Enable BTF generation in the BPF backend
authorIndu Bhagat <indu.bhagat@oracle.com>
Thu, 20 May 2021 18:21:39 +0000 (11:21 -0700)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Mon, 28 Jun 2021 16:47:21 +0000 (18:47 +0200)
commitd5cf2b5db325fd5c053ca7bc8d6a54a06cd71124
tree20263bd75b4a944a9aaf3119caac662a9e450c87
parent824a6a52a6c2892c8d4a4a889a425bdaf207634f
Enable BTF generation in the BPF backend

This patch changes the BPF GCC backend in order to use the DWARF debug
hooks and therefore enables the user to generate BTF debugging
information with -gbtf.  Generating BTF is crucial when compiling BPF
programs, since the CO-RE (compile-once, run-everwhere) mechanism
used by the kernel BPF loader relies on it.

Note that since in eBPF it is not possible to unwind frames due to the
restrictive nature of the target architecture, we are disabling the
generation of CFA in this target.

2021-06-28  David Faust <david.faust@oracle.com>

* config/bpf/bpf.c (bpf_expand_prologue): Do not mark insns as
frame related.
(bpf_expand_epilogue): Likewise.
* config/bpf/bpf.h (DWARF2_FRAME_INFO): Define to 0.
Do not define DBX_DEBUGGING_INFO.
gcc/config/bpf/bpf.c
gcc/config/bpf/bpf.h