----------------------------------------------------------------------------------------------------------------------------
1. modify gw1ns4c_flash.ld

   ****************************************************************************
   FLASH (rx) : ORIGIN = 0x0,        LENGTH = 0x7FFFFF
   RAM (rwx)  : ORIGIN = 0x20000000, LENGTH = 0x1FFFF

   PROVIDE( _text = ADDR(.text) );
   ****************************************************************************

----------------------------------------------------------------------------------------------------------------------------
2. modify startup_gw1ns4c.S

   ****************************************************************************
    //.section .stack
    //.align 3
   .thumb_func
   .align 2
   .globl __gnu_mcount_nc
   .type __gnu_mcount_nc, %function


   __gnu_mcount_nc:
   /* This function gets called at the entry of each called (callee) function.
      It records the caller (who is calling the callee) and the callee (which gets called by the caller).
    */

   #if 0 /* dummy version, doing nothing */
     mov    ip, lr
     pop    { lr }
     bx     ip
   #else
     push {r0, r1, r2, r3, lr}     /* save registers */
     bic r1, lr, #1                /* R1 contains callee address, with thumb bit cleared */
     ldr r0, [sp, #20]             /* R0 contains caller address */
     bic r0, r0, #1                /* clear thumb bit */
     bl _mcount          /* jump to internal _mcount() implementation */
     pop {r0, r1, r2, r3, ip, lr}  /* restore saved registers */
     bx ip                         /* return to callee */
   #endif

   ****************************************************************************
----------------------------------------------------------------------------------------------------------------------------
3. add files "gmon.c, gmon.h, profile.c, profile.h"

----------------------------------------------------------------------------------------------------------------------------
4. add some codes in application

   ****************************************************************************
   SysTick_Config(1500);

   _mcleanup(2);
   ****************************************************************************

----------------------------------------------------------------------------------------------------------------------------
5. If you want to profile which file, please set this file only, "-pg".

   Properties > C/C++ Build > Settings > Tool Settings > GNU Arm Cross C Compiler > Miscellaneous > Ohter compiler flags
   -pg

----------------------------------------------------------------------------------------------------------------------------
6. used in QEMU.

----------------------------------------------------------------------------------------------------------------------------