Skip to content

Commit 86ed96d

Browse files
committed
wasm-linker: check for undefined symbols
Unless the `--import-symbols` flag is set, in which case we don't check for any undefined data symbols.
1 parent 3e32a18 commit 86ed96d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/link/Wasm.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ fn validateFeatures(
805805

806806
fn checkUndefinedSymbols(wasm: *const Wasm) !void {
807807
if (wasm.base.options.output_mode == .Obj) return;
808+
if (wasm.base.options.import_symbols) return;
808809

809810
var found_undefined_symbols = false;
810811
for (wasm.undefs.values()) |undef| {
@@ -2467,6 +2468,7 @@ fn linkWithZld(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) l
24672468
var enabled_features: [@typeInfo(types.Feature.Tag).Enum.fields.len]bool = undefined;
24682469
try wasm.validateFeatures(&enabled_features, &emit_features_count);
24692470
try wasm.resolveSymbolsInArchives();
2471+
try wasm.checkUndefinedSymbols();
24702472

24712473
try wasm.setupStart();
24722474
try wasm.setupImports();

0 commit comments

Comments
 (0)