[PATCH] D91577: [lld][WebAssembly] Add --unresolved-symbols=import-dynamic

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 15:47:51 PST 2020


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

This is a new mode for handling unresolved symbols that allows all
symbols to be imported.  With `import-functions` only functions symbols
are imported.  With this new flag all symbols are imported but code must
be compiled with `-fPIC` (i.e. with relocation model set to pic) so that
data symbols can be resolved via imports.

This is importable to allow the building of static binaries that have
dynamic imports.   See:
https://github.com/emscripten-core/emscripten/issues/12682

As with other used of dynamic linking ABI this beviour will produce a
warning unless run with `--experimental-pic`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91577

Files:
  lld/docs/WebAssembly.rst
  lld/test/wasm/Inputs/unresolved-symbols-dynamic.s
  lld/test/wasm/undefined-data.ll
  lld/test/wasm/unresolved-symbols.s
  lld/wasm/Config.h
  lld/wasm/Driver.cpp
  lld/wasm/Relocations.cpp
  lld/wasm/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91577.305617.patch
Type: text/x-patch
Size: 8890 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201116/674ebb14/attachment.bin>


More information about the llvm-commits mailing list