return {(const uint8_t *)S.data(), S.size() + 1};
}
-template <class ELFT>
-InterpSection<ELFT>::InterpSection()
- : InputSection<ELFT>(SHF_ALLOC, SHT_PROGBITS, 1, createInterp(),
- ".interp") {
- this->Live = true;
+template <class ELFT> InputSection<ELFT> *elf::createInterpSection() {
+ auto *Ret = make<InputSection<ELFT>>(SHF_ALLOC, SHT_PROGBITS, 1,
+ createInterp(), ".interp");
+ Ret->Live = true;
+ return Ret;
}
template <class ELFT>
template InputSection<ELF64LE> *elf::createCommonSection();
template InputSection<ELF64BE> *elf::createCommonSection();
-template class elf::InterpSection<ELF32LE>;
-template class elf::InterpSection<ELF32BE>;
-template class elf::InterpSection<ELF64LE>;
-template class elf::InterpSection<ELF64BE>;
+template InputSection<ELF32LE> *elf::createInterpSection();
+template InputSection<ELF32BE> *elf::createInterpSection();
+template InputSection<ELF64LE> *elf::createInterpSection();
+template InputSection<ELF64BE> *elf::createInterpSection();
template class elf::BuildIdSection<ELF32LE>;
template class elf::BuildIdSection<ELF32BE>;
namespace lld {
namespace elf {
-// .interp section.
-template <class ELFT> class InterpSection final : public InputSection<ELFT> {
-public:
- InterpSection();
-};
-
// .note.gnu.build-id section.
template <class ELFT> class BuildIdSection : public InputSection<ELFT> {
public:
};
template <class ELFT> InputSection<ELFT> *createCommonSection();
+template <class ELFT> InputSection<ELFT> *createInterpSection();
// Linker generated sections which can be used as inputs.
template <class ELFT> struct In {
static BuildIdSection<ELFT> *BuildId;
static InputSection<ELFT> *Common;
- static InterpSection<ELFT> *Interp;
+ static InputSection<ELFT> *Interp;
};
template <class ELFT> BuildIdSection<ELFT> *In<ELFT>::BuildId;
template <class ELFT> InputSection<ELFT> *In<ELFT>::Common;
-template <class ELFT> InterpSection<ELFT> *In<ELFT>::Interp;
+template <class ELFT> InputSection<ELFT> *In<ELFT>::Interp;
} // namespace elf
} // namespace lld
Out<ELFT>::ProgramHeaders->updateAlignment(sizeof(uintX_t));
if (needsInterpSection<ELFT>()) {
- In<ELFT>::Interp = make<InterpSection<ELFT>>();
+ In<ELFT>::Interp = createInterpSection<ELFT>();
Symtab<ELFT>::X->Sections.push_back(In<ELFT>::Interp);
} else {
In<ELFT>::Interp = nullptr;