History log of /freebsd-10.0-release/libexec/rtld-elf/rtld.1
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 238471 15-Jul-2012 kib

Import the DragonFly BSD commit 4f0bc915b65fcf5a23214f6d221d65c80be68ad4
by John Marino <draco@marino.st>, with the following (edited) commit
message
Date: Sat, 24 Mar 2012 06:40:50 +0100
Subject: [PATCH 1/1] rtld: Implement DT_RUNPATH and -z nodefaultlib

DT_RUNPATH is incorrectly being considered as an alias of DT_RPATH. The
purpose of DT_RUNPATH is to have two different types of rpath: one that
can be overridden by the environment variable LD_LIBRARY_PATH and one that
can't. With the currently implementation, LD_LIBRARY_PATH will always
trump any embedded rpath or runpath tags.

Current path search order by rtld:
==================================
LD_LIBRARY_PATH
DT_RPATH / DT_RUNPATH (always the same)
ldconfig hints file (default: /var/run/ld-elf.so.hints)
/usr/lib

New path search order by rtld:
==============================
DT_RPATH of the calling object if no DT_RUNPATH
DT_RPATH of the main binary if no DT_RUNPATH and binary isn't calling obj
LD_LIBRARY_PATH
DT_RUNPATH
ldconfig hints file
/usr/lib

The new path search matches how the linux runtime loader works. The other
major added feature is support for linker flag "-z nodefaultlib". When
this flag is passed to the linker, rtld will skip all references to the
standard library search path ("/usr/lib" in this case but it could handle
more color delimited paths) except in DT_RPATH and DT_RUNPATH.

New path search order by rtld with -z nodefaultlib flag set:
============================================================
DT_RPATH of the calling object if no DT_RUNPATH
DT_RPATH of the main binary if no DT_RUNPATH and binary isn't calling obj
LD_LIBRARY_PATH
DT_RUNPATH
ldconfig hints file (skips all references to /usr/lib)

FreeBSD notes:
- we fixed some bugs which were submitted to DragonFly and merged there
as commit 1ff8a2bd3eb6e5587174c6a983303ea3a79e0002;
- we added LD_LIBRARY_PATH_RPATH environment variable to switch to
the previous behaviour of considering DT_RPATH a synonym for DT_RUNPATH;
- the FreeBSD default search path is /lib:/usr/lib and not /usr/lib.

Reviewed by: kan
MFC after: 1 month
MFC note: flip the ld_library_path_rpath default value for stable/9


# 216695 25-Dec-2010 kib

Implement support for ELF filters in rtld. Both normal and auxillary
filters are implemented.

Filtees are loaded on demand, unless LD_LOADFLTR environment variable
is set or -z loadfltr was specified during the linking. This forces
rtld to upgrade read-locked rtld_bind_lock to write lock when it
encounters an object with filter during symbol lookup.

Consolidate common arguments of the symbol lookup functions in the
SymLook structure. Track the state of the rtld locks in the
RtldLockState structure. Pass local RtldLockState through the rtld
symbol lookup calls to allow lock upgrades.

Reviewed by: kan
Tested by: Mykola Dzham <i levsha me>, nwhitehorn (powerpc)


# 213573 08-Oct-2010 uqs

mdoc: drop redundant .Pp and .LP calls

They have no effect when coming in pairs, or before .Bl/.Bd


# 190624 01-Apr-2009 kib

Document RTLD_NODELETE, -z nodelete and -z origin support.


# 190324 23-Mar-2009 delphij

Support for a new environment variable, LD_ELF_HINTS_PATH for overriding
the rtld hints file. This environment variable would be unset if the
process is considered as tainted with setuid/setgid. This feature gives
a convenient way of using a custom set of shared library that is not
located in the default location and switch back.

Feature requested by: iXsystems
Original patch by: John Hixson
MFC after: 2 weeks


# 179012 15-May-2008 bms

Make the meaning of the %A format specifier, as passed to
LD_TRACE_LOADED_OBJECTS_FMT[12], more obvious for users like me.


# 169663 17-May-2007 csjp

Update the man page to reflect that certain variables will be unset in
the case that the program is set-user-ID or set-group-ID. Add missing
annotations for LIBMAP and LIBMAP_DISABLE.


# 169501 12-May-2007 pav

Remove %m formatter, it's ifdef 0'ed in the code from the very beginning

MFC after: 1 week


# 169500 12-May-2007 pav

Expand documentation for LD_TRACE_LOADED_OBJECTS_FMT? variables

PR: docs/66265 (inspired by)
Submitted by: Michel Lavondes <fox@vader.aacc.cc.md.us>
MFC after: 1 week


# 166205 23-Jan-2007 jhb

Document LD_UTRACE.

MFC after: 3 days


# 162387 17-Sep-2006 ru

Markup fixes.


# 157169 26-Mar-2006 pav

- Document LD_32_* environment variables
- Mention 32-bit files in FILES section

MFC after: 1 week


# 147365 14-Jun-2005 ru

Removed trailing whitespace.

Approved by: re (blanket)


# 141232 04-Feb-2005 mdodd

Description from Dan:

Another handy libmap patch. Lets you do stuff like this:

LD_LIBMAP="libpthread.so.1=libthr.so.1" mythreadedapp

If you already have a program-specific override in libmap.conf, note
that you must use a program-specific override in LD_LIBMAP:

LD_LIBMAP="[mythreadedapp],libpthread.so.1=libthr.so.1" mythreadedapp

PR: bin/74471
Submitted by: Dan Nelson <dnelson AT allantgroup.com>
MFC after: 2 weeks


# 116566 19-Jun-2003 mdodd

LD_DUMP_REL_PRE and LD_DUMP_REL_POST don't output to stderr; don't
claim that they do.


# 116563 19-Jun-2003 mdodd

Provide a mechanism for dumping relocation information.

Setting the LD_DUMP_REL_PRE or LD_DUMP_REL_POST environment variables
cause rtld-elf to output a table of all relocations.

This is useful for debugging.


# 115697 02-Jun-2003 ru

Assorted mdoc(7) fixes.


# 115444 31-May-2003 mdodd

Use the environment variable LD_LIBMAP_DISABLE to disable
libmap.conf(5) functionality.


# 115107 17-May-2003 rwatson

Since libmap.conf is referenced in rtld.1, include it in the references
section.

Approved by: re (scottl)


# 115086 16-May-2003 ru

mdoc(7) police: Normalize the FILES section.

Approved by: re (blanket)


# 113229 07-Apr-2003 mdodd

Dynamic object dependency mapping: libmap.

This is an optional feature, disabled by default.

This will be useful to people testing the various POSIX threading
libraries under -CURRENT but can easily serve other needs.


# 110836 13-Feb-2003 phantom

Advertize rtld(1) as ld.so(1) in manual pages world


# 107788 12-Dec-2002 ru

Uniformly refer to a file system as "file system".

Approved by: re


# 99500 06-Jul-2002 charnier

The .Nm utility


# 90755 17-Feb-2002 obrien

Add support such that if LD_TRACE_LOADED_OBJECTS_ALL is defined to a
non-empty string in the environment; we indicate which objects caused
each object to be loaded.

PR: 30908
Submitted-by: Mike Meyer <mwm@mired.org>


# 89230 10-Jan-2002 ru

mdoc(7) police: tidy up.


# 81251 07-Aug-2001 ru

mdoc(7) police:

Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.


# 79529 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


# 79454 09-Jul-2001 dd

mdoc(7) police: remove extraneous .Pp before and/or after .Sh.


# 79366 06-Jul-2001 ru

mdoc(7) police: sort SEE ALSO xrefs (sort -b -f +2 -3 +1 -2).


# 71099 16-Jan-2001 ru

Prepare for mdoc(7)NG.


# 70227 20-Dec-2000 ru

Prepare for mdoc(7)NG.


# 62271 30-Jun-2000 sheldonh

Only punctuation is an allowed argument type for open-close macros
such as Po/Pc, as explained by phantom.

Reported by: billf


# 58720 28-Mar-2000 sheldonh

Cross-reference ldd(1) in rtld(1) and vice versa.


# 56790 29-Jan-2000 jdp

Add a manual page for the ELF dynamic linker. I initially created
rtld.1 by means of a repository copy from "src/libexec/rtld-aout/rtld.1".
Then I edited it to make it (more) accurate for the ELF dynamic
linker.


# 51746 28-Sep-1999 phantom

.Nm += "rtld"
apropos(1) now knows about rtld(1) manpage.


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 29329 13-Sep-1997 wosch

spelling corrections.

PR: docs/4450
Submitted by: josh@quick.net


# 26195 27-May-1997 max

Typo fix.
PR: 3693
Submitted by: Kazuo Horikawa <k-horik@yk.rim.or.jp>


# 22996 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21819 17-Jan-1997 jdp

Pay attention to the environment variable "LD_IGNORE_MISSING_OBJECTS".
If it is set to a nonempty string, then simply skip any missing
shared libraries. This came up in a discussion long ago as a
potentially useful feature at sysinstall time. For example, an
X11 utility could be used without the X libraries being present,
provided the utility had a mode in which no X functions were actually
called.


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 21635 12-Jan-1997 wosch

Sort cross references.


# 21578 11-Jan-1997 jdp

Correct typos and spelling errors.


# 21577 11-Jan-1997 jdp

Add support for the LD_BIND_NOW environment variable. If it is set to a
nonempty string, then function calls are relocated at program start-up
rather than lazily. This variable is standard on Sun and SVR4 systems.

The dlopen() function now supports both lazy and immediate binding, as
determined by its "mode" argument, which can be either 1 (RTLD_LAZY) or
2 (RTLD_NOW). I will add defines of these symbols to <dlfcn.h> as soon
as I've done a little more checking to make sure they won't cause
collisions or bootstrapping problems that would break "make world".

The "LD_*" environment variables which alter dynamic linker behavior are
now treated as unset if they are set to the empty string. This agrees
with the standard SVR4 conventions for the dynamic linker.

Add a work-around for programs compiled with certain buggy versions of
crt0.o. The buggy versions failed to set the "crt_ldso" member of the
interface structure. This caused certain error messages from the
dynamic linker to begin with "(null)" instead of the pathname of the
dynamic linker.


# 20930 26-Dec-1996 swallace

Fix spelling error in manpage.


# 19010 18-Oct-1996 jdp

Fix two minor typos in the manual page.


# 18599 30-Sep-1996 peter

Update to handle new version ld.so.hints and info in executable for
configurable fallback search paths, as well as new crt interface version.

Also:
- even faster getenv(), get all environment variable settings in a single
pass.
- ldd printf-like format specifications
- minor code cleanups, one vsprintf -> vsnprintf (harmless)

The library search sequence is a little more complete now. Before,
it'd search $LD_LIBRARY_PATH (by opendir/readdir/closedir), then read
the hints file, then read /usr/lib (again by scanning thr directory). It
would then fail if there was no "found" library.

Now, it does LD_LIBRARY_PATH and the hints file the same, but then uses
a longer fallback path. The -R path is fetched from the executable if
specified at build time, the ldconfig path is appended, and /usr/lib is
appended to that. Duplicates are suppressed. This means that simply
placing a new library in /usr/local/lib will work (the same as it did in
/usr/lib) without needing ldconfig -m. It will find it quicker if the
ldconfig is run though.

Similar changes have been made to the NetBSD ld.so, but ours is rather
different now due to John Polstra's speedups and fixes from a while back.

The ldd printf-like format support came direct from NetBSD.

Reviewed by: nate, jdp


# 18480 23-Sep-1996 wosch

add missing comma(s) in .Xr macros


# 15326 20-Apr-1996 jdp

Implement support for LD_PRELOAD in the dynamic linker. Remove
descriptions of LD_NO_INTERN_SEARCH and LD_NOSTD_PATH from the manual
page, since they are not supported.

Submitted by: Doug Ambrisko <ambrisko@ambrisko.roble.com>


# 11198 05-Oct-1995 nate

This is a FreeBSD manpage, not a NetBSD manpage. :)


# 10335 26-Aug-1995 joerg

Import Paul Kranenburg's man page for ld.so (aka. rtld).

Obtained from: NetBSD