mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 18:09:27 +02:00
* Added virtual function TObjSection.GetAltName to be able to specify additional section name by descendants.
* OMF: Use the name of the first global symbol as an addition section name. This name is visible in the linker map file and helps tracking of section references. git-svn-id: trunk@46298 -
This commit is contained in:
parent
fcf085b141
commit
985220d94c
@ -309,6 +309,8 @@ interface
|
||||
FSizeLimit : TObjSectionOfs;
|
||||
procedure SetSecOptions(Aoptions:TObjSectionOptions);
|
||||
procedure SectionTooLargeError;
|
||||
protected
|
||||
function GetAltName: string; virtual;
|
||||
public
|
||||
ObjData : TObjData;
|
||||
index : longword; { index of section in section headers }
|
||||
@ -1013,6 +1015,12 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function TObjSection.GetAltName: string;
|
||||
begin
|
||||
result:='';
|
||||
end;
|
||||
|
||||
|
||||
function TObjSection.write(const d;l:TObjSectionOfs):TObjSectionOfs;
|
||||
begin
|
||||
result:=size;
|
||||
@ -1152,13 +1160,20 @@ implementation
|
||||
|
||||
|
||||
function TObjSection.FullName:string;
|
||||
var
|
||||
s: string;
|
||||
begin
|
||||
if not assigned(FCachedFullName) then
|
||||
begin
|
||||
if assigned(ObjData) then
|
||||
FCachedFullName:=stringdup(ObjData.Name+'('+Name+')')
|
||||
s:=GetAltName;
|
||||
if s<>'' then
|
||||
s:=Name+s
|
||||
else
|
||||
FCachedFullName:=stringdup(Name);
|
||||
s:=Name;
|
||||
if assigned(ObjData) then
|
||||
FCachedFullName:=stringdup(ObjData.Name+'('+s+')')
|
||||
else
|
||||
FCachedFullName:=stringdup(s);
|
||||
end;
|
||||
result:=FCachedFullName^;
|
||||
end;
|
||||
|
@ -74,6 +74,7 @@ interface
|
||||
private
|
||||
FClassName: string;
|
||||
FOverlayName: string;
|
||||
FFirstSym: TObjSymbol;
|
||||
FCombination: TOmfSegmentCombination;
|
||||
FUse: TOmfSegmentUse;
|
||||
FPrimaryGroup: TObjSectionGroup;
|
||||
@ -81,6 +82,8 @@ interface
|
||||
FMZExeUnifiedLogicalSegment: TMZExeUnifiedLogicalSegment;
|
||||
FLinNumEntries: TOmfSubRecord_LINNUM_MsLink_LineNumberList;
|
||||
function GetOmfAlignment: TOmfSegmentAlignment;
|
||||
protected
|
||||
function GetAltName: string; override;
|
||||
public
|
||||
constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:longint;Aoptions:TObjSectionOptions);override;
|
||||
destructor destroy;override;
|
||||
@ -1006,6 +1009,14 @@ implementation
|
||||
end;
|
||||
end;
|
||||
|
||||
function TOmfObjSection.GetAltName: string;
|
||||
begin
|
||||
if FFirstSym<>nil then
|
||||
result:='/'+FFirstSym.Name
|
||||
else
|
||||
result:='';
|
||||
end;
|
||||
|
||||
constructor TOmfObjSection.create(AList: TFPHashObjectList;
|
||||
const Aname: string; Aalign: longint; Aoptions: TObjSectionOptions);
|
||||
begin
|
||||
@ -1983,6 +1994,8 @@ implementation
|
||||
objsym.objsection:=objsec;
|
||||
objsym.offset:=PubDefElem.PublicOffset;
|
||||
objsym.size:=0;
|
||||
if (objsym.bind=AB_GLOBAL) and (objsec.FFirstSym=nil) then
|
||||
objsec.FFirstSym:=objsym;
|
||||
end;
|
||||
PubDefRec.Free;
|
||||
Result:=True;
|
||||
|
Loading…
Reference in New Issue
Block a user