2007-06-13 Jakub Jelinek <jakub@redhat.com>
* include/link.h: Don't include rtld-lowlevel.h.
(struct link_map): Remove l_scope_lock.
* sysdeps/generic/ldsodefs.h: Don't include rtld-lowlevel.h.
(_dl_scope_free_list): New field (variable) in _rtld_global.
(DL_LOOKUP_SCOPE_LOCK): Remove.
(_dl_scope_free): New prototype.
* elf/dl-runtime.c (_dl_fixup): Don't use __rtld_mrlock_*lock.
Don't pass DL_LOOKUP_SCOPE_LOCK to _dl_lookup_symbol_x.
(_dl_profile_fixup): Likewise.
* elf/dl-sym.c (do_sym): Likewise. Use wrapped _dl_lookup_symbol_x
whenever !RTLD_SINGLE_THREAD_P, use THREAD_GSCOPE_SET_FLAG and
THREAD_GSCOPE_RESET_FLAG around it.
* elf/dl-close.c (_dl_close_worker): Don't use
__rtld_mrlock_{change,done}. Call _dl_scope_free on the old
scope. Make sure THREAD_GSCOPE_WAIT () happens if any old
scopes were queued or if l_scope_mem has been abandoned.
* elf/dl-open.c (_dl_scope_free): New function.
(dl_open_worker): Use it. Don't use __rtld_mrlock_{change,done}.
* elf/dl-support.c (_dl_scope_free_list): New variable.
* elf/dl-lookup.c (add_dependency): Remove flags argument.
Remove DL_LOOKUP_SCOPE_LOCK handling.
(_dl_lookup_symbol_x): Adjust caller. Remove DL_LOOKUP_SCOPE_LOCK
handling.
* elf/dl-object.c (_dl_new_object): Don't use
__rtld_mrlock_initialize.
2007-06-19 Ulrich Drepper <drepper@redhat.com>
Tomas Janousek <tjanouse@redhat.com>
Ulrich Drepper <drepper@redhat.com>
[BZ #4647]
* resolv/res_send.c (send_dg): Remove socket_pf. Use ipv6_unavail
member in __res_state, only convaddr4to6 if nssocks[ns] is a PF_INET6
socket.
* resolv/resolv.h (__res_state): Add ipv6_unavail member. Make
unused member a bitmap.
* resolv/res_init.c (__res_vinit): Reset ipv6_unavail if IPv6
servers are configured.
2007-06-18 Jakub Jelinek <jakub@redhat.com>
(__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
(__pthread_rwlock_wrlock): Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
(pthread_rwlock_timedrdlock): Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
(pthread_rwlock_timedwrlock): Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
(__pthread_rwlock_unlock): Likewise.
2007-06-10 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
* sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
Split __flags into __flags, __shared, __pad1 and __pad2.
* sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
futexes if they are available.
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
in libc-lowlevellock.S allow using private futexes.
* sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
FUTEX_PRIVATE_FLAG. Add additional parameter to lll_futex_wait,
lll_futex_timed_wait and lll_futex_wake. Change lll_futex_wait
to call lll_futex_timed_wait. Add lll_private_futex_wait,
lll_private_futex_timed_wait and lll_private_futex_wake.
(lll_robust_mutex_unlock): Fix typo.
* sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
field in futex command setup.
* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
* sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
if they are available. Remove clear_once_control.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
futexes if they are available.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
Wake only when there are waiters.
* sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
support. Indicate that there are waiters. Remove unnecessary
extra cancellation test.
* sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise. Removed
left-over duplication of __sem_wait_cleanup.
whether there are more than one thread makes no sense here since
we only call the slow path if the locks are taken.
* sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
* tst-initializers1.c: Show through exit code which test failed.
* pthread_rwlock_init.c: Also initialize __shared field.
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
element in rwlock structure into four byte elements. One of them is
the new __shared element.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
Likewise.
[__WORDSIZE=64]: Renamed __pad1 element int rwlock structire to
__shared, adjust names of other padding elements.
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
* sysdeps/pthread/pthread.h: Adjust rwlock initializers.
* sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
FUTEX_PRIVATE_FLAG.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
futex to use private operations if possible.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
Add private field.
* sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
* pthread_barrier_init.c: Set private flag if pshared and private
futexes are supported.
* sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
private field in futex command setup.
* sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
* sem_init.c (__new_sem_init): Rewrite to initialize all three
fields in the structure.
(__old_sem_init): New function.
* sem_open.c: Initialize all fields of the structure.
* sem_getvalue.c: Adjust for renamed element.
* sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
(gen-as-const-headers): Add structsem.sym.
* sysdeps/unix/sysv/linux/structsem.sym: New file.
* sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
struct new_sem. Add struct old_sem.
* sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
* Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
* tst-sem10.c: New file.
* tst-sem11.c: New file.
* tst-sem12.c: New file.
* tst-typesizes.c: Test struct new_sem and struct old_sem instead
of struct sem.
2007-05-25 Ulrich Drepper <drepper@redhat.com>
private futexes are available.
* allocatestack.c (allocate_stack): Copy private_futex field from
current thread into the new stack.
* sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
futexes if they are available.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
in libc-lowlevellock.S allow using private futexes.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
FUTEX_PRIVATE_FLAG.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
if they are available.
* sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
* sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
* sysdeps/i386/tcb-offsets.sym: Likewise.
* sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
* sysdeps/i386/tls.h (tcbhead_t): Likewise.
pthread_mutex_init failed with ENOTSUP.
2007-05-21 Jakub Jelinek <jakub@redhat.com>
* tst-robust9.c (do_test): Don't fail if ENABLE_PI and
pthread_mutex_init failed with ENOTSUP.
global scope, wait for all lookups to finish afterwards.
* elf/dl-open.c (add_to_global): When global scope array must
grow, allocate a new one and free old array only after all
lookups finish.
* elf/dl-runtime.c (_dl_fixup): Protect using global scope.
(_dl_lookup_symbol_x): Likewise.
* elf/dl-support.c: Define _dl_wait_lookup_done.
* sysdeps/generic/ldsodefs.h (struct rtld_global): Add
_dl_wait_lookup_done.
* pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
is detected.
* pthread_mutex_timedlock.c: Likewise.
* pthread_mutex_trylock.c: Likewise.
Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
* Makefile (tests): Add tst-robust9 and tst-robustpi9.
* tst-robust9.c: New file.
* tst-robustpi9.c: New file.
* sysdeps/x86_64/fpu/k_cosl.c: New file.
* sysdeps/x86_64/fpu/k_rem_pio2l.c: New file.
* sysdeps/x86_64/fpu/k_sinl.c: New file.
* sysdeps/x86_64/fpu/k_tanl.c: New file.
* sysdeps/unix/sysv/linux/Makefile [subdir=posix] (tests): Add
tst-getcpu.
* include/link.h: Move l_version and l_nversion members around to
fill gaps.
(__sched_setaffinity_new): If syscall was successful and
RESET_VGETCPU_CACHE is defined, use it before returning.
* sysdeps/unix/sysv/linux/x86_64/sched_setaffinity.c: New file.
2007-03-22 Jakub Jelinek <jakub@redhat.com>
* config.h.in (HAVE_LIBCAP): Add.
* nscd/selinux.h: Include sys/capability.h rather than non-existent
sys/capabilities.h.
* nscd/selinux.c (preserve_capabilities): Use cap_free instead of
free_caps. Cast away const from 4th cap_set_flag argument.
smaller scopes.
* elf/dl-dst.h (DL_DST_REQ_STATIC): Add l as macro argument.
(DL_DST_REQUIRED): Adjust user.
* include/dlfcn.h (struct link_map): New forward decl.
* inet/getnameinfo.c: Include stddef.h.
(getnameinfo): Use offsetof.
* time/tst-mktime2.c (do_test): Don't rely on signed wrap.
* stdio-common/vfprintf.c (_itoa): Undef before redefining.
* string/strerror_l.c: Include stdlib.h.
separate cfi regions for the two subsections.
2007-03-13 Richard Henderson <rth@redhat.com>
* sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
separate cfi regions for the two subsections.