[lld] r242701 - Update for llvm api change.

Rafael Espindola rafael.espindola at gmail.com
Mon Jul 20 13:08:04 PDT 2015


Author: rafael
Date: Mon Jul 20 15:08:04 2015
New Revision: 242701

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

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

Modified: lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp?rev=242701&r1=242700&r2=242701&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp Mon Jul 20 15:08:04 2015
@@ -583,7 +583,7 @@ ELFDefinedAtom<ELFT> *ELFFile<ELFT>::cre
 template <class ELFT>
 void ELFFile<ELFT>::createRelocationReferences(const Elf_Sym *symbol,
                                                ArrayRef<uint8_t> content,
-                                               range<Elf_Rela_Iter> rels) {
+                                               range<const Elf_Rela *> rels) {
   bool isMips64EL = _objFile->isMips64EL();
   const auto symValue = getSymbolValue(symbol);
   for (const auto &rel : rels) {
@@ -601,7 +601,7 @@ template <class ELFT>
 void ELFFile<ELFT>::createRelocationReferences(const Elf_Sym *symbol,
                                                ArrayRef<uint8_t> symContent,
                                                ArrayRef<uint8_t> secContent,
-                                               range<Elf_Rel_Iter> rels) {
+                                               range<const Elf_Rel *> rels) {
   bool isMips64EL = _objFile->isMips64EL();
   const auto symValue = getSymbolValue(symbol);
   for (const auto &rel : rels) {

Modified: lld/trunk/lib/ReaderWriter/ELF/ELFFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFFile.h?rev=242701&r1=242700&r2=242701&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFFile.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFFile.h Mon Jul 20 15:08:04 2015
@@ -26,8 +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_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;
 
   // A Map is used to hold the atoms that have been divided up
@@ -137,13 +135,13 @@ protected:
   /// \brief Iterate over Elf_Rela relocations list and create references.
   virtual void createRelocationReferences(const Elf_Sym *symbol,
                                           ArrayRef<uint8_t> content,
-                                          range<Elf_Rela_Iter> rels);
+                                          range<const Elf_Rela *> rels);
 
   /// \brief Iterate over Elf_Rel relocations list and create references.
   virtual void createRelocationReferences(const Elf_Sym *symbol,
                                           ArrayRef<uint8_t> symContent,
                                           ArrayRef<uint8_t> secContent,
-                                          range<Elf_Rel_Iter> rels);
+                                          range<const Elf_Rel *> rels);
 
   /// \brief After all the Atoms and References are created, update each
   /// Reference's target with the Atom pointer it refers to.
@@ -327,10 +325,11 @@ protected:
   /// list of relocations references.  In ELF, if a section named, ".text" has
   /// relocations will also have a section named ".rel.text" or ".rela.text"
   /// which will hold the entries.
-  std::unordered_map<const Elf_Shdr *, range<Elf_Rela_Iter>>
-  _relocationAddendReferences;
+  std::unordered_map<const Elf_Shdr *, range<const Elf_Rela *>>
+      _relocationAddendReferences;
   MergedSectionMapT _mergedSectionMap;
-  std::unordered_map<const Elf_Shdr *, range<Elf_Rel_Iter>> _relocationReferences;
+  std::unordered_map<const Elf_Shdr *, range<const Elf_Rel *>>
+      _relocationReferences;
   std::vector<ELFReference<ELFT> *> _references;
   llvm::DenseMap<const Elf_Sym *, Atom *> _symbolToAtomMapping;
   llvm::DenseMap<const ELFReference<ELFT> *, const Elf_Sym *>

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.cpp?rev=242701&r1=242700&r2=242701&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.cpp Mon Jul 20 15:08:04 2015
@@ -222,9 +222,9 @@ template <class ELFT> std::error_code Mi
 }
 
 template <class ELFT>
-void MipsELFFile<ELFT>::createRelocationReferences(const Elf_Sym *symbol,
-                                                   ArrayRef<uint8_t> content,
-                                                   range<Elf_Rela_Iter> rels) {
+void MipsELFFile<ELFT>::createRelocationReferences(
+    const Elf_Sym *symbol, ArrayRef<uint8_t> content,
+    range<const Elf_Rela *> rels) {
   const auto value = this->getSymbolValue(symbol);
   for (const auto &rel : rels) {
     if (rel.r_offset < value || value + content.size() <= rel.r_offset)
@@ -236,12 +236,12 @@ void MipsELFFile<ELFT>::createRelocation
 }
 
 template <class ELFT>
-void MipsELFFile<ELFT>::createRelocationReferences(const Elf_Sym *symbol,
-                                                   ArrayRef<uint8_t> symContent,
-                                                   ArrayRef<uint8_t> secContent,
-                                                   range<Elf_Rel_Iter> rels) {
+void MipsELFFile<ELFT>::createRelocationReferences(
+    const Elf_Sym *symbol, ArrayRef<uint8_t> symContent,
+    ArrayRef<uint8_t> secContent, range<const Elf_Rel *> rels) {
   const auto value = this->getSymbolValue(symbol);
-  for (Elf_Rel_Iter rit = rels.begin(), eit = rels.end(); rit != eit; ++rit) {
+  for (const Elf_Rel *rit = rels.begin(), *eit = rels.end(); rit != eit;
+       ++rit) {
     if (rit->r_offset < value || value + symContent.size() <= rit->r_offset)
       continue;
 
@@ -303,10 +303,10 @@ uint32_t MipsELFFile<ELFT>::getPairReloc
 }
 
 template <class ELFT>
-typename MipsELFFile<ELFT>::Elf_Rel_Iter
+const typename MipsELFFile<ELFT>::Elf_Rel *
 MipsELFFile<ELFT>::findMatchingRelocation(uint32_t pairRelType,
-                                          Elf_Rel_Iter rit,
-                                          Elf_Rel_Iter eit) const {
+                                          const Elf_Rel *rit,
+                                          const Elf_Rel *eit) const {
   return std::find_if(rit, eit, [&](const Elf_Rel &rel) {
     return getPrimaryType(rel) == pairRelType &&
            rel.getSymbol(isMips64EL<ELFT>()) ==

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h?rev=242701&r1=242700&r2=242701&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h Mon Jul 20 15:08:04 2015
@@ -71,9 +71,8 @@ protected:
 private:
   typedef llvm::object::Elf_Sym_Impl<ELFT> Elf_Sym;
   typedef llvm::object::Elf_Shdr_Impl<ELFT> Elf_Shdr;
-  typedef llvm::object::Elf_Rel_Impl<ELFT, false> Elf_Rel;
-  typedef typename llvm::object::ELFFile<ELFT>::Elf_Rel_Iter Elf_Rel_Iter;
-  typedef typename llvm::object::ELFFile<ELFT>::Elf_Rela_Iter Elf_Rela_Iter;
+  typedef typename llvm::object::ELFFile<ELFT>::Elf_Rel Elf_Rel;
+  typedef typename llvm::object::ELFFile<ELFT>::Elf_Rela Elf_Rela;
 
   enum { TP_OFFSET = 0x7000, DTP_OFFSET = 0x8000 };
 
@@ -90,11 +89,11 @@ private:
 
   void createRelocationReferences(const Elf_Sym *symbol,
                                   ArrayRef<uint8_t> content,
-                                  range<Elf_Rela_Iter> rels) override;
+                                  range<const Elf_Rela *> rels) override;
   void createRelocationReferences(const Elf_Sym *symbol,
                                   ArrayRef<uint8_t> symContent,
                                   ArrayRef<uint8_t> secContent,
-                                  range<Elf_Rel_Iter> rels) override;
+                                  range<const Elf_Rel *> rels) override;
 
   const Elf_Shdr *findSectionByType(uint64_t type) const;
   const Elf_Shdr *findSectionByFlags(uint64_t flags) const;
@@ -114,8 +113,9 @@ private:
 
   uint32_t getPairRelocation(const Elf_Rel &rel) const;
 
-  Elf_Rel_Iter findMatchingRelocation(uint32_t pairRelType, Elf_Rel_Iter rit,
-                                      Elf_Rel_Iter eit) const;
+  const Elf_Rel *findMatchingRelocation(uint32_t pairRelType,
+                                        const Elf_Rel *rit,
+                                        const Elf_Rel *eit) const;
 
   bool isLocalBinding(const Elf_Rel &rel) const;
 };





More information about the llvm-commits mailing list