LLVM: llvm::object::MachOObjectFile Class Reference (original) (raw)

#include "[llvm/Object/MachO.h](Object%5F2MachO%5F8h%5Fsource.html)"

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>
Public Member Functions
void moveSymbolNext (DataRefImpl &Symb) const override
uint64_t getNValue (DataRefImpl Sym) const
Expected< StringRef > getSymbolName (DataRefImpl Symb) const override
Error checkSymbolTable () const
std::error_code getIndirectName (DataRefImpl Symb, StringRef &Res) const
unsigned getSectionType (SectionRef Sec) const
Expected< uint64_t > getSymbolAddress (DataRefImpl Symb) const override
uint32_t getSymbolAlignment (DataRefImpl Symb) const override
uint64_t getCommonSymbolSizeImpl (DataRefImpl Symb) const override
Expected< SymbolRef::Type > getSymbolType (DataRefImpl Symb) const override
Expected< uint32_t > getSymbolFlags (DataRefImpl Symb) const override
Expected< section_iterator > getSymbolSection (DataRefImpl Symb) const override
unsigned getSymbolSectionID (SymbolRef Symb) const
unsigned getSectionID (SectionRef Sec) const
void moveSectionNext (DataRefImpl &Sec) const override
Expected< StringRef > getSectionName (DataRefImpl Sec) const override
uint64_t getSectionAddress (DataRefImpl Sec) const override
uint64_t getSectionIndex (DataRefImpl Sec) const override
uint64_t getSectionSize (DataRefImpl Sec) const override
ArrayRef< uint8_t > getSectionContents (uint64_t Offset, uint64_t Size) const
Expected< ArrayRef< uint8_t > > getSectionContents (DataRefImpl Sec) const override
uint64_t getSectionAlignment (DataRefImpl Sec) const override
Expected< SectionRef > getSection (unsigned SectionIndex) const
Expected< SectionRef > getSection (StringRef SectionName) const
bool isSectionCompressed (DataRefImpl Sec) const override
bool isSectionText (DataRefImpl Sec) const override
bool isSectionData (DataRefImpl Sec) const override
bool isSectionBSS (DataRefImpl Sec) const override
bool isSectionVirtual (DataRefImpl Sec) const override
bool isSectionBitcode (DataRefImpl Sec) const override
bool isDebugSection (DataRefImpl Sec) const override
ArrayRef< uint8_t > getSegmentContents (StringRef SegmentName) const
Return the raw contents of an entire segment.
ArrayRef< uint8_t > getSegmentContents (size_t SegmentIndex) const
bool isSectionStripped (DataRefImpl Sec) const override
When dsymutil generates the companion file, it strips all unnecessary sections (e.g.
relocation_iterator section_rel_begin (DataRefImpl Sec) const override
relocation_iterator section_rel_end (DataRefImpl Sec) const override
relocation_iterator extrel_begin () const
relocation_iterator extrel_end () const
iterator_range< relocation_iterator > external_relocations () const
relocation_iterator locrel_begin () const
relocation_iterator locrel_end () const
void moveRelocationNext (DataRefImpl &Rel) const override
uint64_t getRelocationOffset (DataRefImpl Rel) const override
symbol_iterator getRelocationSymbol (DataRefImpl Rel) const override
section_iterator getRelocationSection (DataRefImpl Rel) const
uint64_t getRelocationType (DataRefImpl Rel) const override
void getRelocationTypeName (DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
uint8_t getRelocationLength (DataRefImpl Rel) const
std::error_code getLibraryShortNameByIndex (unsigned Index, StringRef &) const
uint32_t getLibraryCount () const
section_iterator getRelocationRelocatedSection (relocation_iterator Rel) const
basic_symbol_iterator symbol_begin () const override
basic_symbol_iterator symbol_end () const override
bool is64Bit () const override
symbol_iterator getSymbolByIndex (unsigned Index) const
uint64_t getSymbolIndex (DataRefImpl Symb) const
section_iterator section_begin () const override
section_iterator section_end () const override
uint8_t getBytesInAddress () const override
The number of bytes used to represent an address in this object file format.
StringRef getFileFormatName () const override
Triple::ArchType getArch () const override
Expected< SubtargetFeatures > getFeatures () const override
Triple getArchTriple (const char **McpuDefault=nullptr) const
relocation_iterator section_rel_begin (unsigned Index) const
relocation_iterator section_rel_end (unsigned Index) const
dice_iterator begin_dices () const
dice_iterator end_dices () const
load_command_iterator begin_load_commands () const
load_command_iterator end_load_commands () const
iterator_range< load_command_iterator > load_commands () const
iterator_range< export_iterator > exports (Error &Err) const
For use iterating over all exported symbols.
iterator_range< rebase_iterator > rebaseTable (Error &Err)
For use iterating over all rebase table entries.
iterator_range< bind_iterator > bindTable (Error &Err)
For use iterating over all bind table entries.
iterator_range< fixup_iterator > fixupTable (Error &Err)
For iterating over all chained fixups.
iterator_range< bind_iterator > lazyBindTable (Error &Err)
For use iterating over all lazy bind table entries.
iterator_range< bind_iterator > weakBindTable (Error &Err)
For use iterating over all weak bind table entries.
const char * BindEntryCheckSegAndOffsets (int32_t SegIndex, uint64_t SegOffset, uint8_t PointerSize, uint64_t Count=1, uint64_t Skip=0) const
const char * RebaseEntryCheckSegAndOffsets (int32_t SegIndex, uint64_t SegOffset, uint8_t PointerSize, uint64_t Count=1, uint64_t Skip=0) const
StringRef BindRebaseSegmentName (int32_t SegIndex) const
For use with the SegIndex of a checked Mach-O Bind or Rebase entry to get the segment name.
StringRef BindRebaseSectionName (uint32_t SegIndex, uint64_t SegOffset) const
For use with a SegIndex,SegOffset pair from a checked Mach-O Bind or Rebase entry to get the section name.
uint64_t BindRebaseAddress (uint32_t SegIndex, uint64_t SegOffset) const
For use with a SegIndex,SegOffset pair from a checked Mach-O Bind or Rebase entry to get the address.
StringRef getSectionFinalSegmentName (DataRefImpl Sec) const
ArrayRef< char > getSectionRawName (DataRefImpl Sec) const
ArrayRef< char > getSectionRawFinalSegmentName (DataRefImpl Sec) const
bool isRelocationScattered (const MachO::any_relocation_info &RE) const
unsigned getPlainRelocationSymbolNum (const MachO::any_relocation_info &RE) const
bool getPlainRelocationExternal (const MachO::any_relocation_info &RE) const
bool getScatteredRelocationScattered (const MachO::any_relocation_info &RE) const
uint32_t getScatteredRelocationValue (const MachO::any_relocation_info &RE) const
uint32_t getScatteredRelocationType (const MachO::any_relocation_info &RE) const
unsigned getAnyRelocationAddress (const MachO::any_relocation_info &RE) const
unsigned getAnyRelocationPCRel (const MachO::any_relocation_info &RE) const
unsigned getAnyRelocationLength (const MachO::any_relocation_info &RE) const
unsigned getAnyRelocationType (const MachO::any_relocation_info &RE) const
SectionRef getAnyRelocationSection (const MachO::any_relocation_info &RE) const
MachO::section getSection (DataRefImpl DRI) const
MachO::section_64 getSection64 (DataRefImpl DRI) const
MachO::section getSection (const LoadCommandInfo &L, unsigned Index) const
MachO::section_64 getSection64 (const LoadCommandInfo &L, unsigned Index) const
MachO::nlist getSymbolTableEntry (DataRefImpl DRI) const
MachO::nlist_64 getSymbol64TableEntry (DataRefImpl DRI) const
MachO::linkedit_data_command getLinkeditDataLoadCommand (const LoadCommandInfo &L) const
MachO::segment_command getSegmentLoadCommand (const LoadCommandInfo &L) const
MachO::segment_command_64 getSegment64LoadCommand (const LoadCommandInfo &L) const
MachO::linker_option_command getLinkerOptionLoadCommand (const LoadCommandInfo &L) const
MachO::version_min_command getVersionMinLoadCommand (const LoadCommandInfo &L) const
MachO::note_command getNoteLoadCommand (const LoadCommandInfo &L) const
MachO::build_version_command getBuildVersionLoadCommand (const LoadCommandInfo &L) const
MachO::build_tool_version getBuildToolVersion (unsigned index) const
MachO::dylib_command getDylibIDLoadCommand (const LoadCommandInfo &L) const
MachO::dyld_info_command getDyldInfoLoadCommand (const LoadCommandInfo &L) const
MachO::dylinker_command getDylinkerCommand (const LoadCommandInfo &L) const
MachO::uuid_command getUuidCommand (const LoadCommandInfo &L) const
MachO::rpath_command getRpathCommand (const LoadCommandInfo &L) const
MachO::source_version_command getSourceVersionCommand (const LoadCommandInfo &L) const
MachO::entry_point_command getEntryPointCommand (const LoadCommandInfo &L) const
MachO::encryption_info_command getEncryptionInfoCommand (const LoadCommandInfo &L) const
MachO::encryption_info_command_64 getEncryptionInfoCommand64 (const LoadCommandInfo &L) const
MachO::sub_framework_command getSubFrameworkCommand (const LoadCommandInfo &L) const
MachO::sub_umbrella_command getSubUmbrellaCommand (const LoadCommandInfo &L) const
MachO::sub_library_command getSubLibraryCommand (const LoadCommandInfo &L) const
MachO::sub_client_command getSubClientCommand (const LoadCommandInfo &L) const
MachO::routines_command getRoutinesCommand (const LoadCommandInfo &L) const
MachO::routines_command_64 getRoutinesCommand64 (const LoadCommandInfo &L) const
MachO::thread_command getThreadCommand (const LoadCommandInfo &L) const
MachO::fileset_entry_command getFilesetEntryLoadCommand (const LoadCommandInfo &L) const
MachO::any_relocation_info getRelocation (DataRefImpl Rel) const
MachO::data_in_code_entry getDice (DataRefImpl Rel) const
const MachO::mach_header & getHeader () const
const MachO::mach_header_64 & getHeader64 () const
uint32_t getIndirectSymbolTableEntry (const MachO::dysymtab_command &DLC, unsigned Index) const
MachO::data_in_code_entry getDataInCodeTableEntry (uint32_t DataOffset, unsigned Index) const
MachO::symtab_command getSymtabLoadCommand () const
MachO::dysymtab_command getDysymtabLoadCommand () const
MachO::linkedit_data_command getDataInCodeLoadCommand () const
MachO::linkedit_data_command getLinkOptHintsLoadCommand () const
ArrayRef< uint8_t > getDyldInfoRebaseOpcodes () const
ArrayRef< uint8_t > getDyldInfoBindOpcodes () const
ArrayRef< uint8_t > getDyldInfoWeakBindOpcodes () const
ArrayRef< uint8_t > getDyldInfoLazyBindOpcodes () const
ArrayRef< uint8_t > getDyldInfoExportsTrie () const
Expected< std::optional< MachO::dyld_chained_fixups_header > > getChainedFixupsHeader () const
If the optional is std::nullopt, no header was found, but the object was well-formed.
Expected< std::vector< ChainedFixupTarget > > getDyldChainedFixupTargets () const
Expected< std::optional< MachO::linkedit_data_command > > getChainedFixupsLoadCommand () const
Expected< std::pair< size_t, std::vector< ChainedFixupsSegment > > > getChainedFixupsSegments () const
ArrayRef< uint8_t > getDyldExportsTrie () const
SmallVector< uint64_t > getFunctionStarts () const
ArrayRef< uint8_t > getUuid () const
StringRef getStringTableData () const
void ReadULEB128s (uint64_t Index, SmallVectorImpl< uint64_t > &Out) const
bool isRelocatableObject () const override
True if this is a relocatable object (.o/.obj).
StringRef mapDebugSectionName (StringRef Name) const override
Maps a debug section name to a standard DWARF section name.
llvm::binaryformat::Swift5ReflectionSectionKind mapReflectionSectionNameToEnumValue (StringRef SectionName) const override
bool hasPageZeroSegment () const
size_t getMachOFilesetEntryOffset () const
Public Member Functions inherited from llvm::object::ObjectFile
ObjectFile ()=delete
ObjectFile (const ObjectFile &other)=delete
ObjectFile & operator= (const ObjectFile &other)=delete
uint64_t getCommonSymbolSize (DataRefImpl Symb) const
virtual std::vector< SectionRef > dynamic_relocation_sections () const
symbol_iterator_range symbols () const
section_iterator_range sections () const
virtual bool hasDebugInfo () const
virtual Triple::OSType getOS () const
virtual std::optional< StringRef > tryGetCPUName () const
virtual void setARMSubArch (Triple &TheTriple) const
virtual Expected< uint64_t > getStartAddress () const
Triple makeTriple () const
Create a triple from the data in this object file.
bool isReflectionSectionStrippable (llvm::binaryformat::Swift5ReflectionSectionKind ReflectionSectionKind) const
True if the reflection section can be stripped by the linker.
Public Member Functions inherited from llvm::object::SymbolicFile
SymbolicFile (unsigned int Type, MemoryBufferRef Source)
~SymbolicFile () override
basic_symbol_iterator_range symbols () const
Public Member Functions inherited from llvm::object::Binary
Binary ()=delete
Binary (const Binary &other)=delete
virtual ~Binary ()
virtual Error initContent ()
StringRef getData () const
StringRef getFileName () const
MemoryBufferRef getMemoryBufferRef () const
unsigned int getType () const
bool isObject () const
bool isSymbolic () const
bool isArchive () const
bool isMachOUniversalBinary () const
bool isTapiUniversal () const
bool isELF () const
bool isMachO () const
bool isCOFF () const
bool isXCOFF () const
bool isWasm () const
bool isOffloadFile () const
bool isCOFFImportFile () const
bool isIR () const
bool isGOFF () const
bool isMinidump () const
bool isTapiFile () const
bool isLittleEndian () const
bool isWinRes () const
bool isDXContainer () const
Triple::ObjectFormatType getTripleObjectFormat () const
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)
Additional Inherited Members
Protected Types inherited from llvm::object::Binary
enum { ID_Archive, ID_MachOUniversalBinary, ID_COFFImportFile, ID_IR, ID_TapiUniversal, ID_TapiFile, ID_Minidump, ID_WinRes, ID_Offload, ID_StartObjects, ID_COFF, ID_XCOFF32, ID_XCOFF64, ID_ELF32L, ID_ELF32B, ID_ELF64L, ID_ELF64B, ID_MachO32L, ID_MachO32B, ID_MachO64L, ID_MachO64B, ID_GOFF, ID_Wasm, ID_DXContainer, ID_EndObjects }
Protected Member Functions inherited from llvm::object::ObjectFile
ObjectFile (unsigned int Type, MemoryBufferRef Source)
const uint8_t * base () const
Error printSymbolName (raw_ostream &OS, DataRefImpl Symb) const override
virtual bool isBerkeleyText (DataRefImpl Sec) const
virtual bool isBerkeleyData (DataRefImpl Sec) const
virtual Expected< section_iterator > getRelocatedSection (DataRefImpl Sec) const
Expected< uint64_t > getSymbolValue (DataRefImpl Symb) const
Protected Member Functions inherited from llvm::object::Binary
Binary (unsigned int Type, MemoryBufferRef Source)
Static Protected Member Functions inherited from llvm::object::Binary
static unsigned int getELFType (bool isLE, bool is64Bits)
static unsigned int getMachOType (bool isLE, bool is64Bits)
Protected Attributes inherited from llvm::object::Binary
MemoryBufferRef Data

Definition at line 409 of file MachO.h.

load_command_iterator

LoadCommandList

begin_dices()

begin_load_commands()

MachOObjectFile::load_command_iterator MachOObjectFile::begin_load_commands ( ) const

BindEntryCheckSegAndOffsets()

BindRebaseAddress()

For use with a SegIndex,SegOffset pair from a checked Mach-O Bind or Rebase entry to get the address.

Definition at line 618 of file MachO.h.

BindRebaseSectionName()

For use with a SegIndex,SegOffset pair from a checked Mach-O Bind or Rebase entry to get the section name.

Definition at line 612 of file MachO.h.

BindRebaseSegmentName()

StringRef llvm::object::MachOObjectFile::BindRebaseSegmentName ( int32_t SegIndex) const inline

For use with the SegIndex of a checked Mach-O Bind or Rebase entry to get the segment name.

Definition at line 606 of file MachO.h.

bindTable() [1/2]

bindTable() [2/2]

checkSymbolTable()

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().

classof()

bool llvm::object::MachOObjectFile::classof ( const Binary * v) inlinestatic

create()

end_dices()

end_load_commands()

MachOObjectFile::load_command_iterator MachOObjectFile::end_load_commands ( ) const

exports() [1/2]

exports() [2/2]

external_relocations()

extrel_begin()

extrel_end()

findDsymObjectMembers()

Expected< std::vector< std::string > > MachOObjectFile::findDsymObjectMembers ( StringRef Path) 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 5369 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().

fixupTable()

getAnyRelocationAddress()

getAnyRelocationLength()

getAnyRelocationPCRel()

getAnyRelocationSection()

getAnyRelocationType()

getArch() [1/2]

getArch() [2/2]

Definition at line 2710 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.

getArchTriple() [1/2]

Triple MachOObjectFile::getArchTriple ( const char ** McpuDefault = nullptr ) const

getArchTriple() [2/2]

Definition at line 2731 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.

getBuildPlatform()

std::string llvm::object::MachOObjectFile::getBuildPlatform ( uint32_t platform) inlinestatic

getBuildTool()

std::string llvm::object::MachOObjectFile::getBuildTool ( uint32_t tools) inlinestatic

getBuildToolVersion()

getBuildVersionLoadCommand()

getBytesInAddress()

uint8_t MachOObjectFile::getBytesInAddress ( ) const overridevirtual

getChainedFixupsHeader()

If the optional is std::nullopt, no header was found, but the object was well-formed.

Definition at line 5020 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().

getChainedFixupsLoadCommand()

getChainedFixupsSegments()

Definition at line 5071 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().

getCommonSymbolSizeImpl()

getDataInCodeLoadCommand()

getDataInCodeTableEntry()

getDice()

getDyldChainedFixupTargets()

Definition at line 5180 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().

getDyldExportsTrie()

getDyldInfoBindOpcodes()

getDyldInfoExportsTrie()

getDyldInfoLazyBindOpcodes()

getDyldInfoLoadCommand()

getDyldInfoRebaseOpcodes()

getDyldInfoWeakBindOpcodes()

getDylibIDLoadCommand()

getDylinkerCommand()

getDysymtabLoadCommand()

Definition at line 4872 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().

getEncryptionInfoCommand()

getEncryptionInfoCommand64()

getEntryPointCommand()

getFeatures()

getFileFormatName()

StringRef MachOObjectFile::getFileFormatName ( ) const overridevirtual

getFilesetEntryLoadCommand()

getFunctionStarts()

getHeader()

getHeader64()

getHostArch()

Triple MachOObjectFile::getHostArch ( ) static

getIndirectName()

getIndirectSymbolTableEntry()

getLibraryCount()

uint32_t MachOObjectFile::getLibraryCount ( ) const

getLibraryShortNameByIndex()

std::error_code MachOObjectFile::getLibraryShortNameByIndex ( unsigned Index,
StringRef & Res ) const

getLinkeditDataLoadCommand()

getLinkerOptionLoadCommand()

getLinkOptHintsLoadCommand()

getMachOFilesetEntryOffset()

size_t llvm::object::MachOObjectFile::getMachOFilesetEntryOffset ( ) const inline

getNoteLoadCommand()

getNValue()

getPlainRelocationExternal()

getPlainRelocationSymbolNum()

getRelocation()

Definition at line 4802 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().

getRelocationLength()

getRelocationOffset()

getRelocationRelocatedSection()

getRelocationSection()

getRelocationSymbol()

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.

getRelocationType()

getRelocationTypeName()

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.

getRoutinesCommand()

getRoutinesCommand64()

getRpathCommand()

getScatteredRelocationScattered()

getScatteredRelocationType()

getScatteredRelocationValue()

getSection() [1/4]

getSection() [2/4]

getSection() [3/4]

getSection() [4/4]

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().

getSection64() [1/2]

getSection64() [2/2]

getSectionAddress()

getSectionAlignment()

getSectionContents() [1/2]

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.

getSectionContents() [2/2]

getSectionFinalSegmentName()

getSectionID()

getSectionIndex()

getSectionName()

getSectionRawFinalSegmentName()

getSectionRawName()

getSectionSize()

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().

getSectionType()

getSegment64LoadCommand()

getSegmentContents() [1/2]

ArrayRef< uint8_t > MachOObjectFile::getSegmentContents ( size_t SegmentIndex ) const

getSegmentContents() [2/2]

getSegmentLoadCommand()

getSourceVersionCommand()

getStringTableData()

StringRef MachOObjectFile::getStringTableData ( ) const

getSubClientCommand()

getSubFrameworkCommand()

getSubLibraryCommand()

getSubUmbrellaCommand()

getSymbol64TableEntry()

getSymbolAddress()

getSymbolAlignment()

getSymbolByIndex()

getSymbolFlags()

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().

getSymbolIndex()

getSymbolName()

getSymbolSection()

getSymbolSectionID()

getSymbolTableEntry()

getSymbolType()

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().

getSymtabLoadCommand()

Definition at line 4857 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().

getThreadCommand()

getUuid()

getUuidCommand()

getValidArchs()

getVersionMinLoadCommand()

getVersionMinMajor()

getVersionMinMinor()

getVersionMinUpdate()

getVersionString()

std::string llvm::object::MachOObjectFile::getVersionString ( uint32_t version) inlinestatic

guessLibraryShortName()

hasPageZeroSegment()

bool llvm::object::MachOObjectFile::hasPageZeroSegment ( ) const inline

is64Bit()

bool MachOObjectFile::is64Bit ( ) const overridevirtual

Implements llvm::object::SymbolicFile.

Definition at line 5314 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().

isDebugSection()

bool MachOObjectFile::isDebugSection ( DataRefImpl Sec) const overridevirtual

isMachOPairedReloc()

Definition at line 5423 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.

isRelocatableObject()

bool MachOObjectFile::isRelocatableObject ( ) const overridevirtual

isRelocationScattered()

Definition at line 4564 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().

isSectionBitcode()

bool MachOObjectFile::isSectionBitcode ( DataRefImpl Sec) const overridevirtual

isSectionBSS()

bool MachOObjectFile::isSectionBSS ( DataRefImpl Sec) const overridevirtual

isSectionCompressed()

bool MachOObjectFile::isSectionCompressed ( DataRefImpl Sec) const overridevirtual

isSectionData()

bool MachOObjectFile::isSectionData ( DataRefImpl Sec) const overridevirtual

isSectionStripped()

bool MachOObjectFile::isSectionStripped ( DataRefImpl Sec) const 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.

isSectionText()

bool MachOObjectFile::isSectionText ( DataRefImpl Sec) const overridevirtual

isSectionVirtual()

bool MachOObjectFile::isSectionVirtual ( DataRefImpl Sec) const overridevirtual

isValidArch()

lazyBindTable()

load_commands()

locrel_begin()

locrel_end()

mapDebugSectionName()

mapReflectionSectionNameToEnumValue()

moveRelocationNext()

void MachOObjectFile::moveRelocationNext ( DataRefImpl & Rel) const overridevirtual

moveSectionNext()

void MachOObjectFile::moveSectionNext ( DataRefImpl & Sec) const overridevirtual

moveSymbolNext()

void MachOObjectFile::moveSymbolNext ( DataRefImpl & Symb) const overridevirtual

ReadULEB128s()

RebaseEntryCheckSegAndOffsets()

rebaseTable() [1/2]

rebaseTable() [2/2]

section_begin()

section_end()

section_rel_begin() [1/2]

section_rel_begin() [2/2]

section_rel_end() [1/2]

section_rel_end() [2/2]

symbol_begin()

symbol_end()

weakBindTable()

Header

Header64


The documentation for this class was generated from the following files: