[all-commits] [llvm/llvm-project] 86c90f: [lld][WebAssembly] Add --unresolved-symbols=import...

Sam Clegg via All-commits all-commits at lists.llvm.org
Tue Mar 15 15:13:57 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 86c90f9bfdc4e9f02533196396a6ae363449b6a3
      https://github.com/llvm/llvm-project/commit/86c90f9bfdc4e9f02533196396a6ae363449b6a3
  Author: Sam Clegg <sbc at chromium.org>
  Date:   2022-03-15 (Tue, 15 Mar 2022)

  Changed paths:
    M lld/docs/WebAssembly.rst
    M lld/test/wasm/shared.s
    M lld/test/wasm/shared64.s
    M lld/test/wasm/undefined-data.s
    A lld/test/wasm/unresolved-symbols-dynamic.s
    M lld/test/wasm/unresolved-symbols.s
    M lld/wasm/Config.h
    M lld/wasm/Driver.cpp
    M lld/wasm/InputChunks.cpp
    M lld/wasm/Relocations.cpp
    M lld/wasm/SyntheticSections.cpp
    M lld/wasm/SyntheticSections.h
    M lld/wasm/Writer.cpp

  Log Message:
  -----------
  [lld][WebAssembly] Add --unresolved-symbols=import-dynamic

This is a new mode for handling unresolved symbols that allows all
symbols to be imported in the same that they would be in the case of
`-fpie` or `-shared`, but generting an otherwise fixed/non-relocatable
binary.

Code linked in this way should still be compiled with `-fPIC` so that
data symbols can be resolved via imports.

This essentially allows the building of static binaries that have
dynamic imports.  See:
https://github.com/emscripten-core/emscripten/issues/12682

As with other uses of the experimental dynamic linking ABI, this
behaviour will produce a warning unless run with `--experimental-pic`.

Differential Revision: https://reviews.llvm.org/D91577




More information about the All-commits mailing list