]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Add support for field existance CO-RE relocation
authorAndrii Nakryiko <andriin@fb.com>
Tue, 15 Oct 2019 18:28:47 +0000 (11:28 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 15 Oct 2019 23:06:05 +0000 (16:06 -0700)
commit713b92e3b2b15bc74905a5d004e47cb2a82b5254
tree02791f42e5e643fafd896b0d1492f581835b28cb
parentd4d2e2dfeca04148a9e592b0279ac33d2f15f160
libbpf: Add support for field existance CO-RE relocation

Add support for BPF_FRK_EXISTS relocation kind to detect existence of
captured field in a destination BTF, allowing conditional logic to
handle incompatible differences between kernels.

Also introduce opt-in relaxed CO-RE relocation handling option, which
makes libbpf emit warning for failed relocations, but proceed with other
relocations. Instruction, for which relocation failed, is patched with
(u32)-1 value.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191015182849.3922287-4-andriin@fb.com
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h