LLVM  5.0.0
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:
[legend]
Collaboration diagram for llvm::object::MachOObjectFile:
[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< 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
 
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
 
std::error_code getSectionName (DataRefImpl Sec, StringRef &Res) const override
 
uint64_t getSectionAddress (DataRefImpl Sec) const override
 
uint64_t getSectionIndex (DataRefImpl Sec) const override
 
uint64_t getSectionSize (DataRefImpl Sec) const override
 
std::error_code getSectionContents (DataRefImpl Sec, StringRef &Res) const override
 
uint64_t getSectionAlignment (DataRefImpl Sec) const override
 
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
 
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
 
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
 
basic_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. More...
 
StringRef getFileFormatName () const override
 
unsigned getArch () const override
 
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 () const
 For use iterating over all exported symbols. More...
 
iterator_range< rebase_iterator > rebaseTable (Error &Err)
 For use iterating over all rebase table entries. More...
 
iterator_range< bind_iterator > bindTable (Error &Err)
 For use iterating over all bind table entries. More...
 
iterator_range< bind_iterator > lazyBindTable (Error &Err)
 For use iterating over all lazy bind table entries. More...
 
iterator_range< bind_iterator > weakBindTable (Error &Err)
 For use iterating over all weak bind table entries. More...
 
const char * BindEntryCheckSegAndOffset (int32_t SegIndex, uint64_t SegOffset, bool endInvalid) const
 For use with a SegIndex,SegOffset pair in MachOBindEntry::moveNext() to validate a MachOBindEntry. More...
 
const char * BindEntryCheckCountAndSkip (uint32_t Count, uint32_t Skip, uint8_t PointerSize, int32_t SegIndex, uint64_t SegOffset) const
 For use in MachOBindEntry::moveNext() to validate a MachOBindEntry for the BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB opcode. More...
 
const char * RebaseEntryCheckSegAndOffset (int32_t SegIndex, uint64_t SegOffset, bool endInvalid) const
 For use with a SegIndex,SegOffset pair in MachORebaseEntry::moveNext() to validate a MachORebaseEntry. More...
 
const char * RebaseEntryCheckCountAndSkip (uint32_t Count, uint32_t Skip, uint8_t PointerSize, int32_t SegIndex, uint64_t SegOffset) const
 For use in MachORebaseEntry::moveNext() to validate a MachORebaseEntry for the REBASE_OPCODE_DO_*_TIMES* opcodes. More...
 
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. More...
 
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. More...
 
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. More...
 
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::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
 
ArrayRef< uint8_t > getUuid () const
 
StringRef getStringTableData () const
 
bool is64Bit () const
 
void ReadULEB128s (uint64_t Index, SmallVectorImpl< uint64_t > &Out) const
 
bool isRelocatableObject () const override
 True if this is a relocatable object (.o/.obj). More...
 
StringRef mapDebugSectionName (StringRef Name) const override
 Maps a debug section name to a standard DWARF section name. More...
 
bool hasPageZeroSegment () const
 
- Public Member Functions inherited from llvm::object::ObjectFile
 ObjectFile ()=delete
 
 ObjectFile (const ObjectFile &other)=delete
 
uint64_t getCommonSymbolSize (DataRefImpl Symb) const
 
symbol_iterator_range symbols () const
 
section_iterator_range sections () const
 
virtual void setARMSubArch (Triple &TheTriple) const
 
virtual std::error_code getPlatformFlags (unsigned &Result) const
 Returns platform-specific object flags, if any. More...
 
virtual std::error_code getBuildAttributes (ARMAttributeParser &Attributes) const
 
- 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 ()
 
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 isELF () const
 
bool isMachO () const
 
bool isCOFF () const
 
bool isWasm () const
 
bool isCOFFImportFile () const
 
bool isIR () 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)
 
static iterator_range
< export_iterator > 
exports (ArrayRef< uint8_t > Trie)
 For use examining a trie not in a MachOObjectFile. More...
 
static iterator_range
< rebase_iterator > 
rebaseTable (Error &Err, MachOObjectFile *O, ArrayRef< uint8_t > Opcodes, bool is64)
 For use examining rebase opcodes in a MachOObjectFile. More...
 
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. More...
 
static StringRef guessLibraryShortName (StringRef Name, bool &isFramework, StringRef &Suffix)
 
static Triple::ArchType getArch (uint32_t CPUType)
 
static Triple getArchTriple (uint32_t CPUType, uint32_t CPUSubType, const char **McpuDefault=nullptr, const char **ArchFlag=nullptr)
 
static bool isValidArch (StringRef ArchFlag)
 
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 Public Member Functions inherited from llvm::object::ObjectFile
static Expected< OwningBinary
< ObjectFile > > 
createObjectFile (StringRef ObjectPath)
 Create ObjectFile from path. More...
 
static Expected
< std::unique_ptr< ObjectFile > > 
createObjectFile (MemoryBufferRef Object, llvm::file_magic Type)
 
static Expected
< std::unique_ptr< ObjectFile > > 
createObjectFile (MemoryBufferRef Object)
 
static bool classof (const Binary *v)
 
static ErrorOr
< std::unique_ptr
< COFFObjectFile > > 
createCOFFObjectFile (MemoryBufferRef Object)
 
static ErrorOr
< std::unique_ptr< ObjectFile > > 
createELFObjectFile (MemoryBufferRef Object)
 
static Expected
< std::unique_ptr
< MachOObjectFile > > 
createMachOObjectFile (MemoryBufferRef Object, uint32_t UniversalCputype=0, uint32_t UniversalIndex=0)
 
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)
 
static Expected
< std::unique_ptr
< SymbolicFile > > 
createSymbolicFile (MemoryBufferRef Object)
 
static Expected< OwningBinary
< SymbolicFile > > 
createSymbolicFile (StringRef ObjectPath)
 
static bool classof (const Binary *v)
 

Additional Inherited Members

- Protected Types inherited from llvm::object::Binary
enum  {
  ID_Archive, ID_MachOUniversalBinary, ID_COFFImportFile, ID_IR,
  ID_StartObjects, ID_COFF, ID_ELF32L, ID_ELF32B,
  ID_ELF64L, ID_ELF64B, ID_MachO32L, ID_MachO32B,
  ID_MachO64L, ID_MachO64B, ID_WinRes, ID_Wasm,
  ID_EndObjects
}
 
- Protected Member Functions inherited from llvm::object::ObjectFile
 ObjectFile (unsigned int Type, MemoryBufferRef Source)
 
const uint8_t * base () const
 
std::error_code printSymbolName (raw_ostream &OS, DataRefImpl Symb) const override
 
virtual section_iterator getRelocatedSection (DataRefImpl Sec) const
 
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
 

Detailed Description

Definition at line 256 of file MachO.h.

Member Typedef Documentation

Definition at line 263 of file MachO.h.

Definition at line 262 of file MachO.h.

Member Function Documentation

dice_iterator MachOObjectFile::begin_dices ( ) const
MachOObjectFile::load_command_iterator MachOObjectFile::begin_load_commands ( ) const
const char* llvm::object::MachOObjectFile::BindEntryCheckCountAndSkip ( uint32_t  Count,
uint32_t  Skip,
uint8_t  PointerSize,
int32_t  SegIndex,
uint64_t  SegOffset 
) const
inline

For use in MachOBindEntry::moveNext() to validate a MachOBindEntry for the BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB opcode.

Definition at line 398 of file MachO.h.

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

const char* llvm::object::MachOObjectFile::BindEntryCheckSegAndOffset ( int32_t  SegIndex,
uint64_t  SegOffset,
bool  endInvalid 
) const
inline

For use with a SegIndex,SegOffset pair in MachOBindEntry::moveNext() to validate a MachOBindEntry.

Definition at line 391 of file MachO.h.

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

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

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

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

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

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

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

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

For use iterating over all bind table entries.

Definition at line 3818 of file MachOObjectFile.cpp.

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

Referenced by lazyBindTable(), and weakBindTable().

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

For use examining bind opcodes in a MachOObjectFile.

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

Definition at line 563 of file MachO.h.

References llvm::object::Binary::isMachO().

Expected< std::unique_ptr< MachOObjectFile > > MachOObjectFile::create ( MemoryBufferRef  Object,
bool  IsLittleEndian,
bool  Is64Bits,
uint32_t  UniversalCputype = 0,
uint32_t  UniversalIndex = 0 
)
static
dice_iterator MachOObjectFile::end_dices ( ) const
MachOObjectFile::load_command_iterator MachOObjectFile::end_load_commands ( ) const
iterator_range<export_iterator> llvm::object::MachOObjectFile::exports ( ) const

For use iterating over all exported symbols.

iterator_range< export_iterator > MachOObjectFile::exports ( ArrayRef< uint8_t >  Trie)
static

For use examining a trie not in a MachOObjectFile.

Definition at line 2767 of file MachOObjectFile.cpp.

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

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

Definition at line 309 of file MachO.h.

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

relocation_iterator MachOObjectFile::extrel_begin ( ) const
relocation_iterator MachOObjectFile::extrel_end ( ) const
unsigned MachOObjectFile::getAnyRelocationAddress ( const MachO::any_relocation_info &  RE) const
unsigned MachOObjectFile::getAnyRelocationLength ( const MachO::any_relocation_info &  RE) const
unsigned MachOObjectFile::getAnyRelocationPCRel ( const MachO::any_relocation_info &  RE) const
SectionRef MachOObjectFile::getAnyRelocationSection ( const MachO::any_relocation_info &  RE) const
unsigned MachOObjectFile::getAnyRelocationType ( const MachO::any_relocation_info &  RE) const
unsigned llvm::object::MachOObjectFile::getArch ( ) const
overridevirtual
Triple::ArchType MachOObjectFile::getArch ( uint32_t  CPUType)
static
Triple llvm::object::MachOObjectFile::getArchTriple ( const char **  McpuDefault = nullptr) const
static Triple llvm::object::MachOObjectFile::getArchTriple ( uint32_t  CPUType,
uint32_t  CPUSubType,
const char **  McpuDefault = nullptr,
const char **  ArchFlag = nullptr 
)
static
static std::string llvm::object::MachOObjectFile::getBuildPlatform ( uint32_t  platform)
inlinestatic
static std::string llvm::object::MachOObjectFile::getBuildTool ( uint32_t  tools)
inlinestatic
MachO::build_tool_version MachOObjectFile::getBuildToolVersion ( unsigned  index) const

Definition at line 4019 of file MachOObjectFile.cpp.

MachO::build_version_command MachOObjectFile::getBuildVersionLoadCommand ( const LoadCommandInfo &  L) const
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 2374 of file MachOObjectFile.cpp.

References is64Bit().

uint64_t MachOObjectFile::getCommonSymbolSizeImpl ( DataRefImpl  Symb) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1717 of file MachOObjectFile.cpp.

References getNValue().

MachO::linkedit_data_command MachOObjectFile::getDataInCodeLoadCommand ( ) const

Definition at line 4201 of file MachOObjectFile.cpp.

References llvm::MachO::linkedit_data_command::cmd.

Referenced by begin_dices(), and end_dices().

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

Definition at line 4150 of file MachOObjectFile.cpp.

References getPtr().

MachO::data_in_code_entry MachOObjectFile::getDice ( DataRefImpl  Rel) const
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoBindOpcodes ( ) const
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoExportsTrie ( ) const
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoLazyBindOpcodes ( ) const
MachO::dyld_info_command MachOObjectFile::getDyldInfoLoadCommand ( const LoadCommandInfo &  L) const
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoRebaseOpcodes ( ) const
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoWeakBindOpcodes ( ) const
MachO::dylib_command MachOObjectFile::getDylibIDLoadCommand ( const LoadCommandInfo &  L) const
MachO::dylinker_command MachOObjectFile::getDylinkerCommand ( const LoadCommandInfo &  L) const
MachO::dysymtab_command MachOObjectFile::getDysymtabLoadCommand ( ) const
MachO::encryption_info_command MachOObjectFile::getEncryptionInfoCommand ( const LoadCommandInfo &  L) const
MachO::encryption_info_command_64 MachOObjectFile::getEncryptionInfoCommand64 ( const LoadCommandInfo &  L) const
MachO::entry_point_command MachOObjectFile::getEntryPointCommand ( const LoadCommandInfo &  L) const
SubtargetFeatures llvm::object::MachOObjectFile::getFeatures ( ) const
inlineoverridevirtual

Implements llvm::object::ObjectFile.

Definition at line 345 of file MachO.h.

StringRef MachOObjectFile::getFileFormatName ( ) const
overridevirtual
const MachO::mach_header & MachOObjectFile::getHeader ( ) const

Definition at line 4133 of file MachOObjectFile.cpp.

References Header.

Referenced by checkSymbolTable(), getRelocation(), getRelocationOffset(), and isRelocatableObject().

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

Definition at line 4137 of file MachOObjectFile.cpp.

References assert(), Header64, and is64Bit().

Referenced by checkSymbolTable().

Triple MachOObjectFile::getHostArch ( )
static

Definition at line 2544 of file MachOObjectFile.cpp.

References llvm::sys::getDefaultTargetTriple().

std::error_code MachOObjectFile::getIndirectName ( DataRefImpl  Symb,
StringRef &  Res 
) const
uint32_t MachOObjectFile::getIndirectSymbolTableEntry ( const MachO::dysymtab_command &  DLC,
unsigned  Index 
) const
uint32_t MachOObjectFile::getLibraryCount ( ) const
std::error_code MachOObjectFile::getLibraryShortNameByIndex ( unsigned  Index,
StringRef &  Res 
) const
MachO::linkedit_data_command MachOObjectFile::getLinkeditDataLoadCommand ( const LoadCommandInfo &  L) const
MachO::linker_option_command MachOObjectFile::getLinkerOptionLoadCommand ( const LoadCommandInfo &  L) const
MachO::linkedit_data_command MachOObjectFile::getLinkOptHintsLoadCommand ( ) const

Definition at line 4215 of file MachOObjectFile.cpp.

References llvm::MachO::linkedit_data_command::cmd.

MachO::note_command MachOObjectFile::getNoteLoadCommand ( const LoadCommandInfo &  L) const
uint64_t MachOObjectFile::getNValue ( DataRefImpl  Sym) const
bool MachOObjectFile::getPlainRelocationExternal ( const MachO::any_relocation_info &  RE) const
unsigned MachOObjectFile::getPlainRelocationSymbolNum ( const MachO::any_relocation_info &  RE) const
MachO::any_relocation_info MachOObjectFile::getRelocation ( DataRefImpl  Rel) const
uint8_t MachOObjectFile::getRelocationLength ( DataRefImpl  Rel) const

Definition at line 2121 of file MachOObjectFile.cpp.

References getAnyRelocationLength(), and getRelocation().

uint64_t MachOObjectFile::getRelocationOffset ( DataRefImpl  Rel) const
overridevirtual
section_iterator MachOObjectFile::getRelocationRelocatedSection ( relocation_iterator  Rel) const
section_iterator MachOObjectFile::getRelocationSection ( DataRefImpl  Rel) const

Definition at line 2003 of file MachOObjectFile.cpp.

References getAnyRelocationSection(), and getRelocation().

symbol_iterator MachOObjectFile::getRelocationSymbol ( DataRefImpl  Rel) const
overridevirtual
uint64_t MachOObjectFile::getRelocationType ( DataRefImpl  Rel) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2007 of file MachOObjectFile.cpp.

References getAnyRelocationType(), and getRelocation().

Referenced by getRelocationTypeName().

void MachOObjectFile::getRelocationTypeName ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const
overridevirtual
MachO::routines_command MachOObjectFile::getRoutinesCommand ( const LoadCommandInfo &  L) const
MachO::routines_command_64 MachOObjectFile::getRoutinesCommand64 ( const LoadCommandInfo &  L) const
MachO::rpath_command MachOObjectFile::getRpathCommand ( const LoadCommandInfo &  L) const
bool MachOObjectFile::getScatteredRelocationScattered ( const MachO::any_relocation_info &  RE) const

Definition at line 3892 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 3902 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
MachO::section llvm::object::MachOObjectFile::getSection ( DataRefImpl  DRI) const
MachO::section llvm::object::MachOObjectFile::getSection ( const LoadCommandInfo &  L,
unsigned  Index 
) const
MachO::section_64 llvm::object::MachOObjectFile::getSection64 ( DataRefImpl  DRI) const
MachO::section_64 llvm::object::MachOObjectFile::getSection64 ( const LoadCommandInfo &  L,
unsigned  Index 
) const
uint64_t MachOObjectFile::getSectionAddress ( DataRefImpl  Sec) const
overridevirtual
uint64_t MachOObjectFile::getSectionAlignment ( DataRefImpl  Sec) const
overridevirtual
std::error_code MachOObjectFile::getSectionContents ( DataRefImpl  Sec,
StringRef &  Res 
) const
overridevirtual
StringRef MachOObjectFile::getSectionFinalSegmentName ( DataRefImpl  Sec) const
unsigned MachOObjectFile::getSectionID ( SectionRef  Sec) const
uint64_t MachOObjectFile::getSectionIndex ( DataRefImpl  Sec) const
overridevirtual
std::error_code MachOObjectFile::getSectionName ( DataRefImpl  Sec,
StringRef &  Res 
) const
overridevirtual
ArrayRef< char > MachOObjectFile::getSectionRawFinalSegmentName ( DataRefImpl  Sec) const
ArrayRef< char > MachOObjectFile::getSectionRawName ( DataRefImpl  Sec) const
uint64_t MachOObjectFile::getSectionSize ( DataRefImpl  Sec) const
overridevirtual
unsigned MachOObjectFile::getSectionType ( SectionRef  Sec) const
MachO::segment_command_64 MachOObjectFile::getSegment64LoadCommand ( const LoadCommandInfo &  L) const
MachO::segment_command MachOObjectFile::getSegmentLoadCommand ( const LoadCommandInfo &  L) const
MachO::source_version_command MachOObjectFile::getSourceVersionCommand ( const LoadCommandInfo &  L) const
StringRef MachOObjectFile::getStringTableData ( ) const
MachO::sub_client_command MachOObjectFile::getSubClientCommand ( const LoadCommandInfo &  L) const
MachO::sub_framework_command MachOObjectFile::getSubFrameworkCommand ( const LoadCommandInfo &  L) const
MachO::sub_library_command MachOObjectFile::getSubLibraryCommand ( const LoadCommandInfo &  L) const
MachO::sub_umbrella_command MachOObjectFile::getSubUmbrellaCommand ( const LoadCommandInfo &  L) const
MachO::nlist_64 MachOObjectFile::getSymbol64TableEntry ( DataRefImpl  DRI) const

Definition at line 3978 of file MachOObjectFile.cpp.

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

Referenced by checkSymbolTable(), and getNValue().

Expected< uint64_t > MachOObjectFile::getSymbolAddress ( DataRefImpl  Symb) const
overridevirtual
uint32_t MachOObjectFile::getSymbolAlignment ( DataRefImpl  Symb) const
overridevirtual
basic_symbol_iterator MachOObjectFile::getSymbolByIndex ( unsigned  Index) const
uint32_t MachOObjectFile::getSymbolFlags ( DataRefImpl  Symb) const
overridevirtual
uint64_t MachOObjectFile::getSymbolIndex ( DataRefImpl  Symb) const
Expected< StringRef > MachOObjectFile::getSymbolName ( DataRefImpl  Symb) const
overridevirtual
Expected< section_iterator > MachOObjectFile::getSymbolSection ( DataRefImpl  Symb) const
overridevirtual
unsigned MachOObjectFile::getSymbolSectionID ( SymbolRef  Symb) const
MachO::nlist MachOObjectFile::getSymbolTableEntry ( DataRefImpl  DRI) const

Definition at line 3972 of file MachOObjectFile.cpp.

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

Referenced by checkSymbolTable(), and getNValue().

Expected< SymbolRef::Type > MachOObjectFile::getSymbolType ( DataRefImpl  Symb) const
overridevirtual
MachO::symtab_command MachOObjectFile::getSymtabLoadCommand ( ) const
MachO::thread_command MachOObjectFile::getThreadCommand ( const LoadCommandInfo &  L) const
ArrayRef< uint8_t > MachOObjectFile::getUuid ( ) const

Definition at line 4284 of file MachOObjectFile.cpp.

References llvm::makeArrayRef(), and None.

MachO::uuid_command MachOObjectFile::getUuidCommand ( const LoadCommandInfo &  L) const
MachO::version_min_command MachOObjectFile::getVersionMinLoadCommand ( const LoadCommandInfo &  L) const
static uint32_t llvm::object::MachOObjectFile::getVersionMinMajor ( MachO::version_min_command &  C,
bool  SDK 
)
inlinestatic
static uint32_t llvm::object::MachOObjectFile::getVersionMinMinor ( MachO::version_min_command &  C,
bool  SDK 
)
inlinestatic
static uint32_t llvm::object::MachOObjectFile::getVersionMinUpdate ( MachO::version_min_command &  C,
bool  SDK 
)
inlinestatic
static std::string llvm::object::MachOObjectFile::getVersionString ( uint32_t  version)
inlinestatic
StringRef MachOObjectFile::guessLibraryShortName ( StringRef  Name,
bool &  isFramework,
StringRef &  Suffix 
)
static
bool llvm::object::MachOObjectFile::hasPageZeroSegment ( ) const
inline

Definition at line 561 of file MachO.h.

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

bool MachOObjectFile::is64Bit ( ) const
bool MachOObjectFile::isRelocatableObject ( ) const
overridevirtual

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

Implements llvm::object::ObjectFile.

Definition at line 4314 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
bool MachOObjectFile::isSectionBitcode ( DataRefImpl  Sec) const
overridevirtual

Reimplemented from llvm::object::ObjectFile.

Definition at line 1922 of file MachOObjectFile.cpp.

References getSectionFinalSegmentName(), and getSectionName().

bool MachOObjectFile::isSectionBSS ( DataRefImpl  Sec) const
overridevirtual
bool MachOObjectFile::isSectionCompressed ( DataRefImpl  Sec) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1888 of file MachOObjectFile.cpp.

bool MachOObjectFile::isSectionData ( DataRefImpl  Sec) const
overridevirtual
bool MachOObjectFile::isSectionText ( DataRefImpl  Sec) const
overridevirtual
bool MachOObjectFile::isSectionVirtual ( DataRefImpl  Sec) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1917 of file MachOObjectFile.cpp.

bool MachOObjectFile::isValidArch ( StringRef  ArchFlag)
static
iterator_range< bind_iterator > MachOObjectFile::lazyBindTable ( Error &  Err)

For use iterating over all lazy bind table entries.

Definition at line 3823 of file MachOObjectFile.cpp.

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

iterator_range< MachOObjectFile::load_command_iterator > MachOObjectFile::load_commands ( ) const
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 4339 of file MachOObjectFile.cpp.

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

void MachOObjectFile::moveRelocationNext ( DataRefImpl &  Rel) const
overridevirtual
void MachOObjectFile::moveSectionNext ( DataRefImpl &  Sec) const
overridevirtual
void MachOObjectFile::moveSymbolNext ( DataRefImpl &  Symb) const
overridevirtual

Implements llvm::object::SymbolicFile.

Definition at line 1651 of file MachOObjectFile.cpp.

References is64Bit(), and llvm::object::DataRefImpl::p.

void MachOObjectFile::ReadULEB128s ( uint64_t  Index,
SmallVectorImpl< uint64_t > &  Out 
) const
const char* llvm::object::MachOObjectFile::RebaseEntryCheckCountAndSkip ( uint32_t  Count,
uint32_t  Skip,
uint8_t  PointerSize,
int32_t  SegIndex,
uint64_t  SegOffset 
) const
inline

For use in MachORebaseEntry::moveNext() to validate a MachORebaseEntry for the REBASE_OPCODE_DO_*_TIMES* opcodes.

Definition at line 414 of file MachO.h.

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

const char* llvm::object::MachOObjectFile::RebaseEntryCheckSegAndOffset ( int32_t  SegIndex,
uint64_t  SegOffset,
bool  endInvalid 
) const
inline

For use with a SegIndex,SegOffset pair in MachORebaseEntry::moveNext() to validate a MachORebaseEntry.

Definition at line 407 of file MachO.h.

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

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

For use iterating over all rebase table entries.

Definition at line 3160 of file MachOObjectFile.cpp.

References getDyldInfoRebaseOpcodes(), and is64Bit().

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 3147 of file MachOObjectFile.cpp.

References llvm::make_range().

section_iterator MachOObjectFile::section_begin ( ) const
overridevirtual
section_iterator MachOObjectFile::section_end ( ) const
overridevirtual
relocation_iterator llvm::object::MachOObjectFile::section_rel_begin ( DataRefImpl  Sec) const
overridevirtual
relocation_iterator llvm::object::MachOObjectFile::section_rel_begin ( unsigned  Index) const
relocation_iterator llvm::object::MachOObjectFile::section_rel_end ( DataRefImpl  Sec) const
overridevirtual
relocation_iterator llvm::object::MachOObjectFile::section_rel_end ( unsigned  Index) const
basic_symbol_iterator MachOObjectFile::symbol_begin ( ) const
overridevirtual
basic_symbol_iterator MachOObjectFile::symbol_end ( ) const
overridevirtual
iterator_range< bind_iterator > MachOObjectFile::weakBindTable ( Error &  Err)

For use iterating over all weak bind table entries.

Definition at line 3828 of file MachOObjectFile.cpp.

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

Member Data Documentation

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

Definition at line 634 of file MachO.h.

Referenced by getHeader().

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

Definition at line 633 of file MachO.h.

Referenced by getHeader64().


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