From patchwork Fri Feb 10 20:18:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136327 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 84876C05027 for ; Fri, 10 Feb 2023 20:20:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233626AbjBJUUg (ORCPT ); Fri, 10 Feb 2023 15:20:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233358AbjBJUUf (ORCPT ); Fri, 10 Feb 2023 15:20:35 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03AE6BB80; Fri, 10 Feb 2023 12:20:00 -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 31AI0GNP020903; Fri, 10 Feb 2023 20:18: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=aM1KW8fcv9x3Lh1wkqmDnC96s4GncSh1wfFQnGb8NXs=; b=pRMkbVnl9jZUPG9nsEnVyp9vQQ3J3nw0cNpjTm36nO6sA1p1lYX6kJu5ZVAVvVbVTmIp /OFu3uRMz347DOVJDsOb+oiLDGi7YrTiokJFXbZHi7pcekIvZfuJGilabkNfX9zQ/Z3Y +1ZL1vwSjPZxlXOVcn3HopLKuT5c8UUxm8XkUYHBTgn8C6PcsmVfpJTBv0c8D7AVWd7g Z40GECzAZs4UUj3VcqGslVTdrQEKPlm6mLy0UObVibYlPX0ouwkZBoCCC8+pw2dGvA2W CFEsw+wpk8eeTo3eEcjdH0r6aRH0sWOAuHtCtrBsA+yKt4Xzq9ZNVr/q5BMLST8ygutN Zg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhfwue4df-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:18:57 +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 31AJ4KUq003058; Fri, 10 Feb 2023 20:18:57 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2102.outbound.protection.outlook.com [104.47.70.102]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdtb7gnk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:18:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xa4+iGR9JZv69PSqnm+QkarefCirF4FbelCO84BQJoqOz7wxDh1LHDIQfQMgAc+HvN6stLGQ85hC5mvEJA4MFI4IzW8nzN0Lyt3aoJsJurhFpaQNtFy0JD2dhRb3fJQ2RhchsHODd9bNRa/mHlIulLjGf77tavvpQpEeszsGqiA2kqcYKQy5ivXFVTsfZdIZt/styL/5yrGQI0bJfTQmqbgVxuzJBURH1HVojleJgIqRWd6HusR8ESOqXovVS2xEU/KWGWlVnVOk22IHVFRKfgp4MTOMILA+jFfDWq0NKocDxS181mOHr5tyxwC2nql2FDA9+ZT1fL4LvGlhPD0jGA== 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=aM1KW8fcv9x3Lh1wkqmDnC96s4GncSh1wfFQnGb8NXs=; b=mhGGYkSAt5PE1iAhPEmtTX9c35JGDbTnXJ7VAhe8eMz12PBY89jBxwSHhkfehlwwSlYq1OI0ihVvLFCZ55JNbVRxRNGREjWZL0f6/dhLOGkvkxl3bmtJxT5lgSdVqnoDjDjimFtuwUM6NbgpX5hWM0n2aGBrfG53iKoaLSqBgBYQpCKGFCJpKANhwSRd55+AiwgvKV4+UYUImBn0eNLlcVlcQ1hAXMwucDbpENQStF10AqrAPnKgJbqS4LzAD12BFbCqKAH9hZq8VRlhceRlo38wH61txfi5lRPgZ8ZUNOJDIewylxfdSC1qpdnGp6/Fdkk7dfIPI/ymWziw15ovTg== 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=aM1KW8fcv9x3Lh1wkqmDnC96s4GncSh1wfFQnGb8NXs=; b=SpGGF9i+r8cZtv8NMLUmBIVoGDrP4JMlq8brshsRW0/Asjq8wHWDwFazbyVt3g/bbV9ULb+MXBAAhXnd8hOM0PHX2JHeHWOWxN6HQceHsQKVXDcm466i4Ja/cmj2gjBl3gThih0N+72iCRPclma9UPBeynCVZpGKfLWd8ErFCg4= Received: from BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) by PH7PR10MB6083.namprd10.prod.outlook.com (2603:10b6:510:1f9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.6; Fri, 10 Feb 2023 20:18:54 +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:18:54 +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.15 v2 1/5] arch: fix broken BuildID for arm64 and riscv Date: Fri, 10 Feb 2023 13:18:40 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-15-v2-1-6c68622745e9@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-15-v2-0-6c68622745e9@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-15-v2-0-6c68622745e9@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SA0PR13CA0002.namprd13.prod.outlook.com (2603:10b6:806:130::7) To BY5PR10MB3794.namprd10.prod.outlook.com (2603:10b6:a03:1b2::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB3794:EE_|PH7PR10MB6083:EE_ X-MS-Office365-Filtering-Correlation-Id: f469b6a3-a479-47d7-98c6-08db0ba407ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OwsHmfP5yhXlq+yX1XGwEC4FQ4rlSzZntdZFqW24mk5F/wHbtFAycO3eeKuITm8RZ+0rIDr2uqkJxjexntk3cLxhO9Yw2l03b/495VTlSVuAB8kiqe3hp+fddxDbuQP2OT81zjpePzKdae3NuRY1/1UdRCox4vqH2bmAD3ONI99MVcj0cXSlJJd54RWFm1Ihug8alIK1TbLU1msPEDdsqBQ22KSBOGMM/pteGgl+j4ndruO+Vd8ygBKn7ujqipd3FMRf6T7egOcu2qu31yEYTlN+Nu1sTL6Sk9DEkp5B1LeYWyB6kfisMEvPNN/76gW1BYuqJ2Jj1QFTKmq7IwlWtMQXKMagCrDW/uue++bnipC0a5UJMecPIaDfRLyzsNmvR/ax8f9s3bLkjHbt/w7wsIceV7s+CjNEusWB6P3YJUiDmLKTTYKb1PnO/B6Zmpdy0GAQNqobNuUWaKKrKl88ECXJ2DL2rNWpZwTsLciE/HAiMDuyOJ0DKRMfOvGQ5rOa7OOF+T2OCZ5kOigCwjx9O0sWkLVSqF9aO/aAa0PMqNipGC2AseVm0KX7uIc82wTNCuT/Rf6N+ADgjBVkakKhjz4pg8FV8Yq3nGconDrR0MnK3saUMvB4yWczeLJHVYwt9KEFDEX8/enbKYg9Q81PZDM+TWdRHK6i9Pm8V4s6pJY= 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)(396003)(346002)(376002)(366004)(39860400002)(136003)(451199018)(86362001)(36756003)(38100700002)(6916009)(8936002)(66556008)(8676002)(7416002)(6512007)(6506007)(66946007)(4326008)(186003)(66476007)(41300700001)(44832011)(5660300002)(6666004)(478600001)(966005)(6486002)(316002)(54906003)(83380400001)(2906002)(2616005);DI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IR9o39cCxzEcp4vwthvIDA/Nj5deOeSS?= =?utf-8?q?/Ge8nagRILx7KA8e5HhkDuwWqamrKa3xQN3VieVCJti3aTaqSFP82F87hHHFkj0TB?= =?utf-8?q?HRpMcI8qVdQ8lqwdgYQvblFPKmyvPxd1VHr6jdzUDdvRzEVCuWuthj7rpqahedVs6?= =?utf-8?q?8z/N/uqnLJGUEMkHbz0Vkuab4VBua3eAnFP0wIomNzONm9JQmu3Csx0aftvR0NEl6?= =?utf-8?q?BwWi8PsKOrUSjY+ep6abOP3a0ioxCnGl995dT8j0Gu/F/KS/k8kHM/UhPNh8teco4?= =?utf-8?q?Z92w7EbpTdocNU/G3P+rO+sa9Vffa6dRga6CKPx4cQXaQDIwhc8mjzh9Mv1IiNUV3?= =?utf-8?q?lpaq8fw9Y5wjWdqxHUb0chVdzHmm/ULafXfy2VPVqL09Xk3mwQWgQigvZ6DuFyqpC?= =?utf-8?q?hWiWeX4lJ6akaAwZI+VPHnTORQ7ANX6rz6Qd87Zip00NAjnPP3SuUg/dxXKIWMuau?= =?utf-8?q?2I5qQU/nAtIztKz5zt/+UDBICiRwIrBVZxqZlp5Bli8H+z4VoQLnk/9SZ2WAxjN4O?= =?utf-8?q?5LsxJ0Nvokc45RczV7pVLOzg4GhS/at0KE8mVouANDCq27sG+LlJ9rAdCSifazP2M?= =?utf-8?q?JzcdTmGnww1MVQp5D2v7juzSZgLt4oQXbVv31AAxOSIkC9DpLgE7MvPJNR86l4Ysk?= =?utf-8?q?BWaTN624mpU7tEOG2Zx6v6PfSbCOe7zWJG4atbKIGuKU1Z8OxBzK8HGfqb8E/DSX9?= =?utf-8?q?JnU/YbwlWJObd73r/hR7+H3UEokgqFAYcI5Fefnc2gVX+V3B/0H142E=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?nyK+5bNdINMnEhR0?= =?utf-8?q?DBDYanjJpYqFkuA3y42it9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QT+OSsu14KcCcWsJMm6EvixSFsY0pZqk7ywzJlXir0DORz?= =?utf-8?q?pgOanJlrBi/0C7ZeMh1TJD3yrAG1jvZcpIHOmtzkPOeFoBnhOdFrFt4T7EqiY3TDV?= =?utf-8?q?40PJEdN32jQmOzM8GcZ7mlj8y4OhDbjQNEoutpnYcznT85IAWjOlgY6L54zE+igCV?= =?utf-8?q?8deOIdIkwJ1MnoNtQ2mfj7gNbgYhExIQ/SrhV5BM2haeKdiNTOiBi/HBgpS+penV5?= =?utf-8?q?CA7VbAN2Gqaik/9ugBD534IFkXsIX4?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f469b6a3-a479-47d7-98c6-08db0ba407ea 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:18:54.0601 (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: APyFQ63QZs6gmh02jHjJY/myGbobLlDcqN59E6JJsskLesKm34dRuHFbH8nTB3sh6FZgX81ZQrtN+8d7bTeFQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6083 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: wMLQTl-kvQVt7gJFxMf26em6RDdSHm-O X-Proofpoint-ORIG-GUID: wMLQTl-kvQVt7gJFxMf26em6RDdSHm-O 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 e28792ca25a1..8471717c5085 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -903,7 +903,12 @@ #define PRINTK_INDEX #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:18:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136328 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 A3D2CC6379F for ; Fri, 10 Feb 2023 20:20:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233713AbjBJUUs (ORCPT ); Fri, 10 Feb 2023 15:20:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233666AbjBJUUj (ORCPT ); Fri, 10 Feb 2023 15:20:39 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECE0C81CCB; Fri, 10 Feb 2023 12:20:02 -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 31AI0Bso020866; Fri, 10 Feb 2023 20:19:01 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=cdMFz4JJXYI0K5BiGbqcUzfos2yoHBp5IakE4YK4bqg=; b=26vr35gHvidjqYHGVQN2LOYGvcEScR/W7fGRBb4qU3Is93w8ZDcWf8pLi/SPxkDK9Fas pmrTnVMYl67HKy8CRISC0xjLwaS03uK47wzmdnnNbjeWCn4zejC2QNfSt4N5UFeOuSSG VhJ0dKwK8xz4hKJVwmn/2T5U4FzquCZihIjq3weIr+75qMiXn3VtDPPxa0AyiqR1MFH3 mnRljpW9UnrzT6u7PNVw8XAyBt9hcDa0lyvF2IDJNsnGv8Er/xYybgnT4rMPQ01q8JOJ ISw+JKLnmb+rCKGECD8AITTEG/0AS3O0HxeLKfQu6RfNijrRYREA+D7MNrHz9xlJaqVV Kg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhfwue4dt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:01 +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 31AJbBUN025851; Fri, 10 Feb 2023 20:18:59 GMT Received: from outbound.mail.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdthtecw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:18:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qp7vvrfzNU2PQ+cGS9ydmUB0x524TAUmLLAIr0qbZdep8+aiQrWeYPma18AFqllkmX66KvVZ6MjjsG0fUK+HT9KohSvniubnKhMJwglhGKwRBYEsNsOjRG4jsMgqhAsIgrPnoURIrnMcadVMAf2eCih/xr7hDG4iF+7hBKabY+VMf8AxJ7E9xZwBCQIfEShP/TkWUzWK+t9Z6QoqPIu44TylIgYU8CjxFQciSX12f6E+QSh13rcG9Yqm9lLLbUrHrG/4dbzqa37DLYvDD1yZF5XFYaCxi1xIs/g89S3+S0m5qqBsbv2GHbPhr58sH025xHuT9DjExmltSNDkoeFNGA== 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=cdMFz4JJXYI0K5BiGbqcUzfos2yoHBp5IakE4YK4bqg=; b=oNbC4GqsK616Wbi2qLD3evuMTLoaBQ1TGY0M0Vmhd9owsnrpnjTJz0vBTDRmT6+/L/itVu5fqt6zT8Ad4XaAE/B4VEHaSxlSpKzOsET8eCuGCfaprevmYbok8VsJLW8zulCA8TrneDPXPSPFgAR82JV3/OvgIvENRqrKg2tDUNg2MtHy8zwkWH4SgDaK+hBLRnAWz408IWBOMfyMjL4sk6rRnDVumugZ1n5l4lG4+sqf4GNztab18vtzdz+Go8H/L9ZvLZBNYVuqp1iiTRj4EB4PDEBcu4nqjB9GG3k7kFNmhxS1hW+tFALJtWfKZgJKObnxfEPfVfs0pZHY8WS0ug== 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=cdMFz4JJXYI0K5BiGbqcUzfos2yoHBp5IakE4YK4bqg=; b=V0Lhv49Bl28lVyzBre5cqiDBU3CGmiEF2lzlSPNgEDmEEhU5upV2Mnx5Rl/RM5rOFw0PKHGs1hZLSr+sfEllsI7pzQrG+0+CM4pYi7Pn7O84QryhBVZQNhWgg0dpmSb4WrOrOSM3s3MTgQn+UYiJfgf2Il30/Tz+pIpNRA0as2I= 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:18:57 +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:18:57 +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.15 v2 2/5] powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT Date: Fri, 10 Feb 2023 13:18:41 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-15-v2-2-6c68622745e9@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-15-v2-0-6c68622745e9@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-15-v2-0-6c68622745e9@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SA0PR13CA0018.namprd13.prod.outlook.com (2603:10b6:806:130::23) 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: 47a09f7e-52e3-4da3-caa5-08db0ba409aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cllpaNzF3a6DW6Dln68Rr+2mszEenCw7ellzEQJDC89HAPPH2lohv+OjS0W5uPOgzew0iMfL+zWQ/JV80z9r7K/1DIcMVebfuGYsvz7cVsJ5t+qX+elsNWXTmmIYZnND10nXhQMjSBOhmfLXHYdjkubzRg1iF10sfBnBD/zfyuukvrkiFkoeGThPbcubW+s3Ywt/r7hq5EZoej3KwrgOXDG2yGnHOhXdnWMrV2i54ZZdcK2xJEMGAOsiKkXSx28psGSCBgPncJDAgsbPEmfZ0xK8aek4+iqxEYJN+1XXo4lJLyXVhHR+2VFIYTitzawRVi/Td77phvK+rfI+wlithsdJF++/2UzWDrxP70bIgKfVjlWksfXbERmtdCyPGQRQGHsjhbnxlhv2GCDR9tU+N6uV9u951Y3vdrhk9TeQ2TlCxljfRy2EAjV8MM92ClH8+82LblCSaTH2wZJ2oa89/uSK6YrMkKSpgfpzPUqx8z3OdN22M3l4l7fQM25RNJREm09fcjpcjlNkoEhVSE5GlDzN8DRHpx5oOHNoYkSI1VRrXfakhQA1kQIP4eefqTobKE7fjTS/OqLY7dSS+rh1vJM/paUZNufPgYqcGfCJlax/FpzYh4UdKjusZbA/XeNwpu+uLuFfbOYqYngRtthBu8ea1uy5imF3tIHXLvAoAb8dXgtxi2U0XifpaCAmcqrOfaqG7EAh/JNtTQ7Y05PrVA== 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?UBcwvA0AvWu4nX9LQqwOgT3jM5vP?= =?utf-8?q?eWhDwD2WnDbemD5VXfEsc5tc3cBKude5Cxj/LIyHedVGQyJC2psE6IMBIXkHng+Wv?= =?utf-8?q?6mswocowKsglxX4gmzDjLvv1pouWEDgnCkKHNcx+IemnQtLFnXhZJNgGE0jws29Hw?= =?utf-8?q?waa0NnHw4tR04OoC1Nj1RK8RYwzwQc12klhBTd8wxjF6seCbWB6aDSLsJu70yr/Te?= =?utf-8?q?DrZk2AkttSxLlM/tVzeJdvQ5oaVJGgrpKQGU/cfbOZsB42CJmwG9qpaW3b/NGpC6r?= =?utf-8?q?f0Pooz1iBPH2HDiZ8T1glaLtIoY0t6Em6zU2AEANXprc30FxNZGED1DautOy73o+r?= =?utf-8?q?/T7vRVl0gDMnbWOeTnbMx1hAanSNGcx2jA8V+cXPjU7ZW10oQvmusGTqa3fmLP5+B?= =?utf-8?q?uXFhyXx5xMP/uHmQ9aQuXFqGvESkR6rVYinXo0zheCSq259ps1d+kBCFlNh6nyN1+?= =?utf-8?q?+yR3KgRyEUqGIcxYCbFE0RpuCduQIPhixoV8Rt3RJaSHOllDhrHmCMPEjAiHFsN8l?= =?utf-8?q?LvWUDBvkJNc3wgTOMOxyV8pJ8qjI3d7X4Brw/Bib12i8UchGngJ9SWU7b1teg5IaJ?= =?utf-8?q?mJZt+UOgaPBjBq7g31pSS2xUqBMIxClIaqgwjYpffIqkYCFZ5a5YeMmdrMWTTM5ci?= =?utf-8?q?M83SPlS9mR7l8yQukRq2ecNed+B2jRhGbi2c5ChlD6zqbnvFZycwbTJhq5RC/V5nH?= =?utf-8?q?R3IPaQxWHm495r7bxae4Odxp60An/JeQ9UTz18TEZc04hAtCAPXY5uqXQwlRhC5wU?= =?utf-8?q?OMlgIfELFl8nnYrjhLOlmwCI5FhdlLMMnR7aBOHb3GNME+1dqUq5uBjvONfJZwXPl?= =?utf-8?q?kgfuPltxn4cX3tVtmUeh0g9eBWZWPJqxe2xzKOyEroK3rA3huXoowVCFgiZkCyouZ?= =?utf-8?q?OlTAZJm6aIv8BjDG56ZETg8LX46Dain4dVngJkOxxTsd6+uWd+DMWU+ioEJubcMl1?= =?utf-8?q?1IqTokG6/UxUUNXtgo7pD0NlpPCmNTSGkRq01AaJkWFZ2Y0vxZxQxWY/dwgumf1nH?= =?utf-8?q?TZtagrBX3SEFEOp9HpOcjTELnUSkoODPuj9hOReQj3y8QVOa9Tvh++3TRzp3rogUt?= =?utf-8?q?aX9yU49UYA1PQNTg3tkkAQy0RLSd98oWfr+PpGiS3VgRdOQFCq4g7AGvERlIjZc5O?= =?utf-8?q?WbnV4Zmb28i/mlvg+hmbtUEPbA94TLLX27BYVZiy7Gypp2JIUeMllXzubQz5fyb0e?= =?utf-8?q?DIRYIBZbPsCk2IAoF2KpYqITy5zfKiUjBGZNTx41n9x1HZnMUVs9L/tl17wcrUwYI?= =?utf-8?q?XrAEIs8EE5WNfXo07PV9hxxIWO42b9WUzowF/j2xOwfN8lkBQlG5/eiejc7Bw8u/j?= =?utf-8?q?6vMsV96dwXB6tM5hhNzVIig5WzoBTjMdaKgCDqehtDjB6J75FP6TS6MAi7482iA8P?= =?utf-8?q?/f2A0JBKLLjs7Cx0wweogoov0NSSkxK8iusEmuQM+mMdxwoEyZrHKMIt8+hUeAzeT?= =?utf-8?q?KRQ9UwU1It2oRydOFnbYbAk9f9Yn45fmo2OTUg9t/tXc5vl+Fz7N+EYIYLy7+W1vl?= =?utf-8?q?KNrxjn5bJJYYqeNzHn+xgjbNwT9wnd8tZrgVLW+nfe6EWbiGLnAhaiw=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?JXIzDlU2Cf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-8?q?1a6lLpdkWN7Uebm4oDa2iSsHlFS6PXY1kY22eWeA9C1+Lm2hL+tjDo/S6bk/E+Tbb?= =?utf-8?q?KcpfDughKecAFwpcPQWa4p8SHkZdSKrdE1VVrmXH5OIAKGMN8MfJihHYAEXUQ1HOf?= =?utf-8?q?OCMsw2FVi0gujhxxWGe/txbDGsXFVFdjfrYEPFY79qu+tboixQlzvgNuTbdYo4T1G?= =?utf-8?q?/oeXWzE3YfVIYZxs7rWnrAs6Y0J1r/QI2UhtXPJo2rsD2Wh10rlu+KoEBs1fj0QHh?= =?utf-8?q?7zPseGTvgXYEugV2FYNgk1CkQZgqyRNlbh3rUvZWQd6xAvy/QID5M1XS+6EHAlNL5?= =?utf-8?q?dNtD+xOg=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47a09f7e-52e3-4da3-caa5-08db0ba409aa 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:18:57.0286 (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: Lt35p/PbvbGV15huKJAeJLsK5WxdYDvdVMdBnW+fF4Wf3ZUcVZArmbwob9Nvwqap5AflJXVxn3xxHfJiU+p/zA== 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: 9R6lUaCITpmDTPqmHX0Kh5jrdFIqbxpo X-Proofpoint-ORIG-GUID: 9R6lUaCITpmDTPqmHX0Kh5jrdFIqbxpo 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 1a63e37f336a..50a04347ab05 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 #define SOFT_MASK_TABLE(align) \ . = ALIGN(align); \ From patchwork Fri Feb 10 20:18:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136330 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 D0865C6FA8E for ; Fri, 10 Feb 2023 20:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233700AbjBJUUx (ORCPT ); Fri, 10 Feb 2023 15:20:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233695AbjBJUUr (ORCPT ); Fri, 10 Feb 2023 15:20:47 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75B7681CD4; Fri, 10 Feb 2023 12:20:07 -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 31AI0G4R029930; Fri, 10 Feb 2023 20:19:03 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=l5/FqJUxQ+bSBl23Eq3ijhenIiQb+5heRXvcO0/i0ow=; b=ESw/ReZ4mNPC2u9fUPFrkRSUTZV3SuDHWuhkVQebyyJtIwnQCHIqCWPOMBMCowKbwvZJ j/jaiAHL2Itxaic7cGbzSA1Uw/YHk5InszbS2NezxCqwTfPMc3/ZFkxDoblYdOVUgYKo uCxolux9zrdDh19tOXfnOpVr/OERELAXV7xkDa/LzW89QLS12iwYObJws7y3IGQsYw8G K5xSX/rd8W6apMVAySAnr4IDYRkFlmbNoTq/4IwAypwP3k4h1m1PuRSNyQUtCz9m+ZyE xvCgsa+zrYQSulvUitMxsFEercEVEKQEfFFucfV7SSoaPFBjxG+Bo2uaf6ugq2TppHHf Bw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhdy1ea13-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:03 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 31AJkndH002644; Fri, 10 Feb 2023 20:19:02 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdth9p0r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OE89CSfR71RpDWR1Hs2EtP2KSlaMyuAzkIZJIkxMjORSN7bc7Qsy1T+edKHCz+5HwqWqZnE8Djv2kdv+F1qc5sx+4BLpFG2N5h8Z1ioJXjptEYuCd56S7PA6BooYjC3/X1YPFjaTEN9m3cSyeIS6wKaax5TbJOAubXly56Jqs2w8wbx/UDMlNxVXl3v/bPDGjs4UQADF7kwmAooA2VJXrlSRYbpeZHNbDF96w5SaeGG83wcaaC/RYx+Kd3tKTB4PXYW7Iqd6UOCVsQlpr5SoTLLlbCDtLT43weqAIUB5malXDggkD4NHc2Qj1zoghfry6BfcnuljIQ5Lq0p0qkcVdA== 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=l5/FqJUxQ+bSBl23Eq3ijhenIiQb+5heRXvcO0/i0ow=; b=MdGrCo+8clQz6pxpAsMusC9FZR8VXAFe2HK3LHk4yFmjSxfxP33EhZKAubdp04TxxiRU5cm3CdKsRPGJLnMBuoqDc2TDere0X2LeSOyKEOpm5Fe4t/CtSgomw/cmjdNfGCDYddiBSqSz3SW3uPy3kAleUKKRaBUF3oCcuzAuubjHDS2Qe0a/wPmYlBpqCaImZzrT0GcCRS3gpSlUJDgrbK3o5cLMWCcLMUNT0rTP4r8rKQSk4/sQj1QpDh50tvBXe9MYIm/Gjx8qvwW785frxi93aF2MmaCEyoPYE7zKq7n/pISESt8IXtQ9fr3RLYnnNjxqJxsVRhe7M4uMkDsKrg== 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=l5/FqJUxQ+bSBl23Eq3ijhenIiQb+5heRXvcO0/i0ow=; b=YWCIMyzQUoOYrzDpReuVhUlHjhe4cWL9kwnzYfbFM8VbOdl1gRDgvhB+2zPs9IvsM5Hcckwj88nqHyTJVr8j9UWTGUINSeLW9CMRoRga+foQ6/WqIXUJ3Ff57jljMs0FTB8lCDquyUDFJzAjxvtEkLC8JzupIDFTifalQLoFKxw= 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:00 +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:00 +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.15 v2 3/5] powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds Date: Fri, 10 Feb 2023 13:18:42 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-15-v2-3-6c68622745e9@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-15-v2-0-6c68622745e9@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-15-v2-0-6c68622745e9@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SA0PR13CA0026.namprd13.prod.outlook.com (2603:10b6:806:130::31) 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: e5acecf9-a644-4ccd-d38a-08db0ba40b82 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wVE7i3PEl0eu2UTmKuoxMgb978Hb55hcouSB+DwK60NIf5Q1/z240TOjb0QpEJlBSht8q+FmR4fzDXz/FLK10y82g15QK+SHAUwFfTNFQKkndSq14MgKZhCkzJbYVRMYGS/npQxqdDvg0q6eajirJ7pIZ0ci4ANAoq5LkrnEis4fatecV8qyPH7eL7r7wjoaOu8qvrmVrCb5HXABYX/JPpXqVUUbzXhDl3Xti5rOHH4PeOrHEega8aIC/v9jXJ1RWbLFMFsmT0hyMpKOPCk6fHyMu2yL1+fTG/s2IJtzz56n25g55InV709OIBF88yXcwhsRxNcGuVCm9n4Y03UOeJJG1qxtjZLdyk9iAVomguYp9hT2+wQOmasWtUkaQI4NUFX8I8mFXx51XPAXioMt32rbvO/23PH8KwnN0QviUW/L9gKujjIkfhy/6JHgb/dJAoiuLATFE4JwMkbYbpFDDVXzShhIUel7dexU0ttUbh94xO3J3in0kMOTvzgZN6fACf0LoJc62GNgJy5MLvJBQu8TwUVZVTS6wdGnCnjL4IBmkw2pSeP5YnXuO8MnYw9AqbNWRhYT5ZfGNtcx2GTb2Vx8zs4PpR+lUrReyo0Z3U3zsrGU334SsA6V+Av1qLvT1OfT0ebPLQN3e2EgcxJeVSrI67KYsK0Jr8eTMPviRzxYsbn2MWFXpRcZa5FTdlUTZrPLJp9DwV9EUjkNY4o5Rko//LP62Aksh3r5EsT7unw= 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?AG4t6ztcZ0aajoEJmNZk/HU29zLE?= =?utf-8?q?g57LyrtF1NaVtXQB1/o5Yw5odrUJqmUv0vc6uSghezA/Itah+Y47HytLumjywiANl?= =?utf-8?q?P23p4+1Ymu/JIKT+BQbGYNValEeaH0r0HhynRvs5aahfnSjCRc2wxrkJwFx4004KN?= =?utf-8?q?XYQZ9ZQNV1ySoUKvzNE8kLJCbibNXp/zpPJ6v9V1kq7BGSqtfFnzSMutOxzQ2O8ru?= =?utf-8?q?ojQwfztyRdKkzqT/Hf6Q2qUiu2I0AyV84PZFirXcPfOH1G4moGeDIHjf8xrV2p2Lb?= =?utf-8?q?R0xzwIEs+VMd67xDQZ59MwXKW2yDcVbHrCTX+AQsJc6c4jiAx7ofLT/hxzpvY6dOP?= =?utf-8?q?wiTqzmaDx21/dJcOZs9yTUGKpKnk0ZMt9ihNThlHQ4FfYSk6dDt+zY00vIs66juKG?= =?utf-8?q?VLXXnZj9eyXMpNo6wR8TgpgwG9aVWbaKcVOmikP4+sKp2b7OdVfrK8Z5GWG5hl5Gt?= =?utf-8?q?574LVYBwYOhBSAZ938O8tyy6Pd/LoiZ+5F8qiiUW2zFhI+gXjgO9oqCeDQTmp5vI1?= =?utf-8?q?JXvyF3MxrXXRXvRAEAEqafui1P2DPj7PIV57o5GWsNP2vfZ9dCcVTsdMim9MKVlOF?= =?utf-8?q?lgNH7NYvvfGwUZQLGlFeps7V/0dnr3XwpW2sZkWOWu7UqRlS42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sqg8/VBad7u32ypF5zxd4?= =?utf-8?q?o4ueStC4WiDxiVi7OZIyOXd8Ck8xE1dbXZyz73aO3aLADYonLBpJhmA=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?/AjV8lZt+I+3Xo5g?= =?utf-8?q?svUJzqSPcha6oZXFuYfHdbuAtfOy60oGazjG2urxeDxfSv9A+SRLEju97RUGYHRAL?= =?utf-8?q?cT95oQf/LBtcCrAOId8q33je/gnnXSNr/nMojGoto11P62AgxjO83p9xZr92pRjVj?= =?utf-8?q?+wa8BeRNt0UCbC5UL3gHfwgUyipVFxjTTyD5vFa56f5cE6ydJ82XV94OKGgVGrcEu?= =?utf-8?q?V4BaQKdto8NYdpSxdHa10V7G1xuVMgRtwGU9nQkN3+/baKFQizJHuxhmP1B4M3iJB?= =?utf-8?q?IzBhXun19JhqoLO9KYNs8KZHfudcIhT/I1kLMrwfkGDB+Hr+QfN3F7F1aZCsI4Pyi?= =?utf-8?q?uxuj1U8WNJytPrzNCNIpdwmPMRG3LedD4MHoPodaJVBHgIeKz0JcJa1mPP1Tpkly3?= =?utf-8?q?0+5J/kDblZpiuOBg0WO7MEbY7bapLS53p1aKStpthHikdjOOe2P8FQgmEfsw5Z093?= =?utf-8?q?Ocm0WPMo2E+ffJHifRScXk5jR9CR1QsedZnHoK353vALZU2UcEwXTNI5pLUdsAKIZ?= =?utf-8?q?Py3f19YLHq2oFjsuex9yFfMnEEzSfvroRoawg+H4N5wlIEmcUfcrHmsTz2SeLE0Q3?= =?utf-8?q?ZCIcK4Ovp4ddEkfPEe8GpEnEkLlY1FpGTv5aoWUQMlHlqMKlR5l20xkPENURIetop?= =?utf-8?q?fbMwlAb8DMkMqBWnF2s7ruMNV6CtPEAYQX3XLQSrC4koAJTq9CqdjnNuwfy26b+Ma?= =?utf-8?q?e3O4zPJQ8hlEhFKzYBE7ir8wQyRDMgbs5KhMcoDgsZG4wzLb7h6xdKqohirNieOdk?= =?utf-8?q?Xk8c7Hq9p4uXZTj/gUjzCmldYadENnNF3xlpbxtNxh0SPU7Z98k9PB1set0kw6Ccz?= =?utf-8?q?O2Ena1Kcdr1Nbys7fshwDjL3cwic18a+iY2K3sOOhFjT6tr4tH3oRKMnVrZ0ql40O?= =?utf-8?q?oT5O9OjfbuEA02yJw1+Z2qhdJxp6mgJJ/6ODlUr2K8YWCQFmhJgqRGS9sK3gxpJyH?= =?utf-8?q?D+9v0vHWuTFwZSs8INMjmcGlDb8HPFJWWasMqoDTLqUDspLqC4TklVnb7jaJD/x2m?= =?utf-8?q?m3cQqF6t912G1CEbM0eMxwhhLWUz96UfxcCfsU1sOcWc8PfU82IWHhogEx2+mgEAF?= =?utf-8?q?TkT9jjPAAt3AIkKY1HB3YbglTHS81/PFnsqkEujrgjDz5RICODBZd7qdxcpK83K5B?= =?utf-8?q?pkdyDJN+g8eopKhB/CBqBCbO8RCv170Tiv+j1ycEpZNT1MbZ/Ns7FzEalhqd6nK6W?= =?utf-8?q?V8zw6S4A=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5acecf9-a644-4ccd-d38a-08db0ba40b82 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:00.1378 (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: pUR3X0yk46SSXLBOHemp09DgZNGdou4l7+Utevn1fZ+x4E8Ix3hqhIh2qWya3xsRn8leTHo8ovepmi0tXexXgg== 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 mlxlogscore=999 mlxscore=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302100173 X-Proofpoint-GUID: xz22lOzeqzvHtsWxInwgogCPGm08L9jb X-Proofpoint-ORIG-GUID: xz22lOzeqzvHtsWxInwgogCPGm08L9jb 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 50a04347ab05..3a3ef558244a 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -400,9 +400,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:18:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136329 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 853D8C64ED8 for ; Fri, 10 Feb 2023 20:20:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233720AbjBJUUu (ORCPT ); Fri, 10 Feb 2023 15:20:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233690AbjBJUUr (ORCPT ); Fri, 10 Feb 2023 15:20:47 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA86E81CC7; Fri, 10 Feb 2023 12:20:06 -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 31AHwlMI001695; Fri, 10 Feb 2023 20:19:06 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=cXu8P8jFOr5SfPBGxXeFFA6K9ABsuFEG4QqyuNZVVno=; b=ASKP5NiRUUbSixoNDs8SytIT8AkbqEdjUIlACTTXfi2RXNG68LFgkr30tF3BXDTA8id3 iOJmm/cOmyb/E/l7oVJKlE1sARsXLP3SnXVV2Z9JmcvQ9BA116Xq4sU6l+3CQqOmFh43 sBb8RwzXH6YRz56H7zgiMhDU/GNLMxFDxZoCGz75TCWX6iG5m9NEAakC3HODWLom+x50 SLuICeMAnJWO+g1JyX3THBbz1w6OeC9582CgxCssY8bvleJF0Ehdr232haj3+JuxwIEu j/odbwJCBEAS21Nbe8Yuc01a1GP3QmT6Ib5NsAAXoHFXoD9NTnzxE+80HK/qD/kP7gOk Kw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhfdcp8xj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:06 +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 31AJXlHM036113; Fri, 10 Feb 2023 20:19:06 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2102.outbound.protection.outlook.com [104.47.70.102]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdth2bfn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HTsrX46bn3HT4yTtJVxkxHkpze/7P4JDUuLdGX5DlLirAVDnBvR0POIXo5FvdqmsdNNeQfrWi4JGna/eD2L4eewo/Iw3fEqMZjxqn9EXeYXVYXdFoP8qJw3Y8omHTfJjfsij1aaI2Nt9BVFgbHxvPnVyMPmRe7aTtbBKfb2fXHCiZnHiCf6fsBAy/5EnqE9UT20PF9tFo4DEWGp68foXnL4PwCVu51G9wk6E7LkcEXBug9yTJA4plMIurzr9UsfYuAQbhAwtM9xURuZ4B1HhcegMeKPAPWqu5goZ5VJfFeQHdZG/eFtEZ9Z2JXVEX/RIn82zceTOey0ITIzcWPjv9g== 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=cXu8P8jFOr5SfPBGxXeFFA6K9ABsuFEG4QqyuNZVVno=; b=Z9zjwH8TSHASo1h7nSE04IE6YInCft7RrhGFq/mO2cZYQhNC4r1b5OyzXRYw5hdXmUAJ+GoLcvtHwsbrixtZb3kT0nUAyfy8zIGsYUarqhzQWcpSkitgDvxBc6vzYljp80SphwJ37wdIB/vNTxoithAfM+Zb1Tle213x1X5nfn/tdYRUkGq+rwSsYcHHnaXtb+s+sm7+ydpgbvHrud24A4mMyI8MqqDoZNlVw1i8c8FrwkCn43zmMfA7rdxLDuFbpl+91Cu43WUqdbo+/LQRH3tCkeiwhgQ5nB4BC2bMkf+lPqj9LE+V2LrSz1RI8gkTUddzIKgXvltkIudhwyJOKw== 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=cXu8P8jFOr5SfPBGxXeFFA6K9ABsuFEG4QqyuNZVVno=; b=RAqTW+VojSpuhOutFRlpbq6N+FTaWh2qlexnyiltKdnrYRWNiDe0Fv8GfAxCitf2WmJ3+VFunEztGXie+e1XHknsobCwfaEbseu1cWxPKGtj2pghgJ3GnqIQPLa76jand1B73ZphRpr2XWwx1DU4+m7QODLtzXJ5RtF/Y5FjNLA= 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:03 +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:03 +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.15 v2 4/5] s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36 Date: Fri, 10 Feb 2023 13:18:43 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-15-v2-4-6c68622745e9@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-15-v2-0-6c68622745e9@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-15-v2-0-6c68622745e9@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SJ0PR03CA0020.namprd03.prod.outlook.com (2603:10b6:a03:33a::25) 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: 3e57d538-29b7-4891-c7f8-08db0ba40d66 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UBkuRLuUNKagC90vb+oMsqjSzsILdcNZfqX3PRRxqi4IYwqShf9SktI90DA4uap7SgHavFnUNgio73Zw6sSHqJbiMSDfMthNUOqNa5qxI5l7xSo1IGYaxtq3ak+KrTa+F9W5t2KT0vHP9l/wKId9axAZ9BHS1oivy/SXL6FqsY18YddULAmZ5uE6RBukEzs6WqVnZ3i0dexwOkjRRk2maabqV8Lx88jaySeuyymDWnAWXJZsl0IX4n3luCh8oAFpTzbK19WHcjf3ZEeOwxxYjQYrrNIFhIVi6pmqH/2DYPVW/i1QgSthUpk9J31+31NQu0wxeq4F7epH5lngXXW67Ygi2RH3cZJmYuq3eonjZPJY7HBmj5UJ4/Z/XZGwXJh9BcfyEsFuzvVntKTkFC0AH3JWaIAajq+K/YaWEt+FDJwDeQdhduj7Wkn5jH5OpJ9SLMWtQhAJoFnKFmEIaiVhKjxKLWqLc8iarif+bfmJuKApOENgewNgBlRrjupybdo6At+u4nZ4VjDg5W8hEQImKzVFA7qeJyYEzMJ+UmoRXPPsVuiIijI25Y4Rw3MGT/TR2f8uc7iVfwOCiQRDq8+vQ9NlYzZ+m8hGjjgxZR+azEjOMq3t51N+neld+qC4S2Ae+9HnLZca3ommCjKSLWFwF3BTgkl+xted8D8AscuMLavP1R85p5zPJHX4vtDz1kbOdwEWjS6+BHn42JlBlT2m3Q== 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?+GXIM8Cw2X1tlEI3EbPEL8XB9LIN?= =?utf-8?q?23ec4TVXVqpUOywXuFPdvGijhACUfgTmMclEY2ywVkLiXF7gCIDw9LtOMvZfTYNlh?= =?utf-8?q?eliTHX1oja1LQcy/c04JhLkkmAZuF5xMDrCDatZuv1wHaIJ6ASodEVg8RCuW3nqDV?= =?utf-8?q?tu/568KK/2PykMDLUZEPOBGOOUeXviFipG354CnNWh0WdA8yUkOUqCVxiTdOKxybm?= =?utf-8?q?k5OpNhkHYiBl9LTXwJNzZNf09vOxCgvbLQxikaR8FfamMtOwlbLRyPmUtWUv3kZk8?= =?utf-8?q?bPtu6Q/4Z8D68WR1uCcYTxv5wy9no5AE2eVhnMOj7kj7gLkA0ys6G50mNlLtVZroX?= =?utf-8?q?jVqhyGA1OLY8FPl1Ch9oatznjFplV+Imqpb0N63N7HAcUYK8GMSqJlP75EIJBEk/S?= =?utf-8?q?IW3fMf7BLVP+K4V/mjJQpJrctkvGgspGeV4gx3xsaL7PkcjRuUoyLGB9LdtQOw+dv?= =?utf-8?q?jb5b4dl7VF0F2xxwozCWEu+4nrnBvH5O1Rh6E58dLhtCSronEEddZbZnZ5Knb51aR?= =?utf-8?q?PEt/GG76ltc3JCQUQSPbUbXdUYCWRZjdgJjin91ZaVFaekyuN+7dONk620UZ6ztSA?= =?utf-8?q?nq+oeOtGXAT/ShXg+skuCf6Uajn6WUMtCX8MqyHt3ZwqAkF6QUkp+kNuQrpRxs0MR?= =?utf-8?q?dMSj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?nKLipBzstLLxBO7WTElK1mCt76sxnLosof5w9U4p2snv9hyPxqr0vPo=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?OkkmGJwXGlRp23wD?= =?utf-8?q?UioxUTGmFLT5eKfwJNe9aE/pFmTcrrP31HIy4yMsS+Oj9fobgRzjQ+mtEIFWNwFsM?= =?utf-8?q?/wLKhQ0HGxdQQIX1CUxbUAQFmwzrAWey/HiKSrIku1ju3IoExJleScMDn2E7dFjq2?= =?utf-8?q?s+stqVEX3U+amjjerL3UkGyOXRatJnk5lkZIudOZpCZZEZM6SnJUCYihkMM3CN+oX?= =?utf-8?q?5oVwlOMJG9AhQYoyNWGPMgajiaXDuRE5fFB/vQgAV1GLoHpa3xRZmjxA19kgqbODx?= =?utf-8?q?boZnYXX3Vjis9wccEvjtJciuZwid2pBLTbRBZvDNDHB4C71sTKxyxx5FBPNXqmZ8L?= =?utf-8?q?+YAan0UWvoLaLCIjDJcBXO3E4FSWDYXIpEubQJXV0IdKvstjcVE+keJv52+f4RzzM?= =?utf-8?q?Dk1ZTYzBo2jREkokL1D9Fe/O3ihO5qIqccbfUNLjqosaKdc3bqU4pBiHkWQjyLA2W?= =?utf-8?q?smQskcXLc3dgPQAnEwVRI1FM5yt9k2KJagle6dMLZfxgMWo/RJggIPNf0lvvaTXMJ?= =?utf-8?q?HjMbMHOWEPTqAuWuZysSdEEJhXPlMiGid/vscCPN4/nmxIW94QtFh3gpnOpLGSrpb?= =?utf-8?q?IGLPzhZ4csQte72NfhejjZbau/p6Q/oLxMlG5/U/EuhBWyf27l8AV37/Fs3PTp9cD?= =?utf-8?q?am95AYV10G+eBq+YIh8QmGnJG/otWoeRuG4oDGLjrYl++WGpG/D6mzRI3DJMcOzlh?= =?utf-8?q?mL7lgF3r0UfkT9LVaLZH26z3P9YmHMCnqj68KrthzaFrxzKy0HMF7fAHFzbFIbJv3?= =?utf-8?q?itbm1haUCjMlGrNbOepK/ElnqML+nsmW07fNCbo0zLzt1bbieShVsa8XX/ItyFtdo?= =?utf-8?q?vfqAsIDKw91JLAler8fObvbA41NgD3h3g7caPUd2S6sp6cvQ/UGd2B7M2WLDzxkMr?= =?utf-8?q?+ksecr48+bgnaFggeyKS/QrcrxTw+wI6sF9z6IlFEbX6WZNWhzreH3N8lz1vR14S0?= =?utf-8?q?vqMPY61Vo0W2HU6GaNRDucyfQOiiEXoQl0MOTShk+GCGzIidrQ1uELptQq/6w3fAQ?= =?utf-8?q?DzEkSrSLD/vm78m9LHl6GFXT1vabWG70FqS3e7cM7pbPPWueHCauuHZ7wRAzaBJEm?= =?utf-8?q?n/O/sorqnCoxLkEZYkukCPTN1ljJVJQFW70vggE4lt0TFrl7ASBiIPh+TtE3onO3n?= =?utf-8?q?N+LDpG3gCW4n56PiFSsiRONYbm0cqURF66bDe1n7/HgKlvq9gNZQ=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e57d538-29b7-4891-c7f8-08db0ba40d66 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:03.3563 (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: YsiX8whf0dW9Sg2rrigKGKAHms0/Gw7CwusbS0CJeCh6qiA+8VMUNNHWQ38HIwUW6kqdJIKYRD+BnL0DhM1DoQ== 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: bEow438rYqIWrn5vyHohVDiNcm9q_omq X-Proofpoint-ORIG-GUID: bEow438rYqIWrn5vyHohVDiNcm9q_omq 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 8ce1615c1046..cdc8b84b2db4 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -17,6 +17,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:18:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Saeger X-Patchwork-Id: 13136332 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 CDDCEC636D7 for ; Fri, 10 Feb 2023 20:20:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233742AbjBJUU7 (ORCPT ); Fri, 10 Feb 2023 15:20:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233715AbjBJUUt (ORCPT ); Fri, 10 Feb 2023 15:20:49 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FC722BF38; Fri, 10 Feb 2023 12:20:17 -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 31AI0AqL020851; Fri, 10 Feb 2023 20:19:13 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=j+EPwyDwFbCEHnTTzD4tfzdpW0eshAUOG2DKtoPm+exkNaohC0BKHLPNdafq/hrD9UxK 5jltnddrBV26MmcWOO8wCQLzKbQOaoKxvL3Qn++gwCQmEcW4kfsQlz/g86WQpavx5mYB a74a+HUiHZfxqrOgS4Cuhs5vFl7r9gDdbSIDe7bGgIrKy8CgqheIOaJxkq7vxicHjfyu 8xs8SoCyssAdXCIp0vgRK2S3rBcMbYTudKSIiSNNefnt7Blin3xzjMROw9JcnakSxw5V cf6gDraO48icJa2l2NmI7SSjoAngS7illn1gGROyNpGFULrATtu+TlA8NVThD03t5kOP rw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3nhfwue4e6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:13 +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 31AJsANb013725; Fri, 10 Feb 2023 20:19:09 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2049.outbound.protection.outlook.com [104.47.74.49]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3nhdtaqk2w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Feb 2023 20:19:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Eoc56hDFXn0wPTvPa3GqCg1/Y/fi15KcnVFt6mLN985us/dUfjiM9ri2UFCf+x9/oVp8QYa33gqHhYZzYeOhDcjblFbCZZdGOLOUTm8hKq5YDjkAOLOvK0BOIWJncWEjmmMxOTBslrfBoT1+wYvn2obaaGxNaUq2H4OiXwpXtyKRAU39rbmD/vjF+ktR95zf7eeOImj+Ur5jI0cKNYQu3XWvJoMy5yqQI9AGd3fygOiE1Yt58nnpnMPuWI5dMdGvbQju67ttIT1ug+9/GD/xqza0lxEyZY3i42TB7bCakE6YCGwu/FzUaCM4oh/CMjUAF58OZG6db+eEs298CLO20A== 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=gdfnwbBEo10d/vgyytCGLftvnRSAp+y/4t3Mbvaum7ROVx90wvobO80WNSlGgzNW8wdnEXJOKq0EUjPoYvpW+nrNvN19p6gXdlhis5kAVlxGubmNsM6PhUjcmAZXM7JLhTqg+ifMZQgE5AqVRQtPgpn/gQIGfggbCNLTZ5F+JypeQTyg2lyhouOgxOWj06zRSPjvwUdRGYfBc6iKEUkqolYqRcxoO3cEX466kYUt97bPI4YneGmceHd6QbqfU1b44vQGbpm3oANFiI8pVBu6uVpCE7zrqAJpt52HD/dC6mv0NVuXG1YQhcCjx9W9uDu46NIdFFWB7ImU9zIwImmeHg== 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=oudFEp2fnTklcLyyeB4vXZDLHcKnxVb+Y5r30CHYd3tOSLvc18hC1wy7h3z225ne7fhsuxeUvgh34WfBOC66Iex5GjD246Sv0icJyAnjE4NOqmP5XdkMPqVqAKdE2BuDScqn+O1ZCj3XWChHM79QPbU362ucSx5oVrLZc9Wo2Vk= 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:06 +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:06 +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.15 v2 5/5] sh: define RUNTIME_DISCARD_EXIT Date: Fri, 10 Feb 2023 13:18:44 -0700 Message-Id: <20230210-tsaeger-upstream-linux-stable-5-15-v2-5-6c68622745e9@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-15-v2-0-6c68622745e9@oracle.com> References: <20230210-tsaeger-upstream-linux-stable-5-15-v2-0-6c68622745e9@oracle.com> X-Mailer: b4 0.12.1 X-ClientProxiedBy: SJ0PR13CA0012.namprd13.prod.outlook.com (2603:10b6:a03:2c0::17) 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: 7c3ab880-33f2-45eb-9387-08db0ba40f62 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mprV4hZ3EKSZ45lI1S5iJJGECoTd53KotsWaIlbR5SnxKiozy03RIR8Sm4VSnEdrlhp8sOSsDCMEf8TSRn+ywhACM93CDFiC3l+RufUc0+g7q117ep7xlcbu+ITUk7Jd/BoH0Ydszs/dnIheWZqNOXtjIXa5ygnNV9J5AOb8BALablvypx4iUw9dHkmbXseUu7dh2TY61Ju+lrUa3loPsPWt80M4cGJNNENTIdCdk5o27XPDNYunwTI7rcuHqXKbSAlVe2PEOxAPSuNOeKDj+yZLIsc1ZOBilYtLNfwLEpfA10wOPheedW7tg9mo/6k8ZvDumrUSG6Iyiy6rAG5TonhpmY5Qb26OxryIfk3R8e/Sjf794M4q0wEEFNosb8gCyQNtfzIBvFe2Kl15yVEP8EjSzdbkEA18FG7KQ4W/4RYpzk7FRMcywpgb1yJu80yoQ4E2hrdyipE8CqgGCXf4dPzlKpNgRfEV29ou8hFYwk1t2G6eGl7V6sYMANYAdLnpeZcScBGPGAO+uVakaG3sFkHyZR55mIUzYIwmy45whz69mkyDWv6AV0ZNWk4FkINKJqwNCSR8HRPF71n8y1CmCmObZSOkaXNSXMFDXkIMifVwvljwYYFFr+UYi45iGcmJZ12Ld9hR1qHtU7542O59r+dWra2M1NgENvBhlArfdb/NZ1em5BlcqfnkrQkmltOy86PxQ2KLa9BmDshr11KBzA== 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?2em11uD9gfXXAddq2RPN5HaqMTxB?= =?utf-8?q?U22HrwQkRNeuKmnLwlovaMtPNRH0j8vCYMpVTS2vNKl0kwbuIeJtpqPRaKgpT1+L7?= =?utf-8?q?7XIpaomrJ5m5OlkCMiKYz7EyK2vFIRPr5H7VNMx1kX/QfoTf3F796hBGxwERBjF2F?= =?utf-8?q?TrQ9bQSLmlglPAW7FlL06yZx9++CeW/jT/0MVbCVybmf/txvsMW8q4AhYrr9OIBA8?= =?utf-8?q?nx6Kmeo0xEUpqd8loWFxP2HbjJitrP3MRlR7nFYwJgI2RpEwDliJqXYqie4GRQRWR?= =?utf-8?q?CGDRplSUrIEopMqySlt4189yyuVZId8uV+ehx+MH0lRwgnY/t30VgXu8yuaPTqEPu?= =?utf-8?q?aNghlMMjavuSH2A+ZuWV+PTNd4mEcBjNxKWlf28AW81uZBj7tUhuSHu50DhproQjS?= =?utf-8?q?9euUveJwi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S4MmjBFwdfgzM6/Y70Pfg8tyNIbf35GTjDG9hCraHwOw043ONBC3iJxPQ/6vk5FBY?= =?utf-8?q?Y+iK5rAK9yYs4GQycbF5/auvb1niAyhKwekgBasUd6lXqAyZAjx9QMEFZ9d/ou5xt?= =?utf-8?q?Nnpgem6FOZkRACmMIWTdNpbQWktjBHSWVgxGAHJZUxZsMYPFwrWSru1xoBDBvuNgJ?= =?utf-8?q?F3hwV2QQMK/szebqDpWEgK1W8Yw8xNB6Q9mryh2Y1qPSFSkms9UuCMD2ulfhL0D8L?= =?utf-8?q?2btxKfySmhmcxUe9eafZJ/k+K7/xhcokjcBMQptM3555YWwS5f7ZZMpjzR7I43iFI?= =?utf-8?q?/o74im0HDbXwGrnA6V8ZsPBqgL6npbB36wo09dcGY7+y8l5b3BFlpPZxELizOHMvq?= =?utf-8?q?pp1qM/OakvveQRyxk6hYpT+toOCy59I1K7ddL3ct4L92KbGOBiwELupwIv9ztcN0m?= =?utf-8?q?+FgOLaqehrCEub7QIrSZu/sGVh9GQ/P36yXoaWYSTvuWIyZdOxDboVJ+8BL+rB3z9?= =?utf-8?q?Gn7241zhCp1fTEJvUYcYv20ksRKOyZlP+gG9qlhDSnMwmxmUP8KB5CTGCqvlFUu1a?= =?utf-8?q?DKaXzRLmJN9InWUgc73mMjnQYwkE225bM3BgcCIoe23oqhrSBbTlLg603VVjF8BG5?= =?utf-8?q?AhAvCS40nkp+6aWOkXDFy/j9kEW1A6rgzH5DTsAygOEZmOtRBbt1snTjcRyomsf7q?= =?utf-8?q?w46OYiyKyOGDqb5LJFG7Qjml99tZg?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c3ab880-33f2-45eb-9387-08db0ba40f62 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:06.6842 (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: sR3JTlOySi8z74aZWmFC2whkLD6KaJCxwAJF2XxoPxWJlv0achEAkeOVMErSlyiDPEZQF/bjOK/C1rxadi4cmg== 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: saPtajO_tYHyOXPH73vMTbD_rROWHMd8 X-Proofpoint-ORIG-GUID: saPtajO_tYHyOXPH73vMTbD_rROWHMd8 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