[PATCH] D40559: Wasm entrypoint changes #2 (export entrypoint in "start" section) APPLY AFTER D40724

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 13:39:42 PST 2017


ncw added a comment.

In https://reviews.llvm.org/D40559#947100, @sbc100 wrote:

> I'd rather not change the behaviour of --entry since its a flag that is in common usage.    I'd also rather not default --no-entry since that means that by default nothing will get pulled into the link (i.e. all users will need explicit --entry and/or --undefined otherwise nothing will be linked).
>
> I don't mind adding code to support writing the start section, but since it is (currently) of very limited use I think we should not enable it by default.   How about putting it behing a new flag (i.e. --start=foo).    Even that much I think is a little controversial since we don't know if there will be any users of this flag.
>
> Sorry to be negative about this change.  I do think in the future we may have more use (or even default use) of the start section, but thats later down the road.


That's OK, if it's not useful it's OK to drop it. I think my requests https://reviews.llvm.org/D40724 and https://reviews.llvm.org/D40725 should be OK without this one, if that's preferred.

I'm personally not //too// concerned by compatibility, since I don't think anyone is using the new LLD toolchain in production yet!

What I was suggesting was defaulting to `--no-entry`, but at the same time making the Clang driver default to adding `--undefined=_start(_wasm)` to the link line (where it currently pulls in crt1.o). That's actually preserving the original behaviour, since the old `--entry` argument was the same as the new `--undefined`, namely it prods the linker to include the symbol but doesn't do anything special to call it.

Now that we have `--undefined`, it's odd to have `--entry` as basically a synonym for it, when we could make it actually set the Wasm entry point (not by default, but for people who want it, eg if using `--import-memory`).


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40559





More information about the llvm-commits mailing list