From 15e995a8fb94a00d76da03756579ae6ff645b161 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 7 Jun 2020 23:29:44 +0000 Subject: htl: Fix registration of atfork handlers in modules We really need modules to use their own pthread_atfork so that __dso_handle properly identifies them. * sysdeps/htl/pt-atfork.c (__pthread_atfork): Hide function. (pthread_atfork): Hide alias. * sysdeps/htl/old_pt-atfork.c (pthread_atfork): Rename macro to __pthread_atfork to fix building the compatibility alias. --- sysdeps/htl/pt-atfork.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sysdeps/htl/pt-atfork.c') diff --git a/sysdeps/htl/pt-atfork.c b/sysdeps/htl/pt-atfork.c index d547dd5..db8068e 100644 --- a/sysdeps/htl/pt-atfork.c +++ b/sysdeps/htl/pt-atfork.c @@ -21,11 +21,21 @@ #include #include +/* Hide the symbol so that no definition but the one locally in the + executable or DSO is used. */ int +#ifndef __pthread_atfork +/* Don't mark the compatibility function as hidden. */ +attribute_hidden +#endif __pthread_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void)) { return __register_atfork (prepare, parent, child, __dso_handle); } +#ifndef __pthread_atfork +extern int pthread_atfork (void (*prepare) (void), void (*parent) (void), + void (*child) (void)) attribute_hidden; weak_alias (__pthread_atfork, pthread_atfork) +#endif -- cgit v1.1