From: Alan Modra Date: Tue, 18 Dec 2001 11:54:10 +0000 (+0000) Subject: * objcopy.c (copy_archive): Set output bfd format outside the loop. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b667df2e28e04351ea2ee5b6fd32b51d4a302130;p=binutils-gdb.git * objcopy.c (copy_archive): Set output bfd format outside the loop. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 5efa892821c..440ae5b98aa 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2001-12-18 Alan Modra + + * objcopy.c (copy_archive): Set output bfd format outside the loop. + 2001-12-18 Nick Clifton * po/ja.po: Import from translation project. diff --git a/binutils/objcopy.c b/binutils/objcopy.c index f72a915103d..9a5971dacd3 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -1296,6 +1296,9 @@ copy_archive (ibfd, obfd, output_target) this_element = bfd_openr_next_archived_file (ibfd, NULL); + if (!bfd_set_format (obfd, bfd_get_format (ibfd))) + RETURN_NONFATAL (bfd_get_filename (obfd)); + while (!status && this_element != (bfd *) NULL) { /* Create an output file for this member. */ @@ -1323,9 +1326,6 @@ copy_archive (ibfd, obfd, output_target) if (output_bfd == (bfd *) NULL) RETURN_NONFATAL (output_name); - if (!bfd_set_format (obfd, bfd_get_format (ibfd))) - RETURN_NONFATAL (bfd_get_filename (obfd)); - if (bfd_check_format (this_element, bfd_object) == true) copy_object (this_element, output_bfd);