diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2018-02-09 00:26:18 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-02-09 00:26:28 +0100 |
commit | d977ae593b2d3f9ef0df795eda93f4e6bc92b323 (patch) | |
tree | 0e3c09034cb8bc79fea586681d4de51689a23325 /tools/include | |
parent | Merge branch 'bpf-misc-nfp-bpftool-doc-fixes' (diff) | |
parent | tools/libbpf: handle issues with bpf ELF objects containing .eh_frames (diff) | |
download | linux-dev-d977ae593b2d3f9ef0df795eda93f4e6bc92b323.tar.xz linux-dev-d977ae593b2d3f9ef0df795eda93f4e6bc92b323.zip |
Merge branch 'bpf-libbpf-relo-fix-and-tests'
Jesper Dangaard Brouer says:
====================
While playing with using libbpf for the Suricata project, we had
issues LLVM >= 4.0.1 generating ELF files that could not be loaded
with libbpf (tools/lib/bpf/).
During the troubleshooting phase, I wrote a test program and improved
the debugging output in libbpf. I turned this into a selftests
program, and it also serves as a code example for libbpf in itself.
I discovered that there are at least three ELF load issues with
libbpf. I left them as TODO comments in (tools/testing/selftests/bpf)
test_libbpf.sh. I've only fixed the load issue with eh_frames, and
other types of relo-section that does not have exec flags. We can
work on the other issues later.
====================
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/include')
-rw-r--r-- | tools/include/uapi/linux/bpf_common.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/include/uapi/linux/bpf_common.h b/tools/include/uapi/linux/bpf_common.h index 18be90725ab0..ee97668bdadb 100644 --- a/tools/include/uapi/linux/bpf_common.h +++ b/tools/include/uapi/linux/bpf_common.h @@ -15,9 +15,10 @@ /* ld/ldx fields */ #define BPF_SIZE(code) ((code) & 0x18) -#define BPF_W 0x00 -#define BPF_H 0x08 -#define BPF_B 0x10 +#define BPF_W 0x00 /* 32-bit */ +#define BPF_H 0x08 /* 16-bit */ +#define BPF_B 0x10 /* 8-bit */ +/* eBPF BPF_DW 0x18 64-bit */ #define BPF_MODE(code) ((code) & 0xe0) #define BPF_IMM 0x00 #define BPF_ABS 0x20 |