svn commit: r253802 - head/contrib/llvm/tools/clang/lib/Headers

Jilles Tjoelker jilles at stack.nl
Tue Aug 13 20:57:40 UTC 2013


On Thu, Aug 08, 2013 at 09:37:02AM +0100, David Chisnall wrote:
> On 7 Aug 2013, at 21:56, Jilles Tjoelker <jilles at 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


More information about the svn-src-all mailing list