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

#include "llvm/Object/ELF.h"

Public Types

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

Public Member Functions

const uint8_t * base () const
 
size_t getBufSize () const
 
const Elf_Ehdr * getHeader () 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< StringRef > getStringTable (const Elf_Shdr *Section) const
 
Expected< StringRef > getStringTableForSymtab (const Elf_Shdr &Section) const
 
Expected< StringRef > getStringTableForSymtab (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_Range > sections () const
 
Expected< Elf_Sym_Range > symbols (const Elf_Shdr *Sec) const
 
Expected< Elf_Rela_Range > relas (const Elf_Shdr *Sec) const
 
Expected< Elf_Rel_Range > rels (const Elf_Shdr *Sec) const
 
Expected< Elf_Phdr_Range > program_headers () const
 Iterate over program header table. More...
 
Expected< StringRef > getSectionStringTable (Elf_Shdr_Range Sections) const
 
Expected< uint32_t > getSectionIndex (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< StringRef > getSectionName (const Elf_Shdr *Section) const
 
Expected< StringRef > getSectionName (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 52 of file ELF.h.

Member Typedef Documentation

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Dyn = typename ELFT::Dyn

Definition at line 59 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Dyn_Range = typename ELFT::DynRange

Definition at line 70 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Ehdr = typename ELFT::Ehdr

Definition at line 56 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_GnuHash = typename ELFT::GnuHash

Definition at line 69 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Hash = typename ELFT::Hash

Definition at line 68 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Phdr = typename ELFT::Phdr

Definition at line 60 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Phdr_Range = typename ELFT::PhdrRange

Definition at line 75 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Rel = typename ELFT::Rel

Definition at line 61 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Rel_Range = typename ELFT::RelRange

Definition at line 73 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Rela = typename ELFT::Rela

Definition at line 62 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Rela_Range = typename ELFT::RelaRange

Definition at line 74 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Shdr = typename ELFT::Shdr

Definition at line 57 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Shdr_Range = typename ELFT::ShdrRange

Definition at line 71 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Sym = typename ELFT::Sym

Definition at line 58 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Sym_Range = typename ELFT::SymRange

Definition at line 72 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Verdaux = typename ELFT::Verdaux

Definition at line 64 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Verdef = typename ELFT::Verdef

Definition at line 63 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Vernaux = typename ELFT::Vernaux

Definition at line 66 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Verneed = typename ELFT::Verneed

Definition at line 65 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::Elf_Versym = typename ELFT::Versym

Definition at line 67 of file ELF.h.

template<class ELFT>
using llvm::object::ELFFile< ELFT >::uintX_t = typename ELFT::uint

Definition at line 55 of file ELF.h.

Constructor & Destructor Documentation

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

Definition at line 345 of file 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 81 of file 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 394 of file 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 404 of file 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 322 of file ELF.h.

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

Definition at line 285 of file 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 220 of file 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 230 of file ELF.h.

References llvm::object::getSection().

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

Definition at line 416 of file ELF.h.

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

Definition at line 280 of file ELF.h.

template<class ELFT >
template<typename T >
Expected< ArrayRef< T > > llvm::object::ELFFile< ELFT >::getSectionContentsAsArray ( const Elf_Shdr *  Sec) const
template<class ELFT >
Expected< uint32_t > llvm::object::ELFFile< ELFT >::getSectionIndex ( const Elf_Sym *  Sym,
Elf_Sym_Range  Syms,
ArrayRef< Elf_Word >  ShndxTable 
) const

Definition at line 203 of file ELF.h.

References llvm::ELF::SHN_LORESERVE, llvm::ELF::SHN_UNDEF, and llvm::ELF::SHN_XINDEX.

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

Definition at line 494 of file 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 332 of file 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 441 of file 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 471 of file ELF.h.

template<class ELFT >
Expected< StringRef > llvm::object::ELFFile< ELFT >::getStringTableForSymtab ( const Elf_Shdr &  Section,
Elf_Shdr_Range  Sections 
) const

Definition at line 480 of file ELF.h.

References llvm::object::createError(), llvm::ELF::SHT_DYNSYM, and llvm::ELF::SHT_SYMTAB.

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

Definition at line 251 of file 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 135 of file ELF.h.

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

Definition at line 139 of file ELF.h.

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

Definition at line 355 of file 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 129 of file 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: