From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2RxAOeWqcWpHiQUAWB0awg (envelope-from ) for ; Tue, 04 Aug 2026 05:03:33 -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=NXFt/S+v; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E569D1E09E; Tue, 04 Aug 2026 05:03:33 -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=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 27F621E033 for ; Tue, 04 Aug 2026 05:03:33 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 77F0E4BB24FF for ; Tue, 4 Aug 2026 09:03:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77F0E4BB24FF 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=NXFt/S+v Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 478474BB3B8D for ; Tue, 4 Aug 2026 09:03:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 478474BB3B8D 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 478474BB3B8D 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=1785834182; cv=none; b=PdjI6P9v63di+J6eLWkTuAvt4VvshkBqIJKrQbL+OG+Z6EyshIPhxq6Xq2A/Ca5K+8Zlx+kDsOyeuPxpJdrYjJNt39mTZNw9bikcE3tNgE4CHcB6P1J53CwTkxbcVJlqkI+ACreLd5vyuGkS+nSr8TvRv0evKOSU1qwcY2Iv62s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785834182; c=relaxed/simple; bh=CM6okKMpVmVdAbq2o3LjTzmmvHRbxr+bLznTBAlHibs=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=WDKV1qB6Kt88GC213Ei3P10FY5217RP/prF6TBtOe09alc5f3ETXpXCiYqO2eZebB53O+/j6WsJWnLxnxLhSKhHBY9ht8IHNDaMtlWlmN+3D9IHPghDMuUUcRIgu27aexPgYn0Oremm71ckh+zua1SqeFSYiNm51RX2IJhV6EdY= 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=NXFt/S+v DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 478474BB3B8D 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 F1CD81476; Tue, 4 Aug 2026 02:02:56 -0700 (PDT) Received: from [10.1.23.147] (K775M2XVT2.cambridge.arm.com [10.1.23.147]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D1EDC3F66F; Tue, 4 Aug 2026 02:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785834181; bh=CM6okKMpVmVdAbq2o3LjTzmmvHRbxr+bLznTBAlHibs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=NXFt/S+vU49K54x3nibMiJhhhStmkFNcv0LdTmDwGIiAr7BtRK3PPh98xmG7tnHEK fGdHWCgHwyw/+ZChtPqBwHxa/SJdq5oiyvdHQiYpfHDXSwNJ23DDkwtG0EHMr6S9go ASvc66sGcYFLl8hKN0hozABvTSwfDnOb5xleHYX4= Message-ID: Date: Tue, 4 Aug 2026 10:02:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 0/2] gdb: Fix internal inferior calls through GNU IFUNCs To: gdb-patches@sourceware.org Cc: Simon Marchi , Andrew Burgess , Wilco Dijkstra , Yury Khrustalev , Thiago Jung Bauermann , Adhemerval Zanella Netto , Carlos O'Donell References: <20260630110443.12900-1-muhammad.kamran@arm.com> Content-Language: en-GB From: Muhammad Kamran In-Reply-To: <20260630110443.12900-1-muhammad.kamran@arm.com> 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 Ping. Is this patch series OK to push? This would also unblock the GNU IFUNC malloc implementation in glibc. Thanks, Kamran On 30/06/2026 12:04, Muhammad Kamran wrote: > This series fixes a GDB inferior-call issue exposed by malloc being a GNU > IFUNC in glibc on AArch64. The underlying problem is not AArch64-specific: > it can affect any inferior helper found through find_function_in_inferior's > minimal-symbol fallback when that helper is a GNU IFUNC. > > GDB calls find_function_in_inferior ("malloc") when expression evaluation > needs to allocate memory in the inferior, for example for string literal > arguments. In the minimal-symbol fallback, GDB created a synthetic ordinary > function pointer from the minimal symbol address. If the symbol was a GNU > IFUNC, this lost the IFUNC marker, so call_function_by_hand did not resolve > the symbol before calling it. > > Patch 1 checks the minimal symbol kind directly and propagates the GNU IFUNC > marker to the synthetic function type for mst_text_gnu_ifunc and > mst_data_gnu_ifunc symbols. The existing fallback address and return type > are unchanged. > > Patch 2 fixes the follow-on return-type issue after IFUNC resolution. When > the resolved target type, or the type inferred from the resolver return type, > does not provide a usable return type, find_function_addr now keeps the > original function type's return type. This preserves the synthetic fallback > return type used by find_function_in_inferior ("malloc"). > > The tests add an internal inferior-call case using an IFUNC malloc and run it > through the existing gdb.base/gnu-ifunc.exp matrix for resolver attr, > resolver debug info, and resolved-target debug info. > > Changes since v3: > * Move the ifunc resolver into a shared library. > > Changes since v2: > * Rework the minimal-symbol fallback to check the minimal symbol kind > directly as suggested by Simon. > * Add coverage for both debug and no-debug IFUNC malloc variants by > using the existing framework. > * Preserve the original IFUNC return type when the resolved target type > is unknown. > > Muhammad Kamran (2): > gdb: Preserve IFUNC marker when finding inferior functions > gdb: Keep original IFUNC return type when target type is unknown > > gdb/infcall.c | 12 +++- > .../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 | 66 +++++++++++++++++++ > gdb/valops.c | 5 ++ > 6 files changed, 188 insertions(+), 2 deletions(-) > 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 >