]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Skip CO-RE relocations for not loaded BPF programs
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 8 Oct 2020 00:10:21 +0000 (17:10 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 8 Oct 2020 01:50:27 +0000 (18:50 -0700)
commit488ea4889b4285a070363a4a5dbdb01b867b476d
tree1a3bfa8612f31b91b57f683922639eb5acbf4018
parent3be30b912819abcd5d3604fad53c1088ce877580
libbpf: Skip CO-RE relocations for not loaded BPF programs

Bypass CO-RE relocations step for BPF programs that are not going to be
loaded. This allows to have BPF programs compiled in and disabled dynamically
if kernel is not supposed to provide enough relocation information. In such
case, there won't be unnecessary warnings about failed relocations.

Fixes: 2e36dc476732 ("libbpf: Support disabling auto-loading BPF programs")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201008001025.292064-2-andrii@kernel.org
tools/lib/bpf/libbpf.c