This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] x86: Add .nop directive to assembler
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:
diff --git a/gas/read.c b/gas/read.c
index 7bf52f1..8730318 100644
@@ -3326,6 +3326,7 @@ s_space (int mult)
char *stop = NULL;
char stopc = 0;
+ bfd_boolean do_nops = FALSE;
@@ -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;
+ expression (&val);
> How about "nop" (including the quotes) instead?
Also possible, yeah.