X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Fformat.c;h=1d1363d18403cef706ec1a81f164c5b6521dd20f;hb=5024637fac653914d471808288dc3221bc7ec089;hp=c4afd97d082546ca3b7fa45a22e8f97bd3703024;hpb=7cf7fcc83ca9fb4c4b591b3142bcf12e6e8a2aa5;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/format.c b/bfd/format.c index c4afd97d08..1d1363d184 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -1,5 +1,5 @@ /* Generic BFD support for file formats. - Copyright (C) 1990-2018 Free Software Foundation, Inc. + Copyright (C) 1990-2019 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -290,8 +290,15 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) { const bfd_target *temp; - /* Don't check the default target twice. */ + /* The binary target matches anything, so don't return it when + searching. Don't match the plugin target if we have another + alternative since we want to properly set the input format + before allowing a plugin to claim the file. Also, don't + check the default target twice. */ if (*target == &binary_vec +#if BFD_SUPPORTS_PLUGINS + || (match_count != 0 && *target == &plugin_vec) +#endif || (!abfd->target_defaulted && *target == save_targ)) continue;