From e54ae97fb7672350fc2bf28663cacf7721d9e30b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 24 Nov 2020 08:45:33 +1030 Subject: [PATCH] gas output_file_close error message Seen on arm-elf, where ELFOSABI_ARM is set too late to get a warning when processing ifunc related directives on their source line. ../gas/as-new ifunc.s -o tmpdir/ifunc.o ../gas/as-new: symbol type STT_GNU_IFUNC is supported only by GNU and FreeBSD targets ifunc.s: Assembler messages: ifunc.s: Fatal error: can't close tmpdir/ifunc.o: sorry, cannot handle this file This patch doesn't fix the real underlying problem, just the late error message where "can't close" is a misdirection in this case. * output-file.c (output_file_close): Remove "can't close" from error message. * testsuite/gas/mips/reginfo-2.l: Update expected output. --- gas/ChangeLog | 6 ++++++ gas/output-file.c | 3 +-- gas/testsuite/gas/mips/reginfo-2.l | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index b967e201ca..77007f44b7 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2020-11-25 Alan Modra + + * output-file.c (output_file_close): Remove "can't close" from + error message. + * testsuite/gas/mips/reginfo-2.l: Update expected output. + 2020-11-04 Przemyslaw Wirkus * config/tc-aarch64.c (aarch64_cpus): Add Cortex-A78C. diff --git a/gas/output-file.c b/gas/output-file.c index 573598101c..b8d2132277 100644 --- a/gas/output-file.c +++ b/gas/output-file.c @@ -68,6 +68,5 @@ output_file_close (const char *filename) stdoutput = NULL; if (! res) - as_fatal (_("can't close %s: %s"), filename, - bfd_errmsg (bfd_get_error ())); + as_fatal ("%s: %s", filename, bfd_errmsg (bfd_get_error ())); } diff --git a/gas/testsuite/gas/mips/reginfo-2.l b/gas/testsuite/gas/mips/reginfo-2.l index fd3efa93a2..3d171f2c09 100644 --- a/gas/testsuite/gas/mips/reginfo-2.l +++ b/gas/testsuite/gas/mips/reginfo-2.l @@ -1,3 +1,3 @@ .*: incorrect `\.reginfo' section size; expected 24, got 28 .*: Assembler messages: -.*: Fatal error: can't close .*: bad value +.*: Fatal error: .*: bad value -- 2.34.1