瀏覽代碼

* Changed section for ansi/wide/unicodestring constants, resourcestrings (content only) and dataconstnodes from sec_rodata to sec_rodata_norel, because they never contain relocations.

git-svn-id: trunk@23017 -
sergei 12 年之前
父節點
當前提交
afd34cf9d5
共有 3 個文件被更改,包括 5 次插入5 次删除
  1. 2 2
      compiler/asmutils.pas
  2. 1 1
      compiler/cresstr.pas
  3. 2 2
      compiler/ncgcon.pas

+ 2 - 2
compiler/asmutils.pas

@@ -62,7 +62,7 @@ uses
         if NewSection then
           begin
             maybe_new_object_file(list);
-            new_section(list,sec_rodata,result.lab.name,const_align(sizeof(pint)));
+            new_section(list,sec_rodata_norel,result.lab.name,const_align(sizeof(pint)));
           end;
         { put label before header on Darwin, because there the linker considers
           a global symbol to be the start of a new subsection }
@@ -105,7 +105,7 @@ uses
         current_asmdata.getdatalabel(result.lab);
         result.ofs:=0;
         maybe_new_object_file(list);
-        new_section(list,sec_rodata,result.lab.name,const_align(sizeof(pint)));
+        new_section(list,sec_rodata_norel,result.lab.name,const_align(sizeof(pint)));
         strlength := getlengthwidestring(pcompilerwidestring(data));
         if Winlike then
           begin

+ 1 - 1
compiler/cresstr.pas

@@ -163,7 +163,7 @@ uses
         R:=TResourceStringItem(List.First);
         while assigned(R) do
           begin
-            new_section(current_asmdata.asmlists[al_const],sec_rodata,make_mangledname('RESSTR',current_module.localsymtable,'d_'+r.name),sizeof(pint));
+            new_section(current_asmdata.asmlists[al_const],sec_rodata_norel,make_mangledname('RESSTR',current_module.localsymtable,'d_'+r.name),sizeof(pint));
             { Write default value }
             if assigned(R.value) and (R.len<>0) then
               valuelab:=emit_ansistring_const(current_asmdata.asmlists[al_const],R.Value,R.Len,getansistringcodepage,False)

+ 2 - 2
compiler/ncgcon.pas

@@ -81,7 +81,7 @@ implementation
 
 
 {*****************************************************************************
-                           TCGREALCONSTNODE
+                           TCGDATACONSTNODE
 *****************************************************************************}
 
     procedure tcgdataconstnode.pass_generate_code;
@@ -93,7 +93,7 @@ implementation
         location_reset_ref(location,LOC_CREFERENCE,OS_NO,const_align(maxalign));
         current_asmdata.getdatalabel(l);
         maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
-        new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata,l.name,const_align(maxalign));
+        new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,l.name,const_align(maxalign));
         current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(l));
         data.seek(0);
         for i:=0 to data.size-1 do