[lld] [lld] Elide __swift_FORCE_LOAD_$ dyld fixups in __DATA, __const (PR #214584)
Richard Howell via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 12 07:37:00 PDT 2026
rmaz wrote:
> Thanks for working on this. A few high-level thoughts:
>
> 1. The title says "elide dyld fixups", but the pass actually dead-strips entire `__DATA,__const` sections after `markLive()`, overriding their `no_dead_strip` annotation. Could we rename the title and description to reflect that?
Yes, thats my bad, I did initially start by just dropping the fixups but keeping the input sections.
> 2. This feels like a link-time workaround for a Swift codegen design artifact: the anchors are `weak_odr`, but the `_$_<module>` suffix in their names defeats coalescing. It'd be good to raise the suffix question with the Swift folks to confirm the intention and potentially address it in the Swift compiler.
Do you mean: is the intention that these could coalesce with the autolink sections from other modules? How would you propose to make that work, by constructing the names based on the autolink fixups instead of the originating module?
FWIW this is largely based on a similar optimisation in ld64:
https://github.com/keith/ld64/blob/37d025c536163da612874999d0ea94a4e4e475e7/src/ld/passes/dylibs.cpp#L385-L389
https://github.com/llvm/llvm-project/pull/214584
More information about the llvm-commits
mailing list