From 269362117d399d9d86b7e565e7cb827500fac31c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 24 Dec 2015 21:36:09 -0500 Subject: [PATCH] sim: make LMA loading the default for all targets Most targets already default to loading code via their LMA, but for a few, this means the default changes from loading VMA to LMA. It's better to have the different targets be consistent, and allows some code clean up. --- sim/bfin/ChangeLog | 4 ++++ sim/bfin/tconfig.h | 3 --- sim/common/ChangeLog | 6 ++++++ sim/common/sim-options.c | 10 +--------- sim/cris/ChangeLog | 4 ++++ sim/cris/tconfig.h | 3 --- sim/frv/ChangeLog | 4 ++++ sim/frv/tconfig.h | 3 --- sim/iq2000/ChangeLog | 4 ++++ sim/iq2000/tconfig.h | 3 --- sim/lm32/ChangeLog | 4 ++++ sim/lm32/tconfig.h | 3 --- sim/m32r/ChangeLog | 4 ++++ sim/m32r/tconfig.h | 3 --- sim/m68hc11/ChangeLog | 4 ++++ sim/m68hc11/sim-main.h | 2 -- sim/mips/ChangeLog | 4 ++++ sim/mips/tconfig.h | 7 ------- sim/mn10300/ChangeLog | 4 ++++ sim/mn10300/sim-main.h | 2 -- sim/sh64/ChangeLog | 4 ++++ sim/sh64/tconfig.h | 3 --- sim/testsuite/sim/cr16/ChangeLog | 5 +++++ sim/testsuite/sim/cr16/allinsn.exp | 11 ++++++++++- sim/testsuite/sim/cr16/misc.exp | 10 ++++++++++ 25 files changed, 72 insertions(+), 42 deletions(-) diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog index ac4b7742005..1deb4ea235c 100644 --- a/sim/bfin/ChangeLog +++ b/sim/bfin/ChangeLog @@ -1,3 +1,7 @@ +2015-12-24 Mike Frysinger + + * tconfig.h (SIM_HANDLES_LMA): Delete. + 2015-11-17 Mike Frysinger * tconfig.h (WITH_MODULO_MEMORY): Delete. diff --git a/sim/bfin/tconfig.h b/sim/bfin/tconfig.h index a3e6f7bf7c1..254aba9b984 100644 --- a/sim/bfin/tconfig.h +++ b/sim/bfin/tconfig.h @@ -1,8 +1,5 @@ /* Blackfin target configuration file. -*- C -*- */ -/* See sim-hload.c. We properly handle LMA. -- TODO: check this */ -#define SIM_HANDLES_LMA 1 - /* We use this so that we are passed the requesting CPU for HW acesses. Common sim core by default sets hw_system_cpu to NULL for WITH_HW. */ #define WITH_DEVICES 1 diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 83409289895..857485c674c 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,9 @@ +2015-12-24 Mike Frysinger + + * sim-options.c (standard_options): Always enable load-lma and + load-vma options. + (standard_install): Always set STATE_LOAD_AT_LMA_P(sd) to 1. + 2015-12-24 Mike Frysinger * sim-module.c (MODULE_LIST): Delete. diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index 69655b02afd..95ed2c80008 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -167,18 +167,12 @@ static const OPTION standard_options[] = '\0', "BFDNAME", "Specify the object-code format for the object files", standard_option_handler }, -#ifdef SIM_HANDLES_LMA { {"load-lma", no_argument, NULL, OPTION_LOAD_LMA}, '\0', NULL, -#if SIM_HANDLES_LMA "Use VMA or LMA addresses when loading image (default LMA)", -#else - "Use VMA or LMA addresses when loading image (default VMA)", -#endif standard_option_handler, "load-{lma,vma}" }, { {"load-vma", no_argument, NULL, OPTION_LOAD_VMA}, '\0', NULL, "", standard_option_handler, "" }, -#endif { {"sysroot", required_argument, NULL, OPTION_SYSROOT}, '\0', "SYSROOT", @@ -423,9 +417,7 @@ standard_install (SIM_DESC sd) SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); if (sim_add_option_table (sd, NULL, standard_options) != SIM_RC_OK) return SIM_RC_FAIL; -#ifdef SIM_HANDLES_LMA - STATE_LOAD_AT_LMA_P (sd) = SIM_HANDLES_LMA; -#endif + STATE_LOAD_AT_LMA_P (sd) = 1; return SIM_RC_OK; } diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog index 4bca1e1359e..7b7618c0cbd 100644 --- a/sim/cris/ChangeLog +++ b/sim/cris/ChangeLog @@ -1,3 +1,7 @@ +2015-12-24 Mike Frysinger + + * tconfig.h (SIM_HANDLES_LMA): Delete. + 2015-11-15 Mike Frysinger * Makefile.in (SIM_OBJS): Delete sim-reason.o, sim-reg.o, and diff --git a/sim/cris/tconfig.h b/sim/cris/tconfig.h index e512c3dc9b0..77b000fe61b 100644 --- a/sim/cris/tconfig.h +++ b/sim/cris/tconfig.h @@ -24,9 +24,6 @@ along with this program. If not, see . */ file. I just copied it from m32r, pruned some stuff and added HAVE_MODEL because it seemed useful. */ -/* See sim-hload.c. We properly handle LMA. */ -#define SIM_HANDLES_LMA 1 - /* For MSPR support. FIXME: revisit. */ #define WITH_DEVICES 1 diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog index 513711122fa..4f0dd8f310b 100644 --- a/sim/frv/ChangeLog +++ b/sim/frv/ChangeLog @@ -1,3 +1,7 @@ +2015-12-24 Mike Frysinger + + * tconfig.h (SIM_HANDLES_LMA): Delete. + 2015-12-24 Mike Frysinger * tconfig.h (SIM_HAVE_BREAKPOINTS, SIM_BREAKPOINT, diff --git a/sim/frv/tconfig.h b/sim/frv/tconfig.h index f0de19afb75..044cfb07121 100644 --- a/sim/frv/tconfig.h +++ b/sim/frv/tconfig.h @@ -1,8 +1,5 @@ /* FRV target configuration file. -*- C -*- */ -/* See sim-hload.c. We properly handle LMA. -- TODO: check this */ -#define SIM_HANDLES_LMA 1 - /* For MSPR support. FIXME: revisit. */ #define WITH_DEVICES 1 diff --git a/sim/iq2000/ChangeLog b/sim/iq2000/ChangeLog index 30f950154aa..770a2be1e82 100644 --- a/sim/iq2000/ChangeLog +++ b/sim/iq2000/ChangeLog @@ -1,3 +1,7 @@ +2015-12-24 Mike Frysinger + + * tconfig.h (SIM_HANDLES_LMA): Delete. + 2015-12-24 Mike Frysinger * tconfig.h (SIM_HAVE_BREAKPOINTS, SIM_BREAKPOINT, diff --git a/sim/iq2000/tconfig.h b/sim/iq2000/tconfig.h index ae0bf3ae71c..bd5a3aee8e2 100644 --- a/sim/iq2000/tconfig.h +++ b/sim/iq2000/tconfig.h @@ -1,8 +1,5 @@ /* IQ2000 target configuration file. -*- C -*- */ -/* See sim-hload.c. We properly handle LMA. -- TODO: check this */ -#define SIM_HANDLES_LMA 1 - /* For MSPR support. FIXME: revisit. */ #define WITH_DEVICES 0 diff --git a/sim/lm32/ChangeLog b/sim/lm32/ChangeLog index 081be3717c6..93e7d98dcc5 100644 --- a/sim/lm32/ChangeLog +++ b/sim/lm32/ChangeLog @@ -1,3 +1,7 @@ +2015-12-24 Mike Frysinger + + * tconfig.h (SIM_HANDLES_LMA): Delete. + 2015-11-15 Mike Frysinger * Makefile.in (SIM_OBJS): Delete sim-reason.o, sim-reg.o, and diff --git a/sim/lm32/tconfig.h b/sim/lm32/tconfig.h index 0970c810801..7db04f9d102 100644 --- a/sim/lm32/tconfig.h +++ b/sim/lm32/tconfig.h @@ -19,9 +19,6 @@ #ifndef LM32_TCONFIG_H #define LM32_TCONFIG_H -/* See sim-hload.c. We properly handle LMA. */ -#define SIM_HANDLES_LMA 1 - #define WITH_SCACHE_PBB 1 #endif /* LM32_TCONFIG_H */ diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog index 616fb2ad956..f81e61bd8f8 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/ChangeLog @@ -1,3 +1,7 @@ +2015-12-24 Mike Frysinger + + * tconfig.h (SIM_HANDLES_LMA): Delete. + 2015-12-24 Mike Frysinger * tconfig.h (SIM_HAVE_BREAKPOINTS, SIM_BREAKPOINT, diff --git a/sim/m32r/tconfig.h b/sim/m32r/tconfig.h index 72a7f683383..0a43607416b 100644 --- a/sim/m32r/tconfig.h +++ b/sim/m32r/tconfig.h @@ -3,9 +3,6 @@ #ifndef M32R_TCONFIG_H #define M32R_TCONFIG_H -/* See sim-hload.c. We properly handle LMA. */ -#define SIM_HANDLES_LMA 1 - /* For MSPR support. FIXME: revisit. */ #define WITH_DEVICES 1 diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog index 7ba16fa1e2e..4a20b5510d6 100644 --- a/sim/m68hc11/ChangeLog +++ b/sim/m68hc11/ChangeLog @@ -1,3 +1,7 @@ +2015-12-24 Mike Frysinger + + * sim-main.h (SIM_HANDLES_LMA): Delete. + 2015-12-24 Mike Frysinger * sim-main.h (WITH_WATCHPOINTS): Delete. diff --git a/sim/m68hc11/sim-main.h b/sim/m68hc11/sim-main.h index 144095ac5f4..208b6ab204a 100644 --- a/sim/m68hc11/sim-main.h +++ b/sim/m68hc11/sim-main.h @@ -20,8 +20,6 @@ along with this program. If not, see . */ #ifndef _SIM_MAIN_H #define _SIM_MAIN_H -#define SIM_HANDLES_LMA 1 - #include "sim-basics.h" #include "sim-signal.h" #include "sim-base.h" diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index 93c1814e4ee..9974526fa79 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,7 @@ +2015-12-24 Mike Frysinger + + * tconfig.h (SIM_HANDLES_LMA): Delete. + 2015-12-24 Mike Frysinger * sim-main.h (WITH_WATCHPOINTS): Delete. diff --git a/sim/mips/tconfig.h b/sim/mips/tconfig.h index 136015a06d7..a8c91858aaf 100644 --- a/sim/mips/tconfig.h +++ b/sim/mips/tconfig.h @@ -1,11 +1,4 @@ /* mips target configuration file. */ -/* See sim-hload.c. We properly handle LMA. */ -#ifdef TARGET_TX3904 -#define SIM_HANDLES_LMA 1 -#else -#define SIM_HANDLES_LMA 0 -#endif - /* MIPS uses an unusual format for floating point quiet NaNs. */ #define SIM_QUIET_NAN_NEGATED diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index 0034efcd418..bce17726d88 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,3 +1,7 @@ +2015-12-24 Mike Frysinger + + * sim-main.h (SIM_HANDLES_LMA): Delete. + 2015-12-24 Mike Frysinger * sim-main.h (WITH_WATCHPOINTS): Delete. diff --git a/sim/mn10300/sim-main.h b/sim/mn10300/sim-main.h index b489ad0a0a1..64562ee344f 100644 --- a/sim/mn10300/sim-main.h +++ b/sim/mn10300/sim-main.h @@ -22,8 +22,6 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H -#define SIM_HANDLES_LMA 1 - #define SIM_ENGINE_HALT_HOOK(SD,LAST_CPU,CIA) 0 /* disable this hook */ #include "sim-basics.h" diff --git a/sim/sh64/ChangeLog b/sim/sh64/ChangeLog index cd8f50bd9b0..92fcf75364c 100644 --- a/sim/sh64/ChangeLog +++ b/sim/sh64/ChangeLog @@ -1,3 +1,7 @@ +2015-12-24 Mike Frysinger + + * tconfig.h (SIM_HANDLES_LMA): Delete. + 2015-12-24 Mike Frysinger * tconfig.h (SIM_HAVE_BREAKPOINTS, SIM_BREAKPOINT, diff --git a/sim/sh64/tconfig.h b/sim/sh64/tconfig.h index 1440566626b..4f4d9b74e8d 100644 --- a/sim/sh64/tconfig.h +++ b/sim/sh64/tconfig.h @@ -1,8 +1,5 @@ /* SH64 target configuration file. -*- C -*- */ -/* See sim-hload.c. We properly handle LMA. -- TODO: check this */ -#define SIM_HANDLES_LMA 1 - /* For MSPR support. FIXME: revisit. */ #define WITH_DEVICES 0 diff --git a/sim/testsuite/sim/cr16/ChangeLog b/sim/testsuite/sim/cr16/ChangeLog index e6b2466524f..4cb008b68ab 100644 --- a/sim/testsuite/sim/cr16/ChangeLog +++ b/sim/testsuite/sim/cr16/ChangeLog @@ -1,3 +1,8 @@ +2015-12-24 Mike Frysinger + + * allinsn.exp: Append --load-vma to global_sim_options. + * misc.exp: Likewise. + 2015-03-29 Mike Frysinger PR sim/12385 diff --git a/sim/testsuite/sim/cr16/allinsn.exp b/sim/testsuite/sim/cr16/allinsn.exp index 392e70f8631..852a673c360 100644 --- a/sim/testsuite/sim/cr16/allinsn.exp +++ b/sim/testsuite/sim/cr16/allinsn.exp @@ -1,6 +1,5 @@ # CR16 simulator testsuite. - if [istarget cr16*-*-*] { # load support procs # load_lib cgen.exp @@ -8,6 +7,14 @@ if [istarget cr16*-*-*] { # all machines set all_machs "cr16" + global global_sim_options + if ![info exists global_sim_options] { + set global_sim_options "" + } + set saved_global_sim_options $global_sim_options + # The cr16 linker sets the default LMA base to 0, and all the code + # expects the VMA when running, so use that when running the tests. + set global_sim_options "$saved_global_sim_options --load-vma" # The .cgs suffix is for "cgen .s". foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.cgs]] { @@ -19,4 +26,6 @@ if [istarget cr16*-*-*] { run_sim_test $src $all_machs } + + set global_sim_options $saved_global_sim_options } diff --git a/sim/testsuite/sim/cr16/misc.exp b/sim/testsuite/sim/cr16/misc.exp index 5fe512da0d8..39dd3a4caa3 100644 --- a/sim/testsuite/sim/cr16/misc.exp +++ b/sim/testsuite/sim/cr16/misc.exp @@ -7,6 +7,14 @@ if [istarget cr16*-*-*] { # all machines set all_machs "cr16" + global global_sim_options + if ![info exists global_sim_options] { + set global_sim_options "" + } + set saved_global_sim_options $global_sim_options + # The cr16 linker sets the default LMA base to 0, and all the code + # expects the VMA when running, so use that when running the tests. + set global_sim_options "$saved_global_sim_options --load-vma" # The .ms suffix is for "miscellaneous .s". foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.ms]] { @@ -18,4 +26,6 @@ if [istarget cr16*-*-*] { run_sim_test $src $all_machs } + + set global_sim_options $saved_global_sim_options } -- 2.39.2