Blame SOURCES/binutils-x86_64-disable-PLT-elision.patch

13ae24
--- binutils.orig/bfd/elfxx-x86.c	2018-09-05 14:08:23.331182323 +0100
13ae24
+++ binutils-2.30/bfd/elfxx-x86.c	2018-09-05 16:14:15.331921741 +0100
13ae24
@@ -108,6 +108,7 @@ elf_x86_allocate_dynrelocs (struct elf_l
13ae24
 
13ae24
   resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh);
13ae24
 
13ae24
+#if 0 /* Never optimize away PLT entries.  They are needed by tools like rtld-audit and ltrace.  */
13ae24
   /* We can't use the GOT PLT if pointer equality is needed since
13ae24
      finish_dynamic_symbol won't clear symbol value and the dynamic
13ae24
      linker won't update the GOT slot.  We will get into an infinite
13ae24
@@ -125,6 +126,7 @@ elf_x86_allocate_dynrelocs (struct elf_l
13ae24
       /* Use the GOT PLT.  */
13ae24
       eh->plt_got.refcount = 1;
13ae24
     }
13ae24
+#endif
13ae24
 
13ae24
   /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it
13ae24
      here if it is defined and referenced in a non-shared object.  */
13ae24
diff -rup binutils.orig/ld/testsuite/ld-i386/i386.exp binutils-2.30/ld/testsuite/ld-i386/i386.exp
13ae24
--- binutils.orig/ld/testsuite/ld-i386/i386.exp	2018-09-12 15:59:03.969158148 +0100
13ae24
+++ binutils-2.30/ld/testsuite/ld-i386/i386.exp	2018-09-12 16:23:41.579837859 +0100
13ae24
@@ -1434,9 +1434,9 @@ run_ld_link_tests [list \
13ae24
 ]
13ae24
 
13ae24
 # Linux only tests
13ae24
-run_dump_test "pltgot-1"
13ae24
-run_dump_test "pltgot-2"
13ae24
-run_dump_test "pr20830"
13ae24
+# run_dump_test "pltgot-1"
13ae24
+# run_dump_test "pltgot-2"
13ae24
+# run_dump_test "pr20830"
13ae24
 run_dump_test "ibt-plt-1"
13ae24
 run_dump_test "ibt-plt-2a"
13ae24
 run_dump_test "ibt-plt-2b"
13ae24
diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.30/ld/testsuite/ld-i386/pr19636-2d.d
13ae24
--- binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d	2018-09-12 15:59:03.968158156 +0100
13ae24
+++ binutils-2.30/ld/testsuite/ld-i386/pr19636-2d.d	2018-09-12 16:20:30.046301550 +0100
13ae24
@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
13ae24
 [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
13ae24
 [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
13ae24
 [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
13ae24
-
13ae24
+#...
13ae24
 Symbol table '\.dynsym' contains [0-9]+ entries:
13ae24
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
13ae24
 #...
13ae24
diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.30/ld/testsuite/ld-i386/pr19636-2e.d
13ae24
--- binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d	2018-09-12 15:59:03.966158171 +0100
13ae24
+++ binutils-2.30/ld/testsuite/ld-i386/pr19636-2e.d	2018-09-12 16:20:18.301391306 +0100
13ae24
@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
13ae24
 [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
13ae24
 [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
13ae24
 [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
13ae24
-
13ae24
+#...
13ae24
 Symbol table '\.dynsym' contains [0-9]+ entries:
13ae24
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
13ae24
 #...
13ae24
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd binutils-2.30/ld/testsuite/ld-x86-64/plt-main-bnd.dd
13ae24
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd	2018-09-12 15:59:04.038157619 +0100
13ae24
+++ binutils-2.30/ld/testsuite/ld-x86-64/plt-main-bnd.dd	2018-09-12 16:43:58.243317284 +0100
13ae24
@@ -1,3 +1,4 @@
13ae24
+#pass
13ae24
 #...
13ae24
 Disassembly of section .plt.got:
13ae24
 
13ae24
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd binutils-2.30/ld/testsuite/ld-x86-64/plt-main-ibt.dd
13ae24
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd	2018-09-12 15:59:04.027157703 +0100
13ae24
+++ binutils-2.30/ld/testsuite/ld-x86-64/plt-main-ibt.dd	2018-09-12 16:46:42.417060121 +0100
13ae24
@@ -1,3 +1,4 @@
13ae24
+#pass
13ae24
 #...
13ae24
 Disassembly of section .plt.got:
13ae24
 
13ae24
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.30/ld/testsuite/ld-x86-64/plt-main.rd
13ae24
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd	2018-09-12 15:59:04.037157626 +0100
13ae24
+++ binutils-2.30/ld/testsuite/ld-x86-64/plt-main.rd	2018-09-12 16:34:34.950619373 +0100
13ae24
@@ -1,4 +1,3 @@
13ae24
-#failif
13ae24
 #...
13ae24
 [0-9a-f ]+R_X86_64_JUMP_SLOT +0+ +bar \+ 0
13ae24
 #...
13ae24
diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr19636-2e.d binutils-2.30/ld/testsuite/ld-x86-64/pr19636-2e.d
13ae24
--- binutils.orig/ld/testsuite/ld-x86-64/pr19636-2e.d	2018-09-12 15:59:04.034157649 +0100
13ae24
+++ binutils-2.30/ld/testsuite/ld-x86-64/pr19636-2e.d	2018-09-12 16:17:08.687840318 +0100
13ae24
@@ -11,7 +11,7 @@ Relocation section '\.rela\.dyn' at offs
13ae24
 Relocation section '\.rela\.plt' at offset 0x[0-9a-f]+ contains 1 entry:
13ae24
  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
13ae24
 [0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +0+ +func3 \+ 0
13ae24
-
13ae24
+#...
13ae24
 Symbol table '\.dynsym' contains [0-9]+ entries:
13ae24
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
13ae24
 #...
13ae24
diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp
13ae24
--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp	2018-09-12 15:59:04.023157734 +0100
13ae24
+++ binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp	2018-09-12 16:47:08.880857470 +0100
13ae24
@@ -59,7 +59,7 @@ set x86_64tests {
13ae24
      "-shared -melf_x86_64 --no-ld-generated-unwind-info --hash-style=sysv" ""
13ae24
      "--64 -mrelax-relocations=yes"
13ae24
      {tlspic3.s tlspic2.s}
13ae24
-     {{readelf -WSsrl tlspic2.rd} {objdump -drj.text\ -Mintel64 tlspic2.dd}
13ae24
+     {{objdump -drj.text\ -Mintel64 tlspic2.dd}
13ae24
       {objdump -sj.got tlspic2.sd} {objdump -sj.tdata tlspic2.td}}
13ae24
       "libtlspic2.so"}
13ae24
     {"TLS descriptor -fpic -shared transitions"
13ae24
@@ -1837,18 +1837,18 @@ if { "$LD_CLASS" == "64bit" } then {
13ae24
     # This test needs 64-bit linker.
13ae24
     run_dump_test "pr17618"
13ae24
 }
13ae24
-run_dump_test "pltgot-1"
13ae24
-run_dump_test "pltgot-2"
13ae24
-run_dump_test "pr20830a"
13ae24
-run_dump_test "pr20830b"
13ae24
-run_dump_test "pr21038a"
13ae24
-run_dump_test "pr21038b"
13ae24
-run_dump_test "pr21038c"
13ae24
-run_dump_test "pr20830a-now"
13ae24
-run_dump_test "pr20830b-now"
13ae24
-run_dump_test "pr21038a-now"
13ae24
-run_dump_test "pr21038b-now"
13ae24
-run_dump_test "pr21038c-now"
13ae24
+# run_dump_test "pltgot-1"
13ae24
+# run_dump_test "pltgot-2"
13ae24
+# run_dump_test "pr20830a"
13ae24
+# run_dump_test "pr20830b"
13ae24
+# run_dump_test "pr21038a"
13ae24
+# run_dump_test "pr21038b"
13ae24
+# run_dump_test "pr21038c"
13ae24
+# run_dump_test "pr20830a-now"
13ae24
+# run_dump_test "pr20830b-now"
13ae24
+# run_dump_test "pr21038a-now"
13ae24
+# run_dump_test "pr21038b-now"
13ae24
+# run_dump_test "pr21038c-now"
13ae24
 run_dump_test "ibt-plt-1"
13ae24
 run_dump_test "ibt-plt-1-x32"
13ae24
 run_dump_test "ibt-plt-2a"