Table of Contentsld.so - a.out dynamic linker/loader ld.so completes the final process of linking all necessary references to sharable objects and unreferenced symbols in an impure executable, (usually a dynamically linked executable), to produce a runnable file. Unless explicitly specified via the -static option to ld during compilation, all Linux binaries in a.out format will be "incomplete" and require further linking at run time. ld.so's job is thus to complete the linking process started at compilation.
The necessary dynamically linked libraries (DLL's) which the executable requires to complete it's linking process are searched for in the following order
- o
- Using the environment variable LD_AOUT_LIBRARY_PATH. Except if the executable is a setuid/setgid binary, in which case it is ignored.
- o
- Using the environment variable LD_LIBRARY_PATH. Except if LD_AOUT_LIBRARY_PATH is specified or the executable is a setuid/setgid binary, in which case it is ignored.
- o
- From the cache file /etc/ld.so.cache which contains a compiled list of candidate libraries previously found in the augmented library path.
- o
- In the default path /usr/lib, and then /lib.
The following, possibly fatal, warnings may be output by ld.so - can't
- If ld.so cannot find the library the executable requires anywhere.
- can't
- If the library is corrupt.
- incompatible
-
- Require
- ld.so cannot use the library version found as it is incompatable with the binary attempting to be executed.
- using
-
- Desire
- Even though the minor version is incompatable ld.so will attempt to use it. This message is suppressed if the environment variable LD_NOWARN is set.
- too
- There is a hard coded limit of 32 search directories. The above warning will ensue it this limit is exceeded.
- dynamic
-
- dynamic
-
- dynamic
- An attempt to perform necessary fixups and or relocations failed. These are usually fatal and signifies possible binary corruption.
- can't
-
- cache
-
- cache
-
- cache
- A problem was encountered with the cache. Execution will continue as if the cache did not exist.
- LD_AOUT_LIBRARY_PATH
- A colon-separated list of directories in which to search for libraries at execution-time. Similar to the PATH environment variable.
- LD_LIBRARY_PATH
- A colon-separated list of directories in which to search for libraries at execution-time if LD_AOUT_LIBRARY_PATH is not specified. Similar to the PATH environment variable.
- LD_NOWARN
- Suppress warnings about libraries with incompatible minor version numbers.
- LD_KEEPDIR
- Don't ignore the directory in the names of libraries to be loaded. Use of this option is strongly discouraged.
- LD_AOUT_PRELOAD
- The name of an additional, user-specified, shared library to be loaded after all others. This can be used to selectively override functions in other shared libraries.
- LD_PRELOAD
- The name of an additional, user-specified, shared library to be loaded after all others if LD_AOUT_PRELOAD is not specified. This can be used to selectively override functions in other shared libraries.
- /lib/ld.so
- execution time linker/loader
- /etc/ld.so.cache
- File containing a compiled list of directories in which to search for libraries and an ordered list of candidate libraries.
- lib*.so.version
- shared libraries
- lib*.sa
- exported initialized library data.
ldd(1), ldconfig(8). Currently ld.so has no means of unloading and searching for compatible or newer version of libraries.
ld.so functionality is only available for executables compiled using libc version 4.4.3 or greater.
David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus Torvalds, Lars Wirzenius and Mitch D'Souza (not necessarily in that order).
Table of Contents
www.fiveanddime.net