From 4c55e0db0f0a095dcd76326bef24d0fe05d2a5e4 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 27 Nov 2010 13:26:12 +0000 Subject: macho-dump: Add support for dumping dysymtab indirect symbol table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120214 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Object/MachOObject.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib') diff --git a/lib/Object/MachOObject.cpp b/lib/Object/MachOObject.cpp index 94f6d77..236dfe0 100644 --- a/lib/Object/MachOObject.cpp +++ b/lib/Object/MachOObject.cpp @@ -230,3 +230,16 @@ void MachOObject::ReadDysymtabLoadCommand(const LoadCommandInfo &LCI, InMemoryStruct &Res) const { ReadInMemoryStruct(*this, Buffer->getBuffer(), LCI.Offset, Res); } + +template<> +void SwapStruct(macho::IndirectSymbolTableEntry &Value) { + SwapValue(Value.Index); +} +void +MachOObject::ReadIndirectSymbolTableEntry(const macho::DysymtabLoadCommand &DLC, + unsigned Index, + InMemoryStruct &Res) const { + uint64_t Offset = (DLC.IndirectSymbolTableOffset + + Index * sizeof(macho::IndirectSymbolTableEntry)); + ReadInMemoryStruct(*this, Buffer->getBuffer(), Offset, Res); +} -- cgit v1.1