[lld] [llvm] ELF: Use index 0 for unversioned undefined symbols (PR #168189)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 22 12:19:21 PST 2025
MaskRay wrote:
> I'll approve the change, as I think it will be the eventual outcome. Will leave it to your discretion to when the discussion has stabilised.
Thanks!
The GNU ld regression (should be resolved soon): When a shared object uses versioned symbols from its dependencies but omits a version script, its exported defined symbols are incorrectly indexed as 0 (should be index 1).
I believe future discussions would not change the resolution for unversioned undefined symbols so I am landing this.
(The mold issue is due to mold not supporting output from older GNU ld and the latest GNU ld.)
(
Verified using a4.so (`%t4.so`) from `test/version-script.s` and `~/Dev/binutils-gdb/out/debug/ld/ld-new -shared x.o a4.so -o x.so && readelf -W --dyn-syms -V x.so`.
```
% cat x.s
.globl fff
fff:
call foo3
% cc -c x.s
```
)
https://github.com/llvm/llvm-project/pull/168189
More information about the llvm-commits
mailing list