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:
authorAlexander Fedotov <alfedotov@gmail.com>2019-08-02 15:33:45 +0300
committerRichard Earnshaw <Richard.Earnshaw@arm.com>2019-08-05 15:00:53 +0300
commitbd5596f4fdd8d08966f03057316c1baea754ae4c (patch)
treef20dc874d9c5f77353749d55f3a5d850637079f7
parentdfffe683038357d106893ef1ba30462b31e7b589 (diff)
Align libgloss/arm and libc/sys/arm sources: Lite exit support
Applied changes from commit 2404223: * arm/crt0.S (_mainCRTStartup): Weak reference to atexit and _fini when lite exit is enabled.
-rw-r--r--newlib/libc/sys/arm/crt0.S16
1 files changed, 16 insertions, 0 deletions
diff --git a/newlib/libc/sys/arm/crt0.S b/newlib/libc/sys/arm/crt0.S
index a55aa365b..5e677a23c 100644
--- a/newlib/libc/sys/arm/crt0.S
+++ b/newlib/libc/sys/arm/crt0.S
@@ -518,8 +518,17 @@ __change_mode:
for _fini to be called at program exit. */
movs r4, r0
movs r5, r1
+#ifdef _LITE_EXIT
+ /* Make reference to atexit weak to avoid unconditionally pulling in
+ support code. Refer to comments in __atexit.c for more details. */
+ .weak FUNCTION(atexit)
+ ldr r0, .Latexit
+ cmp r0, #0
+ beq .Lweak_atexit
+#endif
ldr r0, .Lfini
bl FUNCTION (atexit)
+.Lweak_atexit:
bl FUNCTION (_init)
movs r0, r4
movs r1, r5
@@ -589,6 +598,13 @@ change_back:
.LC2:
.word __bss_end__
#ifdef __USES_INITFINI__
+#ifdef _LITE_EXIT
+.Latexit:
+ .word FUNCTION(atexit)
+
+ /* Weak reference _fini in case of lite exit. */
+ .weak FUNCTION(_fini)
+#endif
.Lfini:
.word FUNCTION(_fini)
#endif