Discussion:
[Bug symtab/23749] New: Symbol resolves to ifunc resolver for local functions
keiths at redhat dot com
2018-10-08 20:07:54 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23749

Bug ID: 23749
Summary: Symbol resolves to ifunc resolver for local functions
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: symtab
Assignee: unassigned at sourceware dot org
Reporter: keiths at redhat dot com
Target Milestone: ---

GDB is currently not doing ifunc resolving properly for static functions.

This can be demonstrated with the C++ compile test suite
(gdb.compile/compile-cplus*.exp), in which a lot of tests are failing because
the address of memcpy being passed to the compiler plug-in is actually the
ifunc resolver function.

This happens because the (minimal) symbol for memcpy is not marked as an ifunc:

[from elread.c:elf_symtab_read]

else if (sym->section->flags & SEC_CODE)
{
if (sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE))
{
if (sym->flags & BSF_GNU_INDIRECT_FUNCTION)
ms_type = mst_text_gnu_ifunc;
else
ms_type = mst_text;
}

The resolver function has flags BSF_LOCAL|BSF_GNU_INDIRECT_FUNCTION.
Consequently, it is never noted as an indirect function, and GDB never attempts
to find the "real" symbol.

It may be necessary to add mst_file_text_gnu_ifunc minsym type.
--
You are receiving this mail because:
You are on the CC list for the bug.
sergiodj at redhat dot com
2018-10-10 19:38:23 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23749

Sergio Durigan Junior <sergiodj at redhat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |sergiodj at redhat dot com
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...