Clang seems to generate base type with name "short", instead of "short in", but it also isn't inconceivable to imagine other compilers generating just "long" and/or "long long". This patch adds all those short forms to a list of base type names. $ cat type_test.c struct s { short x1; long x2; long long x3; }; int main() { struct s s; return 0; } $ clang -g type_test.c -o type_test && ~/local/pahole/build/pahole -JV type_test File type_test: [1] INT int size=4 bit_offset=0 nr_bits=32 encoding=SIGNED [2] STRUCT s kind_flag=0 size=24 vlen=3 x1 type_id=3 bits_offset=0 x2 type_id=4 bits_offset=64 x3 type_id=5 bits_offset=128 [3] INT short size=2 bit_offset=0 nr_bits=16 encoding=SIGNED [4] INT long int size=8 bit_offset=0 nr_bits=64 encoding=SIGNED [5] INT long long int size=8 bit_offset=0 nr_bits=64 encoding=SIGNED Before: $ ~/local/pahole/build/pahole -F btf type_test base_type__name_to_size: base_type short class__fixup_btf_bitfields: unknown base type name "short"! struct s { short x1; /* 0 0 */ /* XXX 8 bytes hole, try to pack */ long int x2; /* 8 8 */ long long int x3; /* 16 8 */ /* size: 24, cachelines: 1, members: 3 */ /* sum members: 16, holes: 1, sum holes: 8 */ /* last cacheline: 24 bytes */ }; After: $ ~/local/pahole/build/pahole -F btf type_test struct s { short x1; /* 0 2 */ /* XXX 6 bytes hole, try to pack */ long int x2; /* 8 8 */ long long int x3; /* 16 8 */ /* size: 24, cachelines: 1, members: 3 */ /* sum members: 18, holes: 1, sum holes: 6 */ /* last cacheline: 24 bytes */ }; Signed-off-by: Andrii Nakryiko <andriin@xxxxxx> --- dwarves.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dwarves.c b/dwarves.c index 093de11..adc411a 100644 --- a/dwarves.c +++ b/dwarves.c @@ -147,11 +147,13 @@ static struct base_type_name_to_size { { .name = "signed short", .size = 16, }, { .name = "unsigned short", .size = 16, }, { .name = "short int", .size = 16, }, + { .name = "short", .size = 16, }, { .name = "char", .size = 8, }, { .name = "signed char", .size = 8, }, { .name = "unsigned char", .size = 8, }, { .name = "signed long", .size = 0, }, { .name = "long int", .size = 0, }, + { .name = "long", .size = 0, }, { .name = "signed long", .size = 0, }, { .name = "unsigned long", .size = 0, }, { .name = "long unsigned int", .size = 0, }, @@ -159,6 +161,7 @@ static struct base_type_name_to_size { { .name = "_Bool", .size = 8, }, { .name = "long long unsigned int", .size = 64, }, { .name = "long long int", .size = 64, }, + { .name = "long long", .size = 64, }, { .name = "signed long long", .size = 64, }, { .name = "unsigned long long", .size = 64, }, { .name = "double", .size = 64, }, -- 2.17.1