aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2022-12-07 11:47:26 -0800
committerDavid Faust <david.faust@oracle.com>2022-12-14 10:20:52 -0800
commit4f7aa145b796c044526c93f390e68f3b56a1b30a (patch)
treed00cafaed17f579619ed3a981a3e289e57725731 /gcc/rust
parent2bce22e88e1c8486a0f2d42311506a8d3da20fb7 (diff)
downloadgcc-4f7aa145b796c044526c93f390e68f3b56a1b30a.zip
gcc-4f7aa145b796c044526c93f390e68f3b56a1b30a.tar.gz
gcc-4f7aa145b796c044526c93f390e68f3b56a1b30a.tar.bz2
btf: fix 'extern const void' variables [PR106773]
The eBPF loader expects to find BTF_KIND_VAR records for references to extern const void symbols. We were mistakenly identifing these as unsupported types, and as a result skipping emitting VAR records for them. In addition, the internal DWARF representation from which BTF is produced does not generate 'const' modifier DIEs for the void type, which meant in BTF the 'const' qualifier was dropped for 'extern const void' variables. This patch also adds support for generating a const void type in BTF to correct emission for these variables. PR target/106773 gcc/ * btfout.cc (btf_collect_datasec): Correct size of void entries. (btf_dvd_emit_preprocess_cb): Do not skip emitting variables which refer to void types. (btf_init_postprocess): Create 'const void' type record if needed and adjust variables to refer to it as appropriate. gcc/testsuite/ * gcc.dg/debug/btf/btf-pr106773.c: New test.
Diffstat (limited to 'gcc/rust')
0 files changed, 0 insertions, 0 deletions