Fix a bug in ICF involving COFF associative sections.
authorRui Ueyama <ruiu@google.com>
Fri, 2 Dec 2016 07:46:12 +0000 (07:46 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 2 Dec 2016 07:46:12 +0000 (07:46 +0000)
commit27498b5dd5f97fcd294dd7142a356c32ef139d93
tree0f030d1b164fdf392b31c002e59f5b28a7b77a53
parent17ddb521efcc447049972eb72db4bee741974f11
Fix a bug in ICF involving COFF associative sections.

Associative sections are sections that need to be linked if their associated
sections are linked. Associative sections are used to append auxiliary data
such as debug info.

Previously, we compared all associative sections when comparing two comdat
sections. Because usually assocative sections are not mergeable sections,
we missed a lot of mergeable sections. MSVC linker doesn't seem to check
the identity of associative sections.

This patch makes LLD to ignore associative sections when doing ICF.

llvm-svn: 288483
lld/COFF/ICF.cpp
lld/test/COFF/icf-associative.test [new file with mode: 0644]