mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 04:29:29 +02:00
* ensure that the indirect symbols for VMT, RTTI and IID reside in the same sections as the symbols they point to -> reduces the amount of sections for them by half
git-svn-id: trunk@35367 -
This commit is contained in:
parent
c1db48c8c6
commit
f517311227
@ -1554,7 +1554,7 @@ implementation
|
||||
end;
|
||||
{ write rtti data; make sure that the alignment matches the corresponding data structure
|
||||
in the code that uses it (if alignment is required). }
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable]);
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable,tcalo_data_force_indirect]);
|
||||
{ use TConstPtrUInt packrecords to ensure good alignment }
|
||||
tcb.begin_anonymous_record('',defaultpacking,reqalign,
|
||||
targetinfos[target_info.system]^.alignment.recordalignmin,
|
||||
@ -1609,7 +1609,7 @@ implementation
|
||||
tcb.end_anonymous_record;
|
||||
|
||||
tabledef:=tcb.end_anonymous_record;
|
||||
rttilab:=current_asmdata.DefineAsmSymbol(Tstoreddef(def).rtti_mangledname(rt)+'_o2s',AB_GLOBAL,AT_DATA_FORCEINDIRECT,tabledef);
|
||||
rttilab:=current_asmdata.DefineAsmSymbol(Tstoreddef(def).rtti_mangledname(rt)+'_o2s',AB_GLOBAL,AT_DATA_NOINDIRECT,tabledef);
|
||||
current_asmdata.asmlists[al_rtti].concatlist(tcb.get_final_asmlist(
|
||||
rttilab,tabledef,sec_rodata,
|
||||
rttilab.name,sizeof(pint)));
|
||||
@ -1631,7 +1631,7 @@ implementation
|
||||
tabledef: tdef;
|
||||
begin
|
||||
{ write rtti data }
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable]);
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable,tcalo_data_force_indirect]);
|
||||
{ begin of Tstring_to_ord }
|
||||
tcb.begin_anonymous_record('',defaultpacking,min(reqalign,sizeof(pointer)),
|
||||
targetinfos[target_info.system]^.alignment.recordalignmin,
|
||||
@ -1656,7 +1656,7 @@ implementation
|
||||
end;
|
||||
tcb.end_anonymous_record;
|
||||
tabledef:=tcb.end_anonymous_record;
|
||||
rttilab:=current_asmdata.DefineAsmSymbol(Tstoreddef(def).rtti_mangledname(rt)+'_s2o',AB_GLOBAL,AT_DATA_FORCEINDIRECT,tabledef);
|
||||
rttilab:=current_asmdata.DefineAsmSymbol(Tstoreddef(def).rtti_mangledname(rt)+'_s2o',AB_GLOBAL,AT_DATA_NOINDIRECT,tabledef);
|
||||
current_asmdata.asmlists[al_rtti].concatlist(tcb.get_final_asmlist(
|
||||
rttilab,tabledef,sec_rodata,
|
||||
rttilab.name,sizeof(pint)));
|
||||
@ -1802,7 +1802,7 @@ implementation
|
||||
{ write first all dependencies }
|
||||
write_child_rtti_data(def,rt);
|
||||
{ write rtti data }
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable]);
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable,tcalo_data_force_indirect]);
|
||||
tcb.begin_anonymous_record(
|
||||
internaltypeprefixName[itp_rttidef]+tstoreddef(def).rtti_mangledname(rt),
|
||||
defaultpacking,reqalign,
|
||||
@ -1811,7 +1811,7 @@ implementation
|
||||
);
|
||||
write_rtti_data(tcb,def,rt);
|
||||
rttidef:=tcb.end_anonymous_record;
|
||||
rttilab:=current_asmdata.DefineAsmSymbol(tstoreddef(def).rtti_mangledname(rt),AB_GLOBAL,AT_DATA_FORCEINDIRECT,rttidef);
|
||||
rttilab:=current_asmdata.DefineAsmSymbol(tstoreddef(def).rtti_mangledname(rt),AB_GLOBAL,AT_DATA_NOINDIRECT,rttidef);
|
||||
current_asmdata.AsmLists[al_rtti].concatList(
|
||||
tcb.get_final_asmlist(rttilab,rttidef,sec_rodata,rttilab.name,min(target_info.alignment.maxCrecordalign,SizeOf(QWord))));
|
||||
tcb.free;
|
||||
|
@ -931,9 +931,9 @@ implementation
|
||||
if assigned(_class.iidguid) then
|
||||
begin
|
||||
s:=make_mangledname('IID',_class.owner,_class.objname^);
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable]);
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable,tcalo_data_force_indirect]);
|
||||
tcb.emit_guid_const(_class.iidguid^);
|
||||
sym:=current_asmdata.DefineAsmSymbol(s,AB_GLOBAL,AT_DATA_FORCEINDIRECT,rec_tguid);
|
||||
sym:=current_asmdata.DefineAsmSymbol(s,AB_GLOBAL,AT_DATA_NOINDIRECT,rec_tguid);
|
||||
list.concatlist(tcb.get_final_asmlist(
|
||||
sym,
|
||||
rec_tguid,
|
||||
@ -944,9 +944,9 @@ implementation
|
||||
current_module.add_public_asmsym(sym);
|
||||
end;
|
||||
s:=make_mangledname('IIDSTR',_class.owner,_class.objname^);
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable]);
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable,tcalo_data_force_indirect]);
|
||||
def:=tcb.emit_shortstring_const(_class.iidstr^);
|
||||
sym:=current_asmdata.DefineAsmSymbol(s,AB_GLOBAL,AT_DATA_FORCEINDIRECT,def);
|
||||
sym:=current_asmdata.DefineAsmSymbol(s,AB_GLOBAL,AT_DATA_NOINDIRECT,def);
|
||||
list.concatlist(tcb.get_final_asmlist(
|
||||
sym,
|
||||
def,
|
||||
@ -1106,7 +1106,7 @@ implementation
|
||||
intmessagetabledef:=nil;
|
||||
|
||||
{ generate VMT }
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable]);
|
||||
tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable,tcalo_data_force_indirect]);
|
||||
|
||||
{ write tables for classes, this must be done before the actual
|
||||
class is written, because we need the labels defined }
|
||||
@ -1240,7 +1240,7 @@ implementation
|
||||
|
||||
tcb.maybe_end_aggregate(vmtdef);
|
||||
|
||||
sym:=current_asmdata.DefineAsmSymbol(_class.vmt_mangledname,AB_GLOBAL,AT_DATA_FORCEINDIRECT,vmtdef);
|
||||
sym:=current_asmdata.DefineAsmSymbol(_class.vmt_mangledname,AB_GLOBAL,AT_DATA_NOINDIRECT,vmtdef);
|
||||
current_module.add_public_asmsym(sym);
|
||||
|
||||
{ concatenate the VMT to the asmlist }
|
||||
|
Loading…
Reference in New Issue
Block a user