bfd: install plugin-api.h as needed
[deliverable/binutils-gdb.git] / bfd / ecofflink.c
index 4246e94f3937e05949c191879aebc9cc21466bcc..25b67fab2592a31ee5d6b6bb74dcb0cc31edeed6 100644 (file)
@@ -1,13 +1,13 @@
 /* Routines to link ECOFF debugging information.
    Copyright 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
 
    This file is part of BFD, the Binary File Descriptor library.
 
    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 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
-#include "bfd.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "bfdlink.h"
 #include "libbfd.h"
 #include "objalloc.h"
@@ -717,7 +718,8 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
          lookup = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 20);
          if (lookup == NULL)
            return FALSE;
-         sprintf (lookup, "%s %lx %lx", name, fdr.csym, fdr.caux);
+         sprintf (lookup, "%s %lx %lx", name, (unsigned long) fdr.csym,
+                  (unsigned long) fdr.caux);
 
          fh = string_hash_lookup (&ainfo->fdr_hash, lookup, TRUE, TRUE);
          free (lookup);
@@ -782,7 +784,6 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
        fdr_ptr += fdr_add, i++)
     {
       FDR fdr;
-      bfd_vma fdr_adr;
       bfd_byte *sym_out;
       bfd_byte *lraw_src;
       bfd_byte *lraw_end;
@@ -799,8 +800,6 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
       else
        (*input_swap->swap_fdr_in) (input_bfd, (PTR) fdr_ptr, &fdr);
 
-      fdr_adr = fdr.adr;
-
       /* FIXME: It is conceivable that this FDR points to the .init or
         .fini section, in which case this will not do the right
         thing.  */
@@ -1085,8 +1084,8 @@ ecoff_add_string (ainfo, info, debug, fdr, string)
   len = strlen (string);
   if (info->relocatable)
     {
-      if (!add_memory_shuffle (ainfo, &ainfo->ss, &ainfo->ss_end, (PTR) string,
-                              len + 1))
+      if (!add_memory_shuffle (ainfo, &ainfo->ss, &ainfo->ss_end,
+                               (bfd_byte *) string, len + 1))
        return -1;
       ret = symhdr->issMax;
       symhdr->issMax += len + 1;
@@ -1208,7 +1207,7 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug,
        }
       (*swap_sym_out) (output_bfd, &internal_sym, external_sym);
       add_memory_shuffle (ainfo, &ainfo->sym, &ainfo->sym_end,
-                         external_sym,
+                         (bfd_byte *) external_sym,
                          (unsigned long) output_swap->external_sym_size);
       ++fdr.csym;
       ++output_symhdr->isymMax;
@@ -1229,7 +1228,7 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug,
     }
   (*output_swap->swap_fdr_out) (output_bfd, &fdr, external_fdr);
   add_memory_shuffle (ainfo, &ainfo->fdr, &ainfo->fdr_end,
-                     external_fdr,
+                     (bfd_byte *) external_fdr,
                      (unsigned long) output_swap->external_fdr_size);
 
   ++output_symhdr->ifdMax;
@@ -1339,8 +1338,8 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym)
                - (char *) debug->external_ext)
       < (symhdr->iextMax + 1) * external_ext_size)
     {
-      char *external_ext = debug->external_ext;
-      char *external_ext_end = debug->external_ext_end;
+      char *external_ext = (char *) debug->external_ext;
+      char *external_ext_end = (char *) debug->external_ext_end;
       if (! ecoff_add_bytes ((char **) &external_ext,
                             (char **) &external_ext_end,
                             (symhdr->iextMax + 1) * (size_t) external_ext_size))
@@ -1504,7 +1503,7 @@ ecoff_write_symhdr (abfd, debug, swap, where)
   SET (cbExtOffset, iextMax, swap->external_ext_size);
 #undef SET
 
-  buff = (PTR) bfd_malloc (swap->external_hdr_size);
+  buff = (char *) bfd_malloc (swap->external_hdr_size);
   if (buff == NULL && swap->external_hdr_size != 0)
     goto error_return;
 
This page took 0.031318 seconds and 4 git commands to generate.