summary refs log tree commit diff
path: root/elf/dl-sym.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2009-10-21 06:23:42 -0700
committerUlrich Drepper <drepper@redhat.com>2009-10-21 06:23:42 -0700
commitbc5e8462188bdd9919e804fbba44e4b983b7724a (patch)
treea1c40bc8897a1186452fd80b91f0b3cf7561cb7e /elf/dl-sym.c
parentb7805d0ba8948fcf5e406bf52530d9aba99f5954 (diff)
downloadglibc-bc5e8462188bdd9919e804fbba44e4b983b7724a.tar.gz
glibc-bc5e8462188bdd9919e804fbba44e4b983b7724a.tar.xz
glibc-bc5e8462188bdd9919e804fbba44e4b983b7724a.zip
Handle IFUNC symbols in dlsym.
Diffstat (limited to 'elf/dl-sym.c')
-rw-r--r--elf/dl-sym.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/elf/dl-sym.c b/elf/dl-sym.c
index 740bb9a892..459729f0f2 100644
--- a/elf/dl-sym.c
+++ b/elf/dl-sym.c
@@ -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