From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 16:22:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6952897F; Tue, 2 Dec 2014 16:22:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55802E63; Tue, 2 Dec 2014 16:22:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2GM995008535; Tue, 2 Dec 2014 16:22:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2GM9j4008534; Tue, 2 Dec 2014 16:22:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412021622.sB2GM9j4008534@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 2 Dec 2014 16:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275412 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 16:22:09 -0000 Author: jhb Date: Tue Dec 2 16:22:08 2014 New Revision: 275412 URL: https://svnweb.freebsd.org/changeset/base/275412 Log: The runtime linker needs to include a path to itself in the link map it exports to the debugger. It currently has two choices: it can use a compiled-in path (/libexec/ld-elf.so.1) or it can use the path stored in the interpreter path in the binary being executed. The runtime linker currently prefers the second. However, this is usually wrong for compat32 binaries since the binary specifies the path of rtld on a 32-bit system (/libexec/ld-elf.so.1) instead of the actual path (/libexec/ld-elf32.so.1). For now, always assume the compiled in path (/libexec/ld-elf32.so.1) as the rtld path and ignore the path in the binary for the 32-bit runtime linker. Differential Revision: https://reviews.freebsd.org/D1236 Reviewed by: kib Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Dec 2 14:48:21 2014 (r275411) +++ head/libexec/rtld-elf/rtld.c Tue Dec 2 16:22:08 2014 (r275412) @@ -503,6 +503,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ aux_info[AT_STACKPROT]->a_un.a_val != 0) stack_prot = aux_info[AT_STACKPROT]->a_un.a_val; +#ifndef COMPAT_32BIT /* * Get the actual dynamic linker pathname from the executable if * possible. (It should always be possible.) That ensures that @@ -515,6 +516,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ obj_rtld.path = xstrdup(obj_main->interp); __progname = obj_rtld.path; } +#endif digest_dynamic(obj_main, 0); dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d",