Index: bsp_specs
===================================================================
--- bsp_specs	(revision 192)
+++ bsp_specs	(working copy)
@@ -1,23 +1,20 @@
-%rename cpp old_cpp
 %rename lib old_lib
 %rename endfile old_endfile
 %rename startfile old_startfile
 %rename link old_link
 
-*cpp:
-%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
 
 *lib:
-%{!qrtems: %(old_lib)} %{!nostdlib: %{qrtems: ecrti%O%s --start-group \
+%{!qrtems: %(old_lib)} %{!nostdlib: %{qrtems: --start-group \
 %{!qrtems_debug: -lrtemsbsp -lrtemscpu} %{qrtems_debug: -lrtemsbsp_g -lrtemscpu_g} \
--lc -lgcc --end-group \
+-lc -lgcc --end-group  \
 %{!qnolinkcmds: -T linkcmds%s}}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems: \
-%{!qrtems_debug: } \
-%{qrtems_debug: }}}
+%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems:  ecrti%O%s crtbegin.o%s }}
 
 *link:
 %{!qrtems: %(old_link)} %{qrtems: -dc -dp -u __vectors -u download_entry -N }
 
+*endfile:
+%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s ecrtn.o%s}
--- /dev/null	2004-02-23 21:02:56.000000000 +0000
+++ startup/rtems_crti.S	2005-05-26 15:42:32.000000000 +0100
@@ -0,0 +1,33 @@
+/* rtems_crti.S */
+#include <asm.h>
+
+	/* terminate the __init() function and create
+	 * a new head '_init' for use by RTEMS to 
+	 * invoke C++ global constructors
+	 * NOTE: it is essential that this snippet
+	 * is hooked between ecrti and crtbegin
+	 * 
+	 * ecrti has the following .init section:
+	 * __init:
+	 *    stwu r1,-16(r1)
+	 *    mflr r0
+	 *    stw  r0,20(r1)
+	 *
+	 * The reason for this is that we want to call
+	 * __eabi() at an early stage but prevent __eabi()
+	 * from branching to __init (C++ exception init
+	 * and global CTORs). Hence we make __init a no-op
+	 * and create a new entry point:
+	 */
+	.section ".init","ax"
+	.align 2
+	lwz		r0,r20(r1)
+	mtlr	r0
+	addi	r1,r1,16
+	blr
+	.globl	_init
+	.type	_init,@function
+_init:
+	stwu	r1,-16(r1)
+	mflr	r0
+	stw		r0,20(r1)	
Index: startup/Makefile.am
===================================================================
--- startup/Makefile.am	(revision 192)
+++ startup/Makefile.am	(working copy)
@@ -11,8 +11,11 @@
     setvec.c gnatinstallhandler.c
 C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
 
-OBJS = $(C_O_FILES)
+S_FILES = rtems_crti.S
+S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
 
+OBJS = $(C_O_FILES) $(S_O_FILES)
+
 include $(top_srcdir)/../../../../../../automake/compile.am
 include $(top_srcdir)/../../../../../../automake/lib.am
 
@@ -35,6 +38,6 @@
 
 .PRECIOUS: $(PGM)
 
-EXTRA_DIST = bspclean.c bspstart.c linkcmds linkcmds.dl setvec.c
+EXTRA_DIST = bspclean.c bspstart.c linkcmds linkcmds.dl setvec.c rtems_crti.S
 
 include $(top_srcdir)/../../../../../../automake/local.am
