diff options
author | guenther <> | 2016-05-07 19:05:22 +0000 |
---|---|---|
committer | guenther <> | 2016-05-07 19:05:22 +0000 |
commit | 73eeb757dad6123971edda029d185e4daa632c91 (patch) | |
tree | de4cc654271dece5f2ef0ce9a271e9cafcb14570 /src/lib/libc/include/namespace.h | |
parent | 133d75e6cf272462fba6e4eb561f949d0c12e01f (diff) | |
download | openbsd-73eeb757dad6123971edda029d185e4daa632c91.tar.gz openbsd-73eeb757dad6123971edda029d185e4daa632c91.tar.bz2 openbsd-73eeb757dad6123971edda029d185e4daa632c91.zip |
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 'src/lib/libc/include/namespace.h')
-rw-r--r-- | src/lib/libc/include/namespace.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libc/include/namespace.h b/src/lib/libc/include/namespace.h index 16d524f666..980c1a8dd6 100644 --- a/src/lib/libc/include/namespace.h +++ b/src/lib/libc/include/namespace.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: namespace.h,v 1.9 2016/04/05 04:28:32 guenther Exp $ */ | 1 | /* $OpenBSD: namespace.h,v 1.10 2016/05/07 19:05:22 guenther Exp $ */ |
2 | 2 | ||
3 | #ifndef _LIBC_NAMESPACE_H_ | 3 | #ifndef _LIBC_NAMESPACE_H_ |
4 | #define _LIBC_NAMESPACE_H_ | 4 | #define _LIBC_NAMESPACE_H_ |
@@ -139,12 +139,14 @@ | |||
139 | #define CANCEL(x) _libc_##x##_cancel | 139 | #define CANCEL(x) _libc_##x##_cancel |
140 | #define WRAP(x) _libc_##x##_wrap | 140 | #define WRAP(x) _libc_##x##_wrap |
141 | #define HIDDEN_STRING(x) "_libc_" __STRING(x) | 141 | #define HIDDEN_STRING(x) "_libc_" __STRING(x) |
142 | #define CANCEL_STRING(x) "_libc_" __STRING(x) "_cancel" | ||
142 | #define WRAP_STRING(x) "_libc_" __STRING(x) "_wrap" | 143 | #define WRAP_STRING(x) "_libc_" __STRING(x) "_wrap" |
143 | 144 | ||
144 | #define PROTO_NORMAL(x) __dso_hidden typeof(x) x asm(HIDDEN_STRING(x)) | 145 | #define PROTO_NORMAL(x) __dso_hidden typeof(x) x asm(HIDDEN_STRING(x)) |
145 | #define PROTO_STD_DEPRECATED(x) typeof(x) x __attribute__((deprecated)) | 146 | #define PROTO_STD_DEPRECATED(x) typeof(x) x __attribute__((deprecated)) |
146 | #define PROTO_DEPRECATED(x) typeof(x) x __attribute__((deprecated, weak)) | 147 | #define PROTO_DEPRECATED(x) typeof(x) x __attribute__((deprecated, weak)) |
147 | #define PROTO_CANCEL(x) PROTO_NORMAL(x), CANCEL(x) | 148 | #define PROTO_CANCEL(x) __dso_hidden typeof(x) HIDDEN(x), \ |
149 | x asm(CANCEL_STRING(x)) | ||
148 | #define PROTO_WRAP(x) PROTO_NORMAL(x), WRAP(x) | 150 | #define PROTO_WRAP(x) PROTO_NORMAL(x), WRAP(x) |
149 | 151 | ||
150 | #define DEF_STRONG(x) __strong_alias(x, HIDDEN(x)) | 152 | #define DEF_STRONG(x) __strong_alias(x, HIDDEN(x)) |