From owner-svn-src-all@FreeBSD.ORG Sat May 5 11:26:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E332106564A; Sat, 5 May 2012 11:26:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49A438FC0C; Sat, 5 May 2012 11:26:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q45BQ9g5056207; Sat, 5 May 2012 11:26:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q45BQ9B5056205; Sat, 5 May 2012 11:26:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205051126.q45BQ9B5056205@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 5 May 2012 11:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235054 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 May 2012 11:26:09 -0000 Author: kib Date: Sat May 5 11:26:08 2012 New Revision: 235054 URL: http://svn.freebsd.org/changeset/base/235054 Log: 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 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat May 5 10:05:13 2012 (r235053) +++ head/libexec/rtld-elf/rtld.c Sat May 5 11:26:08 2012 (r235054) @@ -3480,13 +3480,15 @@ symlook_obj(SymLook *req, const Obj_Entr 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) {