]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Add kernel module BTF support for CO-RE relocations
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 3 Dec 2020 20:46:25 +0000 (12:46 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Dec 2020 01:38:20 +0000 (17:38 -0800)
commit7b1bbf8da1e94b0f0db04a1cea8c7c62a32aaa2e
treedb7cfd0be58bf112064c9e9b65b9f6dc4e51d9a6
parent2b205bb5ff524fda4f10ab86ce88cc04b6449e42
libbpf: Add kernel module BTF support for CO-RE relocations

Teach libbpf to search for candidate types for CO-RE relocations across kernel
modules BTFs, in addition to vmlinux BTF. If at least one candidate type is
found in vmlinux BTF, kernel module BTFs are not iterated. If vmlinux BTF has
no matching candidates, then find all kernel module BTFs and search for all
matching candidates across all of them.

Kernel's support for module BTFs are inferred from the support for BTF name
pointer in BPF UAPI.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201203204634.1325171-6-andrii@kernel.org
tools/lib/bpf/libbpf.c