OSDN Git Service

selftests/bpf: Test TYPE_EXISTS and TYPE_SIZE CO-RE relocations
authorAndrii Nakryiko <andriin@fb.com>
Wed, 19 Aug 2020 19:45:16 +0000 (12:45 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 19 Aug 2020 21:19:39 +0000 (14:19 -0700)
commit124a892d1c416dc4f639031afb79d47857d9b0b0
treeaccca582aff803e67fe432b19bf482ca0b5c9d98
parent3fc32f40c40207bf85ce1b007f18981c4673df96
selftests/bpf: Test TYPE_EXISTS and TYPE_SIZE CO-RE relocations

Add selftests for TYPE_EXISTS and TYPE_SIZE relocations, testing correctness
of relocations and handling of type compatiblity/incompatibility.

If __builtin_preserve_type_info() is not supported by compiler, skip tests.

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-3-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/core_reloc.c
tools/testing/selftests/bpf/progs/btf__core_reloc_type_based.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_type_based___all_missing.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_type_based___diff_sz.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_type_based___fn_wrong_args.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_type_based___incompat.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/core_reloc_types.h
tools/testing/selftests/bpf/progs/test_core_reloc_kernel.c
tools/testing/selftests/bpf/progs/test_core_reloc_type_based.c [new file with mode: 0644]