diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-04-06 22:00:40 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-04-06 22:00:40 +0000 |
commit | 6812b6077e4a09eab08458428f09c28ec58fc514 (patch) | |
tree | 16be3cd70ca281aca8b810d71fe5dbc125cbe9c9 /bfd/bfd-in2.h | |
parent | 76336d506d079ddae02f26752357b5ea94582cb0 (diff) | |
download | gdb-6812b6077e4a09eab08458428f09c28ec58fc514.zip gdb-6812b6077e4a09eab08458428f09c28ec58fc514.tar.gz gdb-6812b6077e4a09eab08458428f09c28ec58fc514.tar.bz2 |
* 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.
Diffstat (limited to 'bfd/bfd-in2.h')
-rw-r--r-- | bfd/bfd-in2.h | 180 |
1 files changed, 94 insertions, 86 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 248c04f..8b07188 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 * |