diff --git a/lld/test/wasm/undefined-data.ll b/lld/test/wasm/undefined-data.ll --- a/lld/test/wasm/undefined-data.ll +++ b/lld/test/wasm/undefined-data.ll @@ -1,6 +1,6 @@ ; RUN: llc -filetype=obj %s -o %t.o ; RUN: not wasm-ld -o %t.wasm %t.o 2>&1 | FileCheck %s -check-prefix=UNDEF -; RUN: not wasm-ld --allow-undefined -o %t.wasm %t.o 2>&1 | FileCheck %s -check-prefix=UNDEF +; RUN: wasm-ld --allow-undefined -o %t.wasm %t.o ; RUN: not wasm-ld --shared -o %t.wasm %t.o 2>&1 | FileCheck %s -check-prefix=SHARED target triple = "wasm32-unknown-unknown" diff --git a/lld/wasm/Relocations.cpp b/lld/wasm/Relocations.cpp --- a/lld/wasm/Relocations.cpp +++ b/lld/wasm/Relocations.cpp @@ -21,13 +21,6 @@ } static bool allowUndefined(const Symbol* sym) { - // Historically --allow-undefined doesn't work for data symbols since we don't - // have any way to represent these as imports in the final binary. The idea - // behind allowing undefined symbols is to allow importing these symbols from - // the embedder and we can't do this for data symbols (at least not without - // compiling with -fPIC) - if (isa(sym)) - return false; // Undefined functions with explicit import name are allowed to be undefined // at link time. if (auto *F = dyn_cast(sym))