This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/2 V2] 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 | 4 +++-
 gas/as.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/gas/as.c b/gas/as.c
index 02c7d29..32d5bcd 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' and output '%s' have the same inode"),
+			   argv[i], saved_out_file_name);
 		}
 	    }
 	}
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]