Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp280474pxb; Thu, 25 Feb 2021 02:15:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUKV72mGyG/xH2XKJ8ewAa529QFQOVKuGOps4pImVDIWEBQ106CenVp6LjBVRqfgMVsAsA X-Received: by 2002:a17:907:9e6:: with SMTP id ce6mr1875102ejc.207.1614248155455; Thu, 25 Feb 2021 02:15:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614248155; cv=none; d=google.com; s=arc-20160816; b=wJk8f8otxdiaUvGPofJU8dkBBIltWewgFmePEbLKJO+T3J+O+vv3EvNRlSA6bdBozK bEZI0d5qCo19KG12LrjZTvnqWhwBvdpS72JqeThd78j7FYD2iMwuaTj9kYKQxDWM6hr+ huW4zqwBNPAbnPjPwtgCytlHNfjyQ6zgwkyJs+NPH8MS7EnyZrWDaIgkJoPG/6UkYRP8 8dmQfp1CaRZUvxcaMbab6CotM6gzO5Uoxv8m3qIPHRzY0QcYDACrdYWK5o9VNXllRrG6 TbGOGqNFhzTOOMkD734H0bK0LSe6er8LQYEKmEjGl6VCnXpyDORzElrNvoY0DRybIZT2 dOqA== 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=n2cKPVHobu8c7BU4F8B8jQEq4D/397kyX6NzET8bujM=; b=0w7PKI4pXNj+LPW8z2h/MjCDBZIGDNO95ZNl+mcCVlIkaMwiv/lCqYxtnDmf2NVjVB Y7ArtFpkdTmlxse2JRR7YE4AAGclNj76WW2OAq0NPUwqyf2hiwV6E5Y8u/fIPy3i6XDx jJLQzXd8lXHNG2Js2D/VbhIM9MATlA6ag56lWzqScKfJZkwzgRPWWF+DfUyf4nyOH+Ra NO2Y13uw/RA4DjuoeXuYbpr7w5FzhPunWn8wUJrR2zNah++28K3O6U4SYN2HDg+8tCHp k8aMCYUQi6IrbjanTkYelbM8QzppQYQOxDw9f5cHc5tHKV3F25sCSkxY8HbbTom2+STO 2oyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wd5nRUo5; 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 b2si3240831ejk.68.2021.02.25.02.15.32; Thu, 25 Feb 2021 02:15:55 -0800 (PST) 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=wd5nRUo5; 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 S233603AbhBYKNg (ORCPT + 99 others); Thu, 25 Feb 2021 05:13:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:35100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233743AbhBYJ7X (ORCPT ); Thu, 25 Feb 2021 04:59:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9FB3F64F1C; Thu, 25 Feb 2021 09:55:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614246908; bh=BNFaJw7x5QqIAvV45WIZ+T4caCNc7lTS5t+FNBVKa64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wd5nRUo5kTv9r8gJ1WToLRkbEcZ8jGd0NM8BOzZ+kBOZXPLybe3+TDKjj4VkpoNls M/3BMVey8igysu61Tpgz9uw7OmnSTlKQIxihXaMyqNFCooDh0mlWe9a5CS+NaLKadQ 4Z9w8iM2tLOjtVDhG9J0MRnLwqVHZbkvvlIIPNGw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Rothwell , Masahiro Yamada , Jessica Yu , Sasha Levin Subject: [PATCH 5.10 22/23] kbuild: fix CONFIG_TRIM_UNUSED_KSYMS build for ppc64 Date: Thu, 25 Feb 2021 10:53:53 +0100 Message-Id: <20210225092517.578415148@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225092516.531932232@linuxfoundation.org> References: <20210225092516.531932232@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 29500f15b54b63ad0ea60b58e85144262bd24df2 ] Stephen Rothwell reported a build error on ppc64 when CONFIG_TRIM_UNUSED_KSYMS is enabled. Jessica Yu pointed out the cause of the error with the reference to the ppc64 ELF ABI: "Symbol names with a dot (.) prefix are reserved for holding entry point addresses. The value of a symbol named ".FN", if it exists, is the entry point of the function "FN". As it turned out, CONFIG_TRIM_UNUSED_KSYMS has never worked for ppc64, but this issue has been unnoticed until recently because this option depends on !UNUSED_SYMBOLS hence is disabled by all{mod,yes}config. (Then, it was uncovered by another patch removing UNUSED_SYMBOLS.) Removing the dot prefix in scripts/gen_autoksyms.sh fixes the issue. Please note it must be done before 'sort -u' because modules have both ._mcount and _mcount undefined when CONFIG_FUNCTION_TRACER=y. Link: https://lore.kernel.org/lkml/20210209210843.3af66662@canb.auug.org.au/ Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada Tested-by: Jessica Yu Signed-off-by: Sasha Levin --- scripts/gen_autoksyms.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/gen_autoksyms.sh b/scripts/gen_autoksyms.sh index 16c0b2ddaa4c9..d54dfba15bf25 100755 --- a/scripts/gen_autoksyms.sh +++ b/scripts/gen_autoksyms.sh @@ -43,6 +43,9 @@ EOT sed 's/ko$/mod/' $modlist | xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- | cat - "$ksym_wl" | +# Remove the dot prefix for ppc64; symbol names with a dot (.) hold entry +# point addresses. +sed -e 's/^\.//' | sort -u | sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$output_file" -- 2.27.0