[patch 0/7] STT_GNU_IFUNC support

Jan Kratochvil jan.kratochvil@redhat.com
Sat Mar 19 21:15:00 GMT 2011


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



More information about the Gdb-patches mailing list