diff --git a/loader/kthread.c b/loader/kthread.c index acfa10fe4a7..c791ef6faeb 100644 --- a/loader/kthread.c +++ b/loader/kthread.c @@ -324,7 +324,7 @@ static void DECLSPEC_NORETURN abort_thread( long status ) /*********************************************************************** * pthread_functions */ -const struct wine_pthread_functions pthread_functions = +static const struct wine_pthread_functions pthread_functions = { init_process, init_thread, @@ -336,6 +336,10 @@ const struct wine_pthread_functions pthread_functions = sigprocmask }; +void init_pthread_functions(void) +{ + wine_pthread_set_functions( &pthread_functions, sizeof(pthread_functions) ); +} /* Currently this probably works only for glibc2, * which checks for the presence of double-underscore-prepended diff --git a/loader/main.c b/loader/main.c index 289eb68853b..314398debc8 100644 --- a/loader/main.c +++ b/loader/main.c @@ -106,7 +106,7 @@ int main( int argc, char *argv[] ) reserve_area( wine_main_preload_info[i].addr, wine_main_preload_info[i].size ); } - wine_pthread_set_functions( &pthread_functions, sizeof(pthread_functions) ); + init_pthread_functions(); wine_init( argc, argv, error, sizeof(error) ); fprintf( stderr, "wine: failed to initialize: %s\n", error ); exit(1); diff --git a/loader/main.h b/loader/main.h index 8284477a07d..0c6fc84195b 100644 --- a/loader/main.h +++ b/loader/main.h @@ -30,6 +30,10 @@ struct wine_preload_info size_t size; }; -extern const struct wine_pthread_functions pthread_functions; +#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) +extern void init_pthread_functions(void) __attribute__((visibility ("hidden"))); +#else +extern void init_pthread_functions(void); +#endif #endif /* __WINE_LOADER_MAIN_H */ diff --git a/loader/pthread.c b/loader/pthread.c index dd1a3ba08ec..4951d9706f4 100644 --- a/loader/pthread.c +++ b/loader/pthread.c @@ -246,7 +246,7 @@ static int pthread_sigmask( int how, const sigset_t *newset, sigset_t *oldset ) /*********************************************************************** * pthread_functions */ -const struct wine_pthread_functions pthread_functions = +static const struct wine_pthread_functions pthread_functions = { init_process, init_thread, @@ -257,3 +257,8 @@ const struct wine_pthread_functions pthread_functions = abort_thread, pthread_sigmask }; + +void init_pthread_functions(void) +{ + wine_pthread_set_functions( &pthread_functions, sizeof(pthread_functions) ); +}