This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
update synthetic target for recent gcc changes
- From: Bart Veer <bartv at ecoscentric dot com>
- To: ecos-patches at sources dot redhat dot com
- Date: Tue, 3 Dec 2002 21:07:42 +0000 (GMT)
- Subject: update synthetic target for recent gcc changes
2002-12-03 Bart Veer <bartv@ecoscentric.com>
* src/synth_entry.c:
Provide dummy versions of __cxa_atexit() and __dso_handle, to
satisfy requirements of recent versions of the compiler configured
for native Linux development.
--- synth_entry.c 15 Sep 2002 17:53:27 -0000 1.4
+++ synth_entry.c 3 Dec 2002 21:03:48 -0000
@@ -168,5 +168,24 @@
cyg_hal_sys_exit(0);
}
+// ----------------------------------------------------------------------------
+// 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.
+
+void
+__cxa_atexit(void (*arg1)(void*), void* arg2, void* arg3)
+{
+}
+void* __dso_handle = (void*) &__dso_handle;
+
//-----------------------------------------------------------------------------
// End of entry.c