]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* pthread.c (init_one_static_tls): Adjust initialization of DTV
authorUlrich Drepper <drepper@redhat.com>
Sun, 9 Jan 2005 20:13:03 +0000 (20:13 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 9 Jan 2005 20:13:03 +0000 (20:13 +0000)
entry for static tls deallocation fix.

* sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
also contains information whether the memory pointed to is static
TLS or not, include <stdbool.h>.
* 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.
* sysdeps/x86_64/tls.h: Likewise.

13 files changed:
elf/Makefile
linuxthreads/ChangeLog
linuxthreads/pthread.c
linuxthreads/sysdeps/alpha/tls.h
linuxthreads/sysdeps/i386/tls.h
linuxthreads/sysdeps/ia64/tls.h
linuxthreads/sysdeps/powerpc/tls.h
linuxthreads/sysdeps/s390/tls.h
linuxthreads/sysdeps/sh/tls.h
linuxthreads/sysdeps/sparc/tls.h
linuxthreads/sysdeps/x86_64/tls.h
linuxthreads_db/ChangeLog
linuxthreads_db/td_thr_tlsbase.c

index 57c2d7be135dcac38ebcf7dcf869b01557602dbf..ddc20f40596773258578b440f12946941967b4ae 100644 (file)
@@ -734,6 +734,8 @@ $(objpfx)tst-pie1: $(objpfx)tst-pie1.o $(objpfx)tst-piemod1.so
          -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \
          -o $@ $(objpfx)tst-pie1.o $(objpfx)tst-piemod1.so \
          $(common-objpfx)libc_nonshared.a
+
+generated += tst-pie1 tst-pie1.out tst-pie1.o
 endif
 
 check-textrel-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
index 1036c480aef041a9909d12b5c8285860bd3b6014..7b04bc5bc084333a2a527a9b94b88fbe8c2750e7 100644 (file)
@@ -1,3 +1,19 @@
+2005-01-08  Andreas Jaeger  <aj@suse.de>
+
+       * pthread.c (init_one_static_tls): Adjust initialization of DTV
+       entry for static tls deallocation fix.
+
+       * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
+       also contains information whether the memory pointed to is static
+       TLS or not, include <stdbool.h>.
+       * 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.
+       * sysdeps/x86_64/tls.h: Likewise.
+
 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
 
        * Makefile (tests): Add tst-align.
index 24f0eb02b01e98255abf9023b55fa97f375c8449..39863f2b5456a2e10a689819f96fd05221dd657f 100644 (file)
@@ -482,7 +482,8 @@ init_one_static_tls (pthread_descr descr, struct link_map *map)
 # endif
 
   /* Fill in the DTV slot so that a later LD/GD access will find it.  */
-  dtv[map->l_tls_modid].pointer = dest;
+  dtv[map->l_tls_modid].pointer.val = dest;
+  dtv[map->l_tls_modid].pointer.is_static = true;
 
   /* Initialize the memory.  */
   memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),
index 261d333eb4dec31be2e5e331b4002172b7be8d42..3eb9438ce739b130b6e7e2e35e338b44ddcd32cd 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/Alpha version.
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005 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
 #ifndef __ASSEMBLER__
 
 # include <pt-machine.h>
+# include <stdbool.h>
 # include <stddef.h>
 
 /* Type for the dtv.  */
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 
index 5306d082bb423bc2ed8a750a955d1b2be7a753b7..002bcd3d14797659a586cc4717c47c100b13c1cf 100644 (file)
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  linuxthreads/i386 version.
-   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005 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
@@ -24,6 +24,7 @@
 # include <pt-machine.h>
 
 #ifndef __ASSEMBLER__
+# include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
 
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 
index 3ec2eda783702cdcfeb3d35479a6771d1b72a7e8..c97000e446ee70ce610fd62885f3ada2474ace1b 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/IA-64 version.
-   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005 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 <dl-sysdep.h>
 # include <pt-machine.h>
+# include <stdbool.h>
 # include <stddef.h>
 
 /* Type for the dtv.  */
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 #else /* __ASSEMBLER__ */
index f6eb48b434c607c1e7825875b705e344265b3bd1..1ae0b60ff12d1dc2f6203a40746b6fa332ceccfd 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/PPC version.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005 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
 #ifndef __ASSEMBLER__
 
 # include <pt-machine.h>
+# include <stdbool.h>
 # include <stddef.h>
 
 /* Type for the dtv.  */
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 #else /* __ASSEMBLER__ */
@@ -99,9 +104,9 @@ typedef struct
 /* Code to initially initialize the thread pointer.  This might need
    special attention since 'errno' is not yet available and if the
    operation can cause a failure 'errno' must not be touched.
-   
-   The global register variable is declared in pt-machine.h with the 
-   wrong type, so we need some extra casts to get the desired result.  
+
+   The global register variable is declared in pt-machine.h with the
+   wrong type, so we need some extra casts to get the desired result.
    This avoids a lvalue cast that gcc-3.4 does not like.  */
 # define TLS_INIT_TP(TCBP, SECONDCALL) \
     (__thread_self = (struct _pthread_descr_struct *) \
index 41a83a72fbbd4d0da5e2173656c60973bd5cbf2e..f750f2d6f7d7cf6d3da655daa521712c267c11d9 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/s390 version.
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005 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
 #ifndef __ASSEMBLER__
 
 # include <pt-machine.h>
+# include <stdbool.h>
 # include <stddef.h>
 
 /* Type for the dtv.  */
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 typedef struct
index 17a247c6b6cf6526e27cdc49b28ba57247e1ea84..699eeb62278fd28f0a7fa91fda80aa92d6637cc6 100644 (file)
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  linuxthreads/SH version.
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005 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
@@ -24,6 +24,7 @@
 # include <pt-machine.h>
 
 #ifndef __ASSEMBLER__
+# include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
 
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 #else /* __ASSEMBLER__ */
index 6b1966fe1cb96b362ac519d19ab875cb6230c025..2df97d61e4cab9cf875cf622d351c4b0cad03b28 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/sparc version.
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005 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
 #ifndef __ASSEMBLER__
 
 # include <pt-machine.h>
+# include <stdbool.h>
 # include <stddef.h>
 
 /* Type for the dtv.  */
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 typedef struct
index 63feebdb2c64bdc593c2e686958d87e810683be8..d67275c10c8cb28199364532a929f39f4842a89e 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/x86-64 version.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005 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
 #ifndef __ASSEMBLER__
 
 # include <pt-machine.h>
+# include <stdbool.h>
 # include <stddef.h>
 
 /* Type for the dtv.  */
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 
index 338bf8207f401d98ca5f309a2915a1d88fd869d4..4bda6fb47a9b82125bb4f3e55a51cab5228eb4c6 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-09  Andreas Jaeger  <aj@suse.de>
+
+       * td_thr_tlsbase.c (td_thr_tlsbase): Adjust for dtv change.
+
 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
 
        * thread_dbP.h (LOG): Use write instead of __libc_write.
index 081e8d0e7029426f8d5806168fa7a1d83a63e08b..5a7e31b9e19b1fc8d9330deba6064d1f70b70321 100644 (file)
@@ -1,5 +1,5 @@
 /* Locate TLS data for a thread.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 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
@@ -59,10 +59,10 @@ td_thr_tlsbase (const td_thrhandle_t *th,
 
   /* It could be that the memory for this module is not allocated for
      the given thread.  */
-  if (pdtv.pointer == TLS_DTV_UNALLOCATED)
+  if (pdtv.pointer.val == TLS_DTV_UNALLOCATED)
     return TD_TLSDEFER;
 
-  *base = (char *) pdtv.pointer;
+  *base = (char *) pdtv.pointer.val;
 
   return TD_OK;
 #else