mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] A question about if crti.s and crtn.s is not necessary?
@ 2022-11-09  2:51 王洪亮
  2022-11-09 11:48 ` Szabolcs Nagy
  0 siblings, 1 reply; 3+ messages in thread
From: 王洪亮 @ 2022-11-09  2:51 UTC (permalink / raw)
  To: musl

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.



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

end of thread, other threads:[~2022-11-09 12:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09  2:51 [musl] A question about if crti.s and crtn.s is not necessary? 王洪亮
2022-11-09 11:48 ` Szabolcs Nagy
2022-11-09 12:13   ` Florian Weimer

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