|
|
58725c |
diff -rup binutils.orig/bfd/elf32-s390.c binutils-2.27/bfd/elf32-s390.c
|
|
|
58725c |
--- binutils.orig/bfd/elf32-s390.c 2017-05-12 13:00:01.697650210 +0100
|
|
|
58725c |
+++ binutils-2.27/bfd/elf32-s390.c 2017-05-12 13:01:05.223988744 +0100
|
|
|
58725c |
@@ -2809,7 +2809,7 @@ elf_s390_relocate_section (bfd *output_b
|
|
|
58725c |
&& s390_is_ifunc_symbol_p (h)
|
|
|
58725c |
&& h->def_regular)
|
|
|
58725c |
{
|
|
|
58725c |
- if (!bfd_link_pic (info) || !h->non_got_ref)
|
|
|
58725c |
+ if (!bfd_link_pic (info))
|
|
|
58725c |
{
|
|
|
58725c |
/* For a non-shared object STT_GNU_IFUNC symbol must
|
|
|
58725c |
go through PLT. */
|
|
|
58725c |
diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.27/bfd/elf64-s390.c
|
|
|
58725c |
--- binutils.orig/bfd/elf64-s390.c 2017-05-12 13:00:01.699650190 +0100
|
|
|
58725c |
+++ binutils-2.27/bfd/elf64-s390.c 2017-05-12 13:01:31.017720167 +0100
|
|
|
58725c |
@@ -2768,10 +2768,11 @@ elf_s390_relocate_section (bfd *output_b
|
|
|
58725c |
&& s390_is_ifunc_symbol_p (h)
|
|
|
58725c |
&& h->def_regular)
|
|
|
58725c |
{
|
|
|
58725c |
- if (!bfd_link_pic (info) || !h->non_got_ref)
|
|
|
58725c |
+ if (!bfd_link_pic (info))
|
|
|
58725c |
{
|
|
|
58725c |
- /* For a non-shared object STT_GNU_IFUNC symbol must
|
|
|
58725c |
- go through PLT. */
|
|
|
58725c |
+ /* For a non-shared object the symbol will not
|
|
|
58725c |
+ change. Hence we can write the address of the
|
|
|
58725c |
+ target IPLT slot now. */
|
|
|
58725c |
relocation = (htab->elf.iplt->output_section->vma
|
|
|
58725c |
+ htab->elf.iplt->output_offset
|
|
|
58725c |
+ h ->plt.offset);
|
|
|
58725c |
diff -rup binutils.orig/bfd/elf-s390-common.c binutils-2.27/bfd/elf-s390-common.c
|
|
|
58725c |
--- binutils.orig/bfd/elf-s390-common.c 2017-05-12 13:00:01.695650231 +0100
|
|
|
58725c |
+++ binutils-2.27/bfd/elf-s390-common.c 2017-05-12 13:01:54.347477247 +0100
|
|
|
58725c |
@@ -161,9 +161,7 @@ keep:
|
|
|
58725c |
h->type = STT_FUNC;
|
|
|
58725c |
}
|
|
|
58725c |
|
|
|
58725c |
- /* We need dynamic relocation for STT_GNU_IFUNC symbol only when
|
|
|
58725c |
- there is a non-GOT reference in a shared object. */
|
|
|
58725c |
- if (!bfd_link_pic (info) || !h->non_got_ref)
|
|
|
58725c |
+ if (!bfd_link_pic (info))
|
|
|
58725c |
*head = NULL;
|
|
|
58725c |
|
|
|
58725c |
/* Finally, allocate space. */
|