Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1916067pxb; Thu, 16 Sep 2021 20:09:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRwGUWg4wAVs2ktFxaYE9gHYXXd1kwcsqQIkUqzgaZ2Y0eemq/HR7AW5e2eesS2AoNHK/G X-Received: by 2002:a17:906:5384:: with SMTP id g4mr9742996ejo.27.1631848164053; Thu, 16 Sep 2021 20:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631848164; cv=none; d=google.com; s=arc-20160816; b=BuZUI6tz1DL6XLHa3BMtsIG6Ghym6xXJ9BGfAaVgtPCQV9T9WBFw7n2lVqvbLTBCF7 XM7Jo6u2pD2CNS99o/K5n3JhRTmaLUsW/FkngQjdGBI+0PPm3GteX3LztMsN0w53S1fW l1m42il+nNMGxC1rJbhx81Z/YNlBLMZ73Eqh3Tx7VGGkNfTUIjQG+E279MM+qp77eJV0 VBXEgh4Aw+uMwSjbE6n0Op276+UT+nkMaQ1Pys3er8AsM269kQ+FcWYqfwIQC78zsgJ0 yDnu0nGUNTIp5jmPSg5PY5QkDmH3ttwOxgBVyrdoLlCdu3pCI35jxLJ952Y5imx2WjKZ J3+Q== 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=n2hlsn36gXOhdaDuOP7f6nD+5I1sxWPyjr30gub2p8tgp1pLEbeMDUFDa9QDQImN6n 8LVtZBE0NWmsZxNPYAYe5s2oc3MV4H/x0za8/VsvwrGxaZn6rhQyfqDgwKdD+KNs+ZeO XbBCZxxUKC5KGoGmPpVM2iAONXX/2WTH1Jed2yGLQ7x45lqqDpT0nGUa5yhOQ6czjxYZ XQ2LwxRpwxtMKHp/6gRe9UmSqfVXi8XXZEa9G/91a4IqRU3rOCuyeUzZh8TruBd4uSC4 4KwDPTjmYkOAbJcwKqNvc0GvA3S4igJYgHjuEgFZY7i7qD0D3EIm99v0tSf2JLXUGRne hgqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PDFnztfs; 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 y12si5209139edd.393.2021.09.16.20.09.00; Thu, 16 Sep 2021 20:09:24 -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=PDFnztfs; 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 S1352632AbhIPR1E (ORCPT + 99 others); Thu, 16 Sep 2021 13:27:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:44122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343965AbhIPRSw (ORCPT ); Thu, 16 Sep 2021 13:18:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 754C56147F; Thu, 16 Sep 2021 16:41:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810477; bh=7mFka9LzrtqigieZU60zukE5rqmPUDqyqXjmuylp0YU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PDFnztfsb54M4Jau8rui+rbAv3bWCS7Ws2uGEwXWwhsY7pTB4QIMbEZkHG9zxJOiJ a7fTnOcBbd6HoWU5hSFCa+qNVAtTWsrWFZ+uZrbNLY0TzQwFZOV4YMg0QKFaYjxE1k wjiiXquwX3C4A/G6ge79D1Xa1/A7mx/+ZPRMNZlY= 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.14 155/432] kbuild: Fix no symbols warning when CONFIG_TRIM_UNUSD_KSYMS=y Date: Thu, 16 Sep 2021 17:58:24 +0200 Message-Id: <20210916155815.993146029@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@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