[Bug gdb/34330] GDB does not resolve GNU ifunc in inferior

"cvs-commit at gcc dot gnu.org via Gdb-prs" <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34330

--- Comment #7 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The gdb-18-branch branch has been updated by Andrew Burgess
<[email protected]>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8f39b11736558b6d63b8950e91bd9dbdf08490b1

commit 8f39b11736558b6d63b8950e91bd9dbdf08490b1
Author: Muhammad Kamran <[email protected]>
Date:   Tue Aug 11 13:12:18 2026 +0000

    gdb: Preserve IFUNC marker when finding inferior functions

    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
    Reviewed-By: Kevin Buettner <[email protected]>
    Approved-By: Andrew Burgess <[email protected]>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.