aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-09-13 14:43:34 +0930
committerAlan Modra <amodra@gmail.com>2018-09-15 16:24:18 +0930
commit04ade4bc669b28b3994197d154cb392515c758d4 (patch)
tree90ab815a6febcd4e30c1c338cefe9258a5efbd80 /gas
parenta3a6aef4090ca13d065d116f5d77f4e3f7bcbf9a (diff)
downloadgdb-04ade4bc669b28b3994197d154cb392515c758d4.zip
gdb-04ade4bc669b28b3994197d154cb392515c758d4.tar.gz
gdb-04ade4bc669b28b3994197d154cb392515c758d4.tar.bz2
Remove run_dump_test support for objcopy as a dump program
We have three copies of run_dump_test in the testsuite. This is a first step towards consolidating them. A few tests use objcopy to convert to verilog or srec output, then check that output is as expected. Those tests can just as easily use objdump, keeping the set of dump programs (addr2line, nm, objdump, readelf, size) separate from utilities under test. That in turn makes auto-detecting the dump program possible in more places. binutils/ * testsuite/binutils-all/group-7a.d, * testsuite/binutils-all/group-7b.d, * testsuite/binutils-all/group-7c.d, * testsuite/binutils-all/symbols-1.d, * testsuite/binutils-all/symbols-2.d, * testsuite/binutils-all/symbols-3.d, * testsuite/binutils-all/symbols-4.d: Remove DUMPPROG. gas/ * testsuite/gas/mri/char.d: Don't objcopy to srec, objdump instead. * testsuite/gas/mri/float.d: Likewise. * testsuite/lib/gas-defs.exp (run_dump_test): Remove support for objcopy as a dump tool. ld/ * testsuite/ld-elf/interleave-0.d, * testsuite/ld-elf/interleave-4.d: Don't objcopy to srec, objdump instead. * testsuite/ld-gc/all-debug-sections.d, * testsuite/ld-scripts/provide-4.d, * testsuite/ld-scripts/provide-5.d, * testsuite/ld-scripts/provide-6.d, * testsuite/ld-scripts/provide-7.d, * testsuite/ld-scripts/provide-8.d, * testsuite/ld-scripts/segment-start.d: Remove PROG, specify nm instead. * testsuite/lib/ld-lib.exp (run_dump_test): Remove support for objcopy as a dump tool.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/testsuite/gas/mri/char.d10
-rw-r--r--gas/testsuite/gas/mri/float.d11
-rw-r--r--gas/testsuite/lib/gas-defs.exp24
4 files changed, 24 insertions, 28 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 82a23c4..5c5eeeb 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2018-09-15 Alan Modra <amodra@gmail.com>
+
+ * testsuite/gas/mri/char.d: Don't objcopy to srec, objdump instead.
+ * testsuite/gas/mri/float.d: Likewise.
+ * testsuite/lib/gas-defs.exp (run_dump_test): Remove support
+ for objcopy as a dump tool.
+
2018-09-14 H.J. Lu <hongjiu.lu@intel.com>
PR gas/23642
diff --git a/gas/testsuite/gas/mri/char.d b/gas/testsuite/gas/mri/char.d
index 025f4b5..7d237ac 100644
--- a/gas/testsuite/gas/mri/char.d
+++ b/gas/testsuite/gas/mri/char.d
@@ -1,9 +1,9 @@
-#objcopy: -O srec
#name: MRI character constants
#as: -M
+#objdump: -s
-# Test MRI character constants
+.*: file format .*
-S0.*
-S113....(61616263616263646500000061276200)|(61616263646362610000006500622761).*
-#pass
+Contents of section \.text:
+
+ 0+0 (61616263 61626364 65000000 61276200)|(61616263 64636261 00000065 00622761) .*
diff --git a/gas/testsuite/gas/mri/float.d b/gas/testsuite/gas/mri/float.d
index 21ecf2e..27f4fdc 100644
--- a/gas/testsuite/gas/mri/float.d
+++ b/gas/testsuite/gas/mri/float.d
@@ -1,10 +1,9 @@
-#objcopy: -O srec
#name: MRI floating point constants
#as: -M
+#objdump: -s
-# Test MRI floating point constants
+.*: file format .*
-S0.*
-S113....(123456789ABCDEF03F80000041200000)|(F0DEBC9A785634120000803F00002041).*
-S10.....(4120000042C80000)|(000020410000C842).*
-#pass
+Contents of section \.text:
+ 0+00 (12345678 9abcdef0 3f800000 41200000)|(f0debc9a 78563412 0000803f 00002041) .*
+ 0+10 (41200000 42c80000)|(000020 410000c842) .*
diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp
index 22984c7..b7cc06e 100644
--- a/gas/testsuite/lib/gas-defs.exp
+++ b/gas/testsuite/lib/gas-defs.exp
@@ -359,14 +359,13 @@ proc run_dump_tests { testcases {extra_options {}} } {
#
# addr2line: FLAGS
# nm: FLAGS
-# objcopy: FLAGS
# objdump: FLAGS
# readelf: FLAGS
# Use the specified program to analyze the .o file, and pass it
# FLAGS, in addition to the .o file name. Note that they are run
# with LC_ALL=C in the environment to give consistent sorting
# of symbols. If no FLAGS are needed then use:
-# PROG: [nm objcopy objdump readelf addr2line]
+# PROG: [nm objdump readelf addr2line]
# instead.
# Note: for objdump, we automatically replaces the standard section
# names (.text, .data and .bss) by target ones if any (eg. rx-elf
@@ -414,8 +413,8 @@ proc run_dump_tests { testcases {extra_options {}} } {
#
# error: REGEX
# An error with message matching REGEX must be emitted for the test
-# to pass. The PROG, objdump, nm and objcopy options have no
-# meaning and need not supplied if this is present.
+# to pass. The PROG, addr2line, nm, objdump, and readelf options
+# have no meaning and need not supplied if this is present.
#
# warning: REGEX
# Expect a gas warning matching REGEX. It is an error to issue
@@ -424,12 +423,12 @@ proc run_dump_tests { testcases {extra_options {}} } {
# stderr: FILE
# FILE contains regexp lines to be matched against the diagnostic
# output of the assembler. This does not preclude the use of
-# PROG, nm, objdump, or objcopy.
+# PROG, addr2line, nm, objdump, or readelf.
#
# error-output: FILE
# Means the same as 'stderr', but also indicates that the assembler
-# is expected to exit unsuccessfully (therefore PROG, objdump, nm,
-# and objcopy have no meaning and should not be supplied).
+# is expected to exit unsuccessfully (therefore PROG, addr2line, nm,
+# objdump, and readelf have no meaning and should not be supplied).
#
# section-subst: no
# Means that the section substitution for objdump is disabled.
@@ -465,7 +464,6 @@ proc run_dump_test { name {extra_options {}} } {
set opts(as) {}
set opts(objdump) {}
set opts(nm) {}
- set opts(objcopy) {}
set opts(readelf) {}
set opts(name) {}
set opts(PROG) {}
@@ -546,7 +544,6 @@ proc run_dump_test { name {extra_options {}} } {
addr2line { set program addr2line }
objdump { set program objdump }
nm { set program nm }
- objcopy { set program objcopy }
readelf { set program readelf }
default {
perror "unrecognized program option $opts(PROG) in $file.d"
@@ -555,7 +552,7 @@ proc run_dump_test { name {extra_options {}} } {
}
} else {
# Guess which program to run, by seeing which option was specified.
- foreach p {objdump objcopy nm readelf addr2line} {
+ foreach p {objdump nm readelf addr2line} {
if {$opts($p) != ""} {
if {$program != ""} {
perror "ambiguous dump program in $file.d"
@@ -741,15 +738,8 @@ proc run_dump_test { name {extra_options {}} } {
if { $progopts1 == "" } { set $progopts1 "-r" }
verbose "running $binary $progopts $progopts1" 3
- # Objcopy, unlike the other two, won't send its output to stdout,
- # so we have to run it specially.
set cmd "$binary $progopts $progopts1 dump.o"
set redir ">dump.out"
- if { $program == "objcopy" } {
- set cmd "$binary $progopts $progopts1 dump.o dump.out"
- set redir ""
- }
-
send_log "$cmd\n"
set status [gas_host_run "$cmd" "$redir"]
set comp_output [prune_warnings [lindex $status 1]]