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]

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


On 12 May 2014 18:19, Kyle McMartin <kmcmarti@redhat.com> wrote:
> 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)

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.

Is it possible to write a test for this?

Thanks,

-- 
Will Newton
Toolchain Working Group, Linaro


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