diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-09-12 00:06:34 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-09-12 00:06:34 +0200 |
commit | 5b6b6eb6276af8acb40bd62d28f18b1c3003e5a1 (patch) | |
tree | a3ca4fba1cf8ff7b5daf577b6c314e39b4a4523e | |
parent | 7a4df0aacf25654e5baed2ef3559d961a5c538d7 (diff) | |
parent | df664a147963b28f53eb8f62ba79d98c1739fb74 (diff) |
Merge branch 'master-glibc-2.21' into master-glibc-2.22
-rw-r--r-- | Versions | 1 | ||||
-rw-r--r-- | forward.c | 5 | ||||
-rw-r--r-- | sysdeps/generic/pt-atfork.c | 6 |
3 files changed, 10 insertions, 2 deletions
@@ -20,6 +20,7 @@ libc { GLIBC_PRIVATE { __libc_alloca_cutoff; __libc_pthread_init; + # TODO: expose this publicly __register_atfork; } } @@ -147,6 +147,7 @@ struct atfork { void (*prepare) (void); void (*parent) (void); void (*child) (void); + void *dso_handle; struct atfork *prev; struct atfork *next; }; @@ -219,7 +220,8 @@ int __register_atfork ( void (*prepare) (void), void (*parent) (void), - void (*child) (void)) + void (*child) (void), + void *dso_handle) { struct atfork *new = malloc (sizeof (*new)); if (!new) @@ -228,6 +230,7 @@ __register_atfork ( new->prepare = prepare; new->parent = parent; new->child = child; + new->dso_handle = dso_handle; new->prev = NULL; __mutex_lock (&atfork_lock); diff --git a/sysdeps/generic/pt-atfork.c b/sysdeps/generic/pt-atfork.c index ce72e10..304d7ef 100644 --- a/sysdeps/generic/pt-atfork.c +++ b/sysdeps/generic/pt-atfork.c @@ -20,10 +20,14 @@ #include <pthread.h> #include <pt-internal.h> +/* This is defined by newer gcc version unique for each module. */ +extern void *__dso_handle __attribute__ ((__weak__, + __visibility__ ("hidden"))); + int pthread_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void)) { - return __register_atfork (prepare, parent, child); + return __register_atfork (prepare, parent, child, &__dso_handle == NULL ? NULL : __dso_handle); } |