* declare various symbols as external assembler symbols: RTTI references, parent VMT, FPC_EMPTYMETHOD (all three only if it's used from a different unit), threadvar lists and symbols declared as "external"

git-svn-id: trunk@34176 -
This commit is contained in:
svenbarth 2016-07-22 13:34:38 +00:00
parent bb72c1c4df
commit f69b365b77
4 changed files with 18 additions and 3 deletions

View File

@ -1527,6 +1527,8 @@ implementation
if (cs_create_pic in current_settings.moduleswitches) and
assigned(current_procinfo) then
include(current_procinfo.flags,pi_needs_got);
if def.owner.moduleid<>current_module.moduleid then
current_module.add_extern_asmsym(result);
end;

View File

@ -1011,7 +1011,11 @@ implementation
generate_abstract_stub(current_asmdata.AsmLists[al_procedures],vmtpd);
end
else if (cs_opt_remove_emtpy_proc in current_settings.optimizerswitches) and RedirectToEmpty(vmtpd) then
procname:='FPC_EMPTYMETHOD'
begin
procname:='FPC_EMPTYMETHOD';
if current_module.globalsymtable<>systemunit then
current_module.add_extern_asmsym(procname,AB_GLOBAL,AT_FUNCTION);
end
else if not wpoinfomanager.optimized_name_for_vmt(_class,vmtpd,procname) then
procname:=vmtpd.mangledname;
tcb.emit_tai(Tai_const.Createname(procname,AT_FUNCTION,0),cprocvardef.getreusableprocaddr(vmtpd));
@ -1129,9 +1133,12 @@ implementation
(oo_has_vmt in _class.childof.objectoptions) then
begin
tcb.queue_init(parentvmtdef);
sym:=current_asmdata.RefAsmSymbol(_class.childof.vmt_mangledname,AT_DATA,true);
tcb.queue_emit_asmsym(
current_asmdata.RefAsmSymbol(_class.childof.vmt_mangledname,AT_DATA,true),
sym,
tfieldvarsym(_class.childof.vmt_field).vardef);
if _class.childof.owner.moduleid<>current_module.moduleid then
current_module.add_extern_asmsym(sym);
end
else
tcb.emit_tai(Tai_const.Create_nil_dataptr,parentvmtdef);

View File

@ -1034,6 +1034,7 @@ implementation
tcb.emit_tai(
tai_const.Create_sym(sym),
voidpointertype);
current_module.add_extern_asmsym(sym);
inc(count);
end;
hp:=tused_unit(hp.next);

View File

@ -2238,6 +2238,8 @@ implementation
procedure import_external_proc(pd:tprocdef);
var
name : string;
begin
if not (po_external in pd.procoptions) then
internalerror(2015121101);
@ -2256,9 +2258,12 @@ implementation
end
else
begin
name:=proc_get_importname(pd);
{ add import name to external list for DLL scanning }
if tf_has_dllscanner in target_info.flags then
current_module.dllscannerinputlist.Add(proc_get_importname(pd),pd);
current_module.dllscannerinputlist.Add(name,pd);
{ needed for units that use functions in packages this way }
current_module.add_extern_asmsym(name,AB_EXTERNAL,AT_FUNCTION);
end;
end;