summaryrefslogtreecommitdiff
path: root/sim/lm32/sim-if.c
diff options
context:
space:
mode:
Diffstat (limited to 'sim/lm32/sim-if.c')
-rw-r--r--sim/lm32/sim-if.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/sim/lm32/sim-if.c b/sim/lm32/sim-if.c
index 860c1e63f1f..aad3a35a307 100644
--- a/sim/lm32/sim-if.c
+++ b/sim/lm32/sim-if.c
@@ -71,27 +71,15 @@ find_base (bfd *prog_bfd)
}
static unsigned long
-find_limit (bfd *prog_bfd)
+find_limit (SIM_DESC sd)
{
- struct bfd_symbol **asymbols;
- long symsize;
- long symbol_count;
- long s;
+ bfd_vma addr;
- symsize = bfd_get_symtab_upper_bound (prog_bfd);
- if (symsize < 0)
- return 0;
- asymbols = (asymbol **) xmalloc (symsize);
- symbol_count = bfd_canonicalize_symtab (prog_bfd, asymbols);
- if (symbol_count < 0)
+ addr = trace_sym_value (sd, "_fstack");
+ if (addr == -1)
return 0;
- for (s = 0; s < symbol_count; s++)
- {
- if (!strcmp (asymbols[s]->name, "_fstack"))
- return (asymbols[s]->value + 65536) & ~(0xffffUL);
- }
- return 0;
+ return (addr + 65536) & ~(0xffffUL);
}
/* Create an instance of the simulator. */
@@ -159,7 +147,7 @@ sim_open (kind, callback, abfd, argv)
{
/* It doesn't, so we should try to allocate enough memory to hold program. */
base = find_base (STATE_PROG_BFD (sd));
- limit = find_limit (STATE_PROG_BFD (sd));
+ limit = find_limit (sd);
if (limit == 0)
{
sim_io_eprintf (sd,