From owner-svn-src-head@FreeBSD.ORG Wed Jul 2 22:04:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DA5B515; Wed, 2 Jul 2014 22:04:13 +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 00EB92715; Wed, 2 Jul 2014 22:04:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62M4CKQ020555; Wed, 2 Jul 2014 22:04:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62M4CEu020553; Wed, 2 Jul 2014 22:04:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407022204.s62M4CEu020553@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 22:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268182 - in head/libexec/rtld-elf: . ia64 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 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: Wed, 02 Jul 2014 22:04:13 -0000 Author: marcel Date: Wed Jul 2 22:04:12 2014 New Revision: 268182 URL: http://svnweb.freebsd.org/changeset/base/268182 Log: Fix r264346 for ia64. We need to allocate memory for the function descriptors in order to relocate RTLD itself. To allocate memory, we need the pagesizes array initialized, but that happens after RTLD is relocated. This ordering is important for amd64, but it's opposite of what ia64 needs. Handle this conflict with the define called RTLD_INIT_PAGESIZES_EARLY. When defined, obtain the page sizes before relocating rtld, otherwise do it after. Modified: head/libexec/rtld-elf/ia64/rtld_machdep.h head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/ia64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/ia64/rtld_machdep.h Wed Jul 2 21:53:34 2014 (r268181) +++ head/libexec/rtld-elf/ia64/rtld_machdep.h Wed Jul 2 22:04:12 2014 (r268182) @@ -69,4 +69,6 @@ extern void *__tls_get_addr(unsigned lon #define RTLD_DEFAULT_STACK_PF_EXEC 0 #define RTLD_DEFAULT_STACK_EXEC 0 +#define RTLD_INIT_PAGESIZES_EARLY 1 + #endif Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Jul 2 21:53:34 2014 (r268181) +++ head/libexec/rtld-elf/rtld.c Wed Jul 2 22:04:12 2014 (r268182) @@ -1802,6 +1802,11 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * const Elf_Dyn *dyn_soname; const Elf_Dyn *dyn_runpath; +#ifdef RTLD_INIT_PAGESIZES_EARLY + /* The page size is required by the dynamic memory allocator. */ + init_pagesizes(aux_info); +#endif + /* * Conjure up an Obj_Entry structure for the dynamic linker. * @@ -1838,8 +1843,10 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * /* Now that non-local variables can be accesses, copy out obj_rtld. */ memcpy(&obj_rtld, &objtmp, sizeof(obj_rtld)); +#ifndef RTLD_INIT_PAGESIZES_EARLY /* The page size is required by the dynamic memory allocator. */ init_pagesizes(aux_info); +#endif if (aux_info[AT_OSRELDATE] != NULL) osreldate = aux_info[AT_OSRELDATE]->a_un.a_val;