s/struct _serial_t/struct serial/
[deliverable/binutils-gdb.git] / bfd / vms-gsd.c
index 6a52462a06d22405c83e68f4a6af4e19208f69a6..773823c0baad7a84a0bd184be4c0d9f88453c30c 100644 (file)
@@ -1,6 +1,6 @@
 /* vms-gsd.c -- BFD back-end for VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright 1996, 1997, 1998 Free Software Foundation Inc.
+   Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 
    go and read the openVMS linker manual (esp. appendix B)
    if you don't know what's going on here :-)
@@ -21,7 +21,6 @@ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-
 #include <ctype.h>
 
 #include "bfd.h"
@@ -85,7 +84,6 @@ static struct sec_flags_struct vax_section_flags[] = {
        (SEC_IN_MEMORY|SEC_DATA|SEC_HAS_CONTENTS|SEC_ALLOC|SEC_LOAD) }
 };
 
-
 /* These flags are deccrtl/vaxcrtl (openVMS 6.2 Alpha) compatible  */
 
 static struct sec_flags_struct evax_section_flags[] = {
@@ -170,7 +168,6 @@ vms_secflag_by_name (abfd, section_flags, name, size)
   return section_flags[i].flags_always;
 }
 
-
 /* Retrieve vms section flags by name and size  */
 
 static flagword
@@ -282,7 +279,7 @@ _bfd_vms_slurp_gsd (abfd, objtype)
   vms_symbol_entry *entry;
   unsigned long base_addr;
   unsigned long align_addr;
-  static int psect_idx = 0;
+  static unsigned int psect_idx = 0;
 
 #if VMS_DEBUG
   vms_debug (2, "GSD/EGSD (%d/%x)\n", objtype, objtype);
@@ -354,7 +351,8 @@ _bfd_vms_slurp_gsd (abfd, objtype)
              section = bfd_make_section (abfd, name);
              if (!section)
                {
-                 fprintf (stderr, "bfd_make_section (%s) failed\n", name);
+                 (*_bfd_error_handler) (_("bfd_make_section (%s) failed"),
+                                        name);
                  return -1;
                }
              old_flags = bfd_getl16 (vms_rec + 2);
@@ -366,7 +364,9 @@ _bfd_vms_slurp_gsd (abfd, objtype)
                new_flags |= SEC_IS_COMMON;
              if (!bfd_set_section_flags (abfd, section, new_flags))
                {
-                 fprintf (stderr, "bfd_set_section_flags (%s, %x) failed\n", name, new_flags);
+                 (*_bfd_error_handler)
+                   (_("bfd_set_section_flags (%s, %x) failed"),
+                    name, new_flags);
                  return -1;
                }
              section->alignment_power = vms_rec[1];
@@ -400,7 +400,12 @@ _bfd_vms_slurp_gsd (abfd, objtype)
                  section->contents = old_section->contents;
                  if (section->_raw_size < old_section->_raw_size)
                    {
-                     fprintf (stderr, "Size mismatch section %s=%d, %s=%d\n", old_section->name, old_section->_raw_size, section->name, section->_raw_size);
+                     (*_bfd_error_handler)
+                       (_("Size mismatch section %s=%lx, %s=%lx"),
+                        old_section->name,
+                        (unsigned long) old_section->_raw_size,
+                        section->name,
+                        (unsigned long) section->_raw_size);
                      return -1;
                    }
                  else if (section->_raw_size > old_section->_raw_size)
@@ -645,7 +650,7 @@ _bfd_vms_slurp_gsd (abfd, objtype)
                    new_flags |= BSF_FUNCTION;
                  }
                symbol->value = bfd_getl64 (vms_rec+8);
-               symbol->section = (asection *)((unsigned long) bfd_getl32 (vms_rec+28));
+               symbol->section = (asection *) ((unsigned long) bfd_getl32 (vms_rec+28));
 #if VMS_DEBUG
                vms_debug(4, "egsd sym def #%d (%s, %d, %04x=%s)\n", abfd->symcount,
                           symbol->name, (int)symbol->section, old_flags, flag2str(gsyflagdesc, old_flags));
@@ -716,16 +721,15 @@ _bfd_vms_slurp_gsd (abfd, objtype)
 int
 _bfd_vms_write_gsd (abfd, objtype)
      bfd *abfd;
-     int objtype;
+     int objtype ATTRIBUTE_UNUSED;
 {
   asection *section;
   asymbol *symbol;
-  int symnum;
+  unsigned int symnum;
   int last_index = -1;
   char dummy_name[10];
   char *sname;
   flagword new_flags, old_flags;
-  char *nptr, *uptr;
 
 #if VMS_DEBUG
   vms_debug (2, "vms_write_gsd (%p, %d)\n", abfd, objtype);
@@ -892,9 +896,9 @@ _bfd_vms_write_gsd (abfd, objtype)
            {
              _bfd_vms_output_quad (abfd, symbol->value);
              _bfd_vms_output_quad (abfd,
-                                    ((asymbol *)(symbol->udata.p))->value);
+                                    ((asymbol *) (symbol->udata.p))->value);
              _bfd_vms_output_long (abfd,
-                                    (((asymbol *)(symbol->udata.p))
+                                    (((asymbol *) (symbol->udata.p))
                                      ->section->index));
              _bfd_vms_output_long (abfd, symbol->section->index);
            }
@@ -914,7 +918,7 @@ _bfd_vms_write_gsd (abfd, objtype)
 
   _bfd_vms_output_alignment (abfd, 8);
   _bfd_vms_output_pop (abfd);
-  _bfd_vms_output_end (abfd); 
+  _bfd_vms_output_end (abfd);
 
   return 0;
 }
This page took 0.02488 seconds and 4 git commands to generate.