]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libctf, dedup: reclaim space wasted by duplicate hidden types
authorNick Alcock <nick.alcock@oracle.com>
Tue, 3 Jun 2025 11:01:45 +0000 (12:01 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 26 Jun 2025 14:50:48 +0000 (15:50 +0100)
commitfe282c7bb5f331f6f00759ed961e1730c007a54a
tree3ab6e2b6b7c522e54945d1319f891e3fb5ddf018
parent00f6dcc33cf988b01ea725fad2e85f668dac6571
libctf, dedup: reclaim space wasted by duplicate hidden types

In normal deduplicating links, we insert every type (identified by its
unique hash) precisely once.  But conflicting types appear in multiple
dicts, so for those, we loop, inserting them into every target dict
in turn (each corresponding to an input dict that type appears in).
But in cu-mapped links, some of those dicts may have been merged into
one: now that we are hiding duplicate conflicting types more
aggressively in such links, we are getting duplicate identical hidden
types turning up in large numbers.

Fix this by eliminating them in cu-mapping phase 1 (the phase in which this
merging takes place), by checking to see if a type with this hash has
already been inserted in this dict and skipping it if so.  This is
redundant and a waste of time in other cu-mapping phases and in normal
links, but in cu-mapped links it saves a few tens to hundreds of kilobytes
in kernel-sized links.

libctf/
PR libctf/33047
* ctf-dedup.c (ctf_dedup_emit_type): Check for already-emitted
types in cu-mapping phase 1.
libctf/ctf-dedup.c