diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index a17f713b742a89..fc0b1ecef2b8c0 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -155,6 +155,15 @@ void OutputSection::commitSection(InputSection *isec) { entsize = 0; } +static MergeSyntheticSection *createMergeSynthetic(StringRef name, + uint32_t type, + uint64_t flags, + uint32_t alignment) { + if ((flags & SHF_STRINGS) && config->optimize >= 2) + return make(name, type, flags, alignment); + return make(name, type, flags, alignment); +} + // This function scans over the InputSectionBase list sectionBases to create // InputSectionDescription::sections. // diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 49b80772e56633..95d2cd5d65be87 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -3313,15 +3313,6 @@ void MergeNoTailSection::finalizeContents() { }); } -MergeSyntheticSection *elf::createMergeSynthetic(StringRef name, uint32_t type, - uint64_t flags, - uint32_t alignment) { - bool shouldTailMerge = (flags & SHF_STRINGS) && config->optimize >= 2; - if (shouldTailMerge) - return make(name, type, flags, alignment); - return make(name, type, flags, alignment); -} - template void elf::splitSections() { llvm::TimeTraceScope timeScope("Split sections"); // splitIntoPieces needs to be called on each MergeInputSection diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h index 3d2e73071d099f..6fa99b6204db5a 100644 --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -1182,8 +1182,6 @@ class PartitionIndexSection : public SyntheticSection { InputSection *createInterpSection(); MergeInputSection *createCommentSection(); -MergeSyntheticSection *createMergeSynthetic(StringRef name, uint32_t type, - uint64_t flags, uint32_t alignment); template void splitSections(); template void writeEhdr(uint8_t *buf, Partition &part);