mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 19:41:18 +02:00
* 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:
parent
6a9376cb9e
commit
7f3ed9e85c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user