[1/6] PowerPC64, fix calls to _mcount

Message ID 20170601130823.GG8842@bubble.grove.modra.org
State Committed
Delegated to: Tulio Magno Quites Machado Filho
Headers

Commit Message

Alan Modra June 1, 2017, 1:08 p.m. UTC
  The macros used in assembly were broken on powerpc64 ELFv1.

	* sysdeps/powerpc/powerpc64/sysdep.h: (call_mcount_parm_offset): Delete.
	(SAVE_ARG, REST_ARG, CFI_SAVE_ARG): Correct.
  

Comments

Tulio Magno Quites Machado Filho June 12, 2017, 6:07 p.m. UTC | #1
Alan Modra <amodra@gmail.com> writes:

> The macros used in assembly were broken on powerpc64 ELFv1.
>
> 	* sysdeps/powerpc/powerpc64/sysdep.h: (call_mcount_parm_offset): Delete.
> 	(SAVE_ARG, REST_ARG, CFI_SAVE_ARG): Correct.

Looks good to me.
  

Patch

diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h
index db7c1d7..409734a 100644
--- a/sysdeps/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/powerpc/powerpc64/sysdep.h
@@ -58,29 +58,24 @@ 
 #endif
 
 /* Support macros for CALL_MCOUNT.  */
-#if _CALL_ELF == 2
-#define call_mcount_parm_offset (-64)
-#else
-#define call_mcount_parm_offset FRAME_PARM_SAVE
-#endif
 	.macro SAVE_ARG NARG
 	.if \NARG
 	SAVE_ARG \NARG-1
-	std	2+\NARG,call_mcount_parm_offset-8+8*(\NARG)(1)
+	std	2+\NARG,-FRAME_MIN_SIZE_PARM+FRAME_PARM_SAVE-8+8*(\NARG)(1)
 	.endif
 	.endm
 
 	.macro REST_ARG NARG
 	.if \NARG
 	REST_ARG \NARG-1
-	ld	2+\NARG,FRAME_MIN_SIZE_PARM+call_mcount_parm_offset-8+8*(\NARG)(1)
+	ld	2+\NARG,FRAME_PARM_SAVE-8+8*(\NARG)(1)
 	.endif
 	.endm
 
 	.macro CFI_SAVE_ARG NARG
 	.if \NARG
 	CFI_SAVE_ARG \NARG-1
-	cfi_offset(2+\NARG,call_mcount_parm_offset-8+8*(\NARG))
+	cfi_offset(2+\NARG,-FRAME_MIN_SIZE_PARM+FRAME_PARM_SAVE-8+8*(\NARG))
 	.endif
 	.endm