[lld] [lld][ELF] Introduce an option to keep data section prefix. (PR #148985)
Mingming Liu via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 20 10:43:50 PDT 2025
mingmingl-llvm wrote:
thanks for the reviews!
To share some context and progress on merging this change, we rely on the default behavior configured in the linker script to map `.unlikely`-prefixed input sections to a `.unlikely` output section and keeping the rest to canonical section.
When `-keep-data-section-prefix` is enabled in linker, this change will map a `.hot`-prefixed input section to `.hot`-prefixed output section; I'm currently evaluating two options internally to keep the desired mapping -- we prefer to update the linker script to achieve that as long as the binary linking time remains reasonable, and have a back-up plan to update the [codegen pass](https://github.com/llvm/llvm-project/blob/main/llvm/lib/CodeGen/StaticDataAnnotator.cpp) to optionally (by an LLVM option) not emit `.hot`-prefixed input sections in the first place. Will try to land this in the next few days.
https://github.com/llvm/llvm-project/pull/148985
More information about the llvm-commits
mailing list