From patchwork Tue Oct 31 13:49:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Gomez X-Patchwork-Id: 160117 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp252961vqg; Tue, 31 Oct 2023 06:49:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzBP/IbsE/vgID2aJN2S/Jq3xp31lsAQ+aJ6FDdKboiFKMRPSI0+PSbwTrQlRgqWOODmUB X-Received: by 2002:a17:90a:4922:b0:27d:5946:5e2c with SMTP id c31-20020a17090a492200b0027d59465e2cmr9827837pjh.12.1698760160191; Tue, 31 Oct 2023 06:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698760160; cv=none; d=google.com; s=arc-20160816; b=DsMh3Ck3ubWFBfQwNj7Ycq83oJdCShuEpcueeoj/ooR4HDTbokURoCit+Mn2/HO13M 05YfVm/yZ2kG5+qUHrUgF52T/APIix+g32e1wlFW4zwtDrZw4fp/7Tdpq7EscCwt7KZr 94xLaYNxFc0gwJKiXP0XN1XNsvF/3ZZyxAjTdjp398PsA3JfjqQbREnuWSD/+aTQTvVW t69BOJlhT4RtMGV62H/hWwHL95N0ADEhdhstSYKSE/gYzalp5EFYALQybpYBEOwmVd0u ywBNAwHGLPc8B1SkeR7lviDYPFvkDKDc3QgpiR6pim6WvUV5tGMJxfkpXmwkFdR3Kq6f +ElQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:mime-version :content-transfer-encoding:content-id:content-language :accept-language:message-id:date:thread-index:thread-topic:subject :cc:to:from:dkim-signature:dkim-filter; bh=+5Eh93ax/i28RwkAXRyvodCltxo1X7H2c4M8Yvi/M4o=; fh=katoSZ1l5XvWEvJX6kVGCSVfvIFoKC36NUPWDpnedAY=; b=Ro+A+qTIwrUNMvIgPrK67etrHYXqpqNPxDjRvY1bW8l4WBW0Tqz08pTYmMZgWqtAvh fxPzSjdGNo0Hl3x4LQEBhIPY6gpSVXRWux/f8r8lmM9UpvDr+wUwPntUSXp39APMtBF0 mBIp8ZycDUZsFbWEmMO2X8jv2QMfdhT8DTzIWRYZM6efHyFlo4p1EP8XKAbZc1JZSLjG JTsyRZLtKpvYjjPovAe39qsQrAsHYqT5o7d/FQbB5uLC/OeXw/y+GzH8R6k/m4WeKeUG VBRJQ8Vg5EIk1tHDDppTFNKeKUkcUK4xASeO3Sc0WTle1uxNpD/5drTReeMri2pBbkV8 nAAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=TY2ZqbX0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id nh13-20020a17090b364d00b00280979dbb7csi967535pjb.149.2023.10.31.06.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 06:49:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=TY2ZqbX0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 82D3C801D661; Tue, 31 Oct 2023 06:49:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344633AbjJaNtP (ORCPT + 33 others); Tue, 31 Oct 2023 09:49:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235008AbjJaNtN (ORCPT ); Tue, 31 Oct 2023 09:49:13 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91C51F4 for ; Tue, 31 Oct 2023 06:49:10 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231031134907euoutp02fda67723d9cfa93eb423874862a81c4a~TNVp0jr2T2672626726euoutp02M for ; Tue, 31 Oct 2023 13:49:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231031134907euoutp02fda67723d9cfa93eb423874862a81c4a~TNVp0jr2T2672626726euoutp02M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1698760147; bh=+5Eh93ax/i28RwkAXRyvodCltxo1X7H2c4M8Yvi/M4o=; h=From:To:CC:Subject:Date:References:From; b=TY2ZqbX01lXyA9N1nfvw8ZDucEq3K7+Kc624J5jR2G93u+ocf+hMocrFghz2aTs/6 2J5vjbInPKGXnQWPA3q86Eteh6vZRXPNR/45vO6FQ9yRaN970LKZa35ZEcXo709OHk 22adSkxROYxvMRQPpSLCETdnbiYfIBqwCoI94CiQ= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20231031134906eucas1p125c456c32ccb1adac18e41771b90a4a1~TNVpYMQAv1867218672eucas1p1I; Tue, 31 Oct 2023 13:49:06 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id BC.A9.52736.2D501456; Tue, 31 Oct 2023 13:49:06 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20231031134906eucas1p10b45c65d43bc0643116808c916c12c95~TNVo_4tD52324323243eucas1p1P; Tue, 31 Oct 2023 13:49:06 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231031134906eusmtrp154f8104d9a371f7953b0b6ab7590a567~TNVo_VqOG0203202032eusmtrp1P; Tue, 31 Oct 2023 13:49:06 +0000 (GMT) X-AuditID: cbfec7f5-ba1ff7000000ce00-57-654105d2b47b Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 01.10.25043.2D501456; Tue, 31 Oct 2023 13:49:06 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20231031134905eusmtip13660961fdb7fd8b37e3b37ddfd16b821~TNVoyd4kS1714117141eusmtip1R; Tue, 31 Oct 2023 13:49:05 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 31 Oct 2023 13:49:05 +0000 Received: from CAMSVWEXC02.scsc.local ([::1]) by CAMSVWEXC02.scsc.local ([fe80::3c08:6c51:fa0a:6384%13]) with mapi id 15.00.1497.012; Tue, 31 Oct 2023 13:49:05 +0000 From: Daniel Gomez To: "jan.kiszka@siemens.com" , "kbingham@kernel.org" , "cleger@rivosinc.com" , "akpm@linux-foundation.org" CC: "mcgrof@kernel.org" , "linux-kernel@vger.kernel.org" , Pankaj Raghav , "Daniel Gomez" Subject: [PATCH] scripts/gdb: fix usage of MOD_TEXT not defined when CONFIG_MODULES=n Thread-Topic: [PATCH] scripts/gdb: fix usage of MOD_TEXT not defined when CONFIG_MODULES=n Thread-Index: AQHaDAEDTRsJsWBk1kaMZj/f5uw8FQ== Date: Tue, 31 Oct 2023 13:49:04 +0000 Message-ID: <20231031134848.119391-1-da.gomez@samsung.com> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [106.110.32.103] Content-ID: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBKsWRmVeSWpSXmKPExsWy7djP87qXWB1TDR4/VrCYs34Nm8XCk8kW 927eZLY41b2ZyeLyrjlsFjcmPGV0YPPYtKqTzePEjN8sHjdmRXhsPzmJyePzJrkA1igum5TU nMyy1CJ9uwSujEUH17AUfBKpuDP9DnsD4xqRLkZODgkBE4lfN/6wdTFycQgJrGCUeHplFTuE 84VRYtWkF8wQzmdGida5rewwLQ8Oz2OBSCxnlHj59SMrXNXbh/+hWs4wSpxtmcYE4awEmvxp MwtIP5uApsS+k5vAtoiAVO0/+gysn1lgN6PEqQm/wLYIC4RLPN71DaxDRCBG4uC7R0wQtp7E 7v9tjCA2i4CqxIytJ5hBbF4BK4nrf2+zgtiMArISj1ZCzGEWEJe49WQ+E8TlghKLZu9hhrDF JP7tesgGYetInL3+hBHCNpDYunQfC4StJPGnYyFQnANojqbE+l36ECMtJeZ07GaCsBUlpnQ/ ZIc4QVDi5Mwn4ICRENjMKbFx9iqoXS4SVw8sgtolLPHq+BZoSMpInJ7cwzKBUXsWklNnIayb hWTdLCTrZiFZt4CRdRWjeGppcW56arFxXmq5XnFibnFpXrpecn7uJkZgYjr97/jXHYwrXn3U O8TIxMF4iFGCg1lJhPewqUOqEG9KYmVValF+fFFpTmrxIUZpDhYlcV7VFPlUIYH0xJLU7NTU gtQimCwTB6dUA1PRAxfzN9dnH1nsEyVXc/G5snzh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mbGSOK9nQUei kEB6YklqdmpqQWoRTB8TB6dUA9OqlNDMqAp9puu+M+8G5a42+W9mWRK1T/7iJNGc16rtB0O1 s8vvnmndZb9PXV8ys8TGuqIsrsum4N7/sO7ynNdXo7nO3bT+veHx2bw5LP//ecr8UXHyjT2x 62jvGc31k83b6v1v3976+dGO7TcMbE+YfQs9e2Fn/xUf27CJO2fP8Z7Au092ybTGxkcHK8Tr 94l4Owhtme37w+PXm2Cb6ASHGV7+u2MbD97bFbTXty3VdYeKdlbXMqZHLU/2zWFs3PrQ/dWr xVUhh7Z1e3w746573XbO+QlbfW11LQNm/fh6OePowTt91YdOLnnRm6tqWzRxlcYcaWmHzJmT t5uqfjOz/OLcbPGPuXp7+1c38wwlluKMREMt5qLiRABvLkBwqAMAAA== X-CMS-MailID: 20231031134906eucas1p10b45c65d43bc0643116808c916c12c95 X-Msg-Generator: CA X-RootMTR: 20231031134906eucas1p10b45c65d43bc0643116808c916c12c95 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231031134906eucas1p10b45c65d43bc0643116808c916c12c95 References: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 31 Oct 2023 06:49:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781279133698493074 X-GMAIL-MSGID: 1781279133698493074 From: Clément Léger MOD_TEXT is only defined if CONFIG_MODULES=y which lead to loading failure of the gdb scripts when kernel is built without CONFIG_MODULES=y: Reading symbols from vmlinux... Traceback (most recent call last): File "/foo/vmlinux-gdb.py", line 25, in import linux.constants File "/foo/scripts/gdb/linux/constants.py", line 14, in LX_MOD_TEXT = gdb.parse_and_eval("MOD_TEXT") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ gdb.error: No symbol "MOD_TEXT" in current context. Add a conditional check on CONFIG_MODULES to fix this error. Fixes: b4aff7513df3 ("scripts/gdb: use mem instead of core_layout to get the module address") Signed-off-by: Clément Léger Tested-by: Daniel Gomez Signed-off-by: Daniel Gomez --- Hi, I'm resending the patch [1] from Clement Leger with required changes to make it work with latest linux-next. [1] https://lore.kernel.org/all/20230801125715.139721-1-cleger@rivosinc.com/ I hope it's acceptable that I've included my own Signed-of-by in addition to the Tested-by due to the (minor) changes. Daniel scripts/gdb/linux/constants.py.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.39.2 diff --git a/scripts/gdb/linux/constants.py.in b/scripts/gdb/linux/constants.py.in index e3517d4ab8ec..04c87b570aab 100644 --- a/scripts/gdb/linux/constants.py.in +++ b/scripts/gdb/linux/constants.py.in @@ -66,10 +66,11 @@ LX_GDBPARSED(IRQD_LEVEL) LX_GDBPARSED(IRQ_HIDDEN) /* linux/module.h */ -LX_GDBPARSED(MOD_TEXT) -LX_GDBPARSED(MOD_DATA) -LX_GDBPARSED(MOD_RODATA) -LX_GDBPARSED(MOD_RO_AFTER_INIT) +if IS_BUILTIN(CONFIG_MODULES): + LX_GDBPARSED(MOD_TEXT) + LX_GDBPARSED(MOD_DATA) + LX_GDBPARSED(MOD_RODATA) + LX_GDBPARSED(MOD_RO_AFTER_INIT) /* linux/mount.h */ LX_VALUE(MNT_NOSUID)