Lines Matching defs:MachOObjectFile

1 //===- MachOObjectFile.cpp - Mach-O object file binding -------------------===//
9 // This file defines the MachOObjectFile class, which binds the MachOObject
71 static T getStruct(const MachOObjectFile &O, const char *P) {
84 static Expected<T> getStructOrErr(const MachOObjectFile &O, const char *P) {
97 getSectionPtr(const MachOObjectFile &O, MachOObjectFile::LoadCommandInfo L,
111 static const char *getPtr(const MachOObjectFile &O, size_t Offset,
119 getSymbolTableEntryBase(const MachOObjectFile &O, DataRefImpl DRI) {
132 static unsigned getCPUType(const MachOObjectFile &O) {
136 static unsigned getCPUSubType(const MachOObjectFile &O) {
150 static bool getPlainRelocationPCRel(const MachOObjectFile &O,
162 static unsigned getPlainRelocationLength(const MachOObjectFile &O,
174 static unsigned getPlainRelocationType(const MachOObjectFile &O,
181 static uint32_t getSectionFlags(const MachOObjectFile &O,
191 static Expected<MachOObjectFile::LoadCommandInfo>
192 getLoadCommandInfo(const MachOObjectFile &Obj, const char *Ptr,
201 return MachOObjectFile::LoadCommandInfo({Ptr, *CmdOrErr});
206 static Expected<MachOObjectFile::LoadCommandInfo>
207 getFirstLoadCommandInfo(const MachOObjectFile &Obj) {
217 static Expected<MachOObjectFile::LoadCommandInfo>
218 getNextLoadCommandInfo(const MachOObjectFile &Obj, uint32_t LoadCommandIndex,
219 const MachOObjectFile::LoadCommandInfo &L) {
231 static void parseHeader(const MachOObjectFile &Obj, T &Header,
286 const MachOObjectFile &Obj, const MachOObjectFile::LoadCommandInfo &Load,
409 static Error checkSymtabCommand(const MachOObjectFile &Obj,
410 const MachOObjectFile::LoadCommandInfo &Load,
467 static Error checkDysymtabCommand(const MachOObjectFile &Obj,
468 const MachOObjectFile::LoadCommandInfo &Load,
600 static Error checkLinkeditDataCommand(const MachOObjectFile &Obj,
601 const MachOObjectFile::LoadCommandInfo &Load,
638 static Error checkDyldInfoCommand(const MachOObjectFile &Obj,
639 const MachOObjectFile::LoadCommandInfo &Load,
737 static Error checkDylibCommand(const MachOObjectFile &Obj,
738 const MachOObjectFile::LoadCommandInfo &Load,
769 static Error checkDylibIdCommand(const MachOObjectFile &Obj,
770 const MachOObjectFile::LoadCommandInfo &Load,
786 static Error checkDyldCommand(const MachOObjectFile &Obj,
787 const MachOObjectFile::LoadCommandInfo &Load,
818 static Error checkVersCommand(const MachOObjectFile &Obj,
819 const MachOObjectFile::LoadCommandInfo &Load,
833 static Error checkNoteCommand(const MachOObjectFile &Obj,
834 const MachOObjectFile::LoadCommandInfo &Load,
862 parseBuildVersionCommand(const MachOObjectFile &Obj,
863 const MachOObjectFile::LoadCommandInfo &Load,
885 static Error checkRpathCommand(const MachOObjectFile &Obj,
886 const MachOObjectFile::LoadCommandInfo &Load,
917 static Error checkEncryptCommand(const MachOObjectFile &Obj,
918 const MachOObjectFile::LoadCommandInfo &Load,
941 static Error checkLinkerOptCommand(const MachOObjectFile &Obj,
942 const MachOObjectFile::LoadCommandInfo &Load,
981 static Error checkSubCommand(const MachOObjectFile &Obj,
982 const MachOObjectFile::LoadCommandInfo &Load,
1008 static Error checkThreadCommand(const MachOObjectFile &Obj,
1009 const MachOObjectFile::LoadCommandInfo &Load,
1199 static Error checkTwoLevelHintsCommand(const MachOObjectFile &Obj,
1200 const MachOObjectFile::LoadCommandInfo
1252 Expected<std::unique_ptr<MachOObjectFile>>
1253 MachOObjectFile::create(MemoryBufferRef Object, bool IsLittleEndian,
1258 std::unique_ptr<MachOObjectFile> Obj(new MachOObjectFile(
1266 MachOObjectFile::MachOObjectFile(MemoryBufferRef Object, bool IsLittleEndian,
1700 Error MachOObjectFile::checkSymbolTable() const {
1703 MachO::mach_header_64 H_64 = MachOObjectFile::getHeader64();
1706 MachO::mach_header H = MachOObjectFile::getHeader();
1767 void MachOObjectFile::moveSymbolNext(DataRefImpl &Symb) const {
1774 Expected<StringRef> MachOObjectFile::getSymbolName(DataRefImpl Symb) const {
1789 unsigned MachOObjectFile::getSectionType(SectionRef Sec) const {
1795 uint64_t MachOObjectFile::getNValue(DataRefImpl Sym) const {
1806 std::error_code MachOObjectFile::getIndirectName(DataRefImpl Symb,
1820 uint64_t MachOObjectFile::getSymbolValueImpl(DataRefImpl Sym) const {
1824 Expected<uint64_t> MachOObjectFile::getSymbolAddress(DataRefImpl Sym) const {
1828 uint32_t MachOObjectFile::getSymbolAlignment(DataRefImpl DRI) const {
1837 uint64_t MachOObjectFile::getCommonSymbolSizeImpl(DataRefImpl DRI) const {
1842 MachOObjectFile::getSymbolType(DataRefImpl Symb) const {
1867 Expected<uint32_t> MachOObjectFile::getSymbolFlags(DataRefImpl DRI) const {
1911 MachOObjectFile::getSymbolSection(DataRefImpl Symb) const {
1926 unsigned MachOObjectFile::getSymbolSectionID(SymbolRef Sym) const {
1932 void MachOObjectFile::moveSectionNext(DataRefImpl &Sec) const {
1936 Expected<StringRef> MachOObjectFile::getSectionName(DataRefImpl Sec) const {
1941 uint64_t MachOObjectFile::getSectionAddress(DataRefImpl Sec) const {
1947 uint64_t MachOObjectFile::getSectionIndex(DataRefImpl Sec) const {
1951 uint64_t MachOObjectFile::getSectionSize(DataRefImpl Sec) const {
1980 ArrayRef<uint8_t> MachOObjectFile::getSectionContents(uint32_t Offset,
1986 MachOObjectFile::getSectionContents(DataRefImpl Sec) const {
2003 uint64_t MachOObjectFile::getSectionAlignment(DataRefImpl Sec) const {
2016 Expected<SectionRef> MachOObjectFile::getSection(unsigned SectionIndex) const {
2025 Expected<SectionRef> MachOObjectFile::getSection(StringRef SectionName) const {
2036 bool MachOObjectFile::isSectionCompressed(DataRefImpl Sec) const {
2040 bool MachOObjectFile::isSectionText(DataRefImpl Sec) const {
2045 bool MachOObjectFile::isSectionData(DataRefImpl Sec) const {
2053 bool MachOObjectFile::isSectionBSS(DataRefImpl Sec) const {
2061 bool MachOObjectFile::isDebugSection(DataRefImpl Sec) const {
2077 ArrayRef<uint8_t> getSegmentContents(const MachOObjectFile &Obj,
2078 MachOObjectFile::LoadCommandInfo LoadCmd,
2093 ArrayRef<uint8_t> getSegmentContents(const MachOObjectFile &Obj,
2094 MachOObjectFile::LoadCommandInfo LoadCmd) {
2107 MachOObjectFile::getSegmentContents(StringRef SegmentName) const {
2129 MachOObjectFile::getSegmentContents(size_t SegmentIndex) const {
2150 unsigned MachOObjectFile::getSectionID(SectionRef Sec) const {
2154 bool MachOObjectFile::isSectionVirtual(DataRefImpl Sec) const {
2161 bool MachOObjectFile::isSectionBitcode(DataRefImpl Sec) const {
2168 bool MachOObjectFile::isSectionStripped(DataRefImpl Sec) const {
2174 relocation_iterator MachOObjectFile::section_rel_begin(DataRefImpl Sec) const {
2182 MachOObjectFile::section_rel_end(DataRefImpl Sec) const {
2198 relocation_iterator MachOObjectFile::extrel_begin() const {
2206 relocation_iterator MachOObjectFile::extrel_end() const {
2215 relocation_iterator MachOObjectFile::locrel_begin() const {
2223 relocation_iterator MachOObjectFile::locrel_end() const {
2232 void MachOObjectFile::moveRelocationNext(DataRefImpl &Rel) const {
2236 uint64_t MachOObjectFile::getRelocationOffset(DataRefImpl Rel) const {
2245 MachOObjectFile::getRelocationSymbol(DataRefImpl Rel) const {
2266 MachOObjectFile::getRelocationSection(DataRefImpl Rel) const {
2270 uint64_t MachOObjectFile::getRelocationType(DataRefImpl Rel) const {
2275 void MachOObjectFile::getRelocationTypeName(
2385 uint8_t MachOObjectFile::getRelocationLength(DataRefImpl Rel) const {
2426 StringRef MachOObjectFile::guessLibraryShortName(StringRef Name,
2550 std::error_code MachOObjectFile::getLibraryShortNameByIndex(unsigned Index,
2584 uint32_t MachOObjectFile::getLibraryCount() const {
2589 MachOObjectFile::getRelocationRelocatedSection(relocation_iterator Rel) const {
2595 basic_symbol_iterator MachOObjectFile::symbol_begin() const {
2604 basic_symbol_iterator MachOObjectFile::symbol_end() const {
2619 symbol_iterator MachOObjectFile::getSymbolByIndex(unsigned Index) const {
2631 uint64_t MachOObjectFile::getSymbolIndex(DataRefImpl Symb) const {
2643 section_iterator MachOObjectFile::section_begin() const {
2648 section_iterator MachOObjectFile::section_end() const {
2654 uint8_t MachOObjectFile::getBytesInAddress() const {
2658 StringRef MachOObjectFile::getFileFormatName() const {
2687 Triple::ArchType MachOObjectFile::getArch(uint32_t CPUType, uint32_t CPUSubType) {
2708 Triple MachOObjectFile::getArchTriple(uint32_t CPUType, uint32_t CPUSubType,
2845 Triple MachOObjectFile::getHostArch() {
2849 bool MachOObjectFile::isValidArch(StringRef ArchFlag) {
2854 ArrayRef<StringRef> MachOObjectFile::getValidArchs() {
2879 Triple::ArchType MachOObjectFile::getArch() const {
2883 Triple MachOObjectFile::getArchTriple(const char **McpuDefault) const {
2887 relocation_iterator MachOObjectFile::section_rel_begin(unsigned Index) const {
2893 relocation_iterator MachOObjectFile::section_rel_end(unsigned Index) const {
2899 dice_iterator MachOObjectFile::begin_dices() const {
2909 dice_iterator MachOObjectFile::end_dices() const {
2920 ExportEntry::ExportEntry(Error *E, const MachOObjectFile *O,
3226 MachOObjectFile::exports(Error &E, ArrayRef<uint8_t> Trie,
3227 const MachOObjectFile *O) {
3240 iterator_range<export_iterator> MachOObjectFile::exports(Error &Err) const {
3251 const MachOObjectFile *O)
3317 const MachOObjectFile *O,
3478 MachORebaseEntry::MachORebaseEntry(Error *E, const MachOObjectFile *O,
3800 MachOObjectFile::rebaseTable(Error &Err, MachOObjectFile *O,
3813 iterator_range<rebase_iterator> MachOObjectFile::rebaseTable(Error &Err) {
3817 MachOBindEntry::MachOBindEntry(Error *E, const MachOObjectFile *O,
4354 BindRebaseSegInfo::BindRebaseSegInfo(const object::MachOObjectFile *Obj) {
4461 MachOObjectFile::bindTable(Error &Err, MachOObjectFile *O,
4475 iterator_range<bind_iterator> MachOObjectFile::bindTable(Error &Err) {
4480 iterator_range<bind_iterator> MachOObjectFile::lazyBindTable(Error &Err) {
4485 iterator_range<bind_iterator> MachOObjectFile::weakBindTable(Error &Err) {
4490 iterator_range<fixup_iterator> MachOObjectFile::fixupTable(Error &Err) {
4503 MachOObjectFile::load_command_iterator
4504 MachOObjectFile::begin_load_commands() const {
4508 MachOObjectFile::load_command_iterator
4509 MachOObjectFile::end_load_commands() const {
4513 iterator_range<MachOObjectFile::load_command_iterator>
4514 MachOObjectFile::load_commands() const {
4519 MachOObjectFile::getSectionFinalSegmentName(DataRefImpl Sec) const {
4525 MachOObjectFile::getSectionRawName(DataRefImpl Sec) const {
4533 MachOObjectFile::getSectionRawFinalSegmentName(DataRefImpl Sec) const {
4541 MachOObjectFile::isRelocationScattered(const MachO::any_relocation_info &RE)
4548 unsigned MachOObjectFile::getPlainRelocationSymbolNum(
4555 bool MachOObjectFile::getPlainRelocationExternal(
4562 bool MachOObjectFile::getScatteredRelocationScattered(
4567 uint32_t MachOObjectFile::getScatteredRelocationValue(
4572 uint32_t MachOObjectFile::getScatteredRelocationType(
4577 unsigned MachOObjectFile::getAnyRelocationAddress(
4584 unsigned MachOObjectFile::getAnyRelocationPCRel(
4591 unsigned MachOObjectFile::getAnyRelocationLength(
4599 MachOObjectFile::getAnyRelocationType(
4607 MachOObjectFile::getAnyRelocationSection(
4619 MachO::section MachOObjectFile::getSection(DataRefImpl DRI) const {
4624 MachO::section_64 MachOObjectFile::getSection64(DataRefImpl DRI) const {
4629 MachO::section MachOObjectFile::getSection(const LoadCommandInfo &L,
4635 MachO::section_64 MachOObjectFile::getSection64(const LoadCommandInfo &L,
4642 MachOObjectFile::getSymbolTableEntry(DataRefImpl DRI) const {
4648 MachOObjectFile::getSymbol64TableEntry(DataRefImpl DRI) const {
4654 MachOObjectFile::getLinkeditDataLoadCommand(const LoadCommandInfo &L) const {
4659 MachOObjectFile::getSegmentLoadCommand(const LoadCommandInfo &L) const {
4664 MachOObjectFile::getSegment64LoadCommand(const LoadCommandInfo &L) const {
4669 MachOObjectFile::getLinkerOptionLoadCommand(const LoadCommandInfo &L) const {
4674 MachOObjectFile::getVersionMinLoadCommand(const LoadCommandInfo &L) const {
4679 MachOObjectFile::getNoteLoadCommand(const LoadCommandInfo &L) const {
4684 MachOObjectFile::getBuildVersionLoadCommand(const LoadCommandInfo &L) const {
4689 MachOObjectFile::getBuildToolVersion(unsigned index) const {
4694 MachOObjectFile::getDylibIDLoadCommand(const LoadCommandInfo &L) const {
4699 MachOObjectFile::getDyldInfoLoadCommand(const LoadCommandInfo &L) const {
4704 MachOObjectFile::getDylinkerCommand(const LoadCommandInfo &L) const {
4709 MachOObjectFile::getUuidCommand(const LoadCommandInfo &L) const {
4714 MachOObjectFile::getRpathCommand(const LoadCommandInfo &L) const {
4719 MachOObjectFile::getSourceVersionCommand(const LoadCommandInfo &L) const {
4724 MachOObjectFile::getEntryPointCommand(const LoadCommandInfo &L) const {
4729 MachOObjectFile::getEncryptionInfoCommand(const LoadCommandInfo &L) const {
4734 MachOObjectFile::getEncryptionInfoCommand64(const LoadCommandInfo &L) const {
4739 MachOObjectFile::getSubFrameworkCommand(const LoadCommandInfo &L) const {
4744 MachOObjectFile::getSubUmbrellaCommand(const LoadCommandInfo &L) const {
4749 MachOObjectFile::getSubLibraryCommand(const LoadCommandInfo &L) const {
4754 MachOObjectFile::getSubClientCommand(const LoadCommandInfo &L) const {
4759 MachOObjectFile::getRoutinesCommand(const LoadCommandInfo &L) const {
4764 MachOObjectFile::getRoutinesCommand64(const LoadCommandInfo &L) const {
4769 MachOObjectFile::getThreadCommand(const LoadCommandInfo &L) const {
4774 MachOObjectFile::getFilesetEntryLoadCommand(const LoadCommandInfo &L) const {
4779 MachOObjectFile::getRelocation(DataRefImpl Rel) const {
4806 MachOObjectFile::getDice(DataRefImpl Rel) const {
4811 const MachO::mach_header &MachOObjectFile::getHeader() const {
4815 const MachO::mach_header_64 &MachOObjectFile::getHeader64() const {
4820 uint32_t MachOObjectFile::getIndirectSymbolTableEntry(
4828 MachOObjectFile::getDataInCodeTableEntry(uint32_t DataOffset,
4834 MachO::symtab_command MachOObjectFile::getSymtabLoadCommand() const {
4849 MachO::dysymtab_command MachOObjectFile::getDysymtabLoadCommand() const {
4879 MachOObjectFile::getDataInCodeLoadCommand() const {
4893 MachOObjectFile::getLinkOptHintsLoadCommand() const {
4907 ArrayRef<uint8_t> MachOObjectFile::getDyldInfoRebaseOpcodes() const {
4921 ArrayRef<uint8_t> MachOObjectFile::getDyldInfoBindOpcodes() const {
4935 ArrayRef<uint8_t> MachOObjectFile::getDyldInfoWeakBindOpcodes() const {
4949 ArrayRef<uint8_t> MachOObjectFile::getDyldInfoLazyBindOpcodes() const {
4963 ArrayRef<uint8_t> MachOObjectFile::getDyldInfoExportsTrie() const {
4978 MachOObjectFile::getChainedFixupsLoadCommand() const {
4997 MachOObjectFile::getChainedFixupsHeader() const {
5048 MachOObjectFile::getChainedFixupsSegments() const {
5147 static std::array<T, N> getArray(const MachOObjectFile &O, const void *Ptr) {
5157 MachOObjectFile::getDyldChainedFixupTargets() const {
5249 ArrayRef<uint8_t> MachOObjectFile::getDyldExportsTrie() const {
5263 SmallVector<uint64_t> MachOObjectFile::getFunctionStarts() const {
5278 ArrayRef<uint8_t> MachOObjectFile::getUuid() const {
5286 StringRef MachOObjectFile::getStringTableData() const {
5291 bool MachOObjectFile::is64Bit() const {
5296 void MachOObjectFile::ReadULEB128s(uint64_t Index,
5308 bool MachOObjectFile::isRelocatableObject() const {
5312 /// Create a MachOObjectFile instance from a given buffer.
5318 /// \returns A std::unique_ptr to a MachOObjectFile instance on success.
5319 Expected<std::unique_ptr<MachOObjectFile>> ObjectFile::createMachOObjectFile(
5324 return MachOObjectFile::create(Buffer, false, false, UniversalCputype,
5327 return MachOObjectFile::create(Buffer, true, false, UniversalCputype,
5330 return MachOObjectFile::create(Buffer, false, true, UniversalCputype,
5333 return MachOObjectFile::create(Buffer, true, true, UniversalCputype,
5339 StringRef MachOObjectFile::mapDebugSectionName(StringRef Name) const {
5346 MachOObjectFile::findDsymObjectMembers(StringRef Path) {
5389 MachOObjectFile::mapReflectionSectionNameToEnumValue(
5400 bool MachOObjectFile::isMachOPairedReloc(uint64_t RelocType, uint64_t Arch) {