This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3,arm] Modify vec helper function return value
- From: Paul Brook <paul at nowt dot org>
- To: libstdc++ at gcc dot gnu dot org,"gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 1 Jul 2004 23:24:41 +0100
- Subject: [v3,arm] Modify vec helper function return value
The patch below makes the __cxa_vec_ctor and __cxa_vec_cctor return their
first argument, as specified by the ARM EABI.
Tested with cross to arm-none-elf and bootstrapped i686-linux
Ok?
Paul
2004-07-01 Paul Brook <paul@codesourcery.com>
* libsupc++/cxxabi.h (__cxa_vec_ctor_return): Declare and use.
* libsupc++/vec.cc (__cxa_vec_ctor, __cxa_vec_cctor): Use it.
Return first argument.
Index: libstdc++-v3/libsupc++/cxxabi.h
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/libstdc++-v3/libsupc++/cxxabi.h,v
retrieving revision 1.17
diff -u -p -r1.17 cxxabi.h
--- libstdc++-v3/libsupc++/cxxabi.h 25 Jun 2004 17:15:46 -0000 1.17
+++ libstdc++-v3/libsupc++/cxxabi.h 1 Jul 2004 12:07:37 -0000
@@ -70,12 +70,17 @@ namespace __cxxabiv1
void (*__dealloc) (void*, size_t));
// Construct array.
- void
+#ifdef __ARM_EABI__
+ typedef void * __cxa_vec_ctor_return;
+#else
+ typedef void __cxa_vec_ctor_return;
+#endif
+ __cxa_vec_ctor_return
__cxa_vec_ctor(void* __array_address, size_t __element_count,
size_t __element_size, void (*__constructor) (void*),
void (*__destructor) (void*));
- void
+ __cxa_vec_ctor_return
__cxa_vec_cctor(void* dest_array, void* src_array, size_t element_count,
size_t element_size, void (*constructor) (void*, void*),
void (*destructor) (void*));
Index: libstdc++-v3/libsupc++/vec.cc
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/libstdc++-v3/libsupc++/vec.cc,v
retrieving revision 1.15
diff -u -p -r1.15 vec.cc
--- libstdc++-v3/libsupc++/vec.cc 29 Jun 2004 14:50:35 -0000 1.15
+++ libstdc++-v3/libsupc++/vec.cc 1 Jul 2004 12:06:30 -0000
@@ -157,7 +157,7 @@ namespace __cxxabiv1
}
// Construct array.
- extern "C" void
+ extern "C" __cxa_vec_ctor_return
__cxa_vec_ctor(void *array_address,
std::size_t element_count,
std::size_t element_size,
@@ -181,10 +181,13 @@ namespace __cxxabiv1
}
__throw_exception_again;
}
+#ifdef __ARM_EABI__
+ return array_address;
+#endif
}
// Construct an array by copying.
- extern "C" void
+ extern "C" __cxa_vec_ctor_return
__cxa_vec_cctor(void *dest_array,
void *src_array,
std::size_t element_count,
@@ -211,6 +214,9 @@ namespace __cxxabiv1
}
__throw_exception_again;
}
+#ifdef __ARM_EABI__
+ return dest_array;
+#endif
}
// Destruct array.