aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/function.c13
2 files changed, 10 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 07d8343..6ba6bb8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2005-05-01 Mark Mitchell <mark@codesourcery.com>
+
+ * function.c (INVOKE__main): Do not define.
+ (expand_main_function): Check HAS_INIT_SECTION when determining
+ whether or not to call __main.
+
2005-05-01 Kazu Hirata <kazu@cs.umass.edu>
* tree-ssa-loop-ivopts.c: Fix a comment typo.
diff --git a/gcc/function.c b/gcc/function.c
index 156dc3b..bde08a8 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3867,14 +3867,6 @@ init_function_for_compilation (void)
VARRAY_GROW (sibcall_epilogue, 0);
}
-/* Define IVOKE__main if we should emit a call to __main at the start
- of "main". */
-#if (!defined(INVOKE__main) \
- && !defined(INIT_SECTION_ASM_OP) \
- && !defined(INIT_ARRAY_SECTION_ASM_OP))
-#define INVOKE__main
-#endif
-
void
expand_main_function (void)
{
@@ -3914,7 +3906,10 @@ expand_main_function (void)
}
#endif
-#if defined(INVOKE__main)
+#if (defined(INVOKE__main) \
+ || (!defined(HAS_INIT_SECTION) \
+ && !defined(INIT_SECTION_ASM_OP) \
+ && !defined(INIT_ARRAY_SECTION_ASM_OP)))
emit_library_call (init_one_libfunc (NAME__MAIN), LCT_NORMAL, VOIDmode, 0);
#endif
}