aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-02-04 08:29:46 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-02-04 08:29:46 +0000
commit1ca894a0e403de4be67483069f8b59059ad53a31 (patch)
tree815541fa1776fda28adf6a72453ad1d34ecb1aaf /gcc
parent52b357ea122caec736f311fecec2b3b9a0296da9 (diff)
downloadgcc-1ca894a0e403de4be67483069f8b59059ad53a31.zip
gcc-1ca894a0e403de4be67483069f8b59059ad53a31.tar.gz
gcc-1ca894a0e403de4be67483069f8b59059ad53a31.tar.bz2
cppinit.c (BC): New macro.
* cppinit.c (BC): New macro. (builtin_array): Add __GXX_WEAK__. * cpplib.h (builtin_type): Add BT_WEAK. * cppmacro.c (builtin_macro): Handle BT_WEAK. * defaults.h (SUPPORTS_ONE_ONLY): Define. * varasm.c (SUPPORTS_ONE_ONLY): Do not define. From-SVN: r39436
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/cppinit.c2
-rw-r--r--gcc/cpplib.h4
-rw-r--r--gcc/cppmacro.c4
-rw-r--r--gcc/defaults.h9
-rw-r--r--gcc/varasm.c9
6 files changed, 28 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 678c5d6..4d1fade 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2001-02-04 Mark Mitchell <mark@codesourcery.com>
+
+ * cppinit.c (BC): New macro.
+ (builtin_array): Add __GXX_WEAK__.
+ * cpplib.h (builtin_type): Add BT_WEAK.
+ * cppmacro.c (builtin_macro): Handle BT_WEAK.
+ * defaults.h (SUPPORTS_ONE_ONLY): Define.
+ * varasm.c (SUPPORTS_ONE_ONLY): Do not define.
+
2001-02-03 Jakub Jelinek <jakub@redhat.com>
* cppinit.c (append_include_chain): Honor NO_IMPLICIT_EXTERN_C.
@@ -81,7 +90,7 @@ Fri Feb 2 20:03:50 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
(init_spec): Use it.
* testsuite/lib/g++.exp: Include the directory where libgcc
is located to the LD_LIBRARY_PATH list.
- * inovke.texi (-shared-libgcc): Document the cases in which
+ * invoke.texi (-shared-libgcc): Document the cases in which
GCC defaults to using the shared libgcc.
2001-02-02 Alexandre Oliva <aoliva@redhat.com>
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index 8319ad9..845d35b 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -643,6 +643,7 @@ struct builtin
#define OPERATOR 0x10
#define B(n, t) { U n, 0, t, 0, BUILTIN, sizeof n - 1 }
+#define BC(n, t) { U n, 0, t, 0, BUILTIN | CPLUS, sizeof n - 1 }
#define C(n, v) { U n, v, 0, 0, 0, sizeof n - 1 }
#define X(n, f) { U n, 0, 0, 0, f, sizeof n - 1 }
#define O(n, c, f) { U n, 0, 0, c, OPERATOR | f, sizeof n - 1 }
@@ -655,6 +656,7 @@ static const struct builtin builtin_array[] =
B("__LINE__", BT_SPECLINE),
B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL),
B("__STDC__", BT_STDC),
+ BC("__GXX_WEAK__", BT_WEAK),
X("__VERSION__", VERS),
X("__USER_LABEL_PREFIX__", ULP),
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 9d0b8e2..eec4f1e 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -462,7 +462,9 @@ enum builtin_type
BT_BASE_FILE, /* `__BASE_FILE__' */
BT_INCLUDE_LEVEL, /* `__INCLUDE_LEVEL__' */
BT_TIME, /* `__TIME__' */
- BT_STDC /* `__STDC__' */
+ BT_STDC, /* `__STDC__' */
+ BT_WEAK /* Whether or not G++ supports weak
+ symbols. */
};
/* There is a slot in the hashnode for use by front ends when integrated
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index afe60dc..8e051a9 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -216,6 +216,10 @@ builtin_macro (pfile, token)
*token = node->value.builtin == BT_DATE ? pfile->date: pfile->time;
break;
+ case BT_WEAK:
+ make_number_token (pfile, token, SUPPORTS_ONE_ONLY);
+ break;
+
default:
cpp_ice (pfile, "invalid builtin macro \"%s\"", node->name);
break;
diff --git a/gcc/defaults.h b/gcc/defaults.h
index b0f3ce9..c1c938b 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -149,6 +149,15 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
#endif
#endif
+/* This determines whether or not we support link-once semantics. */
+#ifndef SUPPORTS_ONE_ONLY
+#ifdef MAKE_DECL_ONE_ONLY
+#define SUPPORTS_ONE_ONLY 1
+#else
+#define SUPPORTS_ONE_ONLY 0
+#endif
+#endif
+
/* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
provide a weak attribute. Else define it to nothing.
diff --git a/gcc/varasm.c b/gcc/varasm.c
index cae65cc..0470657 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -4828,15 +4828,6 @@ assemble_alias (decl, target)
#endif
}
-/* This determines whether or not we support link-once semantics. */
-#ifndef SUPPORTS_ONE_ONLY
-#ifdef MAKE_DECL_ONE_ONLY
-#define SUPPORTS_ONE_ONLY 1
-#else
-#define SUPPORTS_ONE_ONLY 0
-#endif
-#endif
-
/* Returns 1 if the target configuration supports defining public symbols
so that one of them will be chosen at link time instead of generating a
multiply-defined symbol error, whether through the use of weak symbols or