This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [ Bug 16340][AARCH64][PATCH] Offset into GOT for TLS relocation computed inconsistently
- From: Alan Modra <amodra at gmail dot com>
- To: Kugan <kugan dot vivekanandarajah at linaro dot org>
- Cc: binutils at sourceware dot org, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, Michael Hudson-Doyle <michael dot hudson at linaro dot org>, "patches at linaro dot org" <patches at linaro dot org>
- Date: Sun, 22 Dec 2013 12:17:13 +1030
- Subject: Re: [ Bug 16340][AARCH64][PATCH] Offset into GOT for TLS relocation computed inconsistently
- Authentication-results: sourceware.org; auth=none
- References: <52B29EF7 dot 7040209 at linaro dot org> <52B4008F dot 1000403 at linaro dot org>
On Fri, Dec 20, 2013 at 07:32:15PM +1100, Kugan wrote:
> [Apologies if you get this twice; Noticed a typo with email address]
>
> Hi,
>
> mongodb for aarch64 segfaults due to an error in applying GOT for TLS
> relocation. Michael Hudson-Doyle tracked this down to wrong usage of
> offset for the relocation. Attached patch (by Michael Hudson-Doyle)
> fixes this. Regression tested on aarch64-none-linux-gnu with no new
> regressions.
>
> Is this OK for trunk and backport for 2.24?
Looks good to me. There are two more occurrences of
output_section->output_offset in elfnn-aarch64.c. Please fix those
too.
> bfd/
> +2013-12-19 Michael Hudson-Doyle <michael.hudson@linaro.org>
> +
> + * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use correct
> + offset for GOT in TLS while calculating relocation address.
> +
>
> diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
> index 8f0e716..e1ab769 100644
> --- a/bfd/elfnn-aarch64.c
> +++ b/bfd/elfnn-aarch64.c
> @@ -3831,7 +3831,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
>
> value = (symbol_got_offset (input_bfd, h, r_symndx)
> + globals->root.sgot->output_section->vma
> - + globals->root.sgot->output_section->output_offset);
> + + globals->root.sgot->output_offset);
>
> value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
> 0, weak_undef_p);
> @@ -3863,7 +3863,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
>
> value = (symbol_tlsdesc_got_offset (input_bfd, h, r_symndx)
> + globals->root.sgotplt->output_section->vma
> - + globals->root.sgotplt->output_section->output_offset
> + + globals->root.sgotplt->output_offset
> + globals->sgotplt_jump_table_size);
>
> value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
--
Alan Modra
Australia Development Lab, IBM