From 9fcd9da67989f554961747332188536869222218 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 25 May 2010 10:14:16 +0000 Subject: [PATCH] PR ld/11624 * archive.c (_bfd_calloc_wrapper): New function. (_bfd_add_bfd_to_archive_cache): Use it. * configure.in: Add alpha*-*-*vms* to list of natives. * configure: Regenerate. * vms-misc.c: Define globalref if necessary. (vms_convert_to_var_unix_filename): Rename to _bfd_vms_convert_to_var_unix_filename and export. * vms.h: Add prototype for _bfd_vms_convert_to_var_unix_filename. * vms-alpha.c (vms_close_and_cleanup): Update invocation of vms_convert_to_var_unix_filename. --- bfd/ChangeLog | 16 ++++++++++++++++ bfd/archive.c | 11 ++++++++++- bfd/bfd-in2.h | 2 +- bfd/configure | 8 +++++--- bfd/configure.in | 8 +++++--- bfd/doc/Makefile.in | 1 + bfd/vms-alpha.c | 2 +- bfd/vms-misc.c | 9 ++++++--- bfd/vms.h | 39 ++++++++++++++++++++------------------- 9 files changed, 65 insertions(+), 31 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0ef88f73682..4c7593c8288 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,19 @@ +2010-05-25 Jay Krell + + PR ld/11624 + * archive.c (_bfd_calloc_wrapper): New function. + (_bfd_add_bfd_to_archive_cache): Use it. + + * configure.in: Add alpha*-*-*vms* to list of natives. + * configure: Regenerate. + + * vms-misc.c: Define globalref if necessary. + (vms_convert_to_var_unix_filename): Rename to + _bfd_vms_convert_to_var_unix_filename and export. + * vms.h: Add prototype for _bfd_vms_convert_to_var_unix_filename. + * vms-alpha.c (vms_close_and_cleanup): Update invocation of + vms_convert_to_var_unix_filename. + 2010-05-24 Tristan Gingold * vms-alpha.c (add_symbol_entry): New function extrated from ... diff --git a/bfd/archive.c b/bfd/archive.c index e6c1e838532..fbe555b03f5 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -303,6 +303,15 @@ eq_file_ptr (const PTR p1, const PTR p2) return arc1->ptr == arc2->ptr; } +/* The calloc function doesn't always take size_t (e.g. on VMS) + so wrap it to avoid a compile time warning. */ + +static void * +_bfd_calloc_wrapper (size_t a, size_t b) +{ + return calloc (a, b); +} + /* Kind of stupid to call cons for each one, but we don't do too many. */ bfd_boolean @@ -315,7 +324,7 @@ _bfd_add_bfd_to_archive_cache (bfd *arch_bfd, file_ptr filepos, bfd *new_elt) if (hash_table == NULL) { hash_table = htab_create_alloc (16, hash_file_ptr, eq_file_ptr, - NULL, calloc, free); + NULL, _bfd_calloc_wrapper, free); if (hash_table == NULL) return FALSE; bfd_ardata (arch_bfd)->cache = hash_table; diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index a3f8ccc9f17..e9dcb2c89ed 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -913,7 +913,7 @@ extern bfd_boolean elf32_arm_build_stubs /* ARM unwind section editing support. */ extern bfd_boolean elf32_arm_fix_exidx_coverage - (struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); +(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); /* PowerPC @tls opcode transform/validate. */ extern unsigned int _bfd_elf_ppc_at_tls_transform diff --git a/bfd/configure b/bfd/configure index a8b15a3d024..d498ff2ee3b 100755 --- a/bfd/configure +++ b/bfd/configure @@ -13829,7 +13829,7 @@ CORE_HEADER= TRAD_HEADER= if test "${target}" = "${host}"; then case "${host}" in - alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu | alpha*-*-*vms*) COREFILE='' ;; alpha*-*-linux-*) @@ -13839,9 +13839,11 @@ if test "${target}" = "${host}"; then alpha*-*-netbsd* | alpha*-*-openbsd*) COREFILE=netbsd-core.lo ;; - alpha*-*-*) COREFILE=osf-core.lo ;; + alpha*-*-*) + COREFILE=osf-core.lo + ;; arm-*-freebsd* | arm-*-kfreebsd*-gnu) - COREFILE='' ;; + COREFILE='' ;; arm-*-netbsd* | arm-*-openbsd*) COREFILE=netbsd-core.lo ;; diff --git a/bfd/configure.in b/bfd/configure.in index dbbadc05eab..3ca7fc7cc51 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -223,7 +223,7 @@ CORE_HEADER= TRAD_HEADER= if test "${target}" = "${host}"; then case "${host}" in - alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu | alpha*-*-*vms*) COREFILE='' ;; alpha*-*-linux-*) @@ -233,9 +233,11 @@ if test "${target}" = "${host}"; then alpha*-*-netbsd* | alpha*-*-openbsd*) COREFILE=netbsd-core.lo ;; - alpha*-*-*) COREFILE=osf-core.lo ;; + alpha*-*-*) + COREFILE=osf-core.lo + ;; arm-*-freebsd* | arm-*-kfreebsd*-gnu) - COREFILE='' ;; + COREFILE='' ;; arm-*-netbsd* | arm-*-openbsd*) COREFILE=netbsd-core.lo ;; diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in index aac7ace7f3b..68e17f72d8e 100644 --- a/bfd/doc/Makefile.in +++ b/bfd/doc/Makefile.in @@ -232,6 +232,7 @@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +havevecs = @havevecs@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index 0a8850126da..7234cd0d1fa 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -8844,7 +8844,7 @@ vms_close_and_cleanup (bfd * abfd) format. */ if (bfd_cache_close (abfd) != TRUE) return FALSE; - if (vms_convert_to_var_unix_filename (abfd->filename) != TRUE) + if (_bfd_vms_convert_to_var_unix_filename (abfd->filename) != TRUE) return FALSE; } #endif diff --git a/bfd/vms-misc.c b/bfd/vms-misc.c index 67cc25adc06..be6d5094b17 100644 --- a/bfd/vms-misc.c +++ b/bfd/vms-misc.c @@ -1,7 +1,7 @@ /* vms-misc.c -- BFD back-end for VMS/VAX (openVMS/VAX) and EVAX (openVMS/Alpha) files. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2007, 2008, 2009 Free Software Foundation, Inc. + 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Miscellaneous functions. @@ -33,6 +33,9 @@ #include "safe-ctype.h" #ifdef VMS +#if defined(__GNUC__) && !defined(globalref) +#define globalref extern +#endif #include #include #include @@ -399,8 +402,8 @@ _bfd_vms_output_fill (struct vms_rec_wr *recwr, int value, int count) using undocumented system call sys$modify(). Pure VMS version. */ -static void -vms_convert_to_var (char *vms_filename) +void +_bfd_vms_convert_to_var (char * vms_filename) { struct FAB fab = cc$rms_fab; diff --git a/bfd/vms.h b/bfd/vms.h index 4a3e1d0a6fc..762c8b53984 100644 --- a/bfd/vms.h +++ b/bfd/vms.h @@ -1,6 +1,6 @@ /* vms.h -- Header file for VMS (Alpha and Vax) support. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, - 2008, 2009 Free Software Foundation, Inc. + 2008, 2009, 2010 Free Software Foundation, Inc. Main header file. @@ -111,26 +111,27 @@ extern void _bfd_hexdump (int, unsigned char *, int, int); #define vms_debug2(X) #endif -extern char *vms_get_module_name (const char *filename, bfd_boolean); +extern char * vms_get_module_name (const char *, bfd_boolean); extern unsigned char *get_vms_time_string (void); extern time_t vms_time_to_time_t (unsigned int hi, unsigned int lo); -extern time_t vms_rawtime_to_time_t (unsigned char *buf); - -extern char *_bfd_vms_save_sized_string (unsigned char *, int); -extern char *_bfd_vms_save_counted_string (unsigned char *); -extern void _bfd_vms_output_begin (struct vms_rec_wr *, int); -extern void _bfd_vms_output_alignment (struct vms_rec_wr *, int); -extern void _bfd_vms_output_begin_subrec (struct vms_rec_wr *, int); -extern void _bfd_vms_output_end_subrec (struct vms_rec_wr *); -extern void _bfd_vms_output_end (bfd *, struct vms_rec_wr *); -extern int _bfd_vms_output_check (struct vms_rec_wr *, int); -extern void _bfd_vms_output_byte (struct vms_rec_wr *, unsigned); -extern void _bfd_vms_output_short (struct vms_rec_wr *, unsigned); -extern void _bfd_vms_output_long (struct vms_rec_wr *, unsigned long); -extern void _bfd_vms_output_quad (struct vms_rec_wr *, bfd_vma); -extern void _bfd_vms_output_counted (struct vms_rec_wr *, char *); -extern void _bfd_vms_output_dump (struct vms_rec_wr *, unsigned char *, int); -extern void _bfd_vms_output_fill (struct vms_rec_wr *, int, int); +extern time_t vms_rawtime_to_time_t (unsigned char *); + +extern char * _bfd_vms_save_sized_string (unsigned char *, int); +extern char * _bfd_vms_save_counted_string (unsigned char *); +extern void _bfd_vms_output_begin (struct vms_rec_wr *, int); +extern void _bfd_vms_output_alignment (struct vms_rec_wr *, int); +extern void _bfd_vms_output_begin_subrec (struct vms_rec_wr *, int); +extern void _bfd_vms_output_end_subrec (struct vms_rec_wr *); +extern void _bfd_vms_output_end (bfd *, struct vms_rec_wr *); +extern int _bfd_vms_output_check (struct vms_rec_wr *, int); +extern void _bfd_vms_output_byte (struct vms_rec_wr *, unsigned); +extern void _bfd_vms_output_short (struct vms_rec_wr *, unsigned); +extern void _bfd_vms_output_long (struct vms_rec_wr *, unsigned long); +extern void _bfd_vms_output_quad (struct vms_rec_wr *, bfd_vma); +extern void _bfd_vms_output_counted (struct vms_rec_wr *, char *); +extern void _bfd_vms_output_dump (struct vms_rec_wr *, unsigned char *, int); +extern void _bfd_vms_output_fill (struct vms_rec_wr *, int, int); +extern int _bfd_vms_convert_to_var_unix_filename (const char *); /* vms-alpha.c */ -- 2.30.2