mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-06 03:33:00 +02:00
+ write EXTDEF records in the omf output file
git-svn-id: trunk@30527 -
This commit is contained in:
parent
fd9e0d7266
commit
d8f04418be
@ -103,6 +103,7 @@ interface
|
|||||||
|
|
||||||
procedure section_count_sections(p:TObject;arg:pointer);
|
procedure section_count_sections(p:TObject;arg:pointer);
|
||||||
procedure WritePUBDEFs(Data: TObjData);
|
procedure WritePUBDEFs(Data: TObjData);
|
||||||
|
procedure WriteEXTDEFs(Data: TObjData);
|
||||||
|
|
||||||
property LNames: TOmfOrderedNameCollection read FLNames;
|
property LNames: TOmfOrderedNameCollection read FLNames;
|
||||||
property Segments: TFPHashObjectList read FSegments;
|
property Segments: TFPHashObjectList read FSegments;
|
||||||
@ -549,6 +550,46 @@ implementation
|
|||||||
RawRecord.Free;
|
RawRecord.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TOmfObjOutput.WriteEXTDEFs(Data: TObjData);
|
||||||
|
var
|
||||||
|
ExtNames: TFPHashObjectList;
|
||||||
|
RawRecord: TOmfRawRecord;
|
||||||
|
i,idx: Integer;
|
||||||
|
objsym: TObjSymbol;
|
||||||
|
ExternalNameElem: TOmfExternalNameElement;
|
||||||
|
ExtDefRec: TOmfRecord_EXTDEF;
|
||||||
|
begin
|
||||||
|
ExtNames:=TFPHashObjectList.Create;
|
||||||
|
RawRecord:=TOmfRawRecord.Create;
|
||||||
|
|
||||||
|
idx:=1;
|
||||||
|
for i:=0 to Data.ObjSymbolList.Count-1 do
|
||||||
|
begin
|
||||||
|
objsym:=TObjSymbol(Data.ObjSymbolList[i]);
|
||||||
|
if objsym.bind=AB_EXTERNAL then
|
||||||
|
begin
|
||||||
|
ExternalNameElem:=TOmfExternalNameElement.Create(ExtNames,objsym.Name);
|
||||||
|
objsym.symidx:=idx;
|
||||||
|
Inc(idx);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if ExtNames.Count>0 then
|
||||||
|
begin
|
||||||
|
ExtDefRec:=TOmfRecord_EXTDEF.Create;
|
||||||
|
ExtDefRec.ExternalNames:=ExtNames;
|
||||||
|
while ExtDefRec.NextIndex<ExtDefRec.ExternalNames.Count do
|
||||||
|
begin
|
||||||
|
ExtDefRec.EncodeTo(RawRecord);
|
||||||
|
RawRecord.WriteTo(FWriter);
|
||||||
|
end;
|
||||||
|
ExtDefRec.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
ExtNames.Free;
|
||||||
|
RawRecord.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
function TOmfObjOutput.writeData(Data:TObjData):boolean;
|
function TOmfObjOutput.writeData(Data:TObjData):boolean;
|
||||||
var
|
var
|
||||||
RawRecord: TOmfRawRecord;
|
RawRecord: TOmfRawRecord;
|
||||||
@ -639,6 +680,9 @@ implementation
|
|||||||
{ write PUBDEF record(s) }
|
{ write PUBDEF record(s) }
|
||||||
WritePUBDEFs(Data);
|
WritePUBDEFs(Data);
|
||||||
|
|
||||||
|
{ write EXTDEF record(s) }
|
||||||
|
WriteEXTDEFs(Data);
|
||||||
|
|
||||||
{ write link pass separator }
|
{ write link pass separator }
|
||||||
LinkPassSeparator_COMENT:=TOmfRecord_COMENT.Create;
|
LinkPassSeparator_COMENT:=TOmfRecord_COMENT.Create;
|
||||||
LinkPassSeparator_COMENT.CommentClass:=CC_LinkPassSeparator;
|
LinkPassSeparator_COMENT.CommentClass:=CC_LinkPassSeparator;
|
||||||
|
Loading…
Reference in New Issue
Block a user