From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20997 invoked by alias); 20 Feb 2003 19:41:06 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 20990 invoked from network); 20 Feb 2003 19:41:05 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 172.16.49.205 with SMTP; 20 Feb 2003 19:41:05 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18lyS4-0001Wy-00; Thu, 20 Feb 2003 15:41:56 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18lwYr-00057M-00; Thu, 20 Feb 2003 14:40:49 -0500 Date: Thu, 20 Feb 2003 19:41:00 -0000 From: Daniel Jacobowitz To: Kevin Buettner Cc: Kris Warkentin , gdb@sources.redhat.com Subject: Re: GDB honouring RPATH in binaries. Message-ID: <20030220194049.GA19653@nevyn.them.org> Mail-Followup-To: Kevin Buettner , Kris Warkentin , gdb@sources.redhat.com References: <0db801c2d914$78f80a50$0202040a@catdog> <1030220193301.ZM10611@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1030220193301.ZM10611@localhost.localdomain> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-02/txt/msg00429.txt.bz2 On Thu, Feb 20, 2003 at 12:33:01PM -0700, Kevin Buettner wrote: > On Feb 20, 2:15pm, Kris Warkentin wrote: > > > I've been having a debate with some coworkers about whether or not gdb > > should use the rpath in an elf binary to find shared libs if it has been > > set. The runtime loader checks LD_LIBRARY_PATH, RPATH and CS_LIBPATH in > > that order and the proposal was that gdb should do the same thing. > > > > The problem I have with this is in the remote case. This might make perfect > > sense on a self-hosted debugger but if targetting a remote machine, the > > RPATH might not make any logical mapping onto the host machine's filesystem. > > It might be possible to come up with some sort of heuristic using > > solib-absolute-prefix as a base but I don't think there's any reliable way > > to make use of this info if not self hosted. > > > > Any thoughts? > > The other problem that I see is that the procedures used to resolve > the location of a dynamic library will vary depending upon the runtime > loader. E.g, on Linux, I am pretty sure that RPATH supercedes > LD_LIBRARY_PATH. > > It may make sense to have a osabi dependent method for doing this > resolution. Or maybe this machinery should be tied to the solib > back end. (That way if you had a qnx back end, it would get used > automatically.) > > With regard to the remote case, I would have thought that simply > prepending solib-absolute-prefix would give the correct results. Question: when do we need to find shared libraries that we can't use a full path + solib-absolute-prefix, where RPATH would be in the least useful? RPATH only matters when you have multiple places you could find the library and are interested in which one you got; if there is a mapping between target and host filesystems, it should be solib-absolute-prefix only. We generally get full pathnames of loaded modules from the dynamic linker, and use that. Is this a problem for QNX? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer