+2004-12-01 Jakub Jelinek <jakub@redhat.com>
+
+ * elf/rtld.c (process_envvars): Don't consider LD_SHOW_AUXV
+ and LD_DYNAMIC_WEAK if __libc_enable_secure.
+ If __libc_enable_secure, /etc/suid-debug doesn't exist and
+ program will be actually run, turn off all debugging.
+ * sysdeps/generic/unsecvars.h (UNSECURE_ENVVARS): Add LD_DEBUG,
+ LD_DYNAMIC_WEAK and LD_SHOW_AUXV.
+
+2004-12-06 Jakub Jelinek <jakub@redhat.com>
+
+ * time/tzset.c (tzset_internal): If + or - is seen,
+ but no offset after it, reset offset to 0. [BZ #601]
+
+2004-12-06 Ulrich Drepper <drepper@redhat.com>
+
+ * libio/ioseekpos.c (_IO_seekpos_unlocked): Call _IO_SEEKOFF not
+ _IO_SEEKPOS, saving one indirect jump.
+
+ * libio/fileops.c (_IO_new_file_seekoff): Fix optimization of in-buffer
+ seek. Remove dead code.
+
+2004-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ * libio/Makefile (tests): Add bug-ungetc4.
+ * libio/bug-ungetc4.c: New test.
+
+2004-12-06 Roland McGrath <roland@redhat.com>
+
+ * sysdeps/unix/clock_nanosleep.c (clock_nanosleep): Diagnose EINVAL
+ for CLOCK_THREAD_CPUTIME_ID, not ENOTSUP.
+ Use SYSDEP_NANOSLEEP handler before validating CLOCK_ID value.
+
+ * rt/tst-timer4.c (TEST_CLOCK, TEST_CLOCK_NANOSLEEP): New macros.
+ Use them throughout in place of CLOCK_REALTIME and nanosleep.
+ (do_test) [TEST_CLOCK_MISSING]: Call this macro and if it returns
+ non-null, punt the test with a message using the string returned.
+ * rt/tst-timer5.c: New file.
+ * rt/Makefile (tests): Add it.
+
+2004-12-01 Paolo Bonzini <bonzini@gnu.org>
+
+ * posix/regcomp.c (free_dfa_content, init_dfa): Remove
+ references to re_dfa_t's subexps field.
+ (parse_sub_exp, parse_expression): Do not use it. Use
+ completed_bkref_map instead.
+ (create_initial_state, peek_token): Store a backreference \N
+ with opr.idx = N-1.
+ * posix/regexec.c (proceed_next_node, check_dst_limits, get_subexp):
+ Likewise.
+ (check_subexp_limits): Remove useless condition.
+ * posix/regex_internal.h (re_subexp_t): Remove.
+ (re_dfa_t): Remove subexps and subexps_alloc field, add
+ completed_bkref_map.
+
+2004-12-05 Roland McGrath <roland@frob.com>
+
+ * Makeconfig: Comment typo fix.
+
+2004-11-30 Andreas Schwab <schwab@suse.de>
+
+ * nis/ypclnt.c (ypprot_err): Remove unused entries.
+
+2004-11-30 Paolo Bonzini <bonzini@gnu.org>
+
+ * posix/regexec.c (check_dst_limits_calc_pos_1): Check for
+ bkref_idx == -1, and don't recurse in that case.
+
+2004-11-30 GOTO Masanori <gotom@debian.or.jp>
+
+ * posix/confstr.c: Enclose #error message with double quote
+ for gcc-3.3 and lower.
+
+2004-12-04 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/i386/clone.S: Add support for NPTL where
+ the PID is stored at userlevel and needs to be reset when CLONE_THREAD
+ is not used.
+ * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
+
+2004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * sysdeps/arm/sysdep.h: Define __USE_BX__ if bx is available.
+ Use it instead of __THUMB_INTERWORK__. Make RETINSTR take
+ only a condition and a register.
+ * sysdeps/arm/dl-machine.h: Use __USE_BX__ instead of
+ __THUMB_INTERWORK__.
+ (_dl_start_user): Use BX.
+ * sysdeps/arm/strlen.S: Use DO_RET.
+ * sysdeps/unix/arm/brk.S: Likewise.
+ * sysdeps/unix/arm/fork.S: Likewise.
+ * sysdeps/unix/arm/sysdep.S: Likewise.
+ * sysdeps/unix/arm/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/arm/clone.S: Update uses of RETINSTR.
+ * sysdeps/unix/sysv/linux/arm/mmap.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/mmap64.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/socket.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/arm/vfork.S: Likewise.
+
2004-12-01 Jakub Jelinek <jakub@redhat.com>
* posix/tst-regex.c: Use defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
_POSIX_THREAD_CPUTIME is defined to 0, return -1 for the corresponding
_SC_ argument.
-2004-12-02 Jakub Jelinek <jakub@redhat.com>
-
- * libio/Makefile (tests): Add bug-ungetc4.
- * libio/bug-ungetc4.c: New test.
-
2004-12-02 Roland McGrath <roland@redhat.com>
* extra-lib.mk (object-suffixes-$(lib)): Add .oS when
shlib-versions.v shlib-versions.v.i
# Generate the header containing the names of all shared libraries.
-# We use a stamp file to avoid uncessary recompilations.
+# We use a stamp file to avoid unnecessary recompilations.
before-compile += $(common-objpfx)gnu/lib-names.h
ifeq ($(soversions.mk-done),t)
$(common-objpfx)gnu/lib-names.h: $(common-objpfx)gnu/lib-names.stmp; @:
case 9:
/* Test whether we want to see the content of the auxiliary
array passed up from the kernel. */
- if (memcmp (envline, "SHOW_AUXV", 9) == 0)
+ if (!INTUSE(__libc_enable_secure)
+ && memcmp (envline, "SHOW_AUXV", 9) == 0)
_dl_show_auxv ();
break;
break;
}
- if (memcmp (envline, "DYNAMIC_WEAK", 12) == 0)
+ if (!INTUSE(__libc_enable_secure)
+ && memcmp (envline, "DYNAMIC_WEAK", 12) == 0)
GLRO(dl_dynamic_weak) = 1;
break;
while (*nextp != '\0');
if (__access ("/etc/suid-debug", F_OK) != 0)
- unsetenv ("MALLOC_CHECK_");
+ {
+ unsetenv ("MALLOC_CHECK_");
+ if (mode == normal)
+ GLRO(dl_debug_mask) = 0;
+ }
}
/* If we have to run the dynamic linker in debugging mode and the
LD_DEBUG_OUTPUT environment variable is given, we write the debug
# This file is updated automatically by Makefile.
glibc-branch := fedora
glibc-base := HEAD
-fedora-sync-date := 2004-12-03 09:35 UTC
-fedora-sync-tag := fedora-glibc-20041203T0935
+fedora-sync-date := 2004-12-07 13:31 UTC
+fedora-sync-tag := fedora-glibc-20041207T1331
-%define glibcrelease 87
+%define glibcrelease 88
%define auxarches i586 i686 athlon sparcv9 alphaev6
%define prelinkarches noarch
%define nptlarches i386 i686 athlon x86_64 ia64 s390 s390x sparcv9 ppc ppc64
grep '%{_prefix}/bin' < rpm.filelist >> common.filelist
grep '%{_prefix}/lib/locale' < rpm.filelist >> common.filelist
-grep '%{_prefix}/libexec' < rpm.filelist >> common.filelist
+grep '%{_prefix}/libexec/pt_chown' < rpm.filelist >> common.filelist
grep '%{_prefix}/sbin/[^gi]' < rpm.filelist >> common.filelist
grep '%{_prefix}/share' < rpm.filelist \
| grep -v '%{_prefix}/share/zoneinfo' >> common.filelist
mv rpm.filelist rpm.filelist.full
grep -v '%{_prefix}/bin' < rpm.filelist.full |
grep -v '%{_prefix}/lib/locale' |
- grep -v '%{_prefix}/libexec' |
+ grep -v '%{_prefix}/libexec/pt_chown' |
grep -v '%{_prefix}/sbin/[^gi]' |
grep -v '%{_prefix}/share' > rpm.filelist
%verify(not md5 size mtime) %config(noreplace) /etc/nsswitch.conf
%verify(not md5 size mtime) %config(noreplace) /etc/ld.so.conf
%dir /etc/ld.so.conf.d
+%dir %{_prefix}/libexec/getconf
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache
%doc README NEWS INSTALL FAQ BUGS NOTES PROJECTS CONFORMANCE
%doc COPYING COPYING.LIB README.libm LICENSES
%endif
%changelog
+* Tue Dec 7 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-88
+- update from CVS
+ - disregard LD_SHOW_AUXV and LD_DYNAMIC_WEAK if __libc_enable_secure
+ - disregard LD_DEBUG if __libc_enable_secure in normal mode
+ if /suid-debug doesn't exist
+ - fix fseekpos after ungetc
+ - avoid reading bytes before start of buffers in regex's
+ check_dst_limits_calc_pos_1 (#142060)
+ - make getpid () working with clone/clone2 without CLONE_THREAD
+ (so far on i386/x86_64/ia64 only)
+- move %{_prefix}/libexec/getconf/* to glibc from glibc-common
+- make %{_prefix}/libexec/getconf directory owned by glibc package
+
* Fri Dec 3 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-87
- update from CVS
- build libpthread_nonshared.a objects with -fPIC on s390/s390x
if (fp->_offset != _IO_pos_BAD && fp->_IO_read_base != NULL
&& !_IO_in_backup (fp))
{
- /* Offset relative to start of main get area. */
- _IO_off64_t rel_offset = (offset - fp->_offset
- + (fp->_IO_read_end - fp->_IO_read_base));
- if (rel_offset >= 0)
+ _IO_off64_t start_offset = (fp->_offset
+ - (fp->_IO_read_end - fp->_IO_buf_base));
+ if (offset >= start_offset && offset < fp->_offset)
{
-#if 0
- if (_IO_in_backup (fp))
- _IO_switch_to_main_get_area (fp);
-#endif
- if (rel_offset <= fp->_IO_read_end - fp->_IO_read_base)
- {
- _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base + rel_offset,
- fp->_IO_read_end);
- _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
- {
- _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
- goto resync;
- }
- }
-#ifdef TODO
- /* If we have streammarkers, seek forward by reading ahead. */
- if (_IO_have_markers (fp))
- {
- int to_skip = rel_offset
- - (fp->_IO_read_ptr - fp->_IO_read_base);
- if (ignore (to_skip) != to_skip)
- goto dumb;
- _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
- goto resync;
- }
-#endif
- }
-#ifdef TODO
- if (rel_offset < 0 && rel_offset >= Bbase () - Bptr ())
- {
- if (!_IO_in_backup (fp))
- _IO_switch_to_backup_area (fp);
- gbump (fp->_IO_read_end + rel_offset - fp->_IO_read_ptr);
+ _IO_setg (fp, fp->_IO_buf_base,
+ fp->_IO_buf_base + (offset - start_offset),
+ fp->_IO_read_end);
+ _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
+
_IO_mask_flags (fp, 0, _IO_EOF_SEEN);
goto resync;
}
-#endif
}
-#ifdef TODO
- INTUSE(_IO_unsave_markers) (fp);
-#endif
-
if (fp->_flags & _IO_NO_READS)
goto dumb;
-/* Copyright (C) 1993,1997,1998,1999,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1997-1999,2002,2003,2004 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
INTUSE(_IO_free_wbackup_area) (fp);
}
- return _IO_SEEKPOS (fp, pos, mode);
+ return _IO_SEEKOFF (fp, pos, 0, mode);
}
+2004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Update RETINSTR use.
+ * sysdeps/unix/sysv/linux/arm/vfork.S: Likewise.
+
2004-12-01 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
These are now handled by generic magic from
libpthread-static-only-routines being set.
-2004-11-04 Roland McGrath <roland@redhat.com>
-
- * sysdeps/pthread/getcpuclockid.c (pthread_getcpuclockid)
- [__NR_clock_getres]: Use kernel-supplied CPU clocks if available.
-
2004-11-27 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
# define MAYBE_SAVE_LR \
str lr, [sp, $-4]!;
# define PSEUDO_RET_MOV \
- RETINSTR(movcc, pc, lr); \
+ RETINSTR(cc, lr); \
b PLTJMP(SYSCALL_ERROR)
# define PSEUDO_PROLOGUE
# else
swi __NR_vfork
cmn a1, #4096
- RETINSTR(movcc, pc, lr)
+ RETINSTR(cc, lr)
#ifndef __ASSUME_VFORK_SYSCALL
/* Check if vfork syscall is known at all. */
/* If we don't have vfork, fork is close enough. */
swi __NR_fork
cmn a1, #4096
- RETINSTR(movcc, pc, lr)
+ RETINSTR(cc, lr)
#elif !defined __NR_vfork
# error "__NR_vfork not available and __ASSUME_VFORK_SYSCALL defined"
#endif
static const int8_t yp_2_yperr[] =
{
#define YP2YPERR(yp, yperr) [YP_##yp - YP_VERS] = YPERR_##yperr
- YP2YPERR (TRUE, SUCCESS),
- YP2YPERR (NOMORE, NOMORE),
- YP2YPERR (FALSE, YPERR),
- YP2YPERR (NOMAP, MAP),
- YP2YPERR (NODOM, DOMAIN),
YP2YPERR (NOKEY, KEY),
YP2YPERR (BADOP, YPERR),
YP2YPERR (BADDB, BADDB),
+2004-12-04 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile (tests): Add tst-getpid1.
+ * tst-getpid1.c: New file.
+ * sysdeps/unix/sysv/linux/i386/clone.S: New file.
+ * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
+
2004-12-01 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
These are now handled by generic magic from
libpthread-static-only-routines being set.
-2004-11-17 Roland McGrath <roland@redhat.com>
-
- * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
- CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
- translating to the kernel clockid_t for our own process/thread clock.
-
2004-11-27 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
here, before calling clone.
* pthread_create.c (start_thread): Don't do it here.
-2004-11-04 Roland McGrath <roland@redhat.com>
-
- * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
-
2004-11-02 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
tst-sched1 \
tst-backtrace1 \
tst-oddstacklimit \
- tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x
+ tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \
+ tst-getpid1
xtests = tst-setuid1 tst-setuid1-static
# Files which must not be linked with libpthread.
--- /dev/null
+#define RESET_PID
+#include <sysdeps/unix/sysv/linux/i386/clone.S>
--- /dev/null
+#define RESET_PID
+#include <sysdeps/unix/sysv/linux/x86_64/clone.S>
--- /dev/null
+#include <sched.h>
+#include <signal.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+static int sig;
+
+static int
+f (void *a)
+{
+ puts ("in f");
+ union sigval sival;
+ sival.sival_int = getpid ();
+ printf ("pid = %d\n", sival.sival_int);
+ if (sigqueue (getppid (), sig, sival) != 0)
+ return 1;
+ return 0;
+}
+
+
+static int
+do_test (void)
+{
+ int mypid = getpid ();
+
+ sig = SIGRTMIN;
+ sigset_t ss;
+ sigemptyset (&ss);
+ sigaddset (&ss, sig);
+ if (sigprocmask (SIG_BLOCK, &ss, NULL) != 0)
+ {
+ printf ("sigprocmask failed: %m\n");
+ return 1;
+ }
+
+ char st[128 * 1024];
+ pid_t p = clone (f, st + sizeof (st), 0, 0);
+ if (p == -1)
+ {
+ printf("clone failed: %m\n");
+ return 1;
+ }
+ printf ("new thread: %d\n", (int) p);
+
+ siginfo_t si;
+ do
+ if (sigwaitinfo (&ss, &si) < 0)
+ {
+ printf("sigwaitinfo failed: %m\n");
+ kill (p, SIGKILL);
+ return 1;
+ }
+ while (si.si_signo != sig || si.si_code != SI_QUEUE);
+
+ if (si.si_int != (int) p)
+ {
+ printf ("expected PID %d, got si_int %d\n", (int) p, si.si_int);
+ kill (p, SIGKILL);
+ return 1;
+ }
+
+ if (si.si_pid != p)
+ {
+ printf ("expected PID %d, got si_pid %d\n", (int) p, (int) si.si_pid);
+ kill (p, SIGKILL);
+ return 1;
+ }
+
+ int e;
+ if (waitpid (p, &e, __WCLONE) != p)
+ {
+ puts ("waitpid failed");
+ kill (p, SIGKILL);
+ return 1;
+ }
+ if (!WIFEXITED (e))
+ {
+ puts ("did not terminate correctly");
+ return 1;
+ }
+ if (WEXITSTATUS (e) != 0)
+ {
+ printf ("exit code %d\n", WEXITSTATUS (e));
+ return 1;
+ }
+
+ if (getpid () != mypid)
+ {
+ puts ("my PID changed");
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
case _CS_POSIX_V6_ILP32_OFF32_CFLAGS:
#ifdef __ILP32_OFF32_CFLAGS
# if _POSIX_V6_ILP32_OFF32 == -1
-# error __ILP32_OFF32_CFLAGS should not be defined
+# error "__ILP32_OFF32_CFLAGS should not be defined"
# elif !defined _POSIX_V6_ILP32_OFF32
if (__sysconf (_SC_V6_ILP32_OFF32) < 0)
break;
case _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS:
#ifdef __ILP32_OFFBIG_CFLAGS
# if _POSIX_V6_ILP32_OFFBIG == -1
-# error __ILP32_OFFBIG_CFLAGS should not be defined
+# error "__ILP32_OFFBIG_CFLAGS should not be defined"
# elif !defined _POSIX_V6_ILP32_OFFBIG
if (__sysconf (_SC_V6_ILP32_OFFBIG) < 0)
break;
case _CS_POSIX_V6_LP64_OFF64_CFLAGS:
#ifdef __LP64_OFF64_CFLAGS
# if _POSIX_V6_LP64_OFF64 == -1
-# error __LP64_OFF64_CFLAGS should not be defined
+# error "__LP64_OFF64_CFLAGS should not be defined"
# elif !defined _POSIX_V6_LP64_OFF64
if (__sysconf (_SC_V6_LP64_OFF64) < 0)
break;
case _CS_POSIX_V6_ILP32_OFF32_LDFLAGS:
#ifdef __ILP32_OFF32_LDFLAGS
# if _POSIX_V6_ILP32_OFF32 == -1
-# error __ILP32_OFF32_LDFLAGS should not be defined
+# error "__ILP32_OFF32_LDFLAGS should not be defined"
# elif !defined _POSIX_V6_ILP32_OFF32
if (__sysconf (_SC_V6_ILP32_OFF32) < 0)
break;
case _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS:
#ifdef __ILP32_OFFBIG_LDFLAGS
# if _POSIX_V6_ILP32_OFFBIG == -1
-# error __ILP32_OFFBIG_LDFLAGS should not be defined
+# error "__ILP32_OFFBIG_LDFLAGS should not be defined"
# elif !defined _POSIX_V6_ILP32_OFFBIG
if (__sysconf (_SC_V6_ILP32_OFFBIG) < 0)
break;
case _CS_POSIX_V6_LP64_OFF64_LDFLAGS:
#ifdef __LP64_OFF64_LDFLAGS
# if _POSIX_V6_LP64_OFF64 == -1
-# error __LP64_OFF64_LDFLAGS should not be defined
+# error "__LP64_OFF64_LDFLAGS should not be defined"
# elif !defined _POSIX_V6_LP64_OFF64
if (__sysconf (_SC_V6_LP64_OFF64) < 0)
break;
{
int i, j;
- re_free (dfa->subexps);
-
if (dfa->nodes)
for (i = 0; i < dfa->nodes_len; ++i)
{
dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size);
dfa->state_hash_mask = table_size - 1;
- dfa->subexps_alloc = 1;
- dfa->subexps = re_malloc (re_subexp_t, dfa->subexps_alloc);
-
dfa->mb_cur_max = MB_CUR_MAX;
#ifdef _LIBC
if (dfa->mb_cur_max == 6
}
#endif
- if (BE (dfa->nodes == NULL || dfa->state_table == NULL
- || dfa->subexps == NULL, 0))
+ if (BE (dfa->nodes == NULL || dfa->state_table == NULL, 0))
return REG_ESPACE;
return REG_NOERROR;
}
re_token_t *clexp_node;
clexp_node = dfa->nodes + init_nodes.elems[clexp_idx];
if (clexp_node->type == OP_CLOSE_SUBEXP
- && clexp_node->opr.idx + 1 == dfa->nodes[node_idx].opr.idx)
+ && clexp_node->opr.idx == dfa->nodes[node_idx].opr.idx)
break;
}
if (clexp_idx == init_nodes.nelem)
if (!(syntax & RE_NO_BK_REFS))
{
token->type = OP_BACK_REF;
- token->opr.idx = c2 - '0';
+ token->opr.idx = c2 - '1';
}
break;
case '<':
return NULL;
break;
case OP_BACK_REF:
- if (BE (preg->re_nsub < token->opr.idx
- || dfa->subexps[token->opr.idx - 1].end == -1, 0))
+ if (!BE (dfa->completed_bkref_map & (1 << token->opr.idx), 1))
{
*err = REG_ESUBREG;
return NULL;
}
- dfa->used_bkref_map |= 1 << (token->opr.idx - 1);
+ dfa->used_bkref_map |= 1 << token->opr.idx;
tree = re_dfa_add_tree_node (dfa, NULL, NULL, token);
if (BE (tree == NULL, 0))
{
bin_tree_t *tree, *left_par, *right_par;
size_t cur_nsub;
cur_nsub = preg->re_nsub++;
- if (BE (dfa->subexps_alloc < preg->re_nsub, 0))
- {
- re_subexp_t *new_array;
- dfa->subexps_alloc *= 2;
- new_array = re_realloc (dfa->subexps, re_subexp_t, dfa->subexps_alloc);
- if (BE (new_array == NULL, 0))
- {
- dfa->subexps_alloc /= 2;
- *err = REG_ESPACE;
- return NULL;
- }
- dfa->subexps = new_array;
- }
- dfa->subexps[cur_nsub].start = dfa->nodes_len;
- dfa->subexps[cur_nsub].end = -1;
left_par = re_dfa_add_tree_node (dfa, NULL, NULL, token);
if (BE (left_par == NULL, 0))
return NULL;
}
right_par = re_dfa_add_tree_node (dfa, NULL, NULL, token);
- dfa->subexps[cur_nsub].end = dfa->nodes_len;
+ dfa->completed_bkref_map |= 1 << cur_nsub;
tree = ((tree == NULL) ? right_par
: create_tree (dfa, tree, right_par, CONCAT, 0));
tree = create_tree (dfa, left_par, tree, CONCAT, 0);
};
typedef struct re_dfastate_t re_dfastate_t;
-typedef struct
-{
- /* start <= node < end */
- int start;
- int end;
-} re_subexp_t;
-
struct re_state_table_entry
{
int num;
struct re_dfa_t
{
- re_subexp_t *subexps;
re_token_t *nodes;
int nodes_alloc;
int nodes_len;
int str_tree_storage_idx;
/* number of subexpressions `re_nsub' is in regex_t. */
- int subexps_alloc;
unsigned int state_hash_mask;
int states_alloc;
int init_node;
int nbackref; /* The number of backreference in this dfa. */
+
/* Bitmap expressing which backreference is used. */
unsigned int used_bkref_map;
+ unsigned int completed_bkref_map;
+
unsigned int has_plural_match : 1;
/* If this dfa has "multibyte node", which is a backreference or
a node which can accept multibyte character or multi character
#endif /* RE_ENABLE_I18N */
if (type == OP_BACK_REF)
{
- int subexp_idx = dfa->nodes[node].opr.idx;
+ int subexp_idx = dfa->nodes[node].opr.idx + 1;
naccepted = regs[subexp_idx].rm_eo - regs[subexp_idx].rm_so;
if (fs != NULL)
{
int subexp_idx;
struct re_backref_cache_entry *ent;
ent = mctx->bkref_ents + limits->elems[lim_idx];
- subexp_idx = dfa->nodes[ent->node].opr.idx - 1;
+ subexp_idx = dfa->nodes[ent->node].opr.idx;
dst_pos = check_dst_limits_calc_pos (mctx, limits->elems[lim_idx],
subexp_idx, dst_node, dst_idx,
switch (dfa->nodes[node].type)
{
case OP_BACK_REF:
- {
- struct re_backref_cache_entry *ent = mctx->bkref_ents + bkref_idx;
- do
- {
- int dst, cpos;
-
- if (ent->node != node)
- continue;
-
- if (subexp_idx <= 8 * sizeof (ent->eps_reachable_subexps_map)
- && (ent->eps_reachable_subexps_map
- & (1 << (subexp_idx - 1))) == 0)
- continue;
+ if (bkref_idx != -1)
+ {
+ struct re_backref_cache_entry *ent = mctx->bkref_ents + bkref_idx;
+ do
+ {
+ int dst, cpos;
- /* Recurse trying to reach the OP_OPEN_SUBEXP and
- OP_CLOSE_SUBEXP cases below. But, if the
- destination node is the same node as the source
- node, don't recurse because it would cause an
- infinite loop: a regex that exhibits this behavior
- is ()\1*\1* */
- dst = dfa->edests[node].elems[0];
- if (dst == from_node)
- {
- if (boundaries & 1)
- return -1;
- else /* if (boundaries & 2) */
- return 0;
- }
+ if (ent->node != node)
+ continue;
- cpos = check_dst_limits_calc_pos_1 (mctx, boundaries,
- subexp_idx, dst, bkref_idx);
+ if (subexp_idx <= 8 * sizeof (ent->eps_reachable_subexps_map)
+ && !(ent->eps_reachable_subexps_map & (1 << subexp_idx)))
+ continue;
- if (cpos == -1 /* && (boundaries & 1) */)
- return -1;
+ /* Recurse trying to reach the OP_OPEN_SUBEXP and
+ OP_CLOSE_SUBEXP cases below. But, if the
+ destination node is the same node as the source
+ node, don't recurse because it would cause an
+ infinite loop: a regex that exhibits this behavior
+ is ()\1*\1* */
+ dst = dfa->edests[node].elems[0];
+ if (dst == from_node)
+ {
+ if (boundaries & 1)
+ return -1;
+ else /* if (boundaries & 2) */
+ return 0;
+ }
- if (cpos == 0 && (boundaries & 2))
- return 0;
+ cpos =
+ check_dst_limits_calc_pos_1 (mctx, boundaries, subexp_idx,
+ dst, bkref_idx);
+ if (cpos == -1 /* && (boundaries & 1) */)
+ return -1;
+ if (cpos == 0 && (boundaries & 2))
+ return 0;
- ent->eps_reachable_subexps_map &= ~(1 << (subexp_idx - 1));
- }
- while (ent++->more);
- break;
- }
+ ent->eps_reachable_subexps_map &= ~(1 << subexp_idx);
+ }
+ while (ent++->more);
+ }
+ break;
case OP_OPEN_SUBEXP:
if ((boundaries & 1) && subexp_idx == dfa->nodes[node].opr.idx)
if (str_idx <= ent->subexp_from || ent->str_idx < str_idx)
continue; /* This is unrelated limitation. */
- subexp_idx = dfa->nodes[ent->node].opr.idx - 1;
+ subexp_idx = dfa->nodes[ent->node].opr.idx;
if (ent->subexp_to == str_idx)
{
int ops_node = -1;
{
if (subexp_idx != dfa->nodes[node].opr.idx)
continue;
- if ((type == OP_CLOSE_SUBEXP && ent->subexp_to != str_idx)
- || (type == OP_OPEN_SUBEXP))
- {
- /* It is against this limitation.
- Remove it form the current sifted state. */
- err = sub_epsilon_src_nodes (dfa, node, dest_nodes,
- candidates);
- if (BE (err != REG_NOERROR, 0))
- return err;
- }
+ /* It is against this limitation.
+ Remove it form the current sifted state. */
+ err = sub_epsilon_src_nodes (dfa, node, dest_nodes,
+ candidates);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
}
}
}
while (entry++->more);
}
- subexp_num = dfa->nodes[bkref_node].opr.idx - 1;
+ subexp_num = dfa->nodes[bkref_node].opr.idx;
/* For each sub expression */
for (sub_top_idx = 0; sub_top_idx < mctx->nsub_tops; ++sub_top_idx)
tst-aio tst-aio64 tst-aio2 tst-aio3 tst-aio4 tst-aio5 tst-aio6 \
tst-aio7 tst-mqueue1 tst-mqueue2 tst-mqueue3 tst-mqueue4 \
tst-mqueue5 tst-mqueue6 tst-mqueue7 tst-mqueue8 tst-mqueue9 \
- tst-timer3 tst-timer4
+ tst-timer3 tst-timer4 tst-timer5
extra-libs := librt
extra-libs-others := $(extra-libs)
#if _POSIX_THREADS
# include <pthread.h>
+# ifndef TEST_CLOCK
+# define TEST_CLOCK CLOCK_REALTIME
+# endif
+
pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
thr1 (union sigval sigval)
{
pthread_mutex_lock (&lock);
- thr1_err = clock_gettime (CLOCK_REALTIME, &thr1_ts);
+ thr1_err = clock_gettime (TEST_CLOCK, &thr1_ts);
if (thr1_cnt >= 5)
{
struct itimerspec it = { };
}
}
pthread_mutex_lock (&lock);
- thr2_err = clock_gettime (CLOCK_REALTIME, &thr2_ts) | err;
+ thr2_err = clock_gettime (TEST_CLOCK, &thr2_ts) | err;
if (thr2_cnt >= 5)
{
struct itimerspec it = { };
if (sig != SIGRTMIN) err |= 1 << 0;
if (info->si_signo != SIGRTMIN) err |= 1 << 1;
if (info->si_code != SI_TIMER) err |= 1 << 2;
- if (clock_gettime (CLOCK_REALTIME, &sig1_ts) != 0)
+ if (clock_gettime (TEST_CLOCK, &sig1_ts) != 0)
err |= 1 << 3;
if (sig1_cnt >= 5)
{
if (sig != SIGRTMIN + 1) err |= 1 << 0;
if (info->si_signo != SIGRTMIN + 1) err |= 1 << 1;
if (info->si_code != SI_TIMER) err |= 1 << 2;
- if (clock_gettime (CLOCK_REALTIME, &sig2_ts) != 0)
+ if (clock_gettime (TEST_CLOCK, &sig2_ts) != 0)
err |= 1 << 3;
if (sig2_cnt >= 5)
{
{
int result = 0;
+#ifdef TEST_CLOCK_MISSING
+ const char *missing = TEST_CLOCK_MISSING (TEST_CLOCK);
+ if (missing != NULL)
+ {
+ printf ("%s missing, skipping test\n", missing);
+ return 0;
+ }
+#endif
+
struct timespec ts;
- if (clock_gettime (CLOCK_REALTIME, &ts) != 0)
+ if (clock_gettime (TEST_CLOCK, &ts) != 0)
{
printf ("*** clock_gettime failed: %m\n");
result = 1;
printf ("clock_gettime returned timespec = { %ld, %ld }\n",
(long) ts.tv_sec, ts.tv_nsec);
- if (clock_getres (CLOCK_REALTIME, &ts) != 0)
+ if (clock_getres (TEST_CLOCK, &ts) != 0)
{
printf ("*** clock_getres failed: %m\n");
result = 1;
struct sigevent ev;
memset (&ev, 0x11, sizeof (ev));
ev.sigev_notify = SIGEV_NONE;
- if (timer_create (CLOCK_REALTIME, &ev, &timer_none) != 0)
+ if (timer_create (TEST_CLOCK, &ev, &timer_none) != 0)
{
printf ("*** timer_create for timer_none failed: %m\n");
return 1;
ev.sigev_notify = SIGEV_SIGNAL;
ev.sigev_signo = SIGRTMIN;
ev.sigev_value.sival_ptr = &ev;
- if (timer_create (CLOCK_REALTIME, &ev, &timer_sig1) != 0)
+ if (timer_create (TEST_CLOCK, &ev, &timer_sig1) != 0)
{
printf ("*** timer_create for timer_sig1 failed: %m\n");
return 1;
ev.sigev_notify = SIGEV_SIGNAL;
ev.sigev_signo = SIGRTMIN + 1;
ev.sigev_value.sival_int = 163;
- if (timer_create (CLOCK_REALTIME, &ev, &timer_sig2) != 0)
+ if (timer_create (TEST_CLOCK, &ev, &timer_sig2) != 0)
{
printf ("*** timer_create for timer_sig2 failed: %m\n");
return 1;
ev.sigev_notify_function = thr1;
ev.sigev_notify_attributes = NULL;
ev.sigev_value.sival_ptr = &ev;
- if (timer_create (CLOCK_REALTIME, &ev, &timer_thr1) != 0)
+ if (timer_create (TEST_CLOCK, &ev, &timer_thr1) != 0)
{
printf ("*** timer_create for timer_thr1 failed: %m\n");
return 1;
ev.sigev_notify_function = thr2;
ev.sigev_notify_attributes = &nattr;
ev.sigev_value.sival_int = 111;
- if (timer_create (CLOCK_REALTIME, &ev, &timer_thr2) != 0)
+ if (timer_create (TEST_CLOCK, &ev, &timer_thr2) != 0)
{
printf ("*** timer_create for timer_thr2 failed: %m\n");
return 1;
#endif
struct timespec startts;
- if (clock_gettime (CLOCK_REALTIME, &startts) != 0)
+ if (clock_gettime (TEST_CLOCK, &startts) != 0)
{
printf ("*** clock_gettime failed: %m\n");
result = 1;
result = 1;
}
- if (clock_gettime (CLOCK_REALTIME, &startts) != 0)
+ if (clock_gettime (TEST_CLOCK, &startts) != 0)
{
printf ("*** clock_gettime failed: %m\n");
result = 1;
--- /dev/null
+/* Timer test using the monotonic clock. */
+
+#include <time.h>
+#include <unistd.h>
+
+#if defined CLOCK_MONOTONIC && defined _POSIX_MONOTONIC_CLOCK
+# define TEST_CLOCK CLOCK_MONOTONIC
+# define TEST_CLOCK_MISSING(clock) \
+ (sysconf (_SC_MONOTONIC_CLOCK) > 0 ? NULL : #clock)
+# include "tst-timer4.c"
+#else
+# define TEST_FUNCTION 0
+# include "../test-skeleton.c"
+#endif
return lazy;
}
-#if defined(__THUMB_INTERWORK__)
+#if defined(__USE_BX__)
#define BX(x) "bx\t" #x
#else
#define BX(x) "mov\tpc, " #x
ldr r0, .L_FINI_PROC\n\
add r0, sl, r0\n\
@ jump to the user_s entry point\n\
- mov pc, r6\n\
+ " BX(r6) "\n\
.L_GET_GOT:\n\
.word _GLOBAL_OFFSET_TABLE_ - .L_GOT_GOT - 4\n\
.L_SKIP_ARGS:\n\
tstne r2, $0x00ff0000 @ (if first three all non-zero, 4th
addne r0, r0, $1 @ must be zero)
#endif
- RETINSTR(mov,pc,lr)
+ DO_RET(lr)
END(strlen)
libc_hidden_builtin_def (strlen)
#include <sysdeps/generic/sysdep.h>
+#if (!defined (__ARM_ARCH_2__) && !defined (__ARM_ARCH_3__) \
+ && !defined (__ARM_ARCH_3M__) && !defined (__ARM_ARCH_4__))
+# define __USE_BX__
+#endif
+
#ifdef __ASSEMBLER__
/* Syntactic details of assembler. */
#ifdef __APCS_32__
#define LOADREGS(cond, base, reglist...)\
ldm##cond base,reglist
-#define RETINSTR(instr, regs...)\
- instr regs
-#ifdef __THUMB_INTERWORK__
+#ifdef __USE_BX__
+#define RETINSTR(cond, reg) \
+ bx##cond reg
#define DO_RET(_reg) \
bx _reg
#else
+#define RETINSTR(cond, reg) \
+ mov##cond pc, reg
#define DO_RET(_reg) \
mov pc, _reg
#endif
#else /* APCS-26 */
#define LOADREGS(cond, base, reglist...)\
ldm##cond base,reglist^
-#define RETINSTR(instr, regs...)\
- instr##s regs
+#define RETINSTR(cond, reg) \
+ mov##cond##s pc, reg
#define DO_RET(_reg) \
movs pc, _reg
#endif
"LD_PRELOAD\0" \
"LD_LIBRARY_PATH\0" \
"LD_ORIGIN_PATH\0" \
+ "LD_DEBUG\0" \
"LD_DEBUG_OUTPUT\0" \
"LD_PROFILE\0" \
"LD_USE_LOAD_BIAS\0" \
+ "LD_DYNAMIC_WEAK\0" \
+ "LD_SHOW_AUXV\0" \
"GCONV_PATH\0" \
"GETCONF_DIR\0" \
"HOSTALIASES\0" \
#endif
str r0, [r1]
mov r0, $0
- RETINSTR(mov, pc, r14)
+ DO_RET (r14)
#ifdef PIC
1: .long _GLOBAL_OFFSET_TABLE_ - 2b - 8
_cb_addr:
R0&-1==R0, and the child gets R0&0==0. */
sub r1, r1, $1
and r0, r0, r1
- RETINSTR(mov, pc, r14)
+ DO_RET (r14)
PSEUDO_END (__fork)
libc_hidden_def (__fork)
ldr r1, 1f
str r0, [r1]
mvn r0, $0
- RETINSTR(mov, pc, r14)
+ DO_RET (r14)
1: .long C_SYMBOL_NAME(errno)
#else
0: add r2, pc, r2
str r0, [r1, r2]
mvn r0, $0
- RETINSTR(mov, pc, r14)
+ DO_RET (r14)
1: .word _GLOBAL_OFFSET_TABLE_ - 0b - 8
2: .word C_SYMBOL_NAME(errno)(GOTOFF)
#ifdef __ASSEMBLER__
-#define ret RETINSTR(mov, pc, r14)
+#define ret DO_RET (r14)
#define MOVE(a,b) mov b,a
#endif
/* High-resolution sleep with the specified clock.
- Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2003, 2004 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
|| __builtin_expect (req->tv_nsec, 0) >= 1000000000)
return EINVAL;
+ if (clock_id == CLOCK_THREAD_CPUTIME_ID)
+ return EINVAL; /* POSIX specifies EINVAL for this case. */
+
+#ifdef SYSDEP_NANOSLEEP
+ SYSDEP_NANOSLEEP;
+#endif
+
if (CPUCLOCK_P (clock_id))
return ENOTSUP;
if (INVALID_CLOCK_P (clock_id))
return EINVAL;
-#ifdef SYSDEP_NANOSLEEP
- SYSDEP_NANOSLEEP;
-#endif
-
/* If we got an absolute time, remap it. */
if (flags == TIMER_ABSTIME)
{
swi SYS_ify(clone)
movs a1, a1
blt PLTJMP(C_SYMBOL_NAME(__syscall_error))
- RETINSTR(movne, pc, lr)
+ RETINSTR(ne, lr)
@ pick the function arg and call address off the stack and execute
ldr r0, [sp, #4]
ldr r5, [sp], #4
cmn r0, $4096
- RETINSTR(movcc, pc, lr)
+ RETINSTR(cc, lr)
b PLTJMP(syscall_error)
.Linval:
add sp, sp, #16
cmn r0, $4096
- RETINSTR(movcc, pc, lr)
+ RETINSTR(cc, lr)
b PLTJMP(syscall_error);
#endif
# ifdef __ASSUME_MMAP2_SYSCALL
ldr r4, [sp], #4
ldr r5, [sp], #4
- RETINSTR(movcc, pc, lr)
+ RETINSTR(cc, lr)
b PLTJMP(syscall_error)
# else
ldrcc r4, [sp], #4
ldrcc r5, [sp], #4
- RETINSTR(movcc, pc, lr)
+ RETINSTR(cc, lr)
cmn r0, $ENOSYS
bne .Lerror
/* The current kernel does not support mmap2. Fall back to plain
/* r0 is < 0 if there was an error. */
cmn r0, $124
- RETINSTR(movcc, pc, r14)
+ RETINSTR(cc, r14)
b PLTJMP(SYSCALL_ERROR)
#if defined NEED_CANCELLATION && defined CENABLE
/* r0 is < 0 if there was an error. */
cmn r0, $124
- RETINSTR(movcc, pc, r14)
+ RETINSTR(cc, r14)
b PLTJMP(SYSCALL_ERROR)
#endif
cmn r0, $4096;
#define PSEUDO_RET \
- RETINSTR(movcc, pc, lr); \
+ RETINSTR(cc, lr); \
b PLTJMP(SYSCALL_ERROR)
#undef ret
#define ret PSEUDO_RET
DO_CALL (syscall_name, args);
#define PSEUDO_RET_NOERRNO \
- RETINSTR(mov, pc, lr);
+ DO_RET (lr);
#undef ret_NOERRNO
#define ret_NOERRNO PSEUDO_RET_NOERRNO
#ifdef __NR_vfork
swi __NR_vfork
cmn a1, #4096
- RETINSTR(movcc, pc, lr)
+ RETINSTR(cc, lr)
# ifdef __ASSUME_VFORK_SYSCALL
b PLTJMP(C_SYMBOL_NAME(__syscall_error))
/* If we don't have vfork, fork is close enough. */
swi __NR_fork
cmn a1, #4096
- RETINSTR(movcc, pc, lr)
+ RETINSTR(cc, lr)
b PLTJMP(C_SYMBOL_NAME(__syscall_error))
#elif !defined __NR_vfork
# error "__NR_vfork not available and __ASSUME_VFORK_SYSCALL defined"
-/* Copyright (C) 1996,1997,98,99,2000,02,03 Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,98,99,2000,02,03,04 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu)
#define __NR_clone 120
#define SYS_clone 120
+#define CLONE_VM 0x00000100
+#define CLONE_THREAD 0x00010000
+
.text
ENTRY (BP_SYM (__clone))
/* Sanity check arguments. */
movl %eax,8(%ecx)
/* Don't leak any information. */
movl $0,4(%ecx)
+#ifndef RESET_PID
movl $0,(%ecx)
+#endif
/* Do the system call */
pushl %ebx
movl FLAGS+12(%esp),%ebx
movl CTID+12(%esp),%edi
movl $SYS_ify(clone),%eax
+
+#ifdef RESET_PID
+ /* Remember the flag value. */
+ movl %ebx, (%ecx)
+#endif
+
int $0x80
popl %edi
popl %esi
ret
L(thread_start):
- subl %ebp,%ebp /* terminate the stack frame */
+ /* Note: %esi is zero. */
+ movl %esi,%ebp /* terminate the stack frame */
+#ifdef RESET_PID
+ testl $CLONE_THREAD, %edi
+ je L(newpid)
+L(haspid):
+#endif
call *%ebx
#ifdef PIC
call L(here)
movl $SYS_ify(exit), %eax
int $0x80
+#ifdef RESET_PID
+ .subsection 2
+L(newpid):
+ testl $CLONE_VM, %edi
+ movl $-1, %eax
+ jne L(nomoregetpid)
+ movl $SYS_ify(getpid), %eax
+ ENTER_KERNEL
+L(nomoregetpid):
+ movl %eax, %gs:PID
+ movl %eax, %gs:TID
+ jmp L(haspid)
+ .previous
+#endif
+
PSEUDO_END (BP_SYM (__clone))
weak_alias (BP_SYM (__clone), BP_SYM (clone))
#include <bp-sym.h>
#include <bp-asm.h>
+#define CLONE_VM 0x00000100
+#define CLONE_THREAD 0x00010000
+
/* The userland implementation is:
int clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg),
the kernel entry is:
testq %rax,%rax
jl SYSCALL_ERROR_LABEL
- jz thread_start
+ jz L(thread_start)
L(pseudo_end):
ret
-thread_start:
+L(thread_start):
/* Clear the frame pointer. The ABI suggests this be done, to mark
the outermost frame obviously. */
xorq %rbp, %rbp
+#ifdef RESET_PID
+ testq $CLONE_THREAD, %rdi
+ jne 1f
+ testq $CLONE_VM, %rdi
+ movl $-1, %eax
+ jne 2f
+ movq $SYS_ify(getpid), %rax
+ syscall
+2: movl %eax, %fs:PID
+ movl %eax, %fs:TID
+1:
+#endif
+
/* Set up arguments for the function call. */
popq %rax /* Function to call. */
popq %rdi /* Argument. */
switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss))
{
default:
+ tz_rules[0].offset = 0;
goto out;
case 1:
mm = 0;