]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libctf: serialize: handle CTF-versus-BTF output format checks
authorNick Alcock <nick.alcock@oracle.com>
Fri, 25 Apr 2025 16:54:48 +0000 (17:54 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 25 Apr 2025 17:07:44 +0000 (18:07 +0100)
commitd5012389a44029018a92b113d2253afb79493e7e
tree07662788e56e743eed59ad0932e5915b096f27a1
parent585f569a2dc390524607a8c12b7c4716b92abd12
libctf: serialize: handle CTF-versus-BTF output format checks

The internal function ctf_serialize_output_format centralizes all the checks
for BTF-versus-CTF, checking to see if the type section, active
suppressions, and BTF-emission mode permit BTF emission, setting
ctf_serialize.cs_is_btf if we are actually BTF, and raising ECTF_NOTBTF if
we are requiring BTF emission but the type section is such that we can't
emit it.

(There is a forcing parameter in place, as with most of these serialization
functions, to allow for the caller to force CTF emission if it knows the
output will be compressed or will be part of multi-member archives or
something else external to the type section that BTF does not support.)
libctf/ctf-serialize.c