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 2900 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 4505 of file MachOObjectFile.cpp.
Referenced by load_commands().
|
inline |
Definition at line 583 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 4476 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 4462 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 2910 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 4510 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 3241 of file MachOObjectFile.cpp.
References exports(), getDyldExportsTrie(), and getDyldInfoExportsTrie().
Referenced by exports(), and readSymbols().
|
static |
For use examining a trie not in a MachOObjectFile.
Definition at line 3227 of file MachOObjectFile.cpp.
References llvm::ArrayRef< T >::empty(), and llvm::make_range().
|
inline |
Definition at line 484 of file MachO.h.
References extrel_begin(), extrel_end(), and llvm::make_range().
relocation_iterator MachOObjectFile::extrel_begin | ( | ) | const |
Definition at line 2199 of file MachOObjectFile.cpp.
References llvm::object::ObjectFile::RelocationRef.
Referenced by external_relocations().
relocation_iterator MachOObjectFile::extrel_end | ( | ) | const |
Definition at line 2207 of file MachOObjectFile.cpp.
References 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 5347 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 4491 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 4578 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 4592 of file MachOObjectFile.cpp.
References getPlainRelocationLength(), getScatteredRelocationLength(), and isRelocationScattered().
Referenced by llvm::RuntimeDyldMachO::getRelocationEntry(), getRelocationLength(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
unsigned MachOObjectFile::getAnyRelocationPCRel | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4585 of file MachOObjectFile.cpp.
References getPlainRelocationPCRel(), getScatteredRelocationPCRel(), and isRelocationScattered().
Referenced by llvm::RuntimeDyldMachO::getRelocationEntry(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
SectionRef MachOObjectFile::getAnyRelocationSection | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4608 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(), and llvm::RuntimeDyldMachO::getRelocationValueRef().
unsigned MachOObjectFile::getAnyRelocationType | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4600 of file MachOObjectFile.cpp.
References getPlainRelocationType(), getScatteredRelocationType(), and isRelocationScattered().
Referenced by extractSections(), llvm::RuntimeDyldMachO::getRelocationEntry(), getRelocationType(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), llvm::RuntimeDyldMachOI386::processRelocationRef(), llvm::RuntimeDyldMachOX86_64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2880 of file MachOObjectFile.cpp.
References getArch(), getCPUSubType(), and getCPUType().
Referenced by llvm::orc::checkMachORelocatableObject(), getArch(), and getRelocationTypeName().
|
static |
Definition at line 2688 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_X86_64, llvm::Triple::ppc, llvm::Triple::ppc64, llvm::Triple::UnknownArch, llvm::Triple::x86, and llvm::Triple::x86_64.
Definition at line 2884 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 2709 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_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, and llvm::MachO::CPU_TYPE_X86_64.
|
inlinestatic |
Definition at line 796 of file MachO.h.
References llvm::format_hex().
|
inlinestatic |
Definition at line 811 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 4690 of file MachOObjectFile.cpp.
References getStruct().
MachO::build_version_command MachOObjectFile::getBuildVersionLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4685 of file MachOObjectFile.cpp.
References getStruct().
Referenced by constructTriples().
|
overridevirtual |
The number of bytes used to represent an address in this object file format.
Implements llvm::object::ObjectFile.
Definition at line 2655 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 4998 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 4979 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 5049 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 4880 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 4829 of file MachOObjectFile.cpp.
References getPtr(), getStruct(), and llvm::Offset.
MachO::data_in_code_entry MachOObjectFile::getDice | ( | DataRefImpl | Rel | ) | const |
Definition at line 4807 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 5158 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 5250 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, getPtr(), getStructOrErr(), and Ptr.
Referenced by exports().
Definition at line 4922 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), llvm::MachO::dyld_info_command::bind_off, llvm::MachO::dyld_info_command::bind_size, getPtr(), getStructOrErr(), and Ptr.
Referenced by bindTable().
Definition at line 4964 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), llvm::MachO::dyld_info_command::export_off, llvm::MachO::dyld_info_command::export_size, getPtr(), getStructOrErr(), and Ptr.
Referenced by exports().
Definition at line 4950 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), getPtr(), getStructOrErr(), llvm::MachO::dyld_info_command::lazy_bind_off, llvm::MachO::dyld_info_command::lazy_bind_size, and Ptr.
Referenced by lazyBindTable().
MachO::dyld_info_command MachOObjectFile::getDyldInfoLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4700 of file MachOObjectFile.cpp.
References getStruct().
Definition at line 4908 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), getPtr(), getStructOrErr(), Ptr, llvm::MachO::dyld_info_command::rebase_off, and llvm::MachO::dyld_info_command::rebase_size.
Referenced by rebaseTable().
Definition at line 4936 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), getPtr(), getStructOrErr(), Ptr, 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 4695 of file MachOObjectFile.cpp.
References getStruct().
Referenced by readMachOHeader().
MachO::dylinker_command MachOObjectFile::getDylinkerCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4705 of file MachOObjectFile.cpp.
References getStruct().
MachO::dysymtab_command MachOObjectFile::getDysymtabLoadCommand | ( | ) | const |
Definition at line 4850 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(), locrel_end(), and llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection().
MachO::encryption_info_command MachOObjectFile::getEncryptionInfoCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4730 of file MachOObjectFile.cpp.
References getStruct().
MachO::encryption_info_command_64 MachOObjectFile::getEncryptionInfoCommand64 | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4735 of file MachOObjectFile.cpp.
References getStruct().
MachO::entry_point_command MachOObjectFile::getEntryPointCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4725 of file MachOObjectFile.cpp.
References getStruct().
|
inlineoverridevirtual |
Implements llvm::object::ObjectFile.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2659 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_X86_64, getCPUType(), and is64Bit().
MachO::fileset_entry_command MachOObjectFile::getFilesetEntryLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4775 of file MachOObjectFile.cpp.
References getStruct().
SmallVector< uint64_t > MachOObjectFile::getFunctionStarts | ( | ) | const |
Definition at line 5264 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, getStructOrErr(), and ReadULEB128s().
const MachO::mach_header & MachOObjectFile::getHeader | ( | ) | const |
Definition at line 4812 of file MachOObjectFile.cpp.
References Header.
Referenced by checkDylibIdCommand(), checkSymbolTable(), extractSections(), getFirstLoadCommandInfo(), getNextLoadCommandInfo(), getRelocation(), getRelocationOffset(), isRelocatableObject(), parseSegmentLoadCommand(), and readMachOHeader().
const MachO::mach_header_64 & MachOObjectFile::getHeader64 | ( | ) | const |
Definition at line 4816 of file MachOObjectFile.cpp.
References assert(), Header64, and is64Bit().
Referenced by checkSymbolTable().
|
static |
Definition at line 2846 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 4821 of file MachOObjectFile.cpp.
References getPtr(), getStruct(), and llvm::Offset.
Referenced by llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection().
uint32_t MachOObjectFile::getLibraryCount | ( | ) | const |
Definition at line 2585 of file MachOObjectFile.cpp.
std::error_code MachOObjectFile::getLibraryShortNameByIndex | ( | unsigned | Index, |
StringRef & | Res ) const |
Definition at line 2551 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 4655 of file MachOObjectFile.cpp.
References getStruct().
Referenced by readMachOHeader().
MachO::linker_option_command MachOObjectFile::getLinkerOptionLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4670 of file MachOObjectFile.cpp.
References getStruct().
MachO::linkedit_data_command MachOObjectFile::getLinkOptHintsLoadCommand | ( | ) | const |
Definition at line 4894 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 |
Definition at line 772 of file MachO.h.
Referenced by getFirstLoadCommandInfo(), getNextLoadCommandInfo(), and parseHeader().
MachO::note_command MachOObjectFile::getNoteLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4680 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 4556 of file MachOObjectFile.cpp.
References llvm::object::Binary::isLittleEndian(), and llvm::MachO::any_relocation_info::r_word1.
Referenced by extractSections(), getAnyRelocationSection(), getRelocationSymbol(), llvm::RuntimeDyldMachO::getRelocationValueRef(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), and llvm::RuntimeDyldMachOX86_64::processRelocationRef().
unsigned MachOObjectFile::getPlainRelocationSymbolNum | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4549 of file MachOObjectFile.cpp.
References llvm::object::Binary::isLittleEndian(), and llvm::MachO::any_relocation_info::r_word1.
Referenced by getAnyRelocationSection(), getRelocationSymbol(), and llvm::RuntimeDyldMachOAArch64::processRelocationRef().
MachO::any_relocation_info MachOObjectFile::getRelocation | ( | DataRefImpl | Rel | ) | const |
Definition at line 4780 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::RuntimeDyldMachO::getRelocationEntry(), llvm::jitlink::MachOLinkGraphBuilder::getRelocationInfo(), getRelocationLength(), getRelocationOffset(), getRelocationSection(), getRelocationSymbol(), getRelocationType(), llvm::RuntimeDyldMachO::getRelocationValueRef(), isRelocScattered(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), llvm::RuntimeDyldMachOI386::processRelocationRef(), llvm::RuntimeDyldMachOX86_64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
uint8_t MachOObjectFile::getRelocationLength | ( | DataRefImpl | Rel | ) | const |
Definition at line 2386 of file MachOObjectFile.cpp.
References getAnyRelocationLength(), and getRelocation().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2237 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 2590 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 2267 of file MachOObjectFile.cpp.
References getAnyRelocationSection(), and getRelocation().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2246 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 2271 of file MachOObjectFile.cpp.
References getAnyRelocationType(), and getRelocation().
Referenced by getRelocationTypeName().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2276 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 4760 of file MachOObjectFile.cpp.
References getStruct().
MachO::routines_command_64 MachOObjectFile::getRoutinesCommand64 | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4765 of file MachOObjectFile.cpp.
References getStruct().
MachO::rpath_command MachOObjectFile::getRpathCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4715 of file MachOObjectFile.cpp.
References getStruct().
Referenced by readMachOHeader().
bool MachOObjectFile::getScatteredRelocationScattered | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4563 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 4573 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 4568 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word1.
Referenced by llvm::RuntimeDyldMachO::processScatteredVANILLA().
MachO::section MachOObjectFile::getSection | ( | const LoadCommandInfo & | L, |
unsigned | Index ) const |
Definition at line 4630 of file MachOObjectFile.cpp.
References getSectionPtr(), and getStruct().
MachO::section MachOObjectFile::getSection | ( | DataRefImpl | DRI | ) | const |
Definition at line 4620 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 2026 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 2017 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(), llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection(), and section_rel_end().
MachO::section_64 MachOObjectFile::getSection64 | ( | const LoadCommandInfo & | L, |
unsigned | Index ) const |
Definition at line 4636 of file MachOObjectFile.cpp.
References getSectionPtr(), and getStruct().
MachO::section_64 MachOObjectFile::getSection64 | ( | DataRefImpl | DRI | ) | const |
Definition at line 4625 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 2004 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 getSection(), getSection64(), getSectionContents(), is64Bit(), 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 4520 of file MachOObjectFile.cpp.
References llvm::ArrayRef< T >::data(), getSectionRawFinalSegmentName(), and parseSegmentOrSectionName().
Referenced by llvm::object::BindRebaseSegInfo::BindRebaseSegInfo(), llvm::orc::getMachOObjectFileSymbolInfo(), and isSectionBitcode().
unsigned MachOObjectFile::getSectionID | ( | SectionRef | Sec | ) | const |
Definition at line 2151 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 llvm::orc::getMachOObjectFileSymbolInfo(), isDebugSection(), and isSectionBitcode().
ArrayRef< char > MachOObjectFile::getSectionRawFinalSegmentName | ( | DataRefImpl | Sec | ) | const |
Definition at line 4534 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 4526 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.
Referenced by llvm::orc::getMachOObjectFileSymbolInfo().
MachO::segment_command_64 MachOObjectFile::getSegment64LoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4665 of file MachOObjectFile.cpp.
References getStruct().
Definition at line 2130 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 2108 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 4660 of file MachOObjectFile.cpp.
References getStruct().
MachO::source_version_command MachOObjectFile::getSourceVersionCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4720 of file MachOObjectFile.cpp.
References getStruct().
StringRef MachOObjectFile::getStringTableData | ( | ) | const |
Definition at line 5287 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 4755 of file MachOObjectFile.cpp.
References getStruct().
Referenced by readMachOHeader().
MachO::sub_framework_command MachOObjectFile::getSubFrameworkCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4740 of file MachOObjectFile.cpp.
References getStruct().
Referenced by readMachOHeader().
MachO::sub_library_command MachOObjectFile::getSubLibraryCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4750 of file MachOObjectFile.cpp.
References getStruct().
MachO::sub_umbrella_command MachOObjectFile::getSubUmbrellaCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4745 of file MachOObjectFile.cpp.
References getStruct().
MachO::nlist_64 MachOObjectFile::getSymbol64TableEntry | ( | DataRefImpl | DRI | ) | const |
Definition at line 4649 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 2620 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 llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection(), and 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 2632 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 4643 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 4835 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 4770 of file MachOObjectFile.cpp.
References getStruct().
Definition at line 5279 of file MachOObjectFile.cpp.
References llvm::ArrayRef(), offsetof, and Ptr.
MachO::uuid_command MachOObjectFile::getUuidCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4710 of file MachOObjectFile.cpp.
References getStruct().
Referenced by readMachOHeader().
Definition at line 2855 of file MachOObjectFile.cpp.
Referenced by isValidArch().
MachO::version_min_command MachOObjectFile::getVersionMinLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4675 of file MachOObjectFile.cpp.
References getStruct().
Referenced by constructTriples().
|
inlinestatic |
Definition at line 779 of file MachO.h.
References llvm::CallingConv::C.
|
inlinestatic |
Definition at line 785 of file MachO.h.
References llvm::CallingConv::C.
|
inlinestatic |
Definition at line 791 of file MachO.h.
References llvm::CallingConv::C.
|
inlinestatic |
Definition at line 826 of file MachO.h.
References llvm::utostr(), and llvm::Version.
|
static |
Definition at line 2427 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 |
Definition at line 770 of file MachO.h.
Referenced by llvm::object::BindRebaseSegInfo::BindRebaseSegInfo().
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 5292 of file MachOObjectFile.cpp.
References llvm::object::Binary::getMachOType(), and llvm::object::Binary::getType().
Referenced by bindTable(), checkDysymtabCommand(), checkSymbolTable(), checkSymtabCommand(), getBytesInAddress(), getFileFormatName(), getFirstLoadCommandInfo(), getHeader64(), getNextLoadCommandInfo(), getNValue(), getRelocation(), getRelocationSymbol(), getSectionAddress(), getSectionAlignment(), getSectionContents(), getSectionSize(), getSymbolByIndex(), getSymbolIndex(), isSectionStripped(), lazyBindTable(), moveSymbolNext(), llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection(), rebaseTable(), section_rel_end(), symbol_end(), and weakBindTable().
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 2062 of file MachOObjectFile.cpp.
References llvm::consumeError(), llvm::Expected< T >::get(), getSectionName(), and llvm::Expected< T >::takeError().
Definition at line 5401 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 5309 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 4542 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(), isRelocScattered(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), llvm::RuntimeDyldMachOI386::processRelocationRef(), and llvm::RuntimeDyldMachOX86_64::processRelocationRef().
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 2162 of file MachOObjectFile.cpp.
References getSectionFinalSegmentName(), and getSectionName().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2054 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 2037 of file MachOObjectFile.cpp.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2046 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 2169 of file MachOObjectFile.cpp.
References getSection(), getSection64(), is64Bit(), and llvm::MachO::section_64::offset.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2041 of file MachOObjectFile.cpp.
References getSectionFlags(), and llvm::MachO::S_ATTR_PURE_INSTRUCTIONS.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2155 of file MachOObjectFile.cpp.
References getSectionFlags(), llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, and llvm::MachO::SECTION_TYPE.
Definition at line 2850 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 4481 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 4515 of file MachOObjectFile.cpp.
References begin_load_commands(), end_load_commands(), and llvm::make_range().
Referenced by constructTriples(), getSegmentContents(), getSegmentContents(), and readMachOHeader().
relocation_iterator MachOObjectFile::locrel_begin | ( | ) | const |
Definition at line 2216 of file MachOObjectFile.cpp.
References llvm::object::ObjectFile::RelocationRef.
relocation_iterator MachOObjectFile::locrel_end | ( | ) | const |
Definition at line 2224 of file MachOObjectFile.cpp.
References 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 5340 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 5390 of file MachOObjectFile.cpp.
References llvm::StringSwitch< T, R >::Default(), and llvm::binaryformat::unknown.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2233 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 5297 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 597 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 3814 of file MachOObjectFile.cpp.
References getDyldInfoRebaseOpcodes(), is64Bit(), and rebaseTable().
Referenced by rebaseTable().
|
static |
For use examining rebase opcodes in a MachOObjectFile.
Definition at line 3801 of file MachOObjectFile.cpp.
References llvm::make_range().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2644 of file MachOObjectFile.cpp.
References llvm::object::ObjectFile::SectionRef.
Referenced by llvm::RuntimeDyldMachO::getSectionByAddress().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2649 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and llvm::object::ObjectFile::SectionRef.
Referenced by getAnyRelocationSection(), llvm::RuntimeDyldMachO::getSectionByAddress(), getSymbolSection(), getSymbolType(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2175 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, 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 2888 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 2183 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, 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 2894 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 2596 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 2605 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 4486 of file MachOObjectFile.cpp.
References bindTable(), getDyldInfoWeakBindOpcodes(), is64Bit(), and llvm::object::MachOBindEntry::Weak.
MachO::mach_header llvm::object::MachOObjectFile::Header |
Definition at line 855 of file MachO.h.
Referenced by getArchTriple(), getChainedFixupsSegments(), getDyldChainedFixupTargets(), and getHeader().
MachO::mach_header_64 llvm::object::MachOObjectFile::Header64 |
Definition at line 854 of file MachO.h.
Referenced by getHeader64().