Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2349767pxb; Mon, 20 Sep 2021 19:43:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3fvSPywo5OxXj+LNHpSfhVRACAttORaE10DI2J5y3d2rG8MJdhrWWPwn+b3TEJsjYb4ct X-Received: by 2002:a50:bec8:: with SMTP id e8mr13996646edk.231.1632192239606; Mon, 20 Sep 2021 19:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192239; cv=none; d=google.com; s=arc-20160816; b=gc4kcfrKggYyWw1iuKL4NR18NorYp6ozaHzviroBH6Wpd5923Z+xqRLXFbAhCrKARK HShQhI1fVemH1D54VAP0rQETmVs6EzgNcbY3pAue4NWAB2y9ACb95wppuTD4slMuRAp+ 4te4pYW3/gHRl+o+ZekNqvlzbMWnMOEBW0XMA25otOK0eIafKcza90ZDcc8nhotnum2T 4sLrW9RF5SYl8hvXAoOQ8Y6NC50U7QL2194iw2BHR4+ezBuKCh2w8FhgDuuiI8JjNFwj olI7aZ9j2t6oe3kiGYNGzQ2SDif8VIYsznLV1hakoD6UtawzeUdUIiM2e1RpKU+tfmzd 3VbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6+vZPSaO2bkv+GYyvSVlkTtUOMRdGGwKggHKoEczktw=; b=Lig/WI4XIKfPYt6Mpq+Lb8NvdY2H87ZW/wuo3oJ12476rj3IXgUrd+6GKJrVvzjqT6 EgGimXDNdXXRa9WXasposBsFNdzEXy0poA4oZieyh1FG3VzwmnIJWLOcHgOWvXrhFR+e 5VVx9LpkcsxdavVpzDVb3YBqwLIYtJt92ITNOYtjvrwkaB2NWSGg2Kdg17B75EWRGGPs PgZxFbn0l4aWguntDXFjXftUFFMQYZZn37cU/AWSUcnIuvJheWQIJATwNfUjG1dNBFrQ t6s4C3xxKwBQSOmxD6fCod1si5C/7zcAs8PGKPv29KAuTqZHcD9VRj7seEAz+GfpzA7B J+pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xg8ZcKOP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la2si19311282ejc.153.2021.09.20.19.43.35; Mon, 20 Sep 2021 19:43:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xg8ZcKOP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377884AbhITSV2 (ORCPT + 99 others); Mon, 20 Sep 2021 14:21:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:60800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357830AbhITSFI (ORCPT ); Mon, 20 Sep 2021 14:05:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A1DB863245; Mon, 20 Sep 2021 17:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158252; bh=7mFka9LzrtqigieZU60zukE5rqmPUDqyqXjmuylp0YU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xg8ZcKOPaINsXZx+qcpeyOu995+cdbRNkYeS5rXXyCH85MxV0UcPlXmzYs4VWiyWB TAT9rT5DIRP7O7Cx6JxR38NmwjoFUnLjr8jOQX+g2siRzB9R0Lj2qiJ7rnDQK6Ktf2 xLltULKXDL1ggF1litJOQCjZiGjGPpXk2Dk/SIgY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Sasha Levin Subject: [PATCH 5.4 070/260] kbuild: Fix no symbols warning when CONFIG_TRIM_UNUSD_KSYMS=y Date: Mon, 20 Sep 2021 18:41:28 +0200 Message-Id: <20210920163933.504199911@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 52d83df682c82055961531853c066f4f16e234ea ] When CONFIG_TRIM_UNUSED_KSYMS is enabled, I see some warnings like this: nm: arch/x86/entry/vdso/vdso32/note.o: no symbols $NM (both GNU nm and llvm-nm) warns when no symbol is found in the object. Suppress the stderr. Fangrui Song mentioned binutils>=2.37 `nm -q` can be used to suppress "no symbols" [1], and llvm-nm>=13.0.0 supports -q as well. We cannot use it for now, but note it as a TODO. [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=27408 Fixes: bbda5ec671d3 ("kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS") Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Signed-off-by: Sasha Levin --- scripts/gen_ksymdeps.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/gen_ksymdeps.sh b/scripts/gen_ksymdeps.sh index 1324986e1362..725e8c9c1b53 100755 --- a/scripts/gen_ksymdeps.sh +++ b/scripts/gen_ksymdeps.sh @@ -4,7 +4,13 @@ set -e # List of exported symbols -ksyms=$($NM $1 | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z) +# +# If the object has no symbol, $NM warns 'no symbols'. +# Suppress the stderr. +# TODO: +# Use -q instead of 2>/dev/null when we upgrade the minimum version of +# binutils to 2.37, llvm to 13.0.0. +ksyms=$($NM $1 2>/dev/null | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z) if [ -z "$ksyms" ]; then exit 0 -- 2.30.2