summaryrefslogtreecommitdiff
path: root/lib/libc/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/arch/powerpc')
-rw-r--r--lib/libc/arch/powerpc/SYS.h25
-rw-r--r--lib/libc/arch/powerpc/string/memmove.S6
2 files changed, 28 insertions, 3 deletions
diff --git a/lib/libc/arch/powerpc/SYS.h b/lib/libc/arch/powerpc/SYS.h
index 6303d68f7b6..b9cd88b7c30 100644
--- a/lib/libc/arch/powerpc/SYS.h
+++ b/lib/libc/arch/powerpc/SYS.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: SYS.h,v 1.17 2015/08/23 15:51:28 kettenis Exp $ */
+/* $OpenBSD: SYS.h,v 1.18 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1994
* Andrew Cagney. All rights reserved.
@@ -44,6 +44,29 @@
#include "machine/asm.h"
+/*
+ * We define a hidden alias with the prefix "_libc_" for each global symbol
+ * that may be used internally. By referencing _libc_x instead of x, other
+ * parts of libc prevent overriding by the application and avoid unnecessary
+ * relocations.
+ */
+#define _HIDDEN(x) _libc_##x
+#define _HIDDEN_ALIAS(x,y) \
+ STRONG_ALIAS(_HIDDEN(x),y); \
+ .hidden _HIDDEN(x)
+#define _HIDDEN_FALIAS(x,y) \
+ _HIDDEN_ALIAS(x,y); \
+ .type _HIDDEN(x),@function
+
+/*
+ * For functions implemented in ASM that aren't syscalls.
+ * END_STRONG(x) Like DEF_STRONG() in C; for standard/reserved C names
+ * END_WEAK(x) Like DEF_WEAK() in C; for non-ISO C names
+ */
+#define END_STRONG(x) END(x); _HIDDEN_FALIAS(x,x); END(_HIDDEN(x))
+#define END_WEAK(x) END_STRONG(x); .weak x
+
+
#define _CONCAT(x,y) x##y
#define PSEUDO_PREFIX(p,x,y) .extern _ASM_LABEL(___cerror) ; \
ENTRY(p##x) \
diff --git a/lib/libc/arch/powerpc/string/memmove.S b/lib/libc/arch/powerpc/string/memmove.S
index 875c562b0b2..80aca10ce78 100644
--- a/lib/libc/arch/powerpc/string/memmove.S
+++ b/lib/libc/arch/powerpc/string/memmove.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: memmove.S,v 1.1 2014/12/04 12:10:26 deraadt Exp $ */
+/* $OpenBSD: memmove.S,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/* $NetBSD: memmove.S,v 1.3 2011/01/15 07:31:12 matt Exp $ */
/* stropt/memmove.S, pl_string_common, pl_linux 10/11/04 11:45:37
@@ -39,7 +39,7 @@
* ==========================================================================
*/
-#include <machine/asm.h>
+#include "SYS.h"
.text
@@ -166,3 +166,5 @@ rlast2:
bdnz+ rlast2 /* Dec ctr, and branch if more */
/* bytes left */
blr
+END_STRONG(memmove)
+END_WEAK(bcopy)