diff options
| author | George Rimar <grimar@accesssoftek.com> | 2017-03-21 08:44:25 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2017-03-21 08:44:25 +0000 |
| commit | 3f7c3df6a4c54174f23722cca0ed68d1a2428b64 (patch) | |
| tree | 2b52ddf5b36194bd40035ba88908c4fd98ce2518 | |
| parent | 75bdc7690e619aea7748d99e1057ffc0ab904936 (diff) | |
| download | bcm5719-llvm-3f7c3df6a4c54174f23722cca0ed68d1a2428b64.tar.gz bcm5719-llvm-3f7c3df6a4c54174f23722cca0ed68d1a2428b64.zip | |
[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
llvm-svn: 298348
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 32 | ||||
| -rw-r--r-- | lld/ELF/InputFiles.h | 1 |
2 files changed, 17 insertions, 16 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 322074d452f..4d97d45f927 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -271,34 +271,35 @@ void elf::ObjectFile<ELFT>::initializeSections( 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>::initializeSections( 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>::initializeSections( 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>::initializeSections( 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::ObjectFile<ELFT>::initializeSymbols() { 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 diff --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h index 59a399a9932..ee7cffcfff3 100644 --- a/lld/ELF/InputFiles.h +++ b/lld/ELF/InputFiles.h @@ -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 { |

