* WebAssembly threads internal linker: declare the symbol __wasm_init_tls in the

.text section (function will be generated later by the linker)
This commit is contained in:
Nikolay Nikolov 2024-08-10 19:59:06 +03:00
parent a87481cfa4
commit 0642f14552

View File

@ -345,11 +345,20 @@ begin
is important to keep the sections grouped, and keep the first section in
each group intact (otherwise, TWasmExeOutput.MemPos_ExeSection in ogwasm.pas
needs to be updated) }
{ tags (used by WebAssembly native exceptions) }
ScriptAddGenericSections('.wasm_tags');
{ code }
if ts_wasm_threads in current_settings.targetswitches then
begin
linkscript.Concat('EXESECTION .text');
linkscript.Concat(' OBJSECTION .text*');
{ functions, generated by the linker: }
linkscript.Concat(' SYMBOL __wasm_init_tls');
linkscript.Concat('ENDEXESECTION');
end
else
ScriptAddGenericSections('.text');
ScriptAddGenericSections(
{ tags (used by WebAssembly native exceptions) }
'.wasm_tags,'+
{ code }
'.text,'+
{ data (initialized data first, uninitialized data later) }
'.rodata,.data,fpc.resources,fpc.reshandles,.bss,'+
{ debug info }