]> sourceware.org Git - glibc.git/commitdiff
USE_TLS support is now default.
authorUlrich Drepper <drepper@redhat.com>
Fri, 27 Oct 2006 23:11:47 +0000 (23:11 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 27 Oct 2006 23:11:47 +0000 (23:11 +0000)
* tls.make.c: USE_TLS support is now default.
* 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.

84 files changed:
ChangeLog
csu/Versions
csu/libc-start.c
csu/libc-tls.c
csu/version.c
dlfcn/dlinfo.c
elf/dl-addr.c
elf/dl-cache.c
elf/dl-close.c
elf/dl-iteratephdr.c
elf/dl-load.c
elf/dl-lookup.c
elf/dl-object.c
elf/dl-open.c
elf/dl-reloc.c
elf/dl-support.c
elf/dl-sym.c
elf/dl-sysdep.c
elf/dl-tls.c
elf/ldconfig.c
elf/rtld.c
elf/tst-tls-dlinfo.c
elf/tst-tls1.c
elf/tst-tls10.h
elf/tst-tls14.c
elf/tst-tls2.c
elf/tst-tls3.c
elf/tst-tls4.c
elf/tst-tls5.c
elf/tst-tls6.c
elf/tst-tls7.c
elf/tst-tls8.c
elf/tst-tls9.c
elf/tst-tlsmod1.c
elf/tst-tlsmod13.c
elf/tst-tlsmod13a.c
elf/tst-tlsmod14a.c
elf/tst-tlsmod2.c
elf/tst-tlsmod3.c
elf/tst-tlsmod4.c
elf/tst-tlsmod5.c
elf/tst-tlsmod6.c
include/errno.h
include/link.h
include/tls.h
locale/global-locale.c
locale/localeinfo.h
malloc/arena.c
malloc/hooks.c
malloc/malloc.c
nptl/ChangeLog
nptl/init.c
nptl/sysdeps/alpha/tls.h
nptl/sysdeps/i386/tls.h
nptl/sysdeps/ia64/tls.h
nptl/sysdeps/powerpc/tls.h
nptl/sysdeps/s390/tls.h
nptl/sysdeps/sh/tls.h
nptl/sysdeps/sparc/tls.h
nptl/sysdeps/x86_64/tls.h
nptl/tst-tls5.h
nptl_db/ChangeLog
nptl_db/structs.def
resolv/Versions
sysdeps/alpha/dl-machine.h
sysdeps/alpha/libc-tls.c
sysdeps/generic/ldsodefs.h
sysdeps/generic/tls.h
sysdeps/i386/dl-machine.h
sysdeps/ia64/dl-machine.h
sysdeps/ia64/libc-tls.c
sysdeps/mach/hurd/fork.c
sysdeps/mach/hurd/i386/tls.h
sysdeps/powerpc/powerpc32/dl-machine.c
sysdeps/powerpc/powerpc32/dl-machine.h
sysdeps/powerpc/powerpc64/dl-machine.h
sysdeps/s390/libc-tls.c
sysdeps/s390/s390-32/dl-machine.h
sysdeps/s390/s390-64/dl-machine.h
sysdeps/sh/dl-machine.h
sysdeps/sparc/sparc32/dl-machine.h
sysdeps/sparc/sparc64/dl-machine.h
sysdeps/x86_64/dl-machine.h
tls.make.c

index 0b264ce8cc305e62ce21cfb9019613ac7a84aa61..2f32dfdee5352c7fdb9b65a71fdc922e263c1ab6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,76 @@
 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
 
+       * tls.make.c: USE_TLS support is now default.
+       * 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.
index a1321a9df8e849613477f1ae2e5222569bd1a7c2..f0b4f00549ac999fe1ee9609c5ceac96f14221f2 100644 (file)
@@ -5,7 +5,7 @@ libc {
     # helper functions
     __libc_init_first; __libc_start_main;
 
-%if !(USE_TLS && HAVE___THREAD)
+%if !HAVE___THREAD
     # global variables
     _errno;
 
@@ -18,7 +18,7 @@ libc {
     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 symbol.
     errno;
 %endif
index 194db6b1ec5239430185a013e1bcf492763783a2..634844759da33c859bb2119daad8165a6e99e7b7 100644 (file)
@@ -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 @@ extern int __libc_multiple_libcs;
 #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 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
 
   /* 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
index 3544e396dae381669b1c3667ab74024c6a7f7c4d..0d240ccef9970819bde531fb406365fb0c57d9f5 100644 (file)
@@ -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, Inc.
    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 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
      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 = roundup (memsz + GL(dl_tls_static_size), tcbalign);
   tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   tcb_offset = roundup (tcbsize, align ?: 1);
   tlsblock = __sbrk (tcb_offset + memsz + max_align
                     + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
   tlsblock += 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 = (void *) (((uintptr_t) tlsblock + max_align - 1)
@@ -166,16 +165,16 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
   // static_dtv[1].counter = 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 = ((char *) tlsblock + tcb_offset
                               - roundup (memsz, align ?: 1));
   static_map.l_tls_offset = roundup (memsz, align ?: 1);
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   static_dtv[2].pointer.val = (char *) tlsblock + tcb_offset;
   static_map.l_tls_offset = 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 = 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 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
   /* 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 = 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 = 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 != NULL, 0))
     __libc_fatal (lossage);
 
@@ -212,11 +211,11 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
 
   memsz = roundup (memsz, align ?: 1);
 
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
   memsz += tcbsize;
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   memsz += tcb_offset;
-# endif
+#endif
 
   init_static_tls (memsz, MAX (TLS_TCB_ALIGN, max_align));
 }
@@ -230,11 +229,11 @@ _dl_tls_setup (void)
 {
   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 @@ __pthread_initialize_minimal (void)
 {
   __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
index 2196d204325050a0ee6cd690498d82af0418f328..1b98c4a7e9aba0812c05e0d809e6cd9caf9d1c98 100644 (file)
@@ -34,9 +34,6 @@ Compiled by GNU CC version "__VERSION__".\n"
 #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";
 
index b1e2b009a5e29d2d6a06eafe883ca3f7a2b86bc1..923127cbf3d2c91827bc75b14ec817bab3dac563 100644 (file)
@@ -32,9 +32,7 @@ dlinfo (void *handle, int request, void *arg)
 
 #else
 
-# ifdef USE_TLS
-#  include <dl-tls.h>
-# endif
+# include <dl-tls.h>
 
 struct dlinfo_args
 {
@@ -97,18 +95,14 @@ RTLD_SELF used in code not dynamically loaded"));
 
     case RTLD_DI_TLS_MODID:
       *(size_t *) args->arg = 0;
-#ifdef USE_TLS
       *(size_t *) args->arg = l->l_tls_modid;
-#endif
       break;
 
     case RTLD_DI_TLS_DATA:
       {
        void *data = NULL;
-#ifdef USE_TLS
        if (l->l_tls_modid != 0)
          data = _dl_tls_get_addr_soft (l);
-#endif
        *(void **) args->arg = data;
        break;
       }
index 720b24d04b962fc5fb296fcfc30afc2cdaf1d3a9..e55dc4b46f07d083b655b071325803e47b634061 100644 (file)
@@ -93,9 +93,7 @@ _dl_addr (const void *address, Dl_info *info,
                         so we can omit that test here.  */
                      if ((symtab[symndx].st_shndx != SHN_UNDEF
                           || symtab[symndx].st_value != 0)
-#ifdef USE_TLS
                          && ELFW(ST_TYPE) (symtab[symndx].st_info) != STT_TLS
-#endif
                          && DL_ADDR_SYM_MATCH (match, &symtab[symndx],
                                                matchsym, addr)
                          && symtab[symndx].st_name < strtabsize)
@@ -123,9 +121,7 @@ _dl_addr (const void *address, Dl_info *info,
          for (; (void *) symtab < (void *) symtabend; ++symtab)
            if ((ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
                 || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)
-#ifdef USE_TLS
                && ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
-#endif
                && (symtab->st_shndx != SHN_UNDEF
                    || symtab->st_value != 0)
                && DL_ADDR_SYM_MATCH (match, symtab, matchsym, addr)
index fc7d9916c6fe52d0cc3959e4bdc4a3168f558c1d..bbeba77e4a1cac772c6fa674f1c0842f8531fbd1 100644 (file)
@@ -256,11 +256,7 @@ _dl_load_cache_lookup (const char *name)
        platform = 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;                                                             \
index fdd9fe6719346b0e037e8c136eb471ce95e8143a..47316ec7f7b7d02c9d2621fbd81ec2adfd766a5f 100644 (file)
@@ -41,7 +41,6 @@ typedef void (*fini_t) (void);
 #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,
@@ -103,7 +102,6 @@ remove_slotinfo (size_t idx, struct dtv_slotinfo_list *listp, size_t disp,
   /* No non-entry in this list element.  */
   return false;
 }
-#endif
 
 
 void
@@ -136,9 +134,7 @@ _dl_close_worker (struct link_map *map)
  retry:
   dl_close_state = pending;
 
-#ifdef USE_TLS
   bool any_tls = false;
-#endif
   const unsigned int nloaded = GL(dl_ns)[ns]._ns_nloaded;
   char used[nloaded];
   char done[nloaded];
@@ -460,11 +456,9 @@ _dl_close_worker (struct link_map *map)
   r->r_state = RT_DELETE;
   _dl_debug_state ();
 
-#ifdef USE_TLS
   size_t tls_free_start;
   size_t tls_free_end;
   tls_free_start = tls_free_end = NO_TLS_OFFSET;
-#endif
 
   /* Check each element of the search list to see if all references to
      it are gone.  */
@@ -495,7 +489,6 @@ _dl_close_worker (struct link_map *map)
              --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))
            {
@@ -514,7 +507,7 @@ _dl_close_worker (struct link_map *map)
                     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 == NO_TLS_OFFSET
                      || (size_t) imap->l_tls_offset == tls_free_start)
                    {
@@ -554,7 +547,7 @@ _dl_close_worker (struct link_map *map)
                            = tls_free_end - imap->l_tls_blocksize;
                        }
                    }
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
                  if ((size_t) imap->l_tls_offset == tls_free_end)
                    /* Extend the contiguous chunk being reclaimed.  */
                    tls_free_end -= imap->l_tls_blocksize;
@@ -571,12 +564,11 @@ _dl_close_worker (struct link_map *map)
                      tls_free_start = imap->l_tls_offset;
                      tls_free_end = 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
@@ -642,7 +634,6 @@ _dl_close_worker (struct link_map *map)
        }
     }
 
-#ifdef USE_TLS
   /* If we removed any object which uses TLS bump the generation counter.  */
   if (any_tls)
     {
@@ -652,7 +643,6 @@ _dl_close_worker (struct link_map *map)
       if (tls_free_end == GL(dl_tls_static_used))
        GL(dl_tls_static_used) = tls_free_start;
     }
-#endif
 
 #ifdef SHARED
   /* Auditing checkpoint: we have deleted all objects.  */
@@ -712,7 +702,6 @@ _dl_close (void *_map)
 }
 
 
-#ifdef USE_TLS
 static bool __libc_freeres_fn_section
 free_slotinfo (struct dtv_slotinfo_list **elemp)
 {
@@ -739,7 +728,6 @@ free_slotinfo (struct dtv_slotinfo_list **elemp)
 
   return true;
 }
-#endif
 
 
 libc_freeres_fn (free_mem)
@@ -765,22 +753,20 @@ libc_freeres_fn (free_mem)
        free (old);
       }
 
-#ifdef USE_TLS
   if (USE___THREAD || GL(dl_tls_dtv_slotinfo_list) != 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) == 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
 }
index 52a114421d20df074d64186f8a075acfa2b1902d..d03d8b6daf1d128549aea5e6727db6f9c9ec88bb 100644 (file)
@@ -70,11 +70,9 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
       info.dlpi_subs = GL(dl_load_adds) - nloaded;
       info.dlpi_tls_modid = 0;
       info.dlpi_tls_data = NULL;
-#ifdef USE_TLS
       info.dlpi_tls_modid = l->l_tls_modid;
       if (info.dlpi_tls_modid != 0)
        info.dlpi_tls_data = _dl_tls_get_addr_soft (l);
-#endif
       ret = callback (&info, sizeof (struct dl_phdr_info), data);
       if (ret)
        break;
index 36dc123c0131d2964129624a4ddb59e81c48b5e8..2adeb60fcd90157b291d6a895bc4b997aa5ae31b 100644 (file)
@@ -1085,7 +1085,6 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
          break;
 
        case PT_TLS:
-#ifdef USE_TLS
          if (ph->p_memsz == 0)
            /* Nothing to do for an empty segment.  */
            break;
@@ -1113,7 +1112,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
              break;
            }
 
-# ifdef SHARED
+#ifdef SHARED
          if (l->l_prev == NULL || (mode & __RTLD_AUDIT) != 0)
            /* We are loading the executable itself when the dynamic linker
               was executed directly.  The setup will happen later.  */
@@ -1122,7 +1121,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
          /* In a static binary there is no way to tell if we dynamically
             loaded libpthread.  */
          if (GL(dl_error_catch_tsd) == &_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 @@ cannot allocate TLS data structures for initial thread");
              _dl_deallocate_tls (tcb, 1);
              goto call_lose;
            }
-#endif
 
          /* Uh-oh, the binary expects TLS support but we cannot
             provide it.  */
@@ -1431,11 +1429,9 @@ cannot enable executable stack as shared object requires");
        }
     }
 
-#ifdef USE_TLS
   /* Adjust the address of the TLS initialization image.  */
   if (l->l_tls_initimage != NULL)
     l->l_tls_initimage = (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) != 0, 0))
index 29a52165ce28f39f650382b4e98f0799cb0e132f..019278c9b0b5d7694911488810043fd4c2425bdd 100644 (file)
@@ -449,12 +449,10 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
            conflict = 1;
        }
 
-# ifdef USE_TLS
       if (value->s
          && (__builtin_expect (ELFW(ST_TYPE) (value->s->st_info)
                                == STT_TLS, 0)))
        type_class = 4;
-# endif
 
       if (conflict
          || GLRO(dl_trace_prelink_map) == undef_map
index 29f44bfd5521eda107c3a66147cf1197176581c1..33ee860e59c4daea82a65b199ecb7451d5efd709 100644 (file)
@@ -64,7 +64,7 @@ _dl_new_object (char *realname, const char *libname, int type,
   new->l_name = realname;
   new->l_type = type;
   new->l_loader = loader;
-#if defined USE_TLS && NO_TLS_OFFSET != 0
+#if NO_TLS_OFFSET != 0
   new->l_tls_offset = NO_TLS_OFFSET;
 #endif
   new->l_ns = nsid;
index c28b6b1e777c5703727f3467dcb3ddd00faa0d14..f2f4ae23836204b1dfb11e20cb988e68311feb5b 100644 (file)
@@ -164,9 +164,7 @@ dl_open_worker (void *a)
   struct link_map *new, *l;
   int lazy;
   unsigned int i;
-#ifdef USE_TLS
   bool any_tls = false;
-#endif
   struct link_map *call_map = NULL;
 
   /* Check whether _dl_open() has been called from a valid DSO.  */
@@ -441,7 +439,6 @@ dl_open_worker (void *a)
          atomic_write_barrier ();
          imap->l_scope[cnt] = &new->l_searchlist;
        }
-#if USE_TLS
       /* Only add TLS memory if this object is loaded now and
         therefore is not yet initialized.  */
       else if (! imap->l_init_called
@@ -456,11 +453,11 @@ dl_open_worker (void *a)
          if (imap->l_need_tls_init)
            {
              imap->l_need_tls_init = 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 == 0);
@@ -469,15 +466,12 @@ dl_open_worker (void *a)
          /* We have to bump the generation counter.  */
          any_tls = true;
        }
-#endif
     }
 
-#if USE_TLS
   /* Bump the generation number if necessary.  */
   if (any_tls && __builtin_expect (++GL(dl_tls_generation) == 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);
@@ -574,7 +568,6 @@ no more namespaces available for dlmopen()"));
         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
@@ -584,7 +577,6 @@ no more namespaces available for dlmopen()"));
             up.  */
          if ((mode & __RTLD_AUDIT) == 0)
            GL(dl_tls_dtv_gaps) = true;
-#endif
 
          _dl_close_worker (args.map);
        }
index 117410e92416fcf6226096b18b930e7d438a9cca..c315b5d972ff0b7f6ff613af5a5619687a4a57a7 100644 (file)
@@ -1,5 +1,5 @@
 /* Relocate a shared object and resolve its references to other loaded objects.
-   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 @@ _dl_allocate_static_tls (struct link_map *map)
 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 @@ cannot allocate memory in static TLS block"));
                                            - map->l_tls_firstbyte_offset);
 
   map->l_tls_offset = GL(dl_tls_static_used) = offset;
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   size_t used;
   size_t check;
 
@@ -87,9 +86,9 @@ cannot allocate memory in static TLS block"));
 
   map->l_tls_offset = offset;
   GL(dl_tls_static_used) = 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 @@ cannot allocate memory in static TLS block"));
 void
 _dl_nothread_init_static_tls (struct link_map *map)
 {
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
   void *dest = (char *) THREAD_SELF - map->l_tls_offset;
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   void *dest = (char *) THREAD_SELF + map->l_tls_offset + TLS_PRE_TCB_SIZE;
-# 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 = THREAD_DTV ();
@@ -133,7 +132,6 @@ _dl_nothread_init_static_tls (struct link_map *map)
   memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),
          '\0', map->l_tls_blocksize - map->l_tls_initimage_size);
 }
-#endif
 
 
 void
index c3b6350ed3260d290cfc7c523efb8f31c3e281f1..fe8c68c9e402c213af3cbca2cf88dd4c345b4f15 100644 (file)
@@ -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 @@ int _dl_starting_up = 1;
 hp_timing_t _dl_cpuclock_offset;
 #endif
 
-#ifdef USE_TLS
 void (*_dl_init_static_tls) (struct link_map *) = &_dl_nothread_init_static_tls;
-#endif
 
 size_t _dl_pagesize;
 
index 8bb564c2fe385b26b62812bdd25291151a3e4b76..2081fd53f1a90fdc8897efd2245b70b222ab4e3f 100644 (file)
 #include <ldsodefs.h>
 #include <dl-hash.h>
 #include <sysdep-cancel.h>
-#ifdef USE_TLS
-# include <dl-tls.h>
-#endif
+#include <dl-tls.h>
 
 
-#if defined USE_TLS && defined SHARED
+#ifdef SHARED
 /* Systems which do not have tls_index also probably have to define
    DONT_USE_TLS_INDEX.  */
 
@@ -184,7 +182,7 @@ RTLD_NEXT used in code not dynamically loaded"));
     {
       void *value;
 
-#if defined USE_TLS && defined SHARED
+#ifdef SHARED
       if (ELFW(ST_TYPE) (ref->st_info) == STT_TLS)
        /* The found symbol is a thread-local storage variable.
           Return the address for to the current thread.  */
index 985e2b8f778f989ccf574869422d601a6cec5393..d06ce1754e1085962f16a860132e78b44d9c15f3 100644 (file)
@@ -1,5 +1,5 @@
 /* Operating system support for run-time dynamic linker.  Generic Unix version.
-   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 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
     }
 #endif
 
-#ifdef USE_TLS
   /* For TLS enabled builds always add 'tls'.  */
   ++cnt;
-#else
-  if (cnt == 0)
-    {
-      /* If we no have platform name and no important capability we only
-        have the base directory to search.  */
-      result = (struct r_strlenpair *) malloc (sizeof (*result));
-      if (result == NULL)
-       goto no_memory;
-
-      result[0].str = (char *) result; /* Does not really matter.  */
-      result[0].len = 0;
-
-      *sz = 1;
-      return result;
-    }
-#endif
 
   /* Create temporary data structure to generate result table.  */
   temp = (struct r_strlenpair *) alloca (cnt * sizeof (*temp));
@@ -465,11 +448,11 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
       temp[m].len = platform_len;
       ++m;
     }
-#ifdef USE_TLS
+
   temp[m].str = "tls";
   temp[m].len = 3;
   ++m;
-#endif
+
   assert (m == cnt);
 
   /* Determine the total size of all strings together.  */
@@ -487,13 +470,8 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
   *sz = 1 << cnt;
   result = (struct r_strlenpair *) malloc (*sz * sizeof (*result) + total);
   if (result == 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 == 1)
     {
index a0f4f77ffa58d333acedc1c97f3a52340d489113..d5865ab40925d2608213cc51302b364bfb8d2d5c 100644 (file)
 #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 @@ _dl_next_tls_modid (void)
 }
 
 
-# ifdef SHARED
+#ifdef SHARED
 void
 internal_function
 _dl_determine_tlsoffset (void)
@@ -158,7 +154,7 @@ _dl_determine_tlsoffset (void)
      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 = 0;
 
@@ -205,7 +201,7 @@ _dl_determine_tlsoffset (void)
   GL(dl_tls_static_used) = offset;
   GL(dl_tls_static_size) = (roundup (offset + TLS_STATIC_SURPLUS, max_align)
                            + TLS_TCB_SIZE);
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
   /* The TLS blocks start right after the TCB.  */
   size_t offset = TLS_TCB_SIZE;
 
@@ -249,9 +245,9 @@ _dl_determine_tlsoffset (void)
   GL(dl_tls_static_used) = offset;
   GL(dl_tls_static_size) = 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) = max_align;
@@ -288,7 +284,7 @@ _dl_tls_setup (void)
   return 0;
 }
 rtld_hidden_def (_dl_tls_setup)
-# endif
+#endif
 
 static void *
 internal_function
@@ -337,13 +333,13 @@ _dl_allocate_tls_storage (void)
   void *result;
   size_t size = 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 += (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 = __libc_memalign (GL(dl_tls_static_align), size);
@@ -352,14 +348,14 @@ _dl_allocate_tls_storage (void)
       /* Allocate the DTV.  */
       void *allocated = result;
 
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
       /* The TCB follows the TLS blocks.  */
       result = (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 = (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 @@ _dl_allocate_tls_storage (void)
         initialize the DTV et al.  */
       memset ((char *) result - TLS_PRE_TCB_SIZE, '\0',
              TLS_PRE_TCB_SIZE + TLS_TCB_SIZE);
-# endif
+#endif
 
       result = allocate_dtv (result);
       if (result == NULL)
@@ -428,14 +424,14 @@ _dl_allocate_tls_init (void *result)
 
          assert (map->l_tls_modid == cnt);
          assert (map->l_tls_blocksize >= map->l_tls_initimage_size);
-# if TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
          assert ((size_t) map->l_tls_offset >= map->l_tls_blocksize);
          dest = (char *) result - map->l_tls_offset;
-# elif TLS_DTV_AT_TP
+#elif TLS_DTV_AT_TP
          dest = (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 = dest;
@@ -491,21 +487,21 @@ _dl_deallocate_tls (void *tcb, bool dealloc_tcb)
 
   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 -= 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 -= (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 @@ rtld_hidden_def (_dl_deallocate_tls)
    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 @@ __tls_get_addr (GET_ADDR_ARGS)
 
   return (char *) p + GET_ADDR_OFFSET;
 }
-# endif
+#endif
 
 
 /* Look up the module's TLS block as for __tls_get_addr,
@@ -840,4 +836,3 @@ cannot create TLS data structures"));
   listp->slotinfo[idx].map = l;
   listp->slotinfo[idx].gen = GL(dl_tls_generation) + 1;
 }
-#endif /* use TLS */
index 5b9a5b174455c0b1de2269dbf13ac22871e75489..b14696d496e0e519936c9ffb9d6b0b4a0ddbef1a 100644 (file)
@@ -1185,9 +1185,7 @@ main (int argc, char **argv)
          add_dir (argv[i]);
     }
 
-#ifdef USE_TLS
   hwcap_extra[63 - _DL_FIRST_EXTRA] = "tls";
-#endif
 
   set_hwcap ();
 
index 8f0b0703a71963a6d75470e11cf3a62cff9623a7..edcc1f7e92ea9e2d85174a00901a66b1f1a1a297 100644 (file)
@@ -1,5 +1,5 @@
 /* Run time dynamic linker.
-   Copyright (C) 1995-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002,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
@@ -292,7 +292,7 @@ _dl_start_final (void *arg, struct dl_start_final_info *info)
   GL(dl_rtld_map).l_map_end = (ElfW(Addr)) _end;
   GL(dl_rtld_map).l_text_end = (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 != 0);
   GL(dl_rtld_map).l_tls_blocksize = info->l.l_tls_blocksize;
@@ -400,7 +400,7 @@ _dl_start (void *arg)
   bootstrap_map.l_ld = (void *) bootstrap_map.l_addr + elf_machine_dynamic ();
   elf_get_dynamic_info (&bootstrap_map, NULL);
 
-#if defined USE_TLS && NO_TLS_OFFSET != 0
+#if NO_TLS_OFFSET != 0
   bootstrap_map.l_tls_offset = NO_TLS_OFFSET;
 #endif
 
@@ -701,7 +701,6 @@ match_version (const char *string, struct link_map *map)
   return 0;
 }
 
-#ifdef USE_TLS
 static bool tls_init_tp_called;
 
 static void *
@@ -773,7 +772,6 @@ cannot allocate TLS data structures for initial thread");
 
   return tcbp;
 }
-#endif
 
 #ifdef _LIBC_REENTRANT
 /* _dl_error_catch_tsd points to this for the single-threaded case.
@@ -861,18 +859,14 @@ dl_main (const ElfW(Phdr) *phdr,
   hp_timing_t stop;
   hp_timing_t diff;
 #endif
-#ifdef USE_TLS
   void *tcbp = NULL;
-#endif
 
 #ifdef _LIBC_REENTRANT
   /* Explicit initialization since the reloc would just be more work.  */
   GL(dl_error_catch_tsd) = &_dl_initial_error_catch_tsd;
 #endif
 
-#ifdef USE_TLS
   GL(dl_init_static_tls) = &_dl_nothread_init_static_tls;
-#endif
 
 #if defined SHARED && defined _LIBC_REENTRANT \
     && defined __rtld_lock_default_lock_recursive
@@ -1157,7 +1151,6 @@ of this helper program; chances are you did not intend to run this program.\n\
        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 +1170,6 @@ of this helper program; chances are you did not intend to run this program.\n\
            /* This image gets the ID one.  */
            GL(dl_tls_max_dtv_idx) = main_map->l_tls_modid = 1;
          }
-#else
-       _dl_fatal_printf ("\
-ld.so does not support TLS, but program uses it!\n");
-#endif
        break;
 
       case PT_GNU_STACK:
@@ -1192,13 +1181,12 @@ ld.so does not support TLS, but program uses it!\n");
        main_map->l_relro_size = 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 != NULL)
-      main_map->l_tls_initimage
-       = (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 != NULL)
+    main_map->l_tls_initimage
+      = (char *) main_map->l_tls_initimage + main_map->l_addr;
   if (! main_map->l_map_end)
     main_map->l_map_end = ~0;
   if (! main_map->l_text_end)
@@ -1401,12 +1389,10 @@ ld.so does not support TLS, but program uses it!\n");
        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 != 0)
     /* Assign a module ID.  Do this before loading any audit modules.  */
     GL(dl_rtld_map).l_tls_modid = _dl_next_tls_modid ();
-#endif
 
   /* If we have auditing DSOs to load, do it now.  */
   if (__builtin_expect (audit_list != NULL, 0))
@@ -1416,7 +1402,6 @@ ld.so does not support TLS, but program uses it!\n");
       struct audit_list *al = audit_list->next;
       do
        {
-#ifdef USE_TLS
          int tls_idx = GL(dl_tls_max_dtv_idx);
 
          /* Now it is time to determine the layout of the static TLS
@@ -1428,7 +1413,7 @@ ld.so does not support TLS, but program uses it!\n");
          /* Since we start using the auditing DSOs right away we need to
             initialize the data structures now.  */
          tcbp = init_tls ();
-#endif
+
          struct dlmopen_args dlmargs;
          dlmargs.fname = al->name;
          dlmargs.map = NULL;
@@ -1543,9 +1528,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
                  assert (GL(dl_ns)[ns]._ns_loaded == NULL);
                  assert (GL(dl_ns)[ns]._ns_nloaded == 0);
 
-#ifdef USE_TLS
                  GL(dl_tls_max_dtv_idx) = tls_idx;
-#endif
                  goto not_loaded;
                }
            }
@@ -1821,7 +1804,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
     _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 +1814,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
   bool was_tls_init_tp_called = tls_init_tp_called;
   if (tcbp == NULL)
     tcbp = init_tls ();
-#endif
 
   /* Set up the stack checker's canary.  */
   uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
@@ -1889,13 +1870,12 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
                          (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");
            }
        }
@@ -2178,11 +2158,9 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
          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 != 0 && tls_init_tp_called)
            _dl_add_to_slotinfo (l);
-#endif
        }
 
       _dl_sysdep_start_cleanup ();
@@ -2229,11 +2207,9 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
            _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 != 0 && tls_init_tp_called)
            _dl_add_to_slotinfo (l);
-#endif
 
          l = l->l_prev;
        }
@@ -2262,7 +2238,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 # 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);
 
@@ -2280,9 +2255,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
        _dl_fatal_printf ("cannot set up thread-local storage: %s\n",
                          lossage);
     }
-#else
-  NONTLS_INIT_TP;
-#endif
 
   if (! prelinked && rtld_multiple_ref)
     {
index e97b5081fdc5b3df0ae8223a702c28eabc471506..26c2811178f9c2fd6cd8278f58c06dd4e9b7fde6 100644 (file)
@@ -9,7 +9,6 @@
 static int
 do_test (void)
 {
-#ifdef USE_TLS
   static const char modname[] = "tst-tlsmod2.so";
   int result = 0;
   int *foop;
@@ -83,9 +82,6 @@ do_test (void)
   dlclose (h);
 
   return result;
-#else
-  return 0;
-#endif
 }
 
 
index 478f5bbdcdf6e24933684aed683040db44bce01c..3b9b10f9aaa1e54a2b27b3099f7f300d7014dc18 100644 (file)
@@ -3,21 +3,18 @@
 
 #include <tls.h>
 
-#ifdef USE_TLS
-# include "tls-macros.h"
+#include "tls-macros.h"
 
 
 /* Two common 'int' variables in TLS.  */
 COMMON_INT_DEF(foo);
 COMMON_INT_DEF(bar);
-#endif
 
 
 #define TEST_FUNCTION do_test ()
 static int
 do_test (void)
 {
-#ifdef USE_TLS
   int result = 0;
   int *ap, *bp;
 
@@ -82,9 +79,6 @@ do_test (void)
     }
 
   return result;
-#else
-  return 0;
-#endif
 }
 
 
index 1be6adc29372916a66159637cbb81c000a250fd5..bffc332a0aa1b5b1bd5ffff135c7b3daf517f5d5 100644 (file)
@@ -1,8 +1,7 @@
 #include <tls.h>
 #include <stdlib.h>
 
-#if defined USE_TLS && defined HAVE___THREAD \
-    && defined HAVE_TLS_MODEL_ATTRIBUTE
+#if defined HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE
 # define USE_TLS__THREAD
 
 struct A
index 428fd5293eb8b455d5244309e18667576eb02bd6..c1e6ba7e2cbeb0054e1e5e65e6c3fc1c19928a93 100644 (file)
@@ -6,9 +6,9 @@
 
 #include <tls.h>
 
-#if USE_TLS && HAVE___THREAD
+#if HAVE___THREAD
 
-#define AL 4096
+# define AL 4096
 struct foo
 {
   int i;
@@ -55,11 +55,11 @@ do_test (void)
   return result;
 }
 
-#define TEST_FUNCTION do_test ()
+# define TEST_FUNCTION do_test ()
 
 #else
 
-#define TEST_FUNCTION 0
+# define TEST_FUNCTION 0
 
 #endif
 
index 417489968ec9db2e2f93b017c1b4da68259c26f9..3d13272c08a0c1426fef68f02c273afb70cfd832 100644 (file)
@@ -3,21 +3,18 @@
 
 #include <tls.h>
 
-#ifdef USE_TLS
-# include "tls-macros.h"
+#include "tls-macros.h"
 
 
 /* Two 'int' variables in TLS.  */
 VAR_INT_DEF(foo);
 VAR_INT_DEF(bar);
-#endif
 
 
 #define TEST_FUNCTION do_test ()
 static int
 do_test (void)
 {
-#ifdef USE_TLS
   int result = 0;
   int *ap, *bp;
 
@@ -82,9 +79,6 @@ do_test (void)
     }
 
   return result;
-#else
-  return 0;
-#endif
 }
 
 
index 84be43575b6c59f81f74e357d7b56223e07d4c45..c5e501eb4ee37f8a7e98f1ae800c4f05dfcef6e3 100644 (file)
@@ -3,15 +3,13 @@
 
 #include <tls.h>
 
-#ifdef USE_TLS
-# include "tls-macros.h"
+#include "tls-macros.h"
 
 
 /* One define int variable, two externs.  */
 COMMON_INT_DECL(foo);
 VAR_INT_DECL(bar);
 VAR_INT_DEF(baz);
-#endif
 
 
 extern int in_dso (void);
@@ -21,7 +19,6 @@ extern int in_dso (void);
 static int
 do_test (void)
 {
-#ifdef USE_TLS
   int result = 0;
   int *ap, *bp, *cp;
 
@@ -67,9 +64,6 @@ do_test (void)
   result |= in_dso ();
 
   return result;
-#else
-  return 0;
-#endif
 }
 
 
index f92ee53ce5542c334b173bfaa615d2cccf9df92b..4ae33db24d9e633fac73613aef6e24e8e542f3ac 100644 (file)
@@ -9,7 +9,6 @@
 static int
 do_test (void)
 {
-#ifdef USE_TLS
   static const char modname[] = "tst-tlsmod2.so";
   int result = 0;
   int *foop;
@@ -47,9 +46,6 @@ do_test (void)
   dlclose (h);
 
   return result;
-#else
-  return 0;
-#endif
 }
 
 
index a571d2cd3fa9685cad18c520e39f010e6914f9ec..27b18294fb2b8eb370101bfef12eab1dbe10a28e 100644 (file)
@@ -9,7 +9,6 @@
 static int
 do_test (void)
 {
-#ifdef USE_TLS
   static const char modname[] = "tst-tlsmod2.so";
   int result = 0;
   int *foop;
@@ -63,9 +62,6 @@ do_test (void)
   dlclose (h);
 
   return result;
-#else
-  return 0;
-#endif
 }
 
 
index 68d706538f4573d1d83408d7da3613a2d240ae74..021622d9c7cee6d2d080268694b1372960fb1fe3 100644 (file)
@@ -10,7 +10,6 @@
 static int
 do_test (void)
 {
-#ifdef USE_TLS
   static const char modname[] = "tst-tlsmod2.so";
   int result = 0;
   int *foop;
@@ -81,9 +80,6 @@ do_test (void)
     }
 
   return result;
-#else
-  return 0;
-#endif
 }
 
 
index 37f1a63e16465294b236c2f0bf10f59f450388f2..1edc2b63568ee821d245dcf151367d82b429af3d 100644 (file)
@@ -10,7 +10,6 @@
 static int
 do_test (void)
 {
-#ifdef USE_TLS
   static const char modname[] = "tst-tlsmod3.so";
   int result = 0;
   int (*fp) (void);
@@ -52,9 +51,6 @@ do_test (void)
     }
 
   return result;
-#else
-  return 0;
-#endif
 }
 
 
index ccc4e9f6fa423dc39f895c40ad38b78239961938..36b1baca63625b28ac157ec2231a71cd4ffb9585 100644 (file)
@@ -10,7 +10,6 @@
 static int
 do_test (void)
 {
-#ifdef USE_TLS
   static const char modname1[] = "$ORIGIN/tst-tlsmod3.so";
   static const char modname2[] = "$ORIGIN/tst-tlsmod4.so";
   int result = 0;
@@ -165,9 +164,6 @@ do_test (void)
     }
 
   return result;
-#else
-  return 0;
-#endif
 }
 
 
index e317696dfc348b61954a6f12d59030be9d6c4955..12078518fad5aa687d0b79408b2cbc668207e64e 100644 (file)
@@ -9,7 +9,6 @@
 static int
 do_test (void)
 {
-#ifdef USE_TLS
   static const char modname1[] = "tst-tlsmod5.so";
   static const char modname2[] = "tst-tlsmod6.so";
   int result = 0;
@@ -33,9 +32,6 @@ do_test (void)
     dlclose (h2);
 
   return result;
-#else
-  return 0;
-#endif
 }
 
 
index c74a617b77a3bc7e3705162b8794fabff6140129..4d966c9472ca3cc471ada8557697837702ebc305 100644 (file)
@@ -2,7 +2,6 @@
 
 #include <tls.h>
 
-#ifdef USE_TLS
 #include "tls-macros.h"
 
 
@@ -10,7 +9,6 @@
 COMMON_INT_DEF(foo);
 VAR_INT_DEF(bar);
 VAR_INT_DECL(baz);
-#endif
 
 extern int in_dso (void);
 
@@ -18,7 +16,6 @@ int
 in_dso (void)
 {
   int result = 0;
-#ifdef USE_TLS
   int *ap, *bp, *cp;
 
   /* Get variables using initial exec model.  */
@@ -62,7 +59,6 @@ in_dso (void)
       printf ("baz = %d\n", *cp);
       result = 1;
     }
-#endif
 
   return result;
 }
index beca89f6fec753d4f972bb42b8d10f97e772006a..e4e23af2d851aa038924969e907eabea5d427d33 100644 (file)
@@ -1,7 +1,6 @@
 #include <tls.h>
 
-#if defined USE_TLS && defined HAVE___THREAD \
-    && defined HAVE_TLS_MODEL_ATTRIBUTE
+#if defined HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE
 __thread int a[2] __attribute__ ((tls_model ("initial-exec")));
 #else
 int a[2];
index 14b12b032b42900cc7823056b53b69eaa5531df9..70a02131ee85d8bb44605596e0eb9868fe7a89b2 100644 (file)
@@ -1,7 +1,6 @@
 #include <tls.h>
 
-#if defined USE_TLS && defined HAVE___THREAD \
-    && defined HAVE_TLS_MODEL_ATTRIBUTE
+#if defined HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE
 __thread int b[2] __attribute__ ((tls_model ("initial-exec")));
 #else
 int b[2];
index 0bb393d9c5d54c5cac446c34c824c2db25db9a01..ad1d179aac2b0c5dd678871a36ae20996b156d41 100644 (file)
@@ -3,9 +3,9 @@
 
 #include <tls.h>
 
-#if USE_TLS && HAVE___THREAD
+#if HAVE___THREAD
 
-#define AL 4096
+# define AL 4096
 struct foo
 {
   int i;
@@ -15,9 +15,9 @@ static __thread struct foo f;
 static struct foo g;
 
 
-#ifndef FCT
-# define FCT in_dso1
-#endif
+# ifndef FCT
+#  define FCT in_dso1
+# endif
 
 
 int
index 98d9d3e5185c2e5a006fb58de7c80ed2076e1854..981923313c5454f01b0fdba0eb1f0d1d2466b1f3 100644 (file)
@@ -2,7 +2,6 @@
 
 #include <tls.h>
 
-#ifdef USE_TLS
 #include "tls-macros.h"
 
 
@@ -35,4 +34,3 @@ in_dso (int n, int *caller_foop)
 
   return result;
 }
-#endif
index 4a8aad659f6aee294417b99ddbdeaed5737e7500..5c456ee2da473271383308b816b2a34b20c1e8da 100644 (file)
@@ -2,8 +2,7 @@
 
 #include <tls.h>
 
-#ifdef USE_TLS
-# include "tls-macros.h"
+#include "tls-macros.h"
 
 extern int in_dso (int n, int *caller_foop);
 
@@ -38,4 +37,3 @@ in_dso2 (void)
 
   return result;
 }
-#endif
index 5285e821b0e94d7df1eda6aef23e7e125514bd77..dd954866186842402a9e95e4cabbf50bad8268b5 100644 (file)
@@ -2,8 +2,7 @@
 
 #include <tls.h>
 
-#ifdef USE_TLS
-# include "tls-macros.h"
+#include "tls-macros.h"
 
 
 COMMON_INT_DEF(baz);
@@ -35,4 +34,3 @@ in_dso (int n, int *caller_bazp)
 
   return result;
 }
-#endif
index 2ec69e13b3f08d2929a62a85cdbaa2cb760d19a8..00d3a9d9203658126e7569482003d913956663dc 100644 (file)
@@ -1,7 +1,5 @@
 #include <tls.h>
 
-#ifdef USE_TLS
 #include "tls-macros.h"
 
 COMMON_INT_DEF(foo);
-#endif
index 0fda51b226fb1ec7d943dceb7d8a88525c35836d..244d9ae485adab8345a866980f1f60adce8b5c9d 100644 (file)
@@ -1,7 +1,5 @@
 #include <tls.h>
 
-#ifdef USE_TLS
 #include "tls-macros.h"
 
 COMMON_INT_DEF(bar);
-#endif
index fe8bca44c5de53e25bad1c16da28b78684624cb5..80c7b6ec132ce0470d054d4036670c7fb5ad394e 100644 (file)
@@ -19,7 +19,7 @@ extern int rtld_errno attribute_hidden;
 
 # else
 
-#  include <tls.h>             /* Defines USE_TLS.  */
+#  include <tls.h>
 
 #  if USE___THREAD
 #   undef  errno
index 80eff3a677964243981ddf77ae5350aa1370a72f..b45deabf7f6b029073908217ec70bb48a4c64c92 100644 (file)
@@ -42,7 +42,7 @@ extern unsigned int la_objopen (struct link_map *__map, Lmid_t __lmid,
 #include <stddef.h>
 #include <bits/linkmap.h>
 #include <dl-lookupcfg.h>
-#include <tls.h>               /* Defines USE_TLS.  */
+#include <tls.h>
 #include <bits/libc-lock.h>
 #include <rtld-lowlevel.h>
 
@@ -261,7 +261,6 @@ struct link_map
       const ElfW(Sym) *ret;
     } l_lookup_cache;
 
-#ifdef USE_TLS
     /* Thread-local storage related info.  */
 
     /* Start of the initialization image.  */
@@ -274,14 +273,13 @@ struct link_map
     size_t l_tls_align;
     /* Offset of first byte module alignment.  */
     size_t l_tls_firstbyte_offset;
-# ifndef NO_TLS_OFFSET
-#  define NO_TLS_OFFSET        0
-# endif
+#ifndef NO_TLS_OFFSET
+# define NO_TLS_OFFSET 0
+#endif
     /* For objects present at startup time: offset in the static TLS block.  */
     ptrdiff_t l_tls_offset;
     /* Index of the module in the dtv array.  */
     size_t l_tls_modid;
-#endif
 
     /* Information used to change permission after the relocations are
        done.  */
index ffd3e4e70c812a6ef38f7fc10405a3eb057bc4a6..1642456a73e9ff270f3e08cd6d27b35ecbdb4955 100644 (file)
@@ -5,8 +5,7 @@
 
 #include_next <tls.h>
 
-#if USE_TLS && HAVE___THREAD \
-    && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+#if HAVE___THREAD && (!defined NOT_IN_libc || defined IS_IN_libpthread)
 
 # define USE___THREAD 1
 
index a5cae3c5d177b83d3f7f1b5483205b30ca574342..2280f68df47ad3b3c91939702e2c3e9cc229b798 100644 (file)
@@ -1,5 +1,5 @@
 /* Locale object representing the global locale controlled by setlocale.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 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
@@ -60,7 +60,7 @@ struct __locale_struct _nl_global_locale attribute_hidden =
   };
 
 #include <tls.h>
-#if USE_TLS && HAVE___THREAD
+#if HAVE___THREAD
 /* The tsd macros don't permit an initializer.  */
 __thread void *__libc_tsd_LOCALE = &_nl_global_locale;
 #else
index 4f746a298d1b3587b60aaadd77712acf3bdfd708..5c1f27f7e174e0d548a8d55e7546de0e35aa9ac1 100644 (file)
@@ -215,9 +215,7 @@ __libc_tsd_define (extern, LOCALE)
    we can use __thread variables.  So only in that case do we attempt this.  */
 #if !defined SHARED && defined HAVE___THREAD && defined HAVE_WEAK_SYMBOLS
 # include <tls.h>
-# if USE_TLS
-#  define NL_CURRENT_INDIRECT  1
-# endif
+# define NL_CURRENT_INDIRECT   1
 #endif
 
 #ifdef NL_CURRENT_INDIRECT
index 2179174d6412e4d49c3236a5997f8f1ed006f484..1d9f952112529d01b983f6b733728ee2057ce98f 100644 (file)
@@ -149,7 +149,7 @@ int __malloc_initialized = -1;
 
 static __malloc_ptr_t (*save_malloc_hook) (size_t __size,
                                           __const __malloc_ptr_t);
-# if !defined _LIBC || !defined USE_TLS || (defined SHARED && !USE___THREAD)
+# if !defined _LIBC || (defined SHARED && !USE___THREAD)
 static __malloc_ptr_t (*save_memalign_hook) (size_t __align, size_t __size,
                                             __const __malloc_ptr_t);
 # endif
@@ -385,7 +385,7 @@ extern struct dl_open_hook *_dl_open_hook;
 libc_hidden_proto (_dl_open_hook);
 # endif
 
-# if defined SHARED && defined USE_TLS && !USE___THREAD
+# if defined SHARED && !USE___THREAD
 /* This is called by __pthread_initialize_minimal when it needs to use
    malloc to set up the TLS state.  We cannot do the full work of
    ptmalloc_init (below) until __pthread_initialize_minimal has finished,
@@ -428,7 +428,7 @@ ptmalloc_init (void)
   __malloc_initialized = 0;
 
 #ifdef _LIBC
-# if defined SHARED && defined USE_TLS && !USE___THREAD
+# if defined SHARED && !USE___THREAD
   /* ptmalloc_init_minimal may already have been called via
      __libc_malloc_pthread_startup, above.  */
   if (mp_.pagesize == 0)
@@ -437,7 +437,7 @@ ptmalloc_init (void)
     ptmalloc_init_minimal();
 
 #ifndef NO_THREADS
-# if defined _LIBC && defined USE_TLS
+# if defined _LIBC
   /* We know __pthread_initialize_minimal has already been called,
      and that is enough.  */
 #   define NO_STARTER
index 708f0faf83116cdac9666825dda172ecb8be2f5d..8346e7345344cdd866de3177b6d09ce8a306a416 100644 (file)
@@ -1,5 +1,5 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@malloc.de>, 2001.
 
@@ -414,7 +414,7 @@ memalign_check(alignment, bytes, caller)
 #ifndef NO_THREADS
 
 # ifdef _LIBC
-#  if USE___THREAD || (defined USE_TLS && !defined SHARED)
+#  if USE___THREAD || !defined SHARED
     /* These routines are never needed in this configuration.  */
 #   define NO_STARTER
 #  endif
index 4cbce0455b9f0e49b4e66f7d3b2922099d3fef4f..d15ed57bd71c6a89550b65d8ea82a13ab1d04731 100644 (file)
@@ -1618,7 +1618,7 @@ static Void_t*   memalign_check(size_t alignment, size_t bytes,
                                const Void_t *caller);
 #ifndef NO_THREADS
 # ifdef _LIBC
-#  if USE___THREAD || (defined USE_TLS && !defined SHARED)
+#  if USE___THREAD || !defined SHARED
     /* These routines are never needed in this configuration.  */
 #   define NO_STARTER
 #  endif
index 7921488eaee699ccd1ed6a3dc14a4bdcae302b0c..2edd634e4649da6013cb66b1b75e9e2dfb808be2 100644 (file)
@@ -1,4 +1,16 @@
-2006-10-27  Jakub Jelinek  <jakub@redhat.com>
+2006-10-27  Ulrich Drepper  <drepper@redhat.com>
+
+       * init.c: USE_TLS support is now default.
+       * tst-tls5.h: Likewise.
+       * sysdeps/alpha/tls.h: Likewise.
+       * sysdeps/i386/tls.h: Likewise.
+       * sysdeps/ia64/tls.h: Likewise.
+       * sysdeps/powerpc/tls.h: Likewise.
+       * sysdeps/s390/tls.h: Likewise.
+       * sysdeps/sh/tls.h: Likewise.
+       * sysdeps/sparc/tls.h: Likewise.
+                                                                               * nptl/sysdeps/x86_64/tls.h: Likewise.
+                                                                               2006-10-27  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
        __rtld_mrlock_change): Update oldval if atomic compare and exchange
index 14441153b8e28de944013cdf7103304a7ce28bbf..dddc975a5eb3635f3cab9b245caf70bf11139adc 100644 (file)
@@ -73,7 +73,7 @@ int __set_robust_list_avail;
 static const char nptl_version[] __attribute_used__ = VERSION;
 
 
-#if defined USE_TLS && !defined SHARED
+#ifndef SHARED
 extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
 #endif
 
index 20f780c5f53002235cb81aab8df542374207f4f2..be2430f676f4b7bc7276b42cdf6a9ca6e4dd1e60 100644 (file)
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/Alpha version.
-   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2003, 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
@@ -48,9 +48,6 @@ typedef union dtv
 # error "TLS support is required."
 #endif
 
-/* Signal that TLS support is available.  */
-# define USE_TLS       1
-
 #ifndef __ASSEMBLER__
 
 /* Get system call information.  */
index a870a848cf4deaf006d0ccdab67091978a627d73..d5b3797e69740c91651a6865753cd955ab4d4194 100644 (file)
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  nptl/i386 version.
-   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002, 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
@@ -65,9 +65,6 @@ typedef struct
 # error "TLS support is required."
 #endif
 
-/* Signal that TLS support is available.  */
-#define USE_TLS        1
-
 /* Alignment requirement for the stack.  For IA-32 this is governed by
    the SSE memory functions.  */
 #define STACK_ALIGN    16
index 69101ad8c4c6941f91e590afea274dc3451a78aa..22a8b081448a7c02ed9732345a490ce6d024cf47 100644 (file)
@@ -61,9 +61,6 @@ register struct pthread *__thread_self __asm__("r13");
 # error "TLS support is required."
 #endif
 
-/* Signal that TLS support is available.  */
-#define USE_TLS        1
-
 /* Alignment requirement for the stack.  */
 #define STACK_ALIGN    16
 
index 976a27136292ee7c2ac63ffbf7c7d849e80eca1a..ddaafe23d0b67bfa6e1f2529d5d9f0b040ed6cf0 100644 (file)
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/PowerPC version.
-   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2003, 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
@@ -48,9 +48,6 @@ typedef union dtv
 # error "TLS support is required."
 #endif
 
-/* Signal that TLS support is available.  */
-# define USE_TLS       1
-
 #ifndef __ASSEMBLER__
 
 /* Get system call information.  */
index 89ff095d522ed0cb59d455bebbe50e5b8e581227..6f6f17b9751dc31bec5ba096ff10df27db4e23f1 100644 (file)
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/s390 version.
-   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 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
@@ -66,9 +66,6 @@ typedef struct
 # error "TLS support is required."
 #endif
 
-/* Signal that TLS support is available.  */
-#define USE_TLS        1
-
 /* Alignment requirement for the stack.  For IA-32 this is governed by
    the SSE memory functions.  */
 #define STACK_ALIGN    16
index 49d105518a38f3e2cc9059fd1a4bd5d9d1ccf65e..d9aa1073b8d6079623cce51707be690cd29303bb 100644 (file)
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/SH version.
-   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2003, 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
@@ -56,9 +56,6 @@ typedef struct
 # error "TLS support is required."
 #endif
 
-/* Signal that TLS support is available.  */
-# define USE_TLS       1
-
 #ifndef __ASSEMBLER__
 
 /* Get system call information.  */
index 127bbf695f4d1e0b1f2510fbe84d4fcad942ccef..4fbe426595924d6eb24d87361ed31c7034d08821 100644 (file)
@@ -60,9 +60,6 @@ typedef struct
 # error "TLS support is required."
 #endif
 
-/* Signal that TLS support is available.  */
-#define USE_TLS        1
-
 #ifndef __ASSEMBLER__
 /* Get system call information.  */
 # include <sysdep.h>
index 65ff0639b61cc660ee288bd2551db85262e712a0..7618573e0bd68f82c11a551c68890da5a5cb7222 100644 (file)
@@ -62,9 +62,6 @@ typedef struct
 # error "TLS support is required."
 #endif
 
-/* Signal that TLS support is available.  */
-#define USE_TLS        1
-
 /* Alignment requirement for the stack.  */
 #define STACK_ALIGN    16
 
index b7c14eb82c5d0df22ba4a4ee9fd259ea0d532b03..9a76ab7827234996691bec83b9faf5fa470ee96b 100644 (file)
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <tls.h>
 
-#if USE_TLS && HAVE___THREAD
+#if HAVE___THREAD
 
 struct tls_obj
 {
index 2bb82f488cc23c479d4cd0f9fe4b89cb0e14c366..f96ab04b86ba5fa67fa2ee6d57b9fd13621a1b4a 100644 (file)
@@ -1,3 +1,7 @@
+2006-10-27  Ulrich Drepper  <drepper@redhat.com>
+
+       * structs.def: USE_TLS support is now default.
+
 2006-02-03  Roland McGrath  <roland@redhat.com>
 
        * structs.def: Add a descriptor for pointer.val field of dtv_t.
index 823af5cba21a4264f953d83dbe0c19ffdd607d49..20fa014909ef21f734d199a183875c01a599f6e4 100644 (file)
@@ -68,15 +68,11 @@ DB_STRUCT_FIELD (pthread_key_data, data)
 DB_STRUCT (pthread_key_data_level2)
 DB_STRUCT_ARRAY_FIELD (pthread_key_data_level2, data)
 
-#if USE_TLS
 DB_STRUCT_FIELD (link_map, l_tls_modid)
-#endif
 
-#if !defined IS_IN_libpthread || USE_TLS
 DB_STRUCT_ARRAY_FIELD (dtv, dtv)
-# define pointer_val pointer.val /* Field of anonymous struct in dtv_t.  */
+#define pointer_val pointer.val /* Field of anonymous struct in dtv_t.  */
 DB_STRUCT_FIELD (dtv_t, pointer_val)
-#endif
 #if !defined IS_IN_libpthread || TLS_TCB_AT_TP
 DB_STRUCT_FIELD (pthread, dtvp)
 #endif
index 7016365be582829c0e23570f21e1deadcda46789..5a350cae36342815f119488782f963bfcf11411c 100644 (file)
@@ -2,7 +2,7 @@
 
 libc {
   GLIBC_2.0 {
-%if !(USE_TLS && HAVE___THREAD)
+%if !HAVE___THREAD
     # global variables
     _h_errno;
 %endif
@@ -17,7 +17,7 @@ libc {
 
     # variables in normal name space
     h_errlist; h_nerr;
-%if !(USE_TLS && HAVE___THREAD)
+%if !HAVE___THREAD
     h_errno;
 %endif
 
@@ -34,7 +34,7 @@ libc {
   GLIBC_PRIVATE {
     __gai_sigqueue;
 
-%if USE_TLS && HAVE___THREAD
+%if HAVE___THREAD
     # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol.
     h_errno; __resp;
 %endif
index 88c357ea07b246e9ef9f3c2876b07b99316beafe..29f500b2d00b56c6d8b244243def6e76a4058a21 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  Alpha version.
-   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.
    Contributed by Richard Henderson <rth@tamu.edu>.
 
@@ -232,14 +232,14 @@ $fixup_stack:                                                     \n\
    to one of the main executable's symbols, as for a COPY reloc.
    This is unused on Alpha.  */
 
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
-#define elf_machine_type_class(type)   \
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
+# define elf_machine_type_class(type)  \
   (((type) == R_ALPHA_JMP_SLOT         \
     || (type) == R_ALPHA_DTPMOD64      \
     || (type) == R_ALPHA_DTPREL64      \
     || (type) == R_ALPHA_TPREL64) * ELF_RTYPE_CLASS_PLT)
 #else
-#define elf_machine_type_class(type)   \
+# define elf_machine_type_class(type)  \
   (((type) == R_ALPHA_JMP_SLOT) * ELF_RTYPE_CLASS_PLT)
 #endif
 
@@ -439,40 +439,40 @@ elf_machine_rela (struct link_map *map,
          memcpy (reloc_addr_arg, &sym_value, 8);
        }
 #endif
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
       else if (r_type == R_ALPHA_DTPMOD64)
        {
-#ifdef RTLD_BOOTSTRAP
+# ifdef RTLD_BOOTSTRAP
          /* During startup the dynamic linker is always index 1.  */
          *reloc_addr = 1;
-#else
+# else
          /* Get the information from the link map returned by the
             resolv function.  */
          if (sym_map != NULL)
            *reloc_addr = sym_map->l_tls_modid;
-#endif
+# endif
        }
       else if (r_type == R_ALPHA_DTPREL64)
        {
-#ifndef RTLD_BOOTSTRAP
+# ifndef RTLD_BOOTSTRAP
          /* During relocation all TLS symbols are defined and used.
             Therefore the offset is already correct.  */
          *reloc_addr = sym_raw_value;
-#endif
+# endif
        }
       else if (r_type == R_ALPHA_TPREL64)
        {
-#ifdef RTLD_BOOTSTRAP
+# ifdef RTLD_BOOTSTRAP
          *reloc_addr = sym_raw_value + map->l_tls_offset;
-#else
+# else
          if (sym_map)
            {
              CHECK_STATIC_TLS (map, sym_map);
              *reloc_addr = sym_raw_value + sym_map->l_tls_offset;
            }
-#endif
+# endif
        }
-#endif /* USE_TLS */
+#endif
       else
        _dl_reloc_bad_type (map, r_type, 0);
     }
index 24629e9aca3efe2f4f4b9fde9a558933f52948e8..7e027691713d8c8784c2262cdd7c13aeae2b432b 100644 (file)
@@ -1,5 +1,5 @@
 /* Thread-local storage handling in the ELF dynamic linker.  Alpha version.
-   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2003, 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
@@ -20,8 +20,6 @@
 #include <csu/libc-tls.c>
 #include <dl-tls.h>
 
-#if USE_TLS
-
 /* On Alpha, linker optimizations are not required, so __tls_get_addr
    can be called even in statically linked binaries.  In this case module
    must be always 1 and PT_TLS segment exist in the binary, otherwise it
@@ -33,5 +31,3 @@ __tls_get_addr (tls_index *ti)
   dtv_t *dtv = THREAD_DTV ();
   return (char *) dtv[1].pointer.val + ti->ti_offset;
 }
-
-#endif
index 4fa3c0114a4be5f6c7aa3b278fdb436c03e642fe..98ba7d5b341aaabd94c44102f6a383aed136b6d9 100644 (file)
@@ -447,11 +447,6 @@ struct rtld_global
      It returns an errno code or zero on success.  */
   EXTERN int (*_dl_make_stack_executable_hook) (void **) internal_function;
 
-  /* Keep the conditional TLS members at the end so the layout of the
-     structure used by !USE_TLS code matches the prefix of the layout in
-     the USE_TLS rtld.  Note that `struct link_map' is conditionally
-     defined as well, so _dl_rtld_map needs to be last before this.  */
-#ifdef USE_TLS
   /* Highest dtv index currently needed.  */
   EXTERN size_t _dl_tls_max_dtv_idx;
   /* Flag signalling whether there are gaps in the module ID allocation.  */
@@ -479,10 +474,10 @@ struct rtld_global
 /* Number of additional entries in the slotinfo array of each slotinfo
    list element.  A large number makes it almost certain take we never
    have to iterate beyond the first element in the slotinfo list.  */
-# define TLS_SLOTINFO_SURPLUS (62)
+#define TLS_SLOTINFO_SURPLUS (62)
 
 /* Number of additional slots in the dtv allocated.  */
-# define DTV_SURPLUS   (14)
+#define DTV_SURPLUS    (14)
 
   /* Initial dtv of the main thread, not allocated with normal malloc.  */
   EXTERN void *_dl_initial_dtv;
@@ -490,7 +485,6 @@ struct rtld_global
   EXTERN size_t _dl_tls_generation;
 
   EXTERN void (*_dl_init_static_tls) (struct link_map *);
-#endif
 
 #ifdef SHARED
 };
@@ -1037,9 +1031,7 @@ rtld_hidden_proto (_dl_allocate_tls_init)
 extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb) internal_function;
 rtld_hidden_proto (_dl_deallocate_tls)
 
-#if defined USE_TLS
 extern void _dl_nothread_init_static_tls (struct link_map *) attribute_hidden;
-#endif
 
 /* Find origin of the executable.  */
 extern const char *_dl_get_origin (void) attribute_hidden;
index 6a23ec05e1be507d9b710a13fb62831db37ea2fd..06e41ad121b3a61be2163c72dbf35bc4c0555708 100644 (file)
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  Generic version.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 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
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-/* By default no TLS support is available.  This is signaled by the
-   absence of the symbol USE_TLS.  */
-#undef USE_TLS
-
-
 /* An architecture-specific version of this file has to defined a
    number of symbols:
 
index df3edf5460268df6deea9a017dedef32aa8cd75b..6b8502c5881e316733e0e0134b879cb250b6942e 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  i386 version.
-   Copyright (C) 1995-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1995-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
@@ -244,7 +244,7 @@ _dl_start_user:\n\
    define the value.
    ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
    of the main executable's symbols, as for a COPY reloc.  */
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
 # define elf_machine_type_class(type) \
   ((((type) == R_386_JMP_SLOT || (type) == R_386_TLS_DTPMOD32                \
      || (type) == R_386_TLS_DTPOFF32 || (type) == R_386_TLS_TPOFF32          \
@@ -352,7 +352,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
          *reloc_addr = value;
          break;
 
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
        case R_386_TLS_DTPMOD32:
 # ifdef RTLD_BOOTSTRAP
          /* During startup the dynamic linker is always the module
@@ -476,7 +476,6 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
          *reloc_addr = (value + reloc->r_addend - (Elf32_Addr) reloc_addr);
          break;
 
-#  ifdef USE_TLS
        case R_386_TLS_DTPMOD32:
          /* Get the information from the link map returned by the
             resolv function.  */
@@ -513,7 +512,6 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
                            + reloc->r_addend;
            }
          break;
-#  endif       /* use TLS */
        case R_386_COPY:
          if (sym == NULL)
            /* This can happen in trace mode if an object could not be
index 55349690e316d05bbbab9c8c06ceb7ab4c48f819..61b4ea99a703f2c8a29f05e923416c71ae39e45c 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  IA-64 version.
-   Copyright (C) 1995-1997, 2000-2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1995-1997, 2000-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
@@ -311,7 +311,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
    of the main executable's symbols, as for a COPY reloc, which we don't
    use.  */
 /* ??? Ignore *MSB for now.  */
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
 #define elf_machine_type_class(type) \
   (((type) == R_IA64_IPLTLSB || (type) == R_IA64_DTPMOD64LSB                 \
     || (type) == R_IA64_DTPREL64LSB || (type) == R_IA64_TPREL64LSB)          \
@@ -432,7 +432,7 @@ elf_machine_rela (struct link_map *map,
            value = _dl_make_fptr (sym_map, sym, value);
          else if (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_PCREL64LSB))
            value -= (Elf64_Addr) reloc_addr & -16;
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || defined USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || defined USE___THREAD
          else if (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_DTPMOD64LSB))
 # ifdef RTLD_BOOTSTRAP
            /* During startup the dynamic linker is always index 1.  */
index 2c0eeae86fccc6641776f7a7cb89f2392a8a9641..9751284008ef52497ecd9165003703685e69a5a2 100644 (file)
@@ -1,5 +1,5 @@
 /* Thread-local storage handling in the ELF dynamic linker.  IA-64 version.
-   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2003, 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
@@ -19,8 +19,6 @@
 
 #include <csu/libc-tls.c>
 
-#if USE_TLS
-
 /* On IA-64, as it lacks linker optimizations, __tls_get_addr can be
    called even in statically linked binaries.
    In this case module must be always 1 and PT_TLS segment
@@ -32,5 +30,3 @@ __tls_get_addr (size_t m, size_t offset)
   dtv_t *dtv = THREAD_DTV ();
   return (char *) dtv[1].pointer.val + offset;
 }
-
-#endif
index fa7da6020408290b504f3da203521dba2c180340..3288f186e5066b22323a30076d71da2a10f74074 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994,1995,1996,1997,1999,2001,2002,2004,2005
+/* Copyright (C) 1994,1995,1996,1997,1999,2001,2002,2004,2005,2006
        Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -532,11 +532,9 @@ __fork (void)
       /* Set the child user thread up to return 1 from the setjmp above.  */
       _hurd_longjmp_thread_state (&state, env, 1);
 
-#if USE_TLS
       /* Do special thread setup for TLS if needed.  */
       if (err = _hurd_tls_fork (thread, &state))
        LOSE;
-#endif
 
       if (err = __thread_set_state (thread, MACHINE_THREAD_STATE_FLAVOR,
                                    (natural_t *) &state, statecount))
index 223a47d2f2c2f9aab5db22356b8190c67cca902b..972cac57a1d99b4b52f29e497fe8f60a94634dd6 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  Hurd/i386 version.
-   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.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,9 +25,6 @@
 /* Some things really need not be machine-dependent.  */
 # include <sysdeps/mach/hurd/tls.h>
 
-/* Indiciate that TLS support is available.  */
-# define USE_TLS       1
-
 /* The TCB can have any size and the memory following the address the
    thread pointer points to is unspecified.  Allocate the TCB there.  */
 # define TLS_TCB_AT_TP 1
index 4120a0238214123e293c23fb3e40b4e8d6c8a9c5..fc460993b12e4aef27876375cb81b1cee05829c2 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation functions.  PowerPC version.
-   Copyright (C) 1995-2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1995-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
@@ -564,13 +564,12 @@ __process_machine_rela (struct link_map *map,
       }
       break;
 
-#ifdef USE_TLS
 #define CHECK_STATIC_TLS(map, sym_map)                                       \
     do {                                                                     \
       if (__builtin_expect ((sym_map)->l_tls_offset == NO_TLS_OFFSET, 0))     \
        _dl_allocate_static_tls (sym_map);                                    \
     } while (0)
-# define DO_TLS_RELOC(suffix)                                                \
+#define DO_TLS_RELOC(suffix)                                                 \
     case R_PPC_DTPREL##suffix:                                               \
       /* During relocation all TLS symbols are defined and used.             \
         Therefore the offset is already correct.  */                         \
@@ -609,7 +608,6 @@ __process_machine_rela (struct link_map *map,
     DO_TLS_RELOC (16_LO)
     DO_TLS_RELOC (16_HI)
     DO_TLS_RELOC (16_HA)
-#endif
 
     default:
       _dl_reloc_bad_type (map, rinfo, 0);
index 496fa71ecc03a0bf1684eb112a39d829c456dc62..a50ffdd1c215816dd56f497bb6ba1e9cca73cf87 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  PowerPC version.
-   Copyright (C) 1995-2002, 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002, 2003, 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
@@ -138,7 +138,7 @@ __elf_preferred_address(struct link_map *loader, size_t maplength,
 /* We never want to use a PLT entry as the destination of a
    reloc, when what is being relocated is a branch. This is
    partly for efficiency, but mostly so we avoid loops.  */
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
 #define elf_machine_type_class(type)                   \
   ((((type) == R_PPC_JMP_SLOT                          \
     || (type) == R_PPC_REL24                           \
@@ -330,7 +330,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
       *reloc_addr = value;
       break;
 
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) \
+#if (!defined RTLD_BOOTSTRAP || USE___THREAD) \
     && !defined RESOLVE_CONFLICT_FIND_MAP
 # ifdef RTLD_BOOTSTRAP
 #  define NOT_BOOTSTRAP 0
@@ -361,7 +361,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
          *reloc_addr = TLS_TPREL_VALUE (sym_map, sym, reloc);
        }
       break;
-#endif /* USE_TLS etc. */
+#endif
 
     case R_PPC_JMP_SLOT:
 #ifdef RESOLVE_CONFLICT_FIND_MAP
index cec271bb3a3aed2f56e951be6a8ae9da93bc82e0..89a69e1a2377d046703be694859b36fe93acdb46 100644 (file)
@@ -1,7 +1,6 @@
 /* Machine-dependent ELF dynamic relocation inline functions.
    PowerPC64 version.
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-   Free Software Foundation, Inc.
+   Copyright 1995-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
@@ -260,7 +259,7 @@ BODY_PREFIX "_dl_start_user:\n"                                             \
    ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
    of the main executable's symbols, as for a COPY reloc.  */
 
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
 #define elf_machine_type_class(type)                                         \
   /* This covers all the TLS relocs, though most won't appear.  */           \
   (((((type) >= R_PPC64_DTPMOD64 && (type) <= R_PPC64_TPREL16_HIGHESTA)              \
@@ -495,7 +494,7 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
   *reloc_addr = l_addr + reloc->r_addend;
 }
 
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
 /* This computes the value used by TPREL* relocs.  */
 auto inline Elf64_Addr __attribute__ ((always_inline, const))
 elf_machine_tprel (struct link_map *map,
@@ -562,7 +561,7 @@ elf_machine_rela (struct link_map *map,
 #endif
       return;
 
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
     case R_PPC64_DTPMOD64:
 # ifdef RTLD_BOOTSTRAP
       /* During startup the dynamic linker is always index 1.  */
@@ -645,7 +644,7 @@ elf_machine_rela (struct link_map *map,
       value = elf_machine_tprel (map, sym_map, sym, reloc);
       *(Elf64_Half *) reloc_addr = PPC_HIGHESTA (value);
       break;
-#endif /* USE_TLS etc. */
+#endif
 
 #ifndef RTLD_BOOTSTRAP /* None of the following appear in ld.so */
     case R_PPC64_ADDR16_LO_DS:
index f177f436e93444dba5b606c90dba2c0ef8e6dddd..766d565a9cbcb8a2f638ea5c0f5226a13f7100ce 100644 (file)
@@ -1,5 +1,5 @@
 /* Thread-local storage handling in the ELF dynamic linker.  S390 version.
-   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2003, 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
 #include <stdlib.h>
 #include <csu/libc-tls.c>
 
-#if USE_TLS
-
 /* On s390, the literal pool entry that refers to __tls_get_offset
    is not removed, even if all branches that use the literal pool
-   entry gets removed by TLS optimizations. To get binaries
+   entry gets removed by TLS optimizations.  To get binaries
    statically linked __tls_get_offset is defined here but
    aborts if it is used.  */
 
@@ -33,5 +31,3 @@ __tls_get_offset (size_t m, size_t offset)
 {
   abort ();
 }
-
-#endif
index 8bbf858fbf092446433ea9e0613f72a628e4eebb..64bf3423b69453ddc8dcf03f55152a6c989de45d 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  S390 Version.
-   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
    Contributed by Carl Pederson & Martin Schwidefsky.
    This file is part of the GNU C Library.
@@ -209,17 +209,11 @@ _dl_start_user:\n\
    define the value.
    ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
    of the main executable's symbols, as for a COPY reloc.  */
-#ifdef USE_TLS
-# define elf_machine_type_class(type) \
+#define elf_machine_type_class(type) \
   ((((type) == R_390_JMP_SLOT || (type) == R_390_TLS_DTPMOD                  \
      || (type) == R_390_TLS_DTPOFF || (type) == R_390_TLS_TPOFF)             \
     * ELF_RTYPE_CLASS_PLT)                                                   \
    | (((type) == R_390_COPY) * ELF_RTYPE_CLASS_COPY))
-#else
-# define elf_machine_type_class(type) \
-  ((((type) == R_390_JMP_SLOT) * ELF_RTYPE_CLASS_PLT)  \
-   | (((type) == R_390_COPY) * ELF_RTYPE_CLASS_COPY))
-#endif
 
 /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */
 #define ELF_MACHINE_JMP_SLOT    R_390_JMP_SLOT
@@ -315,7 +309,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
          *reloc_addr = value + reloc->r_addend;
          break;
 
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) \
+#if (!defined RTLD_BOOTSTRAP || USE___THREAD) \
     && !defined RESOLVE_CONFLICT_FIND_MAP
        case R_390_TLS_DTPMOD:
 # ifdef RTLD_BOOTSTRAP
index 5026a2edad9981d56cd27a5dc7fef630f2d1f739..fa893befdf5c9e571de4b5379cd97efed50a4c8a 100644 (file)
@@ -1,6 +1,6 @@
 /* Machine-dependent ELF dynamic relocation inline functions.
    64 bit S/390 Version.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001-2005, 2006 Free Software Foundation, Inc.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
    This file is part of the GNU C Library.
 
@@ -192,17 +192,11 @@ _dl_start_user:\n\
    define the value.
    ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
    of the main executable's symbols, as for a COPY reloc.  */
-#ifdef USE_TLS
-# define elf_machine_type_class(type) \
+#define elf_machine_type_class(type) \
   ((((type) == R_390_JMP_SLOT || (type) == R_390_TLS_DTPMOD                  \
      || (type) == R_390_TLS_DTPOFF || (type) == R_390_TLS_TPOFF)             \
     * ELF_RTYPE_CLASS_PLT)                                                   \
    | (((type) == R_390_COPY) * ELF_RTYPE_CLASS_COPY))
-#else
-# define elf_machine_type_class(type) \
-  ((((type) == R_390_JMP_SLOT) * ELF_RTYPE_CLASS_PLT)  \
-   | (((type) == R_390_COPY) * ELF_RTYPE_CLASS_COPY))
-#endif
 
 /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */
 #define ELF_MACHINE_JMP_SLOT   R_390_JMP_SLOT
@@ -294,7 +288,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
          *reloc_addr = value + reloc->r_addend;
          break;
 
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) \
+#if (!defined RTLD_BOOTSTRAP || USE___THREAD) \
     && !defined RESOLVE_CONFLICT_FIND_MAP
        case R_390_TLS_DTPMOD:
 # ifdef RTLD_BOOTSTRAP
index e73c6d79c370f80d2d8b0062aaf6bb57c7864b0b..78f70e38805d75d0f1808772756532c69e93a80c 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  SH version.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -208,7 +208,7 @@ __fpscr_values:\n\
    define the value.
    ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
    of the main executable's symbols, as for a COPY reloc.  */
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
 # define elf_machine_type_class(type) \
   ((((type) == R_SH_JMP_SLOT || (type) == R_SH_TLS_DTPMOD32                  \
      || (type) == R_SH_TLS_DTPOFF32 || (type) == R_SH_TLS_TPOFF32)           \
@@ -354,7 +354,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
          /* These addresses are always aligned.  */
          *reloc_addr = value;
          break;
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
          /* XXX Remove TLS relocations which are not needed.  */
        case R_SH_TLS_DTPMOD32:
 # ifdef RTLD_BOOTSTRAP
index 02dabaabb44d9896fff85388d1c02e1535a11d24..19aac6a7fe9a0cbc8b2680bb8277a45915146749 100644 (file)
@@ -188,7 +188,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
    PLT entries should not be allowed to define the value.
    ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
    of the main executable's symbols, as for a COPY reloc.  */
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
 # define elf_machine_type_class(type) \
   ((((type) == R_SPARC_JMP_SLOT                                                      \
      || ((type) >= R_SPARC_TLS_GD_HI22 && (type) <= R_SPARC_TLS_TPOFF64))     \
@@ -459,7 +459,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
         so we can optimize the first instruction of .plt out.  */
       sparc_fixup_plt (reloc, reloc_addr, value, 0);
       break;
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) \
+#if (!defined RTLD_BOOTSTRAP || USE___THREAD) \
     && !defined RESOLVE_CONFLICT_FIND_MAP
     case R_SPARC_TLS_DTPMOD32:
       /* Get the information from the link map returned by the
index 314a784dbc92925c274fcda43a82085f923bc467..3eee6729124bdbafb5f95100139617a1d2dd8f7b 100644 (file)
@@ -240,7 +240,7 @@ elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc,
    PLT entries should not be allowed to define the value.
    ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
    of the main executable's symbols, as for a COPY reloc.  */
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
 # define elf_machine_type_class(type) \
   ((((type) == R_SPARC_JMP_SLOT                                                      \
      || ((type) >= R_SPARC_TLS_GD_HI22 && (type) <= R_SPARC_TLS_TPOFF64))     \
@@ -589,7 +589,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
       sparc64_fixup_plt (map, reloc, reloc_addr, value, reloc->r_addend, 0);
 #endif
       break;
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) \
+#if (!defined RTLD_BOOTSTRAP || USE___THREAD) \
     && !defined RESOLVE_CONFLICT_FIND_MAP
     case R_SPARC_TLS_DTPMOD64:
       /* Get the information from the link map returned by the
index 73e271775aaee05c64ac66b1b8eb7e1dcc11e369..31a7013d504e1546f3134ede3d7497057bf365e1 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  x86-64 version.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001-2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>.
 
@@ -190,7 +190,7 @@ _dl_start_user:\n\
    define the value.
    ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
    of the main executable's symbols, as for a COPY reloc.  */
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
+#if !defined RTLD_BOOTSTRAP || USE___THREAD
 # define elf_machine_type_class(type)                                        \
   ((((type) == R_X86_64_JUMP_SLOT                                            \
      || (type) == R_X86_64_DTPMOD64                                          \
@@ -300,7 +300,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
          *reloc_addr = value + reloc->r_addend;
          break;
 
-#if defined USE_TLS && !defined RESOLVE_CONFLICT_FIND_MAP
+#ifndef RESOLVE_CONFLICT_FIND_MAP
        case R_X86_64_DTPMOD64:
 # ifdef RTLD_BOOTSTRAP
          /* During startup the dynamic linker is always the module
@@ -339,7 +339,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
                             - sym_map->l_tls_offset);
            }
          break;
-#endif /* use TLS */
+#endif
 
 #ifndef RTLD_BOOTSTRAP
        case R_X86_64_64:
index 778d8ef0be587a9f1a38bd071537c2453bacba5d..d19e2e17924306866f5b5ebb4f6c92756a72cfa2 100644 (file)
@@ -2,11 +2,7 @@
 
 #include <tls.h>
 
-#if USE_TLS
 @@@ use-tls = yes @@@
-#else
-@@@ use-tls = no @@@
-#endif
 
 #if USE___THREAD
 @@@ use-thread = yes @@@
This page took 0.179788 seconds and 5 git commands to generate.