summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2016-01-14 23:25:06 +0000
committerPete Cooper <peter_cooper@apple.com>2016-01-14 23:25:06 +0000
commit99f3b9494b985d25642cd29a8ac24dc060cc0c9c (patch)
tree6227689dfc91099c72f5d429e7df49339f63533c /lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
parent784b5e3ff0b44ae7048b9b154d9ae119a9a5cb1a (diff)
downloadbcm5719-llvm-99f3b9494b985d25642cd29a8ac24dc060cc0c9c.tar.gz
bcm5719-llvm-99f3b9494b985d25642cd29a8ac24dc060cc0c9c.zip
Check for mismatched arch and OS when linking MachO files.
This patch makes use of the handleLoadedFile hook added in r257814. That method is used to check the arch and the OS of the files we are linking against the arch and OS on the context. The first test to use this ensures that we do not try to combine i386 Mac OS code with i386 simulator code. llvm-svn: 257837
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp')
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
index f9499b60321..827dca86959 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
@@ -992,6 +992,10 @@ normalizedObjectToAtoms(MachOFile *file,
handler->kindArch());
}
+ // Cache some attributes on the file for use later.
+ file->setArch(normalizedFile.arch);
+ file->setOS(normalizedFile.os);
+
// Sort references in each atom to their canonical order.
for (const DefinedAtom* defAtom : file->defined()) {
reinterpret_cast<const SimpleDefinedAtom*>(defAtom)->sortReferences();
OpenPOWER on IntegriCloud