1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

* 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.
This commit is contained in:
Ulrich Drepper
2005-01-09 20:13:03 +00:00
parent e145f1cc75
commit 217fc747ff
13 changed files with 86 additions and 23 deletions

View 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) \ -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \
-o $@ $(objpfx)tst-pie1.o $(objpfx)tst-piemod1.so \ -o $@ $(objpfx)tst-pie1.o $(objpfx)tst-piemod1.so \
$(common-objpfx)libc_nonshared.a $(common-objpfx)libc_nonshared.a
generated += tst-pie1 tst-pie1.out tst-pie1.o
endif endif
check-textrel-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE check-textrel-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE

View 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> 2004-12-21 Jakub Jelinek <jakub@redhat.com>
* Makefile (tests): Add tst-align. * Makefile (tests): Add tst-align.

View File

@ -482,7 +482,8 @@ init_one_static_tls (pthread_descr descr, struct link_map *map)
# endif # endif
/* Fill in the DTV slot so that a later LD/GD access will find it. */ /* 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. */ /* Initialize the memory. */
memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size), memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),

View File

@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. linuxthreads/Alpha version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -23,13 +23,18 @@
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
# include <pt-machine.h> # include <pt-machine.h>
# include <stdbool.h>
# include <stddef.h> # include <stddef.h>
/* Type for the dtv. */ /* Type for the dtv. */
typedef union dtv typedef union dtv
{ {
size_t counter; size_t counter;
void *pointer; struct
{
void *val;
bool is_static;
} pointer;
} dtv_t; } dtv_t;

View File

@ -1,5 +1,5 @@
/* Definition for thread-local data handling. linuxthreads/i386 version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,6 +24,7 @@
# include <pt-machine.h> # include <pt-machine.h>
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
# include <stdbool.h>
# include <stddef.h> # include <stddef.h>
# include <stdint.h> # include <stdint.h>
@ -31,7 +32,11 @@
typedef union dtv typedef union dtv
{ {
size_t counter; size_t counter;
void *pointer; struct
{
void *val;
bool is_static;
} pointer;
} dtv_t; } dtv_t;

View File

@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. linuxthreads/IA-64 version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,13 +24,18 @@
# include <dl-sysdep.h> # include <dl-sysdep.h>
# include <pt-machine.h> # include <pt-machine.h>
# include <stdbool.h>
# include <stddef.h> # include <stddef.h>
/* Type for the dtv. */ /* Type for the dtv. */
typedef union dtv typedef union dtv
{ {
size_t counter; size_t counter;
void *pointer; struct
{
void *val;
bool is_static;
} pointer;
} dtv_t; } dtv_t;
#else /* __ASSEMBLER__ */ #else /* __ASSEMBLER__ */

View File

@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. linuxthreads/PPC version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -23,13 +23,18 @@
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
# include <pt-machine.h> # include <pt-machine.h>
# include <stdbool.h>
# include <stddef.h> # include <stddef.h>
/* Type for the dtv. */ /* Type for the dtv. */
typedef union dtv typedef union dtv
{ {
size_t counter; size_t counter;
void *pointer; struct
{
void *val;
bool is_static;
} pointer;
} dtv_t; } dtv_t;
#else /* __ASSEMBLER__ */ #else /* __ASSEMBLER__ */
@ -99,9 +104,9 @@ typedef struct
/* Code to initially initialize the thread pointer. This might need /* Code to initially initialize the thread pointer. This might need
special attention since 'errno' is not yet available and if the special attention since 'errno' is not yet available and if the
operation can cause a failure 'errno' must not be touched. operation can cause a failure 'errno' must not be touched.
The global register variable is declared in pt-machine.h with the 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. 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. */ This avoids a lvalue cast that gcc-3.4 does not like. */
# define TLS_INIT_TP(TCBP, SECONDCALL) \ # define TLS_INIT_TP(TCBP, SECONDCALL) \
(__thread_self = (struct _pthread_descr_struct *) \ (__thread_self = (struct _pthread_descr_struct *) \

View File

@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. linuxthreads/s390 version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -23,13 +23,18 @@
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
# include <pt-machine.h> # include <pt-machine.h>
# include <stdbool.h>
# include <stddef.h> # include <stddef.h>
/* Type for the dtv. */ /* Type for the dtv. */
typedef union dtv typedef union dtv
{ {
size_t counter; size_t counter;
void *pointer; struct
{
void *val;
bool is_static;
} pointer;
} dtv_t; } dtv_t;
typedef struct typedef struct

View File

@ -1,5 +1,5 @@
/* Definition for thread-local data handling. linuxthreads/SH version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,6 +24,7 @@
# include <pt-machine.h> # include <pt-machine.h>
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
# include <stdbool.h>
# include <stddef.h> # include <stddef.h>
# include <stdint.h> # include <stdint.h>
@ -31,7 +32,11 @@
typedef union dtv typedef union dtv
{ {
size_t counter; size_t counter;
void *pointer; struct
{
void *val;
bool is_static;
} pointer;
} dtv_t; } dtv_t;
#else /* __ASSEMBLER__ */ #else /* __ASSEMBLER__ */

View File

@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. linuxthreads/sparc version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -23,13 +23,18 @@
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
# include <pt-machine.h> # include <pt-machine.h>
# include <stdbool.h>
# include <stddef.h> # include <stddef.h>
/* Type for the dtv. */ /* Type for the dtv. */
typedef union dtv typedef union dtv
{ {
size_t counter; size_t counter;
void *pointer; struct
{
void *val;
bool is_static;
} pointer;
} dtv_t; } dtv_t;
typedef struct typedef struct

View File

@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. linuxthreads/x86-64 version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -23,13 +23,18 @@
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
# include <pt-machine.h> # include <pt-machine.h>
# include <stdbool.h>
# include <stddef.h> # include <stddef.h>
/* Type for the dtv. */ /* Type for the dtv. */
typedef union dtv typedef union dtv
{ {
size_t counter; size_t counter;
void *pointer; struct
{
void *val;
bool is_static;
} pointer;
} dtv_t; } dtv_t;

View 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> 2004-05-01 Jakub Jelinek <jakub@redhat.com>
* thread_dbP.h (LOG): Use write instead of __libc_write. * thread_dbP.h (LOG): Use write instead of __libc_write.

View File

@ -1,5 +1,5 @@
/* Locate TLS data for a thread. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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 /* It could be that the memory for this module is not allocated for
the given thread. */ the given thread. */
if (pdtv.pointer == TLS_DTV_UNALLOCATED) if (pdtv.pointer.val == TLS_DTV_UNALLOCATED)
return TD_TLSDEFER; return TD_TLSDEFER;
*base = (char *) pdtv.pointer; *base = (char *) pdtv.pointer.val;
return TD_OK; return TD_OK;
#else #else