summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog63
-rw-r--r--elf/dl-load.c9
-rw-r--r--locale/C-time.c4
-rw-r--r--locale/programs/locale-spec.c5
-rw-r--r--po/cs.po17
-rw-r--r--stdio-common/printf_fp.c11
-rw-r--r--stdio-common/vfprintf.c49
-rw-r--r--stdlib/rand_r.c4
-rw-r--r--stdlib/random_r.c6
-rw-r--r--sysdeps/mach/hurd/mkdirat.c3
-rw-r--r--sysdeps/unix/sysv/linux/i386/bits/fcntl.h6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/fcntl.h6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h6
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/fcntl.h6
-rw-r--r--sysdeps/unix/sysv/linux/sh/bits/fcntl.h6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/fcntl.h6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h6
-rw-r--r--sysdeps/x86_64/multiarch/init-arch.c1
-rw-r--r--sysdeps/x86_64/multiarch/init-arch.h32
-rw-r--r--sysdeps/x86_64/multiarch/strcasestr-c.c3
-rw-r--r--sysdeps/x86_64/multiarch/strstr-c.c6
21 files changed, 171 insertions, 84 deletions
diff --git a/ChangeLog b/ChangeLog
index ecde5fc9c7..47e7cbe260 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,66 @@
+2009-10-08  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #10730]
+	* stdlib/random_r.c (__initstate_r): Remove duplicate __set-errno.
+	Patch in part by Steve Ward <planet36@gmail.com>.
+
+	[BZ #10731]
+	* stdlib/rand_r.c: Fix typo.
+
+	* po/cs.po: Update from translation team.
+
+2009-10-06  Andreas Schwab  <schwab@redhat.com>
+
+	* elf/dl-load.c (_dl_map_object_from_fd): Close fd before
+	returning if RTLD_NOLOAD.
+
+2009-10-06  Roland McGrath  <roland@redhat.com>
+
+	* sysdeps/x86_64/multiarch/strstr-c.c
+	[! SHARED]: Omit libc_hidden_builtin_def fiddling.
+
+	* sysdeps/x86_64/multiarch/strcasestr-c.c: Remove
+	libc_hidden_builtin_def fiddling, does not apply to strcasestr at all.
+
+	* sysdeps/x86_64/multiarch/init-arch.h
+	[NOT_IN_libc] (__get_cpu_features): Define it as a macro.
+	(HAS_CPU_FEATURE): New macro.
+	(HAS_SSE2, HAS_POPCOUNT, HAS_SSE4_2, HAS_FMA): Use it.
+	* sysdeps/x86_64/multiarch/init-arch.c
+	(__get_cpu_features): #undef it before definition.
+
+2009-10-05  Andreas Schwab  <schwab@redhat.com>
+
+	* locale/C-time.c: Revert week-1stday back to 19971130 and set
+	first_weekday to 1 and first_workday to 2.
+
+2009-10-01  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Define F_SETOWN_EX and
+	F_GETOWN_EX.
+	* sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
+
+2009-09-28  Andreas Schwab  <schwab@redhat.com>
+
+	* stdio-common/printf_fp.c: Check for and avoid integer overflows.
+	* stdio-common/vfprintf.c: Likewise.
+
+2009-09-27  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* sysdeps/mach/hurd/mkdirat.c: Include <hurd/fd.h>.
+	(mkdirat): Call __directory_name_split_at instead of
+	__directory_name_split.
+
+2009-09-28  Ulrich Drepper  <drepper@redhat.com>
+
+	* locale/programs/locale-spec.c (locale_special): If nothing matches
+	fail with an appropriate message.
+
 2009-09-10  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* configure.in: Exclude binutils 2.X.  Support binutils 2.100
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 0b896d9b47..597193c043 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -903,9 +903,12 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
 #endif
 
   if (mode & RTLD_NOLOAD)
-    /* We are not supposed to load the object unless it is already
-       loaded.  So return now.  */
-    return NULL;
+    {
+      /* We are not supposed to load the object unless it is already
+	 loaded.  So return now.  */
+      __close (fd);
+      return NULL;
+    }
 
   /* Print debugging message.  */
   if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
diff --git a/locale/C-time.c b/locale/C-time.c
index a9275d9ebe..368ffce7ad 100644
--- a/locale/C-time.c
+++ b/locale/C-time.c
@@ -134,10 +134,10 @@ const struct locale_data _nl_C_LC_TIME attribute_hidden =
     { .wstr = (const uint32_t *) L"" },
     { .wstr = (const uint32_t *) L"" },
     { .string = "\7" },
-    { .word = 19971201 },
+    { .word = 19971130 },
     { .string = "\4" },
-    { .string = "\7" },
     { .string = "\1" },
+    { .string = "\2" },
     { .string = "\1" },
     { .string = "" },
     { .string = "%a %b %e %H:%M:%S %Z %Y" },
diff --git a/locale/programs/locale-spec.c b/locale/programs/locale-spec.c
index 6334f4c5ff..63a7a32e05 100644
--- a/locale/programs/locale-spec.c
+++ b/locale/programs/locale-spec.c
@@ -1,5 +1,5 @@
 /* Handle special requests.
-   Copyright (C) 1996, 1997, 1999, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1999, 2005, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
 
@@ -124,4 +124,7 @@ locale_special (const char *name, int show_category_name,
       return;
     }
 #endif
+
+  /* If nothing matches, fail.  */
+  error (1, 0, gettext ("unknown name \"%s\""), name);
 }
diff --git a/po/cs.po b/po/cs.po
index c11f3b2e1c..25742ce5e7 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -22,9 +22,9 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: libc 2.9.90\n"
+"Project-Id-Version: libc 2.10.1\n"
 "POT-Creation-Date: 2009-02-06 12:40-0800\n"
-"PO-Revision-Date: 2009-03-02 10:03+0100\n"
+"PO-Revision-Date: 2009-10-08 21:33+0200\n"
 "Last-Translator: Petr Pisar <petr.pisar@atlas.cz>\n"
 "Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n"
 "MIME-Version: 1.0\n"
@@ -4072,7 +4072,7 @@ msgid ""
 msgstr ""
 "konfigurace nscd:\n"
 "\n"
-"%15d  ladící úroveň serveru\n"
+"%15d  úroveň ladění serveru\n"
 
 #: nscd/nscd_stat.c:230
 #, c-format
@@ -4622,11 +4622,10 @@ msgstr "Neznámá chyba "
 msgid "Unknown error"
 msgstr "Neznámá chyba"
 
-# Signál reálného času %d"
 #: string/strsignal.c:65
 #, c-format
 msgid "Real-time signal %d"
-msgstr "Real-timeový signál %d"
+msgstr "Signál reálného času %d"
 
 #: string/strsignal.c:69
 #, c-format
@@ -5313,11 +5312,11 @@ msgstr "Potomek skončil (SIGCHLD)"
 
 #: sysdeps/generic/siglist.h:47 sysdeps/unix/siglist.c:47
 msgid "Stopped (tty input)"
-msgstr "Pozastaven (tty input) (SIGTTIN)"
+msgstr "Pozastaven (vstup TTY) (SIGTTIN)"
 
 #: sysdeps/generic/siglist.h:48 sysdeps/unix/siglist.c:48
 msgid "Stopped (tty output)"
-msgstr "Pozastaven (tty output) (SIGTTOU)"
+msgstr "Pozastaven (výstup TTY) (SIGTTOU)"
 
 #: sysdeps/generic/siglist.h:49 sysdeps/unix/siglist.c:49
 msgid "I/O possible"
@@ -5361,7 +5360,7 @@ msgstr "Chybné volání systému (SIGSYS)"
 
 #: sysdeps/generic/siglist.h:66
 msgid "Stack fault"
-msgstr "Porušen zásobník (SIGSTKFLT)\""
+msgstr "Porušen zásobník (SIGSTKFLT)"
 
 #: sysdeps/generic/siglist.h:69
 msgid "Information request"
@@ -5373,7 +5372,7 @@ msgstr "Výpadek napájení (SIGPWR)"
 
 #: sysdeps/generic/siglist.h:74 sysdeps/unix/siglist.c:55
 msgid "Resource lost"
-msgstr "Prostředek byl ztracen"
+msgstr "Prostředek byl ztracen (SIGLOST)"
 
 #. TRANS Operation not permitted; only the owner of the file (or other resource)
 #. TRANS or processes with special privileges can perform the operation.
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
index cd3ada6441..b60ddecef0 100644
--- a/stdio-common/printf_fp.c
+++ b/stdio-common/printf_fp.c
@@ -891,8 +891,15 @@ ___printf_fp (FILE *fp,
        it is possible that we need two more characters in front of all the
        other output.  If the amount of memory we have to allocate is too
        large use `malloc' instead of `alloca'.  */
-    size_t wbuffer_to_alloc = (2 + (size_t) chars_needed) * sizeof (wchar_t);
-    buffer_malloced = ! __libc_use_alloca (chars_needed * 2 * sizeof (wchar_t));
+    if (__builtin_expect (chars_needed >= (size_t) -1 / sizeof (wchar_t) - 2
+			  || chars_needed < fracdig_max, 0))
+      {
+	/* Some overflow occurred.  */
+	__set_errno (ERANGE);
+	return -1;
+      }
+    size_t wbuffer_to_alloc = (2 + chars_needed) * sizeof (wchar_t);
+    buffer_malloced = ! __libc_use_alloca (wbuffer_to_alloc);
     if (__builtin_expect (buffer_malloced, 0))
       {
 	wbuffer = (wchar_t *) malloc (wbuffer_to_alloc);
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 38ba8ffdcd..6e0e85cd7c 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -1439,23 +1439,29 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
 	    left = 1;
 	  }
 
-	if (width + 32 >= (int) (sizeof (work_buffer)
-				 / sizeof (work_buffer[0])))
+	if (__builtin_expect (width >= (size_t) -1 / sizeof (CHAR_T) - 32, 0))
+	  {
+	    __set_errno (ERANGE);
+	    done = -1;
+	    goto all_done;
+	  }
+
+	if (width >= sizeof (work_buffer) / sizeof (work_buffer[0]) - 32)
 	  {
 	    /* We have to use a special buffer.  The "32" is just a safe
 	       bet for all the output which is not counted in the width.  */
-	    if (__libc_use_alloca ((width + 32) * sizeof (CHAR_T)))
-	      workend = ((CHAR_T *) alloca ((width + 32) * sizeof (CHAR_T))
-			 + (width + 32));
+	    size_t needed = ((size_t) width + 32) * sizeof (CHAR_T);
+	    if (__libc_use_alloca (needed))
+	      workend = (CHAR_T *) alloca (needed) + width + 32;
 	    else
 	      {
-		workstart = (CHAR_T *) malloc ((width + 32) * sizeof (CHAR_T));
+		workstart = (CHAR_T *) malloc (needed);
 		if (workstart == NULL)
 		  {
 		    done = -1;
 		    goto all_done;
 		  }
-		workend = workstart + (width + 32);
+		workend = workstart + width + 32;
 	      }
 	  }
       }
@@ -1465,22 +1471,29 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
     LABEL (width):
       width = read_int (&f);
 
-      if (width + 32 >= (int) (sizeof (work_buffer) / sizeof (work_buffer[0])))
+      if (__builtin_expect (width >= (size_t) -1 / sizeof (CHAR_T) - 32, 0))
+	{
+	  __set_errno (ERANGE);
+	  done = -1;
+	  goto all_done;
+	}
+
+      if (width >= sizeof (work_buffer) / sizeof (work_buffer[0]) - 32)
 	{
 	  /* We have to use a special buffer.  The "32" is just a safe
 	     bet for all the output which is not counted in the width.  */
-	  if (__libc_use_alloca ((width + 32) * sizeof (CHAR_T)))
-	    workend = ((CHAR_T *) alloca ((width + 32) * sizeof (CHAR_T))
-		       + (width + 32));
+	  size_t needed = ((size_t) width + 32) * sizeof (CHAR_T);
+	  if (__libc_use_alloca (needed))
+	    workend = (CHAR_T *) alloca (needed) + width + 32;
 	  else
 	    {
-	      workstart = (CHAR_T *) malloc ((width + 32) * sizeof (CHAR_T));
+	      workstart = (CHAR_T *) malloc (needed);
 	      if (workstart == NULL)
 		{
 		  done = -1;
 		  goto all_done;
 		}
-	      workend = workstart + (width + 32);
+	      workend = workstart + width + 32;
 	    }
 	}
       if (*f == L_('$'))
@@ -1510,18 +1523,18 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
       else
 	prec = 0;
       if (prec > width
-	  && prec + 32 > (int)(sizeof (work_buffer) / sizeof (work_buffer[0])))
+	  && prec > sizeof (work_buffer) / sizeof (work_buffer[0]) - 32)
 	{
-	  if (__builtin_expect (prec > ~((size_t) 0) / sizeof (CHAR_T) - 31,
-				0))
+	  if (__builtin_expect (prec >= (size_t) -1 / sizeof (CHAR_T) - 32, 0))
 	    {
+	      __set_errno (ERANGE);
 	      done = -1;
 	      goto all_done;
 	    }
 	  size_t needed = ((size_t) prec + 32) * sizeof (CHAR_T);
 
 	  if (__libc_use_alloca (needed))
-	    workend = (((CHAR_T *) alloca (needed)) + ((size_t) prec + 32));
+	    workend = (CHAR_T *) alloca (needed) + prec + 32;
 	  else
 	    {
 	      workstart = (CHAR_T *) malloc (needed);
@@ -1530,7 +1543,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
 		  done = -1;
 		  goto all_done;
 		}
-	      workend = workstart + ((size_t) prec + 32);
+	      workend = workstart + prec + 32;
 	    }
 	}
       JUMP (*f, step2_jumps);
diff --git a/stdlib/rand_r.c b/stdlib/rand_r.c
index 3d49c92de6..6a35112f2f 100644
--- a/stdlib/rand_r.c
+++ b/stdlib/rand_r.c
@@ -1,5 +1,5 @@
-/* Reentrant random function frm POSIX.1c.
-   Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+/* Reentrant random function from POSIX.1c.
+   Copyright (C) 1996, 1999, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
diff --git a/stdlib/random_r.c b/stdlib/random_r.c
index a30055f598..90a157f9c1 100644
--- a/stdlib/random_r.c
+++ b/stdlib/random_r.c
@@ -255,10 +255,8 @@ __initstate_r (seed, arg_state, n, buf)
   else if (n < BREAK_1)
     {
       if (n < BREAK_0)
-	{
-	  __set_errno (EINVAL);
-	  goto fail;
-	}
+	goto fail;
+
       type = TYPE_0;
     }
   else
diff --git a/sysdeps/mach/hurd/mkdirat.c b/sysdeps/mach/hurd/mkdirat.c
index 321d59f2fd..a300745690 100644
--- a/sysdeps/mach/hurd/mkdirat.c
+++ b/sysdeps/mach/hurd/mkdirat.c
@@ -22,6 +22,7 @@
 #include <stddef.h>
 #include <sys/stat.h>
 #include <hurd.h>
+#include <hurd/fd.h>
 
 int
 mkdirat (fd, path, mode)
@@ -31,7 +32,7 @@ mkdirat (fd, path, mode)
 {
   error_t err;
   const char *name;
-  file_t parent = __directory_name_split (path, (char **) &name);
+  file_t parent = __directory_name_split_at (fd, path, (char **) &name);
   if (parent == MACH_PORT_NULL)
     return -1;
   err = __dir_mkdir (parent, name, mode & ~_hurd_umask);
diff --git a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
index 35ef665998..0138b69d78 100644
--- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
@@ -85,13 +85,15 @@
 #define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN	8	/* Get owner (process receiving SIGIO).  */
+# define F_GETOWN	9	/* Set owner (process receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG	10	/* Set number of signal to be sent.  */
 # define F_GETSIG	11	/* Get number of signal to be sent.  */
+# define F_SETOWN_EX	12	/* Get owner (thread receiving SIGIO).  */
+# define F_GETOWN_EX	13	/* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
index 6abc5ced65..b0af8697f8 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
@@ -81,13 +81,15 @@
 #define F_SETLKW64	7	/* Set record locking info (blocking).	*/
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN	8	/* Get owner (process receiving SIGIO).  */
+# define F_GETOWN	9	/* Set owner (process receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG	10	/* Set number of signal to be sent.  */
 # define F_GETSIG	11	/* Get number of signal to be sent.  */
+# define F_SETOWN_EX	12	/* Get owner (thread receiving SIGIO).  */
+# define F_GETOWN_EX	13	/* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
index 90b669ab60..f7ce2aacc8 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
@@ -85,13 +85,15 @@
 #define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN	8	/* Get owner (process receiving of SIGIO).  */
+# define F_GETOWN	9	/* Set owner (process receiving of SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG	10	/* Set number of signal to be sent.  */
 # define F_GETSIG	11	/* Get number of signal to be sent.  */
+# define F_SETOWN_EX	12	/* Get owner (thread receiving SIGIO).  */
+# define F_GETOWN_EX	13	/* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
index ff5941df65..0e6cbfda85 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
@@ -100,13 +100,15 @@
 #endif
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN	8	/* Get owner (process receiving SIGIO).  */
+# define F_GETOWN	9	/* Set owner (process receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG	10	/* Set number of signal to be sent.  */
 # define F_GETSIG	11	/* Get number of signal to be sent.  */
+# define F_SETOWN_EX	12	/* Get owner (thread receiving SIGIO).  */
+# define F_GETOWN_EX	13	/* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
index 35ef665998..dee02a101e 100644
--- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
@@ -85,13 +85,15 @@
 #define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN	8	/* Get owner (process receiving of SIGIO).  */
+# define F_GETOWN	9	/* Set owner (process receiving of SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG	10	/* Set number of signal to be sent.  */
 # define F_GETSIG	11	/* Get number of signal to be sent.  */
+# define F_SETOWN_EX	12	/* Get owner (thread receiving of SIGIO).  */
+# define F_GETOWN_EX	13	/* Set owner (thread receiving of SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
index d59744a55e..6d5e82676d 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -83,8 +83,8 @@
 #define F_GETFL		3	/* Get file status flags.  */
 #define F_SETFL		4	/* Set file status flags.  */
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_GETOWN	5	/* Get owner of socket (receiver of SIGIO).  */
-# define F_SETOWN	6	/* Set owner of socket (receiver of SIGIO).  */
+# define F_GETOWN	5	/* Get owner (process receiving SIGIO).  */
+# define F_SETOWN	6	/* Set owner (process receiving SIGIO).  */
 #endif
 #ifndef __USE_FILE_OFFSET64
 # define F_GETLK	7	/* Get record locking info.  */
@@ -99,6 +99,8 @@
 #ifdef __USE_GNU
 # define F_SETSIG	10	/* Set number of signal to be sent.  */
 # define F_GETSIG	11	/* Get number of signal to be sent.  */
+# define F_GETOWN_EX	12	/* Get owner (thread receiving SIGIO).  */
+# define F_SETOWN_EX	13	/* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
index bc0f4d687b..2041f5764e 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
@@ -99,13 +99,15 @@
 #endif
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN	8	/* Get owner (process receiving of SIGIO).  */
+# define F_GETOWN	9	/* Set owner (process receiving of SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG	10	/* Set number of signal to be sent.  */
 # define F_GETSIG	11	/* Get number of signal to be sent.  */
+# define F_SETOWN_EX	12	/* Get owner (thread receiving SIGIO).  */
+# define F_GETOWN_EX	13	/* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
diff --git a/sysdeps/x86_64/multiarch/init-arch.c b/sysdeps/x86_64/multiarch/init-arch.c
index 9a1e776c9a..7823aceb9b 100644
--- a/sysdeps/x86_64/multiarch/init-arch.c
+++ b/sysdeps/x86_64/multiarch/init-arch.c
@@ -77,6 +77,7 @@ __init_cpu_features (void)
     __cpu_features.kind = arch_kind_other;
 }
 
+#undef __get_cpu_features
 
 const struct cpu_features *
 __get_cpu_features (void)
diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h
index 8d9b1e8d8c..9b12831a6e 100644
--- a/sysdeps/x86_64/multiarch/init-arch.h
+++ b/sysdeps/x86_64/multiarch/init-arch.h
@@ -58,30 +58,16 @@ extern void __init_cpu_features (void) attribute_hidden;
 extern const struct cpu_features *__get_cpu_features (void)
      __attribute__ ((const));
 
-/* Following are the feature tests used throughout libc.  */
-
 #ifndef NOT_IN_libc
-# define HAS_SSE2 \
-  ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].edx & (1 << 26)) != 0)
-
-# define HAS_POPCOUNT \
-  ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 23)) != 0)
-
-# define HAS_SSE4_2 \
-  ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 20)) != 0)
-
-# define HAS_FMA \
-  ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 12)) != 0)
-#else
-# define HAS_SSE2 \
-  ((__get_cpu_features ()->cpuid[COMMON_CPUID_INDEX_1].edx & (1 << 26)) != 0)
+# define __get_cpu_features()	(&__cpu_features)
+#endif
 
-# define HAS_POPCOUNT \
-  ((__get_cpu_features ()->cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 23)) != 0)
+#define HAS_CPU_FEATURE(idx, reg, bit) \
+  ((__get_cpu_features ()->cpuid[idx].reg & (1 << (bit))) != 0)
 
-# define HAS_SSE4_2 \
-  ((__get_cpu_features ()->cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 20)) != 0)
+/* Following are the feature tests used throughout libc.  */
 
-# define HAS_FMA \
-  ((__get_cpu_features ()->cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 12)) != 0)
-#endif
+#define HAS_SSE2	HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, edx, 26)
+#define HAS_POPCOUNT	HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 23)
+#define HAS_SSE4_2	HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 20)
+#define HAS_FMA		HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 12)
diff --git a/sysdeps/x86_64/multiarch/strcasestr-c.c b/sysdeps/x86_64/multiarch/strcasestr-c.c
index 3cb5557b67..551492d8f5 100644
--- a/sysdeps/x86_64/multiarch/strcasestr-c.c
+++ b/sysdeps/x86_64/multiarch/strcasestr-c.c
@@ -1,9 +1,6 @@
 #include "init-arch.h"
 
 #define STRCASESTR __strcasestr_sse2
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name) \
-  __hidden_ver1 (__strcasestr_sse2, __GI_strcasestr, __strcasestr_sse2);
 
 #include "string/strcasestr.c"
 
diff --git a/sysdeps/x86_64/multiarch/strstr-c.c b/sysdeps/x86_64/multiarch/strstr-c.c
index d593089a87..b8ed3161d5 100644
--- a/sysdeps/x86_64/multiarch/strstr-c.c
+++ b/sysdeps/x86_64/multiarch/strstr-c.c
@@ -1,9 +1,11 @@
 #include "init-arch.h"
 
 #define STRSTR __strstr_sse2
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name) \
+#ifdef SHARED
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
   __hidden_ver1 (__strstr_sse2, __GI_strstr, __strstr_sse2);
+#endif
 
 #include "string/strstr.c"