+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.
+
2019-07-17 Jan Beulich <jbeulich@suse.com>
* config/tc-i386.c (check_hle, md_assemble, check_VecOperands,
/* The target specific pseudo-ops which we support. */
const pseudo_typeS md_pseudo_table[] =
{
+ { "half", cons, 2 },
+ { "word", cons, 4 },
+ { "dword", cons, 8 },
{ NULL, NULL, 0 }
};
@menu
* BPF Options:: Options
* BPF Syntax:: Syntax
+* BPF Directives:: Machine Directives
* BPF Opcodes:: Opcodes
@end menu
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
run_dump_test call
run_dump_test exit
run_dump_test atomic
+ run_dump_test data
run_dump_test lddw-be
run_dump_test alu-be
run_dump_test call-be
run_dump_test exit-be
run_dump_test atomic-be
+ run_dump_test data-be
}
--- /dev/null
+#as: --EB
+#source: data.s
+#objdump: -s -j .data
+#name: eBPF data directives, big endian
+
+.*: +file format .*bpf.*
+
+Contents of section \.data:
+ 0000 f00fdead beef1122 33445566 7788 .*
--- /dev/null
+#as: --EL
+#objdump: -s -j .data
+#name: eBPF data directives
+
+.*: +file format .*bpf.*
+
+Contents of section \.data:
+ 0000 0ff0efbe adde8877 66554433 2211 .*
--- /dev/null
+ .section .data
+ .half 0xf00f
+ .word 0xdeadbeef
+ .dword 0x1122334455667788