Don't iterate over all sections in the ELFFile constructor.

With this we finally have an ELFFile that is O(1) to construct. This is helpful
for programs like lld which have to do their own section walk.

llvm-svn: 244510
diff --git a/llvm/tools/llvm-readobj/ARMEHABIPrinter.h b/llvm/tools/llvm-readobj/ARMEHABIPrinter.h
index 85b2f29..39bcdaa 100644
--- a/llvm/tools/llvm-readobj/ARMEHABIPrinter.h
+++ b/llvm/tools/llvm-readobj/ARMEHABIPrinter.h
@@ -308,10 +308,12 @@
   typedef typename object::ELFFile<ET>::Elf_Sym Elf_Sym;
   typedef typename object::ELFFile<ET>::Elf_Shdr Elf_Shdr;
   typedef typename object::ELFFile<ET>::Elf_Rel Elf_Rel;
+  typedef typename object::ELFFile<ET>::Elf_Word Elf_Word;
 
   StreamWriter &SW;
   const object::ELFFile<ET> *ELF;
   const Elf_Shdr *Symtab;
+  ArrayRef<Elf_Word> ShndxTable;
 
   static const size_t IndexTableEntrySize;
 
@@ -385,7 +387,8 @@
       std::pair<const Elf_Shdr *, const Elf_Sym *> Symbol =
         ELF->getRelocationSymbol(&Sec, &RelA);
 
-      ErrorOr<const Elf_Shdr *> Ret = ELF->getSection(Symbol.second);
+      ErrorOr<const Elf_Shdr *> Ret =
+          ELF->getSection(Symbol.second, Symbol.first, ShndxTable);
       if (std::error_code EC = Ret.getError())
         report_fatal_error(EC.message());
       return *Ret;