Remove FileCheck from test case token_landingpad.ll.
[oota-llvm.git] / tools / llvm-readobj / ARMEHABIPrinter.h
index 85b2f2906ca5dcb7f4f878a907129f2e386d5b37..beb5fd4ea042b4aafcd20b62b6c62ad40e92fe40 100644 (file)
@@ -308,10 +308,12 @@ class PrinterContext {
   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;
 
@@ -373,6 +375,10 @@ PrinterContext<ET>::FindExceptionTable(unsigned IndexSectionIndex,
     if (Sec.sh_type != ELF::SHT_REL || Sec.sh_info != IndexSectionIndex)
       continue;
 
+    ErrorOr<const Elf_Shdr *> SymTabOrErr = ELF->getSection(Sec.sh_link);
+    error(SymTabOrErr.getError());
+    const Elf_Shdr *SymTab = *SymTabOrErr;
+
     for (const Elf_Rel &R : ELF->rels(&Sec)) {
       if (R.r_offset != static_cast<unsigned>(IndexTableOffset))
         continue;
@@ -382,10 +388,10 @@ PrinterContext<ET>::FindExceptionTable(unsigned IndexSectionIndex,
       RelA.r_info = R.r_info;
       RelA.r_addend = 0;
 
-      std::pair<const Elf_Shdr *, const Elf_Sym *> Symbol =
-        ELF->getRelocationSymbol(&Sec, &RelA);
+      const Elf_Sym *Symbol = ELF->getRelocationSymbol(&RelA, SymTab);
 
-      ErrorOr<const Elf_Shdr *> Ret = ELF->getSection(Symbol.second);
+      ErrorOr<const Elf_Shdr *> Ret =
+          ELF->getSection(Symbol, SymTab, ShndxTable);
       if (std::error_code EC = Ret.getError())
         report_fatal_error(EC.message());
       return *Ret;