Lazy linking issues

David Huggins-Daines dhd@linuxcare.com
26 Sep 2000 10:26:37 -0400


Alan Modra <alan@linuxcare.com.au> writes:

> On Tue, 26 Sep 2000, Alan Modra wrote:
> 
> > Code at the start of the .plt looks like:
> > 	b,l	1f,%r26
> > 	depi	0,31,2,%r26
> > 1:	addil	LD'_GLOBAL_OFFSET_TABLE_ + 8 - ($PIC_pcrel$0 - 8),%r26
> > 	ldwm	RD'_GLOBAL_OFFSET_TABLE_ + 8 - ($PIC_pcrel$0 - 12)(%r1),%r26
> > 	copy	%r19,%r25
> > 	ldw	4(%r1),%r19
> > 	bv	%r0(%r26)
> > 	ldw	-4(%r1),%r26
> 
> That's all a bit silly.  How come no-one noticed and told me how foolish 
> I am?  We can't trash the arg registers willy-nilly.

Probably because I was asleep :)

> I'm going for a stub at the end of the .plt, with .plt and .got guaranteed
> to be glued together.  The fixup fptr will be immediately after the stub
> at the end of the .plt, ie. at got[-2] istead of got[2].

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.

-- 
dhd@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.