[all-commits] [llvm/llvm-project] 58d5a4: [lld][WebAssembly] Fix regression in function sign...

Sam Clegg via All-commits all-commits at lists.llvm.org
Fri Jan 19 21:45:42 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 58d5a486ec641156dcf420d67e075dc0a766fc5e
      https://github.com/llvm/llvm-project/commit/58d5a486ec641156dcf420d67e075dc0a766fc5e
  Author: Sam Clegg <sbc at chromium.org>
  Date:   2024-01-19 (Fri, 19 Jan 2024)

  Changed paths:
    M lld/test/wasm/signature-mismatch.s
    M lld/wasm/SymbolTable.cpp

  Log Message:
  -----------
  [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.




More information about the All-commits mailing list