summaryrefslogtreecommitdiff
path: root/lib/libc/arch/sparc64
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/sparc64
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/sparc64')
-rw-r--r--lib/libc/arch/sparc64/SYS.h18
-rw-r--r--lib/libc/arch/sparc64/sys/fork.S5
2 files changed, 17 insertions, 6 deletions
diff --git a/lib/libc/arch/sparc64/SYS.h b/lib/libc/arch/sparc64/SYS.h
index f47a4d47da7..3f934da0323 100644
--- a/lib/libc/arch/sparc64/SYS.h
+++ b/lib/libc/arch/sparc64/SYS.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: SYS.h,v 1.11 2014/06/04 20:13:49 matthew Exp $ */
+/* $OpenBSD: SYS.h,v 1.12 2015/04/07 01:27:07 guenther Exp $ */
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -43,7 +43,8 @@
#define _CAT(x,y) x##y
-#define __ENTRY(p,x) ENTRY(_CAT(p,x)) ; .weak x; x = _CAT(p,x)
+#define __ENTRY(p,x) ENTRY(_CAT(p,x)) ; .weak x; x = _CAT(p,x)
+#define __ENTRY_HIDDEN(p,x) ENTRY(_CAT(p,x))
/*
* ERROR branches to cerror. This is done with a macro so that I can
@@ -71,18 +72,26 @@
*/
#define _SYSCALL(p,x,y) \
__ENTRY(p,x); mov _CAT(SYS_,y),%g1; t ST_SYSCALL; bcc 1f; nop; ERROR(); 1:
+#define _SYSCALL_HIDDEN(p,x,y) \
+ __ENTRY_HIDDEN(p,x); mov _CAT(SYS_,y),%g1; t ST_SYSCALL; bcc 1f; nop; ERROR(); 1:
#define __SYSCALL(p,x) \
_SYSCALL(p,x,x)
+#define __SYSCALL_HIDDEN(p,x) \
+ _SYSCALL_HIDDEN(p,x,x)
+
/*
* RSYSCALL is used when the system call should just return. Here
* we use the SYSCALL_G2RFLAG to put the `success' return address in %g2
* and avoid a branch.
*/
#define __RSYSCALL(p,x) \
- __ENTRY(p,x); mov (_CAT(SYS_,x))|SYSCALL_G2RFLAG,%g1; add %o7,8,%g2; \
- t ST_SYSCALL; ERROR()
+ __ENTRY(p,x); mov (_CAT(SYS_,x))|SYSCALL_G2RFLAG,%g1; \
+ add %o7,8,%g2; t ST_SYSCALL; ERROR()
+#define __RSYSCALL_HIDDEN(p,x) \
+ __ENTRY_HIDDEN(p,x); mov (_CAT(SYS_,x))|SYSCALL_G2RFLAG,%g1; \
+ add %o7,8,%g2; t ST_SYSCALL; ERROR()
/*
* PSEUDO(x,y) is like RSYSCALL(y) except that the name is x.
@@ -126,6 +135,7 @@
#define SYSCALL(x) __SYSCALL(_thread_sys_,x)
#define RSYSCALL(x) __RSYSCALL(_thread_sys_,x)
+#define RSYSCALL_HIDDEN(x) __RSYSCALL_HIDDEN(_thread_sys_,x)
#define RSYSCALL_NOERROR(x,y) __RSYSCALL_NOERROR(_thread_sys_,x,y)
#define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y)
#define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(_thread_sys_,x,y)
diff --git a/lib/libc/arch/sparc64/sys/fork.S b/lib/libc/arch/sparc64/sys/fork.S
index ffb32b62ad0..f432448d4ad 100644
--- a/lib/libc/arch/sparc64/sys/fork.S
+++ b/lib/libc/arch/sparc64/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.3 2015/03/31 04:32:02 guenther Exp $ */
+/* $OpenBSD: fork.S,v 1.4 2015/04/07 01:27:07 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -37,4 +37,5 @@
#include "SYS.h"
-RSYSCALL(fork)
+RSYSCALL_HIDDEN(fork)
+WEAK_ALIAS(_thread_fork,_thread_sys_fork)