public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <thomas@t-8ch.de>
Cc: linux-kernel@vger.kernel.org, Zhangjin Wu <falcon@tinylab.org>
Subject: Re: [PATCH] tools/nolibc: completely remove optional environ support
Date: Tue, 11 Jul 2023 09:11:53 +0200	[thread overview]
Message-ID: <ZK0AudpEIDHEdm74@1wt.eu> (raw)
In-Reply-To: <804671ba-3884-4700-b367-2f84dace89f4@t-8ch.de>

On Mon, Jul 10, 2023 at 07:51:53PM +0200, Thomas Weißschuh wrote:
> On 2023-07-10 19:43:27+0200, Willy Tarreau wrote:
> > Hi Thomas,
> > 
> > On Mon, Jul 10, 2023 at 07:22:53PM +0200, Thomas Weißschuh wrote:
> > > In commit 52e423f5b93e ("tools/nolibc: export environ as a weak symbol on i386")
> > > and friends the asm startup logic was extended to directly populate the
> > > "environ" array.
> > > 
> > > This makes it impossible for "environ" to be dropped by the linker.
> > > Therefore also drop the other logic to handle non-present "environ".
> > 
> > Hmmm OK but at least I'd like that we continue to reference it from
> > nolibc-test to make sure it's still visible. Maybe we could just check
> > that it's always equal to envp ? If we drop its reference from there,
> > sooner or later someone will find it interesting to rename it and some
> > programs referencing it will break.
> 
> Easy enough to test for. I'll send a v2.

Thanks!

> > > Note:
> > > 
> > > Given that nowadays both _auxv and environ are mandatory symbols imposed
> > > by nolibc of pointer size does it make sense to keep the code to make
> > > int-sized errno optional?
> > 
> > While it indeed used to be related to having a data segment or not
> > initially, it still has an impact on our ability to completely drop
> > the errno setting code from all syscalls. Given the SET_ERRNO() macro
> > now I guess it's very cheap to keep it, don't you think ?
> 
> SET_ERRNO irks me a tiny bit :-)

To be honest, it's the same for me. but it's cheap. And when you rebuild
a binary without it you can observe significant savings that can be
important for those who are space-constrained.

> But it's easy enough to keep, let's do so.
> Just wanted to have brought it up.

Yes, you're totally right to raise this, thank you!

Willy

      reply	other threads:[~2023-07-11  7:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10 17:22 [PATCH] tools/nolibc: completely remove optional environ support Thomas Weißschuh
2023-07-10 17:43 ` Willy Tarreau
2023-07-10 17:51   ` Thomas Weißschuh
2023-07-11  7:11     ` 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=ZK0AudpEIDHEdm74@1wt.eu \
    --to=w@1wt.eu \
    --cc=falcon@tinylab.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas@t-8ch.de \
    /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