]> git.karo-electronics.de Git - karo-tx-redboot.git/blobdiff - packages/infra/v2_0/src/dummyxxmain.cxx
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / infra / v2_0 / src / dummyxxmain.cxx
index 893406a322693bf69c6dce9c0d8f18698199bb32..5d1a1f410ff6ed9a2d40935fb18b249a47df3b49 100644 (file)
@@ -78,4 +78,39 @@ __main( void )
     CYG_REPORT_RETURN();
 } // __main()
 
+#if (__GNUC__ >= 3)
+// Versions of gcc/g++ after 3.0 (approx.), when configured for Linux
+// native development (specifically, --with-__cxa_enable), have
+// additional dependencies related to the destructors for static
+// objects. When compiling C++ code with static objects the compiler
+// inserts a call to __cxa_atexit() with __dso_handle as one of the
+// arguments. __cxa_atexit() would normally be provided by glibc, and
+// __dso_handle is part of crtstuff.c. Synthetic target applications
+// are linked rather differently, so either a differently-configured
+// compiler is needed or dummy versions of these symbols should be
+// provided. If these symbols are not actually used then providing
+// them is still harmless, linker garbage collection will remove them.
+
+externC void
+__cxa_atexit(void (*func)(void *), void *arg2, const void *arg3)
+{
+}
+void *__dso_handle = (void* )&__dso_handle;
+
+// gcc 3.2.2 (approx). The libsupc++ version of the new operator pulls
+// in exception handling code, even when using the nothrow version and
+// building with -fno-exceptions. libgcc_eh.a provides the necessary
+// functions, but requires a dl_iterate_phdr() function. That is related
+// to handling dynamically loaded code so is not applicable to eCos.
+int
+dl_iterate_phdr(void* arg1, void* arg2)
+{
+    return -1;
+}
+
+externC void
+raise(void)
+{
+}
+#endif
 // EOF dummyxxmain.cxx