]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Support multiple .rodata.* and .data.* BPF maps
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 21 Oct 2021 01:44:01 +0000 (18:44 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 22 Oct 2021 00:10:10 +0000 (17:10 -0700)
commit9e48b07f9425950cf6f773271c727c95f0034270
treedef6ad8d0e23589869fa45625e46e33a27e5ad71
parentc4444092d03911379703a30a651601942e92dea5
libbpf: Support multiple .rodata.* and .data.* BPF maps

Add support for having multiple .rodata and .data data sections ([0]).
.rodata/.data are supported like the usual, but now also
.rodata.<whatever> and .data.<whatever> are also supported. Each such
section will get its own backing BPF_MAP_TYPE_ARRAY, just like
.rodata and .data.

Multiple .bss maps are not supported, as the whole '.bss' name is
confusing and might be deprecated soon, as well as user would need to
specify custom ELF section with SEC() attribute anyway, so might as well
stick to just .data.* and .rodata.* convention.

User-visible map name for such new maps is going to be just their ELF
section names.

  [0] https://github.com/libbpf/libbpf/issues/274

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-8-andrii@kernel.org
tools/lib/bpf/libbpf.c