[WebAssembly] Define __heap_base global

This is an immutable exported global representing
the start of the heap area.  It is a page aligned.

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

llvm-svn: 322609
diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
index 05b0b75..23220e9 100644
--- a/lld/wasm/Driver.cpp
+++ b/lld/wasm/Driver.cpp
@@ -310,6 +310,7 @@
     Config->CtorSymbol = Symtab->addDefinedFunction(
         "__wasm_call_ctors", &Signature, WASM_SYMBOL_VISIBILITY_HIDDEN);
     Config->StackPointerSymbol = Symtab->addDefinedGlobal("__stack_pointer");
+    Config->HeapBaseSymbol = Symtab->addDefinedGlobal("__heap_base");
     Symtab->addDefinedGlobal("__dso_handle")->setVirtualAddress(0);
   }