* autoswitch to writing 32-bit PUBDEF OMF records if there's a need to encode a

32-bit offset

git-svn-id: trunk@39089 -
This commit is contained in:
nickysn 2018-05-22 12:54:11 +00:00
parent ca50b14e21
commit a656d98657

View File

@ -410,6 +410,8 @@ interface
procedure DecodeFrom(RawRecord: TOmfRawRecord);override;
procedure EncodeTo(RawRecord: TOmfRawRecord);override;
procedure MaybeGo32;
property Is32Bit: Boolean read FIs32Bit write FIs32Bit;
property BaseGroupIndex: Integer read FBaseGroupIndex write FBaseGroupIndex;
property BaseSegmentIndex: Integer read FBaseSegmentIndex write FBaseSegmentIndex;
@ -1718,6 +1720,7 @@ implementation
Len,LastIncludedIndex,NextOfs,I: Integer;
PubName: TOmfPublicNameElement;
begin
MaybeGo32;
if Is32Bit then
RawRecord.RecordType:=RT_PUBDEF32
else
@ -1770,6 +1773,22 @@ implementation
NextIndex:=LastIncludedIndex+1;
end;
procedure TOmfRecord_PUBDEF.MaybeGo32;
var
I: Integer;
PubName: TOmfPublicNameElement;
begin
for I:=0 to PublicNames.Count-1 do
begin
PubName:=TOmfPublicNameElement(PublicNames[I]);
if PubName.PublicOffset>$ffff then
begin
Is32Bit:=true;
exit;
end;
end;
end;
{ TOmfExternalNameElement }
function TOmfExternalNameElement.GetLengthInFile: Integer;