Lazy linking issues

Alan Modra alan@linuxcare.com.au
Wed, 27 Sep 2000 01:45:51 +1100 (EST)


On 26 Sep 2000, David Huggins-Daines wrote:

> Okay.  I suppose I will take the same approach as the Alpha code does,
> and look for a particular instruction at the end of the GOT in
> elf_machine_runtime_setup() as an indication of whether lazy linking
> can be done or not.

Yep.  I'll check in my mods to dl-machine.h in a few minutes after I fix
this silly plt stub.

The plt stub looks like

1:	ldw	0(%r20),%r22
	bv	%r0(%r22)
	ldw	4(%r20),%r21
2:	b,l	1b,%r20
	depi	0,31,2,%r20
9:	.word 0xc0ffee
	.word 0xdeadbeef

with entry at label 2.  The idea here being that the linker can change the
plt stub without magic numbers in the dynamic linker needing to be
changed.  So we jump into the trampoline with r19 = reloc offset,
r20 = got-8, r21 = fixup ltp.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.