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 (MemoryBufferRef Object, bool IsLittleEndian, bool Is64Bits, std::error_code &EC)
void moveSymbolNext (DataRefImpl &Symb) const override
std::error_code getSymbolName (DataRefImpl Symb, StringRef &Res) const override
std::error_code getIndirectName (DataRefImpl Symb, StringRef &Res) const
std::error_code getSymbolAddress (DataRefImpl Symb, uint64_t &Res) const override
std::error_code getSymbolAlignment (DataRefImpl Symb, uint32_t &Res) const override
std::error_code getSymbolSize (DataRefImpl Symb, uint64_t &Res) const override
std::error_code getSymbolType (DataRefImpl Symb, SymbolRef::Type &Res) const override
uint32_t getSymbolFlags (DataRefImpl Symb) const override
std::error_code getSymbolSection (DataRefImpl Symb, section_iterator &Res) const override
void moveSectionNext (DataRefImpl &Sec) const override
std::error_code getSectionName (DataRefImpl Sec, StringRef &Res) const override
std::error_code getSectionAddress (DataRefImpl Sec, uint64_t &Res) const override
std::error_code getSectionSize (DataRefImpl Sec, uint64_t &Res) const override
std::error_code getSectionContents (DataRefImpl Sec, StringRef &Res) const override
std::error_code getSectionAlignment (DataRefImpl Sec, uint64_t &Res) const override
std::error_code isSectionText (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionData (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionBSS (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionRequiredForExecution (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionVirtual (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionZeroInit (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionReadOnlyData (DataRefImpl Sec, bool &Res) const override
std::error_code sectionContainsSymbol (DataRefImpl Sec, DataRefImpl Symb, bool &Result) const override
relocation_iterator section_rel_begin (DataRefImpl Sec) const override
relocation_iterator section_rel_end (DataRefImpl Sec) const override
void moveRelocationNext (DataRefImpl &Rel) const override
std::error_code getRelocationAddress (DataRefImpl Rel, uint64_t &Res) const override
std::error_code getRelocationOffset (DataRefImpl Rel, uint64_t &Res) const override
symbol_iterator getRelocationSymbol (DataRefImpl Rel) const override
std::error_code getRelocationType (DataRefImpl Rel, uint64_t &Res) const override
std::error_code getRelocationTypeName (DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
std::error_code getRelocationValueString (DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
std::error_code getRelocationHidden (DataRefImpl Rel, bool &Result) const override
std::error_code getLibraryShortNameByIndex (unsigned Index, StringRef &) const
basic_symbol_iterator symbol_begin_impl () const override
basic_symbol_iterator symbol_end_impl () const override
basic_symbol_iterator getSymbolByIndex (unsigned Index) 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
unsigned getArch () const override
Triple getArch (const char **McpuDefault, Triple *ThumbTriple) 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
iterator_range< export_iteratorexports () const
 For use iterating over all exported symbols.
iterator_range< rebase_iteratorrebaseTable () const
 For use iterating over all rebase table entries.
iterator_range< bind_iteratorbindTable () const
 For use iterating over all bind table entries.
iterator_range< bind_iteratorlazyBindTable () const
 For use iterating over all lazy bind table entries.
iterator_range< bind_iteratorweakBindTable () const
 For use iterating over all lazy bind table entries.
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::version_min_command getVersionMinLoadCommand (const LoadCommandInfo &L) 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::source_version_command getSourceVersionCommand (const LoadCommandInfo &L) const
MachO::entry_point_command getEntryPointCommand (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
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
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).
bool hasPageZeroSegment () const

Static Public Member Functions

static iterator_range
< export_iterator
exports (ArrayRef< uint8_t > Trie)
 For use examining a trie not in a MachOObjectFile.
static iterator_range
< rebase_iterator
rebaseTable (ArrayRef< uint8_t > Opcodes, bool is64)
 For use examining rebase opcodes not in a MachOObjectFile.
static iterator_range
< bind_iterator
bindTable (ArrayRef< uint8_t > Opcodes, bool is64, MachOBindEntry::Kind)
 For use examining bind opcodes not in a MachOObjectFile.
static StringRef guessLibraryShortName (StringRef Name, bool &isFramework, StringRef &Suffix)
static Triple::ArchType getArch (uint32_t CPUType)
static Triple getArch (uint32_t CPUType, uint32_t CPUSubType, const char **McpuDefault=nullptr)
static Triple getThumbArch (uint32_t CPUType, uint32_t CPUSubType, const char **McpuDefault=nullptr)
static Triple getArch (uint32_t CPUType, uint32_t CPUSubType, const char **McpuDefault, Triple *ThumbTriple)
static bool isValidArch (StringRef ArchFlag)
static Triple getHostArch ()
static bool classof (const Binary *v)

Detailed Description

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


Constructor & Destructor Documentation

MachOObjectFile::MachOObjectFile ( MemoryBufferRef  Object,
bool  IsLittleEndian,
bool  Is64Bits,
std::error_code &  EC 
)

Member Function Documentation

For use iterating over all bind table entries.

Referenced by lazyBindTable(), and weakBindTable().

For use examining bind opcodes not in a MachOObjectFile.

static bool llvm::object::MachOObjectFile::classof ( const Binary v) [inline, static]

Reimplemented from llvm::object::ObjectFile.

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

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

For use iterating over all exported symbols.

For use examining a trie not in a MachOObjectFile.

Definition at line 1685 of file MachOObjectFile.cpp.

unsigned llvm::object::MachOObjectFile::getArch ( ) const [override, virtual]
Triple llvm::object::MachOObjectFile::getArch ( const char **  McpuDefault,
Triple ThumbTriple 
) const
Triple::ArchType MachOObjectFile::getArch ( uint32_t  CPUType) [static]
static Triple llvm::object::MachOObjectFile::getArch ( uint32_t  CPUType,
uint32_t  CPUSubType,
const char **  McpuDefault = nullptr 
) [static]
Triple MachOObjectFile::getArch ( uint32_t  CPUType,
uint32_t  CPUSubType,
const char **  McpuDefault,
Triple ThumbTriple 
) [static]

Definition at line 1435 of file MachOObjectFile.cpp.

References getArch(), getThumbArch(), and T.

uint8_t MachOObjectFile::getBytesInAddress ( ) const [override, virtual]

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

Implements llvm::object::ObjectFile.

Definition at line 1257 of file MachOObjectFile.cpp.

References is64Bit().

Definition at line 2378 of file MachOObjectFile.cpp.

References getPtr().

Definition at line 2417 of file MachOObjectFile.cpp.

References getPtr().

Definition at line 2450 of file MachOObjectFile.cpp.

References getPtr().

Definition at line 2439 of file MachOObjectFile.cpp.

References getPtr().

Referenced by lazyBindTable().

Definition at line 2406 of file MachOObjectFile.cpp.

References getPtr().

Definition at line 2428 of file MachOObjectFile.cpp.

References getPtr().

Referenced by weakBindTable().

StringRef MachOObjectFile::getFileFormatName ( ) const [override, virtual]

Definition at line 2362 of file MachOObjectFile.cpp.

References getPtr().

Referenced by getCPUType(), getRelocationOffset(), isRelocatableObject(), and MachOObjectFile().

Definition at line 2366 of file MachOObjectFile.cpp.

References getPtr().

Definition at line 1444 of file MachOObjectFile.cpp.

References llvm::sys::getDefaultTargetTriple().

std::error_code MachOObjectFile::getIndirectName ( DataRefImpl  Symb,
StringRef Res 
) const
std::error_code MachOObjectFile::getLibraryShortNameByIndex ( unsigned  Index,
StringRef Res 
) const
std::error_code MachOObjectFile::getRelocationAddress ( DataRefImpl  Rel,
uint64_t &  Res 
) const [override, virtual]
std::error_code MachOObjectFile::getRelocationHidden ( DataRefImpl  Rel,
bool Result 
) const [override, virtual]
std::error_code MachOObjectFile::getRelocationOffset ( DataRefImpl  Rel,
uint64_t &  Res 
) const [override, virtual]
std::error_code MachOObjectFile::getRelocationType ( DataRefImpl  Rel,
uint64_t &  Res 
) const [override, virtual]
std::error_code MachOObjectFile::getRelocationTypeName ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const [override, virtual]
std::error_code MachOObjectFile::getRelocationValueString ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const [override, virtual]

Definition at line 2180 of file MachOObjectFile.cpp.

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

Definition at line 2185 of file MachOObjectFile.cpp.

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

std::error_code MachOObjectFile::getSectionAddress ( DataRefImpl  Sec,
uint64_t &  Res 
) const [override, virtual]
std::error_code MachOObjectFile::getSectionAlignment ( DataRefImpl  Sec,
uint64_t &  Res 
) const [override, virtual]
std::error_code MachOObjectFile::getSectionContents ( DataRefImpl  Sec,
StringRef Res 
) const [override, virtual]
std::error_code MachOObjectFile::getSectionName ( DataRefImpl  Sec,
StringRef Res 
) const [override, virtual]
std::error_code MachOObjectFile::getSectionSize ( DataRefImpl  Sec,
uint64_t &  Res 
) const [override, virtual]

Definition at line 2276 of file MachOObjectFile.cpp.

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

Referenced by getIndirectName(), and getSymbolAddress().

std::error_code MachOObjectFile::getSymbolAddress ( DataRefImpl  Symb,
uint64_t &  Res 
) const [override, virtual]
std::error_code MachOObjectFile::getSymbolAlignment ( DataRefImpl  Symb,
uint32_t &  Res 
) const [override, virtual]
uint32_t MachOObjectFile::getSymbolFlags ( DataRefImpl  Symb) const [override, virtual]
std::error_code MachOObjectFile::getSymbolName ( DataRefImpl  Symb,
StringRef Res 
) const [override, virtual]
std::error_code MachOObjectFile::getSymbolSection ( DataRefImpl  Symb,
section_iterator Res 
) const [override, virtual]
std::error_code MachOObjectFile::getSymbolSize ( DataRefImpl  Symb,
uint64_t &  Res 
) const [override, virtual]

Definition at line 2270 of file MachOObjectFile.cpp.

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

Referenced by getIndirectName(), and getSymbolAddress().

std::error_code MachOObjectFile::getSymbolType ( DataRefImpl  Symb,
SymbolRef::Type Res 
) const [override, virtual]
Triple MachOObjectFile::getThumbArch ( uint32_t  CPUType,
uint32_t  CPUSubType,
const char **  McpuDefault = nullptr 
) [static]
StringRef MachOObjectFile::guessLibraryShortName ( StringRef  Name,
bool isFramework,
StringRef Suffix 
) [static]

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

bool MachOObjectFile::isRelocatableObject ( ) const [override, virtual]

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

Implements llvm::object::ObjectFile.

Definition at line 2484 of file MachOObjectFile.cpp.

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

std::error_code MachOObjectFile::isSectionBSS ( DataRefImpl  Sec,
bool Res 
) const [override, virtual]
std::error_code MachOObjectFile::isSectionData ( DataRefImpl  Sec,
bool Res 
) const [override, virtual]
std::error_code MachOObjectFile::isSectionReadOnlyData ( DataRefImpl  Sec,
bool Res 
) const [override, virtual]

Implements llvm::object::ObjectFile.

Definition at line 608 of file MachOObjectFile.cpp.

References llvm::object::success.

std::error_code MachOObjectFile::isSectionRequiredForExecution ( DataRefImpl  Sec,
bool Res 
) const [override, virtual]

Implements llvm::object::ObjectFile.

Definition at line 585 of file MachOObjectFile.cpp.

References llvm::object::success.

std::error_code MachOObjectFile::isSectionText ( DataRefImpl  Sec,
bool Res 
) const [override, virtual]
std::error_code MachOObjectFile::isSectionVirtual ( DataRefImpl  Sec,
bool Res 
) const [override, virtual]

Implements llvm::object::ObjectFile.

Definition at line 592 of file MachOObjectFile.cpp.

References llvm::object::success.

std::error_code MachOObjectFile::isSectionZeroInit ( DataRefImpl  Sec,
bool Res 
) const [override, virtual]

For use iterating over all lazy bind table entries.

Definition at line 2128 of file MachOObjectFile.cpp.

References bindTable(), getDyldInfoLazyBindOpcodes(), and is64Bit().

void MachOObjectFile::moveRelocationNext ( DataRefImpl Rel) const [override, virtual]
void MachOObjectFile::moveSectionNext ( DataRefImpl Sec) const [override, virtual]
void MachOObjectFile::moveSymbolNext ( DataRefImpl Symb) const [override, virtual]

Implements llvm::object::SymbolicFile.

Definition at line 287 of file MachOObjectFile.cpp.

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

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

For use iterating over all rebase table entries.

iterator_range< rebase_iterator > MachOObjectFile::rebaseTable ( ArrayRef< uint8_t >  Opcodes,
bool  is64 
) [static]

For use examining rebase opcodes not in a MachOObjectFile.

Definition at line 1857 of file MachOObjectFile.cpp.

section_iterator MachOObjectFile::section_begin ( ) const [override, virtual]
section_iterator MachOObjectFile::section_end ( ) const [override, virtual]
std::error_code MachOObjectFile::sectionContainsSymbol ( DataRefImpl  Sec,
DataRefImpl  Symb,
bool Result 
) const [override, virtual]

Implements llvm::object::SymbolicFile.

Definition at line 1213 of file MachOObjectFile.cpp.

References getSymbolByIndex().

For use iterating over all lazy bind table entries.

Definition at line 2133 of file MachOObjectFile.cpp.

References bindTable(), getDyldInfoWeakBindOpcodes(), and is64Bit().


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