From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0R3WNmqQQmrZ9x0AWB0awg (envelope-from ) for ; Mon, 29 Jun 2026 11:34:02 -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=Yxsdumyv; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Yxsdumyv; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D9C171E024; Mon, 29 Jun 2026 11:34:02 -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 [IPv6:2620:52:6:3111::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 C0DBA1E024 for ; Mon, 29 Jun 2026 11:34:01 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1E6DE4BA23CB for ; Mon, 29 Jun 2026 15:34:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E6DE4BA23CB 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=Yxsdumyv; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Yxsdumyv Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazlp170120005.outbound.protection.outlook.com [IPv6:2a01:111:f403:c200::5]) by sourceware.org (Postfix) with ESMTPS id 68DA04BA2E2E for ; Mon, 29 Jun 2026 15:33:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 68DA04BA2E2E 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 68DA04BA2E2E Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c200::5 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1782747210; cv=pass; b=Up7Sv77ucZHLxVfPPNaaU/SNHatbq8Rb1UXcbSkQTEaAXN6EOdFOMHiCfprz+P992801ak60JHGOaOVSf26VRyBJ7JE38/laMc+yL9mm9yHXnMoTrenKR7bVf6sFOoVKq6VUX+6KNrApEFcXjAWGAQhKoQag075o7apT+xrFF/8= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1782747210; c=relaxed/simple; bh=hMKC+OHQozKuwcSWmNy325bTGDgguTcloKPauMQiiOk=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=QYkK0VQT8FLO5nkxiyUq0T+D+zUyizSKgQK5BNBX6z7VH4dhYYDrpRnOZ/4ZA09VzB3gXhxMUIH0L6ypiqZ+okPRrGCuuWYG2eyKMnP7xVvNOeq4CUVKATSAtF7aIBpPNuCDlfI/B0+Reh70ihHypBcaty/a5ZUVDosmBVFdWpE= 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=Yxsdumyv; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=Yxsdumyv DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68DA04BA2E2E ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=sWCxqflaM0VxdfG1w3YIJlHlHLMSfYdfUP4qyPiVJgv/IsOILQj4Y2AyPc+OeSE+aQuOeJCF6rHG+Vqg0+XcQYi8Xm6CD7z/KTl9TdGnd+PMQrwOXH6jcocUl8ms2Py58KerdyDJZh98dqIUP24u0F0BFcl+kCQKX7EP5irqo4mFYG+W00xdqBj1DcSBZX8a/bwYVwpxyXZJfNDbzyP5dhnPAokdUwEnTTJWzGw15CvlpBFWXTHMhBKlDZFEYV9kT1Rvx7VhoUwnNBEF/BQ5jv0VVCPDB3hFJAtHVpP0pcP1DJY0gu7fs0jpPea54NMQhnTyfhtnArp7WT4/I5WzjA== 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=r50LbzAg0TfUbxLWaLx0MkrjJWVCY7xeZwfKY9AgdNs=; b=yaLiM5Z2DY0vw4BR20GU556woRhvkMkSIr16twLZOCWxl/CT+Af3vnT9rlxxB9dncjmPJJ4e5FRj4K9axntwzLR8RbACB2KGpCDkKWSOjVFdK1x48EF13gFXo2bHwIWZ0Bs7gB6oLQiCi/GCrfooS0LjKn4MipjnXCWLhLTP9mNto5MMuGJ91SJev+GX5rS4mBFvFtphp6bo8MIw6ViD5MYGng/kW+hZ3GPpxbOwEkNDovpnR/FQzARzN6rmHDh3uLfecRJjF704OQgsKnq6r5pnLBFYJFfdiP04jEElrYMKlVFDropS9fur3s5hV26v0+dccGG/x36R9uAm3zOLBw== 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=r50LbzAg0TfUbxLWaLx0MkrjJWVCY7xeZwfKY9AgdNs=; b=YxsdumyvF9t01Nbt9Qn13KMa+yThyMNBGdRTeAtSTsv302nSocvcuuCw9sM+CxxMWAxaShh1jVSkgvxkBqFaaM9Xb2l12k1RRqb2QcrmexmyyznATibTdCNJn9IrqwDsviF2Fst9OkJn/VGZOqFIkpJa8s2lLrHsCdNclloia/o= Received: from DU7PR01CA0043.eurprd01.prod.exchangelabs.com (2603:10a6:10:50e::21) by AS8PR08MB8733.eurprd08.prod.outlook.com (2603:10a6:20b:565::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.12; Mon, 29 Jun 2026 15:33:22 +0000 Received: from DB1PEPF00039233.eurprd03.prod.outlook.com (2603:10a6:10:50e:cafe::ac) by DU7PR01CA0043.outlook.office365.com (2603:10a6:10:50e::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.159.19 via Frontend Transport; Mon, 29 Jun 2026 15:33:22 +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 DB1PEPF00039233.mail.protection.outlook.com (10.167.8.106) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Mon, 29 Jun 2026 15:33:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RzKZGoTzyl5J9Q0jOOAbFpxFSoZc30a8UObOabBIXvlexi3zm9N0zoXx74iKwjYS5UrPAWZ9wu3w5m6RokkYVQ5vUb01BTOBEvn8Uj+TgADM9XCH4LZzOv0a9/V3Y8pxXcl9Ih6dQpOM+pU1tZPKCz+uyxmvu3Dn0BfEzRQYW3oIHFvmZpYvKzym+lmWpPiMOQgXnfZmjjW9r56DK4ol0pHSzSzzvbJ8kp7fkuyf/43bCq4aw4ZwxBiqRHH/K3w7jsfY0VuAr8VygayVIIhRhKrT/jLRqAZ5UqNF/NtoJPVw94NQVVvEaGhf+AfXIosShEtcVH+pTqfF4aQkQ/LxKQ== 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=r50LbzAg0TfUbxLWaLx0MkrjJWVCY7xeZwfKY9AgdNs=; b=aOf5NHGOJ14B1erK4ZZm6t7N/A2R00O7AenXn9VALFwO4N98G9VOXMzZUpIfsbvIGSAhGkVhn658n720Bw49ux0boYLaHUuYFbDqW5nElACRnfAxLVKrIA7BPY9o062nStpwMaH1zSZwNB5//8kyjY5QHTiBT7u/wrBLUyV3u1bqPGb0jiPIWOtzUGekLneEmHxgfKj3S3m3Lv7mDJoLoHjWNnBpk9WKINUJjNdoHuZbyZk98CGm1iu6IchTZTwrgQCa4hL75XgKc7tcAWCxPJzWV9zPkiAztUM/NY0Wi8tw7heFV8Bn6duVxj0Ld3OK4Mg7o2jpFEKeLUCVrm2r1w== 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=r50LbzAg0TfUbxLWaLx0MkrjJWVCY7xeZwfKY9AgdNs=; b=YxsdumyvF9t01Nbt9Qn13KMa+yThyMNBGdRTeAtSTsv302nSocvcuuCw9sM+CxxMWAxaShh1jVSkgvxkBqFaaM9Xb2l12k1RRqb2QcrmexmyyznATibTdCNJn9IrqwDsviF2Fst9OkJn/VGZOqFIkpJa8s2lLrHsCdNclloia/o= Received: from CWLP123CA0182.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:19b::19) by DBBPR08MB10818.eurprd08.prod.outlook.com (2603:10a6:10:532::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.18; Mon, 29 Jun 2026 15:32:14 +0000 Received: from AMS0EPF000001AB.eurprd05.prod.outlook.com (2603:10a6:400:19b:cafe::98) by CWLP123CA0182.outlook.office365.com (2603:10a6:400:19b::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.159.19 via Frontend Transport; Mon, 29 Jun 2026 15:32:13 +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 AMS0EPF000001AB.mail.protection.outlook.com (10.167.16.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Mon, 29 Jun 2026 15:32:13 +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; Mon, 29 Jun 2026 15:32:11 +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; Mon, 29 Jun 2026 15:32:11 +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 v3 1/2] gdb: Preserve IFUNC marker when finding inferior functions Date: Mon, 29 Jun 2026 15:32:02 +0000 Message-ID: <20260629153203.10142-2-muhammad.kamran@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260629153203.10142-1-muhammad.kamran@arm.com> References: <20260629153203.10142-1-muhammad.kamran@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF000001AB:EE_|DBBPR08MB10818:EE_|DB1PEPF00039233:EE_|AS8PR08MB8733:EE_ X-MS-Office365-Filtering-Correlation-Id: fc174fa9-f8cb-48e4-867c-08ded5f3c104 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|82310400026|23010399003|36860700016|1800799024|13003099007|22082099003|18002099003|3023799007|56012099006|5023799004|11063799006; X-Microsoft-Antispam-Message-Info-Original: 0iVImACZ0GmIw6RGRZpaZu5zn8NgMaINKb6YuUj2idToZcEsvrpSOQH4DVv9eC/pEvoKrnHmx5DJqZZiq0LXUOx8RXghOIpga3eJNCMjK/rvAMuchpDe2Fg8+R73uXXG8cjBSp1bDYqkRkFuFeOpISC2S+NmLPDNajqGPmyRINOI+lmr6VfY0jNRsiV/ZJdxNS8YKSWMXQDSDo2ldYnxlng85ofCj89rkBQtVYbv5HOEx4q8DGYoqs5QO5VkJT/f3mmBuhXh1GUz5zyMFQVcrFg8xS6MErafvq9ye21POloJW5oFFO5Ccjyj3l6xxw5FLMlnOWXBb2XRYuh+/UM40I02D93rG6dsReRUN/yji9UJxd2DVqLBobzBknRDH8Odw3ynczA+cFkdY6XNyDZdIXL/kMWBHo3L+/l8OOrLTDzX6ReJKM8yk6GMcgl+Kkll03MuwextrwwmX4UP0qumT8ayR7w6iBHKw5TboV77UxFc64fs92cNwOYT4iZbRENRLUF4GUAPFpGoDqfpJYSN9Q67GiFisEkcyFKKB3ovCrzRjMohHHlWlsabl3X0RD8RF/niJL3pMJqQ2i2CHqF3n0VgFSgi23oh6hBpbk9aIpWM820j4WrMlfOjojlYUOBYtB6rDdFPRyze6IJErj59DJKq67MaVSRIs1x0nW50FB4= 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)(82310400026)(23010399003)(36860700016)(1800799024)(13003099007)(22082099003)(18002099003)(3023799007)(56012099006)(5023799004)(11063799006); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: pIJYiHIlW7LbwtXKOa7taC3H5dASRO1owvIs3TxO4Ug4QGwTNDosLwJZB6pXRKyJudGgl9I4Le4+qVcGW0GEcXUPUN4WCSa820QDdx+/Euqct0h1Zd+P72CDkyf7mI94oYY3Wtwsv1v63piy/la4ju9bfeC4ELL/5lzfVoQj1r5vMFRdzNV/JwpVWS85HxmIXIGksTm2TVkjzS6kKhyh3dCsV5ILE2b++67+MYLB48RY6CSub27SEi9ROgrRSPA4usAO/L2CeFWBgi+txmaQOW6Zku30nvI+cNT5hArjbj+Sth+OhkKf1lwHrVoDT9//o8huPm2GELYTeDQnjUImEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB10818 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF00039233.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 743b9646-8c02-4eda-5f60-08ded5f397f3 X-Microsoft-Antispam: BCL:0; ARA:13230040|14060799003|1800799024|35042699022|36860700016|376014|82310400026|23010399003|22082099003|3023799007|18002099003|5023799004|56012099006|11063799006|13003099007; X-Microsoft-Antispam-Message-Info: BQKEtZ2CeKNAlcCosZ7hb7tDHD5TcDBzJ77PqewnoNITY8zVEDq5NWpquQseRKjnGhzUjZQgYqnVs23rM3oNa5QgeJCtZLQMuwUdFGKCuqTwvA26BnNTRivgxe8SsBJCuTsEYyFKxOOdA8Orvmrtw/BItXpR10bqacnekHzbBQf71Sc/6FY0mv+bNVCyEAEWhCK/RpOhDd/lSuwjT022xxUy2MC6E+ox3BqwT0i43NaqJN6BcV/mGj31eukX5SsH1eQY+yGHEIaaYrMiSUZLdIEkvYnbWBG5CmsZxjGnwdWnzTqSOcXWKnrvmzYAp7a/wsh5WR5YKwkp4F38WthwCDLW7ECSuKJlG+sc7Xd7dZzZOBysHrrFgnBjCJYRAD5bI4xnSJDwHwpeznkRmHXXL61UntE9M8b2LzudfkyfOsmFpD9JMwrm7ACVmhC5qCsZ258NcDybdY4ho5EYDT9VzFA7CrN6DwPufwWpumEJCv96l/QL6m6Z+Y0KxDRn3w3p265H/a6Oqxc+t6qe3KfRYu5wzz/wRifUtB1UQfrIufSz7NayE/YFvFCJ/vLbxPU9LVqSEqKZVjQWGF45CKdHSvu/2C3mkIRpgO6M+EPcJQHJz0KE8NsD8LxiHhbOuC9YgyH1NlpnAbmD6i03yyTH8hGoKuiNp8sg0WHMqvHoYNE= 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)(1800799024)(35042699022)(36860700016)(376014)(82310400026)(23010399003)(22082099003)(3023799007)(18002099003)(5023799004)(56012099006)(11063799006)(13003099007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wWa492zERWhn/sNOUIdGb8HSRmztw8WHLVFGeA3nyxIcPBqF8wQClsP43NixssxlA/EDMuyu7i63IFHyCcvk7P3y++UFBCaP8AKgJHsHkb1OxTsVO9QjLM3gdX7qn7IUPE45Qu8AQlsXVSR9st84TS4TLors/XBfB5s2vhB6Z6YKfi2oVSpf+Izobh/sS0YaP79EBLoTooz9nhxvl89JNSKl/g9jKLyeDvtg9xwGxjGTbHn/dU5aaxgJYTCI/yKh7SouBzuq+OgagKtR0irWh4D/j+snaEp/PGePCqFIux3X84DSt+cA9h3Ox2Y5Xjg4x5FIGewCw8Eg4V/48wyLvPphn75XyqN8y3gFxGeGZCTfoT8EiCBprtiOaIKzw5PPHTf/yrCQbhg4dqgqpzxAsKdLe2ZQi1UlkjuwX8DomebUR1JwKXkQu8UGcNP9XZpa X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2026 15:33:22.4180 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc174fa9-f8cb-48e4-867c-08ded5f3c104 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: DB1PEPF00039233.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8733 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. --- .../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 | 68 +++++++++++++++++++ gdb/valops.c | 5 ++ 5 files changed, 180 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..e2626b9cc0c 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,66 @@ 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 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} + set final_opts {} + + 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 [list ${srcdir}/${subdir}/${infcall_src} \ + $resolver_obj $final_obj] \ + $binfile executable {debug}] != "" } { + 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 +441,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