set global_sim_options "--memory-size=4Mb"
}
- global global_ld_options
- if ![info exists global_ld_options] {
- set global_ld_options "-Ttext=0x0"
- }
+ global LDFLAGS_FOR_TARGET
+ set LDFLAGS_FOR_TARGET "-Ttext=0x0"
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] {
# If we're only testing specific files and this isn't one of them,
proc sim_has_rv_and_cris {} {
global srcdir
global subdir
- global global_ld_options
global global_sim_options
# We need to assemble and link a trivial program and pass that, in
# what we want to do it to run the simulator without affecting the
# PASS/FAIL counters, and we can use e.g. run_sim_test for that.
- if ![info exists global_ld_options] {
- set global_ld_options ""
- }
if ![info exists global_sim_options] {
set global_sim_options ""
}
return 0
}
- set comp_output [target_link quit.o quit.x "$global_ld_options"]
+ set comp_output [target_link quit.o quit.x ""]
if ![string match "" $comp_output] {
verbose -log "$comp_output" 3
if [istarget cris*-*-*] {
global ASFLAGS_FOR_TARGET
+ global LDFLAGS_FOR_TARGET
set has_rv_and_cris [sim_has_rv_and_cris]
- global global_ld_options
global global_sim_options
set saved_global_sim_options $global_sim_options
- set saved_global_ld_options $global_ld_options
# See the logic in sim-defs.exp for more details.
set sim [board_info target sim]
}
set sim_defaults "--hw-file $srcdir/$subdir/std.dev"
- set ld_defaults "--section-start=.text=0"
+ set LDFLAGS_FOR_TARGET "--section-start=.text=0"
# We parse options an extra time besides in run_sim_test,
# to determine if our defaults should be overridden.
if { $opt_name == "sim" && $opt_machs == "" } {
set sim_defaults ""
}
-
- if { $opt_name == "ld" && $opt_machs == "" } {
- set ld_defaults ""
- }
}
set rvdummy_id -1
# Unfortunately this seems like the only way to pass
# additional sim, ld etc. options to run_sim_test.
set global_sim_options "$saved_global_sim_options $sim_defaults"
- set global_ld_options "$saved_global_ld_options $ld_defaults"
run_sim_test $src $mach
set global_sim_options $saved_global_sim_options
- set global_ld_options $saved_global_ld_options
# Stop the rvdummy, if it's still running. We need to
# wait on it anyway to avoid it turning into a zombie.
# All machines.
set all_machs "example"
- set global_ld_options "-Ttext=0"
+ global LDFLAGS_FOR_TARGET
+ set LDFLAGS_FOR_TARGET "-Ttext=0"
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] {
# If we're only testing specific files and this isn't one of them,
run_sim_test $src $all_machs
}
- unset global_ld_options
+ unset LDFLAGS_FOR_TARGET
}
global opts
global cpu_option
global cpu_option_sep
- global global_ld_options
global global_sim_options
if ![file exists [sim_tool_path]] {
set opts(kfail) ""
set seen_output 0
- if ![info exists global_ld_options] {
- set global_ld_options ""
- }
if ![info exists global_sim_options] {
set global_sim_options ""
}
if ![info exists opts(ld,$mach)] {
set opts(ld,$mach) $opts(ld)
}
- regsub {(^ *| +)([^ ]+)} "$opts(ld,$mach) $global_ld_options" { -Wl,\2} c_ld_options
+ regsub {(^ *| +)([^ ]+)} "$opts(ld,$mach)" { -Wl,\2} c_ld_options
if ![info exists opts(cc,$mach)] {
set opts(cc,$mach) $opts(cc)
continue
}
- set comp_output [target_link ${name}.o ${name}.x "$opts(ld,$mach) $global_ld_options"]
+ set comp_output [target_link ${name}.o ${name}.x "$opts(ld,$mach)"]
set method "linking"
}
if [istarget or1k*-*-*] {
set all_machs "or1k"
- global global_ld_options
- set global_ld_options "-T $srcdir/$subdir/or1k-test.ld"
+ global LDFLAGS_FOR_TARGET
+ set LDFLAGS_FOR_TARGET "-T $srcdir/$subdir/or1k-test.ld"
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.S]] {
set all_machs "sh shdsp"
global ASFLAGS_FOR_TARGET
-set global_ld_options ""
+global LDFLAGS_FOR_TARGET
foreach opt $board_variant_list {
switch "x$opt" {
x-ml { set ASFLAGS_FOR_TARGET "-little --defsym LITTLE=1"
- set global_ld_options "-EL" }
+ set LDFLAGS_FOR_TARGET "-EL" }
}
}