rtld_hidden_def (_dl_allocate_tls)
void
-internal_function
_dl_clear_dtv (dtv_t *dtv)
{
for (size_t cnt = 0; cnt < dtv[-1].counter; ++cnt)
- if (! dtv[1 + cnt].pointer.is_static
+ if (/*! dtv[1 + cnt].pointer.is_static */ 1
&& dtv[1 + cnt].pointer.val != TLS_DTV_UNALLOCATED)
__signal_safe_free (dtv[1 + cnt].pointer.val);
memset (dtv, '\0', (dtv[-1].counter + 1) * sizeof (dtv_t));
the_map = listp->slotinfo[idx].map;
}
-#if 0
sigset_t old;
_dl_mask_all_signals (&old);
reentrancy. */
if (dtv[GET_ADDR_MODULE].pointer.val != TLS_DTV_UNALLOCATED)
{
- assert (dtv[GET_ADDR_MODULE].pointer.val != TLS_DTV_UNALLOCATED);
_dl_unmask_signals (&old);
return (char *) dtv[GET_ADDR_MODULE].pointer.val + GET_ADDR_OFFSET;
offset = the_map->l_tls_offset;
assert (offset != NO_TLS_OFFSET);
}
- #endif
-
- /* Make sure that, if a dlopen running in parallel forces the
- variable into static storage, we'll wait until the address in the
- static TLS block is set up, and use that. If we're undecided
- yet, make sure we make the decision holding the lock as well. */
- if (__glibc_unlikely (the_map->l_tls_offset
- != FORCED_DYNAMIC_TLS_OFFSET))
- {
- __rtld_lock_lock_recursive (GL(dl_load_lock));
- if (__glibc_likely (the_map->l_tls_offset == NO_TLS_OFFSET))
- {
- the_map->l_tls_offset = FORCED_DYNAMIC_TLS_OFFSET;
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
- }
- else if (__glibc_likely (the_map->l_tls_offset
- != FORCED_DYNAMIC_TLS_OFFSET))
- {
-#if TLS_TCB_AT_TP
- void *p = (char *) THREAD_SELF - the_map->l_tls_offset;
-#elif TLS_DTV_AT_TP
- void *p = (char *) THREAD_SELF + the_map->l_tls_offset + TLS_PRE_TCB_SIZE;
-#else
-# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
-#endif
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
-
- dtv[GET_ADDR_MODULE].pointer.to_free = NULL;
- dtv[GET_ADDR_MODULE].pointer.val = p;
- return (char *) p + GET_ADDR_OFFSET;
- }
- else
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
- }
- struct dtv_pointer result = allocate_and_init (the_map);
- dtv[GET_ADDR_MODULE].pointer = result;
- assert (result.to_free != NULL);
-
- return (char *) result.val + GET_ADDR_OFFSET;
-
-#if 0
if (offset == FORCED_DYNAMIC_TLS_OFFSET)
{
allocate_and_init (&dtv[GET_ADDR_MODULE], the_map);
threads to initialize it. They'll eventually write
to pointer.val, at which point we know they've fully
completed initialization. */
- atomic_delay ();
+ atomic_spin_nop ();
}
/* Make sure we've picked up their initialization of the actual
block; this pairs against the write barrier in
_dl_unmask_signals (&old);
return (char *) dtv[GET_ADDR_MODULE].pointer.val + GET_ADDR_OFFSET;
-#endif
}
uint64_t _dl_strtoul (const char *, char **) attribute_hidden;
/* Mask every signal, returning the previous sigmask in OLD. */
-extern void _dl_mask_all_signals (sigset_t *old) internal_function;
+extern void _dl_mask_all_signals (sigset_t *old);
/* Undo _dl_mask_all_signals. */
-extern void _dl_unmask_signals (sigset_t *old) internal_function;
+extern void _dl_unmask_signals (sigset_t *old);
/* Function used as argument for `_dl_receive_error' function. The
arguments are the error code, error string, and the objname the
/* Remove all allocated dynamic TLS regions from a DTV
for reuse by new thread. */
-extern void _dl_clear_dtv (dtv_t *dtv) internal_function;
+extern void _dl_clear_dtv (dtv_t *dtv);
rtld_hidden_proto (_dl_clear_dtv)
extern void *__signal_safe_memalign (size_t boundary, size_t size);