summaryrefslogtreecommitdiff
path: root/sysdeps/generic/pt-atfork.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-09-11 23:56:38 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-09-11 23:56:38 +0200
commit7ad3fdec85ef0b37d2ee1c69c5659d5ebe93f909 (patch)
treeec5f8ff98164067f93449d465bf66e10ed84005d /sysdeps/generic/pt-atfork.c
parentc249ebd84f971b158a1a0521bbf7e1261a145755 (diff)
Add dso_handle parameter to __register_atfork
* forward.c (struct atfork): Add dso_handle field. (__register_atfork): Add dso_handle parameter. Store it it dso_handle field. * sysdeps/generic/pt-atfork.c (__dso_handle): New variable. (pthread_atfork): Pass address of __dso_handle to __register_atfork.
Diffstat (limited to 'sysdeps/generic/pt-atfork.c')
-rw-r--r--sysdeps/generic/pt-atfork.c6
1 files changed, 5 insertions, 1 deletions
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);
}