This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Resolve indirect function symbols in dlsym


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]