diff options
author | peter <peter@FreeBSD.org> | 1996-10-01 01:52:03 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-10-01 01:52:03 +0000 |
commit | 7523d23ee7b9610928e383200f010b495d600ed5 (patch) | |
tree | 12cd8af2040e3c14de37f000299465d28585d53c /libexec/rtld-elf | |
parent | 7ad318175daf080c971b4afb1a9294c3eb579035 (diff) | |
download | FreeBSD-src-7523d23ee7b9610928e383200f010b495d600ed5.zip FreeBSD-src-7523d23ee7b9610928e383200f010b495d600ed5.tar.gz |
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
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r-- | libexec/rtld-elf/rtld.1 | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 565124f..8f9e3fe 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -1,4 +1,4 @@ -.\" $Id: rtld.1,v 1.3 1996/04/20 18:29:48 jdp Exp $ +.\" $Id: rtld.1,v 1.4 1996/09/23 22:22:03 wosch Exp $ .\" .\" Copyright (c) 1995 Paul Kranenburg .\" All rights reserved. @@ -106,7 +106,7 @@ library-name, major-version-number, minor-version-number recognises a number of environment variables that can be used to modify its behaviour as follows: .Pp -.Bl -tag -width "LD_TRACE_LOADED_OBJECTS" +.Bl -tag -width "LD_TRACE_LOADED_OBJECTS_PROGNAME" .It Ev LD_LIBRARY_PATH A colon separated list of directories, overriding the default search path for shared libraries. @@ -129,6 +129,54 @@ When set, causes .Nm to exit after loading the shared objects and printing a summary which includes the absolute pathnames of all objects, to standard output. +.It Ev LD_TRACE_LOADED_OBJECTS_FMT1 +.It Ev LD_TRACE_LOADED_OBJECTS_FMT2 +When set, these variables are interpreted as format strings a la +.Xr printf 3 +to customize the trace output and are used by +.Xr ldd 1 's +.Fl f +option and allows +.Xr ldd 1 +to be operated as a filter more conveniently. +The following conversions can be used: +.Bl -tag -indent "LD_TRACE_LOADED_OBJECTS_FMT1 " -width "xxxx" +.It \&%a +The main program's name +.Po also known as +.Dq __progname +.Pc . +.It \&%A +The value of the environment variable +.Ev LD_TRACE_LOADED_OBJECTS_PROGNAME +.It \&%o +The libary name. +.It \&%m +The library's major version numer. +.It \&%n +The library's minor version numer. +.It \&%p +The full pathname as determined by +.Nm rtld Ns 's +library search rules. +.It \&%x +The library's load address. +.El +.Pp +Additionally, +.Sy \en +and +.Sy \et +are recognised and have their usual meaning. +.\" .It Ev LD_NO_INTERN_SEARCH +.\" When set, +.\" .Nm +.\" does not process any internal search paths that were recorded in the +.\" executable. +.\" .It Ev LD_NOSTD_PATH +.\" When set, do not include a set of built-in standard directory paths for +.\" searching. This might be useful when running on a system with a completely +.\" non-standard filesystem layout. .El .Pp .Sh FILES |