git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178985
91177308-0d34-0410-b5e6-
96231b3b80d8
getSymbol64TableEntry(DataRefImpl DRI) const;
const MachOFormat::SymbolTableEntry *
getSymbolTableEntry(DataRefImpl DRI) const;
getSymbol64TableEntry(DataRefImpl DRI) const;
const MachOFormat::SymbolTableEntry *
getSymbolTableEntry(DataRefImpl DRI) const;
const MachOObject *getObject() const { return MachOObj.get(); }
const MachOObject *getObject() const { return MachOObj.get(); }
+bool MachOObjectFile::is64Bit() const {
+ return MachOObj->is64Bit();
+}
ObjectFile *ObjectFile::createMachOObjectFile(MemoryBuffer *Buffer) {
error_code ec;
ObjectFile *ObjectFile::createMachOObjectFile(MemoryBuffer *Buffer) {
error_code ec;
-static bool is64BitLoadCommand(const MachOObject *MachOObj, DataRefImpl DRI) {
- LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
- if (LCI.Command.Type == macho::LCT_Segment64)
- return true;
- assert(LCI.Command.Type == macho::LCT_Segment && "Unexpected Type.");
- return false;
-}
-
static void getSection(const MachOObjectFile *Obj,
DataRefImpl DRI,
MachOSection &Section) {
static void getSection(const MachOObjectFile *Obj,
DataRefImpl DRI,
MachOSection &Section) {
- const MachOObject *MachOObj = Obj->getObject();
-
- if (is64BitLoadCommand(MachOObj, DRI)) {
const MachOFormat::Section64 *Sect = Obj->getSection64(DRI);
Section.Address = Sect->Address;
const MachOFormat::Section64 *Sect = Obj->getSection64(DRI);
Section.Address = Sect->Address;
static void getSymbol(const MachOObjectFile *Obj,
DataRefImpl DRI,
MachOSymbol &Symbol) {
static void getSymbol(const MachOObjectFile *Obj,
DataRefImpl DRI,
MachOSymbol &Symbol) {
- const MachOObject *MachOObj = Obj->getObject();
- if (MachOObj->is64Bit()) {
const MachOFormat::Symbol64TableEntry *Entry =
Obj->getSymbol64TableEntry( DRI);
Symbol.StringIndex = Entry->StringIndex;
const MachOFormat::Symbol64TableEntry *Entry =
Obj->getSymbol64TableEntry( DRI);
Symbol.StringIndex = Entry->StringIndex;