aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl.c5
-rw-r--r--gcc/cp/rtti.c8
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/libsupc++/exception_support.cc12
-rw-r--r--libstdc++-v3/libsupc++/pure.cc10
6 files changed, 44 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0fb019d..7886ddc 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2000-11-19 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (init_decl_processing): Correct name of pure virtual
+ function under the new ABI.
+ * rtti.c (throw_bad_cast): Likewise, for bad cast function.
+ (throw_bad_typeid): Likewise for bad typeid function.
+
2000-11-18 Mark Mitchell <mark@codesourcery.com>
* decl.c (grokparms): Don't even function types of `void' type,
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d641930..380b734 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -6656,7 +6656,10 @@ init_decl_processing ()
}
abort_fndecl
- = build_library_fn_ptr ("__pure_virtual", void_ftype);
+ = build_library_fn_ptr ((flag_new_abi
+ ? "__cxa_pure_virtual"
+ : "__pure_virtual"),
+ void_ftype);
/* Perform other language dependent initializations. */
init_class_processing ();
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index f172c5f..3a54fc4 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -182,7 +182,9 @@ build_headof (exp)
static tree
throw_bad_cast ()
{
- tree fn = get_identifier ("__throw_bad_cast");
+ tree fn = get_identifier (flag_new_abi
+ ? "__cxa_bad_cast" :
+ "__throw_bad_cast");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
@@ -195,7 +197,9 @@ throw_bad_cast ()
static tree
throw_bad_typeid ()
{
- tree fn = get_identifier ("__throw_bad_typeid");
+ tree fn = get_identifier (flag_new_abi
+ ? "__cxa_bad_typeid"
+ : "__throw_bad_typeid");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 64aed38..bec0bea 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2000-11-19 Mark Mitchell <mark@codesourcery.com>
+
+ * libsupc++/exception_support.cc (__throw_bad_cast): Name it
+ __cxa_bad_cast under the new ABI.
+ (__throw_bad_typeid): Name it __cxa_bad_typeid under the new ABI.
+ * libsupc++/pure.cc (__pure_virtual): Name it __cxa_pure_virtual
+ under the new ABI.
+
2000-11-18 Mark Mitchell <mark@codesourcery.com>
* libsupc++/exception_support.h: New header file.
diff --git a/libstdc++-v3/libsupc++/exception_support.cc b/libstdc++-v3/libsupc++/exception_support.cc
index ace0927..4295874 100644
--- a/libstdc++-v3/libsupc++/exception_support.cc
+++ b/libstdc++-v3/libsupc++/exception_support.cc
@@ -348,15 +348,23 @@ __check_null_eh_spec (void)
// Helpers for rtti. Although these don't return, we give them return types so
// that the type system is not broken.
+#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
+#define THROW_BAD_CAST __throw_bad_cast
+#define THROW_BAD_TYPEID __throw_bad_typeid
+#else
+#define THROW_BAD_CAST __cxa_bad_cast
+#define THROW_BAD_TYPEID __cxa_bad_typeid
+#endif
+
extern "C" void *
-__throw_bad_cast ()
+THROW_BAD_CAST ()
{
throw std::bad_cast ();
return 0;
}
extern "C" std::type_info const &
-__throw_bad_typeid ()
+THROW_BAD_TYPEID ()
{
throw std::bad_typeid ();
return typeid (void);
diff --git a/libstdc++-v3/libsupc++/pure.cc b/libstdc++-v3/libsupc++/pure.cc
index c217d8a..7ada066 100644
--- a/libstdc++-v3/libsupc++/pure.cc
+++ b/libstdc++-v3/libsupc++/pure.cc
@@ -46,8 +46,16 @@ extern "C" {
extern void __terminate(void) __attribute__ ((__noreturn__));
+// The name of the function to be placed in vtables in place of a pure
+// virtual function is different in the two ABIs.
+#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
+#define PURE_VIRTUAL_NAME __pure_virtual
+#else
+#define PURE_VIRTUAL_NAME __cxa_pure_virtual
+#endif
+
void
-__pure_virtual (void)
+PURE_VIRTUAL_NAME (void)
{
writestr ("pure virtual method called\n");
__terminate ();