Re: [RFC PATCH 0/9] nolibc: Add static-pie support
From: Willy Tarreau
Date: Sun Feb 01 2026 - 16:49:21 EST
On Mon, Feb 02, 2026 at 06:45:40AM +0900, Daniel Palmer wrote:
> Hi Willy,
>
> On Mon, 2 Feb 2026 at 03:14, Willy Tarreau <w@xxxxxx> wrote:
> > $ diff -u ret0*size
> > --- ret0-6.19-rc7.size 2026-02-01 19:04:33.918536545 +0100
> > +++ ret0-daniel.size 2026-02-01 19:04:40.914761767 +0100
> > @@ -16,4 +16,5 @@
> > 0000000000000011 W raise
> > 0000000000000012 W abort
> > 0000000000000023 W memmove
> > -0000000000000098 W _start_c
> > +0000000000000086 W __start_c
> > +000000000000015f W _start_c
> >
> > The delta is indeed 333 bytes.
> >
> > Is there anything we could detect at build time to detect that we want to
> > go the heavy way ? Maybe we should only condition that code to __PIE__ ?
> > There's nothing critical, it's really about having an open discussion on
> > this, because we're trying to keep the minimal binaries small, and here
> > we're just doubling the size of the smallest ones all the time.
> >
> > Thanks!
> > Willy
>
> Thank you for the feedback. I'll work out a way of hiding all of the
> new code unless it's needed.
> I think there might still be some increase in size from splitting
> _start_c() into two parts though.
Yes but that's expected. We can spend a few bytes here and there for the
good cause, it's just that here there's an opportunity to avoid most of
them when not needed.
Thanks,
Willy