]> 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)
commit7c75a4750a0c5b3ed13a4a198d655d040e128dce
treedb7cfd0be58bf112064c9e9b65b9f6dc4e51d9a6
parentae54cae0ecaeac3886a1c68a8d514efc3db2ecab
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