about summary refs log tree commit diff
path: root/sysdeps/generic
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/dl-tls.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sysdeps/generic/dl-tls.c b/sysdeps/generic/dl-tls.c
index 38f40ac8ae..c969464449 100644
--- a/sysdeps/generic/dl-tls.c
+++ b/sysdeps/generic/dl-tls.c
@@ -212,11 +212,9 @@ allocate_dtv (void *result)
     {
       /* This is the initial length of the dtv.  */
       dtv[0].counter = dtv_length;
-      /* Fill in the generation number.  */
-      dtv[1].counter = GL(dl_tls_generation) = 0;
-      /* Initialize all of the rest of the dtv with zero to indicate
-	 nothing there.  */
-      memset (dtv + 2, '\0', dtv_length * sizeof (dtv_t));
+      /* Initialize all of the rest of the dtv (including the
+	 generation counter) with zero to indicate nothing there.  */
+      memset (dtv + 1, '\0', (dtv_length + 1) * sizeof (dtv_t));
 
       /* Add the dtv to the thread data structures.  */
       INSTALL_DTV (result, dtv);