From: H.J. Lu Date: Tue, 25 Nov 2014 17:28:32 +0000 (-0800) Subject: Use get_symbol_version_string in BFD_JUMP_TABLE_SYMBOLS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=60bb06bc89858ee50ad02907a833565dcc317182;p=binutils-gdb.git Use get_symbol_version_string in BFD_JUMP_TABLE_SYMBOLS This patch adds get_symbol_version_string to BFD_JUMP_TABLE_SYMBOLS so that we can use bfd_get_symbol_version_string in objdump for non-ELF targets. bfd/ * targets.c (BFD_JUMP_TABLE_SYMBOLS): Use NAME##_get_symbol_version_string. (bfd_get_symbol_version_string): New. * aout-adobe.c (aout_32_get_symbol_version_string): Define using _bfd_nosymbols define. * aout-target.h (MY_get_symbol_version_string): Likewise. * aout-tic30.c (MY_get_symbol_version_string): Likewise. * binary.c (binary_get_symbol_version_string): Likewise. * bout.c (aout_32_get_symbol_version_string): Likewise. * coff-rs6000.c (_bfd_xcoff_get_symbol_version_string): Likewise. * i386msdos.c (msdos_get_symbol_version_string): Likewise. * i386os9k.c (aout_32_get_symbol_version_string): Likewise. * ieee.c (ieee_get_symbol_version_string): Likewise. * ihex.c (ihex_get_symbol_version_string): Likewise. * libecoff.h (_bfd_ecoff_get_symbol_version_string): Likewise. * mach-o-target.c (bfd_mach_o_get_symbol_version_string): Likewise. * mmo.c (mmo_get_symbol_version_string): Likewise. * nlm-target.h (nlm_get_symbol_version_string): Likewise. * oasys.c (oasys_get_symbol_version_string): Likewise. * pef.c (bfd_pef_get_symbol_version_string): Likewise. * plugin.c (bfd_plugin_get_symbol_version_string): Likewise. * ppcboot.c (ppcboot_get_symbol_version_string): Likewise. * som.c (som_get_symbol_version_string): Likewise. * srec.c (srec_get_symbol_version_string): Likewise. * tekhex.c (tekhex_get_symbol_version_string): Likewise. * versados.c (versados_get_symbol_version_string): Likewise. * vms-alpha.c (alpha_vms_get_symbol_version_string): Likewise. * xsym.c (bfd_sym_get_symbol_version_string): Likewise. * coff64-rs6000.c (rs6000_xcoff64_vec): Use coff_get_symbol_version_string. (rs6000_xcoff64_aix_vec): Likewise. * elf-bfd.h (bfd_elf_get_symbol_version_string): Renamed to ... (_bfd_elf_get_symbol_version_string): This. * elf.c: Likewise. (bfd_elf_print_symbol): Updated. * elfxx-target.h (bfd_elfNN_get_symbol_version_string): Define. * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Define. * libcoff-in.h (coff_get_symbol_version_string): Likewise. * bfd-in2.h: Regenerated. * libbfd.h: Likewise. * libcoff.h: Likewise. binutils/ * objdump.c (objdump_print_symname): Replace bfd_elf_get_symbol_version_string with bfd_get_symbol_version_string. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7b3971e2352..54942a1b0a7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,50 @@ +2014-11-25 H.J. Lu + + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Use + NAME##_get_symbol_version_string. + (bfd_get_symbol_version_string): New. + * aout-adobe.c (aout_32_get_symbol_version_string): Define using + _bfd_nosymbols define. + * aout-target.h (MY_get_symbol_version_string): Likewise. + * aout-tic30.c (MY_get_symbol_version_string): Likewise. + * binary.c (binary_get_symbol_version_string): Likewise. + * bout.c (aout_32_get_symbol_version_string): Likewise. + * coff-rs6000.c (_bfd_xcoff_get_symbol_version_string): Likewise. + * i386msdos.c (msdos_get_symbol_version_string): Likewise. + * i386os9k.c (aout_32_get_symbol_version_string): Likewise. + * ieee.c (ieee_get_symbol_version_string): Likewise. + * ihex.c (ihex_get_symbol_version_string): Likewise. + * libecoff.h (_bfd_ecoff_get_symbol_version_string): Likewise. + * mach-o-target.c (bfd_mach_o_get_symbol_version_string): Likewise. + * mmo.c (mmo_get_symbol_version_string): Likewise. + * nlm-target.h (nlm_get_symbol_version_string): Likewise. + * oasys.c (oasys_get_symbol_version_string): Likewise. + * pef.c (bfd_pef_get_symbol_version_string): Likewise. + * plugin.c (bfd_plugin_get_symbol_version_string): Likewise. + * ppcboot.c (ppcboot_get_symbol_version_string): Likewise. + * som.c (som_get_symbol_version_string): Likewise. + * srec.c (srec_get_symbol_version_string): Likewise. + * tekhex.c (tekhex_get_symbol_version_string): Likewise. + * versados.c (versados_get_symbol_version_string): Likewise. + * vms-alpha.c (alpha_vms_get_symbol_version_string): Likewise. + * xsym.c (bfd_sym_get_symbol_version_string): Likewise. + + * coff64-rs6000.c (rs6000_xcoff64_vec): Use + coff_get_symbol_version_string. + (rs6000_xcoff64_aix_vec): Likewise. + + * elf-bfd.h (bfd_elf_get_symbol_version_string): Renamed to ... + (_bfd_elf_get_symbol_version_string): This. + * elf.c: Likewise. + (bfd_elf_print_symbol): Updated. + * elfxx-target.h (bfd_elfNN_get_symbol_version_string): Define. + + * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Define. + * libcoff-in.h (coff_get_symbol_version_string): Likewise. + * bfd-in2.h: Regenerated. + * libbfd.h: Likewise. + * libcoff.h: Likewise. + 2014-11-25 H.J. Lu PR binutils/16496 diff --git a/bfd/aout-adobe.c b/bfd/aout-adobe.c index cfdcc645ba6..50394a2c90d 100644 --- a/bfd/aout-adobe.c +++ b/bfd/aout-adobe.c @@ -447,6 +447,7 @@ aout_adobe_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED, /* Build the transfer vector for Adobe A.Out files. */ #define aout_32_find_line _bfd_nosymbols_find_line +#define aout_32_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define aout_32_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup #define aout_32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup diff --git a/bfd/aout-target.h b/bfd/aout-target.h index 3bca8b550ff..7982bf0b1c1 100644 --- a/bfd/aout-target.h +++ b/bfd/aout-target.h @@ -459,6 +459,10 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info) #ifndef MY_get_symbol_info #define MY_get_symbol_info NAME (aout, get_symbol_info) #endif +#ifndef MY_get_symbol_version_string +#define MY_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string +#endif #ifndef MY_get_lineno #define MY_get_lineno NAME (aout, get_lineno) #endif diff --git a/bfd/aout-tic30.c b/bfd/aout-tic30.c index e74464d52e7..e164446566c 100644 --- a/bfd/aout-tic30.c +++ b/bfd/aout-tic30.c @@ -917,6 +917,10 @@ tic30_aout_set_arch_mach (bfd *abfd, #ifndef MY_get_symbol_info #define MY_get_symbol_info NAME (aout, get_symbol_info) #endif +#ifndef MY_get_symbol_version_string +#define MY_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string +#endif #ifndef MY_get_lineno #define MY_get_lineno NAME (aout, get_lineno) #endif diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 433b171d294..ed7be291b87 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -7015,6 +7015,7 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ @@ -7036,6 +7037,9 @@ typedef struct bfd_target void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, symbol_info *); #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) + (bfd *, struct bfd_symbol *, bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); diff --git a/bfd/binary.c b/bfd/binary.c index d35e859f6db..93a0cff56f7 100644 --- a/bfd/binary.c +++ b/bfd/binary.c @@ -190,6 +190,8 @@ binary_canonicalize_symtab (bfd *abfd, asymbol **alocation) #define binary_make_empty_symbol _bfd_generic_make_empty_symbol #define binary_print_symbol _bfd_nosymbols_print_symbol +#define binary_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string /* Get information about a symbol. */ diff --git a/bfd/bout.c b/bfd/bout.c index a27df583b1a..de9c7c718ab 100644 --- a/bfd/bout.c +++ b/bfd/bout.c @@ -1375,6 +1375,7 @@ b_out_bfd_get_relocated_section_contents (bfd *output_bfd, /* Build the transfer vectors for Big and Little-Endian B.OUT files. */ #define aout_32_find_line _bfd_nosymbols_find_line +#define aout_32_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define aout_32_close_and_cleanup aout_32_bfd_free_cached_info #define b_out_bfd_link_hash_table_create _bfd_generic_link_hash_table_create diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index fea5f3bc5e4..05c45cf14bf 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -4008,6 +4008,8 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { #define _bfd_xcoff_make_empty_symbol coff_make_empty_symbol #define _bfd_xcoff_print_symbol coff_print_symbol #define _bfd_xcoff_get_symbol_info coff_get_symbol_info +#define _bfd_xcoff_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string #define _bfd_xcoff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name #define _bfd_xcoff_bfd_is_target_special_symbol \ coff_bfd_is_target_special_symbol diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index 5985d817d9a..72ea58bebbe 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -2712,6 +2712,7 @@ const bfd_target rs6000_xcoff64_vec = coff_make_empty_symbol, coff_print_symbol, coff_get_symbol_info, + coff_get_symbol_version_string, _bfd_xcoff_is_local_label_name, coff_bfd_is_target_special_symbol, coff_get_lineno, @@ -2969,6 +2970,7 @@ const bfd_target rs6000_xcoff64_aix_vec = coff_make_empty_symbol, coff_print_symbol, coff_get_symbol_info, + coff_get_symbol_version_string, _bfd_xcoff_is_local_label_name, coff_bfd_is_target_special_symbol, coff_get_lineno, diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index bee0ea167b0..43686584e53 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1772,7 +1772,7 @@ extern bfd_boolean _bfd_elf_copy_private_bfd_data (bfd *, bfd *); extern bfd_boolean _bfd_elf_print_private_bfd_data (bfd *, void *); -const char * bfd_elf_get_symbol_version_string +const char * _bfd_elf_get_symbol_version_string (bfd *, asymbol *, bfd_boolean *); extern void bfd_elf_print_symbol (bfd *, void *, asymbol *, bfd_print_symbol_type); diff --git a/bfd/elf.c b/bfd/elf.c index c0c7fef8330..0cf19918d34 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -1425,8 +1425,8 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg) /* Get version string. */ const char * -bfd_elf_get_symbol_version_string (bfd *abfd, asymbol *symbol, - bfd_boolean *hidden) +_bfd_elf_get_symbol_version_string (bfd *abfd, asymbol *symbol, + bfd_boolean *hidden) { const char *version_string = NULL; if (elf_dynversym (abfd) != 0 @@ -1522,9 +1522,9 @@ bfd_elf_print_symbol (bfd *abfd, bfd_fprintf_vma (abfd, file, val); /* If we have version information, print it. */ - version_string = bfd_elf_get_symbol_version_string (abfd, - symbol, - &hidden); + version_string = _bfd_elf_get_symbol_version_string (abfd, + symbol, + &hidden); if (version_string) { if (!hidden) diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 692fb46524a..9bf4b18f7b1 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -66,6 +66,10 @@ #ifndef bfd_elfNN_get_symbol_info #define bfd_elfNN_get_symbol_info _bfd_elf_get_symbol_info #endif +#ifndef bfd_elfNN_get_symbol_version_string +#define bfd_elfNN_get_symbol_version_string \ + _bfd_elf_get_symbol_version_string +#endif #define bfd_elfNN_canonicalize_symtab _bfd_elf_canonicalize_symtab #define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound #define bfd_elfNN_make_empty_symbol _bfd_elf_make_empty_symbol diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c index f02659fb49c..bd2730a705a 100644 --- a/bfd/i386msdos.c +++ b/bfd/i386msdos.c @@ -162,6 +162,8 @@ msdos_set_section_contents (bfd *abfd, #define msdos_canonicalize_symtab _bfd_nosymbols_canonicalize_symtab #define msdos_print_symbol _bfd_nosymbols_print_symbol #define msdos_get_symbol_info _bfd_nosymbols_get_symbol_info +#define msdos_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string #define msdos_find_nearest_line _bfd_nosymbols_find_nearest_line #define msdos_find_line _bfd_nosymbols_find_line #define msdos_find_inliner_info _bfd_nosymbols_find_inliner_info diff --git a/bfd/i386os9k.c b/bfd/i386os9k.c index d8d54089159..a8f87e53ce6 100644 --- a/bfd/i386os9k.c +++ b/bfd/i386os9k.c @@ -155,6 +155,8 @@ os9k_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define aout_32_close_and_cleanup aout_32_bfd_free_cached_info #define aout_32_find_line _bfd_nosymbols_find_line +#define aout_32_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string #define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define aout_32_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup diff --git a/bfd/ieee.c b/bfd/ieee.c index 70ce4c5cc05..04ac66611ba 100644 --- a/bfd/ieee.c +++ b/bfd/ieee.c @@ -3828,6 +3828,8 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define ieee_update_armap_timestamp bfd_true #define ieee_get_elt_at_index _bfd_generic_get_elt_at_index +#define ieee_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string #define ieee_bfd_is_target_special_symbol \ ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) #define ieee_bfd_is_local_label_name bfd_generic_is_local_label_name diff --git a/bfd/ihex.c b/bfd/ihex.c index 9b3b8138798..7ce8c4bcb71 100644 --- a/bfd/ihex.c +++ b/bfd/ihex.c @@ -918,6 +918,7 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define ihex_make_empty_symbol _bfd_generic_make_empty_symbol #define ihex_print_symbol _bfd_nosymbols_print_symbol #define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info +#define ihex_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define ihex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) #define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name #define ihex_get_lineno _bfd_nosymbols_get_lineno diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index 50a46ac4d26..f51bc1142dd 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -392,6 +392,8 @@ extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *abfd); ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void) #define _bfd_nosymbols_get_symbol_info \ ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void) +#define _bfd_nosymbols_get_symbol_version_string \ + ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) bfd_nullvoidptr) #define _bfd_nosymbols_bfd_is_local_label_name \ ((bfd_boolean (*) (bfd *, const char *)) bfd_false) #define _bfd_nosymbols_bfd_is_target_special_symbol \ diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 6c48f82a5db..a1923c82fb7 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -397,6 +397,8 @@ extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *abfd); ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void) #define _bfd_nosymbols_get_symbol_info \ ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void) +#define _bfd_nosymbols_get_symbol_version_string \ + ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) bfd_nullvoidptr) #define _bfd_nosymbols_bfd_is_local_label_name \ ((bfd_boolean (*) (bfd *, const char *)) bfd_false) #define _bfd_nosymbols_bfd_is_target_special_symbol \ diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h index 6b6eb287e42..dc7866d6a21 100644 --- a/bfd/libcoff-in.h +++ b/bfd/libcoff-in.h @@ -353,6 +353,8 @@ extern void coff_print_symbol (bfd *, void * filep, asymbol *, bfd_print_symbol_type); extern void coff_get_symbol_info (bfd *, asymbol *, symbol_info *ret); +#define coff_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string extern bfd_boolean _bfd_coff_is_local_label_name (bfd *, const char *); extern asymbol *coff_bfd_make_debug_symbol diff --git a/bfd/libcoff.h b/bfd/libcoff.h index 947998570ba..d1c466a6d61 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -357,6 +357,8 @@ extern void coff_print_symbol (bfd *, void * filep, asymbol *, bfd_print_symbol_type); extern void coff_get_symbol_info (bfd *, asymbol *, symbol_info *ret); +#define coff_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string extern bfd_boolean _bfd_coff_is_local_label_name (bfd *, const char *); extern asymbol *coff_bfd_make_debug_symbol diff --git a/bfd/libecoff.h b/bfd/libecoff.h index 06434c27e0d..ebfa37e2481 100644 --- a/bfd/libecoff.h +++ b/bfd/libecoff.h @@ -285,6 +285,8 @@ extern void _bfd_ecoff_print_symbol (bfd *, void *, asymbol *, bfd_print_symbol_type); extern void _bfd_ecoff_get_symbol_info (bfd *, asymbol *, symbol_info *); +#define _bfd_ecoff_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string extern bfd_boolean _bfd_ecoff_bfd_is_local_label_name (bfd *, const char *); #define _bfd_ecoff_get_lineno _bfd_nosymbols_get_lineno diff --git a/bfd/mach-o-target.c b/bfd/mach-o-target.c index a070e677ebd..dd1ced1ddff 100644 --- a/bfd/mach-o-target.c +++ b/bfd/mach-o-target.c @@ -31,6 +31,7 @@ #define bfd_mach_o_bfd_is_local_label_name bfd_generic_is_local_label_name #define bfd_mach_o_get_lineno _bfd_nosymbols_get_lineno #define bfd_mach_o_find_inliner_info _bfd_nosymbols_find_inliner_info +#define bfd_mach_o_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define bfd_mach_o_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define bfd_mach_o_read_minisymbols _bfd_generic_read_minisymbols #define bfd_mach_o_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff --git a/bfd/mmo.c b/bfd/mmo.c index 2c74c764fc0..698ffa5d555 100644 --- a/bfd/mmo.c +++ b/bfd/mmo.c @@ -3204,6 +3204,9 @@ mmo_write_object_contents (bfd *abfd) #define mmo_bfd_is_target_special_symbol \ ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define mmo_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string + /* Is this one really used or defined by anyone? */ #define mmo_get_lineno _bfd_nosymbols_get_lineno diff --git a/bfd/nlm-target.h b/bfd/nlm-target.h index 2343cff1d95..44b41ed65c9 100644 --- a/bfd/nlm-target.h +++ b/bfd/nlm-target.h @@ -25,6 +25,7 @@ #define nlm_make_empty_symbol nlmNAME (make_empty_symbol) #define nlm_print_symbol nlmNAME (print_symbol) #define nlm_get_symbol_info nlmNAME (get_symbol_info) +#define nlm_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define nlm_bfd_is_local_label_name bfd_generic_is_local_label_name #define nlm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) #define nlm_get_lineno _bfd_nosymbols_get_lineno diff --git a/bfd/oasys.c b/bfd/oasys.c index 9ff9b9e536f..9ff9117b72d 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -1170,6 +1170,7 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define oasys_bfd_is_local_label_name bfd_generic_is_local_label_name #define oasys_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) #define oasys_get_lineno _bfd_nosymbols_get_lineno +#define oasys_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define oasys_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define oasys_read_minisymbols _bfd_generic_read_minisymbols #define oasys_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff --git a/bfd/pef.c b/bfd/pef.c index 4c294173b98..363e6416e79 100644 --- a/bfd/pef.c +++ b/bfd/pef.c @@ -43,6 +43,7 @@ #define bfd_pef_find_nearest_line _bfd_nosymbols_find_nearest_line #define bfd_pef_find_line _bfd_nosymbols_find_line #define bfd_pef_find_inliner_info _bfd_nosymbols_find_inliner_info +#define bfd_pef_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define bfd_pef_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define bfd_pef_read_minisymbols _bfd_generic_read_minisymbols #define bfd_pef_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff --git a/bfd/plugin.c b/bfd/plugin.c index a068861641c..7f8f8b53d37 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -85,6 +85,7 @@ dlerror (void) #define bfd_plugin_find_nearest_line _bfd_nosymbols_find_nearest_line #define bfd_plugin_find_line _bfd_nosymbols_find_line #define bfd_plugin_find_inliner_info _bfd_nosymbols_find_inliner_info +#define bfd_plugin_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define bfd_plugin_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define bfd_plugin_read_minisymbols _bfd_generic_read_minisymbols #define bfd_plugin_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c index 9ee8ab5d9b8..7599e20ee08 100644 --- a/bfd/ppcboot.c +++ b/bfd/ppcboot.c @@ -326,6 +326,8 @@ ppcboot_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED, bfd_symbol_info (symbol, ret); } +#define ppcboot_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string #define ppcboot_bfd_is_target_special_symbol \ ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) #define ppcboot_bfd_is_local_label_name bfd_generic_is_local_label_name diff --git a/bfd/som.c b/bfd/som.c index 513e4fa6049..5f96caa64ae 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -6718,6 +6718,7 @@ som_bfd_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) } #define som_find_line _bfd_nosymbols_find_line +#define som_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define som_close_and_cleanup som_bfd_free_cached_info #define som_read_ar_hdr _bfd_generic_read_ar_hdr #define som_write_ar_hdr _bfd_generic_write_ar_hdr diff --git a/bfd/srec.c b/bfd/srec.c index 5f9a54624ee..8de6e425cb8 100644 --- a/bfd/srec.c +++ b/bfd/srec.c @@ -1258,6 +1258,7 @@ srec_print_symbol (bfd *abfd, #define srec_find_line _bfd_nosymbols_find_line #define srec_find_inliner_info _bfd_nosymbols_find_inliner_info #define srec_make_empty_symbol _bfd_generic_make_empty_symbol +#define srec_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define srec_read_minisymbols _bfd_generic_read_minisymbols #define srec_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff --git a/bfd/targets.c b/bfd/targets.c index 8323e9256a1..6a282ea2e12 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -363,6 +363,7 @@ BFD_JUMP_TABLE macros. . NAME##_make_empty_symbol, \ . NAME##_print_symbol, \ . NAME##_get_symbol_info, \ +. NAME##_get_symbol_version_string, \ . NAME##_bfd_is_local_label_name, \ . NAME##_bfd_is_target_special_symbol, \ . NAME##_get_lineno, \ @@ -384,6 +385,9 @@ BFD_JUMP_TABLE macros. . void (*_bfd_get_symbol_info) . (bfd *, struct bfd_symbol *, symbol_info *); .#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) +. const char *(*_bfd_get_symbol_version_string) +. (bfd *, struct bfd_symbol *, bfd_boolean *); +.#define bfd_get_symbol_version_string(b,s,h) BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) . bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); . bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); . alent * (*_get_lineno) (bfd *, struct bfd_symbol *); diff --git a/bfd/tekhex.c b/bfd/tekhex.c index 0328689c854..2f14194833c 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -957,6 +957,7 @@ tekhex_print_symbol (bfd *abfd, #define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line #define tekhex_find_line _bfd_nosymbols_find_line #define tekhex_find_inliner_info _bfd_nosymbols_find_inliner_info +#define tekhex_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define tekhex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define tekhex_read_minisymbols _bfd_generic_read_minisymbols #define tekhex_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff --git a/bfd/versados.c b/bfd/versados.c index 5bafcb1d7cd..236899822c3 100644 --- a/bfd/versados.c +++ b/bfd/versados.c @@ -811,6 +811,7 @@ versados_canonicalize_reloc (bfd *abfd, #define versados_find_nearest_line _bfd_nosymbols_find_nearest_line #define versados_find_line _bfd_nosymbols_find_line #define versados_find_inliner_info _bfd_nosymbols_find_inliner_info +#define versados_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define versados_make_empty_symbol _bfd_generic_make_empty_symbol #define versados_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define versados_read_minisymbols _bfd_generic_read_minisymbols diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index 3789f794de5..8c24ef0c281 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -9191,6 +9191,9 @@ bfd_vms_get_data (bfd *abfd) ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) #define alpha_vms_print_symbol vms_print_symbol #define alpha_vms_get_symbol_info vms_get_symbol_info +#define alpha_vms_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string + #define alpha_vms_read_minisymbols _bfd_generic_read_minisymbols #define alpha_vms_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol #define alpha_vms_get_lineno _bfd_nosymbols_get_lineno diff --git a/bfd/xsym.c b/bfd/xsym.c index 4e2a8ab3dee..870795ea2ba 100644 --- a/bfd/xsym.c +++ b/bfd/xsym.c @@ -35,6 +35,7 @@ #define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line #define bfd_sym_find_line _bfd_nosymbols_find_line #define bfd_sym_find_inliner_info _bfd_nosymbols_find_inliner_info +#define bfd_sym_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define bfd_sym_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define bfd_sym_read_minisymbols _bfd_generic_read_minisymbols #define bfd_sym_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol diff --git a/binutils/ChangeLog b/binutils/ChangeLog index f4d9aa63f4d..86c8555b534 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2014-11-25 H.J. Lu + + * objdump.c (objdump_print_symname): Replace + bfd_elf_get_symbol_version_string with + bfd_get_symbol_version_string. + 2014-11-25 H.J. Lu PR binutils/16496 diff --git a/binutils/objdump.c b/binutils/objdump.c index e04c3eea8fb..fdfa60250c2 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -808,9 +808,7 @@ objdump_print_symname (bfd *abfd, struct disassemble_info *inf, name = alloc; } - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) - version_string = bfd_elf_get_symbol_version_string (abfd, sym, - &hidden); + version_string = bfd_get_symbol_version_string (abfd, sym, &hidden); if (bfd_is_und_section (bfd_get_section (sym))) hidden = TRUE;