]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libctf: archive: allow opening BTF dicts in archives (not for upstreaming)
authorNick Alcock <nick.alcock@oracle.com>
Fri, 25 Apr 2025 20:09:34 +0000 (21:09 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 25 Apr 2025 20:23:08 +0000 (21:23 +0100)
commit918e356b18afb5daf4f0ba43f25373689782e3de
treecbdeebe8311b9176606a9127c9e3372ec59a0cf6
parent88f2c13d1ce8e9ceac2b95a515c6d7ed96b87adb
libctf: archive: allow opening BTF dicts in archives (not for upstreaming)

BTF dicts are normally suppressed in archives, but it is possible
to create them with enough cunning.  If such an archive is
encountered, the BTF dicts in it have no parent name, which
means that ctf_arc_import_parent (used by ctf_dict_open_cached,
ctf_archive_next, and all the ctf_arc_lookup functions) fails
to figure out what parent to import, and fails.

Kludge around it by relying on our secret knowledge that ctf_link_write
always emits the parent dict into the archive first.  If no name is set,
import the parent dict for now.  (Before upstreaming, a new archive format
with a dedicated parent dict field will turn up, obviating this kludge.)
libctf/ctf-archive.c