[PATCH] D42024: [WebAssembly] Create synthetic __dso_handle symbol

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 17:11:50 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL322606: [WebAssembly] Create synthetic __dso_handle symbol (authored by sbc, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D42024?vs=129743&id=130072#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D42024

Files:
  lld/trunk/wasm/Driver.cpp


Index: lld/trunk/wasm/Driver.cpp
===================================================================
--- lld/trunk/wasm/Driver.cpp
+++ lld/trunk/wasm/Driver.cpp
@@ -299,9 +299,18 @@
     for (auto* Arg : Args.filtered(OPT_undefined))
       addSyntheticUndefinedFunction(Arg->getValue(), nullptr);
 
+    // Create linker-synthetic symbols
+    // __wasm_call_ctors:
+    //    Function that directly calls all ctors in priority order.
+    // __stack_pointer:
+    //    Wasm global that holds the address of the top of the explict
+    //    value stack in linear memory.
+    // __dso_handle;
+    //    Global in calls to __cxa_atexit to determine current DLL
     Config->CtorSymbol = Symtab->addDefinedFunction(
         "__wasm_call_ctors", &Signature, WASM_SYMBOL_VISIBILITY_HIDDEN);
     Config->StackPointerSymbol = Symtab->addDefinedGlobal("__stack_pointer");
+    Symtab->addDefinedGlobal("__dso_handle")->setVirtualAddress(0);
   }
 
   createFiles(Args);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42024.130072.patch
Type: text/x-patch
Size: 969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180117/65259695/attachment.bin>


More information about the llvm-commits mailing list