public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: 瞿仙淼 <xianmiao.qxm@alibaba-inc.com>
To: "newlib" <newlib@sourceware.org>,
	"jjohnstn" <jjohnstn@redhat.com>,
	"vinschen" <vinschen@redhat.com>
Subject: Re: [PATCH] libgloss: csky: use atexit to call fini-array functions.
Date: Fri, 13 Jan 2023 10:07:08 +0800	[thread overview]
Message-ID: <41528e9f-1b8c-4ca0-a2bd-1341e683dca8.xianmiao.qxm@alibaba-inc.com> (raw)
In-Reply-To: <20230110075927.1937-1-cooper.qu@linux.alibaba.com>

[-- 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)

       reply	other threads:[~2023-01-13  2:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230110075927.1937-1-cooper.qu@linux.alibaba.com>
2023-01-13  2:07 ` 瞿仙淼 [this message]
2023-01-13 10:11   ` Corinna Vinschen
2023-01-13 12:46 Xianmiao Qu
2023-01-13 13:10 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41528e9f-1b8c-4ca0-a2bd-1341e683dca8.xianmiao.qxm@alibaba-inc.com \
    --to=xianmiao.qxm@alibaba-inc.com \
    --cc=jjohnstn@redhat.com \
    --cc=newlib@sourceware.org \
    --cc=vinschen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).