From: Joerg Sonnenberger via llvm-dev <llvm-dev@lists.llvm.org>
To: llvm-dev@lists.llvm.org
Subject: Re: [llvm-dev] PIC and mcmodel=large on x86 doesn't use any
relocations
> The idea to make this all work on x86-64 is to use the address of a
> routine's PLT as its "address" in all cases. By putting the PLT in
> 32-bit address space, some ancient BASIC or Fortran program can
> continue to use an INTEGER*4 to hold a routine's "address" and pass
it
> around. Of course, our PLTs won't be actual dynamic loading code but
> just trampolines to the 64-bit code. The PLTs provide a consistent
> "address of routine" for pointer comparisons, etc just like the
> "primary function descriptor" on Itanium.That's effectively how the main binary works for dynamically linked
non-PIE x86_64 code in the default code model. It creates some problems
for protected symbols and involves the nasty copy relocations, but
nothing so far seems to require the large code model, at least in the
sense of "GOT and PLT are not addressable with 32bit signed offset"?Joerg
Looking at what I have today on OpenVMS Itanium, I can have code at address
(I'll add a 'dot' in the middle for readability)
0x00000001.00000000
and our short section with static data/FDs is at
0x00000000.00020000
How does the code find the GOT/PLT with only 32-bit %rip addressing?