aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-08-03 15:50:30 +0000
committerUlrich Drepper <drepper@redhat.com>2007-08-03 15:50:30 +0000
commitce31a3b1c588f8b8a5c7702c6460d6bd4386bd95 (patch)
tree3b8f897b1e40b26d31f18e8095cfd9102612de71
parent96c502084aeb396c8794723b32bdcad58a634695 (diff)
downloadglibc-ce31a3b1c588f8b8a5c7702c6460d6bd4386bd95.tar.xz
glibc-ce31a3b1c588f8b8a5c7702c6460d6bd4386bd95.zip
* intl/dcigettext.c (_nl_find_msg): Free encoding if __gconv_open
failed. * intl/finddomain.c (_nl_find_domain): Free normalized_codeset on failure. * elf/dl-load.c (decompose_rpath): Free copy if result couldn't be allocated. 2007-08-03 Jakub Jelinek <jakub@redhat.com>
-rw-r--r--ChangeLog10
-rw-r--r--elf/dl-load.c1
-rw-r--r--intl/dcigettext.c5
-rw-r--r--intl/finddomain.c3
-rw-r--r--localedata/ChangeLog4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S28
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S212
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h167
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S78
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S30
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S44
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S32
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S79
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S80
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S32
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S35
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S35
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S24
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S32
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/sem_post.S18
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S22
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S18
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S23
24 files changed, 602 insertions, 415 deletions
diff --git a/ChangeLog b/ChangeLog
index d31fc5a039..1354272297 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2007-08-03 Jakub Jelinek <jakub@redhat.com>
+ * intl/dcigettext.c (_nl_find_msg): Free encoding if __gconv_open
+ failed.
+ * intl/finddomain.c (_nl_find_domain): Free normalized_codeset
+ on failure.
+
+ * elf/dl-load.c (decompose_rpath): Free copy if result couldn't be
+ allocated.
+
+2007-08-03 Jakub Jelinek <jakub@redhat.com>
+
* rt/mqueue.h (mq_timedreceive, mq_timedsend): Fix nonnull argument
numbers.
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 1a84e0fe43..98d25b827d 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -578,6 +578,7 @@ decompose_rpath (struct r_search_path_struct *sps,
* sizeof (*result));
if (result == NULL)
{
+ free (copy);
errstring = N_("cannot create cache for search path");
signal_error:
_dl_signal_error (ENOMEM, NULL, NULL, errstring);
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index 23e019ab32..ad2835f930 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -949,7 +949,10 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp)
nothing to do. Otherwise do not use the
translation at all. */
if (__builtin_expect (r != __GCONV_NULCONV, 1))
- return NULL;
+ {
+ free ((char *) encoding);
+ return NULL;
+ }
convd->conv = (__gconv_t) -1;
}
diff --git a/intl/finddomain.c b/intl/finddomain.c
index 54e617ca99..03583b12b7 100644
--- a/intl/finddomain.c
+++ b/intl/finddomain.c
@@ -143,7 +143,7 @@ _nl_find_domain (dirname, locale, domainname, domainbinding)
if (retval == NULL)
/* This means we are out of core. */
- return NULL;
+ goto out;
if (retval->decided <= 0)
_nl_load_domain (retval, domainbinding);
@@ -159,6 +159,7 @@ _nl_find_domain (dirname, locale, domainname, domainbinding)
}
}
+out:
/* The space for normalized_codeset is dynamically allocated. Free it. */
if (mask & XPG_NORM_CODESET)
free ((void *) normalized_codeset);
diff --git a/localedata/ChangeLog b/localedata/ChangeLog
index 8eae5da34f..d27b6d7538 100644
--- a/localedata/ChangeLog
+++ b/localedata/ChangeLog
@@ -1,3 +1,7 @@
+2007-08-03 Jakub Jelinek <jakub@redhat.com>
+
+ * locales/translit_combining: Add U0141 and U0142.
+
2007-07-30 Jakub Jelinek <jakub@redhat.com>
* tst-strptime.c (do_test): Use %tu in fmt string for ptrdiff_t value.
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S
index be85ab7414..feb82110cf 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S
@@ -16,32 +16,4 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <kernel-features.h>
-
-/* All locks in libc are private. Use the kernel feature if possible. */
-#define FUTEX_PRIVATE_FLAG 128
-#ifdef __ASSUME_PRIVATE_FUTEX
-# define FUTEX_WAIT (0 | FUTEX_PRIVATE_FLAG)
-# define FUTEX_WAKE (1 | FUTEX_PRIVATE_FLAG)
-#else
-# define LOAD_FUTEX_WAIT(reg,tmp) \
- stc gbr, tmp ; \
- mov.w 99f, reg ; \
- add reg, tmp ; \
- bra 98f ; \
- mov.l @tmp, reg ; \
-99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
-98:
-
-# define LOAD_FUTEX_WAKE(reg,tmp) \
- stc gbr, tmp ; \
- mov.w 99f, reg ; \
- add reg, tmp ; \
- mov.l @tmp, reg ; \
- bra 98f ; \
- mov #FUTEX_WAKE, tmp ; \
-99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
-98: or tmp, reg
-#endif
-
#include "lowlevellock.S"
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
index b10903bcd7..e929e28499 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
@@ -18,45 +18,112 @@
#include <sysdep.h>
#include <pthread-errnos.h>
+#include <kernel-features.h>
+#include <lowlevellock.h>
#include "lowlevel-atomic.h"
.text
-#define SYS_gettimeofday __NR_gettimeofday
-#define SYS_futex 240
-#ifndef FUTEX_WAIT
-# define FUTEX_WAIT 0
-# define FUTEX_WAKE 1
-#endif
-
-#ifndef LOAD_FUTEX_WAIT
+#ifdef __ASSUME_PRIVATE_FUTEX
+# define LOAD_PRIVATE_FUTEX_WAIT(reg,tmp,tmp2) \
+ mov #(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg; \
+ extu.b reg, reg
+# define LOAD_PRIVATE_FUTEX_WAKE(reg,tmp,tmp2) \
+ mov #(FUTEX_WAKE | FUTEX_PRIVATE_FLAG), reg; \
+ extu.b reg, reg
+# define LOAD_FUTEX_WAIT(reg,tmp,tmp2) \
+ mov #(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), tmp; \
+ extu.b tmp, tmp; \
+ xor tmp, reg
+# define LOAD_FUTEX_WAKE(reg,tmp,tmp2) \
+ mov #(FUTEX_WAKE | FUTEX_PRIVATE_FLAG), tmp; \
+ extu.b tmp, tmp; \
+ xor tmp, reg
+#else
# if FUTEX_WAIT == 0
-# define LOAD_FUTEX_WAIT(reg,tmp) \
- xor reg, reg
+# define LOAD_PRIVATE_FUTEX_WAIT(reg,tmp,tmp2) \
+ stc gbr, tmp ; \
+ mov.w 99f, reg ; \
+ add reg, tmp ; \
+ bra 98f ; \
+ mov.l @tmp, reg ; \
+99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
+98:
# else
-# define LOAD_FUTEX_WAIT(reg,tmp) \
- mov #FUTEX_WAIT, reg; \
- extu.b reg, reg
+# define LOAD_PRIVATE_FUTEX_WAIT(reg,tmp,tmp2) \
+ stc gbr, tmp ; \
+ mov.w 99f, reg ; \
+ add reg, tmp ; \
+ mov.l @tmp, reg ; \
+ bra 98f ; \
+ mov #FUTEX_WAIT, tmp ; \
+99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
+98: or tmp, reg
+# endif
+# define LOAD_PRIVATE_FUTEX_WAKE(reg,tmp,tmp2) \
+ stc gbr, tmp ; \
+ mov.w 99f, reg ; \
+ add reg, tmp ; \
+ mov.l @tmp, reg ; \
+ bra 98f ; \
+ mov #FUTEX_WAKE, tmp ; \
+99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
+98: or tmp, reg
+# if FUTEX_WAIT == 0
+# define LOAD_FUTEX_WAIT(reg,tmp,tmp2) \
+ stc gbr, tmp ; \
+ mov.w 99f, tmp2 ; \
+ add tmp2, tmp ; \
+ mov.l @tmp, tmp2 ; \
+ bra 98f ; \
+ mov #FUTEX_PRIVATE_FLAG, tmp
+99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
+98: extu.b tmp, tmp ; \
+ xor tmp, reg ; \
+ and tmp2, reg
+# else
+# define LOAD_FUTEX_WAIT(reg,tmp,tmp2) \
+ stc gbr, tmp ; \
+ mov.w 99f, tmp2 ; \
+ add tmp2, tmp ; \
+ mov.l @tmp, tmp2 ; \
+ bra 98f ; \
+ mov #FUTEX_PRIVATE_FLAG, tmp
+99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
+98: extu.b tmp, tmp ; \
+ xor tmp, reg ; \
+ and tmp2, reg ; \
+ mov #FUTEX_WAIT, tmp ; \
+ or tmp, reg
# endif
# define LOAD_FUTEX_WAKE(reg,tmp) \
- mov #FUTEX_WAKE, reg; \
- extu.b reg, reg
+ stc gbr, tmp ; \
+ mov.w 99f, tmp2 ; \
+ add tmp2, tmp ; \
+ mov.l @tmp, tmp2 ; \
+ bra 98f ; \
+ mov #FUTEX_PRIVATE_FLAG, tmp
+99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
+98: extu.b tmp, tmp ; \
+ xor tmp, reg ; \
+ and tmp2, reg ; \
+ mov #FUTEX_WAKE, tmp ; \
+ or tmp, reg
#endif
-
- .globl __lll_mutex_lock_wait
- .type __lll_mutex_lock_wait,@function
- .hidden __lll_mutex_lock_wait
+ .globl __lll_lock_wait_private
+ .type __lll_lock_wait_private,@function
+ .hidden __lll_lock_wait_private
.align 5
cfi_startproc
-__lll_mutex_lock_wait:
+__lll_lock_wait_private:
mov.l r8, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r8, 0)
mov r4, r6
mov r5, r8
mov #0, r7 /* No timeout. */
- LOAD_FUTEX_WAIT (r5, r0)
+ LOAD_PRIVATE_FUTEX_WAIT (r5, r0, r1)
mov #2, r4
cmp/eq r4, r6
@@ -79,22 +146,67 @@ __lll_mutex_lock_wait:
ret
mov r2, r0
cfi_endproc
- .size __lll_mutex_lock_wait,.-__lll_mutex_lock_wait
-
+ .size __lll_lock_wait_private,.-__lll_lock_wait_private
#ifdef NOT_IN_libc
- .globl __lll_mutex_timedlock_wait
- .type __lll_mutex_timedlock_wait,@function
- .hidden __lll_mutex_timedlock_wait
+ .globl __lll_lock_wait
+ .type __lll_lock_wait,@function
+ .hidden __lll_lock_wait
.align 5
cfi_startproc
-__lll_mutex_timedlock_wait:
+__lll_lock_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)
+ mov r6, r9
+ mov r4, r6
+ mov r5, r8
+ mov #0, r7 /* No timeout. */
+ mov r9, r5
+ LOAD_FUTEX_WAIT (r5, r0, r1)
+
+ mov #2, r4
+ cmp/eq r4, r6
+ bf 2f
+
+1:
+ mov r8, r4
+ mov #SYS_futex, r3
+ extu.b r3, r3
+ trapa #0x14
+ SYSCALL_INST_PAD
+
+2:
+ mov #2, r6
+ XCHG (r6, @r8, r2)
+ tst r2, r2
+ bf 1b
+
+ mov.l @r15+, r8
+ mov.l @r15+, r9
+ ret
+ mov r2, r0
+ cfi_endproc
+ .size __lll_lock_wait,.-__lll_lock_wait
+
+ .globl __lll_timedlock_wait
+ .type __lll_timedlock_wait,@function
+ .hidden __lll_timedlock_wait
+ .align 5
+ cfi_startproc
+__lll_timedlock_wait:
/* Check for a valid timeout value. */
mov.l @(4,r6), r1
mov.l .L1g, r0
cmp/hs r0, r1
bt 3f
+ mov.l r11, @-r15
+ cfi_adjust_cfa_offset(4)
+ cfi_rel_offset (r11, 0)
mov.l r10, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r10, 0)
@@ -104,6 +216,7 @@ __lll_mutex_timedlock_wait:
mov.l r8, @-r15
cfi_adjust_cfa_offset(4)
cfi_rel_offset (r8, 0)
+ mov r7, r11
mov r4, r10
mov r6, r9
mov r5, r8
@@ -116,7 +229,7 @@ __lll_mutex_timedlock_wait:
/* Get current time. */
mov r15, r4
mov #0, r5
- mov #SYS_gettimeofday, r3
+ mov #__NR_gettimeofday, r3
trapa #0x12
SYSCALL_INST_PAD
@@ -149,7 +262,8 @@ __lll_mutex_timedlock_wait:
bt 8f
mov r8, r4
- LOAD_FUTEX_WAIT (r5, r0)
+ mov r11, r5
+ LOAD_FUTEX_WAIT (r5, r0, r1)
mov r10, r6
mov r15, r7
mov #SYS_futex, r3
@@ -169,8 +283,9 @@ __lll_mutex_timedlock_wait:
add #8, r15
mov.l @r15+, r8
mov.l @r15+, r9
+ mov.l @r15+, r10
rts
- mov.l @r15+, r10
+ mov.l @r15+, r11
7:
/* Check whether the time expired. */
mov #-ETIMEDOUT, r1
@@ -198,17 +313,16 @@ __lll_mutex_timedlock_wait:
.L1g:
.long 1000000000
- .size __lll_mutex_timedlock_wait,.-__lll_mutex_timedlock_wait
+ .size __lll_timedlock_wait,.-__lll_timedlock_wait
#endif
-
- .globl __lll_mutex_unlock_wake
- .type __lll_mutex_unlock_wake,@function
- .hidden __lll_mutex_unlock_wake
+ .globl __lll_unlock_wake_private
+ .type __lll_unlock_wake_private,@function
+ .hidden __lll_unlock_wake_private
.align 5
cfi_startproc
-__lll_mutex_unlock_wake:
- LOAD_FUTEX_WAKE (r5, r0)
+__lll_unlock_wake_private:
+ LOAD_PRIVATE_FUTEX_WAKE (r5, r0, r1)
mov #1, r6 /* Wake one thread. */
mov #0, r7
mov.l r7, @r4 /* Stores 0. */
@@ -219,10 +333,28 @@ __lll_mutex_unlock_wake:
rts
nop
cfi_endproc
- .size __lll_mutex_unlock_wake,.-__lll_mutex_unlock_wake
-
+ .size __lll_unlock_wake_private,.-__lll_unlock_wake_private
#ifdef NOT_IN_libc
+ .globl __lll_unlock_wake
+ .type __lll_unlock_wake,@function
+ .hidden __lll_unlock_wake
+ .align 5
+ cfi_startproc
+__lll_unlock_wake:
+ LOAD_FUTEX_WAKE (r5, r0, r1)
+ mov #1, r6 /* Wake one thread. */
+ mov #0, r7
+ mov.l r7, @r4 /* Stores 0. */
+ mov #SYS_futex, r3
+ extu.b r3, r3
+ trapa #0x14
+ SYSCALL_INST_PAD
+ rts
+ nop
+ cfi_endproc
+ .size __lll_unlock_wake,.-__lll_unlock_wake
+
.globl __lll_timedwait_tid
.type __lll_timedwait_tid,@function
.hidden __lll_timedwait_tid
@@ -246,7 +378,7 @@ __lll_timedwait_tid:
/* Get current time. */
mov r15, r4
mov #0, r5
- mov #SYS_gettimeofday, r3
+ mov #__NR_gettimeofday, r3
trapa #0x12
SYSCALL_INST_PAD
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
index be47bd752e..88e94b9905 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
@@ -19,19 +19,24 @@
#ifndef _LOWLEVELLOCK_H
#define _LOWLEVELLOCK_H 1
+#ifndef __ASSEMBLER__
#include <time.h>
#include <sys/param.h>
#include <bits/pthreadtypes.h>
#include <kernel-features.h>
+#endif
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
+#define FUTEX_CMP_REQUEUE 4
+#define FUTEX_WAKE_OP 5
#define FUTEX_LOCK_PI 6
#define FUTEX_UNLOCK_PI 7
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_PRIVATE_FLAG 128
+#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1)
/* Values for 'private' parameter of locking macros. Yes, the
definition seems to be backwards. But it is not. The bit will be
@@ -64,20 +69,30 @@
# endif
#endif
+#ifndef __ASSEMBLER__
/* Initializer for compatibility lock. */
-#define LLL_MUTEX_LOCK_INITIALIZER (0)
-#define LLL_MUTEX_LOCK_INITIALIZER_LOCKED (1)
-#define LLL_MUTEX_LOCK_INITIALIZER_WAITERS (2)
-
-extern int __lll_mutex_lock_wait (int val, int *__futex) attribute_hidden;
-extern int __lll_mutex_timedlock_wait (int val, int *__futex,
- const struct timespec *abstime)
- attribute_hidden;
-extern int __lll_mutex_unlock_wake (int *__futex) attribute_hidden;
-
-
-#define lll_mutex_trylock(futex) \
+#define LLL_LOCK_INITIALIZER (0)
+#define LLL_LOCK_INITIALIZER_LOCKED (1)
+#define LLL_LOCK_INITIALIZER_WAITERS (2)
+
+extern int __lll_lock_wait_private (int val, int *__futex)
+ attribute_hidden;
+extern int __lll_lock_wait (int val, int *__futex, int private)
+ attribute_hidden;
+extern int __lll_timedlock_wait (int val, int *__futex,
+ const struct timespec *abstime, int private)
+ attribute_hidden;
+extern int __lll_robust_lock_wait (int val, int *__futex, int private)
+ attribute_hidden;
+extern int __lll_robust_timedlock_wait (int val, int *__futex,
+ const struct timespec *abstime,
+ int private)
+ attribute_hidden;
+extern int __lll_unlock_wake_private (int *__futex) attribute_hidden;
+extern int __lll_unlock_wake (int *__futex, int private) attribute_hidden;
+
+#define lll_trylock(futex) \
({ unsigned char __result; \
__asm __volatile ("\
.align 2\n\
@@ -94,12 +109,12 @@ extern int __lll_mutex_unlock_wake (int *__futex) attribute_hidden;
negc %0,%0"\
: "=r" (__result) \
: "r" (&(futex)), \
- "r" (LLL_MUTEX_LOCK_INITIALIZER_LOCKED), \
- "r" (LLL_MUTEX_LOCK_INITIALIZER) \
+ "r" (LLL_LOCK_INITIALIZER_LOCKED), \
+ "r" (LLL_LOCK_INITIALIZER) \
: "r0", "r1", "r2", "t", "memory"); \
__result; })
-#define lll_robust_mutex_trylock(futex, id) \
+#define lll_robust_trylock(futex, id) \
({ unsigned char __result; \
__asm __volatile ("\
.align 2\n\
@@ -117,11 +132,11 @@ extern int __lll_mutex_unlock_wake (int *__futex) attribute_hidden;
: "=r" (__result) \
: "r" (&(futex)), \
"r" (id), \
- "r" (LLL_MUTEX_LOCK_INITIALIZER) \
+ "r" (LLL_LOCK_INITIALIZER) \
: "r0", "r1", "r2", "t", "memory"); \
__result; })
-#define lll_mutex_cond_trylock(futex) \
+#define lll_cond_trylock(futex) \
({ unsigned char __result; \
__asm __volatile ("\
.align 2\n\
@@ -138,13 +153,13 @@ extern int __lll_mutex_unlock_wake (int *__futex) attribute_hidden;
negc %0,%0"\
: "=r" (__result) \
: "r" (&(futex)), \
- "r" (LLL_MUTEX_LOCK_INITIALIZER_WAITERS), \
- "r" (LLL_M