[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210319205909.1748642-1-andrii@kernel.org>
Date: Fri, 19 Mar 2021 13:59:06 -0700
From: Andrii Nakryiko <andrii@...nel.org>
To: <bpf@...r.kernel.org>, <netdev@...r.kernel.org>, <ast@...com>,
<daniel@...earbox.net>
CC: <andrii@...nel.org>, <kernel-team@...com>
Subject: [PATCH bpf-next 0/3] Handle no-BTF object files better
Fix two issues caused by BPF object files with missing BTF type information:
1. BPF skeleton generated for BPF object files that use global variables but
are compiled without BTF won't compile.
2. BPF static linker will crash attempting to fix up BTF for input object
file with no BTF.
This patch set also extends static linking selftest to validate correct
handling of both conditions now. For that, selftests Makefile is enhanced to
allow selecting whether a given BPF object file should be compiled with BTF or
not, based on naming convention (.nobtf.c suffix).
Andrii Nakryiko (3):
bpftool: improve skeleton generation for objects without BTF
libbpf: skip BTF fixup if object file has no BTF
selftests/bpf: allow compiling BPF objects without BTF
tools/bpf/bpftool/gen.c | 81 +++++++++++++++----
tools/lib/bpf/linker.c | 3 +
tools/testing/selftests/bpf/Makefile | 21 +++--
.../selftests/bpf/prog_tests/static_linked.c | 6 +-
.../bpf/progs/test_static_linked3.nobtf.c | 36 +++++++++
5 files changed, 123 insertions(+), 24 deletions(-)
create mode 100644 tools/testing/selftests/bpf/progs/test_static_linked3.nobtf.c
--
2.30.2
Powered by blists - more mailing lists