summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2016-02-04 02:16:08 +0000
committerPete Cooper <peter_cooper@apple.com>2016-02-04 02:16:08 +0000
commitceee5de088f3b644c4040145e1ed1242ef9ca9fa (patch)
tree6b38f9c86fb64dc85f14a1054e8fb0b72840fa86 /lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
parent2b9be250660eaf563fc9a3520363b7f19569daf1 (diff)
downloadbcm5719-llvm-ceee5de088f3b644c4040145e1ed1242ef9ca9fa.tar.gz
bcm5719-llvm-ceee5de088f3b644c4040145e1ed1242ef9ca9fa.zip
Generate version min load commands when the platform is unknown.
In the case where we are emitting to an object file, the platform is possibly unknown, and the source object files contained load commands for version min, we can take the maximum of those min versions and emit in in the output object file. This test also tests r259739. llvm-svn: 259742
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp')
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
index 1013d3ddaef..7a9dd4b7fb9 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
@@ -471,6 +471,15 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
case LC_DYLD_INFO_ONLY:
dyldInfo = reinterpret_cast<const dyld_info_command*>(lc);
break;
+ case LC_VERSION_MIN_MACOSX:
+ case LC_VERSION_MIN_IPHONEOS:
+ case LC_VERSION_MIN_WATCHOS:
+ case LC_VERSION_MIN_TVOS:
+ // If we are emitting an object file, then we may take the load command
+ // kind from these commands and pass it on to the output
+ // file.
+ f->minOSVersionKind = (LoadCommandType)cmd;
+ break;
}
return false;
});
OpenPOWER on IntegriCloud