Handle IFUNC symbols in dlsym.
authorAndreas Schwab <schwab@redhat.com>
Wed, 21 Oct 2009 13:23:42 +0000 (06:23 -0700)
committerUlrich Drepper <drepper@redhat.com>
Wed, 21 Oct 2009 13:23:42 +0000 (06:23 -0700)
ChangeLog
elf/dl-sym.c

index 2857d88..ccbb625 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-10-21  Andreas Schwab  <schwab@redhat.com>
+
+       * elf/dl-sym.c (do_sym): Resolve STT_GNU_IFUNC symbols.
+
 2009-10-19  Andreas Schwab  <schwab@redhat.com>
 
        * include/math.h: Add hidden protos for __exp/__expf/__expl.
index 740bb9a..459729f 100644 (file)
@@ -191,6 +191,11 @@ RTLD_NEXT used in code not dynamically loaded"));
 #endif
        value = DL_SYMBOL_ADDRESS (result, ref);
 
+      /* Resolve indirect function address.  */
+      if (__builtin_expect (ELFW(ST_TYPE) (ref->st_info) == STT_GNU_IFUNC, 0))
+       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