LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | List of all members
llvm::object::ELFFile< ELFT > Class Template Reference

#include <ELF.h>

Classes

class  ArchivePointerTypeTraits
 Archive files are 2 byte aligned, so we need this for PointerIntPair to work. More...
 
class  Elf_Sym_Iter
 
class  ELFEntityIterator
 Iterate over constant sized entities. More...
 

Public Types

typedef conditional
< ELFT::Is64Bits, uint64_t,
uint32_t >::type 
uintX_t
 
typedef Elf_Ehdr_Impl< ELFT > Elf_Ehdr
 
typedef Elf_Shdr_Impl< ELFT > Elf_Shdr
 
typedef Elf_Sym_Impl< ELFT > Elf_Sym
 
typedef Elf_Dyn_Impl< ELFT > Elf_Dyn
 
typedef Elf_Phdr_Impl< ELFT > Elf_Phdr
 
typedef Elf_Rel_Impl< ELFT, falseElf_Rel
 
typedef Elf_Rel_Impl< ELFT, trueElf_Rela
 
typedef Elf_Verdef_Impl< ELFT > Elf_Verdef
 
typedef Elf_Verdaux_Impl< ELFT > Elf_Verdaux
 
typedef Elf_Verneed_Impl< ELFT > Elf_Verneed
 
typedef Elf_Vernaux_Impl< ELFT > Elf_Vernaux
 
typedef Elf_Versym_Impl< ELFT > Elf_Versym
 
typedef ELFEntityIterator
< const Elf_Dyn
Elf_Dyn_Iter
 
typedef ELFEntityIterator
< const Elf_Rela
Elf_Rela_Iter
 
typedef ELFEntityIterator
< const Elf_Rel
Elf_Rel_Iter
 
typedef ELFEntityIterator
< const Elf_Shdr
Elf_Shdr_Iter
 
typedef ELFEntityIterator
< const Elf_Phdr
Elf_Phdr_Iter
 Iterate over program header table. More...
 

Public Member Functions

template<typename T >
const TgetEntry (uint32_t Section, uint32_t Entry) const
 
template<typename T >
const TgetEntry (const Elf_Shdr *Section, uint32_t Entry) const
 
const char * getString (uint32_t section, uint32_t offset) const
 
const char * getString (const Elf_Shdr *section, uint32_t offset) const
 
const char * getDynamicString (uintX_t Offset) const
 
ErrorOr< StringRefgetSymbolVersion (const Elf_Shdr *section, const Elf_Sym *Symb, bool &IsDefault) const
 
void VerifyStrTab (const Elf_Shdr *sh) const
 
StringRef getRelocationTypeName (uint32_t Type) const
 
void getRelocationTypeName (uint32_t Type, SmallVectorImpl< char > &Result) const
 
template<class RelT >
std::pair< const Elf_Shdr
*, const Elf_Sym * > 
getRelocationSymbol (const Elf_Shdr *RelSec, const RelT *Rel) const
 Get the symbol table section and symbol for a given relocation. More...
 
 ELFFile (MemoryBuffer *Object, error_code &ec)
 
bool isMips64EL () const
 
Elf_Shdr_Iter begin_sections () const
 
Elf_Shdr_Iter end_sections () const
 
Elf_Sym_Iter begin_symbols () const
 
Elf_Sym_Iter end_symbols () const
 
Elf_Dyn_Iter begin_dynamic_table () const
 
Elf_Dyn_Iter end_dynamic_table (bool NULLEnd=false) const
 
Elf_Sym_Iter begin_dynamic_symbols () const
 
Elf_Sym_Iter end_dynamic_symbols () const
 
Elf_Rela_Iter begin_rela (const Elf_Shdr *sec) const
 
Elf_Rela_Iter end_rela (const Elf_Shdr *sec) const
 
Elf_Rel_Iter begin_rel (const Elf_Shdr *sec) const
 
Elf_Rel_Iter end_rel (const Elf_Shdr *sec) const
 
Elf_Phdr_Iter begin_program_headers () const
 
Elf_Phdr_Iter end_program_headers () const
 
uint64_t getNumSections () const
 
uintX_t getStringTableIndex () const
 
ELF::Elf64_Word getSymbolTableIndex (const Elf_Sym *symb) const
 
const Elf_EhdrgetHeader () const
 
const Elf_ShdrgetSection (const Elf_Sym *symb) const
 
const Elf_ShdrgetSection (uint32_t Index) const
 
const Elf_SymgetSymbol (uint32_t index) const
 
ErrorOr< StringRefgetSymbolName (Elf_Sym_Iter Sym) const
 
ErrorOr< StringRefgetSymbolName (const Elf_Shdr *SymTab, const Elf_Sym *Symb) const
 Get the name of Symb. More...
 
ErrorOr< StringRefgetSectionName (const Elf_Shdr *Section) const
 
uint64_t getSymbolIndex (const Elf_Sym *sym) const
 
ErrorOr< ArrayRef< uint8_t > > getSectionContents (const Elf_Shdr *Sec) const
 
StringRef getLoadName () const
 
template<class RelT >
std::pair< const typename
ELFFile< ELFT >::Elf_Shdr
*, const typename ELFFile
< ELFT >::Elf_Sym * > 
getRelocationSymbol (const Elf_Shdr *Sec, const RelT *Rel) const
 

Detailed Description

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

Definition at line 51 of file Object/ELF.h.

Member Typedef Documentation

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

Definition at line 126 of file Object/ELF.h.

template<class ELFT>
typedef ELFEntityIterator<const Elf_Dyn> llvm::object::ELFFile< ELFT >::Elf_Dyn_Iter

Definition at line 135 of file Object/ELF.h.

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

Definition at line 123 of file Object/ELF.h.

template<class ELFT>
typedef Elf_Phdr_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Phdr

Definition at line 127 of file Object/ELF.h.

template<class ELFT>
typedef ELFEntityIterator<const Elf_Phdr> llvm::object::ELFFile< ELFT >::Elf_Phdr_Iter

Iterate over program header table.

Definition at line 374 of file Object/ELF.h.

template<class ELFT>
typedef Elf_Rel_Impl<ELFT, false> llvm::object::ELFFile< ELFT >::Elf_Rel

Definition at line 128 of file Object/ELF.h.

template<class ELFT>
typedef ELFEntityIterator<const Elf_Rel> llvm::object::ELFFile< ELFT >::Elf_Rel_Iter

Definition at line 137 of file Object/ELF.h.

template<class ELFT>
typedef Elf_Rel_Impl<ELFT, true> llvm::object::ELFFile< ELFT >::Elf_Rela

Definition at line 129 of file Object/ELF.h.

template<class ELFT>
typedef ELFEntityIterator<const Elf_Rela> llvm::object::ELFFile< ELFT >::Elf_Rela_Iter

Definition at line 136 of file Object/ELF.h.

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

Definition at line 124 of file Object/ELF.h.

template<class ELFT>
typedef ELFEntityIterator<const Elf_Shdr> llvm::object::ELFFile< ELFT >::Elf_Shdr_Iter

Definition at line 138 of file Object/ELF.h.

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

Definition at line 125 of file Object/ELF.h.

template<class ELFT>
typedef Elf_Verdaux_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Verdaux

Definition at line 131 of file Object/ELF.h.

template<class ELFT>
typedef Elf_Verdef_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Verdef

Definition at line 130 of file Object/ELF.h.

template<class ELFT>
typedef Elf_Vernaux_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Vernaux

Definition at line 133 of file Object/ELF.h.

template<class ELFT>
typedef Elf_Verneed_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Verneed

Definition at line 132 of file Object/ELF.h.

template<class ELFT>
typedef Elf_Versym_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Versym

Definition at line 134 of file Object/ELF.h.

template<class ELFT>
typedef conditional<ELFT::Is64Bits, uint64_t, uint32_t>::type llvm::object::ELFFile< ELFT >::uintX_t

Definition at line 55 of file Object/ELF.h.

Constructor & Destructor Documentation

template<class ELFT >
llvm::object::ELFFile< ELFT >::ELFFile ( MemoryBuffer Object,
error_code ec 
)

Member Function Documentation

template<class ELFT>
Elf_Sym_Iter llvm::object::ELFFile< ELFT >::begin_dynamic_symbols ( ) const
inline

Definition at line 337 of file Object/ELF.h.

template<class ELFT >
ELFFile< ELFT >::Elf_Dyn_Iter llvm::object::ELFFile< ELFT >::begin_dynamic_table ( ) const

Definition at line 781 of file Object/ELF.h.

template<class ELFT>
Elf_Phdr_Iter llvm::object::ELFFile< ELFT >::begin_program_headers ( ) const
inline
template<class ELFT>
Elf_Rel_Iter llvm::object::ELFFile< ELFT >::begin_rel ( const Elf_Shdr sec) const
inline

Definition at line 363 of file Object/ELF.h.

template<class ELFT>
Elf_Rela_Iter llvm::object::ELFFile< ELFT >::begin_rela ( const Elf_Shdr sec) const
inline

Definition at line 352 of file Object/ELF.h.

template<class ELFT >
ELFFile< ELFT >::Elf_Shdr_Iter llvm::object::ELFFile< ELFT >::begin_sections ( ) const

Definition at line 749 of file Object/ELF.h.

Referenced by llvm::object::ELFFile< ELFT >::ELFFile().

template<class ELFT >
ELFFile< ELFT >::Elf_Sym_Iter llvm::object::ELFFile< ELFT >::begin_symbols ( ) const

Definition at line 762 of file Object/ELF.h.

Referenced by llvm::object::ELFFile< ELFT >::ELFFile().

template<class ELFT>
Elf_Sym_Iter llvm::object::ELFFile< ELFT >::end_dynamic_symbols ( ) const
inline

Definition at line 344 of file Object/ELF.h.

template<class ELFT >
ELFFile< ELFT >::Elf_Dyn_Iter llvm::object::ELFFile< ELFT >::end_dynamic_table ( bool  NULLEnd = false) const
Parameters
NULLEnduse one past the first DT_NULL entry as the end instead of the section size.

Definition at line 790 of file Object/ELF.h.

References llvm::ELF::DT_NULL, and llvm::AArch64ISD::Ret.

template<class ELFT>
Elf_Phdr_Iter llvm::object::ELFFile< ELFT >::end_program_headers ( ) const
inline
template<class ELFT>
Elf_Rel_Iter llvm::object::ELFFile< ELFT >::end_rel ( const Elf_Shdr sec) const
inline

Definition at line 368 of file Object/ELF.h.

template<class ELFT>
Elf_Rela_Iter llvm::object::ELFFile< ELFT >::end_rela ( const Elf_Shdr sec) const
inline

Definition at line 357 of file Object/ELF.h.

template<class ELFT >
ELFFile< ELFT >::Elf_Shdr_Iter llvm::object::ELFFile< ELFT >::end_sections ( ) const

Definition at line 755 of file Object/ELF.h.

Referenced by llvm::object::ELFFile< ELFT >::ELFFile().

template<class ELFT >
ELFFile< ELFT >::Elf_Sym_Iter llvm::object::ELFFile< ELFT >::end_symbols ( ) const

Definition at line 770 of file Object/ELF.h.

Referenced by llvm::object::ELFFile< ELFT >::ELFFile().

template<class ELFT >
const char * llvm::object::ELFFile< ELFT >::getDynamicString ( uintX_t  Offset) const

Definition at line 872 of file Object/ELF.h.

template<class ELFT >
template<typename T >
const T * llvm::object::ELFFile< ELFT >::getEntry ( uint32_t  Section,
uint32_t  Entry 
) const

Definition at line 829 of file Object/ELF.h.

template<class ELFT >
template<typename T >
const T * llvm::object::ELFFile< ELFT >::getEntry ( const Elf_Shdr Section,
uint32_t  Entry 
) const

Definition at line 835 of file Object/ELF.h.

template<class ELFT>
const Elf_Ehdr* llvm::object::ELFFile< ELFT >::getHeader ( ) const
inline

Definition at line 391 of file Object/ELF.h.

template<class ELFT >
StringRef llvm::object::ELFFile< ELFT >::getLoadName ( ) const

Definition at line 810 of file Object/ELF.h.

References llvm::ELF::DT_SONAME.

template<class ELFT >
uint64_t llvm::object::ELFFile< ELFT >::getNumSections ( ) const

Definition at line 584 of file Object/ELF.h.

References llvm::ELF::SHN_UNDEF.

Referenced by llvm::object::ELFFile< ELFT >::ELFFile().

template<class ELFT>
template<class RelT >
std::pair<const Elf_Shdr *, const Elf_Sym *> llvm::object::ELFFile< ELFT >::getRelocationSymbol ( const Elf_Shdr RelSec,
const RelT *  Rel 
) const

Get the symbol table section and symbol for a given relocation.

template<class ELFT>
template<class RelT >
std::pair<const typename ELFFile<ELFT>::Elf_Shdr *, const typename ELFFile<ELFT>::Elf_Sym *> llvm::object::ELFFile< ELFT >::getRelocationSymbol ( const Elf_Shdr Sec,
const RelT *  Rel 
) const

Definition at line 566 of file Object/ELF.h.

template<class ELFT >
StringRef llvm::object::ELFFile< ELFT >::getRelocationTypeName ( uint32_t  Type) const

Definition at line 533 of file Object/ELF.h.

References llvm::object::getELFRelocationTypeName().

template<class ELFT >
void llvm::object::ELFFile< ELFT >::getRelocationTypeName ( uint32_t  Type,
SmallVectorImpl< char > &  Result 
) const
template<class ELFT >
const ELFFile< ELFT >::Elf_Shdr * llvm::object::ELFFile< ELFT >::getSection ( const Elf_Sym symb) const
template<class ELFT >
const ELFFile< ELFT >::Elf_Shdr * llvm::object::ELFFile< ELFT >::getSection ( uint32_t  Index) const

Definition at line 843 of file Object/ELF.h.

References llvm::report_fatal_error().

template<class ELFT >
ErrorOr< ArrayRef< uint8_t > > llvm::object::ELFFile< ELFT >::getSectionContents ( const Elf_Shdr Sec) const

Definition at line 525 of file Object/ELF.h.

References llvm::object::object_error::parse_failed.

template<class ELFT >
ErrorOr< StringRef > llvm::object::ELFFile< ELFT >::getSectionName ( const Elf_Shdr Section) const

Definition at line 905 of file Object/ELF.h.

References llvm::object::object_error::parse_failed.

template<class ELFT >
const char * llvm::object::ELFFile< ELFT >::getString ( uint32_t  section,
uint32_t  offset 
) const

Definition at line 856 of file Object/ELF.h.

template<class ELFT >
const char * llvm::object::ELFFile< ELFT >::getString ( const Elf_Shdr section,
uint32_t  offset 
) const

Definition at line 862 of file Object/ELF.h.

References llvm::report_fatal_error().

template<class ELFT >
ELFFile< ELFT >::uintX_t llvm::object::ELFFile< ELFT >::getStringTableIndex ( ) const

Definition at line 594 of file Object/ELF.h.

References llvm::ELF::SHN_HIRESERVE, and llvm::ELF::SHN_UNDEF.

Referenced by llvm::object::ELFFile< ELFT >::ELFFile().

template<class ELFT >
const ELFFile< ELFT >::Elf_Sym * llvm::object::ELFFile< ELFT >::getSymbol ( uint32_t  index) const

Definition at line 519 of file Object/ELF.h.

template<class ELFT >
uint64_t llvm::object::ELFFile< ELFT >::getSymbolIndex ( const Elf_Sym sym) const

Definition at line 738 of file Object/ELF.h.

template<class ELFT >
ErrorOr< StringRef > llvm::object::ELFFile< ELFT >::getSymbolName ( Elf_Sym_Iter  Sym) const
template<class ELFT >
ErrorOr< StringRef > llvm::object::ELFFile< ELFT >::getSymbolName ( const Elf_Shdr SymTab,
const Elf_Sym Symb 
) const

Get the name of Symb.

Parameters
SymTabThe symbol table section Symb is contained in.
SymbThe symbol to get the name of.

SymTab is used to lookup the string table to use to get the symbol's name.

Definition at line 889 of file Object/ELF.h.

References llvm::object::object_error::parse_failed.

template<class ELFT >
ELF::Elf64_Word llvm::object::ELFFile< ELFT >::getSymbolTableIndex ( const Elf_Sym symb) const

Definition at line 501 of file Object/ELF.h.

References llvm::ELF::SHN_XINDEX.

template<class ELFT >
ErrorOr< StringRef > llvm::object::ELFFile< ELFT >::getSymbolVersion ( const Elf_Shdr section,
const Elf_Sym Symb,
bool IsDefault 
) const
template<class ELFT>
bool llvm::object::ELFFile< ELFT >::isMips64EL ( ) const
inline
template<class ELFT >
void llvm::object::ELFFile< ELFT >::VerifyStrTab ( const Elf_Shdr sh) const

Definition at line 576 of file Object/ELF.h.

References llvm::report_fatal_error().

Referenced by llvm::object::ELFFile< ELFT >::ELFFile().


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