This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] x86: Add .nop directive to assembler
>>> On 15.02.18 at 16:02, <email@example.com> wrote:
> On Thu, 15 Feb 2018, Jan Beulich wrote:
>> >> > I also think extending .fill feels more natural.
>> >> >
>> >> No, .fill isn't what we want.
>> > I fat-fingered that one, yes I meant .fill.
>> .fill again? Didn't you mean to write .skip this time?
> Sigh. It seems my fingers are unusually fat in this thread. .skip,
> dammit! .skip, .skip, .skip!
>> Having thought about this some more - since currently FILL is expected
>> to be an expression, none of the above is really suitable.
> Well, that could be easily rectified. Something along the lines of:
I didn't make the remark because of foreseeing any issues with
coding this up, but because @NOP (or any of your other
suggestions) could actually be a valid symbol name, which could be
valid to use here even if it's not part of any expression in case it's
an absolute one (e.g. an equate). The leading @ is undesirable
anyway because of ARM's use of it as a comment char.
> diff --git a/gas/read.c b/gas/read.c
> index 7bf52f1..8730318 100644
> --- a/gas/read.c
> +++ b/gas/read.c
> @@ -3326,6 +3326,7 @@ s_space (int mult)
> char *stop = NULL;
> char stopc = 0;
> int bytes;
> + bfd_boolean do_nops = FALSE;
> #ifdef md_flush_pending_output
> md_flush_pending_output ();
> @@ -3386,7 +3387,12 @@ s_space (int mult)
> if (*input_line_pointer == ',')
> - expression (&val);
> + SKIP_WHITESPACE ();
> + if (!strncasecmp (input_line_pointer, "@NOP", 4)
> + && (input_line_pointer == ' ' || !input_line_pointer))
> + do_nops = TRUE, input_line_pointer += 4;
> + else
> + expression (&val);
>> How about "nop" (including the quotes) instead?
> Also possible, yeah.