Bladeren bron

* 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 jaren geleden
bovenliggende
commit
d05f58b604

+ 7 - 9
compiler/aasmtai.pas

@@ -575,6 +575,12 @@ interface
           procedure InsertAfter(Item,Loc : TLinkedListItem);override;
        end;
 
+       Tasmlist=({ default lists }
+                 datasegment,codesegment,bsssegment,debuglist,consts,
+                 withdebuglist,importsection,exportsection,
+                 resourcesection,rttilist,dwarflist,
+                 { data used by pic code }
+                 picdata,resourcestrings);
 
     var
       { array with all class types for tais }
@@ -592,15 +598,7 @@ interface
       { hook to notify uses of registers }
       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_cpu   : tai_cpu_class;

+ 14 - 14
compiler/aggas.pas

@@ -369,7 +369,7 @@ var
       { lineinfo is only needed for codesegment (PFV) }
       do_line:=(cs_asm_source in aktglobalswitches) or
                ((cs_lineinfo in aktmoduleswitches)
-                 and (p=codesegment));
+                 and (p=asmlist[codesegment]));
       hp:=tai(p.first);
       while assigned(hp) do
        begin
@@ -968,21 +968,21 @@ var
       symendcount:=0;
 
       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
         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}
       WriteFileEndInfo;
       {$ENDIF}

+ 13 - 19
compiler/assemble.pas

@@ -1589,6 +1589,9 @@ Implementation
 
     procedure TInternalAssembler.MakeObject;
 
+    var to_do:set of Tasmlist;
+        i:Tasmlist;
+
         procedure addlist(p:TAAsmoutput);
         begin
           inc(lists);
@@ -1596,25 +1599,16 @@ Implementation
         end;
 
       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
           writetreesmart

+ 32 - 30
compiler/cresstr.pas

@@ -141,61 +141,63 @@ procedure TResourceStrings.CreateResourceStringList;
     s : pchar;
     l : longint;
   begin
-    With P Do
+    with p Do
      begin
        if (Value=nil) or (len=0) then
-         resourcestringlist.concat(tai_const.create_sym(nil))
+         asmlist[aasmtai.resourcestrings].concat(tai_const.create_sym(nil))
        else
          begin
             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);
-            move(Value^,s^,len);
+            move(value^,s^,len);
             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;
        { 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. }
        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);
        move(Name[1],s^,l);
        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;
 
 Var
   R : tresourceStringItem;
 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);
-  While assigned(R) do
+  while assigned(R) do
    begin
      AppendToAsmResList(R);
      R:=TResourceStringItem(R.Next);
    end;
-  resourcestringlist.concat(tai_symbol_end.createname(current_module.modulename^+'_'+'RESOURCESTRINGLIST'));
+  asmlist[aasmtai.resourcestrings].concat(tai_symbol_end.createname(
+    current_module.modulename^+'_'+'RESOURCESTRINGLIST'));
 end;
 
 

+ 11 - 11
compiler/i386/ag386nsm.pas

@@ -401,7 +401,7 @@ interface
       { lineinfo is only needed for codesegment (PFV) }
       do_line:=(cs_asm_source in aktglobalswitches) or
                ((cs_lineinfo in aktmoduleswitches)
-                 and (p=codesegment));
+                 and (p=asmlist[codesegment]));
       hp:=tai(p.first);
       while assigned(hp) do
        begin
@@ -797,18 +797,18 @@ interface
     { Nasm doesn't support stabs
       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
         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;
 {$ifdef EXTDEBUG}

+ 1 - 1
compiler/i386/n386set.pas

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

+ 58 - 65
compiler/ncgcon.pas

@@ -100,7 +100,7 @@ implementation
         if not assigned(lab_real) then
           begin
              { tries to find an old entry }
-             hp1:=tai(Consts.first);
+             hp1:=tai(asmlist[consts].first);
              while assigned(hp1) do
                begin
                   if hp1.typ=ait_label then
@@ -138,17 +138,17 @@ implementation
                begin
                   objectlibrary.getdatalabel(lastlabel);
                   lab_real:=lastlabel;
-                  maybe_new_object_file(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
                     ait_real_32bit :
                       begin
-                        Consts.concat(Tai_real_32bit.Create(ts32real(value_real)));
+                        asmlist[consts].concat(Tai_real_32bit.Create(ts32real(value_real)));
                         { range checking? }
                         if ((cs_check_range in aktlocalswitches) or
                           (cs_check_overflow in aktlocalswitches)) and
-                          (tai_real_32bit(Consts.Last).value=double(MathInf)) then
+                          (tai_real_32bit(asmlist[consts].last).value=double(MathInf)) then
                           Message(parser_e_range_check_error);
                       end;
 
@@ -156,54 +156,47 @@ implementation
                       begin
 {$ifdef ARM}
                         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
 {$endif ARM}
-                          Consts.concat(Tai_real_64bit.Create(ts64real(value_real)));
+                          asmlist[consts].concat(Tai_real_64bit.Create(ts64real(value_real)));
 
                         { range checking? }
                         if ((cs_check_range in aktlocalswitches) or
                           (cs_check_overflow in aktlocalswitches)) and
-                          (tai_real_64bit(Consts.Last).value=double(MathInf)) then
+                          (tai_real_64bit(asmlist[consts].last).value=double(MathInf)) then
                           Message(parser_e_range_check_error);
                      end;
 
                     ait_real_80bit :
                       begin
-                        Consts.concat(Tai_real_80bit.Create(value_real));
+                        asmlist[consts].concat(Tai_real_80bit.Create(value_real));
 
                         { range checking? }
                         if ((cs_check_range in aktlocalswitches) or
                           (cs_check_overflow in aktlocalswitches)) and
-                          (tai_real_80bit(Consts.Last).value=double(MathInf)) then
+                          (tai_real_80bit(asmlist[consts].last).value=double(MathInf)) then
                           Message(parser_e_range_check_error);
                       end;
 {$ifdef cpufloat128}
                     ait_real_128bit :
                       begin
-                        Consts.concat(Tai_real_128bit.Create(value_real));
+                        asmlist[consts].concat(Tai_real_128bit.Create(value_real));
 
                         { range checking? }
                         if ((cs_check_range in aktlocalswitches) or
                           (cs_check_overflow in aktlocalswitches)) and
-                          (tai_real_128bit(Consts.Last).value=double(MathInf)) then
+                          (tai_real_128bit(asmlist[consts].last).value=double(MathInf)) then
                           Message(parser_e_range_check_error);
                       end;
 {$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 }
                     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
                     internalerror(10120);
                   end;
@@ -279,8 +272,8 @@ implementation
               { widestrings can't be reused yet }
               if not(is_widestring(resulttype.def)) then
                 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
                     begin
                        if hp1.typ=ait_label then
@@ -467,9 +460,9 @@ implementation
                 begin
                    objectlibrary.getdatalabel(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 ? }
                    case st_type of
                     {$ifdef ansistring_bits}
@@ -477,7 +470,7 @@ implementation
                         begin
                            { an empty ansi string is nil! }
                            if len=0 then
-                             Consts.concat(Tai_const.Create_ptr(0))
+                             asmlist[consts].concat(Tai_const.Create_ptr(0))
                            else
                              begin
                                 objectlibrary.getdatalabel(l1);
@@ -492,7 +485,7 @@ implementation
                                 pc[len]:=#0;
                                 { to overcome this problem we set the length explicitly }
                                 { 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 }
                                 lab_str:=l2;
                              end;
@@ -502,22 +495,22 @@ implementation
                         begin
                            { an empty ansi string is nil! }
                            if len=0 then
-                             Consts.concat(Tai_const.Create_sym(nil))
+                             asmlist[consts].concat(Tai_const.Create_sym(nil))
                            else
                              begin
                                 objectlibrary.getdatalabel(l1);
                                 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);
                                 move(value_str^,pc^,len);
                                 pc[len]:=#0;
                                 { to overcome this problem we set the length explicitly }
                                 { 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 }
                                 lab_str:=l2;
                              end;
@@ -532,17 +525,17 @@ implementation
                              begin
                                 objectlibrary.getdatalabel(l1);
                                 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);
                                 move(value_str^,pc^,len);
                                 pc[len]:=#0;
                                 { to overcome this problem we set the length explicitly }
                                 { 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 }
                                 lab_str:=l2;
                              end;
@@ -552,24 +545,24 @@ implementation
                         begin
                            { an empty wide string is nil! }
                            if len=0 then
-                             Consts.concat(Tai_const.Create_sym(nil))
+                             asmlist[consts].concat(Tai_const.Create_sym(nil))
                            else
                              begin
                                 objectlibrary.getdatalabel(l1);
                                 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 }
                                 { at least for now                          }
                                 { 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
-                                  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 }
-                                Consts.concat(Tai_const.Create_16bit(0));
+                                asmlist[consts].concat(Tai_const.Create_16bit(0));
                                 { return the offset of the real string }
                                 lab_str:=l2;
                              end;
@@ -588,7 +581,7 @@ implementation
                           { to overcome this problem we set the length explicitly }
                           { with the ending null char }
                           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;
@@ -633,7 +626,7 @@ implementation
         if not assigned(lab_set) then
           begin
              { tries to found an old entry }
-             hp1:=tai(Consts.first);
+             hp1:=tai(asmlist[consts].first);
              while assigned(hp1) do
                begin
                   if hp1.typ=ait_label then
@@ -684,9 +677,9 @@ implementation
                begin
                  objectlibrary.getdatalabel(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)
                  if tsetdef(resulttype.def).settype=smallset then
                   begin
@@ -697,7 +690,7 @@ implementation
                  }
                   begin
                     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;
@@ -728,13 +721,13 @@ implementation
         location_reset(location,LOC_CREFERENCE,OS_NO);
         { label for GUID }
         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;
       end;
 

+ 16 - 16
compiler/ncgutil.pas

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

+ 77 - 77
compiler/nobj.pas

@@ -263,13 +263,13 @@ implementation
          objectlibrary.getdatalabel(p^.nl);
          if assigned(p^.l) then
            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);
-         datasegment.concat(tai_const.create_8bit(len));
+         asmlist[datasegment].concat(tai_const.create_8bit(len));
          getmem(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
            writenames(p^.r);
       end;
@@ -281,8 +281,8 @@ implementation
            writestrentry(p^.l);
 
          { 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
            writestrentry(p^.r);
@@ -305,10 +305,10 @@ implementation
 
          { now start writing of the message string table }
          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;
-         dataSegment.concat(Tai_const.Create_32bit(count));
+         asmlist[datasegment].concat(Tai_const.Create_32bit(count));
          if assigned(root) then
            begin
               writestrentry(root);
@@ -323,8 +323,8 @@ implementation
            writeintentry(p^.l);
 
          { 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
            writeintentry(p^.r);
@@ -343,10 +343,10 @@ implementation
 
          { now start writing of the message string table }
          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;
-         dataSegment.concat(Tai_const.Create_32bit(count));
+         asmlist[datasegment].concat(Tai_const.Create_32bit(count));
          if assigned(root) then
            begin
               writeintentry(root);
@@ -477,16 +477,16 @@ implementation
                    begin
                      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
-                       dataSegment.concat(Tai_const.Create_sym(nil))
+                       asmlist[datasegment].concat(Tai_const.Create_sym(nil))
                      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;
@@ -505,9 +505,9 @@ implementation
          if count>0 then
            begin
               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);
               genpublishedmethodstable:=l;
            end
@@ -906,17 +906,17 @@ implementation
             rawdata.concat(Tai_const.Create_16bit(curintf.iidguid^.D3));
             for i:=Low(curintf.iidguid^.D4) to High(curintf.iidguid^.D4) do
               rawdata.concat(Tai_const.Create_8bit(curintf.iidguid^.D4[i]));
-            dataSegment.concat(Tai_const.Create_sym(tmplabel));
+            asmlist[datasegment].concat(Tai_const.Create_sym(tmplabel));
           end
         else
           begin
             { nil for Corba interfaces }
-            dataSegment.concat(Tai_const.Create_sym(nil));
+            asmlist[datasegment].concat(Tai_const.Create_sym(nil));
           end;
         { VTable }
-        dataSegment.concat(Tai_const.Createname(gintfgetvtbllabelname(contintfindex),AT_DATA,0));
+        asmlist[datasegment].concat(Tai_const.Createname(gintfgetvtbllabelname(contintfindex),AT_DATA,0));
         { IOffset field }
-        dataSegment.concat(Tai_const.Create_32bit(implintf.ioffsets(contintfindex)));
+        asmlist[datasegment].concat(Tai_const.Create_32bit(implintf.ioffsets(contintfindex)));
         { IIDStr }
         objectlibrary.getdatalabel(tmplabel);
         rawdata.concat(cai_align.create(const_align(sizeof(aint))));
@@ -926,7 +926,7 @@ implementation
           rawdata.concat(Tai_string.Create(upper(curintf.iidstr^)))
         else
           rawdata.concat(Tai_string.Create(curintf.iidstr^));
-        dataSegment.concat(Tai_const.Create_sym(tmplabel));
+        asmlist[datasegment].concat(Tai_const.Create_sym(tmplabel));
       end;
 
 
@@ -1037,7 +1037,7 @@ implementation
         max:=_class.implementedinterfaces.count;
 
         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 }
         for i:=1 to max do
           begin
@@ -1062,7 +1062,7 @@ implementation
               _class.implementedinterfaces.setioffsets(i,_class.implementedinterfaces.ioffsets(j));
             gintfgenentry(i,j,rawdata);
           end;
-        dataSegment.concatlist(rawdata);
+        asmlist[datasegment].concatlist(rawdata);
         rawdata.free;
       end;
 
@@ -1160,8 +1160,8 @@ implementation
         { 2. step calc required fieldcount and their offsets in the object memory map
              and write data }
         objectlibrary.getdatalabel(intftable);
-        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 }
         gintfoptimizevtbls;
         { Write interface tables }
@@ -1179,21 +1179,21 @@ implementation
       if assigned(_class.iidguid) then
         begin
           s:=make_mangledname('IID',_class.owner,_class.objname^);
-          maybe_new_object_file(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
-            dataSegment.concat(Tai_const.Create_8bit(_class.iidguid^.D4[i]));
+            asmlist[datasegment].concat(Tai_const.Create_8bit(_class.iidguid^.D4[i]));
         end;
-      maybe_new_object_file(dataSegment);
+      maybe_new_object_file(asmlist[datasegment]);
       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;
 
 
@@ -1258,8 +1258,8 @@ implementation
          if is_class(_class) then
           begin
             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 }
             if _class.implementedinterfaces.count>0 then
@@ -1268,9 +1268,9 @@ implementation
             methodnametable:=genpublishedmethodstable;
             fieldtablelabel:=_class.generate_field_table;
             { 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 }
             if (oo_has_msgstr in _class.objectoptions) then
@@ -1280,30 +1280,30 @@ implementation
           end;
 
         { 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}
         if (cs_debuginfo in aktmoduleswitches) then
          begin
            do_count_dbx:=true;
            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)));
          end;
 {$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 }
          { 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}
          if _class.classtype=ct_object then
            begin
               if assigned(dmtlabel) then
-                dataSegment.concat(Tai_const_symbol.Create(dmtlabel)))
+                asmlist[datasegment].concat(Tai_const_symbol.Create(dmtlabel)))
               else
-                dataSegment.concat(Tai_const.Create_ptr(0));
+                asmlist[datasegment].concat(Tai_const.Create_ptr(0));
            end;
 {$endif WITHDMT}
          { write pointer to parent VMT, this isn't implemented in TP }
@@ -1312,52 +1312,52 @@ implementation
          { it is not written for parents that don't have any vmt !! }
          if assigned(_class.childof) and
             (oo_has_vmt in _class.childof.objectoptions) then
-           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
-           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 }
          if is_class(_class) then
           begin
             { 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 }
             if (oo_has_msgint in _class.objectoptions) then
-              dataSegment.concat(Tai_const.Create_sym(intmessagetable))
+              asmlist[datasegment].concat(Tai_const.Create_sym(intmessagetable))
             else
-              dataSegment.concat(Tai_const.Create_sym(nil));
+              asmlist[datasegment].concat(Tai_const.Create_sym(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 }
-            dataSegment.concat(Tai_const.Create_sym(fieldtablelabel));
+            asmlist[datasegment].concat(Tai_const.Create_sym(fieldtablelabel));
             { pointer to type info of published section }
             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
-              dataSegment.concat(Tai_const.Create_sym(nil));
+              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
             { inittable for con-/destruction }
             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
-              dataSegment.concat(Tai_const.Create_sym(nil));
+              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
             { auto table }
-            dataSegment.concat(Tai_const.Create_sym(nil));
+            asmlist[datasegment].concat(Tai_const.Create_sym(nil));
             { interface table }
             if _class.implementedinterfaces.count>0 then
-              dataSegment.concat(Tai_const.Create_sym(interfacetable))
+              asmlist[datasegment].concat(Tai_const.Create_sym(interfacetable))
             else
-              dataSegment.concat(Tai_const.Create_sym(nil));
+              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
             { table for string messages }
             if (oo_has_msgstr in _class.objectoptions) then
-              dataSegment.concat(Tai_const.Create_sym(strmessagetable))
+              asmlist[datasegment].concat(Tai_const.Create_sym(strmessagetable))
             else
-              dataSegment.concat(Tai_const.Create_sym(nil));
+              asmlist[datasegment].concat(Tai_const.Create_sym(nil));
           end;
          { 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 }
-         dataSegment.concat(Tai_symbol_end.Createname(_class.vmt_mangledname));
+         asmlist[datasegment].concat(Tai_symbol_end.Createname(_class.vmt_mangledname));
       end;
 
 

+ 24 - 71
compiler/parser.pas

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

+ 53 - 53
compiler/pmodules.pas

@@ -84,10 +84,10 @@ implementation
            { Recreate import section }
            if (target_info.system in [system_i386_win32,system_i386_wdosx]) then
             begin
-              if assigned(importssection)then
-               importssection.clear
+              if assigned(asmlist[importsection]) then
+               asmlist[importsection].clear
               else
-               importssection:=taasmoutput.Create;
+               asmlist[importsection]:=taasmoutput.Create;
               importlib.generatelib;
             end;
            { Readd the not processed files }
@@ -106,10 +106,10 @@ implementation
         if (cs_create_smart in aktmoduleswitches) then
          begin
            { regenerate the importssection for win32 }
-           if assigned(importssection) and
+           if assigned(asmlist[importsection]) and
               (target_info.system in [system_i386_win32,system_i386_wdosx, system_arm_wince,system_i386_wince]) then
             begin
-              importsSection.clear;
+              asmlist[importsection].clear;
               importlib.generatesmartlib;
             end;
 
@@ -139,11 +139,11 @@ implementation
 
     procedure create_dwarf;
       begin
-        dwarflist:=taasmoutput.create;
+        asmlist[dwarflist]:=taasmoutput.create;
         { Call frame information }
         if (tf_needs_dwarf_cfi in target_info.flags) and
            (af_supports_dwarf in target_asm.flags) then
-          dwarfcfi.generate_code(dwarflist);
+          dwarfcfi.generate_code(asmlist[dwarflist]);
       end;
 
 
@@ -160,31 +160,31 @@ implementation
            then
          begin
            { 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));
          end;
         { align code segment }
-        codeSegment.concat(Tai_align.Create(aktalignment.procalign));
+        asmlist[codesegment].concat(Tai_align.Create(aktalignment.procalign));
         { 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 ?
           .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}
-        if assigned(debuglist) then
+        if assigned(asmlist[debuglist]) then
           begin
             oldaktfilepos:=aktfilepos;
             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;
           end;
 {$endif GDB}
@@ -221,8 +221,8 @@ implementation
         ltvTables.insert(Tai_align.Create(const_align(sizeof(aint))));
         ltvTables.concat(Tai_symbol_end.Createname('FPC_THREADVARTABLES'));
         { insert in data segment }
-        maybe_new_object_file(dataSegment);
-        dataSegment.concatlist(ltvTables);
+        maybe_new_object_file(asmlist[datasegment]);
+        asmlist[datasegment].concatlist(ltvTables);
         ltvTables.free;
       end;
 
@@ -260,8 +260,8 @@ implementation
             ltvTable.insert(Tai_align.Create(const_align(32)));
             ltvTable.concat(tai_const.create_sym(nil));  { end of list marker }
             ltvTable.concat(tai_symbol_end.createname(s));
-            maybe_new_object_file(dataSegment);
-            dataSegment.concatlist(ltvTable);
+            maybe_new_object_file(asmlist[datasegment]);
+            asmlist[datasegment].concatlist(ltvTable);
             current_module.flags:=current_module.flags or uf_threadvars;
           end;
          ltvTable.Free;
@@ -287,7 +287,7 @@ implementation
            hp:=tused_unit(hp.next);
          end;
         { Add program resources, if any }
-        If ResourceStringList<>Nil then
+        if asmlist[aasmtai.resourcestrings]<>nil then
          begin
            ResourceStringTables.concat(Tai_const.Createname(make_mangledname('RESOURCESTRINGLIST',current_module.localsymtable,''),AT_DATA,0));
            Inc(Count);
@@ -298,8 +298,8 @@ implementation
         ResourceStringTables.insert(Tai_align.Create(const_align(4)));
         ResourceStringTables.concat(Tai_symbol_end.Createname('FPC_RESOURCESTRINGTABLES'));
         { insert in data segment }
-        maybe_new_object_file(dataSegment);
-        dataSegment.concatlist(ResourceStringTables);
+        maybe_new_object_file(asmlist[datasegment]);
+        asmlist[datasegment].concatlist(ResourceStringTables);
         ResourceStringTables.free;
       end;
 
@@ -350,8 +350,8 @@ implementation
         unitinits.insert(Tai_align.Create(const_align(4)));
         unitinits.concat(Tai_symbol_end.Createname('INITFINAL'));
         { insert in data segment }
-        maybe_new_object_file(dataSegment);
-        dataSegment.concatlist(unitinits);
+        maybe_new_object_file(asmlist[datasegment]);
+        asmlist[datasegment].concatlist(unitinits);
         unitinits.free;
       end;
 
@@ -359,11 +359,11 @@ implementation
     procedure insertmemorysizes;
       begin
         { 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;
 
 
@@ -658,7 +658,7 @@ implementation
                    dependent stabs }
                  write_used_unit_type_info(pu.u);
                  if assigned(pu.u.globalsymtable) then
-                   tglobalsymtable(pu.u.globalsymtable).concattypestabto(debuglist);
+                   tglobalsymtable(pu.u.globalsymtable).concattypestabto(asmlist[debuglist]);
                end;
              pu:=tused_unit(pu.next);
            end;
@@ -677,10 +677,10 @@ implementation
         if current_module.is_unit then
           begin
             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
         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
           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 }
@@ -698,16 +698,16 @@ implementation
         write_used_unit_type_info(current_module);
         { last write the types from this unit }
         if assigned(current_module.globalsymtable) then
-          tglobalsymtable(current_module.globalsymtable).concattypestabto(debuglist);
+          tglobalsymtable(current_module.globalsymtable).concattypestabto(asmlist[debuglist]);
         if assigned(current_module.localsymtable) then
-          tstaticsymtable(current_module.localsymtable).concattypestabto(debuglist);
+          tstaticsymtable(current_module.localsymtable).concattypestabto(asmlist[debuglist]);
         { include files }
         if (cs_gdb_dbx in aktglobalswitches) then
           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 '+
               tostr(tglobalsymtable(current_module.globalsymtable).moduleid))));
-            debugList.concat(Tai_stabs.Create(strpnew('"'+
+            asmlist[debuglist].concat(Tai_stabs.Create(strpnew('"'+
               tglobalsymtable(current_module.globalsymtable).name^+'",'+
               tostr(N_EINCL)+',0,0,0')));
             tglobalsymtable(current_module.globalsymtable).dbx_count_ok:={true}false;
@@ -909,12 +909,12 @@ implementation
       begin
         is_assembler_generated:=(Errorcount=0) and
           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;
 
@@ -1244,8 +1244,8 @@ implementation
 {$endif GDB}
 
          { 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 }
          InsertThreadvars;
@@ -1491,7 +1491,7 @@ implementation
          if assigned(exportlib) and
             (target_info.system in [system_i386_win32,system_i386_wdosx]) and
             BinaryContainsExports then
-           codesegment.concat(tai_const.create_sym(exportlib.edatalabel));
+           asmlist[codesegment].concat(tai_const.create_sym(exportlib.edatalabel));
 
          If ResourceStrings.ResStrCount>0 then
           begin
@@ -1559,7 +1559,7 @@ implementation
 {$endif GDB}
 
          { generate wrappers for interfaces }
-         gen_intf_wrappers(codesegment,current_module.localsymtable);
+         gen_intf_wrappers(asmlist[codesegment],current_module.localsymtable);
 
          { generate a list of threadvars }
          InsertThreadvars;

+ 7 - 7
compiler/powerpc/agppcmpw.pas

@@ -803,7 +803,7 @@ var
       { lineinfo is only needed for codesegment (PFV) }
       do_line:=((cs_asm_source in aktglobalswitches) or
                 (cs_lineinfo in aktmoduleswitches))
-                 and (p=codesegment);
+                 and (p=asmlist[codesegment]);
       DoNotSplitLine:=false;
       hp:=tai(p.first);
       while assigned(hp) do
@@ -1420,12 +1420,12 @@ var
       If (cs_debuginfo in aktmoduleswitches) then
         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}
       WriteFileEndInfo;
       {$ENDIF}

+ 17 - 19
compiler/powerpc/cgcpu.pas

@@ -364,33 +364,33 @@ const
         if assigned(result) then
           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);
-        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);
         reference_reset_symbol(href,l1,0);
 {$ifdef powerpc}
         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.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}
         internalerror(2004010502);
 {$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;
 
 
@@ -407,9 +407,7 @@ const
                list.concat(taicpu.op_none(A_NOP));
            end
          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
        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
                     begin
                       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;
                   reference_reset_symbol(ref,l,0);
                   reference_reset_base(location.reference,cg.getaddressregister(exprasmlist),0);
@@ -99,9 +99,9 @@ unit nppcld;
                   if not(assigned(l)) then
                     begin
                       l:=objectlibrary.newasmsymbol('L'+tglobalvarsym(symtableentry).mangledname+'$non_lazy_ptr',AB_COMMON,AT_DATA);
-                      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;
 
                   reference_reset_symbol(ref,l,0);

+ 4 - 4
compiler/psub.pas

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

+ 33 - 33
compiler/ptconst.pas

@@ -99,9 +99,9 @@ implementation
          old_block_type:=block_type;
          block_type:=bt_const;
          if writable then
-           curconstsegment:=datasegment
+           curconstsegment:=asmlist[datasegment]
          else
-           curconstsegment:=consts;
+           curconstsegment:=asmlist[consts];
          case t.def.deftype of
             orddef:
               begin
@@ -304,8 +304,8 @@ implementation
                     else
                      varalign:=0;
                     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
                       begin
                         len:=tstringconstnode(p).len;
@@ -315,13 +315,13 @@ implementation
                          len:=255;
                         getmem(ca,len+2);
                         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
                     else
                       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
-                      Message(parser_e_illegal_expression);
+                      message(parser_e_illegal_expression);
                 end
               { maybe pwidechar ? }
               else
@@ -329,9 +329,9 @@ implementation
                    (p.nodetype<>addrn) then
                   begin
                     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
                       begin
                         { convert to widestring stringconstn }
@@ -341,9 +341,9 @@ implementation
                          begin
                            pw:=pcompilerwidestring(tstringconstnode(p).value_str);
                            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 }
-                           Consts.concat(Tai_const.Create_16bit(0))
+                           asmlist[consts].concat(Tai_const.Create_16bit(0))
                          end;
                       end
                     else
@@ -603,15 +603,15 @@ implementation
                      begin
                         { an empty ansi string is nil! }
                         if (strlength=0) then
-                          curconstSegment.concat(Tai_const.Create_sym(nil))
+                          curconstsegment.concat(Tai_const.Create_sym(nil))
                         else
                           begin
                             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);
                             move(strval^,ca^,strlength);
                             { 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 }
                             { tai_string.done, there is a freemem(len+1) (JM)             }
                             ca[strlength+1]:=#0;
-                            Consts.concat(Tai_string.Create_length_pchar(ca,strlength+1));
+                            asmlist[consts].concat(Tai_string.Create_length_pchar(ca,strlength+1));
                           end;
                      end;
                  {$ifdef ansistring_bits}
@@ -627,21 +627,21 @@ implementation
                      begin
                         { an empty ansi string is nil! }
                         if (strlength=0) then
-                          curconstSegment.concat(Tai_const.Create_ptr(0))
+                          curconstsegment.concat(Tai_const.Create_ptr(0))
                         else
                           begin
                             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 }
-                            Consts.concat(tai_align.create(const_align(pointer_size)));
+                            asmlist[consts].concat(tai_align.create(const_align(pointer_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 }
-                            Consts.concat(Tai_const.Create_64bit(strlength));
+                            asmlist[consts].concat(Tai_const.Create_64bit(strlength));
                             { redondent with maxlength but who knows ... (PM) }
                             { 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);
                             move(strval^,ca^,strlength);
                             { 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 }
                             { tai_string.done, there is a freemem(len+1) (JM)             }
                             ca[strlength+1]:=#0;
-                            Consts.concat(Tai_string.Create_length_pchar(ca,strlength+1));
+                            asmlist[consts].concat(Tai_string.Create_length_pchar(ca,strlength+1));
                           end;
                      end;
                  {$endif}
@@ -662,14 +662,14 @@ implementation
                           begin
                             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));
+                            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
-                              Consts.concat(Tai_const.Create_16bit(pcompilerwidestring(strval)^.data[i]));
+                              asmlist[consts].concat(Tai_const.Create_16bit(pcompilerwidestring(strval)^.data[i]));
                             { ending #0 }
-                            Consts.concat(Tai_const.Create_16bit(0))
+                            asmlist[consts].concat(Tai_const.Create_16bit(0))
                           end;
                      end;
                    st_longstring:

+ 2 - 2
compiler/rautils.pas

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

+ 1 - 1
compiler/sparc/cpupara.pas

@@ -171,7 +171,7 @@ implementation
              begin
                p.funcretloc[side].loc:=LOC_REGISTER;
                { 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
                else
                  p.funcretloc[side].register64.reghi:=NR_FUNCTION_RETURN64_HIGH_REG;

+ 5 - 5
compiler/sparc/ncpucnv.pas

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

+ 143 - 143
compiler/symdef.pas

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

+ 4 - 4
compiler/systems/t_beos.pas

@@ -165,10 +165,10 @@ begin
          begin
 {$ifdef i386}
            { 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}
          end;
       end

+ 10 - 10
compiler/systems/t_bsd.pas

@@ -88,8 +88,8 @@ implementation
 
     procedure timportlibdarwin.preparelib(const s : string);
       begin
-         if not(assigned(importssection)) then
-           importssection:=TAAsmoutput.create;
+         if asmlist[importsection]=nil then
+           asmlist[importsection]:=TAAsmoutput.create;
       end;
 
 
@@ -220,16 +220,16 @@ begin
          begin
 {$ifdef i386}
            { 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}
 {$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}
          end;
       end

+ 6 - 6
compiler/systems/t_linux.pas

@@ -156,7 +156,7 @@ procedure texportliblinux.generatelib;
 var
   hp2 : texported_item;
 begin
-  new_section(codesegment,sec_code,'',0);
+  new_section(asmlist[codesegment],sec_code,'',0);
   hp2:=texported_item(current_module._exports.first);
   while assigned(hp2) do
    begin
@@ -168,14 +168,14 @@ begin
         if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
          begin
            { 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
      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);
    end;
 end;

+ 4 - 4
compiler/systems/t_nwl.pas

@@ -242,10 +242,10 @@ begin
          begin
 {$ifdef i386}
            { 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}
          end;
       end

+ 4 - 4
compiler/systems/t_nwm.pas

@@ -234,10 +234,10 @@ begin
          begin
 {$ifdef i386}
            { 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}
          end;
       end

+ 5 - 5
compiler/systems/t_sunos.pas

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

+ 117 - 117
compiler/systems/t_win.pas

@@ -109,8 +109,8 @@ implementation
 
     procedure timportlibwin32.preparelib(const s : string);
       begin
-         if not(assigned(importssection)) then
-           importssection:=TAAsmoutput.create;
+         if asmlist[importsection]=nil then
+           asmlist[importsection]:=TAAsmoutput.create;
       end;
 
 
@@ -219,7 +219,7 @@ implementation
          hp2 : twin32imported_item;
          p : pchar;
       begin
-         new_section(importssection,sec_code,'',0);
+         new_section(asmlist[importsection],sec_code,'',0);
          hp1:=timportlist(current_module.imports.first);
          while assigned(hp1) do
            begin
@@ -230,9 +230,9 @@ implementation
                    p:=strpnew(#9+'EXTRN '+hp2.func^)
                  else
                    p:=strpnew(#9+'EXTERN '+hp2.func^);
-                 importssection.concat(tai_direct.create(p));
+                 asmlist[importsection].concat(tai_direct.create(p));
                  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);
                end;
              hp1:=timportlist(hp1.next);
@@ -267,33 +267,33 @@ implementation
              objectlibrary.getaddrlabel(lidata4);
              objectlibrary.getaddrlabel(lidata5);
            { 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 }
-             importsSection.concat(Tai_const.Create_rva_sym(lidata4));
+             asmlist[importsection].concat(Tai_const.Create_rva_sym(lidata4));
              { 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 }
-             importsSection.concat(Tai_const.Create_rva_sym(lname));
+             asmlist[importsection].concat(Tai_const.Create_rva_sym(lname));
              { 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 }
-             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 }
-             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 }
              hp2:=twin32imported_item(hp1.imported_items.first);
              while assigned(hp2) do
                begin
                  { insert cuts }
-                 importsSection.concat(Tai_cutobject.Create);
+                 asmlist[importsection].concat(Tai_cutobject.Create);
                  { create indirect jump }
                  if not hp2.is_var then
                   begin
@@ -303,47 +303,47 @@ implementation
                   {$endif ARM}
                     { place jump in codesegment, insert a code section in the
                       imporTSection to reduce the amount of .s files (PFV) }
-                    new_section(importsSection,sec_code,'',0);
+                    new_section(asmlist[importsection],sec_code,'',0);
 {$IfDef GDB}
                     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}
                     if assigned(hp2.procdef) then
                       mangledstring:=hp2.procdef.mangledname
                     else
                       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}
                     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);
-                    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);
-                    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}
                     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}
 {$IfDef GDB}
                     if (cs_debuginfo in aktmoduleswitches) and assigned(hp2.procdef) then
-                       hp2.procdef.concatstabto(importssection);
+                       hp2.procdef.concatstabto(asmlist[importsection]);
 {$EndIf GDB}
                   end;
                  { 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 }
                  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 }
-                 new_section(importsSection,sec_idata5,'',0);
+                 new_section(asmlist[importsection],sec_idata5,'',0);
                  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
-                  importsSection.concat(Tai_label.Create(lcode));
+                  asmlist[importsection].concat(Tai_label.Create(lcode));
 {$ifdef GDB}
                  if (cs_debuginfo in aktmoduleswitches) then
                   begin
@@ -356,7 +356,7 @@ implementation
                            inc(suffix);
                            importname:='__imp_'+hp2.name^+'_'+tostr(suffix);
                          end;
-                        importssection.concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                        asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                       end
                     else
                       begin
@@ -367,35 +367,35 @@ implementation
                            inc(suffix);
                            importname:='__imp_by_ordinal'+tostr(hp2.ordnr)+'_'+tostr(suffix);
                          end;
-                        importssection.concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                        asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                       end;
                   end;
 {$endif GDB}
                  if hp2.name^<>'' then
-                  importsSection.concat(Tai_const.Create_rva_sym(hp2.lab))
+                   asmlist[importsection].concat(Tai_const.Create_rva_sym(hp2.lab))
                  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 }
-                 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);
                end;
 
               { write final section }
-              importsSection.concat(Tai_cutobject.Create_end);
+              asmlist[importsection].concat(Tai_cutobject.Create_end);
               { 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 }
-              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 }
-              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);
            end;
@@ -423,45 +423,45 @@ implementation
          while assigned(hp1) do
            begin
               { 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 }
               objectlibrary.getlabel(l1);
               objectlibrary.getlabel(l2);
               objectlibrary.getlabel(l3);
-              new_section(importsSection,sec_idata2,'',0);
+              new_section(asmlist[importsection],sec_idata2,'',0);
               { 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 }
-              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 }
-              importsSection.concat(Tai_const.Create_rva_sym(l1));
+              asmlist[importsection].concat(Tai_const.Create_rva_sym(l1));
               { 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
                 create a lot of idata* }
 
               { 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);
               while assigned(hp2) do
                 begin
                    objectlibrary.getlabel(tasmlabel(hp2.lab));
                    if hp2.name^<>'' then
-                     importsSection.concat(Tai_const.Create_rva_sym(hp2.lab))
+                     asmlist[importsection].concat(Tai_const.Create_rva_sym(hp2.lab))
                    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);
                 end;
               { 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 }
-              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);
               while assigned(hp2) do
                 begin
@@ -473,35 +473,35 @@ implementation
                     {$endif ARM}
                       { create indirect jump and }
                       { place jump in codesegment }
-                      new_section(importsSection,sec_code,'',0);
+                      new_section(asmlist[importsection],sec_code,'',0);
 {$IfDef GDB}
                       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}
                       if assigned(hp2.procdef) then
                         mangledstring:=hp2.procdef.mangledname
                       else
                         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}
                       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);
-                      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);
-                      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}
                       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}
 {$IfDef GDB}
                       if (cs_debuginfo in aktmoduleswitches) and assigned(hp2.procdef) then
-                        hp2.procdef.concatstabto(importssection);
+                        hp2.procdef.concatstabto(asmlist[importsection]);
 {$EndIf GDB}
                       { add jump field to imporTSection }
-                      new_section(importsSection,sec_idata5,'',0);
+                      new_section(asmlist[importsection],sec_idata5,'',0);
 {$ifdef GDB}
                       if (cs_debuginfo in aktmoduleswitches) then
                        begin
@@ -514,7 +514,7 @@ implementation
                                inc(suffix);
                                importname:='__imp_'+hp2.name^+'_'+tostr(suffix);
                              end;
-                            importssection.concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                            asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                           end
                          else
                           begin
@@ -525,38 +525,38 @@ implementation
                                inc(suffix);
                                importname:='__imp_by_ordinal'+tostr(hp2.ordnr)+'_'+tostr(suffix);
                              end;
-                            importssection.concat(tai_symbol.createname(importname,AT_FUNCTION,4));
+                            asmlist[importsection].concat(tai_symbol.createname(importname,AT_FUNCTION,4));
                           end;
                        end;
 {$endif GDB}
-                      importsSection.concat(Tai_label.Create(l4));
+                      asmlist[importsection].concat(Tai_label.Create(l4));
                     end
                    else
                     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;
-                   importsSection.concat(Tai_const.Create_rva_sym(hp2.lab));
+                   asmlist[importsection].concat(Tai_const.Create_rva_sym(hp2.lab));
                    hp2:=twin32imported_item(hp2.next);
                 end;
               { finalize the addresses }
-              importsSection.concat(Tai_const.Create_32bit(0));
+              asmlist[importsection].concat(Tai_const.Create_32bit(0));
 
               { finally the import information }
-              new_section(importsSection,sec_idata6,'',0);
+              new_section(asmlist[importsection],sec_idata6,'',0);
               hp2:=twin32imported_item(hp1.imported_items.first);
               while assigned(hp2) do
                 begin
-                   importsSection.concat(Tai_label.Create(hp2.lab));
+                   asmlist[importsection].concat(Tai_label.Create(hp2.lab));
                    { 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);
                 end;
               { 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);
            end;
@@ -569,8 +569,8 @@ implementation
 
     procedure texportlibwin32.preparelib(const s:string);
       begin
-         if not(assigned(exportssection)) then
-           exportssection:=TAAsmoutput.create;
+         if asmlist[exportsection]=nil then
+           asmlist[exportsection]:=TAAsmoutput.create;
          EList_indexed:=tList.Create;
          EList_nonindexed:=tList.Create;
          objectlibrary.getdatalabel(edatalabel);
@@ -734,38 +734,38 @@ implementation
          { we must also count the holes !! }
          entries:=ordinal_max-ordinal_base+1;
 
-         new_section(exportsSection,sec_edata,'',0);
+         new_section(asmlist[exportsection],sec_edata,'',0);
          { create label to reference from main so smartlink will include
            the .edata section }
-         exportsSection.concat(Tai_symbol.Create_global(edatalabel,0));
+         asmlist[exportsection].concat(Tai_symbol.Create_global(edatalabel,0));
          { export flags }
-         exportsSection.concat(Tai_const.Create_32bit(0));
+         asmlist[exportsection].concat(Tai_const.Create_32bit(0));
          { date/time stamp }
-         exportsSection.concat(Tai_const.Create_32bit(0));
+         asmlist[exportsection].concat(Tai_const.Create_32bit(0));
          { major version }
-         exportsSection.concat(Tai_const.Create_16bit(0));
+         asmlist[exportsection].concat(Tai_const.Create_16bit(0));
          { minor version }
-         exportsSection.concat(Tai_const.Create_16bit(0));
+         asmlist[exportsection].concat(Tai_const.Create_16bit(0));
          { 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 }
-         exportsSection.concat(Tai_const.Create_32bit(ordinal_base));
+         asmlist[exportsection].concat(Tai_const.Create_32bit(ordinal_base));
          { number of entries }
-         exportsSection.concat(Tai_const.Create_32bit(entries));
+         asmlist[exportsection].concat(Tai_const.Create_32bit(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 }
-         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 }
-         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 }
-         exportsSection.concat(Tai_const.Create_rva_sym(export_ordinal_table));
+         asmlist[exportsection].concat(Tai_const.Create_rva_sym(export_ordinal_table));
          { the name }
-         exportsSection.concat(Tai_label.Create(dll_name_label));
+         asmlist[exportsection].concat(Tai_label.Create(dll_name_label));
          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
-           exportsSection.concat(Tai_string.Create(st+target_info.sharedlibext+#0));
+           asmlist[exportsection].concat(Tai_string.Create(st+target_info.sharedlibext+#0));
 
          {  export address table }
          address_table:=TAAsmoutput.create;
@@ -834,10 +834,10 @@ implementation
               hp:=texported_item(hp.next);
            end;
 
-         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;
          name_table_pointers.free;
          ordinal_table.free;
@@ -851,7 +851,7 @@ implementation
          p  : pchar;
          s  : string;
       begin
-         new_section(exportssection,sec_code,'',0);
+         new_section(asmlist[exportsection],sec_code,'',0);
          hp:=texported_item(current_module._exports.first);
          while assigned(hp) do
            begin
@@ -866,7 +866,7 @@ implementation
                  s:='';
              end;
              p:=strpnew(#9+'export '+s+' '+hp.name^+' '+tostr(hp.index));
-             exportssection.concat(tai_direct.create(p));
+             asmlist[exportsection].concat(tai_direct.create(p));
              hp:=texported_item(hp.next);
            end;
       end;

+ 10 - 10
compiler/x86/agx86int.pas

@@ -390,7 +390,7 @@ implementation
       { lineinfo is only needed for codesegment (PFV) }
       do_line:=((cs_asm_source in aktglobalswitches) or
                 (cs_lineinfo in aktmoduleswitches))
-                 and (p=codesegment);
+                 and (p=asmlist[codesegment]);
       InlineLevel:=0;
       DoNotSplitLine:=false;
       hp:=tai(p.first);
@@ -875,17 +875,17 @@ implementation
     { INTEL ASM doesn't support stabs
       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
         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');
       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));
 
                    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);
 
                    { I got these constant from a test program (FK) }
                    if is_double(resulttype.def) then
                      begin
                        { 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));
                      end
                    else if is_single(resulttype.def) then
                      begin
                        { 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));
                      end
                    else
@@ -359,14 +359,14 @@ implementation
 
                    exprasmlist.concat(taicpu.op_ref(A_FILD,S_IQ,left.location.reference));
                    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) }
-                   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);
-                   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);
                 end
               else

+ 4 - 4
compiler/x86/nx86mat.pas

@@ -177,14 +177,14 @@ interface
             reg:=cg.getmmregister(exprasmlist,def_cgsize(resulttype.def));
 
             objectlibrary.getdatalabel(l1);
-            consts.concat(Tai_label.Create(l1));
+            asmlist[consts].concat(Tai_label.Create(l1));
             case def_cgsize(resulttype.def) of
               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:
                 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
               else
                 internalerror(2004110215);

+ 2 - 2
compiler/x86_64/cpuinfo.pas

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