]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" This is in the public domain |
2 | .TH LD.SO 8 2001-12-16 "" "Linux Programmer's Manual" | |
3 | .SH NAME | |
4 | ld.so, ld-linux.so* \- dynamic linker/loader | |
5 | .SH DESCRIPTION | |
6 | The programs | |
7 | .B ld.so | |
8 | and | |
9 | .B ld-linux.so* | |
10 | find and load the shared libraries needed by a program, prepare | |
11 | the program to run, and then run it. | |
12 | .LP | |
13 | Linux binaries require dynamic linking (linking at run time) | |
14 | unless the | |
15 | .B \-static | |
16 | option was given to | |
17 | .B ld | |
18 | during compilation. | |
19 | .LP | |
20 | The program | |
21 | .B ld.so | |
22 | handles a.out binaries, a format used long ago; | |
23 | .B ld-linux.so* | |
24 | handles ELF (\fB/lib/ld-linux.so.1\fP for libc5, \fB/lib/ld-linux.so.2\fP | |
25 | for glibc2), which everybody has been using for years now. | |
26 | Otherwise both have the same behaviour, and use the same | |
27 | support files and programs | |
28 | .BR ldd (1), | |
29 | .BR ldconfig (8) | |
30 | and | |
31 | .IR /etc/ld.so.conf . | |
32 | .LP | |
33 | The shared libraries needed by the program are searched for | |
34 | in various places: | |
35 | .IP o | |
36 | (ELF only) Using the DT_RPATH dynamic section attribute | |
37 | of the binary if present and DT_RUNPATH attribute does not exist. | |
38 | Use of DT_RPATH is deprecated. | |
39 | .IP o | |
40 | Using the environment variable | |
41 | .BR LD_LIBRARY_PATH . | |
42 | Except if the executable is a setuid/setgid binary, in which case it | |
43 | is ignored. | |
44 | .IP o | |
45 | (ELF only) Using the DT_RUNPATH dynamic section attribute | |
46 | of the binary if present. | |
47 | .IP o | |
48 | From the cache file | |
49 | .BR /etc/ld.so.cache | |
50 | which contains a compiled list of candidate libraries previously found | |
51 | in the augmented library path. If, however, the binary was linked with | |
52 | .B -z nodeflib | |
53 | linker option, libraries in the default library paths are skipped. | |
54 | .IP o | |
55 | In the default path | |
56 | .BR /lib , | |
57 | and then | |
58 | .BR /usr/lib . | |
59 | If the binary was linked with | |
60 | .B -z nodeflib | |
61 | linker option, this step is skipped. | |
62 | .SH SYNOPSIS | |
63 | The dynamic linker can be run either indirectly through running some | |
64 | dynamically linked program or library (in which case no command line options | |
65 | to the dynamic linker can be passed and, in the ELF case, the dynamic linker | |
66 | which is stored in the | |
67 | .B .interp | |
68 | section of the program is executed) or directly by running: | |
69 | .P | |
70 | .B /lib/ld-linux.so.* | |
71 | [OPTIONS] [PROGRAM [ARGUMENTS]] | |
72 | .SH COMMAND LINE OPTIONS | |
73 | .TP | |
74 | .B --list | |
75 | List all dependencies and how they are resolved. | |
76 | .TP | |
77 | .B --verify | |
78 | Verify that program is dynamically linked and this dynamic linker can handle | |
79 | it. | |
80 | .TP | |
81 | .B --library-path PATH | |
82 | Override | |
83 | .B LD_LIBRARY_PATH | |
84 | environment variable setting (see below). | |
85 | .TP | |
86 | .B --ignore-rpath LIST | |
87 | Ignore RPATH and RUNPATH information in object names in LIST. | |
88 | This option has been supported by glibc2 for about one hour. | |
89 | Then it was renamed into: | |
90 | .TP | |
91 | .B --inhibit-rpath LIST | |
92 | .SH ENVIRONMENT | |
93 | There are four important environment variables. | |
94 | .TP | |
95 | .B LD_LIBRARY_PATH | |
96 | A colon-separated list of directories in which to search for | |
97 | ELF libraries at execution-time. | |
98 | Similar to the | |
99 | .B PATH | |
100 | environment variable. | |
101 | .TP | |
102 | .B LD_PRELOAD | |
103 | A whitespace-separated list of additional, user-specified, ELF shared | |
104 | libraries to be loaded before all others. | |
105 | This can be used to selectively override functions in other shared libraries. | |
106 | For setuid/setgid ELF binaries, only libraries in the standard search | |
107 | directories that are also setuid will be loaded. | |
108 | .TP | |
109 | .B LD_BIND_NOW | |
110 | (libc5; glibc since 2.1.1) | |
111 | If set to non-empty string, causes the dynamic linker to resolve all symbols | |
112 | at program startup instead of deferring function call resolval to the point | |
113 | when they are first referenced. | |
114 | This is useful when using a debugger. | |
115 | .TP | |
116 | .B LD_TRACE_LOADED_OBJECTS | |
117 | (ELF only) | |
118 | If set to non-empty string, causes the program to list its dynamic library | |
119 | dependencies, as if run by | |
120 | .BR ldd (1), | |
121 | instead of running normally. | |
122 | .LP | |
123 | Then there are lots of more or less obscure variables, | |
124 | many obsolete or only for internal use. | |
125 | .TP | |
126 | .B LD_WARN | |
127 | (ELF only)(glibc since 2.1.3) | |
128 | If set to non-empty string, warn about unresolved symbols. | |
129 | .TP | |
130 | .B LD_NOWARN | |
131 | (a.out only)(libc5) | |
132 | Suppress warnings about a.out libraries with incompatible minor | |
133 | version numbers. | |
134 | .TP | |
135 | .B LD_BIND_NOT | |
136 | (glibc since 2.1.95) | |
137 | Do not update the GOT (global offset table) and PLT (procedure linkage table) | |
138 | after resolving a symbol. | |
139 | .TP | |
140 | .B LD_DEBUG | |
141 | (glibc since 2.1) | |
142 | Output verbose debugging information about the dynamic linker. | |
143 | If set to | |
144 | .B all | |
145 | prints all debugging information it has, if set to | |
146 | .B help | |
147 | prints a help message about which categories can be specified in this | |
148 | environment variable. | |
149 | .TP | |
150 | .B LD_DEBUG_OUTPUT | |
151 | (glibc since 2.1) | |
152 | File where | |
153 | .B LD_DEBUG | |
154 | output should be fed into, default is standard output. | |
155 | LD_DEBUG_OUTPUT is ignored for setuid/setgid binaries. | |
156 | .TP | |
157 | .B LD_VERBOSE | |
158 | (glibc since 2.1) | |
159 | If set to non-empty string, output symbol versioning information about the | |
160 | program if querying information about the program (ie. either | |
161 | .B LD_TRACE_LOADED_OBJECTS | |
162 | has been set, or | |
163 | .B --list | |
164 | or | |
165 | .B --verify | |
166 | options have been given to the dynamic linker). | |
167 | .TP | |
168 | .B LD_PROFILE | |
169 | (glibc since 2.1) | |
170 | Shared object to be profiled. | |
171 | .TP | |
172 | .B LD_PROFILE_OUTPUT | |
173 | (glibc since 2.1) | |
174 | File where | |
175 | .B LD_PROFILE | |
176 | output should be stored, default is standard output. | |
177 | LD_DEBUG_OUTPUT is ignored for setuid/setgid binaries. | |
178 | .TP | |
179 | .B LD_AOUT_LIBRARY_PATH | |
180 | (libc5) | |
181 | Version of LD_LIBRARY_PATH for a.out binaries only. | |
182 | Old versions of ld-linux.so.1 also supported LD_ELF_LIBRARY_PATH. | |
183 | .TP | |
184 | .B LD_AOUT_PRELOAD | |
185 | (libc5) | |
186 | Version of LD_PRELOAD for a.out binaries only. | |
187 | Old versions of ld-linux.so.1 also supported LD_ELF_PRELOAD. | |
188 | .TP | |
189 | .B LD_SHOW_AUXV | |
190 | (glibc since 2.1) | |
191 | Show auxiliary array passed up from the kernel. | |
192 | .TP | |
193 | .B LD_HWCAP_MASK | |
194 | (glibc since 2.1) | |
195 | Mask for hardware capabilities. | |
196 | .TP | |
197 | .B LD_ORIGIN_PATH | |
198 | (glibc since 2.1) | |
199 | Path where the binary is found (for non-setuid programs). | |
200 | .TP | |
201 | .B LD_DYNAMIC_WEAK | |
202 | (glibc since 2.1.91) | |
203 | Allow weak symbols to be overridden (reverting to old glibc behaviour). | |
204 | .TP | |
205 | .B LD_KEEPDIR | |
206 | (a.out only)(libc5) | |
207 | Don't ignore the directory in the names of a.out libraries to be loaded. | |
208 | Use of this option is strongly discouraged. | |
209 | .TP | |
210 | .B LDD_ARGV0 | |
211 | (libc5) | |
212 | .IR argv [0] | |
213 | to be used by | |
214 | .BR ldd (1) | |
215 | when none is present. | |
216 | .SH FILES | |
217 | .PD 0 | |
218 | .TP | |
219 | .B /lib/ld.so | |
220 | a.out dynamic linker/loader | |
221 | .TP | |
222 | .BR /lib/ld-linux.so. { 1 , 2 } | |
223 | ELF dynamic linker/loader | |
224 | .TP | |
225 | .B /etc/ld.so.cache | |
226 | File containing a compiled list of directories in which to search for | |
227 | libraries and an ordered list of candidate libraries. | |
228 | .TP | |
229 | .B /etc/ld.so.preload | |
230 | File containing a whitespace separated list of ELF shared libraries to | |
231 | be loaded before the program. | |
232 | libraries and an ordered list of candidate libraries. | |
233 | .TP | |
234 | .B lib*.so* | |
235 | shared libraries | |
236 | .PD | |
237 | .SH NOTES | |
238 | The | |
239 | .B ld.so | |
240 | functionality is available for executables compiled using libc version | |
241 | 4.4.3 or greater. | |
242 | ELF functionality is available since Linux 1.1.52 and libc5. | |
243 | .SH SEE ALSO | |
244 | .BR ldd (1), | |
245 | .BR ldconfig (8) | |
246 | .\" .SH AUTHORS | |
247 | .\" ld.so: David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus | |
248 | .\" Torvalds, Lars Wirzenius and Mitch D'Souza | |
249 | .\" ld-linux.so: Roland McGrath, Ulrich Drepper and others. | |
250 | .\" | |
251 | .\" In the above, (libc5) stands for David Engel's ld.so/ld-linux.so. |