diff options
author | 2018-01-18 08:23:44 +0000 | |
---|---|---|
committer | 2018-01-18 08:23:44 +0000 | |
commit | ae3cb403620ab940fbaabb3055fac045a63d56b7 (patch) | |
tree | c9675235761df3e321bc80b853144e5c9788dfbc /lib/libc/include | |
parent | Unlike other archs, mips64 needs ld.so to know about symbol visibility and (diff) | |
download | wireguard-openbsd-ae3cb403620ab940fbaabb3055fac045a63d56b7.tar.xz wireguard-openbsd-ae3cb403620ab940fbaabb3055fac045a63d56b7.zip |
Instead of trying to handle ffs() with the normal rename-mark-hidden-and-alias
dance, mark it protected. This works better for both gcc and clang: gcc
blocks overriding of internal calls, while clang permits inlining again.
ok otto@
Diffstat (limited to 'lib/libc/include')
-rw-r--r-- | lib/libc/include/namespace.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h index 73b845e10f1..60766afc0b9 100644 --- a/lib/libc/include/namespace.h +++ b/lib/libc/include/namespace.h @@ -1,4 +1,4 @@ -/* $OpenBSD: namespace.h,v 1.11 2017/11/29 05:13:57 guenther Exp $ */ +/* $OpenBSD: namespace.h,v 1.12 2018/01/18 08:23:44 guenther Exp $ */ #ifndef _LIBC_NAMESPACE_H_ #define _LIBC_NAMESPACE_H_ @@ -135,6 +135,8 @@ #include <sys/cdefs.h> /* for __dso_hidden and __{weak,strong}_alias */ +#define __dso_protected __attribute__((__visibility__("protected"))) + #define HIDDEN(x) _libc_##x #define CANCEL(x) _libc_##x##_cancel #define WRAP(x) _libc_##x##_wrap @@ -148,6 +150,7 @@ #define PROTO_CANCEL(x) __dso_hidden typeof(x) HIDDEN(x), \ x asm(CANCEL_STRING(x)) #define PROTO_WRAP(x) PROTO_NORMAL(x), WRAP(x) +#define PROTO_PROTECTED(x) __dso_protected typeof(x) x #define DEF_STRONG(x) __strong_alias(x, HIDDEN(x)) #define DEF_WEAK(x) __weak_alias(x, HIDDEN(x)) @@ -156,7 +159,7 @@ #define DEF_SYS(x) __strong_alias(_thread_sys_##x, HIDDEN(x)) #ifdef __clang__ #define DEF_BUILTIN(x) __asm("") -#define BUILTIN __attribute__((__visibility__("protected"))) +#define BUILTIN __dso_protected #else #define DEF_BUILTIN(x) DEF_STRONG(x) #define BUILTIN |