uint64_t getNumSections() const;
uintX_t getStringTableIndex() const;
- ELF::Elf64_Word getSymbolTableIndex(const Elf_Sym *symb) const;
+ ELF::Elf64_Word getExtendedSymbolTableIndex(const Elf_Sym *symb) const;
const Elf_Ehdr *getHeader() const { return Header; }
const Elf_Shdr *getSection(const Elf_Sym *symb) const;
const Elf_Shdr *getSection(uint32_t Index) const;
}
template <class ELFT>
-ELF::Elf64_Word ELFFile<ELFT>::getSymbolTableIndex(const Elf_Sym *symb) const {
- if (symb->st_shndx == ELF::SHN_XINDEX)
- return ExtendedSymbolTable.lookup(symb);
- return symb->st_shndx;
+ELF::Elf64_Word
+ELFFile<ELFT>::getExtendedSymbolTableIndex(const Elf_Sym *symb) const {
+ assert(symb->st_shndx == ELF::SHN_XINDEX);
+ return ExtendedSymbolTable.lookup(symb);
}
template <class ELFT>
template <class ELFT>
ErrorOr<StringRef>
ELFFile<ELFT>::getSectionName(const Elf_Shdr *Section) const {
- if (!dot_shstrtab_sec || Section->sh_name >= dot_shstrtab_sec->sh_size)
+ if (Section->sh_name >= dot_shstrtab_sec->sh_size)
return object_error::parse_failed;
return StringRef(getString(dot_shstrtab_sec, Section->sh_name));
}