LLVM API Documentation
#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, false > | Elf_Rel |
typedef Elf_Rel_Impl< ELFT, true > | Elf_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 T * | getEntry (uint32_t Section, uint32_t Entry) const |
template<typename T > | |
const T * | getEntry (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< StringRef > | getSymbolVersion (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_Ehdr * | getHeader () const |
const Elf_Shdr * | getSection (const Elf_Sym *symb) const |
const Elf_Shdr * | getSection (uint32_t Index) const |
const Elf_Sym * | getSymbol (uint32_t index) const |
ErrorOr< StringRef > | getSymbolName (Elf_Sym_Iter Sym) const |
ErrorOr< StringRef > | getSymbolName (const Elf_Shdr *SymTab, const Elf_Sym *Symb) const |
Get the name of Symb . More... | |
ErrorOr< StringRef > | getSectionName (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 |
Definition at line 51 of file Object/ELF.h.
typedef Elf_Dyn_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Dyn |
Definition at line 126 of file Object/ELF.h.
typedef ELFEntityIterator<const Elf_Dyn> llvm::object::ELFFile< ELFT >::Elf_Dyn_Iter |
Definition at line 135 of file Object/ELF.h.
typedef Elf_Ehdr_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Ehdr |
Definition at line 123 of file Object/ELF.h.
typedef Elf_Phdr_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Phdr |
Definition at line 127 of file Object/ELF.h.
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.
typedef Elf_Rel_Impl<ELFT, false> llvm::object::ELFFile< ELFT >::Elf_Rel |
Definition at line 128 of file Object/ELF.h.
typedef ELFEntityIterator<const Elf_Rel> llvm::object::ELFFile< ELFT >::Elf_Rel_Iter |
Definition at line 137 of file Object/ELF.h.
typedef Elf_Rel_Impl<ELFT, true> llvm::object::ELFFile< ELFT >::Elf_Rela |
Definition at line 129 of file Object/ELF.h.
typedef ELFEntityIterator<const Elf_Rela> llvm::object::ELFFile< ELFT >::Elf_Rela_Iter |
Definition at line 136 of file Object/ELF.h.
typedef Elf_Shdr_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Shdr |
Definition at line 124 of file Object/ELF.h.
typedef ELFEntityIterator<const Elf_Shdr> llvm::object::ELFFile< ELFT >::Elf_Shdr_Iter |
Definition at line 138 of file Object/ELF.h.
typedef Elf_Sym_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Sym |
Definition at line 125 of file Object/ELF.h.
typedef Elf_Verdaux_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Verdaux |
Definition at line 131 of file Object/ELF.h.
typedef Elf_Verdef_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Verdef |
Definition at line 130 of file Object/ELF.h.
typedef Elf_Vernaux_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Vernaux |
Definition at line 133 of file Object/ELF.h.
typedef Elf_Verneed_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Verneed |
Definition at line 132 of file Object/ELF.h.
typedef Elf_Versym_Impl<ELFT> llvm::object::ELFFile< ELFT >::Elf_Versym |
Definition at line 134 of file Object/ELF.h.
typedef conditional<ELFT::Is64Bits, uint64_t, uint32_t>::type llvm::object::ELFFile< ELFT >::uintX_t |
Definition at line 55 of file Object/ELF.h.
llvm::object::ELFFile< ELFT >::ELFFile | ( | MemoryBuffer * | Object, |
error_code & | ec | ||
) |
Definition at line 605 of file Object/ELF.h.
References llvm::object::ELFFile< ELFT >::begin_program_headers(), llvm::object::ELFFile< ELFT >::begin_sections(), llvm::object::ELFFile< ELFT >::begin_symbols(), llvm::object::Elf_Ehdr_Impl< ELFT >::e_shentsize, llvm::object::Elf_Ehdr_Impl< ELFT >::e_shoff, llvm::object::ELFFile< ELFT >::end_program_headers(), llvm::object::ELFFile< ELFT >::end_sections(), llvm::object::ELFFile< ELFT >::end_symbols(), llvm::MemoryBuffer::getBufferSize(), llvm::object::ELFFile< ELFT >::getNumSections(), llvm::object::ELFFile< ELFT >::getSection(), llvm::object::ELFFile< ELFT >::getStringTableIndex(), llvm::ELF::PT_DYNAMIC, llvm::report_fatal_error(), llvm::ELF::SHN_UNDEF, llvm::error_code::success(), and llvm::object::ELFFile< ELFT >::VerifyStrTab().
|
inline |
Definition at line 337 of file Object/ELF.h.
ELFFile< ELFT >::Elf_Dyn_Iter llvm::object::ELFFile< ELFT >::begin_dynamic_table | ( | ) | const |
Definition at line 781 of file Object/ELF.h.
|
inline |
Definition at line 376 of file Object/ELF.h.
References llvm::object::Elf_Ehdr_Impl< ELFT >::e_phentsize, and llvm::object::Elf_Ehdr_Impl< ELFT >::e_phoff.
Referenced by llvm::object::ELFFile< ELFT >::ELFFile().
|
inline |
Definition at line 363 of file Object/ELF.h.
|
inline |
Definition at line 352 of file Object/ELF.h.
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().
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().
|
inline |
Definition at line 344 of file Object/ELF.h.
ELFFile< ELFT >::Elf_Dyn_Iter llvm::object::ELFFile< ELFT >::end_dynamic_table | ( | bool | NULLEnd = false | ) | const |
NULLEnd | use 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.
|
inline |
Definition at line 381 of file Object/ELF.h.
References llvm::object::Elf_Ehdr_Impl< ELFT >::e_phentsize, llvm::object::Elf_Ehdr_Impl< ELFT >::e_phnum, and llvm::object::Elf_Ehdr_Impl< ELFT >::e_phoff.
Referenced by llvm::object::ELFFile< ELFT >::ELFFile().
|
inline |
Definition at line 368 of file Object/ELF.h.
|
inline |
Definition at line 357 of file Object/ELF.h.
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().
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().
const char * llvm::object::ELFFile< ELFT >::getDynamicString | ( | uintX_t | Offset | ) | const |
Definition at line 872 of file Object/ELF.h.
const T * llvm::object::ELFFile< ELFT >::getEntry | ( | uint32_t | Section, |
uint32_t | Entry | ||
) | const |
Definition at line 829 of file Object/ELF.h.
const T * llvm::object::ELFFile< ELFT >::getEntry | ( | const Elf_Shdr * | Section, |
uint32_t | Entry | ||
) | const |
Definition at line 835 of file Object/ELF.h.
|
inline |
Definition at line 391 of file Object/ELF.h.
StringRef llvm::object::ELFFile< ELFT >::getLoadName | ( | ) | const |
Definition at line 810 of file Object/ELF.h.
References llvm::ELF::DT_SONAME.
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().
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.
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.
StringRef llvm::object::ELFFile< ELFT >::getRelocationTypeName | ( | uint32_t | Type | ) | const |
Definition at line 533 of file Object/ELF.h.
References llvm::object::getELFRelocationTypeName().
void llvm::object::ELFFile< ELFT >::getRelocationTypeName | ( | uint32_t | Type, |
SmallVectorImpl< char > & | Result | ||
) | const |
Definition at line 538 of file Object/ELF.h.
References llvm::SmallVectorImpl< T >::append(), llvm::StringRef::begin(), and llvm::StringRef::end().
const ELFFile< ELFT >::Elf_Shdr * llvm::object::ELFFile< ELFT >::getSection | ( | const Elf_Sym * | symb | ) | const |
Definition at line 509 of file Object/ELF.h.
References llvm::ELF::SHN_LORESERVE, and llvm::ELF::SHN_XINDEX.
Referenced by llvm::object::ELFFile< ELFT >::ELFFile().
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().
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.
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.
const char * llvm::object::ELFFile< ELFT >::getString | ( | uint32_t | section, |
uint32_t | offset | ||
) | const |
Definition at line 856 of file Object/ELF.h.
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().
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().
const ELFFile< ELFT >::Elf_Sym * llvm::object::ELFFile< ELFT >::getSymbol | ( | uint32_t | index | ) | const |
Definition at line 519 of file Object/ELF.h.
uint64_t llvm::object::ELFFile< ELFT >::getSymbolIndex | ( | const Elf_Sym * | sym | ) | const |
Definition at line 738 of file Object/ELF.h.
ErrorOr< StringRef > llvm::object::ELFFile< ELFT >::getSymbolName | ( | Elf_Sym_Iter | Sym | ) | const |
Definition at line 879 of file Object/ELF.h.
References llvm::object::ELFFile< ELFT >::Elf_Sym_Iter::isDynamic(), and llvm::object::object_error::parse_failed.
ErrorOr< StringRef > llvm::object::ELFFile< ELFT >::getSymbolName | ( | const Elf_Shdr * | SymTab, |
const Elf_Sym * | Symb | ||
) | const |
Get the name of Symb
.
SymTab | The symbol table section Symb is contained in. |
Symb | The 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.
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.
ErrorOr< StringRef > llvm::object::ELFFile< ELFT >::getSymbolVersion | ( | const Elf_Shdr * | section, |
const Elf_Sym * | Symb, | ||
bool & | IsDefault | ||
) | const |
Definition at line 912 of file Object/ELF.h.
References llvm::StringRef::find(), llvm::StringRef::npos, llvm::object::object_error::parse_failed, llvm::StringRef::size(), llvm::StringRef::substr(), llvm::ELF::VER_NDX_GLOBAL, llvm::ELF::VER_NDX_LOCAL, llvm::ELF::VERSYM_HIDDEN, llvm::ELF::VERSYM_VERSION, and llvm::object::Elf_Versym_Impl< ELFT >::vs_index.
|
inline |
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().