[WebAssembly] Implement NO_STRIP

This patch implements support for the NO_STRIP flag, which will allow
__attribute__((used)) to be implemented.

This accompanies https://reviews.llvm.org/D62542, which moves to setting the
NO_STRIP flag, and will continue to set EXPORTED for Emscripten targets for
compatibility.

Differential Revision: https://reviews.llvm.org/D66968

llvm-svn: 370416
diff --git a/lld/wasm/MarkLive.cpp b/lld/wasm/MarkLive.cpp
index 9399156..7656689 100644
--- a/lld/wasm/MarkLive.cpp
+++ b/lld/wasm/MarkLive.cpp
@@ -69,9 +69,9 @@
   if (!config->entry.empty())
     enqueue(symtab->find(config->entry));
 
-  // We need to preserve any exported symbol
+  // We need to preserve any no-strip or exported symbol
   for (Symbol *sym : symtab->getSymbols())
-    if (sym->isExported())
+    if (sym->isNoStrip() || sym->isExported())
       enqueue(sym);
 
   // For relocatable output, we need to preserve all the ctor functions