summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-01-20 00:52:51 +0000
committerSam Clegg <sbc@chromium.org>2018-01-20 00:52:51 +0000
commit77ee17d1919cd088e46b060d1d0950544446f1b5 (patch)
tree80eedaf931b567c23b12c4194b2ae08c2d64364d
parent0699f57bc7a7932ab29f2c9a09cb01a74ebc3b91 (diff)
downloadbcm5719-llvm-77ee17d1919cd088e46b060d1d0950544446f1b5.tar.gz
bcm5719-llvm-77ee17d1919cd088e46b060d1d0950544446f1b5.zip
[WebAssembly] Remove custom handling for undefined entry
This code was needed back when we were not able to write out the synthetic symbol for main. Add tests to make sure we can handle this now. Differential Revision: https://reviews.llvm.org/D42322 llvm-svn: 323020
-rw-r--r--lld/test/wasm/undefined-entry.test6
-rw-r--r--lld/wasm/Driver.cpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/lld/test/wasm/undefined-entry.test b/lld/test/wasm/undefined-entry.test
index 55f7d6fb784..11af20a1a40 100644
--- a/lld/test/wasm/undefined-entry.test
+++ b/lld/test/wasm/undefined-entry.test
@@ -2,3 +2,9 @@ RUN: llc -filetype=obj -mtriple=wasm32-unknown-unknown-wasm %p/Inputs/ret32.ll -
RUN: not lld -flavor wasm -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s
CHECK: error: undefined symbol: _start
+
+RUN: not lld -flavor wasm -entry=foo -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s -check-prefix=CHECK-CUSTOM
+
+CHECK-CUSTOM: error: undefined symbol: foo
+
+RUN: lld -flavor wasm -entry=foo --allow-undefined -o %t.wasm %t.ret32.o
diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
index 23220e9a276..8012be5cea0 100644
--- a/lld/wasm/Driver.cpp
+++ b/lld/wasm/Driver.cpp
@@ -349,8 +349,6 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
Sym->setHidden(false);
}
- if (!Config->Entry.empty() && !Symtab->find(Config->Entry)->isDefined())
- error("entry point not found: " + Config->Entry);
if (errorCount())
return;
OpenPOWER on IntegriCloud