about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-09-12 09:15:22 +0000
committerRoland McGrath <roland@gnu.org>2002-09-12 09:15:22 +0000
commit75aafc716bfcf989abc986c68d506e8a4f991ade (patch)
tree58ffa005d758692cedd1d11ab2b8d42976e43f89 /elf
parentfb848e15854db60732536c0767ad529b6206311c (diff)
downloadglibc-75aafc716bfcf989abc986c68d506e8a4f991ade.tar.gz
glibc-75aafc716bfcf989abc986c68d506e8a4f991ade.tar.xz
glibc-75aafc716bfcf989abc986c68d506e8a4f991ade.zip
* elf/rtld.c (dl_main) [USE_TLS]: Adjust l_tls_initimage of main
	executable if needed, in case it's actually a shared object.
Diffstat (limited to 'elf')
-rw-r--r--elf/rtld.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 273926ef53..22aa48543a 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -832,6 +832,13 @@ of this helper program; chances are you did not intend to run this program.\n\
 	break;
 #endif
       }
+#ifdef USE_TLS
+    /* Adjust the address of the TLS initialization image in case
+       the executable is actually an ET_DYN object.  */
+    if (GL(dl_loaded)->l_tls_initimage != NULL)
+      GL(dl_loaded)->l_tls_initimage
+	= (char *) GL(dl_loaded)->l_tls_initimage + GL(dl_loaded)->l_addr;
+#endif
   if (! GL(dl_loaded)->l_map_end)
     GL(dl_loaded)->l_map_end = ~0;
   if (! GL(dl_rtld_map).l_libname && GL(dl_rtld_map).l_name)