aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-09-09 15:00:55 +0100
committerNick Clifton <nickc@redhat.com>2020-09-09 15:00:55 +0100
commit10556cdc8e4340b0dcc2594aec044ba7b6da4aff (patch)
treecb6b6daae9f36ad39c0904ff954279cf1b6347de /bfd
parent15a32af52fdc010801396cbcf62f33d88435ac1a (diff)
downloadgdb-10556cdc8e4340b0dcc2594aec044ba7b6da4aff.zip
gdb-10556cdc8e4340b0dcc2594aec044ba7b6da4aff.tar.gz
gdb-10556cdc8e4340b0dcc2594aec044ba7b6da4aff.tar.bz2
Fix thinko in the code to check coff archive elements.
* cofflink.c (coff_link_check_archive_element): Move the check for coff type input to the start of the function.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/cofflink.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 180a894..f266901 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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.
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 8833cd0..6c68ca1 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -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;