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;