diff options
author | kib <kib@FreeBSD.org> | 2011-01-25 21:04:55 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2011-01-25 21:04:55 +0000 |
commit | b902a8a1767c4005becfcbfd51997125a1f92968 (patch) | |
tree | 2f8d3885f7b804174faa802a7321eb7d4058406b | |
parent | a123f0aac0bbca03e1fcd5bf754b1ba29df2f5e9 (diff) | |
download | FreeBSD-src-b902a8a1767c4005becfcbfd51997125a1f92968.zip FreeBSD-src-b902a8a1767c4005becfcbfd51997125a1f92968.tar.gz |
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
-rw-r--r-- | libexec/rtld-elf/rtld.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index a39a90c..8acbdc5 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -2800,7 +2800,12 @@ get_program_var_addr(const char *name, RtldLockState *lockstate) 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)); } /* |