LLVM  4.0.0
Public Types | Public Member Functions | List of all members
llvm::object::ELFFile< ELFT > Class Template Reference

#include <ELF.h>

Public Types

typedef ELFT::uint uintX_t
 
typedef ELFT::Ehdr Elf_Ehdr
 
typedef ELFT::Shdr Elf_Shdr
 
typedef ELFT::Sym Elf_Sym
 
typedef ELFT::Dyn Elf_Dyn
 
typedef ELFT::Phdr Elf_Phdr
 
typedef ELFT::Rel Elf_Rel
 
typedef ELFT::Rela Elf_Rela
 
typedef ELFT::Verdef Elf_Verdef
 
typedef ELFT::Verdaux Elf_Verdaux
 
typedef ELFT::Verneed Elf_Verneed
 
typedef ELFT::Vernaux Elf_Vernaux
 
typedef ELFT::Versym Elf_Versym
 
typedef ELFT::Hash Elf_Hash
 
typedef ELFT::GnuHash Elf_GnuHash
 
typedef ELFT::DynRange Elf_Dyn_Range
 
typedef ELFT::ShdrRange Elf_Shdr_Range
 
typedef ELFT::SymRange Elf_Sym_Range
 
typedef ELFT::RelRange Elf_Rel_Range
 
typedef ELFT::RelaRange Elf_Rela_Range
 
typedef ELFT::PhdrRange Elf_Phdr_Range
 

Public Member Functions

const uint8_t * base () const
 
size_t getBufSize () const
 
const Elf_EhdrgetHeader () const
 
template<typename T >
Expected< const T * > getEntry (uint32_t Section, uint32_t Entry) const
 
template<typename T >
Expected< const T * > getEntry (const Elf_Shdr *Section, uint32_t Entry) const
 
Expected< StringRefgetStringTable (const Elf_Shdr *Section) const
 
Expected< StringRefgetStringTableForSymtab (const Elf_Shdr &Section) const
 
Expected< StringRefgetStringTableForSymtab (const Elf_Shdr &Section, Elf_Shdr_Range Sections) const
 
Expected< ArrayRef< Elf_Word > > getSHNDXTable (const Elf_Shdr &Section) const
 
Expected< ArrayRef< Elf_Word > > getSHNDXTable (const Elf_Shdr &Section, Elf_Shdr_Range Sections) const
 
void VerifyStrTab (const Elf_Shdr *sh) const
 
StringRef getRelocationTypeName (uint32_t Type) const
 
void getRelocationTypeName (uint32_t Type, SmallVectorImpl< char > &Result) const
 
Expected< const Elf_Sym * > getRelocationSymbol (const Elf_Rel *Rel, const Elf_Shdr *SymTab) const
 Get the symbol for a given relocation. More...
 
 ELFFile (StringRef Object)
 
bool isMipsELF64 () const
 
bool isMips64EL () const
 
Expected< Elf_Shdr_Rangesections () const
 
Expected< Elf_Sym_Rangesymbols (const Elf_Shdr *Sec) const
 
Expected< Elf_Rela_Rangerelas (const Elf_Shdr *Sec) const
 
Expected< Elf_Rel_Rangerels (const Elf_Shdr *Sec) const
 
Expected< Elf_Phdr_Rangeprogram_headers () const
 Iterate over program header table. More...
 
Expected< StringRefgetSectionStringTable (Elf_Shdr_Range Sections) const
 
Expected< uint32_tgetSectionIndex (const Elf_Sym *Sym, Elf_Sym_Range Syms, ArrayRef< Elf_Word > ShndxTable) const
 
Expected< const Elf_Shdr * > getSection (const Elf_Sym *Sym, const Elf_Shdr *SymTab, ArrayRef< Elf_Word > ShndxTable) const
 
Expected< const Elf_Shdr * > getSection (const Elf_Sym *Sym, Elf_Sym_Range Symtab, ArrayRef< Elf_Word > ShndxTable) const
 
Expected< const Elf_Shdr * > getSection (uint32_t Index) const
 
Expected< const Elf_Sym * > getSymbol (const Elf_Shdr *Sec, uint32_t Index) const
 
Expected< StringRefgetSectionName (const Elf_Shdr *Section) const
 
Expected< StringRefgetSectionName (const Elf_Shdr *Section, StringRef DotShstrtab) const
 
template<typename T >
Expected< ArrayRef< T > > getSectionContentsAsArray (const Elf_Shdr *Sec) const
 
Expected< ArrayRef< uint8_t > > getSectionContents (const Elf_Shdr *Sec) const
 

Detailed Description

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

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

Member Typedef Documentation

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

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

template<class ELFT>
typedef ELFT::DynRange llvm::object::ELFFile< ELFT >::Elf_Dyn_Range

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

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

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

template<class ELFT>
typedef ELFT::GnuHash llvm::object::ELFFile< ELFT >::Elf_GnuHash

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

template<class ELFT>
typedef ELFT::Hash llvm::object::ELFFile< ELFT >::Elf_Hash

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

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

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

template<class ELFT>
typedef ELFT::PhdrRange llvm::object::ELFFile< ELFT >::Elf_Phdr_Range

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

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

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

template<class ELFT>
typedef ELFT::RelRange llvm::object::ELFFile< ELFT >::Elf_Rel_Range

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

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

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

template<class ELFT>
typedef ELFT::RelaRange llvm::object::ELFFile< ELFT >::Elf_Rela_Range

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

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

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

template<class ELFT>
typedef ELFT::ShdrRange llvm::object::ELFFile< ELFT >::Elf_Shdr_Range

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

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

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

template<class ELFT>
typedef ELFT::SymRange llvm::object::ELFFile< ELFT >::Elf_Sym_Range

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

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

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

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

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

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

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

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

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

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

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

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

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

Constructor & Destructor Documentation

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

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

References assert(), and llvm::StringRef::size().

Member Function Documentation

template<class ELFT>
const uint8_t* llvm::object::ELFFile< ELFT >::base ( ) const
inline
template<class ELFT>
size_t llvm::object::ELFFile< ELFT >::getBufSize ( ) const
inline

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

References llvm::StringRef::size().

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

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

References llvm::object::getSection().

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

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

References llvm::object::createError(), and T.

template<class ELFT>
const Elf_Ehdr* llvm::object::ELFFile< ELFT >::getHeader ( ) const
inline
template<class ELFT >
Expected< const typename ELFT::Sym * > llvm::object::ELFFile< ELFT >::getRelocationSymbol ( const Elf_Rel Rel,
const Elf_Shdr SymTab 
) const

Get the symbol for a given relocation.

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

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

Definition at line 278 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 >
Expected< const typename ELFT::Shdr * > llvm::object::ELFFile< ELFT >::getSection ( const Elf_Sym Sym,
const Elf_Shdr SymTab,
ArrayRef< Elf_Word >  ShndxTable 
) const

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

References llvm::object::getSection().

template<class ELFT >
Expected< const typename ELFT::Shdr * > llvm::object::ELFFile< ELFT >::getSection ( const Elf_Sym Sym,
Elf_Sym_Range  Symtab,
ArrayRef< Elf_Word >  ShndxTable 
) const

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

template<class ELFT >
Expected< const typename ELFT::Shdr * > llvm::object::ELFFile< ELFT >::getSection ( uint32_t  Index) const

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

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

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

template<class ELFT >
template<typename T >
Expected< ArrayRef< T > > llvm::object::ELFFile< ELFT >::getSectionContentsAsArray ( const Elf_Shdr Sec) const

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

References llvm::object::createError(), llvm::makeArrayRef(), and Offset.

template<class ELFT >
Expected< uint32_t > llvm::object::ELFFile< ELFT >::getSectionIndex ( const Elf_Sym Sym,
Elf_Sym_Range  Syms,
ArrayRef< Elf_Word >  ShndxTable 
) const
template<class ELFT >
Expected< StringRef > llvm::object::ELFFile< ELFT >::getSectionName ( const Elf_Shdr Section) const

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

template<class ELFT >
Expected< StringRef > llvm::object::ELFFile< ELFT >::getSectionName ( const Elf_Shdr Section,
StringRef  DotShstrtab 
) const
template<class ELFT >
Expected< StringRef > llvm::object::ELFFile< ELFT >::getSectionStringTable ( Elf_Shdr_Range  Sections) const

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

References llvm::object::createError(), and llvm::ELF::SHN_XINDEX.

template<class ELFT >
Expected< ArrayRef< typename ELFT::Word > > llvm::object::ELFFile< ELFT >::getSHNDXTable ( const Elf_Shdr Section) const

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

template<class ELFT >
Expected< ArrayRef< typename ELFT::Word > > llvm::object::ELFFile< ELFT >::getSHNDXTable ( const Elf_Shdr Section,
Elf_Shdr_Range  Sections 
) const
template<class ELFT >
Expected< StringRef > llvm::object::ELFFile< ELFT >::getStringTable ( const Elf_Shdr Section) const
template<class ELFT >
Expected< StringRef > llvm::object::ELFFile< ELFT >::getStringTableForSymtab ( const Elf_Shdr Section) const

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

template<class ELFT >
Expected< StringRef > llvm::object::ELFFile< ELFT >::getStringTableForSymtab ( const Elf_Shdr Section,
Elf_Shdr_Range  Sections 
) const
template<class ELFT >
Expected< const typename ELFT::Sym * > llvm::object::ELFFile< ELFT >::getSymbol ( const Elf_Shdr Sec,
uint32_t  Index 
) const

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

template<class ELFT>
bool llvm::object::ELFFile< ELFT >::isMips64EL ( ) const
inline
template<class ELFT>
bool llvm::object::ELFFile< ELFT >::isMipsELF64 ( ) const
inline
template<class ELFT>
Expected<Elf_Phdr_Range> llvm::object::ELFFile< ELFT >::program_headers ( ) const
inline
template<class ELFT>
Expected<Elf_Rela_Range> llvm::object::ELFFile< ELFT >::relas ( const Elf_Shdr Sec) const
inline

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

template<class ELFT>
Expected<Elf_Rel_Range> llvm::object::ELFFile< ELFT >::rels ( const Elf_Shdr Sec) const
inline

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

template<class ELFT >
Expected< typename ELFT::ShdrRange > llvm::object::ELFFile< ELFT >::sections ( ) const

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

References llvm::object::createError(), and llvm::makeArrayRef().

template<class ELFT>
Expected<Elf_Sym_Range> llvm::object::ELFFile< ELFT >::symbols ( const Elf_Shdr Sec) const
inline

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

template<class ELFT>
void llvm::object::ELFFile< ELFT >::VerifyStrTab ( const Elf_Shdr sh) const

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