Add profile support.

Add profile support for ARC processors.

libgloss/
2016-07-28  Claudiu Zissulescu  <claziss@synopsys.com>

	* arc/crt0.S: Add calls to profiler support routines.
	* Makefile.in (CRT0): Add gcrt0.
	(NSIM_OBJS): Add mcount.
	(CRT0_INSTALL): Install gcrt0, and crt0.
	* arc/gcrt0.S: New file.
	* arc/mcount.c: Likewise.
This commit is contained in:
Claudiu Zissulescu
2017-05-23 15:05:48 +02:00
committed by Corinna Vinschen
parent 8eada33223
commit 8c8b25e388
4 changed files with 527 additions and 8 deletions

View File

@@ -194,6 +194,13 @@ __start:
#else
bl @_init
#endif /* __ARCEM__ || __ARCHS__ */
#ifdef PROFILE_SUPPORT /* Defined in gcrt0.S. */
mov r0,@__start
mov r1,@_etext
jl @_monstartup
#endif /* PROFILE_SUPPORT */
mov_s r0, r13
mov_s r1, r14
; branch to main
@@ -204,6 +211,13 @@ __start:
bl.d @main
mov fp, 0 ; initialize frame pointer
#endif /* __ARCEM__ || __ARCHS__ */
#ifdef PROFILE_SUPPORT
mov r13, r0 ; Save return code
jl @_mcleanup
mov r0, r13
#endif /* PROFILE_SUPPORT */
; r0 contains exit code
j @exit