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
|
|
|
.\"
|
pldd.1, bpf.2, chdir.2, clone.2, fanotify_init.2, fanotify_mark.2, intro.2, ipc.2, mount.2, mprotect.2, msgctl.2, msgget.2, msgop.2, pivot_root.2, pkey_alloc.2, poll.2, prctl.2, semctl.2, semget.2, semop.2, setxattr.2, shmctl.2, shmget.2, shmop.2, tkill.2, dlopen.3, exec.3, ftok.3, getutent.3, on_exit.3, strcat.3, cpuid.4, proc.5, capabilities.7, cgroup_namespaces.7, credentials.7, fanotify.7, mount_namespaces.7, namespaces.7, sched.7, signal.7, socket.7, unix.7, user_namespaces.7, vdso.7, xattr.7, ld.so.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-08-02 06:34:32 +00:00
|
|
|
.TH LD.SO 8 2019-08-02 "GNU" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
2017-05-13 11:29:50 +00:00
|
|
|
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:
|
add_key.2, bpf.2, fcntl.2, futex.2, listxattr.2, perf_event_open.2, prctl.2, request_key.2, sigaltstack.2, __ppc_set_ppr_med.3, __ppc_yield.3, getw.3, setbuf.3, setjmp.3, lirc.4, core.5, securetty.5, inode.7, keyrings.7, process-keyring.7, user-keyring.7, ld.so.8: srcfix: use .PP instead of .P
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 23:13:44 +00:00
|
|
|
.PP
|
2017-05-13 11:29:50 +00:00
|
|
|
.I /lib/ld\-linux.so.*
|
2007-05-18 16:06:42 +00:00
|
|
|
[OPTIONS] [PROGRAM [ARGUMENTS]]
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
The programs
|
|
|
|
.B ld.so
|
|
|
|
and
|
2017-05-13 11:29:50 +00:00
|
|
|
.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.
|
getent.1, intro.1, time.1, _exit.2, alloc_hugepages.2, arch_prctl.2, clock_getres.2, getitimer.2, getrusage.2, intro.2, ioctl_console.2, ioctl_list.2, ioctl_tty.2, kill.2, madvise.2, mlock.2, mmap.2, mount.2, open.2, outb.2, perf_event_open.2, ptrace.2, quotactl.2, reboot.2, recv.2, remap_file_pages.2, select.2, semctl.2, send.2, set_tid_address.2, seteuid.2, shmop.2, statfs.2, times.2, truncate.2, uname.2, uselib.2, vm86.2, wait.2, a64l.3, aio_cancel.3, aio_fsync.3, aio_read.3, aio_return.3, aio_suspend.3, aio_write.3, alloca.3, argz_add.3, atexit.3, basename.3, bindresvport.3, cacos.3, cacosh.3, carg.3, casin.3, casinh.3, catan.3, catanh.3, catgets.3, catopen.3, cexp.3, cfree.3, cimag.3, clog.3, conj.3, creal.3, ctime.3, des_crypt.3, dirfd.3, div.3, dlopen.3, envz_add.3, exit.3, fenv.3, flockfile.3, fmtmsg.3, fpclassify.3, fpurge.3, fseeko.3, ftime.3, ftok.3, ftw.3, getcontext.3, getcwd.3, getdate.3, getfsent.3, getgrent.3, getgrnam.3, gethostbyname.3, getipnodebyname.3, getlogin.3, getpwnam.3, getrpcent.3, getspnam.3, getutent.3, gsignal.3, hsearch.3, lockf.3, logb.3, login.3, lseek64.3, makecontext.3, malloc.3, malloc_hook.3, nan.3, nl_langinfo.3, openpty.3, posix_spawn.3, putenv.3, realpath.3, remainder.3, rint.3, rpc.3, rtime.3, scandir.3, setlogmask.3, shm_open.3, sigpause.3, statvfs.3, stdio_ext.3, strfmon.3, strftime.3, strptime.3, strtod.3, strtol.3, strtoul.3, swab.3, sysconf.3, syslog.3, tcgetpgrp.3, tempnam.3, termios.3, tmpfile.3, tmpnam.3, ttyslot.3, tzset.3, ualarm.3, usleep.3, wordexp.3, xcrypt.3, xdr.3, cciss.4, console_codes.4, full.4, hd.4, loop.4, mem.4, null.4, pts.4, ram.4, random.4, tty.4, ttyS.4, vcs.4, networks.5, nsswitch.conf.5, protocols.5, resolv.conf.5, slabinfo.5, termcap.5, ascii.7, boot.7, bootparam.7, charsets.7, icmp.7, inode.7, man.7, netdevice.7, posixoptions.7, ld.so.8: srcfix: use .PP instead of .LP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 23:12:54 +00:00
|
|
|
.PP
|
2004-11-03 13:51:07 +00:00
|
|
|
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.
|
getent.1, intro.1, time.1, _exit.2, alloc_hugepages.2, arch_prctl.2, clock_getres.2, getitimer.2, getrusage.2, intro.2, ioctl_console.2, ioctl_list.2, ioctl_tty.2, kill.2, madvise.2, mlock.2, mmap.2, mount.2, open.2, outb.2, perf_event_open.2, ptrace.2, quotactl.2, reboot.2, recv.2, remap_file_pages.2, select.2, semctl.2, send.2, set_tid_address.2, seteuid.2, shmop.2, statfs.2, times.2, truncate.2, uname.2, uselib.2, vm86.2, wait.2, a64l.3, aio_cancel.3, aio_fsync.3, aio_read.3, aio_return.3, aio_suspend.3, aio_write.3, alloca.3, argz_add.3, atexit.3, basename.3, bindresvport.3, cacos.3, cacosh.3, carg.3, casin.3, casinh.3, catan.3, catanh.3, catgets.3, catopen.3, cexp.3, cfree.3, cimag.3, clog.3, conj.3, creal.3, ctime.3, des_crypt.3, dirfd.3, div.3, dlopen.3, envz_add.3, exit.3, fenv.3, flockfile.3, fmtmsg.3, fpclassify.3, fpurge.3, fseeko.3, ftime.3, ftok.3, ftw.3, getcontext.3, getcwd.3, getdate.3, getfsent.3, getgrent.3, getgrnam.3, gethostbyname.3, getipnodebyname.3, getlogin.3, getpwnam.3, getrpcent.3, getspnam.3, getutent.3, gsignal.3, hsearch.3, lockf.3, logb.3, login.3, lseek64.3, makecontext.3, malloc.3, malloc_hook.3, nan.3, nl_langinfo.3, openpty.3, posix_spawn.3, putenv.3, realpath.3, remainder.3, rint.3, rpc.3, rtime.3, scandir.3, setlogmask.3, shm_open.3, sigpause.3, statvfs.3, stdio_ext.3, strfmon.3, strftime.3, strptime.3, strtod.3, strtol.3, strtoul.3, swab.3, sysconf.3, syslog.3, tcgetpgrp.3, tempnam.3, termios.3, tmpfile.3, tmpnam.3, ttyslot.3, tzset.3, ualarm.3, usleep.3, wordexp.3, xcrypt.3, xdr.3, cciss.4, console_codes.4, full.4, hd.4, loop.4, mem.4, null.4, pts.4, ram.4, random.4, tty.4, ttyS.4, vcs.4, networks.5, nsswitch.conf.5, protocols.5, resolv.conf.5, slabinfo.5, termcap.5, ascii.7, boot.7, bootparam.7, charsets.7, icmp.7, inode.7, man.7, netdevice.7, posixoptions.7, ld.so.8: srcfix: use .PP instead of .LP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 23:12:54 +00:00
|
|
|
.PP
|
2004-11-03 13:51:07 +00:00
|
|
|
The program
|
|
|
|
.B ld.so
|
2019-07-03 12:17:58 +00:00
|
|
|
handles a.out binaries, a binary format used long ago.
|
|
|
|
The program
|
2017-05-13 11:29:50 +00:00
|
|
|
.B ld\-linux.so*
|
|
|
|
(\fI/lib/ld\-linux.so.1\fP for libc5, \fI/lib/ld\-linux.so.2\fP for glibc2)
|
2019-07-03 12:17:58 +00:00
|
|
|
handles binaries that are in the more modern ELF format.
|
|
|
|
Both programs have the same behavior, and use the same
|
|
|
|
support files and programs
|
|
|
|
.RB ( 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
|
2019-07-03 12:17:58 +00:00
|
|
|
.IR /etc/ld.so.conf ).
|
getent.1, intro.1, time.1, _exit.2, alloc_hugepages.2, arch_prctl.2, clock_getres.2, getitimer.2, getrusage.2, intro.2, ioctl_console.2, ioctl_list.2, ioctl_tty.2, kill.2, madvise.2, mlock.2, mmap.2, mount.2, open.2, outb.2, perf_event_open.2, ptrace.2, quotactl.2, reboot.2, recv.2, remap_file_pages.2, select.2, semctl.2, send.2, set_tid_address.2, seteuid.2, shmop.2, statfs.2, times.2, truncate.2, uname.2, uselib.2, vm86.2, wait.2, a64l.3, aio_cancel.3, aio_fsync.3, aio_read.3, aio_return.3, aio_suspend.3, aio_write.3, alloca.3, argz_add.3, atexit.3, basename.3, bindresvport.3, cacos.3, cacosh.3, carg.3, casin.3, casinh.3, catan.3, catanh.3, catgets.3, catopen.3, cexp.3, cfree.3, cimag.3, clog.3, conj.3, creal.3, ctime.3, des_crypt.3, dirfd.3, div.3, dlopen.3, envz_add.3, exit.3, fenv.3, flockfile.3, fmtmsg.3, fpclassify.3, fpurge.3, fseeko.3, ftime.3, ftok.3, ftw.3, getcontext.3, getcwd.3, getdate.3, getfsent.3, getgrent.3, getgrnam.3, gethostbyname.3, getipnodebyname.3, getlogin.3, getpwnam.3, getrpcent.3, getspnam.3, getutent.3, gsignal.3, hsearch.3, lockf.3, logb.3, login.3, lseek64.3, makecontext.3, malloc.3, malloc_hook.3, nan.3, nl_langinfo.3, openpty.3, posix_spawn.3, putenv.3, realpath.3, remainder.3, rint.3, rpc.3, rtime.3, scandir.3, setlogmask.3, shm_open.3, sigpause.3, statvfs.3, stdio_ext.3, strfmon.3, strftime.3, strptime.3, strtod.3, strtol.3, strtoul.3, swab.3, sysconf.3, syslog.3, tcgetpgrp.3, tempnam.3, termios.3, tmpfile.3, tmpnam.3, ttyslot.3, tzset.3, ualarm.3, usleep.3, wordexp.3, xcrypt.3, xdr.3, cciss.4, console_codes.4, full.4, hd.4, loop.4, mem.4, null.4, pts.4, ram.4, random.4, tty.4, ttyS.4, vcs.4, networks.5, nsswitch.conf.5, protocols.5, resolv.conf.5, slabinfo.5, termcap.5, ascii.7, boot.7, bootparam.7, charsets.7, icmp.7, inode.7, man.7, netdevice.7, posixoptions.7, ld.so.8: srcfix: use .PP instead of .LP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 23:12:54 +00:00
|
|
|
.PP
|
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.
|
getent.1, intro.1, time.1, _exit.2, alloc_hugepages.2, arch_prctl.2, clock_getres.2, getitimer.2, getrusage.2, intro.2, ioctl_console.2, ioctl_list.2, ioctl_tty.2, kill.2, madvise.2, mlock.2, mmap.2, mount.2, open.2, outb.2, perf_event_open.2, ptrace.2, quotactl.2, reboot.2, recv.2, remap_file_pages.2, select.2, semctl.2, send.2, set_tid_address.2, seteuid.2, shmop.2, statfs.2, times.2, truncate.2, uname.2, uselib.2, vm86.2, wait.2, a64l.3, aio_cancel.3, aio_fsync.3, aio_read.3, aio_return.3, aio_suspend.3, aio_write.3, alloca.3, argz_add.3, atexit.3, basename.3, bindresvport.3, cacos.3, cacosh.3, carg.3, casin.3, casinh.3, catan.3, catanh.3, catgets.3, catopen.3, cexp.3, cfree.3, cimag.3, clog.3, conj.3, creal.3, ctime.3, des_crypt.3, dirfd.3, div.3, dlopen.3, envz_add.3, exit.3, fenv.3, flockfile.3, fmtmsg.3, fpclassify.3, fpurge.3, fseeko.3, ftime.3, ftok.3, ftw.3, getcontext.3, getcwd.3, getdate.3, getfsent.3, getgrent.3, getgrnam.3, gethostbyname.3, getipnodebyname.3, getlogin.3, getpwnam.3, getrpcent.3, getspnam.3, getutent.3, gsignal.3, hsearch.3, lockf.3, logb.3, login.3, lseek64.3, makecontext.3, malloc.3, malloc_hook.3, nan.3, nl_langinfo.3, openpty.3, posix_spawn.3, putenv.3, realpath.3, remainder.3, rint.3, rpc.3, rtime.3, scandir.3, setlogmask.3, shm_open.3, sigpause.3, statvfs.3, stdio_ext.3, strfmon.3, strftime.3, strptime.3, strtod.3, strtol.3, strtoul.3, swab.3, sysconf.3, syslog.3, tcgetpgrp.3, tempnam.3, termios.3, tmpfile.3, tmpnam.3, ttyslot.3, tzset.3, ualarm.3, usleep.3, wordexp.3, xcrypt.3, xdr.3, cciss.4, console_codes.4, full.4, hd.4, loop.4, mem.4, null.4, pts.4, ram.4, random.4, tty.4, ttyS.4, vcs.4, networks.5, nsswitch.conf.5, protocols.5, resolv.conf.5, slabinfo.5, termcap.5, ascii.7, boot.7, bootparam.7, charsets.7, icmp.7, inode.7, man.7, netdevice.7, posixoptions.7, ld.so.8: srcfix: use .PP instead of .LP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 23:12:54 +00:00
|
|
|
.PP
|
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
|
2018-03-28 03:03:32 +00:00
|
|
|
.BR LD_LIBRARY_PATH ,
|
|
|
|
unless the executable is being run in secure-execution mode (see below),
|
|
|
|
in which case this variable 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
|
2017-07-05 08:35:36 +00:00
|
|
|
of the binary if present.
|
|
|
|
Such directories are searched only to
|
2017-06-29 16:21:36 +00:00
|
|
|
find those objects required by DT_NEEDED (direct dependencies) entries
|
2017-07-05 08:35:36 +00:00
|
|
|
and do not apply to those objects' children,
|
|
|
|
which must themselves have their own DT_RUNPATH entries.
|
|
|
|
This is unlike DT_RPATH, which is applied
|
2017-06-29 16:21:36 +00:00
|
|
|
to searches for all children in the dependency tree.
|
2004-11-03 13:51:07 +00:00
|
|
|
.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
|
2017-05-13 11:56:43 +00:00
|
|
|
The dynamic linker
|
2017-05-03 03:41:44 +00:00
|
|
|
understands certain token strings in an rpath specification
|
|
|
|
(DT_RPATH or DT_RUNPATH).
|
|
|
|
Those strings are substituted as follows:
|
2013-07-15 12:32:17 +00:00
|
|
|
.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
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2020-04-14 09:59:14 +00:00
|
|
|
.in +4n
|
|
|
|
.EX
|
|
|
|
gcc \-Wl,\-rpath,\(aq$ORIGIN/../lib\(aq
|
|
|
|
.EE
|
|
|
|
.in
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
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
|
2019-02-26 11:18:38 +00:00
|
|
|
.BI \-\-audit " list"
|
|
|
|
Use objects named in
|
|
|
|
.I list
|
|
|
|
as auditors.
|
|
|
|
The objects in
|
|
|
|
.I list
|
|
|
|
are delimited by colons.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2017-05-13 11:29:50 +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).
|
2019-02-26 10:06:24 +00:00
|
|
|
The objects in
|
|
|
|
.I list
|
|
|
|
are delimited by colons or spaces.
|
2012-03-20 10:09:15 +00:00
|
|
|
.TP
|
2019-02-26 11:18:38 +00:00
|
|
|
.B \-\-list
|
|
|
|
List all dependencies and how they are resolved.
|
|
|
|
.TP
|
2019-02-26 11:46:47 +00:00
|
|
|
.BR \-\-preload " \fIlist\fP (since glibc 2.30)"
|
|
|
|
Preload the objects specified in
|
|
|
|
.IR list .
|
|
|
|
The objects in
|
|
|
|
.I list
|
|
|
|
are delimited by colons or spaces.
|
|
|
|
The objects are preloaded as explained in the description of the
|
|
|
|
.BR LD_PRELOAD
|
|
|
|
environment variable below.
|
|
|
|
.IP
|
|
|
|
By contrast with
|
|
|
|
.BR LD_PRELOAD ,
|
|
|
|
the
|
|
|
|
.BR \-\-preload
|
|
|
|
option provides a way to perform preloading for a single executable
|
|
|
|
without affecting preloading performed in any child process that executes
|
|
|
|
a new program.
|
|
|
|
.TP
|
2019-02-26 11:18:38 +00:00
|
|
|
.B \-\-verify
|
|
|
|
Verify that program is dynamically linked and this dynamic linker can handle
|
|
|
|
it.
|
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,
|
2019-05-22 19:38:36 +00:00
|
|
|
if the dynamic linker determines that a binary should be
|
|
|
|
run in secure-execution mode,
|
|
|
|
the effects of some environment variables are voided or modified,
|
|
|
|
and furthermore those environment variables are stripped from the environment,
|
|
|
|
so that the program does not even see the definitions.
|
|
|
|
Some of these environment variables affect the operation of
|
|
|
|
the dynamic linker itself, and are described below.
|
|
|
|
Other environment variables treated in this way include:
|
|
|
|
.BR GCONV_PATH ,
|
|
|
|
.BR GETCONF_DIR ,
|
|
|
|
.BR HOSTALIASES ,
|
|
|
|
.BR LOCALDOMAIN ,
|
|
|
|
.BR LOCPATH ,
|
|
|
|
.BR MALLOC_TRACE ,
|
|
|
|
.BR NIS_PATH ,
|
|
|
|
.BR NLSPATH ,
|
|
|
|
.BR RESOLV_HOST_CONF ,
|
|
|
|
.BR RES_OPTIONS ,
|
|
|
|
.BR TMPDIR ,
|
|
|
|
and
|
|
|
|
.BR TZDIR .
|
|
|
|
.PP
|
2017-04-14 07:49:28 +00:00
|
|
|
A binary is executed in secure-execution mode if the
|
2015-09-13 13:39:24 +00:00
|
|
|
.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
|
2017-10-13 10:52:46 +00:00
|
|
|
conferred capabilities to the process.
|
2015-09-13 13:39:24 +00:00
|
|
|
.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.
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2013-07-15 12:32:17 +00:00
|
|
|
.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 :
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2013-07-15 12:32:17 +00:00
|
|
|
.in +4n
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EX
|
2013-07-15 12:32:17 +00:00
|
|
|
$ \fBLD_ASSUME_KERNEL=2.2.5 ./myprog\fP
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EE
|
2013-07-15 12:32:17 +00:00
|
|
|
.in
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
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).
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2013-07-15 12:32:17 +00:00
|
|
|
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
|
2017-05-13 11:56:43 +00:00
|
|
|
ELF libraries at execution time.
|
2018-02-05 21:48:02 +00:00
|
|
|
The items in the list are separated by either colons or semicolons,
|
|
|
|
and there is no support for escaping either separator.
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2015-12-04 20:47:38 +00:00
|
|
|
This variable is ignored in secure-execution mode.
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2016-04-21 12:14:31 +00:00
|
|
|
Within the pathnames specified in
|
|
|
|
.BR LD_LIBRARY_PATH ,
|
2017-05-03 03:41:44 +00:00
|
|
|
the dynamic linker expands the tokens
|
2016-04-21 12:14:31 +00:00
|
|
|
.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:
|
2017-08-15 14:15:21 +00:00
|
|
|
.IP
|
|
|
|
.in +4n
|
|
|
|
.EX
|
|
|
|
$ \fBLD_LIBRARY_PATH='$ORIGIN/$LIB' prog\fP
|
|
|
|
.EE
|
|
|
|
.in
|
|
|
|
.IP
|
2016-04-21 12:14:31 +00:00
|
|
|
(Note the use of single quotes, which prevent expansion of
|
2017-05-03 03:41:44 +00:00
|
|
|
.I $ORIGIN
|
2016-04-21 12:14:31 +00:00
|
|
|
and
|
2017-05-03 03:41:44 +00:00
|
|
|
.I $LIB
|
2016-04-21 12:14:31 +00:00
|
|
|
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.
|
2019-02-26 11:11:48 +00:00
|
|
|
This feature can be used to selectively override functions
|
|
|
|
in other shared objects.
|
|
|
|
.IP
|
2018-02-05 21:48:02 +00:00
|
|
|
The items of the list can be separated by spaces or colons,
|
|
|
|
and there is no support for escaping either separator.
|
2015-07-10 18:37:59 +00:00
|
|
|
The objects are searched for using the rules given under DESCRIPTION.
|
2019-02-26 11:13:23 +00:00
|
|
|
Objects are searched for and added to the link map in the left-to-right
|
|
|
|
order specified in the list.
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2015-09-13 20:10:47 +00:00
|
|
|
In secure-execution mode,
|
2017-05-08 08:45:44 +00:00
|
|
|
preload pathnames containing slashes are ignored.
|
2017-05-08 09:10:37 +00:00
|
|
|
Furthermore, shared objects are preloaded only
|
2017-05-13 10:37:47 +00:00
|
|
|
from the standard search directories and only
|
2017-05-08 08:48:19 +00:00
|
|
|
if they have set-user-ID mode bit enabled (which is not typical).
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2017-01-15 22:35:12 +00:00
|
|
|
Within the names specified in the
|
|
|
|
.BR LD_PRELOAD
|
2017-05-03 03:41:44 +00:00
|
|
|
list, the dynamic linker understands the tokens
|
2016-04-21 12:14:31 +00:00
|
|
|
.IR $ORIGIN ,
|
|
|
|
.IR $LIB ,
|
|
|
|
and
|
|
|
|
.IR $PLATFORM
|
|
|
|
(or the versions using curly braces around the names)
|
|
|
|
as described above in
|
|
|
|
.IR "Rpath token expansion" .
|
2017-05-03 05:00:56 +00:00
|
|
|
(See also the discussion of quoting under the description of
|
|
|
|
.BR LD_LIBRARY_PATH .)
|
2016-04-21 12:14:31 +00:00
|
|
|
.\" Tested with the following:
|
|
|
|
.\"
|
|
|
|
.\" LD_PRELOAD='$LIB/libmod.so' LD_LIBRARY_PATH=. ./prog
|
|
|
|
.\"
|
2017-05-03 03:37:10 +00:00
|
|
|
.\" which will preload the libmod.so in 'lib' or 'lib64', using it
|
2016-04-21 12:14:31 +00:00
|
|
|
.\" in preference to the version in '.'.
|
2019-02-26 11:46:47 +00:00
|
|
|
.IP
|
|
|
|
There are various methods of specifying libraries to be preloaded,
|
|
|
|
and these are handled in the following order:
|
|
|
|
.RS
|
|
|
|
.IP (1) 4
|
|
|
|
The
|
|
|
|
.BR LD_PRELOAD
|
|
|
|
environment variable.
|
|
|
|
.IP (2)
|
|
|
|
The
|
|
|
|
.B \-\-preload
|
|
|
|
command-line option when invoking the dynamic linker directly.
|
|
|
|
.IP (3)
|
|
|
|
The
|
|
|
|
.I /etc/ld.so.preload
|
|
|
|
file (described below).
|
|
|
|
.RE
|
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.
|
getent.1, intro.1, time.1, _exit.2, alloc_hugepages.2, arch_prctl.2, clock_getres.2, getitimer.2, getrusage.2, intro.2, ioctl_console.2, ioctl_list.2, ioctl_tty.2, kill.2, madvise.2, mlock.2, mmap.2, mount.2, open.2, outb.2, perf_event_open.2, ptrace.2, quotactl.2, reboot.2, recv.2, remap_file_pages.2, select.2, semctl.2, send.2, set_tid_address.2, seteuid.2, shmop.2, statfs.2, times.2, truncate.2, uname.2, uselib.2, vm86.2, wait.2, a64l.3, aio_cancel.3, aio_fsync.3, aio_read.3, aio_return.3, aio_suspend.3, aio_write.3, alloca.3, argz_add.3, atexit.3, basename.3, bindresvport.3, cacos.3, cacosh.3, carg.3, casin.3, casinh.3, catan.3, catanh.3, catgets.3, catopen.3, cexp.3, cfree.3, cimag.3, clog.3, conj.3, creal.3, ctime.3, des_crypt.3, dirfd.3, div.3, dlopen.3, envz_add.3, exit.3, fenv.3, flockfile.3, fmtmsg.3, fpclassify.3, fpurge.3, fseeko.3, ftime.3, ftok.3, ftw.3, getcontext.3, getcwd.3, getdate.3, getfsent.3, getgrent.3, getgrnam.3, gethostbyname.3, getipnodebyname.3, getlogin.3, getpwnam.3, getrpcent.3, getspnam.3, getutent.3, gsignal.3, hsearch.3, lockf.3, logb.3, login.3, lseek64.3, makecontext.3, malloc.3, malloc_hook.3, nan.3, nl_langinfo.3, openpty.3, posix_spawn.3, putenv.3, realpath.3, remainder.3, rint.3, rpc.3, rtime.3, scandir.3, setlogmask.3, shm_open.3, sigpause.3, statvfs.3, stdio_ext.3, strfmon.3, strftime.3, strptime.3, strtod.3, strtol.3, strtoul.3, swab.3, sysconf.3, syslog.3, tcgetpgrp.3, tempnam.3, termios.3, tmpfile.3, tmpnam.3, ttyslot.3, tzset.3, ualarm.3, usleep.3, wordexp.3, xcrypt.3, xdr.3, cciss.4, console_codes.4, full.4, hd.4, loop.4, mem.4, null.4, pts.4, ram.4, random.4, tty.4, ttyS.4, vcs.4, networks.5, nsswitch.conf.5, protocols.5, resolv.conf.5, slabinfo.5, termcap.5, ascii.7, boot.7, bootparam.7, charsets.7, icmp.7, inode.7, man.7, netdevice.7, posixoptions.7, ld.so.8: srcfix: use .PP instead of .LP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 23:12:54 +00:00
|
|
|
.PP
|
2004-11-03 13:51:07 +00:00
|
|
|
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)"
|
2019-07-05 08:16:01 +00:00
|
|
|
A list of user-specified, ELF shared objects
|
2009-01-12 06:10:46 +00:00
|
|
|
to be loaded before all others in a separate linker namespace
|
|
|
|
(i.e., one that does not intrude upon the normal symbol bindings that
|
2018-02-05 21:48:02 +00:00
|
|
|
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.
|
2019-07-05 08:16:01 +00:00
|
|
|
The items in the list are colon-separated,
|
|
|
|
and there is no support for escaping the separator.
|
2017-05-13 11:56:43 +00:00
|
|
|
.IP
|
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.
|
2017-05-13 11:56:43 +00:00
|
|
|
.IP
|
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
|
2019-08-26 16:19:21 +00:00
|
|
|
.BR rtld\-audit (7).
|
2009-01-12 06:10:46 +00:00
|
|
|
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" .
|
2017-05-13 11:56:43 +00:00
|
|
|
.IP
|
2017-01-15 22:35:12 +00:00
|
|
|
Within the names specified in the
|
|
|
|
.BR LD_AUDIT
|
2017-05-03 03:41:44 +00:00
|
|
|
list, the dynamic linker understands the tokens
|
2017-01-15 22:32:41 +00:00
|
|
|
.IR $ORIGIN ,
|
|
|
|
.IR $LIB ,
|
|
|
|
and
|
|
|
|
.IR $PLATFORM
|
|
|
|
(or the versions using curly braces around the names)
|
|
|
|
as described above in
|
|
|
|
.IR "Rpath token expansion" .
|
2017-05-03 05:00:56 +00:00
|
|
|
(See also the discussion of quoting under the description of
|
|
|
|
.BR LD_LIBRARY_PATH .)
|
2017-05-13 11:56:43 +00:00
|
|
|
.IP
|
2017-01-15 22:00:52 +00:00
|
|
|
Since glibc 2.13,
|
|
|
|
.\" commit 8e9f92e9d5d7737afdacf79b76d98c4c42980508
|
|
|
|
in secure-execution mode,
|
|
|
|
names in the audit list that contain slashes are ignored,
|
|
|
|
and only shared objects in the standard search directories that
|
|
|
|
have the set-user-ID mode bit enabled are loaded.
|
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)
|
2017-01-15 20:32:14 +00:00
|
|
|
after resolving a function symbol.
|
2017-01-15 20:42:18 +00:00
|
|
|
By combining the use of this variable with
|
|
|
|
.BR LD_DEBUG
|
|
|
|
(with the categories
|
|
|
|
.IR bindings
|
|
|
|
and
|
|
|
|
.IR symbols ),
|
|
|
|
one can observe all run-time function bindings.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2016-09-11 10:27:03 +00:00
|
|
|
.BR LD_DEBUG " (since glibc 2.1)"
|
2017-05-13 10:58:31 +00:00
|
|
|
Output verbose debugging information about operation of the dynamic linker.
|
2017-05-13 11:04:54 +00:00
|
|
|
The content of this variable is one of more of the following categories,
|
|
|
|
separated by colons, commas, or (if the value is quoted) spaces:
|
|
|
|
.RS
|
|
|
|
.TP 12
|
|
|
|
.I help
|
2017-05-13 10:56:36 +00:00
|
|
|
Specifying
|
|
|
|
.IR help
|
|
|
|
in the value of this variable does not run the specified program,
|
2016-09-10 16:36:07 +00:00
|
|
|
and displays a help message about which categories can be specified in this
|
2004-11-03 13:51:07 +00:00
|
|
|
environment variable.
|
2017-05-13 11:04:54 +00:00
|
|
|
.TP
|
|
|
|
.I all
|
|
|
|
Print all debugging information (except
|
|
|
|
.IR statistics
|
|
|
|
and
|
|
|
|
.IR unused ;
|
|
|
|
see below).
|
|
|
|
.TP
|
2016-09-10 16:36:07 +00:00
|
|
|
.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
|
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)"
|
2017-05-12 11:55:41 +00:00
|
|
|
By default,
|
2004-11-03 13:51:07 +00:00
|
|
|
.B LD_DEBUG
|
2017-05-12 11:55:41 +00:00
|
|
|
output is written to standard error.
|
|
|
|
If
|
|
|
|
.B LD_DEBUG_OUTPUT
|
|
|
|
is defined, then output is written to the pathname specified by its value,
|
|
|
|
with the suffix "." (dot) followed by the process ID appended to the pathname.
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
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)"
|
2017-05-08 14:12:31 +00:00
|
|
|
By default, when searching shared libraries to resolve a symbol reference,
|
|
|
|
the dynamic linker will resolve to the first definition it finds.
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2017-05-08 14:12:31 +00:00
|
|
|
Old glibc versions (before 2.2), provided a different behavior:
|
|
|
|
if the linker found a symbol that was weak,
|
|
|
|
it would remember that symbol and
|
|
|
|
keep searching in the remaining shared libraries.
|
|
|
|
If it subsequently found a strong definition of the same symbol,
|
|
|
|
then it would instead use that definition.
|
|
|
|
(If no further symbol was found,
|
|
|
|
then the dynamic linker would use the weak symbol that it initially found.)
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2017-05-08 14:12:31 +00:00
|
|
|
The old glibc behavior was nonstandard.
|
2017-05-13 10:37:47 +00:00
|
|
|
(Standard practice is that the distinction between
|
2017-05-08 14:12:31 +00:00
|
|
|
weak and strong symbols should have effect only at static link time.)
|
2017-05-10 07:54:20 +00:00
|
|
|
In glibc 2.2,
|
2017-05-08 14:12:31 +00:00
|
|
|
.\" More precisely 2.1.92
|
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)
|
2017-05-08 14:12:31 +00:00
|
|
|
the dynamic linker was modified to provide the current behavior
|
|
|
|
(which was the behavior that was provided by most other implementations
|
|
|
|
at that time).
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2017-05-08 14:12:31 +00:00
|
|
|
Defining the
|
|
|
|
.B LD_DYNAMIC_WEAK
|
|
|
|
environment variable (with any value) provides
|
|
|
|
the old (nonstandard) glibc behavior,
|
|
|
|
whereby a weak symbol in one shared library may be overridden by
|
|
|
|
a strong symbol subsequently discovered in another shared library.
|
|
|
|
(Note that even when this variable is set,
|
|
|
|
a strong symbol in a shared library will not override
|
|
|
|
a weak definition of the same symbol in the main program.)
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
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.
|
2017-05-08 12:41:23 +00:00
|
|
|
.\" Used only if $ORIGIN can't be determined by normal means
|
|
|
|
.\" (from the origin path saved at load time, or from /proc/self/exe)?
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
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.
|
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".
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2017-05-08 12:46:16 +00:00
|
|
|
Since glibc 2.2.5,
|
|
|
|
.BR LD_PROFILE
|
2017-05-13 11:29:50 +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_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 .
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
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.
|
2017-05-08 12:46:16 +00:00
|
|
|
(This detail is relevant only before glibc 2.2.5,
|
|
|
|
since in later glibc versions,
|
|
|
|
.B LD_PROFILE
|
|
|
|
is also ignored in secure-execution mode.)
|
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)).
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2017-05-08 12:49:23 +00:00
|
|
|
Since glibc 2.3.4,
|
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)"
|
2017-01-15 22:40:46 +00:00
|
|
|
If this environment variable is defined,
|
2015-12-16 14:32:04 +00:00
|
|
|
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.
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
2017-05-08 13:03:22 +00:00
|
|
|
Since glibc 2.3.3, 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
|
dup.2, fallocate.2, futex.2, ioctl_fat.2, ioctl_ficlonerange.2, ioctl_fideduperange.2, madvise.2, membarrier.2, mprotect.2, open.2, openat2.2, perf_event_open.2, perfmonctl.2, pipe.2, process_vm_readv.2, s390_pci_mmio_write.2, s390_runtime_instr.2, s390_sthyi.2, set_thread_area.2, sigprocmask.2, subpage_prot.2, unshare.2, cmsg.3, newlocale.3, pthread_setname_np.3, strfmon.3, strfromd.3, tsearch.3, tcp.7, ld.so.8: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-11 05:45:09 +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
|
arch_prctl.2, ioctl_fideduperange.2, ioctl_getfsmap.2, kexec_load.2, madvise.2, mbind.2, mmap.2, mmap2.2, mprotect.2, perf_event_open.2, process_vm_readv.2, set_mempolicy.2, shmget.2, subpage_prot.2, pthread_attr_init.3, pthread_create.3, pthread_getattr_np.3, regex.3, wavelan.4, filesystems.5, proc.5, bootparam.7, raw.7, tcp.7, units.7, ld.so.8: Add a non-breaking space between a number and a unit (prefix)
Based on a patch by Bjarni Ingi Gislason.
According to SI, ""The numerical value always precedes the unit,
and a space is always used to separate the unit from the number
[...] The only exceptions to this rule are for the unit symbols
for degree, minute, and second for plane angle."
Cowritten-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 10:12:59 +00:00
|
|
|
when the target of a branch is more than 4\ GB away from the branch.
|
2015-12-16 13:59:39 +00:00
|
|
|
If this environment variable is set (to any value),
|
2017-05-13 11:56:43 +00:00
|
|
|
the dynamic linker
|
2015-12-16 13:59:39 +00:00
|
|
|
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.
|
arch_prctl.2, ioctl_fideduperange.2, ioctl_getfsmap.2, kexec_load.2, madvise.2, mbind.2, mmap.2, mmap2.2, mprotect.2, perf_event_open.2, process_vm_readv.2, set_mempolicy.2, shmget.2, subpage_prot.2, pthread_attr_init.3, pthread_create.3, pthread_getattr_np.3, regex.3, wavelan.4, filesystems.5, proc.5, bootparam.7, raw.7, tcp.7, units.7, ld.so.8: Add a non-breaking space between a number and a unit (prefix)
Based on a patch by Bjarni Ingi Gislason.
According to SI, ""The numerical value always precedes the unit,
and a space is always used to separate the unit from the number
[...] The only exceptions to this rule are for the unit symbols
for degree, minute, and second for plane angle."
Cowritten-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 10:12:59 +00:00
|
|
|
NB: MAP_32BIT will map to the low 2\ GB (not 4\ GB) of the address space.
|
iconv.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 00:52:54 +00:00
|
|
|
.IP
|
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
|
|
|
|
.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.
|
2017-05-03 05:11:36 +00:00
|
|
|
See
|
|
|
|
.BR ldconfig (8).
|
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.
|
2017-05-03 05:09:56 +00:00
|
|
|
See the discussion of
|
|
|
|
.BR LD_PRELOAD
|
|
|
|
above.
|
|
|
|
If both
|
|
|
|
.BR LD_PRELOAD
|
|
|
|
and
|
|
|
|
.I /etc/ld.so.preload
|
|
|
|
are employed, the libraries specified by
|
|
|
|
.BR LD_PRELOAD
|
|
|
|
are preloaded first.
|
|
|
|
.I /etc/ld.so.preload
|
|
|
|
has a system-wide effect,
|
|
|
|
causing the specified libraries to be preloaded for
|
|
|
|
all programs that are executed on the system.
|
|
|
|
(This is usually undesirable,
|
|
|
|
and is typically employed only as an emergency remedy, for example,
|
|
|
|
as a temporary workaround to a library misconfiguration issue.)
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2018-01-06 22:02:17 +00:00
|
|
|
.I lib*.so*
|
2015-07-10 18:37:59 +00:00
|
|
|
shared objects
|
2004-11-03 13:51:07 +00:00
|
|
|
.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:
|
2019-05-23 10:28:23 +00:00
|
|
|
.\" Presumably, this info comes from sysdeps/i386/dl-procinfo.c and
|
|
|
|
.\" similar files
|
2015-02-06 06:03:26 +00:00
|
|
|
.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),
|
2017-05-05 03:38:39 +00:00
|
|
|
.BR elf (5),
|
2015-09-13 13:39:24 +00:00
|
|
|
.BR capabilities (7),
|
2019-08-26 16:19:21 +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
|
2017-05-13 11:29:50 +00:00
|
|
|
.\" ld\-linux.so: Roland McGrath, Ulrich Drepper and others.
|
2004-11-03 13:51:07 +00:00
|
|
|
.\"
|
2017-05-13 11:29:50 +00:00
|
|
|
.\" In the above, (libc5) stands for David Engel's ld.so/ld\-linux.so.
|