diff options
Diffstat (limited to 'gcc/dwarf2ctf.cc')
-rw-r--r-- | gcc/dwarf2ctf.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/dwarf2ctf.cc b/gcc/dwarf2ctf.cc index 93e5619..dca86ed 100644 --- a/gcc/dwarf2ctf.cc +++ b/gcc/dwarf2ctf.cc @@ -944,7 +944,10 @@ ctf_debug_finalize (const char *filename, bool btf) if (btf) { btf_output (filename); - btf_finalize (); + /* btf_finalize when compiling BPF applciations gets deallocated by the + BPF target in bpf_file_end. */ + if (btf_debuginfo_p () && !btf_with_core_debuginfo_p ()) + btf_finalize (); } else @@ -1027,11 +1030,8 @@ ctf_debug_finish (const char * filename) /* Emit BTF debug info here when CO-RE relocations need to be generated. BTF with CO-RE relocations needs to be generated when CO-RE is in effect for the BPF target. */ - if (btf_with_core_debuginfo_p ()) - { - gcc_assert (btf_debuginfo_p ()); - ctf_debug_finalize (filename, btf_debuginfo_p ()); - } + if (btf_debuginfo_p () && btf_with_core_debuginfo_p ()) + ctf_debug_finalize (filename, btf_debuginfo_p ()); } #include "gt-dwarf2ctf.h" |