[all-commits] [llvm/llvm-project] 206884: [lld][WebAssembly] Implement --unresolved-symbols

Sam Clegg via All-commits all-commits at lists.llvm.org
Tue Nov 17 16:28:47 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 206884bf90cd9793558a9c80315ca3cfa35c25d6
      https://github.com/llvm/llvm-project/commit/206884bf90cd9793558a9c80315ca3cfa35c25d6
  Author: Sam Clegg <sbc at chromium.org>
  Date:   2020-11-17 (Tue, 17 Nov 2020)

  Changed paths:
    M lld/docs/WebAssembly.rst
    M lld/test/wasm/archive-weak-undefined.ll
    M lld/test/wasm/cxx-mangling.ll
    M lld/test/wasm/lto/weak-undefined.ll
    M lld/test/wasm/undefined-weak-call.ll
    A lld/test/wasm/unresolved-symbols.s
    M lld/test/wasm/weak-undefined.ll
    M lld/wasm/Config.h
    M lld/wasm/Driver.cpp
    M lld/wasm/Options.td
    M lld/wasm/Relocations.cpp
    M lld/wasm/SymbolTable.cpp
    M lld/wasm/SymbolTable.h
    M lld/wasm/Symbols.cpp
    M lld/wasm/Symbols.h
    M lld/wasm/Writer.cpp

  Log Message:
  -----------
  [lld][WebAssembly] Implement --unresolved-symbols

This is a more full featured version of ``--allow-undefined``.
The semantics of the different methods are as follows:

report-all:

   Report all unresolved symbols.  This is the default.  Normally the
   linker will generate an error message for each reported unresolved
   symbol but the option ``--warn-unresolved-symbols`` can change this
   to a warning.

ignore-all:

   Resolve all undefined symbols to zero.  For data and function
   addresses this is trivial.  For direct function calls, the linker
   will generate a trapping stub function in place of the undefined
   function.

import-functions:

   Generate WebAssembly imports for any undefined functions.  Undefined
   data symbols are resolved to zero as in `ignore-all`.  This
   corresponds to the legacy ``--allow-undefined`` flag.

The plan is to followup with a new mode called `import-dynamic` which
allows for statically linked binaries to refer to both data and
functions symbols from the embedder.

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




More information about the All-commits mailing list