From patchwork Fri Feb 10 20:20:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136340 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 4519DC677F1 for ; Fri, 10 Feb 2023 20:23:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233890AbjBJUXJ (ORCPT ); Fri, 10 Feb 2023 15:23:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233755AbjBJUWr (ORCPT ); Fri, 10 Feb 2023 15:22:47 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7416783CDA; Fri, 10 Feb 2023 12:22:00 -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 31AHwhii005533; Fri, 10 Feb 2023 20:20:40 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=r7KjTkFRoyk1VYqkeou6pOGL5sJNyxPRtaHo/h9tUs4=; b=td2IIriQsY4Yhbz5BRc/YhawONYFAifA/mc8pYlYglNvwK20uZ6k4JSVegu1seacsyBp oJH3V/SjWfxAt0DqkL+f2KtHHRPUg7DzDulE3zoWBrUtTlJT/P0hvKSs6HDHTEMfuAK/ qPQXns6EHhdfq3P+wpY4puW9pFrQGxEWEQhV4BTwr7iuyvooWUYSTwVl9L+GIFXW0zyj Mr3ZdwHZCq+fb+Pnb8pibSbXRvIIgIloHfyW7dg8cLDPm6Bik6lWQxdt/HslM1cqchdo vZ5DR28TUjZtca4F7EyHUpIgg5kWWtgmYhhS9ky6+2/1g7W1CzDkYnI0FXGqTiV1/h29 rw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhe53p6f1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:20:39 +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 31AIvq7E036260; Fri, 10 Feb 2023 20:20:39 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2044.outbound.protection.outlook.com [104.47.74.44]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdth2d4c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:20:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CmaaECtac0rTQ3EqyeNDJYAoL1MC1wZPXcML4ONGBK80MVY840x0xijOtWwgsXvvd0/azIwVqCzYN/0tJB7G2R42Y795gCimfweL+nvebdd9FYfRgvgkml94fbR4QNElEKeyaO8yuNN50tnkPW2N5MtoxEsnRPCD0iOMlNQnMKi2qBYOiHWhv1St28d7MVtdPgj0dWIf8J1bRS0bJThBW/ex9cDSjuLD5EolLz4HLIY5gJLdEQPMQRqYFVm5/zLCIdtAFtPdlMrB6G+5UlDZM9ghi4NWEY5hOmNos/KjkWfWQ+xsSEVmjuRmYXHDjYf24aGzotxZI3YdKi6pzGpyrg== 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=r7KjTkFRoyk1VYqkeou6pOGL5sJNyxPRtaHo/h9tUs4=; b=iCuK3Z8jjPn7fYdGVvPARXTnJ54OkTvZseo7a1Re812FOXltJWYtCHp5aVhUts3meRg+ZLcA076aLxzahdD5EViVI78TdctgDpX/Z82nf7TsNR3BpQEdWZnLgVK5mtg5ZqtQkQ4KTFldY6t/n1PdREIbgURT4RVWExkgLvjBRrB8gRRDVdr+M2yJ9VrRZQ67QwUJ0dHNd90SoA1ZW9lj3KRlFxl+8tIAgLkS5GKvOVkmESJ1fZVH1doRHxCS+owMoGUZzY5mtg/lBZWPlyaOfBlk9f6sA7J6JJ2k084BDGsUpIecM/jpLxHwhV76058iqSmbt7xcaRn2zG8odX2xPQ== 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=r7KjTkFRoyk1VYqkeou6pOGL5sJNyxPRtaHo/h9tUs4=; b=ziOesL+sZc3dpUgkrQlS7GShnvTgrDcDPWK0nYbxmL0+UOXOkFj40EilnY46KKYwDgUOa8H1jU6/IzZDR5/2YP7g5RM5nUxNgnjxYfYqnqbgR+KOHkN5IDohl10UqgQcV+J5inQ86x0PGhuW1x3YDR88YPRPELhYNxCFjCLyzqk= 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:20:36 +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:20:36 +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, "H.J. Lu" , Borislav Petkov , Kees Cook Subject: [PATCH 5.4 v2 1/6] x86, vmlinux.lds: Add RUNTIME_DISCARD_EXIT to generic DISCARDS Date: Fri, 10 Feb 2023 13:20:22 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-4-v2-1-a56d1e0f5e98@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: MN2PR10CA0026.namprd10.prod.outlook.com (2603:10b6:208:120::39) 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: 5cbc6105-8df5-41a8-f748-08db0ba444fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nm4e8+jCFEttqehWGgvpMzf9DLKgaqtst2yRQiIN++Tq978u4H2E19Y6xZjmQhsnnVCM61yqHTf7XOEuPdOiK+BvN0RbtTElLBTbo10Qv5rJRubOx6sj98irJ3xMg5CeveXgN+SwG5dbmwbRCSVAYbVQ4oPCZGh8i1hb6CpquqknPE/CwVNCOTu+/dLP25T6tkz/x/t1zOG71pegH1EntWVwFJG97eB72JqKETk5IjrwiHQqOt5mJZLczlI0Ja6fiRVqsBYCYU7XtvphtXehZMBlRCBDGj9eWJn2tgEBcwYEVxiK5AvORn0IrDcReP83TC6QUduFK24PYAUkGvaphWGyG+iRsV+wdPGP5Agr6dxdN52l7uE1y0m0ItaisUu2YEH5hbF91/gjQHHU2LavaxOclw5nr1tYW+AUo3hymIew3U7+8ySFW7C9qTckPphT7IbD0PVEo3ldBvOKtMYrHPkqEt+NNsXFXQ8vPJmjv7BNrV9lr2wOZqszgEyR8vyVZU5MOy60bMb5pGuYUMGLyFf3BbGOEk7N8s/JtUaujbTN05JO75geri9c/b+38jx0jwlmtTSGHDak/sDbgTKT7uEdJz3aGybSCBrPC0+zOysmo+3i3stZBRPDzxnDr3A1kkuYTZN/gIMe7wnH1AxrzcHFor8JLIgU2xLtYga4ClpeqZUnIT4cH6qWor6XeZB3oKJaJc4b1dyA2N1UJrL1kRWgkv3t6ng/v1iKYCnffSA= 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)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?7JiSNYOJAyv88RvQWAgZ0Y5b8P3g?= =?utf-8?q?FD//C7g+/1/Tpcu3ZeXbJDafeg5BCZD/XlG6jvN4v8i5Vb8ZCIxctz/bHwM7R6IDC?= =?utf-8?q?Xn7RR1oZ4AB0pnlK7TX7Bekp4LtXBXl86PJmMLW3+PKS/n7qQA+AmHnJoZpws2VSv?= =?utf-8?q?BwvAtAIkmB9fHKpZGLnRL6G57W5Ar4pG1mWrLLoWIuloz5Ps8pSnmVPANfpPLnnza?= =?utf-8?q?r1uZdBjzMjYsrK2CvcYP5f7fpjnFyy2iTnVYrdJB9pgsga7hrTfKIoj/t1VxrBKI+?= =?utf-8?q?bmtOyTQefqbBoUQBQF7+LobukLqdids/5rMyo8+2dUm0wNgOPSkhoIl8Zxb4QYoBx?= =?utf-8?q?4g/mavzGvGKi2veARWgHEnwTZ7hoVhjScS0h21R3kC8z7/jXiMBJk+n1Fu5+ezugG?= =?utf-8?q?ifOx+78MNXr/gPbbccpQ1P8E++lyuWeHNmmYCZfJzMxVMSfQafwSRVBhYwabIyJlV?= =?utf-8?q?5qXMP0h1/h86/Ds3X6YHIWBf7RFEVOwO+hRq/YrGrYGQFFCErXq8ezfYdrZcFFKZJ?= =?utf-8?q?AtTAF/7QoqAw3UA5ErOlR0zfexLGnFKkpi6bt+Ax1X5CUxGuE+acKuT8hYbYSusOW?= =?utf-8?q?Zr+P0MkPCxtVxa0mhdjTRKaN8X8I+1T7lLSw8czk1vuAqGwXOHo128F8rm0rDTepj?= =?utf-8?q?+mGn56l4XholPnBgw9dZuLXNhkTnToc6vB6t++ZpQTMbtjgjXnjiy3GtArmW1sBLw?= =?utf-8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ange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?ehONV+5AJwr42jCs?= =?utf-8?q?SCyWYcmbnlR8CoPVk/wt+NdO05B9mmxb2djc1+pwxapln9LV13GP4l7Jrdn/dI4o4?= =?utf-8?q?ezw7Q/vBdkcLTO352a2KYkYzbXrPnOBGQhUcs82fCRZibxUn9q/ZXwwZtcRm9bXE5?= =?utf-8?q?UzyWBqA2VO/BK6Y+FcwYZ6LmBuwqDuqfC8Ys+eN9R4Wrap9ImErkpfpunWyO2newR?= =?utf-8?q?VF0j9JbhD452IVh545EKrLTvkft9QhxX8ejKKGbntI7VPh9pEAYXgFJWyYzAFBGj2?= =?utf-8?q?YZe2ixvmkZvOR7u4pnk4xrTq3XnmEHXzwYAV/dyjALi9xwtry8lc4S96SiV14NbsC?= =?utf-8?q?IJdTZI80LEG+eSNOeidpkZgWixMPQ1t4IdSKuQNi/4LHPdI8JtRHfFAvOpj+uy9ov?= =?utf-8?q?OSrilSn/jUv93r7fZRY1gkLuF3NciWrOlGGEygC1P8IEvA7xjav54iLEgPS5/LONP?= =?utf-8?q?/zddsqbHlmMTMifotcPsY5IniODousngViR/znn9DMbkf+p6+4YllgaFDVEj5go2Z?= =?utf-8?q?yQuaC4j3kz0y+PejrbnLhepmbOrTVCOXEasFvc9w3UHMF3h/xtWiM+ia0FAK7Yxdn?= =?utf-8?q?08cpdoTkL7JFAMx7js4UNqhIBvVhEmm3NQIsCiUoN2C20nBQc2bHUxslhSmVIBayb?= =?utf-8?q?oolE8Pls0u3manJYGLAQ5fS77lgpOuD4sVXpvAGtoReRuAYFDH7IKlArcjKifI5AO?= =?utf-8?q?sJPDSxwxGkQyJU+Q0TFiI78WfwEc47JIH60lI9km5kceibTRH278Q0t8BP8bSUoKv?= =?utf-8?q?JJsELNFjXLxvfWp4nKAQMxyvvM0rBsJzAaByr+GpS09AhkD5BihJp9uO5KM/kKoGT?= =?utf-8?q?jyUfQpeJIEB79zL5kwMQVSwScztYTcbtKQnWQrrhbotugqjgYqDyH8G47m0lcb3+H?= =?utf-8?q?u3N0B3X3b65rIf3CeR20sPgP9rLIceJnOngbhTueTv2WkzAUeZ4pcuM0A3fp0dscp?= =?utf-8?q?N9APfLCITmx4xr9Jwr9j1oIqt0Q54rBjQ4eKuVn4bmhSscgnJRBr2DRc1mv35FcNA?= =?utf-8?q?xrHMpcdwHhbf+doEu11PcfhvpRKfjDWDNuOC4ZH8C1mH74x30fUzbZHO7jRSxbXAP?= =?utf-8?q?qRCtKpeXhrMJVz3AXfuVaFHdfyz/35Q+1rYJg08ktfoDcDKkva/E3l0M7+WyjvSD3?= =?utf-8?q?xfmUxOwutB3PUqD4ARStOhvs/ltcFjaL6jH7XTpcLXIbeoR0JQiyIaU/I/LIbsiyi?= =?utf-8?q?llv6LfnblHUEbFgU//PmhxXJFwjhXNIvkBnM6P5CottGvXwPDNw=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cbc6105-8df5-41a8-f748-08db0ba444fc 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:20:36.5684 (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: 7F8JeDv8woMptHQunOU/qj23XY19YKk5CXiygNAD00rkUARpvapXqbAWjEIW4PCxZ9P0iJodL36lyjYKPotWFg== 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-ORIG-GUID: OmZkZ9rXb3vIbezrscjuRnPcng-x3xVA X-Proofpoint-GUID: OmZkZ9rXb3vIbezrscjuRnPcng-x3xVA Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: "H.J. Lu" commit 84d5f77fc2ee4e010c2c037750e32f06e55224b0 upstream. In the x86 kernel, .exit.text and .exit.data sections are discarded at runtime, not by the linker. Add RUNTIME_DISCARD_EXIT to generic DISCARDS and define it in the x86 kernel linker script to keep them. The sections are added before the DISCARD directive so document here only the situation explicitly as this change doesn't have any effect on the generated kernel. Also, other architectures like ARM64 will use it too so generalize the approach with the RUNTIME_DISCARD_EXIT define. [ bp: Massage and extend commit message. ] Signed-off-by: H.J. Lu Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20200326193021.255002-1-hjl.tools@gmail.com Signed-off-by: Tom Saeger --- arch/x86/kernel/vmlinux.lds.S | 1 + include/asm-generic/vmlinux.lds.h | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 1afe211d7a7c..0ae3cd9a25ea 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -21,6 +21,7 @@ #define LOAD_OFFSET __START_KERNEL_map #endif +#define RUNTIME_DISCARD_EXIT #include #include #include diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index c3bcac22c389..2d45d98773e2 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -900,10 +900,17 @@ * section definitions so that such archs put those in earlier section * definitions. */ +#ifdef RUNTIME_DISCARD_EXIT +#define EXIT_DISCARDS +#else +#define EXIT_DISCARDS \ + EXIT_TEXT \ + EXIT_DATA +#endif + #define DISCARDS \ /DISCARD/ : { \ - EXIT_TEXT \ - EXIT_DATA \ + EXIT_DISCARDS \ EXIT_CALL \ *(.discard) \ *(.discard.*) \ From patchwork Fri Feb 10 20:20:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136339 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 3A4DBC05027 for ; Fri, 10 Feb 2023 20:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233831AbjBJUXI (ORCPT ); Fri, 10 Feb 2023 15:23:08 -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 S233859AbjBJUWr (ORCPT ); Fri, 10 Feb 2023 15:22:47 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0550583CC3; Fri, 10 Feb 2023 12:22:00 -0800 (PST) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31AI0WOe017288; Fri, 10 Feb 2023 20:20:46 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=VrxY6FEeDrhSrD6bnLrKzJPNvn5vXR3scp2L28Wycvk=; b=qNI9wbxLSv7kWMSkpBdey5vfeY1V9skUwsk1UjqgkB+YZa04BuLZmcr1kWe2Dg2J/fNT bg61T4bN46ryJISn0MV2CLyVcg0sTjuPxzboK586EH48WHdFSIBqsfOEaR4U/fROfrmh 0AdtBHsAouYtQde4kv36eUX10tX7wt2n+F0JVGPsIJ91nZPzIM3J1VqbnQMMc9H1bEfp 9WXFmM8BakFh0e0rXKoQ2VkmxiZMjQ58oSPTy4ynyprJGycyzl8NxNWCQX3fECUMZ1HK 4Ek5S9epfg2BzKmvFolkbZC0zTJlLk5MLC30K4vNvoINr0ujMZSZ4/hUKP7jdxl786BD lg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhe9np5vf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:20:46 +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 31AJZVFZ036245; Fri, 10 Feb 2023 20:20:44 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdth2d6v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:20:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DoKy2Nthrr4tYEcrHbhtUAr5RMI2Y0UwoXsv/zSLakgqXSZRhrY/GzurSNlrd707KYMtaOi5gLtXoooHG/52zV/LRZlFd1cVsf7k1BipL0YArlLRiO/oKoW/Dh5ratCMYhJiUj9OGMJxkcKv0fsb8oUJZ48HldMpyz/py5mgzdNSvRvsMKHABhx4BmUJUDDq8H8Xdm5b/XS/LnQ+uO0vLhsrtrd3gPAwKqKmFA89uk2MrEFLNGC9+sAjEcIU0iBf18PoMcB8gKJspDWfSCRhFvq9YaK5tnXMkXz54CB9N4Sm0TLhW/zlBI9HCRICdazUbFX2AeyXEcLysnae4E5Ktg== 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=VrxY6FEeDrhSrD6bnLrKzJPNvn5vXR3scp2L28Wycvk=; b=IhXNMpsFqSCJMNECsphUzQgxSAlgRbfv+AXiMA8QkXmf1nXquywnV2FMoQUvlA7gKwCJ3o9y+r6KQyQjD4gEMnRPvI2UF/EDa0QRFEvl4nA4+vIkaJeKW8c8Ejao0AnkPHUBN5esL8esBpFSfPqufqKvn6SnjRq6veBTvEPVS4gcj3Fw/k4CJT0m1ZKh8Vp+JWwrfRiGvfaYCRaG3hYF6ad1mh1RqLbyl67WZhYUXnOB603d0HMV9CKmsgdzbmUKEQ/LZXVBSvOyBnXOpBuqm+Ky0RUkt15JJKAtlJLei122/TZlRQYrWe53rNRUpUHktjz6r/SiA/nA91AmgEIarQ== 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=VrxY6FEeDrhSrD6bnLrKzJPNvn5vXR3scp2L28Wycvk=; b=bvJZY4PcOHkyG3uCh8NZdwMBvjgJvo/xZ+R7pL0PFgriGrouJ0SE/w5TowqvEiCKLtCuVwFLJtZre46QUf/sqGECblBRwSZL6XIQLZSuAaFkQG3moWs1/glW1fm9yhwpX2NeCZKyKpW8yemvV6nz3R+VtKemvHhsHrTGMtz+/7s= 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:20:40 +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:20:40 +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.4 v2 2/6] arch: fix broken BuildID for arm64 and riscv Date: Fri, 10 Feb 2023 13:20:23 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-4-v2-2-a56d1e0f5e98@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: BLAPR03CA0114.namprd03.prod.outlook.com (2603:10b6:208:32a::29) 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: 52d07fb7-ddc2-4805-0cb6-08db0ba44745 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ruZKfL6Vg08tBeLdIIsuTdYy+XmEAtrzFfy+gcmCgzIVfwSf87v6604Ix0OUBGCqI+AxkuWEUfoMQpb9myfNIcS++YYssMURP99AXKZf/t1sLsdGdqeULrMYpeoZ6IxL84GrqPrnePqwic+G4Wmo9ahRkdNzdxVEUOKdTcVyz56BozlapQmkZ4i75UejpFFthzqd6HXx9kHrR5e3DlfKzVd2TIbOl3CboBZl4o/MYrhzNxr/ds7l+cs2MbLFv5Vos7oHD/SyNBfsgxhg9OTYURdeJBA862pJHEuPdFXyiZ5WRn3nnp0qOKlW2DAw29dbhLqOcmpIB7zPujBMVz08+B1DfyiMnzCnMmieyuoBbEiPzGJ1CDGSPBqjLqc1ZAEumwwws0NYuNFiBUlv0CiqCP466mKA3qQdYPPdmC60Nf0X+gZQGiYrLsP5k0pYjZDMkiFDWlrIaOWsNLwN6hxAnrUYQm5woU99CXSojnF03KzvJUbYcLKu6XYYTk9SEHh5lgG7ACpzmK1JMzkAZBvwDGtmBRHDLKYVffSTgRhV9HV05u8KLmUtz4VmafGFsuCIuSraWwynx5wpMqIysbD8fBtQLt6Z6xiVumLWHRkeYwIc9fIOSXto2C8QL7YgL9VqR2FW+c1PnwEJ7jGWELqN3PJQ57qpAx2UGemTAQezETw= 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:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?drSvgeZd7RVpKmysycHOPRfpROr4?= =?utf-8?q?dFnDNbgtlP+ypKmf9mYcQsuZ7V9DuL/j4hnpEK/1i1NW4tazoX/HZeQDAetTaxKPn?= =?utf-8?q?bbrW3y7kJCrCPlrSf2r/IMuDMCo5NJzztntjQx94F5lLzYkUb7GBHASlRZIVdkj68?= =?utf-8?q?Fm++q6Bm4p/HC+3FDUTIHOGAjidlDzj1OD98TDXUCrO3L5NVWdB5f62qUfJyejk2p?= =?utf-8?q?PD8Dyg2wNiDNbGN5GG2UzAJvjqnE7ok3BkQedYEYxYjc1c4VNftaNXi9PxAbkpkke?= =?utf-8?q?P1isyXRbKMnGX5XkYid6xn6ojxbTyXVhAFZPgZOvSHbB7qYbJ01nHZEkR4tr6kaew?= =?utf-8?q?XTOz7Iv680C6ERmxqEwuqGKxxDW54LMjs6zUWRNBIlNLSZPV6xicJyBiXWVLTNkLC?= =?utf-8?q?mkBO5GXBk6GOz9OzdHLU1kNutAhAqyZCrHqZI7wyANIS0VjiJ2JfhLoe105ljWI8m?= =?utf-8?q?uHMYfLuiNuBEUPEHPZ1ajsipsr/UIbMGh5VSQ4jYP80bCcUUpw3im03mXW1wcgHqM?= =?utf-8?q?n110xXy+GjUQ/rwbc4tlxkZ0qiRXJGhyGmB7gXRGGav1xk7V3+yauv9ugOz3o/+bu?= =?utf-8?q?ZrhoPXe2rjo+p+LVodSheuiAgjju6SRU4aPZUb4BsuawknhVBS/cTBMvsG+f0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OzMkat?= =?utf-8?q?K/7ILWmBc6bX7xedRgweGUDbRLUH+4lJkO9PEPzaY72FdopwNGEYbZI=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?ox0iaROlrMu8RS3o?= =?utf-8?q?3yhRRqr3A1bNHO6PHxCrZu+Biww4oO7Aq/uJeAx11FVtK36Xe2ooZkvVFg7ORsK48?= =?utf-8?q?ZaXes2fQ5qJpXHSoaIwNYxAh1HdV+plUj/oVkroSDc+oL/zxsGPPX4nVSUv6hI62c?= =?utf-8?q?zXrmKy+v+7GvjOEKLwoBDTCkG0umkmLC00/x1/QLHXoKYXqPr6bK/aFvAcsGjd0eD?= =?utf-8?q?PI8DngImhKUVzhxR/ppx9ZqwBaAep4ESP4c0IP+7cUOHNb8ckvQknoWOwhY+dWSDa?= =?utf-8?q?sZDl39Lv+RvgP98y1+PwEKSxgRDHIpPFafwao2Fqcw3VjjolNrWXi+Km1QWzssd+y?= =?utf-8?q?Hy1117KjWE1WXAocgW/ev2AeX5fUJ5rvMSx02JL5KwFyGz1KNPQvSKPEiuUJjkvfu?= =?utf-8?q?4KS0lvrVoHOm69vOGzg4VUOOOnmexzLSHMZcQ1at7kjCND8zWComSJX4jy+sy1aJ8?= =?utf-8?q?/K4TAeA2Bq7UMpnSI8aMRZaqQdYcWOJD6XP5fIuAgEErcvZG/8xRZRKUIXvx689tT?= =?utf-8?q?NJQRT/WEAFoDze7bvYEGAdGzzb2SVrjjV+rTeg7pq1QmiIzlH3Fs0F0nnV9YhWFmB?= =?utf-8?q?XzQF9YJdbru/fe1w8RBekR5OzQnwnvdRtSe1HJGViR93Nr4bOjB17muZCwP3X3iMK?= =?utf-8?q?M8rqwNjc4qnamC0hSClh8yoob0Mt9Og9sutBpnSfqOePQSLIC9hwzCgKn2v++Yndr?= =?utf-8?q?Oo/AJzUNeDLVeJ8g7mVJ80ymPj2/WfKOO/Ejkp7PCKtQlDIwJ3aixfW0m13guXkPD?= =?utf-8?q?yQJ7jdoVzWUDQMu02Qfl0epWlm5zuP3UzwQ+5zwo7m33vTT9exsM3V4zMBlQhqfud?= =?utf-8?q?1a8LgEGAz7Hsy/WU5d/1wN0ZyzFMFzOUNl6qcZEYjiKJMKvr28oGYQy5UMpJckgpB?= =?utf-8?q?cuSCxSsSqZ+5n/KBJ6yiynrtbDO3dS5fNH+6Lr2+Q+YlM8nUx2nkCX3X78PAJNGJl?= =?utf-8?q?d7qyKyoXFxcSC5arB+WoZK/7zaOYzWjRJLZDO3Alx5LGQiFz2Olm9+OK//FPF+n0r?= =?utf-8?q?Fha9P4bdpnGiKRxpjNfMcCYWk35Qs6PKyGWPvOZHSUrkpPRdazuBiJcdH7uKYX2g2?= =?utf-8?q?xdtXrvDhj6FVacllM51UnSooa/l8cNJc3gMBz5egNQuLpscw8V2CV+Fu8QM3eJN/Y?= =?utf-8?q?AfKOgQXv9w91bNnjtBGgiVLbbarJWi?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52d07fb7-ddc2-4805-0cb6-08db0ba44745 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:20:40.3337 (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: UAjtaVZI8Za08TwmF6Ht0kSGyZQWL714modtBainm9TwXKIDyxxUugDIT5cPfKNpixW3jcr5b57K1SX0cRISMw== 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-ORIG-GUID: EyXU24meCM88HAVzdZNV_09UdtD1bkia X-Proofpoint-GUID: EyXU24meCM88HAVzdZNV_09UdtD1bkia 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 2d45d98773e2..a68535f36d13 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -825,7 +825,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:20:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136342 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 0CF7BC64ED9 for ; Fri, 10 Feb 2023 20:23:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233902AbjBJUX0 (ORCPT ); Fri, 10 Feb 2023 15:23:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233662AbjBJUW4 (ORCPT ); Fri, 10 Feb 2023 15:22:56 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C6FD831C9; Fri, 10 Feb 2023 12:22:13 -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 31AHwfgX019274; Fri, 10 Feb 2023 20:20:48 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=QqBCW0Bt5JbyYA2UStm7LO7bdepNZRe0BKllSHzxss0=; b=fwPffx00yD10rogBpQVgo+UGvP1AmlgCb0FJfZ2Y8MH6wPJIoSe+eotDhTDwHJzFPAyl pbl0E7qFortF3QGP8n3eYlYY8WJ4suTdrgEnvVfHz5HdmxvK1JYafh7jgaYAUZvoUCOR 1vopOaJRBlAuMvhRpoIX0pWOhrbKB2UDLzbAw+nx+UoWQruZPgc5RdiyUMRR9y7KJj4o xB7UYqtn1yANee+ynEw3/Iu2IlNXWrNrXvsIhSFocmLJapMMGno4nILrb8jFdj1r6tNJ hzXEitlx6ioUNHbIimT8MXSPibbSrwVk0SBEBzJRmVS158QG9YIbhWBq23q6tNC+Sjln 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 3nheyu68ms-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:20:48 +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 31AIpDEY013624; Fri, 10 Feb 2023 20:20:47 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2044.outbound.protection.outlook.com [104.47.74.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdtaqmhn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:20:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AOOMIoZL3XnnfMkM8v1tMWlJL0TwrkraBAb0DRRb0C72kcVnYHDbXYnId23eV+Zu2VZYAoZahrrW/4XU29QA/NCrZUOUDTDNiJMtgAd1Tim1eSk3WYugX3bxcnk1g/i9awfKj0NhoLiINYPIkSx8dwNk4Co7s+KgyVnAQuzcJF5lmu56LKyNP2t+Hd4H9K9EHTYpnJQN8prFqzAihIPvGeGbik7w8J9NO0p9VGvrP4XO1k7p9C0Z9mJya7YfIVdLo/gaUA8I38E7HL417lNnsg+PcHBU1HnF9yyoqbzp0b4zNDO/XwrNzssOieACAgIdCUVWeR2CzgBny7sdJ+6Lng== 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=QqBCW0Bt5JbyYA2UStm7LO7bdepNZRe0BKllSHzxss0=; b=YNArriEPJXde6peW9uBD2gDHJbWWiGwUJ7GvDQVgA84p3pAChq5bnTUQClfi6ky158x8WaF1J9sXaJ8bRWEGRW3Y4dWLElVHTkC1NxFckllxfY9YIirSzEjGrXcxE2A3wOdPj1OhHAbb5U81q1PYPibOOlRxlSI8eEC5y0EqW9rRp/wjV9Oug4TLBzrTVZOKmpAic6c9BTkoazvCw+tDSfpe2tVXRB0wQIYWpK6EPqxJeJgVQmkJKcHI/tpk/k/OCt1qEuUJBOwz96fblmaWPPh2TVDE4RQ0Xrv6yIQ7ila7doGH2/WEv/a5oNNJx1c2ar8SE6AC0LU9B7og0cSOaA== 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=QqBCW0Bt5JbyYA2UStm7LO7bdepNZRe0BKllSHzxss0=; b=ZkC50hRN68ttvaMEf3SFSULgNIt+zodOzKd9wGyJQiH0iM/XmtKdkfiaO8cx2Tpg7RmHcD3O6PNDP63JBmlvmWAqLhCUFBUrL3IU8KsE0YevY8YCA18yG+sJ1zwlweNoMrIpOy766ttp0VbPlrO1kr4GFQ75Kg0z6f0HtX7B67I= 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:20:44 +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:20:44 +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.4 v2 3/6] powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT Date: Fri, 10 Feb 2023 13:20:24 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-4-v2-3-a56d1e0f5e98@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: BL1PR13CA0298.namprd13.prod.outlook.com (2603:10b6:208:2bc::33) 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: 60c98fb4-b3be-440f-4513-08db0ba449d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RozIESzAEwyEmI7a7t6hr1nFT1qDCawzNDBVkOk/KqtZw3iu7vjxdr6dqsRZIZZWod8WbymkCIoWJWoQ6Lujyx5cwO3r/NF5exVfJR9lw+rEVT4NF94BUWQ0ipgLD9DMUYmhL/YuSOleGvv1NdshMHZDGHStuBPYHrfdJg0E4CKFyz3Wrsh+u/uuplcszcwbyjpmGBIjaOIDme8wWUNLctA4GQfHQZ0CJlTNtivdifZgSqcs1hN2Ek8Wienk+Taw7w1y1yBIZVhSs5uTLijBIy/hStYWCQKizqXE5rDc/IvUCQREVghJeNjm3ksWeMdneKAlvpg5kvoExOMWpY1o352hCzpRwvsloeUX9/+MSrkRq5fAPpOcbcBFHBCLJ7NRG+M3Le/xHCcHRfVCviPlYnHEtxeTVSKZWJZsIOgM+mQ0DSWWtZ6swOJEE9jLGoEuw9md+wx9QFV6iZupIOUIDc05ANtbaXdnteGcqRaoOalyqI1KynK29gstgZEBt2xuMKgVFr4CAAs5q6XJx8kYlZFGNY7FtTO0MDdzsKVcAuh/5Wo9n3Sv3Hm+ifr8tEQ2VBpjbMIqhRdw1N/wAs9yXHvck1JPLoOLCyupRw4fvmPEZnESYxTZLvwtjA+NDBKv0gtnisHR/URHIzpZyR8HDszCQQwreBbB9KqKjt3SZh/XHkCBAaAyRplDsuy5dW8uYsGjyKo3csbdE0E7Vz6mlw== 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?BkK4R524Q+yDQeKT5VHzr3NNY3Xo?= =?utf-8?q?b53+H5DhBoRJv/1apgL+F5HhEUFtX5Io9BkZuD2OBi8nnu1px86gQFHHjt/RUVT8x?= =?utf-8?q?IlCCqak7aBbkyQeIz2xmYBv/azmm6yhP8sEE0Xb1pMoG+wmxISPjp8kmKt4yT7vn6?= =?utf-8?q?i/s5mG+X7fGRdOcfSxiatSfNRSyB18uI6fvdgarqj9kODe3cm/4IL4yNLdIlHj4qx?= =?utf-8?q?7NLa0oNN70YGDvUL9vrCGFZpsMfVUpbeFA5QwADcQF7nJPmHk4McAPHdRrmTn02mT?= =?utf-8?q?8AKHAFDWWpmhAV91QzZ3Dv9lxCPaI0T6syqVlH8YQSsRU+ghlX7OsEkI/hgvldvAN?= =?utf-8?q?qSjV/iCn1adNi3mTQZowmRErlt/bR6xqSz0vJ619OwpatojO0UMruD72BsM8y0DLw?= =?utf-8?q?Ju+1NJWZCTewsZ9S2/9XPEZzaM76feD4LDIZ8HqwKvNgxJkWi0JJXRcWKF7oClKbf?= =?utf-8?q?hUAt6I50ri4Nk5xseI38urI0UCvB3065ySB2MaRFAi6uVDvDqAkNDXgTiDWcj5uwT?= =?utf-8?q?GC5J1iVgULQPItbBJKU4cW8VVO6Pyy62pV1LWIoLYRzEXNyWaf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Gc+Gb8GM6?= =?utf-8?q?HfzHQr1DmVj1qh6QNdJEGQaWsCATrf4gYPKdj25oYAVwwYeAs+HXBbX6fNkNBQ+kp?= =?utf-8?q?LC1Z24CIgnyBpM6yoaNS/z0ZtoZV8aVXKrzAT5R/72DE/58K0IJtpJc=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?Ts2zVf0tk2bo4oX9?= =?utf-8?q?xq79iOdE1/bJjXamg+xiGJk0HGSVmIN69OApC0E+V6pDq0yCdMBImHwhNeBBm8xDW?= =?utf-8?q?Oo3Y9ufN/88JFEUPsUK58gXnTzEmx8XIyRtggTKos4aeTe+b2aMfIWzqY37Et9Xa9?= =?utf-8?q?PFJLeotbkMvqeXaQJcjzU3tIBQvWLHBuvTEjeeekWLNwAKKP/MP6g8Sk/Kuj0bZeR?= =?utf-8?q?QXdDll61nAff/gIW39b2/cixcswyazuBDWKRot7IGdDu67KfKuwSUafozNYsjU99K?= =?utf-8?q?QOB1GOtQ53Qk8CKkaUhOov+caQPvkoxSEqg73svApp4e9cBn/8CDWw9niBNXDmkjZ?= =?utf-8?q?aiYTCB6tTJO5nO5z46To2q8wVP3UmQSv60P9Jkp+AtH9YZlBd28kWXe2d0/+ugKJ+?= =?utf-8?q?tJjOB9bRORJdOl8Zu/THv612xq4c4/Z52Bw3X5J6+4uaQ+hutwFYDctNrhY7jOFfB?= =?utf-8?q?0zmtZCJfJMQKU9kvh96fxX51OV900H62aKjqOb+UU0IYM00uW6ZlPWe7BPNbXGro9?= =?utf-8?q?NNQjG6zgqme0QpXuzCv0TFgmIT591fSMpJ9Prx291CMMJfZC9EH+7uqctZ+hMz26z?= =?utf-8?q?T7rbrR5pbKr+o34p5s1MX9mgb1O2HSXhcA/p6BhpUYQE3pRe2SN+RGoONjcdkdjL7?= =?utf-8?q?2O+giPxTj444RcH2F+lR83HAPYjSDjmsILUNCyI7gK43cbr7hdyD5hxEB0VYRhfGH?= =?utf-8?q?2sWES/ZS30SixNncfh6dWCqJ9PgDYcBYf+s0XAhyEmLic/0QYk/ktKQ0qInqhr6cl?= =?utf-8?q?eRcvWjM07RnZnWqPa+3dHxNBfiJor74Q4oL2Ua9FUUMTNUywy32MsEX7jQM7PqJiN?= =?utf-8?q?iREttdQPWMV0+C8cY5ARZV4lmhzAux58oy4zMI//5AHUdFBtFd7uz64kDSsnWbRc/?= =?utf-8?q?rxDKGxzq0WzDfqWzP+mHYHgOul/BW8lR04GbuUDb01sekIKJ5rM/fPCBWQbQmeDEf?= =?utf-8?q?ZfK3pGQzRqdp6sjmS4jYsj7Q7OVURl2xk/qxXVjj9/bNcXvtNyfNrZxcGtUheK3gZ?= =?utf-8?q?abA8YPdwSWHf39ofFgFEWj3AquRnyya5w0SjTZPUL9LrLT63IntqdYa5nXNuQ0YUS?= =?utf-8?q?vSple043ZGcWjsN0NTrwaeaJiP/EA5/TJ1MG8WRjkFM3/x5KSAg7lyr0OnZhbyOOd?= =?utf-8?q?WVxRtMVZYIf9iITGmUiFDPFkkx7ymyXS2mnX5UeyOhCzVm3LDWB0S4DHDh3vVrsnx?= =?utf-8?q?NCTfIlMQ=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60c98fb4-b3be-440f-4513-08db0ba449d2 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:20:44.6616 (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: Q2lGSjiA+A0OcCaEoYJpIT1n9g65RSNyickyqNgAGouBT4UD+d8OJniZC6OlOZVQUM6LrQPDHv/LfvBEPNuX0A== 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-GUID: g6EWzY_tPUnH7m7dRgFDI37sTa3vt1ih X-Proofpoint-ORIG-GUID: g6EWzY_tPUnH7m7dRgFDI37sTa3vt1ih 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 3ea360cad337..4d5e1662a0ba 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -6,6 +6,7 @@ #endif #define BSS_FIRST_SECTIONS *(.bss.prominit) +#define RUNTIME_DISCARD_EXIT #include #include From patchwork Fri Feb 10 20:38:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136394 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 EAA67C64ED9 for ; Fri, 10 Feb 2023 20:40:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233878AbjBJUkA (ORCPT ); Fri, 10 Feb 2023 15:40:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233394AbjBJUju (ORCPT ); Fri, 10 Feb 2023 15:39:50 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BB8556ED2; Fri, 10 Feb 2023 12:39:46 -0800 (PST) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31AHwuou001750; Fri, 10 Feb 2023 20:38:58 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=VhfbtTG/NUQ7wu7lNb9jypTCgn4r0UxTOdaBvnltlAo=; b=a9QZ1Ek8o5STVZtd+ZLp46ykPikT8bbDK1ovF+A4PA5cCAVcQBpUBsKjcg+Kpa9+d7gc nym6nlFNMwQ7dmMNdxoEb4lXVbRFnhngGmPu+I56/AbKQcZiSy92Kb3v+bHBPxxGtduS xw3hkelckykdxgzzOoErPiiUFwDHofdiEKBaIwvOUV2UN+sXoLB7PBpPNIR646cKFsdi IFLeg4MO5tAXY5Cep68lJ62QzIbG1G1tNEv2mq4zFYsb7nqmGyeQEvIIWD53z1ygfyNq z8EP2bC3esxVhBvxQ8UY+UHX7H9lNmVO22tArIN151IwVKUVhB3+8S+z+BVNZkjUxxZG KQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhfdcpa2e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:38:58 +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 31AJInko013716; Fri, 10 Feb 2023 20:38:57 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdtar8sx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:38:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=npVMUFpTRP0DtnYQX6YucRZ0smMD9A/oL1FNHXb+YLLoYda2fPZEZnSiKIs+7FypCwwLRjYHiGkUr09m18DwV4hkStPJityh6gzaiV+IZ+dxV8zh/AGR893qYAxgVHVLDxv6z2fVL5zcVQVCnY0e9XZishJTx2F/FJ1NkaaFe76iF1Po8eXdV8IOmrkvgxAKyfCBiCEo5gXRht29xVayInxcPlTRBNn9gKOUsR7pqQ65pJWSVyoktKQowakciwqraOgmrwZpzRtibnqbD/LA8axV410L5sEbD5sY2fRKsibNskoHLSLOmDX1531TeUjLGr9vnX4XRoT/oCIrgjcnqQ== 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=VhfbtTG/NUQ7wu7lNb9jypTCgn4r0UxTOdaBvnltlAo=; b=VGmOdSwMsU9wrOWUBMF/7En1BMTkhHQZFGcqv0R/k2b8uZWqeGovAUImsuMeB9q5x1PeVN4HDZ01SCQvWjLWRFOA3Bzww78ipik0U8MqHkqyYblnlJS4MvmTwVooMypxzdSXt0qSCUNMVQ1p6M1N5GV5/8Q+YzeT6kFThIBo02ABJw0naGR+S/l/HubgCLzUwmhPp30EzFQQUXea9zZi1FTxnwUWhFeaNHzPnWExAMYvR2MOF7gcMmHpk6wRCbf+IrnBXGX0RU1RcyUqrkINO2mGdKYVm6MjqQmo5gHv6h7cTSRN2Glb2/26kPIl66eCgmjMLTBEe7T9dAiO0OzzgQ== 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=VhfbtTG/NUQ7wu7lNb9jypTCgn4r0UxTOdaBvnltlAo=; b=a6z41hhLDPAwWV9chevjLJL/Ke23AKEoDzLIwY3nkDV2g5KfNdqTzTqAR4CFEDMsJMAyzn2QeOTvDhpFdSFtF2a0jrW2ahyqeZXhzVtht8DHlIiNMh0IlGdkDG/Qgqu7zMlFXwirz/7DlaAJnnzn5+V1YotDjwU9ZbHWdsneT+Q= Received: from BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) by DS0PR10MB7522.namprd10.prod.outlook.com (2603:10b6:8:15e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.7; Fri, 10 Feb 2023 20:38: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:38: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.4 v2 4/6] powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds Date: Fri, 10 Feb 2023 13:38:48 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-4-v2-4-a56d1e0f5e98@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SJ0PR05CA0118.namprd05.prod.outlook.com (2603:10b6:a03:334::33) To BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB3794:EE_|DS0PR10MB7522:EE_ X-MS-Office365-Filtering-Correlation-Id: 3680ada8-9084-4584-7ce3-08db0ba6d2f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tWEXd/S5tJaabiZXxQFPbXsiMYV67Ugprs1NcMccfGxVwsYhjBSUOULNSf9o1RkQ9PIZQ2LX+WHs8fBOmxQdNE4w/esMXctxJCK0EN3UEOuqjLCZlqeVGBLTWiUFtg7U/wPpcPV+h3ompfb+5OchvEoZhIWZmIMUmDaN94kGRByqalcjQlGXQf3zY40oS5Pebugp3kdtTPQJjoSZqzTVPM5vAmwZCM/LtFYi/b3yLsbwb+GcaGqfIop9YiiwDQMQl37cGoZtk3A3UmpUbs1ch4ZLVn4Ch04BmO38kZA+OiHAGCVrWNht7t4OCiGkURvZjV72Jtex0ybFyNarY5KO915ZOm2wHIhlE3EcJDFXQ7UhmzImH4zRDDiLZAB641zUE/wJWbBhVVY4X6/Vambh4V0tJxwP4gv3SFC64pOsEwQsvxeS4FAFiJTn1mPGEsgVWsZgcN+Q+XbLdrNYGgJNOd4FtOSud8Jvac+6uXrkUejRcx0aClaDEqB8niDkKq8CYOFwk0Ul9ArsuGqe2lonjfvTS+EXrOsKfPHlklGg4r54a+pK2/l2TeS+NnBAPsgWuO1OsZF3fitQ76RHWeH7dYbnwLD2e+vSHqnJoPVGEMiYLs/VqNkdRqvTBXJHsfVbGbY3MyGxduipqH2Tg6J0oiDjysDIZLZiYwS6Mm/6BzjNmkItVZ0h3xIafBJqX+oIZPTvhKHQKpMmGGxBBLfaR92aL/dGF97myxG7iLgcR80= 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)(39860400002)(376002)(396003)(136003)(366004)(346002)(451199018)(478600001)(6486002)(966005)(316002)(6512007)(186003)(5660300002)(8936002)(54906003)(6506007)(44832011)(2616005)(2906002)(7416002)(83380400001)(38100700002)(6666004)(36756003)(4326008)(8676002)(66946007)(66556008)(6916009)(66476007)(41300700001)(86362001)(142923001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?cy6+lIIGZbQMMNLC3EDZ0QIxQkfQ?= =?utf-8?q?UD2F0Kv0vob9zYmHqnMfuasgWuMxuJkzSvwQazsLcBRqn9P99w16jMNV5vGl2gmHb?= =?utf-8?q?DgNxA0qB8CSXaudwJC9XEGGkx+qtNGQ+89kvyhc5f7vvTU9kM8EZc3dHEEfaiKdH8?= =?utf-8?q?TpyqMIGTN0ugfLqVyyhJJA0/t8LuH+0wbCPzt+4KsSnCihY4cxEVWqc1vOXiFGlU0?= =?utf-8?q?1hh6ofTb0CtX6HXSu1aZQ/Oz3upnsdjBUWcidVsu3aQx0eFsWB61Z/NzGh9Dbc54k?= =?utf-8?q?eOzZiL0MHhUlc+Fck2X5EJKafwiv3NxsatJDMav70LH5M9pmYGWqjoX2qevrVlIj6?= =?utf-8?q?CEEENqEGr4TU4f4P3xLMjJf+GBM/jAQdDJG+oQVH01T61h7N9CHeW+IpQZFKQXkAu?= =?utf-8?q?Eol50EiJKTiZw9+ADtLKPmsGUSx3UDxlM3d4jiDE2B9RTAaoHNKbGrngBC8XiBe8F?= =?utf-8?q?+aMRv+U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FZGqH9/aJT?= =?utf-8?q?n9bkq7hbUbS17M29fMh3lkUc0rPejBSstbtCBefzO2XhA1DbZl4a78HuhtyW2wirH?= =?utf-8?q?RW2O27sKfDGZ/T3dy8MPxXSWqF2yaE96HZBPIKpNk4G44l+4vdzLNdgQZk3LMFj9d?= =?utf-8?q?hHndFLrZnFJZGWp4njM9LOjUu+hK4UJdgGaRLPOO1csUr7xl3DbtouNic40wWN/Ti?= =?utf-8?q?HTQV96MH5CoEviCIY+exRI38WCCLhMcp3JdSF3fKx8P8VZfwub0s8RX61n53hb/pp?= =?utf-8?q?Hrbn51sDju/51rNV0hP11euToJan3wCfVrT2aRrE4a+hg1Dq1dm0OIotfH1Ui0Aa1?= =?utf-8?q?aUYZIOKhKBBDhKTmJAJtuQXqFU26DKizCBBxrc108sczHXMsEbfiG0yFQbtCgFUpZ?= =?utf-8?q?DvxpFGBf1SUS+PfWijk5aJCmE4ZeTBCiXbtf5nVAcD69MHRm9DAR1zpoji3iG+2g+?= =?utf-8?q?kNLHWfbWvu+QxJ4Bs7L/NzPBzYAv3cWgkmP33TNF2ITr+7MGHt8nlpVNG22DhW+qo?= =?utf-8?q?8VUQcKBIOnISGdSDumxczEIxCTPvfRto2QroZ95KcNqP+4n12SZqMr1x86Sam6KzM?= =?utf-8?q?NhOB1/7WZXHr2/+kH7O2IVI9YDnr2+TCNxdyAhl9th1iAjpBDnDap5x29F5tXjs+w?= =?utf-8?q?T0z1DdnA=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3680ada8-9084-4584-7ce3-08db0ba6d2f6 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:38:53.7559 (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: BAd7Lys7Xvk8DD7JFzWukvsj/UFn79UJAsiTukvs6o21bNrbohZBn44zcf1b4f+wzTYxvVf8i5SvzDqOEZbEKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7522 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-2302100176 X-Proofpoint-GUID: H3jRyuyElL_RvEclc1z4Q61ZQXGAYvfI X-Proofpoint-ORIG-GUID: H3jRyuyElL_RvEclc1z4Q61ZQXGAYvfI 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 4d5e1662a0ba..46dfb3701c6e 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -395,9 +395,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:39:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136393 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 7CEC3C636D7 for ; Fri, 10 Feb 2023 20:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233818AbjBJUj7 (ORCPT ); Fri, 10 Feb 2023 15:39:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233713AbjBJUju (ORCPT ); Fri, 10 Feb 2023 15:39:50 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93AF35B775; Fri, 10 Feb 2023 12:39: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 31AHwgvP019335; Fri, 10 Feb 2023 20:39:12 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=fteaV//kM5gvfhNkB07KGHv/UjLnACIvgHB9+7jPycA=; b=zhz8f/sWc/O2IbwyzeagQ3xR+hAFGpZTMUgyh2OkO4PZMNVzcBnEHIx7eYAiePEMR/Cx YvgqSupzdAgQwxfX2KWFbA9pKDJZA6UtP3Dhh+DTsTXf/kAgHkD3vv+KL+3k/9txUjAt 04lxKgQL0HxH3KOBMOg+ImsPFKg+VldVka6fIIqECauGRCJsmvHyz7MVQp2Gz8vow7zL t4imQMICgVsOgjRcITsmmQBnqURBt2zNog19BPUgNB/tBf087bM2EexxyvXWafJTt0RL bwWfWFS5DKenirMtzS3jtCHzn6J9GdnN9/9NThHFLQcSxpC/gDOiAPAmlPKPVU+nVER/ aQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nheyu69pe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:39:11 +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 31AJg4cE025798; Fri, 10 Feb 2023 20:39:11 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2174.outbound.protection.outlook.com [104.47.57.174]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdthu2es-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:39:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g1c/mDCPOy7pVcwhW/Pajmz7VTcJb6M1puxwGEYg+vRlfME3nnvl04daUXzR9UBKQXZ95F+uzNF5yfFSCJjekGxAxsurSMo+nBWBAgTin3ZHzOTdFRhvOI7xGN8jY8YqCslx3uyJGpuKL9AwezeG7XGwR2mz8+DlB5mW02wIncxXreiLfwT0zC44aAgq0bfeia+mlaqawiT+v5qg3GsXnujfUVk4qt2O0+PRsvdB/sH4q3M7sbGB/hTtMDB1GDncw0yzsBJSoOfxYQo4zlmzUnP40+J5NsMbtHiBD7f4WMV8EKAkvb5nuEIQsgia/30lHsgoYyW4l0fQ7fKICmKqgA== 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=fteaV//kM5gvfhNkB07KGHv/UjLnACIvgHB9+7jPycA=; b=NoVJ9qwIkYH+5f3brpJxAtn293eZ43SP6u/786tbKqWkwUUqnXq4oqPfQ8PHvVx4CCqWJC8/IASwJAcfcurTDokOdrQWK+JehdXTbXhgatwjgQjvqdFNtNp/lvBsEb8k9s67cWSlyeKQw8DnSWVq2q608x5NS9NOfv1RNQV36BFT1I4b1FJ3uH3LhF+hdZk7Tq29jVxbZ4WMXJEJ5Ce4X6M6MoJsO4mIffdUU9M6W32dY6eO+J7Y3ExWR32bOgD+MLU64a17xGwsT8kq5UrHqtQQ/QhbFLxeJzv7KA51yLUNgwgPLVJ1sE/TnxycCBBEBfFldR4sBf9Njbt/aoaorA== 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=fteaV//kM5gvfhNkB07KGHv/UjLnACIvgHB9+7jPycA=; b=e8Sgez8dIBEfZKwTfG4y/lo3pbi3xHvHXYcnY0xEFcO2izkPij+v85S/9BM2dxKMnJ10nV/u7Y+AzMLl4tzjQ90IBOYIFAipSHT0wpX5S/FhcT9rVh7UKbwHeYyJG7RWKeRS31PvNx80pFPutP7iITHXax646ZeeekV5m8hHTBs= Received: from BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) by DS0PR10MB7522.namprd10.prod.outlook.com (2603:10b6:8:15e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.7; Fri, 10 Feb 2023 20:39:08 +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:39:08 +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.4 v2 5/6] s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36 Date: Fri, 10 Feb 2023 13:39:04 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-4-v2-5-a56d1e0f5e98@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SJ0PR05CA0022.namprd05.prod.outlook.com (2603:10b6:a03:33b::27) To BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB3794:EE_|DS0PR10MB7522:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f1bed32-1854-4bba-4dc8-08db0ba6dbcf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BGI8RDKM97Zrf9QwIg2sfa7qxjuwCKxJATGH7czOAyKGxHMTJOPXojPIsvP1QD/76L+sDFKvE9gW2z3kPJxNZRGqc5h62ORRKmykizT2+E4UHthXjzcVoGe2X6oi6TiAEyX74XslZ4liVkFE049b7HtmqVgf01nMiZK6gFWezSRaR5vnr8gXLxX/ysDUHIdqW3YPEMhLwl3q4b/nqUQxSscw/C0GZLPy/U6uFKnqeahuiGD2A+IRJ51IlTAO2y9hdU0ZpkR9DSQXFelhyjDU/F6tV7u00Rv/j2n3YQJWrH0r/iUZV7NcvfzGXWJOW2BbfrjYIz2DSWhEcYzcZRw1p2Cf6Hacpf+9IhmZoGeQ7iMIGHS5Xe05hgMAW9oWAL9W/OoqiNrQ9IF7o5yWnSASAsBhsKpur2JrbQYzOOWNpfVUxrtD5l7G9Rst8ygDCKezU6itAxBSFJj9FXzu9+jJVmMANgoNaAiQTbXn1BGiIDhZsj52xDlzX03t4PyYy1N1icDNF3lmGPD22N9Xgwyxv7qxneGEn6dkEa6v64QXnlasZMRduT3u1Ieh0wO1wp6hQ/xzPPQA4YXEGmZNJQ8gPp1Y8/pnsJs3AVG2Q9acAJsjiGXBm09qIArylYZxWEkfnYS/HojHw/m9BI9gaovlvxoUCMIlmUqRaX7JhmLs7KEMQmcWBPUycNMXz5zEtygIx+2qn1F2ePMKi55mnxIhjA== 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)(39860400002)(376002)(396003)(136003)(366004)(346002)(451199018)(478600001)(66899018)(6486002)(966005)(316002)(6512007)(186003)(5660300002)(8936002)(54906003)(6506007)(44832011)(2616005)(2906002)(7416002)(38100700002)(6666004)(36756003)(4326008)(8676002)(66946007)(66556008)(6916009)(66476007)(41300700001)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Z93gIXtYroV6d4Beow/s4Zxu6w/K?= =?utf-8?q?lboDqxujac45HSvBxjUk2L4RUdmt4fd6Y6/++3ryRLNQqOnRwjnpfwL3YwEv5Bk3D?= =?utf-8?q?zHn2RV1hdOj5F9lFWXv7Aeg+DE6LrgUMYmoka568qsmx/r/69zii+WokssvNgTrre?= =?utf-8?q?+unWZizseS5t3EqUDpAR5wT19rfz1m4bDVML7zkZBZpBQxHiX//y1m1eMMpNC6nIr?= =?utf-8?q?Hn1kVOVDYIg3Nw2ujeXPzyBZeg2dHcUOC+c+sNfQySDyBi2S95UAb38Dz5oWSjeOR?= =?utf-8?q?FwNE+csTavDYnKWECLI8yctzWD4DgvRLd5HLwsEOyJdxWUJl4bzcEWJuswRqmXaP9?= =?utf-8?q?bwnapuh2pz1SWGwe/OYozjnlGPijMa56G5svtyY/l6tefwddoCYQW3ulZdcVtHEEw?= =?utf-8?q?EqL1HXqvqPV5+tc2n64qEaTO6qtLulQ0B3EraA1BsYhzZUdetWB5Vn63Rhi6xYsaz?= =?utf-8?q?Hh5kt8T3A0N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rr2vUpkBmZusvz5Q97YTQvwT7qheFRUxUfqC/bT+3zzhEJE?= =?utf-8?q?Ze2pFCTg1hgaEFY+6Tg6MDCE9WZq8MBNZYpKnzUMNe4zrSyJGfdjM7T7t9ahtuHnd?= =?utf-8?q?2XjVWbR0coboNeFhsNHjHgtnm3ipTlbNTXqBvSuoCzVaDT7K6YmVSdxZ9yu6EIQXV?= =?utf-8?q?ddSqa2ig2asiWvUrFjBf5qTp7r5G+fNsfJAxMhl7RaseGJcie15Xb88=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?6ESvGj06PeSkuIRS?= =?utf-8?q?Cg1/HEA59ZmYDygRo/08Gn1pLkv14x5QXVpGLozk8JfB1C1k0eXDcEw244UcQWDvy?= =?utf-8?q?RdJiPMMjuS2K6sYzuP/VywkONfl+fimsRImQ/qNV2om+KR49IvweUVoaGlemQ0a/h?= =?utf-8?q?9qRYP1fzyxoqVj/v+HkPO5C5SZ1jo4r6b32rpZsZBLCqR0YOB8Sv4MPrIjSMI2DWv?= =?utf-8?q?cgCgs6q7E1r1qLivMtSavUqmfOeUWOcbuBF/0Ehz2hONjF8/rG86ExKsL0dQ6Bldq?= =?utf-8?q?hWfPTebPrpi+dClsKMBxjDXpqIVNsnAzwEHhPU0k0tJS+xQWhBApkTCh53jNTeE4B?= =?utf-8?q?vMOaGc4XHf8+we23htRzNznneFwV+kBz0TFmyc9Ng9h2u2EDxO3BvgLYHcDz4plH1?= =?utf-8?q?yI2v7cAiZd+hlptz59ebwvk6z22c4Cos9Hc4YuWq6Lyn8c6wYbwf4uNORaeEoOY8T?= =?utf-8?q?YcUnagsns6Z8O5Jl/xPpf57Z5Y9PE3RBxtrNuQhaaFT4h99CigEm+NziRfb4E57r3?= =?utf-8?q?t9L28mNu/KVWUyzdrxystUHUyhzRZCbsSpu6qd91qUuxX7/nWuV6FXBH8Oee1wRA/?= =?utf-8?q?3/s8XdYvd2yhWGPY6TBC63cLPDzh15hjBn4aNsHyoFOdFBv1XNcN9y0uN0Rf7Z+eJ?= =?utf-8?q?cEY9uN7IXOOOfXw7iuazonyk2LvBIqc3X8IhfwsyC24h0aRwvyo+ASVuxwiip2PCR?= =?utf-8?q?RK2ksMStdhKKbZ9DFx9w7DeHm56gvHjVRSxqYCeQ51XobptdmoIcxZUnzVLRfylx6?= =?utf-8?q?mARySAifhescI/UcknqPCIa5pfk8rJ6JMYUPiJYLb1RA6cJCAeYLf4IU2VVlZJl0G?= =?utf-8?q?yJviZlWTcKuyw9n2cDUYRhBttdNXaYYDuuzpt7rFlxXHdvM3QGjUrX/SySG33ur7v?= =?utf-8?q?XJ97TS/vMET8nkl6ng5TxKEbsbfVHVmlhs3/yzLyVY/Q7Em8C1CL3/UQXIMHgo1Df?= =?utf-8?q?ydjGeMDPcmo5MPsifyA/ADXqjjmOgD/ko7Ku0yy7ABKL68KtImxf0tPUSubSR5UBL?= =?utf-8?q?a5GyA/lSpQ3IB/Ms8OhzCAQRYOJ7AuN/ORNKayThcNJSSohz5iS2NTmSrEWpTABl3?= =?utf-8?q?WMy4T1kTX4lf//SvnnGzGLt4IP8ctIF0yEVApb9ve0K7daM/9eH1EimOqBKSZCs2i?= =?utf-8?q?Xau/2kHAu7IR9yR0kp51ZDcicRGpFGL4wZmDfOwsmy4GT9jqoMQg=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f1bed32-1854-4bba-4dc8-08db0ba6dbcf 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:39:08.5986 (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: VIe0KXS/+m1ky4P1FLHrPh3rZY5jBdQRDV9xzAWMN1FWFWcsIFtGoJZF0QcyWi8UNysoYBs/Q15YIH2jY6Uo3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7522 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-2302100176 X-Proofpoint-GUID: NA9lnfuEBtObvn3zgGK87yPlviIqp8GM X-Proofpoint-ORIG-GUID: NA9lnfuEBtObvn3zgGK87yPlviIqp8GM 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 4df41695caec..a471bd480397 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 + #include #include From patchwork Fri Feb 10 20:39:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136395 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 5E47CC05027 for ; Fri, 10 Feb 2023 20:40:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233714AbjBJUk0 (ORCPT ); Fri, 10 Feb 2023 15:40:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233752AbjBJUkW (ORCPT ); Fri, 10 Feb 2023 15:40:22 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49A947FEE7; Fri, 10 Feb 2023 12:40:13 -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 31AI0ALJ029682; Fri, 10 Feb 2023 20:39:26 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=PYDN8SoG5y7Xsuz/xXeD50LzGPZBWZEQK/CZBZ7kdWo=; b=2SdBkIORU1sbYK/+mowzZhukglFXrd+OHkSsq5ZnpXkZfKZAfoawvkrjykJxNWicEYxg 5IcWahwl2rfU+hzWJBTY037mBDi+K/4dvutWIBc6PV24yj9L6cTNGWSqBpqz8QnBauxl mYnFHa9jKC2BHACrF4lg6xCSAi/9T5LvTW/q5r9zVS271KUw9SKYVNprfkT6yX3C4rfa cT7E4XN9lkyvslXztvh22pqF6cUMvKvepkmbcI1mPNi6FOSE8zMvpI/zdbqEs2rNp7EA /BkdF/PpgyoVg4NGeImEKxZRU1FAFaFeQ/gxv84LPcGt66CJudKgpgy56bdF6gh80uUC /g== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhdy1eb8f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:39:26 +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 31AIuWHI003019; Fri, 10 Feb 2023 20:39:25 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2172.outbound.protection.outlook.com [104.47.57.172]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdtb84ps-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:39:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AO+Te4Zi60MIDUgk2GX4DmrEE8vPC31DChwt3R1gm5kcT8TdGCFKbWs8EBbFSNkLw+roovXqmctTPN/59XffqVmOIqUR7frs8X+efUFsuQ1oGcgBuq9ZrjaewmSL1DbH4naVMGCy23DeIPDqIN/tAUCb/lRkdcrYOswGolltbtEErVmMg5ddBGhb0vfvSjvZP5P5irvboBG5xzbpKEeDygeX3YtpthKOYbXPa36auNrcWeQzgT/nQFe59rhBBOsaTlZiTBtrbjK9yB1lKmElTfGqZWYg3TkZPjqv3GH28pZUq88brz8QAxYSeBpeLyMriaXieS7pUUZbFiHr3XhxJA== 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=PYDN8SoG5y7Xsuz/xXeD50LzGPZBWZEQK/CZBZ7kdWo=; b=R7dRKwIhiUg3GawPXLbtbkBZ4NajXqqG9k0FlRzEsKwglhqz4BVs5grD+OIRfsCL1JKeM1Z42e53sxW9Zgc0cTwxkocolLiV+UZGA/BGsRV1S6z/MPhIiY9IquftauB65m/q4Dr1ph8saJxNTTh/G1ZXAzVpcU/XzWpwM5THM2N8nnk6k7SonF5oP3/HThs4ytoyyu4+HvF9QEPZHnBe5/yKrkl88+HXdh2x0rgZKPGZU9Fp2KvdHlbVdzwJhESCslF/k9x9kEXP/4IOWuJJzZRIFcIhW63bRJN7ixOEnoP9PMrVbfvx+f34XUdvLtbK2OWir7sfzlAOUTgLTTYsTg== 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=PYDN8SoG5y7Xsuz/xXeD50LzGPZBWZEQK/CZBZ7kdWo=; b=zgqFCUkXyCicg5/c2tjHXREJP3oiAONameuHMrleBNz+Ezc1rzw5Dbq7OHt6iC7psL1OWhpaEKVirMfFPExNosxfdQp9xEXiLBFEU3XTLtpT8fHL2rHspjvwgR4hYKBrWN2RSbSKzWApz0nVcryQqghysqqwVNG8kcQ9ypW5PFs= Received: from BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) by DS0PR10MB7522.namprd10.prod.outlook.com (2603:10b6:8:15e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.7; Fri, 10 Feb 2023 20:39:22 +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:39:22 +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.4 v2 6/6] sh: define RUNTIME_DISCARD_EXIT Date: Fri, 10 Feb 2023 13:39:18 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-4-v2-6-a56d1e0f5e98@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SA9PR10CA0017.namprd10.prod.outlook.com (2603:10b6:806:a7::22) To BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB3794:EE_|DS0PR10MB7522:EE_ X-MS-Office365-Filtering-Correlation-Id: 722bef8e-d1f4-4ba5-3f30-08db0ba6e3e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0C4NLnU9MIljGzhVfQneNGsVzIGukZO2qZsGnonc61qIEYcHXZvEOe+hxcLOHIGmbQ8xnuf7xfDFsmvoANYFcZQBgQNnMmtwY27i20yZKrr7VUUkT7BoiuXB4EBEfdwUhnh+OhhUuRU3NBG79vs4j7dMEAmpgbliHEm4kbOrB6fSh/rlTLG/SAe5SACvryajhy37oshthXePsSOfGVZtpr8Qt+CNNiKsGfc7ejddozO87+bhf0boie8meKiEDRukIrVyg3ZpYmVUkbfGabyy8PfqQ+J9zFhPgBeGsuzSg49eacaxNrA1d3ZZEXLZixH3GagjP4UsdlxuCDg+3PZBpXoR350+pbNVqlPKLUswhmZf/t6nynA3OlfYnqTzyhl3tFtO3qRu+r4xD6UuoSodSUlgsw3mOM+SPnguWM8ZCyOc3DjjSw0e2lMiL6bHisug7v6xOVxGRoJQGOBK7DSa6hlP8KM6YoAEbyEZ5TwKbvofJExAcK/Z/hr9pydEpiNReE2qQGdU/0UNUK7NMA45GKrWWtvM2hZEXrsJJmh3GpzRqFMwWzzVWDCEzmqs3Ew/Jak8wPkjMS1sl04OecAcCBWSdnj5JNi39HCegmIgfA56eJHoYbN/adllBuOTq2thveCgmX+kQjwxA1Z9oz/iXhPqicYuWlzLgeolGlzU7O9snV8iD5bLP9sJTSw8J0VVOrsm7tQ09N/SYz8VwCrszw== 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)(39860400002)(376002)(396003)(136003)(366004)(346002)(451199018)(478600001)(66899018)(6486002)(966005)(316002)(6512007)(186003)(5660300002)(8936002)(54906003)(6506007)(44832011)(2616005)(2906002)(7416002)(38100700002)(6666004)(36756003)(4326008)(8676002)(66946007)(66556008)(6916009)(66476007)(41300700001)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Vcr0INBa+TGJrdLpl6+ij/Z2ljuV?= =?utf-8?q?lhR8ihB6RhNKxx1237PErpl6/BnouQgdeNhwcVq/OFh0n+ujRwx52wFqVLVHIOdRD?= =?utf-8?q?2v0bkY6Qhn3dK/IxZAzYIQ71ib0O7UQoRM1vA8ddl2/p8I5fNbvMoq/t1N7rlF7sY?= =?utf-8?q?kTxC/nwnCqiFTi58TezGkXF/FttJ5Xu1d1FYxoZ6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l9th/DZavi/AaDZxk3BZKNE5S7X?= =?utf-8?q?R6qvzOEkpJ5Fg284PGlX/ODP0xsfedlDOrGv5iJXvS/yCFRXPTbnjNCg8mN8C0Vg7?= =?utf-8?q?yV2fj42RLcousOz+ruz3Hpe4nBlVLdqLs+E6scDnpkQDGMX6hWBEdwPef778PtaJ+?= =?utf-8?q?qcZGImE12BvvSKdwUo2hUCxRtfrJN7KmAybY2uAkjuIZjEzQgvw12AzlKU/UUeNbD?= =?utf-8?q?TnyuzfwBrKbb4muYppJ+mWjJkV3kR3wUyqcVNLkaNZsYySOSixNYJf07ongMqIMSK?= =?utf-8?q?YO4+eadCP0WJtPZXcsLkhzYE0uym+/kfEvk6nCIW/wQySdCj6Jpcs6YGZ4FQIwPCR?= =?utf-8?q?kYqOhXeirD/6yv7fboqR32Rno+pisW265tqKq7FgYEiefmQ3o07oFeQM8LmctLptU?= =?utf-8?q?ecIi3tIf0p30lHZyTo3lb/Sk6wMVc/M/x5RUaTmRILTF9F0CREgnb3Dlo3fSaby4Z?= =?utf-8?q?iuLn8yg2Dd4F+eucSVPqI1vUD+VKtklLTfz5u3xZ31feFzU92zhUjcU=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?tFsGRw0MKYvA1tju?= =?utf-8?q?w/FHdgrAKYJOtn8lZNe3sTWXfbSVCj/PfXDDr3Cd0KgDYus8Yp1xClOCvgQ07qocI?= =?utf-8?q?hiBIvgvpBO3u7k8unCV9srbkDggzpTFg8zlKSPJ6iXGYUzquyLQ0/mfIbw1RvFYoL?= =?utf-8?q?MI+VobwgRw6K7GpdCvoKFs31U0NldpsuCfdkFKeQ2nbIXiNH6ieslVsR00A1B49m/?= =?utf-8?q?23H/xtP9To3hvMWQ49+CX8Ib5EySitbwX5fDDqK/sy1myK2aM9SWUTXj0yJK6J4wx?= =?utf-8?q?+ij6wrGUMunzlz7/S3JGseWRJjCbK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nJ1XgNEn5LMYzgPYiq0AU6T7ZRio?= =?utf-8?q?z6hFnLai2oQxQRpg+4X9/vHmGxHjm?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 722bef8e-d1f4-4ba5-3f30-08db0ba6e3e2 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:39:22.1445 (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: Jvt1LgC0Uy3WedmmaU8i10sRnuHjvFe6GlqeBLi0uc4CVwmWcU0ToT6p23GbV4mJAWwl3YJzAMETveCYpdN2ag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7522 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-2302100176 X-Proofpoint-GUID: CkaNXL_ui_jJ16jn_qyaIML9DyqnvU-8 X-Proofpoint-ORIG-GUID: CkaNXL_ui_jJ16jn_qyaIML9DyqnvU-8 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 77a59d8c6b4d..ec3bae172b20 100644 --- a/arch/sh/kernel/vmlinux.lds.S +++ b/arch/sh/kernel/vmlinux.lds.S @@ -10,6 +10,7 @@ OUTPUT_ARCH(sh:sh5) #define LOAD_OFFSET 0 OUTPUT_ARCH(sh) #endif +#define RUNTIME_DISCARD_EXIT #include #include