Browse Source

* WebAssembly threads internal linker: declare the __tls_base, __tls_size and
__tls_align symbols in the internal linker script if threads are enabled

Nikolay Nikolov 1 year ago
parent
commit
a87481cfa4
1 changed files with 6 additions and 0 deletions
  1. 6 0
      compiler/systems/t_wasi.pas

+ 6 - 0
compiler/systems/t_wasi.pas

@@ -332,6 +332,12 @@ begin
 
 
   LinkScript.Concat('EXESECTION .wasm_globals');
   LinkScript.Concat('EXESECTION .wasm_globals');
   LinkScript.Concat('  SYMBOL __stack_pointer');
   LinkScript.Concat('  SYMBOL __stack_pointer');
+  if ts_wasm_threads in current_settings.targetswitches then
+    begin
+      LinkScript.Concat('  SYMBOL __tls_base');
+      LinkScript.Concat('  SYMBOL __tls_size');
+      LinkScript.Concat('  SYMBOL __tls_align');
+    end;
   LinkScript.Concat('  OBJSECTION .wasm_globals.*');
   LinkScript.Concat('  OBJSECTION .wasm_globals.*');
   LinkScript.Concat('ENDEXESECTION');
   LinkScript.Concat('ENDEXESECTION');