mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 00:09:31 +02:00
+ allow referencing TLS_SIZE_SYM, TLS_ALIGN_SYM and TLS_BASE_SYM from WebAssembly inline asm
This commit is contained in:
parent
43229cdf2e
commit
ee3ff19312
@ -720,6 +720,7 @@ Unit rawasmtext;
|
||||
var
|
||||
srsym: tsym;
|
||||
srsymtable: TSymtable;
|
||||
globsym: TWasmGlobalAsmSymbol;
|
||||
begin
|
||||
result:=nil;
|
||||
case actasmtoken of
|
||||
@ -985,6 +986,21 @@ Unit rawasmtext;
|
||||
result.operands[1].opr.symbol:=thlcgwasm(hlcg).RefStackPointerSym;
|
||||
Consume(AS_ID);
|
||||
end;
|
||||
'$'+TLS_SIZE_SYM,
|
||||
'$'+TLS_ALIGN_SYM,
|
||||
'$'+TLS_BASE_SYM:
|
||||
begin
|
||||
globsym:=TWasmGlobalAsmSymbol(
|
||||
current_asmdata.RefAsmSymbolByClass(
|
||||
TWasmGlobalAsmSymbol,
|
||||
Copy(actasmpattern,2,Length(actasmpattern)-1),
|
||||
AT_WASM_GLOBAL));
|
||||
globsym.WasmGlobalType:=wbt_i32;
|
||||
result.ops:=1;
|
||||
result.operands[1].opr.typ:=OPR_SYMBOL;
|
||||
result.operands[1].opr.symbol:=globsym;
|
||||
Consume(AS_ID);
|
||||
end;
|
||||
else
|
||||
internalerror(2024072002);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user