From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yYK8Fggge2pjbh0AWB0awg (envelope-from ) for ; Tue, 11 Aug 2026 09:13:44 -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=CIPjA/lQ; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=CIPjA/lQ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 586741E033; Tue, 11 Aug 2026 09:13:44 -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 1494F1E033 for ; Tue, 11 Aug 2026 09:13:43 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2098B4BA9036 for ; Tue, 11 Aug 2026 13:13:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2098B4BA9036 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=CIPjA/lQ; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=CIPjA/lQ Received: from AM0PR02CU008.outbound.protection.outlook.com (mail-westeuropeazon11013071.outbound.protection.outlook.com [52.101.72.71]) by sourceware.org (Postfix) with ESMTPS id 7AC3B4BA799B for ; Tue, 11 Aug 2026 13:13:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7AC3B4BA799B 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 7AC3B4BA799B Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=52.101.72.71 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1786453992; cv=pass; b=RHE87z8LKqhcjA2jiPVS9XVYbXmfRYO7RG5nkqa6M+NMdf3bn0oOspVcYMikLA2T8RvcuLrXcteeZkvarVgA2+R3eThGbr3Kul+Iwi43rJEZQRXSDA4eQw4p88lCv+FbxoaUV4v8GjNd6IvW/nVcHhm0iAqsjAxrcvKLsYxbAqc= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1786453992; c=relaxed/simple; bh=XsOWUq+iZZrkH305CuXHZ2zNkn1mfm01uI9yf9CaDDE=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=fgdmKXiPP/upbXVBCRyJlEERGobP36tug2F2C9o3nywfOFuzAf3Fkh/h2Q1kZQJC02Birc91NWEmXkGUksqBO4mhMnMAFAHQYFlUIZfkVaQ+XV7c/NGnzjZJ23jtmJ5OL9lU1GoSJ+xQvAxotV5ywh4IWdPX14ixS4xK//aauZE= 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=CIPjA/lQ; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=CIPjA/lQ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AC3B4BA799B ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=gd0tswfvzFnSBsYX0hfx1xrDbxn3p4PvDChFj9BQV23XfYNRUaMwmszzBxzFXpJaw8qZ+EJ3LIMmnzIkM1PEYzl2I/Z8nSTJTKvfoTqSRpdQf+f7TdWNEP1eHAuoDRYpxikTV2uTi+i3kv7qBWE42u6Ab5pHz84uTucRx6YDstt4nIrCZM09ogDSEudO4JtR/Sozy5jEzfyPOaQiHiNkChwgtzrq+SEcwbJuWgCc1Ld9ILANtb8QwOsP6DYasxwgdt4n2tgNIrrUhXMwP8UVOvt11IdV1SQC0Ttrlzis7Axh9Hxoo6o0jKi0H3TxgKgJ0mlCcD/bdovvzdtxVvA3lA== 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=MJh0efbtYPbqReDP2N3gyHHEZlgL6cIOuoMBbq3ydD8=; b=DfMWQp1SX/nsScWduLoI7fnoKVovkUL3cFefIMN6CCY7GFYKCSLwD7kU9vn6UczU3A0dZoVWC3+E857DYSyzIZORQj67CPs/Bv8yNbRJpNRUWAOJ+2BRqGiMmgH+n70tBwYV4eAmCUiM+YE42ZYYu9DuWR7Ejd2lCutaNsdctaIYb9esCkemaqQMPcSUg3BD6K7iCrKzIyYcdnPgTRXWHaVxHWErLKzYVIlCajO6EXBlxenpbtRISNFlZkS9iKOJCPGQhl5fiXyUfb9/120rhH7WlGOW8gwZsddfov1KQsvK8Y5bPyaOLolzxo/ap5nlZFKRnsfQ0cINHxh2gB4yXQ== 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=MJh0efbtYPbqReDP2N3gyHHEZlgL6cIOuoMBbq3ydD8=; b=CIPjA/lQFZPH7usoS0GOY37gp8H2Q7C+horVZvQ2imMRGoJkD0LMkV9Ras+Ts4NrSD3yDt4ZDBpGgJv02lE8JrOXCe6N2Dt9oJ47fNbt5UPCnwLOk0Y3oBrgRMFIL/3FY/WaSCkC4Yemqh/dfNoZmzFkiSUL11ZomQQGwZkNC4c= Received: from AS9PR06CA0152.eurprd06.prod.outlook.com (2603:10a6:20b:45c::21) by AM7PR08MB5399.eurprd08.prod.outlook.com (2603:10a6:20b:104::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.11; Tue, 11 Aug 2026 13:13:05 +0000 Received: from AM4PEPF00027A5E.eurprd04.prod.outlook.com (2603:10a6:20b:45c:cafe::75) by AS9PR06CA0152.outlook.office365.com (2603:10a6:20b:45c::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.315.12 via Frontend Transport; Tue, 11 Aug 2026 13:13:05 +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 AM4PEPF00027A5E.mail.protection.outlook.com (10.167.16.72) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.315.6 via Frontend Transport; Tue, 11 Aug 2026 13:13:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Us40cCfecH7/obV3mVZCxUa3xWi3sKhjA/OV0rGSakiL0ZzZtPZE0zWplWe4okkDc55EO8yAAvhcBQD0OOdpO8YfBSUXwvE9S40bVSYtJhym47tKCCo8W6klS9P08qXxEUdUztKk0lpdDrRb/9F8vC9nBAJhbU6CDwSp2/6vxKhurXSO2arkJu5M+p/86sTjOo4sJtmEU6LOSXxGeE5HWhXMY0xx+zOG0oKqC04cgB7viJmJtNkgiMqmNGgLxB1MMKgeU9+mY8sTdM+lfIXvDXfFRMfiY+ApGLIGqmFUwZHjY7TFBYlqzsSCo44DqupjYdoDPGaR6Kd1/nBBRPY2ZA== 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=MJh0efbtYPbqReDP2N3gyHHEZlgL6cIOuoMBbq3ydD8=; b=uR9IL8YaI4Q0C5GGZFsUvcY10GtT3vZg7nTmO0J+/9uDwacO7L/ok3tUJv4Pzczvz25OLY4qOT3mxreGNVgtDev4PH/Mrt1M4Fo8tvjyMM3GWk9875fUz6/Nem/kzE8d4djS/2tBgyAEKuozsv/ohu1nrGtHd4Y2hA1wiOGj/w884v2/Zw9YTbFdg7F3d4ybdcA3AICvlSarRugheyYiURCm8DgzubxUFrSbhlQojOwosT627cHBdo84Pod30RizrwCn0MoXIdQwik1dWNvNyRP5GYiqSla4oMzYVGdzJs//TXc58zvuZ82ihakY7Bttr6FDD3SYoMXb2jrZvGkHkQ== 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=MJh0efbtYPbqReDP2N3gyHHEZlgL6cIOuoMBbq3ydD8=; b=CIPjA/lQFZPH7usoS0GOY37gp8H2Q7C+horVZvQ2imMRGoJkD0LMkV9Ras+Ts4NrSD3yDt4ZDBpGgJv02lE8JrOXCe6N2Dt9oJ47fNbt5UPCnwLOk0Y3oBrgRMFIL/3FY/WaSCkC4Yemqh/dfNoZmzFkiSUL11ZomQQGwZkNC4c= Received: from AM0PR02CA0120.eurprd02.prod.outlook.com (2603:10a6:20b:28c::17) by PAXPR08MB7318.eurprd08.prod.outlook.com (2603:10a6:102:231::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.292.25; Tue, 11 Aug 2026 13:12:30 +0000 Received: from AMS0EPF00000191.eurprd05.prod.outlook.com (2603:10a6:20b:28c:cafe::98) by AM0PR02CA0120.outlook.office365.com (2603:10a6:20b:28c::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.292.25 via Frontend Transport; Tue, 11 Aug 2026 13:12:30 +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 AMS0EPF00000191.mail.protection.outlook.com (10.167.16.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.6 via Frontend Transport; Tue, 11 Aug 2026 13:12:30 +0000 Received: from AZ-NEU-EX03.Arm.com (10.240.25.137) 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, 11 Aug 2026 13:12:29 +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, 11 Aug 2026 13:12:29 +0000 From: Muhammad Kamran To: CC: Wilco Dijkstra , Yury Khrustalev , Thiago Jung Bauermann , Adhemerval Zanella Netto , Carlos O'Donell , "Simon Marchi" , Andrew Burgess , "Muhammad Kamran" Subject: [PATCH v5 1/2] gdb: Preserve IFUNC marker when finding inferior functions Date: Tue, 11 Aug 2026 13:12:18 +0000 Message-ID: <20260811131219.510776-2-muhammad.kamran@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260811131219.510776-1-muhammad.kamran@arm.com> References: <20260811131219.510776-1-muhammad.kamran@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF00000191:EE_|PAXPR08MB7318:EE_|AM4PEPF00027A5E:EE_|AM7PR08MB5399:EE_ X-MS-Office365-Filtering-Correlation-Id: 307209b6-2435-4df2-9e3b-08def7aa471a 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|82310400026|36860700016|13003099007|56012099006|10067099003|5023799004|11063799006|3023799007|22082099003|18002099003; X-Microsoft-Antispam-Message-Info-Original: hiR+MwxdiTiWccU3sIhzOAYULcHDmXh42sb410sirywa9vVIBRQelNrQF09wXckI6aIwHtphneFpXNTYypvDEWgqDoU3sq3PTfGtfn2HJjCT2VpP9FQq8PvkUK0RN61Ulc9v8mi/5pw0tEU6aC3C7ij8kBBMl3NfRj+txI7MAFtpUsgGjWyg/XCUQAAShdtcWDCfPdsgZaIRsWpGHl1ffxXRiUOS0EwRHpL/tKRD0k+DobeUU/9tf1TtwGT8/rTbXgB2pf+abZ8mszji5uYl5wXZf41pTJDvih3HLlmxQzWTabvKALZLizpU7SSZ9EX90A40Q9tsPHylKpQ/VFnohqZIUvRDwOKtETBqsVYwSIPcdFKfQynYq/NoCL+kt81eg0GF0sTghxw4W16rDtXeLdgE6boyqbYKGnM1n5wFf7g/2Vk0Ake/MNe6noaBOElXlUMmv4VEYYrTAPI+MemzT3+qBcL8IkUxn6exZOO9FvAPgK+BnHLY0Nkre0MIl+WdyvPRhFe+YfflQoLDl5y8wx0MIKxkM2Q7naDAeFk2l9PD+cw/xoVs8r2fnYpRFknd8n26mel39Wr3ZC6yd6eVKb/g4WeNW1UrIb1KkJ5PdxHwCWf+Sf9HK7jp2UeX5P6rOFrBRX+plQd/vRhmyipwfg== 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)(82310400026)(36860700016)(13003099007)(56012099006)(10067099003)(5023799004)(11063799006)(3023799007)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: YEf/9WxHhChphXQ7alBcXfle7jad1Z95wdlZxwDS0b2vOxLLX9bEK0cGyRxVjJZPDc+tXFEiWsvv0J1Bi1BgZquKVA4rxnJcIjb0pLcDgcfKKSXv+W0gPYsnaqrhKjeaEwPUGfM4+/mu7OVjLvmMixgJndgupOVUAva6YwqarWyUSQmDBMTAi/be4WmjMJJZEsOrRuuCQHxkCkxe0coLHtAbORcYQnrkF9Q9xdcXmz+IvFdyMtn/dMK61s4nLjvGgR0BSWyURZxFvSTYOZMlsuf77TdqaZK+jQrnAFyaYl5tRfHV/tEPusZiQU6u4w0hssLafojBIgTiLOHtTT2cUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7318 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A5E.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7de15e3a-2ba4-487e-bd7d-08def7aa3327 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|14060799003|82310400026|36860700016|35042699022|376014|23010399003|18002099003|22082099003|56012099006|5023799004|11063799006|3023799007|13003099007|10067099003; X-Microsoft-Antispam-Message-Info: fC6iKK1t0IM5iA+mDEn6Vr+xgNYl1lDNQ6nT3P64NK9t1H6MVuHSAudc26+oKoih/GByaMUzTFTNJvwS9iHJAXZO5v04XWZESsJNhjRQXnNziasjtnRyu8EcXRSGGboMVJhnpRYiDb+wNsdHsyMd5kUZxFuxaLz3S6b79TGsWEFjW65njqeNgL7M84iXQXGFV8qXKJDGeDq9eVOZnx6sGGcf6KUus693dKpV9I1Zucm2vqKBF/kU2eFxswCJRv6dBNSn97xar9jTs1TSHbaC7OlhnvEs1+0rpJo9ggWspo9LRoxIz/g/RwIONgtgAdk6xirTHf3mTEzLSo+3y+d4rxt7ATH8sqEMqMZSYMZ/8M+Jc3v4RLWb1byl27jgrRRBFqTcgHQFBrTLLP7slU3uprn9oGqKvq5cDpxhs5A6V/GETQ7KjuNTVousyzozVzuSfXyaAz9Zp5ORDKXBnRabQXr62bLHMb3mt3xDIIMHIjlBRVJmQXR32nM2yZRkDT2seq6V7zN1s/z7wKenB7TiPkPYxVX/lFM6m4xGJvqD+ePyO4t3dD3EfTWKgBpUys6b+myLItJU8/KoadV3Xowv3BDp5SdFhH+zSIaDfw3/53UMkLBm+dX7W9HHM0XgQOj4t4hfXyQrNpSvcqwyNdpBJA== 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)(1800799024)(14060799003)(82310400026)(36860700016)(35042699022)(376014)(23010399003)(18002099003)(22082099003)(56012099006)(5023799004)(11063799006)(3023799007)(13003099007)(10067099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qkL7lA1gfsUb/hzFCiQILl6pi6LSMiZgfFcNRJXd+yzvk90CnADLUXvJuEH3PSG9WNjgogJMV6hA4CSEnlm8nh0CTgn9SjENWBEck50HAGUwaIYgLuiNrfjEVl+p5pRi67j5L7xpFKvoi17/1L0D/+8RI4hAfP1WWWwEhSqjfZx6x8mhf/U22z/RQAs/LJR/aIjfZBV7gRDi/EBsUklH8F8PXgWaJnaDmmVdvtBvBONA7Ci7rT/QftxC3iy51Rfc+B9NcPn1q7aB1NC8wG/ZNQEt/mkAd1JDpO5Jb3doggnbhhkRYVihgVo9NYL27XtMrLRKNYJa713RvU4MMyQTCrgSByvecNyMNy/g5Q1Oru4ma42LXOD8BcMk7Fx819zzPLw9LBbC9B7g82G7fBOdDoJM2ip7l0MFw2VyTDfeEvqBx+x/1zNagQYATHipQvxe X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2026 13:13:04.1669 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 307209b6-2435-4df2-9e3b-08def7aa471a 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: AM4PEPF00027A5E.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5399 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 | 105 ++++++++++++++++++ gdb/valops.c | 5 + 5 files changed, 217 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..d146a197776 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,103 @@ 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 + gdb_load_shlib $infcall_lib_so + if {![runto_main]} { + return + } + + set malloc_addr {} + gdb_test_multiple "pipe maint print msymbols | grep \" malloc \"" \ + "look for malloc msyms" { + -re "($::hex) malloc section \[^\r\n\]+\r\n" { + lappend malloc_addr $expect_out(1,string) + exp_continue + } + + -re "$::gdb_prompt $" { + gdb_assert {[llength $malloc_addr] > 0} \ + "found at least one malloc symbol" + } + } + + set found_correct_malloc false + set first_addr [lindex $malloc_addr 0] + set infcall_lib_tail [file tail $infcall_lib_so] + gdb_test_multiple "info symbol $first_addr" "check first malloc symbol" { + -re -wrap " in section \[^\r\n\]+ of \[^\r\n\]+/$infcall_lib_tail" { + set found_correct_malloc true + } + + -re -wrap " in section \[^\r\n\]+" { + # Nothing to do. + } + } + if { !$found_correct_malloc } { + unsupported "found some other malloc symbol" + 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 +478,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 d2dc3d9e869..c478bdc3f15 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