binutils-gdb/libctf
Nick Alcock eabb7154df libctf: add linking of the variable section
The compiler describes the name and type of all file-scope variables in
this section.  Merging it at link time requires using the type mapping
added in the previous commit to determine the appropriate type for the
variable in the output, given its type in the input: we check the shared
container first, and if the type doesn't exist there, it must be a
conflicted type in the per-CU child, and the variable should go there
too.  We also put the variable in the per-CU child if a variable with
the same name but a different type already exists in the parent: we
ignore any such conflict in the child because CTF cannot represent such
things, nor can they happen unless a third-party linking program has
overridden the mapping of CU to CTF archive member name (using machinery
added in a later commit).

v3: rewritten using an algorithm that actually works in the case of
    conflicting names.  Some code motion from the next commit.  Set
    the per-CU parent name.
v4: check for strdup failure.
v5: fix tabdamage.

include/
	* ctf-api.h (ECTF_INTERNAL): New.

libctf/
	* ctf-link.c (ctf_create_per_cu): New, refactored out of...
	(ctf_link_one_type): ... here, with parent-name setting added.
	(check_variable): New.
	(ctf_link_one_variable): Likewise.
	(ctf_link_one_input_archive_member): Call it.
	* ctf-error.c (_ctf_errlist): Updated with new errors.
2019-10-03 17:04:55 +01:00
..
aclocal.m4
ChangeLog libctf: add linking of the variable section 2019-10-03 17:04:55 +01:00
config.h.in
configure
configure.ac
ctf-archive.c libctf: write CTF files to memory, and CTF archives to fds 2019-10-03 17:04:55 +01:00
ctf-create.c libctf: map from old to corresponding newly-added types in ctf_add_type 2019-10-03 17:04:55 +01:00
ctf-decl.c
ctf-decls.h
ctf-dump.c libctf: dump: check the right error values when dumping functions 2019-10-03 17:04:55 +01:00
ctf-endian.h libctf: make it compile for old glibc 2019-10-03 17:04:55 +01:00
ctf-error.c libctf: add linking of the variable section 2019-10-03 17:04:55 +01:00
ctf-hash.c libctf: map from old to corresponding newly-added types in ctf_add_type 2019-10-03 17:04:55 +01:00
ctf-impl.h libctf: map from old to corresponding newly-added types in ctf_add_type 2019-10-03 17:04:55 +01:00
ctf-labels.c
ctf-link.c libctf: add linking of the variable section 2019-10-03 17:04:55 +01:00
ctf-lookup.c
ctf-open-bfd.c libctf, bfd: fix ctf_bfdopen_ctfsect opening symbol and string sections 2019-10-03 17:04:55 +01:00
ctf-open.c libctf: map from old to corresponding newly-added types in ctf_add_type 2019-10-03 17:04:55 +01:00
ctf-qsort_r.c
ctf-string.c libctf: support getting strings from the ELF strtab 2019-10-03 17:04:55 +01:00
ctf-subr.c
ctf-types.c libctf: Add iteration over non-root types 2019-10-03 17:04:55 +01:00
ctf-util.c
elf.h
Makefile.am libctf: add the ctf_link machinery 2019-10-03 17:04:55 +01:00
Makefile.in libctf: add the ctf_link machinery 2019-10-03 17:04:55 +01:00
swap.h