Add a test case for skip with inlined functions
[deliverable/binutils-gdb.git] / bfd / format.c
index c4afd97d082546ca3b7fa45a22e8f97bd3703024..1d1363d18403cef706ec1a81f164c5b6521dd20f 100644 (file)
@@ -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;
 
This page took 0.023313 seconds and 4 git commands to generate.