+ wasm internal obj reader: add globals to a '.wasm_globals' object section

This commit is contained in:
Nikolay Nikolov 2024-01-01 18:03:02 +02:00
parent 2eae62a6e8
commit ef796906e9
2 changed files with 3 additions and 3 deletions

View File

@ -3851,6 +3851,7 @@ implementation
CurrSec.Size:=Len;
end;
ReadSectionContent(ObjData);
ObjData.createsection('.wasm_globals',1,[]);
for i:=low(SymbolTable) to high(SymbolTable) do
with SymbolTable[i] do
@ -3966,9 +3967,7 @@ implementation
objsym:=TWasmObjSymbol(ObjData.CreateSymbol(SymName));
objsym.bind:=AB_GLOBAL;
objsym.typ:=AT_WASM_GLOBAL;
objsym.objsection:=nil;
//if (SymFlags and WASM_SYM_EXPLICIT_NAME)=0 then
// TWasmObjSection(ObjData.ObjSectionList[SymIndex-FuncTypeImportsCount]).MainFuncSymbol:=objsym;
objsym.objsection:=ObjData.findsection('.wasm_globals');
objsym.offset:=0;
objsym.size:=0;
end;

View File

@ -299,6 +299,7 @@ begin
LinkScript.Concat('EXESECTION .wasm_globals');
LinkScript.Concat(' SYMBOL __stack_pointer');
LinkScript.Concat(' OBJSECTION .wasm_globals');
LinkScript.Concat('ENDEXESECTION');
LinkScript.Concat('EXESECTION .text');