sgallagh / rpms / binutils

Forked from rpms/binutils 2 years ago
Clone
76bffb9
diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.29.1/bfd/elf32-i386.c
76bffb9
--- binutils.orig/bfd/elf32-i386.c	2017-11-15 13:32:41.209042711 +0000
76bffb9
+++ binutils-2.29.1/bfd/elf32-i386.c	2017-11-15 13:42:09.365205187 +0000
76bffb9
@@ -2747,24 +2747,6 @@ elf_i386_allocate_dynrelocs (struct elf_
76bffb9
   if (h->type != STT_FUNC)
76bffb9
     eh->func_pointer_refcount = 0;
76bffb9
 
76bffb9
-  /* We can't use the GOT PLT if pointer equality is needed since
76bffb9
-     finish_dynamic_symbol won't clear symbol value and the dynamic
76bffb9
-     linker won't update the GOT slot.  We will get into an infinite
76bffb9
-     loop at run-time.  */
76bffb9
-  if (htab->plt_got != NULL
76bffb9
-      && h->type != STT_GNU_IFUNC
76bffb9
-      && !h->pointer_equality_needed
76bffb9
-      && h->plt.refcount > 0
76bffb9
-      && h->got.refcount > 0)
76bffb9
-    {
76bffb9
-      /* Don't use the regular PLT if there are both GOT and GOTPLT
76bffb9
-         reloctions.  */
76bffb9
-      h->plt.offset = (bfd_vma) -1;
76bffb9
-
76bffb9
-      /* Use the GOT PLT.  */
76bffb9
-      eh->plt_got.refcount = 1;
76bffb9
-    }
76bffb9
-
76bffb9
   /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it
76bffb9
      here if it is defined and referenced in a non-shared object.  */
76bffb9
   if (h->type == STT_GNU_IFUNC
76bffb9
diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.29.1/bfd/elf64-x86-64.c
76bffb9
--- binutils.orig/bfd/elf64-x86-64.c	2017-11-15 13:32:41.142043517 +0000
76bffb9
+++ binutils-2.29.1/bfd/elf64-x86-64.c	2017-11-15 13:41:45.030498045 +0000
76bffb9
@@ -3184,24 +3184,6 @@ elf_x86_64_allocate_dynrelocs (struct el
76bffb9
 						      eh->has_got_reloc,
76bffb9
 						      eh);
76bffb9
 
76bffb9
-  /* We can't use the GOT PLT if pointer equality is needed since
76bffb9
-     finish_dynamic_symbol won't clear symbol value and the dynamic
76bffb9
-     linker won't update the GOT slot.  We will get into an infinite
76bffb9
-     loop at run-time.  */
76bffb9
-  if (htab->plt_got != NULL
76bffb9
-      && h->type != STT_GNU_IFUNC
76bffb9
-      && !h->pointer_equality_needed
76bffb9
-      && h->plt.refcount > 0
76bffb9
-      && h->got.refcount > 0)
76bffb9
-    {
76bffb9
-      /* Don't use the regular PLT if there are both GOT and GOTPLT
76bffb9
-         reloctions.  */
76bffb9
-      h->plt.offset = (bfd_vma) -1;
76bffb9
-
76bffb9
-      /* Use the GOT PLT.  */
76bffb9
-      eh->plt_got.refcount = 1;
76bffb9
-    }
76bffb9
-
76bffb9
   /* Clear the reference count of function pointer relocations if
76bffb9
      symbol isn't a normal function.  */
76bffb9
   if (h->type != STT_FUNC)
76bffb9
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d
76bffb9
--- binutils.orig/ld/testsuite/ld-i386/pltgot-1.d	2017-11-15 13:32:39.335065263 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d	2017-11-15 15:03:55.649727195 +0000
76bffb9
@@ -2,6 +2,7 @@
76bffb9
 #readelf: -S --wide
76bffb9
 #as: --32
76bffb9
 
76bffb9
+#pass
76bffb9
 #...
76bffb9
  +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
76bffb9
 #...
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d
76bffb9
--- binutils.orig/ld/testsuite/ld-i386/pltgot-2.d	2017-11-15 13:32:39.329065335 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d	2017-11-15 15:04:20.803430034 +0000
76bffb9
@@ -3,7 +3,6 @@
76bffb9
 #readelf: -d --wide
76bffb9
 #as: --32
76bffb9
 
76bffb9
-#failif
76bffb9
 #...
76bffb9
  +0x[0-9a-f]+ +\(PLTREL.*
76bffb9
 #...
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d
76bffb9
--- binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d	2017-11-15 13:32:39.336065251 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d	2017-11-15 15:03:00.413379749 +0000
76bffb9
@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
76bffb9
 [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
76bffb9
 [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
76bffb9
 [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
76bffb9
-
76bffb9
+#...
76bffb9
 Symbol table '\.dynsym' contains [0-9]+ entries:
76bffb9
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
76bffb9
 #...
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d
76bffb9
--- binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d	2017-11-15 13:32:39.330065323 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d	2017-11-15 15:03:28.928042882 +0000
76bffb9
@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
76bffb9
 [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
76bffb9
 [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
76bffb9
 [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
76bffb9
-
76bffb9
+#...
76bffb9
 Symbol table '\.dynsym' contains [0-9]+ entries:
76bffb9
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
76bffb9
 #...
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-i386/pr20830.d binutils-2.29.1/ld/testsuite/ld-i386/pr20830.d
76bffb9
--- binutils.orig/ld/testsuite/ld-i386/pr20830.d	2017-11-15 13:32:39.332065299 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-i386/pr20830.d	2017-11-15 15:04:43.205165384 +0000
76bffb9
@@ -19,7 +19,7 @@ Contents of the .eh_frame section:
76bffb9
   DW_CFA_offset: r8 \(eip\) at cfa-4
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
-
76bffb9
+#pass
76bffb9
 0+18 00000010 0000001c FDE cie=00000000 pc=00000188..00000193
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d	2017-11-15 13:32:39.415064300 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d	2017-11-15 15:08:39.333375801 +0000
76bffb9
@@ -2,8 +2,4 @@
76bffb9
 #readelf: -S --wide
76bffb9
 #as: --64
76bffb9
 
76bffb9
-#...
76bffb9
- +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
76bffb9
-#...
76bffb9
- +\[ *[0-9]+\] \.got\.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+18 +.*
76bffb9
 #pass
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d	2017-11-15 13:32:39.404064432 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d	2017-11-15 15:08:59.031143095 +0000
76bffb9
@@ -3,7 +3,6 @@
76bffb9
 #readelf: -d --wide
76bffb9
 #as: --64
76bffb9
 
76bffb9
-#failif
76bffb9
 #...
76bffb9
  +0x[0-9a-f]+ +\(PLTREL.*
76bffb9
 #...
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd	2017-11-15 13:32:39.405064420 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd	2017-11-15 15:06:53.694623801 +0000
76bffb9
@@ -1,7 +1,4 @@
76bffb9
-#...
76bffb9
-Disassembly of section .plt.got:
76bffb9
 
76bffb9
-[a-f0-9]+ <[a-z]+@plt>:
76bffb9
-[ 	]*[a-f0-9]+:	f2 ff 25 .. .. 20 00 	bnd jmpq \*0x20....\(%rip\)        # ...... <.*>
76bffb9
+#...
76bffb9
 [ 	]*[a-f0-9]+:	90                   	nop
76bffb9
 #pass
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-ibt.dd
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd	2017-11-15 13:32:39.412064336 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-ibt.dd	2017-11-15 15:06:35.148842897 +0000
76bffb9
@@ -1,7 +1,3 @@
76bffb9
 #...
76bffb9
-Disassembly of section .plt.got:
76bffb9
-
76bffb9
-[a-f0-9]+ <[_a-z]+@plt>:
76bffb9
 [ 	]*[a-f0-9]+:	f3 0f 1e fa          	endbr64 
76bffb9
-[ 	]*[a-f0-9]+:	f2 ff 25 .. .. 20 00 	bnd jmpq \*0x20....\(%rip\)        # ...... <[_a-z]+>
76bffb9
 #pass
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd	2017-11-15 13:32:39.407064397 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd	2017-11-15 15:06:17.244054423 +0000
76bffb9
@@ -1,4 +1,3 @@
76bffb9
-#failif
76bffb9
 #...
76bffb9
 [0-9a-f ]+R_X86_64_JUMP_SLOT +0+ +bar \+ 0
76bffb9
 #...
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d	2017-11-15 13:32:39.412064336 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d	2017-11-15 15:15:09.918750288 +0000
76bffb9
@@ -20,6 +20,7 @@ Contents of the .eh_frame section:
76bffb9
   DW_CFA_offset: r16 \(rip\) at cfa-8
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
+#pass
76bffb9
 
76bffb9
 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000238..0000000000000244
76bffb9
   DW_CFA_nop
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d	2017-11-15 13:32:39.413064324 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d	2017-11-15 15:16:08.227055104 +0000
76bffb9
@@ -20,6 +20,7 @@ Contents of the .eh_frame section:
76bffb9
   DW_CFA_offset: r16 \(rip\) at cfa-8
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
+#pass
76bffb9
 
76bffb9
 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000238..0000000000000244
76bffb9
   DW_CFA_nop
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d	2017-11-15 13:32:39.413064324 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d	2017-11-15 15:16:20.115913358 +0000
76bffb9
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
76bffb9
   DW_CFA_offset: r16 \(rip\) at cfa-8
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
-
76bffb9
+#pass
76bffb9
+ 
76bffb9
 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000188..0000000000000194
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d	2017-11-15 13:32:39.411064348 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d	2017-11-15 15:16:29.012807282 +0000
76bffb9
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
76bffb9
   DW_CFA_offset: r16 \(rip\) at cfa-8
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
-
76bffb9
+#pass
76bffb9
+ 
76bffb9
 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000188..0000000000000194
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d	2017-11-15 13:32:39.408064384 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d	2017-11-15 15:19:48.097433680 +0000
76bffb9
@@ -19,7 +19,8 @@ Contents of the .eh_frame section:
76bffb9
   DW_CFA_offset: r16 \(rip\) at cfa-8
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
-
76bffb9
+#pass
76bffb9
+  
76bffb9
 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000238..0000000000000244
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d	2017-11-15 13:32:39.401064469 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d	2017-11-15 15:10:56.077760324 +0000
76bffb9
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
76bffb9
   DW_CFA_offset: r16 \(rip\) at cfa-8
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
-
76bffb9
+#pass
76bffb9
+  
76bffb9
 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000238..0000000000000244
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d	2017-11-15 13:32:39.405064420 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d	2017-11-15 15:10:42.828916844 +0000
76bffb9
@@ -19,6 +19,7 @@ Contents of the .eh_frame section:
76bffb9
   DW_CFA_offset: r16 \(rip\) at cfa-8
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
+#pass
76bffb9
 
76bffb9
 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000248..000000000000024d
76bffb9
   DW_CFA_nop
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d	2017-11-15 13:32:39.416064288 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d	2017-11-15 15:11:11.550577531 +0000
76bffb9
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
76bffb9
   DW_CFA_offset: r16 \(rip\) at cfa-8
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
-
76bffb9
+#pass
76bffb9
+  
76bffb9
 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000248..000000000000024d
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d	2017-11-15 13:32:39.411064348 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d	2017-11-15 15:09:52.664509478 +0000
76bffb9
@@ -19,7 +19,8 @@ Contents of the .eh_frame section:
76bffb9
   DW_CFA_offset: r16 \(rip\) at cfa-8
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
-
76bffb9
+#pass
76bffb9
+  
76bffb9
 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000290..00000000000002a1
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d	2017-11-15 13:32:39.413064324 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d	2017-11-15 15:11:22.975442559 +0000
76bffb9
@@ -20,7 +20,8 @@ Contents of the .eh_frame section:
76bffb9
   DW_CFA_offset: r16 \(rip\) at cfa-8
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
-
76bffb9
+#pass
76bffb9
+  
76bffb9
 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000290..00000000000002a1
76bffb9
   DW_CFA_nop
76bffb9
   DW_CFA_nop
76bffb9
diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd
76bffb9
--- binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd	2017-11-15 13:32:39.417064276 +0000
76bffb9
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd	2017-11-15 15:05:02.950932110 +0000
76bffb9
@@ -14,6 +14,7 @@ Section Headers:
76bffb9
  +\[[ 0-9]+\] .dynsym +.*
76bffb9
  +\[[ 0-9]+\] .dynstr +.*
76bffb9
  +\[[ 0-9]+\] .rela.dyn +.*
76bffb9
+#pass
76bffb9
  +\[[ 0-9]+\] .plt +.*
76bffb9
  +\[[ 0-9]+\] .plt.got +.*
76bffb9
  +\[[ 0-9]+\] .text +PROGBITS +0+1000 0+1000 0+31a 00 +AX +0 +0 4096