[all-commits] [llvm/llvm-project] c468dc: [lld][WebAssembly] Handle weakly defined symbols i...

Sam Clegg via All-commits all-commits at lists.llvm.org
Thu Aug 19 16:26:52 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c468dc1b12d8db2c2f881db5b0166f73345631c2
      https://github.com/llvm/llvm-project/commit/c468dc1b12d8db2c2f881db5b0166f73345631c2
  Author: Sam Clegg <sbc at chromium.org>
  Date:   2021-08-19 (Thu, 19 Aug 2021)

  Changed paths:
    A lld/test/wasm/shared-weak-symbols.s
    M lld/wasm/Symbols.cpp
    M lld/wasm/Symbols.h
    M lld/wasm/SyntheticSections.cpp
    M lld/wasm/Writer.cpp

  Log Message:
  -----------
  [lld][WebAssembly] Handle weakly defined symbols in shared libraries.

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 among all the shared libraries that define 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

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




More information about the All-commits mailing list