|
From: <sv...@va...> - 2005-05-05 01:16:30
|
Author: sewardj Date: 2005-05-05 02:16:24 +0100 (Thu, 05 May 2005) New Revision: 3617 Modified: trunk/coregrind/vg_replace_malloc.c Log: Tidy up a bit. Modified: trunk/coregrind/vg_replace_malloc.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/vg_replace_malloc.c 2005-05-04 18:01:26 UTC (rev 3616= ) +++ trunk/coregrind/vg_replace_malloc.c 2005-05-05 01:16:24 UTC (rev 3617= ) @@ -215,58 +215,70 @@ ALLOC_or_NULL(m_libc_dot_so_dot_6, malloc, malloc); //ALLOC_or_NULL(m_libpgc_dot_so, malloc, malloc); =20 -// operator new(unsigned int), GNU mangling, 32-bit platforms + +// operator new(unsigned int), unmangled for some bizarre reason ALLOC_or_BOMB(m_libstc_plus_plus_star, builtin_new, __builtin_new); ALLOC_or_BOMB(m_libc_dot_so_dot_6, builtin_new, __builtin_new); =20 ALLOC_or_BOMB(m_libstc_plus_plus_star, __builtin_new, __builtin_new); ALLOC_or_BOMB(m_libc_dot_so_dot_6, __builtin_new, __builtin_new); =20 -// TODO: these should only exist on 32-bit platforms -ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znwj, __builtin_new); -ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znwj, __builtin_new); =20 -// TODO: these should only exist on 64-bit platforms +// operator new(unsigned int), GNU mangling, 32-bit platforms // operator new(unsigned long), GNU mangling, 64-bit platforms -ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znwm, __builtin_new); -ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znwm, __builtin_new); +#if VG_WORDSIZE =3D=3D 4 + ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znwj, __builtin_new); + ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znwj, __builtin_new); +#endif +#if VG_WORDSIZE =3D=3D 8 + ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znwm, __builtin_new); + ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znwm, __builtin_new); +#endif =20 =20 // operator new(unsigned int), ARM/cfront mangling //ALLOC_or_BOMB(m_libpgc_dot_so, __nw__FUi, __builtin_new); =20 -// TODO: these should only exist on 32-bit platforms -// operator new(unsigned, std::nothrow_t const&), GNU mangling -ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnwjRKSt9nothrow_t, __builtin_n= ew); -ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnwjRKSt9nothrow_t, __builtin_n= ew); =20 -// TODO: these should only exist on 64-bit platforms -// operator new(unsigned long, std::nothrow_t const&), GNU mangling -ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnwmRKSt9nothrow_t, __builtin_n= ew); -ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnwmRKSt9nothrow_t, __builtin_n= ew); +// operator new(unsigned, std::nothrow_t const&), GNU mangling, 32-bit +// operator new(unsigned long, std::nothrow_t const&), GNU mangling, 64-= bit +#if VG_WORDSIZE =3D=3D 4 + ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnwjRKSt9nothrow_t, __builtin_= new); + ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnwjRKSt9nothrow_t, __builtin_= new); +#endif +#if VG_WORDSIZE =3D=3D 8 + ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnwmRKSt9nothrow_t, __builtin_= new); + ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnwmRKSt9nothrow_t, __builtin_= new); +#endif =20 -// operator new[](unsigned int), GNU mangling + +// operator new[](unsigned int), , unmangled for some bizarre reason ALLOC_or_BOMB(m_libstc_plus_plus_star, __builtin_vec_new, __builtin_vec_= new ); ALLOC_or_BOMB(m_libc_dot_so_dot_6, __builtin_vec_new, __builtin_vec_= new ); =20 -// TODO: these should only exist on 32-bit platforms -ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znaj, __builtin_vec_= new ); -ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znaj, __builtin_vec_= new ); =20 -// TODO: these should only exist on 64-bit platforms +// operator new[](unsigned int), GNU mangling, 32-bit platforms // operator new[](unsigned long), GNU mangling, 64-bit platforms -ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znam, __builtin_vec_= new ); -ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znam, __builtin_vec_= new ); +#if VG_WORDSIZE =3D=3D 4 + ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znaj, __builtin_vec= _new ); + ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znaj, __builtin_vec= _new ); +#endif +#if VG_WORDSIZE =3D=3D 8 + ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znam, __builtin_vec= _new ); + ALLOC_or_BOMB(m_libc_dot_so_dot_6, _Znam, __builtin_vec= _new ); +#endif =20 -// TODO: these should only exist on 32-bit platforms -// operator new[](unsigned, std::nothrow_t const&), GNU mangling -ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnajRKSt9nothrow_t, __builtin_ve= c_new ); -ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnajRKSt9nothrow_t, __builtin_ve= c_new ); =20 -// TODO: these should only exist on 64-bit platforms -// operator new[](unsigned long, std::nothrow_t const&), GNU mangling -ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnamRKSt9nothrow_t, __builtin_ve= c_new ); -ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnamRKSt9nothrow_t, __builtin_ve= c_new ); +// operator new[](unsigned, std::nothrow_t const&), GNU mangling, 32-bit +// operator new[](unsigned long, std::nothrow_t const&), GNU mangling, 6= 4-bit +#if VG_WORDSIZE =3D=3D 4 + ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnajRKSt9nothrow_t, __builtin_v= ec_new ); + ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnajRKSt9nothrow_t, __builtin_v= ec_new ); +#endif +#if VG_WORDSIZE =3D=3D 8 + ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnamRKSt9nothrow_t, __builtin_v= ec_new ); + ALLOC_or_NULL(m_libc_dot_so_dot_6, _ZnamRKSt9nothrow_t, __builtin_v= ec_new ); +#endif =20 =20 /* Generate a replacement for 'fnname' in object 'soname', which calls |