diff options
author | Indu Bhagat <indu.bhagat@oracle.com> | 2023-12-04 01:57:34 -0800 |
---|---|---|
committer | Indu Bhagat <indu.bhagat@oracle.com> | 2023-12-04 02:00:37 -0800 |
commit | b6abc5dbfa5342347828b9feb4d9060071ff819c (patch) | |
tree | 5c9a6a7bc8666b80d9c8a9dcf78cec0da81fbd24 /gcc/btfout.cc | |
parent | 9b6e2cb7e61ebb7006a89fa75869ec1a3e0a6e33 (diff) | |
download | gcc-b6abc5dbfa5342347828b9feb4d9060071ff819c.zip gcc-b6abc5dbfa5342347828b9feb4d9060071ff819c.tar.gz gcc-b6abc5dbfa5342347828b9feb4d9060071ff819c.tar.bz2 |
BTF: fix PR debug/112656
PR debug/112656 - btf: function prototypes generated with name
With this patch, all BTF_KIND_FUNC_PROTO will appear anonymous in the
generated BTF section.
As noted in the discussion in the bugzilla, the number of
BTF_KIND_FUNC_PROTO types output varies across targets (BPF with -mco-re
vs non-BPF targets). Hence the check in the test case merely checks
that all BTF_KIND_FUNC_PROTO appear anonymous.
gcc/ChangeLog:
PR debug/112656
* btfout.cc (btf_asm_type): Fixup ctti_name for all
BTF types of kind BTF_KIND_FUNC_PROTO.
gcc/testsuite/ChangeLog:
PR debug/112656
* gcc.dg/debug/btf/btf-function-7.c: New test.
Diffstat (limited to 'gcc/btfout.cc')
-rw-r--r-- | gcc/btfout.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/btfout.cc b/gcc/btfout.cc index 1c25404..a5e0d64 100644 --- a/gcc/btfout.cc +++ b/gcc/btfout.cc @@ -820,6 +820,10 @@ btf_asm_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd) btf_kind = BTF_KIND_ENUM64; } + /* PR debug/112656. BTF_KIND_FUNC_PROTO is always anonymous. */ + if (btf_kind == BTF_KIND_FUNC_PROTO) + dtd->dtd_data.ctti_name = 0; + dw2_asm_output_data (4, dtd->dtd_data.ctti_name, "TYPE %" PRIu64 " BTF_KIND_%s '%s'", get_btf_id (dtd->dtd_type), btf_kind_name (btf_kind), |