diff options
author | Rui Ueyama <ruiu@google.com> | 2016-11-02 18:58:44 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-11-02 18:58:44 +0000 |
commit | e288eef32256baf32968b7540c6ca29e51749f5c (patch) | |
tree | 6165afa3921fc0eac2b8283a34d523b8d6334fb9 /lld/ELF/SyntheticSections.cpp | |
parent | 7556f6b2764d802b51dd4966d00c1d9a9d9e317d (diff) | |
download | bcm5719-llvm-e288eef32256baf32968b7540c6ca29e51749f5c.tar.gz bcm5719-llvm-e288eef32256baf32968b7540c6ca29e51749f5c.zip |
Convert Out::InterpSection to In::InterpSection.
Differential Revision: https://reviews.llvm.org/D26225
llvm-svn: 285851
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>; |