]>
Commit | Line | Data |
---|---|---|
2d6c6dd1 | 1 | .\" %%%LICENSE_START(PUBLIC_DOMAIN) |
fea681da | 2 | .\" This is in the public domain |
2d6c6dd1 | 3 | .\" %%%LICENSE_END |
6a717e5e | 4 | .\" |
b8efb414 | 5 | .TH LD.SO 8 2016-10-08 "GNU" "Linux Programmer's Manual" |
fea681da MK |
6 | .SH NAME |
7 | ld.so, ld-linux.so* \- dynamic linker/loader | |
a1d5f77c | 8 | .SH SYNOPSIS |
cd6dddf6 | 9 | The dynamic linker can be run either indirectly by running some |
43151de3 MK |
10 | dynamically linked program or shared object |
11 | (in which case no command-line options | |
a1d5f77c MK |
12 | to the dynamic linker can be passed and, in the ELF case, the dynamic linker |
13 | which is stored in the | |
14 | .B .interp | |
15 | section of the program is executed) or directly by running: | |
16 | .P | |
17 | .I /lib/ld-linux.so.* | |
18 | [OPTIONS] [PROGRAM [ARGUMENTS]] | |
fea681da MK |
19 | .SH DESCRIPTION |
20 | The programs | |
21 | .B ld.so | |
22 | and | |
23 | .B ld-linux.so* | |
43151de3 MK |
24 | find and load the shared objects (shared libraries) needed by a program, |
25 | prepare the program to run, and then run it. | |
fea681da MK |
26 | .LP |
27 | Linux binaries require dynamic linking (linking at run time) | |
28 | unless the | |
29 | .B \-static | |
30 | option was given to | |
f19a0f03 | 31 | .BR ld (1) |
fea681da MK |
32 | during compilation. |
33 | .LP | |
34 | The program | |
35 | .B ld.so | |
36 | handles a.out binaries, a format used long ago; | |
37 | .B ld-linux.so* | |
d8d00ab7 MK |
38 | (\fI/lib/ld-linux.so.1\fP for libc5, \fI/lib/ld-linux.so.2\fP for glibc2) |
39 | handles ELF, | |
40 | which everybody has been using for years now. | |
2b9b829d | 41 | Otherwise, both have the same behavior, and use the same |
fea681da MK |
42 | support files and programs |
43 | .BR ldd (1), | |
9af134cd | 44 | .BR ldconfig (8), |
fea681da MK |
45 | and |
46 | .IR /etc/ld.so.conf . | |
47 | .LP | |
43151de3 | 48 | When resolving shared object dependencies, |
15d116d5 MK |
49 | the dynamic linker first inspects each dependency |
50 | string to see if it contains a slash (this can occur if | |
43151de3 | 51 | a shared object pathname containing slashes was specified at link time). |
15d116d5 MK |
52 | If a slash is found, then the dependency string is interpreted as |
53 | a (relative or absolute) pathname, | |
43151de3 | 54 | and the shared object is loaded using that pathname. |
15d116d5 | 55 | .LP |
43151de3 | 56 | If a shared object dependency does not contain a slash, |
15d116d5 | 57 | then it is searched for in the following order: |
cd6dddf6 | 58 | .IP o 3 |
dc4b358f | 59 | Using the directories specified in the |
cd6dddf6 | 60 | DT_RPATH dynamic section attribute |
fea681da MK |
61 | of the binary if present and DT_RUNPATH attribute does not exist. |
62 | Use of DT_RPATH is deprecated. | |
63 | .IP o | |
64 | Using the environment variable | |
24fb0923 MK |
65 | .BR LD_LIBRARY_PATH |
66 | (unless the executable is being run in secure-execution mode; see below). | |
880f5b4b | 67 | in which case it is ignored. |
fea681da | 68 | .IP o |
dc4b358f | 69 | Using the directories specified in the |
cd6dddf6 | 70 | DT_RUNPATH dynamic section attribute |
fea681da MK |
71 | of the binary if present. |
72 | .IP o | |
73 | From the cache file | |
de6d7600 | 74 | .IR /etc/ld.so.cache , |
43151de3 | 75 | which contains a compiled list of candidate shared objects previously found |
c13182ef | 76 | in the augmented library path. |
cd6dddf6 | 77 | If, however, the binary was linked with the |
4d9b6984 | 78 | .B \-z nodeflib |
43151de3 MK |
79 | linker option, shared objects in the default paths are skipped. |
80 | Shared objects installed in hardware capability directories (see below) | |
81 | are preferred to other shared objects. | |
fea681da MK |
82 | .IP o |
83 | In the default path | |
8478ee02 | 84 | .IR /lib , |
fea681da | 85 | and then |
8478ee02 | 86 | .IR /usr/lib . |
39a15561 | 87 | (On some 64-bit architectures, the default paths for 64-bit shared objects are |
b9359c7a MK |
88 | .IR /lib64 , |
89 | and then | |
90 | .IR /usr/lib64 .) | |
cd6dddf6 | 91 | If the binary was linked with the |
4d9b6984 | 92 | .B \-z nodeflib |
fea681da | 93 | linker option, this step is skipped. |
eeb25d47 | 94 | .SS Rpath token expansion |
0a216931 MK |
95 | .PP |
96 | .B ld.so | |
eeb25d47 MK |
97 | understands certain strings in an rpath specification (DT_RPATH or DT_RUNPATH); those strings are substituted as follows |
98 | .TP | |
99 | .IR $ORIGIN " (or equivalently " ${ORIGIN} ) | |
8a94e783 | 100 | This expands to |
43151de3 | 101 | the directory containing the program or shared object. |
0a216931 MK |
102 | Thus, an application located in |
103 | .I somedir/app | |
104 | could be compiled with | |
eeb25d47 | 105 | |
5c977011 | 106 | gcc \-Wl,\-rpath,\(aq$ORIGIN/../lib\(aq |
eeb25d47 | 107 | |
43151de3 | 108 | so that it finds an associated shared object in |
0a216931 | 109 | .I somedir/lib |
988db661 MK |
110 | no matter where |
111 | .I somedir | |
0a216931 MK |
112 | is located in the directory hierarchy. |
113 | This facilitates the creation of "turn-key" applications that | |
114 | do not need to be installed into special directories, | |
115 | but can instead be unpacked into any directory | |
43151de3 | 116 | and still find their own shared objects. |
909df276 MK |
117 | .TP |
118 | .IR $LIB " (or equivalently " ${LIB} ) | |
119 | This expands to | |
120 | .I lib | |
121 | or | |
122 | .I lib64 | |
123 | depending on the architecture | |
124 | (e.g., on x86-64, it expands to | |
125 | .IR lib64 | |
126 | and | |
127 | on x86-32, it expands to | |
128 | .IR lib ). | |
3f2f2461 MK |
129 | .TP |
130 | .IR $PLATFORM " (or equivalently " ${PLATFORM} ) | |
131 | This expands to a string corresponding to the processor type | |
132 | of the host system (e.g., "x86_64"). | |
133 | On some architectures, the Linux kernel doesn't provide a platform | |
134 | string to the dynamic linker. | |
135 | The value of this string is taken from the | |
136 | .BR AT_PLATFORM | |
137 | value in the auxiliary vector (see | |
138 | .BR getauxval (3)). | |
139 | .\" To get an idea of the places that $PLATFORM would match, | |
140 | .\" look at the output of the following: | |
0a216931 | 141 | .\" |
3f2f2461 MK |
142 | .\" mkdir /tmp/d |
143 | .\" LD_LIBRARY_PATH=/tmp/d strace -e open /bin/date 2>&1 | grep /tmp/d | |
0a216931 MK |
144 | .\" |
145 | .\" ld.so lets names be abbreviated, so $O will work for $ORIGIN; | |
146 | .\" Don't do this!! | |
9d4869b3 | 147 | .SH OPTIONS |
fea681da | 148 | .TP |
4d9b6984 | 149 | .B \-\-list |
fea681da MK |
150 | List all dependencies and how they are resolved. |
151 | .TP | |
4d9b6984 | 152 | .B \-\-verify |
fea681da MK |
153 | Verify that program is dynamically linked and this dynamic linker can handle |
154 | it. | |
155 | .TP | |
495dadb7 | 156 | .B \-\-inhibit-cache |
8584e381 MK |
157 | Do not use |
158 | .IR /etc/ld.so.cache . | |
495dadb7 | 159 | .TP |
a831ad17 MK |
160 | .BI \-\-library\-path " path" |
161 | Use | |
162 | .I path | |
163 | instead of | |
fea681da MK |
164 | .B LD_LIBRARY_PATH |
165 | environment variable setting (see below). | |
0a8909c4 MK |
166 | The names |
167 | .IR ORIGIN , | |
168 | .IR LIB , | |
169 | and | |
170 | .IR PLATFORM | |
171 | are interpreted as for the | |
172 | .BR LD_LIBRARY_PATH | |
173 | environment variable. | |
fea681da | 174 | .TP |
a831ad17 MK |
175 | .BI \-\-inhibit\-rpath " list" |
176 | Ignore RPATH and RUNPATH information in object names in | |
177 | .IR list . | |
6e1064d3 | 178 | This option is ignored when running in secure-execution mode (see below). |
608dce1f | 179 | .TP |
a831ad17 MK |
180 | .BI \-\-audit " list" |
181 | Use objects named in | |
182 | .I list | |
183 | as auditors. | |
fea681da | 184 | .SH ENVIRONMENT |
6e1064d3 | 185 | Various environment variables influence the operation of the dynamic linker. |
9894eac3 MK |
186 | .\" |
187 | .SS Secure-execution mode | |
188 | For security reasons, | |
189 | the effects of some environment variables are voided or modified if | |
190 | the dynamic linker determines that the binary should be | |
191 | run in secure-execution mode. | |
192 | This determination is made by checking whether the | |
193 | .B AT_SECURE | |
194 | entry in the auxiliary vector (see | |
195 | .BR getauxval (3)) | |
196 | has a nonzero value. | |
197 | This entry may have a nonzero value for various reasons, including: | |
198 | .IP * 3 | |
199 | The process's real and effective user IDs differ, | |
200 | or the real and effective group IDs differ. | |
c93f2202 | 201 | This typically occurs as a result of executing |
9894eac3 MK |
202 | a set-user-ID or set-group-ID program. |
203 | .IP * | |
204 | A process with a non-root user ID executed a binary that | |
205 | conferred permitted or effective capabilities. | |
206 | .IP * | |
207 | A nonzero value may have been set by a Linux Security Module. | |
208 | .\" | |
209 | .SS Environment variables | |
6f6a4840 | 210 | Among the more important environment variables are the following: |
fea681da | 211 | .TP |
9a741b5b | 212 | .BR LD_ASSUME_KERNEL " (since glibc 2.2.3)" |
43151de3 | 213 | Each shared object can inform the dynamic linker of the minimum kernel ABI |
eeb25d47 | 214 | version that it requires. |
ef74d4ad MK |
215 | (This requirement is encoded in an ELF note section that is viewable via |
216 | .IR "readelf\ \-n" | |
217 | as a section labeled | |
218 | .BR NT_GNU_ABI_TAG .) | |
eeb25d47 MK |
219 | At run time, |
220 | the dynamic linker determines the ABI version of the running kernel and | |
43151de3 | 221 | will reject loading shared objects that specify minimum ABI versions |
eeb25d47 MK |
222 | that exceed that ABI version. |
223 | ||
224 | .BR LD_ASSUME_KERNEL | |
225 | can be used to | |
226 | cause the dynamic linker to assume that it is running on a system with | |
227 | a different kernel ABI version. | |
228 | For example, the following command line causes the | |
229 | dynamic linker to assume it is running on Linux 2.2.5 when loading | |
43151de3 | 230 | the shared objects required by |
eeb25d47 MK |
231 | .IR myprog : |
232 | ||
233 | .in +4n | |
234 | .nf | |
235 | $ \fBLD_ASSUME_KERNEL=2.2.5 ./myprog\fP | |
236 | .fi | |
237 | .in | |
238 | ||
43151de3 | 239 | On systems that provide multiple versions of a shared object |
eeb25d47 MK |
240 | (in different directories in the search path) that have |
241 | different minimum kernel ABI version requirements, | |
242 | .BR LD_ASSUME_KERNEL | |
43151de3 | 243 | can be used to select the version of the object that is used |
eeb25d47 MK |
244 | (dependent on the directory search order). |
245 | Historically, the most common use of the | |
8a94e783 | 246 | .BR LD_ASSUME_KERNEL |
eeb25d47 MK |
247 | feature was to manually select the older |
248 | LinuxThreads POSIX threads implementation on systems that provided both | |
249 | LinuxThreads and NPTL | |
260c8fcd MK |
250 | (which latter was typically the default on such systems); |
251 | see | |
252 | .BR pthreads (7). | |
eeb25d47 | 253 | .TP |
9a741b5b | 254 | .BR LD_BIND_NOW " (since glibc 2.1.1)" |
aa796481 | 255 | If set to a nonempty string, |
e1725521 MK |
256 | causes the dynamic linker to resolve all symbols |
257 | at program startup instead of deferring function call resolution to the point | |
258 | when they are first referenced. | |
259 | This is useful when using a debugger. | |
260 | .TP | |
fea681da | 261 | .B LD_LIBRARY_PATH |
75c2bb63 | 262 | A list of directories in which to search for |
fea681da | 263 | ELF libraries at execution-time. |
75c2bb63 | 264 | The items in the list are separated by either colons or semicolons. |
c13182ef | 265 | Similar to the |
fea681da MK |
266 | .B PATH |
267 | environment variable. | |
6e1064d3 | 268 | This variable is ignored in secure-execution mode. |
0a8909c4 MK |
269 | |
270 | Within the pathnames specified in | |
271 | .BR LD_LIBRARY_PATH , | |
272 | the dynamic linker expands the strings | |
273 | .IR $ORIGIN , | |
274 | .IR $LIB , | |
275 | and | |
276 | .IR $PLATFORM | |
277 | (or the versions using curly braces around the names) | |
278 | as described above in | |
279 | .IR "Rpath token expansion" . | |
280 | Thus, for example, | |
281 | the following would cause a library to be searched for in either the | |
282 | .I lib | |
283 | or | |
284 | .I lib64 | |
285 | subdirectory below the directory containing the program to be executed: | |
286 | ||
287 | $ \fBLD_LIBRARY_PATH='$ORIGIN/$LIB' prog\fP | |
288 | ||
289 | (Note the use of single quotes, which prevent expansion of | |
290 | .I ORIGIN | |
291 | and | |
292 | .I LIB | |
293 | as shell variables!) | |
fea681da MK |
294 | .TP |
295 | .B LD_PRELOAD | |
df7ef267 | 296 | A list of additional, user-specified, ELF shared |
43151de3 | 297 | objects to be loaded before all others. |
df7ef267 | 298 | The items of the list can be separated by spaces or colons. |
43151de3 MK |
299 | This can be used to selectively override functions in other shared objects. |
300 | The objects are searched for using the rules given under DESCRIPTION. | |
24fb0923 | 301 | In secure-execution mode, |
eb58a74c | 302 | preload pathnames containing slashes are ignored, |
8e7a186a MK |
303 | and only shared objects in the standard search directories that |
304 | have the set-user-ID mode bit enabled are loaded. | |
0a8909c4 MK |
305 | |
306 | Within the pathnames specified in | |
307 | .BR LD_PRELOAD , | |
308 | the dynamic linker understands the strings | |
309 | .IR $ORIGIN , | |
310 | .IR $LIB , | |
311 | and | |
312 | .IR $PLATFORM | |
313 | (or the versions using curly braces around the names) | |
314 | as described above in | |
315 | .IR "Rpath token expansion" . | |
316 | .\" Tested with the following: | |
317 | .\" | |
318 | .\" LD_PRELOAD='$LIB/libmod.so' LD_LIBRARY_PATH=. ./prog | |
319 | .\" | |
320 | .\" which will reload the libmod.so in 'lib' or 'lib64', using it | |
321 | .\" in preference to the version in '.'. | |
fea681da | 322 | .TP |
dc4b358f | 323 | .BR LD_TRACE_LOADED_OBJECTS |
01132bd6 | 324 | If set (to any value), causes the program to list its dynamic |
fea681da MK |
325 | dependencies, as if run by |
326 | .BR ldd (1), | |
327 | instead of running normally. | |
328 | .LP | |
329 | Then there are lots of more or less obscure variables, | |
330 | many obsolete or only for internal use. | |
331 | .TP | |
9a741b5b | 332 | .BR LD_AUDIT " (since glibc 2.4)" |
54eb2620 PB |
333 | A colon-separated list of user-specified, ELF shared objects |
334 | to be loaded before all others in a separate linker namespace | |
335 | (i.e., one that does not intrude upon the normal symbol bindings that | |
336 | would occur in the process). | |
43151de3 | 337 | These objects can be used to audit the operation of the dynamic linker. |
54eb2620 | 338 | .B LD_AUDIT |
24fb0923 | 339 | is ignored in secure-execution mode. |
54eb2620 PB |
340 | |
341 | The dynamic linker will notify the audit | |
43151de3 MK |
342 | shared objects at so-called auditing checkpoints\(emfor example, |
343 | loading a new shared object, resolving a symbol, | |
54eb2620 | 344 | or calling a symbol from another shared object\(emby |
43151de3 | 345 | calling an appropriate function within the audit shared object. |
54eb2620 PB |
346 | For details, see |
347 | .BR rtld-audit (7). | |
348 | The auditing interface is largely compatible with that provided on Solaris, | |
349 | as described in its | |
350 | .IR "Linker and Libraries Guide" , | |
351 | in the chapter | |
352 | .IR "Runtime Linker Auditing Interface" . | |
fea681da | 353 | .TP |
9a741b5b | 354 | .BR LD_BIND_NOT " (since glibc 2.1.95)" |
963c1947 MK |
355 | If this environment variable is set to a nonempty string, |
356 | do not update the GOT (global offset table) and PLT (procedure linkage table) | |
fea681da MK |
357 | after resolving a symbol. |
358 | .TP | |
9a741b5b | 359 | .BR LD_DEBUG " (since glibc 2.1)" |
fea681da MK |
360 | Output verbose debugging information about the dynamic linker. |
361 | If set to | |
a3fb5696 MK |
362 | .BR all , |
363 | print all debugging information, | |
d81099fb MK |
364 | Setting this variable to |
365 | .BR help | |
366 | does not run the specified program, | |
367 | and displays a help message about which categories can be specified in this | |
fea681da | 368 | environment variable. |
d81099fb MK |
369 | The categories are: |
370 | .RS | |
371 | .TP 12 | |
372 | .I bindings | |
373 | Display information about which definition each symbol is bound to. | |
374 | .TP | |
375 | .I files | |
376 | Display progress for input file. | |
377 | .TP | |
378 | .I libs | |
379 | Display library search paths. | |
380 | .TP | |
381 | .I reloc | |
382 | Display relocation processing. | |
383 | .TP | |
384 | .I scopes | |
385 | Display scope information. | |
386 | .TP | |
387 | .I statistics | |
388 | Display relocation statistics. | |
389 | .TP | |
390 | .I symbols | |
391 | Display search paths for each symbol look-up. | |
392 | .TP | |
393 | .I unused | |
394 | Determine unused DSOs. | |
395 | .TP | |
396 | .I versions | |
397 | Display version dependencies. | |
398 | .RE | |
399 | .IP | |
400 | The value in | |
401 | .BR LD_DEBUG | |
402 | can specify multiple categories, separated by colons, commas, | |
403 | or (if the value is quoted) spaces. | |
404 | ||
e4c14bd9 MK |
405 | Since glibc 2.3.4, |
406 | .B LD_DEBUG | |
ae861bf1 MG |
407 | is ignored in secure-execution mode, unless the file |
408 | .IR /etc/suid\-debug | |
409 | exists (the content of the file is irrelevant). | |
fea681da | 410 | .TP |
9a741b5b | 411 | .BR LD_DEBUG_OUTPUT " (since glibc 2.1)" |
70e26d29 | 412 | File in which |
fea681da | 413 | .B LD_DEBUG |
70e26d29 | 414 | output should be written. |
a3e50dc1 | 415 | The default is standard error. |
097585ed | 416 | .B LD_DEBUG_OUTPUT |
24fb0923 | 417 | is ignored in secure-execution mode. |
fea681da | 418 | .TP |
9a741b5b | 419 | .BR LD_DYNAMIC_WEAK " (since glibc 2.1.91)" |
963c1947 MK |
420 | If this environment variable is defined (with any value), |
421 | allow weak symbols to be overridden (reverting to old glibc behavior). | |
c595ec7e MK |
422 | .\" See weak handling |
423 | .\" https://www.sourceware.org/ml/libc-hacker/2000-06/msg00029.html | |
424 | .\" To: GNU libc hacker <libc-hacker at sourceware dot cygnus dot com> | |
425 | .\" Subject: weak handling | |
426 | .\" From: Ulrich Drepper <drepper at redhat dot com> | |
427 | .\" Date: 07 Jun 2000 20:08:12 -0700 | |
428 | .\" Reply-To: drepper at cygnus dot com (Ulrich Drepper) | |
6e1064d3 | 429 | Since glibc 2.3.4, |
e1725521 | 430 | .B LD_DYNAMIC_WEAK |
24fb0923 | 431 | is ignored in secure-execution mode. |
e1725521 | 432 | .TP |
9a741b5b | 433 | .BR LD_HWCAP_MASK " (since glibc 2.1)" |
e1725521 MK |
434 | Mask for hardware capabilities. |
435 | .TP | |
9a741b5b | 436 | .BR LD_ORIGIN_PATH " (since glibc 2.1)" |
71ffb3ed | 437 | Path where the binary is found. |
24fb0923 | 438 | Since glibc 2.4, |
e1725521 | 439 | .B LD_ORIGIN_PATH |
24fb0923 | 440 | is ignored in secure-execution mode. |
e613d016 | 441 | .\" Used only if $ORIGIN can't be determined by normal means |
e1725521 | 442 | .\" (from the origin path saved at load time, or from /proc/self/exe)? |
7b0cacbb | 443 | .TP |
bdf75f3e | 444 | .BR LD_POINTER_GUARD " (glibc from 2.4 to 2.22)" |
7b0cacbb PB |
445 | Set to 0 to disable pointer guarding. |
446 | Any other value enables pointer guarding, which is also the default. | |
447 | Pointer guarding is a security mechanism whereby some pointers to code | |
448 | stored in writable program memory (return addresses saved by | |
449 | .BR setjmp (3) | |
450 | or function pointers used by various glibc internals) are mangled | |
451 | semi-randomly to make it more difficult for an attacker to hijack | |
452 | the pointers for use in the event of a buffer overrun or | |
453 | stack-smashing attack. | |
ca1c3729 MK |
454 | Since glibc 2.23, |
455 | .\" commit a014cecd82b71b70a6a843e250e06b541ad524f7 | |
456 | .B LD_POINTER_GUARD | |
457 | can no longer be used to disable pointer guarding, | |
458 | which is now always enabled. | |
fea681da | 459 | .TP |
9a741b5b | 460 | .BR LD_PROFILE " (since glibc 2.1)" |
7c7a7df3 | 461 | The name of a (single) shared object to be profiled, |
8a7f3759 | 462 | specified either as a pathname or a soname. |
c64ea262 | 463 | Profiling output is appended to the file whose name is: |
8a7f3759 | 464 | "\fI$LD_PROFILE_OUTPUT\fP/\fI$LD_PROFILE\fP.profile". |
fea681da | 465 | .TP |
9a741b5b | 466 | .BR LD_PROFILE_OUTPUT " (since glibc 2.1)" |
8a7f3759 | 467 | Directory where |
fea681da | 468 | .B LD_PROFILE |
8a7f3759 MK |
469 | output should be written. |
470 | If this variable is not defined, or is defined as an empty string, | |
471 | then the default is | |
472 | .IR /var/tmp . | |
097585ed | 473 | .B LD_PROFILE_OUTPUT |
8977c66c MK |
474 | is ignored in secure-execution mode; instead |
475 | .IR /var/profile | |
476 | is always used. | |
fea681da | 477 | .TP |
9a741b5b | 478 | .BR LD_SHOW_AUXV " (since glibc 2.1)" |
b5ccc9bb MK |
479 | If this environment variable is defined (with any value), |
480 | show the auxiliary array passed up from the kernel (see also | |
481 | .BR getauxval (3)). | |
24fb0923 | 482 | Since glibc 2.3.5, |
ca2bcde1 | 483 | .B LD_SHOW_AUXV |
24fb0923 | 484 | is ignored in secure-execution mode. |
de2a932a | 485 | .TP |
9a741b5b | 486 | .BR LD_TRACE_PRELINKING " (since glibc 2.4)" |
a5817257 MK |
487 | If this environment variable is defined (with any value), |
488 | trace prelinking of the object whose name is assigned to | |
de2a932a MK |
489 | this environment variable. |
490 | (Use | |
491 | .BR ldd (1) | |
492 | to get a list of the objects that might be traced.) | |
493 | If the object name is not recognized, | |
494 | .\" (This is what seems to happen, from experimenting) | |
495 | then all prelinking activity is traced. | |
fea681da | 496 | .TP |
9a741b5b | 497 | .BR LD_USE_LOAD_BIAS " (since glibc 2.3.3)" |
e1725521 MK |
498 | .\" http://sources.redhat.com/ml/libc-hacker/2003-11/msg00127.html |
499 | .\" Subject: [PATCH] Support LD_USE_LOAD_BIAS | |
500 | .\" Jakub Jelinek | |
2656a3fa | 501 | By default (i.e., if this variable is not defined), |
e1725521 | 502 | executables and prelinked |
43151de3 | 503 | shared objects will honor base addresses of their dependent shared objects |
24b74457 | 504 | and (nonprelinked) position-independent executables (PIEs) |
e1725521 MK |
505 | and other shared objects will not honor them. |
506 | If | |
507 | .B LD_USE_LOAD_BIAS | |
dc70d1ea | 508 | is defined with the value 1, both executables and PIEs |
e1725521 MK |
509 | will honor the base addresses. |
510 | If | |
511 | .B LD_USE_LOAD_BIAS | |
512 | is defined with the value 0, | |
513 | neither executables nor PIEs will honor the base addresses. | |
24fb0923 | 514 | This variable is ignored in secure-execution mode. |
fea681da | 515 | .TP |
9a741b5b | 516 | .BR LD_VERBOSE " (since glibc 2.1)" |
aa796481 | 517 | If set to a nonempty string, |
e1725521 | 518 | output symbol versioning information about the |
2216fac7 | 519 | program if the |
e1725521 | 520 | .B LD_TRACE_LOADED_OBJECTS |
2216fac7 | 521 | environment variable has been set. |
fea681da | 522 | .TP |
dc4b358f | 523 | .BR LD_WARN " (since glibc 2.1.3) |
aa796481 | 524 | If set to a nonempty string, warn about unresolved symbols. |
fea681da | 525 | .TP |
9a741b5b | 526 | .BR LD_PREFER_MAP_32BIT_EXEC " (x86-64 only; since glibc 2.23)" |
3cdc1fc4 | 527 | According to the Intel Silvermont software optimization guide, for 64-bit |
5b479f37 L |
528 | applications, branch prediction performance can be negatively impacted |
529 | when the target of a branch is more than 4GB away from the branch. | |
3cdc1fc4 MK |
530 | If this environment variable is set (to any value), |
531 | .BR ld.so | |
532 | will first try to map executable pages using the | |
533 | .BR mmap (2) | |
534 | .BR MAP_32BIT | |
535 | flag, and fall back to mapping without that flag if that attempt fails. | |
81583be9 | 536 | NB: MAP_32BIT will map to the low 2GB (not 4GB) of the address space. |
3cdc1fc4 MK |
537 | Because |
538 | .B MAP_32BIT | |
539 | reduces the address range available for address space layout | |
540 | randomization (ASLR), | |
541 | .B LD_PREFER_MAP_32BIT_EXEC | |
542 | is always disabled in secure-execution mode. | |
fea681da MK |
543 | .SH FILES |
544 | .PD 0 | |
545 | .TP | |
8478ee02 | 546 | .I /lib/ld.so |
fea681da MK |
547 | a.out dynamic linker/loader |
548 | .TP | |
8478ee02 | 549 | .IR /lib/ld\-linux.so. { 1 , 2 } |
fea681da MK |
550 | ELF dynamic linker/loader |
551 | .TP | |
8478ee02 | 552 | .I /etc/ld.so.cache |
fea681da | 553 | File containing a compiled list of directories in which to search for |
43151de3 | 554 | shared objects and an ordered list of candidate shared objects. |
fea681da | 555 | .TP |
8478ee02 | 556 | .I /etc/ld.so.preload |
43151de3 | 557 | File containing a whitespace-separated list of ELF shared objects to |
fea681da | 558 | be loaded before the program. |
fea681da MK |
559 | .TP |
560 | .B lib*.so* | |
43151de3 | 561 | shared objects |
fea681da MK |
562 | .PD |
563 | .SH NOTES | |
8ce45022 | 564 | .SS Hardware capabilities |
43151de3 | 565 | Some shared objects are compiled using hardware-specific instructions which do |
8ce45022 | 566 | not exist on every CPU. |
43151de3 | 567 | Such objects should be installed in directories whose names define the |
8ce45022 MK |
568 | required hardware capabilities, such as |
569 | .IR /usr/lib/sse2/ . | |
570 | The dynamic linker checks these directories against the hardware of the | |
43151de3 | 571 | machine and selects the most suitable version of a given shared object. |
8ce45022 MK |
572 | Hardware capability directories can be cascaded to combine CPU features. |
573 | The list of supported hardware capability names depends on the CPU. | |
574 | The following names are currently recognized: | |
575 | .TP | |
576 | .B Alpha | |
577 | ev4, ev5, ev56, ev6, ev67 | |
578 | .TP | |
579 | .B MIPS | |
580 | loongson2e, loongson2f, octeon, octeon2 | |
581 | .TP | |
582 | .B PowerPC | |
583 | 4xxmac, altivec, arch_2_05, arch_2_06, booke, cellbe, dfp, efpdouble, efpsingle, | |
584 | fpu, ic_snoop, mmu, notb, pa6t, power4, power5, power5+, power6x, ppc32, ppc601, | |
585 | ppc64, smt, spe, ucache, vsx | |
586 | .TP | |
587 | .B SPARC | |
588 | flush, muldiv, stbar, swap, ultra3, v9, v9v, v9v2 | |
589 | .TP | |
590 | .B s390 | |
591 | dfp, eimm, esan3, etf3enh, g5, highgprs, hpage, ldisp, msa, stfle, | |
592 | z900, z990, z9-109, z10, zarch | |
593 | .TP | |
594 | .B x86 (32-bit only) | |
595 | acpi, apic, clflush, cmov, cx8, dts, fxsr, ht, i386, i486, i586, i686, mca, mmx, | |
596 | mtrr, pat, pbe, pge, pn, pse36, sep, ss, sse, sse2, tm | |
fea681da | 597 | .SH SEE ALSO |
6b432477 | 598 | .BR ld (1), |
fea681da | 599 | .BR ldd (1), |
1a7735bb | 600 | .BR pldd (1), |
cf28f98a | 601 | .BR sprof (1), |
639c8860 | 602 | .BR dlopen (3), |
45fa8fcb | 603 | .BR getauxval (3), |
9894eac3 | 604 | .BR capabilities (7), |
c18ecec9 | 605 | .BR rtld-audit (7), |
4d96fe33 MK |
606 | .BR ldconfig (8), |
607 | .BR sln (8) | |
fea681da MK |
608 | .\" .SH AUTHORS |
609 | .\" ld.so: David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus | |
610 | .\" Torvalds, Lars Wirzenius and Mitch D'Souza | |
611 | .\" ld-linux.so: Roland McGrath, Ulrich Drepper and others. | |
612 | .\" | |
613 | .\" In the above, (libc5) stands for David Engel's ld.so/ld-linux.so. |