diff --git a/compiler/systems/t_win.pas b/compiler/systems/t_win.pas index 1a5da90202..6c5f63d9cb 100644 --- a/compiler/systems/t_win.pas +++ b/compiler/systems/t_win.pas @@ -953,6 +953,12 @@ begin if not ObjectFiles.Empty then begin LinkRes.Add('INPUT('); + { For wince external startup file is used and placed first, } + { because ARM prolog structure must be located at the very } + { beginning of code. Otherwise exceptions do not work properly. } + if target_info.system in [system_arm_wince,system_i386_wince] then + LinkRes.AddFileName(MaybeQuoted(FindObjectFile('wprt0','',false))); + while not ObjectFiles.Empty do begin s:=ObjectFiles.GetFirst; diff --git a/rtl/wince/system.pp b/rtl/wince/system.pp index aab766c284..0a627ecade 100644 --- a/rtl/wince/system.pp +++ b/rtl/wince/system.pp @@ -23,9 +23,6 @@ interface {$define WINCE_EXCEPTION_HANDLING} -{ Startup code } -{$L wprt0.o} - { include system-independent routine headers } {$I systemh.inc}