aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/libsupc++
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-06-29 14:50:35 +0000
committerPaul Brook <pbrook@gcc.gnu.org>2004-06-29 14:50:35 +0000
commit46e995e0e40e16ca159d6f5b116829700bbc269f (patch)
treef6a9a6cf28955476ec2789692fe97c33db01c297 /libstdc++-v3/libsupc++
parent50a2de961ffa6022ac3084c94f76d1462be04845 (diff)
downloadgcc-46e995e0e40e16ca159d6f5b116829700bbc269f.zip
gcc-46e995e0e40e16ca159d6f5b116829700bbc269f.tar.gz
gcc-46e995e0e40e16ca159d6f5b116829700bbc269f.tar.bz2
target-def.h (TARGET_CXX_GET_COOKIE_SIZE, [...]): Define.
gcc/ * target-def.h (TARGET_CXX_GET_COOKIE_SIZE, TARGET_CXX_COOKIE_HAS_SIZE): Define. (TARGET_CXX): Use them. * target.h (struct gcc_target): Add cxx.get_cookie_size and cxx.cookie_has_size. * targhooks.c (default_cxx_get_cookie_size): New fucntion. * targhooks.h (default_cxx_get_cookie_size): Add prototype. * config/arm/arm.c (TARGET_CXX_GET_COOKIE_SIZE, TARGET_CXX_COOKIE_HAS_SIZE): Define. (arm_get_cookie_size, arm_cookie_has_size): New functions. * Make-lang.in (cp/init.o): Add dependency on $(TARGET_H). * doc/tm.texi: Document TARGET_CXX_GET_COOKIE_SIZE and TARGET_CXX_COOKIE_HAS_SIZE. gcc/cp/ * init.c: Include target.h. (get_cookie_size): Remove and replace with target hook. Update callers. (build_new_1): Store the element size in the cookie. libstdc++-v3/ * libsupc++/vec.cc (__cxa_vec_new2, __cxa_vec_new3): Store the element size in the cookie. testsuite/ * g++.old-deja/g++.abi/arraynew.C: Handle ARM EABI cookies. * g++.old-deja/g++.abi/cxa_vec.C: Allocate larger cookies for AEABI. From-SVN: r83854
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r--libstdc++-v3/libsupc++/vec.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc
index 86d41d9..eb7851b 100644
--- a/libstdc++-v3/libsupc++/vec.cc
+++ b/libstdc++-v3/libsupc++/vec.cc
@@ -96,6 +96,10 @@ namespace __cxxabiv1
{
base += padding_size;
reinterpret_cast <std::size_t *> (base)[-1] = element_count;
+#ifdef __ARM_EABI__
+ // ARM EABI array cookies also contain the element size.
+ reinterpret_cast <std::size_t *> (base)[-2] = element_size;
+#endif
}
try
{
@@ -131,6 +135,10 @@ namespace __cxxabiv1
{
base += padding_size;
reinterpret_cast<std::size_t *>(base)[-1] = element_count;
+#ifdef __ARM_EABI__
+ // ARM EABI array cookies also contain the element size.
+ reinterpret_cast <std::size_t *> (base)[-2] = element_size;
+#endif
}
try
{