public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gas: accept custom ".linefile <n> ."
@ 2022-11-11  7:32 Jan Beulich
  2022-11-14 13:43 ` Nick Clifton
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2022-11-11  7:32 UTC (permalink / raw)
  To: Binutils

While .linefile is generally intended for gas internal use only, its use
in a source file would better not result in an internal error. Give use
of it outside of any macro(-like) construct the meaning of restoring the
original (physical) input file name.

--- a/gas/input-scrub.c
+++ b/gas/input-scrub.c
@@ -469,13 +469,15 @@ new_logical_line_flags (const char *fnam
       /* FIXME: we could check that include nesting is correct.  */
       break;
     case 1 << 3:
-      if (line_number < 0 || fname != NULL || next_saved_file == NULL)
+      if (line_number < 0 || fname != NULL)
 	abort ();
       /* PR gas/16908 workaround: Ignore updates when nested inside a macro
 	 expansion.  */
       if (from_sb_expansion == expanding_nested)
 	return;
-      if (next_saved_file->logical_input_file)
+      if (next_saved_file == NULL)
+	fname = physical_input_file;
+      else if (next_saved_file->logical_input_file)
 	fname = next_saved_file->logical_input_file;
       else
 	fname = next_saved_file->physical_input_file;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-15 11:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11  7:32 [PATCH] gas: accept custom ".linefile <n> ." Jan Beulich
2022-11-14 13:43 ` Nick Clifton
2022-11-14 15:53   ` Jan Beulich
2022-11-14 16:02     ` Nick Clifton
2022-11-14 16:16       ` Jan Beulich
2022-11-15 11:16         ` Nick Clifton
2022-11-15  7:59   ` Jan Beulich
2022-11-15 11:23     ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).