From 335672e1580ff0ce23a11ee162dc391dc63b362b Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 8 Mar 2018 01:16:05 +0000 Subject: [WebAssembly] Honor --allow-undefined even for explicit exports When a symbol is exported via --export=foo but --allow-undefined is also specified, the symbol is now allowed to be undefined. Previously we were special casing such symbols. This combinations of behavior is exactly what emescripten requires. Although we are trying hard not to allow emscripten specific features in lld, this one makes sense. Enforce this behavior by added this case to test/wasm/undefined.ll. Differential Revision: https://reviews.llvm.org/D44237 --- lld/wasm/Driver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lld/wasm/Driver.cpp') diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp index ef0794c3073..a97026d4df8 100644 --- a/lld/wasm/Driver.cpp +++ b/lld/wasm/Driver.cpp @@ -346,7 +346,7 @@ void LinkerDriver::link(ArrayRef ArgsArr) { Symbol *Sym = Symtab->find(Name); if (Sym && Sym->isDefined()) Sym->setHidden(false); - else + else if (!Config->AllowUndefined) error("symbol exported via --export not found: " + Name); } -- cgit v1.2.3