From 85631c8ecf0d8f777ce30a072a82335add0b194b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 11 Dec 2002 09:32:45 +0000 Subject: [PATCH] Update. 2002-12-11 Ulrich Drepper * init.c (__pthread_initialize_minimal): Fix initialization in static lib by preventing gcc from being too clever. --- nptl/ChangeLog | 5 +++++ nptl/init.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 6dea2933e2..cc8ac2af4e 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,8 @@ +2002-12-11 Ulrich Drepper + + * init.c (__pthread_initialize_minimal): Fix initialization in + static lib by preventing gcc from being too clever. + 2002-12-10 Ulrich Drepper * init.c (__pthread_initialize_minimal): Remove unneccesary diff --git a/nptl/init.c b/nptl/init.c index e3f51119cf..678c0a56c8 100644 --- a/nptl/init.c +++ b/nptl/init.c @@ -104,6 +104,12 @@ __pthread_initialize_minimal (void) /* Unlike in the dynamically linked case the dynamic linker has not taken care of initializing the TLS data structures. */ __libc_setup_tls (TLS_TCB_SIZE, TLS_TCB_ALIGN); + + /* We must prevent gcc from being clever and move any of the + following code ahead of the __libc_setup_tls call. This function + will initialize the thread register which is subsequently + used. */ + __asm __volatile (""); #endif /* Minimal initialization of the thread descriptor. */ -- 2.43.5