[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r11937 - in /fsf/glibc-2_11-branch/libc: ./ elf/ include/ libio/ nis/nss_nis/ nptl/ nptl/sysdeps/unix/sysv/linux/sh/ nptl/sy...
- To: commits@xxxxxxxxxx
- Subject: [commits] r11937 - in /fsf/glibc-2_11-branch/libc: ./ elf/ include/ libio/ nis/nss_nis/ nptl/ nptl/sysdeps/unix/sysv/linux/sh/ nptl/sy...
- From: eglibc@xxxxxxxxxx
- Date: Tue, 02 Nov 2010 07:12:43 -0000
Author: eglibc
Date: Tue Nov 2 00:12:42 2010
New Revision: 11937
Log:
Import glibc-2.11 for 2010-11-02
Added:
fsf/glibc-2_11-branch/libc/string/bug-strstr1.c
Modified:
fsf/glibc-2_11-branch/libc/ChangeLog
fsf/glibc-2_11-branch/libc/elf/dl-deps.c
fsf/glibc-2_11-branch/libc/elf/dl-load.c
fsf/glibc-2_11-branch/libc/elf/dl-open.c
fsf/glibc-2_11-branch/libc/elf/dl-reloc.c
fsf/glibc-2_11-branch/libc/elf/rtld.c
fsf/glibc-2_11-branch/libc/include/dlfcn.h
fsf/glibc-2_11-branch/libc/libio/stdio.h
fsf/glibc-2_11-branch/libc/nis/nss_nis/nis-initgroups.c
fsf/glibc-2_11-branch/libc/nptl/ChangeLog
fsf/glibc-2_11-branch/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
fsf/glibc-2_11-branch/libc/nptl/sysdeps/x86_64/pthreaddef.h
fsf/glibc-2_11-branch/libc/nptl/sysdeps/x86_64/tls.h
fsf/glibc-2_11-branch/libc/posix/getopt.h
fsf/glibc-2_11-branch/libc/string/Makefile
fsf/glibc-2_11-branch/libc/string/str-two-way.h
fsf/glibc-2_11-branch/libc/string/stratcliff.c
fsf/glibc-2_11-branch/libc/sysdeps/generic/ldsodefs.h
fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/strchr.S
fsf/glibc-2_11-branch/libc/sysdeps/x86_64/strcmp.S
fsf/glibc-2_11-branch/libc/wcsmbs/wchar.h
fsf/glibc-2_11-branch/libc/wcsmbs/wcsatcliff.c
Modified: fsf/glibc-2_11-branch/libc/ChangeLog
==============================================================================
--- fsf/glibc-2_11-branch/libc/ChangeLog (original)
+++ fsf/glibc-2_11-branch/libc/ChangeLog Tue Nov 2 00:12:42 2010
@@ -1,3 +1,60 @@
+2010-10-25 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ [BZ #12159]
+ * sysdeps/x86_64/multiarch/strchr.S: Fix propagation of search byte
+ into all bytes of SSE register.
+ Patch by Richard Li <richardpku@xxxxxxxxx>.
+
+2010-10-22 Andreas Schwab <schwab@xxxxxxxxxx>
+
+ * include/dlfcn.h (__RTLD_SECURE): Define.
+ * elf/dl-load.c (_dl_map_object): Remove preloaded parameter. Use
+ mode & __RTLD_SECURE instead.
+ (open_path): Rename preloaded parameter to secure.
+ * sysdeps/generic/ldsodefs.h (_dl_map_object): Adjust declaration.
+ * elf/dl-open.c (dl_open_worker): Adjust call to _dl_map_object.
+ * elf/dl-deps.c (openaux): Likewise.
+ * elf/rtld.c (struct map_args): Remove is_preloaded.
+ (map_doit): Don't use it.
+ (dl_main): Likewise.
+ (do_preload): Use __RTLD_SECURE instead of is_preloaded.
+ (dlmopen_doit): Add __RTLD_SECURE to mode bits.
+
+2010-10-06 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ * string/bug-strstr1.c: New file.
+ * string/Makefile: Add rules to build and run bug-strstr1.
+
+2010-10-05 Eric Blake <eblake@xxxxxxxxxx>
+
+ [BZ #12092]
+ * string/str-two-way.h (two_way_long_needle): Always clear memory
+ when skipping input due to the shift table.
+
+2010-10-03 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ [BZ #12077]
+ * sysdeps/x86_64/strcmp.S: Fix handling of remaining bytes in buffer
+ for strncmp and strncasecmp.
+ * string/stratcliff.c: Add tests for strcmp and strncmp.
+ * wcsmbs/wcsatcliff.c: Adjust for stratcliff change.
+
+2010-06-02 Kirill A. Shutemov <kirill@xxxxxxxxxxxxx>
+
+ * elf/dl-reloc.c: Flush cache after solving TEXTRELs if arch
+ requires it.
+
+2010-06-02 Andreas Schwab <schwab@xxxxxxxxxx>
+
+ * nis/nss_nis/nis-initgroups.c (get_uid): Properly resize buffer.
+
+2010-06-07 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * libio/stdio.h (sscanf, vsscanf): Use __REDIRECT_NTH instead of
+ __REDIRECT followed by __THROW.
+ * wcsmbs/wchar.h (swscanf, vswscanf): Likewise.
+ * posix/getopt.h (getopt): Likewise.
+
2010-05-26 H.J. Lu <hongjiu.lu@xxxxxxxxx>
[BZ #11640]
Modified: fsf/glibc-2_11-branch/libc/elf/dl-deps.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/elf/dl-deps.c (original)
+++ fsf/glibc-2_11-branch/libc/elf/dl-deps.c Tue Nov 2 00:12:42 2010
@@ -62,7 +62,7 @@
{
struct openaux_args *args = (struct openaux_args *) a;
- args->aux = _dl_map_object (args->map, args->name, 0,
+ args->aux = _dl_map_object (args->map, args->name,
(args->map->l_type == lt_executable
? lt_library : args->map->l_type),
args->trace_mode, args->open_mode,
Modified: fsf/glibc-2_11-branch/libc/elf/dl-load.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/elf/dl-load.c (original)
+++ fsf/glibc-2_11-branch/libc/elf/dl-load.c Tue Nov 2 00:12:42 2010
@@ -1802,7 +1802,7 @@
if MAY_FREE_DIRS is true. */
static int
-open_path (const char *name, size_t namelen, int preloaded,
+open_path (const char *name, size_t namelen, int secure,
struct r_search_path_struct *sps, char **realname,
struct filebuf *fbp, struct link_map *loader, int whatcode,
bool *found_other_class)
@@ -1884,7 +1884,7 @@
/* Remember whether we found any existing directory. */
here_any |= this_dir->status[cnt] != nonexisting;
- if (fd != -1 && __builtin_expect (preloaded, 0)
+ if (fd != -1 && __builtin_expect (secure, 0)
&& INTUSE(__libc_enable_secure))
{
/* This is an extra security effort to make sure nobody can
@@ -1953,7 +1953,7 @@
struct link_map *
internal_function
-_dl_map_object (struct link_map *loader, const char *name, int preloaded,
+_dl_map_object (struct link_map *loader, const char *name,
int type, int trace_mode, int mode, Lmid_t nsid)
{
int fd;
@@ -2057,7 +2057,8 @@
for (l = loader; l; l = l->l_loader)
if (cache_rpath (l, &l->l_rpath_dirs, DT_RPATH, "RPATH"))
{
- fd = open_path (name, namelen, preloaded, &l->l_rpath_dirs,
+ fd = open_path (name, namelen, mode & __RTLD_SECURE,
+ &l->l_rpath_dirs,
&realname, &fb, loader, LA_SER_RUNPATH,
&found_other_class);
if (fd != -1)
@@ -2072,14 +2073,15 @@
&& main_map != NULL && main_map->l_type != lt_loaded
&& cache_rpath (main_map, &main_map->l_rpath_dirs, DT_RPATH,
"RPATH"))
- fd = open_path (name, namelen, preloaded, &main_map->l_rpath_dirs,
+ fd = open_path (name, namelen, mode & __RTLD_SECURE,
+ &main_map->l_rpath_dirs,
&realname, &fb, loader ?: main_map, LA_SER_RUNPATH,
&found_other_class);
}
/* Try the LD_LIBRARY_PATH environment variable. */
if (fd == -1 && env_path_list.dirs != (void *) -1)
- fd = open_path (name, namelen, preloaded, &env_path_list,
+ fd = open_path (name, namelen, mode & __RTLD_SECURE, &env_path_list,
&realname, &fb,
loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
LA_SER_LIBPATH, &found_other_class);
@@ -2088,12 +2090,12 @@
if (fd == -1 && loader != NULL
&& cache_rpath (loader, &loader->l_runpath_dirs,
DT_RUNPATH, "RUNPATH"))
- fd = open_path (name, namelen, preloaded,
+ fd = open_path (name, namelen, mode & __RTLD_SECURE,
&loader->l_runpath_dirs, &realname, &fb, loader,
LA_SER_RUNPATH, &found_other_class);
if (fd == -1
- && (__builtin_expect (! preloaded, 1)
+ && (__builtin_expect (! (mode & __RTLD_SECURE), 1)
|| ! INTUSE(__libc_enable_secure)))
{
/* Check the list of libraries in the file /etc/ld.so.cache,
@@ -2159,7 +2161,7 @@
&& ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
|| __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
&& rtld_search_dirs.dirs != (void *) -1)
- fd = open_path (name, namelen, preloaded, &rtld_search_dirs,
+ fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
&realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
/* Add another newline when we are tracing the library loading. */
Modified: fsf/glibc-2_11-branch/libc/elf/dl-open.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/elf/dl-open.c (original)
+++ fsf/glibc-2_11-branch/libc/elf/dl-open.c Tue Nov 2 00:12:42 2010
@@ -251,7 +251,7 @@
/* Load the named object. */
struct link_map *new;
- args->map = new = _dl_map_object (call_map, file, 0, lt_loaded, 0,
+ args->map = new = _dl_map_object (call_map, file, lt_loaded, 0,
mode | __RTLD_CALLMAP, args->nsid);
/* If the pointer returned is NULL this means the RTLD_NOLOAD flag is
Modified: fsf/glibc-2_11-branch/libc/elf/dl-reloc.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/elf/dl-reloc.c (original)
+++ fsf/glibc-2_11-branch/libc/elf/dl-reloc.c Tue Nov 2 00:12:42 2010
@@ -1,5 +1,5 @@
/* Relocate a shared object and resolve its references to other loaded objects.
- Copyright (C) 1995-2006, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1995-2006, 2008, 2009, 2010 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
@@ -307,6 +307,10 @@
goto call_error;
}
+#ifdef CLEAR_CACHE
+ CLEAR_CACHE (textrels->start, textrels->start + textrels->len);
+#endif
+
textrels = textrels->next;
}
Modified: fsf/glibc-2_11-branch/libc/elf/rtld.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/elf/rtld.c (original)
+++ fsf/glibc-2_11-branch/libc/elf/rtld.c Tue Nov 2 00:12:42 2010
@@ -588,7 +588,6 @@
/* Argument to map_doit. */
char *str;
struct link_map *loader;
- int is_preloaded;
int mode;
/* Return value of map_doit. */
struct link_map *map;
@@ -626,16 +625,17 @@
map_doit (void *a)
{
struct map_args *args = (struct map_args *) a;
- args->map = _dl_map_object (args->loader, args->str,
- args->is_preloaded, lt_library, 0, args->mode,
- LM_ID_BASE);
+ args->map = _dl_map_object (args->loader, args->str, lt_library, 0,
+ args->mode, LM_ID_BASE);
}
static void
dlmopen_doit (void *a)
{
struct dlmopen_args *args = (struct dlmopen_args *) a;
- args->map = _dl_open (args->fname, RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT,
+ args->map = _dl_open (args->fname,
+ (RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT
+ | __RTLD_SECURE),
dl_main, LM_ID_NEWLM, _dl_argc, INTUSE(_dl_argv),
__environ);
}
@@ -805,8 +805,7 @@
args.str = fname;
args.loader = main_map;
- args.is_preloaded = 1;
- args.mode = 0;
+ args.mode = __RTLD_SECURE;
unsigned int old_nloaded = GL(dl_ns)[LM_ID_BASE]._ns_nloaded;
@@ -1052,7 +1051,6 @@
args.str = rtld_progname;
args.loader = NULL;
- args.is_preloaded = 0;
args.mode = __RTLD_OPENEXEC;
(void) _dl_catch_error (&objname, &err_str, &malloced, map_doit,
&args);
@@ -1064,7 +1062,7 @@
else
{
HP_TIMING_NOW (start);
- _dl_map_object (NULL, rtld_progname, 0, lt_library, 0,
+ _dl_map_object (NULL, rtld_progname, lt_library, 0,
__RTLD_OPENEXEC, LM_ID_BASE);
HP_TIMING_NOW (stop);
Modified: fsf/glibc-2_11-branch/libc/include/dlfcn.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/include/dlfcn.h (original)
+++ fsf/glibc-2_11-branch/libc/include/dlfcn.h Tue Nov 2 00:12:42 2010
@@ -9,6 +9,7 @@
#define __RTLD_OPENEXEC 0x20000000
#define __RTLD_CALLMAP 0x10000000
#define __RTLD_AUDIT 0x08000000
+#define __RTLD_SECURE 0x04000000 /* Apply additional security checks. */
#define __LM_ID_CALLER -2
Modified: fsf/glibc-2_11-branch/libc/libio/stdio.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/libio/stdio.h (original)
+++ fsf/glibc-2_11-branch/libc/libio/stdio.h Tue Nov 2 00:12:42 2010
@@ -427,9 +427,9 @@
__isoc99_fscanf) __wur;
extern int __REDIRECT (scanf, (__const char *__restrict __format, ...),
__isoc99_scanf) __wur;
-extern int __REDIRECT (sscanf, (__const char *__restrict __s,
- __const char *__restrict __format, ...),
- __isoc99_sscanf) __THROW;
+extern int __REDIRECT_NTH (sscanf, (__const char *__restrict __s,
+ __const char *__restrict __format, ...),
+ __isoc99_sscanf);
# else
extern int __isoc99_fscanf (FILE *__restrict __stream,
__const char *__restrict __format, ...) __wur;
@@ -481,11 +481,11 @@
extern int __REDIRECT (vscanf, (__const char *__restrict __format,
_G_va_list __arg), __isoc99_vscanf)
__attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
-extern int __REDIRECT (vsscanf,
- (__const char *__restrict __s,
- __const char *__restrict __format, _G_va_list __arg),
- __isoc99_vsscanf)
- __THROW __attribute__ ((__format__ (__scanf__, 2, 0)));
+extern int __REDIRECT_NTH (vsscanf,
+ (__const char *__restrict __s,
+ __const char *__restrict __format,
+ _G_va_list __arg), __isoc99_vsscanf)
+ __attribute__ ((__format__ (__scanf__, 2, 0)));
# else
extern int __isoc99_vfscanf (FILE *__restrict __s,
__const char *__restrict __format,
Modified: fsf/glibc-2_11-branch/libc/nis/nss_nis/nis-initgroups.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/nis/nss_nis/nis-initgroups.c (original)
+++ fsf/glibc-2_11-branch/libc/nis/nss_nis/nis-initgroups.c Tue Nov 2 00:12:42 2010
@@ -139,7 +139,7 @@
if (r != ERANGE)
break;
- extend_alloca (buf, buflen, 2 * buflen);
+ buf = extend_alloca (buf, buflen, 2 * buflen);
}
return 1;
Modified: fsf/glibc-2_11-branch/libc/nptl/ChangeLog
==============================================================================
--- fsf/glibc-2_11-branch/libc/nptl/ChangeLog (original)
+++ fsf/glibc-2_11-branch/libc/nptl/ChangeLog Tue Nov 2 00:12:42 2010
@@ -1,3 +1,15 @@
+2010-10-13 H.J. Lu <hongjiu.lu@xxxxxxxxx>
+
+ [BZ #12113]
+ * sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
+ * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
+ of "struct pthread".
+
+2010-06-01 Takashi Yoshii <takashi.yoshii.zj@xxxxxxxxxxx>
+
+ * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
+ location of ifndef __ASSUME_FUTEX_CLOCK_REALTIME.
+
2009-11-27 Andreas Schwab <schwab@xxxxxxxxxx>
* sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
Modified: fsf/glibc-2_11-branch/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
==============================================================================
--- fsf/glibc-2_11-branch/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S (original)
+++ fsf/glibc-2_11-branch/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S Tue Nov 2 00:12:42 2010
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009
+/* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -282,6 +282,7 @@
rts
mov.l @r15+, r12
+# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
.align 2
# ifdef PIC
.Lgot:
@@ -293,7 +294,6 @@
.long __have_futex_clock_realtime
# endif
-# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
.Lreltmo:
/* Check for a valid timeout value. */
mov.l @(4,r6), r1
Modified: fsf/glibc-2_11-branch/libc/nptl/sysdeps/x86_64/pthreaddef.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/nptl/sysdeps/x86_64/pthreaddef.h (original)
+++ fsf/glibc-2_11-branch/libc/nptl/sysdeps/x86_64/pthreaddef.h Tue Nov 2 00:12:42 2010
@@ -27,8 +27,9 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
-/* Alignment requirement for TCB. */
-#define TCB_ALIGNMENT 16
+/* Alignment requirement for TCB. Need to store post-AVX vector registers
+ in the TCB and we want the storage to be aligned at 32-byte. */
+#define TCB_ALIGNMENT 32
/* Location of current stack frame. The frame pointer is not usable. */
Modified: fsf/glibc-2_11-branch/libc/nptl/sysdeps/x86_64/tls.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/nptl/sysdeps/x86_64/tls.h (original)
+++ fsf/glibc-2_11-branch/libc/nptl/sysdeps/x86_64/tls.h Tue Nov 2 00:12:42 2010
@@ -117,12 +117,7 @@
# define TLS_TCB_SIZE sizeof (struct pthread)
/* Alignment requirements for the TCB. */
-//# define TLS_TCB_ALIGN __alignof__ (struct pthread)
-// Normally the above would be correct But we have to store post-AVX
-// vector registers in the TCB and we want the storage to be aligned.
-// unfortunately there isn't yet a type for these values and hence no
-// 32-byte alignment requirement. Make this explicit, for now.
-# define TLS_TCB_ALIGN 32
+# define TLS_TCB_ALIGN __alignof__ (struct pthread)
/* The TCB can have any size and the memory following the address the
thread pointer points to is unspecified. Allocate the TCB there. */
Modified: fsf/glibc-2_11-branch/libc/posix/getopt.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/posix/getopt.h (original)
+++ fsf/glibc-2_11-branch/libc/posix/getopt.h Tue Nov 2 00:12:42 2010
@@ -1,5 +1,5 @@
/* Declarations for getopt.
- Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2009
+ Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2009,2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -158,9 +158,9 @@
additional functionality can be disable at runtime. This redirection
helps to also do this at runtime. */
# ifdef __REDIRECT
- extern int __REDIRECT (getopt, (int ___argc, char *const *___argv,
- const char *__shortopts),
- __posix_getopt) __THROW;
+ extern int __REDIRECT_NTH (getopt, (int ___argc, char *const *___argv,
+ const char *__shortopts),
+ __posix_getopt);
# else
extern int __posix_getopt (int ___argc, char *const *___argv,
const char *__shortopts) __THROW;
Modified: fsf/glibc-2_11-branch/libc/string/Makefile
==============================================================================
--- fsf/glibc-2_11-branch/libc/string/Makefile (original)
+++ fsf/glibc-2_11-branch/libc/string/Makefile Tue Nov 2 00:12:42 2010
@@ -54,7 +54,8 @@
bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \
tst-strtok tst-strxfrm bug-strcoll1 tst-strfry \
bug-strtok1 $(addprefix test-,$(strop-tests)) \
- bug-envz1 tst-strxfrm2 tst-endian tst-svc2
+ bug-envz1 tst-strxfrm2 tst-endian tst-svc2 \
+ bug-strstr1
distribute := memcopy.h pagecopy.h tst-svc.expect test-string.h \
str-two-way.h
@@ -73,6 +74,7 @@
CFLAGS-stratcliff.c = -fno-builtin
CFLAGS-test-ffs.c = -fno-builtin
CFLAGS-tst-inlcall.c = -fno-builtin
+CFLAGS-bug-strstr1.c = -fno-builtin
ifeq ($(cross-compiling),no)
tests: $(objpfx)tst-svc.out
Added: fsf/glibc-2_11-branch/libc/string/bug-strstr1.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/string/bug-strstr1.c (added)
+++ fsf/glibc-2_11-branch/libc/string/bug-strstr1.c Tue Nov 2 00:12:42 2010
@@ -1,0 +1,26 @@
+#include <stdio.h>
+#include <string.h>
+
+int main (int argc, char** argv)
+{
+ const char haystack[] =
+ "F_BD_CE_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_88_20_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_A7_20_EF_BF_BD";
+
+ const char needle[] =
+ "_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD";
+
+ const char* sub = strstr (haystack, needle);
+
+ if (sub != NULL)
+ {
+ int j;
+
+ fprintf (stderr, "BUG: expected NULL, got:\n%s\n%s\n", sub, needle);
+ for (j = 0; needle[j] != '\0'; ++j)
+ putchar (needle[j] == sub[j] ? ' ' : '^');
+ puts ("");
+ return 1;
+ }
+
+ return 0;
+}
Modified: fsf/glibc-2_11-branch/libc/string/str-two-way.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/string/str-two-way.h (original)
+++ fsf/glibc-2_11-branch/libc/string/str-two-way.h Tue Nov 2 00:12:42 2010
@@ -350,8 +350,8 @@
a byte out of place, there can be no match until
after the mismatch. */
shift = needle_len - period;
- memory = 0;
}
+ memory = 0;
j += shift;
continue;
}
Modified: fsf/glibc-2_11-branch/libc/string/stratcliff.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/string/stratcliff.c (original)
+++ fsf/glibc-2_11-branch/libc/string/stratcliff.c Tue Nov 2 00:12:42 2010
@@ -1,5 +1,6 @@
/* Test for string function add boundaries of usable memory.
- Copyright (C) 1996,1997,1999-2003,2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,1999-2003,2007,2009,2010
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
@@ -47,6 +48,8 @@
# define MEMCPY memcpy
# define MEMPCPY mempcpy
# define MEMCHR memchr
+# define STRCMP strcmp
+# define STRNCMP strncmp
#endif
@@ -70,12 +73,12 @@
if (adr == MAP_FAILED || dest == MAP_FAILED)
{
if (errno == ENOSYS)
- puts ("No test, mmap not available.");
+ puts ("No test, mmap not available.");
else
- {
- printf ("mmap failed: %m");
- result = 1;
- }
+ {
+ printf ("mmap failed: %m");
+ result = 1;
+ }
}
else
{
@@ -93,8 +96,8 @@
/* strlen/wcslen test */
for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
- {
- for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+ {
+ for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
{
adr[inner] = L('\0');
@@ -107,12 +110,12 @@
adr[inner] = L('T');
}
- }
+ }
/* strnlen/wcsnlen test */
for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
- {
- for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+ {
+ for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
{
adr[inner] = L('\0');
@@ -126,9 +129,9 @@
adr[inner] = L('T');
}
- }
- for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
- {
+ }
+ for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
+ {
for (inner = MAX (outer, nchars - 64); inner <= nchars; ++inner)
{
if (STRNLEN (&adr[outer], inner - outer)
@@ -139,11 +142,11 @@
result = 1;
}
}
- }
+ }
/* strchr/wcschr test */
for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
- {
+ {
for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
{
for (inner = middle; inner < nchars; ++inner)
@@ -167,7 +170,7 @@
adr[middle] = L('T');
}
}
- }
+ }
/* Special test. */
adr[nchars - 1] = L('\0');
@@ -180,7 +183,7 @@
/* strrchr/wcsrchr test */
for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
- {
+ {
for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
{
for (inner = middle; inner < nchars; ++inner)
@@ -204,11 +207,11 @@
adr[middle] = L('T');
}
}
- }
+ }
/* memchr test */
for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
- {
+ {
for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
{
adr[middle] = L('V');
@@ -224,9 +227,9 @@
adr[middle] = L('T');
}
- }
- for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
- {
+ }
+ for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
+ {
CHAR *cp = MEMCHR (&adr[outer], L('V'), nchars - outer);
if (cp != NULL)
@@ -235,13 +238,13 @@
STRINGIFY (MEMCHR), outer);
result = 1;
}
- }
+ }
/* This function only exists for single-byte characters. */
#ifndef WCSTEST
/* rawmemchr test */
for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
- {
+ {
for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
{
adr[middle] = L('V');
@@ -257,13 +260,13 @@
adr[middle] = L('T');
}
- }
+ }
#endif
/* strcpy/wcscpy test */
for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
- {
- for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+ {
+ for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
{
adr[inner] = L('\0');
@@ -277,7 +280,74 @@
adr[inner] = L('T');
}
- }
+ }
+
+ /* strcmp/wcscmp tests */
+ for (outer = 1; outer < 32; ++outer)
+ for (middle = 0; middle < 16; ++middle)
+ {
+ MEMSET (adr + middle, L('T'), 256);
+ adr[256] = L('\0');
+ MEMSET (dest + nchars - outer, L('T'), outer - 1);
+ dest[nchars - 1] = L('\0');
+
+ if (STRCMP (adr + middle, dest + nchars - outer) <= 0)
+ {
+ printf ("%s 1 flunked for outer = %d, middle = %d\n",
+ STRINGIFY (STRCMP), outer, middle);
+ result = 1;
+ }
+
+ if (STRCMP (dest + nchars - outer, adr + middle) >= 0)
+ {
+ printf ("%s 2 flunked for outer = %d, middle = %d\n",
+ STRINGIFY (STRCMP), outer, middle);
+ result = 1;
+ }
+ }
+
+ /* strncmp/wcsncmp tests */
+ for (outer = 1; outer < 32; ++outer)
+ for (middle = 0; middle < 16; ++middle)
+ {
+ MEMSET (adr + middle, L('T'), 256);
+ adr[256] = L('\0');
+ MEMSET (dest + nchars - outer, L('T'), outer - 1);
+ dest[nchars - 1] = L('U');
+
+ for (inner = 0; inner < outer; ++inner)
+ {
+ if (STRNCMP (adr + middle, dest + nchars - outer, inner) != 0)
+ {
+ printf ("%s 1 flunked for outer = %d, middle = %d, "
+ "inner = %d\n",
+ STRINGIFY (STRNCMP), outer, middle, inner);
+ result = 1;
+ }
+
+ if (STRNCMP (dest + nchars - outer, adr + middle, inner) != 0)
+ {
+ printf ("%s 2 flunked for outer = %d, middle = %d, "
+ "inner = %d\n",
+ STRINGIFY (STRNCMP), outer, middle, inner);
+ result = 1;
+ }
+ }
+
+ if (STRNCMP (adr + middle, dest + nchars - outer, outer) >= 0)
+ {
+ printf ("%s 1 flunked for outer = %d, middle = %d, full\n",
+ STRINGIFY (STRNCMP), outer, middle);
+ result = 1;
+ }
+
+ if (STRNCMP (dest + nchars - outer, adr + middle, outer) <= 0)
+ {
+ printf ("%s 2 flunked for outer = %d, middle = %d, full\n",
+ STRINGIFY (STRNCMP), outer, middle);
+ result = 1;
+ }
+ }
/* strncpy/wcsncpy tests */
adr[nchars - 1] = L('T');
@@ -295,12 +365,12 @@
result = 1;
}
}
- }
+ }
adr[nchars - 1] = L('\0');
for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
- {
- for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+ {
+ for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
{
size_t len;
@@ -334,12 +404,12 @@
adr[inner] = L('T');
}
- }
+ }
/* stpcpy/wcpcpy test */
for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
- {
- for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+ {
+ for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
{
adr[inner] = L('\0');
@@ -352,7 +422,7 @@
adr[inner] = L('T');
}
- }
+ }
/* stpncpy/wcpncpy test */
adr[nchars - 1] = L('T');
@@ -374,8 +444,8 @@
adr[nchars - 1] = L('\0');
for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
- {
- for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
+ {
+ for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
{
adr[middle] = L('\0');
@@ -393,7 +463,7 @@
adr[middle] = L('T');
}
- }
+ }
/* memcpy/wmemcpy test */
for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
Modified: fsf/glibc-2_11-branch/libc/sysdeps/generic/ldsodefs.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/generic/ldsodefs.h (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/generic/ldsodefs.h Tue Nov 2 00:12:42 2010
@@ -820,11 +820,9 @@
/* Open the shared object NAME and map in its segments.
LOADER's DT_RPATH is used in searching for NAME.
- If the object is already opened, returns its existing map.
- For preloaded shared objects PRELOADED is set to a non-zero
- value to allow additional security checks. */
+ If the object is already opened, returns its existing map. */
extern struct link_map *_dl_map_object (struct link_map *loader,
- const char *name, int preloaded,
+ const char *name,
int type, int trace_mode, int mode,
Lmid_t nsid)
internal_function attribute_hidden;
Modified: fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/strchr.S
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/strchr.S (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/x86_64/multiarch/strchr.S Tue Nov 2 00:12:42 2010
@@ -1,5 +1,5 @@
/* strchr with SSE4.2
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010 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
@@ -87,13 +87,13 @@
pxor %xmm2, %xmm2
movd %esi, %xmm1
movl %edi, %ecx
+ pshufb %xmm2, %xmm1
andl $15, %ecx
movq %rdi, %r8
je L(aligned_start)
/* Handle unaligned string. */
andq $-16, %r8
- pshufb %xmm2, %xmm1
movdqa (%r8), %xmm0
pcmpeqb %xmm0, %xmm2
pcmpeqb %xmm1, %xmm0
Modified: fsf/glibc-2_11-branch/libc/sysdeps/x86_64/strcmp.S
==============================================================================
--- fsf/glibc-2_11-branch/libc/sysdeps/x86_64/strcmp.S (original)
+++ fsf/glibc-2_11-branch/libc/sysdeps/x86_64/strcmp.S Tue Nov 2 00:12:42 2010
@@ -313,7 +313,7 @@
jnz LABEL(ashr_1_exittail) /* find null char*/
#ifdef USE_AS_STRNCMP
- cmp $14, %r11
+ cmp $15, %r11
jbe LABEL(ashr_1_exittail)
#endif
@@ -438,7 +438,7 @@
jnz LABEL(ashr_2_exittail)
#ifdef USE_AS_STRNCMP
- cmp $13, %r11
+ cmp $14, %r11
jbe LABEL(ashr_2_exittail)
#endif
@@ -560,7 +560,7 @@
jnz LABEL(ashr_3_exittail)
#ifdef USE_AS_STRNCMP
- cmp $12, %r11
+ cmp $13, %r11
jbe LABEL(ashr_3_exittail)
#endif
@@ -682,7 +682,7 @@
jnz LABEL(ashr_4_exittail)
#ifdef USE_AS_STRNCMP
- cmp $11, %r11
+ cmp $12, %r11
jbe LABEL(ashr_4_exittail)
#endif
@@ -804,7 +804,7 @@
jnz LABEL(ashr_5_exittail)
#ifdef USE_AS_STRNCMP
- cmp $10, %r11
+ cmp $11, %r11
jbe LABEL(ashr_5_exittail)
#endif
@@ -926,7 +926,7 @@
jnz LABEL(ashr_6_exittail)
#ifdef USE_AS_STRNCMP
- cmp $9, %r11
+ cmp $10, %r11
jbe LABEL(ashr_6_exittail)
#endif
@@ -1048,7 +1048,7 @@
jnz LABEL(ashr_7_exittail)
#ifdef USE_AS_STRNCMP
- cmp $8, %r11
+ cmp $9, %r11
jbe LABEL(ashr_7_exittail)
#endif
@@ -1170,7 +1170,7 @@
jnz LABEL(ashr_8_exittail)
#ifdef USE_AS_STRNCMP
- cmp $7, %r11
+ cmp $8, %r11
jbe LABEL(ashr_8_exittail)
#endif
@@ -1292,7 +1292,7 @@
jnz LABEL(ashr_9_exittail)
#ifdef USE_AS_STRNCMP
- cmp $6, %r11
+ cmp $7, %r11
jbe LABEL(ashr_9_exittail)
#endif
@@ -1414,7 +1414,7 @@
jnz LABEL(ashr_10_exittail)
#ifdef USE_AS_STRNCMP
- cmp $5, %r11
+ cmp $6, %r11
jbe LABEL(ashr_10_exittail)
#endif
@@ -1536,7 +1536,7 @@
jnz LABEL(ashr_11_exittail)
#ifdef USE_AS_STRNCMP
- cmp $4, %r11
+ cmp $5, %r11
jbe LABEL(ashr_11_exittail)
#endif
@@ -1658,7 +1658,7 @@
jnz LABEL(ashr_12_exittail)
#ifdef USE_AS_STRNCMP
- cmp $3, %r11
+ cmp $4, %r11
jbe LABEL(ashr_12_exittail)
#endif
@@ -1780,7 +1780,7 @@
jnz LABEL(ashr_13_exittail)
#ifdef USE_AS_STRNCMP
- cmp $2, %r11
+ cmp $3, %r11
jbe LABEL(ashr_13_exittail)
#endif
@@ -1902,7 +1902,7 @@
jnz LABEL(ashr_14_exittail)
#ifdef USE_AS_STRNCMP
- cmp $1, %r11
+ cmp $2, %r11
jbe LABEL(ashr_14_exittail)
#endif
@@ -2026,8 +2026,8 @@
jnz LABEL(ashr_15_exittail)
#ifdef USE_AS_STRNCMP
- test %r11, %r11
- je LABEL(ashr_15_exittail)
+ cmpq $1, %r11
+ jbe LABEL(ashr_15_exittail)
#endif
pxor %xmm0, %xmm0
Modified: fsf/glibc-2_11-branch/libc/wcsmbs/wchar.h
==============================================================================
--- fsf/glibc-2_11-branch/libc/wcsmbs/wchar.h (original)
+++ fsf/glibc-2_11-branch/libc/wcsmbs/wchar.h Tue Nov 2 00:12:42 2010
@@ -658,10 +658,10 @@
extern int __REDIRECT (wscanf, (__const wchar_t *__restrict __format, ...),
__isoc99_wscanf)
/* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
-extern int __REDIRECT (swscanf, (__const wchar_t *__restrict __s,
- __const wchar_t *__restrict __format, ...),
- __isoc99_swscanf)
- __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+extern int __REDIRECT_NTH (swscanf, (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format,
+ ...), __isoc99_swscanf)
+ /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
# else
extern int __isoc99_fwscanf (__FILE *__restrict __stream,
__const wchar_t *__restrict __format, ...);
@@ -712,10 +712,10 @@
extern int __REDIRECT (vwscanf, (__const wchar_t *__restrict __format,
__gnuc_va_list __arg), __isoc99_vwscanf)
/* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
-extern int __REDIRECT (vswscanf, (__const wchar_t *__restrict __s,
- __const wchar_t *__restrict __format,
- __gnuc_va_list __arg), __isoc99_vswscanf)
- __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+extern int __REDIRECT_NTH (vswscanf, (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg), __isoc99_vswscanf)
+ /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
# else
extern int __isoc99_vfwscanf (__FILE *__restrict __s,
__const wchar_t *__restrict __format,
Modified: fsf/glibc-2_11-branch/libc/wcsmbs/wcsatcliff.c
==============================================================================
--- fsf/glibc-2_11-branch/libc/wcsmbs/wcsatcliff.c (original)
+++ fsf/glibc-2_11-branch/libc/wcsmbs/wcsatcliff.c Tue Nov 2 00:12:42 2010
@@ -16,6 +16,8 @@
#define MEMCPY wmemcpy
#define MEMPCPY wmempcpy
#define MEMCHR wmemchr
+#define STRCMP wcscmp
+#define STRNCMP wcsncmp
#include "../string/stratcliff.c"