LLVM 22.0.0git
|
#include "llvm/Object/ELF.h"
Public Types | |
using | WarningHandler = llvm::function_ref<Error(const Twine &Msg)> |
using | RelsOrRelas = std::pair<std::vector<Elf_Rel>, std::vector<Elf_Rela>> |
Public Member Functions | |
ELFFile (const ELFFile &)=default | |
ELFFile & | operator= (const ELFFile &)=default |
const uint8_t * | base () const |
const uint8_t * | end () 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< std::vector< VerDef > > | getVersionDefinitions (const Elf_Shdr &Sec) const |
Expected< std::vector< VerNeed > > | getVersionDependencies (const Elf_Shdr &Sec, WarningHandler WarnHandler=&defaultWarningHandler) const |
Expected< StringRef > | getSymbolVersionByIndex (uint32_t SymbolVersionIndex, bool &IsDefault, SmallVector< std::optional< VersionEntry >, 0 > &VersionMap, std::optional< bool > IsSymHidden) const |
Expected< StringRef > | getStringTable (const Elf_Shdr &Section, WarningHandler WarnHandler=&defaultWarningHandler) const |
Expected< StringRef > | getStringTableForSymtab (const Elf_Shdr &Section) const |
Expected< StringRef > | getStringTableForSymtab (const Elf_Shdr &Section, Elf_Shdr_Range Sections) const |
Expected< StringRef > | getLinkAsStrtab (const typename ELFT::Shdr &Sec) 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 |
Expected< uint64_t > | getDynSymtabSize () const |
This function determines the number of dynamic symbols. | |
StringRef | getRelocationTypeName (uint32_t Type) const |
void | getRelocationTypeName (uint32_t Type, SmallVectorImpl< char > &Result) const |
uint32_t | getRelativeRelocationType () const |
std::string | getDynamicTagAsString (unsigned Arch, uint64_t Type) const |
std::string | getDynamicTagAsString (uint64_t Type) const |
Expected< const Elf_Sym * > | getRelocationSymbol (const Elf_Rel &Rel, const Elf_Shdr *SymTab) const |
Get the symbol for a given relocation. | |
Expected< SmallVector< std::optional< VersionEntry >, 0 > > | loadVersionMap (const Elf_Shdr *VerNeedSec, const Elf_Shdr *VerDefSec) const |
bool | isLE () const |
bool | isMipsELF64 () const |
bool | isMips64EL () const |
Expected< Elf_Shdr_Range > | sections () const |
Expected< Elf_Dyn_Range > | dynamicEntries () const |
Expected< const uint8_t * > | toMappedAddr (uint64_t VAddr, WarningHandler WarnHandler=&defaultWarningHandler) 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_Relr_Range > | relrs (const Elf_Shdr &Sec) const |
std::vector< Elf_Rel > | decode_relrs (Elf_Relr_Range relrs) const |
Expected< uint64_t > | getCrelHeader (ArrayRef< uint8_t > Content) const |
Expected< RelsOrRelas > | decodeCrel (ArrayRef< uint8_t > Content) const |
Expected< RelsOrRelas > | crels (const Elf_Shdr &Sec) const |
Expected< std::vector< Elf_Rela > > | android_relas (const Elf_Shdr &Sec) const |
Expected< Elf_Phdr_Range > | program_headers () const |
Iterate over program header table. | |
Elf_Note_Iterator | notes_begin (const Elf_Phdr &Phdr, Error &Err) const |
Get an iterator over notes in a program header. | |
Elf_Note_Iterator | notes_begin (const Elf_Shdr &Shdr, Error &Err) const |
Get an iterator over notes in a section. | |
Elf_Note_Iterator | notes_end () const |
Get the end iterator for notes. | |
iterator_range< Elf_Note_Iterator > | notes (const Elf_Phdr &Phdr, Error &Err) const |
Get an iterator range over notes of a program header. | |
iterator_range< Elf_Note_Iterator > | notes (const Elf_Shdr &Shdr, Error &Err) const |
Get an iterator range over notes of a section. | |
Expected< StringRef > | getSectionStringTable (Elf_Shdr_Range Sections, WarningHandler WarnHandler=&defaultWarningHandler) const |
Expected< uint32_t > | getSectionIndex (const Elf_Sym &Sym, Elf_Sym_Range Syms, DataRegion< Elf_Word > ShndxTable) const |
Expected< const Elf_Shdr * > | getSection (const Elf_Sym &Sym, const Elf_Shdr *SymTab, DataRegion< Elf_Word > ShndxTable) const |
Expected< const Elf_Shdr * > | getSection (const Elf_Sym &Sym, Elf_Sym_Range Symtab, DataRegion< 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, WarningHandler WarnHandler=&defaultWarningHandler) 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 |
Expected< ArrayRef< uint8_t > > | getSegmentContents (const Elf_Phdr &Phdr) const |
Expected< std::vector< BBAddrMap > > | decodeBBAddrMap (const Elf_Shdr &Sec, const Elf_Shdr *RelaSec=nullptr, std::vector< PGOAnalysisMap > *PGOAnalyses=nullptr) const |
Returns a vector of BBAddrMap structs corresponding to each function within the text section that the SHT_LLVM_BB_ADDR_MAP section Sec is associated with. | |
Expected< MapVector< const Elf_Shdr *, const Elf_Shdr * > > | getSectionAndRelocations (std::function< Expected< bool >(const Elf_Shdr &)> IsMatch) const |
Returns a map from every section matching IsMatch to its relocation section, or nullptr if it has no relocation section. | |
void | createFakeSections () |
Used by llvm-objdump -d (which needs sections for disassembly) to disassemble objects without a section header table (e.g. |
Static Public Member Functions | |
static Expected< ELFFile > | create (StringRef Object) |
using llvm::object::ELFFile< ELFT >::RelsOrRelas = std::pair<std::vector<Elf_Rel>, std::vector<Elf_Rela>> |
using llvm::object::ELFFile< ELFT >::WarningHandler = llvm::function_ref<Error(const Twine &Msg)> |
|
default |
Referenced by create().
Expected< std::vector< typename ELFT::Rela > > ELFFile::android_relas | ( | const Elf_Shdr & | Sec | ) | const |
Definition at line 454 of file ELF.cpp.
References llvm::object::createError(), llvm::Data, getSectionContents(), I, isLE(), llvm::Offset, llvm::ELF::RELOCATION_GROUP_HAS_ADDEND_FLAG, llvm::ELF::RELOCATION_GROUPED_BY_ADDEND_FLAG, llvm::ELF::RELOCATION_GROUPED_BY_INFO_FLAG, llvm::ELF::RELOCATION_GROUPED_BY_OFFSET_DELTA_FLAG, llvm::ArrayRef< T >::size(), llvm::DataExtractor::Cursor::takeError(), and llvm::Expected< T >::takeError().
|
inline |
Definition at line 271 of file ELF.h.
Referenced by dynamicEntries(), llvm::object::ELFFile< ELF32LE >::end(), llvm::object::ELFFile< ELF32LE >::getHeader(), getSectionContentsAsArray(), getSegmentContents(), llvm::object::ELFFile< ELF32LE >::notes_begin(), llvm::object::ELFFile< ELF32LE >::notes_begin(), llvm::object::ELFFile< ELF32LE >::program_headers(), sections(), and toMappedAddr().
|
static |
Definition at line 893 of file ELF.h.
References llvm::object::createError(), and ELFFile().
Referenced by llvm::object::ELFObjectFile< ELFT >::create().
void llvm::object::ELFFile< ELFT >::createFakeSections | ( | ) |
Used by llvm-objdump -d (which needs sections for disassembly) to disassemble objects without a section header table (e.g.
ET_CORE objects analyzed by linux perf or ET_EXEC with llvm-strip –strip-sections).
Definition at line 904 of file ELF.h.
References llvm::enumerate(), llvm::ELF::PF_X, program_headers(), llvm::ELF::PT_LOAD, llvm::ELF::SHF_ALLOC, llvm::ELF::SHF_EXECINSTR, and llvm::ELF::SHT_PROGBITS.
Expected< typename ELFFile< ELFT >::RelsOrRelas > ELFFile::crels | ( | const Elf_Shdr & | Sec | ) | const |
Definition at line 445 of file ELF.cpp.
References llvm::object::decodeCrel(), getSectionContents(), and llvm::Expected< T >::takeError().
Referenced by decodeBBAddrMapImpl().
std::vector< typename ELFT::Rel > ELFFile::decode_relrs | ( | Elf_Relr_Range | relrs | ) | const |
Expected< std::vector< BBAddrMap > > ELFFile::decodeBBAddrMap | ( | const Elf_Shdr & | Sec, |
const Elf_Shdr * | RelaSec = nullptr, | ||
std::vector< PGOAnalysisMap > * | PGOAnalyses = nullptr ) const |
Returns a vector of BBAddrMap structs corresponding to each function within the text section that the SHT_LLVM_BB_ADDR_MAP section Sec
is associated with.
If the current ELFFile is relocatable, a corresponding RelaSec
must be passed in as an argument. Optional out variable to collect all PGO Analyses. New elements are only added if no error occurs. If not provided, the PGO Analyses are decoded then ignored.
Definition at line 975 of file ELF.cpp.
References decodeBBAddrMapImpl().
Referenced by readBBAddrMapImpl().
Expected< typename ELFFile< ELFT >::RelsOrRelas > ELFFile::decodeCrel | ( | ArrayRef< uint8_t > | Content | ) | const |
Definition at line 414 of file ELF.cpp.
References llvm::Count, llvm::object::decodeCrel(), and I.
Expected< typename ELFT::DynRange > ELFFile::dynamicEntries | ( | ) | const |
Definition at line 611 of file ELF.cpp.
References llvm::ArrayRef(), llvm::ArrayRef< T >::back(), base(), llvm::object::createError(), llvm::ArrayRef< T >::data(), llvm::ArrayRef< T >::empty(), end(), getSectionContentsAsArray(), program_headers(), llvm::ELF::PT_DYNAMIC, sections, llvm::ELF::SHT_DYNAMIC, and llvm::Expected< T >::takeError().
Referenced by llvm::ifs::buildStub(), and getDynSymtabSize().
|
inline |
Definition at line 272 of file ELF.h.
Referenced by dynamicEntries().
|
inline |
Definition at line 274 of file ELF.h.
Referenced by llvm::object::ELFFile< ELF32LE >::end(), llvm::object::ELFFile< ELF32LE >::program_headers(), and toMappedAddr().
Expected< uint64_t > ELFFile::getCrelHeader | ( | ArrayRef< uint8_t > | Content | ) | const |
Definition at line 402 of file ELF.cpp.
References llvm::Data, isLE(), and llvm::Error::success().
std::string ELFFile::getDynamicTagAsString | ( | uint64_t | Type | ) | const |
Definition at line 606 of file ELF.cpp.
References getDynamicTagAsString(), and getHeader().
std::string ELFFile::getDynamicTagAsString | ( | unsigned | Arch, |
uint64_t | Type ) const |
Definition at line 522 of file ELF.cpp.
Referenced by getDynamicTagAsString().
Expected< uint64_t > llvm::object::ELFFile< ELFT >::getDynSymtabSize | ( | ) | const |
This function determines the number of dynamic symbols.
It reads section headers first. If section headers are not available, the number of symbols will be inferred by parsing dynamic hash tables.
Definition at line 830 of file ELF.h.
References llvm::StringRef::bytes_end(), llvm::createStringError(), dynamicEntries(), llvm::Expected< T >::get(), llvm::object::getDynSymtabSizeFromGnuHash(), llvm::object::parse_failed, sections, llvm::ELF::SHT_DYNSYM, llvm::Expected< T >::takeError(), and toMappedAddr().
Referenced by llvm::ifs::buildStub().
Expected< const T * > llvm::object::ELFFile< ELFT >::getEntry | ( | const Elf_Shdr & | Section, |
uint32_t | Entry ) const |
Definition at line 993 of file ELF.h.
References llvm::object::createError(), getSectionContentsAsArray(), llvm::ArrayRef< T >::size(), T, llvm::Expected< T >::takeError(), and llvm::Twine::utohexstr().
Expected< const T * > llvm::object::ELFFile< ELFT >::getEntry | ( | uint32_t | Section, |
uint32_t | Entry ) const |
Definition at line 983 of file ELF.h.
References getEntry(), and llvm::object::getSection().
Referenced by getEntry(), and getRelocationSymbol().
|
inline |
Definition at line 284 of file ELF.h.
Referenced by llvm::ifs::buildStub(), decodeBBAddrMapImpl(), llvm::object::describe(), llvm::offloading::amdgpu::getAMDGPUMetaDataFromImage(), getDynamicTagAsString(), getRelativeRelocationType(), getRelocationTypeName(), getSectionStringTable(), getSHNDXTable(), getStringTable(), llvm::object::ELFFile< ELF32LE >::isLE(), llvm::object::ELFFile< ELF32LE >::isMipsELF64(), llvm::object::ELFFile< ELF32LE >::program_headers(), readBBAddrMapImpl(), and sections().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getLinkAsStrtab | ( | const typename ELFT::Shdr & | Sec | ) | const |
Definition at line 1311 of file ELF.h.
References llvm::object::createError(), llvm::object::describe(), llvm::object::getSection(), getStringTable(), llvm::Expected< T >::takeError(), and llvm::toString().
Referenced by getVersionDefinitions(), and getVersionDependencies().
uint32_t llvm::object::ELFFile< ELFT >::getRelativeRelocationType | ( | ) | const |
Definition at line 718 of file ELF.h.
References llvm::object::getELFRelativeRelocationType(), and 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 761 of file ELF.h.
References getEntry(), and isMips64EL().
StringRef llvm::object::ELFFile< ELFT >::getRelocationTypeName | ( | uint32_t | Type | ) | const |
Definition at line 682 of file ELF.h.
References llvm::object::getELFRelocationTypeName(), and getHeader().
Referenced by getRelocationTypeName().
void llvm::object::ELFFile< ELFT >::getRelocationTypeName | ( | uint32_t | Type, |
SmallVectorImpl< char > & | Result ) const |
Definition at line 687 of file ELF.h.
References getRelocationTypeName(), and isMipsELF64().
Expected< const typename ELFT::Shdr * > llvm::object::ELFFile< ELFT >::getSection | ( | const Elf_Sym & | Sym, |
const Elf_Shdr * | SymTab, | ||
DataRegion< Elf_Word > | ShndxTable ) const |
Definition at line 582 of file ELF.h.
References llvm::object::getSection(), and symbols().
Referenced by readBBAddrMapImpl().
Expected< const typename ELFT::Shdr * > llvm::object::ELFFile< ELFT >::getSection | ( | const Elf_Sym & | Sym, |
Elf_Sym_Range | Symtab, | ||
DataRegion< Elf_Word > | ShndxTable ) const |
Definition at line 592 of file ELF.h.
References llvm::object::getSection(), and getSectionIndex().
Expected< const typename ELFT::Shdr * > llvm::object::ELFFile< ELFT >::getSection | ( | uint32_t | Index | ) | const |
Definition at line 1214 of file ELF.h.
References llvm::object::getSection(), and sections.
Expected< MapVector< const typename ELFT::Shdr *, const typename ELFT::Shdr * > > ELFFile::getSectionAndRelocations | ( | std::function< Expected< bool >(const Elf_Shdr &)> | IsMatch | ) | const |
Returns a map from every section matching IsMatch
to its relocation section, or nullptr
if it has no relocation section.
This function returns an error if any of the IsMatch
calls fail or if it fails to retrieve the content section of any relocation section.
Definition at line 988 of file ELF.cpp.
References llvm::cantFail(), llvm::object::createError(), llvm::object::describe(), llvm::object::getSection(), llvm::joinErrors(), sections, llvm::ELF::SHT_CREL, llvm::ELF::SHT_REL, llvm::ELF::SHT_RELA, llvm::Error::success(), llvm::Expected< T >::takeError(), llvm::toString(), and llvm::MapVector< KeyT, ValueT, MapType, VectorType >::try_emplace().
Referenced by readBBAddrMapImpl().
Expected< ArrayRef< uint8_t > > llvm::object::ELFFile< ELFT >::getSectionContents | ( | const Elf_Shdr & | Sec | ) | const |
Definition at line 677 of file ELF.h.
References getSectionContentsAsArray().
Referenced by android_relas(), crels(), decodeBBAddrMapImpl(), getVersionDefinitions(), and getVersionDependencies().
Expected< ArrayRef< T > > llvm::object::ELFFile< ELFT >::getSectionContentsAsArray | ( | const Elf_Shdr & | Sec | ) | const |
Definition at line 621 of file ELF.h.
References llvm::ArrayRef(), base(), llvm::object::createError(), llvm::object::getSecIndexForError(), llvm::Offset, Size, T, and llvm::Twine::utohexstr().
Referenced by dynamicEntries(), getEntry(), getSectionContents(), getSHNDXTable(), getStringTable(), llvm::object::ELFFile< ELF32LE >::relas(), llvm::object::ELFFile< ELF32LE >::relrs(), llvm::object::ELFFile< ELF32LE >::rels(), and llvm::object::ELFFile< ELF32LE >::symbols().
Expected< uint32_t > llvm::object::ELFFile< ELFT >::getSectionIndex | ( | const Elf_Sym & | Sym, |
Elf_Sym_Range | Syms, | ||
DataRegion< Elf_Word > | ShndxTable ) const |
Definition at line 565 of file ELF.h.
References llvm::object::getExtendedSymbolTableIndex(), llvm::ELF::SHN_LORESERVE, llvm::ELF::SHN_UNDEF, llvm::ELF::SHN_XINDEX, and llvm::Expected< T >::takeError().
Referenced by getSection().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getSectionName | ( | const Elf_Shdr & | Section, |
StringRef | DotShstrtab ) const |
Definition at line 1340 of file ELF.h.
References llvm::object::createError(), llvm::StringRef::data(), llvm::object::getSecIndexForError(), llvm::Offset, llvm::StringRef::size(), and llvm::Twine::utohexstr().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getSectionName | ( | const Elf_Shdr & | Section, |
WarningHandler | WarnHandler = &defaultWarningHandler ) const |
Definition at line 1328 of file ELF.h.
References llvm::dwarf_linker::getSectionName(), getSectionStringTable(), and sections.
Referenced by decodeBBAddrMapImpl().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getSectionStringTable | ( | Elf_Shdr_Range | Sections, |
WarningHandler | WarnHandler = &defaultWarningHandler ) const |
Definition at line 771 of file ELF.h.
References llvm::object::createError(), getHeader(), getStringTable(), and llvm::ELF::SHN_XINDEX.
Referenced by getSectionName().
Expected< ArrayRef< uint8_t > > llvm::object::ELFFile< ELFT >::getSegmentContents | ( | const Elf_Phdr & | Phdr | ) | const |
Definition at line 657 of file ELF.h.
References llvm::ArrayRef(), base(), llvm::object::createError(), llvm::object::getPhdrIndexForError(), llvm::Offset, Size, and llvm::Twine::utohexstr().
Expected< ArrayRef< typename ELFT::Word > > llvm::object::ELFFile< ELFT >::getSHNDXTable | ( | const Elf_Shdr & | Section | ) | const |
Definition at line 1249 of file ELF.h.
References getSHNDXTable(), and sections.
Referenced by getSHNDXTable().
Expected< ArrayRef< typename ELFT::Word > > llvm::object::ELFFile< ELFT >::getSHNDXTable | ( | const Elf_Shdr & | Section, |
Elf_Shdr_Range | Sections ) const |
Definition at line 1258 of file ELF.h.
References assert(), llvm::object::createError(), llvm::object::getELFSectionTypeName(), getHeader(), llvm::object::getSection(), getSectionContentsAsArray(), llvm::ELF::SHT_DYNSYM, llvm::ELF::SHT_SYMTAB, and llvm::ELF::SHT_SYMTAB_SHNDX.
Expected< StringRef > llvm::object::ELFFile< ELFT >::getStringTable | ( | const Elf_Shdr & | Section, |
WarningHandler | WarnHandler = &defaultWarningHandler ) const |
Definition at line 1223 of file ELF.h.
References llvm::object::createError(), llvm::Data, E(), llvm::object::getELFSectionTypeName(), getHeader(), llvm::object::getSecIndexForError(), getSectionContentsAsArray(), and llvm::ELF::SHT_STRTAB.
Referenced by getLinkAsStrtab(), getSectionStringTable(), and getStringTableForSymtab().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getStringTableForSymtab | ( | const Elf_Shdr & | Section | ) | const |
Definition at line 1287 of file ELF.h.
References getStringTableForSymtab(), and sections.
Referenced by getStringTableForSymtab().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getStringTableForSymtab | ( | const Elf_Shdr & | Section, |
Elf_Shdr_Range | Sections ) const |
Definition at line 1296 of file ELF.h.
References llvm::object::createError(), llvm::object::getSection(), getStringTable(), llvm::ELF::SHT_DYNSYM, llvm::ELF::SHT_SYMTAB, and llvm::Expected< T >::takeError().
Expected< const typename ELFT::Sym * > llvm::object::ELFFile< ELFT >::getSymbol | ( | const Elf_Shdr * | Sec, |
uint32_t | Index ) const |
Definition at line 605 of file ELF.h.
References llvm::object::createError(), llvm::object::getSecIndexForError(), and symbols().
Expected< StringRef > llvm::object::ELFFile< ELFT >::getSymbolVersionByIndex | ( | uint32_t | SymbolVersionIndex, |
bool & | IsDefault, | ||
SmallVector< std::optional< VersionEntry >, 0 > & | VersionMap, | ||
std::optional< bool > | IsSymHidden ) const |
Definition at line 1010 of file ELF.h.
References llvm::object::createError(), llvm::ELF::VER_NDX_GLOBAL, llvm::ELF::VER_NDX_LOCAL, llvm::ELF::VERSYM_HIDDEN, and llvm::ELF::VERSYM_VERSION.
Referenced by readDynsymVersionsImpl().
Expected< std::vector< VerDef > > llvm::object::ELFFile< ELFT >::getVersionDefinitions | ( | const Elf_Shdr & | Sec | ) | const |
Definition at line 1039 of file ELF.h.
References llvm::object::VerDef::AuxV, llvm::object::VerDef::Cnt, llvm::object::createError(), D(), llvm::object::describe(), llvm::object::VerDef::Flags, getLinkAsStrtab(), getSectionContents(), llvm::object::VerDef::Hash, I, llvm::object::VerdAux::Name, llvm::object::VerDef::Name, llvm::object::VerDef::Ndx, llvm::object::VerdAux::Offset, llvm::object::VerDef::Offset, llvm::Expected< T >::takeError(), llvm::toString(), llvm::Twine::utohexstr(), llvm::object::VerDef::Version, and llvm::Version.
Referenced by loadVersionMap().
Expected< std::vector< VerNeed > > llvm::object::ELFFile< ELFT >::getVersionDependencies | ( | const Elf_Shdr & | Sec, |
WarningHandler | WarnHandler = &defaultWarningHandler ) const |
Definition at line 1126 of file ELF.h.
References llvm::object::VerNeed::AuxV, llvm::object::VerNeed::Cnt, llvm::object::createError(), llvm::StringRef::data(), llvm::object::describe(), llvm::StringRef::drop_front(), E(), llvm::object::VerNeed::File, llvm::object::VernAux::Flags, getLinkAsStrtab(), getSectionContents(), llvm::object::VernAux::Hash, I, llvm::object::VernAux::Name, llvm::object::VernAux::Offset, llvm::object::VerNeed::Offset, llvm::object::VernAux::Other, llvm::StringRef::size(), llvm::Expected< T >::takeError(), llvm::toString(), llvm::Twine::utohexstr(), llvm::object::VerNeed::Version, and llvm::Version.
Referenced by loadVersionMap().
|
inline |
Definition at line 334 of file ELF.h.
Referenced by android_relas(), decodeBBAddrMapImpl(), getCrelHeader(), and llvm::object::ELFFile< ELF32LE >::isMips64EL().
|
inline |
|
inline |
Definition at line 338 of file ELF.h.
Referenced by getRelocationTypeName(), and llvm::object::ELFFile< ELF32LE >::isMips64EL().
Expected< SmallVector< std::optional< VersionEntry >, 0 > > llvm::object::ELFFile< ELFT >::loadVersionMap | ( | const Elf_Shdr * | VerNeedSec, |
const Elf_Shdr * | VerDefSec ) const |
Definition at line 724 of file ELF.h.
References getVersionDefinitions(), getVersionDependencies(), N, llvm::object::VernAux::Name, llvm::object::VernAux::Other, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::resize(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::Expected< T >::takeError(), llvm::Version, and llvm::ELF::VERSYM_VERSION.
Referenced by readDynsymVersionsImpl().
|
inline |
Get an iterator range over notes of a program header.
The program header must be of type PT_NOTE
.
Phdr | the program header to iterate over. |
Err | [out] an error to support fallible iteration, which should be checked after iteration ends. |
Definition at line 467 of file ELF.h.
Referenced by llvm::offloading::amdgpu::getAMDGPUMetaDataFromImage().
|
inline |
|
inline |
Get an iterator over notes in a program header.
The program header must be of type PT_NOTE
.
Phdr | the program header to iterate over. |
Err | [out] an error to support fallible iteration, which should be checked after iteration ends. |
Definition at line 407 of file ELF.h.
Referenced by llvm::object::ELFFile< ELF32LE >::notes(), and llvm::object::ELFFile< ELF32LE >::notes().
|
inline |
|
inline |
Get the end iterator for notes.
Definition at line 456 of file ELF.h.
Referenced by llvm::object::ELFFile< ELF32LE >::notes(), and llvm::object::ELFFile< ELF32LE >::notes().
|
default |
|
inline |
Iterate over program header table.
Definition at line 381 of file ELF.h.
Referenced by createFakeSections(), dynamicEntries(), llvm::object::getPhdrIndexForError(), and toMappedAddr().
|
inline |
Definition at line 359 of file ELF.h.
Referenced by decodeBBAddrMapImpl().
|
inline |
Definition at line 367 of file ELF.h.
Referenced by decode_relrs().
|
inline |
Expected< typename ELFT::ShdrRange > llvm::object::ELFFile< ELFT >::sections | ( | ) | const |
Definition at line 930 of file ELF.h.
References llvm::ArrayRef(), base(), llvm::object::createError(), llvm::First, getHeader(), UINT64_MAX, and llvm::Twine::utohexstr().
Referenced by llvm::object::describe(), llvm::offloading::amdgpu::getAMDGPUMetaDataFromImage(), llvm::object::getSecIndexForError(), readBBAddrMapImpl(), and readDynsymVersionsImpl().
|
inline |
Definition at line 353 of file ELF.h.
Referenced by getSection(), and getSymbol().
Expected< const uint8_t * > ELFFile::toMappedAddr | ( | uint64_t | VAddr, |
WarningHandler | WarnHandler = &defaultWarningHandler ) const |
Definition at line 663 of file ELF.cpp.
References A(), B(), base(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::object::createError(), getBufSize(), I, llvm::is_sorted(), llvm::Offset, program_headers(), llvm::ELF::PT_LOAD, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::stable_sort(), llvm::upper_bound(), and llvm::Twine::utohexstr().
Referenced by getDynSymtabSize().