summary refs log tree commit diff
path: root/sysdeps/generic/dl-tls.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-08-06 00:51:51 +0000
committerUlrich Drepper <drepper@redhat.com>2002-08-06 00:51:51 +0000
commit84bdcade74b3a57cda9d31f56f9054ccbc2b519f (patch)
treedd23892290c8a62a9ed4b05530eca6490eef4537 /sysdeps/generic/dl-tls.c
parent4f6da0f5d827a462e30634e36161f80026223ba8 (diff)
downloadglibc-84bdcade74b3a57cda9d31f56f9054ccbc2b519f.tar.gz
glibc-84bdcade74b3a57cda9d31f56f9054ccbc2b519f.tar.xz
glibc-84bdcade74b3a57cda9d31f56f9054ccbc2b519f.zip
(_dl_allocate_tls_init): Store dtv pointer at correct index. Clear BSS region now that memalign is used.
Diffstat (limited to 'sysdeps/generic/dl-tls.c')
-rw-r--r--sysdeps/generic/dl-tls.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sysdeps/generic/dl-tls.c b/sysdeps/generic/dl-tls.c
index 2ef69e5abc..887f037879 100644
--- a/sysdeps/generic/dl-tls.c
+++ b/sysdeps/generic/dl-tls.c
@@ -292,11 +292,11 @@ _dl_allocate_tls_init (void *result)
 #  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
 # endif
 
-	  /* We don't have to clear the BSS part of the TLS block
-	     since mmap is used to allocate the memory which
-	     guarantees it is initialized to zero.  */
-	  dtv[cnt].pointer = memcpy (dest, map->l_tls_initimage,
-				     map->l_tls_initimage_size);
+	  /* Copy the initialization image and clear the BSS part.  */
+	  dtv[map->l_tls_modid].pointer = dest;
+	  memset (__mempcpy (dest, map->l_tls_initimage,
+			     map->l_tls_initimage_size), '\0',
+		  map->l_tls_blocksize - map->l_tls_initimage_size);
 	}
 
       total += cnt;