This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH][AARCH64] set DF_STATIC_TLS when emitting IE relocs
- From: Kyle McMartin <kmcmarti at redhat dot com>
- To: binutils at sourceware dot org
- Date: Mon, 12 May 2014 13:19:06 -0400
- Subject: [PATCH][AARCH64] 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.
2014-05-12 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.
---
bfd/elfnn-aarch64.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 498b7bd..229407e 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -5272,6 +5272,9 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
if ((got_type & GOT_TLS_IE) && GOT_TLS_GD_ANY_P (got_type))
got_type &= ~ (GOT_TLSDESC_GD | GOT_TLS_GD);
+ if (!info->executable && (got_type & GOT_TLS_IE))
+ info->flags |= DF_STATIC_TLS;
+
if (old_got_type != got_type)
{
if (h != NULL)
--
1.9.0