summaryrefslogtreecommitdiff
path: root/libexec/ld.so/alpha
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-05-07 19:05:25 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-05-07 19:05:25 +0000
commitbe4e94637d7117375492627b79c41629c7da9bc3 (patch)
tree61a9fabcc07d38d2720bbb937e83103928286550 /libexec/ld.so/alpha
parent33d8693716b4a6d503e0ba97f94a783905b87f28 (diff)
Use a Thread Information Block in both single and multi-threaded programs.
This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable! Make libpthread dlopen'able by moving the cancelation wrappers into libc and doing locking and fork/errno handling via callbacks that libpthread registers when it first initializes. 'errno' *must* be declared via <errno.h> now! Clean up libpthread's symbol exports like libc. On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec. Testing by various, particularly sthen@ and patrick@ ok kettenis@
Diffstat (limited to 'libexec/ld.so/alpha')
-rw-r--r--libexec/ld.so/alpha/ldasm.S4
-rw-r--r--libexec/ld.so/alpha/syscall.h4
2 files changed, 6 insertions, 2 deletions
diff --git a/libexec/ld.so/alpha/ldasm.S b/libexec/ld.so/alpha/ldasm.S
index f71de97c74d..952b0c7e174 100644
--- a/libexec/ld.so/alpha/ldasm.S
+++ b/libexec/ld.so/alpha/ldasm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldasm.S,v 1.34 2016/03/21 22:41:28 bluhm Exp $ */
+/* $OpenBSD: ldasm.S,v 1.35 2016/05/07 19:05:23 guenther Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
@@ -317,6 +317,7 @@ DL_SYSCALL(sendsyslog)
DL_SYSCALL(pledge)
DL_SYSCALL(gettimeofday)
DL_SYSCALL_NOERR(issetugid)
+DL_SYSCALL_NOERR(getthrid)
DL_SYSCALL(lstat)
DL_SYSCALL(mprotect)
DL_SYSCALL(munmap)
@@ -324,6 +325,7 @@ DL_SYSCALL(open)
DL_SYSCALL(read)
DL_SYSCALL(readlink)
DL_SYSCALL2(_syscall,__syscall)
+DL_SYSCALL2_NOERR(set_tcb,__set_tcb)
DL_SYSCALL(sysctl)
DL_SYSCALL(utrace)
DL_SYSCALL(write)
diff --git a/libexec/ld.so/alpha/syscall.h b/libexec/ld.so/alpha/syscall.h
index df364c4715e..8005b3e3307 100644
--- a/libexec/ld.so/alpha/syscall.h
+++ b/libexec/ld.so/alpha/syscall.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall.h,v 1.32 2016/03/21 22:41:28 bluhm Exp $ */
+/* $OpenBSD: syscall.h,v 1.33 2016/05/07 19:05:23 guenther Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
@@ -41,6 +41,7 @@ int _dl_close(int);
__dead
int _dl_exit(int);
int _dl_issetugid(void);
+int _dl_getthrid(void);
void * _dl_mmap(void *, size_t, int, int, int, off_t);
int _dl_mprotect(const void *, size_t, int);
int _dl_munmap(const void *, size_t);
@@ -58,6 +59,7 @@ int _dl_getcwd(char *, size_t);
int _dl_utrace(const char *, const void *, size_t);
int _dl_getentropy(char *, size_t);
int _dl_sendsyslog(const char *, size_t, int);
+void _dl_set_tcb(void *);
static inline off_t
_dl_lseek(int fildes, off_t offset, int whence)