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