summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2010-10-12 20:15:00 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2010-10-12 20:15:00 +0000
commit9a13037b9f1354b7405124e83087b72c4c44d388 (patch)
treeada19b076406948b19b9b522f233839986f3b26f
parentd98e5692a730c407beffb9c2b1e31ffb14197948 (diff)
Merge changes between r11460 and r11760 from /fsf/trunk.
* sysdeps/powerpc/powerpc32/e500/fpu/feupdateenv.c (feupdateenv): Add libm_hidden_ver. * sysdeps/powerpc/powerpc32/e500/fpu/ftestexcept.c (fetestexcept): Add libm_hidden_def. git-svn-id: svn://svn.eglibc.org/trunk@11761 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r--libc/ChangeLog176
-rw-r--r--libc/ChangeLog.166
-rw-r--r--libc/INSTALL6
-rw-r--r--libc/NEWS5
-rw-r--r--libc/debug/stack_chk_fail_local.c17
-rw-r--r--libc/debug/warning-nop.c17
-rw-r--r--libc/elf/dl-close.c74
-rw-r--r--libc/elf/dl-libc.c103
-rw-r--r--libc/elf/dl-load.c3
-rw-r--r--libc/elf/dl-support.c3
-rw-r--r--libc/elf/rtld.c4
-rw-r--r--libc/include/fenv.h2
-rw-r--r--libc/localedata/ChangeLog2
-rw-r--r--libc/malloc/mcheck.c22
-rw-r--r--libc/math/feupdateenv.c3
-rw-r--r--libc/math/ftestexcept.c3
-rw-r--r--libc/math/libm-test.inc4
-rw-r--r--libc/nptl/ChangeLog6
-rw-r--r--libc/nptl/sysdeps/pthread/pthread.h12
-rw-r--r--libc/posix/Makefile8
-rw-r--r--libc/posix/bug-regex31.c36
-rw-r--r--libc/posix/bug-regex31.input4
-rw-r--r--libc/posix/regcomp.c19
-rw-r--r--libc/posix/unistd.h3
-rw-r--r--libc/resolv/res_init.c1
-rw-r--r--libc/stdio-common/psiginfo.c34
-rw-r--r--libc/string/Makefile3
-rw-r--r--libc/string/bug-strstr1.c26
-rw-r--r--libc/string/str-two-way.h2
-rw-r--r--libc/string/stratcliff.c144
-rw-r--r--libc/sysdeps/i386/fpu/feupdateenv.c3
-rw-r--r--libc/sysdeps/i386/fpu/ftestexcept.c3
-rw-r--r--libc/sysdeps/i386/i686/multiarch/s_fmaf.c2
-rw-r--r--libc/sysdeps/ia64/fpu/feupdateenv.c3
-rw-r--r--libc/sysdeps/ia64/fpu/ftestexcept.c3
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_fmaf.c50
-rw-r--r--libc/sysdeps/powerpc/fpu/feupdateenv.c3
-rw-r--r--libc/sysdeps/powerpc/fpu/ftestexcept.c3
-rw-r--r--libc/sysdeps/powerpc/powerpc32/rtld-memset.c4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/rtld-memset.c4
-rw-r--r--libc/sysdeps/s390/fpu/feupdateenv.c3
-rw-r--r--libc/sysdeps/s390/fpu/ftestexcept.c3
-rw-r--r--libc/sysdeps/s390/s390-32/__longjmp.c13
-rw-r--r--libc/sysdeps/s390/s390-32/elf/start.S14
-rw-r--r--libc/sysdeps/s390/s390-64/__longjmp.c13
-rw-r--r--libc/sysdeps/sh/sh4/fpu/fpu_control.h13
-rw-r--r--libc/sysdeps/sh/sh4/fpu/ftestexcept.c3
-rw-r--r--libc/sysdeps/sparc/fpu/feupdateenv.c3
-rw-r--r--libc/sysdeps/sparc/fpu/ftestexcept.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/check_pf.c13
-rw-r--r--libc/sysdeps/unix/sysv/linux/getdents.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/internal_statvfs.c9
-rw-r--r--libc/sysdeps/unix/sysv/linux/linux_fsinfo.h16
-rw-r--r--libc/sysdeps/unix/sysv/linux/pathconf.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list1
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S26
-rw-r--r--libc/sysdeps/x86_64/fpu/feupdateenv.c3
-rw-r--r--libc/sysdeps/x86_64/fpu/ftestexcept.c3
-rw-r--r--libc/sysdeps/x86_64/multiarch/s_fmaf.c4
-rw-r--r--libc/sysdeps/x86_64/strcmp.S34
-rw-r--r--libc/wcsmbs/wcsatcliff.c2
-rw-r--r--ports/ChangeLog.alpha25
-rw-r--r--ports/ChangeLog.arm13
-rw-r--r--ports/ChangeLog.eglibc7
-rw-r--r--ports/ChangeLog.m68k9
-rw-r--r--ports/ChangeLog.mips6
-rw-r--r--ports/ChangeLog.powerpc7
-rw-r--r--ports/sysdeps/alpha/alphaev6/memchr.S193
-rw-r--r--ports/sysdeps/alpha/memchr.S176
-rw-r--r--ports/sysdeps/alpha/memchr.c176
-rw-r--r--ports/sysdeps/arm/eabi/feupdateenv.c3
-rw-r--r--ports/sysdeps/arm/eabi/ftestexcept.c3
-rw-r--r--ports/sysdeps/arm/fpu/ftestexcept.c3
-rw-r--r--ports/sysdeps/m68k/fpu/feupdateenv.c3
-rw-r--r--ports/sysdeps/m68k/fpu/ftestexcept.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h14
-rw-r--r--ports/sysdeps/mips/fpu/feupdateenv.c3
-rw-r--r--ports/sysdeps/mips/fpu/ftestexcept.c3
-rw-r--r--ports/sysdeps/powerpc/nofpu/feupdateenv.c3
-rw-r--r--ports/sysdeps/powerpc/nofpu/ftestexcept.c3
-rw-r--r--ports/sysdeps/powerpc/powerpc32/e500/fpu/feupdateenv.c1
-rw-r--r--ports/sysdeps/powerpc/powerpc32/e500/fpu/ftestexcept.c1
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/fstatfs64.c1
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/fstatvfs.c1
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/fstatvfs64.c1
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/internal_statvfs64.c1
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/statfs64.c1
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/statvfs.c1
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/statvfs64.c1
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/syscalls.list5
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/syscalls.list2
92 files changed, 1052 insertions, 635 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index 608be4e12..e2a4a7051 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,179 @@
+2010-10-12 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #12078]
+ * posix/regcomp.c (parse_branch): One more memory leak plugged.
+ * posix/bug-regex31.input: Add test case.
+
+2010-10-11 Ulrich Drepper <drepper@gmail.com>
+
+ * posix/bug-regex31.c: Rewrite to run multiple tests from stdin.
+ * posix/bug-regex31.input: New file.
+
+ [BZ #12078]
+ * posix/regcomp.c (parse_branch): Free memory when allocation failed.
+ (parse_sub_exp): Fix last change, use postorder.
+
+ * posix/bug-regex31.c: New file.
+ * posix/Makefile: Add rules to build and run bug-regex31.
+
+ * posix/regcomp.c (parse_bracket_exp): Add missing re_free calls.
+
+ [BZ #12078]
+ * posix/regcomp.c (parse_sub_exp): Free tree data when it is not used.
+
+ [BZ #12108]
+ * stdio-common/psiginfo.c (psiginfo): Don't expext SIGRTMIN..SIGRTMAX
+ to have entries in sys_siglist.
+
+ [BZ #12093]
+ * sysdeps/unix/sysv/linux/check_pf.c (__check_pf): ->ifa_addr might
+ be NULL.
+
+2010-10-07 Jakub Jelinek <jakub@redhat.com>
+
+ [BZ #3268]
+ * math/libm-test.inc (fma_test): Add 2 fmaf tests.
+ * sysdeps/ieee754/dbl-64/s_fmaf.c: New file.
+ * sysdeps/i386/i686/multiarch/s_fmaf.c: Include
+ sysdeps/ieee754/dbl-64/s_fmaf.c instead of math/s_fmaf.c.
+ * sysdeps/x86_64/multiarch/s_fmaf.c: Likewise.
+ * include/fenv.h (feupdateenv, fetestexcept): Add libm_hidden_proto.
+ * math/feupdateenv.c (feupdateenv): Add libm_hidden_ver.
+ * sysdeps/i386/fpu/feupdateenv.c (feupdateenv): Likewise.
+ * sysdeps/powerpc/fpu/feupdateenv.c (feupdateenv): Likewise.
+ * sysdeps/x86_64/fpu/feupdateenv.c (feupdateenv): Likewise.
+ * sysdeps/sparc/fpu/feupdateenv.c (feupdateenv): Likewise.
+ * sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Add libm_hidden_def.
+ * sysdeps/s390/fpu/feupdateenv.c (feupdateenv): Likewise.
+ * math/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/ia64/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/i386/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/s390/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/powerpc/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/x86_64/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/sparc/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/sh/sh4/fpu/ftestexcept.c (fetestexcept): Likewise.
+
+2010-10-11 Ulrich Drepper <drepper@gmail.com>
+
+ [BZ #12107]
+ * stdio-common/psiginfo.c (psiginfo): Terminate all strings with
+ newline.
+
+2010-10-06 Ulrich Drepper <drepper@gmail.com>
+
+ * string/bug-strstr1.c: New file.
+ * string/Makefile: Add rules to build and run bug-strstr1.
+
+2010-10-05 Eric Blake <eblake@redhat.com>
+
+ [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@gmail.com>
+
+ [BZ #12005]
+ * malloc/mcheck.c: Handle large requests.
+
+ [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-09-28 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+ * sysdeps/sh/sh4/fpu/fpu_control.h: Add 'extern "C"' protection to
+ __set_fpscr.
+
+2010-09-30 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux_fsinfo.h (BTRFS_SUPER_MAGIC): Define.
+ (CGROUP_SUPER_MAGIC): Define.
+ * sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags):
+ Handle btrfs and cgroup file systems.
+ * sysdeps/unix/sysv/linux/pathconf.c (__statfs_filesize_max):
+ Likewise.
+
+2010-09-27 Luis Machado <luisgpm@br.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/rtld-memset.c: New file.
+ * sysdeps/powerpc/powerpc64/rtld-memset.c: New file.
+
+2010-09-29 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ [BZ #12067]
+ * sysdeps/s390/s390-32/elf/start.S: Fix address calculation when
+ trying to locate the ELF header.
+
+2010-09-27 Andreas Schwab <schwab@redhat.com>
+
+ [BZ #11611]
+ * sysdeps/unix/sysv/linux/internal_statvfs.c (INTERNAL_STATVFS):
+ Mask out sign-bit copies when constructing f_fsid.
+
+2010-09-24 Petr Baudis <pasky@suse.cz>
+
+ * debug/stack_chk_fail_local.c: Add missing licence exception.
+ * debug/warning-nop.c: Likewise.
+
+2010-09-15 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): When
+ implementing getdents64 using getdents syscall, set d_type if
+ __ASSUME_GETDENTS32_D_TYPE.
+
+2010-09-16 Andreas Schwab <schwab@redhat.com>
+
+ * elf/dl-close.c (free_slotinfo, free_mem): Move to...
+ * elf/dl-libc.c (free_slotinfo, free_mem): ... here.
+
+2010-09-21 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #12037]
+ * posix/unistd.h: Undo change of feature selection for ftruncate from
+ 2010-01-11.
+
+2010-09-20 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/x86_64/strcmp.S: Fix another typo in x86-64 strncasecmp limit
+ detection.
+
+2010-09-20 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Add
+ fanotify_mark.
+ * sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list: Likewise.
+
+2010-09-14 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/s390/s390-32/__longjmp.c (__longjmp): Define register
+ variables after CHECK_SP call.
+ * sysdeps/s390/s390-64/__longjmp.c (__longjmp): Likewise.
+
+2010-09-13 Andreas Schwab <schwab@redhat.com>
+ Ulrich Drepper <drepper@redhat.com>
+
+ * elf/rtld.c (dl_main): Set GLRO(dl_init_all_dirs) just before
+ re-relocationg ld.so.
+ * elf/dl-support.c (_dl_non_dynamic_init): And here after the
+ _dl_init_paths call.
+ * elf/dl-load.c (_dl_init_paths). Don't set GLRO(dl_init_all_dirs)
+ here anymore.
+
+2010-09-14 Ulrich Drepper <drepper@redhat.com>
+
+ * resolv/res_init.c (__res_vinit): Count the default server we added.
+
+2010-09-08 Chung-Lin Tang <cltang@codesourcery.com>
+ Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #11968]
+ * sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+ (____longjmp_chk): Use %ebx for saving value across system call.
+ Add unwind info.
+
2010-09-06 Andreas Schwab <schwab@redhat.com>
* manual/Makefile: Don't mix pattern rules with normal rules.
diff --git a/libc/ChangeLog.16 b/libc/ChangeLog.16
index 3c09a3b6a..d720779f3 100644
--- a/libc/ChangeLog.16
+++ b/libc/ChangeLog.16
@@ -660,7 +660,7 @@
* iconvdata/Makefile (generate-8bit-table): Use LC_ALL=C.
(generate-8bit-gap-table): Likewise.
($(objpfx)iso8859-7jp.stmp): Likewise.
- Reported by S.Çağlar Onur <caglar@uludag.org.tr>.
+ Reported by S.Çağlar Onur <caglar@uludag.org.tr>.
2006-03-21 Joseph S. Myers <joseph@codesourcery.com>
@@ -6927,7 +6927,7 @@
2005-11-28 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/mips/bits/mman.h (MREMAP_FIXED): Added,
- Patch by René Rebe <rene@exactcode.de>.
+ Patch by René Rebe <rene@exactcode.de>.
2005-11-27 Ulrich Drepper <drepper@redhat.com>
@@ -6939,7 +6939,7 @@
2005-11-27 Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/fchownat.c: Include alloca.h, sysdep.h.
- Reported by René Rebe <rene@exactcode.de>.
+ Reported by René Rebe <rene@exactcode.de>.
2005-11-27 Ulrich Drepper <drepper@redhat.com>
diff --git a/libc/INSTALL b/libc/INSTALL
index aee377849..e7b0b03c8 100644
--- a/libc/INSTALL
+++ b/libc/INSTALL
@@ -329,11 +329,12 @@ build the GNU C library:
Check the FAQ for any special compiler issues on particular
platforms.
- * GNU `binutils' 2.15 or later
+ * GNU `binutils'
You must use GNU `binutils' (as and ld) to build the GNU C library.
No other assembler or linker has the necessary functionality at the
- moment.
+ moment. The configure scripts checks for the appropriate version
+ for the platform. Too-old versions will prevent building glibc.
* GNU `texinfo' 3.12f
@@ -472,4 +473,3 @@ or the manual has a bug, so report the disagreement. If you find any
errors or omissions in this manual, please report them to the bug
database. If you refer to specific sections of the manual, please
include the section names for easier identification.
-
diff --git a/libc/NEWS b/libc/NEWS
index 432813bb9..bd0f21c45 100644
--- a/libc/NEWS
+++ b/libc/NEWS
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes. 2010-8-25
+GNU C Library NEWS -- history of user-visible changes. 2010-10-11
Copyright (C) 1992-2009, 2010 Free Software Foundation, Inc.
See the end for copying conditions.
@@ -9,7 +9,8 @@ Version 2.13
* The following bugs are resolved with this release:
- 7066, 10851, 11640, 11701, 11840, 11856, 11883, 11903, 11904
+ 3268, 7066, 10851, 11611, 11640, 11701, 11840, 11856, 11883, 11903, 11904,
+ 11968, 11979, 12005, 12037, 12067, 12077, 12078, 12092, 12093, 12107, 12108
* New Linux interfaces: prlimit, prlimit64, fanotify_init, fanotify_mark
diff --git a/libc/debug/stack_chk_fail_local.c b/libc/debug/stack_chk_fail_local.c
index de0de8f39..113088d55 100644
--- a/libc/debug/stack_chk_fail_local.c
+++ b/libc/debug/stack_chk_fail_local.c
@@ -6,6 +6,23 @@
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
diff --git a/libc/debug/warning-nop.c b/libc/debug/warning-nop.c
index 8f2f66e16..74df8e7c5 100644
--- a/libc/debug/warning-nop.c
+++ b/libc/debug/warning-nop.c
@@ -7,6 +7,23 @@
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
diff --git a/libc/elf/dl-close.c b/libc/elf/dl-close.c
index c8d9e29a9..866c0a67e 100644
--- a/libc/elf/dl-close.c
+++ b/libc/elf/dl-close.c
@@ -748,77 +748,3 @@ _dl_close (void *_map)
__rtld_lock_unlock_recursive (GL(dl_load_lock));
}
-
-
-static bool __libc_freeres_fn_section
-free_slotinfo (struct dtv_slotinfo_list **elemp)
-{
- size_t cnt;
-
- if (*elemp == NULL)
- /* Nothing here, all is removed (or there never was anything). */
- return true;
-
- if (!free_slotinfo (&(*elemp)->next))
- /* We cannot free the entry. */
- return false;
-
- /* That cleared our next pointer for us. */
-
- for (cnt = 0; cnt < (*elemp)->len; ++cnt)
- if ((*elemp)->slotinfo[cnt].map != NULL)
- /* Still used. */
- return false;
-
- /* We can remove the list element. */
- free (*elemp);
- *elemp = NULL;
-
- return true;
-}
-
-
-libc_freeres_fn (free_mem)
-{
- for (Lmid_t nsid = 0; nsid < GL(dl_nns); ++nsid)
- if (__builtin_expect (GL(dl_ns)[nsid]._ns_global_scope_alloc, 0) != 0
- && (GL(dl_ns)[nsid]._ns_main_searchlist->r_nlist
- // XXX Check whether we need NS-specific initial_searchlist
- == GLRO(dl_initial_searchlist).r_nlist))
- {
- /* All object dynamically loaded by the program are unloaded. Free
- the memory allocated for the global scope variable. */
- struct link_map **old = GL(dl_ns)[nsid]._ns_main_searchlist->r_list;
-
- /* Put the old map in. */
- GL(dl_ns)[nsid]._ns_main_searchlist->r_list
- // XXX Check whether we need NS-specific initial_searchlist
- = GLRO(dl_initial_searchlist).r_list;
- /* Signal that the original map is used. */
- GL(dl_ns)[nsid]._ns_global_scope_alloc = 0;
-
- /* Now free the old map. */
- free (old);
- }
-
- if (USE___THREAD || GL(dl_tls_dtv_slotinfo_list) != NULL)
- {
- /* Free the memory allocated for the dtv slotinfo array. We can do
- this only if all modules which used this memory are unloaded. */
-#ifdef SHARED
- if (GL(dl_initial_dtv) == NULL)
- /* There was no initial TLS setup, it was set up later when
- it used the normal malloc. */
- free_slotinfo (&GL(dl_tls_dtv_slotinfo_list));
- else
-#endif
- /* The first element of the list does not have to be deallocated.
- It was allocated in the dynamic linker (i.e., with a different
- malloc), and in the static library it's in .bss space. */
- free_slotinfo (&GL(dl_tls_dtv_slotinfo_list)->next);
- }
-
- void *scope_free_list = GL(dl_scope_free_list);
- GL(dl_scope_free_list) = NULL;
- free (scope_free_list);
-}
diff --git a/libc/elf/dl-libc.c b/libc/elf/dl-libc.c
index 5e303f29c..7be9483de 100644
--- a/libc/elf/dl-libc.c
+++ b/libc/elf/dl-libc.c
@@ -1,5 +1,5 @@
/* Handle loading and unloading shared objects for internal libc purposes.
- Copyright (C) 1999-2002,2004,2005,2006,2009 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002,2004-2006,2009,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.columbia.edu>, 1999.
@@ -221,6 +221,34 @@ __libc_dlclose (void *map)
libc_hidden_def (__libc_dlclose)
+static bool __libc_freeres_fn_section
+free_slotinfo (struct dtv_slotinfo_list **elemp)
+{
+ size_t cnt;
+
+ if (*elemp == NULL)
+ /* Nothing here, all is removed (or there never was anything). */
+ return true;
+
+ if (!free_slotinfo (&(*elemp)->next))
+ /* We cannot free the entry. */
+ return false;
+
+ /* That cleared our next pointer for us. */
+
+ for (cnt = 0; cnt < (*elemp)->len; ++cnt)
+ if ((*elemp)->slotinfo[cnt].map != NULL)
+ /* Still used. */
+ return false;
+
+ /* We can remove the list element. */
+ free (*elemp);
+ *elemp = NULL;
+
+ return true;
+}
+
+
libc_freeres_fn (free_mem)
{
struct link_map *l;
@@ -235,20 +263,63 @@ libc_freeres_fn (free_mem)
free (old);
}
- /* Remove all additional names added to the objects. */
for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
- for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
- {
- struct libname_list *lnp = l->l_libname->next;
-
- l->l_libname->next = NULL;
-
- while (lnp != NULL)
- {
- struct libname_list *old = lnp;
- lnp = lnp->next;
- if (! old->dont_free)
- free (old);
- }
- }
+ {
+ /* Remove all additional names added to the objects. */
+ for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
+ {
+ struct libname_list *lnp = l->l_libname->next;
+
+ l->l_libname->next = NULL;
+
+ while (lnp != NULL)
+ {
+ struct libname_list *old = lnp;
+ lnp = lnp->next;
+ if (! old->dont_free)
+ free (old);
+ }
+ }
+
+ if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0
+ && (GL(dl_ns)[ns]._ns_main_searchlist->r_nlist
+ // XXX Check whether we need NS-specific initial_searchlist
+ == GLRO(dl_initial_searchlist).r_nlist))
+ {
+ /* All object dynamically loaded by the program are unloaded. Free
+ the memory allocated for the global scope variable. */
+ struct link_map **old = GL(dl_ns)[ns]._ns_main_searchlist->r_list;
+
+ /* Put the old map in. */
+ GL(dl_ns)[ns]._ns_main_searchlist->r_list
+ // XXX Check whether we need NS-specific initial_searchlist
+ = GLRO(dl_initial_searchlist).r_list;
+ /* Signal that the original map is used. */
+ GL(dl_ns)[ns]._ns_global_scope_alloc = 0;
+
+ /* Now free the old map. */
+ free (old);
+ }
+ }
+
+ if (USE___THREAD || GL(dl_tls_dtv_slotinfo_list) != NULL)
+ {
+ /* Free the memory allocated for the dtv slotinfo array. We can do
+ this only if all modules which used this memory are unloaded. */
+#ifdef SHARED
+ if (GL(dl_initial_dtv) == NULL)
+ /* There was no initial TLS setup, it was set up later when
+ it used the normal malloc. */
+ free_slotinfo (&GL(dl_tls_dtv_slotinfo_list));
+ else
+#endif
+ /* The first element of the list does not have to be deallocated.
+ It was allocated in the dynamic linker (i.e., with a different
+ malloc), and in the static library it's in .bss space. */
+ free_slotinfo (&GL(dl_tls_dtv_slotinfo_list)->next);
+ }
+
+ void *scope_free_list = GL(dl_scope_free_list);
+ GL(dl_scope_free_list) = NULL;
+ free (scope_free_list);
}
diff --git a/libc/elf/dl-load.c b/libc/elf/dl-load.c
index 485bd03a7..0345efb93 100644
--- a/libc/elf/dl-load.c
+++ b/libc/elf/dl-load.c
@@ -787,9 +787,6 @@ _dl_init_paths (const char *llp)
}
else
env_path_list.dirs = (void *) -1;
-
- /* Remember the last search directory added at startup. */
- GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
}
diff --git a/libc/elf/dl-support.c b/libc/elf/dl-support.c
index ce507734d..5c0b79875 100644
--- a/libc/elf/dl-support.c
+++ b/libc/elf/dl-support.c
@@ -266,6 +266,9 @@ _dl_non_dynamic_init (void)
objects. */
_dl_init_paths (getenv ("LD_LIBRARY_PATH"));
+ /* Remember the last search directory added at startup. */
+ _dl_init_all_dirs = GL(dl_all_dirs);
+
_dl_lazy = *(getenv ("LD_BIND_NOW") ?: "") == '\0';
_dl_bind_not = *(getenv ("LD_BIND_NOT") ?: "") != '\0';
diff --git a/libc/elf/rtld.c b/libc/elf/rtld.c
index 99af170b6..4ca07f8ae 100644
--- a/libc/elf/rtld.c
+++ b/libc/elf/rtld.c
@@ -2291,6 +2291,10 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
lossage);
}
+ /* Remember the last search directory added at startup, now that
+ malloc will no longer be the one from dl-minimal.c. */
+ GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
+
if (! prelinked && rtld_multiple_ref)
{
/* There was an explicit ref to the dynamic linker as a shared lib.
diff --git a/libc/include/fenv.h b/libc/include/fenv.h
index 254162d45..3605f8150 100644
--- a/libc/include/fenv.h
+++ b/libc/include/fenv.h
@@ -17,5 +17,7 @@ libm_hidden_proto (fegetenv)
libm_hidden_proto (fesetenv)
libm_hidden_proto (fesetround)
libm_hidden_proto (feholdexcept)
+libm_hidden_proto (feupdateenv)
+libm_hidden_proto (fetestexcept)
#endif
diff --git a/libc/localedata/ChangeLog b/libc/localedata/ChangeLog
index 5ef9e5ae2..6b48eb7e6 100644
--- a/libc/localedata/ChangeLog
+++ b/libc/localedata/ChangeLog
@@ -3079,7 +3079,7 @@
* charmaps/ISO-8859-16: Swap 0xa5 and 0xab entries.
-2001-11-15 Børre Gaup <boerre.gaup@pc.nu>
+2001-11-15 Børre Gaup <boerre.gaup@pc.nu>
* locales/se_NO: New file.
diff --git a/libc/malloc/mcheck.c b/libc/malloc/mcheck.c
index 524acc755..e2eb83f41 100644
--- a/libc/malloc/mcheck.c
+++ b/libc/malloc/mcheck.c
@@ -1,5 +1,6 @@
/* Standard debugging hooks for `malloc'.
- Copyright (C) 1990-1997,1999,2000-2002,2007 Free Software Foundation, Inc.
+ Copyright (C) 1990-1997,1999,2000-2002,2007,2010
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written May 1989 by Mike Haertel.
@@ -25,6 +26,7 @@
# include <stdint.h>
# include <stdio.h>
# include <libintl.h>
+# include <errno.h>
#endif
/* Old hook values. */
@@ -209,6 +211,12 @@ mallochook (__malloc_size_t size, const __ptr_t caller)
if (pedantic)
mcheck_check_all ();
+ if (size > ~((size_t) 0) - (sizeof (struct hdr) + 1))
+ {
+ __set_errno (ENOMEM);
+ return NULL;
+ }
+
__malloc_hook = old_malloc_hook;
if (old_malloc_hook != NULL)
hdr = (struct hdr *) (*old_malloc_hook) (sizeof (struct hdr) + size + 1,
@@ -241,6 +249,12 @@ memalignhook (__malloc_size_t alignment, __malloc_size_t size,
slop = (sizeof *hdr + alignment - 1) & -alignment;
+ if (size > ~((size_t) 0) - (slop + 1))
+ {
+ __set_errno (ENOMEM);
+ return NULL;
+ }
+
__memalign_hook = old_memalign_hook;
if (old_memalign_hook != NULL)
block = (*old_memalign_hook) (alignment, slop + size + 1, caller);
@@ -276,6 +290,12 @@ reallochook (__ptr_t ptr, __malloc_size_t size, const __ptr_t caller)
if (pedantic)
mcheck_check_all ();
+ if (size > ~((size_t) 0) - (sizeof (struct hdr) + 1))
+ {
+ __set_errno (ENOMEM);
+ return NULL;
+ }
+
if (ptr)
{
hdr = ((struct hdr *) ptr) - 1;
diff --git a/libc/math/feupdateenv.c b/libc/math/feupdateenv.c
index 3e6aed4fd..dd7a1afdb 100644
--- a/libc/math/feupdateenv.c
+++ b/libc/math/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -31,6 +31,7 @@ __feupdateenv (const fenv_t *envp)
strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
stub_warning (feupdateenv)
diff --git a/libc/math/ftestexcept.c b/libc/math/ftestexcept.c
index 4be3fb770..951d1346c 100644
--- a/libc/math/ftestexcept.c
+++ b/libc/math/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -25,5 +25,6 @@ fetestexcept (int excepts)
{
return 0;
}
+libm_hidden_def (fetestexcept)
stub_warning (fetestexcept)
#include <stub-tag.h>
diff --git a/libc/math/libm-test.inc b/libc/math/libm-test.inc
index cfb7b5120..784cdb6e4 100644
--- a/libc/math/libm-test.inc
+++ b/libc/math/libm-test.inc
@@ -2802,6 +2802,10 @@ fma_test (void)
TEST_fff_f (fma, minus_infty, minus_infty, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_fff_f (fma, 1.25L, 0.75L, 0.0625L, 1.0L);
+#ifdef TEST_FLOAT
+ TEST_fff_f (fma, 0x1.7ff8p+13, 0x1.000002p+0, 0x1.ffffp-24, 0x1.7ff802p+13);
+ TEST_fff_f (fma, 0x1.fffp+0, 0x1.00001p+0, -0x1.fffp+0, 0x1.fffp-20);
+#endif
END (fma);
}
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog
index 30631dcd1..dcb94b220 100644
--- a/libc/nptl/ChangeLog
+++ b/libc/nptl/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-21 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/pthread/pthread.h (pthread_cleanup_push)
+ [!__EXCEPTIONS]: Mangle local variable not_first_call.
+ (pthread_cleanup_push_defer_np): Likewise.
+
2010-09-03 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/allocalim.h (__libc_use_alloca): Expect blocks are
diff --git a/libc/nptl/sysdeps/pthread/pthread.h b/libc/nptl/sysdeps/pthread/pthread.h
index 44cf9f0ca..4c8366545 100644
--- a/libc/nptl/sysdeps/pthread/pthread.h
+++ b/libc/nptl/sysdeps/pthread/pthread.h
@@ -650,9 +650,9 @@ __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
__pthread_unwind_buf_t __cancel_buf; \
void (*__cancel_routine) (void *) = (routine); \
void *__cancel_arg = (arg); \
- int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
- __cancel_buf.__cancel_jmp_buf, 0); \
- if (__builtin_expect (not_first_call, 0)) \
+ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
+ __cancel_buf.__cancel_jmp_buf, 0); \
+ if (__builtin_expect (__not_first_call, 0)) \
{ \
__cancel_routine (__cancel_arg); \
__pthread_unwind_next (&__cancel_buf); \
@@ -685,9 +685,9 @@ extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
__pthread_unwind_buf_t __cancel_buf; \
void (*__cancel_routine) (void *) = (routine); \
void *__cancel_arg = (arg); \
- int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
- __cancel_buf.__cancel_jmp_buf, 0); \
- if (__builtin_expect (not_first_call, 0)) \
+ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
+ __cancel_buf.__cancel_jmp_buf, 0); \
+ if (__builtin_expect (__not_first_call, 0)) \
{ \
__cancel_routine (__cancel_arg); \
__pthread_unwind_next (&__cancel_buf); \
diff --git a/libc/posix/Makefile b/libc/posix/Makefile
index ee5d7efa9..73e7769c9 100644
--- a/libc/posix/Makefile
+++ b/libc/posix/Makefile
@@ -94,6 +94,7 @@ tests := tstgetopt testfnm runtests \
bug-regex14 bug-regex15 \
bug-regex21 bug-regex24 \
bug-regex27 bug-regex28 bug-regex29 bug-regex30 \
+ bug-regex31 \
tst-nice tst-nanosleep \
transbug \
tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
@@ -136,6 +137,7 @@ generated := $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
annexc annexc.out wordexp-tst.out bug-regex2-mem \
bug-regex2.mtrace bug-regex14-mem bug-regex14.mtrace \
bug-regex21-mem bug-regex21.mtrace \
+ bug-regex31-mem bug-regex31.mtrace \
tst-rxspencer-mem tst-rxspencer.mtrace tst-getconf.out \
tst-pcre-mem tst-pcre.mtrace tst-boost-mem tst-boost.mtrace \
bug-ga2.mtrace bug-ga2-mem bug-glob2.mtrace bug-glob2-mem \
@@ -267,6 +269,7 @@ tests: $(objpfx)annexc.out
# eglibc: ifeq (no,$(cross-compiling))
tests: $(objpfx)bug-regex2-mem \
$(objpfx)bug-regex21-mem \
+ $(objpfx)bug-regex31-mem \
$(objpfx)tst-getconf.out \
$(objpfx)bug-glob2-mem $(objpfx)tst-vfork3-mem
ifeq (y,($OPTION_POSIX_REGEXP_GLIBC))
@@ -299,6 +302,11 @@ bug-regex21-ENV = MALLOC_TRACE=$(objpfx)bug-regex21.mtrace
$(objpfx)bug-regex21-mem: $(objpfx)bug-regex21.out
$(common-objpfx)malloc/mtrace $(objpfx)bug-regex21.mtrace > $@
+bug-regex31-ENV = MALLOC_TRACE=$(objpfx)bug-regex31.mtrace
+
+$(objpfx)bug-regex31-mem: $(objpfx)bug-regex31.out
+ $(common-objpfx)malloc/mtrace $(objpfx)bug-regex31.mtrace > $@
+
tst-vfork3-ENV = MALLOC_TRACE=$(objpfx)tst-vfork3.mtrace
$(objpfx)tst-vfork3-mem: $(objpfx)tst-vfork3.out
diff --git a/libc/posix/bug-regex31.c b/libc/posix/bug-regex31.c
new file mode 100644
index 000000000..974e8603b
--- /dev/null
+++ b/libc/posix/bug-regex31.c
@@ -0,0 +1,36 @@
+#include <mcheck.h>
+#include <regex.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+int
+main (void)
+{
+ mtrace ();
+
+ int res = 0;
+ char *buf = NULL;
+ size_t len = 0;
+ while (! feof (stdin))
+ {
+ ssize_t n = getline (&buf, &len, stdin);
+ if (n <= 0)
+ break;
+ if (buf[n - 1] == '\n')
+ buf[n - 1] = '\0';
+
+ regex_t regex;
+ int rc = regcomp (&regex, buf, REG_EXTENDED);
+ if (rc != 0)
+ printf ("%s: Error %d (expected)\n", buf, rc);
+ else
+ {
+ printf ("%s: succeeded !\n", buf);
+ res = 1;
+ }
+ }
+
+ free (buf);
+
+ return 0;
+}
diff --git a/libc/posix/bug-regex31.input b/libc/posix/bug-regex31.input
new file mode 100644
index 000000000..3d1f531f4
--- /dev/null
+++ b/libc/posix/bug-regex31.input
@@ -0,0 +1,4 @@
+[[][
+([0]
+([0]a
+([0]([0])
diff --git a/libc/posix/regcomp.c b/libc/posix/regcomp.c
index 4f35d6b55..3a49b87c5 100644
--- a/libc/posix/regcomp.c
+++ b/libc/posix/regcomp.c
@@ -2170,16 +2170,21 @@ parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token,
exp = parse_expression (regexp, preg, token, syntax, nest, err);
if (BE (*err != REG_NOERROR && exp == NULL, 0))
{
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
return NULL;
}
if (tree != NULL && exp != NULL)
{
- tree = create_tree (dfa, tree, exp, CONCAT);
- if (tree == NULL)
+ bin_tree_t *newtree = create_tree (dfa, tree, exp, CONCAT);
+ if (newtree == NULL)
{
+ postorder (exp, free_tree, NULL);
+ postorder (tree, free_tree, NULL);
*err = REG_ESPACE;
return NULL;
}
+ tree = newtree;
}
else if (tree == NULL)
tree = exp;
@@ -2428,7 +2433,11 @@ parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
{
tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0))
- *err = REG_EPAREN;
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ *err = REG_EPAREN;
+ }
if (BE (*err != REG_NOERROR, 0))
return NULL;
}
@@ -3055,6 +3064,10 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
if (BE (sbcset == NULL, 0))
#endif /* RE_ENABLE_I18N */
{
+ re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+ re_free (mbcset);
+#endif
*err = REG_ESPACE;
return NULL;
}
diff --git a/libc/posix/unistd.h b/libc/posix/unistd.h
index 9ed2c8489..00b775192 100644
--- a/libc/posix/unistd.h
+++ b/libc/posix/unistd.h
@@ -1020,6 +1020,9 @@ extern int truncate64 (__const char *__file, __off64_t __length)
__THROW __nonnull ((1)) __wur;
# endif
+#endif /* Use BSD || X/Open Unix || POSIX 2008. */
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
/* Truncate the file FD is open on to LENGTH bytes. */
# ifndef __USE_FILE_OFFSET64
diff --git a/libc/resolv/res_init.c b/libc/resolv/res_init.c
index 202569dda..74715f34e 100644
--- a/libc/resolv/res_init.c
+++ b/libc/resolv/res_init.c
@@ -430,6 +430,7 @@ __res_vinit(res_state statp, int preinit) {
statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
statp->nsaddr.sin_family = AF_INET;
statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
+ statp->nscount = 1;
}
if (statp->defdname[0] == 0 &&
__gethostname(buf, sizeof(statp->defdname) - 1) == 0 &&
diff --git a/libc/stdio-common/psiginfo.c b/libc/stdio-common/psiginfo.c
index 90cdf0590..627c21c64 100644
--- a/libc/stdio-common/psiginfo.c
+++ b/libc/stdio-common/psiginfo.c
@@ -1,4 +1,4 @@
-/* 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
@@ -85,9 +85,28 @@ psiginfo (const siginfo_t *pinfo, const char *s)
const char *desc;
if (pinfo->si_signo >= 0 && pinfo->si_signo < NSIG
- && (desc = INTUSE(_sys_siglist)[pinfo->si_signo]) != NULL)
+ && ((desc = INTUSE(_sys_siglist)[pinfo->si_signo]) != NULL
+ || (pinfo->si_signo >= SIGRTMIN && pinfo->si_signo < SIGRTMAX)))
{
- fprintf (fp, "%s (", _(desc));
+ if (desc == NULL)
+ {
+ if (pinfo->si_signo - SIGRTMIN < SIGRTMAX - pinfo->si_signo)
+ {
+ if (pinfo->si_signo == SIGRTMIN)
+ fprintf (fp, "SIGRTMIN (");
+ else
+ fprintf (fp, "SIGRTMIN+%d (", pinfo->si_signo - SIGRTMIN);
+ }
+ else
+ {
+ if (pinfo->si_signo == SIGRTMAX)
+ fprintf (fp, "SIGRTMAX (");
+ else
+ fprintf (fp, "SIGRTMAX-%d (", SIGRTMAX - pinfo->si_signo);
+ }
+ }
+ else
+ fprintf (fp, "%s (", _(desc));
const char *base = NULL;
const uint8_t *offarr = NULL;
@@ -165,14 +184,15 @@ Signal generated by the completion of an I/O request");
if (pinfo->si_signo == SIGILL || pinfo->si_signo == SIGFPE
|| pinfo->si_signo == SIGSEGV || pinfo->si_signo == SIGBUS)
- fprintf (fp, "[%p])", pinfo->si_addr);
+ fprintf (fp, "[%p])\n", pinfo->si_addr);
else if (pinfo->si_signo == SIGCHLD)
- fprintf (fp, "%ld %d %ld)", (long int) pinfo->si_pid, pinfo->si_status,
+ fprintf (fp, "%ld %d %ld)\n",
+ (long int) pinfo->si_pid, pinfo->si_status,
(long int) pinfo->si_uid);
else if (pinfo->si_signo == SIGPOLL)
- fprintf (fp, "%ld)", (long int) pinfo->si_band);
+ fprintf (fp, "%ld)\n", (long int) pinfo->si_band);
else
- fprintf (fp, "%ld %ld)",
+ fprintf (fp, "%ld %ld)\n",
(long int) pinfo->si_pid, (long int) pinfo->si_uid);
}
else
diff --git a/libc/string/Makefile b/libc/string/Makefile
index 5bb5a973d..f511eb378 100644
--- a/libc/string/Makefile
+++ b/libc/string/Makefile
@@ -59,7 +59,7 @@ tests := tester inl-tester noinl-tester testcopy test-ffs \
bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \
tst-strtok tst-strfry \
bug-strtok1 $(addprefix test-,$(strop-tests)) \
- tst-strxfrm2 tst-endian tst-svc2
+ tst-strxfrm2 tst-endian tst-svc2 bug-strstr1
tests-$(OPTION_EGLIBC_ENVZ) += bug-envz1
tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+= tst-strxfrm bug-strcoll1
@@ -82,6 +82,7 @@ CFLAGS-tst-strlen.c = -fno-builtin
CFLAGS-stratcliff.c = -fno-builtin
CFLAGS-test-ffs.c = -fno-builtin
CFLAGS-tst-inlcall.c = -fno-builtin
+CFLAGS-bug-strstr1.c = -fno-builtin
# eglibc: ifeq ($(cross-compiling),no)
tests: $(objpfx)tst-svc.out
diff --git a/libc/string/bug-strstr1.c b/libc/string/bug-strstr1.c
new file mode 100644
index 000000000..889de1295
--- /dev/null
+++ b/libc/string/bug-strstr1.c
@@ -0,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;
+}
diff --git a/libc/string/str-two-way.h b/libc/string/str-two-way.h
index 502af4704..76044b34f 100644
--- a/libc/string/str-two-way.h
+++ b/libc/string/str-two-way.h
@@ -350,8 +350,8 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
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;
}
diff --git a/libc/string/stratcliff.c b/libc/string/stratcliff.c
index 2bb59820f..5165be2d1 100644
--- a/libc/string/stratcliff.c
+++ b/libc/string/stratcliff.c
@@ -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@cygnus.com>, 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 @@ do_test (void)
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 @@ do_test (void)
/* 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 @@ do_test (void)
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 @@ do_test (void)
adr[inner] = L('T');
}
- }
+ }
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 @@ do_test (void)
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 @@ do_test (void)
adr[middle] = L('T');
}
}
- }
+ }
/* Special test. */
adr[nchars - 1] = L('\0');
@@ -180,7 +183,7 @@ do_test (void)
/* 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 @@ do_test (void)
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 @@ do_test (void)
adr[middle] = L('T');
}
- }
+ }
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 @@ do_test (void)
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 @@ do_test (void)
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 @@ do_test (void)
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 @@ do_test (void)
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 @@ do_test (void)
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 @@ do_test (void)
adr[inner] = L('T');
}
- }
+ }
/* stpncpy/wcpncpy test */
adr[nchars - 1] = L('T');
@@ -374,8 +444,8 @@ do_test (void)
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 @@ do_test (void)
adr[middle] = L('T');
}
- }
+ }
/* memcpy/wmemcpy test */
for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
diff --git a/libc/sysdeps/i386/fpu/feupdateenv.c b/libc/sysdeps/i386/fpu/feupdateenv.c
index a58963837..e283403bf 100644
--- a/libc/sysdeps/i386/fpu/feupdateenv.c
+++ b/libc/sysdeps/i386/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997,99,2000,01,07 Free Software Foundation, Inc.
+ Copyright (C) 1997,99,2000,01,07,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -57,4 +57,5 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);
diff --git a/libc/sysdeps/i386/fpu/ftestexcept.c b/libc/sysdeps/i386/fpu/ftestexcept.c
index 1979fe13f..1c0ae0d02 100644
--- a/libc/sysdeps/i386/fpu/ftestexcept.c
+++ b/libc/sysdeps/i386/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2003, 2004, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -38,3 +38,4 @@ fetestexcept (int excepts)
return (temp | xtemp) & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
diff --git a/libc/sysdeps/i386/i686/multiarch/s_fmaf.c b/libc/sysdeps/i386/i686/multiarch/s_fmaf.c
index 4ea9be48a..a52bd56e8 100644
--- a/libc/sysdeps/i386/i686/multiarch/s_fmaf.c
+++ b/libc/sysdeps/i386/i686/multiarch/s_fmaf.c
@@ -33,4 +33,4 @@ weak_alias (__fmaf, fmaf)
# define __fmaf __fmaf_ia32
#endif
-#include <math/s_fmaf.c>
+#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
diff --git a/libc/sysdeps/ia64/fpu/feupdateenv.c b/libc/sysdeps/ia64/fpu/feupdateenv.c
index 72f12287f..f961fdca3 100644
--- a/libc/sysdeps/ia64/fpu/feupdateenv.c
+++ b/libc/sysdeps/ia64/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000, 2007, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
@@ -38,3 +38,4 @@ feupdateenv (const fenv_t *envp)
/* Success. */
return 0;
}
+libm_hidden_def (feupdateenv)
diff --git a/libc/sysdeps/ia64/fpu/ftestexcept.c b/libc/sysdeps/ia64/fpu/ftestexcept.c
index 64c37d8c8..0d8190b46 100644
--- a/libc/sysdeps/ia64/fpu/ftestexcept.c
+++ b/libc/sysdeps/ia64/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
@@ -30,3 +30,4 @@ fetestexcept (int excepts)
return (fpsr >> 13) & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
diff --git a/libc/sysdeps/ieee754/dbl-64/s_fmaf.c b/libc/sysdeps/ieee754/dbl-64/s_fmaf.c
new file mode 100644
index 000000000..972187660
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/s_fmaf.c
@@ -0,0 +1,50 @@
+/* Compute x * y + z as ternary operation.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <math.h>
+#include <fenv.h>
+#include <ieee754.h>
+
+/* This implementation relies on double being more than twice as
+ precise as float and uses rounding to odd in order to avoid problems
+ with double rounding.
+ See a paper by Boldo and Melquiond:
+ http://www.lri.fr/~melquion/doc/08-tc.pdf */
+
+float
+__fmaf (float x, float y, float z)
+{
+ fenv_t env;
+ /* Multiplication is always exact. */
+ double temp = (double) x * (double) y;
+ union ieee754_double u;
+ feholdexcept (&env);
+ fesetround (FE_TOWARDZERO);
+ /* Perform addition with round to odd. */
+ u.d = temp + (double) z;
+ if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0xff)
+ u.ieee.mantissa1 |= fetestexcept (FE_INEXACT) != 0;
+ feupdateenv (&env);
+ /* And finally truncation with round to nearest. */
+ return (float) u.d;
+}
+#ifndef __fmaf
+weak_alias (__fmaf, fmaf)
+#endif
diff --git a/libc/sysdeps/powerpc/fpu/feupdateenv.c b/libc/sysdeps/powerpc/fpu/feupdateenv.c
index 5fca301fe..9a157c54f 100644
--- a/libc/sysdeps/powerpc/fpu/feupdateenv.c
+++ b/libc/sysdeps/powerpc/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997, 1999, 2000, 2001, 2007, 2008
+ Copyright (C) 1997, 1999, 2000, 2001, 2007, 2008, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -66,4 +66,5 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);
diff --git a/libc/sysdeps/powerpc/fpu/ftestexcept.c b/libc/sysdeps/powerpc/fpu/ftestexcept.c
index 64406c41d..cda11f56b 100644
--- a/libc/sysdeps/powerpc/fpu/ftestexcept.c
+++ b/libc/sysdeps/powerpc/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 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
@@ -31,3 +31,4 @@ fetestexcept (int excepts)
just: */
return u.l[1] & excepts;
}
+libm_hidden_def (fetestexcept)
diff --git a/libc/sysdeps/powerpc/powerpc32/rtld-memset.c b/libc/sysdeps/powerpc/powerpc32/rtld-memset.c
new file mode 100644
index 000000000..f3ed8ad1e
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc32/rtld-memset.c
@@ -0,0 +1,4 @@
+/* PPCA2 has a different cache-line size than the usual 128 bytes. To avoid
+ using code that assumes cache-line size to be 128 bytes (with dcbz
+ instructions) we use the generic code instead. */
+#include <string/memset.c>
diff --git a/libc/sysdeps/powerpc/powerpc64/rtld-memset.c b/libc/sysdeps/powerpc/powerpc64/rtld-memset.c
new file mode 100644
index 000000000..f3ed8ad1e
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc64/rtld-memset.c
@@ -0,0 +1,4 @@
+/* PPCA2 has a different cache-line size than the usual 128 bytes. To avoid
+ using code that assumes cache-line size to be 128 bytes (with dcbz
+ instructions) we use the generic code instead. */
+#include <string/memset.c>
diff --git a/libc/sysdeps/s390/fpu/feupdateenv.c b/libc/sysdeps/s390/fpu/feupdateenv.c
index 64411e880..80f9687d7 100644
--- a/libc/sysdeps/s390/fpu/feupdateenv.c
+++ b/libc/sysdeps/s390/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
@@ -38,3 +38,4 @@ feupdateenv (const fenv_t *envp)
/* Success. */
return 0;
}
+libm_hidden_def (feupdateenv)
diff --git a/libc/sysdeps/s390/fpu/ftestexcept.c b/libc/sysdeps/s390/fpu/ftestexcept.c
index 51af57e90..50d5afe3e 100644
--- a/libc/sysdeps/s390/fpu/ftestexcept.c
+++ b/libc/sysdeps/s390/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
@@ -31,3 +31,4 @@ fetestexcept (int excepts)
temp = (temp >> FPC_DXC_SHIFT) | (temp >> FPC_FLAGS_SHIFT);
return temp & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
diff --git a/libc/sysdeps/s390/s390-32/__longjmp.c b/libc/sysdeps/s390/s390-32/__longjmp.c
index 4abc0ec81..95f8b7101 100644
--- a/libc/sysdeps/s390/s390-32/__longjmp.c
+++ b/libc/sysdeps/s390/s390-32/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2005, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2005, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
@@ -29,16 +29,19 @@
void
__longjmp (__jmp_buf env, int val)
{
- register int r2 __asm ("%r2") = val == 0 ? 1 : val;
#ifdef PTR_DEMANGLE
- register uintptr_t r3 __asm ("%r3") = THREAD_GET_POINTER_GUARD ();
- register void *r1 __asm ("%r1") = (void *) env;
+ uintptr_t guard = THREAD_GET_POINTER_GUARD ();
# ifdef CHECK_SP
- CHECK_SP (env, r3);
+ CHECK_SP (env, guard);
# endif
#elif defined CHECK_SP
CHECK_SP (env, 0);
#endif
+ register int r2 __asm ("%r2") = val == 0 ? 1 : val;
+#ifdef PTR_DEMANGLE
+ register uintptr_t r3 __asm ("%r3") = guard;
+ register void *r1 __asm ("%r1") = (void *) env;
+#endif
/* Restore registers and jump back. */
asm volatile ("ld %%f6,48(%1)\n\t"
"ld %%f4,40(%1)\n\t"
diff --git a/libc/sysdeps/s390/s390-32/elf/start.S b/libc/sysdeps/s390/s390-32/elf/start.S
index 066f7f0aa..8e48abbcc 100644
--- a/libc/sysdeps/s390/s390-32/elf/start.S
+++ b/libc/sysdeps/s390/s390-32/elf/start.S
@@ -108,7 +108,7 @@ _start:
jne .L20
cl %r8,4(%r4) /* p_offset == 0? */
jne .L20
- l %r9,8(%r4) /* r9 = p_vaddr <- ELF header address */
+ l %r9,8(%r4) /* r9 = PT_LOAD.p_vaddr <- ELF header address */
j .L24
.L20: alr %r4,%r0 /* r4 += AT_PHENT value */
brct %r12,.L19
@@ -124,16 +124,12 @@ _start:
.L22: alr %r4,%r0 /* r4 += AT_PHENT value */
brct %r12,.L23
- ltr %r9,%r9 /* Load address == 0? */
- jz .L14 /* No checking for PIE without PT_PHDR. */
- j .L21
+ j .L14 /* No PT_PHDR found - skip checking. */
-.L25: clr %r3,%r11 /* PT_PHDR p_vaddr == AT_PHDR? */
- je .L21
- lr %r9,%r11
- slr %r9,%r3 /* elf_header_addr = AT_PHDR - PT_PHDR.p_vaddr */
+.L25: slr %r11,%r3 /* AT_PHDR - PT_PHDR.p_vaddr (relocation offset)*/
+ alr %r9,%r11 /* PT_LOAD.p_vaddr += relocation offset */
-.L21: l %r5,36(%r9) /* Load the e_flags field. */
+ l %r5,36(%r9) /* Load the e_flags field. */
tml %r5,1
jz .L14 /* Binary does not require highgprs facility. */
diff --git a/libc/sysdeps/s390/s390-64/__longjmp.c b/libc/sysdeps/s390/s390-64/__longjmp.c
index 445bd3baf..313b33854 100644
--- a/libc/sysdeps/s390/s390-64/__longjmp.c
+++ b/libc/sysdeps/s390/s390-64/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2005, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2005, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
@@ -29,16 +29,19 @@
void
__longjmp (__jmp_buf env, int val)
{
- register long int r2 __asm ("%r2") = val == 0 ? 1 : val;
#ifdef PTR_DEMANGLE
- register uintptr_t r3 __asm ("%r3") = THREAD_GET_POINTER_GUARD ();
- register void *r1 __asm ("%r1") = (void *) env;
+ uintptr_t guard = THREAD_GET_POINTER_GUARD ();
# ifdef CHECK_SP
- CHECK_SP (env, r3);
+ CHECK_SP (env, guard);
# endif
#elif defined CHECK_SP
CHECK_SP (env, 0);
#endif
+ register long int r2 __asm ("%r2") = val == 0 ? 1 : val;
+#ifdef PTR_DEMANGLE
+ register uintptr_t r3 __asm ("%r3") = guard;
+ register void *r1 __asm ("%r1") = (void *) env;
+#endif
/* Restore registers and jump back. */
asm volatile ("ld %%f7,104(%1)\n\t"
"ld %%f5,96(%1)\n\t"
diff --git a/libc/sysdeps/sh/sh4/fpu/fpu_control.h b/libc/sysdeps/sh/sh4/fpu/fpu_control.h
index ff26c9722..ae5007051 100644
--- a/libc/sysdeps/sh/sh4/fpu/fpu_control.h
+++ b/libc/sysdeps/sh/sh4/fpu/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word definitions. SH version.
- Copyright (C) 1999, 2000, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 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
@@ -20,6 +20,8 @@
#ifndef _FPU_CONTROL_H
#define _FPU_CONTROL_H
+#include <features.h>
+
/* masking of interrupts */
#define _FPU_MASK_VM 0x0800 /* Invalid operation */
#define _FPU_MASK_ZM 0x0400 /* Division by zero */
@@ -45,14 +47,10 @@ typedef unsigned int fpu_control_t;
#define _FPU_GETCW(cw) __asm__ ("sts fpscr,%0" : "=r" (cw))
#if defined __GNUC__
-#ifdef __cplusplus
-extern "C" {
-#endif
+__BEGIN_DECLS
+
/* GCC provides this function. */
extern void __set_fpscr (unsigned long);
-#ifdef __cplusplus
-}
-#endif /* C++ */
#define _FPU_SETCW(cw) __set_fpscr ((cw))
#else
#define _FPU_SETCW(cw) __asm__ ("lds %0,fpscr" : : "r" (cw))
@@ -61,4 +59,5 @@ extern void __set_fpscr (unsigned long);
/* Default control word set at startup. */
extern fpu_control_t __fpu_control;
+__END_DECLS
#endif /* _FPU_CONTROL_H */
diff --git a/libc/sysdeps/sh/sh4/fpu/ftestexcept.c b/libc/sysdeps/sh/sh4/fpu/ftestexcept.c
index 17a2ccfc8..a15868b02 100644
--- a/libc/sysdeps/sh/sh4/fpu/ftestexcept.c
+++ b/libc/sysdeps/sh/sh4/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 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
@@ -30,3 +30,4 @@ fetestexcept (int excepts)
return temp & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
diff --git a/libc/sysdeps/sparc/fpu/feupdateenv.c b/libc/sysdeps/sparc/fpu/feupdateenv.c
index b2615379b..008c379a1 100644
--- a/libc/sysdeps/sparc/fpu/feupdateenv.c
+++ b/libc/sysdeps/sparc/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 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
@@ -46,4 +46,5 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/libc/sysdeps/sparc/fpu/ftestexcept.c b/libc/sysdeps/sparc/fpu/ftestexcept.c
index abfaa3299..e77f513b1 100644
--- a/libc/sysdeps/sparc/fpu/ftestexcept.c
+++ b/libc/sysdeps/sparc/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 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
@@ -28,3 +28,4 @@ fetestexcept (int excepts)
return tmp & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
diff --git a/libc/sysdeps/unix/sysv/linux/check_pf.c b/libc/sysdeps/unix/sysv/linux/check_pf.c
index e69434299..b789a32ea 100644
--- a/libc/sysdeps/unix/sysv/linux/check_pf.c
+++ b/libc/sysdeps/unix/sysv/linux/check_pf.c
@@ -1,5 +1,5 @@
/* Determine protocol families for which interfaces exist. Linux version.
- Copyright (C) 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2007, 2008, 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
@@ -304,10 +304,13 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6,
struct ifaddrs *runp;
for (runp = ifa; runp != NULL; runp = runp->ifa_next)
- if (runp->ifa_addr->sa_family == PF_INET)
- *seen_ipv4 = true;
- else if (runp->ifa_addr->sa_family == PF_INET6)
- *seen_ipv6 = true;
+ if (runp->ifa_addr != NULL)
+ {
+ if (runp->ifa_addr->sa_family == PF_INET)
+ *seen_ipv4 = true;
+ else if (runp->ifa_addr->sa_family == PF_INET6)
+ *seen_ipv6 = true;
+ }
(void) freeifaddrs (ifa);
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/getdents.c b/libc/sysdeps/unix/sysv/linux/getdents.c
index b33d1789a..0aa918677 100644
--- a/libc/sysdeps/unix/sysv/linux/getdents.c
+++ b/libc/sysdeps/unix/sysv/linux/getdents.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995-2003, 2004, 2006, 2007
+/* Copyright (C) 1993, 1995-2004, 2006, 2007, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -285,7 +285,11 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
DIRENT_SET_DP_INO(dp, kdp->d_ino);
dp->d_off = kdp->d_off;
dp->d_reclen = new_reclen;
+#ifdef __ASSUME_GETDENTS32_D_TYPE
+ dp->d_type = *((char *) kdp + kdp->d_reclen - 1);
+#else
dp->d_type = DT_UNKNOWN;
+#endif
memcpy (dp->d_name, kdp->d_name,
kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
diff --git a/libc/sysdeps/unix/sysv/linux/internal_statvfs.c b/libc/sysdeps/unix/sysv/linux/internal_statvfs.c
index 0169ae341..828854806 100644
--- a/libc/sysdeps/unix/sysv/linux/internal_statvfs.c
+++ b/libc/sysdeps/unix/sysv/linux/internal_statvfs.c
@@ -109,6 +109,12 @@ __statvfs_getflags (const char *name, int fstype, struct stat64 *st)
case LOGFS_MAGIC_U32:
fsname = "logfs";
break;
+ case BTRFS_SUPER_MAGIC:
+ fsname = "btrfs";
+ break;
+ case CGROUP_SUPER_MAGIC:
+ fsname = "cgroup";
+ break;
}
FILE *mtab = __setmntent ("/proc/mounts", "r");
@@ -228,7 +234,8 @@ INTERNAL_STATVFS (const char *name, struct STATVFS *buf,
buf->f_files = fsbuf->f_files;
buf->f_ffree = fsbuf->f_ffree;
if (sizeof (buf->f_fsid) == sizeof (fsbuf->f_fsid))
- buf->f_fsid = (fsbuf->f_fsid.__val[0]
+ buf->f_fsid = ((fsbuf->f_fsid.__val[0]
+ & ((1UL << (8 * sizeof (fsbuf->f_fsid.__val[0]))) - 1))
| ((unsigned long int) fsbuf->f_fsid.__val[1]
<< (8 * (sizeof (buf->f_fsid)
- sizeof (fsbuf->f_fsid.__val[0])))));
diff --git a/libc/sysdeps/unix/sysv/linux/linux_fsinfo.h b/libc/sysdeps/unix/sysv/linux/linux_fsinfo.h
index b10e98b46..a0e070071 100644
--- a/libc/sysdeps/unix/sysv/linux/linux_fsinfo.h
+++ b/libc/sysdeps/unix/sysv/linux/linux_fsinfo.h
@@ -23,7 +23,7 @@
/* These definitions come from the kernel headers. But we cannot
include the headers here because of type clashes. If new
filesystem types will become available we have to add the
- appropriate definitions here.*/
+ appropriate definitions here. */
/* Constant that identifies the `adfs' filesystem. */
#define ADFS_SUPER_MAGIC 0xadf5
@@ -35,7 +35,13 @@
#define AUTOFS_SUPER_MAGIC 0x187
/* Constant that identifies the `bfs' filesystem. */
-#define BFS_MAGIC 0x1BADFACE
+#define BFS_MAGIC 0x1badface
+
+/* Constant that identifies the `btrfs' filesystem. */
+#define BTRFS_SUPER_MAGIC 0x9123683e
+
+/* Constant that identifies the `cgroup' filesystem. */
+#define CGROUP_SUPER_MAGIC 0x27e0eb
/* Constant that identifies the `coda' filesystem. */
#define CODA_SUPER_MAGIC 0x73757245
@@ -53,7 +59,7 @@
#define DEVPTS_SUPER_MAGIC 0x1cd1
/* Constants that identifies the `efs' filesystem. */
-#define EFS_SUPER_MAGIC 0x414A53
+#define EFS_SUPER_MAGIC 0x414a53
#define EFS_MAGIC 0x072959
/* Constant that identifies the `ext2' and `ext3' filesystems. */
@@ -74,7 +80,7 @@
/* Constant that identifies the `jfs' filesystem. */
#define JFS_SUPER_MAGIC 0x3153464a
-/* Constant that identifies the `logfs´ filesystem. */
+/* Constant that identifies the `logfs' filesystem. */
#define LOGFS_MAGIC_U32 0xc97e8168u
/* Constants that identify the `minix2' filesystem. */
@@ -118,7 +124,7 @@
/* Constant that identifies the `smb' filesystem. */
#define SMB_SUPER_MAGIC 0x517b
-/* Constant that identifies the `sysfs´ filesystem. */
+/* Constant that identifies the `sysfs' filesystem. */
#define SYSFS_MAGIC 0x62656572
/* Constants that identify the `sysV' filesystem. */
diff --git a/libc/sysdeps/unix/sysv/linux/pathconf.c b/libc/sysdeps/unix/sysv/linux/pathconf.c
index db03529fe..ae597fb5b 100644
--- a/libc/sysdeps/unix/sysv/linux/pathconf.c
+++ b/libc/sysdeps/unix/sysv/linux/pathconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux version.
- Copyright (C) 1991,1995,1996,1998-2003,2008 Free Software Foundation, Inc.
+ Copyright (C) 1991,1995,1996,1998-2003,2008,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
@@ -126,6 +126,9 @@ __statfs_filesize_max (int result, const struct statfs *fsbuf)
switch (fsbuf->f_type)
{
+ case BTRFS_SUPER_MAGIC:
+ return 255;
+
case EXT2_SUPER_MAGIC:
case UFS_MAGIC:
case UFS_CIGAM:
@@ -136,6 +139,7 @@ __statfs_filesize_max (int result, const struct statfs *fsbuf)
case UDF_SUPER_MAGIC:
case JFS_SUPER_MAGIC:
case VXFS_SUPER_MAGIC:
+ case CGROUP_SUPER_MAGIC:
return 64;
case MSDOS_SUPER_MAGIC:
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list b/libc/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
index d3a05d2d2..e946d332d 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
@@ -5,3 +5,4 @@ oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
vfork - vfork 0 __vfork vfork
prlimit64 EXTRA prlimit64 i:iipp prlimit64
+fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
index 8b1d6829b..3d7018547 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
@@ -6,3 +6,4 @@ getresuid - getresuid32 3 getresuid
getresgid - getresgid32 3 getresgid
prlimit64 EXTRA prlimit64 i:iipp prlimit64
+fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
index 5e11540fd..da35115b9 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2004,2005,2006,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
@@ -49,9 +49,9 @@ longjmp_msg:
.text
ENTRY(____longjmp_chk)
/* Restore registers. */
- movq (JB_RSP*8)(%rdi),%r8
- movq (JB_RBP*8)(%rdi),%r9
- movq (JB_PC*8)(%rdi),%rdx
+ movq (JB_RSP*8)(%rdi), %r8
+ movq (JB_RBP*8)(%rdi), %r9
+ movq (JB_PC*8)(%rdi), %rdx
#ifdef PTR_DEMANGLE
PTR_DEMANGLE (%r8)
PTR_DEMANGLE (%r9)
@@ -63,7 +63,9 @@ ENTRY(____longjmp_chk)
/* Save function parameters. */
movq %rdi, %r10
- movl %esi, %ecx
+ cfi_register (%rdi, %r10)
+ movl %esi, %ebx
+ cfi_register (%rsi, %rbx)
xorl %edi, %edi
leaq -24(%rsp), %rsi
@@ -84,7 +86,9 @@ ENTRY(____longjmp_chk)
.Lfail: CALL_FAIL
.Lok2: movq %r10, %rdi
- movl %ecx, %esi
+ cfi_restore (%rdi)
+ movl %ebx, %esi
+ cfi_restore (%rsi)
.Lok: /* We add unwind information for the target here. */
cfi_def_cfa(%rdi, 0)
@@ -96,11 +100,11 @@ ENTRY(____longjmp_chk)
cfi_offset(%r13,JB_R13*8)
cfi_offset(%r14,JB_R14*8)
cfi_offset(%r15,JB_R15*8)
- movq (JB_RBX*8)(%rdi),%rbx
- movq (JB_R12*8)(%rdi),%r12
- movq (JB_R13*8)(%rdi),%r13
- movq (JB_R14*8)(%rdi),%r14
- movq (JB_R15*8)(%rdi),%r15
+ movq (JB_RBX*8)(%rdi), %rbx
+ movq (JB_R12*8)(%rdi), %r12
+ movq (JB_R13*8)(%rdi), %r13
+ movq (JB_R14*8)(%rdi), %r14
+ movq (JB_R15*8)(%rdi), %r15
/* Set return value for setjmp. */
movl %esi, %eax
movq %r8,%rsp
diff --git a/libc/sysdeps/x86_64/fpu/feupdateenv.c b/libc/sysdeps/x86_64/fpu/feupdateenv.c
index e23f1affa..291c56bd1 100644
--- a/libc/sysdeps/x86_64/fpu/feupdateenv.c
+++ b/libc/sysdeps/x86_64/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997,99,2000,01,07 Free Software Foundation, Inc.
+ Copyright (C) 1997,99,2000,01,07,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -48,4 +48,5 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/libc/sysdeps/x86_64/fpu/ftestexcept.c b/libc/sysdeps/x86_64/fpu/ftestexcept.c
index 091c25157..f3b54ad80 100644
--- a/libc/sysdeps/x86_64/fpu/ftestexcept.c
+++ b/libc/sysdeps/x86_64/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 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
@@ -31,3 +31,4 @@ fetestexcept (int excepts)
return (temp | mxscr) & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
diff --git a/libc/sysdeps/x86_64/multiarch/s_fmaf.c b/libc/sysdeps/x86_64/multiarch/s_fmaf.c
index de1c4b6f4..85ef65a50 100644
--- a/libc/sysdeps/x86_64/multiarch/s_fmaf.c
+++ b/libc/sysdeps/x86_64/multiarch/s_fmaf.c
@@ -1,5 +1,5 @@
/* FMA version of fmaf.
- 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
@@ -39,4 +39,4 @@ weak_alias (__fmaf, fmaf)
# define __fmaf __fmaf_sse2
#endif
-#include <math/s_fmaf.c>
+#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
diff --git a/libc/sysdeps/x86_64/strcmp.S b/libc/sysdeps/x86_64/strcmp.S
index aeb8895be..165073e90 100644
--- a/libc/sysdeps/x86_64/strcmp.S
+++ b/libc/sysdeps/x86_64/strcmp.S
@@ -458,7 +458,7 @@ LABEL(nibble_ashr_1):
jnz LABEL(ashr_1_exittail) /* find null char*/
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $14, %r11
+ cmp $15, %r11
jbe LABEL(ashr_1_exittail)
# endif
@@ -586,7 +586,7 @@ LABEL(nibble_ashr_2):
jnz LABEL(ashr_2_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $13, %r11
+ cmp $14, %r11
jbe LABEL(ashr_2_exittail)
# endif
@@ -711,7 +711,7 @@ LABEL(nibble_ashr_3):
jnz LABEL(ashr_3_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $12, %r11
+ cmp $13, %r11
jbe LABEL(ashr_3_exittail)
# endif
@@ -836,7 +836,7 @@ LABEL(nibble_ashr_4):
jnz LABEL(ashr_4_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $11, %r11
+ cmp $12, %r11
jbe LABEL(ashr_4_exittail)
# endif
@@ -913,7 +913,7 @@ LABEL(gobble_ashr_5):
sub $0xffff, %edx
jnz LABEL(exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRCASECMP_L
+# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
sub $16, %r11
jbe LABEL(strcmp_exitz)
# endif
@@ -961,7 +961,7 @@ LABEL(nibble_ashr_5):
jnz LABEL(ashr_5_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $10, %r11
+ cmp $11, %r11
jbe LABEL(ashr_5_exittail)
# endif
@@ -1086,7 +1086,7 @@ LABEL(nibble_ashr_6):
jnz LABEL(ashr_6_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $9, %r11
+ cmp $10, %r11
jbe LABEL(ashr_6_exittail)
# endif
@@ -1211,7 +1211,7 @@ LABEL(nibble_ashr_7):
jnz LABEL(ashr_7_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $8, %r11
+ cmp $9, %r11
jbe LABEL(ashr_7_exittail)
# endif
@@ -1336,7 +1336,7 @@ LABEL(nibble_ashr_8):
jnz LABEL(ashr_8_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $7, %r11
+ cmp $8, %r11
jbe LABEL(ashr_8_exittail)
# endif
@@ -1461,7 +1461,7 @@ LABEL(nibble_ashr_9):
jnz LABEL(ashr_9_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $6, %r11
+ cmp $7, %r11
jbe LABEL(ashr_9_exittail)
# endif
@@ -1586,7 +1586,7 @@ LABEL(nibble_ashr_10):
jnz LABEL(ashr_10_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $5, %r11
+ cmp $6, %r11
jbe LABEL(ashr_10_exittail)
# endif
@@ -1711,7 +1711,7 @@ LABEL(nibble_ashr_11):
jnz LABEL(ashr_11_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $4, %r11
+ cmp $5, %r11
jbe LABEL(ashr_11_exittail)
# endif
@@ -1836,7 +1836,7 @@ LABEL(nibble_ashr_12):
jnz LABEL(ashr_12_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $3, %r11
+ cmp $4, %r11
jbe LABEL(ashr_12_exittail)
# endif
@@ -1961,7 +1961,7 @@ LABEL(nibble_ashr_13):
jnz LABEL(ashr_13_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $2, %r11
+ cmp $3, %r11
jbe LABEL(ashr_13_exittail)
# endif
@@ -2086,7 +2086,7 @@ LABEL(nibble_ashr_14):
jnz LABEL(ashr_14_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp $1, %r11
+ cmp $2, %r11
jbe LABEL(ashr_14_exittail)
# endif
@@ -2213,8 +2213,8 @@ LABEL(nibble_ashr_15):
jnz LABEL(ashr_15_exittail)
# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- test %r11, %r11
- je LABEL(ashr_15_exittail)
+ cmpq $1, %r11
+ jbe LABEL(ashr_15_exittail)
# endif
pxor %xmm0, %xmm0
diff --git a/libc/wcsmbs/wcsatcliff.c b/libc/wcsmbs/wcsatcliff.c
index b29571f29..95afff609 100644
--- a/libc/wcsmbs/wcsatcliff.c
+++ b/libc/wcsmbs/wcsatcliff.c
@@ -16,6 +16,8 @@
#define MEMCPY wmemcpy
#define MEMPCPY wmempcpy
#define MEMCHR wmemchr
+#define STRCMP wcscmp
+#define STRNCMP wcsncmp
#include "../string/stratcliff.c"
diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha
index 769be8bdc..d2030d663 100644
--- a/ports/ChangeLog.alpha
+++ b/ports/ChangeLog.alpha
@@ -1,3 +1,28 @@
+2010-09-26 Michael Cree <mcree@orcon.net.nz>
+
+ * sysdeps/alpha/memchr.c: Include <bp-sym.h>
+ (__memchr): Add casts for integer arithmetic on pointers.
+
+2010-09-23 Richard Henderson <rth@redhat.com>
+
+ [BZ #12019]
+ * sysdeps/alpha/alphaev6/memchr.S: Remove.
+ * sysdeps/alpha/memchr.S: Remove.
+ * sysdeps/alpha/memchr.c: New.
+
+2010-09-23 Richard Henderson <rth@redhat.com>
+
+ [BZ #1864]
+ * sysdeps/unix/sysv/linux/alpha/fstatfs64.c: New.
+ * sysdeps/unix/sysv/linux/alpha/fstatvfs.c: New.
+ * sysdeps/unix/sysv/linux/alpha/fstatvfs64.c: New.
+ * sysdeps/unix/sysv/linux/alpha/internal_statvfs64.c: New.
+ * sysdeps/unix/sysv/linux/alpha/statfs64.c: New.
+ * sysdeps/unix/sysv/linux/alpha/statvfs.c: New.
+ * sysdeps/unix/sysv/linux/alpha/statvfs64.c: New.
+ * sysdeps/unix/sysv/linux/alpha/syscalls.list (fstatfs, statfs):
+ Define without 64-bit aliases.
+
2010-05-03 Aurelien Jarno <aurelien@aurel32.net>
* sysdeps/alpha/memchr.S: Use prefetch load.
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index ef2a608c9..02affa8ce 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,3 +1,16 @@
+2010-10-11 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/arm/eabi/feupdateenv.c (feupdateenv): Add
+ libm_hidden_ver.
+ * sysdeps/arm/eabi/ftestexcept.c (fetestexcept): Add
+ libm_hidden_def.
+ * sysdeps/arm/fpu/ftestexcept.c (fetestexcept): Likewise.
+
+2010-09-30 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/syscalls.list: Add entry for
+ fanotify_mark syscall.
+
2010-08-13 Alexander Kanevskiy <kad@kad.name>
* sysdeps/unix/sysv/linux/arm/dl-procinfo.c (_dl_arm_cap_flags):
diff --git a/ports/ChangeLog.eglibc b/ports/ChangeLog.eglibc
index 00e73ab73..346fa1d1c 100644
--- a/ports/ChangeLog.eglibc
+++ b/ports/ChangeLog.eglibc
@@ -1,3 +1,10 @@
+2010-10-12 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/powerpc/powerpc32/e500/fpu/feupdateenv.c (feupdateenv):
+ Add libm_hidden_ver.
+ * sysdeps/powerpc/powerpc32/e500/fpu/ftestexcept.c (fetestexcept):
+ Add libm_hidden_def.
+
2010-08-12 Maxim Kuvyrkov <maxim@codesourcery.com>
* sysdeps/unix/sysv/linux/m68k/kernel-features.h (MMAP2_PAGE_SHIFT):
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
index e66559a85..2bf5a3752 100644
--- a/ports/ChangeLog.m68k
+++ b/ports/ChangeLog.m68k
@@ -1,3 +1,12 @@
+2010-10-11 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Remove fma inlines.
+
+ * sysdeps/m68k/fpu/feupdateenv.c (feupdateenv): Add
+ libm_hidden_ver.
+ * sysdeps/m68k/fpu/ftestexcept.c (feupdateenv): Add
+ libm_hidden_def.
+
2010-08-25 Andreas Schwab <schwab@linux-m68k.org>
* sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h
diff --git a/ports/ChangeLog.mips b/ports/ChangeLog.mips
index 3d0b975b7..8daa71c15 100644
--- a/ports/ChangeLog.mips
+++ b/ports/ChangeLog.mips
@@ -1,3 +1,9 @@
+2010-10-11 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/mips/fpu/feupdateenv.c (feupdateenv): Add
+ libm_hidden_def.
+ * sysdeps/mips/fpu/ftestexcept.c (fetestexcept): Likewise.
+
2010-08-13 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/kernel-features.h
diff --git a/ports/ChangeLog.powerpc b/ports/ChangeLog.powerpc
index 390c774d2..d8989b0b3 100644
--- a/ports/ChangeLog.powerpc
+++ b/ports/ChangeLog.powerpc
@@ -1,3 +1,10 @@
+2010-10-11 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/powerpc/nofpu/feupdateenv.c (feupdateenv): Add
+ libm_hidden_ver.
+ * sysdeps/powerpc/nofpu/ftestexcept.c (fetestexcept): Add
+ libm_hidden_def.
+
2010-02-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/powerpc/nofpu/fegetenv.c: Add hidden alias.
diff --git a/ports/sysdeps/alpha/alphaev6/memchr.S b/ports/sysdeps/alpha/alphaev6/memchr.S
deleted file mode 100644
index fe77cd897..000000000
--- a/ports/sysdeps/alpha/alphaev6/memchr.S
+++ /dev/null
@@ -1,193 +0,0 @@
-/* Copyright (C) 2000, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Mosberger (davidm@cs.arizona.edu).
- EV6 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <sysdep.h>
-
- .arch ev6
- .set noreorder
- .set noat
-
-ENTRY(__memchr)
-#ifdef PROF
- ldgp gp, 0(pv)
- lda AT, _mcount
- jsr AT, (AT), _mcount
- .prologue 1
-#else
- .prologue 0
-#endif
-
- # Hack -- if someone passes in (size_t)-1, hoping to just
- # search til the end of the address space, we will overflow
- # below when we find the address of the last byte. Given
- # that we will never have a 56-bit address space, cropping
- # the length is the easiest way to avoid trouble.
- zap $18, 0x80, $5 # U : Bound length
- beq $18, $not_found # U :
- ldq_u $1, 0($16) # L : load first quadword Latency=3
- and $17, 0xff, $17 # E : L L U U : 00000000000000ch
-
- insbl $17, 1, $2 # U : 000000000000ch00
- cmpult $18, 9, $4 # E : small (< 1 quad) string?
- or $2, $17, $17 # E : 000000000000chch
- lda $3, -1($31) # E : U L L U
-
- sll $17, 16, $2 # U : 00000000chch0000
- addq $16, $5, $5 # E : Max search address
- or $2, $17, $17 # E : 00000000chchchch
- sll $17, 32, $2 # U : U L L U : chchchch00000000
-
- or $2, $17, $17 # E : chchchchchchchch
- extql $1, $16, $7 # U : $7 is upper bits
- beq $4, $first_quad # U :
- ldq_u $6, -1($5) # L : L U U L : eight or less bytes to search Latency=3
-
- extqh $6, $16, $6 # U : 2 cycle stall for $6
- mov $16, $0 # E :
- nop # E :
- or $7, $6, $1 # E : L U L U $1 = quadword starting at $16
-
- # Deal with the case where at most 8 bytes remain to be searched
- # in $1. E.g.:
- # $18 = 6
- # $1 = ????c6c5c4c3c2c1
-$last_quad:
- negq $18, $6 # E :
- xor $17, $1, $1 # E :
- srl $3, $6, $6 # U : $6 = mask of $18 bits set
- cmpbge $31, $1, $2 # E : L U L U
-
- nop
- nop
- and $2, $6, $2 # E :
- beq $2, $not_found # U : U L U L
-
-$found_it:
-#if defined(__alpha_fix__) && defined(__alpha_cix__)
- /*
- * Since we are guaranteed to have set one of the bits, we don't
- * have to worry about coming back with a 0x40 out of cttz...
- */
- cttz $2, $3 # U0 :
- addq $0, $3, $0 # E : All done
- nop # E :
- ret # L0 : L U L U
-#else
- /*
- * Slow and clunky. It can probably be improved.
- * An exercise left for others.
- */
- negq $2, $3 # E :
- and $2, $3, $2 # E :
- and $2, 0x0f, $1 # E :
- addq $0, 4, $3 # E :
-
- cmoveq $1, $3, $0 # E : Latency 2, extra map cycle
- nop # E : keep with cmov
- and $2, 0x33, $1 # E :
- addq $0, 2, $3 # E : U L U L : 2 cycle stall on $0
-
- cmoveq $1, $3, $0 # E : Latency 2, extra map cycle
- nop # E : keep with cmov
- and $2, 0x55, $1 # E :
- addq $0, 1, $3 # E : U L U L : 2 cycle stall on $0
-
- cmoveq $1, $3, $0 # E : Latency 2, extra map cycle
- nop
- nop
- ret # L0 : L U L U
-#endif
-
- # Deal with the case where $18 > 8 bytes remain to be
- # searched. $16 may not be aligned.
- .align 4
-$first_quad:
- andnot $16, 0x7, $0 # E :
- insqh $3, $16, $2 # U : $2 = 0000ffffffffffff ($16<0:2> ff)
- xor $1, $17, $1 # E :
- or $1, $2, $1 # E : U L U L $1 = ====ffffffffffff
-
- cmpbge $31, $1, $2 # E :
- bne $2, $found_it # U :
- # At least one byte left to process.
- ldq $31, 8($0) # L :
- subq $5, 1, $18 # E : U L U L
-
- addq $0, 8, $0 # E :
- # Make $18 point to last quad to be accessed (the
- # last quad may or may not be partial).
- andnot $18, 0x7, $18 # E :
- cmpult $0, $18, $2 # E :
- beq $2, $final # U : U L U L
-
- # At least two quads remain to be accessed.
-
- subq $18, $0, $4 # E : $4 <- nr quads to be processed
- and $4, 8, $4 # E : odd number of quads?
- bne $4, $odd_quad_count # U :
- # At least three quads remain to be accessed
- nop # E : L U L U : move prefetched value to correct reg
-
- .align 4
-$unrolled_loop:
- ldq $1, 0($0) # L : load quad
- xor $17, $1, $2 # E :
- ldq $31, 8($0) # L : prefetch next quad
- cmpbge $31, $2, $2 # E : U L U L
-
- bne $2, $found_it # U :
- addq $0, 8, $0 # E :
- nop # E :
- nop # E :
-
-$odd_quad_count:
- ldq $1, 0($0) # L : load quad
- xor $17, $1, $2 # E :
- ldq $31, 8($0) # L : prefetch $4
- cmpbge $31, $2, $2 # E :
-
- addq $0, 8, $6 # E :
- bne $2, $found_it # U :
- cmpult $6, $18, $6 # E :
- addq $0, 8, $0 # E :
-
- bne $6, $unrolled_loop # U :
- nop # E :
- nop # E :
- nop # E :
-
-$final: ldq $1, 0($0) # L : load last quad
- subq $5, $0, $18 # E : $18 <- number of bytes left to do
- nop # E :
- bne $18, $last_quad # U :
-
-$not_found:
- mov $31, $0 # E :
- nop # E :
- nop # E :
- ret # L0 :
-
- END(__memchr)
-
-weak_alias (__memchr, memchr)
-#if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
-#endif
-libc_hidden_builtin_def (memchr)
diff --git a/ports/sysdeps/alpha/memchr.S b/ports/sysdeps/alpha/memchr.S
deleted file mode 100644
index 87c7fb10c..000000000
--- a/ports/sysdeps/alpha/memchr.S
+++ /dev/null
@@ -1,176 +0,0 @@
-/* Copyright (C) 1996, 2000, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Mosberger (davidm@cs.arizona.edu).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* Finds characters in a memory area. Optimized for the Alpha:
-
- - memory accessed as aligned quadwords only
- - uses cmpbge to compare 8 bytes in parallel
- - does binary search to find 0 byte in last
- quadword (HAKMEM needed 12 instructions to
- do this instead of the 9 instructions that
- binary search needs).
-
-For correctness consider that:
-
- - only minimum number of quadwords may be accessed
- - the third argument is an unsigned long
-*/
-
-#include <sysdep.h>
-
- .set noreorder
- .set noat
-
-ENTRY(__memchr)
-#ifdef PROF
- ldgp gp, 0(pv)
- lda AT, _mcount
- jsr AT, (AT), _mcount
- .prologue 1
-#else
- .prologue 0
-#endif
-
- # Hack -- if someone passes in (size_t)-1, hoping to just
- # search til the end of the address space, we will overflow
- # below when we find the address of the last byte. Given
- # that we will never have a 56-bit address space, cropping
- # the length is the easiest way to avoid trouble.
- zap a2, 0x80, t4 #-e0 :
-
- beq a2, $not_found # .. e1 :
- ldq_u t0, 0(a0) # e1 : load first quadword
- insbl a1, 1, t1 # .. e0 : t1 = 000000000000ch00
- and a1, 0xff, a1 #-e0 : a1 = 00000000000000ch
- cmpult a2, 9, t3 # .. e1 :
- or t1, a1, a1 # e0 : a1 = 000000000000chch
- lda t2, -1(zero) # .. e1 :
- sll a1, 16, t1 #-e0 : t1 = 00000000chch0000
- addq a0, t4, t4 # .. e1 :
- or t1, a1, a1 # e1 : a1 = 00000000chchchch
- unop # :
- sll a1, 32, t1 #-e0 : t1 = chchchch00000000
- or t1, a1, a1 # e1 : a1 = chchchchchchchch
- extql t0, a0, t6 # e0 :
- beq t3, $first_quad # .. e1 :
-
- ldq_u t5, -1(t4) #-e1 : eight or less bytes to search
- extqh t5, a0, t5 # .. e0 :
- mov a0, v0 # e0 :
- or t6, t5, t0 # .. e1 : t0 = quadword starting at a0
-
- # Deal with the case where at most 8 bytes remain to be searched
- # in t0. E.g.:
- # a2 = 6
- # t0 = ????c6c5c4c3c2c1
-$last_quad:
- negq a2, t5 #-e0 :
- xor a1, t0, t0 # .. e1 :
- srl t2, t5, t5 # e0 : t5 = mask of a2 bits set
- cmpbge zero, t0, t1 # .. e1 :
- and t1, t5, t1 #-e0 :
- beq t1, $not_found # .. e1 :
-
-$found_it:
- # Now, determine which byte matched:
- negq t1, t2 # e0 :
- and t1, t2, t1 # e1 :
-
- and t1, 0x0f, t0 #-e0 :
- addq v0, 4, t2 # .. e1 :
- cmoveq t0, t2, v0 # e0 :
-
- addq v0, 2, t2 # .. e1 :
- and t1, 0x33, t0 #-e0 :
- cmoveq t0, t2, v0 # .. e1 :
-
- and t1, 0x55, t0 # e0 :
- addq v0, 1, t2 # .. e1 :
- cmoveq t0, t2, v0 #-e0 :
-
-$done: ret # .. e1 :
-
- # Deal with the case where a2 > 8 bytes remain to be
- # searched. a0 may not be aligned.
- .align 4
-$first_quad:
- andnot a0, 0x7, v0 #-e1 :
- insqh t2, a0, t1 # .. e0 : t1 = 0000ffffffffffff (a0<0:2> ff)
- xor t0, a1, t0 # e0 :
- or t0, t1, t0 # e1 : t0 = ====ffffffffffff
- cmpbge zero, t0, t1 #-e0 :
- bne t1, $found_it # .. e1 :
-
- # At least one byte left to process.
-
- ldq zero, 8(v0) # e0 : prefetch next quad
- subq t4, 1, a2 # .. e1 :
- addq v0, 8, v0 #-e0 :
-
- # Make a2 point to last quad to be accessed (the
- # last quad may or may not be partial).
-
- andnot a2, 0x7, a2 # .. e1 :
- cmpult v0, a2, t1 # e0 :
- beq t1, $final # .. e1 :
-
- # At least two quads remain to be accessed.
-
- subq a2, v0, t3 #-e0 : t3 <- nr quads to be processed
- and t3, 8, t3 # e1 : odd number of quads?
- bne t3, $odd_quad_count # e1 :
-
- # At least three quads remain to be accessed
-
- .align 4
-$unrolled_loop:
- ldq t0, 0(v0) # e0 : load quad
- xor a1, t0, t1 # .. e1 :
- ldq zero, 8(v0) # e0 : prefetch next quad
- cmpbge zero, t1, t1 # .. e1:
- bne t1, $found_it # e0 :
-
- addq v0, 8, v0 # e1 :
-$odd_quad_count:
- ldq t0, 0(v0) # e0 : load quad
- xor a1, t0, t1 # .. e1 :
- ldq zero, 8(v0) # e0 : prefetch next quad
- cmpbge zero, t1, t1 # .. e1 :
- addq v0, 8, t5 #-e0 :
- bne t1, $found_it # .. e1 :
-
- cmpult t5, a2, t5 # e0 :
- addq v0, 8, v0 # .. e1 :
- bne t5, $unrolled_loop #-e1 :
-
-$final: ldq t0, 0(v0) # e0 : load last quad
- subq t4, v0, a2 # .. e1 : a2 <- number of bytes left to do
- bne a2, $last_quad # e1 :
-
-$not_found:
- mov zero, v0 #-e0 :
- ret # .. e1 :
-
- END(__memchr)
-
-weak_alias (__memchr, memchr)
-#if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
-#endif
-libc_hidden_builtin_def (memchr)
diff --git a/ports/sysdeps/alpha/memchr.c b/ports/sysdeps/alpha/memchr.c
new file mode 100644
index 000000000..7e16f8a17
--- /dev/null
+++ b/ports/sysdeps/alpha/memchr.c
@@ -0,0 +1,176 @@
+/* Copyright (C) 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <string.h>
+#include <bp-sym.h>
+
+typedef unsigned long word;
+
+static inline word
+ldq_u(const void *s)
+{
+ return *(const word *)((word)s & -8);
+}
+
+#define unlikely(X) __builtin_expect ((X), 0)
+#define prefetch(X) __builtin_prefetch ((void *)(X), 0)
+
+#define cmpbeq0(X) __builtin_alpha_cmpbge(0, (X))
+#define find(X, Y) cmpbeq0 ((X) ^ (Y))
+
+/* Search no more than N bytes of S for C. */
+
+void *
+__memchr (const void *s, int xc, size_t n)
+{
+ const word *s_align;
+ word t, current, found, mask, offset;
+
+ if (unlikely (n == 0))
+ return 0;
+
+ current = ldq_u (s);
+
+ /* Replicate low byte of XC into all bytes of C. */
+ t = xc & 0xff; /* 0000000c */
+ t = (t << 8) | t; /* 000000cc */
+ t = (t << 16) | t; /* 0000cccc */
+ const word c = (t << 32) | t; /* cccccccc */
+
+ /* Align the source, and decrement the count by the number
+ of bytes searched in the first word. */
+ s_align = (const word *)((word)s & -8);
+ n += ((word)s & 7);
+
+ /* Deal with misalignment in the first word for the comparison. */
+ mask = (1ul << ((word)s & 7)) - 1;
+
+ /* If the entire string fits within one word, we may need masking
+ at both the front and the back of the string. */
+ if (unlikely (n <= 8))
+ {
+ mask |= -1ul << n;
+ goto last_quad;
+ }
+
+ found = find (current, c) & ~mask;
+ if (unlikely (found))
+ goto found_it;
+
+ s_align++;
+ n -= 8;
+
+ /* If the block is sufficiently large, align to cacheline and prefetch. */
+ if (unlikely (n >= 256))
+ {
+ /* Prefetch 3 cache lines beyond the one we're working on. */
+ prefetch (s_align + 8);
+ prefetch (s_align + 16);
+ prefetch (s_align + 24);
+
+ while ((word)s_align & 63)
+ {
+ current = *s_align;
+ found = find (current, c);
+ if (found)
+ goto found_it;
+ s_align++;
+ n -= 8;
+ }
+
+ /* Within each cacheline, advance the load for the next word
+ before the test for the previous word is complete. This
+ allows us to hide the 3 cycle L1 cache load latency. We
+ only perform this advance load within a cacheline to prevent
+ reading across page boundary. */
+#define CACHELINE_LOOP \
+ do { \
+ word i, next = s_align[0]; \
+ for (i = 0; i < 7; ++i) \
+ { \
+ current = next; \
+ next = s_align[1]; \
+ found = find (current, c); \
+ if (unlikely (found)) \
+ goto found_it; \
+ s_align++; \
+ } \
+ current = next; \
+ found = find (current, c); \
+ if (unlikely (found)) \
+ goto found_it; \
+ s_align++; \
+ n -= 64; \
+ } while (0)
+
+ /* While there's still lots more data to potentially be read,
+ continue issuing prefetches for the 4th cacheline out. */
+ while (n >= 256)
+ {
+ prefetch (s_align + 24);
+ CACHELINE_LOOP;
+ }
+
+ /* Up to 3 cache lines remaining. Continue issuing advanced
+ loads, but stop prefetching. */
+ while (n >= 64)
+ CACHELINE_LOOP;
+
+ /* We may have exhausted the buffer. */
+ if (n == 0)
+ return NULL;
+ }
+
+ /* Quadword aligned loop. */
+ current = *s_align;
+ while (n > 8)
+ {
+ found = find (current, c);
+ if (unlikely (found))
+ goto found_it;
+ current = *++s_align;
+ n -= 8;
+ }
+
+ /* The last word may need masking at the tail of the compare. */
+ mask = -1ul << n;
+ last_quad:
+ found = find (current, c) & ~mask;
+ if (found == 0)
+ return NULL;
+
+ found_it:
+#ifdef __alpha_cix__
+ offset = __builtin_alpha_cttz (found);
+#else
+ /* Extract LSB. */
+ found &= -found;
+
+ /* Binary search for the LSB. */
+ offset = (found & 0x0f ? 0 : 4);
+ offset += (found & 0x33 ? 0 : 2);
+ offset += (found & 0x55 ? 0 : 1);
+#endif
+
+ return (void *)((word)s_align + offset);
+}
+
+#ifdef weak_alias
+weak_alias (__memchr, BP_SYM (memchr))
+#endif
+libc_hidden_builtin_def (memchr)
diff --git a/ports/sysdeps/arm/eabi/feupdateenv.c b/ports/sysdeps/arm/eabi/feupdateenv.c
index 9769867ab..8c9685815 100644
--- a/ports/sysdeps/arm/eabi/feupdateenv.c
+++ b/ports/sysdeps/arm/eabi/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997, 1999, 2000, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2008, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -56,4 +56,5 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/ports/sysdeps/arm/eabi/ftestexcept.c b/ports/sysdeps/arm/eabi/ftestexcept.c
index 846bb0195..61b81cbb0 100644
--- a/ports/sysdeps/arm/eabi/ftestexcept.c
+++ b/ports/sysdeps/arm/eabi/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2005, 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
@@ -41,3 +41,4 @@ fetestexcept (int excepts)
/* Unsupported, return 0. */
return 0;
}
+libm_hidden_def (fetestexcept)
diff --git a/ports/sysdeps/arm/fpu/ftestexcept.c b/ports/sysdeps/arm/fpu/ftestexcept.c
index 328bcb05f..c796b01ee 100644
--- a/ports/sysdeps/arm/fpu/ftestexcept.c
+++ b/ports/sysdeps/arm/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 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
@@ -30,3 +30,4 @@ fetestexcept (int excepts)
return temp & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
diff --git a/ports/sysdeps/m68k/fpu/feupdateenv.c b/ports/sysdeps/m68k/fpu/feupdateenv.c
index 2a6831387..9c0fb2119 100644
--- a/ports/sysdeps/m68k/fpu/feupdateenv.c
+++ b/ports/sysdeps/m68k/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc.
+ Copyright (C) 1997,1999-2001,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -47,4 +47,5 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/ports/sysdeps/m68k/fpu/ftestexcept.c b/ports/sysdeps/m68k/fpu/ftestexcept.c
index 3157c90d1..ce180919b 100644
--- a/ports/sysdeps/m68k/fpu/ftestexcept.c
+++ b/ports/sysdeps/m68k/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -30,3 +30,4 @@ fetestexcept (int excepts)
return fpsr & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
diff --git a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
index 8a171278b..00ae07603 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
+++ b/ports/sysdeps/m68k/m680x0/fpu/bits/mathinline.h
@@ -326,13 +326,6 @@ __m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) \
long int __result; \
__asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x)); \
return __result; \
-} \
- \
-__m81_inline float_type \
-__NTH (__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \
- float_type __z)) \
-{ \
- return (__x * __y) + __z; \
}
__inline_functions (double,)
@@ -397,8 +390,6 @@ __inline_forward_c(int,isnan, (double __value), (__value))
__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
__inline_forward_c(double,nearbyint, (double __value), (__value))
__inline_forward_c(long int,lrint, (double __value), (__value))
-__inline_forward_c(double,fma, (double __x, double __y, double __z),
- (__x, __y, __z))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
@@ -419,8 +410,6 @@ __inline_forward_c(int,isnanf, (float __value), (__value))
__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
__inline_forward_c(float,nearbyintf, (float __value), (__value))
__inline_forward_c(long int,lrintf, (float __value), (__value))
-__inline_forward_c(float,fmaf, (float __x, float __y, float __z),
- (__x, __y, __z))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx),
@@ -440,9 +429,6 @@ __inline_forward_c(long double,scalblnl, (long double __x, long int __n),
(__x, __n))
__inline_forward_c(long double,nearbyintl, (long double __value), (__value))
__inline_forward_c(long int,lrintl, (long double __value), (__value))
-__inline_forward_c(long double,fmal,
- (long double __x, long double __y, long double __z),
- (__x, __y, __z))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincosl,
diff --git a/ports/sysdeps/mips/fpu/feupdateenv.c b/ports/sysdeps/mips/fpu/feupdateenv.c
index 20b20e14c..505156262 100644
--- a/ports/sysdeps/mips/fpu/feupdateenv.c
+++ b/ports/sysdeps/mips/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1998.
@@ -41,3 +41,4 @@ feupdateenv (const fenv_t *envp)
/* Success. */
return 0;
}
+libm_hidden_def (feupdateenv)
diff --git a/ports/sysdeps/mips/fpu/ftestexcept.c b/ports/sysdeps/mips/fpu/ftestexcept.c
index 6a833f756..385554c86 100644
--- a/ports/sysdeps/mips/fpu/ftestexcept.c
+++ b/ports/sysdeps/mips/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
@@ -31,3 +31,4 @@ fetestexcept (int excepts)
return cw & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
diff --git a/ports/sysdeps/powerpc/nofpu/feupdateenv.c b/ports/sysdeps/powerpc/nofpu/feupdateenv.c
index 17af8d3ec..f15e1681c 100644
--- a/ports/sysdeps/powerpc/nofpu/feupdateenv.c
+++ b/ports/sysdeps/powerpc/nofpu/feupdateenv.c
@@ -1,6 +1,6 @@
/* Install given floating-point environment and raise exceptions
(soft-float edition).
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2010 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
@@ -49,4 +49,5 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);
diff --git a/ports/sysdeps/powerpc/nofpu/ftestexcept.c b/ports/sysdeps/powerpc/nofpu/ftestexcept.c
index ce8044fe0..ebd3b1505 100644
--- a/ports/sysdeps/powerpc/nofpu/ftestexcept.c
+++ b/ports/sysdeps/powerpc/nofpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test floating-point exceptions (soft-float edition).
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2010 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
@@ -26,3 +26,4 @@ fetestexcept (int x)
{
return __sim_exceptions & x;
}
+libm_hidden_def (fetestexcept)
diff --git a/ports/sysdeps/powerpc/powerpc32/e500/fpu/feupdateenv.c b/ports/sysdeps/powerpc/powerpc32/e500/fpu/feupdateenv.c
index db19f19fd..effe9d51f 100644
--- a/ports/sysdeps/powerpc/powerpc32/e500/fpu/feupdateenv.c
+++ b/ports/sysdeps/powerpc/powerpc32/e500/fpu/feupdateenv.c
@@ -54,4 +54,5 @@ strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);
diff --git a/ports/sysdeps/powerpc/powerpc32/e500/fpu/ftestexcept.c b/ports/sysdeps/powerpc/powerpc32/e500/fpu/ftestexcept.c
index 33546aa00..459af7bb1 100644
--- a/ports/sysdeps/powerpc/powerpc32/e500/fpu/ftestexcept.c
+++ b/ports/sysdeps/powerpc/powerpc32/e500/fpu/ftestexcept.c
@@ -30,3 +30,4 @@ fetestexcept (int excepts)
return f & excepts;
}
+libm_hidden_def (fetestexcept)
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/fstatfs64.c b/ports/sysdeps/unix/sysv/linux/alpha/fstatfs64.c
new file mode 100644
index 000000000..5639959ad
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/alpha/fstatfs64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/fstatfs64.c>
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs.c b/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs.c
new file mode 100644
index 000000000..92e772347
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/fstatvfs.c>
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs64.c b/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs64.c
new file mode 100644
index 000000000..0f1e71027
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/alpha/fstatvfs64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/fstatvfs64.c>
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/internal_statvfs64.c b/ports/sysdeps/unix/sysv/linux/alpha/internal_statvfs64.c
new file mode 100644
index 000000000..81d18f7bb
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/alpha/internal_statvfs64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/internal_statvfs64.c>
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/statfs64.c b/ports/sysdeps/unix/sysv/linux/alpha/statfs64.c
new file mode 100644
index 000000000..fe39cc468
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/alpha/statfs64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/statfs64.c>
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/statvfs.c b/ports/sysdeps/unix/sysv/linux/alpha/statvfs.c
new file mode 100644
index 000000000..78069e96f
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/alpha/statvfs.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/statvfs.c>
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/statvfs64.c b/ports/sysdeps/unix/sysv/linux/alpha/statvfs64.c
new file mode 100644
index 000000000..c80e17751
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/alpha/statvfs64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/statvfs64.c>
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/syscalls.list b/ports/sysdeps/unix/sysv/linux/alpha/syscalls.list
index de2c3ceac..412b67519 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/ports/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -53,3 +53,8 @@ osf_setitimer - osf_setitimer 3 __setitimer_tv32 setitimer@GLIBC_2.0
osf_utimes - osf_utimes 2 __utimes_tv32 utimes@GLIBC_2.0
osf_getrusage - osf_getrusage 2 __getrusage_tv32 getrusage@GLIBC_2.0
osf_wait4 - osf_wait4 2 __wait4_tv32 wait4@GLIBC_2.0
+
+# avoid 64-bit aliases on 32-bit statfs syscalls
+fstatfs - fstatfs i:ip __fstatfs fstatfs
+statfs - statfs i:sp __statfs statfs
+
diff --git a/ports/sysdeps/unix/sysv/linux/arm/syscalls.list b/ports/sysdeps/unix/sysv/linux/arm/syscalls.list
index cc75737c2..820602b79 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/syscalls.list
+++ b/ports/sysdeps/unix/sysv/linux/arm/syscalls.list
@@ -5,3 +5,5 @@ oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
prlimit64 EXTRA prlimit64 i:iipp prlimit64
+
+fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark