aboutsummaryrefslogtreecommitdiff
path: root/gas/doc/c-bpf.texi
diff options
context:
space:
mode:
authorJose E. Marchesi <jose.marchesi@oracle.com>2023-07-24 01:15:08 +0200
committerJose E. Marchesi <jose.marchesi@oracle.com>2023-07-24 01:20:03 +0200
commitc2ca88d74ba3618c4aac6744e923c279ca4cb7f1 (patch)
treecdd500a8a997bd1a8f908176d8f5fe4143d0542d /gas/doc/c-bpf.texi
parent338b21b0881e16bb7116e4eb5bc41817f805ec23 (diff)
downloadgdb-c2ca88d74ba3618c4aac6744e923c279ca4cb7f1.zip
gdb-c2ca88d74ba3618c4aac6744e923c279ca4cb7f1.tar.gz
gdb-c2ca88d74ba3618c4aac6744e923c279ca4cb7f1.tar.bz2
bpf: add support for jal/gotol jump instruction with 32-bit target
This patch adds support for the V4 BPF instruction jal/gotol, which is like ja/goto but it supports a signed 32-bit PC-relative (in number of 64-bit words minus one) target operand instead of the 16-bit signed operand of the other instruction. This greatly increases the jump range in BPF programs. Tested in bpf-unkown-none. bfd/ChangeLog: 2023-07-24 Jose E. Marchesi <jose.marchesi@oracle.com> * reloc.c: New reloc BFD_RELOC_BPF_DISPCALL32. * elf64-bpf.c (bpf_reloc_type_lookup): Handle the new reloc. * libbfd.h (bfd_reloc_code_real_names): Regenerate. gas/ChangeLog: 2023-07-24 Jose E. Marchesi <jose.marchesi@oracle.com> * config/tc-bpf.c (struct bpf_insn): New field `id'. (md_assemble): Save the ids of successfully parsed instructions and use the new BFD_RELOC_BPF_DISPCALL32 whenever appropriate. (md_apply_fix): Adapt to the new BFD reloc. * testsuite/gas/bpf/jump.s: Test JAL. * testsuite/gas/bpf/jump.d: Likewise. * testsuite/gas/bpf/jump-pseudoc.d: Likewise. * testsuite/gas/bpf/jump-be.d: Likewise. * testsuite/gas/bpf/jump-be-pseudoc.d: Likewise. * doc/c-bpf.texi (BPF Instructions): Document new instruction jal/gotol. Document new operand type disp32. include/ChangeLog: 2023-07-24 Jose E. Marchesi <jose.marchesi@oracle.com> * opcode/bpf.h (enum bpf_insn_id): Add entry BPF_INSN_JAL. (enum bpf_insn_id): Remove spurious entry BPF_INSN_CALLI. opcodes/ChangeLog: 2023-07-23 Jose E. Marchesi <jose.marchesi@oracle.com> * bpf-opc.c (bpf_opcodes): Add entry for jal.
Diffstat (limited to 'gas/doc/c-bpf.texi')
-rw-r--r--gas/doc/c-bpf.texi7
1 files changed, 7 insertions, 0 deletions
diff --git a/gas/doc/c-bpf.texi b/gas/doc/c-bpf.texi
index bebf760..d4fd181 100644
--- a/gas/doc/c-bpf.texi
+++ b/gas/doc/c-bpf.texi
@@ -160,6 +160,9 @@ Signed 16-bit immediate representing an offset in bytes.
@item disp16
Signed 16-bit immediate representing a displacement to a target,
measured in number of 64-bit words @emph{minus one}.
+@item disp32
+Signed 32-bit immediate representing a displacement to a target,
+measured in number of 64-bit words @emph{minus one}.
@item imm32
Signed 32-bit immediate.
@item imm64
@@ -555,6 +558,10 @@ holds true.
@itemx goto disp16
Jump-always.
+@item jal disp32
+@itemx gotol disp32
+Jump-always, long range.
+
@item jeq rd, rs, disp16
@itemx jeq rd, imm32, disp16
@itemx if rd == rs goto disp16