[PATCH] bpf: use the expected instruction for NOPs

Nick Clifton nickc@redhat.com
Tue Sep 15 09:37:04 GMT 2020


Hi David,

> The BPF ISA does not have a no-op instruction.

Just an aside - wouldn't it be a good idea if the ISA did define an explicit
encoding for no-ops ?

> There are different ways
> to achieve no-op, but in practice the Linux kernel verifier expects a
> particular form, namely "ja 0". Update the define md_single_noop_insn
> for BPF to reflect this.

Thanks for pointing this out.  I took the original encoding from the
gas/testsuite/gas/all/org-1.s file, in the hopes that it would be correct
one.
 
> gas/
> 	* config/tc-bpf.h (md_single_noop_insn): Use 'ja 0' for no-op.

Approved and applied.

Cheers
  Nick



More information about the Binutils mailing list