[lld] [lld][macho] Restructure thunk generation algorithm (PR #193367)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 22 10:57:53 PDT 2026
ellishg wrote:
> Thanks for tagging me, but I might have time to read the implementation closely. If single-pass ever proves unsolvable (thunk starvation, you ever need multiple branch-range classes), you may need to migrate to mold style two-pass design or lld/ELF style multi-pass design. https://maskray.me/blog/2026-01-25-long-branches-in-compilers-assemblers-and-linkers#linker-range-extension-thunks
Thanks for the info! I didn't realize ELF and mold used two passes. From looking at historical discussion, it seemed that a multi-pass design was strongly avoided. However it might be worth seeing if it could reduce the number of thunks without sacrificing performance.
https://github.com/llvm/llvm-project/pull/193367
More information about the llvm-commits
mailing list