1LD.SO(8) Linux Programmer's Manual LD.SO(8)
2
3
4
6 ld.so, ld-linux.so - dynamic linker/loader
7
9 The dynamic linker can be run either indirectly by running some dynami‐
10 cally linked program or shared object (in which case no command-line
11 options to the dynamic linker can be passed and, in the ELF case, the
12 dynamic linker which is stored in the .interp section of the program is
13 executed) or directly by running:
14
15 /lib/ld-linux.so.* [OPTIONS] [PROGRAM [ARGUMENTS]]
16
18 The programs ld.so and ld-linux.so* find and load the shared objects
19 (shared libraries) needed by a program, prepare the program to run, and
20 then run it.
21
22 Linux binaries require dynamic linking (linking at run time) unless the
23 -static option was given to ld(1) during compilation.
24
25 The program ld.so handles a.out binaries, a format used long ago;
26 ld-linux.so* (/lib/ld-linux.so.1 for libc5, /lib/ld-linux.so.2 for
27 glibc2) handles ELF, which everybody has been using for years now.
28 Otherwise, both have the same behavior, and use the same support files
29 and programs as ldd(1), ldconfig(8), and /etc/ld.so.conf.
30
31 When resolving shared object dependencies, the dynamic linker first
32 inspects each dependency string to see if it contains a slash (this can
33 occur if a shared object pathname containing slashes was specified at
34 link time). If a slash is found, then the dependency string is inter‐
35 preted as a (relative or absolute) pathname, and the shared object is
36 loaded using that pathname.
37
38 If a shared object dependency does not contain a slash, then it is
39 searched for in the following order:
40
41 o Using the directories specified in the DT_RPATH dynamic section
42 attribute of the binary if present and DT_RUNPATH attribute does not
43 exist. Use of DT_RPATH is deprecated.
44
45 o Using the environment variable LD_LIBRARY_PATH (unless the exe‐
46 cutable is being run in secure-execution mode; see below). in which
47 case it is ignored.
48
49 o Using the directories specified in the DT_RUNPATH dynamic section
50 attribute of the binary if present. Such directories are searched
51 only to find those objects required by DT_NEEDED (direct dependen‐
52 cies) entries and do not apply to those objects' children, which
53 must themselves have their own DT_RUNPATH entries. This is unlike
54 DT_RPATH, which is applied to searches for all children in the
55 dependency tree.
56
57 o From the cache file /etc/ld.so.cache, which contains a compiled list
58 of candidate shared objects previously found in the augmented
59 library path. If, however, the binary was linked with the -z node‐
60 flib linker option, shared objects in the default paths are skipped.
61 Shared objects installed in hardware capability directories (see
62 below) are prefer