Index: compiler/systems/i_symbian.pas
===================================================================
--- compiler/systems/i_symbian.pas	(revision 6898)
+++ compiler/systems/i_symbian.pas	(working copy)
@@ -58,7 +58,7 @@
             Cprefix      : '_';
             newline      : #13#10;
             dirsep       : '\';
-            assem        : as_i386_pecoff;
+            assem        : as_gas;
             assemextern  : as_gas;
             link         : nil;
             linkextern   : nil;
Index: rtl/symbian/system.pp
===================================================================
--- rtl/symbian/system.pp	(revision 6898)
+++ rtl/symbian/system.pp	(working copy)
@@ -152,31 +152,39 @@
 end;
 
 {*****************************************************************************
-                         Exit code and Entry Point
+                         System Dependent Exit code
 *****************************************************************************}
 
-procedure PascalMain; stdcall; external name 'PASCALMAIN';
-procedure fpc_do_exit; stdcall; external name 'FPC_DO_EXIT';
+//procedure PascalMain; stdcall; external name 'PASCALMAIN';
+//procedure fpc_do_exit; stdcall; external name 'FPC_DO_EXIT';
 
-procedure SysInitStdIO;
+Procedure system_exit;
 begin
 
 end;
 
-procedure _E32Startup; stdcall; public name '_E32Startup';
+var
+  { value of the stack segment
+    to check if the call stack can be written on exceptions }
+  _SS : Cardinal;
+
+function Pascal_E32Main: Integer; cdecl; [public, alias: '_Pascal_E32Main'];
+var
+  ST : pointer;
 begin
-  IsLibrary:=false;
-  
-  PascalMain;
+  IsLibrary := false;
 
+//  PascalMain;
+
   { if we pass here there was no error }
-  fpc_do_exit;
+  system_exit;
 end;
 
-{*****************************************************************************
-                         Process routines
-*****************************************************************************}
+procedure SysInitStdIO;
+begin
 
+end;
+
 (* ProcessID cached to avoid repeated calls to GetCurrentProcess. *)
 
 var
@@ -192,5 +200,11 @@
   result := stklen;
 end;
 
+{
+const
+   Exe_entry_code : pointer = @Exe_entry;
+   Dll_entry_code : pointer = @Dll_entry;
+}
+
 begin
 end.
