Mips profiling
Kris Warkentin
kewarken@qnx.com
Fri Mar 22 09:10:00 GMT 2002
Thank you very much - everything works fine now. Our _mcount() wasn't
handling the stack properly and was failing to protect some of the registers
it needed to.
cheers,
Kris
----- Original Message -----
From: "Daniel Jacobowitz" <drow@mvista.com>
To: "Kris Warkentin" <kewarken@qnx.com>
Cc: <gcc@gcc.gnu.org>
Sent: Thursday, March 21, 2002 5:48 PM
Subject: Re: Mips profiling
> On Thu, Mar 21, 2002 at 05:34:52PM -0500, Kris Warkentin wrote:
> > Is this the one you're talking about? I had already seen your patch to
take
> > the .set noreorder off - I guess this one went in at the same time. Now
I'm
> > wondering if your mcount works the same way - we have a architecture
> > dependent _mcount() stub for x86, mips, sh, arm and ppc which basically
> > calculates the arguments and calls the generic mcount(). Thank you for
> > explaining the calling conventions to mcount earlier - that might help
me
> > iron out some of the issues I'm having with getting sh working as well.
> > I've only been looking at profiling (and mips/sh4 assembly) for a week
or
> > two now so I'm still mostly wallowing in ignorance.
>
> It won't help you with SH. It's a MIPS-only convention (thankfully;
> it's gross enough).
>
> > > RCS file: /cvs/gcc/gcc/gcc/config/mips/linux.h,v
> > > retrieving revision 1.33
> > > diff -u -r1.33 linux.h
> > > --- linux.h 2001/11/19 11:28:52 1.33
> > > +++ linux.h 2002/01/17 00:59:53
> > > @@ -283,3 +283,9 @@
> > > /* Tell function_prologue in mips.c that we have already output the
> > .ent/.end
> > > pseudo-ops. */
> > > #define FUNCTION_NAME_ALREADY_DECLARED
> > > +
> > > +/* The glibc _mcount stub will save $v0 for us. Don't mess with
saving
> > > + it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in
the
> > > + presence of $gp-relative calls. */
> > > +#undef ASM_OUTPUT_REG_PUSH
> > > +#undef ASM_OUTPUT_REG_POP
> > > Index: mips.h
>
> Yes, that's it. If you compile userspace code as PIC you are
> definitely going to need this (and the corresponding mcount saves).
>
> --
> Daniel Jacobowitz Carnegie Mellon University
> MontaVista Software Debian GNU/Linux Developer
>
More information about the Gcc
mailing list