summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/hppa/include/cdefs.h42
1 files changed, 35 insertions, 7 deletions
diff --git a/sys/arch/hppa/include/cdefs.h b/sys/arch/hppa/include/cdefs.h
index 24aaad537fa..474378816a8 100644
--- a/sys/arch/hppa/include/cdefs.h
+++ b/sys/arch/hppa/include/cdefs.h
@@ -1,7 +1,8 @@
-/* $OpenBSD: cdefs.h,v 1.2 2001/03/27 09:24:46 mickey Exp $ */
+/* $OpenBSD: cdefs.h,v 1.3 2001/03/29 01:44:53 mickey Exp $ */
+/* $NetBSD: cdefs.h,v 1.5 1996/10/12 18:08:12 cgd Exp $ */
/*
- * Copyright (c) 1995 Carnegie-Mellon University.
+ * Copyright (c) 1995, 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
@@ -32,10 +33,37 @@
#define _C_LABEL(x) _STRING(x)
-#if 0
-#define __weak_alias(alias,sym)
-#define __indr_reference(sym,msg)
-#define __warn_references(sym,msg)
-#endif
+#ifdef __ELF__
+
+#ifdef __STDC__
+
+#define __weak_alias(alias,sym) \
+ __asm__(".weak " __STRING(alias) " ; " __STRING(alias) " = " __STRING(sym))
+#define __warn_references(sym,msg) \
+ __asm__(".section .gnu.warning." __STRING(sym) " ; .ascii \"" msg "\" ; .text")
+
+#else /* !__STDC__ */
+
+#define __weak_alias(alias,sym) \
+ __asm__(".weak alias ; alias = sym")
+#define __warn_references(sym,msg) \
+ __asm__(".section .gnu.warning.sym ; .ascii msg ; .text")
+
+#endif /* !__STDC__ */
+
+#else /* !__ELF__ */
+
+/*
+ * We don't support indirect references and don't do anything with warnings.
+ */
+
+#ifdef __STDC__
+#define __weak_alias(alias,sym) __asm__(".weakext " __STRING(alias) ", " __STRING(sym))
+#else /* !__STDC__ */
+#define __weak_alias(alias,sym) __asm__(".weakext alias, sym")
+#endif /* !__STDC__ */
+#define __warn_references(sym,msg) /* nothing */
+
+#endif /* !__ELF__ */
#endif /* !_MACHINE_CDEFS_H_ */