aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.h
diff options
context:
space:
mode:
authorCupertino Miranda <cupertino.miranda@oracle.com>2024-02-12 17:46:03 +0000
committerCupertino Miranda <cupertino.miranda@oracle.com>2024-02-28 19:20:21 +0000
commit77142bdba485057550c5d849864948b0d20be8af (patch)
tree6122a8242d4c336f8a354e59a2d55407ba27acfe /gcc/function.h
parent38d2eb337b41e9cdc5eb89ab865d74ef5304bc03 (diff)
downloadgcc-77142bdba485057550c5d849864948b0d20be8af.zip
gcc-77142bdba485057550c5d849864948b0d20be8af.tar.gz
gcc-77142bdba485057550c5d849864948b0d20be8af.tar.bz2
bpf: implementation of func_info in .BTF.ext.
Kernel verifier complains in some particular cases for missing func_info implementation in .BTF.ext. This patch implements it. Strings are cached locally in coreout.cc to avoid adding duplicated strings in the string list. This string deduplication should eventually be moved to the CTFC functions such that this happens widely. With this implementation, the CO-RE relocations information was also simplified and integrated with the FuncInfo structures. gcc/Changelog: PR target/113453 * config/bpf/bpf.cc (bpf_function_prologue): Define target hook. * config/bpf/coreout.cc (brf_ext_info_section) (btf_ext_info): Move from coreout.h (btf_ext_funcinfo, btf_ext_lineinfo): Add struct. (bpf_core_reloc): Rename to btf_ext_core_reloc. (btf_ext): Add static variable. (btfext_info_sec_find_or_add, SEARCH_NODE_AND_RETURN) (bpf_create_or_find_funcinfo, bpt_create_core_reloc) (btf_ext_add_string, btf_funcinfo_type_callback) (btf_add_func_info_for, btf_validate_funcinfo) (btf_ext_info_len, output_btfext_func_info): Add function. (output_btfext_header, bpf_core_reloc_add) (output_btfext_core_relocs, btf_ext_init, btf_ext_output): Change to support new structs. * config/bpf/coreout.h (btf_ext_funcinfo, btf_ext_lineinfo): Move and change in coreout.cc. (btf_add_func_info_for, btf_ext_add_string): Add prototypes. gcc/testsuite/ChangeLog: PR target/113453 * gcc.target/bpf/btfext-funcinfo-nocore.c: Add. * gcc.target/bpf/btfext-funcinfo.c: Add. * gcc.target/bpf/core-attr-5.c: Fix regexp. * gcc.target/bpf/core-attr-6.c: Fix regexp. * gcc.target/bpf/core-builtin-fieldinfo-offset-1.c: Fix regexp. * gcc.target/bpf/core-section-1.c: Fix regexp.
Diffstat (limited to 'gcc/function.h')
0 files changed, 0 insertions, 0 deletions