This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cfi in asm


> All archs except x86 and x86-64 are missing cfi in most or all asm
> files.  cfi is not optional, it's necessary for backtraces.  And it
> should be equivalent to async unwind tables.

Here is a patch for SH.

Regards,
	kaz
--
[ChangeLog]
2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/sh/sysdep.h: Add cfi instrumentation to asm fragments.
	* sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
	* sysdeps/sh/_mcount.S: Add cfi instrumentation.
	* sysdeps/unix/sh/sysdep.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/makecontext.S: Adjust cfi_startproc.
	* sysdeps/unix/sysv/linux/sh/sh4/getcontext.S: Remove now duplicate
	cfi_startproc and cfi_endproc.
	* sysdeps/unix/sysv/linux/sh/sh4/setcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sh3/getcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sh3/setcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/socket.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sysdep.S: Add cfi_endproc.


[nptl/ChangeLog]
2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
	.eh_frame section, use cfi_* directives.
	* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.

diff -upr ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S	2005-09-13 18:54:53.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S	2005-12-29 21:06:00.000000000 +0900
@@ -32,8 +32,11 @@
 	.type	__lll_mutex_lock_wait,@function
 	.hidden	__lll_mutex_lock_wait
 	.align	5
+	cfi_startproc
 __lll_mutex_lock_wait:
 	mov.l	r8, @-r15
+	cfi_adjust_cfa_offset(4)
+	cfi_rel_offset (r8, 0)
 	mov	r4, r6
 	mov	r5, r8
 	mov	#0, r7		/* No timeout.  */
@@ -59,6 +62,7 @@ __lll_mutex_lock_wait:
 	mov.l	@r15+, r8
 	ret
 	 mov	r2, r0
+	cfi_endproc
 	.size	__lll_mutex_lock_wait,.-__lll_mutex_lock_wait
 
 
@@ -67,6 +71,7 @@ __lll_mutex_lock_wait:
 	.type	__lll_mutex_timedlock_wait,@function
 	.hidden	__lll_mutex_timedlock_wait
 	.align	5
+	cfi_startproc
 __lll_mutex_timedlock_wait:
 	/* Check for a valid timeout value.  */
 	mov.l	@(4,r6), r1
@@ -75,14 +80,21 @@ __lll_mutex_timedlock_wait:
 	bt	3f
 
 	mov.l	r10, @-r15
+	cfi_adjust_cfa_offset(4)
+	cfi_rel_offset (r10, 0)
 	mov.l	r9, @-r15
+	cfi_adjust_cfa_offset(4)
+	cfi_rel_offset (r9, 0)
 	mov.l	r8, @-r15
+	cfi_adjust_cfa_offset(4)
+	cfi_rel_offset (r8, 0)
 	mov	r4, r10
 	mov	r6, r9
 	mov	r5, r8
 
 	/* Stack frame for the timespec and timeval structs.  */
 	add	#-8, r15
+	cfi_adjust_cfa_offset(8)
 
 1:
 	/* Get current time.  */
@@ -162,6 +174,7 @@ __lll_mutex_timedlock_wait:
 5:
 	bra	6b
 	 mov	#ETIMEDOUT, r0
+	cfi_endproc
 
 .L1k:
 	.word	1000
@@ -178,6 +191,7 @@ __lll_mutex_timedlock_wait:
 	.type	lll_unlock_wake_cb,@function
 	.hidden	lll_unlock_wake_cb
 	.align	5
+	cfi_startproc
 lll_unlock_wake_cb:
 	DEC	(@r4, r2)
 	tst	r2, r2
@@ -195,6 +209,7 @@ lll_unlock_wake_cb:
 1:	
 	rts
 	 nop
+	cfi_endproc
 	.size	lll_unlock_wake_cb,.-lll_unlock_wake_cb
 #endif
 
@@ -203,6 +218,7 @@ lll_unlock_wake_cb:
 	.type	__lll_mutex_unlock_wake,@function
 	.hidden	__lll_mutex_unlock_wake
 	.align	5
+	cfi_startproc
 __lll_mutex_unlock_wake:
 	mov	#FUTEX_WAKE, r5
 	mov	#1, r6		/* Wake one thread.  */
@@ -214,6 +230,7 @@ __lll_mutex_unlock_wake:
 	SYSCALL_INST_PAD
 	rts
 	 nop
+	cfi_endproc
 	.size	__lll_mutex_unlock_wake,.-__lll_mutex_unlock_wake
 
 
@@ -222,14 +239,20 @@ __lll_mutex_unlock_wake:
 	.type	__lll_timedwait_tid,@function
 	.hidden	__lll_timedwait_tid
 	.align	5
+	cfi_startproc
 __lll_timedwait_tid:
 	mov.l	r9, @-r15
+	cfi_adjust_cfa_offset(4)
+	cfi_rel_offset (r9, 0)
 	mov.l	r8, @-r15
+	cfi_adjust_cfa_offset(4)
+	cfi_rel_offset (r8, 0)
 	mov	r4, r8
 	mov	r5, r9
 
 	/* Stack frame for the timespec and timeval structs.  */
 	add	#-8, r15
+	cfi_adjust_cfa_offset(8)
 
 2:
 	/* Get current time.  */
@@ -292,6 +315,7 @@ __lll_timedwait_tid:
 6:
 	bra	3b
 	 mov	#ETIMEDOUT, r0
+	cfi_endproc
 
 .L1k2:
 	.word	1000
diff -upr ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h	2004-07-06 13:25:44.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h	2005-12-29 20:29:55.000000000 +0900
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -49,27 +49,32 @@
     .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
  .Lpseudo_cancel: \
     sts.l pr,@-r15; \
- .LCFI0: \
+    cfi_adjust_cfa_offset (4); \
+    cfi_rel_offset (pr, 0); \
     add _IMM16,r15; \
+    cfi_adjust_cfa_offset (16); \
     SAVE_ARGS_##args; \
- .LCFI1: \
     CENABLE; \
     LOAD_ARGS_##args; \
     add _IMP16,r15; \
- .LCFI2: \
+    cfi_adjust_cfa_offset (-16); \
     lds.l @r15+,pr; \
- .LCFI3: \
+    cfi_adjust_cfa_offset (-4); \
+    cfi_restore (pr); \
     DO_CALL(syscall_name, args); \
     SYSCALL_INST_PAD; \
     sts.l pr,@-r15; \
- .LCFI4: \
+    cfi_adjust_cfa_offset (4); \
+    cfi_rel_offset (pr, 0); \
     mov.l r0,@-r15; \
- .LCFI5: \
+    cfi_adjust_cfa_offset (4); \
+    cfi_rel_offset (r0, 0); \
     CDISABLE; \
     mov.l @r15+,r0; \
- .LCFI6: \
+    cfi_adjust_cfa_offset (-4); \
     lds.l @r15+,pr; \
- .LCFI7: \
+    cfi_adjust_cfa_offset (-4); \
+    cfi_restore (pr); \
     mov r0,r1; \
     mov _IMM12,r2; \
     shad r2,r1; \
@@ -78,106 +83,17 @@
     bf .Lpseudo_end; \
  .Lsyscall_error: \
     SYSCALL_ERROR_HANDLER; \
- .Lpseudo_end: \
- /* Create unwinding information for the syscall wrapper.  */ \
- .section .eh_frame,"a",@progbits; \
- .Lframe1: \
-    .ualong .LECIE1-.LSCIE1; \
- .LSCIE1: \
-    .ualong 0x0; \
-    .byte   0x1; \
-    AUGMENTATION_STRING; \
-    .uleb128 0x1; \
-    .sleb128 -4; \
-    .byte   0x11; \
-    AUGMENTATION_PARAM; \
-    .byte   0xc; \
-    .uleb128 0xf; \
-    .uleb128 0x0; \
-    .align 2; \
- .LECIE1: \
- .LSFDE1: \
-    .ualong .LEFDE1-.LASFDE1; \
- .LASFDE1: \
-    .ualong .LASFDE1-.Lframe1; \
-    START_SYMBOL_REF; \
-    .ualong .Lpseudo_end - .Lpseudo_start; \
-    AUGMENTATION_PARAM_FDE; \
-    .byte   0x4; \
-    .ualong .LCFI0-.Lpseudo_start; \
-    .byte   0xe; \
-    .uleb128 0x4; \
-    .byte   0x91; \
-    .uleb128 0x1; \
-    .byte   0x4; \
-    .ualong .LCFI1-.LCFI0; \
-    .byte   0xe; \
-    .uleb128 0x14; \
-    FRAME_REG_##args; \
-    .byte   0x4; \
-    .ualong .LCFI2-.LCFI1; \
-    .byte   0xe; \
-    .uleb128 0x4; \
-    .byte   0x4; \
-    .ualong .LCFI3-.LCFI2; \
-    .byte   0xe; \
-    .uleb128 0x0; \
-    .byte   0xd1; \
-    .byte   0x4; \
-    .ualong .LCFI4-.LCFI3; \
-    .byte   0xe; \
-    .uleb128 0x4; \
-    .byte   0x91; \
-    .uleb128 0x1; \
-    .byte   0x4; \
-    .ualong .LCFI5-.LCFI4; \
-    .byte   0xe; \
-    .uleb128 0x8; \
-    .byte   0x80; \
-    .uleb128 0x2; \
-    .byte   0x4; \
-    .ualong .LCFI6-.LCFI5; \
-    .byte   0xe; \
-    .uleb128 0x4; \
-    .byte   0xc0; \
-    .byte   0x4; \
-    .ualong .LCFI7-.LCFI6; \
-    .byte   0xe; \
-    .uleb128 0x0; \
-    .byte   0xd1; \
-    .align 2; \
- .LEFDE1: \
- .previous
-
-# ifdef SHARED
-#  define AUGMENTATION_STRING .string "zR"
-#  define AUGMENTATION_PARAM .uleb128 1; .byte 0x1b
-#  define AUGMENTATION_PARAM_FDE .uleb128 0
-#  define START_SYMBOL_REF .long .Lpseudo_start-.
-# else
-#  define AUGMENTATION_STRING .ascii "\0"
-#  define AUGMENTATION_PARAM
-#  define AUGMENTATION_PARAM_FDE
-#  define START_SYMBOL_REF .long .Lpseudo_start
-# endif
-
-# define FRAME_REG_0	/* Nothing.  */
-# define FRAME_REG_1	FRAME_REG_0; .byte 0x84; .uleb128 5
-# define FRAME_REG_2	FRAME_REG_1; .byte 0x85; .uleb128 4
-# define FRAME_REG_3	FRAME_REG_2; .byte 0x86; .uleb128 3
-# define FRAME_REG_4	FRAME_REG_3; .byte 0x87; .uleb128 2
-# define FRAME_REG_5	FRAME_REG_4
-# define FRAME_REG_6	FRAME_REG_5
+ .Lpseudo_end:
 
 # undef PSEUDO_END
 # define PSEUDO_END(sym) \
   END (sym)
 
 # define SAVE_ARGS_0	/* Nothing.  */
-# define SAVE_ARGS_1	SAVE_ARGS_0; mov.l r4,@(0,r15)
-# define SAVE_ARGS_2	SAVE_ARGS_1; mov.l r5,@(4,r15)
-# define SAVE_ARGS_3	SAVE_ARGS_2; mov.l r6,@(8,r15)
-# define SAVE_ARGS_4	SAVE_ARGS_3; mov.l r7,@(12,r15)
+# define SAVE_ARGS_1	SAVE_ARGS_0; mov.l r4,@(0,r15); cfi_offset (r4,-4)
+# define SAVE_ARGS_2	SAVE_ARGS_1; mov.l r5,@(4,r15); cfi_offset (r5,-8)
+# define SAVE_ARGS_3	SAVE_ARGS_2; mov.l r6,@(8,r15); cfi_offset (r6,-12)
+# define SAVE_ARGS_4	SAVE_ARGS_3; mov.l r7,@(12,r15); cfi_offset (r7,-16)
 # define SAVE_ARGS_5	SAVE_ARGS_4
 # define SAVE_ARGS_6	SAVE_ARGS_5
 
diff -upr ORIG/libc/sysdeps/sh/_mcount.S LOCAL/libc/sysdeps/sh/_mcount.S
--- ORIG/libc/sysdeps/sh/_mcount.S	2001-12-13 03:05:14.000000000 +0900
+++ LOCAL/libc/sysdeps/sh/_mcount.S	2005-12-29 13:58:15.000000000 +0900
@@ -1,5 +1,5 @@
 /* Machine-specific calling sequence for `mcount' profiling function.  SuperH
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
    Contributed by NIIBE Yutaka <gniibe@m17n.org>
    This file is part of the GNU C Library.
 
@@ -22,14 +22,25 @@
 
 	ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(_mcount)
 	ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(_mcount),function)
+	cfi_startproc
 	.align	5
 C_LABEL(_mcount)
 	/* Save registers.  */
 	mov.l	r4,@-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (r4, 0)
 	mov.l	r5,@-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (r5, 0)
 	mov.l	r6,@-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (r6, 0)
 	mov.l	r7,@-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (r7, 0)
 	sts.l	pr,@-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (pr, 0)
 
 	mov.l	@(20,r15),r4
 	sts	pr,r5
@@ -61,6 +72,7 @@ C_LABEL(_mcount)
 #else
 1:	.long	C_SYMBOL_NAME(__mcount_internal)
 #endif
+	cfi_endproc
 ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
 
 #undef mcount
diff -upr ORIG/libc/sysdeps/sh/sysdep.h LOCAL/libc/sysdeps/sh/sysdep.h
--- ORIG/libc/sysdeps/sh/sysdep.h	2001-12-13 03:05:38.000000000 +0900
+++ LOCAL/libc/sysdeps/sh/sysdep.h	2005-12-29 20:31:40.000000000 +0900
@@ -1,5 +1,5 @@
 /* Assembler macros for SH.
-   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -52,10 +52,12 @@
   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function)			      \
   .align ALIGNARG(5);							      \
   C_LABEL(name)								      \
+  cfi_startproc;							      \
   CALL_MCOUNT
 
 #undef	END
 #define END(name)							      \
+  cfi_endproc;								      \
   ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(name))
 
 /* If compiled for profiling, call `mcount' at the start of each function.  */
@@ -63,12 +65,17 @@
 #define CALL_MCOUNT					\
 	mov.l	1f,r1;					\
 	sts.l	pr,@-r15;				\
+	cfi_adjust_cfa_offset (4);			\
+	cfi_rel_offset (pr, 0);				\
 	mova	2f,r0;					\
 	jmp	@r1;					\
 	 lds	r0,pr;					\
 	.align	2;					\
 1:	.long	mcount;					\
-2:	lds.l	@r15+,pr
+2:	lds.l	@r15+,pr;				\
+	cfi_adjust_cfa_offset (-4);			\
+	cfi_restore (pr)
+
 #else
 #define CALL_MCOUNT		/* Do nothing.  */
 #endif
diff -upr ORIG/libc/sysdeps/unix/sh/sysdep.S LOCAL/libc/sysdeps/unix/sh/sysdep.S
--- ORIG/libc/sysdeps/unix/sh/sysdep.S	2005-11-26 11:56:57.000000000 +0900
+++ LOCAL/libc/sysdeps/unix/sh/sysdep.S	2005-12-29 19:12:47.000000000 +0900
@@ -40,14 +40,21 @@ skip:
 #else
 	mov.l	.L3, r1
 	sts.l	pr, @-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (pr, 0)
 	jsr	@r1
 	 mov.l	r0, @-r15
+	cfi_adjust_cfa_offset (4)
 	mov.l	@r15+, r1
+	cfi_adjust_cfa_offset (-4)
 	lds.l	@r15+, pr
+	cfi_adjust_cfa_offset (-4)
 	mov.l	r1, @r0
 #endif
 #else
 	mov.l	r12, @-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (r12, 0)
 #ifndef _LIBC_REENTRANT
 	mov	r0, r2
         mov.l	0f, r12
@@ -58,7 +65,10 @@ skip:
 	mov.l	r2, @r1
 #else
 	mov.l	r0, @-r15
+	cfi_adjust_cfa_offset (4)
 	sts.l	pr, @-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (pr, 0)
         mov.l	0f, r12
 	mova	0f, r0
 	add	r0, r12
diff -upr ORIG/libc/sysdeps/unix/sysv/linux/sh/makecontext.S LOCAL/libc/sysdeps/unix/sysv/linux/sh/makecontext.S
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/makecontext.S	2005-10-17 00:42:04.000000000 +0900
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/makecontext.S	2005-12-29 14:23:36.000000000 +0900
@@ -32,7 +32,6 @@
 
 	.text
 	.align	5
-	cfi_startproc
 ENTRY(__makecontext)
 	mov	#4, r3
 	mov.l	@(oSS_SP,r4), r1
@@ -140,6 +139,7 @@ ENTRY(__makecontext)
 .L4:
 	.long	HIDDEN_JUMPTARGET(exit)
 #endif
+	cfi_startproc
 PSEUDO_END(__makecontext)
 
 weak_alias (__makecontext, makecontext)
diff -upr ORIG/libc/sysdeps/unix/sysv/linux/sh/sh3/getcontext.S LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh3/getcontext.S
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/sh3/getcontext.S	2005-10-17 00:42:35.000000000 +0900
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh3/getcontext.S	2005-12-29 14:58:16.000000000 +0900
@@ -25,7 +25,6 @@
 
 	.text
 	.align  5
-	cfi_startproc
 ENTRY(__getcontext)
 
 	/* Return value of getcontext.  R0 is the only register whose
@@ -84,7 +83,6 @@ ENTRY(__getcontext)
 	rts
 	 nop
 
-	cfi_endproc
 PSEUDO_END(__getcontext)
 
 weak_alias (__getcontext, getcontext)
diff -upr ORIG/libc/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S	2005-10-17 00:43:10.000000000 +0900
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S	2005-12-29 14:58:33.000000000 +0900
@@ -25,7 +25,6 @@
 
 	.text
 	.align  5
-	cfi_startproc
 ENTRY(__setcontext)
 
 	mov	r4, r8
@@ -95,7 +94,6 @@ ENTRY(__setcontext)
 	jmp	@r0
 	 mov.l	@r15+, r0
 
-	cfi_endproc
 PSEUDO_END(__setcontext)
 
 weak_alias (__setcontext, setcontext)
diff -upr ORIG/libc/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S	2005-10-17 00:43:39.000000000 +0900
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S	2005-12-29 14:58:46.000000000 +0900
@@ -25,7 +25,6 @@
 
 	.text
 	.align  5
-	cfi_startproc
 ENTRY(__swapcontext)
 
 	/* Return value of getcontext.  R0 is the only register whose
@@ -128,7 +127,6 @@ ENTRY(__swapcontext)
 	jmp	@r0
 	 mov.l	@r15+, r0
 	
-	cfi_endproc
 PSEUDO_END(__swapcontext)
 
 weak_alias (__swapcontext, swapcontext)
diff -upr ORIG/libc/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S	2005-10-17 00:45:52.000000000 +0900
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S	2005-12-29 14:01:02.000000000 +0900
@@ -25,7 +25,6 @@
 
 	.text
 	.align  5
-	cfi_startproc
 ENTRY(__getcontext)
 
 	/* Return value of getcontext.  R0 is the only register whose
@@ -127,7 +126,6 @@ ENTRY(__getcontext)
 	rts
 	 nop
 
-	cfi_endproc
 PSEUDO_END(__getcontext)
 
 weak_alias (__getcontext, getcontext)
diff -upr ORIG/libc/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S	2005-10-17 00:46:24.000000000 +0900
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S	2005-12-29 14:01:38.000000000 +0900
@@ -25,7 +25,6 @@
 
 	.text
 	.align  5
-	cfi_startproc
 ENTRY(__setcontext)
 
 	mov	r4, r8
@@ -135,7 +134,6 @@ ENTRY(__setcontext)
 	jmp	@r0
 	 mov.l	@r15+, r0
 
-	cfi_endproc
 PSEUDO_END(__setcontext)
 
 weak_alias (__setcontext, setcontext)
diff -upr ORIG/libc/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S	2005-10-17 00:46:52.000000000 +0900
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S	2005-12-29 14:01:25.000000000 +0900
@@ -25,7 +25,6 @@
 
 	.text
 	.align  5
-	cfi_startproc
 ENTRY(__swapcontext)
 
 	/* Return value of getcontext.  R0 is the only register whose
@@ -210,7 +209,6 @@ ENTRY(__swapcontext)
 	jmp	@r0
 	 mov.l	@r15+, r0
 	
-	cfi_endproc
 PSEUDO_END(__swapcontext)
 
 weak_alias (__swapcontext, swapcontext)
diff -upr ORIG/libc/sysdeps/unix/sysv/linux/sh/socket.S LOCAL/libc/sysdeps/unix/sysv/linux/sh/socket.S
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/socket.S	2005-11-26 11:56:57.000000000 +0900
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/socket.S	2005-12-29 14:14:40.000000000 +0900
@@ -88,7 +88,6 @@
 #endif
 
 .globl __socket
-	cfi_startproc
 ENTRY (__socket)
 	/* This will not work in the case of a socket call being interrupted
 	   by a signal.  If the signal handler uses any stack the arguments
@@ -169,7 +168,6 @@ ENTRY (__socket)
 	bra	.Lsyscall_error
 	 nop
 #endif
-	cfi_endproc
 
 	.align 2
 .L1:
diff -upr ORIG/libc/sysdeps/unix/sysv/linux/sh/sysdep.S LOCAL/libc/sysdeps/unix/sysv/linux/sh/sysdep.S
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/sysdep.S	2002-10-11 19:51:13.000000000 +0900
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sysdep.S	2005-12-29 19:20:05.000000000 +0900
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2005
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +28,7 @@
 
 ENTRY (__syscall_error)
 	neg r4, r0
+	cfi_endproc
 
 #define __syscall_error __syscall_error_1
 #include <sysdeps/unix/sh/sysdep.S>
diff -upr ORIG/libc/sysdeps/unix/sysv/linux/sh/sysdep.h LOCAL/libc/sysdeps/unix/sysv/linux/sh/sysdep.h
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/sysdep.h	2005-12-23 22:38:51.000000000 +0900
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sysdep.h	2005-12-29 17:18:19.000000000 +0900
@@ -141,13 +141,22 @@
 #   define SYSCALL_ERROR_HANDLER \
 	neg r0,r1; \
 	mov.l r14,@-r15; \
+	cfi_adjust_cfa_offset (4); \
+	cfi_rel_offset (r14, 0); \
 	mov.l r12,@-r15; \
+	cfi_adjust_cfa_offset (4); \
+	cfi_rel_offset (r12, 0); \
 	mov.l r1,@-r15; \
+	cfi_adjust_cfa_offset (4); \
+	cfi_rel_offset (r1, 0); \
 	mov.l 0f,r12; \
 	mova 0f,r0; \
 	add r0,r12; \
 	sts.l pr,@-r15; \
+	cfi_adjust_cfa_offset (4); \
+	cfi_rel_offset (pr, 0); \
 	mov r15,r14; \
+	cfi_def_cfa_register (r14); \
 	mov.l 1f,r1; \
 	bsrf r1; \
          nop; \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]