diff options
author | Jason Merrill <merrill@gnu.org> | 1996-10-16 20:25:25 +0000 |
---|---|---|
committer | Jason Merrill <merrill@gnu.org> | 1996-10-16 20:25:25 +0000 |
commit | fe1fd3534199f0595b01432701f76c65d4a464dc (patch) | |
tree | 73380f8b5b5334d5ba3a9df98aa3b5ce0c1af224 /gcc/crtstuff.c | |
parent | c8507ba06b74b058357b484e7a400da11935954c (diff) | |
download | gcc-fe1fd3534199f0595b01432701f76c65d4a464dc.tar.gz |
irix6 ctors
From-SVN: r12971
Diffstat (limited to 'gcc/crtstuff.c')
-rw-r--r-- | gcc/crtstuff.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c index ce5ef3293ec..f41035c91ae 100644 --- a/gcc/crtstuff.c +++ b/gcc/crtstuff.c @@ -186,6 +186,21 @@ __do_global_ctors_aux () /* prologue goes in .init section */ } #endif /* OBJECT_FORMAT_ELF */ + +#else /* defined(INIT_SECTION_ASM_OP) */ + +/* This case is used by the Irix 6 port, which supports named sections but + not an SVR4-style .fini section. __do_global_dtors can be non-static + in this case because the -fini switch to ld binds strongly. */ +static func_ptr __DTOR_LIST__[]; +void +__do_global_dtors () +{ + func_ptr *p; + for (p = __DTOR_LIST__ + 1; *p; p++) + (*p) (); +} + #endif /* defined(INIT_SECTION_ASM_OP) */ /* Force cc1 to switch to .data section. */ @@ -297,6 +312,20 @@ __do_global_ctors_aux () /* prologue goes in .text section */ #endif /* OBJECT_FORMAT_ELF */ +#else /* defined(INIT_SECTION_ASM_OP) */ + +/* This case is used by the Irix 6 port, which supports named sections but + not an SVR4-style .init section. __do_global_ctors can be non-static + in this case because the -init switch to ld binds strongly. */ +static func_ptr __CTOR_END__[]; +void +__do_global_ctors () +{ + func_ptr *p; + for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--) + (*p) (); +} + #endif /* defined(INIT_SECTION_ASM_OP) */ /* Force cc1 to switch to .data section. */ |