[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
Wed Mar 11 04:08:27 PDT 2026


smithp35 wrote:

> Perhaps a stupid question: why does preempting normal globals not hit the same issue with debug info?

I think in this case it comes from how the `DW_OP_form_tls_address` is defined in DWARF. I think other DWARF expressions interact with the symbol table, or are more precise. There is some commentary in the spec for `DW_OP_form_tls_address` 

>  Computing the address of the appropriate block can be complex (in some cases, the compiler emits a function call to do it), and difficult to describe using ordinary DWARF location descriptions. Instead of forcing complex thread-local storage calculations into the DWARF expressions, the DW_OP_form_tls_address allows the consumer to perform the computation based on the run-time environment.

I'm no expert in that area so there's probably a better answer to be found.

https://github.com/llvm/llvm-project/pull/183962


More information about the llvm-commits mailing list