[PATCH] D40725: Wasm entrypoint changes #3 (add --no-entry argument to LLD) APPLY AFTER D40559

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 04:22:36 PST 2017


ncw marked 3 inline comments as done.
ncw added a comment.

Oops, OK, I've removed the use of `Optional<StringRef>` for `Config::Entry`.

The diff is shorter now, and should hopefully be good to go.



================
Comment at: test/wasm/data-layout.ll:3
 ; RUN: llc -filetype=obj %s -o %t.o
-; RUN: lld -flavor wasm --emit-relocs --allow-undefined --entry '' -o %t.wasm %t.o %t.hello.o
+; RUN: lld -flavor wasm --emit-relocs --allow-undefined --no-entry -o %t.wasm %t.o %t.hello.o
 ; RUN: obj2yaml %t.wasm | FileCheck %s
----------------
sbc100 wrote:
> Is the  --allow-undefined still needed? (I was thinking it might be there simply because this test doesn't have an entry point).
Good spot, but it actually still is needed. `Inputs/hello.ll` uses `puts` without defining it.


================
Comment at: wasm/Writer.cpp:264
   bool ExportHidden = Config->Relocatable;
-  Symbol *EntrySym = Symtab->find(Config->Entry);
+  Symbol *EntrySym = Config->Entry ? Symtab->find(Config->Entry.getValue())
+                                   : nullptr;
----------------
sbc100 wrote:
> I think you'll need to rebase this since the symbol is now stored in the Config itself.
I have rebased, but I don't think there are any relevant changes to Config? The stack-pointer has moved in there, but the entrypoint's Symbol isn't in Config.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40725





More information about the llvm-commits mailing list