diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2022-12-12 13:15:01 -0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-12-15 00:05:12 +0100 |
commit | 21a9a1bcccaa4f0337a24d666fe55944abcb171e (patch) | |
tree | 9637adaf711405a85ba15ef57412bd9bdce56c86 /tools/testing/selftests/bpf/progs/btf_dump_test_case_syntax.c | |
parent | 872aec4b5f635d94111d48ec3c57fbe078d64e7d (diff) |
libbpf: Handle non-standardly sized enums better in BTF-to-C dumper
Turns out C allows to force enum to be 1-byte or 8-byte explicitly using
mode(byte) or mode(word), respecticely. Linux sources are using this in
some cases. This is imporant to handle correctly, as enum size
determines corresponding fields in a struct that use that enum type. And
if enum size is incorrect, this will lead to invalid struct layout. So
add mode(byte) and mode(word) attribute support to btf_dump APIs.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20221212211505.558851-3-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/progs/btf_dump_test_case_syntax.c')
0 files changed, 0 insertions, 0 deletions