From: Willy Tarreau <w@1wt.eu>
To: Daniel Palmer <daniel@0x0f.com>
Cc: "Thomas Weißschuh" <linux@weissschuh.net>,
linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH] tools/nolibc: sh: enter _start_c with jsr instead of bsr
Date: Sat, 24 Oct 2026 07:27:10 +0200 [thread overview]
Message-ID: <atxBrgD1Xfcvw7pL@1wt.eu> (raw)
In-Reply-To: <CAFr9PXnggcsL5JSV0ASXSfvcbkt30-g1kpTrsa0PDWqgdhcsOg@mail.gmail.com>
Hi Daniel,
On Sat, Oct 24, 2026 at 02:16:10PM +0900, Daniel Palmer wrote:
> Hi Willy, Thomas
>
> On Sat, 24 Oct 2026 at 03:35, Willy Tarreau <w@1wt.eu> wrote:
> > > Maybe we let Daniel break the tie? :-)
>
> mmm I have the same big binary (Quake using nolibc + a thin DRM/KMS +
> ALSA layer, some libm bits from musl) on 32 bit ARM and x86-64 and
> they were fine so my gut feeling would be that this is an SH issue and
> a few extra bytes is fine for such a niche arch.
x86 can call 32-bit displacements, so you have some margin there ;-)
> On SH this also seems to happen for much more normal binaries if you
> enable LTO and get unlucky which points me towards letting the SH
> entry code deal with it.
>
> But also I'm still working on the static PIE thing so nolibc can
> create binaries that nommu can run and in that case it would probably
> be helpful for all of the code that runs before relocation to be close
> together.
>
> I'll have a go at the ld solution and see what happens.
OK!
> Slightly different topic but related: Another thing on my pile of
> patches is some stuff to extend memcpy() slightly so it generates
> word-by-word copies where possible without passing -O3. This helps
> m68k and SH a lot but everyone would end up with the extra bytes for
> the word-by-word copy loop and the check if fallback to byte-by-byte
> is needed. Would wrapping that in something like "#if
> NOLIBC_FAST_MEMCPY" be acceptable?
I've been thinking about similar things a few times, and I think that
for such cases where we implementa naive function for size purposes, we
could also rely on #ifdef __OPTIMIZE_SIZE__ to keep the small one and
switch to the faster one otherwise. That way we can respect each user's
expectations.
Willy
prev parent reply other threads:[~2026-10-24 5:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 10:01 Daniel Palmer
2026-10-22 16:12 ` Thomas Weißschuh
2026-10-23 5:09 ` Willy Tarreau
2026-10-23 15:53 ` Thomas Weißschuh
2026-10-23 16:20 ` Willy Tarreau
2026-10-23 17:32 ` Thomas Weißschuh
2026-10-23 18:35 ` Willy Tarreau
2026-10-24 5:16 ` Daniel Palmer
2026-10-24 5:27 ` Willy Tarreau [this message]
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=atxBrgD1Xfcvw7pL@1wt.eu \
--to=w@1wt.eu \
--cc=daniel@0x0f.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux@weissschuh.net \
/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
all inboxes | Powered by JetHome®