From ef35586c59f5be2748c893fb97b41c9081919a67 Mon Sep 17 00:00:00 2001 From: kib Date: Sat, 5 May 2012 11:26:08 +0000 Subject: Work around a situation where symlook_obj() could be called for the object for which digest_dynamic1() was not done yet. Just return EINVAL and do not try to dereference NULL buckets hash array. This seems to happen on ia64 for rtld object itself, where the R_IA_64_FPTR64LSB relocations require symbol lookup. The dynamic linker itself does not rely on identity of the C-level function pointers (i.e. function descriptors). Reported and reviewed by: marcel MFC after: 8 days --- libexec/rtld-elf/rtld.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libexec') diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 9276a52..621d084 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -3480,13 +3480,15 @@ symlook_obj(SymLook *req, const Obj_Entry *obj) int flags, res, mres; /* - * There is at least one valid hash at this point, and we prefer to use - * the faster GNU version if available. + * If there is at least one valid hash at this point, we prefer to + * use the faster GNU version if available. */ if (obj->valid_hash_gnu) mres = symlook_obj1_gnu(req, obj); - else + else if (obj->valid_hash_sysv) mres = symlook_obj1_sysv(req, obj); + else + return (EINVAL); if (mres == 0) { if (obj->needed_filtees != NULL) { -- cgit v1.1