diff --git a/compiler/ogwasm.pas b/compiler/ogwasm.pas index d195cbb91b..2c4c2cb08c 100644 --- a/compiler/ogwasm.pas +++ b/compiler/ogwasm.pas @@ -4376,7 +4376,7 @@ implementation InputError('Code section ' + tostr(i) + ' does not have a main symbol defined in the symbol table'); exit; end; - if SegIsExported then + if SegIsExported or not (cs_link_smart in current_settings.globalswitches) then CurrSec:=ObjData.createsection(SegName,1,[oso_executable,oso_Data,oso_load,oso_keep],false) else CurrSec:=ObjData.createsection(SegName,1,[oso_executable,oso_Data,oso_load],false);