Browse Source

* moved insertation of pc relative data for arm target

git-svn-id: trunk@2438 -
florian 19 years ago
parent
commit
d28d7e3c12
1 changed files with 8 additions and 4 deletions
  1. 8 4
      compiler/psub.pas

+ 8 - 4
compiler/psub.pas

@@ -957,16 +957,20 @@ implementation
               end;
 {$endif NoOpt}
 
-            { Add end symbol and debug info }
-            aktfilepos:=exitpos;
-            gen_proc_symbol_end(templist);
-            aktproccode.concatlist(templist);
 
 {$ifdef ARM}
             { because of the limited constant size of the arm, all data access is done pc relative }
             insertpcrelativedata(aktproccode,aktlocaldata);
 {$endif ARM}
 
+            { Add end symbol and debug info }
+            { this must be done after the pcrelativedata is appended else the distance calculation of
+              insertpcrelativedata will be wrong, further the pc indirect data is part of the procedure
+              so it should be inserted before the end symbol (FK)
+            }
+            aktfilepos:=exitpos;
+            gen_proc_symbol_end(templist);
+            aktproccode.concatlist(templist);
 {$ifdef POWERPC}
             fixup_jmps(aktproccode);
 {$endif POWERPC}