[git commit master] PIC fixes for hardened

Timo Teräs timo.teras at iki.fi
Fri Apr 23 14:31:55 UTC 2010


commit: http://git.uclibc.org/uClibc/commit/?id=5418ef694ee17c698270702d927f04836706e60b
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

Signed-off-by: Timo Teräs <timo.teras at iki.fi>
Signed-off-by: Natanael Copa <natanael.copa at gmail.com>
Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 libpthread/nptl/sysdeps/pthread/Makefile.in        |    4 ++--
 .../sysdeps/unix/sysv/linux/i386/Makefile.arch     |    7 ++++---
 .../sysdeps/unix/sysv/linux/i386/lowlevellock.h    |    6 ++++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/libpthread/nptl/sysdeps/pthread/Makefile.in b/libpthread/nptl/sysdeps/pthread/Makefile.in
index 2a82532..4524015 100644
--- a/libpthread/nptl/sysdeps/pthread/Makefile.in
+++ b/libpthread/nptl/sysdeps/pthread/Makefile.in
@@ -23,8 +23,8 @@ libpthread_CSRC = pthread_barrier_wait.c pthread_cond_broadcast.c	\
 
 ifeq ($(TARGET_ARCH),i386)
 X86_PTHREAD_EXCLUDE_LIST = pthread_spin_unlock.c pthread_spin_init.c \
-		pthread_cond_wait.c pthread_barrier_wait.c pthread_cond_broadcast.c	\
-		pthread_cond_signal.c pthread_cond_timedwait.c pthread_rwlock_timedrdlock.c	\
+		pthread_barrier_wait.c pthread_cond_broadcast.c	\
+		pthread_cond_signal.c pthread_rwlock_timedrdlock.c	\
 		pthread_rwlock_timedwrlock.c pthread_rwlock_unlock.c pthread_rwlock_wrlock.c \
 		pthread_rwlock_rdlock.c
 
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch
index 06c0bd8..740ee7f 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch
@@ -15,9 +15,10 @@ libc_a_CSRC = fork.c
 libc_a_SSRC = clone.S vfork.S
 
 libpthread_SSRC += i486/lowlevellock.S i486/pthread_barrier_wait.S i486/pthread_cond_signal.S i486/pthread_cond_broadcast.S \
-				   i486/pthread_cond_timedwait.S i486/pthread_cond_wait.S i486/sem_post.S i486/sem_timedwait.S \
-				   i486/sem_trywait.S i486/sem_wait.S i486/pthread_rwlock_rdlock.S i486/pthread_rwlock_wrlock.S \
-				   i486/pthread_rwlock_timedrdlock.S i486/pthread_rwlock_timedwrlock.S i486/pthread_rwlock_unlock.S
+		   i486/sem_post.S i486/sem_timedwait.S \
+		   i486/sem_trywait.S i486/sem_wait.S i486/pthread_rwlock_rdlock.S i486/pthread_rwlock_wrlock.S \
+		   i486/pthread_rwlock_timedrdlock.S i486/pthread_rwlock_timedwrlock.S i486/pthread_rwlock_unlock.S
+#i486/pthread_cond_timedwait.S i486/pthread_cond_wait.S
 
 libc_a_SSRC += i486/libc-lowlevellock.S
 
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
index 785f2ac..1a060c0 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
@@ -65,8 +65,10 @@ typedef int lll_lock_t;
 /* Delay in spinlock loop.  */
 #define BUSY_WAIT_NOP          __asm__ ("rep; nop")
 
-
 #define lll_futex_wait(futex, val) \
+  lll_futex_timed_wait (futex, val, NULL)
+
+#define lll_futex_timed_wait(futex, val, timeout) \
   ({									      \
     int __ret;							      \
     register __typeof (val) _val __asm__ ("edx") = (val);		      \
@@ -74,7 +76,7 @@ typedef int lll_lock_t;
 		      LLL_ENTER_KERNEL					      \
 		      LLL_EBX_LOAD					      \
 		      : "=a" (__ret)					      \
-		      : "0" (SYS_futex), LLL_EBX_REG (futex), "S" (0),	      \
+		      : "0" (SYS_futex), LLL_EBX_REG (futex), "S" (timeout),  \
 			"c" (FUTEX_WAIT), "d" (_val),			      \
 			"i" (offsetof (tcbhead_t, sysinfo)));		      \
    __ret; })
-- 
1.6.3.3



More information about the uClibc-cvs mailing list