![]() Current BTF only supports 32-bit value. For example, enum T { VAL = 0xffffFFFF00000008 }; the generated BTF looks like .long 16 # BTF_KIND_ENUM(id = 4) .long 100663297 # 0x6000001 .long 8 .long 18 .long 8 The encoded value is 8 which equals to (uint32_t)0xffffFFFF00000008 and this is incorrect. This patch introduced BTF_KIND_ENUM64 which permits to encode 64-bit value. The format for each enumerator looks like: .long name_offset .long (uint32_t)value # lower-32 bit value .long value >> 32 # high-32 bit value We use two 32-bit values to represent a 64-bit value as current BTF type subsection has 4-byte alignment and gaps are not permitted in the subsection. This patch also added support for kflag (the bit 31 of CommonType.Info) such that kflag = 1 implies the value is signed and kflag = 0 implies the value is unsigned. The kernel UAPI enumerator definition is struct btf_enum { __u32 name_off; __s32 val; }; so kflag = 0 with unsigned value provides backward compatability. With this patch, for enum T { VAL = 0xffffFFFF00000008 }; the generated BTF looks like .long 16 # BTF_KIND_ENUM64(id = 4) .long 3187671053 # 0x13000001 .long 8 .long 18 .long 8 # 0x8 .long 4294967295 # 0xffffffff and the enumerator value and signedness are encoded correctly. Differential Revision: https://reviews.llvm.org/D124641 |
||
---|---|---|
.. | ||
align.ll | ||
array-1d-char.ll | ||
array-1d-int.ll | ||
array-2d-int.ll | ||
array-size-0.ll | ||
array-typedef.ll | ||
binary-format.ll | ||
builtin-btf-type-id-2.ll | ||
builtin-btf-type-id.ll | ||
char-no-debuginfo.ll | ||
char.ll | ||
double.ll | ||
empty-btf.ll | ||
enum-basic.ll | ||
extern-builtin.ll | ||
extern-func-arg.ll | ||
extern-func-ptr.ll | ||
extern-global-var.ll | ||
extern-var-func-weak-section.ll | ||
extern-var-func-weak.ll | ||
extern-var-func.ll | ||
extern-var-section.ll | ||
extern-var-struct-weak.ll | ||
extern-var-struct.ll | ||
extern-var-weak-section.ll | ||
filename.ll | ||
float.ll | ||
func-func-ptr.ll | ||
func-non-void.ll | ||
func-source.ll | ||
func-typedef.ll | ||
func-unused-arg.ll | ||
func-void.ll | ||
fwd-no-define.ll | ||
fwd-with-define.ll | ||
global-var-inited.ll | ||
global-var-sec-readonly.ll | ||
global-var-sec.ll | ||
int.ll | ||
local-var-readonly-1.ll | ||
local-var-readonly-2.ll | ||
local-var.ll | ||
longlong.ll | ||
map-def-2.ll | ||
map-def-3.ll | ||
map-def.ll | ||
pruning-const.ll | ||
pruning-multi-derived-type.ll | ||
pruning-typedef.ll | ||
ptr-const-void.ll | ||
ptr-func-1.ll | ||
ptr-func-2.ll | ||
ptr-func-3.ll | ||
ptr-int.ll | ||
ptr-prune-type.ll | ||
ptr-void.ll | ||
ptr-volatile-const-void.ll | ||
ptr-volatile-void.ll | ||
restrict-ptr.ll | ||
short.ll | ||
static-func.ll | ||
static-var-derived-type.ll | ||
static-var-inited-sec.ll | ||
static-var-inited.ll | ||
static-var-readonly-sec.ll | ||
static-var-readonly.ll | ||
static-var-sec.ll | ||
static-var-zerolen-array.ll | ||
static-var.ll | ||
struct-anon-2.ll | ||
struct-anon.ll | ||
struct-basic.ll | ||
struct-bitfield-typedef.ll | ||
struct-enum.ll | ||
tag-1.ll | ||
tag-2.ll | ||
tag-typedef.ll | ||
type-tag-fixup-fwd.ll | ||
type-tag-fixup-resolved.ll | ||
type-tag-var.ll | ||
uchar.ll | ||
uint.ll | ||
ulonglong.ll | ||
union-array-typedef.ll | ||
ushort.ll | ||
weak-global-2.ll | ||
weak-global-3.ll | ||
weak-global.ll |