[lld] [LLD][AArch64] Handle R_AARCH64_TLS_DTPREL64 in non-alloc sections (PR #183962)
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 6 08:56:59 PST 2026
smithp35 wrote:
> Thanks @smithp35 for testing this. Let me know if you have been succeeded in examine the location of TLS variable without DW_AT_location.
Apologies for the delay. Happen to be working from home today so I've been able to check on a Raspberry Pi.
I can reproduce the behaviour in https://sourceware.org/bugzilla/show_bug.cgi?id=28351 and on my own examples. The `DW_OP_form_tls_address` expression is needed for static TLS variables (claim to be optimized out) but not for global TLS variables. GDB seems to be able to find those without the expression.
There may be an advantage in clang not using the Dwarf expression for preemptible global TLS variables. I note that the definition of the `DW_OP_form_tls_address` will always give the offset of the variable from the "modules" TLS block which if the symbol is preempted will give the wrong value. I can confirm that with an example in gdb.
https://github.com/llvm/llvm-project/pull/183962
More information about the llvm-commits
mailing list