[PATCH] D42322: [WebAssembly] Remove custom handling for undefined entry

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 15:10:15 PST 2018


sbc100 created this revision.
Herald added subscribers: llvm-commits, sunfish, aheejin, jgravelle-google, dschuff, jfb.
sbc100 edited the summary of this revision.

Handle undefined entry just like any other symbols.

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.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42322

Files:
  test/wasm/undefined-entry.test
  wasm/Driver.cpp


Index: wasm/Driver.cpp
===================================================================
--- wasm/Driver.cpp
+++ wasm/Driver.cpp
@@ -349,8 +349,6 @@
       Sym->setHidden(false);
   }
 
-  if (!Config->Entry.empty() && !Symtab->find(Config->Entry)->isDefined())
-    error("entry point not found: " + Config->Entry);
   if (errorCount())
     return;
 
Index: test/wasm/undefined-entry.test
===================================================================
--- test/wasm/undefined-entry.test
+++ test/wasm/undefined-entry.test
@@ -2,3 +2,9 @@
 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42322.130703.patch
Type: text/x-patch
Size: 889 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180119/64232221/attachment.bin>


More information about the llvm-commits mailing list