[PATCH] D108413: [lld][WebAssembly] Handle weakly defined symbols in shared libraries.

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 19 14:52:42 PDT 2021


sbc100 created this revision.
Herald added subscribers: wingo, ecnelises, sunfish, jgravelle-google, dschuff.
sbc100 requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.

In the case of weakly defined symbols in shared libraries we now
generate both an import and an export.  The dynamic linker can then
choose how a winner from amount all the shared libraries that defined a
given symbol.

Previously any direct usage of a weakly defined symbol would use the
DSO-local definition (For example, even through there would be single
address for a weakly defined function, each DSO could end up directly
calling its local version).

Fixes: https://github.com/emscripten-core/emscripten/issues/13773


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108413

Files:
  lld/test/wasm/shared-weak-symbols.s
  lld/wasm/Symbols.cpp
  lld/wasm/Symbols.h
  lld/wasm/SyntheticSections.cpp
  lld/wasm/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108413.367627.patch
Type: text/x-patch
Size: 6749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210819/985486cc/attachment.bin>


More information about the llvm-commits mailing list