Fix a problem in the assembler when checking for overlapping input and output files...
authorNick Clifton <nickc@redhat.com>
Mon, 14 May 2018 12:05:02 +0000 (13:05 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 14 May 2018 12:05:02 +0000 (13:05 +0100)
PR 23153
* as.c (main): When checking for an output file that is also an
input file, also check that the inode is not zero.

gas/ChangeLog
gas/as.c

index 200879cdba3dce70da28f7cae1df98bca68f560a..8322ccf4e79e6a89da878df284ab194a9017303f 100644 (file)
@@ -1,3 +1,9 @@
+2018-05-14  Nick Clifton  <nickc@redhat.com>
+
+       PR 23153
+       * as.c (main): When checking for an output file that is also an
+       input file, also check that the inode is not zero.
+
 2018-05-12  Alan Modra  <amodra@gmail.com>
 
        * config/tc-score.c (s3_do_macro_bcmp): Don't use fixed size
index cdf8cfed487a432b75f9d9a766ffd43721a08e7b..02c7d2970bf3c4690aa684c9d6446f6731395a79 100644 (file)
--- a/gas/as.c
+++ b/gas/as.c
@@ -1256,7 +1256,7 @@ main (int argc, char ** argv)
 
          if (stat (argv[i], &sib) == 0)
            {
-             if (sib.st_ino == sob.st_ino)
+             if (sib.st_ino == sob.st_ino && sib.st_ino != 0)
                {
                  /* Don't let as_fatal remove the output file!  */
                  out_file_name = NULL;