diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2014-12-04 14:19:41 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2014-12-04 16:55:39 -0800 |
commit | 3972882e52d7199000bb5dfc753a86aa296a567a (patch) | |
tree | f12cdd28c4f0d470e3db7b5cb17c82824d5631e6 /bfd/elf-bfd.h | |
parent | 82cf9cb2653b39c426f330854c64028eab4cb65d (diff) | |
download | binutils-gdb-3972882e52d7199000bb5dfc753a86aa296a567a.tar.gz |
Add _bfd_elf_ifunc_get_synthetic_symtab
In i386 and x86-64 binaries with ifunc, relocations against .got.plt
section may not be in the same order as entries in PLT section. This
patch adds _bfd_elf_ifunc_get_synthetic_symtab. It takes a function
pointer which returns an array of PLT entry symbol values. It calls
the function pointer to get the PLT entry symbol value array indexed
by relocation index, instead of calling plt_sym_val on each relocation
index.
PR binutils/17677
* elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): New prototype.
* elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): New
function.
* elf32-i386.c (elf_i386_plt_sym_val): Removed.
(elf_backend_plt_sym_val): Likewise.
(elf_i386_get_plt_sym_val): New.
(elf_i386_get_synthetic_symtab): Likewise.
(bfd_elf32_get_synthetic_symtab): Likewise.
* elf64-x86-64.c (elf_x86_64_plt_sym_val): Removed.
(elf_x86_64_plt_sym_val_offset_plt_bnd): Likewise.
(elf_backend_plt_sym_val): Likewise.
(elf_x86_64_get_plt_sym_val): New.
(elf_x86_64_get_synthetic_symtab): Use
_bfd_elf_ifunc_get_synthetic_symtab.
(bfd_elf64_get_synthetic_symtab): Don't undefine for NaCl.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 43686584e53..3e54ab13dac 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -2376,6 +2376,9 @@ extern bfd_boolean _bfd_elf_create_ifunc_sections 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, unsigned int); +extern long _bfd_elf_ifunc_get_synthetic_symtab + (bfd *, long, asymbol **, long, asymbol **, asymbol **, asection *, + bfd_vma *(*) (bfd *, asymbol **, asection *, asection *)); extern void elf_append_rela (bfd *, asection *, Elf_Internal_Rela *); extern void elf_append_rel (bfd *, asection *, Elf_Internal_Rela *); |