From: Rafael Espindola Date: Tue, 8 Nov 2016 14:56:27 +0000 (+0000) Subject: Delete the InterpSection class. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0e47fbfb26bcdc256b21e50ba8e705a6107e222;p=platform%2Fupstream%2Fllvm.git Delete the InterpSection class. We can just use a regular InputSection. llvm-svn: 286237 --- diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index b612215..5d2c161 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -82,11 +82,11 @@ static ArrayRef createInterp() { return {(const uint8_t *)S.data(), S.size() + 1}; } -template -InterpSection::InterpSection() - : InputSection(SHF_ALLOC, SHT_PROGBITS, 1, createInterp(), - ".interp") { - this->Live = true; +template InputSection *elf::createInterpSection() { + auto *Ret = make>(SHF_ALLOC, SHT_PROGBITS, 1, + createInterp(), ".interp"); + Ret->Live = true; + return Ret; } template @@ -193,10 +193,10 @@ template InputSection *elf::createCommonSection(); template InputSection *elf::createCommonSection(); template InputSection *elf::createCommonSection(); -template class elf::InterpSection; -template class elf::InterpSection; -template class elf::InterpSection; -template class elf::InterpSection; +template InputSection *elf::createInterpSection(); +template InputSection *elf::createInterpSection(); +template InputSection *elf::createInterpSection(); +template InputSection *elf::createInterpSection(); template class elf::BuildIdSection; template class elf::BuildIdSection; diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h index 2938819..45a2f34 100644 --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -15,12 +15,6 @@ namespace lld { namespace elf { -// .interp section. -template class InterpSection final : public InputSection { -public: - InterpSection(); -}; - // .note.gnu.build-id section. template class BuildIdSection : public InputSection { public: @@ -73,17 +67,18 @@ public: }; template InputSection *createCommonSection(); +template InputSection *createInterpSection(); // Linker generated sections which can be used as inputs. template struct In { static BuildIdSection *BuildId; static InputSection *Common; - static InterpSection *Interp; + static InputSection *Interp; }; template BuildIdSection *In::BuildId; template InputSection *In::Common; -template InterpSection *In::Interp; +template InputSection *In::Interp; } // namespace elf } // namespace lld diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 5084b74..b77f0ea 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -228,7 +228,7 @@ template void Writer::createSyntheticSections() { Out::ProgramHeaders->updateAlignment(sizeof(uintX_t)); if (needsInterpSection()) { - In::Interp = make>(); + In::Interp = createInterpSection(); Symtab::X->Sections.push_back(In::Interp); } else { In::Interp = nullptr;