Tidy ld/ldmisc.c

The idea here is to not use elf-bfd.h and coff-bfd.h in generic linker
code.

bfd/
	* targets.c (struct bfd_target): Add _bfd_group_name.
	(BFD_JUMP_TABLE): Likewise.
	* coffgen.c (bfd_coff_group_name): New function.
	* elf.c (bfd_elf_group_name): New function.
	* linker.c (_bfd_nolink_bfd_group_name): New function.
	* section.c (bfd_generic_group_name): New function.
	* elf-bfd.h (bfd_elf_group_name): Declare.
	* libbfd-in.h (_bfd_nolink_bfd_group_name): Declare.
	* libcoff-in.h (bfd_coff_group_name): Declare.
	* aout-target.h (MY_bfd_group_name): Define.
	* aout-tic30.c (MY_bfd_group_name): Define.
	* bfd.c (bfd_group_name): Define.
	* binary.c (binary_bfd_group_name): Define.
	* coff-alpha.c (_bfd_ecoff_bfd_group_name): Define.
	* coff-mips.c (_bfd_ecoff_bfd_group_name): Define.
	* coff-rs6000.c (_bfd_xcoff_bfd_group_name): Define.
	* coffcode.h (coff_bfd_group_name): Define.
	* elfxx-target.h (bfd_elfNN_bfd_group_name): Define.
	* i386msdos.c (msdos_bfd_group_name): Define.
	* ihex.c (ihex_bfd_group_name): Define.
	* mach-o-target.c (bfd_mach_o_bfd_group_name): Define.
	* mmo.c (mmo_bfd_group_name): Define.
	* pef.c (bfd_pef_bfd_group_name): Define.
	* plugin.c (bfd_plugin_bfd_group_name): Define.
	* ppcboot.c (ppcboot_bfd_group_name): Define.
	* som.c (som_bfd_group_name): Define.
	* srec.c (srec_bfd_group_name): Define.
	* tekhex.c (tekhex_bfd_group_name): Define.
	* verilog.c (verilog_bfd_group_name): Define.
	* vms-alpha.c (vms_bfd_group_name, alpha_vms_bfd_group_name): Define.
	* xsym.c (bfd_sym_bfd_group_name): Define.
	* coff64-rs6000.c (rs6000_xcoff64_vec): Init new field.
	(rs6000_xcoff64_aix_vec): Likewise.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
	* libcoff.h: Regenerate.
ld/
	* ldmisc.c: Don't #include elf-bfd.h or coff-bfd.h.
	(vfinfo): Use bfd_group_name.
This commit is contained in:
Alan Modra 2019-09-09 15:23:27 +09:30
parent 0410b45003
commit cb7f4b298e
37 changed files with 155 additions and 19 deletions

View File

@ -1,3 +1,42 @@
2019-09-11 Alan Modra <amodra@gmail.com>
* targets.c (struct bfd_target): Add _bfd_group_name.
(BFD_JUMP_TABLE): Likewise.
* coffgen.c (bfd_coff_group_name): New function.
* elf.c (bfd_elf_group_name): New function.
* linker.c (_bfd_nolink_bfd_group_name): New function.
* section.c (bfd_generic_group_name): New function.
* elf-bfd.h (bfd_elf_group_name): Declare.
* libbfd-in.h (_bfd_nolink_bfd_group_name): Declare.
* libcoff-in.h (bfd_coff_group_name): Declare.
* aout-target.h (MY_bfd_group_name): Define.
* aout-tic30.c (MY_bfd_group_name): Define.
* bfd.c (bfd_group_name): Define.
* binary.c (binary_bfd_group_name): Define.
* coff-alpha.c (_bfd_ecoff_bfd_group_name): Define.
* coff-mips.c (_bfd_ecoff_bfd_group_name): Define.
* coff-rs6000.c (_bfd_xcoff_bfd_group_name): Define.
* coffcode.h (coff_bfd_group_name): Define.
* elfxx-target.h (bfd_elfNN_bfd_group_name): Define.
* i386msdos.c (msdos_bfd_group_name): Define.
* ihex.c (ihex_bfd_group_name): Define.
* mach-o-target.c (bfd_mach_o_bfd_group_name): Define.
* mmo.c (mmo_bfd_group_name): Define.
* pef.c (bfd_pef_bfd_group_name): Define.
* plugin.c (bfd_plugin_bfd_group_name): Define.
* ppcboot.c (ppcboot_bfd_group_name): Define.
* som.c (som_bfd_group_name): Define.
* srec.c (srec_bfd_group_name): Define.
* tekhex.c (tekhex_bfd_group_name): Define.
* verilog.c (verilog_bfd_group_name): Define.
* vms-alpha.c (vms_bfd_group_name, alpha_vms_bfd_group_name): Define.
* xsym.c (bfd_sym_bfd_group_name): Define.
* coff64-rs6000.c (rs6000_xcoff64_vec): Init new field.
(rs6000_xcoff64_aix_vec): Likewise.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
2019-09-10 Nick Clifton <nickc@redhat.com>
PR 24907

View File

@ -502,6 +502,9 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
#ifndef MY_bfd_is_group_section
#define MY_bfd_is_group_section bfd_generic_is_group_section
#endif
#ifndef MY_bfd_group_name
#define MY_bfd_group_name bfd_generic_group_name
#endif
#ifndef MY_bfd_discard_group
#define MY_bfd_discard_group bfd_generic_discard_group
#endif

View File

@ -991,6 +991,9 @@ tic30_aout_set_arch_mach (bfd *abfd,
#ifndef MY_bfd_is_group_section
#define MY_bfd_is_group_section bfd_generic_is_group_section
#endif
#ifndef MY_bfd_group_name
#define MY_bfd_group_name bfd_generic_group_name
#endif
#ifndef MY_bfd_discard_group
#define MY_bfd_discard_group bfd_generic_discard_group
#endif

View File

@ -2002,6 +2002,8 @@ bfd_boolean bfd_copy_private_section_data
(ibfd, isection, obfd, osection))
bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
const char *bfd_generic_group_name (bfd *, const asection *sec);
bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
/* Extracted from archures.c. */
@ -7477,6 +7479,9 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
#define bfd_is_group_section(abfd, sec) \
BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
#define bfd_group_name(abfd, sec) \
BFD_SEND (abfd, _bfd_group_name, (abfd, sec))
#define bfd_discard_group(abfd, sec) \
BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
@ -7908,6 +7913,7 @@ typedef struct bfd_target
NAME##_bfd_lookup_section_flags, \
NAME##_bfd_merge_sections, \
NAME##_bfd_is_group_section, \
NAME##_bfd_group_name, \
NAME##_bfd_discard_group, \
NAME##_section_already_linked, \
NAME##_bfd_define_common_symbol, \
@ -7966,6 +7972,9 @@ typedef struct bfd_target
/* Is this section a member of a group? */
bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
/* The group name, if section is a member of a group. */
const char *(*_bfd_group_name) (bfd *, const struct bfd_section *);
/* Discard members of a group. */
bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);

View File

@ -1862,6 +1862,9 @@ DESCRIPTION
.#define bfd_is_group_section(abfd, sec) \
. BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
.
.#define bfd_group_name(abfd, sec) \
. BFD_SEND (abfd, _bfd_group_name, (abfd, sec))
.
.#define bfd_discard_group(abfd, sec) \
. BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
.

View File

@ -307,6 +307,7 @@ binary_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
#define binary_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define binary_bfd_merge_sections bfd_generic_merge_sections
#define binary_bfd_is_group_section bfd_generic_is_group_section
#define binary_bfd_group_name bfd_generic_group_name
#define binary_bfd_discard_group bfd_generic_discard_group
#define binary_section_already_linked _bfd_generic_section_already_linked
#define binary_bfd_define_common_symbol bfd_generic_define_common_symbol

View File

@ -2390,6 +2390,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
#define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections
#define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections
#define _bfd_ecoff_bfd_is_group_section bfd_generic_is_group_section
#define _bfd_ecoff_bfd_group_name bfd_generic_group_name
#define _bfd_ecoff_bfd_discard_group bfd_generic_discard_group
#define _bfd_ecoff_section_already_linked \
_bfd_coff_section_already_linked

View File

@ -1416,6 +1416,7 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
#define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections
#define _bfd_ecoff_bfd_is_group_section bfd_generic_is_group_section
#define _bfd_ecoff_bfd_group_name bfd_generic_group_name
#define _bfd_ecoff_bfd_discard_group bfd_generic_discard_group
#define _bfd_ecoff_section_already_linked \
_bfd_coff_section_already_linked

View File

@ -4057,6 +4057,7 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = {
#define _bfd_xcoff_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define _bfd_xcoff_bfd_merge_sections bfd_generic_merge_sections
#define _bfd_xcoff_bfd_is_group_section bfd_generic_is_group_section
#define _bfd_xcoff_bfd_group_name bfd_generic_group_name
#define _bfd_xcoff_bfd_discard_group bfd_generic_discard_group
#define _bfd_xcoff_section_already_linked _bfd_generic_section_already_linked
#define _bfd_xcoff_bfd_define_common_symbol _bfd_xcoff_define_common_symbol

View File

@ -2778,6 +2778,7 @@ const bfd_target rs6000_xcoff64_vec =
bfd_generic_lookup_section_flags,
bfd_generic_merge_sections,
bfd_generic_is_group_section,
bfd_generic_group_name,
bfd_generic_discard_group,
_bfd_generic_section_already_linked,
_bfd_xcoff_define_common_symbol,
@ -3040,6 +3041,7 @@ const bfd_target rs6000_xcoff64_aix_vec =
bfd_generic_lookup_section_flags,
bfd_generic_merge_sections,
bfd_generic_is_group_section,
bfd_generic_group_name,
bfd_generic_discard_group,
_bfd_generic_section_already_linked,
_bfd_xcoff_define_common_symbol,

View File

@ -5751,6 +5751,10 @@ static bfd_coff_backend_data bigobj_swap_table =
#define coff_bfd_is_group_section bfd_generic_is_group_section
#endif
#ifndef coff_bfd_group_name
#define coff_bfd_group_name bfd_coff_group_name
#endif
#ifndef coff_bfd_discard_group
#define coff_bfd_discard_group bfd_generic_discard_group
#endif

View File

@ -3155,3 +3155,14 @@ bfd_coff_gc_sections (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
/* ... and mark SEC_EXCLUDE for those that go. */
return coff_gc_sweep (abfd, info);
}
/* Return name used to identify a comdat group. */
const char *
bfd_coff_group_name (bfd *abfd, const asection *sec)
{
struct coff_comdat_info *ci = bfd_coff_get_comdat_section (abfd, sec);
if (ci != NULL)
return ci->name;
return NULL;
}

View File

@ -2111,6 +2111,8 @@ extern bfd_boolean _bfd_elf_match_sections_by_type
(bfd *, const asection *, bfd *, const asection *);
extern bfd_boolean bfd_elf_is_group_section
(bfd *, const struct bfd_section *);
extern const char *bfd_elf_group_name
(bfd *, const struct bfd_section *);
extern bfd_boolean _bfd_elf_section_already_linked
(bfd *, asection *, struct bfd_link_info *);
extern void bfd_elf_set_group_contents

View File

@ -974,6 +974,14 @@ bfd_elf_is_group_section (bfd *abfd ATTRIBUTE_UNUSED, const asection *sec)
return elf_next_in_group (sec) != NULL;
}
const char *
bfd_elf_group_name (bfd *abfd ATTRIBUTE_UNUSED, const asection *sec)
{
if (elf_sec_group (sec) != NULL)
return elf_group_name (sec);
return NULL;
}
static char *
convert_debug_to_zdebug (bfd *abfd, const char *name)
{

View File

@ -192,6 +192,10 @@
#define bfd_elfNN_bfd_is_group_section bfd_elf_is_group_section
#endif
#ifndef bfd_elfNN_bfd_group_name
#define bfd_elfNN_bfd_group_name bfd_elf_group_name
#endif
#ifndef bfd_elfNN_bfd_discard_group
#define bfd_elfNN_bfd_discard_group bfd_generic_discard_group
#endif

View File

@ -226,6 +226,7 @@ msdos_set_section_contents (bfd *abfd,
#define msdos_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define msdos_bfd_merge_sections bfd_generic_merge_sections
#define msdos_bfd_is_group_section bfd_generic_is_group_section
#define msdos_bfd_group_name bfd_generic_group_name
#define msdos_bfd_discard_group bfd_generic_discard_group
#define msdos_section_already_linked \
_bfd_generic_section_already_linked

View File

@ -962,6 +962,7 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
#define ihex_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define ihex_bfd_merge_sections bfd_generic_merge_sections
#define ihex_bfd_is_group_section bfd_generic_is_group_section
#define ihex_bfd_group_name bfd_generic_group_name
#define ihex_bfd_discard_group bfd_generic_discard_group
#define ihex_section_already_linked _bfd_generic_section_already_linked
#define ihex_bfd_define_common_symbol bfd_generic_define_common_symbol

View File

@ -523,6 +523,8 @@ extern bfd_boolean _bfd_nolink_bfd_lookup_section_flags
#define _bfd_nolink_bfd_merge_sections _bfd_bool_bfd_link_false_error
extern bfd_boolean _bfd_nolink_bfd_is_group_section
(bfd *, const asection *) ATTRIBUTE_HIDDEN;
extern const char *_bfd_nolink_bfd_group_name
(bfd *, const asection *) ATTRIBUTE_HIDDEN;
extern bfd_boolean _bfd_nolink_bfd_discard_group
(bfd *, asection *) ATTRIBUTE_HIDDEN;
extern struct bfd_link_hash_table *_bfd_nolink_bfd_link_hash_table_create

View File

@ -528,6 +528,8 @@ extern bfd_boolean _bfd_nolink_bfd_lookup_section_flags
#define _bfd_nolink_bfd_merge_sections _bfd_bool_bfd_link_false_error
extern bfd_boolean _bfd_nolink_bfd_is_group_section
(bfd *, const asection *) ATTRIBUTE_HIDDEN;
extern const char *_bfd_nolink_bfd_group_name
(bfd *, const asection *) ATTRIBUTE_HIDDEN;
extern bfd_boolean _bfd_nolink_bfd_discard_group
(bfd *, asection *) ATTRIBUTE_HIDDEN;
extern struct bfd_link_hash_table *_bfd_nolink_bfd_link_hash_table_create

View File

@ -577,7 +577,8 @@ extern bfd_boolean _bfd_coff_reloc_link_order
struct bfd_link_order *);
extern bfd_boolean bfd_coff_gc_sections
(bfd *, struct bfd_link_info *);
extern const char *bfd_coff_group_name
(bfd *, const asection *);
#define coff_get_section_contents_in_window \
_bfd_generic_get_section_contents_in_window

View File

@ -581,7 +581,8 @@ extern bfd_boolean _bfd_coff_reloc_link_order
struct bfd_link_order *);
extern bfd_boolean bfd_coff_gc_sections
(bfd *, struct bfd_link_info *);
extern const char *bfd_coff_group_name
(bfd *, const asection *);
#define coff_get_section_contents_in_window \
_bfd_generic_get_section_contents_in_window

View File

@ -3461,6 +3461,13 @@ _bfd_nolink_bfd_is_group_section (bfd *abfd,
return _bfd_bool_bfd_false_error (abfd);
}
const char *
_bfd_nolink_bfd_group_name (bfd *abfd,
const asection *sec ATTRIBUTE_UNUSED)
{
return _bfd_ptr_bfd_null_error (abfd);
}
bfd_boolean
_bfd_nolink_bfd_discard_group (bfd *abfd, asection *sec ATTRIBUTE_UNUSED)
{

View File

@ -52,6 +52,7 @@
#define bfd_mach_o_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define bfd_mach_o_bfd_merge_sections bfd_generic_merge_sections
#define bfd_mach_o_bfd_is_group_section bfd_generic_is_group_section
#define bfd_mach_o_bfd_group_name bfd_generic_group_name
#define bfd_mach_o_bfd_discard_group bfd_generic_discard_group
#define bfd_mach_o_section_already_linked _bfd_generic_section_already_linked
#define bfd_mach_o_bfd_define_common_symbol bfd_generic_define_common_symbol

View File

@ -3311,6 +3311,7 @@ mmo_write_object_contents (bfd *abfd)
#define mmo_bfd_relax_section bfd_generic_relax_section
#define mmo_bfd_merge_sections bfd_generic_merge_sections
#define mmo_bfd_is_group_section bfd_generic_is_group_section
#define mmo_bfd_group_name bfd_generic_group_name
#define mmo_bfd_discard_group bfd_generic_discard_group
#define mmo_section_already_linked \
_bfd_generic_section_already_linked

View File

@ -56,6 +56,7 @@
#define bfd_pef_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define bfd_pef_bfd_merge_sections bfd_generic_merge_sections
#define bfd_pef_bfd_is_group_section bfd_generic_is_group_section
#define bfd_pef_bfd_group_name bfd_generic_group_name
#define bfd_pef_bfd_discard_group bfd_generic_discard_group
#define bfd_pef_section_already_linked _bfd_generic_section_already_linked
#define bfd_pef_bfd_define_common_symbol bfd_generic_define_common_symbol

View File

@ -102,6 +102,7 @@ dlerror (void)
#define bfd_plugin_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define bfd_plugin_bfd_merge_sections bfd_generic_merge_sections
#define bfd_plugin_bfd_is_group_section bfd_generic_is_group_section
#define bfd_plugin_bfd_group_name bfd_generic_group_name
#define bfd_plugin_bfd_discard_group bfd_generic_discard_group
#define bfd_plugin_section_already_linked _bfd_generic_section_already_linked
#define bfd_plugin_bfd_define_common_symbol bfd_generic_define_common_symbol

View File

@ -456,6 +456,7 @@ ppcboot_bfd_print_private_bfd_data (bfd *abfd, void * farg)
#define ppcboot_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define ppcboot_bfd_merge_sections bfd_generic_merge_sections
#define ppcboot_bfd_is_group_section bfd_generic_is_group_section
#define ppcboot_bfd_group_name bfd_generic_group_name
#define ppcboot_bfd_discard_group bfd_generic_discard_group
#define ppcboot_section_already_linked \
_bfd_generic_section_already_linked

View File

@ -1662,6 +1662,24 @@ bfd_generic_is_group_section (bfd *abfd ATTRIBUTE_UNUSED,
return FALSE;
}
/*
FUNCTION
bfd_generic_group_name
SYNOPSIS
const char *bfd_generic_group_name (bfd *, const asection *sec);
DESCRIPTION
Returns group name if @var{sec} is a member of a group.
*/
const char *
bfd_generic_group_name (bfd *abfd ATTRIBUTE_UNUSED,
const asection *sec ATTRIBUTE_UNUSED)
{
return NULL;
}
/*
FUNCTION
bfd_generic_discard_group

View File

@ -6756,6 +6756,7 @@ som_bfd_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
#define som_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define som_bfd_merge_sections bfd_generic_merge_sections
#define som_bfd_is_group_section bfd_generic_is_group_section
#define som_bfd_group_name bfd_generic_group_name
#define som_bfd_discard_group bfd_generic_discard_group
#define som_section_already_linked _bfd_generic_section_already_linked
#define som_bfd_define_common_symbol bfd_generic_define_common_symbol

View File

@ -1275,6 +1275,7 @@ srec_print_symbol (bfd *abfd,
#define srec_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define srec_bfd_merge_sections bfd_generic_merge_sections
#define srec_bfd_is_group_section bfd_generic_is_group_section
#define srec_bfd_group_name bfd_generic_group_name
#define srec_bfd_discard_group bfd_generic_discard_group
#define srec_section_already_linked _bfd_generic_section_already_linked
#define srec_bfd_define_common_symbol bfd_generic_define_common_symbol

View File

@ -462,6 +462,7 @@ BFD_JUMP_TABLE macros.
. NAME##_bfd_lookup_section_flags, \
. NAME##_bfd_merge_sections, \
. NAME##_bfd_is_group_section, \
. NAME##_bfd_group_name, \
. NAME##_bfd_discard_group, \
. NAME##_section_already_linked, \
. NAME##_bfd_define_common_symbol, \
@ -520,6 +521,9 @@ BFD_JUMP_TABLE macros.
. {* Is this section a member of a group? *}
. bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
.
. {* The group name, if section is a member of a group. *}
. const char *(*_bfd_group_name) (bfd *, const struct bfd_section *);
.
. {* Discard members of a group. *}
. bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
.

View File

@ -978,6 +978,7 @@ tekhex_print_symbol (bfd *abfd,
#define tekhex_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define tekhex_bfd_merge_sections bfd_generic_merge_sections
#define tekhex_bfd_is_group_section bfd_generic_is_group_section
#define tekhex_bfd_group_name bfd_generic_group_name
#define tekhex_bfd_discard_group bfd_generic_discard_group
#define tekhex_section_already_linked _bfd_generic_section_already_linked
#define tekhex_bfd_define_common_symbol bfd_generic_define_common_symbol

View File

@ -368,6 +368,7 @@ verilog_mkobject (bfd *abfd)
#define verilog_bfd_gc_sections bfd_generic_gc_sections
#define verilog_bfd_merge_sections bfd_generic_merge_sections
#define verilog_bfd_is_group_section bfd_generic_is_group_section
#define verilog_bfd_group_name bfd_generic_group_name
#define verilog_bfd_discard_group bfd_generic_discard_group
#define verilog_section_already_linked _bfd_generic_section_already_linked
#define verilog_bfd_link_hash_table_create _bfd_generic_link_hash_table_create

View File

@ -9504,6 +9504,7 @@ bfd_vms_get_data (bfd *abfd)
#define vms_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
#define vms_bfd_is_group_section bfd_generic_is_group_section
#define vms_bfd_group_name bfd_generic_group_name
#define vms_bfd_discard_group bfd_generic_discard_group
#define vms_section_already_linked _bfd_generic_section_already_linked
#define vms_bfd_define_common_symbol bfd_generic_define_common_symbol
@ -9550,6 +9551,7 @@ bfd_vms_get_data (bfd *abfd)
#define alpha_vms_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define alpha_vms_bfd_merge_sections bfd_generic_merge_sections
#define alpha_vms_bfd_is_group_section bfd_generic_is_group_section
#define alpha_vms_bfd_group_name bfd_generic_group_name
#define alpha_vms_bfd_discard_group bfd_generic_discard_group
#define alpha_vms_section_already_linked \
_bfd_generic_section_already_linked

View File

@ -48,6 +48,7 @@
#define bfd_sym_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define bfd_sym_bfd_merge_sections bfd_generic_merge_sections
#define bfd_sym_bfd_is_group_section bfd_generic_is_group_section
#define bfd_sym_bfd_group_name bfd_generic_group_name
#define bfd_sym_bfd_discard_group bfd_generic_discard_group
#define bfd_sym_section_already_linked _bfd_generic_section_already_linked
#define bfd_sym_bfd_define_common_symbol bfd_generic_define_common_symbol

View File

@ -1,3 +1,8 @@
2019-09-11 Alan Modra <amodra@gmail.com>
* ldmisc.c: Don't #include elf-bfd.h or coff-bfd.h.
(vfinfo): Use bfd_group_name.
2019-09-11 Alan Modra <amodra@gmail.com>
* plugin.c (asymbol_from_plugin_symbol): Move code handling

View File

@ -35,8 +35,6 @@
#include "ldlex.h"
#include "ldmain.h"
#include "ldfile.h"
#include "elf-bfd.h"
#include "coff-bfd.h"
/*
%% literal %
@ -431,26 +429,18 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bfd_boolean is_warning)
/* section name from a section */
asection *sec;
bfd *abfd;
const char *group = NULL;
struct coff_comdat_info *ci;
fmt++;
sec = (asection *) args[arg_no].p;
++arg_count;
abfd = sec->owner;
fprintf (fp, "%s", sec->name);
if (abfd != NULL
&& bfd_get_flavour (abfd) == bfd_target_elf_flavour
&& elf_next_in_group (sec) != NULL
&& (sec->flags & SEC_GROUP) == 0)
group = elf_group_name (sec);
else if (abfd != NULL
&& bfd_get_flavour (abfd) == bfd_target_coff_flavour
&& (ci = bfd_coff_get_comdat_section (sec->owner,
sec)) != NULL)
group = ci->name;
if (group != NULL)
fprintf (fp, "[%s]", group);
abfd = sec->owner;
if (abfd != NULL)
{
const char *group = bfd_group_name (abfd, sec);
if (group != NULL)
fprintf (fp, "[%s]", group);
}
}
else if (*fmt == 'B')
{