mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: 王洪亮 <wanghongliang@loongson.cn>
Cc: musl@lists.openwall.com
Subject: Re: [musl] A question about if crti.s and crtn.s is not necessary?
Date: Wed, 9 Nov 2022 12:48:54 +0100	[thread overview]
Message-ID: <20221109114854.GD98588@port70.net> (raw)
In-Reply-To: <66e5839c-0be7-2c29-df5f-713d7e0d758e@loongson.cn>

* 王洪亮 <wanghongliang@loongson.cn> [2022-11-09 10:51:37 +0800]:
> 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?

in musl the generic crti/crtn.o is empty.
which works if no user code uses .init or .fini sections.

the old way of doing ctors/dtors used .init/.fini but new targets use
.init_array/.fini_array for a while now.

if no language feature uses .init/.fini, should we support this?
well if they are still part of the elf abi and somebody writes code
manually for .init/.fini then yes. however it's not clear to me that
default linker scripts that still treat these sections specially on
new targets do so as old habit i.e. they have no abi relevance, or
if this is still something that's supposed to work.

i think they can be empty on new targets, but it does not hurt to have
support in case somebody needs the .init/.fini behaviour (which has
static and dynamic linker support already anyway).

libc-test does not test for it, and would be tricky to do so portably.

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09  2:51 王洪亮
2022-11-09 11:48 ` Szabolcs Nagy [this message]
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=20221109114854.GD98588@port70.net \
    --to=nsz@port70.net \
    --cc=musl@lists.openwall.com \
    --cc=wanghongliang@loongson.cn \
    /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).