mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
2002-11-03 Roland McGrath <roland@redhat.com>
* sysdeps/generic/ldsodefs.h (struct rtld_global): New member `_dl_tls_static_used'. * sysdeps/generic/libc-tls.c (_dl_tls_static_used): New variable. (__libc_setup_tls): Initialize it. Let the initial value of _dl_tls_static_size indicate some surplus space in the computed value. * elf/dl-open.c (_dl_tls_static_size): New variable. * sysdeps/generic/dl-tls.c (_dl_determine_tlsoffset): Initialize _dl_tls_static_used. Add some surplus space into _dl_tls_static_size. * elf/dl-reloc.c [USE_TLS] (allocate_static_tls): New function. (CHECK_STATIC_TLS): Use it. * elf/dl-close.c (_dl_close): Adjust _dl_tls_static_used when the closed objects occupied a trailing contiguous chunk of static TLS area.
This commit is contained in:
@ -182,12 +182,17 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
|
||||
GL(dl_tls_max_dtv_idx) = 1;
|
||||
GL(dl_tls_dtv_slotinfo_list) = &static_slotinfo.si;
|
||||
|
||||
/* That is the size of the TLS memory for this object. */
|
||||
GL(dl_tls_static_size) = (roundup (memsz, align ?: 1)
|
||||
memsz = roundup (memsz, align ?: 1);
|
||||
# if TLS_TCB_AT_TP
|
||||
+ tcbsize
|
||||
memsz += tcbsize;
|
||||
# endif
|
||||
);
|
||||
|
||||
/* That is the size of the TLS memory for this object. The initialized
|
||||
value of _dl_tls_static_size is provided by dl-open.c to request some
|
||||
surplus that permits dynamic loading of modules with IE-model TLS. */
|
||||
GL(dl_tls_static_size) = roundup (memsz + GL(dl_tls_static_size),
|
||||
TLS_TCB_ALIGN);
|
||||
GL(dl_tls_static_used) = memsz;
|
||||
/* The alignment requirement for the static TLS block. */
|
||||
GL(dl_tls_static_align) = MAX (TLS_TCB_ALIGN, max_align);
|
||||
/* Number of elements in the static TLS block. */
|
||||
|
Reference in New Issue
Block a user