From: Roland McGrath Date: Sat, 26 Feb 2005 01:09:44 +0000 (+0000) Subject: 2005-02-22 Ulrich Drepper X-Git-Tag: cvs/glibc-2_3_5~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b258b905b56c9f4190a4103fd509db3f2b2c1a1e;p=thirdparty%2Fglibc.git 2005-02-22 Ulrich Drepper [BZ #719] * sysdeps/generic/libc-tls.c (static_dtv): Size the same as the slotinfo array. (__libc_setup_tls): Initialize length of DTV based on array length. * elf/dl-load.c: Revert last change. * sysdeps/generic/dl-tls.c: Revert last change. --- diff --git a/sysdeps/generic/libc-tls.c b/sysdeps/generic/libc-tls.c index b5ecc364368..29d9d1e7ea1 100644 --- a/sysdeps/generic/libc-tls.c +++ b/sysdeps/generic/libc-tls.c @@ -34,8 +34,7 @@ extern ElfW(Phdr) *_dl_phdr; extern size_t _dl_phnum; -/* DTV with just one element plus overhead. */ -static dtv_t static_dtv[3]; +static dtv_t static_dtv[2 + TLS_SLOTINFO_SURPLUS]; static struct @@ -173,7 +172,7 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign) & ~(max_align - 1)); /* Initialize the dtv. [0] is the length, [1] the generation counter. */ - static_dtv[0].counter = 1; + static_dtv[0].counter = (sizeof (static_dtv) / sizeof (static_dtv[0])) - 2; // static_dtv[1].counter = 0; would be needed if not already done /* Initialize the TLS block. */