[lld] r298348 - [ELF] Follow-up to r298345 "[ELF] - Detemplate GdbIndexSection."

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 01:44:26 PDT 2017


Author: grimar
Date: Tue Mar 21 03:44:25 2017
New Revision: 298348

URL: http://llvm.org/viewvc/llvm-project?rev=298348&view=rev
Log:
[ELF] Follow-up to r298345 "[ELF] - Detemplate GdbIndexSection."

Fix for linux build bot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/8144/steps/build/logs/stdio

Modified:
    lld/trunk/ELF/InputFiles.cpp
    lld/trunk/ELF/InputFiles.h

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=298348&r1=298347&r2=298348&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Tue Mar 21 03:44:25 2017
@@ -271,34 +271,35 @@ void elf::ObjectFile<ELFT>::initializeSe
   ArrayRef<Elf_Shdr> ObjSections = check(this->getObj().sections());
   const ELFFile<ELFT> &Obj = this->getObj();
   uint64_t Size = ObjSections.size();
-  Sections.resize(Size);
+  this->Sections.resize(Size);
   unsigned I = -1;
   StringRef SectionStringTable = check(Obj.getSectionStringTable(ObjSections));
   for (const Elf_Shdr &Sec : ObjSections) {
     ++I;
-    if (Sections[I] == &InputSection::Discarded)
+    if (this->Sections[I] == &InputSection::Discarded)
       continue;
 
     // SHF_EXCLUDE'ed sections are discarded by the linker. However,
     // if -r is given, we'll let the final link discard such sections.
     // This is compatible with GNU.
     if ((Sec.sh_flags & SHF_EXCLUDE) && !Config->Relocatable) {
-      Sections[I] = &InputSection::Discarded;
+      this->Sections[I] = &InputSection::Discarded;
       continue;
     }
 
     switch (Sec.sh_type) {
     case SHT_GROUP:
-      Sections[I] = &InputSection::Discarded;
-      if (ComdatGroups.insert(CachedHashStringRef(
-                                  getShtGroupSignature(ObjSections, Sec)))
+      this->Sections[I] = &InputSection::Discarded;
+      if (ComdatGroups
+              .insert(
+                  CachedHashStringRef(getShtGroupSignature(ObjSections, Sec)))
               .second)
         continue;
       for (uint32_t SecIndex : getShtGroupEntries(Sec)) {
         if (SecIndex >= Size)
-          fatal(toString(this) + ": invalid section index in group: " +
-                Twine(SecIndex));
-        Sections[SecIndex] = &InputSection::Discarded;
+          fatal(toString(this) +
+                ": invalid section index in group: " + Twine(SecIndex));
+        this->Sections[SecIndex] = &InputSection::Discarded;
       }
       break;
     case SHT_SYMTAB:
@@ -311,7 +312,7 @@ void elf::ObjectFile<ELFT>::initializeSe
     case SHT_NULL:
       break;
     default:
-      Sections[I] = createInputSection(Sec, SectionStringTable);
+      this->Sections[I] = createInputSection(Sec, SectionStringTable);
     }
 
     // .ARM.exidx sections have a reverse dependency on the InputSection they
@@ -320,7 +321,8 @@ void elf::ObjectFile<ELFT>::initializeSe
       if (Sec.sh_link >= Sections.size())
         fatal(toString(this) + ": invalid sh_link index: " +
               Twine(Sec.sh_link));
-      Sections[Sec.sh_link]->DependentSections.push_back(Sections[I]);
+      this->Sections[Sec.sh_link]->DependentSections.push_back(
+          this->Sections[I]);
     }
   }
 }
@@ -328,9 +330,9 @@ void elf::ObjectFile<ELFT>::initializeSe
 template <class ELFT>
 InputSectionBase *elf::ObjectFile<ELFT>::getRelocTarget(const Elf_Shdr &Sec) {
   uint32_t Idx = Sec.sh_info;
-  if (Idx >= Sections.size())
+  if (Idx >= this->Sections.size())
     fatal(toString(this) + ": invalid relocated section index: " + Twine(Idx));
-  InputSectionBase *Target = Sections[Idx];
+  InputSectionBase *Target = this->Sections[Idx];
 
   // Strictly speaking, a relocation section must be included in the
   // group of the section it relocates. However, LLVM 3.3 and earlier
@@ -470,9 +472,9 @@ template <class ELFT> void elf::ObjectFi
 template <class ELFT>
 InputSectionBase *elf::ObjectFile<ELFT>::getSection(const Elf_Sym &Sym) const {
   uint32_t Index = this->getSectionIndex(Sym);
-  if (Index >= Sections.size())
+  if (Index >= this->Sections.size())
     fatal(toString(this) + ": invalid section index: " + Twine(Index));
-  InputSectionBase *S = Sections[Index];
+  InputSectionBase *S = this->Sections[Index];
 
   // We found that GNU assembler 2.17.50 [FreeBSD] 2007-07-03 could
   // generate broken objects. STT_SECTION/STT_NOTYPE symbols can be

Modified: lld/trunk/ELF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=298348&r1=298347&r2=298348&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.h (original)
+++ lld/trunk/ELF/InputFiles.h Tue Mar 21 03:44:25 2017
@@ -158,7 +158,6 @@ public:
   explicit ObjectFile(MemoryBufferRef M);
   void parse(llvm::DenseSet<llvm::CachedHashStringRef> &ComdatGroups);
 
-  ArrayRef<InputSectionBase *> getSections() const { return Sections; }
   InputSectionBase *getSection(const Elf_Sym &Sym) const;
 
   SymbolBody &getSymbolBody(uint32_t SymbolIndex) const {




More information about the llvm-commits mailing list