This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: PR libc/10087: STT_GNU_IFUNC handling doesn't work withfunction descriptor
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 24 Apr 2009 15:48:32 -0700
- Subject: PATCH: PR libc/10087: STT_GNU_IFUNC handling doesn't work withfunction descriptor
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
dl-runtime.c has
if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
0))
value = ((DL_FIXUP_VALUE_TYPE (*) (void)) value) ();
The type of value is DL_FIXUP_VALUE_TYPE, which may be struct fdesc.
We need to use DL_FIXUP_VALUE_ADDR to get the address of value.
H.J.
----
2009-04-24 H.J. Lu <hongjiu.lu@intel.com>
PR libc/10087
* elf/dl-runtime.c (_dl_fixup): Use DL_FIXUP_VALUE_ADDR when
calling value.
(_dl_profile_fixup): Likewise.
Index: elf/dl-runtime.c
===================================================================
--- elf/dl-runtime.c (revision 5746)
+++ elf/dl-runtime.c (working copy)
@@ -137,7 +137,8 @@ _dl_fixup (
value = elf_machine_plt_value (l, reloc, value);
if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0))
- value = ((DL_FIXUP_VALUE_TYPE (*) (void)) value) ();
+ value = ((DL_FIXUP_VALUE_TYPE (*) (void))
+ DL_FIXUP_VALUE_ADDR (value)) ();
/* Finally, fix up the plt itself. */
if (__builtin_expect (GLRO(dl_bind_not), 0))
@@ -225,7 +226,8 @@ _dl_profile_fixup (
if (__builtin_expect (ELFW(ST_TYPE) (defsym->st_info)
== STT_GNU_IFUNC, 0))
- value = ((DL_FIXUP_VALUE_TYPE (*) (void)) value) ();
+ value = ((DL_FIXUP_VALUE_TYPE (*) (void))
+ DL_FIXUP_VALUE_ADDR (value)) ();
}
else
{
@@ -235,7 +237,8 @@ _dl_profile_fixup (
if (__builtin_expect (ELFW(ST_TYPE) (refsym->st_info)
== STT_GNU_IFUNC, 0))
- value = ((DL_FIXUP_VALUE_TYPE (*) (void)) value) ();
+ value = ((DL_FIXUP_VALUE_TYPE (*) (void))
+ DL_FIXUP_VALUE_ADDR (value)) ();
result = l;
}