gnu ld searchpath

Mike Frysinger vapier@gentoo.org
Fri May 29 04:12:00 GMT 2015


On 28 May 2015 13:25, Ramana Radhakrishnan wrote:
> > Is this the expected behavior for gnu ld ? And ld.so.conf file entries
> > only affect runtime linker (ld-linux*.so) searchpaths ?
> 
> ld.so.conf has nothing to do with the static linker. It's only used by
> the dynamic linker.

sorry, but that's incorrect.  he is referring to the documentation:
https://sourceware.org/binutils/docs/ld/Options.html
(scan down to the -rpath-link section)

that does cover ld.so.conf, and ld itself does parse it in some cases:
ld/emultempl/elf32.em:
/* For a native linker, check the file /etc/ld.so.conf for directories
   in which we may find shared libraries.  /etc/ld.so.conf is really
   only meaningful on Linux.  */

in many C libraries, /etc/ld.so.conf isn't used by the dynamic linker.  instead 
tools like ldconfig (that you mentioned) parse those paths to generate a cache 
file that the dynamic linker then uses.  i'm sure you knew that, but i figured 
while we're all being pedantic ... ;)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://sourceware.org/pipermail/binutils/attachments/20150529/25835245/attachment.sig>


More information about the Binutils mailing list