[lld] r285897 - We already have the sections, pass them to getSHNDXTable.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 05:21:00 PDT 2016


Author: rafael
Date: Thu Nov  3 07:21:00 2016
New Revision: 285897

URL: http://llvm.org/viewvc/llvm-project?rev=285897&view=rev
Log:
We already have the sections, pass them to getSHNDXTable.

Modified:
    lld/trunk/ELF/InputFiles.cpp

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=285897&r1=285896&r2=285897&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Thu Nov  3 07:21:00 2016
@@ -318,7 +318,7 @@ void elf::ObjectFile<ELFT>::initializeSe
       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<EL
   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<EL
       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;




More information about the llvm-commits mailing list