From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2801 Path: news.gmane.org!not-for-mail From: Jens Gustedt Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH 3/5] identify the weak function symbols that provide a real default action Date: Sat, 16 Feb 2013 00:24:02 +0100 Message-ID: <50a7dfa0d4087c301278e0626cb0780338342dbb.1360968989.git.Jens.Gustedt@inria.fr> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1360970659 6210 80.91.229.3 (15 Feb 2013 23:24:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Feb 2013 23:24:19 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2802-gllmg-musl=m.gmane.org@lists.openwall.com Sat Feb 16 00:24:41 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1U6Udv-0008Re-2f for gllmg-musl@plane.gmane.org; Sat, 16 Feb 2013 00:24:35 +0100 Original-Received: (qmail 11338 invoked by uid 550); 15 Feb 2013 23:24:15 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11327 invoked from network); 15 Feb 2013 23:24:15 -0000 X-IronPort-AV: E=Sophos;i="4.84,675,1355094000"; d="scan'208";a="3112331" In-Reply-To: Resent-From: Jens Gustedt Resent-To: musl@lists.openwall.com Resent-Cc: musl X-Mailer: Evolution 3.2.3-0ubuntu6 Xref: news.gmane.org gmane.linux.lib.musl.general:2801 Archived-At: 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