This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 1/2 V3] gas/as.c: print input and output filenames when error
- From: Robert Yang <liezhi dot yang at windriver dot com>
- To: <binutils at sourceware dot org>
- Cc: <nickc at redhat dot com>
- Date: Thu, 9 Aug 2018 19:45:00 +0800
- Subject: [PATCH 1/2 V3] gas/as.c: print input and output filenames when error
This makes the debug easier.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
gas/as.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gas/as.c b/gas/as.c
index 02c7d29..512ad59 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -1200,6 +1200,7 @@ main (int argc, char ** argv)
struct stat sob;
int macro_strip_at;
+ const char *saved_out_file_name;
start_time = get_run_time ();
signal_init ();
@@ -1258,9 +1259,11 @@ main (int argc, char ** argv)
{
if (sib.st_ino == sob.st_ino && sib.st_ino != 0)
{
+ saved_out_file_name = out_file_name;
/* Don't let as_fatal remove the output file! */
out_file_name = NULL;
- as_fatal (_("The input and output files must be distinct"));
+ as_fatal (_("The input '%s' and output '%s' are the same file"),
+ argv[i], saved_out_file_name);
}
}
}
--
2.7.4