bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] gas/as.c: print input and output details when error


From: Robert Yang
Subject: [PATCH 1/2] gas/as.c: print input and output details when error
Date: Thu, 9 Aug 2018 11:38:24 +0800

Print input and output details (filename, inode number) when error, this makes
the debug easier.

Signed-off-by: Robert Yang <address@hidden>
---
 gas/as.c | 4 +++-
 gas/as.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/gas/as.c b/gas/as.c
index 02c7d29..6afe9a5 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -1259,8 +1259,10 @@ main (int argc, char ** argv)
              if (sib.st_ino == sob.st_ino && sib.st_ino != 0)
                {
                  /* Don't let as_fatal remove the output file!  */
+                 saved_out_file_name = xstrdup (out_file_name);
                  out_file_name = NULL;
-                 as_fatal (_("The input and output files must be distinct"));
+                 as_fatal (_("The input (%s, ino: %ld) and output (%s, ino: 
%ld) files must be distinct"),
+                          argv[i], sib.st_ino, saved_out_file_name, 
sob.st_ino);
                }
            }
        }
diff --git a/gas/as.h b/gas/as.h
index 52bb5a7..d97d9b5 100644
--- a/gas/as.h
+++ b/gas/as.h
@@ -375,6 +375,7 @@ COMMON int flag_noexecstack;
 
 /* name of emitted object file */
 COMMON const char *out_file_name;
+COMMON const char *saved_out_file_name;
 
 /* name of file defining extensions to the basic instruction set */
 COMMON char *insttbl_file_name;
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]