Commit: Gas: Add .nop directive.

Nick Clifton nickc@redhat.com
Tue Sep 15 11:13:06 GMT 2020


Hi Jose,


> In the same spirit, it would be awesome to be able to generate
> architecture-neutral data directives as well, for DWARF and CTF and the
> like :)

What about ".dc.b <val>" ?  Does that not work for all targets ?

>> +#define md_single_noop_insn "mov %r1,%r1"
> 
> For BPF we have this in GCC:
> 
> (define_insn "nop"
>   [(const_int 0)]
>   ""
>   "mov\t%%r0,%%r0"

> I think it would be good to settle on the same way to encode nops in
> both GCC and binutils.

Actually David Faust just posted a patch to change the instruction to "ja 0"
as this is what the kernel expects.  I have applied his patch to gas.  Maybe
gcc should be updated as well ?

Cheers
  Nick




More information about the Binutils mailing list