mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 05:25:58 +02:00
* factored out the creation of start/end symbols of vectorized dead strippable
sections such as the resourcestring data git-svn-id: trunk@32391 -
This commit is contained in:
parent
d5428ee210
commit
964f8c9f9b
@ -29,7 +29,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
cclasses,globtype,constexp,
|
cclasses,globtype,constexp,
|
||||||
aasmbase,aasmdata,aasmtai,
|
aasmbase,aasmdata,aasmtai,
|
||||||
symconst,symtype,symdef,symsym;
|
symconst,symbase,symtype,symdef,symsym;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ typed const: integer/floating point/string/pointer/... const along with
|
{ typed const: integer/floating point/string/pointer/... const along with
|
||||||
@ -296,6 +296,10 @@ type
|
|||||||
procedure mark_anon_aggregate_alignment; virtual; abstract;
|
procedure mark_anon_aggregate_alignment; virtual; abstract;
|
||||||
procedure insert_marked_aggregate_alignment(def: tdef); virtual; abstract;
|
procedure insert_marked_aggregate_alignment(def: tdef); virtual; abstract;
|
||||||
public
|
public
|
||||||
|
{ get the start/end symbol for a dead stripable vectorized section, such
|
||||||
|
as the resourcestring data of a unit }
|
||||||
|
class function get_vectorized_dead_strip_section_symbol(const basename: string; st: tsymtable; start: boolean): tasmsymbol; virtual;
|
||||||
|
|
||||||
class function get_dynstring_rec_name(typ: tstringtype; winlike: boolean; len: asizeint): string;
|
class function get_dynstring_rec_name(typ: tstringtype; winlike: boolean; len: asizeint): string;
|
||||||
{ the datalist parameter specifies where the data for the string constant
|
{ the datalist parameter specifies where the data for the string constant
|
||||||
will be emitted (via an internal data builder) }
|
will be emitted (via an internal data builder) }
|
||||||
@ -443,7 +447,7 @@ implementation
|
|||||||
uses
|
uses
|
||||||
verbose,globals,systems,widestr,
|
verbose,globals,systems,widestr,
|
||||||
fmodule,
|
fmodule,
|
||||||
symbase,symtable,defutil;
|
symtable,defutil;
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
taggregateinformation
|
taggregateinformation
|
||||||
@ -1256,6 +1260,15 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
class function ttai_typedconstbuilder.get_vectorized_dead_strip_section_symbol(const basename: string; st: tsymtable; start: boolean): tasmsymbol;
|
||||||
|
begin
|
||||||
|
if start then
|
||||||
|
result:=current_asmdata.DefineAsmSymbol(make_mangledname(basename,st,'START'),AB_GLOBAL,AT_DATA)
|
||||||
|
else
|
||||||
|
result:=current_asmdata.DefineAsmSymbol(make_mangledname(basename,st,'END'),AB_GLOBAL,AT_DATA);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
class function ttai_typedconstbuilder.get_dynstring_rec_name(typ: tstringtype; winlike: boolean; len: asizeint): string;
|
class function ttai_typedconstbuilder.get_dynstring_rec_name(typ: tstringtype; winlike: boolean; len: asizeint): string;
|
||||||
begin
|
begin
|
||||||
case typ of
|
case typ of
|
||||||
|
@ -37,7 +37,7 @@ uses
|
|||||||
{$endif}
|
{$endif}
|
||||||
cclasses,widestr,
|
cclasses,widestr,
|
||||||
cutils,globtype,globals,systems,
|
cutils,globtype,globals,systems,
|
||||||
symbase,symconst,symtype,symdef,symsym,
|
symbase,symconst,symtype,symdef,symsym,symtable,
|
||||||
verbose,fmodule,ppu,
|
verbose,fmodule,ppu,
|
||||||
aasmbase,aasmtai,aasmdata,aasmcnst,
|
aasmbase,aasmtai,aasmdata,aasmcnst,
|
||||||
aasmcpu;
|
aasmcpu;
|
||||||
@ -147,9 +147,8 @@ uses
|
|||||||
|
|
||||||
maybe_new_object_file(current_asmdata.asmlists[al_resourcestrings]);
|
maybe_new_object_file(current_asmdata.asmlists[al_resourcestrings]);
|
||||||
new_section(current_asmdata.asmlists[al_resourcestrings],sec_data,make_mangledname('RESSTR',current_module.localsymtable,'1_START'),sizeof(pint));
|
new_section(current_asmdata.asmlists[al_resourcestrings],sec_data,make_mangledname('RESSTR',current_module.localsymtable,'1_START'),sizeof(pint));
|
||||||
current_asmdata.AsmLists[al_resourcestrings].concat(tai_symbol.createname_global(
|
current_asmdata.AsmLists[al_resourcestrings].concat(tai_symbol.Create_Global(
|
||||||
make_mangledname('RESSTR',current_module.localsymtable,'START'),AT_DATA,0));
|
ctai_typedconstbuilder.get_vectorized_dead_strip_section_symbol('RESSTR',current_module.localsymtable,true),0));
|
||||||
|
|
||||||
{ Write unitname entry }
|
{ Write unitname entry }
|
||||||
namelab:=tcb.emit_ansistring_const(current_asmdata.asmlists[al_const],@current_module.localsymtable.name^[1],length(current_module.localsymtable.name^),getansistringcodepage);
|
namelab:=tcb.emit_ansistring_const(current_asmdata.asmlists[al_const],@current_module.localsymtable.name^[1],length(current_module.localsymtable.name^),getansistringcodepage);
|
||||||
current_asmdata.asmlists[al_resourcestrings].concat(tai_const.Create_sym_offset(namelab.lab,namelab.ofs));
|
current_asmdata.asmlists[al_resourcestrings].concat(tai_const.Create_sym_offset(namelab.lab,namelab.ofs));
|
||||||
@ -202,7 +201,7 @@ uses
|
|||||||
{ nothing has been emited to the tcb itself }
|
{ nothing has been emited to the tcb itself }
|
||||||
tcb.free;
|
tcb.free;
|
||||||
new_section(current_asmdata.asmlists[al_resourcestrings],sec_data,make_mangledname('RESSTR',current_module.localsymtable,'3_END'),sizeof(pint));
|
new_section(current_asmdata.asmlists[al_resourcestrings],sec_data,make_mangledname('RESSTR',current_module.localsymtable,'3_END'),sizeof(pint));
|
||||||
endsymlab:=current_asmdata.DefineAsmSymbol(make_mangledname('RESSTR',current_module.localsymtable,'END'),AB_GLOBAL,AT_DATA);
|
endsymlab:=ctai_typedconstbuilder.get_vectorized_dead_strip_section_symbol('RESSTR',current_module.localsymtable,false);
|
||||||
current_asmdata.AsmLists[al_resourcestrings].concat(tai_symbol.create_global(endsymlab,0));
|
current_asmdata.AsmLists[al_resourcestrings].concat(tai_symbol.create_global(endsymlab,0));
|
||||||
{ The darwin/ppc64 assembler or linker seems to have trouble }
|
{ The darwin/ppc64 assembler or linker seems to have trouble }
|
||||||
{ if a section ends with a global label without any data after it. }
|
{ if a section ends with a global label without any data after it. }
|
||||||
|
@ -970,8 +970,12 @@ implementation
|
|||||||
begin
|
begin
|
||||||
If (hp.flags and uf_has_resourcestrings)=uf_has_resourcestrings then
|
If (hp.flags and uf_has_resourcestrings)=uf_has_resourcestrings then
|
||||||
begin
|
begin
|
||||||
ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESSTR',hp.localsymtable,'START'),AT_DATA,0));
|
ResourceStringTables.concat(Tai_const.Create_sym(
|
||||||
ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESSTR',hp.localsymtable,'END'),AT_DATA,0));
|
ctai_typedconstbuilder.get_vectorized_dead_strip_section_symbol('RESSTR',hp.localsymtable,true))
|
||||||
|
);
|
||||||
|
ResourceStringTables.concat(Tai_const.Create_sym(
|
||||||
|
ctai_typedconstbuilder.get_vectorized_dead_strip_section_symbol('RESSTR',hp.localsymtable,false))
|
||||||
|
);
|
||||||
inc(count);
|
inc(count);
|
||||||
end;
|
end;
|
||||||
hp:=tmodule(hp.next);
|
hp:=tmodule(hp.next);
|
||||||
|
Loading…
Reference in New Issue
Block a user