Commit bd5596f4 authored by Alexander Fedotov's avatar Alexander Fedotov Committed by Richard Earnshaw

Align libgloss/arm and libc/sys/arm sources: Lite exit support

Applied changes from commit 2404223d:

	* arm/crt0.S (_mainCRTStartup): Weak reference to atexit and _fini
		when lite exit is enabled.
parent dfffe683
......@@ -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
ldr r0, .Lfini
bl FUNCTION (atexit)
bl FUNCTION (_init)
movs r0, r4
movs r1, r5
......@@ -589,6 +598,13 @@ change_back:
.word __bss_end__
#ifdef __USES_INITFINI__
#ifdef _LITE_EXIT
.word FUNCTION(atexit)
/* Weak reference _fini in case of lite exit. */
.weak FUNCTION(_fini)
.word FUNCTION(_fini)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment