mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 06:50:15 +02:00
* it's rather useless that sectiontype2options is virtual as we can't use a class type, not to mention that the classes doing the overriding are for the internal assemblers/linkers, but we need it also for external
Thus we move the functionality of the overloads to the basemethod and remove the virtual directive; maybe we'll find a better solution in the future... git-svn-id: trunk@44926 -
This commit is contained in:
parent
0cc592e9ee
commit
61358b1eaa
@ -404,7 +404,7 @@ interface
|
|||||||
destructor destroy;override;
|
destructor destroy;override;
|
||||||
{ Sections }
|
{ Sections }
|
||||||
function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;virtual;abstract;
|
function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;virtual;abstract;
|
||||||
class function sectiontype2options(atype:TAsmSectiontype):TObjSectionOptions;virtual;
|
class function sectiontype2options(atype:TAsmSectiontype):TObjSectionOptions;
|
||||||
function sectiontype2align(atype:TAsmSectiontype):longint;virtual;
|
function sectiontype2align(atype:TAsmSectiontype):longint;virtual;
|
||||||
class procedure sectiontype2progbitsandflags(atype:TAsmSectiontype;out progbits:TSectionProgbits;out flags:TSectionFlags);virtual;
|
class procedure sectiontype2progbitsandflags(atype:TAsmSectiontype;out progbits:TSectionProgbits;out flags:TSectionFlags);virtual;
|
||||||
function createsection(atype:TAsmSectionType;const aname:string='';aorder:TAsmSectionOrder=secorder_default):TObjSection;virtual;
|
function createsection(atype:TAsmSectionType;const aname:string='';aorder:TAsmSectionOrder=secorder_default):TObjSection;virtual;
|
||||||
@ -743,7 +743,11 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils,
|
SysUtils,
|
||||||
globals,verbose,ogmap;
|
globals,verbose,
|
||||||
|
{$ifdef OMFOBJSUPPORT}
|
||||||
|
omfbase,
|
||||||
|
{$endif OMFOBJSUPPORT}
|
||||||
|
ogmap;
|
||||||
|
|
||||||
{$ifdef MEMDEBUG}
|
{$ifdef MEMDEBUG}
|
||||||
var
|
var
|
||||||
@ -1290,7 +1294,20 @@ implementation
|
|||||||
{arm_attribute} [oso_data]
|
{arm_attribute} [oso_data]
|
||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
|
if (aType in [sec_rodata,sec_rodata_norel]) then
|
||||||
|
begin
|
||||||
|
if (target_info.system in systems_all_windows) then
|
||||||
|
aType:=sec_rodata_norel
|
||||||
|
else
|
||||||
|
aType:=sec_data;
|
||||||
|
end;
|
||||||
result:=secoptions[atype];
|
result:=secoptions[atype];
|
||||||
|
{$ifdef OMFOBJSUPPORT}
|
||||||
|
{ in the huge memory model, BSS data is actually written in the regular
|
||||||
|
FAR_DATA segment of the module }
|
||||||
|
if omf_segclass(atype)='FAR_DATA' then
|
||||||
|
Result:=Result+[oso_data,oso_sparse_data];
|
||||||
|
{$endif OMFOBJSUPPORT}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,7 +133,6 @@ interface
|
|||||||
constructor createcoff(const n:string;awin32:boolean;acObjSection:TObjSectionClass);
|
constructor createcoff(const n:string;awin32:boolean;acObjSection:TObjSectionClass);
|
||||||
procedure CreateDebugSections;override;
|
procedure CreateDebugSections;override;
|
||||||
function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
|
function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
|
||||||
class function sectiontype2options(atype:TAsmSectiontype):TObjSectionOptions;override;
|
|
||||||
procedure writereloc(data:aint;len:aword;p:TObjSymbol;reloctype:TObjRelocationType);override;
|
procedure writereloc(data:aint;len:aword;p:TObjSymbol;reloctype:TObjRelocationType);override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1214,19 +1213,6 @@ const pemagic : array[0..3] of byte = (
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
class function TCoffObjData.sectiontype2options(aType:TAsmSectionType): TObjSectionOptions;
|
|
||||||
begin
|
|
||||||
if (aType in [sec_rodata,sec_rodata_norel]) then
|
|
||||||
begin
|
|
||||||
if (target_info.system in systems_all_windows) then
|
|
||||||
aType:=sec_rodata_norel
|
|
||||||
else
|
|
||||||
aType:=sec_data;
|
|
||||||
end;
|
|
||||||
result:=inherited sectiontype2options(aType);
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure TCoffObjData.CreateDebugSections;
|
procedure TCoffObjData.CreateDebugSections;
|
||||||
begin
|
begin
|
||||||
if target_dbg.id=dbg_stabs then
|
if target_dbg.id=dbg_stabs then
|
||||||
|
@ -128,7 +128,6 @@ interface
|
|||||||
public
|
public
|
||||||
constructor create(const n:string);override;
|
constructor create(const n:string);override;
|
||||||
destructor destroy;override;
|
destructor destroy;override;
|
||||||
class function sectiontype2options(atype:TAsmSectiontype):TObjSectionOptions;override;
|
|
||||||
function sectiontype2align(atype:TAsmSectiontype):longint;override;
|
function sectiontype2align(atype:TAsmSectiontype):longint;override;
|
||||||
class function sectiontype2class(atype:TAsmSectiontype):string;
|
class function sectiontype2class(atype:TAsmSectiontype):string;
|
||||||
function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
|
function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
|
||||||
@ -1070,15 +1069,6 @@ implementation
|
|||||||
inherited destroy;
|
inherited destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TOmfObjData.sectiontype2options(atype: TAsmSectiontype): TObjSectionOptions;
|
|
||||||
begin
|
|
||||||
Result:=inherited sectiontype2options(atype);
|
|
||||||
{ in the huge memory model, BSS data is actually written in the regular
|
|
||||||
FAR_DATA segment of the module }
|
|
||||||
if sectiontype2class(atype)='FAR_DATA' then
|
|
||||||
Result:=Result+[oso_data,oso_sparse_data];
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TOmfObjData.sectiontype2align(atype: TAsmSectiontype): longint;
|
function TOmfObjData.sectiontype2align(atype: TAsmSectiontype): longint;
|
||||||
begin
|
begin
|
||||||
Result:=omf_sectiontype2align(atype);
|
Result:=omf_sectiontype2align(atype);
|
||||||
|
Loading…
Reference in New Issue
Block a user