Decouple inferior_ptid/inferior_thread(); dup ptids in thread list (PR 25412)
[deliverable/binutils-gdb.git] / sim / m32c / load.c
index 9e43f2db5f12b5f1dd459ef02d5fb88b7587e196..8db4a92951c620bbad0f26abaa72aff2192a8645 100644 (file)
@@ -1,26 +1,24 @@
 /* load.c --- loading object files into the M32C simulator.
 
-Copyright (C) 2005, 2007 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.
 
-The GNU simulators are free software; you can redistribute them and/or
-modify them under the terms of the GNU General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
 
-The GNU simulators are distributed in the hope that they will be
-useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with the GNU simulators; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA  */
-
+along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include "config.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -29,8 +27,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
 #include "cpu.h"
 #include "mem.h"
+#include "load.h"
 
-int (*decode_opcode) () = 0;
+int (*decode_opcode) (void) = 0;
 int default_machine = 0;
 
 void
@@ -56,7 +55,7 @@ m32c_set_mach (unsigned long mach)
 }
 
 void
-m32c_load (bfd *prog)
+m32c_load (bfd * prog)
 {
   asection *s;
   unsigned long mach = bfd_get_mach (prog);
@@ -75,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;
                }
@@ -90,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);
This page took 0.029774 seconds and 4 git commands to generate.