This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]