[WebAssembly] Remove special handling of entry point export.
Its much easier to export it via setHidden(false), now that
that is a thing.
As a side effect the start function is not longer always exports first
(becuase its being exported just like all the other function).
Differential Revision: https://reviews.llvm.org/D42321
llvm-svn: 323025
diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
index 010e4f3..d780491 100644
--- a/lld/wasm/Driver.cpp
+++ b/lld/wasm/Driver.cpp
@@ -282,10 +282,11 @@
if (Config->Relocatable && Args.hasArg(OPT_undefined))
error("undefined symbols specified for relocatable output file");
+ Symbol *EntrySym = nullptr;
if (!Config->Relocatable) {
static WasmSignature Signature = {{}, WASM_TYPE_NORESULT};
if (!Config->Entry.empty())
- Symtab->addUndefinedFunction(Config->Entry, &Signature);
+ EntrySym = Symtab->addUndefinedFunction(Config->Entry, &Signature);
// Handle the `--undefined <sym>` options.
for (auto* Arg : Args.filtered(OPT_undefined))
@@ -341,6 +342,9 @@
Sym->setHidden(false);
}
+ if (EntrySym)
+ EntrySym->setHidden(false);
+
if (errorCount())
return;