From: Tom Hughes Date: Mon, 25 Oct 2004 16:59:46 +0000 (+0000) Subject: Actually call VGA_(has_tls) rather than just testing the function X-Git-Tag: svn/VALGRIND_3_0_0~1464 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c4b27a325aaa7ccf84eadaf5d896913ae5046d0;p=thirdparty%2Fvalgrind.git Actually call VGA_(has_tls) rather than just testing the function address - this replaces Nick's replacing of the has_tls call with an inline version. BUG: 91844 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2832 --- diff --git a/coregrind/x86/libpthread.c b/coregrind/x86/libpthread.c index 240aa0f02a..40db0bca0c 100644 --- a/coregrind/x86/libpthread.c +++ b/coregrind/x86/libpthread.c @@ -96,18 +96,7 @@ Bool VGA_(has_tls)(void) void VGA_(thread_create)(arch_thread_aux_t *aux) { - // Weirdness alert: I tried removing this call to get_gs() by using a - // call to VGA_(has_tls)() in the condition, and Jeroen Witmond - // experienced mysterious regtest failures (some of the pth_* ones) on - // on of his machines: - // - // 'Linux DoornRoosje 2.4.26-1-386 #1 Tue Aug // 24 - // 13:31:19 JST 2004 i686 GNU/Linux' (Debian sarge) - // - // I don't understand what the difference is either. Compiler bug? --njn - int gs = get_gs(); - - if ((gs & 7) == 3) { + if (VGA_(has_tls)()) { tcbhead_t *tcb = get_tcb(); if (allocate_tls == NULL || deallocate_tls == NULL) { @@ -118,7 +107,7 @@ void VGA_(thread_create)(arch_thread_aux_t *aux) my_assert(allocate_tls != NULL); aux->tls_data = allocate_tls(NULL); - aux->tls_segment = gs >> 3; + aux->tls_segment = get_gs() >> 3; aux->sysinfo = tcb->sysinfo; tcb->multiple_threads = 1;