diff options
author | Paul Brook <paul@codesourcery.com> | 2004-06-26 22:46:08 +0000 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2004-06-26 22:46:08 +0000 |
commit | b973a55e93f57b3d1328fb72d332a6a3015f4152 (patch) | |
tree | c90839e0d10e9237202164671c29209cd0e57ed7 /libstdc++-v3 | |
parent | ac32f68ecbef16a5d9c1078ae13954b2716cfb87 (diff) |
gcc/
* target-def.h (TARGET_CXX_GUARD_TYPE, TARGET_CXX_GUARD_MASK_BIT,
TARGET_CXX): Define.
(TARGET_INITIALIZER): Use TARGET_CXX.
* target.h (struct gcc_target): Add struct cxx.
* targhooks.h (default_cxx_guard_type): Add prototype.
* targhooks.c (default_cxx_guard_type): New function.
* config/arm/arm.c (TARGET_CXX_GUARD_TYPE, TARGET_CXX_GUARD_MASK_BIT):
Define.
(arm_cxx_guard_type, arm_cxx_guard_mask_bit): New functions.
* doc/tm.texi: Document TARGET_CXX_GUARD_TYPE and
TARGET_CXX_GUARD_MASK_BIT.
gcc/cp/
* decl2.c (get_guard): Call targetm.cxx.guard_type.
(get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit.
libstdc++/
* libsupc++/cxxabi.h: Define __ARM_EABI__
(__guard): Use it.
* libsupc++/guard.h (__cxa_guard_acquire, __cxa_guard_release): Ditto.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/csl-arm-branch@83723 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/cxxabi.h | 5 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/guard.cc | 11 |
3 files changed, 22 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 776303072d4..deb3738b180 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2004-06-25 Paul Brook <paul@codesourcery.com> + + * libsupc++/cxxabi.h: Define __ARM_EABI__ + (__guard): Use it. + * libsupc++/guard.h (__cxa_guard_acquire, __cxa_guard_release): Ditto. + 2004-03-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/14783 diff --git a/libstdc++-v3/libsupc++/cxxabi.h b/libstdc++-v3/libsupc++/cxxabi.h index f31ce2db1c7..8ae033a57e2 100644 --- a/libstdc++-v3/libsupc++/cxxabi.h +++ b/libstdc++-v3/libsupc++/cxxabi.h @@ -500,8 +500,13 @@ void __cxa_vec_delete3 (void *__array_address, /* guard variables */ +#ifdef __ARM_EABI__ +/* The ARM EABI says this is a 32-bit type. */ +typedef int __guard; +#else /* The ABI requires a 64-bit type. */ __extension__ typedef int __guard __attribute__((mode (__DI__))); +#endif extern "C" int __cxa_guard_acquire (__guard *); diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc index b93cffd2e20..fb49f1f081a 100644 --- a/libstdc++-v3/libsupc++/guard.cc +++ b/libstdc++-v3/libsupc++/guard.cc @@ -30,18 +30,29 @@ #include <cxxabi.h> +// The IA64/generic ABI uses the fist byte of the guard variable. +// The ARM EABI uses the least significant bit. + namespace __cxxabiv1 { extern "C" int __cxa_guard_acquire (__guard *g) { +#ifdef __ARM_EABI__ + return !(*g & 1); +#else return !*(char *)(g); +#endif } extern "C" void __cxa_guard_release (__guard *g) { +#ifdef __ARM_EABI__ + *g = 1; +#else *(char *)g = 1; +#endif } extern "C" |