Date: Tue, 13 Aug 2013 22:57:36 +0200 From: Jilles Tjoelker <jilles@stack.nl> To: David Chisnall <theraven@FreeBSD.org> Cc: "svn-src-head@FreeBSD.org" <svn-src-head@FreeBSD.org>, Matthew Fleming <mdf@FreeBSD.org>, "svn-src-all@FreeBSD.org" <svn-src-all@FreeBSD.org>, "src-committers@FreeBSD.org" <src-committers@FreeBSD.org>, Dimitry Andric <dim@FreeBSD.org> Subject: Re: svn commit: r253802 - head/contrib/llvm/tools/clang/lib/Headers Message-ID: <20130813205736.GA68244@stack.nl> In-Reply-To: <46BC9A7E-4AF1-4BE9-9902-3578BDE0CD56@FreeBSD.org> References: <201307301233.r6UCXLT8012177@svn.freebsd.org> <CAMBSHm8xDvWsKJiLAzPF8azMKLHq3WWWQ3X1d6-6nJSAppux9Q@mail.gmail.com> <2DE35C45-B110-4D93-BFA7-542A3D1EE902@freebsd.org> <20130807205653.GB4918@stack.nl> <46BC9A7E-4AF1-4BE9-9902-3578BDE0CD56@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 08, 2013 at 09:37:02AM +0100, David Chisnall wrote: > On 7 Aug 2013, at 21:56, Jilles Tjoelker <jilles@stack.nl> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130813205736.GA68244>