This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch 0/7] STT_GNU_IFUNC support
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Sat, 19 Mar 2011 22:14:41 +0100
- Subject: [patch 0/7] STT_GNU_IFUNC support
Hi,
the first post here was:
[patch] STT_GNU_IFUNC support
http://sourceware.org/ml/gdb-patches/2010-02/msg00354.html
this is a rework based on the comments therein.
STT_GNU_IFUNC is present in some distributions - at least Fedora ones - since
2009.
$ nm --dynamic /lib64/libc.so.6 |grep strcmp
0000000000080df0 i strcmp
^
Such functions return address of the real function to be executed, typically
depending on the CPU type. FSF GDB without the STT_GNU_IFUNC support will
display the resolved/target function address instead of the real strcmp return
value.
GNU gdb (GDB) 7.2.50.20110317-cvs
(gdb) p strcmp ("","")
$1 = -163217696
(gdb) p/x ((void *(*)()) strcmp) ("","")
$2 = 0x7ffff6457ee0
(gdb) info sym $
__strcmp_sse42 in section .text of /lib64/libc.so.6
There is no standard for DWARF type information for full symbols for the
GNU-IFUNC functions, there is only STT_GNU_IFUNC for the minimal/ELF symbols.
(Still GDB sometimes internally needs to know about the full symbols and they
get converted from minimal symbols.)
Thanks,
Jan