summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-07-01 08:15:41 +0000
committerTim Northover <tnorthover@apple.com>2014-07-01 08:15:41 +0000
commit301c4e690a84d262125674f34d4b23a09649fdec (patch)
treed39de833c582800a1456f0ff76579366341093f2 /lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
parent012dff0b237c860b8371332aa588756689e60be5 (diff)
downloadbcm5719-llvm-301c4e690a84d262125674f34d4b23a09649fdec.tar.gz
bcm5719-llvm-301c4e690a84d262125674f34d4b23a09649fdec.zip
[mach-o] add representation for LC_ID_DYLIB to MachONormalizedFile
It still needs to be tied into BinaryReader, but this allows reasonably sensible creation of SharedLibrary atoms on MachO. llvm-svn: 212093
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 bf93a00d67f..7c599152e8b 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
@@ -386,6 +386,15 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
}
}
}
+ if (cmd == LC_ID_DYLIB) {
+ const dylib_command *dl = reinterpret_cast<const dylib_command*>(lc);
+ dylib_command tempDL;
+ if (swap) {
+ tempDL = *dl; swapStruct(tempDL); dl = &tempDL;
+ }
+
+ f->installName = lc + dl->dylib.name;
+ }
return false;
});
if (ec)
OpenPOWER on IntegriCloud