Ver código fonte

* 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 anos atrás
pai
commit
afd34cf9d5
3 arquivos alterados com 5 adições e 5 exclusões
  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
         if NewSection then
           begin
           begin
             maybe_new_object_file(list);
             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;
           end;
         { put label before header on Darwin, because there the linker considers
         { put label before header on Darwin, because there the linker considers
           a global symbol to be the start of a new subsection }
           a global symbol to be the start of a new subsection }
@@ -105,7 +105,7 @@ uses
         current_asmdata.getdatalabel(result.lab);
         current_asmdata.getdatalabel(result.lab);
         result.ofs:=0;
         result.ofs:=0;
         maybe_new_object_file(list);
         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));
         strlength := getlengthwidestring(pcompilerwidestring(data));
         if Winlike then
         if Winlike then
           begin
           begin

+ 1 - 1
compiler/cresstr.pas

@@ -163,7 +163,7 @@ uses
         R:=TResourceStringItem(List.First);
         R:=TResourceStringItem(List.First);
         while assigned(R) do
         while assigned(R) do
           begin
           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 }
             { Write default value }
             if assigned(R.value) and (R.len<>0) then
             if assigned(R.value) and (R.len<>0) then
               valuelab:=emit_ansistring_const(current_asmdata.asmlists[al_const],R.Value,R.Len,getansistringcodepage,False)
               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;
     procedure tcgdataconstnode.pass_generate_code;
@@ -93,7 +93,7 @@ implementation
         location_reset_ref(location,LOC_CREFERENCE,OS_NO,const_align(maxalign));
         location_reset_ref(location,LOC_CREFERENCE,OS_NO,const_align(maxalign));
         current_asmdata.getdatalabel(l);
         current_asmdata.getdatalabel(l);
         maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
         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));
         current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(l));
         data.seek(0);
         data.seek(0);
         for i:=0 to data.size-1 do
         for i:=0 to data.size-1 do