gprof's broken in 7-CURRENT
luoqi at FreeBSD.org
Wed Nov 28 15:22:50 PST 2007
> Luoqi Chen wrote:
> > Has anyone else noticed that gprof no longer works with gcc 4.2
> It's a known bug (very irritating!), but I think noone is working on it
> so it won't be fixed in 7.0.
In that case, I'll fix it.
I've looked at glibc's code, it claims that mcount cannot clobber any register.
I don't know if there is a standard for mcount interface, but I guess the gcc
team would use the glibc implementation as the reference. I'll change our code
to do the same.
/* We need a special version of the `mcount' function since for ix86 it
must not clobber any register. This has several reasons:
- there is a bug in gcc as of version 188.8.131.52 which prohibits the
use of profiling together with nested functions
- the ELF `fixup' function uses GCC's regparm feature
- some (future) systems might want to pass parameters in registers. */
/* Save the caller-clobbered registers. */
movl 12(%esp), %edx
movl 4(%ebp), %eax
/* No need to access the PLT or GOT, __mcount_internal is an
internal function and we can make a relative call. */
/* Pop the saved registers. Please note that `mcount' has no
return value. */
More information about the freebsd-current