summaryrefslogtreecommitdiff
path: root/lib/libc/arch/arm
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-04-07 01:27:08 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-04-07 01:27:08 +0000
commit88c62139002b1fec001c04b3594a04d1bbfb1342 (patch)
tree0509c1476b98d3b86a67ed3837dd2dd5f29944de /lib/libc/arch/arm
parent1e37072b7b75ac23dc21e9d893b197aab716875c (diff)
Make pthread_atfork() track the DSO that called it like atexit() does,
unregistering callbacks if the DSO is unloaded. Move the callback handling from libpthread to libc, though libpthread still overrides the inner call to handle locking and thread-library reinitialization. Major version bump for both libc and libpthread. verification that this fixes various ports ajacoutot@ asm assistance miod@; ok millert@ deraadt@
Diffstat (limited to 'lib/libc/arch/arm')
-rw-r--r--lib/libc/arch/arm/SYS.h15
-rw-r--r--lib/libc/arch/arm/sys/fork.S5
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/libc/arch/arm/SYS.h b/lib/libc/arch/arm/SYS.h
index c6cfdbc4fcd..2fb7c3a91ba 100644
--- a/lib/libc/arch/arm/SYS.h
+++ b/lib/libc/arch/arm/SYS.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: SYS.h,v 1.8 2015/03/31 12:31:19 jsing Exp $ */
+/* $OpenBSD: SYS.h,v 1.9 2015/04/07 01:27:06 guenther Exp $ */
/* $NetBSD: SYS.h,v 1.8 2003/08/07 16:42:02 agc Exp $ */
/*-
@@ -42,6 +42,8 @@
.weak _C_LABEL(x); \
_C_LABEL(x) = _C_LABEL(_thread_sys_ ## x); \
ENTRY(_thread_sys_ ## x)
+#define SYSENTRY_HIDDEN(x) \
+ ENTRY(_thread_sys_ ## x)
#define SYSTRAP(x) \
ldr r12, =SYS_ ## x; \
@@ -54,10 +56,16 @@
#define _SYSCALL_NOERROR(x,y) \
SYSENTRY(x); \
SYSTRAP(y)
+#define _SYSCALL_HIDDEN_NOERROR(x,y) \
+ SYSENTRY_HIDDEN(x); \
+ SYSTRAP(y)
#define _SYSCALL(x, y) \
_SYSCALL_NOERROR(x,y); \
bcs PIC_SYM(CERROR, PLT)
+#define _SYSCALL_HIDDEN(x, y) \
+ _SYSCALL_HIDDEN_NOERROR(x,y); \
+ bcs PIC_SYM(CERROR, PLT)
#define SYSCALL_NOERROR(x) \
_SYSCALL_NOERROR(x,x)
@@ -73,6 +81,9 @@
#define PSEUDO(x,y) \
_SYSCALL(x,y); \
mov r15, r14
+#define PSEUDO_HIDDEN(x,y) \
+ _SYSCALL_HIDDEN(x,y); \
+ mov r15, r14
#define RSYSCALL_NOERROR(x) \
@@ -80,5 +91,7 @@
#define RSYSCALL(x) \
PSEUDO(x,x)
+#define RSYSCALL_HIDDEN(x) \
+ PSEUDO_HIDDEN(x,x)
.globl CERROR
diff --git a/lib/libc/arch/arm/sys/fork.S b/lib/libc/arch/arm/sys/fork.S
index 9836d80a975..8d92b286369 100644
--- a/lib/libc/arch/arm/sys/fork.S
+++ b/lib/libc/arch/arm/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.3 2015/03/31 04:32:01 guenther Exp $ */
+/* $OpenBSD: fork.S,v 1.4 2015/04/07 01:27:06 guenther Exp $ */
/* $NetBSD: fork.S,v 1.5 2003/08/07 16:42:04 agc Exp $ */
/*-
@@ -34,4 +34,5 @@
#include "SYS.h"
-RSYSCALL(fork)
+RSYSCALL_HIDDEN(fork)
+WEAK_ALIAS(_thread_fork,_thread_sys_fork)