LLVM API Documentation

Classes | Public Member Functions | Static Public Member Functions
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]

List of all members.

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 getSymbolNMTypeChar (DataRefImpl Symb, char &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 getSectionRelBegin (DataRefImpl Sec) const
virtual relocation_iterator getSectionRelEnd (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 error_code getRelocationSymbol (DataRefImpl Rel, SymbolRef &Res) 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.
virtual StringRef getFileFormatName () const
virtual unsigned getArch () const
virtual StringRef getLoadName () const
relocation_iterator getSectionRelBegin (unsigned Index) const
relocation_iterator getSectionRelEnd (unsigned Index) const
StringRef getSectionFinalSegmentName (DataRefImpl Sec) const
ArrayRef< char > getSectionRawName (DataRefImpl Sec) const
ArrayRef< char > getSectionRawFinalSegmentName (DataRefImpl Sec) const
bool isRelocationScattered (const macho::RelocationEntry &RE) const
unsigned getPlainRelocationSymbolNum (const macho::RelocationEntry &RE) const
bool getPlainRelocationExternal (const macho::RelocationEntry &RE) const
bool getScatteredRelocationScattered (const macho::RelocationEntry &RE) const
uint32_t getScatteredRelocationValue (const macho::RelocationEntry &RE) const
unsigned getAnyRelocationAddress (const macho::RelocationEntry &RE) const
unsigned getAnyRelocationPCRel (const macho::RelocationEntry &RE) const
unsigned getAnyRelocationLength (const macho::RelocationEntry &RE) const
unsigned getAnyRelocationType (const macho::RelocationEntry &RE) const
SectionRef getRelocationSection (const macho::RelocationEntry &RE) const
LoadCommandInfo getFirstLoadCommandInfo () const
LoadCommandInfo getNextLoadCommandInfo (const LoadCommandInfo &L) const
macho::Section getSection (DataRefImpl DRI) const
macho::Section64 getSection64 (DataRefImpl DRI) const
macho::Section getSection (const LoadCommandInfo &L, unsigned Index) const
macho::Section64 getSection64 (const LoadCommandInfo &L, unsigned Index) const
macho::SymbolTableEntry getSymbolTableEntry (DataRefImpl DRI) const
macho::Symbol64TableEntry getSymbol64TableEntry (DataRefImpl DRI) const
macho::LinkeditDataLoadCommand getLinkeditDataLoadCommand (const LoadCommandInfo &L) const
macho::SegmentLoadCommand getSegmentLoadCommand (const LoadCommandInfo &L) const
macho::Segment64LoadCommand getSegment64LoadCommand (const LoadCommandInfo &L) const
macho::LinkerOptionsLoadCommand getLinkerOptionsLoadCommand (const LoadCommandInfo &L) const
macho::RelocationEntry getRelocation (DataRefImpl Rel) const
macho::Header getHeader () const
macho::Header64Ext getHeader64Ext () const
macho::IndirectSymbolTableEntry getIndirectSymbolTableEntry (const macho::DysymtabLoadCommand &DLC, unsigned Index) const
macho::DataInCodeTableEntry getDataInCodeTableEntry (uint32_t DataOffset, unsigned Index) const
macho::SymtabLoadCommand getSymtabLoadCommand () const
macho::DysymtabLoadCommand getDysymtabLoadCommand () const
StringRef getStringTableData () const
bool is64Bit () const
void ReadULEB128s (uint64_t Index, SmallVectorImpl< uint64_t > &Out) const

Static Public Member Functions

static bool classof (const Binary *v)

Detailed Description

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


Constructor & Destructor Documentation

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

Member Function Documentation

symbol_iterator llvm::object::MachOObjectFile::begin_dynamic_symbols ( ) const [virtual]

Implements llvm::object::ObjectFile.

Definition at line 1233 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 1254 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) [inline, static]

Reimplemented from llvm::object::ObjectFile.

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

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

symbol_iterator llvm::object::MachOObjectFile::end_dynamic_symbols ( ) const [virtual]

Implements llvm::object::ObjectFile.

Definition at line 1238 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 1259 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::RelocationEntry RE) const
unsigned llvm::object::MachOObjectFile::getAnyRelocationLength ( const macho::RelocationEntry RE) const
unsigned llvm::object::MachOObjectFile::getAnyRelocationPCRel ( const macho::RelocationEntry RE) const
unsigned llvm::object::MachOObjectFile::getAnyRelocationType ( const macho::RelocationEntry RE) const
unsigned llvm::object::MachOObjectFile::getArch ( ) const [virtual]
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 1264 of file MachOObjectFile.cpp.

References is64Bit().

macho::DataInCodeTableEntry llvm::object::MachOObjectFile::getDataInCodeTableEntry ( uint32_t  DataOffset,
unsigned  Index 
) const

Definition at line 1516 of file MachOObjectFile.cpp.

References llvm::object::getPtr().

macho::DysymtabLoadCommand llvm::object::MachOObjectFile::getDysymtabLoadCommand ( ) const

Definition at line 1526 of file MachOObjectFile.cpp.

StringRef llvm::object::MachOObjectFile::getFileFormatName ( ) const [virtual]
MachOObjectFile::LoadCommandInfo llvm::object::MachOObjectFile::getFirstLoadCommandInfo ( ) const
macho::Header llvm::object::MachOObjectFile::getHeader ( ) const

Definition at line 1498 of file MachOObjectFile.cpp.

References llvm::object::getPtr().

Referenced by llvm::object::getCPUType(), and MachOObjectFile().

macho::Header64Ext llvm::object::MachOObjectFile::getHeader64Ext ( ) const

Definition at line 1502 of file MachOObjectFile.cpp.

References llvm::object::getPtr().

macho::IndirectSymbolTableEntry llvm::object::MachOObjectFile::getIndirectSymbolTableEntry ( const macho::DysymtabLoadCommand DLC,
unsigned  Index 
) const
error_code llvm::object::MachOObjectFile::getLibraryNext ( DataRefImpl  LibData,
LibraryRef Res 
) const [virtual]

Implements llvm::object::ObjectFile.

Definition at line 1198 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 1203 of file MachOObjectFile.cpp.

References llvm::report_fatal_error().

macho::LinkeditDataLoadCommand llvm::object::MachOObjectFile::getLinkeditDataLoadCommand ( const LoadCommandInfo L) const
macho::LinkerOptionsLoadCommand 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 1317 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::RelocationEntry RE) const
unsigned llvm::object::MachOObjectFile::getPlainRelocationSymbolNum ( const macho::RelocationEntry RE) const
macho::RelocationEntry 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 861 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::RelocationEntry RE) const
error_code llvm::object::MachOObjectFile::getRelocationSymbol ( DataRefImpl  Rel,
SymbolRef Res 
) 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::RelocationEntry RE) const

Definition at line 1375 of file MachOObjectFile.cpp.

References llvm::object::macho::RelocationEntry::Word0.

uint32_t llvm::object::MachOObjectFile::getScatteredRelocationValue ( const macho::RelocationEntry RE) const

Definition at line 1380 of file MachOObjectFile.cpp.

References llvm::object::macho::RelocationEntry::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 1448 of file MachOObjectFile.cpp.

References llvm::object::getSectionPtr().

macho::Section64 llvm::object::MachOObjectFile::getSection64 ( DataRefImpl  DRI) const
macho::Section64 llvm::object::MachOObjectFile::getSection64 ( const LoadCommandInfo L,
unsigned  Index 
) const

Definition at line 1454 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
relocation_iterator llvm::object::MachOObjectFile::getSectionRelBegin ( DataRefImpl  Sec) const [virtual]
relocation_iterator llvm::object::MachOObjectFile::getSectionRelBegin ( unsigned  Index) const
relocation_iterator llvm::object::MachOObjectFile::getSectionRelEnd ( DataRefImpl  Sec) const [virtual]
relocation_iterator llvm::object::MachOObjectFile::getSectionRelEnd ( unsigned  Index) const
error_code llvm::object::MachOObjectFile::getSectionSize ( DataRefImpl  Sec,
uint64_t &  Res 
) const [virtual]
macho::Segment64LoadCommand llvm::object::MachOObjectFile::getSegment64LoadCommand ( const LoadCommandInfo L) const
macho::SegmentLoadCommand llvm::object::MachOObjectFile::getSegmentLoadCommand ( const LoadCommandInfo L) const
StringRef llvm::object::MachOObjectFile::getStringTableData ( ) const
macho::Symbol64TableEntry llvm::object::MachOObjectFile::getSymbol64TableEntry ( DataRefImpl  DRI) const

Definition at line 1467 of file MachOObjectFile.cpp.

References P, and llvm::object::DataRefImpl::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::getSymbolNMTypeChar ( DataRefImpl  Symb,
char &  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::SymbolTableEntry llvm::object::MachOObjectFile::getSymbolTableEntry ( DataRefImpl  DRI) const

Definition at line 1461 of file MachOObjectFile.cpp.

References P, and llvm::object::DataRefImpl::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 660 of file MachOObjectFile.cpp.

References llvm::report_fatal_error().

macho::SymtabLoadCommand llvm::object::MachOObjectFile::getSymtabLoadCommand ( ) const
bool llvm::object::MachOObjectFile::is64Bit ( ) const
bool llvm::object::MachOObjectFile::isRelocationScattered ( const macho::RelocationEntry RE) const
error_code llvm::object::MachOObjectFile::isSectionBSS ( 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::isSectionData ( DataRefImpl  Sec,
bool Res 
) const [virtual]

Implements llvm::object::ObjectFile.

Definition at line 745 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 781 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 758 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 765 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
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: