mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
nptl: Remove remnants of the libc/libpthread forwarder interface
All previously forwarded functions are now implemented in libc. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
@ -35,38 +35,11 @@ extern int __libc_multiple_threads attribute_hidden;
|
||||
|
||||
int *
|
||||
#endif
|
||||
__libc_pthread_init (void (*reclaim) (void),
|
||||
const struct pthread_functions *functions)
|
||||
__libc_pthread_init (void (*reclaim) (void))
|
||||
{
|
||||
/* Called by a child after fork. */
|
||||
__register_atfork (NULL, NULL, reclaim, NULL);
|
||||
|
||||
#ifdef SHARED
|
||||
/* Copy the function pointers into an array in libc. This enables
|
||||
access with just one memory reference but moreso, it prevents
|
||||
hijacking the function pointers with just one pointer change. We
|
||||
"encrypt" the function pointers since we cannot write-protect the
|
||||
array easily enough. */
|
||||
union ptrhack
|
||||
{
|
||||
struct pthread_functions pf;
|
||||
# define NPTRS (sizeof (struct pthread_functions) / sizeof (void *))
|
||||
void *parr[NPTRS];
|
||||
} __attribute__ ((may_alias)) const *src;
|
||||
union ptrhack *dest;
|
||||
|
||||
src = (const void *) functions;
|
||||
dest = (void *) &__libc_pthread_functions;
|
||||
|
||||
for (size_t cnt = 0; cnt < NPTRS; ++cnt)
|
||||
{
|
||||
void *p = src->parr[cnt];
|
||||
PTR_MANGLE (p);
|
||||
dest->parr[cnt] = p;
|
||||
}
|
||||
__libc_pthread_functions_init = 1;
|
||||
#endif
|
||||
|
||||
#ifndef TLS_MULTIPLE_THREADS_IN_TCB
|
||||
return &__libc_multiple_threads;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user