1 .\" $FreeBSD: src/libexec/rtld-elf/rtld.1,v 1.18.2.7 2002/01/10 17:51:28 ru Exp $
3 .\" Copyright (c) 1995 Paul Kranenburg
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\" must display the following acknowledgment:
16 .\" This product includes software developed by Paul Kranenburg.
17 .\" 3. The name of the author may not be used to endorse or promote products
18 .\" derived from this software without specific prior written permission
20 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 .Nd run-time link-editor
40 is a self-contained shared object providing run-time
41 support for loading and link-editing shared objects into a process'
43 It is also commonly known as the dynamic linker.
44 It uses the data structures
45 contained within dynamically linked programs to determine which shared
46 libraries are needed and loads them using the
50 After all shared libraries have been successfully loaded,
52 proceeds to resolve external references from both the main program and
54 A mechanism is provided for initialization routines
55 to be called on a per-object basis, giving a shared object an opportunity
56 to perform any extra set-up before execution of the program proper begins.
57 This is useful for C++ libraries that contain static constructors.
60 itself is loaded by the kernel together with any dynamically-linked
61 program that is to be executed.
62 The kernel transfers control to the
64 After the dynamic linker has finished loading,
65 relocating, and initializing the program and its required shared
66 objects, it transfers control to the entry point of the program.
68 To locate the required shared objects in the filesystem,
77 recognizes a number of environment variables that can be used to modify
78 its behaviour as follows:
80 .Bl -tag -width ".Ev LD_LIBRARY_PATH"
81 .It Ev LD_LIBRARY_PATH
82 A colon separated list of directories, overriding the default search path
84 This is ignored for set-user-ID and set-group-ID programs.
86 A list of shared libraries, separated by colons and/or white space,
87 to be linked in before any
88 other shared libraries.
89 If the directory is not specified then
90 the directories specified by
92 will be searched first
93 followed by the set of built-in standard directories.
94 This is ignored for set-user-ID and set-group-ID programs.
96 When set to a nonempty string, causes
98 to relocate all external function calls before starting execution of the
100 Normally, function calls are bound lazily, at the first call
103 increases the start-up time of a program, but it avoids run-time
104 surprises caused by unexpectedly undefined functions.
105 .It Ev LD_TRACE_LOADED_OBJECTS
106 When set to a nonempty string, causes
108 to exit after loading the shared objects and printing a summary which includes
109 the absolute pathnames of all objects, to standard output.
110 .It Ev LD_TRACE_LOADED_OBJECTS_FMT1
111 .It Ev LD_TRACE_LOADED_OBJECTS_FMT2
112 When set, these variables are interpreted as format strings a la
114 to customize the trace output and are used by
119 to be operated as a filter more conveniently.
120 The following conversions can be used:
123 The main program's name
127 The value of the environment variable
128 .Ev LD_TRACE_LOADED_OBJECTS_PROGNAME
132 The library's major version number.
134 The full pathname as determined by
136 library search rules.
138 The library's load address.
145 are recognized and have their usual meaning.
148 .Bl -tag -width indent
149 .It Pa /var/run/ld-elf.so.hints