[LLD][COFF] Add index to disambiguate archive members when using -wholearchive
authorRui Ueyama <ruiu@google.com>
Tue, 10 Sep 2019 11:50:26 +0000 (11:50 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 10 Sep 2019 11:50:26 +0000 (11:50 +0000)
commit89efb03463eecc021e8613b79c43ea8ab135ca49
tree2105edb753d1efb67c2cfe1980e3f4650e693667
parentc2d292f839165bc91a40c1a59ef443e9b58d689f
[LLD][COFF] Add index to disambiguate archive members when using -wholearchive

Patch by Markus Böck.

PR42951: When linking an archive with members that have the same name linking
fails when using the -wholearchive option. This patch passes the index
of the member in the archive to the offset parameter to disambiguate the
member.

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

llvm-svn: 371509
lld/COFF/Driver.cpp
lld/test/COFF/thinlto-whole-archives.ll [new file with mode: 0644]