[lld] [LLD][AArch64] Handle R_AARCH64_TLS_DTPREL64 in non-alloc sections (PR #183962)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 22:00:08 PDT 2026


MaskRay wrote:

> With PR https://github.com/llvm/llvm-project/pull/146572, clang started to emit R_AARCH64_TLS_DTPREL64 in .debug_info section for variables to help in debugging TLS variables. This patch helps recognise that relocation in LLD linker.

This is out of order. The lld patch must be merged before Clang begins emitting relocations that would trigger an error. Similarly, ensure GNU ld supports R_AARCH64_TLS_DTPREL64 before updating Clang.

Clang and lld versions are usually synchronized, but we need to support very old GNU ld. Once GNU ld support is upstreamed we could gate this emission under -fbinutils-version. However, I’m still concerned about the Clang change; can the debugger use `st_value` from the ELF symbol table as a alternative approach?

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


More information about the llvm-commits mailing list