Lines Matching refs:Obj
30 MachODumper(const MachOObjectFile *Obj, ScopedPrinter &Writer) in MachODumper() argument
31 : ObjDumper(Writer, Obj->getFileName()), Obj(Obj) {} in MachODumper()
71 void printRelocation(const MachOObjectFile *Obj, const RelocationRef &Reloc);
73 void printSectionHeaders(const MachOObjectFile *Obj);
75 const MachOObjectFile *Obj; member in __anonb6fae7830111::MachODumper
83 std::unique_ptr<ObjDumper> createMachODumper(const object::MachOObjectFile &Obj, in createMachODumper() argument
85 return std::make_unique<MachODumper>(&Obj, Writer); in createMachODumper()
341 static void getSection(const MachOObjectFile *Obj, in getSection() argument
344 if (!Obj->is64Bit()) { in getSection()
345 MachO::section Sect = Obj->getSection(Sec); in getSection()
357 MachO::section_64 Sect = Obj->getSection64(Sec); in getSection()
370 static void getSegment(const MachOObjectFile *Obj, in getSegment() argument
373 if (!Obj->is64Bit()) { in getSegment()
374 MachO::segment_command SC = Obj->getSegmentLoadCommand(L); in getSegment()
388 MachO::segment_command_64 SC = Obj->getSegment64LoadCommand(L); in getSegment()
402 static void getSymbol(const MachOObjectFile *Obj, in getSymbol() argument
405 if (!Obj->is64Bit()) { in getSymbol()
406 MachO::nlist Entry = Obj->getSymbolTableEntry(DRI); in getSymbol()
414 MachO::nlist_64 Entry = Obj->getSymbol64TableEntry(DRI); in getSymbol()
424 if (!Obj->is64Bit()) { in printFileHeaders()
425 printFileHeaders(Obj->getHeader()); in printFileHeaders()
427 printFileHeaders(Obj->getHeader64()); in printFileHeaders()
428 W.printHex("Reserved", Obj->getHeader64().reserved); in printFileHeaders()
466 void MachODumper::printSectionHeaders() { return printSectionHeaders(Obj); } in printSectionHeaders()
468 void MachODumper::printSectionHeaders(const MachOObjectFile *Obj) { in printSectionHeaders() argument
472 for (const SectionRef &Section : Obj->sections()) { in printSectionHeaders()
476 getSection(Obj, Section.getRawDataRefImpl(), MOSection); in printSectionHeaders()
478 StringRef Name = unwrapOrError(Obj->getFileName(), Section.getName()); in printSectionHeaders()
479 ArrayRef<char> RawName = Obj->getSectionRawName(DR); in printSectionHeaders()
480 StringRef SegmentName = Obj->getSectionFinalSegmentName(DR); in printSectionHeaders()
481 ArrayRef<char> RawSegmentName = Obj->getSectionRawFinalSegmentName(DR); in printSectionHeaders()
498 if (Obj->is64Bit()) in printSectionHeaders()
509 for (const SymbolRef &Symbol : Obj->symbols()) { in printSectionHeaders()
518 W.printBinaryBlock("SectionData", unwrapOrError(Obj->getFileName(), in printSectionHeaders()
527 for (const SectionRef &Section : Obj->sections()) { in printRelocations()
528 StringRef Name = unwrapOrError(Obj->getFileName(), Section.getName()); in printRelocations()
548 return printRelocation(Obj, Reloc); in printRelocation()
551 void MachODumper::printRelocation(const MachOObjectFile *Obj, in printRelocation() argument
558 MachO::any_relocation_info RE = Obj->getRelocation(DR); in printRelocation()
559 bool IsScattered = Obj->isRelocationScattered(RE); in printRelocation()
560 bool IsExtern = !IsScattered && Obj->getPlainRelocationExternal(RE); in printRelocation()
565 if (Symbol != Obj->symbol_end()) { in printRelocation()
569 section_iterator SecI = Obj->getRelocationSection(DR); in printRelocation()
570 if (SecI != Obj->section_end()) in printRelocation()
571 TargetName = unwrapOrError(Obj->getFileName(), SecI->getName()); in printRelocation()
579 W.printNumber("PCRel", Obj->getAnyRelocationPCRel(RE)); in printRelocation()
580 W.printNumber("Length", Obj->getAnyRelocationLength(RE)); in printRelocation()
581 W.printNumber("Type", RelocName, Obj->getAnyRelocationType(RE)); in printRelocation()
583 W.printHex("Value", Obj->getScatteredRelocationValue(RE)); in printRelocation()
586 W.printNumber(Kind, TargetName, Obj->getPlainRelocationSymbolNum(RE)); in printRelocation()
593 SymbolNameOrOffset += utohexstr(Obj->getScatteredRelocationValue(RE)); in printRelocation()
600 << " " << Obj->getAnyRelocationPCRel(RE) in printRelocation()
601 << " " << Obj->getAnyRelocationLength(RE); in printRelocation()
605 OS << " " << Obj->getPlainRelocationExternal(RE); in printRelocation()
616 reportError(SymbolNameOrErr.takeError(), Obj->getFileName()); in getSymbolName()
622 return Obj->is64Bit() in getSymbolType()
623 ? Obj->getSymbol64TableEntry(Symbol.getRawDataRefImpl()).n_type in getSymbolType()
624 : Obj->getSymbolTableEntry(Symbol.getRawDataRefImpl()).n_type; in getSymbolType()
642 auto SymbolRange = Obj->symbols(); in printSymbols()
649 for (const SymbolRef &Symbol : Obj->symbols()) { in printSymbols()
670 getSymbol(Obj, Symbol.getRawDataRefImpl(), MOSymbol); in printSymbol()
681 reportError(SecIOrErr.takeError(), Obj->getFileName()); in printSymbol()
684 if (SecI != Obj->section_end()) in printSymbol()
685 SectionName = unwrapOrError(Obj->getFileName(), SecI->getName()); in printSymbol()
714 for (auto Sec : Obj->sections()) { in printStackMap()
731 unwrapOrError(Obj->getFileName(), StackMapSection.getContents()); in printStackMap()
735 if (Obj->isLittleEndian()) in printStackMap()
745 for (auto Sec : Obj->sections()) { in printCGProfile()
761 unwrapOrError(Obj->getFileName(), CGProfileSection.getContents()); in printCGProfile()
762 BinaryStreamReader Reader(CGProfileContents, Obj->isLittleEndian() in printCGProfile()
771 reportError(std::move(Err), Obj->getFileName()); in printCGProfile()
773 reportError(std::move(Err), Obj->getFileName()); in printCGProfile()
775 reportError(std::move(Err), Obj->getFileName()); in printCGProfile()
777 W.printNumber("From", getSymbolName(*Obj->getSymbolByIndex(FromIndex)), in printCGProfile()
779 W.printNumber("To", getSymbolName(*Obj->getSymbolByIndex(ToIndex)), in printCGProfile()
791 for (const auto &Command : Obj->load_commands()) { in printNeededLibraries()
798 MachO::dylib_command Dl = Obj->getDylibIDLoadCommand(Command); in printNeededLibraries()
814 for (const auto &Load : Obj->load_commands()) { in printMachODataInCode()
816 MachO::linkedit_data_command LLC = Obj->getLinkeditDataLoadCommand(Load); in printMachODataInCode()
823 MachO::data_in_code_entry DICE = Obj->getDataInCodeTableEntry( in printMachODataInCode()
836 for (const auto &Load : Obj->load_commands()) { in printMachOVersionMin()
861 MachO::build_version_command BVC = Obj->getBuildVersionLoadCommand(Load); in printMachOVersionMin()
874 MachO::version_min_command VMC = Obj->getVersionMinLoadCommand(Load); in printMachOVersionMin()
899 for (const auto &Load : Obj->load_commands()) { in printMachODysymtab()
901 MachO::dysymtab_command DLC = Obj->getDysymtabLoadCommand(); in printMachODysymtab()
926 for (const auto &Load : Obj->load_commands()) { in printMachOSegment()
929 getSegment(Obj, Load, MOSegment); in printMachOSegment()
947 for (const auto &Load : Obj->load_commands()) { in printMachOIndirectSymbols()
949 MachO::dysymtab_command DLC = Obj->getDysymtabLoadCommand(); in printMachOIndirectSymbols()
956 W.printHex("Symbol Index", Obj->getIndirectSymbolTableEntry(DLC, i)); in printMachOIndirectSymbols()
963 for (const auto &Load : Obj->load_commands()) { in printMachOLinkerOptions()
965 MachO::linker_option_command LOLC = Obj->getLinkerOptionLoadCommand(Load); in printMachOLinkerOptions()