From 9655389317c92e5935c47d90c0ba48ca54bd245e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 28 Jul 2009 21:58:32 -0700 Subject: Fix bookkeeping of static TLS block for TLS_TCB_AT_TP architectures. --- elf/dl-reloc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'elf') diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c index 28f08de3e7..680caadd65 100644 --- a/elf/dl-reloc.c +++ b/elf/dl-reloc.c @@ -61,7 +61,10 @@ _dl_try_allocate_static_tls (struct link_map *map) size_t n; size_t blsize; - freebytes = GL(dl_tls_static_size) - GL(dl_tls_static_used) - TLS_TCB_SIZE; + freebytes = GL(dl_tls_static_size) - GL(dl_tls_static_used); + if (freebytes < TLS_TCB_SIZE) + goto fail; + freebytes -= TLS_TCB_SIZE; blsize = map->l_tls_blocksize + map->l_tls_firstbyte_offset; if (freebytes < blsize) -- cgit v1.2.3