Browse Source

* allow gaps between LEDATA records, as nasm seems to produce them. They're
automatically filled with zeros. This fixes reading of the tiny memory model
startup code object module by the i8086-msdos internal linker.

git-svn-id: trunk@31354 -

nickysn 10 years ago
parent
commit
808b5dfb78
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/ogomf.pas

+ 2 - 1
compiler/ogomf.pas

@@ -1289,7 +1289,7 @@ implementation
         objsec:=TOmfObjSection(objdata.ObjSectionList[SegmentIndex-1]);
         objsec:=TOmfObjSection(objdata.ObjSectionList[SegmentIndex-1]);
 
 
         objsec.SecOptions:=objsec.SecOptions+[oso_Data];
         objsec.SecOptions:=objsec.SecOptions+[oso_Data];
-        if (objsec.Data.Size<>EnumeratedDataOffset) then
+        if (objsec.Data.Size>EnumeratedDataOffset) then
           begin
           begin
             InputError('LEDATA enumerated data offset field out of sequence');
             InputError('LEDATA enumerated data offset field out of sequence');
             exit;
             exit;
@@ -1299,6 +1299,7 @@ implementation
             InputError('LEDATA goes beyond the segment size declared in the SEGDEF record');
             InputError('LEDATA goes beyond the segment size declared in the SEGDEF record');
             exit;
             exit;
           end;
           end;
+        objsec.Data.seek(EnumeratedDataOffset);
         objsec.Data.write(RawRec.RawData[NextOfs],BlockLength);
         objsec.Data.write(RawRec.RawData[NextOfs],BlockLength);
 
 
         { also read all the FIXUPP records that may follow }
         { also read all the FIXUPP records that may follow }