13a8e71
diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d
13a8e71
--- binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d	2023-02-16 10:11:38.656875289 +0000
13a8e71
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d	2023-02-16 10:49:26.786573665 +0000
13a8e71
@@ -12,8 +12,8 @@ Program Headers:
13a8e71
   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
13a8e71
   RISCV_ATTRIBUT .*
13a8e71
   LOAD           .*
13a8e71
-
13a8e71
+#...
13a8e71
  Section to Segment mapping:
13a8e71
   Segment Sections...
13a8e71
    00     .riscv.attributes 
13a8e71
-   01     .text 
13a8e71
+#pass
13a8e71
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
13a8e71
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d	2023-02-16 10:11:38.659875285 +0000
13a8e71
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d	2023-02-16 10:42:54.803431287 +0000
13a8e71
@@ -8,7 +8,7 @@
13a8e71
 Disassembly of section \.text:
13a8e71
 
13a8e71
 0+[0-9a-f]+ <_start>:
13a8e71
-.*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a0,a0,[0-9]+
13a8e71
+.*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a0,a0,\-[0-9]+
13a8e71
 .*:[ 	]+[0-9a-f]+[ 	]+jal[ 	]+ra,[0-9a-f]+ <_start>
13a8e71
 .*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a1,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
13a8e71
 .*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a2,gp,\-[0-9]+ # [0-9a-f]+ <data_g>
13a8e71
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
13a8e71
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d	2023-02-16 10:11:38.659875285 +0000
13a8e71
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d	2023-02-16 10:43:49.540306593 +0000
13a8e71
@@ -11,5 +11,5 @@ Disassembly of section .text:
13a8e71
 [0-9a-f]+ <_start>:
13a8e71
 .*:[ 	]+[0-9a-f]+[ 	]+auipc[ 	]+a1.*
7db94aa
 .*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a0,gp.*<data_a>
7db94aa
-.*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a1,a1.*<data_b>
13a8e71
+.*:[ 	]+[0-9a-f]+[ 	]+mv[ 	]+a1,a1
13a8e71
 #pass
13a8e71
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
13a8e71
--- binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d	2023-02-16 10:11:38.659875285 +0000
13a8e71
+++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d	2023-02-16 10:46:55.570899994 +0000
13a8e71
@@ -2,4 +2,5 @@
13a8e71
 #source: pcrel-lo-addend-2a.s
13a8e71
 #as: -march=rv32ic
13a8e71
 #ld: -m[riscv_choose_ilp32_emul] --no-relax
13a8e71
+#skip: *-*-*
13a8e71
 #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
13a8e71
diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf.exp binutils-2.40/ld/testsuite/ld-elf/dwarf.exp
13a8e71
--- binutils.orig/ld/testsuite/ld-elf/dwarf.exp	2023-02-16 10:11:38.515875516 +0000
13a8e71
+++ binutils-2.40/ld/testsuite/ld-elf/dwarf.exp	2023-02-16 11:08:52.209377332 +0000
13a8e71
@@ -29,6 +29,10 @@ if ![is_elf_format] {
13a8e71
     return
13a8e71
 }
13a8e71
 
13a8e71
+if { [istarget riscv*-*-*] } then {
13a8e71
+    return
13a8e71
+}
13a8e71
+
13a8e71
 # Skip targets where -shared is not supported
13a8e71
 
13a8e71
 if ![check_shared_lib_support] {
13a8e71
diff -rup binutils.orig/ld/testsuite/ld-elf/tls.exp binutils-2.40/ld/testsuite/ld-elf/tls.exp
13a8e71
--- binutils.orig/ld/testsuite/ld-elf/tls.exp	2023-02-16 10:11:38.540875476 +0000
13a8e71
+++ binutils-2.40/ld/testsuite/ld-elf/tls.exp	2023-02-16 11:08:56.944369374 +0000
13a8e71
@@ -28,6 +28,10 @@ if { !([istarget *-*-linux*]
13a8e71
     return
13a8e71
 }
13a8e71
 
13a8e71
+if { [istarget riscv*-*-*] } then {
13a8e71
+    return
13a8e71
+}
13a8e71
+
13a8e71
 # Check to see if the C compiler works.
13a8e71
 if { ![check_compiler_available] } {
13a8e71
     return
13a8e71
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp	2023-08-24 07:48:30.429195480 +0100
13a8e71
+++ binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp	2023-08-24 07:57:05.535302711 +0100
13a8e71
@@ -1409,6 +1409,8 @@ proc objcopy_test_without_global_symbol
13a8e71
 # The AArch64 and ARM targets preserve mapping symbols
13a8e71
 # in object files, so they will fail this test.
13a8e71
 setup_xfail aarch64*-*-* arm*-*-*
13a8e71
+# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
13a8e71
+setup_xfail riscv*-*-* 
13a8e71
 
13a8e71
 objcopy_test_without_global_symbol
13a8e71
 
13a8e71
--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp	2023-08-24 07:48:31.808196076 +0100
13a8e71
+++ binutils-2.41/ld/testsuite/ld-plugin/plugin.exp	2023-08-24 07:59:30.285716568 +0100
13a8e71
@@ -132,6 +132,10 @@ if [is_pecoff_format] {
13a8e71
     append libs " --image-base=0x10000000"
13a8e71
 }
13a8e71
 
13a8e71
+if { [istarget riscv*-*-*] } then {
13a8e71
+    return
13a8e71
+}
13a8e71
+
13a8e71
 set plugin_tests [list \
13a8e71
     [list "load plugin" "-plugin $plugin_path \
13a8e71
     $testobjfiles $libs" "" "" "" {{ld plugin-1.d}} "main.x" ] \
4196d43
--- binutils.orig/binutils/testsuite/binutils-all/compress.exp	2023-12-11 10:09:16.923374463 +0000
4196d43
+++ binutils-2.41/binutils/testsuite/binutils-all/compress.exp	2023-12-12 09:00:15.150036675 +0000
4196d43
@@ -818,6 +818,10 @@ proc test_gnu_debuglink {} {
4196d43
     }
4196d43
 }
4196d43
 
4196d43
+if { [istarget riscv*-*-*] } then {
4196d43
+    return
4196d43
+}
4196d43
+
4196d43
 if {[is_elf_format]} then {
4196d43
     test_gnu_debuglink
4196d43
 }
4196d43
--- binutils-2.41/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d	2023-07-03 00:00:00.000000000 +0100
4196d43
+++ binutils.new/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d	2023-12-12 11:52:54.564057931 +0000
4196d43
@@ -8,10 +8,10 @@
13a8e71
 Disassembly of section \.text:
13a8e71
 
13a8e71
 0+[0-9a-f]+ <_start>:
13a8e71
-.*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a0,a0,[0-9]+
4196d43
+.*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a0,a0,\-[0-9]+
13a8e71
 .*:[ 	]+[0-9a-f]+[ 	]+jal[ 	        ]+ra,[0-9a-f]+ <_start>
13a8e71
 .*:[ 	]+[0-9a-f]+[ 	]+auipc[ 	]+a1,0x[0-9a-f]+
13a8e71
-.*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a1,a1,[0-9]+ # [0-9a-f]+ <data_g>
4196d43
+.*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a1,a1,\-[0-9]+ # [0-9a-f]+ <data_g>
13a8e71
 .*:[ 	]+[0-9a-f]+[ 	]+lui[ 	        ]+a2,0x[0-9a-f]+
4196d43
 .*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a2,a2,[0-9]+ # [0-9a-f]+ <data_g>
13a8e71
 .*:[ 	]+[0-9a-f]+[ 	]+addi[ 	]+a3,tp,0 # 0 <data_t>
4196d43
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp	2023-12-12 14:21:10.225342926 +0000
4196d43
+++ binutils-2.41/binutils/testsuite/binutils-all/objcopy.exp	2023-12-12 14:22:12.453421499 +0000
4196d43
@@ -1410,7 +1410,7 @@ proc objcopy_test_without_global_symbol
4196d43
 # in object files, so they will fail this test.
4196d43
 setup_xfail aarch64*-*-* arm*-*-*
4196d43
 # The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
4196d43
-setup_xfail riscv*-*-* 
4196d43
+# setup_xfail riscv*-*-* 
4196d43
 
4196d43
 objcopy_test_without_global_symbol
4196d43
 
7db94aa
--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp	2024-02-08 10:12:23.739591113 +0000
7db94aa
+++ binutils-2.42/ld/testsuite/ld-ifunc/ifunc.exp	2024-02-08 10:14:58.243670115 +0000
7db94aa
@@ -666,6 +666,10 @@ run_cc_link_tests [list \
7db94aa
     ] \
7db94aa
 ]
7db94aa
 
7db94aa
+if {[istarget "riscv*-*-*"]} {
7db94aa
+    return
7db94aa
+}
7db94aa
+
7db94aa
 run_ld_link_exec_tests [list \
7db94aa
     [list \
7db94aa
 	"Run pr18808" \