]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: provide more helpful message on uninitialized global var
authorAndrii Nakryiko <andriin@fb.com>
Tue, 23 Jul 2019 21:11:33 +0000 (14:11 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 23 Jul 2019 22:59:12 +0000 (15:59 -0700)
commit0b200013b49cc9352e25dc0cd4fb6bc10e5c5a8c
tree2693646b1efb0420c38f07526bcef2c4e7d9ffb8
parent1a7bce26097fb55a8997f870671972ed88f65dfc
libbpf: provide more helpful message on uninitialized global var

When BPF program defines uninitialized global variable, it's put into
a special COMMON section. Libbpf will reject such programs, but will
provide very unhelpful message with garbage-looking section index.

This patch detects special section cases and gives more explicit error
message.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf.c