[ORLinux] ELF relocations for PIC support
Jonas Bonn
jonas at southpole.se
Fri Jun 17 19:04:10 CEST 2011
On Fri, 2011-06-17 at 18:22 +0200, Giuseppe Scrivano wrote:
>
> Hi Jeremy,
>
> thanks for your reply. Some observations:
>
> On 16/06/2011 11:08, Jeremy Bennett wrote:
> > A more fundamental issue is to define the ABI for PIC (you'll see that
> > section in the manual is blank). One thought that the we restrict the
> > GOT to 64KB and shared objects to 128MB, we can reserve r10 to point to
> > the GOT. We also get some very compact sequences for handling the GOT
> > and PLTs.
> I guess the 64KB size depends from the offset that is possible to
> specify to a JUMP instruction. Is the 128MB value related to the same
> reason (number of bytes of the immediate value considering the sign and
> the shift)?
>
I would expect that the 64kB GOT restriction comes from the desire to be
able to load a symbol value via the GOT as a single instruction:
l.ldw r15,r10,<16 bit immediate offset>
where r10 is the GOT register.
The 128MB limit for the shared object size would be that all local jumps
(within the shared object) are doable with a single instruction:
l.j <28 bit signed offset>
But, Jeremy and Joern are the experts here, so I'll leave it to them to
explain this precisely.
/Jonas
More information about the Linux
mailing list