public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libgloss: csky: use atexit to call fini-array functions.
@ 2023-01-13 12:46 Xianmiao Qu
  2023-01-13 13:10 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Xianmiao Qu @ 2023-01-13 12:46 UTC (permalink / raw)
  To: newlib, vinschen

__libc_fini_array should be called upon exit to call the
global termination functions in fini-array, use atexit to
register it at __start.
---
 libgloss/csky/crt0.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libgloss/csky/crt0.S b/libgloss/csky/crt0.S
index a0651a734..49f7da364 100644
--- a/libgloss/csky/crt0.S
+++ b/libgloss/csky/crt0.S
@@ -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
-- 
2.32.1 (Apple Git-133)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libgloss: csky: use atexit to call fini-array functions.
  2023-01-13 12:46 [PATCH] libgloss: csky: use atexit to call fini-array functions Xianmiao Qu
@ 2023-01-13 13:10 ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2023-01-13 13:10 UTC (permalink / raw)
  To: Xianmiao Qu; +Cc: newlib

Please don't CC me.  I'm subscribed to the newlib ML anyway.  Thanks.

On Jan 13 20:46, Xianmiao Qu wrote:
> __libc_fini_array should be called upon exit to call the
> global termination functions in fini-array, use atexit to
> register it at __start.
> ---
>  libgloss/csky/crt0.S | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libgloss/csky/crt0.S b/libgloss/csky/crt0.S
> index a0651a734..49f7da364 100644
> --- a/libgloss/csky/crt0.S
> +++ b/libgloss/csky/crt0.S
> @@ -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
> -- 
> 2.32.1 (Apple Git-133)

Pushed.


Thanks,
Corinna


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libgloss: csky: use atexit to call fini-array functions.
  2023-01-13  2:07 ` 瞿仙淼
@ 2023-01-13 10:11   ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2023-01-13 10:11 UTC (permalink / raw)
  To: 瞿仙淼; +Cc: newlib

Hi Cooper,

On Jan 13 10:07, 瞿仙淼 wrote:
> Hi,
> Could someone review this patch? This is a small change, I would
> appreciate it if anyone would like to review.

your original mail didn't make it to the newlib ML, I don't see this in
the archives @ https://sourceware.org/pipermail/newlib/2023/ either.

Can you resend your patch with `git send-email' or as attachment?

But see below.

> ------------------------------------------------------------------
> From:Xianmiao Qu <cooper.qu@linux.alibaba.com>
> Sent At:2023 Jan. 10 (Tue.) 15:59
> To:newlib <newlib@sourceware.org>
> Cc:Xianmiao Qu <cooper.qu@linux.alibaba.com>
> Subject:[PATCH] 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.

There should be an empty line between the first and the second line of
the commit message.  The text up to the first blank line in a commit
message is treated as the commit title and your message results in a multi
line summary.

Other than that, your patch looks goot to me.


Thanks,
Corinna


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libgloss: csky: use atexit to call fini-array functions.
       [not found] <20230110075927.1937-1-cooper.qu@linux.alibaba.com>
@ 2023-01-13  2:07 ` 瞿仙淼
  2023-01-13 10:11   ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: 瞿仙淼 @ 2023-01-13  2:07 UTC (permalink / raw)
  To: newlib, jjohnstn, vinschen

[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]

Hi,
Could someone review this patch? This is a small change, I would appreciate it if anyone would like to review.
Thanks,
Cooper
------------------------------------------------------------------
From:Xianmiao Qu <cooper.qu@linux.alibaba.com>
Sent At:2023 Jan. 10 (Tue.) 15:59
To:newlib <newlib@sourceware.org>
Cc:Xianmiao Qu <cooper.qu@linux.alibaba.com>
Subject:[PATCH] 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.
---
 libgloss/csky/crt0.S | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/libgloss/csky/crt0.S b/libgloss/csky/crt0.S
index a0651a734..49f7da364 100644
--- a/libgloss/csky/crt0.S
+++ b/libgloss/csky/crt0.S
@@ -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
-- 
2.32.1 (Apple Git-133)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-13 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13 12:46 [PATCH] libgloss: csky: use atexit to call fini-array functions Xianmiao Qu
2023-01-13 13:10 ` Corinna Vinschen
     [not found] <20230110075927.1937-1-cooper.qu@linux.alibaba.com>
2023-01-13  2:07 ` 瞿仙淼
2023-01-13 10:11   ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).