|
@@ -169,6 +169,7 @@ interface
|
|
constructor create(AList:TFPHashObjectList;const AName:string);
|
|
constructor create(AList:TFPHashObjectList;const AName:string);
|
|
function address:aword;
|
|
function address:aword;
|
|
procedure SetAddress(apass:byte;aobjsec:TObjSection;abind:TAsmsymbind;atyp:Tasmsymtype);
|
|
procedure SetAddress(apass:byte;aobjsec:TObjSection;abind:TAsmsymbind;atyp:Tasmsymtype);
|
|
|
|
+ function ObjData: TObjData;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ Stabs is common for all targets }
|
|
{ Stabs is common for all targets }
|
|
@@ -256,13 +257,18 @@ interface
|
|
|
|
|
|
TString80 = string[80];
|
|
TString80 = string[80];
|
|
|
|
|
|
|
|
+ TObjSymbolList = class(TFPHashObjectList)
|
|
|
|
+ public
|
|
|
|
+ Owner: TObjData;
|
|
|
|
+ end;
|
|
|
|
+
|
|
TObjData = class(TLinkedListItem)
|
|
TObjData = class(TLinkedListItem)
|
|
private
|
|
private
|
|
FCurrObjSec : TObjSection;
|
|
FCurrObjSec : TObjSection;
|
|
FObjSectionList : TFPHashObjectList;
|
|
FObjSectionList : TFPHashObjectList;
|
|
FCObjSection : TObjSectionClass;
|
|
FCObjSection : TObjSectionClass;
|
|
{ Symbols that will be defined in this object file }
|
|
{ Symbols that will be defined in this object file }
|
|
- FObjSymbolList : TFPHashObjectList;
|
|
|
|
|
|
+ FObjSymbolList : TObjSymbolList;
|
|
FCachedAsmSymbolList : TFPObjectList;
|
|
FCachedAsmSymbolList : TFPObjectList;
|
|
{ Special info sections that are written to during object generation }
|
|
{ Special info sections that are written to during object generation }
|
|
FStabsObjSec,
|
|
FStabsObjSec,
|
|
@@ -309,7 +315,7 @@ interface
|
|
procedure layoutsections(var datapos:aword);
|
|
procedure layoutsections(var datapos:aword);
|
|
property Name:TString80 read FName;
|
|
property Name:TString80 read FName;
|
|
property CurrObjSec:TObjSection read FCurrObjSec;
|
|
property CurrObjSec:TObjSection read FCurrObjSec;
|
|
- property ObjSymbolList:TFPHashObjectList read FObjSymbolList;
|
|
|
|
|
|
+ property ObjSymbolList:TObjSymbolList read FObjSymbolList;
|
|
property ObjSectionList:TFPHashObjectList read FObjSectionList;
|
|
property ObjSectionList:TFPHashObjectList read FObjSectionList;
|
|
property GroupsList:TFPHashObjectList read FGroupsList;
|
|
property GroupsList:TFPHashObjectList read FGroupsList;
|
|
property StabsSec:TObjSection read FStabsObjSec write FStabsObjSec;
|
|
property StabsSec:TObjSection read FStabsObjSec write FStabsObjSec;
|
|
@@ -522,6 +528,7 @@ interface
|
|
procedure DoRelocationFixup(objsec:TObjSection);virtual;abstract;
|
|
procedure DoRelocationFixup(objsec:TObjSection);virtual;abstract;
|
|
function MemAlign(exesec: TExeSection): longword;
|
|
function MemAlign(exesec: TExeSection): longword;
|
|
function DataAlign(exesec: TExeSection): longword;
|
|
function DataAlign(exesec: TExeSection): longword;
|
|
|
|
+ procedure ReplaceExeSectionList(newlist: TFPList);
|
|
public
|
|
public
|
|
CurrDataPos : aword;
|
|
CurrDataPos : aword;
|
|
MaxMemPos : qword;
|
|
MaxMemPos : qword;
|
|
@@ -707,6 +714,12 @@ implementation
|
|
offset:=aobjsec.size;
|
|
offset:=aobjsec.size;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ function TObjSymbol.ObjData: TObjData;
|
|
|
|
+ begin
|
|
|
|
+ result:=(OwnerList as TObjSymbolList).Owner;
|
|
|
|
+ end;
|
|
|
|
+
|
|
{****************************************************************************
|
|
{****************************************************************************
|
|
TObjRelocation
|
|
TObjRelocation
|
|
****************************************************************************}
|
|
****************************************************************************}
|
|
@@ -960,7 +973,8 @@ implementation
|
|
FStabsObjSec:=nil;
|
|
FStabsObjSec:=nil;
|
|
FStabStrObjSec:=nil;
|
|
FStabStrObjSec:=nil;
|
|
{ symbols }
|
|
{ symbols }
|
|
- FObjSymbolList:=TFPHashObjectList.Create(true);
|
|
|
|
|
|
+ FObjSymbolList:=TObjSymbolList.Create(true);
|
|
|
|
+ FObjSymbolList.Owner:=Self;
|
|
FCachedAsmSymbolList:=TFPObjectList.Create(false);
|
|
FCachedAsmSymbolList:=TFPObjectList.Create(false);
|
|
{ section class type for creating of new sections }
|
|
{ section class type for creating of new sections }
|
|
FCObjSection:=TObjSection;
|
|
FCObjSection:=TObjSection;
|
|
@@ -2524,7 +2538,7 @@ implementation
|
|
commonsym.size:=objsym.size;
|
|
commonsym.size:=objsym.size;
|
|
internalObjData.alloc(objsym.size);
|
|
internalObjData.alloc(objsym.size);
|
|
if assigned(exemap) then
|
|
if assigned(exemap) then
|
|
- exemap.AddCommonSymbol(commonsym);
|
|
|
|
|
|
+ exemap.AddCommonSymbol(objsym);
|
|
{ Assign to the exesymbol }
|
|
{ Assign to the exesymbol }
|
|
objsym.exesymbol.objsymbol:=commonsym;
|
|
objsym.exesymbol.objsymbol:=commonsym;
|
|
objsym.exesymbol.state:=symstate_defined;
|
|
objsym.exesymbol.state:=symstate_defined;
|
|
@@ -3290,6 +3304,22 @@ implementation
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
+ procedure TExeOutput.ReplaceExeSectionList(newlist: TFPList);
|
|
|
|
+ var
|
|
|
|
+ tmp: TFPHashObjectList;
|
|
|
|
+ i: longint;
|
|
|
|
+ begin
|
|
|
|
+ tmp:=TFPHashObjectList.Create(true);
|
|
|
|
+ for i:=0 to newlist.count-1 do
|
|
|
|
+ TFPHashObject(newlist[i]).ChangeOwner(tmp);
|
|
|
|
+ { prevent destruction of existing sections }
|
|
|
|
+ for i:=0 to ExeSectionList.count-1 do
|
|
|
|
+ ExeSectionList.List[i]:=nil;
|
|
|
|
+ FExeSectionList.Free;
|
|
|
|
+ FExeSectionList:=tmp;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+
|
|
{****************************************************************************
|
|
{****************************************************************************
|
|
TObjInput
|
|
TObjInput
|
|
****************************************************************************}
|
|
****************************************************************************}
|