diff options
| -rw-r--r-- | lld/ELF/InputSection.cpp | 11 | ||||
| -rw-r--r-- | lld/ELF/InputSection.h | 2 | ||||
| -rw-r--r-- | lld/ELF/OutputSections.cpp | 2 |
3 files changed, 5 insertions, 10 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 0499e4d1d5e..c8746a9f66a 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -219,9 +219,9 @@ bool InputSectionBase::classof(const SectionBase *S) { return S->kind() != Output; } -template <class ELFT> InputSectionBase *InputSection::getRelocatedSection() { +InputSectionBase *InputSection::getRelocatedSection() { assert(this->Type == SHT_RELA || this->Type == SHT_REL); - ArrayRef<InputSectionBase *> Sections = this->getFile<ELFT>()->getSections(); + ArrayRef<InputSectionBase *> Sections = this->File->getSections(); return Sections[this->Info]; } @@ -230,7 +230,7 @@ template <class ELFT> InputSectionBase *InputSection::getRelocatedSection() { // for each relocation. So we copy relocations one by one. template <class ELFT, class RelTy> void InputSection::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) { - InputSectionBase *RelocatedSection = getRelocatedSection<ELFT>(); + InputSectionBase *RelocatedSection = getRelocatedSection(); // Loop is slow and have complexity O(N*M), where N - amount of // relocations and M - amount of symbols in symbol table. @@ -823,11 +823,6 @@ template void InputSection::writeTo<ELF32BE>(uint8_t *Buf); template void InputSection::writeTo<ELF64LE>(uint8_t *Buf); template void InputSection::writeTo<ELF64BE>(uint8_t *Buf); -template InputSectionBase *InputSection::getRelocatedSection<ELF32LE>(); -template InputSectionBase *InputSection::getRelocatedSection<ELF32BE>(); -template InputSectionBase *InputSection::getRelocatedSection<ELF64LE>(); -template InputSectionBase *InputSection::getRelocatedSection<ELF64BE>(); - template elf::ObjectFile<ELF32LE> *InputSectionBase::getFile<ELF32LE>() const; template elf::ObjectFile<ELF32BE> *InputSectionBase::getFile<ELF32BE>() const; template elf::ObjectFile<ELF64LE> *InputSectionBase::getFile<ELF64LE>() const; diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index 22eb33f779e..8ecfe131855 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -300,7 +300,7 @@ public: static bool classof(const SectionBase *S); - template <class ELFT> InputSectionBase *getRelocatedSection(); + InputSectionBase *getRelocatedSection(); template <class ELFT, class RelTy> void relocateNonAlloc(uint8_t *Buf, llvm::ArrayRef<RelTy> Rels); diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index be17d96151a..c159669fbab 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -107,7 +107,7 @@ template <class ELFT> void OutputSection::finalize() { this->Link = In<ELFT>::SymTab->OutSec->SectionIndex; // sh_info for SHT_REL[A] sections should contain the section header index of // the section to which the relocation applies. - InputSectionBase *S = First->getRelocatedSection<ELFT>(); + InputSectionBase *S = First->getRelocatedSection(); this->Info = S->OutSec->SectionIndex; } |

