OSDN Git Service

selftests/bpf: Add global variables linking selftest
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 23 Apr 2021 18:13:46 +0000 (11:13 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 23 Apr 2021 21:05:27 +0000 (14:05 -0700)
commit14f1aae17ee13d08315873d4b68d573e91df892f
treef010365a15637827e8180abb3694c08c77ce335a
parentf2644fb44de9abd54e57b55f584c7c67526f7c02
selftests/bpf: Add global variables linking selftest

Add selftest validating various aspects of statically linking global
variables:
  - correct resolution of extern variables across .bss, .data, and .rodata
    sections;
  - correct handling of weak definitions;
  - correct de-duplication of repeating special externs (.kconfig, .ksyms).

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-17-andrii@kernel.org
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/linked_vars.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/linked_vars1.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/linked_vars2.c [new file with mode: 0644]