diff options
| author | Nick Kledzik <kledzik@apple.com> | 2014-11-19 02:21:53 +0000 |
|---|---|---|
| committer | Nick Kledzik <kledzik@apple.com> | 2014-11-19 02:21:53 +0000 |
| commit | 5b9e48b4cec3834303db0f80e6ee197b1dc5e2a4 (patch) | |
| tree | 52511b3371adf95d089fcd0d5cd23c7cbd8657d8 /lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | |
| parent | 970dda295e708a54df1c9516c365a915ba68e96c (diff) | |
| download | bcm5719-llvm-5b9e48b4cec3834303db0f80e6ee197b1dc5e2a4.tar.gz bcm5719-llvm-5b9e48b4cec3834303db0f80e6ee197b1dc5e2a4.zip | |
[mach-o] propagate dylib version numbers
Mach-o does not use a simple SO_NEEDED to track dependent dylibs. Instead,
the linker copies four things from each dylib to each client: the runtime path
(aka "install name"), the build time, current version (dylib build number), and
compatibility version The build time is no longer used (it cause every rebuild
of a dylib to be different). The compatibility version is usually just 1.0
and never changes, or the dylib becomes incompatible.
This patch copies that information into the NormalizedMachO format and
propagates it to clients.
llvm-svn: 222300
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp')
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp index a94329e50f9..7465fb2e613 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -820,7 +820,9 @@ normalizedDylibToAtoms(const NormalizedFile &normalizedFile, StringRef path, bool copyRefs) { // Instantiate SharedLibraryFile object. std::unique_ptr<MachODylibFile> file( - new MachODylibFile(path, normalizedFile.installName)); + new MachODylibFile(path, normalizedFile.installName, + normalizedFile.compatVersion, + normalizedFile.currentVersion)); // Tell MachODylibFile object about all symbols it exports. if (!normalizedFile.exportInfo.empty()) { // If exports trie exists, use it instead of traditional symbol table. |

