aboutsummaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-12-18 11:54:10 +0000
committerAlan Modra <amodra@gmail.com>2001-12-18 11:54:10 +0000
commitb667df2e28e04351ea2ee5b6fd32b51d4a302130 (patch)
tree74a8e9a888e35e49b547d6c6b4fed44bcb356737 /binutils/objcopy.c
parent9e2a48988a4e469d5010bcd27c036ef9ee10a53e (diff)
downloadgdb-b667df2e28e04351ea2ee5b6fd32b51d4a302130.zip
gdb-b667df2e28e04351ea2ee5b6fd32b51d4a302130.tar.gz
gdb-b667df2e28e04351ea2ee5b6fd32b51d4a302130.tar.bz2
* objcopy.c (copy_archive): Set output bfd format outside the loop.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index f72a915..9a5971d 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);