NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: gprof SEGV issue for GCC-4.5.X toolchain.



On Jun 27, 2011, at 2:56 AM, amol pise wrote:

> Dear All,
> 
> I have build the NetBSD-5.1 library by compiling it for ARMv7a (Cortex
> architecture)
> using the GNU GCC-4.5 toolchain.
> 
> Now when I tried to build a sample scenario "hello.c" with profiling
> options "-pg" for gprof analysis.
> Now the new implementation uses "__gnu_mcount_nc".
> So the solution to resolve this issue is to add this new profiling
> hook "__gnu_mcount_nc" into NetBSD library.

Well, first of all, NetBSD doesn't use EABI.  That ABI derives from bpabi.h 
which isn't used by arm*-*-netbsdelf*.  So you've built the wrong compiler to 
use with NetBSD.

The profile ABI changed significantly for bpabi.  In fact, NetBSD has its own 
version of the profil call:

/* NetBSD does its profiling differently to the Acorn compiler. We
   don't need a word following the mcount call; and to skip it
   requires either an assembly stub or use of fomit-frame-pointer when
   compiling the profiling functions.  Since we break Acorn CC
   compatibility below a little more won't hurt.  */

#undef  ARM_FUNCTION_PROFILER
#define ARM_FUNCTION_PROFILER(STREAM,LABELNO)                               \
{                                                                           \
  fprintf(STREAM, "\tmov\t%sip, %slr\n", REGISTER_PREFIX, REGISTER_PREFIX); \
  fprintf(STREAM, "\tbl\tmcount\n");                                        \
}




Home | Main Index | Thread Index | Old Index