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>
Showing
- tools/include/uapi/linux/bpf_common.h 4 additions, 3 deletionstools/include/uapi/linux/bpf_common.h
- tools/lib/bpf/libbpf.c 39 additions, 12 deletionstools/lib/bpf/libbpf.c
- tools/testing/selftests/bpf/Makefile 11 additions, 1 deletiontools/testing/selftests/bpf/Makefile
- tools/testing/selftests/bpf/test_libbpf.sh 49 additions, 0 deletionstools/testing/selftests/bpf/test_libbpf.sh
- tools/testing/selftests/bpf/test_libbpf_open.c 150 additions, 0 deletionstools/testing/selftests/bpf/test_libbpf_open.c
Loading
Please register or sign in to comment