[wasm-ld] --unresolved-symbols=ignore-all
does not actually resolve undefined functions to null
#60806
Labels
--unresolved-symbols=ignore-all
does not actually resolve undefined functions to null
#60806
Reproduction steps:
test.c
:$env:EMCC_DEBUG=1
/export EMCC_DEBUG=1
.emcc test.c -nostdlib -O2
emcc
will fail with a fewwasm-ld
errors like below:export=<...>
arguments, delete--import-undefined
, add--unresolved-symbols=ignore-all
. Run it again with the modified command line.wasm-objdump -j Elem -x a.out.wasm
:wasm-objdump -d a.out.wasm
:Expected behavior (documentation):
undefined_stub
is not in the indirect function table,&undefined_func
is resolved to zero.Actual behavior:
&undefined_func
is resolved to&undefined_stub
/1
.Analysis: scanRelocations will first process the function index relocation, invoking
out.elemSec->addEntry(cast<FunctionSymbol>(sym));
, adding it to the indirect function table, and only then replace the function with a stub (setisStub = true
), hence, the check inElemSection::addEntry
is not effective.The text was updated successfully, but these errors were encountered: