[PATCH] D130736: [lld][WebAssemby] Demote LazySymbols back to undefined symbols if they are not loaded

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 17:04:30 PDT 2022


sbc100 created this revision.
Herald added subscribers: pmatos, asb, wingo.
Herald added a project: All.
sbc100 requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.

A LazySymbol is one that lives in `.a` archive and gets pulled in by a
strong reference.  However, weak references to such symbols do not
result in them be loaded from the archive.  In this case we want to
treat such symbols at undefined rather then lazy, once symbols
resolution is complete.

This fixes a crash bug in the linker when weakly referenced symbol that
lives in an archive file is live at the end of the link.  In the case of
dynamic linking this is expected to turn into an import with (in the
case of a function symbol) a function index.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130736

Files:
  lld/test/wasm/shared-weak-undefined.s
  lld/wasm/Driver.cpp
  lld/wasm/SymbolTable.cpp
  lld/wasm/Symbols.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130736.448476.patch
Type: text/x-patch
Size: 4475 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220729/1d1035d4/attachment.bin>


More information about the llvm-commits mailing list