selftests/bpf: Add CO-RE relo test for TYPE_ID_LOCAL/TYPE_ID_TARGET
authorAndrii Nakryiko <andriin@fb.com>
Wed, 19 Aug 2020 19:45:17 +0000 (12:45 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 19 Aug 2020 21:19:39 +0000 (14:19 -0700)
commit4836bf5e2ec6e410c7f0c044402951484901a676
treecafddeaf11ed1724638274dddd6be1acf101c5f5
parent124a892d1c416dc4f639031afb79d47857d9b0b0
selftests/bpf: Add CO-RE relo test for TYPE_ID_LOCAL/TYPE_ID_TARGET

Add tests for BTF type ID relocations. To allow testing this, enhance
core_relo.c test runner to allow dynamic initialization of test inputs.
If Clang doesn't have necessary support for new functionality, test is
skipped.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200819194519.3375898-4-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/core_reloc.c
tools/testing/selftests/bpf/progs/btf__core_reloc_type_id.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_type_id___missing_targets.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/core_reloc_types.h
tools/testing/selftests/bpf/progs/test_core_reloc_type_based.c
tools/testing/selftests/bpf/progs/test_core_reloc_type_id.c [new file with mode: 0644]