* [PATCH] sim: synacor: simplify test generation
@ 2021-11-11 2:50 Mike Frysinger
0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-11-11 2:50 UTC (permalink / raw)
To: gdb-patches
Objcopy was used to create a binary file of just the executable code
since the environment requires code to based at address 0. We can
accomplish the same thing with the -Ttext=0 flag, so switch to that
to get rid of custom logic.
---
sim/testsuite/example-synacor/allinsn.exp | 4 ++++
sim/testsuite/lib/sim-defs.exp | 7 -------
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/sim/testsuite/example-synacor/allinsn.exp b/sim/testsuite/example-synacor/allinsn.exp
index a73312b8adfb..0f8d856ed0a5 100644
--- a/sim/testsuite/example-synacor/allinsn.exp
+++ b/sim/testsuite/example-synacor/allinsn.exp
@@ -4,6 +4,8 @@ if [istarget *] {
# All machines.
set all_machs "example"
+ set global_ld_options "-Ttext=0"
+
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] {
# If we're only testing specific files and this isn't one of them,
# skip it.
@@ -12,4 +14,6 @@ if [istarget *] {
}
run_sim_test $src $all_machs
}
+
+ unset global_ld_options
}
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 59c7dede83e4..6e8feaf6bf89 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -390,13 +390,6 @@ proc run_sim_test { name requested_machs } {
set options "$options timeout=$opts(timeout)"
}
- if [string match "example" "$mach"] {
- set objcopy [find_binutils_prog objcopy]
- set comp_output [remote_exec host $objcopy "-O binary -j .text ${name}.x ${name}.bin"]
- file rename -force "${name}.bin" "${name}.x"
- append opts(sim,$mach) " --target binary"
- }
-
set result [sim_run ${name}.x "$opts(sim,$mach) $global_sim_options" "$opts(progopts)" "" "$options"]
set return_code [lindex $result 0]
set output [lindex $result 1]
--
2.33.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-11 2:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 2:50 [PATCH] sim: synacor: simplify test generation Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).