From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0di2CcplgWo3qCkAWB0awg (envelope-from ) for ; Sun, 16 Aug 2026 03:24:58 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MvD91ZqF; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 204481E0A3; Sun, 16 Aug 2026 03:24:58 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_SBL_CSS autolearn=ham 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 140011E033 for ; Sun, 16 Aug 2026 03:24:56 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 238A14BA23C1 for ; Sun, 16 Aug 2026 07:24:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 238A14BA23C1 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MvD91ZqF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 2D77A4BA2E1E for ; Sun, 16 Aug 2026 07:24:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D77A4BA2E1E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2D77A4BA2E1E Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786865063; cv=none; b=TE0JuV6NxjrPdawl34Lt3yeKSXtiP29/8mINP+Hf+EvMd0mSSMB+Qs3YxOce/6KkSGm7PTWA0kSZ//mW6i9D6hZgCCpq5U/PW+mIMI6iYPa4wNi2QSGbHO+Nzvb071i4gGVErBSZs6EA/OD6to5ZqqdWcvn8epgJ1mHGISxE7dw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786865063; c=relaxed/simple; bh=91RYgDaC9NRjIr8RYgAAiSxDKRhTAeIlbWk7Qzeipb0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=vXNZoSvXT/s1o+ZXmIP8Z/AHHCmMwc9pXe8H8L5DkaBoDlHAVQb+5Bv0YZsXpVB++ld3tX6umf0PjTv0Y9xRYVMtGHPwZLvASD4+ah/x0qXIcIpv/vDlo2BacEBILOlWDsCZao104qrSMkj7bFx0X8FTwoh6LKBLVPaS5h/FZxY= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MvD91ZqF DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D77A4BA2E1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786865062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ERiAelTtwQfC6ltu7cWVIwuZ86/qgG50wp5O3sqH0HU=; b=MvD91ZqFGDdKFJAqwf+8WxyWsa/iOwaXqo3vF/y+7pF6Q6y4KYUlC1aSFww/RSBx8EwUPx /nq2Sc5qmJj+ZSaa5XmZUP8zok/q/XTDMmkq3B1YiBXLzWlm591p3rpjOMfTwlZ6P21qnd hshXnvnK431zRs6OEXFbZt25VV6TeXc= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-357-z2-Ie2CYOOegsVIphRnmGQ-1; Sun, 16 Aug 2026 03:24:19 -0400 X-MC-Unique: z2-Ie2CYOOegsVIphRnmGQ-1 X-Mimecast-MFC-AGG-ID: z2-Ie2CYOOegsVIphRnmGQ_1786865057 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 765F219560B5; Sun, 16 Aug 2026 07:24:17 +0000 (UTC) Received: from f44-mesa-1 (unknown [10.22.88.13]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BF518197750F; Sun, 16 Aug 2026 07:24:14 +0000 (UTC) Date: Sun, 16 Aug 2026 00:24:12 -0700 From: Kevin Buettner To: Muhammad Kamran Cc: gdb-patches@sourceware.org, Wilco Dijkstra , Yury Khrustalev , Thiago Jung Bauermann , Adhemerval Zanella Netto , Carlos O'Donell , "Simon Marchi" , Andrew Burgess Subject: Re: [PATCH v5 0/2] gdb: Fix internal inferior calls through GNU IFUNCs Message-ID: <20260816002317.2a44f116@f44-mesa-1> In-Reply-To: <20260811131219.510776-1-muhammad.kamran@arm.com> References: <20260811131219.510776-1-muhammad.kamran@arm.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: OpZ1XH5XXEMSg1wBaiXA5h23ZdOMIfYaNc_-T67f7iw_1786865057 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII 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 On Tue, 11 Aug 2026 13:12:17 +0000 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 v4: > * Address feedback from Andrew Burgess . > > 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. Andrew gave conditional approval for both parts in his v4 replies. I've looked over this v5 series; IMO, you've completely addressed his concerns. Therefore, I think you can consider this version approved; but do add Andrew's Approved-By tag. If you need a maintainer to push it for you, I'll be happy to do that. Reviewed-By: Kevin Buettner