mailing list of musl libc
 help / color / mirror / code / Atom feed
From: 王洪亮 <wanghongliang@loongson.cn>
To: musl@lists.openwall.com
Subject: [musl] A question about if crti.s and crtn.s is not necessary?
Date: Wed, 9 Nov 2022 10:51:37 +0800	[thread overview]
Message-ID: <66e5839c-0be7-2c29-df5f-713d7e0d758e@loongson.cn> (raw)

Hi,

In LoongArch port, I found build musl and libc-test is OK without 
crt/loongarch64/crti.s and crt/loongarch64/crtn.s,

so I want to ask if crti.s and crtn.s is not necessary in architecture?


 > diff --git a/crt/loongarch64/crti.s b/crt/loongarch64/crti.s
 > new file mode 100644
 > index 00000000..81c43e6e
 > --- /dev/null
 > +++ b/crt/loongarch64/crti.s
 > @@ -0,0 +1,15 @@
 > +.section .init
 > +.global _init
 > +_init:
 > +    addi.d $sp,$sp,-16
 > +    st.d $fp,$sp,0
 > +    st.d $ra,$sp,8
 > +    addi.d $fp,$sp,16
 > +
 > +.section .fini
 > +.global _fini
 > +_fini:
 > +    addi.d $sp,$sp,-16
 > +    st.d $fp,$sp,0
 > +    st.d $ra,$sp,8
 > +    addi.d $fp,$sp,16
 > diff --git a/crt/loongarch64/crtn.s b/crt/loongarch64/crtn.s
 > new file mode 100644
 > index 00000000..ca3fe80e
 > --- /dev/null
 > +++ b/crt/loongarch64/crtn.s
 > @@ -0,0 +1,12 @@
 > +.section .init
 > +    ld.d $fp,$sp,0
 > +    ld.d $ra,$sp,8
 > +    addi.d $sp,$sp,16
 > +    jr $ra
 > +
 > +
 > +.section .fini
 > +    ld.d $fp,$sp,0
 > +    ld.d $ra,$sp,8
 > +    addi.d $sp,$sp,16
 > +    jr $ra

The crt changes shouldn't be necessary at all huh? I didn't see any 
custom asm
for riscv, for example.



             reply	other threads:[~2022-11-09  2:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09  2:51 王洪亮 [this message]
2022-11-09 11:48 ` Szabolcs Nagy
2022-11-09 12:13   ` Florian Weimer

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=66e5839c-0be7-2c29-df5f-713d7e0d758e@loongson.cn \
    --to=wanghongliang@loongson.cn \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).