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

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

   PROVIDE_HIDDEN (__init_array_start = .);
   KEEP (*(SORT(.init_array.*)))
   KEEP (*(.init_array*))
   PROVIDE_HIDDEN (__init_array_end = .);
   ****************************************************************************

----------------------------------------------------------------------------------------------------------------------------
2. add a file "gcov.c"

----------------------------------------------------------------------------------------------------------------------------
3. add some codes in application

   ****************************************************************************
   extern long gcov_collect(unsigned long interface);

   gcov_collect(2);

   gcov_init();

   void gcov_init(void)
   {
     void (**p)(void);
     extern uint32_t __init_array_start, __init_array_end; /* linker defined symbols, array of function pointers */
     uint32_t beg = (uint32_t)&__init_array_start;
     uint32_t end = (uint32_t)&__init_array_end;

     while(beg<end)
     {
       p = (void(**)(void))beg; /* get function pointer */
       (*p)(); /* call constructor */
       beg += sizeof(p); /* next pointer */
     }
   }
   ****************************************************************************

----------------------------------------------------------------------------------------------------------------------------
4. If you want to profile which file, please set this file only, "-coverage".

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

----------------------------------------------------------------------------------------------------------------------------
5. used in QEMU.

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