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/File.h | |
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/File.h')
-rw-r--r-- | lld/lib/ReaderWriter/MachO/File.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h index cc98cd51f57..7d0292d0e93 100644 --- a/lld/lib/ReaderWriter/MachO/File.h +++ b/lld/lib/ReaderWriter/MachO/File.h @@ -198,8 +198,10 @@ private: class MachODylibFile : public SharedLibraryFile { public: - MachODylibFile(StringRef path, StringRef installName) - : SharedLibraryFile(path), _installName(installName) { + MachODylibFile(StringRef path, StringRef installName, uint32_t compatVersion, + uint32_t currentVersion) + : SharedLibraryFile(path), _installName(installName), + _currentVersion(currentVersion), _compatVersion(compatVersion) { } const SharedLibraryAtom *exports(StringRef name, @@ -243,6 +245,10 @@ public: StringRef installName() { return _installName; } + uint32_t currentVersion() { return _currentVersion; } + + uint32_t compatVersion() { return _compatVersion; } + typedef std::function<MachODylibFile *(StringRef)> FindDylib; void loadReExportedDylibs(FindDylib find) { @@ -292,7 +298,9 @@ private: bool weakDef; }; - StringRef _installName; + StringRef _installName; + uint32_t _currentVersion; + uint32_t _compatVersion; atom_collection_vector<DefinedAtom> _definedAtoms; atom_collection_vector<UndefinedAtom> _undefinedAtoms; atom_collection_vector<SharedLibraryAtom> _sharedLibraryAtoms; |