diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2019-07-13 21:41:25 +0100 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2019-10-03 17:04:55 +0100 |
commit | eabb7154df3e97e9d808a8673953cc1ce708f3d4 (patch) | |
tree | ab9fd36c30115b6c8d19ec062f5f14e1e2860cd9 /include | |
parent | 886453cbbc86ba63d8ab1264e9684a7698243eeb (diff) | |
download | fsf-binutils-gdb-eabb7154df3e97e9d808a8673953cc1ce708f3d4.zip fsf-binutils-gdb-eabb7154df3e97e9d808a8673953cc1ce708f3d4.tar.gz fsf-binutils-gdb-eabb7154df3e97e9d808a8673953cc1ce708f3d4.tar.bz2 |
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.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/ctf-api.h | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 6980ec2..0122c1d 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,5 +1,9 @@ 2019-07-13 Nick Alcock <nick.alcock@oracle.com> + * ctf-api.h (ECTF_INTERNAL): New. + +2019-07-13 Nick Alcock <nick.alcock@oracle.com> + * ctf-api.h (struct ctf_link_sym): New, a symbol in flight to the libctf linking machinery. (CTF_LINK_SHARE_UNCONFLICTED): New. diff --git a/include/ctf-api.h b/include/ctf-api.h index e4c6f9f..4130a2e 100644 --- a/include/ctf-api.h +++ b/include/ctf-api.h @@ -203,7 +203,8 @@ enum ECTF_SLICEOVERFLOW, /* Overflow of type bitness or offset in slice. */ ECTF_DUMPSECTUNKNOWN, /* Unknown section number in dump. */ ECTF_DUMPSECTCHANGED, /* Section changed in middle of dump. */ - ECTF_NOTYET /* Feature not yet implemented. */ + ECTF_NOTYET, /* Feature not yet implemented. */ + ECTF_INTERNAL /* Internal error in link. */ }; /* The CTF data model is inferred to be the caller's data model or the data |