summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/global_data_init.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2021-10-20 18:44:04 -0700
committerAlexei Starovoitov <ast@kernel.org>2021-10-21 17:10:11 -0700
commit4f2511e1990985103929ab799fb3ebca81969b77 (patch)
tree788f588b995b81fe8bcc9c639fefc8b6f866a379 /tools/testing/selftests/bpf/prog_tests/global_data_init.c
parent26071635ac5ecd8276bf3bdfc3ea1128c93ac722 (diff)
downloadlinux-4f2511e1990985103929ab799fb3ebca81969b77.tar.gz
linux-4f2511e1990985103929ab799fb3ebca81969b77.tar.bz2
linux-4f2511e1990985103929ab799fb3ebca81969b77.zip
selftests/bpf: Switch to ".bss"/".rodata"/".data" lookups for internal maps
Utilize libbpf's feature of allowing to lookup internal maps by their ELF section names. No need to guess or calculate the exact truncated prefix taken from the object name. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20211021014404.2635234-11-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/global_data_init.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/global_data_init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/global_data_init.c b/tools/testing/selftests/bpf/prog_tests/global_data_init.c
index ee46b11f1f9a..1db86eab101b 100644
--- a/tools/testing/selftests/bpf/prog_tests/global_data_init.c
+++ b/tools/testing/selftests/bpf/prog_tests/global_data_init.c
@@ -16,7 +16,7 @@ void test_global_data_init(void)
if (CHECK_FAIL(err))
return;
- map = bpf_object__find_map_by_name(obj, "test_glo.rodata");
+ map = bpf_object__find_map_by_name(obj, ".rodata");
if (CHECK_FAIL(!map || !bpf_map__is_internal(map)))
goto out;