This is the mail archive of the 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: ARM: Imply frame pointer for arm-linux profiling

On Wed, May 11, 2005 at 01:57:40PM +0100, Richard Earnshaw wrote:
> On Wed, 2005-05-11 at 13:44, Daniel Jacobowitz wrote:
> > The arm-linux invocation of mcount does not pass the old value of lr in ip,
> > the way the arm-elf or arm-netbsd implementations do.  Instead the profiler
> > grubs around in its caller's stack frame to find the saved lr.  Gross, but
> > nothing we can do about it now.  This patch makes sure to create a frame
> > if emitting the call to mcount.  It fixes nest.c and 20021014-1.c in gcc.dg
> > for arm-linux.  OK for HEAD?
> > 
> The arm/linux compiler hasn't used a frame pointer for approximately
> forever.  That was a decision taken by the linux developers long ago. 
> IMO if their mcount can't cope with that, then it's their mcount
> implementation that's broken not the compiler.  However, for the old
> ABI, I really don't care very much (but see below).

What would you recommend?  The problem with the ip-based version is
that it means you can't go through a PLT on the way to mcount - for
this reason I suspect the netbsd-elf implementation is a little quirky. 
I suppose we could require the runtime library implementation to
provide an entry point for mcount which will not pass through the PLT,
which does appropriate register saving.  Alternatively, force GCC to
save/restore r3 if it is live on function entry.

I can expose the new interface under a different function name, for
both ABIs; then new GCCs will require new glibc, but existing compilers
will continue to work for the old ABI.

Daniel Jacobowitz
CodeSourcery, LLC

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