[PATCH] D40559: Run Wasm entrypoint on load

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 22:45:41 PST 2017


sbc100 added a comment.

OK, it sounds like have the entry section call the entry point by default seems to be the consensus.  We will likely need to modify musl wasm.js to handle that before this change lands.  And I imagine emscripten will want to pass --entry to override this behaviour (but its already going to be passing a lot of cusom flags).

Can you add test (or tests)?



================
Comment at: wasm/Driver.cpp:328
+    if (!Config->Entry.empty())
+      addSyntheticUndefinedFunction(Config->Entry);
 
----------------
Don't we always want some kind of entry point for non-relocatable binaries.  Without it it will be hard to gc unused functions.   (I suppose we could use the '-u' flag to pin the function we want kept instead?)


================
Comment at: wasm/Driver.cpp:352
+    if (!Sym)
+      fatal("entry point not found: " + Config->Entry);
     if (!Sym->isFunction())
----------------
We probably don't need these two checks here and in Writer.cpp.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40559





More information about the llvm-commits mailing list