--- libgcc2.c.orig	Fri Oct 21 13:13:56 1994
+++ libgcc2.c	Wed Nov 16 09:02:17 1994
@@ -1683,7 +1683,11 @@
   write (2, MESSAGE, sizeof (MESSAGE));
   /* don't call exit () because that may call global destructors which
      may cause a loop.  */
+#ifdef VXWORKS
+  exit(-1);
+#else
   _exit (-1);
+#endif /* VXWORKS */  
 }
 #endif
 
@@ -2022,6 +2026,17 @@
   DO_GLOBAL_CTORS_BODY;
   ON_EXIT (__do_global_dtors, 0);
 }
+#else
+#ifdef VXWORKS
+void
+__do_global_ctors ()
+{
+/*  DO_GLOBAL_CTORS_BODY;*/
+  func_ptr *p;
+  for (p = __CTOR_LIST__ + 1; *p; )
+    (*p++) ();
+}
+#endif /* VXWORKS */
 #endif /* no INIT_SECTION_ASM_OP */
 
 #if !defined (INIT_SECTION_ASM_OP) || defined (INVOKE__main)
@@ -2044,6 +2059,12 @@
       __do_global_ctors ();
     }
 }
+#else
+#ifdef VXWORKS
+SYMBOL__MAIN ()
+{
+}
+#endif /* VXWORKS */
 #endif /* no INIT_SECTION_ASM_OP or INVOKE__main */
 
 #endif /* L__main */
@@ -2059,6 +2080,12 @@
 
 /* We declare the lists here with two elements each,
    so that they are valid empty lists if no other definition is loaded.  */
+#ifdef VXWORKS
+#ifdef INIT_SECTION_ASM_OP
+#undef INIT_SECTION_ASM_OP
+#endif
+#endif
+
 #if !defined(INIT_SECTION_ASM_OP) && !defined(CTOR_LISTS_DEFINED_EXTERNALLY)
 #ifdef __NeXT__
 /* After 2.3, try this definition on all systems.  */

