mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 17:49:13 +02:00
+ check for supported relocation types, report an error if an unsupported type is found
This commit is contained in:
parent
881ca2c52f
commit
a1bdf11d99
@ -2380,6 +2380,21 @@ implementation
|
|||||||
InputError('Error reading the relocation type of a relocation entry');
|
InputError('Error reading the relocation type of a relocation entry');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
if not (TWasmRelocationType(RelocType) in [R_WASM_FUNCTION_INDEX_LEB,
|
||||||
|
R_WASM_MEMORY_ADDR_LEB,
|
||||||
|
R_WASM_TABLE_INDEX_SLEB,
|
||||||
|
R_WASM_MEMORY_ADDR_SLEB,
|
||||||
|
R_WASM_SECTION_OFFSET_I32,
|
||||||
|
R_WASM_TABLE_INDEX_I32,
|
||||||
|
R_WASM_FUNCTION_OFFSET_I32,
|
||||||
|
R_WASM_MEMORY_ADDR_I32,
|
||||||
|
R_WASM_TYPE_INDEX_LEB,
|
||||||
|
R_WASM_GLOBAL_INDEX_LEB,
|
||||||
|
R_WASM_TAG_INDEX_LEB]) then
|
||||||
|
begin
|
||||||
|
InputError('Unsupported relocation type: ' + tostr(RelocType));
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
if not ReadUleb32(RelocOffset) then
|
if not ReadUleb32(RelocOffset) then
|
||||||
begin
|
begin
|
||||||
InputError('Error reading the relocation offset of a relocation entry');
|
InputError('Error reading the relocation offset of a relocation entry');
|
||||||
|
Loading…
Reference in New Issue
Block a user