[all-commits] [llvm/llvm-project] b0f18a: [lld][WebAssemby] Demote LazySymbols back to undef...

Sam Clegg via All-commits all-commits at lists.llvm.org
Fri Jul 29 14:05:36 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b0f18af30ba71382feda64fe523baac151d9a43f
  Author: Sam Clegg <sbc at chromium.org>
  Date:   2022-07-29 (Fri, 29 Jul 2022)

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

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

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.

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

More information about the All-commits mailing list