]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add field existence CO-RE relocs tests
authorAndrii Nakryiko <andriin@fb.com>
Tue, 15 Oct 2019 18:28:49 +0000 (11:28 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 15 Oct 2019 23:06:05 +0000 (16:06 -0700)
commit60f534e5d357b045697703e810e4940b949f5bb0
tree87cf6a2540dbbb1bca6286de1e1c5c06b65f650f
parentf163e485116fd7630312720667a83370973fab40
selftests/bpf: Add field existence CO-RE relocs tests

Add a bunch of tests validating CO-RE is handling field existence
relocation. Relaxed CO-RE relocation mode is activated for these new
tests to prevent libbpf from rejecting BPF object for no-match
relocation, even though test BPF program is not going to use that
relocation, if field is missing.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191015182849.3922287-6-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/core_reloc.c
tools/testing/selftests/bpf/progs/btf__core_reloc_existence.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_existence___err_wrong_arr_kind.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_existence___err_wrong_arr_value_type.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_existence___err_wrong_int_kind.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_existence___err_wrong_int_sz.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_existence___err_wrong_int_type.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_existence___err_wrong_struct_type.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/btf__core_reloc_existence___minimal.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/core_reloc_types.h
tools/testing/selftests/bpf/progs/test_core_reloc_existence.c [new file with mode: 0644]