From: Ian Lance Taylor Date: Wed, 6 Apr 1994 22:00:40 +0000 (+0000) Subject: * targets.c (bfd_target): Rearranged fields in target vector. X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=6812b6077e4a09eab08458428f09c28ec58fc514;p=deliverable%2Fbinutils-gdb.git * targets.c (bfd_target): Rearranged fields in target vector. Removed _bfd_debug_info_start, _bfd_debug_info_end and _bfd_debug_info_accumulate, which were never used. (BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined. (BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined. (BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined. (BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined. * All backends: Changed to use the new BFD_JUMP_TABLE_* macros rather than the single JUMP_TABLE macro. Removed many of the weird macro definitions needed to support the monolithic JUMP_TABLE. * bfd-in.h (JUMP_TABLE): Removed. * libbfd-in.h: Define a bunch of macros, and declare a few functions, for use with the new BFD_JUMP_TABLE_* macros. * libbfd.c (_bfd_dummy_new_section_hook): Removed. (bfd_false): Set bfd_error_invalid_operation. (bfd_nullvoidptr): Likewise. (bfd_n1): New function. (_bfd_nocore_core_file_matches_executable_p): Renamed from _bfd_dummy_core_file_matches_executable_p. (_bfd_nocore_core_file_failing_command): Similar rename. Set bfd_error_invalid_operation. (_bfd_nocore_core_file_failing_signal): Likewise. (_bfd_generic_get_section_contents): Renamed from bfd_generic_get_section_contents. Changed all callers. (_bfd_generic_set_section_contents): Similar rename. * ieee.c: #if 0 out ieee_bfd_debug_info_start, ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They were never called. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 53ef902d08..df39493838 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,37 @@ +Wed Apr 6 17:24:14 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * targets.c (bfd_target): Rearranged fields in target vector. + Removed _bfd_debug_info_start, _bfd_debug_info_end and + _bfd_debug_info_accumulate, which were never used. + (BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined. + (BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined. + (BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined. + (BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined. + * All backends: Changed to use the new BFD_JUMP_TABLE_* macros + rather than the single JUMP_TABLE macro. Removed many of the + weird macro definitions needed to support the monolithic + JUMP_TABLE. + * bfd-in.h (JUMP_TABLE): Removed. + * libbfd-in.h: Define a bunch of macros, and declare a few + functions, for use with the new BFD_JUMP_TABLE_* macros. + * libbfd.c (_bfd_dummy_new_section_hook): Removed. + (bfd_false): Set bfd_error_invalid_operation. + (bfd_nullvoidptr): Likewise. + (bfd_n1): New function. + (_bfd_nocore_core_file_matches_executable_p): Renamed from + _bfd_dummy_core_file_matches_executable_p. + (_bfd_nocore_core_file_failing_command): Similar rename. Set + bfd_error_invalid_operation. + (_bfd_nocore_core_file_failing_signal): Likewise. + (_bfd_generic_get_section_contents): Renamed from + bfd_generic_get_section_contents. Changed all callers. + (_bfd_generic_set_section_contents): Similar rename. + * ieee.c: #if 0 out ieee_bfd_debug_info_start, + ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They + were never called. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + Tue Apr 5 22:10:04 1994 Jeffrey A. Law (law@snake.cs.utah.edu) * Crude support for examining dynamic libraries. diff --git a/bfd/aix386-core.c b/bfd/aix386-core.c index 99c015e5a8..7f7a6bb1cc 100644 --- a/bfd/aix386-core.c +++ b/bfd/aix386-core.c @@ -244,73 +244,6 @@ aix386_core_file_matches_executable_p (core_bfd, exec_bfd) point */ } -/* No archive file support via this BFD */ -#define aix386_openr_next_archived_file bfd_generic_openr_next_archived_file -#define aix386_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define aix386_slurp_armap bfd_false -#define aix386_slurp_extended_name_table bfd_true -#define aix386_write_armap (PROTO (boolean, (*), \ - (bfd *arch, unsigned int elength, struct orl *map, \ - unsigned int orl_count, int stridx))) bfd_false -#define aix386_truncate_arname bfd_dont_truncate_arname - -#define aix386_close_and_cleanup bfd_generic_close_and_cleanup -#define aix386_set_section_contents (PROTO(boolean, (*), \ - (bfd *abfd, asection *section, PTR data, file_ptr offset, \ - bfd_size_type count))) bfd_generic_set_section_contents -#define aix386_get_section_contents bfd_generic_get_section_contents -#define aix386_new_section_hook (PROTO (boolean, (*), \ - (bfd *, sec_ptr))) bfd_true -#define aix386_get_symtab_upper_bound bfd_0l -#define aix386_get_symtab (PROTO (long, (*), \ - (bfd *, struct symbol_cache_entry **))) bfd_0l -#define aix386_get_reloc_upper_bound (PROTO (long, (*), \ - (bfd *, sec_ptr))) bfd_0l -#define aix386_canonicalize_reloc (PROTO (long, (*), \ - (bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0l -#define aix386_make_empty_symbol (PROTO ( \ - struct symbol_cache_entry *, (*), (bfd *))) bfd_false -#define aix386_print_symbol (PROTO (void, (*), \ - (bfd *, PTR, struct symbol_cache_entry *, \ - bfd_print_symbol_type))) bfd_false -#define aix386_get_symbol_info (PROTO (void, (*), \ - (bfd *, struct symbol_cache_entry *, \ - symbol_info *))) bfd_false -#define aix386_get_lineno (PROTO (alent *, (*), \ - (bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr -#define aix386_set_arch_mach (PROTO (boolean, (*), \ - (bfd *, enum bfd_architecture, unsigned long))) bfd_false -#define aix386_find_nearest_line (PROTO (boolean, (*), \ - (bfd *abfd, struct sec *section, \ - struct symbol_cache_entry **symbols,bfd_vma offset, \ - CONST char **file, CONST char **func, unsigned int *line))) bfd_false -#define aix386_sizeof_headers (PROTO (int, (*), \ - (bfd *, boolean))) bfd_0 - -#define aix386_bfd_debug_info_start bfd_void -#define aix386_bfd_debug_info_end bfd_void -#define aix386_bfd_debug_info_accumulate (PROTO (void, (*), \ - (bfd *, struct sec *))) bfd_void -#define aix386_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define aix386_bfd_relax_section bfd_generic_relax_section -#define aix386_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define aix386_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) -#define aix386_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) -#define aix386_bfd_link_add_symbols \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define aix386_bfd_final_link \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define aix386_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_false) -#define aix386_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_false) -#define aix386_bfd_is_local_label \ - ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) -#define aix386_bfd_free_cached_info bfd_true - /* If somebody calls any byte-swapping routines, shoot them. */ void swap_abort() @@ -349,7 +282,15 @@ bfd_target aix386_core_vec = bfd_false, bfd_false}, {bfd_false, bfd_false, /* bfd_write_contents */ bfd_false, bfd_false}, - - JUMP_TABLE(aix386), + + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (aix386), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + (PTR) 0 }; diff --git a/bfd/aout-adobe.c b/bfd/aout-adobe.c index 3abd88e40e..42188595cd 100644 --- a/bfd/aout-adobe.c +++ b/bfd/aout-adobe.c @@ -465,39 +465,26 @@ aout_adobe_sizeof_headers (ignore_abfd, ignore) /* Build the transfer vector for Adobe A.Out files. */ -/* We don't have core files. */ -#define aout_32_core_file_failing_command _bfd_dummy_core_file_failing_command -#define aout_32_core_file_failing_signal _bfd_dummy_core_file_failing_signal -#define aout_32_core_file_matches_executable_p \ - _bfd_dummy_core_file_matches_executable_p - -/* We use BSD-Unix generic archive files. */ -#define aout_32_openr_next_archived_file bfd_generic_openr_next_archived_file -#define aout_32_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define aout_32_slurp_armap bfd_slurp_bsd_armap -#define aout_32_slurp_extended_name_table bfd_true -#define aout_32_write_armap bsd_write_armap -#define aout_32_truncate_arname bfd_bsd_truncate_arname - -/* We override these routines from the usual a.out file routines. */ -#define aout_32_set_section_contents aout_adobe_set_section_contents -#define aout_32_set_arch_mach aout_adobe_set_arch_mach -#define aout_32_sizeof_headers aout_adobe_sizeof_headers - -#define aout_32_bfd_debug_info_start bfd_void -#define aout_32_bfd_debug_info_end bfd_void -#define aout_32_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void +#define aout_32_close_and_cleanup aout_32_bfd_free_cached_info -#define aout_32_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define aout_32_bfd_relax_section bfd_generic_relax_section -#define aout_32_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) #define aout_32_bfd_make_debug_symbol \ ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) -#define aout_32_bfd_link_hash_table_create _bfd_generic_link_hash_table_create -#define aout_32_bfd_link_add_symbols _bfd_generic_link_add_symbols -#define aout_32_bfd_final_link _bfd_generic_final_link -#define aout_32_close_and_cleanup aout_32_bfd_free_cached_info + +#define aout_32_bfd_reloc_type_lookup \ + ((CONST struct reloc_howto_struct *(*) \ + PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) + +#define aout_32_set_arch_mach aout_adobe_set_arch_mach +#define aout_32_set_section_contents aout_adobe_set_section_contents + +#define aout_32_sizeof_headers aout_adobe_sizeof_headers +#define aout_32_bfd_get_relocated_section_contents \ + bfd_generic_get_relocated_section_contents +#define aout_32_bfd_relax_section bfd_generic_relax_section +#define aout_32_bfd_link_hash_table_create \ + _bfd_generic_link_hash_table_create +#define aout_32_bfd_link_add_symbols _bfd_generic_link_add_symbols +#define aout_32_bfd_final_link _bfd_generic_final_link bfd_target a_out_adobe_vec = { @@ -528,6 +515,14 @@ bfd_target a_out_adobe_vec = {bfd_false, aout_adobe_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(aout_32), + BFD_JUMP_TABLE_GENERIC (aout_32), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), + BFD_JUMP_TABLE_SYMBOLS (aout_32), + BFD_JUMP_TABLE_RELOCS (aout_32), + BFD_JUMP_TABLE_WRITE (aout_32), + BFD_JUMP_TABLE_LINK (aout_32), + (PTR) 0 }; diff --git a/bfd/aout-target.h b/bfd/aout-target.h index 8d2f616b27..68cda6c5f6 100644 --- a/bfd/aout-target.h +++ b/bfd/aout-target.h @@ -272,14 +272,14 @@ MY_bfd_final_link (abfd, info) /* No core file defined here -- configure in trad-core.c separately. */ #ifndef MY_core_file_failing_command -#define MY_core_file_failing_command _bfd_dummy_core_file_failing_command +#define MY_core_file_failing_command _bfd_nocore_core_file_failing_command #endif #ifndef MY_core_file_failing_signal -#define MY_core_file_failing_signal _bfd_dummy_core_file_failing_signal +#define MY_core_file_failing_signal _bfd_nocore_core_file_failing_signal #endif #ifndef MY_core_file_matches_executable_p #define MY_core_file_matches_executable_p \ - _bfd_dummy_core_file_matches_executable_p + _bfd_nocore_core_file_matches_executable_p #endif #ifndef MY_core_file_p #define MY_core_file_p _bfd_dummy_target @@ -305,18 +305,6 @@ MY_bfd_final_link (abfd, info) #ifndef MY_core_file_matches_executable_p #define MY_core_file_matches_executable_p NAME(aout,core_file_matches_executable_p) #endif -#ifndef MY_slurp_armap -#define MY_slurp_armap NAME(aout,slurp_armap) -#endif -#ifndef MY_slurp_extended_name_table -#define MY_slurp_extended_name_table NAME(aout,slurp_extended_name_table) -#endif -#ifndef MY_truncate_arname -#define MY_truncate_arname NAME(aout,truncate_arname) -#endif -#ifndef MY_write_armap -#define MY_write_armap NAME(aout,write_armap) -#endif #ifndef MY_set_section_contents #define MY_set_section_contents NAME(aout,set_section_contents) #endif @@ -353,15 +341,9 @@ MY_bfd_final_link (abfd, info) #ifndef MY_set_arch_mach #define MY_set_arch_mach NAME(aout,set_arch_mach) #endif -#ifndef MY_openr_next_archived_file -#define MY_openr_next_archived_file NAME(aout,openr_next_archived_file) -#endif #ifndef MY_find_nearest_line #define MY_find_nearest_line NAME(aout,find_nearest_line) #endif -#ifndef MY_generic_stat_arch_elt -#define MY_generic_stat_arch_elt NAME(aout,generic_stat_arch_elt) -#endif #ifndef MY_sizeof_headers #define MY_sizeof_headers NAME(aout,sizeof_headers) #endif @@ -387,11 +369,10 @@ MY_bfd_final_link (abfd, info) #ifndef MY_bfd_copy_private_section_data #define MY_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) + _bfd_generic_bfd_copy_private_section_data #endif #ifndef MY_bfd_copy_private_bfd_data -#define MY_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) +#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data #endif #ifndef MY_bfd_is_local_label @@ -458,7 +439,15 @@ bfd_target MY(vec) = {bfd_false, MY_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE (MY), + BFD_JUMP_TABLE_GENERIC (MY), + BFD_JUMP_TABLE_COPY (MY), + BFD_JUMP_TABLE_CORE (MY), + BFD_JUMP_TABLE_ARCHIVE (MY), + BFD_JUMP_TABLE_SYMBOLS (MY), + BFD_JUMP_TABLE_RELOCS (MY), + BFD_JUMP_TABLE_WRITE (MY), + BFD_JUMP_TABLE_LINK (MY), + (PTR) MY_backend_data, }; #endif /* MY_BFD_TARGET */ diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index d42d2c5d43..e2f9226276 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -389,11 +389,6 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, PTR), PTR info)); -/* The code that implements targets can initialize a jump table with this - macro. It must name all its routines the same way (a prefix plus - the standard routine suffix), or it must #define the routines that - are not so named, before calling JUMP_TABLE in the initializer. */ - /* Semi-portable string concatenation in cpp. The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors. The problem is, "32_" is not a valid preprocessing token, and we don't @@ -419,48 +414,7 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, #endif #endif -#define JUMP_TABLE(NAME)\ -CAT(NAME,_core_file_failing_command),\ -CAT(NAME,_core_file_failing_signal),\ -CAT(NAME,_core_file_matches_executable_p),\ -CAT(NAME,_slurp_armap),\ -CAT(NAME,_slurp_extended_name_table),\ -CAT(NAME,_truncate_arname),\ -CAT(NAME,_write_armap),\ -CAT(NAME,_close_and_cleanup),\ -CAT(NAME,_set_section_contents),\ -CAT(NAME,_get_section_contents),\ -CAT(NAME,_new_section_hook),\ -CAT(NAME,_bfd_copy_private_section_data),\ -CAT(NAME,_bfd_copy_private_bfd_data),\ -CAT(NAME,_get_symtab_upper_bound),\ -CAT(NAME,_get_symtab),\ -CAT(NAME,_get_reloc_upper_bound),\ -CAT(NAME,_canonicalize_reloc),\ -CAT(NAME,_make_empty_symbol),\ -CAT(NAME,_print_symbol),\ -CAT(NAME,_get_symbol_info),\ -CAT(NAME,_bfd_is_local_label),\ -CAT(NAME,_get_lineno),\ -CAT(NAME,_set_arch_mach),\ -CAT(NAME,_openr_next_archived_file),\ -CAT(NAME,_find_nearest_line),\ -CAT(NAME,_generic_stat_arch_elt),\ -CAT(NAME,_sizeof_headers),\ -CAT(NAME,_bfd_debug_info_start),\ -CAT(NAME,_bfd_debug_info_end),\ -CAT(NAME,_bfd_debug_info_accumulate),\ -CAT(NAME,_bfd_get_relocated_section_contents),\ -CAT(NAME,_bfd_relax_section),\ -CAT(NAME,_bfd_reloc_type_lookup),\ -CAT(NAME,_bfd_make_debug_symbol),\ -CAT(NAME,_bfd_link_hash_table_create),\ -CAT(NAME,_bfd_link_add_symbols),\ -CAT(NAME,_bfd_final_link),\ -CAT(NAME,_bfd_free_cached_info) - #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table - /* User program access to BFD facilities */ diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 248c04fcbc..8b07188278 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -389,11 +389,6 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, PTR), PTR info)); -/* The code that implements targets can initialize a jump table with this - macro. It must name all its routines the same way (a prefix plus - the standard routine suffix), or it must #define the routines that - are not so named, before calling JUMP_TABLE in the initializer. */ - /* Semi-portable string concatenation in cpp. The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors. The problem is, "32_" is not a valid preprocessing token, and we don't @@ -419,48 +414,7 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, #endif #endif -#define JUMP_TABLE(NAME)\ -CAT(NAME,_core_file_failing_command),\ -CAT(NAME,_core_file_failing_signal),\ -CAT(NAME,_core_file_matches_executable_p),\ -CAT(NAME,_slurp_armap),\ -CAT(NAME,_slurp_extended_name_table),\ -CAT(NAME,_truncate_arname),\ -CAT(NAME,_write_armap),\ -CAT(NAME,_close_and_cleanup),\ -CAT(NAME,_set_section_contents),\ -CAT(NAME,_get_section_contents),\ -CAT(NAME,_new_section_hook),\ -CAT(NAME,_bfd_copy_private_section_data),\ -CAT(NAME,_bfd_copy_private_bfd_data),\ -CAT(NAME,_get_symtab_upper_bound),\ -CAT(NAME,_get_symtab),\ -CAT(NAME,_get_reloc_upper_bound),\ -CAT(NAME,_canonicalize_reloc),\ -CAT(NAME,_make_empty_symbol),\ -CAT(NAME,_print_symbol),\ -CAT(NAME,_get_symbol_info),\ -CAT(NAME,_bfd_is_local_label),\ -CAT(NAME,_get_lineno),\ -CAT(NAME,_set_arch_mach),\ -CAT(NAME,_openr_next_archived_file),\ -CAT(NAME,_find_nearest_line),\ -CAT(NAME,_generic_stat_arch_elt),\ -CAT(NAME,_sizeof_headers),\ -CAT(NAME,_bfd_debug_info_start),\ -CAT(NAME,_bfd_debug_info_end),\ -CAT(NAME,_bfd_debug_info_accumulate),\ -CAT(NAME,_bfd_get_relocated_section_contents),\ -CAT(NAME,_bfd_relax_section),\ -CAT(NAME,_bfd_reloc_type_lookup),\ -CAT(NAME,_bfd_make_debug_symbol),\ -CAT(NAME,_bfd_link_hash_table_create),\ -CAT(NAME,_bfd_link_add_symbols),\ -CAT(NAME,_bfd_final_link),\ -CAT(NAME,_bfd_free_cached_info) - #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table - /* User program access to BFD facilities */ @@ -2025,9 +1979,52 @@ typedef struct bfd_target struct bfd_target * (*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); + + /* Generic entry points. */ +#define BFD_JUMP_TABLE_GENERIC(NAME)\ +CAT(NAME,_close_and_cleanup),\ +CAT(NAME,_bfd_free_cached_info),\ +CAT(NAME,_new_section_hook),\ +CAT(NAME,_get_section_contents) + /* Called when the BFD is being closed to do any necessary cleanup. */ + boolean (*_close_and_cleanup) PARAMS ((bfd *)); + /* Ask the BFD to free all cached information. */ + boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); + /* Called when a new section is created. */ + boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); + /* Read the contents of a section. */ + boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, + file_ptr, bfd_size_type)); + + /* Entry points to copy private data. */ +#define BFD_JUMP_TABLE_COPY(NAME)\ +CAT(NAME,_bfd_copy_private_bfd_data),\ +CAT(NAME,_bfd_copy_private_section_data) + /* Called to copy BFD general private data from one object file + to another. */ + boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); + /* Called to copy BFD private section data from one object file + to another. */ + boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, + bfd *, sec_ptr)); + + /* Core file entry points. */ +#define BFD_JUMP_TABLE_CORE(NAME)\ +CAT(NAME,_core_file_failing_command),\ +CAT(NAME,_core_file_failing_signal),\ +CAT(NAME,_core_file_matches_executable_p) char * (*_core_file_failing_command) PARAMS ((bfd *)); int (*_core_file_failing_signal) PARAMS ((bfd *)); boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); + + /* Archive entry points. */ +#define BFD_JUMP_TABLE_ARCHIVE(NAME)\ +CAT(NAME,_slurp_armap),\ +CAT(NAME,_slurp_extended_name_table),\ +CAT(NAME,_truncate_arname),\ +CAT(NAME,_write_armap),\ +CAT(NAME,_openr_next_archived_file),\ +CAT(NAME,_generic_stat_arch_elt) boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); @@ -2036,21 +2033,23 @@ typedef struct bfd_target struct orl *map, unsigned int orl_count, int stridx)); - boolean (*_close_and_cleanup) PARAMS ((bfd *)); - boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); - boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); - boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); - boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, - bfd *, sec_ptr)); - boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); + bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); + int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); + + /* Entry points used for symbols. */ +#define BFD_JUMP_TABLE_SYMBOLS(NAME)\ +CAT(NAME,_get_symtab_upper_bound),\ +CAT(NAME,_get_symtab),\ +CAT(NAME,_make_empty_symbol),\ +CAT(NAME,_print_symbol),\ +CAT(NAME,_get_symbol_info),\ +CAT(NAME,_bfd_is_local_label),\ +CAT(NAME,_get_lineno),\ +CAT(NAME,_find_nearest_line),\ +CAT(NAME,_bfd_make_debug_symbol) long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, struct symbol_cache_entry **)); - long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); - long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, - struct symbol_cache_entry **)); struct symbol_cache_entry * (*_bfd_make_empty_symbol) PARAMS ((bfd *)); void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, @@ -2062,26 +2061,51 @@ typedef struct bfd_target symbol_info *)); #define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) boolean (*_bfd_is_local_label) PARAMS ((bfd *, asymbol *)); - alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); - - boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, - unsigned long)); - bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); - + alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd, struct sec *section, struct symbol_cache_entry **symbols, bfd_vma offset, CONST char **file, CONST char **func, unsigned int *line)); - - int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); + /* Back-door to allow format-aware applications to create debug symbols + while using BFD for everything else. Currently used by the assembler + when creating COFF files. */ + asymbol * (*_bfd_make_debug_symbol) PARAMS (( + bfd *abfd, + void *ptr, + unsigned long size)); - int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); + /* Routines for relocs. */ +#define BFD_JUMP_TABLE_RELOCS(NAME)\ +CAT(NAME,_get_reloc_upper_bound),\ +CAT(NAME,_canonicalize_reloc),\ +CAT(NAME,_bfd_reloc_type_lookup) + long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); + long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, + struct symbol_cache_entry **)); + /* See documentation on reloc types. */ + CONST struct reloc_howto_struct * + (*reloc_type_lookup) PARAMS ((bfd *abfd, + bfd_reloc_code_real_type code)); - void (*_bfd_debug_info_start) PARAMS ((bfd *)); - void (*_bfd_debug_info_end) PARAMS ((bfd *)); - void (*_bfd_debug_info_accumulate) PARAMS ((bfd *, struct sec *)); + /* Routines used when writing an object file. */ +#define BFD_JUMP_TABLE_WRITE(NAME)\ +CAT(NAME,_set_arch_mach),\ +CAT(NAME,_set_section_contents) + boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, + unsigned long)); + boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, + file_ptr, bfd_size_type)); + /* Routines used by the linker. */ +#define BFD_JUMP_TABLE_LINK(NAME)\ +CAT(NAME,_sizeof_headers),\ +CAT(NAME,_bfd_get_relocated_section_contents),\ +CAT(NAME,_bfd_relax_section),\ +CAT(NAME,_bfd_link_hash_table_create),\ +CAT(NAME,_bfd_link_add_symbols),\ +CAT(NAME,_bfd_final_link) + int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *data, boolean relocateable, @@ -2090,19 +2114,6 @@ typedef struct bfd_target boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *again)); - /* See documentation on reloc types. */ - CONST struct reloc_howto_struct * - (*reloc_type_lookup) PARAMS ((bfd *abfd, - bfd_reloc_code_real_type code)); - - /* Back-door to allow format-aware applications to create debug symbols - while using BFD for everything else. Currently used by the assembler - when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) PARAMS (( - bfd *abfd, - void *ptr, - unsigned long size)); - /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); @@ -2114,9 +2125,6 @@ typedef struct bfd_target section of the BFD. */ boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); - /* Ask the BFD to free all cached information. */ - boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); - PTR backend_data; } bfd_target; bfd_target * diff --git a/bfd/bout.c b/bfd/bout.c index d560e8c860..eb94cef333 100644 --- a/bfd/bout.c +++ b/bfd/bout.c @@ -46,10 +46,10 @@ static bfd_vma get_value PARAMS ((arelent *, struct bfd_link_info *, asection *)); static int abs32code PARAMS ((bfd *, asection *, arelent *, unsigned int, struct bfd_link_info *)); -static boolean b_out_relax_section PARAMS ((bfd *, asection *, - struct bfd_link_info *, - boolean *)); -static bfd_byte *b_out_get_relocated_section_contents +static boolean b_out_bfd_relax_section PARAMS ((bfd *, asection *, + struct bfd_link_info *, + boolean *)); +static bfd_byte *b_out_bfd_get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, boolean, asymbol **)); @@ -428,7 +428,7 @@ static reloc_howto_type howto_done_align_table[] = { }; static const reloc_howto_type * -b_out_reloc_type_lookup (abfd, code) +b_out_bfd_reloc_type_lookup (abfd, code) bfd *abfd; bfd_reloc_code_real_type code; { @@ -1100,7 +1100,7 @@ aligncode (abfd, input_section, r, shrink) } static boolean -b_out_relax_section (abfd, i, link_info, again) +b_out_bfd_relax_section (abfd, i, link_info, again) bfd *abfd; asection *i; struct bfd_link_info *link_info; @@ -1174,8 +1174,8 @@ b_out_relax_section (abfd, i, link_info, again) } static bfd_byte * -b_out_get_relocated_section_contents (in_abfd, link_info, link_order, data, - relocateable, symbols) +b_out_bfd_get_relocated_section_contents (in_abfd, link_info, link_order, + data, relocateable, symbols) bfd *in_abfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; @@ -1356,41 +1356,13 @@ b_out_get_relocated_section_contents (in_abfd, link_info, link_order, data, /* Build the transfer vectors for Big and Little-Endian B.OUT files. */ -/* We don't have core files. */ -#define aout_32_core_file_failing_command _bfd_dummy_core_file_failing_command -#define aout_32_core_file_failing_signal _bfd_dummy_core_file_failing_signal -#define aout_32_core_file_matches_executable_p \ - _bfd_dummy_core_file_matches_executable_p - -/* We use BSD-Unix generic archive files. */ -#define aout_32_openr_next_archived_file bfd_generic_openr_next_archived_file -#define aout_32_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define aout_32_slurp_armap bfd_slurp_bsd_armap -#define aout_32_slurp_extended_name_table _bfd_slurp_extended_name_table -#define aout_32_write_armap bsd_write_armap -#define aout_32_truncate_arname bfd_bsd_truncate_arname - -/* We override these routines from the usual a.out file routines. */ -#define aout_32_canonicalize_reloc b_out_canonicalize_reloc -#define aout_32_get_reloc_upper_bound b_out_get_reloc_upper_bound -#define aout_32_set_section_contents b_out_set_section_contents -#define aout_32_set_arch_mach b_out_set_arch_mach -#define aout_32_sizeof_headers b_out_sizeof_headers - -#define aout_32_bfd_debug_info_start bfd_void -#define aout_32_bfd_debug_info_end bfd_void -#define aout_32_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void - -#define aout_32_bfd_get_relocated_section_contents b_out_get_relocated_section_contents -#define aout_32_bfd_relax_section b_out_relax_section -#define aout_32_bfd_reloc_type_lookup b_out_reloc_type_lookup -#define aout_32_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) -#define aout_32_bfd_link_hash_table_create _bfd_generic_link_hash_table_create -#define aout_32_bfd_link_add_symbols _bfd_generic_link_add_symbols -#define aout_32_bfd_final_link _bfd_generic_final_link +#define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define aout_32_close_and_cleanup aout_32_bfd_free_cached_info +#define b_out_bfd_link_hash_table_create _bfd_generic_link_hash_table_create +#define b_out_bfd_link_add_symbols _bfd_generic_link_add_symbols +#define b_out_bfd_final_link _bfd_generic_final_link + bfd_target b_out_vec_big_host = { "b.out.big", /* name */ @@ -1419,7 +1391,15 @@ bfd_target b_out_vec_big_host = {bfd_false, b_out_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(aout_32), + BFD_JUMP_TABLE_GENERIC (aout_32), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), + BFD_JUMP_TABLE_SYMBOLS (aout_32), + BFD_JUMP_TABLE_RELOCS (b_out), + BFD_JUMP_TABLE_WRITE (b_out), + BFD_JUMP_TABLE_LINK (b_out), + (PTR) 0, }; @@ -1451,6 +1431,15 @@ bfd_target b_out_vec_little_host = _bfd_generic_mkarchive, bfd_false}, {bfd_false, b_out_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(aout_32), + + BFD_JUMP_TABLE_GENERIC (aout_32), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), + BFD_JUMP_TABLE_SYMBOLS (aout_32), + BFD_JUMP_TABLE_RELOCS (b_out), + BFD_JUMP_TABLE_WRITE (b_out), + BFD_JUMP_TABLE_LINK (b_out), + (PTR) 0 }; diff --git a/bfd/cf-i386lynx.c b/bfd/cf-i386lynx.c new file mode 100644 index 0000000000..3c9c8d060f --- /dev/null +++ b/bfd/cf-i386lynx.c @@ -0,0 +1,98 @@ +/* BFD back-end for Intel 386 COFF LynxOS files. + Copyright 1993 Free Software Foundation, Inc. + Written by Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#define TARGET_SYM i386lynx_coff_vec +#define TARGET_NAME "coff-i386-lynx" + +#define LYNXOS + +#define COFF_LONG_FILENAMES + +#include "coff-i386.c" + +static bfd_target * +i386_lynxos_coff_object_p(a) + bfd *a; +{ + return coff_object_p(a); +} + +#if 0 + +#undef TARGET_SYM +#define TARGET_SYM i386lynx_sysv_coff_vec +#undef TARGET_NAME +#define TARGET_NAME "coff-i386-lynx-sysv" + +/* Another almost-copy of the vector in coff-i386.c. */ + +bfd_target +#ifdef TARGET_SYM + TARGET_SYM = +#else + i386coff_vec = +#endif +{ +#ifdef TARGET_NAME + TARGET_NAME, +#else + "coff-i386", /* name */ +#endif + bfd_target_coff_flavour, + false, /* data byte order is little */ + false, /* header byte order is little */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + 0, /* leading underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + + 2, /* minimum alignment power */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + +/* Note that we allow an object file to be treated as a core file as well. */ + {_bfd_dummy_target, i3coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, i3coff_object_p}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + + COFF_SWAP_TABLE, +}; +#endif diff --git a/bfd/cisco-core.c b/bfd/cisco-core.c index 5a94d5107b..a253675a8d 100644 --- a/bfd/cisco-core.c +++ b/bfd/cisco-core.c @@ -273,74 +273,6 @@ cisco_core_file_matches_executable_p (core_bfd, exec_bfd) return true; } -/* No archive file support via this BFD */ -#define cisco_openr_next_archived_file bfd_generic_openr_next_archived_file -#define cisco_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define cisco_slurp_armap bfd_false -#define cisco_slurp_extended_name_table bfd_true -#define cisco_write_armap (boolean (*) PARAMS \ - ((bfd *arch, unsigned int elength, struct orl *map, \ - unsigned int orl_count, int stridx))) bfd_false -#define cisco_truncate_arname bfd_dont_truncate_arname -#define aout_32_openr_next_archived_file bfd_generic_openr_next_archived_file - -#define cisco_close_and_cleanup bfd_generic_close_and_cleanup -#define cisco_set_section_contents (boolean (*) PARAMS \ - ((bfd *abfd, asection *section, PTR data, file_ptr offset, \ - bfd_size_type count))) bfd_generic_set_section_contents -#define cisco_get_section_contents bfd_generic_get_section_contents -#define cisco_new_section_hook (boolean (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_true -#define cisco_get_symtab_upper_bound bfd_0l -#define cisco_get_symtab (long (*) PARAMS \ - ((bfd *, struct symbol_cache_entry **))) bfd_0l -#define cisco_get_reloc_upper_bound (long (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_0l -#define cisco_canonicalize_reloc (long (*) PARAMS \ - ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0l -#define cisco_make_empty_symbol (struct symbol_cache_entry * \ - (*) PARAMS ((bfd *))) bfd_false -#define cisco_print_symbol (void (*) PARAMS \ - ((bfd *, PTR, struct symbol_cache_entry *, \ - bfd_print_symbol_type))) bfd_false -#define cisco_get_symbol_info (void (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *, \ - symbol_info *))) bfd_false -#define cisco_get_lineno (alent * (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr -#define cisco_set_arch_mach (boolean (*) PARAMS \ - ((bfd *, enum bfd_architecture, unsigned long))) bfd_false -#define cisco_find_nearest_line (boolean (*) PARAMS \ - ((bfd *abfd, struct sec *section, \ - struct symbol_cache_entry **symbols,bfd_vma offset, \ - CONST char **file, CONST char **func, unsigned int *line))) bfd_false -#define cisco_sizeof_headers (int (*) PARAMS \ - ((bfd *, boolean))) bfd_0 - -#define cisco_bfd_debug_info_start bfd_void -#define cisco_bfd_debug_info_end bfd_void -#define cisco_bfd_debug_info_accumulate (void (*) PARAMS \ - ((bfd *, struct sec *))) bfd_void -#define cisco_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define cisco_bfd_relax_section bfd_generic_relax_section -#define cisco_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define cisco_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) -#define cisco_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) -#define cisco_bfd_link_add_symbols \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define cisco_bfd_final_link \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define cisco_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_false) -#define cisco_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_false) -#define cisco_bfd_is_local_label \ - ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) -#define cisco_bfd_free_cached_info bfd_true - bfd_target cisco_core_vec = { "trad-core", @@ -377,6 +309,14 @@ bfd_target cisco_core_vec = bfd_false, bfd_false }, - JUMP_TABLE(cisco), + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (cisco), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + (PTR) 0 /* backend_data */ }; diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c index 1016b21251..21b48502c7 100644 --- a/bfd/coff-a29k.c +++ b/bfd/coff-a29k.c @@ -335,6 +335,14 @@ bfd_target a29kcoff_big_vec = bfd_false }, - JUMP_TABLE(coff), + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE }; diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index 49cb9df03e..cee3ea7bd3 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -1895,12 +1895,6 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, return true; } -#define ecoff_core_file_p _bfd_dummy_target -#define ecoff_core_file_failing_command _bfd_dummy_core_file_failing_command -#define ecoff_core_file_failing_signal _bfd_dummy_core_file_failing_signal -#define ecoff_core_file_matches_executable_p \ - _bfd_dummy_core_file_matches_executable_p - /* This is the ECOFF backend structure. The backend field of the target vector points to this. */ @@ -2024,6 +2018,15 @@ bfd_target ecoffalpha_little_vec = _bfd_generic_mkarchive, bfd_false}, {bfd_false, ecoff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE (ecoff), + + BFD_JUMP_TABLE_GENERIC (ecoff), + BFD_JUMP_TABLE_COPY (ecoff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (ecoff), + BFD_JUMP_TABLE_SYMBOLS (ecoff), + BFD_JUMP_TABLE_RELOCS (ecoff), + BFD_JUMP_TABLE_WRITE (ecoff), + BFD_JUMP_TABLE_LINK (ecoff), + (PTR) &alpha_ecoff_backend_data }; diff --git a/bfd/coff-apollo.c b/bfd/coff-apollo.c new file mode 100644 index 0000000000..45493ca06b --- /dev/null +++ b/bfd/coff-apollo.c @@ -0,0 +1,160 @@ +/* BFD back-end for Apollo 68000 COFF binaries. + Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. + By Troy Rollo (troy@cbme.unsw.edu.au) + Based on m68k standard COFF version Written by Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "obstack.h" +#include "coff/apollo.h" +#include "coff/internal.h" +#include "libcoff.h" + +#ifdef ONLY_DECLARE_RELOCS +extern reloc_howto_type apollocoff_howto_table[]; +#else +reloc_howto_type apollocoff_howto_table[] = +{ + HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, 0x000000ff,0x000000ff, false), + HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, 0x0000ffff,0x0000ffff, false), + HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, 0xffffffff,0xffffffff, false), + HOWTO(R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, 0x000000ff,0x000000ff, false), + HOWTO(R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, 0x0000ffff,0x0000ffff, false), + HOWTO(R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, 0xffffffff,0xffffffff, false), + HOWTO(R_RELLONG_NEG, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "-32", true, 0xffffffff,0xffffffff, false), +}; +#endif /* not ONLY_DECLARE_RELOCS */ + +#ifndef BADMAG +#define BADMAG(x) M68KBADMAG(x) +#endif +#define APOLLO_M68 1 /* Customize coffcode.h */ + +/* Turn a howto into a reloc number */ + +#ifdef ONLY_DECLARE_RELOCS +extern void apollo_rtype2howto PARAMS ((arelent *internal, int relocentry)); +extern int apollo_howto2rtype PARAMS ((CONST struct reloc_howto_struct *)); +#else +void +apollo_rtype2howto(internal, relocentry) + arelent *internal; + int relocentry; +{ + switch (relocentry) + { + case R_RELBYTE: internal->howto = apollocoff_howto_table + 0; break; + case R_RELWORD: internal->howto = apollocoff_howto_table + 1; break; + case R_RELLONG: internal->howto = apollocoff_howto_table + 2; break; + case R_PCRBYTE: internal->howto = apollocoff_howto_table + 3; break; + case R_PCRWORD: internal->howto = apollocoff_howto_table + 4; break; + case R_PCRLONG: internal->howto = apollocoff_howto_table + 5; break; + case R_RELLONG_NEG: internal->howto = apollocoff_howto_table + 6; break; + } +} + +int +apollo_howto2rtype (internal) + CONST struct reloc_howto_struct *internal; +{ + if (internal->pc_relative) + { + switch (internal->bitsize) + { + case 32: return R_PCRLONG; + case 16: return R_PCRWORD; + case 8: return R_PCRBYTE; + } + } + else + { + switch (internal->bitsize) + { + case 32: return R_RELLONG; + case 16: return R_RELWORD; + case 8: return R_RELBYTE; + } + } + return R_RELLONG; +} +#endif /* not ONLY_DECLARE_RELOCS */ + +#define RTYPE2HOWTO(internal, relocentry) \ + apollo_rtype2howto(internal, (relocentry)->r_type) + +#define SELECT_RELOC(external, internal) \ + external.r_type = apollo_howto2rtype(internal); + +#include "coffcode.h" + +bfd_target +#ifdef TARGET_SYM + TARGET_SYM = +#else + apollocoff_vec = +#endif +{ +#ifdef TARGET_NAME + TARGET_NAME, +#else + "apollo-m68k", /* name */ +#endif + bfd_target_coff_flavour, + true, /* data byte order is big */ + true, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ +#ifdef NAMES_HAVE_UNDERSCORE + '_', +#else + 0, /* leading underscore */ +#endif + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + 3, /* minimum section alignment */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + + COFF_SWAP_TABLE + }; diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c index 54aa02809c..8c7af9b210 100644 --- a/bfd/coff-h8300.c +++ b/bfd/coff-h8300.c @@ -591,6 +591,14 @@ bfd_target h8300coff_vec = {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE (coff), + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE, }; diff --git a/bfd/coff-h8500.c b/bfd/coff-h8500.c index cf87258862..bc80a222a1 100644 --- a/bfd/coff-h8500.c +++ b/bfd/coff-h8500.c @@ -339,6 +339,14 @@ bfd_target h8500coff_vec = {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE (coff), + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE, }; diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c index 981b510760..da8d0d89e5 100644 --- a/bfd/coff-i386.c +++ b/bfd/coff-i386.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 386 COFF files. - Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -31,7 +31,8 @@ static bfd_reloc_status_type coff_i386_reloc PARAMS ((bfd *abfd, asymbol *symbol, PTR data, asection *input_section, - bfd *output_bfd)); + bfd *output_bfd, + char **error_message)); /* For some reason when using i386 COFF the value stored in the .text section for a reference to a common symbol is the value itself plus @@ -43,13 +44,15 @@ static bfd_reloc_status_type coff_i386_reloc PARAMS ((bfd *abfd, reloc type to make any required adjustments. */ static bfd_reloc_status_type -coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd) +coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, + error_message) bfd *abfd; arelent *reloc_entry; asymbol *symbol; PTR data; asection *input_section; bfd *output_bfd; + char **error_message; { symvalue diff; @@ -85,7 +88,7 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd) if (diff != 0) { - reloc_howto_type *howto = reloc_entry->howto; + const reloc_howto_type *howto = reloc_entry->howto; unsigned char *addr = (unsigned char *) data + reloc_entry->address; switch (howto->size) @@ -234,7 +237,7 @@ static reloc_howto_type howto_table[] = /* Turn a howto into a reloc nunmber */ -#define SELECT_RELOC(x,howto) { x = howto->type; } +#define SELECT_RELOC(x,howto) { x.r_type = howto->type; } #define BADMAG(x) I386BADMAG(x) #define I386 1 /* Customize coffcode.h */ @@ -284,14 +287,6 @@ static reloc_howto_type howto_table[] = cache_ptr->addend += asect->vma; \ } -/* For aix386, define a variable to track the number of sections discarded - during a strip. */ - -#if defined(_AIX) && defined(_I386) -#define USE_DISCARDED_SECTIONS_COUNT -int discarded_sections_count = 0; -#endif - #include "coffcode.h" static bfd_target * @@ -319,7 +314,7 @@ bfd_target (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT), + HAS_SYMS | HAS_LOCALS | WP_TEXT), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ 0, /* leading underscore */ @@ -342,6 +337,14 @@ bfd_target {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(coff), + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE, }; diff --git a/bfd/coff-i960.c b/bfd/coff-i960.c index f58f9485c1..c505798e59 100644 --- a/bfd/coff-i960.c +++ b/bfd/coff-i960.c @@ -1,5 +1,5 @@ -/* Intel 960 COFF support for BFD. - Copyright (C) 1990-1991 Free Software Foundation, Inc. +/* BFD back-end for Intel 960 COFF files. + Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -28,6 +28,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "coff/i960.h" #include "coff/internal.h" #include "libcoff.h" /* to allow easier abstraction-breaking */ + +static bfd_reloc_status_type optcall_callback + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + #define COFF_LONG_FILENAMES #define CALLS 0x66003800 /* Template for 'calls' instruction */ @@ -35,14 +39,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define BAL_MASK 0x00ffffff static bfd_reloc_status_type -DEFUN (optcall_callback, (abfd, reloc_entry, symbol_in, data, - ignore_input_section, ignore_bfd), - bfd *abfd AND - arelent *reloc_entry AND - asymbol *symbol_in AND - PTR data AND - asection *ignore_input_section AND - bfd *ignore_bfd) +optcall_callback (abfd, reloc_entry, symbol_in, data, + ignore_input_section, ignore_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol_in; + PTR data; + asection *ignore_input_section; + bfd *ignore_bfd; + char **error_message; { /* This item has already been relocated correctly, but we may be * able to patch in yet better code - done by digging out the @@ -52,33 +57,36 @@ DEFUN (optcall_callback, (abfd, reloc_entry, symbol_in, data, /* So the target symbol has to be of coff type, and the symbol has to have the correct native information within it */ - if ((cs->symbol.the_bfd->xvec->flavour != bfd_target_coff_flavour) - || (cs->native == (combined_entry_type *)NULL)) { - /* This is interesting, consider the case where we're outputting */ - /* coff from a mix n match input, linking from coff to a symbol */ - /* defined in a bout file will cause this match to be true. Should */ - /* I complain ? - This will only work if the bout symbol is non */ - /* leaf. */ - result = bfd_reloc_dangerous; - } - else { + if ((bfd_asymbol_flavour(&cs->symbol) != bfd_target_coff_flavour) + || (cs->native == (combined_entry_type *)NULL)) + { + /* This is interesting, consider the case where we're outputting coff + from a mix n match input, linking from coff to a symbol defined in a + bout file will cause this match to be true. Should I complain? This + will only work if the bout symbol is non leaf. */ + *error_message = + (char *) "uncertain calling convention for non-COFF symbol"; + result = bfd_reloc_dangerous; + } + else + { switch (cs->native->u.syment.n_sclass) { case C_LEAFSTAT: case C_LEAFEXT: /* This is a call to a leaf procedure, replace instruction with a bal - to the correct location */ + to the correct location. */ { union internal_auxent *aux = &((cs->native+2)->u.auxent); int word = bfd_get_32(abfd, (bfd_byte *)data + reloc_entry->address); int olf = (aux->x_bal.x_balntry - cs->native->u.syment.n_value); BFD_ASSERT(cs->native->u.syment.n_numaux==2); - /* We replace the original call instruction with a bal to */ - /* the bal entry point - the offset of which is described in the */ - /* 2nd auxent of the original symbol. We keep the native sym and */ - /* auxents untouched, so the delta between the two is the */ - /* offset of the bal entry point */ + /* We replace the original call instruction with a bal to + the bal entry point - the offset of which is described in + the 2nd auxent of the original symbol. We keep the native + sym and auxents untouched, so the delta between the two + is the offset of the bal entry point. */ word = ((word + olf) & BAL_MASK) | BAL; bfd_put_32(abfd, word, (bfd_byte *) data + reloc_entry->address); } @@ -98,19 +106,20 @@ DEFUN (optcall_callback, (abfd, reloc_entry, symbol_in, data, } static reloc_howto_type howto_rellong = - { (unsigned int) R_RELLONG, 0, 2, 32,false, 0, true, true, - 0,"rellong", true, 0xffffffff, 0xffffffff}; + { (unsigned int) R_RELLONG, 0, 2, 32,false, 0, + complain_overflow_bitfield, 0,"rellong", true, 0xffffffff, + 0xffffffff}; static reloc_howto_type howto_iprmed = - { R_IPRMED, 0, 2, 24,true,0, true, true,0,"iprmed ", true, - 0x00ffffff, 0x00ffffff}; + { R_IPRMED, 0, 2, 24,true,0, complain_overflow_signed,0, + "iprmed ", true, 0x00ffffff, 0x00ffffff}; static reloc_howto_type howto_optcall = - { R_OPTCALL, 0,2,24,true,0, true, true, optcall_callback, - "optcall", true, 0x00ffffff, 0x00ffffff}; + { R_OPTCALL, 0,2,24,true,0, complain_overflow_signed, + optcall_callback, "optcall", true, 0x00ffffff, 0x00ffffff}; -static reloc_howto_type * -DEFUN (coff_i960_reloc_type_lookup, (abfd, code), - bfd *abfd AND - bfd_reloc_code_real_type code) +static const reloc_howto_type * +coff_i960_reloc_type_lookup (abfd, code) + bfd *abfd; + bfd_reloc_code_real_type code; { switch (code) { @@ -141,6 +150,9 @@ DEFUN (coff_i960_reloc_type_lookup, (abfd, code), #include "coffcode.h" +#undef coff_bfd_reloc_type_lookup +#define coff_bfd_reloc_type_lookup coff_i960_reloc_type_lookup + bfd_target icoff_little_vec = { "coff-Intel-little", /* name */ @@ -150,7 +162,7 @@ bfd_target icoff_little_vec = (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT), + HAS_SYMS | HAS_LOCALS | WP_TEXT), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ 0, /* leading underscore */ @@ -158,8 +170,12 @@ bfd_target icoff_little_vec = 15, /* ar_max_namelen */ 3, /* minimum alignment power */ - _do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */ - _do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* hdrs */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, _bfd_dummy_target}, @@ -167,10 +183,17 @@ bfd_target icoff_little_vec = _bfd_generic_mkarchive, bfd_false}, {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(coff), + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE, - coff_i960_reloc_type_lookup, - coff_make_debug_symbol, }; @@ -183,7 +206,7 @@ bfd_target icoff_big_vec = (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT), + HAS_SYMS | HAS_LOCALS | WP_TEXT), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ 0, /* leading underscore */ @@ -191,8 +214,12 @@ bfd_target icoff_big_vec = 15, /* ar_max_namelen */ 3, /* minimum alignment power */ -_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */ -_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */ +bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ +bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, _bfd_dummy_target}, @@ -200,8 +227,15 @@ _do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs _bfd_generic_mkarchive, bfd_false}, {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(coff), + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE, - coff_i960_reloc_type_lookup, - coff_make_debug_symbol, }; diff --git a/bfd/coff-m68k.c b/bfd/coff-m68k.c index ee113ecb39..cd4fd42cf2 100644 --- a/bfd/coff-m68k.c +++ b/bfd/coff-m68k.c @@ -1,5 +1,5 @@ /* BFD back-end for Motorola 68000 COFF binaries. - Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -26,18 +26,27 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "coff/internal.h" #include "libcoff.h" +#ifndef LYNX_SPECIAL_FN +#define LYNX_SPECIAL_FN 0 +#endif + +/* Clean up namespace. */ +#define m68kcoff_howto_table _bfd_m68kcoff_howto_table +#define m68k_rtype2howto _bfd_m68kcoff_rtype2howto +#define m68k_howto2rtype _bfd_m68kcoff_howto2rtype + #ifdef ONLY_DECLARE_RELOCS extern reloc_howto_type m68kcoff_howto_table[]; #else reloc_howto_type m68kcoff_howto_table[] = { - HOWTO(R_RELBYTE, 0, 0, 8, false, 0, true, true,0,"8", true, 0x000000ff,0x000000ff, false), - HOWTO(R_RELWORD, 0, 1, 16, false, 0, true, true,0,"16", true, 0x0000ffff,0x0000ffff, false), - HOWTO(R_RELLONG, 0, 2, 32, false, 0, true, true,0,"32", true, 0xffffffff,0xffffffff, false), - HOWTO(R_PCRBYTE, 0, 0, 8, true, 0, false, true,0,"DISP8", true, 0x000000ff,0x000000ff, false), - HOWTO(R_PCRWORD, 0, 1, 16, true, 0, false, true,0,"DISP16", true, 0x0000ffff,0x0000ffff, false), - HOWTO(R_PCRLONG, 0, 2, 32, true, 0, false, true,0,"DISP32", true, 0xffffffff,0xffffffff, false), - HOWTO(R_RELLONG_NEG, 0, -2, 32, false, 0, true, true,0,"-32", true, 0xffffffff,0xffffffff, false), + HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, LYNX_SPECIAL_FN, "8", true, 0x000000ff,0x000000ff, false), + HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, LYNX_SPECIAL_FN, "16", true, 0x0000ffff,0x0000ffff, false), + HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, LYNX_SPECIAL_FN, "32", true, 0xffffffff,0xffffffff, false), + HOWTO(R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, LYNX_SPECIAL_FN, "DISP8", true, 0x000000ff,0x000000ff, false), + HOWTO(R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, LYNX_SPECIAL_FN, "DISP16", true, 0x0000ffff,0x0000ffff, false), + HOWTO(R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, LYNX_SPECIAL_FN, "DISP32", true, 0xffffffff,0xffffffff, false), + HOWTO(R_RELLONG_NEG, 0, -2, 32, false, 0, complain_overflow_bitfield, LYNX_SPECIAL_FN, "-32", true, 0xffffffff,0xffffffff, false), }; #endif /* not ONLY_DECLARE_RELOCS */ @@ -99,7 +108,7 @@ m68k_howto2rtype (internal) m68k_rtype2howto(internal, (relocentry)->r_type) #define SELECT_RELOC(external, internal) \ - external = m68k_howto2rtype(internal); + external.r_type = m68k_howto2rtype(internal); #include "coffcode.h" @@ -121,7 +130,7 @@ bfd_target (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT), + HAS_SYMS | HAS_LOCALS | WP_TEXT), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ #ifdef NAMES_HAVE_UNDERSCORE @@ -132,12 +141,12 @@ bfd_target '/', /* ar_pad_char */ 15, /* ar_max_namelen */ 1, /* minimum section alignment */ - _do_getb64, _do_getb_signed_64, _do_putb64, - _do_getb32, _do_getb_signed_32, _do_putb32, - _do_getb16, _do_getb_signed_16, _do_putb16, /* data */ - _do_getb64, _do_getb_signed_64, _do_putb64, - _do_getb32, _do_getb_signed_32, _do_putb32, - _do_getb16, _do_getb_signed_16, _do_putb16, /* hdrs */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, _bfd_dummy_target}, @@ -146,6 +155,14 @@ bfd_target {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(coff), + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE }; diff --git a/bfd/coff-m88k.c b/bfd/coff-m88k.c index ff67087833..aa0d8ea7f1 100644 --- a/bfd/coff-m88k.c +++ b/bfd/coff-m88k.c @@ -46,14 +46,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ static bfd_reloc_status_type -DEFUN(howto_hvrt16,(abfd, reloc_entry, symbol_in, data, - ignore_input_section, ignore_bfd), - bfd *abfd AND - arelent *reloc_entry AND - asymbol *symbol_in AND - PTR data AND - asection *ignore_input_section AND - bfd *ignore_bfd) +howto_hvrt16 (abfd, reloc_entry, symbol_in, data, + ignore_input_section, ignore_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol_in; + PTR data; + asection *ignore_input_section; + bfd *ignore_bfd; + char **error_message; { long relocation = 0; bfd_vma addr = reloc_entry->address; @@ -71,12 +72,12 @@ DEFUN(howto_hvrt16,(abfd, reloc_entry, symbol_in, data, static reloc_howto_type howto_table[] = { - HOWTO(R_PCR16L,02,1,16,true, 0,false,true,0,"PCR16L",false,0x0000ffff,0x0000ffff,true), - HOWTO(R_PCR26L,02,2,26,true, 0,false,true,0,"PCR26L",false,0x03ffffff,0x03ffffff,true), - HOWTO(R_VRT16, 00,1,16,false,0,false,true,0,"VRT16", false,0x0000ffff,0x0000ffff,true), - HOWTO(R_HVRT16,16,1,16,false,0,false,true,howto_hvrt16,"HVRT16",false,0x0000ffff,0x0000ffff,true), - HOWTO(R_LVRT16,00,1,16,false,0,false,true,0,"LVRT16",false,0x0000ffff,0x0000ffff,true), - HOWTO(R_VRT32, 00,2,32,false,0,false,true,0,"VRT32", false,0xffffffff,0xffffffff,true), + HOWTO(R_PCR16L,02,1,16,true, 0,complain_overflow_signed, 0, "PCR16L",false,0x0000ffff,0x0000ffff,true), + HOWTO(R_PCR26L,02,2,26,true, 0,complain_overflow_signed, 0, "PCR26L",false,0x03ffffff,0x03ffffff,true), + HOWTO(R_VRT16, 00,1,16,false,0,complain_overflow_bitfield, 0, "VRT16", false,0x0000ffff,0x0000ffff,true), + HOWTO(R_HVRT16,16,1,16,false,0,complain_overflow_dont,howto_hvrt16,"HVRT16",false,0x0000ffff,0x0000ffff,true), + HOWTO(R_LVRT16,00,1,16,false,0,complain_overflow_dont, 0, "LVRT16",false,0x0000ffff,0x0000ffff,true), + HOWTO(R_VRT32, 00,2,32,false,0,complain_overflow_bitfield, 0, "VRT32", false,0xffffffff,0xffffffff,true), }; @@ -112,19 +113,19 @@ bfd_target m88kbcs_vec = (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT), + HAS_SYMS | HAS_LOCALS | WP_TEXT), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ '_', /* leading underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ 3, /* default alignment power */ - _do_getb64, _do_getb_signed_64, _do_putb64, - _do_getb32, _do_getb_signed_32, _do_putb32, - _do_getb16, _do_getb_signed_16, _do_putb16, /* data */ - _do_getb64, _do_getb_signed_64, _do_putb64, - _do_getb32, _do_getb_signed_32, _do_putb32, - _do_getb16, _do_getb_signed_16, _do_putb16, /* hdrs */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, _bfd_dummy_target}, @@ -133,6 +134,14 @@ bfd_target m88kbcs_vec = {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(coff), + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE, }; diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index 71a0cd5e5d..7aa2aa1541 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -1776,14 +1776,6 @@ static const struct ecoff_backend_data mips_ecoff_backend_data = /* Relaxing sections is MIPS specific. */ #define ecoff_bfd_relax_section mips_relax_section -/* Core file support is usually traditional (but note that Irix uses - irix-core.c). */ -#define ecoff_core_file_p _bfd_dummy_target -#define ecoff_core_file_failing_command _bfd_dummy_core_file_failing_command -#define ecoff_core_file_failing_signal _bfd_dummy_core_file_failing_signal -#define ecoff_core_file_matches_executable_p \ - _bfd_dummy_core_file_matches_executable_p - bfd_target ecoff_little_vec = { "ecoff-littlemips", /* name */ @@ -1814,7 +1806,16 @@ bfd_target ecoff_little_vec = _bfd_generic_mkarchive, bfd_false}, {bfd_false, ecoff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE (ecoff), + + BFD_JUMP_TABLE_GENERIC (ecoff), + BFD_JUMP_TABLE_COPY (ecoff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (ecoff), + BFD_JUMP_TABLE_SYMBOLS (ecoff), + BFD_JUMP_TABLE_RELOCS (ecoff), + BFD_JUMP_TABLE_WRITE (ecoff), + BFD_JUMP_TABLE_LINK (ecoff), + (PTR) &mips_ecoff_backend_data }; @@ -1841,14 +1842,20 @@ bfd_target ecoff_big_vec = bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - ecoff_archive_p, ecoff_core_file_p}, + ecoff_archive_p, _bfd_dummy_target}, {bfd_false, ecoff_mkobject, /* bfd_set_format */ _bfd_generic_mkarchive, bfd_false}, {bfd_false, ecoff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(ecoff), + + BFD_JUMP_TABLE_GENERIC (ecoff), + BFD_JUMP_TABLE_COPY (ecoff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (ecoff), + BFD_JUMP_TABLE_SYMBOLS (ecoff), + BFD_JUMP_TABLE_RELOCS (ecoff), + BFD_JUMP_TABLE_WRITE (ecoff), + BFD_JUMP_TABLE_LINK (ecoff), + (PTR) &mips_ecoff_backend_data - /* Note that there is another bfd_target just above this one. If - you are adding initializers here, you should be adding them there - as well. */ }; diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index b24c0158c4..0b1ba78fda 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -469,17 +469,9 @@ rs6000coff_reloc_type_lookup (abfd, code) /* Stolen from Damon A. Permezel's `bfd' portation. */ /* ------------------------------------------------------------------------ */ -#undef coff_openr_next_archived_file -#define coff_openr_next_archived_file rs6000coff_openr_next_archived_file - -#undef coff_write_armap -#define coff_write_armap rs6000coff_write_armap - -#undef coff_stat_arch_elt -#define coff_stat_arch_elt rs6000coff_stat_arch_elt - -#undef coff_snarf_ar_hdr -#define coff_snarf_ar_hdr rs6000coff_snarf_ar_hdr +#define rs6000coff_slurp_armap bfd_slurp_coff_armap +#define rs6000coff_slurp_extended_name_table _bfd_slurp_extended_name_table +#define rs6000coff_truncate_arname bfd_dont_truncate_arname #undef coff_mkarchive #define coff_mkarchive rs6000coff_mkarchive @@ -669,7 +661,7 @@ rs6000coff_archive_p (abfd) static int -rs6000coff_stat_arch_elt(abfd, buf) +rs6000coff_generic_stat_arch_elt(abfd, buf) bfd *abfd; struct stat *buf; { @@ -713,6 +705,11 @@ rs6000coff_write_armap (arch, elength, map, orl_count, stridx) #define CORE_FILE_P _bfd_dummy_target +#define coff_core_file_failing_command _bfd_nocore_core_file_failing_command +#define coff_core_file_failing_signal _bfd_nocore_core_file_failing_signal +#define coff_core_file_matches_executable_p \ + _bfd_nocore_core_file_matches_executable_p + #ifdef HOST_AIX #undef CORE_FILE_P #define CORE_FILE_P rs6000coff_core_p @@ -782,6 +779,18 @@ bfd_target rs6000coff_vec = {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(coff), + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (coff), +#ifdef HOST_AIX + BFD_JUMP_TABLE_ARCHIVE (rs6000coff), +#else + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), +#endif + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE, }; diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c index 37f92edd65..00b16025df 100644 --- a/bfd/coff-sh.c +++ b/bfd/coff-sh.c @@ -1,5 +1,5 @@ /* BFD back-end for Hitachi Super-H COFF binaries. - Copyright 1993 Free Software Foundation, Inc. + Copyright 1993, 1994 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . @@ -21,18 +21,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "bfd.h" #include "sysdep.h" -#include "libbfd.h" #include "obstack.h" +#include "libbfd.h" +#include "bfdlink.h" #include "coff/sh.h" #include "coff/internal.h" #include "libcoff.h" -#include "seclet.h" - -extern bfd_error_vector_type bfd_error_vector; static reloc_howto_type r_imm32 = -HOWTO (R_SH_IMM32, 0,2, 32, false, 0, true, - true, 0, "r_imm32", false, 0x0, 0xffffffff, false); +HOWTO (R_SH_IMM32, 0,2, 32, false, 0, + complain_overflow_bitfield, 0, "r_imm32", false, 0x0, 0xffffffff, + false); @@ -45,7 +44,7 @@ coff_SH_select_reloc (howto) return howto->type; } -#define SELECT_RELOC(x,howto) x= coff_SH_select_reloc(howto) +#define SELECT_RELOC(x,howto) x.r_type = coff_SH_select_reloc(howto) #define BADMAG(x) SHBADMAG(x) @@ -64,9 +63,9 @@ coff_SH_select_reloc (howto) */ static void -DEFUN (rtype2howto, (internal, dst), - arelent * internal AND - struct internal_reloc *dst) +rtype2howto (internal, dst) + arelent * internal; + struct internal_reloc *dst; { switch (dst->r_type) { @@ -92,12 +91,12 @@ DEFUN (rtype2howto, (internal, dst), reloc_processing(relent, reloc, symbols, abfd, section) static void -DEFUN (reloc_processing, (relent, reloc, symbols, abfd, section), - arelent * relent AND - struct internal_reloc *reloc AND - asymbol ** symbols AND - bfd * abfd AND - asection * section) +reloc_processing (relent, reloc, symbols, abfd, section) + arelent * relent; + struct internal_reloc *reloc; + asymbol ** symbols; + bfd * abfd; + asection * section; { relent->address = reloc->r_vaddr; rtype2howto (relent, reloc); @@ -117,9 +116,10 @@ DEFUN (reloc_processing, (relent, reloc, symbols, abfd, section), } static void -extra_case (in_abfd, seclet, reloc, data, src_ptr, dst_ptr) +extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) bfd *in_abfd; - bfd_seclet_type *seclet; + struct bfd_link_info *link_info; + struct bfd_link_order *link_order; arelent *reloc; bfd_byte *data; unsigned int *src_ptr; @@ -129,7 +129,8 @@ extra_case (in_abfd, seclet, reloc, data, src_ptr, dst_ptr) { case R_SH_IMM32: { - int v = bfd_coff_reloc16_get_value(reloc, seclet); + int v = bfd_coff_reloc16_get_value(reloc, link_info, + link_order->u.indirect.section); bfd_put_32 (in_abfd, v, data + *dst_ptr); (*dst_ptr) +=4; (*src_ptr)+=4;; @@ -148,7 +149,8 @@ extra_case (in_abfd, seclet, reloc, data, src_ptr, dst_ptr) #undef coff_bfd_get_relocated_section_contents #undef coff_bfd_relax_section -#define coff_bfd_get_relocated_section_contents bfd_coff_reloc16_get_relocated_section_contents +#define coff_bfd_get_relocated_section_contents \ + bfd_coff_reloc16_get_relocated_section_contents #define coff_bfd_relax_section bfd_coff_reloc16_relax_section bfd_target shcoff_vec = @@ -160,19 +162,19 @@ bfd_target shcoff_vec = (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT), + HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ '_', /* leading symbol underscore */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ 2, /* minimum section alignment */ -_do_getb64, _do_getb_signed_64, _do_putb64, - _do_getb32, _do_getb_signed_32, _do_putb32, - _do_getb16, _do_getb_signed_16, _do_putb16, /* data */ -_do_getb64, _do_getb_signed_64, _do_putb64, - _do_getb32, _do_getb_signed_32, _do_putb32, - _do_getb16, _do_getb_signed_16, _do_putb16, /* hdrs */ +bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ +bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, _bfd_dummy_target}, @@ -181,6 +183,14 @@ _do_getb64, _do_getb_signed_64, _do_putb64, {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(coff), + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE, }; diff --git a/bfd/coff-sparc.c b/bfd/coff-sparc.c index 304087bc12..ebd5babdfe 100644 --- a/bfd/coff-sparc.c +++ b/bfd/coff-sparc.c @@ -247,7 +247,15 @@ bfd_target {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE(coff), + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE, }; diff --git a/bfd/coff-we32k.c b/bfd/coff-we32k.c new file mode 100644 index 0000000000..6b05615388 --- /dev/null +++ b/bfd/coff-we32k.c @@ -0,0 +1,109 @@ +/* BFD back-end for we32k COFF files. + Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. + Contributed by Brendan Kehoe (brendan@cs.widener.edu). + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "obstack.h" +#include "coff/we32k.h" +#include "coff/internal.h" +#include "libcoff.h" + + +static reloc_howto_type howto_table[] = +{ + {0}, + {1}, + {2}, + {3}, + {4}, + {5}, + HOWTO(R_DIR32, 0, 2, 32, false, 0,complain_overflow_bitfield, 0, "dir32", true, 0xffffffff,0xffffffff, false), + {7}, + {010}, + {011}, + {012}, + {013}, + {014}, + {015}, + {016}, + HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, 0x000000ff,0x000000ff, false), + HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, 0x0000ffff,0x0000ffff, false), + HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, 0xffffffff,0xffffffff, false), + HOWTO(R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, 0x000000ff,0x000000ff, false), + HOWTO(R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, 0x0000ffff,0x0000ffff, false), + HOWTO(R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, 0xffffffff,0xffffffff, false), +}; + +/* Turn a howto into a reloc nunmber */ + +#define SELECT_RELOC(x,howto) { x.r_type = howto->type; } +#define BADMAG(x) WE32KBADMAG(x) +#define WE32K 1 + +#define RTYPE2HOWTO(cache_ptr, dst) \ + cache_ptr->howto = howto_table + (dst)->r_type; + +#include "coffcode.h" + +#define coff_write_armap bsd_write_armap + +bfd_target we32kcoff_vec = +{ + "coff-we32k", /* name */ + bfd_target_coff_flavour, + true, /* data byte order is big */ + true, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + 0, /* leading underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + + 3, /* minimum alignment power */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + + COFF_SWAP_TABLE, +}; diff --git a/bfd/coff-z8k.c b/bfd/coff-z8k.c index 59ea5e22f3..4681dd4cf9 100644 --- a/bfd/coff-z8k.c +++ b/bfd/coff-z8k.c @@ -1,5 +1,5 @@ /* BFD back-end for Zilog Z800n COFF binaries. - Copyright 1992, 1993 Free Software Foundation, Inc. + Copyright 1992, 1993, 1994 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . @@ -60,7 +60,7 @@ coff_z8k_select_reloc (howto) return howto->type; } -#define SELECT_RELOC(x,howto) x= coff_z8k_select_reloc(howto) +#define SELECT_RELOC(x,howto) x.r_type = coff_z8k_select_reloc(howto) #define BADMAG(x) Z8KBADMAG(x) @@ -80,9 +80,9 @@ coff_z8k_select_reloc (howto) */ static void -DEFUN (rtype2howto, (internal, dst), - arelent * internal AND - struct internal_reloc *dst) +rtype2howto (internal, dst) + arelent * internal; + struct internal_reloc *dst; { switch (dst->r_type) { @@ -120,12 +120,12 @@ DEFUN (rtype2howto, (internal, dst), reloc_processing(relent, reloc, symbols, abfd, section) static void -DEFUN (reloc_processing, (relent, reloc, symbols, abfd, section), - arelent * relent AND - struct internal_reloc *reloc AND - asymbol ** symbols AND - bfd * abfd AND - asection * section) +reloc_processing (relent, reloc, symbols, abfd, section) + arelent * relent; + struct internal_reloc *reloc; + asymbol ** symbols; + bfd * abfd; + asection * section; { relent->address = reloc->r_vaddr; rtype2howto (relent, reloc); @@ -265,6 +265,14 @@ bfd_target z8kcoff_vec = {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE (coff), + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + COFF_SWAP_TABLE, }; diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 3b75ef4865..af015bb769 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -2497,40 +2497,27 @@ static CONST bfd_coff_backend_data bfd_coff_std_swap_table = coff_reloc16_extra_cases, coff_reloc16_estimate }; -#define coff_core_file_failing_command _bfd_dummy_core_file_failing_command -#define coff_core_file_failing_signal _bfd_dummy_core_file_failing_signal -#define coff_core_file_matches_executable_p _bfd_dummy_core_file_matches_executable_p -#define coff_slurp_armap bfd_slurp_coff_armap -#define coff_slurp_extended_name_table _bfd_slurp_extended_name_table -#define coff_truncate_arname bfd_dont_truncate_arname -#define coff_openr_next_archived_file bfd_generic_openr_next_archived_file -#define coff_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define coff_get_section_contents bfd_generic_get_section_contents -#define coff_close_and_cleanup bfd_generic_close_and_cleanup - -#define coff_bfd_debug_info_start bfd_void -#define coff_bfd_debug_info_end bfd_void -#define coff_bfd_debug_info_accumulate \ - (void (*) PARAMS ((bfd *, struct sec *))) bfd_void -#define coff_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define coff_bfd_relax_section bfd_generic_relax_section -#ifndef coff_bfd_reloc_type_lookup -#define coff_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#endif -#define coff_bfd_link_hash_table_create _bfd_generic_link_hash_table_create -#define coff_bfd_link_add_symbols _bfd_generic_link_add_symbols -#define coff_bfd_final_link _bfd_generic_final_link +#define coff_close_and_cleanup _bfd_generic_close_and_cleanup +#define coff_bfd_free_cached_info _bfd_generic_bfd_free_cached_info +#define coff_get_section_contents _bfd_generic_get_section_contents -#ifndef coff_bfd_copy_private_section_data #define coff_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) -#endif -#ifndef coff_bfd_copy_private_bfd_data -#define coff_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) -#endif + _bfd_generic_bfd_copy_private_section_data +#define coff_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data + #ifndef coff_bfd_is_local_label #define coff_bfd_is_local_label bfd_generic_is_local_label #endif -#define coff_bfd_free_cached_info bfd_true + +/* The reloc lookup routine must be supplied by each individual COFF + backend. */ +#ifndef coff_bfd_reloc_type_lookup +#define coff_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup +#endif + +#define coff_bfd_get_relocated_section_contents \ + bfd_generic_get_relocated_section_contents +#define coff_bfd_relax_section bfd_generic_relax_section +#define coff_bfd_link_hash_table_create _bfd_generic_link_hash_table_create +#define coff_bfd_link_add_symbols _bfd_generic_link_add_symbols +#define coff_bfd_final_link _bfd_generic_final_link diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 61833055b8..a58d207453 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -2185,7 +2185,7 @@ ecoff_get_section_contents (abfd, section, location, offset, count) int i; if (strcmp (section->name, REGINFO) != 0) - return bfd_generic_get_section_contents (abfd, section, location, + return _bfd_generic_get_section_contents (abfd, section, location, offset, count); s.gp_value = tdata->gp; diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 5874aabcc7..7a0f37d068 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -3055,8 +3055,8 @@ hppa_elf_get_section_contents (abfd, section, location, offset, count) if (section->output_section == NULL && abfd->direction == read_direction) { - return bfd_generic_get_section_contents (abfd, section, location, - offset, count); + return _bfd_generic_get_section_contents (abfd, section, location, + offset, count); } /* If this is the first time through, and there are output sections, @@ -3098,8 +3098,8 @@ hppa_elf_get_section_contents (abfd, section, location, offset, count) else /* It's not the symbol extension or linker stub sections, use the generic routines. */ - return bfd_generic_get_section_contents (abfd, section, location, - offset, count); + return _bfd_generic_get_section_contents (abfd, section, location, + offset, count); } /* Translate from an elf into field into a howto relocation pointer. */ @@ -3396,7 +3396,7 @@ elf32_hppa_backend_section_from_bfd_section (abfd, hdr, asect, ignored) #define elf_backend_symbol_processing elf32_hppa_backend_symbol_processing #define elf_backend_symbol_table_processing elf32_hppa_backend_symbol_table_processing -#define bfd_generic_get_section_contents hppa_elf_get_section_contents +#define bfd_elf32_get_section_contents hppa_elf_get_section_contents #define bfd_elf32_set_section_contents hppa_elf_set_section_contents #define bfd_elf32_bfd_is_local_label hppa_elf_is_local_label diff --git a/bfd/elf32-target.h b/bfd/elf32-target.h index 951913c99f..ca4db2179b 100644 --- a/bfd/elf32-target.h +++ b/bfd/elf32-target.h @@ -25,25 +25,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ There are two such structures here: one for big-endian machines and one for little-endian machines. */ -/* Archives are generic or unimplemented. */ -#ifndef bfd_elf32_slurp_armap -#define bfd_elf32_slurp_armap bfd_slurp_coff_armap +#define bfd_elf32_close_and_cleanup _bfd_generic_close_and_cleanup +#define bfd_elf32_bfd_free_cached_info _bfd_generic_bfd_free_cached_info +#ifndef bfd_elf32_get_section_contents +#define bfd_elf32_get_section_contents _bfd_generic_get_section_contents #endif -#define bfd_elf32_slurp_extended_name_table _bfd_slurp_extended_name_table -#define bfd_elf32_truncate_arname bfd_dont_truncate_arname -#define bfd_elf32_openr_next_archived_file bfd_generic_openr_next_archived_file -#define bfd_elf32_generic_stat_arch_elt bfd_generic_stat_arch_elt -#ifndef bfd_elf32_write_armap -#define bfd_elf32_write_armap coff_write_armap -#endif - -/* Ordinary section reading and writing */ -#define bfd_elf32_get_section_contents bfd_generic_get_section_contents -#define bfd_elf32_close_and_cleanup bfd_generic_close_and_cleanup -#define bfd_elf32_bfd_debug_info_start bfd_void -#define bfd_elf32_bfd_debug_info_end bfd_void -#define bfd_elf32_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void #define bfd_elf32_bfd_get_relocated_section_contents \ bfd_generic_get_relocated_section_contents #define bfd_elf32_bfd_relax_section bfd_generic_relax_section @@ -71,9 +58,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef bfd_elf32_bfd_is_local_label #define bfd_elf32_bfd_is_local_label bfd_generic_is_local_label #endif -#ifndef bfd_elf32_bfd_free_cached_info -#define bfd_elf32_bfd_free_cached_info bfd_true -#endif #ifndef elf_info_to_howto_rel #define elf_info_to_howto_rel 0 @@ -212,9 +196,14 @@ bfd_target TARGET_BIG_SYM = bfd_false }, - /* Initialize a jump table with the standard macro. All names start with - "elf" */ - JUMP_TABLE(bfd_elf32), + BFD_JUMP_TABLE_GENERIC (bfd_elf32), + BFD_JUMP_TABLE_COPY (bfd_elf32), + BFD_JUMP_TABLE_CORE (bfd_elf32), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (bfd_elf32), + BFD_JUMP_TABLE_RELOCS (bfd_elf32), + BFD_JUMP_TABLE_WRITE (bfd_elf32), + BFD_JUMP_TABLE_LINK (bfd_elf32), /* backend_data: */ (PTR) &elf32_bed, @@ -294,9 +283,14 @@ bfd_target TARGET_LITTLE_SYM = bfd_false }, - /* Initialize a jump table with the standard macro. All names start with - "elf" */ - JUMP_TABLE(bfd_elf32), + BFD_JUMP_TABLE_GENERIC (bfd_elf32), + BFD_JUMP_TABLE_COPY (bfd_elf32), + BFD_JUMP_TABLE_CORE (bfd_elf32), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (bfd_elf32), + BFD_JUMP_TABLE_RELOCS (bfd_elf32), + BFD_JUMP_TABLE_WRITE (bfd_elf32), + BFD_JUMP_TABLE_LINK (bfd_elf32), /* backend_data: */ (PTR) &elf32_bed, diff --git a/bfd/elf64-target.h b/bfd/elf64-target.h index 454f0d50a1..a7b1b272c4 100644 --- a/bfd/elf64-target.h +++ b/bfd/elf64-target.h @@ -25,21 +25,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ There are two such structures here: one for big-endian machines and one for little-endian machines. */ -/* Archives are generic or unimplemented. */ -#ifndef bfd_elf64_slurp_armap -#define bfd_elf64_slurp_armap bfd_slurp_coff_armap +#define bfd_elf64_close_and_cleanup _bfd_generic_close_and_cleanup +#define bfd_elf64_bfd_free_cached_info _bfd_generic_bfd_free_cached_info +#ifndef bfd_elf64_get_section_contents +#define bfd_elf64_get_section_contents _bfd_generic_get_section_contents #endif -#define bfd_elf64_slurp_extended_name_table _bfd_slurp_extended_name_table -#define bfd_elf64_truncate_arname bfd_dont_truncate_arname -#define bfd_elf64_openr_next_archived_file bfd_generic_openr_next_archived_file -#define bfd_elf64_generic_stat_arch_elt bfd_generic_stat_arch_elt -#ifndef bfd_elf64_write_armap -#define bfd_elf64_write_armap coff_write_armap -#endif - -/* Ordinary section reading and writing */ -#define bfd_elf64_get_section_contents bfd_generic_get_section_contents -#define bfd_elf64_close_and_cleanup bfd_generic_close_and_cleanup #define bfd_elf64_bfd_debug_info_start bfd_void #define bfd_elf64_bfd_debug_info_end bfd_void @@ -71,9 +61,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef bfd_elf64_bfd_is_local_label #define bfd_elf64_bfd_is_local_label bfd_generic_is_local_label #endif -#ifndef bfd_elf64_bfd_free_cached_info -#define bfd_elf64_bfd_free_cached_info bfd_true -#endif #ifndef elf_info_to_howto_rel #define elf_info_to_howto_rel 0 @@ -211,9 +198,14 @@ bfd_target TARGET_BIG_SYM = bfd_false }, - /* Initialize a jump table with the standard macro. All names start with - "elf" */ - JUMP_TABLE(bfd_elf64), + BFD_JUMP_TABLE_GENERIC (bfd_elf64), + BFD_JUMP_TABLE_COPY (bfd_elf64), + BFD_JUMP_TABLE_CORE (bfd_elf64), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (bfd_elf64), + BFD_JUMP_TABLE_RELOCS (bfd_elf64), + BFD_JUMP_TABLE_WRITE (bfd_elf64), + BFD_JUMP_TABLE_LINK (bfd_elf64), /* backend_data: */ (PTR) &elf64_bed, @@ -293,9 +285,14 @@ bfd_target TARGET_LITTLE_SYM = bfd_false }, - /* Initialize a jump table with the standard macro. All names start with - "elf" */ - JUMP_TABLE(bfd_elf64), + BFD_JUMP_TABLE_GENERIC (bfd_elf64), + BFD_JUMP_TABLE_COPY (bfd_elf64), + BFD_JUMP_TABLE_CORE (bfd_elf64), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (bfd_elf64), + BFD_JUMP_TABLE_RELOCS (bfd_elf64), + BFD_JUMP_TABLE_WRITE (bfd_elf64), + BFD_JUMP_TABLE_LINK (bfd_elf64), /* backend_data: */ (PTR) &elf64_bed, diff --git a/bfd/hppabsd-core.c b/bfd/hppabsd-core.c index bc99ff5f98..34ca1edb24 100644 --- a/bfd/hppabsd-core.c +++ b/bfd/hppabsd-core.c @@ -227,72 +227,15 @@ hppabsd_core_core_file_matches_executable_p (core_bfd, exec_bfd) } -/* No archive file support via this BFD */ -#define hppabsd_core_openr_next_archived_file \ - bfd_generic_openr_next_archived_file -#define hppabsd_core_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define hppabsd_core_slurp_armap bfd_false -#define hppabsd_core_slurp_extended_name_table bfd_true -#define hppabsd_core_write_armap (boolean (*) PARAMS \ - ((bfd *arch, unsigned int elength, struct orl *map, \ - unsigned int orl_count, int stridx))) bfd_false -#define hppabsd_core_truncate_arname bfd_dont_truncate_arname - -#define hppabsd_core_close_and_cleanup bfd_generic_close_and_cleanup -#define hppabsd_core_set_section_contents (boolean (*) PARAMS \ - ((bfd *abfd, asection *section, PTR data, file_ptr offset, \ - bfd_size_type count))) bfd_generic_set_section_contents -#define hppabsd_core_get_section_contents \ - bfd_generic_get_section_contents -#define hppabsd_core_new_section_hook (boolean (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_true -#define hppabsd_core_get_symtab_upper_bound bfd_0l -#define hppabsd_core_get_symtab (long (*) PARAMS \ - ((bfd *, struct symbol_cache_entry **))) bfd_0l -#define hppabsd_core_get_reloc_upper_bound (long (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_0l -#define hppabsd_core_canonicalize_reloc (long (*) PARAMS \ - ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0l -#define hppabsd_core_print_symbol (void (*) PARAMS \ - ((bfd *, PTR, struct symbol_cache_entry *, \ - bfd_print_symbol_type))) bfd_false -#define hppabsd_core_get_symbol_info (void (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *, \ - symbol_info *))) bfd_false -#define hppabsd_core_get_lineno (alent * (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr -#define hppabsd_core_set_arch_mach (boolean (*) PARAMS \ - ((bfd *, enum bfd_architecture, unsigned long))) bfd_false -#define hppabsd_core_find_nearest_line (boolean (*) PARAMS \ - ((bfd *abfd, struct sec *section, \ - struct symbol_cache_entry **symbols,bfd_vma offset, \ - CONST char **file, CONST char **func, unsigned int *line))) bfd_false -#define hppabsd_core_sizeof_headers (int (*) PARAMS \ - ((bfd *, boolean))) bfd_0 - -#define hppabsd_core_bfd_debug_info_start bfd_void -#define hppabsd_core_bfd_debug_info_end bfd_void -#define hppabsd_core_bfd_debug_info_accumulate (void (*) PARAMS \ - ((bfd *, struct sec *))) bfd_void -#define hppabsd_core_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define hppabsd_core_bfd_relax_section bfd_generic_relax_section -#define hppabsd_core_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define hppabsd_core_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) -#define hppabsd_core_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) -#define hppabsd_core_bfd_link_add_symbols \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define hppabsd_core_bfd_final_link \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define hppabsd_core_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_false) -#define hppabsd_core_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_false) -#define hppabsd_core_bfd_is_local_label \ - ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) -#define hppabsd_core_bfd_free_cached_info bfd_true +#define hppabsd_core_get_symtab_upper_bound \ + _bfd_nosymbols_get_symtab_upper_bound +#define hppabsd_core_get_symtab _bfd_nosymbols_get_symtab +#define hppabsd_core_print_symbol _bfd_nosymbols_print_symbol +#define hppabsd_core_get_symbol_info _bfd_nosymbols_get_symbol_info +#define hppabsd_core_bfd_is_local_label _bfd_nosymbols_bfd_is_local_label +#define hppabsd_core_get_lineno _bfd_nosymbols_get_lineno +#define hppabsd_core_find_nearest_line _bfd_nosymbols_find_nearest_line +#define hppabsd_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol /* If somebody calls any byte-swapping routines, shoot them. */ static void @@ -343,7 +286,15 @@ bfd_target hppabsd_core_vec = bfd_false, bfd_false }, - JUMP_TABLE(hppabsd_core), + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (hppabsd_core), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (hppabsd_core), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + (PTR) 0 /* backend_data */ }; #endif diff --git a/bfd/hpux-core.c b/bfd/hpux-core.c index 81b0e53858..7653b85166 100644 --- a/bfd/hpux-core.c +++ b/bfd/hpux-core.c @@ -214,70 +214,14 @@ hpux_core_core_file_matches_executable_p (core_bfd, exec_bfd) return true; /* FIXME, We have no way of telling at this point */ } -/* No archive file support via this BFD */ -#define hpux_core_openr_next_archived_file bfd_generic_openr_next_archived_file -#define hpux_core_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define hpux_core_slurp_armap bfd_false -#define hpux_core_slurp_extended_name_table bfd_true -#define hpux_core_write_armap (boolean (*) PARAMS \ - ((bfd *arch, unsigned int elength, struct orl *map, \ - unsigned int orl_count, int stridx))) bfd_false -#define hpux_core_truncate_arname bfd_dont_truncate_arname - -#define hpux_core_close_and_cleanup bfd_generic_close_and_cleanup -#define hpux_core_set_section_contents (boolean (*) PARAMS \ - ((bfd *abfd, asection *section, PTR data, file_ptr offset, \ - bfd_size_type count))) bfd_generic_set_section_contents -#define hpux_core_get_section_contents bfd_generic_get_section_contents -#define hpux_core_new_section_hook (boolean (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_true -#define hpux_core_get_symtab_upper_bound bfd_0l -#define hpux_core_get_symtab (long (*) PARAMS \ - ((bfd *, struct symbol_cache_entry **))) bfd_0l -#define hpux_core_get_reloc_upper_bound (long (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_0l -#define hpux_core_canonicalize_reloc (long (*) PARAMS \ - ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0l -#define hpux_core_print_symbol (void (*) PARAMS \ - ((bfd *, PTR, struct symbol_cache_entry *, \ - bfd_print_symbol_type))) bfd_false -#define hpux_core_get_symbol_info (void (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *, \ - symbol_info *))) bfd_false -#define hpux_core_get_lineno (alent * (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr -#define hpux_core_set_arch_mach (boolean (*) PARAMS \ - ((bfd *, enum bfd_architecture, unsigned long))) bfd_false -#define hpux_core_find_nearest_line (boolean (*) PARAMS \ - ((bfd *abfd, struct sec *section, \ - struct symbol_cache_entry **symbols,bfd_vma offset, \ - CONST char **file, CONST char **func, unsigned int *line))) bfd_false -#define hpux_core_sizeof_headers (int (*) PARAMS \ - ((bfd *, boolean))) bfd_0 - -#define hpux_core_bfd_debug_info_start bfd_void -#define hpux_core_bfd_debug_info_end bfd_void -#define hpux_core_bfd_debug_info_accumulate (void (*) PARAMS \ - ((bfd *, struct sec *))) bfd_void -#define hpux_core_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define hpux_core_bfd_relax_section bfd_generic_relax_section -#define hpux_core_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define hpux_core_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) -#define hpux_core_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) -#define hpux_core_bfd_link_add_symbols \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define hpux_core_bfd_final_link \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define hpux_core_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_false) -#define hpux_core_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_false) -#define hpux_core_bfd_is_local_label \ - ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) -#define hpux_core_bfd_free_cached_info bfd_true +#define hpux_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound +#define hpux_core_get_symtab _bfd_nosymbols_get_symtab +#define hpux_core_print_symbol _bfd_nosymbols_print_symbol +#define hpux_core_get_symbol_info _bfd_nosymbols_get_symbol_info +#define hpux_core_bfd_is_local_label _bfd_nosymbols_bfd_is_local_label +#define hpux_core_get_lineno _bfd_nosymbols_get_lineno +#define hpux_core_find_nearest_line _bfd_nosymbols_find_nearest_line +#define hpux_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol /* If somebody calls any byte-swapping routines, shoot them. */ void @@ -326,6 +270,14 @@ bfd_target hpux_core_vec = bfd_false, bfd_false }, - JUMP_TABLE(hpux_core), + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (hpux_core), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (hpux_core), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + (PTR) 0 /* backend_data */ }; diff --git a/bfd/i386os9k.c b/bfd/i386os9k.c index 69a0f2d276..2d5cd15005 100644 --- a/bfd/i386os9k.c +++ b/bfd/i386os9k.c @@ -323,43 +323,19 @@ os9k_sizeof_headers (ignore_abfd, ignore) /***********************************************************************/ -/* We don't have core files. */ -#define aout_32_core_file_failing_command _bfd_dummy_core_file_failing_command -#define aout_32_core_file_failing_signal _bfd_dummy_core_file_failing_signal -#define aout_32_core_file_matches_executable_p \ - _bfd_dummy_core_file_matches_executable_p - -/* We use BSD-Unix generic archive files. */ -#define aout_32_openr_next_archived_file bfd_generic_openr_next_archived_file -#define aout_32_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define aout_32_slurp_armap bfd_slurp_bsd_armap -#define aout_32_slurp_extended_name_table _bfd_slurp_extended_name_table -#define aout_32_write_armap bsd_write_armap -#define aout_32_truncate_arname bfd_bsd_truncate_arname - -/* We override these routines from the usual a.out file routines. */ -#define aout_32_canonicalize_reloc bfd_canonicalize_reloc -#define aout_32_get_reloc_upper_bound bfd_get_reloc_upper_bound -#define aout_32_set_section_contents bfd_set_section_contents -#define aout_32_set_arch_mach bfd_default_set_arch_mach -#define aout_32_sizeof_headers os9k_sizeof_headers - -#define aout_32_bfd_debug_info_start bfd_void -#define aout_32_bfd_debug_info_end bfd_void -#define aout_32_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void - -#define aout_32_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) -#define aout_32_bfd_link_hash_table_create _bfd_generic_link_hash_table_create -#define aout_32_bfd_link_add_symbols _bfd_generic_link_add_symbols -#define aout_32_bfd_final_link _bfd_generic_final_link -#define aout_32_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define aout_32_bfd_relax_section bfd_generic_relax_section -#define aout_32_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS \ -((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) #define aout_32_close_and_cleanup aout_32_bfd_free_cached_info +#define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol + +#define aout_32_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup + +#define os9k_bfd_get_relocated_section_contents \ + bfd_generic_get_relocated_section_contents +#define os9k_bfd_relax_section bfd_generic_relax_section +#define os9k_bfd_link_hash_table_create _bfd_generic_link_hash_table_create +#define os9k_bfd_link_add_symbols _bfd_generic_link_add_symbols +#define os9k_bfd_final_link _bfd_generic_final_link + bfd_target i386os9k_vec = { "i386os9k", /* name */ @@ -386,6 +362,14 @@ bfd_target i386os9k_vec = {bfd_false, bfd_false, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE (aout_32), + BFD_JUMP_TABLE_GENERIC (aout_32), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), + BFD_JUMP_TABLE_SYMBOLS (aout_32), + BFD_JUMP_TABLE_RELOCS (aout_32), + BFD_JUMP_TABLE_WRITE (aout_32), + BFD_JUMP_TABLE_LINK (os9k), + (PTR) 0, }; diff --git a/bfd/ieee.c b/bfd/ieee.c index 775cd5d554..889fbcc896 100644 --- a/bfd/ieee.c +++ b/bfd/ieee.c @@ -3275,6 +3275,9 @@ ieee_sizeof_headers (abfd, x) } +/* The debug info routines are never used. */ +#if 0 + static void ieee_bfd_debug_info_start (abfd) bfd *abfd; @@ -3337,33 +3340,33 @@ ieee_bfd_debug_info_accumulate (abfd, section) } } +#endif + +#define ieee_close_and_cleanup _bfd_generic_close_and_cleanup +#define ieee_bfd_free_cached_info _bfd_generic_bfd_free_cached_info -#define FOO PROTO -#define ieee_core_file_failing_command (char *(*)())(bfd_nullvoidptr) -#define ieee_core_file_failing_signal (int (*)())bfd_0 -#define ieee_core_file_matches_executable_p ( FOO(boolean, (*),(bfd *, bfd *)))bfd_false #define ieee_slurp_armap bfd_true #define ieee_slurp_extended_name_table bfd_true -#define ieee_truncate_arname (void (*)())bfd_nullvoidptr -#define ieee_write_armap (FOO( boolean, (*),(bfd *, unsigned int, struct orl *, unsigned int, int))) bfd_nullvoidptr -#define ieee_get_lineno (struct lineno_cache_entry *(*)())bfd_nullvoidptr -#define ieee_close_and_cleanup bfd_generic_close_and_cleanup -#define ieee_set_arch_mach bfd_default_set_arch_mach -#define ieee_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents +#define ieee_truncate_arname bfd_dont_truncate_arname +#define ieee_write_armap \ + ((boolean (*) \ + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \ + bfd_true) + +#define ieee_bfd_is_local_label bfd_generic_is_local_label +#define ieee_get_lineno _bfd_nosymbols_get_lineno +#define ieee_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol + +#define ieee_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup + +#define ieee_set_arch_mach _bfd_generic_set_arch_mach + +#define ieee_bfd_get_relocated_section_contents \ + bfd_generic_get_relocated_section_contents #define ieee_bfd_relax_section bfd_generic_relax_section -#define ieee_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define ieee_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) #define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols #define ieee_bfd_final_link _bfd_generic_final_link -#define ieee_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) -#define ieee_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) -#define ieee_bfd_is_local_label bfd_generic_is_local_label -#define ieee_bfd_free_cached_info bfd_true /*SUPPRESS 460 */ bfd_target ieee_vec = @@ -3405,6 +3408,15 @@ bfd_target ieee_vec = _bfd_write_archive_contents, bfd_false, }, - JUMP_TABLE (ieee), + + BFD_JUMP_TABLE_GENERIC (ieee), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (ieee), + BFD_JUMP_TABLE_SYMBOLS (ieee), + BFD_JUMP_TABLE_RELOCS (ieee), + BFD_JUMP_TABLE_WRITE (ieee), + BFD_JUMP_TABLE_LINK (ieee), + (PTR) 0 }; diff --git a/bfd/irix-core.c b/bfd/irix-core.c index 0a578cf37b..ff7e56b4fc 100644 --- a/bfd/irix-core.c +++ b/bfd/irix-core.c @@ -189,70 +189,14 @@ irix_core_make_empty_symbol (abfd) return new; } -#define irix_core_openr_next_archived_file bfd_generic_openr_next_archived_file -#define irix_core_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define irix_core_slurp_armap bfd_false -#define irix_core_slurp_extended_name_table bfd_true -#define irix_core_write_armap (boolean (*) PARAMS \ - ((bfd *arch, unsigned int elength, struct orl *map, \ - unsigned int orl_count, int stridx))) bfd_false -#define irix_core_truncate_arname bfd_dont_truncate_arname - -#define irix_core_close_and_cleanup bfd_generic_close_and_cleanup -#define irix_core_set_section_contents (boolean (*) PARAMS \ - ((bfd *abfd, asection *section, PTR data, file_ptr offset, \ - bfd_size_type count))) bfd_generic_set_section_contents -#define irix_core_get_section_contents bfd_generic_get_section_contents -#define irix_core_new_section_hook (boolean (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_true -#define irix_core_get_symtab_upper_bound bfd_0l -#define irix_core_get_symtab (long (*) PARAMS \ - ((bfd *, struct symbol_cache_entry **))) bfd_0l -#define irix_core_get_reloc_upper_bound (long (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_0l -#define irix_core_canonicalize_reloc (long (*) PARAMS \ - ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0l -#define irix_core_print_symbol (void (*) PARAMS \ - ((bfd *, PTR, struct symbol_cache_entry *, \ - bfd_print_symbol_type))) bfd_false -#define irix_core_get_symbol_info (void (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *, \ - symbol_info *))) bfd_false -#define irix_core_get_lineno (alent * (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr -#define irix_core_set_arch_mach (boolean (*) PARAMS \ - ((bfd *, enum bfd_architecture, unsigned long))) bfd_false -#define irix_core_find_nearest_line (boolean (*) PARAMS \ - ((bfd *abfd, struct sec *section, \ - struct symbol_cache_entry **symbols,bfd_vma offset, \ - CONST char **file, CONST char **func, unsigned int *line))) bfd_false -#define irix_core_sizeof_headers (int (*) PARAMS \ - ((bfd *, boolean))) bfd_0 - -#define irix_core_bfd_debug_info_start bfd_void -#define irix_core_bfd_debug_info_end bfd_void -#define irix_core_bfd_debug_info_accumulate (void (*) PARAMS \ - ((bfd *, struct sec *))) bfd_void -#define irix_core_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define irix_core_bfd_relax_section bfd_generic_relax_section -#define irix_core_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define irix_core_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) -#define irix_core_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) -#define irix_core_bfd_link_add_symbols \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define irix_core_bfd_final_link \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) - -#define irix_core_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_false) -#define irix_core_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_false) -#define irix_core_bfd_is_local_label \ - ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) -#define irix_core_bfd_free_cached_info bfd_true +#define irix_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound +#define irix_core_get_symtab _bfd_nosymbols_get_symtab +#define irix_core_print_symbol _bfd_nosymbols_print_symbol +#define irix_core_get_symbol_info _bfd_nosymbols_get_symbol_info +#define irix_core_bfd_is_local_label _bfd_nosymbols_bfd_is_local_label +#define irix_core_get_lineno _bfd_nosymbols_get_lineno +#define irix_core_find_nearest_line _bfd_nosymbols_find_nearest_line +#define irix_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol /* If somebody calls any byte-swapping routines, shoot them. */ void @@ -301,7 +245,15 @@ bfd_target irix_core_vec = bfd_false, bfd_false }, - JUMP_TABLE(irix_core), + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (irix_core), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (irix_core), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + (PTR) 0 /* backend_data */ }; diff --git a/bfd/libaout.h b/bfd/libaout.h index 9a3cecc461..0348463cdf 100644 --- a/bfd/libaout.h +++ b/bfd/libaout.h @@ -398,21 +398,13 @@ aout_stab_name PARAMS ((int code)); /* A.out uses the generic versions of these routines... */ -#define aout_32_get_section_contents bfd_generic_get_section_contents +#define aout_32_get_section_contents _bfd_generic_get_section_contents -#define aout_64_get_section_contents bfd_generic_get_section_contents +#define aout_64_get_section_contents _bfd_generic_get_section_contents #ifndef NO_WRITE_HEADER_KLUDGE #define NO_WRITE_HEADER_KLUDGE 0 #endif -#ifndef aout_32_bfd_copy_private_section_data -#define aout_32_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) -#endif -#ifndef aout_32_bfd_copy_private_bfd_data -#define aout_32_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) -#endif #ifndef aout_32_bfd_is_local_label #define aout_32_bfd_is_local_label bfd_generic_is_local_label #endif diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index b0a0f5fc8c..a4712c9c69 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -118,14 +118,10 @@ PTR bfd_nullvoidptr PARAMS ((bfd *ignore)); int bfd_0 PARAMS ((bfd *ignore)); unsigned int bfd_0u PARAMS ((bfd *ignore)); long bfd_0l PARAMS ((bfd *ignore)); +long _bfd_n1 PARAMS ((bfd *ignore)); void bfd_void PARAMS ((bfd *ignore)); bfd * _bfd_new_bfd_contained_in PARAMS ((bfd *)); -boolean _bfd_dummy_new_section_hook PARAMS ((bfd *ignore, asection *newsect)); -char * _bfd_dummy_core_file_failing_command PARAMS ((bfd *abfd)); -int _bfd_dummy_core_file_failing_signal PARAMS ((bfd *abfd)); -boolean _bfd_dummy_core_file_matches_executable_p PARAMS ((bfd *core_bfd, - bfd *exec_bfd)); bfd_target * _bfd_dummy_target PARAMS ((bfd *abfd)); void bfd_dont_truncate_arname PARAMS ((bfd *abfd, CONST char *filename, @@ -146,13 +142,146 @@ bfd * bfd_generic_openr_next_archived_file PARAMS ((bfd *archive, int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); -boolean bfd_generic_get_section_contents PARAMS ((bfd *abfd, sec_ptr section, - PTR location, file_ptr offset, - bfd_size_type count)); - -boolean bfd_generic_set_section_contents PARAMS ((bfd *abfd, sec_ptr section, - PTR location, file_ptr offset, - bfd_size_type count)); + +/* Generic routines to use for BFD_JUMP_TABLE_GENERIC. Use + BFD_JUMP_TABLE_GENERIC (_bfd_generic). */ + +#define _bfd_generic_close_and_cleanup bfd_true +#define _bfd_generic_bfd_free_cached_info bfd_true +#define _bfd_generic_new_section_hook \ + ((boolean (*) PARAMS ((bfd *, asection *))) bfd_true) +extern boolean _bfd_generic_get_section_contents + PARAMS ((bfd *, asection *, PTR location, file_ptr offset, + bfd_size_type count)); + +/* Generic routines to use for BFD_JUMP_TABLE_COPY. Use + BFD_JUMP_TABLE_COPY (_bfd_generic). */ + +#define _bfd_generic_bfd_copy_private_bfd_data \ + ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) +#define _bfd_generic_bfd_copy_private_section_data \ + ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) + +/* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file + support. Use BFD_JUMP_TABLE_CORE (_bfd_nocore). */ + +extern char *_bfd_nocore_core_file_failing_command PARAMS ((bfd *)); +extern int _bfd_nocore_core_file_failing_signal PARAMS ((bfd *)); +extern boolean _bfd_nocore_core_file_matches_executable_p + PARAMS ((bfd *, bfd *)); + +/* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive + file support. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive). */ + +#define _bfd_noarchive_slurp_armap bfd_false +#define _bfd_noarchive_slurp_extended_name_table bfd_false +#define _bfd_noarchive_truncate_arname \ + ((void (*) PARAMS ((bfd *, const char *, char *))) bfd_void) +#define _bfd_noarchive_write_armap \ + ((boolean (*) \ + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \ + bfd_false) +#define _bfd_noarchive_openr_next_archived_file \ + ((bfd *(*) PARAMS ((bfd *, bfd *))) bfd_nullvoidptr) +#define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt + +/* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get BSD style + archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd). */ + +#define _bfd_archive_bsd_slurp_armap bfd_slurp_bsd_armap +#define _bfd_archive_bsd_slurp_extended_name_table \ + _bfd_slurp_extended_name_table +#define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname +#define _bfd_archive_bsd_write_armap bsd_write_armap +#define _bfd_archive_bsd_openr_next_archived_file \ + bfd_generic_openr_next_archived_file +#define _bfd_archive_bsd_generic_stat_arch_elt \ + bfd_generic_stat_arch_elt + +/* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get COFF style + archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff). */ + +#define _bfd_archive_coff_slurp_armap bfd_slurp_coff_armap +#define _bfd_archive_coff_slurp_extended_name_table \ + _bfd_slurp_extended_name_table +#define _bfd_archive_coff_truncate_arname bfd_dont_truncate_arname +#define _bfd_archive_coff_write_armap coff_write_armap +#define _bfd_archive_coff_openr_next_archived_file \ + bfd_generic_openr_next_archived_file +#define _bfd_archive_coff_generic_stat_arch_elt \ + bfd_generic_stat_arch_elt + +/* 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_get_symtab \ + ((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1) +#define _bfd_nosymbols_make_empty_symbol \ + ((asymbol *(*) PARAMS ((bfd *))) bfd_nullvoidptr) +#define _bfd_nosymbols_print_symbol \ + ((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void) +#define _bfd_nosymbols_get_symbol_info \ + ((void (*) PARAMS ((bfd *, asymbol *, symbol_info *))) bfd_void) +#define _bfd_nosymbols_bfd_is_local_label \ + ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) +#define _bfd_nosymbols_get_lineno \ + ((alent *(*) PARAMS ((bfd *, asymbol *))) bfd_nullvoidptr) +#define _bfd_nosymbols_find_nearest_line \ + ((boolean (*) \ + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, \ + const char **, unsigned int *))) \ + bfd_false) +#define _bfd_nosymbols_bfd_make_debug_symbol \ + ((asymbol *(*) PARAMS ((bfd *, PTR, unsigned long))) bfd_nullvoidptr) + +/* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc + support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ + +#define _bfd_norelocs_get_reloc_upper_bound \ + ((long (*) PARAMS ((bfd *, asection *))) _bfd_n1) +#define _bfd_norelocs_canonicalize_reloc \ + ((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) _bfd_n1) +#define _bfd_norelocs_bfd_reloc_type_lookup \ + ((const reloc_howto_type *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) \ + bfd_nullvoidptr) + +/* 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 \ + ((boolean (*) PARAMS ((bfd *, enum bfd_architecture, unsigned long))) \ + bfd_false) +#define _bfd_nowrite_set_section_contents \ + ((boolean (*) PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type))) \ + bfd_false) + +/* Generic routines to use for BFD_JUMP_TABLE_WRITE. Use + BFD_JUMP_TABLE_WRITE (_bfd_generic). */ + +#define _bfd_generic_set_arch_mach bfd_default_set_arch_mach +extern boolean _bfd_generic_set_section_contents + PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); + +/* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not + support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ + +#define _bfd_nolink_sizeof_headers ((int (*) PARAMS ((bfd *, boolean))) bfd_0) +#define _bfd_nolink_bfd_get_relocated_section_contents \ + ((bfd_byte *(*) \ + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, \ + bfd_byte *, boolean, asymbol **))) \ + bfd_nullvoidptr) +#define _bfd_nolink_bfd_relax_section \ + ((boolean (*) \ + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *))) \ + bfd_false) +#define _bfd_nolink_bfd_link_hash_table_create \ + ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) +#define _bfd_nolink_bfd_link_add_symbols \ + ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) +#define _bfd_nolink_bfd_final_link \ + ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) /* Generic routine to determine of the given symbol is a local label. */ @@ -259,9 +388,6 @@ extern bfd *bfd_last_cache; #define stoi(x) ((int)(x)) #endif -/* Generic routine for close_and_cleanup is really just bfd_true. */ -#define bfd_generic_close_and_cleanup bfd_true - /* List of supported target vectors, and the default vector (if bfd_default_vector[0] is NULL, there is no default). */ extern bfd_target *bfd_target_vector[]; diff --git a/bfd/libbfd.c b/bfd/libbfd.c index 93522d9cd3..2925754cbd 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -32,23 +32,21 @@ DESCRIPTION completeness. */ -/*ARGSUSED*/ -boolean -_bfd_dummy_new_section_hook (ignore, ignore_newsect) - bfd *ignore; - asection *ignore_newsect; -{ - return true; -} +/* A routine which is used in target vectors for unsupported + operations. */ /*ARGSUSED*/ boolean bfd_false (ignore) bfd *ignore; { + 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. */ + /*ARGSUSED*/ boolean bfd_true (ignore) @@ -57,12 +55,16 @@ bfd_true (ignore) return true; } +/* A routine which is used in target vectors for unsupported + operations which return a pointer value. */ + /*ARGSUSED*/ PTR bfd_nullvoidptr (ignore) bfd *ignore; { - return (PTR)NULL; + bfd_set_error (bfd_error_invalid_operation); + return NULL; } /*ARGSUSED*/ @@ -89,6 +91,18 @@ bfd_0l (ignore) return 0; } +/* A routine which is used in target vectors for unsupported + operations which return -1 on error. */ + +/*ARGSUSED*/ +long +_bfd_n1 (ignore_abfd) + bfd *ignore_abfd; +{ + bfd_set_error (bfd_error_invalid_operation); + return -1; +} + /*ARGSUSED*/ void bfd_void (ignore) @@ -98,7 +112,7 @@ bfd_void (ignore) /*ARGSUSED*/ boolean -_bfd_dummy_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd) +_bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd) bfd *ignore_core_bfd; bfd *ignore_exec_bfd; { @@ -106,21 +120,27 @@ _bfd_dummy_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd) return false; } -/* of course you can't initialize a function to be the same as another, grr */ +/* Routine to handle core_file_failing_command entry point for targets + without core file support. */ /*ARGSUSED*/ char * -_bfd_dummy_core_file_failing_command (ignore_abfd) +_bfd_nocore_core_file_failing_command (ignore_abfd) bfd *ignore_abfd; { + bfd_set_error (bfd_error_invalid_operation); return (char *)NULL; } +/* Routine to handle core_file_failing_signal entry point for targets + without core file support. */ + /*ARGSUSED*/ int -_bfd_dummy_core_file_failing_signal (ignore_abfd) +_bfd_nocore_core_file_failing_signal (ignore_abfd) bfd *ignore_abfd; { + bfd_set_error (bfd_error_invalid_operation); return 0; } @@ -787,7 +807,7 @@ bfd_putl64 (data, addr) /* Default implementation */ boolean -bfd_generic_get_section_contents (abfd, section, location, offset, count) +_bfd_generic_get_section_contents (abfd, section, location, offset, count) bfd *abfd; sec_ptr section; PTR location; @@ -808,7 +828,7 @@ bfd_generic_get_section_contents (abfd, section, location, offset, count) in read-write files, though. See other set_section_contents functions to see why it doesn't work for new sections. */ boolean -bfd_generic_set_section_contents (abfd, section, location, offset, count) +_bfd_generic_set_section_contents (abfd, section, location, offset, count) bfd *abfd; sec_ptr section; PTR location; diff --git a/bfd/libbfd.h b/bfd/libbfd.h index a31db2ee81..2c2ab3614d 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -118,14 +118,10 @@ PTR bfd_nullvoidptr PARAMS ((bfd *ignore)); int bfd_0 PARAMS ((bfd *ignore)); unsigned int bfd_0u PARAMS ((bfd *ignore)); long bfd_0l PARAMS ((bfd *ignore)); +long _bfd_n1 PARAMS ((bfd *ignore)); void bfd_void PARAMS ((bfd *ignore)); bfd * _bfd_new_bfd_contained_in PARAMS ((bfd *)); -boolean _bfd_dummy_new_section_hook PARAMS ((bfd *ignore, asection *newsect)); -char * _bfd_dummy_core_file_failing_command PARAMS ((bfd *abfd)); -int _bfd_dummy_core_file_failing_signal PARAMS ((bfd *abfd)); -boolean _bfd_dummy_core_file_matches_executable_p PARAMS ((bfd *core_bfd, - bfd *exec_bfd)); bfd_target * _bfd_dummy_target PARAMS ((bfd *abfd)); void bfd_dont_truncate_arname PARAMS ((bfd *abfd, CONST char *filename, @@ -146,13 +142,146 @@ bfd * bfd_generic_openr_next_archived_file PARAMS ((bfd *archive, int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); -boolean bfd_generic_get_section_contents PARAMS ((bfd *abfd, sec_ptr section, - PTR location, file_ptr offset, - bfd_size_type count)); - -boolean bfd_generic_set_section_contents PARAMS ((bfd *abfd, sec_ptr section, - PTR location, file_ptr offset, - bfd_size_type count)); + +/* Generic routines to use for BFD_JUMP_TABLE_GENERIC. Use + BFD_JUMP_TABLE_GENERIC (_bfd_generic). */ + +#define _bfd_generic_close_and_cleanup bfd_true +#define _bfd_generic_bfd_free_cached_info bfd_true +#define _bfd_generic_new_section_hook \ + ((boolean (*) PARAMS ((bfd *, asection *))) bfd_true) +extern boolean _bfd_generic_get_section_contents + PARAMS ((bfd *, asection *, PTR location, file_ptr offset, + bfd_size_type count)); + +/* Generic routines to use for BFD_JUMP_TABLE_COPY. Use + BFD_JUMP_TABLE_COPY (_bfd_generic). */ + +#define _bfd_generic_bfd_copy_private_bfd_data \ + ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) +#define _bfd_generic_bfd_copy_private_section_data \ + ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) + +/* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file + support. Use BFD_JUMP_TABLE_CORE (_bfd_nocore). */ + +extern char *_bfd_nocore_core_file_failing_command PARAMS ((bfd *)); +extern int _bfd_nocore_core_file_failing_signal PARAMS ((bfd *)); +extern boolean _bfd_nocore_core_file_matches_executable_p + PARAMS ((bfd *, bfd *)); + +/* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive + file support. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive). */ + +#define _bfd_noarchive_slurp_armap bfd_false +#define _bfd_noarchive_slurp_extended_name_table bfd_false +#define _bfd_noarchive_truncate_arname \ + ((void (*) PARAMS ((bfd *, const char *, char *))) bfd_void) +#define _bfd_noarchive_write_armap \ + ((boolean (*) \ + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \ + bfd_false) +#define _bfd_noarchive_openr_next_archived_file \ + ((bfd *(*) PARAMS ((bfd *, bfd *))) bfd_nullvoidptr) +#define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt + +/* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get BSD style + archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd). */ + +#define _bfd_archive_bsd_slurp_armap bfd_slurp_bsd_armap +#define _bfd_archive_bsd_slurp_extended_name_table \ + _bfd_slurp_extended_name_table +#define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname +#define _bfd_archive_bsd_write_armap bsd_write_armap +#define _bfd_archive_bsd_openr_next_archived_file \ + bfd_generic_openr_next_archived_file +#define _bfd_archive_bsd_generic_stat_arch_elt \ + bfd_generic_stat_arch_elt + +/* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get COFF style + archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff). */ + +#define _bfd_archive_coff_slurp_armap bfd_slurp_coff_armap +#define _bfd_archive_coff_slurp_extended_name_table \ + _bfd_slurp_extended_name_table +#define _bfd_archive_coff_truncate_arname bfd_dont_truncate_arname +#define _bfd_archive_coff_write_armap coff_write_armap +#define _bfd_archive_coff_openr_next_archived_file \ + bfd_generic_openr_next_archived_file +#define _bfd_archive_coff_generic_stat_arch_elt \ + bfd_generic_stat_arch_elt + +/* 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_get_symtab \ + ((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1) +#define _bfd_nosymbols_make_empty_symbol \ + ((asymbol *(*) PARAMS ((bfd *))) bfd_nullvoidptr) +#define _bfd_nosymbols_print_symbol \ + ((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void) +#define _bfd_nosymbols_get_symbol_info \ + ((void (*) PARAMS ((bfd *, asymbol *, symbol_info *))) bfd_void) +#define _bfd_nosymbols_bfd_is_local_label \ + ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) +#define _bfd_nosymbols_get_lineno \ + ((alent *(*) PARAMS ((bfd *, asymbol *))) bfd_nullvoidptr) +#define _bfd_nosymbols_find_nearest_line \ + ((boolean (*) \ + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, \ + const char **, unsigned int *))) \ + bfd_false) +#define _bfd_nosymbols_bfd_make_debug_symbol \ + ((asymbol *(*) PARAMS ((bfd *, PTR, unsigned long))) bfd_nullvoidptr) + +/* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc + support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ + +#define _bfd_norelocs_get_reloc_upper_bound \ + ((long (*) PARAMS ((bfd *, asection *))) _bfd_n1) +#define _bfd_norelocs_canonicalize_reloc \ + ((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) _bfd_n1) +#define _bfd_norelocs_bfd_reloc_type_lookup \ + ((const reloc_howto_type *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) \ + bfd_nullvoidptr) + +/* 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 \ + ((boolean (*) PARAMS ((bfd *, enum bfd_architecture, unsigned long))) \ + bfd_false) +#define _bfd_nowrite_set_section_contents \ + ((boolean (*) PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type))) \ + bfd_false) + +/* Generic routines to use for BFD_JUMP_TABLE_WRITE. Use + BFD_JUMP_TABLE_WRITE (_bfd_generic). */ + +#define _bfd_generic_set_arch_mach bfd_default_set_arch_mach +extern boolean _bfd_generic_set_section_contents + PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); + +/* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not + support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ + +#define _bfd_nolink_sizeof_headers ((int (*) PARAMS ((bfd *, boolean))) bfd_0) +#define _bfd_nolink_bfd_get_relocated_section_contents \ + ((bfd_byte *(*) \ + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, \ + bfd_byte *, boolean, asymbol **))) \ + bfd_nullvoidptr) +#define _bfd_nolink_bfd_relax_section \ + ((boolean (*) \ + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *))) \ + bfd_false) +#define _bfd_nolink_bfd_link_hash_table_create \ + ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) +#define _bfd_nolink_bfd_link_add_symbols \ + ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) +#define _bfd_nolink_bfd_final_link \ + ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) /* Generic routine to determine of the given symbol is a local label. */ @@ -259,9 +388,6 @@ extern bfd *bfd_last_cache; #define stoi(x) ((int)(x)) #endif -/* Generic routine for close_and_cleanup is really just bfd_true. */ -#define bfd_generic_close_and_cleanup bfd_true - /* List of supported target vectors, and the default vector (if bfd_default_vector[0] is NULL, there is no default). */ extern bfd_target *bfd_target_vector[]; diff --git a/bfd/libecoff.h b/bfd/libecoff.h index cbd9347cc7..f4b8f5eea2 100644 --- a/bfd/libecoff.h +++ b/bfd/libecoff.h @@ -216,19 +216,45 @@ extern boolean ecoff_mkobject PARAMS ((bfd *)); extern boolean ecoff_slurp_symbolic_info PARAMS ((bfd *)); /* Generic ECOFF BFD backend vectors. */ -extern asymbol *ecoff_make_empty_symbol PARAMS ((bfd *abfd)); + +extern boolean ecoff_write_object_contents PARAMS ((bfd *abfd)); +extern bfd_target *ecoff_archive_p PARAMS ((bfd *abfd)); + +#define ecoff_close_and_cleanup _bfd_generic_close_and_cleanup +#define ecoff_bfd_free_cached_info _bfd_generic_bfd_free_cached_info +extern boolean ecoff_new_section_hook PARAMS ((bfd *abfd, + asection *section)); +extern boolean ecoff_get_section_contents PARAMS ((bfd *abfd, + asection *section, + PTR location, + file_ptr offset, + bfd_size_type count)); + +#define ecoff_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data +#define ecoff_bfd_copy_private_section_data \ + _bfd_generic_bfd_copy_private_section_data + +extern boolean ecoff_slurp_armap PARAMS ((bfd *abfd)); +#define ecoff_slurp_extended_name_table _bfd_slurp_extended_name_table +#define ecoff_truncate_arname bfd_dont_truncate_arname +extern boolean ecoff_write_armap PARAMS ((bfd *abfd, unsigned int elength, + struct orl *map, + unsigned int orl_count, + int stridx)); +#define ecoff_openr_next_archived_file bfd_generic_openr_next_archived_file +#define ecoff_generic_stat_arch_elt bfd_generic_stat_arch_elt + extern long ecoff_get_symtab_upper_bound PARAMS ((bfd *abfd)); extern long ecoff_get_symtab PARAMS ((bfd *abfd, asymbol **alocation)); -extern void ecoff_get_symbol_info PARAMS ((bfd *abfd, - asymbol *symbol, - symbol_info *ret)); +extern asymbol *ecoff_make_empty_symbol PARAMS ((bfd *abfd)); extern void ecoff_print_symbol PARAMS ((bfd *abfd, PTR filep, asymbol *symbol, bfd_print_symbol_type how)); -extern long ecoff_canonicalize_reloc PARAMS ((bfd *abfd, - asection *section, - arelent **relptr, - asymbol **symbols)); +extern void ecoff_get_symbol_info PARAMS ((bfd *abfd, + asymbol *symbol, + symbol_info *ret)); +#define ecoff_bfd_is_local_label bfd_generic_is_local_label +#define ecoff_get_lineno _bfd_nosymbols_get_lineno extern boolean ecoff_find_nearest_line PARAMS ((bfd *abfd, asection *section, asymbol **symbols, @@ -236,58 +262,37 @@ extern boolean ecoff_find_nearest_line PARAMS ((bfd *abfd, CONST char **filename_ptr, CONST char **fnname_ptr, unsigned int *retline_ptr)); +#define ecoff_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol + +#define ecoff_get_reloc_upper_bound coff_get_reloc_upper_bound +extern long ecoff_canonicalize_reloc PARAMS ((bfd *abfd, + asection *section, + arelent **relptr, + asymbol **symbols)); +/* ecoff_bfd_reloc_type_lookup defined by backend. */ + extern boolean ecoff_set_arch_mach PARAMS ((bfd *abfd, enum bfd_architecture arch, unsigned long machine)); -extern int ecoff_sizeof_headers PARAMS ((bfd *abfd, boolean reloc)); extern boolean ecoff_set_section_contents PARAMS ((bfd *abfd, asection *section, PTR location, file_ptr offset, bfd_size_type count)); -extern boolean ecoff_get_section_contents PARAMS ((bfd *abfd, - asection *section, - PTR location, - file_ptr offset, - bfd_size_type count)); -extern boolean ecoff_write_object_contents PARAMS ((bfd *abfd)); -extern boolean ecoff_slurp_armap PARAMS ((bfd *abfd)); -extern boolean ecoff_write_armap PARAMS ((bfd *abfd, unsigned int elength, - struct orl *map, - unsigned int orl_count, - int stridx)); -#define ecoff_slurp_extended_name_table _bfd_slurp_extended_name_table -extern bfd_target *ecoff_archive_p PARAMS ((bfd *abfd)); -#define ecoff_get_lineno \ - ((alent *(*) PARAMS ((bfd *, asymbol *))) bfd_nullvoidptr) -#define ecoff_truncate_arname bfd_dont_truncate_arname -#define ecoff_openr_next_archived_file bfd_generic_openr_next_archived_file -#define ecoff_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define ecoff_get_reloc_upper_bound coff_get_reloc_upper_bound -#define ecoff_close_and_cleanup bfd_generic_close_and_cleanup -#define ecoff_bfd_debug_info_start bfd_void -#define ecoff_bfd_debug_info_end bfd_void -#define ecoff_bfd_debug_info_accumulate \ - ((void (*) PARAMS ((bfd *, struct sec *))) bfd_void) -#define ecoff_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) + +extern int ecoff_sizeof_headers PARAMS ((bfd *abfd, boolean reloc)); +/* ecoff_bfd_get_relocated_section_contents defined by backend. */ +/* ecoff_bfd_relax_section defined by backend. */ extern struct bfd_link_hash_table *ecoff_bfd_link_hash_table_create PARAMS ((bfd *)); extern boolean ecoff_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); extern boolean ecoff_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); -#define ecoff_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) -#define ecoff_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) -#define ecoff_bfd_is_local_label bfd_generic_is_local_label -#define ecoff_bfd_free_cached_info bfd_true /* Hook functions for the generic COFF section reading code. */ + extern PTR ecoff_mkobject_hook PARAMS ((bfd *, PTR filehdr, PTR aouthdr)); extern asection *ecoff_make_section_hook PARAMS ((bfd *abfd, char *name)); -extern boolean ecoff_new_section_hook PARAMS ((bfd *abfd, - asection *section)); #define ecoff_set_alignment_hook \ ((void (*) PARAMS ((bfd *, asection *, PTR))) bfd_void) extern boolean ecoff_set_arch_mach_hook PARAMS ((bfd *abfd, PTR filehdr)); diff --git a/bfd/mipsbsd.c b/bfd/mipsbsd.c index 0b6424dc56..72261fbad6 100644 --- a/bfd/mipsbsd.c +++ b/bfd/mipsbsd.c @@ -350,7 +350,16 @@ bfd_target aout_mips_little_vec = _bfd_generic_mkarchive, bfd_false}, {bfd_false, MY_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE (MY), + + BFD_JUMP_TABLE_GENERIC (MY), + BFD_JUMP_TABLE_COPY (MY), + BFD_JUMP_TABLE_CORE (MY), + BFD_JUMP_TABLE_ARCHIVE (MY), + BFD_JUMP_TABLE_SYMBOLS (MY), + BFD_JUMP_TABLE_RELOCS (MY), + BFD_JUMP_TABLE_WRITE (MY), + BFD_JUMP_TABLE_LINK (MY), + (PTR) MY_backend_data, }; @@ -380,6 +389,15 @@ bfd_target aout_mips_big_vec = _bfd_generic_mkarchive, bfd_false}, {bfd_false, MY_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - JUMP_TABLE (MY), + + BFD_JUMP_TABLE_GENERIC (MY), + BFD_JUMP_TABLE_COPY (MY), + BFD_JUMP_TABLE_CORE (MY), + BFD_JUMP_TABLE_ARCHIVE (MY), + BFD_JUMP_TABLE_SYMBOLS (MY), + BFD_JUMP_TABLE_RELOCS (MY), + BFD_JUMP_TABLE_WRITE (MY), + BFD_JUMP_TABLE_LINK (MY), + (PTR) MY_backend_data, }; diff --git a/bfd/nlm-target.h b/bfd/nlm-target.h index 4cbc8a72a9..7b4b8932a6 100644 --- a/bfd/nlm-target.h +++ b/bfd/nlm-target.h @@ -20,79 +20,30 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define nlm_core_file_p \ ((bfd_target *(*) PARAMS ((bfd *))) bfd_nullvoidptr) -/* The JUMP_TABLE macro is used in the target structure to get names - for all the functions. We use JUMP_TABLE(nlm) to get a prefix of - nlm for all the functions. Here we redefine those names. Many of - the functions are the same for any NLM target. The others are - defined in terms of the nlmNAME macro. */ - -#define nlm_core_file_failing_command \ - _bfd_dummy_core_file_failing_command -#define nlm_core_file_failing_signal \ - _bfd_dummy_core_file_failing_signal -#define nlm_core_file_matches_executable_p \ - _bfd_dummy_core_file_matches_executable_p -#define nlm_slurp_armap bfd_slurp_coff_armap -#define nlm_slurp_extended_name_table \ - _bfd_slurp_extended_name_table -#define nlm_truncate_arname bfd_dont_truncate_arname -#define nlm_write_armap coff_write_armap -#define nlm_close_and_cleanup bfd_generic_close_and_cleanup -#define nlm_set_section_contents \ - nlmNAME(set_section_contents) -#define nlm_get_section_contents \ - bfd_generic_get_section_contents -#define nlm_new_section_hook _bfd_dummy_new_section_hook -#define nlm_get_symtab_upper_bound \ - nlmNAME(get_symtab_upper_bound) -#define nlm_get_symtab nlmNAME(get_symtab) -#define nlm_get_reloc_upper_bound \ - nlmNAME(get_reloc_upper_bound) -#define nlm_canonicalize_reloc nlmNAME(canonicalize_reloc) -#define nlm_make_empty_symbol nlmNAME(make_empty_symbol) -#define nlm_print_symbol nlmNAME(print_symbol) -#define nlm_get_symbol_info nlmNAME(get_symbol_info) -#define nlm_get_lineno ((alent * (*) PARAMS ((bfd *, asymbol *))) \ - bfd_false) -/* We use the generic function nlm_set_arch_mach. */ -#define nlm_openr_next_archived_file \ - bfd_generic_openr_next_archived_file -#define nlm_find_nearest_line \ - ((boolean (*) PARAMS ((bfd *, asection *, \ - asymbol **, bfd_vma, \ - CONST char **, \ - CONST char **, \ - unsigned int *))) \ - bfd_false) -#define nlm_generic_stat_arch_elt \ - bfd_generic_stat_arch_elt -#define nlm_sizeof_headers ((int (*) PARAMS ((bfd *, boolean))) bfd_0u) -#define nlm_bfd_debug_info_start \ - bfd_void -#define nlm_bfd_debug_info_end bfd_void -#define nlm_bfd_debug_info_accumulate \ - ((void (*) PARAMS ((bfd*, struct sec *))) \ - bfd_void) +#define nlm_get_symtab_upper_bound nlmNAME(get_symtab_upper_bound) +#define nlm_get_symtab nlmNAME(get_symtab) +#define nlm_make_empty_symbol nlmNAME(make_empty_symbol) +#define nlm_print_symbol nlmNAME(print_symbol) +#define nlm_get_symbol_info nlmNAME(get_symbol_info) +#define nlm_bfd_is_local_label bfd_generic_is_local_label +#define nlm_get_lineno _bfd_nosymbols_get_lineno +#define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line +#define nlm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol + +#define nlm_get_reloc_upper_bound nlmNAME(get_reloc_upper_bound) +#define nlm_canonicalize_reloc nlmNAME(canonicalize_reloc) +#define nlm_bfd_reloc_type_lookup bfd_default_reloc_type_lookup + +#define nlm_set_section_contents nlmNAME(set_section_contents) + +#define nlm_sizeof_headers _bfd_nolink_sizeof_headers #define nlm_bfd_get_relocated_section_contents \ - bfd_generic_get_relocated_section_contents -#define nlm_bfd_relax_section bfd_generic_relax_section -#define nlm_bfd_reloc_type_lookup \ - bfd_default_reloc_type_lookup -#define nlm_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, \ - unsigned long))) \ - bfd_nullvoidptr) + bfd_generic_get_relocated_section_contents +#define nlm_bfd_relax_section bfd_generic_relax_section #define nlm_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define nlm_bfd_link_add_symbols _bfd_generic_link_add_symbols #define nlm_bfd_final_link _bfd_generic_final_link -#define nlm_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) -#define nlm_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) -#define nlm_bfd_is_local_label bfd_generic_is_local_label -#define nlm_bfd_free_cached_info bfd_true - /* This structure contains everything that BFD knows about a target. It includes things like its byte order, name, what routines to call to do various operations, etc. Every BFD points to a target structure @@ -177,7 +128,14 @@ bfd_target TARGET_BIG_SYM = /* Initialize a jump table with the standard macro. All names start with "nlm" */ - JUMP_TABLE(nlm), + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (nlm), + BFD_JUMP_TABLE_RELOCS (nlm), + BFD_JUMP_TABLE_WRITE (nlm), + BFD_JUMP_TABLE_LINK (nlm), /* backend_data: */ (PTR) TARGET_BACKEND_DATA @@ -259,7 +217,14 @@ bfd_target TARGET_LITTLE_SYM = /* Initialize a jump table with the standard macro. All names start with "nlm" */ - JUMP_TABLE(nlm), + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (nlm), + BFD_JUMP_TABLE_RELOCS (nlm), + BFD_JUMP_TABLE_WRITE (nlm), + BFD_JUMP_TABLE_LINK (nlm), /* backend_data: */ (PTR) TARGET_BACKEND_DATA diff --git a/bfd/oasys.c b/bfd/oasys.c index a094543914..e0dfd292a9 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -1469,35 +1469,32 @@ oasys_sizeof_headers (abfd, exec) { return 0; } -#define FOO PROTO -#define oasys_core_file_failing_command (char *(*)())(bfd_nullvoidptr) -#define oasys_core_file_failing_signal (int (*)())bfd_0 -#define oasys_core_file_matches_executable_p 0 + +#define oasys_close_and_cleanup _bfd_generic_close_and_cleanup +#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_truncate_arname (void (*)())bfd_nullvoidptr -#define oasys_write_armap 0 -#define oasys_get_lineno (struct lineno_cache_entry *(*)())bfd_nullvoidptr -#define oasys_close_and_cleanup bfd_generic_close_and_cleanup +#define oasys_truncate_arname bfd_dont_truncate_arname +#define oasys_write_armap \ + ((boolean (*) \ + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \ + bfd_true) + +#define oasys_bfd_is_local_label bfd_generic_is_local_label +#define oasys_get_lineno _bfd_nosymbols_get_lineno +#define oasys_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol + +#define oasys_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup + #define oasys_set_arch_mach bfd_default_set_arch_mach -#define oasys_bfd_debug_info_start bfd_void -#define oasys_bfd_debug_info_end bfd_void -#define oasys_bfd_debug_info_accumulate (FOO(void, (*), (bfd *, asection *)))bfd_void -#define oasys_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents + +#define oasys_bfd_get_relocated_section_contents \ + bfd_generic_get_relocated_section_contents #define oasys_bfd_relax_section bfd_generic_relax_section -#define oasys_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define oasys_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) #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_final_link _bfd_generic_final_link -#define oasys_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) -#define oasys_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) -#define oasys_bfd_is_local_label bfd_generic_is_local_label -#define oasys_bfd_free_cached_info bfd_true /*SUPPRESS 460 */ bfd_target oasys_vec = @@ -1539,6 +1536,15 @@ bfd_target oasys_vec = _bfd_write_archive_contents, bfd_false, }, - JUMP_TABLE (oasys), + + BFD_JUMP_TABLE_GENERIC (oasys), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (oasys), + BFD_JUMP_TABLE_SYMBOLS (oasys), + BFD_JUMP_TABLE_RELOCS (oasys), + BFD_JUMP_TABLE_WRITE (oasys), + BFD_JUMP_TABLE_LINK (oasys), + (PTR) 0 }; diff --git a/bfd/osf-core.c b/bfd/osf-core.c index 28693dbc72..915e485bc1 100644 --- a/bfd/osf-core.c +++ b/bfd/osf-core.c @@ -195,70 +195,14 @@ osf_core_core_file_matches_executable_p (core_bfd, exec_bfd) return true; /* FIXME, We have no way of telling at this point */ } -/* No archive file support via this BFD */ -#define osf_core_openr_next_archived_file bfd_generic_openr_next_archived_file -#define osf_core_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define osf_core_slurp_armap bfd_false -#define osf_core_slurp_extended_name_table bfd_true -#define osf_core_write_armap (boolean (*) PARAMS \ - ((bfd *arch, unsigned int elength, struct orl *map, \ - unsigned int orl_count, int stridx))) bfd_false -#define osf_core_truncate_arname bfd_dont_truncate_arname - -#define osf_core_close_and_cleanup bfd_generic_close_and_cleanup -#define osf_core_set_section_contents (boolean (*) PARAMS \ - ((bfd *abfd, asection *section, PTR data, file_ptr offset, \ - bfd_size_type count))) bfd_generic_set_section_contents -#define osf_core_get_section_contents bfd_generic_get_section_contents -#define osf_core_new_section_hook (boolean (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_true -#define osf_core_get_symtab_upper_bound bfd_0l -#define osf_core_get_symtab (long (*) PARAMS \ - ((bfd *, struct symbol_cache_entry **))) bfd_0l -#define osf_core_get_reloc_upper_bound (long (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_0l -#define osf_core_canonicalize_reloc (long (*) PARAMS \ - ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0l -#define osf_core_print_symbol (void (*) PARAMS \ - ((bfd *, PTR, struct symbol_cache_entry *, \ - bfd_print_symbol_type))) bfd_false -#define osf_core_get_symbol_info (void (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *, \ - symbol_info *))) bfd_false -#define osf_core_get_lineno (alent * (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr -#define osf_core_set_arch_mach (boolean (*) PARAMS \ - ((bfd *, enum bfd_architecture, unsigned long))) bfd_false -#define osf_core_find_nearest_line (boolean (*) PARAMS \ - ((bfd *abfd, struct sec *section, \ - struct symbol_cache_entry **symbols,bfd_vma offset, \ - CONST char **file, CONST char **func, unsigned int *line))) bfd_false -#define osf_core_sizeof_headers (int (*) PARAMS \ - ((bfd *, boolean))) bfd_0 - -#define osf_core_bfd_debug_info_start bfd_void -#define osf_core_bfd_debug_info_end bfd_void -#define osf_core_bfd_debug_info_accumulate (void (*) PARAMS \ - ((bfd *, struct sec *))) bfd_void -#define osf_core_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define osf_core_bfd_relax_section bfd_generic_relax_section -#define osf_core_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define osf_core_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) -#define osf_core_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) -#define osf_core_bfd_link_add_symbols \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define osf_core_bfd_final_link \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define osf_core_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_false) -#define osf_core_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_false) -#define osf_core_bfd_is_local_label \ - ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) -#define osf_core_bfd_free_cached_info bfd_true +#define osf_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound +#define osf_core_get_symtab _bfd_nosymbols_get_symtab +#define osf_core_print_symbol _bfd_nosymbols_print_symbol +#define osf_core_get_symbol_info _bfd_nosymbols_get_symbol_info +#define osf_core_bfd_is_local_label _bfd_nosymbols_bfd_is_local_label +#define osf_core_get_lineno _bfd_nosymbols_get_lineno +#define osf_core_find_nearest_line _bfd_nosymbols_find_nearest_line +#define osf_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol /* If somebody calls any byte-swapping routines, shoot them. */ static void @@ -307,6 +251,14 @@ bfd_target osf_core_vec = bfd_false, bfd_false }, - JUMP_TABLE(osf_core), + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (osf_core), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (osf_core), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + (PTR) 0 /* backend_data */ }; diff --git a/bfd/ptrace-core.c b/bfd/ptrace-core.c index a712032129..e0b2473380 100644 --- a/bfd/ptrace-core.c +++ b/bfd/ptrace-core.c @@ -189,74 +189,6 @@ ptrace_unix_core_file_matches_executable_p (core_bfd, exec_bfd) return true; } -/* No archive file support via this BFD */ -#define ptrace_unix_openr_next_archived_file bfd_generic_openr_next_archived_file -#define ptrace_unix_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define ptrace_unix_slurp_armap bfd_false -#define ptrace_unix_slurp_extended_name_table bfd_true -#define ptrace_unix_write_armap (boolean (*) PARAMS \ - ((bfd *arch, unsigned int elength, struct orl *map, \ - unsigned int orl_count, int stridx))) bfd_false -#define ptrace_unix_truncate_arname bfd_dont_truncate_arname -#define aout_32_openr_next_archived_file bfd_generic_openr_next_archived_file - -#define ptrace_unix_close_and_cleanup bfd_generic_close_and_cleanup -#define ptrace_unix_set_section_contents (boolean (*) PARAMS \ - ((bfd *abfd, asection *section, PTR data, file_ptr offset, \ - bfd_size_type count))) bfd_generic_set_section_contents -#define ptrace_unix_get_section_contents bfd_generic_get_section_contents -#define ptrace_unix_new_section_hook (boolean (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_true -#define ptrace_unix_get_symtab_upper_bound bfd_0l -#define ptrace_unix_get_symtab (long (*) PARAMS \ - ((bfd *, struct symbol_cache_entry **))) bfd_0l -#define ptrace_unix_get_reloc_upper_bound (long (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_0l -#define ptrace_unix_canonicalize_reloc (long (*) PARAMS \ - ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0l -#define ptrace_unix_make_empty_symbol (struct symbol_cache_entry * \ - (*) PARAMS ((bfd *))) bfd_false -#define ptrace_unix_print_symbol (void (*) PARAMS \ - ((bfd *, PTR, struct symbol_cache_entry *, \ - bfd_print_symbol_type))) bfd_false -#define ptrace_unix_get_symbol_info (void (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *, \ - symbol_info *))) bfd_false -#define ptrace_unix_get_lineno (alent * (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr -#define ptrace_unix_set_arch_mach (boolean (*) PARAMS \ - ((bfd *, enum bfd_architecture, unsigned long))) bfd_false -#define ptrace_unix_find_nearest_line (boolean (*) PARAMS \ - ((bfd *abfd, struct sec *section, \ - struct symbol_cache_entry **symbols,bfd_vma offset, \ - CONST char **file, CONST char **func, unsigned int *line))) bfd_false -#define ptrace_unix_sizeof_headers (int (*) PARAMS \ - ((bfd *, boolean))) bfd_0 - -#define ptrace_unix_bfd_debug_info_start bfd_void -#define ptrace_unix_bfd_debug_info_end bfd_void -#define ptrace_unix_bfd_debug_info_accumulate (void (*) PARAMS \ - ((bfd *, struct sec *))) bfd_void -#define ptrace_unix_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define ptrace_unix_bfd_relax_section bfd_generic_relax_section -#define ptrace_unix_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define ptrace_unix_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) -#define ptrace_unix_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) -#define ptrace_unix_bfd_link_add_symbols \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define ptrace_unix_bfd_final_link \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define ptrace_unix_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_false) -#define ptrace_unix_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_false) -#define ptrace_unix_bfd_is_local_label \ - ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) -#define ptrace_unix_bfd_free_cached_info bfd_true - /* If somebody calls any byte-swapping routines, shoot them. */ void swap_abort() @@ -304,7 +236,15 @@ bfd_target ptrace_core_vec = bfd_false, bfd_false }, - JUMP_TABLE(ptrace_unix), + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (ptrace_unix), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + (PTR) 0 /* backend_data */ }; diff --git a/bfd/som.c b/bfd/som.c index 0d359244f4..7bca3c6fc2 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -5493,32 +5493,23 @@ som_bfd_free_cached_info (abfd) /* End of miscellaneous support functions. */ -#define som_bfd_debug_info_start bfd_void -#define som_bfd_debug_info_end bfd_void -#define som_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void +#define som_close_and_cleanup som_bfd_free_cached_info #define som_openr_next_archived_file bfd_generic_openr_next_archived_file #define som_generic_stat_arch_elt bfd_generic_stat_arch_elt #define som_truncate_arname bfd_bsd_truncate_arname #define som_slurp_extended_name_table _bfd_slurp_extended_name_table -#define som_get_lineno (struct lineno_cache_entry *(*)())bfd_nullvoidptr -#define som_close_and_cleanup som_bfd_free_cached_info +#define som_get_lineno _bfd_nosymbols_get_lineno +#define som_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define som_bfd_get_relocated_section_contents \ bfd_generic_get_relocated_section_contents #define som_bfd_relax_section bfd_generic_relax_section -#define som_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) #define som_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define som_bfd_link_add_symbols _bfd_generic_link_add_symbols #define som_bfd_final_link _bfd_generic_final_link -/* Core file support is in the hpux-core backend. */ -#define som_core_file_failing_command _bfd_dummy_core_file_failing_command -#define som_core_file_failing_signal _bfd_dummy_core_file_failing_signal -#define som_core_file_matches_executable_p _bfd_dummy_core_file_matches_executable_p - bfd_target som_vec = { "som", /* name */ @@ -5561,7 +5552,16 @@ bfd_target som_vec = bfd_false, }, #undef som - JUMP_TABLE (som), + + BFD_JUMP_TABLE_GENERIC (som), + BFD_JUMP_TABLE_COPY (som), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (som), + BFD_JUMP_TABLE_SYMBOLS (som), + BFD_JUMP_TABLE_RELOCS (som), + BFD_JUMP_TABLE_WRITE (som), + BFD_JUMP_TABLE_LINK (som), + (PTR) 0 }; diff --git a/bfd/srec.c b/bfd/srec.c index 654bab1827..2eadc04610 100644 --- a/bfd/srec.c +++ b/bfd/srec.c @@ -946,48 +946,22 @@ srec_print_symbol (ignore_abfd, afile, symbol, how) } } -#define FOO PROTO -#define srec_new_section_hook (FOO(boolean, (*), (bfd *, asection *)))bfd_true - -#define srec_get_reloc_upper_bound (FOO(long, (*),(bfd*, asection *)))bfd_0l -#define srec_canonicalize_reloc (FOO(long, (*),(bfd*,asection *, arelent **, asymbol **))) bfd_0l - - - -#define srec_openr_next_archived_file (FOO(bfd *, (*), (bfd*,bfd*))) bfd_nullvoidptr -#define srec_find_nearest_line (FOO(boolean, (*),(bfd*,asection*,asymbol**,bfd_vma, CONST char**, CONST char**, unsigned int *))) bfd_false -#define srec_generic_stat_arch_elt (FOO(int, (*), (bfd *,struct stat *))) bfd_0 +#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_local_label bfd_generic_is_local_label +#define srec_get_lineno _bfd_nosymbols_get_lineno +#define srec_find_nearest_line _bfd_nosymbols_find_nearest_line +#define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol -#define srec_core_file_failing_command (char *(*)())(bfd_nullvoidptr) -#define srec_core_file_failing_signal (int (*)())bfd_0 -#define srec_core_file_matches_executable_p (FOO(boolean, (*),(bfd*, bfd*)))bfd_false -#define srec_slurp_armap bfd_true -#define srec_slurp_extended_name_table bfd_true -#define srec_truncate_arname (void (*)())bfd_nullvoidptr -#define srec_write_armap (FOO( boolean, (*),(bfd *, unsigned int, struct orl *, unsigned int, int))) bfd_nullvoidptr -#define srec_get_lineno (struct lineno_cache_entry *(*)())bfd_nullvoidptr -#define srec_close_and_cleanup bfd_generic_close_and_cleanup -#define srec_bfd_debug_info_start bfd_void -#define srec_bfd_debug_info_end bfd_void -#define srec_bfd_debug_info_accumulate (FOO(void, (*), (bfd *, asection *))) bfd_void -#define srec_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents +#define srec_bfd_get_relocated_section_contents \ + bfd_generic_get_relocated_section_contents #define srec_bfd_relax_section bfd_generic_relax_section -#define srec_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define srec_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) #define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols #define srec_bfd_final_link _bfd_generic_final_link -#define srec_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) -#define srec_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) -#define srec_bfd_is_local_label bfd_generic_is_local_label -#define srec_bfd_free_cached_info bfd_true - bfd_target srec_vec = { "srec", /* name */ @@ -1028,7 +1002,17 @@ bfd_target srec_vec = _bfd_write_archive_contents, bfd_false, }, - JUMP_TABLE (srec) + + BFD_JUMP_TABLE_GENERIC (srec), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (srec), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (srec), + BFD_JUMP_TABLE_LINK (srec), + + (PTR) 0 }; @@ -1073,6 +1057,15 @@ bfd_target symbolsrec_vec = _bfd_write_archive_contents, bfd_false, }, - JUMP_TABLE (srec), + + BFD_JUMP_TABLE_GENERIC (srec), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (srec), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (srec), + BFD_JUMP_TABLE_LINK (srec), + (PTR) 0 }; diff --git a/bfd/targets.c b/bfd/targets.c index c034c15632..80d2f218e6 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -239,19 +239,54 @@ Write cached information into a file being written, at <>. . boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); -The following functions are defined in <>. The idea is -that the back end writer of <> names all the routines -<>@var{entry_point}; <> will build the entries -in this structure in the right order. - -Core file entry points. +The general target vector. +. +. {* Generic entry points. *} +.#define BFD_JUMP_TABLE_GENERIC(NAME)\ +.CAT(NAME,_close_and_cleanup),\ +.CAT(NAME,_bfd_free_cached_info),\ +.CAT(NAME,_new_section_hook),\ +.CAT(NAME,_get_section_contents) +. {* Called when the BFD is being closed to do any necessary cleanup. *} +. boolean (*_close_and_cleanup) PARAMS ((bfd *)); +. {* Ask the BFD to free all cached information. *} +. boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); +. {* Called when a new section is created. *} +. boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); +. {* Read the contents of a section. *} +. boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, +. file_ptr, bfd_size_type)); +. +. {* Entry points to copy private data. *} +.#define BFD_JUMP_TABLE_COPY(NAME)\ +.CAT(NAME,_bfd_copy_private_bfd_data),\ +.CAT(NAME,_bfd_copy_private_section_data) +. {* Called to copy BFD general private data from one object file +. to another. *} +. boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); +. {* Called to copy BFD private section data from one object file +. to another. *} +. boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, +. bfd *, sec_ptr)); +. +. {* Core file entry points. *} +.#define BFD_JUMP_TABLE_CORE(NAME)\ +.CAT(NAME,_core_file_failing_command),\ +.CAT(NAME,_core_file_failing_signal),\ +.CAT(NAME,_core_file_matches_executable_p) . char * (*_core_file_failing_command) PARAMS ((bfd *)); . int (*_core_file_failing_signal) PARAMS ((bfd *)); . boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); - -Archive entry points. - +. +. {* Archive entry points. *} +.#define BFD_JUMP_TABLE_ARCHIVE(NAME)\ +.CAT(NAME,_slurp_armap),\ +.CAT(NAME,_slurp_extended_name_table),\ +.CAT(NAME,_truncate_arname),\ +.CAT(NAME,_write_armap),\ +.CAT(NAME,_openr_next_archived_file),\ +.CAT(NAME,_generic_stat_arch_elt) . boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); . boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); . void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); @@ -260,27 +295,23 @@ Archive entry points. . struct orl *map, . unsigned int orl_count, . int stridx)); - -Standard stuff. - -. boolean (*_close_and_cleanup) PARAMS ((bfd *)); -. boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, -. file_ptr, bfd_size_type)); -. boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, -. file_ptr, bfd_size_type)); -. boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); -. boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, -. bfd *, sec_ptr)); -. boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); - -Symbols and relocations. - +. bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); +. int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); +. +. {* Entry points used for symbols. *} +.#define BFD_JUMP_TABLE_SYMBOLS(NAME)\ +.CAT(NAME,_get_symtab_upper_bound),\ +.CAT(NAME,_get_symtab),\ +.CAT(NAME,_make_empty_symbol),\ +.CAT(NAME,_print_symbol),\ +.CAT(NAME,_get_symbol_info),\ +.CAT(NAME,_bfd_is_local_label),\ +.CAT(NAME,_get_lineno),\ +.CAT(NAME,_find_nearest_line),\ +.CAT(NAME,_bfd_make_debug_symbol) . long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); . long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, . struct symbol_cache_entry **)); -. long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); -. long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, -. struct symbol_cache_entry **)); . struct symbol_cache_entry * . (*_bfd_make_empty_symbol) PARAMS ((bfd *)); . void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, @@ -292,27 +323,51 @@ Symbols and relocations. . symbol_info *)); .#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) . boolean (*_bfd_is_local_label) PARAMS ((bfd *, asymbol *)); - -. alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); -. -. boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, -. unsigned long)); . -. bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); -. +. alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); . boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd, . struct sec *section, struct symbol_cache_entry **symbols, . bfd_vma offset, CONST char **file, CONST char **func, . unsigned int *line)); -. -. int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); +. {* Back-door to allow format-aware applications to create debug symbols +. while using BFD for everything else. Currently used by the assembler +. when creating COFF files. *} +. asymbol * (*_bfd_make_debug_symbol) PARAMS (( +. bfd *abfd, +. void *ptr, +. unsigned long size)); . -. int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); +. {* Routines for relocs. *} +.#define BFD_JUMP_TABLE_RELOCS(NAME)\ +.CAT(NAME,_get_reloc_upper_bound),\ +.CAT(NAME,_canonicalize_reloc),\ +.CAT(NAME,_bfd_reloc_type_lookup) +. long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); +. long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, +. struct symbol_cache_entry **)); +. {* See documentation on reloc types. *} +. CONST struct reloc_howto_struct * +. (*reloc_type_lookup) PARAMS ((bfd *abfd, +. bfd_reloc_code_real_type code)); . -. void (*_bfd_debug_info_start) PARAMS ((bfd *)); -. void (*_bfd_debug_info_end) PARAMS ((bfd *)); -. void (*_bfd_debug_info_accumulate) PARAMS ((bfd *, struct sec *)); +. {* Routines used when writing an object file. *} +.#define BFD_JUMP_TABLE_WRITE(NAME)\ +.CAT(NAME,_set_arch_mach),\ +.CAT(NAME,_set_section_contents) +. boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, +. unsigned long)); +. boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, +. file_ptr, bfd_size_type)); . +. {* Routines used by the linker. *} +.#define BFD_JUMP_TABLE_LINK(NAME)\ +.CAT(NAME,_sizeof_headers),\ +.CAT(NAME,_bfd_get_relocated_section_contents),\ +.CAT(NAME,_bfd_relax_section),\ +.CAT(NAME,_bfd_link_hash_table_create),\ +.CAT(NAME,_bfd_link_add_symbols),\ +.CAT(NAME,_bfd_final_link) +. int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); . bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *, . struct bfd_link_info *, struct bfd_link_order *, . bfd_byte *data, boolean relocateable, @@ -321,19 +376,6 @@ Symbols and relocations. . boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, . struct bfd_link_info *, boolean *again)); . -. {* See documentation on reloc types. *} -. CONST struct reloc_howto_struct * -. (*reloc_type_lookup) PARAMS ((bfd *abfd, -. bfd_reloc_code_real_type code)); -. -. {* Back-door to allow format-aware applications to create debug symbols -. while using BFD for everything else. Currently used by the assembler -. when creating COFF files. *} -. asymbol * (*_bfd_make_debug_symbol) PARAMS (( -. bfd *abfd, -. void *ptr, -. unsigned long size)); -. . {* Create a hash table for the linker. Different backends store . different information in this table. *} . struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); @@ -345,9 +387,6 @@ Symbols and relocations. . section of the BFD. *} . boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); . -. {* Ask the BFD to free all cached information. *} -. boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); -. Data for use by back-end routines, which isn't generic enough to belong in this structure. diff --git a/bfd/tekhex.c b/bfd/tekhex.c index ad83c0abd6..507fb54576 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -999,42 +999,21 @@ tekhex_print_symbol (ignore_abfd, filep, symbol, how) } } -#define FOO PROTO -#define tekhex_new_section_hook (FOO(boolean, (*), (bfd *, asection *)))bfd_true -#define tekhex_get_reloc_upper_bound (FOO(long, (*),(bfd*, asection *)))bfd_0l -#define tekhex_canonicalize_reloc (FOO(long, (*),(bfd*,asection *, arelent **, asymbol **))) bfd_0l - -#define tekhex_openr_next_archived_file (FOO(bfd *, (*), (bfd*,bfd*))) bfd_nullvoidptr -#define tekhex_find_nearest_line (FOO(boolean, (*),(bfd*,asection*,asymbol**,bfd_vma, CONST char**, CONST char**, unsigned int *))) bfd_false -#define tekhex_generic_stat_arch_elt (FOO(int, (*), (bfd *,struct stat *))) bfd_0 - -#define tekhex_core_file_failing_command (char *(*)())(bfd_nullvoidptr) -#define tekhex_core_file_failing_signal (int (*)())bfd_0 -#define tekhex_core_file_matches_executable_p (FOO(boolean, (*),(bfd*, bfd*)))bfd_false -#define tekhex_slurp_armap bfd_true -#define tekhex_slurp_extended_name_table bfd_true -#define tekhex_truncate_arname (void (*)())bfd_nullvoidptr -#define tekhex_write_armap (FOO( boolean, (*),(bfd *, unsigned int, struct orl *, unsigned int, int))) bfd_nullvoidptr -#define tekhex_get_lineno (struct lineno_cache_entry *(*)())bfd_nullvoidptr -#define tekhex_close_and_cleanup bfd_generic_close_and_cleanup -#define tekhex_bfd_debug_info_start bfd_void -#define tekhex_bfd_debug_info_end bfd_void -#define tekhex_bfd_debug_info_accumulate (FOO(void, (*), (bfd *, asection *))) bfd_void -#define tekhex_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents +#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_local_label bfd_generic_is_local_label +#define tekhex_get_lineno _bfd_nosymbols_get_lineno +#define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line +#define tekhex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol + +#define tekhex_bfd_get_relocated_section_contents \ + bfd_generic_get_relocated_section_contents #define tekhex_bfd_relax_section bfd_generic_relax_section -#define tekhex_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define tekhex_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) #define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols #define tekhex_bfd_final_link _bfd_generic_final_link -#define tekhex_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) -#define tekhex_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) -#define tekhex_bfd_is_local_label bfd_generic_is_local_label -#define tekhex_bfd_free_cached_info bfd_true bfd_target tekhex_vec = { @@ -1076,6 +1055,15 @@ bfd_target tekhex_vec = _bfd_write_archive_contents, bfd_false, }, - JUMP_TABLE (tekhex), + + BFD_JUMP_TABLE_GENERIC (tekhex), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (tekhex), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (tekhex), + BFD_JUMP_TABLE_LINK (tekhex), + (PTR) 0 }; diff --git a/bfd/trad-core.c b/bfd/trad-core.c index 9e048633fe..9c16bd751a 100644 --- a/bfd/trad-core.c +++ b/bfd/trad-core.c @@ -279,74 +279,6 @@ trad_unix_core_file_matches_executable_p (core_bfd, exec_bfd) return true; /* FIXME, We have no way of telling at this point */ } -/* No archive file support via this BFD */ -#define trad_unix_openr_next_archived_file bfd_generic_openr_next_archived_file -#define trad_unix_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define trad_unix_slurp_armap bfd_false -#define trad_unix_slurp_extended_name_table bfd_true -#define trad_unix_write_armap (boolean (*) PARAMS \ - ((bfd *arch, unsigned int elength, struct orl *map, \ - unsigned int orl_count, int stridx))) bfd_false -#define trad_unix_truncate_arname bfd_dont_truncate_arname -#define aout_32_openr_next_archived_file bfd_generic_openr_next_archived_file - -#define trad_unix_close_and_cleanup bfd_generic_close_and_cleanup -#define trad_unix_set_section_contents (boolean (*) PARAMS \ - ((bfd *abfd, asection *section, PTR data, file_ptr offset, \ - bfd_size_type count))) bfd_generic_set_section_contents -#define trad_unix_get_section_contents bfd_generic_get_section_contents -#define trad_unix_new_section_hook (boolean (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_true -#define trad_unix_get_symtab_upper_bound bfd_0l -#define trad_unix_get_symtab (long (*) PARAMS \ - ((bfd *, struct symbol_cache_entry **))) bfd_0l -#define trad_unix_get_reloc_upper_bound (long (*) PARAMS \ - ((bfd *, sec_ptr))) bfd_0l -#define trad_unix_canonicalize_reloc (long (*) PARAMS \ - ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0l -#define trad_unix_make_empty_symbol (struct symbol_cache_entry * \ - (*) PARAMS ((bfd *))) bfd_false -#define trad_unix_print_symbol (void (*) PARAMS \ - ((bfd *, PTR, struct symbol_cache_entry *, \ - bfd_print_symbol_type))) bfd_false -#define trad_unix_get_symbol_info (void (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *, \ - symbol_info *))) bfd_false -#define trad_unix_get_lineno (alent * (*) PARAMS \ - ((bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr -#define trad_unix_set_arch_mach (boolean (*) PARAMS \ - ((bfd *, enum bfd_architecture, unsigned long))) bfd_false -#define trad_unix_find_nearest_line (boolean (*) PARAMS \ - ((bfd *abfd, struct sec *section, \ - struct symbol_cache_entry **symbols,bfd_vma offset, \ - CONST char **file, CONST char **func, unsigned int *line))) bfd_false -#define trad_unix_sizeof_headers (int (*) PARAMS \ - ((bfd *, boolean))) bfd_0 - -#define trad_unix_bfd_debug_info_start bfd_void -#define trad_unix_bfd_debug_info_end bfd_void -#define trad_unix_bfd_debug_info_accumulate (void (*) PARAMS \ - ((bfd *, struct sec *))) bfd_void -#define trad_unix_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents -#define trad_unix_bfd_relax_section bfd_generic_relax_section -#define trad_unix_bfd_reloc_type_lookup \ - ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr) -#define trad_unix_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) -#define trad_unix_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) -#define trad_unix_bfd_link_add_symbols \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define trad_unix_bfd_final_link \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) -#define trad_unix_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_false) -#define trad_unix_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_false) -#define trad_unix_bfd_is_local_label \ - ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) -#define trad_unix_bfd_free_cached_info bfd_true - /* If somebody calls any byte-swapping routines, shoot them. */ void swap_abort() @@ -394,6 +326,14 @@ bfd_target trad_core_vec = bfd_false, bfd_false }, - JUMP_TABLE(trad_unix), + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (trad_unix), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + (PTR) 0 /* backend_data */ };