[lld][WebAssembly] Fix regression in function signature checking (#78831)
Followup to #78658, which caused a regression in emscripten. When a lazy symbol is added, which resolved and existing undefined symbol, we don't need/want to replace the undefined symbol with the lazy one. Instead we called extract, which replaces the undefined symbol with the defined one. The fact that we were first replacing the undefined symbol with a lazy one before extracting the archive member doesn't normally matter but, in the case of the function symbol, replacing the undefined symbol with a lazy symbol means that `addDefinedFunction` sees the existing symbol as lazy and simply replaces it. Note that this is consistent with both the ELF code in `Symbol::resolve(const LazySymbol &other)` and the wasm code prior to #78658, neither of which replace the existing symbol with the lazy one in this case.
Loading
Please sign in to comment