summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2021-06-01 09:22:59 -0700
committerDavid Faust <david.faust@oracle.com>2021-07-02 08:32:44 -0700
commit18d0fad77b580d1ac64ed04d94fd3c9795687b91 (patch)
tree1dcda79f66eae9a3de3ddc5028ec73c71db26cd5 /include
parentPreparing to use shifts to eliminate redundant test/compare insns on H8 (diff)
downloadgcc-18d0fad77b580d1ac64ed04d94fd3c9795687b91.tar.gz
gcc-18d0fad77b580d1ac64ed04d94fd3c9795687b91.tar.bz2
gcc-18d0fad77b580d1ac64ed04d94fd3c9795687b91.tar.xz
BTF: Support for BTF_KIND_FLOAT
Add BTF_KIND_FLOAT, a new BTF type kind which has recently stabilized in the linux kernel [1]. This kind is used for encoding floating point types, and is of particular use when generating BTF for some s390 arch-specific kernel headers. Also update some BTF tests which previously used floating point types to check correct behavior for types with no BTF representation. [1]: https://github.com/torvalds/linux/commit/b1828f0b04828aa8cccadf00a702f459caefeed9 include/ChangeLog: * btf.h (struct btf_type): Update bit usage comment. (BTF_INFO_KIND): Update bit mask. (BTF_KIND_FLOAT): New define. (BTF_KIND_MAX): Update. gcc/ChangeLog: * btfout.c (get_btf_kind): Support BTF_KIND_FLOAT. (btf_asm_type): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/debug/btf/btf-float-1.c: New test. * gcc.dg/debug/btf/btf-function-3.c: Use different unrepresentable type. * gcc.dg/debug/btf/btf-struct-2.c: Likewise. * gcc.dg/debug/btf/btf-variables-2.c: Likewise.
Diffstat (limited to 'include')
-rw-r--r--include/btf.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/btf.h b/include/btf.h
index 3b1a4c3093f..bf720ee49b4 100644
--- a/include/btf.h
+++ b/include/btf.h
@@ -62,8 +62,8 @@ struct btf_type
62 uint32_t info; /* Encoded kind, variant length, kind flag: 62 uint32_t info; /* Encoded kind, variant length, kind flag:
63 - bits 0-15: vlen 63 - bits 0-15: vlen
64 - bits 16-23: unused 64 - bits 16-23: unused
65 - bits 24-27: kind 65 - bits 24-28: kind
66 - bits 28-30: unused 66 - bits 29-30: unused
67 - bit 31: kind_flag 67 - bit 31: kind_flag
68 See accessor macros below. */ 68 See accessor macros below. */
69 69
@@ -79,7 +79,7 @@ struct btf_type
79 79
80/* The folloing macros access the information encoded in btf_type.info. */ 80/* The folloing macros access the information encoded in btf_type.info. */
81/* Type kind. See below. */ 81/* Type kind. See below. */
82#define BTF_INFO_KIND(info) (((info) >> 24) & 0x0f) 82#define BTF_INFO_KIND(info) (((info) >> 24) & 0x1f)
83/* Number of entries of variable length data following certain type kinds. 83/* Number of entries of variable length data following certain type kinds.
84 For example, number of structure members, number of function parameters. */ 84 For example, number of structure members, number of function parameters. */
85#define BTF_INFO_VLEN(info) ((info) & 0xffff) 85#define BTF_INFO_VLEN(info) ((info) & 0xffff)
@@ -108,7 +108,8 @@ struct btf_type
108#define BTF_KIND_FUNC_PROTO 13 /* Function Prototype. */ 108#define BTF_KIND_FUNC_PROTO 13 /* Function Prototype. */
109#define BTF_KIND_VAR 14 /* Variable. */ 109#define BTF_KIND_VAR 14 /* Variable. */
110#define BTF_KIND_DATASEC 15 /* Section such as .bss or .data. */ 110#define BTF_KIND_DATASEC 15 /* Section such as .bss or .data. */
111#define BTF_KIND_MAX BTF_KIND_DATASEC 111#define BTF_KIND_FLOAT 16 /* Floating point. */
112#define BTF_KIND_MAX BTF_KIND_FLOAT
112#define NR_BTF_KINDS (BTF_KIND_MAX + 1) 113#define NR_BTF_KINDS (BTF_KIND_MAX + 1)
113 114
114/* For some BTF_KINDs, struct btf_type is immediately followed by 115/* For some BTF_KINDs, struct btf_type is immediately followed by