aboutsummaryrefslogtreecommitdiff
path: root/lib/Object
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-11-27 13:52:53 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-11-27 13:52:53 +0000
commit2208b58b83392b2a3558e556c7447b13c3aea857 (patch)
tree163b3d8177447a47d2f2193a44fb90a51e6c1b13 /lib/Object
parentf2e2a5ff04e13720cec0c130c1d88d81d0ae6007 (diff)
macho-dump: Add support for dumping symbol table entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r--lib/Object/MachOObject.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/Object/MachOObject.cpp b/lib/Object/MachOObject.cpp
index 45c9bff45f..33890f6617 100644
--- a/lib/Object/MachOObject.cpp
+++ b/lib/Object/MachOObject.cpp
@@ -308,3 +308,31 @@ void MachOObject::ReadRelocationEntry(uint64_t RelocationTableOffset,
Index * sizeof(macho::RelocationEntry));
ReadInMemoryStruct(*this, Buffer->getBuffer(), Offset, Res);
}
+
+template<>
+void SwapStruct(macho::SymbolTableEntry &Value) {
+ SwapValue(Value.StringIndex);
+ SwapValue(Value.Flags);
+ SwapValue(Value.Value);
+}
+void MachOObject::ReadSymbolTableEntry(uint64_t SymbolTableOffset,
+ unsigned Index,
+ InMemoryStruct<macho::SymbolTableEntry> &Res) const {
+ uint64_t Offset = (SymbolTableOffset +
+ Index * sizeof(macho::SymbolTableEntry));
+ ReadInMemoryStruct(*this, Buffer->getBuffer(), Offset, Res);
+}
+
+template<>
+void SwapStruct(macho::Symbol64TableEntry &Value) {
+ SwapValue(Value.StringIndex);
+ SwapValue(Value.Flags);
+ SwapValue(Value.Value);
+}
+void MachOObject::ReadSymbol64TableEntry(uint64_t SymbolTableOffset,
+ unsigned Index,
+ InMemoryStruct<macho::Symbol64TableEntry> &Res) const {
+ uint64_t Offset = (SymbolTableOffset +
+ Index * sizeof(macho::Symbol64TableEntry));
+ ReadInMemoryStruct(*this, Buffer->getBuffer(), Offset, Res);
+}