binutils-gdb/include
Nick Alcock 662df3c3f1 libctf, link: tie in the deduplicating linker
This fairly intricate commit connects up the CTF linker machinery (which
operates in terms of ctf_archive_t's on ctf_link_inputs ->
ctf_link_outputs) to the deduplicator (which operates in terms of arrays
of ctf_file_t's, all the archives exploded).

The nondeduplicating linker is retained, but is not called unless the
CTF_LINK_NONDEDUP flag is passed in (which ld never does), or the
environment variable LD_NO_CTF_DEDUP is set.  Eventually, once we have
confidence in the much-more-complex deduplicating linker, I hope the
nondeduplicating linker can be removed.

In brief, what this does is traverses each input archive in
ctf_link_inputs, opening every member (if not already open) and tying
child dicts to their parents, shoving them into an array and
constructing a corresponding parents array that tells the deduplicator
which dict is the parent of which child.  We then call ctf_dedup and
ctf_dedup_emit with that array of inputs, taking the outputs that result
and putting them into ctf_link_outputs where the rest of the CTF linker
expects to find them, then linking in the variables just as is done by
the nondeduplicating linker.

It also implements much of the CU-mapping side of things.  The problem
CU-mapping introduces is that if you map many input CUs into one output,
this is saying that you want many translation units to produce at most
one child dict if conflicting types are found in any of them.  This
means you can suddenly have multiple distinct types with the same name
in the same dict, which libctf cannot really represent because it's not
something you can do with C translation units.

The deduplicator machinery already committed does as best it can with
these, hiding types with conflicting names rather than making child
dicts out of them: but we still need to call it.  This is done similarly
to the main link, taking the inputs (one CU output at a time),
deduplicating them, taking the output and making it an input to the
final link.  Two (significant) optimizations are done: we share atoms
tables between all these links and the final link (so e.g. all type hash
values are shared, all decorated type names, etc); and any CU-mapped
links with only one input (and no child dicts) doesn't need to do
anything other than renaming the CU: the CU-mapped link phase can be
skipped for it.  Put together, large CU-mapped links can save 50% of
their memory usage and about as much time (and the memory usage for
CU-mapped links is significant, because all those output CUs have to
have all their types stored in memory all at once).

include/
	* ctf-api.h (CTF_LINK_NONDEDUP): New, turn off the
	deduplicator.
libctf/
	* ctf-impl.h (ctf_list_splice): New.
	* ctf-util.h (ctf_list_splice): Likewise.
	* ctf-link.c (link_sort_inputs_cb_arg_t): Likewise.
	(ctf_link_sort_inputs): Likewise.
	(ctf_link_deduplicating_count_inputs): Likewise.
	(ctf_link_deduplicating_open_inputs): Likewise.
	(ctf_link_deduplicating_close_inputs): Likewise.
	(ctf_link_deduplicating_variables): Likewise.
	(ctf_link_deduplicating_per_cu): Likewise.
	(ctf_link_deduplicating): Likewise.
	(ctf_link): Call it.
2020-07-22 18:02:19 +01:00
..
aout Fixes for the magic number used in PDP11 AOUT binaries. 2020-04-14 14:41:27 +01:00
cgen Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
coff Remove powerpc PE support 2020-07-09 22:58:16 +09:30
elf x86: Support GNU_PROPERTY_X86_FEATURE_2_TMM 2020-07-11 04:04:20 -07:00
gdb Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
mach-o Recognize some new Mach-O load commands 2020-06-22 14:29:20 +01:00
opcode RISC-V: Support debug and float CSR as the unprivileged ones. 2020-06-30 09:54:55 +08:00
som ubsan: som: left shift of 1 by 31 places 2020-03-10 17:58:02 +10:30
vms Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
alloca-conf.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ansidecl.h Update libiberty sources with changes in the gcc mainline. 2020-01-17 14:13:22 +00:00
bfdlink.h ld: Properly override the IR definition 2020-07-22 03:49:17 -07:00
binary-io.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
bout.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ChangeLog libctf, link: tie in the deduplicating linker 2020-07-22 18:02:19 +01:00
ChangeLog-0415
ChangeLog-2016
ChangeLog-2017 ChangeLog rotation 2018-01-03 17:49:42 +10:30
ChangeLog-2018 ChangeLog rotation 2019-01-01 21:25:40 +10:30
ChangeLog-2019 ChangeLog rotation 2020-01-01 18:12:08 +10:30
ChangeLog-9103
COPYING
COPYING3
ctf-api.h libctf, link: tie in the deduplicating linker 2020-07-22 18:02:19 +01:00
ctf.h libctf: error out on corrupt CTF with invalid header flags 2020-07-22 17:57:54 +01:00
demangle.h Update libiberty sources with changes in the gcc mainline. 2020-01-17 14:13:22 +00:00
diagnostics.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
dis-asm.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
dwarf2.def Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
dwarf2.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
dyn-string.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
environ.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
fibheap.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
filenames.h Sync config, include and libiberty with GCC 2020-06-24 16:52:48 -07:00
floatformat.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
fnmatch.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
fopen-bin.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
fopen-same.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
fopen-vms.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
gcc-c-fe.def Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
gcc-c-interface.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
gcc-cp-fe.def Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
gcc-cp-interface.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
gcc-interface.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
getopt.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
hashtab.h Merge upstream GCC changes for include/ and libiberty/ directories 2020-02-25 17:04:42 +00:00
hp-symtab.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
leb128.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
libiberty.h Remove the use of the register keyword in the libiberty.h header file - it is deprecated and incompatible with C++17. 2020-06-25 11:16:42 +01:00
longlong.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
lto-symtab.h include: Sync lto-symtab.h and plugin-api.h with GCC 2020-03-21 03:39:18 -07:00
MAINTAINERS Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
md5.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
oasys.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
objalloc.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
obstack.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
os9k.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
partition.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
plugin-api.h include: Sync plugin-api.h with GCC 2020-04-01 02:36:11 -07:00
progress.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
safe-ctype.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
sha1.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
simple-object.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
sort.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
splay-tree.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
symcat.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
timeval-utils.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
vtv-change-permission.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
xregex2.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
xregex.h
xtensa-config.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
xtensa-isa-internal.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
xtensa-isa.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30