libgloss: csky: use atexit to call fini-array functions.

__libc_fini_array should be called upon exit to call the
global termination functions in fini-array, use atexit to
register it at __start.
This commit is contained in:
Xianmiao Qu 2023-01-13 20:46:47 +08:00 committed by Corinna Vinschen
parent 3ef006f056
commit 7f4c04755e
1 changed files with 2 additions and 0 deletions

View File

@ -150,6 +150,8 @@ __start:
* Assember start up done, C codes start here.
*/
__goto_c:
lrw r0, __libc_fini_array # Register global termination functions
jbsr atexit # to be called upon exit
/*jsri main*/
lrw r5, __libc_init_array
jsr r5