diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-11-27 13:39:48 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-11-27 13:39:48 +0000 |
commit | 90e3e3a429e75a7d3671afcc30ed376b6186fd58 (patch) | |
tree | 1afdd3719869f2b6225fcba37425143de0961a30 /lib/Object | |
parent | 2acadbddf6783055249da9fc9ea40a05b83ce56a (diff) |
macho-dump: Add support for dumping relocation entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120216 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r-- | lib/Object/MachOObject.cpp | 13 |
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); +} |