Add missing parts of ChangeLog entry for my change of 2000/02/19 00:59:26 to coff...
[deliverable/binutils-gdb.git] / bfd / format.c
index a07935a464ab199326e9bf18365ed2bca48a62ef..c9f1f9cd4be3f6f2c521956114a386b7470eefdb 100644 (file)
@@ -118,6 +118,7 @@ bfd_check_format_matches (abfd, format, matching)
      bfd_format format;
      char ***matching;
 {
+  extern const bfd_target binary_vec;
   const bfd_target * const *target, *save_targ, *right_targ;
   char **matching_vector = NULL;
   int match_count;
@@ -174,9 +175,13 @@ bfd_check_format_matches (abfd, format, matching)
        not permit archives (e.g., the binary target), then we should
        not allow some other target to recognize it as an archive, but
        should instead allow the specified target to recognize it as an
-       object.  */
+       object.  When I first made this change, it broke the PE target,
+       because the specified pei-i386 target did not recognize the
+       actual pe-i386 archive.  Since there may be other problems of
+       this sort, I changed this test to check only for the binary
+       target.  */
 
-    if (format == bfd_archive)
+    if (format == bfd_archive && save_targ == &binary_vec)
       {
        abfd->xvec = save_targ;
        abfd->format = bfd_unknown;
@@ -188,7 +193,6 @@ bfd_check_format_matches (abfd, format, matching)
   }
 
   for (target = bfd_target_vector; *target != NULL; target++) {
-    extern const bfd_target binary_vec;
     const bfd_target *temp;
 
     if (*target == &binary_vec)
This page took 0.024006 seconds and 4 git commands to generate.