2 .Dt update_dyld_shared_cache 1
5 .Nm update_dyld_shared_cache
6 .Nd "Updates dyld's shared cache"
9 .Op Fl root Ar directory
10 .Op Fl overlay Ar directory
17 .Op Fl dylib_list Ar file
19 .Op Fl cache_dir Ar dir
21 .Nm update_dyld_shared_cache
22 ensures that dyld's shared cache is up-to-date. This tool is normally
23 only run by Apple's Installer and Software Update, as they are the only
24 official ways for OS dylibs to be updated. But if for some reason you
25 used another mechanism to alter an OS dylib, you should manually run
26 .Nm update_dyld_shared_cache .
28 Note that the new cache does not take effect until the OS is rebooted.
31 done (booting with shift key held down) the cache is deleted.
34 is mapped by dyld into a process at launch time. Later, when loading
35 any mach-o image, dyld will first check if is in the share cache, and if
36 it is will use that pre-bound version instead of opening, mapping, and binding
37 the original file. This results in significant performance improvements to
40 .Nm update_dyld_shared_cache
41 scans the directory /var/db/dyld/shared_region_roots for text files containing paths to
42 mach-o executables. The full dependencies of all dylibs required by those executables is
43 used to determine which libraries are commonly used and should be placed in the
44 shared cache. If one of the text files contains a path to a dylib, that dylib and its
45 dependents will be forced into the cache.
47 .Nm update_dyld_shared_cache
48 builds a separate cache file for each architecture. The cache files and a readable text
49 map of the cached are generated to /var/db/dyld.
51 You must be root to run this tool.
53 The options are as follows:
55 .It Fl root Ar directory
56 This option specifies the root of an OS installation for which dyld's
57 shared cache should be updated. This is used by the Installer to update the
58 dyld shared cache in a partition other than the one you into which you are currently
59 booted. The cache files are created in the var/db/dyld directory of the specified directory.
60 Note: if you are manually doing this, be sure to run the update_dyld_shared_cache tool
61 that is in the partition being updated. This assures the cache format created will
62 match that expected when booting off that partition.
63 .It Fl overlay Ar directory
64 This option specifies the root of a sparse directory tree. When building
65 the dyld shared cache, any corresponding mach-o files in the sparse directory
66 will override those in the boot partition. This is used by Software
67 Update to build a dyld shared cache for the update that is about to be
68 installed. The cache files
69 are created in the var/db/dyld directory of the specified directory.
72 .Nm update_dyld_shared_cache
73 generates cache files for all architecture that the current machine
74 can execute. You can override this behavior by specifying one or more -arch options and list
75 exactly which architectures should have their shared caches updated.
77 This option will cause
78 .Nm update_dyld_shared_cache
79 to regenerated the shared cache files even if they appear to be already up-to-date.
81 This option prints out additional information about the work being done.
84 .Nm update_dyld_shared_cache
85 assigns a random start address to each mach-o image in the cache.
86 This option causes the start addresses to be chosen in path order, thus subsequent runs will
87 produce the same address layout which can help reproduce some bugs.
89 This option can only be used running on an machine with an Intel processor. It builds caches
90 that can be used when booting on both 32-bit and 64-bit machines.
91 .It Fl dylib_list Ar file
92 Instead of scanning /var/db/dyld/shared_region_roots/, this option provides a file that contains
93 a list of the dylibs to use when building the shared cache file.
95 Will regenerate a shared cache in-memory that matches the randomization of the existing shared
96 cache file. Then instead of writing the cache file, it compares the in-memory cache file to
97 the on disk version and reports any differences.
99 indicates that cache is not for the current Mac OS X, but for rather for an iPhone
100 .It Fl cache_dir Ar directory
101 This option specifies the directory in which to create the cache file(s). If not specified,
102 the cache file(s) are created in the standard location (e.g. var/db/dyld/) of the root partition.
106 /var/db/dyld/shared_region_roots
107 directory of text files with paths to mach-o images used to determine what should be in shared cache.