This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.15-1209-g58f902b
- From: tschwinge at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 23 Jun 2012 10:15:56 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.15-1209-g58f902b
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 58f902b8d8cd47e8f4f2fcd64721a6289400422e (commit)
from 1518f58b6120289e69aeba9426eca9234cd9a200 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=58f902b8d8cd47e8f4f2fcd64721a6289400422e
commit 58f902b8d8cd47e8f4f2fcd64721a6289400422e
Author: Thomas Schwinge <thomas@codesourcery.com>
Date: Sat Jun 23 12:11:13 2012 +0200
SH: Preserve more registers for frame unwinding purposes, add CFI directives.
diff --git a/ChangeLog b/ChangeLog
index 649b656..06c33af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2012-06-23 Thomas Schwinge <thomas@codesourcery.com>
+ * sysdeps/sh/____longjmp_chk.S (CALL_FAIL): Preserve r12 and pr
+ registers for frame unwinding purposes, add CFI directives.
+ * sysdeps/unix/sysv/linux/sh/____longjmp_chk.S (CALL_FAIL): Likewise.
+ * sysdeps/unix/sysv/linux/sh/makecontext.S (.Lexitcode): Likewise
+ * sysdeps/unix/sysv/linux/sh/sysdep.h (SYSCALL_ERROR_HANDLER):
+ Likewise.
+
* sysdeps/sh/____longjmp_chk.S (CALL_FAIL): Don't plan for the call to
__fortify_fail returning.
* sysdeps/unix/sysv/linux/sh/____longjmp_chk.S (CALL_FAIL): Likewise.
diff --git a/sysdeps/sh/____longjmp_chk.S b/sysdeps/sh/____longjmp_chk.S
index e8d5f68..b37a948 100644
--- a/sysdeps/sh/____longjmp_chk.S
+++ b/sysdeps/sh/____longjmp_chk.S
@@ -28,9 +28,16 @@ longjmp_msg:
# define CALL_FAIL \
mov.l .Lfail, r1; \
mov.l .Lstr, r4; \
+ mov.l r12, @-r15; \
+ cfi_remember_state; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (r12, 0); \
mova .Lgot, r0; \
mov.l .Lgot, r12; \
add r0, r12; \
+ sts.l pr, @-r15; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (pr, 0); \
bsrf r1; \
add r12, r4; \
/* Unreachable. */ \
@@ -41,11 +48,16 @@ longjmp_msg:
.Lstr: \
.long longjmp_msg@GOTOFF; \
.Lfail: \
- .long __GI___fortify_fail@PLT-(.Lfail0-.);
+ .long __GI___fortify_fail@PLT-(.Lfail0-.); \
+ cfi_restore_state;
#else
# define CALL_FAIL \
mov.l .Lfail, r1; \
mov.l .Lstr, r4; \
+ sts.l pr, @-r15; \
+ cfi_remember_state; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (pr, 0); \
jsr @r1; \
nop; \
/* Unreachable. */ \
@@ -53,7 +65,8 @@ longjmp_msg:
.Lstr: \
.long longjmp_msg; \
.Lfail: \
- .long __fortify_fail;
+ .long __fortify_fail; \
+ cfi_restore_state;
#endif
#define CHECK_SP(reg) \
diff --git a/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S b/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
index bcf828b..d74caa2 100644
--- a/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
@@ -32,9 +32,16 @@ longjmp_msg:
# define CALL_FAIL \
mov.l .Lfail, r1; \
mov.l .Lstr, r4; \
+ mov.l r12, @-r15; \
+ cfi_remember_state; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (r12, 0); \
mova .Lgot, r0; \
mov.l .Lgot, r12; \
add r0, r12; \
+ sts.l pr, @-r15; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (pr, 0); \
bsrf r1; \
add r12, r4; \
.Lfail0: \
@@ -45,11 +52,16 @@ longjmp_msg:
.Lstr: \
.long longjmp_msg@GOTOFF; \
.Lfail: \
- .long __GI___fortify_fail@PLT-(.Lfail0-.);
+ .long __GI___fortify_fail@PLT-(.Lfail0-.); \
+ cfi_restore_state;
#else
# define CALL_FAIL \
mov.l .Lfail, r1; \
mov.l .Lstr, r4; \
+ sts.l pr, @-r15; \
+ cfi_remember_state; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (pr, 0); \
jsr @r1; \
nop; \
/* Unreachable. */ \
@@ -57,7 +69,8 @@ longjmp_msg:
.Lstr: \
.long longjmp_msg; \
.Lfail: \
- .long __fortify_fail;
+ .long __fortify_fail; \
+ cfi_restore_state;
#endif
#define CHECK_SP(reg) \
diff --git a/sysdeps/unix/sysv/linux/sh/makecontext.S b/sysdeps/unix/sysv/linux/sh/makecontext.S
index ec9ce91..a04bc9f 100644
--- a/sysdeps/unix/sysv/linux/sh/makecontext.S
+++ b/sysdeps/unix/sysv/linux/sh/makecontext.S
@@ -97,8 +97,12 @@ ENTRY(__makecontext)
cfi_endproc
.align 5
+ cfi_startproc
.Lexitcode:
#ifdef PIC
+ mov.l r12, @-r15
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (r12, 0)
mova .Lgot, r0
mov.l .Lgot, r12
add r0, r12
@@ -107,6 +111,9 @@ ENTRY(__makecontext)
bt/s 2f
mov r8, r4 /* r4 <- ucb->uc_link */
mov.l .Lsetcontext, r1
+ sts.l pr, @-r15
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (pr, 0)
#ifdef PIC
bsrf r1
.LPCS0:
@@ -115,6 +122,10 @@ ENTRY(__makecontext)
jsr @r1
nop
#endif
+ /* Restore to keep CFI/CFA balanced. */
+ lds.l @r15+, pr
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (pr)
/* If this returns (which can happen if the syscall fails) we'll exit
the program with the return error value (-1). */
@@ -143,7 +154,6 @@ ENTRY(__makecontext)
.Lexit:
.long HIDDEN_JUMPTARGET(exit)
#endif
- cfi_startproc
PSEUDO_END(__makecontext)
weak_alias (__makecontext, makecontext)
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.h b/sysdeps/unix/sysv/linux/sh/sysdep.h
index 5215a84..ce72c66 100644
--- a/sysdeps/unix/sysv/linux/sh/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sh/sysdep.h
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992,1993,1995-2000,2002-2006,2009,2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
@@ -100,11 +99,15 @@
# if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_HANDLER \
neg r0,r1; \
+ mov r12,r2; \
+ cfi_register (r12, r2); \
mov.l 0f,r12; \
mova 0f,r0; \
add r0,r12; \
mov.l 1f,r0; \
mov.l r1,@(r0,r12); \
+ mov r2,r12; \
+ cfi_restore (r12); \
bra .Lpseudo_end; \
mov _IMM1,r0; \
.align 2; \
@@ -121,6 +124,7 @@
# define SYSCALL_ERROR_HANDLER \
neg r0,r1; \
mov r12,r2; \
+ cfi_register (r12, r2); \
mov.l 0f,r12; \
mova 0f,r0; \
add r0,r12; \
@@ -128,6 +132,7 @@
stc gbr, r4; \
mov.l @(r0,r12),r0; \
mov r2,r12; \
+ cfi_restore (r12); \
add r4,r0; \
mov.l r1,@r0; \
bra .Lpseudo_end; \
@@ -140,12 +145,14 @@
# define SYSCALL_ERROR_HANDLER \
neg r0,r1; \
mov r12,r2; \
+ cfi_register (r12, r2); \
mov.l 0f,r12; \
mova 0f,r0; \
add r0,r12; \
mov.l 1f,r0; \
mov.l @(r0,r12),r0; \
mov r2,r12; \
+ cfi_restore (r12); \
mov.l r1,@r0; \
bra .Lpseudo_end; \
mov _IMM1,r0; \
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
sysdeps/sh/____longjmp_chk.S | 17 +++++++++++++++--
sysdeps/unix/sysv/linux/sh/____longjmp_chk.S | 17 +++++++++++++++--
sysdeps/unix/sysv/linux/sh/makecontext.S | 12 +++++++++++-
sysdeps/unix/sysv/linux/sh/sysdep.h | 11 +++++++++--
5 files changed, 57 insertions(+), 7 deletions(-)
hooks/post-receive
--
GNU C Library master sources