This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: powerpc new PLT and GOT
On Wed, May 11, 2005 at 10:37:47PM -0700, Richard Henderson wrote:
> If the program does in fact use different got registers, then there
> will have to be more than one PLTresolve.
Not if the plt call stubs are modified to copy their got pointer to,
say, r12. Or better, if PLTresolve loads its own got pointer, like
this:
PLTresolve:
addis 11,11,(got-plt)@ha
addi 11,11,(got-plt)@l
mflr 0
bcl 20,31,1f
1: mflr 12
addis 12,12,(got-1b)@ha
addi 12,12,(got-1b)@l # r12 = _GLOBAL_OFFSET_TABLE_
mtlr 0
sub 11,11,12 # r11 = index * 4
add 0,11,11
add 11,0,11 # r11 = index * 12 = reloc offset.
lwz 0,4(12) # got[1] address of dl_runtime_resolve
mtctr 0
lwz 12,8(12) # got[2] contains the map address
bctr
> At which point it doesn't
> make sense to have DT_PPC_GLINK pick out any one of them. I suggest
> simply setting this entry to 1, as with DT_TEXTREL.
I agree however that the dynamic linker doesn't need to know where
Pltresolve is, so any non-zero value in DT_PPC_GLINK will do. (It did
need to know when I was still considering a BSS PLT.)
--
Alan Modra
IBM OzLabs - Linux Technology Centre