XCOFF ld testsuite fixes

Alan Modra amodra@gmail.com
Mon Jul 13 10:15:12 GMT 2020


On Mon, Jul 13, 2020 at 09:14:06AM +0200, Jan Beulich wrote:
> On 07.07.2020 10:56, Alan Modra via Binutils wrote:
> > 	* testsuite/ld-scripts/align.exp: Don't exclude xcoff.  Pass
> > 	-bnogc ld option for xcoff.
> > 	* testsuite/ld-scripts/provide.exp: Likewise.
> > 	* testsuite/ld-scripts/data.exp: Pass -bnogc ld option for xcoff.
> > 	* testsuite/ld-scripts/default-script.exp: Likewise.
> > 	* testsuite/ld-scripts/defined.exp: Likewise.
> > 	* testsuite/ld-scripts/empty-address.exp: Likewise.
> > 	* testsuite/ld-scripts/expr.exp: Likewise.
> > 	* testsuite/ld-scripts/include.exp: Likewise.
> > 	* testsuite/ld-scripts/script.exp: Likewise.
> > 	* testsuite/ld-scripts/assign-loc.d: Don't exclude xcoff.
> > 	* testsuite/ld-scripts/defined3.d: Likewise.
> > 	* testsuite/ld-scripts/defined4.d: Likewise.
> > 	* testsuite/ld-scripts/pr18963.d: Likewise.
> > 	* testsuite/ld-scripts/sane1.d: Likewise.
> > 	* testsuite/ld-scripts/segment-start.d: Likewise.
> > 	* testsuite/ld-scripts/include-1.d: Likewise, and relax text vma.
> > 	* testsuite/ld-scripts/defined5.d: Update xfail and comment.
> > 	* testsuite/ld-scripts/defined5.s: Tweak "defined" to be at
> > 	non-zero section offset.
> > 	* testsuite/ld-scripts/fill16.d: xfail for xcoff.
> > 	* testsuite/ld-scripts/provide-2.d: Accept more symbols.
> > 	* testsuite/ld-scripts/provide-4.d: Likewise.
> > 	* testsuite/ld-scripts/provide-5.d: Likewise.
> > 	* testsuite/ld-scripts/provide-6.d: Likewise.
> > 	* testsuite/ld-scripts/provide-7.d: Likewise.
> > 	* testsuite/ld-scripts/align.t: Accept xcoff mapped .text and .data.
> > 	* testsuite/ld-scripts/defined3.t: Likewise.
> > 	* testsuite/ld-scripts/defined4.t: Likewise.
> > 	* testsuite/ld-scripts/defined5.t: Likewise.
> > 	* testsuite/ld-scripts/fill.t: Likewise.
> > 	* testsuite/ld-scripts/include-subdata.t: Likewise.
> > 	* testsuite/ld-scripts/provide-1.t: Likewise.
> > 	* testsuite/ld-scripts/provide-2.t: Likewise.
> > 	* testsuite/ld-scripts/provide-3.t: Likewise.
> > 	* testsuite/ld-scripts/provide-4.t: Likewise.
> > 	* testsuite/ld-scripts/provide-5.t: Likewise.
> > 	* testsuite/ld-scripts/provide-6.t: Likewise.
> > 	* testsuite/ld-scripts/provide-7.t: Likewise.
> > 	* testsuite/ld-scripts/provide-8.t: Likewise.
> 
> Alan,
> 
> presumably as of this change I'm observing, for x86_64-cygwin and
> besides many FAIL-s no longer occurring there,
> 
> XPASS: ld-scripts/provide-6
> XPASS: ld-scripts/provide-8
> 
> Was it perhaps meant for the respective xfail attributes of the
> tests to be dropped? Or am I running in so much different an env
> (cross build on 64-bit Linux) than you?

I regularly build a cross to x86_64-w64-mingw32 but not to
x86_64-cygwin.  So I didn't see this difference in test results.

Of course, the test just having "xfail: x86_64-*-cygwin" isn't good,
since presumably if a test fails on x86_64-cygwin then it also fails
on x86_64-*-pe* and x86_64-*-mingw*.

Does the following work for you?

binutils/
	* testsuite/lib/binutils-common.exp (is_pecoff_format): Accept
	optional machine-os arg.
ld/
	* testsuite/ld-scripts/default-script1.d: Don't skip, xfail
	using is_pecoff_format.
	* testsuite/ld-scripts/default-script2.d: Likewise.
	* testsuite/ld-scripts/default-script3.d: Likewise.
	* testsuite/ld-scripts/default-script4.d: Likewise.
	* testsuite/ld-scripts/pr20302.d: Remove x86_64-*-cygwin from notarget.
	* testsuite/ld-scripts/provide-6.d: Remove x86_64-*-cygwin from xfail.
	* testsuite/ld-scripts/provide-8.d: Likewise.

diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
index 948b910b83..345840c0b2 100644
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -94,15 +94,20 @@ proc is_aout_format {} {
 
 # True if the object format is known to be PE COFF.
 #
-proc is_pecoff_format {} {
-    if { [istarget *-*-beospe*]
-	 || [istarget *-*-cegcc*]
-	 || [istarget *-*-cygwin*]
-	 || [istarget *-*-interix*]
-	 || [istarget *-*-mingw*]
-	 || [istarget *-*-netbsdpe*]
-	 || [istarget *-*-pe*]
-	 || [istarget *-*-winnt*] } {
+proc is_pecoff_format args {
+    if { [llength $args] == 1 } {
+	set m_os [lindex $args 0]
+    } else {
+	set m_os *-*
+    }
+    if { [istarget $m_os-beospe*]
+	 || [istarget $m_os-cegcc*]
+	 || [istarget $m_os-cygwin*]
+	 || [istarget $m_os-interix*]
+	 || [istarget $m_os-mingw*]
+	 || [istarget $m_os-netbsdpe*]
+	 || [istarget $m_os-pe*]
+	 || [istarget $m_os-winnt*] } {
 	return 1
     }
     return 0
diff --git a/ld/testsuite/ld-scripts/default-script1.d b/ld/testsuite/ld-scripts/default-script1.d
index 110b30e344..ec88067f43 100644
--- a/ld/testsuite/ld-scripts/default-script1.d
+++ b/ld/testsuite/ld-scripts/default-script1.d
@@ -1,7 +1,7 @@
-# source: default-script.s
-# ld: -defsym _START=0x800 -T default-script.t
-# nm: -n
-# skip: x86_64-*-mingw* x86_64-*-cygwin
+#source: default-script.s
+#ld: -defsym _START=0x800 -T default-script.t
+#nm: -n
+#xfail: {[is_pecoff_format x86_64-*]}
 # Skipped on Mingw64 and Cygwin because the image base defaults to 0x100000000
 
 #...
diff --git a/ld/testsuite/ld-scripts/default-script2.d b/ld/testsuite/ld-scripts/default-script2.d
index 3fd4386453..b10ac96288 100644
--- a/ld/testsuite/ld-scripts/default-script2.d
+++ b/ld/testsuite/ld-scripts/default-script2.d
@@ -1,7 +1,7 @@
-# source: default-script.s
-# ld: -T default-script.t -defsym _START=0x800
-# nm: -n
-# skip: x86_64-*-mingw* x86_64-*-cygwin
+#source: default-script.s
+#ld: -T default-script.t -defsym _START=0x800
+#nm: -n
+#xfail: {[is_pecoff_format x86_64-*]}
 # Skipped on Mingw64 and Cygwin because the image base defaults to 0x100000000
 
 #...
diff --git a/ld/testsuite/ld-scripts/default-script3.d b/ld/testsuite/ld-scripts/default-script3.d
index 43164bddc7..4742bc31e4 100644
--- a/ld/testsuite/ld-scripts/default-script3.d
+++ b/ld/testsuite/ld-scripts/default-script3.d
@@ -1,7 +1,7 @@
-# source: default-script.s
-# ld: -defsym _START=0x800 -dT default-script.t
-# nm: -n
-# skip: x86_64-*-mingw* x86_64-*-cygwin
+#source: default-script.s
+#ld: -defsym _START=0x800 -dT default-script.t
+#nm: -n
+#xfail: {[is_pecoff_format x86_64-*]}
 # Skipped on Mingw64 and Cygwin because the image base defaults to 0x100000000
 
 #...
diff --git a/ld/testsuite/ld-scripts/default-script4.d b/ld/testsuite/ld-scripts/default-script4.d
index d92e9d6089..09b6dbf08b 100644
--- a/ld/testsuite/ld-scripts/default-script4.d
+++ b/ld/testsuite/ld-scripts/default-script4.d
@@ -1,7 +1,7 @@
-# source: default-script.s
-# ld: --default-script default-script.t -defsym _START=0x800
-# nm: -n
-# skip: x86_64-*-mingw* x86_64-*-cygwin
+#source: default-script.s
+#ld: --default-script default-script.t -defsym _START=0x800
+#nm: -n
+#xfail: {[is_pecoff_format x86_64-*]}
 # Skipped on Mingw64 and Cygwin because the image base defaults to 0x100000000
 
 #...
diff --git a/ld/testsuite/ld-scripts/pr20302.d b/ld/testsuite/ld-scripts/pr20302.d
index b89e32b349..7eb25ce858 100644
--- a/ld/testsuite/ld-scripts/pr20302.d
+++ b/ld/testsuite/ld-scripts/pr20302.d
@@ -1,11 +1,10 @@
 #ld: -Tdata=0x1000 -Tdata=0x2000 -Tcross2.t
 #source: align2a.s
 #objdump: -h
-#notarget: *-*-*aout *-*-netbsd *-*-vms ns32k-*-* rx-*-* x86_64-*-cygwin
+#notarget: *-*-*aout *-*-netbsd *-*-vms ns32k-*-* rx-*-*
 # AOUT and NETBSD (ns32k is aout) have fixed address for the data section.
 # VMS targets need extra libraries.
 # RX uses non standard section names.
-# x86_64 Cygwin biases all start addresses to be > 2Gb.
 
 #...
   . \.data[ 	]+0+[0-9a-f]+[ 	]+0+02000[ 	]+0+02000.*
diff --git a/ld/testsuite/ld-scripts/provide-6.d b/ld/testsuite/ld-scripts/provide-6.d
index 6b3808ee4e..27a2d0d5a0 100644
--- a/ld/testsuite/ld-scripts/provide-6.d
+++ b/ld/testsuite/ld-scripts/provide-6.d
@@ -1,7 +1,6 @@
 #source: provide-5.s
 #ld: -T provide-6.t
 #nm: -B
-#xfail: x86_64-*-cygwin
 
 #...
 0+1000 D foo
diff --git a/ld/testsuite/ld-scripts/provide-8.d b/ld/testsuite/ld-scripts/provide-8.d
index f5abc524e8..16510be9e9 100644
--- a/ld/testsuite/ld-scripts/provide-8.d
+++ b/ld/testsuite/ld-scripts/provide-8.d
@@ -1,7 +1,7 @@
 #source: provide-5.s
 #ld: -T provide-8.t
 #nm: -B
-#xfail: x86_64-*-cygwin mmix-*-* sh-*-pe spu-*-*
+#xfail: mmix-*-* sh-*-pe spu-*-*
 
 #...
 0+4000 D __FOO

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list