[lld] r244336 - Use already available symbol tables. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 10:16:28 PDT 2015


Author: rafael
Date: Fri Aug  7 12:16:28 2015
New Revision: 244336

URL: http://llvm.org/viewvc/llvm-project?rev=244336&view=rev
Log:
Use already available symbol tables. NFC.

Modified:
    lld/trunk/ELF/InputFiles.cpp
    lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp
    lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=244336&r1=244335&r2=244336&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Fri Aug  7 12:16:28 2015
@@ -55,7 +55,7 @@ template <class ELFT> void elf2::ObjectF
   error(StringTableOrErr.getError());
   StringRef StringTable = *StringTableOrErr;
 
-  Elf_Sym_Range Syms = ELFObj->symbols();
+  Elf_Sym_Range Syms = ELFObj->symbols(Symtab);
   Syms = Elf_Sym_Range(Syms.begin() + 1, Syms.end());
   auto NumSymbols = std::distance(Syms.begin(), Syms.end());
   SymbolBodies.reserve(NumSymbols);

Modified: lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp?rev=244336&r1=244335&r2=244336&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp Fri Aug  7 12:16:28 2015
@@ -101,7 +101,7 @@ template <class ELFT> std::error_code Dy
   // Create a map from names to dynamic symbol table entries.
   // TODO: This should use the object file's build in hash table instead if
   // it exists.
-  for (auto i = obj.dynamic_symbol_begin(), e = obj.dynamic_symbol_end();
+  for (auto i = obj.symbol_begin(dynSymSec), e = obj.symbol_end(dynSymSec);
        i != e; ++i) {
     auto name = i->getName(stringTable);
     if ((ec = name.getError()))

Modified: lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp?rev=244336&r1=244335&r2=244336&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp Fri Aug  7 12:16:28 2015
@@ -217,7 +217,8 @@ std::error_code ELFFile<ELFT>::createSym
     return ec;
   StringRef strTable = *strTableOrErr;
 
-  auto SymI = _objFile->symbol_begin(), SymE = _objFile->symbol_end();
+  auto SymI = _objFile->symbol_begin(symtab),
+       SymE = _objFile->symbol_end(symtab);
   // Skip over dummy sym.
   ++SymI;
 




More information about the llvm-commits mailing list