mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 04:49:21 +02:00
* WebAssembly threads internal linker: fix validation of R_WASM_GLOBAL_INDEX_LEB relocations in modules that support threads
This commit is contained in:
parent
610f2bb3c9
commit
961042356c
@ -2700,9 +2700,16 @@ implementation
|
||||
InputError('R_WASM_SECTION_OFFSET_I32 must point to a SYMTAB_SECTION symbol');
|
||||
exit;
|
||||
end;
|
||||
if (RelocType=R_WASM_GLOBAL_INDEX_LEB) and (SymbolTable[RelocIndex].SymKind<>SYMTAB_GLOBAL) then
|
||||
if (RelocType=R_WASM_GLOBAL_INDEX_LEB) and
|
||||
not ((SymbolTable[RelocIndex].SymKind=SYMTAB_GLOBAL) or
|
||||
((ts_wasm_threads in current_settings.targetswitches) and
|
||||
(SymbolTable[RelocIndex].SymKind=SYMTAB_DATA) and
|
||||
((SymbolTable[RelocIndex].SymFlags and WASM_SYM_TLS)<>0))) then
|
||||
begin
|
||||
InputError('Relocation must point to a SYMTAB_GLOBAL symbol');
|
||||
if ts_wasm_threads in current_settings.targetswitches then
|
||||
InputError('Relocation must point to a SYMTAB_GLOBAL symbol or a SYMTAB_DATA symbol with the WASM_SYM_TLS flag set')
|
||||
else
|
||||
InputError('Relocation must point to a SYMTAB_GLOBAL symbol');
|
||||
exit;
|
||||
end;
|
||||
if (RelocType=R_WASM_TAG_INDEX_LEB) and (SymbolTable[RelocIndex].SymKind<>SYMTAB_EVENT) then
|
||||
|
Loading…
Reference in New Issue
Block a user