From patchwork Fri Feb 10 20:19:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D155C64EC7 for ; Fri, 10 Feb 2023 20:21:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233816AbjBJUVb (ORCPT ); Fri, 10 Feb 2023 15:21:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233764AbjBJUVC (ORCPT ); Fri, 10 Feb 2023 15:21:02 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3A0081296; Fri, 10 Feb 2023 12:20:27 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31AI0A5q029778; Fri, 10 Feb 2023 20:19:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=kfNfns9B5e8vAxdfNNVCTOrSp6ACTnHzEBkIAFG4xog=; b=0BKAw6XQuYZONwo+3sRLHEzuR21+F2iIv1RgPkS0gJIsNQUsMDQ4xtJ2SRrTFA8ITlS3 C+5yybPlp2i6HdvkgHiu5ZZdkwYSPWVuJLQeITa9oi53D91myLxuuum8rDGY/b+o/wJE npfObdKfIjWMwAVJmr0dYZfTJWky9JeVNrY1Ejjm8H8KvIVYW2ZfeaKBglR+hgWdovxq MGbqaRf5XhVMQPtMGXgoUf50qSKH8JL2qLwFi2IDyNpkm2xUEJ9JeVJm3tt0qHuuzvJz DlpUhl26jfpaU1xRciNiu/TMyZA9FY16DjWiyYdnBiN5tE81kmZQq1wg2F9oZpUKeItR /w== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhdy1ea38-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:50 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 31AJoiBm003053; Fri, 10 Feb 2023 20:19:49 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2045.outbound.protection.outlook.com [104.47.74.45]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdtb7hev-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fDGZMTs9E+qmjI6zCdtTyv+eMRJdeFCtNXescD6a3nOUl/8nNFUKCTioB4Ad1SUHPxRW/DBjyZ7THUr5IJSDLZUnl96qHd2R5fLPFTCpdDKFdZ4YwI9FvLT1mjjYtYSecFYJlWWilONlGX393ixRyoNl4WKeLPeH6/kA+JnKvhL3dWhschm09A6KP+nh2RWOilHamqoO4lGog0gELn5u8SZGXIN2M9YSByXrIdZSVPIn1U5qJFWK7Op0Idg5ImJhduSLSqv/nsy7/uRKMYxbfVKpp/1LpDMejhjVL38mt9gdFhSV52SzBzlH8SvJH8Ya5/1EJ9kF3BSrjBCMyaKGHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kfNfns9B5e8vAxdfNNVCTOrSp6ACTnHzEBkIAFG4xog=; b=GANVaZbErifQdQ2CyB81EsIiDcX3IWwYJPxnylI1pL4qOoMpPOgyeXsdLoEPJnkF+Z/KzBDL3fQfYICwCqaC+qzVwS1ICON68bvibqDuJqt6illrAn6WI7umylZJywTPDbxqMDxQsVwFJkzT0BuocsT7DHwqSlo4hpTPq9+zMN3qhSSvjOAv/cQaVBrfS7pyeMO3gxcnNFdOwZr/DKXl6YoozS5gDO7fqVYsa22YMMSyq8uUwoSmzUy7ARgEAnNO0dfLDxSDBNHlQe9yBaqyJBGwYKthSPj8ezCrULFHAUPRaRFW34aNk+kc7l5sx8ORDRhcQVZSDoOJkR5+FZRAjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kfNfns9B5e8vAxdfNNVCTOrSp6ACTnHzEBkIAFG4xog=; b=NOKbzqKffdcaDEgprm6QLibvlSU0MqEbETos6aH0VOX6r0XiJXqMTxJLdClX8go550wxYCZHrMoijDQ3Ke3nKVEHX/IT7toAW5Wk01PXTeo2kEWjWOgMa4bXfPhJT3Obl1zt0dIXGOPLCOIxojM+SvO/pSTBLYdWhyfEftbpwFQ= Received: from BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) by CO6PR10MB5652.namprd10.prod.outlook.com (2603:10b6:303:135::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 20:19:47 +0000 Received: from BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d]) by BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d%6]) with mapi id 15.20.6111.006; Fri, 10 Feb 2023 20:19:47 +0000 From: Tom Saeger To: Greg Kroah-Hartman Cc: Sasha Levin , Naresh Kamboju , John Paul Adrian Glaubitz , Rich Felker , Masahiro Yamada , Ard Biesheuvel , Nathan Chancellor , Dennis Gilmore , Palmer Dabbelt , Arnd Bergmann , Andrew Morton , Tom Saeger , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org Subject: [PATCH 5.10 v2 1/5] arch: fix broken BuildID for arm64 and riscv Date: Fri, 10 Feb 2023 13:19:35 -0700 Message-Id: <20230210-tsaeger-upstream-linux-5-10-y-v2-1-ada7b8d36096@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-5-10-y-v2-0-ada7b8d36096@oracle.com> References: <20230210-tsaeger-upstream-linux-5-10-y-v2-0-ada7b8d36096@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: BYAPR08CA0042.namprd08.prod.outlook.com (2603:10b6:a03:117::19) To BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB3794:EE_|CO6PR10MB5652:EE_ X-MS-Office365-Filtering-Correlation-Id: ec01a323-d73c-4663-2c9f-08db0ba42781 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W4JMfRyig3JdLzCjsJk0zTNGxYQmpTBiWO/B7V2joEqPcAxTBA2pYmKjxjHP7+scANuyCRtBbwwYYzYR/KxfzqLLDxfc7v2+dvZsA08JzM27PeE4iu7fVJLgNjO2rDTPam/7/HAUdOsK9cS4jDt1nlKEMcttaD4ALCbP0eRZIuOU9p5qDyAscY5zSXopRDFclzTu0HyhejoZKXfsnHl7gJKO/zjRn5VG7tE9Z5oX7+WVguFg5YHmZ4NTHkphkexZ8J2G981r2WGyIA+o8Dwan3RUrc2vrwTgPuZ/mBeB6AKQk0IAmdxQgtfBp6ASwYcPy+E6WC0Z6NO5nfWKps6s2FpqV0p3ESzN+jBANbCT40IcxKn2gHIKvu2CSxWCDUjwWQZv3Nz4TKj7AYGqKnJtUICereAdJpl83gow9yfBmd2mcn4w/NGcEZ0MwyYw+l+GrgLLjhoCHkYXGJU+6fUkXFTbzcWce2L6UOvroUllLHaqrLgv0/+tO1wvdPxI8/tc/IVGrUQSEjX84CD5gPdxzFlOs+nKgSjEBa7uWZmqW+f4R7D0cIbL8FgtnSX3AIGGbfOFgPTP0t188wzdzEyNfvk9xzvm6HSseeDSfjzB614Daswa2/EtXgulrjaWfYM7hC7WaJPPowRWFqBX+b6s+Ojyh2V3wb1/pf4uhBPIjsI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB3794.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199018)(2906002)(36756003)(966005)(6666004)(6486002)(478600001)(6512007)(86362001)(2616005)(4326008)(83380400001)(6506007)(6916009)(8676002)(66556008)(66946007)(66476007)(7416002)(44832011)(186003)(5660300002)(316002)(38100700002)(8936002)(41300700001)(54906003);DIR:OU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t1/Ssaa0B3+txQkZYWk1xx7xi?= =?utf-8?q?6zeLrOxjHh46G6WVZna073vQ+XeIIBEQjtqrVzRdg75WgaNMgmZM5iALVk923S8mS?= =?utf-8?q?cs+WgO5T/C/7OviKX7fUZcuzB5dqbginS/aU9My56roDcjRSy95sa2705ncXlpRP/?= =?utf-8?q?BtlL0tIDyavBtK2qPD3igjrPH+xEh6sSu+NudtpcYoEkjxbc7empiZNibXWRUPUA7?= =?utf-8?q?dQU1rrxtg9cLWXYEGl7sAfUolJ+Y5nPs45T7yrJbFpAentOxfVSogkOTLMfgkgdgM?= =?utf-8?q?ZIxusxn7QHQIIddmq8wsnLttzCMX+v2UJIl2bsieJG45CkBUQm+GbTGJKWXHn8ZZ4?= =?utf-8?q?AukdIJVEOgLKQxsxfWnKE7QEhSYXBXg7Z4ezAngpJ8gTsQ4qow65d0ltTdwXv13B3?= =?utf-8?q?x8VNGjJw7Csvva86rZrv7wB6AJlT9FE5VaK2BnU7/w7Uml+6TQvNQPz7SijQXQn6p?= =?utf-8?q?PBvmB74efUtQ87qYphYlV7Qa4FwnOpFytPcboH7OwAsRiHU6MlHc5CZB2sHI1KyFy?= =?utf-8?q?/EIHH/pN62uVzoKN7CnrwSLt3WYpZX9LC1aNfcMCAQxEX6XYSTzNK74vItRQW+oAa?= =?utf-8?q?cR8QzJBbCUvnBxi5FeffeUbheyZfSKacV1C2MVtfCN4GUDBTnpYNQkG3JpUsdNdaW?= =?utf-8?q?GjhaOGTeLU+8F6LGkrq4Giyd6ZF5VNZ+pZUb6FF4ZP9+vo+VDBM7tOJCGt5v/1fLF?= =?utf-8?q?tYGIdE+l94S/CtCguD0sLoDIVwKuctOBQPpBO1SstgryiBdDcwpHV24=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?FcLcXk+KR8/EyjbA?= =?utf-8?q?iMFAvUGadfjkf4f2cjIvSwH588MtGRgcxO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7db7IBnpqUau1svlya0?= =?utf-8?q?cM4E9uF6fHPl68tjzim2O1ebGrcd6DZZaOZWBkEGv1LJ33e8aW8xQZlJxR1X1rmTn?= =?utf-8?q?dvB4R+Y60PSgQ+jEmGKloFvgJocTfRitfEKUd6NN48mvp3ySw4EhJ9x4BNB2xaUTS?= =?utf-8?q?zOaxnmbD3wyhCQR88FIXrgknlWNeH7zKHEwzJJuIWCAvk1w8c0xVpamHfB6TFYlEZ?= =?utf-8?q?YOyDYYOOWuz4/F5iz7F0Mz9hwKiHLO?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec01a323-d73c-4663-2c9f-08db0ba42781 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB3794.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 20:19:47.0251 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZAZBPX+hPi8RcgBMEISru1DNLrxDbENKlLzGTRPynbxkDFZAfEQYFopNMcwX8JKVeZQ+4H05RFrbN56MnJTs+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5652 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-10_15,2023-02-09_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 phishscore=0 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302100173 X-Proofpoint-GUID: kUSf0n_RBSwb2mbVk3WNzB30xdZcuVkg X-Proofpoint-ORIG-GUID: kUSf0n_RBSwb2mbVk3WNzB30xdZcuVkg Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Masahiro Yamada commit 99cb0d917ffa1ab628bb67364ca9b162c07699b1 upstream. Dennis Gilmore reports that the BuildID is missing in the arm64 vmlinux since commit 994b7ac1697b ("arm64: remove special treatment for the link order of head.o"). The issue is that the type of .notes section, which contains the BuildID, changed from NOTES to PROGBITS. Ard Biesheuvel figured out that whichever object gets linked first gets to decide the type of a section. The PROGBITS type is the result of the compiler emitting .note.GNU-stack as PROGBITS rather than NOTE. While Ard provided a fix for arm64, I want to fix this globally because the same issue is happening on riscv since commit 2348e6bf4421 ("riscv: remove special treatment for the link order of head.o"). This problem will happen in general for other architectures if they start to drop unneeded entries from scripts/head-object-list.txt. Discard .note.GNU-stack in include/asm-generic/vmlinux.lds.h. Link: https://lore.kernel.org/lkml/CAABkxwuQoz1CTbyb57n0ZX65eSYiTonFCU8-LCQc=74D=xE=rA@mail.gmail.com/ Fixes: 994b7ac1697b ("arm64: remove special treatment for the link order of head.o") Fixes: 2348e6bf4421 ("riscv: remove special treatment for the link order of head.o") Reported-by: Dennis Gilmore Suggested-by: Ard Biesheuvel Signed-off-by: Masahiro Yamada Acked-by: Palmer Dabbelt Signed-off-by: Tom Saeger --- include/asm-generic/vmlinux.lds.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index d233f9e4b9c6..44103f9487c9 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -906,7 +906,12 @@ #define TRACEDATA #endif +/* + * Discard .note.GNU-stack, which is emitted as PROGBITS by the compiler. + * Otherwise, the type of .notes section would become PROGBITS instead of NOTES. + */ #define NOTES \ + /DISCARD/ : { *(.note.GNU-stack) } \ .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ __start_notes = .; \ KEEP(*(.note.*)) \ From patchwork Fri Feb 10 20:19:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14DCEC6379F for ; Fri, 10 Feb 2023 20:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233832AbjBJUVc (ORCPT ); Fri, 10 Feb 2023 15:21:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233685AbjBJUVF (ORCPT ); Fri, 10 Feb 2023 15:21:05 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30F4981297; Fri, 10 Feb 2023 12:20:29 -0800 (PST) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31AI0AIR020852; Fri, 10 Feb 2023 20:19:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=Zztlk30BauT+Ce8jwOcRAGtBcHOOScbHyyvQMWkJ8tU=; b=PKXoKSZbSysxcr3sr3IeeU2lEi0OtPCCJmxbUlF+oyL7AGxQEr9MXk9FPY4IKtoApYjN hcOod+VG38XPJ0IspA2C0GtKqKH1BpO16VPzgWw3vPlRrBxntxFBbrGvlGPi/H4iUSuH 4STBlYpYezyQNHelmO7jNraL20QWw1cqW5FxkjUAzu6PXxcq6v/477O4DQccslKhTfTP 8csY7sXmKw9D/jZN61zmwzyBQISFNz8HZS69WXwA7aeSHeCUlrk/q7zZ6srX3rXfMqHU ufXoAoAEuiJPL0RjBXQ7KRs9leXzlqyW2yfy20l/jtThbob5cLwOvmjkQu3mW3pvsc6o nw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhfwue4fp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:53 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 31AJXSbm025785; Fri, 10 Feb 2023 20:19:52 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2045.outbound.protection.outlook.com [104.47.74.45]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdthtf12-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=meP72UzqCefoEjbDrrywrZMiu/SHpyArUTVoXradSDWUZPCxy9Szwz5lZFqoQIsmMowWrFPgwW9zfuYr1fsndhWo8zDe3frrwP8dyAe1BI3f3vVYwCpzGEwtH0nGrXGC9uOyeYMOwVUuISQEzp7vFLt9IUPWeqs1oqc3deJZWV/xE3NzYYIhTnbsl4phGMd5vneqAcvU8rKaFCMnYQ/1cj2Jnfe5xQImzO1gqU1MPHbtSpVlaFJPUUcifrbR1DpIuDHLBXIOV2Xjso0N7l/xqaqt9zI1vfZbjZeSyX8m4/KpQQU/jgn6R3dms0+vzqmXeUxGocN68Sy5M88TpxP2oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Zztlk30BauT+Ce8jwOcRAGtBcHOOScbHyyvQMWkJ8tU=; b=EjjsXt+9yC3ze0CMobn17yHJM0KBFYlGwSobZylcO1svvCp6Fj2NpJe4kRA3uGZ9H3yHfXThxuWqXcSFXKGvOcl7m5L/fPikvjnzU7ZltRSLHGDaMCeL53o2r6cORd7IpgK1Wi6yojc44KxRIPciwhYiWMvacDbUYCB7Yk68mEC5mUxpxPyAp04DqMDFBaCB5e6UfPfiNl1JWqtaW+u7LBa+1j4/iIQpYK6fI4pAvBirUjICMa4OVUoB/XSw+I5E+/ZKfJ6cHKJacgbF0C46qc1o2O5DuJk5UuebD9HS7QZovTV/oMWWpLP4dTaLK1Q3sY6EKGBz4XQPmO1MSMSpvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zztlk30BauT+Ce8jwOcRAGtBcHOOScbHyyvQMWkJ8tU=; b=uVwAszMIY4hUaZD8gJH7Rpxegj53+8aZUjiBBfn3ORHNjibF9WuPtru8m160y7EjWJx/1MuRLfo05XZRoCOzlKYiFnSzdjxDwDep9oqaqkE2ctv2TNjEWFSha6tAyTlE1+yKF6CmTqVvHDzoqv7ijrWMf0vu9SYoTeK7jNVlw/w= Received: from BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) by CO6PR10MB5652.namprd10.prod.outlook.com (2603:10b6:303:135::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 20:19:50 +0000 Received: from BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d]) by BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d%6]) with mapi id 15.20.6111.006; Fri, 10 Feb 2023 20:19:50 +0000 From: Tom Saeger To: Greg Kroah-Hartman Cc: Sasha Levin , Naresh Kamboju , John Paul Adrian Glaubitz , Rich Felker , Masahiro Yamada , Ard Biesheuvel , Nathan Chancellor , Dennis Gilmore , Palmer Dabbelt , Arnd Bergmann , Andrew Morton , Tom Saeger , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, Michael Ellerman Subject: [PATCH 5.10 v2 2/5] powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT Date: Fri, 10 Feb 2023 13:19:36 -0700 Message-Id: <20230210-tsaeger-upstream-linux-5-10-y-v2-2-ada7b8d36096@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-5-10-y-v2-0-ada7b8d36096@oracle.com> References: <20230210-tsaeger-upstream-linux-5-10-y-v2-0-ada7b8d36096@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SJ0PR13CA0171.namprd13.prod.outlook.com (2603:10b6:a03:2c7::26) To BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB3794:EE_|CO6PR10MB5652:EE_ X-MS-Office365-Filtering-Correlation-Id: ef4d4272-d167-4629-e9bb-08db0ba4292b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S6UoErBKlDDwr+JgypvvWCeH04tvRgqKJND6VK0ljgpwU6s6QzQZHsfGHj18tk62WhsXzkeTPPSNWhXd0MfxLHsmi3wWulH6S+SlIZpbrsdvkgnw/P7wM7wiIdG/UmYphZcq3Q73PewMLvsr4Pbu3trpqj3BjWhppc7hbyHMaZuXlMojqaRCqCQ83ruqowmb8QQlkH6o16KyzzZGYIXlfjDK4E0zSD+9rIVwcxiTQ23ic0eHoYuYSEvVgFJhDNEFKeaZbdVgs71cD4x87hbA+Y0R/UV9iYWrZcP0FzjB4KdboauGjamaQyhMMp289u7hnv150Wmv0srarqBw1XuhyKkJEY1HYXCN7AB0YWpEBbCW7HuhbvfzgAud7sFuPcnDjblAVcbd23FLetPC89BBL1elJFXWrzfZICOZPKnqkwEpS8wDu8ejyHfOTN0ZBA1PUXhLnvDYUmYcv6IKmWzu8H6qd1EJdz+vodwZ9LPiJzdQ5ilHwOabBZ9U2ND1bDvfVmhJxIBgy1Q9s5j/Xk7Rl3cagjZcUYB0EkHB+Fbs8eOxGBXIviWkj1l1Ss76MTlWi/XQBVeTrSV7HhcKojdkmoZH5Zk+y6Yibwuj54BuFvCp7UuAuVUtd6MNilduwR6IGvlIKCFrVgVznyPn4lVxzUwHVlQtzwe9ut4SeBajsJX4u4bbqKU47UpnI0UzkIG8Pol+J6jjYdbuwmzhnWimGA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB3794.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199018)(2906002)(36756003)(966005)(6666004)(6486002)(478600001)(6512007)(86362001)(2616005)(4326008)(6506007)(6916009)(8676002)(66556008)(66946007)(66476007)(7416002)(44832011)(186003)(5660300002)(316002)(38100700002)(8936002)(41300700001)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Ai2JB/L1t1FRpH6uqRHisz8EQdu3?= =?utf-8?q?RfDrWpZPao83TmAVXY30axv5BxUGGCYMGjbshIuHQCvQOKqqsXF+V/poy2RSI46Px?= =?utf-8?q?hVgL5iL9VI7zJyGX2/hE0EGVBTkvF2XviZyL34rK01HoUv57Mo34UKDGCnoUXz9VZ?= =?utf-8?q?yqXQsGW5efFY5I0gXpBNXZtcmPVKRe4es+X8bcSvg+R/xalY4JCRAtfmOc6hFRFzj?= =?utf-8?q?eWH2yFcNmQnwemaesrAbBrK8XvEihMzZre7DDj5EzCcyLeDotrGW/YZJPNtQKN5mV?= =?utf-8?q?yxBmD8rJOmNC3pkyzF5GVnDeYqS0c1q8lSrcjMjgV+Q4XjuqS32IuZs9C2v5M8xAk?= =?utf-8?q?lUP0BSAN6SMf/dH49nNv0g+eCUyM7GmhoRKVKiwlbpoTKfBYoCz76gQdDR2FXe3ma?= =?utf-8?q?bLIOP1dHnwD67VevBToyDO/Zv6l869iCFc62EgH4vEUUrKcf2wvYE6y2PV5XFp6kY?= =?utf-8?q?FUmedcNQ2f/4uZka9xsU2t8hBtuFBvJBabtEF/wT4qBjzOqqQBeoS8Kxpv1bh6Rsx?= =?utf-8?q?KFlgkpiGHfxxbX1MYvdRRtgzuBzJXNeu95ajIBnRz1GP34pLRJPhblTvZQ+9nOj/1?= =?utf-8?q?bvk4D81641rP/mwuBZ6auAoAFPf35PSTXq2RE+3Q+geLU6f7u3VCAnKK705ljkW7M?= =?utf-8?q?1u7Y7NASS+nOOQLS8bkcFX+ifP+SULPLHfn5zEZCNUrNBPuC92Epcnk5QXOBn5PKU?= =?utf-8?q?2Y9vTq6jZD/iVRUdjj7TdPg74D21eWxJAdlrSJ4kVoPVq41r5rV6hJWDXyNyEhVkn?= =?utf-8?q?aYrPmEsl1l0YjK4bv4xdRIQ+fvr0ZML034R6jIcWJZMVy00V6tztQQeqmexXZwLpV?= =?utf-8?q?dOEdMb1SAAQniedQevR9M2/m6aZNcWTiPA7yWAfa+3ZeKCPY/OTPw9wTj/e3veJCI?= =?utf-8?q?Vad0RrTR4DSMQ68cEDJxZKdqFOm3nqFz7K7hfp0piN2yywyKW2TY5/j52BRPlwm/r?= =?utf-8?q?8As73zLgJpiJOZ+peBxzoevEeyjPJUG2SA2ImVqvq6jDbzsj3ziXYX/Ng4mjBE5cX?= =?utf-8?q?bLBYVwOARRpvIB7PquKVzjK8Jn505roMLRoZLyHigd5ZuvThDxq1f8zxImCOPWzhM?= =?utf-8?q?NWUS454vBsHCHF0arit/36I8EN+1Z9GHkBERbsrZNhTetk4LDxVrE3o57dP0vZQnC?= =?utf-8?q?cNjgD6PB2LknkZj/visRCCqn8Ejt5iiG+8igxanfRRa8364qnOsJ8ldtw2Aijb4g4?= =?utf-8?q?6SsSEA9OUbCVcYR/ePPUP/Rhbh1ddBFvxuZxZHj99yp2UyagFaAhDZ5hLiRQtOWII?= =?utf-8?q?+ukppriunIxKt41zuoWuMxReSO6wvn7sWps49xCUNGU3zJj0ZYTssmo5vXfI1Jsfi?= =?utf-8?q?8M7ZuuF/nYcPzoyf88s5eetdKX97DbzTw/JeKj/UgpfLusGLf3jBb42RcNiwXyQ+F?= =?utf-8?q?BFcXebC/yYzcN4uxskXGc2QxOK44DWauRMdG8f6HBEf2T4ez5qEhbs8Y4bMYxOvqP?= =?utf-8?q?Bw1v6RJRHIidm7era1YjxlbeITCAYbhWsLN+5O6n+x3RhxSETSQhgWww7yi/W/kAk?= =?utf-8?q?LXxbSE3NEtUgH6ZEL3tbROWcGVx6UluiX5yzFkFADYvmStL++b2oKwQ=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?LEvO0tGqpZ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zyeR0Y/ncB/Jg?= =?utf-8?q?lRUYTgjElqHus/BjDkWtBEWQRBoM7QlK/Ii9O5h+V3m2X5/epfV+qlCgUSopn59Tj?= =?utf-8?q?lW7G+eo8KVH/sxG6frUmVbgNICHhuL0R5wLC8mxM3o8ZCDH0xP1s/HmpumOWST1VC?= =?utf-8?q?Qa2TqHoZ7zoIWuxmvAt0p8BCLmIvugm6/Ga8dT0ZW1Egueem94w8ZOvCbekwJbbve?= =?utf-8?q?i+VUZRo/huV6dt1eheigYCI6NbTyeINGiTeJ45dBwEZcZEUwlJIDZebwpDIXgueAA?= =?utf-8?q?GhNq7gQXfySzqCeTBYoCVmKNGX/YVboeVM0MICtukpDsOdNs8fiubYcTFZkgdo+4w?= =?utf-8?q?Uf7p7uw0=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef4d4272-d167-4629-e9bb-08db0ba4292b X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB3794.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 20:19:49.8842 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XS/ZyJW4JSzknWRG/UBwLzyvKgaTz451R1CkRmQEcjrp3MAcrJIuGMYSorutjrDTOnDLAT0VHCE1IWQIZe0xaQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5652 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-10_15,2023-02-09_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302100173 X-Proofpoint-GUID: tEaPRlKyinHWM0fM63SamRKWUdYq8U8B X-Proofpoint-ORIG-GUID: tEaPRlKyinHWM0fM63SamRKWUdYq8U8B Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Michael Ellerman commit 4b9880dbf3bdba3a7c56445137c3d0e30aaa0a40 upstream. The powerpc linker script explicitly includes .exit.text, because otherwise the link fails due to references from __bug_table and __ex_table. The code is freed (discarded) at runtime along with .init.text and data. That has worked in the past despite powerpc not defining RUNTIME_DISCARD_EXIT because DISCARDS appears late in the powerpc linker script (line 410), and the explicit inclusion of .exit.text earlier (line 280) supersedes the discard. However commit 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv") introduced an earlier use of DISCARD as part of the RO_DATA macro (line 136). With binutils < 2.36 that causes the DISCARD directives later in the script to be applied earlier [1], causing .exit.text to actually be discarded at link time, leading to build errors: '.exit.text' referenced in section '__bug_table' of crypto/algboss.o: defined in discarded section '.exit.text' of crypto/algboss.o '.exit.text' referenced in section '__ex_table' of drivers/nvdimm/core.o: defined in discarded section '.exit.text' of drivers/nvdimm/core.o Fix it by defining RUNTIME_DISCARD_EXIT, which causes the generic DISCARDS macro to not include .exit.text at all. 1: https://lore.kernel.org/lkml/87fscp2v7k.fsf@igel.home/ Fixes: 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20230105132349.384666-1-mpe@ellerman.id.au Signed-off-by: Tom Saeger --- arch/powerpc/kernel/vmlinux.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 4a1f494ef03f..e3984389f8ef 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -8,6 +8,7 @@ #define BSS_FIRST_SECTIONS *(.bss.prominit) #define EMITS_PT_NOTE #define RO_EXCEPTION_TABLE_ALIGN 0 +#define RUNTIME_DISCARD_EXIT #include #include From patchwork Fri Feb 10 20:19:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 546A8C6FA8E for ; Fri, 10 Feb 2023 20:21:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233839AbjBJUVd (ORCPT ); Fri, 10 Feb 2023 15:21:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233779AbjBJUV0 (ORCPT ); Fri, 10 Feb 2023 15:21:26 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66B32C653; Fri, 10 Feb 2023 12:20:31 -0800 (PST) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31AHwrY9007089; Fri, 10 Feb 2023 20:19:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=AhQSONNbupqVH4rRfSwGHzzv1jtMgpIdW7W9Pkq82J4=; b=LbQ3sKng8CxtAVNnUJmXoS7P6xlEAPh6qVNC85dyzfmLlz4U2qQ/0P3uVlt09RRijgWf Oc65ojX6i9/Tk2xwYqqb5JPoW5Tg9VnHdnwSEhHqDAKCScJJgLp+9FJjjmihDfuUjd4a jy10w4BigopFUOMgxF5eFRr9fCE6wn33MwYEsvzKRnqtHZo/TLa9p3eh9QkQVa7rwn5b ku+lizEFIASA90pAyHpZLNvk2ioJEfyJfN8qCAQ/RjeYkaEAw1xJB3IfP4Y1P4SRGx1W k61JOEuzU0pfkb3+876/QwS2SMuWYMz0BNOpsKOA2ccaw/gh/pWlWHzk3sIwdtKCZVYn OQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhe53p6df-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:56 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 31AJ6w6x025750; Fri, 10 Feb 2023 20:19:55 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdthtf2g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AZsPwwBWvbqUKIDQlGXJZkk+WEix4QZ3DNI5+C4yCdxWbYKZRAKD6Q/8vBEe3J5o8C1/9rk/ft87YmskS6NTJVRK2fAKYmDDQ7vQZvg8TcTFVzYXA0aEiO3Mst72U1FPmXBh90ro2UReBcSone3OuTySrSTCYxQZUt1Flt3/hN6ANTcu7JSx1x2OVuNnvKGPclZfvUDgzUv0uFl+bbYOJ/Q9VnYuyWTrdhXEZ/LPb78wdnRLrTWwRjaemkkKYnjCIAHhWKfEiytykH8B9AhjIVQksp/3rLStLyWbVGNl/iVCVdYg6rv2DbL4Pq7y70wcBsjEeEBQjwN+ik6yTJPu7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AhQSONNbupqVH4rRfSwGHzzv1jtMgpIdW7W9Pkq82J4=; b=LHQlcUMnavrUYq2Mu4gbmxcn2NnsIFGbU0Om3JVGsElnoHNtidP/NrXmHRfduMIlqIRHWwTJVf4eQ4OfL1AmpxBTiK0yvU/YM8uFlirNJkdUR6alBjw6HI3Aaj3CpJwerKXa02O5vbt0B1lJuJNfSu9bzkmq78rBZrJJPRhm7mLk5/EuDv9Fb3FI6ZAwpKu5nDF1Lr+dLNCVnijFYXgw0nS0r/SEBFgb3H42zEjcNzfjtT3JdY9YiNo9r0a7IR118ozlvaUAzH1K0TrMwYwgJ1O8r8qIZhJfcVPvLJXjDBy5N2AxKuCA2UCJ+eAuwqZB6G5OiVmGNqzJx6lsNtttPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AhQSONNbupqVH4rRfSwGHzzv1jtMgpIdW7W9Pkq82J4=; b=Y5ucjTmvKUfyBwHZEtYfyaC0SyyayTv/dTCEldgOz5CkMJMZXmDMgLcXDikbzyxCBUymr+ook3XMHr3I5d8fjQ2t8+08HtlWBxM9sZV3f5LBmWXwzHq4zbe8ruUMWAB9GSc1JHcFijpu3A4frAaRxFarhcwGZkE9Z9B5WzChxEM= Received: from BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) by CO6PR10MB5652.namprd10.prod.outlook.com (2603:10b6:303:135::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 20:19:53 +0000 Received: from BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d]) by BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d%6]) with mapi id 15.20.6111.006; Fri, 10 Feb 2023 20:19:53 +0000 From: Tom Saeger To: Greg Kroah-Hartman Cc: Sasha Levin , Naresh Kamboju , John Paul Adrian Glaubitz , Rich Felker , Masahiro Yamada , Ard Biesheuvel , Nathan Chancellor , Dennis Gilmore , Palmer Dabbelt , Arnd Bergmann , Andrew Morton , Tom Saeger , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, Michael Ellerman Subject: [PATCH 5.10 v2 3/5] powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds Date: Fri, 10 Feb 2023 13:19:37 -0700 Message-Id: <20230210-tsaeger-upstream-linux-5-10-y-v2-3-ada7b8d36096@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-5-10-y-v2-0-ada7b8d36096@oracle.com> References: <20230210-tsaeger-upstream-linux-5-10-y-v2-0-ada7b8d36096@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SJ0PR03CA0027.namprd03.prod.outlook.com (2603:10b6:a03:33a::32) To BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB3794:EE_|CO6PR10MB5652:EE_ X-MS-Office365-Filtering-Correlation-Id: fa645596-0984-4327-1795-08db0ba42b2a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t/YPNq1DB7KPNYhxpzHuUakrfMAbymNsgeQeoTrviyYv990dhLfGyjJjfW3qGYfCbebjts7uhHW9gJNgcydWL61ck5cse9mr/8o48FEUxf50kEFVXvqfLTbw5DIImz97l6jJH3x6u4XS0NEb4qKdoIhz7O56dhROV5OkRGUrT8AsfTj/hmhzxqPYA+x+it/bSbZcFSd6YiN5m6gXcss8rFb0KzPVFXsSMmr33yl45DYPj59kDhGcVruJc7QwcPIOfh5KdNMEay1H5im5THXDiYGeAf2FhYlcAP4CmsgJsvpRVRPDLGqKkoYZuAyb70/Gm4l3YHXlm0BZhyPFdcYN84pBXGorRudyc26pa6i+C8NomiJjvrtPwNHG1B7iun/o1V1tnIiUGrW8RQ8sA/u/v/NHvzv9JNIvRk2pq9QKGoXE7kOprn7pHvRmjshJ+UZl3D8XerzXSF0lHZRqGR5ZpIiHRprqX/cmN+ToMcfwSVV/HxDIOuI9EidUp5wQDVNRRyanCeDrfDmsFmM+TQVT3exAEO0IWiLs9HIzzKodf/Ylnk0C/Zm2OpoTXh8GXOXcVTG8gQL22beQqN905oM3hs8WpwBqIK/WBGhSGtGHUh2w+M9nwUOqmW6FelTb5rcoBqaRFADNsNqxDD85/gMFw1rAW/5VftsWBlxQmwwP1Mk2G9S/I3hTjCHAvLA1QDRUE3HiDyr1++bptDjD3jCKda6la+MBLBYrlAVBFylMVls= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB3794.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199018)(2906002)(36756003)(966005)(6666004)(6486002)(478600001)(6512007)(86362001)(2616005)(4326008)(83380400001)(6506007)(6916009)(8676002)(66556008)(66946007)(66476007)(7416002)(44832011)(186003)(5660300002)(316002)(38100700002)(8936002)(41300700001)(54906003)(142923001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?31EKcGxCprgFMvc8mN+4b2iliYET?= =?utf-8?q?Ud6V1URZxj+cyH/jsfqC7shi8M8RgrCP9LVzTfmJ4fKG0m0IZ9P5jxXCKitlQE+FU?= =?utf-8?q?aHpqDIGOjGMvbp/S2u6v+G+frLbcFMCX5RWZ+DZ6VB+R0KG+x7fKknL+C4JdPDTLg?= =?utf-8?q?/I2y0VvvkaSCbZ6vOYn8IMk1csNmh/6wsoUPcpKO+gwWHkxa1XZT+xdVIui8ncPUk?= =?utf-8?q?oVe6XCpvK8oxEzdqHPJOxCERd2zxIH71ABc0jPF7X1uGhuTqlUUsMEvkg6MldBhkE?= =?utf-8?q?ct04WDiHhX1Le+MmN5wZlxzNjnQ73QH2WnyDL1IRqKVJD2uipQONE3rR1savYChEn?= =?utf-8?q?d6EHVNNSWtfxZwXtDdjcLgP832yAVFfkz9ZlbnTpRGE6irBLEsuEQ61DrhJknGwNp?= =?utf-8?q?SvuBqk/nEdLk21p91h0FkmKzeB0crgydieyPXEr0MsnBA9PPT11werjbujCpwRX7p?= =?utf-8?q?JcApPxlgqZLU8goebXHx1wRoElKO+wYHWAIkzeMfixc17pGa7GvxLBRapNdfUNvxr?= =?utf-8?q?kxkoVZdf/ov4A/NuSZUqb9fxGLksI52DMu8SUw90fwm3pbdtPEHniXlxCvvn0MO5A?= =?utf-8?q?H9Hq4yuSbcVCpU3TuTpa3vP1mlTETwWpq4PyaK654g857Bjl+81rjYioF33f+344n?= =?utf-8?q?J5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utf-8?q?P5+zvJpo9AEnsX0GnnHRR7OBxczGjCFllhQi9eUAwILKeHXNdOPbQ7k=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?1lXwgb2U3MPsxe8u?= =?utf-8?q?nhISEsBiqbrSLiyuANzBtNCZ6DQRJkA0rwrVF/qgIFIS5kLT4N3g3Ad/NEmMrLEMn?= =?utf-8?q?9xRFMlUfbRJos/QxpQfOYfMdvGfIRVwdbqxdwi//JGZz240dxhZoy/KSnX0Tccres?= =?utf-8?q?s6aulXa1uSFqes17wMYARUkCWSl6ulKT7T42JLhMgEVHx2Ln+GrA6TFs4o9iUGxZp?= =?utf-8?q?vpypZS+QWps4UPigHJfERKmWuWj8zD9GpPX1M02IOHDe+Q7F6M2TP3NnTUu9FZ9i+?= =?utf-8?q?bXnBeCA5w48XOCxbZcTGM0GGJboOKrWBbABmqw3H19yIeokCkATPWseHAG57MhrL5?= =?utf-8?q?Jx0qNcA7wSwnWqvPqktxS8U1zOtlrxuF9UAQ0E451KJ71zeHhAoym3JbkHyEIMFpN?= =?utf-8?q?97RgQ7v1fNKyr64QBIvzkz5S270b/L0NxDpcdGsfo7Y/lRT7bkj2D5N6DZ1IKa0Qs?= =?utf-8?q?/8wGGHz9VIzwkKD9uHXB4EeTvBZGi8FVrjTIfHCpkWsEvun7SGdkdx7MjbhrSfaHb?= =?utf-8?q?rmDfoe6VktvBqdCkrB8MWIQww7Lj+607bS1k1XzjEZSSf/LtHo52iqHhgBL7o/1Ll?= =?utf-8?q?/qUjDgx/yK/5N1CWyksliYI/EEFJPG6tSbmIYm7hhJdDyT4+pSsP9k5E/o2mJH/Xp?= =?utf-8?q?opvVOOWVmKC8v45ylqAjxea//BENlaOAD/3bt7M1u7pgrlOkBFsXi/8Y8fztHK0US?= =?utf-8?q?Irtjaezb722p/933LXhnixRBWa4udjMruiAycE9fnqcc4FFOklP+8n+L5NwWl0eQ1?= =?utf-8?q?TMthB4gxcwleGd04ZzwtLiswhquSIrif699wzzM9cda5VoNO+KtiScsDLcL3tSc10?= =?utf-8?q?FoMxajlwLNIyez8UxzDrEwxNODBAEtYj85J06F7W2qXZ521OyjalUpo3AX7ZuuxY4?= =?utf-8?q?UXLhbXQcQnHn6TC05yNak7E3Q3cfMwv/5ORVOPMDRfkipfgZPwf+yGZl3H36xg2G4?= =?utf-8?q?/Y8PUqYfr+g0CwpFaXTOzKC9O4GyEu3zm0HiUdq0c1fOf9BskPdKzjMRizhG9EMJc?= =?utf-8?q?ns1XW6ZLLnU9l6qSKjJykvvuyGx5644FXSGRzQKKDGqKgGi/BH87mK/kuSsG7JqI9?= =?utf-8?q?FPKRHEiyO7q6fuhbEQDCWbdph4djkTEMQVRgo6aVGTeVKCVeSSB7UHPN3wzgrOuID?= =?utf-8?q?8xgcEAFEhBwYChFDgx7kTZ/JRJs1w+MdkYaS0jOErhvv/lhiLGS+ZaV0T/6aJ73Ep?= =?utf-8?q?91Qd6b28=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa645596-0984-4327-1795-08db0ba42b2a X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB3794.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 20:19:53.2434 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KPh6LnLnzVffKPIsQlO+kxrzNptvl+m+011RAxl/RJuhNB9S3lF8w/xdfqa2RmFyNWFU1B6yTKbRgQ5XcTBrQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5652 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-10_15,2023-02-09_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302100173 X-Proofpoint-ORIG-GUID: BrvnppJUZZxvUUU6RiWKYwdEpinEMZwl X-Proofpoint-GUID: BrvnppJUZZxvUUU6RiWKYwdEpinEMZwl Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Michael Ellerman commit 07b050f9290ee012a407a0f64151db902a1520f5 upstream. Relocatable kernels must not discard relocations, they need to be processed at runtime. As such they are included for CONFIG_RELOCATABLE builds in the powerpc linker script (line 340). However they are also unconditionally discarded later in the script (line 414). Previously that worked because the earlier inclusion superseded the discard. However commit 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv") introduced an earlier use of DISCARD as part of the RO_DATA macro (line 137). With binutils < 2.36 that causes the DISCARD directives later in the script to be applied earlier, causing .rela* to actually be discarded at link time, leading to build warnings and a kernel that doesn't boot: ld: warning: discarding dynamic section .rela.init.rodata Fix it by conditionally discarding .rela* only when CONFIG_RELOCATABLE is disabled. Fixes: 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20230105132349.384666-2-mpe@ellerman.id.au Signed-off-by: Tom Saeger --- arch/powerpc/kernel/vmlinux.lds.S | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index e3984389f8ef..fabe6cf10bd2 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -379,9 +379,12 @@ SECTIONS DISCARDS /DISCARD/ : { *(*.EMB.apuinfo) - *(.glink .iplt .plt .rela* .comment) + *(.glink .iplt .plt .comment) *(.gnu.version*) *(.gnu.attributes) *(.eh_frame) +#ifndef CONFIG_RELOCATABLE + *(.rela*) +#endif } } From patchwork Fri Feb 10 20:19:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136336 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 375ABC6FD19 for ; Fri, 10 Feb 2023 20:21:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233845AbjBJUVe (ORCPT ); Fri, 10 Feb 2023 15:21:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233676AbjBJUV1 (ORCPT ); Fri, 10 Feb 2023 15:21:27 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25E64303C7; Fri, 10 Feb 2023 12:20:35 -0800 (PST) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31AHwjcu007847; Fri, 10 Feb 2023 20:20:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=aUX1kB/TU2UHqMvgNPxPrGes/UDAzkjMcV0iXLH9KKM=; b=PCuPJEG00CmZdaz7eatz5rRISXUlIJ/mNRij6kNYSCF/PYHK9HSKsN4odkMvmdwTuZdB WE2PTRnxv38pLdx2w45ICa9KmPMIQ/NbmSDOHNrjNOgBLd+AEsJAu2P7C5jF0cqyRUUs YyWw1ESEyR2gpnucSc4O63iNX+tGqJHkbEPuMzhjqmIVYKo2yX0ALddJ28eAtAiqX8TG dBjceFJ+CM2aizEOEPp7mtWAjsch76Z076QPkXCdHMLncsyXEoRtKLVGCgaLMZjup/gW RTg1XDyHoatJbkFlpgdedpNJLi7Eq/a2Tc+5mix+Og93U4POLFnA47KKtGwCh3djGqOt RQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhdsdx4n2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:20:00 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 31AJxsES013647; Fri, 10 Feb 2023 20:19:59 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2045.outbound.protection.outlook.com [104.47.74.45]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdtaqkny-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=crzC9oy+uDph46ZH2RLh4v2A1nIphzDU45U1y1ARGW6mCSUHgzBPcOegoB2Odn1jgTwKf9c9DfOaJY8KJxM+NDFsvTl1rNWfNMooaW2gUPuRz/469Xr6FcIdEewJvCo+LxcljVnYjLVzt9sZAeHPL6vi2Uz0AoRIfkPIMwkQM3WTxIk6KWCS2zcfKzBpBhbdifnPDZumtoxcVZ6chSrPoP/XBFfXd8RJgesIwhWcVsAb1m7qRuMbBOpCNjjtQFvBhVxDbnOcnFn8KRFoXZdDn2TIixN1KFKA6C/lZwgnfQaLJxjelOvmar8Fwe7OPom9BY9czwX1Uw9xf5oVBL56cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aUX1kB/TU2UHqMvgNPxPrGes/UDAzkjMcV0iXLH9KKM=; b=SdnI+hXfd0TAX5OcD3L3+qwbTXpx5K2MhjnS/ORIAo/K+V1r9q4DbynmKV3Q9UOtAeKkTNolfmyLAjc3Jm7Ltb/4JeYnHu3/iMxVJMhRz7BGkIGAwsx1LJYpHCStWH15eSmkQ3F7geycg6snUzLCCs3Kz5CSgWJbP8LUD/9oEwuKtttCwMMyUsNdctcz3IBKqTvEwtd7ycA61auvJ0F34+rSY83JESPH2YjaA26XBNMbcX/WxMqxzjDGVm55KaLufA1Qa0Q7V4Oerb0xO/ntwhRm/GiWw+gDYGgyBsAtyzMjOb0igjyLeNYT3vYbmJPgPZt5xa5X+eMkMNnWccCvMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aUX1kB/TU2UHqMvgNPxPrGes/UDAzkjMcV0iXLH9KKM=; b=k0FFZZFpN6RGzG+r9cbUCr5cnr+cDCdANMOBAsrXSJs56Sls4Diyg4tIJ6IwVw2pfzGmCFmKlVUxerksZdCjO/E2YLrF4geJlXW6MIla9BfMj2tH1HfVRk3TeE3TPbB/E52yrA+U5PtNAAeY2ZXwnq0q4Lh+sMF7wMd5Q4xB+rA= Received: from BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) by CO6PR10MB5652.namprd10.prod.outlook.com (2603:10b6:303:135::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 20:19:56 +0000 Received: from BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d]) by BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d%6]) with mapi id 15.20.6111.006; Fri, 10 Feb 2023 20:19:56 +0000 From: Tom Saeger To: Greg Kroah-Hartman Cc: Sasha Levin , Naresh Kamboju , John Paul Adrian Glaubitz , Rich Felker , Masahiro Yamada , Ard Biesheuvel , Nathan Chancellor , Dennis Gilmore , Palmer Dabbelt , Arnd Bergmann , Andrew Morton , Tom Saeger , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, Heiko Carstens Subject: [PATCH 5.10 v2 4/5] s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36 Date: Fri, 10 Feb 2023 13:19:38 -0700 Message-Id: <20230210-tsaeger-upstream-linux-5-10-y-v2-4-ada7b8d36096@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-5-10-y-v2-0-ada7b8d36096@oracle.com> References: <20230210-tsaeger-upstream-linux-5-10-y-v2-0-ada7b8d36096@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SJ0PR03CA0219.namprd03.prod.outlook.com (2603:10b6:a03:39f::14) To BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB3794:EE_|CO6PR10MB5652:EE_ X-MS-Office365-Filtering-Correlation-Id: 0712abb9-24d6-4cae-32ff-08db0ba42d15 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hoe+wSKouVUE1uRnZ9z08pA9auaAra0WaHra6NJpTKFVcehEm1Fv/SY1cCugzAMZDDHYbYrTVEFEboSOzBlI3KYS9veWHgGF0tZ6+FPeOBybobMf5v6AEjPUHpcZHRiqPobjOjx3J2NqB2b1Q5X2PjpwblIIR2v6c8F0Ofh9DkgFqgNy7zsN02Wts1Mb3j6HykHjc7B1xPEPXK4R6WgpKvBumsZDM8FgLv7msWXFhLbLG+Z0sqse5HXB29kdz0ifrirlz7NcvWhMU4P7LY8OzYxPkIqcjjen8abfB0M/uGVskxbWSdVITFHpKuRlidL1H3NyF3be5Cl8UzcZEXkLdhTc4AMj4MRUe+zQi6R3yDPO49v+hlFrbAenrTXFLpf/0qOuIAck3KNQq/Jn8zOtPMNGWs4cuZHAPkN7/aENRdu2BLG2xt6d/EZE7pvH3U+m/+B4FmEgtajupV47xUwUh5QB7p4AV07RSHw+J9vaivNEowlyYVq3V2LitvkuZCENwbOHaL2yoiA3ErKKuj3/FLYogZL1bmlzCBZ/fOyiNwmczeI+p3QmS+LDVhVFSf+/6xnIJvBbzmnmaTtlZ+uUbPlfZHC6008IrL6y4cv9cT//2df3WCOuzyBmmgKobjDf4B1hLe5DZSKLb56o83NXeKMPhIiBHYij8bbogJoVQk7ZGJScewl7gGFT7u7URFT6wzEX3gQ6s+dLz+jZ7kGnig== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB3794.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199018)(2906002)(36756003)(966005)(6666004)(6486002)(478600001)(6512007)(86362001)(2616005)(4326008)(6506007)(6916009)(8676002)(66556008)(66946007)(66476007)(7416002)(44832011)(186003)(5660300002)(316002)(38100700002)(8936002)(41300700001)(54906003)(66899018);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?K87Qy69Yp2AM1ROPOM2fa9lIUxfc?= =?utf-8?q?XylBrStJ6XlWXoOemaeM07O5+dSY4+uZhq1nnyFjPVy2fyunWdJQ2An3QD9CM2P/w?= =?utf-8?q?sIHeO+Gy10CtCg6t43GoBFVpuXEKywM7dwKj6CxoWhoJW9no58gP9UPg6bTFzhnot?= =?utf-8?q?78muxJVjAeRq7+4CuNhEhX4rqXGGT5MHK7z8yC1ciXb/Xp6oMIRVmie0aGuRiDce2?= =?utf-8?q?7GbvyToBQQZvmTu+ZlASd+Z5otCl62zhHKHNdARNeOpH7VnwsO4KHm1hGO0HIwUgk?= =?utf-8?q?o3ACYisOqefAJ8p1TrAKq0K//taVdIDn9U+XCVeeboKpUNqXlHo5USd6tQr9Fsa/A?= =?utf-8?q?dc5iPzt6mo1dmXPBs1VQqMrty+m5NqJ56C5ECkqWCyYvHoWqL9AqUf7/uGA7nu+YT?= =?utf-8?q?vRf1m8XvhXa7Jpfgpdm6Z9sGKIOAF7/mkGzC3pP/x5jVOua2uvQVJ2qjcFgd2O2y+?= =?utf-8?q?HqIzHohQbnFE6Kg/F3SUA1tvje37TBv6JwGtrVAx5Ckfk3ZffR5ljm6Nr2ZMr5W5A?= =?utf-8?q?/Its+dqTZbA4X0j8CnGj0t+tSGOq0N6dWxJ87IDFPLSec8vZ0g5cE899lybclJPQW?= =?utf-8?q?yuXWBhBg0WseORVGZVmge5Ucyze08zLn4/hxPONZroVfwZK+HX1rXTf26DJEjRZZW?= =?utf-8?q?Cf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DWuUbO?= =?utf-8?q?I4vxTD3kdXj+PagHDxDM2riR3X7hnE+WZY4w5UVnJcxga983juiGpQE=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?/n78KStO4++Hbov1?= =?utf-8?q?xSSNMMLh/6+XGyfvY1i3Wr+xsbQZyRDZ8SSXAv83GPb49fD2aCV4+Eqx+4NymNIxf?= =?utf-8?q?fCyEZTkozp2gBvdCzNwBKIgghznRPpAyVLXsgm5f4xM97r9TrO0A5gRqUgu7k9f/C?= =?utf-8?q?2N3okoO0kb1UVzC1fbhaBLfWOAAL1ix0VS+PW3c4W4G1oimRuGHXzsJ3x2assLh6f?= =?utf-8?q?6ElD3AelBB42kc9wE4NSdlznr851bnc7qCEYJtvkrOhJjIMug8ak2KxKGUp6T6K3Q?= =?utf-8?q?lxYd7MexbX9yvk0NYvDPq3v44celAePDHZQezm/kmZRJuUhLnY8oXfA9/eLkiG2qm?= =?utf-8?q?hsETjZwfXcC4mc043CI59lctAbQjTPn92t0AUoCT3NIjr/8Cs7TonuiMLBNBGraBM?= =?utf-8?q?4N/eegPQV9ePpL9Ht2F7uadZ1c/cgLU3hU5FQteu8Bn4vy7nLtK3CE+rOzsG+21UT?= =?utf-8?q?Kld14t/0/w4thT4Kgq3uEHM7i0hI3yfXHmK80tXi7DSSZaoRmfEO1OxcW1/Cq5qf/?= =?utf-8?q?8GQHWHCA0K9GPM6AFc+vRHSV9uwyPMKoqL8OQFdPf56zt+VkQWcJqAVkdkcn3PWVS?= =?utf-8?q?03Zwqn25m03iSuiq7GCcA0jfhbwU4w84LXzaB7kWfGqQJKBROhvvZH0ZXwxfa3KEt?= =?utf-8?q?ATag33yjqrJiNJN6OmxAA/Luwr7Xy+J4WhFXTUJKTzLeavCUiHKNi+65PRk3ZYWch?= =?utf-8?q?vF2rfebQ+iZdoXYpPGjm7qOGFArY24ho6D7rIiRH2erCP18PQRQWmRrovIVU5JJsa?= =?utf-8?q?YT3xD5lcpyvdgF/MqrIcjkSJhe7+0R0AvXZwz3TeTe0FY7V2MJAQaZl55GbpmAOn6?= =?utf-8?q?iIgevUJ3sLrEA/7Z2dcL79BHCMzaP0xpcXaZavu6ZUDxePP/GXRJCmJIleKxojlnr?= =?utf-8?q?+5SdvvTXVcnbukWdaWhug0PeKHM9oD9Z9sZkxcLx5viHuez4IdDcOTgm27a/lPr/B?= =?utf-8?q?K170i0LrNLrgMrCmQAmRzLJlI5Q2Ss7waTgXdKrEM6LTqJak7CwaEQNu5v9gJYTON?= =?utf-8?q?ULSaxioDfrWW/kxjMQnS7VkzAsIJ2YqI8cHmOZRquGkhxGOs7A17JQXFDuoNJgmdn?= =?utf-8?q?wnIYtVKdtjKUYCmTYBLKyvi9SY6h7mkG/EfMAg4J7Bg26ugWbxpLSanR2MdsAHIqE?= =?utf-8?q?1o5Dl8JqE+skNNtFBclc8n/GfEI4Y7XHVabsaCyMIuaNkDz/p0qg=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0712abb9-24d6-4cae-32ff-08db0ba42d15 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB3794.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 20:19:56.4775 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cp16qw/DsRlieq9J+1G/jfbsbIV7W4mE940LnWYHCgl1y/5CBg32EwMsOyioS67oiaAP6JxJc4g3fyviblZdEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5652 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-10_15,2023-02-09_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302100173 X-Proofpoint-ORIG-GUID: jWalbsQuWtNDHu-LvqlTa1rm5MQZKGpE X-Proofpoint-GUID: jWalbsQuWtNDHu-LvqlTa1rm5MQZKGpE Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Masahiro Yamada commit a494398bde273143c2352dd373cad8211f7d94b2 upstream. Nathan Chancellor reports that the s390 vmlinux fails to link with GNU ld < 2.36 since commit 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv"). It happens for defconfig, or more specifically for CONFIG_EXPOLINE=y. $ s390x-linux-gnu-ld --version | head -n1 GNU ld (GNU Binutils for Debian) 2.35.2 $ make -s ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- allnoconfig $ ./scripts/config -e CONFIG_EXPOLINE $ make -s ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- olddefconfig $ make -s ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- `.exit.text' referenced in section `.s390_return_reg' of drivers/base/dd.o: defined in discarded section `.exit.text' of drivers/base/dd.o make[1]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1 make: *** [Makefile:1252: vmlinux] Error 2 arch/s390/kernel/vmlinux.lds.S wants to keep EXIT_TEXT: .exit.text : { EXIT_TEXT } But, at the same time, EXIT_TEXT is thrown away by DISCARD because s390 does not define RUNTIME_DISCARD_EXIT. I still do not understand why the latter wins after 99cb0d917ffa, but defining RUNTIME_DISCARD_EXIT seems correct because the comment line in arch/s390/kernel/vmlinux.lds.S says: /* * .exit.text is discarded at runtime, not link time, * to deal with references from __bug_table */ Nathan also found that binutils commit 21401fc7bf67 ("Duplicate output sections in scripts") cured this issue, so we cannot reproduce it with binutils 2.36+, but it is better to not rely on it. Fixes: 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv") Link: https://lore.kernel.org/all/Y7Jal56f6UBh1abE@dev-arch.thelio-3990X/ Reported-by: Nathan Chancellor Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20230105031306.1455409-1-masahiroy@kernel.org Signed-off-by: Heiko Carstens Signed-off-by: Tom Saeger --- arch/s390/kernel/vmlinux.lds.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index 9505bdb0aa54..137c805d6896 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -15,6 +15,8 @@ /* Handle ro_after_init data on our own. */ #define RO_AFTER_INIT_DATA +#define RUNTIME_DISCARD_EXIT + #define EMITS_PT_NOTE #include From patchwork Fri Feb 10 20:19:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136338 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45D3DC636D7 for ; Fri, 10 Feb 2023 20:22:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233882AbjBJUWC (ORCPT ); Fri, 10 Feb 2023 15:22:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233797AbjBJUV3 (ORCPT ); Fri, 10 Feb 2023 15:21:29 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 090B7812B9; Fri, 10 Feb 2023 12:20:47 -0800 (PST) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31AHwgiU019292; Fri, 10 Feb 2023 20:20:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=VL5ggjV7l8uquv3Cdfin43ZELlq/Zxr4naWQDZOYm1Y=; b=G7itgFEa3EaP4RAlj/7ppv8fNIqzjvJEuHWT2zIn++o6ycnap4SCCcGmn9bPfI5OCZy+ pjUb/8o3I+NtUsSrQPLsm7TVcq6aGkQDO60j6jXi/ujmo0SWOVQDTFquYrJ0rEpYf2zm vdlbToyiiOShLfMzCP31/+/QFgl6KS/+Uh0Zgllbk6ExmFd/C0IayX1FrGYCqdYTBufV 6DBrcR/pssPLbPMqeY4yJE4ody4nZr74Xz5rNo8bsSTUvl5HPxqSGwHo3/dZU/APi5M2 iQoBqYlIwuLeUx2gXeZkw9Edkc30vsoq6fox+J7wxxqKG68fWwkIh1NBr/iIpnFSBoZ0 Gw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nheyu68kb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:20:02 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 31AJAb6M036229; Fri, 10 Feb 2023 20:20:01 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2042.outbound.protection.outlook.com [104.47.74.42]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdth2c96-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:20:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S3K3DzJiqLYidI7dp5+J6h0TpN4HOcH/Tdz52/xbk8fQJvC2odrn1Y+oYwITOMkjOImn37QAZ36DPtZIckodLpkQGw0MyQikxWkv2dcODKj9cQ4pAoIvLd0c3A3Y/GSyc6VucxaJmFMx0XHzd44SP91VDTwaKc2rS3LaFgCtf7QNHOZ9hkLSDIkXKDz7Hz6t1M+OXtza6A45YAAMF37+I8WpGC9mQdijkEwMSQ75YpNlNCtecEdOZbZMve/DOVuggqt+/Z4agzkTk1KFx8p5fGSfxlJ8tSYdELLDwDo8NeSiqkFsDAFT9gwDyHWvK6NWK+/gtHvVS5JKpHOYmqY2Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VL5ggjV7l8uquv3Cdfin43ZELlq/Zxr4naWQDZOYm1Y=; b=j3XpOeXuGQjSiHUifHg+1HrtQlPfNGKiAb72oLHd3h/LYTbpi1BZCC3h9/goKOJFBvEJ56vqRs8ZdlAdATZ3Or7vUWN6WjDV8PNlBMhe3HZhqd7g8Bbxgu9oEBu7RmN4ltGzZDjqb2LellNBN4cwdbR5imrD/t8o/WzLJ0V0wrOT5NOPVjFDZ62n0pcv7P4Cm6RYNhwpER7UyFN1ANmcsWfg+/PxYRgqVxcfPEJ/rH1SPn8Ia+MA2+njQk8Ui5exebZey8PYKTsOIWLakJ+WdB64DdraE0z6CS0cGFpLZemZ5wPUY19pIDFozbxnpr01N9GzuXcBRdAGNS5i+JuPVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VL5ggjV7l8uquv3Cdfin43ZELlq/Zxr4naWQDZOYm1Y=; b=ZOHu0xjbAaIi37BcQ/qYuf7kng+gE9bLoWtbgaU7H064NGVRFyB1o6ZdsW8KggDebMBWn9v1NIJNyR0cw1LqWPB31+Rv19ZTrh4TOlbIvGIjJZfc6Kdw0HWCtojEjtXYd+lfnh4Vr++YtpOzJQGnGhXxUoF+kU7udvKAyS1FxVY= Received: from BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) by CO6PR10MB5652.namprd10.prod.outlook.com (2603:10b6:303:135::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 20:19:59 +0000 Received: from BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d]) by BY5PR10MB3794.namprd10.prod.outlook.com ([fe80::f37e:ad45:7d9e:d84d%6]) with mapi id 15.20.6111.006; Fri, 10 Feb 2023 20:19:59 +0000 From: Tom Saeger To: Greg Kroah-Hartman Cc: Sasha Levin , Naresh Kamboju , John Paul Adrian Glaubitz , Rich Felker , Masahiro Yamada , Ard Biesheuvel , Nathan Chancellor , Dennis Gilmore , Palmer Dabbelt , Arnd Bergmann , Andrew Morton , Tom Saeger , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, Christoph Hellwig , Yoshinori Sato Subject: [PATCH 5.10 v2 5/5] sh: define RUNTIME_DISCARD_EXIT Date: Fri, 10 Feb 2023 13:19:39 -0700 Message-Id: <20230210-tsaeger-upstream-linux-5-10-y-v2-5-ada7b8d36096@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-5-10-y-v2-0-ada7b8d36096@oracle.com> References: <20230210-tsaeger-upstream-linux-5-10-y-v2-0-ada7b8d36096@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SJ0PR03CA0215.namprd03.prod.outlook.com (2603:10b6:a03:39f::10) To BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB3794:EE_|CO6PR10MB5652:EE_ X-MS-Office365-Filtering-Correlation-Id: 7574f9b1-dfb4-4c88-7b4f-08db0ba42eaa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S/Ja0UrE7IhB9EsREiMHj6WZoxJfc+JBtw9zmJ55Xyfy2Ybs1F8jJAXWfiLljK3S0EhJhTW+cBU4RrQc+zlasEtFwTiZLdNL20iTFco3fSrDEYk9nEAqbx6ElBXvUvi3HhwTUJAp/epF5RTNdtY0UAg6ArYyNJ3nT/9jZNrqHDiofQUnZ/Sh8/IxhhhrC8ozJxXRS9BLS3ORx8ZeKpPWIV2WeAmnUjzXUjC8jYJ/rLCe6KyOIIZUImfWdHBeFUbVEPNZ8QFXoqifPR5jiyoF98/ZYgM+Sjokp5PdSVLtoCxCQXf8vZjvSct60ArV8GDfPxyby5ORdAt6+At78QdttdVJeYS91enzROzifJa8Q7xtYLtOiCAIUr/dckwM8Y0K4Eq0EiNasl/4BJ8trs3Nr9a9EmH45C7dhP/S8JXprZld6N0uStxDmcx2IuXkB0AObKe6SdxJvozVm7JxBc7Pcm02t1jMTbjSVgVTEUuYBKZemL9/CsiFWMltn17nFPuwPjkRsYxrfnuWfy80v+brCrH6s+6SM7b0Y90P0900Cwy+ubTS8fxojMJWgGKyXxIdpbtttDoAZXoTDEt3vueYsGSi00Mbrf1iIkseW9/5lZLYg6X42Fh2Lkt5XqYCMjavTKuHWRuz5P4Mz2Vjvl2864XF4LYfn7ykRJZiYkoGu8AsyiHKvVXESb+HYS7VbWBAlzWSTCqVoAHSg99Oi9hlcQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB3794.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(376002)(136003)(396003)(346002)(366004)(39860400002)(451199018)(2906002)(36756003)(966005)(6666004)(6486002)(478600001)(6512007)(86362001)(2616005)(4326008)(6506007)(6916009)(8676002)(66556008)(66946007)(66476007)(7416002)(44832011)(186003)(5660300002)(316002)(38100700002)(8936002)(41300700001)(54906003)(66899018);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?z8eDNG+J1vx3x40o6pt74UeHbISo?= =?utf-8?q?e6x9GhdTQl58qy/gEnY6MlBjrr/t0AJCNAr/b+TjTjoTpwDWcpz03tQeLjDv95GM8?= =?utf-8?q?OOwgEzuWyVCLKUsVS2hVnRByS+6fDswmmqY8h/w0ywOX0btc54GoUNM2n/hUNAJ8Q?= =?utf-8?q?14oFmc7b9M6DmjlRGM8skkRXSxLmaQxvQ8ey0l3tKJigxMvARWJ/WqOQzcsOyrBvp?= =?utf-8?q?CycJaOJnu7XnzDHU9aQNWeZZGngNuhlY/RwWbWwKHDxS2rJeff2Q/IrOK08A2wdGY?= =?utf-8?q?zbxHNW9VESnD//vaJIpiGQUTorjva5v0VWFeu5JflTLvu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iKN6pFPerLh2g8zA?= =?utf-8?q?+kYXtqzed2MV3YK9D5MsqDpUvP0MKDHNs/cmF0baTkukIEyOqxWAHr5j6mzXvdYjS?= =?utf-8?q?m261W1wCdlF1Q5RrLGC1+QRuhSrKPGJ4qJZvz9EL0tLonbFUHNwa5OmBuqjskamZI?= =?utf-8?q?EWXGcrAZY4VKE1FzCOyjbbruz+TSTkcFl0DP0TC2YyWmVJJJrDOAawH0FABBmyNOZ?= =?utf-8?q?UUdBnu1Fn66NmEewp3ZPH+xXrhjszrd4SD4h4W238dbTpzKEC8XJihAJgjn2+MB/b?= =?utf-8?q?9rIOuMIqlcnXRVfIuf1kqGfZVjL3aUFpF6lstdbgWUnn2AZC+DgLsEbtBND0nKt/i?= =?utf-8?q?fHH7mI9EVOtyOcrTysGw+/QY9oaeCeJSQblZk/LEXZtocZKndS1B5k0=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?jLQl591eF79XNCsn?= =?utf-8?q?knhkRldCy+EzRYkyHGsOmoTR1+aR5Y6AwwMrNk5Y85xExRpBVodG5IXbr8r9eiANN?= =?utf-8?q?+YzbmVpEkvht2/BpSUf5EWl+xxmnliX5RmFjadf7YqLUMFpI02CPyaI8wVP14c5nZ?= =?utf-8?q?XpgOV1Oz182b7HtVRO6fud/fbE3mTeEeP9eBHcGwMHEicWGmAqjRA7myyzNd9yZcH?= =?utf-8?q?EjC28RQrRaUnnrZ6ZckGN1IPG8NOP0rhVaAwJXsJtehM8sdhyzp8K3mm2P7WffNEr?= =?utf-8?q?b+4Wjk3z7x5xM5KmIEUI6Py0UueE/XLVPOMiC9KlGJNxLotLOus9WZeU7Jdm9AD31?= =?utf-8?q?wBQWRfmLwwbgRdvZohsMB3CyLHMueU9d6XrhVyVx1DyGjosr0IkmLxeWi9o/koEcs?= =?utf-8?q?xukHiMWjXm4lxwXdgP2cCln3keKURJqGaIk8GTZgnM98WYM8s1vCQygFLe6bD8JsN?= =?utf-8?q?eln4X1iMYmPOiSz2djYB3OOXMkoXR+OaHhILcegdx/G/BgGL6RiugPg84SntR23Ew?= =?utf-8?q?+hLMu50xQ7ACRaaeocnI2NLQyTJjlT+9AwXYW4P8BfFXUwG/R/LgMOZO71SB2yoCW?= =?utf-8?q?iZxNyC4m+stojceYtSGfrMGGepcQnGDJdDl+rEAFSr6m5IBrpwjrhJ7u5k8v7zUwD?= =?utf-8?q?SvascuXdqK7MHFsgXVLblFlTWWj7slAdsG0FYkV8gierfpSaHIxyhxbDNdBJw6DXy?= =?utf-8?q?4JNw/eac2hBLBdGbNaeTVSF/m6V2ZbSr+ZK/8pCxYJJb+5az6Tjdn1spl63+UBPat?= =?utf-8?q?oIWM+y1Jq/wvvYvMJZwqc4Pvk6MbRTVetlFp98UIATJU6kZc05iSqrsUlvfDjXubq?= =?utf-8?q?cUAbwLZYTjGYmy3MLPHiNJjz7RtD0WwZwBFUU6RmcyqO5ROWJgsd7rYk63gaHpfqZ?= =?utf-8?q?mzhNVQtjXwjs/vrHI8UUQZumI+FjUJJ5/0Mc9WPZfWY9mIH1t8icvAGKYtt5gGh/S?= =?utf-8?q?QNOL5kQf7BUIKUnrsbdy1WkiABSR9deb2SrgEmuwQlD6Bqf/51VcPB77o1G7SB8+J?= =?utf-8?q?JQ0BX/FWnYT7RNCJPI3POO5E/bDC2Pbz7A4sw/kxmUmucCKd8BO6+BAfRwxszncxg?= =?utf-8?q?8l0O8j6vhrsH2brzGuXov2qxz/6PYIQLVtGWt3CUs0Cc8SQ/dh1tm4zG3BgkmScsj?= =?utf-8?q?tmO5XTsPVbeHQI/9O13OsM76zH5Z173gwOmRTdgrG5K8ubQcF9b1horrLie6gLBaq?= =?utf-8?q?haT+bkpGdrp6TdAmmhuWdeqwT3x1o?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7574f9b1-dfb4-4c88-7b4f-08db0ba42eaa X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB3794.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 20:19:59.1023 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iKgru7HBQOZIsiNE5AApNd5hYe8R65hIDQFNS5ZhLkeKijggRB/9eDsI+y1d1RYmOzgiGSwa14UCGO4GOHqmEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5652 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-10_15,2023-02-09_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 adultscore=0 malwarescore=0 mlxscore=0 phishscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302100173 X-Proofpoint-GUID: 6JB-zsa-1VpLB1o2s3OCHTAAmJGCNgM3 X-Proofpoint-ORIG-GUID: 6JB-zsa-1VpLB1o2s3OCHTAAmJGCNgM3 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org commit c1c551bebf928889e7a8fef7415b44f9a64975f4 upstream. sh vmlinux fails to link with GNU ld < 2.40 (likely < 2.36) since commit 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv"). This is similar to fixes for powerpc and s390: commit 4b9880dbf3bd ("powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT"). commit a494398bde27 ("s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36"). $ sh4-linux-gnu-ld --version | head -n1 GNU ld (GNU Binutils for Debian) 2.35.2 $ make ARCH=sh CROSS_COMPILE=sh4-linux-gnu- microdev_defconfig $ make ARCH=sh CROSS_COMPILE=sh4-linux-gnu- `.exit.text' referenced in section `__bug_table' of crypto/algboss.o: defined in discarded section `.exit.text' of crypto/algboss.o `.exit.text' referenced in section `__bug_table' of drivers/char/hw_random/core.o: defined in discarded section `.exit.text' of drivers/char/hw_random/core.o make[2]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1 make[1]: *** [Makefile:1252: vmlinux] Error 2 arch/sh/kernel/vmlinux.lds.S keeps EXIT_TEXT: /* * .exit.text is discarded at runtime, not link time, to deal with * references from __bug_table */ .exit.text : AT(ADDR(.exit.text)) { EXIT_TEXT } However, EXIT_TEXT is thrown away by DISCARD(include/asm-generic/vmlinux.lds.h) because sh does not define RUNTIME_DISCARD_EXIT. GNU ld 2.40 does not have this issue and builds fine. This corresponds with Masahiro's comments in a494398bde27: "Nathan [Chancellor] also found that binutils commit 21401fc7bf67 ("Duplicate output sections in scripts") cured this issue, so we cannot reproduce it with binutils 2.36+, but it is better to not rely on it." Link: https://lkml.kernel.org/r/9166a8abdc0f979e50377e61780a4bba1dfa2f52.1674518464.git.tom.saeger@oracle.com Fixes: 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv") Link: https://lore.kernel.org/all/Y7Jal56f6UBh1abE@dev-arch.thelio-3990X/ Link: https://lore.kernel.org/all/20230123194218.47ssfzhrpnv3xfez@oracle.com/ Signed-off-by: Tom Saeger Tested-by: John Paul Adrian Glaubitz Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Dennis Gilmore Cc: Greg Kroah-Hartman Cc: Masahiro Yamada Cc: Naresh Kamboju Cc: Nathan Chancellor Cc: Palmer Dabbelt Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Tom Saeger --- arch/sh/kernel/vmlinux.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S index 3161b9ccd2a5..b6276a3521d7 100644 --- a/arch/sh/kernel/vmlinux.lds.S +++ b/arch/sh/kernel/vmlinux.lds.S @@ -4,6 +4,7 @@ * Written by Niibe Yutaka and Paul Mundt */ OUTPUT_ARCH(sh) +#define RUNTIME_DISCARD_EXIT #include #include #include