Procházet zdrojové kódy

* fixed asd_references for ansi/widestrings on Darwin

git-svn-id: trunk@11658 -
Jonas Maebe před 17 roky
rodič
revize
3f39c95163
2 změnil soubory, kde provedl 12 přidání a 10 odebrání
  1. 8 6
      compiler/ncgcon.pas
  2. 4 4
      compiler/ptconst.pas

+ 8 - 6
compiler/ncgcon.pas

@@ -327,13 +327,14 @@ implementation
                                 current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(l1));
                                 current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_pint(-1));
                                 current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_pint(len));
-                                current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(lastlabel));
+
                                 { make sure the string doesn't get dead stripped if the header is referenced }
                                 if (target_info.system in systems_darwin) then
-                                  current_asmdata.asmlists[al_typedconsts].concat(tai_directive.create(asd_reference,l1.name));
+                                  current_asmdata.asmlists[al_typedconsts].concat(tai_directive.create(asd_reference,lastlabel.name));
+                                current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(lastlabel));
                                 { ... and vice versa }
                                 if (target_info.system in systems_darwin) then
-                                  current_asmdata.asmlists[al_typedconsts].concat(tai_directive.create(asd_reference,lab_str.name));
+                                  current_asmdata.asmlists[al_typedconsts].concat(tai_directive.create(asd_reference,l1.name));
                                 { include also terminating zero }
                                 getmem(pc,len+1);
                                 move(value_str^,pc^,len);
@@ -359,13 +360,14 @@ implementation
                                     current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_pint(-1));
                                     current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_pint(len*cwidechartype.size));
                                   end;
-                                current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(lastlabel));
+
                                 { make sure the string doesn't get dead stripped if the header is referenced }
                                 if (target_info.system in systems_darwin) then
-                                  current_asmdata.asmlists[al_typedconsts].concat(tai_directive.create(asd_reference,l1.name));
+                                  current_asmdata.asmlists[al_typedconsts].concat(tai_directive.create(asd_reference,lastlabel.name));
+                                current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(lastlabel));
                                 { ... and vice versa }
                                 if (target_info.system in systems_darwin) then
-                                  current_asmdata.asmlists[al_typedconsts].concat(tai_directive.create(asd_reference,lab_str.name));
+                                  current_asmdata.asmlists[al_typedconsts].concat(tai_directive.create(asd_reference,l1.name));
                                 for i:=0 to len-1 do
                                   current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_16bit(pcompilerwidestring(value_str)^.data[i]));
                                 { terminating zero }

+ 4 - 4
compiler/ptconst.pas

@@ -711,11 +711,11 @@ implementation
                          current_asmdata.asmlists[al_const].concat(Tai_const.Create_pint(strlength));
                          { make sure the string doesn't get dead stripped if the header is referenced }
                          if (target_info.system in systems_darwin) then
-                           current_asmdata.asmlists[al_typedconsts].concat(tai_directive.create(asd_reference,ll.name));
+                           current_asmdata.asmlists[al_const].concat(tai_directive.create(asd_reference,ll.name));
                          current_asmdata.asmlists[al_const].concat(Tai_label.Create(ll));
                          { ... and vice versa }
                          if (target_info.system in systems_darwin) then
-                           list.concat(tai_directive.create(asd_reference,ll2.name));
+                           current_asmdata.asmlists[al_const].concat(tai_directive.create(asd_reference,ll2.name));
                          getmem(ca,strlength+1);
                          move(strval^,ca^,strlength);
                          { The terminating #0 to be stored in the .data section (JM) }
@@ -745,11 +745,11 @@ implementation
                            end;
                          { make sure the string doesn't get dead stripped if the header is referenced }
                          if (target_info.system in systems_darwin) then
-                           current_asmdata.asmlists[al_typedconsts].concat(tai_directive.create(asd_reference,ll.name));
+                           current_asmdata.asmlists[al_const].concat(tai_directive.create(asd_reference,ll.name));
                          current_asmdata.asmlists[al_const].concat(Tai_label.Create(ll));
                          { ... and vice versa }
                          if (target_info.system in systems_darwin) then
-                           current_asmdata.asmlists[al_typedconsts].concat(tai_directive.create(asd_reference,ll2.name));
+                           current_asmdata.asmlists[al_const].concat(tai_directive.create(asd_reference,ll2.name));
                          for i:=0 to strlength-1 do
                            current_asmdata.asmlists[al_const].concat(Tai_const.Create_16bit(pcompilerwidestring(strval)^.data[i]));
                          { ending #0 }