[PATCH 2/5] gas: squash (some) .linefile from listings

Jan Beulich jbeulich@suse.com
Tue Nov 29 10:36:59 GMT 2022


Not so long ago we started to insert these artificially when expanding
certain macro-like constructs; zap them as cluttering what actually
results from user input.
---
We may want to also zap ones resulting from "# <line> <file>", albeit
these anyway appear in listings only when assembling from stdin. Such
zapping also would need to happen elsewhere and/or in a different
manner.

Slightly RFC: Am I at risk of zapping a label named "linefile" this way?
(At least we can assume that this directive is the only think on a line,
_if_ it is a directive, for being internal only.) If so, lifting
buffer_and_nest()'s respective logic into a helper function may be the
way to go.

--- a/gas/read.c
+++ b/gas/read.c
@@ -867,7 +867,10 @@ read_a_source_file (const char *name)
 		  /* Find the end of the current expanded macro line.  */
 		  s = find_end_of_line (input_line_pointer, flag_m68k_mri);
 
-		  if (s != last_eol)
+		  if (s != last_eol
+		      && !startswith (input_line_pointer,
+				      !flag_m68k_mri ? " .linefile "
+						     : " linefile "))
 		    {
 		      char *copy;
 		      size_t len;



More information about the Binutils mailing list