[PATCH] gas: accept custom ".linefile <n> ."

Nick Clifton nickc@redhat.com
Mon Nov 14 13:43:25 GMT 2022


Hi Jan,

> While .linefile is generally intended for gas internal use only, its use
> in a source file would better not result in an internal error.

Agreed.

> Give use
> of it outside of any macro(-like) construct the meaning of restoring the
> original (physical) input file name.

We should document this behaviour in the as.texi file then, so that it
is "official"...

> --- 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 ();

I still hate having calls to abort() in code.  Much better to have
a helpful error message IMHO.  Not important for this patch though.

Cheers
   Nick




More information about the Binutils mailing list