Don't use catomic functions in mcount
diff mbox

Message ID mvma9av19u2.fsf@hawking.suse.de
State New
Headers show

Commit Message

Andreas Schwab May 6, 2014, 10:27 a.m. UTC
mcount cannot use catomic function since it is called by
__libc_start_main before TLS is set up.  This reverts the change made by
commit 8099361.

Andreas.

	[BZ #16912]
	* gmon/mcount.c (_MCOUNT_DECL): Use
	atomic_compare_and_exchange_bool_acq instead of
	catomic_compare_and_exchange_bool_acq.
---
 gmon/mcount.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ondřej Bílka May 6, 2014, 12:01 p.m. UTC | #1
On Tue, May 06, 2014 at 12:27:01PM +0200, Andreas Schwab wrote:
> mcount cannot use catomic function since it is called by
> __libc_start_main before TLS is set up.  This reverts the change made by
> commit 8099361.
>
looks ok.
 
> Andreas.
> 
> 	[BZ #16912]
> 	* gmon/mcount.c (_MCOUNT_DECL): Use
> 	atomic_compare_and_exchange_bool_acq instead of
> 	catomic_compare_and_exchange_bool_acq.
> ---
>  gmon/mcount.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gmon/mcount.c b/gmon/mcount.c
> index 0c2acd2..9d4a1a50 100644
> --- a/gmon/mcount.c
> +++ b/gmon/mcount.c
> @@ -69,8 +69,8 @@ _MCOUNT_DECL(frompc, selfpc)	/* _mcount; may be static, inline, etc */
>  	 * check that we are profiling
>  	 * and that we aren't recursively invoked.
>  	 */
> -	if (catomic_compare_and_exchange_bool_acq (&p->state, GMON_PROF_BUSY,
> -						   GMON_PROF_ON))
> +	if (atomic_compare_and_exchange_bool_acq (&p->state, GMON_PROF_BUSY,
> +						  GMON_PROF_ON))
>  	  return;
>  
>  	/*
> -- 
> 1.9.2
> 
> -- 
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."

Patch
diff mbox

diff --git a/gmon/mcount.c b/gmon/mcount.c
index 0c2acd2..9d4a1a50 100644
--- a/gmon/mcount.c
+++ b/gmon/mcount.c
@@ -69,8 +69,8 @@  _MCOUNT_DECL(frompc, selfpc)	/* _mcount; may be static, inline, etc */
 	 * check that we are profiling
 	 * and that we aren't recursively invoked.
 	 */
-	if (catomic_compare_and_exchange_bool_acq (&p->state, GMON_PROF_BUSY,
-						   GMON_PROF_ON))
+	if (atomic_compare_and_exchange_bool_acq (&p->state, GMON_PROF_BUSY,
+						  GMON_PROF_ON))
 	  return;
 
 	/*