libbpf: Suppress compiler warning when using SEC() macro with externs
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 23 Apr 2021 18:13:33 +0000 (11:13 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 23 Apr 2021 21:05:26 +0000 (14:05 -0700)
commit0fec7a3cee1cf8e4f86ff563d229408ccbdc2d66
tree819ff515663653459f53849db97538345e828e29
parent5b438f01d7eb2dc9bec7cd79de881b5f155d9a71
libbpf: Suppress compiler warning when using SEC() macro with externs

When used on externs SEC() macro will trigger compilation warning about
inapplicable `__attribute__((used))`. That's expected for extern declarations,
so suppress it with the corresponding _Pragma.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210423181348.1801389-4-andrii@kernel.org
tools/lib/bpf/bpf_helpers.h