From: Alexei Starovoitov <ast@xxxxxxxxxx> Allow BPF programs detect at load time whether particular kfunc exists. Patch 1: Allow ld_imm64 to point to kfunc in the kernel. Patch 2: Fix relocation of kfunc in ld_imm64 insn when kfunc is in kernel module. Patch 3: Introduce bpf_ksym_exists() macro. Patch 4: selftest. NOTE: detection of kfuncs from light skeleton is not supported yet. Alexei Starovoitov (4): bpf: Allow ld_imm64 instruction to point to kfunc. libbpf: Fix relocation of kfunc ksym in ld_imm64 insn. libbpf: Introduce bpf_ksym_exists() macro. selftests/bpf: Add test for bpf_ksym_exists(). kernel/bpf/verifier.c | 17 ++++++++++------ tools/lib/bpf/bpf_helpers.h | 3 +++ tools/lib/bpf/libbpf.c | 6 ++++++ .../selftests/bpf/progs/task_kfunc_success.c | 20 ++++++++++++++++++- 4 files changed, 39 insertions(+), 7 deletions(-) -- 2.34.1