Don't use InMemoryStruct<macho::SymtabLoadCommand>.

This also required not using the RegisterStringTable API, which is also a
good thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2013-04-06 03:31:08 +00:00
parent 05b5bdd024
commit 82a21077a0
2 changed files with 65 additions and 21 deletions

View File

@@ -76,6 +76,15 @@ namespace MachOFormat {
support::ulittle16_t Flags;
support::ulittle64_t Value;
};
struct SymtabLoadCommand {
support::ulittle32_t Type;
support::ulittle32_t Size;
support::ulittle32_t SymbolTableOffset;
support::ulittle32_t NumSymbolTableEntries;
support::ulittle32_t StringTableOffset;
support::ulittle32_t StringTableSize;
};
}
typedef MachOObject::LoadCommandInfo LoadCommandInfo;
@@ -169,20 +178,32 @@ protected:
private:
OwningPtr<MachOObject> MachOObj;
mutable uint32_t RegisteredStringTable;
typedef SmallVector<DataRefImpl, 1> SectionList;
SectionList Sections;
void moveToNextSection(DataRefImpl &DRI) const;
const MachOFormat::SymbolTableEntry *
getSymbolTableEntry(DataRefImpl DRI) const;
const MachOFormat::SymbolTableEntry *
getSymbolTableEntry(DataRefImpl DRI,
const MachOFormat::SymtabLoadCommand *SymtabLoadCmd) const;
const MachOFormat::Symbol64TableEntry *
getSymbol64TableEntry(DataRefImpl DRI) const;
const MachOFormat::Symbol64TableEntry *
getSymbol64TableEntry(DataRefImpl DRI,
const MachOFormat::SymtabLoadCommand *SymtabLoadCmd) const;
void moveToNextSymbol(DataRefImpl &DRI) const;
const MachOFormat::Section *getSection(DataRefImpl DRI) const;
const MachOFormat::Section64 *getSection64(DataRefImpl DRI) const;
const MachOFormat::RelocationEntry *getRelocation(DataRefImpl Rel) const;
const MachOFormat::SymtabLoadCommand *
getSymtabLoadCommand(LoadCommandInfo LCI) const;
std::size_t getSectionIndex(DataRefImpl Sec) const;
void printRelocationTargetName(const MachOFormat::RelocationEntry *RE,