about summary refs log tree commit diff
path: root/sysdeps/x86_64
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2003-05-21 09:25:53 +0000
committerAndreas Jaeger <aj@suse.de>2003-05-21 09:25:53 +0000
commit5018956927ff82b308a8885dcc23dfcddb3ad177 (patch)
treeac1c69dbe5bec98193689e64c4ab9a5fb5ccdfea /sysdeps/x86_64
parent479aa8ecb2e64cb2bd70be3c258d42541d916291 (diff)
downloadglibc-5018956927ff82b308a8885dcc23dfcddb3ad177.tar.gz
glibc-5018956927ff82b308a8885dcc23dfcddb3ad177.tar.xz
glibc-5018956927ff82b308a8885dcc23dfcddb3ad177.zip
* sysdeps/generic/sysdep.h (cfi_offset, cfi_startproc,
cfi_endproc, cfi_def_cfa, cfi_def_ccfa_register, 
cfi_def_cfa_offset, cfi_adjust_cfa_offset, cfi_offset): Define.
	* sysdeps/x86_64/sysdep.h (CALL_MCOUNT): Add cfi directives.
	(ENTRY): Likewise.
	(END): Likewise.

	* configure.in: Test for asm cfi directives.

	* config.h.in: Add HAVE_ASM_CFI_DIRECTIVES.
2003-05-21  Andreas Jaeger  <aj@suse.de>

	* sysdeps/generic/sysdep.h (cfi_offset, cfi_startproc,
	cfi_endproc, cfi_def_cfa, cfi_def_ccfa_register,
	cfi_def_cfa_offset, cfi_adjust_cfa_offset, cfi_offset): Define.

	* sysdeps/x86_64/sysdep.h (CALL_MCOUNT): Add cfi directives.
	(ENTRY): Likewise.
	(END): Likewise.

	* configure.in: Test for asm cfi directives.

	* config.h.in: Add HAVE_ASM_CFI_DIRECTIVES.
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r--sysdeps/x86_64/sysdep.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h
index 99b7e565e9..122270f91b 100644
--- a/sysdeps/x86_64/sysdep.h
+++ b/sysdeps/x86_64/sysdep.h
@@ -50,18 +50,26 @@
   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)			      \
   .align ALIGNARG(4);							      \
   C_LABEL(name)								      \
+  cfi_startproc;							      \
   CALL_MCOUNT
 
 #undef	END
 #define END(name)							      \
-  ASM_SIZE_DIRECTIVE(name)						      \
+  cfi_endproc;								      \
+  ASM_SIZE_DIRECTIVE(name)
 
 /* If compiled for profiling, call `mcount' at the start of each function.  */
 #ifdef	PROF
 /* The mcount code relies on a normal frame pointer being on the stack
    to locate our caller, so push one just for its benefit.  */
-#define CALL_MCOUNT \
-  pushq %rbp; movq %rsp, %rbp; call JUMPTARGET(mcount); popq %rbp;
+#define CALL_MCOUNT                                                          \
+  pushq %rbp;                                                                \
+  cfi_adjust_cfa_offset(8);                                                  \
+  movq %rsp, %rbp;                                                           \
+  cfi_def_cfa_register(%rbp);                                                \
+  call JUMPTARGET(mcount);                                                   \
+  popq %rbp;                                                                 \
+  cfi_def_cfa(rsp,8);
 #else
 #define CALL_MCOUNT		/* Do nothing.  */
 #endif