Wed Jun 16 2021 Nick Alcock <nick.alcock@oracle.com> - 2.30.93.0.2
- Backport the fully-functional CTF deduplicator. The spurious conflicts
in the previous version are gone; ambiguously-defined types and those
depending on them are properly shuffled into per-CU dicts; the
share-duplicated link mode used by ctfarchive where types only used in
one CU end up in a per-CU dict is fully implemented. This is the
version that is upstream.
The linker is much faster, uses much less memory, and generates much
smaller CTF output (usually better than dwarf2ctf despite emitting
function types where dwarf2ctf did not) and is much more robust and
more heavily tested.
- Remove the nondeduplicating CTF linker, and dead code supporting
impossible things unnamed typedefs and basic types
- Backport the new ld-ctf and libctf testsuites
- New linker options --ctf-variables (off by default), --ctf-share-types
- func info / data object support (needs compiler changes for
working func info support, but all the code is there in binutils now);
new API functions to add symbols to a dict, look them up, and iterate over
them: ctf_symbol_next, ctf_add_objt_sym, ctf_add_func_sym,
ctf_link_add_linker_symbol, ctf_arc_lookup_symbol, ctf_lookup_by_symbol_name,
ctf_arc_lookup_symbol_name
- Backport numerous bugfixes: fix handling of function types' arglists,
allow ctf_type_reference of dynamic slices; prevent some causes of
munmap()s of random chunks of memory; improved handling of corrupted
dicts; improve dump output some more; fix some error handling bugs;
fix opening CTF in binaries with a strtab but no symtab; use a more reliable
method to ensure the output has exactly one .ctf section; use the dynamic
sections for strings and symbols so that CTF is not corrupted by strip(1);
improve the CTF dumper; support unnamed structure members better; fix a
theoretical buffer overrun when looking up symbols by name; improve
pointer lookup by name in dicts with parents; don't lose types or corrupt
the dict when looking up or adding more types in writable dicts after
serializing the dict
- more armoring against invalid CTF and prevention of wrong results when
asking for things like the size of opaque forwards or the encoding of enums
- gettextization
- New public API also used by the deduplicator: improved error reporting and
assertion failures; improved _next iterators with most _iter iterators
reimplemented using them, new API functions *_next, ctf_type_name_raw,
ctf_type_kind_forwarded, ctf_ref, ctf_member_count, ctf_archive_count,
ctf_arc_flush_caches, ctf_getsymsect, ctf_getstrsect, ctf_symsect_endianness,
ctf_arc_symsect_endianness, ctf_add_unknown; add ctf_dict_t as a recommended
new typename for the deprecated ctf_file_t, and new functions with _dict in
the name; add the ability to filter out variables from the link
- New internal infrastructure: new internal dynhash functions and a new dynset
type; higher-efficiency dynhashes; removal of unnecessary duplication in
type lookup paths; add optional lazy loading of CTF >at link time (not used
by ld); make cu-mapping links (as used by ctfarchive) take much less memory
- Run make check in libctf too.
- Reviewed-by: David Faust <david.faust@oracle.com>