2013-03-10 09:28:48 +00:00
|
|
|
.\" %%%LICENSE_START(PUBLIC_DOMAIN)
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" This is in the public domain
|
2013-03-10 09:28:48 +00:00
|
|
|
.\" %%%LICENSE_END
|
networks.5, arp.7, cp1251.7, ddp.7, icmp.7, ip.7, ipv6.7, iso_8859-10.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-9.7, koi8-r.7, netdevice.7, netlink.7, packet.7, raw.7, rtnetlink.7, udp.7, x25.7, ld.so.8, sln.8, sync.8: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-12 11:28:50 +00:00
|
|
|
.\"
|
2016-05-09 21:37:59 +00:00
|
|
|
.TH LD.SO 8 2016-05-09 "GNU" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
ld.so, ld-linux.so* \- dynamic linker/loader
|
2007-05-18 16:06:42 +00:00
|
|
|
.SH SYNOPSIS
|
2008-04-18 20:38:02 +00:00
|
|
|
The dynamic linker can be run either indirectly by running some
|
2015-07-10 18:37:59 +00:00
|
|
|
dynamically linked program or shared object
|
|
|
|
(in which case no command-line options
|
2007-05-18 16:06:42 +00:00
|
|
|
to the dynamic linker can be passed and, in the ELF case, the dynamic linker
|
|
|
|
which is stored in the
|
|
|
|
.B .interp
|
|
|
|
section of the program is executed) or directly by running:
|
|
|
|
.P
|
|
|
|
.I /lib/ld-linux.so.*
|
|
|
|
[OPTIONS] [PROGRAM [ARGUMENTS]]
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
The programs
|
|
|
|
.B ld.so
|
|
|
|
and
|
|
|
|
.B ld-linux.so*
|
2015-07-10 18:37:59 +00:00
|
|
|
find and load the shared objects (shared libraries) needed by a program,
|
|
|
|
prepare the program to run, and then run it.
|
2004-11-03 13:51:07 +00:00
|
|
|
.LP
|
|
|
|
Linux binaries require dynamic linking (linking at run time)
|
|
|
|
unless the
|
|
|
|
.B \-static
|
|
|
|
option was given to
|
2007-06-23 07:56:56 +00:00
|
|
|
.BR ld (1)
|
2004-11-03 13:51:07 +00:00
|
|
|
during compilation.
|
|
|
|
.LP
|
|
|
|
The program
|
|
|
|
.B ld.so
|
|
|
|
handles a.out binaries, a format used long ago;
|
|
|
|
.B ld-linux.so*
|
2016-09-11 10:19:47 +00:00
|
|
|
(\fI/lib/ld-linux.so.1\fP for libc5, \fI/lib/ld-linux.so.2\fP for glibc2)
|
|
|
|
handles ELF,
|
|
|
|
which everybody has been using for years now.
|
time.1, get_kernel_syms.2, getitimer.2, open.2, perf_event_open.2, wait.2, alloca.3, bcmp.3, catopen.3, fputwc.3, iconv.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, mbsinit.3, putwchar.3, rcmd.3, rexec.3, sigqueue.3, strverscmp.3, wctrans.3, wctype.3, wcwidth.3, console_codes.4, initrd.4, st.4, elf.5, nss.5, ip.7, netdevice.7, path_resolution.7, socket.7, udp.7, ld.so.8: grfix: s/Otherwise /Otherwise, /
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-28 08:15:47 +00:00
|
|
|
Otherwise, both have the same behavior, and use the same
|
2004-11-03 13:51:07 +00:00
|
|
|
support files and programs
|
|
|
|
.BR ldd (1),
|
getrlimit.2, mmap.2, stat.2, unimplemented.2, dbopen.3, ecvt_r.3, fopen.3, fts.3, getcontext.3, qecvt.3, ip.7, ld.so.8: grfix: Add Oxford comma
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-09-01 15:57:07 +00:00
|
|
|
.BR ldconfig (8),
|
2004-11-03 13:51:07 +00:00
|
|
|
and
|
|
|
|
.IR /etc/ld.so.conf .
|
|
|
|
.LP
|
2015-07-10 18:37:59 +00:00
|
|
|
When resolving shared object dependencies,
|
2012-08-26 21:01:34 +00:00
|
|
|
the dynamic linker first inspects each dependency
|
|
|
|
string to see if it contains a slash (this can occur if
|
2015-07-10 18:37:59 +00:00
|
|
|
a shared object pathname containing slashes was specified at link time).
|
2012-08-26 21:01:34 +00:00
|
|
|
If a slash is found, then the dependency string is interpreted as
|
|
|
|
a (relative or absolute) pathname,
|
2015-07-10 18:37:59 +00:00
|
|
|
and the shared object is loaded using that pathname.
|
2012-08-26 21:01:34 +00:00
|
|
|
.LP
|
2015-07-10 18:37:59 +00:00
|
|
|
If a shared object dependency does not contain a slash,
|
2012-08-26 21:01:34 +00:00
|
|
|
then it is searched for in the following order:
|
2008-04-18 20:38:02 +00:00
|
|
|
.IP o 3
|
2016-09-11 10:28:24 +00:00
|
|
|
Using the directories specified in the
|
2008-04-18 20:38:02 +00:00
|
|
|
DT_RPATH dynamic section attribute
|
2004-11-03 13:51:07 +00:00
|
|
|
of the binary if present and DT_RUNPATH attribute does not exist.
|
|
|
|
Use of DT_RPATH is deprecated.
|
|
|
|
.IP o
|
|
|
|
Using the environment variable
|
2015-09-13 20:10:47 +00:00
|
|
|
.BR LD_LIBRARY_PATH
|
|
|
|
(unless the executable is being run in secure-execution mode; see below).
|
2005-07-18 14:25:42 +00:00
|
|
|
in which case it is ignored.
|
2004-11-03 13:51:07 +00:00
|
|
|
.IP o
|
2016-09-11 10:28:24 +00:00
|
|
|
Using the directories specified in the
|
2008-04-18 20:38:02 +00:00
|
|
|
DT_RUNPATH dynamic section attribute
|
2004-11-03 13:51:07 +00:00
|
|
|
of the binary if present.
|
|
|
|
.IP o
|
|
|
|
From the cache file
|
2012-08-26 18:34:10 +00:00
|
|
|
.IR /etc/ld.so.cache ,
|
2015-07-10 18:37:59 +00:00
|
|
|
which contains a compiled list of candidate shared objects previously found
|
2007-04-12 22:42:49 +00:00
|
|
|
in the augmented library path.
|
2008-04-18 20:38:02 +00:00
|
|
|
If, however, the binary was linked with the
|
2005-07-06 07:41:37 +00:00
|
|
|
.B \-z nodeflib
|
2015-07-10 18:37:59 +00:00
|
|
|
linker option, shared objects in the default paths are skipped.
|
|
|
|
Shared objects installed in hardware capability directories (see below)
|
|
|
|
are preferred to other shared objects.
|
2004-11-03 13:51:07 +00:00
|
|
|
.IP o
|
|
|
|
In the default path
|
2005-11-02 13:55:25 +00:00
|
|
|
.IR /lib ,
|
2004-11-03 13:51:07 +00:00
|
|
|
and then
|
2005-11-02 13:55:25 +00:00
|
|
|
.IR /usr/lib .
|
2015-12-06 18:47:28 +00:00
|
|
|
(On some 64-bit architectures, the default paths for 64-bit shared objects are
|
2015-03-12 10:25:41 +00:00
|
|
|
.IR /lib64 ,
|
|
|
|
and then
|
|
|
|
.IR /usr/lib64 .)
|
2008-04-18 20:38:02 +00:00
|
|
|
If the binary was linked with the
|
2005-07-06 07:41:37 +00:00
|
|
|
.B \-z nodeflib
|
2004-11-03 13:51:07 +00:00
|
|
|
linker option, this step is skipped.
|
2013-07-15 12:32:17 +00:00
|
|
|
.SS Rpath token expansion
|
2007-05-26 11:55:36 +00:00
|
|
|
.PP
|
|
|
|
.B ld.so
|
2013-07-15 12:32:17 +00:00
|
|
|
understands certain strings in an rpath specification (DT_RPATH or DT_RUNPATH); those strings are substituted as follows
|
|
|
|
.TP
|
|
|
|
.IR $ORIGIN " (or equivalently " ${ORIGIN} )
|
2013-07-31 06:45:42 +00:00
|
|
|
This expands to
|
2015-07-10 18:37:59 +00:00
|
|
|
the directory containing the program or shared object.
|
2007-05-26 11:55:36 +00:00
|
|
|
Thus, an application located in
|
|
|
|
.I somedir/app
|
|
|
|
could be compiled with
|
2013-07-15 12:32:17 +00:00
|
|
|
|
2013-09-05 11:08:35 +00:00
|
|
|
gcc \-Wl,\-rpath,\(aq$ORIGIN/../lib\(aq
|
2013-07-15 12:32:17 +00:00
|
|
|
|
2015-07-10 18:37:59 +00:00
|
|
|
so that it finds an associated shared object in
|
2007-05-26 11:55:36 +00:00
|
|
|
.I somedir/lib
|
2007-06-21 22:55:04 +00:00
|
|
|
no matter where
|
|
|
|
.I somedir
|
2007-05-26 11:55:36 +00:00
|
|
|
is located in the directory hierarchy.
|
|
|
|
This facilitates the creation of "turn-key" applications that
|
|
|
|
do not need to be installed into special directories,
|
|
|
|
but can instead be unpacked into any directory
|
2015-07-10 18:37:59 +00:00
|
|
|
and still find their own shared objects.
|
2013-07-15 12:32:46 +00:00
|
|
|
.TP
|
|
|
|
.IR $LIB " (or equivalently " ${LIB} )
|
|
|
|
This expands to
|
|
|
|
.I lib
|
|
|
|
or
|
|
|
|
.I lib64
|
|
|
|
depending on the architecture
|
|
|
|
(e.g., on x86-64, it expands to
|
|
|
|
.IR lib64
|
|
|
|
and
|
|
|
|
on x86-32, it expands to
|
|
|
|
.IR lib ).
|
2013-07-15 12:39:35 +00:00
|
|
|
.TP
|
|
|
|
.IR $PLATFORM " (or equivalently " ${PLATFORM} )
|
|
|
|
This expands to a string corresponding to the processor type
|
|
|
|
of the host system (e.g., "x86_64").
|
|
|
|
On some architectures, the Linux kernel doesn't provide a platform
|
|
|
|
string to the dynamic linker.
|
|
|
|
The value of this string is taken from the
|
|
|
|
.BR AT_PLATFORM
|
|
|
|
value in the auxiliary vector (see
|
|
|
|
.BR getauxval (3)).
|
|
|
|
.\" To get an idea of the places that $PLATFORM would match,
|
|
|
|
.\" look at the output of the following:
|
2007-05-26 11:55:36 +00:00
|
|
|
.\"
|
2013-07-15 12:39:35 +00:00
|
|
|
.\" mkdir /tmp/d
|
|
|
|
.\" LD_LIBRARY_PATH=/tmp/d strace -e open /bin/date 2>&1 | grep /tmp/d
|
2007-05-26 11:55:36 +00:00
|
|
|
.\"
|
|
|
|
.\" ld.so lets names be abbreviated, so $O will work for $ORIGIN;
|
|
|
|
.\" Don't do this!!
|
2007-05-16 05:06:47 +00:00
|
|
|
.SH OPTIONS
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2005-07-06 07:41:37 +00:00
|
|
|
.B \-\-list
|
2004-11-03 13:51:07 +00:00
|
|
|
List all dependencies and how they are resolved.
|
|
|
|
.TP
|
2005-07-06 07:41:37 +00:00
|
|
|
.B \-\-verify
|
2004-11-03 13:51:07 +00:00
|
|
|
Verify that program is dynamically linked and this dynamic linker can handle
|
|
|
|
it.
|
|
|
|
.TP
|
2014-10-17 20:14:01 +00:00
|
|
|
.B \-\-inhibit-cache
|
2015-03-13 07:04:24 +00:00
|
|
|
Do not use
|
|
|
|
.IR /etc/ld.so.cache .
|
2014-10-17 20:14:01 +00:00
|
|
|
.TP
|
2015-02-16 05:57:12 +00:00
|
|
|
.BI \-\-library\-path " path"
|
|
|
|
Use
|
|
|
|
.I path
|
|
|
|
instead of
|
2004-11-03 13:51:07 +00:00
|
|
|
.B LD_LIBRARY_PATH
|
|
|
|
environment variable setting (see below).
|
2016-04-21 12:14:31 +00:00
|
|
|
The names
|
|
|
|
.IR ORIGIN ,
|
|
|
|
.IR LIB ,
|
|
|
|
and
|
|
|
|
.IR PLATFORM
|
|
|
|
are interpreted as for the
|
|
|
|
.BR LD_LIBRARY_PATH
|
|
|
|
environment variable.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2015-02-16 05:57:12 +00:00
|
|
|
.BI \-\-inhibit\-rpath " list"
|
|
|
|
Ignore RPATH and RUNPATH information in object names in
|
|
|
|
.IR list .
|
2015-12-04 20:47:38 +00:00
|
|
|
This option is ignored when running in secure-execution mode (see below).
|
2012-03-20 10:09:15 +00:00
|
|
|
.TP
|
2015-02-16 05:57:12 +00:00
|
|
|
.BI \-\-audit " list"
|
|
|
|
Use objects named in
|
|
|
|
.I list
|
|
|
|
as auditors.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH ENVIRONMENT
|
2015-12-04 20:47:38 +00:00
|
|
|
Various environment variables influence the operation of the dynamic linker.
|
2015-09-13 13:39:24 +00:00
|
|
|
.\"
|
|
|
|
.SS Secure-execution mode
|
|
|
|
For security reasons,
|
|
|
|
the effects of some environment variables are voided or modified if
|
|
|
|
the dynamic linker determines that the binary should be
|
|
|
|
run in secure-execution mode.
|
|
|
|
This determination is made by checking whether the
|
|
|
|
.B AT_SECURE
|
|
|
|
entry in the auxiliary vector (see
|
|
|
|
.BR getauxval (3))
|
|
|
|
has a nonzero value.
|
|
|
|
This entry may have a nonzero value for various reasons, including:
|
|
|
|
.IP * 3
|
|
|
|
The process's real and effective user IDs differ,
|
|
|
|
or the real and effective group IDs differ.
|
2015-12-05 09:45:06 +00:00
|
|
|
This typically occurs as a result of executing
|
2015-09-13 13:39:24 +00:00
|
|
|
a set-user-ID or set-group-ID program.
|
|
|
|
.IP *
|
|
|
|
A process with a non-root user ID executed a binary that
|
|
|
|
conferred permitted or effective capabilities.
|
|
|
|
.IP *
|
|
|
|
A nonzero value may have been set by a Linux Security Module.
|
|
|
|
.\"
|
|
|
|
.SS Environment variables
|
2013-12-07 22:33:50 +00:00
|
|
|
Among the more important environment variables are the following:
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_ASSUME_KERNEL " (since glibc 2.2.3)"
|
2015-07-10 18:37:59 +00:00
|
|
|
Each shared object can inform the dynamic linker of the minimum kernel ABI
|
2013-07-15 12:32:17 +00:00
|
|
|
version that it requires.
|
2013-07-22 18:25:37 +00:00
|
|
|
(This requirement is encoded in an ELF note section that is viewable via
|
|
|
|
.IR "readelf\ \-n"
|
|
|
|
as a section labeled
|
|
|
|
.BR NT_GNU_ABI_TAG .)
|
2013-07-15 12:32:17 +00:00
|
|
|
At run time,
|
|
|
|
the dynamic linker determines the ABI version of the running kernel and
|
2015-07-10 18:37:59 +00:00
|
|
|
will reject loading shared objects that specify minimum ABI versions
|
2013-07-15 12:32:17 +00:00
|
|
|
that exceed that ABI version.
|
|
|
|
|
|
|
|
.BR LD_ASSUME_KERNEL
|
|
|
|
can be used to
|
|
|
|
cause the dynamic linker to assume that it is running on a system with
|
|
|
|
a different kernel ABI version.
|
|
|
|
For example, the following command line causes the
|
|
|
|
dynamic linker to assume it is running on Linux 2.2.5 when loading
|
2015-07-10 18:37:59 +00:00
|
|
|
the shared objects required by
|
2013-07-15 12:32:17 +00:00
|
|
|
.IR myprog :
|
|
|
|
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
$ \fBLD_ASSUME_KERNEL=2.2.5 ./myprog\fP
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
|
2015-07-10 18:37:59 +00:00
|
|
|
On systems that provide multiple versions of a shared object
|
2013-07-15 12:32:17 +00:00
|
|
|
(in different directories in the search path) that have
|
|
|
|
different minimum kernel ABI version requirements,
|
|
|
|
.BR LD_ASSUME_KERNEL
|
2015-07-10 18:37:59 +00:00
|
|
|
can be used to select the version of the object that is used
|
2013-07-15 12:32:17 +00:00
|
|
|
(dependent on the directory search order).
|
|
|
|
Historically, the most common use of the
|
2013-07-31 06:45:42 +00:00
|
|
|
.BR LD_ASSUME_KERNEL
|
2013-07-15 12:32:17 +00:00
|
|
|
feature was to manually select the older
|
|
|
|
LinuxThreads POSIX threads implementation on systems that provided both
|
|
|
|
LinuxThreads and NPTL
|
2013-07-20 20:14:36 +00:00
|
|
|
(which latter was typically the default on such systems);
|
|
|
|
see
|
|
|
|
.BR pthreads (7).
|
2013-07-15 12:32:17 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_BIND_NOW " (since glibc 2.1.1)"
|
mbind.2, rename.2, sched_setscheduler.2, set_mempolicy.2, syslog.2, argz_add.3, dlopen.3, scanf.3, strtod.3, strtok.3, tcgetpgrp.3, hd.4, cpuset.7, regex.7, ld.so.8: Global fix: s/non-empty/nonempty/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:41:47 +00:00
|
|
|
If set to a nonempty string,
|
2008-10-27 22:23:21 +00:00
|
|
|
causes the dynamic linker to resolve all symbols
|
|
|
|
at program startup instead of deferring function call resolution to the point
|
|
|
|
when they are first referenced.
|
|
|
|
This is useful when using a debugger.
|
|
|
|
.TP
|
2004-11-03 13:51:07 +00:00
|
|
|
.B LD_LIBRARY_PATH
|
2015-08-05 18:45:12 +00:00
|
|
|
A list of directories in which to search for
|
2004-11-03 13:51:07 +00:00
|
|
|
ELF libraries at execution-time.
|
2015-08-05 18:45:12 +00:00
|
|
|
The items in the list are separated by either colons or semicolons.
|
2007-04-12 22:42:49 +00:00
|
|
|
Similar to the
|
2004-11-03 13:51:07 +00:00
|
|
|
.B PATH
|
|
|
|
environment variable.
|
2015-12-04 20:47:38 +00:00
|
|
|
This variable is ignored in secure-execution mode.
|
2016-04-21 12:14:31 +00:00
|
|
|
|
|
|
|
Within the pathnames specified in
|
|
|
|
.BR LD_LIBRARY_PATH ,
|
|
|
|
the dynamic linker expands the strings
|
|
|
|
.IR $ORIGIN ,
|
|
|
|
.IR $LIB ,
|
|
|
|
and
|
|
|
|
.IR $PLATFORM
|
|
|
|
(or the versions using curly braces around the names)
|
|
|
|
as described above in
|
|
|
|
.IR "Rpath token expansion" .
|
|
|
|
Thus, for example,
|
|
|
|
the following would cause a library to be searched for in either the
|
|
|
|
.I lib
|
|
|
|
or
|
|
|
|
.I lib64
|
|
|
|
subdirectory below the directory containing the program to be executed:
|
|
|
|
|
|
|
|
$ \fBLD_LIBRARY_PATH='$ORIGIN/$LIB' prog\fP
|
|
|
|
|
|
|
|
(Note the use of single quotes, which prevent expansion of
|
|
|
|
.I ORIGIN
|
|
|
|
and
|
|
|
|
.I LIB
|
|
|
|
as shell variables!)
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
.B LD_PRELOAD
|
2012-08-26 13:41:30 +00:00
|
|
|
A list of additional, user-specified, ELF shared
|
2015-07-10 18:37:59 +00:00
|
|
|
objects to be loaded before all others.
|
2012-08-26 13:41:30 +00:00
|
|
|
The items of the list can be separated by spaces or colons.
|
2015-07-10 18:37:59 +00:00
|
|
|
This can be used to selectively override functions in other shared objects.
|
|
|
|
The objects are searched for using the rules given under DESCRIPTION.
|
2015-09-13 20:10:47 +00:00
|
|
|
In secure-execution mode,
|
2012-08-26 21:08:59 +00:00
|
|
|
preload pathnames containing slashes are ignored,
|
2016-09-15 06:18:21 +00:00
|
|
|
and only shared objects in the standard search directories that
|
|
|
|
have the set-user-ID mode bit enabled are loaded.
|
2016-04-21 12:14:31 +00:00
|
|
|
|
|
|
|
Within the pathnames specified in
|
|
|
|
.BR LD_PRELOAD ,
|
|
|
|
the dynamic linker understands the strings
|
|
|
|
.IR $ORIGIN ,
|
|
|
|
.IR $LIB ,
|
|
|
|
and
|
|
|
|
.IR $PLATFORM
|
|
|
|
(or the versions using curly braces around the names)
|
|
|
|
as described above in
|
|
|
|
.IR "Rpath token expansion" .
|
|
|
|
.\" Tested with the following:
|
|
|
|
.\"
|
|
|
|
.\" LD_PRELOAD='$LIB/libmod.so' LD_LIBRARY_PATH=. ./prog
|
|
|
|
.\"
|
|
|
|
.\" which will reload the libmod.so in 'lib' or 'lib64', using it
|
|
|
|
.\" in preference to the version in '.'.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:28:24 +00:00
|
|
|
.BR LD_TRACE_LOADED_OBJECTS
|
2015-12-16 14:25:49 +00:00
|
|
|
If set (to any value), causes the program to list its dynamic
|
2004-11-03 13:51:07 +00:00
|
|
|
dependencies, as if run by
|
|
|
|
.BR ldd (1),
|
|
|
|
instead of running normally.
|
|
|
|
.LP
|
|
|
|
Then there are lots of more or less obscure variables,
|
|
|
|
many obsolete or only for internal use.
|
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_AUDIT " (since glibc 2.4)"
|
2009-01-12 06:10:46 +00:00
|
|
|
A colon-separated list of user-specified, ELF shared objects
|
|
|
|
to be loaded before all others in a separate linker namespace
|
|
|
|
(i.e., one that does not intrude upon the normal symbol bindings that
|
|
|
|
would occur in the process).
|
2015-07-10 18:37:59 +00:00
|
|
|
These objects can be used to audit the operation of the dynamic linker.
|
2009-01-12 06:10:46 +00:00
|
|
|
.B LD_AUDIT
|
2015-09-13 20:10:47 +00:00
|
|
|
is ignored in secure-execution mode.
|
2009-01-12 06:10:46 +00:00
|
|
|
|
|
|
|
The dynamic linker will notify the audit
|
2015-07-10 18:37:59 +00:00
|
|
|
shared objects at so-called auditing checkpoints\(emfor example,
|
|
|
|
loading a new shared object, resolving a symbol,
|
2009-01-12 06:10:46 +00:00
|
|
|
or calling a symbol from another shared object\(emby
|
2015-07-10 18:37:59 +00:00
|
|
|
calling an appropriate function within the audit shared object.
|
2009-01-12 06:10:46 +00:00
|
|
|
For details, see
|
|
|
|
.BR rtld-audit (7).
|
|
|
|
The auditing interface is largely compatible with that provided on Solaris,
|
|
|
|
as described in its
|
|
|
|
.IR "Linker and Libraries Guide" ,
|
|
|
|
in the chapter
|
|
|
|
.IR "Runtime Linker Auditing Interface" .
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_BIND_NOT " (since glibc 2.1.95)"
|
2015-12-16 14:28:18 +00:00
|
|
|
If this environment variable is set to a nonempty string,
|
|
|
|
do not update the GOT (global offset table) and PLT (procedure linkage table)
|
2004-11-03 13:51:07 +00:00
|
|
|
after resolving a symbol.
|
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_DEBUG " (since glibc 2.1)"
|
2004-11-03 13:51:07 +00:00
|
|
|
Output verbose debugging information about the dynamic linker.
|
|
|
|
If set to
|
2016-09-10 16:19:04 +00:00
|
|
|
.BR all ,
|
|
|
|
print all debugging information,
|
2016-09-10 16:36:07 +00:00
|
|
|
Setting this variable to
|
|
|
|
.BR help
|
|
|
|
does not run the specified program,
|
|
|
|
and displays a help message about which categories can be specified in this
|
2004-11-03 13:51:07 +00:00
|
|
|
environment variable.
|
2016-09-10 16:36:07 +00:00
|
|
|
The categories are:
|
|
|
|
.RS
|
|
|
|
.TP 12
|
|
|
|
.I bindings
|
|
|
|
Display information about which definition each symbol is bound to.
|
|
|
|
.TP
|
|
|
|
.I files
|
|
|
|
Display progress for input file.
|
|
|
|
.TP
|
|
|
|
.I libs
|
|
|
|
Display library search paths.
|
|
|
|
.TP
|
|
|
|
.I reloc
|
|
|
|
Display relocation processing.
|
|
|
|
.TP
|
|
|
|
.I scopes
|
|
|
|
Display scope information.
|
|
|
|
.TP
|
|
|
|
.I statistics
|
|
|
|
Display relocation statistics.
|
|
|
|
.TP
|
|
|
|
.I symbols
|
|
|
|
Display search paths for each symbol look-up.
|
|
|
|
.TP
|
|
|
|
.I unused
|
|
|
|
Determine unused DSOs.
|
|
|
|
.TP
|
|
|
|
.I versions
|
|
|
|
Display version dependencies.
|
|
|
|
.RE
|
|
|
|
.IP
|
|
|
|
The value in
|
|
|
|
.BR LD_DEBUG
|
|
|
|
can specify multiple categories, separated by colons, commas,
|
|
|
|
or (if the value is quoted) spaces.
|
|
|
|
|
2008-10-27 19:13:11 +00:00
|
|
|
Since glibc 2.3.4,
|
|
|
|
.B LD_DEBUG
|
2015-12-05 07:29:33 +00:00
|
|
|
is ignored in secure-execution mode, unless the file
|
|
|
|
.IR /etc/suid\-debug
|
|
|
|
exists (the content of the file is irrelevant).
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_DEBUG_OUTPUT " (since glibc 2.1)"
|
2013-07-15 03:42:21 +00:00
|
|
|
File in which
|
2004-11-03 13:51:07 +00:00
|
|
|
.B LD_DEBUG
|
2013-07-15 03:42:21 +00:00
|
|
|
output should be written.
|
2014-01-07 20:31:57 +00:00
|
|
|
The default is standard error.
|
2007-06-22 20:40:07 +00:00
|
|
|
.B LD_DEBUG_OUTPUT
|
2015-09-13 20:10:47 +00:00
|
|
|
is ignored in secure-execution mode.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_DYNAMIC_WEAK " (since glibc 2.1.91)"
|
2015-12-16 14:28:18 +00:00
|
|
|
If this environment variable is defined (with any value),
|
|
|
|
allow weak symbols to be overridden (reverting to old glibc behavior).
|
2015-10-20 19:23:19 +00:00
|
|
|
.\" See weak handling
|
|
|
|
.\" https://www.sourceware.org/ml/libc-hacker/2000-06/msg00029.html
|
|
|
|
.\" To: GNU libc hacker <libc-hacker at sourceware dot cygnus dot com>
|
|
|
|
.\" Subject: weak handling
|
|
|
|
.\" From: Ulrich Drepper <drepper at redhat dot com>
|
|
|
|
.\" Date: 07 Jun 2000 20:08:12 -0700
|
|
|
|
.\" Reply-To: drepper at cygnus dot com (Ulrich Drepper)
|
2015-12-04 20:47:38 +00:00
|
|
|
Since glibc 2.3.4,
|
2008-10-27 22:23:21 +00:00
|
|
|
.B LD_DYNAMIC_WEAK
|
2015-09-13 20:10:47 +00:00
|
|
|
is ignored in secure-execution mode.
|
2008-10-27 22:23:21 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_HWCAP_MASK " (since glibc 2.1)"
|
2008-10-27 22:23:21 +00:00
|
|
|
Mask for hardware capabilities.
|
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_ORIGIN_PATH " (since glibc 2.1)"
|
2016-04-21 11:39:43 +00:00
|
|
|
Path where the binary is found.
|
2015-09-13 20:10:47 +00:00
|
|
|
Since glibc 2.4,
|
2008-10-27 22:23:21 +00:00
|
|
|
.B LD_ORIGIN_PATH
|
2015-09-13 20:10:47 +00:00
|
|
|
is ignored in secure-execution mode.
|
2008-10-27 22:23:21 +00:00
|
|
|
.\" Only used if $ORIGIN can't be determined by normal means
|
|
|
|
.\" (from the origin path saved at load time, or from /proc/self/exe)?
|
2009-01-12 09:57:06 +00:00
|
|
|
.TP
|
2016-09-11 10:08:05 +00:00
|
|
|
.BR LD_POINTER_GUARD " (glibc from 2.4 to 2.22)"
|
2009-01-12 09:57:06 +00:00
|
|
|
Set to 0 to disable pointer guarding.
|
|
|
|
Any other value enables pointer guarding, which is also the default.
|
|
|
|
Pointer guarding is a security mechanism whereby some pointers to code
|
|
|
|
stored in writable program memory (return addresses saved by
|
|
|
|
.BR setjmp (3)
|
|
|
|
or function pointers used by various glibc internals) are mangled
|
|
|
|
semi-randomly to make it more difficult for an attacker to hijack
|
|
|
|
the pointers for use in the event of a buffer overrun or
|
|
|
|
stack-smashing attack.
|
2015-11-24 06:43:04 +00:00
|
|
|
Since glibc 2.23,
|
|
|
|
.\" commit a014cecd82b71b70a6a843e250e06b541ad524f7
|
|
|
|
.B LD_POINTER_GUARD
|
|
|
|
can no longer be used to disable pointer guarding,
|
|
|
|
which is now always enabled.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_PROFILE " (since glibc 2.1)"
|
2014-06-10 14:07:01 +00:00
|
|
|
The name of a (single) shared object to be profiled,
|
2008-10-28 01:02:28 +00:00
|
|
|
specified either as a pathname or a soname.
|
2014-06-10 11:32:34 +00:00
|
|
|
Profiling output is appended to the file whose name is:
|
2008-10-28 01:02:28 +00:00
|
|
|
"\fI$LD_PROFILE_OUTPUT\fP/\fI$LD_PROFILE\fP.profile".
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_PROFILE_OUTPUT " (since glibc 2.1)"
|
2008-10-28 01:02:28 +00:00
|
|
|
Directory where
|
2004-11-03 13:51:07 +00:00
|
|
|
.B LD_PROFILE
|
2008-10-28 01:02:28 +00:00
|
|
|
output should be written.
|
|
|
|
If this variable is not defined, or is defined as an empty string,
|
|
|
|
then the default is
|
|
|
|
.IR /var/tmp .
|
2007-06-22 20:40:07 +00:00
|
|
|
.B LD_PROFILE_OUTPUT
|
2015-12-05 07:17:44 +00:00
|
|
|
is ignored in secure-execution mode; instead
|
|
|
|
.IR /var/profile
|
|
|
|
is always used.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_SHOW_AUXV " (since glibc 2.1)"
|
2015-12-16 14:31:20 +00:00
|
|
|
If this environment variable is defined (with any value),
|
|
|
|
show the auxiliary array passed up from the kernel (see also
|
|
|
|
.BR getauxval (3)).
|
2015-09-13 20:10:47 +00:00
|
|
|
Since glibc 2.3.5,
|
2008-10-27 20:26:59 +00:00
|
|
|
.B LD_SHOW_AUXV
|
2015-09-13 20:10:47 +00:00
|
|
|
is ignored in secure-execution mode.
|
2015-02-06 10:14:43 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_TRACE_PRELINKING " (since glibc 2.4)"
|
2015-12-16 14:32:04 +00:00
|
|
|
If this environment variable is defined (with any value),
|
|
|
|
trace prelinking of the object whose name is assigned to
|
2015-02-06 10:14:43 +00:00
|
|
|
this environment variable.
|
|
|
|
(Use
|
|
|
|
.BR ldd (1)
|
|
|
|
to get a list of the objects that might be traced.)
|
|
|
|
If the object name is not recognized,
|
|
|
|
.\" (This is what seems to happen, from experimenting)
|
|
|
|
then all prelinking activity is traced.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_USE_LOAD_BIAS " (since glibc 2.3.3)"
|
2008-10-27 22:23:21 +00:00
|
|
|
.\" http://sources.redhat.com/ml/libc-hacker/2003-11/msg00127.html
|
|
|
|
.\" Subject: [PATCH] Support LD_USE_LOAD_BIAS
|
|
|
|
.\" Jakub Jelinek
|
2015-03-27 11:23:02 +00:00
|
|
|
By default (i.e., if this variable is not defined),
|
2008-10-27 22:23:21 +00:00
|
|
|
executables and prelinked
|
2015-07-10 18:37:59 +00:00
|
|
|
shared objects will honor base addresses of their dependent shared objects
|
accept.2, access.2, acct.2, clock_nanosleep.2, mbind.2, mincore.2, remap_file_pages.2, sched_setscheduler.2, set_mempolicy.2, splice.2, stat.2, syslog.2, timer_create.2, timerfd_create.2, truncate.2, fenv.3, ferror.3, fflush.3, fgetwc.3, fgetws.3, flockfile.3, fputwc.3, fputws.3, fread.3, getopt.3, gets.3, getwchar.3, glob.3, iconv.3, longjmp.3, pow.3, printf.3, puts.3, putwchar.3, regex.3, rpc.3, scanf.3, setjmp.3, termios.3, unlocked_stdio.3, wcswidth.3, hd.4, rtc.4, st.4, core.5, dir_colors.5, elf.5, proc.5, arp.7, ascii.7, boot.7, bootparam.7, charsets.7, futex.7, ip.7, iso_8859-11.7, man-pages.7, man.7, mdoc.samples.7, path_resolution.7, pipe.7, posixoptions.7, unicode.7, unix.7, uri.7, utf-8.7, ld.so.8: s/non-/non/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 17:20:12 +00:00
|
|
|
and (nonprelinked) position-independent executables (PIEs)
|
2008-10-27 22:23:21 +00:00
|
|
|
and other shared objects will not honor them.
|
|
|
|
If
|
|
|
|
.B LD_USE_LOAD_BIAS
|
2015-01-10 21:17:18 +00:00
|
|
|
is defined with the value 1, both executables and PIEs
|
2008-10-27 22:23:21 +00:00
|
|
|
will honor the base addresses.
|
|
|
|
If
|
|
|
|
.B LD_USE_LOAD_BIAS
|
|
|
|
is defined with the value 0,
|
|
|
|
neither executables nor PIEs will honor the base addresses.
|
2015-09-13 20:10:47 +00:00
|
|
|
This variable is ignored in secure-execution mode.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_VERBOSE " (since glibc 2.1)"
|
mbind.2, rename.2, sched_setscheduler.2, set_mempolicy.2, syslog.2, argz_add.3, dlopen.3, scanf.3, strtod.3, strtok.3, tcgetpgrp.3, hd.4, cpuset.7, regex.7, ld.so.8: Global fix: s/non-empty/nonempty/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:41:47 +00:00
|
|
|
If set to a nonempty string,
|
2008-10-27 22:23:21 +00:00
|
|
|
output symbol versioning information about the
|
2013-07-15 03:48:22 +00:00
|
|
|
program if the
|
2008-10-27 22:23:21 +00:00
|
|
|
.B LD_TRACE_LOADED_OBJECTS
|
2013-07-15 03:48:22 +00:00
|
|
|
environment variable has been set.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:28:24 +00:00
|
|
|
.BR LD_WARN " (since glibc 2.1.3)
|
mbind.2, rename.2, sched_setscheduler.2, set_mempolicy.2, syslog.2, argz_add.3, dlopen.3, scanf.3, strtod.3, strtok.3, tcgetpgrp.3, hd.4, cpuset.7, regex.7, ld.so.8: Global fix: s/non-empty/nonempty/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:41:47 +00:00
|
|
|
If set to a nonempty string, warn about unresolved symbols.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_PREFER_MAP_32BIT_EXEC " (x86-64 only; since glibc 2.23)"
|
2015-12-16 13:59:39 +00:00
|
|
|
According to the Intel Silvermont software optimization guide, for 64-bit
|
2015-12-16 13:40:40 +00:00
|
|
|
applications, branch prediction performance can be negatively impacted
|
|
|
|
when the target of a branch is more than 4GB away from the branch.
|
2015-12-16 13:59:39 +00:00
|
|
|
If this environment variable is set (to any value),
|
|
|
|
.BR ld.so
|
|
|
|
will first try to map executable pages using the
|
|
|
|
.BR mmap (2)
|
|
|
|
.BR MAP_32BIT
|
|
|
|
flag, and fall back to mapping without that flag if that attempt fails.
|
2015-12-16 14:33:10 +00:00
|
|
|
NB: MAP_32BIT will map to the low 2GB (not 4GB) of the address space.
|
2015-12-16 13:59:39 +00:00
|
|
|
Because
|
|
|
|
.B MAP_32BIT
|
|
|
|
reduces the address range available for address space layout
|
|
|
|
randomization (ASLR),
|
|
|
|
.B LD_PREFER_MAP_32BIT_EXEC
|
|
|
|
is always disabled in secure-execution mode.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH FILES
|
|
|
|
.PD 0
|
|
|
|
.TP
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /lib/ld.so
|
2004-11-03 13:51:07 +00:00
|
|
|
a.out dynamic linker/loader
|
|
|
|
.TP
|
2005-11-02 13:55:25 +00:00
|
|
|
.IR /lib/ld\-linux.so. { 1 , 2 }
|
2004-11-03 13:51:07 +00:00
|
|
|
ELF dynamic linker/loader
|
|
|
|
.TP
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /etc/ld.so.cache
|
2004-11-03 13:51:07 +00:00
|
|
|
File containing a compiled list of directories in which to search for
|
2015-07-10 18:37:59 +00:00
|
|
|
shared objects and an ordered list of candidate shared objects.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /etc/ld.so.preload
|
2015-07-10 18:37:59 +00:00
|
|
|
File containing a whitespace-separated list of ELF shared objects to
|
2004-11-03 13:51:07 +00:00
|
|
|
be loaded before the program.
|
|
|
|
.TP
|
|
|
|
.B lib*.so*
|
2015-07-10 18:37:59 +00:00
|
|
|
shared objects
|
2004-11-03 13:51:07 +00:00
|
|
|
.PD
|
|
|
|
.SH NOTES
|
2015-02-06 06:03:26 +00:00
|
|
|
.SS Hardware capabilities
|
2015-07-10 18:37:59 +00:00
|
|
|
Some shared objects are compiled using hardware-specific instructions which do
|
2015-02-06 06:03:26 +00:00
|
|
|
not exist on every CPU.
|
2015-07-10 18:37:59 +00:00
|
|
|
Such objects should be installed in directories whose names define the
|
2015-02-06 06:03:26 +00:00
|
|
|
required hardware capabilities, such as
|
|
|
|
.IR /usr/lib/sse2/ .
|
|
|
|
The dynamic linker checks these directories against the hardware of the
|
2015-07-10 18:37:59 +00:00
|
|
|
machine and selects the most suitable version of a given shared object.
|
2015-02-06 06:03:26 +00:00
|
|
|
Hardware capability directories can be cascaded to combine CPU features.
|
|
|
|
The list of supported hardware capability names depends on the CPU.
|
|
|
|
The following names are currently recognized:
|
|
|
|
.TP
|
|
|
|
.B Alpha
|
|
|
|
ev4, ev5, ev56, ev6, ev67
|
|
|
|
.TP
|
|
|
|
.B MIPS
|
|
|
|
loongson2e, loongson2f, octeon, octeon2
|
|
|
|
.TP
|
|
|
|
.B PowerPC
|
|
|
|
4xxmac, altivec, arch_2_05, arch_2_06, booke, cellbe, dfp, efpdouble, efpsingle,
|
|
|
|
fpu, ic_snoop, mmu, notb, pa6t, power4, power5, power5+, power6x, ppc32, ppc601,
|
|
|
|
ppc64, smt, spe, ucache, vsx
|
|
|
|
.TP
|
|
|
|
.B SPARC
|
|
|
|
flush, muldiv, stbar, swap, ultra3, v9, v9v, v9v2
|
|
|
|
.TP
|
|
|
|
.B s390
|
|
|
|
dfp, eimm, esan3, etf3enh, g5, highgprs, hpage, ldisp, msa, stfle,
|
|
|
|
z900, z990, z9-109, z10, zarch
|
|
|
|
.TP
|
|
|
|
.B x86 (32-bit only)
|
|
|
|
acpi, apic, clflush, cmov, cx8, dts, fxsr, ht, i386, i486, i586, i686, mca, mmx,
|
|
|
|
mtrr, pat, pbe, pge, pn, pse36, sep, ss, sse, sse2, tm
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH SEE ALSO
|
2014-06-09 10:21:22 +00:00
|
|
|
.BR ld (1),
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR ldd (1),
|
2014-06-09 10:20:04 +00:00
|
|
|
.BR pldd (1),
|
2014-06-10 14:40:48 +00:00
|
|
|
.BR sprof (1),
|
2014-06-09 09:37:41 +00:00
|
|
|
.BR dlopen (3),
|
2012-11-09 05:54:37 +00:00
|
|
|
.BR getauxval (3),
|
2015-09-13 13:39:24 +00:00
|
|
|
.BR capabilities (7),
|
2009-01-12 19:47:47 +00:00
|
|
|
.BR rtld-audit (7),
|
2013-08-07 08:13:48 +00:00
|
|
|
.BR ldconfig (8),
|
|
|
|
.BR sln (8)
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" .SH AUTHORS
|
|
|
|
.\" ld.so: David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus
|
|
|
|
.\" Torvalds, Lars Wirzenius and Mitch D'Souza
|
|
|
|
.\" ld-linux.so: Roland McGrath, Ulrich Drepper and others.
|
|
|
|
.\"
|
|
|
|
.\" In the above, (libc5) stands for David Engel's ld.so/ld-linux.so.
|