Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35719222rwd; Mon, 10 Jul 2023 11:27:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlH9FPJjHWMGpOIpN8ULBsxy+IU8Sl7QQP3QkjIJ4NpI2sv3aro/9mu1I14XDH/puEy5sekA X-Received: by 2002:a17:906:51d4:b0:987:16c6:6ff3 with SMTP id v20-20020a17090651d400b0098716c66ff3mr12744413ejk.38.1689013652856; Mon, 10 Jul 2023 11:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689013652; cv=none; d=google.com; s=arc-20160816; b=r7vTtYfNw62yvrkJeZ2J8po2vNWf7AQgCTErmz74RcRUwR+nbXOPvmgtjC4m3dA1GH uP28igIVSpXRjTKAFB7shxUTAUx+y2wJhuChpgzo6HvwbOnOb7XasqaCB9iJJjBAzvCg EpF1F7qK/vClRb64mbR7LddxnUiwUD6ByjtWxureiy6OTwBBuUS+f+TrUm87HNu6TkvX ljbgiI+NySpolmNCzmqmUsqU3efb2qHD8YFwNU6Jmud2RSAYyKqFiVfWktcs5RjGd+da BqQaaAViv0uT5snWybNTUGGHk45Cb3iO8nIi7+yxSZL7SjkdxMXbbd8sd7vZE2pPlexy 2MmA== 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:dkim-signature; bh=yAi8ZVLm88QYq+JgGpaaXr7VF3iXtBXAOnXXwnGajkc=; fh=70c5vieYm9nCX+n2yyi8dOZx8+Zw7H5v2DfkMYCr3G4=; b=JqtqQREEIgceO4bQo5Sq5/D+HcgxJ6JLssUTpY6VfyZIqqzYzagZMdRrEqvuEt3+wv PVyZxVpwu5xcEJYSKj/TiLDOsIWaAiP3LiJjjZqBbxovYVCfQhTXoQgLB35mMMZ+7vdf 7irkKwtU7lnsBTMS+hpkEdx+1mFMW/7U22eUEwU+8GpQAM1KTaLes9U5XU2xWF1Ilcae ioLHeCAv44HVIzzOk/SE22CM3f/f0hxNlZfp21UpJx509Pa1eFyhdAOb97u2fdL38JFp SxiAb+8dGdk3l7nqnx7/VhWOrQcHpKkllw9O4gZjpSGEwJW8fhlUIgiraAUiI8NZYzJv v7Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b="NBUV/JAf"; 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 kk21-20020a170907767500b00992bf8cc68csi95066ejc.973.2023.07.10.11.27.08; Mon, 10 Jul 2023 11:27:32 -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; dkim=pass header.i=@t-8ch.de header.s=mail header.b="NBUV/JAf"; 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 S231144AbjGJRv6 (ORCPT + 99 others); Mon, 10 Jul 2023 13:51:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbjGJRv5 (ORCPT ); Mon, 10 Jul 2023 13:51:57 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F543AD for ; Mon, 10 Jul 2023 10:51:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1689011514; bh=WV6iTHNAjUAk0vrAhPrfPwRXuH5RztHU4ZrjaCHu7cw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NBUV/JAfZ0D6p37Vd/VeBxPU22HScKokphUudTTze53QL+8HUrp20Dw2m0dT1s2En +qyT8K2eOUrZlaigDMSXcN5xVzCQgZuU1rG2y90W00w/iW+/jPDnTqHglGN5ZtXjq1 Kjr7tJE8Np6VGb5JhrB+tQ87sijtGqDFo/DfDZ84= Date: Mon, 10 Jul 2023 19:51:53 +0200 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Willy Tarreau Cc: linux-kernel@vger.kernel.org, Zhangjin Wu Subject: Re: [PATCH] tools/nolibc: completely remove optional environ support Message-ID: <804671ba-3884-4700-b367-2f84dace89f4@t-8ch.de> References: <20230710-nolibc-environ-v1-1-173831573af6@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,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 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. > > 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 :-) But it's easy enough to keep, let's do so. Just wanted to have brought it up. Thomas