From fa9a4ff0ba0b66f544bcd69e6bd0929f0a7fc7ff Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 3 Dec 2002 02:50:58 +0000 Subject: [PATCH] * sysdeps/hppa/fpu/fesetround.c (fesetround): Use ~FE_DOWNWARD so both bits of RM are cleared. --- ChangeLog | 5 +++++ linuxthreads/ChangeLog | 14 +++++++++++++- nptl/ChangeLog | 14 ++++++++++++++ nptl/allocatestack.c | 1 + nptl/events.c | 2 ++ nptl/pthreadP.h | 13 ++++++++----- nptl/pthread_create.c | 10 +++++++--- nptl/pthread_key_create.c | 6 +++--- nptl_db/ChangeLog | 6 ++++++ nptl_db/td_symbol_list.c | 2 +- nptl_db/td_ta_map_lwp2thr.c | 7 ++++++- sysdeps/hppa/fpu/fesetround.c | 2 +- 12 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 nptl_db/ChangeLog diff --git a/ChangeLog b/ChangeLog index 593f6a6893..f4d324a52b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-12-02 Carlos O'Donell + + * sysdeps/hppa/fpu/fesetround.c (fesetround): Use ~FE_DOWNWARD so both + bits of RM are cleared. + 2002-12-02 Roland McGrath * elf/tst-tls4.c: Define an unused TLS variable here, so that no lazy diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 53ef5c6694..f47f3192b8 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,15 @@ +2002-11-28 Roland McGrath + + * tst-context.c: #define IS_IN_libpthread around #include + before other headers, so FLOATING_STACKS is not defined wrongly. + + * sysdeps/i386/tls.h [!IS_IN_libpthread]: Enable TLS support + even if [! FLOATING_STACKS]. + (TLS_DO_MODIFY_LDT_KERNEL_CHECK): New macro. + If not under [__ASSUME_LDT_WORKS > 0], then do a runtime check of + dl_osversion >= 2.3.99 and fatal if not. + (TLS_DO_MODIFY_LDT): Use it. + 2002-11-28 Ulrich Drepper * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which @@ -6,7 +18,7 @@ 2002-11-19 Ulrich Drepper - * Versions (libc:GLIBC_2.0): Remove names of functions which are + * Versions (libc: GLIBC_2.0): Remove names of functions which are not defined in libc. * Makefile (shared-only-routines): Add weaks. * weaks.c: Remove functions which are not exported from libc.so. diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 187b443359..537c59878a 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,17 @@ +2002-12-02 Roland McGrath + + * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event): + Declare using hidden_proto instead of attribute_hidden, so there are + non-.hidden static symbols for gdb to find. + (__pthread_keys): Likewise. + * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def. + * allocatestack.c (__stack_user): Likewise. + * pthread_create.c (__pthread_keys): Likewise. + (__nptl_threads_events, __nptl_last_event): Make these static instead + of hidden. + * pthread_key_create.c (__pthread_pthread_keys_max, + __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*. + 2002-12-02 Ulrich Drepper * pthread_cond_timedwait.c: Include . diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 2aaaaeca9c..e9e1cfd1cd 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -70,6 +70,7 @@ static LIST_HEAD (stack_used); /* List of the threads with user provided stacks in use. */ LIST_HEAD (__stack_user); +hidden_def (__stack_user) /* Number of threads running. */ static unsigned int nptl_nthreads = 1; diff --git a/nptl/events.c b/nptl/events.c index 8232d0c7d7..df97e54f69 100644 --- a/nptl/events.c +++ b/nptl/events.c @@ -25,8 +25,10 @@ void __nptl_create_event (void) { } +hidden_def (__nptl_create_event) void __nptl_death_event (void) { } +hidden_def (__nptl_death_event) diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index adca0514a3..c6c1e49a53 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -42,7 +42,8 @@ extern size_t __static_tls_size attribute_hidden; extern size_t __static_tls_align attribute_hidden; /* Thread descriptor handling. */ -extern list_t __stack_user attribute_hidden; +extern list_t __stack_user; +hidden_proto (__stack_user) /* Attribute handling. */ extern struct pthread_attr *__attr_list attribute_hidden; @@ -57,8 +58,8 @@ extern int __current_sigrtmax attribute_hidden; extern int __concurrency_level attribute_hidden; /* Thread-local data key handling. */ -extern struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX] - attribute_hidden; +extern struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX]; +hidden_proto (__pthread_keys) /* The library can run in debugging mode where it performs a lot more tests. */ @@ -134,8 +135,10 @@ extern int __pthread_attr_init_2_0 (pthread_attr_t *attr); /* Event handlers for libthread_db interface. */ -extern void __nptl_create_event (void) attribute_hidden; -extern void __nptl_death_event (void) attribute_hidden; +extern void __nptl_create_event (void); +extern void __nptl_death_event (void); +hidden_proto (__nptl_create_event) +hidden_proto (__nptl_death_event) /* Namespace save aliases. */ diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index 451a9b3f99..5fef400ee4 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -38,10 +38,10 @@ static int start_thread_debug (void *arg); int __pthread_debug; /* Globally enabled events. */ -td_thr_events_t __nptl_threads_events attribute_hidden; +static td_thr_events_t __nptl_threads_events; /* Pointer to descriptor with the last event. */ -struct pthread *__nptl_last_event attribute_hidden; +static struct pthread *__nptl_last_event; /* Code to allocate and deallocate a stack. */ @@ -53,8 +53,12 @@ struct pthread *__nptl_last_event attribute_hidden; /* Table of the key information. */ -struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX]; +struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX] + __attribute__ ((section (".bss"))); +hidden_def (__pthread_keys) +/* This is for libthread_db only. */ +const int __pthread_pthread_sizeof_descr = sizeof (struct pthread); struct pthread * __find_in_stack_list (pd) diff --git a/nptl/pthread_key_create.c b/nptl/pthread_key_create.c index 7a073f2d80..3a49c094d6 100644 --- a/nptl/pthread_key_create.c +++ b/nptl/pthread_key_create.c @@ -21,13 +21,13 @@ #include "pthreadP.h" -/* Internal mutex for __pthread_kyes table handling. */ +/* Internal mutex for __pthread_keys table handling. */ lll_lock_t __pthread_keys_lock = LLL_LOCK_INITIALIZER; /* For debugging purposes put the maximum number of keys in a variable. */ -const int __linuxthreads_pthread_keys_max = PTHREAD_KEYS_MAX; -const int __linuxthreads_pthread_key_2ndlevel_size = PTHREAD_KEY_2NDLEVEL_SIZE; +const int __pthread_pthread_keys_max = PTHREAD_KEYS_MAX; +const int __pthread_pthread_key_2ndlevel_size = PTHREAD_KEY_2NDLEVEL_SIZE; int diff --git a/nptl_db/ChangeLog b/nptl_db/ChangeLog new file mode 100644 index 0000000000..5d3fd84a0b --- /dev/null +++ b/nptl_db/ChangeLog @@ -0,0 +1,6 @@ +2002-12-02 Roland McGrath + + * td_symbol_list.c (symbol_list_arr): pthread_keys -> __pthread_keys + + * td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Fetch inferior registers to + see its %gs value, not our own. diff --git a/nptl_db/td_symbol_list.c b/nptl_db/td_symbol_list.c index 1be7001d85..f6ba91794a 100644 --- a/nptl_db/td_symbol_list.c +++ b/nptl_db/td_symbol_list.c @@ -30,7 +30,7 @@ static const char *symbol_list_arr[] = [SYM_PTHREAD_NTHREADS] = "nptl_nthreads", [SYM_PTHREAD_STACK_USED] = "stack_used", [SYM_PTHREAD_STACK_USER] = "__stack_user", - [SYM_PTHREAD_KEYS] = "pthread_keys", + [SYM_PTHREAD_KEYS] = "__pthread_keys", [SYM_PTHREAD_KEYS_MAX] = "__pthread_pthread_keys_max", [SYM_PTHREAD_SIZEOF_DESCR] = "__pthread_pthread_sizeof_descr", [SYM_PTHREAD_CREATE_EVENT] = "__nptl_create_event", diff --git a/nptl_db/td_ta_map_lwp2thr.c b/nptl_db/td_ta_map_lwp2thr.c index 326b9ee92a..2097194837 100644 --- a/nptl_db/td_ta_map_lwp2thr.c +++ b/nptl_db/td_ta_map_lwp2thr.c @@ -20,6 +20,7 @@ #include "thread_dbP.h" #include +#include td_err_e @@ -31,8 +32,12 @@ td_ta_map_lwp2thr (const td_thragent_t *ta, lwpid_t lwpid, td_thrhandle_t *th) if (! ta_ok (ta)) return TD_BADTA; + prgregset_t regs; + if (ps_lgetregs (ta->ph, lwpid, regs) != PS_OK) + return TD_ERR; + /* Get the thread area for the addressed thread. */ - if (ps_get_thread_area (ta->ph, lwpid, TLS_GET_GS () >> 3, &th->th_unique) + if (ps_get_thread_area (ta->ph, lwpid, regs[GS] >> 3, &th->th_unique) != PS_OK) return TD_ERR; /* XXX Other error value? */ diff --git a/sysdeps/hppa/fpu/fesetround.c b/sysdeps/hppa/fpu/fesetround.c index 7634b1e1d7..3687624c2b 100644 --- a/sysdeps/hppa/fpu/fesetround.c +++ b/sysdeps/hppa/fpu/fesetround.c @@ -31,7 +31,7 @@ fesetround (int round) /* Get the current status word. */ __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw)); - sw[0] &= ~FE_UPWARD; + sw[0] &= ~FE_DOWNWARD; sw[0] |= round; __asm__ ("fldd 0(%0),%%fr0" : : "r" (sw)); -- 2.43.5