[mach-o] propagate dylib version numbers
authorNick Kledzik <kledzik@apple.com>
Wed, 19 Nov 2014 02:21:53 +0000 (02:21 +0000)
committerNick Kledzik <kledzik@apple.com>
Wed, 19 Nov 2014 02:21:53 +0000 (02:21 +0000)
commit5b9e48b4cec3834303db0f80e6ee197b1dc5e2a4
tree52511b3371adf95d089fcd0d5cd23c7cbd8657d8
parent970dda295e708a54df1c9516c365a915ba68e96c
[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/include/lld/ReaderWriter/MachOLinkingContext.h
lld/lib/ReaderWriter/MachO/File.h
lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFile.h
lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
lld/test/mach-o/dylib-install-names.yaml
lld/test/mach-o/lazy-bind-x86_64.yaml