]> gcc.gnu.org Git - gcc.git/commit
btf: be clear when record size/type is not used
authorDavid Faust <david.faust@oracle.com>
Tue, 30 May 2023 16:16:36 +0000 (09:16 -0700)
committerDavid Faust <david.faust@oracle.com>
Wed, 31 May 2023 15:32:25 +0000 (08:32 -0700)
commit008878653989da899c9756df0896a722d25e5498
treea01eeebb09690b398ff1bddca8e2b551d43c0644
parent3f4853a5f00fabdc7b9ce01fbbdd6f4be11506c5
btf: be clear when record size/type is not used

All BTF type records have a 4-byte field used to encode a size or link
to another type, depending on the type kind. But BTF_KIND_ARRAY and
BTF_KIND_FWD do not use this field at all, and should write zero.

GCC already correctly writes zero in this field for these type kinds,
but the process is not straightforward and results in the -dA comment
claiming the field is a reference to another type. This patch makes
the behavior explicit and updates the assembler comment to state
clearly that the field is unused.

gcc/

* btfout.cc (btf_asm_type): Add dedicated cases for BTF_KIND_ARRAY
and BTF_KIND_FWD which do not use the size/type field at all.
gcc/btfout.cc
This page took 0.059773 seconds and 5 git commands to generate.