LLVM
8.0.1
|
#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_Relr = typename ELFT::Relr |
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_Nhdr = typename ELFT::Nhdr |
using | Elf_Note = typename ELFT::Note |
using | Elf_Note_Iterator = typename ELFT::NoteIterator |
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_Relr_Range = typename ELFT::RelrRange |
using | Elf_Phdr_Range = typename ELFT::PhdrRange |
Static Public Member Functions | |
static Expected< ELFFile > | create (StringRef Object) |
using llvm::object::ELFFile< ELFT >::Elf_Dyn = typename ELFT::Dyn |
using llvm::object::ELFFile< ELFT >::Elf_Dyn_Range = typename ELFT::DynRange |
using llvm::object::ELFFile< ELFT >::Elf_Ehdr = typename ELFT::Ehdr |
using llvm::object::ELFFile< ELFT >::Elf_GnuHash = typename ELFT::GnuHash |
using llvm::object::ELFFile< ELFT >::Elf_Hash = typename ELFT::Hash |
using llvm::object::ELFFile< ELFT >::Elf_Nhdr = typename ELFT::Nhdr |
using llvm::object::ELFFile< ELFT >::Elf_Note = typename ELFT::Note |
using llvm::object::ELFFile< ELFT >::Elf_Note_Iterator = typename ELFT::NoteIterator |
using llvm::object::ELFFile< ELFT >::Elf_Phdr = typename ELFT::Phdr |
using llvm::object::ELFFile< ELFT >::Elf_Phdr_Range = typename ELFT::PhdrRange |
using llvm::object::ELFFile< ELFT >::Elf_Rel = typename ELFT::Rel |
using llvm::object::ELFFile< ELFT >::Elf_Rel_Range = typename ELFT::RelRange |
using llvm::object::ELFFile< ELFT >::Elf_Rela = typename ELFT::Rela |
using llvm::object::ELFFile< ELFT >::Elf_Rela_Range = typename ELFT::RelaRange |
using llvm::object::ELFFile< ELFT >::Elf_Relr = typename ELFT::Relr |
using llvm::object::ELFFile< ELFT >::Elf_Relr_Range = typename ELFT::RelrRange |
using llvm::object::ELFFile< ELFT >::Elf_Shdr = typename ELFT::Shdr |
using llvm::object::ELFFile< ELFT >::Elf_Shdr_Range = typename ELFT::ShdrRange |
using llvm::object::ELFFile< ELFT >::Elf_Sym = typename ELFT::Sym |
using llvm::object::ELFFile< ELFT >::Elf_Sym_Range = typename ELFT::SymRange |
using llvm::object::ELFFile< ELFT >::Elf_Verdaux = typename ELFT::Verdaux |
using llvm::object::ELFFile< ELFT >::Elf_Verdef = typename ELFT::Verdef |
using llvm::object::ELFFile< ELFT >::Elf_Vernaux = typename ELFT::Vernaux |
using llvm::object::ELFFile< ELFT >::Elf_Verneed = typename ELFT::Verneed |
using llvm::object::ELFFile< ELFT >::Elf_Versym = typename ELFT::Versym |
using llvm::object::ELFFile< ELFT >::uintX_t = typename ELFT::uint |
Expected< std::vector< typename ELFT::Rela > > ELFFile::android_relas | ( | const Elf_Shdr * | Sec | ) | const |
Definition at line 348 of file ELF.cpp.
References llvm::Expected< T >::takeError().
Referenced by llvm::object::ELFFile< ELFT >::relrs().
|
inline |
Definition at line 83 of file ELF.h.
References llvm::StringRef::data().
Referenced by llvm::object::ELFFile< ELFT >::getEntry(), llvm::object::ELFFile< ELFT >::getHeader(), llvm::object::ELFFile< ELFT >::program_headers(), and llvm::object::ELFFile< ELFT >::sections().
|
static |
Definition at line 449 of file ELF.h.
References llvm::object::createError(), and llvm::StringRef::size().
Referenced by llvm::object::ELFObjectFile< ELFT >::create(), and llvm::object::ELFFile< ELFT >::getHeader().
Expected< std::vector< typename ELFT::Rela > > ELFFile::decode_relrs | ( | Elf_Relr_Range | relrs | ) | const |
Definition at line 269 of file ELF.cpp.
Referenced by llvm::object::ELFFile< ELFT >::relrs().
Expected< typename ELFT::DynRange > ELFFile::dynamicEntries | ( | ) | const |
Definition at line 484 of file ELF.cpp.
References llvm::ArrayRef< T >::back(), llvm::object::createError(), llvm::ArrayRef< T >::data(), llvm::ArrayRef< T >::empty(), llvm::makeArrayRef(), llvm::ELF::PT_DYNAMIC, llvm::ELF::SHT_DYNAMIC, and llvm::Expected< T >::takeError().
Referenced by llvm::object::ELFFile< ELFT >::isMips64EL().
|
inline |
Definition at line 87 of file ELF.h.
References llvm::StringRef::size().
Referenced by llvm::object::ELFFile< ELFT >::program_headers().
const char * ELFFile::getDynamicTagAsString | ( | unsigned | Arch, |
uint64_t | Type | ||
) | const |
Definition at line 428 of file ELF.cpp.
References llvm::ELF::EM_HEXAGON, llvm::ELF::EM_MIPS, and llvm::ELF::EM_PPC64.
Referenced by llvm::object::ELFFile< ELFT >::getHeader().
Expected< const T * > llvm::object::ELFFile< ELFT >::getEntry | ( | uint32_t | Section, |
uint32_t | Entry | ||
) | const |
Definition at line 495 of file ELF.h.
References llvm::object::ELFFile< ELFT >::getSection().
Referenced by llvm::object::ELFFile< ELFT >::getHeader().
Expected< const T * > llvm::object::ELFFile< ELFT >::getEntry | ( | const Elf_Shdr * | Section, |
uint32_t | Entry | ||
) | const |
Definition at line 505 of file ELF.h.
References llvm::object::ELFFile< ELFT >::base(), llvm::object::createError(), llvm::StringRef::size(), and T.
|
inline |
Definition at line 95 of file ELF.h.
References llvm::object::ELFFile< ELFT >::base(), llvm::object::ELFFile< ELFT >::create(), llvm::object::ELFFile< ELFT >::getDynamicTagAsString(), llvm::object::ELFFile< ELFT >::getEntry(), llvm::object::ELFFile< ELFT >::getRelativeRelocationType(), llvm::object::ELFFile< ELFT >::getRelocationSymbol(), llvm::object::ELFFile< ELFT >::getRelocationTypeName(), llvm::object::ELFFile< ELFT >::getSHNDXTable(), llvm::object::ELFFile< ELFT >::getStringTable(), llvm::object::ELFFile< ELFT >::getStringTableForSymtab(), and llvm::ARMBuildAttrs::Section.
Referenced by llvm::object::ELFObjectFile< ELFT >::getArch(), llvm::object::ELFObjectFile< ELFT >::getFileFormatName(), llvm::object::ELFFile< ELFT >::getRelativeRelocationType(), llvm::object::ELFFile< ELFT >::getRelocationTypeName(), llvm::object::ELFFile< ELFT >::getSectionStringTable(), llvm::object::ELFObjectFile< ELFT >::getStartAddress(), llvm::object::ELFFile< ELFT >::isMips64EL(), llvm::object::ELFFile< ELFT >::isMipsELF64(), llvm::object::ELFObjectFile< ELFT >::isRelocatableObject(), llvm::object::ELFFile< ELFT >::program_headers(), and llvm::object::ELFFile< ELFT >::sections().
uint32_t llvm::object::ELFFile< ELFT >::getRelativeRelocationType | ( | ) | const |
Definition at line 418 of file ELF.h.
References llvm::object::getELFRelativeRelocationType(), and llvm::object::ELFFile< ELFT >::getHeader().
Referenced by llvm::object::ELFFile< ELFT >::getHeader().
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 424 of file ELF.h.
References llvm::object::ELFFile< ELFT >::isMips64EL().
Referenced by llvm::object::ELFFile< ELFT >::getHeader().
StringRef llvm::object::ELFFile< ELFT >::getRelocationTypeName | ( | uint32_t | Type | ) | const |
Definition at line 382 of file ELF.h.
References llvm::object::getELFRelocationTypeName(), and llvm::object::ELFFile< ELFT >::getHeader().
Referenced by llvm::object::ELFFile< ELFT >::getHeader(), and llvm::object::ELFFile< ELFT >::getRelocationTypeName().
void llvm::object::ELFFile< ELFT >::getRelocationTypeName | ( | uint32_t | Type, |
SmallVectorImpl< char > & | Result | ||
) | const |
Definition at line 387 of file ELF.h.
References llvm::SmallVectorImpl< T >::append(), llvm::StringRef::begin(), llvm::StringRef::end(), llvm::object::ELFFile< ELFT >::getRelocationTypeName(), llvm::object::ELFFile< ELFT >::isMipsELF64(), Name, Type2, and Type3.
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 314 of file ELF.h.
References llvm::object::ELFFile< ELFT >::symbols().
Referenced by llvm::object::ELFFile< ELFT >::getEntry(), and llvm::object::ELFFile< ELFT >::getSection().
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 324 of file ELF.h.
References llvm::object::ELFFile< ELFT >::getSection(), and llvm::object::ELFFile< ELFT >::getSectionIndex().
Expected< const typename ELFT::Shdr * > llvm::object::ELFFile< ELFT >::getSection | ( | uint32_t | Index | ) | const |
Definition at line 517 of file ELF.h.
References llvm::object::ELFFile< ELFT >::sections().
Expected< const typename ELFT::Shdr * > llvm::object::ELFFile< ELFT >::getSection | ( | const StringRef | SectionName | ) | const |
Definition at line 526 of file ELF.h.
References llvm::object::createError(), llvm::object::ELFFile< ELFT >::getSectionName(), and llvm::object::ELFFile< ELFT >::sections().
Expected< ArrayRef< uint8_t > > llvm::object::ELFFile< ELFT >::getSectionContents | ( | const Elf_Shdr * | Sec | ) | const |
Expected< ArrayRef< T > > llvm::object::ELFFile< ELFT >::getSectionContentsAsArray | ( | const Elf_Shdr * | Sec | ) | const |
Definition at line 355 of file ELF.h.
References llvm::object::createError(), llvm::max(), Size, and llvm::StringRef::size().
Expected< uint32_t > llvm::object::ELFFile< ELFT >::getSectionIndex | ( | const Elf_Sym * | Sym, |
Elf_Sym_Range | Syms, | ||
ArrayRef< Elf_Word > | ShndxTable | ||
) | const |
Definition at line 297 of file ELF.h.
References llvm::ELF::SHN_LORESERVE, llvm::ELF::SHN_UNDEF, and llvm::ELF::SHN_XINDEX.
Referenced by llvm::object::ELFFile< ELFT >::getSection().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getSectionName | ( | const Elf_Shdr * | Section | ) | const |
Definition at line 611 of file ELF.h.
References llvm::object::ELFFile< ELFT >::getSectionStringTable(), and llvm::object::ELFFile< ELFT >::sections().
Referenced by llvm::object::ELFFile< ELFT >::getSection().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getSectionName | ( | const Elf_Shdr * | Section, |
StringRef | DotShstrtab | ||
) | const |
Definition at line 622 of file ELF.h.
References llvm::object::createError(), llvm::StringRef::data(), and llvm::StringRef::size().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getSectionStringTable | ( | Elf_Shdr_Range | Sections | ) | const |
Definition at line 434 of file ELF.h.
References llvm::object::createError(), llvm::object::ELFFile< ELFT >::getHeader(), llvm::object::ELFFile< ELFT >::getStringTable(), and llvm::ELF::SHN_XINDEX.
Referenced by llvm::object::ELFFile< ELFT >::getSectionName().
Expected< ArrayRef< typename ELFT::Word > > llvm::object::ELFFile< ELFT >::getSHNDXTable | ( | const Elf_Shdr & | Section | ) | const |
Definition at line 558 of file ELF.h.
References llvm::object::ELFFile< ELFT >::sections().
Referenced by llvm::object::ELFFile< ELFT >::getHeader().
Expected< ArrayRef< typename ELFT::Word > > llvm::object::ELFFile< ELFT >::getSHNDXTable | ( | const Elf_Shdr & | Section, |
Elf_Shdr_Range | Sections | ||
) | const |
Definition at line 567 of file ELF.h.
References assert(), llvm::object::createError(), llvm::ARMBuildAttrs::Section, llvm::ELF::SHT_DYNSYM, llvm::ELF::SHT_SYMTAB, llvm::ELF::SHT_SYMTAB_SHNDX, and llvm::ArrayRef< T >::size().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getStringTable | ( | const Elf_Shdr * | Section | ) | const |
Definition at line 542 of file ELF.h.
References llvm::ArrayRef< T >::back(), llvm::ArrayRef< T >::begin(), llvm::object::createError(), llvm::Data, llvm::ArrayRef< T >::empty(), llvm::ARMBuildAttrs::Section, llvm::ELF::SHT_STRTAB, and llvm::ArrayRef< T >::size().
Referenced by llvm::object::ELFFile< ELFT >::getHeader(), llvm::object::ELFFile< ELFT >::getSectionStringTable(), and llvm::object::ELFFile< ELFT >::getStringTableForSymtab().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getStringTableForSymtab | ( | const Elf_Shdr & | Section | ) | const |
Definition at line 588 of file ELF.h.
References llvm::object::ELFFile< ELFT >::sections().
Referenced by llvm::object::ELFFile< ELFT >::getHeader().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getStringTableForSymtab | ( | const Elf_Shdr & | Section, |
Elf_Shdr_Range | Sections | ||
) | const |
Definition at line 597 of file ELF.h.
References llvm::object::createError(), llvm::object::ELFFile< ELFT >::getStringTable(), llvm::ELF::SHT_DYNSYM, and llvm::ELF::SHT_SYMTAB.
Expected< const typename ELFT::Sym * > llvm::object::ELFFile< ELFT >::getSymbol | ( | const Elf_Shdr * | Sec, |
uint32_t | Index | ||
) | const |
Definition at line 345 of file ELF.h.
References llvm::object::ELFFile< ELFT >::symbols().
|
inline |
Definition at line 132 of file ELF.h.
References llvm::object::ELFFile< ELFT >::dynamicEntries(), llvm::ELF::ELFDATA2LSB, llvm::object::ELFFile< ELFT >::getHeader(), llvm::object::ELFFile< ELFT >::isMipsELF64(), llvm::object::ELFFile< ELFT >::sections(), and llvm::object::ELFFile< ELFT >::toMappedAddr().
Referenced by llvm::object::ELFFile< ELFT >::getRelocationSymbol().
|
inline |
Definition at line 127 of file ELF.h.
References llvm::ELF::ELFCLASS64, llvm::ELF::EM_MIPS, and llvm::object::ELFFile< ELFT >::getHeader().
Referenced by llvm::object::ELFFile< ELFT >::getRelocationTypeName(), and llvm::object::ELFFile< ELFT >::isMips64EL().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Iterate over program header table.
Definition at line 166 of file ELF.h.
References llvm::object::ELFFile< ELFT >::base(), llvm::object::createError(), llvm::object::ELFFile< ELFT >::getBufSize(), llvm::object::ELFFile< ELFT >::getHeader(), and llvm::makeArrayRef().
|
inline |
|
inline |
Definition at line 157 of file ELF.h.
References llvm::object::ELFFile< ELFT >::android_relas(), and llvm::object::ELFFile< ELFT >::decode_relrs().
|
inline |
Expected< typename ELFT::ShdrRange > llvm::object::ELFFile< ELFT >::sections | ( | ) | const |
Definition at line 456 of file ELF.h.
References llvm::object::ELFFile< ELFT >::base(), llvm::object::createError(), llvm::object::ELFFile< ELFT >::getHeader(), llvm::makeArrayRef(), llvm::StringRef::size(), and UINT64_MAX.
Referenced by llvm::object::ELFFile< ELFT >::getSection(), llvm::object::ELFFile< ELFT >::getSectionName(), llvm::object::ELFFile< ELFT >::getSHNDXTable(), llvm::object::ELFFile< ELFT >::getStringTableForSymtab(), llvm::object::ELFFile< ELFT >::isMips64EL(), llvm::object::ELFObjectFile< ELFT >::section_begin(), and llvm::object::ELFObjectFile< ELFT >::section_end().
|
inline |
Definition at line 143 of file ELF.h.
Referenced by llvm::object::ELFFile< ELFT >::getSection(), and llvm::object::ELFFile< ELFT >::getSymbol().
Definition at line 538 of file ELF.cpp.
References llvm::SmallVectorTemplateCommon< T >::begin(), llvm::object::createError(), llvm::SmallVectorTemplateCommon< T >::end(), I, llvm::ELF::PT_LOAD, llvm::SmallVectorTemplateBase< T >::push_back(), and llvm::upper_bound().
Referenced by llvm::object::ELFFile< ELFT >::isMips64EL().