-.TH DYLD 1 "December 14, 2009" "Apple Inc."
+.TH DYLD 1 "June 1, 2020" "Apple Inc."
.SH NAME
-dyld \- the dynamic link editor
+dyld \- the dynamic linker
.SH SYNOPSIS
DYLD_FRAMEWORK_PATH
.br
.br
DYLD_PRINT_TO_FILE
.br
-DYLD_ROOT_PATH
-.br
DYLD_SHARED_REGION
.br
DYLD_INSERT_LIBRARIES
.br
DYLD_PRINT_LIBRARIES
.br
-DYLD_PRINT_LIBRARIES_POST_LAUNCH
-.br
DYLD_BIND_AT_LAUNCH
.br
DYLD_DISABLE_DOFS
DYLD_PRINT_RPATHS
.br
DYLD_SHARED_CACHE_DIR
-.br
-DYLD_SHARED_CACHE_DONT_VALIDATE
.SH DESCRIPTION
-The dynamic linker uses the following environment variables.
-They affect any program that uses the dynamic linker.
+The dynamic linker checks the following environment variables during the launch
+of each process.
+.br
+.br
+Note: If System Integrity Protection is enabled, these environment variables are ignored
+when executing binaries protected by System Integrity Protection.
.TP
.B DYLD_FRAMEWORK_PATH
This is a colon separated list of directories that contain frameworks.
framework by its install name.
It allows you to test new versions of existing
frameworks. (A framework is a library install name that ends in the form
-XXX.framework/Versions/YYY/XXX or XXX.framework/XXX, where XXX and YYY are any
+XXX.framework/Versions/A/XXX or XXX.framework/XXX, where XXX and A are any
name.)
.IP
For each framework that a program uses, the dynamic linker looks for the
framework in each directory in
.SM DYLD_FRAMEWORK_PATH
-in turn. If it looks in all the directories and can't find the framework, it
-searches the directories in
-.SM DYLD_LIBRARY_PATH
-in turn. If it still can't find the framework, it then searches
-.SM DYLD_FALLBACK_FRAMEWORK_PATH
-and
-.SM DYLD_FALLBACK_LIBRARY_PATH
-in turn.
+in turn. If it looks in all those directories and can't find the framework, it
+uses whatever it would have loaded if DYLD_FRAMEWORK_PATH had not been set.
.IP
Use the
.B \-L
option to
-.IR otool (1).
+.IR otool (1)
to discover the frameworks and shared libraries that the executable
is linked against.
.TP
.B DYLD_FALLBACK_FRAMEWORK_PATH
This is a colon separated list of directories that contain frameworks.
-It is used as the default location for frameworks not found in their install
-path.
+If a framework is not found at its install path, dyld uses this
+as a list of directories to search for the framework.
By default, it is set to
-/Library/Frameworks:/Network/Library/Frameworks:/System/Library/Frameworks
+/Library/Frameworks:/System/Library/Frameworks
.TP
.B DYLD_VERSIONED_FRAMEWORK_PATH
This is a colon separated list of directories that contain potential override frameworks.
and install name. Dyld then looks for the framework at the install name path.
Whichever has the larger current_version value will be used in the process whenever
a framework with that install name is required. This is similar to DYLD_FRAMEWORK_PATH
-except instead of always overriding, it only overrides is the supplied framework is newer.
+except instead of always overriding, it only overrides if the supplied framework is newer.
Note: dyld does not check the framework's Info.plist to find its version. Dyld only
checks the -currrent_version number supplied when the framework was created.
.TP
locations for libraries. It allows you to test new versions of existing
libraries.
.IP
-For each library that a program uses, the dynamic linker looks for it in each
-directory in
-.SM DYLD_LIBRARY_PATH
-in turn. If it still can't find the library, it then searches
-.SM DYLD_FALLBACK_FRAMEWORK_PATH
-and
-.SM DYLD_FALLBACK_LIBRARY_PATH
-in turn.
+For each dylib that a program uses, the dynamic linker looks for its
+leaf name in each directory in
+.SM DYLD_LIBRARY_PATH.
.IP
Use the
.B \-L
option to
-.IR otool (1).
+.IR otool (1)
to discover the frameworks and shared libraries that the executable
is linked against.
.TP
.B DYLD_FALLBACK_LIBRARY_PATH
This is a colon separated list of directories that contain libraries.
-It is used as the default location for libraries not found in their install
-path.
+If a dylib is not found at its install path,
+dyld uses this as a list of directories to search for the dylib.
By default, it is set
-to $(HOME)/lib:/usr/local/lib:/lib:/usr/lib.
+to /usr/local/lib:/usr/lib.
.TP
.B DYLD_VERSIONED_LIBRARY_PATH
This is a colon separated list of directories that contain potential override libraries.
(which is usually stderr). But this setting causes the dynamic linker to
write logging output to the specified file.
.TP
-.B DYLD_ROOT_PATH
-This is a colon separated list of directories. The dynamic linker will prepend each of
-this directory paths to every image access until a file is found.
-.TP
.B DYLD_SHARED_REGION
This can be "use" (the default), "avoid", or "private". Setting it to
"avoid" tells dyld to not use the shared cache. All OS dylibs are loaded
.SM DYLD_LIBRARY_PATH
is getting what you want.
.TP
-.B DYLD_PRINT_LIBRARIES_POST_LAUNCH
-This does the same as
-.SM DYLD_PRINT_LIBRARIES
-but the printing starts after the program gets to its entry point.
-.TP
.B DYLD_BIND_AT_LAUNCH
When this is set, the dynamic linker binds all undefined symbols
-the program needs at launch time. This includes function symbols that can are normally
+the program needs at launch time. This includes function symbols that are normally
lazily bound at the time of their first call.
.TP
.B DYLD_PRINT_STATISTICS
dyld spent its time. Useful for analyzing launch performance.
.TP
.B DYLD_DISABLE_DOFS
-Causes dyld not register dtrace static probes with the kernel.
+Causes dyld to not register dtrace static probes with the kernel.
.TP
.B DYLD_PRINT_INITIALIZERS
-Causes dyld to print out a line when running each initializers in every image. Initializers
-run by dyld included constructors for C++ statically allocated objects, functions marked with
+Causes dyld to print out a line when running each initializer in every image. Initializers
+run by dyld include constructors for C++ statically allocated objects, functions marked with
__attribute__((constructor)), and -init functions.
.TP
.B DYLD_PRINT_APIS
.TP
.B DYLD_SHARED_CACHE_DIR
This is a directory containing dyld shared cache files. This variable can be used in
-conjunction with DYLD_SHARED_REGION=private and DYLD_SHARED_CACHE_DONT_VALIDATE
-to run a process with an alternate shared cache.
-.TP
-.B DYLD_SHARED_CACHE_DONT_VALIDATE
-Causes dyld to not check that the inode and mod-time of files in the shared cache match
-the requested dylib on disk. Thus a program can be made to run with the dylib in the
-shared cache even though the real dylib has been updated on disk.
+conjunction with DYLD_SHARED_REGION=private to run a process with an alternate shared cache.
.TP
.SH DYNAMIC LIBRARY LOADING
Unlike many other operating systems, Darwin does not locate dependent dynamic libraries
At runtime dyld sets it run path to be the anchor point, then each dylib is found relative
to the anchor point.
.SH "SEE ALSO"
-libtool(1), ld(1), otool(1)
+dyldinfo(1), ld(1), otool(1)