about summary refs log tree commit diff
path: root/src/thread/pthread_testcancel.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-07-06 22:56:25 -0400
committerRich Felker <dalias@aerifal.cx>2014-07-06 22:56:25 -0400
commitd96b12b755483208673fb05e2e60a15d3822752d (patch)
tree1a8eac2308bc9348b23417a462a271570d1ceea3 /src/thread/pthread_testcancel.c
parentea496d6c63ecbb5ea475111808e5c0f799354450 (diff)
downloadmusl-d96b12b755483208673fb05e2e60a15d3822752d.tar.gz
musl-d96b12b755483208673fb05e2e60a15d3822752d.tar.xz
musl-d96b12b755483208673fb05e2e60a15d3822752d.zip
rework cancellation weak alias logic not to depend on archive order
if the order of object files in the static archive libc.a was not
respected by the linker, the old logic could wrongly cause POSIX
symbols outside of the ISO C namespace to be pulled into pure C
programs. this should not happen with well-behaved linkers, but
relying on the link order was a bad idea anyway.

files are renamed to better reflect their contents now that they don't
need names to control their order as members in the archive file.
Diffstat (limited to 'src/thread/pthread_testcancel.c')
-rw-r--r--src/thread/pthread_testcancel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/thread/pthread_testcancel.c b/src/thread/pthread_testcancel.c
index 33238c0f..ba5f7c6c 100644
--- a/src/thread/pthread_testcancel.c
+++ b/src/thread/pthread_testcancel.c
@@ -1,6 +1,11 @@
 #include "pthread_impl.h"
+#include "libc.h"
 
-void __testcancel(void);
+static void dummy()
+{
+}
+
+weak_alias(dummy, __testcancel);
 
 void pthread_testcancel()
 {