diff options
author | Richard Henderson <rth@redhat.com> | 2001-05-22 16:57:40 +0000 |
---|---|---|
committer | Richard Henderson <rth@redhat.com> | 2001-05-22 16:57:40 +0000 |
commit | fac334a2934b32e2ba7586396598affc6b495439 (patch) | |
tree | f3a57d110a686d95d437a43f194144c18a10751a /gcc/crtstuff.c | |
parent | 849a1e5eda15fbc9da0dee9bb9cf95e97e39da3d (diff) |
* crtstuff.c (__register_frame_info_bases): Declare.
(frame_dummy): Use it, if CRT_GET_RFIB_TEXT or CRT_GET_RFIB_DATA.
(__do_global_dtors_aux, __do_global_dtors): Streamline.
* config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New.
(CRT_GET_RFIB_DATA): New.
* config/i386/sysv4.h: Likewise.
* config/i386/sco5.h: Likewise.
(ASM_PREFERRED_EH_DATA_FORMAT): New.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@42453 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/crtstuff.c')
-rw-r--r-- | gcc/crtstuff.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c index b8f6df588f8..1897185f3d1 100644 --- a/gcc/crtstuff.c +++ b/gcc/crtstuff.c @@ -90,7 +90,9 @@ Boston, MA 02111-1307, USA. */ be weak in this file if at all possible. */ extern void __register_frame_info (void *, struct object *) TARGET_ATTRIBUTE_WEAK; - +extern void __register_frame_info_bases (void *, struct object *, + void *, void *) + TARGET_ATTRIBUTE_WEAK; extern void *__deregister_frame_info (void *) TARGET_ATTRIBUTE_WEAK; @@ -190,9 +192,10 @@ static void __do_global_dtors_aux (void) { static func_ptr *p = __DTOR_LIST__ + 1; - static int completed = 0; + static int completed; + func_ptr f; - if (completed) + if (__builtin_expect (completed, 0)) return; #ifdef CRTSTUFFS_O @@ -200,10 +203,10 @@ __do_global_dtors_aux (void) __cxa_finalize (__dso_handle); #endif - while (*p) + while ((f = *p)) { p++; - (*(p-1)) (); + f (); } #ifdef EH_FRAME_SECTION_ASM_OP @@ -236,8 +239,24 @@ static void frame_dummy (void) { static struct object object; +#if defined(CRT_GET_RFIB_TEXT) || defined(CRT_GET_RFIB_DATA) + void *tbase, *dbase; +#ifdef CRT_GET_RFIB_TEXT + CRT_GET_RFIB_TEXT (tbase); +#else + tbase = 0; +#endif +#ifdef CRT_GET_RFIB_DATA + CRT_GET_RFIB_DATA (dbase); +#else + dbase = 0; +#endif + if (__register_frame_info_bases) + __register_frame_info_bases (__EH_FRAME_BEGIN__, &object, tbase, dbase); +#else if (__register_frame_info) __register_frame_info (__EH_FRAME_BEGIN__, &object); +#endif } static void __attribute__ ((__unused__)) @@ -317,9 +336,9 @@ static func_ptr __DTOR_LIST__[]; void __do_global_dtors (void) { - func_ptr *p; - for (p = __DTOR_LIST__ + 1; *p; p++) - (*p) (); + func_ptr *p, f; + for (p = __DTOR_LIST__ + 1; (f = *p); p++) + f (); #ifdef EH_FRAME_SECTION_ASM_OP if (__deregister_frame_info) |