From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uYSnByTuTGoc9ioAWB0awg (envelope-from ) for ; Tue, 07 Jul 2026 08:16:36 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=VDlze9B/; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1C3031E098; Tue, 07 Jul 2026 08:16:36 -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.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,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 79C441E070 for ; Tue, 07 Jul 2026 08:16:35 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0AA874BA2E10 for ; Tue, 7 Jul 2026 12:16:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0AA874BA2E10 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=VDlze9B/ Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 0B80A4BA2E17 for ; Tue, 7 Jul 2026 12:15:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B80A4BA2E17 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 0B80A4BA2E17 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783426555; cv=none; b=S9CAKJCTZPZb1ryN3Bi3tA2MVSadl8CLkrd4HbeeiB0b9tZJSrTUGOaY8IsomOeWs64Zzg6SHPfRFq0iE+L0q8KBpRuerE5dnXEbdh5ZESFosPeZmz8gv9rgdelTggyuHAGBzV+rLER235OCjhaCcIAVgVEvityJvNWEtSGqqVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783426555; c=relaxed/simple; bh=euSqY3NPDJKdkbrsQgeLZEaWGyOXt/FBcJlzyEKEuSw=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=LLRmI1/mLwS0989e9XZqHtEIcl6cr/li9xaemnFKUiX+t6P+VOqGnWHn/F4ZkPshhX47TVuUGaa2g7df8DhMDtiNVzsFsJF3G9g/ro+ANFaoRfqsRIuznq6uvPs9ZULg+troN9h9DmPsDaWcbkwBJFTiMocguDxoIsEAVhqcVvs= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=VDlze9B/ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B80A4BA2E17 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EEF7325E1; Tue, 7 Jul 2026 05:15:49 -0700 (PDT) Received: from [10.1.29.181] (K775M2XVT2.cambridge.arm.com [10.1.29.181]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0D9843F7B4; Tue, 7 Jul 2026 05:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1783426554; bh=euSqY3NPDJKdkbrsQgeLZEaWGyOXt/FBcJlzyEKEuSw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=VDlze9B/soqk60wVimyWTCpMEakdLd0o15HzjjvFg9N8T+n0/1iMjEP28p120tJKj ljPLAymH4rtLiIJC3ad3DsdFt+dto2OkTJW0Z+mjHUo84G+tCZdiGP9W0SqzplfRDu rSi0zbiQqvEeHZWYifKlDC/GaqTmWUAXDWN3j/Lk= Message-ID: <86242273-d37a-4159-8f07-5917e5c622c1@arm.com> Date: Tue, 7 Jul 2026 13:15:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/1] gdb: Preserve IFUNC marker when finding inferior functions To: Simon Marchi , Wilco Dijkstra , Florian Weimer Cc: "gdb-patches@sourceware.org" , Andrew Burgess , Yury Khrustalev , Thiago Jung Bauermann , Adhemerval Zanella Netto , Carlos O'Donell References: <20260625152036.6149-1-muhammad.kamran@arm.com> <20260625152036.6149-2-muhammad.kamran@arm.com> <549b8d25-1102-42bc-96d0-24ac30060ea0@arm.com> Content-Language: en-GB From: Muhammad Kamran In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Hi Simon, On 03/07/2026 13:56, Simon Marchi wrote: > On 6/30/26 11:29 AM, Wilco Dijkstra wrote: >> Hi Muhammad, >> >>> Yes. GDB should prefer the cache/GOT path and avoid resolver calls >>> where possible. The patch does not make resolver calls safer or add a >>> new resolver-calling mechanism; it just preserves the IFUNC marker so >>> the existing IFUNC resolution path is used instead of calling the >>> resolver address as though it were malloc itself. >> >> Indeed - while the patch works for now as a workaround, directly calling >> ifunc resolvers without following the ifunc ABI does not work. GDB only >> passes HWCAP as the first argument, so the resolver may return different >> functions due to the set of HWCAP values given not being identical between >> GDB and GLIBC (ie. It could call the wrong malloc implementation that was >> not selected or initialized). >> >> So the best option is to call dlsym() as Florian suggested. > > To track this, could either of you file a GDB bug with the necessary > background (why it would be good to switch to using to dlsym to resolve > ifuncs)? A GDB bug has been created on bugzilla and can be seen here: https://sourceware.org/bugzilla/show_bug.cgi?id=34367 > > Thanks, > > Simon