[lld][WebAssembly] Fix for --relocatable and signature mismatches
authorSam Clegg <sbc@chromium.org>
Tue, 12 May 2020 00:39:04 +0000 (17:39 -0700)
committerSam Clegg <sbc@chromium.org>
Wed, 13 May 2020 17:27:09 +0000 (10:27 -0700)
commit064e9907ba069392427887405481d5e7abc1f662
treee0b68da55cdbc7433bcc7658eefd182fb328cb5b
parent4d4ea9ac59cd541b1d5e38ab87a70a38d3bc09bb
[lld][WebAssembly] Fix for --relocatable and signature mismatches

This is a followup to https://reviews.llvm.org/D78779.

When signatures mismatch we create set of variant symbols.  Some of
the fields in these symbols were not be initialized correct.
Specifically we were seeing isUsedInRegularObj not being set correctly,
leading to the symbol not getting included in the symbol table
and a crash writing relections in --reloctable mode.

There is larger refactor due here, but this is a minimal change the
fixes the bug at hand.

Differential Revision: https://reviews.llvm.org/D79756
lld/test/wasm/Inputs/sig_mismatch.s [new file with mode: 0644]
lld/test/wasm/signature-mismatch-relocatable.s [new file with mode: 0644]
lld/wasm/SymbolTable.cpp