Browse Source

* cleaned up handling of Darwin non-lazy pointer sections: create sections
as needed, instead of once when initialising the list (currently nothing
else is added to that asmlist so it was safe, but it was not robust)

git-svn-id: trunk@15742 -

Jonas Maebe 15 years ago
parent
commit
99aece6230
2 changed files with 5 additions and 5 deletions
  1. 0 3
      compiler/aasmdata.pas
  2. 5 2
      compiler/cgobj.pas

+ 0 - 3
compiler/aasmdata.pas

@@ -332,9 +332,6 @@ implementation
         for hal:=low(TAsmListType) to high(TAsmListType) do
           AsmLists[hal]:=TAsmList.create;
         WideInits :=TLinkedList.create;
-        { PIC data }
-        if (target_info.system in [system_powerpc_darwin,system_powerpc64_darwin,system_i386_darwin,system_arm_darwin]) then
-          new_section(AsmLists[al_picdata],sec_data_nonlazy,'',sizeof(pint));
         { CFI }
         FAsmCFI:=CAsmCFI.Create;
       end;

+ 5 - 2
compiler/cgobj.pas

@@ -4169,6 +4169,7 @@ implementation
       var
         l: tasmsymbol;
         ref: treference;
+        nlsymname: string;
       begin
         result := NR_NO;
         case target_info.system of
@@ -4177,10 +4178,12 @@ implementation
           system_powerpc64_darwin,
           system_arm_darwin:
             begin
-              l:=current_asmdata.getasmsymbol('L'+symname+'$non_lazy_ptr');
+              nlsymname:='L'+symname+'$non_lazy_ptr';
+              l:=current_asmdata.getasmsymbol(nlsymname);
               if not(assigned(l)) then
                 begin
-                  l:=current_asmdata.DefineAsmSymbol('L'+symname+'$non_lazy_ptr',AB_LOCAL,AT_DATA);
+                  new_section(current_asmdata.asmlists[al_picdata],sec_data_nonlazy,'',sizeof(pint));
+                  l:=current_asmdata.DefineAsmSymbol(nlsymname,AB_LOCAL,AT_DATA);
                   current_asmdata.asmlists[al_picdata].concat(tai_symbol.create(l,0));
                   if not(weak) then
                     current_asmdata.asmlists[al_picdata].concat(tai_directive.Create(asd_indirect_symbol,current_asmdata.RefAsmSymbol(symname).Name))