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

[Commits] r23394 - in /fsf/trunk/libc: ./ dlfcn/ elf/ misc/ ports/ ports/sysdeps/aarch64/ ports/sysdeps/alpha/ ports/sysdeps/m68k/ por...



Author: eglibc
Date: Sat Jun 29 00:02:05 2013
New Revision: 23394

Log:
Import glibc-mainline for 2013-06-29

Added:
    fsf/trunk/libc/dlfcn/modstatic3.c
    fsf/trunk/libc/dlfcn/modstatic5.c
    fsf/trunk/libc/dlfcn/tststatic3.c
    fsf/trunk/libc/dlfcn/tststatic4.c
    fsf/trunk/libc/dlfcn/tststatic5.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/dlfcn/Makefile
    fsf/trunk/libc/elf/dl-load.c
    fsf/trunk/libc/elf/dl-open.c
    fsf/trunk/libc/elf/dl-profile.c
    fsf/trunk/libc/elf/dl-support.c
    fsf/trunk/libc/elf/dl-sysdep.c
    fsf/trunk/libc/misc/getauxval.c
    fsf/trunk/libc/ports/ChangeLog.aarch64
    fsf/trunk/libc/ports/ChangeLog.alpha
    fsf/trunk/libc/ports/ChangeLog.arm
    fsf/trunk/libc/ports/ChangeLog.m68k
    fsf/trunk/libc/ports/ChangeLog.mips
    fsf/trunk/libc/ports/sysdeps/aarch64/dl-machine.h
    fsf/trunk/libc/ports/sysdeps/alpha/dl-procinfo.h
    fsf/trunk/libc/ports/sysdeps/m68k/fpu_control.h
    fsf/trunk/libc/ports/sysdeps/mips/dl-procinfo.h
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
    fsf/trunk/libc/sysdeps/generic/dl-procinfo.h
    fsf/trunk/libc/sysdeps/generic/ldsodefs.h
    fsf/trunk/libc/sysdeps/i386/dl-procinfo.h
    fsf/trunk/libc/sysdeps/powerpc/Makefile
    fsf/trunk/libc/sysdeps/powerpc/bits/hwcap.h
    fsf/trunk/libc/sysdeps/powerpc/dl-procinfo.c
    fsf/trunk/libc/sysdeps/powerpc/dl-procinfo.h
    fsf/trunk/libc/sysdeps/powerpc/rtld-global-offsets.sym
    fsf/trunk/libc/sysdeps/s390/dl-procinfo.h
    fsf/trunk/libc/sysdeps/sparc/dl-procinfo.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/dl-procinfo.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/mmap64.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/dl-procinfo.h
    fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c
    fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h
    fsf/trunk/libc/sysdeps/x86_64/multiarch/strchr.S
    fsf/trunk/libc/sysdeps/x86_64/multiarch/strcmp.S
    fsf/trunk/libc/sysdeps/x86_64/multiarch/strrchr.S

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Jun 29 00:02:05 2013
@@ -1,3 +1,108 @@
+2013-06-28  Liubov Dmitrieva  <liubov.dmitrieva@xxxxxxxxx>
+
+	* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features): Set
+	bit_Slow_SSE4_2 and bit_Prefer_PMINUB_for_stringop for Intel
+	Silvermont.
+	* sysdeps/x86_64/multiarch/init-arch.h (bit_Slow_SSE4_2): New
+	macro.
+	(index_Slow_SSE4_2): Likewise.
+	(index_Prefer_PMINUB_for_stringop): Likewise.
+	* sysdeps/x86_64/multiarch/strchr.S: Skip SSE4.2 version if
+	bit_Slow_SSE4_2 is set.
+	* sysdeps/x86_64/multiarch/strcmp.S: Likewise.
+	* sysdeps/x86_64/multiarch/strrchr.S: Likewise.
+
+2013-06-28  Ryan S. Arnold  <rsa@xxxxxxxxxxxxxxxxxx>
+
+	* sysdeps/powerpc/Makefile: Add comment about generating an offset to
+	rtld_global._dl_hwcap2.
+	* sysdeps/powerpc/bits/hwcap.h: Added PPC_FEATURE2_* definitions for
+	POWER8.
+	* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Extend for
+	POWER8 feature descriptions defined in _dl_hwcap2.
+	* sysdeps/powerpc/dl-procinfo.h (_dl_procinfo): Implement AT_HWCAP2
+	string handling for POWER8 feature bits.
+	(_DL_HWCAP_COUNT): Increment to 64 to cover AT_HWCAP2 bits.
+	(_DL_HWCAP_LAST): New definition for position of last AT_HWCAP bit in
+	_dl_powerpc_cap_flags.
+	(_DL_HWCAP2_LAST): New definition for last usable bit of AT_HWCAP2.
+	* sysdeps/powerpc/rtld-global-offsets.sym
+	(RTLD_GLOBAL_RO_DL_HWCAP2_OFFSET): New offset macro to locate
+	_dl_hwcap2 in the rtld_global_ro structure.
+
+2013-06-28  Ryan S. Arnold  <rsa@xxxxxxxxxxxxxxxxxx>
+
+	* elf/dl-support.c (_dl_hwcap2): Add a new hwcap field for more
+	hardware capabilities in support of AT_HWCAP2.
+	(_dl_aux_init): Read AT_HWCAP2 into GLRO(dl_hwcap2).
+	* elf/dl-sysdep.c (_dl_sysdep_start): Read AT_HWCAP2 into
+	GLRO(dl_hwcap2).
+	(_dl_show_auxv): Add support for calling _dl_procinfo to display
+	AT_HWCAP2.  If a platform doesn't chose to handle displaying AT_HWCAP2
+	explicitly the unknown a_type display mechanism is used.
+	* misc/getauxval.c (__getauxval): Return GLRO(dl_hwcap2) on AT_HWCAP2.
+	* sysdeps/generic/ldsodefs.h (rtld_global_ro): Add _dl_hwcap2 as a new
+	struct member.
+	* sysdeps/generic/dl-procinfo.h (_dl_procinfo): Add TYPE parameter
+	to macro prototype for AT_HWCAP2 support.
+	* sysdeps/i386/dl-procinfo.h: Likewise.
+	* sysdeps/s390/dl-procinfo.h: Likewise.
+	* sysdeps/powerpc/dl-procinfo.h (_dl_procinfo): Add TYPE parameter to
+	macro prototype for AT_HWCAP2 support.  Make WORD unsigned long int
+	rather than signed int.  Stub in handler for TYPE == AT_HWCAP2 to
+	return -1 for unknown a_type display fallback.
+	* sysdeps/sparc/dl-procinfo.h: Likewise.
+	* sysdeps/unix/sysv/linux/i386/dl-procinfo.h: Likewise.
+	* sysdeps/unix/sysv/linux/s390/dl-procinfo.h: Likewise.
+
+2013-06-28  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Shift by page_shift
+	instead of MMAP2_PAGE_SHIFT in call to INLINE_SYSCALL.
+
+2013-06-28  Pierre Ynard  <linkfanel@xxxxxxxx>
+
+	[BZ #12492]
+	* elf/dl-load.c (_dl_map_object_from_fd): Test for failure of
+	mprotect making __stack_prot writable.
+
+2013-06-28  Nathan Froyd  <froydnj@xxxxxxxxxxxxxxxx>
+	    Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* elf/dl-profile.c (struct here_cg_arc_record): Declare 'count'
+	as being properly aligned.
+
+2013-06-28  Maciej W. Rozycki  <macro@xxxxxxxxxxxxxxxx>
+
+	* dlfcn/modstatic5.c: New file.
+	* dlfcn/tststatic5.c: New file.
+	* dlfcn/Makefile (tests): Add tststatic5.
+	(tests-static): Likewise.
+	(modules-names): Add modstatic5.
+	(tststatic5-ENV): New variable.
+	($(objpfx)tststatic5, $(objpfx)tststatic5.out): New dependencies.
+
+	[BZ #15022]
+	* elf/dl-support.c (_dl_main_map): New variable.
+	(_dl_ns): Use it to initialize [LM_ID_BASE] element.
+	(_dl_nns, _dl_load_adds): Set to 1.
+	(_dl_initial_searchlist): Refer to _dl_main_map.
+	(_dl_non_dynamic_init): Initialize _dl_main_map.l_origin.
+	* elf/dl-load.c (_dl_dst_substitute) [!SHARED]: Remove fallback
+	call to _dl_get_origin.
+	* elf/dl-open.c (dl_open_worker): Remove !SHARED special casing
+	around call_map.
+	(_dl_open) [!SHARED]: Remove code to initialize GL(dl_nns).
+	* dlfcn/modstatic3.c: New file.
+	* dlfcn/tststatic3.c: New file.
+	* dlfcn/tststatic4.c: New file.
+	* dlfcn/Makefile (tests): Add tststatic3 and tststatic4.
+	(tests-static): Likewise.
+	(modules-names): Add modstatic3.
+	(tststatic3-ENV, tststatic4-ENV): New variables.
+	($(objpfx)tststatic3, $(objpfx)tststatic3.out): New dependencies.
+	($(objpfx)tststatic4, $(objpfx)tststatic4.out): Likewise.
+
 2013-06-26  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* configure.in (CC): Require GCC version 4.4 or later.

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sat Jun 29 00:02:05 2013
@@ -10,18 +10,18 @@
 * The following bugs are resolved with this release:
 
   2546, 2560, 5159, 6809, 7006, 10060, 10062, 10283, 10357, 10686, 11120,
-  11561, 12310, 12387, 12515, 12723, 13550, 13889, 13951, 13988, 14142,
-  14176, 14200, 14256, 14280, 14293, 14317, 14327, 14478, 14496, 14582,
-  14686, 14812, 14888, 14894, 14907, 14908, 14909, 14920, 14952, 14964,
-  14981, 14982, 14985, 14991, 14994, 14996, 15000, 15003, 15006, 15007,
-  15014, 15020, 15023, 15036, 15054, 15055, 15062, 15078, 15084, 15085,
-  15086, 15100, 15160, 15214, 15221, 15232, 15234, 15283, 15285, 15287,
-  15304, 15305, 15307, 15309, 15327, 15330, 15335, 15336, 15337, 15339,
-  15342, 15346, 15359, 15361, 15366, 15380, 15381, 15394, 15395, 15405,
-  15406, 15409, 15416, 15418, 15419, 15423, 15424, 15426, 15429, 15431,
-  15432, 15441, 15442, 15448, 15465, 15480, 15485, 15488, 15490, 15492,
-  15493, 15497, 15506, 15529, 15536, 15553, 15577, 15583, 15618, 15627,
-  15631, 15654, 15655, 15666, 15667, 15674.
+  11561, 12310, 12387, 12492, 12515, 12723, 13550, 13889, 13951, 13988,
+  14142, 14176, 14200, 14256, 14280, 14293, 14317, 14327, 14478, 14496,
+  14582, 14686, 14812, 14888, 14894, 14907, 14908, 14909, 14920, 14952,
+  14964, 14981, 14982, 14985, 14991, 14994, 14996, 15000, 15003, 15006,
+  15007, 15014, 15020, 15022, 15023, 15036, 15054, 15055, 15062, 15078,
+  15084, 15085, 15086, 15100, 15160, 15214, 15221, 15232, 15234, 15283,
+  15285, 15287, 15304, 15305, 15307, 15309, 15327, 15330, 15335, 15336,
+  15337, 15339, 15342, 15346, 15359, 15361, 15366, 15380, 15381, 15394,
+  15395, 15405, 15406, 15409, 15416, 15418, 15419, 15423, 15424, 15426,
+  15429, 15431, 15432, 15441, 15442, 15448, 15465, 15480, 15485, 15488,
+  15490, 15492, 15493, 15497, 15506, 15529, 15536, 15553, 15577, 15583,
+  15618, 15627, 15631, 15654, 15655, 15666, 15667, 15674.
 
 * CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
   #15078).
@@ -38,6 +38,21 @@
 
 * Support for priority inherited mutexes in pthread condition variables on
   non-x86 architectures.
+
+* Port to Xilinx MicroBlaze contributed by David Holsgrove.
+
+* Optimized string functions for AArch64.  Implemented by Marcus Shawcroft.
+
+* Optimized string functions for ARM.  Implemented by Will Newton and
+  Richard Henderson.
+
+* Optimized libm functions for SPARC.  Implemented by David S. Miller.
+
+* Support for building more of ARM glibc as Thumb-2 code.  Implemented by
+  Richard Henderson.
+
+* Support for building most of MIPS glibc as MIPS16 code.  Implemented by
+  Chung-Lin Tang, Maciej W. Rozycki and Maxim Kuvyrkov.
 
 * Added a benchmark framework to track performance of functions in glibc.
 

Modified: fsf/trunk/libc/dlfcn/Makefile
==============================================================================
--- fsf/trunk/libc/dlfcn/Makefile (original)
+++ fsf/trunk/libc/dlfcn/Makefile Sat Jun 29 00:02:05 2013
@@ -47,11 +47,14 @@
 errmsg1mod.so-no-z-defs = yes
 
 ifeq (yes,$(build-shared))
-tests += tststatic tststatic2
-tests-static += tststatic tststatic2
-modules-names += modstatic modstatic2
+tests += tststatic tststatic2 tststatic3 tststatic4 tststatic5
+tests-static += tststatic tststatic2 tststatic3 tststatic4 tststatic5
+modules-names += modstatic modstatic2 modstatic3 modstatic5
 tststatic-ENV = LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
 tststatic2-ENV = $(tststatic-ENV)
+tststatic3-ENV = $(tststatic-ENV)
+tststatic4-ENV = $(tststatic-ENV)
+tststatic5-ENV = $(tststatic-ENV)
 endif
 
 extra-test-objs += $(modules-names:=.os)
@@ -104,6 +107,15 @@
 
 $(objpfx)modstatic2.so: $(libdl)
 
+$(objpfx)tststatic3: $(objpfx)libdl.a
+$(objpfx)tststatic3.out: $(objpfx)tststatic3 $(objpfx)modstatic3.so
+
+$(objpfx)tststatic4: $(objpfx)libdl.a
+$(objpfx)tststatic4.out: $(objpfx)tststatic4 $(objpfx)modstatic3.so
+
+$(objpfx)tststatic5: $(objpfx)libdl.a
+$(objpfx)tststatic5.out: $(objpfx)tststatic5 $(objpfx)modstatic5.so
+
 $(objpfx)bug-dlopen1: $(libdl)
 
 $(objpfx)bug-dlsym1: $(libdl) $(objpfx)bug-dlsym1-lib2.so

Added: fsf/trunk/libc/dlfcn/modstatic3.c
==============================================================================
--- fsf/trunk/libc/dlfcn/modstatic3.c (added)
+++ fsf/trunk/libc/dlfcn/modstatic3.c Sat Jun 29 00:02:05 2013
@@ -1,0 +1,31 @@
+/* DSO used for dlopen testing with a static executable.
+   Copyright (C) 2013 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+unsigned int foo;
+
+unsigned int
+getfoo (void)
+{
+  return foo;
+}
+
+void
+setfoo (unsigned int f)
+{
+  foo = f;
+}

Added: fsf/trunk/libc/dlfcn/modstatic5.c
==============================================================================
--- fsf/trunk/libc/dlfcn/modstatic5.c (added)
+++ fsf/trunk/libc/dlfcn/modstatic5.c Sat Jun 29 00:02:05 2013
@@ -1,0 +1,26 @@
+/* DSO used for GLRO(dl_pagesize) initialization testing with a static
+   executable.
+   Copyright (C) 2013 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <unistd.h>
+
+int
+my_getpagesize (void)
+{
+  return getpagesize ();
+}

Added: fsf/trunk/libc/dlfcn/tststatic3.c
==============================================================================
--- fsf/trunk/libc/dlfcn/tststatic3.c (added)
+++ fsf/trunk/libc/dlfcn/tststatic3.c Sat Jun 29 00:02:05 2013
@@ -1,0 +1,128 @@
+/* Global-scope DSO mapping test with a static executable (BZ #15022).
+   Copyright (C) 2013 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <dlfcn.h>
+#include <stddef.h>
+#include <stdio.h>
+
+#define MAGIC0 0
+#define MAGIC1 0x5500ffaa
+#define MAGIC2 0xaaff0055
+
+/* Mapping a DSO into the global scope used to crash in static
+   executables.  Check that it succeeds and then that symbols from
+   the DSO can be accessed and operate as expected.  */
+static int
+do_test (void)
+{
+  unsigned int (*getfoo) (void);
+  void (*setfoo) (unsigned int);
+  unsigned int *foop;
+  unsigned int foo;
+  void *handle;
+
+  /* Try to map a module into the global scope.  */
+  handle = dlopen ("modstatic3.so", RTLD_LAZY | RTLD_GLOBAL);
+  if (handle == NULL)
+    {
+      printf ("dlopen (modstatic3.so): %s\n", dlerror ());
+      return 1;
+    }
+
+  /* Get at its symbols.  */
+  foop = dlsym (handle, "foo");
+  if (foop == NULL)
+    {
+      printf ("dlsym (foo): %s\n", dlerror ());
+      return 1;
+    }
+
+  getfoo = dlsym (handle, "getfoo");
+  if (getfoo == NULL)
+    {
+      printf ("dlsym (getfoo): %s\n", dlerror ());
+      return 1;
+    }
+
+  setfoo = dlsym (handle, "setfoo");
+  if (setfoo == NULL)
+    {
+      printf ("dlsym (setfoo): %s\n", dlerror ());
+      return 1;
+    }
+
+  /* Make sure the view of the initial state is consistent.  */
+  foo = *foop;
+  if (foo != MAGIC0)
+    {
+      printf ("*foop: got %#x, expected %#x\n", foo, MAGIC0);
+      return 1;
+    }
+
+  foo = getfoo ();
+  if (foo != MAGIC0)
+    {
+      printf ("getfoo: got %#x, expected %#x\n", foo, MAGIC0);
+      return 1;
+    }
+
+  /* Likewise with one change to its state.  */
+  setfoo (MAGIC1);
+
+  foo = *foop;
+  if (foo != MAGIC1)
+    {
+      printf ("*foop: got %#x, expected %#x\n", foo, MAGIC1);
+      return 1;
+    }
+
+  foo = getfoo ();
+  if (foo != MAGIC1)
+    {
+      printf ("getfoo: got %#x, expected %#x\n", foo, MAGIC1);
+      return 1;
+    }
+
+  /* And with another.  */
+  setfoo (MAGIC2);
+
+  foo = *foop;
+  if (foo != MAGIC2)
+    {
+      printf ("*foop: got %#x, expected %#x\n", foo, MAGIC2);
+      return 1;
+    }
+
+  foo = getfoo ();
+  if (foo != MAGIC2)
+    {
+      printf ("getfoo: got %#x, expected %#x\n", foo, MAGIC2);
+      return 1;
+    }
+
+  /* All done, clean up.  */
+  getfoo = NULL;
+  setfoo = NULL;
+  foop = NULL;
+  dlclose (handle);
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Added: fsf/trunk/libc/dlfcn/tststatic4.c
==============================================================================
--- fsf/trunk/libc/dlfcn/tststatic4.c (added)
+++ fsf/trunk/libc/dlfcn/tststatic4.c Sat Jun 29 00:02:05 2013
@@ -1,0 +1,363 @@
+/* Global object symbol access tests with a static executable (BZ #15022).
+   Copyright (C) 2013 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <dlfcn.h>
+#include <stddef.h>
+#include <stdio.h>
+
+#define MAGIC0 0
+#define MAGIC1 0x5500ffaa
+#define MAGIC2 0xaaff0055
+#define MAGIC3 0xff55aa00
+
+/* Check the ability to access the global symbol object and then
+   global-scope symbol access consistency via different mappings
+   requested from a static executable.  */
+static int
+do_test (void)
+{
+  unsigned int (*initial_getfoo) (void);
+  void (*initial_setfoo) (unsigned int);
+  unsigned int (*global_getfoo) (void);
+  void (*global_setfoo) (unsigned int);
+  unsigned int (*local_getfoo) (void);
+  void (*local_setfoo) (unsigned int);
+  unsigned int *initial_foop;
+  unsigned int *global_foop;
+  unsigned int *local_foop;
+  void *initial_handle;
+  void *global_handle;
+  void *local_handle;
+  unsigned int foo;
+
+  /* Try to map self.  */
+  initial_handle = dlopen (NULL, RTLD_LAZY | RTLD_GLOBAL);
+  if (initial_handle == NULL)
+    {
+      printf ("dlopen [initial] (NULL): %s\n", dlerror ());
+      return 1;
+    }
+
+  /* Make sure symbol lookups fail gracefully.  */
+  initial_foop = dlsym (initial_handle, "foo");
+  if (initial_foop != NULL)
+    {
+      printf ("dlsym [initial] (foo): got %p, expected NULL\n", initial_foop);
+      return 1;
+    }
+
+  initial_getfoo = dlsym (initial_handle, "getfoo");
+  if (initial_getfoo != NULL)
+    {
+      printf ("dlsym [initial] (getfoo): got %p, expected NULL\n",
+	      initial_getfoo);
+      return 1;
+    }
+
+  initial_setfoo = dlsym (initial_handle, "setfoo");
+  if (initial_setfoo != NULL)
+    {
+      printf ("dlsym [initial] (setfoo): got %p, expected NULL\n",
+	      initial_setfoo);
+      return 1;
+    }
+
+  /* Try to map a module into the global scope.  */
+  global_handle = dlopen ("modstatic3.so", RTLD_LAZY | RTLD_GLOBAL);
+  if (global_handle == NULL)
+    {
+      printf ("dlopen [global] (modstatic3.so): %s\n", dlerror ());
+      return 1;
+    }
+
+  /* Get at its symbols.  */
+  global_foop = dlsym (global_handle, "foo");
+  if (global_foop == NULL)
+    {
+      printf ("dlsym [global] (foo): %s\n", dlerror ());
+      return 1;
+    }
+
+  global_getfoo = dlsym (global_handle, "getfoo");
+  if (global_getfoo == NULL)
+    {
+      printf ("dlsym [global] (getfoo): %s\n", dlerror ());
+      return 1;
+    }
+
+  global_setfoo = dlsym (global_handle, "setfoo");
+  if (global_setfoo == NULL)
+    {
+      printf ("dlsym [global] (setfoo): %s\n", dlerror ());
+      return 1;
+    }
+
+  /* Try to map self again now.  */
+  local_handle = dlopen (NULL, RTLD_LAZY | RTLD_LOCAL);
+  if (local_handle == NULL)
+    {
+      printf ("dlopen [local] (NULL): %s\n", dlerror ());
+      return 1;
+    }
+
+  /* Make sure we can get at the previously loaded module's symbols
+     via this handle too.  */
+  local_foop = dlsym (local_handle, "foo");
+  if (local_foop == NULL)
+    {
+      printf ("dlsym [local] (foo): %s\n", dlerror ());
+      return 1;
+    }
+
+  local_getfoo = dlsym (local_handle, "getfoo");
+  if (local_getfoo == NULL)
+    {
+      printf ("dlsym [local] (getfoo): %s\n", dlerror ());
+      return 1;
+    }
+
+  local_setfoo = dlsym (local_handle, "setfoo");
+  if (local_setfoo == NULL)
+    {
+      printf ("dlsym [local] (setfoo): %s\n", dlerror ());
+      return 1;
+    }
+
+  /* Make sure we can get at the previously loaded module's symbols
+     via a handle that was obtained before the module was loaded too.  */
+  initial_foop = dlsym (initial_handle, "foo");
+  if (initial_foop == NULL)
+    {
+      printf ("dlsym [initial] (foo): %s\n", dlerror ());
+      return 1;
+    }
+
+  initial_getfoo = dlsym (initial_handle, "getfoo");
+  if (initial_getfoo == NULL)
+    {
+      printf ("dlsym [initial] (getfoo): %s\n", dlerror ());
+      return 1;
+    }
+
+  initial_setfoo = dlsym (initial_handle, "setfoo");
+  if (initial_setfoo == NULL)
+    {
+      printf ("dlsym [initial] (setfoo): %s\n", dlerror ());
+      return 1;
+    }
+
+  /* Make sure the view of the initial state is consistent.  */
+  foo = *initial_foop;
+  if (foo != MAGIC0)
+    {
+      printf ("*foop [initial]: got %#x, expected %#x\n", foo, MAGIC0);
+      return 1;
+    }
+
+  foo = *global_foop;
+  if (foo != MAGIC0)
+    {
+      printf ("*foop [global]: got %#x, expected %#x\n", foo, MAGIC0);
+      return 1;
+    }
+
+  foo = *local_foop;
+  if (foo != MAGIC0)
+    {
+      printf ("*foop [local]: got %#x, expected %#x\n", foo, MAGIC0);
+      return 1;
+    }
+
+  foo = initial_getfoo ();
+  if (foo != MAGIC0)
+    {
+      printf ("getfoo [initial]: got %#x, expected %#x\n", foo, MAGIC0);
+      return 1;
+    }
+
+  foo = global_getfoo ();
+  if (foo != MAGIC0)
+    {
+      printf ("getfoo [global]: got %#x, expected %#x\n", foo, MAGIC0);
+      return 1;
+    }
+
+  foo = local_getfoo ();
+  if (foo != MAGIC0)
+    {
+      printf ("getfoo [local]: got %#x, expected %#x\n", foo, MAGIC0);
+      return 1;
+    }
+
+  /* Likewise with a change to its state made through the first handle.  */
+  initial_setfoo (MAGIC1);
+
+  foo = *initial_foop;
+  if (foo != MAGIC1)
+    {
+      printf ("*foop [initial]: got %#x, expected %#x\n", foo, MAGIC1);
+      return 1;
+    }
+
+  foo = *global_foop;
+  if (foo != MAGIC1)
+    {
+      printf ("*foop [global]: got %#x, expected %#x\n", foo, MAGIC1);
+      return 1;
+    }
+
+  foo = *local_foop;
+  if (foo != MAGIC1)
+    {
+      printf ("*foop [local]: got %#x, expected %#x\n", foo, MAGIC1);
+      return 1;
+    }
+
+  foo = initial_getfoo ();
+  if (foo != MAGIC1)
+    {
+      printf ("getfoo [initial]: got %#x, expected %#x\n", foo, MAGIC1);
+      return 1;
+    }
+
+  foo = global_getfoo ();
+  if (foo != MAGIC1)
+    {
+      printf ("getfoo [global]: got %#x, expected %#x\n", foo, MAGIC1);
+      return 1;
+    }
+
+  foo = local_getfoo ();
+  if (foo != MAGIC1)
+    {
+      printf ("getfoo [local]: got %#x, expected %#x\n", foo, MAGIC1);
+      return 1;
+    }
+
+  /* Likewise with a change to its state made through the second handle.  */
+  global_setfoo (MAGIC2);
+
+  foo = *initial_foop;
+  if (foo != MAGIC2)
+    {
+      printf ("*foop [initial]: got %#x, expected %#x\n", foo, MAGIC2);
+      return 1;
+    }
+
+  foo = *global_foop;
+  if (foo != MAGIC2)
+    {
+      printf ("*foop [global]: got %#x, expected %#x\n", foo, MAGIC2);
+      return 1;
+    }
+
+  foo = *local_foop;
+  if (foo != MAGIC2)
+    {
+      printf ("*foop [local]: got %#x, expected %#x\n", foo, MAGIC2);
+      return 1;
+    }
+
+  foo = initial_getfoo ();
+  if (foo != MAGIC2)
+    {
+      printf ("getfoo [initial]: got %#x, expected %#x\n", foo, MAGIC2);
+      return 1;
+    }
+
+  foo = global_getfoo ();
+  if (foo != MAGIC2)
+    {
+      printf ("getfoo [global]: got %#x, expected %#x\n", foo, MAGIC2);
+      return 1;
+    }
+
+  foo = local_getfoo ();
+  if (foo != MAGIC2)
+    {
+      printf ("getfoo [local]: got %#x, expected %#x\n", foo, MAGIC2);
+      return 1;
+    }
+
+  /* Likewise with a change to its state made through the third handle.  */
+  local_setfoo (MAGIC3);
+
+  foo = *initial_foop;
+  if (foo != MAGIC3)
+    {
+      printf ("*foop [initial]: got %#x, expected %#x\n", foo, MAGIC3);
+      return 1;
+    }
+
+  foo = *global_foop;
+  if (foo != MAGIC3)
+    {
+      printf ("*foop [global]: got %#x, expected %#x\n", foo, MAGIC3);
+      return 1;
+    }
+
+  foo = *local_foop;
+  if (foo != MAGIC3)
+    {
+      printf ("*foop [local]: got %#x, expected %#x\n", foo, MAGIC3);
+      return 1;
+    }
+
+  foo = initial_getfoo ();
+  if (foo != MAGIC3)
+    {
+      printf ("getfoo [initial]: got %#x, expected %#x\n", foo, MAGIC3);
+      return 1;
+    }
+
+  foo = global_getfoo ();
+  if (foo != MAGIC3)
+    {
+      printf ("getfoo [global]: got %#x, expected %#x\n", foo, MAGIC3);
+      return 1;
+    }
+
+  foo = local_getfoo ();
+  if (foo != MAGIC3)
+    {
+      printf ("getfoo [local]: got %#x, expected %#x\n", foo, MAGIC3);
+      return 1;
+    }
+
+  /* All done, clean up.  */
+  initial_getfoo = NULL;
+  initial_setfoo = NULL;
+  initial_foop = NULL;
+
+  local_getfoo = NULL;
+  local_setfoo = NULL;
+  local_foop = NULL;
+  dlclose (local_handle);
+
+  global_getfoo = NULL;
+  global_setfoo = NULL;
+  global_foop = NULL;
+  dlclose (global_handle);
+
+  dlclose (initial_handle);
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Added: fsf/trunk/libc/dlfcn/tststatic5.c
==============================================================================
--- fsf/trunk/libc/dlfcn/tststatic5.c (added)
+++ fsf/trunk/libc/dlfcn/tststatic5.c Sat Jun 29 00:02:05 2013
@@ -1,0 +1,76 @@
+/* GLRO(dl_pagesize) initialization DSO test with a static executable.
+   Copyright (C) 2013 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <dlfcn.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <unistd.h>
+
+/* Check that the same page size is reported both directly and by a DSO
+   mapped from a static executable.
+
+   On targets that support different page sizes, the kernel communicates
+   the size currently in use via the auxiliary vector.  This vector is
+   available to initial startup, but not any DSOs loaded later on.  As
+   static executables do not export their symbols a DSO cannot access
+   the value obtained by initial startup and the value therefore has to
+   be passed on to the DSO and stored within its data area explicitly.
+   This is performed by a call to DL_STATIC_INIT that is defined in a
+   target-dependent way, and that on variable page size targets stores
+   it in the GLRO(dl_pagesize) variable of the DSO's dynamic linker.  */
+static int
+do_test (void)
+{
+  int pagesize = getpagesize ();
+  int (*my_getpagesize) (void);
+  int my_pagesize;
+  void *handle;
+
+  /* Try to map a module.  */
+  handle = dlopen ("modstatic5.so", RTLD_LAZY | RTLD_LOCAL);
+  if (handle == NULL)
+    {
+      printf ("dlopen (modstatic5.so): %s\n", dlerror ());
+      return 1;
+    }
+
+  /* Get at its symbol.  */
+  my_getpagesize = dlsym (handle, "my_getpagesize");
+  if (my_getpagesize == NULL)
+    {
+      printf ("dlsym (my_getpagesize): %s\n", dlerror ());
+      return 1;
+    }
+
+  /* Make sure the page size reported is the same either way.  */
+  my_pagesize = my_getpagesize ();
+  if (my_pagesize != pagesize)
+    {
+      printf ("my_getpagesize: got %i, expected %i\n", my_pagesize, pagesize);
+      return 1;
+    }
+
+  /* All done, clean up.  */
+  my_getpagesize = NULL;
+  dlclose (handle);
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/elf/dl-load.c
==============================================================================
--- fsf/trunk/libc/elf/dl-load.c (original)
+++ fsf/trunk/libc/elf/dl-load.c Sat Jun 29 00:02:05 2013
@@ -342,13 +342,7 @@
 	  if ((len = is_dst (start, name, "ORIGIN", is_path,
 			     INTUSE(__libc_enable_secure))) != 0)
 	    {
-#ifndef SHARED
-	      if (l == NULL)
-		repl = _dl_get_origin ();
-	      else
-#endif
-		repl = l->l_origin;
-
+	      repl = l->l_origin;
 	      check_for_trusted = (INTUSE(__libc_enable_secure)
 				   && l->l_type == lt_executable);
 	    }
@@ -1493,7 +1487,11 @@
 	  if (__builtin_expect (p + s <= relro_end, 1))
 	    {
 	      /* The variable lies in the region protected by RELRO.  */
-	      __mprotect ((void *) p, s, PROT_READ|PROT_WRITE);
+	      if (__mprotect ((void *) p, s, PROT_READ|PROT_WRITE) < 0)
+		{
+		  errstring = N_("cannot change memory protections");
+		  goto call_lose_errno;
+		}
 	      __stack_prot |= PROT_READ|PROT_WRITE|PROT_EXEC;
 	      __mprotect ((void *) p, s, PROT_READ);
 	    }

Modified: fsf/trunk/libc/elf/dl-open.c
==============================================================================
--- fsf/trunk/libc/elf/dl-open.c (original)
+++ fsf/trunk/libc/elf/dl-open.c Sat Jun 29 00:02:05 2013
@@ -204,11 +204,9 @@
     {
       const void *caller_dlopen = args->caller_dlopen;
 
-#ifdef SHARED
       /* We have to find out from which object the caller is calling.
 	 By default we assume this is the main application.  */
       call_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
-#endif
 
       struct link_map *l = _dl_find_dso_for_object ((ElfW(Addr)) caller_dlopen);
 
@@ -216,15 +214,7 @@
         call_map = l;
 
       if (args->nsid == __LM_ID_CALLER)
-	{
-#ifndef SHARED
-	  /* In statically linked apps there might be no loaded object.  */
-	  if (call_map == NULL)
-	    args->nsid = LM_ID_BASE;
-	  else
-#endif
-	    args->nsid = call_map->l_ns;
-	}
+	args->nsid = call_map->l_ns;
     }
 
   assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT);
@@ -642,12 +632,6 @@
 	       || GL(dl_ns)[nsid]._ns_loaded->l_auditing))
     _dl_signal_error (EINVAL, file, NULL,
 		      N_("invalid target namespace in dlmopen()"));
-#ifndef SHARED
-  else if ((nsid == LM_ID_BASE || nsid == __LM_ID_CALLER)
-	   && GL(dl_ns)[LM_ID_BASE]._ns_loaded == NULL
-	   && GL(dl_nns) == 0)
-    GL(dl_nns) = 1;
-#endif
 
   struct dl_open_args args;
   args.file = file;

Modified: fsf/trunk/libc/elf/dl-profile.c
==============================================================================
--- fsf/trunk/libc/elf/dl-profile.c (original)
+++ fsf/trunk/libc/elf/dl-profile.c Sat Jun 29 00:02:05 2013
@@ -131,7 +131,18 @@
   {
     uintptr_t from_pc;
     uintptr_t self_pc;
-    uint32_t count;
+    /* The count field is atomically incremented in _dl_mcount, which
+       requires it to be properly aligned for its type, and for this
+       alignment to be visible to the compiler.  The amount of data
+       before an array of this structure is calculated as
+       expected_size in _dl_start_profile.  Everything in that
+       calculation is a multiple of 4 bytes (in the case of
+       kcountsize, because it is derived from a subtraction of
+       page-aligned values, and the corresponding calculation in
+       __monstartup also ensures it is at least a multiple of the size
+       of u_long), so all copies of this field do in fact have the
+       appropriate alignment.  */
+    uint32_t count __attribute__ ((aligned (__alignof__ (uint32_t))));
   } __attribute__ ((packed));
 
 static struct here_cg_arc_record *data;

Modified: fsf/trunk/libc/elf/dl-support.c
==============================================================================
--- fsf/trunk/libc/elf/dl-support.c (original)
+++ fsf/trunk/libc/elf/dl-support.c Sat Jun 29 00:02:05 2013
@@ -70,17 +70,52 @@
 /* Nonzero if runtime lookup should not update the .got/.plt.  */
 int _dl_bind_not;
 
+/* A dummy link map for the executable, used by dlopen to access the global
+   scope.  We don't export any symbols ourselves, so this can be minimal.  */
+static struct link_map _dl_main_map =
+  {
+    .l_name = (char *) "",
+    .l_real = &_dl_main_map,
+    .l_ns = LM_ID_BASE,
+    .l_libname = &(struct libname_list) { .name = "", .dont_free = 1 },
+    .l_searchlist =
+      {
+	.r_list = &(struct link_map *) { &_dl_main_map },
+	.r_nlist = 1,
+      },
+    .l_symbolic_searchlist = { .r_list = &(struct link_map *) { NULL } },
+    .l_type = lt_executable,
+    .l_scope_mem = { &_dl_main_map.l_searchlist },
+    .l_scope_max = (sizeof (_dl_main_map.l_scope_mem)
+		    / sizeof (_dl_main_map.l_scope_mem[0])),
+    .l_scope = _dl_main_map.l_scope_mem,
+    .l_local_scope = { &_dl_main_map.l_searchlist },
+    .l_used = 1,
+    .l_tls_offset = NO_TLS_OFFSET,
+    .l_serial = 1,
+  };
+
 /* Namespace information.  */
-struct link_namespaces _dl_ns[DL_NNS];
-size_t _dl_nns;
+struct link_namespaces _dl_ns[DL_NNS] =
+  {
+    [LM_ID_BASE] =
+      {
+	._ns_loaded = &_dl_main_map,
+	._ns_nloaded = 1,
+	._ns_main_searchlist = &_dl_main_map.l_searchlist,
+      }
+  };
+size_t _dl_nns = 1;
 
 /* Incremented whenever something may have been added to dl_loaded. */
-unsigned long long _dl_load_adds;
-
-/* Fake scope.  In dynamically linked binaries this is the scope of the
-   main application but here we don't have something like this.  So
-   create a fake scope containing nothing.  */
-struct r_scope_elem _dl_initial_searchlist;
+unsigned long long _dl_load_adds = 1;
+
+/* Fake scope of the main application.  */
+struct r_scope_elem _dl_initial_searchlist =
+  {
+    .r_list = &(struct link_map *) { &_dl_main_map },
+    .r_nlist = 1,
+  };
 
 #ifndef HAVE_INLINED_SYSCALLS
 /* Nonzero during startup.  */
@@ -130,6 +165,7 @@
 const ElfW(Phdr) *_dl_phdr;
 size_t _dl_phnum;
 uint64_t _dl_hwcap __attribute__ ((nocommon));
+uint64_t _dl_hwcap2 __attribute__ ((nocommon));
 
 /* This is not initialized to HWCAP_IMPORTANT, matching the definition
    of _dl_important_hwcaps, below, where no hwcap strings are ever
@@ -213,6 +249,9 @@
 	break;
       case AT_HWCAP:
 	GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val;
+	break;
+      case AT_HWCAP2:
+	GLRO(dl_hwcap2) = (unsigned long int) av->a_un.a_val;
 	break;
 #ifdef NEED_DL_SYSINFO
       case AT_SYSINFO:
@@ -265,6 +304,8 @@
 internal_function
 _dl_non_dynamic_init (void)
 {
+  _dl_main_map.l_origin = _dl_get_origin ();
+
   if (HP_TIMING_AVAIL)
     HP_TIMING_NOW (_dl_cpuclock_offset);
 

Modified: fsf/trunk/libc/elf/dl-sysdep.c
==============================================================================
--- fsf/trunk/libc/elf/dl-sysdep.c (original)
+++ fsf/trunk/libc/elf/dl-sysdep.c Sat Jun 29 00:02:05 2013
@@ -155,6 +155,9 @@
 	break;
       case AT_HWCAP:
 	GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val;
+	break;
+      case AT_HWCAP2:
+	GLRO(dl_hwcap2) = (unsigned long int) av->a_un.a_val;
 	break;
       case AT_CLKTCK:
 	GLRO(dl_clktck) = av->a_un.a_val;
@@ -303,6 +306,7 @@
 	  [AT_SYSINFO - 2] =		{ "SYSINFO:      0x", hex },
 	  [AT_SYSINFO_EHDR - 2] =	{ "SYSINFO_EHDR: 0x", hex },
 	  [AT_RANDOM - 2] =		{ "RANDOM:       0x", hex },
+	  [AT_HWCAP2 - 2] =		{ "HWCAP2:       0x", hex },
 	};
       unsigned int idx = (unsigned int) (av->a_type - 2);
 
@@ -314,10 +318,10 @@
       assert (AT_NULL == 0);
       assert (AT_IGNORE == 1);
 
-      if (av->a_type == AT_HWCAP)
+      if (av->a_type == AT_HWCAP || av->a_type == AT_HWCAP2)
 	{
-	  /* This is handled special.  */
-	  if (_dl_procinfo (av->a_un.a_val) == 0)
+	  /* These are handled in a special way per platform.  */
+	  if (_dl_procinfo (av->a_type, av->a_un.a_val) == 0)
 	    continue;
 	}
 

Modified: fsf/trunk/libc/misc/getauxval.c
==============================================================================
--- fsf/trunk/libc/misc/getauxval.c (original)
+++ fsf/trunk/libc/misc/getauxval.c Sat Jun 29 00:02:05 2013
@@ -26,6 +26,8 @@
 
   if (type == AT_HWCAP)
     return GLRO(dl_hwcap);
+  else if (type == AT_HWCAP2)
+    return GLRO(dl_hwcap2);
 
   for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++)
     if (p->a_type == type)

Modified: fsf/trunk/libc/ports/ChangeLog.aarch64
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.aarch64 (original)
+++ fsf/trunk/libc/ports/ChangeLog.aarch64 Sat Jun 29 00:02:05 2013
@@ -1,3 +1,13 @@
+2013-06-28  Marcus Shawcroft  <marcus.shawcroft@xxxxxxxxxx>
+
+	* sysdeps/aarch64/dl-machine.h (elf_machine_dynamic): De-reference
+	_GLOBAL_OFFSET_TABLE_.
+
+2013-06-28  Marcus Shawcroft  <marcus.shawcroft@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/aarch64/getcontext.S (__getcontext): Simplify
+	oPSTATE initialization.
+
 2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist:

Modified: fsf/trunk/libc/ports/ChangeLog.alpha
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.alpha (original)
+++ fsf/trunk/libc/ports/ChangeLog.alpha Sat Jun 29 00:02:05 2013
@@ -1,3 +1,8 @@
+2013-06-28  Ryan S. Arnold  <rsa@xxxxxxxxxxxxxxxxxx>
+
+	* sysdeps/alpha/dl-procinfo.h (_dl_procinfo): Add TYPE parameter
+	to macro prototype for AT_HWCAP2 support.
+
 2013-06-24  Richard Henderson  <rth@xxxxxxxxxx>
 
 	[BZ #15666]

Modified: fsf/trunk/libc/ports/ChangeLog.arm
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.arm (original)
+++ fsf/trunk/libc/ports/ChangeLog.arm Sat Jun 29 00:02:05 2013
@@ -1,3 +1,10 @@
+2013-06-28  Ryan S. Arnold  <rsa@xxxxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/dl-procinfo.h (_dl_procinfo): Add
+	TYPE parameter to macro prototype for AT_HWCAP2 support.  Make WORD
+	unsigned long int rather than signed int.  Stub in handler for TYPE ==
+	AT_HWCAP2 to return -1 for unknown a_type display fallback.
+
 2013-06-18  Roland McGrath  <roland@xxxxxxxxxxxxx>
 
 	* sysdeps/arm/arm-mcount.S: Comment typo fix.

Modified: fsf/trunk/libc/ports/ChangeLog.m68k
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.m68k (original)
+++ fsf/trunk/libc/ports/ChangeLog.m68k Sat Jun 29 00:02:05 2013
@@ -1,3 +1,17 @@
+2013-06-28  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/m68k/fpu_control.h: Fix preprocessor indentation.
+
+2013-06-28  Nathan Sidwell  <nathan@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/m68k/fpu_control.h [__mcoldfire__ && !__mcffpu__]
+	(_FPU_RESERVED): Provide alternative definition.
+	[__mcoldfire__ && !__mcffpu__] (_FPU_DEFAULT): Likewise.
+	[__mcoldfire__ && !__mcffpu__] (_FPU_GETCW): Likewise.
+	[__mcoldfire__ && !__mcffpu__] (_FPU_SETCW): Likewise.
+	[!(__mcoldfire__ && !__mcffpu__)]: Make existing macro definitions
+	conditional.
+
 2013-06-25  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
 
 	* sysdeps/m68k/sysdep.h (CALL_MCOUNT) [PROF]: Use %a6 instead of

Modified: fsf/trunk/libc/ports/ChangeLog.mips
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.mips (original)
+++ fsf/trunk/libc/ports/ChangeLog.mips Sat Jun 29 00:02:05 2013
@@ -1,3 +1,8 @@
+2013-06-28  Ryan S. Arnold  <rsa@xxxxxxxxxxxxxxxxxx>
+
+	* sysdeps/mips/dl-procinfo.h (_dl_procinfo): Add TYPE parameter
+	to macro prototype for AT_HWCAP2 support.
+
 2013-06-27  Maciej W. Rozycki  <macro@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/mips/dl-static.c: Do not include

Modified: fsf/trunk/libc/ports/sysdeps/aarch64/dl-machine.h
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/aarch64/dl-machine.h (original)
+++ fsf/trunk/libc/ports/sysdeps/aarch64/dl-machine.h Sat Jun 29 00:02:05 2013
@@ -36,8 +36,8 @@
 static inline ElfW(Addr) __attribute__ ((unused))
 elf_machine_dynamic (void)
 {
-  ElfW(Addr) addr = (ElfW(Addr)) &_DYNAMIC;
-  return addr;
+  extern const ElfW(Addr) _GLOBAL_OFFSET_TABLE_[] attribute_hidden;
+  return _GLOBAL_OFFSET_TABLE_[0];
 }
 
 /* Return the run-time load address of the shared object.  */

Modified: fsf/trunk/libc/ports/sysdeps/alpha/dl-procinfo.h
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/alpha/dl-procinfo.h (original)
+++ fsf/trunk/libc/ports/sysdeps/alpha/dl-procinfo.h Sat Jun 29 00:02:05 2013
@@ -51,7 +51,7 @@
 };
 
 /* We cannot provide a general printing function.  */
-#define _dl_procinfo(word) -1
+#define _dl_procinfo(type, word) -1
 
 /* There are no hardware capabilities defined.  */
 #define _dl_hwcap_string(idx) ""

Modified: fsf/trunk/libc/ports/sysdeps/m68k/fpu_control.h
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/m68k/fpu_control.h (original)
+++ fsf/trunk/libc/ports/sysdeps/m68k/fpu_control.h Sat Jun 29 00:02:05 2013
@@ -53,54 +53,64 @@
 
 #include <features.h>
 
+#if defined (__mcoldfire__) && !defined (__mcffpu__)
+
+# define _FPU_RESERVED 0xffffffff
+# define _FPU_DEFAULT  0x00000000
+# define _FPU_GETCW(cw) ((cw) = 0)
+# define _FPU_SETCW(cw) ((void) (cw))
+
+#else
+
 /* masking of interrupts */
-#define _FPU_MASK_BSUN  0x8000
-#define _FPU_MASK_SNAN  0x4000
-#define _FPU_MASK_OPERR 0x2000
-#define _FPU_MASK_OVFL  0x1000
-#define _FPU_MASK_UNFL  0x0800
-#define _FPU_MASK_DZ    0x0400
-#define _FPU_MASK_INEX1 0x0200
-#define _FPU_MASK_INEX2 0x0100
+# define _FPU_MASK_BSUN  0x8000
+# define _FPU_MASK_SNAN  0x4000
+# define _FPU_MASK_OPERR 0x2000
+# define _FPU_MASK_OVFL  0x1000
+# define _FPU_MASK_UNFL  0x0800
+# define _FPU_MASK_DZ    0x0400
+# define _FPU_MASK_INEX1 0x0200
+# define _FPU_MASK_INEX2 0x0100
 
 /* precision control */
-#ifdef __mcoldfire__
-#define _FPU_DOUBLE   0x00
-#else
-#define _FPU_EXTENDED 0x00   /* RECOMMENDED */
-#define _FPU_DOUBLE   0x80
-#endif
-#define _FPU_SINGLE   0x40     /* DO NOT USE */
+# ifdef __mcoldfire__
+#  define _FPU_DOUBLE   0x00
+# else
+#  define _FPU_EXTENDED 0x00   /* RECOMMENDED */
+#  define _FPU_DOUBLE   0x80
+# endif
+# define _FPU_SINGLE   0x40     /* DO NOT USE */
 
 /* rounding control */
-#define _FPU_RC_NEAREST 0x00    /* RECOMMENDED */
-#define _FPU_RC_ZERO    0x10
-#define _FPU_RC_DOWN    0x20
-#define _FPU_RC_UP      0x30
+# define _FPU_RC_NEAREST 0x00    /* RECOMMENDED */
+# define _FPU_RC_ZERO    0x10
+# define _FPU_RC_DOWN    0x20
+# define _FPU_RC_UP      0x30
 
-#ifdef __mcoldfire__
-#define _FPU_RESERVED 0xFFFF800F
-#else
-#define _FPU_RESERVED 0xFFFF000F  /* Reserved bits in fpucr */
-#endif
+# ifdef __mcoldfire__
+#  define _FPU_RESERVED 0xFFFF800F
+# else
+#  define _FPU_RESERVED 0xFFFF000F  /* Reserved bits in fpucr */
+# endif
 
 
 /* Now two recommended fpucr */
 
 /* The fdlibm code requires no interrupts for exceptions.  Don't
    change the rounding mode, it would break long double I/O!  */
-#define _FPU_DEFAULT  0x00000000
+# define _FPU_DEFAULT  0x00000000
 
 /* IEEE:  same as above, but exceptions.  We must make it non-zero so
    that __setfpucw works.  This bit will be ignored.  */
-#define _FPU_IEEE     0x00000001
+# define _FPU_IEEE     0x00000001
+
+/* Macros for accessing the hardware control word.  */
+# define _FPU_GETCW(cw) __asm__ ("fmove%.l %!, %0" : "=dm" (cw))
+# define _FPU_SETCW(cw) __asm__ volatile ("fmove%.l %0, %!" : : "dm" (cw))
+#endif
 
 /* Type of the control word.  */
 typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
-
-/* Macros for accessing the hardware control word.  */
-#define _FPU_GETCW(cw) __asm__ ("fmove%.l %!, %0" : "=dm" (cw))
-#define _FPU_SETCW(cw) __asm__ volatile ("fmove%.l %0, %!" : : "dm" (cw))
 
 /* Default control word set at startup.  */
 extern fpu_control_t __fpu_control;

Modified: fsf/trunk/libc/ports/sysdeps/mips/dl-procinfo.h
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/mips/dl-procinfo.h (original)
+++ fsf/trunk/libc/ports/sysdeps/mips/dl-procinfo.h Sat Jun 29 00:02:05 2013
@@ -51,7 +51,7 @@
 };
 
 /* We cannot provide a general printing function.  */
-#define _dl_procinfo(word) -1
+#define _dl_procinfo(type, word) -1
 
 /* There are no hardware capabilities defined.  */
 #define _dl_hwcap_string(idx) ""

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S Sat Jun 29 00:02:05 2013
@@ -54,8 +54,7 @@
 	str     x2, [x0, oSP]
 
 	/* Initialize the pstate.  */
-	mov	x3, #0
-	str	x3, [x0, oPSTATE]
+	str	xzr, [x0, oPSTATE]
 
 	/* Figure out where to place the first context extension
 	   block.  */

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/arm/dl-procinfo.h Sat Jun 29 00:02:05 2013
@@ -31,9 +31,13 @@
 
 static inline int
 __attribute__ ((unused))
-_dl_procinfo (int word)
+_dl_procinfo (unsigned int type, unsigned long int word)
 {
   int i;
+
+  /* Fallback to unknown output mechanism.  */
+  if (type == AT_HWCAP2)
+    return -1;
 
   _dl_printf ("AT_HWCAP:   ");
 

Modified: fsf/trunk/libc/sysdeps/generic/dl-procinfo.h
==============================================================================
--- fsf/trunk/libc/sysdeps/generic/dl-procinfo.h (original)
+++ fsf/trunk/libc/sysdeps/generic/dl-procinfo.h Sat Jun 29 00:02:05 2013
@@ -21,7 +21,7 @@
 #define _DL_PROCINFO_H	1
 
 /* We cannot provide a general printing function.  */
-#define _dl_procinfo(word) -1
+#define _dl_procinfo(type, word) -1
 
 /* There are no hardware capabilities defined.  */
 #define _dl_hwcap_string(idx) ""

Modified: fsf/trunk/libc/sysdeps/generic/ldsodefs.h
==============================================================================
--- fsf/trunk/libc/sysdeps/generic/ldsodefs.h (original)
+++ fsf/trunk/libc/sysdeps/generic/ldsodefs.h Sat Jun 29 00:02:05 2013
@@ -554,6 +554,10 @@
   EXTERN struct link_map *_dl_sysinfo_map;
 #endif
 
+  /* Mask for more hardware capabilities that are available on some
+     platforms.  */
+  EXTERN uint64_t _dl_hwcap2;
+
 #ifdef SHARED
   /* We add a function table to _rtld_global which is then used to
      call the function instead of going through the PLT.  The result

Modified: fsf/trunk/libc/sysdeps/i386/dl-procinfo.h
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/dl-procinfo.h (original)
+++ fsf/trunk/libc/sysdeps/i386/dl-procinfo.h Sat Jun 29 00:02:05 2013
@@ -61,7 +61,7 @@
 };
 
 /* We cannot provide a general printing function.  */
-#define _dl_procinfo(word) -1
+#define _dl_procinfo(type, word) -1
 
 static inline const char *
 __attribute__ ((unused))

Modified: fsf/trunk/libc/sysdeps/powerpc/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/Makefile (original)
+++ fsf/trunk/libc/sysdeps/powerpc/Makefile Sat Jun 29 00:02:05 2013
@@ -17,7 +17,7 @@
 endif
 
 ifeq ($(subdir),csu)
-# get offset to rtld_global._dl_hwcap
+# get offset to rtld_global._dl_hwcap and rtld_global._dl_hwcap2
 gen-as-const-headers += rtld-global-offsets.sym
 # get offset to __locale_struct.__ctype_tolower
 gen-as-const-headers += locale-defines.sym

Modified: fsf/trunk/libc/sysdeps/powerpc/bits/hwcap.h
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/bits/hwcap.h (original)
+++ fsf/trunk/libc/sysdeps/powerpc/bits/hwcap.h Sat Jun 29 00:02:05 2013
@@ -1,4 +1,4 @@
-/* Defines for bits in AT_HWCAP.
+/* Defines for bits in AT_HWCAP and AT_HWCAP2.
    Copyright (C) 2012-2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -20,9 +20,9 @@
 # error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
 #endif
 
-/*
- * The following must match the kernels asm/cputable.h.
- */
+/* The bit numbers must match those in the kernel's asm/cputable.h.  */
+
+/* Feature definitions in AT_HWCAP.  */
 #define PPC_FEATURE_32		    0x80000000 /* 32-bit mode. */
 #define PPC_FEATURE_64		    0x40000000 /* 64-bit mode. */
 #define PPC_FEATURE_601_INSTR	    0x20000000 /* 601 chip, Old POWER ISA.  */
@@ -39,8 +39,9 @@
 #define PPC_FEATURE_POWER5	    0x00040000 /* POWER5 ISA 2.02 */
 #define PPC_FEATURE_POWER5_PLUS	    0x00020000 /* POWER5+ ISA 2.03 */
 #define PPC_FEATURE_CELL_BE	    0x00010000 /* CELL Broadband Engine */
-#define PPC_FEATURE_BOOKE	    0x00008000
-#define PPC_FEATURE_SMT		    0x00004000 /* Simultaneous Multi-Threading */
+#define PPC_FEATURE_BOOKE	    0x00008000 /* ISA Category Embedded */
+#define PPC_FEATURE_SMT		    0x00004000 /* Simultaneous
+						  Multi-Threading */
 #define PPC_FEATURE_ICACHE_SNOOP    0x00002000
 #define PPC_FEATURE_ARCH_2_05	    0x00001000 /* ISA 2.05 */
 #define PPC_FEATURE_PA6T	    0x00000800 /* PA Semi 6T Core */
@@ -51,3 +52,13 @@
 #define PPC_FEATURE_PSERIES_PERFMON_COMPAT  0x00000040
 #define PPC_FEATURE_TRUE_LE	    0x00000002
 #define PPC_FEATURE_PPC_LE	    0x00000001
+
+/* Feature definitions in AT_HWCAP2.  */
+#define PPC_FEATURE2_ARCH_2_07     0x80000000 /* ISA 2.07 */
+#define PPC_FEATURE2_HAS_HTM       0x40000000 /* Hardware Transactional
+						 Memory */
+#define PPC_FEATURE2_HAS_DSCR      0x20000000 /* Data Stream Control
+						 Register */
+#define PPC_FEATURE2_HAS_EBB       0x10000000 /* Event Base Branching */
+#define PPC_FEATURE2_HAS_ISEL      0x08000000 /* Integer Select */
+#define PPC_FEATURE2_HAS_TAR       0x04000000 /* Target Address Register */

Modified: fsf/trunk/libc/sysdeps/powerpc/dl-procinfo.c
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/dl-procinfo.c (original)
+++ fsf/trunk/libc/sysdeps/powerpc/dl-procinfo.c Sat Jun 29 00:02:05 2013
@@ -45,7 +45,7 @@
 #if !defined PROCINFO_DECL && defined SHARED
   ._dl_powerpc_cap_flags
 #else
-PROCINFO_CLASS const char _dl_powerpc_cap_flags[25][10]
+PROCINFO_CLASS const char _dl_powerpc_cap_flags[57][10]
 #endif
 #ifndef PROCINFO_DECL
 = {
@@ -56,6 +56,14 @@
     "notb", "efpdouble", "efpsingle", "spe",
     "ucache", "4xxmac", "mmu", "fpu",
     "altivec", "ppc601", "ppc64", "ppc32",
+    "", "", "", "",
+    "", "", "", "",
+    "", "", "", "",
+    "", "", "", "",
+    "", "", "", "",
+    "", "", "", "",
+    "", "", "tar", "isel",
+    "ebb", "dscr", "htm", "arch_2_07",
   }
 #endif
 #if !defined SHARED || defined PROCINFO_DECL

Modified: fsf/trunk/libc/sysdeps/powerpc/dl-procinfo.h
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/dl-procinfo.h (original)
+++ fsf/trunk/libc/sysdeps/powerpc/dl-procinfo.h Sat Jun 29 00:02:05 2013
@@ -20,11 +20,21 @@
 #define _DL_PROCINFO_H 1
 
 #include <ldsodefs.h>
-#include <sysdep.h>	/* This defines the PPC_FEATURE_* macros.  */
+#include <sysdep.h>	/* This defines the PPC_FEATURE[2]_* macros.  */
 
 /* There are 25 bits used, but they are bits 7..31.  */
 #define _DL_HWCAP_FIRST		7
-#define _DL_HWCAP_COUNT		32
+
+/* The total number of available bits (including those prior to
+   _DL_HWCAP_FIRST).  Some of these bits might not be used.  */
+#define _DL_HWCAP_COUNT		64
+
+/* Features started at bit 31 and decremented as new features were added.  */
+#define _DL_HWCAP_LAST		31
+
+/* AT_HWCAP2 features started at bit 31 and decremented as new features were
+   added.  HWCAP2 feature bits start at bit 0.  */
+#define _DL_HWCAP2_LAST		31
 
 /* These bits influence library search.  */
 #define HWCAP_IMPORTANT		(PPC_FEATURE_HAS_ALTIVEC \
@@ -159,16 +169,35 @@
 #ifdef IS_IN_rtld
 static inline int
 __attribute__ ((unused))
-_dl_procinfo (int word)
-{
-  _dl_printf ("AT_HWCAP:       ");
-
-  for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i)
-    if (word & (1 << i))
-      _dl_printf (" %s", _dl_hwcap_string (i));
-
-  _dl_printf ("\n");
-
+_dl_procinfo (unsigned int type, unsigned long int word)
+{
+  switch(type)
+    {
+    case AT_HWCAP:
+      _dl_printf ("AT_HWCAP:       ");
+
+      for (int i = _DL_HWCAP_FIRST; i <= _DL_HWCAP_LAST; ++i)
+       if (word & (1 << i))
+         _dl_printf (" %s", _dl_hwcap_string (i));
+      break;
+    case AT_HWCAP2:
+      {
+       unsigned int offset = _DL_HWCAP_LAST + 1;
+
+       _dl_printf ("AT_HWCAP2:      ");
+
+        /* We have to go through them all because the kernel added the
+          AT_HWCAP2 features starting with the high bits.  */
+       for (int i = 0; i <= _DL_HWCAP2_LAST; ++i)
+         if (word & (1 << i))
+           _dl_printf (" %s", _dl_hwcap_string (offset + i));
+       break;
+      }
+    default:
+      /* This should not happen.  */
+      return -1;
+    }
+   _dl_printf ("\n");
   return 0;
 }
 #endif

Modified: fsf/trunk/libc/sysdeps/powerpc/rtld-global-offsets.sym
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/rtld-global-offsets.sym (original)
+++ fsf/trunk/libc/sysdeps/powerpc/rtld-global-offsets.sym Sat Jun 29 00:02:05 2013
@@ -5,3 +5,4 @@
 #define rtld_global_ro_offsetof(mem) offsetof (struct rtld_global_ro, mem)
 
 RTLD_GLOBAL_RO_DL_HWCAP_OFFSET	rtld_global_ro_offsetof (_dl_hwcap)
+RTLD_GLOBAL_RO_DL_HWCAP2_OFFSET	rtld_global_ro_offsetof (_dl_hwcap2)

Modified: fsf/trunk/libc/sysdeps/s390/dl-procinfo.h
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/dl-procinfo.h (original)
+++ fsf/trunk/libc/sysdeps/s390/dl-procinfo.h Sat Jun 29 00:02:05 2013
@@ -56,7 +56,7 @@
 			  | HWCAP_S390_EIMM | HWCAP_S390_DFP)
 
 /* We cannot provide a general printing function.  */
-#define _dl_procinfo(word) -1
+#define _dl_procinfo(type, word) -1
 
 static inline const char *
 __attribute__ ((unused))

Modified: fsf/trunk/libc/sysdeps/sparc/dl-procinfo.h
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/dl-procinfo.h (original)
+++ fsf/trunk/libc/sysdeps/sparc/dl-procinfo.h Sat Jun 29 00:02:05 2013
@@ -27,9 +27,13 @@
 
 static inline int
 __attribute__ ((unused))
-_dl_procinfo (int word)
+_dl_procinfo (unsigned int type, unsigned long int word)
 {
   int i;
+
+  /* Fallback to unknown output mechanism.  */
+  if (type == AT_HWCAP2)
+    return -1;
 
   _dl_printf ("AT_HWCAP:   ");
 

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/dl-procinfo.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/dl-procinfo.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/dl-procinfo.h Sat Jun 29 00:02:05 2013
@@ -24,11 +24,15 @@
 #undef _dl_procinfo
 static inline int
 __attribute__ ((unused))
-_dl_procinfo (int word)
+_dl_procinfo (unsigned int type, unsigned long int word)
 {
   /* This table should match the information from arch/i386/kernel/setup.c
      in the kernel sources.  */
   int i;
+
+  /* Fallback to unknown output mechanism.  */
+  if (type == AT_HWCAP2)
+    return -1;
 
   _dl_printf ("AT_HWCAP:   ");
 

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/mmap64.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/mmap64.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/mmap64.c Sat Jun 29 00:02:05 2013
@@ -56,7 +56,7 @@
   result = (void *)
     INLINE_SYSCALL (mmap2, 6, addr,
 		    len, prot, flags, fd,
-		    (off_t) (offset >> MMAP2_PAGE_SHIFT));
+		    (off_t) (offset >> page_shift));
   return result;
 }
 weak_alias (__mmap64, mmap64)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/dl-procinfo.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/dl-procinfo.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/dl-procinfo.h Sat Jun 29 00:02:05 2013
@@ -24,11 +24,15 @@
 #undef _dl_procinfo
 static inline int
 __attribute__ ((unused))
-_dl_procinfo (int word)
+_dl_procinfo (unsigned int type, unsigned long int word)
 {
   /* This table should match the information from arch/s390/kernel/setup.c
      in the kernel sources.  */
   int i;
+
+  /* Fallback to unknown output mechanism.  */
+  if (type == AT_HWCAP2)
+    return -1;
 
   _dl_printf ("AT_HWCAP:   ");
 

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c Sat Jun 29 00:02:05 2013
@@ -81,8 +81,16 @@
 	    case 0x37:
 	      /* Unaligned load versions are faster than SSSE3
 		 on Silvermont.  */
+#if index_Fast_Unaligned_Load != index_Prefer_PMINUB_for_stringop
+# error index_Fast_Unaligned_Load != index_Prefer_PMINUB_for_stringop
+#endif
+#if index_Fast_Unaligned_Load != index_Slow_SSE4_2
+# error index_Fast_Unaligned_Load != index_Slow_SSE4_2
+#endif
 	      __cpu_features.feature[index_Fast_Unaligned_Load]
-		|= bit_Fast_Unaligned_Load;
+		|= (bit_Fast_Unaligned_Load
+		    | bit_Prefer_PMINUB_for_stringop
+		    | bit_Slow_SSE4_2);
 	      break;
 
 	    default:

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h Sat Jun 29 00:02:05 2013
@@ -23,6 +23,7 @@
 #define bit_AVX_Usable			(1 << 6)
 #define bit_FMA_Usable			(1 << 7)
 #define bit_FMA4_Usable			(1 << 8)
+#define bit_Slow_SSE4_2			(1 << 9)
 
 /* CPUID Feature flags.  */
 
@@ -62,6 +63,7 @@
 # define index_AVX_Usable		FEATURE_INDEX_1*FEATURE_SIZE
 # define index_FMA_Usable		FEATURE_INDEX_1*FEATURE_SIZE
 # define index_FMA4_Usable		FEATURE_INDEX_1*FEATURE_SIZE
+# define index_Slow_SSE4_2		FEATURE_INDEX_1*FEATURE_SIZE
 
 #else	/* __ASSEMBLER__ */
 
@@ -156,9 +158,11 @@
 # define index_Fast_Copy_Backward	FEATURE_INDEX_1
 # define index_Slow_BSF			FEATURE_INDEX_1
 # define index_Fast_Unaligned_Load	FEATURE_INDEX_1
+# define index_Prefer_PMINUB_for_stringop FEATURE_INDEX_1
 # define index_AVX_Usable		FEATURE_INDEX_1
 # define index_FMA_Usable		FEATURE_INDEX_1
 # define index_FMA4_Usable		FEATURE_INDEX_1
+# define index_Slow_SSE4_2		FEATURE_INDEX_1
 
 # define HAS_ARCH_FEATURE(name) \
   ((__get_cpu_features ()->feature[index_##name] & (bit_##name)) != 0)

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/strchr.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/strchr.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/strchr.S Sat Jun 29 00:02:05 2013
@@ -29,6 +29,8 @@
 	jne	1f
 	call	__init_cpu_features
 1:	leaq	__strchr_sse2(%rip), %rax
+	testl	$bit_Slow_SSE4_2, __cpu_features+CPUID_OFFSET+index_Slow_SSE4_2(%rip)
+	jnz	2f
 	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
 	jz	2f
 	leaq	__strchr_sse42(%rip), %rax

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/strcmp.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/strcmp.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/strcmp.S Sat Jun 29 00:02:05 2013
@@ -88,14 +88,16 @@
 	jne	1f
 	call	__init_cpu_features
 1:
+	testl	$bit_Slow_SSE4_2, __cpu_features+CPUID_OFFSET+index_Slow_SSE4_2(%rip)
+	jnz	2f
 	leaq	STRCMP_SSE42(%rip), %rax
 	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
-	jnz	2f
-	leaq	STRCMP_SSSE3(%rip), %rax
+	jnz	3f
+2:	leaq	STRCMP_SSSE3(%rip), %rax
 	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
-	jnz	2f
+	jnz	3f
 	leaq	STRCMP_SSE2(%rip), %rax
-2:	ret
+3:	ret
 END(STRCMP)
 
 # ifdef USE_AS_STRCASECMP_L
@@ -109,16 +111,18 @@
 #  ifdef HAVE_AVX_SUPPORT
 	leaq	__strcasecmp_avx(%rip), %rax
 	testl	$bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip)
+	jnz	3f
+#  endif
+	testl	$bit_Slow_SSE4_2, __cpu_features+CPUID_OFFSET+index_Slow_SSE4_2(%rip)
 	jnz	2f
-#  endif
 	leaq	__strcasecmp_sse42(%rip), %rax
 	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
-	jnz	2f
-	leaq	__strcasecmp_ssse3(%rip), %rax
+	jnz	3f
+2:	leaq	__strcasecmp_ssse3(%rip), %rax
 	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
-	jnz	2f
+	jnz	3f
 	leaq	__strcasecmp_sse2(%rip), %rax
-2:	ret
+3:	ret
 END(__strcasecmp)
 weak_alias (__strcasecmp, strcasecmp)
 # endif
@@ -133,16 +137,18 @@
 #  ifdef HAVE_AVX_SUPPORT
 	leaq	__strncasecmp_avx(%rip), %rax
 	testl	$bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip)
+	jnz	3f
+#  endif
+	testl	$bit_Slow_SSE4_2, __cpu_features+CPUID_OFFSET+index_Slow_SSE4_2(%rip)
 	jnz	2f
-#  endif
 	leaq	__strncasecmp_sse42(%rip), %rax
 	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
-	jnz	2f
-	leaq	__strncasecmp_ssse3(%rip), %rax
+	jnz	3f
+2:	leaq	__strncasecmp_ssse3(%rip), %rax
 	testl	$bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
-	jnz	2f
+	jnz	3f
 	leaq	__strncasecmp_sse2(%rip), %rax
-2:	ret
+3:	ret
 END(__strncasecmp)
 weak_alias (__strncasecmp, strncasecmp)
 # endif

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/strrchr.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/strrchr.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/strrchr.S Sat Jun 29 00:02:05 2013
@@ -32,6 +32,8 @@
 	jne	1f
 	call	__init_cpu_features
 1:	leaq	__strrchr_sse2(%rip), %rax
+	testl	$bit_Slow_SSE4_2, __cpu_features+CPUID_OFFSET+index_Slow_SSE4_2(%rip)
+	jnz	2f
 	testl	$bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
 	jz	2f
 	leaq	__strrchr_sse42(%rip), %rax

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits