summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-02-09 13:32:36 +1030
committerAlan Modra <amodra@gmail.com>2021-02-09 13:37:59 +1030
commit7651a4871c225925ffdfda0a8c91a6ed370cd9a1 (patch)
tree3c3198ba2edd9e5e62781296a50d48534edd9e1a
parent179cd8fe065b1019f7fb24daf179a1428b000648 (diff)
downloadbinutils-gdb-7651a4871c225925ffdfda0a8c91a6ed370cd9a1.tar.gz
PR27382, build failure if fileno() is a macro
PR 27382 * objcopy.c (copy_file): Use bfd_stat.
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/objcopy.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 8b08bd0db79..b60e55d1632 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2021-02-09 Alan Modra <amodra@gmail.com>
+
+ PR 27382
+ * objcopy.c (copy_file): Use bfd_stat.
+
2021-02-06 Nick Clifton <nickc@redhat.com>
This is the 2.36.1 release.
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;