void MachOObjectFile::moveToNextSymbol(DataRefImpl &DRI) const {
uint32_t LoadCommandCount = MachOObj->getHeader().NumLoadCommands;
while (DRI.d.a < LoadCommandCount) {
- LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
+ LoadCommandInfo LCI = getLoadCommandInfo(DRI.d.a);
if (LCI.Command.Type == macho::LCT_Symtab) {
const MachOFormat::SymtabLoadCommand *SymtabLoadCmd =
getSymtabLoadCommand(LCI);
const MachOFormat::SymbolTableEntry *
MachOObjectFile::getSymbolTableEntry(DataRefImpl DRI) const {
- LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
+ LoadCommandInfo LCI = getLoadCommandInfo(DRI.d.a);
const MachOFormat::SymtabLoadCommand *SymtabLoadCmd =
getSymtabLoadCommand(LCI);
const MachOFormat::Symbol64TableEntry*
MachOObjectFile::getSymbol64TableEntry(DataRefImpl DRI) const {
- LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
+ LoadCommandInfo LCI = getLoadCommandInfo(DRI.d.a);
const MachOFormat::SymtabLoadCommand *SymtabLoadCmd =
getSymtabLoadCommand(LCI);
error_code MachOObjectFile::getSymbolName(DataRefImpl DRI,
StringRef &Result) const {
- LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
+ LoadCommandInfo LCI = getLoadCommandInfo(DRI.d.a);
const MachOFormat::SymtabLoadCommand *SymtabLoadCmd =
getSymtabLoadCommand(LCI);
void MachOObjectFile::moveToNextSection(DataRefImpl &DRI) const {
uint32_t LoadCommandCount = MachOObj->getHeader().NumLoadCommands;
while (DRI.d.a < LoadCommandCount) {
- LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
+ LoadCommandInfo LCI = getLoadCommandInfo(DRI.d.a);
if (LCI.Command.Type == macho::LCT_Segment) {
const MachOFormat::SegmentLoadCommand *SegmentLoadCmd =
getSegmentLoadCommand(LCI);
return object_error::success;
}
-static bool is64BitLoadCommand(const MachOObject *MachOObj, DataRefImpl DRI) {
+static bool is64BitLoadCommand(const MachOObjectFile *MachOObj,
+ DataRefImpl DRI) {
LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
if (LCI.Command.Type == macho::LCT_Segment64)
return true;
}
const MachOFormat::Section *MachOObjectFile::getSection(DataRefImpl DRI) const {
- assert(!is64BitLoadCommand(MachOObj.get(), DRI));
- LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
+ assert(!is64BitLoadCommand(this, DRI));
+ LoadCommandInfo LCI = getLoadCommandInfo(DRI.d.a);
unsigned SectionOffset = LCI.Offset + sizeof(macho::SegmentLoadCommand) +
DRI.d.b * sizeof(MachOFormat::Section);
StringRef Data = MachOObj->getData(SectionOffset, sizeof(MachOFormat::Section));
const MachOFormat::Section64 *
MachOObjectFile::getSection64(DataRefImpl DRI) const {
- assert(is64BitLoadCommand(MachOObj.get(), DRI));
- LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
+ assert(is64BitLoadCommand(this, DRI));
+ LoadCommandInfo LCI = getLoadCommandInfo(DRI.d.a);
unsigned SectionOffset = LCI.Offset + sizeof(macho::Segment64LoadCommand) +
DRI.d.b * sizeof(MachOFormat::Section64);
StringRef Data = MachOObj->getData(SectionOffset, sizeof(MachOFormat::Section64));
}
ArrayRef<char> MachOObjectFile::getSectionRawName(DataRefImpl DRI) const {
- if (is64BitLoadCommand(MachOObj.get(), DRI)) {
+ if (is64BitLoadCommand(this, DRI)) {
const MachOFormat::Section64 *sec = getSection64(DRI);
return ArrayRef<char>(sec->Name);
} else {
ArrayRef<char>
MachOObjectFile::getSectionRawFinalSegmentName(DataRefImpl Sec) const {
- if (is64BitLoadCommand(MachOObj.get(), Sec)) {
+ if (is64BitLoadCommand(this, Sec)) {
const MachOFormat::Section64 *sec = getSection64(Sec);
return ArrayRef<char>(sec->SegmentName, 16);
} else {
error_code MachOObjectFile::getSectionAddress(DataRefImpl DRI,
uint64_t &Result) const {
- if (is64BitLoadCommand(MachOObj.get(), DRI)) {
+ if (is64BitLoadCommand(this, DRI)) {
const MachOFormat::Section64 *Sect = getSection64(DRI);
Result = Sect->Address;
} else {
error_code MachOObjectFile::getSectionSize(DataRefImpl DRI,
uint64_t &Result) const {
- if (is64BitLoadCommand(MachOObj.get(), DRI)) {
+ if (is64BitLoadCommand(this, DRI)) {
const MachOFormat::Section64 *Sect = getSection64(DRI);
Result = Sect->Size;
} else {
error_code MachOObjectFile::getSectionContents(DataRefImpl DRI,
StringRef &Result) const {
- if (is64BitLoadCommand(MachOObj.get(), DRI)) {
+ if (is64BitLoadCommand(this, DRI)) {
const MachOFormat::Section64 *Sect = getSection64(DRI);
Result = MachOObj->getData(Sect->Offset, Sect->Size);
} else {
error_code MachOObjectFile::getSectionAlignment(DataRefImpl DRI,
uint64_t &Result) const {
- if (is64BitLoadCommand(MachOObj.get(), DRI)) {
+ if (is64BitLoadCommand(this, DRI)) {
const MachOFormat::Section64 *Sect = getSection64(DRI);
Result = uint64_t(1) << Sect->Align;
} else {
error_code MachOObjectFile::isSectionText(DataRefImpl DRI,
bool &Result) const {
- if (is64BitLoadCommand(MachOObj.get(), DRI)) {
+ if (is64BitLoadCommand(this, DRI)) {
const MachOFormat::Section64 *Sect = getSection64(DRI);
Result = Sect->Flags & macho::SF_PureInstructions;
} else {
}
relocation_iterator MachOObjectFile::getSectionRelEnd(DataRefImpl Sec) const {
uint32_t last_reloc;
- if (is64BitLoadCommand(MachOObj.get(), Sec)) {
+ if (is64BitLoadCommand(this, Sec)) {
const MachOFormat::Section64 *Sect = getSection64(Sec);
last_reloc = Sect->NumRelocationTableEntries;
} else {