From: Jens Gustedt <Jens.Gustedt@inria.fr>
To: musl@lists.openwall.com
Subject: [PATCH 3/5] identify the weak function symbols that provide a real default action
Date: Sat, 16 Feb 2013 00:24:02 +0100 [thread overview]
Message-ID: <50a7dfa0d4087c301278e0626cb0780338342dbb.1360968989.git.Jens.Gustedt@inria.fr> (raw)
In-Reply-To: <cover.1360968989.git.Jens.Gustedt@inria.fr>
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
next prev parent reply other threads:[~2013-02-15 23:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-15 23:22 [PATCH 0/5] reorganize the use of weak symbols Jens Gustedt
2013-02-15 23:23 ` [PATCH 1/5] Clearly identify the readonly replacement symbols that serve as 'dummies' that could (or could not) be provided by other compilation units Jens Gustedt
2013-02-15 23:23 ` [PATCH 2/5] Clarify the implementation of the dummy alias used for pthread_self Jens Gustedt
2013-02-15 23:24 ` Jens Gustedt [this message]
2013-02-15 23:24 ` [PATCH 4/5] add three macros for empty dummy functions that do nothing Jens Gustedt
2013-02-15 23:25 ` [PATCH 5/5] Use the weak functions that do nothing as aliases for the default actions Jens Gustedt
2013-02-16 5:59 ` [PATCH 0/5] reorganize the use of weak symbols Rich Felker
2013-02-16 8:16 ` Jens Gustedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50a7dfa0d4087c301278e0626cb0780338342dbb.1360968989.git.Jens.Gustedt@inria.fr \
--to=jens.gustedt@inria.fr \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).