aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-09-09 15:23:27 +0930
committerAlan Modra <amodra@gmail.com>2019-09-11 13:43:29 +0930
commitcb7f4b298e5e0a3ab4fb6b13aa89e970478597bc (patch)
treeaf4e431f5fd6f44b829eaebfacff1c6dc6147ac3 /ld
parent0410b45003d287eb29e9f2b949a29588c663bca1 (diff)
downloadgdb-cb7f4b298e5e0a3ab4fb6b13aa89e970478597bc.zip
gdb-cb7f4b298e5e0a3ab4fb6b13aa89e970478597bc.tar.gz
gdb-cb7f4b298e5e0a3ab4fb6b13aa89e970478597bc.tar.bz2
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.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldmisc.c24
2 files changed, 12 insertions, 17 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index d24973e..955d460 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,10 @@
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
ELF common symbols to block handling ELF visibility. Simplify
visibility setting.
diff --git a/ld/ldmisc.c b/ld/ldmisc.c
index f7ab7b5..319f247 100644
--- a/ld/ldmisc.c
+++ b/ld/ldmisc.c
@@ -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')
{