From 5b9e48b4cec3834303db0f80e6ee197b1dc5e2a4 Mon Sep 17 00:00:00 2001 From: Nick Kledzik Date: Wed, 19 Nov 2014 02:21:53 +0000 Subject: [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 --- lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp') 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 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. -- cgit v1.2.3