Ping!!
________________________________
From: [email protected] <[email protected]>
Sent: 08 May 2026 15:00
To: [email protected] <[email protected]>
Cc: Alice Carlotti <[email protected]>; Alex Coplan <[email protected]>;
[email protected] <[email protected]>; [email protected]
<[email protected]>; Srinath Parvathaneni
<[email protected]>
Subject: [PATCH v2][GCC] aarch64: Fix tls debuginfo missing location info
[PR97344]
Changes v1 → v2:
* Added a check in gcc/configure.ac to apply the patch only if the
assembler supports DTPREL relocations.
* Added a target check to verify whether the assembler supports
".xword %dtprel(symbol)".
------------------------------
Hi,
This patch fixes the missing debuginfo for the TLS variables by emitting
".xword %dtprel(symbol)" along with DW_AT_location in .debug_info section.
Support for the assembler directive ".xword %dtprel(symbol)" was recently
introduced. To prevent assembler errors when building GCC with older
versions of binutils, the patch adds a configure check that skips these
changes if the assembler does not support ".xword %dtprel(symbol)".
Regression tested on aarch64-linux-gnu and found no regressions.
Ok for trunk ? And also backport to other GCC versions?
Regards,
Srinath
gcc/ChangeLog:
PR target/97344
* config.in: Re-generate.
* config/aarch64/aarch64.cc (aarch64_output_dwarf_dtprel): Define
function.
(TARGET_ASM_OUTPUT_DWARF_DTPREL): Define macro.
* configure: Re-generate.
* configure.ac: Add assembler check for dtprel relocation.
gcc/testsuite/ChangeLog:
PR target/97344
* gcc.target/aarch64/pr97344.c: New test.
* lib/target-supports.exp (aarch64_gas_has_dtprel_reloc): Add new target
check.
---
gcc/config.in | 6 ++++
gcc/config/aarch64/aarch64.cc | 16 ++++++++++
gcc/configure | 34 ++++++++++++++++++++++
gcc/configure.ac | 6 ++++
gcc/testsuite/gcc.target/aarch64/pr97344.c | 26 +++++++++++++++++
gcc/testsuite/lib/target-supports.exp | 11 +++++++
6 files changed, 99 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/aarch64/pr97344.c