* pe-arm-wince.c (pe_print_compressed_pdata): Define new function to
[platform/upstream/binutils.git] / bfd / vms.c
index 0e178eb..1944c1e 100644 (file)
--- a/bfd/vms.c
+++ b/bfd/vms.c
@@ -1,13 +1,13 @@
 /* vms.c -- BFD back-end for VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
    Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-   2006 Free Software Foundation, Inc.
+   2006, 2007, 2008 Free Software Foundation, Inc.
 
    Written by Klaus K"ampf (kkaempf@rmi.de)
 
    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"
 
@@ -427,7 +428,8 @@ vms_close_and_cleanup (bfd * abfd)
 #if VMS_DEBUG
   vms_debug (1, "vms_close_and_cleanup (%p)\n", abfd);
 #endif
-  if (abfd == NULL)
+  if (abfd == NULL
+      || abfd->tdata.any == NULL)
     return TRUE;
 
   if (PRIV (vms_buf) != NULL)
@@ -474,7 +476,7 @@ vms_new_section_hook (bfd * abfd, asection *section)
     {
       bfd_size_type amt = section_count;
       amt *= sizeof (asection *);
-      PRIV (sections) = bfd_realloc (PRIV (sections), amt);
+      PRIV (sections) = bfd_realloc_or_free (PRIV (sections), amt);
       if (PRIV (sections) == NULL)
        return FALSE;
       PRIV (section_count) = section_count;
@@ -1353,6 +1355,22 @@ vms_bfd_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
   return & alpha_howto_table[alpha_type];
 }
 
+static reloc_howto_type *
+vms_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+                          const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (alpha_howto_table) / sizeof (alpha_howto_table[0]);
+       i++)
+    if (alpha_howto_table[i].name != NULL
+       && strcasecmp (alpha_howto_table[i].name, r_name) == 0)
+      return &alpha_howto_table[i];
+
+  return NULL;
+}
+
 /* Part 4.7, writing an object file.  */
 
 /* Set the architecture and machine type in BFD abfd to arch and mach.
@@ -1402,7 +1420,7 @@ vms_set_section_contents (bfd * abfd,
 
 static int
 vms_sizeof_headers (bfd * abfd ATTRIBUTE_UNUSED,
-                   bfd_boolean reloc ATTRIBUTE_UNUSED)
+                   struct bfd_link_info *info ATTRIBUTE_UNUSED)
 {
 #if VMS_DEBUG
   vms_debug (1, "vms_sizeof_headers (%p, %s)\n", abfd, (reloc)?"True":"False");