Browse Source

* fix arm-wince exception handling.

git-svn-id: trunk@5375 -
yury 18 years ago
parent
commit
87d5058dec
2 changed files with 19 additions and 17 deletions
  1. 19 0
      compiler/arm/aasmcpu.pas
  2. 0 17
      compiler/pmodules.pas

+ 19 - 0
compiler/arm/aasmcpu.pas

@@ -236,6 +236,8 @@ uses
 
 
     { inserts pc relative symbols at places where they are reachable }
     { inserts pc relative symbols at places where they are reachable }
     procedure insertpcrelativedata(list,listtoinsert : TAsmList);
     procedure insertpcrelativedata(list,listtoinsert : TAsmList);
+    { inserts .pdata section and dummy function prolog needed for arm-wince exception handling }
+    procedure InsertPData;
 
 
     procedure InitAsm;
     procedure InitAsm;
     procedure DoneAsm;
     procedure DoneAsm;
@@ -723,6 +725,23 @@ implementation
         curdata.free;
         curdata.free;
       end;
       end;
 
 
+    procedure InsertPData;
+      var
+        prolog: TAsmList;
+      begin
+        prolog:=TAsmList.create;
+        new_section(prolog,sec_code,'FPC_EH_PROLOG',sizeof(aint),secorder_begin);
+        prolog.concat(Tai_const.Createname('_ARM_ExceptionHandler', 0));
+        prolog.concat(Tai_const.Create_32bit(0));
+        prolog.concat(Tai_symbol.Createname_global('FPC_EH_CODE_START',AT_DATA,0));
+        { dummy function }
+        prolog.concat(taicpu.op_reg_reg(A_MOV,NR_R15,NR_R14));
+        current_asmdata.asmlists[al_start].insertList(prolog);
+        prolog.Free;
+        new_section(current_asmdata.asmlists[al_end],sec_pdata,'',sizeof(aint));
+        current_asmdata.asmlists[al_end].concat(Tai_const.Createname('FPC_EH_CODE_START', 0));
+        current_asmdata.asmlists[al_end].concat(Tai_const.Create_32bit($ffffff01));
+      end;
 
 
 (*
 (*
       Floating point instruction format information, taken from the linux kernel
       Floating point instruction format information, taken from the linux kernel

+ 0 - 17
compiler/pmodules.pas

@@ -222,23 +222,6 @@ implementation
          ltvTable.Free;
          ltvTable.Free;
       end;
       end;
 
 
-{$ifdef arm}
-    procedure InsertPData;
-      var
-        prolog: TAsmList;
-      begin
-        prolog:=TAsmList.create;
-        new_section(prolog,sec_code,'FPC_EH_PROLOG',sizeof(aint),secorder_begin);
-        prolog.concat(Tai_const.Createname('_ARM_ExceptionHandler', 0));
-        prolog.concat(Tai_const.Create_32bit(0));
-        prolog.concat(Tai_symbol.Createname_global('FPC_EH_CODE_START',AT_DATA,0));
-        current_asmdata.asmlists[al_start].insertList(prolog);
-        prolog.Free;
-        new_section(current_asmdata.asmlists[al_end],sec_pdata,'',sizeof(aint));
-        current_asmdata.asmlists[al_end].concat(Tai_const.Createname('FPC_EH_CODE_START', 0));
-        current_asmdata.asmlists[al_end].concat(Tai_const.Create_32bit($cfffff02));
-      end;
-{$endif arm}
 
 
     Procedure InsertResourceInfo;
     Procedure InsertResourceInfo;