daily update
[deliverable/binutils-gdb.git] / sim / common / sim-load.c
index 22fb33b777b6201d1c5588b69165d31d67d3023b..32699529aaa9e6fae2216b725baa54ac19e4f902 100644 (file)
@@ -1,5 +1,5 @@
 /* Utility to load a file into the simulator.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
 
 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
@@ -19,14 +19,12 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
    as it is used by simulators that don't use it [though that doesn't mean
    to suggest that they shouldn't :-)].  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include "cconfig.h"
+#endif
 #include "ansidecl.h"
 #include <stdio.h> /* for NULL */
-#ifdef ANSI_PROTOTYPES
 #include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
@@ -36,8 +34,8 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
 #include "bfd.h"
 #include "sim-utils.h"
 
-#include "callback.h"
-#include "remote-sim.h"
+#include "gdb/callback.h"
+#include "gdb/remote-sim.h"
 
 static void eprintf PARAMS ((host_callback *, const char *, ...));
 static void xprintf PARAMS ((host_callback *, const char *, ...));
@@ -110,7 +108,7 @@ sim_load_file (sd, myname, callback, prog, prog_bfd, verbose_p, lma_p, do_write)
        {
          bfd_size_type size;
 
-         size = bfd_get_section_size_before_reloc (s);
+         size = bfd_get_section_size (s);
          if (size > 0)
            {
              char *buffer;
@@ -166,23 +164,17 @@ sim_load_file (sd, myname, callback, prog, prog_bfd, verbose_p, lma_p, do_write)
       report_transfer_performance (callback, data_count, start_time, end_time);
     }
 
+  bfd_cache_close (result_bfd);
+
   return result_bfd;
 }
 
 static void
 xprintf VPARAMS ((host_callback *callback, const char *fmt, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  host_callback *callback;
-  char *fmt;
-#endif
   va_list ap;
 
   VA_START (ap, fmt);
-#ifndef ANSI_PROTOTYPES
-  callback = va_arg (ap, host_callback *);
-  fmt = va_arg (ap, char *);
-#endif
 
   (*callback->vprintf_filtered) (callback, fmt, ap);
 
@@ -192,17 +184,9 @@ xprintf VPARAMS ((host_callback *callback, const char *fmt, ...))
 static void
 eprintf VPARAMS ((host_callback *callback, const char *fmt, ...))
 {
-#ifndef ANSI_PROTOTYPES
-  host_callback *callback;
-  char *fmt;
-#endif
   va_list ap;
 
   VA_START (ap, fmt);
-#ifndef ANSI_PROTOTYPES
-  callback = va_arg (ap, host_callback *);
-  fmt = va_arg (ap, char *);
-#endif
 
   (*callback->evprintf_filtered) (callback, fmt, ap);
 
This page took 0.025532 seconds and 4 git commands to generate.