2013-03-20 Yaakov Selkowitz * lib/_cygwin_crt0_common.cc: Fix mangled operator new names for x86_64. Index: lib/_cygwin_crt0_common.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/lib/_cygwin_crt0_common.cc,v retrieving revision 1.24.2.4 diff -u -p -r1.24.2.4 _cygwin_crt0_common.cc --- lib/_cygwin_crt0_common.cc 5 Mar 2013 14:29:30 -0000 1.24.2.4 +++ lib/_cygwin_crt0_common.cc 20 Mar 2013 06:17:36 -0000 @@ -17,22 +17,34 @@ details. */ unnecessarily. */ #define WEAK __attribute__ ((weak)) +#ifdef __x86_64__ +#define REAL_ZNWX "__real__Znwm" +#define REAL_ZNAX "__real__Znam" +#define REAL_ZNWX_NOTHROW_T "__real__ZnwmRKSt9nothrow_t" +#define REAL_ZNAX_NOTHROW_T "__real__ZnamRKSt9nothrow_t" +#else +#define REAL_ZNWX "___real__Znwj" +#define REAL_ZNAX "___real__Znaj" +#define REAL_ZNWX_NOTHROW_T "___real__ZnwjRKSt9nothrow_t" +#define REAL_ZNAX_NOTHROW_T "___real__ZnajRKSt9nothrow_t" +#endif + /* Use asm names to bypass the --wrap that is being applied to redirect all other references to these operators toward the redirectors in the Cygwin DLL; this way we can record what definitions were visible at final link time but still send all calls to the redirectors. */ extern WEAK void *operator new(std::size_t sz) throw (std::bad_alloc) - __asm__ (_SYMSTR (__real__Znwj)); + __asm__ (REAL_ZNWX); extern WEAK void *operator new[](std::size_t sz) throw (std::bad_alloc) - __asm__ (_SYMSTR (__real__Znaj)); + __asm__ (REAL_ZNAX); extern WEAK void operator delete(void *p) throw() __asm__ (_SYMSTR (__real__ZdlPv )); extern WEAK void operator delete[](void *p) throw() __asm__ (_SYMSTR (__real__ZdaPv)); extern WEAK void *operator new(std::size_t sz, const std::nothrow_t &nt) throw() - __asm__ (_SYMSTR (__real__ZnwjRKSt9nothrow_t)); + __asm__ (REAL_ZNWX_NOTHROW_T); extern WEAK void *operator new[](std::size_t sz, const std::nothrow_t &nt) throw() - __asm__ (_SYMSTR (__real__ZnajRKSt9nothrow_t)); + __asm__ (REAL_ZNAX_NOTHROW_T); extern WEAK void operator delete(void *p, const std::nothrow_t &nt) throw() __asm__ (_SYMSTR (__real__ZdlPvRKSt9nothrow_t)); extern WEAK void operator delete[](void *p, const std::nothrow_t &nt) throw()