[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
This commit is contained in:
Sam Clegg 2018-01-20 00:52:51 +00:00
parent 0699f57bc7
commit 77ee17d191
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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;