[lld][WebAssembly] Fix crash on undefined+weak function syms in LTO objects
authorSam Clegg <sbc@chromium.org>
Fri, 27 May 2022 15:34:31 +0000 (08:34 -0700)
committerSam Clegg <sbc@chromium.org>
Fri, 27 May 2022 18:41:34 +0000 (11:41 -0700)
commit0e8f4ce31df192d188239575839d8cceb47caf85
tree4a8b584e83c8463cc2c8e9622473ffe87d1250bb
parent4f12a721f1790f3fafadcd0ad4ce456bb0e04677
[lld][WebAssembly] Fix crash on undefined+weak function syms in LTO objects

Symbols from LTO objects don't contain Wasm signatures, but we need a
signature when we create undefined/stub functions for missing weakly
undefined symbols.

Luckily, after LTO, we know that symbols that are not referenced by a
regular object file must not be needed in the final output so there
is no need to generate undefined/stub function for them.

Differential Revision: https://reviews.llvm.org/D126554
lld/test/wasm/lto/weak-undefined.ll
lld/wasm/SymbolTable.cpp