[lld] [ELF] Fix -u with TLS symbols: propagate type from STT_NOTYPE to STT_TLS (PR #185794)
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 11 03:28:59 PDT 2026
https://github.com/smithp35 approved this pull request.
LGTM thanks.
Running the test case in https://github.com/llvm/llvm-project/pull/178846 against gnu ld, it seems like the symbol retains the STT_TLS type, although I don't know what the underlying mechanism is.
I did think of the case where the reference in the object file has weak binding, but the reference from -u will be non-weak. Could there be a reason not to transfer the file and symbol type in that case?
The combination will be a non-weak reference from the file with symbol type STT_TLS. I think that is going to be fine in most practical cases. Only thing that I think could go wrong is that any error message we get about undefined symbols (from non-weak binding) will refer to the weak-reference from the object which could be confusing. However I think that is better than getting a relocation out of range error.
https://github.com/llvm/llvm-project/pull/185794
More information about the llvm-commits
mailing list