Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1784577pxb; Thu, 16 Sep 2021 15:50:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztUBMkmyDstB8sVb0dc3Ud0Gc+nB2UfSMa1oFDWzcd5IMoiSX4+Cw5X1n0UKrHml1JLrD0 X-Received: by 2002:a05:6402:31eb:: with SMTP id dy11mr9379870edb.17.1631832626432; Thu, 16 Sep 2021 15:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631832626; cv=none; d=google.com; s=arc-20160816; b=bkWtY1MDHF5c3FrTn4d05RrS8E2fb3MC+0jBjpcBnKmELMDRlpooxAhiSOI767/i+k M+eIeSxkuuhxhKHP50ppiBAm26fqpxrkgHpMzOCemUF+2Ocfq4Oayp+AcJT4zOyfn1ux teNffX5ZWbKJqxkG9SGhvTGiISOcWcUS4DioEVACHDkCeiHhOF760rPyB92d3KPpO040 Tlp5VDq8qjeeki6Brkm8ZrQ9cJ2x6JyiJo3rA8nuSd9JioAsM48fLXM2ewAqvTmf5Djb Qn77/Hpv6cYTJ2zoT/X19KurpcJjxny/+fvvvGXWUrjmAhQPEnIOuN1OiNH8OIRoJk3+ OZYA== 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=YcESEiIYiyea5ukX5d+/v3ZwGf03n3NhQ9WXhQdsSxYTv/GHTK6vjXmfhfaiaPoz7y Iz6zsosZ+OVWJsp84+xt5rINp/nZledwWx8DovAfAsD77o0gGf6iBF3NifFkiXt3Cloe Gr7krbu+XYaQfFlFvfincqOE9Z3nXfini74tabHp7KIa0tM4lu8UCoihkhybJV0imMjn SW4sXLxoncNr8211RCi1FywcIpduGBA8nUS9FP/1oZlgvlCXhNH9fAVfrqo7ORNEteY1 oeks7IXkeucs4A2FSgz/BnFlhGBESidewDwGw3dW/d4UIIbHAa+sjSivB1SsfK3XdNsp ufBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0zXy7FNQ; 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 d16si4998105ejm.114.2021.09.16.15.50.02; Thu, 16 Sep 2021 15:50:26 -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=0zXy7FNQ; 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 S243113AbhIPQp1 (ORCPT + 99 others); Thu, 16 Sep 2021 12:45:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:51674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244688AbhIPQj1 (ORCPT ); Thu, 16 Sep 2021 12:39:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BEAA261452; Thu, 16 Sep 2021 16:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809394; bh=7mFka9LzrtqigieZU60zukE5rqmPUDqyqXjmuylp0YU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0zXy7FNQnuFmI3AT7SLhJUvpLg1JRau5eydz9GvhmsRnAbn9XcRJ868B9ml4AiFG5 dDDDCEnm98xBLOdSqFOGoR5/2jso+xAccKTmc81PBJZAn39qJqFg+cq7leRR/v4IKk xuSU+Rue5kVT3vyrNNQDoPHBk+bcrS8hGTzykeZg= 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.13 137/380] kbuild: Fix no symbols warning when CONFIG_TRIM_UNUSD_KSYMS=y Date: Thu, 16 Sep 2021 17:58:14 +0200 Message-Id: <20210916155808.698071142@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@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