This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


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

Adding CFI statements to ARM's assembly code: _Unwind_Resume


Hello!

On 2009-12-31 16:57, Joseph S. Myers wrote:
> sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
> sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c

> The two C files define functions using toplevel asms, and those functions 
> save registers to and restore them from the stack.  They don't use ENTRY 
> so do not need fixing for the patch series to go in, but correct 
> .debug_frame for the point when the stack is adjusted would still be 
> useful.

Ack.


This patch adds CFI statements to the _Unwind_Resume functions.


2010-01-08  Thomas Schwinge  <thomas@codesourcery.com>

	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
	(_Unwind_Resume): Add CFI statements.
	* sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
	(_Unwind_Resume): Likewise.

diff --git a/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c b/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
index ed321a3..011746d 100644
--- a/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
+++ b/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>.
 
@@ -89,7 +89,15 @@ asm (
 "	.globl	_Unwind_Resume\n"
 "	.type	_Unwind_Resume, %function\n"
 "_Unwind_Resume:\n"
+"	.cfi_sections .debug_frame\n"
+"	" CFI_STARTPROC "\n"
 "	stmfd	sp!, {r4, r5, r6, lr}\n"
+"	" CFI_ADJUST_CFA_OFFSET (16)" \n"
+"	" CFI_REL_OFFSET (r4, 0) "\n"
+"	" CFI_REL_OFFSET (r5, 4) "\n"
+"	" CFI_REL_OFFSET (r6, 8) "\n"
+"	" CFI_REL_OFFSET (lr, 12) "\n"
+"	" CFI_REMEMBER_STATE "\n"
 "	ldr	r4, 1f\n"
 "	ldr	r5, 2f\n"
 "3:	add	r4, pc, r4\n"
@@ -99,10 +107,17 @@ asm (
 "	beq	4f\n"
 "5:	mov	r0, r6\n"
 "	ldmfd	sp!, {r4, r5, r6, lr}\n"
+"	" CFI_ADJUST_CFA_OFFSET (-16) "\n"
+"	" CFI_RESTORE (r4) "\n"
+"	" CFI_RESTORE (r5) "\n"
+"	" CFI_RESTORE (r6) "\n"
+"	" CFI_RESTORE (lr) "\n"
 "	bx	r3\n"
+"	" CFI_RESTORE_STATE "\n"
 "4:	bl	pthread_cancel_init\n"
 "	ldr	r3, [r4, r5]\n"
 "	b	5b\n"
+"	" CFI_ENDPROC "\n"
 "	.align 2\n"
 #ifdef __thumb2__
 "1:	.word	_GLOBAL_OFFSET_TABLE_ - 3b - 4\n"
diff --git a/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c b/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
index 3c780b7..cdab10e 100644
--- a/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
+++ b/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2005, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>.
 
@@ -52,7 +52,15 @@ asm (
 "	.globl	_Unwind_Resume\n"
 "	.type	_Unwind_Resume, %function\n"
 "_Unwind_Resume:\n"
+"	.cfi_sections .debug_frame\n"
+"	" CFI_STARTPROC "\n"
 "	stmfd	sp!, {r4, r5, r6, lr}\n"
+"	" CFI_ADJUST_CFA_OFFSET (16)" \n"
+"	" CFI_REL_OFFSET (r4, 0) "\n"
+"	" CFI_REL_OFFSET (r5, 4) "\n"
+"	" CFI_REL_OFFSET (r6, 8) "\n"
+"	" CFI_REL_OFFSET (lr, 12) "\n"
+"	" CFI_REMEMBER_STATE "\n"
 "	ldr	r4, 1f\n"
 "	ldr	r5, 2f\n"
 "3:	add	r4, pc, r4\n"
@@ -62,10 +70,17 @@ asm (
 "	beq	4f\n"
 "5:	mov	r0, r6\n"
 "	ldmfd	sp!, {r4, r5, r6, lr}\n"
+"	" CFI_ADJUST_CFA_OFFSET (-16) "\n"
+"	" CFI_RESTORE (r4) "\n"
+"	" CFI_RESTORE (r5) "\n"
+"	" CFI_RESTORE (r6) "\n"
+"	" CFI_RESTORE (lr) "\n"
 "	bx	r3\n"
+"	" CFI_RESTORE_STATE "\n"
 "4:	bl	init\n"
 "	ldr	r3, [r4, r5]\n"
 "	b	5b\n"
+"	" CFI_ENDPROC "\n"
 "	.align 2\n"
 #ifdef __thumb2__
 "1:	.word	_GLOBAL_OFFSET_TABLE_ - 3b - 4\n"


Regards,
 Thomas

Attachment: pgp00000.pgp
Description: PGP signature


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