[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r14838 - in /fsf/glibc-2_14-branch/libc: ./ elf/ resolv/ sysdeps/i386/i486/bits/ sysdeps/posix/ sysdeps/x86_64/



Author: eglibc
Date: Sat Aug  6 00:05:03 2011
New Revision: 14838

Log:
Import glibc-2.14 for 2011-08-06

Modified:
    fsf/glibc-2_14-branch/libc/ChangeLog
    fsf/glibc-2_14-branch/libc/elf/tst-audit4.c
    fsf/glibc-2_14-branch/libc/elf/tst-audit6.c
    fsf/glibc-2_14-branch/libc/resolv/res_init.c
    fsf/glibc-2_14-branch/libc/sysdeps/i386/i486/bits/string.h
    fsf/glibc-2_14-branch/libc/sysdeps/posix/getaddrinfo.c
    fsf/glibc-2_14-branch/libc/sysdeps/x86_64/dl-trampoline.S

Modified: fsf/glibc-2_14-branch/libc/ChangeLog
==============================================================================
--- fsf/glibc-2_14-branch/libc/ChangeLog (original)
+++ fsf/glibc-2_14-branch/libc/ChangeLog Sat Aug  6 00:05:03 2011
@@ -1,3 +1,46 @@
+2011-07-22  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* resolv/res_init.c (__res_vinit): Properly tokenize nameserver
+	line.
+
+2011-07-26  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Don't discard result of
+	encoding to ACE if AI_IDN.
+
+2011-07-25  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/i386/i486/bits/string.h (__strncat_g): Correctly handle
+	__n bigger than INT_MAX+1.
+	(__strncmp_g): Likewise.
+
+2011-07-23  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix one more
+	typo.
+	(_dl_x86_64_save_sse): Likewise.
+
+2011-07-22  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix test for
+	OSXSAVE.
+	(_dl_x86_64_save_sse): Likewise.
+
+2011-07-21  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix last
+	change.
+	(_dl_x86_64_save_sse): Use correct AVX check.
+
+2011-07-20  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ #13007]
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): More complete
+	check for AVX enablement so that we don't crash with old kernels and
+	new hardware.
+	* elf/tst-audit4.c: Add same checks here.
+	* elf/tst-audit6.c: Likewise.
+
 2011-07-20  Ulrich Drepper  <drepper@xxxxxxxxx>
 
 	[BZ #12852]

Modified: fsf/glibc-2_14-branch/libc/elf/tst-audit4.c
==============================================================================
--- fsf/glibc-2_14-branch/libc/elf/tst-audit4.c (original)
+++ fsf/glibc-2_14-branch/libc/elf/tst-audit4.c Sat Aug  6 00:05:03 2011
@@ -6,16 +6,30 @@
 #include <cpuid.h>
 #include <immintrin.h>
 
+
+static int
+avx_enabled (void)
+{
+  unsigned int eax, ebx, ecx, edx;
+
+  if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
+      || (ecx & (bit_AVX | bit_OSXSAVE)) != (bit_AVX | bit_OSXSAVE))
+    return 0;
+
+  /* Check the OS has AVX and SSE saving enabled.  */
+  asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
+
+  return (eax & 6) == 6;
+}
+
+
 extern __m256i audit_test (__m256i, __m256i, __m256i, __m256i,
 			   __m256i, __m256i, __m256i, __m256i);
 int
 main (void)
 {
-  unsigned int eax, ebx, ecx, edx;
-
   /* Run AVX test only if AVX is supported.  */
-  if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
-      && (ecx & bit_AVX))
+  if (avx_enabled ())
     {
       __m256i ymm = _mm256_setzero_si256 ();
       __m256i ret = audit_test (ymm, ymm, ymm, ymm, ymm, ymm, ymm, ymm);

Modified: fsf/glibc-2_14-branch/libc/elf/tst-audit6.c
==============================================================================
--- fsf/glibc-2_14-branch/libc/elf/tst-audit6.c (original)
+++ fsf/glibc-2_14-branch/libc/elf/tst-audit6.c Sat Aug  6 00:05:03 2011
@@ -8,14 +8,28 @@
 extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i,
 			   __m128i, __m128i, __m128i, __m128i);
 
+
+static int
+avx_enabled (void)
+{
+  unsigned int eax, ebx, ecx, edx;
+
+  if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
+      || (ecx & (bit_AVX | bit_OSXSAVE)) != (bit_AVX | bit_OSXSAVE))
+    return 0;
+
+  /* Check the OS has AVX and SSE saving enabled.  */
+  asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
+
+  return (eax & 6) == 6;
+}
+
+
 int
 main (void)
 {
-  unsigned int eax, ebx, ecx, edx;
-
   /* Run AVX test only if AVX is supported.  */
-  if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
-      && (ecx & bit_AVX))
+  if (avx_enabled ())
     {
       __m128i xmm = _mm_setzero_si128 ();
       __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm);

Modified: fsf/glibc-2_14-branch/libc/resolv/res_init.c
==============================================================================
--- fsf/glibc-2_14-branch/libc/resolv/res_init.c (original)
+++ fsf/glibc-2_14-branch/libc/resolv/res_init.c Sat Aug  6 00:05:03 2011
@@ -318,7 +318,7 @@
 			struct in6_addr a6;
 			char *el;
 
-			if ((el = strchr(cp, '\n')) != NULL)
+			if ((el = strpbrk(cp, " \t\n")) != NULL)
 			    *el = '\0';
 			if ((el = strchr(cp, SCOPE_DELIMITER)) != NULL)
 			    *el = '\0';

Modified: fsf/glibc-2_14-branch/libc/sysdeps/i386/i486/bits/string.h
==============================================================================
--- fsf/glibc-2_14-branch/libc/sysdeps/i386/i486/bits/string.h (original)
+++ fsf/glibc-2_14-branch/libc/sysdeps/i386/i486/bits/string.h Sat Aug  6 00:05:03 2011
@@ -1,6 +1,6 @@
 /* Optimized, inlined string functions.  i486 version.
-   Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2004,2007
-   	Free Software Foundation, Inc.
+   Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2004,2007,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
@@ -1058,8 +1058,8 @@
      "movl %4, %3\n\t"
      "decl %1\n\t"
      "1:\n\t"
-     "decl	%3\n\t"
-     "js	2f\n\t"
+     "subl	$1,%3\n\t"
+     "jc	2f\n\t"
      "movb	(%2),%b0\n\t"
      "movsb\n\t"
      "testb	%b0,%b0\n\t"
@@ -1078,8 +1078,8 @@
      "leal	1(%1),%1\n\t"
      "jne	1b\n"
      "2:\n\t"
-     "decl	%3\n\t"
-     "js	3f\n\t"
+     "subl	$1,%3\n\t"
+     "jc	3f\n\t"
      "movb	(%2),%b0\n\t"
      "leal	1(%2),%2\n\t"
      "movb	%b0,(%1)\n\t"
@@ -1219,8 +1219,8 @@
   register int __res;
   __asm__ __volatile__
     ("1:\n\t"
-     "decl	%3\n\t"
-     "js	2f\n\t"
+     "subl	$1,%3\n\t"
+     "jc	2f\n\t"
      "movb	(%1),%b0\n\t"
      "incl	%1\n\t"
      "cmpb	%b0,(%2)\n\t"

Modified: fsf/glibc-2_14-branch/libc/sysdeps/posix/getaddrinfo.c
==============================================================================
--- fsf/glibc-2_14-branch/libc/sysdeps/posix/getaddrinfo.c (original)
+++ fsf/glibc-2_14-branch/libc/sysdeps/posix/getaddrinfo.c Sat Aug  6 00:05:03 2011
@@ -432,7 +432,10 @@
 	  /* In case the output string is the same as the input string
 	     no new string has been allocated.  */
 	  if (p != name)
-	    malloc_name = true;
+	    {
+	      name = p;
+	      malloc_name = true;
+	    }
 	}
 #endif
 

Modified: fsf/glibc-2_14-branch/libc/sysdeps/x86_64/dl-trampoline.S
==============================================================================
--- fsf/glibc-2_14-branch/libc/sysdeps/x86_64/dl-trampoline.S (original)
+++ fsf/glibc-2_14-branch/libc/sysdeps/x86_64/dl-trampoline.S Sat Aug  6 00:05:03 2011
@@ -1,5 +1,5 @@
 /* PLT trampolines.  x86-64 version.
-   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 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
@@ -139,11 +139,20 @@
 	movl	$1, %eax
 	cpuid
 	movq	%r11,%rbx		# Restore rbx
-	movl	$1, %eax
-	testl	$(1 << 28), %ecx
+	xorl	%eax, %eax
+	// AVX and XSAVE supported?
+	andl	$((1 << 28) | (1 << 27)), %ecx
+	cmpl	$((1 << 28) | (1 << 27)), %ecx
 	jne	2f
-	negl	%eax
-2:	movl	%eax, L(have_avx)(%rip)
+	xorl	%ecx, %ecx
+	// Get XFEATURE_ENABLED_MASK
+	xgetbv
+	andl	$0x6, %eax
+	cmpl	$0x6, %eax
+	// Nonzero if SSE and AVX state saving is enabled.
+	sete	%al
+2:	leal	-1(%eax,%eax), %eax
+	movl	%eax, L(have_avx)(%rip)
 	cmpl	$0, %eax
 
 1:	js	L(no_avx)
@@ -176,11 +185,20 @@
 	movl	$1, %eax
 	cpuid
 	movq	%r11,%rbx		# Restore rbx
-	movl	$1, %eax
-	testl	$(1 << 28), %ecx
+	xorl	%eax, %eax
+	// AVX and XSAVE supported?
+	andl	$((1 << 28) | (1 << 27)), %ecx
+	cmpl	$((1 << 28) | (1 << 27)), %ecx
 	jne	2f
-	negl	%eax
-2:	movl	%eax, L(have_avx)(%rip)
+	xorl	%ecx, %ecx
+	// Get XFEATURE_ENABLED_MASK
+	xgetbv
+	andl	$0x6, %eax
+	cmpl	$0x6, %eax
+	// Nonzero if SSE and AVX state saving is enabled.
+	sete	%al
+2:	leal	-1(%eax,%eax), %eax
+	movl	%eax, L(have_avx)(%rip)
 	cmpl	$0, %eax
 
 1:	js	L(no_avx5)