LLVM 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::object::MachOObjectFile Class Reference

#include "llvm/Object/MachO.h"

Inheritance diagram for llvm::object::MachOObjectFile:
Inheritance graph
[legend]

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 >
 

Public Member Functions

void moveSymbolNext (DataRefImpl &Symb) const override
 
uint64_t getNValue (DataRefImpl Sym) const
 
Expected< StringRefgetSymbolName (DataRefImpl Symb) const override
 
Error checkSymbolTable () const
 
std::error_code getIndirectName (DataRefImpl Symb, StringRef &Res) const
 
unsigned getSectionType (SectionRef Sec) const
 
Expected< uint64_tgetSymbolAddress (DataRefImpl Symb) const override
 
uint32_t getSymbolAlignment (DataRefImpl Symb) const override
 
uint64_t getCommonSymbolSizeImpl (DataRefImpl Symb) const override
 
Expected< SymbolRef::TypegetSymbolType (DataRefImpl Symb) const override
 
Expected< uint32_tgetSymbolFlags (DataRefImpl Symb) const override
 
Expected< section_iteratorgetSymbolSection (DataRefImpl Symb) const override
 
unsigned getSymbolSectionID (SymbolRef Symb) const
 
unsigned getSectionID (SectionRef Sec) const
 
void moveSectionNext (DataRefImpl &Sec) const override
 
Expected< StringRefgetSectionName (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_tgetSectionContents (uint32_t Offset, uint64_t Size) const
 
Expected< ArrayRef< uint8_t > > getSectionContents (DataRefImpl Sec) const override
 
uint64_t getSectionAlignment (DataRefImpl Sec) const override
 
Expected< SectionRefgetSection (unsigned SectionIndex) const
 
Expected< SectionRefgetSection (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_tgetSegmentContents (StringRef SegmentName) const
 Return the raw contents of an entire segment.
 
ArrayRef< uint8_tgetSegmentContents (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_iteratorexternal_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< SubtargetFeaturesgetFeatures () 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_iteratorload_commands () const
 
iterator_range< export_iteratorexports (Error &Err) const
 For use iterating over all exported symbols.
 
iterator_range< rebase_iteratorrebaseTable (Error &Err)
 For use iterating over all rebase table entries.
 
iterator_range< bind_iteratorbindTable (Error &Err)
 For use iterating over all bind table entries.
 
iterator_range< fixup_iteratorfixupTable (Error &Err)
 For iterating over all chained fixups.
 
iterator_range< bind_iteratorlazyBindTable (Error &Err)
 For use iterating over all lazy bind table entries.
 
iterator_range< bind_iteratorweakBindTable (Error &Err)
 For use iterating over all weak bind table entries.
 
const charBindEntryCheckSegAndOffsets (int32_t SegIndex, uint64_t SegOffset, uint8_t PointerSize, uint64_t Count=1, uint64_t Skip=0) const
 
const charRebaseEntryCheckSegAndOffsets (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< chargetSectionRawName (DataRefImpl Sec) const
 
ArrayRef< chargetSectionRawFinalSegmentName (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_headergetHeader () const
 
const MachO::mach_header_64getHeader64 () 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_tgetDyldInfoRebaseOpcodes () const
 
ArrayRef< uint8_tgetDyldInfoBindOpcodes () const
 
ArrayRef< uint8_tgetDyldInfoWeakBindOpcodes () const
 
ArrayRef< uint8_tgetDyldInfoLazyBindOpcodes () const
 
ArrayRef< uint8_tgetDyldInfoExportsTrie () 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_tgetDyldExportsTrie () const
 
SmallVector< uint64_tgetFunctionStarts () const
 
ArrayRef< uint8_tgetUuid () 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
 
ObjectFileoperator= (const ObjectFile &other)=delete
 
uint64_t getCommonSymbolSize (DataRefImpl Symb) const
 
virtual std::vector< SectionRefdynamic_relocation_sections () const
 
symbol_iterator_range symbols () const
 
virtual section_iterator section_begin () const =0
 
virtual section_iterator section_end () const =0
 
section_iterator_range sections () const
 
virtual bool hasDebugInfo () const
 
virtual uint8_t getBytesInAddress () const =0
 The number of bytes used to represent an address in this object file format.
 
virtual StringRef getFileFormatName () const =0
 
virtual Triple::ArchType getArch () const =0
 
virtual Triple::OSType getOS () const
 
virtual Expected< SubtargetFeaturesgetFeatures () const =0
 
virtual std::optional< StringReftryGetCPUName () const
 
virtual void setARMSubArch (Triple &TheTriple) const
 
virtual Expected< uint64_tgetStartAddress () const
 
Triple makeTriple () const
 Create a triple from the data in this object file.
 
virtual StringRef mapDebugSectionName (StringRef Name) const
 Maps a debug section name to a standard DWARF section name.
 
virtual bool isRelocatableObject () const =0
 True if this is a relocatable object (.o/.obj).
 
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
 
virtual void moveSymbolNext (DataRefImpl &Symb) const =0
 
virtual Error printSymbolName (raw_ostream &OS, DataRefImpl Symb) const =0
 
virtual Expected< uint32_tgetSymbolFlags (DataRefImpl Symb) const =0
 
virtual basic_symbol_iterator symbol_begin () const =0
 
virtual basic_symbol_iterator symbol_end () const =0
 
virtual bool is64Bit () const =0
 
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
 
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_iteratorexports (Error &Err, ArrayRef< uint8_t > Trie, const MachOObjectFile *O=nullptr)
 For use examining a trie not in a MachOObjectFile.
 
static iterator_range< rebase_iteratorrebaseTable (Error &Err, MachOObjectFile *O, ArrayRef< uint8_t > Opcodes, bool is64)
 For use examining rebase opcodes in a MachOObjectFile.
 
static iterator_range< bind_iteratorbindTable (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< StringRefgetValidArchs ()
 
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 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_EndObjects
}
 
- Protected Member Functions inherited from llvm::object::ObjectFile
 ObjectFile (unsigned int Type, MemoryBufferRef Source)
 
const uint8_tbase () const
 
virtual Expected< StringRefgetSymbolName (DataRefImpl Symb) const =0
 
Error printSymbolName (raw_ostream &OS, DataRefImpl Symb) const override
 
virtual Expected< uint64_tgetSymbolAddress (DataRefImpl Symb) const =0
 
virtual uint64_t getSymbolValueImpl (DataRefImpl Symb) const =0
 
virtual uint32_t getSymbolAlignment (DataRefImpl Symb) const
 
virtual uint64_t getCommonSymbolSizeImpl (DataRefImpl Symb) const =0
 
virtual Expected< SymbolRef::TypegetSymbolType (DataRefImpl Symb) const =0
 
virtual Expected< section_iteratorgetSymbolSection (DataRefImpl Symb) const =0
 
virtual void moveSectionNext (DataRefImpl &Sec) const =0
 
virtual Expected< StringRefgetSectionName (DataRefImpl Sec) const =0
 
virtual uint64_t getSectionAddress (DataRefImpl Sec) const =0
 
virtual uint64_t getSectionIndex (DataRefImpl Sec) const =0
 
virtual uint64_t getSectionSize (DataRefImpl Sec) const =0
 
virtual Expected< ArrayRef< uint8_t > > getSectionContents (DataRefImpl Sec) const =0
 
virtual uint64_t getSectionAlignment (DataRefImpl Sec) const =0
 
virtual bool isSectionCompressed (DataRefImpl Sec) const =0
 
virtual bool isSectionText (DataRefImpl Sec) const =0
 
virtual bool isSectionData (DataRefImpl Sec) const =0
 
virtual bool isSectionBSS (DataRefImpl Sec) const =0
 
virtual bool isSectionVirtual (DataRefImpl Sec) const =0
 
virtual bool isSectionBitcode (DataRefImpl Sec) const
 
virtual bool isSectionStripped (DataRefImpl Sec) const
 
virtual bool isBerkeleyText (DataRefImpl Sec) const
 
virtual bool isBerkeleyData (DataRefImpl Sec) const
 
virtual bool isDebugSection (DataRefImpl Sec) const
 
virtual relocation_iterator section_rel_begin (DataRefImpl Sec) const =0
 
virtual relocation_iterator section_rel_end (DataRefImpl Sec) const =0
 
virtual Expected< section_iteratorgetRelocatedSection (DataRefImpl Sec) const
 
virtual void moveRelocationNext (DataRefImpl &Rel) const =0
 
virtual uint64_t getRelocationOffset (DataRefImpl Rel) const =0
 
virtual symbol_iterator getRelocationSymbol (DataRefImpl Rel) const =0
 
virtual uint64_t getRelocationType (DataRefImpl Rel) const =0
 
virtual void getRelocationTypeName (DataRefImpl Rel, SmallVectorImpl< char > &Result) const =0
 
virtual llvm::binaryformat::Swift5ReflectionSectionKind mapReflectionSectionNameToEnumValue (StringRef SectionName) const
 
Expected< uint64_tgetSymbolValue (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
 

Detailed Description

Definition at line 406 of file MachO.h.

Member Typedef Documentation

◆ load_command_iterator

Definition at line 413 of file MachO.h.

◆ LoadCommandList

Definition at line 412 of file MachO.h.

Member Function Documentation

◆ begin_dices()

dice_iterator MachOObjectFile::begin_dices ( ) const

◆ begin_load_commands()

MachOObjectFile::load_command_iterator MachOObjectFile::begin_load_commands ( ) const

◆ BindEntryCheckSegAndOffsets()

const char * llvm::object::MachOObjectFile::BindEntryCheckSegAndOffsets ( int32_t  SegIndex,
uint64_t  SegOffset,
uint8_t  PointerSize,
uint64_t  Count = 1,
uint64_t  Skip = 0 
) const
inline

Definition at line 578 of file MachO.h.

Referenced by llvm::object::MachOBindEntry::moveNext().

◆ BindRebaseAddress()

uint64_t llvm::object::MachOObjectFile::BindRebaseAddress ( uint32_t  SegIndex,
uint64_t  SegOffset 
) const
inline

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

Definition at line 615 of file MachO.h.

Referenced by llvm::object::MachORebaseEntry::address(), llvm::object::MachOBindEntry::address(), llvm::object::MachOAbstractFixupEntry::address(), and llvm::object::MachOAbstractFixupEntry::segmentAddress().

◆ BindRebaseSectionName()

StringRef llvm::object::MachOObjectFile::BindRebaseSectionName ( uint32_t  SegIndex,
uint64_t  SegOffset 
) const
inline

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

Definition at line 609 of file MachO.h.

Referenced by llvm::object::MachORebaseEntry::sectionName(), llvm::object::MachOBindEntry::sectionName(), and llvm::object::MachOAbstractFixupEntry::sectionName().

◆ 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 603 of file MachO.h.

Referenced by llvm::object::MachORebaseEntry::segmentName(), llvm::object::MachOBindEntry::segmentName(), and llvm::object::MachOAbstractFixupEntry::segmentName().

◆ bindTable() [1/2]

iterator_range< bind_iterator > MachOObjectFile::bindTable ( Error Err)

For use iterating over all bind table entries.

Definition at line 4475 of file MachOObjectFile.cpp.

References bindTable(), getDyldInfoBindOpcodes(), is64Bit(), and llvm::object::MachOBindEntry::Regular.

Referenced by bindTable(), lazyBindTable(), and weakBindTable().

◆ bindTable() [2/2]

iterator_range< bind_iterator > MachOObjectFile::bindTable ( Error Err,
MachOObjectFile O,
ArrayRef< uint8_t Opcodes,
bool  is64,
MachOBindEntry::Kind  BKind 
)
static

For use examining bind opcodes in a MachOObjectFile.

Definition at line 4461 of file MachOObjectFile.cpp.

References llvm::make_range().

◆ checkSymbolTable()

Error MachOObjectFile::checkSymbolTable ( ) const

◆ classof()

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

Definition at line 769 of file MachO.h.

◆ create()

Expected< std::unique_ptr< MachOObjectFile > > MachOObjectFile::create ( MemoryBufferRef  Object,
bool  IsLittleEndian,
bool  Is64Bits,
uint32_t  UniversalCputype = 0,
uint32_t  UniversalIndex = 0,
size_t  MachOFilesetEntryOffset = 0 
)
static

◆ end_dices()

dice_iterator MachOObjectFile::end_dices ( ) const

◆ end_load_commands()

MachOObjectFile::load_command_iterator MachOObjectFile::end_load_commands ( ) const

◆ exports() [1/2]

iterator_range< export_iterator > MachOObjectFile::exports ( Error Err) const

For use iterating over all exported symbols.

Definition at line 3240 of file MachOObjectFile.cpp.

References exports(), getDyldExportsTrie(), and getDyldInfoExportsTrie().

Referenced by exports(), and readSymbols().

◆ exports() [2/2]

iterator_range< export_iterator > MachOObjectFile::exports ( Error Err,
ArrayRef< uint8_t Trie,
const MachOObjectFile O = nullptr 
)
static

For use examining a trie not in a MachOObjectFile.

Definition at line 3226 of file MachOObjectFile.cpp.

References llvm::ArrayRef< T >::empty(), and llvm::make_range().

◆ external_relocations()

iterator_range< relocation_iterator > llvm::object::MachOObjectFile::external_relocations ( ) const
inline

Definition at line 479 of file MachO.h.

References extrel_begin(), extrel_end(), and llvm::make_range().

◆ extrel_begin()

relocation_iterator MachOObjectFile::extrel_begin ( ) const

Definition at line 2198 of file MachOObjectFile.cpp.

References llvm::object::ObjectFile::RelocationRef.

Referenced by external_relocations().

◆ extrel_end()

relocation_iterator MachOObjectFile::extrel_end ( ) const

◆ 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 5346 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()

iterator_range< fixup_iterator > MachOObjectFile::fixupTable ( Error Err)

For iterating over all chained fixups.

Definition at line 4490 of file MachOObjectFile.cpp.

References llvm::make_range(), and llvm::object::MachOChainedFixupEntry::moveToEnd().

◆ getAnyRelocationAddress()

unsigned MachOObjectFile::getAnyRelocationAddress ( const MachO::any_relocation_info RE) const

◆ getAnyRelocationLength()

unsigned MachOObjectFile::getAnyRelocationLength ( const MachO::any_relocation_info RE) const

◆ getAnyRelocationPCRel()

unsigned MachOObjectFile::getAnyRelocationPCRel ( const MachO::any_relocation_info RE) const

◆ getAnyRelocationSection()

SectionRef MachOObjectFile::getAnyRelocationSection ( const MachO::any_relocation_info RE) const

◆ getAnyRelocationType()

unsigned MachOObjectFile::getAnyRelocationType ( const MachO::any_relocation_info RE) const

◆ getArch() [1/2]

Triple::ArchType MachOObjectFile::getArch ( ) const
overridevirtual

◆ getArch() [2/2]

Triple::ArchType MachOObjectFile::getArch ( uint32_t  CPUType,
uint32_t  CPUSubType 
)
static

◆ getArchTriple() [1/2]

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

◆ getArchTriple() [2/2]

Triple MachOObjectFile::getArchTriple ( uint32_t  CPUType,
uint32_t  CPUSubType,
const char **  McpuDefault = nullptr,
const char **  ArchFlag = nullptr 
)
static

◆ getBuildPlatform()

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

Definition at line 791 of file MachO.h.

References llvm::format_hex().

◆ getBuildTool()

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

◆ getBuildToolVersion()

MachO::build_tool_version MachOObjectFile::getBuildToolVersion ( unsigned  index) const

Definition at line 4689 of file MachOObjectFile.cpp.

◆ getBuildVersionLoadCommand()

MachO::build_version_command MachOObjectFile::getBuildVersionLoadCommand ( const LoadCommandInfo L) const

Definition at line 4684 of file MachOObjectFile.cpp.

Referenced by constructTriples().

◆ getBytesInAddress()

uint8_t MachOObjectFile::getBytesInAddress ( ) const
overridevirtual

The number of bytes used to represent an address in this object file format.

Implements llvm::object::ObjectFile.

Definition at line 2654 of file MachOObjectFile.cpp.

References is64Bit().

◆ getChainedFixupsHeader()

Expected< std::optional< MachO::dyld_chained_fixups_header > > MachOObjectFile::getChainedFixupsHeader ( ) const

◆ getChainedFixupsLoadCommand()

Expected< std::optional< MachO::linkedit_data_command > > MachOObjectFile::getChainedFixupsLoadCommand ( ) const

◆ getChainedFixupsSegments()

Expected< std::pair< size_t, std::vector< ChainedFixupsSegment > > > MachOObjectFile::getChainedFixupsSegments ( ) const

◆ getCommonSymbolSizeImpl()

uint64_t MachOObjectFile::getCommonSymbolSizeImpl ( DataRefImpl  Symb) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1837 of file MachOObjectFile.cpp.

References getNValue().

◆ getDataInCodeLoadCommand()

MachO::linkedit_data_command MachOObjectFile::getDataInCodeLoadCommand ( ) const

◆ getDataInCodeTableEntry()

MachO::data_in_code_entry MachOObjectFile::getDataInCodeTableEntry ( uint32_t  DataOffset,
unsigned  Index 
) const

Definition at line 4828 of file MachOObjectFile.cpp.

References getPtr(), and llvm::Offset.

◆ getDice()

MachO::data_in_code_entry MachOObjectFile::getDice ( DataRefImpl  Rel) const

◆ getDyldChainedFixupTargets()

Expected< std::vector< ChainedFixupTarget > > MachOObjectFile::getDyldChainedFixupTargets ( ) const

◆ getDyldExportsTrie()

ArrayRef< uint8_t > MachOObjectFile::getDyldExportsTrie ( ) const

◆ getDyldInfoBindOpcodes()

ArrayRef< uint8_t > MachOObjectFile::getDyldInfoBindOpcodes ( ) const

◆ getDyldInfoExportsTrie()

ArrayRef< uint8_t > MachOObjectFile::getDyldInfoExportsTrie ( ) const

◆ getDyldInfoLazyBindOpcodes()

ArrayRef< uint8_t > MachOObjectFile::getDyldInfoLazyBindOpcodes ( ) const

◆ getDyldInfoLoadCommand()

MachO::dyld_info_command MachOObjectFile::getDyldInfoLoadCommand ( const LoadCommandInfo L) const

Definition at line 4699 of file MachOObjectFile.cpp.

◆ getDyldInfoRebaseOpcodes()

ArrayRef< uint8_t > MachOObjectFile::getDyldInfoRebaseOpcodes ( ) const

◆ getDyldInfoWeakBindOpcodes()

ArrayRef< uint8_t > MachOObjectFile::getDyldInfoWeakBindOpcodes ( ) const

◆ getDylibIDLoadCommand()

MachO::dylib_command MachOObjectFile::getDylibIDLoadCommand ( const LoadCommandInfo L) const

Definition at line 4694 of file MachOObjectFile.cpp.

Referenced by readMachOHeader().

◆ getDylinkerCommand()

MachO::dylinker_command MachOObjectFile::getDylinkerCommand ( const LoadCommandInfo L) const

Definition at line 4704 of file MachOObjectFile.cpp.

◆ getDysymtabLoadCommand()

MachO::dysymtab_command MachOObjectFile::getDysymtabLoadCommand ( ) const

◆ getEncryptionInfoCommand()

MachO::encryption_info_command MachOObjectFile::getEncryptionInfoCommand ( const LoadCommandInfo L) const

Definition at line 4729 of file MachOObjectFile.cpp.

◆ getEncryptionInfoCommand64()

MachO::encryption_info_command_64 MachOObjectFile::getEncryptionInfoCommand64 ( const LoadCommandInfo L) const

Definition at line 4734 of file MachOObjectFile.cpp.

◆ getEntryPointCommand()

MachO::entry_point_command MachOObjectFile::getEntryPointCommand ( const LoadCommandInfo L) const

Definition at line 4724 of file MachOObjectFile.cpp.

◆ getFeatures()

Expected< SubtargetFeatures > llvm::object::MachOObjectFile::getFeatures ( ) const
inlineoverridevirtual

Implements llvm::object::ObjectFile.

Definition at line 520 of file MachO.h.

◆ getFileFormatName()

StringRef MachOObjectFile::getFileFormatName ( ) const
overridevirtual

◆ getFilesetEntryLoadCommand()

MachO::fileset_entry_command MachOObjectFile::getFilesetEntryLoadCommand ( const LoadCommandInfo L) const

Definition at line 4774 of file MachOObjectFile.cpp.

◆ getFunctionStarts()

SmallVector< uint64_t > MachOObjectFile::getFunctionStarts ( ) const

◆ getHeader()

const MachO::mach_header & MachOObjectFile::getHeader ( ) const

◆ getHeader64()

const MachO::mach_header_64 & MachOObjectFile::getHeader64 ( ) const

◆ getHostArch()

Triple MachOObjectFile::getHostArch ( )
static

Definition at line 2845 of file MachOObjectFile.cpp.

References llvm::sys::getDefaultTargetTriple().

◆ getIndirectName()

std::error_code MachOObjectFile::getIndirectName ( DataRefImpl  Symb,
StringRef Res 
) const

◆ getIndirectSymbolTableEntry()

uint32_t MachOObjectFile::getIndirectSymbolTableEntry ( const MachO::dysymtab_command DLC,
unsigned  Index 
) const

◆ getLibraryCount()

uint32_t MachOObjectFile::getLibraryCount ( ) const

◆ getLibraryShortNameByIndex()

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

◆ getLinkeditDataLoadCommand()

MachO::linkedit_data_command MachOObjectFile::getLinkeditDataLoadCommand ( const LoadCommandInfo L) const

Definition at line 4654 of file MachOObjectFile.cpp.

Referenced by readMachOHeader().

◆ getLinkerOptionLoadCommand()

MachO::linker_option_command MachOObjectFile::getLinkerOptionLoadCommand ( const LoadCommandInfo L) const

Definition at line 4669 of file MachOObjectFile.cpp.

◆ getLinkOptHintsLoadCommand()

MachO::linkedit_data_command MachOObjectFile::getLinkOptHintsLoadCommand ( ) const

◆ getMachOFilesetEntryOffset()

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

Definition at line 767 of file MachO.h.

Referenced by getFirstLoadCommandInfo(), getNextLoadCommandInfo(), and parseHeader().

◆ getNoteLoadCommand()

MachO::note_command MachOObjectFile::getNoteLoadCommand ( const LoadCommandInfo L) const

Definition at line 4679 of file MachOObjectFile.cpp.

◆ getNValue()

uint64_t MachOObjectFile::getNValue ( DataRefImpl  Sym) const

◆ getPlainRelocationExternal()

bool MachOObjectFile::getPlainRelocationExternal ( const MachO::any_relocation_info RE) const

◆ getPlainRelocationSymbolNum()

unsigned MachOObjectFile::getPlainRelocationSymbolNum ( const MachO::any_relocation_info RE) const

◆ getRelocation()

MachO::any_relocation_info MachOObjectFile::getRelocation ( DataRefImpl  Rel) const

◆ getRelocationLength()

uint8_t MachOObjectFile::getRelocationLength ( DataRefImpl  Rel) const

Definition at line 2385 of file MachOObjectFile.cpp.

References getAnyRelocationLength(), and getRelocation().

◆ getRelocationOffset()

uint64_t MachOObjectFile::getRelocationOffset ( DataRefImpl  Rel) const
overridevirtual

◆ getRelocationRelocatedSection()

section_iterator MachOObjectFile::getRelocationRelocatedSection ( relocation_iterator  Rel) const

◆ getRelocationSection()

section_iterator MachOObjectFile::getRelocationSection ( DataRefImpl  Rel) const

Definition at line 2266 of file MachOObjectFile.cpp.

References getAnyRelocationSection(), and getRelocation().

◆ getRelocationSymbol()

symbol_iterator MachOObjectFile::getRelocationSymbol ( DataRefImpl  Rel) const
overridevirtual

◆ getRelocationType()

uint64_t MachOObjectFile::getRelocationType ( DataRefImpl  Rel) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2270 of file MachOObjectFile.cpp.

References getAnyRelocationType(), and getRelocation().

Referenced by getRelocationTypeName().

◆ getRelocationTypeName()

void MachOObjectFile::getRelocationTypeName ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const
overridevirtual

◆ getRoutinesCommand()

MachO::routines_command MachOObjectFile::getRoutinesCommand ( const LoadCommandInfo L) const

Definition at line 4759 of file MachOObjectFile.cpp.

◆ getRoutinesCommand64()

MachO::routines_command_64 MachOObjectFile::getRoutinesCommand64 ( const LoadCommandInfo L) const

Definition at line 4764 of file MachOObjectFile.cpp.

◆ getRpathCommand()

MachO::rpath_command MachOObjectFile::getRpathCommand ( const LoadCommandInfo L) const

Definition at line 4714 of file MachOObjectFile.cpp.

Referenced by readMachOHeader().

◆ getScatteredRelocationScattered()

bool MachOObjectFile::getScatteredRelocationScattered ( const MachO::any_relocation_info RE) const

Definition at line 4562 of file MachOObjectFile.cpp.

References llvm::MachO::any_relocation_info::r_word0.

◆ getScatteredRelocationType()

uint32_t MachOObjectFile::getScatteredRelocationType ( const MachO::any_relocation_info RE) const

Definition at line 4572 of file MachOObjectFile.cpp.

References llvm::MachO::any_relocation_info::r_word0.

Referenced by getAnyRelocationType().

◆ getScatteredRelocationValue()

uint32_t MachOObjectFile::getScatteredRelocationValue ( const MachO::any_relocation_info RE) const

◆ getSection() [1/4]

MachO::section MachOObjectFile::getSection ( const LoadCommandInfo L,
unsigned  Index 
) const

Definition at line 4629 of file MachOObjectFile.cpp.

References getSectionPtr().

◆ getSection() [2/4]

MachO::section MachOObjectFile::getSection ( DataRefImpl  DRI) const

◆ getSection() [3/4]

Expected< SectionRef > MachOObjectFile::getSection ( StringRef  SectionName) const

◆ getSection() [4/4]

Expected< SectionRef > MachOObjectFile::getSection ( unsigned  SectionIndex) const

◆ getSection64() [1/2]

MachO::section_64 MachOObjectFile::getSection64 ( const LoadCommandInfo L,
unsigned  Index 
) const

Definition at line 4635 of file MachOObjectFile.cpp.

References getSectionPtr().

◆ getSection64() [2/2]

MachO::section_64 MachOObjectFile::getSection64 ( DataRefImpl  DRI) const

◆ getSectionAddress()

uint64_t MachOObjectFile::getSectionAddress ( DataRefImpl  Sec) const
overridevirtual

◆ getSectionAlignment()

uint64_t MachOObjectFile::getSectionAlignment ( DataRefImpl  Sec) const
overridevirtual

◆ getSectionContents() [1/2]

Expected< ArrayRef< uint8_t > > MachOObjectFile::getSectionContents ( DataRefImpl  Sec) const
overridevirtual

◆ getSectionContents() [2/2]

ArrayRef< uint8_t > MachOObjectFile::getSectionContents ( uint32_t  Offset,
uint64_t  Size 
) const

◆ getSectionFinalSegmentName()

StringRef MachOObjectFile::getSectionFinalSegmentName ( DataRefImpl  Sec) const

◆ getSectionID()

unsigned MachOObjectFile::getSectionID ( SectionRef  Sec) const

◆ getSectionIndex()

uint64_t MachOObjectFile::getSectionIndex ( DataRefImpl  Sec) const
overridevirtual

◆ getSectionName()

Expected< StringRef > MachOObjectFile::getSectionName ( DataRefImpl  Sec) const
overridevirtual

◆ getSectionRawFinalSegmentName()

ArrayRef< char > MachOObjectFile::getSectionRawFinalSegmentName ( DataRefImpl  Sec) const

◆ getSectionRawName()

ArrayRef< char > MachOObjectFile::getSectionRawName ( DataRefImpl  Sec) const

◆ getSectionSize()

uint64_t MachOObjectFile::getSectionSize ( DataRefImpl  Sec) const
overridevirtual

◆ getSectionType()

unsigned MachOObjectFile::getSectionType ( SectionRef  Sec) const

◆ getSegment64LoadCommand()

MachO::segment_command_64 MachOObjectFile::getSegment64LoadCommand ( const LoadCommandInfo L) const

◆ getSegmentContents() [1/2]

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

◆ getSegmentContents() [2/2]

ArrayRef< uint8_t > MachOObjectFile::getSegmentContents ( StringRef  SegmentName) const

Return the raw contents of an entire segment.

Definition at line 2107 of file MachOObjectFile.cpp.

References llvm::object::MachOObjectFile::LoadCommandInfo::C, llvm::MachO::load_command::cmd, llvm::ArrayRef< T >::empty(), and load_commands().

◆ getSegmentLoadCommand()

MachO::segment_command MachOObjectFile::getSegmentLoadCommand ( const LoadCommandInfo L) const

◆ getSourceVersionCommand()

MachO::source_version_command MachOObjectFile::getSourceVersionCommand ( const LoadCommandInfo L) const

Definition at line 4719 of file MachOObjectFile.cpp.

◆ getStringTableData()

StringRef MachOObjectFile::getStringTableData ( ) const

◆ getSubClientCommand()

MachO::sub_client_command MachOObjectFile::getSubClientCommand ( const LoadCommandInfo L) const

Definition at line 4754 of file MachOObjectFile.cpp.

Referenced by readMachOHeader().

◆ getSubFrameworkCommand()

MachO::sub_framework_command MachOObjectFile::getSubFrameworkCommand ( const LoadCommandInfo L) const

Definition at line 4739 of file MachOObjectFile.cpp.

Referenced by readMachOHeader().

◆ getSubLibraryCommand()

MachO::sub_library_command MachOObjectFile::getSubLibraryCommand ( const LoadCommandInfo L) const

Definition at line 4749 of file MachOObjectFile.cpp.

◆ getSubUmbrellaCommand()

MachO::sub_umbrella_command MachOObjectFile::getSubUmbrellaCommand ( const LoadCommandInfo L) const

Definition at line 4744 of file MachOObjectFile.cpp.

◆ getSymbol64TableEntry()

MachO::nlist_64 MachOObjectFile::getSymbol64TableEntry ( DataRefImpl  DRI) const

Definition at line 4648 of file MachOObjectFile.cpp.

References llvm::object::DataRefImpl::p, and P.

Referenced by checkSymbolTable(), and getNValue().

◆ getSymbolAddress()

Expected< uint64_t > MachOObjectFile::getSymbolAddress ( DataRefImpl  Symb) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1824 of file MachOObjectFile.cpp.

References llvm::object::ObjectFile::getSymbolValue(), and Sym.

◆ getSymbolAlignment()

uint32_t MachOObjectFile::getSymbolAlignment ( DataRefImpl  Symb) const
overridevirtual

◆ getSymbolByIndex()

symbol_iterator MachOObjectFile::getSymbolByIndex ( unsigned  Index) const

◆ getSymbolFlags()

Expected< uint32_t > MachOObjectFile::getSymbolFlags ( DataRefImpl  Symb) const
overridevirtual

◆ getSymbolIndex()

uint64_t MachOObjectFile::getSymbolIndex ( DataRefImpl  Symb) const

◆ getSymbolName()

Expected< StringRef > MachOObjectFile::getSymbolName ( DataRefImpl  Symb) const
overridevirtual

◆ getSymbolSection()

Expected< section_iterator > MachOObjectFile::getSymbolSection ( DataRefImpl  Symb) const
overridevirtual

◆ getSymbolSectionID()

unsigned MachOObjectFile::getSymbolSectionID ( SymbolRef  Symb) const

Definition at line 1926 of file MachOObjectFile.cpp.

References getSymbolTableEntryBase(), and Sym.

◆ getSymbolTableEntry()

MachO::nlist MachOObjectFile::getSymbolTableEntry ( DataRefImpl  DRI) const

Definition at line 4642 of file MachOObjectFile.cpp.

References llvm::object::DataRefImpl::p, and P.

Referenced by checkSymbolTable(), and getNValue().

◆ getSymbolType()

Expected< SymbolRef::Type > MachOObjectFile::getSymbolType ( DataRefImpl  Symb) const
overridevirtual

◆ getSymtabLoadCommand()

MachO::symtab_command MachOObjectFile::getSymtabLoadCommand ( ) const

◆ getThreadCommand()

MachO::thread_command MachOObjectFile::getThreadCommand ( const LoadCommandInfo L) const

Definition at line 4769 of file MachOObjectFile.cpp.

◆ getUuid()

ArrayRef< uint8_t > MachOObjectFile::getUuid ( ) const

Definition at line 5278 of file MachOObjectFile.cpp.

References offsetof, and Ptr.

◆ getUuidCommand()

MachO::uuid_command MachOObjectFile::getUuidCommand ( const LoadCommandInfo L) const

Definition at line 4709 of file MachOObjectFile.cpp.

Referenced by readMachOHeader().

◆ getValidArchs()

ArrayRef< StringRef > MachOObjectFile::getValidArchs ( )
static

Definition at line 2854 of file MachOObjectFile.cpp.

Referenced by isValidArch().

◆ getVersionMinLoadCommand()

MachO::version_min_command MachOObjectFile::getVersionMinLoadCommand ( const LoadCommandInfo L) const

Definition at line 4674 of file MachOObjectFile.cpp.

Referenced by constructTriples().

◆ getVersionMinMajor()

static uint32_t llvm::object::MachOObjectFile::getVersionMinMajor ( MachO::version_min_command C,
bool  SDK 
)
inlinestatic

Definition at line 774 of file MachO.h.

References llvm::CallingConv::C.

◆ getVersionMinMinor()

static uint32_t llvm::object::MachOObjectFile::getVersionMinMinor ( MachO::version_min_command C,
bool  SDK 
)
inlinestatic

Definition at line 780 of file MachO.h.

References llvm::CallingConv::C.

◆ getVersionMinUpdate()

static uint32_t llvm::object::MachOObjectFile::getVersionMinUpdate ( MachO::version_min_command C,
bool  SDK 
)
inlinestatic

Definition at line 786 of file MachO.h.

References llvm::CallingConv::C.

◆ getVersionString()

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

Definition at line 821 of file MachO.h.

References llvm::Version.

◆ guessLibraryShortName()

StringRef MachOObjectFile::guessLibraryShortName ( StringRef  Name,
bool isFramework,
StringRef Suffix 
)
static

◆ hasPageZeroSegment()

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

Definition at line 765 of file MachO.h.

Referenced by llvm::object::BindRebaseSegInfo::BindRebaseSegInfo().

◆ is64Bit()

bool MachOObjectFile::is64Bit ( ) const
overridevirtual

◆ isDebugSection()

bool MachOObjectFile::isDebugSection ( DataRefImpl  Sec) const
overridevirtual

◆ isMachOPairedReloc()

bool MachOObjectFile::isMachOPairedReloc ( uint64_t  RelocType,
uint64_t  Arch 
)
static

◆ isRelocatableObject()

bool MachOObjectFile::isRelocatableObject ( ) const
overridevirtual

True if this is a relocatable object (.o/.obj).

Implements llvm::object::ObjectFile.

Definition at line 5308 of file MachOObjectFile.cpp.

References llvm::MachO::mach_header::filetype, getHeader(), and llvm::MachO::MH_OBJECT.

Referenced by llvm::jitlink::MachOLinkGraphBuilder::buildGraph().

◆ isRelocationScattered()

bool MachOObjectFile::isRelocationScattered ( const MachO::any_relocation_info RE) const

◆ isSectionBitcode()

bool MachOObjectFile::isSectionBitcode ( DataRefImpl  Sec) const
overridevirtual

Reimplemented from llvm::object::ObjectFile.

Definition at line 2161 of file MachOObjectFile.cpp.

References getSectionFinalSegmentName(), and getSectionName().

◆ isSectionBSS()

bool MachOObjectFile::isSectionBSS ( DataRefImpl  Sec) const
overridevirtual

◆ isSectionCompressed()

bool MachOObjectFile::isSectionCompressed ( DataRefImpl  Sec) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2036 of file MachOObjectFile.cpp.

◆ 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 2168 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()

bool MachOObjectFile::isValidArch ( StringRef  ArchFlag)
static

Definition at line 2849 of file MachOObjectFile.cpp.

References getValidArchs(), and llvm::is_contained().

◆ lazyBindTable()

iterator_range< bind_iterator > MachOObjectFile::lazyBindTable ( Error Err)

For use iterating over all lazy bind table entries.

Definition at line 4480 of file MachOObjectFile.cpp.

References bindTable(), getDyldInfoLazyBindOpcodes(), is64Bit(), and llvm::object::MachOBindEntry::Lazy.

◆ load_commands()

iterator_range< MachOObjectFile::load_command_iterator > MachOObjectFile::load_commands ( ) const

◆ locrel_begin()

relocation_iterator MachOObjectFile::locrel_begin ( ) const

Definition at line 2215 of file MachOObjectFile.cpp.

References llvm::object::ObjectFile::RelocationRef.

◆ locrel_end()

relocation_iterator MachOObjectFile::locrel_end ( ) const

◆ mapDebugSectionName()

StringRef MachOObjectFile::mapDebugSectionName ( StringRef  Name) const
overridevirtual

Maps a debug section name to a standard DWARF section name.

Reimplemented from llvm::object::ObjectFile.

Definition at line 5339 of file MachOObjectFile.cpp.

References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), and Name.

◆ mapReflectionSectionNameToEnumValue()

llvm::binaryformat::Swift5ReflectionSectionKind MachOObjectFile::mapReflectionSectionNameToEnumValue ( StringRef  SectionName) const
overridevirtual

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

void MachOObjectFile::ReadULEB128s ( uint64_t  Index,
SmallVectorImpl< uint64_t > &  Out 
) const

◆ RebaseEntryCheckSegAndOffsets()

const char * llvm::object::MachOObjectFile::RebaseEntryCheckSegAndOffsets ( int32_t  SegIndex,
uint64_t  SegOffset,
uint8_t  PointerSize,
uint64_t  Count = 1,
uint64_t  Skip = 0 
) const
inline

Definition at line 592 of file MachO.h.

Referenced by llvm::object::MachORebaseEntry::moveNext().

◆ rebaseTable() [1/2]

iterator_range< rebase_iterator > MachOObjectFile::rebaseTable ( Error Err)

For use iterating over all rebase table entries.

Definition at line 3813 of file MachOObjectFile.cpp.

References getDyldInfoRebaseOpcodes(), is64Bit(), and rebaseTable().

Referenced by rebaseTable().

◆ rebaseTable() [2/2]

iterator_range< rebase_iterator > MachOObjectFile::rebaseTable ( Error Err,
MachOObjectFile O,
ArrayRef< uint8_t Opcodes,
bool  is64 
)
static

For use examining rebase opcodes in a MachOObjectFile.

Definition at line 3800 of file MachOObjectFile.cpp.

References llvm::make_range().

◆ section_begin()

section_iterator MachOObjectFile::section_begin ( ) const
overridevirtual

◆ section_end()

section_iterator MachOObjectFile::section_end ( ) const
overridevirtual

◆ section_rel_begin() [1/2]

relocation_iterator MachOObjectFile::section_rel_begin ( DataRefImpl  Sec) const
overridevirtual

◆ section_rel_begin() [2/2]

relocation_iterator MachOObjectFile::section_rel_begin ( unsigned  Index) const

◆ section_rel_end() [1/2]

relocation_iterator MachOObjectFile::section_rel_end ( DataRefImpl  Sec) const
overridevirtual

◆ section_rel_end() [2/2]

relocation_iterator MachOObjectFile::section_rel_end ( unsigned  Index) const

◆ symbol_begin()

basic_symbol_iterator MachOObjectFile::symbol_begin ( ) const
overridevirtual

◆ symbol_end()

basic_symbol_iterator MachOObjectFile::symbol_end ( ) const
overridevirtual

◆ weakBindTable()

iterator_range< bind_iterator > MachOObjectFile::weakBindTable ( Error Err)

For use iterating over all weak bind table entries.

Definition at line 4485 of file MachOObjectFile.cpp.

References bindTable(), getDyldInfoWeakBindOpcodes(), is64Bit(), and llvm::object::MachOBindEntry::Weak.

Member Data Documentation

◆ Header

MachO::mach_header llvm::object::MachOObjectFile::Header

◆ Header64

MachO::mach_header_64 llvm::object::MachOObjectFile::Header64

Definition at line 849 of file MachO.h.

Referenced by getHeader64().


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