diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2020-11-20 13:34:04 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2020-11-20 13:34:10 +0000 |
commit | 0e28ade476e20bd8af917e01a3f1429a34cc1d83 (patch) | |
tree | e71bd47c4efb2f5847743e155c07f42e6efed78e /ld | |
parent | 0ad70c536abd64b1b913ce89e385faef34c373c0 (diff) | |
download | fsf-binutils-gdb-0e28ade476e20bd8af917e01a3f1429a34cc1d83.zip fsf-binutils-gdb-0e28ade476e20bd8af917e01a3f1429a34cc1d83.tar.gz fsf-binutils-gdb-0e28ade476e20bd8af917e01a3f1429a34cc1d83.tar.bz2 |
libctf, ld: properly deduplicate function types
Some type kinds in CTF (functions, arrays, pointers, slices, and
cvr-quals) are intrinsically nameless: the ctt_name field in the CTF
is always zero, and the libctf API provides no way to set a name.
But the compiler can and does sometimes set names for some of these
kinds: in particular, the name it sets on CTF_K_FUNCTION types is the
means it uses to force the name of the function into the string table
so that it can point at it from the function info section.
So null out the name at hashing time so that the deduplicator can
correctly detect that e.g. function types identical but for name should
be considered truly identical, since they will not have a name when the
deduplicator re-emits them into the output.
ld/ChangeLog
2020-11-20 Nick Alcock <nick.alcock@oracle.com>
* testsuite/ld-ctf/data-func-conflicted.d: Shrink the expected
size of the type section now that function types are being
deduplicated properly.
libctf/ChangeLog
2020-11-20 Nick Alcock <nick.alcock@oracle.com>
* ctf-dedup.c (ctf_dedup_rhash_type): Null out the names of nameless
type kinds, just in case the input has named them.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-ctf/data-func-conflicted.d | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 8b088b4..5e81fa2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,11 @@ 2020-11-20 Nick Alcock <nick.alcock@oracle.com> + * testsuite/ld-ctf/data-func-conflicted.d: Shrink the expected + size of the type section now that function types are being + deduplicated properly. + +2020-11-20 Nick Alcock <nick.alcock@oracle.com> + * testsuite/ld-ctf/array.d: Adjust for nonzero flags word and public symbols in the data section rather than variables: use sysv hash style to keep test results the same on non-GNU targets. diff --git a/ld/testsuite/ld-ctf/data-func-conflicted.d b/ld/testsuite/ld-ctf/data-func-conflicted.d index 626bfef..1fa8bb2 100644 --- a/ld/testsuite/ld-ctf/data-func-conflicted.d +++ b/ld/testsuite/ld-ctf/data-func-conflicted.d @@ -16,7 +16,7 @@ Contents of CTF section \.ctf: Data object section: .* \(0xc bytes\) Function info section: .* \(0x40 bytes\) Object index section: .* \(0xc bytes\) - Type section: .* \(0x228 bytes\) + Type section: .* \(0xe8 bytes\) String section: .* #... Data objects: |