From owner-svn-src-head@FreeBSD.ORG Tue Aug 13 20:57:39 2013 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 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E01633B1; Tue, 13 Aug 2013 20:57:39 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E6D624D3; Tue, 13 Aug 2013 20:57:39 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id B4472358C67; Tue, 13 Aug 2013 22:57:36 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 90B3828494; Tue, 13 Aug 2013 22:57:36 +0200 (CEST) Date: Tue, 13 Aug 2013 22:57:36 +0200 From: Jilles Tjoelker To: David Chisnall Subject: Re: svn commit: r253802 - head/contrib/llvm/tools/clang/lib/Headers Message-ID: <20130813205736.GA68244@stack.nl> References: <201307301233.r6UCXLT8012177@svn.freebsd.org> <2DE35C45-B110-4D93-BFA7-542A3D1EE902@freebsd.org> <20130807205653.GB4918@stack.nl> <46BC9A7E-4AF1-4BE9-9902-3578BDE0CD56@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46BC9A7E-4AF1-4BE9-9902-3578BDE0CD56@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@FreeBSD.org" , Matthew Fleming , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" , Dimitry Andric X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 13 Aug 2013 20:57:40 -0000 On Thu, Aug 08, 2013 at 09:37:02AM +0100, David Chisnall wrote: > On 7 Aug 2013, at 21:56, Jilles Tjoelker wrote: > > The code_model stuff is not for x32 support but for PIC/PIE code where > > code+data exceed 2GB so relative addressing cannot always be used. The > > ABI then prescribes that %r15 be loaded with the GOT pointer when > > invoking a large model (code>2GB) PLT entry; otherwise (medium model or > > no PLT entry used), much like i386, any register can be used for the GOT > > pointer. > Does our rtld provide support for this? We recently encountered a > problem with the new LLVM JIT because FreeBSD's mmap() does not > provide a way of requesting memory that is below the 2GB line and so > we can't use the small code model. Our rtld does not seem to support the large PLT layout, but the regular layout may (should) be used if the PLT can reach the GOT via relative (<=2GB) addressing. This should be the case unless very many symbols are used. I think it is more likely to encounter problems with ld. Support for the larger models may have been added later. Given that JIT is for performance and larger addresses increase code size and register pressure, the mmap() flag is probably useful. Alternatively, all the JITted code could be placed in one block and use relative addressing. -- Jilles Tjoelker