LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::object::MachOObjectFile Class Reference

#include <MachO.h>

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

Classes

struct  LoadCommandInfo
 

Public Member Functions

 MachOObjectFile (MemoryBuffer *Object, bool IsLittleEndian, bool Is64Bits, error_code &ec)
 
virtual error_code getSymbolNext (DataRefImpl Symb, SymbolRef &Res) const
 
virtual error_code getSymbolName (DataRefImpl Symb, StringRef &Res) const
 
virtual error_code getSymbolAddress (DataRefImpl Symb, uint64_t &Res) const
 
virtual error_code getSymbolFileOffset (DataRefImpl Symb, uint64_t &Res) const
 
virtual error_code getSymbolAlignment (DataRefImpl Symb, uint32_t &Res) const
 
virtual error_code getSymbolSize (DataRefImpl Symb, uint64_t &Res) const
 
virtual error_code getSymbolType (DataRefImpl Symb, SymbolRef::Type &Res) const
 
virtual error_code getSymbolFlags (DataRefImpl Symb, uint32_t &Res) const
 
virtual error_code getSymbolSection (DataRefImpl Symb, section_iterator &Res) const
 
virtual error_code getSymbolValue (DataRefImpl Symb, uint64_t &Val) const
 
virtual error_code getSectionNext (DataRefImpl Sec, SectionRef &Res) const
 
virtual error_code getSectionName (DataRefImpl Sec, StringRef &Res) const
 
virtual error_code getSectionAddress (DataRefImpl Sec, uint64_t &Res) const
 
virtual error_code getSectionSize (DataRefImpl Sec, uint64_t &Res) const
 
virtual error_code getSectionContents (DataRefImpl Sec, StringRef &Res) const
 
virtual error_code getSectionAlignment (DataRefImpl Sec, uint64_t &Res) const
 
virtual error_code isSectionText (DataRefImpl Sec, bool &Res) const
 
virtual error_code isSectionData (DataRefImpl Sec, bool &Res) const
 
virtual error_code isSectionBSS (DataRefImpl Sec, bool &Res) const
 
virtual error_code isSectionRequiredForExecution (DataRefImpl Sec, bool &Res) const
 
virtual error_code isSectionVirtual (DataRefImpl Sec, bool &Res) const
 
virtual error_code isSectionZeroInit (DataRefImpl Sec, bool &Res) const
 
virtual error_code isSectionReadOnlyData (DataRefImpl Sec, bool &Res) const
 
virtual error_code sectionContainsSymbol (DataRefImpl Sec, DataRefImpl Symb, bool &Result) const
 
virtual relocation_iterator section_rel_begin (DataRefImpl Sec) const
 
virtual relocation_iterator section_rel_end (DataRefImpl Sec) const
 
virtual error_code getRelocationNext (DataRefImpl Rel, RelocationRef &Res) const
 
virtual error_code getRelocationAddress (DataRefImpl Rel, uint64_t &Res) const
 
virtual error_code getRelocationOffset (DataRefImpl Rel, uint64_t &Res) const
 
virtual symbol_iterator getRelocationSymbol (DataRefImpl Rel) const
 
virtual error_code getRelocationType (DataRefImpl Rel, uint64_t &Res) const
 
virtual error_code getRelocationTypeName (DataRefImpl Rel, SmallVectorImpl< char > &Result) const
 
virtual error_code getRelocationValueString (DataRefImpl Rel, SmallVectorImpl< char > &Result) const
 
virtual error_code getRelocationHidden (DataRefImpl Rel, bool &Result) const
 
virtual error_code getLibraryNext (DataRefImpl LibData, LibraryRef &Res) const
 
virtual error_code getLibraryPath (DataRefImpl LibData, StringRef &Res) const
 
virtual symbol_iterator begin_symbols () const
 
virtual symbol_iterator end_symbols () const
 
virtual symbol_iterator begin_dynamic_symbols () const
 
virtual symbol_iterator end_dynamic_symbols () const
 
virtual section_iterator begin_sections () const
 
virtual section_iterator end_sections () const
 
virtual library_iterator begin_libraries_needed () const
 
virtual library_iterator end_libraries_needed () const
 
virtual uint8_t getBytesInAddress () const
 The number of bytes used to represent an address in this object file format. More...
 
virtual StringRef getFileFormatName () const
 
virtual unsigned getArch () const
 
virtual StringRef getLoadName () 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
 
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
 
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 getRelocationSection (const MachO::any_relocation_info &RE) const
 
LoadCommandInfo getFirstLoadCommandInfo () const
 
LoadCommandInfo getNextLoadCommandInfo (const LoadCommandInfo &L) 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_options_command getLinkerOptionsLoadCommand (const LoadCommandInfo &L) const
 
MachO::any_relocation_info getRelocation (DataRefImpl Rel) const
 
MachO::data_in_code_entry getDice (DataRefImpl Rel) const
 
MachO::mach_header getHeader () 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
 
StringRef getStringTableData () const
 
bool is64Bit () const
 
void ReadULEB128s (uint64_t Index, SmallVectorImpl< uint64_t > &Out) const
 
- Public Member Functions inherited from llvm::object::Binary
virtual ~Binary ()
 
StringRef getData () const
 
StringRef getFileName () const
 
unsigned int getType () const
 
bool isObject () const
 
bool isArchive () const
 
bool isMachOUniversalBinary () const
 
bool isELF () const
 
bool isMachO () const
 
bool isCOFF () const
 
bool isLittleEndian () const
 

Static Public Member Functions

static Triple::ArchType getArch (uint32_t CPUType)
 
static bool classof (const Binary *v)
 
- Static Public Member Functions inherited from llvm::object::ObjectFile
static ObjectFilecreateObjectFile (StringRef ObjectPath)
 Create ObjectFile from path. More...
 
static ObjectFilecreateObjectFile (MemoryBuffer *Object)
 
static bool classof (const Binary *v)
 
static ObjectFilecreateCOFFObjectFile (MemoryBuffer *Object)
 
static ObjectFilecreateELFObjectFile (MemoryBuffer *Object)
 
static ObjectFilecreateMachOObjectFile (MemoryBuffer *Object)
 

Additional Inherited Members

- Protected Types inherited from llvm::object::Binary
enum  {
  ID_Archive, ID_MachOUniversalBinary, ID_StartObjects, ID_COFF,
  ID_ELF32L, ID_ELF32B, ID_ELF64L, ID_ELF64B,
  ID_MachO32L, ID_MachO32B, ID_MachO64L, ID_MachO64B,
  ID_EndObjects
}
 
- Protected Member Functions inherited from llvm::object::ObjectFile
 ObjectFile (unsigned int Type, MemoryBuffer *source)
 
const uint8_t * base () const
 
virtual section_iterator getRelocatedSection (DataRefImpl Sec) const
 
- Protected Member Functions inherited from llvm::object::Binary
 Binary (unsigned int Type, MemoryBuffer *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
MemoryBufferData
 

Detailed Description

Definition at line 52 of file Object/MachO.h.

Constructor & Destructor Documentation

llvm::object::MachOObjectFile::MachOObjectFile ( MemoryBuffer Object,
bool  IsLittleEndian,
bool  Is64Bits,
error_code ec 
)

Member Function Documentation

dice_iterator llvm::object::MachOObjectFile::begin_dices ( ) const
symbol_iterator llvm::object::MachOObjectFile::begin_dynamic_symbols ( ) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 1215 of file MachOObjectFile.cpp.

References llvm::report_fatal_error().

library_iterator llvm::object::MachOObjectFile::begin_libraries_needed ( ) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 1236 of file MachOObjectFile.cpp.

References llvm::report_fatal_error().

section_iterator llvm::object::MachOObjectFile::begin_sections ( ) const
virtual
symbol_iterator llvm::object::MachOObjectFile::begin_symbols ( ) const
virtual
static bool llvm::object::MachOObjectFile::classof ( const Binary v)
inlinestatic

Definition at line 202 of file Object/MachO.h.

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

dice_iterator llvm::object::MachOObjectFile::end_dices ( ) const
symbol_iterator llvm::object::MachOObjectFile::end_dynamic_symbols ( ) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 1220 of file MachOObjectFile.cpp.

References llvm::report_fatal_error().

library_iterator llvm::object::MachOObjectFile::end_libraries_needed ( ) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 1241 of file MachOObjectFile.cpp.

References llvm::report_fatal_error().

section_iterator llvm::object::MachOObjectFile::end_sections ( ) const
virtual
symbol_iterator llvm::object::MachOObjectFile::end_symbols ( ) const
virtual
unsigned llvm::object::MachOObjectFile::getAnyRelocationAddress ( const MachO::any_relocation_info RE) const
unsigned llvm::object::MachOObjectFile::getAnyRelocationLength ( const MachO::any_relocation_info RE) const
unsigned llvm::object::MachOObjectFile::getAnyRelocationPCRel ( const MachO::any_relocation_info RE) const
unsigned llvm::object::MachOObjectFile::getAnyRelocationType ( const MachO::any_relocation_info RE) const
unsigned llvm::object::MachOObjectFile::getArch ( ) const
virtual
Triple::ArchType llvm::object::MachOObjectFile::getArch ( uint32_t  CPUType)
static
uint8_t llvm::object::MachOObjectFile::getBytesInAddress ( ) const
virtual

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

Implements llvm::object::ObjectFile.

Definition at line 1246 of file MachOObjectFile.cpp.

References is64Bit().

MachO::linkedit_data_command llvm::object::MachOObjectFile::getDataInCodeLoadCommand ( ) const

Definition at line 1547 of file MachOObjectFile.cpp.

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

Referenced by begin_dices(), and end_dices().

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

Definition at line 1532 of file MachOObjectFile.cpp.

References llvm::object::getPtr().

MachO::data_in_code_entry llvm::object::MachOObjectFile::getDice ( DataRefImpl  Rel) const
MachO::dysymtab_command llvm::object::MachOObjectFile::getDysymtabLoadCommand ( ) const

Definition at line 1542 of file MachOObjectFile.cpp.

StringRef llvm::object::MachOObjectFile::getFileFormatName ( ) const
virtual
MachOObjectFile::LoadCommandInfo llvm::object::MachOObjectFile::getFirstLoadCommandInfo ( ) const
MachO::mach_header llvm::object::MachOObjectFile::getHeader ( ) const
MachO::mach_header_64 llvm::object::MachOObjectFile::getHeader64 ( ) const

Definition at line 1520 of file MachOObjectFile.cpp.

References llvm::object::getPtr().

uint32_t llvm::object::MachOObjectFile::getIndirectSymbolTableEntry ( const MachO::dysymtab_command DLC,
unsigned  Index 
) const
error_code llvm::object::MachOObjectFile::getLibraryNext ( DataRefImpl  LibData,
LibraryRef Res 
) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 1180 of file MachOObjectFile.cpp.

References llvm::report_fatal_error().

error_code llvm::object::MachOObjectFile::getLibraryPath ( DataRefImpl  LibData,
StringRef Res 
) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 1185 of file MachOObjectFile.cpp.

References llvm::report_fatal_error().

MachO::linkedit_data_command llvm::object::MachOObjectFile::getLinkeditDataLoadCommand ( const LoadCommandInfo L) const
MachO::linker_options_command llvm::object::MachOObjectFile::getLinkerOptionsLoadCommand ( const LoadCommandInfo L) const
StringRef llvm::object::MachOObjectFile::getLoadName ( ) const
virtual

For shared objects, returns the name which this object should be loaded from at runtime. This corresponds to DT_SONAME on ELF and LC_ID_DYLIB (install name) on MachO.

Implements llvm::object::ObjectFile.

Definition at line 1303 of file MachOObjectFile.cpp.

References llvm::report_fatal_error().

MachOObjectFile::LoadCommandInfo llvm::object::MachOObjectFile::getNextLoadCommandInfo ( const LoadCommandInfo L) const
bool llvm::object::MachOObjectFile::getPlainRelocationExternal ( const MachO::any_relocation_info RE) const
unsigned llvm::object::MachOObjectFile::getPlainRelocationSymbolNum ( const MachO::any_relocation_info RE) const
MachO::any_relocation_info llvm::object::MachOObjectFile::getRelocation ( DataRefImpl  Rel) const
error_code llvm::object::MachOObjectFile::getRelocationAddress ( DataRefImpl  Rel,
uint64_t &  Res 
) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 847 of file MachOObjectFile.cpp.

References llvm::report_fatal_error().

error_code llvm::object::MachOObjectFile::getRelocationHidden ( DataRefImpl  Rel,
bool Result 
) const
virtual
error_code llvm::object::MachOObjectFile::getRelocationNext ( DataRefImpl  Rel,
RelocationRef Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getRelocationOffset ( DataRefImpl  Rel,
uint64_t &  Res 
) const
virtual
SectionRef llvm::object::MachOObjectFile::getRelocationSection ( const MachO::any_relocation_info RE) const
symbol_iterator llvm::object::MachOObjectFile::getRelocationSymbol ( DataRefImpl  Rel) const
virtual
error_code llvm::object::MachOObjectFile::getRelocationType ( DataRefImpl  Rel,
uint64_t &  Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getRelocationTypeName ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const
virtual
error_code llvm::object::MachOObjectFile::getRelocationValueString ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const
virtual
bool llvm::object::MachOObjectFile::getScatteredRelocationScattered ( const MachO::any_relocation_info RE) const

Definition at line 1383 of file MachOObjectFile.cpp.

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

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

Definition at line 1388 of file MachOObjectFile.cpp.

References llvm::MachO::any_relocation_info::r_word1.

MachO::section llvm::object::MachOObjectFile::getSection ( DataRefImpl  DRI) const
MachO::section llvm::object::MachOObjectFile::getSection ( const LoadCommandInfo L,
unsigned  Index 
) const

Definition at line 1460 of file MachOObjectFile.cpp.

References llvm::object::getSectionPtr().

MachO::section_64 llvm::object::MachOObjectFile::getSection64 ( DataRefImpl  DRI) const
MachO::section_64 llvm::object::MachOObjectFile::getSection64 ( const LoadCommandInfo L,
unsigned  Index 
) const

Definition at line 1466 of file MachOObjectFile.cpp.

References llvm::object::getSectionPtr().

error_code llvm::object::MachOObjectFile::getSectionAddress ( DataRefImpl  Sec,
uint64_t &  Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getSectionAlignment ( DataRefImpl  Sec,
uint64_t &  Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getSectionContents ( DataRefImpl  Sec,
StringRef Res 
) const
virtual
StringRef llvm::object::MachOObjectFile::getSectionFinalSegmentName ( DataRefImpl  Sec) const
error_code llvm::object::MachOObjectFile::getSectionName ( DataRefImpl  Sec,
StringRef Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getSectionNext ( DataRefImpl  Sec,
SectionRef Res 
) const
virtual
ArrayRef< char > llvm::object::MachOObjectFile::getSectionRawFinalSegmentName ( DataRefImpl  Sec) const
ArrayRef< char > llvm::object::MachOObjectFile::getSectionRawName ( DataRefImpl  Sec) const
error_code llvm::object::MachOObjectFile::getSectionSize ( DataRefImpl  Sec,
uint64_t &  Res 
) const
virtual
MachO::segment_command_64 llvm::object::MachOObjectFile::getSegment64LoadCommand ( const LoadCommandInfo L) const
MachO::segment_command llvm::object::MachOObjectFile::getSegmentLoadCommand ( const LoadCommandInfo L) const
StringRef llvm::object::MachOObjectFile::getStringTableData ( ) const
MachO::nlist_64 llvm::object::MachOObjectFile::getSymbol64TableEntry ( DataRefImpl  DRI) const

Definition at line 1479 of file MachOObjectFile.cpp.

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

Referenced by getSymbolAddress().

error_code llvm::object::MachOObjectFile::getSymbolAddress ( DataRefImpl  Symb,
uint64_t &  Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getSymbolAlignment ( DataRefImpl  Symb,
uint32_t &  Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getSymbolFileOffset ( DataRefImpl  Symb,
uint64_t &  Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getSymbolFlags ( DataRefImpl  Symb,
uint32_t &  Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getSymbolName ( DataRefImpl  Symb,
StringRef Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getSymbolNext ( DataRefImpl  Symb,
SymbolRef Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getSymbolSection ( DataRefImpl  Symb,
section_iterator Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getSymbolSize ( DataRefImpl  Symb,
uint64_t &  Res 
) const
virtual
MachO::nlist llvm::object::MachOObjectFile::getSymbolTableEntry ( DataRefImpl  DRI) const

Definition at line 1473 of file MachOObjectFile.cpp.

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

Referenced by getSymbolAddress().

error_code llvm::object::MachOObjectFile::getSymbolType ( DataRefImpl  Symb,
SymbolRef::Type Res 
) const
virtual
error_code llvm::object::MachOObjectFile::getSymbolValue ( DataRefImpl  Symb,
uint64_t &  Val 
) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 646 of file MachOObjectFile.cpp.

References llvm::report_fatal_error().

MachO::symtab_command llvm::object::MachOObjectFile::getSymtabLoadCommand ( ) const
bool llvm::object::MachOObjectFile::is64Bit ( ) const
bool llvm::object::MachOObjectFile::isRelocationScattered ( const MachO::any_relocation_info RE) const
error_code llvm::object::MachOObjectFile::isSectionBSS ( DataRefImpl  Sec,
bool Res 
) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 737 of file MachOObjectFile.cpp.

References llvm::object::object_error::success.

error_code llvm::object::MachOObjectFile::isSectionData ( DataRefImpl  Sec,
bool Res 
) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 731 of file MachOObjectFile.cpp.

References llvm::object::object_error::success.

error_code llvm::object::MachOObjectFile::isSectionReadOnlyData ( DataRefImpl  Sec,
bool Res 
) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 767 of file MachOObjectFile.cpp.

References llvm::object::object_error::success.

error_code llvm::object::MachOObjectFile::isSectionRequiredForExecution ( DataRefImpl  Sec,
bool Res 
) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 744 of file MachOObjectFile.cpp.

References llvm::object::object_error::success.

error_code llvm::object::MachOObjectFile::isSectionText ( DataRefImpl  Sec,
bool Res 
) const
virtual
error_code llvm::object::MachOObjectFile::isSectionVirtual ( DataRefImpl  Sec,
bool Res 
) const
virtual

Implements llvm::object::ObjectFile.

Definition at line 751 of file MachOObjectFile.cpp.

References llvm::object::object_error::success.

error_code llvm::object::MachOObjectFile::isSectionZeroInit ( DataRefImpl  Sec,
bool Res 
) const
virtual
void llvm::object::MachOObjectFile::ReadULEB128s ( uint64_t  Index,
SmallVectorImpl< uint64_t > &  Out 
) const
relocation_iterator llvm::object::MachOObjectFile::section_rel_begin ( DataRefImpl  Sec) const
virtual
relocation_iterator llvm::object::MachOObjectFile::section_rel_begin ( unsigned  Index) const
relocation_iterator llvm::object::MachOObjectFile::section_rel_end ( DataRefImpl  Sec) const
virtual
relocation_iterator llvm::object::MachOObjectFile::section_rel_end ( unsigned  Index) const
error_code llvm::object::MachOObjectFile::sectionContainsSymbol ( DataRefImpl  Sec,
DataRefImpl  Symb,
bool Result 
) const
virtual

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