summaryrefslogtreecommitdiff
path: root/gcc/crtstuff.c
diff options
context:
space:
mode:
authormerrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4>1996-10-16 20:25:25 +0000
committermerrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4>1996-10-16 20:25:25 +0000
commit8313a7823adb78d51bc8099f15e7c665d8dbb64c (patch)
tree73380f8b5b5334d5ba3a9df98aa3b5ce0c1af224 /gcc/crtstuff.c
parentb3bfba75d0235f7a8da993dd208cbace0fa6dcca (diff)
downloadgcc-8313a7823adb78d51bc8099f15e7c665d8dbb64c.tar.gz
irix6 ctors
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12971 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/crtstuff.c')
-rw-r--r--gcc/crtstuff.c29
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. */