diff options
author | guenther <> | 2017-11-29 05:13:57 +0000 |
---|---|---|
committer | guenther <> | 2017-11-29 05:13:57 +0000 |
commit | bc8bb57301186279c74b55cd2daec9131d087ef8 (patch) | |
tree | 4976229f4c71d61ceb103c7276e63e28e5ef1d31 /src/lib/libc/string | |
parent | aa9c99e53a08fd5b5178e337b1082d178fb34c07 (diff) | |
download | openbsd-bc8bb57301186279c74b55cd2daec9131d087ef8.tar.gz openbsd-bc8bb57301186279c74b55cd2daec9131d087ef8.tar.bz2 openbsd-bc8bb57301186279c74b55cd2daec9131d087ef8.zip |
clang doesn't propagate attributes like "asm labels" and "visibility(hidden)"
to builtins like mem{set,cpy,move} and __stack_smash_handler. So, when
building with clang, instead mark those as protected visibility to get rid
of the PLT relocations. We can't take the address of them then, but that's
ok: it's a build-time error not a run-time error.
ok kettenis@
Diffstat (limited to 'src/lib/libc/string')
-rw-r--r-- | src/lib/libc/string/memcpy.c | 4 | ||||
-rw-r--r-- | src/lib/libc/string/memmove.c | 4 | ||||
-rw-r--r-- | src/lib/libc/string/memset.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libc/string/memcpy.c b/src/lib/libc/string/memcpy.c index a2516ed041..19fddc0ab5 100644 --- a/src/lib/libc/string/memcpy.c +++ b/src/lib/libc/string/memcpy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: memcpy.c,v 1.3 2017/08/14 17:10:02 guenther Exp $ */ | 1 | /* $OpenBSD: memcpy.c,v 1.4 2017/11/29 05:13:57 guenther Exp $ */ |
2 | /*- | 2 | /*- |
3 | * Copyright (c) 1990 The Regents of the University of California. | 3 | * Copyright (c) 1990 The Regents of the University of California. |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -106,4 +106,4 @@ memcpy(void *dst0, const void *src0, size_t length) | |||
106 | done: | 106 | done: |
107 | return (dst0); | 107 | return (dst0); |
108 | } | 108 | } |
109 | DEF_STRONG(memcpy); | 109 | DEF_BUILTIN(memcpy); |
diff --git a/src/lib/libc/string/memmove.c b/src/lib/libc/string/memmove.c index 2f1deb2c70..1cd1086ab9 100644 --- a/src/lib/libc/string/memmove.c +++ b/src/lib/libc/string/memmove.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: memmove.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */ | 1 | /* $OpenBSD: memmove.c,v 1.3 2017/11/29 05:13:57 guenther Exp $ */ |
2 | /*- | 2 | /*- |
3 | * Copyright (c) 1990 The Regents of the University of California. | 3 | * Copyright (c) 1990 The Regents of the University of California. |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -110,4 +110,4 @@ memmove(void *dst0, const void *src0, size_t length) | |||
110 | done: | 110 | done: |
111 | return (dst0); | 111 | return (dst0); |
112 | } | 112 | } |
113 | DEF_STRONG(memmove); | 113 | DEF_BUILTIN(memmove); |
diff --git a/src/lib/libc/string/memset.c b/src/lib/libc/string/memset.c index 242529ee0f..0c261f0965 100644 --- a/src/lib/libc/string/memset.c +++ b/src/lib/libc/string/memset.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: memset.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */ | 1 | /* $OpenBSD: memset.c,v 1.8 2017/11/29 05:13:57 guenther Exp $ */ |
2 | /*- | 2 | /*- |
3 | * Copyright (c) 1990 The Regents of the University of California. | 3 | * Copyright (c) 1990 The Regents of the University of California. |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -45,4 +45,4 @@ memset(void *dst, int c, size_t n) | |||
45 | } | 45 | } |
46 | return (dst); | 46 | return (dst); |
47 | } | 47 | } |
48 | DEF_STRONG(memset); | 48 | DEF_BUILTIN(memset); |