summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libc-symbols.h44
1 files changed, 34 insertions, 10 deletions
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index c5ec2814f..391d53f1b 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -1,4 +1,7 @@
-/* Copyright (C) 1991,92,93,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+/* Support macros for making weak and strong aliases for symbols,
+ and for using symbol sets and linker warnings with GNU ld.
+ Copyright (C) 1995-1998,2000-2003,2004,2005,2006
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,14 +20,38 @@
02111-1307 USA. */
#ifndef _LIBC_SYMBOLS_H
-#define _LIBC_SYMBOLS_H 1
+#define _LIBC_SYMBOLS_H 1
+
+/* This file's macros are included implicitly in the compilation of every
+ file in the C library by -imacros.
+
+ We include uClibc_arch_features.h which is defined by arch devs.
+ It should define for us the following symbols:
+
+ * HAVE_ASM_SET_DIRECTIVE if we have `.set B, A' instead of `A = B'.
+ * ASM_GLOBAL_DIRECTIVE with `.globl' or `.global'.
+ * ASM_TYPE_DIRECTIVE_PREFIX with `@' or `#' or whatever for .type,
+ or leave it undefined if there is no .type directive.
+ * HAVE_ELF if using ELF, which supports weak symbols using `.weak'.
+ * HAVE_ASM_WEAK_DIRECTIVE if we have weak symbols using `.weak'.
+ * HAVE_ASM_WEAKEXT_DIRECTIVE if we have weak symbols using `.weakext'.
+
+ */
#include <bits/uClibc_arch_features.h>
-#define _LIBC 1
+
+/* This is defined for the compilation of all C library code. features.h
+ tests this to avoid inclusion of stubs.h while compiling the library,
+ before stubs.h has been generated. Some library code that is shared
+ with other packages also tests this symbol to see if it is being
+ compiled as part of the C library. We must define this before including
+ config.h, because it makes some definitions conditional on whether libc
+ itself is being compiled, or just some generator program. */
+#define _LIBC 1
/* Enable declarations of GNU extensions, since we are compiling them. */
-#define _GNU_SOURCE 1
+#define _GNU_SOURCE 1
/* Prepare for the case that `__builtin_expect' is not available. */
#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
@@ -128,13 +155,13 @@
# define _strong_alias(name, aliasname) \
extern __typeof (name) aliasname __attribute__ ((alias (#name)));
-# ifdef HAVE_WEAK_SYMBOLS
-
/* This comes between the return type and function name in
a function definition to make that definition weak. */
# define weak_function __attribute__ ((weak))
# define weak_const_function __attribute__ ((weak, __const__))
+# ifdef HAVE_WEAK_SYMBOLS
+
/* Define ALIASNAME as a weak alias for NAME.
If weak aliases are not available, this defines a strong alias. */
# define weak_alias(name, aliasname) _weak_alias (name, aliasname)
@@ -147,9 +174,6 @@
# else
-# define weak_function /* empty */
-# define weak_const_function /* empty */
-
# define weak_alias(name, aliasname) strong_alias(name, aliasname)
# define weak_extern(symbol) /* Nothing. */
@@ -235,7 +259,7 @@
functions not exported) a bit faster by using a different calling
convention. */
#ifndef internal_function
-# define internal_function /* empty */
+# define internal_function /* empty */
#endif
/* We want the .gnu.warning.SYMBOL section to be unallocated. */