[lld][WebAssembly] Fix handling of comdat functions in init array.
When hidden symbols are discarded by comdat rules we still want to create a local defined symbol, otherwise `Symbol::isDiscarded()` relies on begin able to check `getChunk->discarded`. This is a followup on rL362769. The comdat.ll test was previously GC'ing the `__wasm_call_ctors` functions so `do_init` was not actually being included in the link. Once that function was included in triggered the crash bug that this change addresses. Fixes: https://github.com/emscripten-core/emscripten/issues/8981 Differential Revision: https://reviews.llvm.org/D64872 llvm-svn: 366358
Loading
Please register or sign in to comment