daily update
[deliverable/binutils-gdb.git] / bfd / format.c
index ba9ca9f6095366cf8ed4dc81cee78b844d83493c..848ac180bc22df03fa18a27c5cd334f9adc1e929 100644 (file)
@@ -1,13 +1,13 @@
 /* Generic BFD support for file formats.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
-   2003, 2005 Free Software Foundation, Inc.
+   2003, 2005, 2007 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -17,7 +17,9 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
 
 /*
 SECTION
@@ -42,8 +44,8 @@ SUBSECTION
        File format functions
 */
 
-#include "bfd.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "libbfd.h"
 
 /* IMPORT from targets.c.  */
@@ -217,7 +219,9 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
       const bfd_target *temp;
       bfd_error_type err;
 
-      if (*target == &binary_vec)
+      /* Don't check the default target twice.  */
+      if (*target == &binary_vec
+         || (!abfd->target_defaulted && *target == save_targ))
        continue;
 
       abfd->xvec = *target;    /* Change BFD's target temporarily.  */
This page took 0.023751 seconds and 4 git commands to generate.