diff options
author | Aaron W. LaFramboise <aaronavay62@aaronwl.com> | 2004-11-02 21:00:00 -0600 |
---|---|---|
committer | Aaron W. LaFramboise <aaronwl@gcc.gnu.org> | 2004-11-02 21:00:00 -0600 |
commit | 5cc781508e02593002ea1198645539c3fc2f87bd (patch) | |
tree | 945daee19b8d2dc68c77292206dc48448497a2f1 | |
parent | 71bd71860a61dbdbe2ff60a1a46a978baf0497ac (diff) | |
download | gcc-5cc781508e02593002ea1198645539c3fc2f87bd.zip gcc-5cc781508e02593002ea1198645539c3fc2f87bd.tar.gz gcc-5cc781508e02593002ea1198645539c3fc2f87bd.tar.bz2 |
* config/os/bsd/darwin/os_defines.h
(_GLIBCXX_WEAK_DEFINITION): Define.
* include/bits/c++config (_GLIBCXX_WEAK_DEFINITION): Define.
* libsupc++/del_op.cc (operator delete(void *)): Use
_GLIBCXX_WEAK_DEFINITION.
* libsupc++/del_opnt.cc
(operator delete(void *, const std::nothrow_t&)): Same.
* libsupc++/del_opv.cc (operator delete[](void *)): Same.
* libsupc++/del_opvnt.cc
(operator delete[](void *, const std::nothrow_t&)): Same.
* libsupc++/new_op.cc (operator new(std::size_t)): Same.
* libsupc++/new_opnt.cc
(operator new(std::size_t, const std::nothrow_t&)): Same
* libsupc++/new_opv.cc (operator new[](std::size_t)): Same.
* libsupc++/new_opvnt.cc
(operator new[](std::size_t, const std::nothrow_t&)): Same.
From-SVN: r90017
-rw-r--r-- | libstdc++-v3/ChangeLog | 19 | ||||
-rw-r--r-- | libstdc++-v3/config/os/bsd/darwin/os_defines.h | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/c++config | 7 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/del_op.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/del_opnt.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/del_opv.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/del_opvnt.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/new_op.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/new_opnt.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/new_opv.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/new_opvnt.cc | 2 |
11 files changed, 40 insertions, 8 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9063603..cb3ab69 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,22 @@ +2004-11-03 Aaron W. LaFramboise <aaronavay62@aaronwl.com> + + * config/os/bsd/darwin/os_defines.h + (_GLIBCXX_WEAK_DEFINITION): Define. + * include/bits/c++config (_GLIBCXX_WEAK_DEFINITION): Define. + * libsupc++/del_op.cc (operator delete(void *)): Use + _GLIBCXX_WEAK_DEFINITION. + * libsupc++/del_opnt.cc + (operator delete(void *, const std::nothrow_t&)): Same. + * libsupc++/del_opv.cc (operator delete[](void *)): Same. + * libsupc++/del_opvnt.cc + (operator delete[](void *, const std::nothrow_t&)): Same. + * libsupc++/new_op.cc (operator new(std::size_t)): Same. + * libsupc++/new_opnt.cc + (operator new(std::size_t, const std::nothrow_t&)): Same + * libsupc++/new_opv.cc (operator new[](std::size_t)): Same. + * libsupc++/new_opvnt.cc + (operator new[](std::size_t, const std::nothrow_t&)): Same. + 2004-11-02 Paolo Carlini <pcarlini@suse.de> * include/bits/locale_facets.tcc (num_get<>::_M_extract_int): diff --git a/libstdc++-v3/config/os/bsd/darwin/os_defines.h b/libstdc++-v3/config/os/bsd/darwin/os_defines.h index 9b68110..07fb55b 100644 --- a/libstdc++-v3/config/os/bsd/darwin/os_defines.h +++ b/libstdc++-v3/config/os/bsd/darwin/os_defines.h @@ -38,4 +38,10 @@ links to, so there's no need for weak-ness for that. */ #define _GLIBCXX_GTHREAD_USE_WEAK 0 +// On Darwin, in order to enable overriding of operator new and delete, +// GCC makes the definition of these functions weak, relies on the +// loader to implement weak semantics properly, and uses +// -flat_namespace to work around the way that it doesn't. +#define _GLIBCXX_WEAK_DEFINITION __attribute__ ((weak)) + #endif diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 0c7b44c..064280b 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -51,6 +51,13 @@ # define _GLIBCXX_EXTERN_TEMPLATE 1 #endif +// Certain function definitions that are meant to be overridable +// from user code are decorated with this macro. For some targets, +// this macro causes these definitions to be weak. +#ifndef _GLIBCXX_WEAK_DEFINITION +#define _GLIBCXX_WEAK_DEFINITION +#endif + // Debug mode support. Debug mode basic_string is not allowed to be // associated with std, because of locale and exception link // dependence. diff --git a/libstdc++-v3/libsupc++/del_op.cc b/libstdc++-v3/libsupc++/del_op.cc index 32ccdb6..388f508 100644 --- a/libstdc++-v3/libsupc++/del_op.cc +++ b/libstdc++-v3/libsupc++/del_op.cc @@ -39,7 +39,7 @@ using std::free; extern "C" void free(void *); #endif -__attribute__((weak)) void +_GLIBCXX_WEAK_DEFINITION void operator delete (void *ptr) throw () { if (ptr) diff --git a/libstdc++-v3/libsupc++/del_opnt.cc b/libstdc++-v3/libsupc++/del_opnt.cc index 6cfb077..76b7d69 100644 --- a/libstdc++-v3/libsupc++/del_opnt.cc +++ b/libstdc++-v3/libsupc++/del_opnt.cc @@ -32,7 +32,7 @@ extern "C" void free (void *); -__attribute__((weak)) void +_GLIBCXX_WEAK_DEFINITION void operator delete (void *ptr, const std::nothrow_t&) throw () { if (ptr) diff --git a/libstdc++-v3/libsupc++/del_opv.cc b/libstdc++-v3/libsupc++/del_opv.cc index 03e1612..94cdfde 100644 --- a/libstdc++-v3/libsupc++/del_opv.cc +++ b/libstdc++-v3/libsupc++/del_opv.cc @@ -30,7 +30,7 @@ #include "new" -__attribute__((weak)) void +_GLIBCXX_WEAK_DEFINITION void operator delete[] (void *ptr) throw () { ::operator delete (ptr); diff --git a/libstdc++-v3/libsupc++/del_opvnt.cc b/libstdc++-v3/libsupc++/del_opvnt.cc index 5b55cda..180b08f63 100644 --- a/libstdc++-v3/libsupc++/del_opvnt.cc +++ b/libstdc++-v3/libsupc++/del_opvnt.cc @@ -30,7 +30,7 @@ #include "new" -__attribute__((weak)) void +_GLIBCXX_WEAK_DEFINITION void operator delete[] (void *ptr, const std::nothrow_t&) throw () { ::operator delete (ptr); diff --git a/libstdc++-v3/libsupc++/new_op.cc b/libstdc++-v3/libsupc++/new_op.cc index 656b9f4..0ebec1c 100644 --- a/libstdc++-v3/libsupc++/new_op.cc +++ b/libstdc++-v3/libsupc++/new_op.cc @@ -43,7 +43,7 @@ extern "C" void *malloc (std::size_t); extern new_handler __new_handler; -__attribute__((weak)) void * +_GLIBCXX_WEAK_DEFINITION void * operator new (std::size_t sz) throw (std::bad_alloc) { void *p; diff --git a/libstdc++-v3/libsupc++/new_opnt.cc b/libstdc++-v3/libsupc++/new_opnt.cc index ff550b7..1b29c1a 100644 --- a/libstdc++-v3/libsupc++/new_opnt.cc +++ b/libstdc++-v3/libsupc++/new_opnt.cc @@ -36,7 +36,7 @@ using std::bad_alloc; extern "C" void *malloc (std::size_t); extern new_handler __new_handler; -__attribute__((weak)) void * +_GLIBCXX_WEAK_DEFINITION void * operator new (std::size_t sz, const std::nothrow_t&) throw() { void *p; diff --git a/libstdc++-v3/libsupc++/new_opv.cc b/libstdc++-v3/libsupc++/new_opv.cc index de3bc4e..9fa7d19 100644 --- a/libstdc++-v3/libsupc++/new_opv.cc +++ b/libstdc++-v3/libsupc++/new_opv.cc @@ -30,7 +30,7 @@ #include "new" -__attribute__((weak)) void * +_GLIBCXX_WEAK_DEFINITION void * operator new[] (std::size_t sz) throw (std::bad_alloc) { return ::operator new(sz); diff --git a/libstdc++-v3/libsupc++/new_opvnt.cc b/libstdc++-v3/libsupc++/new_opvnt.cc index 1dbf991..79b8cdc 100644 --- a/libstdc++-v3/libsupc++/new_opvnt.cc +++ b/libstdc++-v3/libsupc++/new_opvnt.cc @@ -30,7 +30,7 @@ #include "new" -__attribute__((weak)) void * +_GLIBCXX_WEAK_DEFINITION void * operator new[] (std::size_t sz, const std::nothrow_t& nothrow) throw() { return ::operator new(sz, nothrow); |