LLVM API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
llvm::object::ELFObjectFile< ELFT > Class Template Reference

#include <ELFObjectFile.h>

Inheritance diagram for llvm::object::ELFObjectFile< ELFT >:
Inheritance graph
[legend]
Collaboration diagram for llvm::object::ELFObjectFile< ELFT >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef ELFFile< ELFT >::uintX_t uintX_t
typedef ELFFile< ELFT >::Elf_Sym Elf_Sym
typedef ELFFile< ELFT >::Elf_Shdr Elf_Shdr
typedef ELFFile< ELFT >::Elf_Ehdr Elf_Ehdr
typedef ELFFile< ELFT >::Elf_Rel Elf_Rel
typedef ELFFile< ELFT >::Elf_Rela Elf_Rela
typedef ELFFile< ELFT >::Elf_Dyn Elf_Dyn
typedef ELFFile< ELFT >
::Elf_Sym_Iter 
Elf_Sym_Iter
typedef ELFFile< ELFT >
::Elf_Shdr_Iter 
Elf_Shdr_Iter
typedef ELFFile< ELFT >
::Elf_Dyn_Iter 
Elf_Dyn_Iter

Public Member Functions

 ELFObjectFile (MemoryBufferRef Object, std::error_code &EC)
const Elf_SymgetSymbol (DataRefImpl Symb) const
basic_symbol_iterator symbol_begin_impl () const override
basic_symbol_iterator symbol_end_impl () const override
symbol_iterator dynamic_symbol_begin () const
symbol_iterator dynamic_symbol_end () const
section_iterator section_begin () const override
section_iterator section_end () const override
std::error_code getRelocationAddend (DataRefImpl Rel, int64_t &Res) const override
std::error_code getSymbolVersion (SymbolRef Symb, StringRef &Version, bool &IsDefault) 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
StringRef getLoadName () const
std::error_code getPlatformFlags (unsigned &Result) const override
 Returns platform-specific object flags, if any.
const ELFFile< ELFT > * getELFFile () const
bool isDyldType () const
std::pair< symbol_iterator,
symbol_iterator
getELFDynamicSymbolIterators () const override
bool isRelocatableObject () const override
 True if this is a relocatable object (.o/.obj).

Static Public Member Functions

static bool classof (const Binary *v)

Protected Member Functions

void moveSymbolNext (DataRefImpl &Symb) const override
std::error_code getSymbolName (DataRefImpl Symb, StringRef &Res) const override
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
uint32_t getSymbolFlags (DataRefImpl Symb) const override
std::error_code getSymbolOther (DataRefImpl Symb, uint8_t &Res) const override
std::error_code getSymbolType (DataRefImpl Symb, SymbolRef::Type &Res) 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
section_iterator getRelocatedSection (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
uint64_t getROffset (DataRefImpl Rel) const
StringRef getRelocationTypeName (uint32_t Type) const
const Elf_ShdrgetRelSection (DataRefImpl Rel) const
 Get the relocation section that contains Rel.
const Elf_RelgetRel (DataRefImpl Rel) const
const Elf_RelagetRela (DataRefImpl Rela) const
Elf_Sym_Iter toELFSymIter (DataRefImpl Symb) const
DataRefImpl toDRI (Elf_Sym_Iter Symb) const
Elf_Shdr_Iter toELFShdrIter (DataRefImpl Sec) const
DataRefImpl toDRI (Elf_Shdr_Iter Sec) const
DataRefImpl toDRI (const Elf_Shdr *Sec) const
Elf_Dyn_Iter toELFDynIter (DataRefImpl Dyn) const
DataRefImpl toDRI (Elf_Dyn_Iter Dyn) const

Protected Attributes

ELFFile< ELFT > EF
bool isDyldELFObject

Detailed Description

template<class ELFT>
class llvm::object::ELFObjectFile< ELFT >

Definition at line 52 of file ELFObjectFile.h.


Member Typedef Documentation

template<class ELFT>
typedef ELFFile<ELFT>::Elf_Dyn llvm::object::ELFObjectFile< ELFT >::Elf_Dyn

Definition at line 63 of file ELFObjectFile.h.

template<class ELFT>
typedef ELFFile<ELFT>::Elf_Dyn_Iter llvm::object::ELFObjectFile< ELFT >::Elf_Dyn_Iter

Definition at line 67 of file ELFObjectFile.h.

template<class ELFT>
typedef ELFFile<ELFT>::Elf_Ehdr llvm::object::ELFObjectFile< ELFT >::Elf_Ehdr

Definition at line 60 of file ELFObjectFile.h.

template<class ELFT>
typedef ELFFile<ELFT>::Elf_Rel llvm::object::ELFObjectFile< ELFT >::Elf_Rel

Definition at line 61 of file ELFObjectFile.h.

template<class ELFT>
typedef ELFFile<ELFT>::Elf_Rela llvm::object::ELFObjectFile< ELFT >::Elf_Rela

Definition at line 62 of file ELFObjectFile.h.

template<class ELFT>
typedef ELFFile<ELFT>::Elf_Shdr llvm::object::ELFObjectFile< ELFT >::Elf_Shdr

Definition at line 59 of file ELFObjectFile.h.

template<class ELFT>
typedef ELFFile<ELFT>::Elf_Shdr_Iter llvm::object::ELFObjectFile< ELFT >::Elf_Shdr_Iter

Definition at line 66 of file ELFObjectFile.h.

template<class ELFT>
typedef ELFFile<ELFT>::Elf_Sym llvm::object::ELFObjectFile< ELFT >::Elf_Sym

Definition at line 58 of file ELFObjectFile.h.

template<class ELFT>
typedef ELFFile<ELFT>::Elf_Sym_Iter llvm::object::ELFObjectFile< ELFT >::Elf_Sym_Iter

Definition at line 65 of file ELFObjectFile.h.

template<class ELFT>
typedef ELFFile<ELFT>::uintX_t llvm::object::ELFObjectFile< ELFT >::uintX_t

Definition at line 56 of file ELFObjectFile.h.


Constructor & Destructor Documentation

template<class ELFT >
llvm::object::ELFObjectFile< ELFT >::ELFObjectFile ( MemoryBufferRef  Object,
std::error_code &  EC 
)

Definition at line 800 of file ELFObjectFile.h.


Member Function Documentation

template<class ELFT>
static bool llvm::object::ELFObjectFile< ELFT >::classof ( const Binary v) [inline, static]
template<class ELFT >
symbol_iterator llvm::object::ELFObjectFile< ELFT >::dynamic_symbol_begin ( ) const

Definition at line 819 of file ELFObjectFile.h.

template<class ELFT >
symbol_iterator llvm::object::ELFObjectFile< ELFT >::dynamic_symbol_end ( ) const

Definition at line 824 of file ELFObjectFile.h.

template<class ELFT >
unsigned llvm::object::ELFObjectFile< ELFT >::getArch ( ) const [override, virtual]
template<class ELFT >
uint8_t llvm::object::ELFObjectFile< ELFT >::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 852 of file ELFObjectFile.h.

template<class ELFT >
std::pair< symbol_iterator, symbol_iterator > llvm::object::ELFObjectFile< ELFT >::getELFDynamicSymbolIterators ( ) const [override, virtual]

Implements llvm::object::ELFObjectFileBase.

Definition at line 945 of file ELFObjectFile.h.

template<class ELFT>
const ELFFile<ELFT>* llvm::object::ELFObjectFile< ELFT >::getELFFile ( ) const [inline]

Definition at line 217 of file ELFObjectFile.h.

References llvm::object::ELFObjectFile< ELFT >::EF.

template<class ELFT >
StringRef llvm::object::ELFObjectFile< ELFT >::getFileFormatName ( ) const [override, virtual]
template<class ELFT >
StringRef llvm::object::ELFObjectFile< ELFT >::getLoadName ( ) const

Definition at line 839 of file ELFObjectFile.h.

References llvm::ELF::DT_SONAME.

template<class ELFT>
std::error_code llvm::object::ELFObjectFile< ELFT >::getPlatformFlags ( unsigned Result) const [inline, override, virtual]

Returns platform-specific object flags, if any.

Reimplemented from llvm::object::ObjectFile.

Definition at line 212 of file ELFObjectFile.h.

References llvm::object::ELFObjectFile< ELFT >::EF, and llvm::object::success.

template<class ELFT >
const ELFObjectFile< ELFT >::Elf_Rel * llvm::object::ELFObjectFile< ELFT >::getRel ( DataRefImpl  Rel) const [protected]
template<class ELFT >
const ELFObjectFile< ELFT >::Elf_Rela * llvm::object::ELFObjectFile< ELFT >::getRela ( DataRefImpl  Rela) const [protected]
template<class ELFT >
section_iterator llvm::object::ELFObjectFile< ELFT >::getRelocatedSection ( DataRefImpl  Sec) const [override, protected, virtual]

Reimplemented from llvm::object::ObjectFile.

Definition at line 539 of file ELFObjectFile.h.

References llvm::ELF::ET_REL, llvm::ELF::SHT_REL, and llvm::ELF::SHT_RELA.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getRelocationAddend ( DataRefImpl  Rel,
int64_t &  Res 
) const [override, virtual]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getRelocationAddress ( DataRefImpl  Rel,
uint64_t &  Res 
) const [override, protected, virtual]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getRelocationOffset ( DataRefImpl  Rel,
uint64_t &  Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 615 of file ELFObjectFile.h.

References llvm::ELF::ET_REL, and llvm::object::success.

template<class ELFT >
symbol_iterator llvm::object::ELFObjectFile< ELFT >::getRelocationSymbol ( DataRefImpl  Rel) const [override, protected, virtual]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getRelocationType ( DataRefImpl  Rel,
uint64_t &  Res 
) const [override, protected, virtual]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getRelocationTypeName ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const [override, protected, virtual]
template<class ELFT >
StringRef llvm::object::ELFObjectFile< ELFT >::getRelocationTypeName ( uint32_t  Type) const [protected]

Definition at line 656 of file ELFObjectFile.h.

References llvm::object::getELFRelocationTypeName(), and Type.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getRelocationValueString ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const [override, protected, virtual]
template<class ELFT>
const Elf_Shdr* llvm::object::ELFObjectFile< ELFT >::getRelSection ( DataRefImpl  Rel) const [inline, protected]

Get the relocation section that contains Rel.

Definition at line 131 of file ELFObjectFile.h.

template<class ELFT >
uint64_t llvm::object::ELFObjectFile< ELFT >::getROffset ( DataRefImpl  Rel) const [protected]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSectionAddress ( DataRefImpl  Sec,
uint64_t &  Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 414 of file ELFObjectFile.h.

References llvm::object::success.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSectionAlignment ( DataRefImpl  Sec,
uint64_t &  Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 438 of file ELFObjectFile.h.

References llvm::object::success.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSectionContents ( DataRefImpl  Sec,
StringRef Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 429 of file ELFObjectFile.h.

References llvm::object::success.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSectionName ( DataRefImpl  Sec,
StringRef Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 404 of file ELFObjectFile.h.

References llvm::ErrorOr< T >::getError(), Name, and llvm::object::success.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSectionSize ( DataRefImpl  Sec,
uint64_t &  Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 421 of file ELFObjectFile.h.

References llvm::object::success.

template<class ELFT >
const ELFFile< ELFT >::Elf_Sym * llvm::object::ELFObjectFile< ELFT >::getSymbol ( DataRefImpl  Symb) const

Definition at line 783 of file ELFObjectFile.h.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSymbolAddress ( DataRefImpl  Symb,
uint64_t &  Res 
) const [override, protected, virtual]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSymbolAlignment ( DataRefImpl  Symb,
uint32_t &  Res 
) const [override, protected, virtual]

Reimplemented from llvm::object::ObjectFile.

Definition at line 297 of file ELFObjectFile.h.

References llvm::ELF::SHN_COMMON, and llvm::object::success.

template<class ELFT >
uint32_t llvm::object::ELFObjectFile< ELFT >::getSymbolFlags ( DataRefImpl  Symb) const [override, protected, virtual]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSymbolName ( DataRefImpl  Symb,
StringRef Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 244 of file ELFObjectFile.h.

References llvm::ErrorOr< T >::getError(), Name, and llvm::object::success.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSymbolOther ( DataRefImpl  Symb,
uint8_t &  Res 
) const [override, protected, virtual]

Reimplemented from llvm::object::ObjectFile.

Definition at line 315 of file ELFObjectFile.h.

References llvm::object::success.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSymbolSection ( DataRefImpl  Symb,
section_iterator Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 384 of file ELFObjectFile.h.

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

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSymbolSize ( DataRefImpl  Symb,
uint64_t &  Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 308 of file ELFObjectFile.h.

References llvm::object::success.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSymbolType ( DataRefImpl  Symb,
SymbolRef::Type Res 
) const [override, protected, virtual]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::getSymbolVersion ( SymbolRef  Symb,
StringRef Version,
bool IsDefault 
) const [override, virtual]
template<class ELFT>
bool llvm::object::ELFObjectFile< ELFT >::isDyldType ( ) const [inline]
template<class ELFT >
bool llvm::object::ELFObjectFile< ELFT >::isRelocatableObject ( ) const [override, virtual]

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

Implements llvm::object::ObjectFile.

Definition at line 949 of file ELFObjectFile.h.

References llvm::ELF::ET_REL.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::isSectionBSS ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::isSectionData ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::isSectionReadOnlyData ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::isSectionRequiredForExecution ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 471 of file ELFObjectFile.h.

References llvm::ELF::SHF_ALLOC, and llvm::object::success.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::isSectionText ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 445 of file ELFObjectFile.h.

References llvm::ELF::SHF_EXECINSTR, and llvm::object::success.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::isSectionVirtual ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 478 of file ELFObjectFile.h.

References llvm::ELF::SHT_NOBITS, and llvm::object::success.

template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::isSectionZeroInit ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 485 of file ELFObjectFile.h.

References llvm::ELF::SHT_NOBITS, and llvm::object::success.

template<class ELFT >
void llvm::object::ELFObjectFile< ELFT >::moveRelocationNext ( DataRefImpl Rel) const [override, protected, virtual]
template<class ELFT >
void llvm::object::ELFObjectFile< ELFT >::moveSectionNext ( DataRefImpl Sec) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 399 of file ELFObjectFile.h.

template<class ELFT >
void llvm::object::ELFObjectFile< ELFT >::moveSymbolNext ( DataRefImpl Symb) const [override, protected, virtual]

Implements llvm::object::SymbolicFile.

Definition at line 239 of file ELFObjectFile.h.

template<class ELFT >
section_iterator llvm::object::ELFObjectFile< ELFT >::section_begin ( ) const [override, virtual]

Implements llvm::object::ObjectFile.

Definition at line 829 of file ELFObjectFile.h.

template<class ELFT >
section_iterator llvm::object::ELFObjectFile< ELFT >::section_end ( ) const [override, virtual]

Implements llvm::object::ObjectFile.

Definition at line 834 of file ELFObjectFile.h.

template<class ELFT >
relocation_iterator llvm::object::ELFObjectFile< ELFT >::section_rel_begin ( DataRefImpl  Sec) const [override, protected, virtual]
template<class ELFT >
relocation_iterator llvm::object::ELFObjectFile< ELFT >::section_rel_end ( DataRefImpl  Sec) const [override, protected, virtual]
template<class ELFT >
std::error_code llvm::object::ELFObjectFile< ELFT >::sectionContainsSymbol ( DataRefImpl  Sec,
DataRefImpl  Symb,
bool Result 
) const [override, protected, virtual]
template<class ELFT >
basic_symbol_iterator llvm::object::ELFObjectFile< ELFT >::symbol_begin_impl ( ) const [override, virtual]

Implements llvm::object::SymbolicFile.

Definition at line 809 of file ELFObjectFile.h.

template<class ELFT >
basic_symbol_iterator llvm::object::ELFObjectFile< ELFT >::symbol_end_impl ( ) const [override, virtual]

Implements llvm::object::SymbolicFile.

Definition at line 814 of file ELFObjectFile.h.

template<class ELFT>
DataRefImpl llvm::object::ELFObjectFile< ELFT >::toDRI ( Elf_Sym_Iter  Symb) const [inline, protected]
template<class ELFT>
DataRefImpl llvm::object::ELFObjectFile< ELFT >::toDRI ( Elf_Shdr_Iter  Sec) const [inline, protected]
template<class ELFT>
DataRefImpl llvm::object::ELFObjectFile< ELFT >::toDRI ( const Elf_Shdr Sec) const [inline, protected]

Definition at line 166 of file ELFObjectFile.h.

References llvm::object::DataRefImpl::p.

template<class ELFT>
DataRefImpl llvm::object::ELFObjectFile< ELFT >::toDRI ( Elf_Dyn_Iter  Dyn) const [inline, protected]
template<class ELFT>
Elf_Dyn_Iter llvm::object::ELFObjectFile< ELFT >::toELFDynIter ( DataRefImpl  Dyn) const [inline, protected]
template<class ELFT>
Elf_Shdr_Iter llvm::object::ELFObjectFile< ELFT >::toELFShdrIter ( DataRefImpl  Sec) const [inline, protected]
template<class ELFT>
Elf_Sym_Iter llvm::object::ELFObjectFile< ELFT >::toELFSymIter ( DataRefImpl  Symb) const [inline, protected]

Member Data Documentation

template<class ELFT>
ELFFile<ELFT> llvm::object::ELFObjectFile< ELFT >::EF [protected]
template<class ELFT>
bool llvm::object::ELFObjectFile< ELFT >::isDyldELFObject [protected]

Definition at line 186 of file ELFObjectFile.h.

Referenced by llvm::object::ELFObjectFile< ELFT >::isDyldType().


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