From: Mark Seaborn Date: Tue, 9 Jun 2009 20:46:50 +0000 (+0100) Subject: Fix some uses of ret in libpthread X-Git-Tag: nacl-dynlink-0.1~2 X-Git-Url: https://repo.or.cz/w/glibc/nacl-glibc.git/commitdiff_plain/214da24dedbd51e56ae73b96dac01b48d9831ed6 Fix some uses of ret in libpthread This makes sem_wait() work, at least partially, when used by Python. Done using: perl -pi -e 's/^(\s*)ret(\s*)$/$1popl %ecx; nacljmp %ecx$2/' nptl/sysdeps/unix/sysv/linux/i386/i486/*.S --- diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S index 9c8a68f5b2..a8e15bc941 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S @@ -103,7 +103,7 @@ __lll_lock_wait_private: popl %edx cfi_adjust_cfa_offset(-4) cfi_restore(%edx) - ret + popl %ecx; nacljmp %ecx cfi_endproc .size __lll_lock_wait_private,.-__lll_lock_wait_private @@ -150,7 +150,7 @@ __lll_lock_wait: popl %edx cfi_adjust_cfa_offset(-4) cfi_restore(%edx) - ret + popl %ecx; nacljmp %ecx cfi_endproc .size __lll_lock_wait,.-__lll_lock_wait @@ -249,10 +249,10 @@ __lll_timedlock_wait: cfi_adjust_cfa_offset(-4) cfi_restore(%edi) movl %edx, %eax - ret + popl %ecx; nacljmp %ecx 3: movl $EINVAL, %eax - ret + popl %ecx; nacljmp %ecx cfi_endproc .size __lll_timedlock_wait,.-__lll_timedlock_wait #endif @@ -289,7 +289,7 @@ __lll_unlock_wake_private: popl %ebx cfi_adjust_cfa_offset(-4) cfi_restore(%ebx) - ret + popl %ecx; nacljmp %ecx cfi_endproc .size __lll_unlock_wake_private,.-__lll_unlock_wake_private @@ -326,7 +326,7 @@ __lll_unlock_wake: popl %ebx cfi_adjust_cfa_offset(-4) cfi_restore(%ebx) - ret + popl %ecx; nacljmp %ecx cfi_endproc .size __lll_unlock_wake,.-__lll_unlock_wake @@ -388,7 +388,7 @@ __lll_timedwait_tid: popl %ebx popl %esi popl %edi - ret + popl %ecx; nacljmp %ecx 1: cmpl $-ETIMEDOUT, %eax jne 2b diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S index 7c2e1d135c..26a0a9a46b 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S @@ -101,7 +101,7 @@ __lll_robust_lock_wait: popl %edx cfi_adjust_cfa_offset(-4) cfi_restore(%edx) - ret + popl %ecx; nacljmp %ecx cfi_endproc .size __lll_robust_lock_wait,.-__lll_robust_lock_wait @@ -213,10 +213,10 @@ __lll_robust_timedlock_wait: popl %edi cfi_adjust_cfa_offset(-4) cfi_restore(%edi) - ret + popl %ecx; nacljmp %ecx 3: movl $EINVAL, %eax - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(28) cfi_offset(%edi, -8) diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S index 040d7f8c33..97a93a33a0 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S @@ -111,7 +111,7 @@ pthread_barrier_wait: popl %ebx cfi_adjust_cfa_offset(-4) cfi_restore(%ebx) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(4) cfi_offset(%ebx, -8) @@ -154,7 +154,7 @@ pthread_barrier_wait: popl %ebx cfi_adjust_cfa_offset(-4) cfi_restore(%ebx) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(4) cfi_offset(%ebx, -8) 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..2b7f7613a5 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 @@ -133,7 +133,7 @@ __pthread_cond_broadcast: popl %ebx cfi_adjust_cfa_offset(-4) cfi_restore(%ebx) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(16) cfi_offset(%ebx, -8) @@ -159,7 +159,7 @@ __pthread_cond_broadcast: popl %ebx cfi_adjust_cfa_offset(-4) cfi_restore(%ebx) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(16) cfi_offset(%ebx, -8) 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..cfd3c19c4c 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 @@ -119,7 +119,7 @@ __pthread_cond_signal: popl %ebx cfi_adjust_cfa_offset(-4) cfi_restore(%ebx) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(8) cfi_offset(%ebx, -8) 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..6a29bfa483 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 @@ -294,7 +294,7 @@ __pthread_cond_timedwait: popl %ebp .Lpop_ebp: - ret + popl %ecx; nacljmp %ecx /* Initial locking failed. */ 1: 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..8d08474dfb 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 @@ -212,7 +212,7 @@ __pthread_cond_wait: .Lpop_edi: /* We return the result of the mutex_lock operation. */ - ret + popl %ecx; nacljmp %ecx /* Initial locking failed. */ 1: @@ -628,7 +628,7 @@ __condvar_w_cleanup: .type __i686.get_pc_thunk.cx,@function __i686.get_pc_thunk.cx: movl (%esp), %ecx; - ret + popl %ecx; nacljmp %ecx .size __i686.get_pc_thunk.cx,.-__i686.get_pc_thunk.cx #endif diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S index 4e5f0c5b2a..52c49669a1 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S @@ -123,7 +123,7 @@ __pthread_rwlock_rdlock: popl %esi cfi_adjust_cfa_offset(-4) cfi_restore(%esi) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(8) cfi_offset(%esi, -8) diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S index 2b84cd06c2..005925035d 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S @@ -173,7 +173,7 @@ pthread_rwlock_timedrdlock: popl %esi cfi_adjust_cfa_offset(-4) cfi_restore(%esi) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(24) cfi_offset(%esi, -8) diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S index 91652467c4..3c8b3b9351 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S @@ -171,7 +171,7 @@ pthread_rwlock_timedwrlock: popl %esi cfi_adjust_cfa_offset(-4) cfi_restore(%esi) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(24) cfi_offset(%esi, -8) diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S index aabb92960b..cb2160cf54 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S @@ -97,7 +97,7 @@ __pthread_rwlock_unlock: popl %ebx cfi_adjust_cfa_offset(-4) cfi_restore(%ebx) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(8) cfi_offset(%ebx, -8) @@ -114,7 +114,7 @@ __pthread_rwlock_unlock: 4: xorl %eax, %eax popl %edi popl %ebx - ret + popl %ecx; nacljmp %ecx 1: #if MUTEX == 0 diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S index 100736499b..3187f654f9 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S @@ -121,7 +121,7 @@ __pthread_rwlock_wrlock: popl %esi cfi_adjust_cfa_offset(-4) cfi_restore(%esi) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(8) cfi_offset(%esi, -8) diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S index 86992c877e..435272748f 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S @@ -69,7 +69,7 @@ __new_sem_post: popl %ebx cfi_adjust_cfa_offset(-4) cfi_restore(%ebx) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(4) cfi_offset(%ebx, -8) @@ -97,7 +97,7 @@ __new_sem_post: orl $-1, %eax popl %ebx - ret + popl %ecx; nacljmp %ecx 3: #ifdef PIC @@ -125,7 +125,7 @@ __new_sem_post: popl %ebx cfi_adjust_cfa_offset(-4) cfi_restore(%ebx) - ret + popl %ecx; nacljmp %ecx cfi_endproc .size __new_sem_post,.-__new_sem_post versioned_symbol(libpthread, __new_sem_post, sem_post, GLIBC_2_1) @@ -154,7 +154,7 @@ __old_sem_post: popl %ebx cfi_adjust_cfa_offset(-4) cfi_restore(%ebx) - ret + popl %ecx; nacljmp %ecx cfi_endproc .size __old_sem_post,.-__old_sem_post compat_symbol(libpthread, __old_sem_post, sem_post, GLIBC_2_0) @@ -168,6 +168,6 @@ __old_sem_post: .type __i686.get_pc_thunk.bx,@function __i686.get_pc_thunk.bx: movl (%esp), %ebx; - ret + popl %ecx; nacljmp %ecx .size __i686.get_pc_thunk.bx,.-__i686.get_pc_thunk.bx #endif diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S index 13a36d64cc..f7bb45ff60 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S @@ -48,7 +48,7 @@ sem_timedwait: jne 2b xorl %eax, %eax - ret + popl %ecx; nacljmp %ecx /* Check whether the timeout value is valid. */ 1: pushl %esi @@ -142,7 +142,7 @@ sem_timedwait: .Lpop_edi: popl %esi .Lpop_esi: - ret + popl %ecx; nacljmp %ecx .Lafter_ret: 3: negl %esi diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S index 2d49934f02..c766a86a10 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S @@ -39,7 +39,7 @@ __new_sem_trywait: cmpxchgl %edx, (%ecx) jne 2b xorl %eax, %eax - ret + popl %ecx; nacljmp %ecx 1: #ifdef PIC @@ -63,7 +63,7 @@ __new_sem_trywait: movl $EAGAIN, (%eax) #endif orl $-1, %eax - ret + popl %ecx; nacljmp %ecx .size __new_sem_trywait,.-__new_sem_trywait versioned_symbol(libpthread, __new_sem_trywait, sem_trywait, GLIBC_2_1) #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) @@ -80,6 +80,6 @@ __old_sem_trywait = __new_sem_trywait .type __i686.get_pc_thunk.cx,@function __i686.get_pc_thunk.cx: movl (%esp), %ecx; - ret + popl %ecx; nacljmp %ecx .size __i686.get_pc_thunk.cx,.-__i686.get_pc_thunk.cx #endif diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S index 93c0a64a9e..d49ee09944 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S @@ -58,7 +58,7 @@ __new_sem_wait: movl 8(%esp), %ebx addl $12, %esp .Ladd_esp: - ret + popl %ecx; nacljmp %ecx .Lafter_ret: 1: LOCK @@ -303,7 +303,7 @@ __old_sem_wait: cfi_restore(ebx) cfi_restore(esi) cfi_adjust_cfa_offset(-12) - ret + popl %ecx; nacljmp %ecx cfi_adjust_cfa_offset(12) cfi_offset(ebx, -8)