/* load.c --- loading object files into the M32C simulator.
-Copyright (C) 2005, 2007-2012 Free Software Foundation, Inc.
+Copyright (C) 2005-2019 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of the GNU simulators.
#include "cpu.h"
#include "mem.h"
+#include "load.h"
-int (*decode_opcode) () = 0;
+int (*decode_opcode) (void) = 0;
int default_machine = 0;
void
remains as a reminder. */
if ((s->flags & SEC_ALLOC) && !(s->flags & SEC_READONLY))
{
- if (strcmp (bfd_get_section_name (prog, s), ".stack"))
+ if (strcmp (bfd_section_name (s), ".stack"))
{
int secend =
- bfd_get_section_size (s) + bfd_section_lma (prog, s);
- if (heaptop < secend && bfd_section_lma (prog, s) < 0x10000)
+ bfd_section_size (s) + bfd_section_lma (s);
+ if (heaptop < secend && bfd_section_lma (s) < 0x10000)
{
heaptop = heapbottom = secend;
}
{
char *buf;
bfd_size_type size;
+ bfd_vma base;
- size = bfd_get_section_size (s);
+ size = bfd_section_size (s);
if (size <= 0)
continue;
- bfd_vma base = bfd_section_lma (prog, s);
+ base = bfd_section_lma (s);
if (verbose)
fprintf (stderr, "[load a=%08x s=%08x %s]\n",
- (int) base, (int) size, bfd_get_section_name (prog, s));
+ (int) base, (int) size, bfd_section_name (s));
buf = (char *) malloc (size);
bfd_get_section_contents (prog, s, buf, 0, size);
mem_put_blk (base, buf, size);