From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id RmyFMbNHPWol+xcAWB0awg (envelope-from ) for ; Thu, 25 Jun 2026 11:22:27 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=BuE7Cjuq; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=BuE7Cjuq; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BB6131E024; Thu, 25 Jun 2026 11:22:27 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 472881E024 for ; Thu, 25 Jun 2026 11:22:26 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B19074BA23E7 for ; Thu, 25 Jun 2026 15:22:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B19074BA23E7 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=BuE7Cjuq; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=BuE7Cjuq Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c200::1]) by sourceware.org (Postfix) with ESMTPS id B21734BA2E1B for ; Thu, 25 Jun 2026 15:21:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B21734BA2E1B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B21734BA2E1B Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c200::1 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1782400916; cv=pass; b=YQZahpFw7TsUe5oKYSXPqFpk9jKDAGniljwLpN1Di4OkxMM3RmbJCmcbEiu2YGyznWFkNKmf9VMOjmEDpeKgfjx+r9W71oj6tQ/LtOKrloECQaAJdBJRz1SuFGQAkk05itXB61tpCfR+Lk1JzhbaknzFsyaDUHxAtab9FXK+xP4= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1782400916; c=relaxed/simple; bh=gMPil7KiIGw6tyOjVqy4GrOA60rpzhcBdXGSYGONPpc=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=gI6QYNTs/YFNd0Ze0yEVsraAiBST4gLOPFxJr1gGZcgQ0SYYJXFrZZ0fmVhTMdqGkOeM470eYcShv1fO8xnNbI32f7wognU6quiUWLRg6XqP2bwa0279qrv2qxB5Kr/BLD1vaDPJSu4Gn+zEOqO+VsgusETUOpXQZSoyx37C+zE= ARC-Authentication-Results: i=3; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=BuE7Cjuq; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=BuE7Cjuq DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B21734BA2E1B ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=KKvr0gUi6TYvb+JbGz/80TjmAOP2H4LeEnypyk9cCY35ii117rku2WCpWbYO9UcZCrirMbn7G1V2UleKjQxnGV+FVntMKm3XWPwt83II4rMxDIkF3cZyHINgEXGgg3hvNXt54ZZ0Qa2yB9D7d7Q/qVd3Czcp3nYQgNirT37Z1I2RImf7HgObMgSl8fwMLKpXELlvmQjIs+CnkWbNfsaZjHkeArUG9taIOP5yVXIGRKyCQq32xpNMT64qMQRi4ZYAQQssV2g0qVKTnwFn0RHnC6/xM0s3/dvIwy+xZrRfWl+66Aesi2Rx1aMd76rFS23DeRNTQL/BIuOfMbnBfgEm6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=LeM0PEV6ENcZU3pWBUu0/qekJA/PSM1Z87LYkyufWU0=; b=yej1XN+e8ERVY4U5LwRljnnMZ/bGBQm8pw2TrX8NkkgtLQYc8h3LPEea6aT+BGvYLz8Z/8ZiKU80A5Ns4zzXw21u3gWx+1RCnf5+/BD46riyE02/ROeKWP++7YYwdaX05FNoJ2pBua8E5ejuMXNqeDLxLcqwqNb0cr54NA9qHzUrmromhOzFVkVWoyVkGxSAKNSdRQJn+WyUERN8b62zOAD6EwGhmv+EN5TpAiZFBCGJLm4FYLQnjfKHJMMmSzLOBjSWw9lTdv8ui4EPgHAEUNxiGZpEDfU6y/X4xv6t4GDbWDoP4vNuHSYLRz9nw4f3l6l5+4ErKCADVsZgs3p8Sw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LeM0PEV6ENcZU3pWBUu0/qekJA/PSM1Z87LYkyufWU0=; b=BuE7CjuqIg1ipPnj4eNC7VuQ2afSQe9ovXuQuhrQJyy95TTiWH5JX1WJtRhyyoP7ikY5SbY3DAZ3BuB80NeqPSdDfi0NhidRGMYRINNG8BAOdrQjDzC+u36frxcBjovjtocGil9LJ3wD7UD0vxyQ3S2WtT2w3bixmOa6+BDftAk= Received: from AM0PR02CA0170.eurprd02.prod.outlook.com (2603:10a6:20b:28e::7) by GV2PR08MB11420.eurprd08.prod.outlook.com (2603:10a6:150:2b1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.13; Thu, 25 Jun 2026 15:21:50 +0000 Received: from AM3PEPF0000A79C.eurprd04.prod.outlook.com (2603:10a6:20b:28e:cafe::9c) by AM0PR02CA0170.outlook.office365.com (2603:10a6:20b:28e::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.159.16 via Frontend Transport; Thu, 25 Jun 2026 15:21:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by AM3PEPF0000A79C.mail.protection.outlook.com (10.167.16.107) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Thu, 25 Jun 2026 15:21:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SYUvcz/scuW6tpqBksVob7Cnk7C125NpBxOd4GXfyZr+btbTyzlhHkTHY5+vSrWxJIEpDnMBpECzOz+eIdouPA0JQEJ/AmFGo3fWbuMAw068FmW+GkdbU1qoQYqMHHVlFAqMHTcMOKMw8GE5FBGjKQRcAkAdBw4i1ENvzI0kZAEurXtMOHaaUBRU28Z4meuya+cPxgPQDkc3vCEbrMv/KLz89TWlomHCacL7UA2KmYGuH4H2pqui4ktQepACxbuaKupmNC2jF6i5S5jEINNIzr7RQFlXgOuhlO4c7dL5pH5hhiywLvqPzg8uQHbu9alaG8+MIhkThlipbSZgtT0lfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=LeM0PEV6ENcZU3pWBUu0/qekJA/PSM1Z87LYkyufWU0=; b=KP6vJxk/XNR+9lkLE4q+1Zgac8/OA6hIawyLiWtQy/EEVNVHbYTKqIPT2iz10+dAp++OS9r/Mdi+h34/TC00YeG1yh9Nshksduv9BXH9bdPAzJxv8oriil+D0aZJZS7c4tvw72vIuwdLOvsadAEk+ahNtxUlKXniXHjN11BBnfBSfC5j/PGffJBHzNU0o5PbIDymaV0lhUqnzrPP1nU8rpd3rJizPQaxJt4Fm/rNOQJ2dIyhLqRVy6VCNyJViTHSzXBpSKpCWCW+lAIRwQAmSI6daD7yUH/HKYemmYBYBeQwfRsbOIGFAcMxFbckaJU4MOJvsZN4upEwzd6sEO3paQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LeM0PEV6ENcZU3pWBUu0/qekJA/PSM1Z87LYkyufWU0=; b=BuE7CjuqIg1ipPnj4eNC7VuQ2afSQe9ovXuQuhrQJyy95TTiWH5JX1WJtRhyyoP7ikY5SbY3DAZ3BuB80NeqPSdDfi0NhidRGMYRINNG8BAOdrQjDzC+u36frxcBjovjtocGil9LJ3wD7UD0vxyQ3S2WtT2w3bixmOa6+BDftAk= Received: from AS4P190CA0005.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::17) by AS2PR08MB9022.eurprd08.prod.outlook.com (2603:10a6:20b:5fc::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.16; Thu, 25 Jun 2026 15:20:46 +0000 Received: from AMS0EPF00000193.eurprd05.prod.outlook.com (2603:10a6:20b:5de:cafe::ab) by AS4P190CA0005.outlook.office365.com (2603:10a6:20b:5de::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.159.16 via Frontend Transport; Thu, 25 Jun 2026 15:20:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (172.205.89.229) by AMS0EPF00000193.mail.protection.outlook.com (10.167.16.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Thu, 25 Jun 2026 15:20:44 +0000 Received: from AZ-NEU-EX03.Arm.com (10.240.25.137) by AZ-NEU-EX04.Arm.com (10.240.25.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Thu, 25 Jun 2026 15:20:44 +0000 Received: from ip-10-249-57-232.eu-west-1.compute.internal (10.249.57.232) by mail.arm.com (10.240.25.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29 via Frontend Transport; Thu, 25 Jun 2026 15:20:43 +0000 From: Muhammad Kamran To: CC: Andrew Burgess , Wilco Dijkstra , Yury Khrustalev , "Thiago Jung Bauermann" , Adhemerval Zanella Netto , Carlos O'Donell , Muhammad Kamran Subject: [PATCH v2 1/1] gdb: Preserve IFUNC marker when finding inferior functions Date: Thu, 25 Jun 2026 15:20:36 +0000 Message-ID: <20260625152036.6149-2-muhammad.kamran@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260625152036.6149-1-muhammad.kamran@arm.com> References: <20260625152036.6149-1-muhammad.kamran@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF00000193:EE_|AS2PR08MB9022:EE_|AM3PEPF0000A79C:EE_|GV2PR08MB11420:EE_ X-MS-Office365-Filtering-Correlation-Id: 112180fa-2cbf-46a4-41dd-08ded2cd7aaa x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|1800799024|23010399003|36860700016|82310400026|3023799007|13003099007|22082099003|56012099006|18002099003|11063799006|5023799004; X-Microsoft-Antispam-Message-Info-Original: GrxFnFJibNwItxOGkZyVXb5cmRmjNRHEIlk0eF79uj5YT7/C7fscfm3iaOOzgRoT+u9SZTsFFFtSzqxzGBpyrtP7YCH/1w0iHIL93bNtlVDmESgA8H8QntX6Ru8BRRxOSjnC3dUHzxLxS/tq4OM2Dg3Xwdb3tFAq4RyYuvbbDiuqbnkRNAABo7b6rEGJKaQ8+jDNYAc5cG/TnRycmoRcuJ0OTkPXUDlWXNS4WbLhUD/Jrlr1fyHlZvPxy5n92Pdhxk9dX8pbflrO8QC0abEhLpVrfOPYHSFoq8EkF20TVDY3JzuIk/S0asSH2WiltmqbvvNSdDa0WO+0Zj20dawlHYBQFXuew+xWUQU98m0lfiMc1h9JMZX1YN5WE+kyB0/bVL8NPMUsKuGMpKpDGq2VXjSVAWNl0mMKgTNcuxMFCPOXPqqXIHCXUXVWYR7Suv3TdyLxmhVmn3HLLr5ilKZKyBUGCVLUPFgktZUVWV0AIu3UznECzhtY9m17k+HRmhl6ur0zb7EsH/VbRLeaqAgRnTZ899NgDu2edv1qvOD03yDtUSAlKjA3iaMnzI4fGMcnvqpQRVQ+tWHgBv5QB3O3SQjdm3QFlEA0oNA5B0IR3V3NMMCWT09fiB2uanHTYXsox/lPCa1M02dofCD/7WY03wFVswF/qB79OwNCeDqZ1prtVDD7hRNNW1acQtJpFdtOGVSaiePJdwRoUtNPOBFSPA== X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(1800799024)(23010399003)(36860700016)(82310400026)(3023799007)(13003099007)(22082099003)(56012099006)(18002099003)(11063799006)(5023799004); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: cUhMb+e7itdMTwPGiuOoXrATr29cGwRF8oKPDUr8oS3MYHIV8Xm+REE6lmXPcz6fCFgNXqu+kSxbENXdb2kLh+Vpz39EvzPo5MsGxJY/4/4S2r6AIf3oG0SLHtvG8oDhsTgX1NyjGKq7uxPAPWQcq/TiVqzPLkZRs30TyANeVSeSLuxb1cQcbr93vg2Kbtscuc3fjmoKydDd9xBdE5e5cjRVDykdoSEWPD7oGibXEuXGMdmfVfpla6FTwmeoxVIs3BxebwghgIHHcFkDiTWAfffhD+XaX78ZWwJkYnPB6qWcuUDn3utH2hQTBTfGyzRRgJ5g7C3rLzLNEGVytEhDOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9022 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM3PEPF0000A79C.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9611093e-3285-4c7e-98c3-08ded2cd5392 X-Microsoft-Antispam: BCL:0; ARA:13230040|14060799003|376014|82310400026|35042699022|1800799024|23010399003|36860700016|22082099003|18002099003|3023799007|13003099007|5023799004|56012099006|11063799006; X-Microsoft-Antispam-Message-Info: U0flF2mcvouUzUwv94tZ+kK+uXwTOIgb3U0K+iN+XcziOg9thQ3YkLbnjHR+OvHueZjGGMslr+lWdGfWekxOc1NzR28N/XKgFh+YADvR4iAJqhlVUnvSVtbC58B/TL8btg9kYy5FParGQizOUIlFLE8WEbfa5AFqz+X1PL2io+KFHUFWRfozfh+KpnIQgCj01eb75uJCUytPLqArCNRsVwGCdhGjus36Z9MWvcuEfhrL3i7+J9sNKUDaxuNlQpNr+uRJ8/lczBZTMSo5WT0NfBBfZV7Ua64oakrXS8vm36ExTs95I/GnqRWKB6Kt19wtF7XKvzP0jAideag2Pj/e4qg5XNgKp1pNNp6UTmgEsFpAuADF7fwNCTqnjee+iJfnR296GE1JyFl+ob1oSVsZoYA0UaGgiogGkHObz5+C9NPacMe/mKOtt/s2Mxwn8JRX7v98N/DVsJKW3pu+EhveJaEFdOcIiUtrFCkilHQ8WEXnO7273im9zU9E+ZMURICFDGUpdmAr2bow48L34rdwsApeH6M1PnaaA7zrQitF46WrVEU+tOSvGp8lGiAiNU6hjkI/TGlgizCrdFiKT0+iOqBwmqCbej93qVUc1PJ1MZdPN2Ud/3ebA/UQz0oZaBqGX8W8cxjT6f44rqxSs+Ri+cIKP3y7spsSdqrxmqm1CxdaEk7dhjaaWAN1qJ2aYQVqeTqU1v+N/INsksNjB9jVog== X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(14060799003)(376014)(82310400026)(35042699022)(1800799024)(23010399003)(36860700016)(22082099003)(18002099003)(3023799007)(13003099007)(5023799004)(56012099006)(11063799006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sLIC3xFytQxVAd3u4PNAGAJG3a9DNLs0to3XgTmOI7zN2D9OePm5/wq+YjFdRWWusYXM9fQLApqRbvW0Wh68ckmeSOFspa3IwG/ZmwINDyA/1HnrkhVNtGgITypiM/E+WVCrOWpxNmDJQyZOXUTUcmayCxe9p7YMe2K1ie8PuuCTdTw7iVsFmaIIdtQbzHC17OZo04yHe47XeVdOkDgJFTQIWi3Ll1Euir7dbU7fO/OA1XIioolDvygiyp0Y8ZVSr2P85n86fNSrio52zLt6FZNfv0kPUf/PfoBtG+fVKHGl9p2ZwudYgEbN5/3s9vb6IivveDLbDZBR6YUtkuffscePXeC48ZGu44Kf4ytCp+iZ8PShRxWlVB8GBtE33wlVOUluHWCfoYgTrn0YGUyhSsMomTVEu/2KH/3mEl6q/bAYNofi3BoKZvtxobLaU1Vs X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2026 15:21:50.0216 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 112180fa-2cbf-46a4-41dd-08ded2cd7aaa X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: AM3PEPF0000A79C.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB11420 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org GDB calls find_function_in_inferior ("malloc") when expression evaluation needs to allocate memory in the inferior, e.g. for string literal arguments. The minimal-symbol fallback created a synthetic ordinary function pointer from msymbol.value_address (). If the symbol was a GNU IFUNC, this discarded the IFUNC marker, so call_function_by_hand did not resolve the symbol before calling it. Use find_minsym_type_and_address to classify the minimal symbol and propagate the GNU IFUNC marker to the synthetic function type. This keeps the existing fallback return type while allowing inferior calls through IFUNC symbols to be resolved correctly. --- .../gdb.base/gnu-ifunc-inferior-call-malloc.c | 27 +++++++++++ .../gdb.base/gnu-ifunc-inferior-call.c | 45 +++++++++++++++++++ gdb/testsuite/gdb.base/gnu-ifunc.exp | 40 +++++++++++++++++ gdb/valops.c | 6 ++- 4 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-malloc.c create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc-inferior-call.c diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-malloc.c b/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-malloc.c new file mode 100644 index 00000000000..2547fee20a9 --- /dev/null +++ b/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-malloc.c @@ -0,0 +1,27 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2026 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +extern void *dummy_malloc (size_t size); + +static void *(*resolve_malloc (void)) (size_t) +{ + return dummy_malloc; +} + +void *malloc (size_t size) __attribute__ ((ifunc ("resolve_malloc"))); diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call.c b/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call.c new file mode 100644 index 00000000000..3b70811b69b --- /dev/null +++ b/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call.c @@ -0,0 +1,45 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2026 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +static char arena[32]; +const char *str; + +int +str_in_arena (void) +{ + return str == arena; +} + +void * +dummy_malloc (size_t size) +{ + return arena; +} + +void +get_string (const char *s) +{ + str = s; +} + +int +main (void) +{ + return 0; +} diff --git a/gdb/testsuite/gdb.base/gnu-ifunc.exp b/gdb/testsuite/gdb.base/gnu-ifunc.exp index e6389102ae3..85f57071140 100644 --- a/gdb/testsuite/gdb.base/gnu-ifunc.exp +++ b/gdb/testsuite/gdb.base/gnu-ifunc.exp @@ -25,6 +25,11 @@ set libsrc ${libfile}.c set final_file "${testfile}-final" set final_src ${final_file}.c +set infcall_file "${testfile}-inferior-call" +set infcall_src ${infcall_file}.c +set infcall_malloc_file "${testfile}-inferior-call-malloc" +set infcall_malloc_src ${infcall_malloc_file}.c + # Return the binary suffix appended to program and library names to # make each testcase variant unique. proc make_binsuffix {resolver_attr resolver_debug final_debug} { @@ -356,6 +361,39 @@ proc misc_tests {resolver_attr resolver_debug final_debug} { } } +# Test that GDB resolves a GNU IFUNC minimal symbol when it uses +# find_function_in_inferior to make an internal inferior call. String +# literals are copied into the inferior with a call to malloc, so a +# no-debug IFUNC malloc exercises the minimal-symbol fallback. + +proc_with_prefix test_inferior_call {} { + global srcdir subdir + global infcall_file infcall_src + global infcall_malloc_file infcall_malloc_src + + set executable $infcall_file + set binfile [standard_output_file $executable] + set malloc_obj [standard_output_file ${infcall_malloc_file}.o] + + if { [gdb_compile ${srcdir}/${subdir}/${infcall_malloc_src} \ + $malloc_obj object {}] != "" + || [gdb_compile [list ${srcdir}/${subdir}/${infcall_src} \ + $malloc_obj] \ + $binfile executable {debug}] != "" } { + untested "failed to compile inferior call testcase" + return + } + + clean_restart $executable + if {![runto_main]} { + return + } + + gdb_test "print (get_string (\"hello-ifunc\"), str_in_arena ())" \ + " = 1" \ + "internal call resolves no-debug IFUNC malloc" +} + # Test all the combinations of: # # - An ifunc resolver with the same name as the ifunc symbol vs an @@ -379,6 +417,8 @@ foreach_with_prefix resolver_attr {0 1} { } } +test_inferior_call + # Test statically linked ifunc resolving during inferior start. # https://bugzilla.redhat.com/show_bug.cgi?id=624967 diff --git a/gdb/valops.c b/gdb/valops.c index ab6fd5079e1..7d305871efc 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -133,11 +133,15 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) struct gdbarch *gdbarch = objfile->arch (); struct type *type; + struct type *resolved_type; CORE_ADDR maddr; type = lookup_pointer_type (builtin_type (gdbarch)->builtin_char); type = lookup_function_type (type); type = lookup_pointer_type (type); - maddr = msymbol.value_address (); + resolved_type = find_minsym_type_and_address (msymbol.minsym, objfile, + &maddr); + if (resolved_type->is_gnu_ifunc ()) + type->target_type ()->set_is_gnu_ifunc (true); if (objf_p) *objf_p = objfile; -- 2.43.0