From patchwork Fri Jun 14 17:14:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kris Van Hees X-Patchwork-Id: 13698974 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 553A217FADB; Fri, 14 Jun 2024 17:15:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718385359; cv=fail; b=gAkN1AAqPOiun6n6SXsPDa9l1IzNaQPETkKj4AXO9b3cSC3wj2Za4ph1SALfMHt+ReyEMelpjQHqNE+dfD4s7RIvlFRh0dp7JBztEt67vhaeySQopohiH1ByXkVihO6rwhvhnjfHlRZXWJLp6RZJ6gTR//Ivc8C2z6RiaogelOU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718385359; c=relaxed/simple; bh=WdU5V2L8uT4AR3B+A5cI5ajW/H+Qgp0BPRjuA6k8tQ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=JgruWvNw3EngCvDT96qiyCmVy0y/UUMk8LbRNjRQCcnszKB69gS3afX3EvOhJxs62l/oKyM7RTiyLQL726zwfZ6I3nptG78yAHzd5+uHWqQHoIRH3ApAYTuNuAtUtYOrbWBydEWMujwqVcs28mnSl23sWebKffJIqe/ELMxapEk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=jqAFZUOy; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=v2QoLbq8; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="jqAFZUOy"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="v2QoLbq8" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45EDH0Kl028777; Fri, 14 Jun 2024 17:15:51 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-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=CTK5uummU8kivbhjOTVtyBG7+Z2HdxyHAAOMyo5Qb68=; b= jqAFZUOybJzQVarXDDPJt0V0Vr11DuwSwX2H7rdlQCLPtA/M7bL/rvScpe+lGDt5 Grxuu+oCJ0ouj/mqAZB6ETObcrxNxyQaXdV6/L9a0//zutt5r04AE/fzwMnL7V+B q09KYbgL0NT55eLl5yvhFWRaAhRTeC6IhnaG5o2v89/SSsb29cFRGvvLKKqC0PII 6b3/gAUhQvcsIg7Scr6SInHxmoBZsTF95bM1J68wxih737kjvnHCdyPmkVM+Vpsb kMQ4DSdMLiHwapj6fK23c14D5NzV5zJ9J11PaxBHbQMQaGnvEUlCIWwZOK7o6wP2 /0bRXVpHqFYq+CGoB6iMwA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ymh3pc2by-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2024 17:15:51 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 45EGd8sO036740; Fri, 14 Jun 2024 17:15:50 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2174.outbound.protection.outlook.com [104.47.58.174]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ynce1ync4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2024 17:15:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ft19erXQrn5DLZ88v7owWjA0B1QGGqRbx3jKpu2RWDoGydStNGiG1l0TRv8mBmDh4Px2tSHqnm8UoOqcjVztczSicIoufYbXHPzKywGHuNwU6TaeUKqE7G33UyWopkSKBWPvs40n58/O0HdD0mS9IpFRlYeBJ7sFBDxLFUAF5zn8EcPl3gbmDHdd4q1CDUOmWb5XFStkDGmy0i8iiG8j2jb3XPlM84giQzrH35V/7TF7Yprt1wT9xh790ZARQNspFG0Va5rY05TNNayPYZ58QRd07R0hKu22TQmz6d7M59M27m0AFsnVF3vVb4l2SP+peeiI0I/SjM3Afy7HaVp16A== 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=CTK5uummU8kivbhjOTVtyBG7+Z2HdxyHAAOMyo5Qb68=; b=G1ULGFOcsWrtHr1z3Z6BjdNHl4Z3hFmuJqXa9xqL8O070KiDg6FrZV4fC4rF/GqkdP5BxYwi8AbveP70H792hTMIxDb9t8o2lEOMV92NrwfMkn7Di2CgrHeSQpA5iGB7eMe9pz19W7sx7vClK19/jUelcHAmzhdEiOvenQeFTvUxYMD80HxbVOwfVB6ZkCzfrDPkjgH4sffcNWnBGAZE53V/mVN8he/tW3MfFB6HIoSiJVX5Nfv/UX9592cp+0yDORfqocVY/h61C+ahhRMrglr4hb2e5q04jsGKThYaNQJjvdwYuhzcBxnRMu/n/J9bWpMWbuXQyPsraqF4sQzEuA== 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=CTK5uummU8kivbhjOTVtyBG7+Z2HdxyHAAOMyo5Qb68=; b=v2QoLbq8Wbt3IS73isGmJMLS4hGESiTYjoOmrhzbY2yAk8k7VxKuRaj1V72UTN8/kTDSVeKIM/d6K66lhwD/upMi39nD1DJS0CGRJjNLSUgtSzcmkrFL8yzawOpdrkFM3WDOf2hr0fJxsy5r3LVnf+/XManQiX+TNhogPpcHa4A= Received: from SN7PR10MB6287.namprd10.prod.outlook.com (2603:10b6:806:26d::14) by LV8PR10MB7847.namprd10.prod.outlook.com (2603:10b6:408:1ec::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24; Fri, 14 Jun 2024 17:15:48 +0000 Received: from SN7PR10MB6287.namprd10.prod.outlook.com ([fe80::5a47:2d75:eef9:1d29]) by SN7PR10MB6287.namprd10.prod.outlook.com ([fe80::5a47:2d75:eef9:1d29%6]) with mapi id 15.20.7677.024; Fri, 14 Jun 2024 17:15:48 +0000 From: Kris Van Hees To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Kris Van Hees , Masahiro Yamada , Steven Rostedt , Luis Chamberlain , Masami Hiramatsu , Nick Desaulniers , Jiri Olsa , Elena Zannoni Subject: [PATCH v4 1/3] kbuild: add mod(name,file)_flags to assembler flags for module objects Date: Fri, 14 Jun 2024 13:14:26 -0400 Message-ID: <20240614171428.968174-2-kris.van.hees@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240614171428.968174-1-kris.van.hees@oracle.com> References: <20240614171428.968174-1-kris.van.hees@oracle.com> X-ClientProxiedBy: MN2PR01CA0012.prod.exchangelabs.com (2603:10b6:208:10c::25) To SN7PR10MB6287.namprd10.prod.outlook.com (2603:10b6:806:26d::14) Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR10MB6287:EE_|LV8PR10MB7847:EE_ X-MS-Office365-Filtering-Correlation-Id: fdd8017a-f7f8-428a-ff09-08dc8c95a246 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|366013|7416011|376011; X-Microsoft-Antispam-Message-Info: iRsG2jmALG8HhKtVZYPtHyK9PucXblaT/UY9uMFw9h7EgybaqPKzhL7OhHgaxsbSnflPzPzD0flBqRYUFZzpScjUQk8ztnCAOQmL15pcTKdvNGFfc3YMqdLjYF3Bqv/afFOk/nmeY/7ehDUUjEsD4QZsHVsIEItmnTNPqqAuPz0i0GE+bB/2rHHXGImQ0tH05uyQAjRGFYKtuO3iDTYOPMOyYgqcN4ir7HYsuRMa2xzGtwYHnDvdwb/Iz9dl6QLX3+v73laH6Jt8o4qAmq98KNfO9xdCzQ6EFWXRpp5BJMpnb0FJ84pIpNaoJh73jwmNfO39UDIy7iuNl0c3+tgBpgbHRoiE2zSXBvyOGNshjz9LUjnZwyIQtyRL/x0siATxz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S:(13230037)(1800799021)(366013)(7416011)(376011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Zk0x1s7kHtmwRHaiQypLGkGSqGDpIu//qr8Cqqhkgvd7DTPcv3UAmxZiKgRYOpfrtQXLH0/i0cHVmdfnFJsCYtozWlqTPMu5ELgZ2VdrHMK+v/SviDsA/duYDiehJKD3pbAraRYiYtVDTBmYxdAFTJ/JdSWxRl4BVMSx3N31nUyND1UzBIeuQEGMtaAuZJmKZTKhEpsy44H/Y5MimdXWIhR8g3lKa7o4AMrqg5znDaVj/UZiIFKZJlzprYi+mMcy9Fe0S/2goVVI/k11+TOkc9ccJ9xGLbqSABz+zji9G66W4OPyy8iGBnkOZB/sNjtxDK/QuYqBLGchs6fJe7Nau/D2m9o21rL/tSOlu3EqgkUEFBx03setD9xJN1j0hMCrG78qHmgsdVqfAux5kBC4RXfV4QblJ3S89DX6lIvjQXZ02ZQIN2T+eS8H6BmJm8zAP5eHks+1OPKT6pV0PJGq0hASo1Fj1HEF7rvmCML1q1/RfmoU94bZ8eZoBcA+7dF1yvlGQKGPorFmYAZ3P1BQT1YHJGbJuMKVvpiPS/cRX94m2azqqjuUafbi+aDoMpR19698GVa2h1MJ7EaROmmjfvASQyrvtzdPXRmFMYmgVtAk/lCNv/eNIeSHGC8e82s3wZYHTuJzQRkI4enNitf3Vp1mW6INYoPor7aXu5hGaP564Pcpnn/q5F1uNB+QFM5UeqUka2zdgw96Q6y6U1FKD2B6rbOPukQEVoH12BWVLHoHulEZAWgDw7mZ8a0i/eZdHyrRKXB/vFK9tq6IMtyFMglr5tbVzu6UxEwxHizjGovAnDbZMKscvNcXALW5C6uowEz6IQYG3Js9U6CY7P+dRox3HTub5/bYPKEAMr9rG0NqaMO/eoJ2tezJ00cas6bSmM2umOYvPlbXD1BW0NBWQ6gd+g8aacb7pp2Bww+JToF83lFF8hpSDljRDis93YbYt054ZpqDJ7nEb60zda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2X+vCK6rB3RuMX3FsDfGpX8wB58Nw9m4p3TTJHQ/m4tTGS2N+UdzgA6u3O2stt9xG37tUzTpyBWOS0xsY56r/LeniGNB95ugrAROiAVMMmiZXTqLfqUJ80hhEbUjgKY19LUOHgmyJJW9/pAPSWL0O9p92+r/STKxKVK1UoIdf1VTmEZJK0J/gn6RWwg/sPy9Dz3VQOWzmlqdBQ8tnSfNewvofCsMj9FwxbcRZRnzZVW06zW8EFtoDVQ0ohV2eUk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fdd8017a-f7f8-428a-ff09-08dc8c95a246 X-MS-Exchange-CrossTenant-AuthSource: SN7PR10MB6287.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2024 17:15:48.1172 (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: pfT/+l3mRre/FeoCiGFD0nvxpDW5XiLRsrxJGbaIlgq5jlqp3gVbVHLFmyxW0PE+yQ7CB9Z81h1LmtO8+HYSiu+N1CzgoNjOSyK/C4GTNGk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR10MB7847 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-14_15,2024-06-14_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 adultscore=0 mlxscore=0 bulkscore=0 malwarescore=0 mlxlogscore=805 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406140118 X-Proofpoint-GUID: ztja67lz8PJYxdMRto5ozWDpnBDwy7D- X-Proofpoint-ORIG-GUID: ztja67lz8PJYxdMRto5ozWDpnBDwy7D- Module objects compiled from C source can be identified by the presence of -DKBUILD_MODFILE and -DKBUILD_MODNAME on their compile command lines. However, module objects from assembler source do not have this defines. Add $(modfile_flags) to modkern_aflags (similar to modkern_cflahs), and add $(modname_flags) to a_flags (similar to c_flags). Signed-off-by: Kris Van Hees --- scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 3179747cbd2c..a2524ffd046f 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -234,7 +234,7 @@ modkern_rustflags = \ modkern_aflags = $(if $(part-of-module), \ $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE), \ - $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL)) + $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL) $(modfile_flags)) c_flags = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ -include $(srctree)/include/linux/compiler_types.h \ @@ -244,7 +244,7 @@ c_flags = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ rust_flags = $(_rust_flags) $(modkern_rustflags) @$(objtree)/include/generated/rustc_cfg a_flags = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ - $(_a_flags) $(modkern_aflags) + $(_a_flags) $(modkern_aflags) $(modname_flags) cpp_flags = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ $(_cpp_flags) From patchwork Fri Jun 14 17:14:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kris Van Hees X-Patchwork-Id: 13698986 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A26C0383; Fri, 14 Jun 2024 17:16:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718385402; cv=fail; b=M/3K6c87QLjeYhne6PRQDeL1FUzojZksI4lhzQtE5JuSyfz6yoTSLYTLsfScusqUtla0U9oVCS82VlExOW9QOy3xdioBazcfnsfwQC+B+EHTNsXwdwFQ3IKhX0yvGDgQornTlAOR1y3Sktv4KUtAG8HDb6XKP7ws2W1hRM95664= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718385402; c=relaxed/simple; bh=Utgr38imGpwpT9ufQTMg6tfqVcyUskQiq9UbSAVLI48=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=JdfUWsip6sVlG44FpgKFtJ6lCMUKk46ZJtzjhVIe7BWxgF65clEW9VzPP0v/uShQBFpLrIu1HXgQSK7TWjsIProYxbrsWix1FSemWuTeUbxWaTcOWMn/Ej5Fydto8XVhUTSlgEt1ecOBIZzGDdD48eMH2UEDYiR32k/Pv+9+OvE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=LRqACV3m; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=MKRXKoUV; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="LRqACV3m"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="MKRXKoUV" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45EDH0k4026816; Fri, 14 Jun 2024 17:16:30 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-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=vqOAfKb3q5jjYNFvje6um5TzGHxrkJM1lWMDV3Tiz/k=; b= LRqACV3mqhhBBrlt9OOMippiWBGBhtNpJsrgK+VsPo/ahITs9oBaQ7HMdGS0njCD diKNJyI1PTgEERmXMU/T/RbQGQ5sWCZsNZAN6VMdG60ttgaaszk/TsrksA8HZQgz qFa2kxJl/BSojw+L10lHi9oYKIoFVsUPSDFroMGtSt2+Hv5wCdiufKdraP+q+IW2 UIB3I/O58tG2jdNiaOhVA5XAktY9WJO/KzacYeQ5y1jNMNVNq3DcMIYOXVOp86ny mRMvv2f1fkqQiCx5VxId5d358xTGViKjoh+y/UvHEQJidTeoRqv4WmyBoXpxP3JP TyGj+4kvZfCcep9tGGqIkw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ymhajc6u5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2024 17:16:30 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 45EGarMr012576; Fri, 14 Jun 2024 17:16:29 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2041.outbound.protection.outlook.com [104.47.56.41]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ynca2ssvw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2024 17:16:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LOma2PgWLUTxzHwy2gsorf4pv6wpoJwHu3zhWveqHx+qoSENg4x3PH90pbsIZJOL99pNhQPlxvxUy3wruKAnq0n2RQmwUkS2ukNO4vzXoOeRwFe4bA/PYLhCeOAqDQPJMvqUryGyWfAcMpK5lSgW9ZRWRfZ0T/ymuT2QwKyrtOF6dwmukO4myB4pK4SYoS+NBkvBpGKzpk9hWvW4s0oRxExtyjQmZuJfYFC/FCtS7VxZJCehBhi2ubHIqjBPNfpRipKB6SvlAFn9EWwI457DMZ+6H6HPYzx9QbfW0rh150CkwS+688y5wT1LHqgHSAutENU8anOV4hOXuEupasSJ6Q== 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=vqOAfKb3q5jjYNFvje6um5TzGHxrkJM1lWMDV3Tiz/k=; b=SpPl6uy/umpXljQvoq/uaS/3K82QOBAZt+hkd5vXkVtWvGDIn8wdzRheN0TFJGbCjrIn1/miFhkPNFt0tgiZckjviIv18QUXckvRLhUxfeM/Lz94kfSLc8jorYqucBX0qeI5oMLbka5M+cOycBtI4OKmWDwDqOpBn5gxhriH+Q1uKmd9eBgQRQPEgZDO9jkNvUgL4kOxOArZDuYnTwAVSwvH7BcMfpfSOlkpfBLT73n4+0cnNwjcgy2vRwSk+9+xjgT1TTipsLim7Wx98bGrwtBO1mkU5zN8Thb4w7rw3TUrLl2X1YlNU50/e6rcZ1DlqXBsFAy3Tecuu0sivzbDew== 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=vqOAfKb3q5jjYNFvje6um5TzGHxrkJM1lWMDV3Tiz/k=; b=MKRXKoUV9IA+bnZS2INKym1R0N10r/E+ymWQ2E+IOj64UeZ7xw7QISFe/uVIjm+51WjIKA3uKwJqUKtgSQm3h36LrW564QfH5QUIFVGhfdZX+EN0W4e3nC3+G3cWjEwD/MlB1/hrNnuwb9NjASXwDOFf5dPdYc/H4GPKL55mciQ= Received: from SN7PR10MB6287.namprd10.prod.outlook.com (2603:10b6:806:26d::14) by DS0PR10MB8176.namprd10.prod.outlook.com (2603:10b6:8:201::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24; Fri, 14 Jun 2024 17:16:27 +0000 Received: from SN7PR10MB6287.namprd10.prod.outlook.com ([fe80::5a47:2d75:eef9:1d29]) by SN7PR10MB6287.namprd10.prod.outlook.com ([fe80::5a47:2d75:eef9:1d29%6]) with mapi id 15.20.7677.024; Fri, 14 Jun 2024 17:16:27 +0000 From: Kris Van Hees To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Kris Van Hees , Nick Alcock , Alan Maguire , Masahiro Yamada , Steven Rostedt , Luis Chamberlain , Masami Hiramatsu , Nick Desaulniers , Jiri Olsa , Elena Zannoni Subject: [PATCH v4 2/3] kbuild, kconfig: generate offset range data for builtin modules Date: Fri, 14 Jun 2024 13:14:27 -0400 Message-ID: <20240614171428.968174-3-kris.van.hees@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240614171428.968174-1-kris.van.hees@oracle.com> References: <20240614171428.968174-1-kris.van.hees@oracle.com> X-ClientProxiedBy: LO6P265CA0009.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:339::14) To SN7PR10MB6287.namprd10.prod.outlook.com (2603:10b6:806:26d::14) Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR10MB6287:EE_|DS0PR10MB8176:EE_ X-MS-Office365-Filtering-Correlation-Id: eecffa2a-91f3-43dc-2c02-08dc8c95b9a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|366013|7416011|376011; X-Microsoft-Antispam-Message-Info: k1Ee1H1icE2N1Xcrqn+xrwv6wD5XNZi7U95iNlEiaEVgFpYfgwQFfC+HNkxdLlFOAil7Yu/HtCk5merAoeoF+/SCKlkCY0k/cjhLvfjJ9uuQcdgl7rYUmTNUzxnlSrarnQUut3IG+ClShYp0m6uMy7E20fmWeddjUW1LoPY66rzMWfCpmePAtwN72/5127lOin2hIfP3eJb4bMqKsJV1VqNrGkWW2GpqrrhbGX4YlwwlI7001uwz6zt/Tz4JyAfGDKyMbbJVAQ/yzAmDVZeE0nifXst/oA+qj2aVJC5IWDpqi6StQpn/gWyQtqAot/jFJLFM+i607jxiH0LOEv9EETfy0SJxZkwwCUlrnrozfuVOs9JsDDAB4scdf9EXNuaORhsvF7pf52jBspvv27v+W4G9SIgYz8vKg2myxcROncJXJM4wRS7CquzAbbj4jnl9jKJOZuHlH2wHhSD7ZDY9jSQJS9BTHRyyIPyI6k03Ou41piqhlN5Xgb/FzQ0IKKs2KC08fbJx06I/PgWbgxhcwMFC2KeExqB53mq4GvjZd3nwpb9YX1vVzpgrczm2qqsHIhoPlGhac3n4R4LZvVmFELSXDCJlsovZnV9iKPMgzIu3pIaj+xwDdemoDpDLdCUOAcxj/Cwkdxw/DTHclRyAloxjisP9To4tlcMbTYDqTwUbmlt6VIT9ZnaikgwCRypEEHRQXJS1hSBgETYOlS9efeliwamKW4nc7bLxhBxrEVE2MwxSMl4DNsIeBer7jEfF4UECYbIRC7py3XhU3FeSuJvUxXTzQz0rQqDGDEImO9HJXOXedzG9UT9vm1432jBRzbjcpfPpW4DFcDc1tWec7VGd/KjTygfX+E2A/QEV9R9FV2l+/wyCbOcShw8CWe+5XG1m+HF1xPhnt5W2jnSqfyUZNOV8jomuNQbG9QW2RB3NFT9r6SLqmCG6K+cEtzrh0buw7IKy6JLNX9xqsAvg29JbVfVCSo6B+gPLabqvXfRzLoq/4sl+86H0WCZ3Ye9JEwJJnbvZqwwz5lSR92r2d+5mSmGecYSZdx+MUNmbMxO7AZjxYAfQxPF4rb+2orMvxShHcjiUDWn+IfbNUloMC5WeZRlBFbsXLZI1R72RobjUO6vsWvd422wbY+bomm1wn9zrmVJLa91oGYVt1lgx9VlXBPJzc91JZsD1ParXJ34Oep3RXPG3NPmGy4iZdRMvG6EXUm2beDNjsp15eBf8vS4sUH0hBTSnkzj8kQtaf4Te7XSllJj/8bYGbCocdNA7KNyt8OB4IyqGzIRN2Ty79Ax4V/A7+p/1cd6iIorCAmqphdHKmw7+7jbaq7MpXM4+ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR10MB6287.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(1800799021)(366013)(7416011)(376011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vy4Mcr3Y/NtUa6b5sHv7cIKHo94TGOprkKbW3sCOcI0oB/36wAEIboX6jU1sL5dqmuQ5Jmc3sB7opph5hJts5E5NVOoG/C1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0NLUegB2KYf1psAulwNGRX/LUsMDxEt6XDxM1W7K9h8FEAmX3pz9cXug6CFxU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: eecffa2a-91f3-43dc-2c02-08dc8c95b9a6 X-MS-Exchange-CrossTenant-AuthSource: SN7PR10MB6287.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2024 17:16:27.3254 (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: Wy4AmxVkmIaqfREsOkHzUunjbRfJh3iDBd0zvbXOQUVAgECZBQAEzJKMdnzKHlBd3GOBywRI+MJxgaekZCb7OGZPOv2EmzXetlWtaZxQHbI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB8176 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-14_15,2024-06-14_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406140118 X-Proofpoint-GUID: iGAKSNPpeB2a5OeXJvAKCMLZ3bIQEaE7 X-Proofpoint-ORIG-GUID: iGAKSNPpeB2a5OeXJvAKCMLZ3bIQEaE7 The offset range data for builtin modules is generated using: - modules.builtin: associates object files with module names - vmlinux.map: provides load order of sections and offset of first member per section - vmlinux.o.map: provides offset of object file content per section - .*.cmd: build cmd file with KBUILD_MODFILE and KBUILD_MODNAME The generated data will look like: .text 00000000-00000000 = _text .text 0000baf0-0000cb10 amd_uncore .text 0009bd10-0009c8e0 iosf_mbi ... .text 008e6660-008e9630 snd_soc_wcd_mbhc .text 008e9630-008ea610 snd_soc_wcd9335 snd_soc_wcd934x snd_soc_wcd938x .text 008ea610-008ea780 snd_soc_wcd9335 ... .data 00000000-00000000 = _sdata .data 0000f020-0000f680 amd_uncore For each ELF section, it lists the offset of the first symbol. This can be used to determine the base address of the section at runtime. Next, it lists (in strict ascending order) offset ranges in that section that cover the symbols of one or more builtin modules. Multiple ranges can apply to a single module, and ranges can be shared between modules. The CONFIG_BUILTIN_MODULE_RANGES option controls whether offset range data is generated for kernel modules that are built into the kernel image. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock Reviewed-by: Alan Maguire --- Changes since v3: - Consolidated patches 2 through 5 into a single patch - Move CONFIG_BUILTIN_MODULE_RANGES to Kconfig.debug - Make CONFIG_BUILTIN_MODULE_RANGES select CONFIG_VMLINUX_MAP - Disable CONFIG_BUILTIN_MODULE_RANGES if CONFIG_LTO_CLANG_(FULL|THIN)=y - Support LLVM (lld) compiles in generate_builtin_ranges.awk - Support CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y Changes since v2: - Add explicit dependency on FTRACE for CONFIG_BUILTIN_MODULE_RANGES - 1st arg to generate_builtin_ranges.awk is now modules.builtin.modinfo - Switched from using modules.builtin.objs to parsing .*.cmd files - Parse data from .*.cmd in generate_builtin_ranges.awk - Use $(real-prereqs) rather than $(filter-out ...) --- lib/Kconfig.debug | 19 ++ scripts/Makefile.vmlinux | 16 ++ scripts/Makefile.vmlinux_o | 3 + scripts/generate_builtin_ranges.awk | 284 ++++++++++++++++++++++++++++ 4 files changed, 322 insertions(+) create mode 100755 scripts/generate_builtin_ranges.awk diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 291185f54ee4..03fddad67d59 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -571,6 +571,25 @@ config VMLINUX_MAP pieces of code get eliminated with CONFIG_LD_DEAD_CODE_DATA_ELIMINATION. +config BUILTIN_MODULE_RANGES + bool "Generate address range information for builtin modules" + depends on !LTO_CLANG_FULL + depends on !LTO_CLANG_THIN + select VMLINUX_MAP + help + When modules are built into the kernel, there will be no module name + associated with its symbols in /proc/kallsyms. Tracers may want to + identify symbols by module name and symbol name regardless of whether + the module is configured as loadable or not. + + This option generates modules.builtin.ranges in the build tree with + offset ranges (per ELF section) for the module(s) they belong to. + It also records an anchor symbol to determine the load address of the + section. + + It is fully compatible with CONFIG_RANDOMIZE_BASE and similar late- + address-modification options. + config DEBUG_FORCE_WEAK_PER_CPU bool "Force weak per-cpu definitions" depends on DEBUG_KERNEL diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux index c9f3e03124d7..5fd1f272ccde 100644 --- a/scripts/Makefile.vmlinux +++ b/scripts/Makefile.vmlinux @@ -36,6 +36,22 @@ targets += vmlinux vmlinux: scripts/link-vmlinux.sh vmlinux.o $(KBUILD_LDS) FORCE +$(call if_changed_dep,link_vmlinux) +# module.builtin.ranges +# --------------------------------------------------------------------------- +ifdef CONFIG_BUILTIN_MODULE_RANGES +__default: modules.builtin.ranges + +quiet_cmd_modules_builtin_ranges = GEN $@ + cmd_modules_builtin_ranges = \ + $(srctree)/scripts/generate_builtin_ranges.awk $(real-prereqs) > $@ + +vmlinux.map: vmlinux + +targets += modules.builtin.ranges +modules.builtin.ranges: modules.builtin vmlinux.map vmlinux.o.map FORCE + $(call if_changed,modules_builtin_ranges) +endif + # Add FORCE to the prequisites of a target to force it to be always rebuilt. # --------------------------------------------------------------------------- diff --git a/scripts/Makefile.vmlinux_o b/scripts/Makefile.vmlinux_o index 6de297916ce6..252505505e0e 100644 --- a/scripts/Makefile.vmlinux_o +++ b/scripts/Makefile.vmlinux_o @@ -45,9 +45,12 @@ objtool-args = $(vmlinux-objtool-args-y) --link # Link of vmlinux.o used for section mismatch analysis # --------------------------------------------------------------------------- +vmlinux-o-ld-args-$(CONFIG_BUILTIN_MODULE_RANGES) += -Map=$@.map + quiet_cmd_ld_vmlinux.o = LD $@ cmd_ld_vmlinux.o = \ $(LD) ${KBUILD_LDFLAGS} -r -o $@ \ + $(vmlinux-o-ld-args-y) \ $(addprefix -T , $(initcalls-lds)) \ --whole-archive vmlinux.a --no-whole-archive \ --start-group $(KBUILD_VMLINUX_LIBS) --end-group \ diff --git a/scripts/generate_builtin_ranges.awk b/scripts/generate_builtin_ranges.awk new file mode 100755 index 000000000000..ba7a5dcef284 --- /dev/null +++ b/scripts/generate_builtin_ranges.awk @@ -0,0 +1,284 @@ +#!/usr/bin/gawk -f +# SPDX-License-Identifier: GPL-2.0 +# generate_builtin_ranges.awk: Generate address range data for builtin modules +# Written by Kris Van Hees +# +# Usage: generate_builtin_ranges.awk modules.builtin vmlinux.map \ +# vmlinux.o.map > modules.builtin.ranges +# + +# Return the module name(s) (if any) associated with the given object. +# +# If we have seen this object before, return information from the cache. +# Otherwise, retrieve it from the corresponding .cmd file. +# +function get_module_info(fn, mod, obj, mfn, s) { + if (fn in omod) + return omod[fn]; + + if (match(fn, /\/[^/]+$/) == 0) + return ""; + + obj = fn; + mod = ""; + mfn = ""; + fn = substr(fn, 1, RSTART) "." substr(fn, RSTART + 1) ".cmd"; + if (getline s 0) { + mfn = substr(s, RSTART + 16, RLENGTH - 16); + gsub(/['"]/, "", mfn); + + mod = mfn; + gsub(/([^/ ]*\/)+/, "", mod); + gsub(/-/, "_", mod); + } + } + close(fn); + + # A single module (common case) also reflects objects that are not part + # of a module. Some of those objects have names that are also a module + # name (e.g. core). We check the associated module file name, and if + # they do not match, the object is not part of a module. + if (mod !~ / /) { + if (!(mod in mods)) + return ""; + if (mods[mod] != mfn) + return ""; + } + + # At this point, mod is a single (valid) module name, or a list of + # module names (that do not need validation). + omod[obj] = mod; + close(fn); + + return mod; +} + +FNR == 1 { + FC++; +} + +# (1) Build a lookup map of built-in module names. +# +# The first file argument is used as input (modules.builtin). +# +# Lines will be like: +# kernel/crypto/lzo-rle.ko +# and we derive the built-in module name from this as "lzo_rle" and associate +# it with object name "crypto/lzo-rle". +# +FC == 1 { + sub(/kernel\//, ""); # strip off "kernel/" prefix + sub(/\.ko$/, ""); # strip off .ko suffix + + mod = $1; + sub(/([^/]*\/)+/, "", mod); # mod = basename($1) + gsub(/-/, "_", mod); # Convert - to _ + + mods[mod] = $1; + next; +} + +# (2) Determine the load address for each section. +# +# The second file argument is used as input (vmlinux.map). +# +# Since some AWK implementations cannot handle large integers, we strip of the +# first 4 hex digits from the address. This is safe because the kernel space +# is not large enough for addresses to extend into those digits. +# + +# First determine whether we are dealing with a GNU ld or LLVM lld linker map. +# +FC == 2 && FNR == 1 && NF == 7 && $1 == "VMA" && $7 == "Symbol" { + map_is_lld = 1; + next; +} + +# (LLD) Convert a section record fronm lld format to ld format. +# +FC == 2 && map_is_lld && NF == 5 && /[0-9] \./ { + $0 = $5 " 0x"$1 " dummy"; +} + +# (LLD) Convert an anchor record from lld format to ld format. +# +FC == 2 && map_is_lld && !anchor && NF == 7 && raw_addr == "0x"$1 && $6 == "=" && $7 == "." { + $0 = "0x"$1 " " $5 " = " $7; +} + +# (LLD) Convert an object record from lld format to ld format. +# +FC == 2 && map_is_lld && NF == 5 && $5 ~ /:\(\./ { + gsub(/\)/, ""); + sub(/:\(/, " "); + sub(/ vmlinux\.a\(/, " "); + $0 = " "$6 " 0x"$1 " 0x"$3 " " $5; +} + +FC == 2 && /^\./ && NF > 2 { + if (type) + delete sect_addend[type]; + + if ($1 ~ /\.percpu/) + next; + + raw_addr = $2; + addr_prefix = "^" substr($2, 1, 6); + sub(addr_prefix, "0x", $2); + base = strtonum($2); + type = $1; + tpat = "^ \\"type"[\\. ]"; + anchor = 0; + sect_base[type] = base; + + next; +} + +!type { + next; +} + +# (3) We need to determine the base address of the section so that ranges can +# be expressed based on offsets from the base address. This accommodates the +# kernel sections getting loaded at different addresses than what is recorded +# in vmlinux.map. +# +# At runtime, we will need to determine the base address of each section we are +# interested in. We do that by recording the offset of the first symbol in the +# section. Once we know the address of this symbol in the running kernel, we +# can calculate the base address of the section. +# +# If possible, we use an explicit anchor symbol (sym = .) listed at the base +# address (offset 0). +# +# If there is no such symbol, we record the first symbol in the section along +# with its offset. +# +# We also determine the offset of the first member in the section in case the +# final linking inserts some content between the start of the section and the +# first member. I.e. in that case, vmlinux.map will list the first member at +# a non-zero offset whereas vmlinux.o.map will list it at offset 0. We record +# the addend so we can apply it when processing vmlinux.o.map (next). +# +FC == 2 && !anchor && raw_addr == $1 && $3 == "=" && $4 == "." { + anchor = sprintf("%s %08x-%08x = %s", type, 0, 0, $2); + sect_anchor[type] = anchor; + + next; +} + +FC == 2 && !anchor && $1 ~ /^0x/ && $2 !~ /^0x/ && NF <= 4 { + sub(addr_prefix, "0x", $1); + addr = strtonum($1) - base; + anchor = sprintf("%s %08x-%08x = %s", type, addr, addr, $2); + sect_anchor[type] = anchor; + + next; +} + +FC == 2 && /^ \./ && NF == 1 { + # If the section name is long, the remainder of the entry is found on + # the next line. + s = $0; + getline; + $0 = s " " $0; +} + +FC == 2 && base && $0 ~ tpat && NF == 4 { + # If the first object is vmlinux.o then we need vmlinux.o.map to get + # the offsets of the actual objects. That is valid because in this + # case the vmlinux.o is linked into vmlinux verbatim (per section). + if ($4 == "vmlinux.o") + need_o_map = 1; + + sub(addr_prefix, "0x", $2); + addr = strtonum($2); + sect_addend[type] = addr - base; + + if (anchor) + base = 0; + if (need_o_map) + type = 0; + + next; +} + +FC == 2 && !need_o_map && $0 ~ tpat && NF == 4 { + if ($1 ~ /\.percpu/ || !(type in sect_addend)) + next; + + sub(addr_prefix, "0x", $2); + addr = strtonum($2) - sect_base[type]; + + mod = get_module_info($4); + if (mod == mod_name) + next; + + if (mod_name) { + idx = mod_start + sect_base[type]; + entries[idx] = sprintf("%s %08x-%08x %s", type, mod_start, addr, mod_name); + count[type]++; + } + + mod_name = mod; + mod_start = addr; + + next; +} + +# If we do not need to parse the vmlinux.o.map file, we are done. +FC == 3 && !need_o_map { + exit; +} + +# (4) Collect offset ranges (relative to the section base address) for built-in +# modules. +# + +# (LLD) Convert an object record from lld format to ld format. +# +FC == 3 && map_is_lld && NF == 5 && $5 ~ /:\(\./ { + gsub(/\)/, ""); + sub(/:\(/, " "); + + type = $6; + if (!(type in sect_addend)) + next; + + sub(/ vmlinux\.a\(/, " "); + $0 = " "type " 0x"$1 " 0x"$3 " " $5; +} + +FC == 3 && /^ \./ && NF == 4 && $3 != "0x0" { + type = $1; + if (!(type in sect_addend)) + next; + + sub(addr_prefix, "0x", $2); + addr = strtonum($2) + sect_addend[type]; + + mod = get_module_info($4); + if (mod == mod_name) + next; + + if (mod_name) { + idx = mod_start + sect_base[type] + sect_addend[type]; + entries[idx] = sprintf("%s %08x-%08x %s", type, mod_start, addr, mod_name); + count[type]++; + } + + mod_name = mod; + mod_start = addr; +} + +END { + for (type in count) { + if (type in sect_anchor) + entries[sect_base[type]] = sect_anchor[type]; + } + + n = asorti(entries, indices); + for (i = 1; i <= n; i++) + print entries[indices[i]]; +} From patchwork Fri Jun 14 17:14:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kris Van Hees X-Patchwork-Id: 13698987 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87F0D197540; Fri, 14 Jun 2024 17:17:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718385434; cv=fail; b=fwWhtLpDm/q6PgEnW47EjRLB+iq46IKKVwh2SRqiytlXyAxRn0xRFHe5sctmQrC7CHQ+yCaubBDN/sSVLhiLNIXBqnCZp08xIVjb91iDWkeolL1OWFqvCT2Lx/hjFVIgy47nYgso999nA8txJUW/hfX5H/WOkWJyIWWE+HXa7FE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718385434; c=relaxed/simple; bh=QuS6WMnSSlL4Il3oYMHeHFThcVFKJSY0JzlJXykTIyI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=J3AUuEeKUpI09y1P9rG6GYSpYmpKUGzaDSeSlFQmAmz9iks7mlezWSeuQFIaY2PQs60qLqZmhwnSnyS12tmBaE+33VhH23eh9k7saUXQU7yBgL9CK2wyVIUcnnQqW//rlAkW/In67E3ks5XOuePGIIdI2NsooL8R6n1luBpNbls= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=om71gJYa; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Y8ukbbR5; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="om71gJYa"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Y8ukbbR5" Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45EDGw24007171; Fri, 14 Jun 2024 17:17:04 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-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=AiRDg7YNI4oMlVkXR84xXsK2YP+xq0+cqswv/87H5ig=; b= om71gJYajzUauqWeMhABdxewLnSrl1VXyX+DDyo761rMpMqnlLawfB0Ze7BF5jv9 K4Wl8swov5gBTlQ0P36IgwJ7nXGm2FEynNYtVoxO5RT6TTtMXMmhNw7y6nrc+a+A 2B1S862pLcr8WFxBbUoRrgp8+IPIOfRwWWxrZsiouRtr3057/tASG3PYknDKco2e ciFZFIzQ/zgWXm9W8j2Os6SrWcDzBHT45KrMq3jDwD9Ug9a9CoFE35y1Xz5k2d86 ed8ftpEaVHo+FzANDEuSWoH9znVYLY/ajHR9ojcsKKPVglg0MIuwpoEA8XL4C4Kn K7h67PttvRvmu+9IOZFLaw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ymh19c3yc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2024 17:17:04 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 45EG0WOW020600; Fri, 14 Jun 2024 17:17:03 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3yncb06yvv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2024 17:17:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cucvfSX+IwZVq0ybv8sq4CXml3KqaU80WuaWZOOY7SeMe0ImuM3UyW2HmJt7RKS+cj/LSf+Pcluqxsl4E5zfE044oZyrw2aM3yCL9MIaTJ9JVSDXn9fjrvsj2bX8pDFmARIe8No+bdWIZs5qAH4XsKuGJ5h6IJ81JaPXoK2/ED47SWJesnYvhO8hOPd9PsCyo4prm//ZifN23+myni+6WuAMDd/vtOVenYdmHw/2qOd3bdHEaYP2WMmnfnqgsYG/uEuk5C0RASr9ua33r1VurfdzX2rRZqTwnA9VkoMpnumKEibtTqM8nCHLLXrB1OqAAoBQVn98FYBb2Ri4R81HzA== 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=AiRDg7YNI4oMlVkXR84xXsK2YP+xq0+cqswv/87H5ig=; b=hqMW40q1AEWnnU5x0XC/lSCXSkXztIDywqiXKtNyZk+EWggs9ci6dk/AbcazWS1eH4wW0GxF6E0j0A3AIP0MqiaBdUkXtrQ5VeQnr2zCC4w+bGwmAP3t2CHWibWuWKwtPvNIp5EMZRfYsMXe03UH+l0nwGACFAN2p68B1JifpCJOGMjoKvjm1rQhbNI6GVQnfDGyLFZ8uy83m7Ay9ZVHAiaMIpGYUF9vr2DH2OxMEKLmGnz7vXpsFbsKhqO+madkr4q7vJAcKpwzXIBUEBAZFNqtQGTmNODmullcfsW9/+ztP8QcvrSR1OZMCAApWHnIYgFDNNtbdU3hKCI1X1l/kQ== 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=AiRDg7YNI4oMlVkXR84xXsK2YP+xq0+cqswv/87H5ig=; b=Y8ukbbR5orqjnttCaSTbCJCC8+lpQ68yaqwJlVWKDuVWK5vZmIQr52HLtKA2iBgD0E3yTIn0WVOhQx3P/J54xO/30zdlS5kzsrxh6gQ74Z8JzwNRb5b7mTto/d8ZJIqXYFVA4BI+vY9WXnue3MBIZg90eaKdAmRLmiGDryAXGd8= Received: from SN7PR10MB6287.namprd10.prod.outlook.com (2603:10b6:806:26d::14) by DS0PR10MB8176.namprd10.prod.outlook.com (2603:10b6:8:201::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24; Fri, 14 Jun 2024 17:17:01 +0000 Received: from SN7PR10MB6287.namprd10.prod.outlook.com ([fe80::5a47:2d75:eef9:1d29]) by SN7PR10MB6287.namprd10.prod.outlook.com ([fe80::5a47:2d75:eef9:1d29%6]) with mapi id 15.20.7677.024; Fri, 14 Jun 2024 17:17:01 +0000 From: Kris Van Hees To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Kris Van Hees , Nick Alcock , Masahiro Yamada , Steven Rostedt , Luis Chamberlain , Masami Hiramatsu , Nick Desaulniers , Jiri Olsa , Elena Zannoni Subject: [PATCH v4 3/3] module: add install target for modules.builtin.ranges Date: Fri, 14 Jun 2024 13:14:28 -0400 Message-ID: <20240614171428.968174-4-kris.van.hees@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240614171428.968174-1-kris.van.hees@oracle.com> References: <20240614171428.968174-1-kris.van.hees@oracle.com> X-ClientProxiedBy: BL1P221CA0003.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::9) To SN7PR10MB6287.namprd10.prod.outlook.com (2603:10b6:806:26d::14) Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR10MB6287:EE_|DS0PR10MB8176:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c276b3e-1b91-4760-8956-08dc8c95ce1d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|366013|7416011|376011; X-Microsoft-Antispam-Message-Info: DgYs6cJ/73+KLioDKE5XyvnSb9dajkEC4ELrcYaLlbgUCXF9ZzV5ALWeO29MaeikYKUgTOmgf7axp/X1gFDx3YqTyS9xPwADyis5DZv5q0MxnqSi8ivcz9nweo9V3VOt/r1YV4unpODdNQaFqAjQmOmY/sZ6ZLw9V2ASVUZtN4S4WicvA/ZastAzHAtOCZVajnHGf2lZd43hIBDgdiofO5T6BTnSUdyi47wiHxVC4pJbvTG9Lbfz/wGWPgyUw13VP9E6pIHGnKoveTtJhC83zAMwsUt0pqD/NR6EfI7z4RryoHpbU+yUgLxUO0k7KSg6PFzVtE9vOScmIPjBjdNgEKU5TUgtvy2QG5ZB0JBE6I48b88t6lZUB5ESqu/HZGF6xY1s8HR9sZnqWeGzxVSxpvxSspg8QECMUvPXFCgT2T5vue75KmuMSSlsms/pb7hMZjyBhunxfAQQI4r1fJL0MIkxmj4P2AOKgg6z0DQS4zAG8ezmFfDKFvk4tTy6uZeO9k1O8lHJwYdmj4BjcyNmqxMv8dLxTtV10KVg2bi6Tb07hVqw66SrJN9d4O/t9VhHZ34ltuS42urXP5AzM57nc+vuMMOCqnaQTxr0C5sIoqT3z9awtO7Tp0SPSXhLTVAAYSFxlNzLCKgURzsXdOELi2xtLi3WCf3kAaBSVOs9+S9h1JYo9yOwHYnoMHVEqxg+ILbZ9n5/lTu9PI8UxQGQ2uiA1AD3ybFD4oc/keq3wmk2wXQm7rXHigK08uuC7bHLYkOFa8r9RWQEObGQGPtLac5MvAGkZi0xdNylFWO9Yk2ipFMNGkYDfzNxCJr5XFJ0kA4l+irY7ymL2IXIrYe+rJFcL8y6jte/GL0UKd3xjnLQWqTiICI/2sAlmOh5Setr37WV0rKiK486KAjbcvgVshAYVgWnglhYpZ7w3byK96Nuho+f9FP2Cc5N/k3tUPMQcONmT2rfq1WJTHWIQ/nIwzSdbl0KPkx1EYxUsBSdrSmme2Dfw6wjIrq0YcjAEvSOsnBgfnVWkEj9ic9ExNWhRFlDvmuFOAJF4H1i2pz0YmZR5NaRla2Xvkkb/6onhpsGRbSQOl+bajeZAiNf2yavfN/cUsNI1GYtcfbZg8bWH7kz3WKYTQ9YtIetGLsaf00g6hKQ5IsEMglgSVbGHOnf+YzXOpDHrO+ejEt3G7wbP6+drq3dPvYE7nWkKCE4pz3Khwly5g5O+kmInFMIitQGmHDsvK9qBhQJ/ZowGjBeqdFxN7HSJnJSA67Ci3Ko7t4/adL8gnVEUbKuAewjRn4K0EHAL++2EgrjnT+FdS8/XyidP2KXaSDd9kGhX1ExnLGK X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR10MB6287.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(1800799021)(366013)(7416011)(376011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: q3rVf7tXsNR/CdTWSn5UeNEhTXYT/c41H1EjFvi8XhpNpTBPi0m4WjcwTqiXD08jRZZFUkhpmuYONRJvflBqijSlKR2UHwRo+r1navB5yeYs2/reutfblxQt1AvA3oJsetmhfLUegxLhpaUI5Z4BFcLaRGqoK2MN3yl9MbwMX8CjalF0I6CXXP7NPosfALwrNmOgQmU7JCfMse/CSzaE7laEEDaKLe9EemXHG3iJLnLYL69r3+IJjsL6mhotTrfr1Q9HmIpZ/PAK9uQupuaxLEitT0Se4IbwXJhJrYntXrp6bOuKshc2g5GuEpBvy8fZhZaDekd9OxBHhAVQ8Mbca9+N3NfVXE9+Cf35ddOQ1PSb3j5+UIMMCgpafp6SRuZtZ0oUflC/N3NYYWa37j540vPCCl+ANqPHKjVx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Be+T8Npw0TNklMPYK3oME59fMW7hisgMWSJ9fPXeUA+F6u2x5JZQmeZUQAcqOMCG+OaZKfim68tm+uA80t09X2ZI249cj6aRqYjVE64SkbjXJezKPEmsg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +dDwP8ptQzkppY15NxVabOuDY3e42RhtXP4wmReaDtCQCZfyxTqF9bzRdqdhNa26nwCZaGniJuGXKEtkMOwfzz5M8L9HUumc9Qf84uwRn4qL21stiZxQQ0fyqh9CTQnhikp1IUe9VNZl/fNi4frZLNXmhCd6pJfrM9YlQRJvyJek2rXAsJKYzMd/lhu1XbVnPnQmO1spQRRc7gksWq15IHeqwbTxvbPuy/INKFwqKVVz6eW34+m+Leb8olEABJbmjb3F4lqXhupme/60FzSuzhmalZXRHgt8SMfNxgtvDXb8B78c6iZY8jThs3d0fDXhVHbrDUI6brfysoWtreumAsKS25Yy5LjxA4Y8ZxmogHeYtuAC2ZqvkCLBQGBzhKKwxlKXgXoC6gZ6fcEgk2YD9Q0+ogHbHbedIRbVeH/sGa+YHTjMnfY6iaV13/BCtsgSkzid98lMVRiM8tmu5gmfRAe6jL87+/nK05WZXTvt17Zxnbw0TiB1G38hNc8QO7ExIRgfaAwgJhAB8uFtn/fJ+QJrVcZOhsmP6icamFhRljE/n4JEWG1/NgjuJReTQqTiVtStOOvrinBIshYf5bkzOsoFkrYLMZXzOF6LSiwo9GA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c276b3e-1b91-4760-8956-08dc8c95ce1d X-MS-Exchange-CrossTenant-AuthSource: SN7PR10MB6287.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2024 17:17:01.6666 (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: Zu9KFrUo5RgW0Igmp6lyWOffCzIUK+7aFM5oQ9o92/lhK4FDBAMg6QmfD7LXxwoSGDSOEQXlGQXihe12cdcEJPdruXli2KmKF9/JkAKoIww= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB8176 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-14_15,2024-06-14_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406140118 X-Proofpoint-GUID: l3YaTr6CDcep0jLCGi63rtYayDKUysdl X-Proofpoint-ORIG-GUID: l3YaTr6CDcep0jLCGi63rtYayDKUysdl When CONFIG_BUILTIN_MODULE_RANGES is enabled, the modules.builtin.ranges file should be installed in the module install location. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v3: - Only install modules.builtin.ranges if CONFIG_BUILTIN_MODULE_RANGES=y --- scripts/Makefile.modinst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 0afd75472679..c38bf63a33be 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -30,10 +30,12 @@ $(MODLIB)/modules.order: modules.order FORCE quiet_cmd_install_modorder = INSTALL $@ cmd_install_modorder = sed 's:^\(.*\)\.o$$:kernel/\1.ko:' $< > $@ -# Install modules.builtin(.modinfo) even when CONFIG_MODULES is disabled. +# Install modules.builtin(.modinfo,.ranges) even when CONFIG_MODULES is disabled. install-y += $(addprefix $(MODLIB)/, modules.builtin modules.builtin.modinfo) -$(addprefix $(MODLIB)/, modules.builtin modules.builtin.modinfo): $(MODLIB)/%: % FORCE +install-$(CONFIG_BUILTIN_MODULE_RANGES) += $(MODLIB)/modules.builtin.ranges + +$(addprefix $(MODLIB)/, modules.builtin modules.builtin.modinfo modules.builtin.ranges): $(MODLIB)/%: % FORCE $(call cmd,install) endif