HomePhabricator

[lld][WebAssembly] Implement --unresolved-symbols

Authored by sbc100 on May 1 2020, 9:14 AM.

Description

[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

Details

Committed
sbc100Nov 17 2020, 4:27 PM
Differential Revision
D79248: [lld][WebAssembly] Implement --unresolved-symbols
Parents
rGe5d240968919: [gn build] Port f8f6d6455f9
Branches
Unknown
Tags
Unknown