You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/04/26 06:18:09 UTC

[mynewt-core] 02/03: mcu/fe310: Remove global ctrs initialization from start.s

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 4c3fb709bc00b0102f49921f74c94525b698adbb
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Wed Apr 21 10:45:41 2021 +0200

    mcu/fe310: Remove global ctrs initialization from start.s
    
    Call to __libc_init_array is now present in baselibc start.c.
    
    This removes double initialization of constructors.
    It also removes call to atexit since for embedded systems when
    main() ends it means system reboot so there is no need for cleanup
    here.
    Other MCU's code don't bother with global destructors too.
---
 hw/mcu/sifive/fe310/src/arch/rv32imac/start.s | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/hw/mcu/sifive/fe310/src/arch/rv32imac/start.s b/hw/mcu/sifive/fe310/src/arch/rv32imac/start.s
index 4184fb7..77147da 100644
--- a/hw/mcu/sifive/fe310/src/arch/rv32imac/start.s
+++ b/hw/mcu/sifive/fe310/src/arch/rv32imac/start.s
@@ -62,11 +62,6 @@ _reset_handler:
     la a1, _heap_end
     call _sbrkInit
 
-    /* Call global constructors */
-    la a0, __libc_fini_array
-    call atexit
-    call __libc_init_array
-
     call SystemInit
     call _start
     call _fini