selftests/bpf: Test linking with duplicate extern functions

Previously when multiple BPF object files referencing the same extern
function (usually kfunc) are statically linked using `bpftool gen
object`, libbpf tries to get the nonexistent size of BTF_KIND_FUNC_PROTO
and fails. This test ensures it is fixed.

Signed-off-by: Eric Long <i@hack3r.moe>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20241002-libbpf-dup-extern-funcs-v4-2-560eb460ff90@hack3r.moe
This commit is contained in:
Eric Long 2024-10-02 14:25:07 +08:00 • committed by Andrii Nakryiko
commit 3c591de285
2 changed files with 16 additions and 0 deletions