]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Support pre-initializing .bss global variables
authorAndrii Nakryiko <andriin@fb.com>
Fri, 12 Jun 2020 19:45:04 +0000 (12:45 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 12 Jun 2020 22:27:47 +0000 (15:27 -0700)
commit90de900f48da88c0d48cd2062d5f0aa5ebd2d51e
tree03150a668bc94cea09c896dbaa58d18266b7557d
parent0496a6c42b7e59b2cf25d5cf3c8860177a37c3cf
libbpf: Support pre-initializing .bss global variables

Remove invalid assumption in libbpf that .bss map doesn't have to be updated
in kernel. With addition of skeleton and memory-mapped initialization image,
.bss doesn't have to be all zeroes when BPF map is created, because user-code
might have initialized those variables from user-space.

Fixes: fd57ffe4cf59 ("libbpf: Refactor global data map initialization")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200612194504.557844-1-andriin@fb.com
tools/lib/bpf/libbpf.c
tools/testing/selftests/bpf/prog_tests/skeleton.c
tools/testing/selftests/bpf/progs/test_skeleton.c