On Fri, May 8, 2026 at 7:01 AM <[email protected]> wrote: > > 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?
The only thing I am worried about is in aarch64_output_dwarf_dtprel and the assert there. Even though ilp32 is deprecated, an ICE might not be welcomed. Everything else looks good. Thanks, Andrea > > 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 >
