]> git.saurik.com Git - apple/dyld.git/blame - doc/man/man1/dyld.1
dyld-97.1.tar.gz
[apple/dyld.git] / doc / man / man1 / dyld.1
CommitLineData
bac542e6 1.TH DYLD 1 "March 23, 2007" "Apple Inc."
0959b6d4
A
2.SH NAME
3dyld \- the dynamic link editor
4.SH SYNOPSIS
5DYLD_FRAMEWORK_PATH
6.br
7DYLD_FALLBACK_FRAMEWORK_PATH
8.br
9DYLD_LIBRARY_PATH
10.br
11DYLD_FALLBACK_LIBRARY_PATH
12.br
13DYLD_ROOT_PATH
14.br
bac542e6
A
15DYLD_SHARED_REGION
16.br
0959b6d4
A
17DYLD_INSERT_LIBRARIES
18.br
19DYLD_FORCE_FLAT_NAMESPACE
20.br
21DYLD_IMAGE_SUFFIX
22.br
23DYLD_PRINT_OPTS
24.br
25DYLD_PRINT_ENV
26.br
27DYLD_PRINT_LIBRARIES
28.br
29DYLD_PRINT_LIBRARIES_POST_LAUNCH
30.br
31DYLD_BIND_AT_LAUNCH
32.br
bac542e6 33DYLD_NO_FIX_PREBINDING
0959b6d4 34.br
bac542e6 35DYLD_DISABLE_DOFS
0959b6d4
A
36.br
37DYLD_PRINT_APIS
38.br
39DYLD_PRINT_BINDINGS
40.br
41DYLD_PRINT_INITIALIZERS
42.br
43DYLD_PRINT_REBASINGS
44.br
45DYLD_PRINT_SEGMENTS
46.br
47DYLD_PRINT_STATISTICS
bac542e6
A
48.br
49DYLD_PRINT_DOFS
0959b6d4
A
50.SH DESCRIPTION
51The dynamic linker uses the following environment variables.
52They affect any program that uses the dynamic linker.
53.TP
54.B DYLD_FRAMEWORK_PATH
55This is a colon separated list of directories that contain frameworks.
56The dynamic linker searches these directories before it searches for the
57framework by its install name.
58It allows you to test new versions of existing
59frameworks. (A framework is a library install name that ends in the form
60XXX.framework/Versions/YYY/XXX or XXX.framework/XXX, where XXX and YYY are any
61name.)
62.IP
63For each framework that a program uses, the dynamic linker looks for the
64framework in each directory in
65.SM DYLD_FRAMEWORK_PATH
66in turn. If it looks in all the directories and can't find the framework, it
67searches the directories in
68.SM DYLD_LIBRARY_PATH
69in turn. If it still can't find the framework, it then searches
70.SM DYLD_FALLBACK_FRAMEWORK_PATH
71and
72.SM DYLD_FALLBACK_LIBRARY_PATH
73in turn.
74.IP
75Use the
76.B \-L
77option to
78.IR otool (1).
79to discover the frameworks and shared libraries that the executable
80is linked against.
81.TP
82.B DYLD_FALLBACK_FRAMEWORK_PATH
83This is a colon separated list of directories that contain frameworks.
84It is used as the default location for frameworks not found in their install
85path.
86
87By default, it is set to
88/Library/Frameworks:/Network/Library/Frameworks:/System/Library/Frameworks
89.TP
90.B DYLD_LIBRARY_PATH
91This is a colon separated list of directories that contain libraries. The
92dynamic linker searches these directories before it searches the default
93locations for libraries. It allows you to test new versions of existing
94libraries.
95.IP
96For each library that a program uses, the dynamic linker looks for it in each
97directory in
98.SM DYLD_LIBRARY_PATH
99in turn. If it still can't find the library, it then searches
100.SM DYLD_FALLBACK_FRAMEWORK_PATH
101and
102.SM DYLD_FALLBACK_LIBRARY_PATH
103in turn.
104.IP
105Use the
106.B \-L
107option to
108.IR otool (1).
109to discover the frameworks and shared libraries that the executable
110is linked against.
111.TP
112.B DYLD_FALLBACK_LIBRARY_PATH
113This is a colon separated list of directories that contain libraries.
114It is used as the default location for libraries not found in their install
115path.
116By default, it is set
117to $(HOME)/lib:/usr/local/lib:/lib:/usr/lib.
118.TP
119.B DYLD_ROOT_PATH
120This is a colon separated list of directories. The dynamic linker will prepend each of
121this directory paths to every image access until a file is found.
122.TP
bac542e6
A
123.B DYLD_SHARED_REGION
124This can be "use" (the default), "avoid", or "private". Settting it to
125"avoid" tells dyld to not use the shared cache. All OS dylibs are loaded
126dynamically just like every other dylib. Setting it to "private" tells
127dyld to remove the shared region from the process address space and mmap()
128back in a private copy of the dyld shared cache in the shared region address
129range. This is only useful if the shared cache on disk has been updated
130and is different than the shared cache in use.
131.TP
0959b6d4
A
132.B DYLD_INSERT_LIBRARIES
133This is a colon separated list of dynamic libraries to load before the ones
134specified in the program. This lets you test new modules of existing dynamic
135shared libraries that are used in flat-namespace images by loading a temporary
136dynamic shared library with just the new modules. Note that this has no
137effect on images built a two-level namespace images using a dynamic shared
138library unless
139.SM DYLD_FORCE_FLAT_NAMESPACE
140is also used.
141.TP
142.B DYLD_FORCE_FLAT_NAMESPACE
143Force all images in the program to be linked as flat-namespace images and ignore
144any two-level namespace bindings. This may cause programs to fail to execute
145with a multiply defined symbol error if two-level namespace images are used to
146allow the images to have multiply defined symbols.
147.TP
148.B DYLD_IMAGE_SUFFIX
149This is set to a string of a suffix to try to be used for all shared libraries
150used by the program. For libraries ending in ".dylib" the suffix is applied
151just before the ".dylib". For all other libraries the suffix is appended to the
152library name. This is useful for using conventional "_profile" and "_debug"
153libraries and frameworks.
154.TP
155.B DYLD_PRINT_OPTS
156When this is set, the dynamic linker writes to file descriptor 2 (normally
157standard error) the command line options.
158.TP
159.B DYLD_PRINT_ENV
160When this is set, the dynamic linker writes to file descriptor 2 (normally
161standard error) the environment variables.
162.TP
163.B DYLD_PRINT_LIBRARIES
164When this is set, the dynamic linker writes to file descriptor 2 (normally
165standard error) the filenames of the libraries the program is using.
166This is useful to make sure that the use of
167.SM DYLD_LIBRARY_PATH
168is getting what you want.
169.TP
170.B DYLD_PRINT_LIBRARIES_POST_LAUNCH
171This does the same as
172.SM DYLD_PRINT_LIBRARIES
173but the printing starts after the program gets to its entry point.
174.TP
175.B DYLD_BIND_AT_LAUNCH
176When this is set, the dynamic linker binds all undefined symbols
bac542e6
A
177the program needs at launch time. This includes function symbols that can are normally
178lazily bound at the time of their first call.
0959b6d4
A
179.TP
180.B DYLD_PRINT_STATISTICS
181Right before the process's main() is called, dyld prints out information about how
182dyld spent its time. Useful for analyzing launch performance.
183.TP
bac542e6
A
184.B DYLD_NO_FIX_PREBINDING
185Normally, dyld will trigger the dyld shared cache to be regenerated if it notices
186the cache is out of date while launching a process. If this environment variable
187is set, dyld will not trigger a cache rebuild. This is useful to set while installing
188a large set of OS dylibs, to ensure the cache is not regenerated until the install
189is complete.
190.TP
191.B DYLD_DISABLE_DOFS
192Causes dyld not register dtrace static probes with the kernel.
0959b6d4
A
193.TP
194.B DYLD_PRINT_INITIALIZERS
195Causes dyld to print out a line when running each initializers in every image. Initializers
196run by dyld included constructors for C++ statically allocated objects, functions marked with
197__attribute__((constructor)), and -init functions.
198.TP
199.B DYLD_PRINT_APIS
200Causes dyld to print a line whenever a dyld API is called (e.g. NSAddImage()).
201.TP
202.B DYLD_PRINT_SEGMENTS
203Causes dyld to print out a line containing the name and address range of each mach-o segment
bac542e6
A
204that dyld maps. In addition it prints information about if the image was from the dyld
205shared cache.
0959b6d4
A
206.TP
207.B DYLD_PRINT_BINDINGS
208Causes dyld to print a line each time a symbolic name is bound.
bac542e6
A
209.TP
210.B DYLD_PRINT_DOFS
211Causes dyld to print out information about dtrace static probes registered with the kernel.
0959b6d4
A
212
213.SH "SEE ALSO"
214libtool(1), ld(1), otool(1)