diff options
author | Jose E. Marchesi <jose.marchesi@oracle.com> | 2019-07-17 22:57:23 +0200 |
---|---|---|
committer | Jose E. Marchesi <jose.marchesi@oracle.com> | 2019-07-17 22:57:23 +0200 |
commit | e0b989a6d74efbcdadac4974d0b8520ac31cd9b6 (patch) | |
tree | 5585c1fc5c6229a0c2415ea411cacb50349773c2 /gas/config/tc-bpf.c | |
parent | d8f68fcb9378b5ab1c945fa676e11da15be56dd6 (diff) | |
download | binutils-e0b989a6d74efbcdadac4974d0b8520ac31cd9b6.zip binutils-e0b989a6d74efbcdadac4974d0b8520ac31cd9b6.tar.gz binutils-e0b989a6d74efbcdadac4974d0b8520ac31cd9b6.tar.bz2 |
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/config/tc-bpf.c')
-rw-r--r-- | gas/config/tc-bpf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gas/config/tc-bpf.c b/gas/config/tc-bpf.c index 9318c35..3ebe81f 100644 --- a/gas/config/tc-bpf.c +++ b/gas/config/tc-bpf.c @@ -38,6 +38,9 @@ const char FLT_CHARS[] = "fFdD"; /* 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 } }; |