summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-11-20 18:22:35 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-11-20 18:22:35 +0000
commit94ab166c673a5e9dab0e2ee666060e291c62d85e (patch)
tree4154538d5362f3a80fcc810870eabedbeb87f848
parent82a48d07a4c6458f923c32aad80bf99ebeae17e4 (diff)
downloadrtems-94ab166c673a5e9dab0e2ee666060e291c62d85e.tar.bz2
2001-11-20 Joel Sherrill <joel@OARcorp.com>
* src/threadhandler.c: When __USE__MAIN__ is defined by the toolset, invoke the global constructors via __main. Reported as tested by Alexandra Kossovsky <sasha@oktet.ru> and Victor V. Vengerov <vvv@oktet.ru> in conjunction with a new set of tool RPMs (gcc2.95.3newlib1.9.0-3). This was tracked as GNATS PR tools/84.
-rw-r--r--c/src/exec/score/ChangeLog8
-rw-r--r--c/src/exec/score/src/threadhandler.c9
-rw-r--r--cpukit/score/ChangeLog8
-rw-r--r--cpukit/score/src/threadhandler.c9
4 files changed, 30 insertions, 4 deletions
diff --git a/c/src/exec/score/ChangeLog b/c/src/exec/score/ChangeLog
index d6aab6880d..8e74f602c0 100644
--- a/c/src/exec/score/ChangeLog
+++ b/c/src/exec/score/ChangeLog
@@ -1,3 +1,11 @@
+2001-11-20 Joel Sherrill <joel@OARcorp.com>
+
+ * src/threadhandler.c: When __USE__MAIN__ is defined by the toolset,
+ invoke the global constructors via __main. Reported as tested by
+ Alexandra Kossovsky <sasha@oktet.ru> and Victor V. Vengerov
+ <vvv@oktet.ru> in conjunction with a new set of tool RPMs
+ (gcc2.95.3newlib1.9.0-3). This was tracked as GNATS PR tools/84.
+
2001-11-07 Joel Sherrill <joel@OARcorp.com>
Reported by Todor.Todorov@barco.com and tracked as PR36.
diff --git a/c/src/exec/score/src/threadhandler.c b/c/src/exec/score/src/threadhandler.c
index 84618751fd..e23667c32f 100644
--- a/c/src/exec/score/src/threadhandler.c
+++ b/c/src/exec/score/src/threadhandler.c
@@ -58,7 +58,7 @@ void _Thread_Handler( void )
{
ISR_Level level;
Thread_Control *executing;
-#if defined(__USE_INIT_FINI__)
+#if defined(__USE_INIT_FINI__) || defined(__USE__MAIN__)
static char doneConstructors;
char doneCons;
#endif
@@ -73,7 +73,7 @@ void _Thread_Handler( void )
level = executing->Start.isr_level;
_ISR_Set_level(level);
-#if defined(__USE_INIT_FINI__)
+#if defined(__USE_INIT_FINI__) || defined(__USE__MAIN__)
doneCons = doneConstructors;
doneConstructors = 1;
#endif
@@ -95,6 +95,11 @@ void _Thread_Handler( void )
if (!doneCons)
_init ();
#endif
+#if defined(__USE__MAIN__)
+ if (!doneCons)
+ __main ();
+#endif
+
switch ( executing->Start.prototype ) {
case THREAD_START_NUMERIC:
diff --git a/cpukit/score/ChangeLog b/cpukit/score/ChangeLog
index d6aab6880d..8e74f602c0 100644
--- a/cpukit/score/ChangeLog
+++ b/cpukit/score/ChangeLog
@@ -1,3 +1,11 @@
+2001-11-20 Joel Sherrill <joel@OARcorp.com>
+
+ * src/threadhandler.c: When __USE__MAIN__ is defined by the toolset,
+ invoke the global constructors via __main. Reported as tested by
+ Alexandra Kossovsky <sasha@oktet.ru> and Victor V. Vengerov
+ <vvv@oktet.ru> in conjunction with a new set of tool RPMs
+ (gcc2.95.3newlib1.9.0-3). This was tracked as GNATS PR tools/84.
+
2001-11-07 Joel Sherrill <joel@OARcorp.com>
Reported by Todor.Todorov@barco.com and tracked as PR36.
diff --git a/cpukit/score/src/threadhandler.c b/cpukit/score/src/threadhandler.c
index 84618751fd..e23667c32f 100644
--- a/cpukit/score/src/threadhandler.c
+++ b/cpukit/score/src/threadhandler.c
@@ -58,7 +58,7 @@ void _Thread_Handler( void )
{
ISR_Level level;
Thread_Control *executing;
-#if defined(__USE_INIT_FINI__)
+#if defined(__USE_INIT_FINI__) || defined(__USE__MAIN__)
static char doneConstructors;
char doneCons;
#endif
@@ -73,7 +73,7 @@ void _Thread_Handler( void )
level = executing->Start.isr_level;
_ISR_Set_level(level);
-#if defined(__USE_INIT_FINI__)
+#if defined(__USE_INIT_FINI__) || defined(__USE__MAIN__)
doneCons = doneConstructors;
doneConstructors = 1;
#endif
@@ -95,6 +95,11 @@ void _Thread_Handler( void )
if (!doneCons)
_init ();
#endif
+#if defined(__USE__MAIN__)
+ if (!doneCons)
+ __main ();
+#endif
+
switch ( executing->Start.prototype ) {
case THREAD_START_NUMERIC: