This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Hard coding paths to shared libraries
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Rocha Iran-QIR001 <Iran dot Rocha at motorola dot com>
- Cc: "'binutils at sources dot redhat dot com'" <binutils at sources dot redhat dot com>
- Date: Thu, 21 Aug 2003 15:12:33 -0400
- Subject: Re: Hard coding paths to shared libraries
- References: <4D87884B6A6D4E438A8592BCC9C85DCA0634F087@il02exm06.corp.mot.com>
On Thu, Aug 21, 2003 at 01:59:59PM -0500, Rocha Iran-QIR001 wrote:
> I know that hard coding the path to a shared library is probably not a good
> idea. Nevertheless, I would like to know how to do it. For instance:
>
> I see the following in my Solaris machine:
>
> > /bin/ldd /bin/ls
> libc.so.1 => /usr/lib/libc.so.1
> libdl.so.1 => /usr/lib/libdl.so.1
> /usr/platform/SUNW,Ultra-60/lib/libc_psr.so.1
>
> Apparently, the path to libc_psr.so.1 was hard coded into the binary. How
> can I do the same if I want to?
Look up "rpath" in the GNU ld documentation.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer