This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] bfd/elf-ifunc.c: Add header size arg to _bfd_elf_allocate_ifunc_dyn_relocs.
- From: Will Newton <will dot newton at linaro dot org>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>, Patch Tracking <patches at linaro dot org>
- Date: Tue, 7 May 2013 18:04:41 +0100
- Subject: Re: [PATCH] bfd/elf-ifunc.c: Add header size arg to _bfd_elf_allocate_ifunc_dyn_relocs.
- References: <5188D156 dot 2070602 at linaro dot org> <CAMe9rOph10HzgKTqa0gEH+zb3Otpf29Jd4bxaqU+7vdPhV0xUg at mail dot gmail dot com>
On 7 May 2013 17:31, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, May 7, 2013 at 3:03 AM, Will Newton <will.newton@linaro.org> wrote:
>>
>> bfd/ChangeLog:
>>
>> 2013-05-07 Will Newton <will.newton@linaro.org>
>>
>> * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Add a
>> plt_header_size argument for ports where it differs from
>> plt_entry_size.
>> * elf-bfd.h: Likewise.
>> * elf32-i386.c: Pass plt_header_size to
>> _bfd_elf_allocate_ifunc_dyn_relocs.
>> * elf64-x86-64.c: Likewise.
>> ---
>> bfd/elf-bfd.h | 2 +-
>> bfd/elf-ifunc.c | 3 ++-
>> bfd/elf32-i386.c | 3 ++-
>> bfd/elf64-x86-64.c | 1 +
>> 4 files changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
>> index d1a7e26..4a67d02 100644
>> --- a/bfd/elf-bfd.h
>> +++ b/bfd/elf-bfd.h
>> @@ -2380,7 +2380,7 @@ extern bfd_boolean _bfd_elf_create_ifunc_sections
>> (bfd *, struct bfd_link_info *);
>> extern bfd_boolean _bfd_elf_allocate_ifunc_dyn_relocs
>> (struct bfd_link_info *, struct elf_link_hash_entry *,
>> - struct elf_dyn_relocs **, unsigned int, unsigned int);
>> + struct elf_dyn_relocs **, unsigned int, unsigned int, unsigned int);
>>
>> extern void elf_append_rela (bfd *, asection *, Elf_Internal_Rela *);
>> extern void elf_append_rel (bfd *, asection *, Elf_Internal_Rela *);
>> diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c
>> index ea08329..8d48e66 100644
>> --- a/bfd/elf-ifunc.c
>> +++ b/bfd/elf-ifunc.c
>> @@ -112,6 +112,7 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info,
>> struct elf_link_hash_entry *h,
>> struct elf_dyn_relocs **head,
>> unsigned int plt_entry_size,
>> + unsigned int plt_header_size,
>> unsigned int got_entry_size)
>> {
>> asection *plt, *gotplt, *relplt;
>> @@ -193,7 +194,7 @@ keep:
>> /* If this is the first .plt entry, make room for the special
>> first entry. */
>> if (plt->size == 0)
>> - plt->size += plt_entry_size;
>> + plt->size += plt_header_size;
>> }
>> else
>> {
>> diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
>> index 2609130..cc8b48e 100644
>> --- a/bfd/elf32-i386.c
>> +++ b/bfd/elf32-i386.c
>> @@ -2197,7 +2197,8 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
>> if (h->type == STT_GNU_IFUNC
>> && h->def_regular)
>> return _bfd_elf_allocate_ifunc_dyn_relocs (info, h, &eh->dyn_relocs,
>> - plt_entry_size, 4);
>> + plt_entry_size,
>> + plt_entry_size, 4);
>> else if (htab->elf.dynamic_sections_created
>> && h->plt.refcount > 0)
>> {
>> diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
>> index 9adc959..758231e 100644
>> --- a/bfd/elf64-x86-64.c
>> +++ b/bfd/elf64-x86-64.c
>> @@ -2260,6 +2260,7 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
>> return _bfd_elf_allocate_ifunc_dyn_relocs (info, h,
>> &eh->dyn_relocs,
>> plt_entry_size,
>> + plt_entry_size,
>> GOT_ENTRY_SIZE);
>> else if (htab->elf.dynamic_sections_created
>> && h->plt.refcount > 0)
>> --
>> 1.8.1.4
>>
>
> OK. Thanks.
>
> --
> H.J.
Thanks, I applied both patches.
--
Will Newton
Toolchain Working Group, Linaro