[PATCH] Resend: Add a new chapter on the dynamic linker
Joseph Myers
joseph@codesourcery.com
Fri Oct 13 00:29:00 GMT 2017
Also: the documentation of RPATH and RUNPATH seems to be missing what I
think of as the key difference: a RUNPATH is only used to locate objects
listed as NEEDED in the same executable or shared library that has the
RUNPATH, whereas the RPATH of the executable (and those of intermediate
shared libraries) gets used to search for indirect shared library
dependencies.
(This is also why I'm dubious of deprecation of RPATH. If you want to use
libraries from a non-default sysroot, you can link an executable with
-Wl,-dynamic-linker,/sysroot/path-to-ld.so
-Wl,-rpath,/sysroot/lib:/sysroot/usr/lib (or similar), and all required
libraries, whether direct or indirect dependencies, will be loaded from
the sysroot if present there. This only works with RPATH semantics, not
RUNPATH semantics.)
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list