]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man8/ld.so.8
ld.so.8: Clarify LD_PROFILE in secure-execution mode
[thirdparty/man-pages.git] / man8 / ld.so.8
1 .\" %%%LICENSE_START(PUBLIC_DOMAIN)
2 .\" This is in the public domain
3 .\" %%%LICENSE_END
4 .\" Various parts:
5 .\" Copyright (C) 2007-9, 2013, 2016 Michael Kerrisk <mtk.manpages@gmail.com>
6 .\"
7 .TH ld.so 8 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 ld.so, ld\-linux.so \- dynamic linker/loader
10 .SH SYNOPSIS
11 The dynamic linker can be run either indirectly by running some
12 dynamically linked program or shared object
13 (in which case no command-line options
14 to the dynamic linker can be passed and, in the ELF case, the dynamic linker
15 which is stored in the
16 .B .interp
17 section of the program is executed) or directly by running:
18 .PP
19 .I /lib/ld\-linux.so.*
20 [OPTIONS] [PROGRAM [ARGUMENTS]]
21 .SH DESCRIPTION
22 The programs
23 .B ld.so
24 and
25 .B ld\-linux.so*
26 find and load the shared objects (shared libraries) needed by a program,
27 prepare the program to run, and then run it.
28 .PP
29 Linux binaries require dynamic linking (linking at run time)
30 unless the
31 .B \-static
32 option was given to
33 .BR ld (1)
34 during compilation.
35 .PP
36 The program
37 .B ld.so
38 handles a.out binaries, a binary format used long ago.
39 The program
40 .B ld\-linux.so*
41 (\fI/lib/ld\-linux.so.1\fP for libc5, \fI/lib/ld\-linux.so.2\fP for glibc2)
42 handles binaries that are in the more modern ELF format.
43 Both programs have the same behavior, and use the same
44 support files and programs
45 .RB ( ldd (1),
46 .BR ldconfig (8),
47 and
48 .IR /etc/ld.so.conf ).
49 .PP
50 When resolving shared object dependencies,
51 the dynamic linker first inspects each dependency
52 string to see if it contains a slash (this can occur if
53 a shared object pathname containing slashes was specified at link time).
54 If a slash is found, then the dependency string is interpreted as
55 a (relative or absolute) pathname,
56 and the shared object is loaded using that pathname.
57 .PP
58 If a shared object dependency does not contain a slash,
59 then it is searched for in the following order:
60 .IP (1) 5
61 Using the directories specified in the
62 DT_RPATH dynamic section attribute
63 of the binary if present and DT_RUNPATH attribute does not exist.
64 Use of DT_RPATH is deprecated.
65 .IP (2)
66 Using the environment variable
67 .BR LD_LIBRARY_PATH ,
68 unless the executable is being run in secure-execution mode (see below),
69 in which case this variable is ignored.
70 .IP (3)
71 Using the directories specified in the
72 DT_RUNPATH dynamic section attribute
73 of the binary if present.
74 Such directories are searched only to
75 find those objects required by DT_NEEDED (direct dependencies) entries
76 and do not apply to those objects' children,
77 which must themselves have their own DT_RUNPATH entries.
78 This is unlike DT_RPATH, which is applied
79 to searches for all children in the dependency tree.
80 .IP (4)
81 From the cache file
82 .IR /etc/ld.so.cache ,
83 which contains a compiled list of candidate shared objects previously found
84 in the augmented library path.
85 If, however, the binary was linked with the
86 .B \-z nodefaultlib
87 linker option, shared objects in the default paths are skipped.
88 Shared objects installed in hardware capability directories (see below)
89 are preferred to other shared objects.
90 .IP (5)
91 In the default path
92 .IR /lib ,
93 and then
94 .IR /usr/lib .
95 (On some 64-bit architectures, the default paths for 64-bit shared objects are
96 .IR /lib64 ,
97 and then
98 .IR /usr/lib64 .)
99 If the binary was linked with the
100 .B \-z nodefaultlib
101 linker option, this step is skipped.
102 .\"
103 .SS Dynamic string tokens
104 In several places, the dynamic linker expands dynamic string tokens:
105 .IP \[bu] 3
106 In the environment variables
107 .BR LD_LIBRARY_PATH ,
108 .BR LD_PRELOAD ,
109 and
110 .BR LD_AUDIT ,
111 .IP \[bu]
112 inside the values of the dynamic section tags
113 .BR DT_NEEDED ,
114 .BR DT_RPATH ,
115 .BR DT_RUNPATH ,
116 .BR DT_AUDIT ,
117 and
118 .B DT_DEPAUDIT
119 of ELF binaries,
120 .IP \[bu]
121 in the arguments to the
122 .B ld.so
123 command line options
124 .BR \-\-audit ,
125 .BR \-\-library\-path ,
126 and
127 .B \-\-preload
128 (see below), and
129 .IP \[bu]
130 in the filename arguments to the
131 .BR dlopen (3)
132 and
133 .BR dlmopen (3)
134 functions.
135 .PP
136 The substituted tokens are as follows:
137 .TP
138 .IR $ORIGIN " (or equivalently " ${ORIGIN} )
139 This expands to
140 the directory containing the program or shared object.
141 Thus, an application located in
142 .I somedir/app
143 could be compiled with
144 .IP
145 .in +4n
146 .EX
147 gcc \-Wl,\-rpath,\[aq]$ORIGIN/../lib\[aq]
148 .EE
149 .in
150 .IP
151 so that it finds an associated shared object in
152 .I somedir/lib
153 no matter where
154 .I somedir
155 is located in the directory hierarchy.
156 This facilitates the creation of "turn-key" applications that
157 do not need to be installed into special directories,
158 but can instead be unpacked into any directory
159 and still find their own shared objects.
160 .TP
161 .IR $LIB " (or equivalently " ${LIB} )
162 This expands to
163 .I lib
164 or
165 .I lib64
166 depending on the architecture
167 (e.g., on x86-64, it expands to
168 .I lib64
169 and
170 on x86-32, it expands to
171 .IR lib ).
172 .TP
173 .IR $PLATFORM " (or equivalently " ${PLATFORM} )
174 This expands to a string corresponding to the processor type
175 of the host system (e.g., "x86_64").
176 On some architectures, the Linux kernel doesn't provide a platform
177 string to the dynamic linker.
178 The value of this string is taken from the
179 .B AT_PLATFORM
180 value in the auxiliary vector (see
181 .BR getauxval (3)).
182 .\" To get an idea of the places that $PLATFORM would match,
183 .\" look at the output of the following:
184 .\"
185 .\" mkdir /tmp/d
186 .\" LD_LIBRARY_PATH=/tmp/d strace -e open /bin/date 2>&1 | grep /tmp/d
187 .\"
188 .\" ld.so lets names be abbreviated, so $O will work for $ORIGIN;
189 .\" Don't do this!!
190 .PP
191 Note that the dynamic string tokens have to be quoted properly when
192 set from a shell,
193 to prevent their expansion as shell or environment variables.
194 .SH OPTIONS
195 .TP
196 .BR \-\-argv0 " \fIstring\fP (since glibc 2.33)"
197 Set
198 .I argv[0]
199 to the value
200 .I string
201 before running the program.
202 .TP
203 .BI \-\-audit " list"
204 Use objects named in
205 .I list
206 as auditors.
207 The objects in
208 .I list
209 are delimited by colons.
210 .TP
211 .B \-\-inhibit\-cache
212 Do not use
213 .IR /etc/ld.so.cache .
214 .TP
215 .BI \-\-library\-path " path"
216 Use
217 .I path
218 instead of
219 .B LD_LIBRARY_PATH
220 environment variable setting (see below).
221 The names
222 .IR ORIGIN ,
223 .IR LIB ,
224 and
225 .I PLATFORM
226 are interpreted as for the
227 .B LD_LIBRARY_PATH
228 environment variable.
229 .TP
230 .BI \-\-inhibit\-rpath " list"
231 Ignore RPATH and RUNPATH information in object names in
232 .IR list .
233 This option is ignored when running in secure-execution mode (see below).
234 The objects in
235 .I list
236 are delimited by colons or spaces.
237 .TP
238 .B \-\-list
239 List all dependencies and how they are resolved.
240 .TP
241 .BR \-\-list\-diagnostics " (since glibc 2.33)"
242 Print system diagnostic information in a machine-readable format,
243 such as some internal loader variables,
244 the auxiliary vector
245 (see
246 .BR getauxval (3)),
247 and the environment variables.
248 On some architectures,
249 the command might print additional information
250 (like the cpu features used in GNU indirect function selection on x86).
251 .BR \-\-list\-tunables " (since glibc 2.33)"
252 Print the names and values of all tunables,
253 along with the minimum and maximum allowed values.
254 .TP
255 .BR \-\-preload " \fIlist\fP (since glibc 2.30)"
256 Preload the objects specified in
257 .IR list .
258 The objects in
259 .I list
260 are delimited by colons or spaces.
261 The objects are preloaded as explained in the description of the
262 .B LD_PRELOAD
263 environment variable below.
264 .IP
265 By contrast with
266 .BR LD_PRELOAD ,
267 the
268 .B \-\-preload
269 option provides a way to perform preloading for a single executable
270 without affecting preloading performed in any child process that executes
271 a new program.
272 .TP
273 .B \-\-verify
274 Verify that program is dynamically linked and this dynamic linker can handle
275 it.
276 .SH ENVIRONMENT
277 Various environment variables influence the operation of the dynamic linker.
278 .\"
279 .SS Secure-execution mode
280 For security reasons,
281 if the dynamic linker determines that a binary should be
282 run in secure-execution mode,
283 the effects of some environment variables are voided or modified,
284 and furthermore those environment variables are stripped from the environment,
285 so that the program does not even see the definitions.
286 Some of these environment variables affect the operation of
287 the dynamic linker itself, and are described below.
288 Other environment variables treated in this way include:
289 .BR GCONV_PATH ,
290 .BR GETCONF_DIR ,
291 .BR HOSTALIASES ,
292 .BR LOCALDOMAIN ,
293 .BR LD_AUDIT ,
294 .BR LD_DEBUG ,
295 .BR LD_DEBUG_OUTPUT ,
296 .BR LD_DYNAMIC_WEAK ,
297 .BR LD_HWCAP_MASK ,
298 .BR LD_LIBRARY_PATH ,
299 .BR LD_ORIGIN_PATH ,
300 .BR LD_PRELOAD ,
301 .BR LD_PROFILE ,
302 .BR LD_SHOW_AUXV ,
303 .BR LOCALDOMAIN ,
304 .BR LOCPATH ,
305 .BR MALLOC_TRACE ,
306 .BR NIS_PATH ,
307 .BR NLSPATH ,
308 .BR RESOLV_HOST_CONF ,
309 .BR RES_OPTIONS ,
310 .BR TMPDIR ,
311 and
312 .BR TZDIR .
313 .PP
314 A binary is executed in secure-execution mode if the
315 .B AT_SECURE
316 entry in the auxiliary vector (see
317 .BR getauxval (3))
318 has a nonzero value.
319 This entry may have a nonzero value for various reasons, including:
320 .IP \[bu] 3
321 The process's real and effective user IDs differ,
322 or the real and effective group IDs differ.
323 This typically occurs as a result of executing
324 a set-user-ID or set-group-ID program.
325 .IP \[bu]
326 A process with a non-root user ID executed a binary that
327 conferred capabilities to the process.
328 .IP \[bu]
329 A nonzero value may have been set by a Linux Security Module.
330 .\"
331 .SS Environment variables
332 Among the more important environment variables are the following:
333 .TP
334 .BR LD_ASSUME_KERNEL " (from glibc 2.2.3 to glibc 2.36)"
335 Each shared object can inform the dynamic linker of the minimum kernel ABI
336 version that it requires.
337 (This requirement is encoded in an ELF note section that is viewable via
338 .I readelf\~\-n
339 as a section labeled
340 .BR NT_GNU_ABI_TAG .)
341 At run time,
342 the dynamic linker determines the ABI version of the running kernel and
343 will reject loading shared objects that specify minimum ABI versions
344 that exceed that ABI version.
345 .IP
346 .B LD_ASSUME_KERNEL
347 can be used to
348 cause the dynamic linker to assume that it is running on a system with
349 a different kernel ABI version.
350 For example, the following command line causes the
351 dynamic linker to assume it is running on Linux 2.2.5 when loading
352 the shared objects required by
353 .IR myprog :
354 .IP
355 .in +4n
356 .EX
357 $ \fBLD_ASSUME_KERNEL=2.2.5 ./myprog\fP
358 .EE
359 .in
360 .IP
361 On systems that provide multiple versions of a shared object
362 (in different directories in the search path) that have
363 different minimum kernel ABI version requirements,
364 .B LD_ASSUME_KERNEL
365 can be used to select the version of the object that is used
366 (dependent on the directory search order).
367 .IP
368 Historically, the most common use of the
369 .B LD_ASSUME_KERNEL
370 feature was to manually select the older
371 LinuxThreads POSIX threads implementation on systems that provided both
372 LinuxThreads and NPTL
373 (which latter was typically the default on such systems);
374 see
375 .BR pthreads (7).
376 .TP
377 .BR LD_BIND_NOW " (since glibc 2.1.1)"
378 If set to a nonempty string,
379 causes the dynamic linker to resolve all symbols
380 at program startup instead of deferring function call resolution to the point
381 when they are first referenced.
382 This is useful when using a debugger.
383 .TP
384 .B LD_LIBRARY_PATH
385 A list of directories in which to search for
386 ELF libraries at execution time.
387 The items in the list are separated by either colons or semicolons,
388 and there is no support for escaping either separator.
389 A zero-length directory name indicates the current working directory.
390 .IP
391 This variable is ignored in secure-execution mode.
392 .IP
393 Within the pathnames specified in
394 .BR LD_LIBRARY_PATH ,
395 the dynamic linker expands the tokens
396 .IR $ORIGIN ,
397 .IR $LIB ,
398 and
399 .I $PLATFORM
400 (or the versions using curly braces around the names)
401 as described above in
402 .IR "Dynamic string tokens" .
403 Thus, for example,
404 the following would cause a library to be searched for in either the
405 .I lib
406 or
407 .I lib64
408 subdirectory below the directory containing the program to be executed:
409 .IP
410 .in +4n
411 .EX
412 $ \fBLD_LIBRARY_PATH=\[aq]$ORIGIN/$LIB\[aq] prog\fP
413 .EE
414 .in
415 .IP
416 (Note the use of single quotes, which prevent expansion of
417 .I $ORIGIN
418 and
419 .I $LIB
420 as shell variables!)
421 .TP
422 .B LD_PRELOAD
423 A list of additional, user-specified, ELF shared
424 objects to be loaded before all others.
425 This feature can be used to selectively override functions
426 in other shared objects.
427 .IP
428 The items of the list can be separated by spaces or colons,
429 and there is no support for escaping either separator.
430 The objects are searched for using the rules given under DESCRIPTION.
431 Objects are searched for and added to the link map in the left-to-right
432 order specified in the list.
433 .IP
434 In secure-execution mode,
435 preload pathnames containing slashes are ignored.
436 Furthermore, shared objects are preloaded only
437 from the standard search directories and only
438 if they have set-user-ID mode bit enabled (which is not typical).
439 .IP
440 Within the names specified in the
441 .B LD_PRELOAD
442 list, the dynamic linker understands the tokens
443 .IR $ORIGIN ,
444 .IR $LIB ,
445 and
446 .I $PLATFORM
447 (or the versions using curly braces around the names)
448 as described above in
449 .IR "Dynamic string tokens" .
450 (See also the discussion of quoting under the description of
451 .BR LD_LIBRARY_PATH .)
452 .\" Tested with the following:
453 .\"
454 .\" LD_PRELOAD='$LIB/libmod.so' LD_LIBRARY_PATH=. ./prog
455 .\"
456 .\" which will preload the libmod.so in 'lib' or 'lib64', using it
457 .\" in preference to the version in '.'.
458 .IP
459 There are various methods of specifying libraries to be preloaded,
460 and these are handled in the following order:
461 .RS
462 .IP (1) 5
463 The
464 .B LD_PRELOAD
465 environment variable.
466 .IP (2)
467 The
468 .B \-\-preload
469 command-line option when invoking the dynamic linker directly.
470 .IP (3)
471 The
472 .I /etc/ld.so.preload
473 file (described below).
474 .RE
475 .TP
476 .B LD_TRACE_LOADED_OBJECTS
477 If set (to any value), causes the program to list its dynamic
478 dependencies, as if run by
479 .BR ldd (1),
480 instead of running normally.
481 .PP
482 Then there are lots of more or less obscure variables,
483 many obsolete or only for internal use.
484 .TP
485 .BR LD_AUDIT " (since glibc 2.4)"
486 A list of user-specified, ELF shared objects
487 to be loaded before all others in a separate linker namespace
488 (i.e., one that does not intrude upon the normal symbol bindings that
489 would occur in the process)
490 These objects can be used to audit the operation of the dynamic linker.
491 The items in the list are colon-separated,
492 and there is no support for escaping the separator.
493 .IP
494 .B LD_AUDIT
495 is ignored in secure-execution mode.
496 .IP
497 The dynamic linker will notify the audit
498 shared objects at so-called auditing checkpoints\[em]for example,
499 loading a new shared object, resolving a symbol,
500 or calling a symbol from another shared object\[em]by
501 calling an appropriate function within the audit shared object.
502 For details, see
503 .BR rtld\-audit (7).
504 The auditing interface is largely compatible with that provided on Solaris,
505 as described in its
506 .IR "Linker and Libraries Guide" ,
507 in the chapter
508 .IR "Runtime Linker Auditing Interface" .
509 .IP
510 Within the names specified in the
511 .B LD_AUDIT
512 list, the dynamic linker understands the tokens
513 .IR $ORIGIN ,
514 .IR $LIB ,
515 and
516 .I $PLATFORM
517 (or the versions using curly braces around the names)
518 as described above in
519 .IR "Dynamic string tokens" .
520 (See also the discussion of quoting under the description of
521 .BR LD_LIBRARY_PATH .)
522 .IP
523 Since glibc 2.13,
524 .\" commit 8e9f92e9d5d7737afdacf79b76d98c4c42980508
525 in secure-execution mode,
526 names in the audit list that contain slashes are ignored,
527 and only shared objects in the standard search directories that
528 have the set-user-ID mode bit enabled are loaded.
529 .TP
530 .BR LD_BIND_NOT " (since glibc 2.1.95)"
531 If this environment variable is set to a nonempty string,
532 do not update the GOT (global offset table) and PLT (procedure linkage table)
533 after resolving a function symbol.
534 By combining the use of this variable with
535 .B LD_DEBUG
536 (with the categories
537 .I bindings
538 and
539 .IR symbols ),
540 one can observe all run-time function bindings.
541 .TP
542 .BR LD_DEBUG " (since glibc 2.1)"
543 Output verbose debugging information about operation of the dynamic linker.
544 The content of this variable is one of more of the following categories,
545 separated by colons, commas, or (if the value is quoted) spaces:
546 .RS
547 .TP 12
548 .I help
549 Specifying
550 .I help
551 in the value of this variable does not run the specified program,
552 and displays a help message about which categories can be specified in this
553 environment variable.
554 .TP
555 .I all
556 Print all debugging information (except
557 .I statistics
558 and
559 .IR unused ;
560 see below).
561 .TP
562 .I bindings
563 Display information about which definition each symbol is bound to.
564 .TP
565 .I files
566 Display progress for input file.
567 .TP
568 .I libs
569 Display library search paths.
570 .TP
571 .I reloc
572 Display relocation processing.
573 .TP
574 .I scopes
575 Display scope information.
576 .TP
577 .I statistics
578 Display relocation statistics.
579 .TP
580 .I symbols
581 Display search paths for each symbol look-up.
582 .TP
583 .I unused
584 Determine unused DSOs.
585 .TP
586 .I versions
587 Display version dependencies.
588 .RE
589 .IP
590 Since glibc 2.3.4,
591 .B LD_DEBUG
592 is ignored in secure-execution mode, unless the file
593 .I /etc/suid\-debug
594 exists (the content of the file is irrelevant).
595 .TP
596 .BR LD_DEBUG_OUTPUT " (since glibc 2.1)"
597 By default,
598 .B LD_DEBUG
599 output is written to standard error.
600 If
601 .B LD_DEBUG_OUTPUT
602 is defined, then output is written to the pathname specified by its value,
603 with the suffix "." (dot) followed by the process ID appended to the pathname.
604 .IP
605 .B LD_DEBUG_OUTPUT
606 is ignored in secure-execution mode.
607 .TP
608 .BR LD_DYNAMIC_WEAK " (since glibc 2.1.91)"
609 By default, when searching shared libraries to resolve a symbol reference,
610 the dynamic linker will resolve to the first definition it finds.
611 .IP
612 Old glibc versions (before glibc 2.2), provided a different behavior:
613 if the linker found a symbol that was weak,
614 it would remember that symbol and
615 keep searching in the remaining shared libraries.
616 If it subsequently found a strong definition of the same symbol,
617 then it would instead use that definition.
618 (If no further symbol was found,
619 then the dynamic linker would use the weak symbol that it initially found.)
620 .IP
621 The old glibc behavior was nonstandard.
622 (Standard practice is that the distinction between
623 weak and strong symbols should have effect only at static link time.)
624 In glibc 2.2,
625 .\" More precisely 2.1.92
626 .\" See weak handling
627 .\" https://www.sourceware.org/ml/libc-hacker/2000-06/msg00029.html
628 .\" To: GNU libc hacker <libc-hacker at sourceware dot cygnus dot com>
629 .\" Subject: weak handling
630 .\" From: Ulrich Drepper <drepper at redhat dot com>
631 .\" Date: 07 Jun 2000 20:08:12 -0700
632 .\" Reply-To: drepper at cygnus dot com (Ulrich Drepper)
633 the dynamic linker was modified to provide the current behavior
634 (which was the behavior that was provided by most other implementations
635 at that time).
636 .IP
637 Defining the
638 .B LD_DYNAMIC_WEAK
639 environment variable (with any value) provides
640 the old (nonstandard) glibc behavior,
641 whereby a weak symbol in one shared library may be overridden by
642 a strong symbol subsequently discovered in another shared library.
643 (Note that even when this variable is set,
644 a strong symbol in a shared library will not override
645 a weak definition of the same symbol in the main program.)
646 .IP
647 Since glibc 2.3.4,
648 .B LD_DYNAMIC_WEAK
649 is ignored in secure-execution mode.
650 .TP
651 .BR LD_HWCAP_MASK " (from glibc 2.1 to glibc 2.38)"
652 Mask for hardware capabilities.
653 Since glibc 2.26,
654 the option might be ignored
655 if glibc does not support tunables.
656 .TP
657 .BR LD_ORIGIN_PATH " (since glibc 2.1)"
658 Path where the binary is found.
659 .\" Used only if $ORIGIN can't be determined by normal means
660 .\" (from the origin path saved at load time, or from /proc/self/exe)?
661 .IP
662 Since glibc 2.4,
663 .B LD_ORIGIN_PATH
664 is ignored in secure-execution mode.
665 .TP
666 .BR LD_POINTER_GUARD " (from glibc 2.4 to glibc 2.22)"
667 Set to 0 to disable pointer guarding.
668 Any other value enables pointer guarding, which is also the default.
669 Pointer guarding is a security mechanism whereby some pointers to code
670 stored in writable program memory (return addresses saved by
671 .BR setjmp (3)
672 or function pointers used by various glibc internals) are mangled
673 semi-randomly to make it more difficult for an attacker to hijack
674 the pointers for use in the event of a buffer overrun or
675 stack-smashing attack.
676 Since glibc 2.23,
677 .\" commit a014cecd82b71b70a6a843e250e06b541ad524f7
678 .B LD_POINTER_GUARD
679 can no longer be used to disable pointer guarding,
680 which is now always enabled.
681 .TP
682 .BR LD_PROFILE " (since glibc 2.1)"
683 The name of a (single) shared object to be profiled,
684 specified either as a pathname or a soname.
685 Profiling output is appended to the file whose name is:
686 .RI \%$LD_PROFILE_OUTPUT /\: $LD_PROFILE .profile .
687 .IP
688 Since glibc 2.2.5,
689 .B LD_PROFILE
690 uses a different default path in secure-execution mode.
691 .TP
692 .BR LD_PROFILE_OUTPUT " (since glibc 2.1)"
693 Directory where
694 .B LD_PROFILE
695 output should be written.
696 If this variable is not defined, or is defined as an empty string,
697 then the default is
698 .IR /var/tmp .
699 .IP
700 .B LD_PROFILE_OUTPUT
701 is ignored in secure-execution mode; instead
702 .I /var/profile
703 is always used.
704 .TP
705 .BR LD_SHOW_AUXV " (since glibc 2.1)"
706 If this environment variable is defined (with any value),
707 show the auxiliary array passed up from the kernel (see also
708 .BR getauxval (3)).
709 .IP
710 Since glibc 2.3.4,
711 .B LD_SHOW_AUXV
712 is ignored in secure-execution mode.
713 .TP
714 .BR LD_TRACE_PRELINKING " (from glibc 2.4 to glibc 2.35)"
715 If this environment variable is defined,
716 trace prelinking of the object whose name is assigned to
717 this environment variable.
718 (Use
719 .BR ldd (1)
720 to get a list of the objects that might be traced.)
721 If the object name is not recognized,
722 .\" (This is what seems to happen, from experimenting)
723 then all prelinking activity is traced.
724 .TP
725 .BR LD_USE_LOAD_BIAS " (from glibc 2.3.3 to glibc 2.35)"
726 .\" http://sources.redhat.com/ml/libc-hacker/2003-11/msg00127.html
727 .\" Subject: [PATCH] Support LD_USE_LOAD_BIAS
728 .\" Jakub Jelinek
729 By default (i.e., if this variable is not defined),
730 executables and prelinked
731 shared objects will honor base addresses of their dependent shared objects
732 and (nonprelinked) position-independent executables (PIEs)
733 and other shared objects will not honor them.
734 If
735 .B LD_USE_LOAD_BIAS
736 is defined with the value 1, both executables and PIEs
737 will honor the base addresses.
738 If
739 .B LD_USE_LOAD_BIAS
740 is defined with the value 0,
741 neither executables nor PIEs will honor the base addresses.
742 .IP
743 Since glibc 2.3.3, this variable is ignored in secure-execution mode.
744 .TP
745 .BR LD_VERBOSE " (since glibc 2.1)"
746 If set to a nonempty string,
747 output symbol versioning information about the
748 program if the
749 .B LD_TRACE_LOADED_OBJECTS
750 environment variable has been set.
751 .TP
752 .BR LD_WARN " (since glibc 2.1.3)"
753 If set to a nonempty string, warn about unresolved symbols.
754 .TP
755 .BR LD_PREFER_MAP_32BIT_EXEC " (x86-64 only; since glibc 2.23)"
756 According to the Intel Silvermont software optimization guide, for 64-bit
757 applications, branch prediction performance can be negatively impacted
758 when the target of a branch is more than 4\ GB away from the branch.
759 If this environment variable is set (to any value),
760 the dynamic linker
761 will first try to map executable pages using the
762 .BR mmap (2)
763 .B MAP_32BIT
764 flag, and fall back to mapping without that flag if that attempt fails.
765 NB: MAP_32BIT will map to the low 2\ GB (not 4\ GB) of the address space.
766 .IP
767 Because
768 .B MAP_32BIT
769 reduces the address range available for address space layout
770 randomization (ASLR),
771 .B LD_PREFER_MAP_32BIT_EXEC
772 is always disabled in secure-execution mode.
773 .SH FILES
774 .TP
775 .I /lib/ld.so
776 a.out dynamic linker/loader
777 .TP
778 .IR /lib/ld\-linux.so. { 1 , 2 }
779 ELF dynamic linker/loader
780 .TP
781 .I /etc/ld.so.cache
782 File containing a compiled list of directories in which to search for
783 shared objects and an ordered list of candidate shared objects.
784 See
785 .BR ldconfig (8).
786 .TP
787 .I /etc/ld.so.preload
788 File containing a whitespace-separated list of ELF shared objects to
789 be loaded before the program.
790 See the discussion of
791 .B LD_PRELOAD
792 above.
793 If both
794 .B LD_PRELOAD
795 and
796 .I /etc/ld.so.preload
797 are employed, the libraries specified by
798 .B LD_PRELOAD
799 are preloaded first.
800 .I /etc/ld.so.preload
801 has a system-wide effect,
802 causing the specified libraries to be preloaded for
803 all programs that are executed on the system.
804 (This is usually undesirable,
805 and is typically employed only as an emergency remedy, for example,
806 as a temporary workaround to a library misconfiguration issue.)
807 .TP
808 .I lib*.so*
809 shared objects
810 .SH NOTES
811 .SS Hardware capabilities
812 Some shared objects are compiled using hardware-specific instructions which do
813 not exist on every CPU.
814 Such objects should be installed in directories whose names define the
815 required hardware capabilities, such as
816 .IR /usr/lib/sse2/ .
817 The dynamic linker checks these directories against the hardware of the
818 machine and selects the most suitable version of a given shared object.
819 Hardware capability directories can be cascaded to combine CPU features.
820 The list of supported hardware capability names depends on the CPU.
821 The following names are currently recognized:
822 .\" Presumably, this info comes from sysdeps/i386/dl-procinfo.c and
823 .\" similar files
824 .TP
825 .B Alpha
826 ev4, ev5, ev56, ev6, ev67
827 .TP
828 .B MIPS
829 loongson2e, loongson2f, octeon, octeon2
830 .TP
831 .B PowerPC
832 4xxmac, altivec, arch_2_05, arch_2_06, booke, cellbe, dfp, efpdouble, efpsingle,
833 fpu, ic_snoop, mmu, notb, pa6t, power4, power5, power5+, power6x, ppc32, ppc601,
834 ppc64, smt, spe, ucache, vsx
835 .TP
836 .B SPARC
837 flush, muldiv, stbar, swap, ultra3, v9, v9v, v9v2
838 .TP
839 .B s390
840 dfp, eimm, esan3, etf3enh, g5, highgprs, hpage, ldisp, msa, stfle,
841 z900, z990, z9-109, z10, zarch
842 .TP
843 .B x86 (32-bit only)
844 acpi, apic, clflush, cmov, cx8, dts, fxsr, ht, i386, i486, i586, i686, mca, mmx,
845 mtrr, pat, pbe, pge, pn, pse36, sep, ss, sse, sse2, tm
846 .SH SEE ALSO
847 .BR ld (1),
848 .BR ldd (1),
849 .BR pldd (1),
850 .BR sprof (1),
851 .BR dlopen (3),
852 .BR getauxval (3),
853 .BR elf (5),
854 .BR capabilities (7),
855 .BR rtld\-audit (7),
856 .BR ldconfig (8),
857 .BR sln (8)
858 .\" .SH AUTHORS
859 .\" ld.so: David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus
860 .\" Torvalds, Lars Wirzenius and Mitch D'Souza
861 .\" ld\-linux.so: Roland McGrath, Ulrich Drepper and others.
862 .\"
863 .\" In the above, (libc5) stands for David Engel's ld.so/ld\-linux.so.