]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Support subprog address relocation
authorYonghong Song <yhs@fb.com>
Fri, 26 Feb 2021 20:49:30 +0000 (12:49 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 26 Feb 2021 21:23:52 +0000 (13:23 -0800)
commit49145289d0910eb6fb883ed7dbb8a388c9a81dd6
treeee1704c335102fd4f7c1905819f93c313938ce7d
parent9bfc8879121c53b3a2f2c877527ef0a7fabd27af
libbpf: Support subprog address relocation

A new relocation RELO_SUBPROG_ADDR is added to capture
subprog addresses loaded with ld_imm64 insns. Such ld_imm64
insns are marked with BPF_PSEUDO_FUNC and will be passed to
kernel. For bpf_for_each_map_elem() case, kernel will
check that the to-be-used subprog address must be a static
function and replace it with proper actual jited func address.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210226204930.3885367-1-yhs@fb.com
tools/lib/bpf/libbpf.c