From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2dC3NWejQ2qmNh8AWB0awg (envelope-from ) for ; Tue, 30 Jun 2026 07:07:19 -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=Meg57RPh; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Meg57RPh; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D6A591E024; Tue, 30 Jun 2026 07:07:19 -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=unavailable 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 16BD61E024 for ; Tue, 30 Jun 2026 07:07:19 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3AE8B4BA2E04 for ; Tue, 30 Jun 2026 11:07:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AE8B4BA2E04 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=Meg57RPh; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Meg57RPh Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazlp170110003.outbound.protection.outlook.com [IPv6:2a01:111:f403:c207::3]) by sourceware.org (Postfix) with ESMTPS id 893AB4BA2E3E for ; Tue, 30 Jun 2026 11:06:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 893AB4BA2E3E 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 893AB4BA2E3E Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c207::3 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1782817570; cv=pass; b=fVrAthF2v50gm20V3cgEgApNyQhewOzEZ9i6lxum92CONvXA1RQ1RIpKrIQIsaXE3hqOFeSR++yA49XS8a6qBkCXgASsyEtwuibccxuIXKCp+kU0fn4+n85mp4lzgS7pG2SJI1uJMmfEC7sF6vzyg705+SzDWLbksA7is5ImODI= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1782817570; c=relaxed/simple; bh=x0mEfWxW9ZrTiwfIg/HoyIHzcfTKRv6k7fcL9C07R2o=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=qMJO/nGNIFzj7WrjdbfEinQTBjUImZ9aqyUJsPrM+QkFenzJ5MhehDUmN0G+K99dN9uRcfVQQ+xyvIF/4z8eYdwtYKl2mEBNKBQ+KY47BLLd42gfhpLMmBYjW8iwmsIEfuuCsZ+HN5WPGos3WI0S8z1/3lYu/pQdX/loOT5SYAI= 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=Meg57RPh; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Meg57RPh DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 893AB4BA2E3E ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=HTQVXlLHqvUCRvM4RPucgTqODraBs77zLonAqB3yRhSTvZa89IZRkGOIW5W5W5zEHriqVCHv/shmfGtNvhzGvxNmTjxSmYIlkl1TJcodk9uzceGbQ6n4EMGzc7sesROSbyc7Bl3Xdrw+1iGe1rW4kqB8P2K80PmjZ7BTXgRYgi3h5iFXUjxaPtGS7XS4NkSJKxOCWxJKGMPYf9Jk/AX35qsbTpzOj4i7ppCMLFfSxAsYe2PFCPMqQhcg7dNigaYMQUtDLpf9mOXRo+8IyCQszg/D34FXvrDoU6J9CdXUJho18eOyyDqlwb707/glFdqOyzOa5/fEH6anUPrFf6L2VQ== 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=37NRizA97YrE0uN7F+ii59NbMkqBr/JISkrokvXHyKU=; b=csHYyjoalnfoZpAbA7LNr+sGoGwEqYLupmSNPWqiZSUhhS1H5RyK9uTFoRgHiHTxH9ltVGB1fDQ6ZuPkVzJNWV0SiEfwocq18OYhlWLk0Jt1GXCKPc9RIhDaEA0Z34oLv6D7BnRJ44sd5FJEHOm5veoZfhW6eryu7SW+xU+2JNZ+JNbwIGJzSJhdG3T6ZcimATsUHFjhbn8zLFJJc2Na1XdwEy62diYScTh9pJOpoJ+8yC7NeHLO0YOOBy4W0n0tiwpcq5QiHIhs8BlBojYNo2zkUxUcyk6Zw6+Iazm9IqvxbsbSXN0fQCTk86uO6otkgADIrKpvt/nTy6PqX0uNzg== 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=37NRizA97YrE0uN7F+ii59NbMkqBr/JISkrokvXHyKU=; b=Meg57RPhueyke6aRHxocXxStS62iMhFYLAtv+4hL2P8CL2bW/HiNvHFPeOAMhzlKxveeBj6EpVT29vO2/j6G8Sy63UGqKwWjVg6h4njMGRyL1P3KnI1fjWeNRjIYxPLvFtkebhPjWEXo4B+cUrbaS7liK/7AYHGFm/1FH3ZngAk= Received: from DU2PR04CA0282.eurprd04.prod.outlook.com (2603:10a6:10:28c::17) by DBBPR08MB10462.eurprd08.prod.outlook.com (2603:10a6:10:539::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Tue, 30 Jun 2026 11:05:59 +0000 Received: from DU2PEPF00028D07.eurprd03.prod.outlook.com (2603:10a6:10:28c:cafe::9c) by DU2PR04CA0282.outlook.office365.com (2603:10a6:10:28c::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.8 via Frontend Transport; Tue, 30 Jun 2026 11:05:59 +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 DU2PEPF00028D07.mail.protection.outlook.com (10.167.242.167) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Tue, 30 Jun 2026 11:05:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hRuSabPczUjrlxeJXFAO+sYfuDw2YCZsls0Mfh3MObHjXm9ICUMknaDiL9ttkzk3WcdlpDunb+BqYTO6HG+EnaOQTvrM1EC2qHiAW/BzMXObjI/bZH3v/B1orROPf4sihKbCJREhE2B0nKIFCBcMQwoQ5J5ZNCgG2JJdKQv0BOgU2Lu4k7TOHT6rj9tvN2xLRyR9aYdpqDYEbGQP+kdvCRqFFf49cc2ANM77eD+bX/Jv6IAhP86sk6kBrlU5NYj25W3rafqSJnwGyr5KAimKfZB1RFMT3hNAxfUxjEKLN54sMWkaqcIFP3vxHo9uKnhnmLKqoeAS1wCxI+oozXQHqA== 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=37NRizA97YrE0uN7F+ii59NbMkqBr/JISkrokvXHyKU=; b=Zy6xa44OJE7fdbxsIbcHY/EcAON6iV8sSCR8AlTY2vZ/AqQAK6JMV4OZ0zXMJzAojs5cCLO8QG0FFW/V88pmAu+TfhuCbszwhjUlXKfx1+IG/yEG5UkBOpVha/YlvF9o8Fgv9a/EVc8UVxrSoDQr/E8nMzv9/vUvTHvaEqX03jn0w7HuK6ByXDYwQGFkEM3vAR7jzOERIrHZHDHjN2rtzNjwtT+aYt31jAe1vY1A9wjzGEuUGvMHfv3YBT19a35uYbZJndpLWZkC4ZuhgVBMVOlRfbv6SGl8HMGFGstIXLozJ/vRChh+Eh8rGJ/7RmuOGFl3pufMx/8k097DM9iNzw== 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=37NRizA97YrE0uN7F+ii59NbMkqBr/JISkrokvXHyKU=; b=Meg57RPhueyke6aRHxocXxStS62iMhFYLAtv+4hL2P8CL2bW/HiNvHFPeOAMhzlKxveeBj6EpVT29vO2/j6G8Sy63UGqKwWjVg6h4njMGRyL1P3KnI1fjWeNRjIYxPLvFtkebhPjWEXo4B+cUrbaS7liK/7AYHGFm/1FH3ZngAk= Received: from AM8P251CA0002.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::7) by GV2PR08MB11817.eurprd08.prod.outlook.com (2603:10a6:150:302::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.19; Tue, 30 Jun 2026 11:04:53 +0000 Received: from AMS0EPF000001A2.eurprd05.prod.outlook.com (2603:10a6:20b:21b:cafe::4) by AM8P251CA0002.outlook.office365.com (2603:10a6:20b:21b::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.159.19 via Frontend Transport; Tue, 30 Jun 2026 11:04:53 +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 AMS0EPF000001A2.mail.protection.outlook.com (10.167.16.235) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Tue, 30 Jun 2026 11:04:53 +0000 Received: from AZ-NEU-EXJ02.Arm.com (10.240.25.139) by AZ-NEU-EX03.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; Tue, 30 Jun 2026 11:04:51 +0000 Received: from AZ-NEU-EX03.Arm.com (10.240.25.137) by AZ-NEU-EXJ02.Arm.com (10.240.25.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Tue, 30 Jun 2026 11:04:50 +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; Tue, 30 Jun 2026 11:04:50 +0000 From: Muhammad Kamran To: CC: Simon Marchi , Andrew Burgess , Wilco Dijkstra , Yury Khrustalev , Thiago Jung Bauermann , Adhemerval Zanella Netto , Carlos O'Donell , Muhammad Kamran Subject: [PATCH v4 1/2] gdb: Preserve IFUNC marker when finding inferior functions Date: Tue, 30 Jun 2026 11:04:42 +0000 Message-ID: <20260630110443.12900-2-muhammad.kamran@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260630110443.12900-1-muhammad.kamran@arm.com> References: <20260630110443.12900-1-muhammad.kamran@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF000001A2:EE_|GV2PR08MB11817:EE_|DU2PEPF00028D07:EE_|DBBPR08MB10462:EE_ X-MS-Office365-Filtering-Correlation-Id: f6a709c6-0a6b-4276-1eed-08ded69790fa x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|36860700016|23010399003|82310400026|1800799024|376014|18002099003|22082099003|3023799007|11063799006|56012099006|5023799004|13003099007; X-Microsoft-Antispam-Message-Info-Original: WFvCfAiHi9uMr/iriDspYcyIKEs3jMtBp0wJgDEXT3zHs/3QremTeytKHOW5f8QpDHkVwI3jgXonAY78eIBMMDaDpJmHitNCzprezRfKIBUyCAHg1meI+sJRXE0W1WLyBx38dD/Rwb5LHI5eqBLJ1KQtHpCrMuZi+ePgwvrP1NLK49Se6Qb7Gx2GROh2R9JVqjJoZCR0y1NjTEUFMvTXGnLUsajqv8OaFOUaXEB2NnDmIMGZYmo6DNnWIpja63UCf+LgxZG194ADJ2/zd4wqwAFQlEJyXe0+sqQ5FjJ/fheLkxS2RYSv6OAN+SRdQy+Wj2yPbbhAXrFJkVO5wI/WwWNBGOOl+9IBHFB+vmGw3QBn8/fzI78AVKjZxlqfRwyvwLemJxNCKXpF1bvOpnAJmtD9WXk3k/CyTaWi87HWthA4ORKyRUcS4o2D3KfB6EVEM62NQr+3fjIVILeWLKmCxRtRfm+3k9huwoJ/kCt3IappfonUJ8CTtjg5n0+QXi0l2ifpfbhtfsjUDkJqCWn/F79WA59S91HeL0PaQJQd9oaBgruKzoB3HCAfpFsIlQTWz7iDwAJxAVmyUJ/GTAnUAqZkCld1ULMYHhnNZ1X5uGyeA5g4ehRGuhQ2jU9ZfXpTTAjAhfRGX16EnsMomjzJTg== 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)(36860700016)(23010399003)(82310400026)(1800799024)(376014)(18002099003)(22082099003)(3023799007)(11063799006)(56012099006)(5023799004)(13003099007); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: RJbZVmMuxNuh1ONfgAcu0LvjoqIFaEATocfgMik3mYU1PSHCB8sZr1J5uuDHmcAwLiSuR8HJyyvMH1I/3A4CLF9W6I4wVyGCNdk1kg1cnOJPbOJr7fBZ116VeVkZ0QJBdy/EiJtXwrU5rcpNGrch3y4xM/n7ZUcTdJAgE2WjMtBMbKhR7/KA7Etgt/lp3MPAsfGrklJpBjlYxLk8CLCGZ8r+XEfPe+eV9XLI3LqN9JEC+AtGtlhNmcs1LW1I0araVnW6cCQAdK7eE6qoxoctlX5FXXD48+mWXQfyRtSlrGQHypiRqEE3O/wVNuvSFP168h7M0RKJm+rOrZFx/1/HUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB11817 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF00028D07.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 66bdf6ec-bf46-4309-51ac-08ded69769dd X-Microsoft-Antispam: BCL:0; ARA:13230040|23010399003|14060799003|35042699022|376014|82310400026|36860700016|1800799024|13003099007|22082099003|18002099003|3023799007|11063799006|56012099006|5023799004; X-Microsoft-Antispam-Message-Info: PapFUhcL5AdfQoNUcHyRxnuRpKnI3R9q+AKYUC1EN+eWHfFdMMHFZRGPLKQPowQw1OQ9juOg2OgfX8PW/W5GZfS37IhVYG8zzD+AYbyE9SRn4aqiNKEsXOmdi+ok2ceaOYxuVkhCcHtU2NGWueBPbeMcLyfonBGsrrSgYctBxe/h7pIo4ZlsPD/T8oqfaTwh86h1/pR5Chr6aCp35X+9lWpxlmvsBXo2dKCfx+Rkr4Hy3H8tT4iJIbxA4Y/0JFzXBBN2dUM185s+1HG9oT+m6QvRyXokc8uZj/MvYVlj8WUUztEHo2RptYaoW5VYS8546FS8Vhi6EtnR688PSR+hXg13C30sQvXXEiFuNdl1qIlE/0lEMx/o3cLCo/Ag3o3T00bt7V2BT9s1h3O1Z5QHqGviCDwfOVbFKyKYLTJ8HYqkblQ/yfMzd8y/fI8Ibv5vdjGUat+FZ2swmQZXSV1/+Kt0Ha77/bG5fDphQBKIEL4mT0CcLcbsOHiVSgGxz3JdtlVQefvR8Kd/tQmROxbcUQBP/nbV6OHBYiiO7w9E7NAHGnw6xdCfS+Fcz5HqBF5mX8XuEapxitfLgzO7gE6BAHblCSLS6uEP5YT1GHoqOnHd+h3+wufLVLLb9v1U+WTGlxRGCIa+gYFvxk2p+8RgqA== 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)(23010399003)(14060799003)(35042699022)(376014)(82310400026)(36860700016)(1800799024)(13003099007)(22082099003)(18002099003)(3023799007)(11063799006)(56012099006)(5023799004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pI3ENDcZFSoLpHjyPM7nwWXPHenZaSaF1rn3gWVxgzVsQNXzbhCEGj1aYR61tEhxC6KW/ONMsJ6okOZtlQUxuvyGaL99nGVeAGLnrz77zGYr+e1hOjzI3QofmQpYu6yYQKIPcA5QP/VOA7KsZDEWmnyc8bza5KjXTChKtDj+30AKmT0pV/9nUe6RgU8Hal3GktaB1twK5HlOyH01/2hBOzWjjqoV/eweptAvrz9m2iJFC21Le71JOs3bHGsUvqqjU4yk2sE+8ifIxKWXmlQ16PKyyjYIQffTEyZWtPhCsip7au/o4+95bSNG+Dz2VE1aVq//o+mmAxm1Ts0DIkFZP9DyhxXF5edLJt8Hq4A2k4puTbAMas12ChYgdmPXZsvm3e3bYSMAt6OvfHfo5/bVw0kWn/f7PwcfuDJWJ8FFdm9rX98V4N+IpXfRcSlatY8q X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2026 11:05:59.2823 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6a709c6-0a6b-4276-1eed-08ded69790fa 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: DU2PEPF00028D07.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB10462 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. Check the minimal symbol kind directly and propagate the GNU IFUNC marker to the synthetic function type for mst_text_gnu_ifunc and mst_data_gnu_ifunc symbols. This keeps the existing fallback address and return type while allowing inferior calls through IFUNC symbols to be resolved correctly. Extend gdb.base/gnu-ifunc.exp with an internal inferior-call test that uses an IFUNC malloc. The test runs through the existing IFUNC matrix for resolver attr, resolver debug info, and resolved-target debug info. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34330 --- .../gdb.base/gnu-ifunc-inferior-call-final.c | 27 +++++++ .../gnu-ifunc-inferior-call-resolver.c | 43 +++++++++++ .../gdb.base/gnu-ifunc-inferior-call.c | 37 ++++++++++ gdb/testsuite/gdb.base/gnu-ifunc.exp | 73 +++++++++++++++++++ gdb/valops.c | 5 ++ 5 files changed, 185 insertions(+) create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-final.c create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-resolver.c create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc-inferior-call.c diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-final.c b/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-final.c new file mode 100644 index 00000000000..1a9ae6fdcba --- /dev/null +++ b/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-final.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 char arena[32]; + +void * +dummy_malloc (size_t size) +{ + (void) size; + return arena; +} diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-resolver.c b/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-resolver.c new file mode 100644 index 00000000000..217002968de --- /dev/null +++ b/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call-resolver.c @@ -0,0 +1,43 @@ +/* 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); + +typedef void *(*malloc_t) (size_t size); + +#ifndef IFUNC_RESOLVER_ATTR +asm (".type malloc, %gnu_indirect_function"); +malloc_t +malloc (unsigned long hwcap) +#else +static malloc_t +resolve_malloc (void) +#endif +{ +#ifndef IFUNC_RESOLVER_ATTR + (void) hwcap; +#endif + return dummy_malloc; +} + +#ifdef IFUNC_RESOLVER_ATTR +extern void *malloc (size_t size); + +__typeof (malloc) malloc __attribute__ ((ifunc ("resolve_malloc"))); +#endif 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..67d195d25f0 --- /dev/null +++ b/gdb/testsuite/gdb.base/gnu-ifunc-inferior-call.c @@ -0,0 +1,37 @@ +/* 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 . */ + +char arena[32]; +const char *str; + +int +str_in_arena (void) +{ + return str == 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..23a5aadbcbf 100644 --- a/gdb/testsuite/gdb.base/gnu-ifunc.exp +++ b/gdb/testsuite/gdb.base/gnu-ifunc.exp @@ -25,6 +25,13 @@ 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_resolver_file "${testfile}-inferior-call-resolver" +set infcall_resolver_src ${infcall_resolver_file}.c +set infcall_final_file "${testfile}-inferior-call-final" +set infcall_final_src ${infcall_final_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 +363,71 @@ 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 an +# IFUNC malloc exercises this path. + +proc_with_prefix test_inferior_call {resolver_attr resolver_debug final_debug} { + global srcdir subdir + global infcall_file infcall_src + global infcall_resolver_file infcall_resolver_src + global infcall_final_file infcall_final_src + + set suffix [make_binsuffix $resolver_attr $resolver_debug $final_debug] + set executable ${infcall_file}-$suffix + set binfile [standard_output_file $executable] + set infcall_lib_so [standard_output_file ${infcall_file}-$suffix.so] + set resolver_obj [standard_output_file ${infcall_resolver_file}-$suffix.o] + set final_obj [standard_output_file ${infcall_final_file}-$suffix.o] + + set resolver_opts {additional_flags=-fno-builtin-malloc additional_flags=-fpic} + set final_opts {additional_flags=-fpic} + set shlib_opts {ldflags=-Wl,-z,lazy} + set exec_opts [list debug shlib=$infcall_lib_so] + lappend exec_opts "ldflags=-Wl,-z,lazy" + + if {$resolver_attr} { + lappend resolver_opts "additional_flags=-DIFUNC_RESOLVER_ATTR" + } + + if {$resolver_debug} { + lappend resolver_opts "debug" + } + + if {$final_debug} { + lappend final_opts "debug" + } + + if { [gdb_compile ${srcdir}/${subdir}/${infcall_resolver_src} \ + $resolver_obj object $resolver_opts] != "" + || [gdb_compile ${srcdir}/${subdir}/${infcall_final_src} \ + $final_obj object $final_opts] != "" + || [gdb_compile_shlib [list $resolver_obj $final_obj] \ + $infcall_lib_so $shlib_opts] != "" + || [gdb_compile ${srcdir}/${subdir}/${infcall_src} \ + $binfile executable $exec_opts] != "" } { + untested "failed to compile inferior call testcase" + return + } + + clean_restart $executable + if {![runto_main]} { + return + } + + # Without debug info for both the resolver and the resolved target, + # find_function_addr currently loses the synthetic return type after + # resolving the IFUNC. + if {!$resolver_debug && !$final_debug} { + unsupported "internal call resolves IFUNC malloc" + return + } + gdb_test "print (get_string (\"hello-ifunc\"), str_in_arena ())" \ + " = 1" \ + "internal call resolves IFUNC malloc" +} + # Test all the combinations of: # # - An ifunc resolver with the same name as the ifunc symbol vs an @@ -374,6 +446,7 @@ foreach_with_prefix resolver_attr {0 1} { if { [build $resolver_attr $resolver_debug $final_debug] != 0 } { misc_tests $resolver_attr $resolver_debug $final_debug set-break $resolver_attr $resolver_debug $final_debug + test_inferior_call $resolver_attr $resolver_debug $final_debug } } } diff --git a/gdb/valops.c b/gdb/valops.c index ab6fd5079e1..454f093ab68 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -138,6 +138,11 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) type = lookup_function_type (type); type = lookup_pointer_type (type); maddr = msymbol.value_address (); + minimal_symbol_type minsym_type = msymbol.minsym->type (); + + if (minsym_type == mst_text_gnu_ifunc + || minsym_type == mst_data_gnu_ifunc) + type->target_type ()->set_is_gnu_ifunc (true); if (objf_p) *objf_p = objfile; -- 2.43.0