diff options
| author | jules <jules@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-29 14:09:45 +0000 |
|---|---|---|
| committer | jules <jules@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-29 14:09:45 +0000 |
| commit | d24bc14583aaf3a0edb93267bffb5b240252d87c (patch) | |
| tree | a069a1c7e66dac7e1d042f7a22530125e2918422 /gcc/function.c | |
| parent | c828481ae6866cf54f3fe408e82e81d93c38b6d6 (diff) | |
| download | ppe42-gcc-d24bc14583aaf3a0edb93267bffb5b240252d87c.tar.gz ppe42-gcc-d24bc14583aaf3a0edb93267bffb5b240252d87c.zip | |
* crtstuff.c: Handle targets that use .init_array.
* function.c (HAS_INIT_SECTION): Do not define. Instead, make sure
that INVOKE__main is set correctly.
(expand_main_function): Test INVOKE__main.
* libgcc2.c: Do not define __main when using .init_array.
* config/arm/arm.c (arm_elf_asm_constructor): New function.
* config/arm/arm.h (CTORS_SECTION_ASM_OP): Define, with specialized
libgcc version.
(DTORS_SECTION_ASM_OP): Likewise.
(CTOR_LIST_BEGIN): Define specially when in libgcc.
(CTOR_LIST_END): Likewise.
(DTOR_LIST_BEGIN): Likewise.
(DTOR_LIST_END): Likewise.
* config/arm/bpapi.h (INIT_SECTION_ASM_OP): Do not define it.
(FINI_SECTION_ASM_OP): Likewise.
(INIT_ARRAY_SECTION_ASM_OP): Define.
(FINI_ARRAY_SECTION_ASM_OP): Likewise.
* config/arm/elf.h (TARGET_ASM_CONSTRUCTOR): Define.
(SUPPORTS_INIT_PRIORITY): Evaluate to false for EABI based targets.
* doc/tm.texi (INIT_ARRAY_SECTION_ASM_OP): Document.
(FINI_ARRAY_SECTION_ASM_OP): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98986 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
| -rw-r--r-- | gcc/function.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/function.c b/gcc/function.c index 5a1cf8b36c1..a092d6c62e0 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4035,11 +4035,12 @@ init_function_for_compilation (void) VARRAY_GROW (sibcall_epilogue, 0); } -/* Expand a call to __main at the beginning of a possible main function. */ - -#if defined(INIT_SECTION_ASM_OP) && !defined(INVOKE__main) -#undef HAS_INIT_SECTION -#define HAS_INIT_SECTION +/* 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 @@ -4081,7 +4082,7 @@ expand_main_function (void) } #endif -#ifndef HAS_INIT_SECTION +#if defined(INVOKE__main) emit_library_call (init_one_libfunc (NAME__MAIN), LCT_NORMAL, VOIDmode, 0); #endif } |

