aboutsummaryrefslogtreecommitdiff
path: root/sim/lm32
diff options
context:
space:
mode:
Diffstat (limited to 'sim/lm32')
-rw-r--r--sim/lm32/ChangeLog6
-rw-r--r--sim/lm32/sim-if.c24
2 files changed, 12 insertions, 18 deletions
diff --git a/sim/lm32/ChangeLog b/sim/lm32/ChangeLog
index c1b442d..51869ba 100644
--- a/sim/lm32/ChangeLog
+++ b/sim/lm32/ChangeLog
@@ -1,3 +1,9 @@
+2016-08-15 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (find_limit): Change prototype to take a SIM_DESC.
+ Replace symbol lookup code with a call to trace_sym_value.
+ (sim_open): Update find_limit call.
+
2016-01-10 Mike Frysinger <vapier@gentoo.org>
* config.in, configure: Regenerate.
diff --git a/sim/lm32/sim-if.c b/sim/lm32/sim-if.c
index 860c1e6..aad3a35 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,