Browse Source

* changed type used for section alignment from byte/shortint to longint, so the
internal object writer and the internal linker support object files with
sections with alignment >=256

git-svn-id: trunk@37518 -

nickysn 7 years ago
parent
commit
2af5c9d508

+ 5 - 5
compiler/aasmtai.pas

@@ -564,7 +564,7 @@ interface
        tai_section = class(tai)
           sectype  : TAsmSectiontype;
           secorder : TasmSectionorder;
-          secalign : byte;
+          secalign : longint;
           name     : pshortstring;
           sec      : TObjSection; { used in binary writer }
           destructor Destroy;override;
@@ -574,7 +574,7 @@ interface
          private
           { this constructor is made private on purpose }
           { because sections should be created via new_section() }
-          constructor Create(Asectype:TAsmSectiontype;const Aname:string;Aalign:byte;Asecorder:TasmSectionorder=secorder_default);
+          constructor Create(Asectype:TAsmSectiontype;const Aname:string;Aalign:longint;Asecorder:TasmSectionorder=secorder_default);
 {$pop}
        end;
 
@@ -1170,7 +1170,7 @@ implementation
                              TAI_SECTION
  ****************************************************************************}
 
-    constructor tai_section.Create(Asectype:TAsmSectiontype;const Aname:string;Aalign:byte;Asecorder:TasmSectionorder=secorder_default);
+    constructor tai_section.Create(Asectype:TAsmSectiontype;const Aname:string;Aalign:longint;Asecorder:TasmSectionorder=secorder_default);
       begin
         inherited Create;
         typ:=ait_section;
@@ -1186,7 +1186,7 @@ implementation
       begin
         inherited ppuload(t,ppufile);
         sectype:=TAsmSectiontype(ppufile.getbyte);
-        secalign:=ppufile.getbyte;
+        secalign:=ppufile.getlongint;
         name:=ppufile.getpshortstring;
         sec:=nil;
       end;
@@ -1202,7 +1202,7 @@ implementation
       begin
         inherited ppuwrite(ppufile);
         ppufile.putbyte(byte(sectype));
-        ppufile.putbyte(secalign);
+        ppufile.putlongint(secalign);
         ppufile.putstring(name^);
       end;
 

+ 4 - 4
compiler/aggas.pas

@@ -48,8 +48,8 @@ interface
         function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;virtual;
         function sectionattrs(atype:TAsmSectiontype):string;virtual;
         function sectionattrs_coff(atype:TAsmSectiontype):string;virtual;
-        function sectionalignment_aix(atype:TAsmSectiontype;secalign: byte):string;
-        procedure WriteSection(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder;secalign:byte);virtual;
+        function sectionalignment_aix(atype:TAsmSectiontype;secalign: longint):string;
+        procedure WriteSection(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder;secalign:longint);virtual;
         procedure WriteExtraHeader;virtual;
         procedure WriteExtraFooter;virtual;
         procedure WriteInstruction(hp: tai);
@@ -441,7 +441,7 @@ implementation
       end;
 
 
-    function TGNUAssembler.sectionalignment_aix(atype:TAsmSectiontype;secalign: byte): string;
+    function TGNUAssembler.sectionalignment_aix(atype:TAsmSectiontype;secalign: longint): string;
       var
         l: longint;
       begin
@@ -457,7 +457,7 @@ implementation
       end;
 
 
-    procedure TGNUAssembler.WriteSection(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder;secalign:byte);
+    procedure TGNUAssembler.WriteSection(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder;secalign:longint);
       var
         s : string;
       begin

+ 4 - 4
compiler/cutils.pas

@@ -72,9 +72,9 @@ interface
 
     function next_prime(l: longint): longint;
 
-    function used_align(varalign,minalign,maxalign:shortint):shortint;
+    function used_align(varalign,minalign,maxalign:longint):longint;
     function isbetteralignedthan(new, org, limit: cardinal): boolean;
-    function size_2_align(len : longint) : shortint;
+    function size_2_align(len : longint) : longint;
     function packedbitsloadsize(bitlen: int64) : int64;
     procedure Replace(var s:string;s1:string;const s2:string);
     procedure Replace(var s:AnsiString;s1:string;const s2:AnsiString);
@@ -341,7 +341,7 @@ implementation
       end;
 
 
-    function size_2_align(len : longint) : shortint;
+    function size_2_align(len : longint) : longint;
       begin
          if len>16 then
            size_2_align:=32
@@ -435,7 +435,7 @@ implementation
       end;
 
 
-    function used_align(varalign,minalign,maxalign:shortint):shortint;
+    function used_align(varalign,minalign,maxalign:longint):longint;
       begin
         { varalign  : minimum alignment required for the variable
           minalign  : Minimum alignment of this structure, 0 = undefined

+ 10 - 10
compiler/ogbase.pas

@@ -275,7 +275,7 @@ interface
        ObjData    : TObjData;
        index      : longword;  { index of section in section headers }
        SecSymIdx  : longint;   { index for the section in symtab }
-       SecAlign   : shortint;   { alignment of the section }
+       SecAlign   : longint;   { alignment of the section }
        { section Data }
        Size,
        DataPos    : PUInt;
@@ -290,7 +290,7 @@ interface
        ExeSection  : TExeSection;
        USed        : Boolean;
        VTRefList : TFPObjectList;
-       constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:shortint;Aoptions:TObjSectionOptions);virtual;
+       constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:longint;Aoptions:TObjSectionOptions);virtual;
        destructor  destroy;override;
        function  write(const d;l:PUInt):PUInt;
        { writes string plus zero byte }
@@ -369,9 +369,9 @@ interface
        { Sections }
        function  sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;virtual;abstract;
        function  sectiontype2options(atype:TAsmSectiontype):TObjSectionOptions;virtual;
-       function  sectiontype2align(atype:TAsmSectiontype):shortint;virtual;
+       function  sectiontype2align(atype:TAsmSectiontype):longint;virtual;
        function  createsection(atype:TAsmSectionType;const aname:string='';aorder:TAsmSectionOrder=secorder_default):TObjSection;virtual;
-       function  createsection(const aname:string;aalign:shortint;aoptions:TObjSectionOptions;DiscardDuplicate:boolean=true):TObjSection;virtual;
+       function  createsection(const aname:string;aalign:longint;aoptions:TObjSectionOptions;DiscardDuplicate:boolean=true):TObjSection;virtual;
        function  createsectiongroup(const aname:string):TObjSectionGroup;
        procedure CreateDebugSections;virtual;
        function  findsection(const aname:string):TObjSection;
@@ -385,7 +385,7 @@ interface
        procedure ResetCachedAsmSymbols;
        { Allocation }
        procedure alloc(len:aword);
-       procedure allocalign(len:shortint);
+       procedure allocalign(len:longint);
        procedure writebytes(const Data;len:aword);
        procedure writeReloc(Data:TRelocDataInt;len:aword;p:TObjSymbol;Reloctype:TObjRelocationType);virtual;abstract;
        procedure beforealloc;virtual;
@@ -507,7 +507,7 @@ interface
         Size,
         DataPos,
         MemPos     : qword;
-        SecAlign   : shortint;
+        SecAlign   : longint;
         Disabled   : boolean;
         SecOptions : TObjSectionOptions;
         constructor create(AList:TFPHashObjectList;const AName:string);virtual;
@@ -901,7 +901,7 @@ implementation
                               TObjSection
 ****************************************************************************}
 
-    constructor TObjSection.create(AList:TFPHashObjectList;const Aname:string;Aalign:shortint;Aoptions:TObjSectionOptions);
+    constructor TObjSection.create(AList:TFPHashObjectList;const Aname:string;Aalign:longint;Aoptions:TObjSectionOptions);
       begin
         inherited Create(AList,Aname);
         { Data }
@@ -1237,7 +1237,7 @@ implementation
       end;
 
 
-    function TObjData.sectiontype2align(atype:TAsmSectiontype):shortint;
+    function TObjData.sectiontype2align(atype:TAsmSectiontype):longint;
       begin
         case atype of
           sec_stabstr,sec_debug_info,sec_debug_line,sec_debug_abbrev,sec_debug_aranges,sec_debug_ranges:
@@ -1266,7 +1266,7 @@ implementation
       end;
 
 
-    function TObjData.createsection(const aname:string;aalign:shortint;aoptions:TObjSectionOptions;DiscardDuplicate:boolean):TObjSection;
+    function TObjData.createsection(const aname:string;aalign:longint;aoptions:TObjSectionOptions;DiscardDuplicate:boolean):TObjSection;
       begin
         if DiscardDuplicate then
           result:=TObjSection(FObjSectionList.Find(aname))
@@ -1415,7 +1415,7 @@ implementation
       end;
 
 
-    procedure TObjData.allocalign(len:shortint);
+    procedure TObjData.allocalign(len:longint);
       begin
         if not assigned(CurrObjSec) then
           internalerror(200402253);

+ 34 - 6
compiler/ogcoff.pas

@@ -119,7 +119,7 @@ interface
          coffrelocs,
          coffrelocpos : aword;
        public
-         constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:shortint;Aoptions:TObjSectionOptions);override;
+         constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:longint;Aoptions:TObjSectionOptions);override;
          procedure writereloc_internal(aTarget:TObjSection;offset:aword;len:byte;reltype:TObjRelocationType);override;
        end;
 
@@ -379,6 +379,13 @@ implementation
        PE_SCN_ALIGN_16BYTES          = $00500000; { Default alignment if no others are specified. }
        PE_SCN_ALIGN_32BYTES          = $00600000;
        PE_SCN_ALIGN_64BYTES          = $00700000;
+       PE_SCN_ALIGN_128BYTES         = $00800000;
+       PE_SCN_ALIGN_256BYTES         = $00900000;
+       PE_SCN_ALIGN_512BYTES         = $00A00000;
+       PE_SCN_ALIGN_1024BYTES        = $00B00000;
+       PE_SCN_ALIGN_2048BYTES        = $00C00000;
+       PE_SCN_ALIGN_4096BYTES        = $00D00000;
+       PE_SCN_ALIGN_8192BYTES        = $00E00000;
        PE_SCN_LNK_NRELOC_OVFL        = $01000000; { Section contains extended relocations. }
        PE_SCN_MEM_NOT_CACHED         = $04000000; { Section is not cachable.               }
        PE_SCN_MEM_NOT_PAGED          = $08000000; { Section is not pageable.               }
@@ -778,7 +785,7 @@ const pemagic : array[0..3] of byte = (
       end;
 
 
-    function peencodesechdrflags(aoptions:TObjSectionOptions;aalign:shortint):longword;
+    function peencodesechdrflags(aoptions:TObjSectionOptions;aalign:longint):longword;
       begin
         if oso_executable in aoptions then
           result:=PE_SCN_CNT_CODE or PE_SCN_MEM_EXECUTE
@@ -803,12 +810,19 @@ const pemagic : array[0..3] of byte = (
           16 : result:=result or PE_SCN_ALIGN_16BYTES;
           32 : result:=result or PE_SCN_ALIGN_32BYTES;
           64 : result:=result or PE_SCN_ALIGN_64BYTES;
+         128 : result:=result or PE_SCN_ALIGN_128BYTES;
+         256 : result:=result or PE_SCN_ALIGN_256BYTES;
+         512 : result:=result or PE_SCN_ALIGN_512BYTES;
+        1024 : result:=result or PE_SCN_ALIGN_1024BYTES;
+        2048 : result:=result or PE_SCN_ALIGN_2048BYTES;
+        4096 : result:=result or PE_SCN_ALIGN_4096BYTES;
+        8192 : result:=result or PE_SCN_ALIGN_8192BYTES;
           else result:=result or PE_SCN_ALIGN_16BYTES;
         end;
       end;
 
 
-    procedure pedecodesechdrflags(const aname:string;flags:longword;out aoptions:TObjSectionOptions;out aalign:shortint);
+    procedure pedecodesechdrflags(const aname:string;flags:longword;out aoptions:TObjSectionOptions;out aalign:longint);
       var
         alignflag : longword;
       begin
@@ -828,7 +842,21 @@ const pemagic : array[0..3] of byte = (
           include(aoptions,oso_write);
         { alignment }
         alignflag:=flags and PE_SCN_ALIGN_MASK;
-        if alignflag=PE_SCN_ALIGN_64BYTES then
+        if alignflag=PE_SCN_ALIGN_8192BYTES then
+          aalign:=8192
+        else if alignflag=PE_SCN_ALIGN_4096BYTES then
+          aalign:=4096
+        else if alignflag=PE_SCN_ALIGN_2048BYTES then
+          aalign:=2048
+        else if alignflag=PE_SCN_ALIGN_1024BYTES then
+          aalign:=1024
+        else if alignflag=PE_SCN_ALIGN_512BYTES then
+          aalign:=512
+        else if alignflag=PE_SCN_ALIGN_256BYTES then
+          aalign:=256
+        else if alignflag=PE_SCN_ALIGN_128BYTES then
+          aalign:=128
+        else if alignflag=PE_SCN_ALIGN_64BYTES then
           aalign:=64
         else if alignflag=PE_SCN_ALIGN_32BYTES then
           aalign:=32
@@ -853,7 +881,7 @@ const pemagic : array[0..3] of byte = (
                                TCoffObjSection
 ****************************************************************************}
 
-    constructor TCoffObjSection.create(AList:TFPHashObjectList;const aname:string;aalign:shortint;aoptions:TObjSectionOptions);
+    constructor TCoffObjSection.create(AList:TFPHashObjectList;const aname:string;aalign:longint;aoptions:TObjSectionOptions);
       begin
         inherited create(AList,aname,aalign,aoptions);
       end;
@@ -2032,7 +2060,7 @@ const pemagic : array[0..3] of byte = (
 
     function  TCoffObjInput.ReadObjData(AReader:TObjectreader;out objdata:TObjData):boolean;
       var
-        secalign : shortint;
+        secalign : longint;
         secofs,
         strpos,
         i        : longint;

+ 4 - 4
compiler/ogelf.pas

@@ -53,8 +53,8 @@ interface
           shlink,
           shinfo,
           shentsize : longint;
-          constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:shortint;Aoptions:TObjSectionOptions);override;
-          constructor create_ext(aobjdata:TObjData;const Aname:string;Ashtype,Ashflags:longint;Aalign:shortint;Aentsize:longint);
+          constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:longint;Aoptions:TObjSectionOptions);override;
+          constructor create_ext(aobjdata:TObjData;const Aname:string;Ashtype,Ashflags:longint;Aalign:longint;Aentsize:longint);
           constructor create_reloc(aobjdata:TObjData;const Aname:string;allocflag:boolean);
           procedure writeReloc_internal(aTarget:TObjSection;offset:aword;len:byte;reltype:TObjRelocationType);override;
        end;
@@ -668,7 +668,7 @@ implementation
                                TElfObjSection
 ****************************************************************************}
 
-    constructor TElfObjSection.create(AList:TFPHashObjectList;const Aname:string;Aalign:shortint;Aoptions:TObjSectionOptions);
+    constructor TElfObjSection.create(AList:TFPHashObjectList;const Aname:string;Aalign:longint;Aoptions:TObjSectionOptions);
       begin
         inherited create(AList,Aname,Aalign,aoptions);
         index:=0;
@@ -681,7 +681,7 @@ implementation
       end;
 
 
-    constructor TElfObjSection.create_ext(aobjdata:TObjData;const Aname:string;Ashtype,Ashflags:longint;Aalign:shortint;Aentsize:longint);
+    constructor TElfObjSection.create_ext(aobjdata:TObjData;const Aname:string;Ashtype,Ashflags:longint;Aalign:longint;Aentsize:longint);
       var
         aoptions : TObjSectionOptions;
       begin

+ 4 - 4
compiler/ogmacho.pas

@@ -63,7 +63,7 @@ type
         machoSec  : TMachoSectionType;
         function GetRelocCount: Integer;
         function FileSize: Integer;
-        constructor create(AList:TFPHashObjectList; const Aname:string; Aalign:shortint; Aoptions:TObjSectionOptions);override;
+        constructor create(AList:TFPHashObjectList; const Aname:string; Aalign:longint; Aoptions:TObjSectionOptions);override;
       end;
 
     { TmachoObjData }
@@ -74,7 +74,7 @@ type
         constructor create(const n:string); override;
         procedure CreateDebugSections; override;
         function sectionname(atype:TAsmSectiontype; const aname:string; aorder:TAsmSectionOrder):string;override;
-        function sectiontype2align(atype:TAsmSectiontype):shortint;override;
+        function sectiontype2align(atype:TAsmSectiontype):longint;override;
         function sectiontype2options(atype:TAsmSectiontype):TObjSectionOptions;override;
         procedure writereloc(data:aint; len:aword; p:TObjSymbol; reltype:TObjRelocationType);override;
       public
@@ -329,7 +329,7 @@ uses
     end;
 
 
-  function TmachoObjData.sectiontype2align(atype: TAsmSectiontype): shortint;
+  function TmachoObjData.sectiontype2align(atype: TAsmSectiontype): longint;
     begin
       case atype of
         sec_bss:
@@ -1210,7 +1210,7 @@ uses
 
 
   constructor TmachoObjSection.create(AList: TFPHashObjectList;
-    const Aname: string; Aalign: shortint; Aoptions: TObjSectionOptions);
+    const Aname: string; Aalign: longint; Aoptions: TObjSectionOptions);
     begin
       if Aname = '__TEXT __textcoal_nt' then
         Aalign:=4;

+ 2 - 2
compiler/ognlm.pas

@@ -314,7 +314,7 @@ const NLM_MAX_DESCRIPTION_LENGTH = 127;
        end;
 
       TNLMCoffObjSection = class(TCoffObjSection)
-         constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:shortint;Aoptions:TObjSectionOptions);override;
+         constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:longint;Aoptions:TObjSectionOptions);override;
        end;
 
 implementation
@@ -1452,7 +1452,7 @@ function SecOpts(SecOptions:TObjSectionOptions):string;
                                TNLMoffObjSection
 ****************************************************************************}
 
-    constructor TNLMCoffObjSection.create(AList:TFPHashObjectList;const aname:string;aalign:shortint;aoptions:TObjSectionOptions);
+    constructor TNLMCoffObjSection.create(AList:TFPHashObjectList;const aname:string;aalign:longint;aoptions:TObjSectionOptions);
       begin
         inherited create(alist,aname,aalign,aoptions);
       end;

+ 12 - 11
compiler/ogomf.pas

@@ -80,7 +80,7 @@ interface
         FMZExeUnifiedLogicalSegment: TMZExeUnifiedLogicalSegment;
         function GetOmfAlignment: TOmfSegmentAlignment;
       public
-        constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:shortint;Aoptions:TObjSectionOptions);override;
+        constructor create(AList:TFPHashObjectList;const Aname:string;Aalign:longint;Aoptions:TObjSectionOptions);override;
         function MemPosStr(AImageBase: qword): string;override;
         property ClassName: string read FClassName;
         property OverlayName: string read FOverlayName;
@@ -100,7 +100,7 @@ interface
       public
         constructor create(const n:string);override;
         function sectiontype2options(atype:TAsmSectiontype):TObjSectionOptions;override;
-        function sectiontype2align(atype:TAsmSectiontype):shortint;override;
+        function sectiontype2align(atype:TAsmSectiontype):longint;override;
         function sectiontype2class(atype:TAsmSectiontype):string;
         function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
         function createsection(atype:TAsmSectionType;const aname:string='';aorder:TAsmSectionOrder=secorder_default):TObjSection;override;
@@ -466,13 +466,17 @@ implementation
             result:=saRelocatableDWordAligned;
           16:
             result:=saRelocatableParaAligned;
+          256:
+            result:=saRelocatablePageAligned;
+          4096:
+            result:=saNotSupported;
           else
             internalerror(2015041504);
         end;
       end;
 
     constructor TOmfObjSection.create(AList: TFPHashObjectList;
-          const Aname: string; Aalign: shortint; Aoptions: TObjSectionOptions);
+          const Aname: string; Aalign: longint; Aoptions: TObjSectionOptions);
       begin
         inherited create(AList, Aname, Aalign, Aoptions);
         FCombination:=scPublic;
@@ -521,7 +525,7 @@ implementation
           Result:=Result+[oso_data,oso_sparse_data];
       end;
 
-    function TOmfObjData.sectiontype2align(atype: TAsmSectiontype): shortint;
+    function TOmfObjData.sectiontype2align(atype: TAsmSectiontype): longint;
       begin
         Result:=omf_sectiontype2align(atype);
       end;
@@ -1088,7 +1092,7 @@ implementation
       var
         SegDefRec: TOmfRecord_SEGDEF;
         SegmentName,SegClassName,OverlayName: string;
-        SecAlign: ShortInt;
+        SecAlign: LongInt;
         secoptions: TObjSectionOptions;
         objsec: TOmfObjSection;
       begin
@@ -1127,18 +1131,15 @@ implementation
           saRelocatableDWordAligned:
             SecAlign:=4;
           saRelocatablePageAligned:
-            begin
-              InputError('Page segment alignment not supported');
-              SegDefRec.Free;
-              exit;
-            end;
+            SecAlign:=256;
+          saNotSupported:
+            SecAlign:=4096;
           saAbsolute:
             begin
               InputError('Absolute segment alignment not supported');
               SegDefRec.Free;
               exit;
             end;
-          saNotSupported,
           saNotDefined:
             begin
               InputError('Invalid (unsupported/undefined) OMF segment alignment');

+ 3 - 3
compiler/omfbase.pas

@@ -167,7 +167,7 @@ interface
       saRelocatableParaAligned  = 3,
       saRelocatablePageAligned  = 4,  { 32-bit linkers extension }
       saRelocatableDWordAligned = 5,  { 32-bit linkers extension }
-      saNotSupported            = 6,
+      saNotSupported            = 6,  { PharLap: 4096-byte page alignment }
       saNotDefined              = 7);
     TOmfSegmentCombination = (
       scPrivate   = 0,
@@ -1107,7 +1107,7 @@ interface
 
   { OMF segment class names for the object sections, produced by the FPC code generator }
   function omf_segclass(atype:TAsmSectiontype):string;
-  function omf_sectiontype2align(atype:TAsmSectiontype):shortint;
+  function omf_sectiontype2align(atype:TAsmSectiontype):longint;
   { returns whether the specified section type belongs to the group DGROUP in
     the current memory model. DGROUP is the segment group pointed by DS }
   function section_belongs_to_dgroup(atype:TAsmSectiontype): Boolean;
@@ -2301,7 +2301,7 @@ implementation
 {$endif i8086}
     end;
 
-  function omf_sectiontype2align(atype: TAsmSectiontype): shortint;
+  function omf_sectiontype2align(atype: TAsmSectiontype): longint;
     begin
       case atype of
         sec_stabstr:

+ 4 - 4
compiler/ppcgen/agppcgas.pas

@@ -54,11 +54,11 @@ unit agppcgas;
     end;
 
     TPPCAIXAssembler=class(TPPCGNUAssembler)
-      max_alignment : array[TAsmSectionType] of byte;
+      max_alignment : array[TAsmSectionType] of longint;
       constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
      protected
       function sectionname(atype: TAsmSectiontype; const aname: string; aorder: TAsmSectionOrder): string; override;
-      procedure WriteSection(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder;secalign:byte); override;
+      procedure WriteSection(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder;secalign:longint); override;
       procedure WriteAsmList; override;
       procedure WriteExtraHeader; override;
       procedure WriteExtraFooter; override;
@@ -480,7 +480,7 @@ unit agppcgas;
            max_alignment[cur_sectype]:=8;
       end;
 
-    procedure TPPCAIXAssembler.WriteSection(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder;secalign:byte);
+    procedure TPPCAIXAssembler.WriteSection(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder;secalign:longint);
 
       begin
         secalign:=max_alignment[atype];
@@ -493,7 +493,7 @@ unit agppcgas;
         cur_list : TAsmList;
         hal : tasmlisttype;
         hp : tai;
-        max_al : byte;
+        max_al : longint;
       begin
         { Parse all asmlists to get maximum alignement used for all types }
         for hal:=low(TasmlistType) to high(TasmlistType) do

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion = 195;
+  CurrentPPUVersion = 196;
 
 { unit flags }
   uf_init                = $000001; { unit has initialization section }

+ 1 - 1
compiler/x86/agx86int.pas

@@ -265,7 +265,7 @@ implementation
       end;
 
     { MASM supports aligns up to 8192 }
-    function alignstr(b : integer) : string;
+    function alignstr(b : longint) : string;
       begin
         case b of
           1: result:='BYTE';

+ 3 - 3
compiler/x86/agx86nsm.pas

@@ -43,7 +43,7 @@ interface
         procedure WriteReference(var ref : treference);
         procedure WriteOper(const o:toper;s : topsize; opcode: tasmop;ops:longint;dest : boolean);
         procedure WriteOper_jmp(const o:toper; ai : taicpu);
-        procedure WriteSection(atype:TAsmSectiontype;const aname:string;alignment : byte);
+        procedure WriteSection(atype:TAsmSectiontype;const aname:string;alignment : longint);
         procedure ResetSectionsList;
         procedure WriteGroups;
       protected
@@ -462,7 +462,7 @@ interface
       );
 
     procedure TX86NasmAssembler.WriteSection(atype : TAsmSectiontype;
-      const aname : string; alignment : byte);
+      const aname : string; alignment : longint);
       const
         secnames : array[TAsmSectiontype] of string[length('__DATA, __datacoal_nt,coalesced')] = ('','',
           '.text',
@@ -630,7 +630,7 @@ interface
       quoted   : boolean;
       fixed_opcode: TAsmOp;
       prefix, LastSecName  : string;
-      LastAlign : Byte;
+      LastAlign : LongInt;
       cpu: tcputype;
       prevfileinfo : tfileposinfo;
       previnfile : tinputfile;