Use the getSectionIndex from llvm.

llvm-svn: 285918
This commit is contained in:
Rafael Espindola 2016-11-03 14:26:25 +00:00
parent a455864fdf
commit 73aba6229f

View File

@ -142,12 +142,7 @@ typename ELFT::SymRange ELFFileBase<ELFT>::getElfSymbols(bool OnlyGlobals) {
template <class ELFT>
uint32_t ELFFileBase<ELFT>::getSectionIndex(const Elf_Sym &Sym) const {
uint32_t I = Sym.st_shndx;
if (I == ELF::SHN_XINDEX)
return check(ELFObj.getExtendedSymbolTableIndex(&Sym, Symtab, SymtabSHNDX));
if (I >= ELF::SHN_LORESERVE)
return 0;
return I;
return check(ELFObj.getSectionIndex(&Sym, Symtab, SymtabSHNDX));
}
template <class ELFT>