Author: kib
Date: Tue Jan 25 21:04:55 2011
New Revision: 217849
URL: http://svn.freebsd.org/changeset/base/217849

Log:
  Fix get_program_var_addr() when type of the resolved symbol is functional.
  Use make_function_pointer then, otherwise ia64 is broken.
  
  Reported and tested by:       marcel

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c        Tue Jan 25 20:59:47 2011        
(r217848)
+++ head/libexec/rtld-elf/rtld.c        Tue Jan 25 21:04:55 2011        
(r217849)
@@ -2800,7 +2800,12 @@ get_program_var_addr(const char *name, R
     donelist_init(&donelist);
     if (symlook_global(&req, &donelist) != 0)
        return (NULL);
-    return ((const void **)(req.defobj_out->relocbase + 
req.sym_out->st_value));
+    if (ELF_ST_TYPE(req.sym_out->st_info) == STT_FUNC)
+       return ((const void **)make_function_pointer(req.sym_out,
+         req.defobj_out));
+    else
+       return ((const void **)(req.defobj_out->relocbase +
+         req.sym_out->st_value));
 }
 
 /*
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to