[2/2] gas/ELF: widen use of $dump_opts in testsuite

Message ID e3b4fc0c-d7b2-2e6b-e05c-bd630217c7c9@suse.com
State Unresolved
Headers
Series gas/ELF: allow "inheriting" section attributes and type |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Jan Beulich Aug. 14, 2023, 1:48 p.m. UTC
  Rather than special-casing rx-*-* for section30, force use of
conventional section names uniformly. By further passing $dump_opts to
a few more tests, a number of xfail-s (and one notarget) can be
eliminated (some of which had wrong justifications in associated
comments anyway). Note that section7 and section15 need to be left
alone: The harness fiddling with section names there didn't help before
and is getting in the way now. For section12b, section16b, and most of
the Dwarf tests nothing changes. Interestingly by passing $dump_opts
the need to xfail section11 for LoongArch and RISC-V also goes away.
  

Patch

--- a/gas/testsuite/gas/elf/bignums.d
+++ b/gas/testsuite/gas/elf/bignums.d
@@ -1,8 +1,6 @@ 
 #readelf: -x .data
 #name: bignum byte values
-#xfail: rx-*
-# The RX target sometimes calls its data section D_1.
-# 
+
 # Test that 8-bit and 16-bit constants can be specified via bignums.
 # 
 # Note - we should really apply this test to all targets, not just
--- a/gas/testsuite/gas/elf/dwarf2-5.d
+++ b/gas/testsuite/gas/elf/dwarf2-5.d
@@ -1,11 +1,11 @@ 
 #as: --gdwarf-3
 #readelf: -x.rodata -wlL
 #name: DWARF2 5
-# The am33 cr16 crx ft32 mn10 msp430 nds32 rl78 and rx targets do not evaluate the subtraction of symbols at assembly time.
+# The am33 cr16 crx ft32 mn10 msp430 nds32 and rl78 targets do not evaluate the subtraction of symbols at assembly time.
 # The mep target tries to relay code sections which breaks symbolic view computations.
 # The riscv targets do not support the subtraction of symbols.
 # The loongarch targets do not support the subtraction of symbols.
-#xfail: am3*-* cr16-* crx-* ft32*-* loongarch*-* mep-* mn10*-* msp430-* nds32*-* riscv*-* rl78-* rx-*
+#xfail: am3*-* cr16-* crx-* ft32*-* loongarch*-* mep-* mn10*-* msp430-* nds32*-* riscv*-* rl78-*
 
 Hex dump of section '\.rodata':
   0x00000000 01010201 010203 *.*
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -96,6 +96,7 @@  if { [is_elf_format] } then {
     }
     if {[istarget "rx-*-*"]} then {
 	set target_machine -rx
+	set dump_opts {{as -muse-conventional-section-names}}
     }
     if {[istarget "score-*-*"]} then {
 	set target_machine -score
@@ -142,7 +143,7 @@  if { [is_elf_format] } then {
     run_dump_test "group0a"
     run_dump_test "group0b"
     run_dump_test "group0c"
-    run_dump_test "group1a"
+    run_dump_test "group1a" $dump_opts
     run_dump_test "group1b"
     run_dump_test "group2"
     run_dump_test "group3"
@@ -154,7 +155,7 @@  if { [is_elf_format] } then {
 	hppa64*-*-hpux* { }
 	riscv*-*-* { }
 	default {
-	    run_dump_test "groupautoa"
+	    run_dump_test "groupautoa" $dump_opts
 	}
     }
     switch -glob $target_triplet {
@@ -211,7 +212,7 @@  if { [is_elf_format] } then {
 	run_elf_list_test "section2" "$target_machine" "$as_flags" "-s" ""
     }
     run_dump_test "section3"
-    run_dump_test "section4"
+    run_dump_test "section4" $dump_opts
     if {! [istarget "h8300-*-*"] && ! [istarget "rx-*-*"]} then {
 	# The h8300 port issues a warning message for
 	# new sections created without atrributes.
@@ -255,8 +256,8 @@  if { [is_elf_format] } then {
     run_dump_test "section7"
     run_dump_test "section8"
     run_dump_test "section9"
-    run_dump_test "section10"
-    run_dump_test "section11"
+    run_dump_test "section10" $dump_opts
+    run_dump_test "section11" $dump_opts
     run_dump_test "section12a"
     run_dump_test "section12b"
     run_dump_test "section13"
@@ -279,11 +280,7 @@  if { [is_elf_format] } then {
     run_dump_test "section27"
     run_dump_test "section28"
     run_dump_test "section29"
-    if { ![istarget "rx-*-*"] } then {
-	run_dump_test "section30"
-    } else {
-	run_dump_test "section30" {{as -muse-conventional-section-names}}
-    }
+    run_dump_test "section30" $dump_opts
     run_dump_test "sh-link-zero"
     run_dump_test "size"
     run_dump_test "dwarf2-1" $dump_opts
@@ -370,7 +367,7 @@  if { [is_elf_format] } then {
 
     run_dump_test "strtab"
 
-    run_dump_test "bignums"
+    run_dump_test "bignums" $dump_opts
     run_dump_test "section-symbol-redef"
     run_dump_test "pr27228"
 }
--- a/gas/testsuite/gas/elf/group1a.d
+++ b/gas/testsuite/gas/elf/group1a.d
@@ -1,8 +1,6 @@ 
 #readelf: -SW
 #name: group section with multiple sections of same name (using readelf -SW)
 #source: group1.s
-# The RX port uses non-standard section names.
-#xfail: rx-*
 
 #...
 [ 	]*\[.*\][ 	]+\.group[ 	]+GROUP.*
--- a/gas/testsuite/gas/elf/groupautoa.d
+++ b/gas/testsuite/gas/elf/groupautoa.d
@@ -1,8 +1,6 @@ 
 #readelf: -SW
 #name: automatic section group a
 #source: groupauto.s
-# The RX port uses non-standard section names.
-#notarget: rx-*
 
 #...
 [ 	]*\[.*\][ 	]+\.group[ 	]+GROUP.*
--- a/gas/testsuite/gas/elf/section10.d
+++ b/gas/testsuite/gas/elf/section10.d
@@ -1,7 +1,5 @@ 
 #readelf: -N --wide
 #name: numeric section flags and types
-# The RX port annoyingly reorders the sections so that they do not match the sequence expected below.
-#xfail: rx-*-*
 
 #...
 [ 	]*\[.*\][ 	]+.text
--- a/gas/testsuite/gas/elf/section11.d
+++ b/gas/testsuite/gas/elf/section11.d
@@ -1,11 +1,6 @@ 
 #as: --no-pad-sections
 #readelf: -S --wide
 #name: Disabling section padding
-# The RX port uses non standard section names.
-#xfail: loongarch*-* rx-*-*
-# LoongArch and RISC-V handles alignment via linker relaxation, so object files don't have
-# the expected alignment.
-#xfail: riscv*-*-*
 
 #...
   \[ .\] .text[ 	]+PROGBITS[ 	]+0+00 0+[0-9a-f]+ 0+0(1|4|5) 00  AX  0   0 16
--- a/gas/testsuite/gas/elf/section4.d
+++ b/gas/testsuite/gas/elf/section4.d
@@ -1,7 +1,5 @@ 
 #readelf: --sections
 #name: label arithmetic with multiple same-name sections
-# The RX port uses non-standard section names.
-#xfail: rx-*
 
 #...
 [ 	]*\[.*\][ 	]+\.group[ 	]+GROUP.*