[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patches] Re: ARM EABI mcount fix (second try)
- To: Paul Brook <paul@xxxxxxxxxxxxxxxx>
- Subject: [patches] Re: ARM EABI mcount fix (second try)
- From: Daniel Jacobowitz <dan@xxxxxxxxxxxxxxxx>
- Date: Wed, 2 Apr 2008 09:46:41 -0400
On Fri, Mar 28, 2008 at 12:06:03AM +0000, Paul Brook wrote:
> Attached is a second attempt at making gmon profiling work on
> arm-linux-gnueabi. It comprises two parts (in a single file):
>
> - Define a new __gnu_mcount_nc entry point, with an ABI that doesn't require
> the compiler to generate crufty old APCS frames. I'm choosing to define a new
> entry point to preserve backwards compatibility, and to allow for different
> variants as necessary. The "nc" comes from the fact that we do not need to
> pass mcount the location of a counter. Further justification can be found in
> this thread: http://gcc.gnu.org/ml/gcc-patches/2005-05/msg01001.html
>
> - Rewrite the the old _mcount implementation to not rely on particular
> compiler behavior when building glibc itself.
>
> Tested on arm-linux-gnueabi.
Seems fine to me.
Richard commented (in above thread) that __gnu_mcount_nc in that
scheme can not clobber non-core registers. I believe that means
mcount_internal and everything it calls must be compiled with no
VFP, iWMMXt, et cetera. It should only matter if we supported
a hard-VFP / hard-iWMMXt ABI or interprocedural register allocation,
but at least a warning comment about the problem would be nice.
Fortunately mcount_internal only calls
catomic_compare_and_exchange_bool_acq, which will be inlined anyway,
no other functions. So just that file needs special options.
--
Daniel Jacobowitz
CodeSourcery