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