lld-link: Use just one code path to process associative comdats, reject some invalid...
authorNico Weber <nicolasweber@gmx.de>
Wed, 23 Jan 2019 02:07:10 +0000 (02:07 +0000)
committerNico Weber <nicolasweber@gmx.de>
Wed, 23 Jan 2019 02:07:10 +0000 (02:07 +0000)
commit0fb18e6e780357217eef74d2aebbec1765c21622
treeed2466811e5f6a08b18a65b8fb7ba5d024848be4
parent7c8fc8142e990b862333ea62d446618f249f70e3
lld-link: Use just one code path to process associative comdats, reject some invalid associated comdats

Currently, if an associative comdat appears after the comdat it's associated
with it's processed immediately, else it's deferred until the end of the object
file. I found this confusing to think about while working on PR40094, so this
makes it so that associated comdats are always processed at the end of the
object file.  This seems to be perf-neutral and simpler.

Now there's a natural place to reject the associated comdats referring to later
associated comdats (associated comdats referring to associated comdats is
invalid per COFF spec) that, so reject those. (A later patch will reject
associated comdats referring to earlier comdats.)

Differential Revision: https://reviews.llvm.org/D56929

llvm-svn: 351917
lld/COFF/InputFiles.cpp
lld/test/COFF/associative-comdat-empty.s [new file with mode: 0644]
lld/test/COFF/associative-comdat-order.s [new file with mode: 0644]