mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 11:24:14 +02:00
+ .fini section support
git-svn-id: trunk@8174 -
This commit is contained in:
parent
f88fca7d83
commit
4151029ee5
@ -87,7 +87,8 @@ interface
|
||||
sec_fpc,
|
||||
{ Table of contents section }
|
||||
sec_toc,
|
||||
sec_init
|
||||
sec_init,
|
||||
sec_fini
|
||||
);
|
||||
|
||||
TAsmSectionOrder = (secorder_begin,secorder_default,secorder_end);
|
||||
|
@ -265,7 +265,8 @@ implementation
|
||||
'.debug_frame','.debug_info','.debug_line','.debug_abbrev',
|
||||
'.fpc',
|
||||
'.toc',
|
||||
'.init'
|
||||
'.init',
|
||||
'.fini'
|
||||
);
|
||||
secnames_pic : array[TAsmSectiontype] of string[17] = ('',
|
||||
'.text',
|
||||
@ -282,7 +283,8 @@ implementation
|
||||
'.debug_frame','.debug_info','.debug_line','.debug_abbrev',
|
||||
'.fpc',
|
||||
'.toc',
|
||||
'.init'
|
||||
'.init',
|
||||
'.fini'
|
||||
);
|
||||
var
|
||||
sep : string[3];
|
||||
@ -1161,7 +1163,8 @@ implementation
|
||||
sec_code (* sec_fpc *),
|
||||
{ Table of contents section }
|
||||
sec_code (* sec_toc *),
|
||||
sec_code (* sec_init *)
|
||||
sec_code (* sec_init *),
|
||||
sec_code (* sec_fini *)
|
||||
);
|
||||
begin
|
||||
Result := inherited SectionName (SecXTable [AType], AName, AOrder);
|
||||
|
@ -470,7 +470,8 @@ interface
|
||||
'.debug_frame','.debug_info','.debug_line','.debug_abbrev',
|
||||
'.fpc',
|
||||
'',
|
||||
'.init'
|
||||
'.init',
|
||||
'.fini'
|
||||
);
|
||||
begin
|
||||
AsmLn;
|
||||
|
@ -810,7 +810,8 @@ implementation
|
||||
'debug_frame','debug_info','debug_line','debug_abbrev',
|
||||
'fpc',
|
||||
'toc',
|
||||
'init'
|
||||
'init',
|
||||
'fini'
|
||||
);
|
||||
var
|
||||
sep : string[3];
|
||||
@ -858,7 +859,8 @@ implementation
|
||||
{debug_abbrev} [oso_Data,oso_noload,oso_debug],
|
||||
{fpc} [oso_Data,oso_load,oso_write,oso_keep],
|
||||
{toc} [oso_Data,oso_load,oso_readonly],
|
||||
{init} [oso_Data,oso_load,oso_readonly,oso_executable,oso_keep]
|
||||
{init} [oso_Data,oso_load,oso_readonly,oso_executable,oso_keep],
|
||||
{fini} [oso_Data,oso_load,oso_readonly,oso_executable,oso_keep]
|
||||
);
|
||||
begin
|
||||
result:=secoptions[atype];
|
||||
@ -1637,8 +1639,8 @@ implementation
|
||||
procedure TExeOutput.Order_ObjSectionList(ObjSectionList : TFPObjectList);
|
||||
begin
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
procedure TExeOutput.Order_Symbol(const aname:string);
|
||||
var
|
||||
ObjSection : TObjSection;
|
||||
|
@ -486,7 +486,8 @@ implementation
|
||||
'.debug_frame','.debug_info','.debug_line','.debug_abbrev',
|
||||
'.fpc',
|
||||
'',
|
||||
'.init'
|
||||
'.init',
|
||||
'.fini'
|
||||
);
|
||||
|
||||
const go32v2stub : array[0..2047] of byte=(
|
||||
|
@ -583,7 +583,8 @@ implementation
|
||||
'.debug_frame','.debug_info','.debug_line','.debug_abbrev',
|
||||
'.fpc',
|
||||
'.toc',
|
||||
'.init'
|
||||
'.init',
|
||||
'.fini'
|
||||
);
|
||||
secnames_pic : array[TAsmSectiontype] of string[17] = ('',
|
||||
'.text',
|
||||
@ -600,7 +601,8 @@ implementation
|
||||
'.debug_frame','.debug_info','.debug_line','.debug_abbrev',
|
||||
'.fpc',
|
||||
'.toc',
|
||||
'.init'
|
||||
'.init',
|
||||
'.fini'
|
||||
);
|
||||
var
|
||||
sep : string[3];
|
||||
|
@ -774,6 +774,7 @@ implementation
|
||||
begin
|
||||
result:=create_main_proc(make_mangledname('',current_module.localsymtable,'finalize_implicit'),potype_unitfinalize,st);
|
||||
result.procdef.aliasnames.insert(make_mangledname('FINALIZE$',current_module.localsymtable,''));
|
||||
result.procdef.aliasnames.insert('PASCALFINALIZE');
|
||||
end;
|
||||
else
|
||||
internalerror(200304253);
|
||||
@ -1354,6 +1355,7 @@ implementation
|
||||
{ Parse the finalize }
|
||||
finalize_procinfo:=create_main_proc(make_mangledname('',current_module.localsymtable,'finalize'),potype_unitfinalize,current_module.localsymtable);
|
||||
finalize_procinfo.procdef.aliasnames.insert(make_mangledname('FINALIZE$',current_module.localsymtable,''));
|
||||
finalize_procinfo.procdef.aliasnames.insert('PASCALFINALIZE');
|
||||
finalize_procinfo.parse_body;
|
||||
end
|
||||
else
|
||||
|
@ -74,7 +74,7 @@ interface
|
||||
'csect', {read only data}
|
||||
'csect', {bss} 'csect', '',
|
||||
'csect','csect','csect','csect',
|
||||
'','','','','','','','','','','','',''
|
||||
'','','','','','','','','','','','','',''
|
||||
);
|
||||
|
||||
type
|
||||
|
@ -52,7 +52,7 @@ unit raatt;
|
||||
AS_DB,AS_DW,AS_DD,AS_DQ,AS_GLOBAL,
|
||||
AS_ALIGN,AS_BALIGN,AS_P2ALIGN,AS_ASCII,
|
||||
AS_ASCIIZ,AS_LCOMM,AS_COMM,AS_SINGLE,AS_DOUBLE,AS_EXTENDED,
|
||||
AS_DATA,AS_TEXT,AS_INIT,AS_END,
|
||||
AS_DATA,AS_TEXT,AS_INIT,AS_FINI,AS_END,
|
||||
{------------------ Assembler Operators --------------------}
|
||||
AS_TYPE,AS_SIZEOF,AS_VMTOFFSET,AS_MOD,AS_SHL,AS_SHR,AS_NOT,AS_AND,AS_OR,AS_XOR,AS_NOR,AS_AT,
|
||||
AS_LO,AS_HI);
|
||||
@ -74,7 +74,7 @@ unit raatt;
|
||||
'.byte','.word','.long','.quad','.globl',
|
||||
'.align','.balign','.p2align','.ascii',
|
||||
'.asciz','.lcomm','.comm','.single','.double','.tfloat',
|
||||
'.data','.text','.init','END',
|
||||
'.data','.text','.init','.fini','END',
|
||||
'TYPE','SIZEOF','VMTOFFSET','%','<<','>>','!','&','|','^','~','@','lo','hi');
|
||||
|
||||
type
|
||||
@ -987,6 +987,13 @@ unit raatt;
|
||||
Consume(AS_INIT);
|
||||
end;
|
||||
|
||||
AS_FINI:
|
||||
Begin
|
||||
new_section(curList,sec_fini,lower(current_procinfo.procdef.mangledname),0);
|
||||
lasTSec:=sec_fini;
|
||||
Consume(AS_FINI);
|
||||
end;
|
||||
|
||||
AS_DB:
|
||||
Begin
|
||||
Consume(AS_DB);
|
||||
|
@ -67,6 +67,7 @@ implementation
|
||||
'','','','',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
@ -78,6 +79,7 @@ implementation
|
||||
'','','','',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user