aboutsummaryrefslogtreecommitdiff
path: root/gcc/btfout.c
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 /gcc/btfout.c
parentb60761baa6fd6acf3200e732283d133f4ce0f0e9 (diff)
downloadgcc-18d0fad77b580d1ac64ed04d94fd3c9795687b91.zip
gcc-18d0fad77b580d1ac64ed04d94fd3c9795687b91.tar.gz
gcc-18d0fad77b580d1ac64ed04d94fd3c9795687b91.tar.bz2
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 'gcc/btfout.c')
-rw-r--r--gcc/btfout.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/btfout.c b/gcc/btfout.c
index e58c969..8cdd990 100644
--- a/gcc/btfout.c
+++ b/gcc/btfout.c
@@ -124,6 +124,7 @@ get_btf_kind (uint32_t ctf_kind)
switch (ctf_kind)
{
case CTF_K_INTEGER: return BTF_KIND_INT;
+ case CTF_K_FLOAT: return BTF_KIND_FLOAT;
case CTF_K_POINTER: return BTF_KIND_PTR;
case CTF_K_ARRAY: return BTF_KIND_ARRAY;
case CTF_K_FUNCTION: return BTF_KIND_FUNC_PROTO;
@@ -627,6 +628,7 @@ btf_asm_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd)
switch (btf_kind)
{
case BTF_KIND_INT:
+ case BTF_KIND_FLOAT:
case BTF_KIND_STRUCT:
case BTF_KIND_UNION:
case BTF_KIND_ENUM: