Sam Clegg 617278e7b0
[lld][WebAssembly] Fix for shared library symbols WRT replacing lazy symbols (#124619)
The rule here, which I'm copying from the ELF linker, is that shared
library symbols should take presence, unless the symbol has already be
extracted from the archive. e.g:

```
$ wasm-ld foo.a foo.so ref.o  // .so wins
$ wasm-ld foo.a ref.o foo.so  // .a wins
```

In the first case the shared library takes precedence because the lazy
symbol is replaced by the .so symbol before it is extracted from the
archive. In the second example the ref.o file causes the archive to be
exracted before the .so file is processed, so in that case the archive
file wins.

Fixes: https://github.com/emscripten-core/emscripten/issues/23501
2025-01-28 16:06:01 -08:00
..