aboutsummaryrefslogtreecommitdiff
path: root/lib/Object/MachOObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Object/MachOObject.cpp')
-rw-r--r--lib/Object/MachOObject.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Object/MachOObject.cpp b/lib/Object/MachOObject.cpp
index 1e9ec70d42..f5bc73ada7 100644
--- a/lib/Object/MachOObject.cpp
+++ b/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);
+}