diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2024-07-15 19:42:10 +0100 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2024-07-31 21:02:05 +0100 |
commit | 87b2f673102884d7c69144c85a26ed5dbaa4f86a (patch) | |
tree | 4e1728d7a0facf14c40cb9422b5586ec9ce7abe0 /gas/remap.c | |
parent | 2b35088f30d95cd45bb572765a7b01260a1d8ee2 (diff) | |
download | binutils-87b2f673102884d7c69144c85a26ed5dbaa4f86a.zip binutils-87b2f673102884d7c69144c85a26ed5dbaa4f86a.tar.gz binutils-87b2f673102884d7c69144c85a26ed5dbaa4f86a.tar.bz2 |
libctf: fix linking of non-root-visible types
If you deduplicate non-root-visible types, the resulting type should still
be non-root-visible! We were promoting all such types to root-visible, and
re-demoting them only if their names collided (which might happen on
cu-mapped links if multiple compilation units with conflicting types are
fused into one child dict).
This "worked" before now, in that linking at least didn't fail (if you don't
mind having your non-root flag value destroyed if you're adding
non-root-visible types), but now that conflicting enumerators cause their
containing enums to become conflicted (enums which might have *different
names*), this caused the linker to crash when it hit two enumerators with
conflicting values.
Not testable in ld because cu-mapped links are not exposed to ld, but can be
tested via direct creation of libraries and calls to ctf_link directly.
(This also tests the ctf_dump non-root type printout, which before now
was untested.)
libctf/
* ctf-dedup.c (ctf_dedup_emit_type): Non-root-visible input types
should be emitted as non-root-visible output types.
* testsuite/libctf-writable/ctf-nonroot-linking.c: New test.
* testsuite/libctf-writable/ctf-nonroot-linking.lk: New test.
Diffstat (limited to 'gas/remap.c')
0 files changed, 0 insertions, 0 deletions