Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2002-02-05 21:09:18 +0300
committerMark Salter <msalter@redhat.com>2002-02-05 21:09:18 +0300
commit4fa60ba90198174426d362afa299189f82ba0a42 (patch)
tree29ed3c7ab9dba1af56ac8244837b7452dcced011 /libgloss
parentbf317e4b797d7e08e5f6a3c932563605ad630e33 (diff)
Add init/fini support.
Diffstat (limited to 'libgloss')
-rw-r--r--libgloss/arm/redboot-crt0.S15
1 files changed, 15 insertions, 0 deletions
diff --git a/libgloss/arm/redboot-crt0.S b/libgloss/arm/redboot-crt0.S
index e7153341e..e14559a59 100644
--- a/libgloss/arm/redboot-crt0.S
+++ b/libgloss/arm/redboot-crt0.S
@@ -49,18 +49,33 @@ __change_mode:
sub r0, r0, #32
mov sp, r0
+#ifdef __USES_INITFINI__
+ /* Some arm/elf targets use the .init and .fini sections
+ to create constructors and destructors, and for these
+ targets we need to call the _init function and arrange
+ for _fini to be called at program exit. */
+ ldr r0, .Lfini
+ bl SYM_NAME (atexit)
+ bl SYM_NAME (_init)
+#endif
+
mov a1, #0
ldr a2, .LC3
mov a3, a2
bl SYM_NAME(main)
1: bl SYM_NAME(exit)
b 1b
+ .align 2
.LC1:
.word __bss_start__
.LC2:
.word __bss_end__
.LC3:
.word 0
+#ifdef __USES_INITFINI__
+.Lfini:
+ .word SYM_NAME(_fini)
+#endif
#if 0
#ifdef __thumb__