summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObject.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-11-27 13:39:48 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-11-27 13:39:48 +0000
commit0ac77d526db7e094dbf50f5290032b4b9152c56f (patch)
tree29248c521b0d948a038ea82a5aa0b28e5358b6d9 /llvm/lib/Object/MachOObject.cpp
parent5867690cfab812a22d0409a8b8cc996d30263d30 (diff)
downloadbcm5719-llvm-0ac77d526db7e094dbf50f5290032b4b9152c56f.tar.gz
bcm5719-llvm-0ac77d526db7e094dbf50f5290032b4b9152c56f.zip
macho-dump: Add support for dumping relocation entries.
llvm-svn: 120216
Diffstat (limited to 'llvm/lib/Object/MachOObject.cpp')
-rw-r--r--llvm/lib/Object/MachOObject.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Object/MachOObject.cpp b/llvm/lib/Object/MachOObject.cpp
index 1e9ec70d422..f5bc73ada71 100644
--- a/llvm/lib/Object/MachOObject.cpp
+++ b/llvm/lib/Object/MachOObject.cpp
@@ -289,3 +289,16 @@ void MachOObject::ReadSection64(const LoadCommandInfo &LCI,
Index * sizeof(macho::Section64));
ReadInMemoryStruct(*this, Buffer->getBuffer(), Offset, Res);
}
+
+template<>
+void SwapStruct(macho::RelocationEntry &Value) {
+ SwapValue(Value.Word0);
+ SwapValue(Value.Word1);
+}
+void MachOObject::ReadRelocationEntry(uint64_t RelocationTableOffset,
+ unsigned Index,
+ InMemoryStruct<macho::RelocationEntry> &Res) const {
+ uint64_t Offset = (RelocationTableOffset +
+ Index * sizeof(macho::RelocationEntry));
+ ReadInMemoryStruct(*this, Buffer->getBuffer(), Offset, Res);
+}
OpenPOWER on IntegriCloud