diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 14 |
2 files changed, 22 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ef771a9..68a23d1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2016-08-29 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/14961 + PR ld/20515 + * elf32-i386.c (elf_i386_check_relocs): Issue an error when + R_386_PC32 relocation is used to call IFUNC function in PIC + object. + 2016-08-27 Alan Modra <amodra@gmail.com> PR 20520 diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 4179572..17f86e8 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -2178,6 +2178,20 @@ do_relocation: a function defined in a shared library. */ if ((sec->flags & SEC_CODE) == 0) h->pointer_equality_needed = 1; + else if (h->type == STT_GNU_IFUNC + && bfd_link_pic (info)) + { + if (isym == NULL) + name = h->root.root.string; + else + name = bfd_elf_sym_name (abfd, symtab_hdr, isym, + NULL); + (*_bfd_error_handler) + (_("%B: unsupported non-PIC call to IFUNC `%s'"), + abfd, name); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } } else { |