]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/vms-misc.c
LoongArch: The symbol got type can only be obtained after initialization
[thirdparty/binutils-gdb.git] / bfd / vms-misc.c
index e10d2a4a94cdc278902c8c4b7d3ac0c9a48f9f39..b388c1177d4cccf47f574bc5217489ccdaffd3a5 100644 (file)
@@ -1,6 +1,6 @@
 /* vms-misc.c -- BFD back-end for VMS/VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright (C) 1996-2021 Free Software Foundation, Inc.
+   Copyright (C) 1996-2024 Free Software Foundation, Inc.
 
    Miscellaneous functions.
 
@@ -269,7 +269,7 @@ _bfd_vms_output_end_subrec (struct vms_rec_wr *recwr)
 
 /* Ends current record (and write it).  */
 
-void
+bool
 _bfd_vms_output_end (bfd *abfd, struct vms_rec_wr *recwr)
 {
   vms_debug2 ((6, "_bfd_vms_output_end (size %u)\n", recwr->size));
@@ -278,7 +278,7 @@ _bfd_vms_output_end (bfd *abfd, struct vms_rec_wr *recwr)
   BFD_ASSERT (recwr->subrec_offset == 0);
 
   if (recwr->size == 0)
-    return;
+    return true;
 
   _bfd_vms_output_align (recwr, recwr->size);
 
@@ -289,16 +289,20 @@ _bfd_vms_output_end (bfd *abfd, struct vms_rec_wr *recwr)
      converted to variable length (VAR) format.  VAR format has a length
      word first which must be explicitly output in UDF format.  */
   /* So, first the length word.  */
-  bfd_bwrite (recwr->buf + 2, 2, abfd);
+  if (bfd_write (recwr->buf + 2, 2, abfd) != 2)
+    return false;
 
   /* Align.  */
   if (recwr->size & 1)
     recwr->buf[recwr->size++] = 0;
 
   /* Then the record.  */
-  bfd_bwrite (recwr->buf, (size_t) recwr->size, abfd);
+  if (bfd_write (recwr->buf, (size_t) recwr->size, abfd)
+      != (size_t) recwr->size)
+    return false;
 
   recwr->size = 0;
+  return true;
 }
 
 /* Check remaining buffer size.  Return what's left.  */
@@ -434,9 +438,9 @@ static int
 vms_convert_to_var_1 (char *filename, int type)
 {
   if (type != DECC$K_FILE)
-    return FALSE;
+    return false;
   vms_convert_to_var (filename);
-  return TRUE;
+  return true;
 }
 
 /* Convert the file to variable record length format. This is done
@@ -447,8 +451,8 @@ int
 _bfd_vms_convert_to_var_unix_filename (const char *unix_filename)
 {
   if (decc$to_vms (unix_filename, &vms_convert_to_var_1, 0, 1) != 1)
-    return FALSE;
-  return TRUE;
+    return false;
+  return true;
 }
 #endif /* VMS */
 
@@ -492,7 +496,7 @@ get_vms_time_string (unsigned char *tbuf)
    The result has to be free().  */
 
 char *
-vms_get_module_name (const char *filename, bfd_boolean upcase)
+vms_get_module_name (const char *filename, bool upcase)
 {
   char *fname, *fptr;
   const char *fout;