[lld] r285913 - Use existing ELFObj function. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 07:17:54 PDT 2016


Author: rafael
Date: Thu Nov  3 09:17:53 2016
New Revision: 285913

URL: http://llvm.org/viewvc/llvm-project?rev=285913&view=rev
Log:
Use existing ELFObj function. NFC.

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=285913&r1=285912&r2=285913&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Thu Nov  3 09:17:53 2016
@@ -564,10 +564,7 @@ SharedFile<ELFT>::SharedFile(MemoryBuffe
 template <class ELFT>
 const typename ELFT::Shdr *
 SharedFile<ELFT>::getSection(const Elf_Sym &Sym) const {
-  uint32_t Index = this->getSectionIndex(Sym);
-  if (Index == 0)
-    return nullptr;
-  return check(this->ELFObj.getSection(Index));
+  return check(this->ELFObj.getSection(&Sym, this->Symtab, this->SymtabSHNDX));
 }
 
 // Partially parse the shared object file so that we can call




More information about the llvm-commits mailing list