Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp517103pxb; Mon, 25 Apr 2022 15:22:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+COge6iDAiBrw4Wgj/JKPRG2yCRYf6sLJJOR96hhhMes8sZQQE7lz/mU9ssHnGwF+yBhE X-Received: by 2002:a17:902:a712:b0:158:9e75:686c with SMTP id w18-20020a170902a71200b001589e75686cmr21262301plq.56.1650925343116; Mon, 25 Apr 2022 15:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650925343; cv=none; d=google.com; s=arc-20160816; b=c989r3HkH9x2iGcwhlnbBeBgU899N+tcHoxTHSt/NB/1rTNW8WMaSg1VVmRNwJz7VK iQIAxF1Kjrr8dCXBJxVyUAYamH6+165+kEzItL12LQzBnQVm8Fy1/vCR8jeyUEEzFDYE z5+44gX91IfpdPv+9oBHilhtCf0Fukk/zPNB4Z20yoqtRdxYDayWHKS+jsFadq2XauBB hQmmSVXMKzD8oATho/dok+OlEC/7pq9UwGJQgJEzf0ty4vt6GmO9fatai8h6IAJ2WAnU sEnHmHa4jwjYaWHI4mUa4aAesrpGiUrfM0+KUgSwWadue1NEBLuXbUaoksWDLHCXPI9J ntgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=mWwc7mf7BKdCaJhN4Fzr3lEAPxe1cNjfM2MegTwuVjw=; b=K9LICmj8+P0UE03kQoHoMc6Sa1lBT6GKgaeCmyksNMJkM0fg/okArhBWXTArTcGodR jhFMGRU/tqqNekH+kJWNv7NG6NAtvU+ZJFGsdY62oRjHYMsOkk8f7uRMgf4HdRs9l1tA 5A5mM893rrzytbdhSmGdiAUiYHUNd3t+hUOUowoUTBWiiHES9mmLWNt8qOvPECNRoSoW HZwmBaNLzE3QH6UtLsYbe1gAmM4IT3nlGiM2qU+OmQcOqgWINIw29PEURjYPxhsYJn7S 9tx5fX0r649LD3ErNJFO97bd1hNU8bbKw9+8l7jtFnzCQUmp2GHg4OsXjcDJS//dLX5j aC3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=P9LugIYb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a63730e000000b0039d678a64e2si19208678pgc.232.2022.04.25.15.21.45; Mon, 25 Apr 2022 15:22:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=P9LugIYb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243475AbiDYRpP (ORCPT + 99 others); Mon, 25 Apr 2022 13:45:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230335AbiDYRpO (ORCPT ); Mon, 25 Apr 2022 13:45:14 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2597FC3E8E for ; Mon, 25 Apr 2022 10:42:09 -0700 (PDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23PGQMr4013138; Mon, 25 Apr 2022 17:41:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=mWwc7mf7BKdCaJhN4Fzr3lEAPxe1cNjfM2MegTwuVjw=; b=P9LugIYb2+3ydqwqh9M181rUIbxJT5SEVGituCDhXNfGqevRMztk8Y9yGkXiwy9r9hm8 kGxJMIOdUTfaJKSuQkPZKpQlR9YNv89ZDfCtLcpq4TLTcF1B33bXJkVZr5PvHCZSkTz9 +2AyN301peZjeT3/831cp25kj4/14SvO8GUiIJKcD6CpuoMisJ7Qh3vKcC6EZgdiBljW Hxvh/14ZGmNvvEGxoteTQeAFA90V4ZkQ5Qt8qTrsQLrFnlS20Y8y1IEf98FnmilQ9xj5 blQ9MPlbz979q+gxp9NafX1lSF5cK4dXyXP3KcsJdHmkdvJmn8Kmr5Mt66revJE0I2kV iQ== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fny5r1ky5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Apr 2022 17:41:49 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23PHSQVY004804; Mon, 25 Apr 2022 17:41:47 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma03ams.nl.ibm.com with ESMTP id 3fm938tquw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Apr 2022 17:41:47 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23PHfild53608926 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Apr 2022 17:41:44 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9877452050; Mon, 25 Apr 2022 17:41:44 +0000 (GMT) Received: from li-NotSettable.ibm.com.com (unknown [9.43.79.106]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3725152051; Mon, 25 Apr 2022 17:41:41 +0000 (GMT) From: "Naveen N. Rao" To: Michael Ellerman , Eric Biederman Cc: , , kexec@lists.infradead.org Subject: [PATCH] kexec_file: Drop pr_err in weak implementations of arch_kexec_apply_relocations[_add] Date: Mon, 25 Apr 2022 23:11:28 +0530 Message-Id: <20220425174128.11455-1-naveen.n.rao@linux.vnet.ibm.com> X-Mailer: git-send-email 2.27.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: EBo1atO3SRUozK-Gw_Q6mTuZbtchykkM X-Proofpoint-GUID: EBo1atO3SRUozK-Gw_Q6mTuZbtchykkM Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-25_10,2022-04-25_03,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 impostorscore=0 spamscore=0 phishscore=0 mlxscore=0 suspectscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=800 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204250078 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kexec_load_purgatory() can fail for many reasons - there is no need to print an error when encountering unsupported relocations. This solves a build issue on powerpc with binutils v2.36 and newer [1]. Since commit d1bcae833b32f1 ("ELF: Don't generate unused section symbols") [2], binutils started dropping section symbols that it thought were unused. This isn't an issue in general, but with kexec_file.c, gcc is placing kexec_arch_apply_relocations[_add] into a separate .text.unlikely section and the section symbol ".text.unlikely" is being dropped. Due to this, recordmcount is unable to find a non-weak symbol in .text.unlikely to generate a relocation record against. Dropping pr_err() calls results in these functions being left in .text section, enabling recordmcount to emit a proper relocation record. [1] https://github.com/linuxppc/issues/issues/388 [2] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d1bcae833b32f1 Signed-off-by: Naveen N. Rao --- kernel/kexec_file.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 8347fc158d2b96..55d144c58b5278 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -121,7 +121,6 @@ int __weak arch_kexec_apply_relocations_add(struct purgatory_info *pi, Elf_Shdr *section, const Elf_Shdr *relsec, const Elf_Shdr *symtab) { - pr_err("RELA relocation unsupported.\n"); return -ENOEXEC; } @@ -138,7 +137,6 @@ int __weak arch_kexec_apply_relocations(struct purgatory_info *pi, Elf_Shdr *section, const Elf_Shdr *relsec, const Elf_Shdr *symtab) { - pr_err("REL relocation unsupported.\n"); return -ENOEXEC; } base-commit: 83d8a0d166119de813cad27ae7d61f54f9aea707 -- 2.35.1