Browse Source

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@
OPENBSD_6_3
guenther 7 years ago
parent
commit
06875abb1a
3 changed files with 6 additions and 6 deletions
  1. +2
    -2
      src/lib/libc/string/memcpy.c
  2. +2
    -2
      src/lib/libc/string/memmove.c
  3. +2
    -2
      src/lib/libc/string/memset.c

+ 2
- 2
src/lib/libc/string/memcpy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memcpy.c,v 1.3 2017/08/14 17:10:02 guenther Exp $ */
/* $OpenBSD: memcpy.c,v 1.4 2017/11/29 05:13:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -106,4 +106,4 @@ memcpy(void *dst0, const void *src0, size_t length)
done: done:
return (dst0); return (dst0);
} }
DEF_STRONG(memcpy);
DEF_BUILTIN(memcpy);

+ 2
- 2
src/lib/libc/string/memmove.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memmove.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/* $OpenBSD: memmove.c,v 1.3 2017/11/29 05:13:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -110,4 +110,4 @@ memmove(void *dst0, const void *src0, size_t length)
done: done:
return (dst0); return (dst0);
} }
DEF_STRONG(memmove);
DEF_BUILTIN(memmove);

+ 2
- 2
src/lib/libc/string/memset.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memset.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/* $OpenBSD: memset.c,v 1.8 2017/11/29 05:13:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -45,4 +45,4 @@ memset(void *dst, int c, size_t n)
} }
return (dst); return (dst);
} }
DEF_STRONG(memset);
DEF_BUILTIN(memset);

Loading…
Cancel
Save