diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 4b80b6bce9a6..03e2d99f82d5 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2182,17 +2182,15 @@ void MipsRldMapSection::writeTo(uint8_t *Buf) { memcpy(Buf, &Filler, getSize()); } -template -ARMExidxSentinelSection::ARMExidxSentinelSection() +ARMExidxSentinelSection::ARMExidxSentinelSection() : SyntheticSection(SHF_ALLOC | SHF_LINK_ORDER, SHT_ARM_EXIDX, - sizeof(typename ELFT::uint), ".ARM.exidx") {} + Config->Wordsize, ".ARM.exidx") {} // Write a terminating sentinel entry to the end of the .ARM.exidx table. // This section will have been sorted last in the .ARM.exidx table. // This table entry will have the form: // | PREL31 upper bound of code that has exception tables | EXIDX_CANTUNWIND | -template -void ARMExidxSentinelSection::writeTo(uint8_t *Buf) { +void ARMExidxSentinelSection::writeTo(uint8_t *Buf) { // Get the InputSection before us, we are by definition last auto RI = cast(this->OutSec)->Sections.rbegin(); InputSection *LE = *(++RI); @@ -2338,11 +2336,6 @@ template class elf::VersionDefinitionSection; template class elf::VersionDefinitionSection; template class elf::VersionDefinitionSection; -template class elf::ARMExidxSentinelSection; -template class elf::ARMExidxSentinelSection; -template class elf::ARMExidxSentinelSection; -template class elf::ARMExidxSentinelSection; - template class elf::EhFrameSection; template class elf::EhFrameSection; template class elf::EhFrameSection; diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h index 5babe78741e4..e60df2847d72 100644 --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -718,7 +718,7 @@ public: void writeTo(uint8_t *Buf) override; }; -template class ARMExidxSentinelSection : public SyntheticSection { +class ARMExidxSentinelSection : public SyntheticSection { public: ARMExidxSentinelSection(); size_t getSize() const override { return 8; } diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 2237c537f0e9..50c0e6cd34a4 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1197,7 +1197,7 @@ template void Writer::addPredefinedSections() { // We have the terminater synthetic section class. Add that at the end. auto *OS = dyn_cast_or_null(findSection(".ARM.exidx")); if (OS && !OS->Sections.empty() && !Config->Relocatable) - OS->addSection(make>()); + OS->addSection(make()); } // The linker is expected to define SECNAME_start and SECNAME_end