From: Ulrich Drepper Date: Tue, 6 Aug 2002 00:51:51 +0000 (+0000) Subject: (_dl_allocate_tls_init): Store dtv pointer at correct index. Clear BSS region now... X-Git-Tag: upstream/2.20~14492 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84bdcade74b3a57cda9d31f56f9054ccbc2b519f;p=platform%2Fupstream%2Flinaro-glibc.git (_dl_allocate_tls_init): Store dtv pointer at correct index. Clear BSS region now that memalign is used. --- diff --git a/sysdeps/generic/dl-tls.c b/sysdeps/generic/dl-tls.c index 2ef69e5..887f037 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;