From: Will Newton Date: Tue, 7 May 2013 17:03:52 +0000 (+0000) Subject: bfd/elf-ifunc.c: Add header size arg to _bfd_elf_allocate_ifunc_dyn_relocs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b70956dc8e3886e5fa483d72847f68a5008346c;p=binutils-gdb.git bfd/elf-ifunc.c: Add header size arg to _bfd_elf_allocate_ifunc_dyn_relocs. bfd/ChangeLog: 2013-05-07 Will Newton * 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5e24d2e1dfe..a670a24d345 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +2013-05-07 Will Newton + + * 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. + 2013-05-07 Will Newton * elf-ifunc.c (_bfd_elf_create_ifunc_dyn_reloc): Remove unused diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index d1a7e262083..4a67d02198b 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 ea08329d2ed..8d48e66eef9 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 2609130d81a..cc8b48efef0 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 9adc959f9d5..758231e2c46 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)