summaryrefslogtreecommitdiff
path: root/compiler/ngenutil.pas
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/ngenutil.pas')
-rw-r--r--compiler/ngenutil.pas22
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler/ngenutil.pas b/compiler/ngenutil.pas
index a3821f8da9..fe0837d574 100644
--- a/compiler/ngenutil.pas
+++ b/compiler/ngenutil.pas
@@ -146,6 +146,8 @@ interface
class procedure RegisterModuleInitFunction(pd: tprocdef); virtual;
class procedure RegisterModuleFiniFunction(pd: tprocdef); virtual;
+ class procedure GenerateObjCImageInfo; virtual;
+
strict protected
class procedure add_main_procdef_paras(pd: tdef); virtual;
end;
@@ -1580,6 +1582,26 @@ implementation
end;
+ class procedure tnodeutils.GenerateObjCImageInfo;
+ var
+ tcb: ttai_typedconstbuilder;
+ begin
+ { first 4 bytes contain version information about this section (currently version 0),
+ next 4 bytes contain flags (currently only regarding whether the code in the object
+ file supports or requires garbage collection)
+ }
+ tcb:=ctai_typedconstbuilder.create([tcalo_new_section,tcalo_no_dead_strip]);
+ tcb.emit_ord_const(0,u64inttype);
+ current_asmdata.asmlists[al_objc_data].concatList(
+ tcb.get_final_asmlist(
+ current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'_OBJC_IMAGE_INFO',AB_LOCAL,AT_DATA,u64inttype),
+ u64inttype,sec_objc_image_info,'_OBJC_IMAGE_INFO',sizeof(pint)
+ )
+ );
+ tcb.free;
+ end;
+
+
class procedure tnodeutils.add_main_procdef_paras(pd: tdef);
var
pvs: tparavarsym;