This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH v2] aarch64: Add support for GNU indirect functions.
- From: Jiong Wang <jiong dot wang at foss dot arm dot com>
- To: will dot newton at gmail dot com
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 9 May 2016 11:27:44 +0100
- Subject: Re: [PATCH v2] aarch64: Add support for GNU indirect functions.
- Authentication-results: sourceware.org; auth=none
- References: <52455263 dot 1030208 at linaro dot org>
On 27/09/13 10:39, Will Newton wrote:
> Add support for STT_GNU_IFUNC symbols to the AArch64 bfd backend. The
tests
> are ported from the ld-ifunc tests but are enabled for cross builds
so can
> be run easily without hardware or a simulator.
>
> This version of the patch uses two passes over the symbols to ensure that
> the dynamic relocs are output in the correct order.
>
>
> (elfNN_aarch64_allocate_ifunc_dynrelocs): New function.
> (elfNN_aarch64_allocate_local_ifunc_dynrelocs): New function.
>
>
> /* This is the most important function of all . Innocuosly named
> though ! */
> @@ -5987,6 +6421,20 @@ elfNN_aarch64_size_dynamic_sections (bfd
*output_bfd ATTRIBUTE_UNUSED,
> elf_link_hash_traverse (&htab->root,
elfNN_aarch64_allocate_dynrelocs,
> info);
>
> + /* Allocate global ifunc sym .plt and .got entries, and space for
global
> + ifunc sym dynamic relocs. */
> + elf_link_hash_traverse (&htab->root,
elfNN_aarch64_allocate_ifunc_dynrelocs,
> + info);
> +
> + /* Allocate .plt and .got entries, and space for local symbols. */
> + htab_traverse (htab->loc_hash_table,
> + elfNN_aarch64_allocate_local_dynrelocs,
> + info);
> +
> + /* Allocate .plt and .got entries, and space for local ifunc
symbols. */
> + htab_traverse (htab->loc_hash_table,
> + elfNN_aarch64_allocate_local_ifunc_dynrelocs,
> + info);
Hi Will,
I came across above code where extra traverses are introduced for
IFUNC symbol, any particular
reason we need them? purely to make sure IFUNC runtime relocations
happens last? If it is, I
noticed you are using next_jump_slot_index/next_irelative_index
mechanism to solve the relocation
order issue in your initial aarch64 IFUNC support, why it's dropped
in your final version?
thanks.
Regards,
Jiong