1
0
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:
Florian Weimer
2021-04-21 19:49:51 +02:00
parent 486010a3c8
commit 1d67cf9e8a
7 changed files with 10 additions and 147 deletions

View File

@ -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