Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36442307rwd; Tue, 11 Jul 2023 00:40:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlFBdknW3ykfVKao24XocexmqB1dRN6BKXyn8RS/Gm1AhkM3wHvt031VUtXoubulN3BNWPQT X-Received: by 2002:a17:903:228a:b0:1b6:6b90:7c2f with SMTP id b10-20020a170903228a00b001b66b907c2fmr13900333plh.55.1689061256843; Tue, 11 Jul 2023 00:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689061256; cv=none; d=google.com; s=arc-20160816; b=ZWPElMnWV9QcUmf9rmIut4U2m3XEaFcZNN/RquH6b+wEhcdLHml7qLK+Ib6YOc4sil C2HSf04LVLHE8d7jobie2BONAXn0vgM+OdNPY1Xrrh1yzls5oXMODnv6EZZ0LqE8CmZI yXYlTMacZG/tIdqNjNKH9c02Mr5Y2tp6TCSgd/ShDHiSWn68u7G/XJgUk4gCDEs3nw1Y tTlJFgLCxODFUjJMWGj7rieBS7gCOBYwhr8KGDYiPCGULdyz2TXtMtXcJqFs3Lk6LeJp ppAVAph6dgR8u/Marx4ZPBgkpybupcfPDBNSQ8sXeq1rG6m9m8Xoytj3pQ+4CAoSjO0S bezg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fyAQC8Q1DXFHGvl69dRSfXqAKcuJtHP+qgam69BCsSk=; fh=YmRtGvnwK05TY7bsceFdZ3XCy9nQQXis0bPM6jcYu5w=; b=AjjuenPjRCOQJLg3KJ82ocYX1R8/oQGZUywD+fcWNo93MBmb9H+yiwp9jS8QZh0RlB nuhmnIXfu+5oq1/hPtncRRFllhW5DL6e2ahCzJFV/U7zGMjq3OPqEqpzkZ5URR5ifxkO RpMQ+4MTO982HxN24qSo/8E9vePRBWPNW8zrcd/c0g7U2f+kHydGMA3KsWSiYk2Qu81Q knHZi7bonlQdfCjT+UDKXUGkGCmtGdaivWzZGWKYhtJG5KKFD13mvaDFInzZ78Rek/Jo /pCPogkQQ8Ln7vj/8XAPw1V+mPYG2iKU4Cydfkq7YwFebqAvRXvygvjqOgIOo9JCcvZo iY2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kf12-20020a17090305cc00b001b9d03d0bdesi1139028plb.79.2023.07.11.00.40.44; Tue, 11 Jul 2023 00:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbjGKHMH (ORCPT + 99 others); Tue, 11 Jul 2023 03:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230255AbjGKHMG (ORCPT ); Tue, 11 Jul 2023 03:12:06 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 05717CE for ; Tue, 11 Jul 2023 00:12:04 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 36B7BrF7030670; Tue, 11 Jul 2023 09:11:53 +0200 Date: Tue, 11 Jul 2023 09:11:53 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: linux-kernel@vger.kernel.org, Zhangjin Wu Subject: Re: [PATCH] tools/nolibc: completely remove optional environ support Message-ID: References: <20230710-nolibc-environ-v1-1-173831573af6@weissschuh.net> <804671ba-3884-4700-b367-2f84dace89f4@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <804671ba-3884-4700-b367-2f84dace89f4@t-8ch.de> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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