diff --git a/compiler/ncal.pas b/compiler/ncal.pas index 44587f6e08..48d5eeb98b 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -698,6 +698,19 @@ implementation (left.nodetype<>nothingn) then handlemanagedbyrefpara(left.resultdef); + { does it need to load RTTI? } + if assigned(parasym) and (parasym.varspez=vs_out) and + (cs_create_pic in current_settings.moduleswitches) and + ( + is_rtti_managed_type(left.resultdef) or + ( + is_open_array(resultdef) and + is_managed_type(tarraydef(resultdef).elementdef) + ) + ) and + not(target_info.system in systems_garbage_collected_managed_types) then + include(current_procinfo.flags,pi_needs_got); + if assigned(fparainit) then firstpass(fparainit); firstpass(left); @@ -3568,6 +3581,11 @@ implementation ([cnf_member_call,cnf_inherited] * callnodeflags <> []) then current_procinfo.ConstructorCallingConstructor:=true; + { object check helper will load VMT -> needs GOT } + if (cs_check_object in current_settings.localswitches) and + (cs_create_pic in current_settings.moduleswitches) then + include(current_procinfo.flags,pi_needs_got); + { Continue with checking a normal call or generate the inlined code } if cnf_do_inline in callnodeflags then result:=pass1_inline