]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add function linking selftest
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 23 Apr 2021 18:13:45 +0000 (11:13 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 23 Apr 2021 21:05:27 +0000 (14:05 -0700)
commita7c2fa9ab17b4340fbc5de3d6482ea8b5674a773
tree1567fc448eb051723471dea24054880933689bf0
parent3990ef2d5f4ef367cba4c2ad2c9eff84b9dd7145
selftests/bpf: Add function linking selftest

Add selftest validating various aspects of statically linking functions:
  - no conflicts and correct resolution for name-conflicting static funcs;
  - correct resolution of extern functions;
  - correct handling of weak functions, both resolution itself and libbpf's
    handling of unused weak function that "lost" (it leaves gaps in code with
    no ELF symbols);
  - correct handling of hidden visibility to turn global function into
    "static" for the purpose of BPF verification.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210423181348.1801389-16-andrii@kernel.org
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/linked_funcs.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/linked_funcs1.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/linked_funcs2.c [new file with mode: 0644]