case "$target_cpu" in {
"m68???" { set target_cpu_family m68k }
- "i[34]86" { set target_cpu_family i386 }
+ "i[3-7]86" { set target_cpu_family i386 }
default { set target_cpu_family $target_cpu }
}
return
}
+#
+# is_elf_format
+# true if the object format is known to be ELF
+#
+proc is_elf_format {} {
+ if { ![istarget *-*-sysv4*] \
+ && ![istarget *-*-unixware*] \
+ && ![istarget *-*-elf*] \
+ && ![istarget *-*-eabi*] \
+ && ![istarget hppa*64*-*-hpux*] \
+ && ![istarget *-*-linux*] \
+ && ![istarget *-*-irix5*] \
+ && ![istarget *-*-irix6*] \
+ && ![istarget *-*-netbsd*] \
+ && ![istarget *-*-solaris2*] } {
+ return 0
+ }
+
+ if { [istarget *-*-linux*aout*] \
+ || [istarget *-*-linux*oldld*] } {
+ return 0
+ }
+
+ if { ![istarget *-*-netbsdelf*] \
+ && ([istarget *-*-netbsd*aout*] \
+ || [istarget *-*-netbsdpe*] \
+ || [istarget arm*-*-netbsd*] \
+ || [istarget sparc-*-netbsd*] \
+ || [istarget i*86-*-netbsd*] \
+ || [istarget m68*-*-netbsd*] \
+ || [istarget vax-*-netbsd*] \
+ || [istarget ns32k-*-netbsd*]) } {
+ return 0
+ }
+ return 1
+}
+
-# run_dump_test FILE
+# run_dump_test FILE (optional:) EXTRA_OPTIONS
#
# Assemble a .s file, then run some utility on it and check the output.
#
# list ends with the first line that doesn't match the above syntax
# (hmm, not great for error detection).
#
+# The optional EXTRA_OPTIONS argument to `run_dump_test' is a list of
+# two-element lists. The first element of each is an option name, and
+# the second additional arguments to be added on to the end of the
+# option list as given in FILE.d. (If omitted, no additional options
+# are added.)
+#
# The interesting options are:
#
# name: TEST-NAME
# regexps in FILE.d. `regexp_diff' is defined later in this file; see
# further comments there.
-proc run_dump_test { name } {
+proc run_dump_test { name {extra_options {}} } {
global subdir srcdir
global OBJDUMP NM AS OBJCOPY READELF
global OBJDUMPFLAGS NMFLAGS ASFLAGS OBJCOPYFLAGS READELFFLAGS
set opts($opt_name) $opt_val
}
+ foreach i $extra_options {
+ set opt_name [lindex $i 0]
+ set opt_val [lindex $i 1]
+ if ![info exists opts($opt_name)] {
+ perror "unknown option $opt_name given in extra_opts"
+ unresolved $subdir/$name
+ return
+ }
+ # add extra option to end of existing option, adding space
+ # if necessary.
+ if [string length $opts($opt_name)] {
+ append opts($opt_name) " "
+ }
+ append opts($opt_name) $opt_val
+ }
+
if {$opts(PROG) != ""} {
switch -- $opts(PROG) {
objdump
catch "exec $srcdir/lib/run $AS $ASFLAGS $opts(as) -o dump.o $sourcefile" comp_output
set comp_output [prune_warnings $comp_output]
- if ![string match "" $comp_output] then {
+ if { ![string match "" $comp_output] || $opts(stderr) != "" } then {
if { $opts(stderr) == "" } then {
send_log "$comp_output\n"
verbose "$comp_output" 3