Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35729853rwd; Mon, 10 Jul 2023 11:38:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlEcxp1sTRa0UCsKdiG16BwTvJcNlR3W1EdHbr6TGbfW5ubOfMbZqrgu17BhepGNw3SWq94/ X-Received: by 2002:a17:907:9541:b0:96f:8666:5fc4 with SMTP id ex1-20020a170907954100b0096f86665fc4mr13532135ejc.50.1689014332860; Mon, 10 Jul 2023 11:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689014332; cv=none; d=google.com; s=arc-20160816; b=HzP8OnvVz0KIzrIKyasAlDO/VSKehwj+XH1279oHZADqMIwJNgFjGuYZFhmtOoLfTC 080mJESbYAIWTkVFdUoUpM6FQHbm5x7kH9a0j5ME7OemgzU4v5ZLjh6mQw880/1dpEaS N59UKj9UQxnVGa3fCqmIdm0uFI9R8G+jv8AS8ZakLoIKb8ZCchWN0/vSLJr5WXCH5QDR oiLqzTm/4tgMQAIy33ytXVpr4PUM+iaGLlaDl3wMmF43fy5byKHXTMvjiI+5zlLkPvtl JVDMwbBIC5hhayElRWQFY+JUMUipLz7fnVFtmzLz03qDWd5vfJpLO9JR1M9MvRO1JKfj yTUA== 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=E/5VTf/i+9StK9fUfosH70wfKtKeaW/NeZOJ8mGIOck=; fh=B89reJUr71aRxlKJ0DefXyhZ/LUqGOgmP8l7QknfTBo=; b=cq4j1l1N6Bn1LX4PcEK16q7wBHyB8bNTZy068fcEO+YxFPGZ3GnFdKrns2ZyLAV/os HWzJgcCsWMZttKt7rAJzYYktpiAYPWxrVGg7Jmzf7Pcg/oqnOxITEy6KdU7zBlrxRRmP lwefF1pC1X5yIL5tLO5RRs0mmA+1VUzytXx4zaWfTyYamRwgrO4/Y66XQgPShmZeupHS 6n29r6CKhD4vbHYJ8XJ2K3DtMJU/IrOq+H7B34Utc+FydUfzdRMBb+nIQ3LhBqmKZ6ZJ rAdRRpIwli3kVvQxjzrYQV3lVYihdkzuWobK9sfI2fFue8hevhGreyBOr0nbRCtGp2Ko P0pw== 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 k25-20020a170906579900b00992ae4dfc04si116099ejq.990.2023.07.10.11.38.27; Mon, 10 Jul 2023 11:38:52 -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 S231207AbjGJRnh (ORCPT + 99 others); Mon, 10 Jul 2023 13:43:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbjGJRng (ORCPT ); Mon, 10 Jul 2023 13:43:36 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ABDB6DD for ; Mon, 10 Jul 2023 10:43:34 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 36AHhRKI025103; Mon, 10 Jul 2023 19:43:27 +0200 Date: Mon, 10 Jul 2023 19:43:27 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230710-nolibc-environ-v1-1-173831573af6@weissschuh.net> 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 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. > 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 ? Thanks, Willy