17 #ifndef FOLLY_EXPERIMENTAL_SYMBOLIZER_ELF_H_ 18 #error This file must be included from Elf.h 22 namespace symbolizer {
34 for (
size_t i = 0;
i <
elfHeader().e_phnum;
i++, ptr++) {
52 for (
size_t i = 0;
i <
elfHeader().e_shnum;
i++, ptr++) {
63 [&](
const ElfShdr& sh) {
return sh.sh_type == type && fn(sh); });
68 std::initializer_list<uint32_t> types,
71 auto const it = std::find(types.begin(), types.end(), sh.sh_type);
72 return it != types.end() && fn(sh);
80 const char*
start =
file_ + stringTable.sh_offset;
81 const char*
end = start + stringTable.sh_size;
84 while (ptr != end && !fn(ptr)) {
85 ptr += strlen(ptr) + 1;
88 return ptr != end ? ptr :
nullptr;
94 section.sh_entsize ==
sizeof(
ElfSym),
95 "invalid entry size in symbol table");
97 const ElfSym* sym = &at<ElfSym>(section.sh_offset);
98 const ElfSym*
end = sym + (section.sh_size / section.sh_entsize);
118 return ELF32_ST_TYPE(sym.st_info) == type && fn(sym);
125 std::initializer_list<uint32_t> types,
129 auto const elfType = ELF32_ST_TYPE(sym.st_info);
130 auto const it = std::find(types.begin(), types.end(), elfType);
131 return it != types.end() && fn(sym);
const ElfShdr * iterateSectionsWithTypes(std::initializer_list< uint32_t > types, Fn fn) const
const ElfPhdr * iterateProgramHeaders(Fn fn) const
const ElfShdr * iterateSectionsWithType(uint32_t type, Fn fn) const
—— Concurrent Priority Queue Implementation ——
const ElfShdr * iterateSections(Fn fn) const
const ElfSym * iterateSymbolsWithTypes(const ElfShdr §ion, std::initializer_list< uint32_t > types, Fn fn) const
void validateStringTable(const ElfShdr &stringTable) const
auto end(TestAdlIterable &instance)
const ElfEhdr & elfHeader() const
#define FOLLY_SAFE_CHECK(expr, msg)
const ElfSym * iterateSymbols(const ElfShdr §ion, Fn fn) const
const ElfSym * iterateSymbolsWithType(const ElfShdr §ion, uint32_t type, Fn fn) const
const char * iterateStrings(const ElfShdr &stringTable, Fn fn) const