2
0
Эх сурвалжийг харах

* Group asmlists into array to be able to add
some of them more comfortably.
* x86_64 compilation was broken, fixed.
* Sparc compilation was broken, fixed.

git-svn-id: trunk@731 -

daniel 20 жил өмнө
parent
commit
d05f58b604

+ 7 - 9
compiler/aasmtai.pas

@@ -575,6 +575,12 @@ interface
           procedure InsertAfter(Item,Loc : TLinkedListItem);override;
           procedure InsertAfter(Item,Loc : TLinkedListItem);override;
        end;
        end;
 
 
+       Tasmlist=({ default lists }
+                 datasegment,codesegment,bsssegment,debuglist,consts,
+                 withdebuglist,importsection,exportsection,
+                 resourcesection,rttilist,dwarflist,
+                 { data used by pic code }
+                 picdata,resourcestrings);
 
 
     var
     var
       { array with all class types for tais }
       { array with all class types for tais }
@@ -592,15 +598,7 @@ interface
       { hook to notify uses of registers }
       { hook to notify uses of registers }
       add_reg_instruction_hook : tadd_reg_instruction_proc;
       add_reg_instruction_hook : tadd_reg_instruction_proc;
 
 
-      { default lists }
-      datasegment,codesegment,bsssegment,
-      debuglist,withdebuglist,consts,
-      importssection,exportssection,
-      resourcesection,rttilist,
-      dwarflist,
-      { data used by pic code }
-      picdata,
-      resourcestringlist         : taasmoutput;
+      asmlist:array[Tasmlist] of Taasmoutput;
 
 
       cai_align : tai_align_class;
       cai_align : tai_align_class;
       cai_cpu   : tai_cpu_class;
       cai_cpu   : tai_cpu_class;

+ 14 - 14
compiler/aggas.pas

@@ -369,7 +369,7 @@ var
       { lineinfo is only needed for codesegment (PFV) }
       { lineinfo is only needed for codesegment (PFV) }
       do_line:=(cs_asm_source in aktglobalswitches) or
       do_line:=(cs_asm_source in aktglobalswitches) or
                ((cs_lineinfo in aktmoduleswitches)
                ((cs_lineinfo in aktmoduleswitches)
-                 and (p=codesegment));
+                 and (p=asmlist[codesegment]));
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
        begin
        begin
@@ -968,21 +968,21 @@ var
       symendcount:=0;
       symendcount:=0;
 
 
       If (cs_debuginfo in aktmoduleswitches) then
       If (cs_debuginfo in aktmoduleswitches) then
-        WriteTree(debuglist);
-      WriteTree(codesegment);
-      WriteTree(datasegment);
-      WriteTree(consts);
-      WriteTree(rttilist);
-      WriteTree(picdata);
-      Writetree(resourcestringlist);
-      WriteTree(bsssegment);
-      Writetree(importssection);
+        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[importsection]);
       { exports are written by DLLTOOL
       { exports are written by DLLTOOL
         if we use it so don't insert it twice (PM) }
         if we use it so don't insert it twice (PM) }
-      if not UseDeffileForExports and assigned(exportssection) then
-        Writetree(exportssection);
-      Writetree(resourcesection);
-      Writetree(dwarflist);
+      if not UseDeffileForExports and assigned(asmlist[exportsection]) then
+        Writetree(asmlist[exportsection]);
+      Writetree(asmlist[resourcesection]);
+      Writetree(asmlist[dwarflist]);
       {$ifdef GDB}
       {$ifdef GDB}
       WriteFileEndInfo;
       WriteFileEndInfo;
       {$ENDIF}
       {$ENDIF}

+ 13 - 19
compiler/assemble.pas

@@ -1589,6 +1589,9 @@ Implementation
 
 
     procedure TInternalAssembler.MakeObject;
     procedure TInternalAssembler.MakeObject;
 
 
+    var to_do:set of Tasmlist;
+        i:Tasmlist;
+
         procedure addlist(p:TAAsmoutput);
         procedure addlist(p:TAAsmoutput);
         begin
         begin
           inc(lists);
           inc(lists);
@@ -1596,25 +1599,16 @@ Implementation
         end;
         end;
 
 
       begin
       begin
-        if cs_debuginfo in aktmoduleswitches then
-          addlist(debuglist);
-        addlist(codesegment);
-        addlist(datasegment);
-        addlist(consts);
-        addlist(rttilist);
-        addlist(picdata);
-        if assigned(resourcestringlist) then
-          addlist(resourcestringlist);
-        addlist(bsssegment);
-        if assigned(importssection) then
-          addlist(importssection);
-        if assigned(exportssection) and not UseDeffileForExports then
-          addlist(exportssection);
-        if assigned(resourcesection) then
-          addlist(resourcesection);
-{$warning TODO internal writer support for dwarf}
-        {if assigned(dwarflist) then
-          addlist(dwarflist);}
+        to_do:=[low(Tasmlist)..high(Tasmlist)];
+        if not(cs_debuginfo in aktmoduleswitches) then
+          exclude(to_do,debuglist);
+        if usedeffileforexports then
+          exclude(to_do,exportsection);
+        {$warning TODO internal writer support for dwarf}
+        exclude(to_do,dwarflist);
+        for i:=low(Tasmlist) to high(Tasmlist) do
+          if (i in to_do) and (asmlist[i]<>nil) then
+            addlist(asmlist[i]);
 
 
         if SmartAsm then
         if SmartAsm then
           writetreesmart
           writetreesmart

+ 32 - 30
compiler/cresstr.pas

@@ -141,61 +141,63 @@ procedure TResourceStrings.CreateResourceStringList;
     s : pchar;
     s : pchar;
     l : longint;
     l : longint;
   begin
   begin
-    With P Do
+    with p Do
      begin
      begin
        if (Value=nil) or (len=0) then
        if (Value=nil) or (len=0) then
-         resourcestringlist.concat(tai_const.create_sym(nil))
+         asmlist[aasmtai.resourcestrings].concat(tai_const.create_sym(nil))
        else
        else
          begin
          begin
             objectlibrary.getdatalabel(l1);
             objectlibrary.getdatalabel(l1);
-            resourcestringlist.concat(tai_const.create_sym(l1));
-            maybe_new_object_file(consts);
-            consts.concat(tai_align.Create(const_align(sizeof(aint))));
-            consts.concat(tai_const.create_aint(-1));
-            consts.concat(tai_const.create_aint(len));
-            consts.concat(tai_label.create(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));
             getmem(s,len+1);
             getmem(s,len+1);
-            move(Value^,s^,len);
+            move(value^,s^,len);
             s[len]:=#0;
             s[len]:=#0;
-            consts.concat(tai_string.create_length_pchar(s,len));
-            consts.concat(tai_const.create_8bit(0));
+            asmlist[consts].concat(tai_string.create_length_pchar(s,len));
+            asmlist[consts].concat(tai_const.create_8bit(0));
          end;
          end;
        { append Current value (nil) and hash...}
        { append Current value (nil) and hash...}
-       resourcestringlist.concat(tai_const.create_sym(nil));
-       resourcestringlist.concat(tai_const.create_32bit(longint(hash)));
+       asmlist[aasmtai.resourcestrings].concat(tai_const.create_sym(nil));
+       asmlist[aasmtai.resourcestrings].concat(tai_const.create_32bit(longint(hash)));
        { Append the name as a ansistring. }
        { Append the name as a ansistring. }
        objectlibrary.getdatalabel(l1);
        objectlibrary.getdatalabel(l1);
-       L:=Length(Name);
-       resourcestringlist.concat(tai_const.create_sym(l1));
-       maybe_new_object_file(consts);
-       consts.concat(tai_align.Create(const_align(sizeof(aint))));
-       consts.concat(tai_const.create_aint(-1));
-       consts.concat(tai_const.create_aint(l));
-       consts.concat(tai_label.create(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));
        getmem(s,l+1);
        getmem(s,l+1);
        move(Name[1],s^,l);
        move(Name[1],s^,l);
        s[l]:=#0;
        s[l]:=#0;
-       consts.concat(tai_string.create_length_pchar(s,l));
-       consts.concat(tai_const.create_8bit(0));
+       asmlist[consts].concat(tai_string.create_length_pchar(s,l));
+       asmlist[consts].concat(tai_const.create_8bit(0));
      end;
      end;
   end;
   end;
 
 
 Var
 Var
   R : tresourceStringItem;
   R : tresourceStringItem;
 begin
 begin
-  if not(assigned(resourcestringlist)) then
-    resourcestringlist:=taasmoutput.create;
-  maybe_new_object_file(resourcestringlist);
-  resourcestringlist.concat(tai_align.Create(const_align(sizeof(aint))));
-  resourcestringlist.concat(tai_symbol.createname_global(make_mangledname('RESOURCESTRINGLIST',current_module.localsymtable,''),AT_DATA,0));
-  resourcestringlist.concat(tai_const.create_32bit(resstrcount));
+  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(
+    make_mangledname('RESOURCESTRINGLIST',current_module.localsymtable,''),AT_DATA,0));
+  asmlist[aasmtai.resourcestrings].concat(tai_const.create_32bit(resstrcount));
   R:=TResourceStringItem(List.First);
   R:=TResourceStringItem(List.First);
-  While assigned(R) do
+  while assigned(R) do
    begin
    begin
      AppendToAsmResList(R);
      AppendToAsmResList(R);
      R:=TResourceStringItem(R.Next);
      R:=TResourceStringItem(R.Next);
    end;
    end;
-  resourcestringlist.concat(tai_symbol_end.createname(current_module.modulename^+'_'+'RESOURCESTRINGLIST'));
+  asmlist[aasmtai.resourcestrings].concat(tai_symbol_end.createname(
+    current_module.modulename^+'_'+'RESOURCESTRINGLIST'));
 end;
 end;
 
 
 
 

+ 11 - 11
compiler/i386/ag386nsm.pas

@@ -401,7 +401,7 @@ interface
       { lineinfo is only needed for codesegment (PFV) }
       { lineinfo is only needed for codesegment (PFV) }
       do_line:=(cs_asm_source in aktglobalswitches) or
       do_line:=(cs_asm_source in aktglobalswitches) or
                ((cs_lineinfo in aktmoduleswitches)
                ((cs_lineinfo in aktmoduleswitches)
-                 and (p=codesegment));
+                 and (p=asmlist[codesegment]));
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
        begin
        begin
@@ -797,18 +797,18 @@ interface
     { Nasm doesn't support stabs
     { Nasm doesn't support stabs
       WriteTree(debuglist);}
       WriteTree(debuglist);}
 
 
-      WriteTree(codesegment);
-      WriteTree(datasegment);
-      WriteTree(consts);
-      WriteTree(rttilist);
-      WriteTree(resourcestringlist);
-      WriteTree(bsssegment);
-      Writetree(importssection);
+      WriteTree(asmlist[codesegment]);
+      WriteTree(asmlist[datasegment]);
+      WriteTree(asmlist[consts]);
+      WriteTree(asmlist[rttilist]);
+      WriteTree(asmlist[resourcestrings]);
+      WriteTree(asmlist[bsssegment]);
+      Writetree(asmlist[importsection]);
       { exports are written by DLLTOOL
       { exports are written by DLLTOOL
         if we use it so don't insert it twice (PM) }
         if we use it so don't insert it twice (PM) }
-      if not UseDeffileForExports and assigned(exportssection) then
-        Writetree(exportssection);
-      Writetree(resourcesection);
+      if not UseDeffileForExports and assigned(asmlist[exportsection]) then
+        Writetree(asmlist[exportsection]);
+      Writetree(asmlist[resourcesection]);
 
 
       AsmLn;
       AsmLn;
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}

+ 1 - 1
compiler/i386/n386set.pas

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

+ 58 - 65
compiler/ncgcon.pas

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

+ 16 - 16
compiler/ncgutil.pas

@@ -1784,7 +1784,7 @@ implementation
                 strpcopy(strend(p),'-');
                 strpcopy(strend(p),'-');
                 strpcopy(strend(p),current_procinfo.procdef.mangledname);
                 strpcopy(strend(p),current_procinfo.procdef.mangledname);
               end;
               end;
-            list.concatlist(withdebuglist);
+            list.concatlist(asmlist[withdebuglist]);
             list.concat(Tai_stabn.Create(strnew(p)));
             list.concat(Tai_stabn.Create(strnew(p)));
              { strpnew('224,0,0,'
              { strpnew('224,0,0,'
              +current_procinfo.procdef.mangledname+'_end'))));}
              +current_procinfo.procdef.mangledname+'_end'))));}
@@ -1939,9 +1939,9 @@ implementation
         storefilepos:=aktfilepos;
         storefilepos:=aktfilepos;
         aktfilepos:=sym.fileinfo;
         aktfilepos:=sym.fileinfo;
         if sym.is_writable then
         if sym.is_writable then
-          curconstsegment:=datasegment
+          curconstsegment:=asmlist[datasegment]
         else
         else
-          curconstsegment:=consts;
+          curconstsegment:=asmlist[consts];
         l:=sym.getsize;
         l:=sym.getsize;
         { insert cut for smartlinking or alignment }
         { insert cut for smartlinking or alignment }
         maybe_new_object_file(curconstSegment);
         maybe_new_object_file(curconstSegment);
@@ -1973,11 +1973,11 @@ implementation
         if (vo_is_thread_var in sym.varoptions) then
         if (vo_is_thread_var in sym.varoptions) then
           inc(l,sizeof(aint));
           inc(l,sizeof(aint));
         varalign:=var_align(l);
         varalign:=var_align(l);
-        maybe_new_object_file(bssSegment);
-        new_section(bssSegment,sec_bss,lower(sym.mangledname),varalign);
+        maybe_new_object_file(asmlist[bsssegment]);
+        new_section(asmlist[bsssegment],sec_bss,lower(sym.mangledname),varalign);
 {$ifdef GDB}
 {$ifdef GDB}
         if (cs_debuginfo in aktmoduleswitches) then
         if (cs_debuginfo in aktmoduleswitches) then
-          sym.concatstabto(bssSegment);
+          sym.concatstabto(asmlist[bsssegment]);
 {$endif GDB}
 {$endif GDB}
         if (sym.owner.symtabletype=globalsymtable) or
         if (sym.owner.symtabletype=globalsymtable) or
            maybe_smartlink_symbol or
            maybe_smartlink_symbol or
@@ -1986,9 +1986,9 @@ implementation
             (po_inline in current_procinfo.procdef.procoptions)) or
             (po_inline in current_procinfo.procdef.procoptions)) or
            (vo_is_exported in sym.varoptions) or
            (vo_is_exported in sym.varoptions) or
            (vo_is_C_var in sym.varoptions) then
            (vo_is_C_var in sym.varoptions) then
-          bssSegment.concat(Tai_datablock.Create_global(sym.mangledname,l))
+          asmlist[bsssegment].concat(Tai_datablock.Create_global(sym.mangledname,l))
         else
         else
-          bssSegment.concat(Tai_datablock.Create(sym.mangledname,l));
+          asmlist[bsssegment].concat(Tai_datablock.Create(sym.mangledname,l));
         aktfilepos:=storefilepos;
         aktfilepos:=storefilepos;
       end;
       end;
 
 
@@ -2333,11 +2333,11 @@ implementation
            def.rttitablesym:=rsym;
            def.rttitablesym:=rsym;
            { write rtti data }
            { write rtti data }
            def.write_child_rtti_data(fullrtti);
            def.write_child_rtti_data(fullrtti);
-           maybe_new_object_file(rttilist);
-           new_section(rttilist,sec_rodata,rsym.get_label.name,const_align(sizeof(aint)));
-           rttiList.concat(Tai_symbol.Create_global(rsym.get_label,0));
+           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));
            def.write_rtti_data(fullrtti);
            def.write_rtti_data(fullrtti);
-           rttiList.concat(Tai_symbol_end.Create(rsym.get_label));
+           asmlist[rttilist].concat(Tai_symbol_end.Create(rsym.get_label));
          end;
          end;
       end;
       end;
 
 
@@ -2373,11 +2373,11 @@ implementation
            def.inittablesym:=rsym;
            def.inittablesym:=rsym;
            { write inittable data }
            { write inittable data }
            def.write_child_rtti_data(initrtti);
            def.write_child_rtti_data(initrtti);
-           maybe_new_object_file(rttilist);
-           new_section(rttilist,sec_rodata,rsym.get_label.name,const_align(sizeof(aint)));
-           rttiList.concat(Tai_symbol.Create_global(rsym.get_label,0));
+           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));
            def.write_rtti_data(initrtti);
            def.write_rtti_data(initrtti);
-           rttiList.concat(Tai_symbol_end.Create(rsym.get_label));
+           asmlist[rttilist].concat(Tai_symbol_end.Create(rsym.get_label));
          end;
          end;
       end;
       end;
 
 

+ 77 - 77
compiler/nobj.pas

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

+ 24 - 71
compiler/parser.pas

@@ -245,61 +245,47 @@ implementation
 *****************************************************************************}
 *****************************************************************************}
 
 
     procedure init_module;
     procedure init_module;
+
+      var to_create:set of Tasmlist;
+          i:Tasmlist;
       begin
       begin
-         { Create assembler output lists for CG }
          exprasmlist:=taasmoutput.create;
          exprasmlist:=taasmoutput.create;
-         datasegment:=taasmoutput.create;
-         codesegment:=taasmoutput.create;
-         bsssegment:=taasmoutput.create;
-         debuglist:=taasmoutput.create;
-         withdebuglist:=taasmoutput.create;
-         consts:=taasmoutput.create;
-         rttilist:=taasmoutput.create;
-         picdata:=taasmoutput.create;
+         { Create assembler output lists for CG }
+         to_create:=[datasegment,codesegment,bsssegment,debuglist,
+                     withdebuglist,consts,rttilist,picdata];
+         for i:=low(Tasmlist) to high(Tasmlist) do
+           if i in to_create then
+             asmlist[i]:=Taasmoutput.create
+           else
+             asmlist[i]:=nil;
+
          if target_info.system=system_powerpc_darwin then
          if target_info.system=system_powerpc_darwin then
-           picdata.concat(tai_simple.create(ait_non_lazy_symbol_pointer));
-         ResourceStringList:=Nil;
-         importssection:=nil;
-         exportssection:=nil;
-         resourcesection:=nil;
+           asmlist[picdata].concat(tai_simple.create(ait_non_lazy_symbol_pointer));
          { Resource strings }
          { Resource strings }
-         ResourceStrings:=TResourceStrings.Create;
+         cresstr.ResourceStrings:=TResourceStrings.Create;
          { use the librarydata from current_module }
          { use the librarydata from current_module }
          objectlibrary:=current_module.librarydata;
          objectlibrary:=current_module.librarydata;
       end;
       end;
 
 
 
 
     procedure done_module;
     procedure done_module;
-{$ifdef MEMDEBUG}
       var
       var
+{$ifdef MEMDEBUG}
         d : tmemdebug;
         d : tmemdebug;
 {$endif}
 {$endif}
+        i:Tasmlist;
       begin
       begin
 {$ifdef MEMDEBUG}
 {$ifdef MEMDEBUG}
          d:=tmemdebug.create(current_module.modulename^+' - asmlists');
          d:=tmemdebug.create(current_module.modulename^+' - asmlists');
 {$endif}
 {$endif}
-         exprasmlist.free;
-         codesegment.free;
-         bsssegment.free;
-         datasegment.free;
-         debuglist.free;
-         withdebuglist.free;
-         consts.free;
-         rttilist.free;
-         picdata.free;
-         if assigned(ResourceStringList) then
-          ResourceStringList.free;
-         if assigned(importssection) then
-          importssection.free;
-         if assigned(exportssection) then
-          exportssection.free;
-         if assigned(resourcesection) then
-          resourcesection.free;
+         for i:=low(Tasmlist) to high(Tasmlist) do
+           if asmlist[i]<>nil then
+             asmlist[i].free;
 {$ifdef MEMDEBUG}
 {$ifdef MEMDEBUG}
          d.free;
          d.free;
 {$endif}
 {$endif}
          { resource strings }
          { resource strings }
-         ResourceStrings.free;
+         cresstr.resourcestrings.free;
          objectlibrary:=nil;
          objectlibrary:=nil;
       end;
       end;
 
 
@@ -330,19 +316,8 @@ implementation
         { cg }
         { cg }
           oldparse_only  : boolean;
           oldparse_only  : boolean;
         { asmlists }
         { asmlists }
-          oldimports,
-          oldexports,
-          oldresource,
-          oldrttilist,
-          oldpicdata,
-          oldresourcestringlist,
-          oldbsssegment,
-          olddatasegment,
-          oldcodesegment,
-          oldexprasmlist,
-          olddebuglist,
-          oldwithdebuglist,
-          oldconsts     : taasmoutput;
+          oldexprasmlist:Taasmoutput;
+          oldasmlist:array[Tasmlist] of Taasmoutput;
           oldobjectlibrary : tasmlibrarydata;
           oldobjectlibrary : tasmlibrarydata;
         { resourcestrings }
         { resourcestrings }
           OldResourceStrings : tResourceStrings;
           OldResourceStrings : tResourceStrings;
@@ -402,19 +377,8 @@ implementation
           { save cg }
           { save cg }
             oldparse_only:=parse_only;
             oldparse_only:=parse_only;
           { save assembler lists }
           { save assembler lists }
-            olddatasegment:=datasegment;
-            oldbsssegment:=bsssegment;
-            oldcodesegment:=codesegment;
-            olddebuglist:=debuglist;
-            oldwithdebuglist:=withdebuglist;
-            oldconsts:=consts;
-            oldrttilist:=rttilist;
-            oldpicdata:=picdata;
+            oldasmlist:=asmlist;
             oldexprasmlist:=exprasmlist;
             oldexprasmlist:=exprasmlist;
-            oldimports:=importssection;
-            oldexports:=exportssection;
-            oldresource:=resourcesection;
-            oldresourcestringlist:=resourcestringlist;
             oldobjectlibrary:=objectlibrary;
             oldobjectlibrary:=objectlibrary;
             OldResourceStrings:=ResourceStrings;
             OldResourceStrings:=ResourceStrings;
           { save akt... state }
           { save akt... state }
@@ -577,18 +541,7 @@ implementation
                    parse_only:=oldparse_only;
                    parse_only:=oldparse_only;
                    { restore asmlists }
                    { restore asmlists }
                    exprasmlist:=oldexprasmlist;
                    exprasmlist:=oldexprasmlist;
-                   datasegment:=olddatasegment;
-                   bsssegment:=oldbsssegment;
-                   codesegment:=oldcodesegment;
-                   consts:=oldconsts;
-                   debuglist:=olddebuglist;
-                   withdebuglist:=oldwithdebuglist;
-                   importssection:=oldimports;
-                   exportssection:=oldexports;
-                   resourcesection:=oldresource;
-                   rttilist:=oldrttilist;
-                   picdata:=oldpicdata;
-                   resourcestringlist:=oldresourcestringlist;
+                   asmlist:=oldasmlist;
                    { object data }
                    { object data }
                    ResourceStrings:=OldResourceStrings;
                    ResourceStrings:=OldResourceStrings;
                    objectlibrary:=oldobjectlibrary;
                    objectlibrary:=oldobjectlibrary;

+ 53 - 53
compiler/pmodules.pas

@@ -84,10 +84,10 @@ implementation
            { Recreate import section }
            { Recreate import section }
            if (target_info.system in [system_i386_win32,system_i386_wdosx]) then
            if (target_info.system in [system_i386_win32,system_i386_wdosx]) then
             begin
             begin
-              if assigned(importssection)then
-               importssection.clear
+              if assigned(asmlist[importsection]) then
+               asmlist[importsection].clear
               else
               else
-               importssection:=taasmoutput.Create;
+               asmlist[importsection]:=taasmoutput.Create;
               importlib.generatelib;
               importlib.generatelib;
             end;
             end;
            { Readd the not processed files }
            { Readd the not processed files }
@@ -106,10 +106,10 @@ implementation
         if (cs_create_smart in aktmoduleswitches) then
         if (cs_create_smart in aktmoduleswitches) then
          begin
          begin
            { regenerate the importssection for win32 }
            { regenerate the importssection for win32 }
-           if assigned(importssection) and
+           if assigned(asmlist[importsection]) and
               (target_info.system in [system_i386_win32,system_i386_wdosx, system_arm_wince,system_i386_wince]) then
               (target_info.system in [system_i386_win32,system_i386_wdosx, system_arm_wince,system_i386_wince]) then
             begin
             begin
-              importsSection.clear;
+              asmlist[importsection].clear;
               importlib.generatesmartlib;
               importlib.generatesmartlib;
             end;
             end;
 
 
@@ -139,11 +139,11 @@ implementation
 
 
     procedure create_dwarf;
     procedure create_dwarf;
       begin
       begin
-        dwarflist:=taasmoutput.create;
+        asmlist[dwarflist]:=taasmoutput.create;
         { Call frame information }
         { Call frame information }
         if (tf_needs_dwarf_cfi in target_info.flags) and
         if (tf_needs_dwarf_cfi in target_info.flags) and
            (af_supports_dwarf in target_asm.flags) then
            (af_supports_dwarf in target_asm.flags) then
-          dwarfcfi.generate_code(dwarflist);
+          dwarfcfi.generate_code(asmlist[dwarflist]);
       end;
       end;
 
 
 
 
@@ -160,31 +160,31 @@ implementation
            then
            then
          begin
          begin
            { align the first data }
            { align the first data }
-           dataSegment.insert(Tai_align.Create(const_align(32)));
-           dataSegment.insert(Tai_string.Create('FPC '+full_version_string+
+           asmlist[datasegment].insert(Tai_align.Create(const_align(32)));
+           asmlist[datasegment].insert(Tai_string.Create('FPC '+full_version_string+
              ' ['+date_string+'] for '+target_cpu_string+' - '+target_info.shortname));
              ' ['+date_string+'] for '+target_cpu_string+' - '+target_info.shortname));
          end;
          end;
         { align code segment }
         { align code segment }
-        codeSegment.concat(Tai_align.Create(aktalignment.procalign));
+        asmlist[codesegment].concat(Tai_align.Create(aktalignment.procalign));
         { Insert start and end of sections }
         { Insert start and end of sections }
-        fixseg(codesegment,sec_code,'____seg_code');
-        fixseg(datasegment,sec_data,'____seg_data');
-        fixseg(bsssegment,sec_bss,'____seg_bss');
+        fixseg(asmlist[codesegment],sec_code,'____seg_code');
+        fixseg(asmlist[datasegment],sec_data,'____seg_data');
+        fixseg(asmlist[bsssegment],sec_bss,'____seg_bss');
         { we should use .rdata section for these two no ?
         { we should use .rdata section for these two no ?
           .rdata is a read only data section (PM) }
           .rdata is a read only data section (PM) }
-        fixseg(rttilist,sec_data,'____seg_rtti');
-        fixseg(consts,sec_data,'____seg_consts');
-        fixseg(picdata,sec_data,'____seg_picdata');
-        if assigned(resourcestringlist) then
-          fixseg(resourcestringlist,sec_data,'____seg_resstrings');
+        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');
 {$ifdef GDB}
 {$ifdef GDB}
-        if assigned(debuglist) then
+        if assigned(asmlist[debuglist]) then
           begin
           begin
             oldaktfilepos:=aktfilepos;
             oldaktfilepos:=aktfilepos;
             aktfilepos.line:=0;
             aktfilepos.line:=0;
-            debugList.insert(Tai_symbol.Createname('gcc2_compiled',AT_DATA,0));
-            debugList.insert(Tai_symbol.Createname('fpc_compiled',AT_DATA,0));
-            fixseg(debuglist,sec_code,'____seg_debug');
+            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');
             aktfilepos:=oldaktfilepos;
             aktfilepos:=oldaktfilepos;
           end;
           end;
 {$endif GDB}
 {$endif GDB}
@@ -221,8 +221,8 @@ implementation
         ltvTables.insert(Tai_align.Create(const_align(sizeof(aint))));
         ltvTables.insert(Tai_align.Create(const_align(sizeof(aint))));
         ltvTables.concat(Tai_symbol_end.Createname('FPC_THREADVARTABLES'));
         ltvTables.concat(Tai_symbol_end.Createname('FPC_THREADVARTABLES'));
         { insert in data segment }
         { insert in data segment }
-        maybe_new_object_file(dataSegment);
-        dataSegment.concatlist(ltvTables);
+        maybe_new_object_file(asmlist[datasegment]);
+        asmlist[datasegment].concatlist(ltvTables);
         ltvTables.free;
         ltvTables.free;
       end;
       end;
 
 
@@ -260,8 +260,8 @@ implementation
             ltvTable.insert(Tai_align.Create(const_align(32)));
             ltvTable.insert(Tai_align.Create(const_align(32)));
             ltvTable.concat(tai_const.create_sym(nil));  { end of list marker }
             ltvTable.concat(tai_const.create_sym(nil));  { end of list marker }
             ltvTable.concat(tai_symbol_end.createname(s));
             ltvTable.concat(tai_symbol_end.createname(s));
-            maybe_new_object_file(dataSegment);
-            dataSegment.concatlist(ltvTable);
+            maybe_new_object_file(asmlist[datasegment]);
+            asmlist[datasegment].concatlist(ltvTable);
             current_module.flags:=current_module.flags or uf_threadvars;
             current_module.flags:=current_module.flags or uf_threadvars;
           end;
           end;
          ltvTable.Free;
          ltvTable.Free;
@@ -287,7 +287,7 @@ implementation
            hp:=tused_unit(hp.next);
            hp:=tused_unit(hp.next);
          end;
          end;
         { Add program resources, if any }
         { Add program resources, if any }
-        If ResourceStringList<>Nil then
+        if asmlist[aasmtai.resourcestrings]<>nil then
          begin
          begin
            ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESOURCESTRINGLIST',current_module.localsymtable,''),AT_DATA,0));
            ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESOURCESTRINGLIST',current_module.localsymtable,''),AT_DATA,0));
            Inc(Count);
            Inc(Count);
@@ -298,8 +298,8 @@ implementation
         ResourceStringTables.insert(Tai_align.Create(const_align(4)));
         ResourceStringTables.insert(Tai_align.Create(const_align(4)));
         ResourceStringTables.concat(Tai_symbol_end.Createname('FPC_RESOURCESTRINGTABLES'));
         ResourceStringTables.concat(Tai_symbol_end.Createname('FPC_RESOURCESTRINGTABLES'));
         { insert in data segment }
         { insert in data segment }
-        maybe_new_object_file(dataSegment);
-        dataSegment.concatlist(ResourceStringTables);
+        maybe_new_object_file(asmlist[datasegment]);
+        asmlist[datasegment].concatlist(ResourceStringTables);
         ResourceStringTables.free;
         ResourceStringTables.free;
       end;
       end;
 
 
@@ -350,8 +350,8 @@ implementation
         unitinits.insert(Tai_align.Create(const_align(4)));
         unitinits.insert(Tai_align.Create(const_align(4)));
         unitinits.concat(Tai_symbol_end.Createname('INITFINAL'));
         unitinits.concat(Tai_symbol_end.Createname('INITFINAL'));
         { insert in data segment }
         { insert in data segment }
-        maybe_new_object_file(dataSegment);
-        dataSegment.concatlist(unitinits);
+        maybe_new_object_file(asmlist[datasegment]);
+        asmlist[datasegment].concatlist(unitinits);
         unitinits.free;
         unitinits.free;
       end;
       end;
 
 
@@ -359,11 +359,11 @@ implementation
     procedure insertmemorysizes;
     procedure insertmemorysizes;
       begin
       begin
         { stacksize can be specified and is now simulated }
         { stacksize can be specified and is now simulated }
-        dataSegment.concat(Tai_align.Create(const_align(4)));
-        dataSegment.concat(Tai_symbol.Createname_global('__stklen',AT_DATA,4));
-        dataSegment.concat(Tai_const.Create_32bit(stacksize));
-        dataSegment.concat(Tai_symbol.Createname_global('__heapsize',AT_DATA,4));
-        dataSegment.concat(Tai_const.Create_32bit(heapsize));
+        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));
       end;
       end;
 
 
 
 
@@ -658,7 +658,7 @@ implementation
                    dependent stabs }
                    dependent stabs }
                  write_used_unit_type_info(pu.u);
                  write_used_unit_type_info(pu.u);
                  if assigned(pu.u.globalsymtable) then
                  if assigned(pu.u.globalsymtable) then
-                   tglobalsymtable(pu.u.globalsymtable).concattypestabto(debuglist);
+                   tglobalsymtable(pu.u.globalsymtable).concattypestabto(asmlist[debuglist]);
                end;
                end;
              pu:=tused_unit(pu.next);
              pu:=tused_unit(pu.next);
            end;
            end;
@@ -677,10 +677,10 @@ implementation
         if current_module.is_unit then
         if current_module.is_unit then
           begin
           begin
             current_module.flags:=current_module.flags or uf_has_debuginfo;
             current_module.flags:=current_module.flags or uf_has_debuginfo;
-            debugList.concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.globalsymtable,''),AT_DATA,0));
+            asmlist[debuglist].concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.globalsymtable,''),AT_DATA,0));
           end
           end
         else
         else
-          debugList.concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.localsymtable,''),AT_DATA,0));
+          asmlist[debuglist].concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.localsymtable,''),AT_DATA,0));
         { first write all global/local symbols again to a temp list. This will flag
         { first write all global/local symbols again to a temp list. This will flag
           all required tdefs. After that the temp list can be removed since the debuginfo is already
           all required tdefs. After that the temp list can be removed since the debuginfo is already
           written to the stabs when the variables/consts were written }
           written to the stabs when the variables/consts were written }
@@ -698,16 +698,16 @@ implementation
         write_used_unit_type_info(current_module);
         write_used_unit_type_info(current_module);
         { last write the types from this unit }
         { last write the types from this unit }
         if assigned(current_module.globalsymtable) then
         if assigned(current_module.globalsymtable) then
-          tglobalsymtable(current_module.globalsymtable).concattypestabto(debuglist);
+          tglobalsymtable(current_module.globalsymtable).concattypestabto(asmlist[debuglist]);
         if assigned(current_module.localsymtable) then
         if assigned(current_module.localsymtable) then
-          tstaticsymtable(current_module.localsymtable).concattypestabto(debuglist);
+          tstaticsymtable(current_module.localsymtable).concattypestabto(asmlist[debuglist]);
         { include files }
         { include files }
         if (cs_gdb_dbx in aktglobalswitches) then
         if (cs_gdb_dbx in aktglobalswitches) then
           begin
           begin
-            debugList.concat(tai_comment.Create(strpnew('EINCL of global '+
+            asmlist[debuglist].concat(tai_comment.Create(strpnew('EINCL of global '+
               tglobalsymtable(current_module.globalsymtable).name^+' has index '+
               tglobalsymtable(current_module.globalsymtable).name^+' has index '+
               tostr(tglobalsymtable(current_module.globalsymtable).moduleid))));
               tostr(tglobalsymtable(current_module.globalsymtable).moduleid))));
-            debugList.concat(Tai_stabs.Create(strpnew('"'+
+            asmlist[debuglist].concat(Tai_stabs.Create(strpnew('"'+
               tglobalsymtable(current_module.globalsymtable).name^+'",'+
               tglobalsymtable(current_module.globalsymtable).name^+'",'+
               tostr(N_EINCL)+',0,0,0')));
               tostr(N_EINCL)+',0,0,0')));
             tglobalsymtable(current_module.globalsymtable).dbx_count_ok:={true}false;
             tglobalsymtable(current_module.globalsymtable).dbx_count_ok:={true}false;
@@ -909,12 +909,12 @@ implementation
       begin
       begin
         is_assembler_generated:=(Errorcount=0) and
         is_assembler_generated:=(Errorcount=0) and
           not(
           not(
-          codeSegment.empty and
-          dataSegment.empty and
-          bssSegment.empty and
-          ((importssection=nil) or importsSection.empty) and
-          ((resourcesection=nil) or resourceSection.empty) and
-          ((resourcestringlist=nil) or resourcestringList.empty)
+          asmlist[codesegment].empty and
+          asmlist[datasegment].empty and
+          asmlist[bsssegment].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)
         );
         );
       end;
       end;
 
 
@@ -1244,8 +1244,8 @@ implementation
 {$endif GDB}
 {$endif GDB}
 
 
          { generate wrappers for interfaces }
          { generate wrappers for interfaces }
-         gen_intf_wrappers(codesegment,current_module.globalsymtable);
-         gen_intf_wrappers(codesegment,current_module.localsymtable);
+         gen_intf_wrappers(asmlist[codesegment],current_module.globalsymtable);
+         gen_intf_wrappers(asmlist[codesegment],current_module.localsymtable);
 
 
          { generate a list of threadvars }
          { generate a list of threadvars }
          InsertThreadvars;
          InsertThreadvars;
@@ -1491,7 +1491,7 @@ implementation
          if assigned(exportlib) and
          if assigned(exportlib) and
             (target_info.system in [system_i386_win32,system_i386_wdosx]) and
             (target_info.system in [system_i386_win32,system_i386_wdosx]) and
             BinaryContainsExports then
             BinaryContainsExports then
-           codesegment.concat(tai_const.create_sym(exportlib.edatalabel));
+           asmlist[codesegment].concat(tai_const.create_sym(exportlib.edatalabel));
 
 
          If ResourceStrings.ResStrCount>0 then
          If ResourceStrings.ResStrCount>0 then
           begin
           begin
@@ -1559,7 +1559,7 @@ implementation
 {$endif GDB}
 {$endif GDB}
 
 
          { generate wrappers for interfaces }
          { generate wrappers for interfaces }
-         gen_intf_wrappers(codesegment,current_module.localsymtable);
+         gen_intf_wrappers(asmlist[codesegment],current_module.localsymtable);
 
 
          { generate a list of threadvars }
          { generate a list of threadvars }
          InsertThreadvars;
          InsertThreadvars;

+ 7 - 7
compiler/powerpc/agppcmpw.pas

@@ -803,7 +803,7 @@ var
       { lineinfo is only needed for codesegment (PFV) }
       { lineinfo is only needed for codesegment (PFV) }
       do_line:=((cs_asm_source in aktglobalswitches) or
       do_line:=((cs_asm_source in aktglobalswitches) or
                 (cs_lineinfo in aktmoduleswitches))
                 (cs_lineinfo in aktmoduleswitches))
-                 and (p=codesegment);
+                 and (p=asmlist[codesegment]);
       DoNotSplitLine:=false;
       DoNotSplitLine:=false;
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
@@ -1420,12 +1420,12 @@ var
       If (cs_debuginfo in aktmoduleswitches) then
       If (cs_debuginfo in aktmoduleswitches) then
         WriteTree(debuglist);
         WriteTree(debuglist);
 *)
 *)
-      WriteTree(codesegment);
-      WriteTree(datasegment);
-      WriteTree(consts);
-      WriteTree(rttilist);
-      WriteTree(resourcestringlist);
-      WriteTree(bsssegment);
+      WriteTree(asmlist[codesegment]);
+      WriteTree(asmlist[datasegment]);
+      WriteTree(asmlist[consts]);
+      WriteTree(asmlist[rttilist]);
+      WriteTree(asmlist[resourcestrings]);
+      WriteTree(asmlist[bsssegment]);
       {$ifdef GDB}
       {$ifdef GDB}
       WriteFileEndInfo;
       WriteFileEndInfo;
       {$ENDIF}
       {$ENDIF}

+ 17 - 19
compiler/powerpc/cgcpu.pas

@@ -364,33 +364,33 @@ const
         if assigned(result) then
         if assigned(result) then
           exit;
           exit;
 
 
-        if not(assigned(importssection)) then
-          importssection:=TAAsmoutput.create;
+        if asmlist[importsection]=nil then
+          asmlist[importsection]:=TAAsmoutput.create;
 
 
-        importsSection.concat(Tai_section.Create(sec_data,'',0));
-        importsSection.concat(Tai_direct.create(strpnew('.section __TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16')));
-        importsSection.concat(Tai_align.Create(4));
+        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));
         result := objectlibrary.newasmsymbol(stubname,AB_EXTERNAL,AT_FUNCTION);
         result := objectlibrary.newasmsymbol(stubname,AB_EXTERNAL,AT_FUNCTION);
-        importsSection.concat(Tai_symbol.Create(result,0));
-        importsSection.concat(Tai_direct.create(strpnew((#9+'.indirect_symbol ')+s)));
+        asmlist[importsection].concat(Tai_symbol.Create(result,0));
+        asmlist[importsection].concat(Tai_direct.create(strpnew((#9+'.indirect_symbol ')+s)));
         l1 := objectlibrary.newasmsymbol('L'+s+'$lazy_ptr',AB_EXTERNAL,AT_FUNCTION);
         l1 := objectlibrary.newasmsymbol('L'+s+'$lazy_ptr',AB_EXTERNAL,AT_FUNCTION);
         reference_reset_symbol(href,l1,0);
         reference_reset_symbol(href,l1,0);
 {$ifdef powerpc}
 {$ifdef powerpc}
         href.refaddr := addr_hi;
         href.refaddr := addr_hi;
-        importsSection.concat(taicpu.op_reg_ref(A_LIS,NR_R11,href));
+        asmlist[importsection].concat(taicpu.op_reg_ref(A_LIS,NR_R11,href));
         href.refaddr := addr_lo;
         href.refaddr := addr_lo;
         href.base := NR_R11;
         href.base := NR_R11;
-        importsSection.concat(taicpu.op_reg_ref(A_LWZU,NR_R12,href));
-        importsSection.concat(taicpu.op_reg(A_MTCTR,NR_R12));
-        importsSection.concat(taicpu.op_none(A_BCTR));
+        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));
 {$else powerpc}
 {$else powerpc}
         internalerror(2004010502);
         internalerror(2004010502);
 {$endif powerpc}
 {$endif powerpc}
-        importsSection.concat(Tai_section.Create(sec_data,'',0));
-        importsSection.concat(Tai_direct.create(strpnew('.lazy_symbol_pointer')));
-        importsSection.concat(Tai_symbol.Create(l1,0));
-        importsSection.concat(Tai_direct.create(strpnew((#9+'.indirect_symbol ')+s)));
-        importsSection.concat(tai_const.createname(strpnew('dyld_stub_binding_helper'),AT_FUNCTION,0));
+        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));
       end;
       end;
 
 
 
 
@@ -407,9 +407,7 @@ const
                list.concat(taicpu.op_none(A_NOP));
                list.concat(taicpu.op_none(A_NOP));
            end
            end
          else
          else
-           begin
-             list.concat(taicpu.op_sym(A_BL,get_darwin_call_stub(s)));
-           end;
+           list.concat(taicpu.op_sym(A_BL,get_darwin_call_stub(s)));
 {
 {
        the compiler does not properly set this flag anymore in pass 1, and
        the compiler does not properly set this flag anymore in pass 1, and
        for now we only need it after pass 2 (I hope) (JM)
        for now we only need it after pass 2 (I hope) (JM)

+ 6 - 6
compiler/powerpc/nppcld.pas

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

+ 4 - 4
compiler/psub.pas

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

+ 33 - 33
compiler/ptconst.pas

@@ -99,9 +99,9 @@ implementation
          old_block_type:=block_type;
          old_block_type:=block_type;
          block_type:=bt_const;
          block_type:=bt_const;
          if writable then
          if writable then
-           curconstsegment:=datasegment
+           curconstsegment:=asmlist[datasegment]
          else
          else
-           curconstsegment:=consts;
+           curconstsegment:=asmlist[consts];
          case t.def.deftype of
          case t.def.deftype of
             orddef:
             orddef:
               begin
               begin
@@ -304,8 +304,8 @@ implementation
                     else
                     else
                      varalign:=0;
                      varalign:=0;
                     varalign:=const_align(varalign);
                     varalign:=const_align(varalign);
-                    Consts.concat(Tai_align.Create(varalign));
-                    Consts.concat(Tai_label.Create(ll));
+                    asmlist[consts].concat(Tai_align.Create(varalign));
+                    asmlist[consts].concat(Tai_label.Create(ll));
                     if p.nodetype=stringconstn then
                     if p.nodetype=stringconstn then
                       begin
                       begin
                         len:=tstringconstnode(p).len;
                         len:=tstringconstnode(p).len;
@@ -315,13 +315,13 @@ implementation
                          len:=255;
                          len:=255;
                         getmem(ca,len+2);
                         getmem(ca,len+2);
                         move(tstringconstnode(p).value_str^,ca^,len+1);
                         move(tstringconstnode(p).value_str^,ca^,len+1);
-                        Consts.concat(Tai_string.Create_length_pchar(ca,len+1));
+                        asmlist[consts].concat(Tai_string.Create_length_pchar(ca,len+1));
                       end
                       end
                     else
                     else
                       if is_constcharnode(p) then
                       if is_constcharnode(p) then
-                        Consts.concat(Tai_string.Create(char(byte(tordconstnode(p).value))+#0))
+                        asmlist[consts].concat(Tai_string.Create(char(byte(tordconstnode(p).value))+#0))
                     else
                     else
-                      Message(parser_e_illegal_expression);
+                      message(parser_e_illegal_expression);
                 end
                 end
               { maybe pwidechar ? }
               { maybe pwidechar ? }
               else
               else
@@ -329,9 +329,9 @@ implementation
                    (p.nodetype<>addrn) then
                    (p.nodetype<>addrn) then
                   begin
                   begin
                     objectlibrary.getdatalabel(ll);
                     objectlibrary.getdatalabel(ll);
-                    curconstSegment.concat(Tai_const.Create_sym(ll));
-                    Consts.concat(tai_align.create(const_align(sizeof(aint))));
-                    Consts.concat(Tai_label.Create(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));
                     if (p.nodetype in [stringconstn,ordconstn]) then
                     if (p.nodetype in [stringconstn,ordconstn]) then
                       begin
                       begin
                         { convert to widestring stringconstn }
                         { convert to widestring stringconstn }
@@ -341,9 +341,9 @@ implementation
                          begin
                          begin
                            pw:=pcompilerwidestring(tstringconstnode(p).value_str);
                            pw:=pcompilerwidestring(tstringconstnode(p).value_str);
                            for i:=0 to tstringconstnode(p).len-1 do
                            for i:=0 to tstringconstnode(p).len-1 do
-                            Consts.concat(Tai_const.Create_16bit(pw^.data[i]));
+                             asmlist[consts].concat(Tai_const.Create_16bit(pw^.data[i]));
                            { ending #0 }
                            { ending #0 }
-                           Consts.concat(Tai_const.Create_16bit(0))
+                           asmlist[consts].concat(Tai_const.Create_16bit(0))
                          end;
                          end;
                       end
                       end
                     else
                     else
@@ -603,15 +603,15 @@ implementation
                      begin
                      begin
                         { an empty ansi string is nil! }
                         { an empty ansi string is nil! }
                         if (strlength=0) then
                         if (strlength=0) then
-                          curconstSegment.concat(Tai_const.Create_sym(nil))
+                          curconstsegment.concat(Tai_const.Create_sym(nil))
                         else
                         else
                           begin
                           begin
                             objectlibrary.getdatalabel(ll);
                             objectlibrary.getdatalabel(ll);
-                            curconstSegment.concat(Tai_const.Create_sym(ll));
-                            Consts.concat(tai_align.create(const_align(sizeof(aint))));
-                            Consts.concat(Tai_const.Create_aint(-1));
-                            Consts.concat(Tai_const.Create_aint(strlength));
-                            Consts.concat(Tai_label.Create(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);
                             getmem(ca,strlength+2);
                             move(strval^,ca^,strlength);
                             move(strval^,ca^,strlength);
                             { The terminating #0 to be stored in the .data section (JM) }
                             { The terminating #0 to be stored in the .data section (JM) }
@@ -619,7 +619,7 @@ implementation
                             { End of the PChar. The memory has to be allocated because in }
                             { End of the PChar. The memory has to be allocated because in }
                             { tai_string.done, there is a freemem(len+1) (JM)             }
                             { tai_string.done, there is a freemem(len+1) (JM)             }
                             ca[strlength+1]:=#0;
                             ca[strlength+1]:=#0;
-                            Consts.concat(Tai_string.Create_length_pchar(ca,strlength+1));
+                            asmlist[consts].concat(Tai_string.Create_length_pchar(ca,strlength+1));
                           end;
                           end;
                      end;
                      end;
                  {$ifdef ansistring_bits}
                  {$ifdef ansistring_bits}
@@ -627,21 +627,21 @@ implementation
                      begin
                      begin
                         { an empty ansi string is nil! }
                         { an empty ansi string is nil! }
                         if (strlength=0) then
                         if (strlength=0) then
-                          curconstSegment.concat(Tai_const.Create_ptr(0))
+                          curconstsegment.concat(Tai_const.Create_ptr(0))
                         else
                         else
                           begin
                           begin
                             objectlibrary.getdatalabel(ll);
                             objectlibrary.getdatalabel(ll);
-                            curconstSegment.concat(Tai_const_symbol.Create(ll));
+                            curconstsegment.concat(Tai_const_symbol.Create(ll));
                             { the actual structure starts at -12 from start label - CEC }
                             { the actual structure starts at -12 from start label - CEC }
-                            Consts.concat(tai_align.create(const_align(pointer_size)));
+                            asmlist[consts].concat(tai_align.create(const_align(pointer_size)));
                             { first write the maximum size }
                             { first write the maximum size }
-                            Consts.concat(Tai_const.Create_64bit(strlength));
+                            asmlist[consts].concat(Tai_const.Create_64bit(strlength));
                             { second write the real length }
                             { second write the real length }
-                            Consts.concat(Tai_const.Create_64bit(strlength));
+                            asmlist[consts].concat(Tai_const.Create_64bit(strlength));
                             { redondent with maxlength but who knows ... (PM) }
                             { redondent with maxlength but who knows ... (PM) }
                             { third write use count (set to -1 for safety ) }
                             { third write use count (set to -1 for safety ) }
-                            Consts.concat(Tai_const.Create_64bit(-1));
-                            Consts.concat(Tai_label.Create(ll));
+                            asmlist[consts].concat(Tai_const.Create_64bit(-1));
+                            asmlist[consts].concat(Tai_label.Create(ll));
                             getmem(ca,strlength+2);
                             getmem(ca,strlength+2);
                             move(strval^,ca^,strlength);
                             move(strval^,ca^,strlength);
                             { The terminating #0 to be stored in the .data section (JM) }
                             { The terminating #0 to be stored in the .data section (JM) }
@@ -649,7 +649,7 @@ implementation
                             { End of the PChar. The memory has to be allocated because in }
                             { End of the PChar. The memory has to be allocated because in }
                             { tai_string.done, there is a freemem(len+1) (JM)             }
                             { tai_string.done, there is a freemem(len+1) (JM)             }
                             ca[strlength+1]:=#0;
                             ca[strlength+1]:=#0;
-                            Consts.concat(Tai_string.Create_length_pchar(ca,strlength+1));
+                            asmlist[consts].concat(Tai_string.Create_length_pchar(ca,strlength+1));
                           end;
                           end;
                      end;
                      end;
                  {$endif}
                  {$endif}
@@ -662,14 +662,14 @@ implementation
                           begin
                           begin
                             objectlibrary.getdatalabel(ll);
                             objectlibrary.getdatalabel(ll);
                             curconstSegment.concat(Tai_const.Create_sym(ll));
                             curconstSegment.concat(Tai_const.Create_sym(ll));
-                            Consts.concat(tai_align.create(const_align(sizeof(aint))));
-                            Consts.concat(Tai_const.Create_aint(-1));
-                            Consts.concat(Tai_const.Create_aint(strlength));
-                            Consts.concat(Tai_label.Create(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));
                             for i:=0 to strlength-1 do
                             for i:=0 to strlength-1 do
-                              Consts.concat(Tai_const.Create_16bit(pcompilerwidestring(strval)^.data[i]));
+                              asmlist[consts].concat(Tai_const.Create_16bit(pcompilerwidestring(strval)^.data[i]));
                             { ending #0 }
                             { ending #0 }
-                            Consts.concat(Tai_const.Create_16bit(0))
+                            asmlist[consts].concat(Tai_const.Create_16bit(0))
                           end;
                           end;
                      end;
                      end;
                    st_longstring:
                    st_longstring:

+ 2 - 2
compiler/rautils.pas

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

+ 1 - 1
compiler/sparc/cpupara.pas

@@ -171,7 +171,7 @@ implementation
              begin
              begin
                p.funcretloc[side].loc:=LOC_REGISTER;
                p.funcretloc[side].loc:=LOC_REGISTER;
                { high }
                { high }
-               if (side=callerside) (po_inline in p.procoptions) then
+               if (side=callerside) or (po_inline in p.procoptions) then
                  p.funcretloc[side].register64.reghi:=NR_FUNCTION_RESULT64_HIGH_REG
                  p.funcretloc[side].register64.reghi:=NR_FUNCTION_RESULT64_HIGH_REG
                else
                else
                  p.funcretloc[side].register64.reghi:=NR_FUNCTION_RETURN64_HIGH_REG;
                  p.funcretloc[side].register64.reghi:=NR_FUNCTION_RETURN64_HIGH_REG;

+ 5 - 5
compiler/sparc/ncpucnv.pas

@@ -169,14 +169,14 @@ implementation
                s64real:
                s64real:
                  begin
                  begin
                    hregister:=cg.getfpuregister(exprasmlist,OS_F64);
                    hregister:=cg.getfpuregister(exprasmlist,OS_F64);
-                   consts.concat(tai_align.create(const_align(8)));
-                   consts.concat(Tai_label.Create(l1));
+                   asmlist[consts].concat(tai_align.create(const_align(8)));
+                   asmlist[consts].concat(Tai_label.Create(l1));
                    { I got this constant from a test program (FK) }
                    { I got this constant from a test program (FK) }
-                   consts.concat(Tai_const.Create_32bit($41f00000));
-                   consts.concat(Tai_const.Create_32bit(0));
+                   asmlist[consts].concat(Tai_const.Create_32bit($41f00000));
+                   asmlist[consts].concat(Tai_const.Create_32bit(0));
 
 
                    cg.a_loadfpu_ref_reg(exprasmlist,OS_F64,href,hregister);
                    cg.a_loadfpu_ref_reg(exprasmlist,OS_F64,href,hregister);
-                   exprasmList.concat(taicpu.op_reg_reg_reg(A_FADDD,location.register,hregister,location.register));
+                   exprasmlist.concat(taicpu.op_reg_reg_reg(A_FADDD,location.register,hregister,location.register));
                    cg.a_label(exprasmlist,l2);
                    cg.a_label(exprasmlist,l2);
 
 
                    { cut off if we should convert to single }
                    { cut off if we should convert to single }

+ 1 - 1
compiler/sparc/ncpuset.pas

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

+ 143 - 143
compiler/symdef.pas

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

+ 4 - 4
compiler/systems/t_beos.pas

@@ -165,10 +165,10 @@ begin
          begin
          begin
 {$ifdef i386}
 {$ifdef i386}
            { place jump in codesegment }
            { place jump in codesegment }
-           codesegment.concat(Tai_align.Create_op(4,$90));
-           codeSegment.concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
-           codeSegment.concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
-           codeSegment.concat(Tai_symbol_end.Createname(hp2.name^));
+           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^));
 {$endif i386}
 {$endif i386}
          end;
          end;
       end
       end

+ 10 - 10
compiler/systems/t_bsd.pas

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

+ 6 - 6
compiler/systems/t_linux.pas

@@ -156,7 +156,7 @@ procedure texportliblinux.generatelib;
 var
 var
   hp2 : texported_item;
   hp2 : texported_item;
 begin
 begin
-  new_section(codesegment,sec_code,'',0);
+  new_section(asmlist[codesegment],sec_code,'',0);
   hp2:=texported_item(current_module._exports.first);
   hp2:=texported_item(current_module._exports.first);
   while assigned(hp2) do
   while assigned(hp2) do
    begin
    begin
@@ -168,14 +168,14 @@ begin
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          begin
          begin
            { place jump in codesegment }
            { place jump in codesegment }
-           codesegment.concat(tai_align.create(target_info.alignment.procalign));
-           codeSegment.concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
-           cg.a_jmp_name(codesegment,tprocsym(hp2.sym).first_procdef.mangledname);
-           codeSegment.concat(Tai_symbol_end.Createname(hp2.name^));
+           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^));
          end;
          end;
       end
       end
      else
      else
-      Message1(parser_e_no_export_of_variables_for_target,'linux');
+      message1(parser_e_no_export_of_variables_for_target,'linux');
      hp2:=texported_item(hp2.next);
      hp2:=texported_item(hp2.next);
    end;
    end;
 end;
 end;

+ 4 - 4
compiler/systems/t_nwl.pas

@@ -242,10 +242,10 @@ begin
          begin
          begin
 {$ifdef i386}
 {$ifdef i386}
            { place jump in codesegment }
            { place jump in codesegment }
-           codesegment.concat(Tai_align.Create_op(4,$90));
-           codeSegment.concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
-           codeSegment.concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
-           codeSegment.concat(Tai_symbol_end.Createname(hp2.name^));
+           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^));
 {$endif i386}
 {$endif i386}
          end;
          end;
       end
       end

+ 4 - 4
compiler/systems/t_nwm.pas

@@ -234,10 +234,10 @@ begin
          begin
          begin
 {$ifdef i386}
 {$ifdef i386}
            { place jump in codesegment }
            { place jump in codesegment }
-           codesegment.concat(Tai_align.Create_op(4,$90));
-           codeSegment.concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
-           codeSegment.concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
-           codeSegment.concat(Tai_symbol_end.Createname(hp2.name^));
+           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^));
 {$endif i386}
 {$endif i386}
          end;
          end;
       end
       end

+ 5 - 5
compiler/systems/t_sunos.pas

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

+ 117 - 117
compiler/systems/t_win.pas

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

+ 10 - 10
compiler/x86/agx86int.pas

@@ -390,7 +390,7 @@ implementation
       { lineinfo is only needed for codesegment (PFV) }
       { lineinfo is only needed for codesegment (PFV) }
       do_line:=((cs_asm_source in aktglobalswitches) or
       do_line:=((cs_asm_source in aktglobalswitches) or
                 (cs_lineinfo in aktmoduleswitches))
                 (cs_lineinfo in aktmoduleswitches))
-                 and (p=codesegment);
+                 and (p=asmlist[codesegment]);
       InlineLevel:=0;
       InlineLevel:=0;
       DoNotSplitLine:=false;
       DoNotSplitLine:=false;
       hp:=tai(p.first);
       hp:=tai(p.first);
@@ -875,17 +875,17 @@ implementation
     { INTEL ASM doesn't support stabs
     { INTEL ASM doesn't support stabs
       WriteTree(debuglist);}
       WriteTree(debuglist);}
 
 
-      WriteTree(codesegment);
-      WriteTree(datasegment);
-      WriteTree(consts);
-      WriteTree(rttilist);
-      WriteTree(resourcestringlist);
-      WriteTree(bsssegment);
-      Writetree(importssection);
+      WriteTree(asmlist[codesegment]);
+      WriteTree(asmlist[datasegment]);
+      WriteTree(asmlist[consts]);
+      WriteTree(asmlist[rttilist]);
+      WriteTree(asmlist[resourcestrings]);
+      WriteTree(asmlist[bsssegment]);
+      Writetree(asmlist[importsection]);
       { exports are written by DLLTOOL
       { exports are written by DLLTOOL
         if we use it so don't insert it twice (PM) }
         if we use it so don't insert it twice (PM) }
-      if not UseDeffileForExports and assigned(exportssection) then
-        Writetree(exportssection);
+      if not UseDeffileForExports and assigned(asmlist[exportsection]) then
+        Writetree(asmlist[exportsection]);
 
 
       AsmWriteLn(#9'END');
       AsmWriteLn(#9'END');
       AsmLn;
       AsmLn;

+ 10 - 10
compiler/x86/nx86cnv.pas

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

+ 4 - 4
compiler/x86/nx86mat.pas

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

+ 2 - 2
compiler/x86_64/cpuinfo.pas

@@ -59,8 +59,8 @@ Const
    { calling conventions supported by the code generator }
    { calling conventions supported by the code generator }
    supported_calling_conventions : tproccalloptions = [
    supported_calling_conventions : tproccalloptions = [
      pocall_internproc,
      pocall_internproc,
-     pocall_compilerproc,
-     pocall_inline,
+{     pocall_compilerproc,
+     pocall_inline,}
      pocall_register,
      pocall_register,
      pocall_safecall,
      pocall_safecall,
      pocall_stdcall,
      pocall_stdcall,