|
|
d9d3dc |
diff -rup binutils.orig/bfd/elf32-s390.c binutils-2.25.1/bfd/elf32-s390.c
|
|
|
d9d3dc |
--- binutils.orig/bfd/elf32-s390.c 2017-05-09 11:06:34.741540539 +0100
|
|
|
d9d3dc |
+++ binutils-2.25.1/bfd/elf32-s390.c 2017-05-09 11:08:21.140239839 +0100
|
|
|
d9d3dc |
@@ -2728,7 +2728,7 @@ elf_s390_relocate_section (bfd *output_b
|
|
|
d9d3dc |
&& s390_is_ifunc_symbol_p (h)
|
|
|
d9d3dc |
&& h->def_regular)
|
|
|
d9d3dc |
{
|
|
|
d9d3dc |
- if (!info->shared || !h->non_got_ref)
|
|
|
d9d3dc |
+ if (!info->shared)
|
|
|
d9d3dc |
{
|
|
|
d9d3dc |
/* For a non-shared object STT_GNU_IFUNC symbol must
|
|
|
d9d3dc |
go through PLT. */
|
|
|
d9d3dc |
diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.25.1/bfd/elf64-s390.c
|
|
|
d9d3dc |
--- binutils.orig/bfd/elf64-s390.c 2017-05-09 11:06:34.711540906 +0100
|
|
|
d9d3dc |
+++ binutils-2.25.1/bfd/elf64-s390.c 2017-05-09 11:09:23.495477558 +0100
|
|
|
d9d3dc |
@@ -2693,10 +2693,11 @@ elf_s390_relocate_section (bfd *output_b
|
|
|
d9d3dc |
&& s390_is_ifunc_symbol_p (h)
|
|
|
d9d3dc |
&& h->def_regular)
|
|
|
d9d3dc |
{
|
|
|
d9d3dc |
- if (!info->shared || !h->non_got_ref)
|
|
|
d9d3dc |
+ if (!info->shared)
|
|
|
d9d3dc |
{
|
|
|
d9d3dc |
- /* For a non-shared object STT_GNU_IFUNC symbol must
|
|
|
d9d3dc |
- go through PLT. */
|
|
|
d9d3dc |
+ /* For a non-shared object the symbol will not
|
|
|
d9d3dc |
+ change. Hence we can write the address of the
|
|
|
d9d3dc |
+ target IPLT slot now. */
|
|
|
d9d3dc |
relocation = (htab->elf.iplt->output_section->vma
|
|
|
d9d3dc |
+ htab->elf.iplt->output_offset
|
|
|
d9d3dc |
+ h ->plt.offset);
|
|
|
d9d3dc |
diff -rup binutils.orig/bfd/elf-s390-common.c binutils-2.25.1/bfd/elf-s390-common.c
|
|
|
d9d3dc |
--- binutils.orig/bfd/elf-s390-common.c 2017-05-09 11:06:34.715540857 +0100
|
|
|
d9d3dc |
+++ binutils-2.25.1/bfd/elf-s390-common.c 2017-05-09 11:07:34.079815141 +0100
|
|
|
d9d3dc |
@@ -159,9 +159,7 @@ keep:
|
|
|
d9d3dc |
h->type = STT_FUNC;
|
|
|
d9d3dc |
}
|
|
|
d9d3dc |
|
|
|
d9d3dc |
- /* We need dynamic relocation for STT_GNU_IFUNC symbol only when
|
|
|
d9d3dc |
- there is a non-GOT reference in a shared object. */
|
|
|
d9d3dc |
- if (!info->shared || !h->non_got_ref)
|
|
|
d9d3dc |
+ if (!info->shared)
|
|
|
d9d3dc |
*head = NULL;
|
|
|
d9d3dc |
|
|
|
d9d3dc |
/* Finally, allocate space. */
|
|
|
d9d3dc |
diff -rupN binutils.orig/ld/testsuite/ld-s390/pltoffset-1.dd binutils-2.25.1/ld/testsuite/ld-s390/pltoffset-1.dd
|
|
|
d9d3dc |
--- binutils.orig/ld/testsuite/ld-s390/pltoffset-1.dd 1970-01-01 01:00:00.000000000 +0100
|
|
|
d9d3dc |
+++ binutils-2.25.1/ld/testsuite/ld-s390/pltoffset-1.dd 2017-05-09 11:16:02.644598050 +0100
|
|
|
d9d3dc |
@@ -0,0 +1,8 @@
|
|
|
d9d3dc |
+tmpdir/pltoffset-1: file format elf64-s390
|
|
|
d9d3dc |
+
|
|
|
d9d3dc |
+Disassembly of section .text:
|
|
|
d9d3dc |
+
|
|
|
d9d3dc |
+.* <.text>:
|
|
|
d9d3dc |
+.*: 00 00 00 00 [ ]*.long 0x00000000
|
|
|
d9d3dc |
+.*: e3 10 f0 38 00 24 [ ]*stg %r1,56\(%r15\)
|
|
|
d9d3dc |
+.*: c0 10 00 00 00 27 [ ]*larl %r1,58 <_GLOBAL_OFFSET_TABLE_>
|
|
|
d9d3dc |
diff -rupN binutils.orig/ld/testsuite/ld-s390/pltoffset-1.ld binutils-2.25.1/ld/testsuite/ld-s390/pltoffset-1.ld
|
|
|
d9d3dc |
--- binutils.orig/ld/testsuite/ld-s390/pltoffset-1.ld 1970-01-01 01:00:00.000000000 +0100
|
|
|
d9d3dc |
+++ binutils-2.25.1/ld/testsuite/ld-s390/pltoffset-1.ld 2017-05-09 11:16:02.644598050 +0100
|
|
|
d9d3dc |
@@ -0,0 +1,34 @@
|
|
|
d9d3dc |
+SECTIONS
|
|
|
d9d3dc |
+{
|
|
|
d9d3dc |
+ .text : {
|
|
|
d9d3dc |
+ . = . + 4;
|
|
|
d9d3dc |
+ *(.plt)
|
|
|
d9d3dc |
+ }
|
|
|
d9d3dc |
+ .test : {
|
|
|
d9d3dc |
+ *(.text)
|
|
|
d9d3dc |
+ *(.got)
|
|
|
d9d3dc |
+ *(.got.plt)
|
|
|
d9d3dc |
+ *(.rodata)
|
|
|
d9d3dc |
+ *(.eh_frame)
|
|
|
d9d3dc |
+ *(.interp)
|
|
|
d9d3dc |
+ *(.data)
|
|
|
d9d3dc |
+ *(.bss)
|
|
|
d9d3dc |
+ }
|
|
|
d9d3dc |
+
|
|
|
d9d3dc |
+ /* For old binutils which otherwise complain about nonrepresentable
|
|
|
d9d3dc |
+ sections. */
|
|
|
d9d3dc |
+ .dynsym : { *(.dynsym) }
|
|
|
d9d3dc |
+ .gnu.version : { *(.gnu.version) }
|
|
|
d9d3dc |
+
|
|
|
d9d3dc |
+ /DISCARD/ : {
|
|
|
d9d3dc |
+ *(.rela.text)
|
|
|
d9d3dc |
+ *(.rela.plt)
|
|
|
d9d3dc |
+ *(.rela.got.plt)
|
|
|
d9d3dc |
+ *(.rela.data)
|
|
|
d9d3dc |
+ *(.rela.rodata)
|
|
|
d9d3dc |
+ *(.rela.bss)
|
|
|
d9d3dc |
+ *(.rela.text)
|
|
|
d9d3dc |
+ *(.comment*)
|
|
|
d9d3dc |
+ *(.note*)
|
|
|
d9d3dc |
+ }
|
|
|
d9d3dc |
+}
|
|
|
d9d3dc |
diff -rupN binutils.orig/ld/testsuite/ld-s390/pltoffset-1.s binutils-2.25.1/ld/testsuite/ld-s390/pltoffset-1.s
|
|
|
d9d3dc |
--- binutils.orig/ld/testsuite/ld-s390/pltoffset-1.s 1970-01-01 01:00:00.000000000 +0100
|
|
|
d9d3dc |
+++ binutils-2.25.1/ld/testsuite/ld-s390/pltoffset-1.s 2017-05-09 11:16:02.645598038 +0100
|
|
|
d9d3dc |
@@ -0,0 +1,12 @@
|
|
|
d9d3dc |
+ .file "hello.c"
|
|
|
d9d3dc |
+.text
|
|
|
d9d3dc |
+ .align 8
|
|
|
d9d3dc |
+.globl main
|
|
|
d9d3dc |
+ .type main, @function
|
|
|
d9d3dc |
+main:
|
|
|
d9d3dc |
+ brasl %r5,foo@PLT
|
|
|
d9d3dc |
+ br %r4
|
|
|
d9d3dc |
+ .size main, .-main
|
|
|
d9d3dc |
+
|
|
|
d9d3dc |
+.globl foo
|
|
|
d9d3dc |
+foo: .long 123
|