We already have the sections, pass them to getSHNDXTable.

llvm-svn: 285897
This commit is contained in:
Rafael Espindola 2016-11-03 12:21:00 +00:00
parent 2227c7f425
commit 84d6a17134

View File

@ -318,7 +318,7 @@ void elf::ObjectFile<ELFT>::initializeSections(
this->Symtab = &Sec;
break;
case SHT_SYMTAB_SHNDX:
this->SymtabSHNDX = check(Obj.getSHNDXTable(Sec));
this->SymtabSHNDX = check(Obj.getSHNDXTable(Sec, ObjSections));
break;
case SHT_STRTAB:
case SHT_NULL:
@ -575,7 +575,8 @@ template <class ELFT> void SharedFile<ELFT>::parseSoName() {
const Elf_Shdr *DynamicSec = nullptr;
const ELFFile<ELFT> Obj = this->ELFObj;
for (const Elf_Shdr &Sec : check(Obj.sections())) {
ArrayRef<Elf_Shdr> Sections = check(Obj.sections());
for (const Elf_Shdr &Sec : Sections) {
switch (Sec.sh_type) {
default:
continue;
@ -586,7 +587,7 @@ template <class ELFT> void SharedFile<ELFT>::parseSoName() {
DynamicSec = &Sec;
break;
case SHT_SYMTAB_SHNDX:
this->SymtabSHNDX = check(Obj.getSHNDXTable(Sec));
this->SymtabSHNDX = check(Obj.getSHNDXTable(Sec, Sections));
break;
case SHT_GNU_versym:
this->VersymSec = &Sec;