X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fvms.c;h=1944c1ee06736cc6c032ebc81b2d16e5cb417616;hb=d57a3c85f6eee87b04852e98cce75af080969951;hp=220277cea7e4eb51b56e2dcff7cf5c46f861efe4;hpb=53e09e0aaf3d13e4b893744e2fe79edde7edfd20;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/vms.c b/bfd/vms.c index 220277cea7..1944c1ee06 100644 --- 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 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 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, @@ -17,10 +17,11 @@ 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 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" @@ -77,7 +78,8 @@ vms_initialize (bfd * abfd) if (PRIV (vms_symbol_table) == NULL) goto error_ret1; - if (!bfd_hash_table_init (PRIV (vms_symbol_table), _bfd_vms_hash_newfunc)) + if (!bfd_hash_table_init (PRIV (vms_symbol_table), _bfd_vms_hash_newfunc, + sizeof (vms_symbol_entry))) goto error_ret1; amt = sizeof (struct location_struct) * LOCATION_SAVE_SIZE; @@ -426,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) @@ -473,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; @@ -486,7 +489,7 @@ vms_new_section_hook (bfd * abfd, asection *section) vms_debug (7, "%d: %s\n", section->index, section->name); #endif - return TRUE; + return _bfd_generic_new_section_hook (abfd, section); } /* Read the contents of a section. @@ -972,6 +975,19 @@ vms_find_nearest_line (bfd * abfd ATTRIBUTE_UNUSED, return FALSE; } +static bfd_boolean +vms_find_inliner_info (bfd * abfd ATTRIBUTE_UNUSED, + const char **file ATTRIBUTE_UNUSED, + const char **func ATTRIBUTE_UNUSED, + unsigned int *line ATTRIBUTE_UNUSED) +{ +#if VMS_DEBUG + vms_debug (1, "vms_find_inliner_info (%p, , , )\n", + abfd); +#endif + return FALSE; +} + /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ @@ -1339,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. @@ -1388,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");