All of lore.kernel.org
 help / color / mirror / Atom feed
* understanding elf_machine_load_address
@ 2001-12-08 14:11 Guido Guenther
  2001-12-08 15:18 ` Andreas Jaeger
  0 siblings, 1 reply; 8+ messages in thread
From: Guido Guenther @ 2001-12-08 14:11 UTC (permalink / raw)
  To: linux-mips

Hi,
I'm trying to understand to following snippet from glibc's
sysdeps/mips/dl-machine.h:

elf_machine_load_address (void)
{
  ElfW(Addr) addr;
  asm ("	.set noreorder\n"
       "	la %0, here\n"
       "	bltzal $0, here\n"
       "	nop\n"
       "here:	subu %0, $31, %0\n"
       "	.set reorder\n"
       :	"=r" (addr)
       :	/* No inputs */
       :	"$31");
  return addr;
}

As of my understanding addr is zero since $31-%0 is always
zero(%0 stored (before the subu) the address of 'here', as does $31
after the bltzal). Please beat me with a cluebat.
 -- Guido

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-12-08 22:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-08 14:11 understanding elf_machine_load_address Guido Guenther
2001-12-08 15:18 ` Andreas Jaeger
2001-12-08 16:37   ` Guido Guenther
2001-12-08 16:47   ` Daniel Jacobowitz
2001-12-08 19:42     ` Andreas Jaeger
2001-12-08 20:23       ` Guido Guenther
2001-12-08 20:52     ` Andreas Jaeger
2001-12-08 21:03       ` Daniel Jacobowitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.