소스 검색

* Use unsigned integers for sizes and positions to break 2GB limit in tdynamicarray, object writer, internal linker, coff and PE headers.

git-svn-id: trunk@11480 -
yury 17 년 전
부모
커밋
5e11e697b4
13개의 변경된 파일165개의 추가작업 그리고 166개의 파일을 삭제
  1. 23 25
      compiler/cclasses.pas
  2. 1 1
      compiler/comphook.pas
  3. 2 2
      compiler/compiler.pas
  4. 1 1
      compiler/fppu.pas
  5. 1 1
      compiler/link.pas
  6. 43 43
      compiler/ogbase.pas
  7. 76 75
      compiler/ogcoff.pas
  8. 3 3
      compiler/ogelf.pas
  9. 1 1
      compiler/ogmap.pas
  10. 2 2
      compiler/owar.pas
  11. 9 9
      compiler/owbase.pas
  12. 2 2
      compiler/verbose.pas
  13. 1 1
      compiler/x86/aasmcpu.pas

+ 23 - 25
compiler/cclasses.pas

@@ -423,7 +423,7 @@ type
        tdynamicblock = record
        tdynamicblock = record
          pos,
          pos,
          size,
          size,
-         used : integer;
+         used : longword;
          Next : pdynamicblock;
          Next : pdynamicblock;
          data : tdynamicblockdata;
          data : tdynamicblockdata;
        end;
        end;
@@ -434,28 +434,28 @@ type
      type
      type
        tdynamicarray = class
        tdynamicarray = class
        private
        private
-         FPosn       : integer;
+         FPosn       : longword;
          FPosnblock  : pdynamicblock;
          FPosnblock  : pdynamicblock;
          FCurrBlocksize,
          FCurrBlocksize,
-         FMaxBlocksize  : integer;
+         FMaxBlocksize  : longword;
          FFirstblock,
          FFirstblock,
          FLastblock  : pdynamicblock;
          FLastblock  : pdynamicblock;
          procedure grow;
          procedure grow;
        public
        public
-         constructor Create(Ablocksize:integer);
+         constructor Create(Ablocksize:longword);
          destructor  Destroy;override;
          destructor  Destroy;override;
          procedure reset;
          procedure reset;
-         function  size:integer;
-         procedure align(i:integer);
-         procedure seek(i:integer);
-         function  read(var d;len:integer):integer;
-         procedure write(const d;len:integer);
+         function  size:longword;
+         procedure align(i:longword);
+         procedure seek(i:longword);
+         function  read(var d;len:longword):longword;
+         procedure write(const d;len:longword);
          procedure writestr(const s:string); {$ifdef CCLASSESINLINE}inline;{$endif}
          procedure writestr(const s:string); {$ifdef CCLASSESINLINE}inline;{$endif}
-         procedure readstream(f:TCStream;maxlen:longint);
+         procedure readstream(f:TCStream;maxlen:longword);
          procedure writestream(f:TCStream);
          procedure writestream(f:TCStream);
-         property  CurrBlockSize : integer read FCurrBlocksize;
+         property  CurrBlockSize : longword read FCurrBlocksize;
          property  FirstBlock : PDynamicBlock read FFirstBlock;
          property  FirstBlock : PDynamicBlock read FFirstBlock;
-         property  Pos : integer read FPosn;
+         property  Pos : longword read FPosn;
        end;
        end;
 
 
 
 
@@ -2261,7 +2261,7 @@ end;
                                 tdynamicarray
                                 tdynamicarray
 ****************************************************************************}
 ****************************************************************************}
 
 
-    constructor tdynamicarray.create(Ablocksize:integer);
+    constructor tdynamicarray.create(Ablocksize:longword);
       begin
       begin
         FPosn:=0;
         FPosn:=0;
         FPosnblock:=nil;
         FPosnblock:=nil;
@@ -2286,7 +2286,7 @@ end;
       end;
       end;
 
 
 
 
-    function  tdynamicarray.size:integer;
+    function  tdynamicarray.size:longword;
       begin
       begin
         if assigned(FLastblock) then
         if assigned(FLastblock) then
          size:=FLastblock^.pos+FLastblock^.used
          size:=FLastblock^.pos+FLastblock^.used
@@ -2351,9 +2351,9 @@ end;
       end;
       end;
 
 
 
 
-    procedure tdynamicarray.align(i:integer);
+    procedure tdynamicarray.align(i:longword);
       var
       var
-        j : integer;
+        j : longword;
       begin
       begin
         j:=(FPosn mod i);
         j:=(FPosn mod i);
         if j<>0 then
         if j<>0 then
@@ -2372,7 +2372,7 @@ end;
       end;
       end;
 
 
 
 
-    procedure tdynamicarray.seek(i:integer);
+    procedure tdynamicarray.seek(i:longword);
       begin
       begin
         if (i<FPosnblock^.pos) or (i>=FPosnblock^.pos+FPosnblock^.size) then
         if (i<FPosnblock^.pos) or (i>=FPosnblock^.pos+FPosnblock^.size) then
          begin
          begin
@@ -2403,10 +2403,10 @@ end;
       end;
       end;
 
 
 
 
-    procedure tdynamicarray.write(const d;len:integer);
+    procedure tdynamicarray.write(const d;len:longword);
       var
       var
         p : pchar;
         p : pchar;
-        i,j : integer;
+        i,j : longword;
       begin
       begin
         p:=pchar(@d);
         p:=pchar(@d);
         while (len>0) do
         while (len>0) do
@@ -2448,10 +2448,10 @@ end;
       end;
       end;
 
 
 
 
-    function tdynamicarray.read(var d;len:integer):integer;
+    function tdynamicarray.read(var d;len:longword):longword;
       var
       var
         p : pchar;
         p : pchar;
-        i,j,res : integer;
+        i,j,res : longword;
       begin
       begin
         res:=0;
         res:=0;
         p:=pchar(@d);
         p:=pchar(@d);
@@ -2484,12 +2484,10 @@ end;
       end;
       end;
 
 
 
 
-    procedure tdynamicarray.readstream(f:TCStream;maxlen:longint);
+    procedure tdynamicarray.readstream(f:TCStream;maxlen:longword);
       var
       var
-        i,left : integer;
+        i,left : longword;
       begin
       begin
-        if maxlen=-1 then
-         maxlen:=maxlongint;
         repeat
         repeat
           left:=FPosnblock^.size-FPosnblock^.used;
           left:=FPosnblock^.size-FPosnblock^.used;
           if left>maxlen then
           if left>maxlen then

+ 1 - 1
compiler/comphook.pas

@@ -84,7 +84,7 @@ type
     countNotes,
     countNotes,
     countHints    : longint;  { number of found errors/warnings/notes/hints }
     countHints    : longint;  { number of found errors/warnings/notes/hints }
     codesize,
     codesize,
-    datasize      : aint;
+    datasize      : aword;
   { program info }
   { program info }
     isexe,
     isexe,
     ispackage,
     ispackage,

+ 2 - 2
compiler/compiler.pas

@@ -110,7 +110,7 @@ uses
 {$ifdef symbian}
 {$ifdef symbian}
   ,i_symbian
   ,i_symbian
 {$endif symbian}
 {$endif symbian}
-  ;
+  ,globtype;
 
 
 function Compile(const cmd:string):longint;
 function Compile(const cmd:string):longint;
 
 
@@ -249,7 +249,7 @@ begin
           if totaltime<0 then
           if totaltime<0 then
             totaltime:=totaltime+3600.0*24.0;
             totaltime:=totaltime+3600.0*24.0;
           timestr:=tostr(trunc(totaltime))+'.'+tostr(round(frac(totaltime)*10));
           timestr:=tostr(trunc(totaltime))+'.'+tostr(round(frac(totaltime)*10));
-          if status.codesize<>-1 then
+          if status.codesize<>aword(-1) then
             linkstr:=', '+tostr(status.codesize)+' ' +strpas(MessagePChar(general_text_bytes_code))+', '+tostr(status.datasize)+' '+strpas(MessagePChar(general_text_bytes_data))
             linkstr:=', '+tostr(status.codesize)+' ' +strpas(MessagePChar(general_text_bytes_code))+', '+tostr(status.datasize)+' '+strpas(MessagePChar(general_text_bytes_data))
           else
           else
             linkstr:='';
             linkstr:='';

+ 1 - 1
compiler/fppu.pas

@@ -569,7 +569,7 @@ uses
         len,hlen : longint;
         len,hlen : longint;
         buf : array[0..1023] of byte;
         buf : array[0..1023] of byte;
       begin
       begin
-        if derefdataintflen>derefdata.size then
+        if longword(derefdataintflen)>derefdata.size then
           internalerror(200310223);
           internalerror(200310223);
         derefdata.seek(0);
         derefdata.seek(0);
         { Write interface data }
         { Write interface data }

+ 1 - 1
compiler/link.pas

@@ -1018,7 +1018,7 @@ Implementation
       label
       label
         myexit;
         myexit;
       var
       var
-        bsssize : aint;
+        bsssize : aword;
         bsssec  : TExeSection;
         bsssec  : TExeSection;
         dbgname : TCmdStr;
         dbgname : TCmdStr;
       begin
       begin

+ 43 - 43
compiler/ogbase.pas

@@ -140,11 +140,11 @@ interface
        objsection : TObjSection;
        objsection : TObjSection;
        symidx     : longint;
        symidx     : longint;
        offset,
        offset,
-       size       : aint;
+       size       : aword;
        { Used for external and common solving during linking }
        { Used for external and common solving during linking }
        exesymbol  : TExeSymbol;
        exesymbol  : TExeSymbol;
        constructor create(AList:TFPHashObjectList;const AName:string);
        constructor create(AList:TFPHashObjectList;const AName:string);
-       function  address:aint;
+       function  address:aword;
        procedure SetAddress(apass:byte;aobjsec:TObjSection;abind:TAsmsymbind;atyp:Tasmsymtype);
        procedure SetAddress(apass:byte;aobjsec:TObjSection;abind:TAsmsymbind;atyp:Tasmsymtype);
      end;
      end;
 
 
@@ -160,13 +160,13 @@ interface
 
 
      TObjRelocation = class
      TObjRelocation = class
         DataOffset,
         DataOffset,
-        orgsize    : aint;  { original size of the symbol to Relocate, required for COFF }
+        orgsize    : aword;  { original size of the symbol to Relocate, required for COFF }
         symbol     : TObjSymbol;
         symbol     : TObjSymbol;
         objsection : TObjSection; { only used if symbol=nil }
         objsection : TObjSection; { only used if symbol=nil }
         typ        : TObjRelocationType;
         typ        : TObjRelocationType;
-        constructor CreateSymbol(ADataOffset:aint;s:TObjSymbol;Atyp:TObjRelocationType);
-        constructor CreateSymbolSize(ADataOffset:aint;s:TObjSymbol;Aorgsize:aint;Atyp:TObjRelocationType);
-        constructor CreateSection(ADataOffset:aint;aobjsec:TObjSection;Atyp:TObjRelocationType);
+        constructor CreateSymbol(ADataOffset:aword;s:TObjSymbol;Atyp:TObjRelocationType);
+        constructor CreateSymbolSize(ADataOffset:aword;s:TObjSymbol;Aorgsize:aword;Atyp:TObjRelocationType);
+        constructor CreateSection(ADataOffset:aword;aobjsec:TObjSection;Atyp:TObjRelocationType);
      end;
      end;
 
 
      TObjSection = class(TFPHashObject)
      TObjSection = class(TFPHashObject)
@@ -182,7 +182,7 @@ interface
        { section Data }
        { section Data }
        Size,
        Size,
        DataPos,
        DataPos,
-       MemPos     : aint;
+       MemPos     : aword;
        DataAlignBytes : shortint;
        DataAlignBytes : shortint;
        { Relocations (=references) to other sections }
        { Relocations (=references) to other sections }
        ObjRelocations : TFPObjectList;
        ObjRelocations : TFPObjectList;
@@ -194,14 +194,14 @@ interface
        VTRefList : TFPObjectList;
        VTRefList : TFPObjectList;
        constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:shortint;Aoptions:TObjSectionOptions);virtual;
        constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:shortint;Aoptions:TObjSectionOptions);virtual;
        destructor  destroy;override;
        destructor  destroy;override;
-       function  write(const d;l:aint):aint;
-       function  writestr(const s:string):aint;
-       function  WriteZeros(l:longint):aint;
-       procedure setmempos(var mpos:aint);
-       procedure setDatapos(var dpos:aint);
-       procedure alloc(l:aint);
-       procedure addsymReloc(ofs:aint;p:TObjSymbol;Reloctype:TObjRelocationType);
-       procedure addsectionReloc(ofs:aint;aobjsec:TObjSection;Reloctype:TObjRelocationType);
+       function  write(const d;l:aword):aword;
+       function  writestr(const s:string):aword;
+       function  WriteZeros(l:longword):aword;
+       procedure setmempos(var mpos:aword);
+       procedure setDatapos(var dpos:aword);
+       procedure alloc(l:aword);
+       procedure addsymReloc(ofs:aword;p:TObjSymbol;Reloctype:TObjRelocationType);
+       procedure addsectionReloc(ofs:aword;aobjsec:TObjSection;Reloctype:TObjRelocationType);
        procedure AddSymbolDefine(p:TObjSymbol);
        procedure AddSymbolDefine(p:TObjSymbol);
        procedure FixupRelocs;virtual;
        procedure FixupRelocs;virtual;
        procedure ReleaseData;
        procedure ReleaseData;
@@ -232,7 +232,7 @@ interface
        property CObjSection:TObjSectionClass read FCObjSection write FCObjSection;
        property CObjSection:TObjSectionClass read FCObjSection write FCObjSection;
      public
      public
        CurrPass  : byte;
        CurrPass  : byte;
-       ImageBase : aint;
+       ImageBase : aword;
        constructor create(const n:string);virtual;
        constructor create(const n:string);virtual;
        destructor  destroy;override;
        destructor  destroy;override;
        { Sections }
        { Sections }
@@ -252,10 +252,10 @@ interface
        function  symbolref(const aname:string):TObjSymbol;
        function  symbolref(const aname:string):TObjSymbol;
        procedure ResetCachedAsmSymbols;
        procedure ResetCachedAsmSymbols;
        { Allocation }
        { Allocation }
-       procedure alloc(len:aint);
+       procedure alloc(len:aword);
        procedure allocalign(len:shortint);
        procedure allocalign(len:shortint);
-       procedure writebytes(const Data;len:aint);
-       procedure writeReloc(Data,len:aint;p:TObjSymbol;Reloctype:TObjRelocationType);virtual;abstract;
+       procedure writebytes(const Data;len:aword);
+       procedure writeReloc(Data,len:aword;p:TObjSymbol;Reloctype:TObjRelocationType);virtual;abstract;
        procedure beforealloc;virtual;
        procedure beforealloc;virtual;
        procedure beforewrite;virtual;
        procedure beforewrite;virtual;
        procedure afteralloc;virtual;
        procedure afteralloc;virtual;
@@ -348,7 +348,7 @@ interface
       public
       public
         Size,
         Size,
         DataPos,
         DataPos,
-        MemPos     : aint;
+        MemPos     : aword;
         SecAlign   : shortint;
         SecAlign   : shortint;
         SecOptions : TObjSectionOptions;
         SecOptions : TObjSectionOptions;
         constructor create(AList:TFPHashObjectList;const AName:string);virtual;
         constructor create(AList:TFPHashObjectList;const AName:string);virtual;
@@ -411,7 +411,7 @@ interface
         { Objects }
         { Objects }
         FObjDataList  : TFPObjectList;
         FObjDataList  : TFPObjectList;
         { Position calculation }
         { Position calculation }
-        FImageBase    : aint;
+        FImageBase    : aword;
       protected
       protected
         { writer }
         { writer }
         FExeWriteMode : TExeWriteMode;
         FExeWriteMode : TExeWriteMode;
@@ -420,14 +420,14 @@ interface
         internalObjData : TObjData;
         internalObjData : TObjData;
         EntrySym  : TObjSymbol;
         EntrySym  : TObjSymbol;
         SectionDataAlign,
         SectionDataAlign,
-        SectionMemAlign : aint;
+        SectionMemAlign : aword;
         function  writeData:boolean;virtual;abstract;
         function  writeData:boolean;virtual;abstract;
         property CExeSection:TExeSectionClass read FCExeSection write FCExeSection;
         property CExeSection:TExeSectionClass read FCExeSection write FCExeSection;
         property CObjData:TObjDataClass read FCObjData write FCObjData;
         property CObjData:TObjDataClass read FCObjData write FCObjData;
         procedure Order_ObjSectionList(ObjSectionList : TFPObjectList);virtual;
         procedure Order_ObjSectionList(ObjSectionList : TFPObjectList);virtual;
       public
       public
         CurrDataPos,
         CurrDataPos,
-        CurrMemPos   : aint;
+        CurrMemPos   : aword;
         IsSharedLibrary : boolean;
         IsSharedLibrary : boolean;
         constructor create;virtual;
         constructor create;virtual;
         destructor  destroy;override;
         destructor  destroy;override;
@@ -477,7 +477,7 @@ interface
         property CommonObjSymbols:TFPObjectList read FCommonObjSymbols;
         property CommonObjSymbols:TFPObjectList read FCommonObjSymbols;
         property ExeVTableList:TFPObjectList read FExeVTableList;
         property ExeVTableList:TFPObjectList read FExeVTableList;
         property EntryName:string read FEntryName write FEntryName;
         property EntryName:string read FEntryName write FEntryName;
-        property ImageBase:aint read FImageBase write FImageBase;
+        property ImageBase:aword read FImageBase write FImageBase;
         property CurrExeSec:TExeSection read FCurrExeSec;
         property CurrExeSec:TExeSection read FCurrExeSec;
         property ExeWriteMode:TExeWriteMode read FExeWriteMode write FExeWriteMode;
         property ExeWriteMode:TExeWriteMode read FExeWriteMode write FExeWriteMode;
       end;
       end;
@@ -518,7 +518,7 @@ implementation
       end;
       end;
 
 
 
 
-    function TObjSymbol.address:aint;
+    function TObjSymbol.address:aword;
       begin
       begin
         if assigned(objsection) then
         if assigned(objsection) then
           result:=offset+objsection.mempos
           result:=offset+objsection.mempos
@@ -560,7 +560,7 @@ implementation
                               TObjRelocation
                               TObjRelocation
 ****************************************************************************}
 ****************************************************************************}
 
 
-    constructor TObjRelocation.CreateSymbol(ADataOffset:aint;s:TObjSymbol;Atyp:TObjRelocationType);
+    constructor TObjRelocation.CreateSymbol(ADataOffset:aword;s:TObjSymbol;Atyp:TObjRelocationType);
       begin
       begin
         if not assigned(s) then
         if not assigned(s) then
           internalerror(200603034);
           internalerror(200603034);
@@ -572,7 +572,7 @@ implementation
       end;
       end;
 
 
 
 
-    constructor TObjRelocation.CreateSymbolSize(ADataOffset:aint;s:TObjSymbol;Aorgsize:aint;Atyp:TObjRelocationType);
+    constructor TObjRelocation.CreateSymbolSize(ADataOffset:aword;s:TObjSymbol;Aorgsize:aword;Atyp:TObjRelocationType);
       begin
       begin
         if not assigned(s) then
         if not assigned(s) then
           internalerror(200603035);
           internalerror(200603035);
@@ -584,7 +584,7 @@ implementation
       end;
       end;
 
 
 
 
-    constructor TObjRelocation.CreateSection(ADataOffset:aint;aobjsec:TObjSection;Atyp:TObjRelocationType);
+    constructor TObjRelocation.CreateSection(ADataOffset:aword;aobjsec:TObjSection;Atyp:TObjRelocationType);
       begin
       begin
         if not assigned(aobjsec) then
         if not assigned(aobjsec) then
           internalerror(200603036);
           internalerror(200603036);
@@ -640,7 +640,7 @@ implementation
       end;
       end;
 
 
 
 
-    function TObjSection.write(const d;l:aint):aint;
+    function TObjSection.write(const d;l:aword):aword;
       begin
       begin
         result:=size;
         result:=size;
         if assigned(Data) then
         if assigned(Data) then
@@ -655,13 +655,13 @@ implementation
       end;
       end;
 
 
 
 
-    function TObjSection.writestr(const s:string):aint;
+    function TObjSection.writestr(const s:string):aword;
       begin
       begin
         result:=Write(s[1],length(s));
         result:=Write(s[1],length(s));
       end;
       end;
 
 
 
 
-    function TObjSection.WriteZeros(l:longint):aint;
+    function TObjSection.WriteZeros(l:longword):aword;
       var
       var
         empty : array[0..1023] of byte;
         empty : array[0..1023] of byte;
       begin
       begin
@@ -677,7 +677,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TObjSection.setDatapos(var dpos:aint);
+    procedure TObjSection.setDatapos(var dpos:aword);
       begin
       begin
         if oso_Data in secoptions then
         if oso_Data in secoptions then
           begin
           begin
@@ -692,7 +692,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TObjSection.setmempos(var mpos:aint);
+    procedure TObjSection.setmempos(var mpos:aword);
       begin
       begin
         mempos:=align(mpos,secalign);
         mempos:=align(mpos,secalign);
         { return updated mempos }
         { return updated mempos }
@@ -700,19 +700,19 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TObjSection.alloc(l:aint);
+    procedure TObjSection.alloc(l:aword);
       begin
       begin
         inc(size,l);
         inc(size,l);
       end;
       end;
 
 
 
 
-    procedure TObjSection.addsymReloc(ofs:aint;p:TObjSymbol;Reloctype:TObjRelocationType);
+    procedure TObjSection.addsymReloc(ofs:aword;p:TObjSymbol;Reloctype:TObjRelocationType);
       begin
       begin
         ObjRelocations.Add(TObjRelocation.CreateSymbol(ofs,p,reloctype));
         ObjRelocations.Add(TObjRelocation.CreateSymbol(ofs,p,reloctype));
       end;
       end;
 
 
 
 
-    procedure TObjSection.addsectionReloc(ofs:aint;aobjsec:TObjSection;Reloctype:TObjRelocationType);
+    procedure TObjSection.addsectionReloc(ofs:aword;aobjsec:TObjSection;Reloctype:TObjRelocationType);
       begin
       begin
         ObjRelocations.Add(TObjRelocation.CreateSection(ofs,aobjsec,reloctype));
         ObjRelocations.Add(TObjRelocation.CreateSection(ofs,aobjsec,reloctype));
       end;
       end;
@@ -1021,7 +1021,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TObjData.writebytes(const Data;len:aint);
+    procedure TObjData.writebytes(const Data;len:aword);
       begin
       begin
         if not assigned(CurrObjSec) then
         if not assigned(CurrObjSec) then
           internalerror(200402251);
           internalerror(200402251);
@@ -1029,7 +1029,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TObjData.alloc(len:aint);
+    procedure TObjData.alloc(len:aword);
       begin
       begin
         if not assigned(CurrObjSec) then
         if not assigned(CurrObjSec) then
           internalerror(200402252);
           internalerror(200402252);
@@ -1241,10 +1241,10 @@ implementation
       var
       var
         i : longint;
         i : longint;
         objreloc : TObjRelocation;
         objreloc : TObjRelocation;
-        vtblentryoffset : aint;
+        vtblentryoffset : aword;
       begin
       begin
         CheckIdx(VTableIdx);
         CheckIdx(VTableIdx);
-        vtblentryoffset:=ExeSymbol.ObjSymbol.Offset+VTableIdx*sizeof(pint);
+        vtblentryoffset:=ExeSymbol.ObjSymbol.Offset+longword(VTableIdx)*sizeof(pint);
         { Find and disable relocation }
         { Find and disable relocation }
         for i:=0 to ExeSymbol.ObjSymbol.ObjSection.ObjRelocations.Count-1 do
         for i:=0 to ExeSymbol.ObjSymbol.ObjSection.ObjRelocations.Count-1 do
           begin
           begin
@@ -2168,11 +2168,11 @@ implementation
         currstabrelocidx,
         currstabrelocidx,
         i,j,
         i,j,
         mergestabcnt,
         mergestabcnt,
-        stabcnt : longint;
+        stabcnt : longword;
         skipstab : boolean;
         skipstab : boolean;
         skipfun : boolean;
         skipfun : boolean;
         hstab   : TObjStabEntry;
         hstab   : TObjStabEntry;
-        stabrelocofs : longint;
+        stabrelocofs : longword;
         buf     : array[0..1023] of byte;
         buf     : array[0..1023] of byte;
         bufend,
         bufend,
         bufsize  : longint;
         bufsize  : longint;
@@ -2226,7 +2226,7 @@ implementation
                       begin
                       begin
                         { Find corresponding Relocation }
                         { Find corresponding Relocation }
                         currstabreloc:=nil;
                         currstabreloc:=nil;
-                        while (currstabrelocidx<currstabsec.ObjRelocations.Count) do
+                        while (currstabrelocidx<longword(currstabsec.ObjRelocations.Count)) do
                           begin
                           begin
                             currstabreloc:=TObjRelocation(currstabsec.ObjRelocations[currstabrelocidx]);
                             currstabreloc:=TObjRelocation(currstabsec.ObjRelocations[currstabrelocidx]);
                             if assigned(currstabreloc) and
                             if assigned(currstabreloc) and

+ 76 - 75
compiler/ogcoff.pas

@@ -41,15 +41,15 @@ interface
 
 
     type
     type
        tcoffpedatadir = packed record
        tcoffpedatadir = packed record
-         vaddr : longint;
-         size  : longint;
+         vaddr : longword;
+         size  : longword;
        end;
        end;
        tcoffheader = packed record
        tcoffheader = packed record
          mach   : word;
          mach   : word;
-         nsects : smallint;
-         time   : longint;
-         sympos : longint;
-         syms   : longint;
+         nsects : word;
+         time   : longword;
+         sympos : longword;
+         syms   : longword;
          opthdr : word;
          opthdr : word;
          flag   : word;
          flag   : word;
        end;
        end;
@@ -57,45 +57,45 @@ interface
          Magic : word;
          Magic : word;
          MajorLinkerVersion : byte;
          MajorLinkerVersion : byte;
          MinorLinkerVersion : byte;
          MinorLinkerVersion : byte;
-         tsize : longint;
-         dsize : longint;
-         bsize : longint;
-         entry : longint;
-         text_start : longint;
+         tsize : longword;
+         dsize : longword;
+         bsize : longword;
+         entry : longword;
+         text_start : longword;
 {$ifndef x86_64}
 {$ifndef x86_64}
-         data_start : longint;
+         data_start : longword;
 {$endif x86_64}
 {$endif x86_64}
-         ImageBase : aint;
-         SectionAlignment : longint;
-         FileAlignment : longint;
+         ImageBase : aword;
+         SectionAlignment : longword;
+         FileAlignment : longword;
          MajorOperatingSystemVersion : word;
          MajorOperatingSystemVersion : word;
          MinorOperatingSystemVersion : word;
          MinorOperatingSystemVersion : word;
          MajorImageVersion : word;
          MajorImageVersion : word;
          MinorImageVersion : word;
          MinorImageVersion : word;
          MajorSubsystemVersion : word;
          MajorSubsystemVersion : word;
          MinorSubsystemVersion : word;
          MinorSubsystemVersion : word;
-         Win32Version : longint;
-         SizeOfImage : longint;
-         SizeOfHeaders : longint;
-         CheckSum : longint;
+         Win32Version : longword;
+         SizeOfImage : longword;
+         SizeOfHeaders : longword;
+         CheckSum : longword;
          Subsystem : word;
          Subsystem : word;
          DllCharacteristics : word;
          DllCharacteristics : word;
-         SizeOfStackReserve : aint;
-         SizeOfStackCommit : aint;
-         SizeOfHeapReserve : aint;
-         SizeOfHeapCommit : aint;
-         LoaderFlags : longint;
-         NumberOfRvaAndSizes : longint;
+         SizeOfStackReserve : aword;
+         SizeOfStackCommit : aword;
+         SizeOfHeapReserve : aword;
+         SizeOfHeapCommit : aword;
+         LoaderFlags : longword;
+         NumberOfRvaAndSizes : longword;
          DataDirectory : array[0..PE_DATADIR_ENTRIES-1] of tcoffpedatadir;
          DataDirectory : array[0..PE_DATADIR_ENTRIES-1] of tcoffpedatadir;
        end;
        end;
        tcoffsechdr = packed record
        tcoffsechdr = packed record
          name     : array[0..7] of char;
          name     : array[0..7] of char;
-         vsize    : longint;
-         rvaofs   : longint;
-         datasize : longint;
-         datapos  : longint;
-         relocpos : longint;
-         lineno1  : longint;
+         vsize    : longword;
+         rvaofs   : longword;
+         datasize : longword;
+         datapos  : longword;
+         relocpos : longword;
+         lineno1  : longword;
          nrelocs  : word;
          nrelocs  : word;
          lineno2  : word;
          lineno2  : word;
          flags    : longword;
          flags    : longword;
@@ -105,12 +105,12 @@ interface
        private
        private
          orgmempos,
          orgmempos,
          coffrelocs,
          coffrelocs,
-         coffrelocpos : aint;
+         coffrelocpos : aword;
        public
        public
-         secidx   : longint;
+         secidx   : longword;
          flags    : longword;
          flags    : longword;
          constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:shortint;Aoptions:TObjSectionOptions);override;
          constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:shortint;Aoptions:TObjSectionOptions);override;
-         procedure addsymsizereloc(ofs:aint;p:TObjSymbol;symsize:aint;reloctype:TObjRelocationType);
+         procedure addsymsizereloc(ofs:aword;p:TObjSymbol;symsize:aword;reloctype:TObjRelocationType);
          procedure fixuprelocs;override;
          procedure fixuprelocs;override;
        end;
        end;
 
 
@@ -133,7 +133,7 @@ interface
          destructor  destroy;override;
          destructor  destroy;override;
          procedure CreateDebugSections;override;
          procedure CreateDebugSections;override;
          function  sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
          function  sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
-         procedure writereloc(data,len:aint;p:TObjSymbol;reloctype:TObjRelocationType);override;
+         procedure writereloc(data,len:aword;p:TObjSymbol;reloctype:TObjRelocationType);override;
          procedure afteralloc;override;
          procedure afteralloc;override;
        end;
        end;
 
 
@@ -151,7 +151,7 @@ interface
          symidx  : longint;
          symidx  : longint;
          FCoffSyms,
          FCoffSyms,
          FCoffStrs : tdynamicarray;
          FCoffStrs : tdynamicarray;
-         procedure write_symbol(const name:string;value:aint;section:smallint;typ,aux:byte);
+         procedure write_symbol(const name:string;value:aword;section:smallint;typ,aux:byte);
          procedure section_write_symbol(p:TObject;arg:pointer);
          procedure section_write_symbol(p:TObject;arg:pointer);
          procedure section_write_relocs(p:TObject;arg:pointer);
          procedure section_write_relocs(p:TObject;arg:pointer);
          procedure create_symbols(data:TObjData);
          procedure create_symbols(data:TObjData);
@@ -185,7 +185,7 @@ interface
          FSecTbl   : ^TObjSectionArray;
          FSecTbl   : ^TObjSectionArray;
          win32     : boolean;
          win32     : boolean;
          function  GetSection(secidx:longint):TObjSection;
          function  GetSection(secidx:longint):TObjSection;
-         function  Read_str(strpos:longint):string;
+         function  Read_str(strpos:longword):string;
          procedure read_relocs(s:TCoffObjSection);
          procedure read_relocs(s:TCoffObjSection);
          procedure read_symbols(objdata:TObjData);
          procedure read_symbols(objdata:TObjData);
          procedure ObjSections_read_data(p:TObject;arg:pointer);
          procedure ObjSections_read_data(p:TObject;arg:pointer);
@@ -224,12 +224,12 @@ interface
          FCoffsyms,
          FCoffsyms,
          FCoffStrs : tdynamicarray;
          FCoffStrs : tdynamicarray;
          win32     : boolean;
          win32     : boolean;
-         nsects    : smallint;
+         nsects    : word;
          nsyms,
          nsyms,
-         sympos    : aint;
-         function  totalheadersize:longint;
+         sympos    : aword;
+         function  totalheadersize:longword;
          procedure ExeSectionList_pass2_header(p:TObject;arg:pointer);
          procedure ExeSectionList_pass2_header(p:TObject;arg:pointer);
-         procedure write_symbol(const name:string;value:aint;section:smallint;typ,aux:byte);
+         procedure write_symbol(const name:string;value:aword;section:smallint;typ,aux:byte);
          procedure globalsyms_write_symbol(p:TObject;arg:pointer);
          procedure globalsyms_write_symbol(p:TObject;arg:pointer);
          procedure ExeSectionList_write_header(p:TObject;arg:pointer);
          procedure ExeSectionList_write_header(p:TObject;arg:pointer);
          procedure ExeSectionList_write_data(p:TObject;arg:pointer);
          procedure ExeSectionList_write_data(p:TObject;arg:pointer);
@@ -249,7 +249,7 @@ interface
 
 
        TPECoffexeoutput = class(TCoffexeoutput)
        TPECoffexeoutput = class(TCoffexeoutput)
        private
        private
-         idatalabnr : longint;
+         idatalabnr : longword;
          procedure GenerateRelocs;
          procedure GenerateRelocs;
        public
        public
          constructor create;override;
          constructor create;override;
@@ -260,7 +260,7 @@ interface
 
 
        TObjSymbolrec = record
        TObjSymbolrec = record
          sym : TObjSymbol;
          sym : TObjSymbol;
-         orgsize : aint;
+         orgsize : aword;
        end;
        end;
        TObjSymbolArray = array[0..high(word)] of TObjSymbolrec;
        TObjSymbolArray = array[0..high(word)] of TObjSymbolrec;
        TObjSectionArray = array[0..high(smallint)] of TObjSection;
        TObjSectionArray = array[0..high(smallint)] of TObjSection;
@@ -455,19 +455,19 @@ implementation
          data_start : longint;
          data_start : longint;
        end;
        end;
        coffsectionrec=packed record
        coffsectionrec=packed record
-         len     : longint;
+         len     : longword;
          nrelocs : word;
          nrelocs : word;
          empty   : array[0..11] of char;
          empty   : array[0..11] of char;
        end;
        end;
        coffreloc=packed record
        coffreloc=packed record
-         address  : longint;
-         sym      : longint;
+         address  : longword;
+         sym      : longword;
          reloctype : word;
          reloctype : word;
        end;
        end;
        coffsymbol=packed record
        coffsymbol=packed record
          name    : array[0..3] of char; { real is [0..7], which overlaps the strpos ! }
          name    : array[0..3] of char; { real is [0..7], which overlaps the strpos ! }
-         strpos  : longint;
-         value   : longint;
+         strpos  : longword;
+         value   : longword;
          section : smallint;
          section : smallint;
          empty   : word;
          empty   : word;
          typ     : byte;
          typ     : byte;
@@ -763,7 +763,7 @@ const pemagic : array[0..3] of byte = (
       end;
       end;
 
 
 
 
-    procedure TCoffObjSection.addsymsizereloc(ofs:aint;p:TObjSymbol;symsize:aint;reloctype:TObjRelocationType);
+    procedure TCoffObjSection.addsymsizereloc(ofs:aword;p:TObjSymbol;symsize:aword;reloctype:TObjRelocationType);
       begin
       begin
         ObjRelocations.Add(TObjRelocation.createsymbolsize(ofs,p,symsize,reloctype));
         ObjRelocations.Add(TObjRelocation.createsymbolsize(ofs,p,symsize,reloctype));
       end;
       end;
@@ -774,7 +774,7 @@ const pemagic : array[0..3] of byte = (
         i,zero   : longint;
         i,zero   : longint;
         objreloc : TObjRelocation;
         objreloc : TObjRelocation;
         address,
         address,
-        relocval : aint;
+        relocval : aword;
         relocsec : TObjSection;
         relocsec : TObjSection;
       begin
       begin
         if (ObjRelocations.Count>0) and
         if (ObjRelocations.Count>0) and
@@ -980,10 +980,10 @@ const pemagic : array[0..3] of byte = (
       end;
       end;
 
 
 
 
-    procedure TCoffObjData.writereloc(data,len:aint;p:TObjSymbol;reloctype:TObjRelocationType);
+    procedure TCoffObjData.writereloc(data,len:aword;p:TObjSymbol;reloctype:TObjRelocationType);
       var
       var
         curraddr,
         curraddr,
-        symaddr : aint;
+        symaddr : aword;
       begin
       begin
         if CurrObjSec=nil then
         if CurrObjSec=nil then
           internalerror(200403072);
           internalerror(200403072);
@@ -1063,7 +1063,7 @@ const pemagic : array[0..3] of byte = (
 
 
     procedure TCoffObjData.afteralloc;
     procedure TCoffObjData.afteralloc;
       var
       var
-        mempos : aint;
+        mempos : aword;
         i      : longint;
         i      : longint;
       begin
       begin
         inherited afteralloc;
         inherited afteralloc;
@@ -1118,7 +1118,7 @@ const pemagic : array[0..3] of byte = (
       end;
       end;
 
 
 
 
-    procedure TCoffObjOutput.write_symbol(const name:string;value:aint;section:smallint;typ,aux:byte);
+    procedure TCoffObjOutput.write_symbol(const name:string;value:aword;section:smallint;typ,aux:byte);
       var
       var
         sym : coffsymbol;
         sym : coffsymbol;
       begin
       begin
@@ -1249,7 +1249,7 @@ const pemagic : array[0..3] of byte = (
         sectionval : word;
         sectionval : word;
         globalval  : byte;
         globalval  : byte;
         i          : longint;
         i          : longint;
-        value      : aint;
+        value      : aword;
         objsym     : TObjSymbol;
         objsym     : TObjSymbol;
       begin
       begin
         with TCoffObjData(data) do
         with TCoffObjData(data) do
@@ -1299,7 +1299,7 @@ const pemagic : array[0..3] of byte = (
 
 
     procedure TCoffObjOutput.section_set_datapos(p:TObject;arg:pointer);
     procedure TCoffObjOutput.section_set_datapos(p:TObject;arg:pointer);
       begin
       begin
-        TObjSection(p).setdatapos(paint(arg)^);
+        TObjSection(p).setdatapos(paword(arg)^);
       end;
       end;
 
 
 
 
@@ -1314,7 +1314,7 @@ const pemagic : array[0..3] of byte = (
       var
       var
         sechdr   : tcoffsechdr;
         sechdr   : tcoffsechdr;
         s        : string;
         s        : string;
-        strpos   : Aint;
+        strpos   : aword;
       begin
       begin
         with TCoffObjSection(p) do
         with TCoffObjSection(p) do
           begin
           begin
@@ -1372,7 +1372,7 @@ const pemagic : array[0..3] of byte = (
       var
       var
         orgdatapos,
         orgdatapos,
         datapos,
         datapos,
-        sympos   : aint;
+        sympos   : aword;
         i        : longint;
         i        : longint;
         gotreloc : boolean;
         gotreloc : boolean;
         header   : tcoffheader;
         header   : tcoffheader;
@@ -1495,7 +1495,7 @@ const pemagic : array[0..3] of byte = (
       end;
       end;
 
 
 
 
-    function TCoffObjInput.Read_str(strpos:longint):string;
+    function TCoffObjInput.Read_str(strpos:longword):string;
       begin
       begin
         FCoffStrs.Seek(strpos-4);
         FCoffStrs.Seek(strpos-4);
         FCoffStrs.Read(result[1],255);
         FCoffStrs.Read(result[1],255);
@@ -1922,7 +1922,7 @@ const pemagic : array[0..3] of byte = (
       end;
       end;
 
 
 
 
-    procedure TCoffexeoutput.write_symbol(const name:string;value:aint;section:smallint;typ,aux:byte);
+    procedure TCoffexeoutput.write_symbol(const name:string;value:aword;section:smallint;typ,aux:byte);
       var
       var
         sym : coffsymbol;
         sym : coffsymbol;
       begin
       begin
@@ -1981,7 +1981,7 @@ const pemagic : array[0..3] of byte = (
       var
       var
         sechdr   : tcoffsechdr;
         sechdr   : tcoffsechdr;
         s        : string;
         s        : string;
-        strpos   : Aint;
+        strpos   : aword;
       begin
       begin
         with tExeSection(p) do
         with tExeSection(p) do
           begin
           begin
@@ -2065,10 +2065,10 @@ const pemagic : array[0..3] of byte = (
       end;
       end;
 
 
 
 
-    function tcoffexeoutput.totalheadersize:longint;
+    function tcoffexeoutput.totalheadersize:longword;
       var
       var
         stubsize,
         stubsize,
-        optheadersize : longint;
+        optheadersize : longword;
       begin
       begin
         if win32 then
         if win32 then
           begin
           begin
@@ -2087,7 +2087,7 @@ const pemagic : array[0..3] of byte = (
     procedure tcoffexeoutput.MemPos_Header;
     procedure tcoffexeoutput.MemPos_Header;
       begin
       begin
         { calculate start positions after the headers }
         { calculate start positions after the headers }
-        currmempos:=totalheadersize+sizeof(tcoffsechdr)*(ExeSectionList.Count-2);
+        currmempos:=totalheadersize+sizeof(tcoffsechdr)*longword(ExeSectionList.Count-2);
       end;
       end;
 
 
 
 
@@ -2097,7 +2097,7 @@ const pemagic : array[0..3] of byte = (
         nsects:=0;
         nsects:=0;
         ExeSectionList.ForEachCall(@ExeSectionList_pass2_header,@nsects);
         ExeSectionList.ForEachCall(@ExeSectionList_pass2_header,@nsects);
         { calculate start positions after the headers }
         { calculate start positions after the headers }
-        currdatapos:=totalheadersize+sizeof(tcoffsechdr)*nsects;
+        currdatapos:=totalheadersize+longword(nsects)*sizeof(tcoffsechdr);
       end;
       end;
 
 
 
 
@@ -2113,7 +2113,7 @@ const pemagic : array[0..3] of byte = (
 
 
     function TCoffexeoutput.writedata:boolean;
     function TCoffexeoutput.writedata:boolean;
       var
       var
-        i           : longint;
+        i           : longword;
         header      : tcoffheader;
         header      : tcoffheader;
         djoptheader : coffdjoptheader;
         djoptheader : coffdjoptheader;
         peoptheader : tcoffpeoptheader;
         peoptheader : tcoffpeoptheader;
@@ -2547,13 +2547,13 @@ const pemagic : array[0..3] of byte = (
 
 
     procedure TPECoffexeoutput.GenerateRelocs;
     procedure TPECoffexeoutput.GenerateRelocs;
       var
       var
-        pgaddr, hdrpos : longint;
+        pgaddr, hdrpos : longword;
 
 
       procedure FinishBlock;
       procedure FinishBlock;
       var
       var
         p,len : longint;
         p,len : longint;
       begin
       begin
-        if hdrpos = -1 then
+        if hdrpos = longword(-1) then
           exit;
           exit;
         p:=0;
         p:=0;
         internalobjdata.writebytes(p,align(internalobjdata.CurrObjSec.size,4)-internalobjdata.CurrObjSec.size);
         internalobjdata.writebytes(p,align(internalobjdata.CurrObjSec.size,4)-internalobjdata.CurrObjSec.size);
@@ -2562,14 +2562,15 @@ const pemagic : array[0..3] of byte = (
         len:=p-hdrpos;
         len:=p-hdrpos;
         internalObjData.CurrObjSec.Data.write(len,4);
         internalObjData.CurrObjSec.Data.write(len,4);
         internalObjData.CurrObjSec.Data.seek(p);
         internalObjData.CurrObjSec.Data.seek(p);
-        hdrpos:=-1;
+        hdrpos:=longword(-1);
       end;
       end;
 
 
       var
       var
         exesec : TExeSection;
         exesec : TExeSection;
         objsec : TObjSection;
         objsec : TObjSection;
         objreloc : TObjRelocation;
         objreloc : TObjRelocation;
-        i,j,k,offset : longint;
+        i,j,k : longint;
+        offset : longword;
         w: word;
         w: word;
       begin
       begin
         if not RelocSection then
         if not RelocSection then
@@ -2579,8 +2580,8 @@ const pemagic : array[0..3] of byte = (
           exit;
           exit;
         objsec:=internalObjData.createsection('.reloc',0,exesec.SecOptions+[oso_data]);
         objsec:=internalObjData.createsection('.reloc',0,exesec.SecOptions+[oso_data]);
         exesec.AddObjSection(objsec);
         exesec.AddObjSection(objsec);
-        pgaddr:=-1;
-        hdrpos:=-1;
+        pgaddr:=longword(-1);
+        hdrpos:=longword(-1);
         for i:=0 to ExeSectionList.Count-1 do
         for i:=0 to ExeSectionList.Count-1 do
           begin
           begin
             exesec:=TExeSection(ExeSectionList[i]);
             exesec:=TExeSection(ExeSectionList[i]);
@@ -2598,7 +2599,7 @@ const pemagic : array[0..3] of byte = (
                     offset:=objsec.MemPos+objreloc.dataoffset;
                     offset:=objsec.MemPos+objreloc.dataoffset;
                     if offset<pgaddr then
                     if offset<pgaddr then
                       Internalerror(2007062701);
                       Internalerror(2007062701);
-                    if (offset-pgaddr>=4096) or (pgaddr=-1) then
+                    if (offset-pgaddr>=4096) or (pgaddr=longword(-1)) then
                       begin
                       begin
                         FinishBlock;
                         FinishBlock;
                         pgaddr:=(offset div 4096)*4096;
                         pgaddr:=(offset div 4096)*4096;
@@ -2693,7 +2694,7 @@ const pemagic : array[0..3] of byte = (
         Header    : TCoffHeader;
         Header    : TCoffHeader;
         peheader  : tcoffpeoptheader;
         peheader  : tcoffpeoptheader;
         NameOfs,
         NameOfs,
-        newheaderofs : longint;
+        newheaderofs : longword;
         FuncName  : string;
         FuncName  : string;
         expdir    : TPECoffExpDir;
         expdir    : TPECoffExpDir;
         i         : longint;
         i         : longint;
@@ -2765,7 +2766,7 @@ const pemagic : array[0..3] of byte = (
         DLLReader.Read(expdir,sizeof(expdir));
         DLLReader.Read(expdir,sizeof(expdir));
         for i:=0 to expdir.NumNames-1 do
         for i:=0 to expdir.NumNames-1 do
           begin
           begin
-            DLLReader.Seek(sechdr.datapos+longint(expdir.AddrNames)-sechdr.rvaofs+i*4);
+            DLLReader.Seek(sechdr.datapos+expdir.AddrNames-sechdr.rvaofs+i*4);
             DLLReader.Read(NameOfs,4);
             DLLReader.Read(NameOfs,4);
             Dec(NameOfs,sechdr.rvaofs);
             Dec(NameOfs,sechdr.rvaofs);
             if (NameOfs<0) or
             if (NameOfs<0) or

+ 3 - 3
compiler/ogelf.pas

@@ -57,7 +57,7 @@ interface
          destructor  destroy;override;
          destructor  destroy;override;
          function  sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
          function  sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
          procedure CreateDebugSections;override;
          procedure CreateDebugSections;override;
-         procedure writereloc(data,len:aint;p:TObjSymbol;reltype:TObjRelocationType);override;
+         procedure writereloc(data,len:aword;p:TObjSymbol;reltype:TObjRelocationType);override;
        end;
        end;
 
 
        TElfObjectOutput = class(tObjOutput)
        TElfObjectOutput = class(tObjOutput)
@@ -646,7 +646,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TElfObjData.writereloc(data,len:aint;p:TObjSymbol;reltype:TObjRelocationType);
+    procedure TElfObjData.writereloc(data,len:aword;p:TObjSymbol;reltype:TObjRelocationType);
       var
       var
         symaddr : longint;
         symaddr : longint;
       begin
       begin
@@ -985,7 +985,7 @@ implementation
 
 
     procedure TElfObjectOutput.section_set_datapos(p:TObject;arg:pointer);
     procedure TElfObjectOutput.section_set_datapos(p:TObject;arg:pointer);
       begin
       begin
-        TObjSection(p).setdatapos(paint(arg)^);
+        TObjSection(p).setdatapos(paword(arg)^);
       end;
       end;
 
 
 
 

+ 1 - 1
compiler/ogmap.pas

@@ -36,7 +36,7 @@ interface
        texemap = class
        texemap = class
        private
        private
          t : text;
          t : text;
-         FImageBase : aint;
+         FImageBase : aword;
        public
        public
          constructor Create(const s:string);
          constructor Create(const s:string);
          destructor Destroy;override;
          destructor Destroy;override;

+ 2 - 2
compiler/owar.pas

@@ -46,7 +46,7 @@ type
     function  createfile(const fn:string):boolean;override;
     function  createfile(const fn:string):boolean;override;
     procedure closefile;override;
     procedure closefile;override;
     procedure writesym(const sym:string);override;
     procedure writesym(const sym:string);override;
-    procedure write(const b;len:longint);override;
+    procedure write(const b;len:longword);override;
   private
   private
     arfn        : string;
     arfn        : string;
     arhdr       : tarhdr;
     arhdr       : tarhdr;
@@ -252,7 +252,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure tarobjectwriter.write(const b;len:longint);
+    procedure tarobjectwriter.write(const b;len:longword);
       begin
       begin
         inc(fobjsize,len);
         inc(fobjsize,len);
         inc(fsize,len);
         inc(fsize,len);

+ 9 - 9
compiler/owbase.pas

@@ -34,22 +34,22 @@ type
     f      : TCFileStream;
     f      : TCFileStream;
     opened : boolean;
     opened : boolean;
     buf    : pchar;
     buf    : pchar;
-    bufidx : longint;
+    bufidx : longword;
     procedure writebuf;
     procedure writebuf;
   protected
   protected
     fsize,
     fsize,
-    fobjsize  : longint;
+    fobjsize  : longword;
   public
   public
     constructor create;
     constructor create;
     destructor  destroy;override;
     destructor  destroy;override;
     function  createfile(const fn:string):boolean;virtual;
     function  createfile(const fn:string):boolean;virtual;
     procedure closefile;virtual;
     procedure closefile;virtual;
     procedure writesym(const sym:string);virtual;
     procedure writesym(const sym:string);virtual;
-    procedure write(const b;len:longint);virtual;
-    procedure WriteZeros(l:longint);
+    procedure write(const b;len:longword);virtual;
+    procedure WriteZeros(l:longword);
     procedure writearray(a:TDynamicArray);
     procedure writearray(a:TDynamicArray);
-    property Size:longint read FSize;
-    property ObjSize:longint read FObjSize;
+    property Size:longword read FSize;
+    property ObjSize:longword read FObjSize;
   end;
   end;
 
 
   tobjectreader=class
   tobjectreader=class
@@ -151,11 +151,11 @@ begin
 end;
 end;
 
 
 
 
-procedure tobjectwriter.write(const b;len:longint);
+procedure tobjectwriter.write(const b;len:longword);
 var
 var
   p   : pchar;
   p   : pchar;
   bufleft,
   bufleft,
-  idx : longint;
+  idx : longword;
 begin
 begin
   inc(fsize,len);
   inc(fsize,len);
   inc(fobjsize,len);
   inc(fobjsize,len);
@@ -182,7 +182,7 @@ begin
 end;
 end;
 
 
 
 
-procedure tobjectwriter.WriteZeros(l:longint);
+procedure tobjectwriter.WriteZeros(l:longword);
 var
 var
   empty : array[0..1023] of byte;
   empty : array[0..1023] of byte;
 begin
 begin

+ 2 - 2
compiler/verbose.pas

@@ -853,8 +853,8 @@ end;
         FillChar(Status,sizeof(TCompilerStatus),0);
         FillChar(Status,sizeof(TCompilerStatus),0);
         status.verbosity:=V_Default;
         status.verbosity:=V_Default;
         Status.MaxErrorCount:=50;
         Status.MaxErrorCount:=50;
-        Status.codesize:=-1;
-        Status.datasize:=-1;
+        Status.codesize:=aword(-1);
+        Status.datasize:=aword(-1);
         Loadprefixes;
         Loadprefixes;
         lastfileidx:=-1;
         lastfileidx:=-1;
         lastmoduleidx:=-1;
         lastmoduleidx:=-1;

+ 1 - 1
compiler/x86/aasmcpu.pas

@@ -1965,7 +1965,7 @@ implementation
         ea_data : ea;
         ea_data : ea;
       begin
       begin
         { safety check }
         { safety check }
-        if objdata.currobjsec.size<>insoffset then
+        if objdata.currobjsec.size<>longword(insoffset) then
            internalerror(200130121);
            internalerror(200130121);
         { load data to write }
         { load data to write }
         codes:=insentry^.code;
         codes:=insentry^.code;