diff options
author | merrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-05-16 01:02:59 +0000 |
---|---|---|
committer | merrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-05-16 01:02:59 +0000 |
commit | 9a0ce7db12eff82b3a17ca1040523fd865787f2b (patch) | |
tree | 9d5f3bb804d2bbfb71d3beebd8c3bc2c6f1f2499 /gcc/libgcc2.c | |
parent | 3a5f6e90259514f8a4c2cdfeb92a6aed600d9617 (diff) | |
download | gcc-9a0ce7db12eff82b3a17ca1040523fd865787f2b.tar.gz |
Update weak symbol support
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9697 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r-- | gcc/libgcc2.c | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 7647baa254d..32cb00bca05 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -31,6 +31,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "tconfig.h" #include "machmode.h" +#include "defaults.h" #ifndef L_trampoline #include <stddef.h> #endif @@ -40,6 +41,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef abort #endif +#if (SUPPORTS_WEAK == 1) && defined (ASM_OUTPUT_DEF) +#define WEAK_ALIAS +#endif + /* Permit the tm.h file to select the endianness to use just for this file. This is used when the endianness is determined when the compiler is run. */ @@ -1606,9 +1611,15 @@ typedef void (*vfp)(void); extern vfp __new_handler; extern void __default_new_handler (void); -void * __builtin_new (size_t sz) __attribute__ ((weak)); +#ifdef WEAK_ALIAS +void * __builtin_new (size_t sz) + __attribute__ ((weak, alias ("___builtin_new"))); +void * +___builtin_new (size_t sz) +#else void * __builtin_new (size_t sz) +#endif { void *p; vfp handler = (__new_handler) ? __new_handler : __default_new_handler; @@ -1633,9 +1644,15 @@ __builtin_new (size_t sz) extern void * __builtin_new (size_t); -void * __builtin_vec_new (size_t sz) __attribute__ ((weak)); +#ifdef WEAK_ALIAS +void * __builtin_vec_new (size_t sz) + __attribute__ ((weak, alias ("___builtin_vec_new"))); +void * +___builtin_vec_new (size_t sz) +#else void * __builtin_vec_new (size_t sz) +#endif { return __builtin_new (sz); } @@ -1696,9 +1713,15 @@ __default_new_handler () by C++ programs to return to the free store a block of memory allocated as a single object. */ -void __builtin_delete (void *ptr) __attribute__ ((weak)); +#ifdef WEAK_ALIAS +void __builtin_delete (void *ptr) + __attribute__ ((weak, alias ("___builtin_delete"))); +void +___builtin_delete (void *ptr) +#else void __builtin_delete (void *ptr) +#endif { if (ptr) free (ptr); @@ -1712,9 +1735,15 @@ __builtin_delete (void *ptr) extern void __builtin_delete (void *); -void __builtin_vec_delete (void *ptr) __attribute__ ((weak)); +#ifdef WEAK_ALIAS +void __builtin_vec_delete (void *ptr) + __attribute__ ((weak, alias ("___builtin_vec_delete"))); +void +___builtin_vec_delete (void *ptr) +#else void __builtin_vec_delete (void *ptr) +#endif { __builtin_delete (ptr); } |