Browse Source

* 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 years ago
parent
commit
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/tw4253.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/ub1883.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;
         pass:=255;
         ppuidx:=-1;
-        { mainly used to remove unused labels from the codesegment }
+        { mainly used to remove unused labels from the al_code }
         refs:=0;
       end;
 

+ 13 - 4
compiler/aasmtai.pas

@@ -576,11 +576,20 @@ interface
        end;
 
        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 }
-                 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
       { array with all class types for tais }

+ 11 - 20
compiler/aggas.pas

@@ -364,12 +364,13 @@ var
     begin
       if not assigned(p) then
        exit;
+
       last_align := 2;
       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
                ((cs_lineinfo in aktmoduleswitches)
-                 and (p=asmlist[codesegment]));
+                 and (p=asmlist[al_code]));
       hp:=tai(p.first);
       while assigned(hp) do
        begin
@@ -935,7 +936,7 @@ var
 {$ifdef GDB}
       fileinfo : tfileposinfo;
 {$endif GDB}
-
+      hal : tasmlist;
     begin
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
@@ -981,23 +982,13 @@ var
       AsmStartSize:=AsmSize;
       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}
       WriteFileEndInfo;
       {$ENDIF}

+ 4 - 4
compiler/assemble.pas

@@ -1601,13 +1601,13 @@ Implementation
       begin
         to_do:=[low(Tasmlist)..high(Tasmlist)];
         if not(cs_debuginfo in aktmoduleswitches) then
-          exclude(to_do,debuglist);
+          exclude(to_do,al_debug);
         if usedeffileforexports then
-          exclude(to_do,exportsection);
+          exclude(to_do,al_exports);
         {$warning TODO internal writer support for dwarf}
-        exclude(to_do,dwarflist);
+        exclude(to_do,al_dwarf);
 {$ifndef segment_threadvars}
-        exclude(to_do,threadvarsegment);
+        exclude(to_do,al_threadvars);
 {$endif}
         for i:=low(Tasmlist) to high(Tasmlist) do
           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
 
-    Handles resourcestrings
+    Handles al_resourcestrings
 
     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
@@ -40,7 +40,7 @@ Type
     procedure CalcHash;
   end;
 
-  TResourceStrings=class
+  Tal_resourcestrings=class
   private
     List : TLinkedList;
   public
@@ -53,7 +53,7 @@ Type
   end;
 
 var
-  ResourceStrings : TResourceStrings;
+  al_resourcestrings : Tal_resourcestrings;
 
 
 implementation
@@ -113,27 +113,27 @@ end;
 
 
 { ---------------------------------------------------------------------
-                          TRESOURCESTRINGS
+                          Tal_resourcestrings
   ---------------------------------------------------------------------}
 
-Constructor TResourceStrings.Create;
+Constructor Tal_resourcestrings.Create;
 begin
   List:=TStringList.Create;
   ResStrCount:=0;
 end;
 
 
-Destructor TResourceStrings.Destroy;
+Destructor Tal_resourcestrings.Destroy;
 begin
   List.Free;
 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);
   Var
@@ -144,59 +144,59 @@ procedure TResourceStrings.CreateResourceStringList;
     with p Do
      begin
        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
          begin
             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);
             move(value^,s^,len);
             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;
        { 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. }
        objectlibrary.getdatalabel(l1);
        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);
        move(Name[1],s^,l);
        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;
 
 Var
   R : tresourceStringItem;
 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));
-  asmlist[aasmtai.resourcestrings].concat(tai_const.create_32bit(resstrcount));
+  asmlist[aasmtai.al_resourcestrings].concat(tai_const.create_32bit(resstrcount));
   R:=TResourceStringItem(List.First);
   while assigned(R) do
    begin
      AppendToAsmResList(R);
      R:=TResourceStringItem(R.Next);
    end;
-  asmlist[aasmtai.resourcestrings].concat(tai_symbol_end.createname(
+  asmlist[aasmtai.al_resourcestrings].concat(tai_symbol_end.createname(
     current_module.modulename^+'_'+'RESOURCESTRINGLIST'));
 end;
 
@@ -205,7 +205,7 @@ end;
     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
   List.Concat(tResourceStringItem.Create(lower(current_module.modulename^+'.'+Name),p,len));
   Register:=ResStrCount;
@@ -213,7 +213,7 @@ begin
 end;
 
 
-Procedure TResourceStrings.WriteResourceFile(const FileName : String);
+Procedure Tal_resourcestrings.WriteResourceFile(const FileName : String);
 Type
   TMode = (quoted,unquoted);
 Var

+ 14 - 14
compiler/dwarf.pas

@@ -61,11 +61,11 @@ interface
 
       tdwarf=class
       private
-        FDwarfList : TLinkedList;
+        Fal_dwarf : TLinkedList;
       public
         constructor create;
         destructor destroy;override;
-        property DwarfList:TlinkedList read FDwarfList;
+        property al_dwarf:TlinkedList read Fal_dwarf;
       end;
 
       tdwarfcfi=class(tdwarf)
@@ -133,13 +133,13 @@ implementation
 
     constructor tdwarf.create;
       begin
-        FDwarfList:=TLinkedList.Create;
+        Fal_dwarf:=TLinkedList.Create;
       end;
 
 
     destructor tdwarf.destroy;
       begin
-        FDwarfList.Free;
+        Fal_dwarf.Free;
       end;
 
 
@@ -298,7 +298,7 @@ implementation
         lenstartlabel:=nil;
         lenendlabel:=nil;
 
-        hp:=TDwarfItem(Dwarflist.first);
+        hp:=TDwarfItem(al_dwarf.first);
         while assigned(hp) do
           begin
             case hp.op of
@@ -341,8 +341,8 @@ implementation
         { Check for open frames }
         if assigned(lenstartlabel) then
           internalerror(2004041210);
-        { Dwarflist is processed, remove items }
-        DwarfList.Clear;
+        { al_dwarf is processed, remove items }
+        al_dwarf.Clear;
       end;
 
 
@@ -354,7 +354,7 @@ implementation
         objectlibrary.getlabel(FFrameEndLabel);
         FLastloclabel:=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;
 
 
@@ -362,7 +362,7 @@ implementation
       begin
         if not assigned(FFrameStartLabel) then
           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));
         FFrameStartLabel:=nil;
         FFrameEndLabel:=nil;
@@ -378,7 +378,7 @@ implementation
           internalerror(200404082);
         objectlibrary.getlabel(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;
       end;
 
@@ -388,28 +388,28 @@ implementation
         cfa_advance_loc(list);
 {$warning TODO check if ref is a temp}
         { 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;
 
 
     procedure tdwarfcfi.cfa_restore(list:taasmoutput;reg:tregister);
       begin
         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;
 
 
     procedure tdwarfcfi.cfa_def_cfa_register(list:taasmoutput;reg:tregister);
       begin
         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;
 
 
     procedure tdwarfcfi.cfa_def_cfa_offset(list:taasmoutput;ofs:longint);
       begin
         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;
 
 

+ 10 - 18
compiler/i386/ag386nsm.pas

@@ -398,10 +398,10 @@ interface
       if not assigned(p) then
        exit;
       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
                ((cs_lineinfo in aktmoduleswitches)
-                 and (p=asmlist[codesegment]));
+                 and (p=asmlist[al_code]));
       hp:=tai(p.first);
       while assigned(hp) do
        begin
@@ -779,6 +779,8 @@ interface
 
 
     procedure T386NasmAssembler.WriteAsmList;
+    var
+      hal : tasmlist;
     begin
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
@@ -794,22 +796,12 @@ interface
 
       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;
 {$ifdef EXTDEBUG}

+ 1 - 1
compiler/i386/n386set.pas

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

+ 3 - 3
compiler/ncgcal.pas

@@ -1123,7 +1123,7 @@ implementation
              cg.a_label(exprasmlist,startlabel);
 
              { 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);
              getmem(pp,mangled_length+50);
@@ -1133,7 +1133,7 @@ implementation
                  strpcopy(strend(pp),'-');
                  strpcopy(strend(pp),current_procinfo.inlining_procinfo.procdef.mangledname);
                end;
-             withdebugList.concat(Tai_stabn.Create(strnew(pp)));
+             al_withdebug.concat(Tai_stabn.Create(strnew(pp)));
            end;
 {$endif GDB}
 
@@ -1221,7 +1221,7 @@ implementation
                  strpcopy(strend(pp),'-');
                  strpcopy(strend(pp),current_procinfo.inlining_procinfo.procdef.mangledname);
                end;
-             withdebugList.concat(Tai_stabn.Create(strnew(pp)));
+             al_withdebug.concat(Tai_stabn.Create(strnew(pp)));
              freemem(pp,mangled_length+50);
            end;
 {$endif GDB}

+ 53 - 53
compiler/ncgcon.pas

@@ -100,7 +100,7 @@ implementation
         if not assigned(lab_real) then
           begin
              { tries to find an old entry }
-             hp1:=tai(asmlist[consts].first);
+             hp1:=tai(asmlist[al_typedconsts].first);
              while assigned(hp1) do
                begin
                   if hp1.typ=ait_label then
@@ -138,17 +138,17 @@ implementation
                begin
                   objectlibrary.getdatalabel(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
                     ait_real_32bit :
                       begin
-                        asmlist[consts].concat(Tai_real_32bit.Create(ts32real(value_real)));
+                        asmlist[al_typedconsts].concat(Tai_real_32bit.Create(ts32real(value_real)));
                         { range checking? }
                         if ((cs_check_range in aktlocalswitches) or
                           (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);
                       end;
 
@@ -156,37 +156,37 @@ implementation
                       begin
 {$ifdef ARM}
                         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
 {$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? }
                         if ((cs_check_range in aktlocalswitches) or
                           (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);
                      end;
 
                     ait_real_80bit :
                       begin
-                        asmlist[consts].concat(Tai_real_80bit.Create(value_real));
+                        asmlist[al_typedconsts].concat(Tai_real_80bit.Create(value_real));
 
                         { range checking? }
                         if ((cs_check_range in aktlocalswitches) or
                           (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);
                       end;
 {$ifdef cpufloat128}
                     ait_real_128bit :
                       begin
-                        asmlist[consts].concat(Tai_real_128bit.Create(value_real));
+                        asmlist[al_typedconsts].concat(Tai_real_128bit.Create(value_real));
 
                         { range checking? }
                         if ((cs_check_range in aktlocalswitches) or
                           (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);
                       end;
 {$endif cpufloat128}
@@ -196,7 +196,7 @@ implementation
                       if (value_real>9223372036854775807.0) or (value_real<-9223372036854775808.0) then
                         message(parser_e_range_check_error)
                       else
-                        asmlist[consts].concat(Tai_comp_64bit.Create(round(value_real)));
+                        asmlist[al_typedconsts].concat(Tai_comp_64bit.Create(round(value_real)));
                   else
                     internalerror(10120);
                   end;
@@ -273,7 +273,7 @@ implementation
               if not(is_widestring(resulttype.def)) then
                 begin
                   { tries to find an old entry }
-                  hp1:=tai(asmlist[consts].first);
+                  hp1:=tai(asmlist[al_typedconsts].first);
                   while assigned(hp1) do
                     begin
                        if hp1.typ=ait_label then
@@ -460,9 +460,9 @@ implementation
                 begin
                    objectlibrary.getdatalabel(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 ? }
                    case st_type of
                     {$ifdef ansistring_bits}
@@ -470,7 +470,7 @@ implementation
                         begin
                            { an empty ansi string is nil! }
                            if len=0 then
-                             asmlist[consts].concat(Tai_const.Create_ptr(0))
+                             asmlist[al_typedconsts].concat(Tai_const.Create_ptr(0))
                            else
                              begin
                                 objectlibrary.getdatalabel(l1);
@@ -485,7 +485,7 @@ implementation
                                 pc[len]:=#0;
                                 { to overcome this problem we set the length explicitly }
                                 { 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 }
                                 lab_str:=l2;
                              end;
@@ -495,22 +495,22 @@ implementation
                         begin
                            { an empty ansi string is nil! }
                            if len=0 then
-                             asmlist[consts].concat(Tai_const.Create_sym(nil))
+                             asmlist[al_typedconsts].concat(Tai_const.Create_sym(nil))
                            else
                              begin
                                 objectlibrary.getdatalabel(l1);
                                 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);
                                 move(value_str^,pc^,len);
                                 pc[len]:=#0;
                                 { to overcome this problem we set the length explicitly }
                                 { 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 }
                                 lab_str:=l2;
                              end;
@@ -525,17 +525,17 @@ implementation
                              begin
                                 objectlibrary.getdatalabel(l1);
                                 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);
                                 move(value_str^,pc^,len);
                                 pc[len]:=#0;
                                 { to overcome this problem we set the length explicitly }
                                 { 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 }
                                 lab_str:=l2;
                              end;
@@ -545,24 +545,24 @@ implementation
                         begin
                            { an empty wide string is nil! }
                            if len=0 then
-                             asmlist[consts].concat(Tai_const.Create_sym(nil))
+                             asmlist[al_typedconsts].concat(Tai_const.Create_sym(nil))
                            else
                              begin
                                 objectlibrary.getdatalabel(l1);
                                 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 }
                                 { at least for now                          }
                                 { 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
-                                  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 }
-                                asmlist[consts].concat(Tai_const.Create_16bit(0));
+                                asmlist[al_typedconsts].concat(Tai_const.Create_16bit(0));
                                 { return the offset of the real string }
                                 lab_str:=l2;
                              end;
@@ -581,7 +581,7 @@ implementation
                           { to overcome this problem we set the length explicitly }
                           { with the ending null char }
                           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;
@@ -626,7 +626,7 @@ implementation
         if not assigned(lab_set) then
           begin
              { tries to found an old entry }
-             hp1:=tai(asmlist[consts].first);
+             hp1:=tai(asmlist[al_typedconsts].first);
              while assigned(hp1) do
                begin
                   if hp1.typ=ait_label then
@@ -677,9 +677,9 @@ implementation
                begin
                  objectlibrary.getdatalabel(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)
                  if tsetdef(resulttype.def).settype=smallset then
                   begin
@@ -690,7 +690,7 @@ implementation
                  }
                   begin
                     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;
@@ -721,13 +721,13 @@ implementation
         location_reset(location,LOC_CREFERENCE,OS_NO);
         { label for GUID }
         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
-          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;
       end;
 

+ 3 - 3
compiler/ncgmem.pas

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

+ 14 - 51
compiler/ncgutil.pas

@@ -103,7 +103,6 @@ interface
     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 insertconstdata(sym : ttypedconstsym);
     procedure insertbssdata(sym : tglobalvarsym);
 
     procedure gen_alloc_symtable(list:TAAsmoutput;st:tsymtable);
@@ -1621,7 +1620,7 @@ implementation
               { the parameters are already in the right registers }
               cg.a_call_name(list,target_info.cprefix+'FPC_SYSTEMMAIN');
              end;
-           
+
            { initialize units }
            cg.allocallcpuregisters(list);
            cg.a_call_name(list,'FPC_INITIALIZEUNITS');
@@ -1784,7 +1783,7 @@ implementation
                 strpcopy(strend(p),'-');
                 strpcopy(strend(p),current_procinfo.procdef.mangledname);
               end;
-            list.concatlist(asmlist[withdebuglist]);
+            list.concatlist(asmlist[al_withdebug]);
             list.concat(Tai_stabn.Create(strnew(p)));
              { strpnew('224,0,0,'
              +current_procinfo.procdef.mangledname+'_end'))));}
@@ -1911,7 +1910,7 @@ implementation
 
     procedure gen_external_stub(list:taasmoutput;pd:tprocdef;const externalname:string);
       begin
-        { add the procedure to the codesegment }
+        { add the procedure to the al_code }
         maybe_new_object_file(list);
         new_section(list,sec_code,lower(pd.mangledname),aktalignment.procalign);
         list.concat(Tai_align.create(aktalignment.procalign));
@@ -1926,42 +1925,6 @@ implementation
                                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);
       var
         l,varalign : longint;
@@ -1975,17 +1938,17 @@ implementation
      {$ifndef segment_threadvars}
         if (vo_is_thread_var in sym.varoptions) then
           inc(l,sizeof(aint));
-        list:=asmlist[bsssegment];
+        list:=asmlist[al_bss];
         sectype:=sec_bss;
      {$else}
         if (vo_is_thread_var in sym.varoptions) then
           begin
-            list:=asmlist[threadvarsegment];
+            list:=asmlist[al_threadvars];
             sectype:=sec_threadvar;
           end
         else
           begin
-            list:=asmlist[bsssegment];
+            list:=asmlist[al_bss];
             sectype:=sec_bss;
           end;
      {$endif}
@@ -2350,11 +2313,11 @@ implementation
            def.rttitablesym:=rsym;
            { write rtti data }
            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);
-           asmlist[rttilist].concat(Tai_symbol_end.Create(rsym.get_label));
+           asmlist[al_rtti].concat(Tai_symbol_end.Create(rsym.get_label));
          end;
       end;
 
@@ -2390,11 +2353,11 @@ implementation
            def.inittablesym:=rsym;
            { write inittable data }
            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);
-           asmlist[rttilist].concat(Tai_symbol_end.Create(rsym.get_label));
+           asmlist[al_rtti].concat(Tai_symbol_end.Create(rsym.get_label));
          end;
       end;
 

+ 85 - 85
compiler/nobj.pas

@@ -118,7 +118,7 @@ interface
 {$endif WITHDMT}
         { interfaces }
         function  genintftable: tasmlabel;
-        { write the VMT to datasegment }
+        { write the VMT to al_data }
         procedure writevmt;
         procedure writeinterfaceids;
       end;
@@ -263,13 +263,13 @@ implementation
          objectlibrary.getdatalabel(p^.nl);
          if assigned(p^.l) then
            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);
-         asmlist[datasegment].concat(tai_const.create_8bit(len));
+         asmlist[al_data].concat(tai_const.create_8bit(len));
          getmem(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
            writenames(p^.r);
       end;
@@ -281,8 +281,8 @@ implementation
            writestrentry(p^.l);
 
          { 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
            writestrentry(p^.r);
@@ -305,10 +305,10 @@ implementation
 
          { now start writing of the message string table }
          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;
-         asmlist[datasegment].concat(Tai_const.Create_32bit(count));
+         asmlist[al_data].concat(Tai_const.Create_32bit(count));
          if assigned(root) then
            begin
               writestrentry(root);
@@ -323,8 +323,8 @@ implementation
            writeintentry(p^.l);
 
          { 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
            writeintentry(p^.r);
@@ -343,10 +343,10 @@ implementation
 
          { now start writing of the message string table }
          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;
-         asmlist[datasegment].concat(Tai_const.Create_32bit(count));
+         asmlist[al_data].concat(Tai_const.Create_32bit(count));
          if assigned(root) then
            begin
               writeintentry(root);
@@ -390,7 +390,7 @@ implementation
       begin
          if assigned(p^.l) then
            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
            writedmtindexentry(p^.r);
       end;
@@ -400,7 +400,7 @@ implementation
       begin
          if assigned(p^.l) then
            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
            writedmtaddressentry(p^.r);
       end;
@@ -421,13 +421,13 @@ implementation
            begin
               objectlibrary.getdatalabel(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 }
-              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
                 begin
                    writedmtindexentry(root);
@@ -477,16 +477,16 @@ implementation
                    begin
                      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
-                       asmlist[datasegment].concat(Tai_const.Create_sym(nil))
+                       asmlist[al_data].concat(Tai_const.Create_sym(nil))
                      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;
@@ -505,9 +505,9 @@ implementation
          if count>0 then
            begin
               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);
               genpublishedmethodstable:=l;
            end
@@ -906,17 +906,17 @@ implementation
             rawdata.concat(Tai_const.Create_16bit(curintf.iidguid^.D3));
             for i:=Low(curintf.iidguid^.D4) to High(curintf.iidguid^.D4) do
               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
         else
           begin
             { nil for Corba interfaces }
-            asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+            asmlist[al_data].concat(Tai_const.Create_sym(nil));
           end;
         { 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 }
-        asmlist[datasegment].concat(Tai_const.Create_32bit(implintf.ioffsets(contintfindex)));
+        asmlist[al_data].concat(Tai_const.Create_32bit(implintf.ioffsets(contintfindex)));
         { IIDStr }
         objectlibrary.getdatalabel(tmplabel);
         rawdata.concat(cai_align.create(const_align(sizeof(aint))));
@@ -926,7 +926,7 @@ implementation
           rawdata.concat(Tai_string.Create(upper(curintf.iidstr^)))
         else
           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;
 
 
@@ -1037,7 +1037,7 @@ implementation
         max:=_class.implementedinterfaces.count;
 
         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 }
         for i:=1 to max do
           begin
@@ -1062,7 +1062,7 @@ implementation
               _class.implementedinterfaces.setioffsets(i,_class.implementedinterfaces.ioffsets(j));
             gintfgenentry(i,j,rawdata);
           end;
-        asmlist[datasegment].concatlist(rawdata);
+        asmlist[al_data].concatlist(rawdata);
         rawdata.free;
       end;
 
@@ -1160,8 +1160,8 @@ implementation
         { 2. step calc required fieldcount and their offsets in the object memory map
              and write data }
         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 }
         gintfoptimizevtbls;
         { Write interface tables }
@@ -1179,21 +1179,21 @@ implementation
       if assigned(_class.iidguid) then
         begin
           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
-            asmlist[datasegment].concat(Tai_const.Create_8bit(_class.iidguid^.D4[i]));
+            asmlist[al_data].concat(Tai_const.Create_8bit(_class.iidguid^.D4[i]));
         end;
-      maybe_new_object_file(asmlist[datasegment]);
+      maybe_new_object_file(asmlist[al_data]);
       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;
 
 
@@ -1258,8 +1258,8 @@ implementation
          if is_class(_class) then
           begin
             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 }
             if _class.implementedinterfaces.count>0 then
@@ -1268,9 +1268,9 @@ implementation
             methodnametable:=genpublishedmethodstable;
             fieldtablelabel:=_class.generate_field_table;
             { 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 }
             if (oo_has_msgstr in _class.objectoptions) then
@@ -1280,30 +1280,30 @@ implementation
           end;
 
         { 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}
         if (cs_debuginfo in aktmoduleswitches) then
          begin
            do_count_dbx:=true;
            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)));
          end;
 {$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 }
          { 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}
          if _class.classtype=ct_object then
            begin
               if assigned(dmtlabel) then
-                asmlist[datasegment].concat(Tai_const_symbol.Create(dmtlabel)))
+                asmlist[al_data].concat(Tai_const_symbol.Create(dmtlabel)))
               else
-                asmlist[datasegment].concat(Tai_const.Create_ptr(0));
+                asmlist[al_data].concat(Tai_const.Create_ptr(0));
            end;
 {$endif WITHDMT}
          { 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 !! }
          if assigned(_class.childof) and
             (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
-           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 }
          if is_class(_class) then
           begin
             { 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 }
             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
-              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+              asmlist[al_data].concat(Tai_const.Create_sym(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 }
-            asmlist[datasegment].concat(Tai_const.Create_sym(fieldtablelabel));
+            asmlist[al_data].concat(Tai_const.Create_sym(fieldtablelabel));
             { pointer to type info of published section }
             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
-              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+              asmlist[al_data].concat(Tai_const.Create_sym(nil));
             { inittable for con-/destruction }
             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
-              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+              asmlist[al_data].concat(Tai_const.Create_sym(nil));
             { auto table }
-            asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+            asmlist[al_data].concat(Tai_const.Create_sym(nil));
             { interface table }
             if _class.implementedinterfaces.count>0 then
-              asmlist[datasegment].concat(Tai_const.Create_sym(interfacetable))
+              asmlist[al_data].concat(Tai_const.Create_sym(interfacetable))
             else
-              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+              asmlist[al_data].concat(Tai_const.Create_sym(nil));
             { table for string messages }
             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
-              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
+              asmlist[al_data].concat(Tai_const.Create_sym(nil));
           end;
          { 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 }
-         asmlist[datasegment].concat(Tai_symbol_end.Createname(_class.vmt_mangledname));
+         asmlist[al_data].concat(Tai_symbol_end.Createname(_class.vmt_mangledname));
       end;
 
 

+ 9 - 9
compiler/parser.pas

@@ -251,8 +251,8 @@ implementation
       begin
          exprasmlist:=taasmoutput.create;
          { 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
            if i in to_create then
              asmlist[i]:=Taasmoutput.create
@@ -260,9 +260,9 @@ implementation
              asmlist[i]:=nil;
 
          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 }
-         cresstr.ResourceStrings:=TResourceStrings.Create;
+         cresstr.al_resourcestrings:=Tal_resourcestrings.Create;
          { use the librarydata from current_module }
          objectlibrary:=current_module.librarydata;
       end;
@@ -285,7 +285,7 @@ implementation
          d.free;
 {$endif}
          { resource strings }
-         cresstr.resourcestrings.free;
+         cresstr.al_resourcestrings.free;
          objectlibrary:=nil;
       end;
 
@@ -319,8 +319,8 @@ implementation
           oldexprasmlist:Taasmoutput;
           oldasmlist:array[Tasmlist] of Taasmoutput;
           oldobjectlibrary : tasmlibrarydata;
-        { resourcestrings }
-          OldResourceStrings : tResourceStrings;
+        { al_resourcestrings }
+          Oldal_resourcestrings : tal_resourcestrings;
         { akt.. things }
           oldaktlocalswitches  : tlocalswitches;
           oldaktmoduleswitches : tmoduleswitches;
@@ -380,7 +380,7 @@ implementation
             oldasmlist:=asmlist;
             oldexprasmlist:=exprasmlist;
             oldobjectlibrary:=objectlibrary;
-            OldResourceStrings:=ResourceStrings;
+            Oldal_resourcestrings:=al_resourcestrings;
           { save akt... state }
           { handle the postponed case first }
            if localswitcheschanged then
@@ -543,7 +543,7 @@ implementation
                    exprasmlist:=oldexprasmlist;
                    asmlist:=oldasmlist;
                    { object data }
-                   ResourceStrings:=OldResourceStrings;
+                   al_resourcestrings:=Oldal_resourcestrings;
                    objectlibrary:=oldobjectlibrary;
                    { restore previous scanner }
                    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));
                    akttokenpos:=storetokenpos;
                    symtablestack.insert(sym);
-                   insertconstdata(ttypedconstsym(sym));
                    { procvar can have proc directives, but not type references }
                    if (tt.def.deftype=procvardef) and
                       (tt.sym=nil) then
@@ -334,21 +333,21 @@ implementation
                        { avoid wrong unused warnings web bug 801 PM }
                        inc(ttypesym(srsym).refs);
 {$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
                         begin
                           ttypesym(p).isusedinstab:=true;
-{                          ttypesym(p).concatstabto(debuglist);}
+{                          ttypesym(p).concatstabto(al_debug);}
                           {not stabs for forward defs }
                           if not Ttypesym(p).isstabwritten then
                             begin
                               if Ttypesym(p).restype.def.typesym=p then
-                                Tstoreddef(Ttypesym(p).restype.def).concatstabto(debuglist)
+                                Tstoreddef(Ttypesym(p).restype.def).concatstabto(al_debug)
                               else
                                 begin
                                   stab_str:=Ttypesym(p).stabstring;
                                   if assigned(stab_str) then
-                                    debuglist.concat(Tai_stabs.create(stab_str));
+                                    al_debug.concat(Tai_stabs.create(stab_str));
                                   Ttypesym(p).isstabwritten:=true;
                                 end;
                             end;

+ 2 - 4
compiler/pdecvar.pas

@@ -652,7 +652,6 @@ implementation
               tcsym:=ttypedconstsym.createtype('default'+vs.realname,tt,false);
               vs.defaultconstsym:=tcsym;
               symtablestack.insert(tcsym);
-              insertconstdata(tcsym);
               readtypedconst(tt,tcsym,false);
               { The variable has a value assigned }
               vs.varstate:=vs_assigned;
@@ -663,7 +662,6 @@ implementation
               tcsym.fileinfo:=vs.fileinfo;
               symtablestack.replace(vs,tcsym);
               vs.free;
-              insertconstdata(tcsym);
               consume(_EQUAL);
               readtypedconst(tt,tcsym,true);
             end;
@@ -723,7 +721,7 @@ implementation
           consume(_ID);
          { read vars }
          sc:=tsinglelist.create;
-         while (token=_ID) and 
+         while (token=_ID) and
             not((vd_object in options) and
                 (idtoken in [_PUBLIC,_PRIVATE,_PUBLISHED,_PROTECTED,_STRICT])) do
            begin
@@ -1119,7 +1117,7 @@ implementation
                    if vs.typ=globalvarsym then
                      begin
                        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
                          insertbssdata(tglobalvarsym(vs));
                        { 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 }
            if (target_info.system in [system_i386_win32,system_i386_wdosx]) then
             begin
-              if assigned(asmlist[importsection]) then
-               asmlist[importsection].clear
+              if assigned(asmlist[al_imports]) then
+               asmlist[al_imports].clear
               else
-               asmlist[importsection]:=taasmoutput.Create;
+               asmlist[al_imports]:=taasmoutput.Create;
               importlib.generatelib;
             end;
            { Readd the not processed files }
@@ -106,10 +106,10 @@ implementation
         if (cs_create_smart in aktmoduleswitches) then
          begin
            { 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
             begin
-              asmlist[importsection].clear;
+              asmlist[al_imports].clear;
               importlib.generatesmartlib;
             end;
 
@@ -139,11 +139,11 @@ implementation
 
     procedure create_dwarf;
       begin
-        asmlist[dwarflist]:=taasmoutput.create;
+        asmlist[al_dwarf]:=taasmoutput.create;
         { Call frame information }
         if (tf_needs_dwarf_cfi in target_info.flags) and
            (af_supports_dwarf in target_asm.flags) then
-          dwarfcfi.generate_code(asmlist[dwarflist]);
+          dwarfcfi.generate_code(asmlist[al_dwarf]);
       end;
 
 
@@ -160,32 +160,34 @@ implementation
            then
          begin
            { 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));
          end;
         { 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 }
-        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 ?
           .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}
-        if assigned(asmlist[debuglist]) then
+        if assigned(asmlist[al_debug]) then
           begin
             oldaktfilepos:=aktfilepos;
             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;
           end;
 {$endif GDB}
@@ -222,8 +224,8 @@ implementation
         ltvTables.insert(Tai_align.Create(const_align(sizeof(aint))));
         ltvTables.concat(Tai_symbol_end.Createname('FPC_THREADVARTABLES'));
         { 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;
       end;
 
@@ -260,8 +262,8 @@ implementation
             ltvTable.insert(Tai_align.Create(const_align(32)));
             ltvTable.concat(tai_const.create_sym(nil));  { end of list marker }
             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;
           end;
          ltvTable.Free;
@@ -288,7 +290,7 @@ implementation
            hp:=tused_unit(hp.next);
          end;
         { Add program resources, if any }
-        if asmlist[aasmtai.resourcestrings]<>nil then
+        if asmlist[aasmtai.al_resourcestrings]<>nil then
          begin
            ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESOURCESTRINGLIST',current_module.localsymtable,''),AT_DATA,0));
            Inc(Count);
@@ -299,8 +301,8 @@ implementation
         ResourceStringTables.insert(Tai_align.Create(const_align(4)));
         ResourceStringTables.concat(Tai_symbol_end.Createname('FPC_RESOURCESTRINGTABLES'));
         { 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;
       end;
 
@@ -351,8 +353,8 @@ implementation
         unitinits.insert(Tai_align.Create(const_align(4)));
         unitinits.concat(Tai_symbol_end.Createname('INITFINAL'));
         { 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;
       end;
 
@@ -360,11 +362,11 @@ implementation
     procedure insertmemorysizes;
       begin
         { 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;
 
 
@@ -659,14 +661,14 @@ implementation
                    dependent stabs }
                  write_used_unit_type_info(pu.u);
                  if assigned(pu.u.globalsymtable) then
-                   tglobalsymtable(pu.u.globalsymtable).concattypestabto(asmlist[debuglist]);
+                   tglobalsymtable(pu.u.globalsymtable).concattypestabto(asmlist[al_debug]);
                end;
              pu:=tused_unit(pu.next);
            end;
        end;
 
       var
-        vardebuglist : taasmoutput;
+        varal_debug : taasmoutput;
         storefilepos : tfileposinfo;
       begin
         if not (cs_debuginfo in aktmoduleswitches) then
@@ -678,37 +680,37 @@ implementation
         if current_module.is_unit then
           begin
             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
         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
           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 }
 {$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
-          tglobalsymtable(current_module.globalsymtable).concatstabto(vardebuglist);
+          tglobalsymtable(current_module.globalsymtable).concatstabto(varal_debug);
         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;
         { write used types from the used units }
         write_used_unit_type_info(current_module);
         { last write the types from this unit }
         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
-          tstaticsymtable(current_module.localsymtable).concattypestabto(asmlist[debuglist]);
+          tstaticsymtable(current_module.localsymtable).concattypestabto(asmlist[al_debug]);
         { include files }
         if (cs_gdb_dbx in aktglobalswitches) then
           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 '+
               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^+'",'+
               tostr(N_EINCL)+',0,0,0')));
             tglobalsymtable(current_module.globalsymtable).dbx_count_ok:={true}false;
@@ -910,14 +912,14 @@ implementation
       begin
         is_assembler_generated:=(Errorcount=0) and
           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;
 
@@ -1201,13 +1203,13 @@ implementation
          consume(_POINT);
 
          { Generate resoucestrings }
-         If ResourceStrings.ResStrCount>0 then
+         If al_resourcestrings.ResStrCount>0 then
           begin
-            ResourceStrings.CreateResourceStringList;
+            al_resourcestrings.CreateResourceStringList;
             current_module.flags:=current_module.flags or uf_has_resources;
             { only write if no errors found }
             if (Errorcount=0) then
-             ResourceStrings.WriteResourceFile(ForceExtension(current_module.ppufilename^,'.rst'));
+             al_resourcestrings.WriteResourceFile(ForceExtension(current_module.ppufilename^,'.rst'));
           end;
 
          if (Errorcount=0) then
@@ -1247,8 +1249,8 @@ implementation
 {$endif GDB}
 
          { 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 }
 {$ifndef segment_threadvars}
@@ -1500,14 +1502,14 @@ implementation
          if assigned(exportlib) and
             (target_info.system in [system_i386_win32,system_i386_wdosx]) and
             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
-            ResourceStrings.CreateResourceStringList;
+            al_resourcestrings.CreateResourceStringList;
             { only write if no errors found }
             if (Errorcount=0) then
-             ResourceStrings.WriteResourceFile(ForceExtension(current_module.ppufilename^,'.rst'));
+             al_resourcestrings.WriteResourceFile(ForceExtension(current_module.ppufilename^,'.rst'));
           end;
 
          { finalize? }
@@ -1568,7 +1570,7 @@ implementation
 {$endif GDB}
 
          { generate wrappers for interfaces }
-         gen_intf_wrappers(asmlist[codesegment],current_module.localsymtable);
+         gen_intf_wrappers(asmlist[al_code],current_module.localsymtable);
 
 {$ifndef segment_threadvars}
          { generate a list of threadvars }

+ 10 - 14
compiler/powerpc/agppcmpw.pas

@@ -800,10 +800,10 @@ var
       if not assigned(p) then
        exit;
       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
                 (cs_lineinfo in aktmoduleswitches))
-                 and (p=asmlist[codesegment]);
+                 and (p=asmlist[al_code]);
       DoNotSplitLine:=false;
       hp:=tai(p.first);
       while assigned(hp) do
@@ -1386,7 +1386,7 @@ var
     var
       fileinfo : tfileposinfo;
 {$endif GDB}
-
+      hal : tasmlist;
     begin
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
@@ -1415,17 +1415,13 @@ var
       WriteAsmFileHeader;
       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}
       WriteFileEndInfo;
       {$ENDIF}

+ 16 - 16
compiler/powerpc/cgcpu.pas

@@ -365,33 +365,33 @@ const
         if assigned(result) then
           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);
-        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);
         reference_reset_symbol(href,l1,0);
 {$ifdef powerpc}
         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.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}
         internalerror(2004010502);
 {$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;
 
 

+ 6 - 6
compiler/powerpc/nppcld.pas

@@ -67,9 +67,9 @@ unit nppcld;
                   if not(assigned(l)) then
                     begin
                       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;
                   reference_reset_symbol(ref,l,0);
                   reference_reset_base(location.reference,cg.getaddressregister(exprasmlist),0);
@@ -99,9 +99,9 @@ unit nppcld;
                   if not(assigned(l)) then
                     begin
                       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;
 
                   reference_reset_symbol(ref,l,0);

+ 5 - 5
compiler/psub.pas

@@ -862,10 +862,10 @@ implementation
                  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 }
             tg.resettempgen;
@@ -1301,7 +1301,7 @@ implementation
                    begin
                      s:=proc_get_importname(pd);
                      if s<>'' then
-                       gen_external_stub(asmlist[codesegment],pd,s);
+                       gen_external_stub(asmlist[al_code],pd,s);
                    end;
 
                  { Import DLL specified? }

+ 124 - 156
compiler/ptconst.pas

@@ -41,7 +41,7 @@ implementation
        symconst,symbase,symdef,symtable,
        aasmbase,aasmtai,aasmcpu,defutil,defcmp,
        { pass 1 }
-       node,htypechk,
+       node,htypechk,procinfo,
        nmat,nadd,ncal,nmem,nset,ncnv,ninl,ncon,nld,nflw,
        { parser specific stuff }
        pbase,pexpr,
@@ -65,7 +65,6 @@ implementation
          varalign  : longint;
          offset,
          strlength : aint;
-         curconstsegment : TAAsmoutput;
          ll        : tasmlabel;
          s,sorg    : string;
          c         : char;
@@ -82,6 +81,9 @@ implementation
          pw        : pcompilerwidestring;
          error     : boolean;
          old_block_type : tblock_type;
+         storefilepos : tfileposinfo;
+         cursectype : TAsmSectionType;
+         cural : tasmlist;
 
          procedure check_range(def:torddef);
          begin
@@ -98,10 +100,45 @@ implementation
       begin
          old_block_type:=block_type;
          block_type:=bt_const;
+
          if writable then
-           curconstsegment:=asmlist[datasegment]
+           begin
+             cural:=al_typedconsts;
+             cursectype:=sec_data;
+           end
          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
             orddef:
               begin
@@ -110,28 +147,28 @@ implementation
                     bool8bit :
                       begin
                          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
                            Message(parser_e_illegal_expression);
                       end;
                     bool16bit :
                       begin
                          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
                            Message(parser_e_illegal_expression);
                       end;
                     bool32bit :
                       begin
                          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
                            Message(parser_e_illegal_expression);
                       end;
                     uchar :
                       begin
                          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
                            Message(parser_e_illegal_expression);
                       end;
@@ -140,7 +177,7 @@ implementation
                          if is_constcharnode(p) then
                            inserttypeconv(p,cwidechartype);
                          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
                            Message(parser_e_illegal_expression);
                       end;
@@ -149,7 +186,7 @@ implementation
                       begin
                          if is_constintnode(p) then
                            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));
                            end
                          else
@@ -160,7 +197,7 @@ implementation
                       begin
                          if is_constintnode(p) then
                            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));
                            end
                          else
@@ -171,7 +208,7 @@ implementation
                       begin
                          if is_constintnode(p) then
                            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
                                check_range(torddef(t.def));
                            end
@@ -196,7 +233,7 @@ implementation
                              intvalue:=0;
                              Message(parser_e_illegal_expression);
                            end;
-                        curconstSegment.concat(Tai_const.Create_64bit(intvalue));
+                        asmlist[cural].concat(Tai_const.Create_64bit(intvalue));
                       end;
                     else
                       internalerror(3799);
@@ -215,24 +252,24 @@ implementation
 
               case tfloatdef(t.def).typ of
                  s32real :
-                   curconstSegment.concat(Tai_real_32bit.Create(ts32real(value)));
+                   asmlist[cural].concat(Tai_real_32bit.Create(ts32real(value)));
                  s64real :
 {$ifdef ARM}
                    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
 {$endif ARM}
-                     curconstSegment.concat(Tai_real_64bit.Create(ts64real(value)));
+                     asmlist[cural].concat(Tai_real_64bit.Create(ts64real(value)));
                  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 }
                  s64comp :
-                   curconstSegment.concat(Tai_comp_64bit.Create(round(value)));
+                   asmlist[cural].concat(Tai_comp_64bit.Create(round(value)));
                  s64currency:
-                   curconstSegment.concat(Tai_comp_64bit.Create(round(value*10000)));
+                   asmlist[cural].concat(Tai_comp_64bit.Create(round(value*10000)));
                  s128real:
-                   curconstSegment.concat(Tai_real_128bit.Create(value));
+                   asmlist[cural].concat(Tai_real_128bit.Create(value));
                  else
                    internalerror(18);
               end;
@@ -247,11 +284,11 @@ implementation
                      begin
                         if not Tobjectdef(pointertype.def).is_related(Tobjectdef(pointertype.def)) then
                           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)));
                      end;
                  niln:
-                   curconstSegment.concat(Tai_const.Create_sym(nil));
+                   asmlist[cural].concat(Tai_const.Create_sym(nil));
                  else Message(parser_e_illegal_expression);
               end;
               p.free;
@@ -282,30 +319,30 @@ implementation
               if (p.nodetype = pointerconstn) then
                 begin
                   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
                     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
                     internalerror(200404122);
                 end
               { nil pointer ? }
               else if p.nodetype=niln then
-                curconstSegment.concat(Tai_const.Create_sym(nil))
+                asmlist[cural].concat(Tai_const.Create_sym(nil))
               { maybe pchar ? }
               else
                 if is_char(tpointerdef(t.def).pointertype.def) and
                    (p.nodetype<>addrn) then
                   begin
                     objectlibrary.getdatalabel(ll);
-                    curconstSegment.concat(Tai_const.Create_sym(ll));
+                    asmlist[cural].concat(Tai_const.Create_sym(ll));
                     if p.nodetype=stringconstn then
                      varalign:=tstringconstnode(p).len
                     else
                      varalign:=0;
                     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
                       begin
                         len:=tstringconstnode(p).len;
@@ -315,11 +352,11 @@ implementation
                          len:=255;
                         getmem(ca,len+2);
                         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
                     else
                       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
                       message(parser_e_illegal_expression);
                 end
@@ -329,9 +366,9 @@ implementation
                    (p.nodetype<>addrn) then
                   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_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
                       begin
                         { convert to widestring stringconstn }
@@ -341,9 +378,9 @@ implementation
                          begin
                            pw:=pcompilerwidestring(tstringconstnode(p).value_str);
                            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 }
-                           asmlist[consts].concat(Tai_const.Create_16bit(0))
+                           asmlist[al_typedconsts].concat(Tai_const.Create_16bit(0))
                          end;
                       end
                     else
@@ -411,17 +448,17 @@ implementation
                               if po_abstractmethod in tprocsym(srsym).first_procdef.procoptions then
                                 Message(type_e_cant_take_address_of_abstract_method)
                               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;
                           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 :
-                            curconstSegment.concat(Tai_const.Createname(ttypedconstsym(srsym).mangledname,AT_DATA,offset));
+                            asmlist[cural].concat(Tai_const.Createname(ttypedconstsym(srsym).mangledname,AT_DATA,offset));
                           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 :
                             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
                               Message(type_e_variable_id_expected);
                           else
@@ -438,7 +475,7 @@ implementation
                   begin
                     if (tinlinenode(p).left.nodetype=typen) then
                       begin
-                        curconstSegment.concat(Tai_const.createname(
+                        asmlist[cural].concat(Tai_const.createname(
                           tobjectdef(tinlinenode(p).left.resulttype.def).vmt_mangledname,AT_DATA,0));
                       end
                     else
@@ -468,7 +505,7 @@ implementation
                         if source_info.endian = target_info.endian then
                           begin
                             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
                         else
                           begin
@@ -476,10 +513,10 @@ implementation
                             j:=0;
                             for l:=0 to ((p.resulttype.def.size-1) div 4) do
                               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);
                               end;
                           end;
@@ -498,9 +535,9 @@ implementation
                      is_subequal(p.resulttype.def,t.def) then
                    begin
                      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
                   else
@@ -550,12 +587,12 @@ implementation
                           message2(parser_w_string_too_long,strpas(strval),tostr(t.def.size-1));
                           strlength:=t.def.size-1;
                         end;
-                       curconstSegment.concat(Tai_const.Create_8bit(strlength));
+                       asmlist[cural].concat(Tai_const.Create_8bit(strlength));
                        { this can also handle longer strings }
                        getmem(ca,strlength+1);
                        move(strval^,ca^,strlength);
                        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 }
                        if t.def.size>strlength then
                         begin
@@ -565,29 +602,22 @@ implementation
                           fillchar(ca[0],t.def.size-strlength-1,' ');
                           ca[t.def.size-strlength-1]:=#0;
                           { 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;
-                 {$ifdef ansistrings_bits}
-                   st_ansistring16:
+                   st_ansistring:
                      begin
                         { an empty ansi string is nil! }
                         if (strlength=0) then
-                          curconstSegment.concat(Tai_const.Create_ptr(0))
+                          asmlist[cural].concat(Tai_const.Create_sym(nil))
                         else
                           begin
                             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);
                             move(strval^,ca^,strlength);
                             { 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 }
                             { tai_string.done, there is a freemem(len+1) (JM)             }
                             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;
-                 {$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:
                      begin
                         { an empty ansi string is nil! }
                         if (strlength=0) then
-                          curconstSegment.concat(Tai_const.Create_sym(nil))
+                          asmlist[cural].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));
+                            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
-                              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 }
-                            asmlist[consts].concat(Tai_const.Create_16bit(0))
+                            asmlist[al_rodata].concat(Tai_const.Create_16bit(0))
                           end;
                      end;
                    st_longstring:
                      begin
                        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;
@@ -694,7 +662,7 @@ implementation
                 begin
                   { Only allow nil initialization }
                   consume(_NIL);
-                  curconstSegment.concat(Tai_const.Create_sym(nil));
+                  asmlist[cural].concat(Tai_const.Create_sym(nil));
                 end
               else
               if try_to_consume(_LKLAMMER) then
@@ -739,12 +707,12 @@ implementation
                      begin
                         if i+1-tarraydef(t.def).lowrange<=len then
                           begin
-                             curconstSegment.concat(Tai_const.Create_8bit(byte(ca^)));
+                             asmlist[cural].concat(Tai_const.Create_8bit(byte(ca^)));
                              inc(ca);
                           end
                         else
                           {Fill the remaining positions with #0.}
-                          curconstSegment.concat(Tai_const.Create_8bit(0));
+                          asmlist[cural].concat(Tai_const.Create_8bit(0));
                      end;
                    p.free;
                 end
@@ -760,9 +728,9 @@ implementation
               { under tp:  =nil or =var under fpc: =nil or =@var }
               if token=_NIL then
                 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
-                     curconstSegment.concat(Tai_const.Create_sym(nil));
+                     asmlist[cural].concat(Tai_const.Create_sym(nil));
                    consume(_NIL);
                    exit;
                 end;
@@ -809,7 +777,7 @@ implementation
               if (p.nodetype=loadn) and
                  (tloadnode(p).symtableentry.typ=procsym) then
                begin
-                 curconstSegment.concat(Tai_const.createname(
+                 asmlist[cural].concat(Tai_const.createname(
                    tprocsym(tloadnode(p).symtableentry).first_procdef.mangledname,AT_FUNCTION,0));
                end
               else
@@ -831,11 +799,11 @@ implementation
                       p.free;
                       if string2guid(s,tmpguid) then
                         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
-                            curconstSegment.concat(Tai_const.Create_8bit(tmpguid.D4[i]));
+                            asmlist[cural].concat(Tai_const.Create_8bit(tmpguid.D4[i]));
                         end
                       else
                         Message(parser_e_improper_guid_syntax);
@@ -913,7 +881,7 @@ implementation
                             { if needed fill (alignment) }
                             if tfieldvarsym(srsym).fieldoffset>aktpos then
                                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 }
                              aktpos:=tfieldvarsym(srsym).fieldoffset+tfieldvarsym(srsym).vartype.def.size;
@@ -942,7 +910,7 @@ implementation
                    Message1(parser_w_skipped_fields_after,sorg);
 
                  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);
               end;
@@ -960,7 +928,7 @@ implementation
                     end
                   else
                     begin
-                      curconstSegment.concat(Tai_const.Create_sym(nil));
+                      asmlist[cural].concat(Tai_const.Create_sym(nil));
                     end;
                   p.free;
                 end
@@ -1011,8 +979,8 @@ implementation
                                     (vmt_offset<fieldoffset) then
                                    begin
                                      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 }
                                      aktpos:=vmt_offset + sizeof(aint);
                                    end;
@@ -1020,7 +988,7 @@ implementation
                                { if needed fill }
                                if fieldoffset>aktpos then
                                  for i:=1 to fieldoffset-aktpos do
-                                   curconstSegment.concat(Tai_const.Create_8bit(0));
+                                   asmlist[cural].concat(Tai_const.Create_8bit(0));
 
                                { new position }
                                aktpos:=fieldoffset+vartype.def.size;
@@ -1038,13 +1006,13 @@ implementation
                       (tobjectdef(t.def).vmt_offset>=aktpos) then
                      begin
                        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 }
                        aktpos:=tobjectdef(t.def).vmt_offset + sizeof(aint);
                      end;
                    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);
                 end;
            end;

+ 2 - 2
compiler/rautils.pas

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

+ 4 - 4
compiler/sparc/ncpucnv.pas

@@ -169,11 +169,11 @@ implementation
                s64real:
                  begin
                    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) }
-                   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);
                    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
           jumpsegment:=current_procinfo.aktlocaldata
         else
-          jumpsegment:=asmlist[datasegment];
+          jumpsegment:=asmlist[al_data];
         if not(jumptable_no_range) then
           begin
              { case expr less than min_ => goto elselabel }

+ 143 - 143
compiler/symdef.pas

@@ -1257,16 +1257,16 @@ implementation
          if assigned(typesym) then
            begin
               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
          else
-           asmlist[rttilist].concat(Tai_string.Create(#0))
+           asmlist[al_rtti].concat(Tai_string.Create(#0))
       end;
 
 
     procedure tstoreddef.write_rtti_data(rt:trttitype);
       begin
-        asmlist[rttilist].concat(tai_const.create_8bit(tkUnknown));
+        asmlist[al_rtti].concat(tai_const.create_8bit(tkUnknown));
         write_rtti_name;
       end;
 
@@ -1290,11 +1290,11 @@ implementation
              begin
                objectlibrary.getdatalabel(localrttilab[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);
-               asmlist[rttilist].concat(Tai_symbol_end.Create(localrttilab[rt]));
+               asmlist[al_rtti].concat(Tai_symbol_end.Create(localrttilab[rt]));
              end;
             get_rtti_label:=localrttilab[rt];
           end;
@@ -1654,43 +1654,43 @@ implementation
           {$ifdef ansistring_bits}
             st_ansistring16:
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkA16String));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkA16String));
                  write_rtti_name;
               end;
             st_ansistring32:
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkA32String));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkA32String));
                  write_rtti_name;
               end;
             st_ansistring64:
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkA64String));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkA64String));
                  write_rtti_name;
               end;
           {$else}
             st_ansistring:
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkAString));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkAString));
                  write_rtti_name;
               end;
           {$endif}
             st_widestring:
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkWString));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkWString));
                  write_rtti_name;
               end;
             st_longstring:
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkLString));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkLString));
                  write_rtti_name;
               end;
             st_shortstring:
               begin
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(tkSString));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(tkSString));
                  write_rtti_name;
-                 asmlist[rttilist].concat(Tai_const.Create_8bit(len));
+                 asmlist[al_rtti].concat(Tai_const.Create_8bit(len));
 {$ifdef cpurequiresproperalignment}
-                 asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+                 asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
               end;
          end;
@@ -1927,36 +1927,36 @@ implementation
       var
          hp : tenumsym;
       begin
-         asmlist[rttilist].concat(Tai_const.Create_8bit(tkEnumeration));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(tkEnumeration));
          write_rtti_name;
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
          case longint(savesize) of
             1:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(otUByte));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(otUByte));
             2:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(otUWord));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(otUWord));
             4:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(otULong));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(otULong));
          end;
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(4));
+         asmlist[al_rtti].concat(Tai_align.Create(4));
 {$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
-           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
-           asmlist[rttilist].concat(Tai_const.create_sym(nil));
+           asmlist[al_rtti].concat(Tai_const.create_sym(nil));
          hp:=tenumsym(firstenum);
          while assigned(hp) do
            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;
            end;
-         asmlist[rttilist].concat(Tai_const.Create_8bit(0));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(0));
       end;
 
 
@@ -2122,60 +2122,60 @@ implementation
         begin
           write_rtti_name;
 {$ifdef cpurequiresproperalignment}
-          asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+          asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$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}
-         asmlist[rttilist].concat(Tai_align.Create(4));
+         asmlist[al_rtti].concat(Tai_align.Create(4));
 {$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;
 
       begin
         case typ of
           s64bit :
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkInt64));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkInt64));
               write_rtti_name;
 {$ifdef cpurequiresproperalignment}
-              asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+              asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
               { 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 }
-              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;
           u64bit :
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkQWord));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkQWord));
               write_rtti_name;
 {$ifdef cpurequiresproperalignment}
-              asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+              asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
               { low }
-              asmlist[rttilist].concat(Tai_const.Create_64bit(0));
+              asmlist[al_rtti].concat(Tai_const.Create_64bit(0));
               { 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;
           bool8bit:
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkBool));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkBool));
               dointeger;
             end;
           uchar:
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkChar));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkChar));
               dointeger;
             end;
           uwidechar:
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkWChar));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkWChar));
               dointeger;
             end;
           else
             begin
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkInteger));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkInteger));
               dointeger;
             end;
         end;
@@ -2300,12 +2300,12 @@ implementation
          translate : array[tfloattype] of byte =
            (ftSingle,ftDouble,ftExtended,ftComp,ftCurr,ftFloat128);
       begin
-         asmlist[rttilist].concat(Tai_const.Create_8bit(tkFloat));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(tkFloat));
          write_rtti_name;
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_const.Create_8bit(translate[typ]));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(translate[typ]));
       end;
 
 
@@ -2578,7 +2578,7 @@ implementation
 
     procedure tvariantdef.write_rtti_data(rt:trttitype);
       begin
-         asmlist[rttilist].concat(Tai_const.Create_8bit(tkVariant));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(tkVariant));
       end;
 
 
@@ -2920,16 +2920,16 @@ implementation
 
     procedure tsetdef.write_rtti_data(rt:trttitype);
       begin
-         asmlist[rttilist].concat(Tai_const.Create_8bit(tkSet));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(tkSet));
          write_rtti_name;
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_const.Create_8bit(otULong));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(otULong));
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$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;
 
 
@@ -3216,21 +3216,21 @@ implementation
     procedure tarraydef.write_rtti_data(rt:trttitype);
       begin
          if IsDynamicArray then
-           asmlist[rttilist].concat(Tai_const.Create_8bit(tkdynarray))
+           asmlist[al_rtti].concat(Tai_const.Create_8bit(tkdynarray))
          else
-           asmlist[rttilist].concat(Tai_const.Create_8bit(tkarray));
+           asmlist[al_rtti].concat(Tai_const.Create_8bit(tkarray));
          write_rtti_name;
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
          { size of elements }
-         asmlist[rttilist].concat(Tai_const.Create_aint(elesize));
+         asmlist[al_rtti].concat(Tai_const.Create_aint(elesize));
          if not(IsDynamicArray) then
-           asmlist[rttilist].concat(Tai_const.Create_aint(elecount));
+           asmlist[al_rtti].concat(Tai_const.Create_aint(elecount));
          { 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 }
-         asmlist[rttilist].concat(Tai_const.Create_32bit(tstoreddef(elementtype.def).getvartype));
+         asmlist[al_rtti].concat(Tai_const.Create_32bit(tstoreddef(elementtype.def).getvartype));
       end;
 
 
@@ -3354,8 +3354,8 @@ implementation
             ((tsym(sym).typ=fieldvarsym) and
              tfieldvarsym(sym).vartype.def.needs_inittable) then
           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;
 
@@ -3510,16 +3510,16 @@ implementation
 
     procedure trecorddef.write_rtti_data(rt:trttitype);
       begin
-         asmlist[rttilist].concat(Tai_const.Create_8bit(tkrecord));
+         asmlist[al_rtti].concat(Tai_const.Create_8bit(tkrecord));
          write_rtti_name;
 {$ifdef cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
-         asmlist[rttilist].concat(Tai_const.Create_32bit(size));
+         asmlist[al_rtti].concat(Tai_const.Create_32bit(size));
          Count:=0;
          FRTTIType:=rt;
          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);
       end;
 
@@ -4911,10 +4911,10 @@ implementation
                  vs_out  : paraspec := pfOut;
                end;
                { 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 }
-               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 }
                tstoreddef(parasym.vartype.def).write_rtti_name;
@@ -4928,21 +4928,21 @@ implementation
         if po_methodpointer in procoptions then
           begin
              { 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;
 
 {$ifdef cpurequiresproperalignment}
-             asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+             asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
              { write kind of method (can only be function or procedure)}
              if rettype.def = voidtype.def then
                methodkind := mkProcedure
              else
                methodkind := mkFunction;
-             asmlist[rttilist].concat(Tai_const.Create_8bit(methodkind));
+             asmlist[al_rtti].concat(Tai_const.Create_8bit(methodkind));
 
              { 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
                if this method uses right to left parameter pushing! }
@@ -5714,7 +5714,7 @@ implementation
         begin
            if not(assigned(proc) and assigned(proc.firstsym))  then
              begin
-                asmlist[rttilist].concat(Tai_const.create(ait_const_ptr,1));
+                asmlist[al_rtti].concat(Tai_const.create(ait_const_ptr,1));
                 typvalue:=3;
              end
            else if proc.firstsym^.sym.typ=fieldvarsym then
@@ -5747,7 +5747,7 @@ implementation
                      end;
                      hp:=hp^.next;
                   end;
-                asmlist[rttilist].concat(Tai_const.create(ait_const_ptr,address));
+                asmlist[al_rtti].concat(Tai_const.create(ait_const_ptr,address));
                 typvalue:=0;
              end
            else
@@ -5757,13 +5757,13 @@ implementation
                   exit;
                 if not(po_virtualmethod in tprocdef(proc.procdef).procoptions) then
                   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;
                   end
                 else
                   begin
                      { 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)));
                      typvalue:=2;
                   end;
@@ -5782,20 +5782,20 @@ implementation
                      internalerror(1509992);
                    { access to implicit class property as field }
                    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 }
-                   asmlist[rttilist].concat(Tai_const.Create_32bit(1));
+                   asmlist[al_rtti].concat(Tai_const.Create_32bit(1));
                    { 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 }
-                   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);
-                   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}
                 end;
               propertysym:
@@ -5804,26 +5804,26 @@ implementation
                      proctypesinfo:=$40
                    else
                      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).writeaccess,2);
                    { isn't it stored ? }
                    if not(ppo_stored in tpropertysym(sym).propoptions) then
                      begin
-                        asmlist[rttilist].concat(Tai_const.create_sym(nil));
+                        asmlist[al_rtti].concat(Tai_const.create_sym(nil));
                         proctypesinfo:=proctypesinfo or (3 shl 4);
                      end
                    else
                      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);
-                   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}
-                   asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+                   asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
                 end;
               else internalerror(1509992);
@@ -5921,15 +5921,15 @@ implementation
           (tsym(sym).typ=fieldvarsym) then
           begin
 {$ifdef cpurequiresproperalignment}
-             asmlist[rttilist].concat(Tai_align.Create(sizeof(AInt)));
+             asmlist[al_rtti].concat(Tai_align.Create(sizeof(AInt)));
 {$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));
              if not(assigned(hp)) then
                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;
 
@@ -5946,29 +5946,29 @@ implementation
          objectlibrary.getdatalabel(classtable);
          count:=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 }
          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}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$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);
 
          { 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}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
          hp:=tclasslistitem(classtablelist.first);
          while assigned(hp) do
            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);
            end;
 
@@ -5997,33 +5997,33 @@ implementation
       begin
          case objecttype of
             odt_class:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkclass));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkclass));
             odt_object:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkobject));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkobject));
             odt_interfacecom:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkinterface));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkinterface));
             odt_interfacecorba:
-              asmlist[rttilist].concat(Tai_const.Create_8bit(tkinterfaceCorba));
+              asmlist[al_rtti].concat(Tai_const.Create_8bit(tkinterfaceCorba));
           else
             exit;
           end;
 
          { 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}
-         asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+         asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
          case rt of
            initrtti :
              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
                 begin
                   count:=0;
                   FRTTIType:=rt;
                   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);
                 end;
              end;
@@ -6032,17 +6032,17 @@ implementation
                if not(objecttype in [odt_interfacecom,odt_interfacecorba]) then
                  begin
                    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
-                     asmlist[rttilist].concat(Tai_const.create_sym(nil));
+                     asmlist[al_rtti].concat(Tai_const.create_sym(nil));
                  end;
 
                { write parent typeinfo }
                if assigned(childof) and ((oo_can_have_published in childof.objectoptions) or
                  (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
-                 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
                  begin
@@ -6054,12 +6054,12 @@ implementation
 
                    { write it }
                    symtable.foreach(@count_published_properties,nil);
-                   asmlist[rttilist].concat(Tai_const.Create_16bit(count));
+                   asmlist[al_rtti].concat(Tai_const.Create_16bit(count));
                  end
                else
                  { interface: write flags, iid and iidstr }
                  begin
-                   asmlist[rttilist].concat(Tai_const.Create_32bit(
+                   asmlist[al_rtti].concat(Tai_const.Create_32bit(
                      { ugly, but working }
                      longint([
                        TCompilerIntfFlag(ord(ifHasGuid)*ord(assigned(iidguid))),
@@ -6070,21 +6070,21 @@ implementation
                      ifDispatch, }
                      ));
 {$ifdef cpurequiresproperalignment}
-                   asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+                   asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$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
-                     asmlist[rttilist].concat(Tai_const.Create_8bit(iidguid^.D4[i]));
+                     asmlist[al_rtti].concat(Tai_const.Create_8bit(iidguid^.D4[i]));
                  end;
 
                { 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}
-               asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+               asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
 
                { write iidstr }
@@ -6092,13 +6092,13 @@ implementation
                  begin
                    if assigned(iidstr) then
                      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
                    else
-                     asmlist[rttilist].concat(Tai_const.Create_8bit(0));
+                     asmlist[al_rtti].concat(Tai_const.Create_8bit(0));
 {$ifdef cpurequiresproperalignment}
-                   asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+                   asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
                  end;
 
@@ -6107,10 +6107,10 @@ implementation
                    { write published properties count }
                    count:=0;
                    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}
-                   asmlist[rttilist].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+                   asmlist[al_rtti].concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
                  end;
 

+ 1 - 1
compiler/symsym.pas

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

+ 2 - 2
compiler/symtable.pas

@@ -1532,8 +1532,8 @@ implementation
              unittypecount:=1;
              pglobaltypecount := @unittypecount;
              {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);}
              { we can't use dbx_vcount, because we don't know
                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
          begin
 {$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}
          end;
       end

+ 11 - 11
compiler/systems/t_bsd.pas

@@ -88,8 +88,8 @@ implementation
 
     procedure timportlibdarwin.preparelib(const s : string);
       begin
-         if asmlist[importsection]=nil then
-           asmlist[importsection]:=TAAsmoutput.create;
+         if asmlist[al_imports]=nil then
+           asmlist[al_imports]:=TAAsmoutput.create;
       end;
 
 
@@ -219,17 +219,17 @@ begin
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          begin
 {$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}
 {$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}
          end;
       end

+ 6 - 6
compiler/systems/t_linux.pas

@@ -156,7 +156,7 @@ procedure texportliblinux.generatelib;
 var
   hp2 : texported_item;
 begin
-  new_section(asmlist[codesegment],sec_code,'',0);
+  new_section(asmlist[al_code],sec_code,'',0);
   hp2:=texported_item(current_module._exports.first);
   while assigned(hp2) do
    begin
@@ -167,11 +167,11 @@ begin
           is declared with cdecl }
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          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
      else

+ 5 - 5
compiler/systems/t_nwl.pas

@@ -241,11 +241,11 @@ begin
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          begin
 {$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}
          end;
       end

+ 5 - 5
compiler/systems/t_nwm.pas

@@ -233,11 +233,11 @@ begin
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          begin
 {$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}
          end;
       end

+ 6 - 6
compiler/systems/t_sunos.pas

@@ -169,7 +169,7 @@ procedure texportlibsolaris.generatelib;
 var
   hp2 : texported_item;
 begin
-  new_section(asmlist[codesegment],sec_code,'',0);
+  new_section(asmlist[al_code],sec_code,'',0);
   hp2:=texported_item(current_module._exports.first);
   while assigned(hp2) do
    begin
@@ -180,11 +180,11 @@ begin
           is declared with cdecl }
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          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
      else

+ 123 - 123
compiler/systems/t_win.pas

@@ -109,8 +109,8 @@ implementation
 
     procedure timportlibwin32.preparelib(const s : string);
       begin
-         if asmlist[importsection]=nil then
-           asmlist[importsection]:=TAAsmoutput.create;
+         if asmlist[al_imports]=nil then
+           asmlist[al_imports]:=TAAsmoutput.create;
       end;
 
 
@@ -219,7 +219,7 @@ implementation
          hp2 : twin32imported_item;
          p : pchar;
       begin
-         new_section(asmlist[importsection],sec_code,'',0);
+         new_section(asmlist[al_imports],sec_code,'',0);
          hp1:=timportlist(current_module.imports.first);
          while assigned(hp1) do
            begin
@@ -230,9 +230,9 @@ implementation
                    p:=strpnew(#9+'EXTRN '+hp2.func^)
                  else
                    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^);
-                 asmlist[importsection].concat(tai_direct.create(p));
+                 asmlist[al_imports].concat(tai_direct.create(p));
                  hp2:=twin32imported_item(hp2.next);
                end;
              hp1:=timportlist(hp1.next);
@@ -267,33 +267,33 @@ implementation
              objectlibrary.getaddrlabel(lidata4);
              objectlibrary.getaddrlabel(lidata5);
            { 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 }
-             asmlist[importsection].concat(Tai_const.Create_rva_sym(lidata4));
+             asmlist[al_imports].concat(Tai_const.Create_rva_sym(lidata4));
              { 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 }
-             asmlist[importsection].concat(Tai_const.Create_rva_sym(lname));
+             asmlist[al_imports].concat(Tai_const.Create_rva_sym(lname));
              { 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 }
-             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 }
-             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 }
              hp2:=twin32imported_item(hp1.imported_items.first);
              while assigned(hp2) do
                begin
                  { insert cuts }
-                 asmlist[importsection].concat(Tai_cutobject.Create);
+                 asmlist[al_imports].concat(Tai_cutobject.Create);
                  { create indirect jump }
                  if not hp2.is_var then
                   begin
@@ -301,49 +301,49 @@ implementation
                   {$ifdef ARM}
                     objectlibrary.getlabel(lpcode);
                   {$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}
                     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}
                     if assigned(hp2.procdef) then
                       mangledstring:=hp2.procdef.mangledname
                     else
                       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}
                     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);
-                    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);
-                    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}
                     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}
 {$IfDef GDB}
                     if (cs_debuginfo in aktmoduleswitches) and assigned(hp2.procdef) then
-                       hp2.procdef.concatstabto(asmlist[importsection]);
+                       hp2.procdef.concatstabto(asmlist[al_imports]);
 {$EndIf GDB}
                   end;
                  { 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 }
                  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
-                  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
-                  asmlist[importsection].concat(Tai_label.Create(lcode));
+                  asmlist[al_imports].concat(Tai_label.Create(lcode));
 {$ifdef GDB}
                  if (cs_debuginfo in aktmoduleswitches) then
                   begin
@@ -356,7 +356,7 @@ implementation
                            inc(suffix);
                            importname:='__imp_'+hp2.name^+'_'+tostr(suffix);
                          end;
-                        asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                        asmlist[al_imports].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                       end
                     else
                       begin
@@ -367,35 +367,35 @@ implementation
                            inc(suffix);
                            importname:='__imp_by_ordinal'+tostr(hp2.ordnr)+'_'+tostr(suffix);
                          end;
-                        asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                        asmlist[al_imports].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                       end;
                   end;
 {$endif GDB}
                  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
-                   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 }
-                 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);
                end;
 
               { write final section }
-              asmlist[importsection].concat(Tai_cutobject.Create_end);
+              asmlist[al_imports].concat(Tai_cutobject.Create_end);
               { 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 }
-              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 }
-              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);
            end;
@@ -422,46 +422,46 @@ implementation
          hp1:=timportlist(current_module.imports.first);
          while assigned(hp1) do
            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 }
               objectlibrary.getlabel(l1);
               objectlibrary.getlabel(l2);
               objectlibrary.getlabel(l3);
-              new_section(asmlist[importsection],sec_idata2,'',0);
+              new_section(asmlist[al_imports],sec_idata2,'',0);
               { 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 }
-              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 }
-              asmlist[importsection].concat(Tai_const.Create_rva_sym(l1));
+              asmlist[al_imports].concat(Tai_const.Create_rva_sym(l1));
               { 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
                 create a lot of idata* }
 
               { 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);
               while assigned(hp2) do
                 begin
                    objectlibrary.getlabel(tasmlabel(hp2.lab));
                    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
-                     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);
                 end;
               { 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 }
-              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);
               while assigned(hp2) do
                 begin
@@ -472,36 +472,36 @@ implementation
                       objectlibrary.getlabel(l5);
                     {$endif ARM}
                       { 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}
                       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}
                       if assigned(hp2.procdef) then
                         mangledstring:=hp2.procdef.mangledname
                       else
                         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}
                       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);
-                      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);
-                      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}
                       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}
 {$IfDef GDB}
                       if (cs_debuginfo in aktmoduleswitches) and assigned(hp2.procdef) then
-                        hp2.procdef.concatstabto(asmlist[importsection]);
+                        hp2.procdef.concatstabto(asmlist[al_imports]);
 {$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}
                       if (cs_debuginfo in aktmoduleswitches) then
                        begin
@@ -514,7 +514,7 @@ implementation
                                inc(suffix);
                                importname:='__imp_'+hp2.name^+'_'+tostr(suffix);
                              end;
-                            asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                            asmlist[al_imports].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                           end
                          else
                           begin
@@ -525,38 +525,38 @@ implementation
                                inc(suffix);
                                importname:='__imp_by_ordinal'+tostr(hp2.ordnr)+'_'+tostr(suffix);
                              end;
-                            asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                            asmlist[al_imports].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                           end;
                        end;
 {$endif GDB}
-                      asmlist[importsection].concat(Tai_label.Create(l4));
+                      asmlist[al_imports].concat(Tai_label.Create(l4));
                     end
                    else
                     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;
-                   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);
                 end;
               { finalize the addresses }
-              asmlist[importsection].concat(Tai_const.Create_32bit(0));
+              asmlist[al_imports].concat(Tai_const.Create_32bit(0));
 
               { 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);
               while assigned(hp2) do
                 begin
-                   asmlist[importsection].concat(Tai_label.Create(hp2.lab));
+                   asmlist[al_imports].concat(Tai_label.Create(hp2.lab));
                    { 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);
                 end;
               { 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);
            end;
@@ -569,8 +569,8 @@ implementation
 
     procedure texportlibwin32.preparelib(const s:string);
       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_nonindexed:=tList.Create;
          objectlibrary.getdatalabel(edatalabel);
@@ -734,38 +734,38 @@ implementation
          { we must also count the holes !! }
          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
            the .edata section }
-         asmlist[exportsection].concat(Tai_symbol.Create_global(edatalabel,0));
+         asmlist[al_exports].concat(Tai_symbol.Create_global(edatalabel,0));
          { export flags }
-         asmlist[exportsection].concat(Tai_const.Create_32bit(0));
+         asmlist[al_exports].concat(Tai_const.Create_32bit(0));
          { date/time stamp }
-         asmlist[exportsection].concat(Tai_const.Create_32bit(0));
+         asmlist[al_exports].concat(Tai_const.Create_32bit(0));
          { major version }
-         asmlist[exportsection].concat(Tai_const.Create_16bit(0));
+         asmlist[al_exports].concat(Tai_const.Create_16bit(0));
          { minor version }
-         asmlist[exportsection].concat(Tai_const.Create_16bit(0));
+         asmlist[al_exports].concat(Tai_const.Create_16bit(0));
          { 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 }
-         asmlist[exportsection].concat(Tai_const.Create_32bit(ordinal_base));
+         asmlist[al_exports].concat(Tai_const.Create_32bit(ordinal_base));
          { number of entries }
-         asmlist[exportsection].concat(Tai_const.Create_32bit(entries));
+         asmlist[al_exports].concat(Tai_const.Create_32bit(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 }
-         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 }
-         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 }
-         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 }
-         asmlist[exportsection].concat(Tai_label.Create(dll_name_label));
+         asmlist[al_exports].concat(Tai_label.Create(dll_name_label));
          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
-           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 }
          address_table:=TAAsmoutput.create;
@@ -834,10 +834,10 @@ implementation
               hp:=texported_item(hp.next);
            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;
          name_table_pointers.free;
          ordinal_table.free;
@@ -851,7 +851,7 @@ implementation
          p  : pchar;
          s  : string;
       begin
-         new_section(asmlist[exportsection],sec_code,'',0);
+         new_section(asmlist[al_exports],sec_code,'',0);
          hp:=texported_item(current_module._exports.first);
          while assigned(hp) do
            begin
@@ -866,7 +866,7 @@ implementation
                  s:='';
              end;
              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);
            end;
       end;

+ 10 - 17
compiler/x86/agx86int.pas

@@ -387,10 +387,10 @@ implementation
     begin
       if not assigned(p) then
        exit;
-      { lineinfo is only needed for codesegment (PFV) }
+      { lineinfo is only needed for al_code (PFV) }
       do_line:=((cs_asm_source in aktglobalswitches) or
                 (cs_lineinfo in aktmoduleswitches))
-                 and (p=asmlist[codesegment]);
+                 and (p=asmlist[al_code]);
       InlineLevel:=0;
       DoNotSplitLine:=false;
       hp:=tai(p.first);
@@ -851,6 +851,8 @@ implementation
 
 
     procedure tx86IntelAssembler.WriteAsmList;
+    var
+      hal : tasmlist;
     begin
 {$ifdef EXTDEBUG}
       if assigned(current_module.mainsource) then
@@ -872,21 +874,12 @@ implementation
 
       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');
       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));
 
                    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);
 
                    { I got these constant from a test program (FK) }
                    if is_double(resulttype.def) then
                      begin
                        { 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));
                      end
                    else if is_single(resulttype.def) then
                      begin
                        { 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));
                      end
                    else
@@ -359,11 +359,11 @@ implementation
 
                    exprasmlist.concat(taicpu.op_ref(A_FILD,S_IQ,left.location.reference));
                    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) }
-                   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);
                    exprasmlist.concat(Taicpu.Op_ref(A_FLD,S_FX,href));
                    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));
 
             objectlibrary.getdatalabel(l1);
-            asmlist[consts].concat(Tai_label.Create(l1));
+            asmlist[al_typedconsts].concat(Tai_label.Create(l1));
             case def_cgsize(resulttype.def) of
               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:
                 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
               else
                 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.