diff options
24 files changed, 420 insertions, 33 deletions
@@ -1,3 +1,14 @@ +2012-05-27 Chung-Lin Tang <cltang@codesourcery.com> + + * sysdeps/sh/_mcount.S (_mount): Add CFI directives. + * sysdeps/unix/sh/sysdep.S (__syscall_error): Likewise. + * sysdeps/unix/sysv/linux/sh/sh3/setcontext.S (__setcontext): Likewise. + * sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S (__swapcontext): + Likewise. + * sysdeps/unix/sysv/linux/sh/sh4/setcontext.S (__setcontext): Likewise. + * sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S (__swapcontext): + Likewise. + 2012-05-27 Ulrich Drepper <drepper@gmail.com> * po/h.po: Update from translation team. diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 492668bdeb..bc2e98b2c6 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,36 @@ +2012-05-27 Chung-Lin Tang <cltang@codesourcery.com> + + * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_lock_wait_private) + (__lll_lock_wait, __lll_timedlock_wait, __lll_timedwait_tid): Add CFI + directives. + * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S + (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Likewise. + * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S + (pthread_barrier_wait): Likewise. + * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S + (__pthread_cond_broadcast): Likewise. + * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S + (__pthread_cond_signal): Likewise. + * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S + (__pthread_cond_timedwait): Likewise. + * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S (__pthread_cond_wait): + Likewise. + * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S + (__pthread_rwlock_rdlock): Likewise. + * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S + (pthread_rwlock_timedrdlock): Likewise. + * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S + (pthread_rwlock_timedwrlock): Likewise. + * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S + (__pthread_rwlock_unlock): Likewise. + * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S + (__pthread_rwlock_wrlock): Likewise. + * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post): Likewise. + * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait): Likewise. + * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait): + Likewise. + * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise. + 2012-05-26 Siddhesh Poyarekar <siddhesh@redhat.com> [BZ #12416] diff --git a/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S index fe4e3b628b..0177209638 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S @@ -165,6 +165,8 @@ __lll_lock_wait_private: bf 1b mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) rts mov r2, r0 cfi_endproc @@ -208,7 +210,11 @@ __lll_lock_wait: bf 1b mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) ret mov r2, r0 cfi_endproc @@ -286,6 +292,7 @@ __lll_timedlock_wait: 5: rts mov.l @r15+, r12 + /* Omit CFI for restore in delay slot. */ # ifndef __ASSUME_FUTEX_CLOCK_REALTIME .align 2 @@ -306,6 +313,8 @@ __lll_timedlock_wait: cmp/hs r0, r1 bt 3f + cfi_remember_state + mov.l r11, @-r15 cfi_adjust_cfa_offset(4) cfi_rel_offset (r11, 0) @@ -386,17 +395,32 @@ __lll_timedlock_wait: 2: mov #ETIMEDOUT, r3 6: - mov r3, r0 add #8, r15 + cfi_adjust_cfa_offset (-8) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) mov.l @r15+, r10 + cfi_adjust_cfa_offset (-4) + cfi_restore (r10) mov.l @r15+, r11 + cfi_adjust_cfa_offset (-4) + cfi_restore (r11) + mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) rts - mov.l @r15+, r12 + mov r3, r0 + + cfi_restore_state 3: mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) rts mov #EINVAL, r0 # endif @@ -521,10 +545,16 @@ __lll_timedwait_tid: 4: mov #0, r0 3: + cfi_remember_state add #8, r15 + cfi_adjust_cfa_offset (-8) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) rts mov.l @r15+, r9 + /* Omit CFI for restore in delay slot. */ + cfi_restore_state 1: /* Check whether the time expired. */ mov #-ETIMEDOUT, r1 diff --git a/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S b/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S index 8b1e006712..7a192a9cc5 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S @@ -1,5 +1,4 @@ -/* Copyright (C) 2003, 2004, 2005, 2006, 2007 - Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -115,6 +114,8 @@ __lll_robust_lock_wait: 3: mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) ret mov r4, r0 cfi_endproc @@ -231,12 +232,22 @@ __lll_robust_timedlock_wait: mov #0, r0 6: + cfi_remember_state add #8, r15 + cfi_adjust_cfa_offset (-8) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) mov.l @r15+, r10 + cfi_adjust_cfa_offset (-4) + cfi_restore (r10) rts mov.l @r15+, r11 + /* Omit CFI for restore in delay slot. */ + cfi_restore_state 7: /* Check whether the time expired. */ @@ -248,6 +259,12 @@ __lll_robust_timedlock_wait: bra 6b mov #ETIMEDOUT, r0 3: + /* Restore initial state for invalid timeout case. */ + cfi_restore (r8) + cfi_restore (r9) + cfi_restore (r10) + cfi_restore (r11) + cfi_def_cfa_offset (0) rts mov #EINVAL, r0 cfi_endproc diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S index 58a9cdef58..dd32d81dc6 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -25,10 +25,17 @@ .globl pthread_barrier_wait .type pthread_barrier_wait,@function .align 5 + cfi_startproc pthread_barrier_wait: 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) sts.l pr, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (pr, 0) mov r4, r8 /* Get the mutex. */ @@ -98,11 +105,19 @@ pthread_barrier_wait: bf 9f 10: - mov #0, r0 /* != PTHREAD_BARRIER_SERIAL_THREAD */ + cfi_remember_state lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) + mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) rts - mov.l @r15+, r9 + mov #0, r0 /* != PTHREAD_BARRIER_SERIAL_THREAD */ + cfi_restore_state 3: /* The necessary number of threads arrived. */ @@ -140,11 +155,19 @@ pthread_barrier_wait: tst r2, r2 bf 4f 5: - mov #-1, r0 /* == PTHREAD_BARRIER_SERIAL_THREAD */ + cfi_remember_state lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) + mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) rts - mov.l @r15+, r9 + mov #-1, r0 /* == PTHREAD_BARRIER_SERIAL_THREAD */ + cfi_restore_state 1: mov.l @(PRIVATE,r8), r6 @@ -200,6 +223,7 @@ pthread_barrier_wait: .Lwake2b: bra 10b mov r9, r6 + cfi_endproc .align 2 .Lall: diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S index 7bd93553d3..fc1791b51f 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -30,11 +30,20 @@ .globl __pthread_cond_broadcast .type __pthread_cond_broadcast, @function .align 5 + cfi_startproc __pthread_cond_broadcast: 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) sts.l pr, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (pr, 0) mov r4, r8 /* Get internal lock. */ @@ -136,12 +145,22 @@ __pthread_cond_broadcast: add #cond_futex, r4 10: - mov #0, r0 + cfi_remember_state lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) + mov.l @r15+, r10 + cfi_adjust_cfa_offset (-4) + cfi_restore (r10) rts - mov.l @r15+, r10 + mov #0, r0 + cfi_restore_state 4: /* Unlock. */ @@ -153,12 +172,22 @@ __pthread_cond_broadcast: tst r2, r2 bf 5f 6: - mov #0, r0 + cfi_remember_state lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) + mov.l @r15+, r10 + cfi_adjust_cfa_offset (-4) + cfi_restore (r10) rts - mov.l @r15+, r10 + mov #0, r0 + cfi_restore_state 1: /* Initial locking failed. */ @@ -244,6 +273,7 @@ __pthread_cond_broadcast: SYSCALL_INST_PAD bra 10b nop + cfi_endproc #ifndef __ASSUME_PRIVATE_FUTEX .Lpfoff: diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S index 320a3e8f05..71a8e57506 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -29,9 +29,14 @@ .globl __pthread_cond_signal .type __pthread_cond_signal, @function .align 5 + cfi_startproc __pthread_cond_signal: mov.l r8, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r8, 0) sts.l pr, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (pr, 0) mov r4, r8 /* Get internal lock. */ @@ -109,10 +114,16 @@ __pthread_cond_signal: bt 7f 6: - mov #0, r0 + cfi_remember_state lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) + mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) rts - mov.l @r15+, r8 + mov #0, r0 + cfi_restore_state #ifndef __ASSUME_PRIVATE_FUTEX .Lpfoff: @@ -178,6 +189,7 @@ __pthread_cond_signal: .Lwait4b: bra 2b nop + cfi_endproc .align 2 .Lwait4: diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S index d945dbf2c6..0937d6c237 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -416,15 +416,31 @@ __pthread_cond_timedwait: mov.l @(24,r15), r0 18: + cfi_remember_state add #64, r15 + cfi_adjust_cfa_offset (-64) lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r13 + cfi_adjust_cfa_offset (-4) + cfi_restore (r13) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) mov.l @r15+, r11 + cfi_adjust_cfa_offset (-4) + cfi_restore (r11) mov.l @r15+, r10 + cfi_adjust_cfa_offset (-4) + cfi_restore (r10) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) rts mov.l @r15+, r8 + /* Omit CFI for restore in delay slot. */ + cfi_restore_state #ifndef __ASSUME_PRIVATE_FUTEX .Lpfoff: diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S index d06673cd84..4588c6f083 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -285,14 +285,28 @@ __pthread_cond_wait: /* We return the result of the mutex_lock operation. */ 14: + cfi_remember_state add #48, r15 + cfi_adjust_cfa_offset (-48) lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) mov.l @r15+, r11 + cfi_adjust_cfa_offset (-4) + cfi_restore (r11) mov.l @r15+, r10 + cfi_adjust_cfa_offset (-4) + cfi_restore (r10) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) rts mov.l @r15+, r8 + /* Omit CFI for restore in delay slot. */ + cfi_restore_state #ifndef __ASSUME_PRIVATE_FUTEX .Lpfoff0: diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S index ee88089527..8d261bc7b8 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -29,11 +29,20 @@ .globl __pthread_rwlock_rdlock .type __pthread_rwlock_rdlock,@function .align 5 + cfi_startproc __pthread_rwlock_rdlock: mov.l r12, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r12, 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) sts.l pr, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (pr, 0) mov r4, r8 /* Get the lock. */ @@ -134,12 +143,22 @@ __pthread_rwlock_rdlock: tst r2, r2 bf 6f 7: + cfi_remember_state lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) rts mov r3, r0 + cfi_restore_state #ifndef __ASSUME_PRIVATE_FUTEX .Lpfoff: @@ -234,6 +253,7 @@ __pthread_rwlock_rdlock: .Lwait1b: bra 13b nop + cfi_endproc .align 2 .Lwait0: diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S index a7c524d414..4a3dbb35fb 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -29,13 +29,25 @@ .globl pthread_rwlock_timedrdlock .type pthread_rwlock_timedrdlock,@function .align 5 + cfi_startproc pthread_rwlock_timedrdlock: mov.l r12, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r12, 0) 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) sts.l pr, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (pr, 0) add #-8, r15 + cfi_adjust_cfa_offset (8) mov r4, r8 mov r5, r9 @@ -183,14 +195,27 @@ pthread_rwlock_timedrdlock: tst r2, r2 bf 6f 7: + cfi_remember_state add #8,r15 + cfi_adjust_cfa_offset (-8) lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) mov.l @r15+, r10 + cfi_adjust_cfa_offset (-4) + cfi_restore (r10) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) rts mov r3, r0 + cfi_restore_state #ifndef __ASSUME_PRIVATE_FUTEX .Lpfoff: @@ -300,6 +325,7 @@ pthread_rwlock_timedrdlock: 19: bra 9b mov #EINVAL, r3 + cfi_endproc .align 2 .Lwait2: diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S index 04e2c63f1e..89741e3df3 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -29,13 +29,25 @@ .globl pthread_rwlock_timedwrlock .type pthread_rwlock_timedwrlock,@function .align 5 + cfi_startproc pthread_rwlock_timedwrlock: mov.l r12, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r12, 0) 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) sts.l pr, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (pr, 0) add #-8, r15 + cfi_adjust_cfa_offset (8) mov r4, r8 mov r5, r9 @@ -181,14 +193,27 @@ pthread_rwlock_timedwrlock: tst r2, r2 bf 6f 7: + cfi_remember_state add #8,r15 + cfi_adjust_cfa_offset (-8) lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) mov.l @r15+, r10 + cfi_adjust_cfa_offset (-4) + cfi_restore (r10) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) rts mov r3, r0 + cfi_restore_state #ifndef __ASSUME_PRIVATE_FUTEX .Lpfoff: @@ -284,6 +309,7 @@ pthread_rwlock_timedwrlock: 16: bra 17b mov #-ETIMEDOUT, r3 + cfi_endproc .align 2 .Lwait6: diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S index bd0b08a73a..0ffbe577db 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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,10 +27,17 @@ .globl __pthread_rwlock_unlock .type __pthread_rwlock_unlock,@function .align 5 + cfi_startproc __pthread_rwlock_unlock: mov.l r12, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r12, 0) mov.l r8, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r8, 0) sts.l pr, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (pr, 0) mov r4, r8 /* Get the lock. */ @@ -108,11 +115,19 @@ __pthread_rwlock_unlock: trapa #0x14 SYSCALL_INST_PAD + cfi_remember_state lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) rts mov #0, r0 + cfi_restore_state 6: #if MUTEX == 0 DEC (@r8, r2) @@ -122,11 +137,19 @@ __pthread_rwlock_unlock: tst r2, r2 bf 3f 4: + cfi_remember_state lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) rts mov #0, r0 + cfi_restore_state 1: mov r8, r5 @@ -159,7 +182,9 @@ __pthread_rwlock_unlock: 7: mov.l r4, @-r15 + cfi_adjust_cfa_offset (4) mov.l r6, @-r15 + cfi_adjust_cfa_offset (4) mov r8, r4 #if MUTEX != 0 add #MUTEX, r4 @@ -173,9 +198,12 @@ __pthread_rwlock_unlock: .Lwake9b: mov.l @r15+, r6 + cfi_adjust_cfa_offset (-4) bra 8b mov.l @r15+, r4 + cfi_endproc + #ifndef __ASSUME_PRIVATE_FUTEX .Lpfoff: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S index b378df6abd..febdaa1d79 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -29,11 +29,20 @@ .globl __pthread_rwlock_wrlock .type __pthread_rwlock_wrlock,@function .align 5 + cfi_startproc __pthread_rwlock_wrlock: mov.l r12, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r12, 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) sts.l pr, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (pr, 0) mov r4, r8 /* Get the lock. */ @@ -128,12 +137,22 @@ __pthread_rwlock_wrlock: tst r2, r2 bf 6f 7: + cfi_remember_state lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) rts mov r3, r0 + cfi_restore_state 1: mov r8, r5 @@ -217,6 +236,8 @@ __pthread_rwlock_wrlock: bra 13b nop + cfi_endproc + .align 2 .Lwait4: .long __lll_lock_wait-.Lwait4b diff --git a/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S b/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S index b228a325fe..662271c5fa 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2007, 2008, 2011 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -28,6 +28,7 @@ .globl __new_sem_post .type __new_sem_post,@function .align 5 + cfi_startproc __new_sem_post: mov.l @(VALUE,r4), r2 0: @@ -66,8 +67,14 @@ __new_sem_post: mov #EOVERFLOW, r2 4: mov.l r12, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r12, 0) mov.l r8, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r8, 0) sts.l pr, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (pr, 0) mova .Lgot3, r0 mov.l .Lgot3, r12 add r0, r12 @@ -83,10 +90,17 @@ __new_sem_post: .Lexit: mov.l r2, @r0 lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) rts mov #-1, r0 + cfi_endproc .align 2 .Lmax: diff --git a/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S index 9553bc7ba1..f8f9de5abd 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S @@ -170,14 +170,27 @@ sem_timedwait: mov #0, r0 10: + cfi_remember_state add #8, r15 + cfi_adjust_cfa_offset (-8) lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) mov.l @r15+, r10 + cfi_adjust_cfa_offset (-4) + cfi_restore (r10) mov.l @r15+, r9 + cfi_adjust_cfa_offset (-4) + cfi_restore (r9) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) rts nop + cfi_restore_state 3: neg r0, r0 diff --git a/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S b/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S index 35ae9b213d..2c5d3f589b 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2007, 2011 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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,10 +27,17 @@ .globl __new_sem_trywait .type __new_sem_trywait,@function .align 5 + cfi_startproc __new_sem_trywait: mov.l r12, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r12, 0) mov.l r8, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (r8, 0) sts.l pr, @-r15 + cfi_adjust_cfa_offset (4) + cfi_rel_offset (pr, 0) mov r4, r8 mov.l @r8, r0 2: @@ -44,11 +51,19 @@ __new_sem_trywait: bf/s 2b mov r2, r0 + cfi_remember_state lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) rts mov #0, r0 + cfi_restore_state 1: mov #EAGAIN, r8 @@ -67,11 +82,19 @@ __new_sem_trywait: .Lexit: mov.l r8, @r0 lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r8 + cfi_adjust_cfa_offset (-4) + cfi_restore (r8) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) rts mov #-1, r0 + cfi_endproc + .align 2 .Lgot1: .long _GLOBAL_OFFSET_TABLE_ diff --git a/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S b/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S index f2dd0c8bf7..57af34473d 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S +++ b/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2007, 2011 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 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 @@ -71,11 +71,20 @@ __new_sem_wait: 7: mov #0, r0 9: + cfi_remember_state lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) mov.l @r15+, r10 + cfi_adjust_cfa_offset (-4) + cfi_restore (r10) rts mov.l @r15+, r8 + /* Omit CFI for restore in delay slot. */ + cfi_restore_state .Lafter_ret: 1: diff --git a/sysdeps/sh/_mcount.S b/sysdeps/sh/_mcount.S index 7956c01256..7e3d50e94e 100644 --- a/sysdeps/sh/_mcount.S +++ b/sysdeps/sh/_mcount.S @@ -1,5 +1,5 @@ /* Machine-specific calling sequence for `mcount' profiling function. SuperH - Copyright (C) 2001, 2005 Free Software Foundation, Inc. + Copyright (C) 2001-2012 Free Software Foundation, Inc. Contributed by NIIBE Yutaka <gniibe@m17n.org> This file is part of the GNU C Library. @@ -58,11 +58,20 @@ C_LABEL(_mcount) /* Pop the saved registers. */ lds.l @r15+,pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+,r7 + cfi_adjust_cfa_offset (-4) + cfi_restore (r7) mov.l @r15+,r6 + cfi_adjust_cfa_offset (-4) + cfi_restore (r6) mov.l @r15+,r5 + cfi_adjust_cfa_offset (-4) + cfi_restore (r5) rts mov.l @r15+,r4 + /* Omit CFI for restore in delay slot. */ .align 2 #ifdef SHARED diff --git a/sysdeps/unix/sh/sysdep.S b/sysdeps/unix/sh/sysdep.S index e816575b03..f8025cc70c 100644 --- a/sysdeps/unix/sh/sysdep.S +++ b/sysdeps/unix/sh/sysdep.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1999-2012 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 @@ -41,13 +41,15 @@ skip: sts.l pr, @-r15 cfi_adjust_cfa_offset (4) cfi_rel_offset (pr, 0) - jsr @r1 - mov.l r0, @-r15 + mov.l r0, @-r15 cfi_adjust_cfa_offset (4) + jsr @r1 + nop mov.l @r15+, r1 cfi_adjust_cfa_offset (-4) lds.l @r15+, pr cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l r1, @r0 #endif #else @@ -77,10 +79,15 @@ skip: jsr @r1 nop lds.l @r15+, pr + cfi_adjust_cfa_offset (-4) + cfi_restore (pr) mov.l @r15+, r1 + cfi_adjust_cfa_offset (-4) mov.l r1, @r0 #endif mov.l @r15+, r12 + cfi_adjust_cfa_offset (-4) + cfi_restore (r12) #endif /* And just kick back a -1. */ rts diff --git a/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S b/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S index abe384ef6b..9d672f9203 100644 --- a/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S +++ b/sysdeps/unix/sysv/linux/sh/sh3/setcontext.S @@ -1,5 +1,5 @@ /* Install given context. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005-2012 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 @@ -90,6 +90,7 @@ ENTRY(__setcontext) mov.l @(oR7,r0), r7 mov.l @(oR8,r0), r8 mov.l @r15+, r0 + cfi_adjust_cfa_offset(-4) jmp @r0 mov.l @r15+, r0 diff --git a/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S b/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S index 92c476efe7..8227a139e8 100644 --- a/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S +++ b/sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S @@ -1,5 +1,5 @@ /* Save current context and install the given one. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005-2012 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 @@ -123,6 +123,7 @@ ENTRY(__swapcontext) mov.l @(oR7,r0), r7 mov.l @(oR8,r0), r8 mov.l @r15+, r0 + cfi_adjust_cfa_offset(-4) jmp @r0 mov.l @r15+, r0 diff --git a/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S b/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S index a3c0e21e56..161c51d45d 100644 --- a/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S +++ b/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S @@ -132,6 +132,7 @@ ENTRY(__setcontext) mov.l @(oR7,r0), r7 mov.l @(oR8,r0), r8 mov.l @r15+, r0 + cfi_adjust_cfa_offset(-4) jmp @r0 mov.l @r15+, r0 diff --git a/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S b/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S index 3ff7fe420c..24caae5b64 100644 --- a/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S +++ b/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S @@ -209,6 +209,7 @@ ENTRY(__swapcontext) mov.l @(oR7,r0), r7 mov.l @(oR8,r0), r8 mov.l @r15+, r0 + cfi_adjust_cfa_offset(-4) jmp @r0 mov.l @r15+, r0 |