diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-02-24 10:13:32 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-02-24 12:50:32 +0100 |
commit | 95d0c98cac5000da7f4f1fdd52299224b2f94235 (patch) | |
tree | 0ff773e88497f39f45747b1023b0f7622cce4f0e /cpukit | |
parent | sptests/spcpucounter01: Adjust test (diff) | |
download | rtems-95d0c98cac5000da7f4f1fdd52299224b2f94235.tar.bz2 |
score: Fix thread TLS area initialization
Do not use _TLS_Size here since this will lead GCC to assume that this
symbol is not 0 and the later > 0 test will be optimized away.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/score/src/threadinitialize.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c index bc2600afcb..94ff8650c2 100644 --- a/cpukit/score/src/threadinitialize.c +++ b/cpukit/score/src/threadinitialize.c @@ -40,16 +40,21 @@ bool _Thread_Initialize( Objects_Name name ) { - size_t actual_stack_size = 0; - void *stack = NULL; + size_t actual_stack_size = 0; + void *stack = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) - void *fp_area; + void *fp_area; #endif - void *sched = NULL; - void *extensions_area; - bool extension_status; - int i; - uintptr_t tls_size = (uintptr_t) _TLS_Size; + void *sched = NULL; + void *extensions_area; + bool extension_status; + int i; + + /* + * Do not use _TLS_Size here since this will lead GCC to assume that this + * symbol is not 0 and the later > 0 test will be optimized away. + */ + uintptr_t tls_size = (uintptr_t) _TLS_BSS_end - (uintptr_t) _TLS_Data_begin; #if defined( RTEMS_SMP ) if ( rtems_configuration_is_smp_enabled() && !is_preemptible ) { |