diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-02-05 08:25:04 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-02-05 08:25:04 +0000 |
commit | a2f1f5cb89a809e819b64bb9819b845f7c234ae2 (patch) | |
tree | 1fcca336b3a5062df625e0b64976b8098f9a25d0 | |
parent | 5d6feea8f54fe67cbeb7c35e35539b2efd4ead29 (diff) | |
download | glibc-a2f1f5cb89a809e819b64bb9819b845f7c234ae2.zip glibc-a2f1f5cb89a809e819b64bb9819b845f7c234ae2.tar.gz glibc-a2f1f5cb89a809e819b64bb9819b845f7c234ae2.tar.bz2 |
Update.
2002-02-05 Ulrich Drepper <drepper@redhat.com>
* elf/rtld.c (dl_main): Read PT_TLS entry of the executable.
* sysdeps/generic/ldsodefs.h (struct rtld_global): Add
_dl_tls_module_cnt.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | elf/rtld.c | 19 | ||||
-rw-r--r-- | sysdeps/generic/ldsodefs.h | 3 |
3 files changed, 28 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2002-02-05 Ulrich Drepper <drepper@redhat.com> + + * elf/rtld.c (dl_main): Read PT_TLS entry of the executable. + * sysdeps/generic/ldsodefs.h (struct rtld_global): Add + _dl_tls_module_cnt. + 2002-02-04 Ulrich Drepper <drepper@redhat.com> * elf/rtld.c (_dl_start): Fill TLS values in link map for rtld. @@ -708,6 +708,25 @@ of this helper program; chances are you did not intend to run this program.\n\ GL(dl_loaded)->l_map_end = allocend; } break; +#ifdef USE_TLS + case PT_TLS: + /* Note that in the case the dynamic linker we duplicate work + here since we read the PT_TLS entry already in + _dl_start_final. But the result is repeatable so do not + check for this special but unimportant case. */ + GL(dl_loaded)->l_tls_blocksize = ph->p_memsz; + GL(dl_loaded)->l_tls_initimage_size = ph->p_filesz; + GL(dl_loaded)->l_tls_initimage = (void *) (GL(dl_loaded)->l_addr + + ph->p_offset); + /* This is the first element of the initialization image list. + It is created as a circular list so that we can easily + append to it. */ + GL(dl_initimage_list) = GL(dl_loaded)->l_tls_nextimage = GL(dl_loaded); + + /* This image get the ID one. */ + GL(dl_tls_module_cnt) = GL(dl_loaded)->l_tls_modid = 1; + break; +#endif } if (! GL(dl_loaded)->l_map_end) GL(dl_loaded)->l_map_end = ~0; diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 4e4fecf..75f82bd 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -292,6 +292,9 @@ struct rtld_global thread-local storage sections. This will be traversed to initialize new TLS blocks. */ EXTERN struct link_map *_dl_initimage_list; + + /* Count the number of modules which define TLS data. */ + EXTERN size_t _dl_tls_module_cnt; #endif /* Name of the shared object to be profiled (if any). */ |