MIPS/BFD: Correct microMIPS cross-mode BAL to JALX relaxation
[deliverable/binutils-gdb.git] / bfd / vms-lib.c
index 8f15419fa38011f4cb8a3e79c450d03d3923b79a..7b1320de721b9812f162402159d231d4b5a757ed 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for VMS archive files.
 
-   Copyright 2010, 2011, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2010-2017 Free Software Foundation, Inc.
    Written by Tristan Gingold <gingold@adacore.com>, AdaCore.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -25,6 +25,7 @@
 #include "libbfd.h"
 #include "safe-ctype.h"
 #include "bfdver.h"
+#include "libiberty.h"
 #include "vms.h"
 #include "vms/lbr.h"
 #include "vms/dcx.h"
@@ -630,7 +631,7 @@ _bfd_vms_lib_archive_p (bfd *abfd, enum vms_lib_kind kind)
 
  err:
   bfd_release (abfd, tdata);
-  abfd->tdata.any = (void *)tdata_hold;;
+  abfd->tdata.any = (void *)tdata_hold;
   return NULL;
 }
 
@@ -1174,11 +1175,11 @@ vms_lib_bwrite (struct bfd *abfd ATTRIBUTE_UNUSED,
   return -1;
 }
 
-static bfd_boolean
+static int
 vms_lib_bclose (struct bfd *abfd)
 {
   abfd->iostream = NULL;
-  return TRUE;
+  return 0;
 }
 
 static int
@@ -1376,7 +1377,7 @@ _bfd_vms_lib_get_module (bfd *abfd, unsigned int modidx)
     default:
       break;
     }
-  res->filename = name;
+  res->filename = xstrdup (name);
 
   tdata->cache[modidx] = res;
 
@@ -1440,8 +1441,9 @@ _bfd_vms_lib_get_imagelib_file (bfd *el)
 
   if (res == NULL)
     {
-      (*_bfd_error_handler)(_("could not open shared image '%s' from '%s'"),
-                            filename, archive->filename);
+      /* xgettext:c-format */
+      _bfd_error_handler(_("could not open shared image '%s' from '%s'"),
+                        filename, archive->filename);
       bfd_release (archive, filename);
       return NULL;
     }
@@ -1660,7 +1662,7 @@ vms_write_index (bfd *abfd,
                       /* Write it to the disk (if there is one).  */
                       if (kbn_vbn != 0)
                         {
-                          if (vms_write_block (abfd, kbn_vbn, kbn_blk) != TRUE)
+                          if (!vms_write_block (abfd, kbn_vbn, kbn_blk))
                             return FALSE;
                         }
                       else
@@ -1778,7 +1780,7 @@ vms_write_index (bfd *abfd,
               if (abfd != NULL)
                 {
                   bfd_putl16 (blk[j].len + blk[j].lastlen, rblk[j]->used);
-                  if (vms_write_block (abfd, blk[j].vbn, rblk[j]) != TRUE)
+                  if (!vms_write_block (abfd, blk[j].vbn, rblk[j]))
                     return FALSE;
                 }
 
@@ -1871,7 +1873,7 @@ vms_write_index (bfd *abfd,
     {
       /* Write this block on the disk.  */
       bfd_putl16 (blk[j].len + blk[j].lastlen, rblk[j]->used);
-      if (vms_write_block (abfd, blk[j].vbn, rblk[j]) != TRUE)
+      if (!vms_write_block (abfd, blk[j].vbn, rblk[j]))
         return FALSE;
 
       free (rblk[j]);
@@ -1880,7 +1882,7 @@ vms_write_index (bfd *abfd,
   /* Write the last kbn (if any).  */
   if (kbn_vbn != 0)
     {
-      if (vms_write_block (abfd, kbn_vbn, kbn_blk) != TRUE)
+      if (!vms_write_block (abfd, kbn_vbn, kbn_blk))
         return FALSE;
       free (kbn_blk);
     }
@@ -2221,11 +2223,11 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
 
   /* Write the indexes.  */
   vbn = 2;
-  if (vms_write_index (arch, modules, nbr_modules, &vbn, &mod_idx_vbn,
-                       is_elfidx) != TRUE)
+  if (!vms_write_index (arch, modules, nbr_modules, &vbn, &mod_idx_vbn,
+                       is_elfidx))
     return FALSE;
-  if (vms_write_index (arch, symbols, nbr_symbols, &vbn, &sym_idx_vbn,
-                       is_elfidx) != TRUE)
+  if (!vms_write_index (arch, symbols, nbr_symbols, &vbn, &sym_idx_vbn,
+                       is_elfidx))
     return FALSE;
 
   /* Write libary header.  */
@@ -2296,7 +2298,7 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
     bfd_putl16 (sym_idx_vbn, idd->vbn);
     idd++;
 
-    if (vms_write_block (arch, 1, blk) != TRUE)
+    if (!vms_write_block (arch, 1, blk))
       return FALSE;
   }
 
@@ -2310,7 +2312,7 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
 /* Add a target for text library.  This costs almost nothing and is useful to
    read VMS library on the host.  */
 
-const bfd_target vms_lib_txt_vec =
+const bfd_target alpha_vms_lib_txt_vec =
 {
   "vms-libtxt",                        /* Name.  */
   bfd_target_unknown_flavour,
This page took 0.024827 seconds and 4 git commands to generate.