|
LLVM 22.0.0git
|
#include "llvm/Object/MachO.h"
Classes | |
| struct | LoadCommandInfo |
Public Types | |
| using | LoadCommandList = SmallVector<LoadCommandInfo, 4> |
| using | load_command_iterator = LoadCommandList::const_iterator |
| Public Types inherited from llvm::object::ObjectFile | |
| using | symbol_iterator_range = iterator_range<symbol_iterator> |
| using | section_iterator_range = iterator_range<section_iterator> |
| Public Types inherited from llvm::object::SymbolicFile | |
| using | basic_symbol_iterator_range = iterator_range<basic_symbol_iterator> |
Static Public Member Functions | |
| static Expected< std::unique_ptr< MachOObjectFile > > | create (MemoryBufferRef Object, bool IsLittleEndian, bool Is64Bits, uint32_t UniversalCputype=0, uint32_t UniversalIndex=0, size_t MachOFilesetEntryOffset=0) |
| static bool | isMachOPairedReloc (uint64_t RelocType, uint64_t Arch) |
| static iterator_range< export_iterator > | exports (Error &Err, ArrayRef< uint8_t > Trie, const MachOObjectFile *O=nullptr) |
| For use examining a trie not in a MachOObjectFile. | |
| static iterator_range< rebase_iterator > | rebaseTable (Error &Err, MachOObjectFile *O, ArrayRef< uint8_t > Opcodes, bool is64) |
| For use examining rebase opcodes in a MachOObjectFile. | |
| static iterator_range< bind_iterator > | bindTable (Error &Err, MachOObjectFile *O, ArrayRef< uint8_t > Opcodes, bool is64, MachOBindEntry::Kind) |
| For use examining bind opcodes in a MachOObjectFile. | |
| static StringRef | guessLibraryShortName (StringRef Name, bool &isFramework, StringRef &Suffix) |
| static Triple::ArchType | getArch (uint32_t CPUType, uint32_t CPUSubType) |
| static Triple | getArchTriple (uint32_t CPUType, uint32_t CPUSubType, const char **McpuDefault=nullptr, const char **ArchFlag=nullptr) |
| static bool | isValidArch (StringRef ArchFlag) |
| static ArrayRef< StringRef > | getValidArchs () |
| static Triple | getHostArch () |
| static bool | classof (const Binary *v) |
| static uint32_t | getVersionMinMajor (MachO::version_min_command &C, bool SDK) |
| static uint32_t | getVersionMinMinor (MachO::version_min_command &C, bool SDK) |
| static uint32_t | getVersionMinUpdate (MachO::version_min_command &C, bool SDK) |
| static std::string | getBuildPlatform (uint32_t platform) |
| static std::string | getBuildTool (uint32_t tools) |
| static std::string | getVersionString (uint32_t version) |
| static Expected< std::vector< std::string > > | findDsymObjectMembers (StringRef Path) |
| If the input path is a .dSYM bundle (as created by the dsymutil tool), return the paths to the object files found in the bundle, otherwise return an empty vector. | |
| Static Public Member Functions inherited from llvm::object::ObjectFile | |
| static Expected< OwningBinary< ObjectFile > > | createObjectFile (StringRef ObjectPath) |
| static Expected< std::unique_ptr< ObjectFile > > | createObjectFile (MemoryBufferRef Object, llvm::file_magic Type, bool InitContent=true) |
| static Expected< std::unique_ptr< ObjectFile > > | createObjectFile (MemoryBufferRef Object) |
| static bool | classof (const Binary *v) |
| static Expected< std::unique_ptr< COFFObjectFile > > | createCOFFObjectFile (MemoryBufferRef Object) |
| static Expected< std::unique_ptr< ObjectFile > > | createXCOFFObjectFile (MemoryBufferRef Object, unsigned FileType) |
| static Expected< std::unique_ptr< ObjectFile > > | createELFObjectFile (MemoryBufferRef Object, bool InitContent=true) |
| static Expected< std::unique_ptr< MachOObjectFile > > | createMachOObjectFile (MemoryBufferRef Object, uint32_t UniversalCputype=0, uint32_t UniversalIndex=0, size_t MachOFilesetEntryOffset=0) |
| Create a MachOObjectFile instance from a given buffer. | |
| static Expected< std::unique_ptr< ObjectFile > > | createGOFFObjectFile (MemoryBufferRef Object) |
| static Expected< std::unique_ptr< WasmObjectFile > > | createWasmObjectFile (MemoryBufferRef Object) |
| static Expected< std::unique_ptr< DXContainerObjectFile > > | createDXContainerObjectFile (MemoryBufferRef Object) |
| Static Public Member Functions inherited from llvm::object::SymbolicFile | |
| static Expected< std::unique_ptr< SymbolicFile > > | createSymbolicFile (MemoryBufferRef Object, llvm::file_magic Type, LLVMContext *Context, bool InitContent=true) |
| static Expected< std::unique_ptr< SymbolicFile > > | createSymbolicFile (MemoryBufferRef Object) |
| static bool | classof (const Binary *v) |
| static bool | isSymbolicFile (file_magic Type, const LLVMContext *Context) |
| Static Public Member Functions inherited from llvm::object::Binary | |
| static Error | checkOffset (MemoryBufferRef M, uintptr_t Addr, const uint64_t Size) |
| dice_iterator MachOObjectFile::begin_dices | ( | ) | const |
Definition at line 2935 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, getDataInCodeLoadCommand(), getPtr(), and llvm::object::DataRefImpl::p.
| MachOObjectFile::load_command_iterator MachOObjectFile::begin_load_commands | ( | ) | const |
Definition at line 4540 of file MachOObjectFile.cpp.
Referenced by load_commands().
|
inline |
Definition at line 581 of file MachO.h.
References llvm::Count.
|
inline |
| iterator_range< bind_iterator > MachOObjectFile::bindTable | ( | Error & | Err | ) |
For use iterating over all bind table entries.
Definition at line 4511 of file MachOObjectFile.cpp.
References bindTable(), getDyldInfoBindOpcodes(), is64Bit(), and llvm::object::MachOBindEntry::Regular.
Referenced by bindTable(), lazyBindTable(), and weakBindTable().
|
static |
For use examining bind opcodes in a MachOObjectFile.
Definition at line 4497 of file MachOObjectFile.cpp.
References llvm::make_range().
| Error MachOObjectFile::checkSymbolTable | ( | ) | const |
Definition at line 1701 of file MachOObjectFile.cpp.
References llvm::MachO::DYNAMIC_LOOKUP_ORDINAL, llvm::MachO::EXECUTABLE_ORDINAL, llvm::MachO::mach_header_64::flags, llvm::MachO::GET_LIBRARY_ORDINAL(), getHeader(), getHeader64(), getSymbol64TableEntry(), getSymbolTableEntry(), getSymtabLoadCommand(), H, is64Bit(), malformedError(), llvm::MachO::MH_TWOLEVEL, llvm::MachO::nlist::n_desc, llvm::MachO::nlist_64::n_desc, llvm::MachO::N_INDR, llvm::MachO::N_PBUD, llvm::MachO::N_SECT, llvm::MachO::nlist::n_sect, llvm::MachO::nlist_64::n_sect, llvm::MachO::N_STAB, llvm::MachO::nlist::n_strx, llvm::MachO::nlist_64::n_strx, llvm::MachO::N_TYPE, llvm::MachO::nlist::n_type, llvm::MachO::nlist_64::n_type, llvm::MachO::N_UNDF, llvm::MachO::nlist::n_value, llvm::MachO::nlist_64::n_value, llvm::MachO::symtab_command::strsize, llvm::Error::success(), llvm::object::ObjectFile::SymbolRef, and llvm::object::ObjectFile::symbols().
|
static |
Definition at line 1254 of file MachOObjectFile.cpp.
References llvm::Error::success().
Referenced by llvm::object::ObjectFile::createMachOObjectFile().
| dice_iterator MachOObjectFile::end_dices | ( | ) | const |
Definition at line 2945 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, getDataInCodeLoadCommand(), getPtr(), llvm::Offset, and llvm::object::DataRefImpl::p.
| MachOObjectFile::load_command_iterator MachOObjectFile::end_load_commands | ( | ) | const |
Definition at line 4545 of file MachOObjectFile.cpp.
Referenced by load_commands().
| iterator_range< export_iterator > MachOObjectFile::exports | ( | Error & | Err | ) | const |
For use iterating over all exported symbols.
Definition at line 3276 of file MachOObjectFile.cpp.
References exports(), getDyldExportsTrie(), and getDyldInfoExportsTrie().
Referenced by exports().
|
static |
For use examining a trie not in a MachOObjectFile.
Definition at line 3262 of file MachOObjectFile.cpp.
References llvm::ArrayRef< T >::empty(), and llvm::make_range().
|
inline |
Definition at line 482 of file MachO.h.
References extrel_begin(), extrel_end(), and llvm::make_range().
| relocation_iterator MachOObjectFile::extrel_begin | ( | ) | const |
Definition at line 2221 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, and llvm::object::ObjectFile::RelocationRef.
Referenced by external_relocations().
| relocation_iterator MachOObjectFile::extrel_end | ( | ) | const |
Definition at line 2229 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, getDysymtabLoadCommand(), and llvm::object::ObjectFile::RelocationRef.
Referenced by external_relocations().
|
static |
If the input path is a .dSYM bundle (as created by the dsymutil tool), return the paths to the object files found in the bundle, otherwise return an empty vector.
If the path appears to be a .dSYM bundle but no objects were found or there was a filesystem error, then return an error.
Definition at line 5382 of file MachOObjectFile.cpp.
References llvm::sys::path::append(), llvm::createFileError(), llvm::createStringError(), llvm::errorCodeToError(), llvm::sys::path::extension(), llvm::sys::fs::is_directory(), llvm::no_such_file_or_directory, llvm::sys::fs::regular_file, llvm::sys::path::remove_dots(), llvm::sys::fs::status(), llvm::StringRef::str(), llvm::sys::fs::symlink_file, and llvm::sys::fs::type_unknown.
Referenced by llvm::MachO::DylibReader::accumulateSourceLocFromDSYM(), and llvm::InstrProfCorrelator::get().
| iterator_range< fixup_iterator > MachOObjectFile::fixupTable | ( | Error & | Err | ) |
For iterating over all chained fixups.
Definition at line 4526 of file MachOObjectFile.cpp.
References llvm::make_range(), and llvm::object::MachOChainedFixupEntry::moveToEnd().
| unsigned MachOObjectFile::getAnyRelocationAddress | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4613 of file MachOObjectFile.cpp.
References getPlainRelocationAddress(), getScatteredRelocationAddress(), and isRelocationScattered().
Referenced by getRelocationOffset().
| unsigned MachOObjectFile::getAnyRelocationLength | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4627 of file MachOObjectFile.cpp.
References getPlainRelocationLength(), getScatteredRelocationLength(), and isRelocationScattered().
Referenced by getRelocationLength().
| unsigned MachOObjectFile::getAnyRelocationPCRel | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4620 of file MachOObjectFile.cpp.
References getPlainRelocationPCRel(), getScatteredRelocationPCRel(), and isRelocationScattered().
| SectionRef MachOObjectFile::getAnyRelocationSection | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4643 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, getPlainRelocationExternal(), getPlainRelocationSymbolNum(), isRelocationScattered(), llvm::MachO::R_ABS, section_end(), and llvm::object::ObjectFile::SectionRef.
Referenced by getRelocationSection().
| unsigned MachOObjectFile::getAnyRelocationType | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4635 of file MachOObjectFile.cpp.
References getPlainRelocationType(), getScatteredRelocationType(), and isRelocationScattered().
Referenced by extractSections(), and getRelocationType().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2915 of file MachOObjectFile.cpp.
References getArch(), getCPUSubType(), and getCPUType().
Referenced by llvm::orc::checkMachORelocatableObject(), getArch(), and getRelocationTypeName().
|
static |
Definition at line 2712 of file MachOObjectFile.cpp.
References llvm::Triple::aarch64, llvm::Triple::aarch64_32, llvm::Triple::arm, llvm::MachO::CPU_TYPE_ARM, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_TYPE_ARM64_32, llvm::MachO::CPU_TYPE_I386, llvm::MachO::CPU_TYPE_POWERPC, llvm::MachO::CPU_TYPE_POWERPC64, llvm::MachO::CPU_TYPE_RISCV, llvm::MachO::CPU_TYPE_X86_64, llvm::Triple::ppc, llvm::Triple::ppc64, llvm::Triple::riscv32, llvm::Triple::UnknownArch, llvm::Triple::x86, and llvm::Triple::x86_64.
Definition at line 2919 of file MachOObjectFile.cpp.
References getArchTriple(), and Header.
Referenced by llvm::object::Slice::create(), llvm::object::MachOUniversalBinary::ObjectForArch::getArchFlagName(), getArchTriple(), and llvm::object::MachOUniversalBinary::ObjectForArch::getTriple().
|
static |
Definition at line 2735 of file MachOObjectFile.cpp.
References llvm::MachO::CPU_SUBTYPE_ARM64_32_V8, llvm::MachO::CPU_SUBTYPE_ARM64_ALL, llvm::MachO::CPU_SUBTYPE_ARM64E, llvm::MachO::CPU_SUBTYPE_ARM_V4T, llvm::MachO::CPU_SUBTYPE_ARM_V5TEJ, llvm::MachO::CPU_SUBTYPE_ARM_V6, llvm::MachO::CPU_SUBTYPE_ARM_V6M, llvm::MachO::CPU_SUBTYPE_ARM_V7, llvm::MachO::CPU_SUBTYPE_ARM_V7EM, llvm::MachO::CPU_SUBTYPE_ARM_V7K, llvm::MachO::CPU_SUBTYPE_ARM_V7M, llvm::MachO::CPU_SUBTYPE_ARM_V7S, llvm::MachO::CPU_SUBTYPE_ARM_XSCALE, llvm::MachO::CPU_SUBTYPE_I386_ALL, llvm::MachO::CPU_SUBTYPE_MASK, llvm::MachO::CPU_SUBTYPE_POWERPC_ALL, llvm::MachO::CPU_SUBTYPE_RISCV_ALL, llvm::MachO::CPU_SUBTYPE_X86_64_ALL, llvm::MachO::CPU_SUBTYPE_X86_64_H, llvm::MachO::CPU_TYPE_ARM, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_TYPE_ARM64_32, llvm::MachO::CPU_TYPE_I386, llvm::MachO::CPU_TYPE_POWERPC, llvm::MachO::CPU_TYPE_POWERPC64, llvm::MachO::CPU_TYPE_RISCV, and llvm::MachO::CPU_TYPE_X86_64.
|
inlinestatic |
Definition at line 794 of file MachO.h.
References llvm::format_hex().
|
inlinestatic |
Definition at line 809 of file MachO.h.
References llvm::format_hex(), llvm::MachO::TOOL_CLANG, llvm::MachO::TOOL_LD, llvm::MachO::TOOL_LLD, and llvm::MachO::TOOL_SWIFT.
| MachO::build_tool_version MachOObjectFile::getBuildToolVersion | ( | unsigned | index | ) | const |
Definition at line 4725 of file MachOObjectFile.cpp.
References getStruct().
| MachO::build_version_command MachOObjectFile::getBuildVersionLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4720 of file MachOObjectFile.cpp.
References getStruct().
|
overridevirtual |
The number of bytes used to represent an address in this object file format.
Implements llvm::object::ObjectFile.
Definition at line 2677 of file MachOObjectFile.cpp.
References is64Bit().
| Expected< std::optional< MachO::dyld_chained_fixups_header > > MachOObjectFile::getChainedFixupsHeader | ( | ) | const |
If the optional is std::nullopt, no header was found, but the object was well-formed.
Definition at line 5033 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, llvm::MachO::dyld_chained_fixups_header::fixups_version, getChainedFixupsLoadCommand(), getPtr(), getStructOrErr(), llvm::MachO::dyld_chained_fixups_header::imports_format, malformedError(), and llvm::MachO::dyld_chained_fixups_header::starts_offset.
Referenced by getChainedFixupsSegments(), and getDyldChainedFixupTargets().
| Expected< std::optional< MachO::linkedit_data_command > > MachOObjectFile::getChainedFixupsLoadCommand | ( | ) | const |
Definition at line 5014 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, and getStructOrErr().
Referenced by getChainedFixupsHeader(), getChainedFixupsSegments(), and getDyldChainedFixupTargets().
| Expected< std::pair< size_t, std::vector< ChainedFixupsSegment > > > MachOObjectFile::getChainedFixupsSegments | ( | ) | const |
Definition at line 5084 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, Fail, getChainedFixupsHeader(), getChainedFixupsLoadCommand(), getPtr(), getStructOrErr(), Header, I, llvm::object::Binary::isLittleEndian(), llvm::sys::IsLittleEndianHost, malformedError(), N, offsetof, llvm::MachO::dyld_chained_starts_in_segment::page_count, llvm::MachO::dyld_chained_starts_in_segment::pointer_format, llvm::MachO::dyld_chained_starts_in_image::seg_count, llvm::MachO::dyld_chained_starts_in_segment::size, and llvm::sys::swapByteOrder().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1838 of file MachOObjectFile.cpp.
References getNValue().
| MachO::linkedit_data_command MachOObjectFile::getDataInCodeLoadCommand | ( | ) | const |
Definition at line 4915 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::cmd, llvm::MachO::linkedit_data_command::cmdsize, llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, and getStruct().
Referenced by begin_dices(), and end_dices().
| MachO::data_in_code_entry MachOObjectFile::getDataInCodeTableEntry | ( | uint32_t | DataOffset, |
| unsigned | Index ) const |
Definition at line 4864 of file MachOObjectFile.cpp.
References getPtr(), getStruct(), and llvm::Offset.
| MachO::data_in_code_entry MachOObjectFile::getDice | ( | DataRefImpl | Rel | ) | const |
Definition at line 4842 of file MachOObjectFile.cpp.
References getStruct(), P, and llvm::object::DataRefImpl::p.
Referenced by llvm::object::DiceRef::getKind(), llvm::object::DiceRef::getLength(), and llvm::object::DiceRef::getOffset().
| Expected< std::vector< ChainedFixupTarget > > MachOObjectFile::getDyldChainedFixupTargets | ( | ) | const |
Definition at line 5193 of file MachOObjectFile.cpp.
References llvm::bit_cast(), llvm::object::createError(), llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, llvm::MachO::DYLD_CHAINED_IMPORT, llvm::MachO::DYLD_CHAINED_IMPORT_ADDEND, llvm::MachO::DYLD_CHAINED_IMPORT_ADDEND64, getArray(), getChainedFixupsHeader(), getChainedFixupsLoadCommand(), getEncodedOrdinal(), getPtr(), Header, llvm::object::Binary::isLittleEndian(), llvm_unreachable, and malformedError().
Definition at line 5285 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, getPtr(), and getStructOrErr().
Referenced by exports().
Definition at line 4957 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), llvm::MachO::dyld_info_command::bind_off, llvm::MachO::dyld_info_command::bind_size, getPtr(), and getStructOrErr().
Referenced by bindTable().
Definition at line 4999 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), llvm::MachO::dyld_info_command::export_off, llvm::MachO::dyld_info_command::export_size, getPtr(), and getStructOrErr().
Referenced by exports().
Definition at line 4985 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), getPtr(), getStructOrErr(), llvm::MachO::dyld_info_command::lazy_bind_off, and llvm::MachO::dyld_info_command::lazy_bind_size.
Referenced by lazyBindTable().
| MachO::dyld_info_command MachOObjectFile::getDyldInfoLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4735 of file MachOObjectFile.cpp.
References getStruct().
Definition at line 4943 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), getPtr(), getStructOrErr(), llvm::MachO::dyld_info_command::rebase_off, and llvm::MachO::dyld_info_command::rebase_size.
Referenced by rebaseTable().
Definition at line 4971 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), getPtr(), getStructOrErr(), llvm::MachO::dyld_info_command::weak_bind_off, and llvm::MachO::dyld_info_command::weak_bind_size.
Referenced by weakBindTable().
| MachO::dylib_command MachOObjectFile::getDylibIDLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4730 of file MachOObjectFile.cpp.
References getStruct().
| MachO::dylinker_command MachOObjectFile::getDylinkerCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4740 of file MachOObjectFile.cpp.
References getStruct().
| MachO::dysymtab_command MachOObjectFile::getDysymtabLoadCommand | ( | ) | const |
Definition at line 4885 of file MachOObjectFile.cpp.
References llvm::MachO::dysymtab_command::cmd, llvm::MachO::dysymtab_command::cmdsize, llvm::MachO::dysymtab_command::extrefsymoff, llvm::MachO::dysymtab_command::extreloff, getStruct(), llvm::MachO::dysymtab_command::iextdefsym, llvm::MachO::dysymtab_command::ilocalsym, llvm::MachO::dysymtab_command::indirectsymoff, llvm::MachO::dysymtab_command::iundefsym, llvm::MachO::dysymtab_command::locreloff, llvm::MachO::dysymtab_command::modtaboff, llvm::MachO::dysymtab_command::nextdefsym, llvm::MachO::dysymtab_command::nextrefsyms, llvm::MachO::dysymtab_command::nextrel, llvm::MachO::dysymtab_command::nindirectsyms, llvm::MachO::dysymtab_command::nlocalsym, llvm::MachO::dysymtab_command::nlocrel, llvm::MachO::dysymtab_command::nmodtab, llvm::MachO::dysymtab_command::ntoc, llvm::MachO::dysymtab_command::nundefsym, and llvm::MachO::dysymtab_command::tocoff.
Referenced by extrel_end(), getRelocation(), and locrel_end().
| MachO::encryption_info_command MachOObjectFile::getEncryptionInfoCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4765 of file MachOObjectFile.cpp.
References getStruct().
| MachO::encryption_info_command_64 MachOObjectFile::getEncryptionInfoCommand64 | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4770 of file MachOObjectFile.cpp.
References getStruct().
| MachO::entry_point_command MachOObjectFile::getEntryPointCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4760 of file MachOObjectFile.cpp.
References getStruct().
|
inlineoverridevirtual |
Implements llvm::object::ObjectFile.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2681 of file MachOObjectFile.cpp.
References llvm::MachO::CPU_TYPE_ARM, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_TYPE_ARM64_32, llvm::MachO::CPU_TYPE_I386, llvm::MachO::CPU_TYPE_POWERPC, llvm::MachO::CPU_TYPE_POWERPC64, llvm::MachO::CPU_TYPE_RISCV, llvm::MachO::CPU_TYPE_X86_64, getCPUType(), and is64Bit().
| MachO::fileset_entry_command MachOObjectFile::getFilesetEntryLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4810 of file MachOObjectFile.cpp.
References getStruct().
| SmallVector< uint64_t > MachOObjectFile::getFunctionStarts | ( | ) | const |
Definition at line 5299 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, getStructOrErr(), and ReadULEB128s().
| const MachO::mach_header & MachOObjectFile::getHeader | ( | ) | const |
Definition at line 4847 of file MachOObjectFile.cpp.
References Header.
Referenced by checkSymbolTable(), extractSections(), getRelocation(), getRelocationOffset(), and isRelocatableObject().
| const MachO::mach_header_64 & MachOObjectFile::getHeader64 | ( | ) | const |
Definition at line 4851 of file MachOObjectFile.cpp.
References assert(), Header64, and is64Bit().
Referenced by checkSymbolTable().
|
static |
Definition at line 2881 of file MachOObjectFile.cpp.
References llvm::sys::getDefaultTargetTriple().
| std::error_code MachOObjectFile::getIndirectName | ( | DataRefImpl | Symb, |
| StringRef & | Res ) const |
Definition at line 1807 of file MachOObjectFile.cpp.
References getNValue(), getStringTableData(), getSymbolTableEntryBase(), llvm::MachO::N_INDR, llvm::MachO::N_TYPE, llvm::object::parse_failed, and llvm::StringTable::size().
| uint32_t MachOObjectFile::getIndirectSymbolTableEntry | ( | const MachO::dysymtab_command & | DLC, |
| unsigned | Index ) const |
Definition at line 4856 of file MachOObjectFile.cpp.
References getPtr(), getStruct(), and llvm::Offset.
| uint32_t MachOObjectFile::getLibraryCount | ( | ) | const |
Definition at line 2607 of file MachOObjectFile.cpp.
| std::error_code MachOObjectFile::getLibraryShortNameByIndex | ( | unsigned | Index, |
| StringRef & | Res ) const |
Definition at line 2573 of file MachOObjectFile.cpp.
References D(), llvm::StringRef::empty(), getStructOrErr(), guessLibraryShortName(), P, and llvm::object::parse_failed.
| MachO::linkedit_data_command MachOObjectFile::getLinkeditDataLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4690 of file MachOObjectFile.cpp.
References getStruct().
| MachO::linker_option_command MachOObjectFile::getLinkerOptionLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4705 of file MachOObjectFile.cpp.
References getStruct().
| MachO::linkedit_data_command MachOObjectFile::getLinkOptHintsLoadCommand | ( | ) | const |
Definition at line 4929 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::cmd, llvm::MachO::linkedit_data_command::cmdsize, llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, and getStruct().
|
inline |
| MachO::note_command MachOObjectFile::getNoteLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4715 of file MachOObjectFile.cpp.
References getStruct().
| uint64_t MachOObjectFile::getNValue | ( | DataRefImpl | Sym | ) | const |
Definition at line 1796 of file MachOObjectFile.cpp.
References getSymbol64TableEntry(), getSymbolTableEntry(), and is64Bit().
Referenced by getCommonSymbolSizeImpl(), getIndirectName(), and getSymbolFlags().
| bool MachOObjectFile::getPlainRelocationExternal | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4591 of file MachOObjectFile.cpp.
References llvm::object::Binary::isLittleEndian(), and llvm::MachO::any_relocation_info::r_word1.
Referenced by extractSections(), getAnyRelocationSection(), and getRelocationSymbol().
| unsigned MachOObjectFile::getPlainRelocationSymbolNum | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4584 of file MachOObjectFile.cpp.
References llvm::object::Binary::isLittleEndian(), and llvm::MachO::any_relocation_info::r_word1.
Referenced by getAnyRelocationSection(), and getRelocationSymbol().
| MachO::any_relocation_info MachOObjectFile::getRelocation | ( | DataRefImpl | Rel | ) | const |
Definition at line 4815 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, getDysymtabLoadCommand(), getHeader(), getPtr(), getSection(), getSection64(), getStruct(), is64Bit(), llvm::MachO::MH_OBJECT, llvm::Offset, P, llvm::MachO::section::reloff, and llvm::MachO::section_64::reloff.
Referenced by extractSections(), llvm::jitlink::MachOLinkGraphBuilder::getRelocationInfo(), getRelocationLength(), getRelocationOffset(), getRelocationSection(), getRelocationSymbol(), getRelocationType(), and isRelocScattered().
| uint8_t MachOObjectFile::getRelocationLength | ( | DataRefImpl | Rel | ) | const |
Definition at line 2408 of file MachOObjectFile.cpp.
References getAnyRelocationLength(), and getRelocation().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2259 of file MachOObjectFile.cpp.
References assert(), getAnyRelocationAddress(), getHeader(), getRelocation(), llvm::MachO::MH_KEXT_BUNDLE, and llvm::MachO::MH_OBJECT.
| section_iterator MachOObjectFile::getRelocationRelocatedSection | ( | relocation_iterator | Rel | ) | const |
Definition at line 2612 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, llvm::object::RelocationRef::getRawDataRefImpl(), and llvm::object::ObjectFile::SectionRef.
| section_iterator MachOObjectFile::getRelocationSection | ( | DataRefImpl | Rel | ) | const |
Definition at line 2289 of file MachOObjectFile.cpp.
References getAnyRelocationSection(), and getRelocation().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2268 of file MachOObjectFile.cpp.
References getPlainRelocationExternal(), getPlainRelocationSymbolNum(), getPtr(), getRelocation(), getSymtabLoadCommand(), is64Bit(), isRelocationScattered(), llvm::Offset, llvm::object::DataRefImpl::p, symbol_end(), llvm::object::ObjectFile::SymbolRef, llvm::XCOFF::SymbolTableEntrySize, and llvm::MachO::symtab_command::symoff.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2293 of file MachOObjectFile.cpp.
References getAnyRelocationType(), and getRelocation().
Referenced by getRelocationTypeName().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2298 of file MachOObjectFile.cpp.
References llvm::Triple::aarch64, llvm::Triple::aarch64_32, llvm::Triple::arm, llvm::StringRef::begin(), llvm::StringRef::end(), getArch(), getRelocationType(), llvm::Triple::ppc, llvm::Triple::UnknownArch, llvm::Triple::x86, and llvm::Triple::x86_64.
| MachO::routines_command MachOObjectFile::getRoutinesCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4795 of file MachOObjectFile.cpp.
References getStruct().
| MachO::routines_command_64 MachOObjectFile::getRoutinesCommand64 | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4800 of file MachOObjectFile.cpp.
References getStruct().
| MachO::rpath_command MachOObjectFile::getRpathCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4750 of file MachOObjectFile.cpp.
References getStruct().
| bool MachOObjectFile::getScatteredRelocationScattered | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4598 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word0.
| uint32_t MachOObjectFile::getScatteredRelocationType | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4608 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word0.
Referenced by getAnyRelocationType().
| uint32_t MachOObjectFile::getScatteredRelocationValue | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4603 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word1.
| MachO::section MachOObjectFile::getSection | ( | const LoadCommandInfo & | L, |
| unsigned | Index ) const |
Definition at line 4665 of file MachOObjectFile.cpp.
References getSectionPtr(), and getStruct().
| MachO::section MachOObjectFile::getSection | ( | DataRefImpl | DRI | ) | const |
Definition at line 4655 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, assert(), llvm::object::DataRefImpl::d, and getStruct().
| Expected< SectionRef > MachOObjectFile::getSection | ( | StringRef | SectionName | ) | const |
Definition at line 2048 of file MachOObjectFile.cpp.
References llvm::errorCodeToError(), llvm::object::parse_failed, llvm::object::ObjectFile::SectionRef, and llvm::object::ObjectFile::sections().
| Expected< SectionRef > MachOObjectFile::getSection | ( | unsigned | SectionIndex | ) | const |
Definition at line 2039 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, malformedError(), and llvm::object::ObjectFile::SectionRef.
Referenced by extractSections(), getRelocation(), getSectionAddress(), getSectionAlignment(), getSectionContents(), getSectionSize(), isSectionStripped(), and section_rel_end().
| MachO::section_64 MachOObjectFile::getSection64 | ( | const LoadCommandInfo & | L, |
| unsigned | Index ) const |
Definition at line 4671 of file MachOObjectFile.cpp.
References getSectionPtr(), and getStruct().
| MachO::section_64 MachOObjectFile::getSection64 | ( | DataRefImpl | DRI | ) | const |
Definition at line 4660 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, assert(), llvm::object::DataRefImpl::d, and getStruct().
Referenced by getRelocation(), getSectionAddress(), getSectionAlignment(), getSectionContents(), getSectionSize(), isSectionStripped(), and section_rel_end().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1942 of file MachOObjectFile.cpp.
References llvm::MachO::section_64::addr, getSection(), getSection64(), and is64Bit().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2026 of file MachOObjectFile.cpp.
References llvm::MachO::section::align, llvm::MachO::section_64::align, getSection(), getSection64(), and is64Bit().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1987 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, getSection(), getSection64(), getSectionContents(), getStruct(), is64Bit(), malformedError(), llvm::Offset, llvm::MachO::section::offset, llvm::MachO::section_64::offset, Size, llvm::MachO::section::size, and llvm::MachO::section_64::size.
Definition at line 1981 of file MachOObjectFile.cpp.
References llvm::arrayRefFromStringRef(), llvm::object::Binary::getData(), llvm::Offset, Size, and substr().
Referenced by extractSections(), and getSectionContents().
| StringRef MachOObjectFile::getSectionFinalSegmentName | ( | DataRefImpl | Sec | ) | const |
Definition at line 4555 of file MachOObjectFile.cpp.
References llvm::ArrayRef< T >::data(), getSectionRawFinalSegmentName(), and parseSegmentOrSectionName().
Referenced by isSectionBitcode().
| unsigned MachOObjectFile::getSectionID | ( | SectionRef | Sec | ) | const |
Definition at line 2173 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, llvm::object::SectionRef::getRawDataRefImpl(), and llvm::object::ObjectFile::SectionRef.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1948 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, and llvm::object::DataRefImpl::d.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1937 of file MachOObjectFile.cpp.
References llvm::ArrayRef< T >::data(), getSectionRawName(), and parseSegmentOrSectionName().
Referenced by isDebugSection(), and isSectionBitcode().
| ArrayRef< char > MachOObjectFile::getSectionRawFinalSegmentName | ( | DataRefImpl | Sec | ) | const |
Definition at line 4569 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::ArrayRef(), assert(), llvm::sampleprof::Base, and llvm::object::DataRefImpl::d.
Referenced by getSectionFinalSegmentName().
| ArrayRef< char > MachOObjectFile::getSectionRawName | ( | DataRefImpl | Sec | ) | const |
Definition at line 4561 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::ArrayRef(), assert(), llvm::sampleprof::Base, and llvm::object::DataRefImpl::d.
Referenced by getSectionName().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1952 of file MachOObjectFile.cpp.
References llvm::MachO::section::flags, llvm::MachO::section_64::flags, llvm::object::Binary::getData(), getSection(), getSection64(), is64Bit(), llvm::MachO::section::offset, llvm::MachO::section_64::offset, llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, llvm::MachO::SECTION_TYPE, llvm::MachO::section::size, llvm::MachO::section_64::size, and llvm::StringRef::size().
| unsigned MachOObjectFile::getSectionType | ( | SectionRef | Sec | ) | const |
Definition at line 1790 of file MachOObjectFile.cpp.
References llvm::object::SectionRef::getRawDataRefImpl(), getSectionFlags(), llvm::MachO::SECTION_TYPE, and llvm::object::ObjectFile::SectionRef.
| MachO::segment_command_64 MachOObjectFile::getSegment64LoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4700 of file MachOObjectFile.cpp.
References getStruct().
Definition at line 2152 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::C, llvm::MachO::load_command::cmd, and load_commands().
Return the raw contents of an entire segment.
Definition at line 2130 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::C, llvm::MachO::load_command::cmd, llvm::ArrayRef< T >::empty(), getSegmentContents(), and load_commands().
Referenced by getSegmentContents().
| MachO::segment_command MachOObjectFile::getSegmentLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4695 of file MachOObjectFile.cpp.
References getStruct().
| MachO::source_version_command MachOObjectFile::getSourceVersionCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4755 of file MachOObjectFile.cpp.
References getStruct().
| StringRef MachOObjectFile::getStringTableData | ( | ) | const |
Definition at line 5322 of file MachOObjectFile.cpp.
References llvm::object::Binary::getData(), getSymtabLoadCommand(), llvm::MachO::symtab_command::stroff, llvm::MachO::symtab_command::strsize, and llvm::StringRef::substr().
Referenced by getIndirectName(), and getSymbolName().
| MachO::sub_client_command MachOObjectFile::getSubClientCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4790 of file MachOObjectFile.cpp.
References getStruct().
| MachO::sub_framework_command MachOObjectFile::getSubFrameworkCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4775 of file MachOObjectFile.cpp.
References getStruct().
| MachO::sub_library_command MachOObjectFile::getSubLibraryCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4785 of file MachOObjectFile.cpp.
References getStruct().
| MachO::sub_umbrella_command MachOObjectFile::getSubUmbrellaCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4780 of file MachOObjectFile.cpp.
References getStruct().
| MachO::nlist_64 MachOObjectFile::getSymbol64TableEntry | ( | DataRefImpl | DRI | ) | const |
Definition at line 4684 of file MachOObjectFile.cpp.
References getStruct(), P, and llvm::object::DataRefImpl::p.
Referenced by checkSymbolTable(), and getNValue().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1825 of file MachOObjectFile.cpp.
References llvm::object::ObjectFile::getSymbolValue().
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 1829 of file MachOObjectFile.cpp.
References llvm::cantFail(), llvm::MachO::GET_COMM_ALIGN(), getSymbolFlags(), getSymbolTableEntryBase(), and llvm::object::BasicSymbolRef::SF_Common.
| symbol_iterator MachOObjectFile::getSymbolByIndex | ( | unsigned | Index | ) | const |
Definition at line 2642 of file MachOObjectFile.cpp.
References getPtr(), getSymtabLoadCommand(), is64Bit(), llvm::MachO::symtab_command::nsyms, llvm::object::DataRefImpl::p, llvm::report_fatal_error(), llvm::object::ObjectFile::SymbolRef, llvm::XCOFF::SymbolTableEntrySize, and llvm::MachO::symtab_command::symoff.
Referenced by symbol_begin().
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 1868 of file MachOObjectFile.cpp.
References getNValue(), getSymbolTableEntryBase(), llvm::MachO::N_ABS, llvm::MachO::N_ARM_THUMB_DEF, llvm::MachO::N_EXT, llvm::MachO::N_INDR, llvm::MachO::N_PEXT, llvm::MachO::N_STAB, llvm::MachO::N_TYPE, llvm::MachO::N_UNDF, llvm::MachO::N_WEAK_DEF, llvm::MachO::N_WEAK_REF, llvm::object::BasicSymbolRef::SF_Absolute, llvm::object::BasicSymbolRef::SF_Common, llvm::object::BasicSymbolRef::SF_Exported, llvm::object::BasicSymbolRef::SF_FormatSpecific, llvm::object::BasicSymbolRef::SF_Global, llvm::object::BasicSymbolRef::SF_Hidden, llvm::object::BasicSymbolRef::SF_Indirect, llvm::object::BasicSymbolRef::SF_None, llvm::object::BasicSymbolRef::SF_Thumb, llvm::object::BasicSymbolRef::SF_Undefined, and llvm::object::BasicSymbolRef::SF_Weak.
Referenced by getSymbolAlignment().
| uint64_t MachOObjectFile::getSymbolIndex | ( | DataRefImpl | Symb | ) | const |
Definition at line 2654 of file MachOObjectFile.cpp.
References getPtr(), getSymtabLoadCommand(), is64Bit(), llvm::object::DataRefImpl::p, llvm::report_fatal_error(), llvm::XCOFF::SymbolTableEntrySize, and llvm::MachO::symtab_command::symoff.
Referenced by getSymbolName(), and getSymbolSection().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1775 of file MachOObjectFile.cpp.
References llvm::object::Binary::getData(), getStringTableData(), getSymbolIndex(), getSymbolTableEntryBase(), and malformedError().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1912 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, getSymbolIndex(), getSymbolTableEntryBase(), malformedError(), section_end(), and llvm::object::ObjectFile::SectionRef.
Referenced by getSymbolType().
Definition at line 1927 of file MachOObjectFile.cpp.
References llvm::object::BasicSymbolRef::getRawDataRefImpl(), getSymbolTableEntryBase(), and llvm::object::ObjectFile::SymbolRef.
| MachO::nlist MachOObjectFile::getSymbolTableEntry | ( | DataRefImpl | DRI | ) | const |
Definition at line 4678 of file MachOObjectFile.cpp.
References getStruct(), P, and llvm::object::DataRefImpl::p.
Referenced by checkSymbolTable(), and getNValue().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1843 of file MachOObjectFile.cpp.
References getSymbolSection(), getSymbolTableEntryBase(), llvm::object::SectionRef::isBSS(), llvm::object::SectionRef::isData(), llvm::MachO::N_SECT, llvm::MachO::N_STAB, llvm::MachO::N_TYPE, llvm::MachO::N_UNDF, section_end(), llvm::object::SymbolRef::ST_Data, llvm::object::SymbolRef::ST_Debug, llvm::object::SymbolRef::ST_Function, llvm::object::SymbolRef::ST_Other, llvm::object::SymbolRef::ST_Unknown, and llvm::Expected< T >::takeError().
| MachO::symtab_command MachOObjectFile::getSymtabLoadCommand | ( | ) | const |
Definition at line 4870 of file MachOObjectFile.cpp.
References llvm::MachO::symtab_command::cmd, llvm::MachO::symtab_command::cmdsize, getStruct(), llvm::MachO::symtab_command::nsyms, llvm::MachO::symtab_command::stroff, llvm::MachO::symtab_command::strsize, and llvm::MachO::symtab_command::symoff.
Referenced by checkSymbolTable(), getRelocationSymbol(), getStringTableData(), getSymbolByIndex(), getSymbolIndex(), symbol_begin(), and symbol_end().
| MachO::thread_command MachOObjectFile::getThreadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4805 of file MachOObjectFile.cpp.
References getStruct().
Definition at line 5314 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), and offsetof.
| MachO::uuid_command MachOObjectFile::getUuidCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4745 of file MachOObjectFile.cpp.
References getStruct().
Definition at line 2890 of file MachOObjectFile.cpp.
Referenced by isValidArch().
| MachO::version_min_command MachOObjectFile::getVersionMinLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4710 of file MachOObjectFile.cpp.
References getStruct().
|
inlinestatic |
Definition at line 777 of file MachO.h.
References llvm::CallingConv::C.
|
inlinestatic |
Definition at line 783 of file MachO.h.
References llvm::CallingConv::C.
|
inlinestatic |
Definition at line 789 of file MachO.h.
References llvm::CallingConv::C.
|
inlinestatic |
Definition at line 824 of file MachO.h.
References llvm::utostr(), and llvm::Version.
|
static |
Definition at line 2449 of file MachOObjectFile.cpp.
References F, llvm::Lib, llvm::StringRef::npos, llvm::StringRef::rfind(), llvm::StringRef::size(), llvm::StringRef::slice(), and llvm::StringRef::substr().
Referenced by getLibraryShortNameByIndex().
|
inline |
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 5327 of file MachOObjectFile.cpp.
References llvm::object::Binary::getMachOType(), and llvm::object::Binary::getType().
Referenced by bindTable(), checkSymbolTable(), getBytesInAddress(), getFileFormatName(), getHeader64(), getNValue(), getRelocation(), getRelocationSymbol(), getSectionAddress(), getSectionAlignment(), getSectionContents(), getSectionSize(), getSymbolByIndex(), getSymbolIndex(), isSectionStripped(), lazyBindTable(), moveSymbolNext(), rebaseTable(), section_rel_end(), symbol_end(), and weakBindTable().
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 2084 of file MachOObjectFile.cpp.
References llvm::consumeError(), llvm::Expected< T >::get(), getSectionName(), and llvm::Expected< T >::takeError().
Definition at line 5436 of file MachOObjectFile.cpp.
References llvm::Triple::aarch64, llvm::Triple::arm, llvm::MachO::ARM64_RELOC_SUBTRACTOR, llvm::MachO::ARM_RELOC_HALF, llvm::MachO::ARM_RELOC_HALF_SECTDIFF, llvm::MachO::ARM_RELOC_LOCAL_SECTDIFF, llvm::MachO::ARM_RELOC_SECTDIFF, llvm::MachO::GENERIC_RELOC_LOCAL_SECTDIFF, llvm::MachO::GENERIC_RELOC_SECTDIFF, llvm::Triple::thumb, llvm::Triple::x86, llvm::Triple::x86_64, and llvm::MachO::X86_64_RELOC_SUBTRACTOR.
|
overridevirtual |
True if this is a relocatable object (.o/.obj).
Implements llvm::object::ObjectFile.
Definition at line 5344 of file MachOObjectFile.cpp.
References llvm::MachO::mach_header::filetype, getHeader(), and llvm::MachO::MH_OBJECT.
| bool MachOObjectFile::isRelocationScattered | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4577 of file MachOObjectFile.cpp.
References llvm::MachO::CPU_TYPE_X86_64, getCPUType(), getPlainRelocationAddress(), and llvm::MachO::R_SCATTERED.
Referenced by extractSections(), getAnyRelocationAddress(), getAnyRelocationLength(), getAnyRelocationPCRel(), getAnyRelocationSection(), getAnyRelocationType(), getRelocationSymbol(), and isRelocScattered().
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 2184 of file MachOObjectFile.cpp.
References getSectionFinalSegmentName(), and getSectionName().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2076 of file MachOObjectFile.cpp.
References getSectionFlags(), llvm::MachO::S_ATTR_PURE_INSTRUCTIONS, llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, and llvm::MachO::SECTION_TYPE.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2059 of file MachOObjectFile.cpp.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2068 of file MachOObjectFile.cpp.
References getSectionFlags(), llvm::MachO::S_ATTR_PURE_INSTRUCTIONS, llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, and llvm::MachO::SECTION_TYPE.
|
overridevirtual |
When dsymutil generates the companion file, it strips all unnecessary sections (e.g.
everything in the _TEXT segment) by omitting their body and setting the offset in their corresponding load command to zero.
While the load command itself is valid, reading the section corresponds to reading the number of bytes specified in the load command, starting from offset 0 (i.e. the Mach-O header at the beginning of the file).
Reimplemented from llvm::object::ObjectFile.
Definition at line 2191 of file MachOObjectFile.cpp.
References getSection(), getSection64(), is64Bit(), and llvm::MachO::section_64::offset.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2063 of file MachOObjectFile.cpp.
References getSectionFlags(), and llvm::MachO::S_ATTR_PURE_INSTRUCTIONS.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2177 of file MachOObjectFile.cpp.
References getSectionFlags(), llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, and llvm::MachO::SECTION_TYPE.
Definition at line 2885 of file MachOObjectFile.cpp.
References getValidArchs(), and llvm::is_contained().
| iterator_range< bind_iterator > MachOObjectFile::lazyBindTable | ( | Error & | Err | ) |
For use iterating over all lazy bind table entries.
Definition at line 4516 of file MachOObjectFile.cpp.
References bindTable(), getDyldInfoLazyBindOpcodes(), is64Bit(), and llvm::object::MachOBindEntry::Lazy.
| iterator_range< MachOObjectFile::load_command_iterator > MachOObjectFile::load_commands | ( | ) | const |
Definition at line 4550 of file MachOObjectFile.cpp.
References begin_load_commands(), end_load_commands(), and llvm::make_range().
Referenced by getSegmentContents(), and getSegmentContents().
| relocation_iterator MachOObjectFile::locrel_begin | ( | ) | const |
Definition at line 2238 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, and llvm::object::ObjectFile::RelocationRef.
| relocation_iterator MachOObjectFile::locrel_end | ( | ) | const |
Definition at line 2246 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, getDysymtabLoadCommand(), and llvm::object::ObjectFile::RelocationRef.
Maps a debug section name to a standard DWARF section name.
Reimplemented from llvm::object::ObjectFile.
Definition at line 5375 of file MachOObjectFile.cpp.
References llvm::StringSwitch< T, R >::Case(), and llvm::StringSwitch< T, R >::Default().
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 5425 of file MachOObjectFile.cpp.
References llvm::StringSwitch< T, R >::Default(), and llvm::binaryformat::unknown.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2255 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::b, and llvm::object::DataRefImpl::d.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1933 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, and llvm::object::DataRefImpl::d.
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 1768 of file MachOObjectFile.cpp.
References is64Bit(), llvm::object::DataRefImpl::p, and llvm::XCOFF::SymbolTableEntrySize.
| void MachOObjectFile::ReadULEB128s | ( | uint64_t | Index, |
| SmallVectorImpl< uint64_t > & | Out ) const |
Definition at line 5332 of file MachOObjectFile.cpp.
References data, llvm::object::Binary::getData(), llvm::DataExtractor::getULEB128(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by getFunctionStarts().
|
inline |
Definition at line 595 of file MachO.h.
References llvm::Count.
| iterator_range< rebase_iterator > MachOObjectFile::rebaseTable | ( | Error & | Err | ) |
For use iterating over all rebase table entries.
Definition at line 3849 of file MachOObjectFile.cpp.
References getDyldInfoRebaseOpcodes(), is64Bit(), and rebaseTable().
Referenced by rebaseTable().
|
static |
For use examining rebase opcodes in a MachOObjectFile.
Definition at line 3836 of file MachOObjectFile.cpp.
References llvm::make_range().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2666 of file MachOObjectFile.cpp.
References llvm::object::ObjectFile::SectionRef.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2671 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and llvm::object::ObjectFile::SectionRef.
Referenced by getAnyRelocationSection(), getSymbolSection(), and getSymbolType().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2197 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, and llvm::object::ObjectFile::RelocationRef.
Referenced by extractSections(), and section_rel_begin().
| relocation_iterator MachOObjectFile::section_rel_begin | ( | unsigned | Index | ) | const |
Definition at line 2923 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and section_rel_begin().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2205 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, getSection(), getSection64(), is64Bit(), llvm::MachO::section::nreloc, llvm::MachO::section_64::nreloc, and llvm::object::ObjectFile::RelocationRef.
Referenced by extractSections(), and section_rel_end().
| relocation_iterator MachOObjectFile::section_rel_end | ( | unsigned | Index | ) | const |
Definition at line 2929 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and section_rel_end().
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 2618 of file MachOObjectFile.cpp.
References getSymbolByIndex(), getSymtabLoadCommand(), llvm::MachO::symtab_command::nsyms, and llvm::object::ObjectFile::SymbolRef.
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 2627 of file MachOObjectFile.cpp.
References getPtr(), getSymtabLoadCommand(), is64Bit(), llvm::MachO::symtab_command::nsyms, llvm::Offset, llvm::object::DataRefImpl::p, llvm::object::ObjectFile::SymbolRef, llvm::XCOFF::SymbolTableEntrySize, and llvm::MachO::symtab_command::symoff.
Referenced by getRelocationSymbol().
| iterator_range< bind_iterator > MachOObjectFile::weakBindTable | ( | Error & | Err | ) |
For use iterating over all weak bind table entries.
Definition at line 4521 of file MachOObjectFile.cpp.
References bindTable(), getDyldInfoWeakBindOpcodes(), is64Bit(), and llvm::object::MachOBindEntry::Weak.
| MachO::mach_header llvm::object::MachOObjectFile::Header |
Definition at line 853 of file MachO.h.
Referenced by getArchTriple(), getChainedFixupsSegments(), getDyldChainedFixupTargets(), and getHeader().
| MachO::mach_header_64 llvm::object::MachOObjectFile::Header64 |
Definition at line 852 of file MachO.h.
Referenced by getHeader64().