libbpf: fix signedness determination in CO-RE relo handling logic
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 24 Aug 2023 00:00:16 +0000 (17:00 -0700)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 24 Aug 2023 04:13:48 +0000 (21:13 -0700)
commitf3bdb54f09ab4cdbca48bf7befa8997cadd8d6a1
tree36b33878f81635dd1ed43b253f7778258eed8e04
parenta182e64147f7db006691c181077e456321f23bff
libbpf: fix signedness determination in CO-RE relo handling logic

Extracting btf_int_encoding() is only meaningful for BTF_KIND_INT, so we
need to check that first before inferring signedness.

Closes: https://github.com/libbpf/libbpf/issues/704
Reported-by: Lorenz Bauer <lmb@isovalent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20230824000016.2658017-2-andrii@kernel.org
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/lib/bpf/relo_core.c