diff --git a/btf_loader.c b/btf_loader.c index ec286f413f36..a39edd3362db 100644 --- a/btf_loader.c +++ b/btf_loader.c @@ -107,6 +107,7 @@ static struct base_type *base_type__new(strings_t name, uint32_t attrs, bt->bit_size = size; bt->is_signed = attrs & BTF_INT_SIGNED; bt->is_bool = attrs & BTF_INT_BOOL; + bt->is_unsigned = attrs & BTF_INT_UNSIGNED; bt->name_has_encoding = false; bt->float_type = float_type; } diff --git a/ctf.h b/ctf.h index 25b79892bde3..9e47c3c74677 100644 --- a/ctf.h +++ b/ctf.h @@ -100,6 +100,7 @@ struct ctf_full_type { #define CTF_TYPE_INT_CHAR 0x2 #define CTF_TYPE_INT_BOOL 0x4 #define CTF_TYPE_INT_VARARGS 0x8 +#define CTF_TYPE_INT_UNSIGNED 0x16 #define CTF_TYPE_FP_ATTRS(VAL) ((VAL) >> 24) #define CTF_TYPE_FP_OFFSET(VAL) (((VAL) >> 16) & 0xff) diff --git a/dwarf_loader.c b/dwarf_loader.c index b73d7867e1e6..79d40f183c24 100644 --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -473,6 +473,7 @@ static struct base_type *base_type__new(Dwarf_Die *die, struct cu *cu) bt->is_bool = encoding == DW_ATE_boolean; bt->is_signed = encoding == DW_ATE_signed; bt->is_varargs = false; + bt->is_unsigned = encoding == DW_ATE_unsigned; bt->name_has_encoding = true; } diff --git a/dwarves.h b/dwarves.h index 98caf1abc54d..edf32d2e6f80 100644 --- a/dwarves.h +++ b/dwarves.h @@ -1261,6 +1261,7 @@ struct base_type { uint8_t is_signed:1; uint8_t is_bool:1; uint8_t is_varargs:1; + uint8_t is_unsigned:1; uint8_t float_type:4; }; diff --git a/lib/bpf b/lib/bpf --- a/lib/bpf +++ b/lib/bpf @@ -1 +1 @@ -Subproject commit 5af3d86b5a2c5fecdc3ab83822d083edd32b4396 +Subproject commit 5af3d86b5a2c5fecdc3ab83822d083edd32b4396-dirty diff --git a/libbtf.c b/libbtf.c index 9f7628304495..f47de1ecd21e 100644 --- a/libbtf.c +++ b/libbtf.c @@ -247,6 +247,8 @@ static const char * btf_elf__int_encoding_str(uint8_t encoding) return "CHAR"; else if (encoding == BTF_INT_BOOL) return "BOOL"; + else if (encoding == BTF_INT_UNSIGNED) + return "UNSIGNED"; else return "UNKN"; } @@ -379,6 +381,8 @@ int32_t btf_elf__add_base_type(struct btf_elf *btfe, const struct base_type *bt, encoding = BTF_INT_SIGNED; } else if (bt->is_bool) { encoding = BTF_INT_BOOL; + } else if (bt->is_unsigned) { + ; /* ignored for now */ } else if (bt->float_type) { fprintf(stderr, "float_type is not supported\n"); return -1;