]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Ignore STT_SECTION symbols in 'maps' section
authorToke Høiland-Jørgensen <toke@redhat.com>
Mon, 27 Sep 2021 20:58:10 +0000 (22:58 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 28 Sep 2021 04:29:37 +0000 (21:29 -0700)
commitc759cd3d4140d33f2a22cd3a806529b06836098a
tree6cd24fa8287346f0b6576e3baad77a62f8850e73
parent8fa2c5c2b9356ba5218e3255427c33f81d397689
libbpf: Ignore STT_SECTION symbols in 'maps' section

When parsing legacy map definitions, libbpf would error out when
encountering an STT_SECTION symbol. This becomes a problem because some
versions of binutils will produce SECTION symbols for every section when
processing an ELF file, so BPF files run through 'strip' will end up with
such symbols, making libbpf refuse to load them.

There's not really any reason why erroring out is strictly necessary, so
change libbpf to just ignore SECTION symbols when parsing the ELF.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210927205810.715656-1-toke@redhat.com
tools/lib/bpf/libbpf.c