aboutsummaryrefslogtreecommitdiff
path: root/lib/Object
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-11-27 13:46:11 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-11-27 13:46:11 +0000
commitf2e2a5ff04e13720cec0c130c1d88d81d0ae6007 (patch)
treed8a06360956446e828600dd653fd69aa5ecdddc4 /lib/Object
parent90e3e3a429e75a7d3671afcc30ed376b6186fd58 (diff)
macho-dump: Add support for dumping string table data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120217 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r--lib/Object/MachOObject.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Object/MachOObject.cpp b/lib/Object/MachOObject.cpp
index f5bc73ada7..45c9bff45f 100644
--- a/lib/Object/MachOObject.cpp
+++ b/lib/Object/MachOObject.cpp
@@ -57,7 +57,7 @@ MachOObject::MachOObject(MemoryBuffer *Buffer_, bool IsLittleEndian_,
bool Is64Bit_)
: Buffer(Buffer_), IsLittleEndian(IsLittleEndian_), Is64Bit(Is64Bit_),
IsSwappedEndian(IsLittleEndian != sys::isLittleEndianHost()),
- LoadCommands(0), NumLoadedCommands(0) {
+ HasStringTable(false), LoadCommands(0), NumLoadedCommands(0) {
// Load the common header.
memcpy(&Header, Buffer->getBuffer().data(), sizeof(Header));
if (IsSwappedEndian) {
@@ -125,6 +125,12 @@ MachOObject *MachOObject::LoadFromBuffer(MemoryBuffer *Buffer,
return Object.take();
}
+void MachOObject::RegisterStringTable(macho::SymtabLoadCommand &SLC) {
+ HasStringTable = true;
+ StringTable = Buffer->getBuffer().substr(SLC.StringTableOffset,
+ SLC.StringTableSize);
+}
+
const MachOObject::LoadCommandInfo &
MachOObject::getLoadCommandInfo(unsigned Index) const {
assert(Index < getHeader().NumLoadCommands && "Invalid index!");