set link-flags "-e _start"
set debug-flags ""
+set obj_include -I[standard_output_file {}]
+
switch -glob -- [istarget] {
"alpha*-*-*" {
set asm-arch alpha
# ??? Won't work with ecoff systems like Tru64, but then we also
# don't have any other -g flag that creates mdebug output.
- set asm-flags "-no-mdebug -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-no-mdebug -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
}
"arm*-*-*" {
}
"m6811-*-*" {
set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc11 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-mshort-double -m68hc11 --no-warn -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
# This asm test is specific and uses the linker directly.
# We must not use the target board linker script defined for other
}
"m6812-*-*" {
set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc12 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-mshort-double -m68hc12 --no-warn -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
# This asm test is specific and uses the linker directly.
# We must not use the target board linker script defined for other
"powerpc*-*" {
if { [is_lp64_target] } {
set asm-arch powerpc64
- set asm-flags "-a64 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-a64 -I${srcdir}/${subdir} $obj_include"
append link-flags " -m elf64ppc"
} else {
set asm-arch powerpc
- set asm-flags "-a32 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-a32 -I${srcdir}/${subdir} $obj_include"
append link-flags " -m elf32ppc"
}
}
}
"sparc64-*-*" {
set asm-arch sparc64
- set asm-flags "-xarch=v9 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-xarch=v9 -I${srcdir}/${subdir} $obj_include"
set debug-flags "-gdwarf-2"
}
"spu*-*-*" {
set asm-arch spu
- set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir} --no-warn"
+ set asm-flags "-I${srcdir}/${subdir} $obj_include --no-warn"
set debug-flags "-gdwarf-2"
}
"xstormy16-*-*" {
}
}
-set testfile "asm-source"
-set binfile ${objdir}/${subdir}/${testfile}
-set srcfile1 asmsrc1.s
-set srcfile2 asmsrc2.s
+standard_testfile asmsrc1.s asmsrc2.s
remote_exec build "rm -f ${subdir}/arch.inc"
remote_download host ${srcdir}/${subdir}/${asm-arch}.inc ${subdir}/arch.inc
remote_download host ${srcdir}/${subdir}/${asm-note}.inc ${subdir}/note.inc
if { [string equal ${asm-flags} ""] } {
- set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-I${srcdir}/${subdir} $obj_include"
}
if { [string equal ${debug-flags} ""] } {
# The GNU assembler does not support level options like "-g2" or "-g3".
regsub "--" "-g\[0-9\]" "${debug-flags}" "" debug-flags
-if {[target_assemble ${srcdir}/${subdir}/${srcfile1} asmsrc1.o "${asm-flags} ${debug-flags}"] != ""} then {
+set asm1obj [standard_output_file asmrc1.o]
+set asm2obj [standard_output_file asmrc2.o]
+
+if {[target_assemble ${srcdir}/${subdir}/${srcfile} $asm1obj "${asm-flags} ${debug-flags}"] != ""} then {
untested asm-source.exp
return -1
}
-if {[target_assemble ${srcdir}/${subdir}/${srcfile2} asmsrc2.o "${asm-flags} ${debug-flags}"] != ""} then {
+if {[target_assemble ${srcdir}/${subdir}/${srcfile2} $asm2obj "${asm-flags} ${debug-flags}"] != ""} then {
untested asm-source.exp
return -1
}
# code here that provides its own startup code. Using target_link
# also avoids a lot of problems on many systems, most notably on
# *-*-*bsd* and *-*-solaris2*.
-if {[target_link "asmsrc1.o asmsrc2.o" "${binfile}" ${link-flags}] != "" } then {
+if {[target_link [list $asm1obj $asm2obj] "${binfile}" ${link-flags}] != "" } then {
untested asm-source.exp
return -1
}
set_board_info ldscript $old_ldscript
}
-remote_exec build "mv asmsrc1.o asmsrc2.o ${objdir}/${subdir}"
-
# Collect some line numbers.
set line_main [expr [gdb_get_line_number "main start" "asmsrc1.s"] + 1]
set line_call_foo2 [expr [gdb_get_line_number "call foo2" "asmsrc1.s"] + 1]