Subject: Re: Profiling Weirdness Solved.
To: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
From: J.T. Conklin <jtc@cygnus.com>
List: current-users
Date: 08/30/1994 10:20:22
> > I don't understand the "movl $1b,%eax" that I removed, or the .long 0
> > in the data segement.  %eax is likely to be clobbered by mcount(),
> > and the .long 0 doesn't look like it is ever referenced.
> 
> The "movl $1b,%eax" moves the address of local label 1b - ie, the
> address of that .long 0 that was mystifying you - into %eax.
> Presumably mcount uses this address for something.  (Many UNIX-derived
> assemblers use $ to indicate an immediate operand, what many other
> assemblers use # for.  Confusing, but that's history for you. 

Thanks,

I read the $1b has an immediate operand, and didn't realize it refered
to the address of label 1.  

However, I am still confused by the fact that the %eax is not used by
mcount(), and `gcc -pg' generated code emits .long 0's, but doesn't
reference them at all.  

It's probably just an anachronism.  Probably gcc should be changed to
stop emitting the .long 0's; and the ENTRY() macro in <machine/asm.h>
should be changed to omit the .long 0 and the movl $1b,%eax.

	--jtc

------------------------------------------------------------------------------