diff options
author | 2022-07-31 17:26:49 -0600 | |
---|---|---|
committer | 2022-08-04 14:39:07 -0700 | |
commit | 47ea7417b0744324424405fc1207e266053237a9 (patch) | |
tree | a22d754b60690412ceb85acdbc40613c44bce1db /kernel/bpf/core.c | |
parent | Merge tag 'net-next-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next (diff) | |
download | linux-rng-47ea7417b0744324424405fc1207e266053237a9.tar.xz linux-rng-47ea7417b0744324424405fc1207e266053237a9.zip |
libbpf: Skip empty sections in bpf_object__init_global_data_maps
The GNU assembler generates an empty .bss section. This is a well
established behavior in GAS that happens in all supported targets.
The LLVM assembler doesn't generate an empty .bss section.
bpftool chokes on the empty .bss section.
Additionally in bpf_object__elf_collect the sec_desc->data is not
initialized when a section is not recognized. In this case, this
happens with .comment.
So we must check that sec_desc->data is initialized before checking
if the size is 0.
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20220731232649.4668-1-james.hilliard1@gmail.com
Diffstat (limited to 'kernel/bpf/core.c')
0 files changed, 0 insertions, 0 deletions