* elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Fix PT_DYNAMIC
[deliverable/binutils-gdb.git] / bfd / vms-hdr.c
index 3b36b3278c580b65acfb1ca1fc69cd6d4ca4f1fb..adbecaccba5afebb297854145708e995afc66312 100644 (file)
@@ -1,6 +1,7 @@
 /* vms-hdr.c -- BFD back-end for VMS/VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Free Software Foundation, Inc.
 
    HDR record handling functions
    EMH record handling functions
@@ -24,17 +25,23 @@ 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"
+#include "bfdver.h"
 #include "sysdep.h"
 #include "bfdlink.h"
+#include "safe-ctype.h"
 #include "libbfd.h"
 
 #include "vms.h"
 
-/*---------------------------------------------------------------------------*/
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
 
+static unsigned char *get_vms_time_string PARAMS ((void));
+
+
+/*---------------------------------------------------------------------------*/
 
 /* Read & process emh record
    return 0 on success, -1 on error  */
@@ -196,11 +203,9 @@ _bfd_vms_slurp_hdr (abfd, objtype)
   return 0;
 }
 
-
 /*-----------------------------------------------------------------------------*/
 /* Output routines.  */
 
-
 /* Manufacure a VMS like time on a unix based system.
    stolen from obj-vms.c  */
 
@@ -240,7 +245,6 @@ get_vms_time_string ()
   return tbuf;
 }
 
-
 /* write object header for bfd abfd  */
 
 int
@@ -253,7 +257,6 @@ _bfd_vms_write_hdr (abfd, objtype)
   int had_case = 0;
   int had_file = 0;
 
-
 #if VMS_DEBUG
   vms_debug (2, "vms_write_hdr (%p)\n", abfd);
 #endif
@@ -301,8 +304,7 @@ _bfd_vms_write_hdr (abfd, objtype)
       fptr = fout;
       while (*fptr != 0)
        {
-         if (islower (*fptr))
-           *fptr = toupper (*fptr);
+         *fptr = TOUPPER (*fptr);
          fptr++;
          if ((*fptr == ';')
             || ((fptr - fout) > 31))
@@ -313,7 +315,7 @@ _bfd_vms_write_hdr (abfd, objtype)
   else
     _bfd_vms_output_counted (abfd, "NONAME");
 
-  _bfd_vms_output_counted (abfd, BFD_VERSION);
+  _bfd_vms_output_counted (abfd, BFD_VERSION_STRING);
   _bfd_vms_output_dump (abfd, get_vms_time_string (), 17);
   _bfd_vms_output_fill (abfd, 0, 17);
   _bfd_vms_output_flush (abfd);
@@ -345,7 +347,8 @@ _bfd_vms_write_hdr (abfd, objtype)
              continue;
            }
 
-         _bfd_vms_output_dump (abfd, (unsigned char *)symbol->name, strlen (symbol->name));
+         _bfd_vms_output_dump (abfd, (unsigned char *) symbol->name,
+                               (int) strlen (symbol->name));
          if (had_case)
            break;
          had_file = 1;
@@ -392,7 +395,7 @@ _bfd_vms_slurp_eom (abfd, objtype)
 
   vms_rec = PRIV(vms_rec);
 
-  if ((objtype == OBJ_S_C_EOM) 
+  if ((objtype == OBJ_S_C_EOM)
      || (objtype == OBJ_S_C_EOMW))
     {
     }
@@ -406,10 +409,10 @@ _bfd_vms_slurp_eom (abfd, objtype)
          bfd_set_error (bfd_error_bad_value);
          return -1;
        }
-      PRIV(eom_data).eom_has_transfer = false;
+      PRIV(eom_data).eom_has_transfer = FALSE;
       if (PRIV(rec_size) > 10)
        {
-          PRIV(eom_data).eom_has_transfer = true;
+          PRIV(eom_data).eom_has_transfer = TRUE;
           PRIV(eom_data).eom_b_tfrflg = *(vms_rec + 9);
           PRIV(eom_data).eom_l_psindx = bfd_getl32 (vms_rec + 12);
           PRIV(eom_data).eom_l_tfradr = bfd_getl32 (vms_rec + 16);
@@ -420,7 +423,6 @@ _bfd_vms_slurp_eom (abfd, objtype)
   return 0;
 }
 
-
 /* Write eom record for bfd abfd  */
 
 int
@@ -433,7 +435,7 @@ _bfd_vms_write_eom (abfd, objtype)
 #endif
 
   _bfd_vms_output_begin (abfd, objtype, -1);
-  _bfd_vms_output_long (abfd, (unsigned long)(PRIV(vms_linkage_index) >> 1));
+  _bfd_vms_output_long (abfd, (unsigned long) (PRIV(vms_linkage_index) >> 1));
   _bfd_vms_output_byte (abfd, 0);      /* completion code */
   _bfd_vms_output_byte (abfd, 0);      /* fill byte */
 
@@ -448,7 +450,7 @@ _bfd_vms_write_eom (abfd, objtype)
          return -1;
        }
       _bfd_vms_output_short (abfd, 0);
-      _bfd_vms_output_long (abfd, (unsigned long)(section->index));
+      _bfd_vms_output_long (abfd, (unsigned long) (section->index));
       _bfd_vms_output_long (abfd,
                             (unsigned long) bfd_get_start_address (abfd));
       _bfd_vms_output_long (abfd, 0);
This page took 0.025769 seconds and 4 git commands to generate.