This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 2/2] bfd/elfnn-aarch64.c: set DF_STATIC_TLS when emitting IE relocs
- From: Kyle McMartin <kmcmarti at redhat dot com>
- To: binutils at sourceware dot org
- Cc: will dot newton at linaro dot org, nickc at redhat dot com
- Date: Mon, 30 Jun 2014 20:18:08 -0400
- Subject: [PATCH 2/2] bfd/elfnn-aarch64.c: set DF_STATIC_TLS when emitting IE relocs
- Authentication-results: sourceware.org; auth=none
For consistency with other architectures, set DF_STATIC_TLS in
shared libraries which will consume static TLS slots when loaded.
Fixes the tls-flag-static_tls test added in 1/2.
bfd/ChangeLog:
2014-06-30 Kyle McMartin <kyle@redhat.com>
* elfnn-aarch64.c (elfNN_aarch64_check_relocs): Set DF_STATIC_TLS
when emitting initial-exec relocs and not linking an executable.
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -5233,6 +5233,9 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
got_type = aarch64_reloc_got_type (bfd_r_type);
+ if (!info->executable && (got_type & GOT_TLS_IE))
+ info->flags |= DF_STATIC_TLS;
+
if (h)
{
h->got.refcount += 1;