* wasm internal linker: skip the element section when reading object files. This fixes linking with object modules, produced by the external assembler.

This commit is contained in:
Nikolay Nikolov 2024-01-07 00:11:59 +02:00
parent 6a9376cb9e
commit 7f3ed9e85c

View File

@ -2366,6 +2366,7 @@ implementation
FunctionSectionRead: Boolean = false;
GlobalSectionRead: Boolean = false;
ExportSectionRead: Boolean = false;
ElementSectionRead: Boolean = false;
CodeSectionRead: Boolean = false;
DataSectionRead: Boolean = false;
DataCountSectionRead: Boolean = false;
@ -3646,6 +3647,20 @@ implementation
Result:=True;
end;
function ReadElementSection: Boolean;
begin
Result:=False;
if ElementSectionRead then
begin
InputError('Element section is duplicated');
exit;
end;
ElementSectionRead:=True;
{ We skip the element section for now }
{ TODO: implement reading it (and linking of tables) }
Result:=True;
end;
function ReadCodeSection: Boolean;
var
CodeEntriesCount: uint32;
@ -3910,6 +3925,12 @@ implementation
InputError('Error reading the export section');
exit;
end;
Byte(wsiElement):
if not ReadElementSection then
begin
InputError('Error reading the element section');
exit;
end;
Byte(wsiCode):
if not ReadCodeSection then
begin