Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libbpf: Add enum64 support for bpf linking

Add BTF_KIND_ENUM64 support for bpf linking, which is
very similar to BTF_KIND_ENUM.

Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20220607062642.3721494-1-yhs@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Yonghong Song and committed by
Alexei Starovoitov
6ec7d79b f2a62588

+2
+2
tools/lib/bpf/linker.c
··· 1335 1335 case BTF_KIND_STRUCT: 1336 1336 case BTF_KIND_UNION: 1337 1337 case BTF_KIND_ENUM: 1338 + case BTF_KIND_ENUM64: 1338 1339 case BTF_KIND_FWD: 1339 1340 case BTF_KIND_FUNC: 1340 1341 case BTF_KIND_VAR: ··· 1358 1357 case BTF_KIND_INT: 1359 1358 case BTF_KIND_FLOAT: 1360 1359 case BTF_KIND_ENUM: 1360 + case BTF_KIND_ENUM64: 1361 1361 /* ignore encoding for int and enum values for enum */ 1362 1362 if (t1->size != t2->size) { 1363 1363 pr_warn("global '%s': incompatible %s '%s' size %u and %u\n",