]> git.ipfire.org Git - thirdparty/gcc.git/commit
bpf: Always emit .BTF.ext section if generating BTF
authorCupertino Miranda <cupertino.miranda@oracle.com>
Mon, 12 Feb 2024 17:37:37 +0000 (17:37 +0000)
committerCupertino Miranda <cupertino.miranda@oracle.com>
Wed, 28 Feb 2024 19:20:20 +0000 (19:20 +0000)
commit38d2eb337b41e9cdc5eb89ab865d74ef5304bc03
treea01f1992e0887de5303d85c0d53a648835fc029a
parent69a3ce49bda929e1ffbc1fc1123f5f2485ec944d
bpf: Always emit .BTF.ext section if generating BTF

BPF applications, when generating BTF information should always create a
.BTF.ext section.
Current implementation was only creating it when -mco-re option was used.
This patch makes .BTF.ext always be generated for BPF target objects.
The patch also adds conditions around btf_finalize function call
such that BTF deallocation happens later for BPF target.
For BPF, btf_finalize is only called after .BTF.ext is generated.

gcc/ChangeLog:

* config/bpf/bpf.cc (bpf_option_override): Make .BTF.ext
enabled by default for BPF.
(bpf_file_end): Call BTF deallocation.
(bpf_asm_init_sections): Correct condition.
* dwarf2ctf.cc (ctf_debug_finalize): Conditionally execute BTF
deallocation.
(ctf_debuf_finish): Correct condition for calling
ctf_debug_finalize.
gcc/config/bpf/bpf.cc
gcc/dwarf2ctf.cc