const ELFFile<ELFT> &EF = *Obj->getELFFile();
const Elf_Shdr *sec = EF.getSection(Rel.d.a);
+ const Elf_Shdr *SymTab = EF.getSection(sec->sh_link);
+ assert(SymTab->sh_type == ELF::SHT_SYMTAB ||
+ SymTab->sh_type == ELF::SHT_DYNSYM);
+ const Elf_Shdr *StrTab = EF.getSection(SymTab->sh_link);
uint8_t type;
StringRef res;
int64_t addend = 0;
return EC;
Target = *SecName;
} else {
- ErrorOr<StringRef> SymName =
- EF.getSymbolName(EF.getSection(sec->sh_link), symb);
+ ErrorOr<StringRef> SymName = EF.getSymbolName(StrTab, symb);
if (!SymName)
return SymName.getError();
Target = *SymName;