about summary refs log tree commit diff
path: root/elf/dl-sym.c
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2009-11-06 09:30:56 -0800
committerUlrich Drepper <drepper@redhat.com>2009-11-06 09:30:56 -0800
commit8608ae1f7ba31f2149f9620a1339020339eac00d (patch)
treef5e43d7d064da86a766fa86e4d5133cb4460d360 /elf/dl-sym.c
parent5b55d23611e939340d658f42212c474c8188053e (diff)
downloadglibc-8608ae1f7ba31f2149f9620a1339020339eac00d.tar.gz
glibc-8608ae1f7ba31f2149f9620a1339020339eac00d.tar.xz
glibc-8608ae1f7ba31f2149f9620a1339020339eac00d.zip
Properly handle STT_GNU_IFUNC symbols in do_sym.
do_sym should use DL_FIXUP_VALUE_XXX macros to call IFUNC function.
Otherwise, it won't compile on ia64. This patch fixes it and adds
a test.
Diffstat (limited to 'elf/dl-sym.c')
-rw-r--r--elf/dl-sym.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/elf/dl-sym.c b/elf/dl-sym.c
index 459729f0f2..0fa3b3ae47 100644
--- a/elf/dl-sym.c
+++ b/elf/dl-sym.c
@@ -193,8 +193,13 @@ RTLD_NEXT used in code not dynamically loaded"));
 
       /* 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)) ();
+	{
+	  DL_FIXUP_VALUE_TYPE fixup
+	    = DL_FIXUP_MAKE_VALUE (result, (ElfW(Addr)) value);
+	  fixup = 
+	    ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (fixup)) ();
+	  value = (void *) DL_FIXUP_VALUE_CODE_ADDR (fixup);
+	}
 
 #ifdef SHARED
       /* Auditing checkpoint: we have a new binding.  Provide the