diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index bb317c9592e5c..48e22052b3304 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -268,16 +268,14 @@ MipsReginfoSection *MipsReginfoSection::create() { return nullptr; } -static ArrayRef createInterp() { - // StringSaver guarantees that the returned string ends with '\0'. - StringRef S = Saver.save(Config->DynamicLinker); - return {(const uint8_t *)S.data(), S.size() + 1}; -} - template InputSection *elf::createInterpSection() { auto *Ret = make>(SHF_ALLOC, SHT_PROGBITS, 1, - createInterp(), ".interp"); + ArrayRef(), ".interp"); Ret->Live = true; + + // StringSaver guarantees that the returned string ends with '\0'. + StringRef S = Saver.save(Config->DynamicLinker); + Ret->Data = {(const uint8_t *)S.data(), S.size() + 1}; return Ret; }