about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-07-28 21:58:32 -0700
committerUlrich Drepper <drepper@redhat.com>2009-07-28 21:58:32 -0700
commit9655389317c92e5935c47d90c0ba48ca54bd245e (patch)
tree0a083bd6f315f83ff3a269fbbd9b55b82996f745 /elf
parentb0948ffdcbdace63317297d3d3fe2556387dfcbd (diff)
downloadglibc-9655389317c92e5935c47d90c0ba48ca54bd245e.tar.gz
glibc-9655389317c92e5935c47d90c0ba48ca54bd245e.tar.xz
glibc-9655389317c92e5935c47d90c0ba48ca54bd245e.zip
Fix bookkeeping of static TLS block for TLS_TCB_AT_TP architectures.
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-reloc.c5
1 files changed, 4 insertions, 1 deletions
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)