Pārlūkot izejas kodu

* align all code/data sections to sizeof(pint), instead of sometimes
to 0 or 1 (section alignment <> alignment of individual data
elements in section on some platforms, such as AIX)
* set constalignmin and varalignmin to 8 bytes for AIX/ppc64

git-svn-id: trunk@21044 -

Jonas Maebe 13 gadi atpakaļ
vecāks
revīzija
6502717e67
4 mainītis faili ar 8 papildinājumiem un 8 dzēšanām
  1. 1 1
      compiler/aggas.pas
  2. 4 4
      compiler/dbgstabs.pas
  3. 1 1
      compiler/nobj.pas
  4. 2 2
      compiler/systems/i_aix.pas

+ 1 - 1
compiler/aggas.pas

@@ -470,7 +470,7 @@ implementation
         l: longint;
       begin
         if (secalign=0) or
-           not(atype in [sec_code,sec_bss,sec_rodata_norel]) then
+           not(atype in [sec_code,sec_bss,sec_rodata_norel,sec_rodata,sec_data]) then
           begin
             result:='';
             exit;

+ 4 - 4
compiler/dbgstabs.pas

@@ -1619,11 +1619,11 @@ implementation
         current_module.flags:=current_module.flags or uf_has_stabs_debuginfo;
         if not(target_info.system in systems_darwin) then
           begin
-            new_section(current_asmdata.asmlists[al_stabs],sec_data,GetSymTableName(current_module.localsymtable),0);
+            new_section(current_asmdata.asmlists[al_stabs],sec_data,GetSymTableName(current_module.localsymtable),sizeof(pint));
             current_asmdata.asmlists[al_stabs].concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.localsymtable,''),AT_DATA,0));
           end
         else
-          new_section(current_asmdata.asmlists[al_stabs],sec_code,GetSymTableName(current_module.localsymtable),0);
+          new_section(current_asmdata.asmlists[al_stabs],sec_code,GetSymTableName(current_module.localsymtable),sizeof(pint));
 
         { write all global/local variables. This will flag all required tdefs  }
         if assigned(current_module.globalsymtable) then
@@ -1756,7 +1756,7 @@ implementation
         { emit main source n_sourcefile for start of module }
         current_asmdata.getlabel(hlabel,alt_dbgfile);
         infile:=current_module.sourcefiles.get_file(1);
-        new_section(current_asmdata.asmlists[al_start],sec_code,make_mangledname('DEBUGSTART',current_module.localsymtable,''),0,secorder_begin);
+        new_section(current_asmdata.asmlists[al_start],sec_code,make_mangledname('DEBUGSTART',current_module.localsymtable,''),sizeof(pint),secorder_begin);
         if not(target_info.system in systems_darwin) then
           current_asmdata.asmlists[al_start].concat(tai_symbol.Createname_global(make_mangledname('DEBUGSTART',current_module.localsymtable,''),AT_DATA,0));
         current_asmdata.asmlists[al_start].concat(Tai_stab.Create_str(stabsdir,'"'+BsToSlash(FixPath(getcurrentdir,false))+'",'+
@@ -1771,7 +1771,7 @@ implementation
           current_asmdata.asmlists[al_end].concat(Tai_stab.Create_str(stabsdir,'"",'+base_stabs_str(STABS_N_OSO,'0','0','0')));
         { emit empty n_sourcefile for end of module }
         current_asmdata.getlabel(hlabel,alt_dbgfile);
-        new_section(current_asmdata.asmlists[al_end],sec_code,make_mangledname('DEBUGEND',current_module.localsymtable,''),0,secorder_end);
+        new_section(current_asmdata.asmlists[al_end],sec_code,make_mangledname('DEBUGEND',current_module.localsymtable,''),sizeof(pint),secorder_end);
         if not(target_info.system in systems_darwin) then
           current_asmdata.asmlists[al_end].concat(tai_symbol.Createname_global(make_mangledname('DEBUGEND',current_module.localsymtable,''),AT_DATA,0));
         current_asmdata.asmlists[al_end].concat(Tai_stab.Create_str(stabsdir,'"",'+base_stabs_str(stabs_n_sourcefile,'0','0',hlabel.name)));

+ 1 - 1
compiler/nobj.pas

@@ -1393,7 +1393,7 @@ implementation
         end;
       maybe_new_object_file(current_asmdata.asmlists[al_globals]);
       s:=make_mangledname('IIDSTR',_class.owner,_class.objname^);
-      new_section(current_asmdata.asmlists[al_globals],sec_rodata,s,0);
+      new_section(current_asmdata.asmlists[al_globals],sec_rodata,s,sizeof(pint));
       current_asmdata.asmlists[al_globals].concat(Tai_symbol.Createname_global(s,AT_DATA,0));
       current_asmdata.asmlists[al_globals].concat(Tai_const.Create_8bit(length(_class.iidstr^)));
       current_asmdata.asmlists[al_globals].concat(Tai_string.Create(_class.iidstr^));

+ 2 - 2
compiler/systems/i_aix.pas

@@ -138,9 +138,9 @@ unit i_aix;
                 procalign       : 8;
                 loopalign       : 4;
                 jumpalign       : 0;
-                constalignmin   : 4;
+                constalignmin   : 8;
                 constalignmax   : 16;
-                varalignmin     : 4;
+                varalignmin     : 8;
                 varalignmax     : 16;
                 localalignmin   : 0;
                 localalignmax   : 16;