From patchwork Tue Feb 9 03:23:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: PR27382, build failure if fileno() is a macro X-Patchwork-Submitter: Andreas Krebbel via Binutils X-Patchwork-Id: 48702 Message-Id: <20210209032356.GV5348@bubble.grove.modra.org> To: binutils@sourceware.org Date: Tue, 9 Feb 2021 13:53:56 +1030 From: Alan Modra via Binutils List-Id: Binutils mailing list We lost the fix for this problem in the smart_rename reversion. Committed to the 2.36 branch. PR 27382 * objcopy.c (copy_file): Use bfd_stat. -- Alan Modra Australia Development Lab, IBM diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 00d751522c4..eab3b6db585 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -3769,7 +3769,7 @@ copy_file (const char *input_filename, const char *output_filename, int ofd, /* To allow us to do "strip *" without dying on the first non-object file, failures are nonfatal. */ ibfd = bfd_openr (input_filename, input_target); - if (ibfd == NULL || fstat (fileno (ibfd->iostream), in_stat) != 0) + if (ibfd == NULL || bfd_stat (ibfd, in_stat) != 0) { bfd_nonfatal_message (input_filename, NULL, NULL, NULL); status = 1;