summaryrefslogtreecommitdiff
path: root/lib/libc/arch/powerpc/SYS.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/arch/powerpc/SYS.h')
-rw-r--r--lib/libc/arch/powerpc/SYS.h25
1 files changed, 24 insertions, 1 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) \