Index: ELF/InputSection.h =================================================================== --- ELF/InputSection.h +++ ELF/InputSection.h @@ -85,12 +85,6 @@ // This corresponds to a section of an input file. class InputSectionBase : public SectionBase { public: - InputSectionBase() - : SectionBase(Regular, "", /*Flags*/ 0, /*Entsize*/ 0, /*Alignment*/ 0, - /*Type*/ 0, - /*Info*/ 0, /*Link*/ 0), - NumRelocations(0), AreRelocsRela(false), Repl(this) {} - template InputSectionBase(ObjFile *File, const typename ELFT::Shdr *Header, StringRef Name, Kind SectionKind); @@ -114,8 +108,6 @@ ArrayRef Data; uint64_t getOffsetInFile() const; - static InputSectionBase Discarded; - // True if this section has already been placed to a linker script // output section. This is needed because, in a linker script, you // can refer to the same section more than once. For example, in @@ -306,6 +298,7 @@ // .eh_frame. It also includes the synthetic sections themselves. class InputSection : public InputSectionBase { public: + InputSection(); InputSection(uint64_t Flags, uint32_t Type, uint32_t Alignment, ArrayRef Data, StringRef Name, Kind K = Regular); template @@ -337,6 +330,8 @@ // Called by ICF to merge two input sections. void replace(InputSection *Other); + static InputSection Discarded; + private: template void copyRelocations(uint8_t *Buf, llvm::ArrayRef Rels); Index: ELF/InputSection.cpp =================================================================== --- ELF/InputSection.cpp +++ ELF/InputSection.cpp @@ -323,7 +323,9 @@ .str(); } -InputSectionBase InputSectionBase::Discarded; +InputSection InputSection::Discarded; + +InputSection::InputSection() : InputSection(0, 0, 0, ArrayRef(), "") {} InputSection::InputSection(uint64_t Flags, uint32_t Type, uint32_t Alignment, ArrayRef Data, StringRef Name, Kind K)