diff options
44 files changed, 648 insertions, 253 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog index c6d652d55..8e5956043 100644 --- a/libc/ChangeLog +++ b/libc/ChangeLog @@ -1,3 +1,76 @@ +2011-03-20 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #12597] + * string/test-strncmp.c (do_page_test): New function. + (check2): Likewise. + (test_main): Call check2. + * sysdeps/x86_64/multiarch/strcmp.S: Properly cross page boundary. + +2011-03-20 Ulrich Drepper <drepper@gmail.com> + + [BZ #12587] + * sysdeps/unix/sysv/linux/i386/sysconf.c (intel_check_word): + Handle cache information in CPU leaf 4. + * sysdeps/x86_64/cacheinfo.c (intel_check_word): Likewise. + +2011-03-18 Ulrich Drepper <drepper@gmail.com> + + [BZ #12583] + * posix/fnmatch.c (fnmatch): Check size of pattern in wide + character representation. + Partly based on a patch by Tomas Hoger <thoger@redhat.com>. + +2011-03-16 Ryan S. Arnold <rsa@us.ibm.com> + + * sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S (isnanf): Fix + END(__isnan) to END(__isnanf) to match function entry point/label + EALIGN(__isnanf,...). + +2011-03-10 Jakub Jelinek <jakub@redhat.com> + + * wcsmbs/wchar.h (wmemcmp): Remove __restrict qualifiers. + +2011-03-10 Ulrich Drepper <drepper@gmail.com> + + [BZ #12510] + * elf/dl-lookup.c (do_lookup_x): For copy relocations of unique objects + copy from the symbol referenced in the relocation to initialize the + used variable. + Patch by Piotr Bury <pbury@goahead.com>. + * elf/Makefile: Add rules to build and tst-unique3. + * include/bits/dlfcn.h: Remove _dl_mcount_wrapper_check declaration. + * elf/tst-unique3.cc: New file. + * elf/tst-unique3.h: New file. + * elf/tst-unique3lib.cc: New file. + * elf/tst-unique3lib2.cc: New file. + + * elf/Makefile: Don't run tst-execstack* tests of SELinux is enabled. + +2011-03-10 Mike Frysinger <vapier@gentoo.org> + + * sysdeps/sparc/sparc64/elf/configure.in (libc_cv_sparc64_tls): Add + $LDFLAGS and -nostdlib -nostartfiles to linking step. Change main + to _start. + +2011-03-06 Ulrich Drepper <drepper@gmail.com> + + * elf/dl-load.c (_dl_map_object): If we are looking for the first + to-be-loaded object along a path to loader is ld.so. + +2011-03-02 Harsha Jagasia <harsha.jagasia@amd.com> + Ulrich Drepper <drepper@gmail.com> + + * sysdeps/x86_64/memset.S: After aligning destination, code + branches to different locations depending on the value of + misalignment, when multiarch is enabled. Fix this. + +2011-03-02 Harsha Jagasia <harsha.jagasia@amd.com> + + * sysdeps/x86_64/cacheinfo.c (init_cacheinfo): + Set _x86_64_preferred_memory_instruction for AMD processsors. + * sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features): + Set bit_Prefer_SSE_for_memop for AMD processors. + 2011-03-04 Ulrich Drepper <drepper@gmail.com> * libio/fmemopen.c (fmemopen): Optimize a bit. @@ -12,7 +85,7 @@ 2011-02-28 Aurelien Jarno <aurelien@aurel32.net> - * sysdeps/sparc/sparc64/multiarch/memset.S(__bzero): call + * sysdeps/sparc/sparc64/multiarch/memset.S(__bzero): Call __bzero_ultra1 instead of __memset_ultra1. 2011-02-23 Andreas Schwab <schwab@redhat.com> @@ -1,4 +1,4 @@ -GNU C Library NEWS -- history of user-visible changes. 2011-2-25 +GNU C Library NEWS -- history of user-visible changes. 2011-3-21 Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc. See the end for copying conditions. @@ -9,7 +9,7 @@ Version 2.14 * The following bugs are resolved with this release: - 11724, 12445, 12454, 12460, 12469, 12489, 12509 + 11724, 12445, 12454, 12460, 12469, 12489, 12509, 12510, 12583, 12587, 12597 Version 2.13 diff --git a/libc/elf/Makefile b/libc/elf/Makefile index 4dc9f1c86..5ae389906 100644 --- a/libc/elf/Makefile +++ b/libc/elf/Makefile @@ -202,11 +202,14 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ unload3 unload4 unload5 unload6 unload7 tst-global1 order2 \ tst-audit1 tst-audit2 \ tst-stackguard1 tst-addr1 tst-thrlock \ - tst-unique1 tst-unique2 \ + tst-unique1 tst-unique2 tst-unique3 \ tst-initorder # reldep9 test-srcs = tst-pathopt +selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null) +ifneq ($(selinux-enabled),1) tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog +endif ifeq (x86_64,$(config-machine)) tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 endif @@ -256,6 +259,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ order2mod1 order2mod2 order2mod3 order2mod4 \ tst-unique1mod1 tst-unique1mod2 \ tst-unique2mod1 tst-unique2mod2 \ + tst-unique3lib tst-unique3lib2 \ tst-initordera1 tst-initorderb1 \ tst-initordera2 tst-initorderb2 \ tst-initordera3 tst-initordera4 @@ -1194,6 +1198,9 @@ $(objpfx)tst-unique1.out: $(objpfx)tst-unique1mod1.so \ $(objpfx)tst-unique2: $(libdl) $(objpfx)tst-unique2mod1.so $(objpfx)tst-unique2.out: $(objpfx)tst-unique2mod2.so +$(objpfx)tst-unique3: $(libdl) $(objpfx)tst-unique3lib.so +$(objpfx)tst-unique3.out: $(objpfx)tst-unique3lib2.so + $(objpfx)tst-initorder.out: $(objpfx)tst-initorder $(elf-objpfx)${rtld-installed-name} \ --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ diff --git a/libc/elf/dl-load.c b/libc/elf/dl-load.c index c831fec7c..4a0ae7223 100644 --- a/libc/elf/dl-load.c +++ b/libc/elf/dl-load.c @@ -2115,7 +2115,9 @@ _dl_map_object (struct link_map *loader, const char *name, { #ifdef SHARED // XXX Correct to unconditionally default to namespace 0? - l = loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded; + l = (loader + ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded + ?: &GL(dl_rtld_map)); #else l = loader; #endif diff --git a/libc/elf/dl-lookup.c b/libc/elf/dl-lookup.c index 11680a90b..79d4306c0 100644 --- a/libc/elf/dl-lookup.c +++ b/libc/elf/dl-lookup.c @@ -1,6 +1,5 @@ /* Look up a symbol in the loaded objects. - Copyright (C) 1995-2005, 2006, 2007, 2009, 2010 - Free Software Foundation, Inc. + Copyright (C) 1995-2007, 2009, 2010, 2011 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 @@ -364,8 +363,19 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash, if (entries[idx].hashval == new_hash && strcmp (entries[idx].name, undef_name) == 0) { - result->s = entries[idx].sym; - result->m = (struct link_map *) entries[idx].map; + if ((type_class & ELF_RTYPE_CLASS_COPY) != 0) + { + /* We possibly have to initialize the central + copy from the copy addressed through the + relocation. */ + result->s = sym; + result->m = (struct link_map *) map; + } + else + { + result->s = entries[idx].sym; + result->m = (struct link_map *) entries[idx].map; + } __rtld_lock_unlock_recursive (tab->lock); return 1; } diff --git a/libc/elf/tst-unique3.cc b/libc/elf/tst-unique3.cc new file mode 100644 index 000000000..b2c95939a --- /dev/null +++ b/libc/elf/tst-unique3.cc @@ -0,0 +1,23 @@ +#include "tst-unique3.h" +#include <cstdio> +#include "../dlfcn/dlfcn.h" + +int t = S<char>::i; + +int +main (void) +{ + std::printf ("%d %d\n", S<char>::i, t); + int result = S<char>::i++ != 1 || t != 1; + result |= in_lib (); + void *d = dlopen ("$ORIGIN/tst-unique3lib2.so", RTLD_LAZY); + int (*fp) (); + if (d == NULL || (fp = (int(*)()) dlsym (d, "in_lib2")) == NULL) + { + std::printf ("failed to get symbol in_lib2\n"); + return 1; + } + result |= fp (); + dlclose (d); + return result; +} diff --git a/libc/elf/tst-unique3.h b/libc/elf/tst-unique3.h new file mode 100644 index 000000000..716d23641 --- /dev/null +++ b/libc/elf/tst-unique3.h @@ -0,0 +1,8 @@ +// BZ 12510 +template<typename T> +struct S +{ + static int i; +}; + +extern int in_lib (void); diff --git a/libc/elf/tst-unique3lib.cc b/libc/elf/tst-unique3lib.cc new file mode 100644 index 000000000..fa8e85a36 --- /dev/null +++ b/libc/elf/tst-unique3lib.cc @@ -0,0 +1,11 @@ +#include <cstdio> +#include "tst-unique3.h" +template<typename T> int S<T>::i = 1; +static int i = S<char>::i; + +int +in_lib (void) +{ + std::printf ("in_lib: %d %d\n", S<char>::i, i); + return S<char>::i++ != 2 || i != 1; +} diff --git a/libc/elf/tst-unique3lib2.cc b/libc/elf/tst-unique3lib2.cc new file mode 100644 index 000000000..17d817e12 --- /dev/null +++ b/libc/elf/tst-unique3lib2.cc @@ -0,0 +1,12 @@ +#include <cstdio> +#include "tst-unique3.h" + +template<typename T> int S<T>::i; + +extern "C" +int +in_lib2 () +{ + std::printf ("in_lib2: %d\n", S<char>::i); + return S<char>::i != 3; +} diff --git a/libc/include/bits/dlfcn.h b/libc/include/bits/dlfcn.h index cb4a5c202..c31a645bc 100644 --- a/libc/include/bits/dlfcn.h +++ b/libc/include/bits/dlfcn.h @@ -1,4 +1,3 @@ #include_next <bits/dlfcn.h> -extern void _dl_mcount_wrapper_check (void *__selfpc); libc_hidden_proto (_dl_mcount_wrapper_check) diff --git a/libc/posix/fnmatch.c b/libc/posix/fnmatch.c index 3fb8e7c79..1cb1bafe9 100644 --- a/libc/posix/fnmatch.c +++ b/libc/posix/fnmatch.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007,2010 +/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007,2010,2011 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -379,6 +379,11 @@ fnmatch (pattern, string, flags) XXX Do we have to set `errno' to something which mbsrtows hasn't already done? */ return -1; + if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0)) + { + __set_errno (ENOMEM); + return -2; + } wpattern_malloc = wpattern = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t)); assert (mbsinit (&ps)); @@ -423,6 +428,12 @@ fnmatch (pattern, string, flags) XXX Do we have to set `errno' to something which mbsrtows hasn't already done? */ goto free_return; + if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0)) + { + free (wpattern_malloc); + __set_errno (ENOMEM); + return -2; + } wstring_malloc = wstring = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t)); diff --git a/libc/string/test-strncmp.c b/libc/string/test-strncmp.c index 3687879c2..00971df22 100644 --- a/libc/string/test-strncmp.c +++ b/libc/string/test-strncmp.c @@ -1,5 +1,5 @@ /* Test and measure strncmp functions. - Copyright (C) 1999, 2002, 2003, 2010 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -108,13 +108,13 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char, s2 = (char*)(buf2 + page_size); if (HP_TIMING_AVAIL) printf ("Length %4zd/%4zd:", len, n); - + FOR_EACH_IMPL (impl, 0) do_one_test (impl, s1, s2, n, 0); if (HP_TIMING_AVAIL) putchar ('\n'); - + return; } @@ -124,13 +124,13 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char, s1 = (char*)(buf1 + page_size - n); s2 = (char*)(buf2 + page_size - n); - + if (align1 < align_n) s1 -= (align_n - align1); - + if (align2 < align_n) s2 -= (align_n - align2); - + for (i = 0; i < n; i++) s1[i] = s2[i] = 1 + 23 * i % max_char; @@ -200,6 +200,27 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char, } static void +do_page_test (size_t offset1, size_t offset2, char *s2) +{ + char *s1; + int exp_result; + + if (offset1 >= page_size || offset2 >= page_size) + return; + + s1 = (char *) (buf1 + offset1); + s2 += offset2; + + exp_result= *s1; + + FOR_EACH_IMPL (impl, 0) + { + check_result (impl, s1, s2, page_size, -exp_result); + check_result (impl, s2, s1, page_size, exp_result); + } +} + +static void do_random_tests (void) { size_t i, j, n, align1, align2, pos, len1, len2, size; @@ -312,6 +333,25 @@ check1 (void) } } +static void +check2 (void) +{ + size_t i; + char *s1, *s2; + + s1 = (char *) buf1; + for (i = 0; i < page_size - 1; i++) + s1[i] = 23; + s1[i] = 0; + + s2 = strdup (s1); + + for (i = 0; i < 64; ++i) + do_page_test (3990 + i, 2635, s2); + + free (s2); +} + int test_main (void) { @@ -320,6 +360,7 @@ test_main (void) test_init (); check1 (); + check2 (); printf ("%23s", ""); FOR_EACH_IMPL (impl, 0) @@ -361,7 +402,7 @@ test_main (void) do_test (2 * i, i, 8 << i, 16 << i, 255, 0); do_test (2 * i, i, 8 << i, 16 << i, 255, 1); } - + do_test_limit (0, 0, 0, 0, 127, 0); do_test_limit (4, 0, 21, 20, 127, 0); do_test_limit (0, 4, 21, 20, 127, 0); diff --git a/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S b/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S index 12bf473a8..0f71a987d 100644 --- a/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S +++ b/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_isnanf.S @@ -1,5 +1,5 @@ /* isnanf(). PowerPC32 version. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 2011 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,8 +39,7 @@ EALIGN (__isnanf, 4, 0) L(NaN): li r3,1 /* else return 1 */ blr - END (__isnan) + END (__isnanf) hidden_def (__isnanf) weak_alias (__isnanf, isnanf) - diff --git a/libc/sysdeps/sparc/sparc64/elf/configure b/libc/sysdeps/sparc/sparc64/elf/configure index 7962ff52d..f213438aa 100644 --- a/libc/sysdeps/sparc/sparc64/elf/configure +++ b/libc/sysdeps/sparc/sparc64/elf/configure @@ -1,12 +1,61 @@ # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/sparc/sparc64/elf. -cat >>confdefs.h <<\_ACEOF +if test "$usetls" != no; then +# Check for support of thread-local storage handling in assembler and linker. +{ $as_echo "$as_me:$LINENO: checking for sparc64 TLS support" >&5 +$as_echo_n "checking for sparc64 TLS support... " >&6; } +if test "${libc_cv_sparc64_tls+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat > conftest.s <<\EOF + .section ".tdata", "awT", @progbits + .globl foo +foo: .word 1 + .section ".tbss", "awT", @nobits + .globl bar +bar: .skip 4 + .text + .globl _start +_start: sethi %tgd_hi22(foo), %l1 + add %l1, %tgd_lo10(foo), %l1 + add %l7, %l1, %o0, %tgd_add(foo) + call __tls_get_addr, %tgd_call(foo) + sethi %tldm_hi22(bar), %l1 + add %l1, %tldm_lo10(bar), %l1 + add %l7, %l1, %o0, %tldm_add(bar) + call __tls_get_addr, %tldm_call(bar) + sethi %tldo_hix22(bar), %l1 + xor %l1, %tldo_lox10(bar), %l1 + add %o0, %l1, %l1, %tldo_add(bar) + sethi %tie_hi22(foo), %l1 + add %l1, %tie_lo10(foo), %l1 + ldx [%l7 + %l1], %l1, %tie_ldx(foo) + add %g7, %l1, %l1, %tie_add(foo) + sethi %tle_hix22(foo), %l1 + xor %l1, %tle_lox10(foo), %l1 +EOF +if { ac_try='${CC-cc} -o conftest.bin $CFLAGS $LDFLAGS conftest.s -nostdlib -nostartfiles 1>&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + libc_cv_sparc64_tls=yes +else + libc_cv_sparc64_tls=no +fi +rm -f conftest* +fi +{ $as_echo "$as_me:$LINENO: result: $libc_cv_sparc64_tls" >&5 +$as_echo "$libc_cv_sparc64_tls" >&6; } +if test $libc_cv_sparc64_tls = yes; then + cat >>confdefs.h <<\_ACEOF #define HAVE_TLS_SUPPORT 1 _ACEOF -libc_cv_sparc64_tls=yes - +fi +fi # Check for broken WDISP22 in the linker. { $as_echo "$as_me:$LINENO: checking for sparc64 ld WDISP22 handling" >&5 diff --git a/libc/sysdeps/sparc/sparc64/elf/configure.in b/libc/sysdeps/sparc/sparc64/elf/configure.in index f6281655a..4f7597835 100644 --- a/libc/sysdeps/sparc/sparc64/elf/configure.in +++ b/libc/sysdeps/sparc/sparc64/elf/configure.in @@ -1,52 +1,49 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/sparc/sparc64/elf. -AC_DEFINE(HAVE_TLS_SUPPORT) -libc_cv_sparc64_tls=yes - -dnl if test "$usetls" != no; then -dnl # Check for support of thread-local storage handling in assembler and linker. -dnl AC_CACHE_CHECK(for sparc64 TLS support, libc_cv_sparc64_tls, [dnl -dnl changequote(,)dnl -dnl cat > conftest.s <<\EOF -dnl .section ".tdata", "awT", @progbits -dnl .globl foo -dnl foo: .word 1 -dnl .section ".tbss", "awT", @nobits -dnl .globl bar -dnl bar: .skip 4 -dnl .text -dnl .globl main -dnl main: sethi %tgd_hi22(foo), %l1 -dnl add %l1, %tgd_lo10(foo), %l1 -dnl add %l7, %l1, %o0, %tgd_add(foo) -dnl call __tls_get_addr, %tgd_call(foo) -dnl sethi %tldm_hi22(bar), %l1 -dnl add %l1, %tldm_lo10(bar), %l1 -dnl add %l7, %l1, %o0, %tldm_add(bar) -dnl call __tls_get_addr, %tldm_call(bar) -dnl sethi %tldo_hix22(bar), %l1 -dnl xor %l1, %tldo_lox10(bar), %l1 -dnl add %o0, %l1, %l1, %tldo_add(bar) -dnl sethi %tie_hi22(foo), %l1 -dnl add %l1, %tie_lo10(foo), %l1 -dnl ldx [%l7 + %l1], %l1, %tie_ldx(foo) -dnl add %g7, %l1, %l1, %tie_add(foo) -dnl sethi %tle_hix22(foo), %l1 -dnl xor %l1, %tle_lox10(foo), %l1 -dnl EOF -dnl changequote([,])dnl -dnl dnl -dnl if AC_TRY_COMMAND(${CC-cc} -o conftest.bin $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then -dnl libc_cv_sparc64_tls=yes -dnl else -dnl libc_cv_sparc64_tls=no -dnl fi -dnl rm -f conftest*]) -dnl if test $libc_cv_sparc64_tls = yes; then -dnl AC_DEFINE(HAVE_TLS_SUPPORT) -dnl fi -dnl fi +if test "$usetls" != no; then +# Check for support of thread-local storage handling in assembler and linker. +AC_CACHE_CHECK(for sparc64 TLS support, libc_cv_sparc64_tls, [dnl +changequote(,)dnl +cat > conftest.s <<\EOF + .section ".tdata", "awT", @progbits + .globl foo +foo: .word 1 + .section ".tbss", "awT", @nobits + .globl bar +bar: .skip 4 + .text + .globl _start +_start: sethi %tgd_hi22(foo), %l1 + add %l1, %tgd_lo10(foo), %l1 + add %l7, %l1, %o0, %tgd_add(foo) + call __tls_get_addr, %tgd_call(foo) + sethi %tldm_hi22(bar), %l1 + add %l1, %tldm_lo10(bar), %l1 + add %l7, %l1, %o0, %tldm_add(bar) + call __tls_get_addr, %tldm_call(bar) + sethi %tldo_hix22(bar), %l1 + xor %l1, %tldo_lox10(bar), %l1 + add %o0, %l1, %l1, %tldo_add(bar) + sethi %tie_hi22(foo), %l1 + add %l1, %tie_lo10(foo), %l1 + ldx [%l7 + %l1], %l1, %tie_ldx(foo) + add %g7, %l1, %l1, %tie_add(foo) + sethi %tle_hix22(foo), %l1 + xor %l1, %tle_lox10(foo), %l1 +EOF +changequote([,])dnl +dnl +if AC_TRY_COMMAND(${CC-cc} -o conftest.bin $CFLAGS $LDFLAGS conftest.s -nostdlib -nostartfiles 1>&AS_MESSAGE_LOG_FD); then + libc_cv_sparc64_tls=yes +else + libc_cv_sparc64_tls=no +fi +rm -f conftest*]) +if test $libc_cv_sparc64_tls = yes; then + AC_DEFINE(HAVE_TLS_SUPPORT) +fi +fi # Check for broken WDISP22 in the linker. AC_CACHE_CHECK(for sparc64 ld WDISP22 handling, libc_cv_sparc64_wdisp22, [dnl diff --git a/libc/sysdeps/unix/sysv/linux/i386/sysconf.c b/libc/sysdeps/unix/sysv/linux/i386/sysconf.c index ff3cf9f7c..4ea1a2bf5 100644 --- a/libc/sysdeps/unix/sysv/linux/i386/sysconf.c +++ b/libc/sysdeps/unix/sysv/linux/i386/sysconf.c @@ -1,5 +1,5 @@ /* Get file-specific information about a file. Linux version. - Copyright (C) 2003, 2004, 2006, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2006, 2007, 2009, 2011 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 @@ -186,6 +186,55 @@ intel_check_word (int name, unsigned int value, bool *has_level_2, /* No need to look further. */ break; } + else if (byte == 0xff) + { + /* CPUID leaf 0x4 contains all the information. We need to + iterate over it. */ + unsigned int eax; + unsigned int ebx; + unsigned int ecx; + unsigned int edx; + + unsigned int round = 0; + while (1) + { + asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" + : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) + : "0" (4), "2" (round)); + + enum { null = 0, data = 1, inst = 2, uni = 3 } type = eax & 0x1f; + if (type == null) + /* That was the end. */ + break; + + unsigned int level = (eax >> 5) & 0x7; + + if ((level == 1 && type == data + && folded_rel_name == M(_SC_LEVEL1_DCACHE_SIZE)) + || (level == 1 && type == inst + && folded_rel_name == M(_SC_LEVEL1_ICACHE_SIZE)) + || (level == 2 && folded_rel_name == M(_SC_LEVEL2_CACHE_SIZE)) + || (level == 3 && folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE)) + || (level == 4 && folded_rel_name == M(_SC_LEVEL4_CACHE_SIZE))) + { + unsigned int offset = M(name) - folded_rel_name; + + if (offset == 0) + /* Cache size. */ + return (((ebx >> 22) + 1) + * (((ebx >> 12) & 0x3ff) + 1) + * ((ebx & 0xfff) + 1) + * (ecx + 1)); + if (offset == 1) + return (ebx >> 22) + 1; + + assert (offset == 2); + return (ebx & 0xfff) + 1; + } + } + /* There is no other cache information anywhere else. */ + break; + } else { if (byte == 0x49 && folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE)) @@ -358,11 +407,11 @@ handle_amd (int name) case _SC_LEVEL2_CACHE_ASSOC: ecx >>= 12; switch (ecx & 0xf) - { - case 0: - case 1: - case 2: - case 4: + { + case 0: + case 1: + case 2: + case 4: return ecx & 0xf; case 6: return 8; @@ -372,7 +421,7 @@ handle_amd (int name) return (ecx << 6) & 0x3fffc00; default: return 0; - } + } case _SC_LEVEL2_CACHE_LINESIZE: return (ecx & 0xf000) == 0 ? 0 : ecx & 0xff; default: diff --git a/libc/sysdeps/x86_64/cacheinfo.c b/libc/sysdeps/x86_64/cacheinfo.c index eae54e725..fdd6427e1 100644 --- a/libc/sysdeps/x86_64/cacheinfo.c +++ b/libc/sysdeps/x86_64/cacheinfo.c @@ -1,5 +1,5 @@ /* x86_64 cache info. - Copyright (C) 2003, 2004, 2006, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2003,2004,2006,2007,2009,2011 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 @@ -181,6 +181,55 @@ intel_check_word (int name, unsigned int value, bool *has_level_2, /* No need to look further. */ break; } + else if (byte == 0xff) + { + /* CPUID leaf 0x4 contains all the information. We need to + iterate over it. */ + unsigned int eax; + unsigned int ebx; + unsigned int ecx; + unsigned int edx; + + unsigned int round = 0; + while (1) + { + asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" + : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) + : "0" (4), "2" (round)); + + enum { null = 0, data = 1, inst = 2, uni = 3 } type = eax & 0x1f; + if (type == null) + /* That was the end. */ + break; + + unsigned int level = (eax >> 5) & 0x7; + + if ((level == 1 && type == data + && folded_rel_name == M(_SC_LEVEL1_DCACHE_SIZE)) + || (level == 1 && type == inst + && folded_rel_name == M(_SC_LEVEL1_ICACHE_SIZE)) + || (level == 2 && folded_rel_name == M(_SC_LEVEL2_CACHE_SIZE)) + || (level == 3 && folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE)) + || (level == 4 && folded_rel_name == M(_SC_LEVEL4_CACHE_SIZE))) + { + unsigned int offset = M(name) - folded_rel_name; + + if (offset == 0) + /* Cache size. */ + return (((ebx >> 22) + 1) + * (((ebx >> 12) & 0x3ff) + 1) + * ((ebx & 0xfff) + 1) + * (ecx + 1)); + if (offset == 1) + return (ebx >> 22) + 1; + + assert (offset == 2); + return (ebx & 0xfff) + 1; + } + } + /* There is no other cache information anywhere else. */ + break; + } else { if (byte == 0x49 && folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE)) @@ -352,11 +401,11 @@ handle_amd (int name) case _SC_LEVEL2_CACHE_ASSOC: switch ((ecx >> 12) & 0xf) - { - case 0: - case 1: - case 2: - case 4: + { + case 0: + case 1: + case 2: + case 4: return (ecx >> 12) & 0xf; case 6: return 8; @@ -376,7 +425,7 @@ handle_amd (int name) return ((ecx >> 6) & 0x3fffc00) / (ecx & 0xff); default: return 0; - } + } /* NOTREACHED */ case _SC_LEVEL2_CACHE_LINESIZE: @@ -521,10 +570,10 @@ init_cacheinfo (void) shared = handle_intel (_SC_LEVEL3_CACHE_SIZE, max_cpuid); if (shared <= 0) - { + { /* Try L2 otherwise. */ - level = 2; - shared = handle_intel (_SC_LEVEL2_CACHE_SIZE, max_cpuid); + level = 2; + shared = handle_intel (_SC_LEVEL2_CACHE_SIZE, max_cpuid); } unsigned int ebx_1; @@ -540,7 +589,7 @@ init_cacheinfo (void) #ifndef DISABLE_PREFERRED_MEMORY_INSTRUCTION /* Intel prefers SSSE3 instructions for memory/string routines - if they are avaiable. */ + if they are available. */ if ((ecx & 0x200)) __x86_64_preferred_memory_instruction = 3; else @@ -550,7 +599,7 @@ init_cacheinfo (void) /* Figure out the number of logical threads that share the highest cache level. */ if (max_cpuid >= 4) - { + { int i = 0; /* Query until desired cache level is enumerated. */ @@ -565,7 +614,7 @@ init_cacheinfo (void) if ((eax & 0x1f) == 0) goto intel_bug_no_cache_info; } - while (((eax >> 5) & 0x7) != level); + while (((eax >> 5) & 0x7) != level); threads = (eax >> 14) & 0x3ff; @@ -602,7 +651,7 @@ init_cacheinfo (void) threads += 1; } else - { + { intel_bug_no_cache_info: /* Assume that all logical threads share the highest cache level. */ @@ -612,7 +661,7 @@ init_cacheinfo (void) /* Cap usage of highest cache level to the number of supported threads. */ if (shared > 0 && threads > 0) - shared /= threads; + shared /= threads; } /* This spells out "AuthenticAMD". */ else if (is_amd) @@ -621,6 +670,25 @@ init_cacheinfo (void) long int core = handle_amd (_SC_LEVEL2_CACHE_SIZE); shared = handle_amd (_SC_LEVEL3_CACHE_SIZE); +#ifndef DISABLE_PREFERRED_MEMORY_INSTRUCTION +# ifdef USE_MULTIARCH + eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax; + ebx = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ebx; + ecx = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx; + edx = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].edx; +# else + __cpuid (1, eax, ebx, ecx, edx); +# endif + + /* AMD prefers SSSE3 instructions for memory/string routines + if they are avaiable, otherwise it prefers integer + instructions. */ + if ((ecx & 0x200)) + __x86_64_preferred_memory_instruction = 3; + else + __x86_64_preferred_memory_instruction = 0; +#endif + /* Get maximum extended function. */ __cpuid (0x80000000, max_cpuid_ex, ebx, ecx, edx); diff --git a/libc/sysdeps/x86_64/memset.S b/libc/sysdeps/x86_64/memset.S index f6eb71fc7..d43c7f68b 100644 --- a/libc/sysdeps/x86_64/memset.S +++ b/libc/sysdeps/x86_64/memset.S @@ -1,6 +1,6 @@ /* memset/bzero -- set memory area to CH/0 Optimized version for x86-64. - Copyright (C) 2002-2005, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2002-2005, 2007, 2008, 2011 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 @@ -23,7 +23,7 @@ #define __STOS_LOWER_BOUNDARY $8192 #define __STOS_UPPER_BOUNDARY $65536 - .text + .text #if !defined NOT_IN_libc && !defined USE_MULTIARCH ENTRY(__bzero) mov %rsi,%rdx /* Adjust parameter. */ @@ -417,7 +417,7 @@ L(P4Q0): mov %edx,-0x4(%rdi) retq .balign 16 -#if defined(USE_EXTRA_TABLE) +#ifdef USE_EXTRA_TABLE L(P5QI): mov %rdx,-0x95(%rdi) #endif L(P5QH): mov %rdx,-0x8d(%rdi) @@ -596,6 +596,8 @@ L(A6Q0): mov %dx,-0x6(%rdi) jmp L(aligned_now) L(SSE_pre): +#else +L(aligned_now): #endif #if !defined USE_MULTIARCH || defined USE_SSE2 # fill RegXMM0 with the pattern @@ -606,16 +608,16 @@ L(SSE_pre): jge L(byte32sse2_pre) add %r8,%rdi -#ifndef PIC +# ifndef PIC lea L(SSExDx)(%rip),%r9 jmpq *(%r9,%r8,8) -#else +# else lea L(SSE0Q0)(%rip),%r9 lea L(SSExDx)(%rip),%rcx movswq (%rcx,%r8,2),%rcx lea (%rcx,%r9,1),%r9 jmpq *%r9 -#endif +# endif L(SSE0QB): movdqa %xmm0,-0xb0(%rdi) L(SSE0QA): movdqa %xmm0,-0xa0(%rdi) @@ -881,16 +883,16 @@ L(byte32sse2): lea 0x80(%rdi),%rdi jge L(byte32sse2) add %r8,%rdi -#ifndef PIC +# ifndef PIC lea L(SSExDx)(%rip),%r11 jmpq *(%r11,%r8,8) -#else +# else lea L(SSE0Q0)(%rip),%r11 lea L(SSExDx)(%rip),%rcx movswq (%rcx,%r8,2),%rcx lea (%rcx,%r11,1),%r11 jmpq *%r11 -#endif +# endif .balign 16 L(sse2_nt_move_pre): @@ -916,20 +918,20 @@ L(sse2_nt_move): jge L(sse2_nt_move) sfence add %r8,%rdi -#ifndef PIC +# ifndef PIC lea L(SSExDx)(%rip),%r11 jmpq *(%r11,%r8,8) -#else +# else lea L(SSE0Q0)(%rip),%r11 lea L(SSExDx)(%rip),%rcx movswq (%rcx,%r8,2),%rcx lea (%rcx,%r11,1),%r11 jmpq *%r11 -#endif +# endif .pushsection .rodata .balign 16 -#ifndef PIC +# ifndef PIC L(SSExDx): .quad L(SSE0Q0), L(SSE1Q0), L(SSE2Q0), L(SSE3Q0) .quad L(SSE4Q0), L(SSE5Q0), L(SSE6Q0), L(SSE7Q0) @@ -979,7 +981,7 @@ L(SSExDx): .quad L(SSE4QB), L(SSE5QB), L(SSE6QB), L(SSE7QB) .quad L(SSE8QB), L(SSE9QB), L(SSE10QB), L(SSE11QB) .quad L(SSE12QB), L(SSE13QB), L(SSE14QB), L(SSE15QB) -#else +# else L(SSExDx): .short L(SSE0Q0) -L(SSE0Q0) .short L(SSE1Q0) -L(SSE0Q0) @@ -1196,14 +1198,14 @@ L(SSExDx): .short L(SSE13QB)-L(SSE0Q0) .short L(SSE14QB)-L(SSE0Q0) .short L(SSE15QB)-L(SSE0Q0) -#endif +# endif .popsection #endif /* !defined USE_MULTIARCH || defined USE_SSE2 */ .balign 16 +#ifndef USE_MULTIARCH L(aligned_now): -#ifndef USE_MULTIARCH cmpl $0x1,__x86_64_preferred_memory_instruction(%rip) jg L(SSE_pre) #endif /* USE_MULTIARCH */ @@ -1246,17 +1248,17 @@ L(8byte_move_loop): L(8byte_move_skip): andl $127,%r8d - lea (%rdi,%r8,1),%rdi + lea (%rdi,%r8,1),%rdi #ifndef PIC - lea L(setPxQx)(%rip),%r11 - jmpq *(%r11,%r8,8) # old scheme remained for nonPIC + lea L(setPxQx)(%rip),%r11 + jmpq *(%r11,%r8,8) # old scheme remained for nonPIC #else - lea L(Got0)(%rip),%r11 + lea L(Got0)(%rip),%r11 lea L(setPxQx)(%rip),%rcx movswq (%rcx,%r8,2),%rcx - lea (%rcx,%r11,1),%r11 - jmpq *%r11 + lea (%rcx,%r11,1),%r11 + jmpq *%r11 #endif .balign 16 @@ -1290,16 +1292,16 @@ L(8byte_stos_skip): ja L(8byte_nt_move) andl $7,%r8d - lea (%rdi,%r8,1),%rdi + lea (%rdi,%r8,1),%rdi #ifndef PIC - lea L(setPxQx)(%rip),%r11 - jmpq *(%r11,%r8,8) # old scheme remained for nonPIC + lea L(setPxQx)(%rip),%r11 + jmpq *(%r11,%r8,8) # old scheme remained for nonPIC #else - lea L(Got0)(%rip),%r11 + lea L(Got0)(%rip),%r11 lea L(setPxQx)(%rip),%rcx movswq (%rcx,%r8,2),%rcx lea (%rcx,%r11,1),%r11 - jmpq *%r11 + jmpq *%r11 #endif .balign 16 @@ -1338,16 +1340,16 @@ L(8byte_nt_move_loop): L(8byte_nt_move_skip): andl $127,%r8d - lea (%rdi,%r8,1),%rdi + lea (%rdi,%r8,1),%rdi #ifndef PIC - lea L(setPxQx)(%rip),%r11 - jmpq *(%r11,%r8,8) # old scheme remained for nonPIC + lea L(setPxQx)(%rip),%r11 + jmpq *(%r11,%r8,8) # old scheme remained for nonPIC #else - lea L(Got0)(%rip),%r11 + lea L(Got0)(%rip),%r11 lea L(setPxQx)(%rip),%rcx movswq (%rcx,%r8,2),%rcx - lea (%rcx,%r11,1),%r11 - jmpq *%r11 + lea (%rcx,%r11,1),%r11 + jmpq *%r11 #endif END (memset) diff --git a/libc/sysdeps/x86_64/multiarch/init-arch.c b/libc/sysdeps/x86_64/multiarch/init-arch.c index f0d2bb7d1..34ec2df2d 100644 --- a/libc/sysdeps/x86_64/multiarch/init-arch.c +++ b/libc/sysdeps/x86_64/multiarch/init-arch.c @@ -1,6 +1,6 @@ /* Initialize CPU feature data. This file is part of the GNU C Library. - Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Ulrich Drepper <drepper@redhat.com>. The GNU C Library is free software; you can redistribute it and/or @@ -60,7 +60,7 @@ __init_cpu_features (void) get_common_indeces (&family, &model); /* Intel processors prefer SSE instruction for memory/string - routines if they are avaiable. */ + routines if they are available. */ __cpu_features.feature[index_Prefer_SSE_for_memop] |= bit_Prefer_SSE_for_memop; @@ -107,6 +107,14 @@ __init_cpu_features (void) kind = arch_kind_amd; get_common_indeces (&family, &model); + + unsigned int ecx = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx; + + /* AMD processors prefer SSE instructions for memory/string routines + if they are available, otherwise they prefer integer instructions. */ + if ((ecx & 0x200)) + __cpu_features.feature[index_Prefer_SSE_for_memop] + |= bit_Prefer_SSE_for_memop; } else kind = arch_kind_other; diff --git a/libc/sysdeps/x86_64/multiarch/strcmp.S b/libc/sysdeps/x86_64/multiarch/strcmp.S index 185928957..8879855d9 100644 --- a/libc/sysdeps/x86_64/multiarch/strcmp.S +++ b/libc/sysdeps/x86_64/multiarch/strcmp.S @@ -452,6 +452,7 @@ LABEL(loop_ashr_1_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_1_use_sse4_2) +LABEL(nibble_ashr_1_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $1, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -499,7 +500,7 @@ LABEL(nibble_ashr_1_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $14, %ecx - ja LABEL(loop_ashr_1_use_sse4_2) + ja LABEL(nibble_ashr_1_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -544,6 +545,7 @@ LABEL(loop_ashr_2_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_2_use_sse4_2) +LABEL(nibble_ashr_2_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $2, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -591,7 +593,7 @@ LABEL(nibble_ashr_2_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $13, %ecx - ja LABEL(loop_ashr_2_use_sse4_2) + ja LABEL(nibble_ashr_2_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -636,6 +638,7 @@ LABEL(loop_ashr_3_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_3_use_sse4_2) +LABEL(nibble_ashr_3_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $3, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -683,7 +686,7 @@ LABEL(nibble_ashr_3_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $12, %ecx - ja LABEL(loop_ashr_3_use_sse4_2) + ja LABEL(nibble_ashr_3_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -729,6 +732,7 @@ LABEL(loop_ashr_4_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_4_use_sse4_2) +LABEL(nibble_ashr_4_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $4, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -776,7 +780,7 @@ LABEL(nibble_ashr_4_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $11, %ecx - ja LABEL(loop_ashr_4_use_sse4_2) + ja LABEL(nibble_ashr_4_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -822,6 +826,7 @@ LABEL(loop_ashr_5_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_5_use_sse4_2) +LABEL(nibble_ashr_5_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $5, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -870,7 +875,7 @@ LABEL(nibble_ashr_5_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $10, %ecx - ja LABEL(loop_ashr_5_use_sse4_2) + ja LABEL(nibble_ashr_5_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -916,6 +921,7 @@ LABEL(loop_ashr_6_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_6_use_sse4_2) +LABEL(nibble_ashr_6_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $6, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -963,7 +969,7 @@ LABEL(nibble_ashr_6_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $9, %ecx - ja LABEL(loop_ashr_6_use_sse4_2) + ja LABEL(nibble_ashr_6_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -1009,6 +1015,7 @@ LABEL(loop_ashr_7_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_7_use_sse4_2) +LABEL(nibble_ashr_7_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $7, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -1056,7 +1063,7 @@ LABEL(nibble_ashr_7_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $8, %ecx - ja LABEL(loop_ashr_7_use_sse4_2) + ja LABEL(nibble_ashr_7_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -1102,6 +1109,7 @@ LABEL(loop_ashr_8_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_8_use_sse4_2) +LABEL(nibble_ashr_8_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $8, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -1149,7 +1157,7 @@ LABEL(nibble_ashr_8_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $7, %ecx - ja LABEL(loop_ashr_8_use_sse4_2) + ja LABEL(nibble_ashr_8_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -1195,6 +1203,7 @@ LABEL(loop_ashr_9_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_9_use_sse4_2) +LABEL(nibble_ashr_9_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $9, -16(%rdi, %rdx), %xmm0 @@ -1243,7 +1252,7 @@ LABEL(nibble_ashr_9_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $6, %ecx - ja LABEL(loop_ashr_9_use_sse4_2) + ja LABEL(nibble_ashr_9_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -1289,6 +1298,7 @@ LABEL(loop_ashr_10_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_10_use_sse4_2) +LABEL(nibble_ashr_10_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $10, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -1336,7 +1346,7 @@ LABEL(nibble_ashr_10_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $5, %ecx - ja LABEL(loop_ashr_10_use_sse4_2) + ja LABEL(nibble_ashr_10_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -1382,6 +1392,7 @@ LABEL(loop_ashr_11_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_11_use_sse4_2) +LABEL(nibble_ashr_11_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $11, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -1429,7 +1440,7 @@ LABEL(nibble_ashr_11_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $4, %ecx - ja LABEL(loop_ashr_11_use_sse4_2) + ja LABEL(nibble_ashr_11_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -1475,6 +1486,7 @@ LABEL(loop_ashr_12_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_12_use_sse4_2) +LABEL(nibble_ashr_12_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $12, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -1522,7 +1534,7 @@ LABEL(nibble_ashr_12_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $3, %ecx - ja LABEL(loop_ashr_12_use_sse4_2) + ja LABEL(nibble_ashr_12_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -1569,6 +1581,7 @@ LABEL(loop_ashr_13_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_13_use_sse4_2) +LABEL(nibble_ashr_13_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $13, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -1616,7 +1629,7 @@ LABEL(nibble_ashr_13_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $2, %ecx - ja LABEL(loop_ashr_13_use_sse4_2) + ja LABEL(nibble_ashr_13_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -1663,6 +1676,7 @@ LABEL(loop_ashr_14_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_14_use_sse4_2) +LABEL(nibble_ashr_14_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $14, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -1710,7 +1724,7 @@ LABEL(nibble_ashr_14_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $1, %ecx - ja LABEL(loop_ashr_14_use_sse4_2) + ja LABEL(nibble_ashr_14_use_sse4_2_restart) jmp LABEL(nibble_ashr_use_sse4_2_exit) @@ -1759,6 +1773,7 @@ LABEL(loop_ashr_15_use_sse4_2): add $16, %r10 jg LABEL(nibble_ashr_15_use_sse4_2) +LABEL(nibble_ashr_15_use_sse4_2_restart): movdqa (%rdi, %rdx), %xmm0 palignr $15, -16(%rdi, %rdx), %xmm0 # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L @@ -1806,7 +1821,7 @@ LABEL(nibble_ashr_15_use_sse4_2): jae LABEL(nibble_ashr_use_sse4_2_exit) # endif cmp $0, %ecx - ja LABEL(loop_ashr_15_use_sse4_2) + ja LABEL(nibble_ashr_15_use_sse4_2_restart) LABEL(nibble_ashr_use_sse4_2_exit): # if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L diff --git a/libc/wcsmbs/wchar.h b/libc/wcsmbs/wchar.h index 5f341f399..fdcfdd68e 100644 --- a/libc/wcsmbs/wchar.h +++ b/libc/wcsmbs/wchar.h @@ -319,8 +319,7 @@ extern wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n) #endif /* Compare N wide characters of S1 and S2. */ -extern int wmemcmp (__const wchar_t *__restrict __s1, - __const wchar_t *__restrict __s2, size_t __n) +extern int wmemcmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n) __THROW __attribute_pure__; /* Copy N wide characters of SRC to DEST. */ diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm index 1e05d4187..346440446 100644 --- a/ports/ChangeLog.arm +++ b/ports/ChangeLog.arm @@ -1,3 +1,17 @@ +2011-03-21 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/arm/eabi/__longjmp.S, sysdeps/arm/eabi/bits/fenv.h, + sysdeps/arm/eabi/fclrexcpt.c, sysdeps/arm/eabi/fedisblxcpt.c, + sysdeps/arm/eabi/feenablxcpt.c, sysdeps/arm/eabi/fegetenv.c, + sysdeps/arm/eabi/fegetexcept.c, sysdeps/arm/eabi/fegetround.c, + sysdeps/arm/eabi/feholdexcpt.c, sysdeps/arm/eabi/fesetenv.c, + sysdeps/arm/eabi/fesetround.c, sysdeps/arm/eabi/fpu_control.h, + sysdeps/arm/eabi/fraiseexcpt.c, sysdeps/arm/eabi/fsetexcptflg.c, + sysdeps/arm/eabi/ftestexcept.c, sysdeps/arm/eabi/setjmp.S, + sysdeps/unix/sysv/linux/arm/____longjmp_chk.S, + sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S: Correct + license reference in last paragraph of license notice. + 2011-03-05 Nathan Sidwell <nathan@codesourcery.com> Glauber de Oliveira Costa <glommer@gmail.com> diff --git a/ports/ChangeLog.eglibc b/ports/ChangeLog.eglibc index 346fa1d1c..cdbfee229 100644 --- a/ports/ChangeLog.eglibc +++ b/ports/ChangeLog.eglibc @@ -1,3 +1,8 @@ +2011-03-21 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/arm/eabi/bits/predefs.h: Correct license reference in + last paragraph of license notice. + 2010-10-12 Joseph Myers <joseph@codesourcery.com> * sysdeps/powerpc/powerpc32/e500/fpu/feupdateenv.c (feupdateenv): diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k index 6edab560b..5e45243a1 100644 --- a/ports/ChangeLog.m68k +++ b/ports/ChangeLog.m68k @@ -1,3 +1,8 @@ +2011-03-06 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/bits/byteswap.h (__bswap_16, __bswap_32) + (__bswap_64): Implement as inline functions. + 2011-01-18 Andreas Schwab <schwab@linux-m68k.org> * sysdeps/unix/sysv/linux/m68k/bits/mman.h (MADV_HUGEPAGE) diff --git a/ports/sysdeps/arm/eabi/__longjmp.S b/ports/sysdeps/arm/eabi/__longjmp.S index edabdad4a..f97489e97 100644 --- a/ports/sysdeps/arm/eabi/__longjmp.S +++ b/ports/sysdeps/arm/eabi/__longjmp.S @@ -13,10 +13,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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> #define _SETJMP_H diff --git a/ports/sysdeps/arm/eabi/bits/fenv.h b/ports/sysdeps/arm/eabi/bits/fenv.h index 49e386222..816ebe773 100644 --- a/ports/sysdeps/arm/eabi/bits/fenv.h +++ b/ports/sysdeps/arm/eabi/bits/fenv.h @@ -11,10 +11,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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. */ #ifndef _FENV_H # error "Never use <bits/fenv.h> directly; include <fenv.h> instead." diff --git a/ports/sysdeps/arm/eabi/bits/predefs.h b/ports/sysdeps/arm/eabi/bits/predefs.h index 5683349b8..3ef3c6260 100644 --- a/ports/sysdeps/arm/eabi/bits/predefs.h +++ b/ports/sysdeps/arm/eabi/bits/predefs.h @@ -11,10 +11,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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. */ #ifndef _FEATURES_H # error "Never use <bits/predefs.h> directly; include <features.h> instead." diff --git a/ports/sysdeps/arm/eabi/fclrexcpt.c b/ports/sysdeps/arm/eabi/fclrexcpt.c index 0bdd6a14d..fa326ecd5 100644 --- a/ports/sysdeps/arm/eabi/fclrexcpt.c +++ b/ports/sysdeps/arm/eabi/fclrexcpt.c @@ -12,10 +12,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fenv.h> #include <fpu_control.h> diff --git a/ports/sysdeps/arm/eabi/fedisblxcpt.c b/ports/sysdeps/arm/eabi/fedisblxcpt.c index ab6fe79da..31a4dcd7a 100644 --- a/ports/sysdeps/arm/eabi/fedisblxcpt.c +++ b/ports/sysdeps/arm/eabi/fedisblxcpt.c @@ -13,10 +13,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fenv.h> #include <fpu_control.h> diff --git a/ports/sysdeps/arm/eabi/feenablxcpt.c b/ports/sysdeps/arm/eabi/feenablxcpt.c index f12b45320..9c4215870 100644 --- a/ports/sysdeps/arm/eabi/feenablxcpt.c +++ b/ports/sysdeps/arm/eabi/feenablxcpt.c @@ -13,10 +13,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fenv.h> #include <fpu_control.h> diff --git a/ports/sysdeps/arm/eabi/fegetenv.c b/ports/sysdeps/arm/eabi/fegetenv.c index 049138194..d2afd77bc 100644 --- a/ports/sysdeps/arm/eabi/fegetenv.c +++ b/ports/sysdeps/arm/eabi/fegetenv.c @@ -12,10 +12,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fenv.h> #include <fpu_control.h> diff --git a/ports/sysdeps/arm/eabi/fegetexcept.c b/ports/sysdeps/arm/eabi/fegetexcept.c index 8e29ff7c6..b0e623db5 100644 --- a/ports/sysdeps/arm/eabi/fegetexcept.c +++ b/ports/sysdeps/arm/eabi/fegetexcept.c @@ -13,10 +13,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fenv.h> #include <fpu_control.h> diff --git a/ports/sysdeps/arm/eabi/fegetround.c b/ports/sysdeps/arm/eabi/fegetround.c index 6a3442aa4..e8246368e 100644 --- a/ports/sysdeps/arm/eabi/fegetround.c +++ b/ports/sysdeps/arm/eabi/fegetround.c @@ -12,10 +12,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fenv.h> #include <fpu_control.h> diff --git a/ports/sysdeps/arm/eabi/feholdexcpt.c b/ports/sysdeps/arm/eabi/feholdexcpt.c index 33c88e7d1..04bb2fa92 100644 --- a/ports/sysdeps/arm/eabi/feholdexcpt.c +++ b/ports/sysdeps/arm/eabi/feholdexcpt.c @@ -12,10 +12,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fenv.h> #include <fpu_control.h> diff --git a/ports/sysdeps/arm/eabi/fesetenv.c b/ports/sysdeps/arm/eabi/fesetenv.c index c47aa6582..10bfa38c2 100644 --- a/ports/sysdeps/arm/eabi/fesetenv.c +++ b/ports/sysdeps/arm/eabi/fesetenv.c @@ -12,10 +12,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fenv.h> #include <fpu_control.h> diff --git a/ports/sysdeps/arm/eabi/fesetround.c b/ports/sysdeps/arm/eabi/fesetround.c index 552352282..efa14b45b 100644 --- a/ports/sysdeps/arm/eabi/fesetround.c +++ b/ports/sysdeps/arm/eabi/fesetround.c @@ -12,10 +12,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fenv.h> #include <fpu_control.h> diff --git a/ports/sysdeps/arm/eabi/fpu_control.h b/ports/sysdeps/arm/eabi/fpu_control.h index 9d2999457..8b0fa1419 100644 --- a/ports/sysdeps/arm/eabi/fpu_control.h +++ b/ports/sysdeps/arm/eabi/fpu_control.h @@ -12,10 +12,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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. */ #ifndef _FPU_CONTROL_H #define _FPU_CONTROL_H diff --git a/ports/sysdeps/arm/eabi/fraiseexcpt.c b/ports/sysdeps/arm/eabi/fraiseexcpt.c index 78441ec01..3a41b2254 100644 --- a/ports/sysdeps/arm/eabi/fraiseexcpt.c +++ b/ports/sysdeps/arm/eabi/fraiseexcpt.c @@ -12,10 +12,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fpu_control.h> #include <fenv.h> diff --git a/ports/sysdeps/arm/eabi/fsetexcptflg.c b/ports/sysdeps/arm/eabi/fsetexcptflg.c index 28966bb8f..a844854f6 100644 --- a/ports/sysdeps/arm/eabi/fsetexcptflg.c +++ b/ports/sysdeps/arm/eabi/fsetexcptflg.c @@ -12,10 +12,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fenv.h> #include <math.h> diff --git a/ports/sysdeps/arm/eabi/ftestexcept.c b/ports/sysdeps/arm/eabi/ftestexcept.c index 61b81cbb0..144eef9c5 100644 --- a/ports/sysdeps/arm/eabi/ftestexcept.c +++ b/ports/sysdeps/arm/eabi/ftestexcept.c @@ -12,10 +12,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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 <fenv.h> #include <fpu_control.h> diff --git a/ports/sysdeps/arm/eabi/setjmp.S b/ports/sysdeps/arm/eabi/setjmp.S index 92f83af3f..0bc1a1547 100644 --- a/ports/sysdeps/arm/eabi/setjmp.S +++ b/ports/sysdeps/arm/eabi/setjmp.S @@ -12,10 +12,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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> #define _SETJMP_H diff --git a/ports/sysdeps/m68k/bits/byteswap.h b/ports/sysdeps/m68k/bits/byteswap.h index a2546c9a2..4f31d95bb 100644 --- a/ports/sysdeps/m68k/bits/byteswap.h +++ b/ports/sysdeps/m68k/bits/byteswap.h @@ -1,5 +1,5 @@ /* Macros to swap the order of bytes in integer values. m68k version. - Copyright (C) 1997, 2002, 2008 Free Software Foundation, Inc. + Copyright (C) 1997, 2002, 2008, 2011 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,36 +30,29 @@ #define __bswap_constant_16(x) \ ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8)) -#ifdef __GNUC__ -# define __bswap_16(x) \ - (__extension__ \ - ({ unsigned short int __bsx = (x); __bswap_constant_16 (__bsx); })) -#else static __inline unsigned short int __bswap_16 (unsigned short int __bsx) { return __bswap_constant_16 (__bsx); } -#endif /* Swap bytes in 32 bit value. */ #define __bswap_constant_32(x) \ ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \ (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) -#if defined __GNUC__ && __GNUC__ >= 2 && !defined(__mcoldfire__) -# define __bswap_32(x) \ - __extension__ \ - ({ unsigned int __bswap_32_v; \ - if (__builtin_constant_p (x)) \ - __bswap_32_v = __bswap_constant_32 (x); \ - else \ - __asm__ __volatile__ ("ror%.w %#8, %0;" \ - "swap %0;" \ - "ror%.w %#8, %0" \ - : "=d" (__bswap_32_v) \ - : "0" ((unsigned int) (x))); \ - __bswap_32_v; }) +#if !defined(__mcoldfire__) +static __inline unsigned int +__bswap_32 (unsigned int __bsx) +{ + if (__builtin_constant_p (__bsx)) + return __bswap_constant_32 (__bsx); + __asm__ __volatile__ ("ror%.w %#8, %0;" + "swap %0;" + "ror%.w %#8, %0" + : "+d" (__bsx)); + return __bsx; +} #else static __inline unsigned int __bswap_32 (unsigned int __bsx) @@ -81,19 +74,14 @@ __bswap_32 (unsigned int __bsx) | (((x) & 0x00000000000000ffull) << 56)) /* Swap bytes in 64 bit value. */ -# define __bswap_64(x) \ - __extension__ \ - ({ union { unsigned long long int __ll; \ - unsigned long int __l[2]; } __bswap_64_v, __bswap_64_r; \ - if (__builtin_constant_p (x)) \ - __bswap_64_r.__ll = __bswap_constant_64 (x); \ - else \ - { \ - __bswap_64_v.__ll = (x); \ - __bswap_64_r.__l[0] = __bswap_32 (__bswap_64_v.__l[1]); \ - __bswap_64_r.__l[1] = __bswap_32 (__bswap_64_v.__l[0]); \ - } \ - __bswap_64_r.__ll; }) +static __inline unsigned long long +__bswap_64 (unsigned long long __bsx) +{ + if (__builtin_constant_p (__bsx)) + return __bswap_constant_64 (__bsx); + return (__bswap_32 (__bsx >> 32) + | ((unsigned long long) __bswap_32 (__bsx) << 32)); +} #endif #endif /* _BITS_BYTESWAP_H */ diff --git a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S index 2fa727dcf..bac25635f 100644 --- a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S +++ b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S @@ -11,10 +11,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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> diff --git a/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S index 423e7776e..508b4babd 100644 --- a/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S +++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S @@ -11,10 +11,10 @@ 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 General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + 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> |