XCOFF binutils testsuite fix
authorAlan Modra <amodra@gmail.com>
Tue, 7 Jul 2020 00:53:06 +0000 (10:23 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 7 Jul 2020 08:56:33 +0000 (18:26 +0930)
Avoid an UNRESOLVED test due to "Error: the XCOFF file format does not
support arbitrary sections".

* testsuite/lib/binutils-common.exp (is_xcoff_format): New.
* testsuite/binutils-all/objcopy.exp (pr25662): Exclude xcoff.

binutils/ChangeLog
binutils/testsuite/binutils-all/objcopy.exp
binutils/testsuite/lib/binutils-common.exp

index 0f4b5c8e268dc2543edc2ff8e72707cf54ed77a5..47cad6ee2328929fb13568ec724437d506704c35 100644 (file)
@@ -1,3 +1,8 @@
+2020-07-07  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/lib/binutils-common.exp (is_xcoff_format): New.
+       * testsuite/binutils-all/objcopy.exp (pr25662): Exclude xcoff.
+
 2020-07-06  Nick Clifton  <nickc@redhat.com>
 
        * po/bg.po: Updated Bulgarian translation.
index dd74860f9e9823bdeffeeeab57868fb0508c52ec..f857003e33e27df03b43781ea78e75947763e01b 100644 (file)
@@ -1354,4 +1354,7 @@ if { [istarget pdp11-*-*] } {
     set src "pr25662.s"
 }
 
-objcopy_test "pr25662" $src executable "" "-T$srcdir/$subdir/pr25662.ld"
+#xcoff doesn't support arbitrary sections
+if { ![is_xcoff_format] } {
+    objcopy_test "pr25662" $src executable "" "-T$srcdir/$subdir/pr25662.ld"
+}
index 491cd8db09ed8cd2f28b89309e377dd4e4028dff..948b910b83589b1ef8330726d3ecb15aeb0598e7 100644 (file)
@@ -121,6 +121,16 @@ proc is_som_format {} {
     return 0;
 }
 
+proc is_xcoff_format {} {
+    if { [istarget rs6000-*-*]
+        || [istarget powerpc*-*-aix*]
+        || [istarget powerpc*-*-beos*]
+        || [istarget powerpc*-*-macos*] } {
+       return 1;
+    }
+    return 0;
+}
+
 # True if the object format is known to be 64-bit ELF.
 #
 proc is_elf64 { binary_file } {