[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r616 - in /trunk: libc/ libc/csu/ libc/dlfcn/ libc/elf/ libc/include/ libc/io/ libc/libio/ libc/locale/ libc/localedata/ lib...



Author: joseph
Date: Tue Nov  7 14:59:31 2006
New Revision: 616

Log:
Merge changes between r426 and r615 from /fsf/trunk.

Added:
    trunk/libc/elf/tst-thrlock.c
      - copied unchanged from r615, fsf/trunk/libc/elf/tst-thrlock.c
    trunk/libc/localedata/locales/mai_IN
      - copied unchanged from r615, fsf/trunk/libc/localedata/locales/mai_IN
    trunk/libc/nptl/pthread_barrier_wait.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_barrier_wai=
t.c
    trunk/libc/nptl/pthread_cond_broadcast.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_cond_broadc=
ast.c
    trunk/libc/nptl/pthread_cond_signal.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_cond_signal=
.c
    trunk/libc/nptl/pthread_cond_timedwait.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_cond_timedw=
ait.c
    trunk/libc/nptl/pthread_cond_wait.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_cond_wait.c
    trunk/libc/nptl/pthread_getcpuclockid.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_getcpuclock=
id.c
    trunk/libc/nptl/pthread_once.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_once.c
    trunk/libc/nptl/pthread_rwlock_rdlock.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_rwlock_rdlo=
ck.c
    trunk/libc/nptl/pthread_rwlock_timedrdlock.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_rwlock_time=
drdlock.c
    trunk/libc/nptl/pthread_rwlock_timedwrlock.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_rwlock_time=
dwrlock.c
    trunk/libc/nptl/pthread_rwlock_unlock.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_rwlock_unlo=
ck.c
    trunk/libc/nptl/pthread_rwlock_wrlock.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_rwlock_wrlo=
ck.c
    trunk/libc/nptl/pthread_spin_destroy.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_spin_destro=
y.c
    trunk/libc/nptl/pthread_spin_init.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_spin_init.c
    trunk/libc/nptl/pthread_spin_unlock.c
      - copied unchanged from r615, fsf/trunk/libc/nptl/pthread_spin_unlock=
.c
    trunk/libc/sunrpc/tst-xdrmem2.c
      - copied unchanged from r615, fsf/trunk/libc/sunrpc/tst-xdrmem2.c
    trunk/libc/sysdeps/powerpc/fpu/math_private.h
      - copied unchanged from r615, fsf/trunk/libc/sysdeps/powerpc/fpu/math=
_private.h
Removed:
    trunk/libc/nptl/sysdeps/pthread/pthread_barrier_wait.c
    trunk/libc/nptl/sysdeps/pthread/pthread_cond_broadcast.c
    trunk/libc/nptl/sysdeps/pthread/pthread_cond_signal.c
    trunk/libc/nptl/sysdeps/pthread/pthread_cond_timedwait.c
    trunk/libc/nptl/sysdeps/pthread/pthread_cond_wait.c
    trunk/libc/nptl/sysdeps/pthread/pthread_getcpuclockid.c
    trunk/libc/nptl/sysdeps/pthread/pthread_once.c
    trunk/libc/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c
    trunk/libc/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c
    trunk/libc/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
    trunk/libc/nptl/sysdeps/pthread/pthread_rwlock_unlock.c
    trunk/libc/nptl/sysdeps/pthread/pthread_rwlock_wrlock.c
    trunk/libc/nptl/sysdeps/pthread/pthread_spin_destroy.c
    trunk/libc/nptl/sysdeps/pthread/pthread_spin_init.c
    trunk/libc/nptl/sysdeps/pthread/pthread_spin_unlock.c
Modified:
    trunk/libc/ChangeLog
    trunk/libc/Makeconfig
    trunk/libc/Makerules
    trunk/libc/config.h.in
    trunk/libc/config.make.in
    trunk/libc/configure
    trunk/libc/configure.in
    trunk/libc/csu/Versions
    trunk/libc/csu/libc-start.c
    trunk/libc/csu/libc-tls.c
    trunk/libc/csu/tst-atomic.c
    trunk/libc/csu/version.c
    trunk/libc/dlfcn/Makefile
    trunk/libc/dlfcn/dlinfo.c
    trunk/libc/elf/Makefile
    trunk/libc/elf/dl-addr.c
    trunk/libc/elf/dl-cache.c
    trunk/libc/elf/dl-close.c
    trunk/libc/elf/dl-iteratephdr.c
    trunk/libc/elf/dl-libc.c
    trunk/libc/elf/dl-load.c
    trunk/libc/elf/dl-lookup.c
    trunk/libc/elf/dl-object.c
    trunk/libc/elf/dl-open.c
    trunk/libc/elf/dl-reloc.c
    trunk/libc/elf/dl-runtime.c
    trunk/libc/elf/dl-support.c
    trunk/libc/elf/dl-sym.c
    trunk/libc/elf/dl-sysdep.c
    trunk/libc/elf/dl-tls.c
    trunk/libc/elf/ldconfig.c
    trunk/libc/elf/rtld.c
    trunk/libc/elf/tst-tls-dlinfo.c
    trunk/libc/elf/tst-tls1.c
    trunk/libc/elf/tst-tls10.h
    trunk/libc/elf/tst-tls14.c
    trunk/libc/elf/tst-tls2.c
    trunk/libc/elf/tst-tls3.c
    trunk/libc/elf/tst-tls4.c
    trunk/libc/elf/tst-tls5.c
    trunk/libc/elf/tst-tls6.c
    trunk/libc/elf/tst-tls7.c
    trunk/libc/elf/tst-tls8.c
    trunk/libc/elf/tst-tls9.c
    trunk/libc/elf/tst-tlsmod1.c
    trunk/libc/elf/tst-tlsmod13.c
    trunk/libc/elf/tst-tlsmod13a.c
    trunk/libc/elf/tst-tlsmod14a.c
    trunk/libc/elf/tst-tlsmod2.c
    trunk/libc/elf/tst-tlsmod3.c
    trunk/libc/elf/tst-tlsmod4.c
    trunk/libc/elf/tst-tlsmod5.c
    trunk/libc/elf/tst-tlsmod6.c
    trunk/libc/include/atomic.h
    trunk/libc/include/dlfcn.h
    trunk/libc/include/errno.h
    trunk/libc/include/libc-symbols.h
    trunk/libc/include/link.h
    trunk/libc/include/stdio.h
    trunk/libc/include/tls.h
    trunk/libc/io/Makefile
    trunk/libc/io/fstat.c
    trunk/libc/io/fstat64.c
    trunk/libc/io/fstatat.c
    trunk/libc/io/fstatat64.c
    trunk/libc/io/lstat.c
    trunk/libc/io/lstat64.c
    trunk/libc/io/mknod.c
    trunk/libc/io/mknodat.c
    trunk/libc/io/stat.c
    trunk/libc/io/stat64.c
    trunk/libc/libio/stdio.c
    trunk/libc/locale/global-locale.c
    trunk/libc/locale/localeinfo.h
    trunk/libc/localedata/ChangeLog
    trunk/libc/localedata/SUPPORTED
    trunk/libc/malloc/arena.c
    trunk/libc/malloc/hooks.c
    trunk/libc/malloc/malloc.c
    trunk/libc/malloc/memusage.c
    trunk/libc/manual/conf.texi
    trunk/libc/nptl/ChangeLog
    trunk/libc/nptl/init.c
    trunk/libc/nptl/pthread_attr_setstacksize.c
    trunk/libc/nptl/sysdeps/alpha/tls.h
    trunk/libc/nptl/sysdeps/i386/tls.h
    trunk/libc/nptl/sysdeps/ia64/pthread_spin_unlock.c
    trunk/libc/nptl/sysdeps/ia64/tls.h
    trunk/libc/nptl/sysdeps/powerpc/tls.h
    trunk/libc/nptl/sysdeps/s390/tls.h
    trunk/libc/nptl/sysdeps/sh/tls.h
    trunk/libc/nptl/sysdeps/sparc/tls.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel=
.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel=
.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h
    trunk/libc/nptl/sysdeps/x86_64/tls.h
    trunk/libc/nptl/tst-tls5.h
    trunk/libc/nptl_db/ChangeLog
    trunk/libc/nptl_db/db_info.c
    trunk/libc/nptl_db/structs.def
    trunk/libc/nscd/Makefile
    trunk/libc/po/sv.po
    trunk/libc/resolv/Versions
    trunk/libc/stdlib/Makefile
    trunk/libc/stdlib/atexit.c
    trunk/libc/stdlib/stdlib.h
    trunk/libc/sunrpc/Makefile
    trunk/libc/sunrpc/xdr_mem.c
    trunk/libc/sysdeps/alpha/dl-machine.h
    trunk/libc/sysdeps/alpha/libc-tls.c
    trunk/libc/sysdeps/generic/ldsodefs.h
    trunk/libc/sysdeps/generic/sysdep-cancel.h
    trunk/libc/sysdeps/generic/tls.h
    trunk/libc/sysdeps/gnu/netinet/tcp.h
    trunk/libc/sysdeps/i386/dl-machine.h
    trunk/libc/sysdeps/i386/i486/bits/atomic.h
    trunk/libc/sysdeps/i386/i686/memcmp.S
    trunk/libc/sysdeps/i386/sysdep.h
    trunk/libc/sysdeps/ia64/dl-machine.h
    trunk/libc/sysdeps/ia64/libc-tls.c
    trunk/libc/sysdeps/mach/hurd/fork.c
    trunk/libc/sysdeps/mach/hurd/i386/tls.h
    trunk/libc/sysdeps/powerpc/fpu/bits/mathinline.h
    trunk/libc/sysdeps/powerpc/powerpc32/dl-machine.c
    trunk/libc/sysdeps/powerpc/powerpc32/dl-machine.h
    trunk/libc/sysdeps/powerpc/powerpc32/sysdep.h
    trunk/libc/sysdeps/powerpc/powerpc64/dl-machine.h
    trunk/libc/sysdeps/s390/libc-tls.c
    trunk/libc/sysdeps/s390/s390-32/dl-machine.h
    trunk/libc/sysdeps/s390/s390-64/dl-machine.h
    trunk/libc/sysdeps/sh/dl-machine.h
    trunk/libc/sysdeps/sparc/sparc32/dl-machine.h
    trunk/libc/sysdeps/sparc/sparc64/dl-machine.h
    trunk/libc/sysdeps/unix/sysv/linux/i386/sigaction.c
    trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c
    trunk/libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
    trunk/libc/sysdeps/unix/sysv/linux/x86_64/sysconf.c
    trunk/libc/sysdeps/x86_64/bits/atomic.h
    trunk/libc/sysdeps/x86_64/dl-machine.h
    trunk/libc/tls.make.c
    trunk/linuxthreads/linuxthreads/ChangeLog
    trunk/linuxthreads/linuxthreads/specific.c
    trunk/linuxthreads/linuxthreads/sysdeps/ia64/tcb-offsets.sym
    trunk/ports/ChangeLog.arm
    trunk/ports/ChangeLog.mips
    trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h
    trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
    trunk/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h

Modified: trunk/libc/ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/ChangeLog (original)
+++ trunk/libc/ChangeLog Tue Nov  7 14:59:31 2006
@@ -1,3 +1,258 @@
+2006-11-03  Steven Munroe  <sjmunroe@xxxxxxxxxx>
+
+	* sysdeps/powerpc/fpu/bits/mathinline.h
+	[__LIBC_INTERNAL_MATH_INLINES]: Moved to ...
+	* sysdeps/powerpc/fpu/math_private.h: ...here.  New file.
+
+2006-11-05  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/i386/sysconf.c (intel_check_word):
+	Update handling of cache descriptor 0x49 for new models.
+	* sysdeps/unix/sysv/linux/x86_64/sysconf.c (intel_check_word):
+	Likewise.
+
+2006-11-02  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* malloc/memusage.c (dest): Reset not_me back to false after
+	printing statistics.
+
+2006-11-02  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* configure.in: Work around ld --help change and avoid -z relro
+	test completely if the architecture doesn't care about security.
+
+2006-11-01  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* po/sv.po: Update from translation team.
+
+2006-10-31  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* stdlib/atexit.c (atexit): Don't mark as hidden when used to
+	generate compatibility version.
+
+2006-10-29  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* configure.in: Relax -z relro requirement a bit.
+
+	* po/sv.po: Update from translation team.
+
+2006-10-29  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* elf/dl-sym.c (do_sym): Use RTLD_SINGLE_THREAD_P.
+	* elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Likewise.
+	* elf/dl-close.c (_dl_close_worker): Likewise.
+	* elf/dl-open.c (_dl_open_worker): Likewise.
+	* sysdeps/generic/sysdep-cancel.h (RTLD_SINGLE_THREAD_P): Define.
+
+2006-10-27  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* configure.in: Require assembler support for visibility, compiler
+	support for visibility and aliases, linker support for various -z
+	options.
+	* Makeconfig: Remove conditional code which now is unnecessary.
+	* config.h.in: Likewise.
+	* config.make.in: Likewise.
+	* dlfcn/Makefile: Likewise.
+	* elf/Makefile: Likewise.
+	* elf/dl-load.c: Likewise.
+	* elf/rtld.c: Likewise.
+	* include/libc-symbols.h: Likewise.
+	* include/stdio.h: Likewise.
+	* io/Makefile: Likewise.
+	* io/fstat.c: Likewise.
+	* io/fstat64.c: Likewise.
+	* io/fstatat.c: Likewise.
+	* io/fstatat64.c: Likewise.
+	* io/lstat.c: Likewise.
+	* io/lstat64.c: Likewise.
+	* io/mknod.c: Likewise.
+	* io/mknodat.c: Likewise.
+	* io/stat.c: Likewise.
+	* io/stat64.c: Likewise.
+	* libio/stdio.c: Likewise.
+	* nscd/Makefile: Likewise.
+	* stdlib/Makefile: Likewise.
+	* stdlib/atexit.c: Likewise.
+	* sysdeps/generic/ldsodefs.h: Likewise.
+	* sysdeps/i386/dl-machine.h: Likewise.
+	* sysdeps/i386/sysdep.h: Likewise.
+	* sysdeps/i386/i686/memcmp.S: Likewise.
+	* sysdeps/powerpc/powerpc32/sysdep.h: Likewise.
+	* sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.
+
+	* Makerules: USE_TLS support is now default.
+	* tls.make.c: Likewise.
+	* csu/Versions: Likewise.
+	* csu/libc-start.c: Likewise.
+	* csu/libc-tls.c: Likewise.
+	* csu/version.c: Likewise.
+	* dlfcn/dlinfo.c: Likewise.
+	* elf/dl-addr.c: Likewise.
+	* elf/dl-cache.c: Likewise.
+	* elf/dl-close.c: Likewise.
+	* elf/dl-iteratephdr.c: Likewise.
+	* elf/dl-load.c: Likewise.
+	* elf/dl-lookup.c: Likewise.
+	* elf/dl-object.c: Likewise.
+	* elf/dl-open.c: Likewise.
+	* elf/dl-reloc.c: Likewise.
+	* elf/dl-support.c: Likewise.
+	* elf/dl-sym.c: Likewise.
+	* elf/dl-sysdep.c: Likewise.
+	* elf/dl-tls.c: Likewise.
+	* elf/ldconfig.c: Likewise.
+	* elf/rtld.c: Likewise.
+	* elf/tst-tls-dlinfo.c: Likewise.
+	* elf/tst-tls1.c: Likewise.
+	* elf/tst-tls10.h: Likewise.
+	* elf/tst-tls14.c: Likewise.
+	* elf/tst-tls2.c: Likewise.
+	* elf/tst-tls3.c: Likewise.
+	* elf/tst-tls4.c: Likewise.
+	* elf/tst-tls5.c: Likewise.
+	* elf/tst-tls6.c: Likewise.
+	* elf/tst-tls7.c: Likewise.
+	* elf/tst-tls8.c: Likewise.
+	* elf/tst-tls9.c: Likewise.
+	* elf/tst-tlsmod1.c: Likewise.
+	* elf/tst-tlsmod13.c: Likewise.
+	* elf/tst-tlsmod13a.c: Likewise.
+	* elf/tst-tlsmod14a.c: Likewise.
+	* elf/tst-tlsmod2.c: Likewise.
+	* elf/tst-tlsmod3.c: Likewise.
+	* elf/tst-tlsmod4.c: Likewise.
+	* elf/tst-tlsmod5.c: Likewise.
+	* elf/tst-tlsmod6.c: Likewise.
+	* include/errno.h: Likewise.
+	* include/link.h: Likewise.
+	* include/tls.h: Likewise.
+	* locale/global-locale.c: Likewise.
+	* locale/localeinfo.h: Likewise.
+	* malloc/arena.c: Likewise.
+	* malloc/hooks.c: Likewise.
+	* malloc/malloc.c: Likewise.
+	* resolv/Versions: Likewise.
+	* sysdeps/alpha/dl-machine.h: Likewise.
+	* sysdeps/alpha/libc-tls.c: Likewise.
+	* sysdeps/generic/ldsodefs.h: Likewise.
+	* sysdeps/generic/tls.h: Likewise.
+	* sysdeps/i386/dl-machine.h: Likewise.
+	* sysdeps/ia64/dl-machine.h: Likewise.
+	* sysdeps/ia64/libc-tls.c: Likewise.
+	* sysdeps/mach/hurd/fork.c: Likewise.
+	* sysdeps/mach/hurd/i386/tls.h: Likewise.
+	* sysdeps/powerpc/powerpc32/dl-machine.c: Likwise.
+	* sysdeps/powerpc/powerpc32/dl-machine.h: Likewise.
+	* sysdeps/powerpc/powerpc64/dl-machine.h: Likewise.
+	* sysdeps/s390/libc-tls.c: Likewise.
+	* sysdeps/s390/s390-32/dl-machine.h: Likewise.
+	* sysdeps/s390/s390-64/dl-machine.h: Likewise.
+	* sysdeps/sh/dl-machine.h: Likewise.
+	* sysdeps/sparc/sparc32/dl-machine.h: Likewise.
+	* sysdeps/sparc/sparc64/dl-machine.h: Likewise.
+	* sysdeps/x86_64/dl-machine.h: Likewise.
+
+	* elf/dl-close.c (_dl_close_worker): Renamed from _dl_close and
+	split out locking and parameter checking.
+	(_dl_close): Call _dl_close_worker after locking and checking.
+	* elf/dl-open.c (_dl_open): Call _dl_close_worker instead of
+	_dl_close.
+	* elf/Makefile: Add rules to build and run tst-thrlock.
+	* elf/tst-thrlock.c:  New file.
+
+	[BZ #3426]
+	* stdlib/stdlib.h: Adjust comment for canonicalize_file_name to
+	reality.
+
+	[BZ #3429]
+	* elf/dl-open.c (dl_open_worker): Keep holding dl_load_lock until
+	we are sure we do not need it anymore for _dl_close.  Also move
+	the asserts inside the lock region.
+	Patch mostly by Suzuki <suzuki@xxxxxxxxxx>.
+
+2006-10-27  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* elf/dl-lookup.c (_dl_debug_bindings): Remove unused symbol_scope
+	argument.
+	(_dl_lookup_symbol_x): Adjust caller.
+
+	* sysdeps/generic/ldsodefs.h (struct link_namespaces): Remove
+	_ns_global_scope.
+	* elf/rtld.c (dl_main): Don't initialize _ns_global_scope.
+
+	* elf/dl-libc.c: Revert l_scope name changes.
+	* elf/dl-load.c: Likewise.
+	* elf/dl-object.c: Likewise.
+	* elf/rtld.c: Likewise.
+	* elf/dl-close.c (_dl_close): Likewise.
+	* elf/dl-open.c (dl_open_worker): Likewise.  If not SINGLE_THREAD_P,
+	always use __rtld_mrlock_{change,done}.  Always free old scope list
+	here if not l_scope_mem.
+	* elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Revert l_scope name
+	change.  Never free scope list here.  Just __rtld_mrlock_lock before
+	the lookup and __rtld_mrlock_unlock it after the lookup.
+	* elf/dl-sym.c: Likewise.
+	* include/link.h (struct r_scoperec): Remove.
+	(struct link_map): Replace l_scoperec with l_scope, l_scoperec_mem
+	with l_scope_mem and l_scoperec_lock with l_scope_lock.
+
+2006-10-25  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/gnu/netinet/tcp.h: Define TCP_CONGESTION.
+
+2006-10-18  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* configure.in: Disable building profile libraries by default.
+
+2006-10-17  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sunrpc/xdr_mem.c (xdrmem_setpos): Don't compare addresses
+	as signed longs, check for x_base + pos overflow.
+	* sunrpc/Makefile (tests): Add tst-xdrmem2.
+	* sunrpc/tst-xdrmem2.c: New test.
+
+2006-10-18  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* elf/dl-lookup.c (_dl_lookup_symbol_x): Add warning to
+	_dl_lookup_symbol_x code.
+
+2006-10-17  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* elf/dl-runtime.c: Include sysdep-cancel.h.
+	(_dl_fixup, _dl_profile_fixup): Use __rtld_mrlock_* and
+	scoperec->nusers only if !SINGLE_THREAD_P.  Use atomic_*
+	instead of catomic_* macros.
+	* elf/dl-sym.c: Include sysdep-cancel.h.
+	(do_sym): Use __rtld_mrlock_* and scoperec->nusers only
+	if !SINGLE_THREAD_P.  Use atomic_* instead of catomic_* macros.
+	* elf/dl-close.c: Include sysdep-cancel.h.
+	(_dl_close): Use __rtld_mrlock_* and scoperec->nusers only
+	if !SINGLE_THREAD_P.  Use atomic_* instead of catomic_* macros.
+	* elf/dl-open.c: Include sysdep-cancel.h.
+	(dl_open_worker): Use __rtld_mrlock_* and scoperec->nusers only
+	if !SINGLE_THREAD_P.  Use atomic_* instead of catomic_* macros.
+
+2006-10-17  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	[BZ #3313]
+	* malloc/malloc.c (malloc_consolidate): Set maxfb to address of last
+	fastbin rather than end of fastbin array.
+
+2006-10-18  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/i386/i486/bits/atomic.h (catomic_decrement): Use correct
+	body macro.
+	* sysdeps/x86_64/bits/atomic.h
+	(__arch_c_compare_and_exchange_val_64_acq): Add missing casts.
+	(catomic_decrement): Use correct body macro.
+
+2006-10-17  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* include/atomic.h: Add a unique prefix to all local variables
+	in macros.
+	* csu/tst-atomic.c (do_test): Test also catomic_* macros.
+
 2006-10-16  Ulrich Drepper  <drepper@xxxxxxxxxx>
 =

 	[BZ #3369]
@@ -108,7 +363,7 @@
 	* elf/dl-load.c: Likewise.
 	* elf/dl-object.c: Likewise.
 	* elf/rtld.c: Likewise.
-	* include/link.h: Inlcude <rtld-lowlevel.h>.  Define struct
+	* include/link.h: Include <rtld-lowlevel.h>.  Define struct
 	r_scoperec.  Replace r_scope with pointer to r_scoperec structure.
 	Add l_scoperec_lock.
 	* sysdeps/generic/ldsodefs.h: Include <rtld-lowlevel.h>.

Modified: trunk/libc/Makeconfig
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/Makeconfig (original)
+++ trunk/libc/Makeconfig Tue Nov  7 14:59:31 2006
@@ -407,11 +407,9 @@
 LDFLAGS-rtld +=3D $(combreloc-LDFLAGS)
 endif
 =

-ifeq (yes,$(have-z-relro))
 relro-LDFLAGS =3D -Wl,-z,relro
 LDFLAGS.so +=3D $(relro-LDFLAGS)
 LDFLAGS-rtld +=3D $(relro-LDFLAGS)
-endif
 =

 ifeq (yes,$(have-hash-style))
 # For the time being we unconditionally use 'both'.  At some time we

Modified: trunk/libc/Makerules
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/Makerules (original)
+++ trunk/libc/Makerules Tue Nov  7 14:59:31 2006
@@ -1233,10 +1233,7 @@
 =

 ifeq ($(firstword $(sysd-sorted-done) f)$(firstword $(generating) f),tf)
 -include $(common-objpfx)tls.make
-config-tls :=3D notls
-ifeq ($(use-tls),yes)
 config-tls :=3D tls
-endif
 ifeq ($(use-thread),yes)
 config-tls :=3D thread
 endif

Modified: trunk/libc/config.h.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/config.h.in (original)
+++ trunk/libc/config.h.in Tue Nov  7 14:59:31 2006
@@ -119,23 +119,6 @@
 =

 /* Define if the linker supports the -z combreloc option.  */
 #undef	HAVE_Z_COMBRELOC
-
-/* Define if the assembler supported .protected.  */
-#undef	HAVE_PROTECTED
-
-/* Define if the assembler supported .hidden.  */
-#undef	HAVE_HIDDEN
-
-/* Define if the compiler supports __attribute__ ((visibility (...))).  */
-#undef	HAVE_VISIBILITY_ATTRIBUTE
-
-/* Define if the compiler doesn't support __attribute__ ((visibility (...)=
))
-   together with __asm__ redirection properly.  */
-#undef	HAVE_BROKEN_VISIBILITY_ATTRIBUTE
-
-/* Define if the compiler doesn't support __attribute__ ((alias (...)))
-   together with __asm__ redirection properly.  */
-#undef	HAVE_BROKEN_ALIAS_ATTRIBUTE
 =

 /* Define if _rtld_local structure should be forced into .sdata section.  =
*/
 #undef	HAVE_SDATA_SECTION
@@ -187,9 +170,6 @@
 =

 /* Defined if forced unwind support is available.  */
 #undef	HAVE_FORCED_UNWIND
-
-/* Defined if the linker supports the -z relro option.  */
-#undef HAVE_Z_RELRO
 =

 /* Defined of libidn is available.  */
 #undef HAVE_LIBIDN

Modified: trunk/libc/config.make.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/config.make.in (original)
+++ trunk/libc/config.make.in Tue Nov  7 14:59:31 2006
@@ -38,14 +38,9 @@
 all-warnings =3D @all_warnings@
 =

 elf =3D @elf@
-have-protected =3D @libc_cv_asm_protected_directive@
-have-z-nodelete =3D @libc_cv_z_nodelete@
-have-z-nodlopen =3D @libc_cv_z_nodlopen@
-have-z-initfirst =3D @libc_cv_z_initfirst@
 have-z-combreloc =3D @libc_cv_z_combreloc@
 have-z-execstack =3D @libc_cv_z_execstack@
 have-initfini =3D @libc_cv_have_initfini@
-have-z-relro =3D @libc_cv_z_relro@
 have-Bgroup =3D @libc_cv_Bgroup@
 have-as-needed =3D @libc_cv_as_needed@
 libgcc_s_suffix =3D @libc_cv_libgcc_s_suffix@

Modified: trunk/libc/configure
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/configure (original)
+++ trunk/libc/configure Tue Nov  7 14:59:31 2006
@@ -313,7 +313,7 @@
 # include <unistd.h>
 #endif"
 =

-ac_subst_vars=3D'SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE=
_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transf=
orm_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir locals=
tatedir libdir includedir oldincludedir infodir mandir build_alias host_ali=
as target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_chec=
k_abi oldest_abi bindnow force_install all_warnings build build_cpu build_v=
endor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_sub=
dirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTA=
LL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUIL=
D_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RAN=
LIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSIN=
CLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_k=
sh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive l=
ibc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_in=
itfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_n=
eeded ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie l=
ibc_cv_hashstyle fno_unit_at_a_time libc_cv_ssp libc_cv_have_initfini no_wh=
ole_archive exceptions LIBGD have_libaudit have_libcap have_selinux EGREP s=
izeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release u=
name_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sy=
sconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite=
_script elf xcoff static shared pic_default profile omitfp bounded static_n=
ss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIB=
OBJS'
+ac_subst_vars=3D'SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE=
_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transf=
orm_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir locals=
tatedir libdir includedir oldincludedir infodir mandir build_alias host_ali=
as target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_chec=
k_abi oldest_abi bindnow force_install all_warnings build build_cpu build_v=
endor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_sub=
dirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTA=
LL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUIL=
D_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RAN=
LIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSIN=
CLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_k=
sh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_cc_with_libunwind libc_cv=
_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_=
combreloc libc_cv_z_execstack libc_cv_fpie libc_cv_hashstyle fno_unit_at_a_=
time libc_cv_ssp libc_cv_have_initfini no_whole_archive exceptions LIBGD ha=
ve_libaudit have_libcap have_selinux EGREP sizeof_long_double libc_cv_gcc_u=
nwind_find_fde uname_sysname uname_release uname_version old_glibc_headers =
libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir li=
bc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared=
 pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_=
interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
 ac_subst_files=3D''
 =

 # Initialize some variables set by options.
@@ -864,7 +864,7 @@
                           [default=3Dno]
   --enable-shared         build shared library [default=3Dyes if GNU ld &
                           ELF]
-  --enable-profile        build profiled library [default=3Dyes]
+  --enable-profile        build profiled library [default=3Dno]
   --enable-omitfp         build undebuggable optimized library
                           [default=3Dno]
   --enable-bounded        build with runtime bounds checking
@@ -1543,7 +1543,7 @@
   enableval=3D"$enable_profile"
   profile=3D$enableval
 else
-  profile=3Dyes
+  profile=3Dno
 fi;
 # Check whether --enable-omitfp or --disable-omitfp was given.
 if test "${enable_omitfp+set}" =3D set; then
@@ -5339,21 +5339,14 @@
   (exit $ac_status); }; }; then
     libc_cv_asm_protected_directive=3Dyes
   else
-    libc_cv_asm_protected_directive=3Dno
+    { { echo "$as_me:$LINENO: error: assembler support for symbol visibili=
ty is required" >&5
+echo "$as_me: error: assembler support for symbol visibility is required" =
>&2;}
+   { (exit 1); exit 1; }; }
   fi
   rm -f conftest*
 fi
 echo "$as_me:$LINENO: result: $libc_cv_asm_protected_directive" >&5
 echo "${ECHO_T}$libc_cv_asm_protected_directive" >&6
-
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_PROTECTED 1
-_ACEOF
-
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_HIDDEN 1
-_ACEOF
-
 =

   if test $libc_cv_asm_protected_directive =3D yes; then
     echo "$as_me:$LINENO: checking whether __attribute__((visibility())) i=
s supported" >&5
@@ -5383,11 +5376,10 @@
 fi
 echo "$as_me:$LINENO: result: $libc_cv_visibility_attribute" >&5
 echo "${ECHO_T}$libc_cv_visibility_attribute" >&6
-    if test $libc_cv_visibility_attribute =3D yes; then
-      cat >>confdefs.h <<\_ACEOF
-#define HAVE_VISIBILITY_ATTRIBUTE 1
-_ACEOF
-
+    if test $libc_cv_visibility_attribute !=3D yes; then
+      { { echo "$as_me:$LINENO: error: compiler support for visibility att=
ribute is required" >&5
+echo "$as_me: error: compiler support for visibility attribute is required=
" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 =

@@ -5419,10 +5411,9 @@
 echo "$as_me:$LINENO: result: $libc_cv_broken_visibility_attribute" >&5
 echo "${ECHO_T}$libc_cv_broken_visibility_attribute" >&6
     if test $libc_cv_broken_visibility_attribute =3D yes; then
-      cat >>confdefs.h <<\_ACEOF
-#define HAVE_BROKEN_VISIBILITY_ATTRIBUTE 1
-_ACEOF
-
+      { { echo "$as_me:$LINENO: error: working compiler support for visibi=
lity attribute is required" >&5
+echo "$as_me: error: working compiler support for visibility attribute is =
required" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 =

@@ -5457,10 +5448,9 @@
 echo "$as_me:$LINENO: result: $libc_cv_broken_alias_attribute" >&5
 echo "${ECHO_T}$libc_cv_broken_alias_attribute" >&6
   if test $libc_cv_broken_alias_attribute =3D yes; then
-    cat >>confdefs.h <<\_ACEOF
-#define HAVE_BROKEN_ALIAS_ATTRIBUTE 1
-_ACEOF
-
+    { { echo "$as_me:$LINENO: error: working alias attribute support requi=
red" >&5
+echo "$as_me: error: working alias attribute support required" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 =

   if test $libc_cv_visibility_attribute =3D yes; then
@@ -5572,13 +5562,14 @@
   then
     libc_cv_z_nodelete=3Dyes
   else
-    libc_cv_z_nodelete=3Dno
+    { { echo "$as_me:$LINENO: error: linker with -z nodelete support requi=
red" >&5
+echo "$as_me: error: linker with -z nodelete support required" >&2;}
+   { (exit 1); exit 1; }; }
   fi
   rm -f conftest*
 fi
 echo "$as_me:$LINENO: result: $libc_cv_z_nodelete" >&5
 echo "${ECHO_T}$libc_cv_z_nodelete" >&6
-
 =

   echo "$as_me:$LINENO: checking for -z nodlopen option" >&5
 echo $ECHO_N "checking for -z nodlopen option... $ECHO_C" >&6
@@ -5600,13 +5591,14 @@
   then
     libc_cv_z_nodlopen=3Dyes
   else
-    libc_cv_z_nodlopen=3Dno
+    { { echo "$as_me:$LINENO: error: linker with -z nodlopen support requi=
red" >&5
+echo "$as_me: error: linker with -z nodlopen support required" >&2;}
+   { (exit 1); exit 1; }; }
   fi
   rm -f conftest*
 fi
 echo "$as_me:$LINENO: result: $libc_cv_z_nodlopen" >&5
 echo "${ECHO_T}$libc_cv_z_nodlopen" >&6
-
 =

   echo "$as_me:$LINENO: checking for -z initfirst option" >&5
 echo $ECHO_N "checking for -z initfirst option... $ECHO_C" >&6
@@ -5628,15 +5620,18 @@
   then
     libc_cv_z_initfirst=3Dyes
   else
-    libc_cv_z_initfirst=3Dno
+    { { echo "$as_me:$LINENO: error: linker with -z initfirst support requ=
ired" >&5
+echo "$as_me: error: linker with -z initfirst support required" >&2;}
+   { (exit 1); exit 1; }; }
   fi
   rm -f conftest*
 fi
 echo "$as_me:$LINENO: result: $libc_cv_z_initfirst" >&5
 echo "${ECHO_T}$libc_cv_z_initfirst" >&6
 =

-
-  echo "$as_me:$LINENO: checking for -z relro option" >&5
+  case "$base_machine" in
+    i[34567]86 | x86_64 | powerpc* | s390* | sparc* | alpha*)
+      echo "$as_me:$LINENO: checking for -z relro option" >&5
 echo $ECHO_N "checking for -z relro option... $ECHO_C" >&6
 if test "${libc_cv_z_relro+set}" =3D set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5662,13 +5657,14 @@
 fi
 echo "$as_me:$LINENO: result: $libc_cv_z_relro" >&5
 echo "${ECHO_T}$libc_cv_z_relro" >&6
-
-  if test $libc_cv_z_relro =3D yes; then
-    cat >>confdefs.h <<\_ACEOF
-#define HAVE_Z_RELRO 1
-_ACEOF
-
-  fi
+      if test "$libc_cv_z_relro" =3D no; then
+        { { echo "$as_me:$LINENO: error: linker with -z relro support requ=
ired" >&5
+echo "$as_me: error: linker with -z relro support required" >&2;}
+   { (exit 1); exit 1; }; }
+      fi
+      ;;
+    *) ;;
+   esac
 =

   echo "$as_me:$LINENO: checking for -Bgroup option" >&5
 echo $ECHO_N "checking for -Bgroup option... $ECHO_C" >&6
@@ -8510,12 +8506,7 @@
 s,@INSTALL_INFO@,$INSTALL_INFO,;t t
 s,@BISON@,$BISON,;t t
 s,@VERSIONING@,$VERSIONING,;t t
-s,@libc_cv_asm_protected_directive@,$libc_cv_asm_protected_directive,;t t
 s,@libc_cv_cc_with_libunwind@,$libc_cv_cc_with_libunwind,;t t
-s,@libc_cv_z_nodelete@,$libc_cv_z_nodelete,;t t
-s,@libc_cv_z_nodlopen@,$libc_cv_z_nodlopen,;t t
-s,@libc_cv_z_initfirst@,$libc_cv_z_initfirst,;t t
-s,@libc_cv_z_relro@,$libc_cv_z_relro,;t t
 s,@libc_cv_Bgroup@,$libc_cv_Bgroup,;t t
 s,@libc_cv_libgcc_s_suffix@,$libc_cv_libgcc_s_suffix,;t t
 s,@libc_cv_as_needed@,$libc_cv_as_needed,;t t

Modified: trunk/libc/configure.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/configure.in (original)
+++ trunk/libc/configure.in Tue Nov  7 14:59:31 2006
@@ -131,9 +131,9 @@
 	      [shared=3Ddefault])
 AC_ARG_ENABLE([profile],
               AC_HELP_STRING([--enable-profile],
-                             [build profiled library @<:@default=3Dyes@:>@=
]),
+                             [build profiled library @<:@default=3Dno@:>@]=
),
 	      [profile=3D$enableval],
-	      [profile=3Dyes])
+	      [profile=3Dno])
 AC_ARG_ENABLE([omitfp],
               AC_HELP_STRING([--enable-omitfp],
                              [build undebuggable optimized library @<:@def=
ault=3Dno@:>@]),
@@ -1259,12 +1259,9 @@
   if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD);=
 then
     libc_cv_asm_protected_directive=3Dyes
   else
-    libc_cv_asm_protected_directive=3Dno
+    AC_MSG_ERROR(assembler support for symbol visibility is required)
   fi
   rm -f conftest*])
-  AC_SUBST(libc_cv_asm_protected_directive)
-  AC_DEFINE(HAVE_PROTECTED)
-  AC_DEFINE(HAVE_HIDDEN)
 =

   if test $libc_cv_asm_protected_directive =3D yes; then
     AC_CACHE_CHECK(whether __attribute__((visibility())) is supported,
@@ -1283,8 +1280,8 @@
 		  fi
 		  rm -f conftest.[cs]
 		 ])
-    if test $libc_cv_visibility_attribute =3D yes; then
-      AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
+    if test $libc_cv_visibility_attribute !=3D yes; then
+      AC_MSG_ERROR(compiler support for visibility attribute is required)
     fi
   fi
 =

@@ -1307,7 +1304,7 @@
 		  rm -f conftest.c conftest.s
 		 ])
     if test $libc_cv_broken_visibility_attribute =3D yes; then
-      AC_DEFINE(HAVE_BROKEN_VISIBILITY_ATTRIBUTE)
+      AC_MSG_ERROR(working compiler support for visibility attribute is re=
quired)
     fi
   fi
 =

@@ -1331,7 +1328,7 @@
 		  rm -f conftest.c conftest.s
 		 ])
   if test $libc_cv_broken_alias_attribute =3D yes; then
-    AC_DEFINE(HAVE_BROKEN_ALIAS_ATTRIBUTE)
+    AC_MSG_ERROR(working alias attribute support required)
   fi
 =

   if test $libc_cv_visibility_attribute =3D yes; then
@@ -1403,10 +1400,9 @@
   then
     libc_cv_z_nodelete=3Dyes
   else
-    libc_cv_z_nodelete=3Dno
+    AC_MSG_ERROR(linker with -z nodelete support required)
   fi
   rm -f conftest*])
-  AC_SUBST(libc_cv_z_nodelete)
 =

   AC_CACHE_CHECK(for -z nodlopen option,
 		 libc_cv_z_nodlopen, [dnl
@@ -1420,10 +1416,9 @@
   then
     libc_cv_z_nodlopen=3Dyes
   else
-    libc_cv_z_nodlopen=3Dno
+    AC_MSG_ERROR(linker with -z nodlopen support required)
   fi
   rm -f conftest*])
-  AC_SUBST(libc_cv_z_nodlopen)
 =

   AC_CACHE_CHECK(for -z initfirst option,
 		 libc_cv_z_initfirst, [dnl
@@ -1437,13 +1432,16 @@
   then
     libc_cv_z_initfirst=3Dyes
   else
-    libc_cv_z_initfirst=3Dno
+    AC_MSG_ERROR(linker with -z initfirst support required)
   fi
   rm -f conftest*])
-  AC_SUBST(libc_cv_z_initfirst)
-
-  AC_CACHE_CHECK(for -z relro option,
-		 libc_cv_z_relro, [dnl
+
+  case "$base_machine" in
+changequote(,)dnl
+    i[34567]86 | x86_64 | powerpc* | s390* | sparc* | alpha*)
+changequote([,])dnl
+      AC_CACHE_CHECK(for -z relro option,
+		     libc_cv_z_relro, [dnl
   libc_cv_z_relro=3Dno
   if AC_TRY_COMMAND([${CC-cc} -v --help 2>&1|grep "z relro" 1>&AS_MESSAGE_=
LOG_FD])
   then
@@ -1452,10 +1450,12 @@
       libc_cv_z_relro=3Dyes
     fi
   fi])
-  AC_SUBST(libc_cv_z_relro)
-  if test $libc_cv_z_relro =3D yes; then
-    AC_DEFINE(HAVE_Z_RELRO)
-  fi
+      if test "$libc_cv_z_relro" =3D no; then
+        AC_MSG_ERROR(linker with -z relro support required)
+      fi
+      ;;
+    *) ;;
+   esac
 =

   AC_CACHE_CHECK(for -Bgroup option,
 		 libc_cv_Bgroup, [dnl

Modified: trunk/libc/csu/Versions
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/csu/Versions (original)
+++ trunk/libc/csu/Versions Tue Nov  7 14:59:31 2006
@@ -5,7 +5,7 @@
     # helper functions
     __libc_init_first; __libc_start_main;
 =

-%if !(USE_TLS && HAVE___THREAD)
+%if !HAVE___THREAD
     # global variables
     _errno;
 =

@@ -18,7 +18,7 @@
     gnu_get_libc_release; gnu_get_libc_version;
   }
   GLIBC_PRIVATE {
-%if USE_TLS && HAVE___THREAD
+%if HAVE___THREAD
     # This version is for the TLS symbol, GLIBC_2.0 is the old object symb=
ol.
     errno;
 %endif

Modified: trunk/libc/csu/libc-start.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/csu/libc-start.c (original)
+++ trunk/libc/csu/libc-start.c Tue Nov  7 14:59:31 2006
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 =

    The GNU C Library is free software; you can redistribute it and/or
@@ -30,11 +30,7 @@
 #include <tls.h>
 #ifndef SHARED
 # include <dl-osinfo.h>
-extern void __pthread_initialize_minimal (void)
-# if !(USE_TLS - 0) && !defined NONTLS_INIT_TP
-     __attribute__ ((weak))
-# endif
-     ;
+extern void __pthread_initialize_minimal (void);
 # ifndef THREAD_SET_STACK_GUARD
 /* Only exported for architectures that don't store the stack guard canary
    in thread local area.  */
@@ -140,13 +136,8 @@
 =

   /* Initialize the thread library at least a bit since the libgcc
      functions are using thread functions if these are available and
-     we need to setup errno.  If there is no thread library and we
-     handle TLS the function is defined in the libc to initialized the
-     TLS handling.  */
-# if !(USE_TLS - 0) && !defined NONTLS_INIT_TP
-  if (__pthread_initialize_minimal)
-# endif
-    __pthread_initialize_minimal ();
+     we need to setup errno.  */
+  __pthread_initialize_minimal ();
 #endif
 =

 # ifndef SHARED

Modified: trunk/libc/csu/libc-tls.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/csu/libc-tls.c (original)
+++ trunk/libc/csu/libc-tls.c Tue Nov  7 14:59:31 2006
@@ -1,5 +1,5 @@
 /* Initialization code for TLS in statically linked application.
-   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, In=
c.
    This file is part of the GNU C Library.
 =

    The GNU C Library is free software; you can redistribute it and/or
@@ -29,7 +29,6 @@
  #error makefile bug, this file is for static only
 #endif
 =

-#ifdef USE_TLS
 extern ElfW(Phdr) *_dl_phdr;
 extern size_t _dl_phnum;
 =

@@ -143,19 +142,19 @@
      The initialized value of _dl_tls_static_size is provided by dl-open.c
      to request some surplus that permits dynamic loading of modules with
      IE-model TLS.  */
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
   tcb_offset =3D roundup (memsz + GL(dl_tls_static_size), tcbalign);
   tlsblock =3D __sbrk (tcb_offset + tcbsize + max_align);
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   tcb_offset =3D roundup (tcbsize, align ?: 1);
   tlsblock =3D __sbrk (tcb_offset + memsz + max_align
 		     + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
   tlsblock +=3D TLS_PRE_TCB_SIZE;
-# else
+#else
   /* In case a model with a different layout for the TCB and DTV
      is defined add another #elif here and in the following #ifs.  */
-#  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
-# endif
+# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
+#endif
 =

   /* Align the TLS block.  */
   tlsblock =3D (void *) (((uintptr_t) tlsblock + max_align - 1)
@@ -166,16 +165,16 @@
   // static_dtv[1].counter =3D 0;		would be needed if not already done
 =

   /* Initialize the TLS block.  */
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
   static_dtv[2].pointer.val =3D ((char *) tlsblock + tcb_offset
 			       - roundup (memsz, align ?: 1));
   static_map.l_tls_offset =3D roundup (memsz, align ?: 1);
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   static_dtv[2].pointer.val =3D (char *) tlsblock + tcb_offset;
   static_map.l_tls_offset =3D tcb_offset;
-# else
-#  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
-# endif
+#else
+# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
+#endif
   static_dtv[2].pointer.is_static =3D true;
   /* sbrk gives us zero'd memory, so we don't need to clear the remainder.=
  */
   memcpy (static_dtv[2].pointer.val, initimage, filesz);
@@ -183,16 +182,16 @@
   /* Install the pointer to the dtv.  */
 =

   /* Initialize the thread pointer.  */
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
   INSTALL_DTV ((char *) tlsblock + tcb_offset, static_dtv);
 =

   const char *lossage =3D TLS_INIT_TP ((char *) tlsblock + tcb_offset, 0);
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   INSTALL_DTV (tlsblock, static_dtv);
   const char *lossage =3D TLS_INIT_TP (tlsblock, 0);
-# else
-#  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
-# endif
+#else
+# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
+#endif
   if (__builtin_expect (lossage !=3D NULL, 0))
     __libc_fatal (lossage);
 =

@@ -212,11 +211,11 @@
 =

   memsz =3D roundup (memsz, align ?: 1);
 =

-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
   memsz +=3D tcbsize;
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   memsz +=3D tcb_offset;
-# endif
+#endif
 =

   init_static_tls (memsz, MAX (TLS_TCB_ALIGN, max_align));
 }
@@ -230,11 +229,11 @@
 {
   init_slotinfo ();
   init_static_tls (
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
 		   TLS_TCB_SIZE,
-# else
+#else
 		   0,
-# endif
+#endif
 		   TLS_TCB_ALIGN);
   return 0;
 }
@@ -248,16 +247,3 @@
 {
   __libc_setup_tls (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN);
 }
-
-#elif defined NONTLS_INIT_TP
-
-/* This is the minimal initialization function used when libpthread is
-   not used.  */
-void
-__attribute__ ((weak))
-__pthread_initialize_minimal (void)
-{
-  NONTLS_INIT_TP;
-}
-
-#endif

Modified: trunk/libc/csu/tst-atomic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/csu/tst-atomic.c (original)
+++ trunk/libc/csu/tst-atomic.c Tue Nov  7 14:59:31 2006
@@ -1,5 +1,5 @@
 /* Tests for atomic.h macros.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@xxxxxxxxxx>, 2003.
 =

@@ -379,6 +379,117 @@
     }
 #endif
 =

+#ifdef catomic_compare_and_exchange_val_acq
+  mem =3D 24;
+  if (catomic_compare_and_exchange_val_acq (&mem, 35, 24) !=3D 24
+      || mem !=3D 35)
+    {
+      puts ("catomic_compare_and_exchange_val_acq test 1 failed");
+      ret =3D 1;
+    }
+
+  mem =3D 12;
+  if (catomic_compare_and_exchange_val_acq (&mem, 10, 15) !=3D 12
+      || mem !=3D 12)
+    {
+      puts ("catomic_compare_and_exchange_val_acq test 2 failed");
+      ret =3D 1;
+    }
+
+  mem =3D -15;
+  if (catomic_compare_and_exchange_val_acq (&mem, -56, -15) !=3D -15
+      || mem !=3D -56)
+    {
+      puts ("catomic_compare_and_exchange_val_acq test 3 failed");
+      ret =3D 1;
+    }
+
+  mem =3D -1;
+  if (catomic_compare_and_exchange_val_acq (&mem, 17, 0) !=3D -1
+      || mem !=3D -1)
+    {
+      puts ("catomic_compare_and_exchange_val_acq test 4 failed");
+      ret =3D 1;
+    }
+#endif
+
+  mem =3D 24;
+  if (catomic_compare_and_exchange_bool_acq (&mem, 35, 24)
+      || mem !=3D 35)
+    {
+      puts ("catomic_compare_and_exchange_bool_acq test 1 failed");
+      ret =3D 1;
+    }
+
+  mem =3D 12;
+  if (! catomic_compare_and_exchange_bool_acq (&mem, 10, 15)
+      || mem !=3D 12)
+    {
+      puts ("catomic_compare_and_exchange_bool_acq test 2 failed");
+      ret =3D 1;
+    }
+
+  mem =3D -15;
+  if (catomic_compare_and_exchange_bool_acq (&mem, -56, -15)
+      || mem !=3D -56)
+    {
+      puts ("catomic_compare_and_exchange_bool_acq test 3 failed");
+      ret =3D 1;
+    }
+
+  mem =3D -1;
+  if (! catomic_compare_and_exchange_bool_acq (&mem, 17, 0)
+      || mem !=3D -1)
+    {
+      puts ("catomic_compare_and_exchange_bool_acq test 4 failed");
+      ret =3D 1;
+    }
+
+  mem =3D 2;
+  if (catomic_exchange_and_add (&mem, 11) !=3D 2
+      || mem !=3D 13)
+    {
+      puts ("catomic_exchange_and_add test failed");
+      ret =3D 1;
+    }
+
+  mem =3D -21;
+  catomic_add (&mem, 22);
+  if (mem !=3D 1)
+    {
+      puts ("catomic_add test failed");
+      ret =3D 1;
+    }
+
+  mem =3D -1;
+  catomic_increment (&mem);
+  if (mem !=3D 0)
+    {
+      puts ("catomic_increment test failed");
+      ret =3D 1;
+    }
+
+  mem =3D 2;
+  if (catomic_increment_val (&mem) !=3D 3)
+    {
+      puts ("catomic_increment_val test failed");
+      ret =3D 1;
+    }
+
+  mem =3D 17;
+  catomic_decrement (&mem);
+  if (mem !=3D 16)
+    {
+      puts ("catomic_decrement test failed");
+      ret =3D 1;
+    }
+
+  if (catomic_decrement_val (&mem) !=3D 15)
+    {
+      puts ("catomic_decrement_val test failed");
+      ret =3D 1;
+    }
+
   return ret;
 }
 =


Modified: trunk/libc/csu/version.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/csu/version.c (original)
+++ trunk/libc/csu/version.c Tue Nov  7 14:59:31 2006
@@ -33,9 +33,6 @@
 #include "version-info.h"
 #ifdef GLIBC_OLDEST_ABI
 "The oldest ABI supported: " GLIBC_OLDEST_ABI ".\n"
-#endif
-#ifdef USE_TLS
-"Thread-local storage support included.\n"
 #endif
 "For bug reporting instructions, please see:\n\
 <http://www.gnu.org/software/libc/bugs.html>.\n";

Modified: trunk/libc/dlfcn/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/dlfcn/Makefile (original)
+++ trunk/libc/dlfcn/Makefile Tue Nov  7 14:59:31 2006
@@ -41,10 +41,7 @@
 ifeq (yes,$(build-shared))
 tests =3D glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \
 	bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \
-	bug-atexit3
-ifeq (yes,$(have-protected))
-tests +=3D tstatexit
-endif
+	bug-atexit3 tstatexit
 endif
 modules-names =3D glreflib1 glreflib2 failtestmod defaultmod1 defaultmod2 \
 		errmsg1mod modatexit modcxaatexit \

Modified: trunk/libc/dlfcn/dlinfo.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/dlfcn/dlinfo.c (original)
+++ trunk/libc/dlfcn/dlinfo.c Tue Nov  7 14:59:31 2006
@@ -32,9 +32,7 @@
 =

 #else
 =

-# ifdef USE_TLS
-#  include <dl-tls.h>
-# endif
+# include <dl-tls.h>
 =

 struct dlinfo_args
 {
@@ -97,18 +95,14 @@
 =

     case RTLD_DI_TLS_MODID:
       *(size_t *) args->arg =3D 0;
-#ifdef USE_TLS
       *(size_t *) args->arg =3D l->l_tls_modid;
-#endif
       break;
 =

     case RTLD_DI_TLS_DATA:
       {
 	void *data =3D NULL;
-#ifdef USE_TLS
 	if (l->l_tls_modid !=3D 0)
 	  data =3D _dl_tls_get_addr_soft (l);
-#endif
 	*(void **) args->arg =3D data;
 	break;
       }

Modified: trunk/libc/elf/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/Makefile (original)
+++ trunk/libc/elf/Makefile Tue Nov  7 14:59:31 2006
@@ -159,8 +159,8 @@
 ifeq (yes,$(build-shared))
 tests +=3D loadtest restest1 preloadtest loadfail multiload origtest resol=
vfail \
 	 constload1 order $(tests-vis-$(have-protected)) noload filter unload \
-	 reldep reldep2 reldep3 reldep4 $(tests-nodelete-$(have-z-nodelete)) \
-	 $(tests-nodlopen-$(have-z-nodlopen)) neededtest neededtest2 \
+	 reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
+	 nodlopen nodlopen2 neededtest neededtest2 \
 	 neededtest3 neededtest4 unload2 lateglobal initfirst global \
 	 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
 	 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
@@ -171,12 +171,10 @@
 	 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
 	 unload3 unload4 unload5 unload6 unload7 tst-global1 order2 \
 	 tst-audit1 tst-audit2 \
-	 tst-stackguard1 tst-addr1
+	 tst-stackguard1 tst-addr1 tst-thrlock
 #	 reldep9
 test-srcs =3D tst-pathopt
 tests-vis-yes =3D vismain
-tests-nodelete-yes =3D nodelete nodelete2
-tests-nodlopen-yes =3D nodlopen nodlopen2
 tests-execstack-yes =3D tst-execstack tst-execstack-needed tst-execstack-p=
rog
 endif
 ifeq (yesyes,$(have-fpie)$(build-shared))
@@ -186,8 +184,9 @@
 modules-names =3D testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		testobj1_1 failobj constload2 constload3 unloadmod \
 		dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \
-		$(modules-nodelete-$(have-z-nodelete)) \
-		$(modules-nodlopen-$(have-z-nodlopen)) filtmod1 filtmod2 \
+		nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
+		nodel2mod1 nodel2mod2 nodel2mod3 \
+		nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
 		reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
 		reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
 		neededobj1 neededobj2 neededobj3 neededobj4 \
@@ -221,9 +220,6 @@
 modules-names +=3D tst-piemod1
 endif
 modules-vis-yes =3D vismod1 vismod2 vismod3
-modules-nodelete-yes =3D nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
-		       nodel2mod1 nodel2mod2 nodel2mod3
-modules-nodlopen-yes =3D nodlopenmod nodlopenmod2
 modules-execstack-yes =3D tst-execstack-mod
 extra-test-objs +=3D $(addsuffix .os,$(strip $(modules-names)))
 # We need this variable to be sure the test modules get the right CPPFLAGS.
@@ -916,3 +912,5 @@
 tst-leaks1-ENV =3D MALLOC_TRACE=3D$(objpfx)tst-leaks1.mtrace
 =

 $(objpfx)tst-addr1: $(libdl)
+
+$(objpfx)tst-thrlock: $(libdl) $(shared-thread-library)

Modified: trunk/libc/elf/dl-addr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-addr.c (original)
+++ trunk/libc/elf/dl-addr.c Tue Nov  7 14:59:31 2006
@@ -93,9 +93,7 @@
 			 so we can omit that test here.  */
 		      if ((symtab[symndx].st_shndx !=3D SHN_UNDEF
 			   || symtab[symndx].st_value !=3D 0)
-#ifdef USE_TLS
 			  && ELFW(ST_TYPE) (symtab[symndx].st_info) !=3D STT_TLS
-#endif
 			  && DL_ADDR_SYM_MATCH (match, &symtab[symndx],
 						matchsym, addr)
 			  && symtab[symndx].st_name < strtabsize)
@@ -123,9 +121,7 @@
 	  for (; (void *) symtab < (void *) symtabend; ++symtab)
 	    if ((ELFW(ST_BIND) (symtab->st_info) =3D=3D STB_GLOBAL
 		 || ELFW(ST_BIND) (symtab->st_info) =3D=3D STB_WEAK)
-#ifdef USE_TLS
 		&& ELFW(ST_TYPE) (symtab->st_info) !=3D STT_TLS
-#endif
 		&& (symtab->st_shndx !=3D SHN_UNDEF
 		    || symtab->st_value !=3D 0)
 		&& DL_ADDR_SYM_MATCH (match, symtab, matchsym, addr)

Modified: trunk/libc/elf/dl-cache.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-cache.c (original)
+++ trunk/libc/elf/dl-cache.c Tue Nov  7 14:59:31 2006
@@ -256,11 +256,7 @@
 	platform =3D 1ULL << platform;
 =

       /* Only accept hwcap if it's for the right platform.  */
-#ifdef USE_TLS
-# define _DL_HWCAP_TLS_MASK (1LL << 63)
-#else
-# define _DL_HWCAP_TLS_MASK 0
-#endif
+#define _DL_HWCAP_TLS_MASK (1LL << 63)
 #define HWCAP_CHECK \
       if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion))	     =
 \
 	continue;							      \

Modified: trunk/libc/elf/dl-close.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-close.c (original)
+++ trunk/libc/elf/dl-close.c Tue Nov  7 14:59:31 2006
@@ -30,6 +30,7 @@
 #include <ldsodefs.h>
 #include <sys/types.h>
 #include <sys/mman.h>
+#include <sysdep-cancel.h>
 =

 =

 /* Type of the constructor functions.  */
@@ -40,7 +41,6 @@
 #define IDX_STILL_USED -1
 =

 =

-#ifdef USE_TLS
 /* Returns true we an non-empty was found.  */
 static bool
 remove_slotinfo (size_t idx, struct dtv_slotinfo_list *listp, size_t disp,
@@ -102,26 +102,12 @@
   /* No non-entry in this list element.  */
   return false;
 }
-#endif
 =

 =

 void
-_dl_close (void *_map)
+_dl_close_worker (struct link_map *map)
 {
-  struct link_map *map =3D _map;
   Lmid_t ns =3D map->l_ns;
-  unsigned int i;
-  /* First see whether we can remove the object at all.  */
-  if (__builtin_expect (map->l_flags_1 & DF_1_NODELETE, 0)
-      && map->l_init_called)
-    /* Nope.  Do nothing.  */
-    return;
-
-  if (__builtin_expect (map->l_direct_opencount, 1) =3D=3D 0)
-    GLRO(dl_signal_error) (0, map->l_name, NULL, N_("shared object not ope=
n"));
-
-  /* Acquire the lock.  */
-  __rtld_lock_lock_recursive (GL(dl_load_lock));
 =

   /* One less direct use.  */
   --map->l_direct_opencount;
@@ -142,16 +128,13 @@
 	_dl_debug_printf ("\nclosing file=3D%s; direct_opencount=3D%u\n",
 			  map->l_name, map->l_direct_opencount);
 =

-      __rtld_lock_unlock_recursive (GL(dl_load_lock));
       return;
     }
 =

  retry:
   dl_close_state =3D pending;
 =

-#ifdef USE_TLS
   bool any_tls =3D false;
-#endif
   const unsigned int nloaded =3D GL(dl_ns)[ns]._ns_nloaded;
   char used[nloaded];
   char done[nloaded];
@@ -245,7 +228,7 @@
 #endif
   bool unload_any =3D false;
   unsigned int first_loaded =3D ~0;
-  for (i =3D 0; i < nloaded; ++i)
+  for (unsigned int i =3D 0; i < nloaded; ++i)
     {
       struct link_map *imap =3D maps[i];
 =

@@ -342,14 +325,14 @@
 	     one for the terminating NULL pointer.  */
 	  size_t remain =3D (new_list !=3D NULL) + 1;
 	  bool removed_any =3D false;
-	  for (size_t cnt =3D 0; imap->l_scoperec->scope[cnt] !=3D NULL; ++cnt)
+	  for (size_t cnt =3D 0; imap->l_scope[cnt] !=3D NULL; ++cnt)
 	    /* This relies on l_scope[] entries being always set either
 	       to its own l_symbolic_searchlist address, or some map's
 	       l_searchlist address.  */
-	    if (imap->l_scoperec->scope[cnt] !=3D &imap->l_symbolic_searchlist)
+	    if (imap->l_scope[cnt] !=3D &imap->l_symbolic_searchlist)
 	      {
 		struct link_map *tmap =3D (struct link_map *)
-		  ((char *) imap->l_scoperec->scope[cnt]
+		  ((char *) imap->l_scope[cnt]
 		   - offsetof (struct link_map, l_searchlist));
 		assert (tmap->l_ns =3D=3D ns);
 		if (tmap->l_idx =3D=3D IDX_STILL_USED)
@@ -367,38 +350,35 @@
 		 user of the current array.  If possible use the link map's
 		 memory.  */
 	      size_t new_size;
-	      struct r_scoperec *newp;
-	      if (imap->l_scoperec !=3D &imap->l_scoperec_mem
-		  && remain < NINIT_SCOPE_ELEMS (imap)
-		  && imap->l_scoperec_mem.nusers =3D=3D 0)
+	      struct r_scope_elem **newp;
+
+#define SCOPE_ELEMS(imap) \
+  (sizeof (imap->l_scope_mem) / sizeof (imap->l_scope_mem[0]))
+
+	      if (imap->l_scope !=3D imap->l_scope_mem
+		  && remain < SCOPE_ELEMS (imap))
 		{
-		  new_size =3D NINIT_SCOPE_ELEMS (imap);
-		  newp =3D &imap->l_scoperec_mem;
+		  new_size =3D SCOPE_ELEMS (imap);
+		  newp =3D imap->l_scope_mem;
 		}
 	      else
 		{
 		  new_size =3D imap->l_scope_max;
-		  newp =3D (struct r_scoperec *)
-		    malloc (sizeof (struct r_scoperec)
-			    + new_size * sizeof (struct r_scope_elem *));
+		  newp =3D (struct r_scope_elem **)
+		    malloc (new_size * sizeof (struct r_scope_elem *));
 		  if (newp =3D=3D NULL)
 		    _dl_signal_error (ENOMEM, "dlclose", NULL,
 				      N_("cannot create scope list"));
 		}
 =

-	      newp->nusers =3D 0;
-	      newp->remove_after_use =3D false;
-	      newp->notify =3D false;
-
 	      /* Copy over the remaining scope elements.  */
 	      remain =3D 0;
-	      for (size_t cnt =3D 0; imap->l_scoperec->scope[cnt] !=3D NULL; ++cn=
t)
+	      for (size_t cnt =3D 0; imap->l_scope[cnt] !=3D NULL; ++cnt)
 		{
-		  if (imap->l_scoperec->scope[cnt]
-		      !=3D &imap->l_symbolic_searchlist)
+		  if (imap->l_scope[cnt] !=3D &imap->l_symbolic_searchlist)
 		    {
 		      struct link_map *tmap =3D (struct link_map *)
-			((char *) imap->l_scoperec->scope[cnt]
+			((char *) imap->l_scope[cnt]
 			 - offsetof (struct link_map, l_searchlist));
 		      if (tmap->l_idx !=3D IDX_STILL_USED)
 			{
@@ -406,33 +386,30 @@
 			     scope.  */
 			  if (new_list !=3D NULL)
 			    {
-			      newp->scope[remain++] =3D new_list;
+			      newp[remain++] =3D new_list;
 			      new_list =3D NULL;
 			    }
 			  continue;
 			}
 		    }
 =

-		  newp->scope[remain++] =3D imap->l_scoperec->scope[cnt];
+		  newp[remain++] =3D imap->l_scope[cnt];
 		}
-	      newp->scope[remain] =3D NULL;
-
-	      struct r_scoperec *old =3D imap->l_scoperec;
-
-	      __rtld_mrlock_change (imap->l_scoperec_lock);
-	      imap->l_scoperec =3D newp;
-	      __rtld_mrlock_done (imap->l_scoperec_lock);
-
-	      if (catomic_increment_val (&old->nusers) !=3D 1)
+	      newp[remain] =3D NULL;
+
+	      struct r_scope_elem **old =3D imap->l_scope;
+
+	      if (RTLD_SINGLE_THREAD_P)
+		imap->l_scope =3D newp;
+	      else
 		{
-		  old->remove_after_use =3D true;
-		  old->notify =3D true;
-		  if (catomic_decrement_val (&old->nusers) !=3D 0)
-		    __rtld_waitzero (old->nusers);
+		  __rtld_mrlock_change (imap->l_scope_lock);
+		  imap->l_scope =3D newp;
+		  __rtld_mrlock_done (imap->l_scope_lock);
 		}
 =

 	      /* No user anymore, we can free it now.  */
-	      if (old !=3D &imap->l_scoperec_mem)
+	      if (old !=3D imap->l_scope_mem)
 		free (old);
 =

 	      imap->l_scope_max =3D new_size;
@@ -479,15 +456,13 @@
   r->r_state =3D RT_DELETE;
   _dl_debug_state ();
 =

-#ifdef USE_TLS
   size_t tls_free_start;
   size_t tls_free_end;
   tls_free_start =3D tls_free_end =3D NO_TLS_OFFSET;
-#endif
 =

   /* Check each element of the search list to see if all references to
      it are gone.  */
-  for (i =3D first_loaded; i < nloaded; ++i)
+  for (unsigned int i =3D first_loaded; i < nloaded; ++i)
     {
       struct link_map *imap =3D maps[i];
       if (!used[i])
@@ -514,7 +489,6 @@
 	      --GL(dl_ns)[ns]._ns_main_searchlist->r_nlist;
 	    }
 =

-#ifdef USE_TLS
 	  /* Remove the object from the dtv slotinfo array if it uses TLS.  */
 	  if (__builtin_expect (imap->l_tls_blocksize > 0, 0))
 	    {
@@ -533,7 +507,7 @@
 		     this search list, going in either direction.  When the
 		     whole chunk is at the end of the used area then we can
 		     reclaim it.  */
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
 		  if (tls_free_start =3D=3D NO_TLS_OFFSET
 		      || (size_t) imap->l_tls_offset =3D=3D tls_free_start)
 		    {
@@ -573,7 +547,7 @@
 			    =3D tls_free_end - imap->l_tls_blocksize;
 			}
 		    }
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
 		  if ((size_t) imap->l_tls_offset =3D=3D tls_free_end)
 		    /* Extend the contiguous chunk being reclaimed.  */
 		    tls_free_end -=3D imap->l_tls_blocksize;
@@ -590,12 +564,11 @@
 		      tls_free_start =3D imap->l_tls_offset;
 		      tls_free_end =3D tls_free_start + imap->l_tls_blocksize;
 		    }
-# else
-#  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
-# endif
+#else
+# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
+#endif
 		}
 	    }
-#endif
 =

 	  /* We can unmap all the maps at once.  We determined the
 	     start address and length when we loaded the object and
@@ -646,8 +619,8 @@
 	  free (imap->l_initfini);
 =

 	  /* Remove the scope array if we allocated it.  */
-	  if (imap->l_scoperec !=3D &imap->l_scoperec_mem)
-	    free (imap->l_scoperec);
+	  if (imap->l_scope !=3D imap->l_scope_mem)
+	    free (imap->l_scope);
 =

 	  if (imap->l_phdr_allocated)
 	    free ((void *) imap->l_phdr);
@@ -661,7 +634,6 @@
 	}
     }
 =

-#ifdef USE_TLS
   /* If we removed any object which uses TLS bump the generation counter. =
 */
   if (any_tls)
     {
@@ -671,7 +643,6 @@
       if (tls_free_end =3D=3D GL(dl_tls_static_used))
 	GL(dl_tls_static_used) =3D tls_free_start;
     }
-#endif
 =

 #ifdef SHARED
   /* Auditing checkpoint: we have deleted all objects.  */
@@ -703,11 +674,34 @@
     goto retry;
 =

   dl_close_state =3D not_pending;
+}
+
+
+void
+_dl_close (void *_map)
+{
+  struct link_map *map =3D _map;
+
+  /* First see whether we can remove the object at all.  */
+  if (__builtin_expect (map->l_flags_1 & DF_1_NODELETE, 0))
+    {
+      assert (map->l_init_called);
+      /* Nope.  Do nothing.  */
+      return;
+    }
+
+  if (__builtin_expect (map->l_direct_opencount, 1) =3D=3D 0)
+    GLRO(dl_signal_error) (0, map->l_name, NULL, N_("shared object not ope=
n"));
+
+  /* Acquire the lock.  */
+  __rtld_lock_lock_recursive (GL(dl_load_lock));
+
+  _dl_close_worker (map);
+
   __rtld_lock_unlock_recursive (GL(dl_load_lock));
 }
 =

 =

-#ifdef USE_TLS
 static bool __libc_freeres_fn_section
 free_slotinfo (struct dtv_slotinfo_list **elemp)
 {
@@ -734,7 +728,6 @@
 =

   return true;
 }
-#endif
 =

 =

 libc_freeres_fn (free_mem)
@@ -760,22 +753,20 @@
 	free (old);
       }
 =

-#ifdef USE_TLS
   if (USE___THREAD || GL(dl_tls_dtv_slotinfo_list) !=3D NULL)
     {
       /* Free the memory allocated for the dtv slotinfo array.  We can do
 	 this only if all modules which used this memory are unloaded.  */
-# ifdef SHARED
+#ifdef SHARED
       if (GL(dl_initial_dtv) =3D=3D NULL)
 	/* There was no initial TLS setup, it was set up later when
 	   it used the normal malloc.  */
 	free_slotinfo (&GL(dl_tls_dtv_slotinfo_list));
       else
-# endif
+#endif
 	/* The first element of the list does not have to be deallocated.
 	   It was allocated in the dynamic linker (i.e., with a different
 	   malloc), and in the static library it's in .bss space.  */
 	free_slotinfo (&GL(dl_tls_dtv_slotinfo_list)->next);
     }
-#endif
 }

Modified: trunk/libc/elf/dl-iteratephdr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-iteratephdr.c (original)
+++ trunk/libc/elf/dl-iteratephdr.c Tue Nov  7 14:59:31 2006
@@ -70,11 +70,9 @@
       info.dlpi_subs =3D GL(dl_load_adds) - nloaded;
       info.dlpi_tls_modid =3D 0;
       info.dlpi_tls_data =3D NULL;
-#ifdef USE_TLS
       info.dlpi_tls_modid =3D l->l_tls_modid;
       if (info.dlpi_tls_modid !=3D 0)
 	info.dlpi_tls_data =3D _dl_tls_get_addr_soft (l);
-#endif
       ret =3D callback (&info, sizeof (struct dl_phdr_info), data);
       if (ret)
 	break;

Modified: trunk/libc/elf/dl-libc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-libc.c (original)
+++ trunk/libc/elf/dl-libc.c Tue Nov  7 14:59:31 2006
@@ -133,8 +133,7 @@
   struct do_dlsym_args *args =3D (struct do_dlsym_args *) ptr;
   args->ref =3D NULL;
   l =3D GLRO(dl_lookup_symbol_x) (args->name, args->map, &args->ref,
-				args->map->l_scoperec->scope, &vers, 0, 0,
-				NULL);
+				args->map->l_scope, &vers, 0, 0, NULL);
   args->loadbase =3D l;
 }
 =


Modified: trunk/libc/elf/dl-load.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-load.c (original)
+++ trunk/libc/elf/dl-load.c Tue Nov  7 14:59:31 2006
@@ -1085,7 +1085,6 @@
 	  break;
 =

 	case PT_TLS:
-#ifdef USE_TLS
 	  if (ph->p_memsz =3D=3D 0)
 	    /* Nothing to do for an empty segment.  */
 	    break;
@@ -1113,7 +1112,7 @@
 	      break;
 	    }
 =

-# ifdef SHARED
+#ifdef SHARED
 	  if (l->l_prev =3D=3D NULL || (mode & __RTLD_AUDIT) !=3D 0)
 	    /* We are loading the executable itself when the dynamic linker
 	       was executed directly.  The setup will happen later.  */
@@ -1122,7 +1121,7 @@
 	  /* In a static binary there is no way to tell if we dynamically
 	     loaded libpthread.  */
 	  if (GL(dl_error_catch_tsd) =3D=3D &_dl_initial_error_catch_tsd)
-# endif
+#endif
 	    {
 	      /* We have not yet loaded libpthread.
 		 We can do the TLS setup right now!  */
@@ -1155,7 +1154,6 @@
 	      _dl_deallocate_tls (tcb, 1);
 	      goto call_lose;
 	    }
-#endif
 =

 	  /* Uh-oh, the binary expects TLS support but we cannot
 	     provide it.  */
@@ -1394,7 +1392,7 @@
 	 requires that it be executable.  We must change the
 	 protection of the variable which contains the flags used in
 	 the mprotect calls.  */
-#if defined HAVE_Z_RELRO && defined SHARED
+#ifdef SHARED
       if ((mode & (__RTLD_DLOPEN | __RTLD_AUDIT)) =3D=3D __RTLD_DLOPEN)
 	{
 	  const uintptr_t p =3D (uintptr_t) &__stack_prot & -GLRO(dl_pagesize);
@@ -1431,11 +1429,9 @@
 	}
     }
 =

-#ifdef USE_TLS
   /* Adjust the address of the TLS initialization image.  */
   if (l->l_tls_initimage !=3D NULL)
     l->l_tls_initimage =3D (char *) l->l_tls_initimage + l->l_addr;
-#endif
 =

   /* We are done mapping in the file.  We no longer need the descriptor.  =
*/
   if (__builtin_expect (__close (fd) !=3D 0, 0))
@@ -1473,7 +1469,7 @@
      have to do this for the main map.  */
   if ((mode & RTLD_DEEPBIND) =3D=3D 0
       && __builtin_expect (l->l_info[DT_SYMBOLIC] !=3D NULL, 0)
-      && &l->l_searchlist !=3D l->l_scoperec->scope[0])
+      && &l->l_searchlist !=3D l->l_scope[0])
     {
       /* Create an appropriate searchlist.  It contains only this map.
 	 This is the definition of DT_SYMBOLIC in SysVr4.  */
@@ -1490,11 +1486,11 @@
       l->l_symbolic_searchlist.r_nlist =3D 1;
 =

       /* Now move the existing entries one back.  */
-      memmove (&l->l_scoperec->scope[1], &l->l_scoperec->scope[0],
-	       (l->l_scope_max - 1) * sizeof (l->l_scoperec->scope[0]));
+      memmove (&l->l_scope[1], &l->l_scope[0],
+	       (l->l_scope_max - 1) * sizeof (l->l_scope[0]));
 =

       /* Now add the new entry.  */
-      l->l_scoperec->scope[0] =3D &l->l_symbolic_searchlist;
+      l->l_scope[0] =3D &l->l_symbolic_searchlist;
     }
 =

   /* Remember whether this object must be initialized first.  */
@@ -1939,11 +1935,10 @@
 	 must not be freed using the general free() in libc.  */
       if (sps->malloced)
 	free (sps->dirs);
-#ifdef HAVE_Z_RELRO
+
       /* rtld_search_dirs is attribute_relro, therefore avoid writing
 	 into it.  */
       if (sps !=3D &rtld_search_dirs)
-#endif
 	sps->dirs =3D (void *) -1;
     }
 =


Modified: trunk/libc/elf/dl-lookup.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-lookup.c (original)
+++ trunk/libc/elf/dl-lookup.c Tue Nov  7 14:59:31 2006
@@ -200,14 +200,17 @@
 static void
 internal_function
 _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
-		    const ElfW(Sym) **ref, struct r_scope_elem *symbol_scope[],
-		    struct sym_val *value,
+		    const ElfW(Sym) **ref, struct sym_val *value,
 		    const struct r_found_version *version, int type_class,
 		    int protected);
 =

 =

 /* Search loaded objects' symbol tables for a definition of the symbol
-   UNDEF_NAME, perhaps with a requested version for the symbol.  */
+   UNDEF_NAME, perhaps with a requested version for the symbol.
+
+   We must never have calls to the audit functions inside this function
+   or in any function which gets called.  If this would happen the audit
+   code might create a thread which can throw off all the scope locking.  =
*/
 lookup_t
 internal_function
 _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
@@ -347,7 +350,7 @@
 =

   if (__builtin_expect (GLRO(dl_debug_mask)
 			& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
-    _dl_debug_bindings (undef_name, undef_map, ref, symbol_scope,
+    _dl_debug_bindings (undef_name, undef_map, ref,
 			&current_value, version, type_class, protected);
 =

   *ref =3D current_value.s;
@@ -404,8 +407,7 @@
 static void
 internal_function
 _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
-		    const ElfW(Sym) **ref, struct r_scope_elem *symbol_scope[],
-		    struct sym_val *value,
+		    const ElfW(Sym) **ref, struct sym_val *value,
 		    const struct r_found_version *version, int type_class,
 		    int protected)
 {
@@ -447,12 +449,10 @@
 	    conflict =3D 1;
 	}
 =

-# ifdef USE_TLS
       if (value->s
 	  && (__builtin_expect (ELFW(ST_TYPE) (value->s->st_info)
 				=3D=3D STT_TLS, 0)))
 	type_class =3D 4;
-# endif
 =

       if (conflict
 	  || GLRO(dl_trace_prelink_map) =3D=3D undef_map

Modified: trunk/libc/elf/dl-object.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-object.c (original)
+++ trunk/libc/elf/dl-object.c Tue Nov  7 14:59:31 2006
@@ -64,7 +64,7 @@
   new->l_name =3D realname;
   new->l_type =3D type;
   new->l_loader =3D loader;
-#if defined USE_TLS && NO_TLS_OFFSET !=3D 0
+#if NO_TLS_OFFSET !=3D 0
   new->l_tls_offset =3D NO_TLS_OFFSET;
 #endif
   new->l_ns =3D nsid;
@@ -82,13 +82,12 @@
   /* Use the 'l_scope_mem' array by default for the the 'l_scope'
      information.  If we need more entries we will allocate a large
      array dynamically.  */
-  new->l_scoperec =3D &new->l_scoperec_mem;
-  new->l_scope_max =3D (sizeof (new->l_scope_realmem.scope_elems)
-		      / sizeof (new->l_scope_realmem.scope_elems[0]));
+  new->l_scope =3D new->l_scope_mem;
+  new->l_scope_max =3D sizeof (new->l_scope_mem) / sizeof (new->l_scope_me=
m[0]);
 =

   /* No need to initialize the scope lock if the initializer is zero.  */
 #if _RTLD_MRLOCK_INITIALIZER !=3D 0
-  __rtld_mrlock_initialize (new->l_scoperec_mem.lock);
+  __rtld_mrlock_initialize (new->l_scope_lock);
 #endif
 =

   /* Counter for the scopes we have to handle.  */
@@ -104,8 +103,7 @@
       l->l_next =3D new;
 =

       /* Add the global scope.  */
-      new->l_scoperec->scope[idx++]
-	=3D &GL(dl_ns)[nsid]._ns_loaded->l_searchlist;
+      new->l_scope[idx++] =3D &GL(dl_ns)[nsid]._ns_loaded->l_searchlist;
     }
   else
     GL(dl_ns)[nsid]._ns_loaded =3D new;
@@ -121,15 +119,15 @@
       loader =3D loader->l_loader;
 =

   /* Insert the scope if it isn't the global scope we already added.  */
-  if (idx =3D=3D 0 || &loader->l_searchlist !=3D new->l_scoperec->scope[0])
+  if (idx =3D=3D 0 || &loader->l_searchlist !=3D new->l_scope[0])
     {
       if ((mode & RTLD_DEEPBIND) !=3D 0 && idx !=3D 0)
 	{
-	  new->l_scoperec->scope[1] =3D new->l_scoperec->scope[0];
+	  new->l_scope[1] =3D new->l_scope[0];
 	  idx =3D 0;
 	}
 =

-      new->l_scoperec->scope[idx] =3D &loader->l_searchlist;
+      new->l_scope[idx] =3D &loader->l_searchlist;
     }
 =

   new->l_local_scope[0] =3D &new->l_searchlist;

Modified: trunk/libc/elf/dl-open.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-open.c (original)
+++ trunk/libc/elf/dl-open.c Tue Nov  7 14:59:31 2006
@@ -31,6 +31,7 @@
 #include <ldsodefs.h>
 #include <bp-sym.h>
 #include <caller.h>
+#include <sysdep-cancel.h>
 =

 #include <dl-dst.h>
 =

@@ -163,9 +164,7 @@
   struct link_map *new, *l;
   int lazy;
   unsigned int i;
-#ifdef USE_TLS
   bool any_tls =3D false;
-#endif
   struct link_map *call_map =3D NULL;
 =

   /* Check whether _dl_open() has been called from a valid DSO.  */
@@ -343,7 +342,7 @@
 		 start the profiling.  */
 	      struct link_map *old_profile_map =3D GL(dl_profile_map);
 =

-	      _dl_relocate_object (l, l->l_scoperec->scope, 1, 1);
+	      _dl_relocate_object (l, l->l_scope, 1, 1);
 =

 	      if (old_profile_map =3D=3D NULL && GL(dl_profile_map) !=3D NULL)
 		{
@@ -356,7 +355,7 @@
 	    }
 	  else
 #endif
-	    _dl_relocate_object (l, l->l_scoperec->scope, lazy, 0);
+	    _dl_relocate_object (l, l->l_scope, lazy, 0);
 	}
 =

       if (l =3D=3D new)
@@ -374,7 +373,7 @@
 	 not been loaded here and now.  */
       if (imap->l_init_called && imap->l_type =3D=3D lt_loaded)
 	{
-	  struct r_scope_elem **runp =3D imap->l_scoperec->scope;
+	  struct r_scope_elem **runp =3D imap->l_scope;
 	  size_t cnt =3D 0;
 =

 	  while (*runp !=3D NULL)
@@ -394,47 +393,41 @@
 	      /* The 'r_scope' array is too small.  Allocate a new one
 		 dynamically.  */
 	      size_t new_size;
-	      struct r_scoperec *newp;
-
-	      if (imap->l_scoperec !=3D &imap->l_scoperec_mem
-		  && imap->l_scope_max < NINIT_SCOPE_ELEMS (imap)
-		  && imap->l_scoperec_mem.nusers =3D=3D 0)
+	      struct r_scope_elem **newp;
+
+#define SCOPE_ELEMS(imap) \
+  (sizeof (imap->l_scope_mem) / sizeof (imap->l_scope_mem[0]))
+
+	      if (imap->l_scope !=3D imap->l_scope_mem
+		  && imap->l_scope_max < SCOPE_ELEMS (imap))
 		{
-		  new_size =3D NINIT_SCOPE_ELEMS (imap);
-		  newp =3D &imap->l_scoperec_mem;
+		  new_size =3D SCOPE_ELEMS (imap);
+		  newp =3D imap->l_scope_mem;
 		}
 	      else
 		{
 		  new_size =3D imap->l_scope_max * 2;
-		  newp =3D (struct r_scoperec *)
-		    malloc (sizeof (struct r_scoperec)
-			    + new_size * sizeof (struct r_scope_elem *));
+		  newp =3D (struct r_scope_elem **)
+		    malloc (new_size * sizeof (struct r_scope_elem *));
 		  if (newp =3D=3D NULL)
 		    _dl_signal_error (ENOMEM, "dlopen", NULL,
 				      N_("cannot create scope list"));
 		}
 =

-	      newp->nusers =3D 0;
-	      newp->remove_after_use =3D false;
-	      newp->notify =3D false;
-	      memcpy (newp->scope, imap->l_scoperec->scope,
-		      cnt * sizeof (imap->l_scoperec->scope[0]));
-	      struct r_scoperec *old =3D imap->l_scoperec;
-
-	      if (old =3D=3D &imap->l_scoperec_mem)
-		imap->l_scoperec =3D newp;
+	      memcpy (newp, imap->l_scope, cnt * sizeof (imap->l_scope[0]));
+	      struct r_scope_elem **old =3D imap->l_scope;
+
+	      if (RTLD_SINGLE_THREAD_P)
+		imap->l_scope =3D newp;
 	      else
 		{
-		  __rtld_mrlock_change (imap->l_scoperec_lock);
-		  imap->l_scoperec =3D newp;
-		  __rtld_mrlock_done (imap->l_scoperec_lock);
-
-		  catomic_increment (&old->nusers);
-		  old->remove_after_use =3D true;
-		  if (catomic_decrement_val (&old->nusers) =3D=3D 0)
-		    /* No user, we can free it here and now.  */
-		    free (old);
+		  __rtld_mrlock_change (imap->l_scope_lock);
+		  imap->l_scope =3D newp;
+		  __rtld_mrlock_done (imap->l_scope_lock);
 		}
+
+	      if (old !=3D imap->l_scope_mem)
+		free (old);
 =

 	      imap->l_scope_max =3D new_size;
 	    }
@@ -442,11 +435,10 @@
 	  /* First terminate the extended list.  Otherwise a thread
 	     might use the new last element and then use the garbage
 	     at offset IDX+1.  */
-	  imap->l_scoperec->scope[cnt + 1] =3D NULL;
+	  imap->l_scope[cnt + 1] =3D NULL;
 	  atomic_write_barrier ();
-	  imap->l_scoperec->scope[cnt] =3D &new->l_searchlist;
-	}
-#if USE_TLS
+	  imap->l_scope[cnt] =3D &new->l_searchlist;
+	}
       /* Only add TLS memory if this object is loaded now and
 	 therefore is not yet initialized.  */
       else if (! imap->l_init_called
@@ -461,11 +453,11 @@
 	  if (imap->l_need_tls_init)
 	    {
 	      imap->l_need_tls_init =3D 0;
-# ifdef SHARED
+#ifdef SHARED
 	      /* Update the slot information data for at least the
 		 generation of the DSO we are allocating data for.  */
 	      _dl_update_slotinfo (imap->l_tls_modid);
-# endif
+#endif
 =

 	      GL(dl_init_static_tls) (imap);
 	      assert (imap->l_need_tls_init =3D=3D 0);
@@ -474,15 +466,12 @@
 	  /* We have to bump the generation counter.  */
 	  any_tls =3D true;
 	}
-#endif
-    }
-
-#if USE_TLS
+    }
+
   /* Bump the generation number if necessary.  */
   if (any_tls && __builtin_expect (++GL(dl_tls_generation) =3D=3D 0, 0))
     _dl_fatal_printf (N_("\
 TLS generation counter wrapped!  Please report this."));
-#endif
 =

   /* Run the initializer functions of new objects.  */
   _dl_init (new, args->argc, args->argv, args->env);
@@ -572,20 +561,13 @@
   _dl_unload_cache ();
 #endif
 =

-  /* Release the lock.  */
-  __rtld_lock_unlock_recursive (GL(dl_load_lock));
-
+  /* See if an error occurred during loading.  */
   if (__builtin_expect (errstring !=3D NULL, 0))
     {
-      /* Some error occurred during loading.  */
-      char *local_errstring;
-      size_t len_errstring;
-
       /* Remove the object from memory.  It may be in an inconsistent
 	 state if relocation failed, for example.  */
       if (args.map)
 	{
-#ifdef USE_TLS
 	  /* Maybe some of the modules which were loaded use TLS.
 	     Since it will be removed in the following _dl_close call
 	     we have to mark the dtv array as having gaps to fill the
@@ -595,14 +577,19 @@
 	     up.  */
 	  if ((mode & __RTLD_AUDIT) =3D=3D 0)
 	    GL(dl_tls_dtv_gaps) =3D true;
-#endif
-
-	  _dl_close (args.map);
-	}
+
+	  _dl_close_worker (args.map);
+	}
+
+      assert (_dl_debug_initialize (0, args.nsid)->r_state =3D=3D RT_CONSI=
STENT);
+
+      /* Release the lock.  */
+      __rtld_lock_unlock_recursive (GL(dl_load_lock));
 =

       /* Make a local copy of the error string so that we can release the
 	 memory allocated for it.  */
-      len_errstring =3D strlen (errstring) + 1;
+      size_t len_errstring =3D strlen (errstring) + 1;
+      char *local_errstring;
       if (objname =3D=3D errstring + len_errstring)
 	{
 	  size_t total_len =3D len_errstring + strlen (objname) + 1;
@@ -619,13 +606,14 @@
       if (malloced)
 	free ((char *) errstring);
 =

-      assert (_dl_debug_initialize (0, args.nsid)->r_state =3D=3D RT_CONSI=
STENT);
-
       /* Reraise the error.  */
       _dl_signal_error (errcode, objname, NULL, local_errstring);
     }
 =

   assert (_dl_debug_initialize (0, args.nsid)->r_state =3D=3D RT_CONSISTEN=
T);
+
+  /* Release the lock.  */
+  __rtld_lock_unlock_recursive (GL(dl_load_lock));
 =

 #ifndef SHARED
   DL_STATIC_INIT (args.map);

Modified: trunk/libc/elf/dl-reloc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-reloc.c (original)
+++ trunk/libc/elf/dl-reloc.c Tue Nov  7 14:59:31 2006
@@ -1,5 +1,5 @@
 /* Relocate a shared object and resolve its references to other loaded obj=
ects.
-   Copyright (C) 1995-2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1995-2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 =

    The GNU C Library is free software; you can redistribute it and/or
@@ -35,7 +35,6 @@
 #endif
 =

 =

-#ifdef USE_TLS
 /* We are trying to perform a static TLS relocation in MAP, but it was
    dynamically loaded.  This can only work if there is enough surplus in
    the static TLS area already allocated for each running thread.  If this
@@ -56,7 +55,7 @@
 cannot allocate memory in static TLS block"));
     }
 =

-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
   size_t freebytes;
   size_t n;
   size_t blsize;
@@ -73,7 +72,7 @@
 					    - map->l_tls_firstbyte_offset);
 =

   map->l_tls_offset =3D GL(dl_tls_static_used) =3D offset;
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   size_t used;
   size_t check;
 =

@@ -87,9 +86,9 @@
 =

   map->l_tls_offset =3D offset;
   GL(dl_tls_static_used) =3D used;
-# else
-#  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
-# endif
+#else
+# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
+#endif
 =

   /* If the object is not yet relocated we cannot initialize the
      static TLS region.  Delay it.  */
@@ -115,13 +114,13 @@
 void
 _dl_nothread_init_static_tls (struct link_map *map)
 {
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
   void *dest =3D (char *) THREAD_SELF - map->l_tls_offset;
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   void *dest =3D (char *) THREAD_SELF + map->l_tls_offset + TLS_PRE_TCB_SI=
ZE;
-# else
-#  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
-# endif
+#else
+# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
+#endif
 =

   /* Fill in the DTV slot so that a later LD/GD access will find it.  */
   dtv_t *dtv =3D THREAD_DTV ();
@@ -133,7 +132,6 @@
   memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size=
),
 	  '\0', map->l_tls_blocksize - map->l_tls_initimage_size);
 }
-#endif
 =

 =

 void

Modified: trunk/libc/elf/dl-runtime.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-runtime.c (original)
+++ trunk/libc/elf/dl-runtime.c Tue Nov  7 14:59:31 2006
@@ -24,6 +24,7 @@
 #include <unistd.h>
 #include <sys/param.h>
 #include <ldsodefs.h>
+#include <sysdep-cancel.h>
 #include "dynamic-link.h"
 =

 #if (!defined ELF_MACHINE_NO_RELA && !defined ELF_MACHINE_PLT_REL) \
@@ -92,29 +93,15 @@
 	    version =3D NULL;
 	}
 =

-      struct r_scoperec *scoperec =3D l->l_scoperec;
-      if (l->l_type =3D=3D lt_loaded)
-	{
-	  __rtld_mrlock_lock (l->l_scoperec_lock);
-	  scoperec =3D l->l_scoperec;
-	  catomic_increment (&scoperec->nusers);
-	  __rtld_mrlock_unlock (l->l_scoperec_lock);
-	}
+      if (l->l_type =3D=3D lt_loaded && !RTLD_SINGLE_THREAD_P)
+	__rtld_mrlock_lock (l->l_scope_lock);
 =

       result =3D _dl_lookup_symbol_x (strtab + sym->st_name, l, &sym,
-				    scoperec->scope, version,
-				    ELF_RTYPE_CLASS_PLT,
+				    l->l_scope, version, ELF_RTYPE_CLASS_PLT,
 				    DL_LOOKUP_ADD_DEPENDENCY, NULL);
 =

-      if (l->l_type =3D=3D lt_loaded
-	  && catomic_decrement_val (&scoperec->nusers) =3D=3D 0
-	  && __builtin_expect (scoperec->remove_after_use, 0))
-	{
-	  if (scoperec->notify)
-	    __rtld_notify (scoperec->nusers);
-	  else
-	    free (scoperec);
-	}
+      if (l->l_type =3D=3D lt_loaded && !RTLD_SINGLE_THREAD_P)
+	__rtld_mrlock_unlock (l->l_scope_lock);
 =

       /* Currently result contains the base load address (or link map)
 	 of the object that defines sym.  Now add in the symbol
@@ -194,29 +181,16 @@
 		version =3D NULL;
 	    }
 =

-	  struct r_scoperec *scoperec =3D l->l_scoperec;
-	  if (l->l_type =3D=3D lt_loaded)
-	    {
-	      __rtld_mrlock_lock (l->l_scoperec_lock);
-	      scoperec =3D l->l_scoperec;
-	      catomic_increment (&scoperec->nusers);
-	      __rtld_mrlock_unlock (l->l_scoperec_lock);
-	    }
+	  if (l->l_type =3D=3D lt_loaded && !RTLD_SINGLE_THREAD_P)
+	    __rtld_mrlock_lock (l->l_scope_lock);
 =

 	  result =3D _dl_lookup_symbol_x (strtab + refsym->st_name, l, &defsym,
-					scoperec->scope, version,
+					l->l_scope, version,
 					ELF_RTYPE_CLASS_PLT,
 					DL_LOOKUP_ADD_DEPENDENCY, NULL);
 =

-	  if (l->l_type =3D=3D lt_loaded
-	      && catomic_decrement_val (&scoperec->nusers) =3D=3D 0
-	      && __builtin_expect (scoperec->remove_after_use, 0))
-	    {
-	      if (scoperec->notify)
-		__rtld_notify (scoperec->nusers);
-	      else
-		free (scoperec);
-	    }
+	  if (l->l_type =3D=3D lt_loaded && !RTLD_SINGLE_THREAD_P)
+	    __rtld_mrlock_unlock (l->l_scope_lock);
 =

 	  /* Currently result contains the base load address (or link map)
 	     of the object that defines sym.  Now add in the symbol

Modified: trunk/libc/elf/dl-support.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-support.c (original)
+++ trunk/libc/elf/dl-support.c Tue Nov  7 14:59:31 2006
@@ -1,5 +1,5 @@
 /* Support for dynamic linking code in static libc.
-   Copyright (C) 1996-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1996-2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 =

    The GNU C Library is free software; you can redistribute it and/or
@@ -97,9 +97,7 @@
 hp_timing_t _dl_cpuclock_offset;
 #endif
 =

-#ifdef USE_TLS
 void (*_dl_init_static_tls) (struct link_map *) =3D &_dl_nothread_init_sta=
tic_tls;
-#endif
 =

 size_t _dl_pagesize;
 =


Modified: trunk/libc/elf/dl-sym.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-sym.c (original)
+++ trunk/libc/elf/dl-sym.c Tue Nov  7 14:59:31 2006
@@ -25,12 +25,11 @@
 #include <dlfcn.h>
 #include <ldsodefs.h>
 #include <dl-hash.h>
-#ifdef USE_TLS
-# include <dl-tls.h>
-#endif
-
-
-#if defined USE_TLS && defined SHARED
+#include <sysdep-cancel.h>
+#include <dl-tls.h>
+
+
+#ifdef SHARED
 /* Systems which do not have tls_index also probably have to define
    DONT_USE_TLS_INDEX.  */
 =

@@ -64,7 +63,6 @@
   /* Arguments to do_dlsym.  */
   struct link_map *map;
   const char *name;
-  struct r_scope_elem **scope;
   struct r_found_version *vers;
   int flags;
 =

@@ -78,7 +76,7 @@
 {
   struct call_dl_lookup_args *args =3D (struct call_dl_lookup_args *) ptr;
   args->map =3D GLRO(dl_lookup_symbol_x) (args->name, args->map, args->ref=
p,
-					args->scope, args->vers, 0,
+					args->map->l_scope, args->vers, 0,
 					args->flags, NULL);
 }
 =

@@ -115,22 +113,18 @@
 	 the initial binary.  And then the more complex part
 	 where the object is dynamically loaded and the scope
 	 array can change.  */
-      if (match->l_type !=3D lt_loaded)
+      if (match->l_type !=3D lt_loaded || RTLD_SINGLE_THREAD_P)
 	result =3D GLRO(dl_lookup_symbol_x) (name, match, &ref,
-					   match->l_scoperec->scope, vers, 0,
+					   match->l_scope, vers, 0,
 					   flags | DL_LOOKUP_ADD_DEPENDENCY,
 					   NULL);
       else
 	{
-	  __rtld_mrlock_lock (match->l_scoperec_lock);
-	  struct r_scoperec *scoperec =3D match->l_scoperec;
-	  catomic_increment (&scoperec->nusers);
-	  __rtld_mrlock_unlock (match->l_scoperec_lock);
+	  __rtld_mrlock_lock (match->l_scope_lock);
 =

 	  struct call_dl_lookup_args args;
 	  args.name =3D name;
 	  args.map =3D match;
-	  args.scope =3D scoperec->scope;
 	  args.vers =3D vers;
 	  args.flags =3D flags | DL_LOOKUP_ADD_DEPENDENCY;
 	  args.refp =3D &ref;
@@ -141,14 +135,7 @@
 	  int err =3D GLRO(dl_catch_error) (&objname, &errstring, &malloced,
 					  call_dl_lookup, &args);
 =

-	  if (catomic_decrement_val (&scoperec->nusers) =3D=3D 0
-	      && __builtin_expect (scoperec->remove_after_use, 0))
-	    {
-	      if (scoperec->notify)
-		__rtld_notify (scoperec->nusers);
-	      else
-		free (scoperec);
-	    }
+	  __rtld_mrlock_unlock (match->l_scope_lock);
 =

 	  if (__builtin_expect (errstring !=3D NULL, 0))
 	    {
@@ -195,7 +182,7 @@
     {
       void *value;
 =

-#if defined USE_TLS && defined SHARED
+#ifdef SHARED
       if (ELFW(ST_TYPE) (ref->st_info) =3D=3D STT_TLS)
 	/* The found symbol is a thread-local storage variable.
 	   Return the address for to the current thread.  */

Modified: trunk/libc/elf/dl-sysdep.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-sysdep.c (original)
+++ trunk/libc/elf/dl-sysdep.c Tue Nov  7 14:59:31 2006
@@ -1,5 +1,5 @@
 /* Operating system support for run-time dynamic linker.  Generic Unix ver=
sion.
-   Copyright (C) 1995-1998, 2000-2003, 2004, 2005 Free Software Foundation=
, Inc.
+   Copyright (C) 1995-1998, 2000-2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 =

    The GNU C Library is free software; you can redistribute it and/or
@@ -405,25 +405,8 @@
     }
 #endif
 =

-#ifdef USE_TLS
   /* For TLS enabled builds always add 'tls'.  */
   ++cnt;
-#else
-  if (cnt =3D=3D 0)
-    {
-      /* If we no have platform name and no important capability we only
-	 have the base directory to search.  */
-      result =3D (struct r_strlenpair *) malloc (sizeof (*result));
-      if (result =3D=3D NULL)
-	goto no_memory;
-
-      result[0].str =3D (char *) result;	/* Does not really matter.  */
-      result[0].len =3D 0;
-
-      *sz =3D 1;
-      return result;
-    }
-#endif
 =

   /* Create temporary data structure to generate result table.  */
   temp =3D (struct r_strlenpair *) alloca (cnt * sizeof (*temp));
@@ -465,11 +448,11 @@
       temp[m].len =3D platform_len;
       ++m;
     }
-#ifdef USE_TLS
+
   temp[m].str =3D "tls";
   temp[m].len =3D 3;
   ++m;
-#endif
+
   assert (m =3D=3D cnt);
 =

   /* Determine the total size of all strings together.  */
@@ -487,13 +470,8 @@
   *sz =3D 1 << cnt;
   result =3D (struct r_strlenpair *) malloc (*sz * sizeof (*result) + tota=
l);
   if (result =3D=3D NULL)
-    {
-#ifndef USE_TLS
-    no_memory:
-#endif
-      _dl_signal_error (ENOMEM, NULL, NULL,
-			N_("cannot create capability list"));
-    }
+    _dl_signal_error (ENOMEM, NULL, NULL,
+		      N_("cannot create capability list"));
 =

   if (cnt =3D=3D 1)
     {

Modified: trunk/libc/elf/dl-tls.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/dl-tls.c (original)
+++ trunk/libc/elf/dl-tls.c Tue Nov  7 14:59:31 2006
@@ -26,30 +26,26 @@
 #include <sys/param.h>
 =

 #include <tls.h>
-
-/* We don't need any of this if TLS is not supported.  */
-#ifdef USE_TLS
-
-# include <dl-tls.h>
-# include <ldsodefs.h>
+#include <dl-tls.h>
+#include <ldsodefs.h>
 =

 /* Amount of excess space to allocate in the static TLS area
    to allow dynamic loading of modules defining IE-model TLS data.  */
-# define TLS_STATIC_SURPLUS	64 + DL_NNS * 100
+#define TLS_STATIC_SURPLUS	64 + DL_NNS * 100
 =

 /* Value used for dtv entries for which the allocation is delayed.  */
-# define TLS_DTV_UNALLOCATED	((void *) -1l)
+#define TLS_DTV_UNALLOCATED	((void *) -1l)
 =

 =

 /* Out-of-memory handler.  */
-# ifdef SHARED
+#ifdef SHARED
 static void
 __attribute__ ((__noreturn__))
 oom (void)
 {
   _dl_fatal_printf ("cannot allocate memory for thread-local data: ABORT\n=
");
 }
-# endif
+#endif
 =

 =

 size_t
@@ -113,7 +109,7 @@
 }
 =

 =

-# ifdef SHARED
+#ifdef SHARED
 void
 internal_function
 _dl_determine_tlsoffset (void)
@@ -158,7 +154,7 @@
      memory requirement for the next TLS block is smaller than the
      gap.  */
 =

-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
   /* We simply start with zero.  */
   size_t offset =3D 0;
 =

@@ -205,7 +201,7 @@
   GL(dl_tls_static_used) =3D offset;
   GL(dl_tls_static_size) =3D (roundup (offset + TLS_STATIC_SURPLUS, max_al=
ign)
 			    + TLS_TCB_SIZE);
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   /* The TLS blocks start right after the TCB.  */
   size_t offset =3D TLS_TCB_SIZE;
 =

@@ -249,9 +245,9 @@
   GL(dl_tls_static_used) =3D offset;
   GL(dl_tls_static_size) =3D roundup (offset + TLS_STATIC_SURPLUS,
 				    TLS_TCB_ALIGN);
-# else
-#  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
-# endif
+#else
+# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
+#endif
 =

   /* The alignment requirement for the static TLS block.  */
   GL(dl_tls_static_align) =3D max_align;
@@ -288,7 +284,7 @@
   return 0;
 }
 rtld_hidden_def (_dl_tls_setup)
-# endif
+#endif
 =

 static void *
 internal_function
@@ -337,13 +333,13 @@
   void *result;
   size_t size =3D GL(dl_tls_static_size);
 =

-# if TLS_DTV_AT_TP
+#if TLS_DTV_AT_TP
   /* Memory layout is:
      [ TLS_PRE_TCB_SIZE ] [ TLS_TCB_SIZE ] [ TLS blocks ]
 			  ^ This should be returned.  */
   size +=3D (TLS_PRE_TCB_SIZE + GL(dl_tls_static_align) - 1)
 	  & ~(GL(dl_tls_static_align) - 1);
-# endif
+#endif
 =

   /* Allocate a correctly aligned chunk of memory.  */
   result =3D __libc_memalign (GL(dl_tls_static_align), size);
@@ -352,14 +348,14 @@
       /* Allocate the DTV.  */
       void *allocated =3D result;
 =

-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
       /* The TCB follows the TLS blocks.  */
       result =3D (char *) result + size - TLS_TCB_SIZE;
 =

       /* Clear the TCB data structure.  We can't ask the caller (i.e.
 	 libpthread) to do it, because we will initialize the DTV et al.  */
       memset (result, '\0', TLS_TCB_SIZE);
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
       result =3D (char *) result + size - GL(dl_tls_static_size);
 =

       /* Clear the TCB data structure and TLS_PRE_TCB_SIZE bytes before it.
@@ -367,7 +363,7 @@
 	 initialize the DTV et al.  */
       memset ((char *) result - TLS_PRE_TCB_SIZE, '\0',
 	      TLS_PRE_TCB_SIZE + TLS_TCB_SIZE);
-# endif
+#endif
 =

       result =3D allocate_dtv (result);
       if (result =3D=3D NULL)
@@ -428,14 +424,14 @@
 =

 	  assert (map->l_tls_modid =3D=3D cnt);
 	  assert (map->l_tls_blocksize >=3D map->l_tls_initimage_size);
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
 	  assert ((size_t) map->l_tls_offset >=3D map->l_tls_blocksize);
 	  dest =3D (char *) result - map->l_tls_offset;
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
 	  dest =3D (char *) result + map->l_tls_offset;
-# else
-#  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
-# endif
+#else
+# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
+#endif
 =

 	  /* Copy the initialization image and clear the BSS part.  */
 	  dtv[map->l_tls_modid].pointer.val =3D dest;
@@ -491,21 +487,21 @@
 =

   if (dealloc_tcb)
     {
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
       /* The TCB follows the TLS blocks.  Back up to free the whole block.=
  */
       tcb -=3D GL(dl_tls_static_size) - TLS_TCB_SIZE;
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
       /* Back up the TLS_PRE_TCB_SIZE bytes.  */
       tcb -=3D (TLS_PRE_TCB_SIZE + GL(dl_tls_static_align) - 1)
 	     & ~(GL(dl_tls_static_align) - 1);
-# endif
+#endif
       free (tcb);
     }
 }
 rtld_hidden_def (_dl_deallocate_tls)
 =

 =

-# ifdef SHARED
+#ifdef SHARED
 /* The __tls_get_addr function has two basic forms which differ in the
    arguments.  The IA-64 form takes two parameters, the module ID and
    offset.  The form used, among others, on IA-32 takes a reference to
@@ -513,15 +509,15 @@
    form seems to be more often used (in the moment) so we default to
    it.  Users of the IA-64 form have to provide adequate definitions
    of the following macros.  */
-#  ifndef GET_ADDR_ARGS
-#   define GET_ADDR_ARGS tls_index *ti
-#  endif
-#  ifndef GET_ADDR_MODULE
-#   define GET_ADDR_MODULE ti->ti_module
-#  endif
-#  ifndef GET_ADDR_OFFSET
-#   define GET_ADDR_OFFSET ti->ti_offset
-#  endif
+# ifndef GET_ADDR_ARGS
+#  define GET_ADDR_ARGS tls_index *ti
+# endif
+# ifndef GET_ADDR_MODULE
+#  define GET_ADDR_MODULE ti->ti_module
+# endif
+# ifndef GET_ADDR_OFFSET
+#  define GET_ADDR_OFFSET ti->ti_offset
+# endif
 =

 =

 static void *
@@ -732,7 +728,7 @@
 =

   return (char *) p + GET_ADDR_OFFSET;
 }
-# endif
+#endif
 =

 =

 /* Look up the module's TLS block as for __tls_get_addr,
@@ -840,4 +836,3 @@
   listp->slotinfo[idx].map =3D l;
   listp->slotinfo[idx].gen =3D GL(dl_tls_generation) + 1;
 }
-#endif	/* use TLS */

Modified: trunk/libc/elf/ldconfig.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/ldconfig.c (original)
+++ trunk/libc/elf/ldconfig.c Tue Nov  7 14:59:31 2006
@@ -1185,9 +1185,7 @@
 	  add_dir (argv[i]);
     }
 =

-#ifdef USE_TLS
   hwcap_extra[63 - _DL_FIRST_EXTRA] =3D "tls";
-#endif
 =

   set_hwcap ();
 =


Modified: trunk/libc/elf/rtld.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/libc/elf/rtld.c (original)
+++ trunk/libc/elf/rtld.c Tue Nov  7 14:59:31 2006
@@ -1,5 +1,5 @@
 /* Run time dynamic linker.
-   Copyright (C) 1995-2002, 2003, 2004, 2005, 2006 Free Software Foundatio=
n, Inc.
+   Copyright (C) 1995-2002,2003,2004,2005,2006 Free Software Foundation, I=
nc.
    This file is part of the GNU C Library.
 =

    The GNU C Library is free software; you can redistribute it and/or
@@ -207,8 +207,7 @@
    is fine, too.  The latter is important here.  We can avoid setting
    up a temporary link map for ld.so if we can mark _rtld_global as
    hidden.  */
-#if defined PI_STATIC_AND_HIDDEN && defined HAVE_HIDDEN \
-    && defined HAVE_VISIBILITY_ATTRIBUTE
+#ifdef PI_STATIC_AND_HIDDEN
 # define DONT_USE_BOOTSTRAP_MAP	1
 #endif
 =

@@ -292,7 +291,7 @@
   GL(dl_rtld_map).l_map_end =3D (ElfW(Addr)) _end;
   GL(dl_rtld_map).l_text_end =3D (ElfW(Addr)) _etext;
   /* Copy the TLS related data if necessary.  */
-#if USE_TLS && !defined DONT_USE_BOOTSTRAP_MAP
+#ifndef DONT_USE_BOOTSTRAP_MAP
 # if USE___THREAD
   assert (info->l.l_tls_modid !=3D 0);
   GL(dl_rtld_map).l_tls_blocksize =3D info->l.l_tls_blocksize;
@@ -400,7 +399,7 @@
   bootstrap_map.l_ld =3D (void *) bootstrap_map.l_addr + elf_machine_dynam=
ic ();
   elf_get_dynamic_info (&bootstrap_map, NULL);
 =

-#if defined USE_TLS && NO_TLS_OFFSET !=3D 0
+#if NO_TLS_OFFSET !=3D 0
   bootstrap_map.l_tls_offset =3D NO_TLS_OFFSET;
 #endif
 =

@@ -609,7 +608,7 @@
 {
   struct relocate_args *args =3D (struct relocate_args *) a;
 =

-  _dl_relocate_object (args->l, args->l->l_scoperec->scope, args->lazy, 0);
+  _dl_relocate_object (args->l, args->l->l_scope, args->lazy, 0);
 }
 =

 static void
@@ -701,7 +700,6 @@
   return 0;
 }
 =

-#ifdef USE_TLS
 static bool tls_init_tp_called;
 =

 static void *
@@ -773,7 +771,6 @@
 =

   return tcbp;
 }
-#endif
 =

 #ifdef _LIBC_REENTRANT
 /* _dl_error_catch_tsd points to this for the single-threaded case.
@@ -861,18 +858,14 @@
   hp_timing_t stop;
   hp_timing_t diff;
 #endif
-#ifdef USE_TLS
   void *tcbp =3D NULL;
-#endif
 =

 #ifdef _LIBC_REENTRANT
   /* Explicit initialization since the reloc would just be more work.  */
   GL(dl_error_catch_tsd) =3D &_dl_initial_error_catch_tsd;
 #endif
 =

-#ifdef USE_TLS
   GL(dl_init_static_tls) =3D &_dl_nothread_init_static_tls;
-#endif
 =

 #if defined SHARED && defined _LIBC_REENTRANT \
     && defined __rtld_lock_default_lock_recursive
@@ -1157,7 +1150,6 @@
 	break;
 =

       case PT_TLS:
-#ifdef USE_TLS
 	if (ph->p_memsz > 0)
 	  {
 	    /* Note that in the case the dynamic linker we duplicate work
@@ -1177,10 +1169,6 @@
 	    /* This image gets the ID one.  */
 	    GL(dl_tls_max_dtv_idx) =3D main_map->l_tls_modid =3D 1;
 	  }
-#else
-	_dl_fatal_printf ("\
-ld.so does not support TLS, but program uses it!\n");
-#endif
 	break;
 =

       case PT_GNU_STACK:
@@ -1192,13 +1180,12 @@
 	main_map->l_relro_size =3D ph->p_memsz;
 	break;
       }
-#ifdef USE_TLS
-    /* Adjust the address of the TLS initialization image in case
-       the executable is actually an ET_DYN object.  */
-    if (main_map->l_tls_initimage !=3D NULL)
-      main_map->l_tls_initimage
-	=3D (char *) main_map->l_tls_initimage + main_map->l_addr;
-#endif
+
+  /* Adjust the address of the TLS initialization image in case
+     the executable is actually an ET_DYN object.  */
+  if (main_map->l_tls_initimage !=3D NULL)
+    main_map->l_tls_initimage
+      =3D (char *) main_map->l_tls_initimage + main_map->l_addr;
   if (! main_map->l_map_end)
     main_map->l_map_end =3D ~0;
   if (! main_map->l_text_end)
@@ -1401,12 +1388,10 @@
 	break;
       }
 =

-#ifdef USE_TLS
   /* Add the dynamic linker to the TLS list if it also uses TLS.  */
   if (GL(dl_rtld_map).l_tls_blocksize !=3D 0)
     /* Assign a module ID.  Do this before loading any audit modules.  */
     GL(dl_rtld_map).l_tls_modid =3D _dl_next_tls_modid ();
-#endif
 =

   /* If we have auditing DSOs to load, do it now.  */
   if (__builtin_expect (audit_list !=3D NULL, 0))
@@ -1416,7 +1401,6 @@
       struct audit_list *al =3D audit_list->next;
       do
 	{
-#ifdef USE_TLS
 	  int tls_idx =3D GL(dl_tls_max_dtv_idx);
 =

 	  /* Now it is time to determine the layout of the static TLS
@@ -1428,7 +1412,7 @@
 	  /* Since we start using the auditing DSOs right away we need to
 	     initialize the data structures now.  */
 	  tcbp =3D init_tls ();
-#endif
+
 	  struct dlmopen_args dlmargs;
 	  dlmargs.fname =3D al->name;
 	  dlmargs.map =3D NULL;
@@ -1543,9 +1527,7 @@
 		  assert (GL(dl_ns)[ns]._ns_loaded =3D=3D NULL);
 		  assert (GL(dl_ns)[ns]._ns_nloaded =3D=3D 0);
 =

-#ifdef USE_TLS
 		  GL(dl_tls_max_dtv_idx) =3D tls_idx;
-#endif
 		  goto not_loaded;
 		}
 	    }
@@ -1821,7 +1803,6 @@
     _dl_receive_error (print_missing_version, version_check_doit, &args);
   }
 =

-#ifdef USE_TLS
   /* We do not initialize any of the TLS functionality unless any of the
      initial modules uses TLS.  This makes dynamic loading of modules with
      TLS impossible, but to support it requires either eagerly doing setup
@@ -1832,7 +1813,6 @@
   bool was_tls_init_tp_called =3D tls_init_tp_called;
   if (tcbp =3D=3D NULL)
     tcbp =3D init_tls ();
-#endif
 =

   /* Set up the stack checker's canary.  */
   uintptr_t stack_chk_guard =3D _dl_setup_stack_chk_guard ();
@@ -1889,13 +1869,12 @@
 			  (size_t) l->l_map_start,
 			  (int) sizeof l->l_addr * 2,
 			  (size_t) l->l_addr);
-#ifdef USE_TLS
+
 	      if (l->l_tls_modid)
 		_dl_printf (" TLS(0x%Zx, 0x%0*Zx)\n", l->l_tls_modid,
 			    (int) sizeof l->l_tls_offset * 2,
 			    (size_t) l->l_tls_offset);
 	      else
-#endif
 		_dl_printf ("\n");
 	    }
 	}
@@ -1963,7 +1942,7 @@
 	    lookup_t result;
 =

 	    result =3D _dl_lookup_symbol_x (INTUSE(_dl_argv)[i], main_map,
-					  &ref, main_map->l_scoperec->scope,
+					  &ref, main_map->l_scope,
 					  NULL, ELF_RTYPE_CLASS_PLT,
 					  DL_LOOKUP_ADD_DEPENDENCY, NULL);
 =

@@ -2007,7 +1986,7 @@
 		  /* Mark the link map as not yet relocated again.  */
 		  GL(dl_rtld_map).l_relocated =3D 0;
 		  _dl_relocate_object (&GL(dl_rtld_map),
-				       main_map->l_scoperec->scope, 0, 0);
+				       main_map->l_scope, 0, 0);
 		}
             }
 #define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED=
))
@@ -2143,7 +2122,6 @@
 =

   /* Now set up the variable which helps the assembler startup code.  */
   GL(dl_ns)[LM_ID_BASE]._ns_main_searchlist =3D &main_map->l_searchlist;
-  GL(dl_ns)[LM_ID_BASE]._ns_global_scope[0] =3D &main_map->l_searchlist;
 =

   /* Save the information about the original global scope list since
      we need it in the memory handling later.  */
@@ -2179,11 +2157,9 @@
 	  if (l->l_relro_size)
 	    _dl_protect_relro (l);
 =

-#ifdef USE_TLS
 	  /* Add object to slot information data if necessasy.  */
 	  if (l->l_tls_blocksize !=3D 0 && tls_init_tp_called)
 	    _dl_add_to_slotinfo (l);
-#endif
 	}
 =

       _dl_sysdep_start_cleanup ();
@@ -2227,14 +2203,12 @@
 	    }
 =

 	  if (l !=3D &GL(dl_rtld_map))
-	    _dl_relocate_object (l, l->l_scoperec->scope, GLRO(dl_lazy),
+	    _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy),
 				 consider_profiling);
 =

-#ifdef USE_TLS
 	  /* Add object to slot information data if necessasy.  */
 	  if (l->l_tls_blocksize !=3D 0 && tls_init_tp_called)
 	    _dl_add_to_slotinfo (l);
-#endif
 =

 	  l =3D l->l_prev;
 	}
@@ -2263,7 +2237,6 @@
 # define NONTLS_INIT_TP do { } while (0)
 #endif
 =

-#ifdef USE_TLS
   if (!was_tls_init_tp_called && GL(dl_tls_max_dtv_idx) > 0)
     ++GL(dl_tls_generation);
 =

@@ -2281,9 +2254,6 @@
 	_dl_fatal_printf ("cannot set up thread-local storage: %s\n",
 			  lossage);
     }
-#else
-  NONTLS_INIT_TP;
-#endif
 =

   if (! prelinked && rtld_multiple_ref)
     {
@@ -2303,8 +2273,7 @@
       HP_TIMING_NOW (start);
       /* Mark the link map as not yet relocated again.  */

[... 3971 lines stripped ...]