Browse Source

* x86: clean up and place jump tables into sec_rodata on all targets. Effectively it does not change anything, because sec_rodata with relocations still go into writable data at assembler level.

git-svn-id: trunk@26885 -
sergei 11 years ago
parent
commit
31d160aaf5
1 changed files with 3 additions and 10 deletions
  1. 3 10
      compiler/x86/nx86set.pas

+ 3 - 10
compiler/x86/nx86set.pas

@@ -72,7 +72,6 @@ implementation
         indexreg : tregister;
         indexreg : tregister;
         href : treference;
         href : treference;
         jtlist: tasmlist;
         jtlist: tasmlist;
-        sectype: TAsmSectiontype;
         opcgsize: tcgsize;
         opcgsize: tcgsize;
 
 
         procedure genitem(list:TAsmList;t : pcaselabel);
         procedure genitem(list:TAsmList;t : pcaselabel);
@@ -134,16 +133,10 @@ implementation
         emit_ref(A_JMP,S_NO,href);
         emit_ref(A_JMP,S_NO,href);
         { generate jump table }
         { generate jump table }
         if (target_info.system in [system_i386_darwin,system_i386_iphonesim]) then
         if (target_info.system in [system_i386_darwin,system_i386_iphonesim]) then
-          begin
-            jtlist:=current_asmdata.asmlists[al_const];
-            sectype:=sec_rodata;
-          end
+          jtlist:=current_asmdata.asmlists[al_const]
         else
         else
-          begin
-            jtlist:=current_procinfo.aktlocaldata;
-            sectype:=sec_data;
-          end;
-        new_section(jtlist,sectype,current_procinfo.procdef.mangledname,sizeof(aint));
+          jtlist:=current_procinfo.aktlocaldata;
+        new_section(jtlist,sec_rodata,current_procinfo.procdef.mangledname,sizeof(aint));
         jtlist.concat(Tai_label.Create(table));
         jtlist.concat(Tai_label.Create(table));
         genitem(jtlist,hp);
         genitem(jtlist,hp);
       end;
       end;