浏览代码

* put typedconsts in own asmlist to prevent mixing
array and string data
* added al_rodata
* renamed tasmlist enum names to include al_ prefix

git-svn-id: trunk@899 -

peter 20 年之前
父节点
当前提交
05a628447f

+ 1 - 0
.gitattributes

@@ -6162,6 +6162,7 @@ tests/webtbs/tw4240.pp svneol=native#text/plain
 tests/webtbs/tw4247.pp svneol=native#text/plain
 tests/webtbs/tw4247.pp svneol=native#text/plain
 tests/webtbs/tw4253.pp svneol=native#text/plain
 tests/webtbs/tw4253.pp svneol=native#text/plain
 tests/webtbs/tw4260.pp svneol=native#text/plain
 tests/webtbs/tw4260.pp svneol=native#text/plain
+tests/webtbs/tw4277.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 1 - 1
compiler/aasmbase.pas

@@ -268,7 +268,7 @@ implementation
         inusedlist:=false;
         inusedlist:=false;
         pass:=255;
         pass:=255;
         ppuidx:=-1;
         ppuidx:=-1;
-        { mainly used to remove unused labels from the codesegment }
+        { mainly used to remove unused labels from the al_code }
         refs:=0;
         refs:=0;
       end;
       end;
 
 

+ 13 - 4
compiler/aasmtai.pas

@@ -576,11 +576,20 @@ interface
        end;
        end;
 
 
        Tasmlist=({ default lists }
        Tasmlist=({ default lists }
-                 datasegment,codesegment,bsssegment,debuglist,consts,
-                 threadvarsegment,withdebuglist,importsection,exportsection,
-                 resourcesection,rttilist,dwarflist,
+                 al_code,al_bss,al_data,al_rodata,
+                 al_typedconsts,al_rotypedconsts,
+                 al_debug,al_threadvars,al_withdebug,al_imports,al_exports,
+                 al_resources,al_rtti,al_dwarf,
                  { data used by pic code }
                  { data used by pic code }
-                 picdata,resourcestrings);
+                 al_picdata,al_resourcestrings);
+    const
+       TasmlistStr : array[tasmlist] of string[24] =({ default lists }
+           'al_code','al_bss','al_data','al_rodata',
+           'al_typedconsts','al_rotypedconsts',
+           'al_debug','al_threadvars','al_withdebug','al_imports','al_exports',
+           'al_resources','al_rtti','al_dwarf',
+           { data used by pic code }
+           'al_picdata','al_resourcestrings');
 
 
     var
     var
       { array with all class types for tais }
       { array with all class types for tais }

+ 11 - 20
compiler/aggas.pas

@@ -364,12 +364,13 @@ var
     begin
     begin
       if not assigned(p) then
       if not assigned(p) then
        exit;
        exit;
+
       last_align := 2;
       last_align := 2;
       InlineLevel:=0;
       InlineLevel:=0;
-      { lineinfo is only needed for codesegment (PFV) }
+      { lineinfo is only needed for al_code (PFV) }
       do_line:=(cs_asm_source in aktglobalswitches) or
       do_line:=(cs_asm_source in aktglobalswitches) or
                ((cs_lineinfo in aktmoduleswitches)
                ((cs_lineinfo in aktmoduleswitches)
-                 and (p=asmlist[codesegment]));
+                 and (p=asmlist[al_code]));
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
        begin
        begin
@@ -935,7 +936,7 @@ var
 {$ifdef GDB}
 {$ifdef GDB}
       fileinfo : tfileposinfo;
       fileinfo : tfileposinfo;
 {$endif GDB}
 {$endif GDB}
-
+      hal : tasmlist;
     begin
     begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       if assigned(current_module.mainsource) then
@@ -981,23 +982,13 @@ var
       AsmStartSize:=AsmSize;
       AsmStartSize:=AsmSize;
       symendcount:=0;
       symendcount:=0;
 
 
-      If (cs_debuginfo in aktmoduleswitches) then
-        WriteTree(asmlist[debuglist]);
-      WriteTree(asmlist[codesegment]);
-      WriteTree(asmlist[datasegment]);
-      WriteTree(asmlist[consts]);
-      WriteTree(asmlist[rttilist]);
-      WriteTree(asmlist[picdata]);
-      Writetree(asmlist[resourcestrings]);
-      WriteTree(asmlist[bsssegment]);
-      WriteTree(asmlist[threadvarsegment]);
-      Writetree(asmlist[importsection]);
-      { exports are written by DLLTOOL
-        if we use it so don't insert it twice (PM) }
-      if not UseDeffileForExports and assigned(asmlist[exportsection]) then
-        Writetree(asmlist[exportsection]);
-      Writetree(asmlist[resourcesection]);
-      Writetree(asmlist[dwarflist]);
+      for hal:=low(Tasmlist) to high(Tasmlist) do
+        begin
+          AsmWriteLn(target_asm.comment+'Begin asmlist '+TasmlistStr[hal]);
+          writetree(asmlist[hal]);
+          AsmWriteLn(target_asm.comment+'End asmlist '+TasmlistStr[hal]);
+        end;
+
       {$ifdef GDB}
       {$ifdef GDB}
       WriteFileEndInfo;
       WriteFileEndInfo;
       {$ENDIF}
       {$ENDIF}

+ 4 - 4
compiler/assemble.pas

@@ -1601,13 +1601,13 @@ Implementation
       begin
       begin
         to_do:=[low(Tasmlist)..high(Tasmlist)];
         to_do:=[low(Tasmlist)..high(Tasmlist)];
         if not(cs_debuginfo in aktmoduleswitches) then
         if not(cs_debuginfo in aktmoduleswitches) then
-          exclude(to_do,debuglist);
+          exclude(to_do,al_debug);
         if usedeffileforexports then
         if usedeffileforexports then
-          exclude(to_do,exportsection);
+          exclude(to_do,al_exports);
         {$warning TODO internal writer support for dwarf}
         {$warning TODO internal writer support for dwarf}
-        exclude(to_do,dwarflist);
+        exclude(to_do,al_dwarf);
 {$ifndef segment_threadvars}
 {$ifndef segment_threadvars}
-        exclude(to_do,threadvarsegment);
+        exclude(to_do,al_threadvars);
 {$endif}
 {$endif}
         for i:=low(Tasmlist) to high(Tasmlist) do
         for i:=low(Tasmlist) to high(Tasmlist) do
           if (i in to_do) and (asmlist[i]<>nil) then
           if (i in to_do) and (asmlist[i]<>nil) then

+ 36 - 36
compiler/cresstr.pas

@@ -1,7 +1,7 @@
 {
 {
     Copyright (c) 1998-2002 by Michael van Canneyt
     Copyright (c) 1998-2002 by Michael van Canneyt
 
 
-    Handles resourcestrings
+    Handles al_resourcestrings
 
 
     This program is free software; you can redistribute it and/or modify
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@ Type
     procedure CalcHash;
     procedure CalcHash;
   end;
   end;
 
 
-  TResourceStrings=class
+  Tal_resourcestrings=class
   private
   private
     List : TLinkedList;
     List : TLinkedList;
   public
   public
@@ -53,7 +53,7 @@ Type
   end;
   end;
 
 
 var
 var
-  ResourceStrings : TResourceStrings;
+  al_resourcestrings : Tal_resourcestrings;
 
 
 
 
 implementation
 implementation
@@ -113,27 +113,27 @@ end;
 
 
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------
-                          TRESOURCESTRINGS
+                          Tal_resourcestrings
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
 
 
-Constructor TResourceStrings.Create;
+Constructor Tal_resourcestrings.Create;
 begin
 begin
   List:=TStringList.Create;
   List:=TStringList.Create;
   ResStrCount:=0;
   ResStrCount:=0;
 end;
 end;
 
 
 
 
-Destructor TResourceStrings.Destroy;
+Destructor Tal_resourcestrings.Destroy;
 begin
 begin
   List.Free;
   List.Free;
 end;
 end;
 
 
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------
-    Create the full asmlist for resourcestrings.
+    Create the full asmlist for al_resourcestrings.
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
 
 
-procedure TResourceStrings.CreateResourceStringList;
+procedure Tal_resourcestrings.CreateResourceStringList;
 
 
   Procedure AppendToAsmResList (P : TResourceStringItem);
   Procedure AppendToAsmResList (P : TResourceStringItem);
   Var
   Var
@@ -144,59 +144,59 @@ procedure TResourceStrings.CreateResourceStringList;
     with p Do
     with p Do
      begin
      begin
        if (Value=nil) or (len=0) then
        if (Value=nil) or (len=0) then
-         asmlist[aasmtai.resourcestrings].concat(tai_const.create_sym(nil))
+         asmlist[aasmtai.al_resourcestrings].concat(tai_const.create_sym(nil))
        else
        else
          begin
          begin
             objectlibrary.getdatalabel(l1);
             objectlibrary.getdatalabel(l1);
-            asmlist[aasmtai.resourcestrings].concat(tai_const.create_sym(l1));
-            maybe_new_object_file(asmlist[consts]);
-            asmlist[consts].concat(tai_align.Create(const_align(sizeof(aint))));
-            asmlist[consts].concat(tai_const.create_aint(-1));
-            asmlist[consts].concat(tai_const.create_aint(len));
-            asmlist[consts].concat(tai_label.create(l1));
+            asmlist[aasmtai.al_resourcestrings].concat(tai_const.create_sym(l1));
+            maybe_new_object_file(asmlist[al_typedconsts]);
+            asmlist[al_typedconsts].concat(tai_align.Create(const_align(sizeof(aint))));
+            asmlist[al_typedconsts].concat(tai_const.create_aint(-1));
+            asmlist[al_typedconsts].concat(tai_const.create_aint(len));
+            asmlist[al_typedconsts].concat(tai_label.create(l1));
             getmem(s,len+1);
             getmem(s,len+1);
             move(value^,s^,len);
             move(value^,s^,len);
             s[len]:=#0;
             s[len]:=#0;
-            asmlist[consts].concat(tai_string.create_length_pchar(s,len));
-            asmlist[consts].concat(tai_const.create_8bit(0));
+            asmlist[al_typedconsts].concat(tai_string.create_length_pchar(s,len));
+            asmlist[al_typedconsts].concat(tai_const.create_8bit(0));
          end;
          end;
        { append Current value (nil) and hash...}
        { append Current value (nil) and hash...}
-       asmlist[aasmtai.resourcestrings].concat(tai_const.create_sym(nil));
-       asmlist[aasmtai.resourcestrings].concat(tai_const.create_32bit(longint(hash)));
+       asmlist[aasmtai.al_resourcestrings].concat(tai_const.create_sym(nil));
+       asmlist[aasmtai.al_resourcestrings].concat(tai_const.create_32bit(longint(hash)));
        { Append the name as a ansistring. }
        { Append the name as a ansistring. }
        objectlibrary.getdatalabel(l1);
        objectlibrary.getdatalabel(l1);
        l:=length(name);
        l:=length(name);
-       asmlist[aasmtai.resourcestrings].concat(tai_const.create_sym(l1));
-       maybe_new_object_file(asmlist[consts]);
-       asmlist[consts].concat(tai_align.create(const_align(sizeof(aint))));
-       asmlist[consts].concat(tai_const.create_aint(-1));
-       asmlist[consts].concat(tai_const.create_aint(l));
-       asmlist[consts].concat(tai_label.create(l1));
+       asmlist[aasmtai.al_resourcestrings].concat(tai_const.create_sym(l1));
+       maybe_new_object_file(asmlist[al_typedconsts]);
+       asmlist[al_typedconsts].concat(tai_align.create(const_align(sizeof(aint))));
+       asmlist[al_typedconsts].concat(tai_const.create_aint(-1));
+       asmlist[al_typedconsts].concat(tai_const.create_aint(l));
+       asmlist[al_typedconsts].concat(tai_label.create(l1));
        getmem(s,l+1);
        getmem(s,l+1);
        move(Name[1],s^,l);
        move(Name[1],s^,l);
        s[l]:=#0;
        s[l]:=#0;
-       asmlist[consts].concat(tai_string.create_length_pchar(s,l));
-       asmlist[consts].concat(tai_const.create_8bit(0));
+       asmlist[al_typedconsts].concat(tai_string.create_length_pchar(s,l));
+       asmlist[al_typedconsts].concat(tai_const.create_8bit(0));
      end;
      end;
   end;
   end;
 
 
 Var
 Var
   R : tresourceStringItem;
   R : tresourceStringItem;
 begin
 begin
-  if asmlist[aasmtai.resourcestrings]=nil then
-    asmlist[aasmtai.resourcestrings]:=taasmoutput.create;
-  maybe_new_object_file(asmlist[aasmtai.resourcestrings]);
-  asmlist[aasmtai.resourcestrings].concat(tai_align.create(const_align(sizeof(aint))));
-  asmlist[aasmtai.resourcestrings].concat(tai_symbol.createname_global(
+  if asmlist[aasmtai.al_resourcestrings]=nil then
+    asmlist[aasmtai.al_resourcestrings]:=taasmoutput.create;
+  maybe_new_object_file(asmlist[aasmtai.al_resourcestrings]);
+  asmlist[aasmtai.al_resourcestrings].concat(tai_align.create(const_align(sizeof(aint))));
+  asmlist[aasmtai.al_resourcestrings].concat(tai_symbol.createname_global(
     make_mangledname('RESOURCESTRINGLIST',current_module.localsymtable,''),AT_DATA,0));
     make_mangledname('RESOURCESTRINGLIST',current_module.localsymtable,''),AT_DATA,0));
-  asmlist[aasmtai.resourcestrings].concat(tai_const.create_32bit(resstrcount));
+  asmlist[aasmtai.al_resourcestrings].concat(tai_const.create_32bit(resstrcount));
   R:=TResourceStringItem(List.First);
   R:=TResourceStringItem(List.First);
   while assigned(R) do
   while assigned(R) do
    begin
    begin
      AppendToAsmResList(R);
      AppendToAsmResList(R);
      R:=TResourceStringItem(R.Next);
      R:=TResourceStringItem(R.Next);
    end;
    end;
-  asmlist[aasmtai.resourcestrings].concat(tai_symbol_end.createname(
+  asmlist[aasmtai.al_resourcestrings].concat(tai_symbol_end.createname(
     current_module.modulename^+'_'+'RESOURCESTRINGLIST'));
     current_module.modulename^+'_'+'RESOURCESTRINGLIST'));
 end;
 end;
 
 
@@ -205,7 +205,7 @@ end;
     Insert 1 resource string in all tables.
     Insert 1 resource string in all tables.
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
 
 
-function  TResourceStrings.Register(const name : string;p : pchar;len : longint) : longint;
+function  Tal_resourcestrings.Register(const name : string;p : pchar;len : longint) : longint;
 begin
 begin
   List.Concat(tResourceStringItem.Create(lower(current_module.modulename^+'.'+Name),p,len));
   List.Concat(tResourceStringItem.Create(lower(current_module.modulename^+'.'+Name),p,len));
   Register:=ResStrCount;
   Register:=ResStrCount;
@@ -213,7 +213,7 @@ begin
 end;
 end;
 
 
 
 
-Procedure TResourceStrings.WriteResourceFile(const FileName : String);
+Procedure Tal_resourcestrings.WriteResourceFile(const FileName : String);
 Type
 Type
   TMode = (quoted,unquoted);
   TMode = (quoted,unquoted);
 Var
 Var

+ 14 - 14
compiler/dwarf.pas

@@ -61,11 +61,11 @@ interface
 
 
       tdwarf=class
       tdwarf=class
       private
       private
-        FDwarfList : TLinkedList;
+        Fal_dwarf : TLinkedList;
       public
       public
         constructor create;
         constructor create;
         destructor destroy;override;
         destructor destroy;override;
-        property DwarfList:TlinkedList read FDwarfList;
+        property al_dwarf:TlinkedList read Fal_dwarf;
       end;
       end;
 
 
       tdwarfcfi=class(tdwarf)
       tdwarfcfi=class(tdwarf)
@@ -133,13 +133,13 @@ implementation
 
 
     constructor tdwarf.create;
     constructor tdwarf.create;
       begin
       begin
-        FDwarfList:=TLinkedList.Create;
+        Fal_dwarf:=TLinkedList.Create;
       end;
       end;
 
 
 
 
     destructor tdwarf.destroy;
     destructor tdwarf.destroy;
       begin
       begin
-        FDwarfList.Free;
+        Fal_dwarf.Free;
       end;
       end;
 
 
 
 
@@ -298,7 +298,7 @@ implementation
         lenstartlabel:=nil;
         lenstartlabel:=nil;
         lenendlabel:=nil;
         lenendlabel:=nil;
 
 
-        hp:=TDwarfItem(Dwarflist.first);
+        hp:=TDwarfItem(al_dwarf.first);
         while assigned(hp) do
         while assigned(hp) do
           begin
           begin
             case hp.op of
             case hp.op of
@@ -341,8 +341,8 @@ implementation
         { Check for open frames }
         { Check for open frames }
         if assigned(lenstartlabel) then
         if assigned(lenstartlabel) then
           internalerror(2004041210);
           internalerror(2004041210);
-        { Dwarflist is processed, remove items }
-        DwarfList.Clear;
+        { al_dwarf is processed, remove items }
+        al_dwarf.Clear;
       end;
       end;
 
 
 
 
@@ -354,7 +354,7 @@ implementation
         objectlibrary.getlabel(FFrameEndLabel);
         objectlibrary.getlabel(FFrameEndLabel);
         FLastloclabel:=FFrameStartLabel;
         FLastloclabel:=FFrameStartLabel;
         list.concat(tai_label.create(FFrameStartLabel));
         list.concat(tai_label.create(FFrameStartLabel));
-        dwarflist.concat(tdwarfitem.create_reloffset(DW_CFA_start_frame,doe_32bit,FFrameStartLabel,FFrameEndLabel));
+        al_dwarf.concat(tdwarfitem.create_reloffset(DW_CFA_start_frame,doe_32bit,FFrameStartLabel,FFrameEndLabel));
       end;
       end;
 
 
 
 
@@ -362,7 +362,7 @@ implementation
       begin
       begin
         if not assigned(FFrameStartLabel) then
         if not assigned(FFrameStartLabel) then
           internalerror(2004041213);
           internalerror(2004041213);
-        dwarflist.concat(tdwarfitem.create(DW_CFA_end_frame));
+        al_dwarf.concat(tdwarfitem.create(DW_CFA_end_frame));
         list.concat(tai_label.create(FFrameEndLabel));
         list.concat(tai_label.create(FFrameEndLabel));
         FFrameStartLabel:=nil;
         FFrameStartLabel:=nil;
         FFrameEndLabel:=nil;
         FFrameEndLabel:=nil;
@@ -378,7 +378,7 @@ implementation
           internalerror(200404082);
           internalerror(200404082);
         objectlibrary.getlabel(currloclabel);
         objectlibrary.getlabel(currloclabel);
         list.concat(tai_label.create(currloclabel));
         list.concat(tai_label.create(currloclabel));
-        dwarflist.concat(tdwarfitem.create_reloffset(DW_CFA_advance_loc4,doe_32bit,FLastloclabel,currloclabel));
+        al_dwarf.concat(tdwarfitem.create_reloffset(DW_CFA_advance_loc4,doe_32bit,FLastloclabel,currloclabel));
         FLastloclabel:=currloclabel;
         FLastloclabel:=currloclabel;
       end;
       end;
 
 
@@ -388,28 +388,28 @@ implementation
         cfa_advance_loc(list);
         cfa_advance_loc(list);
 {$warning TODO check if ref is a temp}
 {$warning TODO check if ref is a temp}
         { offset must be positive }
         { offset must be positive }
-        dwarflist.concat(tdwarfitem.create_reg_const(DW_CFA_offset_extended,doe_uleb,reg,doe_uleb,ofs div data_alignment_factor));
+        al_dwarf.concat(tdwarfitem.create_reg_const(DW_CFA_offset_extended,doe_uleb,reg,doe_uleb,ofs div data_alignment_factor));
       end;
       end;
 
 
 
 
     procedure tdwarfcfi.cfa_restore(list:taasmoutput;reg:tregister);
     procedure tdwarfcfi.cfa_restore(list:taasmoutput;reg:tregister);
       begin
       begin
         cfa_advance_loc(list);
         cfa_advance_loc(list);
-        dwarflist.concat(tdwarfitem.create_reg(DW_CFA_restore_extended,doe_uleb,reg));
+        al_dwarf.concat(tdwarfitem.create_reg(DW_CFA_restore_extended,doe_uleb,reg));
       end;
       end;
 
 
 
 
     procedure tdwarfcfi.cfa_def_cfa_register(list:taasmoutput;reg:tregister);
     procedure tdwarfcfi.cfa_def_cfa_register(list:taasmoutput;reg:tregister);
       begin
       begin
         cfa_advance_loc(list);
         cfa_advance_loc(list);
-        dwarflist.concat(tdwarfitem.create_reg(DW_CFA_def_cfa_register,doe_uleb,reg));
+        al_dwarf.concat(tdwarfitem.create_reg(DW_CFA_def_cfa_register,doe_uleb,reg));
       end;
       end;
 
 
 
 
     procedure tdwarfcfi.cfa_def_cfa_offset(list:taasmoutput;ofs:longint);
     procedure tdwarfcfi.cfa_def_cfa_offset(list:taasmoutput;ofs:longint);
       begin
       begin
         cfa_advance_loc(list);
         cfa_advance_loc(list);
-        dwarflist.concat(tdwarfitem.create_const(DW_CFA_def_cfa_offset,doe_uleb,ofs));
+        al_dwarf.concat(tdwarfitem.create_const(DW_CFA_def_cfa_offset,doe_uleb,ofs));
       end;
       end;
 
 
 
 

+ 10 - 18
compiler/i386/ag386nsm.pas

@@ -398,10 +398,10 @@ interface
       if not assigned(p) then
       if not assigned(p) then
        exit;
        exit;
       InlineLevel:=0;
       InlineLevel:=0;
-      { lineinfo is only needed for codesegment (PFV) }
+      { lineinfo is only needed for al_code (PFV) }
       do_line:=(cs_asm_source in aktglobalswitches) or
       do_line:=(cs_asm_source in aktglobalswitches) or
                ((cs_lineinfo in aktmoduleswitches)
                ((cs_lineinfo in aktmoduleswitches)
-                 and (p=asmlist[codesegment]));
+                 and (p=asmlist[al_code]));
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
        begin
        begin
@@ -779,6 +779,8 @@ interface
 
 
 
 
     procedure T386NasmAssembler.WriteAsmList;
     procedure T386NasmAssembler.WriteAsmList;
+    var
+      hal : tasmlist;
     begin
     begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       if assigned(current_module.mainsource) then
@@ -794,22 +796,12 @@ interface
 
 
       WriteExternals;
       WriteExternals;
 
 
-    { Nasm doesn't support stabs
-      WriteTree(debuglist);}
-
-      WriteTree(asmlist[codesegment]);
-      WriteTree(asmlist[datasegment]);
-      WriteTree(asmlist[consts]);
-      WriteTree(asmlist[rttilist]);
-      WriteTree(asmlist[resourcestrings]);
-      WriteTree(asmlist[bsssegment]);
-      WriteTree(asmlist[threadvarsegment]);
-      Writetree(asmlist[importsection]);
-      { exports are written by DLLTOOL
-        if we use it so don't insert it twice (PM) }
-      if not UseDeffileForExports and assigned(asmlist[exportsection]) then
-        Writetree(asmlist[exportsection]);
-      Writetree(asmlist[resourcesection]);
+      for hal:=low(Tasmlist) to high(Tasmlist) do
+        begin
+          AsmWriteLn(target_asm.comment+'Begin asmlist '+TasmlistStr[hal]);
+          writetree(asmlist[hal]);
+          AsmWriteLn(target_asm.comment+'End asmlist '+TasmlistStr[hal]);
+        end;
 
 
       AsmLn;
       AsmLn;
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}

+ 1 - 1
compiler/i386/n386set.pas

@@ -105,7 +105,7 @@ implementation
            (af_smartlink_sections in target_asm.flags) then
            (af_smartlink_sections in target_asm.flags) then
           jumpsegment:=current_procinfo.aktlocaldata
           jumpsegment:=current_procinfo.aktlocaldata
         else
         else
-          jumpsegment:=asmlist[datasegment];
+          jumpsegment:=asmlist[al_data];
         if not(jumptable_no_range) then
         if not(jumptable_no_range) then
           begin
           begin
              { case expr less than min_ => goto elselabel }
              { case expr less than min_ => goto elselabel }

+ 3 - 3
compiler/ncgcal.pas

@@ -1123,7 +1123,7 @@ implementation
              cg.a_label(exprasmlist,startlabel);
              cg.a_label(exprasmlist,startlabel);
 
 
              { Here we must include the para and local symtable info }
              { Here we must include the para and local symtable info }
-             procdefinition.concatstabto(withdebuglist);
+             procdefinition.concatstabto(al_withdebug);
 
 
              mangled_length:=length(current_procinfo.inlining_procinfo.procdef.mangledname);
              mangled_length:=length(current_procinfo.inlining_procinfo.procdef.mangledname);
              getmem(pp,mangled_length+50);
              getmem(pp,mangled_length+50);
@@ -1133,7 +1133,7 @@ implementation
                  strpcopy(strend(pp),'-');
                  strpcopy(strend(pp),'-');
                  strpcopy(strend(pp),current_procinfo.inlining_procinfo.procdef.mangledname);
                  strpcopy(strend(pp),current_procinfo.inlining_procinfo.procdef.mangledname);
                end;
                end;
-             withdebugList.concat(Tai_stabn.Create(strnew(pp)));
+             al_withdebug.concat(Tai_stabn.Create(strnew(pp)));
            end;
            end;
 {$endif GDB}
 {$endif GDB}
 
 
@@ -1221,7 +1221,7 @@ implementation
                  strpcopy(strend(pp),'-');
                  strpcopy(strend(pp),'-');
                  strpcopy(strend(pp),current_procinfo.inlining_procinfo.procdef.mangledname);
                  strpcopy(strend(pp),current_procinfo.inlining_procinfo.procdef.mangledname);
                end;
                end;
-             withdebugList.concat(Tai_stabn.Create(strnew(pp)));
+             al_withdebug.concat(Tai_stabn.Create(strnew(pp)));
              freemem(pp,mangled_length+50);
              freemem(pp,mangled_length+50);
            end;
            end;
 {$endif GDB}
 {$endif GDB}

+ 53 - 53
compiler/ncgcon.pas

@@ -100,7 +100,7 @@ implementation
         if not assigned(lab_real) then
         if not assigned(lab_real) then
           begin
           begin
              { tries to find an old entry }
              { tries to find an old entry }
-             hp1:=tai(asmlist[consts].first);
+             hp1:=tai(asmlist[al_typedconsts].first);
              while assigned(hp1) do
              while assigned(hp1) do
                begin
                begin
                   if hp1.typ=ait_label then
                   if hp1.typ=ait_label then
@@ -138,17 +138,17 @@ implementation
                begin
                begin
                   objectlibrary.getdatalabel(lastlabel);
                   objectlibrary.getdatalabel(lastlabel);
                   lab_real:=lastlabel;
                   lab_real:=lastlabel;
-                  maybe_new_object_file(asmlist[consts]);
-                  new_section(asmlist[consts],sec_rodata,lastlabel.name,const_align(resulttype.def.size));
-                  asmlist[consts].concat(Tai_label.Create(lastlabel));
+                  maybe_new_object_file(asmlist[al_typedconsts]);
+                  new_section(asmlist[al_typedconsts],sec_rodata,lastlabel.name,const_align(resulttype.def.size));
+                  asmlist[al_typedconsts].concat(Tai_label.Create(lastlabel));
                   case realait of
                   case realait of
                     ait_real_32bit :
                     ait_real_32bit :
                       begin
                       begin
-                        asmlist[consts].concat(Tai_real_32bit.Create(ts32real(value_real)));
+                        asmlist[al_typedconsts].concat(Tai_real_32bit.Create(ts32real(value_real)));
                         { range checking? }
                         { range checking? }
                         if ((cs_check_range in aktlocalswitches) or
                         if ((cs_check_range in aktlocalswitches) or
                           (cs_check_overflow in aktlocalswitches)) and
                           (cs_check_overflow in aktlocalswitches)) and
-                          (tai_real_32bit(asmlist[consts].last).value=double(MathInf)) then
+                          (tai_real_32bit(asmlist[al_typedconsts].last).value=double(MathInf)) then
                           Message(parser_e_range_check_error);
                           Message(parser_e_range_check_error);
                       end;
                       end;
 
 
@@ -156,37 +156,37 @@ implementation
                       begin
                       begin
 {$ifdef ARM}
 {$ifdef ARM}
                         if hiloswapped then
                         if hiloswapped then
-                          asmlist[consts].concat(Tai_real_64bit.Create_hiloswapped(ts64real(value_real)))
+                          asmlist[al_typedconsts].concat(Tai_real_64bit.Create_hiloswapped(ts64real(value_real)))
                         else
                         else
 {$endif ARM}
 {$endif ARM}
-                          asmlist[consts].concat(Tai_real_64bit.Create(ts64real(value_real)));
+                          asmlist[al_typedconsts].concat(Tai_real_64bit.Create(ts64real(value_real)));
 
 
                         { range checking? }
                         { range checking? }
                         if ((cs_check_range in aktlocalswitches) or
                         if ((cs_check_range in aktlocalswitches) or
                           (cs_check_overflow in aktlocalswitches)) and
                           (cs_check_overflow in aktlocalswitches)) and
-                          (tai_real_64bit(asmlist[consts].last).value=double(MathInf)) then
+                          (tai_real_64bit(asmlist[al_typedconsts].last).value=double(MathInf)) then
                           Message(parser_e_range_check_error);
                           Message(parser_e_range_check_error);
                      end;
                      end;
 
 
                     ait_real_80bit :
                     ait_real_80bit :
                       begin
                       begin
-                        asmlist[consts].concat(Tai_real_80bit.Create(value_real));
+                        asmlist[al_typedconsts].concat(Tai_real_80bit.Create(value_real));
 
 
                         { range checking? }
                         { range checking? }
                         if ((cs_check_range in aktlocalswitches) or
                         if ((cs_check_range in aktlocalswitches) or
                           (cs_check_overflow in aktlocalswitches)) and
                           (cs_check_overflow in aktlocalswitches)) and
-                          (tai_real_80bit(asmlist[consts].last).value=double(MathInf)) then
+                          (tai_real_80bit(asmlist[al_typedconsts].last).value=double(MathInf)) then
                           Message(parser_e_range_check_error);
                           Message(parser_e_range_check_error);
                       end;
                       end;
 {$ifdef cpufloat128}
 {$ifdef cpufloat128}
                     ait_real_128bit :
                     ait_real_128bit :
                       begin
                       begin
-                        asmlist[consts].concat(Tai_real_128bit.Create(value_real));
+                        asmlist[al_typedconsts].concat(Tai_real_128bit.Create(value_real));
 
 
                         { range checking? }
                         { range checking? }
                         if ((cs_check_range in aktlocalswitches) or
                         if ((cs_check_range in aktlocalswitches) or
                           (cs_check_overflow in aktlocalswitches)) and
                           (cs_check_overflow in aktlocalswitches)) and
-                          (tai_real_128bit(asmlist[consts].last).value=double(MathInf)) then
+                          (tai_real_128bit(asmlist[al_typedconsts].last).value=double(MathInf)) then
                           Message(parser_e_range_check_error);
                           Message(parser_e_range_check_error);
                       end;
                       end;
 {$endif cpufloat128}
 {$endif cpufloat128}
@@ -196,7 +196,7 @@ implementation
                       if (value_real>9223372036854775807.0) or (value_real<-9223372036854775808.0) then
                       if (value_real>9223372036854775807.0) or (value_real<-9223372036854775808.0) then
                         message(parser_e_range_check_error)
                         message(parser_e_range_check_error)
                       else
                       else
-                        asmlist[consts].concat(Tai_comp_64bit.Create(round(value_real)));
+                        asmlist[al_typedconsts].concat(Tai_comp_64bit.Create(round(value_real)));
                   else
                   else
                     internalerror(10120);
                     internalerror(10120);
                   end;
                   end;
@@ -273,7 +273,7 @@ implementation
               if not(is_widestring(resulttype.def)) then
               if not(is_widestring(resulttype.def)) then
                 begin
                 begin
                   { tries to find an old entry }
                   { tries to find an old entry }
-                  hp1:=tai(asmlist[consts].first);
+                  hp1:=tai(asmlist[al_typedconsts].first);
                   while assigned(hp1) do
                   while assigned(hp1) do
                     begin
                     begin
                        if hp1.typ=ait_label then
                        if hp1.typ=ait_label then
@@ -460,9 +460,9 @@ implementation
                 begin
                 begin
                    objectlibrary.getdatalabel(lastlabel);
                    objectlibrary.getdatalabel(lastlabel);
                    lab_str:=lastlabel;
                    lab_str:=lastlabel;
-                   maybe_new_object_file(asmlist[consts]);
-                   new_section(asmlist[consts],sec_rodata,lastlabel.name,const_align(sizeof(aint)));
-                   asmlist[consts].concat(Tai_label.Create(lastlabel));
+                   maybe_new_object_file(asmlist[al_typedconsts]);
+                   new_section(asmlist[al_typedconsts],sec_rodata,lastlabel.name,const_align(sizeof(aint)));
+                   asmlist[al_typedconsts].concat(Tai_label.Create(lastlabel));
                    { generate an ansi string ? }
                    { generate an ansi string ? }
                    case st_type of
                    case st_type of
                     {$ifdef ansistring_bits}
                     {$ifdef ansistring_bits}
@@ -470,7 +470,7 @@ implementation
                         begin
                         begin
                            { an empty ansi string is nil! }
                            { an empty ansi string is nil! }
                            if len=0 then
                            if len=0 then
-                             asmlist[consts].concat(Tai_const.Create_ptr(0))
+                             asmlist[al_typedconsts].concat(Tai_const.Create_ptr(0))
                            else
                            else
                              begin
                              begin
                                 objectlibrary.getdatalabel(l1);
                                 objectlibrary.getdatalabel(l1);
@@ -485,7 +485,7 @@ implementation
                                 pc[len]:=#0;
                                 pc[len]:=#0;
                                 { to overcome this problem we set the length explicitly }
                                 { to overcome this problem we set the length explicitly }
                                 { with the ending null char }
                                 { with the ending null char }
-                                asmlist[consts].concat(Tai_string.Create_length_pchar(pc,len+1));
+                                asmlist[al_typedconsts].concat(Tai_string.Create_length_pchar(pc,len+1));
                                 { return the offset of the real string }
                                 { return the offset of the real string }
                                 lab_str:=l2;
                                 lab_str:=l2;
                              end;
                              end;
@@ -495,22 +495,22 @@ implementation
                         begin
                         begin
                            { an empty ansi string is nil! }
                            { an empty ansi string is nil! }
                            if len=0 then
                            if len=0 then
-                             asmlist[consts].concat(Tai_const.Create_sym(nil))
+                             asmlist[al_typedconsts].concat(Tai_const.Create_sym(nil))
                            else
                            else
                              begin
                              begin
                                 objectlibrary.getdatalabel(l1);
                                 objectlibrary.getdatalabel(l1);
                                 objectlibrary.getdatalabel(l2);
                                 objectlibrary.getdatalabel(l2);
-                                asmlist[consts].concat(Tai_label.Create(l2));
-                                asmlist[consts].concat(Tai_const.Create_sym(l1));
-                                asmlist[consts].concat(Tai_const.Create_aint(-1));
-                                asmlist[consts].concat(Tai_const.Create_aint(len));
-                                asmlist[consts].concat(Tai_label.Create(l1));
+                                asmlist[al_typedconsts].concat(Tai_label.Create(l2));
+                                asmlist[al_typedconsts].concat(Tai_const.Create_sym(l1));
+                                asmlist[al_typedconsts].concat(Tai_const.Create_aint(-1));
+                                asmlist[al_typedconsts].concat(Tai_const.Create_aint(len));
+                                asmlist[al_typedconsts].concat(Tai_label.Create(l1));
                                 getmem(pc,len+2);
                                 getmem(pc,len+2);
                                 move(value_str^,pc^,len);
                                 move(value_str^,pc^,len);
                                 pc[len]:=#0;
                                 pc[len]:=#0;
                                 { to overcome this problem we set the length explicitly }
                                 { to overcome this problem we set the length explicitly }
                                 { with the ending null char }
                                 { with the ending null char }
-                                asmlist[consts].concat(Tai_string.Create_length_pchar(pc,len+1));
+                                asmlist[al_typedconsts].concat(Tai_string.Create_length_pchar(pc,len+1));
                                 { return the offset of the real string }
                                 { return the offset of the real string }
                                 lab_str:=l2;
                                 lab_str:=l2;
                              end;
                              end;
@@ -525,17 +525,17 @@ implementation
                              begin
                              begin
                                 objectlibrary.getdatalabel(l1);
                                 objectlibrary.getdatalabel(l1);
                                 objectlibrary.getdatalabel(l2);
                                 objectlibrary.getdatalabel(l2);
-                                asmlist[consts].concat(Tai_label.Create(l2));
-                                asmlist[consts].concat(Tai_const_symbol.Create(l1));
-                                asmlist[consts].concat(Tai_const.Create_32bit(-1));
-                                asmlist[consts].concat(Tai_const.Create_32bit(len));
-                                asmlist[consts].concat(Tai_label.Create(l1));
+                                asmlist[al_typedconsts].concat(Tai_label.Create(l2));
+                                asmlist[al_typedconsts].concat(Tai_const_symbol.Create(l1));
+                                asmlist[al_typedconsts].concat(Tai_const.Create_32bit(-1));
+                                asmlist[al_typedconsts].concat(Tai_const.Create_32bit(len));
+                                asmlist[al_typedconsts].concat(Tai_label.Create(l1));
                                 getmem(pc,len+2);
                                 getmem(pc,len+2);
                                 move(value_str^,pc^,len);
                                 move(value_str^,pc^,len);
                                 pc[len]:=#0;
                                 pc[len]:=#0;
                                 { to overcome this problem we set the length explicitly }
                                 { to overcome this problem we set the length explicitly }
                                 { with the ending null char }
                                 { with the ending null char }
-                                asmlist[consts].concat(Tai_string.Create_length_pchar(pc,len+1));
+                                asmlist[al_typedconsts].concat(Tai_string.Create_length_pchar(pc,len+1));
                                 { return the offset of the real string }
                                 { return the offset of the real string }
                                 lab_str:=l2;
                                 lab_str:=l2;
                              end;
                              end;
@@ -545,24 +545,24 @@ implementation
                         begin
                         begin
                            { an empty wide string is nil! }
                            { an empty wide string is nil! }
                            if len=0 then
                            if len=0 then
-                             asmlist[consts].concat(Tai_const.Create_sym(nil))
+                             asmlist[al_typedconsts].concat(Tai_const.Create_sym(nil))
                            else
                            else
                              begin
                              begin
                                 objectlibrary.getdatalabel(l1);
                                 objectlibrary.getdatalabel(l1);
                                 objectlibrary.getdatalabel(l2);
                                 objectlibrary.getdatalabel(l2);
-                                asmlist[consts].concat(Tai_label.Create(l2));
-                                asmlist[consts].concat(Tai_const.Create_sym(l1));
+                                asmlist[al_typedconsts].concat(Tai_label.Create(l2));
+                                asmlist[al_typedconsts].concat(Tai_const.Create_sym(l1));
 
 
                                 { we use always UTF-16 coding for constants }
                                 { we use always UTF-16 coding for constants }
                                 { at least for now                          }
                                 { at least for now                          }
                                 { Consts.concat(Tai_const.Create_8bit(2)); }
                                 { Consts.concat(Tai_const.Create_8bit(2)); }
-                                asmlist[consts].concat(Tai_const.Create_aint(-1));
-                                asmlist[consts].concat(Tai_const.Create_aint(len));
-                                asmlist[consts].concat(Tai_label.Create(l1));
+                                asmlist[al_typedconsts].concat(Tai_const.Create_aint(-1));
+                                asmlist[al_typedconsts].concat(Tai_const.Create_aint(len));
+                                asmlist[al_typedconsts].concat(Tai_label.Create(l1));
                                 for i:=0 to len-1 do
                                 for i:=0 to len-1 do
-                                  asmlist[consts].concat(Tai_const.Create_16bit(pcompilerwidestring(value_str)^.data[i]));
+                                  asmlist[al_typedconsts].concat(Tai_const.Create_16bit(pcompilerwidestring(value_str)^.data[i]));
                                 { terminating zero }
                                 { terminating zero }
-                                asmlist[consts].concat(Tai_const.Create_16bit(0));
+                                asmlist[al_typedconsts].concat(Tai_const.Create_16bit(0));
                                 { return the offset of the real string }
                                 { return the offset of the real string }
                                 lab_str:=l2;
                                 lab_str:=l2;
                              end;
                              end;
@@ -581,7 +581,7 @@ implementation
                           { to overcome this problem we set the length explicitly }
                           { to overcome this problem we set the length explicitly }
                           { with the ending null char }
                           { with the ending null char }
                           pc[l+1]:=#0;
                           pc[l+1]:=#0;
-                          asmlist[consts].concat(Tai_string.Create_length_pchar(pc,l+2));
+                          asmlist[al_typedconsts].concat(Tai_string.Create_length_pchar(pc,l+2));
                         end;
                         end;
                    end;
                    end;
                 end;
                 end;
@@ -626,7 +626,7 @@ implementation
         if not assigned(lab_set) then
         if not assigned(lab_set) then
           begin
           begin
              { tries to found an old entry }
              { tries to found an old entry }
-             hp1:=tai(asmlist[consts].first);
+             hp1:=tai(asmlist[al_typedconsts].first);
              while assigned(hp1) do
              while assigned(hp1) do
                begin
                begin
                   if hp1.typ=ait_label then
                   if hp1.typ=ait_label then
@@ -677,9 +677,9 @@ implementation
                begin
                begin
                  objectlibrary.getdatalabel(lastlabel);
                  objectlibrary.getdatalabel(lastlabel);
                  lab_set:=lastlabel;
                  lab_set:=lastlabel;
-                 maybe_new_object_file(asmlist[consts]);
-                 new_section(asmlist[consts],sec_rodata,lastlabel.name,const_align(sizeof(aint)));
-                 asmlist[consts].concat(Tai_label.Create(lastlabel));
+                 maybe_new_object_file(asmlist[al_typedconsts]);
+                 new_section(asmlist[al_typedconsts],sec_rodata,lastlabel.name,const_align(sizeof(aint)));
+                 asmlist[al_typedconsts].concat(Tai_label.Create(lastlabel));
                  { already handled at the start of this method?? (JM)
                  { already handled at the start of this method?? (JM)
                  if tsetdef(resulttype.def).settype=smallset then
                  if tsetdef(resulttype.def).settype=smallset then
                   begin
                   begin
@@ -690,7 +690,7 @@ implementation
                  }
                  }
                   begin
                   begin
                     for i:=0 to 31 do
                     for i:=0 to 31 do
-                      asmlist[consts].concat(Tai_const.Create_8bit(Psetbytes(value_set)^[i xor indexadjust]));
+                      asmlist[al_typedconsts].concat(Tai_const.Create_8bit(Psetbytes(value_set)^[i xor indexadjust]));
                   end;
                   end;
                end;
                end;
           end;
           end;
@@ -721,13 +721,13 @@ implementation
         location_reset(location,LOC_CREFERENCE,OS_NO);
         location_reset(location,LOC_CREFERENCE,OS_NO);
         { label for GUID }
         { label for GUID }
         objectlibrary.getdatalabel(tmplabel);
         objectlibrary.getdatalabel(tmplabel);
-        asmlist[consts].concat(tai_align.create(const_align(16)));
-        asmlist[consts].concat(Tai_label.Create(tmplabel));
-        asmlist[consts].concat(Tai_const.Create_32bit(longint(value.D1)));
-        asmlist[consts].concat(Tai_const.Create_16bit(value.D2));
-        asmlist[consts].concat(Tai_const.Create_16bit(value.D3));
+        asmlist[al_typedconsts].concat(tai_align.create(const_align(16)));
+        asmlist[al_typedconsts].concat(Tai_label.Create(tmplabel));
+        asmlist[al_typedconsts].concat(Tai_const.Create_32bit(longint(value.D1)));
+        asmlist[al_typedconsts].concat(Tai_const.Create_16bit(value.D2));
+        asmlist[al_typedconsts].concat(Tai_const.Create_16bit(value.D3));
         for i:=low(value.D4) to high(value.D4) do
         for i:=low(value.D4) to high(value.D4) do
-          asmlist[consts].concat(Tai_const.Create_8bit(value.D4[i]));
+          asmlist[al_typedconsts].concat(Tai_const.Create_8bit(value.D4[i]));
         location.reference.symbol:=tmplabel;
         location.reference.symbol:=tmplabel;
       end;
       end;
 
 

+ 3 - 3
compiler/ncgmem.pas

@@ -386,7 +386,7 @@ implementation
             objectlibrary.getaddrlabel(withstartlabel);
             objectlibrary.getaddrlabel(withstartlabel);
             objectlibrary.getaddrlabel(withendlabel);
             objectlibrary.getaddrlabel(withendlabel);
             cg.a_label(exprasmlist,withstartlabel);
             cg.a_label(exprasmlist,withstartlabel);
-            withdebugList.concat(Tai_stabs.Create(strpnew(
+            al_withdebug.concat(Tai_stabs.Create(strpnew(
                '"with'+tostr(withlevel)+':'+tostr(symtablestack.getnewtypecount)+
                '"with'+tostr(withlevel)+':'+tostr(symtablestack.getnewtypecount)+
                '=*'+tstoreddef(left.resulttype.def).numberstring+'",'+
                '=*'+tstoreddef(left.resulttype.def).numberstring+'",'+
                tostr(N_LSYM)+',0,0,'+tostr(refnode.location.reference.offset))));
                tostr(N_LSYM)+',0,0,'+tostr(refnode.location.reference.offset))));
@@ -398,7 +398,7 @@ implementation
                 strpcopy(strend(pp),'-');
                 strpcopy(strend(pp),'-');
                 strpcopy(strend(pp),current_procinfo.procdef.mangledname);
                 strpcopy(strend(pp),current_procinfo.procdef.mangledname);
               end;
               end;
-            withdebugList.concat(Tai_stabn.Create(strnew(pp)));
+            al_withdebug.concat(Tai_stabn.Create(strnew(pp)));
           end;
           end;
 {$endif WITHNODEDEBUG}
 {$endif WITHNODEDEBUG}
 
 
@@ -415,7 +415,7 @@ implementation
                strpcopy(strend(pp),'-');
                strpcopy(strend(pp),'-');
                strpcopy(strend(pp),current_procinfo.procdef.mangledname);
                strpcopy(strend(pp),current_procinfo.procdef.mangledname);
              end;
              end;
-            withdebugList.concat(Tai_stabn.Create(strnew(pp)));
+            al_withdebug.concat(Tai_stabn.Create(strnew(pp)));
             freemem(pp,mangled_length+50);
             freemem(pp,mangled_length+50);
             dec(withlevel);
             dec(withlevel);
           end;
           end;

+ 14 - 51
compiler/ncgutil.pas

@@ -103,7 +103,6 @@ interface
     procedure new_exception(list:TAAsmoutput;const t:texceptiontemps;exceptlabel:tasmlabel);
     procedure new_exception(list:TAAsmoutput;const t:texceptiontemps;exceptlabel:tasmlabel);
     procedure free_exception(list:TAAsmoutput;const t:texceptiontemps;a:aint;endexceptlabel:tasmlabel;onlyfree:boolean);
     procedure free_exception(list:TAAsmoutput;const t:texceptiontemps;a:aint;endexceptlabel:tasmlabel;onlyfree:boolean);
 
 
-    procedure insertconstdata(sym : ttypedconstsym);
     procedure insertbssdata(sym : tglobalvarsym);
     procedure insertbssdata(sym : tglobalvarsym);
 
 
     procedure gen_alloc_symtable(list:TAAsmoutput;st:tsymtable);
     procedure gen_alloc_symtable(list:TAAsmoutput;st:tsymtable);
@@ -1621,7 +1620,7 @@ implementation
               { the parameters are already in the right registers }
               { the parameters are already in the right registers }
               cg.a_call_name(list,target_info.cprefix+'FPC_SYSTEMMAIN');
               cg.a_call_name(list,target_info.cprefix+'FPC_SYSTEMMAIN');
              end;
              end;
-           
+
            { initialize units }
            { initialize units }
            cg.allocallcpuregisters(list);
            cg.allocallcpuregisters(list);
            cg.a_call_name(list,'FPC_INITIALIZEUNITS');
            cg.a_call_name(list,'FPC_INITIALIZEUNITS');
@@ -1784,7 +1783,7 @@ implementation
                 strpcopy(strend(p),'-');
                 strpcopy(strend(p),'-');
                 strpcopy(strend(p),current_procinfo.procdef.mangledname);
                 strpcopy(strend(p),current_procinfo.procdef.mangledname);
               end;
               end;
-            list.concatlist(asmlist[withdebuglist]);
+            list.concatlist(asmlist[al_withdebug]);
             list.concat(Tai_stabn.Create(strnew(p)));
             list.concat(Tai_stabn.Create(strnew(p)));
              { strpnew('224,0,0,'
              { strpnew('224,0,0,'
              +current_procinfo.procdef.mangledname+'_end'))));}
              +current_procinfo.procdef.mangledname+'_end'))));}
@@ -1911,7 +1910,7 @@ implementation
 
 
     procedure gen_external_stub(list:taasmoutput;pd:tprocdef;const externalname:string);
     procedure gen_external_stub(list:taasmoutput;pd:tprocdef;const externalname:string);
       begin
       begin
-        { add the procedure to the codesegment }
+        { add the procedure to the al_code }
         maybe_new_object_file(list);
         maybe_new_object_file(list);
         new_section(list,sec_code,lower(pd.mangledname),aktalignment.procalign);
         new_section(list,sec_code,lower(pd.mangledname),aktalignment.procalign);
         list.concat(Tai_align.create(aktalignment.procalign));
         list.concat(Tai_align.create(aktalignment.procalign));
@@ -1926,42 +1925,6 @@ implementation
                                Const Data
                                Const Data
 ****************************************************************************}
 ****************************************************************************}
 
 
-    procedure insertconstdata(sym : ttypedconstsym);
-    { this does not affect the local stack space, since all
-      typed constansts and initialized variables are always
-      put in the .data / .rodata section
-    }
-      var
-        storefilepos : tfileposinfo;
-        curconstsegment : taasmoutput;
-        l : longint;
-      begin
-        storefilepos:=aktfilepos;
-        aktfilepos:=sym.fileinfo;
-        if sym.is_writable then
-          curconstsegment:=asmlist[datasegment]
-        else
-          curconstsegment:=asmlist[consts];
-        l:=sym.getsize;
-        { insert cut for smartlinking or alignment }
-        maybe_new_object_file(curconstSegment);
-        new_section(curconstSegment,sec_rodata,lower(sym.mangledname),const_align(l));
-{$ifdef GDB}
-        if (cs_debuginfo in aktmoduleswitches) then
-          sym.concatstabto(curconstSegment);
-{$endif GDB}
-        if (sym.owner.symtabletype=globalsymtable) or
-           maybe_smartlink_symbol or
-           (assigned(current_procinfo) and
-            (po_inline in current_procinfo.procdef.procoptions)) or
-           DLLSource then
-          curconstSegment.concat(Tai_symbol.Createname_global(sym.mangledname,AT_DATA,l))
-        else
-          curconstSegment.concat(Tai_symbol.Createname(sym.mangledname,AT_DATA,l));
-        aktfilepos:=storefilepos;
-      end;
-
-
     procedure insertbssdata(sym : tglobalvarsym);
     procedure insertbssdata(sym : tglobalvarsym);
       var
       var
         l,varalign : longint;
         l,varalign : longint;
@@ -1975,17 +1938,17 @@ implementation
      {$ifndef segment_threadvars}
      {$ifndef segment_threadvars}
         if (vo_is_thread_var in sym.varoptions) then
         if (vo_is_thread_var in sym.varoptions) then
           inc(l,sizeof(aint));
           inc(l,sizeof(aint));
-        list:=asmlist[bsssegment];
+        list:=asmlist[al_bss];
         sectype:=sec_bss;
         sectype:=sec_bss;
      {$else}
      {$else}
         if (vo_is_thread_var in sym.varoptions) then
         if (vo_is_thread_var in sym.varoptions) then
           begin
           begin
-            list:=asmlist[threadvarsegment];
+            list:=asmlist[al_threadvars];
             sectype:=sec_threadvar;
             sectype:=sec_threadvar;
           end
           end
         else
         else
           begin
           begin
-            list:=asmlist[bsssegment];
+            list:=asmlist[al_bss];
             sectype:=sec_bss;
             sectype:=sec_bss;
           end;
           end;
      {$endif}
      {$endif}
@@ -2350,11 +2313,11 @@ implementation
            def.rttitablesym:=rsym;
            def.rttitablesym:=rsym;
            { write rtti data }
            { write rtti data }
            def.write_child_rtti_data(fullrtti);
            def.write_child_rtti_data(fullrtti);
-           maybe_new_object_file(asmlist[rttilist]);
-           new_section(asmlist[rttilist],sec_rodata,rsym.get_label.name,const_align(sizeof(aint)));
-           asmlist[rttilist].concat(Tai_symbol.Create_global(rsym.get_label,0));
+           maybe_new_object_file(asmlist[al_rtti]);
+           new_section(asmlist[al_rtti],sec_rodata,rsym.get_label.name,const_align(sizeof(aint)));
+           asmlist[al_rtti].concat(Tai_symbol.Create_global(rsym.get_label,0));
            def.write_rtti_data(fullrtti);
            def.write_rtti_data(fullrtti);
-           asmlist[rttilist].concat(Tai_symbol_end.Create(rsym.get_label));
+           asmlist[al_rtti].concat(Tai_symbol_end.Create(rsym.get_label));
          end;
          end;
       end;
       end;
 
 
@@ -2390,11 +2353,11 @@ implementation
            def.inittablesym:=rsym;
            def.inittablesym:=rsym;
            { write inittable data }
            { write inittable data }
            def.write_child_rtti_data(initrtti);
            def.write_child_rtti_data(initrtti);
-           maybe_new_object_file(asmlist[rttilist]);
-           new_section(asmlist[rttilist],sec_rodata,rsym.get_label.name,const_align(sizeof(aint)));
-           asmlist[rttilist].concat(Tai_symbol.Create_global(rsym.get_label,0));
+           maybe_new_object_file(asmlist[al_rtti]);
+           new_section(asmlist[al_rtti],sec_rodata,rsym.get_label.name,const_align(sizeof(aint)));
+           asmlist[al_rtti].concat(Tai_symbol.Create_global(rsym.get_label,0));
            def.write_rtti_data(initrtti);
            def.write_rtti_data(initrtti);
-           asmlist[rttilist].concat(Tai_symbol_end.Create(rsym.get_label));
+           asmlist[al_rtti].concat(Tai_symbol_end.Create(rsym.get_label));
          end;
          end;
       end;
       end;
 
 

+ 85 - 85
compiler/nobj.pas

@@ -118,7 +118,7 @@ interface
 {$endif WITHDMT}
 {$endif WITHDMT}
         { interfaces }
         { interfaces }
         function  genintftable: tasmlabel;
         function  genintftable: tasmlabel;
-        { write the VMT to datasegment }
+        { write the VMT to al_data }
         procedure writevmt;
         procedure writevmt;
         procedure writeinterfaceids;
         procedure writeinterfaceids;
       end;
       end;
@@ -263,13 +263,13 @@ implementation
          objectlibrary.getdatalabel(p^.nl);
          objectlibrary.getdatalabel(p^.nl);
          if assigned(p^.l) then
          if assigned(p^.l) then
            writenames(p^.l);
            writenames(p^.l);
-         asmlist[datasegment].concat(cai_align.create(const_align(sizeof(aint))));
-         asmlist[datasegment].concat(Tai_label.Create(p^.nl));
+         asmlist[al_data].concat(cai_align.create(const_align(sizeof(aint))));
+         asmlist[al_data].concat(Tai_label.Create(p^.nl));
          len:=strlen(p^.data.messageinf.str);
          len:=strlen(p^.data.messageinf.str);
-         asmlist[datasegment].concat(tai_const.create_8bit(len));
+         asmlist[al_data].concat(tai_const.create_8bit(len));
          getmem(ca,len+1);
          getmem(ca,len+1);
          move(p^.data.messageinf.str^,ca^,len+1);
          move(p^.data.messageinf.str^,ca^,len+1);
-         asmlist[datasegment].concat(Tai_string.Create_pchar(ca));
+         asmlist[al_data].concat(Tai_string.Create_pchar(ca));
          if assigned(p^.r) then
          if assigned(p^.r) then
            writenames(p^.r);
            writenames(p^.r);
       end;
       end;
@@ -281,8 +281,8 @@ implementation
            writestrentry(p^.l);
            writestrentry(p^.l);
 
 
          { write name label }
          { write name label }
-         asmlist[datasegment].concat(Tai_const.Create_sym(p^.nl));
-         asmlist[datasegment].concat(Tai_const.Createname(p^.data.mangledname,AT_FUNCTION,0));
+         asmlist[al_data].concat(Tai_const.Create_sym(p^.nl));
+         asmlist[al_data].concat(Tai_const.Createname(p^.data.mangledname,AT_FUNCTION,0));
 
 
          if assigned(p^.r) then
          if assigned(p^.r) then
            writestrentry(p^.r);
            writestrentry(p^.r);
@@ -305,10 +305,10 @@ implementation
 
 
          { now start writing of the message string table }
          { now start writing of the message string table }
          objectlibrary.getdatalabel(r);
          objectlibrary.getdatalabel(r);
-         asmlist[datasegment].concat(cai_align.create(const_align(sizeof(aint))));
-         asmlist[datasegment].concat(Tai_label.Create(r));
+         asmlist[al_data].concat(cai_align.create(const_align(sizeof(aint))));
+         asmlist[al_data].concat(Tai_label.Create(r));
          genstrmsgtab:=r;
          genstrmsgtab:=r;
-         asmlist[datasegment].concat(Tai_const.Create_32bit(count));
+         asmlist[al_data].concat(Tai_const.Create_32bit(count));
          if assigned(root) then
          if assigned(root) then
            begin
            begin
               writestrentry(root);
               writestrentry(root);
@@ -323,8 +323,8 @@ implementation
            writeintentry(p^.l);
            writeintentry(p^.l);
 
 
          { write name label }
          { write name label }
-         asmlist[datasegment].concat(Tai_const.Create_32bit(p^.data.messageinf.i));
-         asmlist[datasegment].concat(Tai_const.Createname(p^.data.mangledname,AT_FUNCTION,0));
+         asmlist[al_data].concat(Tai_const.Create_32bit(p^.data.messageinf.i));
+         asmlist[al_data].concat(Tai_const.Createname(p^.data.mangledname,AT_FUNCTION,0));
 
 
          if assigned(p^.r) then
          if assigned(p^.r) then
            writeintentry(p^.r);
            writeintentry(p^.r);
@@ -343,10 +343,10 @@ implementation
 
 
          { now start writing of the message string table }
          { now start writing of the message string table }
          objectlibrary.getdatalabel(r);
          objectlibrary.getdatalabel(r);
-         asmlist[datasegment].concat(cai_align.create(const_align(sizeof(aint))));
-         asmlist[datasegment].concat(Tai_label.Create(r));
+         asmlist[al_data].concat(cai_align.create(const_align(sizeof(aint))));
+         asmlist[al_data].concat(Tai_label.Create(r));
          genintmsgtab:=r;
          genintmsgtab:=r;
-         asmlist[datasegment].concat(Tai_const.Create_32bit(count));
+         asmlist[al_data].concat(Tai_const.Create_32bit(count));
          if assigned(root) then
          if assigned(root) then
            begin
            begin
               writeintentry(root);
               writeintentry(root);
@@ -390,7 +390,7 @@ implementation
       begin
       begin
          if assigned(p^.l) then
          if assigned(p^.l) then
            writedmtindexentry(p^.l);
            writedmtindexentry(p^.l);
-         dataSegment.concat(Tai_const.Create_32bit(p^.data.messageinf.i));
+         al_data.concat(Tai_const.Create_32bit(p^.data.messageinf.i));
          if assigned(p^.r) then
          if assigned(p^.r) then
            writedmtindexentry(p^.r);
            writedmtindexentry(p^.r);
       end;
       end;
@@ -400,7 +400,7 @@ implementation
       begin
       begin
          if assigned(p^.l) then
          if assigned(p^.l) then
            writedmtaddressentry(p^.l);
            writedmtaddressentry(p^.l);
-         dataSegment.concat(Tai_const_symbol.Createname(p^.data.mangledname,AT_FUNCTION,0));
+         al_data.concat(Tai_const_symbol.Createname(p^.data.mangledname,AT_FUNCTION,0));
          if assigned(p^.r) then
          if assigned(p^.r) then
            writedmtaddressentry(p^.r);
            writedmtaddressentry(p^.r);
       end;
       end;
@@ -421,13 +421,13 @@ implementation
            begin
            begin
               objectlibrary.getdatalabel(r);
               objectlibrary.getdatalabel(r);
               gendmt:=r;
               gendmt:=r;
-              datasegment.concat(cai_align.create(const_align(sizeof(aint))));
-              dataSegment.concat(Tai_label.Create(r));
+              al_data.concat(cai_align.create(const_align(sizeof(aint))));
+              al_data.concat(Tai_label.Create(r));
               { entries for caching }
               { entries for caching }
-              dataSegment.concat(Tai_const.Create_ptr(0));
-              dataSegment.concat(Tai_const.Create_ptr(0));
+              al_data.concat(Tai_const.Create_ptr(0));
+              al_data.concat(Tai_const.Create_ptr(0));
 
 
-              dataSegment.concat(Tai_const.Create_32bit(count));
+              al_data.concat(Tai_const.Create_32bit(count));
               if assigned(root) then
               if assigned(root) then
                 begin
                 begin
                    writedmtindexentry(root);
                    writedmtindexentry(root);
@@ -477,16 +477,16 @@ implementation
                    begin
                    begin
                      objectlibrary.getdatalabel(l);
                      objectlibrary.getdatalabel(l);
 
 
-                     asmlist[consts].concat(cai_align.create(const_align(sizeof(aint))));
-                     asmlist[consts].concat(Tai_label.Create(l));
-                     asmlist[consts].concat(Tai_const.Create_8bit(length(tsym(p).realname)));
-                     asmlist[consts].concat(Tai_string.Create(tsym(p).realname));
+                     asmlist[al_typedconsts].concat(cai_align.create(const_align(sizeof(aint))));
+                     asmlist[al_typedconsts].concat(Tai_label.Create(l));
+                     asmlist[al_typedconsts].concat(Tai_const.Create_8bit(length(tsym(p).realname)));
+                     asmlist[al_typedconsts].concat(Tai_string.Create(tsym(p).realname));
 
 
-                     asmlist[datasegment].concat(Tai_const.Create_sym(l));
+                     asmlist[al_data].concat(Tai_const.Create_sym(l));
                      if po_abstractmethod in pd.procoptions then
                      if po_abstractmethod in pd.procoptions then
-                       asmlist[datasegment].concat(Tai_const.Create_sym(nil))
+                       asmlist[al_data].concat(Tai_const.Create_sym(nil))
                      else
                      else
-                       asmlist[datasegment].concat(Tai_const.Createname(pd.mangledname,AT_FUNCTION,0));
+                       asmlist[al_data].concat(Tai_const.Createname(pd.mangledname,AT_FUNCTION,0));
                    end;
                    end;
                 end;
                 end;
            end;
            end;
@@ -505,9 +505,9 @@ implementation
          if count>0 then
          if count>0 then
            begin
            begin
               objectlibrary.getdatalabel(l);
               objectlibrary.getdatalabel(l);
-              asmlist[datasegment].concat(cai_align.create(const_align(sizeof(aint))));
-              asmlist[datasegment].concat(Tai_label.Create(l));
-              asmlist[datasegment].concat(Tai_const.Create_32bit(count));
+              asmlist[al_data].concat(cai_align.create(const_align(sizeof(aint))));
+              asmlist[al_data].concat(Tai_label.Create(l));
+              asmlist[al_data].concat(Tai_const.Create_32bit(count));
               _class.symtable.foreach(@do_gen_published_methods,nil);
               _class.symtable.foreach(@do_gen_published_methods,nil);
               genpublishedmethodstable:=l;
               genpublishedmethodstable:=l;
            end
            end
@@ -906,17 +906,17 @@ implementation
             rawdata.concat(Tai_const.Create_16bit(curintf.iidguid^.D3));
             rawdata.concat(Tai_const.Create_16bit(curintf.iidguid^.D3));
             for i:=Low(curintf.iidguid^.D4) to High(curintf.iidguid^.D4) do
             for i:=Low(curintf.iidguid^.D4) to High(curintf.iidguid^.D4) do
               rawdata.concat(Tai_const.Create_8bit(curintf.iidguid^.D4[i]));
               rawdata.concat(Tai_const.Create_8bit(curintf.iidguid^.D4[i]));
-            asmlist[datasegment].concat(Tai_const.Create_sym(tmplabel));
+            asmlist[al_data].concat(Tai_const.Create_sym(tmplabel));
           end
           end
         else
         else
           begin
           begin
             { nil for Corba interfaces }
             { nil for Corba interfaces }
-            asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+            asmlist[al_data].concat(Tai_const.Create_sym(nil));
           end;
           end;
         { VTable }
         { VTable }
-        asmlist[datasegment].concat(Tai_const.Createname(gintfgetvtbllabelname(contintfindex),AT_DATA,0));
+        asmlist[al_data].concat(Tai_const.Createname(gintfgetvtbllabelname(contintfindex),AT_DATA,0));
         { IOffset field }
         { IOffset field }
-        asmlist[datasegment].concat(Tai_const.Create_32bit(implintf.ioffsets(contintfindex)));
+        asmlist[al_data].concat(Tai_const.Create_32bit(implintf.ioffsets(contintfindex)));
         { IIDStr }
         { IIDStr }
         objectlibrary.getdatalabel(tmplabel);
         objectlibrary.getdatalabel(tmplabel);
         rawdata.concat(cai_align.create(const_align(sizeof(aint))));
         rawdata.concat(cai_align.create(const_align(sizeof(aint))));
@@ -926,7 +926,7 @@ implementation
           rawdata.concat(Tai_string.Create(upper(curintf.iidstr^)))
           rawdata.concat(Tai_string.Create(upper(curintf.iidstr^)))
         else
         else
           rawdata.concat(Tai_string.Create(curintf.iidstr^));
           rawdata.concat(Tai_string.Create(curintf.iidstr^));
-        asmlist[datasegment].concat(Tai_const.Create_sym(tmplabel));
+        asmlist[al_data].concat(Tai_const.Create_sym(tmplabel));
       end;
       end;
 
 
 
 
@@ -1037,7 +1037,7 @@ implementation
         max:=_class.implementedinterfaces.count;
         max:=_class.implementedinterfaces.count;
 
 
         rawdata:=TAAsmOutput.Create;
         rawdata:=TAAsmOutput.Create;
-        asmlist[datasegment].concat(Tai_const.Create_16bit(max));
+        asmlist[al_data].concat(Tai_const.Create_16bit(max));
         { Two pass, one for allocation and vtbl creation }
         { Two pass, one for allocation and vtbl creation }
         for i:=1 to max do
         for i:=1 to max do
           begin
           begin
@@ -1062,7 +1062,7 @@ implementation
               _class.implementedinterfaces.setioffsets(i,_class.implementedinterfaces.ioffsets(j));
               _class.implementedinterfaces.setioffsets(i,_class.implementedinterfaces.ioffsets(j));
             gintfgenentry(i,j,rawdata);
             gintfgenentry(i,j,rawdata);
           end;
           end;
-        asmlist[datasegment].concatlist(rawdata);
+        asmlist[al_data].concatlist(rawdata);
         rawdata.free;
         rawdata.free;
       end;
       end;
 
 
@@ -1160,8 +1160,8 @@ implementation
         { 2. step calc required fieldcount and their offsets in the object memory map
         { 2. step calc required fieldcount and their offsets in the object memory map
              and write data }
              and write data }
         objectlibrary.getdatalabel(intftable);
         objectlibrary.getdatalabel(intftable);
-        asmlist[datasegment].concat(cai_align.create(const_align(sizeof(aint))));
-        asmlist[datasegment].concat(Tai_label.Create(intftable));
+        asmlist[al_data].concat(cai_align.create(const_align(sizeof(aint))));
+        asmlist[al_data].concat(Tai_label.Create(intftable));
         { Optimize interface tables to reuse wrappers }
         { Optimize interface tables to reuse wrappers }
         gintfoptimizevtbls;
         gintfoptimizevtbls;
         { Write interface tables }
         { Write interface tables }
@@ -1179,21 +1179,21 @@ implementation
       if assigned(_class.iidguid) then
       if assigned(_class.iidguid) then
         begin
         begin
           s:=make_mangledname('IID',_class.owner,_class.objname^);
           s:=make_mangledname('IID',_class.owner,_class.objname^);
-          maybe_new_object_file(asmlist[datasegment]);
-          new_section(asmlist[datasegment],sec_rodata,s,const_align(sizeof(aint)));
-          asmlist[datasegment].concat(Tai_symbol.Createname_global(s,AT_DATA,0));
-          asmlist[datasegment].concat(Tai_const.Create_32bit(longint(_class.iidguid^.D1)));
-          asmlist[datasegment].concat(Tai_const.Create_16bit(_class.iidguid^.D2));
-          asmlist[datasegment].concat(Tai_const.Create_16bit(_class.iidguid^.D3));
+          maybe_new_object_file(asmlist[al_data]);
+          new_section(asmlist[al_data],sec_rodata,s,const_align(sizeof(aint)));
+          asmlist[al_data].concat(Tai_symbol.Createname_global(s,AT_DATA,0));
+          asmlist[al_data].concat(Tai_const.Create_32bit(longint(_class.iidguid^.D1)));
+          asmlist[al_data].concat(Tai_const.Create_16bit(_class.iidguid^.D2));
+          asmlist[al_data].concat(Tai_const.Create_16bit(_class.iidguid^.D3));
           for i:=Low(_class.iidguid^.D4) to High(_class.iidguid^.D4) do
           for i:=Low(_class.iidguid^.D4) to High(_class.iidguid^.D4) do
-            asmlist[datasegment].concat(Tai_const.Create_8bit(_class.iidguid^.D4[i]));
+            asmlist[al_data].concat(Tai_const.Create_8bit(_class.iidguid^.D4[i]));
         end;
         end;
-      maybe_new_object_file(asmlist[datasegment]);
+      maybe_new_object_file(asmlist[al_data]);
       s:=make_mangledname('IIDSTR',_class.owner,_class.objname^);
       s:=make_mangledname('IIDSTR',_class.owner,_class.objname^);
-      new_section(asmlist[datasegment],sec_rodata,s,0);
-      asmlist[datasegment].concat(Tai_symbol.Createname_global(s,AT_DATA,0));
-      asmlist[datasegment].concat(Tai_const.Create_8bit(length(_class.iidstr^)));
-      asmlist[datasegment].concat(Tai_string.Create(_class.iidstr^));
+      new_section(asmlist[al_data],sec_rodata,s,0);
+      asmlist[al_data].concat(Tai_symbol.Createname_global(s,AT_DATA,0));
+      asmlist[al_data].concat(Tai_const.Create_8bit(length(_class.iidstr^)));
+      asmlist[al_data].concat(Tai_string.Create(_class.iidstr^));
     end;
     end;
 
 
 
 
@@ -1258,8 +1258,8 @@ implementation
          if is_class(_class) then
          if is_class(_class) then
           begin
           begin
             objectlibrary.getdatalabel(classnamelabel);
             objectlibrary.getdatalabel(classnamelabel);
-            maybe_new_object_file(asmlist[datasegment]);
-            new_section(asmlist[datasegment],sec_rodata,classnamelabel.name,const_align(sizeof(aint)));
+            maybe_new_object_file(asmlist[al_data]);
+            new_section(asmlist[al_data],sec_rodata,classnamelabel.name,const_align(sizeof(aint)));
 
 
             { interface table }
             { interface table }
             if _class.implementedinterfaces.count>0 then
             if _class.implementedinterfaces.count>0 then
@@ -1268,9 +1268,9 @@ implementation
             methodnametable:=genpublishedmethodstable;
             methodnametable:=genpublishedmethodstable;
             fieldtablelabel:=_class.generate_field_table;
             fieldtablelabel:=_class.generate_field_table;
             { write class name }
             { write class name }
-            asmlist[datasegment].concat(Tai_label.Create(classnamelabel));
-            asmlist[datasegment].concat(Tai_const.Create_8bit(length(_class.objrealname^)));
-            asmlist[datasegment].concat(Tai_string.Create(_class.objrealname^));
+            asmlist[al_data].concat(Tai_label.Create(classnamelabel));
+            asmlist[al_data].concat(Tai_const.Create_8bit(length(_class.objrealname^)));
+            asmlist[al_data].concat(Tai_string.Create(_class.objrealname^));
 
 
             { generate message and dynamic tables }
             { generate message and dynamic tables }
             if (oo_has_msgstr in _class.objectoptions) then
             if (oo_has_msgstr in _class.objectoptions) then
@@ -1280,30 +1280,30 @@ implementation
           end;
           end;
 
 
         { write debug info }
         { write debug info }
-        maybe_new_object_file(asmlist[datasegment]);
-        new_section(asmlist[datasegment],sec_rodata,_class.vmt_mangledname,const_align(sizeof(aint)));
+        maybe_new_object_file(asmlist[al_data]);
+        new_section(asmlist[al_data],sec_rodata,_class.vmt_mangledname,const_align(sizeof(aint)));
 {$ifdef GDB}
 {$ifdef GDB}
         if (cs_debuginfo in aktmoduleswitches) then
         if (cs_debuginfo in aktmoduleswitches) then
          begin
          begin
            do_count_dbx:=true;
            do_count_dbx:=true;
            if assigned(_class.owner) and assigned(_class.owner.name) then
            if assigned(_class.owner) and assigned(_class.owner.name) then
-             asmlist[datasegment].concat(Tai_stabs.Create(strpnew('"vmt_'+_class.owner.name^+_class.name+':S'+
+             asmlist[al_data].concat(Tai_stabs.Create(strpnew('"vmt_'+_class.owner.name^+_class.name+':S'+
                tstoreddef(vmttype.def).numberstring+'",'+tostr(N_STSYM)+',0,0,'+_class.vmt_mangledname)));
                tstoreddef(vmttype.def).numberstring+'",'+tostr(N_STSYM)+',0,0,'+_class.vmt_mangledname)));
          end;
          end;
 {$endif GDB}
 {$endif GDB}
-         asmlist[datasegment].concat(Tai_symbol.Createname_global(_class.vmt_mangledname,AT_DATA,0));
+         asmlist[al_data].concat(Tai_symbol.Createname_global(_class.vmt_mangledname,AT_DATA,0));
 
 
          { determine the size with symtable.datasize, because }
          { determine the size with symtable.datasize, because }
          { size gives back 4 for classes                    }
          { size gives back 4 for classes                    }
-         asmlist[datasegment].concat(Tai_const.Create(ait_const_ptr,tobjectsymtable(_class.symtable).datasize));
-         asmlist[datasegment].concat(Tai_const.Create(ait_const_ptr,-int64(tobjectsymtable(_class.symtable).datasize)));
+         asmlist[al_data].concat(Tai_const.Create(ait_const_ptr,tobjectsymtable(_class.symtable).datasize));
+         asmlist[al_data].concat(Tai_const.Create(ait_const_ptr,-int64(tobjectsymtable(_class.symtable).datasize)));
 {$ifdef WITHDMT}
 {$ifdef WITHDMT}
          if _class.classtype=ct_object then
          if _class.classtype=ct_object then
            begin
            begin
               if assigned(dmtlabel) then
               if assigned(dmtlabel) then
-                asmlist[datasegment].concat(Tai_const_symbol.Create(dmtlabel)))
+                asmlist[al_data].concat(Tai_const_symbol.Create(dmtlabel)))
               else
               else
-                asmlist[datasegment].concat(Tai_const.Create_ptr(0));
+                asmlist[al_data].concat(Tai_const.Create_ptr(0));
            end;
            end;
 {$endif WITHDMT}
 {$endif WITHDMT}
          { write pointer to parent VMT, this isn't implemented in TP }
          { write pointer to parent VMT, this isn't implemented in TP }
@@ -1312,52 +1312,52 @@ implementation
          { it is not written for parents that don't have any vmt !! }
          { it is not written for parents that don't have any vmt !! }
          if assigned(_class.childof) and
          if assigned(_class.childof) and
             (oo_has_vmt in _class.childof.objectoptions) then
             (oo_has_vmt in _class.childof.objectoptions) then
-           asmlist[datasegment].concat(Tai_const.Createname(_class.childof.vmt_mangledname,AT_DATA,0))
+           asmlist[al_data].concat(Tai_const.Createname(_class.childof.vmt_mangledname,AT_DATA,0))
          else
          else
-           asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+           asmlist[al_data].concat(Tai_const.Create_sym(nil));
 
 
          { write extended info for classes, for the order see rtl/inc/objpash.inc }
          { write extended info for classes, for the order see rtl/inc/objpash.inc }
          if is_class(_class) then
          if is_class(_class) then
           begin
           begin
             { pointer to class name string }
             { pointer to class name string }
-            asmlist[datasegment].concat(Tai_const.Create_sym(classnamelabel));
+            asmlist[al_data].concat(Tai_const.Create_sym(classnamelabel));
             { pointer to dynamic table or nil }
             { pointer to dynamic table or nil }
             if (oo_has_msgint in _class.objectoptions) then
             if (oo_has_msgint in _class.objectoptions) then
-              asmlist[datasegment].concat(Tai_const.Create_sym(intmessagetable))
+              asmlist[al_data].concat(Tai_const.Create_sym(intmessagetable))
             else
             else
-              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+              asmlist[al_data].concat(Tai_const.Create_sym(nil));
             { pointer to method table or nil }
             { pointer to method table or nil }
-            asmlist[datasegment].concat(Tai_const.Create_sym(methodnametable));
+            asmlist[al_data].concat(Tai_const.Create_sym(methodnametable));
             { pointer to field table }
             { pointer to field table }
-            asmlist[datasegment].concat(Tai_const.Create_sym(fieldtablelabel));
+            asmlist[al_data].concat(Tai_const.Create_sym(fieldtablelabel));
             { pointer to type info of published section }
             { pointer to type info of published section }
             if (oo_can_have_published in _class.objectoptions) then
             if (oo_can_have_published in _class.objectoptions) then
-              asmlist[datasegment].concat(Tai_const.Create_sym(_class.get_rtti_label(fullrtti)))
+              asmlist[al_data].concat(Tai_const.Create_sym(_class.get_rtti_label(fullrtti)))
             else
             else
-              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+              asmlist[al_data].concat(Tai_const.Create_sym(nil));
             { inittable for con-/destruction }
             { inittable for con-/destruction }
             if _class.members_need_inittable then
             if _class.members_need_inittable then
-              asmlist[datasegment].concat(Tai_const.Create_sym(_class.get_rtti_label(initrtti)))
+              asmlist[al_data].concat(Tai_const.Create_sym(_class.get_rtti_label(initrtti)))
             else
             else
-              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+              asmlist[al_data].concat(Tai_const.Create_sym(nil));
             { auto table }
             { auto table }
-            asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+            asmlist[al_data].concat(Tai_const.Create_sym(nil));
             { interface table }
             { interface table }
             if _class.implementedinterfaces.count>0 then
             if _class.implementedinterfaces.count>0 then
-              asmlist[datasegment].concat(Tai_const.Create_sym(interfacetable))
+              asmlist[al_data].concat(Tai_const.Create_sym(interfacetable))
             else
             else
-              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+              asmlist[al_data].concat(Tai_const.Create_sym(nil));
             { table for string messages }
             { table for string messages }
             if (oo_has_msgstr in _class.objectoptions) then
             if (oo_has_msgstr in _class.objectoptions) then
-              asmlist[datasegment].concat(Tai_const.Create_sym(strmessagetable))
+              asmlist[al_data].concat(Tai_const.Create_sym(strmessagetable))
             else
             else
-              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+              asmlist[al_data].concat(Tai_const.Create_sym(nil));
           end;
           end;
          { write virtual methods }
          { write virtual methods }
-         writevirtualmethods(asmlist[datasegment]);
-         asmlist[datasegment].concat(Tai_const.create(ait_const_ptr,0));
+         writevirtualmethods(asmlist[al_data]);
+         asmlist[al_data].concat(Tai_const.create(ait_const_ptr,0));
          { write the size of the VMT }
          { write the size of the VMT }
-         asmlist[datasegment].concat(Tai_symbol_end.Createname(_class.vmt_mangledname));
+         asmlist[al_data].concat(Tai_symbol_end.Createname(_class.vmt_mangledname));
       end;
       end;
 
 
 
 

+ 9 - 9
compiler/parser.pas

@@ -251,8 +251,8 @@ implementation
       begin
       begin
          exprasmlist:=taasmoutput.create;
          exprasmlist:=taasmoutput.create;
          { Create assembler output lists for CG }
          { Create assembler output lists for CG }
-         to_create:=[datasegment,codesegment,bsssegment,debuglist,
-                     threadvarsegment,withdebuglist,consts,rttilist,picdata];
+         to_create:=[al_code,al_bss,al_debug,al_data,al_rodata,
+                     al_threadvars,al_withdebug,al_typedconsts,al_rotypedconsts,al_rtti,al_picdata];
          for i:=low(Tasmlist) to high(Tasmlist) do
          for i:=low(Tasmlist) to high(Tasmlist) do
            if i in to_create then
            if i in to_create then
              asmlist[i]:=Taasmoutput.create
              asmlist[i]:=Taasmoutput.create
@@ -260,9 +260,9 @@ implementation
              asmlist[i]:=nil;
              asmlist[i]:=nil;
 
 
          if target_info.system=system_powerpc_darwin then
          if target_info.system=system_powerpc_darwin then
-           asmlist[picdata].concat(tai_simple.create(ait_non_lazy_symbol_pointer));
+           asmlist[al_picdata].concat(tai_simple.create(ait_non_lazy_symbol_pointer));
          { Resource strings }
          { Resource strings }
-         cresstr.ResourceStrings:=TResourceStrings.Create;
+         cresstr.al_resourcestrings:=Tal_resourcestrings.Create;
          { use the librarydata from current_module }
          { use the librarydata from current_module }
          objectlibrary:=current_module.librarydata;
          objectlibrary:=current_module.librarydata;
       end;
       end;
@@ -285,7 +285,7 @@ implementation
          d.free;
          d.free;
 {$endif}
 {$endif}
          { resource strings }
          { resource strings }
-         cresstr.resourcestrings.free;
+         cresstr.al_resourcestrings.free;
          objectlibrary:=nil;
          objectlibrary:=nil;
       end;
       end;
 
 
@@ -319,8 +319,8 @@ implementation
           oldexprasmlist:Taasmoutput;
           oldexprasmlist:Taasmoutput;
           oldasmlist:array[Tasmlist] of Taasmoutput;
           oldasmlist:array[Tasmlist] of Taasmoutput;
           oldobjectlibrary : tasmlibrarydata;
           oldobjectlibrary : tasmlibrarydata;
-        { resourcestrings }
-          OldResourceStrings : tResourceStrings;
+        { al_resourcestrings }
+          Oldal_resourcestrings : tal_resourcestrings;
         { akt.. things }
         { akt.. things }
           oldaktlocalswitches  : tlocalswitches;
           oldaktlocalswitches  : tlocalswitches;
           oldaktmoduleswitches : tmoduleswitches;
           oldaktmoduleswitches : tmoduleswitches;
@@ -380,7 +380,7 @@ implementation
             oldasmlist:=asmlist;
             oldasmlist:=asmlist;
             oldexprasmlist:=exprasmlist;
             oldexprasmlist:=exprasmlist;
             oldobjectlibrary:=objectlibrary;
             oldobjectlibrary:=objectlibrary;
-            OldResourceStrings:=ResourceStrings;
+            Oldal_resourcestrings:=al_resourcestrings;
           { save akt... state }
           { save akt... state }
           { handle the postponed case first }
           { handle the postponed case first }
            if localswitcheschanged then
            if localswitcheschanged then
@@ -543,7 +543,7 @@ implementation
                    exprasmlist:=oldexprasmlist;
                    exprasmlist:=oldexprasmlist;
                    asmlist:=oldasmlist;
                    asmlist:=oldasmlist;
                    { object data }
                    { object data }
-                   ResourceStrings:=OldResourceStrings;
+                   al_resourcestrings:=Oldal_resourcestrings;
                    objectlibrary:=oldobjectlibrary;
                    objectlibrary:=oldobjectlibrary;
                    { restore previous scanner }
                    { restore previous scanner }
                    if assigned(old_compiled_module) then
                    if assigned(old_compiled_module) then

+ 4 - 5
compiler/pdecl.pas

@@ -204,7 +204,6 @@ implementation
                    sym:=ttypedconstsym.createtype(orgname,tt,(cs_typed_const_writable in aktlocalswitches));
                    sym:=ttypedconstsym.createtype(orgname,tt,(cs_typed_const_writable in aktlocalswitches));
                    akttokenpos:=storetokenpos;
                    akttokenpos:=storetokenpos;
                    symtablestack.insert(sym);
                    symtablestack.insert(sym);
-                   insertconstdata(ttypedconstsym(sym));
                    { procvar can have proc directives, but not type references }
                    { procvar can have proc directives, but not type references }
                    if (tt.def.deftype=procvardef) and
                    if (tt.def.deftype=procvardef) and
                       (tt.sym=nil) then
                       (tt.sym=nil) then
@@ -334,21 +333,21 @@ implementation
                        { avoid wrong unused warnings web bug 801 PM }
                        { avoid wrong unused warnings web bug 801 PM }
                        inc(ttypesym(srsym).refs);
                        inc(ttypesym(srsym).refs);
 {$ifdef GDB_UNUSED}
 {$ifdef GDB_UNUSED}
-                       if (cs_debuginfo in aktmoduleswitches) and assigned(debuglist) and
+                       if (cs_debuginfo in aktmoduleswitches) and assigned(al_debug) and
                           (tsym(p).owner.symtabletype in [globalsymtable,staticsymtable]) then
                           (tsym(p).owner.symtabletype in [globalsymtable,staticsymtable]) then
                         begin
                         begin
                           ttypesym(p).isusedinstab:=true;
                           ttypesym(p).isusedinstab:=true;
-{                          ttypesym(p).concatstabto(debuglist);}
+{                          ttypesym(p).concatstabto(al_debug);}
                           {not stabs for forward defs }
                           {not stabs for forward defs }
                           if not Ttypesym(p).isstabwritten then
                           if not Ttypesym(p).isstabwritten then
                             begin
                             begin
                               if Ttypesym(p).restype.def.typesym=p then
                               if Ttypesym(p).restype.def.typesym=p then
-                                Tstoreddef(Ttypesym(p).restype.def).concatstabto(debuglist)
+                                Tstoreddef(Ttypesym(p).restype.def).concatstabto(al_debug)
                               else
                               else
                                 begin
                                 begin
                                   stab_str:=Ttypesym(p).stabstring;
                                   stab_str:=Ttypesym(p).stabstring;
                                   if assigned(stab_str) then
                                   if assigned(stab_str) then
-                                    debuglist.concat(Tai_stabs.create(stab_str));
+                                    al_debug.concat(Tai_stabs.create(stab_str));
                                   Ttypesym(p).isstabwritten:=true;
                                   Ttypesym(p).isstabwritten:=true;
                                 end;
                                 end;
                             end;
                             end;

+ 2 - 4
compiler/pdecvar.pas

@@ -652,7 +652,6 @@ implementation
               tcsym:=ttypedconstsym.createtype('default'+vs.realname,tt,false);
               tcsym:=ttypedconstsym.createtype('default'+vs.realname,tt,false);
               vs.defaultconstsym:=tcsym;
               vs.defaultconstsym:=tcsym;
               symtablestack.insert(tcsym);
               symtablestack.insert(tcsym);
-              insertconstdata(tcsym);
               readtypedconst(tt,tcsym,false);
               readtypedconst(tt,tcsym,false);
               { The variable has a value assigned }
               { The variable has a value assigned }
               vs.varstate:=vs_assigned;
               vs.varstate:=vs_assigned;
@@ -663,7 +662,6 @@ implementation
               tcsym.fileinfo:=vs.fileinfo;
               tcsym.fileinfo:=vs.fileinfo;
               symtablestack.replace(vs,tcsym);
               symtablestack.replace(vs,tcsym);
               vs.free;
               vs.free;
-              insertconstdata(tcsym);
               consume(_EQUAL);
               consume(_EQUAL);
               readtypedconst(tt,tcsym,true);
               readtypedconst(tt,tcsym,true);
             end;
             end;
@@ -723,7 +721,7 @@ implementation
           consume(_ID);
           consume(_ID);
          { read vars }
          { read vars }
          sc:=tsinglelist.create;
          sc:=tsinglelist.create;
-         while (token=_ID) and 
+         while (token=_ID) and
             not((vd_object in options) and
             not((vd_object in options) and
                 (idtoken in [_PUBLIC,_PRIVATE,_PUBLISHED,_PROTECTED,_STRICT])) do
                 (idtoken in [_PUBLIC,_PRIVATE,_PUBLISHED,_PROTECTED,_STRICT])) do
            begin
            begin
@@ -1119,7 +1117,7 @@ implementation
                    if vs.typ=globalvarsym then
                    if vs.typ=globalvarsym then
                      begin
                      begin
                        tglobalvarsym(vs).set_mangledname(C_Name);
                        tglobalvarsym(vs).set_mangledname(C_Name);
-                       { insert in the datasegment when it is not external }
+                       { insert in the al_data when it is not external }
                        if (not extern_var) then
                        if (not extern_var) then
                          insertbssdata(tglobalvarsym(vs));
                          insertbssdata(tglobalvarsym(vs));
                        { now we can insert it in the import lib if its a dll, or
                        { now we can insert it in the import lib if its a dll, or

+ 70 - 68
compiler/pmodules.pas

@@ -84,10 +84,10 @@ implementation
            { Recreate import section }
            { Recreate import section }
            if (target_info.system in [system_i386_win32,system_i386_wdosx]) then
            if (target_info.system in [system_i386_win32,system_i386_wdosx]) then
             begin
             begin
-              if assigned(asmlist[importsection]) then
-               asmlist[importsection].clear
+              if assigned(asmlist[al_imports]) then
+               asmlist[al_imports].clear
               else
               else
-               asmlist[importsection]:=taasmoutput.Create;
+               asmlist[al_imports]:=taasmoutput.Create;
               importlib.generatelib;
               importlib.generatelib;
             end;
             end;
            { Readd the not processed files }
            { Readd the not processed files }
@@ -106,10 +106,10 @@ implementation
         if (cs_create_smart in aktmoduleswitches) then
         if (cs_create_smart in aktmoduleswitches) then
          begin
          begin
            { regenerate the importssection for win32 }
            { regenerate the importssection for win32 }
-           if assigned(asmlist[importsection]) and
+           if assigned(asmlist[al_imports]) and
               (target_info.system in [system_i386_win32,system_i386_wdosx, system_arm_wince,system_i386_wince]) then
               (target_info.system in [system_i386_win32,system_i386_wdosx, system_arm_wince,system_i386_wince]) then
             begin
             begin
-              asmlist[importsection].clear;
+              asmlist[al_imports].clear;
               importlib.generatesmartlib;
               importlib.generatesmartlib;
             end;
             end;
 
 
@@ -139,11 +139,11 @@ implementation
 
 
     procedure create_dwarf;
     procedure create_dwarf;
       begin
       begin
-        asmlist[dwarflist]:=taasmoutput.create;
+        asmlist[al_dwarf]:=taasmoutput.create;
         { Call frame information }
         { Call frame information }
         if (tf_needs_dwarf_cfi in target_info.flags) and
         if (tf_needs_dwarf_cfi in target_info.flags) and
            (af_supports_dwarf in target_asm.flags) then
            (af_supports_dwarf in target_asm.flags) then
-          dwarfcfi.generate_code(asmlist[dwarflist]);
+          dwarfcfi.generate_code(asmlist[al_dwarf]);
       end;
       end;
 
 
 
 
@@ -160,32 +160,34 @@ implementation
            then
            then
          begin
          begin
            { align the first data }
            { align the first data }
-           asmlist[datasegment].insert(Tai_align.Create(const_align(32)));
-           asmlist[datasegment].insert(Tai_string.Create('FPC '+full_version_string+
+           asmlist[al_data].insert(Tai_align.Create(const_align(32)));
+           asmlist[al_data].insert(Tai_string.Create('FPC '+full_version_string+
              ' ['+date_string+'] for '+target_cpu_string+' - '+target_info.shortname));
              ' ['+date_string+'] for '+target_cpu_string+' - '+target_info.shortname));
          end;
          end;
         { align code segment }
         { align code segment }
-        asmlist[codesegment].concat(Tai_align.create(aktalignment.procalign));
+        asmlist[al_code].concat(Tai_align.create(aktalignment.procalign));
         { Insert start and end of sections }
         { Insert start and end of sections }
-        fixseg(asmlist[codesegment],sec_code,'____seg_code');
-        fixseg(asmlist[datasegment],sec_data,'____seg_data');
-        fixseg(asmlist[bsssegment],sec_bss,'____seg_bss');
-        fixseg(asmlist[threadvarsegment],sec_bss,'____seg_tbss');
+        fixseg(asmlist[al_code],sec_code,'____seg_code');
+        fixseg(asmlist[al_data],sec_data,'____seg_data');
+        fixseg(asmlist[al_rodata],sec_rodata,'____seg_rodata');
+        fixseg(asmlist[al_bss],sec_bss,'____seg_bss');
+        fixseg(asmlist[al_threadvars],sec_bss,'____seg_tbss');
         { we should use .rdata section for these two no ?
         { we should use .rdata section for these two no ?
           .rdata is a read only data section (PM) }
           .rdata is a read only data section (PM) }
-        fixseg(asmlist[rttilist],sec_data,'____seg_rtti');
-        fixseg(asmlist[consts],sec_data,'____seg_consts');
-        fixseg(asmlist[picdata],sec_data,'____seg_picdata');
-        if assigned(asmlist[aasmtai.resourcestrings]) then
-          fixseg(asmlist[aasmtai.resourcestrings],sec_data,'____seg_resstrings');
+        fixseg(asmlist[al_rtti],sec_data,'____seg_rtti');
+        fixseg(asmlist[al_typedconsts],sec_data,'____seg_consts');
+        fixseg(asmlist[al_rotypedconsts],sec_rodata,'____seg_consts');
+        fixseg(asmlist[al_picdata],sec_data,'____seg_al_picdata');
+        if assigned(asmlist[aasmtai.al_resourcestrings]) then
+          fixseg(asmlist[aasmtai.al_resourcestrings],sec_data,'____seg_resstrings');
 {$ifdef GDB}
 {$ifdef GDB}
-        if assigned(asmlist[debuglist]) then
+        if assigned(asmlist[al_debug]) then
           begin
           begin
             oldaktfilepos:=aktfilepos;
             oldaktfilepos:=aktfilepos;
             aktfilepos.line:=0;
             aktfilepos.line:=0;
-            asmlist[debuglist].insert(Tai_symbol.Createname('gcc2_compiled',AT_DATA,0));
-            asmlist[debuglist].insert(Tai_symbol.Createname('fpc_compiled',AT_DATA,0));
-            fixseg(asmlist[debuglist],sec_code,'____seg_debug');
+            asmlist[al_debug].insert(Tai_symbol.Createname('gcc2_compiled',AT_DATA,0));
+            asmlist[al_debug].insert(Tai_symbol.Createname('fpc_compiled',AT_DATA,0));
+            fixseg(asmlist[al_debug],sec_code,'____seg_debug');
             aktfilepos:=oldaktfilepos;
             aktfilepos:=oldaktfilepos;
           end;
           end;
 {$endif GDB}
 {$endif GDB}
@@ -222,8 +224,8 @@ implementation
         ltvTables.insert(Tai_align.Create(const_align(sizeof(aint))));
         ltvTables.insert(Tai_align.Create(const_align(sizeof(aint))));
         ltvTables.concat(Tai_symbol_end.Createname('FPC_THREADVARTABLES'));
         ltvTables.concat(Tai_symbol_end.Createname('FPC_THREADVARTABLES'));
         { insert in data segment }
         { insert in data segment }
-        maybe_new_object_file(asmlist[datasegment]);
-        asmlist[datasegment].concatlist(ltvTables);
+        maybe_new_object_file(asmlist[al_data]);
+        asmlist[al_data].concatlist(ltvTables);
         ltvTables.free;
         ltvTables.free;
       end;
       end;
 
 
@@ -260,8 +262,8 @@ implementation
             ltvTable.insert(Tai_align.Create(const_align(32)));
             ltvTable.insert(Tai_align.Create(const_align(32)));
             ltvTable.concat(tai_const.create_sym(nil));  { end of list marker }
             ltvTable.concat(tai_const.create_sym(nil));  { end of list marker }
             ltvTable.concat(tai_symbol_end.createname(s));
             ltvTable.concat(tai_symbol_end.createname(s));
-            maybe_new_object_file(asmlist[datasegment]);
-            asmlist[datasegment].concatlist(ltvTable);
+            maybe_new_object_file(asmlist[al_data]);
+            asmlist[al_data].concatlist(ltvTable);
             current_module.flags:=current_module.flags or uf_threadvars;
             current_module.flags:=current_module.flags or uf_threadvars;
           end;
           end;
          ltvTable.Free;
          ltvTable.Free;
@@ -288,7 +290,7 @@ implementation
            hp:=tused_unit(hp.next);
            hp:=tused_unit(hp.next);
          end;
          end;
         { Add program resources, if any }
         { Add program resources, if any }
-        if asmlist[aasmtai.resourcestrings]<>nil then
+        if asmlist[aasmtai.al_resourcestrings]<>nil then
          begin
          begin
            ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESOURCESTRINGLIST',current_module.localsymtable,''),AT_DATA,0));
            ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESOURCESTRINGLIST',current_module.localsymtable,''),AT_DATA,0));
            Inc(Count);
            Inc(Count);
@@ -299,8 +301,8 @@ implementation
         ResourceStringTables.insert(Tai_align.Create(const_align(4)));
         ResourceStringTables.insert(Tai_align.Create(const_align(4)));
         ResourceStringTables.concat(Tai_symbol_end.Createname('FPC_RESOURCESTRINGTABLES'));
         ResourceStringTables.concat(Tai_symbol_end.Createname('FPC_RESOURCESTRINGTABLES'));
         { insert in data segment }
         { insert in data segment }
-        maybe_new_object_file(asmlist[datasegment]);
-        asmlist[datasegment].concatlist(ResourceStringTables);
+        maybe_new_object_file(asmlist[al_data]);
+        asmlist[al_data].concatlist(ResourceStringTables);
         ResourceStringTables.free;
         ResourceStringTables.free;
       end;
       end;
 
 
@@ -351,8 +353,8 @@ implementation
         unitinits.insert(Tai_align.Create(const_align(4)));
         unitinits.insert(Tai_align.Create(const_align(4)));
         unitinits.concat(Tai_symbol_end.Createname('INITFINAL'));
         unitinits.concat(Tai_symbol_end.Createname('INITFINAL'));
         { insert in data segment }
         { insert in data segment }
-        maybe_new_object_file(asmlist[datasegment]);
-        asmlist[datasegment].concatlist(unitinits);
+        maybe_new_object_file(asmlist[al_data]);
+        asmlist[al_data].concatlist(unitinits);
         unitinits.free;
         unitinits.free;
       end;
       end;
 
 
@@ -360,11 +362,11 @@ implementation
     procedure insertmemorysizes;
     procedure insertmemorysizes;
       begin
       begin
         { stacksize can be specified and is now simulated }
         { stacksize can be specified and is now simulated }
-        asmlist[datasegment].concat(Tai_align.Create(const_align(4)));
-        asmlist[datasegment].concat(Tai_symbol.Createname_global('__stklen',AT_DATA,4));
-        asmlist[datasegment].concat(Tai_const.Create_32bit(stacksize));
-        asmlist[datasegment].concat(Tai_symbol.Createname_global('__heapsize',AT_DATA,4));
-        asmlist[datasegment].concat(Tai_const.Create_32bit(heapsize));
+        asmlist[al_data].concat(Tai_align.Create(const_align(4)));
+        asmlist[al_data].concat(Tai_symbol.Createname_global('__stklen',AT_DATA,4));
+        asmlist[al_data].concat(Tai_const.Create_32bit(stacksize));
+        asmlist[al_data].concat(Tai_symbol.Createname_global('__heapsize',AT_DATA,4));
+        asmlist[al_data].concat(Tai_const.Create_32bit(heapsize));
       end;
       end;
 
 
 
 
@@ -659,14 +661,14 @@ implementation
                    dependent stabs }
                    dependent stabs }
                  write_used_unit_type_info(pu.u);
                  write_used_unit_type_info(pu.u);
                  if assigned(pu.u.globalsymtable) then
                  if assigned(pu.u.globalsymtable) then
-                   tglobalsymtable(pu.u.globalsymtable).concattypestabto(asmlist[debuglist]);
+                   tglobalsymtable(pu.u.globalsymtable).concattypestabto(asmlist[al_debug]);
                end;
                end;
              pu:=tused_unit(pu.next);
              pu:=tused_unit(pu.next);
            end;
            end;
        end;
        end;
 
 
       var
       var
-        vardebuglist : taasmoutput;
+        varal_debug : taasmoutput;
         storefilepos : tfileposinfo;
         storefilepos : tfileposinfo;
       begin
       begin
         if not (cs_debuginfo in aktmoduleswitches) then
         if not (cs_debuginfo in aktmoduleswitches) then
@@ -678,37 +680,37 @@ implementation
         if current_module.is_unit then
         if current_module.is_unit then
           begin
           begin
             current_module.flags:=current_module.flags or uf_has_debuginfo;
             current_module.flags:=current_module.flags or uf_has_debuginfo;
-            asmlist[debuglist].concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.globalsymtable,''),AT_DATA,0));
+            asmlist[al_debug].concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.globalsymtable,''),AT_DATA,0));
           end
           end
         else
         else
-          asmlist[debuglist].concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.localsymtable,''),AT_DATA,0));
+          asmlist[al_debug].concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.localsymtable,''),AT_DATA,0));
         { first write all global/local symbols again to a temp list. This will flag
         { first write all global/local symbols again to a temp list. This will flag
           all required tdefs. After that the temp list can be removed since the debuginfo is already
           all required tdefs. After that the temp list can be removed since the debuginfo is already
           written to the stabs when the variables/consts were written }
           written to the stabs when the variables/consts were written }
 {$warning Hack to get all needed types}
 {$warning Hack to get all needed types}
-        vardebuglist:=taasmoutput.create;
-        new_section(vardebuglist,sec_data,'',0);
+        varal_debug:=taasmoutput.create;
+        new_section(varal_debug,sec_data,'',0);
         if assigned(current_module.globalsymtable) then
         if assigned(current_module.globalsymtable) then
-          tglobalsymtable(current_module.globalsymtable).concatstabto(vardebuglist);
+          tglobalsymtable(current_module.globalsymtable).concatstabto(varal_debug);
         if assigned(current_module.localsymtable) then
         if assigned(current_module.localsymtable) then
-          tstaticsymtable(current_module.localsymtable).concatstabto(vardebuglist);
-        vardebuglist.free;
+          tstaticsymtable(current_module.localsymtable).concatstabto(varal_debug);
+        varal_debug.free;
         { reset unit type info flag }
         { reset unit type info flag }
         reset_unit_type_info;
         reset_unit_type_info;
         { write used types from the used units }
         { write used types from the used units }
         write_used_unit_type_info(current_module);
         write_used_unit_type_info(current_module);
         { last write the types from this unit }
         { last write the types from this unit }
         if assigned(current_module.globalsymtable) then
         if assigned(current_module.globalsymtable) then
-          tglobalsymtable(current_module.globalsymtable).concattypestabto(asmlist[debuglist]);
+          tglobalsymtable(current_module.globalsymtable).concattypestabto(asmlist[al_debug]);
         if assigned(current_module.localsymtable) then
         if assigned(current_module.localsymtable) then
-          tstaticsymtable(current_module.localsymtable).concattypestabto(asmlist[debuglist]);
+          tstaticsymtable(current_module.localsymtable).concattypestabto(asmlist[al_debug]);
         { include files }
         { include files }
         if (cs_gdb_dbx in aktglobalswitches) then
         if (cs_gdb_dbx in aktglobalswitches) then
           begin
           begin
-            asmlist[debuglist].concat(tai_comment.Create(strpnew('EINCL of global '+
+            asmlist[al_debug].concat(tai_comment.Create(strpnew('EINCL of global '+
               tglobalsymtable(current_module.globalsymtable).name^+' has index '+
               tglobalsymtable(current_module.globalsymtable).name^+' has index '+
               tostr(tglobalsymtable(current_module.globalsymtable).moduleid))));
               tostr(tglobalsymtable(current_module.globalsymtable).moduleid))));
-            asmlist[debuglist].concat(Tai_stabs.Create(strpnew('"'+
+            asmlist[al_debug].concat(Tai_stabs.Create(strpnew('"'+
               tglobalsymtable(current_module.globalsymtable).name^+'",'+
               tglobalsymtable(current_module.globalsymtable).name^+'",'+
               tostr(N_EINCL)+',0,0,0')));
               tostr(N_EINCL)+',0,0,0')));
             tglobalsymtable(current_module.globalsymtable).dbx_count_ok:={true}false;
             tglobalsymtable(current_module.globalsymtable).dbx_count_ok:={true}false;
@@ -910,14 +912,14 @@ implementation
       begin
       begin
         is_assembler_generated:=(Errorcount=0) and
         is_assembler_generated:=(Errorcount=0) and
           not(
           not(
-          asmlist[codesegment].empty and
-          asmlist[datasegment].empty and
-          asmlist[bsssegment].empty and
-          asmlist[threadvarsegment].empty and
-          asmlist[rttilist].empty and
-          ((asmlist[importsection]=nil) or asmlist[importsection].empty) and
-          ((asmlist[resourcesection]=nil) or asmlist[resourcesection].empty) and
-          ((asmlist[aasmtai.resourcestrings]=nil) or asmlist[aasmtai.resourcestrings].empty)
+          asmlist[al_code].empty and
+          asmlist[al_data].empty and
+          asmlist[al_bss].empty and
+          asmlist[al_threadvars].empty and
+          asmlist[al_rtti].empty and
+          ((asmlist[al_imports]=nil) or asmlist[al_imports].empty) and
+          ((asmlist[al_resources]=nil) or asmlist[al_resources].empty) and
+          ((asmlist[aasmtai.al_resourcestrings]=nil) or asmlist[aasmtai.al_resourcestrings].empty)
         );
         );
       end;
       end;
 
 
@@ -1201,13 +1203,13 @@ implementation
          consume(_POINT);
          consume(_POINT);
 
 
          { Generate resoucestrings }
          { Generate resoucestrings }
-         If ResourceStrings.ResStrCount>0 then
+         If al_resourcestrings.ResStrCount>0 then
           begin
           begin
-            ResourceStrings.CreateResourceStringList;
+            al_resourcestrings.CreateResourceStringList;
             current_module.flags:=current_module.flags or uf_has_resources;
             current_module.flags:=current_module.flags or uf_has_resources;
             { only write if no errors found }
             { only write if no errors found }
             if (Errorcount=0) then
             if (Errorcount=0) then
-             ResourceStrings.WriteResourceFile(ForceExtension(current_module.ppufilename^,'.rst'));
+             al_resourcestrings.WriteResourceFile(ForceExtension(current_module.ppufilename^,'.rst'));
           end;
           end;
 
 
          if (Errorcount=0) then
          if (Errorcount=0) then
@@ -1247,8 +1249,8 @@ implementation
 {$endif GDB}
 {$endif GDB}
 
 
          { generate wrappers for interfaces }
          { generate wrappers for interfaces }
-         gen_intf_wrappers(asmlist[codesegment],current_module.globalsymtable);
-         gen_intf_wrappers(asmlist[codesegment],current_module.localsymtable);
+         gen_intf_wrappers(asmlist[al_code],current_module.globalsymtable);
+         gen_intf_wrappers(asmlist[al_code],current_module.localsymtable);
 
 
          { generate a list of threadvars }
          { generate a list of threadvars }
 {$ifndef segment_threadvars}
 {$ifndef segment_threadvars}
@@ -1500,14 +1502,14 @@ implementation
          if assigned(exportlib) and
          if assigned(exportlib) and
             (target_info.system in [system_i386_win32,system_i386_wdosx]) and
             (target_info.system in [system_i386_win32,system_i386_wdosx]) and
             BinaryContainsExports then
             BinaryContainsExports then
-           asmlist[codesegment].concat(tai_const.create_sym(exportlib.edatalabel));
+           asmlist[al_code].concat(tai_const.create_sym(exportlib.edatalabel));
 
 
-         If ResourceStrings.ResStrCount>0 then
+         If al_resourcestrings.ResStrCount>0 then
           begin
           begin
-            ResourceStrings.CreateResourceStringList;
+            al_resourcestrings.CreateResourceStringList;
             { only write if no errors found }
             { only write if no errors found }
             if (Errorcount=0) then
             if (Errorcount=0) then
-             ResourceStrings.WriteResourceFile(ForceExtension(current_module.ppufilename^,'.rst'));
+             al_resourcestrings.WriteResourceFile(ForceExtension(current_module.ppufilename^,'.rst'));
           end;
           end;
 
 
          { finalize? }
          { finalize? }
@@ -1568,7 +1570,7 @@ implementation
 {$endif GDB}
 {$endif GDB}
 
 
          { generate wrappers for interfaces }
          { generate wrappers for interfaces }
-         gen_intf_wrappers(asmlist[codesegment],current_module.localsymtable);
+         gen_intf_wrappers(asmlist[al_code],current_module.localsymtable);
 
 
 {$ifndef segment_threadvars}
 {$ifndef segment_threadvars}
          { generate a list of threadvars }
          { generate a list of threadvars }

+ 10 - 14
compiler/powerpc/agppcmpw.pas

@@ -800,10 +800,10 @@ var
       if not assigned(p) then
       if not assigned(p) then
        exit;
        exit;
       InlineLevel:=0;
       InlineLevel:=0;
-      { lineinfo is only needed for codesegment (PFV) }
+      { lineinfo is only needed for al_code (PFV) }
       do_line:=((cs_asm_source in aktglobalswitches) or
       do_line:=((cs_asm_source in aktglobalswitches) or
                 (cs_lineinfo in aktmoduleswitches))
                 (cs_lineinfo in aktmoduleswitches))
-                 and (p=asmlist[codesegment]);
+                 and (p=asmlist[al_code]);
       DoNotSplitLine:=false;
       DoNotSplitLine:=false;
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
@@ -1386,7 +1386,7 @@ var
     var
     var
       fileinfo : tfileposinfo;
       fileinfo : tfileposinfo;
 {$endif GDB}
 {$endif GDB}
-
+      hal : tasmlist;
     begin
     begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       if assigned(current_module.mainsource) then
@@ -1415,17 +1415,13 @@ var
       WriteAsmFileHeader;
       WriteAsmFileHeader;
       WriteExternals;
       WriteExternals;
 
 
-      { PowerPC MPW ASM doesn't support stabs, at the moment:}
-(*
-      If (cs_debuginfo in aktmoduleswitches) then
-        WriteTree(debuglist);
-*)
-      WriteTree(asmlist[codesegment]);
-      WriteTree(asmlist[datasegment]);
-      WriteTree(asmlist[consts]);
-      WriteTree(asmlist[rttilist]);
-      WriteTree(asmlist[resourcestrings]);
-      WriteTree(asmlist[bsssegment]);
+      for hal:=low(Tasmlist) to high(Tasmlist) do
+        begin
+          AsmWriteLn(target_asm.comment+'Begin asmlist '+TasmlistStr[hal]);
+          writetree(asmlist[hal]);
+          AsmWriteLn(target_asm.comment+'End asmlist '+TasmlistStr[hal]);
+        end;
+
       {$ifdef GDB}
       {$ifdef GDB}
       WriteFileEndInfo;
       WriteFileEndInfo;
       {$ENDIF}
       {$ENDIF}

+ 16 - 16
compiler/powerpc/cgcpu.pas

@@ -365,33 +365,33 @@ const
         if assigned(result) then
         if assigned(result) then
           exit;
           exit;
 
 
-        if asmlist[importsection]=nil then
-          asmlist[importsection]:=TAAsmoutput.create;
+        if asmlist[al_imports]=nil then
+          asmlist[al_imports]:=TAAsmoutput.create;
 
 
-        asmlist[importsection].concat(Tai_section.Create(sec_data,'',0));
-        asmlist[importsection].concat(Tai_direct.create(strpnew('.section __TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16')));
-        asmlist[importsection].concat(Tai_align.Create(4));
+        asmlist[al_imports].concat(Tai_section.Create(sec_data,'',0));
+        asmlist[al_imports].concat(Tai_direct.create(strpnew('.section __TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16')));
+        asmlist[al_imports].concat(Tai_align.Create(4));
         result := objectlibrary.newasmsymbol(stubname,AB_EXTERNAL,AT_FUNCTION);
         result := objectlibrary.newasmsymbol(stubname,AB_EXTERNAL,AT_FUNCTION);
-        asmlist[importsection].concat(Tai_symbol.Create(result,0));
-        asmlist[importsection].concat(Tai_direct.create(strpnew((#9+'.indirect_symbol ')+s)));
+        asmlist[al_imports].concat(Tai_symbol.Create(result,0));
+        asmlist[al_imports].concat(Tai_direct.create(strpnew((#9+'.indirect_symbol ')+s)));
         l1 := objectlibrary.newasmsymbol('L'+s+'$lazy_ptr',AB_EXTERNAL,AT_FUNCTION);
         l1 := objectlibrary.newasmsymbol('L'+s+'$lazy_ptr',AB_EXTERNAL,AT_FUNCTION);
         reference_reset_symbol(href,l1,0);
         reference_reset_symbol(href,l1,0);
 {$ifdef powerpc}
 {$ifdef powerpc}
         href.refaddr := addr_hi;
         href.refaddr := addr_hi;
-        asmlist[importsection].concat(taicpu.op_reg_ref(A_LIS,NR_R11,href));
+        asmlist[al_imports].concat(taicpu.op_reg_ref(A_LIS,NR_R11,href));
         href.refaddr := addr_lo;
         href.refaddr := addr_lo;
         href.base := NR_R11;
         href.base := NR_R11;
-        asmlist[importsection].concat(taicpu.op_reg_ref(A_LWZU,NR_R12,href));
-        asmlist[importsection].concat(taicpu.op_reg(A_MTCTR,NR_R12));
-        asmlist[importsection].concat(taicpu.op_none(A_BCTR));
+        asmlist[al_imports].concat(taicpu.op_reg_ref(A_LWZU,NR_R12,href));
+        asmlist[al_imports].concat(taicpu.op_reg(A_MTCTR,NR_R12));
+        asmlist[al_imports].concat(taicpu.op_none(A_BCTR));
 {$else powerpc}
 {$else powerpc}
         internalerror(2004010502);
         internalerror(2004010502);
 {$endif powerpc}
 {$endif powerpc}
-        asmlist[importsection].concat(Tai_section.Create(sec_data,'',0));
-        asmlist[importsection].concat(Tai_direct.create(strpnew('.lazy_symbol_pointer')));
-        asmlist[importsection].concat(Tai_symbol.Create(l1,0));
-        asmlist[importsection].concat(Tai_direct.create(strpnew((#9+'.indirect_symbol ')+s)));
-        asmlist[importsection].concat(tai_const.createname(strpnew('dyld_stub_binding_helper'),AT_FUNCTION,0));
+        asmlist[al_imports].concat(Tai_section.Create(sec_data,'',0));
+        asmlist[al_imports].concat(Tai_direct.create(strpnew('.lazy_symbol_pointer')));
+        asmlist[al_imports].concat(Tai_symbol.Create(l1,0));
+        asmlist[al_imports].concat(Tai_direct.create(strpnew((#9+'.indirect_symbol ')+s)));
+        asmlist[al_imports].concat(tai_const.createname(strpnew('dyld_stub_binding_helper'),AT_FUNCTION,0));
       end;
       end;
 
 
 
 

+ 6 - 6
compiler/powerpc/nppcld.pas

@@ -67,9 +67,9 @@ unit nppcld;
                   if not(assigned(l)) then
                   if not(assigned(l)) then
                     begin
                     begin
                       l:=objectlibrary.newasmsymbol('L'+tprocsym(symtableentry).procdef[1].mangledname+'$non_lazy_ptr',AB_COMMON,AT_DATA);
                       l:=objectlibrary.newasmsymbol('L'+tprocsym(symtableentry).procdef[1].mangledname+'$non_lazy_ptr',AB_COMMON,AT_DATA);
-                      asmlist[picdata].concat(tai_symbol.create(l,0));
-                      asmlist[picdata].concat(tai_const.create_indirect_sym(objectlibrary.newasmsymbol(tprocsym(symtableentry).procdef[1].mangledname,AB_EXTERNAL,AT_DATA)));
-                      asmlist[picdata].concat(tai_const.create_32bit(0));
+                      asmlist[al_picdata].concat(tai_symbol.create(l,0));
+                      asmlist[al_picdata].concat(tai_const.create_indirect_sym(objectlibrary.newasmsymbol(tprocsym(symtableentry).procdef[1].mangledname,AB_EXTERNAL,AT_DATA)));
+                      asmlist[al_picdata].concat(tai_const.create_32bit(0));
                     end;
                     end;
                   reference_reset_symbol(ref,l,0);
                   reference_reset_symbol(ref,l,0);
                   reference_reset_base(location.reference,cg.getaddressregister(exprasmlist),0);
                   reference_reset_base(location.reference,cg.getaddressregister(exprasmlist),0);
@@ -99,9 +99,9 @@ unit nppcld;
                   if not(assigned(l)) then
                   if not(assigned(l)) then
                     begin
                     begin
                       l:=objectlibrary.newasmsymbol('L'+tglobalvarsym(symtableentry).mangledname+'$non_lazy_ptr',AB_COMMON,AT_DATA);
                       l:=objectlibrary.newasmsymbol('L'+tglobalvarsym(symtableentry).mangledname+'$non_lazy_ptr',AB_COMMON,AT_DATA);
-                      asmlist[picdata].concat(tai_symbol.create(l,0));
-                      asmlist[picdata].concat(tai_const.create_indirect_sym(objectlibrary.newasmsymbol(tglobalvarsym(symtableentry).mangledname,AB_EXTERNAL,AT_DATA)));
-                      asmlist[picdata].concat(tai_const.create_32bit(0));
+                      asmlist[al_picdata].concat(tai_symbol.create(l,0));
+                      asmlist[al_picdata].concat(tai_const.create_indirect_sym(objectlibrary.newasmsymbol(tglobalvarsym(symtableentry).mangledname,AB_EXTERNAL,AT_DATA)));
+                      asmlist[al_picdata].concat(tai_const.create_32bit(0));
                     end;
                     end;
 
 
                   reference_reset_symbol(ref,l,0);
                   reference_reset_symbol(ref,l,0);

+ 5 - 5
compiler/psub.pas

@@ -862,10 +862,10 @@ implementation
                  end;
                  end;
             end;
             end;
 
 
-            { add the procedure to the codesegment }
-            maybe_new_object_file(asmlist[codesegment]);
-            new_section(asmlist[codesegment],sec_code,lower(procdef.mangledname),aktalignment.procalign);
-            asmlist[codesegment].concatlist(aktproccode);
+            { add the procedure to the al_code }
+            maybe_new_object_file(asmlist[al_code]);
+            new_section(asmlist[al_code],sec_code,lower(procdef.mangledname),aktalignment.procalign);
+            asmlist[al_code].concatlist(aktproccode);
 
 
             { only now we can remove the temps }
             { only now we can remove the temps }
             tg.resettempgen;
             tg.resettempgen;
@@ -1301,7 +1301,7 @@ implementation
                    begin
                    begin
                      s:=proc_get_importname(pd);
                      s:=proc_get_importname(pd);
                      if s<>'' then
                      if s<>'' then
-                       gen_external_stub(asmlist[codesegment],pd,s);
+                       gen_external_stub(asmlist[al_code],pd,s);
                    end;
                    end;
 
 
                  { Import DLL specified? }
                  { Import DLL specified? }

+ 124 - 156
compiler/ptconst.pas

@@ -41,7 +41,7 @@ implementation
        symconst,symbase,symdef,symtable,
        symconst,symbase,symdef,symtable,
        aasmbase,aasmtai,aasmcpu,defutil,defcmp,
        aasmbase,aasmtai,aasmcpu,defutil,defcmp,
        { pass 1 }
        { pass 1 }
-       node,htypechk,
+       node,htypechk,procinfo,
        nmat,nadd,ncal,nmem,nset,ncnv,ninl,ncon,nld,nflw,
        nmat,nadd,ncal,nmem,nset,ncnv,ninl,ncon,nld,nflw,
        { parser specific stuff }
        { parser specific stuff }
        pbase,pexpr,
        pbase,pexpr,
@@ -65,7 +65,6 @@ implementation
          varalign  : longint;
          varalign  : longint;
          offset,
          offset,
          strlength : aint;
          strlength : aint;
-         curconstsegment : TAAsmoutput;
          ll        : tasmlabel;
          ll        : tasmlabel;
          s,sorg    : string;
          s,sorg    : string;
          c         : char;
          c         : char;
@@ -82,6 +81,9 @@ implementation
          pw        : pcompilerwidestring;
          pw        : pcompilerwidestring;
          error     : boolean;
          error     : boolean;
          old_block_type : tblock_type;
          old_block_type : tblock_type;
+         storefilepos : tfileposinfo;
+         cursectype : TAsmSectionType;
+         cural : tasmlist;
 
 
          procedure check_range(def:torddef);
          procedure check_range(def:torddef);
          begin
          begin
@@ -98,10 +100,45 @@ implementation
       begin
       begin
          old_block_type:=block_type;
          old_block_type:=block_type;
          block_type:=bt_const;
          block_type:=bt_const;
+
          if writable then
          if writable then
-           curconstsegment:=asmlist[datasegment]
+           begin
+             cural:=al_typedconsts;
+             cursectype:=sec_data;
+           end
          else
          else
-           curconstsegment:=asmlist[consts];
+           begin
+             cural:=al_rotypedconsts;
+             cursectype:=sec_rodata;
+           end;
+
+         { Add symbol name if this is specified. For array
+           elements sym=nil and we should skip this }
+         if assigned(sym) then
+           begin
+             storefilepos:=aktfilepos;
+             aktfilepos:=sym.fileinfo;
+
+             { insert cut for smartlinking or alignment }
+             l:=sym.getsize;
+             maybe_new_object_file(asmlist[cural]);
+             new_section(asmlist[cural],cursectype,lower(sym.mangledname),const_align(l));
+
+{$ifdef GDB}
+             if (cs_debuginfo in aktmoduleswitches) then
+               sym.concatstabto(asmlist[cural]);
+{$endif GDB}
+             if (sym.owner.symtabletype=globalsymtable) or
+                maybe_smartlink_symbol or
+                (assigned(current_procinfo) and
+                 (po_inline in current_procinfo.procdef.procoptions)) or
+                DLLSource then
+               asmlist[cural].concat(Tai_symbol.Createname_global(sym.mangledname,AT_DATA,l))
+             else
+               asmlist[cural].concat(Tai_symbol.Createname(sym.mangledname,AT_DATA,l));
+             aktfilepos:=storefilepos;
+           end;
+
          case t.def.deftype of
          case t.def.deftype of
             orddef:
             orddef:
               begin
               begin
@@ -110,28 +147,28 @@ implementation
                     bool8bit :
                     bool8bit :
                       begin
                       begin
                          if is_constboolnode(p) then
                          if is_constboolnode(p) then
-                           curconstSegment.concat(Tai_const.Create_8bit(byte(tordconstnode(p).value)))
+                           asmlist[cural].concat(Tai_const.Create_8bit(byte(tordconstnode(p).value)))
                          else
                          else
                            Message(parser_e_illegal_expression);
                            Message(parser_e_illegal_expression);
                       end;
                       end;
                     bool16bit :
                     bool16bit :
                       begin
                       begin
                          if is_constboolnode(p) then
                          if is_constboolnode(p) then
-                           curconstSegment.concat(Tai_const.Create_16bit(word(tordconstnode(p).value)))
+                           asmlist[cural].concat(Tai_const.Create_16bit(word(tordconstnode(p).value)))
                          else
                          else
                            Message(parser_e_illegal_expression);
                            Message(parser_e_illegal_expression);
                       end;
                       end;
                     bool32bit :
                     bool32bit :
                       begin
                       begin
                          if is_constboolnode(p) then
                          if is_constboolnode(p) then
-                           curconstSegment.concat(Tai_const.Create_32bit(longint(tordconstnode(p).value)))
+                           asmlist[cural].concat(Tai_const.Create_32bit(longint(tordconstnode(p).value)))
                          else
                          else
                            Message(parser_e_illegal_expression);
                            Message(parser_e_illegal_expression);
                       end;
                       end;
                     uchar :
                     uchar :
                       begin
                       begin
                          if is_constcharnode(p) then
                          if is_constcharnode(p) then
-                           curconstSegment.concat(Tai_const.Create_8bit(byte(tordconstnode(p).value)))
+                           asmlist[cural].concat(Tai_const.Create_8bit(byte(tordconstnode(p).value)))
                          else
                          else
                            Message(parser_e_illegal_expression);
                            Message(parser_e_illegal_expression);
                       end;
                       end;
@@ -140,7 +177,7 @@ implementation
                          if is_constcharnode(p) then
                          if is_constcharnode(p) then
                            inserttypeconv(p,cwidechartype);
                            inserttypeconv(p,cwidechartype);
                          if is_constwidecharnode(p) then
                          if is_constwidecharnode(p) then
-                           curconstSegment.concat(Tai_const.Create_16bit(word(tordconstnode(p).value)))
+                           asmlist[cural].concat(Tai_const.Create_16bit(word(tordconstnode(p).value)))
                          else
                          else
                            Message(parser_e_illegal_expression);
                            Message(parser_e_illegal_expression);
                       end;
                       end;
@@ -149,7 +186,7 @@ implementation
                       begin
                       begin
                          if is_constintnode(p) then
                          if is_constintnode(p) then
                            begin
                            begin
-                              curconstSegment.concat(Tai_const.Create_8bit(byte(tordconstnode(p).value)));
+                              asmlist[cural].concat(Tai_const.Create_8bit(byte(tordconstnode(p).value)));
                               check_range(torddef(t.def));
                               check_range(torddef(t.def));
                            end
                            end
                          else
                          else
@@ -160,7 +197,7 @@ implementation
                       begin
                       begin
                          if is_constintnode(p) then
                          if is_constintnode(p) then
                            begin
                            begin
-                             curconstSegment.concat(Tai_const.Create_16bit(word(tordconstnode(p).value)));
+                             asmlist[cural].concat(Tai_const.Create_16bit(word(tordconstnode(p).value)));
                              check_range(torddef(t.def));
                              check_range(torddef(t.def));
                            end
                            end
                          else
                          else
@@ -171,7 +208,7 @@ implementation
                       begin
                       begin
                          if is_constintnode(p) then
                          if is_constintnode(p) then
                            begin
                            begin
-                              curconstSegment.concat(Tai_const.Create_32bit(longint(tordconstnode(p).value)));
+                              asmlist[cural].concat(Tai_const.Create_32bit(longint(tordconstnode(p).value)));
                               if torddef(t.def).typ<>u32bit then
                               if torddef(t.def).typ<>u32bit then
                                check_range(torddef(t.def));
                                check_range(torddef(t.def));
                            end
                            end
@@ -196,7 +233,7 @@ implementation
                              intvalue:=0;
                              intvalue:=0;
                              Message(parser_e_illegal_expression);
                              Message(parser_e_illegal_expression);
                            end;
                            end;
-                        curconstSegment.concat(Tai_const.Create_64bit(intvalue));
+                        asmlist[cural].concat(Tai_const.Create_64bit(intvalue));
                       end;
                       end;
                     else
                     else
                       internalerror(3799);
                       internalerror(3799);
@@ -215,24 +252,24 @@ implementation
 
 
               case tfloatdef(t.def).typ of
               case tfloatdef(t.def).typ of
                  s32real :
                  s32real :
-                   curconstSegment.concat(Tai_real_32bit.Create(ts32real(value)));
+                   asmlist[cural].concat(Tai_real_32bit.Create(ts32real(value)));
                  s64real :
                  s64real :
 {$ifdef ARM}
 {$ifdef ARM}
                    if aktfputype in [fpu_fpa,fpu_fpa10,fpu_fpa11] then
                    if aktfputype in [fpu_fpa,fpu_fpa10,fpu_fpa11] then
-                     curconstSegment.concat(Tai_real_64bit.Create_hiloswapped(ts64real(value)))
+                     asmlist[cural].concat(Tai_real_64bit.Create_hiloswapped(ts64real(value)))
                    else
                    else
 {$endif ARM}
 {$endif ARM}
-                     curconstSegment.concat(Tai_real_64bit.Create(ts64real(value)));
+                     asmlist[cural].concat(Tai_real_64bit.Create(ts64real(value)));
                  s80real :
                  s80real :
-                   curconstSegment.concat(Tai_real_80bit.Create(value));
+                   asmlist[cural].concat(Tai_real_80bit.Create(value));
 
 
                  { the round is necessary for native compilers where comp isn't a float }
                  { the round is necessary for native compilers where comp isn't a float }
                  s64comp :
                  s64comp :
-                   curconstSegment.concat(Tai_comp_64bit.Create(round(value)));
+                   asmlist[cural].concat(Tai_comp_64bit.Create(round(value)));
                  s64currency:
                  s64currency:
-                   curconstSegment.concat(Tai_comp_64bit.Create(round(value*10000)));
+                   asmlist[cural].concat(Tai_comp_64bit.Create(round(value*10000)));
                  s128real:
                  s128real:
-                   curconstSegment.concat(Tai_real_128bit.Create(value));
+                   asmlist[cural].concat(Tai_real_128bit.Create(value));
                  else
                  else
                    internalerror(18);
                    internalerror(18);
               end;
               end;
@@ -247,11 +284,11 @@ implementation
                      begin
                      begin
                         if not Tobjectdef(pointertype.def).is_related(Tobjectdef(pointertype.def)) then
                         if not Tobjectdef(pointertype.def).is_related(Tobjectdef(pointertype.def)) then
                           message(parser_e_illegal_expression);
                           message(parser_e_illegal_expression);
-                        curconstSegment.concat(Tai_const.Create_sym(objectlibrary.newasmsymbol(
+                        asmlist[cural].concat(Tai_const.Create_sym(objectlibrary.newasmsymbol(
                           Tobjectdef(pointertype.def).vmt_mangledname,AB_EXTERNAL,AT_DATA)));
                           Tobjectdef(pointertype.def).vmt_mangledname,AB_EXTERNAL,AT_DATA)));
                      end;
                      end;
                  niln:
                  niln:
-                   curconstSegment.concat(Tai_const.Create_sym(nil));
+                   asmlist[cural].concat(Tai_const.Create_sym(nil));
                  else Message(parser_e_illegal_expression);
                  else Message(parser_e_illegal_expression);
               end;
               end;
               p.free;
               p.free;
@@ -282,30 +319,30 @@ implementation
               if (p.nodetype = pointerconstn) then
               if (p.nodetype = pointerconstn) then
                 begin
                 begin
                   if sizeof(TConstPtrUInt)=8 then
                   if sizeof(TConstPtrUInt)=8 then
-                    curconstsegment.concat(Tai_const.Create_64bit(TConstPtrUInt(tpointerconstnode(p).value)))
+                    asmlist[cural].concat(Tai_const.Create_64bit(TConstPtrUInt(tpointerconstnode(p).value)))
                   else
                   else
                     if sizeof(TConstPtrUInt)=4 then
                     if sizeof(TConstPtrUInt)=4 then
-                      curconstsegment.concat(Tai_const.Create_32bit(TConstPtrUInt(tpointerconstnode(p).value)))
+                      asmlist[cural].concat(Tai_const.Create_32bit(TConstPtrUInt(tpointerconstnode(p).value)))
                   else
                   else
                     internalerror(200404122);
                     internalerror(200404122);
                 end
                 end
               { nil pointer ? }
               { nil pointer ? }
               else if p.nodetype=niln then
               else if p.nodetype=niln then
-                curconstSegment.concat(Tai_const.Create_sym(nil))
+                asmlist[cural].concat(Tai_const.Create_sym(nil))
               { maybe pchar ? }
               { maybe pchar ? }
               else
               else
                 if is_char(tpointerdef(t.def).pointertype.def) and
                 if is_char(tpointerdef(t.def).pointertype.def) and
                    (p.nodetype<>addrn) then
                    (p.nodetype<>addrn) then
                   begin
                   begin
                     objectlibrary.getdatalabel(ll);
                     objectlibrary.getdatalabel(ll);
-                    curconstSegment.concat(Tai_const.Create_sym(ll));
+                    asmlist[cural].concat(Tai_const.Create_sym(ll));
                     if p.nodetype=stringconstn then
                     if p.nodetype=stringconstn then
                      varalign:=tstringconstnode(p).len
                      varalign:=tstringconstnode(p).len
                     else
                     else
                      varalign:=0;
                      varalign:=0;
                     varalign:=const_align(varalign);
                     varalign:=const_align(varalign);
-                    asmlist[consts].concat(Tai_align.Create(varalign));
-                    asmlist[consts].concat(Tai_label.Create(ll));
+                    asmlist[al_typedconsts].concat(Tai_align.Create(varalign));
+                    asmlist[al_typedconsts].concat(Tai_label.Create(ll));
                     if p.nodetype=stringconstn then
                     if p.nodetype=stringconstn then
                       begin
                       begin
                         len:=tstringconstnode(p).len;
                         len:=tstringconstnode(p).len;
@@ -315,11 +352,11 @@ implementation
                          len:=255;
                          len:=255;
                         getmem(ca,len+2);
                         getmem(ca,len+2);
                         move(tstringconstnode(p).value_str^,ca^,len+1);
                         move(tstringconstnode(p).value_str^,ca^,len+1);
-                        asmlist[consts].concat(Tai_string.Create_length_pchar(ca,len+1));
+                        asmlist[al_typedconsts].concat(Tai_string.Create_length_pchar(ca,len+1));
                       end
                       end
                     else
                     else
                       if is_constcharnode(p) then
                       if is_constcharnode(p) then
-                        asmlist[consts].concat(Tai_string.Create(char(byte(tordconstnode(p).value))+#0))
+                        asmlist[al_typedconsts].concat(Tai_string.Create(char(byte(tordconstnode(p).value))+#0))
                     else
                     else
                       message(parser_e_illegal_expression);
                       message(parser_e_illegal_expression);
                 end
                 end
@@ -329,9 +366,9 @@ implementation
                    (p.nodetype<>addrn) then
                    (p.nodetype<>addrn) then
                   begin
                   begin
                     objectlibrary.getdatalabel(ll);
                     objectlibrary.getdatalabel(ll);
-                    curconstsegment.concat(Tai_const.Create_sym(ll));
-                    asmlist[consts].concat(tai_align.create(const_align(sizeof(aint))));
-                    asmlist[consts].concat(Tai_label.Create(ll));
+                    asmlist[cural].concat(Tai_const.Create_sym(ll));
+                    asmlist[al_typedconsts].concat(tai_align.create(const_align(sizeof(aint))));
+                    asmlist[al_typedconsts].concat(Tai_label.Create(ll));
                     if (p.nodetype in [stringconstn,ordconstn]) then
                     if (p.nodetype in [stringconstn,ordconstn]) then
                       begin
                       begin
                         { convert to widestring stringconstn }
                         { convert to widestring stringconstn }
@@ -341,9 +378,9 @@ implementation
                          begin
                          begin
                            pw:=pcompilerwidestring(tstringconstnode(p).value_str);
                            pw:=pcompilerwidestring(tstringconstnode(p).value_str);
                            for i:=0 to tstringconstnode(p).len-1 do
                            for i:=0 to tstringconstnode(p).len-1 do
-                             asmlist[consts].concat(Tai_const.Create_16bit(pw^.data[i]));
+                             asmlist[al_typedconsts].concat(Tai_const.Create_16bit(pw^.data[i]));
                            { ending #0 }
                            { ending #0 }
-                           asmlist[consts].concat(Tai_const.Create_16bit(0))
+                           asmlist[al_typedconsts].concat(Tai_const.Create_16bit(0))
                          end;
                          end;
                       end
                       end
                     else
                     else
@@ -411,17 +448,17 @@ implementation
                               if po_abstractmethod in tprocsym(srsym).first_procdef.procoptions then
                               if po_abstractmethod in tprocsym(srsym).first_procdef.procoptions then
                                 Message(type_e_cant_take_address_of_abstract_method)
                                 Message(type_e_cant_take_address_of_abstract_method)
                               else
                               else
-                                curconstSegment.concat(Tai_const.Createname(tprocsym(srsym).first_procdef.mangledname,AT_FUNCTION,offset));
+                                asmlist[cural].concat(Tai_const.Createname(tprocsym(srsym).first_procdef.mangledname,AT_FUNCTION,offset));
                             end;
                             end;
                           globalvarsym :
                           globalvarsym :
-                            curconstSegment.concat(Tai_const.Createname(tglobalvarsym(srsym).mangledname,AT_DATA,offset));
+                            asmlist[cural].concat(Tai_const.Createname(tglobalvarsym(srsym).mangledname,AT_DATA,offset));
                           typedconstsym :
                           typedconstsym :
-                            curconstSegment.concat(Tai_const.Createname(ttypedconstsym(srsym).mangledname,AT_DATA,offset));
+                            asmlist[cural].concat(Tai_const.Createname(ttypedconstsym(srsym).mangledname,AT_DATA,offset));
                           labelsym :
                           labelsym :
-                            curconstSegment.concat(Tai_const.Createname(tlabelsym(srsym).mangledname,AT_FUNCTION,offset));
+                            asmlist[cural].concat(Tai_const.Createname(tlabelsym(srsym).mangledname,AT_FUNCTION,offset));
                           constsym :
                           constsym :
                             if tconstsym(srsym).consttyp=constresourcestring then
                             if tconstsym(srsym).consttyp=constresourcestring then
-                              curconstSegment.concat(Tai_const.Createname(make_mangledname('RESOURCESTRINGLIST',tconstsym(srsym).owner,''),AT_DATA,tconstsym(srsym).resstrindex*(4+sizeof(aint)*3)+4+sizeof(aint)))
+                              asmlist[cural].concat(Tai_const.Createname(make_mangledname('RESOURCESTRINGLIST',tconstsym(srsym).owner,''),AT_DATA,tconstsym(srsym).resstrindex*(4+sizeof(aint)*3)+4+sizeof(aint)))
                             else
                             else
                               Message(type_e_variable_id_expected);
                               Message(type_e_variable_id_expected);
                           else
                           else
@@ -438,7 +475,7 @@ implementation
                   begin
                   begin
                     if (tinlinenode(p).left.nodetype=typen) then
                     if (tinlinenode(p).left.nodetype=typen) then
                       begin
                       begin
-                        curconstSegment.concat(Tai_const.createname(
+                        asmlist[cural].concat(Tai_const.createname(
                           tobjectdef(tinlinenode(p).left.resulttype.def).vmt_mangledname,AT_DATA,0));
                           tobjectdef(tinlinenode(p).left.resulttype.def).vmt_mangledname,AT_DATA,0));
                       end
                       end
                     else
                     else
@@ -468,7 +505,7 @@ implementation
                         if source_info.endian = target_info.endian then
                         if source_info.endian = target_info.endian then
                           begin
                           begin
                             for l:=0 to p.resulttype.def.size-1 do
                             for l:=0 to p.resulttype.def.size-1 do
-                              curconstsegment.concat(tai_const.create_8bit(Psetbytes(tsetconstnode(p).value_set)^[l]));
+                              asmlist[cural].concat(tai_const.create_8bit(Psetbytes(tsetconstnode(p).value_set)^[l]));
                           end
                           end
                         else
                         else
                           begin
                           begin
@@ -476,10 +513,10 @@ implementation
                             j:=0;
                             j:=0;
                             for l:=0 to ((p.resulttype.def.size-1) div 4) do
                             for l:=0 to ((p.resulttype.def.size-1) div 4) do
                               begin
                               begin
-                                curconstsegment.concat(tai_const.create_8bit(Psetbytes(tsetconstnode(p).value_set)^[j+3]));
-                                curconstsegment.concat(tai_const.create_8bit(Psetbytes(tsetconstnode(p).value_set)^[j+2]));
-                                curconstsegment.concat(tai_const.create_8bit(Psetbytes(tsetconstnode(p).value_set)^[j+1]));
-                                curconstsegment.concat(tai_const.create_8bit(Psetbytes(tsetconstnode(p).value_set)^[j]));
+                                asmlist[cural].concat(tai_const.create_8bit(Psetbytes(tsetconstnode(p).value_set)^[j+3]));
+                                asmlist[cural].concat(tai_const.create_8bit(Psetbytes(tsetconstnode(p).value_set)^[j+2]));
+                                asmlist[cural].concat(tai_const.create_8bit(Psetbytes(tsetconstnode(p).value_set)^[j+1]));
+                                asmlist[cural].concat(tai_const.create_8bit(Psetbytes(tsetconstnode(p).value_set)^[j]));
                                 Inc(j,4);
                                 Inc(j,4);
                               end;
                               end;
                           end;
                           end;
@@ -498,9 +535,9 @@ implementation
                      is_subequal(p.resulttype.def,t.def) then
                      is_subequal(p.resulttype.def,t.def) then
                    begin
                    begin
                      case longint(p.resulttype.def.size) of
                      case longint(p.resulttype.def.size) of
-                       1 : curconstSegment.concat(Tai_const.Create_8bit(Byte(tordconstnode(p).value)));
-                       2 : curconstSegment.concat(Tai_const.Create_16bit(Word(tordconstnode(p).value)));
-                       4 : curconstSegment.concat(Tai_const.Create_32bit(Longint(tordconstnode(p).value)));
+                       1 : asmlist[cural].concat(Tai_const.Create_8bit(Byte(tordconstnode(p).value)));
+                       2 : asmlist[cural].concat(Tai_const.Create_16bit(Word(tordconstnode(p).value)));
+                       4 : asmlist[cural].concat(Tai_const.Create_32bit(Longint(tordconstnode(p).value)));
                      end;
                      end;
                    end
                    end
                   else
                   else
@@ -550,12 +587,12 @@ implementation
                           message2(parser_w_string_too_long,strpas(strval),tostr(t.def.size-1));
                           message2(parser_w_string_too_long,strpas(strval),tostr(t.def.size-1));
                           strlength:=t.def.size-1;
                           strlength:=t.def.size-1;
                         end;
                         end;
-                       curconstSegment.concat(Tai_const.Create_8bit(strlength));
+                       asmlist[cural].concat(Tai_const.Create_8bit(strlength));
                        { this can also handle longer strings }
                        { this can also handle longer strings }
                        getmem(ca,strlength+1);
                        getmem(ca,strlength+1);
                        move(strval^,ca^,strlength);
                        move(strval^,ca^,strlength);
                        ca[strlength]:=#0;
                        ca[strlength]:=#0;
-                       curconstSegment.concat(Tai_string.Create_length_pchar(ca,strlength));
+                       asmlist[cural].concat(Tai_string.Create_length_pchar(ca,strlength));
                        { fillup with spaces if size is shorter }
                        { fillup with spaces if size is shorter }
                        if t.def.size>strlength then
                        if t.def.size>strlength then
                         begin
                         begin
@@ -565,29 +602,22 @@ implementation
                           fillchar(ca[0],t.def.size-strlength-1,' ');
                           fillchar(ca[0],t.def.size-strlength-1,' ');
                           ca[t.def.size-strlength-1]:=#0;
                           ca[t.def.size-strlength-1]:=#0;
                           { this can also handle longer strings }
                           { this can also handle longer strings }
-                          curconstSegment.concat(Tai_string.Create_length_pchar(ca,t.def.size-strlength-1));
+                          asmlist[cural].concat(Tai_string.Create_length_pchar(ca,t.def.size-strlength-1));
                         end;
                         end;
                      end;
                      end;
-                 {$ifdef ansistrings_bits}
-                   st_ansistring16:
+                   st_ansistring:
                      begin
                      begin
                         { an empty ansi string is nil! }
                         { an empty ansi string is nil! }
                         if (strlength=0) then
                         if (strlength=0) then
-                          curconstSegment.concat(Tai_const.Create_ptr(0))
+                          asmlist[cural].concat(Tai_const.Create_sym(nil))
                         else
                         else
                           begin
                           begin
                             objectlibrary.getdatalabel(ll);
                             objectlibrary.getdatalabel(ll);
-                            curconstSegment.concat(Tai_const_symbol.Create(ll));
-                            { the actual structure starts at -12 from start label - CEC }
-                            Consts.concat(tai_align.create(const_align(pointer_size)));
-                            { first write the maximum size }
-                            Consts.concat(Tai_const.Create_16bit(strlength));
-                            { second write the real length }
-                            Consts.concat(Tai_const.Create_16bit(strlength));
-                            { redondent with maxlength but who knows ... (PM) }
-                            { third write use count (set to -1 for safety ) }
-                            Consts.concat(Tai_const.Create_16bit(-1));
-                            Consts.concat(Tai_label.Create(ll));
+                            asmlist[cural].concat(Tai_const.Create_sym(ll));
+                            asmlist[al_rodata].concat(tai_align.create(const_align(sizeof(aint))));
+                            asmlist[al_rodata].concat(Tai_const.Create_aint(-1));
+                            asmlist[al_rodata].concat(Tai_const.Create_aint(strlength));
+                            asmlist[al_rodata].concat(Tai_label.Create(ll));
                             getmem(ca,strlength+2);
                             getmem(ca,strlength+2);
                             move(strval^,ca^,strlength);
                             move(strval^,ca^,strlength);
                             { The terminating #0 to be stored in the .data section (JM) }
                             { The terminating #0 to be stored in the .data section (JM) }
@@ -595,93 +625,31 @@ implementation
                             { End of the PChar. The memory has to be allocated because in }
                             { End of the PChar. The memory has to be allocated because in }
                             { tai_string.done, there is a freemem(len+1) (JM)             }
                             { tai_string.done, there is a freemem(len+1) (JM)             }
                             ca[strlength+1]:=#0;
                             ca[strlength+1]:=#0;
-                            Consts.concat(Tai_string.Create_length_pchar(ca,strlength+1));
+                            asmlist[al_rodata].concat(Tai_string.Create_length_pchar(ca,strlength+1));
                           end;
                           end;
                      end;
                      end;
-                 {$endif}
-                   {$ifdef ansistring_bits}st_ansistring32{$else}st_ansistring{$endif}:
-                     begin
-                        { an empty ansi string is nil! }
-                        if (strlength=0) then
-                          curconstsegment.concat(Tai_const.Create_sym(nil))
-                        else
-                          begin
-                            objectlibrary.getdatalabel(ll);
-                            curconstsegment.concat(Tai_const.Create_sym(ll));
-                            asmlist[consts].concat(tai_align.create(const_align(sizeof(aint))));
-                            asmlist[consts].concat(Tai_const.Create_aint(-1));
-                            asmlist[consts].concat(Tai_const.Create_aint(strlength));
-                            asmlist[consts].concat(Tai_label.Create(ll));
-                            getmem(ca,strlength+2);
-                            move(strval^,ca^,strlength);
-                            { The terminating #0 to be stored in the .data section (JM) }
-                            ca[strlength]:=#0;
-                            { End of the PChar. The memory has to be allocated because in }
-                            { tai_string.done, there is a freemem(len+1) (JM)             }
-                            ca[strlength+1]:=#0;
-                            asmlist[consts].concat(Tai_string.Create_length_pchar(ca,strlength+1));
-                          end;
-                     end;
-                 {$ifdef ansistring_bits}
-                   st_ansistring64:
-                     begin
-                        { an empty ansi string is nil! }
-                        if (strlength=0) then
-                          curconstsegment.concat(Tai_const.Create_ptr(0))
-                        else
-                          begin
-                            objectlibrary.getdatalabel(ll);
-                            curconstsegment.concat(Tai_const_symbol.Create(ll));
-                            { the actual structure starts at -12 from start label - CEC }
-                            asmlist[consts].concat(tai_align.create(const_align(pointer_size)));
-                            { first write the maximum size }
-                            asmlist[consts].concat(Tai_const.Create_64bit(strlength));
-                            { second write the real length }
-                            asmlist[consts].concat(Tai_const.Create_64bit(strlength));
-                            { redondent with maxlength but who knows ... (PM) }
-                            { third write use count (set to -1 for safety ) }
-                            asmlist[consts].concat(Tai_const.Create_64bit(-1));
-                            asmlist[consts].concat(Tai_label.Create(ll));
-                            getmem(ca,strlength+2);
-                            move(strval^,ca^,strlength);
-                            { The terminating #0 to be stored in the .data section (JM) }
-                            ca[strlength]:=#0;
-                            { End of the PChar. The memory has to be allocated because in }
-                            { tai_string.done, there is a freemem(len+1) (JM)             }
-                            ca[strlength+1]:=#0;
-                            asmlist[consts].concat(Tai_string.Create_length_pchar(ca,strlength+1));
-                          end;
-                     end;
-                 {$endif}
                    st_widestring:
                    st_widestring:
                      begin
                      begin
                         { an empty ansi string is nil! }
                         { an empty ansi string is nil! }
                         if (strlength=0) then
                         if (strlength=0) then
-                          curconstSegment.concat(Tai_const.Create_sym(nil))
+                          asmlist[cural].concat(Tai_const.Create_sym(nil))
                         else
                         else
                           begin
                           begin
                             objectlibrary.getdatalabel(ll);
                             objectlibrary.getdatalabel(ll);
-                            curconstSegment.concat(Tai_const.Create_sym(ll));
-                            asmlist[consts].concat(tai_align.create(const_align(sizeof(aint))));
-                            asmlist[consts].concat(Tai_const.Create_aint(-1));
-                            asmlist[consts].concat(Tai_const.Create_aint(strlength));
-                            asmlist[consts].concat(Tai_label.Create(ll));
+                            asmlist[cural].concat(Tai_const.Create_sym(ll));
+                            asmlist[al_rodata].concat(tai_align.create(const_align(sizeof(aint))));
+                            asmlist[al_rodata].concat(Tai_const.Create_aint(-1));
+                            asmlist[al_rodata].concat(Tai_const.Create_aint(strlength));
+                            asmlist[al_rodata].concat(Tai_label.Create(ll));
                             for i:=0 to strlength-1 do
                             for i:=0 to strlength-1 do
-                              asmlist[consts].concat(Tai_const.Create_16bit(pcompilerwidestring(strval)^.data[i]));
+                              asmlist[al_rodata].concat(Tai_const.Create_16bit(pcompilerwidestring(strval)^.data[i]));
                             { ending #0 }
                             { ending #0 }
-                            asmlist[consts].concat(Tai_const.Create_16bit(0))
+                            asmlist[al_rodata].concat(Tai_const.Create_16bit(0))
                           end;
                           end;
                      end;
                      end;
                    st_longstring:
                    st_longstring:
                      begin
                      begin
                        internalerror(200107081);
                        internalerror(200107081);
-                       {curconstSegment.concat(Tai_const.Create_32bit(strlength))));
-                       curconstSegment.concat(Tai_const.Create_8bit(0));
-                       getmem(ca,strlength+1);
-                       move(strval^,ca^,strlength);
-                       ca[strlength]:=#0;
-                       generate_pascii(consts,ca,strlength);
-                       curconstSegment.concat(Tai_const.Create_8bit(0));}
                      end;
                      end;
                  end;
                  end;
                end;
                end;
@@ -694,7 +662,7 @@ implementation
                 begin
                 begin
                   { Only allow nil initialization }
                   { Only allow nil initialization }
                   consume(_NIL);
                   consume(_NIL);
-                  curconstSegment.concat(Tai_const.Create_sym(nil));
+                  asmlist[cural].concat(Tai_const.Create_sym(nil));
                 end
                 end
               else
               else
               if try_to_consume(_LKLAMMER) then
               if try_to_consume(_LKLAMMER) then
@@ -739,12 +707,12 @@ implementation
                      begin
                      begin
                         if i+1-tarraydef(t.def).lowrange<=len then
                         if i+1-tarraydef(t.def).lowrange<=len then
                           begin
                           begin
-                             curconstSegment.concat(Tai_const.Create_8bit(byte(ca^)));
+                             asmlist[cural].concat(Tai_const.Create_8bit(byte(ca^)));
                              inc(ca);
                              inc(ca);
                           end
                           end
                         else
                         else
                           {Fill the remaining positions with #0.}
                           {Fill the remaining positions with #0.}
-                          curconstSegment.concat(Tai_const.Create_8bit(0));
+                          asmlist[cural].concat(Tai_const.Create_8bit(0));
                      end;
                      end;
                    p.free;
                    p.free;
                 end
                 end
@@ -760,9 +728,9 @@ implementation
               { under tp:  =nil or =var under fpc: =nil or =@var }
               { under tp:  =nil or =var under fpc: =nil or =@var }
               if token=_NIL then
               if token=_NIL then
                 begin
                 begin
-                   curconstSegment.concat(Tai_const.Create_sym(nil));
+                   asmlist[cural].concat(Tai_const.Create_sym(nil));
                    if (po_methodpointer in tprocvardef(t.def).procoptions) then
                    if (po_methodpointer in tprocvardef(t.def).procoptions) then
-                     curconstSegment.concat(Tai_const.Create_sym(nil));
+                     asmlist[cural].concat(Tai_const.Create_sym(nil));
                    consume(_NIL);
                    consume(_NIL);
                    exit;
                    exit;
                 end;
                 end;
@@ -809,7 +777,7 @@ implementation
               if (p.nodetype=loadn) and
               if (p.nodetype=loadn) and
                  (tloadnode(p).symtableentry.typ=procsym) then
                  (tloadnode(p).symtableentry.typ=procsym) then
                begin
                begin
-                 curconstSegment.concat(Tai_const.createname(
+                 asmlist[cural].concat(Tai_const.createname(
                    tprocsym(tloadnode(p).symtableentry).first_procdef.mangledname,AT_FUNCTION,0));
                    tprocsym(tloadnode(p).symtableentry).first_procdef.mangledname,AT_FUNCTION,0));
                end
                end
               else
               else
@@ -831,11 +799,11 @@ implementation
                       p.free;
                       p.free;
                       if string2guid(s,tmpguid) then
                       if string2guid(s,tmpguid) then
                         begin
                         begin
-                          curconstSegment.concat(Tai_const.Create_32bit(longint(tmpguid.D1)));
-                          curconstSegment.concat(Tai_const.Create_16bit(tmpguid.D2));
-                          curconstSegment.concat(Tai_const.Create_16bit(tmpguid.D3));
+                          asmlist[cural].concat(Tai_const.Create_32bit(longint(tmpguid.D1)));
+                          asmlist[cural].concat(Tai_const.Create_16bit(tmpguid.D2));
+                          asmlist[cural].concat(Tai_const.Create_16bit(tmpguid.D3));
                           for i:=Low(tmpguid.D4) to High(tmpguid.D4) do
                           for i:=Low(tmpguid.D4) to High(tmpguid.D4) do
-                            curconstSegment.concat(Tai_const.Create_8bit(tmpguid.D4[i]));
+                            asmlist[cural].concat(Tai_const.Create_8bit(tmpguid.D4[i]));
                         end
                         end
                       else
                       else
                         Message(parser_e_improper_guid_syntax);
                         Message(parser_e_improper_guid_syntax);
@@ -913,7 +881,7 @@ implementation
                             { if needed fill (alignment) }
                             { if needed fill (alignment) }
                             if tfieldvarsym(srsym).fieldoffset>aktpos then
                             if tfieldvarsym(srsym).fieldoffset>aktpos then
                                for i:=1 to tfieldvarsym(srsym).fieldoffset-aktpos do
                                for i:=1 to tfieldvarsym(srsym).fieldoffset-aktpos do
-                                 curconstSegment.concat(Tai_const.Create_8bit(0));
+                                 asmlist[cural].concat(Tai_const.Create_8bit(0));
 
 
                              { new position }
                              { new position }
                              aktpos:=tfieldvarsym(srsym).fieldoffset+tfieldvarsym(srsym).vartype.def.size;
                              aktpos:=tfieldvarsym(srsym).fieldoffset+tfieldvarsym(srsym).vartype.def.size;
@@ -942,7 +910,7 @@ implementation
                    Message1(parser_w_skipped_fields_after,sorg);
                    Message1(parser_w_skipped_fields_after,sorg);
 
 
                  for i:=1 to t.def.size-aktpos do
                  for i:=1 to t.def.size-aktpos do
-                   curconstSegment.concat(Tai_const.Create_8bit(0));
+                   asmlist[cural].concat(Tai_const.Create_8bit(0));
 
 
                  consume(_RKLAMMER);
                  consume(_RKLAMMER);
               end;
               end;
@@ -960,7 +928,7 @@ implementation
                     end
                     end
                   else
                   else
                     begin
                     begin
-                      curconstSegment.concat(Tai_const.Create_sym(nil));
+                      asmlist[cural].concat(Tai_const.Create_sym(nil));
                     end;
                     end;
                   p.free;
                   p.free;
                 end
                 end
@@ -1011,8 +979,8 @@ implementation
                                     (vmt_offset<fieldoffset) then
                                     (vmt_offset<fieldoffset) then
                                    begin
                                    begin
                                      for i:=1 to vmt_offset-aktpos do
                                      for i:=1 to vmt_offset-aktpos do
-                                       curconstsegment.concat(tai_const.create_8bit(0));
-                                     curconstsegment.concat(tai_const.createname(vmt_mangledname,AT_DATA,0));
+                                       asmlist[cural].concat(tai_const.create_8bit(0));
+                                     asmlist[cural].concat(tai_const.createname(vmt_mangledname,AT_DATA,0));
                                      { this is more general }
                                      { this is more general }
                                      aktpos:=vmt_offset + sizeof(aint);
                                      aktpos:=vmt_offset + sizeof(aint);
                                    end;
                                    end;
@@ -1020,7 +988,7 @@ implementation
                                { if needed fill }
                                { if needed fill }
                                if fieldoffset>aktpos then
                                if fieldoffset>aktpos then
                                  for i:=1 to fieldoffset-aktpos do
                                  for i:=1 to fieldoffset-aktpos do
-                                   curconstSegment.concat(Tai_const.Create_8bit(0));
+                                   asmlist[cural].concat(Tai_const.Create_8bit(0));
 
 
                                { new position }
                                { new position }
                                aktpos:=fieldoffset+vartype.def.size;
                                aktpos:=fieldoffset+vartype.def.size;
@@ -1038,13 +1006,13 @@ implementation
                       (tobjectdef(t.def).vmt_offset>=aktpos) then
                       (tobjectdef(t.def).vmt_offset>=aktpos) then
                      begin
                      begin
                        for i:=1 to tobjectdef(t.def).vmt_offset-aktpos do
                        for i:=1 to tobjectdef(t.def).vmt_offset-aktpos do
-                         curconstsegment.concat(tai_const.create_8bit(0));
-                       curconstsegment.concat(tai_const.createname(tobjectdef(t.def).vmt_mangledname,AT_DATA,0));
+                         asmlist[cural].concat(tai_const.create_8bit(0));
+                       asmlist[cural].concat(tai_const.createname(tobjectdef(t.def).vmt_mangledname,AT_DATA,0));
                        { this is more general }
                        { this is more general }
                        aktpos:=tobjectdef(t.def).vmt_offset + sizeof(aint);
                        aktpos:=tobjectdef(t.def).vmt_offset + sizeof(aint);
                      end;
                      end;
                    for i:=1 to t.def.size-aktpos do
                    for i:=1 to t.def.size-aktpos do
-                     curconstSegment.concat(Tai_const.Create_8bit(0));
+                     asmlist[cural].concat(Tai_const.Create_8bit(0));
                    consume(_RKLAMMER);
                    consume(_RKLAMMER);
                 end;
                 end;
            end;
            end;

+ 2 - 2
compiler/rautils.pas

@@ -1575,7 +1575,7 @@ end;
   {  linked list of instructions.                                       }
   {  linked list of instructions.                                       }
   {*********************************************************************}
   {*********************************************************************}
    begin
    begin
-       asmlist[bsssegment].concat(Tai_datablock.Create_global(s,size));
+       asmlist[al_bss].concat(Tai_datablock.Create_global(s,size));
    end;
    end;
 
 
   Procedure ConcatLocalBss(const s : string;size : aint);
   Procedure ConcatLocalBss(const s : string;size : aint);
@@ -1585,7 +1585,7 @@ end;
   {  linked list of instructions.                                       }
   {  linked list of instructions.                                       }
   {*********************************************************************}
   {*********************************************************************}
    begin
    begin
-       asmlist[bsssegment].concat(Tai_datablock.Create(s,size));
+       asmlist[al_bss].concat(Tai_datablock.Create(s,size));
    end;
    end;
 
 
 end.
 end.

+ 4 - 4
compiler/sparc/ncpucnv.pas

@@ -169,11 +169,11 @@ implementation
                s64real:
                s64real:
                  begin
                  begin
                    hregister:=cg.getfpuregister(exprasmlist,OS_F64);
                    hregister:=cg.getfpuregister(exprasmlist,OS_F64);
-                   asmlist[consts].concat(tai_align.create(const_align(8)));
-                   asmlist[consts].concat(Tai_label.Create(l1));
+                   asmlist[al_typedconsts].concat(tai_align.create(const_align(8)));
+                   asmlist[al_typedconsts].concat(Tai_label.Create(l1));
                    { I got this constant from a test program (FK) }
                    { I got this constant from a test program (FK) }
-                   asmlist[consts].concat(Tai_const.Create_32bit($41f00000));
-                   asmlist[consts].concat(Tai_const.Create_32bit(0));
+                   asmlist[al_typedconsts].concat(Tai_const.Create_32bit($41f00000));
+                   asmlist[al_typedconsts].concat(Tai_const.Create_32bit(0));
 
 
                    cg.a_loadfpu_ref_reg(exprasmlist,OS_F64,href,hregister);
                    cg.a_loadfpu_ref_reg(exprasmlist,OS_F64,href,hregister);
                    exprasmlist.concat(taicpu.op_reg_reg_reg(A_FADDD,location.register,hregister,location.register));
                    exprasmlist.concat(taicpu.op_reg_reg_reg(A_FADDD,location.register,hregister,location.register));

+ 1 - 1
compiler/sparc/ncpuset.pas

@@ -91,7 +91,7 @@ unit ncpuset;
            (af_smartlink_sections in target_asm.flags) then
            (af_smartlink_sections in target_asm.flags) then
           jumpsegment:=current_procinfo.aktlocaldata
           jumpsegment:=current_procinfo.aktlocaldata
         else
         else
-          jumpsegment:=asmlist[datasegment];
+          jumpsegment:=asmlist[al_data];
         if not(jumptable_no_range) then
         if not(jumptable_no_range) then
           begin
           begin
              { case expr less than min_ => goto elselabel }
              { case expr less than min_ => goto elselabel }

+ 143 - 143
compiler/symdef.pas

@@ -1257,16 +1257,16 @@ implementation
          if assigned(typesym) then
          if assigned(typesym) then
            begin
            begin
               str:=ttypesym(typesym).realname;
               str:=ttypesym(typesym).realname;
-              asmlist[rttilist].concat(Tai_string.Create(chr(length(str))+str));
+              asmlist[al_rtti].concat(Tai_string.Create(chr(length(str))+str));
            end
            end
          else
          else
-           asmlist[rttilist].concat(Tai_string.Create(#0))
+           asmlist[al_rtti].concat(Tai_string.Create(#0))
       end;
       end;
 
 
 
 
     procedure tstoreddef.write_rtti_data(rt:trttitype);
     procedure tstoreddef.write_rtti_data(rt:trttitype);
       begin
       begin
-        asmlist[rttilist].concat(tai_const.create_8bit(tkUnknown));
+        asmlist[al_rtti].concat(tai_const.create_8bit(tkUnknown));
         write_rtti_name;
         write_rtti_name;
       end;
       end;
 
 
@@ -1290,11 +1290,11 @@ implementation
              begin
              begin
                objectlibrary.getdatalabel(localrttilab[rt]);
                objectlibrary.getdatalabel(localrttilab[rt]);
                write_child_rtti_data(rt);
                write_child_rtti_data(rt);
-               maybe_new_object_file(asmlist[rttilist]);
-               new_section(asmlist[rttilist],sec_rodata,localrttilab[rt].name,const_align(sizeof(aint)));
-               asmlist[rttilist].concat(Tai_symbol.Create_global(localrttilab[rt],0));
+               maybe_new_object_file(asmlist[al_rtti]);
+               new_section(asmlist[al_rtti],sec_rodata,localrttilab[rt].name,const_align(sizeof(aint)));
+               asmlist[al_rtti].concat(Tai_symbol.Create_global(localrttilab[rt],0));
                write_rtti_data(rt);
                write_rtti_data(rt);
-               asmlist[rttilist].concat(Tai_symbol_end.Create(localrttilab[rt]));
+               asmlist[al_rtti].concat(Tai_symbol_end.Create(localrttilab[rt]));
              end;
              end;
             get_rtti_label:=localrttilab[rt];
             get_rtti_label:=localrttilab[rt];
           end;
           end;
@@ -1654,43 +1654,43 @@ implementation
           {$ifdef ansistring_bits}
           {$ifdef ansistring_bits}
             st_ansistring16:
             st_ansistring16:
               begin
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkA16String));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkA16String));
                  write_rtti_name;
                  write_rtti_name;
               end;
               end;
             st_ansistring32:
             st_ansistring32:
               begin
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkA32String));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkA32String));
                  write_rtti_name;
                  write_rtti_name;
               end;
               end;
             st_ansistring64:
             st_ansistring64:
               begin
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkA64String));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkA64String));
                  write_rtti_name;
                  write_rtti_name;
               end;
               end;
           {$else}
           {$else}
             st_ansistring:
             st_ansistring:
               begin
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkAString));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkAString));
                  write_rtti_name;
                  write_rtti_name;
               end;
               end;
           {$endif}
           {$endif}
             st_widestring:
             st_widestring:
               begin
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkWString));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkWString));
                  write_rtti_name;
                  write_rtti_name;
               end;
               end;
             st_longstring:
             st_longstring:
               begin
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkLString));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkLString));
                  write_rtti_name;
                  write_rtti_name;
               end;
               end;
             st_shortstring:
             st_shortstring:
               begin
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkSString));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkSString));
                  write_rtti_name;
                  write_rtti_name;
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(len));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(len));
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-                 asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+                 asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
               end;
               end;
          end;
          end;
@@ -1927,36 +1927,36 @@ implementation
       var
       var
          hp : tenumsym;
          hp : tenumsym;
       begin
       begin
-         asmlist[rttilist].concat(Tai_const.Create_8bit(tkEnumeration));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(tkEnumeration));
          write_rtti_name;
          write_rtti_name;
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
          case longint(savesize) of
          case longint(savesize) of
             1:
             1:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(otUByte));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(otUByte));
             2:
             2:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(otUWord));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(otUWord));
             4:
             4:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(otULong));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(otULong));
          end;
          end;
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(4));
+         asmlist[al_rtti].concat(Tai_align.Create(4));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_const.Create_32bit(min));
-         asmlist[rttilist].concat(Tai_const.Create_32bit(max));
+         asmlist[al_rtti].concat(Tai_const.Create_32bit(min));
+         asmlist[al_rtti].concat(Tai_const.Create_32bit(max));
          if assigned(basedef) then
          if assigned(basedef) then
-           asmlist[rttilist].concat(Tai_const.Create_sym(basedef.get_rtti_label(rt)))
+           asmlist[al_rtti].concat(Tai_const.Create_sym(basedef.get_rtti_label(rt)))
          else
          else
-           asmlist[rttilist].concat(Tai_const.create_sym(nil));
+           asmlist[al_rtti].concat(Tai_const.create_sym(nil));
          hp:=tenumsym(firstenum);
          hp:=tenumsym(firstenum);
          while assigned(hp) do
          while assigned(hp) do
            begin
            begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(length(hp.realname)));
-              asmlist[rttilist].concat(Tai_string.Create(hp.realname));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(length(hp.realname)));
+              asmlist[al_rtti].concat(Tai_string.Create(hp.realname));
               hp:=hp.nextenum;
               hp:=hp.nextenum;
            end;
            end;
-         asmlist[rttilist].concat(Tai_const.Create_8bit(0));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(0));
       end;
       end;
 
 
 
 
@@ -2122,60 +2122,60 @@ implementation
         begin
         begin
           write_rtti_name;
           write_rtti_name;
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-          asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+          asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
-          asmlist[rttilist].concat(Tai_const.Create_8bit(byte(trans[typ])));
+          asmlist[al_rtti].concat(Tai_const.Create_8bit(byte(trans[typ])));
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(4));
+         asmlist[al_rtti].concat(Tai_align.Create(4));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
-          asmlist[rttilist].concat(Tai_const.Create_32bit(longint(low)));
-          asmlist[rttilist].concat(Tai_const.Create_32bit(longint(high)));
+          asmlist[al_rtti].concat(Tai_const.Create_32bit(longint(low)));
+          asmlist[al_rtti].concat(Tai_const.Create_32bit(longint(high)));
         end;
         end;
 
 
       begin
       begin
         case typ of
         case typ of
           s64bit :
           s64bit :
             begin
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkInt64));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkInt64));
               write_rtti_name;
               write_rtti_name;
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-              asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+              asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
               { low }
               { low }
-              asmlist[rttilist].concat(Tai_const.Create_64bit(int64($80000000) shl 32));
+              asmlist[al_rtti].concat(Tai_const.Create_64bit(int64($80000000) shl 32));
               { high }
               { high }
-              asmlist[rttilist].concat(Tai_const.Create_64bit((int64($7fffffff) shl 32) or int64($ffffffff)));
+              asmlist[al_rtti].concat(Tai_const.Create_64bit((int64($7fffffff) shl 32) or int64($ffffffff)));
             end;
             end;
           u64bit :
           u64bit :
             begin
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkQWord));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkQWord));
               write_rtti_name;
               write_rtti_name;
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-              asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+              asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
               { low }
               { low }
-              asmlist[rttilist].concat(Tai_const.Create_64bit(0));
+              asmlist[al_rtti].concat(Tai_const.Create_64bit(0));
               { high }
               { high }
-              asmlist[rttilist].concat(Tai_const.Create_64bit(int64((int64($ffffffff) shl 32) or int64($ffffffff))));
+              asmlist[al_rtti].concat(Tai_const.Create_64bit(int64((int64($ffffffff) shl 32) or int64($ffffffff))));
             end;
             end;
           bool8bit:
           bool8bit:
             begin
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkBool));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkBool));
               dointeger;
               dointeger;
             end;
             end;
           uchar:
           uchar:
             begin
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkChar));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkChar));
               dointeger;
               dointeger;
             end;
             end;
           uwidechar:
           uwidechar:
             begin
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkWChar));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkWChar));
               dointeger;
               dointeger;
             end;
             end;
           else
           else
             begin
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkInteger));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkInteger));
               dointeger;
               dointeger;
             end;
             end;
         end;
         end;
@@ -2300,12 +2300,12 @@ implementation
          translate : array[tfloattype] of byte =
          translate : array[tfloattype] of byte =
            (ftSingle,ftDouble,ftExtended,ftComp,ftCurr,ftFloat128);
            (ftSingle,ftDouble,ftExtended,ftComp,ftCurr,ftFloat128);
       begin
       begin
-         asmlist[rttilist].concat(Tai_const.Create_8bit(tkFloat));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(tkFloat));
          write_rtti_name;
          write_rtti_name;
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_const.Create_8bit(translate[typ]));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(translate[typ]));
       end;
       end;
 
 
 
 
@@ -2578,7 +2578,7 @@ implementation
 
 
     procedure tvariantdef.write_rtti_data(rt:trttitype);
     procedure tvariantdef.write_rtti_data(rt:trttitype);
       begin
       begin
-         asmlist[rttilist].concat(Tai_const.Create_8bit(tkVariant));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(tkVariant));
       end;
       end;
 
 
 
 
@@ -2920,16 +2920,16 @@ implementation
 
 
     procedure tsetdef.write_rtti_data(rt:trttitype);
     procedure tsetdef.write_rtti_data(rt:trttitype);
       begin
       begin
-         asmlist[rttilist].concat(Tai_const.Create_8bit(tkSet));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(tkSet));
          write_rtti_name;
          write_rtti_name;
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_const.Create_8bit(otULong));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(otULong));
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_const.Create_sym(tstoreddef(elementtype.def).get_rtti_label(rt)));
+         asmlist[al_rtti].concat(Tai_const.Create_sym(tstoreddef(elementtype.def).get_rtti_label(rt)));
       end;
       end;
 
 
 
 
@@ -3216,21 +3216,21 @@ implementation
     procedure tarraydef.write_rtti_data(rt:trttitype);
     procedure tarraydef.write_rtti_data(rt:trttitype);
       begin
       begin
          if IsDynamicArray then
          if IsDynamicArray then
-           asmlist[rttilist].concat(Tai_const.Create_8bit(tkdynarray))
+           asmlist[al_rtti].concat(Tai_const.Create_8bit(tkdynarray))
          else
          else
-           asmlist[rttilist].concat(Tai_const.Create_8bit(tkarray));
+           asmlist[al_rtti].concat(Tai_const.Create_8bit(tkarray));
          write_rtti_name;
          write_rtti_name;
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
          { size of elements }
          { size of elements }
-         asmlist[rttilist].concat(Tai_const.Create_aint(elesize));
+         asmlist[al_rtti].concat(Tai_const.Create_aint(elesize));
          if not(IsDynamicArray) then
          if not(IsDynamicArray) then
-           asmlist[rttilist].concat(Tai_const.Create_aint(elecount));
+           asmlist[al_rtti].concat(Tai_const.Create_aint(elecount));
          { element type }
          { element type }
-         asmlist[rttilist].concat(Tai_const.Create_sym(tstoreddef(elementtype.def).get_rtti_label(rt)));
+         asmlist[al_rtti].concat(Tai_const.Create_sym(tstoreddef(elementtype.def).get_rtti_label(rt)));
          { variant type }
          { variant type }
-         asmlist[rttilist].concat(Tai_const.Create_32bit(tstoreddef(elementtype.def).getvartype));
+         asmlist[al_rtti].concat(Tai_const.Create_32bit(tstoreddef(elementtype.def).getvartype));
       end;
       end;
 
 
 
 
@@ -3354,8 +3354,8 @@ implementation
             ((tsym(sym).typ=fieldvarsym) and
             ((tsym(sym).typ=fieldvarsym) and
              tfieldvarsym(sym).vartype.def.needs_inittable) then
              tfieldvarsym(sym).vartype.def.needs_inittable) then
           begin
           begin
-            asmlist[rttilist].concat(Tai_const.Create_sym(tstoreddef(tfieldvarsym(sym).vartype.def).get_rtti_label(FRTTIType)));
-            asmlist[rttilist].concat(Tai_const.Create_32bit(tfieldvarsym(sym).fieldoffset));
+            asmlist[al_rtti].concat(Tai_const.Create_sym(tstoreddef(tfieldvarsym(sym).vartype.def).get_rtti_label(FRTTIType)));
+            asmlist[al_rtti].concat(Tai_const.Create_32bit(tfieldvarsym(sym).fieldoffset));
           end;
           end;
       end;
       end;
 
 
@@ -3510,16 +3510,16 @@ implementation
 
 
     procedure trecorddef.write_rtti_data(rt:trttitype);
     procedure trecorddef.write_rtti_data(rt:trttitype);
       begin
       begin
-         asmlist[rttilist].concat(Tai_const.Create_8bit(tkrecord));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(tkrecord));
          write_rtti_name;
          write_rtti_name;
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_const.Create_32bit(size));
+         asmlist[al_rtti].concat(Tai_const.Create_32bit(size));
          Count:=0;
          Count:=0;
          FRTTIType:=rt;
          FRTTIType:=rt;
          symtable.foreach(@count_field_rtti,nil);
          symtable.foreach(@count_field_rtti,nil);
-         asmlist[rttilist].concat(Tai_const.Create_32bit(Count));
+         asmlist[al_rtti].concat(Tai_const.Create_32bit(Count));
          symtable.foreach(@write_field_rtti,nil);
          symtable.foreach(@write_field_rtti,nil);
       end;
       end;
 
 
@@ -4911,10 +4911,10 @@ implementation
                  vs_out  : paraspec := pfOut;
                  vs_out  : paraspec := pfOut;
                end;
                end;
                { write flags for current parameter }
                { write flags for current parameter }
-               asmlist[rttilist].concat(Tai_const.Create_8bit(paraspec));
+               asmlist[al_rtti].concat(Tai_const.Create_8bit(paraspec));
                { write name of current parameter }
                { write name of current parameter }
-               asmlist[rttilist].concat(Tai_const.Create_8bit(length(parasym.realname)));
-               asmlist[rttilist].concat(Tai_string.Create(parasym.realname));
+               asmlist[al_rtti].concat(Tai_const.Create_8bit(length(parasym.realname)));
+               asmlist[al_rtti].concat(Tai_string.Create(parasym.realname));
 
 
                { write name of type of current parameter }
                { write name of type of current parameter }
                tstoreddef(parasym.vartype.def).write_rtti_name;
                tstoreddef(parasym.vartype.def).write_rtti_name;
@@ -4928,21 +4928,21 @@ implementation
         if po_methodpointer in procoptions then
         if po_methodpointer in procoptions then
           begin
           begin
              { write method id and name }
              { write method id and name }
-             asmlist[rttilist].concat(Tai_const.Create_8bit(tkmethod));
+             asmlist[al_rtti].concat(Tai_const.Create_8bit(tkmethod));
              write_rtti_name;
              write_rtti_name;
 
 
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-             asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+             asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
              { write kind of method (can only be function or procedure)}
              { write kind of method (can only be function or procedure)}
              if rettype.def = voidtype.def then
              if rettype.def = voidtype.def then
                methodkind := mkProcedure
                methodkind := mkProcedure
              else
              else
                methodkind := mkFunction;
                methodkind := mkFunction;
-             asmlist[rttilist].concat(Tai_const.Create_8bit(methodkind));
+             asmlist[al_rtti].concat(Tai_const.Create_8bit(methodkind));
 
 
              { get # of parameters }
              { get # of parameters }
-             asmlist[rttilist].concat(Tai_const.Create_8bit(maxparacount));
+             asmlist[al_rtti].concat(Tai_const.Create_8bit(maxparacount));
 
 
              { write parameter info. The parameters must be written in reverse order
              { write parameter info. The parameters must be written in reverse order
                if this method uses right to left parameter pushing! }
                if this method uses right to left parameter pushing! }
@@ -5714,7 +5714,7 @@ implementation
         begin
         begin
            if not(assigned(proc) and assigned(proc.firstsym))  then
            if not(assigned(proc) and assigned(proc.firstsym))  then
              begin
              begin
-                asmlist[rttilist].concat(Tai_const.create(ait_const_ptr,1));
+                asmlist[al_rtti].concat(Tai_const.create(ait_const_ptr,1));
                 typvalue:=3;
                 typvalue:=3;
              end
              end
            else if proc.firstsym^.sym.typ=fieldvarsym then
            else if proc.firstsym^.sym.typ=fieldvarsym then
@@ -5747,7 +5747,7 @@ implementation
                      end;
                      end;
                      hp:=hp^.next;
                      hp:=hp^.next;
                   end;
                   end;
-                asmlist[rttilist].concat(Tai_const.create(ait_const_ptr,address));
+                asmlist[al_rtti].concat(Tai_const.create(ait_const_ptr,address));
                 typvalue:=0;
                 typvalue:=0;
              end
              end
            else
            else
@@ -5757,13 +5757,13 @@ implementation
                   exit;
                   exit;
                 if not(po_virtualmethod in tprocdef(proc.procdef).procoptions) then
                 if not(po_virtualmethod in tprocdef(proc.procdef).procoptions) then
                   begin
                   begin
-                     asmlist[rttilist].concat(Tai_const.createname(tprocdef(proc.procdef).mangledname,AT_FUNCTION,0));
+                     asmlist[al_rtti].concat(Tai_const.createname(tprocdef(proc.procdef).mangledname,AT_FUNCTION,0));
                      typvalue:=1;
                      typvalue:=1;
                   end
                   end
                 else
                 else
                   begin
                   begin
                      { virtual method, write vmt offset }
                      { virtual method, write vmt offset }
-                     asmlist[rttilist].concat(Tai_const.create(ait_const_ptr,
+                     asmlist[al_rtti].concat(Tai_const.create(ait_const_ptr,
                        tprocdef(proc.procdef)._class.vmtmethodoffset(tprocdef(proc.procdef).extnumber)));
                        tprocdef(proc.procdef)._class.vmtmethodoffset(tprocdef(proc.procdef).extnumber)));
                      typvalue:=2;
                      typvalue:=2;
                   end;
                   end;
@@ -5782,20 +5782,20 @@ implementation
                      internalerror(1509992);
                      internalerror(1509992);
                    { access to implicit class property as field }
                    { access to implicit class property as field }
                    proctypesinfo:=(0 shl 0) or (0 shl 2) or (0 shl 4);
                    proctypesinfo:=(0 shl 0) or (0 shl 2) or (0 shl 4);
-                   asmlist[rttilist].concat(Tai_const_symbol.Createname(tvarsym(sym.vartype.def.get_rtti_label),AT_DATA,0));
-                   asmlist[rttilist].concat(Tai_const.create(ait_const_ptr,tvarsym(sym.address)));
-                   asmlist[rttilist].concat(Tai_const.create(ait_const_ptr,tvarsym(sym.address)));
+                   asmlist[al_rtti].concat(Tai_const_symbol.Createname(tvarsym(sym.vartype.def.get_rtti_label),AT_DATA,0));
+                   asmlist[al_rtti].concat(Tai_const.create(ait_const_ptr,tvarsym(sym.address)));
+                   asmlist[al_rtti].concat(Tai_const.create(ait_const_ptr,tvarsym(sym.address)));
                    { by default stored }
                    { by default stored }
-                   asmlist[rttilist].concat(Tai_const.Create_32bit(1));
+                   asmlist[al_rtti].concat(Tai_const.Create_32bit(1));
                    { index as well as ... }
                    { index as well as ... }
-                   asmlist[rttilist].concat(Tai_const.Create_32bit(0));
+                   asmlist[al_rtti].concat(Tai_const.Create_32bit(0));
                    { default value are zero }
                    { default value are zero }
-                   asmlist[rttilist].concat(Tai_const.Create_32bit(0));
-                   asmlist[rttilist].concat(Tai_const.Create_16bit(count));
+                   asmlist[al_rtti].concat(Tai_const.Create_32bit(0));
+                   asmlist[al_rtti].concat(Tai_const.Create_16bit(count));
                    inc(count);
                    inc(count);
-                   asmlist[rttilist].concat(Tai_const.Create_8bit(proctypesinfo));
-                   asmlist[rttilist].concat(Tai_const.Create_8bit(length(tvarsym(sym.realname))));
-                   asmlist[rttilist].concat(Tai_string.Create(tvarsym(sym.realname)));
+                   asmlist[al_rtti].concat(Tai_const.Create_8bit(proctypesinfo));
+                   asmlist[al_rtti].concat(Tai_const.Create_8bit(length(tvarsym(sym.realname))));
+                   asmlist[al_rtti].concat(Tai_string.Create(tvarsym(sym.realname)));
 {$endif dummy}
 {$endif dummy}
                 end;
                 end;
               propertysym:
               propertysym:
@@ -5804,26 +5804,26 @@ implementation
                      proctypesinfo:=$40
                      proctypesinfo:=$40
                    else
                    else
                      proctypesinfo:=0;
                      proctypesinfo:=0;
-                   asmlist[rttilist].concat(Tai_const.Create_sym(tstoreddef(tpropertysym(sym).proptype.def).get_rtti_label(fullrtti)));
+                   asmlist[al_rtti].concat(Tai_const.Create_sym(tstoreddef(tpropertysym(sym).proptype.def).get_rtti_label(fullrtti)));
                    writeproc(tpropertysym(sym).readaccess,0);
                    writeproc(tpropertysym(sym).readaccess,0);
                    writeproc(tpropertysym(sym).writeaccess,2);
                    writeproc(tpropertysym(sym).writeaccess,2);
                    { isn't it stored ? }
                    { isn't it stored ? }
                    if not(ppo_stored in tpropertysym(sym).propoptions) then
                    if not(ppo_stored in tpropertysym(sym).propoptions) then
                      begin
                      begin
-                        asmlist[rttilist].concat(Tai_const.create_sym(nil));
+                        asmlist[al_rtti].concat(Tai_const.create_sym(nil));
                         proctypesinfo:=proctypesinfo or (3 shl 4);
                         proctypesinfo:=proctypesinfo or (3 shl 4);
                      end
                      end
                    else
                    else
                      writeproc(tpropertysym(sym).storedaccess,4);
                      writeproc(tpropertysym(sym).storedaccess,4);
-                   asmlist[rttilist].concat(Tai_const.Create_32bit(tpropertysym(sym).index));
-                   asmlist[rttilist].concat(Tai_const.Create_32bit(tpropertysym(sym).default));
-                   asmlist[rttilist].concat(Tai_const.Create_16bit(count));
+                   asmlist[al_rtti].concat(Tai_const.Create_32bit(tpropertysym(sym).index));
+                   asmlist[al_rtti].concat(Tai_const.Create_32bit(tpropertysym(sym).default));
+                   asmlist[al_rtti].concat(Tai_const.Create_16bit(count));
                    inc(count);
                    inc(count);
-                   asmlist[rttilist].concat(Tai_const.Create_8bit(proctypesinfo));
-                   asmlist[rttilist].concat(Tai_const.Create_8bit(length(tpropertysym(sym).realname)));
-                   asmlist[rttilist].concat(Tai_string.Create(tpropertysym(sym).realname));
+                   asmlist[al_rtti].concat(Tai_const.Create_8bit(proctypesinfo));
+                   asmlist[al_rtti].concat(Tai_const.Create_8bit(length(tpropertysym(sym).realname)));
+                   asmlist[al_rtti].concat(Tai_string.Create(tpropertysym(sym).realname));
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-                   asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+                   asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
                 end;
                 end;
               else internalerror(1509992);
               else internalerror(1509992);
@@ -5921,15 +5921,15 @@ implementation
           (tsym(sym).typ=fieldvarsym) then
           (tsym(sym).typ=fieldvarsym) then
           begin
           begin
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-             asmlist[rttilist].concat(Tai_align.Create(sizeof(AInt)));
+             asmlist[al_rtti].concat(Tai_align.Create(sizeof(AInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
-             asmlist[rttilist].concat(Tai_const.Create_aint(tfieldvarsym(sym).fieldoffset));
+             asmlist[al_rtti].concat(Tai_const.Create_aint(tfieldvarsym(sym).fieldoffset));
              hp:=searchclasstablelist(tobjectdef(tfieldvarsym(sym).vartype.def));
              hp:=searchclasstablelist(tobjectdef(tfieldvarsym(sym).vartype.def));
              if not(assigned(hp)) then
              if not(assigned(hp)) then
                internalerror(0206002);
                internalerror(0206002);
-             asmlist[rttilist].concat(Tai_const.Create_16bit(hp.index));
-             asmlist[rttilist].concat(Tai_const.Create_8bit(length(tfieldvarsym(sym).realname)));
-             asmlist[rttilist].concat(Tai_string.Create(tfieldvarsym(sym).realname));
+             asmlist[al_rtti].concat(Tai_const.Create_16bit(hp.index));
+             asmlist[al_rtti].concat(Tai_const.Create_8bit(length(tfieldvarsym(sym).realname)));
+             asmlist[al_rtti].concat(Tai_string.Create(tfieldvarsym(sym).realname));
           end;
           end;
       end;
       end;
 
 
@@ -5946,29 +5946,29 @@ implementation
          objectlibrary.getdatalabel(classtable);
          objectlibrary.getdatalabel(classtable);
          count:=0;
          count:=0;
          tablecount:=0;
          tablecount:=0;
-         maybe_new_object_file(asmlist[rttilist]);
-         new_section(asmlist[rttilist],sec_rodata,classtable.name,const_align(sizeof(aint)));
+         maybe_new_object_file(asmlist[al_rtti]);
+         new_section(asmlist[al_rtti],sec_rodata,classtable.name,const_align(sizeof(aint)));
          { fields }
          { fields }
          symtable.foreach({$ifdef FPC}@{$endif}count_published_fields,nil);
          symtable.foreach({$ifdef FPC}@{$endif}count_published_fields,nil);
-         asmlist[rttilist].concat(Tai_label.Create(fieldtable));
-         asmlist[rttilist].concat(Tai_const.Create_16bit(count));
+         asmlist[al_rtti].concat(Tai_label.Create(fieldtable));
+         asmlist[al_rtti].concat(Tai_const.Create_16bit(count));
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_const.Create_sym(classtable));
+         asmlist[al_rtti].concat(Tai_const.Create_sym(classtable));
          symtable.foreach({$ifdef FPC}@{$endif}writefields,nil);
          symtable.foreach({$ifdef FPC}@{$endif}writefields,nil);
 
 
          { generate the class table }
          { generate the class table }
-         asmlist[rttilist].concat(tai_align.create(const_align(sizeof(aint))));
-         asmlist[rttilist].concat(Tai_label.Create(classtable));
-         asmlist[rttilist].concat(Tai_const.Create_16bit(tablecount));
+         asmlist[al_rtti].concat(tai_align.create(const_align(sizeof(aint))));
+         asmlist[al_rtti].concat(Tai_label.Create(classtable));
+         asmlist[al_rtti].concat(Tai_const.Create_16bit(tablecount));
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
          hp:=tclasslistitem(classtablelist.first);
          hp:=tclasslistitem(classtablelist.first);
          while assigned(hp) do
          while assigned(hp) do
            begin
            begin
-              asmlist[rttilist].concat(Tai_const.Createname(tobjectdef(hp.p).vmt_mangledname,AT_DATA,0));
+              asmlist[al_rtti].concat(Tai_const.Createname(tobjectdef(hp.p).vmt_mangledname,AT_DATA,0));
               hp:=tclasslistitem(hp.next);
               hp:=tclasslistitem(hp.next);
            end;
            end;
 
 
@@ -5997,33 +5997,33 @@ implementation
       begin
       begin
          case objecttype of
          case objecttype of
             odt_class:
             odt_class:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkclass));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkclass));
             odt_object:
             odt_object:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkobject));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkobject));
             odt_interfacecom:
             odt_interfacecom:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkinterface));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkinterface));
             odt_interfacecorba:
             odt_interfacecorba:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkinterfaceCorba));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkinterfaceCorba));
           else
           else
             exit;
             exit;
           end;
           end;
 
 
          { generate the name }
          { generate the name }
-         asmlist[rttilist].concat(Tai_const.Create_8bit(length(objrealname^)));
-         asmlist[rttilist].concat(Tai_string.Create(objrealname^));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(length(objrealname^)));
+         asmlist[al_rtti].concat(Tai_string.Create(objrealname^));
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
          case rt of
          case rt of
            initrtti :
            initrtti :
              begin
              begin
-               asmlist[rttilist].concat(Tai_const.Create_32bit(size));
+               asmlist[al_rtti].concat(Tai_const.Create_32bit(size));
                if objecttype in [odt_class,odt_object] then
                if objecttype in [odt_class,odt_object] then
                 begin
                 begin
                   count:=0;
                   count:=0;
                   FRTTIType:=rt;
                   FRTTIType:=rt;
                   symtable.foreach(@count_field_rtti,nil);
                   symtable.foreach(@count_field_rtti,nil);
-                  asmlist[rttilist].concat(Tai_const.Create_32bit(count));
+                  asmlist[al_rtti].concat(Tai_const.Create_32bit(count));
                   symtable.foreach(@write_field_rtti,nil);
                   symtable.foreach(@write_field_rtti,nil);
                 end;
                 end;
              end;
              end;
@@ -6032,17 +6032,17 @@ implementation
                if not(objecttype in [odt_interfacecom,odt_interfacecorba]) then
                if not(objecttype in [odt_interfacecom,odt_interfacecorba]) then
                  begin
                  begin
                    if (oo_has_vmt in objectoptions) then
                    if (oo_has_vmt in objectoptions) then
-                     asmlist[rttilist].concat(Tai_const.Createname(vmt_mangledname,AT_DATA,0))
+                     asmlist[al_rtti].concat(Tai_const.Createname(vmt_mangledname,AT_DATA,0))
                    else
                    else
-                     asmlist[rttilist].concat(Tai_const.create_sym(nil));
+                     asmlist[al_rtti].concat(Tai_const.create_sym(nil));
                  end;
                  end;
 
 
                { write parent typeinfo }
                { write parent typeinfo }
                if assigned(childof) and ((oo_can_have_published in childof.objectoptions) or
                if assigned(childof) and ((oo_can_have_published in childof.objectoptions) or
                  (objecttype in [odt_interfacecom,odt_interfacecorba])) then
                  (objecttype in [odt_interfacecom,odt_interfacecorba])) then
-                 asmlist[rttilist].concat(Tai_const.Create_sym(childof.get_rtti_label(fullrtti)))
+                 asmlist[al_rtti].concat(Tai_const.Create_sym(childof.get_rtti_label(fullrtti)))
                else
                else
-                 asmlist[rttilist].concat(Tai_const.create_sym(nil));
+                 asmlist[al_rtti].concat(Tai_const.create_sym(nil));
 
 
                if objecttype in [odt_object,odt_class] then
                if objecttype in [odt_object,odt_class] then
                  begin
                  begin
@@ -6054,12 +6054,12 @@ implementation
 
 
                    { write it }
                    { write it }
                    symtable.foreach(@count_published_properties,nil);
                    symtable.foreach(@count_published_properties,nil);
-                   asmlist[rttilist].concat(Tai_const.Create_16bit(count));
+                   asmlist[al_rtti].concat(Tai_const.Create_16bit(count));
                  end
                  end
                else
                else
                  { interface: write flags, iid and iidstr }
                  { interface: write flags, iid and iidstr }
                  begin
                  begin
-                   asmlist[rttilist].concat(Tai_const.Create_32bit(
+                   asmlist[al_rtti].concat(Tai_const.Create_32bit(
                      { ugly, but working }
                      { ugly, but working }
                      longint([
                      longint([
                        TCompilerIntfFlag(ord(ifHasGuid)*ord(assigned(iidguid))),
                        TCompilerIntfFlag(ord(ifHasGuid)*ord(assigned(iidguid))),
@@ -6070,21 +6070,21 @@ implementation
                      ifDispatch, }
                      ifDispatch, }
                      ));
                      ));
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-                   asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+                   asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
-                   asmlist[rttilist].concat(Tai_const.Create_32bit(longint(iidguid^.D1)));
-                   asmlist[rttilist].concat(Tai_const.Create_16bit(iidguid^.D2));
-                   asmlist[rttilist].concat(Tai_const.Create_16bit(iidguid^.D3));
+                   asmlist[al_rtti].concat(Tai_const.Create_32bit(longint(iidguid^.D1)));
+                   asmlist[al_rtti].concat(Tai_const.Create_16bit(iidguid^.D2));
+                   asmlist[al_rtti].concat(Tai_const.Create_16bit(iidguid^.D3));
                    for i:=Low(iidguid^.D4) to High(iidguid^.D4) do
                    for i:=Low(iidguid^.D4) to High(iidguid^.D4) do
-                     asmlist[rttilist].concat(Tai_const.Create_8bit(iidguid^.D4[i]));
+                     asmlist[al_rtti].concat(Tai_const.Create_8bit(iidguid^.D4[i]));
                  end;
                  end;
 
 
                { write unit name }
                { write unit name }
-               asmlist[rttilist].concat(Tai_const.Create_8bit(length(current_module.realmodulename^)));
-               asmlist[rttilist].concat(Tai_string.Create(current_module.realmodulename^));
+               asmlist[al_rtti].concat(Tai_const.Create_8bit(length(current_module.realmodulename^)));
+               asmlist[al_rtti].concat(Tai_string.Create(current_module.realmodulename^));
 
 
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-               asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+               asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
 
 
                { write iidstr }
                { write iidstr }
@@ -6092,13 +6092,13 @@ implementation
                  begin
                  begin
                    if assigned(iidstr) then
                    if assigned(iidstr) then
                      begin
                      begin
-                       asmlist[rttilist].concat(Tai_const.Create_8bit(length(iidstr^)));
-                       asmlist[rttilist].concat(Tai_string.Create(iidstr^));
+                       asmlist[al_rtti].concat(Tai_const.Create_8bit(length(iidstr^)));
+                       asmlist[al_rtti].concat(Tai_string.Create(iidstr^));
                      end
                      end
                    else
                    else
-                     asmlist[rttilist].concat(Tai_const.Create_8bit(0));
+                     asmlist[al_rtti].concat(Tai_const.Create_8bit(0));
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-                   asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+                   asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
                  end;
                  end;
 
 
@@ -6107,10 +6107,10 @@ implementation
                    { write published properties count }
                    { write published properties count }
                    count:=0;
                    count:=0;
                    symtable.foreach(@count_published_properties,nil);
                    symtable.foreach(@count_published_properties,nil);
-                   asmlist[rttilist].concat(Tai_const.Create_16bit(count));
+                   asmlist[al_rtti].concat(Tai_const.Create_16bit(count));
 
 
 {$ifdef cpurequiresproperalignment}
 {$ifdef cpurequiresproperalignment}
-                   asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+                   asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 {$endif cpurequiresproperalignment}
                  end;
                  end;
 
 

+ 1 - 1
compiler/symsym.pas

@@ -2161,7 +2161,7 @@ implementation
          consttype.reset;
          consttype.reset;
          value.len:=l;
          value.len:=l;
          if t=constresourcestring then
          if t=constresourcestring then
-           ResStrIndex:=ResourceStrings.Register(name,pchar(value.valueptr),value.len);
+           ResStrIndex:=al_resourcestrings.Register(name,pchar(value.valueptr),value.len);
       end;
       end;
 
 
 
 

+ 2 - 2
compiler/symtable.pas

@@ -1532,8 +1532,8 @@ implementation
              unittypecount:=1;
              unittypecount:=1;
              pglobaltypecount := @unittypecount;
              pglobaltypecount := @unittypecount;
              {moduleid:=current_module.unitcount;}
              {moduleid:=current_module.unitcount;}
-             {debugList.concat(tai_comment.Create(strpnew('Global '+name^+' has index '+tostr(moduleid))));
-             debugList.concat(Tai_stabs.Create(strpnew('"'+name^+'",'+tostr(N_BINCL)+',0,0,0')));}
+             {al_debug.concat(tai_comment.Create(strpnew('Global '+name^+' has index '+tostr(moduleid))));
+             al_debug.concat(Tai_stabs.Create(strpnew('"'+name^+'",'+tostr(N_BINCL)+',0,0,0')));}
              {inc(current_module.unitcount);}
              {inc(current_module.unitcount);}
              { we can't use dbx_vcount, because we don't know
              { we can't use dbx_vcount, because we don't know
                if the object file will be loaded before or afeter PM }
                if the object file will be loaded before or afeter PM }

+ 5 - 5
compiler/systems/t_beos.pas

@@ -164,11 +164,11 @@ begin
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          begin
          begin
 {$ifdef i386}
 {$ifdef i386}
-           { place jump in codesegment }
-           asmlist[codesegment].concat(Tai_align.Create_op(4,$90));
-           asmlist[codesegment].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
-           asmlist[codesegment].concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
-           asmlist[codesegment].concat(Tai_symbol_end.Createname(hp2.name^));
+           { place jump in al_code }
+           asmlist[al_code].concat(Tai_align.Create_op(4,$90));
+           asmlist[al_code].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
+           asmlist[al_code].concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
+           asmlist[al_code].concat(Tai_symbol_end.Createname(hp2.name^));
 {$endif i386}
 {$endif i386}
          end;
          end;
       end
       end

+ 11 - 11
compiler/systems/t_bsd.pas

@@ -88,8 +88,8 @@ implementation
 
 
     procedure timportlibdarwin.preparelib(const s : string);
     procedure timportlibdarwin.preparelib(const s : string);
       begin
       begin
-         if asmlist[importsection]=nil then
-           asmlist[importsection]:=TAAsmoutput.create;
+         if asmlist[al_imports]=nil then
+           asmlist[al_imports]:=TAAsmoutput.create;
       end;
       end;
 
 
 
 
@@ -219,17 +219,17 @@ begin
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          begin
          begin
 {$ifdef i386}
 {$ifdef i386}
-           { place jump in codesegment }
-           asmlist[codesegment].concat(Tai_align.Create_op(4,$90));
-           asmlist[codeSegment].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
-           asmlist[codeSegment].concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
-           asmlist[codeSegment].concat(Tai_symbol_end.Createname(hp2.name^));
+           { place jump in al_code }
+           asmlist[al_code].concat(Tai_align.Create_op(4,$90));
+           asmlist[al_code].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
+           asmlist[al_code].concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
+           asmlist[al_code].concat(Tai_symbol_end.Createname(hp2.name^));
 {$endif i386}
 {$endif i386}
 {$ifdef powerpc}
 {$ifdef powerpc}
-           asmlist[codesegment].concat(Tai_align.create(16));
-           asmlist[codesegment].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
-           asmlist[codeSegment].concat(Taicpu.Op_sym(A_B,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
-           asmlist[codeSegment].concat(Tai_symbol_end.Createname(hp2.name^));
+           asmlist[al_code].concat(Tai_align.create(16));
+           asmlist[al_code].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
+           asmlist[al_code].concat(Taicpu.Op_sym(A_B,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
+           asmlist[al_code].concat(Tai_symbol_end.Createname(hp2.name^));
 {$endif powerpc}
 {$endif powerpc}
          end;
          end;
       end
       end

+ 6 - 6
compiler/systems/t_linux.pas

@@ -156,7 +156,7 @@ procedure texportliblinux.generatelib;
 var
 var
   hp2 : texported_item;
   hp2 : texported_item;
 begin
 begin
-  new_section(asmlist[codesegment],sec_code,'',0);
+  new_section(asmlist[al_code],sec_code,'',0);
   hp2:=texported_item(current_module._exports.first);
   hp2:=texported_item(current_module._exports.first);
   while assigned(hp2) do
   while assigned(hp2) do
    begin
    begin
@@ -167,11 +167,11 @@ begin
           is declared with cdecl }
           is declared with cdecl }
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          begin
          begin
-           { place jump in codesegment }
-           asmlist[codesegment].concat(tai_align.create(target_info.alignment.procalign));
-           asmlist[codesegment].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
-           cg.a_jmp_name(asmlist[codesegment],tprocsym(hp2.sym).first_procdef.mangledname);
-           asmlist[codesegment].concat(Tai_symbol_end.Createname(hp2.name^));
+           { place jump in al_code }
+           asmlist[al_code].concat(tai_align.create(target_info.alignment.procalign));
+           asmlist[al_code].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
+           cg.a_jmp_name(asmlist[al_code],tprocsym(hp2.sym).first_procdef.mangledname);
+           asmlist[al_code].concat(Tai_symbol_end.Createname(hp2.name^));
          end;
          end;
       end
       end
      else
      else

+ 5 - 5
compiler/systems/t_nwl.pas

@@ -241,11 +241,11 @@ begin
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          begin
          begin
 {$ifdef i386}
 {$ifdef i386}
-           { place jump in codesegment }
-           asmlist[codesegment].concat(Tai_align.Create_op(4,$90));
-           asmlist[codesegment].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
-           asmlist[codesegment].concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
-           asmlist[codesegment].concat(Tai_symbol_end.Createname(hp2.name^));
+           { place jump in al_code }
+           asmlist[al_code].concat(Tai_align.Create_op(4,$90));
+           asmlist[al_code].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
+           asmlist[al_code].concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
+           asmlist[al_code].concat(Tai_symbol_end.Createname(hp2.name^));
 {$endif i386}
 {$endif i386}
          end;
          end;
       end
       end

+ 5 - 5
compiler/systems/t_nwm.pas

@@ -233,11 +233,11 @@ begin
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          begin
          begin
 {$ifdef i386}
 {$ifdef i386}
-           { place jump in codesegment }
-           asmlist[codesegment].concat(Tai_align.Create_op(4,$90));
-           asmlist[codesegment].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
-           asmlist[codesegment].concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
-           asmlist[codesegment].concat(Tai_symbol_end.Createname(hp2.name^));
+           { place jump in al_code }
+           asmlist[al_code].concat(Tai_align.Create_op(4,$90));
+           asmlist[al_code].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
+           asmlist[al_code].concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
+           asmlist[al_code].concat(Tai_symbol_end.Createname(hp2.name^));
 {$endif i386}
 {$endif i386}
          end;
          end;
       end
       end

+ 6 - 6
compiler/systems/t_sunos.pas

@@ -169,7 +169,7 @@ procedure texportlibsolaris.generatelib;
 var
 var
   hp2 : texported_item;
   hp2 : texported_item;
 begin
 begin
-  new_section(asmlist[codesegment],sec_code,'',0);
+  new_section(asmlist[al_code],sec_code,'',0);
   hp2:=texported_item(current_module._exports.first);
   hp2:=texported_item(current_module._exports.first);
   while assigned(hp2) do
   while assigned(hp2) do
    begin
    begin
@@ -180,11 +180,11 @@ begin
           is declared with cdecl }
           is declared with cdecl }
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          begin
          begin
-           { place jump in codesegment }
-           asmlist[codesegment].concat(tai_align.create(target_info.alignment.procalign));
-           asmlist[codesegment].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
-           cg.a_jmp_name(asmlist[codesegment],tprocsym(hp2.sym).first_procdef.mangledname);
-           asmlist[codesegment].concat(Tai_symbol_end.Createname(hp2.name^));
+           { place jump in al_code }
+           asmlist[al_code].concat(tai_align.create(target_info.alignment.procalign));
+           asmlist[al_code].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
+           cg.a_jmp_name(asmlist[al_code],tprocsym(hp2.sym).first_procdef.mangledname);
+           asmlist[al_code].concat(Tai_symbol_end.Createname(hp2.name^));
          end;
          end;
       end
       end
      else
      else

+ 123 - 123
compiler/systems/t_win.pas

@@ -109,8 +109,8 @@ implementation
 
 
     procedure timportlibwin32.preparelib(const s : string);
     procedure timportlibwin32.preparelib(const s : string);
       begin
       begin
-         if asmlist[importsection]=nil then
-           asmlist[importsection]:=TAAsmoutput.create;
+         if asmlist[al_imports]=nil then
+           asmlist[al_imports]:=TAAsmoutput.create;
       end;
       end;
 
 
 
 
@@ -219,7 +219,7 @@ implementation
          hp2 : twin32imported_item;
          hp2 : twin32imported_item;
          p : pchar;
          p : pchar;
       begin
       begin
-         new_section(asmlist[importsection],sec_code,'',0);
+         new_section(asmlist[al_imports],sec_code,'',0);
          hp1:=timportlist(current_module.imports.first);
          hp1:=timportlist(current_module.imports.first);
          while assigned(hp1) do
          while assigned(hp1) do
            begin
            begin
@@ -230,9 +230,9 @@ implementation
                    p:=strpnew(#9+'EXTRN '+hp2.func^)
                    p:=strpnew(#9+'EXTRN '+hp2.func^)
                  else
                  else
                    p:=strpnew(#9+'EXTERN '+hp2.func^);
                    p:=strpnew(#9+'EXTERN '+hp2.func^);
-                 asmlist[importsection].concat(tai_direct.create(p));
+                 asmlist[al_imports].concat(tai_direct.create(p));
                  p:=strpnew(#9+'import '+hp2.func^+' '+hp1.dllname^+' '+hp2.name^);
                  p:=strpnew(#9+'import '+hp2.func^+' '+hp1.dllname^+' '+hp2.name^);
-                 asmlist[importsection].concat(tai_direct.create(p));
+                 asmlist[al_imports].concat(tai_direct.create(p));
                  hp2:=twin32imported_item(hp2.next);
                  hp2:=twin32imported_item(hp2.next);
                end;
                end;
              hp1:=timportlist(hp1.next);
              hp1:=timportlist(hp1.next);
@@ -267,33 +267,33 @@ implementation
              objectlibrary.getaddrlabel(lidata4);
              objectlibrary.getaddrlabel(lidata4);
              objectlibrary.getaddrlabel(lidata5);
              objectlibrary.getaddrlabel(lidata5);
            { create header for this importmodule }
            { create header for this importmodule }
-             asmlist[importsection].concat(Tai_cutobject.Create_begin);
-             new_section(asmlist[importsection],sec_idata2,'',0);
-             asmlist[importsection].concat(Tai_label.Create(lhead));
+             asmlist[al_imports].concat(Tai_cutobject.Create_begin);
+             new_section(asmlist[al_imports],sec_idata2,'',0);
+             asmlist[al_imports].concat(Tai_label.Create(lhead));
              { pointer to procedure names }
              { pointer to procedure names }
-             asmlist[importsection].concat(Tai_const.Create_rva_sym(lidata4));
+             asmlist[al_imports].concat(Tai_const.Create_rva_sym(lidata4));
              { two empty entries follow }
              { two empty entries follow }
-             asmlist[importsection].concat(Tai_const.Create_32bit(0));
-             asmlist[importsection].concat(Tai_const.Create_32bit(0));
+             asmlist[al_imports].concat(Tai_const.Create_32bit(0));
+             asmlist[al_imports].concat(Tai_const.Create_32bit(0));
              { pointer to dll name }
              { pointer to dll name }
-             asmlist[importsection].concat(Tai_const.Create_rva_sym(lname));
+             asmlist[al_imports].concat(Tai_const.Create_rva_sym(lname));
              { pointer to fixups }
              { pointer to fixups }
-             asmlist[importsection].concat(Tai_const.Create_rva_sym(lidata5));
+             asmlist[al_imports].concat(Tai_const.Create_rva_sym(lidata5));
              { first write the name references }
              { first write the name references }
-             new_section(asmlist[importsection],sec_idata4,'',0);
-             asmlist[importsection].concat(Tai_const.Create_32bit(0));
-             asmlist[importsection].concat(Tai_label.Create(lidata4));
+             new_section(asmlist[al_imports],sec_idata4,'',0);
+             asmlist[al_imports].concat(Tai_const.Create_32bit(0));
+             asmlist[al_imports].concat(Tai_label.Create(lidata4));
              { then the addresses and create also the indirect jump }
              { then the addresses and create also the indirect jump }
-             new_section(asmlist[importsection],sec_idata5,'',0);
-             asmlist[importsection].concat(Tai_const.Create_32bit(0));
-             asmlist[importsection].concat(Tai_label.Create(lidata5));
+             new_section(asmlist[al_imports],sec_idata5,'',0);
+             asmlist[al_imports].concat(Tai_const.Create_32bit(0));
+             asmlist[al_imports].concat(Tai_label.Create(lidata5));
 
 
              { create procedures }
              { create procedures }
              hp2:=twin32imported_item(hp1.imported_items.first);
              hp2:=twin32imported_item(hp1.imported_items.first);
              while assigned(hp2) do
              while assigned(hp2) do
                begin
                begin
                  { insert cuts }
                  { insert cuts }
-                 asmlist[importsection].concat(Tai_cutobject.Create);
+                 asmlist[al_imports].concat(Tai_cutobject.Create);
                  { create indirect jump }
                  { create indirect jump }
                  if not hp2.is_var then
                  if not hp2.is_var then
                   begin
                   begin
@@ -301,49 +301,49 @@ implementation
                   {$ifdef ARM}
                   {$ifdef ARM}
                     objectlibrary.getlabel(lpcode);
                     objectlibrary.getlabel(lpcode);
                   {$endif ARM}
                   {$endif ARM}
-                    { place jump in codesegment, insert a code section in the
-                      imporTSection to reduce the amount of .s files (PFV) }
-                    new_section(asmlist[importsection],sec_code,'',0);
+                    { place jump in al_code, insert a code section in the
+                      al_imports to reduce the amount of .s files (PFV) }
+                    new_section(asmlist[al_imports],sec_code,'',0);
 {$IfDef GDB}
 {$IfDef GDB}
                     if (cs_debuginfo in aktmoduleswitches) then
                     if (cs_debuginfo in aktmoduleswitches) then
-                      asmlist[importsection].concat(Tai_stab_function_name.Create(nil));
+                      asmlist[al_imports].concat(Tai_stab_function_name.Create(nil));
 {$EndIf GDB}
 {$EndIf GDB}
                     if assigned(hp2.procdef) then
                     if assigned(hp2.procdef) then
                       mangledstring:=hp2.procdef.mangledname
                       mangledstring:=hp2.procdef.mangledname
                     else
                     else
                       mangledstring:=hp2.func^;
                       mangledstring:=hp2.func^;
-                    asmlist[importsection].concat(Tai_symbol.Createname_global(mangledstring,AT_FUNCTION,0));
+                    asmlist[al_imports].concat(Tai_symbol.Createname_global(mangledstring,AT_FUNCTION,0));
                   {$ifdef ARM}
                   {$ifdef ARM}
                     reference_reset_symbol(href,lpcode,0);
                     reference_reset_symbol(href,lpcode,0);
-                    asmlist[importsection].concat(Taicpu.op_reg_ref(A_LDR,NR_R12,href));
+                    asmlist[al_imports].concat(Taicpu.op_reg_ref(A_LDR,NR_R12,href));
                     reference_reset_base(href,NR_R12,0);
                     reference_reset_base(href,NR_R12,0);
-                    asmlist[importsection].concat(Taicpu.op_reg_ref(A_LDR,NR_R15,href));
-                    asmlist[importsection].concat(Tai_label.Create(lpcode));
+                    asmlist[al_imports].concat(Taicpu.op_reg_ref(A_LDR,NR_R15,href));
+                    asmlist[al_imports].concat(Tai_label.Create(lpcode));
                     reference_reset_symbol(href,lcode,0);
                     reference_reset_symbol(href,lcode,0);
-                    asmlist[importsection].concat(tai_const.create_sym_offset(href.symbol,href.offset));
+                    asmlist[al_imports].concat(tai_const.create_sym_offset(href.symbol,href.offset));
                   {$else ARM}
                   {$else ARM}
                     reference_reset_symbol(href,lcode,0);
                     reference_reset_symbol(href,lcode,0);
-                    asmlist[importsection].concat(Taicpu.Op_ref(A_JMP,S_NO,href));
-                    asmlist[importsection].concat(Tai_align.Create_op(4,$90));
+                    asmlist[al_imports].concat(Taicpu.Op_ref(A_JMP,S_NO,href));
+                    asmlist[al_imports].concat(Tai_align.Create_op(4,$90));
                   {$endif ARM}
                   {$endif ARM}
 {$IfDef GDB}
 {$IfDef GDB}
                     if (cs_debuginfo in aktmoduleswitches) and assigned(hp2.procdef) then
                     if (cs_debuginfo in aktmoduleswitches) and assigned(hp2.procdef) then
-                       hp2.procdef.concatstabto(asmlist[importsection]);
+                       hp2.procdef.concatstabto(asmlist[al_imports]);
 {$EndIf GDB}
 {$EndIf GDB}
                   end;
                   end;
                  { create head link }
                  { create head link }
-                 new_section(asmlist[importsection],sec_idata7,'',0);
-                 asmlist[importsection].concat(Tai_const.Create_rva_sym(lhead));
+                 new_section(asmlist[al_imports],sec_idata7,'',0);
+                 asmlist[al_imports].concat(Tai_const.Create_rva_sym(lhead));
                  { fixup }
                  { fixup }
                  objectlibrary.getlabel(tasmlabel(hp2.lab));
                  objectlibrary.getlabel(tasmlabel(hp2.lab));
-                 new_section(asmlist[importsection],sec_idata4,'',0);
-                 asmlist[importsection].concat(Tai_const.Create_rva_sym(hp2.lab));
-                 { add jump field to imporTSection }
-                 new_section(asmlist[importsection],sec_idata5,'',0);
+                 new_section(asmlist[al_imports],sec_idata4,'',0);
+                 asmlist[al_imports].concat(Tai_const.Create_rva_sym(hp2.lab));
+                 { add jump field to al_imports }
+                 new_section(asmlist[al_imports],sec_idata5,'',0);
                  if hp2.is_var then
                  if hp2.is_var then
-                  asmlist[importsection].concat(Tai_symbol.Createname_global(hp2.func^,AT_FUNCTION,0))
+                  asmlist[al_imports].concat(Tai_symbol.Createname_global(hp2.func^,AT_FUNCTION,0))
                  else
                  else
-                  asmlist[importsection].concat(Tai_label.Create(lcode));
+                  asmlist[al_imports].concat(Tai_label.Create(lcode));
 {$ifdef GDB}
 {$ifdef GDB}
                  if (cs_debuginfo in aktmoduleswitches) then
                  if (cs_debuginfo in aktmoduleswitches) then
                   begin
                   begin
@@ -356,7 +356,7 @@ implementation
                            inc(suffix);
                            inc(suffix);
                            importname:='__imp_'+hp2.name^+'_'+tostr(suffix);
                            importname:='__imp_'+hp2.name^+'_'+tostr(suffix);
                          end;
                          end;
-                        asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                        asmlist[al_imports].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                       end
                       end
                     else
                     else
                       begin
                       begin
@@ -367,35 +367,35 @@ implementation
                            inc(suffix);
                            inc(suffix);
                            importname:='__imp_by_ordinal'+tostr(hp2.ordnr)+'_'+tostr(suffix);
                            importname:='__imp_by_ordinal'+tostr(hp2.ordnr)+'_'+tostr(suffix);
                          end;
                          end;
-                        asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                        asmlist[al_imports].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                       end;
                       end;
                   end;
                   end;
 {$endif GDB}
 {$endif GDB}
                  if hp2.name^<>'' then
                  if hp2.name^<>'' then
-                   asmlist[importsection].concat(Tai_const.Create_rva_sym(hp2.lab))
+                   asmlist[al_imports].concat(Tai_const.Create_rva_sym(hp2.lab))
                  else
                  else
-                   asmlist[importsection].concat(Tai_const.Create_32bit(longint($80000000) or longint(hp2.ordnr)));
+                   asmlist[al_imports].concat(Tai_const.Create_32bit(longint($80000000) or longint(hp2.ordnr)));
                  { finally the import information }
                  { finally the import information }
-                 new_section(asmlist[importsection],sec_idata6,'',0);
-                 asmlist[importsection].concat(Tai_label.Create(hp2.lab));
-                 asmlist[importsection].concat(Tai_const.Create_16bit(hp2.ordnr));
-                 asmlist[importsection].concat(Tai_string.Create(hp2.name^+#0));
-                 asmlist[importsection].concat(Tai_align.Create_op(2,0));
+                 new_section(asmlist[al_imports],sec_idata6,'',0);
+                 asmlist[al_imports].concat(Tai_label.Create(hp2.lab));
+                 asmlist[al_imports].concat(Tai_const.Create_16bit(hp2.ordnr));
+                 asmlist[al_imports].concat(Tai_string.Create(hp2.name^+#0));
+                 asmlist[al_imports].concat(Tai_align.Create_op(2,0));
                  hp2:=twin32imported_item(hp2.next);
                  hp2:=twin32imported_item(hp2.next);
                end;
                end;
 
 
               { write final section }
               { write final section }
-              asmlist[importsection].concat(Tai_cutobject.Create_end);
+              asmlist[al_imports].concat(Tai_cutobject.Create_end);
               { end of name references }
               { end of name references }
-              new_section(asmlist[importsection],sec_idata4,'',0);
-              asmlist[importsection].concat(Tai_const.Create_32bit(0));
+              new_section(asmlist[al_imports],sec_idata4,'',0);
+              asmlist[al_imports].concat(Tai_const.Create_32bit(0));
               { end if addresses }
               { end if addresses }
-              new_section(asmlist[importsection],sec_idata5,'',0);
-              asmlist[importsection].concat(Tai_const.Create_32bit(0));
+              new_section(asmlist[al_imports],sec_idata5,'',0);
+              asmlist[al_imports].concat(Tai_const.Create_32bit(0));
               { dllname }
               { dllname }
-              new_section(asmlist[importsection],sec_idata7,'',0);
-              asmlist[importsection].concat(Tai_label.Create(lname));
-              asmlist[importsection].concat(Tai_string.Create(hp1.dllname^+#0));
+              new_section(asmlist[al_imports],sec_idata7,'',0);
+              asmlist[al_imports].concat(Tai_label.Create(lname));
+              asmlist[al_imports].concat(Tai_string.Create(hp1.dllname^+#0));
 
 
               hp1:=timportlist(hp1.next);
               hp1:=timportlist(hp1.next);
            end;
            end;
@@ -422,46 +422,46 @@ implementation
          hp1:=timportlist(current_module.imports.first);
          hp1:=timportlist(current_module.imports.first);
          while assigned(hp1) do
          while assigned(hp1) do
            begin
            begin
-              { align codesegment for the jumps }
-              new_section(asmlist[importsection],sec_code,'',sizeof(aint));
+              { align al_code for the jumps }
+              new_section(asmlist[al_imports],sec_code,'',sizeof(aint));
               { Get labels for the sections }
               { Get labels for the sections }
               objectlibrary.getlabel(l1);
               objectlibrary.getlabel(l1);
               objectlibrary.getlabel(l2);
               objectlibrary.getlabel(l2);
               objectlibrary.getlabel(l3);
               objectlibrary.getlabel(l3);
-              new_section(asmlist[importsection],sec_idata2,'',0);
+              new_section(asmlist[al_imports],sec_idata2,'',0);
               { pointer to procedure names }
               { pointer to procedure names }
-              asmlist[importsection].concat(Tai_const.Create_rva_sym(l2));
+              asmlist[al_imports].concat(Tai_const.Create_rva_sym(l2));
               { two empty entries follow }
               { two empty entries follow }
-              asmlist[importsection].concat(Tai_const.Create_32bit(0));
-              asmlist[importsection].concat(Tai_const.Create_32bit(0));
+              asmlist[al_imports].concat(Tai_const.Create_32bit(0));
+              asmlist[al_imports].concat(Tai_const.Create_32bit(0));
               { pointer to dll name }
               { pointer to dll name }
-              asmlist[importsection].concat(Tai_const.Create_rva_sym(l1));
+              asmlist[al_imports].concat(Tai_const.Create_rva_sym(l1));
               { pointer to fixups }
               { pointer to fixups }
-              asmlist[importsection].concat(Tai_const.Create_rva_sym(l3));
+              asmlist[al_imports].concat(Tai_const.Create_rva_sym(l3));
 
 
               { only create one section for each else it will
               { only create one section for each else it will
                 create a lot of idata* }
                 create a lot of idata* }
 
 
               { first write the name references }
               { first write the name references }
-              new_section(asmlist[importsection],sec_idata4,'',0);
-              asmlist[importsection].concat(Tai_label.Create(l2));
+              new_section(asmlist[al_imports],sec_idata4,'',0);
+              asmlist[al_imports].concat(Tai_label.Create(l2));
 
 
               hp2:=twin32imported_item(hp1.imported_items.first);
               hp2:=twin32imported_item(hp1.imported_items.first);
               while assigned(hp2) do
               while assigned(hp2) do
                 begin
                 begin
                    objectlibrary.getlabel(tasmlabel(hp2.lab));
                    objectlibrary.getlabel(tasmlabel(hp2.lab));
                    if hp2.name^<>'' then
                    if hp2.name^<>'' then
-                     asmlist[importsection].concat(Tai_const.Create_rva_sym(hp2.lab))
+                     asmlist[al_imports].concat(Tai_const.Create_rva_sym(hp2.lab))
                    else
                    else
-                     asmlist[importsection].concat(Tai_const.Create_32bit(longint($80000000) or hp2.ordnr));
+                     asmlist[al_imports].concat(Tai_const.Create_32bit(longint($80000000) or hp2.ordnr));
                    hp2:=twin32imported_item(hp2.next);
                    hp2:=twin32imported_item(hp2.next);
                 end;
                 end;
               { finalize the names ... }
               { finalize the names ... }
-              asmlist[importsection].concat(Tai_const.Create_32bit(0));
+              asmlist[al_imports].concat(Tai_const.Create_32bit(0));
 
 
               { then the addresses and create also the indirect jump }
               { then the addresses and create also the indirect jump }
-              new_section(asmlist[importsection],sec_idata5,'',0);
-              asmlist[importsection].concat(Tai_label.Create(l3));
+              new_section(asmlist[al_imports],sec_idata5,'',0);
+              asmlist[al_imports].concat(Tai_label.Create(l3));
               hp2:=twin32imported_item(hp1.imported_items.first);
               hp2:=twin32imported_item(hp1.imported_items.first);
               while assigned(hp2) do
               while assigned(hp2) do
                 begin
                 begin
@@ -472,36 +472,36 @@ implementation
                       objectlibrary.getlabel(l5);
                       objectlibrary.getlabel(l5);
                     {$endif ARM}
                     {$endif ARM}
                       { create indirect jump and }
                       { create indirect jump and }
-                      { place jump in codesegment }
-                      new_section(asmlist[importsection],sec_code,'',0);
+                      { place jump in al_code }
+                      new_section(asmlist[al_imports],sec_code,'',0);
 {$IfDef GDB}
 {$IfDef GDB}
                       if (cs_debuginfo in aktmoduleswitches) then
                       if (cs_debuginfo in aktmoduleswitches) then
-                        asmlist[importsection].concat(tai_stab_function_name.create(nil));
+                        asmlist[al_imports].concat(tai_stab_function_name.create(nil));
 {$EndIf GDB}
 {$EndIf GDB}
                       if assigned(hp2.procdef) then
                       if assigned(hp2.procdef) then
                         mangledstring:=hp2.procdef.mangledname
                         mangledstring:=hp2.procdef.mangledname
                       else
                       else
                         mangledstring:=hp2.func^;
                         mangledstring:=hp2.func^;
-                      asmlist[importsection].concat(Tai_symbol.Createname_global(mangledstring,AT_FUNCTION,0));
+                      asmlist[al_imports].concat(Tai_symbol.Createname_global(mangledstring,AT_FUNCTION,0));
                     {$ifdef ARM}
                     {$ifdef ARM}
                       reference_reset_symbol(href,l5,0);
                       reference_reset_symbol(href,l5,0);
-                      asmlist[importsection].concat(Taicpu.op_reg_ref(A_LDR,NR_R12,href));
+                      asmlist[al_imports].concat(Taicpu.op_reg_ref(A_LDR,NR_R12,href));
                       reference_reset_base(href,NR_R12,0);
                       reference_reset_base(href,NR_R12,0);
-                      asmlist[importsection].concat(Taicpu.op_reg_ref(A_LDR,NR_R15,href));
-                      asmlist[importsection].concat(Tai_label.Create(l5));
+                      asmlist[al_imports].concat(Taicpu.op_reg_ref(A_LDR,NR_R15,href));
+                      asmlist[al_imports].concat(Tai_label.Create(l5));
                       reference_reset_symbol(href,l4,0);
                       reference_reset_symbol(href,l4,0);
-                      asmlist[importsection].concat(tai_const.create_sym_offset(href.symbol,href.offset));
+                      asmlist[al_imports].concat(tai_const.create_sym_offset(href.symbol,href.offset));
                     {$else ARM}
                     {$else ARM}
                       reference_reset_symbol(href,l4,0);
                       reference_reset_symbol(href,l4,0);
-                      asmlist[importsection].concat(Taicpu.Op_ref(A_JMP,S_NO,href));
-                      asmlist[importsection].concat(Tai_align.Create_op(4,$90));
+                      asmlist[al_imports].concat(Taicpu.Op_ref(A_JMP,S_NO,href));
+                      asmlist[al_imports].concat(Tai_align.Create_op(4,$90));
                     {$endif ARM}
                     {$endif ARM}
 {$IfDef GDB}
 {$IfDef GDB}
                       if (cs_debuginfo in aktmoduleswitches) and assigned(hp2.procdef) then
                       if (cs_debuginfo in aktmoduleswitches) and assigned(hp2.procdef) then
-                        hp2.procdef.concatstabto(asmlist[importsection]);
+                        hp2.procdef.concatstabto(asmlist[al_imports]);
 {$EndIf GDB}
 {$EndIf GDB}
-                      { add jump field to imporTSection }
-                      new_section(asmlist[importsection],sec_idata5,'',0);
+                      { add jump field to al_imports }
+                      new_section(asmlist[al_imports],sec_idata5,'',0);
 {$ifdef GDB}
 {$ifdef GDB}
                       if (cs_debuginfo in aktmoduleswitches) then
                       if (cs_debuginfo in aktmoduleswitches) then
                        begin
                        begin
@@ -514,7 +514,7 @@ implementation
                                inc(suffix);
                                inc(suffix);
                                importname:='__imp_'+hp2.name^+'_'+tostr(suffix);
                                importname:='__imp_'+hp2.name^+'_'+tostr(suffix);
                              end;
                              end;
-                            asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                            asmlist[al_imports].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                           end
                           end
                          else
                          else
                           begin
                           begin
@@ -525,38 +525,38 @@ implementation
                                inc(suffix);
                                inc(suffix);
                                importname:='__imp_by_ordinal'+tostr(hp2.ordnr)+'_'+tostr(suffix);
                                importname:='__imp_by_ordinal'+tostr(hp2.ordnr)+'_'+tostr(suffix);
                              end;
                              end;
-                            asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                            asmlist[al_imports].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                           end;
                           end;
                        end;
                        end;
 {$endif GDB}
 {$endif GDB}
-                      asmlist[importsection].concat(Tai_label.Create(l4));
+                      asmlist[al_imports].concat(Tai_label.Create(l4));
                     end
                     end
                    else
                    else
                     begin
                     begin
-                      asmlist[importsection].concat(Tai_symbol.Createname_global(hp2.func^,AT_DATA,0));
+                      asmlist[al_imports].concat(Tai_symbol.Createname_global(hp2.func^,AT_DATA,0));
                     end;
                     end;
-                   asmlist[importsection].concat(Tai_const.Create_rva_sym(hp2.lab));
+                   asmlist[al_imports].concat(Tai_const.Create_rva_sym(hp2.lab));
                    hp2:=twin32imported_item(hp2.next);
                    hp2:=twin32imported_item(hp2.next);
                 end;
                 end;
               { finalize the addresses }
               { finalize the addresses }
-              asmlist[importsection].concat(Tai_const.Create_32bit(0));
+              asmlist[al_imports].concat(Tai_const.Create_32bit(0));
 
 
               { finally the import information }
               { finally the import information }
-              new_section(asmlist[importsection],sec_idata6,'',0);
+              new_section(asmlist[al_imports],sec_idata6,'',0);
               hp2:=twin32imported_item(hp1.imported_items.first);
               hp2:=twin32imported_item(hp1.imported_items.first);
               while assigned(hp2) do
               while assigned(hp2) do
                 begin
                 begin
-                   asmlist[importsection].concat(Tai_label.Create(hp2.lab));
+                   asmlist[al_imports].concat(Tai_label.Create(hp2.lab));
                    { the ordinal number }
                    { the ordinal number }
-                   asmlist[importsection].concat(Tai_const.Create_16bit(hp2.ordnr));
-                   asmlist[importsection].concat(Tai_string.Create(hp2.name^+#0));
-                   asmlist[importsection].concat(Tai_align.Create_op(2,0));
+                   asmlist[al_imports].concat(Tai_const.Create_16bit(hp2.ordnr));
+                   asmlist[al_imports].concat(Tai_string.Create(hp2.name^+#0));
+                   asmlist[al_imports].concat(Tai_align.Create_op(2,0));
                    hp2:=twin32imported_item(hp2.next);
                    hp2:=twin32imported_item(hp2.next);
                 end;
                 end;
               { create import dll name }
               { create import dll name }
-              new_section(asmlist[importsection],sec_idata7,'',0);
-              asmlist[importsection].concat(Tai_label.Create(l1));
-              asmlist[importsection].concat(Tai_string.Create(hp1.dllname^+#0));
+              new_section(asmlist[al_imports],sec_idata7,'',0);
+              asmlist[al_imports].concat(Tai_label.Create(l1));
+              asmlist[al_imports].concat(Tai_string.Create(hp1.dllname^+#0));
 
 
               hp1:=timportlist(hp1.next);
               hp1:=timportlist(hp1.next);
            end;
            end;
@@ -569,8 +569,8 @@ implementation
 
 
     procedure texportlibwin32.preparelib(const s:string);
     procedure texportlibwin32.preparelib(const s:string);
       begin
       begin
-         if asmlist[exportsection]=nil then
-           asmlist[exportsection]:=TAAsmoutput.create;
+         if asmlist[al_exports]=nil then
+           asmlist[al_exports]:=TAAsmoutput.create;
          EList_indexed:=tList.Create;
          EList_indexed:=tList.Create;
          EList_nonindexed:=tList.Create;
          EList_nonindexed:=tList.Create;
          objectlibrary.getdatalabel(edatalabel);
          objectlibrary.getdatalabel(edatalabel);
@@ -734,38 +734,38 @@ implementation
          { we must also count the holes !! }
          { we must also count the holes !! }
          entries:=ordinal_max-ordinal_base+1;
          entries:=ordinal_max-ordinal_base+1;
 
 
-         new_section(asmlist[exportsection],sec_edata,'',0);
+         new_section(asmlist[al_exports],sec_edata,'',0);
          { create label to reference from main so smartlink will include
          { create label to reference from main so smartlink will include
            the .edata section }
            the .edata section }
-         asmlist[exportsection].concat(Tai_symbol.Create_global(edatalabel,0));
+         asmlist[al_exports].concat(Tai_symbol.Create_global(edatalabel,0));
          { export flags }
          { export flags }
-         asmlist[exportsection].concat(Tai_const.Create_32bit(0));
+         asmlist[al_exports].concat(Tai_const.Create_32bit(0));
          { date/time stamp }
          { date/time stamp }
-         asmlist[exportsection].concat(Tai_const.Create_32bit(0));
+         asmlist[al_exports].concat(Tai_const.Create_32bit(0));
          { major version }
          { major version }
-         asmlist[exportsection].concat(Tai_const.Create_16bit(0));
+         asmlist[al_exports].concat(Tai_const.Create_16bit(0));
          { minor version }
          { minor version }
-         asmlist[exportsection].concat(Tai_const.Create_16bit(0));
+         asmlist[al_exports].concat(Tai_const.Create_16bit(0));
          { pointer to dll name }
          { pointer to dll name }
-         asmlist[exportsection].concat(Tai_const.Create_rva_sym(dll_name_label));
+         asmlist[al_exports].concat(Tai_const.Create_rva_sym(dll_name_label));
          { ordinal base normally set to 1 }
          { ordinal base normally set to 1 }
-         asmlist[exportsection].concat(Tai_const.Create_32bit(ordinal_base));
+         asmlist[al_exports].concat(Tai_const.Create_32bit(ordinal_base));
          { number of entries }
          { number of entries }
-         asmlist[exportsection].concat(Tai_const.Create_32bit(entries));
+         asmlist[al_exports].concat(Tai_const.Create_32bit(entries));
          { number of named entries }
          { number of named entries }
-         asmlist[exportsection].concat(Tai_const.Create_32bit(named_entries));
+         asmlist[al_exports].concat(Tai_const.Create_32bit(named_entries));
          { address of export address table }
          { address of export address table }
-         asmlist[exportsection].concat(Tai_const.Create_rva_sym(export_address_table));
+         asmlist[al_exports].concat(Tai_const.Create_rva_sym(export_address_table));
          { address of name pointer pointers }
          { address of name pointer pointers }
-         asmlist[exportsection].concat(Tai_const.Create_rva_sym(export_name_table_pointers));
+         asmlist[al_exports].concat(Tai_const.Create_rva_sym(export_name_table_pointers));
          { address of ordinal number pointers }
          { address of ordinal number pointers }
-         asmlist[exportsection].concat(Tai_const.Create_rva_sym(export_ordinal_table));
+         asmlist[al_exports].concat(Tai_const.Create_rva_sym(export_ordinal_table));
          { the name }
          { the name }
-         asmlist[exportsection].concat(Tai_label.Create(dll_name_label));
+         asmlist[al_exports].concat(Tai_label.Create(dll_name_label));
          if st='' then
          if st='' then
-           asmlist[exportsection].concat(Tai_string.Create(current_module.modulename^+target_info.sharedlibext+#0))
+           asmlist[al_exports].concat(Tai_string.Create(current_module.modulename^+target_info.sharedlibext+#0))
          else
          else
-           asmlist[exportsection].concat(Tai_string.Create(st+target_info.sharedlibext+#0));
+           asmlist[al_exports].concat(Tai_string.Create(st+target_info.sharedlibext+#0));
 
 
          {  export address table }
          {  export address table }
          address_table:=TAAsmoutput.create;
          address_table:=TAAsmoutput.create;
@@ -834,10 +834,10 @@ implementation
               hp:=texported_item(hp.next);
               hp:=texported_item(hp.next);
            end;
            end;
 
 
-         asmlist[exportsection].concatlist(address_table);
-         asmlist[exportsection].concatlist(name_table_pointers);
-         asmlist[exportsection].concatlist(ordinal_table);
-         asmlist[exportsection].concatlist(name_table);
+         asmlist[al_exports].concatlist(address_table);
+         asmlist[al_exports].concatlist(name_table_pointers);
+         asmlist[al_exports].concatlist(ordinal_table);
+         asmlist[al_exports].concatlist(name_table);
          address_table.Free;
          address_table.Free;
          name_table_pointers.free;
          name_table_pointers.free;
          ordinal_table.free;
          ordinal_table.free;
@@ -851,7 +851,7 @@ implementation
          p  : pchar;
          p  : pchar;
          s  : string;
          s  : string;
       begin
       begin
-         new_section(asmlist[exportsection],sec_code,'',0);
+         new_section(asmlist[al_exports],sec_code,'',0);
          hp:=texported_item(current_module._exports.first);
          hp:=texported_item(current_module._exports.first);
          while assigned(hp) do
          while assigned(hp) do
            begin
            begin
@@ -866,7 +866,7 @@ implementation
                  s:='';
                  s:='';
              end;
              end;
              p:=strpnew(#9+'export '+s+' '+hp.name^+' '+tostr(hp.index));
              p:=strpnew(#9+'export '+s+' '+hp.name^+' '+tostr(hp.index));
-             asmlist[exportsection].concat(tai_direct.create(p));
+             asmlist[al_exports].concat(tai_direct.create(p));
              hp:=texported_item(hp.next);
              hp:=texported_item(hp.next);
            end;
            end;
       end;
       end;

+ 10 - 17
compiler/x86/agx86int.pas

@@ -387,10 +387,10 @@ implementation
     begin
     begin
       if not assigned(p) then
       if not assigned(p) then
        exit;
        exit;
-      { lineinfo is only needed for codesegment (PFV) }
+      { lineinfo is only needed for al_code (PFV) }
       do_line:=((cs_asm_source in aktglobalswitches) or
       do_line:=((cs_asm_source in aktglobalswitches) or
                 (cs_lineinfo in aktmoduleswitches))
                 (cs_lineinfo in aktmoduleswitches))
-                 and (p=asmlist[codesegment]);
+                 and (p=asmlist[al_code]);
       InlineLevel:=0;
       InlineLevel:=0;
       DoNotSplitLine:=false;
       DoNotSplitLine:=false;
       hp:=tai(p.first);
       hp:=tai(p.first);
@@ -851,6 +851,8 @@ implementation
 
 
 
 
     procedure tx86IntelAssembler.WriteAsmList;
     procedure tx86IntelAssembler.WriteAsmList;
+    var
+      hal : tasmlist;
     begin
     begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
       if assigned(current_module.mainsource) then
@@ -872,21 +874,12 @@ implementation
 
 
       WriteExternals;
       WriteExternals;
 
 
-    { INTEL ASM doesn't support stabs
-      WriteTree(debuglist);}
-
-      WriteTree(asmlist[codesegment]);
-      WriteTree(asmlist[datasegment]);
-      WriteTree(asmlist[consts]);
-      WriteTree(asmlist[rttilist]);
-      WriteTree(asmlist[resourcestrings]);
-      WriteTree(asmlist[bsssegment]);
-      WriteTree(asmlist[threadvarsegment]);
-      Writetree(asmlist[importsection]);
-      { exports are written by DLLTOOL
-        if we use it so don't insert it twice (PM) }
-      if not UseDeffileForExports and assigned(asmlist[exportsection]) then
-        Writetree(asmlist[exportsection]);
+      for hal:=low(Tasmlist) to high(Tasmlist) do
+        begin
+          AsmWriteLn(target_asm.comment+'Begin asmlist '+TasmlistStr[hal]);
+          writetree(asmlist[hal]);
+          AsmWriteLn(target_asm.comment+'End asmlist '+TasmlistStr[hal]);
+        end;
 
 
       AsmWriteLn(#9'END');
       AsmWriteLn(#9'END');
       AsmLn;
       AsmLn;

+ 8 - 8
compiler/x86/nx86cnv.pas

@@ -245,21 +245,21 @@ implementation
                    exprasmlist.concat(taicpu.op_ref_reg(op,S_Q,left.location.reference,location.register));
                    exprasmlist.concat(taicpu.op_ref_reg(op,S_Q,left.location.reference,location.register));
 
 
                    cg.a_jmp_flags(exprasmlist,F_NC,l2);
                    cg.a_jmp_flags(exprasmlist,F_NC,l2);
-                   asmlist[consts].concat(Tai_label.Create(l1));
+                   asmlist[al_typedconsts].concat(Tai_label.Create(l1));
                    reference_reset_symbol(href,l1,0);
                    reference_reset_symbol(href,l1,0);
 
 
                    { I got these constant from a test program (FK) }
                    { I got these constant from a test program (FK) }
                    if is_double(resulttype.def) then
                    if is_double(resulttype.def) then
                      begin
                      begin
                        { double (2^64) }
                        { double (2^64) }
-                       asmlist[consts].concat(Tai_const.Create_32bit(0));
-                       asmlist[consts].concat(Tai_const.Create_32bit($43f00000));
+                       asmlist[al_typedconsts].concat(Tai_const.Create_32bit(0));
+                       asmlist[al_typedconsts].concat(Tai_const.Create_32bit($43f00000));
                        exprasmlist.concat(taicpu.op_ref_reg(A_ADDSD,S_NO,href,location.register));
                        exprasmlist.concat(taicpu.op_ref_reg(A_ADDSD,S_NO,href,location.register));
                      end
                      end
                    else if is_single(resulttype.def) then
                    else if is_single(resulttype.def) then
                      begin
                      begin
                        { single(2^64) }
                        { single(2^64) }
-                       asmlist[consts].concat(Tai_const.Create_32bit($5f800000));
+                       asmlist[al_typedconsts].concat(Tai_const.Create_32bit($5f800000));
                        exprasmlist.concat(taicpu.op_ref_reg(A_ADDSS,S_NO,href,location.register));
                        exprasmlist.concat(taicpu.op_ref_reg(A_ADDSS,S_NO,href,location.register));
                      end
                      end
                    else
                    else
@@ -359,11 +359,11 @@ implementation
 
 
                    exprasmlist.concat(taicpu.op_ref(A_FILD,S_IQ,left.location.reference));
                    exprasmlist.concat(taicpu.op_ref(A_FILD,S_IQ,left.location.reference));
                    cg.a_jmp_flags(exprasmlist,F_NC,l2);
                    cg.a_jmp_flags(exprasmlist,F_NC,l2);
-                   asmlist[consts].concat(Tai_label.Create(l1));
+                   asmlist[al_typedconsts].concat(Tai_label.Create(l1));
                    { I got this constant from a test program (FK) }
                    { I got this constant from a test program (FK) }
-                   asmlist[consts].concat(Tai_const.Create_32bit(0));
-                   asmlist[consts].concat(Tai_const.Create_32bit(longint ($80000000)));
-                   asmlist[consts].concat(Tai_const.Create_32bit($0000403f));
+                   asmlist[al_typedconsts].concat(Tai_const.Create_32bit(0));
+                   asmlist[al_typedconsts].concat(Tai_const.Create_32bit(longint ($80000000)));
+                   asmlist[al_typedconsts].concat(Tai_const.Create_32bit($0000403f));
                    reference_reset_symbol(href,l1,0);
                    reference_reset_symbol(href,l1,0);
                    exprasmlist.concat(Taicpu.Op_ref(A_FLD,S_FX,href));
                    exprasmlist.concat(Taicpu.Op_ref(A_FLD,S_FX,href));
                    exprasmlist.concat(Taicpu.Op_reg_reg(A_FADDP,S_NO,NR_ST,NR_ST1));
                    exprasmlist.concat(Taicpu.Op_reg_reg(A_FADDP,S_NO,NR_ST,NR_ST1));

+ 4 - 4
compiler/x86/nx86mat.pas

@@ -177,14 +177,14 @@ interface
             reg:=cg.getmmregister(exprasmlist,def_cgsize(resulttype.def));
             reg:=cg.getmmregister(exprasmlist,def_cgsize(resulttype.def));
 
 
             objectlibrary.getdatalabel(l1);
             objectlibrary.getdatalabel(l1);
-            asmlist[consts].concat(Tai_label.Create(l1));
+            asmlist[al_typedconsts].concat(Tai_label.Create(l1));
             case def_cgsize(resulttype.def) of
             case def_cgsize(resulttype.def) of
               OS_F32:
               OS_F32:
-                asmlist[consts].concat(tai_const.create_32bit(longint(1 shl 31)));
+                asmlist[al_typedconsts].concat(tai_const.create_32bit(longint(1 shl 31)));
               OS_F64:
               OS_F64:
                 begin
                 begin
-                  asmlist[consts].concat(tai_const.create_32bit(0));
-                  asmlist[consts].concat(tai_const.create_32bit(-(1 shl 31)));
+                  asmlist[al_typedconsts].concat(tai_const.create_32bit(0));
+                  asmlist[al_typedconsts].concat(tai_const.create_32bit(-(1 shl 31)));
                 end
                 end
               else
               else
                 internalerror(2004110215);
                 internalerror(2004110215);

+ 11 - 0
tests/webtbs/tw4277.pp

@@ -0,0 +1,11 @@
+{$mode delphi}
+{$J-}
+
+const
+  RFCMonthNames : Array[1..12] of String = (
+    'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+    'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
+
+begin
+  writeln(RFCMonthNames[10]);
+end.