diff options
author | Nick Clifton <nickc@redhat.com> | 2018-02-13 13:14:47 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2018-02-13 13:14:47 +0000 |
commit | 68d206766637a041bbbeb89c8a1bfdd76317e192 (patch) | |
tree | 435e8bb00be52ac286ba5cce2c9a99a5f6b3e71d | |
parent | b29d26411c62fef6b1401aff4f2c6a157053de4d (diff) | |
download | gdb-68d206766637a041bbbeb89c8a1bfdd76317e192.zip gdb-68d206766637a041bbbeb89c8a1bfdd76317e192.tar.gz gdb-68d206766637a041bbbeb89c8a1bfdd76317e192.tar.bz2 |
Fix compile time warning messages from gcc version 8 about cast between incompatible function types.
PR 22823
bfd Fix compile time warnings generated by gcc version 8.
* libbfd-in.h: Remove extraneous text from prototypes.
Add prototypes for bfd_false_any, bfd_true_any,
bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any,
bfd_n1_any, bfd_void_any.
(_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy
function.
(_bfd_generic_bfd_merge_private_bfd_data): Likewise.
(_bfd_generic_bfd_set_private_flags): Likewise.
(_bfd_generic_bfd_copy_private_section_data): Likewise.
(_bfd_generic_bfd_copy_private_symbol_data): Likewise.
(_bfd_generic_bfd_copy_private_header_data): Likewise.
(_bfd_generic_bfd_print_private_bfd_data): Likewise.
(_bfd_noarchive_construct_extended_name_table): Likewise.
(_bfd_noarchive_truncate_arname): Likewise.
(_bfd_noarchive_write_ar_hdr): Likewise.
(_bfd_noarchive_get_elt_at_index): Likewise.
(_bfd_nosymbols_canonicalize_symtab): Likewise.
(_bfd_nosymbols_print_symbol): Likewise.
(_bfd_nosymbols_get_symbol_info): Likewise.
(_bfd_nosymbols_get_symbol_version_string): Likewise.
(_bfd_nosymbols_bfd_is_local_label_name): Likewise.
(_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
(_bfd_nosymbols_get_lineno): Likewise.
(_bfd_nosymbols_find_nearest_line): Likewise.
(_bfd_nosymbols_find_line): Likewise.
(_bfd_nosymbols_find_inliner_info): Likewise.
(_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
(_bfd_nosymbols_read_minisymbols): Likewise.
(_bfd_nosymbols_minisymbol_to_symbol): Likewise.
(_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
(_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
(_bfd_nowrite_set_arch_mach): Likewise.
(_bfd_nowrite_set_section_contents): Likewise.
(_bfd_nolink_sizeof_headers): Likewise.
(_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
(_bfd_nolink_bfd_relax_section): Likewise.
(_bfd_nolink_bfd_gc_sections): Likewise.
(_bfd_nolink_bfd_lookup_section_flags): Likewise.
(_bfd_nolink_bfd_merge_sections): Likewise.
(_bfd_nolink_bfd_is_group_section): Likewise.
(_bfd_nolink_bfd_discard_group): Likewise.
(_bfd_nolink_bfd_link_hash_table_create): Likewise.
(_bfd_nolink_bfd_link_add_symbols): Likewise.
(_bfd_nolink_bfd_link_just_syms): Likewise.
(_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
(_bfd_nolink_bfd_final_link): Likewise.
(_bfd_nolink_bfd_link_split_section): Likewise.
(_bfd_nolink_section_already_linked): Likewise.
(_bfd_nolink_bfd_define_common_symbol): Likewise.
(_bfd_nolink_bfd_define_start_stop): Likewise.
(_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
(_bfd_nodynamic_get_synthetic_symtab): Likewise.
(_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
(_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
* libbfd.c (bfd_false_any): New function. Like bfd_false but
accepts one or more arguments.
(bfd_true_any): Likewise.
(bfd_nullvoidptr_any): Likewise.
(bfd_0_any): Likewise.
(bfd_0u_any): Likewise.
(bfd_0l_any): Likewise.
(_bfd_n1_any): Likewise.
(bfd_void_any): Likewise.
* libbfd.h (extern): Regenerate
* aout-target.h (MY_bfd_is_target_special_symbol): Use vararg
based dummy function.
* aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
* binary.c (binary_get_symbol_info): Likewise.
* coff-alpha.c (alpha_ecoff_backend_data): Likewise.
* coff-mips.c (mips_ecoff_backend_data): Likewise.
* coffcode.h (coff_set_alignment_hook): Likewise.
(symname_in_debug_hook): Likewise.
(bfd_coff_backend_data bigobj_swap_table): Likewise.
* elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
* elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
* elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
* elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
* elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
* elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
* elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
* elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
* elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
(bfd_elfNN_bfd_make_debug_symbol): Likewise.
(bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
(bfd_elfNN_bfd_set_private_flags): Likewise.
(bfd_elfNN_bfd_is_target_special_symbol): Likewise.
(elf_backend_init_index_section): Likewise.
(elf_backend_allow_non_load_phdr): Likewise.
* elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
* i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
* ieee.c (ieee_construct_extended_name_table): Likewise.
(ieee_write_armap): Likewise.
(ieee_write_ar_hdr): Likewise.
(ieee_bfd_is_target_special_symbol): Likewise.
* ihex.c (ihex_canonicalize_symtab): Likewise.
(ihex_bfd_is_target_special_symbol): Likewise.
* libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
* libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
(_bfd_ecoff_set_alignment_hook): Likewise.
* mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
* mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
* nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
* oasys.c (oasys_construct_extended_name_table): Likewise.
(oasys_write_armap): Likewise.
(oasys_write_ar_hdr): Likewise.
(oasys_bfd_is_target_special_symbol): Likewise.
* pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
* plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
* ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
* som.c (som_bfd_is_target_special_symbol): Likewise.
* srec.c (srec_bfd_is_target_special_symbol): Likewise.
* tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
* verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
* versados.c (versados_bfd_is_target_special_symbol): Likewise.
(versados_bfd_reloc_name_lookup): Likewise.
* vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
(vms_bfd_define_start_stop): Likewise.
(alpha_vms_bfd_is_target_special_symbol): Likewise.
* wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
* xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
* elf32-arc.c (get_replace_function): Assign replacement function
to func pointer.
* elf32-i370.c (i370_noop): Update prototype.
gas * config/obj-elf.c (elf_pseudo_table): Remove now redundant
casts.
(obj_elf_vtable_inherit): Rename to obj_elf_get_vtable_inherit.
(obj_elf_vtable_inherit): New stub function that calls
obj_elf_get_vtable_inherit.
(obj_elf_vtable_entry): Rename to obj_elf_get_vtable_entry.
(obj_elf_vtable_entry): New stub function that calls
obj_elf_get_vtable_entry.
* config/obj-elf.h (obj_elf_vtable_inherit): Update prototype.
(obj_elf_vtable_entry) Likewise.
(obj_elf_get_vtable_inherit) Likewise.
(obj_elf_get_vtable_entry) Likewise.
* config/tc-arm.c (md_pseudo_table): Remove now redundant cast.
* config/tc-i386c (md_pseudo_table): Likewise.
* config/tc-hppa.c (pa_vtable_entry): Call
obj_elf_get_vtable_entry.
(pa_vtable_inherit): Call obj_elf_get_vtable_inherit.
* config/tc-mips.c (s_mips_file): Replace call to dwarf2_get_file
with call to dwarf2_get_filename.
* dwarf2dbg.c (dwarf2_directive_file): Rename to
dwarf2_directive_filename.
(dwarf2_directive_file): New stub function that calls
dwarf2_directive_filename.
* dwarf2dbg.h: Prototype dwarf2_directive_filename.
opcodes * metag-dis.c (print_fmmov): Double buffer size to avoid warning
about truncation of printing.
60 files changed, 607 insertions, 292 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6b9e1d1..9e2443e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -3,6 +3,141 @@ * wasm-module.c (wasm_scan_name_function_section): Rename `index' local variable to `idx'. +2018-02-13 Nick Clifton <nickc@redhat.com> + + PR 22823 + Fix compile time warnings generated by gcc version 8. + * libbfd-in.h: Remove extraneous text from prototypes. + Add prototypes for bfd_false_any, bfd_true_any, + bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any, + bfd_n1_any, bfd_void_any. + (_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy + function. + (_bfd_generic_bfd_merge_private_bfd_data): Likewise. + (_bfd_generic_bfd_set_private_flags): Likewise. + (_bfd_generic_bfd_copy_private_section_data): Likewise. + (_bfd_generic_bfd_copy_private_symbol_data): Likewise. + (_bfd_generic_bfd_copy_private_header_data): Likewise. + (_bfd_generic_bfd_print_private_bfd_data): Likewise. + (_bfd_noarchive_construct_extended_name_table): Likewise. + (_bfd_noarchive_truncate_arname): Likewise. + (_bfd_noarchive_write_ar_hdr): Likewise. + (_bfd_noarchive_get_elt_at_index): Likewise. + (_bfd_nosymbols_canonicalize_symtab): Likewise. + (_bfd_nosymbols_print_symbol): Likewise. + (_bfd_nosymbols_get_symbol_info): Likewise. + (_bfd_nosymbols_get_symbol_version_string): Likewise. + (_bfd_nosymbols_bfd_is_local_label_name): Likewise. + (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise. + (_bfd_nosymbols_get_lineno): Likewise. + (_bfd_nosymbols_find_nearest_line): Likewise. + (_bfd_nosymbols_find_line): Likewise. + (_bfd_nosymbols_find_inliner_info): Likewise. + (_bfd_nosymbols_bfd_make_debug_symbol): Likewise. + (_bfd_nosymbols_read_minisymbols): Likewise. + (_bfd_nosymbols_minisymbol_to_symbol): Likewise. + (_bfd_norelocs_bfd_reloc_type_lookup): Likewise. + (_bfd_norelocs_bfd_reloc_name_lookup): Likewise. + (_bfd_nowrite_set_arch_mach): Likewise. + (_bfd_nowrite_set_section_contents): Likewise. + (_bfd_nolink_sizeof_headers): Likewise. + (_bfd_nolink_bfd_get_relocated_section_contents): Likewise. + (_bfd_nolink_bfd_relax_section): Likewise. + (_bfd_nolink_bfd_gc_sections): Likewise. + (_bfd_nolink_bfd_lookup_section_flags): Likewise. + (_bfd_nolink_bfd_merge_sections): Likewise. + (_bfd_nolink_bfd_is_group_section): Likewise. + (_bfd_nolink_bfd_discard_group): Likewise. + (_bfd_nolink_bfd_link_hash_table_create): Likewise. + (_bfd_nolink_bfd_link_add_symbols): Likewise. + (_bfd_nolink_bfd_link_just_syms): Likewise. + (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise. + (_bfd_nolink_bfd_final_link): Likewise. + (_bfd_nolink_bfd_link_split_section): Likewise. + (_bfd_nolink_section_already_linked): Likewise. + (_bfd_nolink_bfd_define_common_symbol): Likewise. + (_bfd_nolink_bfd_define_start_stop): Likewise. + (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise. + (_bfd_nodynamic_get_synthetic_symtab): Likewise. + (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise. + (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise. + * libbfd.c (bfd_false_any): New function. Like bfd_false but + accepts one or more arguments. + (bfd_true_any): Likewise. + (bfd_nullvoidptr_any): Likewise. + (bfd_0_any): Likewise. + (bfd_0u_any): Likewise. + (bfd_0l_any): Likewise. + (_bfd_n1_any): Likewise. + (bfd_void_any): Likewise. + * libbfd.h (extern): Regenerate + * aout-target.h (MY_bfd_is_target_special_symbol): Use vararg + based dummy function. + * aout-tic30.c (tic30_aout_set_arch_mach): Likewise. + * binary.c (binary_get_symbol_info): Likewise. + * coff-alpha.c (alpha_ecoff_backend_data): Likewise. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * coffcode.h (coff_set_alignment_hook): Likewise. + (symname_in_debug_hook): Likewise. + (bfd_coff_backend_data bigobj_swap_table): Likewise. + * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-score.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise. + * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise. + * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise. + (bfd_elfNN_bfd_make_debug_symbol): Likewise. + (bfd_elfNN_bfd_merge_private_bfd_data): Likewise. + (bfd_elfNN_bfd_set_private_flags): Likewise. + (bfd_elfNN_bfd_is_target_special_symbol): Likewise. + (elf_backend_init_index_section): Likewise. + (elf_backend_allow_non_load_phdr): Likewise. + * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise. + * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise. + * ieee.c (ieee_construct_extended_name_table): Likewise. + (ieee_write_armap): Likewise. + (ieee_write_ar_hdr): Likewise. + (ieee_bfd_is_target_special_symbol): Likewise. + * ihex.c (ihex_canonicalize_symtab): Likewise. + (ihex_bfd_is_target_special_symbol): Likewise. + * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise. + * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise. + (_bfd_ecoff_set_alignment_hook): Likewise. + * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise. + * mmo.c (mmo_bfd_is_target_special_symbol): Likewise. + * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise. + * oasys.c (oasys_construct_extended_name_table): Likewise. + (oasys_write_armap): Likewise. + (oasys_write_ar_hdr): Likewise. + (oasys_bfd_is_target_special_symbol): Likewise. + * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise. + * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise. + * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise. + * som.c (som_bfd_is_target_special_symbol): Likewise. + * srec.c (srec_bfd_is_target_special_symbol): Likewise. + * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise. + * verilog.c (verilog_bfd_is_target_special_symbol): Likewise. + * versados.c (versados_bfd_is_target_special_symbol): Likewise. + (versados_bfd_reloc_name_lookup): Likewise. + * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise. + (vms_bfd_define_start_stop): Likewise. + (alpha_vms_bfd_is_target_special_symbol): Likewise. + * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise. + * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise. + * elf32-arc.c (get_replace_function): Assign replacement function + to func pointer. + * elf32-i370.c (i370_noop): Update prototype. + 2018-02-13 Alan Modra <amodra@gmail.com> PR 22836 diff --git a/bfd/aout-target.h b/bfd/aout-target.h index cb14b98..0ea615a 100644 --- a/bfd/aout-target.h +++ b/bfd/aout-target.h @@ -581,7 +581,7 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info) #endif #ifndef MY_bfd_is_target_special_symbol -#define MY_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define MY_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #endif #ifndef MY_bfd_free_cached_info diff --git a/bfd/aout-tic30.c b/bfd/aout-tic30.c index d8ad415..a1a57b6 100644 --- a/bfd/aout-tic30.c +++ b/bfd/aout-tic30.c @@ -1037,7 +1037,7 @@ tic30_aout_set_arch_mach (bfd *abfd, #ifndef MY_bfd_is_target_special_symbol #define MY_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #endif #ifndef MY_bfd_free_cached_info diff --git a/bfd/binary.c b/bfd/binary.c index 518b845..67d76f4 100644 --- a/bfd/binary.c +++ b/bfd/binary.c @@ -211,7 +211,7 @@ binary_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED, #define binary_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define binary_read_minisymbols _bfd_generic_read_minisymbols #define binary_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol -#define binary_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define binary_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) /* Set the architecture of a binary file. */ #define binary_set_arch_mach _bfd_generic_set_arch_mach diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index fe8669f..c47fe3f 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -2226,13 +2226,13 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = { /* COFF backend structure. */ { - (void (*) (bfd *,void *,int,int,int,int,void *)) bfd_void, /* aux_in */ - (void (*) (bfd *,void *,void *)) bfd_void, /* sym_in */ - (void (*) (bfd *,void *,void *)) bfd_void, /* lineno_in */ - (unsigned (*) (bfd *,void *,int,int,int,int,void *)) bfd_void,/*aux_out*/ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* sym_out */ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* lineno_out */ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* reloc_out */ + (void (*) (bfd *, void *, int, int, int, int, void *)) bfd_void_any, /* aux_in */ + (void (*) (bfd *, void *, void *)) bfd_void_any, /* sym_in */ + (void (*) (bfd *, void *, void *)) bfd_void_any, /* lineno_in */ + (unsigned (*) (bfd *, void *, int, int, int, int, void *)) bfd_0u_any,/*aux_out*/ + (unsigned (*) (bfd *, void *, void *)) bfd_0u_any, /* sym_out */ + (unsigned (*) (bfd *, void *, void *)) bfd_0u_any, /* lineno_out */ + (unsigned (*) (bfd *, void *, void *)) bfd_0u_any, /* reloc_out */ alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out, alpha_ecoff_swap_scnhdr_out, FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index 2891133..41ba4b5 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -1244,13 +1244,13 @@ static const struct ecoff_backend_data mips_ecoff_backend_data = { /* COFF backend structure. */ { - (void (*) (bfd *,void *,int,int,int,int,void *)) bfd_void, /* aux_in */ - (void (*) (bfd *,void *,void *)) bfd_void, /* sym_in */ - (void (*) (bfd *,void *,void *)) bfd_void, /* lineno_in */ - (unsigned (*) (bfd *,void *,int,int,int,int,void *)) bfd_void,/*aux_out*/ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* sym_out */ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* lineno_out */ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* reloc_out */ + (void (*) (bfd *,void *,int,int,int,int,void *)) bfd_void_any, /* aux_in */ + (void (*) (bfd *,void *,void *)) bfd_void_any, /* sym_in */ + (void (*) (bfd *,void *,void *)) bfd_void_any, /* lineno_in */ + (unsigned (*) (bfd *,void *,int,int,int,int,void *)) bfd_0u_any,/*aux_out*/ + (unsigned (*) (bfd *,void *,void *)) bfd_0u_any, /* sym_out */ + (unsigned (*) (bfd *,void *,void *)) bfd_0u_any, /* lineno_out */ + (unsigned (*) (bfd *,void *,void *)) bfd_0u_any, /* reloc_out */ mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out, mips_ecoff_swap_scnhdr_out, FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, diff --git a/bfd/coffcode.h b/bfd/coffcode.h index ec0103e..aaf5add 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1986,7 +1986,7 @@ coff_set_alignment_hook (bfd *abfd, asection *section, void * scnhdr) #else /* ! RS6000COFF_C */ #define coff_set_alignment_hook \ - ((void (*) (bfd *, asection *, void *)) bfd_void) + ((void (*) (bfd *, asection *, void *)) bfd_void_any) #endif /* ! RS6000COFF_C */ #endif /* ! COFF_WITH_PE */ @@ -2508,7 +2508,7 @@ symname_in_debug_hook (bfd * abfd ATTRIBUTE_UNUSED, struct internal_syment *sym) #else #define symname_in_debug_hook \ - (bfd_boolean (*) (bfd *, struct internal_syment *)) bfd_false + (bfd_boolean (*) (bfd *, struct internal_syment *)) bfd_false_any #endif @@ -6024,7 +6024,7 @@ static bfd_coff_backend_data bigobj_swap_table = #endif #ifndef coff_bfd_is_target_special_symbol -#define coff_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define coff_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #endif #ifndef coff_read_minisymbols diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index a91257e..5110815 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -5575,7 +5575,7 @@ mn10300_elf_mkobject (bfd *abfd) #define elf_backend_size_dynamic_sections \ _bfd_mn10300_elf_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_finish_dynamic_symbol \ _bfd_mn10300_elf_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 1ad9e3e..839f624 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -98,6 +98,7 @@ reloc_type_to_name (unsigned int type) break; } } + #undef ARC_RELOC_HOWTO /* Try to minimize the amount of space occupied by relocation tables @@ -160,7 +161,7 @@ struct arc_relocation_data }; /* Should be included at this location due to static declarations - * defined before this point. */ + defined before this point. */ #include "arc-got.h" #define arc_bfd_get_8(A,B,C) bfd_get_8(A,B) @@ -199,11 +200,13 @@ arc_elf_reloc (bfd *abfd ATTRIBUTE_UNUSED, #define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ TYPE = VALUE, + enum howto_list { #include "elf/arc-reloc.def" HOWTO_LIST_LAST }; + #undef ARC_RELOC_HOWTO #define ARC_RELOC_HOWTO(TYPE, VALUE, RSIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ @@ -233,16 +236,17 @@ static struct reloc_howto_struct elf_arc_howto_table[] = }; #undef ARC_RELOC_HOWTO -static void arc_elf_howto_init (void) +static void +arc_elf_howto_init (void) { #define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ - elf_arc_howto_table[TYPE].pc_relative = \ + elf_arc_howto_table[TYPE].pc_relative = \ (strstr (#FORMULA, " P ") != NULL || strstr (#FORMULA, " PDATA ") != NULL); \ - elf_arc_howto_table[TYPE].dst_mask = RELOC_FUNCTION(0, ~0); \ - /* Only 32 bit data relocations should be marked as ME. */ \ - if (strstr (#FORMULA, " ME ") != NULL) \ - { \ - BFD_ASSERT (SIZE == 2); \ + elf_arc_howto_table[TYPE].dst_mask = RELOC_FUNCTION(0, ~0); \ + /* Only 32 bit data relocations should be marked as ME. */ \ + if (strstr (#FORMULA, " ME ") != NULL) \ + { \ + BFD_ASSERT (SIZE == 2); \ } #include "elf/arc-reloc.def" @@ -253,10 +257,12 @@ static void arc_elf_howto_init (void) #define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ [TYPE] = VALUE, + const int howto_table_lookup[] = { #include "elf/arc-reloc.def" }; + #undef ARC_RELOC_HOWTO static reloc_howto_type * @@ -358,6 +364,7 @@ arc_elf_link_hash_table_create (bfd *abfd) #define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ { BFD_RELOC_##TYPE, R_##TYPE }, + static const struct arc_reloc_map arc_reloc_map[] = { #include "elf/arc-reloc.def" @@ -368,6 +375,7 @@ static const struct arc_reloc_map arc_reloc_map[] = {BFD_RELOC_24, R_ARC_24}, {BFD_RELOC_32, R_ARC_32}, }; + #undef ARC_RELOC_HOWTO typedef ATTRIBUTE_UNUSED bfd_vma (*replace_func) (unsigned, int ATTRIBUTE_UNUSED); @@ -376,6 +384,7 @@ typedef ATTRIBUTE_UNUSED bfd_vma (*replace_func) (unsigned, int ATTRIBUTE_UNUSED case TYPE: \ func = (void *) RELOC_FUNCTION; \ break; + static replace_func get_replace_function (bfd *abfd, unsigned int r_type) { @@ -387,7 +396,7 @@ get_replace_function (bfd *abfd, unsigned int r_type) } if (func == replace_bits24 && bfd_big_endian (abfd)) - return (replace_func) replace_bits24_be; + func = replace_bits24_be; return (replace_func) func; } diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c index 7bb67a7..0e19fa6 100644 --- a/bfd/elf32-cr16.c +++ b/bfd/elf32-cr16.c @@ -2922,7 +2922,7 @@ _bfd_cr16_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSE #define elf_backend_size_dynamic_sections \ _bfd_cr16_elf_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_finish_dynamic_symbol \ _bfd_cr16_elf_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index 88be84b..e8e2e57 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -1405,10 +1405,10 @@ i370_elf_relocate_section (bfd *output_bfd, #define elf_backend_adjust_dynamic_symbol i370_elf_adjust_dynamic_symbol #define elf_backend_check_relocs i370_elf_check_relocs -static int -i370_noop (void) +static bfd_boolean +i370_noop (bfd * abfd ATTRIBUTE_UNUSED, ...) { - return 1; + return TRUE; } #define elf_backend_finish_dynamic_symbol \ diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c index 089ec84..2adece3 100644 --- a/bfd/elf32-lm32.c +++ b/bfd/elf32-lm32.c @@ -2580,7 +2580,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd) #define elf_backend_reloc_type_class lm32_elf_reloc_type_class #define elf_backend_copy_indirect_symbol lm32_elf_copy_indirect_symbol #define elf_backend_size_dynamic_sections lm32_elf_size_dynamic_sections -#define elf_backend_omit_section_dynsym ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_omit_section_dynsym ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_create_dynamic_sections lm32_elf_create_dynamic_sections #define elf_backend_finish_dynamic_sections lm32_elf_finish_dynamic_sections #define elf_backend_adjust_dynamic_symbol lm32_elf_adjust_dynamic_symbol diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 78d5e39..c90bee7 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -3855,7 +3855,7 @@ m32r_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, #define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create #define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections #define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol #define elf_backend_finish_dynamic_symbol m32r_elf_finish_dynamic_symbol diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c index b985fc0..887ac30 100644 --- a/bfd/elf32-metag.c +++ b/bfd/elf32-metag.c @@ -4141,7 +4141,7 @@ elf_metag_plt_sym_val (bfd_vma i, const asection *plt, #define elf_backend_finish_dynamic_sections elf_metag_finish_dynamic_sections #define elf_backend_size_dynamic_sections elf_metag_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_post_process_headers elf_metag_post_process_headers #define elf_backend_reloc_type_class elf_metag_reloc_type_class #define elf_backend_copy_indirect_symbol elf_metag_copy_indirect_symbol diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c index 897ab8a..20f7798 100644 --- a/bfd/elf32-score.c +++ b/bfd/elf32-score.c @@ -4467,7 +4467,7 @@ _bfd_score_elf_common_definition (Elf_Internal_Sym *sym) #define elf_backend_size_dynamic_sections \ _bfd_score_elf_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_create_dynamic_sections \ _bfd_score_elf_create_dynamic_sections #define elf_backend_finish_dynamic_symbol \ diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c index 2b803e6..d8b43c2 100644 --- a/bfd/elf32-score7.c +++ b/bfd/elf32-score7.c @@ -3872,4 +3872,4 @@ s7_elf32_score_new_section_hook (bfd *abfd, asection *sec) } #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index 476f9e0..fbc038a 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -1009,7 +1009,7 @@ xstormy16_elf_gc_mark_hook (asection *sec, #define elf_backend_always_size_sections \ xstormy16_elf_always_size_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_finish_dynamic_sections \ xstormy16_elf_finish_dynamic_sections diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index b3a7467..fd0a362 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -11244,7 +11244,7 @@ static const struct bfd_elf_special_section elf_xtensa_special_sections[] = #define elf_backend_size_dynamic_sections elf_xtensa_size_dynamic_sections #define elf_backend_always_size_sections elf_xtensa_always_size_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_special_sections elf_xtensa_special_sections #define elf_backend_action_discarded elf_xtensa_action_discarded #define elf_backend_copy_indirect_symbol elf_xtensa_copy_indirect_symbol diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index db4001c..af21a38 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -5495,7 +5495,7 @@ static const struct elf_size_info alpha_elf_size_info = #define elf_backend_size_dynamic_sections \ elf64_alpha_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_relocate_section \ elf64_alpha_relocate_section #define elf_backend_finish_dynamic_symbol \ diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index ff96a8c..353367b 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -4053,7 +4053,7 @@ const struct elf_size_info hppa64_elf_size_info = #define elf_backend_post_process_headers elf64_hppa_post_process_headers #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_adjust_dynamic_symbol \ elf64_hppa_adjust_dynamic_symbol diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c index 0fab317..4d37127 100644 --- a/bfd/elf64-ia64-vms.c +++ b/bfd/elf64-ia64-vms.c @@ -5481,7 +5481,7 @@ static const struct elf_size_info elf64_ia64_vms_size_info = { #define elf_backend_size_dynamic_sections \ elf64_ia64_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_relocate_section \ elf64_ia64_relocate_section #define elf_backend_finish_dynamic_symbol \ diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index 16930c1..e164db7 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -2902,7 +2902,7 @@ mmix_elf_relax_section (bfd *abfd, #define elf_backend_check_relocs mmix_elf_check_relocs #define elf_backend_symbol_processing mmix_elf_symbol_processing #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define bfd_elf64_bfd_copy_link_hash_symbol_type \ _bfd_generic_copy_link_hash_symbol_type diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 8a41764..917ca56 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -3927,7 +3927,7 @@ static const struct bfd_elf_special_section sh64_elf64_special_sections[]= #define elf_backend_size_dynamic_sections \ sh64_elf64_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_finish_dynamic_symbol \ sh64_elf64_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c index 3af05f6..b6181d6 100644 --- a/bfd/elfnn-ia64.c +++ b/bfd/elfnn-ia64.c @@ -5046,7 +5046,7 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, #define elf_backend_size_dynamic_sections \ elfNN_ia64_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_relocate_section \ elfNN_ia64_relocate_section #define elf_backend_finish_dynamic_symbol \ diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index fcd487f..af6d7b8 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -148,7 +148,7 @@ #define bfd_elfNN_bfd_debug_info_start bfd_void #define bfd_elfNN_bfd_debug_info_end bfd_void #define bfd_elfNN_bfd_debug_info_accumulate \ - ((void (*) (bfd*, struct bfd_section *)) bfd_void) + ((void (*) (bfd*, struct bfd_section *)) bfd_void_any) #ifndef bfd_elfNN_bfd_get_relocated_section_contents #define bfd_elfNN_bfd_get_relocated_section_contents \ @@ -212,7 +212,7 @@ #ifndef bfd_elfNN_bfd_make_debug_symbol #define bfd_elfNN_bfd_make_debug_symbol \ - ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) + ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr_any) #endif #ifndef bfd_elfNN_bfd_copy_private_symbol_data @@ -238,18 +238,18 @@ #endif #ifndef bfd_elfNN_bfd_merge_private_bfd_data #define bfd_elfNN_bfd_merge_private_bfd_data \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true_any) #endif #ifndef bfd_elfNN_bfd_set_private_flags #define bfd_elfNN_bfd_set_private_flags \ - ((bfd_boolean (*) (bfd *, flagword)) bfd_true) + ((bfd_boolean (*) (bfd *, flagword)) bfd_true_any) #endif #ifndef bfd_elfNN_bfd_is_local_label_name #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name #endif #ifndef bfd_elfNN_bfd_is_target_special_symbol #define bfd_elfNN_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #endif #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound @@ -474,7 +474,7 @@ #endif #ifndef elf_backend_init_index_section #define elf_backend_init_index_section \ - ((void (*) (bfd *, struct bfd_link_info *)) bfd_void) + ((void (*) (bfd *, struct bfd_link_info *)) bfd_void_any) #endif #ifndef elf_backend_relocate_section #define elf_backend_relocate_section 0 @@ -502,7 +502,7 @@ #endif #ifndef elf_backend_allow_non_load_phdr #define elf_backend_allow_non_load_phdr \ - ((bfd_boolean (*) (bfd *, const Elf_Internal_Phdr *, unsigned)) bfd_false) + ((bfd_boolean (*) (bfd *, const Elf_Internal_Phdr *, unsigned)) bfd_false_any) #endif #ifndef elf_backend_ecoff_debug_swap #define elf_backend_ecoff_debug_swap 0 diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h index a7bd49e..0162a90 100644 --- a/bfd/elfxx-x86.h +++ b/bfd/elfxx-x86.h @@ -692,7 +692,7 @@ extern bfd * _bfd_x86_elf_link_setup_gnu_properties #define elf_backend_gc_mark_hook \ _bfd_x86_elf_gc_mark_hook #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true_any) #define elf_backend_parse_gnu_properties \ _bfd_x86_elf_parse_gnu_properties #define elf_backend_merge_gnu_properties \ diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c index 5437b16..c4d6ebe 100644 --- a/bfd/i386msdos.c +++ b/bfd/i386msdos.c @@ -251,7 +251,7 @@ msdos_set_section_contents (bfd *abfd, #define msdos_find_line _bfd_nosymbols_find_line #define msdos_find_inliner_info _bfd_nosymbols_find_inliner_info #define msdos_get_lineno _bfd_nosymbols_get_lineno -#define msdos_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define msdos_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define msdos_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name #define msdos_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define msdos_read_minisymbols _bfd_nosymbols_read_minisymbols @@ -3858,21 +3858,21 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define ieee_construct_extended_name_table \ ((bfd_boolean (*) \ (bfd *, char **, bfd_size_type *, const char **)) \ - bfd_true) + bfd_true_any) #define ieee_truncate_arname bfd_dont_truncate_arname #define ieee_write_armap \ ((bfd_boolean (*) \ (bfd *, unsigned int, struct orl *, unsigned int, int)) \ - bfd_true) + bfd_true_any) #define ieee_read_ar_hdr bfd_nullvoidptr -#define ieee_write_ar_hdr ((bfd_boolean (*) (bfd *, bfd *)) bfd_false) +#define ieee_write_ar_hdr ((bfd_boolean (*) (bfd *, bfd *)) bfd_false_any) #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) + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define ieee_bfd_is_local_label_name bfd_generic_is_local_label_name #define ieee_get_lineno _bfd_nosymbols_get_lineno #define ieee_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol @@ -919,12 +919,12 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define ihex_new_section_hook _bfd_generic_new_section_hook #define ihex_get_section_contents_in_window _bfd_generic_get_section_contents_in_window #define ihex_get_symtab_upper_bound bfd_0l -#define ihex_canonicalize_symtab ((long (*) (bfd *, asymbol **)) bfd_0l) +#define ihex_canonicalize_symtab ((long (*) (bfd *, asymbol **)) bfd_0l_any) #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_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name #define ihex_get_lineno _bfd_nosymbols_get_lineno #define ihex_find_nearest_line _bfd_nosymbols_find_nearest_line diff --git a/bfd/libaout.h b/bfd/libaout.h index 274207d..eb9c052 100644 --- a/bfd/libaout.h +++ b/bfd/libaout.h @@ -618,7 +618,7 @@ extern bfd_boolean NAME (aout, bfd_free_cached_info) #ifndef aout_32_bfd_is_target_special_symbol #define aout_32_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #endif #ifndef WRITE_HEADERS diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index b7b7905..2be89e8 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -121,21 +121,21 @@ extern void bfd_release (bfd *, void *); bfd * _bfd_create_empty_archive_element_shell - (bfd *obfd); + (bfd *); bfd * _bfd_look_for_bfd_in_cache (bfd *, file_ptr); bfd_boolean _bfd_add_bfd_to_archive_cache (bfd *, file_ptr, bfd *); bfd_boolean _bfd_generic_mkarchive - (bfd *abfd); + (bfd *); char *_bfd_append_relative_path - (bfd *arch, char *elt_name); + (bfd *, char *); const bfd_target *bfd_generic_archive_p - (bfd *abfd); + (bfd *); bfd_boolean bfd_slurp_armap - (bfd *abfd); + (bfd *); bfd_boolean bfd_slurp_bsd_armap_f2 - (bfd *abfd); + (bfd *); #define bfd_slurp_bsd_armap bfd_slurp_armap #define bfd_slurp_coff_armap bfd_slurp_armap bfd_boolean _bfd_archive_64_bit_slurp_armap @@ -162,15 +162,15 @@ bfd_boolean _bfd_archive_64_bit_write_armap bfd_true bfd_boolean _bfd_slurp_extended_name_table - (bfd *abfd); + (bfd *); extern bfd_boolean _bfd_construct_extended_name_table (bfd *, bfd_boolean, char **, bfd_size_type *); bfd_boolean _bfd_write_archive_contents - (bfd *abfd); + (bfd *); bfd_boolean _bfd_compute_and_write_armap - (bfd *, unsigned int elength); + (bfd *, unsigned int); bfd *_bfd_get_elt_at_filepos - (bfd *archive, file_ptr filepos); + (bfd *, file_ptr); extern bfd *_bfd_generic_get_elt_at_index (bfd *, symindex); bfd * _bfd_new_bfd @@ -178,42 +178,56 @@ bfd * _bfd_new_bfd bfd_boolean _bfd_free_cached_info (bfd *); -bfd_boolean bfd_false - (bfd *ignore); -bfd_boolean bfd_true - (bfd *ignore); -void *bfd_nullvoidptr - (bfd *ignore); -int bfd_0 - (bfd *ignore); -unsigned int bfd_0u - (bfd *ignore); -long bfd_0l - (bfd *ignore); -long _bfd_n1 - (bfd *ignore); -void bfd_void - (bfd *ignore); +extern bfd_boolean bfd_false + (bfd *); +extern bfd_boolean bfd_false_any + (bfd *, ...); +extern bfd_boolean bfd_true + (bfd *); +extern bfd_boolean bfd_true_any + (bfd *, ...); +extern void * bfd_nullvoidptr + (bfd *); +extern void * bfd_nullvoidptr_any + (bfd *, ...); +extern int bfd_0 + (bfd *); +extern int bfd_0_any + (bfd *, ...); +extern unsigned int bfd_0u + (bfd *); +extern unsigned int bfd_0u_any + (bfd *, ...); +extern long bfd_0l + (bfd *); +extern long bfd_0l_any + (bfd *, ...); +extern long _bfd_n1 + (bfd *); +extern long _bfd_n1_any + (bfd *, ...); +extern void bfd_void + (bfd *); +extern void bfd_void_any + (bfd *, ...); bfd *_bfd_new_bfd_contained_in (bfd *); const bfd_target *_bfd_dummy_target - (bfd *abfd); + (bfd *); void bfd_dont_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); void bfd_bsd_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); void bfd_gnu_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); bfd_boolean _bfd_bsd_write_armap - (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, - int stridx); + (bfd *, unsigned int, struct orl *, unsigned int, int); bfd_boolean _bfd_coff_write_armap - (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, - int stridx); + (bfd *, unsigned int, struct orl *, unsigned int, int); extern void *_bfd_generic_read_ar_hdr (bfd *); @@ -232,7 +246,7 @@ extern bfd_boolean _bfd_bsd44_write_ar_hdr (bfd *, bfd *); bfd * bfd_generic_openr_next_archived_file - (bfd *archive, bfd *last_file); + (bfd *, bfd *); int bfd_generic_stat_arch_elt (bfd *, struct stat *); @@ -260,19 +274,19 @@ extern bfd_boolean _bfd_generic_get_section_contents_in_window BFD_JUMP_TABLE_COPY (_bfd_generic). */ #define _bfd_generic_bfd_copy_private_bfd_data \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true_any) #define _bfd_generic_bfd_merge_private_bfd_data \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true_any) #define _bfd_generic_bfd_set_private_flags \ - ((bfd_boolean (*) (bfd *, flagword)) bfd_true) + ((bfd_boolean (*) (bfd *, flagword)) bfd_true_any) #define _bfd_generic_bfd_copy_private_section_data \ - ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true_any) #define _bfd_generic_bfd_copy_private_symbol_data \ - ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true) + ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true_any) #define _bfd_generic_bfd_copy_private_header_data \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true_any) #define _bfd_generic_bfd_print_private_bfd_data \ - ((bfd_boolean (*) (bfd *, void *)) bfd_true) + ((bfd_boolean (*) (bfd *, void *)) bfd_true_any) extern bfd_boolean _bfd_generic_init_private_section_data (bfd *, asection *, bfd *, asection *, struct bfd_link_info *); @@ -296,19 +310,19 @@ extern int _bfd_nocore_core_file_pid #define _bfd_noarchive_slurp_extended_name_table bfd_false #define _bfd_noarchive_construct_extended_name_table \ ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) \ - bfd_false) + bfd_false_any) #define _bfd_noarchive_truncate_arname \ - ((void (*) (bfd *, const char *, char *)) bfd_void) + ((void (*) (bfd *, const char *, char *)) bfd_void_any) #define _bfd_noarchive_write_armap \ ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) \ - bfd_false) + bfd_false_any) #define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr #define _bfd_noarchive_write_ar_hdr \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_false) + ((bfd_boolean (*) (bfd *, bfd *)) bfd_false_any) #define _bfd_noarchive_openr_next_archived_file \ - ((bfd *(*) (bfd *, bfd *)) bfd_nullvoidptr) + ((bfd *(*) (bfd *, bfd *)) bfd_nullvoidptr_any) #define _bfd_noarchive_get_elt_at_index \ - ((bfd *(*) (bfd *, symindex)) bfd_nullvoidptr) + ((bfd *(*) (bfd *, symindex)) bfd_nullvoidptr_any) #define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt #define _bfd_noarchive_update_armap_timestamp bfd_false @@ -375,7 +389,7 @@ extern bfd_boolean _bfd_archive_bsd44_construct_extended_name_table archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_vms_lib). Some of them are irrelevant. */ -extern bfd_boolean _bfd_vms_lib_write_archive_contents (bfd *arch); +extern bfd_boolean _bfd_vms_lib_write_archive_contents (bfd *); #define _bfd_vms_lib_slurp_armap _bfd_noarchive_slurp_armap #define _bfd_vms_lib_slurp_extended_name_table \ _bfd_noarchive_slurp_extended_name_table @@ -394,49 +408,49 @@ extern int _bfd_vms_lib_generic_stat_arch_elt (bfd *, struct stat *); extern symindex _bfd_vms_lib_find_symbol (bfd *, const char *); extern bfd *_bfd_vms_lib_get_imagelib_file (bfd *); -extern const bfd_target *_bfd_vms_lib_alpha_archive_p (bfd *abfd); -extern const bfd_target *_bfd_vms_lib_ia64_archive_p (bfd *abfd); -extern bfd_boolean _bfd_vms_lib_alpha_mkarchive (bfd *abfd); -extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *abfd); +extern const bfd_target *_bfd_vms_lib_alpha_archive_p (bfd *); +extern const bfd_target *_bfd_vms_lib_ia64_archive_p (bfd *); +extern bfd_boolean _bfd_vms_lib_alpha_mkarchive (bfd *); +extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *); /* Routines to use for BFD_JUMP_TABLE_SYMBOLS where there is no symbol support. Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols). */ #define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1 #define _bfd_nosymbols_canonicalize_symtab \ - ((long (*) (bfd *, asymbol **)) _bfd_n1) + ((long (*) (bfd *, asymbol **)) _bfd_n1_any) #define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol #define _bfd_nosymbols_print_symbol \ - ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void) + ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void_any) #define _bfd_nosymbols_get_symbol_info \ - ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void) + ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void_any) #define _bfd_nosymbols_get_symbol_version_string \ - ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) bfd_nullvoidptr) + ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) bfd_nullvoidptr_any) #define _bfd_nosymbols_bfd_is_local_label_name \ - ((bfd_boolean (*) (bfd *, const char *)) bfd_false) + ((bfd_boolean (*) (bfd *, const char *)) bfd_false_any) #define _bfd_nosymbols_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define _bfd_nosymbols_get_lineno \ - ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr) + ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr_any) #define _bfd_nosymbols_find_nearest_line \ ((bfd_boolean (*) (bfd *, asymbol **, asection *, bfd_vma, \ const char **, const char **, unsigned int *, \ unsigned int *)) \ - bfd_false) + bfd_false_any) #define _bfd_nosymbols_find_line \ ((bfd_boolean (*) (bfd *, asymbol **, asymbol *, \ const char **, unsigned int *)) \ - bfd_false) + bfd_false_any) #define _bfd_nosymbols_find_inliner_info \ ((bfd_boolean (*) (bfd *, const char **, const char **, unsigned int *)) \ - bfd_false) + bfd_false_any) #define _bfd_nosymbols_bfd_make_debug_symbol \ - ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) + ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr_any) #define _bfd_nosymbols_read_minisymbols \ - ((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) _bfd_n1) + ((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) _bfd_n1_any) #define _bfd_nosymbols_minisymbol_to_symbol \ ((asymbol *(*) (bfd *, bfd_boolean, const void *, asymbol *)) \ - bfd_nullvoidptr) + bfd_nullvoidptr_any) /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ @@ -447,19 +461,19 @@ extern long _bfd_norelocs_canonicalize_reloc (bfd *, asection *, extern void _bfd_norelocs_set_reloc (bfd *, asection *, arelent **, unsigned int); #define _bfd_norelocs_bfd_reloc_type_lookup \ - ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) + ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr_any) #define _bfd_norelocs_bfd_reloc_name_lookup \ - ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr) + ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr_any) /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */ #define _bfd_nowrite_set_arch_mach \ ((bfd_boolean (*) (bfd *, enum bfd_architecture, unsigned long)) \ - bfd_false) + bfd_false_any) #define _bfd_nowrite_set_section_contents \ ((bfd_boolean (*) (bfd *, asection *, const void *, file_ptr, bfd_size_type)) \ - bfd_false) + bfd_false_any) /* Generic routines to use for BFD_JUMP_TABLE_WRITE. Use BFD_JUMP_TABLE_WRITE (_bfd_generic). */ @@ -472,52 +486,52 @@ extern bfd_boolean _bfd_generic_set_section_contents support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ #define _bfd_nolink_sizeof_headers \ - ((int (*) (bfd *, struct bfd_link_info *)) bfd_0) + ((int (*) (bfd *, struct bfd_link_info *)) bfd_0_any) #define _bfd_nolink_bfd_get_relocated_section_contents \ ((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \ bfd_byte *, bfd_boolean, asymbol **)) \ - bfd_nullvoidptr) + bfd_nullvoidptr_any) #define _bfd_nolink_bfd_relax_section \ ((bfd_boolean (*) \ (bfd *, asection *, struct bfd_link_info *, bfd_boolean *)) \ - bfd_false) + bfd_false_any) #define _bfd_nolink_bfd_gc_sections \ ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ - bfd_false) + bfd_false_any) #define _bfd_nolink_bfd_lookup_section_flags \ ((bfd_boolean (*) (struct bfd_link_info *, struct flag_info *, asection *)) \ - bfd_0) + bfd_0_any) #define _bfd_nolink_bfd_merge_sections \ ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ - bfd_false) + bfd_false_any) #define _bfd_nolink_bfd_is_group_section \ ((bfd_boolean (*) (bfd *, const struct bfd_section *)) \ - bfd_false) + bfd_false_any) #define _bfd_nolink_bfd_discard_group \ ((bfd_boolean (*) (bfd *, struct bfd_section *)) \ - bfd_false) + bfd_false_any) #define _bfd_nolink_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr) + ((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr_any) #define _bfd_nolink_bfd_link_add_symbols \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false_any) #define _bfd_nolink_bfd_link_just_syms \ - ((void (*) (asection *, struct bfd_link_info *)) bfd_void) + ((void (*) (asection *, struct bfd_link_info *)) bfd_void_any) #define _bfd_nolink_bfd_copy_link_hash_symbol_type \ ((void (*) (bfd *, struct bfd_link_hash_entry *, \ - struct bfd_link_hash_entry *)) bfd_void) + struct bfd_link_hash_entry *)) bfd_void_any) #define _bfd_nolink_bfd_final_link \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false_any) #define _bfd_nolink_bfd_link_split_section \ - ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false_any) #define _bfd_nolink_section_already_linked \ ((bfd_boolean (*) (bfd *, asection *, \ - struct bfd_link_info *)) bfd_false) + struct bfd_link_info *)) bfd_false_any) #define _bfd_nolink_bfd_define_common_symbol \ ((bfd_boolean (*) (bfd *, struct bfd_link_info *, \ - struct bfd_link_hash_entry *)) bfd_false) + struct bfd_link_hash_entry *)) bfd_false_any) #define _bfd_nolink_bfd_define_start_stop \ ((struct bfd_link_hash_entry * (*) (struct bfd_link_info *, \ - const char *, asection *)) bfd_nullvoidptr) + const char *, asection *)) bfd_nullvoidptr_any) #define _bfd_nolink_bfd_link_check_relocs \ _bfd_generic_link_check_relocs @@ -527,12 +541,12 @@ extern bfd_boolean _bfd_generic_set_section_contents #define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1 #define _bfd_nodynamic_canonicalize_dynamic_symtab \ - ((long (*) (bfd *, asymbol **)) _bfd_n1) + ((long (*) (bfd *, asymbol **)) _bfd_n1_any) #define _bfd_nodynamic_get_synthetic_symtab \ - ((long (*) (bfd *, long, asymbol **, long, asymbol **, asymbol **)) _bfd_n1) + ((long (*) (bfd *, long, asymbol **, long, asymbol **, asymbol **)) _bfd_n1_any) #define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1 #define _bfd_nodynamic_canonicalize_dynamic_reloc \ - ((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1) + ((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1_any) /* Generic routine to determine of the given symbol is a local label. */ @@ -557,8 +571,8 @@ extern bfd_boolean _bfd_dwarf1_find_nearest_line struct dwarf_debug_section { - const char *uncompressed_name; - const char *compressed_name; + const char * uncompressed_name; + const char * compressed_name; }; /* Map of uncompressed DWARF debug section name to compressed one. It diff --git a/bfd/libbfd.c b/bfd/libbfd.c index 6f29fe7..a94de20 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -50,6 +50,15 @@ bfd_false (bfd *ignore ATTRIBUTE_UNUSED) return FALSE; } +/* Like bfd_false, but accepts an arbitrary number of arguments. */ + +bfd_boolean +bfd_false_any (bfd *ignore ATTRIBUTE_UNUSED, ...) +{ + bfd_set_error (bfd_error_invalid_operation); + return FALSE; +} + /* A routine which is used in target vectors for supported operations which do not actually do anything. */ @@ -59,6 +68,14 @@ bfd_true (bfd *ignore ATTRIBUTE_UNUSED) return TRUE; } +/* Like bfd_true, but accepts an arbitrary number of arguments. */ + +bfd_boolean +bfd_true_any (bfd *ignore ATTRIBUTE_UNUSED, ...) +{ + return TRUE; +} + /* A routine which is used in target vectors for unsupported operations which return a pointer value. */ @@ -69,24 +86,57 @@ bfd_nullvoidptr (bfd *ignore ATTRIBUTE_UNUSED) return NULL; } +/* Like bfd_nullvoidptr, but accepts an arbitrary number of arguments. */ + +void * +bfd_nullvoidptr_any (bfd *ignore ATTRIBUTE_UNUSED, ...) +{ + bfd_set_error (bfd_error_invalid_operation); + return NULL; +} + int bfd_0 (bfd *ignore ATTRIBUTE_UNUSED) { return 0; } +/* Like bfd_0, but accepts an arbitrary number of arguments. */ + +int +bfd_0_any (bfd *ignore ATTRIBUTE_UNUSED, ...) +{ + return 0; +} + unsigned int bfd_0u (bfd *ignore ATTRIBUTE_UNUSED) { return 0; } +/* Like bfd_0u, but accepts an arbitrary number of arguments. */ + +unsigned int +bfd_0u_any (bfd *ignore ATTRIBUTE_UNUSED, ...) +{ + return 0; +} + long bfd_0l (bfd *ignore ATTRIBUTE_UNUSED) { return 0; } +/* Like bfd_0l, but accepts an arbitrary number of arguments. */ + +long +bfd_0l_any (bfd *ignore ATTRIBUTE_UNUSED, ...) +{ + return 0; +} + /* A routine which is used in target vectors for unsupported operations which return -1 on error. */ @@ -97,11 +147,27 @@ _bfd_n1 (bfd *ignore_abfd ATTRIBUTE_UNUSED) return -1; } +/* Like bfd_n1, but accepts an arbitrary number of arguments. */ + +long +_bfd_n1_any (bfd *ignore_abfd ATTRIBUTE_UNUSED, ...) +{ + bfd_set_error (bfd_error_invalid_operation); + return -1; +} + void bfd_void (bfd *ignore ATTRIBUTE_UNUSED) { } +/* Like bfd_void, but accepts an arbitrary number of arguments. */ + +void +bfd_void_any (bfd *ignore ATTRIBUTE_UNUSED, ...) +{ +} + long _bfd_norelocs_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED, asection *sec ATTRIBUTE_UNUSED) diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 8746d9c..935b5b4 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -126,21 +126,21 @@ extern void bfd_release (bfd *, void *); bfd * _bfd_create_empty_archive_element_shell - (bfd *obfd); + (bfd *); bfd * _bfd_look_for_bfd_in_cache (bfd *, file_ptr); bfd_boolean _bfd_add_bfd_to_archive_cache (bfd *, file_ptr, bfd *); bfd_boolean _bfd_generic_mkarchive - (bfd *abfd); + (bfd *); char *_bfd_append_relative_path - (bfd *arch, char *elt_name); + (bfd *, char *); const bfd_target *bfd_generic_archive_p - (bfd *abfd); + (bfd *); bfd_boolean bfd_slurp_armap - (bfd *abfd); + (bfd *); bfd_boolean bfd_slurp_bsd_armap_f2 - (bfd *abfd); + (bfd *); #define bfd_slurp_bsd_armap bfd_slurp_armap #define bfd_slurp_coff_armap bfd_slurp_armap bfd_boolean _bfd_archive_64_bit_slurp_armap @@ -167,15 +167,15 @@ bfd_boolean _bfd_archive_64_bit_write_armap bfd_true bfd_boolean _bfd_slurp_extended_name_table - (bfd *abfd); + (bfd *); extern bfd_boolean _bfd_construct_extended_name_table (bfd *, bfd_boolean, char **, bfd_size_type *); bfd_boolean _bfd_write_archive_contents - (bfd *abfd); + (bfd *); bfd_boolean _bfd_compute_and_write_armap - (bfd *, unsigned int elength); + (bfd *, unsigned int); bfd *_bfd_get_elt_at_filepos - (bfd *archive, file_ptr filepos); + (bfd *, file_ptr); extern bfd *_bfd_generic_get_elt_at_index (bfd *, symindex); bfd * _bfd_new_bfd @@ -183,42 +183,56 @@ bfd * _bfd_new_bfd bfd_boolean _bfd_free_cached_info (bfd *); -bfd_boolean bfd_false - (bfd *ignore); -bfd_boolean bfd_true - (bfd *ignore); -void *bfd_nullvoidptr - (bfd *ignore); -int bfd_0 - (bfd *ignore); -unsigned int bfd_0u - (bfd *ignore); -long bfd_0l - (bfd *ignore); -long _bfd_n1 - (bfd *ignore); -void bfd_void - (bfd *ignore); +extern bfd_boolean bfd_false + (bfd *); +extern bfd_boolean bfd_false_any + (bfd *, ...); +extern bfd_boolean bfd_true + (bfd *); +extern bfd_boolean bfd_true_any + (bfd *, ...); +extern void * bfd_nullvoidptr + (bfd *); +extern void * bfd_nullvoidptr_any + (bfd *, ...); +extern int bfd_0 + (bfd *); +extern int bfd_0_any + (bfd *, ...); +extern unsigned int bfd_0u + (bfd *); +extern unsigned int bfd_0u_any + (bfd *, ...); +extern long bfd_0l + (bfd *); +extern long bfd_0l_any + (bfd *, ...); +extern long _bfd_n1 + (bfd *); +extern long _bfd_n1_any + (bfd *, ...); +extern void bfd_void + (bfd *); +extern void bfd_void_any + (bfd *, ...); bfd *_bfd_new_bfd_contained_in (bfd *); const bfd_target *_bfd_dummy_target - (bfd *abfd); + (bfd *); void bfd_dont_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); void bfd_bsd_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); void bfd_gnu_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); bfd_boolean _bfd_bsd_write_armap - (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, - int stridx); + (bfd *, unsigned int, struct orl *, unsigned int, int); bfd_boolean _bfd_coff_write_armap - (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, - int stridx); + (bfd *, unsigned int, struct orl *, unsigned int, int); extern void *_bfd_generic_read_ar_hdr (bfd *); @@ -237,7 +251,7 @@ extern bfd_boolean _bfd_bsd44_write_ar_hdr (bfd *, bfd *); bfd * bfd_generic_openr_next_archived_file - (bfd *archive, bfd *last_file); + (bfd *, bfd *); int bfd_generic_stat_arch_elt (bfd *, struct stat *); @@ -265,19 +279,19 @@ extern bfd_boolean _bfd_generic_get_section_contents_in_window BFD_JUMP_TABLE_COPY (_bfd_generic). */ #define _bfd_generic_bfd_copy_private_bfd_data \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true_any) #define _bfd_generic_bfd_merge_private_bfd_data \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true_any) #define _bfd_generic_bfd_set_private_flags \ - ((bfd_boolean (*) (bfd *, flagword)) bfd_true) + ((bfd_boolean (*) (bfd *, flagword)) bfd_true_any) #define _bfd_generic_bfd_copy_private_section_data \ - ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true_any) #define _bfd_generic_bfd_copy_private_symbol_data \ - ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true) + ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true_any) #define _bfd_generic_bfd_copy_private_header_data \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true_any) #define _bfd_generic_bfd_print_private_bfd_data \ - ((bfd_boolean (*) (bfd *, void *)) bfd_true) + ((bfd_boolean (*) (bfd *, void *)) bfd_true_any) extern bfd_boolean _bfd_generic_init_private_section_data (bfd *, asection *, bfd *, asection *, struct bfd_link_info *); @@ -301,19 +315,19 @@ extern int _bfd_nocore_core_file_pid #define _bfd_noarchive_slurp_extended_name_table bfd_false #define _bfd_noarchive_construct_extended_name_table \ ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) \ - bfd_false) + bfd_false_any) #define _bfd_noarchive_truncate_arname \ - ((void (*) (bfd *, const char *, char *)) bfd_void) + ((void (*) (bfd *, const char *, char *)) bfd_void_any) #define _bfd_noarchive_write_armap \ ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) \ - bfd_false) + bfd_false_any) #define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr #define _bfd_noarchive_write_ar_hdr \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_false) + ((bfd_boolean (*) (bfd *, bfd *)) bfd_false_any) #define _bfd_noarchive_openr_next_archived_file \ - ((bfd *(*) (bfd *, bfd *)) bfd_nullvoidptr) + ((bfd *(*) (bfd *, bfd *)) bfd_nullvoidptr_any) #define _bfd_noarchive_get_elt_at_index \ - ((bfd *(*) (bfd *, symindex)) bfd_nullvoidptr) + ((bfd *(*) (bfd *, symindex)) bfd_nullvoidptr_any) #define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt #define _bfd_noarchive_update_armap_timestamp bfd_false @@ -380,7 +394,7 @@ extern bfd_boolean _bfd_archive_bsd44_construct_extended_name_table archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_vms_lib). Some of them are irrelevant. */ -extern bfd_boolean _bfd_vms_lib_write_archive_contents (bfd *arch); +extern bfd_boolean _bfd_vms_lib_write_archive_contents (bfd *); #define _bfd_vms_lib_slurp_armap _bfd_noarchive_slurp_armap #define _bfd_vms_lib_slurp_extended_name_table \ _bfd_noarchive_slurp_extended_name_table @@ -399,49 +413,49 @@ extern int _bfd_vms_lib_generic_stat_arch_elt (bfd *, struct stat *); extern symindex _bfd_vms_lib_find_symbol (bfd *, const char *); extern bfd *_bfd_vms_lib_get_imagelib_file (bfd *); -extern const bfd_target *_bfd_vms_lib_alpha_archive_p (bfd *abfd); -extern const bfd_target *_bfd_vms_lib_ia64_archive_p (bfd *abfd); -extern bfd_boolean _bfd_vms_lib_alpha_mkarchive (bfd *abfd); -extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *abfd); +extern const bfd_target *_bfd_vms_lib_alpha_archive_p (bfd *); +extern const bfd_target *_bfd_vms_lib_ia64_archive_p (bfd *); +extern bfd_boolean _bfd_vms_lib_alpha_mkarchive (bfd *); +extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *); /* Routines to use for BFD_JUMP_TABLE_SYMBOLS where there is no symbol support. Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols). */ #define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1 #define _bfd_nosymbols_canonicalize_symtab \ - ((long (*) (bfd *, asymbol **)) _bfd_n1) + ((long (*) (bfd *, asymbol **)) _bfd_n1_any) #define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol #define _bfd_nosymbols_print_symbol \ - ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void) + ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void_any) #define _bfd_nosymbols_get_symbol_info \ - ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void) + ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void_any) #define _bfd_nosymbols_get_symbol_version_string \ - ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) bfd_nullvoidptr) + ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) bfd_nullvoidptr_any) #define _bfd_nosymbols_bfd_is_local_label_name \ - ((bfd_boolean (*) (bfd *, const char *)) bfd_false) + ((bfd_boolean (*) (bfd *, const char *)) bfd_false_any) #define _bfd_nosymbols_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define _bfd_nosymbols_get_lineno \ - ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr) + ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr_any) #define _bfd_nosymbols_find_nearest_line \ ((bfd_boolean (*) (bfd *, asymbol **, asection *, bfd_vma, \ const char **, const char **, unsigned int *, \ unsigned int *)) \ - bfd_false) + bfd_false_any) #define _bfd_nosymbols_find_line \ ((bfd_boolean (*) (bfd *, asymbol **, asymbol *, \ const char **, unsigned int *)) \ - bfd_false) + bfd_false_any) #define _bfd_nosymbols_find_inliner_info \ ((bfd_boolean (*) (bfd *, const char **, const char **, unsigned int *)) \ - bfd_false) + bfd_false_any) #define _bfd_nosymbols_bfd_make_debug_symbol \ - ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) + ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr_any) #define _bfd_nosymbols_read_minisymbols \ - ((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) _bfd_n1) + ((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) _bfd_n1_any) #define _bfd_nosymbols_minisymbol_to_symbol \ ((asymbol *(*) (bfd *, bfd_boolean, const void *, asymbol *)) \ - bfd_nullvoidptr) + bfd_nullvoidptr_any) /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ @@ -452,19 +466,19 @@ extern long _bfd_norelocs_canonicalize_reloc (bfd *, asection *, extern void _bfd_norelocs_set_reloc (bfd *, asection *, arelent **, unsigned int); #define _bfd_norelocs_bfd_reloc_type_lookup \ - ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) + ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr_any) #define _bfd_norelocs_bfd_reloc_name_lookup \ - ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr) + ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr_any) /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */ #define _bfd_nowrite_set_arch_mach \ ((bfd_boolean (*) (bfd *, enum bfd_architecture, unsigned long)) \ - bfd_false) + bfd_false_any) #define _bfd_nowrite_set_section_contents \ ((bfd_boolean (*) (bfd *, asection *, const void *, file_ptr, bfd_size_type)) \ - bfd_false) + bfd_false_any) /* Generic routines to use for BFD_JUMP_TABLE_WRITE. Use BFD_JUMP_TABLE_WRITE (_bfd_generic). */ @@ -477,52 +491,52 @@ extern bfd_boolean _bfd_generic_set_section_contents support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ #define _bfd_nolink_sizeof_headers \ - ((int (*) (bfd *, struct bfd_link_info *)) bfd_0) + ((int (*) (bfd *, struct bfd_link_info *)) bfd_0_any) #define _bfd_nolink_bfd_get_relocated_section_contents \ ((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \ bfd_byte *, bfd_boolean, asymbol **)) \ - bfd_nullvoidptr) + bfd_nullvoidptr_any) #define _bfd_nolink_bfd_relax_section \ ((bfd_boolean (*) \ (bfd *, asection *, struct bfd_link_info *, bfd_boolean *)) \ - bfd_false) + bfd_false_any) #define _bfd_nolink_bfd_gc_sections \ ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ - bfd_false) + bfd_false_any) #define _bfd_nolink_bfd_lookup_section_flags \ ((bfd_boolean (*) (struct bfd_link_info *, struct flag_info *, asection *)) \ - bfd_0) + bfd_0_any) #define _bfd_nolink_bfd_merge_sections \ ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ - bfd_false) + bfd_false_any) #define _bfd_nolink_bfd_is_group_section \ ((bfd_boolean (*) (bfd *, const struct bfd_section *)) \ - bfd_false) + bfd_false_any) #define _bfd_nolink_bfd_discard_group \ ((bfd_boolean (*) (bfd *, struct bfd_section *)) \ - bfd_false) + bfd_false_any) #define _bfd_nolink_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr) + ((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr_any) #define _bfd_nolink_bfd_link_add_symbols \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false_any) #define _bfd_nolink_bfd_link_just_syms \ - ((void (*) (asection *, struct bfd_link_info *)) bfd_void) + ((void (*) (asection *, struct bfd_link_info *)) bfd_void_any) #define _bfd_nolink_bfd_copy_link_hash_symbol_type \ ((void (*) (bfd *, struct bfd_link_hash_entry *, \ - struct bfd_link_hash_entry *)) bfd_void) + struct bfd_link_hash_entry *)) bfd_void_any) #define _bfd_nolink_bfd_final_link \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false_any) #define _bfd_nolink_bfd_link_split_section \ - ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false_any) #define _bfd_nolink_section_already_linked \ ((bfd_boolean (*) (bfd *, asection *, \ - struct bfd_link_info *)) bfd_false) + struct bfd_link_info *)) bfd_false_any) #define _bfd_nolink_bfd_define_common_symbol \ ((bfd_boolean (*) (bfd *, struct bfd_link_info *, \ - struct bfd_link_hash_entry *)) bfd_false) + struct bfd_link_hash_entry *)) bfd_false_any) #define _bfd_nolink_bfd_define_start_stop \ ((struct bfd_link_hash_entry * (*) (struct bfd_link_info *, \ - const char *, asection *)) bfd_nullvoidptr) + const char *, asection *)) bfd_nullvoidptr_any) #define _bfd_nolink_bfd_link_check_relocs \ _bfd_generic_link_check_relocs @@ -532,12 +546,12 @@ extern bfd_boolean _bfd_generic_set_section_contents #define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1 #define _bfd_nodynamic_canonicalize_dynamic_symtab \ - ((long (*) (bfd *, asymbol **)) _bfd_n1) + ((long (*) (bfd *, asymbol **)) _bfd_n1_any) #define _bfd_nodynamic_get_synthetic_symtab \ - ((long (*) (bfd *, long, asymbol **, long, asymbol **, asymbol **)) _bfd_n1) + ((long (*) (bfd *, long, asymbol **, long, asymbol **, asymbol **)) _bfd_n1_any) #define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1 #define _bfd_nodynamic_canonicalize_dynamic_reloc \ - ((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1) + ((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1_any) /* Generic routine to determine of the given symbol is a local label. */ @@ -562,8 +576,8 @@ extern bfd_boolean _bfd_dwarf1_find_nearest_line struct dwarf_debug_section { - const char *uncompressed_name; - const char *compressed_name; + const char * uncompressed_name; + const char * compressed_name; }; /* Map of uncompressed DWARF debug section name to compressed one. It diff --git a/bfd/libecoff.h b/bfd/libecoff.h index 43f872f..ea97840 100644 --- a/bfd/libecoff.h +++ b/bfd/libecoff.h @@ -277,7 +277,7 @@ extern bfd_boolean _bfd_ecoff_write_armap #define _bfd_ecoff_generic_stat_arch_elt bfd_generic_stat_arch_elt #define _bfd_ecoff_update_armap_timestamp bfd_true #define _bfd_ecoff_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) extern long _bfd_ecoff_get_symtab_upper_bound (bfd *); extern long _bfd_ecoff_canonicalize_symtab (bfd *, asymbol **); @@ -302,7 +302,7 @@ extern bfd_boolean _bfd_ecoff_find_nearest_line #define _bfd_ecoff_get_reloc_upper_bound coff_get_reloc_upper_bound extern long _bfd_ecoff_canonicalize_reloc - (bfd *, asection *, arelent **, asymbol **symbols); + (bfd *, asection *, arelent **, asymbol **); /* ecoff_bfd_reloc_type_lookup defined by backend. */ extern bfd_boolean _bfd_ecoff_set_arch_mach @@ -327,7 +327,7 @@ extern bfd_boolean _bfd_ecoff_bfd_final_link extern void * _bfd_ecoff_mkobject_hook (bfd *, void *, void *); #define _bfd_ecoff_set_alignment_hook \ - ((void (*) (bfd *, asection *, void *)) bfd_void) + ((void (*) (bfd *, asection *, void *)) bfd_void_any) extern bfd_boolean _bfd_ecoff_set_arch_mach_hook (bfd *, void *); extern bfd_boolean _bfd_ecoff_no_long_sections diff --git a/bfd/mach-o-target.c b/bfd/mach-o-target.c index 96a90a6..6d26dbb 100644 --- a/bfd/mach-o-target.c +++ b/bfd/mach-o-target.c @@ -27,7 +27,7 @@ #define bfd_mach_o_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define bfd_mach_o_get_section_contents_in_window _bfd_generic_get_section_contents_in_window #define bfd_mach_o_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data -#define bfd_mach_o_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define bfd_mach_o_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #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 @@ -3276,7 +3276,7 @@ mmo_write_object_contents (bfd *abfd) leading ':' might more appropriately be called local. */ #define mmo_bfd_is_local_label_name bfd_generic_is_local_label_name #define mmo_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define mmo_get_symbol_version_string \ _bfd_nosymbols_get_symbol_version_string diff --git a/bfd/nlm-target.h b/bfd/nlm-target.h index b26f924..d2f94d2 100644 --- a/bfd/nlm-target.h +++ b/bfd/nlm-target.h @@ -27,7 +27,7 @@ #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_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define nlm_get_lineno _bfd_nosymbols_get_lineno #define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line #define nlm_find_line _bfd_nosymbols_find_line diff --git a/bfd/oasys.c b/bfd/oasys.c index d8e38a8..3d4d6a5 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -1159,22 +1159,26 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define oasys_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define oasys_slurp_armap bfd_true #define oasys_slurp_extended_name_table bfd_true -#define oasys_construct_extended_name_table ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_true) +#define oasys_construct_extended_name_table \ + ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_true_any) #define oasys_truncate_arname bfd_dont_truncate_arname -#define oasys_write_armap ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) bfd_true) +#define oasys_write_armap \ + ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) bfd_true_any) #define oasys_read_ar_hdr bfd_nullvoidptr -#define oasys_write_ar_hdr ((bfd_boolean (*) (bfd *, bfd *)) bfd_false) +#define oasys_write_ar_hdr \ + ((bfd_boolean (*) (bfd *, bfd *)) bfd_false_any) #define oasys_get_elt_at_index _bfd_generic_get_elt_at_index #define oasys_update_armap_timestamp bfd_true #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_bfd_is_target_special_symbol \ + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #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 #define oasys_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup -#define oasys_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup +#define oasys_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define oasys_set_arch_mach bfd_default_set_arch_mach #define oasys_get_section_contents_in_window _bfd_generic_get_section_contents_in_window #define oasys_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents @@ -1190,7 +1194,7 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define oasys_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define oasys_bfd_link_add_symbols _bfd_generic_link_add_symbols #define oasys_bfd_link_just_syms _bfd_generic_link_just_syms -#define oasys_bfd_copy_link_hash_symbol_type \ +#define oasys_bfd_copy_link_hash_symbol_type \ _bfd_generic_copy_link_hash_symbol_type #define oasys_bfd_final_link _bfd_generic_final_link #define oasys_bfd_link_split_section _bfd_generic_link_split_section @@ -38,7 +38,8 @@ #define bfd_pef_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define bfd_pef_new_section_hook _bfd_generic_new_section_hook #define bfd_pef_bfd_is_local_label_name bfd_generic_is_local_label_name -#define bfd_pef_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define bfd_pef_bfd_is_target_special_symbol \ + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define bfd_pef_get_lineno _bfd_nosymbols_get_lineno #define bfd_pef_find_nearest_line _bfd_nosymbols_find_nearest_line #define bfd_pef_find_line _bfd_nosymbols_find_line diff --git a/bfd/plugin.c b/bfd/plugin.c index b088191..f63c592 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -80,7 +80,7 @@ dlerror (void) #define bfd_plugin_bfd_set_private_flags _bfd_generic_bfd_set_private_flags #define bfd_plugin_core_file_matches_executable_p generic_core_file_matches_executable_p #define bfd_plugin_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name -#define bfd_plugin_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define bfd_plugin_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define bfd_plugin_get_lineno _bfd_nosymbols_get_lineno #define bfd_plugin_find_nearest_line _bfd_nosymbols_find_nearest_line #define bfd_plugin_find_line _bfd_nosymbols_find_line diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c index dd0b96f..e9e40fd 100644 --- a/bfd/ppcboot.c +++ b/bfd/ppcboot.c @@ -329,7 +329,7 @@ ppcboot_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED, #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) + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define ppcboot_bfd_is_local_label_name bfd_generic_is_local_label_name #define ppcboot_get_lineno _bfd_nosymbols_get_lineno #define ppcboot_find_nearest_line _bfd_nosymbols_find_nearest_line @@ -6738,7 +6738,8 @@ som_bfd_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) #define som_slurp_extended_name_table _bfd_slurp_extended_name_table #define som_construct_extended_name_table _bfd_archive_coff_construct_extended_name_table #define som_update_armap_timestamp bfd_true -#define som_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define som_bfd_is_target_special_symbol \ + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define som_get_lineno _bfd_nosymbols_get_lineno #define som_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define som_read_minisymbols _bfd_generic_read_minisymbols @@ -1257,7 +1257,7 @@ srec_print_symbol (bfd *abfd, #define srec_close_and_cleanup _bfd_generic_close_and_cleanup #define srec_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define srec_new_section_hook _bfd_generic_new_section_hook -#define srec_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define srec_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define srec_bfd_is_local_label_name bfd_generic_is_local_label_name #define srec_get_lineno _bfd_nosymbols_get_lineno #define srec_find_nearest_line _bfd_nosymbols_find_nearest_line diff --git a/bfd/tekhex.c b/bfd/tekhex.c index 601975a..7ad8a1b 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -962,7 +962,7 @@ tekhex_print_symbol (bfd *abfd, #define tekhex_close_and_cleanup _bfd_generic_close_and_cleanup #define tekhex_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define tekhex_new_section_hook _bfd_generic_new_section_hook -#define tekhex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define tekhex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define tekhex_bfd_is_local_label_name bfd_generic_is_local_label_name #define tekhex_get_lineno _bfd_nosymbols_get_lineno #define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line diff --git a/bfd/verilog.c b/bfd/verilog.c index 6d1e7d4..82bccc8 100644 --- a/bfd/verilog.c +++ b/bfd/verilog.c @@ -293,7 +293,7 @@ verilog_mkobject (bfd *abfd) #define verilog_close_and_cleanup _bfd_generic_close_and_cleanup #define verilog_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define verilog_new_section_hook _bfd_generic_new_section_hook -#define verilog_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define verilog_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define verilog_bfd_is_local_label_name bfd_generic_is_local_label_name #define verilog_get_lineno _bfd_nosymbols_get_lineno #define verilog_find_nearest_line _bfd_nosymbols_find_nearest_line diff --git a/bfd/versados.c b/bfd/versados.c index 369ec2f..274a212 100644 --- a/bfd/versados.c +++ b/bfd/versados.c @@ -848,7 +848,8 @@ versados_canonicalize_reloc (bfd *abfd, #define versados_close_and_cleanup _bfd_generic_close_and_cleanup #define versados_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define versados_new_section_hook _bfd_generic_new_section_hook -#define versados_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define versados_bfd_is_target_special_symbol \ + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define versados_bfd_is_local_label_name bfd_generic_is_local_label_name #define versados_get_lineno _bfd_nosymbols_get_lineno #define versados_find_nearest_line _bfd_nosymbols_find_nearest_line @@ -860,7 +861,7 @@ versados_canonicalize_reloc (bfd *abfd, #define versados_read_minisymbols _bfd_generic_read_minisymbols #define versados_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol #define versados_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup -#define versados_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup +#define versados_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define versados_set_arch_mach bfd_default_set_arch_mach #define versados_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents #define versados_bfd_relax_section bfd_generic_relax_section diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index d93ac10..6d5faef 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -9489,7 +9489,8 @@ bfd_vms_get_data (bfd *abfd) return (struct vms_private_data_struct *)abfd->tdata.any; } -#define vms_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define vms_bfd_is_target_special_symbol \ + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define vms_bfd_link_just_syms _bfd_generic_link_just_syms #define vms_bfd_copy_link_hash_symbol_type \ _bfd_generic_copy_link_hash_symbol_type @@ -9497,7 +9498,7 @@ bfd_vms_get_data (bfd *abfd) #define vms_bfd_discard_group bfd_generic_discard_group #define vms_section_already_linked _bfd_generic_section_already_linked #define vms_bfd_define_common_symbol bfd_generic_define_common_symbol -#define vms_bfd_define_start_stop bfd_generic_define_start_stop +#define vms_bfd_define_start_stop bfd_generic_define_start_stop #define vms_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data #define vms_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data @@ -9510,7 +9511,7 @@ bfd_vms_get_data (bfd *abfd) /* Symbols table. */ #define alpha_vms_make_empty_symbol _bfd_generic_make_empty_symbol #define alpha_vms_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #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 \ diff --git a/bfd/wasm-module.c b/bfd/wasm-module.c index 2d5822d..c32a0b6 100644 --- a/bfd/wasm-module.c +++ b/bfd/wasm-module.c @@ -773,7 +773,7 @@ wasm_object_p (bfd *abfd) /* BFD_JUMP_TABLE_SYMBOLS */ #define wasm_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define wasm_bfd_is_local_label_name bfd_generic_is_local_label_name -#define wasm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define wasm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define wasm_get_lineno _bfd_nosymbols_get_lineno #define wasm_find_nearest_line _bfd_nosymbols_find_nearest_line #define wasm_find_line _bfd_nosymbols_find_line @@ -30,7 +30,7 @@ #define bfd_sym_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define bfd_sym_new_section_hook _bfd_generic_new_section_hook #define bfd_sym_bfd_is_local_label_name bfd_generic_is_local_label_name -#define bfd_sym_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define bfd_sym_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false_any) #define bfd_sym_get_lineno _bfd_nosymbols_get_lineno #define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line #define bfd_sym_find_line _bfd_nosymbols_find_line diff --git a/gas/ChangeLog b/gas/ChangeLog index fc4cd6f..97b3581 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -2,6 +2,34 @@ * testsuite/gas/mips/loongson-3a-2.d: Rename test. +2018-02-13 Nick Clifton <nickc@redhat.com> + + PR 22823 + * config/obj-elf.c (elf_pseudo_table): Remove now redundant + casts. + (obj_elf_vtable_inherit): Rename to obj_elf_get_vtable_inherit. + (obj_elf_vtable_inherit): New stub function that calls + obj_elf_get_vtable_inherit. + (obj_elf_vtable_entry): Rename to obj_elf_get_vtable_entry. + (obj_elf_vtable_entry): New stub function that calls + obj_elf_get_vtable_entry. + * config/obj-elf.h (obj_elf_vtable_inherit): Update prototype. + (obj_elf_vtable_entry) Likewise. + (obj_elf_get_vtable_inherit) Likewise. + (obj_elf_get_vtable_entry) Likewise. + * config/tc-arm.c (md_pseudo_table): Remove now redundant cast. + * config/tc-i386c (md_pseudo_table): Likewise. + * config/tc-hppa.c (pa_vtable_entry): Call + obj_elf_get_vtable_entry. + (pa_vtable_inherit): Call obj_elf_get_vtable_inherit. + * config/tc-mips.c (s_mips_file): Replace call to dwarf2_get_file + with call to dwarf2_get_filename. + * dwarf2dbg.c (dwarf2_directive_file): Rename to + dwarf2_directive_filename. + (dwarf2_directive_file): New stub function that calls + dwarf2_directive_filename. + * dwarf2dbg.h: Prototype dwarf2_directive_filename. + 2018-02-12 Maciej W. Rozycki <macro@mips.com> * testsuite/gas/mips/reginfo-2-n32.d: Add `--no-pad-sections' to diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index ae9b2e1..cac3c39a 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -117,8 +117,8 @@ static const pseudo_typeS elf_pseudo_table[] = {"subsection", obj_elf_subsection, 0}, /* These are GNU extensions to aid in garbage collecting C++ vtables. */ - {"vtable_inherit", (void (*) (int)) &obj_elf_vtable_inherit, 0}, - {"vtable_entry", (void (*) (int)) &obj_elf_vtable_entry, 0}, + {"vtable_inherit", obj_elf_vtable_inherit, 0}, + {"vtable_entry", obj_elf_vtable_entry, 0}, /* A GNU extension for object attributes. */ {"gnu_attribute", obj_elf_gnu_attribute, 0}, @@ -128,7 +128,7 @@ static const pseudo_typeS elf_pseudo_table[] = {"4byte", cons, 4}, {"8byte", cons, 8}, /* These are used for dwarf2. */ - { "file", (void (*) (int)) dwarf2_directive_file, 0 }, + { "file", dwarf2_directive_file, 0 }, { "loc", dwarf2_directive_loc, 0 }, { "loc_mark_labels", dwarf2_directive_loc_mark_labels, 0 }, @@ -1460,7 +1460,7 @@ obj_elf_symver (int ignore ATTRIBUTE_UNUSED) syntax is ".vtable_inherit CHILDNAME, PARENTNAME". */ struct fix * -obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED) +obj_elf_get_vtable_inherit (void) { char *cname, *pname; symbolS *csym, *psym; @@ -1524,12 +1524,21 @@ obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED) 0, psym, 0, 0, BFD_RELOC_VTABLE_INHERIT); } +/* This is a version of obj_elf_get_vtable_inherit() that is + suitable for use in struct _pseudo_type tables. */ + +void +obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED) +{ + (void) obj_elf_get_vtable_inherit (); +} + /* This handles the .vtable_entry pseudo-op, which is used to indicate to the linker that a vtable slot was used. The syntax is ".vtable_entry tablename, offset". */ struct fix * -obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED) +obj_elf_get_vtable_entry (void) { symbolS *sym; offsetT offset; @@ -1557,6 +1566,15 @@ obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED) BFD_RELOC_VTABLE_ENTRY); } +/* This is a version of obj_elf_get_vtable_entry() that is + suitable for use in struct _pseudo_type tables. */ + +void +obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED) +{ + (void) obj_elf_get_vtable_entry (); +} + #define skip_whitespace(str) do { if (*(str) == ' ') ++(str); } while (0) static inline int diff --git a/gas/config/obj-elf.h b/gas/config/obj-elf.h index 33e0954..96f7cbc 100644 --- a/gas/config/obj-elf.h +++ b/gas/config/obj-elf.h @@ -164,8 +164,10 @@ extern void obj_elf_text (int); extern void obj_elf_change_section (const char *, unsigned int, unsigned int, bfd_vma, int, const char *, int, int); -extern struct fix *obj_elf_vtable_inherit (int); -extern struct fix *obj_elf_vtable_entry (int); +extern void obj_elf_vtable_inherit (int); +extern void obj_elf_vtable_entry (int); +extern struct fix * obj_elf_get_vtable_inherit (void); +extern struct fix * obj_elf_get_vtable_entry (void); extern bfd_boolean obj_elf_seen_attribute (int, unsigned int); extern int obj_elf_vendor_attribute (int); diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index ec50420..9786f14 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -4758,7 +4758,7 @@ const pseudo_typeS md_pseudo_table[] = {"4byte", cons, 4}, {"8byte", cons, 8}, /* These are used for dwarf2. */ - { "file", (void (*) (int)) dwarf2_directive_file, 0 }, + { "file", dwarf2_directive_file, 0 }, { "loc", dwarf2_directive_loc, 0 }, { "loc_mark_labels", dwarf2_directive_loc_mark_labels, 0 }, #endif diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index f18aab6..e69fdb2 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -8528,7 +8528,7 @@ pa_vtable_entry (int ignore ATTRIBUTE_UNUSED) { struct fix *new_fix; - new_fix = obj_elf_vtable_entry (0); + new_fix = obj_elf_get_vtable_entry (); if (new_fix) { @@ -8549,7 +8549,7 @@ pa_vtable_inherit (int ignore ATTRIBUTE_UNUSED) { struct fix *new_fix; - new_fix = obj_elf_vtable_inherit (0); + new_fix = obj_elf_get_vtable_inherit (); if (new_fix) { diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 32a8b31..552c1b8 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1127,7 +1127,7 @@ const pseudo_typeS md_pseudo_table[] = #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) {"largecomm", handle_large_common, 0}, #else - {"file", (void (*) (int)) dwarf2_directive_file, 0}, + {"file", dwarf2_directive_file, 0}, {"loc", dwarf2_directive_loc, 0}, {"loc_mark_labels", dwarf2_directive_loc_mark_labels, 0}, #endif diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index c135131..fca0dea 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -19324,7 +19324,7 @@ s_mips_file (int x ATTRIBUTE_UNUSED) { char *filename; - filename = dwarf2_directive_file (0); + filename = dwarf2_directive_filename (); /* Versions of GCC up to 3.1 start files with a ".file" directive even for stabs output. Make sure that this diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 3fb5dc1..e7c0b6e 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -751,10 +751,10 @@ get_filenum (const char *filename, unsigned int num) - Pass .file "source.c" to s_app_file - Handle .file 1 "source.c" by adding an entry to the DWARF-2 file table - If an entry is added to the file table, return a pointer to the filename. */ + If an entry is added to the file table, return a pointer to the filename. */ char * -dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED) +dwarf2_directive_filename (void) { offsetT num; char *filename; @@ -795,6 +795,15 @@ dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED) return filename; } +/* Calls dwarf2_directive_filename, but discards its result. + Used in pseudo-op tables where the function result is ignored. */ + +void +dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED) +{ + (void) dwarf2_directive_filename (); +} + void dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED) { diff --git a/gas/dwarf2dbg.h b/gas/dwarf2dbg.h index 06e537b..3c272d6 100644 --- a/gas/dwarf2dbg.h +++ b/gas/dwarf2dbg.h @@ -41,8 +41,10 @@ struct dwarf2_line_info /* Implements the .file FILENO "FILENAME" directive. FILENO can be 0 to indicate that no file number has been assigned. All real file - number must be >0. */ -extern char *dwarf2_directive_file (int); + number must be >0. The second form returns the filename extracted + from the input stream. */ +extern void dwarf2_directive_file (int); +extern char * dwarf2_directive_filename (void); /* Implements the .loc FILENO LINENO [COLUMN] directive. FILENO is the file number, LINENO the line number and the (optional) COLUMN diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index bfae54b..f1e0863 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -3,6 +3,12 @@ * wasm32-dis.c (print_insn_wasm32): Rename `index' local variable to `function_index'. +2018-02-13 Nick Clifton <nickc@redhat.com> + + PR 22823 + * metag-dis.c (print_fmmov): Double buffer size to avoid warning + about truncation of printing. + 2018-02-12 Henry Wong <henry@stuffedcow.net> * mips-opc.c (mips_builtin_opcodes): Correct "sigrie" encoding. diff --git a/opcodes/metag-dis.c b/opcodes/metag-dis.c index 60135ed..5143735 100644 --- a/opcodes/metag-dis.c +++ b/opcodes/metag-dis.c @@ -1762,7 +1762,11 @@ print_fmmov (unsigned int insn_word, bfd_vma pc ATTRIBUTE_UNUSED, const insn_template *template, disassemble_info *outf) { - char buf[OPERAND_WIDTH]; + /* We used to have buf[OPERAND_WIDTH] here, but gcc v8 complains + about the snprintf()s below possibly truncating the output. + (There is no way to tell gcc that this truncation is intentional). + So now we use an extra wide buffer. */ + char buf[OPERAND_WIDTH * 2]; char data_buf[REG_WIDTH]; char fpu_buf[REG_WIDTH]; bfd_boolean to_fpu = MAJOR_OPCODE (insn_word) == OPC_GET; @@ -1783,9 +1787,9 @@ print_fmmov (unsigned int insn_word, bfd_vma pc ATTRIBUTE_UNUSED, convert_fx_rmask (rmask), is_mmovl); if (to_fpu) - snprintf (buf, OPERAND_WIDTH, "%s,%s", fpu_buf, data_buf); + snprintf (buf, sizeof buf, "%s,%s", fpu_buf, data_buf); else - snprintf (buf, OPERAND_WIDTH, "%s,%s", data_buf, fpu_buf); + snprintf (buf, sizeof buf, "%s,%s", data_buf, fpu_buf); print_insn (outf, "F", template->name, buf); } |