[lld] [lld][WebAssembly] Allow linker-synthetic symbols to be undefined when building shared libraries (PR #128223)

YAMAMOTO Takashi via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 9 18:04:10 PDT 2025


================
@@ -965,6 +965,8 @@ static void createSyntheticSymbols() {
   } else {
     // For non-PIC code
     WasmSym::stackPointer = createGlobalVariable("__stack_pointer", true);
+    WasmSym::definedMemoryBase = symtab->addOptionalDataSymbol("__memory_base");
+    WasmSym::definedTableBase = symtab->addOptionalDataSymbol("__table_base");
----------------
yamt wrote:

these calls seem too early in the link process.
the symbol table is almost empty here and they are effectively no-op i guess.
createSyntheticSymbols is called even before addFile.


https://github.com/llvm/llvm-project/pull/128223


More information about the llvm-commits mailing list