linux-mips
[Top] [All Lists]

Re: understanding elf_machine_load_address

To: Daniel Jacobowitz <dan@debian.org>
Subject: Re: understanding elf_machine_load_address
From: Andreas Jaeger <aj@suse.de>
Date: Sat, 08 Dec 2001 20:42:32 +0100
Cc: Guido Guenther <guido.guenther@gmx.net>, linux-mips@oss.sgi.com
In-reply-to: <20011208114713.A20432@nevyn.them.org> (Daniel Jacobowitz's message of "Sat, 8 Dec 2001 11:47:13 -0500")
Mail-copies-to: never
References: <20011208141141.GA11437@bogon.ms20.nix> <u8n10tg2oy.fsf@gromit.moeb> <20011208114713.A20432@nevyn.them.org>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.4 (Artificial Intelligence, i386-suse-linux)
Daniel Jacobowitz <dan@debian.org> writes:

> On Sat, Dec 08, 2001 at 04:18:53PM +0100, Andreas Jaeger wrote:
>> >        "   bltzal $0, here\n"
>> >        "   nop\n"
>> >        "here:      subu %0, $31, %0\n"
>> 
>> Subtract shared address of "here" from address of "here" at build time
>> - and you know at which address byte 0 of the shared library is
>>   loaded.
>
> Wait a second.  Does bltzal fill in $31 even on a not-taken branch? 
> Because bltzal $0 should never be taken.  My handy MIPS reference and
> SPIM seem to agree that it won't fill in $31.

That's what I've asked myself also when fixing the dynamic linker.
But Ralf convinced me that $31 will get filled in (and I verified that
it did) - otherwise the dynamic linker would not work on any system at
all.

But it might be worth checking if Guido notices a problem.

Btw. could anybody send me a patch documenting this instruction so
that next time everybody knows directly what's going on?

Thanks,
Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

<Prev in Thread] Current Thread [Next in Thread>