summaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2009-11-24 16:24:59 +0100
committerAndreas Schwab <schwab@redhat.com>2009-11-24 16:24:59 +0100
commit13cada74709e88387c4f086d4042683f86e2e10f (patch)
tree2f264830ff2eab5de6216b6eab2a9206c65dd8d1 /nptl
parent4909e83159d429b1fd9a679c78cba24e610fd5a6 (diff)
parent49c7f27194d16976a6bb9c5b7be186662ec7a6e6 (diff)
Merge remote branch 'origin/master' into fedora/master
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog27
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h55
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S56
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S15
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S254
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S223
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S31
7 files changed, 203 insertions, 458 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 709a04b61c..181af50038 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,30 @@
+2009-11-22 Roland McGrath <roland@redhat.com>
+
+ * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h"
+ instead of recapitulating its contents.
+
+2009-11-18 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor
+ optimizations and cleanups.
+
+2009-11-18 Dinakar Guniguntala <dino@in.ibm.com>
+
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
+ Remove redundant code. Fix cfi offsets.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
+ Fix cfi offsets.
+
+2009-11-17 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally
+ reduce size of unwind info.
+
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use
+ cfi directives.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
+ Based on a patch by Dinakar Guniguntala <dino@in.ibm.com>.
+
2009-11-03 Andreas Schwab <schwab@linux-m68k.org>
[BZ #4457]
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h b/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h
index a3b2c77c32..5216114a70 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h
+++ b/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h
@@ -1,5 +1,5 @@
-/* System-specific settings for dynamic linker code. IA-32 version.
- Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc.
+/* System-specific settings for dynamic linker code. i386 version.
+ Copyright (C) 2002,2003,2008,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
@@ -18,56 +18,11 @@
02111-1307 USA. */
#ifndef _DL_SYSDEP_H
-#define _DL_SYSDEP_H 1
+# include "i686/dl-sysdep.h"
-/* This macro must be defined to either 0 or 1.
-
- If 1, then an errno global variable hidden in ld.so will work right with
- all the errno-using libc code compiled for ld.so, and there is never a
- need to share the errno location with libc. This is appropriate only if
- all the libc functions that ld.so uses are called without PLT and always
- get the versions linked into ld.so rather than the libc ones. */
-
-#ifdef IS_IN_rtld
-# define RTLD_PRIVATE_ERRNO 1
-#else
-# define RTLD_PRIVATE_ERRNO 0
-#endif
-
-/* Traditionally system calls have been made using int $0x80. A
- second method was introduced which, if possible, will use the
- sysenter/syscall instructions. To signal the presence and where to
- find the code the kernel passes an AT_SYSINFO value in the
- auxiliary vector to the application.
- sysenter/syscall is not useful on i386 through i586, but the dynamic
+/* sysenter/syscall is not useful on i386 through i586, but the dynamic
linker and dl code in libc.a has to be able to load i686 compiled
libraries. */
-#define NEED_DL_SYSINFO 1
-#undef USE_DL_SYSINFO
-
-#if defined NEED_DL_SYSINFO && !defined __ASSEMBLER__
-extern void _dl_sysinfo_int80 (void) attribute_hidden;
-# define DL_SYSINFO_DEFAULT (uintptr_t) _dl_sysinfo_int80
-# define DL_SYSINFO_IMPLEMENTATION \
- asm (".text\n\t" \
- ".type _dl_sysinfo_int80,@function\n\t" \
- ".hidden _dl_sysinfo_int80\n\t" \
- CFI_STARTPROC "\n" \
- "_dl_sysinfo_int80:\n\t" \
- "int $0x80;\n\t" \
- "ret;\n\t" \
- CFI_ENDPROC "\n" \
- ".size _dl_sysinfo_int80,.-_dl_sysinfo_int80\n\t" \
- ".previous;");
-#endif
-
-
-/* The _dl_discover_osversion function is so far only needed in sysconf
- to check for kernels later than 2.6.23. */
-#if !defined __ASSEMBLER__ && __LINUX_KERNEL_VERSION < 0x020617
-/* Get version of the OS. */
-extern int _dl_discover_osversion (void) attribute_hidden;
-# define HAVE_DL_DISCOVER_OSVERSION 1
-#endif
+# undef USE_DL_SYSINFO
#endif /* dl-sysdep.h */
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
index f46b4b874a..40fb04b31b 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2004,2006,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -35,16 +35,17 @@ __pthread_cond_broadcast:
cfi_startproc
pushl %ebx
cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%ebx, 0)
pushl %esi
cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%esi, 0)
pushl %edi
cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%edi, 0)
pushl %ebp
cfi_adjust_cfa_offset(4)
- cfi_offset(%ebx, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%edi, -16)
- cfi_offset(%ebp, -20)
+ cfi_rel_offset(%ebp, 0)
+ cfi_remember_state
movl 20(%esp), %ebx
@@ -120,32 +121,6 @@ __pthread_cond_broadcast:
cmpl $0xfffff001, %eax
jae 9f
-10: xorl %eax, %eax
- popl %ebp
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebp)
- popl %edi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edi)
- popl %esi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%esi)
- popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
- ret
-
- cfi_adjust_cfa_offset(16)
- cfi_offset(%ebx, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%edi, -16)
- cfi_offset(%ebp, -20)
- .align 16
- /* Unlock. */
-4: LOCK
- subl $1, cond_lock-cond_futex(%ebx)
- jne 5f
-
6: xorl %eax, %eax
popl %ebp
cfi_adjust_cfa_offset(-4)
@@ -161,11 +136,8 @@ __pthread_cond_broadcast:
cfi_restore(%ebx)
ret
- cfi_adjust_cfa_offset(16)
- cfi_offset(%ebx, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%edi, -16)
- cfi_offset(%ebp, -20)
+ cfi_restore_state
+
/* Initial locking failed. */
1:
#if cond_lock == 0
@@ -186,7 +158,13 @@ __pthread_cond_broadcast:
call __lll_lock_wait
jmp 2b
- /* Unlock in loop requires waekup. */
+ .align 16
+ /* Unlock. */
+4: LOCK
+ subl $1, cond_lock-cond_futex(%ebx)
+ je 6b
+
+ /* Unlock in loop requires wakeup. */
5: leal cond_lock-cond_futex(%ebx), %eax
#if (LLL_SHARED-LLL_PRIVATE) > 255
xorl %ecx, %ecx
@@ -201,7 +179,7 @@ __pthread_cond_broadcast:
call __lll_unlock_wake
jmp 6b
- /* Unlock in loop requires waekup. */
+ /* Unlock in loop requires wakeup. */
7: leal cond_lock-cond_futex(%ebx), %eax
#if (LLL_SHARED-LLL_PRIVATE) > 255
xorl %ecx, %ecx
@@ -232,7 +210,7 @@ __pthread_cond_broadcast:
addl $FUTEX_WAKE, %ecx
movl $SYS_futex, %eax
ENTER_KERNEL
- jmp 10b
+ jmp 6b
cfi_endproc
.size __pthread_cond_broadcast, .-__pthread_cond_broadcast
versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
index 4909f49107..013fcc303f 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2004,2005,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -36,10 +36,11 @@ __pthread_cond_signal:
cfi_startproc
pushl %ebx
cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%ebx, 0)
pushl %edi
cfi_adjust_cfa_offset(4)
- cfi_offset(%ebx, -8)
- cfi_offset(%edi, -12)
+ cfi_rel_offset(%edi, 0)
+ cfi_remember_state
movl 12(%esp), %edi
@@ -75,10 +76,10 @@ __pthread_cond_signal:
/* Wake up one thread. */
pushl %esi
cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%esi, 0)
pushl %ebp
cfi_adjust_cfa_offset(4)
- cfi_offset(%esi, -16)
- cfi_offset(%ebp, -20)
+ cfi_rel_offset(%ebp, 0)
#if FUTEX_PRIVATE_FLAG > 255
xorl %ecx, %ecx
@@ -121,9 +122,7 @@ __pthread_cond_signal:
cfi_restore(%ebx)
ret
- cfi_adjust_cfa_offset(8)
- cfi_offset(%ebx, -8)
- cfi_offset(%edi, -12)
+ cfi_restore_state
7: /* %ecx should be either FUTEX_WAKE_OP or
FUTEX_WAKE_OP|FUTEX_PRIVATE_FLAG from the previous syscall. */
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
index 83f8db25bb..8f5088a460 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2004, 2006-2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -34,14 +34,29 @@
.align 16
__pthread_cond_timedwait:
.LSTARTCODE:
+ cfi_startproc
+#ifdef SHARED
+ cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect,
+ DW.ref.__gcc_personality_v0)
+ cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART)
+#else
+ cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0)
+ cfi_lsda(DW_EH_PE_udata4, .LexceptSTART)
+#endif
+
pushl %ebp
-.Lpush_ebp:
+ cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%ebp, 0)
pushl %edi
-.Lpush_edi:
+ cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%edi, 0)
pushl %esi
-.Lpush_esi:
+ cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%esi, 0)
pushl %ebx
-.Lpush_ebx:
+ cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%ebx, 0)
+ cfi_remember_state
movl 20(%esp), %ebx
movl 28(%esp), %ebp
@@ -82,7 +97,7 @@ __pthread_cond_timedwait:
#define FRAME_SIZE 24
subl $FRAME_SIZE, %esp
-.Lsubl:
+ cfi_adjust_cfa_offset(FRAME_SIZE)
/* Get and store current wakeup_seq value. */
movl wakeup_seq(%ebx), %edi
@@ -273,7 +288,7 @@ __pthread_cond_timedwait:
11: movl 24+FRAME_SIZE(%esp), %eax
call __pthread_mutex_cond_lock
addl $FRAME_SIZE, %esp
-.Laddl:
+ cfi_adjust_cfa_offset(-FRAME_SIZE);
/* We return the result of the mutex_lock operation if it failed. */
testl %eax, %eax
@@ -286,19 +301,24 @@ __pthread_cond_timedwait:
#endif
18: popl %ebx
-.Lpop_ebx:
+ cfi_adjust_cfa_offset(-4)
+ cfi_restore(%ebx)
popl %esi
-.Lpop_esi:
+ cfi_adjust_cfa_offset(-4)
+ cfi_restore(%esi)
popl %edi
-.Lpop_edi:
+ cfi_adjust_cfa_offset(-4)
+ cfi_restore(%edi)
popl %ebp
-.Lpop_ebp:
+ cfi_adjust_cfa_offset(-4)
+ cfi_restore(%ebp)
ret
+ cfi_restore_state
+
/* Initial locking failed. */
1:
-.LSbl1:
#if cond_lock == 0
movl %ebx, %edx
#else
@@ -317,9 +337,17 @@ __pthread_cond_timedwait:
call __lll_lock_wait
jmp 2b
- /* Unlock in loop requires wakeup. */
-3:
-.LSbl2:
+ /* The initial unlocking of the mutex failed. */
+16:
+ LOCK
+#if cond_lock == 0
+ subl $1, (%ebx)
+#else
+ subl $1, cond_lock(%ebx)
+#endif
+ jne 18b
+
+ movl %eax, %esi
#if cond_lock == 0
movl %ebx, %eax
#else
@@ -336,14 +364,18 @@ __pthread_cond_timedwait:
addl $LLL_PRIVATE, %ecx
#endif
call __lll_unlock_wake
- jmp 4b
- /* Locking in loop failed. */
-5:
+ movl %esi, %eax
+ jmp 18b
+
+ cfi_adjust_cfa_offset(FRAME_SIZE)
+
+ /* Unlock in loop requires wakeup. */
+3:
#if cond_lock == 0
- movl %ebx, %edx
+ movl %ebx, %eax
#else
- leal cond_lock(%ebx), %edx
+ leal cond_lock(%ebx), %eax
#endif
#if (LLL_SHARED-LLL_PRIVATE) > 255
xorl %ecx, %ecx
@@ -355,15 +387,15 @@ __pthread_cond_timedwait:
#if LLL_PRIVATE != 0
addl $LLL_PRIVATE, %ecx
#endif
- call __lll_lock_wait
- jmp 6b
+ call __lll_unlock_wake
+ jmp 4b
- /* Unlock after loop requires wakeup. */
-10:
+ /* Locking in loop failed. */
+5:
#if cond_lock == 0
- movl %ebx, %eax
+ movl %ebx, %edx
#else
- leal cond_lock(%ebx), %eax
+ leal cond_lock(%ebx), %edx
#endif
#if (LLL_SHARED-LLL_PRIVATE) > 255
xorl %ecx, %ecx
@@ -375,21 +407,11 @@ __pthread_cond_timedwait:
#if LLL_PRIVATE != 0
addl $LLL_PRIVATE, %ecx
#endif
- call __lll_unlock_wake
- jmp 11b
-
- /* The initial unlocking of the mutex failed. */
-16:
-.LSbl3:
- LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
- jne 18b
+ call __lll_lock_wait
+ jmp 6b
- movl %eax, %esi
+ /* Unlock after loop requires wakeup. */
+10:
#if cond_lock == 0
movl %ebx, %eax
#else
@@ -406,13 +428,10 @@ __pthread_cond_timedwait:
addl $LLL_PRIVATE, %ecx
#endif
call __lll_unlock_wake
-
- movl %esi, %eax
- jmp 18b
+ jmp 11b
#if defined __NR_clock_gettime && !defined __ASSUME_POSIX_TIMERS
/* clock_gettime not available. */
-.LSbl4:
19: leal 4(%esp), %ebx
xorl %ecx, %ecx
movl $__NR_gettimeofday, %eax
@@ -443,7 +462,6 @@ versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
.type __condvar_tw_cleanup2, @function
__condvar_tw_cleanup2:
subl $cond_futex, %ebx
-.LSbl5:
.size __condvar_tw_cleanup2, .-__condvar_tw_cleanup2
.type __condvar_tw_cleanup, @function
__condvar_tw_cleanup:
@@ -583,14 +601,15 @@ __condvar_tw_cleanup:
call _Unwind_Resume
hlt
.LENDCODE:
+ cfi_endproc
.size __condvar_tw_cleanup, .-__condvar_tw_cleanup
.section .gcc_except_table,"a",@progbits
.LexceptSTART:
- .byte 0xff # @LPStart format (omit)
- .byte 0xff # @TType format (omit)
- .byte 0x0b # call-site format
+ .byte DW_EH_PE_omit # @LPStart format (omit)
+ .byte DW_EH_PE_omit # @TType format (omit)
+ .byte DW_EH_PE_sdata4 # call-site format
# DW_EH_PE_sdata4
.uleb128 .Lcstend-.Lcstbegin
.Lcstbegin:
@@ -613,144 +632,13 @@ __condvar_tw_cleanup:
.Lcstend:
- .section .eh_frame,"a",@progbits
-.LSTARTFRAME:
- .long L(ENDCIE)-L(STARTCIE) # Length of the CIE.
-.LSTARTCIE:
- .long 0 # CIE ID.
- .byte 1 # Version number.
-#ifdef SHARED
- .string "zPLR" # NUL-terminated augmentation
- # string.
-#else
- .string "zPL" # NUL-terminated augmentation
- # string.
-#endif
- .uleb128 1 # Code alignment factor.
- .sleb128 -4 # Data alignment factor.
- .byte 8 # Return address register
- # column.
-#ifdef SHARED
- .uleb128 7 # Augmentation value length.
- .byte 0x9b # Personality: DW_EH_PE_pcrel
- # + DW_EH_PE_sdata4
- # + DW_EH_PE_indirect
- .long DW.ref.__gcc_personality_v0-.
- .byte 0x1b # LSDA Encoding: DW_EH_PE_pcrel
- # + DW_EH_PE_sdata4.
- .byte 0x1b # FDE Encoding: DW_EH_PE_pcrel
- # + DW_EH_PE_sdata4.
-#else
- .uleb128 6 # Augmentation value length.
- .byte 0x0 # Personality: absolute
- .long __gcc_personality_v0
- .byte 0x0 # LSDA Encoding: absolute
-#endif
- .byte 0x0c # DW_CFA_def_cfa
- .uleb128 4
- .uleb128 4
- .byte 0x88 # DW_CFA_offset, column 0x8
- .uleb128 1
- .align 4
-.LENDCIE:
-
- .long .LENDFDE-.LSTARTFDE # Length of the FDE.
-.LSTARTFDE:
- .long .LSTARTFDE-.LSTARTFRAME # CIE pointer.
-#ifdef SHARED
- .long .LSTARTCODE-. # PC-relative start address
- # of the code
-#else
- .long .LSTARTCODE # Start address of the code.
-#endif
- .long .LENDCODE-.LSTARTCODE # Length of the code.
- .uleb128 4 # Augmentation size
-#ifdef SHARED
- .long .LexceptSTART-.
-#else
- .long .LexceptSTART
-#endif
- .byte 0x40+.Lpush_ebp-.LSTARTCODE # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 8
- .byte 0x85 # DW_CFA_offset %ebp
- .uleb128 2
- .byte 0x40+ .Lpush_edi-.Lpush_ebp # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 12
- .byte 0x87 # DW_CFA_offset %edi
- .uleb128 3
- .byte 0x40+.Lpush_esi-.Lpush_edi # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 16
- .byte 0x86 # DW_CFA_offset %esi
- .uleb128 4
- .byte 0x40+.Lpush_ebx-.Lpush_esi # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 20
- .byte 0x83 # DW_CFA_offset %ebx
- .uleb128 5
- .byte 4 # DW_CFA_advance_loc4
- .4byte .Lsubl-.Lpush_ebx
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 20+FRAME_SIZE
- .byte 4 # DW_CFA_advance_loc4
- .4byte .Laddl-.Lsubl
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 20
- .byte 0x40+.Lpop_ebx-.Laddl # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 16
- .byte 0xc3 # DW_CFA_restore %ebx
- .byte 0x40+.Lpop_esi-.Lpop_ebx # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 12
- .byte 0xc6 # DW_CFA_restore %esi
- .byte 0x40+.Lpop_edi-.Lpop_esi # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 8
- .byte 0xc7 # DW_CFA_restore %edi
- .byte 0x40+.Lpop_ebp-.Lpop_edi # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 4
- .byte 0xc5 # DW_CFA_restore %ebp
- .byte 0x40+.LSbl1-.Lpop_edi # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 20
- .byte 4 # DW_CFA_advance_loc4
- .4byte .LSbl2-.LSbl1
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 20+FRAME_SIZE
- .byte 0x85 # DW_CFA_offset %ebp
- .uleb128 2
- .byte 0x87 # DW_CFA_offset %edi
- .uleb128 3
- .byte 0x86 # DW_CFA_offset %esi
- .uleb128 4
- .byte 0x83 # DW_CFA_offset %ebx
- .uleb128 5
- .byte 4 # DW_CFA_advance_loc4
- .4byte .LSbl3-.LSbl2
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 20
- .byte 4 # DW_CFA_advance_loc4
-#if defined __NR_clock_gettime && !defined __ASSUME_POSIX_TIMERS
- .4byte .LSbl4-.LSbl3
-#else
- .4byte .LSbl5-.LSbl3
-#endif
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 20+FRAME_SIZE
- .align 4
-.LENDFDE:
-
#ifdef SHARED
.hidden DW.ref.__gcc_personality_v0
- .weak DW.ref.__gcc_personality_v0
+ .weak DW.ref.__gcc_personality_v0
.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
- .align 4
- .type DW.ref.__gcc_personality_v0, @object
- .size DW.ref.__gcc_personality_v0, 4
+ .align 4
+ .type DW.ref.__gcc_personality_v0, @object
+ .size DW.ref.__gcc_personality_v0, 4
DW.ref.__gcc_personality_v0:
.long __gcc_personality_v0
#endif
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
index 5b301979b5..776b95e40c 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2004, 2006-2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -33,13 +33,26 @@
.align 16
__pthread_cond_wait:
.LSTARTCODE:
+ cfi_startproc
+#ifdef SHARED
+ cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect,
+ DW.ref.__gcc_personality_v0)
+ cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART)
+#else
+ cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0)
+ cfi_lsda(DW_EH_PE_udata4, .LexceptSTART)
+#endif
pushl %edi
-.Lpush_edi:
+ cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%edi, 0)
pushl %esi
-.Lpush_esi:
+ cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%esi, 0)
pushl %ebx
-.Lpush_ebx:
+ cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%ebx, 0)
+ cfi_remember_state
xorl %esi, %esi
movl 16(%esp), %ebx
@@ -76,7 +89,7 @@ __pthread_cond_wait:
#define FRAME_SIZE 16
subl $FRAME_SIZE, %esp
-.Lsubl:
+ cfi_adjust_cfa_offset(FRAME_SIZE)
/* Get and store current wakeup_seq value. */
movl wakeup_seq(%ebx), %edi
@@ -202,21 +215,25 @@ __pthread_cond_wait:
11: movl 20+FRAME_SIZE(%esp), %eax
call __pthread_mutex_cond_lock
addl $FRAME_SIZE, %esp
-.Laddl:
+ cfi_adjust_cfa_offset(-FRAME_SIZE);
14: popl %ebx
-.Lpop_ebx:
+ cfi_adjust_cfa_offset(-4)
+ cfi_restore(%ebx)
popl %esi
-.Lpop_esi:
+ cfi_adjust_cfa_offset(-4)
+ cfi_restore(%esi)
popl %edi
-.Lpop_edi:
+ cfi_adjust_cfa_offset(-4)
+ cfi_restore(%edi)
/* We return the result of the mutex_lock operation. */
ret
+ cfi_restore_state
+
/* Initial locking failed. */
1:
-.LSbl1:
#if cond_lock == 0
movl %ebx, %edx
#else
@@ -235,9 +252,17 @@ __pthread_cond_wait:
call __lll_lock_wait
jmp 2b
- /* Unlock in loop requires waekup. */
-3:
-.LSbl2:
+ /* The initial unlocking of the mutex failed. */
+12:
+ LOCK
+#if cond_lock == 0
+ subl $1, (%ebx)
+#else
+ subl $1, cond_lock(%ebx)
+#endif
+ jne 14b
+
+ movl %eax, %esi
#if cond_lock == 0
movl %ebx, %eax
#else
@@ -254,14 +279,18 @@ __pthread_cond_wait:
addl $LLL_PRIVATE, %ecx
#endif
call __lll_unlock_wake
- jmp 4b
- /* Locking in loop failed. */
-5:
+ movl %esi, %eax
+ jmp 14b
+
+ cfi_adjust_cfa_offset(FRAME_SIZE)
+
+ /* Unlock in loop requires wakeup. */
+3:
#if cond_lock == 0
- movl %ebx, %edx
+ movl %ebx, %eax
#else
- leal cond_lock(%ebx), %edx
+ leal cond_lock(%ebx), %eax
#endif
#if (LLL_SHARED-LLL_PRIVATE) > 255
xorl %ecx, %ecx
@@ -273,15 +302,15 @@ __pthread_cond_wait:
#if LLL_PRIVATE != 0
addl $LLL_PRIVATE, %ecx
#endif
- call __lll_lock_wait
- jmp 6b
+ call __lll_unlock_wake
+ jmp 4b
- /* Unlock after loop requires wakeup. */
-10:
+ /* Locking in loop failed. */
+5:
#if cond_lock == 0
- movl %ebx, %eax
+ movl %ebx, %edx
#else
- leal cond_lock(%ebx), %eax
+ leal cond_lock(%ebx), %edx
#endif
#if (LLL_SHARED-LLL_PRIVATE) > 255
xorl %ecx, %ecx
@@ -293,21 +322,11 @@ __pthread_cond_wait:
#if LLL_PRIVATE != 0
addl $LLL_PRIVATE, %ecx
#endif
- call __lll_unlock_wake
- jmp 11b
-
- /* The initial unlocking of the mutex failed. */
-12:
-.LSbl3:
- LOCK
-#if cond_lock == 0
- subl $1, (%ebx)
-#else
- subl $1, cond_lock(%ebx)
-#endif
- jne 14b
+ call __lll_lock_wait
+ jmp 6b
- movl %eax, %esi
+ /* Unlock after loop requires wakeup. */
+10:
#if cond_lock == 0
movl %ebx, %eax
#else
@@ -324,9 +343,7 @@ __pthread_cond_wait:
addl $LLL_PRIVATE, %ecx
#endif
call __lll_unlock_wake
-
- movl %esi, %eax
- jmp 14b
+ jmp 11b
.size __pthread_cond_wait, .-__pthread_cond_wait
versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
GLIBC_2_3_2)
@@ -475,14 +492,15 @@ __condvar_w_cleanup:
call _Unwind_Resume
hlt
.LENDCODE:
+ cfi_endproc
.size __condvar_w_cleanup, .-__condvar_w_cleanup
.section .gcc_except_table,"a",@progbits
.LexceptSTART:
- .byte 0xff # @LPStart format (omit)
- .byte 0xff # @TType format (omit)
- .byte 0x0b # call-site format
+ .byte DW_EH_PE_omit # @LPStart format (omit)
+ .byte DW_EH_PE_omit # @TType format (omit)
+ .byte DW_EH_PE_sdata4 # call-site format
# DW_EH_PE_sdata4
.uleb128 .Lcstend-.Lcstbegin
.Lcstbegin:
@@ -504,123 +522,6 @@ __condvar_w_cleanup:
.uleb128 0
.Lcstend:
- .section .eh_frame,"a",@progbits
-.LSTARTFRAME:
- .long L(ENDCIE)-L(STARTCIE) # Length of the CIE.
-.LSTARTCIE:
- .long 0 # CIE ID.
- .byte 1 # Version number.
-#ifdef SHARED
- .string "zPLR" # NUL-terminated augmentation
- # string.
-#else
- .string "zPL" # NUL-terminated augmentation
- # string.
-#endif
- .uleb128 1 # Code alignment factor.
- .sleb128 -4 # Data alignment factor.
- .byte 8 # Return address register
- # column.
-#ifdef SHARED
- .uleb128 7 # Augmentation value length.
- .byte 0x9b # Personality: DW_EH_PE_pcrel
- # + DW_EH_PE_sdata4
- # + DW_EH_PE_indirect
- .long DW.ref.__gcc_personality_v0-.
- .byte 0x1b # LSDA Encoding: DW_EH_PE_pcrel
- # + DW_EH_PE_sdata4.
- .byte 0x1b # FDE Encoding: DW_EH_PE_pcrel
- # + DW_EH_PE_sdata4.
-#else
- .uleb128 6 # Augmentation value length.
- .byte 0x0 # Personality: absolute
- .long __gcc_personality_v0
- .byte 0x0 # LSDA Encoding: absolute
-#endif
- .byte 0x0c # DW_CFA_def_cfa
- .uleb128 4
- .uleb128 4
- .byte 0x88 # DW_CFA_offset, column 0x8
- .uleb128 1
- .align 4
-.LENDCIE:
-
- .long .LENDFDE-.LSTARTFDE # Length of the FDE.
-.LSTARTFDE:
- .long .LSTARTFDE-.LSTARTFRAME # CIE pointer.
-#ifdef SHARED
- .long .LSTARTCODE-. # PC-relative start address
- # of the code.
-#else
- .long .LSTARTCODE # Start address of the code.
-#endif
- .long .LENDCODE-.LSTARTCODE # Length of the code.
- .uleb128 4 # Augmentation size
-#ifdef SHARED
- .long .LexceptSTART-.
-#else
- .long .LexceptSTART
-#endif
- .byte 0x40+.Lpush_edi-.LSTARTCODE # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 8
- .byte 0x87 # DW_CFA_offset %edi
- .uleb128 2
- .byte 0x40+.Lpush_esi-.Lpush_edi # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 12
- .byte 0x86 # DW_CFA_offset %esi
- .uleb128 3
- .byte 0x40+.Lpush_ebx-.Lpush_esi # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 16
- .byte 0x83 # DW_CFA_offset %ebx
- .uleb128 4
- .byte 4 # DW_CFA_advance_loc4
- .4byte .Lsubl-.Lpush_ebx
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 16+FRAME_SIZE
- .byte 4 # DW_CFA_advance_loc4
- .4byte .Laddl-.Lsubl
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 16
- .byte 0x40+ .Lpop_ebx-.Laddl # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 12
- .byte 0xc3 # DW_CFA_restore %ebx
- .byte 0x40+.Lpop_esi-.Lpop_ebx # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 8
- .byte 0xc6 # DW_CFA_restore %esi
- .byte 0x40+.Lpop_edi-.Lpop_esi # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 4
- .byte 0xc7 # DW_CFA_restore %edi
- .byte 0x40+.LSbl1-.Lpop_edi # DW_CFA_advance_loc+N
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 16
- .byte 0x87 # DW_CFA_offset %edi
- .uleb128 2
- .byte 0x86 # DW_CFA_offset %esi
- .uleb128 3
- .byte 0x83 # DW_CFA_offset %ebx
- .uleb128 4
- .byte 4 # DW_CFA_advance_loc4
- .4byte .LSbl2-.LSbl1
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 16+FRAME_SIZE
- .byte 4 # DW_CFA_advance_loc4
- .4byte .LSbl3-.LSbl2
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 16
- .byte 4 # DW_CFA_advance_loc4
- .4byte .LSbl4-.LSbl3
- .byte 14 # DW_CFA_def_cfa_offset
- .uleb128 16+FRAME_SIZE
- .align 4
-.LENDFDE:
-
-
#ifdef PIC
.section .gnu.linkonce.t.__i686.get_pc_thunk.cx,"ax",@progbits
.globl __i686.get_pc_thunk.cx
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
index 86bdac1b1b..be14fc897e 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -69,6 +69,7 @@ __pthread_cond_timedwait:
#endif
subq $FRAME_SIZE, %rsp
cfi_adjust_cfa_offset(FRAME_SIZE)
+ cfi_remember_state
cmpq $1000000000, 8(%rdx)
movl $EINVAL, %eax
@@ -77,19 +78,19 @@ __pthread_cond_timedwait:
/* Stack frame:
rsp + 48
- +--------------------------+
+ +--------------------------+
rsp + 32 | timeout value |
- +--------------------------+
+ +--------------------------+
rsp + 24 | old wake_seq value |
- +--------------------------+
+ +--------------------------+
rsp + 16 | mutex pointer |
- +--------------------------+
+ +--------------------------+
rsp + 8 | condvar pointer |
- +--------------------------+
+ +--------------------------+
rsp + 4 | old broadcast_seq value |
- +--------------------------+
+ +--------------------------+
rsp + 0 | old cancellation mode |
- +--------------------------+
+ +--------------------------+
*/
cmpq $-1, dep_mutex(%rdi)
@@ -317,11 +318,7 @@ __pthread_cond_timedwait:
retq
- cfi_adjust_cfa_offset(4 * 8 + FRAME_SIZE)
- cfi_rel_offset(%r12, FRAME_SIZE + 24)
- cfi_rel_offset(%r13, FRAME_SIZE + 16)
- cfi_rel_offset(%r14, FRAME_SIZE + 8)
- cfi_rel_offset(%r15, FRAME_SIZE)
+ cfi_restore_state
64: callq __pthread_mutex_cond_lock_adjust
movq %r14, %rax
@@ -650,15 +647,15 @@ __condvar_cleanup2:
rsp + 48 | %r14 |
+--------------------------+
rsp + 24 | unused |
- +--------------------------+
+ +--------------------------+
rsp + 16 | mutex pointer |
- +--------------------------+
+ +--------------------------+
rsp + 8 | condvar pointer |
- +--------------------------+
+ +--------------------------+
rsp + 4 | old broadcast_seq value |
- +--------------------------+
+ +--------------------------+
rsp + 0 | old cancellation mode |
- +--------------------------+
+ +--------------------------+
*/
movq %rax, 24(%rsp)