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: mmap family


Hello!

This patch adds CFI statements to the mmap family of functions.


2009-12-22  Thomas Schwinge  <thomas@codesourcery.com>

	* sysdeps/unix/sysv/linux/arm/eabi/mmap64.S (__mmap64): Add CFI
	statements.
	* sysdeps/unix/sysv/linux/arm/mmap.S (__mmap): Likewise.

diff --git a/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/mmap64.S b/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/mmap64.S
index 38fac06..59352f7 100644
--- a/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/mmap64.S
+++ b/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/eabi/mmap64.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003, 2005, 2009 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
@@ -34,8 +34,13 @@
 ENTRY (__mmap64)
 	ldr	ip, [sp, $LOW_OFFSET]
 	str	r5, [sp, #-4]!
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (r5, 0)
 	ldr	r5, [sp, $HIGH_OFFSET]
 	str	r4, [sp, #-4]!
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (r4, 0)
+	cfi_remember_state
 	movs	r4, ip, lsl $20		@ check that offset is page-aligned
 	mov	ip, ip, lsr $12
 	moveqs	r4, r5, lsr $12		@ check for overflow
@@ -45,11 +50,19 @@ ENTRY (__mmap64)
 	DO_CALL (mmap2, 0)
 	cmn	r0, $4096
 	ldmfd	sp!, {r4, r5}
+	cfi_adjust_cfa_offset (-8)
+	cfi_restore (r4)
+	cfi_restore (r5)
 	RETINSTR(cc, lr)
 	b	PLTJMP(syscall_error)
+
+	cfi_restore_state
 .Linval:
 	mov	r0, $-EINVAL
 	ldmfd	sp!, {r4, r5}
+	cfi_adjust_cfa_offset (-8)
+	cfi_restore (r4)
+	cfi_restore (r5)
 	b	PLTJMP(syscall_error)
 PSEUDO_END (__mmap64)
 
diff --git a/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/mmap.S b/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/mmap.S
index 9227bd7..abac9e0 100644
--- a/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/mmap.S
+++ b/glibc-ports-mainline/sysdeps/unix/sysv/linux/arm/mmap.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2003, 2005, 2009 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
@@ -33,8 +33,13 @@ ENTRY (__mmap)
 
 	/* shuffle args */
 	str	r5, [sp, #-4]!
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (r5, 0)
 	ldr	r5, [sp, #8]
 	str	r4, [sp, #-4]!
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (r4, 0)
+	cfi_remember_state
 	ldr	r4, [sp, #8]
 
 	/* convert offset to pages */
@@ -48,12 +53,17 @@ ENTRY (__mmap)
 	/* restore registers */
 2:
 	ldr	r4, [sp], #4
+	cfi_adjust_cfa_offset (-4)
+	cfi_restore (r4)
 	ldr	r5, [sp], #4
+	cfi_adjust_cfa_offset (-4)
+	cfi_restore (r5)
 
 	cmn	r0, $4096
 	RETINSTR(cc, lr)
 	b	PLTJMP(syscall_error)
 
+	cfi_restore_state
 .Linval:
 	mov	r0, #-EINVAL
 	b	2b
@@ -74,6 +84,7 @@ ENTRY (__mmap)
 
 	/* store args on the stack */
 	stmdb	sp!, {a1-a4}
+	cfi_adjust_cfa_offset (16)
 
 	/* do the syscall */
 	mov	a1, sp
@@ -81,6 +92,7 @@ ENTRY (__mmap)
 
 	/* pop args off the stack. */
 	add	sp, sp, #16
+	cfi_adjust_cfa_offset (-16)
 
 	cmn	r0, $4096
 	RETINSTR(cc, lr)


Not updated: sysdeps/unix/sysv/linux/arm/mmap64.S


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]