summaryrefslogtreecommitdiff
path: root/gas/doc
diff options
context:
space:
mode:
authorJose E. Marchesi <jose.marchesi@oracle.com>2019-07-17 22:57:23 +0200
committerJose E. Marchesi <jose.marchesi@oracle.com>2019-07-17 22:57:23 +0200
commite0b989a6d74efbcdadac4974d0b8520ac31cd9b6 (patch)
tree5585c1fc5c6229a0c2415ea411cacb50349773c2 /gas/doc
parentd8f68fcb9378b5ab1c945fa676e11da15be56dd6 (diff)
downloadbinutils-gdb-e0b989a6d74efbcdadac4974d0b8520ac31cd9b6.tar.gz
gas: support .half, .word and .dword directives in eBPF
This little patch adds support to the eBPF port of GAS for a few data directives. The names for the directives have been chosen to be coherent with the suffixes used in eBPF instructions: b, h, w and dw for 8, 16, 32 and 64-bit values respectively. Documentation and tests included. Tested in a x86_64 host. gas/ChangeLog: 2019-07-17 Jose E. Marchesi <jose.marchesi@oracle.com> * config/tc-bpf.c (md_pseudo_table): .half, .word and .dword. * testsuite/gas/bpf/data.s: New file. * testsuite/gas/bpf/data.d: Likewise. * testsuite/gas/bpf/data-be.d: Likewise. * testsuite/gas/bpf/bpf.exp: Run data and data-be. * doc/c-bpf.texi (BPF Directives): New section.
Diffstat (limited to 'gas/doc')
-rw-r--r--gas/doc/c-bpf.texi23
1 files changed, 23 insertions, 0 deletions
diff --git a/gas/doc/c-bpf.texi b/gas/doc/c-bpf.texi
index 13f41441caa..9496359f242 100644
--- a/gas/doc/c-bpf.texi
+++ b/gas/doc/c-bpf.texi
@@ -17,6 +17,7 @@
@menu
* BPF Options:: Options
* BPF Syntax:: Syntax
+* BPF Directives:: Machine Directives
* BPF Opcodes:: Opcodes
@end menu
@@ -104,6 +105,28 @@ descriptor @samp{2} in register @samp{r1} we would do:
lddw %r1, %map_fd(2)
@end smallexample
+@node BPF Directives
+@section Machine Directives
+
+@cindex machine directives, BPF
+
+The BPF version of @code{@value{AS}} supports the following additional
+machine directives:
+
+@table @code
+@cindex @code{half} directive, BPF
+@item .word
+The @code{.half} directive produces a 16 bit value.
+
+@cindex @code{word} directive, BPF
+@item .word
+The @code{.word} directive produces a 32 bit value.
+
+@cindex @code{dword} directive, BPF
+@item .dword
+The @code{.dword} directive produces a 64 bit value.
+@end table
+
@node BPF Opcodes
@section Opcodes