[PATCH] x86: Add .nop directive to assembler

Florian Weimer fweimer@redhat.com
Mon Feb 19 13:41:00 GMT 2018


On 02/12/2018 08:38 PM, H.J. Lu wrote:
> +@cindex @code{nop} directive
> +@cindex filling memory with NOP
> +This directive emits @var{size} bytes filled with @code{NOP}
> +instructions.  @var{size} is absolute expression, which must be
> +between 0 and 512.  @var{limit} specifies the size limit of a
> +single @code{NOP} instruction.  If the comma and @var{limit} are
> +omitted, @var{limit} is assumed to the maximum supported size of
> +a single @code{NOP} instruction.  The valid values of @var{limit}
> +are between 1 and 8 for 16-bit mode, between 1 and 10 for 32-bit mode,
> +between 1 and 11 for 64-bit mode.  This directive is only allowed
> +in text sections.

The documentation doesn't say if it is safe to execute those NOPs on all 
future CPUs, or if these NOPs can only be used for non-executing 
padding.  I think it's worth clarifying that.

Thanks,
Florian



More information about the Binutils mailing list