Using the symbol name as suffix for the section name is enough to keep things working for ld.bfd, but making them proper associative comdats helps LLD to bring them in when necessary.
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I'd prefer if we did something like this rather than changing the linker. I see gcc's non-conformance with the coff spec as a bug and if there aren't any real users of gcc+lld I'd prefer us not to have workarounds for that case.
Comment Actions
As tested by @rnk in D49700 (in the comment https://reviews.llvm.org/D49700#1177295), this doesn't actually cause these sections to be deduplicated when using ld.bfd, so this doesn't work as intended/hoped.