X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sim%2Fm32c%2Fload.c;h=8db4a92951c620bbad0f26abaa72aff2192a8645;hb=3922b302645fda04da42a5279399578ae2f6206c;hp=a040274f30f51678f1c4e2bb594ebc731663a086;hpb=7b6bb8daaceb9ecf3f42dea57ae82733d6a3b2f6;p=deliverable%2Fbinutils-gdb.git
diff --git a/sim/m32c/load.c b/sim/m32c/load.c
index a040274f30..8db4a92951 100644
--- a/sim/m32c/load.c
+++ b/sim/m32c/load.c
@@ -1,7 +1,6 @@
/* load.c --- loading object files into the M32C simulator.
-Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
-Free Software Foundation, Inc.
+Copyright (C) 2005-2020 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of the GNU simulators.
@@ -19,7 +18,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
-
+#include "config.h"
#include
#include
#include
@@ -28,8 +27,9 @@ along with this program. If not, see . */
#include "cpu.h"
#include "mem.h"
+#include "load.h"
-int (*decode_opcode) () = 0;
+int (*decode_opcode) (void) = 0;
int default_machine = 0;
void
@@ -74,11 +74,11 @@ m32c_load (bfd * prog)
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;
}
@@ -89,15 +89,16 @@ m32c_load (bfd * prog)
{
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);