aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2002-08-13 08:52:02 +0000
committerStephane Carrez <stcarrez@nerim.fr>2002-08-13 08:52:02 +0000
commit31c7c532ab465f25e697ac2c1f992f143822cc3e (patch)
treee42393801b1608b6365faed84f65e3f45d2620d5 /sim
parent39762100979423101cb7a7c577b573df0b8d44a9 (diff)
downloadgdb-31c7c532ab465f25e697ac2c1f992f143822cc3e.zip
gdb-31c7c532ab465f25e697ac2c1f992f143822cc3e.tar.gz
gdb-31c7c532ab465f25e697ac2c1f992f143822cc3e.tar.bz2
* interp.c (sim_prepare_for_program): Look up the image for the
reset vector and set cpu_use_elf_start to 1 if not found. (sim_open): Do not set cpu_use_elf_start.
Diffstat (limited to 'sim')
-rw-r--r--sim/m68hc11/ChangeLog6
-rw-r--r--sim/m68hc11/interp.c25
2 files changed, 30 insertions, 1 deletions
diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index d6c3863..fc85e60 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,5 +1,11 @@
2002-08-13 Marko Kohtala <marko.kohtala@luukku.com>
+ * interp.c (sim_prepare_for_program): Look up the image for the
+ reset vector and set cpu_use_elf_start to 1 if not found.
+ (sim_open): Do not set cpu_use_elf_start.
+
+2002-08-13 Marko Kohtala <marko.kohtala@luukku.com>
+
* interp.c (sim_hw_configure): Return 1 for success.
(sim_prepare_for_program): Use the sim_hw_configure exit code to
return SIM_RC_FAIL.
diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c
index 8889da6..74674ce 100644
--- a/sim/m68hc11/interp.c
+++ b/sim/m68hc11/interp.c
@@ -306,7 +306,31 @@ sim_prepare_for_program (SIM_DESC sd, struct _bfd* abfd)
if (abfd != NULL)
{
+ asection *s;
cpu->cpu_elf_start = bfd_get_start_address (abfd);
+ /* See if any section sets the reset address */
+ cpu->cpu_use_elf_start = 1;
+ for (s = abfd->sections; s && cpu->cpu_use_elf_start; s = s->next)
+ {
+ if (s->flags & SEC_LOAD)
+ {
+ bfd_size_type size;
+
+ size = bfd_get_section_size_before_reloc (s);
+ if (size > 0)
+ {
+ bfd_vma lma;
+
+ if (STATE_LOAD_AT_LMA_P (sd))
+ lma = bfd_section_lma (abfd, s);
+ else
+ lma = bfd_section_vma (abfd, s);
+
+ if (lma <= 0xFFFE && lma+size >= 0x10000)
+ cpu->cpu_use_elf_start = 0;
+ }
+ }
+ }
}
/* reset all state information */
@@ -333,7 +357,6 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
cpu_initialize (sd, cpu);
- cpu->cpu_use_elf_start = 1;
if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)
{
free_state (sd);