diff options
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r-- | lld/ELF/SyntheticSections.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 5a53eb181b8..6275170b7e8 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -18,6 +18,7 @@ #include "Config.h" #include "Error.h" #include "InputFiles.h" +#include "Memory.h" #include "OutputSections.h" #include "Strings.h" @@ -36,6 +37,17 @@ using namespace llvm::support::endian; using namespace lld; using namespace lld::elf; +static ArrayRef<uint8_t> createInterp() { + // StringSaver guarantees that the returned string ends with '\0'. + StringRef S = Saver.save(Config->DynamicLinker); + return {(uint8_t *)S.data(), S.size() + 1}; +} + +template <class ELFT> +InterpSection<ELFT>::InterpSection() + : InputSection<ELFT>(SHF_ALLOC, SHT_PROGBITS, 1, createInterp(), + ".interp") {} + template <class ELFT> BuildIdSection<ELFT>::BuildIdSection(size_t HashSize) : InputSection<ELFT>(SHF_ALLOC, SHT_NOTE, 1, ArrayRef<uint8_t>(), @@ -95,6 +107,11 @@ void BuildIdHexstring<ELFT>::writeBuildId(MutableArrayRef<uint8_t> Buf) { Config->BuildIdVector.size()); } +template class elf::InterpSection<ELF32LE>; +template class elf::InterpSection<ELF32BE>; +template class elf::InterpSection<ELF64LE>; +template class elf::InterpSection<ELF64BE>; + template class elf::BuildIdSection<ELF32LE>; template class elf::BuildIdSection<ELF32BE>; template class elf::BuildIdSection<ELF64LE>; |