* set the size of AT_WASM_GLOBAL symbols to 1

This commit is contained in:
Nikolay Nikolov 2024-01-01 18:10:20 +02:00
parent ef796906e9
commit cd93050d7e

View File

@ -3940,7 +3940,7 @@ implementation
objsym.typ:=AT_WASM_GLOBAL; objsym.typ:=AT_WASM_GLOBAL;
objsym.objsection:=nil; objsym.objsection:=nil;
objsym.offset:=0; objsym.offset:=0;
objsym.size:=0; objsym.size:=1;
objsym.LinkingData.ImportModule:=GlobalTypes[SymIndex].ImportModName; objsym.LinkingData.ImportModule:=GlobalTypes[SymIndex].ImportModName;
objsym.LinkingData.ImportName:=GlobalTypes[SymIndex].ImportName; objsym.LinkingData.ImportName:=GlobalTypes[SymIndex].ImportName;
end end
@ -3954,7 +3954,7 @@ implementation
objsym.typ:=AT_WASM_GLOBAL; objsym.typ:=AT_WASM_GLOBAL;
objsym.objsection:=nil; objsym.objsection:=nil;
objsym.offset:=0; objsym.offset:=0;
objsym.size:=0; objsym.size:=1;
end; end;
end end
else else
@ -3969,7 +3969,7 @@ implementation
objsym.typ:=AT_WASM_GLOBAL; objsym.typ:=AT_WASM_GLOBAL;
objsym.objsection:=ObjData.findsection('.wasm_globals'); objsym.objsection:=ObjData.findsection('.wasm_globals');
objsym.offset:=0; objsym.offset:=0;
objsym.size:=0; objsym.size:=1;
end; end;
end; end;
byte(SYMTAB_SECTION), byte(SYMTAB_SECTION),
@ -4487,11 +4487,14 @@ implementation
procedure TWasmExeOutput.Load_Symbol(const aname: string); procedure TWasmExeOutput.Load_Symbol(const aname: string);
const const
StackPointerSymStr='__stack_pointer'; StackPointerSymStr='__stack_pointer';
var
objsym: TObjSymbol;
begin begin
if aname=StackPointerSymStr then if aname=StackPointerSymStr then
begin begin
internalObjData.createsection('*'+aname,0,[]); internalObjData.createsection('*'+aname,0,[]);
internalObjData.SymbolDefine(aname,AB_GLOBAL,AT_WASM_GLOBAL); objsym:=internalObjData.SymbolDefine(aname,AB_GLOBAL,AT_WASM_GLOBAL);
objsym.size:=1;
end end
else else
inherited; inherited;