change log for rtems (2010-11-29)

rtems-vc at rtems.org rtems-vc at rtems.org
Mon Nov 29 15:10:28 UTC 2010


 *sh*:
2010-11-29	Sebastian Huber <sebastian.huber at embedded-brains.de>

	* libcsupport/src/newlibc_exit.c, score/src/threadhandler.c: Added
	support for .preinit_array, .init_array and .fini_array sections.

M 1.2660  cpukit/ChangeLog
M   1.10  cpukit/libcsupport/src/newlibc_exit.c
M   1.30  cpukit/score/src/threadhandler.c

diff -u rtems/cpukit/ChangeLog:1.2659 rtems/cpukit/ChangeLog:1.2660
--- rtems/cpukit/ChangeLog:1.2659	Thu Nov 25 07:24:25 2010
+++ rtems/cpukit/ChangeLog	Mon Nov 29 08:14:27 2010
@@ -1,3 +1,8 @@
+2010-11-29	Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+	* libcsupport/src/newlibc_exit.c, score/src/threadhandler.c: Added
+	support for .preinit_array, .init_array and .fini_array sections.
+
 2010-11-25	Sebastian Huber <sebastian.huber at embedded-brains.de>
 
 	* sapi/include/confdefs.h, score/include/rtems/score/scheduler.h,

diff -u rtems/cpukit/libcsupport/src/newlibc_exit.c:1.9 rtems/cpukit/libcsupport/src/newlibc_exit.c:1.10
--- rtems/cpukit/libcsupport/src/newlibc_exit.c:1.9	Sun Nov 29 07:35:32 2009
+++ rtems/cpukit/libcsupport/src/newlibc_exit.c	Mon Nov 29 08:14:27 2010
@@ -118,10 +118,13 @@
  */
 
 #include <unistd.h>
+#include <newlib.h>
 
-/* FIXME: These defines are a blatant hack */
-  #define EXIT_SYMBOL _exit
+#if defined(HAVE_INITFINI_ARRAY)
+  extern void __libc_fini_array(void);
+#endif
 
+/* FIXME: These defines are a blatant hack */
   #if defined(__AVR__)
     #undef __USE_INIT_FINI__
   #endif
@@ -135,8 +138,22 @@
     extern void FINI_SYMBOL( void );
   #endif
 
-void EXIT_SYMBOL(int status)
+void _exit(int status)
 {
+  #if defined(HAVE_INITFINI_ARRAY)
+    /*
+     * According to
+     *
+     *   System V Application Binary Interface
+     *     Chapter 5
+     *       Initialization and Termination Functions
+     *
+     * we have to call the functions referenced by the .fini_array before the
+     * one referenced by the .fini section.
+     */
+    __libc_fini_array();
+  #endif
+
   /*
    *  If the toolset uses init/fini sections, then we need to
    *  run the global destructors now.

diff -u rtems/cpukit/score/src/threadhandler.c:1.29 rtems/cpukit/score/src/threadhandler.c:1.30
--- rtems/cpukit/score/src/threadhandler.c:1.29	Sun Nov 29 07:51:52 2009
+++ rtems/cpukit/score/src/threadhandler.c	Mon Nov 29 08:14:27 2010
@@ -30,6 +30,14 @@
 #include <rtems/score/userext.h>
 #include <rtems/score/wkspace.h>
 
+#if defined(RTEMS_NEWLIB)
+  #include <newlib.h>
+#endif
+
+#if defined(HAVE_INITFINI_ARRAY)
+  extern void __libc_init_array(void);
+#endif
+
 #if defined(__AVR__)
   #undef __USE_INIT_FINI__
 #endif
@@ -138,6 +146,20 @@
      */
     if (!doneCons) /* && (volatile void *)_init) */ {
       INIT_NAME ();
+
+      #if defined(HAVE_INITFINI_ARRAY)
+        /*
+         * According to
+         *
+         *   System V Application Binary Interface
+         *     Chapter 5
+         *       Initialization and Termination Functions
+         *
+         * we have to call the functions referenced by the .init_array after
+         * the one referenced by the .init section.
+         */
+        __libc_init_array();
+      #endif
     }
   #endif
 



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20101129/6b3c3c49/attachment.html>


More information about the vc mailing list