Fix thinko in the code to check coff archive elements.
authorNick Clifton <nickc@redhat.com>
Wed, 9 Sep 2020 14:00:55 +0000 (15:00 +0100)
committerNick Clifton <nickc@redhat.com>
Wed, 9 Sep 2020 14:00:55 +0000 (15:00 +0100)
* cofflink.c (coff_link_check_archive_element): Move the check for
coff type input to the start of the function.

bfd/ChangeLog
bfd/cofflink.c

index 180a894da97c40fbd148cc507e9342976e72f460..f26690145e32129f6632a3a1113f0c121a0854cf 100644 (file)
@@ -1,3 +1,8 @@
+2020-09-09  Nick Clifton  <nickc@redhat.com>
+
+       * cofflink.c (coff_link_check_archive_element): Move the check for
+       coff type input to the start of the function.
+
 2020-09-09  Alan Modra  <amodra@gmail.com>
 
        * libbfd-in.h (_bfd_write_unsigned_leb128): Declare.
index 8833cd0caf9c46e7d58666691b008708a46efe3c..6c68ca1d28a9b61f9f46d75f4dd97a5333fb6665 100644 (file)
@@ -206,6 +206,10 @@ coff_link_check_archive_element (bfd *abfd,
 {
   *pneeded = FALSE;
 
+  /* PR 22369 - Skip non COFF objects in the archive.  */
+  if (! bfd_family_coff (abfd))
+    return TRUE;
+
   /* We are only interested in symbols that are currently undefined.
      If a symbol is currently known to be common, COFF linkers do not
      bring in an object file which defines it.  */
@@ -218,10 +222,6 @@ coff_link_check_archive_element (bfd *abfd,
   if (((struct coff_link_hash_entry *) h)->indx == -3)
     return TRUE;
 
-  /* PR 22369 - Skip non COFF objects in the archive.  */
-  if (! bfd_family_coff (abfd))
-    return TRUE;
-
   /* Include this element?  */
   if (!(*info->callbacks->add_archive_element) (info, abfd, name, &abfd))
     return TRUE;
This page took 0.026441 seconds and 4 git commands to generate.