]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2005-02-21 Alan Modra <amodra@bigpond.net.au>
authorRoland McGrath <roland@gnu.org>
Sat, 26 Feb 2005 01:09:47 +0000 (01:09 +0000)
committerRoland McGrath <roland@gnu.org>
Sat, 26 Feb 2005 01:09:47 +0000 (01:09 +0000)
[BZ #719]
* elf/dl-reloc.c (_dl_nothread_init_static_tls): Assert that dtv
array index is within bounds.
2005-02-21  Ulrich Drepper  <drepper@redhat.com>

[BZ #719]
* elf/dl-reloc.c (_dl_nothread_init_static_tls): Avoid using
THREAD_DTV multiple times, this minimally reduces code size on
some archs.

elf/dl-reloc.c

index 4004316c5a3e5fa49b8011a194bd7b83ca9eb8d5..893b3c954a07da7e2dfb858f8dab8637782666dd 100644 (file)
@@ -114,7 +114,9 @@ _dl_nothread_init_static_tls (struct link_map *map)
 # endif
 
   /* Fill in the DTV slot so that a later LD/GD access will find it.  */
-  THREAD_DTV ()[map->l_tls_modid].pointer = dest;
+  dtv_t *dtv = THREAD_DTV ();
+  assert (map->l_tls_modid <= dtv[-1].counter);
+  dtv[map->l_tls_modid].pointer = dest;
 
   /* Initialize the memory.  */
   memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),