[lld] [lld][ICF] Prevent merging two sections when they point to non-globals (PR #136641)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 08:39:42 PDT 2025


smithp35 wrote:

> (I'm currently traveling with limited computer access, so I haven't been able to fully analyze the details-my apologies.)
> 
No problem.

> While the `MachineOutliner` transform is valid and relocations tied to specific symbol locations could theoretically be isolated-and the psABI doesn't prohibit this separation-in practice, we could restrict compiler transforms to simplify the linker's ICF code significantly. As an occasional contributor to the RISC-V psABI, I note that it hasn't faced this ICF issue yet. If it did, I would advocate prohibiting such compiler-generated code to simplify the linker's ICF implementation.

I'll see if I can get some internal opinion on whether there is a restriction that could be added to the ABI. Although writing something in the ABI is only part of the story, I'd need to find a commitment to fix and maintain that in the outliner.

https://github.com/llvm/llvm-project/pull/136641


More information about the llvm-commits mailing list