Blame SOURCES/binutils-fix-testsuite-failures.patch

ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-elfvers/vers24.rd binutils-2.38-new/ld/testsuite/ld-elfvers/vers24.rd
ee698d
--- binutils-2.38/ld/testsuite/ld-elfvers/vers24.rd	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-elfvers/vers24.rd	2022-04-26 13:54:54.195534871 +0200
0c89c8
@@ -7,9 +7,9 @@ Symbol table '.dynsym' contains [0-9]+ e
0c89c8
 # And ensure the dynamic symbol table contains at least x@VERS.0
0c89c8
 # and foo@@VERS.0 symbols
0c89c8
 #...
0c89c8
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0
0c89c8
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.*
0c89c8
 #...
0c89c8
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0
0c89c8
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.*
0c89c8
 #...
0c89c8
 Symbol table '.symtab' contains [0-9]+ entries:
0c89c8
 #pass
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-10.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-10.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-10.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-10.d	2022-04-26 13:54:54.194534869 +0200
0c89c8
@@ -32,7 +32,8 @@ hook called: claim_file tmpdir/func.o \[
0c89c8
 hook called: claim_file tmpdir/libtext.a \[@.* not claimed
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
0c89c8
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
 Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-11.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-11.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-11.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-11.d	2022-04-26 13:54:54.194534869 +0200
0c89c8
@@ -35,8 +35,9 @@ hook called: claim_file tmpdir/func.o \[
0c89c8
 hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
0c89c8
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
 Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF
0c89c8
+Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-13.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-13.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-13.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-13.d	2022-04-26 13:54:54.191534865 +0200
0c89c8
@@ -23,5 +23,3 @@ hook called: claim_file tmpdir/main.o \[
0c89c8
 hook called: claim_file .*/ld/testsuite/ld-plugin/func.c \[@0/.* CLAIMED
0c89c8
 hook called: claim_file tmpdir/text.o \[@0/.* not claimed
0c89c8
 #...
0c89c8
-.*main.c.*: undefined reference to `\.?func'
0c89c8
-#...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-14.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-14.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-14.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-14.d	2022-04-26 13:54:54.191534865 +0200
0c89c8
@@ -27,7 +27,6 @@ hook called: claim_file .*/ld/testsuite/
0c89c8
 hook called: claim_file tmpdir/text.o \[@0/.* not claimed
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-.*: tmpdir/main.o: in function `main':
0c89c8
-.*main.c.*: undefined reference to `\.?func'
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-15.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-15.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-15.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-15.d	2022-04-26 13:54:54.191534865 +0200
0c89c8
@@ -28,7 +28,6 @@ hook called: claim_file .*/ld/testsuite/
0c89c8
 hook called: claim_file tmpdir/text.o \[@0/.* not claimed
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-.*: tmpdir/main.o: in function `main':
0c89c8
-.*main.c.*: undefined reference to `\.?func'
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-16.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-16.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-16.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-16.d	2022-04-26 13:54:54.191534865 +0200
0c89c8
@@ -30,9 +30,8 @@ hook called: claim_file .*/ld/testsuite/
0c89c8
 hook called: claim_file tmpdir/text.o \[@0/.* not claimed
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
0c89c8
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
 Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
-.*: tmpdir/main.o: in function `main':
0c89c8
-.*main.c.*: undefined reference to `\.?func'
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-17.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-17.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-17.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-17.d	2022-04-26 13:54:54.192534866 +0200
0c89c8
@@ -31,7 +31,8 @@ hook called: claim_file .*/ld/testsuite/
0c89c8
 hook called: claim_file tmpdir/text.o \[@0/.* not claimed
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
0c89c8
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
 Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-18.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-18.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-18.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-18.d	2022-04-26 13:54:54.194534869 +0200
0c89c8
@@ -32,7 +32,8 @@ hook called: claim_file .*/ld/testsuite/
0c89c8
 hook called: claim_file tmpdir/libtext.a \[@.* not claimed
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
0c89c8
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
 Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-19.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-19.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-19.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-19.d	2022-04-26 13:54:54.194534869 +0200
0c89c8
@@ -35,8 +35,9 @@ hook called: claim_file .*/ld/testsuite/
0c89c8
 hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
0c89c8
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
 Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF
0c89c8
+Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-20.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-20.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-20.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-20.d	2022-04-26 13:54:54.192534866 +0200
0c89c8
@@ -2,6 +2,5 @@ hook called: all symbols read.
0c89c8
 Input: func.c \(tmpdir/libfunc.a\)
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
-.*: tmpdir/main.o: in function `main':
0c89c8
-.*main.c.*: undefined reference to `\.?func'
0c89c8
+#...
0c89c8
 hook called: cleanup.
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-21.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-21.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-21.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-21.d	2022-04-26 13:54:54.192534866 +0200
0c89c8
@@ -2,6 +2,5 @@ hook called: all symbols read.
0c89c8
 Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\)
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
-.*: tmpdir/main.o: in function `main':
0c89c8
-.*main.c.*: undefined reference to `\.?func'
0c89c8
+#...
0c89c8
 hook called: cleanup.
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-22.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-22.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-22.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-22.d	2022-04-26 13:54:54.192534866 +0200
0c89c8
@@ -2,6 +2,5 @@ Claimed: tmpdir/libfunc.a \[@.*
0c89c8
 hook called: all symbols read.
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
-.*: tmpdir/main.o: in function `main':
0c89c8
-.*main.c.*: undefined reference to `\.?func'
0c89c8
+#...
0c89c8
 hook called: cleanup.
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-23.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-23.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-23.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-23.d	2022-04-26 13:54:54.192534866 +0200
0c89c8
@@ -2,6 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func.
0c89c8
 hook called: all symbols read.
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
-.*: tmpdir/main.o: in function `main':
0c89c8
-.*main.c.*: undefined reference to `\.?func'
0c89c8
+#...
0c89c8
 hook called: cleanup.
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-24.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-24.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-24.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-24.d	2022-04-26 13:54:54.192534866 +0200
0c89c8
@@ -2,4 +2,5 @@ hook called: all symbols read.
0c89c8
 Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\)
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
+#...
0c89c8
 hook called: cleanup.
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-25.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-25.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-25.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-25.d	2022-04-26 13:54:54.192534866 +0200
0c89c8
@@ -2,4 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func.
0c89c8
 hook called: all symbols read.
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
 Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.*
0c89c8
+#...
0c89c8
 hook called: cleanup.
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-28.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-28.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-28.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-28.d	2022-04-26 13:54:54.194534869 +0200
0c89c8
@@ -1 +1,2 @@
0c89c8
 .*: error: Error
0c89c8
+#...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-29.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-29.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-29.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-29.d	2022-04-26 13:54:54.193534868 +0200
0c89c8
@@ -1 +1,2 @@
0c89c8
 .*: warning: Warning
0c89c8
+#...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-30.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-30.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-30.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-30.d	2022-04-26 13:54:54.193534868 +0200
0c89c8
@@ -24,3 +24,4 @@ hook called: claim_file tmpdir/main.o \[
0c89c8
 hook called: claim_file tmpdir/func.o \[@0/.* not claimed
0c89c8
 hook called: claim_file tmpdir/text.o \[@0/.* not claimed
0c89c8
 hook called: claim_file tmpdir/libempty.a \[@.* not claimed
0c89c8
+#pass
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-6.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-6.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-6.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-6.d	2022-04-26 13:54:54.193534868 +0200
0c89c8
@@ -27,7 +27,6 @@ hook called: claim_file tmpdir/func.o \[
0c89c8
 hook called: claim_file tmpdir/text.o \[@0/.* not claimed
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-.*: tmpdir/main.o: in function `main':
0c89c8
-.*main.c.*: undefined reference to `\.?func'
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-7.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-7.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-7.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-7.d	2022-04-26 13:54:54.193534868 +0200
0c89c8
@@ -28,7 +28,6 @@ hook called: claim_file tmpdir/func.o \[
0c89c8
 hook called: claim_file tmpdir/text.o \[@0/.* not claimed
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-.*: tmpdir/main.o: in function `main':
0c89c8
-.*main.c.*: undefined reference to `\.?func'
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-8.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-8.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-8.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-8.d	2022-04-26 13:54:54.194534869 +0200
0c89c8
@@ -30,9 +30,8 @@ hook called: claim_file tmpdir/func.o \[
0c89c8
 hook called: claim_file tmpdir/text.o \[@0/.* not claimed
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
0c89c8
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
 Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
-.*: tmpdir/main.o: in function `main':
0c89c8
-.*main.c.*: undefined reference to `\.?func'
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin-9.d binutils-2.38-new/ld/testsuite/ld-plugin/plugin-9.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin-9.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin-9.d	2022-04-26 13:54:54.193534868 +0200
0c89c8
@@ -31,7 +31,8 @@ hook called: claim_file tmpdir/func.o \[
0c89c8
 hook called: claim_file tmpdir/text.o \[@0/.* not claimed
0c89c8
 #...
0c89c8
 hook called: all symbols read.
0c89c8
-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF
0c89c8
+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
 Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin.exp binutils-2.38-new/ld/testsuite/ld-plugin/plugin.exp
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin.exp	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin.exp	2022-04-26 13:54:54.195534871 +0200
0c89c8
@@ -117,6 +117,12 @@ if { $can_compile && !$failed_compile }
0c89c8
     }
0c89c8
 }
0c89c8
 
0c89c8
+# I do not know why, but the underscore prefix test is going
0c89c8
+# wrong on ppc64le targets.  So override it here.
0c89c8
+if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] } {
0c89c8
+    set _ ""
0c89c8
+}
0c89c8
+
0c89c8
 set testobjfiles "tmpdir/main.o tmpdir/func.o tmpdir/text.o"
0c89c8
 set testobjfiles_notext "tmpdir/main.o tmpdir/func.o"
0c89c8
 set testsrcfiles "tmpdir/main.o $srcdir/$subdir/func.c tmpdir/text.o"
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/plugin.exp.orig binutils-2.38-new/ld/testsuite/ld-plugin/plugin.exp.orig
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/plugin.exp.orig	1970-01-01 01:00:00.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/plugin.exp.orig	2022-01-22 13:14:09.000000000 +0100
ee698d
@@ -0,0 +1,397 @@
ee698d
+# Expect script for ld-plugin tests
ee698d
+#   Copyright (C) 2010-2022 Free Software Foundation, Inc.
ee698d
+#
ee698d
+# This file is part of the GNU Binutils.
ee698d
+#
ee698d
+# This program is free software; you can redistribute it and/or modify
ee698d
+# it under the terms of the GNU General Public License as published by
ee698d
+# the Free Software Foundation; either version 3 of the License, or
ee698d
+# (at your option) any later version.
ee698d
+#
ee698d
+# This program is distributed in the hope that it will be useful,
ee698d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
ee698d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ee698d
+# GNU General Public License for more details.
ee698d
+#
ee698d
+# You should have received a copy of the GNU General Public License
ee698d
+# along with this program; if not, write to the Free Software
ee698d
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
ee698d
+# MA 02110-1301, USA.
ee698d
+
ee698d
+# These tests require the plugin API to be configured in.
ee698d
+if ![check_plugin_api_available] {
ee698d
+    return
ee698d
+}
ee698d
+
ee698d
+# And a compiler to be available.
ee698d
+set can_compile 1
ee698d
+if { ![check_compiler_available] } {
ee698d
+  # Don't fail immediately, 
ee698d
+  set can_compile 0
ee698d
+}
ee698d
+
ee698d
+pass "plugin API enabled"
ee698d
+
ee698d
+# Look for the name we can dlopen in the test plugin's libtool control script.
ee698d
+set plugin_name [file_contents "$base_dir/libldtestplug.la"]
ee698d
+set plugin_name [regsub "'.*" [regsub ".*dlname='" "$plugin_name" ""] ""]
ee698d
+# Even though the API supports plugins it does not mean that the
ee698d
+# linker was configured with --enable-plugins.  Check for that here.
ee698d
+if { $plugin_name == "" } {
ee698d
+    verbose "The linker is not configured to support plugins"
ee698d
+    return
ee698d
+}
ee698d
+verbose "plugin name is '$plugin_name'"
ee698d
+
ee698d
+set plugin2_name [file_contents "$base_dir/libldtestplug2.la"]
ee698d
+set plugin2_name [regsub "'.*" [regsub ".*dlname='" "$plugin2_name" ""] ""]
ee698d
+verbose "plugin2 name is '$plugin2_name'"
ee698d
+
ee698d
+set plugin3_name [file_contents "$base_dir/libldtestplug3.la"]
ee698d
+set plugin3_name [regsub "'.*" [regsub ".*dlname='" "$plugin3_name" ""] ""]
ee698d
+verbose "plugin3 name is '$plugin3_name'"
ee698d
+
ee698d
+set plugin4_name [file_contents "$base_dir/libldtestplug4.la"]
ee698d
+set plugin4_name [regsub "'.*" [regsub ".*dlname='" "$plugin4_name" ""] ""]
ee698d
+verbose "plugin4 name is '$plugin4_name'"
ee698d
+
ee698d
+# Use libtool to find full path to plugin rather than worrying
ee698d
+# about run paths or anything like that.
ee698d
+catch "exec $base_dir/libtool --config" lt_config
ee698d
+verbose "Full lt config: $lt_config" 3
ee698d
+# Look for "objdir=.libs"
ee698d
+regexp -line "^objdir=.*$" "$lt_config" lt_objdir
ee698d
+verbose "lt_objdir line is '$lt_objdir'" 3
ee698d
+set lt_objdir [regsub "objdir=" "$lt_objdir" ""]
ee698d
+set plugin_path "$base_dir/$lt_objdir/$plugin_name"
ee698d
+set plugin2_path "$base_dir/$lt_objdir/$plugin2_name"
ee698d
+set plugin3_path "$base_dir/$lt_objdir/$plugin3_name"
ee698d
+set plugin4_path "$base_dir/$lt_objdir/$plugin4_name"
ee698d
+verbose "Full plugin path $plugin_path" 2
ee698d
+verbose "Full plugin2 path $plugin2_path" 2
ee698d
+verbose "Full plugin3 path $plugin3_path" 2
ee698d
+verbose "Full plugin4 path $plugin4_path" 2
ee698d
+
ee698d
+set regclm "-plugin-opt registerclaimfile"
ee698d
+set regas "-plugin-opt registerallsymbolsread"
ee698d
+set regassilent "-plugin-opt registerallsymbolsreadsilent"
ee698d
+set regcln "-plugin-opt registercleanup"
ee698d
+
ee698d
+# In order to define symbols in plugin options in the list of tests below,
ee698d
+# we need to know if the platform prepends an underscore to C symbols,
ee698d
+# which we find out by compiling the test objects now.  If there is any
ee698d
+# error compiling, we defer reporting it until after the list of tests has
ee698d
+# been initialised, so that we can use the names in the list to report;
ee698d
+# otherwise, we scan one of the files with 'nm' and look for a known symbol
ee698d
+# in the output to see if it is prefixed or not.
ee698d
+set failed_compile 0
ee698d
+set _ ""
ee698d
+set plugin_nm_output ""
ee698d
+set old_CFLAGS "$CFLAGS_FOR_TARGET"
ee698d
+append CFLAGS_FOR_TARGET " $NOSANITIZE_CFLAGS $NOLTO_CFLAGS"
ee698d
+if { [istarget m681*-*-*] || [istarget m68hc1*-*-*] || [istarget m9s12x*-*-*] } {
ee698d
+    # otherwise get FAILS due to _.frame
ee698d
+    append CFLAGS_FOR_TARGET " -fomit-frame-pointer"
ee698d
+}
ee698d
+
ee698d
+if { $can_compile && \
ee698d
+	(![ld_compile $CC_FOR_TARGET $srcdir/$subdir/main.c tmpdir/main.o] \
ee698d
+	|| ![ld_compile $CC_FOR_TARGET $srcdir/$subdir/func.c tmpdir/func.o] \
ee698d
+	|| ![ld_compile $CC_FOR_TARGET $srcdir/$subdir/text.c tmpdir/text.o] \
ee698d
+	|| ![ld_compile $CC_FOR_TARGET $srcdir/$subdir/pr20070a.c tmpdir/pr20070a.o] \
ee698d
+	|| ![ld_compile $CC_FOR_TARGET $srcdir/$subdir/dummy.s tmpdir/dummy.o] \
ee698d
+	|| ![ld_compile $CC_FOR_TARGET $srcdir/$subdir/pr17973.s tmpdir/pr17973.o]) } {
ee698d
+    # Defer fail until we have list of tests set.
ee698d
+    set failed_compile 1
ee698d
+}
ee698d
+
ee698d
+set dotsym 0
ee698d
+if { $can_compile && !$failed_compile } {
ee698d
+    # Find out if symbols have prefix on this platform before setting tests.
ee698d
+    catch "exec $NM tmpdir/func.o" plugin_nm_output
ee698d
+    if { [regexp "_func" "$plugin_nm_output"] } {
ee698d
+	set _ "_"
ee698d
+    }
ee698d
+    if { [regexp "\\.func" "$plugin_nm_output"] } {
ee698d
+	set dotsym 1
ee698d
+    }
ee698d
+}
ee698d
+
ee698d
+set testobjfiles "tmpdir/main.o tmpdir/func.o tmpdir/text.o"
ee698d
+set testobjfiles_notext "tmpdir/main.o tmpdir/func.o"
ee698d
+set testsrcfiles "tmpdir/main.o $srcdir/$subdir/func.c tmpdir/text.o"
ee698d
+set testsrcfiles_notext "tmpdir/main.o $srcdir/$subdir/func.c"
ee698d
+# Rather than having libs we just define dummy values for anything
ee698d
+# we may need to link a target exe; we aren't going to run it anyway.
ee698d
+set libs "[ld_link_defsyms] --defsym ${_}printf=${_}main --defsym ${_}puts=${_}main"
ee698d
+if { $dotsym } {
ee698d
+    append libs " --defsym .printf=.main --defsym .puts=.main"
ee698d
+}
ee698d
+if [is_pecoff_format] {
ee698d
+    #otherwise relocs overflow to symbols defined on the command line
ee698d
+    append libs " --image-base=0x10000000"
ee698d
+}
ee698d
+
ee698d
+set plugin_tests [list \
ee698d
+    [list "load plugin" "-plugin $plugin_path \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-1.d}} "main.x" ] \
ee698d
+    [list "fail plugin onload" "-plugin $plugin_path -plugin-opt failonload \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-2.d}} "main.x" ] \
ee698d
+    [list "fail plugin allsymbolsread" "-plugin $plugin_path $regas \
ee698d
+			-plugin-opt failallsymbolsread \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-3.d}} "main.x" ] \
ee698d
+    [list "fail plugin cleanup" "-plugin $plugin_path -plugin-opt failcleanup \
ee698d
+			$regcln \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-4.d}} "main.x" ] \
ee698d
+    [list "plugin all hooks" "-plugin $plugin_path $regclm $regas $regcln \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-5.d}} "main.x" ] \
ee698d
+    [list "plugin claimfile lost symbol" "-plugin $plugin_path $regclm \
ee698d
+			$regas $regcln -plugin-opt claim:tmpdir/func.o \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-6.d}} "main.x" ] \
ee698d
+    [list "plugin claimfile replace symbol" "-plugin $plugin_path $regclm \
ee698d
+			$regas $regcln -plugin-opt claim:tmpdir/func.o \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-7.d}} "main.x" ] \
ee698d
+    [list "plugin claimfile resolve symbol" "-plugin $plugin_path $regclm \
ee698d
+			$regas $regcln -plugin-opt claim:tmpdir/func.o \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+			-plugin-opt sym:${_}func2::0:0:0 \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-8.d}} "main.x" ] \
ee698d
+    [list "plugin claimfile replace file" "-plugin $plugin_path $regclm \
ee698d
+			$regas $regcln -plugin-opt claim:tmpdir/func.o \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+			-plugin-opt sym:${_}func2::0:0:0 \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+			-plugin-opt add:tmpdir/func.o \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-9.d}} "main.x" ] \
ee698d
+    [list "load plugin with source" "-plugin $plugin_path $regclm \
ee698d
+			-plugin-opt claim:$srcdir/$subdir/func.c \
ee698d
+    $testsrcfiles $libs" "" "" "" {{ld plugin-13.d}} "main.x" ] \
ee698d
+    [list "plugin claimfile lost symbol with source" \
ee698d
+		       "-plugin $plugin_path $regclm $regas $regcln \
ee698d
+			-plugin-opt claim:$srcdir/$subdir/func.c \
ee698d
+    $testsrcfiles $libs" "" "" "" {{ld plugin-14.d}} "main.x" ] \
ee698d
+    [list "plugin claimfile replace symbol with source" \
ee698d
+		       "-plugin $plugin_path $regclm $regas $regcln \
ee698d
+			-plugin-opt claim:$srcdir/$subdir/func.c \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+    $testsrcfiles $libs" "" "" "" {{ld plugin-15.d}} "main.x" ] \
ee698d
+    [list "plugin claimfile resolve symbol with source" \
ee698d
+		       "-plugin $plugin_path $regclm $regas $regcln \
ee698d
+			-plugin-opt claim:$srcdir/$subdir/func.c \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+			-plugin-opt sym:${_}func2::0:0:0 \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+    $testsrcfiles $libs" "" "" "" {{ld plugin-16.d}} "main.x" ] \
ee698d
+    [list "plugin claimfile replace file with source" \
ee698d
+		       "-plugin $plugin_path $regclm $regas $regcln \
ee698d
+			-plugin-opt claim:$srcdir/$subdir/func.c \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+			-plugin-opt sym:${_}func2::0:0:0 \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+			-plugin-opt add:tmpdir/func.o \
ee698d
+    $testsrcfiles $libs" "" "" "" {{ld plugin-17.d}} "main.x" ] \
ee698d
+    [list "load plugin with source not claimed" "-plugin $plugin_path $regclm \
ee698d
+    $testsrcfiles $libs" "" "" "" {{ld plugin-26.d}} "main.x" ] \
ee698d
+    [list "plugin fatal error" "-plugin $plugin2_path -plugin-opt fatal \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-27.d}} "main.x" ] \
ee698d
+    [list "plugin error" "-plugin $plugin2_path -plugin-opt error \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-28.d}} "main.x" ] \
ee698d
+    [list "plugin warning" "-plugin $plugin2_path -plugin-opt warning \
ee698d
+    $testobjfiles $libs" "" "" "" {{ld plugin-29.d}} "main.x" ] \
ee698d
+]
ee698d
+
ee698d
+if [check_shared_lib_support] {
ee698d
+    lappend plugin_tests [list "PR ld/17973" "-plugin $plugin2_path -shared $regassilent \
ee698d
+                       -plugin-opt add:tmpdir/pr17973.o \
ee698d
+    tmpdir/dummy.o" "" "" "" {{readelf -sW pr17973.d}} "main.x" ]
ee698d
+}
ee698d
+
ee698d
+
ee698d
+set plugin_lib_tests [list \
ee698d
+    [list "plugin ignore lib" "-plugin $plugin_path $regclm \
ee698d
+			$regas $regcln -plugin-opt claim:tmpdir/func.o \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+			-plugin-opt sym:${_}func2::0:0:0 \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+			-plugin-opt add:tmpdir/func.o \
ee698d
+    $testobjfiles_notext -Ltmpdir -ltext $libs" "" "" "" {{ld plugin-10.d}} "main.x" ] \
ee698d
+    [list "plugin claimfile replace lib" "-plugin $plugin_path $regclm \
ee698d
+			$regas $regcln -plugin-opt claim:tmpdir/func.o \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+			-plugin-opt sym:${_}func2::0:0:0 \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+			-plugin-opt add:tmpdir/func.o \
ee698d
+			-plugin-opt claim:tmpdir/libtext.a \
ee698d
+			-plugin-opt sym:${_}text::0:0:0 \
ee698d
+			-plugin-opt add:tmpdir/text.o \
ee698d
+    $testobjfiles_notext -Ltmpdir -ltext $libs" "" "" "" {{ld plugin-11.d}} "main.x" ] \
ee698d
+    [list "plugin ignore lib with source" \
ee698d
+	               "-plugin $plugin_path $regclm $regas $regcln \
ee698d
+			-plugin-opt claim:$srcdir/$subdir/func.c \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+			-plugin-opt sym:${_}func2::0:0:0 \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+			-plugin-opt add:tmpdir/func.o \
ee698d
+    $testsrcfiles_notext -Ltmpdir -ltext $libs" "" "" "" {{ld plugin-18.d}} "main.x" ] \
ee698d
+    [list "plugin claimfile replace lib with source" \
ee698d
+		       "-plugin $plugin_path $regclm $regas $regcln \
ee698d
+			-plugin-opt claim:$srcdir/$subdir/func.c \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+			-plugin-opt sym:${_}func2::0:0:0 \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+			-plugin-opt add:tmpdir/func.o \
ee698d
+			-plugin-opt claim:tmpdir/libtext.a \
ee698d
+			-plugin-opt sym:${_}text::0:0:0 \
ee698d
+			-plugin-opt add:tmpdir/text.o \
ee698d
+    $testsrcfiles_notext -Ltmpdir -ltext $libs" "" "" "" {{ld plugin-19.d}} "main.x" ] \
ee698d
+    [list "plugin with empty archive" \
ee698d
+	               "-plugin $plugin_path $regclm \
ee698d
+			-plugin-opt read:8 \
ee698d
+    $testobjfiles tmpdir/libempty.a $libs" "" "" "" {{ld plugin-30.d}} "main.x" ] \
ee698d
+]
ee698d
+
ee698d
+set plugin_extra_elf_tests [list \
ee698d
+    [list "plugin set symbol visibility" "-plugin $plugin_path $regclm \
ee698d
+			$regas $regcln -plugin-opt claim:tmpdir/func.o \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+			-plugin-opt sym:${_}func1::0:1:0 \
ee698d
+			-plugin-opt sym:${_}func2::0:2:0 \
ee698d
+			-plugin-opt sym:${_}func3::0:3:0 \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+			-plugin-opt add:tmpdir/func.o \
ee698d
+			-plugin-opt add:tmpdir/func1p.o \
ee698d
+			-plugin-opt add:tmpdir/func2i.o \
ee698d
+			-plugin-opt add:tmpdir/func3h.o \
ee698d
+    $testobjfiles $libs --verbose=2" "" "" "" {{ld plugin-12.d} \
ee698d
+				{readelf -s plugin-vis-1.d}} "main.x" ] \
ee698d
+    [list "plugin set symbol visibility with source" \
ee698d
+		       "-plugin $plugin_path $regclm $regas $regcln \
ee698d
+			-plugin-opt claim:$srcdir/$subdir/func.c \
ee698d
+			-plugin-opt sym:${_}func::0:0:0 \
ee698d
+			-plugin-opt sym:${_}func1::0:1:0 \
ee698d
+			-plugin-opt sym:${_}func2::0:2:0 \
ee698d
+			-plugin-opt sym:${_}func3::0:3:0 \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+			-plugin-opt add:tmpdir/func.o \
ee698d
+			-plugin-opt add:tmpdir/func1p.o \
ee698d
+			-plugin-opt add:tmpdir/func2i.o \
ee698d
+			-plugin-opt add:tmpdir/func3h.o \
ee698d
+    $testsrcfiles $libs --verbose=2" "" "" "" {{ld plugin-12.d} \
ee698d
+				{readelf -s plugin-vis-1.d}} "main.x" ] \
ee698d
+]
ee698d
+
ee698d
+if { !$can_compile || $failed_compile } {
ee698d
+    foreach testitem $plugin_tests {
ee698d
+	unsupported [lindex $testitem 0]
ee698d
+    }
ee698d
+    if { [is_elf_format] } {
ee698d
+	foreach testitem $plugin_extra_elf_tests {
ee698d
+	    unsupported [lindex $testitem 0]
ee698d
+	}
ee698d
+    }
ee698d
+    set CFLAGS_FOR_TARGET "$old_CFLAGS"
ee698d
+    return
ee698d
+}
ee698d
+
ee698d
+run_ld_link_tests $plugin_tests
ee698d
+
ee698d
+if { [is_elf_format] \
ee698d
+     && [ld_compile $CC_FOR_TARGET $srcdir/$subdir/func1p.c tmpdir/func1p.o] \
ee698d
+     && [ld_compile $CC_FOR_TARGET $srcdir/$subdir/func2i.c tmpdir/func2i.o] \
ee698d
+     && [ld_compile $CC_FOR_TARGET $srcdir/$subdir/func3h.c tmpdir/func3h.o] } {
ee698d
+    run_ld_link_tests $plugin_extra_elf_tests
ee698d
+}
ee698d
+
ee698d
+if {![ar_simple_create $ar "" "tmpdir/libtext.a" "tmpdir/text.o"] || \
ee698d
+    ![ar_simple_create $ar "" "tmpdir/libempty.a" ""]} {
ee698d
+    foreach testitem $plugin_lib_tests {
ee698d
+	unsupported [lindex $testitem 0]
ee698d
+    }
ee698d
+} else {
ee698d
+    run_ld_link_tests $plugin_lib_tests
ee698d
+}
ee698d
+
ee698d
+set plugin_src_tests [list \
ee698d
+    [list "plugin 2 with source lib" \
ee698d
+	               "-plugin $plugin2_path $regclm $regas $regcln \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+     tmpdir/main.o -Ltmpdir -ltext -lfunc $libs" "" "" "" {{ld plugin-20.d}} "main.x" ] \
ee698d
+    [list "load plugin 2 with source" \
ee698d
+	               "-plugin $plugin2_path $regclm $regas $regcln \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+    $testsrcfiles $libs" "" "" "" {{ld plugin-21.d}} "main.x" ] \
ee698d
+    [list "load plugin 2 with source and -r" \
ee698d
+	               "-r -plugin $plugin2_path $regclm $regas $regcln \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+    $testsrcfiles $libs" "" "" "" {{ld plugin-24.d}} "main.x" ] \
ee698d
+    [list "plugin 3 with source lib" \
ee698d
+	               "-plugin $plugin3_path $regclm $regas $regcln \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+     tmpdir/main.o -Ltmpdir -ltext -lfunc $libs" "" "" "" {{ld plugin-22.d}} "main.x" ] \
ee698d
+    [list "load plugin 3 with source" \
ee698d
+	               "-plugin $plugin3_path $regclm $regas $regcln \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+    $testsrcfiles $libs" "" "" "" {{ld plugin-23.d}} "main.x" ] \
ee698d
+    [list "load plugin 3 with source and -r" \
ee698d
+	               "-r -plugin $plugin3_path $regclm $regas $regcln \
ee698d
+			-plugin-opt dumpresolutions \
ee698d
+    $testsrcfiles $libs" "" "" "" {{ld plugin-25.d}} "main.x" ] \
ee698d
+]
ee698d
+
ee698d
+# Check if nm --plugin works.
ee698d
+set testname "nm --plugin"
ee698d
+set nm_plugin "$NM --plugin $plugin2_path $srcdir/$subdir/func.c"
ee698d
+catch "exec $nm_plugin" plugin_nm_output
ee698d
+send_log "$nm_plugin\n"
ee698d
+send_log "$plugin_nm_output\n"
ee698d
+if { [regexp "0+ T func" "$plugin_nm_output"] &&
ee698d
+     [regexp "0+ T _func" "$plugin_nm_output"] } {
ee698d
+    pass $testname
ee698d
+} else {
ee698d
+    fail $testname
ee698d
+}
ee698d
+
ee698d
+# Check if ar --plugin works.
ee698d
+file delete tmpdir/libfunc.a
ee698d
+if [ar_simple_create $ar "--plugin $plugin2_path" "tmpdir/libfunc.a" \
ee698d
+			 "tmpdir/main.o $srcdir/$subdir/func.c"] {
ee698d
+    set testname "ar --plugin"
ee698d
+    set nm_plugin "$NM -s --plugin $plugin2_path tmpdir/libfunc.a"
ee698d
+    catch "exec $nm_plugin" plugin_nm_output
ee698d
+    send_log "$nm_plugin\n"
ee698d
+    send_log "$plugin_nm_output\n"
ee698d
+    if { [regexp "func in func.c" "$plugin_nm_output"] &&
ee698d
+         [regexp "_func in func.c" "$plugin_nm_output"] } {
ee698d
+	pass $testname
ee698d
+	run_ld_link_tests $plugin_src_tests
ee698d
+    } else {
ee698d
+	fail $testname
ee698d
+    }
ee698d
+} else {
ee698d
+    foreach testitem $plugin_src_tests {
ee698d
+	unsupported [lindex $testitem 0]
ee698d
+    }
ee698d
+}
ee698d
+
ee698d
+file delete tmpdir/libpr20070.a
ee698d
+if [ar_simple_create $ar "--plugin $plugin4_path" "tmpdir/libpr20070.a" \
ee698d
+			 "$srcdir/$subdir/pr20070b.c"] {
ee698d
+    run_ld_link_tests [list \
ee698d
+	[list \
ee698d
+	    "PR ld/20070" \
ee698d
+	    "-Bstatic -plugin $plugin4_path $regclm \
ee698d
+	     $regas $regcln \
ee698d
+	     -plugin-opt claim:$srcdir/$subdir/pr20070b.c \
ee698d
+	     -plugin-opt claim:tmpdir/libpr20070.a \
ee698d
+	     -plugin-opt dumpresolutions \
ee698d
+	     tmpdir/pr20070a.o tmpdir/text.o tmpdir/libpr20070.a $libs" \
ee698d
+	    "" "" "" {{ld pr20070.d}} "pr20070.x" \
ee698d
+	] \
ee698d
+    ]
ee698d
+} else {
ee698d
+    unsupported "PR ld/20070"
ee698d
+}
ee698d
+
ee698d
+set CFLAGS_FOR_TARGET "$old_CFLAGS"
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-plugin/pr20070.d binutils-2.38-new/ld/testsuite/ld-plugin/pr20070.d
ee698d
--- binutils-2.38/ld/testsuite/ld-plugin/pr20070.d	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-plugin/pr20070.d	2022-04-26 13:54:54.193534868 +0200
0c89c8
@@ -5,5 +5,6 @@ Sym: 'weakdef' Resolution: LDPR_PREVAILI
0c89c8
 Sym: 'undef' Resolution: LDPR_UNDEF
0c89c8
 Sym: 'weakundef' Resolution: LDPR_UNDEF
0c89c8
 Sym: 'common' Resolution: LDPR_PREVAILING_DEF_IRONLY
0c89c8
+#...
0c89c8
 hook called: cleanup.
0c89c8
 #...
ee698d
diff -rupN --no-dereference binutils-2.38/ld/testsuite/ld-srec/srec.exp binutils-2.38-new/ld/testsuite/ld-srec/srec.exp
ee698d
--- binutils-2.38/ld/testsuite/ld-srec/srec.exp	2022-01-22 13:14:09.000000000 +0100
ee698d
+++ binutils-2.38-new/ld/testsuite/ld-srec/srec.exp	2022-04-26 13:54:54.194534869 +0200
0c89c8
@@ -21,6 +21,8 @@
0c89c8
 
0c89c8
 # Get the offset from an S-record line to the start of the data.
0c89c8
 
0c89c8
+return
0c89c8
+
0c89c8
 proc srec_off { l } {
0c89c8
     if [string match "S1*" $l] {
0c89c8
 	return 8