This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][AARCH64] set DF_STATIC_TLS when emitting IE relocs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]