[llvm-dev] PIC and mcmodel=large on x86 doesn't use any relocations

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Sat Oct 29 13:36:41 PDT 2016


On Thu, Oct 27, 2016 at 05:12:53PM -0400, John Reagan via llvm-dev wrote:
> I want my GOT, .plt, and other static data to be more than 2GB away from the code.
> Our stack and heap will also live in the bottom 2GB chunk of memory due to VAX
> history.
> 
> No single code segment or data segment will be larger than 2GB however.  So
> branches inside of .text for example (or to other code sections) will fit
> within 2GB.

Actually, it is only GOT and PLT that is really relevant. All the other
data is easy to access via GOT with the same or less overhead than doing
the 64bit movabs dance. Some platforms like PPC allow multiple GOT and
PLT sections to deal with the immediate constraints of the platform.

Given that the PLT has to be executable, there is normally no big
justification for splitting it from the actual code segment. The GOT is
a bit more difficult, but I still don't see why you want to split that
off? The pain is large for mandating that to be separate.

Joerg


More information about the llvm-dev mailing list