Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1681269pxb; Thu, 16 Sep 2021 12:50:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhcir+p5ihF6ess0Tpw6wJueGFAEXhBxVjuW4+DI8ICOUtJ8NzI6qXjrRbSefo7dXAMGhP X-Received: by 2002:a92:c56b:: with SMTP id b11mr4978600ilj.225.1631821816235; Thu, 16 Sep 2021 12:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631821816; cv=none; d=google.com; s=arc-20160816; b=zJIQ+MuIEjqL/5Hy/zkS66hfdM25AGe/HfLCobkTVbb4gSUw5Y5w7pfH9LHMo0pqFA fu7V9nQSynxDoEY3pKMqGAm7LpA34L/JESeHmsUsqV9U5nibnB3obhZvkGpTdm3X7+PD vXD4X8jt2jGUlKPSDIh/46UkT6Tn6DXciKJoa6kTkqdUn+OwlMShgBeXwVIvX+EVLGlN CqNuVIgdqky9lDwjQhtd6fWp4rgmzAcC5/OSXBb+heTmdeAD5KHWR2JtXGfhjeaN57yS C5El8qV2ySIrZnYm8wdOAyVZ7cXvK2tBSxqY6pY9QbL3y7XL0EoJmrFjMYiNqdV78R8W 53CQ== 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=ZkM1Wgqcnq1qxuh/26Acq9HbDQXhiHNeZMeiiQCURO+Wvw1kZHVChuTHIJXgTzZXlB dg6d5XMf8FLUVimLv63gZaz39BDNpTgDujxkcIHh20vO8xegaKkwqhrS0/VMgTGnG3Qk 8/SUVvdSxBim2A2qKF7J4BVrFjy4wcjM6+MCO1qMnDOv+AV0LD9rv9k6DntZ5gZu4uH+ 9kb2PWeTWy+VBv53crMjCCgBOEaH22lDNfjXftVdbpb3HnOuyGqZk1OFm+cT6LkTrivK GGRExyvDo0kVeZqxRqbXcmAngZrWkd9vfycdgadNdoEjCCEqzEKGW6ND2HR3PYaxneBU ZTEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jbJOV26r; 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 r1si3416120ilg.125.2021.09.16.12.50.02; Thu, 16 Sep 2021 12:50:16 -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=jbJOV26r; 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 S241373AbhIPQV2 (ORCPT + 99 others); Thu, 16 Sep 2021 12:21:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:48498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235102AbhIPQMo (ORCPT ); Thu, 16 Sep 2021 12:12:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CDB086137F; Thu, 16 Sep 2021 16:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808572; bh=7mFka9LzrtqigieZU60zukE5rqmPUDqyqXjmuylp0YU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jbJOV26rZxHsuJn88kQRVGcn0WrqNxdTKY7coIKbhyfj150rmFwFlhmNCX4SIYtPU 5w1ryDdreQDte3UGbI/6/DTyVp7Gv3FqlBQx8lnBKo47pV36xo2f2xihL/uneTC9Kr PbcfXSKO4WzTnWSPMaKtJWUP4otSaCmZIkD4XADk= 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.10 108/306] kbuild: Fix no symbols warning when CONFIG_TRIM_UNUSD_KSYMS=y Date: Thu, 16 Sep 2021 17:57:33 +0200 Message-Id: <20210916155757.760551693@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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