diff options
author | Alan Modra <amodra@gmail.com> | 2019-06-28 10:18:49 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-06-28 10:18:49 +0930 |
commit | 999d6dff80fab12d22c2a8d91923db6bde7fb3e5 (patch) | |
tree | 52f94654b2fd1984897dffd3a043f003e7c5b77a /bfd/configure.ac | |
parent | f60c61e60e59c2bfc5fdd1b448408c2af287899e (diff) | |
download | gdb-999d6dff80fab12d22c2a8d91923db6bde7fb3e5.zip gdb-999d6dff80fab12d22c2a8d91923db6bde7fb3e5.tar.gz gdb-999d6dff80fab12d22c2a8d91923db6bde7fb3e5.tar.bz2 |
Plugin target handling
This patch fixes failures with LTO on mingw32 targets. Since git
commit 7cf7fcc83c all possible targets (minus binary) are matched in
bfd_check_format_matches rather than lower priority targets being
excluded once a higher priority target matches. During linking that
results in the ld/plugin.c plugin_object_p function being called with
the input file xvec set to plugin_vec, which means
plugin_get_ir_dummy_bfd doesn't see the real format of the file
(pe-i386). It defaults to the output format instead, which happens to
be pei-i386, and this wrong choice persists for the dummy bfd.
pei-i386 isn't recognised as a valid linker input file.
So, omit recognizing a plugin object in bfd_check_format_matches when
some other object format matches, and make sure those other object
formats are checked first.
* format.c (bfd_check_format_matches): Don't match plugin target
if another target matches. Expand comment.
* targets.c (_bfd_target_vector): Move plugin_vec after all other
non-corefile targets, outside !SELECT_VECS.
* config.bfd: Don't handle targ=plugin here.
* configure.ac: Don't add plugin to enable_targets or handle in
target loop setting selvecs and other target vars.
* configure: Regenerate.
Diffstat (limited to 'bfd/configure.ac')
-rw-r--r-- | bfd/configure.ac | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bfd/configure.ac b/bfd/configure.ac index c941389..39702ce 100644 --- a/bfd/configure.ac +++ b/bfd/configure.ac @@ -46,10 +46,6 @@ ACX_LARGEFILE AM_CONDITIONAL(PLUGINS, test "$plugins" = "yes") -if test "$plugins" = "yes"; then - enable_targets="$enable_targets plugin" -fi - AC_ARG_ENABLE(64-bit-bfd, [ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)], [case "${enableval}" in @@ -349,12 +345,12 @@ selarchs= TDEFINES= for targ in $target $canon_targets do - if test "x$targ" = "xall"; then + if test $targ = all; then all_targets=true assocvecs="$assocvecs $targ_defvec $targ_selvecs" - else + elif test $targ != plugin; then . $srcdir/config.bfd - if test "x$targ" = "x$target"; then + if test $targ = $target; then defvec=$targ_defvec fi selvecs="$selvecs $targ_defvec $targ_selvecs" @@ -592,7 +588,6 @@ do pef_xlib_vec) tb="$tb pef.lo" ;; pj_elf32_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;; pj_elf32_le_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;; - plugin_vec) tb="$tb plugin.lo" ;; powerpc_boot_vec) tb="$tb ppcboot.lo" ;; powerpc_elf32_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; powerpc_elf32_le_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; @@ -719,6 +714,10 @@ do fi done +if test "$plugins" = "yes"; then + tb="$tb plugin.lo" +fi + # Target architecture .o files. # A couple of CPUs use shorter file names to avoid problems on DOS # filesystems. |