This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] x86: Add .nop directive to assembler


Hi,

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
--- 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 == ',')
     {
       ++input_line_pointer;
-      expression (&val);
+      SKIP_WHITESPACE ();
+      if (!strncasecmp (input_line_pointer, "@NOP", 4)
+         && (input_line_pointer[4] == ' ' || !input_line_pointer[4]))
+       do_nops = TRUE, input_line_pointer += 4;
+      else
+       expression (&val);
     }
   else
     {

> How about "nop" (including the quotes) instead?

Also possible, yeah.


Ciao,
Michael.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]