Bug 24146 - "R_AARCH64_ABS64 used with TLS symbol a_thread_local" when compiled for -g
Summary: "R_AARCH64_ABS64 used with TLS symbol a_thread_local" when compiled for -g
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.31
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-28 14:40 UTC by Alan Hayward
Modified: 2019-01-28 14:40 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Hayward 2019-01-28 14:40:22 UTC
$ cat l.c
__thread int a_thread_local;

int main(void)
{
  a_thread_local = 3;
}


Note this does produce a binary as well as error. Assuming this means stuff is missing from the result:
$ clang l.c -fuse-ld=ld -g
/usr/bin/ld: /tmp/l-e8fd7d.o(.debug_info+0x37): R_AARCH64_ABS64 used with TLS symbol a_thread_local

Works with GOLD, no error:
$ clang l.c -fuse-ld=gold -g


With GCC+LD this error does not occur because GCC is not outputting DW_AT_location for the TLS variable a_thread_local.  Once this support is added into LD then GCC will be able to add support.  See https://gcc.gnu.org/bugzilla//show_bug.cgi?id=83010

Support for DW_AT_location on TLS variables is required for good debugging in GDB.

Tested on both 2.31.1 and HEAD.