From 8a1894ac7ba96fb629e676300ca2a870ddfc6dba Mon Sep 17 00:00:00 2001 From: Chris Demetriou Date: Wed, 24 Jan 2001 03:03:12 +0000 Subject: [PATCH] libgcc-std.ver (GCC_3.0): Add __terminate_func_set to list of EH symbols. 2001-01-23 Chris Demetriou * libgcc-std.ver (GCC_3.0): Add __terminate_func_set to list of EH symbols. * libgcc2.c (__terminate_func): Make variable static. (__terminate_set_func): New function to set __terminate_func. * libgcc2.h (__terminate_func_ptr): New typedef. (__terminate_set_func): New function. From-SVN: r39224 --- gcc/ChangeLog | 9 +++++++++ gcc/libgcc-std.ver | 1 + gcc/libgcc2.c | 11 ++++++++++- gcc/libgcc2.h | 3 +++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a1ca492a17c..04136c92a93 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2001-01-23 Chris Demetriou + + * libgcc-std.ver (GCC_3.0): Add __terminate_func_set to list + of EH symbols. + * libgcc2.c (__terminate_func): Make variable static. + (__terminate_set_func): New function to set __terminate_func. + * libgcc2.h (__terminate_func_ptr): New typedef. + (__terminate_set_func): New function. + 2001-01-23 Richard Henderson * flow.c (init_propagate_block_info): Don't consider unchanging diff --git a/gcc/libgcc-std.ver b/gcc/libgcc-std.ver index 9dc81fa4163..87aac0dfaca 100644 --- a/gcc/libgcc-std.ver +++ b/gcc/libgcc-std.ver @@ -132,6 +132,7 @@ GCC_3.0 { __sjpopnthrow __sjthrow __terminate + __terminate_set_func __throw __throw_type_match __unwinding_cleanup diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index cf6822bb565..5e5d7c01339 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -3143,7 +3143,7 @@ __default_terminate (void) abort (); } -void (*__terminate_func)(void) __attribute__ ((__noreturn__)) = +static __terminate_func_ptr __terminate_func = __default_terminate; void __attribute__((__noreturn__)) @@ -3152,6 +3152,15 @@ __terminate (void) (*__terminate_func)(); } +__terminate_func_ptr +__terminate_set_func (__terminate_func_ptr newfunc) +{ + __terminate_func_ptr oldfunc = __terminate_func; + + __terminate_func = newfunc; + return (oldfunc); +} + void * __throw_type_match (void *catch_type, void *throw_type, void *obj) { diff --git a/gcc/libgcc2.h b/gcc/libgcc2.h index a64eb8f223c..c31a1462598 100644 --- a/gcc/libgcc2.h +++ b/gcc/libgcc2.h @@ -22,12 +22,15 @@ Boston, MA 02111-1307, USA. */ #ifndef __LIBGCC2_H__ #define __LIBGCC2_H__ +typedef void (*__terminate_func_ptr)(void) __attribute__ ((__noreturn__)); + extern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t); extern void *__builtin_saveregs (void); extern void __dummy (void); extern void __clear_cache (char *, char *); extern void __pure_virtual (void) __attribute__ ((__noreturn__)); extern void __terminate (void) __attribute__ ((__noreturn__)); +extern __terminate_func_ptr __terminate_set_func (__terminate_func_ptr); extern void __default_terminate (void) __attribute__ ((__noreturn__)); extern void *__throw_type_match (void *, void *, void *); extern void __empty (void); -- 2.30.2