[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.
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
& ~(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. */