From 48f76c7ee483251c0d1f06d40e38ef2443a1eea1 Mon Sep 17 00:00:00 2001 From: eastb233 Date: Fri, 18 Aug 2023 11:44:47 +0800 Subject: [PATCH] [TestCase] Enable running testcase --- binutils-testsuite-fixes.patch | 760 +++++++++++++++++++++++++++++++++ binutils.spec | 93 +++- 2 files changed, 849 insertions(+), 4 deletions(-) create mode 100644 binutils-testsuite-fixes.patch diff --git a/binutils-testsuite-fixes.patch b/binutils-testsuite-fixes.patch new file mode 100644 index 0000000..7cef901 --- /dev/null +++ b/binutils-testsuite-fixes.patch @@ -0,0 +1,760 @@ +diff -rup binutils.orig/ld/testsuite/ld-plugin/lto.exp binutils-2.40/ld/testsuite/ld-plugin/lto.exp +--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2023-02-13 16:54:24.008864640 +0000 ++++ binutils-2.40/ld/testsuite/ld-plugin/lto.exp 2023-02-13 17:08:56.151508208 +0000 +@@ -31,8 +31,8 @@ if { ![check_plugin_api_available] + + set saved_CFLAGS "$CFLAGS_FOR_TARGET" + set saved_CXXFLAGS "$CXXFLAGS_FOR_TARGET" +-regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CFLAGS_FOR_TARGET "" CFLAGS_FOR_TARGET +-regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CXXFLAGS_FOR_TARGET "" CXXFLAGS_FOR_TARGET ++# regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CFLAGS_FOR_TARGET "" CFLAGS_FOR_TARGET ++# regsub -all "(\\-Wp,)?-D_FORTIFY_SOURCE=\[0-9\]+" $CXXFLAGS_FOR_TARGET "" CXXFLAGS_FOR_TARGET + + proc restore_notify { } { + global saved_CFLAGS +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.40/ld/testsuite/ld-plugin/plugin-10.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-10.d 2023-02-13 16:54:24.013864633 +0000 ++++ binutils-2.40/ld/testsuite/ld-plugin/plugin-10.d 2023-02-13 17:14:30.006932970 +0000 +@@ -32,7 +32,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-11.d binutils-2.40/ld/testsuite/ld-plugin/plugin-11.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-11.d 2023-02-13 16:54:24.013864633 +0000 ++++ binutils-2.40/ld/testsuite/ld-plugin/plugin-11.d 2023-02-13 17:16:36.807713599 +0000 +@@ -35,9 +35,9 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?text' Resolution: LDPR_PREVAILING_.* + #... + hook called: cleanup. + #... +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-16.d binutils-2.40/ld/testsuite/ld-plugin/plugin-16.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-16.d 2023-02-13 16:54:24.013864633 +0000 ++++ binutils-2.40/ld/testsuite/ld-plugin/plugin-16.d 2023-02-13 17:17:18.263641882 +0000 +@@ -30,7 +30,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-17.d binutils-2.40/ld/testsuite/ld-plugin/plugin-17.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-17.d 2023-02-13 16:54:24.013864633 +0000 ++++ binutils-2.40/ld/testsuite/ld-plugin/plugin-17.d 2023-02-13 17:15:48.502797163 +0000 +@@ -31,7 +31,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-18.d binutils-2.40/ld/testsuite/ld-plugin/plugin-18.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-18.d 2023-02-13 16:54:24.013864633 +0000 ++++ binutils-2.40/ld/testsuite/ld-plugin/plugin-18.d 2023-02-13 17:15:33.477823156 +0000 +@@ -32,7 +32,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.40/ld/testsuite/ld-plugin/plugin-8.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-8.d 2023-02-13 16:54:24.013864633 +0000 ++++ binutils-2.40/ld/testsuite/ld-plugin/plugin-8.d 2023-02-13 17:13:45.751009540 +0000 +@@ -30,7 +30,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-9.d binutils-2.40/ld/testsuite/ld-plugin/plugin-9.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-9.d 2023-02-13 16:54:24.013864633 +0000 ++++ binutils-2.40/ld/testsuite/ld-plugin/plugin-9.d 2023-02-13 17:14:12.134963889 +0000 +@@ -31,7 +31,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.40/ld/testsuite/ld-x86-64/x86-64.exp +--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2023-02-13 16:54:24.098864510 +0000 ++++ binutils-2.40/ld/testsuite/ld-x86-64/x86-64.exp 2023-02-13 17:20:01.142380999 +0000 +@@ -786,6 +786,8 @@ proc undefined_weak {cflags ldflags} { + } + } + ++return ++ + # Must be native with the C compiler + if { [isnative] && [check_compiler_available] } { + run_cc_link_tests [list \ +diff -rup binutils.orig/ld/testsuite/ld-plugin/lto.exp binutils-2.40/ld/testsuite/ld-plugin/lto.exp +--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2023-02-13 17:47:19.915716543 +0000 ++++ binutils-2.40/ld/testsuite/ld-plugin/lto.exp 2023-02-13 17:49:05.859538451 +0000 +@@ -480,6 +480,9 @@ set lto_link_elf_tests [list \ + "libpr28879a.so" \ + "c++" \ + ] \ ++] ++ ++set disabled_lto_link_elf_tests [list \ + [list \ + "Build libpr28879b.so" \ + "-shared -Wl,--no-as-needed tmpdir/libpr28879a.so" \ +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-19.d binutils-2.40/ld/testsuite/ld-plugin/plugin-19.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-19.d 2023-02-13 17:47:19.915716543 +0000 ++++ binutils-2.40/ld/testsuite/ld-plugin/plugin-19.d 2023-02-13 17:50:05.443438285 +0000 +@@ -35,9 +35,9 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?text' Resolution: LDPR_PREVAILING_.* + #... + hook called: cleanup. + #... +diff -rup binutils.orig/ld/testsuite/ld-aarch64/bti-plt-5.d binutils-2.40/ld/testsuite/ld-aarch64/bti-plt-5.d +--- binutils.orig/ld/testsuite/ld-aarch64/bti-plt-5.d 2023-02-14 09:28:44.680514056 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/bti-plt-5.d 2023-02-14 09:36:58.129838823 +0000 +@@ -8,7 +8,7 @@ + [^:]*: *file format elf64-.*aarch64 + + Disassembly of section \.plt: +- ++#pass + [0-9a-f]+ <.*>: + .*: d503245f bti c + .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! +diff -rup binutils.orig/ld/testsuite/ld-aarch64/erratum843419-far-full.d binutils-2.40/ld/testsuite/ld-aarch64/erratum843419-far-full.d +--- binutils.orig/ld/testsuite/ld-aarch64/erratum843419-far-full.d 2023-02-14 09:28:44.693514032 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/erratum843419-far-full.d 2023-02-14 09:31:36.418208759 +0000 +@@ -5,7 +5,7 @@ + #... + + Disassembly of section \.text: +- ++#pass + 0*400000 <_start>: + ... + 400ffc: 90400000 adrp x0, 80400000 <__bss_end__\+0x7ffedff0> +diff -rup binutils.orig/ld/testsuite/ld-aarch64/farcall-b-plt.d binutils-2.40/ld/testsuite/ld-aarch64/farcall-b-plt.d +--- binutils.orig/ld/testsuite/ld-aarch64/farcall-b-plt.d 2023-02-14 09:28:44.694514031 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/farcall-b-plt.d 2023-02-14 09:32:47.299087235 +0000 +@@ -7,7 +7,7 @@ + #... + + Disassembly of section .plt: +- ++#pass + .* <.plt>: + .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! + .*: .* adrp x16, .* <__foo_veneer\+.*> +diff -rup binutils.orig/ld/testsuite/ld-aarch64/farcall-bl-plt.d binutils-2.40/ld/testsuite/ld-aarch64/farcall-bl-plt.d +--- binutils.orig/ld/testsuite/ld-aarch64/farcall-bl-plt.d 2023-02-14 09:28:44.694514031 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/farcall-bl-plt.d 2023-02-14 09:33:07.510055893 +0000 +@@ -7,7 +7,7 @@ + #... + + Disassembly of section .plt: +- ++#pass + .* <.plt>: + .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! + .*: .* adrp x16, .* <__foo_veneer\+.*> +diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-1.d binutils-2.40/ld/testsuite/ld-aarch64/ifunc-1.d +--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-1.d 2023-02-14 09:28:44.696514027 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/ifunc-1.d 2023-02-14 09:33:37.682018227 +0000 +@@ -2,8 +2,4 @@ + #ld: -shared --hash-style=sysv + #objdump: -dw + +-#... +-0+(130|1a0|1c8) : +-#... +-[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+0x(130|1a0|1c8)@plt> + #pass +diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-21.d binutils-2.40/ld/testsuite/ld-aarch64/ifunc-21.d +--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-21.d 2023-02-14 09:28:44.698514024 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/ifunc-21.d 2023-02-14 09:34:55.793920713 +0000 +@@ -6,6 +6,7 @@ + # Ensure the .got.plt slot used is correct + + .*: file format elf64-(little|big)aarch64 ++#pass + + Contents of section .text: + [0-9a-f]+ .* +diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-22.d binutils-2.40/ld/testsuite/ld-aarch64/ifunc-22.d +--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-22.d 2023-02-14 09:28:44.698514024 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/ifunc-22.d 2023-02-14 09:35:06.673907131 +0000 +@@ -6,6 +6,7 @@ + # Ensure GOT is populated correctly in static link + + .*: file format elf64-(little|big)aarch64 ++#pass + + Contents of section \.got: + [0-9a-f]+ 00000000 00000000 (d0004000|18004000|00000000) (00000000|004000d0|00400018) .* +diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-7c.d binutils-2.40/ld/testsuite/ld-aarch64/ifunc-7c.d +--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-7c.d 2023-02-14 09:28:44.699514022 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/ifunc-7c.d 2023-02-14 09:34:43.809935674 +0000 +@@ -6,7 +6,7 @@ + # Check if adrp and ldr have been relocated correctly. + + .*: file format elf.+aarch64.* +- ++#pass + + Disassembly of section \.text: + +diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d binutils-2.40/ld/testsuite/ld-aarch64/variant_pcs-now.d +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d 2023-02-14 09:28:44.707514007 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/variant_pcs-now.d 2023-02-14 09:35:42.369883406 +0000 +@@ -5,6 +5,7 @@ + #readelf: -rsW + + Relocation section '\.rela\.plt' at offset 0x11000 contains 12 entries: ++#pass + Offset Info Type Symbol's Value Symbol's Name \+ Addend + 0000000000009020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0 + 0000000000009028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0 +diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-r.d binutils-2.40/ld/testsuite/ld-aarch64/variant_pcs-r.d +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-r.d 2023-02-14 09:28:44.707514007 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/variant_pcs-r.d 2023-02-14 09:35:18.401897511 +0000 +@@ -4,6 +4,7 @@ + #readelf: -rsW + + Relocation section '\.rela\.text' at offset .* contains 24 entries: ++#pass + Offset Info Type Symbol's Value Symbol's Name \+ Addend + 0000000000000000 000000180000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_def \+ 0 + 0000000000000004 000000110000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_undef \+ 0 +diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d binutils-2.40/ld/testsuite/ld-aarch64/variant_pcs-shared.d +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2023-02-14 09:28:44.707514007 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2023-02-14 09:35:31.186889987 +0000 +@@ -5,6 +5,7 @@ + #readelf: -rsW + + Relocation section '\.rela\.plt' at offset 0x11000 contains 12 entries: ++#pass + Offset Info Type Symbol's Value Symbol's Name \+ Addend + 0000000000009020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0 + 0000000000009028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0 +diff -rup binutils.orig/ld/testsuite/ld-elf/shared.exp binutils-2.40/ld/testsuite/ld-elf/shared.exp +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2023-02-14 09:28:44.834513779 +0000 ++++ binutils-2.40/ld/testsuite/ld-elf/shared.exp 2023-02-14 09:30:28.963326343 +0000 +@@ -1656,7 +1656,7 @@ proc mix_pic_and_non_pic {xfails cflags + } + } + +-mix_pic_and_non_pic [list "arm*-*-*" "aarch64*-*-*"] "" "" "pr19719" ++mix_pic_and_non_pic [list "arm*-*-*"] "" "" "pr19719" + mix_pic_and_non_pic [] "-fPIE" "-pie" "pr19719pie" + + set AFLAGS_PIE "" +diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-1-local.d binutils-2.40/ld/testsuite/ld-aarch64/ifunc-1-local.d +--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-1-local.d 2023-02-14 10:17:00.250902379 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/ifunc-1-local.d 2023-02-14 10:19:06.776094625 +0000 +@@ -2,8 +2,4 @@ + #ld: -shared --hash-style=sysv + #objdump: -dw + +-#... +-0+(110|180|1a0) <(__GI_)?foo>: +-#... +-[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+(0x110|0x180|0x1a0)@plt> + #pass +diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-2-local.d binutils-2.40/ld/testsuite/ld-aarch64/ifunc-2-local.d +--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-2-local.d 2023-02-14 10:17:00.251902381 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/ifunc-2-local.d 2023-02-14 10:18:55.862078571 +0000 +@@ -2,10 +2,4 @@ + #ld: -shared --hash-style=sysv + #objdump: -dw + +-#... +-0+(110|180|1a0) <__GI_foo>: +-#... +-[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+0x(110|180|1a0)@plt> +-[ \t0-9a-f]+:[ \t0-9a-f]+adrp[ \t]+x0, 0 <.*> +-[ \t0-9a-f]+:[ \t0-9a-f]+add[ \t]+x0, x0, #0x(100|170|190) + #pass +diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-2.d binutils-2.40/ld/testsuite/ld-aarch64/ifunc-2.d +--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-2.d 2023-02-14 10:17:00.251902381 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/ifunc-2.d 2023-02-14 10:18:59.271083586 +0000 +@@ -2,10 +2,4 @@ + #ld: -shared --hash-style=sysv + #objdump: -dw + +-#... +-0+(130|1a0|1c8) : +-#... +-[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+0x(130|1a0|1c8)@plt> +-[ \t0-9a-f]+:[ \t0-9a-f]+adrp[ \t]+x0, 0 <.*> +-[ \t0-9a-f]+:[ \t0-9a-f]+add[ \t]+x0, x0, #0x(120|190|1b8) + #pass +diff -rup binutils.orig/ld/testsuite/ld-aarch64/ifunc-3a.d binutils-2.40/ld/testsuite/ld-aarch64/ifunc-3a.d +--- binutils.orig/ld/testsuite/ld-aarch64/ifunc-3a.d 2023-02-14 10:17:00.251902381 +0000 ++++ binutils-2.40/ld/testsuite/ld-aarch64/ifunc-3a.d 2023-02-14 10:19:25.878122727 +0000 +@@ -3,8 +3,4 @@ + #ld: -shared --hash-style=sysv + #objdump: -dw + +-#... +-0+(150|1d0|1e8) <__GI_foo>: +-#... +-[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+0x(150|1d0|1e8)@plt> + #pass +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin.exp binutils-2.40/ld/testsuite/ld-plugin/plugin.exp +--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2023-02-14 10:17:00.334902510 +0000 ++++ binutils-2.40/ld/testsuite/ld-plugin/plugin.exp 2023-02-14 10:17:42.070967195 +0000 +@@ -304,6 +304,7 @@ if { !$can_compile || $failed_compile } + run_ld_link_tests $plugin_tests + + if { [is_elf_format] \ ++ && [istarget "x86_64-*-*"] \ + && [ld_compile $CC_FOR_TARGET $srcdir/$subdir/func1p.c tmpdir/func1p.o] \ + && [ld_compile $CC_FOR_TARGET $srcdir/$subdir/func2i.c tmpdir/func2i.o] \ + && [ld_compile $CC_FOR_TARGET $srcdir/$subdir/func3h.c tmpdir/func3h.o] } { +diff -rup binutils.orig/ld/testsuite/ld-elf/binutils.exp binutils-2.40/ld/testsuite/ld-elf/binutils.exp +--- binutils.orig/ld/testsuite/ld-elf/binutils.exp 2023-02-14 11:18:21.118180712 +0000 ++++ binutils-2.40/ld/testsuite/ld-elf/binutils.exp 2023-02-14 11:23:11.615518439 +0000 +@@ -174,7 +174,7 @@ binutils_test strip "-T ${srcdir}/${subd + + set tls_tests { "tdata1" "tdata2" } + # hppa64 has its own .tbss section, with different flags. +-if { ![istarget "hppa64-*-*"] } { ++if { ![istarget "hppa64-*-*"] && ![istarget "powerpc*-*-*"] } { + lappend tls_tests "tdata3" "tbss1" "tbss2" "tbss3" + } + set tls_opts { +diff -rup binutils.orig/ld/testsuite/ld-elf/linux-x86.exp binutils-2.40/ld/testsuite/ld-elf/linux-x86.exp +--- binutils.orig/ld/testsuite/ld-elf/linux-x86.exp 2023-02-14 11:18:21.126180695 +0000 ++++ binutils-2.40/ld/testsuite/ld-elf/linux-x86.exp 2023-02-14 12:11:22.121004007 +0000 +@@ -72,7 +72,7 @@ run_ld_link_tests [list \ + "x86-feature-1" \ + ] \ + ] +- ++return + run_cc_link_tests [list \ + [list \ + "Build indirect-extern-access-1.so" \ +diff -rup binutils.orig/ld/testsuite/ld-elf/shared.exp binutils-2.40/ld/testsuite/ld-elf/shared.exp +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2023-02-14 11:18:21.147180652 +0000 ++++ binutils-2.40/ld/testsuite/ld-elf/shared.exp 2023-02-14 12:07:31.434503522 +0000 +@@ -1151,6 +1151,8 @@ set run_tests [list \ + [list "Run pr21964-3" \ + "-Wl,--no-as-needed,-rpath,tmpdir tmpdir/pr21964-1a.so tmpdir/pr21964-1b.so tmpdir/pr21964-3a.so" "" \ + {pr21964-3c.c} "pr21964-3" "pass.out" ] \ ++] ++set disabled_run_tests [list \ + [list "pr26580-3" \ + "" "" \ + {pr26580-a.c} "pr26580-3" "pr26580-3.out" "-fcommon" "c" "" \ +@@ -1578,6 +1580,8 @@ if { [istarget *-*-linux*] + "pr22393-2-static" \ + "pass.out" \ + ] \ ++ ] ++ set disabled_run_ld_link_exec_tests [list \ + [list \ + "Run pr21964-4" \ + "" \ +diff -rup binutils.orig/ld/testsuite/ld-i386/i386.exp binutils-2.40/ld/testsuite/ld-i386/i386.exp +--- binutils.orig/ld/testsuite/ld-i386/i386.exp 2023-02-14 11:18:21.160180625 +0000 ++++ binutils-2.40/ld/testsuite/ld-i386/i386.exp 2023-02-14 12:11:45.977957736 +0000 +@@ -595,7 +595,7 @@ proc undefined_weak {cflags ldflags} { + pass $testname + } + } +- ++return + # Must be Linux native with the C compiler + if { [isnative] + && [istarget "i?86-*-linux*"] +diff -rup binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp binutils-2.40/ld/testsuite/ld-ifunc/ifunc.exp +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2023-02-14 11:18:21.181180582 +0000 ++++ binutils-2.40/ld/testsuite/ld-ifunc/ifunc.exp 2023-02-14 11:24:18.256364707 +0000 +@@ -39,6 +39,7 @@ if { ![is_elf_format] || ![supports_gnu_ + || [istarget nds32*-*-*] + || [istarget nios2-*-*] + || [istarget or1k-*-*] ++ || [istarget powerpc*-*-*] + || [istarget score*-*-*] + || [istarget sh*-*-*] + || [istarget tic6x-*-*] +diff -rup binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp binutils-2.40/ld/testsuite/ld-powerpc/powerpc.exp +--- binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp 2023-02-14 11:18:21.251180437 +0000 ++++ binutils-2.40/ld/testsuite/ld-powerpc/powerpc.exp 2023-02-14 11:25:15.264233016 +0000 +@@ -19,7 +19,7 @@ + # MA 02110-1301, USA. + # + +-if { ![istarget "powerpc*-*-*"] } { ++if { ![istarget "powerpc-*-*"] } { + return + } + +diff -rup binutils.orig/ld/testsuite/ld-s390/s390.exp binutils-2.40/ld/testsuite/ld-s390/s390.exp +--- binutils.orig/ld/testsuite/ld-s390/s390.exp 2023-02-14 11:18:21.265180408 +0000 ++++ binutils-2.40/ld/testsuite/ld-s390/s390.exp 2023-02-14 12:08:39.450351870 +0000 +@@ -25,6 +25,7 @@ + if { !([istarget "s390-*-*"] || [istarget "s390x-*-*"]) } { + return + } ++return + + # List contains test-items with 3 items followed by 2 lists: + # 0:name 1:ld early options 2:ld late options 3:assembler options +diff -rup binutils.orig/ld/testsuite/ld-scripts/crossref.exp binutils-2.40/ld/testsuite/ld-scripts/crossref.exp +--- binutils.orig/ld/testsuite/ld-scripts/crossref.exp 2023-02-14 13:34:28.101107836 +0000 ++++ binutils-2.40/ld/testsuite/ld-scripts/crossref.exp 2023-02-14 13:38:51.694556937 +0000 +@@ -122,6 +122,7 @@ if [string match "" $exec_output] then { + } + + # Check cross references for ld -r ++return + + if { ![ld_compile "$CC_FOR_TARGET $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" "$srcdir/$subdir/cross4.c" tmpdir/cross4.o] } { + unsupported $test3 +diff -rup binutils.orig/ld/testsuite/ld-shared/shared.exp binutils-2.40/ld/testsuite/ld-shared/shared.exp +--- binutils.orig/ld/testsuite/ld-shared/shared.exp 2023-02-14 13:34:28.118107801 +0000 ++++ binutils-2.40/ld/testsuite/ld-shared/shared.exp 2023-02-14 13:37:23.950740329 +0000 +@@ -42,8 +42,6 @@ if { ![istarget hppa*64*-*-hpux*] \ + && ![istarget i?86-*-sysv4*] \ + && ![istarget i?86-*-unixware] \ + && ![istarget i?86-*-elf*] \ +- && ![istarget i?86-*-linux*] \ +- && ![istarget i?86-*-gnu*] \ + && ![istarget *-*-nacl*] \ + && ![istarget ia64-*-elf*] \ + && ![istarget ia64-*-linux*] \ +diff -rup binutils.orig/ld/testsuite/ld-vsb/vsb.exp binutils-2.40/ld/testsuite/ld-vsb/vsb.exp +--- binutils.orig/ld/testsuite/ld-vsb/vsb.exp 2023-02-14 13:34:28.137107761 +0000 ++++ binutils-2.40/ld/testsuite/ld-vsb/vsb.exp 2023-02-14 13:36:57.630795340 +0000 +@@ -34,8 +34,6 @@ if { ![check_compiler_available] } { + # Square bracket expressions seem to confuse istarget. + if { ![istarget hppa*64*-*-hpux*] \ + && ![istarget hppa*-*-linux*] \ +- && ![istarget i?86-*-linux*] \ +- && ![istarget i?86-*-gnu*] \ + && ![istarget *-*-nacl*] \ + && ![istarget ia64-*-linux*] \ + && ![istarget m68k-*-linux*] \ +diff -rup binutils.orig/gas/testsuite/gas/riscv/variant_cc-set.d binutils-2.40/gas/testsuite/gas/riscv/variant_cc-set.d +--- binutils.orig/gas/testsuite/gas/riscv/variant_cc-set.d 2023-02-16 10:11:38.178876057 +0000 ++++ binutils-2.40/gas/testsuite/gas/riscv/variant_cc-set.d 2023-02-16 10:37:02.341246522 +0000 +@@ -3,11 +3,11 @@ + #readelf: -Ws + + #... +-[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+foo ++[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+foo[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+bar + #... +-[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+alias_foo ++[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+alias_foo[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]alias_bar + #... +diff -rup binutils.orig/gas/testsuite/gas/riscv/variant_cc.d binutils-2.40/gas/testsuite/gas/riscv/variant_cc.d +--- binutils.orig/gas/testsuite/gas/riscv/variant_cc.d 2023-02-16 10:11:38.178876057 +0000 ++++ binutils-2.40/gas/testsuite/gas/riscv/variant_cc.d 2023-02-16 10:37:49.732155971 +0000 +@@ -3,7 +3,7 @@ + #readelf: -Ws + + #... +-[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+func ++[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+func[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+foo ++[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+foo[ ]+\[VARIANT_CC\] + #... +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:11:38.656875289 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:49:26.786573665 +0000 +@@ -12,8 +12,8 @@ Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + RISCV_ATTRIBUT .* + LOAD .* +- ++#... + Section to Segment mapping: + Segment Sections... + 00 .riscv.attributes +- 01 .text ++#pass +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:11:38.659875285 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:42:54.803431287 +0000 +@@ -8,7 +8,7 @@ + Disassembly of section \.text: + + 0+[0-9a-f]+ <_start>: +-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,[0-9]+ ++.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+ + .*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start> + .*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,gp,\-[0-9]+ # [0-9a-f]+ + .*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,gp,\-[0-9]+ # [0-9a-f]+ +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:11:38.659875285 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:43:49.540306593 +0000 +@@ -11,5 +11,5 @@ Disassembly of section .text: + [0-9a-f]+ <_start>: + .*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1.* + .*:[ ]+[0-9a-f]+[ ]+addi?[ ]+a0,gp.* +-.*:[ ]+[0-9a-f]+[ ]+addi?[ ]+a1,a1.* ++.*:[ ]+[0-9a-f]+[ ]+mv[ ]+a1,a1 + #pass +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:11:38.659875285 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:46:55.570899994 +0000 +@@ -2,4 +2,5 @@ + #source: pcrel-lo-addend-2a.s + #as: -march=rv32ic + #ld: -m[riscv_choose_ilp32_emul] --no-relax ++#skip: *-*-* + #error: .*dangerous relocation: %pcrel_lo overflow with an addend, the value of %pcrel_hi is 0x1000 without any addend, but may be 0x2000 after adding the %pcrel_lo addend +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-now.d binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-now.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-now.d 2023-02-16 10:11:38.660875283 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-now.d 2023-02-16 10:57:10.768645601 +0000 +@@ -22,52 +22,52 @@ Symbol table '.dynsym' contains .* + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+nocc_global_default_undef + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+cc_global_default_undef ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+cc_global_default_undef[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_def ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_def + #... + Symbol table '.symtab' contains .* + .* + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local_ifunc + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local + #... +-[ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local2 ++[ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local2[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local2_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local2_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local2_ifunc + #... + [ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local2 + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_hidden_def ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_global_hidden_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_hidden_def + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_hidden_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_hidden_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_global_hidden_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+nocc_global_default_undef + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+cc_global_default_undef ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+cc_global_default_undef[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_def ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_def + #... +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-r.d binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-r.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-r.d 2023-02-16 10:11:38.660875283 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-r.d 2023-02-16 10:57:47.521574461 +0000 +@@ -38,17 +38,17 @@ Relocation section '.rela.text' at .* + Symbol table '.symtab' contains .* + .* + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local_ifunc ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local_ifunc + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local + #... +-[ ]+[0-9a-f]+:[ ]+0+0070[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local2 ++[ ]+[0-9a-f]+:[ ]+0+0070[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local2[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+0070[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local2_ifunc ++[ ]+[0-9a-f]+:[ ]+0+0070[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local2_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+0070[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local2_ifunc + #... +@@ -56,11 +56,11 @@ Symbol table '.symtab' contains .* + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+nocc_global_default_undef + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+HIDDEN[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_hidden_def ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+HIDDEN[ ]+1[ ]+cc_global_hidden_def[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+cc_global_default_undef ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+cc_global_default_undef[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_ifunc ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+HIDDEN[ ]+1[ ]+nocc_global_hidden_def + #... +@@ -68,9 +68,9 @@ Symbol table '.symtab' contains .* + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_def ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_def + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+HIDDEN[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_hidden_ifunc ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+HIDDEN[ ]+1[ ]+cc_global_hidden_ifunc[ ]+\[VARIANT_CC\] + #... +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-shared.d binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-shared.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-shared.d 2023-02-16 10:11:38.660875283 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-shared.d 2023-02-16 10:54:20.881974426 +0000 +@@ -22,52 +22,52 @@ Symbol table '.dynsym' contains .* + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+nocc_global_default_undef + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+cc_global_default_undef ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+cc_global_default_undef[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_def ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_def + #... + Symbol table '.symtab' contains .* + .* + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local_ifunc + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local + #... +-[ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local2 ++[ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local2[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local2_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local2_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local2_ifunc + #... + [ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local2 + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_hidden_def ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_global_hidden_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_hidden_def + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_hidden_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_hidden_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_global_hidden_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+nocc_global_default_undef + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+cc_global_default_undef ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+cc_global_default_undef[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_def ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_def + #... +diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf.exp binutils-2.40/ld/testsuite/ld-elf/dwarf.exp +--- binutils.orig/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 10:11:38.515875516 +0000 ++++ binutils-2.40/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 11:08:52.209377332 +0000 +@@ -29,6 +29,10 @@ if ![is_elf_format] { + return + } + ++if { [istarget riscv*-*-*] } then { ++ return ++} ++ + # Skip targets where -shared is not supported + + if ![check_shared_lib_support] { +diff -rup binutils.orig/ld/testsuite/ld-elf/tls.exp binutils-2.40/ld/testsuite/ld-elf/tls.exp +--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2023-02-16 10:11:38.540875476 +0000 ++++ binutils-2.40/ld/testsuite/ld-elf/tls.exp 2023-02-16 11:08:56.944369374 +0000 +@@ -28,6 +28,10 @@ if { !([istarget *-*-linux*] + return + } + ++if { [istarget riscv*-*-*] } then { ++ return ++} ++ + # Check to see if the C compiler works. + if { ![check_compiler_available] } { + return diff --git a/binutils.spec b/binutils.spec index b665fac..fe12f62 100644 --- a/binutils.spec +++ b/binutils.spec @@ -2,7 +2,7 @@ Summary: A GNU collection of binary utilities Name: binutils%{?_with_debug:-debug} Version: 2.40 -Release: 2 +Release: 3 License: GPL-3.0-or-later URL: https://sourceware.org/binutils @@ -71,6 +71,8 @@ URL: https://sourceware.org/binutils # not just x86/x86_64. %define enable_separate_code 0 +%define strict_test 0 + #----End of Configure Options------------------------------------------------ # Note - in the future the gold linker may become deprecated. @@ -87,8 +89,8 @@ URL: https://sourceware.org/binutils %bcond_with debug # Default: Always build documentation. %bcond_without docs -# Default: Always run the testsuite. FIXME: Temporarily disable it. -%bcond_with testsuite +# Default: Always run the testsuite. +%bcond_without testsuite # Default: Not support debuginfod. %bcond_with debuginfod # Default: Not build binutils-gprofng package. @@ -224,7 +226,7 @@ Patch10: binutils-special-sections-in-groups.patch # Purpose: Fix linker testsuite failures. # Lifetime: Fixed in 2.39 (maybe) -Patch11: binutils-fix-testsuite-failures.patch +# Patch11: binutils-fix-testsuite-failures.patch # Purpose: Stop gold from aborting when input sections with the same name # have different flags. @@ -794,6 +796,7 @@ run_tests() return %endif +%if %strict_test pushd build-$target # FIXME: I have not been able to find a way to capture a "failed" return @@ -865,6 +868,84 @@ run_tests() fi popd +%else + pushd build-$target + +check_failure() +{ + local file="$1" + local knownfail="$2" + + if [ -f $file ]; then + echo ==================== PRINT $file ==================== + cat $file + + grep -e "^XPASS:\|^FAIL:" $file | while read line + do + if [[ "${knownfail[@]}" =~ "@${line}@" ]]; then + echo Expected: $line + else + echo UnExpected: $line + errorcode=1 + fi + done + fi +} + + echo ================ $target == TEST RUN =============================== + + if test x$native == x1 ; then + make -k check-gas check-binutils check-ld < /dev/null || : +%if %{with gold} + make -k check-gold < /dev/null || : +%endif + + local gas_failure=("@@") + local binutils_failure=("@@") + local ld_failure=("@@") + local gold_failure=("@@") + +%ifarch aarch64 + binutils_failure=( + "@FAIL: objdump -S@" + "@FAIL: objdump --source-comment@" + ) + ld_failure=( + "@XPASS: Run pr19719 fun undefined@" + ) +%endif + + if [ -f gas/testsuite/gas.sum ]; then + check_failure "gas/testsuite/gas.sum" "${gas_failure[*]}" + cat gas/testsuite/gas.log || : + fi + + if [ -f binutils/binutils.sum ]; then + check_failure "binutils/binutils.sum" "${binutils_failure[*]}" + cat binutils/binutils.log || : + fi + + if [ -f ld/ld.sum ]; then + check_failure "ld/ld.sum" "${ld_failure[*]}" + cat ld/ld.log || : + fi + +%if %{with gold} + if [ -f gold/test-suite.log ]; then + check_failure "gold/test-suite.log" "${gold_failure[*]}" + fi + + if [ -f gold/testsuite/test-suite.log ]; then + check_failure "gold/testsuite/test-suite.log" "${gold_failure[*]}" + cat gold/testsuite/*.log || : + fi +%endif + + if test x$errorcode == x1 ; then exit 1; fi + fi + + popd +%endif } #---------------------------------------------------------------------------- @@ -892,6 +973,7 @@ run_tests() compute_global_configuration +errorcode=0 # Build the native configuration. run_target_configuration %{_target_platform} 1 %{enable_shared} build_target %{_target_platform} @@ -1310,6 +1392,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Fri Aug 18 2023 eastb233 - 2.40-3 +- Enable running testcase + * Tue Aug 08 2023 eastb233 - 2.40-2 - In X86, change -fpic to -fPIC in PICFLAG -- Gitee