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

Kyle McMartin kmcmarti@redhat.com
Tue May 13 14:14:00 GMT 2014


On Tue, May 13, 2014 at 08:49:51AM +0100, Will Newton wrote:
> > --- 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)
> 
> This looks ok in principle, but I have a couple of questions.
> 
> In the aarch64 version we test the got_type after merging TLS methods
> but in the arm version we test before. Is there a reason for that? Can
> it make any difference? We should probably be consistent in any case.
> 

I'll fix this to be consistent between the two. It shouldn't make any
difference because we never clear the TLS_IE flag.

> Is it possible to write a test for this?
>

Yeah, I'll resubmit with a test case as soon as I finish writing a
testcase for another TLS issue in glibc. :/

--Kyle



More information about the Binutils mailing list