[llvm] [LTO][Legacy] Add new C APIs to query undefined symbols in assembly (PR #145413)
Steven Wu via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 24 09:26:17 PDT 2025
cachemeifyoucan wrote:
> This seems ok to make legacy thin LTO equivalent to legacy full LTO behavior. I don't know that the new LTO api handles this case for full or thin LTO? Does that issue remain unresolved for lld/gold?
lld is fine but it would be good if you can confirm that. There are two problems in legacy LTO that uses `LTOModule` to vend symbols to linker. One is that linker cannot distinguish undefs from assembly or bitcode, the other is that if the undef can be resolved in the same object file, LTOModule will only show the defined symbols, not undefined ones. lld has visibility for all symbols in the object file, and it distinguishes which one is prevailing and not, so it doesn't care if the symbol is assembly or bitcode and can know which one to keep. Legacy API doesn't track prevailing symbols so it needs to preserve all edges from assembly code to bitcode, otherwise the definition in bitcode might get internalized and dead stripped.
I don't see reports in the issue regarding lld, but I can leave that open if you see there are still issues in lld/gold.
https://github.com/llvm/llvm-project/pull/145413
More information about the llvm-commits
mailing list