diff options
author | Alan Modra <amodra@bigpond.net.au> | 2002-06-05 03:43:11 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2002-06-05 03:43:11 +0000 |
commit | b07b424a436dd864a39d3c1387147e1ee9b758e0 (patch) | |
tree | d91bfa2a90716952c5f84a72fd83dbac5e79e810 | |
parent | 0000be11a2655679eb55612aa2ba11f315a4f840 (diff) | |
download | gdb-b07b424a436dd864a39d3c1387147e1ee9b758e0.tar.gz |
* bfd-in.h: Remove "taken from the source" comment.
* libbfd-in.h: Likewise.
* libcoff-in.h: Likewise.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
* elf.c (bfd_elf_discard_group): Return true.
* elf-bfd.h (bfd_elf_discard_group): Declare.
* bfd-in.h (bfd_elf_discard_group): Don't declare here.
* section.c (bfd_discard_group): Rename to bfd_generic_discard_group.
* bfd.c (bfd_discard_group): Define.
* targets.c (struct bfd_target): Add _bfd_discard_group.
(BFD_JUMP_TABLE_LINK): Here too.
* libbfd-in.h (_bfd_nolink_bfd_discard_group): Define.
* aout-adobe.c (aout_32_bfd_discard_group): Define.
* aout-target.h (MY_bfd_discard_group): Define.
* aout-tic30.c (MY_bfd_discard_group): Define.
* binary.c (binary_bfd_discard_group): Define.
* bout.c (b_out_bfd_discard_group): Define.
* coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define.
* coffcode.h (coff_bfd_discard_group): Define.
* coff-mips.c (_bfd_ecoff_bfd_discard_group): Define.
* elfxx-target.h (bfd_elfNN_bfd_discard_group): Define.
* i386msdos.c (msdos_bfd_discard_group): Define.
* i386os9k.c (os9k_bfd_discard_group): Define.
* ieee.c (ieee_bfd_discard_group): Define.
* ihex.c (ihex_bfd_discard_group): Define.
* mmo.c (mmo_bfd_discard_group): Define.
* nlm-target.h (nlm_bfd_discard_group): Define.
* oasys.c (oasys_bfd_discard_group): Define.
* ppcboot.c (ppcboot_bfd_discard_group): Define.
* som.c (som_bfd_discard_group): Define.
* srec.c (srec_bfd_discard_group): Define.
* tekhex.c (tekhex_bfd_discard_group): Define.
* versados.c (versados_bfd_discard_group): Define.
* vms.c (vms_bfd_discard_group): Define.
* xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define.
* coff64-rs6000.c (rs6000coff64_vec): Update initialiser.
(aix5coff64_vec): Likewise.
* coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
-rw-r--r-- | bfd/ChangeLog | 44 | ||||
-rw-r--r-- | bfd/aout-adobe.c | 1 | ||||
-rw-r--r-- | bfd/aout-target.h | 3 | ||||
-rw-r--r-- | bfd/aout-tic30.c | 3 | ||||
-rw-r--r-- | bfd/bfd-in.h | 3 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 28 | ||||
-rw-r--r-- | bfd/bfd.c | 3 | ||||
-rw-r--r-- | bfd/binary.c | 1 | ||||
-rw-r--r-- | bfd/bout.c | 1 | ||||
-rw-r--r-- | bfd/coff-alpha.c | 1 | ||||
-rw-r--r-- | bfd/coff-mips.c | 2 | ||||
-rw-r--r-- | bfd/coff-rs6000.c | 4 | ||||
-rw-r--r-- | bfd/coff64-rs6000.c | 2 | ||||
-rw-r--r-- | bfd/coffcode.h | 4 | ||||
-rw-r--r-- | bfd/elf-bfd.h | 2 | ||||
-rw-r--r-- | bfd/elf.c | 3 | ||||
-rw-r--r-- | bfd/elfxx-target.h | 4 | ||||
-rw-r--r-- | bfd/i386msdos.c | 1 | ||||
-rw-r--r-- | bfd/i386os9k.c | 1 | ||||
-rw-r--r-- | bfd/ieee.c | 1 | ||||
-rw-r--r-- | bfd/ihex.c | 1 | ||||
-rw-r--r-- | bfd/libbfd-in.h | 6 | ||||
-rw-r--r-- | bfd/libbfd.h | 12 | ||||
-rw-r--r-- | bfd/libcoff-in.h | 2 | ||||
-rw-r--r-- | bfd/libcoff.h | 3 | ||||
-rw-r--r-- | bfd/mmo.c | 1 | ||||
-rw-r--r-- | bfd/nlm-target.h | 1 | ||||
-rw-r--r-- | bfd/oasys.c | 1 | ||||
-rw-r--r-- | bfd/ppcboot.c | 1 | ||||
-rw-r--r-- | bfd/section.c | 16 | ||||
-rw-r--r-- | bfd/som.c | 1 | ||||
-rw-r--r-- | bfd/srec.c | 1 | ||||
-rw-r--r-- | bfd/targets.c | 6 | ||||
-rw-r--r-- | bfd/tekhex.c | 1 | ||||
-rw-r--r-- | bfd/versados.c | 1 | ||||
-rw-r--r-- | bfd/vms.c | 1 | ||||
-rw-r--r-- | bfd/xcoff-target.h | 1 |
37 files changed, 139 insertions, 29 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d04c40943be..ab52bca481b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,47 @@ +2002-06-05 Alan Modra <amodra@bigpond.net.au> + + * bfd-in.h: Remove "taken from the source" comment. + * libbfd-in.h: Likewise. + * libcoff-in.h: Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + + * elf.c (bfd_elf_discard_group): Return true. + * elf-bfd.h (bfd_elf_discard_group): Declare. + * bfd-in.h (bfd_elf_discard_group): Don't declare here. + * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. + * bfd.c (bfd_discard_group): Define. + * targets.c (struct bfd_target): Add _bfd_discard_group. + (BFD_JUMP_TABLE_LINK): Here too. + * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. + * aout-adobe.c (aout_32_bfd_discard_group): Define. + * aout-target.h (MY_bfd_discard_group): Define. + * aout-tic30.c (MY_bfd_discard_group): Define. + * binary.c (binary_bfd_discard_group): Define. + * bout.c (b_out_bfd_discard_group): Define. + * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. + * coffcode.h (coff_bfd_discard_group): Define. + * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. + * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. + * i386msdos.c (msdos_bfd_discard_group): Define. + * i386os9k.c (os9k_bfd_discard_group): Define. + * ieee.c (ieee_bfd_discard_group): Define. + * ihex.c (ihex_bfd_discard_group): Define. + * mmo.c (mmo_bfd_discard_group): Define. + * nlm-target.h (nlm_bfd_discard_group): Define. + * oasys.c (oasys_bfd_discard_group): Define. + * ppcboot.c (ppcboot_bfd_discard_group): Define. + * som.c (som_bfd_discard_group): Define. + * srec.c (srec_bfd_discard_group): Define. + * tekhex.c (tekhex_bfd_discard_group): Define. + * versados.c (versados_bfd_discard_group): Define. + * vms.c (vms_bfd_discard_group): Define. + * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. + * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. + (aix5coff64_vec): Likewise. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise. + 2002-06-04 Jason Thorpe <thorpej@wasabisystems.com> * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-com.lo. diff --git a/bfd/aout-adobe.c b/bfd/aout-adobe.c index c11c504c584..83983398aa7 100644 --- a/bfd/aout-adobe.c +++ b/bfd/aout-adobe.c @@ -510,6 +510,7 @@ aout_adobe_sizeof_headers (ignore_abfd, ignore) #define aout_32_bfd_relax_section bfd_generic_relax_section #define aout_32_bfd_gc_sections bfd_generic_gc_sections #define aout_32_bfd_merge_sections bfd_generic_merge_sections +#define aout_32_bfd_discard_group bfd_generic_discard_group #define aout_32_bfd_link_hash_table_create \ _bfd_generic_link_hash_table_create #define aout_32_bfd_link_hash_table_free \ diff --git a/bfd/aout-target.h b/bfd/aout-target.h index 15a25687692..75299fa8180 100644 --- a/bfd/aout-target.h +++ b/bfd/aout-target.h @@ -513,6 +513,9 @@ MY_bfd_final_link (abfd, info) #ifndef MY_bfd_merge_sections #define MY_bfd_merge_sections bfd_generic_merge_sections #endif +#ifndef MY_bfd_discard_group +#define MY_bfd_discard_group bfd_generic_discard_group +#endif #ifndef MY_bfd_reloc_type_lookup #define MY_bfd_reloc_type_lookup NAME(aout,reloc_type_lookup) #endif diff --git a/bfd/aout-tic30.c b/bfd/aout-tic30.c index e00c1379e87..a39a5b1fb88 100644 --- a/bfd/aout-tic30.c +++ b/bfd/aout-tic30.c @@ -965,6 +965,9 @@ tic30_aout_set_arch_mach (abfd, arch, machine) #ifndef MY_bfd_merge_sections #define MY_bfd_merge_sections bfd_generic_merge_sections #endif +#ifndef MY_bfd_discard_group +#define MY_bfd_discard_group bfd_generic_discard_group +#endif #ifndef MY_bfd_reloc_type_lookup #define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup #endif diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 0ba88985292..19fd1072084 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -657,8 +657,6 @@ extern boolean bfd_elf32_discard_info PARAMS ((bfd *, struct bfd_link_info *)); extern boolean bfd_elf64_discard_info PARAMS ((bfd *, struct bfd_link_info *)); -extern void bfd_elf_discard_group - PARAMS ((bfd *, struct sec *)); /* Return an upper bound on the number of bytes required to store a copy of ABFD's program header table entries. Return -1 if an error @@ -815,4 +813,3 @@ extern void bfd_ticoff_set_section_load_page extern int bfd_ticoff_get_section_load_page PARAMS ((struct sec *)); -/* And more from the source. */ diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index afaefef40d4..e4319ff91d7 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -663,8 +663,6 @@ extern boolean bfd_elf32_discard_info PARAMS ((bfd *, struct bfd_link_info *)); extern boolean bfd_elf64_discard_info PARAMS ((bfd *, struct bfd_link_info *)); -extern void bfd_elf_discard_group - PARAMS ((bfd *, struct sec *)); /* Return an upper bound on the number of bytes required to store a copy of ABFD's program header table entries. Return -1 if an error @@ -821,10 +819,11 @@ extern void bfd_ticoff_set_section_load_page extern int bfd_ticoff_get_section_load_page PARAMS ((struct sec *)); -/* And more from the source. */ +/* Extracted from init.c. */ void bfd_init PARAMS ((void)); +/* Extracted from opncls.c. */ bfd * bfd_openr PARAMS ((const char *filename, const char *target)); @@ -852,6 +851,7 @@ bfd_make_writable PARAMS ((bfd *abfd)); boolean bfd_make_readable PARAMS ((bfd *abfd)); +/* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -992,6 +992,7 @@ bfd_make_readable PARAMS ((bfd *abfd)); #define H_GET_S8 bfd_h_get_signed_8 +/* Extracted from section.c. */ /* This structure is used for a comdat section, as in PE. A comdat section is associated with a particular symbol. When the linker sees a comdat section, it keeps only one of the sections with a @@ -1452,9 +1453,10 @@ bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, void _bfd_strip_section_from_output PARAMS ((struct bfd_link_info *info, asection *section)); -void -bfd_discard_group PARAMS ((bfd *abfd, asection *group)); +boolean +bfd_generic_discard_group PARAMS ((bfd *abfd, asection *group)); +/* Extracted from archures.c. */ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ @@ -1728,6 +1730,7 @@ unsigned int bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch, unsigned long machine)); +/* Extracted from reloc.c. */ typedef enum bfd_reloc_status { /* No errors detected. */ @@ -3090,6 +3093,7 @@ bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); const char * bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code)); +/* Extracted from syms.c. */ typedef struct symbol_cache_entry { @@ -3262,6 +3266,7 @@ bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymb BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ (ibfd, isymbol, obfd, osymbol)) +/* Extracted from bfd.c. */ struct _bfd { /* The filename the application opened the BFD with. */ @@ -3561,6 +3566,9 @@ bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); #define bfd_merge_sections(abfd, link_info) \ BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) +#define bfd_discard_group(abfd, sec) \ + BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) + #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) @@ -3602,6 +3610,7 @@ extern bfd_byte *bfd_get_relocated_section_contents boolean bfd_alt_mach_code PARAMS ((bfd *abfd, int index)); +/* Extracted from archive.c. */ symindex bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym)); @@ -3611,6 +3620,7 @@ bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head)); bfd * bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous)); +/* Extracted from corefile.c. */ const char * bfd_core_file_failing_command PARAMS ((bfd *abfd)); @@ -3620,6 +3630,7 @@ bfd_core_file_failing_signal PARAMS ((bfd *abfd)); boolean core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd)); +/* Extracted from targets.c. */ #define BFD_SEND(bfd, message, arglist) \ ((*((bfd)->xvec->message)) arglist) @@ -3901,7 +3912,8 @@ CONCAT2 (NAME,_bfd_link_just_syms), \ CONCAT2 (NAME,_bfd_final_link), \ CONCAT2 (NAME,_bfd_link_split_section), \ CONCAT2 (NAME,_bfd_gc_sections), \ -CONCAT2 (NAME,_bfd_merge_sections) +CONCAT2 (NAME,_bfd_merge_sections), \ +CONCAT2 (NAME,_bfd_discard_group) int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); bfd_byte *(*_bfd_get_relocated_section_contents) PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, @@ -3936,6 +3948,9 @@ CONCAT2 (NAME,_bfd_merge_sections) /* Attempt to merge SEC_MERGE sections. */ boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); + /* Discard members of a group. */ + boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ @@ -3974,6 +3989,7 @@ bfd_target_list PARAMS ((void)); const bfd_target * bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *)); +/* Extracted from format.c. */ boolean bfd_check_format PARAMS ((bfd *abfd, bfd_format format)); diff --git a/bfd/bfd.c b/bfd/bfd.c index 0e72b0ba99f..d230aac5af6 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -1185,6 +1185,9 @@ DESCRIPTION .#define bfd_merge_sections(abfd, link_info) \ . BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) . +.#define bfd_discard_group(abfd, sec) \ +. BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) +. .#define bfd_link_hash_table_create(abfd) \ . BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) . diff --git a/bfd/binary.c b/bfd/binary.c index 3a0390131e4..fc972b22d13 100644 --- a/bfd/binary.c +++ b/bfd/binary.c @@ -337,6 +337,7 @@ binary_sizeof_headers (abfd, exec) #define binary_bfd_relax_section bfd_generic_relax_section #define binary_bfd_gc_sections bfd_generic_gc_sections #define binary_bfd_merge_sections bfd_generic_merge_sections +#define binary_bfd_discard_group bfd_generic_discard_group #define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define binary_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define binary_bfd_link_just_syms _bfd_generic_link_just_syms diff --git a/bfd/bout.c b/bfd/bout.c index d02364ee77c..9550956e089 100644 --- a/bfd/bout.c +++ b/bfd/bout.c @@ -1456,6 +1456,7 @@ b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order, #define b_out_bfd_link_split_section _bfd_generic_link_split_section #define b_out_bfd_gc_sections bfd_generic_gc_sections #define b_out_bfd_merge_sections bfd_generic_merge_sections +#define b_out_bfd_discard_group bfd_generic_discard_group #define aout_32_get_section_contents_in_window \ _bfd_generic_get_section_contents_in_window diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index 4056e2ce6e7..5c02c3a7f15 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -2356,6 +2356,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = #define _bfd_ecoff_bfd_relax_section bfd_generic_relax_section #define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections #define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections +#define _bfd_ecoff_bfd_discard_group bfd_generic_discard_group const bfd_target ecoffalpha_little_vec = { diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index 672b07f7762..f9975e3f91e 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -2602,6 +2602,8 @@ static const struct ecoff_backend_data mips_ecoff_backend_data = /* Merging of sections is not done. */ #define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections +#define _bfd_ecoff_bfd_discard_group bfd_generic_discard_group + extern const bfd_target ecoff_big_vec; const bfd_target ecoff_little_vec = diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 6d5597875aa..fdf3162bb7c 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -4189,6 +4189,7 @@ const bfd_target rs6000coff_vec = _bfd_generic_link_split_section, /* _bfd_link_split_section */ bfd_generic_gc_sections, /* _bfd_gc_sections */ bfd_generic_merge_sections, /* _bfd_merge_sections */ + bfd_generic_discard_group, /* _bfd_discard_group */ /* Dynamic */ /* _get_dynamic_symtab_upper_bound */ @@ -4450,7 +4451,8 @@ const bfd_target pmac_xcoff_vec = _bfd_xcoff_bfd_final_link, /* _bfd_final_link */ _bfd_generic_link_split_section, /* _bfd_link_split_section */ bfd_generic_gc_sections, /* _bfd_gc_sections */ - bfd_generic_merge_sections, /* _bfd_merge_sections */ + bfd_generic_merge_sections, /* _bfd_merge_sections */ + bfd_generic_discard_group, /* _bfd_discard_group */ /* Dynamic */ /* _get_dynamic_symtab_upper_bound */ diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index 068b2c20aa1..16b63d4f8ab 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -2735,6 +2735,7 @@ const bfd_target rs6000coff64_vec = _bfd_generic_link_split_section, /* _bfd_link_split_section */ bfd_generic_gc_sections, /* _bfd_gc_sections */ bfd_generic_merge_sections, /* _bfd_merge_sections */ + bfd_generic_discard_group, /* _bfd_discard_group */ /* Dynamic */ /* _get_dynamic_symtab_upper_bound */ @@ -2988,6 +2989,7 @@ const bfd_target aix5coff64_vec = _bfd_generic_link_split_section, /* _bfd_link_split_section */ bfd_generic_gc_sections, /* _bfd_gc_sections */ bfd_generic_merge_sections, /* _bfd_merge_sections */ + bfd_generic_discard_group, /* _bfd_discard_group */ /* Dynamic */ /* _get_dynamic_symtab_upper_bound */ diff --git a/bfd/coffcode.h b/bfd/coffcode.h index cea516f6172..ece19a2ecad 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -5372,6 +5372,10 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = #define coff_bfd_merge_sections bfd_generic_merge_sections #endif +#ifndef coff_bfd_discard_group +#define coff_bfd_discard_group bfd_generic_discard_group +#endif + #define CREATE_BIG_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE) \ const bfd_target VAR = \ { \ diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 47bb6891b5d..1dd03b24051 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1261,6 +1261,8 @@ extern boolean _bfd_elf_slurp_version_tables PARAMS ((bfd *)); extern boolean _bfd_elf_merge_sections PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean bfd_elf_discard_group + PARAMS ((bfd *, struct sec *)); extern void _bfd_elf_link_just_syms PARAMS ((asection *, struct bfd_link_info *)); extern boolean _bfd_elf_copy_private_symbol_data diff --git a/bfd/elf.c b/bfd/elf.c index e1e929f2750..8125ed7a4dc 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -553,7 +553,7 @@ setup_group (abfd, hdr, newsect) return true; } -void +boolean bfd_elf_discard_group (abfd, group) bfd *abfd ATTRIBUTE_UNUSED; asection *group; @@ -569,6 +569,7 @@ bfd_elf_discard_group (abfd, group) if (s == first) break; } + return true; } /* Make a BFD section from an ELF section. We store a pointer to the diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index f7736989dbf..369a44e0105 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -128,6 +128,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ _bfd_elf_merge_sections #endif +#ifndef bfd_elfNN_bfd_discard_group +#define bfd_elfNN_bfd_discard_group bfd_elf_discard_group +#endif + #ifndef bfd_elfNN_bfd_make_debug_symbol #define bfd_elfNN_bfd_make_debug_symbol \ ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c index 0edb90e3486..5c060ecf58e 100644 --- a/bfd/i386msdos.c +++ b/bfd/i386msdos.c @@ -173,6 +173,7 @@ msdos_set_section_contents (abfd, section, location, offset, count) #define msdos_bfd_relax_section bfd_generic_relax_section #define msdos_bfd_gc_sections bfd_generic_gc_sections #define msdos_bfd_merge_sections bfd_generic_merge_sections +#define msdos_bfd_discard_group bfd_generic_discard_group #define msdos_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define msdos_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define msdos_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/i386os9k.c b/bfd/i386os9k.c index 47f9ef3a1a8..5ae994bfd6f 100644 --- a/bfd/i386os9k.c +++ b/bfd/i386os9k.c @@ -329,6 +329,7 @@ os9k_sizeof_headers (ignore_abfd, ignore) #define os9k_bfd_relax_section bfd_generic_relax_section #define os9k_bfd_gc_sections bfd_generic_gc_sections #define os9k_bfd_merge_sections bfd_generic_merge_sections +#define os9k_bfd_discard_group bfd_generic_discard_group #define os9k_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define os9k_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define os9k_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/ieee.c b/bfd/ieee.c index 8439f6daafb..4e7f3a3ed7c 100644 --- a/bfd/ieee.c +++ b/bfd/ieee.c @@ -4010,6 +4010,7 @@ ieee_bfd_debug_info_accumulate (abfd, section) #define ieee_bfd_relax_section bfd_generic_relax_section #define ieee_bfd_gc_sections bfd_generic_gc_sections #define ieee_bfd_merge_sections bfd_generic_merge_sections +#define ieee_bfd_discard_group bfd_generic_discard_group #define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define ieee_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/ihex.c b/bfd/ihex.c index cee736ace7d..4cba29bf7bb 100644 --- a/bfd/ihex.c +++ b/bfd/ihex.c @@ -977,6 +977,7 @@ ihex_sizeof_headers (abfd, exec) #define ihex_bfd_relax_section bfd_generic_relax_section #define ihex_bfd_gc_sections bfd_generic_gc_sections #define ihex_bfd_merge_sections bfd_generic_merge_sections +#define ihex_bfd_discard_group bfd_generic_discard_group #define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define ihex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index 106ba8d9247..776dcd62f91 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -322,6 +322,10 @@ extern boolean _bfd_generic_set_section_contents ((boolean (*) \ PARAMS ((bfd *, struct bfd_link_info *))) \ bfd_false) +#define _bfd_nolink_bfd_discard_group \ + ((boolean (*) \ + PARAMS ((bfd *, struct sec *))) \ + bfd_false) #define _bfd_nolink_bfd_link_hash_table_create \ ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) #define _bfd_nolink_bfd_link_hash_table_free \ @@ -589,5 +593,3 @@ extern boolean _bfd_sh_align_load_span boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma), PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *)); -/* And more follows */ - diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 0322f8b5310..fa9873f35bc 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -327,6 +327,10 @@ extern boolean _bfd_generic_set_section_contents ((boolean (*) \ PARAMS ((bfd *, struct bfd_link_info *))) \ bfd_false) +#define _bfd_nolink_bfd_discard_group \ + ((boolean (*) \ + PARAMS ((bfd *, struct sec *))) \ + bfd_false) #define _bfd_nolink_bfd_link_hash_table_create \ ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) #define _bfd_nolink_bfd_link_hash_table_free \ @@ -594,14 +598,15 @@ extern boolean _bfd_sh_align_load_span boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma), PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *)); -/* And more follows */ - +/* Extracted from init.c. */ +/* Extracted from libbfd.c. */ boolean bfd_write_bigendian_4byte_int PARAMS ((bfd *, unsigned int)); unsigned int bfd_log2 PARAMS ((bfd_vma x)); +/* Extracted from cache.c. */ #define BFD_CACHE_MAX_OPEN 10 extern bfd *bfd_last_cache; @@ -621,6 +626,7 @@ bfd_open_file PARAMS ((bfd *abfd)); FILE * bfd_cache_lookup_worker PARAMS ((bfd *abfd)); +/* Extracted from reloc.c. */ #ifdef _BFD_MAKE_TABLE_bfd_reloc_code_real static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", @@ -1277,6 +1283,7 @@ bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd, boolean relocateable, asymbol **symbols)); +/* Extracted from archures.c. */ extern const bfd_arch_info_type bfd_default_arch_struct; boolean bfd_default_set_arch_mach PARAMS ((bfd *abfd, @@ -1290,6 +1297,7 @@ bfd_default_compatible PARAMS ((const bfd_arch_info_type *a, boolean bfd_default_scan PARAMS ((const struct bfd_arch_info *info, const char *string)); +/* Extracted from elf.c. */ struct elf_internal_shdr * bfd_elf_find_section PARAMS ((bfd *abfd, char *name)); diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h index 618dddaee45..efc2fee268b 100644 --- a/bfd/libcoff-in.h +++ b/bfd/libcoff-in.h @@ -598,5 +598,3 @@ extern boolean ppc_allocate_toc_section extern boolean ppc_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *)); -/* And more taken from the source .. */ - diff --git a/bfd/libcoff.h b/bfd/libcoff.h index 2e9a7d8c2ee..88b09098296 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -602,8 +602,7 @@ extern boolean ppc_allocate_toc_section extern boolean ppc_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *)); -/* And more taken from the source .. */ - +/* Extracted from coffcode.h. */ typedef struct coff_ptr_struct { /* Remembers the offset from the first symbol in the file for diff --git a/bfd/mmo.c b/bfd/mmo.c index 94593830151..85adcaa7762 100644 --- a/bfd/mmo.c +++ b/bfd/mmo.c @@ -3256,6 +3256,7 @@ mmo_canonicalize_reloc (abfd, section, relptr, symbols) #define mmo_set_arch_mach bfd_default_set_arch_mach #define mmo_bfd_relax_section bfd_generic_relax_section #define mmo_bfd_merge_sections bfd_generic_merge_sections +#define mmo_bfd_discard_group bfd_generic_discard_group /* objcopy will be upset if we return -1 from bfd_get_reloc_upper_bound by using BFD_JUMP_TABLE_RELOCS (_bfd_norelocs) rather than 0. FIXME: Most diff --git a/bfd/nlm-target.h b/bfd/nlm-target.h index e8f46261299..e0a83044e91 100644 --- a/bfd/nlm-target.h +++ b/bfd/nlm-target.h @@ -44,6 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define nlm_bfd_relax_section bfd_generic_relax_section #define nlm_bfd_gc_sections bfd_generic_gc_sections #define nlm_bfd_merge_sections bfd_generic_merge_sections +#define nlm_bfd_discard_group bfd_generic_discard_group #define nlm_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define nlm_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define nlm_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/oasys.c b/bfd/oasys.c index 5c2bf5e1ceb..17fc735d779 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -1490,6 +1490,7 @@ oasys_sizeof_headers (abfd, exec) #define oasys_bfd_relax_section bfd_generic_relax_section #define oasys_bfd_gc_sections bfd_generic_gc_sections #define oasys_bfd_merge_sections bfd_generic_merge_sections +#define oasys_bfd_discard_group bfd_generic_discard_group #define oasys_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define oasys_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define oasys_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c index 22043b5f347..5b153bdff08 100644 --- a/bfd/ppcboot.c +++ b/bfd/ppcboot.c @@ -469,6 +469,7 @@ ppcboot_bfd_print_private_bfd_data (abfd, farg) #define ppcboot_bfd_relax_section bfd_generic_relax_section #define ppcboot_bfd_gc_sections bfd_generic_gc_sections #define ppcboot_bfd_merge_sections bfd_generic_merge_sections +#define ppcboot_bfd_discard_group bfd_generic_discard_group #define ppcboot_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define ppcboot_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define ppcboot_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/section.c b/bfd/section.c index 70c7f27d029..96130b9d3fb 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -1378,21 +1378,19 @@ _bfd_strip_section_from_output (info, s) /* FUNCTION - bfd_discard_group + bfd_generic_discard_group SYNOPSIS - void bfd_discard_group (bfd *abfd, asection *group); + boolean bfd_generic_discard_group (bfd *abfd, asection *group); DESCRIPTION Remove all members of @var{group} from the output. */ -void -bfd_discard_group (abfd, group) - bfd *abfd; - asection *group; +boolean +bfd_generic_discard_group (abfd, group) + bfd *abfd ATTRIBUTE_UNUSED; + asection *group ATTRIBUTE_UNUSED; { - if ((group->flags & SEC_GROUP) != 0 - && abfd->xvec->flavour == bfd_target_elf_flavour) - bfd_elf_discard_group (abfd, group); + return true; } diff --git a/bfd/som.c b/bfd/som.c index 55c9013572a..6bb27f7a220 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -6340,6 +6340,7 @@ som_bfd_link_split_section (abfd, sec) #define som_bfd_gc_sections bfd_generic_gc_sections #define som_bfd_merge_sections bfd_generic_merge_sections +#define som_bfd_discard_group bfd_generic_discard_group const bfd_target som_vec = { "som", /* name */ diff --git a/bfd/srec.c b/bfd/srec.c index b556f267379..e7a27be2ce6 100644 --- a/bfd/srec.c +++ b/bfd/srec.c @@ -1270,6 +1270,7 @@ srec_print_symbol (abfd, afile, symbol, how) #define srec_bfd_relax_section bfd_generic_relax_section #define srec_bfd_gc_sections bfd_generic_gc_sections #define srec_bfd_merge_sections bfd_generic_merge_sections +#define srec_bfd_discard_group bfd_generic_discard_group #define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define srec_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/targets.c b/bfd/targets.c index 7f7f485afc6..6902f4126b6 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -400,7 +400,8 @@ the tokens. .CONCAT2 (NAME,_bfd_final_link), \ .CONCAT2 (NAME,_bfd_link_split_section), \ .CONCAT2 (NAME,_bfd_gc_sections), \ -.CONCAT2 (NAME,_bfd_merge_sections) +.CONCAT2 (NAME,_bfd_merge_sections), \ +.CONCAT2 (NAME,_bfd_discard_group) . int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); . bfd_byte *(*_bfd_get_relocated_section_contents) . PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, @@ -435,6 +436,9 @@ the tokens. . {* Attempt to merge SEC_MERGE sections. *} . boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); . +. {* Discard members of a group. *} +. boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); +. . {* Routines to handle dynamic symbols and relocs. *} .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ .CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ diff --git a/bfd/tekhex.c b/bfd/tekhex.c index 4391da18441..8efd401dbda 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -1005,6 +1005,7 @@ tekhex_print_symbol (abfd, filep, symbol, how) #define tekhex_bfd_relax_section bfd_generic_relax_section #define tekhex_bfd_gc_sections bfd_generic_gc_sections #define tekhex_bfd_merge_sections bfd_generic_merge_sections +#define tekhex_bfd_discard_group bfd_generic_discard_group #define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define tekhex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/versados.c b/bfd/versados.c index e1cd9f7dc5e..297bbe60a4a 100644 --- a/bfd/versados.c +++ b/bfd/versados.c @@ -867,6 +867,7 @@ versados_canonicalize_reloc (abfd, section, relptr, symbols) #define versados_bfd_relax_section bfd_generic_relax_section #define versados_bfd_gc_sections bfd_generic_gc_sections #define versados_bfd_merge_sections bfd_generic_merge_sections +#define versados_bfd_discard_group bfd_generic_discard_group #define versados_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define versados_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define versados_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/vms.c b/bfd/vms.c index d2fb16b645d..60326179b32 100644 --- a/bfd/vms.c +++ b/bfd/vms.c @@ -133,6 +133,7 @@ static boolean vms_bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); #define vms_make_empty_symbol _bfd_generic_make_empty_symbol #define vms_bfd_link_just_syms _bfd_generic_link_just_syms +#define vms_bfd_discard_group bfd_generic_discard_group /*===========================================================================*/ diff --git a/bfd/xcoff-target.h b/bfd/xcoff-target.h index 0787b8de3e2..adbc9a1cc3d 100644 --- a/bfd/xcoff-target.h +++ b/bfd/xcoff-target.h @@ -98,6 +98,7 @@ extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd)); #define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section #define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections #define _bfd_xcoff_bfd_merge_sections coff_bfd_merge_sections +#define _bfd_xcoff_bfd_discard_group bfd_generic_discard_group #define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section /* XCOFF archives do not have anything which corresponds to an |