[PATCH] Resolve indirect function symbols in dlsym
Andreas Schwab
schwab@redhat.com
Wed Oct 21 13:16:00 GMT 2009
2009-10-21 Andreas Schwab <schwab@redhat.com>
* elf/dl-sym.c (do_sym): Resolve STT_GNU_IFUNC symbols.
diff --git a/elf/dl-sym.c b/elf/dl-sym.c
index 740bb9a..a95c5ef 100644
--- a/elf/dl-sym.c
+++ b/elf/dl-sym.c
@@ -191,6 +191,10 @@ RTLD_NEXT used in code not dynamically loaded"));
#endif
value = DL_SYMBOL_ADDRESS (result, ref);
+ /* Resolve indirect function address. */
+ if (ELFW(ST_TYPE) (ref->st_info) == STT_GNU_IFUNC)
+ value = ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) ();
+
#ifdef SHARED
/* Auditing checkpoint: we have a new binding. Provide the
auditing libraries the possibility to change the value and
--
1.6.5.1
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
More information about the Libc-alpha
mailing list