|
@@ -295,6 +295,8 @@ type
|
|
|
{ get a label in the middle of an internal data section (no dead
|
|
|
stripping) }
|
|
|
function get_internal_data_section_internal_label: tasmlabel; virtual;
|
|
|
+ { adds a new entry to current_module.linkorderedsymbols }
|
|
|
+ procedure add_link_ordered_symbol(sym: tasmsymbol; const secname: TSymStr); virtual;
|
|
|
|
|
|
{ easy access to the top level aggregate information instance }
|
|
|
property curagginfo: taggregateinformation read getcurragginfo;
|
|
@@ -336,11 +338,13 @@ type
|
|
|
procedure insert_marked_aggregate_alignment(def: tdef); virtual; abstract;
|
|
|
class function get_vectorized_dead_strip_section_symbol(const basename: string; st: tsymtable; options: ttcdeadstripsectionsymboloptions; start: boolean): tasmsymbol; virtual;
|
|
|
public
|
|
|
- class function get_vectorized_dead_strip_custom_section_name(const basename: TSymStr; st: tsymtable; out secname: TSymStr): boolean; virtual;
|
|
|
+ class function get_vectorized_dead_strip_custom_section_name(const basename: TSymStr; st: tsymtable; options: ttcasmlistoptions; out secname: TSymStr): boolean; virtual;
|
|
|
{ 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_start(const basename: string; st: tsymtable; options: ttcdeadstripsectionsymboloptions): tasmsymbol; virtual;
|
|
|
class function get_vectorized_dead_strip_section_symbol_end(const basename: string; st: tsymtable; options: ttcdeadstripsectionsymboloptions): tasmsymbol; virtual;
|
|
|
+ { returns true if smartlinking of the dead stripable vectorized lists is supported }
|
|
|
+ class function is_smartlink_vectorized_dead_strip: boolean; virtual;
|
|
|
|
|
|
class function get_dynstring_rec_name(typ: tstringtype; winlike: boolean; len: asizeint): TSymStr;
|
|
|
class function get_dynstring_rec(typ: tstringtype; winlike: boolean; len: asizeint): trecorddef;
|
|
@@ -918,6 +922,12 @@ implementation
|
|
|
end;
|
|
|
|
|
|
|
|
|
+ procedure ttai_typedconstbuilder.add_link_ordered_symbol(sym: tasmsymbol; const secname: TSymStr);
|
|
|
+ begin
|
|
|
+ current_module.linkorderedsymbols.concat(sym.Name);
|
|
|
+ end;
|
|
|
+
|
|
|
+
|
|
|
function ttai_typedconstbuilder.aggregate_kind(def: tdef): ttypedconstkind;
|
|
|
begin
|
|
|
if (def.typ in [recorddef,filedef,variantdef]) or
|
|
@@ -977,14 +987,7 @@ implementation
|
|
|
new_section(prelist,section,secname,alignment);
|
|
|
end
|
|
|
else if tcalo_new_section in options then
|
|
|
- begin
|
|
|
- { insert ait_cutobject for smart-linking on targets
|
|
|
- that do not support smarlinking based on sections,
|
|
|
- like msdos }
|
|
|
- if not (tf_smartlink_sections in target_info.flags) then
|
|
|
- maybe_new_object_file(prelist);
|
|
|
- new_section(prelist,section,secname,alignment);
|
|
|
- end
|
|
|
+ new_section(prelist,section,secname,alignment)
|
|
|
else
|
|
|
prelist.concat(cai_align.Create(alignment));
|
|
|
|
|
@@ -1069,7 +1072,7 @@ implementation
|
|
|
begin
|
|
|
fvectorized_finalize_called:=true;
|
|
|
sym:=nil;
|
|
|
- customsecname:=get_vectorized_dead_strip_custom_section_name(basename,st,secname);
|
|
|
+ customsecname:=get_vectorized_dead_strip_custom_section_name(basename,st,options,secname);
|
|
|
if customsecname then
|
|
|
sectype:=sec_user
|
|
|
else
|
|
@@ -1110,7 +1113,17 @@ implementation
|
|
|
secname:=make_mangledname(basename,st,'2_'+itemname);
|
|
|
exclude(options,tcalo_vectorized_dead_strip_item);
|
|
|
end;
|
|
|
- current_module.linkorderedsymbols.concat(sym.Name);
|
|
|
+ add_link_ordered_symbol(sym,secname);
|
|
|
+ if is_smartlink_vectorized_dead_strip then
|
|
|
+ options:=options+[tcalo_new_section,tcalo_make_dead_strippable]
|
|
|
+ else
|
|
|
+ begin
|
|
|
+ { if smartlinking of vectorized lists is not supported,
|
|
|
+ put the whole list into a single section. }
|
|
|
+ options:=options-[tcalo_new_section,tcalo_make_dead_strippable];
|
|
|
+ if tcalo_vectorized_dead_strip_start in options then
|
|
|
+ include(options,tcalo_new_section);
|
|
|
+ end;
|
|
|
finalize_asmlist(sym,def,sectype,secname,alignment,options);
|
|
|
end;
|
|
|
|
|
@@ -1547,7 +1560,7 @@ implementation
|
|
|
end;
|
|
|
|
|
|
|
|
|
- class function ttai_typedconstbuilder.get_vectorized_dead_strip_custom_section_name(const basename: TSymStr; st: tsymtable; out secname: TSymStr): boolean;
|
|
|
+ class function ttai_typedconstbuilder.get_vectorized_dead_strip_custom_section_name(const basename: TSymStr; st: tsymtable; options: ttcasmlistoptions; out secname: TSymStr): boolean;
|
|
|
begin
|
|
|
result:=false;
|
|
|
end;
|
|
@@ -1565,6 +1578,12 @@ implementation
|
|
|
end;
|
|
|
|
|
|
|
|
|
+ class function ttai_typedconstbuilder.is_smartlink_vectorized_dead_strip: boolean;
|
|
|
+ begin
|
|
|
+ result:=tf_smartlink_sections in target_info.flags;
|
|
|
+ end;
|
|
|
+
|
|
|
+
|
|
|
class function ttai_typedconstbuilder.get_dynstring_rec_name(typ: tstringtype; winlike: boolean; len: asizeint): TSymStr;
|
|
|
begin
|
|
|
case typ of
|