|
Message-Id: <50a7dfa0d4087c301278e0626cb0780338342dbb.1360968989.git.Jens.Gustedt@inria.fr> Date: Sat, 16 Feb 2013 00:24:02 +0100 From: Jens Gustedt <Jens.Gustedt@...ia.fr> To: musl@...ts.openwall.com Subject: [PATCH 3/5] identify the weak function symbols that provide a real default action 2 0 src/internal/libc.h 2 2 src/signal/sigaction.c 2 3 src/thread/cancel_dummy.c 2 2 src/time/timer_create.c diff --git a/src/internal/libc.h b/src/internal/libc.h index a2f36fb..a097a66 100644 --- a/src/internal/libc.h +++ b/src/internal/libc.h @@ -67,6 +67,8 @@ extern char **__environ; #define _Readonly_alias extern __attribute__((__weak__,__alias__("__readonly_dummy"))) +#define _Weak extern __attribute__((__weak__)) + #undef weak_alias #define weak_alias(old, new) \ extern __typeof(old) new __attribute__((weak, alias(#old))) diff --git a/src/signal/sigaction.c b/src/signal/sigaction.c index 7a72a44..ff7ac81 100644 --- a/src/signal/sigaction.c +++ b/src/signal/sigaction.c @@ -9,8 +9,8 @@ void __restore(), __restore_rt(); -static pthread_t dummy(void) { return 0; } -weak_alias(dummy, __pthread_self_def); +_Weak +pthread_t __pthread_self_def(void) { return 0; } int __libc_sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old) { diff --git a/src/thread/cancel_dummy.c b/src/thread/cancel_dummy.c index 047692c..7246970 100644 --- a/src/thread/cancel_dummy.c +++ b/src/thread/cancel_dummy.c @@ -1,12 +1,11 @@ #include "pthread_impl.h" -static long sccp(long nr, long u, long v, long w, long x, long y, long z) +_Weak +long (__syscall_cp)(long nr, long u, long v, long w, long x, long y, long z) { return (__syscall)(nr, u, v, w, x, y, z); } -weak_alias(sccp, __syscall_cp); - static void dummy() { } diff --git a/src/time/timer_create.c b/src/time/timer_create.c index 60a18c7..0e00baf 100644 --- a/src/time/timer_create.c +++ b/src/time/timer_create.c @@ -14,10 +14,10 @@ struct start_args { struct sigevent *sev; }; -static void dummy_1(pthread_t self) +_Weak +void __pthread_tsd_run_dtors(pthread_t self) { } -weak_alias(dummy_1, __pthread_tsd_run_dtors); static void cleanup_fromsig(void *p) { -- 1.7.9.5
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.