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

r6726 - in glibc-package/branches/glibc-2.22/debian: . patches patches/any



Author: aurel32
Date: 2015-12-01 21:49:15 +0000 (Tue, 01 Dec 2015)
New Revision: 6726

Removed:
   glibc-package/branches/glibc-2.22/debian/patches/any/cvs-ld_pointer_guard.diff
Modified:
   glibc-package/branches/glibc-2.22/debian/changelog
   glibc-package/branches/glibc-2.22/debian/patches/git-updates.diff
   glibc-package/branches/glibc-2.22/debian/patches/series
Log:
Update git-updates up to 2015-11-27


Modified: glibc-package/branches/glibc-2.22/debian/changelog
===================================================================
--- glibc-package/branches/glibc-2.22/debian/changelog	2015-12-01 20:15:57 UTC (rev 6725)
+++ glibc-package/branches/glibc-2.22/debian/changelog	2015-12-01 21:49:15 UTC (rev 6726)
@@ -1,7 +1,7 @@
 glibc (2.22-0experimental0) UNRELEASED; urgency=medium
 
   [ Adam Conrad ]
-  * New upstream release: version 2.22, with git updates up to 2015-09-17:
+  * New upstream release: version 2.22, with git updates up to 2015-11-27:
     - debian/patches/all/local-alias-UTF-8.diff: Fixed upstream.
     - debian/patches/any/cvs-ldconfig-aux-cache.diff: Upstreamed.
     - debian/patches/any/cvs-localplt-new-readelf.diff: Upstreamed.
@@ -73,6 +73,7 @@
   * debian/patches/any/cvs-tls-dtv.diff: Upstreamed.
   * debian/patches/any/cvs-rfc3542-advanced-api.diff: Upstreamed.
   * debian/patches/any/cvs-check-localplt.diff: Upstreamed.
+  * debian/patches/any/cvs-ld_pointer_guard.diff: Upstreamed.
 
  -- Adam Conrad <adconrad@0c3.net>  Tue, 15 Sep 2015 17:57:41 -0600
 

Deleted: glibc-package/branches/glibc-2.22/debian/patches/any/cvs-ld_pointer_guard.diff
===================================================================
--- glibc-package/branches/glibc-2.22/debian/patches/any/cvs-ld_pointer_guard.diff	2015-12-01 20:15:57 UTC (rev 6725)
+++ glibc-package/branches/glibc-2.22/debian/patches/any/cvs-ld_pointer_guard.diff	2015-12-01 21:49:15 UTC (rev 6726)
@@ -1,62 +0,0 @@
-2015-10-15  Florian Weimer  <fweimer@redhat.com>
-
-	[BZ #18928]
-	* sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
-	_dl_pointer_guard member.
-	* elf/rtld.c (_rtld_global_ro): Remove _dl_pointer_guard
-	initializer.
-	(security_init): Always set up pointer guard.
-	(process_envvars): Do not process LD_POINTER_GUARD.
-
---- a/elf/rtld.c
-+++ b/elf/rtld.c
-@@ -162,7 +162,6 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
-     ._dl_hwcap_mask = HWCAP_IMPORTANT,
-     ._dl_lazy = 1,
-     ._dl_fpu_control = _FPU_DEFAULT,
--    ._dl_pointer_guard = 1,
-     ._dl_pagesize = EXEC_PAGESIZE,
-     ._dl_inhibit_cache = 0,
- 
-@@ -709,15 +708,12 @@ security_init (void)
- #endif
- 
-   /* Set up the pointer guard as well, if necessary.  */
--  if (GLRO(dl_pointer_guard))
--    {
--      uintptr_t pointer_chk_guard = _dl_setup_pointer_guard (_dl_random,
--							     stack_chk_guard);
-+  uintptr_t pointer_chk_guard
-+    = _dl_setup_pointer_guard (_dl_random, stack_chk_guard);
- #ifdef THREAD_SET_POINTER_GUARD
--      THREAD_SET_POINTER_GUARD (pointer_chk_guard);
-+  THREAD_SET_POINTER_GUARD (pointer_chk_guard);
- #endif
--      __pointer_chk_guard_local = pointer_chk_guard;
--    }
-+  __pointer_chk_guard_local = pointer_chk_guard;
- 
-   /* We do not need the _dl_random value anymore.  The less
-      information we leave behind, the better, so clear the
-@@ -2471,9 +2467,6 @@ process_envvars (enum mode *modep)
- 	      GLRO(dl_use_load_bias) = envline[14] == '1' ? -1 : 0;
- 	      break;
- 	    }
--
--	  if (memcmp (envline, "POINTER_GUARD", 13) == 0)
--	    GLRO(dl_pointer_guard) = envline[14] != '0';
- 	  break;
- 
- 	case 14:
---- a/sysdeps/generic/ldsodefs.h
-+++ b/sysdeps/generic/ldsodefs.h
-@@ -592,9 +592,6 @@ struct rtld_global_ro
-   /* List of auditing interfaces.  */
-   struct audit_ifaces *_dl_audit;
-   unsigned int _dl_naudit;
--
--  /* 0 if internal pointer values should not be guarded, 1 if they should.  */
--  EXTERN int _dl_pointer_guard;
- };
- # define __rtld_global_attribute__
- # if IS_IN (rtld)

Modified: glibc-package/branches/glibc-2.22/debian/patches/git-updates.diff
===================================================================
--- glibc-package/branches/glibc-2.22/debian/patches/git-updates.diff	2015-12-01 20:15:57 UTC (rev 6725)
+++ glibc-package/branches/glibc-2.22/debian/patches/git-updates.diff	2015-12-01 21:49:15 UTC (rev 6726)
@@ -1,10 +1,152 @@
 GIT update of git://sourceware.org/git/glibc.git/release/2.22/master from glibc-2.22
 
 diff --git a/ChangeLog b/ChangeLog
-index cb9124e..a25da67 100644
+index cb9124e..842a7c6 100644
 --- a/ChangeLog
 +++ b/ChangeLog
-@@ -1,3 +1,93 @@
+@@ -1,3 +1,235 @@
++2015-11-27  Andrew Senkevich  <andrew.senkevich@intel.com>
++
++	[BZ #19058]
++	* math/Makefile ($(inst_libdir)/libm.so): Added libmvec_nonshared.a to
++	AS_NEEDED.
++	* sysdeps/x86/fpu/bits/math-vector.h: Removed code with asm aliases
++	workaround.
++	* sysdeps/x86_64/fpu/Makefile (libmvec-support,
++	libmvec-static-only-routines): Added new file.
++	* sysdeps/x86_64/fpu/svml_finite_alias.S: New file.
++	* NEWS: Mention this fix.
++
++2015-11-20  Roland McGrath  <roland@hack.frob.com>
++
++	* sysdeps/nacl/dl-map-segments.h (_dl_map_segments): Use
++	__glibc_likely instead of __builtin_expect.  After falling back to
++	dyncode_create in a non-ET_DYN case, use the allocate_code_data
++	system interface to register the code pages as occupied.
++
++2015-11-14  H.J. Lu  <hongjiu.lu@intel.com>
++
++	* config.make.in (have-glob-dat-reloc): New.
++	* configure.ac (libc_cv_has_glob_dat): New.  Set to yes if
++	target supports GLOB_DAT relocaton. AC_SUBST.
++	* configure: Regenerated.
++	* elf/Makefile (tests): Add tst-prelink.
++	(tests-special): Add $(objpfx)tst-prelink-cmp.out.
++	(tst-prelink-ENV): New.
++	($(objpfx)tst-prelink-conflict.out): Likewise.
++	($(objpfx)tst-prelink-cmp.out): Likewise.
++	* sysdeps/x86/tst-prelink.c: Moved to ...
++	* elf/tst-prelink.c: Here.
++	* sysdeps/x86/tst-prelink.exp: Moved to ...
++	* elf/tst-prelink.exp: Here.
++	* sysdeps/x86/Makefile (tests): Don't add tst-prelink.
++	(tst-prelink-ENV): Removed.
++	($(objpfx)tst-prelink-conflict.out): Likewise.
++	($(objpfx)tst-prelink-cmp.out): Likewise.
++	(tests-special): Don't add $(objpfx)tst-prelink-cmp.out.
++
++2015-11-10  Roland McGrath  <roland@hack.frob.com>
++
++	* elf/dl-load.c (open_verify): Take new argument FD.
++	Skip __open call if passed FD is not -1.
++	(_dl_map_object, open_path): Update callers.
++	* elf/dl-sysdep-open.h: New file.
++	* elf/dl-load.c: Include it.
++	(_dl_map_object): Try _dl_sysdep_open_object before ldconfig cache.
++	* sysdeps/nacl/dl-sysdep.c (_dl_sysdep_open_object): New function.
++	* sysdeps/nacl/dl-sysdep-open.h: New file.
++	* sysdeps/nacl/nacl-interface-list.h: Move nacl_irt_resource_open
++	from libc to rtld.
++
++2015-11-10  H.J. Lu  <hongjiu.lu@intel.com>
++
++	[BZ #19178]
++	* sysdeps/x86/Makefile (tests): Add tst-prelink.
++	(tst-prelink-ENV): New.
++	($(objpfx)tst-prelink-conflict.out): Likewise.
++	($(objpfx)tst-prelink-cmp.out): Likewise.
++	(tests-special): Add $(objpfx)tst-prelink-cmp.out.
++	* sysdeps/x86/tst-prelink.c: New file.
++	* sysdeps/x86/tst-prelink.exp: Likewise.
++
++2015-11-07  H.J. Lu  <hongjiu.lu@intel.com>
++
++	[BZ #19178]
++	* elf/dl-lookup.c (RTYPE_CLASS_VALID): New.
++	(RTYPE_CLASS_PLT): Likewise.
++	(RTYPE_CLASS_COPY): Likewise.
++	(RTYPE_CLASS_TLS): Likewise.
++	(_dl_debug_bindings): Use RTYPE_CLASS_TLS and RTYPE_CLASS_VALID
++	to set relocation type class for DL_DEBUG_PRELINK.  Keep only
++	ELF_RTYPE_CLASS_PLT and ELF_RTYPE_CLASS_COPY bits for
++	DL_DEBUG_PRELINK.
++
++2015-10-20  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
++
++	[BZ #18743]
++	* sysdeps/powerpc/nptl/elide.h (__elide_lock): Move most of this
++	code to...
++	(ELIDE_LOCK): ...here.
++	(__get_new_count): New function with part of the code from
++	__elide_lock that updates the value of adapt_count after a
++	transaction abort.
++	(__elided_trylock): Moved this code to...
++	(ELIDE_TRYLOCK): ...here.
++
++2015-10-06  Florian Weimer  <fweimer@redhat.com>
++
++	[BZ #19018]
++	* stdlib/cxa_thread_atexit_impl.c (__cxa_thread_atexit_impl):
++	Mangle function pointer before storing it.
++	(__call_tls_dtors): Demangle function pointer before calling it.
++
++2015-10-15  Florian Weimer  <fweimer@redhat.com>
++
++	[BZ #18928]
++	* sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
++	_dl_pointer_guard member.
++	* elf/rtld.c (_rtld_global_ro): Remove _dl_pointer_guard
++	initializer.
++	(security_init): Always set up pointer guard.
++	(process_envvars): Do not process LD_POINTER_GUARD.
++
++2015-10-09  Carlos O'Donell  <carlos@redhat.com>
++
++	[BZ #18589]
++	* string/bug-strcoll2.c: Adjust copyright, and remove contributed by.
++	* string/Makefile ($(objpfx)bug-strcoll2.out): Depend on
++	$(gen-locales).
++
++2015-10-08  Carlos O'Donell  <carlos@redhat.com>
++
++	[BZ #18589]
++	* string/Makefile (tests): Add bug-strcoll2.
++	(LOCALES): Add cs_CZ.UTF-8.
++
++2015-09-28  Martin Sebor  <msebor@redhat.com>
++
++	[BZ #18969]
++	* string/Makefile (LOCALES): Define.
++	(gen-locales.mk): Include.
++	(test-strcasecmp.out, test-strncasecmp.out, tst-strxfrm.out)
++	(tst-strxfrm2.out): Add deppendency on $(gen-locales).
++	* string/tst-strxfrm2.c (do_test): Print the name of the locale
++	on setlocale failure.
++
++2015-10-08  Carlos O'Donell  <carlos@redhat.com>
++
++	[BZ #18589]
++	* string/bug-strcoll2.c: New file.
++	* locale/categories.def: Revert commit
++	f13c2a8dff2329c6692a80176262ceaaf8a6f74e.
++	* locale/langinfo.h: Likewise.
++	* locale/localeinfo.h: Likewise.
++	* locale/C-collate.c: Likewise.
++	* programs/ld-collate.c (collate_output): Likewise.
++	* string/strcoll_l.c (STRDIFF): Likewise.
++	(STRCOLL): Likewise.
++	* wcsmbs/wcscoll_l.c: Likewise.
++
 +2015-09-15  Roland McGrath  <roland@hack.frob.com>
 +
 +	* misc/sys/param.h [!MAXHOSTNAMELEN && HOST_NAME_MAX]
@@ -99,10 +241,10 @@
  
  	* version.h (RELEASE): Set to "stable".
 diff --git a/NEWS b/NEWS
-index 4c31de7..d220c07 100644
+index 4c31de7..e100318 100644
 --- a/NEWS
 +++ b/NEWS
-@@ -5,6 +5,12 @@ See the end for copying conditions.
+@@ -5,6 +5,16 @@ See the end for copying conditions.
  Please send GNU C library bug reports via <http://sourceware.org/bugzilla/>
  using `glibc' in the "product" field.
  
@@ -110,12 +252,16 @@
 +
 +* The following bugs are resolved with this release:
 +
-+  18778, 18781, 18787, 18796, 18870, 18887, 18921.
++  18589, 18743, 18778, 18781, 18787, 18796, 18870, 18887, 18921, 18928,
++  18969, 19018, 19058, 19178.
++
++* The LD_POINTER_GUARD environment variable can no longer be used to
++  disable the pointer guard feature.  It is always enabled.
 +
  Version 2.22
  
  * The following bugs are resolved with this release:
-@@ -84,7 +90,7 @@ Version 2.22
+@@ -84,7 +94,7 @@ Version 2.22
    release.  Use of this header will trigger a deprecation warning.
    Application developers should update their code to use <regex.h> instead.
  
@@ -124,8 +270,106 @@
    removed from the standard in 2001.  Also, the glibc implementation
    leaks memory.  See BZ#18681 for more details.
  
+diff --git a/config.make.in b/config.make.in
+index a9f5696..46cd9bb 100644
+--- a/config.make.in
++++ b/config.make.in
+@@ -51,6 +51,7 @@ have-z-combreloc = @libc_cv_z_combreloc@
+ have-z-execstack = @libc_cv_z_execstack@
+ have-Bgroup = @libc_cv_Bgroup@
+ have-protected-data = @libc_cv_protected_data@
++have-glob-dat-reloc = @libc_cv_has_glob_dat@
+ with-fp = @with_fp@
+ old-glibc-headers = @old_glibc_headers@
+ unwind-find-fde = @libc_cv_gcc_unwind_find_fde@
+diff --git a/configure b/configure
+index 45cc7cb..4f87b31 100755
+--- a/configure
++++ b/configure
+@@ -628,6 +628,7 @@ gnu89_inline
+ libc_cv_ssp
+ fno_unit_at_a_time
+ libc_cv_output_format
++libc_cv_has_glob_dat
+ libc_cv_hashstyle
+ libc_cv_fpie
+ libc_cv_z_execstack
+@@ -6335,6 +6336,39 @@ $as_echo "$libc_cv_use_default_link" >&6; }
+   use_default_link=$libc_cv_use_default_link
+ fi
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_DAT reloc" >&5
++$as_echo_n "checking for GLOB_DAT reloc... " >&6; }
++if ${libc_cv_has_glob_dat+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat > conftest.c <<EOF
++extern int mumble;
++int foo (void) { return mumble; }
++EOF
++if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
++			-fPIC -shared -o conftest.so conftest.c
++			-nostdlib -nostartfiles
++			1>&5'
++  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }; }
++then
++  if $READELF -rW conftest.so | grep '_GLOB_DAT' > /dev/null; then
++    libc_cv_has_glob_dat=yes
++  else
++    libc_cv_has_glob_dat=no
++  fi
++else
++  libc_cv_has_glob_dat=no
++fi
++rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_has_glob_dat" >&5
++$as_echo "$libc_cv_has_glob_dat" >&6; }
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker output format" >&5
+ $as_echo_n "checking linker output format... " >&6; }
+ if ${libc_cv_output_format+:} false; then :
+diff --git a/configure.ac b/configure.ac
+index 7e9383a..8be612d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1535,6 +1535,29 @@ $ac_try"
+   use_default_link=$libc_cv_use_default_link
+ fi
+ 
++AC_CACHE_CHECK(for GLOB_DAT reloc,
++	       libc_cv_has_glob_dat, [dnl
++cat > conftest.c <<EOF
++extern int mumble;
++int foo (void) { return mumble; }
++EOF
++if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
++			-fPIC -shared -o conftest.so conftest.c
++			-nostdlib -nostartfiles
++			1>&AS_MESSAGE_LOG_FD])
++then
++dnl look for GLOB_DAT relocation.
++  if $READELF -rW conftest.so | grep '_GLOB_DAT' > /dev/null; then
++    libc_cv_has_glob_dat=yes
++  else
++    libc_cv_has_glob_dat=no
++  fi
++else
++  libc_cv_has_glob_dat=no
++fi
++rm -f conftest*])
++AC_SUBST(libc_cv_has_glob_dat)
++
+ AC_CACHE_CHECK(linker output format, libc_cv_output_format, [dnl
+ if libc_cv_output_format=`
+ ${CC-cc} -nostartfiles -nostdlib -Wl,--print-output-format 2>&AS_MESSAGE_LOG_FD`
 diff --git a/elf/Makefile b/elf/Makefile
-index 4ceeaf8..71a18a1 100644
+index 4ceeaf8..a2c43bc 100644
 --- a/elf/Makefile
 +++ b/elf/Makefile
 @@ -148,7 +148,8 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
@@ -147,7 +391,21 @@
  ifeq (yes,$(have-protected-data))
  modules-names += tst-protected1moda tst-protected1modb
  tests += tst-protected1a tst-protected1b
-@@ -594,6 +595,7 @@ tst-auditmod9b.so-no-z-defs = yes
+@@ -292,6 +293,13 @@ check-abi: $(objpfx)check-abi-ld.out
+ tests-special += $(objpfx)check-abi-ld.out
+ update-abi: update-abi-ld
+ 
++ifeq ($(have-glob-dat-reloc),yes)
++tests += tst-prelink
++ifeq ($(run-built-tests),yes)
++tests-special += $(objpfx)tst-prelink-cmp.out
++endif
++endif
++
+ include ../Rules
+ 
+ ifeq (yes,$(build-shared))
+@@ -594,6 +602,7 @@ tst-auditmod9b.so-no-z-defs = yes
  tst-nodelete-uniquemod.so-no-z-defs = yes
  tst-nodelete-rtldmod.so-no-z-defs = yes
  tst-nodelete-zmod.so-no-z-defs = yes
@@ -155,7 +413,7 @@
  
  ifeq ($(build-shared),yes)
  # Build all the modules even when not actually running test programs.
-@@ -1164,6 +1166,11 @@ $(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \
+@@ -1164,6 +1173,11 @@ $(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \
  LDFLAGS-tst-nodelete = -rdynamic
  LDFLAGS-tst-nodelete-zmod.so = -Wl,--enable-new-dtags,-z,nodelete
  
@@ -167,6 +425,20 @@
  $(objpfx)tst-initorder-cmp.out: tst-initorder.exp $(objpfx)tst-initorder.out
  	cmp $^ > $@; \
  	$(evaluate-test)
+@@ -1205,3 +1219,13 @@ $(objpfx)tst-unused-dep.out: $(objpfx)testobj1.so
+ $(objpfx)tst-unused-dep-cmp.out: $(objpfx)tst-unused-dep.out
+ 	cmp $< /dev/null > $@; \
+ 	$(evaluate-test)
++
++tst-prelink-ENV = LD_TRACE_PRELINKING=1
++
++$(objpfx)tst-prelink-conflict.out: $(objpfx)tst-prelink.out
++	grep stdout $< | grep conflict | $(AWK) '{ print $$10, $$11 }' > $@
++
++$(objpfx)tst-prelink-cmp.out: tst-prelink.exp \
++			      $(objpfx)tst-prelink-conflict.out
++	cmp $^ > $@; \
++	$(evaluate-test)
 diff --git a/elf/dl-close.c b/elf/dl-close.c
 index 9105277..c897247 100644
 --- a/elf/dl-close.c
@@ -200,6 +472,250 @@
      }
    assert (idx == nloaded);
  
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index 0c052e4..7e6f4c5 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -42,6 +42,7 @@
+ #include <dl-map-segments.h>
+ #include <dl-unmap-segments.h>
+ #include <dl-machine-reject-phdr.h>
++#include <dl-sysdep-open.h>
+ 
+ 
+ #include <endian.h>
+@@ -1471,9 +1472,13 @@ print_search_path (struct r_search_path_elem **list,
+    ignore only ELF files for other architectures.  Non-ELF files and
+    ELF files with different header information cause fatal errors since
+    this could mean there is something wrong in the installation and the
+-   user might want to know about this.  */
++   user might want to know about this.
++
++   If FD is not -1, then the file is already open and FD refers to it.
++   In that case, FD is consumed for both successful and error returns.  */
+ static int
+-open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
++open_verify (const char *name, int fd,
++             struct filebuf *fbp, struct link_map *loader,
+ 	     int whatcode, int mode, bool *found_other_class, bool free_name)
+ {
+   /* This is the expected ELF header.  */
+@@ -1514,6 +1519,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
+   if (__glibc_unlikely (GLRO(dl_naudit) > 0) && whatcode != 0
+       && loader->l_auditing == 0)
+     {
++      const char *original_name = name;
+       struct audit_ifaces *afct = GLRO(dl_audit);
+       for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
+ 	{
+@@ -1528,11 +1534,21 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
+ 
+ 	  afct = afct->next;
+ 	}
++
++      if (fd != -1 && name != original_name && strcmp (name, original_name))
++        {
++          /* An audit library changed what we're supposed to open,
++             so FD no longer matches it.  */
++          __close (fd);
++          fd = -1;
++        }
+     }
+ #endif
+ 
+-  /* Open the file.  We always open files read-only.  */
+-  int fd = __open (name, O_RDONLY | O_CLOEXEC);
++  if (fd == -1)
++    /* Open the file.  We always open files read-only.  */
++    fd = __open (name, O_RDONLY | O_CLOEXEC);
++
+   if (fd != -1)
+     {
+       ElfW(Ehdr) *ehdr;
+@@ -1801,7 +1817,7 @@ open_path (const char *name, size_t namelen, int mode,
+ 	  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
+ 	    _dl_debug_printf ("  trying file=%s\n", buf);
+ 
+-	  fd = open_verify (buf, fbp, loader, whatcode, mode,
++	  fd = open_verify (buf, -1, fbp, loader, whatcode, mode,
+ 			    found_other_class, false);
+ 	  if (this_dir->status[cnt] == unknown)
+ 	    {
+@@ -2041,6 +2057,20 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 			&loader->l_runpath_dirs, &realname, &fb, loader,
+ 			LA_SER_RUNPATH, &found_other_class);
+ 
++      if (fd == -1)
++        {
++          realname = _dl_sysdep_open_object (name, namelen, &fd);
++          if (realname != NULL)
++            {
++              fd = open_verify (realname, fd,
++                                &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
++                                LA_SER_CONFIG, mode, &found_other_class,
++                                false);
++              if (fd == -1)
++                free (realname);
++            }
++        }
++
+ #ifdef USE_LDCONFIG
+       if (fd == -1
+ 	  && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
+@@ -2086,7 +2116,7 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 
+ 	      if (cached != NULL)
+ 		{
+-		  fd = open_verify (cached,
++		  fd = open_verify (cached, -1,
+ 				    &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
+ 				    LA_SER_CONFIG, mode, &found_other_class,
+ 				    false);
+@@ -2121,7 +2151,7 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 	fd = -1;
+       else
+ 	{
+-	  fd = open_verify (realname, &fb,
++	  fd = open_verify (realname, -1, &fb,
+ 			    loader ?: GL(dl_ns)[nsid]._ns_loaded, 0, mode,
+ 			    &found_other_class, true);
+ 	  if (__glibc_unlikely (fd == -1))
+diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
+index 11cb44b..acf5280 100644
+--- a/elf/dl-lookup.c
++++ b/elf/dl-lookup.c
+@@ -1016,6 +1016,18 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
+ #ifdef SHARED
+   if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
+     {
++/* ELF_RTYPE_CLASS_XXX must match RTYPE_CLASS_XXX used by prelink with
++   LD_TRACE_PRELINKING.  */
++#define RTYPE_CLASS_VALID	8
++#define RTYPE_CLASS_PLT		(8|1)
++#define RTYPE_CLASS_COPY	(8|2)
++#define RTYPE_CLASS_TLS		(8|4)
++#if ELF_RTYPE_CLASS_PLT != 0 && ELF_RTYPE_CLASS_PLT != 1
++# error ELF_RTYPE_CLASS_PLT must be 0 or 1!
++#endif
++#if ELF_RTYPE_CLASS_COPY != 0 && ELF_RTYPE_CLASS_COPY != 2
++# error ELF_RTYPE_CLASS_COPY must be 0 or 2!
++#endif
+       int conflict = 0;
+       struct sym_val val = { NULL, NULL };
+ 
+@@ -1071,12 +1083,17 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
+ 
+       if (value->s)
+ 	{
++	  /* Keep only ELF_RTYPE_CLASS_PLT and ELF_RTYPE_CLASS_COPY
++	     bits since since prelink only uses them.  */
++	  type_class &= ELF_RTYPE_CLASS_PLT | ELF_RTYPE_CLASS_COPY;
+ 	  if (__glibc_unlikely (ELFW(ST_TYPE) (value->s->st_info)
+ 				== STT_TLS))
+-	    type_class = 4;
++	    /* Clear the RTYPE_CLASS_VALID bit in RTYPE_CLASS_TLS.  */
++	    type_class = RTYPE_CLASS_TLS & ~RTYPE_CLASS_VALID;
+ 	  else if (__glibc_unlikely (ELFW(ST_TYPE) (value->s->st_info)
+ 				     == STT_GNU_IFUNC))
+-	    type_class |= 8;
++	    /* Set the RTYPE_CLASS_VALID bit.  */
++	    type_class |= RTYPE_CLASS_VALID;
+ 	}
+ 
+       if (conflict
+diff --git a/elf/dl-sysdep-open.h b/elf/dl-sysdep-open.h
+new file mode 100644
+index 0000000..a63d9f5
+--- /dev/null
++++ b/elf/dl-sysdep-open.h
+@@ -0,0 +1,45 @@
++/* System-specific call to open a shared object by name.  Stub version.
++   Copyright (C) 2015 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/>.  */
++
++#ifndef _DL_SYSDEP_OPEN_H
++#define _DL_SYSDEP_OPEN_H	1
++
++#include <assert.h>
++#include <stddef.h>
++
++/* NAME is a name without slashes, as it appears in a DT_NEEDED entry
++   or a dlopen call's argument or suchlike.  NAMELEN is (strlen (NAME) + 1).
++
++   Find NAME in an OS-dependent fashion, and return its "real" name.
++   Optionally fill in *FD with a file descriptor open on that file (or
++   else leave its initial value of -1).  The return value is a new
++   malloc'd string, which will be free'd by the caller.  If NAME is
++   resolved to an actual file that can be opened, then the return
++   value should name that file (and if *FD was not set, then a normal
++   __open call on that string will be made).  If *FD was set by some
++   other means than a normal open and there is no "real" name to use,
++   then __strdup (NAME) is fine (modulo error checking).  */
++
++static inline char *
++_dl_sysdep_open_object (const char *name, size_t namelen, int *fd)
++{
++  assert (*fd == -1);
++  return NULL;
++}
++
++#endif  /* dl-sysdep-open.h */
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 69873c2..07e741c 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -162,7 +162,6 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
+     ._dl_hwcap_mask = HWCAP_IMPORTANT,
+     ._dl_lazy = 1,
+     ._dl_fpu_control = _FPU_DEFAULT,
+-    ._dl_pointer_guard = 1,
+     ._dl_pagesize = EXEC_PAGESIZE,
+     ._dl_inhibit_cache = 0,
+ 
+@@ -709,15 +708,12 @@ security_init (void)
+ #endif
+ 
+   /* Set up the pointer guard as well, if necessary.  */
+-  if (GLRO(dl_pointer_guard))
+-    {
+-      uintptr_t pointer_chk_guard = _dl_setup_pointer_guard (_dl_random,
+-							     stack_chk_guard);
++  uintptr_t pointer_chk_guard
++    = _dl_setup_pointer_guard (_dl_random, stack_chk_guard);
+ #ifdef THREAD_SET_POINTER_GUARD
+-      THREAD_SET_POINTER_GUARD (pointer_chk_guard);
++  THREAD_SET_POINTER_GUARD (pointer_chk_guard);
+ #endif
+-      __pointer_chk_guard_local = pointer_chk_guard;
+-    }
++  __pointer_chk_guard_local = pointer_chk_guard;
+ 
+   /* We do not need the _dl_random value anymore.  The less
+      information we leave behind, the better, so clear the
+@@ -2471,9 +2467,6 @@ process_envvars (enum mode *modep)
+ 	      GLRO(dl_use_load_bias) = envline[14] == '1' ? -1 : 0;
+ 	      break;
+ 	    }
+-
+-	  if (memcmp (envline, "POINTER_GUARD", 13) == 0)
+-	    GLRO(dl_pointer_guard) = envline[14] != '0';
+ 	  break;
+ 
+ 	case 14:
 diff --git a/elf/tst-nodelete2.c b/elf/tst-nodelete2.c
 new file mode 100644
 index 0000000..388e8af
@@ -256,6 +772,49 @@
 +{
 +  return not_exist ();
 +}
+diff --git a/elf/tst-prelink.c b/elf/tst-prelink.c
+new file mode 100644
+index 0000000..ab61c4e
+--- /dev/null
++++ b/elf/tst-prelink.c
+@@ -0,0 +1,30 @@
++/* Test the output from the environment variable, LD_TRACE_PRELINKING,
++   for prelink.
++   Copyright (C) 2015 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 <stdio.h>
++
++static int
++do_test (void)
++{
++  fprintf (stdout, "hello\n");
++  return 0;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+diff --git a/elf/tst-prelink.exp b/elf/tst-prelink.exp
+new file mode 100644
+index 0000000..b35b4c9
+--- /dev/null
++++ b/elf/tst-prelink.exp
+@@ -0,0 +1 @@
++/0 stdout
 diff --git a/elf/tst-znodelete-zlib.cc b/elf/tst-znodelete-zlib.cc
 deleted file mode 100644
 index 1e8f368..0000000
@@ -307,6 +866,110 @@
    test_ftello ();
  
    return 0;
+diff --git a/locale/C-collate.c b/locale/C-collate.c
+index d7f3c55..06dfdfa 100644
+--- a/locale/C-collate.c
++++ b/locale/C-collate.c
+@@ -144,8 +144,6 @@ const struct __locale_data _nl_C_LC_COLLATE attribute_hidden =
+     /* _NL_COLLATE_COLLSEQWC */
+     { .string = (const char *) collseqwc },
+     /* _NL_COLLATE_CODESET */
+-    { .string = _nl_C_codeset },
+-    /* _NL_COLLATE_ENCODING_TYPE */
+-    { .word = __cet_8bit }
++    { .string = _nl_C_codeset }
+   }
+ };
+diff --git a/locale/categories.def b/locale/categories.def
+index 045489d..a8dda53 100644
+--- a/locale/categories.def
++++ b/locale/categories.def
+@@ -58,7 +58,6 @@ DEFINE_CATEGORY
+   DEFINE_ELEMENT (_NL_COLLATE_COLLSEQMB,        "collate-collseqmb",        std, wstring)
+   DEFINE_ELEMENT (_NL_COLLATE_COLLSEQWC,        "collate-collseqwc",        std, wstring)
+   DEFINE_ELEMENT (_NL_COLLATE_CODESET,		"collate-codeset",	    std, string)
+-  DEFINE_ELEMENT (_NL_COLLATE_ENCODING_TYPE,   "collate-encoding-type",    std, word)
+   ), NO_POSTLOAD)
+ 
+ 
+diff --git a/locale/langinfo.h b/locale/langinfo.h
+index ffc5c7f..a565d9d 100644
+--- a/locale/langinfo.h
++++ b/locale/langinfo.h
+@@ -255,7 +255,6 @@ enum
+   _NL_COLLATE_COLLSEQMB,
+   _NL_COLLATE_COLLSEQWC,
+   _NL_COLLATE_CODESET,
+-  _NL_COLLATE_ENCODING_TYPE,
+   _NL_NUM_LC_COLLATE,
+ 
+   /* LC_CTYPE category: character classification.
+diff --git a/locale/localeinfo.h b/locale/localeinfo.h
+index bdab9fe..1d2ee00 100644
+--- a/locale/localeinfo.h
++++ b/locale/localeinfo.h
+@@ -110,14 +110,6 @@ enum coll_sort_rule
+   sort_mask
+ };
+ 
+-/* Collation encoding type.  */
+-enum collation_encoding_type
+-{
+-  __cet_other,
+-  __cet_8bit,
+-  __cet_utf8
+-};
+-
+ /* We can map the types of the entries into a few categories.  */
+ enum value_type
+ {
+diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
+index a39a94f..dc0fe30 100644
+--- a/locale/programs/ld-collate.c
++++ b/locale/programs/ld-collate.c
+@@ -32,7 +32,6 @@
+ #include "linereader.h"
+ #include "locfile.h"
+ #include "elem-hash.h"
+-#include "../localeinfo.h"
+ 
+ /* Uncomment the following line in the production version.  */
+ /* #define NDEBUG 1 */
+@@ -2131,8 +2130,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
+ 	  /* The words have to be handled specially.  */
+ 	  if (idx == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_HASH_SIZEMB))
+ 	    add_locale_uint32 (&file, 0);
+-	  else if (idx == _NL_ITEM_INDEX (_NL_COLLATE_ENCODING_TYPE))
+-	    add_locale_uint32 (&file, __cet_other);
+ 	  else
+ 	    add_locale_empty (&file);
+ 	}
+@@ -2496,12 +2493,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
+   add_locale_raw_data (&file, collate->mbseqorder, 256);
+   add_locale_collseq_table (&file, &collate->wcseqorder);
+   add_locale_string (&file, charmap->code_set_name);
+-  if (strcmp (charmap->code_set_name, "UTF-8") == 0)
+-    add_locale_uint32 (&file, __cet_utf8);
+-  else if (charmap->mb_cur_max == 1)
+-    add_locale_uint32 (&file, __cet_8bit);
+-  else
+-    add_locale_uint32 (&file, __cet_other);
+   write_locale_data (output_path, LC_COLLATE, "LC_COLLATE", &file);
+ 
+   obstack_free (&weightpool, NULL);
+diff --git a/math/Makefile b/math/Makefile
+index 6388bae..76f99fb 100644
+--- a/math/Makefile
++++ b/math/Makefile
+@@ -98,7 +98,7 @@ $(inst_libdir)/libm.so: $(common-objpfx)format.lds \
+ 	(echo '/* GNU ld script'; echo '*/';\
+ 	 cat $<; \
+ 	 echo 'GROUP ( $(slibdir)/libm.so$(libm.so-version) ' \
+-	      'AS_NEEDED ( $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \
++	      'AS_NEEDED ( $(slibdir)/libmvec_nonshared.a $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \
+ 	) > $@
+ endif
+ 
 diff --git a/misc/Makefile b/misc/Makefile
 index aecb0da..2f5edf6 100644
 --- a/misc/Makefile
@@ -551,6 +1214,277 @@
      if ($name ne "nss_ldap" && $name ne "db1"
  	&& !($name =~/^nss1_/) && $name ne "thread_db"
  	&& $name ne "nss_test1" && $name ne "libgcc_s") {
+diff --git a/stdlib/cxa_thread_atexit_impl.c b/stdlib/cxa_thread_atexit_impl.c
+index 2d5d56a..5717f09 100644
+--- a/stdlib/cxa_thread_atexit_impl.c
++++ b/stdlib/cxa_thread_atexit_impl.c
+@@ -98,6 +98,10 @@ static __thread struct link_map *lm_cache;
+ int
+ __cxa_thread_atexit_impl (dtor_func func, void *obj, void *dso_symbol)
+ {
++#ifdef PTR_MANGLE
++  PTR_MANGLE (func);
++#endif
++
+   /* Prepend.  */
+   struct dtor_list *new = calloc (1, sizeof (struct dtor_list));
+   new->func = func;
+@@ -142,9 +146,13 @@ __call_tls_dtors (void)
+   while (tls_dtor_list)
+     {
+       struct dtor_list *cur = tls_dtor_list;
++      dtor_func func = cur->func;
++#ifdef PTR_DEMANGLE
++      PTR_DEMANGLE (func);
++#endif
+ 
+       tls_dtor_list = tls_dtor_list->next;
+-      cur->func (cur->obj);
++      func (cur->obj);
+ 
+       /* Ensure that the MAP dereference happens before
+ 	 l_tls_dtor_count decrement.  That way, we protect this access from a
+diff --git a/string/Makefile b/string/Makefile
+index 8424a61..ebe9354 100644
+--- a/string/Makefile
++++ b/string/Makefile
+@@ -54,7 +54,7 @@ tests		:= tester inl-tester noinl-tester testcopy test-ffs	\
+ 		   tst-strtok tst-strxfrm bug-strcoll1 tst-strfry	\
+ 		   bug-strtok1 $(addprefix test-,$(strop-tests))	\
+ 		   bug-envz1 tst-strxfrm2 tst-endian tst-svc2		\
+-		   tst-strtok_r
++		   tst-strtok_r bug-strcoll2
+ 
+ xtests = tst-strcoll-overflow
+ 
+@@ -75,4 +75,17 @@ ifeq ($(run-built-tests),yes)
+ $(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
+ 	cmp $^ > $@; \
+ 	$(evaluate-test)
++
++LOCALES := de_DE.UTF-8 en_US.ISO-8859-1 en_US.UTF-8 \
++           tr_TR.ISO-8859-9 tr_TR.UTF-8 cs_CZ.UTF-8 \
++	   da_DK.ISO-8859-1
++include ../gen-locales.mk
++
++$(objpfx)test-strcasecmp.out: $(gen-locales)
++$(objpfx)test-strncasecmp.out: $(gen-locales)
++$(objpfx)tst-strxfrm.out: $(gen-locales)
++$(objpfx)tst-strxfrm2.out: $(gen-locales)
++# bug-strcoll2 needs cs_CZ.UTF-8 and da_DK.ISO-8859-1.
++$(objpfx)bug-strcoll2.out: $(gen-locales)
++
+ endif
+diff --git a/string/bug-strcoll2.c b/string/bug-strcoll2.c
+new file mode 100644
+index 0000000..72a9ff2
+--- /dev/null
++++ b/string/bug-strcoll2.c
+@@ -0,0 +1,92 @@
++/* Bug 18589: sort-test.sh fails at random.
++   Copyright (C) 2015 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 <stdio.h>
++#include <string.h>
++#include <locale.h>
++
++/* An incorrect strcoll optimization resulted in incorrect
++   results from strcoll for cs_CZ and da_DK.  */
++
++int
++test_cs_CZ (void)
++{
++  const char t1[] = "config";
++  const char t2[] = "choose";
++  if (setlocale (LC_ALL, "cs_CZ.UTF-8") == NULL)
++    {
++      perror ("setlocale");
++      return 1;
++    }
++  /* In Czech the digraph ch sorts after c, therefore we expect
++     config to sort before choose.  */
++  int a = strcoll (t1, t2);
++  int b = strcoll (t2, t1);
++  printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, a);
++  printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, b);
++  if (a < 0 && b > 0)
++    {
++      puts ("PASS: config < choose");
++      return 0;
++    }
++  else
++    {
++      puts ("FAIL: Wrong sorting in cs_CZ.UTF-8.");
++      return 1;
++    }
++}
++
++int
++test_da_DK (void)
++{
++  const char t1[] = "AS";
++  const char t2[] = "AA";
++  if (setlocale (LC_ALL, "da_DK.ISO-8859-1") == NULL)
++    {
++      perror ("setlocale");
++      return 1;
++    }
++  /* AA should be treated as the last letter of the Danish alphabet,
++     hence sorting after AS.  */
++  int a = strcoll (t1, t2);
++  int b = strcoll (t2, t1);
++  printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, a);
++  printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, b);
++  if (a < 0 && b > 0)
++    {
++      puts ("PASS: AS < AA");
++      return 0;
++    }
++  else
++    {
++      puts ("FAIL: Wrong sorting in da_DK.ISO-8859-1");
++      return 1;
++    }
++}
++
++static int
++do_test (void)
++{
++  int err = 0;
++  err |= test_cs_CZ ();
++  err |= test_da_DK ();
++  return err;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+diff --git a/string/strcoll_l.c b/string/strcoll_l.c
+index 8f1225f..35bc0e4 100644
+--- a/string/strcoll_l.c
++++ b/string/strcoll_l.c
+@@ -29,7 +29,6 @@
+ # define STRING_TYPE char
+ # define USTRING_TYPE unsigned char
+ # define STRCOLL __strcoll_l
+-# define STRDIFF __strdiff
+ # define STRCMP strcmp
+ # define WEIGHT_H "../locale/weight.h"
+ # define SUFFIX	MB
+@@ -42,20 +41,6 @@
+ #include "../locale/localeinfo.h"
+ #include WEIGHT_H
+ 
+-#define MASK_UTF8_7BIT  (1 << 7)
+-#define MASK_UTF8_START (3 << 6)
+-
+-size_t
+-STRDIFF (const STRING_TYPE *s, const STRING_TYPE *t)
+-{
+-  size_t n;
+-
+-  for (n = 0; *s != '\0' && *s++ == *t++; ++n)
+-    continue;
+-
+-  return n;
+-}
+-
+ /* Track status while looking for sequences in a string.  */
+ typedef struct
+ {
+@@ -269,29 +254,9 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l)
+   const USTRING_TYPE *extra;
+   const int32_t *indirect;
+ 
+-  /* In case there is no locale specific sort order (C / POSIX).  */
+   if (nrules == 0)
+     return STRCMP (s1, s2);
+ 
+-  /* Fast forward to the position of the first difference.  Needs to be
+-     encoding aware as the byte-by-byte comparison can stop in the middle
+-     of a char sequence for multibyte encodings like UTF-8.  */
+-  uint_fast32_t encoding =
+-    current->values[_NL_ITEM_INDEX (_NL_COLLATE_ENCODING_TYPE)].word;
+-  if (encoding != __cet_other)
+-    {
+-      size_t diff = STRDIFF (s1, s2);
+-      if (diff > 0)
+-	{
+-	  if (encoding == __cet_utf8 && (*(s1 + diff) & MASK_UTF8_7BIT) != 0)
+-	    do
+-	      diff--;
+-	    while (diff > 0 && (*(s1 + diff) & MASK_UTF8_START) != MASK_UTF8_START);
+-	  s1 += diff;
+-	  s2 += diff;
+-	}
+-    }
+-
+   /* Catch empty strings.  */
+   if (__glibc_unlikely (*s1 == '\0') || __glibc_unlikely (*s2 == '\0'))
+     return (*s1 != '\0') - (*s2 != '\0');
+@@ -358,8 +323,7 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l)
+ 		     byte-level comparison to ensure that we don't waste time
+ 		     going through multiple passes for totally equal strings
+ 		     before proceeding to subsequent passes.  */
+-		  if (pass == 0 && encoding == __cet_other &&
+-		      STRCMP (s1, s2) == 0)
++		  if (pass == 0 && STRCMP (s1, s2) == 0)
+ 		    return result;
+ 		  else
+ 		    break;
+diff --git a/string/tst-strxfrm2.c b/string/tst-strxfrm2.c
+index d5a1115..bea5aa2 100644
+--- a/string/tst-strxfrm2.c
++++ b/string/tst-strxfrm2.c
+@@ -5,6 +5,8 @@
+ static int
+ do_test (void)
+ {
++  static const char test_locale[] = "de_DE.UTF-8";
++
+   int res = 0;
+ 
+   char buf[20];
+@@ -38,9 +40,9 @@ do_test (void)
+       res = 1;
+     }
+ 
+-  if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
++  if (setlocale (LC_ALL, test_locale) == NULL)
+     {
+-      puts ("setlocale failed");
++      printf ("cannot set locale \"%s\"\n", test_locale);
+       res = 1;
+     }
+   else
+diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
+index 7a0fe8d..78e3a97 100644
+--- a/sysdeps/generic/ldsodefs.h
++++ b/sysdeps/generic/ldsodefs.h
+@@ -592,9 +592,6 @@ struct rtld_global_ro
+   /* List of auditing interfaces.  */
+   struct audit_ifaces *_dl_audit;
+   unsigned int _dl_naudit;
+-
+-  /* 0 if internal pointer values should not be guarded, 1 if they should.  */
+-  EXTERN int _dl_pointer_guard;
+ };
+ # define __rtld_global_attribute__
+ # if IS_IN (rtld)
 diff --git a/sysdeps/hppa/dl-symaddr.c b/sysdeps/hppa/dl-symaddr.c
 index b707c19..89d8baf 100644
 --- a/sysdeps/hppa/dl-symaddr.c
@@ -578,6 +1512,142 @@
 +# this coming up seems unlikely.
 +override sysdep_headers := $(sysdep_headers)
  endif
+diff --git a/sysdeps/nacl/dl-map-segments.h b/sysdeps/nacl/dl-map-segments.h
+index f305da3..f2d5d84 100644
+--- a/sysdeps/nacl/dl-map-segments.h
++++ b/sysdeps/nacl/dl-map-segments.h
+@@ -53,7 +53,7 @@ _dl_map_segments (struct link_map *l, int fd,
+ 		  const size_t maplength, bool has_holes,
+ 		  struct link_map *loader)
+ {
+-  if (__builtin_expect (type, ET_DYN) == ET_DYN)
++  if (__glibc_likely (type == ET_DYN))
+     {
+       /* This is a position-independent shared object.  Let the system
+ 	 choose where to place it.
+@@ -165,6 +165,32 @@ _dl_map_segments (struct link_map *l, int fd,
+ 		    errno = error;
+ 		    return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
+ 		  }
++                if (__glibc_unlikely (type != ET_DYN))
++                  {
++                    /* A successful PROT_EXEC mmap would have implicitly
++                       updated the bookkeeping so that a future
++                       allocate_code_data call would know that this range
++                       of the address space is already occupied.  That
++                       doesn't happen implicitly with dyncode_create, so
++                       it's necessary to do an explicit call to update the
++                       bookkeeping.  */
++                    uintptr_t allocated_address;
++                    error = __nacl_irt_code_data_alloc.allocate_code_data
++                      (l->l_addr + c->mapstart, len, 0, 0, &allocated_address);
++                    if (__glibc_unlikely (error))
++                      {
++                        errno = error;
++                        return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
++                      }
++                    if (__glibc_unlikely
++                        (allocated_address != l->l_addr + c->mapstart))
++                      {
++                        /* This is not a very helpful error for this case,
++                           but there isn't really anything better to use.  */
++                        errno = ENOMEM;
++                        return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
++                      }
++                  }
+ 	      }
+ 	    else
+ 	      {
+diff --git a/sysdeps/nacl/dl-sysdep-open.h b/sysdeps/nacl/dl-sysdep-open.h
+new file mode 100644
+index 0000000..38b0f9e
+--- /dev/null
++++ b/sysdeps/nacl/dl-sysdep-open.h
+@@ -0,0 +1,40 @@
++/* System-specific call to open a shared object by name.  NaCl version.
++   Copyright (C) 2015 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/>.  */
++
++#ifndef _DL_SYSDEP_OPEN_H
++#define _DL_SYSDEP_OPEN_H	1
++
++#include <stddef.h>
++
++/* NAME is a name without slashes, as it appears in a DT_NEEDED entry
++   or a dlopen call's argument or suchlike.  NAMELEN is (strlen (NAME) + 1).
++
++   Find NAME in an OS-dependent fashion, and return its "real" name.
++   Optionally fill in *FD with a file descriptor open on that file (or
++   else leave its initial value of -1).  The return value is a new
++   malloc'd string, which will be free'd by the caller.  If NAME is
++   resolved to an actual file that can be opened, then the return
++   value should name that file (and if *FD was not set, then a normal
++   __open call on that string will be made).  If *FD was set by some
++   other means than a normal open and there is no "real" name to use,
++   then __strdup (NAME) is fine (modulo error checking).  */
++
++extern char *_dl_sysdep_open_object (const char *name, size_t namelen, int *fd)
++  internal_function attribute_hidden;
++
++#endif  /* dl-sysdep-open.h */
+diff --git a/sysdeps/nacl/dl-sysdep.c b/sysdeps/nacl/dl-sysdep.c
+index 3e902c2..3a04aa1 100644
+--- a/sysdeps/nacl/dl-sysdep.c
++++ b/sysdeps/nacl/dl-sysdep.c
+@@ -87,3 +87,26 @@ _dl_start_user (void (*user_entry) (uint32_t info[]), uint32_t info[])
+ #endif  /* SHARED */
+ 
+ #include <elf/dl-sysdep.c>
++
++#include <dl-sysdep-open.h>
++#include <nacl-interfaces.h>
++#include <assert.h>
++#include <string.h>
++#include <unistd.h>
++
++char *
++internal_function
++_dl_sysdep_open_object (const char *name, size_t namelen, int *fd)
++{
++  int error = __nacl_irt_resource_open.open_resource (name, fd);
++  if (error)
++    return NULL;
++  assert (*fd != -1);
++  char *realname = __strdup (name);
++  if (__glibc_unlikely (realname == NULL))
++    {
++      __close (*fd);
++      *fd = -1;
++    }
++  return realname;
++}
+diff --git a/sysdeps/nacl/nacl-interface-list.h b/sysdeps/nacl/nacl-interface-list.h
+index cb33751..c68faed 100644
+--- a/sysdeps/nacl/nacl-interface-list.h
++++ b/sysdeps/nacl/nacl-interface-list.h
+@@ -28,7 +28,7 @@ NACL_MANDATORY_INTERFACE (rtld,
+ 			  NACL_IRT_FUTEX_v0_1, nacl_irt_futex)
+ NACL_MANDATORY_INTERFACE (rtld,
+ 			  NACL_IRT_TLS_v0_1, nacl_irt_tls)
+-NACL_MANDATORY_INTERFACE (libc,
++NACL_MANDATORY_INTERFACE (rtld,
+ 			  NACL_IRT_RESOURCE_OPEN_v0_1, nacl_irt_resource_open)
+ NACL_MANDATORY_INTERFACE (rtld,
+ 			  NACL_IRT_CODE_DATA_ALLOC_v0_1,
 diff --git a/sysdeps/nacl/start.c b/sysdeps/nacl/start.c
 index a4b6dd3..8e8bc1a 100644
 --- a/sysdeps/nacl/start.c
@@ -615,6 +1685,141 @@
  #endif
    return true;
  }
+diff --git a/sysdeps/powerpc/nptl/elide.h b/sysdeps/powerpc/nptl/elide.h
+index 389f5a5..12171f4 100644
+--- a/sysdeps/powerpc/nptl/elide.h
++++ b/sysdeps/powerpc/nptl/elide.h
+@@ -23,67 +23,78 @@
+ # include <htm.h>
+ # include <elision-conf.h>
+ 
+-/* Returns true if the lock defined by is_lock_free as elided.
+-   ADAPT_COUNT is a pointer to per-lock state variable. */
+-
++/* Get the new value of adapt_count according to the elision
++   configurations.  Returns true if the system should retry again or false
++   otherwise.  */
+ static inline bool
+-__elide_lock (uint8_t *adapt_count, int is_lock_free)
++__get_new_count (uint8_t *adapt_count)
+ {
+-  if (*adapt_count > 0)
++  /* A persistent failure indicates that a retry will probably
++     result in another failure.  Use normal locking now and
++     for the next couple of calls.  */
++  if (_TEXASRU_FAILURE_PERSISTENT (__builtin_get_texasru ()))
+     {
+-      (*adapt_count)--;
++      if (__elision_aconf.skip_lock_internal_abort > 0)
++	*adapt_count = __elision_aconf.skip_lock_internal_abort;
+       return false;
+     }
+-
+-  for (int i = __elision_aconf.try_tbegin; i > 0; i--)
+-    {
+-      if (__builtin_tbegin (0))
+-	{
+-	  if (is_lock_free)
+-	    return true;
+-	  /* Lock was busy.  */
+-	  __builtin_tabort (_ABORT_LOCK_BUSY);
+-	}
+-      else
+-	{
+-	  /* A persistent failure indicates that a retry will probably
+-	     result in another failure.  Use normal locking now and
+-	     for the next couple of calls.  */
+-	  if (_TEXASRU_FAILURE_PERSISTENT (__builtin_get_texasru ()))
+-	    {
+-	      if (__elision_aconf.skip_lock_internal_abort > 0)
+-		*adapt_count = __elision_aconf.skip_lock_internal_abort;
+-	      break;
+-	    }
+-	  /* Same logic as above, but for a number of temporary failures in a
+-	     a row.  */
+-	  else if (__elision_aconf.skip_lock_out_of_tbegin_retries > 0
+-		   && __elision_aconf.try_tbegin > 0)
+-	    *adapt_count = __elision_aconf.skip_lock_out_of_tbegin_retries;
+-	}
+-     }
+-
+-  return false;
++  /* Same logic as above, but for a number of temporary failures in a
++     a row.  */
++  else if (__elision_aconf.skip_lock_out_of_tbegin_retries > 0
++	   && __elision_aconf.try_tbegin > 0)
++    *adapt_count = __elision_aconf.skip_lock_out_of_tbegin_retries;
++  return true;
+ }
+ 
+-# define ELIDE_LOCK(adapt_count, is_lock_free) \
+-  __elide_lock (&(adapt_count), is_lock_free)
+-
+-
+-static inline bool
+-__elide_trylock (uint8_t *adapt_count, int is_lock_free, int write)
+-{
+-  if (__elision_aconf.try_tbegin > 0)
+-    {
+-      if (write)
+-	__builtin_tabort (_ABORT_NESTED_TRYLOCK);
+-      return __elide_lock (adapt_count, is_lock_free);
+-    }
+-  return false;
+-}
++/* CONCURRENCY NOTES:
++
++   The evaluation of the macro expression is_lock_free encompasses one or
++   more loads from memory locations that are concurrently modified by other
++   threads.  For lock elision to work, this evaluation and the rest of the
++   critical section protected by the lock must be atomic because an
++   execution with lock elision must be equivalent to an execution in which
++   the lock would have been actually acquired and released.  Therefore, we
++   evaluate is_lock_free inside of the transaction that represents the
++   critical section for which we want to use lock elision, which ensures
++   the atomicity that we require.  */
++
++/* Returns 0 if the lock defined by is_lock_free was elided.
++   ADAPT_COUNT is a per-lock state variable.  */
++# define ELIDE_LOCK(adapt_count, is_lock_free)				\
++  ({									\
++    int ret = 0;							\
++    if (adapt_count > 0)						\
++      (adapt_count)--;							\
++    else								\
++      for (int i = __elision_aconf.try_tbegin; i > 0; i--)		\
++	{								\
++	  if (__builtin_tbegin (0))					\
++	    {								\
++	      if (is_lock_free)						\
++		{							\
++		  ret = 1;						\
++		  break;						\
++		}							\
++	      __builtin_tabort (_ABORT_LOCK_BUSY);			\
++	    }								\
++	  else								\
++	    if (!__get_new_count(&adapt_count))				\
++	      break;							\
++	}								\
++    ret;								\
++  })
+ 
+ # define ELIDE_TRYLOCK(adapt_count, is_lock_free, write)	\
+-  __elide_trylock (&(adapt_count), is_lock_free, write)
++  ({								\
++    int ret = 0;						\
++    if (__elision_aconf.try_tbegin > 0)				\
++      {								\
++	if (write)						\
++	  __builtin_tabort (_ABORT_NESTED_TRYLOCK);		\
++	ret = ELIDE_LOCK (adapt_count, is_lock_free);		\
++      }								\
++    ret;							\
++  })
+ 
+ 
+ static inline bool
 diff --git a/sysdeps/sparc/sparc32/sem_open.c b/sysdeps/sparc/sparc32/sem_open.c
 index 16cb9ad..59df2d7 100644
 --- a/sysdeps/sparc/sparc32/sem_open.c
@@ -730,3 +1935,135 @@
    return SYSCALL_CANCEL (openat, fd, file, oflag, mode);
  }
  libc_hidden_def (__OPENAT)
+diff --git a/sysdeps/x86/fpu/bits/math-vector.h b/sysdeps/x86/fpu/bits/math-vector.h
+index f9e798b..f3bfb86 100644
+--- a/sysdeps/x86/fpu/bits/math-vector.h
++++ b/sysdeps/x86/fpu/bits/math-vector.h
+@@ -53,34 +53,5 @@
+ #  undef __DECL_SIMD_powf
+ #  define __DECL_SIMD_powf __DECL_SIMD_x86_64
+ 
+-/* Workaround to exclude unnecessary symbol aliases in libmvec
+-   while GCC creates the vector names based on scalar asm name.
+-   Corresponding discussion started at
+-   <https://gcc.gnu.org/ml/gcc/2015-06/msg00173.html>.  */
+-__asm__ ("_ZGVbN2v___log_finite = _ZGVbN2v_log");
+-__asm__ ("_ZGVcN4v___log_finite = _ZGVcN4v_log");
+-__asm__ ("_ZGVdN4v___log_finite = _ZGVdN4v_log");
+-__asm__ ("_ZGVeN8v___log_finite = _ZGVeN8v_log");
+-__asm__ ("_ZGVbN4v___logf_finite = _ZGVbN4v_logf");
+-__asm__ ("_ZGVcN8v___logf_finite = _ZGVcN8v_logf");
+-__asm__ ("_ZGVdN8v___logf_finite = _ZGVdN8v_logf");
+-__asm__ ("_ZGVeN16v___logf_finite = _ZGVeN16v_logf");
+-__asm__ ("_ZGVbN2v___exp_finite = _ZGVbN2v_exp");
+-__asm__ ("_ZGVcN4v___exp_finite = _ZGVcN4v_exp");
+-__asm__ ("_ZGVdN4v___exp_finite = _ZGVdN4v_exp");
+-__asm__ ("_ZGVeN8v___exp_finite = _ZGVeN8v_exp");
+-__asm__ ("_ZGVbN4v___expf_finite = _ZGVbN4v_expf");
+-__asm__ ("_ZGVcN8v___expf_finite = _ZGVcN8v_expf");
+-__asm__ ("_ZGVdN8v___expf_finite = _ZGVdN8v_expf");
+-__asm__ ("_ZGVeN16v___expf_finite = _ZGVeN16v_expf");
+-__asm__ ("_ZGVbN2vv___pow_finite = _ZGVbN2vv_pow");
+-__asm__ ("_ZGVcN4vv___pow_finite = _ZGVcN4vv_pow");
+-__asm__ ("_ZGVdN4vv___pow_finite = _ZGVdN4vv_pow");
+-__asm__ ("_ZGVeN8vv___pow_finite = _ZGVeN8vv_pow");
+-__asm__ ("_ZGVbN4vv___powf_finite = _ZGVbN4vv_powf");
+-__asm__ ("_ZGVcN8vv___powf_finite = _ZGVcN8vv_powf");
+-__asm__ ("_ZGVdN8vv___powf_finite = _ZGVdN8vv_powf");
+-__asm__ ("_ZGVeN16vv___powf_finite = _ZGVeN16vv_powf");
+-
+ # endif
+ #endif
+diff --git a/sysdeps/x86_64/fpu/Makefile b/sysdeps/x86_64/fpu/Makefile
+index 1ebe511..b32b852 100644
+--- a/sysdeps/x86_64/fpu/Makefile
++++ b/sysdeps/x86_64/fpu/Makefile
+@@ -20,7 +20,10 @@ libmvec-support += svml_d_cos2_core svml_d_cos4_core_avx \
+ 		   svml_d_pow_data svml_s_powf4_core svml_s_powf8_core_avx \
+ 		   svml_s_powf8_core svml_s_powf16_core svml_s_powf_data \
+ 		   svml_s_sincosf4_core svml_s_sincosf8_core_avx \
+-		   svml_s_sincosf8_core svml_s_sincosf16_core init-arch
++		   svml_s_sincosf8_core svml_s_sincosf16_core init-arch \
++		   svml_finite_alias
++
++libmvec-static-only-routines = svml_finite_alias
+ endif
+ 
+ # Variables for libmvec tests.
+diff --git a/sysdeps/x86_64/fpu/svml_finite_alias.S b/sysdeps/x86_64/fpu/svml_finite_alias.S
+new file mode 100644
+index 0000000..f8bcfeb
+--- /dev/null
++++ b/sysdeps/x86_64/fpu/svml_finite_alias.S
+@@ -0,0 +1,59 @@
++/* These aliases added as workaround to exclude unnecessary symbol
++   aliases in libmvec.so while compiler creates the vector names
++   based on scalar asm name.  Corresponding discussion is at
++   <https://gcc.gnu.org/ml/gcc/2015-06/msg00173.html>.
++   Copyright (C) 2015 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 <sysdep.h>
++
++#define ALIAS_IMPL(alias, target) \
++ENTRY (alias); \
++	call target; \
++	ret; \
++END (alias)
++
++	.text
++ALIAS_IMPL (_ZGVbN2v___log_finite, _ZGVbN2v_log)
++ALIAS_IMPL (_ZGVcN4v___log_finite, _ZGVcN4v_log)
++ALIAS_IMPL (_ZGVdN4v___log_finite, _ZGVdN4v_log)
++ALIAS_IMPL (_ZGVeN8v___log_finite, _ZGVeN8v_log)
++
++ALIAS_IMPL (_ZGVbN4v___logf_finite, _ZGVbN4v_logf)
++ALIAS_IMPL (_ZGVcN8v___logf_finite, _ZGVcN8v_logf)
++ALIAS_IMPL (_ZGVdN8v___logf_finite, _ZGVdN8v_logf)
++ALIAS_IMPL (_ZGVeN16v___logf_finite, _ZGVeN16v_logf)
++
++ALIAS_IMPL (_ZGVbN2v___exp_finite, _ZGVbN2v_exp)
++ALIAS_IMPL (_ZGVcN4v___exp_finite, _ZGVcN4v_exp)
++ALIAS_IMPL (_ZGVdN4v___exp_finite, _ZGVdN4v_exp)
++ALIAS_IMPL (_ZGVeN8v___exp_finite, _ZGVeN8v_exp)
++
++ALIAS_IMPL (_ZGVbN4v___expf_finite, _ZGVbN4v_expf)
++ALIAS_IMPL (_ZGVcN8v___expf_finite, _ZGVcN8v_expf)
++ALIAS_IMPL (_ZGVdN8v___expf_finite, _ZGVdN8v_expf)
++ALIAS_IMPL (_ZGVeN16v___expf_finite, _ZGVeN16v_expf)
++
++ALIAS_IMPL (_ZGVbN2vv___pow_finite, _ZGVbN2vv_pow)
++ALIAS_IMPL (_ZGVcN4vv___pow_finite, _ZGVcN4vv_pow)
++ALIAS_IMPL (_ZGVdN4vv___pow_finite, _ZGVdN4vv_pow)
++ALIAS_IMPL (_ZGVeN8vv___pow_finite, _ZGVeN8vv_pow)
++
++ALIAS_IMPL (_ZGVbN4vv___powf_finite, _ZGVbN4vv_powf)
++ALIAS_IMPL (_ZGVcN8vv___powf_finite, _ZGVcN8vv_powf)
++ALIAS_IMPL (_ZGVdN8vv___powf_finite, _ZGVdN8vv_powf)
++ALIAS_IMPL (_ZGVeN16vv___powf_finite, _ZGVeN16vv_powf)
+diff --git a/wcsmbs/wcscoll_l.c b/wcsmbs/wcscoll_l.c
+index 6d9384a..87f240d 100644
+--- a/wcsmbs/wcscoll_l.c
++++ b/wcsmbs/wcscoll_l.c
+@@ -23,7 +23,6 @@
+ #define STRING_TYPE wchar_t
+ #define USTRING_TYPE wint_t
+ #define STRCOLL __wcscoll_l
+-#define STRDIFF __wcsdiff
+ #define STRCMP __wcscmp
+ #define WEIGHT_H "../locale/weightwc.h"
+ #define SUFFIX	WC

Modified: glibc-package/branches/glibc-2.22/debian/patches/series
===================================================================
--- glibc-package/branches/glibc-2.22/debian/patches/series	2015-12-01 20:15:57 UTC (rev 6725)
+++ glibc-package/branches/glibc-2.22/debian/patches/series	2015-12-01 21:49:15 UTC (rev 6726)
@@ -239,5 +239,4 @@
 any/submitted-resolv-ipv6-nameservers.diff
 any/local-static-dlopen-search-path.diff
 any/local-math-logb.diff
-any/cvs-ld_pointer_guard.diff
 any/cvs-mangle-tls_dtor_list.diff


Reply to: