[lld] r240940 - Update for llvm change.

Rafael Espindola rafael.espindola at gmail.com
Mon Jun 29 05:38:36 PDT 2015


Author: rafael
Date: Mon Jun 29 07:38:35 2015
New Revision: 240940

URL: http://llvm.org/viewvc/llvm-project?rev=240940&view=rev
Log:
Update for llvm change.

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

Modified: lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp?rev=240940&r1=240939&r2=240940&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp Mon Jun 29 07:38:35 2015
@@ -70,7 +70,7 @@ template <class ELFT> std::error_code Dy
   // it exists.
   for (auto i = obj.begin_dynamic_symbols(), e = obj.end_dynamic_symbols();
        i != e; ++i) {
-    auto name = obj.getSymbolName(i);
+    auto name = obj.getSymbolName(i, true);
     if ((ec = name.getError()))
       return ec;
 

Modified: lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp?rev=240940&r1=240939&r2=240940&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp Mon Jun 29 07:38:35 2015
@@ -219,7 +219,7 @@ std::error_code ELFFile<ELFT>::createSym
   for (; SymI != SymE; ++SymI) {
     const Elf_Shdr *section = _objFile->getSection(&*SymI);
 
-    auto symbolName = _objFile->getSymbolName(SymI);
+    auto symbolName = _objFile->getSymbolName(SymI, false);
     if (std::error_code ec = symbolName.getError())
       return ec;
 
@@ -264,11 +264,11 @@ template <class ELFT> std::error_code EL
   // Contains a list of comdat sections for a group.
   for (auto &i : _sectionSymbols) {
     const Elf_Shdr *section = i.first;
-    std::vector<Elf_Sym_Iter> &symbols = i.second;
+    std::vector<const Elf_Sym *> &symbols = i.second;
 
     // Sort symbols by position.
     std::stable_sort(symbols.begin(), symbols.end(),
-                     [this](Elf_Sym_Iter a, Elf_Sym_Iter b) {
+                     [this](const Elf_Sym *a, const Elf_Sym *b) {
                        return getSymbolValue(&*a) < getSymbolValue(&*b);
                      });
 
@@ -305,7 +305,7 @@ template <class ELFT> std::error_code EL
       auto symbol = *si;
       StringRef symbolName = "";
       if (symbol->getType() != llvm::ELF::STT_SECTION) {
-        auto symName = _objFile->getSymbolName(symbol);
+        auto symName = _objFile->getSymbolName(symbol, false);
         if (std::error_code ec = symName.getError())
           return ec;
         symbolName = *symName;
@@ -486,7 +486,8 @@ std::error_code ELFFile<ELFT>::handleSec
   }
   const Elf_Sym *symbol = _objFile->getSymbol(section->sh_info);
   const Elf_Shdr *symtab = _objFile->getSection(section->sh_link);
-  ErrorOr<StringRef> symbolName = _objFile->getSymbolName(symtab, symbol);
+  const Elf_Shdr *strtab = _objFile->getSection(symtab->sh_link);
+  ErrorOr<StringRef> symbolName = _objFile->getSymbolName(strtab, symbol);
   if (std::error_code ec = symbolName.getError())
     return ec;
 

Modified: lld/trunk/lib/ReaderWriter/ELF/ELFFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFFile.h?rev=240940&r1=240939&r2=240940&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFFile.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFFile.h Mon Jun 29 07:38:35 2015
@@ -26,7 +26,6 @@ template <class ELFT> class ELFFile : pu
   typedef llvm::object::Elf_Shdr_Impl<ELFT> Elf_Shdr;
   typedef llvm::object::Elf_Rel_Impl<ELFT, false> Elf_Rel;
   typedef llvm::object::Elf_Rel_Impl<ELFT, true> Elf_Rela;
-  typedef typename llvm::object::ELFFile<ELFT>::Elf_Sym_Iter Elf_Sym_Iter;
   typedef typename llvm::object::ELFFile<ELFT>::Elf_Rela_Iter Elf_Rela_Iter;
   typedef typename llvm::object::ELFFile<ELFT>::Elf_Rel_Iter Elf_Rel_Iter;
   typedef typename llvm::object::ELFFile<ELFT>::Elf_Word Elf_Word;
@@ -200,7 +199,7 @@ protected:
   /// Determines if the target wants to create an atom for a section that has no
   /// symbol references.
   bool handleSectionWithNoSymbols(const Elf_Shdr *shdr,
-                                  std::vector<Elf_Sym_Iter> &syms) const {
+                                  std::vector<const Elf_Sym *> &syms) const {
     return shdr &&
            (shdr->sh_type == llvm::ELF::SHT_PROGBITS ||
             shdr->sh_type == llvm::ELF::SHT_INIT_ARRAY ||
@@ -348,7 +347,8 @@ protected:
 
   /// \brief the section and the symbols that are contained within it to create
   /// used to create atoms
-  llvm::MapVector<const Elf_Shdr *, std::vector<Elf_Sym_Iter>> _sectionSymbols;
+  llvm::MapVector<const Elf_Shdr *, std::vector<const Elf_Sym *>>
+      _sectionSymbols;
 
   /// \brief Sections that have merge string property
   std::vector<const Elf_Shdr *> _mergeStringSections;





More information about the llvm-commits mailing list