]> git.pld-linux.org Git - packages/glibc.git/blob - glibc-git.patch
- rel 12; branch update; add libmvec_nonshared.a
[packages/glibc.git] / glibc-git.patch
1 diff --git a/ChangeLog b/ChangeLog
2 index cb9124e..f77829e 100644
3 --- a/ChangeLog
4 +++ b/ChangeLog
5 @@ -1,3 +1,255 @@
6 +2015-12-31  Aurelien Jarno  <aurelien@aurel32.net>
7 +
8 +       * sysdeps/unix/sysv/linux/alpha/libc.abilist [GLIBC_2.22]: Move
9 +       to keep the file sorted.
10 +       * sysdeps/unix/sysv/linux/hppa/libc.abilist [GLIBC_2.22]: Likewise.
11 +
12 +2015-12-17  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
13 +
14 +       [BZ #19174]
15 +       * sysdeps/powerpc/nptl/elide.h (__elide_lock): Fix usage of
16 +       .skip_lock_out_of_tbegin_retries.
17 +       * sysdeps/unix/sysv/linux/powerpc/elision-lock.c
18 +       (__lll_lock_elision): Likewise, and respect a value of
19 +       try_tbegin <= 0.
20 +
21 +2015-12-03  Andrew Senkevich  <andrew.senkevich@intel.com>
22 +
23 +       * math/Makefile ($(inst_libdir)/libm.so): Corrected path to
24 +       libmvec_nonshared.a
25 +
26 +2015-11-27  Andrew Senkevich  <andrew.senkevich@intel.com>
27 +
28 +       [BZ #19058]
29 +       * math/Makefile ($(inst_libdir)/libm.so): Added libmvec_nonshared.a to
30 +       AS_NEEDED.
31 +       * sysdeps/x86/fpu/bits/math-vector.h: Removed code with asm aliases
32 +       workaround.
33 +       * sysdeps/x86_64/fpu/Makefile (libmvec-support,
34 +       libmvec-static-only-routines): Added new file.
35 +       * sysdeps/x86_64/fpu/svml_finite_alias.S: New file.
36 +       * NEWS: Mention this fix.
37 +
38 +2015-11-20  Roland McGrath  <roland@hack.frob.com>
39 +
40 +       * sysdeps/nacl/dl-map-segments.h (_dl_map_segments): Use
41 +       __glibc_likely instead of __builtin_expect.  After falling back to
42 +       dyncode_create in a non-ET_DYN case, use the allocate_code_data
43 +       system interface to register the code pages as occupied.
44 +
45 +2015-11-14  H.J. Lu  <hongjiu.lu@intel.com>
46 +
47 +       * config.make.in (have-glob-dat-reloc): New.
48 +       * configure.ac (libc_cv_has_glob_dat): New.  Set to yes if
49 +       target supports GLOB_DAT relocaton. AC_SUBST.
50 +       * configure: Regenerated.
51 +       * elf/Makefile (tests): Add tst-prelink.
52 +       (tests-special): Add $(objpfx)tst-prelink-cmp.out.
53 +       (tst-prelink-ENV): New.
54 +       ($(objpfx)tst-prelink-conflict.out): Likewise.
55 +       ($(objpfx)tst-prelink-cmp.out): Likewise.
56 +       * sysdeps/x86/tst-prelink.c: Moved to ...
57 +       * elf/tst-prelink.c: Here.
58 +       * sysdeps/x86/tst-prelink.exp: Moved to ...
59 +       * elf/tst-prelink.exp: Here.
60 +       * sysdeps/x86/Makefile (tests): Don't add tst-prelink.
61 +       (tst-prelink-ENV): Removed.
62 +       ($(objpfx)tst-prelink-conflict.out): Likewise.
63 +       ($(objpfx)tst-prelink-cmp.out): Likewise.
64 +       (tests-special): Don't add $(objpfx)tst-prelink-cmp.out.
65 +
66 +2015-11-10  Roland McGrath  <roland@hack.frob.com>
67 +
68 +       * elf/dl-load.c (open_verify): Take new argument FD.
69 +       Skip __open call if passed FD is not -1.
70 +       (_dl_map_object, open_path): Update callers.
71 +       * elf/dl-sysdep-open.h: New file.
72 +       * elf/dl-load.c: Include it.
73 +       (_dl_map_object): Try _dl_sysdep_open_object before ldconfig cache.
74 +       * sysdeps/nacl/dl-sysdep.c (_dl_sysdep_open_object): New function.
75 +       * sysdeps/nacl/dl-sysdep-open.h: New file.
76 +       * sysdeps/nacl/nacl-interface-list.h: Move nacl_irt_resource_open
77 +       from libc to rtld.
78 +
79 +2015-11-10  H.J. Lu  <hongjiu.lu@intel.com>
80 +
81 +       [BZ #19178]
82 +       * sysdeps/x86/Makefile (tests): Add tst-prelink.
83 +       (tst-prelink-ENV): New.
84 +       ($(objpfx)tst-prelink-conflict.out): Likewise.
85 +       ($(objpfx)tst-prelink-cmp.out): Likewise.
86 +       (tests-special): Add $(objpfx)tst-prelink-cmp.out.
87 +       * sysdeps/x86/tst-prelink.c: New file.
88 +       * sysdeps/x86/tst-prelink.exp: Likewise.
89 +
90 +2015-11-07  H.J. Lu  <hongjiu.lu@intel.com>
91 +
92 +       [BZ #19178]
93 +       * elf/dl-lookup.c (RTYPE_CLASS_VALID): New.
94 +       (RTYPE_CLASS_PLT): Likewise.
95 +       (RTYPE_CLASS_COPY): Likewise.
96 +       (RTYPE_CLASS_TLS): Likewise.
97 +       (_dl_debug_bindings): Use RTYPE_CLASS_TLS and RTYPE_CLASS_VALID
98 +       to set relocation type class for DL_DEBUG_PRELINK.  Keep only
99 +       ELF_RTYPE_CLASS_PLT and ELF_RTYPE_CLASS_COPY bits for
100 +       DL_DEBUG_PRELINK.
101 +
102 +2015-10-20  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
103 +
104 +       [BZ #18743]
105 +       * sysdeps/powerpc/nptl/elide.h (__elide_lock): Move most of this
106 +       code to...
107 +       (ELIDE_LOCK): ...here.
108 +       (__get_new_count): New function with part of the code from
109 +       __elide_lock that updates the value of adapt_count after a
110 +       transaction abort.
111 +       (__elided_trylock): Moved this code to...
112 +       (ELIDE_TRYLOCK): ...here.
113 +
114 +2015-10-06  Florian Weimer  <fweimer@redhat.com>
115 +
116 +       [BZ #19018]
117 +       * stdlib/cxa_thread_atexit_impl.c (__cxa_thread_atexit_impl):
118 +       Mangle function pointer before storing it.
119 +       (__call_tls_dtors): Demangle function pointer before calling it.
120 +
121 +2015-10-15  Florian Weimer  <fweimer@redhat.com>
122 +
123 +       [BZ #18928]
124 +       * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
125 +       _dl_pointer_guard member.
126 +       * elf/rtld.c (_rtld_global_ro): Remove _dl_pointer_guard
127 +       initializer.
128 +       (security_init): Always set up pointer guard.
129 +       (process_envvars): Do not process LD_POINTER_GUARD.
130 +
131 +2015-10-09  Carlos O'Donell  <carlos@redhat.com>
132 +
133 +       [BZ #18589]
134 +       * string/bug-strcoll2.c: Adjust copyright, and remove contributed by.
135 +       * string/Makefile ($(objpfx)bug-strcoll2.out): Depend on
136 +       $(gen-locales).
137 +
138 +2015-10-08  Carlos O'Donell  <carlos@redhat.com>
139 +
140 +       [BZ #18589]
141 +       * string/Makefile (tests): Add bug-strcoll2.
142 +       (LOCALES): Add cs_CZ.UTF-8.
143 +
144 +2015-09-28  Martin Sebor  <msebor@redhat.com>
145 +
146 +       [BZ #18969]
147 +       * string/Makefile (LOCALES): Define.
148 +       (gen-locales.mk): Include.
149 +       (test-strcasecmp.out, test-strncasecmp.out, tst-strxfrm.out)
150 +       (tst-strxfrm2.out): Add deppendency on $(gen-locales).
151 +       * string/tst-strxfrm2.c (do_test): Print the name of the locale
152 +       on setlocale failure.
153 +
154 +2015-10-08  Carlos O'Donell  <carlos@redhat.com>
155 +
156 +       [BZ #18589]
157 +       * string/bug-strcoll2.c: New file.
158 +       * locale/categories.def: Revert commit
159 +       f13c2a8dff2329c6692a80176262ceaaf8a6f74e.
160 +       * locale/langinfo.h: Likewise.
161 +       * locale/localeinfo.h: Likewise.
162 +       * locale/C-collate.c: Likewise.
163 +       * programs/ld-collate.c (collate_output): Likewise.
164 +       * string/strcoll_l.c (STRDIFF): Likewise.
165 +       (STRCOLL): Likewise.
166 +       * wcsmbs/wcscoll_l.c: Likewise.
167 +
168 +2015-09-15  Roland McGrath  <roland@hack.frob.com>
169 +
170 +       * misc/sys/param.h [!MAXHOSTNAMELEN && HOST_NAME_MAX]
171 +       (MAXHOSTNAMELEN): Define it to HOST_NAME_MAX.
172 +
173 +2015-09-11  Roland McGrath  <roland@hack.frob.com>
174 +
175 +       * sysdeps/nacl/Makefile [$(subdir) = misc] (sysdep_headers):
176 +       Use 'override' keyword to freeze the value here, preventing
177 +       the addition of sys/mtio.h by sysdeps/gnu/Makefile.
178 +
179 +2015-09-04  Roland McGrath  <roland@hack.frob.com>
180 +
181 +       [BZ #18921]
182 +       * sysdeps/posix/opendir.c (need_isdir_precheck) [O_DIRECTORY]:
183 +       Fix inverted sense of test of 'o_directory_works' value.
184 +       Reported by Pádraig Brady <P@draigBrady.com>, diagnosed by
185 +       Bernhard Voelker <mail@bernhard-voelker.de>.
186 +
187 +2015-08-31  Brett Neumeier <brett@neumeier.us>
188 +
189 +       [BZ #18870]
190 +       * sysdeps/sparc/sparc32/sem_open.c: Add missing #include
191 +
192 +2015-08-28  Mike Frysinger  <vapier@gentoo.org>
193 +
194 +       [BZ #18887]
195 +       * misc/Makefile (tests): Add tst-mntent-blank-corrupt and
196 +       tst-mntent-blank-passno.
197 +       * misc/mntent_r.c (__getmntent_r): Do not read past buffer[0].
198 +       * misc/tst-mntent-blank-corrupt.c: New test.
199 +       * misc/tst-mntent-blank-passno.c: New test ripped from ...
200 +       * misc/tst-mntent.c (do_test): ... here.
201 +
202 +2015-08-25  Roland McGrath  <roland@hack.frob.com>
203 +
204 +       * sysdeps/nacl/start.c (_start): Call __nacl_main instead of main
205 +       if the weak reference is not null.
206 +
207 +2015-08-19  Andrew Senkevich  <andrew.senkevich@intel.com>
208 +
209 +       [BZ #18796]
210 +       * scripts/test-installation.pl: Don't add -lmvec to build options
211 +       if libmvec wasn't built.
212 +       * NEWS: Mention this fix.
213 +
214 +2015-08-10  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>
215 +
216 +       [BZ #18778]
217 +       * elf/Makefile (tests): Add Add tst-nodelete2.
218 +       (modules-names): Add tst-nodelete2mod.
219 +       (tst-nodelete2mod.so-no-z-defs): New.
220 +       ($(objpfx)tst-nodelete2): Likewise.
221 +       ($(objpfx)tst-nodelete2.out): Likewise.
222 +       (LDFLAGS-tst-nodelete2): Likewise.
223 +       * elf/dl-close.c (_dl_close_worker): Move DF_1_NODELETE clearing
224 +       out of loop through all loaded libraries.
225 +       * elf/tst-nodelete2.c: New file.
226 +       * elf/tst-nodelete2mod.c: Likewise.
227 +
228 +2015-08-10  Andreas Schwab  <schwab@suse.de>
229 +
230 +       [BZ #18781]
231 +       * sysdeps/unix/sysv/linux/openat.c (__OPENAT) [MORE_OFLAGS]: Add
232 +       MORE_OFLAGS to oflag.
233 +       * io/test-lfs.c (do_test): Test openat64.
234 +
235 +2015-08-08  John David Anglin  <danglin@gcc.gnu.org>
236 +
237 +       [BZ #18787]
238 +       * sysdeps/unix/sysv/linux/hppa/bits/atomic.h (_LWS_CLOBBER): Revise
239 +       clobber registers.
240 +       (atomic_compare_and_exchange_val_acq): Use register asms to assign
241 +       operand registers.  Use register %r20 for EAGAIN and EDEADLOCK checks.
242 +       Cast return to __typeof (oldval).
243 +
244 +2015-08-08  Mike Frysinger  <vapier@gentoo.org>
245 +
246 +       * sysdeps/unix/sysv/linux/microblaze/sysdep.h: Wrap the whole file
247 +       in _LINUX_MICROBLAZE_SYSDEP_H defines.  Include sysdeps/unix/sysdep.h
248 +       and delete sys/syscall.h include.
249 +
250 +2015-08-07  Mike Frysinger  <vapier@gentoo.org>
251 +
252 +       * sysdeps/hppa/dl-symaddr.c (_dl_symbol_address): Add rtld_hidden_def.
253 +
254 +2015-08-05  Zack Weinberg  <zackw@panix.com>
255 +
256 +       * misc/regexp.h: Update comments.
257 +
258  2015-08-05  Carlos O'Donell  <carlos@systemhalted.org>
259  
260         * version.h (RELEASE): Set to "stable".
261 diff --git a/NEWS b/NEWS
262 index 4c31de7..e1c1e58 100644
263 --- a/NEWS
264 +++ b/NEWS
265 @@ -5,6 +5,16 @@ See the end for copying conditions.
266  Please send GNU C library bug reports via <http://sourceware.org/bugzilla/>
267  using `glibc' in the "product" field.
268  \f
269 +Version 2.22.1
270 +
271 +* The following bugs are resolved with this release:
272 +
273 +  18589, 18743, 18778, 18781, 18787, 18796, 18870, 18887, 18921, 18928,
274 +  18969, 19018, 19058, 19174, 19178.
275 +
276 +* The LD_POINTER_GUARD environment variable can no longer be used to
277 +  disable the pointer guard feature.  It is always enabled.
278 +\f
279  Version 2.22
280  
281  * The following bugs are resolved with this release:
282 @@ -84,7 +94,7 @@ Version 2.22
283    release.  Use of this header will trigger a deprecation warning.
284    Application developers should update their code to use <regex.h> instead.
285  
286 -  This header was formerly part of SUSv2, but was deprecated in 1997 and
287 +  This header was formerly part of SUS, but was deprecated in 1994 and
288    removed from the standard in 2001.  Also, the glibc implementation
289    leaks memory.  See BZ#18681 for more details.
290  \f
291 diff --git a/config.make.in b/config.make.in
292 index a9f5696..46cd9bb 100644
293 --- a/config.make.in
294 +++ b/config.make.in
295 @@ -51,6 +51,7 @@ have-z-combreloc = @libc_cv_z_combreloc@
296  have-z-execstack = @libc_cv_z_execstack@
297  have-Bgroup = @libc_cv_Bgroup@
298  have-protected-data = @libc_cv_protected_data@
299 +have-glob-dat-reloc = @libc_cv_has_glob_dat@
300  with-fp = @with_fp@
301  old-glibc-headers = @old_glibc_headers@
302  unwind-find-fde = @libc_cv_gcc_unwind_find_fde@
303 diff --git a/configure b/configure
304 index 45cc7cb..4f87b31 100755
305 --- a/configure
306 +++ b/configure
307 @@ -628,6 +628,7 @@ gnu89_inline
308  libc_cv_ssp
309  fno_unit_at_a_time
310  libc_cv_output_format
311 +libc_cv_has_glob_dat
312  libc_cv_hashstyle
313  libc_cv_fpie
314  libc_cv_z_execstack
315 @@ -6335,6 +6336,39 @@ $as_echo "$libc_cv_use_default_link" >&6; }
316    use_default_link=$libc_cv_use_default_link
317  fi
318  
319 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_DAT reloc" >&5
320 +$as_echo_n "checking for GLOB_DAT reloc... " >&6; }
321 +if ${libc_cv_has_glob_dat+:} false; then :
322 +  $as_echo_n "(cached) " >&6
323 +else
324 +  cat > conftest.c <<EOF
325 +extern int mumble;
326 +int foo (void) { return mumble; }
327 +EOF
328 +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
329 +                       -fPIC -shared -o conftest.so conftest.c
330 +                       -nostdlib -nostartfiles
331 +                       1>&5'
332 +  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
333 +  (eval $ac_try) 2>&5
334 +  ac_status=$?
335 +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
336 +  test $ac_status = 0; }; }
337 +then
338 +  if $READELF -rW conftest.so | grep '_GLOB_DAT' > /dev/null; then
339 +    libc_cv_has_glob_dat=yes
340 +  else
341 +    libc_cv_has_glob_dat=no
342 +  fi
343 +else
344 +  libc_cv_has_glob_dat=no
345 +fi
346 +rm -f conftest*
347 +fi
348 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_has_glob_dat" >&5
349 +$as_echo "$libc_cv_has_glob_dat" >&6; }
350 +
351 +
352  { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker output format" >&5
353  $as_echo_n "checking linker output format... " >&6; }
354  if ${libc_cv_output_format+:} false; then :
355 diff --git a/configure.ac b/configure.ac
356 index 7e9383a..8be612d 100644
357 --- a/configure.ac
358 +++ b/configure.ac
359 @@ -1535,6 +1535,29 @@ $ac_try"
360    use_default_link=$libc_cv_use_default_link
361  fi
362  
363 +AC_CACHE_CHECK(for GLOB_DAT reloc,
364 +              libc_cv_has_glob_dat, [dnl
365 +cat > conftest.c <<EOF
366 +extern int mumble;
367 +int foo (void) { return mumble; }
368 +EOF
369 +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
370 +                       -fPIC -shared -o conftest.so conftest.c
371 +                       -nostdlib -nostartfiles
372 +                       1>&AS_MESSAGE_LOG_FD])
373 +then
374 +dnl look for GLOB_DAT relocation.
375 +  if $READELF -rW conftest.so | grep '_GLOB_DAT' > /dev/null; then
376 +    libc_cv_has_glob_dat=yes
377 +  else
378 +    libc_cv_has_glob_dat=no
379 +  fi
380 +else
381 +  libc_cv_has_glob_dat=no
382 +fi
383 +rm -f conftest*])
384 +AC_SUBST(libc_cv_has_glob_dat)
385 +
386  AC_CACHE_CHECK(linker output format, libc_cv_output_format, [dnl
387  if libc_cv_output_format=`
388  ${CC-cc} -nostartfiles -nostdlib -Wl,--print-output-format 2>&AS_MESSAGE_LOG_FD`
389 diff --git a/elf/Makefile b/elf/Makefile
390 index 4ceeaf8..a2c43bc 100644
391 --- a/elf/Makefile
392 +++ b/elf/Makefile
393 @@ -148,7 +148,8 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
394          tst-unique1 tst-unique2 $(if $(CXX),tst-unique3 tst-unique4 \
395          tst-nodelete) \
396          tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
397 -        tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened
398 +        tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
399 +        tst-nodelete2
400  #       reldep9
401  ifeq ($(build-hardcoded-path-in-tests),yes)
402  tests += tst-dlopen-aout
403 @@ -218,7 +219,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
404                 tst-initorder2d \
405                 tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \
406                 tst-array5dep tst-null-argv-lib \
407 -               tst-tlsalign-lib tst-nodelete-opened-lib
408 +               tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod
409  ifeq (yes,$(have-protected-data))
410  modules-names += tst-protected1moda tst-protected1modb
411  tests += tst-protected1a tst-protected1b
412 @@ -292,6 +293,13 @@ check-abi: $(objpfx)check-abi-ld.out
413  tests-special += $(objpfx)check-abi-ld.out
414  update-abi: update-abi-ld
415  
416 +ifeq ($(have-glob-dat-reloc),yes)
417 +tests += tst-prelink
418 +ifeq ($(run-built-tests),yes)
419 +tests-special += $(objpfx)tst-prelink-cmp.out
420 +endif
421 +endif
422 +
423  include ../Rules
424  
425  ifeq (yes,$(build-shared))
426 @@ -594,6 +602,7 @@ tst-auditmod9b.so-no-z-defs = yes
427  tst-nodelete-uniquemod.so-no-z-defs = yes
428  tst-nodelete-rtldmod.so-no-z-defs = yes
429  tst-nodelete-zmod.so-no-z-defs = yes
430 +tst-nodelete2mod.so-no-z-defs = yes
431  
432  ifeq ($(build-shared),yes)
433  # Build all the modules even when not actually running test programs.
434 @@ -1164,6 +1173,11 @@ $(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \
435  LDFLAGS-tst-nodelete = -rdynamic
436  LDFLAGS-tst-nodelete-zmod.so = -Wl,--enable-new-dtags,-z,nodelete
437  
438 +$(objpfx)tst-nodelete2: $(libdl)
439 +$(objpfx)tst-nodelete2.out: $(objpfx)tst-nodelete2mod.so
440 +
441 +LDFLAGS-tst-nodelete2 = -rdynamic
442 +
443  $(objpfx)tst-initorder-cmp.out: tst-initorder.exp $(objpfx)tst-initorder.out
444         cmp $^ > $@; \
445         $(evaluate-test)
446 @@ -1205,3 +1219,13 @@ $(objpfx)tst-unused-dep.out: $(objpfx)testobj1.so
447  $(objpfx)tst-unused-dep-cmp.out: $(objpfx)tst-unused-dep.out
448         cmp $< /dev/null > $@; \
449         $(evaluate-test)
450 +
451 +tst-prelink-ENV = LD_TRACE_PRELINKING=1
452 +
453 +$(objpfx)tst-prelink-conflict.out: $(objpfx)tst-prelink.out
454 +       grep stdout $< | grep conflict | $(AWK) '{ print $$10, $$11 }' > $@
455 +
456 +$(objpfx)tst-prelink-cmp.out: tst-prelink.exp \
457 +                             $(objpfx)tst-prelink-conflict.out
458 +       cmp $^ > $@; \
459 +       $(evaluate-test)
460 diff --git a/elf/dl-close.c b/elf/dl-close.c
461 index 9105277..c897247 100644
462 --- a/elf/dl-close.c
463 +++ b/elf/dl-close.c
464 @@ -144,6 +144,14 @@ _dl_close_worker (struct link_map *map, bool force)
465    char done[nloaded];
466    struct link_map *maps[nloaded];
467  
468 +  /* Clear DF_1_NODELETE to force object deletion.  We don't need to touch
469 +     l_tls_dtor_count because forced object deletion only happens when an
470 +     error occurs during object load.  Destructor registration for TLS
471 +     non-POD objects should not have happened till then for this
472 +     object.  */
473 +  if (force)
474 +    map->l_flags_1 &= ~DF_1_NODELETE;
475 +
476    /* Run over the list and assign indexes to the link maps and enter
477       them into the MAPS array.  */
478    int idx = 0;
479 @@ -153,13 +161,6 @@ _dl_close_worker (struct link_map *map, bool force)
480        maps[idx] = l;
481        ++idx;
482  
483 -      /* Clear DF_1_NODELETE to force object deletion.  We don't need to touch
484 -        l_tls_dtor_count because forced object deletion only happens when an
485 -        error occurs during object load.  Destructor registration for TLS
486 -        non-POD objects should not have happened till then for this
487 -        object.  */
488 -      if (force)
489 -       l->l_flags_1 &= ~DF_1_NODELETE;
490      }
491    assert (idx == nloaded);
492  
493 diff --git a/elf/dl-load.c b/elf/dl-load.c
494 index 0c052e4..7e6f4c5 100644
495 --- a/elf/dl-load.c
496 +++ b/elf/dl-load.c
497 @@ -42,6 +42,7 @@
498  #include <dl-map-segments.h>
499  #include <dl-unmap-segments.h>
500  #include <dl-machine-reject-phdr.h>
501 +#include <dl-sysdep-open.h>
502  
503  
504  #include <endian.h>
505 @@ -1471,9 +1472,13 @@ print_search_path (struct r_search_path_elem **list,
506     ignore only ELF files for other architectures.  Non-ELF files and
507     ELF files with different header information cause fatal errors since
508     this could mean there is something wrong in the installation and the
509 -   user might want to know about this.  */
510 +   user might want to know about this.
511 +
512 +   If FD is not -1, then the file is already open and FD refers to it.
513 +   In that case, FD is consumed for both successful and error returns.  */
514  static int
515 -open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
516 +open_verify (const char *name, int fd,
517 +             struct filebuf *fbp, struct link_map *loader,
518              int whatcode, int mode, bool *found_other_class, bool free_name)
519  {
520    /* This is the expected ELF header.  */
521 @@ -1514,6 +1519,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
522    if (__glibc_unlikely (GLRO(dl_naudit) > 0) && whatcode != 0
523        && loader->l_auditing == 0)
524      {
525 +      const char *original_name = name;
526        struct audit_ifaces *afct = GLRO(dl_audit);
527        for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
528         {
529 @@ -1528,11 +1534,21 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
530  
531           afct = afct->next;
532         }
533 +
534 +      if (fd != -1 && name != original_name && strcmp (name, original_name))
535 +        {
536 +          /* An audit library changed what we're supposed to open,
537 +             so FD no longer matches it.  */
538 +          __close (fd);
539 +          fd = -1;
540 +        }
541      }
542  #endif
543  
544 -  /* Open the file.  We always open files read-only.  */
545 -  int fd = __open (name, O_RDONLY | O_CLOEXEC);
546 +  if (fd == -1)
547 +    /* Open the file.  We always open files read-only.  */
548 +    fd = __open (name, O_RDONLY | O_CLOEXEC);
549 +
550    if (fd != -1)
551      {
552        ElfW(Ehdr) *ehdr;
553 @@ -1801,7 +1817,7 @@ open_path (const char *name, size_t namelen, int mode,
554           if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
555             _dl_debug_printf ("  trying file=%s\n", buf);
556  
557 -         fd = open_verify (buf, fbp, loader, whatcode, mode,
558 +         fd = open_verify (buf, -1, fbp, loader, whatcode, mode,
559                             found_other_class, false);
560           if (this_dir->status[cnt] == unknown)
561             {
562 @@ -2041,6 +2057,20 @@ _dl_map_object (struct link_map *loader, const char *name,
563                         &loader->l_runpath_dirs, &realname, &fb, loader,
564                         LA_SER_RUNPATH, &found_other_class);
565  
566 +      if (fd == -1)
567 +        {
568 +          realname = _dl_sysdep_open_object (name, namelen, &fd);
569 +          if (realname != NULL)
570 +            {
571 +              fd = open_verify (realname, fd,
572 +                                &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
573 +                                LA_SER_CONFIG, mode, &found_other_class,
574 +                                false);
575 +              if (fd == -1)
576 +                free (realname);
577 +            }
578 +        }
579 +
580  #ifdef USE_LDCONFIG
581        if (fd == -1
582           && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
583 @@ -2086,7 +2116,7 @@ _dl_map_object (struct link_map *loader, const char *name,
584  
585               if (cached != NULL)
586                 {
587 -                 fd = open_verify (cached,
588 +                 fd = open_verify (cached, -1,
589                                     &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
590                                     LA_SER_CONFIG, mode, &found_other_class,
591                                     false);
592 @@ -2121,7 +2151,7 @@ _dl_map_object (struct link_map *loader, const char *name,
593         fd = -1;
594        else
595         {
596 -         fd = open_verify (realname, &fb,
597 +         fd = open_verify (realname, -1, &fb,
598                             loader ?: GL(dl_ns)[nsid]._ns_loaded, 0, mode,
599                             &found_other_class, true);
600           if (__glibc_unlikely (fd == -1))
601 diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
602 index 11cb44b..acf5280 100644
603 --- a/elf/dl-lookup.c
604 +++ b/elf/dl-lookup.c
605 @@ -1016,6 +1016,18 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
606  #ifdef SHARED
607    if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
608      {
609 +/* ELF_RTYPE_CLASS_XXX must match RTYPE_CLASS_XXX used by prelink with
610 +   LD_TRACE_PRELINKING.  */
611 +#define RTYPE_CLASS_VALID      8
612 +#define RTYPE_CLASS_PLT                (8|1)
613 +#define RTYPE_CLASS_COPY       (8|2)
614 +#define RTYPE_CLASS_TLS                (8|4)
615 +#if ELF_RTYPE_CLASS_PLT != 0 && ELF_RTYPE_CLASS_PLT != 1
616 +# error ELF_RTYPE_CLASS_PLT must be 0 or 1!
617 +#endif
618 +#if ELF_RTYPE_CLASS_COPY != 0 && ELF_RTYPE_CLASS_COPY != 2
619 +# error ELF_RTYPE_CLASS_COPY must be 0 or 2!
620 +#endif
621        int conflict = 0;
622        struct sym_val val = { NULL, NULL };
623  
624 @@ -1071,12 +1083,17 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
625  
626        if (value->s)
627         {
628 +         /* Keep only ELF_RTYPE_CLASS_PLT and ELF_RTYPE_CLASS_COPY
629 +            bits since since prelink only uses them.  */
630 +         type_class &= ELF_RTYPE_CLASS_PLT | ELF_RTYPE_CLASS_COPY;
631           if (__glibc_unlikely (ELFW(ST_TYPE) (value->s->st_info)
632                                 == STT_TLS))
633 -           type_class = 4;
634 +           /* Clear the RTYPE_CLASS_VALID bit in RTYPE_CLASS_TLS.  */
635 +           type_class = RTYPE_CLASS_TLS & ~RTYPE_CLASS_VALID;
636           else if (__glibc_unlikely (ELFW(ST_TYPE) (value->s->st_info)
637                                      == STT_GNU_IFUNC))
638 -           type_class |= 8;
639 +           /* Set the RTYPE_CLASS_VALID bit.  */
640 +           type_class |= RTYPE_CLASS_VALID;
641         }
642  
643        if (conflict
644 diff --git a/elf/dl-sysdep-open.h b/elf/dl-sysdep-open.h
645 new file mode 100644
646 index 0000000..a63d9f5
647 --- /dev/null
648 +++ b/elf/dl-sysdep-open.h
649 @@ -0,0 +1,45 @@
650 +/* System-specific call to open a shared object by name.  Stub version.
651 +   Copyright (C) 2015 Free Software Foundation, Inc.
652 +   This file is part of the GNU C Library.
653 +
654 +   The GNU C Library is free software; you can redistribute it and/or
655 +   modify it under the terms of the GNU Lesser General Public
656 +   License as published by the Free Software Foundation; either
657 +   version 2.1 of the License, or (at your option) any later version.
658 +
659 +   The GNU C Library is distributed in the hope that it will be useful,
660 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
661 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
662 +   Lesser General Public License for more details.
663 +
664 +   You should have received a copy of the GNU Lesser General Public
665 +   License along with the GNU C Library; if not, see
666 +   <http://www.gnu.org/licenses/>.  */
667 +
668 +#ifndef _DL_SYSDEP_OPEN_H
669 +#define _DL_SYSDEP_OPEN_H      1
670 +
671 +#include <assert.h>
672 +#include <stddef.h>
673 +
674 +/* NAME is a name without slashes, as it appears in a DT_NEEDED entry
675 +   or a dlopen call's argument or suchlike.  NAMELEN is (strlen (NAME) + 1).
676 +
677 +   Find NAME in an OS-dependent fashion, and return its "real" name.
678 +   Optionally fill in *FD with a file descriptor open on that file (or
679 +   else leave its initial value of -1).  The return value is a new
680 +   malloc'd string, which will be free'd by the caller.  If NAME is
681 +   resolved to an actual file that can be opened, then the return
682 +   value should name that file (and if *FD was not set, then a normal
683 +   __open call on that string will be made).  If *FD was set by some
684 +   other means than a normal open and there is no "real" name to use,
685 +   then __strdup (NAME) is fine (modulo error checking).  */
686 +
687 +static inline char *
688 +_dl_sysdep_open_object (const char *name, size_t namelen, int *fd)
689 +{
690 +  assert (*fd == -1);
691 +  return NULL;
692 +}
693 +
694 +#endif  /* dl-sysdep-open.h */
695 diff --git a/elf/rtld.c b/elf/rtld.c
696 index 69873c2..07e741c 100644
697 --- a/elf/rtld.c
698 +++ b/elf/rtld.c
699 @@ -162,7 +162,6 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
700      ._dl_hwcap_mask = HWCAP_IMPORTANT,
701      ._dl_lazy = 1,
702      ._dl_fpu_control = _FPU_DEFAULT,
703 -    ._dl_pointer_guard = 1,
704      ._dl_pagesize = EXEC_PAGESIZE,
705      ._dl_inhibit_cache = 0,
706  
707 @@ -709,15 +708,12 @@ security_init (void)
708  #endif
709  
710    /* Set up the pointer guard as well, if necessary.  */
711 -  if (GLRO(dl_pointer_guard))
712 -    {
713 -      uintptr_t pointer_chk_guard = _dl_setup_pointer_guard (_dl_random,
714 -                                                            stack_chk_guard);
715 +  uintptr_t pointer_chk_guard
716 +    = _dl_setup_pointer_guard (_dl_random, stack_chk_guard);
717  #ifdef THREAD_SET_POINTER_GUARD
718 -      THREAD_SET_POINTER_GUARD (pointer_chk_guard);
719 +  THREAD_SET_POINTER_GUARD (pointer_chk_guard);
720  #endif
721 -      __pointer_chk_guard_local = pointer_chk_guard;
722 -    }
723 +  __pointer_chk_guard_local = pointer_chk_guard;
724  
725    /* We do not need the _dl_random value anymore.  The less
726       information we leave behind, the better, so clear the
727 @@ -2471,9 +2467,6 @@ process_envvars (enum mode *modep)
728               GLRO(dl_use_load_bias) = envline[14] == '1' ? -1 : 0;
729               break;
730             }
731 -
732 -         if (memcmp (envline, "POINTER_GUARD", 13) == 0)
733 -           GLRO(dl_pointer_guard) = envline[14] != '0';
734           break;
735  
736         case 14:
737 diff --git a/elf/tst-nodelete2.c b/elf/tst-nodelete2.c
738 new file mode 100644
739 index 0000000..388e8af
740 --- /dev/null
741 +++ b/elf/tst-nodelete2.c
742 @@ -0,0 +1,37 @@
743 +#include "../dlfcn/dlfcn.h"
744 +#include <stdio.h>
745 +#include <stdlib.h>
746 +#include <gnu/lib-names.h>
747 +
748 +static int
749 +do_test (void)
750 +{
751 +  int result = 0;
752 +
753 +  printf ("\nOpening pthread library.\n");
754 +  void *pthread = dlopen (LIBPTHREAD_SO, RTLD_LAZY);
755 +
756 +  /* This is a test for correct DF_1_NODELETE clearing when dlopen failure
757 +     happens.  We should clear DF_1_NODELETE for failed library only, because
758 +     doing this for others (e.g. libpthread) might cause them to be unloaded,
759 +     that may lead to some global references (e.g. __rtld_lock_unlock) to be
760 +     broken.  The dlopen should fail because of undefined symbols in shared
761 +     library, that cause DF_1_NODELETE to be cleared.  For libpthread, this
762 +     flag should be set, because if not, SIGSEGV will happen in dlclose.  */
763 +  if (dlopen ("tst-nodelete2mod.so", RTLD_NOW) != NULL)
764 +    {
765 +      printf ("Unique symbols test failed\n");
766 +      result = 1;
767 +    }
768 +
769 +  if (pthread)
770 +    dlclose (pthread);
771 +
772 +  if (result == 0)
773 +    printf ("SUCCESS\n");
774 +
775 +  return result;
776 +}
777 +
778 +#define TEST_FUNCTION do_test ()
779 +#include "../test-skeleton.c"
780 diff --git a/elf/tst-nodelete2mod.c b/elf/tst-nodelete2mod.c
781 new file mode 100644
782 index 0000000..e88c756
783 --- /dev/null
784 +++ b/elf/tst-nodelete2mod.c
785 @@ -0,0 +1,7 @@
786 +/* Undefined symbol.  */
787 +extern int not_exist (void);
788 +
789 +int foo (void)
790 +{
791 +  return not_exist ();
792 +}
793 diff --git a/elf/tst-prelink.c b/elf/tst-prelink.c
794 new file mode 100644
795 index 0000000..ab61c4e
796 --- /dev/null
797 +++ b/elf/tst-prelink.c
798 @@ -0,0 +1,30 @@
799 +/* Test the output from the environment variable, LD_TRACE_PRELINKING,
800 +   for prelink.
801 +   Copyright (C) 2015 Free Software Foundation, Inc.
802 +   This file is part of the GNU C Library.
803 +
804 +   The GNU C Library is free software; you can redistribute it and/or
805 +   modify it under the terms of the GNU Lesser General Public
806 +   License as published by the Free Software Foundation; either
807 +   version 2.1 of the License, or (at your option) any later version.
808 +
809 +   The GNU C Library is distributed in the hope that it will be useful,
810 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
811 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
812 +   Lesser General Public License for more details.
813 +
814 +   You should have received a copy of the GNU Lesser General Public
815 +   License along with the GNU C Library; if not, see
816 +   <http://www.gnu.org/licenses/>.  */
817 +
818 +#include <stdio.h>
819 +
820 +static int
821 +do_test (void)
822 +{
823 +  fprintf (stdout, "hello\n");
824 +  return 0;
825 +}
826 +
827 +#define TEST_FUNCTION do_test ()
828 +#include "../test-skeleton.c"
829 diff --git a/elf/tst-prelink.exp b/elf/tst-prelink.exp
830 new file mode 100644
831 index 0000000..b35b4c9
832 --- /dev/null
833 +++ b/elf/tst-prelink.exp
834 @@ -0,0 +1 @@
835 +/0 stdout
836 diff --git a/elf/tst-znodelete-zlib.cc b/elf/tst-znodelete-zlib.cc
837 deleted file mode 100644
838 index 1e8f368..0000000
839 --- a/elf/tst-znodelete-zlib.cc
840 +++ /dev/null
841 @@ -1,6 +0,0 @@
842 -extern int not_exist (void);
843 -
844 -int foo (void)
845 -{
846 -  return  not_exist ();
847 -}
848 diff --git a/io/test-lfs.c b/io/test-lfs.c
849 index 539c2a2..b6ebae4 100644
850 --- a/io/test-lfs.c
851 +++ b/io/test-lfs.c
852 @@ -144,7 +144,7 @@ test_ftello (void)
853  int
854  do_test (int argc, char *argv[])
855  {
856 -  int ret;
857 +  int ret, fd2;
858    struct stat64 statbuf;
859  
860    ret = lseek64 (fd, TWO_GB+100, SEEK_SET);
861 @@ -195,6 +195,25 @@ do_test (int argc, char *argv[])
862      error (EXIT_FAILURE, 0, "stat reported size %lld instead of %lld.",
863            (long long int) statbuf.st_size, (TWO_GB + 100 + 5));
864  
865 +  fd2 = openat64 (AT_FDCWD, name, O_RDWR);
866 +  if (fd2 == -1)
867 +    {
868 +      if (errno == ENOSYS)
869 +       {
870 +         /* Silently ignore this test.  */
871 +         error (0, 0, "openat64 is not supported");
872 +       }
873 +      else
874 +       error (EXIT_FAILURE, errno, "openat64 failed to open big file");
875 +    }
876 +  else
877 +    {
878 +      ret = close (fd2);
879 +
880 +      if (ret == -1)
881 +       error (EXIT_FAILURE, errno, "error closing file");
882 +    }
883 +
884    test_ftello ();
885  
886    return 0;
887 diff --git a/locale/C-collate.c b/locale/C-collate.c
888 index d7f3c55..06dfdfa 100644
889 --- a/locale/C-collate.c
890 +++ b/locale/C-collate.c
891 @@ -144,8 +144,6 @@ const struct __locale_data _nl_C_LC_COLLATE attribute_hidden =
892      /* _NL_COLLATE_COLLSEQWC */
893      { .string = (const char *) collseqwc },
894      /* _NL_COLLATE_CODESET */
895 -    { .string = _nl_C_codeset },
896 -    /* _NL_COLLATE_ENCODING_TYPE */
897 -    { .word = __cet_8bit }
898 +    { .string = _nl_C_codeset }
899    }
900  };
901 diff --git a/locale/categories.def b/locale/categories.def
902 index 045489d..a8dda53 100644
903 --- a/locale/categories.def
904 +++ b/locale/categories.def
905 @@ -58,7 +58,6 @@ DEFINE_CATEGORY
906    DEFINE_ELEMENT (_NL_COLLATE_COLLSEQMB,        "collate-collseqmb",        std, wstring)
907    DEFINE_ELEMENT (_NL_COLLATE_COLLSEQWC,        "collate-collseqwc",        std, wstring)
908    DEFINE_ELEMENT (_NL_COLLATE_CODESET,         "collate-codeset",          std, string)
909 -  DEFINE_ELEMENT (_NL_COLLATE_ENCODING_TYPE,   "collate-encoding-type",    std, word)
910    ), NO_POSTLOAD)
911  
912  
913 diff --git a/locale/langinfo.h b/locale/langinfo.h
914 index ffc5c7f..a565d9d 100644
915 --- a/locale/langinfo.h
916 +++ b/locale/langinfo.h
917 @@ -255,7 +255,6 @@ enum
918    _NL_COLLATE_COLLSEQMB,
919    _NL_COLLATE_COLLSEQWC,
920    _NL_COLLATE_CODESET,
921 -  _NL_COLLATE_ENCODING_TYPE,
922    _NL_NUM_LC_COLLATE,
923  
924    /* LC_CTYPE category: character classification.
925 diff --git a/locale/localeinfo.h b/locale/localeinfo.h
926 index bdab9fe..1d2ee00 100644
927 --- a/locale/localeinfo.h
928 +++ b/locale/localeinfo.h
929 @@ -110,14 +110,6 @@ enum coll_sort_rule
930    sort_mask
931  };
932  
933 -/* Collation encoding type.  */
934 -enum collation_encoding_type
935 -{
936 -  __cet_other,
937 -  __cet_8bit,
938 -  __cet_utf8
939 -};
940 -
941  /* We can map the types of the entries into a few categories.  */
942  enum value_type
943  {
944 diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
945 index a39a94f..dc0fe30 100644
946 --- a/locale/programs/ld-collate.c
947 +++ b/locale/programs/ld-collate.c
948 @@ -32,7 +32,6 @@
949  #include "linereader.h"
950  #include "locfile.h"
951  #include "elem-hash.h"
952 -#include "../localeinfo.h"
953  
954  /* Uncomment the following line in the production version.  */
955  /* #define NDEBUG 1 */
956 @@ -2131,8 +2130,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
957           /* The words have to be handled specially.  */
958           if (idx == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_HASH_SIZEMB))
959             add_locale_uint32 (&file, 0);
960 -         else if (idx == _NL_ITEM_INDEX (_NL_COLLATE_ENCODING_TYPE))
961 -           add_locale_uint32 (&file, __cet_other);
962           else
963             add_locale_empty (&file);
964         }
965 @@ -2496,12 +2493,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
966    add_locale_raw_data (&file, collate->mbseqorder, 256);
967    add_locale_collseq_table (&file, &collate->wcseqorder);
968    add_locale_string (&file, charmap->code_set_name);
969 -  if (strcmp (charmap->code_set_name, "UTF-8") == 0)
970 -    add_locale_uint32 (&file, __cet_utf8);
971 -  else if (charmap->mb_cur_max == 1)
972 -    add_locale_uint32 (&file, __cet_8bit);
973 -  else
974 -    add_locale_uint32 (&file, __cet_other);
975    write_locale_data (output_path, LC_COLLATE, "LC_COLLATE", &file);
976  
977    obstack_free (&weightpool, NULL);
978 diff --git a/math/Makefile b/math/Makefile
979 index 6388bae..2c9d72d 100644
980 --- a/math/Makefile
981 +++ b/math/Makefile
982 @@ -98,7 +98,7 @@ $(inst_libdir)/libm.so: $(common-objpfx)format.lds \
983         (echo '/* GNU ld script'; echo '*/';\
984          cat $<; \
985          echo 'GROUP ( $(slibdir)/libm.so$(libm.so-version) ' \
986 -             'AS_NEEDED ( $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \
987 +             'AS_NEEDED ( $(libdir)/libmvec_nonshared.a $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \
988         ) > $@
989  endif
990  
991 diff --git a/misc/Makefile b/misc/Makefile
992 index aecb0da..2f5edf6 100644
993 --- a/misc/Makefile
994 +++ b/misc/Makefile
995 @@ -76,7 +76,8 @@ install-lib := libg.a
996  gpl2lgpl := error.c error.h
997  
998  tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \
999 -        tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1
1000 +        tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1 \
1001 +        tst-mntent-blank-corrupt tst-mntent-blank-passno
1002  ifeq ($(run-built-tests),yes)
1003  tests-special += $(objpfx)tst-error1-mem.out
1004  endif
1005 diff --git a/misc/mntent_r.c b/misc/mntent_r.c
1006 index 6159873..4f26998 100644
1007 --- a/misc/mntent_r.c
1008 +++ b/misc/mntent_r.c
1009 @@ -136,7 +136,9 @@ __getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz)
1010        end_ptr = strchr (buffer, '\n');
1011        if (end_ptr != NULL)     /* chop newline */
1012         {
1013 -         while (end_ptr[-1] == ' ' || end_ptr[-1] == '\t')
1014 +         /* Do not walk past the start of buffer if it's all whitespace.  */
1015 +         while (end_ptr != buffer
1016 +                && (end_ptr[-1] == ' ' || end_ptr[-1] == '\t'))
1017              end_ptr--;
1018           *end_ptr = '\0';
1019         }
1020 diff --git a/misc/regexp.h b/misc/regexp.h
1021 index 3460989..42394f7 100644
1022 --- a/misc/regexp.h
1023 +++ b/misc/regexp.h
1024 @@ -19,10 +19,11 @@
1025  #ifndef _REGEXP_H
1026  #define _REGEXP_H      1
1027  
1028 -/* The contents of this header file were standardized in the
1029 -   Single Unix Specification, Version 2 (1997) but marked as
1030 -   LEGACY; new applications were already being encouraged to
1031 -   use <regex.h> instead.  POSIX.1-2001 removed this header.
1032 +/* The contents of this header file were originally standardized in
1033 +   the Single Unix Specification, Issue 3 (1992).  In Issue 4 (1994)
1034 +   the header was marked as TO BE WITHDRAWN, and new applications
1035 +   were encouraged to use <regex.h> instead.  It was officially
1036 +   withdrawn from the standard in Issue 6 (aka POSIX.1-2001).
1037  
1038     This header is provided only for backward compatibility.
1039     It will be removed in the next release of the GNU C Library.
1040 diff --git a/misc/sys/param.h b/misc/sys/param.h
1041 index 62b7ed2..1908b93 100644
1042 --- a/misc/sys/param.h
1043 +++ b/misc/sys/param.h
1044 @@ -50,6 +50,9 @@
1045  #if !defined NOFILE && defined OPEN_MAX
1046  # define NOFILE                OPEN_MAX
1047  #endif
1048 +#if !defined MAXHOSTNAMELEN && defined HOST_NAME_MAX
1049 +# define MAXHOSTNAMELEN        HOST_NAME_MAX
1050 +#endif
1051  #ifndef NCARGS
1052  # ifdef ARG_MAX
1053  #  define NCARGS       ARG_MAX
1054 diff --git a/misc/tst-mntent-blank-corrupt.c b/misc/tst-mntent-blank-corrupt.c
1055 new file mode 100644
1056 index 0000000..92266a3
1057 --- /dev/null
1058 +++ b/misc/tst-mntent-blank-corrupt.c
1059 @@ -0,0 +1,45 @@
1060 +/* Make sure blank lines does not cause memory corruption BZ #18887.
1061 +
1062 +   Copyright (C) 2009-2015 Free Software Foundation, Inc.
1063 +   This file is part of the GNU C Library.
1064 +
1065 +   The GNU C Library is free software; you can redistribute it and/or
1066 +   modify it under the terms of the GNU Lesser General Public
1067 +   License as published by the Free Software Foundation; either
1068 +   version 2.1 of the License, or (at your option) any later version.
1069 +
1070 +   The GNU C Library is distributed in the hope that it will be useful,
1071 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
1072 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1073 +   Lesser General Public License for more details.
1074 +
1075 +   You should have received a copy of the GNU Lesser General Public
1076 +   License along with the GNU C Library; if not, see
1077 +   <http://www.gnu.org/licenses/>.  */
1078 +
1079 +#include <mntent.h>
1080 +#include <stdio.h>
1081 +#include <string.h>
1082 +
1083 +/* Make sure blank lines don't trigger memory corruption.  This doesn't happen
1084 +   for all targets though, so it's a best effort test BZ #18887.  */
1085 +static int
1086 +do_test (void)
1087 +{
1088 +  FILE *fp;
1089 +
1090 +  fp = tmpfile ();
1091 +  fputs ("\n \n/foo\\040dir /bar\\040dir auto bind \t \n", fp);
1092 +  rewind (fp);
1093 +
1094 +  /* The corruption happens here ...  */
1095 +  getmntent (fp);
1096 +  /* ... but trigers here.  */
1097 +  endmntent (fp);
1098 +
1099 +  /* If the test failed, we would crash, and not hit this point.  */
1100 +  return 0;
1101 +}
1102 +
1103 +#define TEST_FUNCTION do_test ()
1104 +#include "../test-skeleton.c"
1105 diff --git a/misc/tst-mntent-blank-passno.c b/misc/tst-mntent-blank-passno.c
1106 new file mode 100644
1107 index 0000000..fc04291
1108 --- /dev/null
1109 +++ b/misc/tst-mntent-blank-passno.c
1110 @@ -0,0 +1,53 @@
1111 +/* Make sure trailing whitespace is handled properly BZ #17273.
1112 +
1113 +   Copyright (C) 2009-2015 Free Software Foundation, Inc.
1114 +   This file is part of the GNU C Library.
1115 +
1116 +   The GNU C Library is free software; you can redistribute it and/or
1117 +   modify it under the terms of the GNU Lesser General Public
1118 +   License as published by the Free Software Foundation; either
1119 +   version 2.1 of the License, or (at your option) any later version.
1120 +
1121 +   The GNU C Library is distributed in the hope that it will be useful,
1122 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
1123 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1124 +   Lesser General Public License for more details.
1125 +
1126 +   You should have received a copy of the GNU Lesser General Public
1127 +   License along with the GNU C Library; if not, see
1128 +   <http://www.gnu.org/licenses/>.  */
1129 +
1130 +#include <mntent.h>
1131 +#include <stdio.h>
1132 +#include <string.h>
1133 +
1134 +/* Check entries to make sure trailing whitespace is ignored and we return the
1135 +   correct passno value BZ #17273.  */
1136 +static int
1137 +do_test (void)
1138 +{
1139 +  int result = 0;
1140 +  FILE *fp;
1141 +  struct mntent *mnt;
1142 +
1143 +  fp = tmpfile ();
1144 +  fputs ("/foo\\040dir /bar\\040dir auto bind \t \n", fp);
1145 +  rewind (fp);
1146 +
1147 +  mnt = getmntent (fp);
1148 +  if (strcmp (mnt->mnt_fsname, "/foo dir") != 0
1149 +      || strcmp (mnt->mnt_dir, "/bar dir") != 0
1150 +      || strcmp (mnt->mnt_type, "auto") != 0
1151 +      || strcmp (mnt->mnt_opts, "bind") != 0
1152 +      || mnt->mnt_freq != 0
1153 +      || mnt->mnt_passno != 0)
1154 +    {
1155 +      puts ("Error while reading entry with trailing whitespaces");
1156 +      result = 1;
1157 +    }
1158 +
1159 +  return result;
1160 +}
1161 +
1162 +#define TEST_FUNCTION do_test ()
1163 +#include "../test-skeleton.c"
1164 diff --git a/misc/tst-mntent.c b/misc/tst-mntent.c
1165 index 876c89f..820b354 100644
1166 --- a/misc/tst-mntent.c
1167 +++ b/misc/tst-mntent.c
1168 @@ -73,26 +73,6 @@ main (int argc, char *argv[])
1169           puts ("Error while reading written entry back in");
1170           result = 1;
1171         }
1172 -
1173 -      /* Part III: Entry with whitespaces at the end of a line. */
1174 -      rewind (fp);
1175 -
1176 -      fputs ("/foo\\040dir /bar\\040dir auto bind \t \n", fp);
1177 -
1178 -      rewind (fp);
1179 -
1180 -      mnt = getmntent (fp);
1181 -
1182 -      if (strcmp (mnt->mnt_fsname, "/foo dir") != 0
1183 -         || strcmp (mnt->mnt_dir, "/bar dir") != 0
1184 -         || strcmp (mnt->mnt_type, "auto") != 0
1185 -         || strcmp (mnt->mnt_opts, "bind") != 0
1186 -         || mnt->mnt_freq != 0
1187 -         || mnt->mnt_passno != 0)
1188 -       {
1189 -         puts ("Error while reading entry with trailing whitespaces");
1190 -         result = 1;
1191 -       }
1192     }
1193  
1194    return result;
1195 diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl
1196 index cac1562..79b2b3e 100755
1197 --- a/scripts/test-installation.pl
1198 +++ b/scripts/test-installation.pl
1199 @@ -80,16 +80,25 @@ arglist: while (@ARGV) {
1200  # We expect none or one argument.
1201  if ($#ARGV == -1) {
1202      $soversions="soversions.mk";
1203 +    $config="config.make";
1204  } elsif ($#ARGV == 0) {
1205      if (-d $ARGV[0]) {
1206        $soversions = "$ARGV[0]/soversions.mk";
1207 +      $config = "$ARGV[0]/config.make";
1208      } else {
1209 -      $soversions = $ARGV[0];
1210 +      $soversions = $dir = $ARGV[0];
1211 +      $dir =~ s!/?[^/]*/*$!!;
1212 +      $config = $dir . "/config.make";
1213      }
1214  } else {
1215      die "Wrong number of arguments.";
1216  }
1217  
1218 +if (system ("grep -q \"build-mathvec = yes\" $config") == 0) {
1219 +    $build_mathvec = 1;
1220 +} else {
1221 +    $build_mathvec = 0;
1222 +}
1223  
1224  # Read names and versions of all shared libraries that are part of
1225  # glibc
1226 @@ -111,6 +120,8 @@ while (<SOVERSIONS>) {
1227      # - libthread_db since it contains unresolved references
1228      # - it's just a test NSS module
1229      # - We don't provide the libgcc so we don't test it
1230 +    # - libmvec if it wasn't built
1231 +    next if ($build_mathvec == 0 && $name eq "mvec");
1232      if ($name ne "nss_ldap" && $name ne "db1"
1233         && !($name =~/^nss1_/) && $name ne "thread_db"
1234         && $name ne "nss_test1" && $name ne "libgcc_s") {
1235 diff --git a/stdlib/cxa_thread_atexit_impl.c b/stdlib/cxa_thread_atexit_impl.c
1236 index 2d5d56a..5717f09 100644
1237 --- a/stdlib/cxa_thread_atexit_impl.c
1238 +++ b/stdlib/cxa_thread_atexit_impl.c
1239 @@ -98,6 +98,10 @@ static __thread struct link_map *lm_cache;
1240  int
1241  __cxa_thread_atexit_impl (dtor_func func, void *obj, void *dso_symbol)
1242  {
1243 +#ifdef PTR_MANGLE
1244 +  PTR_MANGLE (func);
1245 +#endif
1246 +
1247    /* Prepend.  */
1248    struct dtor_list *new = calloc (1, sizeof (struct dtor_list));
1249    new->func = func;
1250 @@ -142,9 +146,13 @@ __call_tls_dtors (void)
1251    while (tls_dtor_list)
1252      {
1253        struct dtor_list *cur = tls_dtor_list;
1254 +      dtor_func func = cur->func;
1255 +#ifdef PTR_DEMANGLE
1256 +      PTR_DEMANGLE (func);
1257 +#endif
1258  
1259        tls_dtor_list = tls_dtor_list->next;
1260 -      cur->func (cur->obj);
1261 +      func (cur->obj);
1262  
1263        /* Ensure that the MAP dereference happens before
1264          l_tls_dtor_count decrement.  That way, we protect this access from a
1265 diff --git a/string/Makefile b/string/Makefile
1266 index 8424a61..ebe9354 100644
1267 --- a/string/Makefile
1268 +++ b/string/Makefile
1269 @@ -54,7 +54,7 @@ tests         := tester inl-tester noinl-tester testcopy test-ffs     \
1270                    tst-strtok tst-strxfrm bug-strcoll1 tst-strfry       \
1271                    bug-strtok1 $(addprefix test-,$(strop-tests))        \
1272                    bug-envz1 tst-strxfrm2 tst-endian tst-svc2           \
1273 -                  tst-strtok_r
1274 +                  tst-strtok_r bug-strcoll2
1275  
1276  xtests = tst-strcoll-overflow
1277  
1278 @@ -75,4 +75,17 @@ ifeq ($(run-built-tests),yes)
1279  $(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
1280         cmp $^ > $@; \
1281         $(evaluate-test)
1282 +
1283 +LOCALES := de_DE.UTF-8 en_US.ISO-8859-1 en_US.UTF-8 \
1284 +           tr_TR.ISO-8859-9 tr_TR.UTF-8 cs_CZ.UTF-8 \
1285 +          da_DK.ISO-8859-1
1286 +include ../gen-locales.mk
1287 +
1288 +$(objpfx)test-strcasecmp.out: $(gen-locales)
1289 +$(objpfx)test-strncasecmp.out: $(gen-locales)
1290 +$(objpfx)tst-strxfrm.out: $(gen-locales)
1291 +$(objpfx)tst-strxfrm2.out: $(gen-locales)
1292 +# bug-strcoll2 needs cs_CZ.UTF-8 and da_DK.ISO-8859-1.
1293 +$(objpfx)bug-strcoll2.out: $(gen-locales)
1294 +
1295  endif
1296 diff --git a/string/bug-strcoll2.c b/string/bug-strcoll2.c
1297 new file mode 100644
1298 index 0000000..72a9ff2
1299 --- /dev/null
1300 +++ b/string/bug-strcoll2.c
1301 @@ -0,0 +1,92 @@
1302 +/* Bug 18589: sort-test.sh fails at random.
1303 +   Copyright (C) 2015 Free Software Foundation, Inc.
1304 +   This file is part of the GNU C Library.
1305 +
1306 +   The GNU C Library is free software; you can redistribute it and/or
1307 +   modify it under the terms of the GNU Lesser General Public
1308 +   License as published by the Free Software Foundation; either
1309 +   version 2.1 of the License, or (at your option) any later version.
1310 +
1311 +   The GNU C Library is distributed in the hope that it will be useful,
1312 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
1313 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1314 +   Lesser General Public License for more details.
1315 +
1316 +   You should have received a copy of the GNU Lesser General Public
1317 +   License along with the GNU C Library; if not, see
1318 +   <http://www.gnu.org/licenses/>.  */
1319 +
1320 +#include <stdio.h>
1321 +#include <string.h>
1322 +#include <locale.h>
1323 +
1324 +/* An incorrect strcoll optimization resulted in incorrect
1325 +   results from strcoll for cs_CZ and da_DK.  */
1326 +
1327 +int
1328 +test_cs_CZ (void)
1329 +{
1330 +  const char t1[] = "config";
1331 +  const char t2[] = "choose";
1332 +  if (setlocale (LC_ALL, "cs_CZ.UTF-8") == NULL)
1333 +    {
1334 +      perror ("setlocale");
1335 +      return 1;
1336 +    }
1337 +  /* In Czech the digraph ch sorts after c, therefore we expect
1338 +     config to sort before choose.  */
1339 +  int a = strcoll (t1, t2);
1340 +  int b = strcoll (t2, t1);
1341 +  printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, a);
1342 +  printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, b);
1343 +  if (a < 0 && b > 0)
1344 +    {
1345 +      puts ("PASS: config < choose");
1346 +      return 0;
1347 +    }
1348 +  else
1349 +    {
1350 +      puts ("FAIL: Wrong sorting in cs_CZ.UTF-8.");
1351 +      return 1;
1352 +    }
1353 +}
1354 +
1355 +int
1356 +test_da_DK (void)
1357 +{
1358 +  const char t1[] = "AS";
1359 +  const char t2[] = "AA";
1360 +  if (setlocale (LC_ALL, "da_DK.ISO-8859-1") == NULL)
1361 +    {
1362 +      perror ("setlocale");
1363 +      return 1;
1364 +    }
1365 +  /* AA should be treated as the last letter of the Danish alphabet,
1366 +     hence sorting after AS.  */
1367 +  int a = strcoll (t1, t2);
1368 +  int b = strcoll (t2, t1);
1369 +  printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, a);
1370 +  printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, b);
1371 +  if (a < 0 && b > 0)
1372 +    {
1373 +      puts ("PASS: AS < AA");
1374 +      return 0;
1375 +    }
1376 +  else
1377 +    {
1378 +      puts ("FAIL: Wrong sorting in da_DK.ISO-8859-1");
1379 +      return 1;
1380 +    }
1381 +}
1382 +
1383 +static int
1384 +do_test (void)
1385 +{
1386 +  int err = 0;
1387 +  err |= test_cs_CZ ();
1388 +  err |= test_da_DK ();
1389 +  return err;
1390 +}
1391 +
1392 +#define TEST_FUNCTION do_test ()
1393 +#include "../test-skeleton.c"
1394 diff --git a/string/strcoll_l.c b/string/strcoll_l.c
1395 index 8f1225f..35bc0e4 100644
1396 --- a/string/strcoll_l.c
1397 +++ b/string/strcoll_l.c
1398 @@ -29,7 +29,6 @@
1399  # define STRING_TYPE char
1400  # define USTRING_TYPE unsigned char
1401  # define STRCOLL __strcoll_l
1402 -# define STRDIFF __strdiff
1403  # define STRCMP strcmp
1404  # define WEIGHT_H "../locale/weight.h"
1405  # define SUFFIX        MB
1406 @@ -42,20 +41,6 @@
1407  #include "../locale/localeinfo.h"
1408  #include WEIGHT_H
1409  
1410 -#define MASK_UTF8_7BIT  (1 << 7)
1411 -#define MASK_UTF8_START (3 << 6)
1412 -
1413 -size_t
1414 -STRDIFF (const STRING_TYPE *s, const STRING_TYPE *t)
1415 -{
1416 -  size_t n;
1417 -
1418 -  for (n = 0; *s != '\0' && *s++ == *t++; ++n)
1419 -    continue;
1420 -
1421 -  return n;
1422 -}
1423 -
1424  /* Track status while looking for sequences in a string.  */
1425  typedef struct
1426  {
1427 @@ -269,29 +254,9 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l)
1428    const USTRING_TYPE *extra;
1429    const int32_t *indirect;
1430  
1431 -  /* In case there is no locale specific sort order (C / POSIX).  */
1432    if (nrules == 0)
1433      return STRCMP (s1, s2);
1434  
1435 -  /* Fast forward to the position of the first difference.  Needs to be
1436 -     encoding aware as the byte-by-byte comparison can stop in the middle
1437 -     of a char sequence for multibyte encodings like UTF-8.  */
1438 -  uint_fast32_t encoding =
1439 -    current->values[_NL_ITEM_INDEX (_NL_COLLATE_ENCODING_TYPE)].word;
1440 -  if (encoding != __cet_other)
1441 -    {
1442 -      size_t diff = STRDIFF (s1, s2);
1443 -      if (diff > 0)
1444 -       {
1445 -         if (encoding == __cet_utf8 && (*(s1 + diff) & MASK_UTF8_7BIT) != 0)
1446 -           do
1447 -             diff--;
1448 -           while (diff > 0 && (*(s1 + diff) & MASK_UTF8_START) != MASK_UTF8_START);
1449 -         s1 += diff;
1450 -         s2 += diff;
1451 -       }
1452 -    }
1453 -
1454    /* Catch empty strings.  */
1455    if (__glibc_unlikely (*s1 == '\0') || __glibc_unlikely (*s2 == '\0'))
1456      return (*s1 != '\0') - (*s2 != '\0');
1457 @@ -358,8 +323,7 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l)
1458                      byte-level comparison to ensure that we don't waste time
1459                      going through multiple passes for totally equal strings
1460                      before proceeding to subsequent passes.  */
1461 -                 if (pass == 0 && encoding == __cet_other &&
1462 -                     STRCMP (s1, s2) == 0)
1463 +                 if (pass == 0 && STRCMP (s1, s2) == 0)
1464                     return result;
1465                   else
1466                     break;
1467 diff --git a/string/tst-strxfrm2.c b/string/tst-strxfrm2.c
1468 index d5a1115..bea5aa2 100644
1469 --- a/string/tst-strxfrm2.c
1470 +++ b/string/tst-strxfrm2.c
1471 @@ -5,6 +5,8 @@
1472  static int
1473  do_test (void)
1474  {
1475 +  static const char test_locale[] = "de_DE.UTF-8";
1476 +
1477    int res = 0;
1478  
1479    char buf[20];
1480 @@ -38,9 +40,9 @@ do_test (void)
1481        res = 1;
1482      }
1483  
1484 -  if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
1485 +  if (setlocale (LC_ALL, test_locale) == NULL)
1486      {
1487 -      puts ("setlocale failed");
1488 +      printf ("cannot set locale \"%s\"\n", test_locale);
1489        res = 1;
1490      }
1491    else
1492 diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
1493 index 7a0fe8d..78e3a97 100644
1494 --- a/sysdeps/generic/ldsodefs.h
1495 +++ b/sysdeps/generic/ldsodefs.h
1496 @@ -592,9 +592,6 @@ struct rtld_global_ro
1497    /* List of auditing interfaces.  */
1498    struct audit_ifaces *_dl_audit;
1499    unsigned int _dl_naudit;
1500 -
1501 -  /* 0 if internal pointer values should not be guarded, 1 if they should.  */
1502 -  EXTERN int _dl_pointer_guard;
1503  };
1504  # define __rtld_global_attribute__
1505  # if IS_IN (rtld)
1506 diff --git a/sysdeps/hppa/dl-symaddr.c b/sysdeps/hppa/dl-symaddr.c
1507 index b707c19..89d8baf 100644
1508 --- a/sysdeps/hppa/dl-symaddr.c
1509 +++ b/sysdeps/hppa/dl-symaddr.c
1510 @@ -33,3 +33,4 @@ _dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref)
1511    else
1512      return (void *) value;
1513  }
1514 +rtld_hidden_def (_dl_symbol_address)
1515 diff --git a/sysdeps/nacl/Makefile b/sysdeps/nacl/Makefile
1516 index 6749a44..1748886 100644
1517 --- a/sysdeps/nacl/Makefile
1518 +++ b/sysdeps/nacl/Makefile
1519 @@ -132,4 +132,13 @@ ifeq ($(subdir),misc)
1520  # sysdeps/.../linux/ directories, but it's still a sysdeps decision to
1521  # install it.
1522  sysdep_headers += bits/mman-linux.h
1523 +
1524 +# This defeats sysdeps/gnu/Makefile's addition of sys/mtio.h, which
1525 +# we do not want.  This is a total kludge, but it seems no worse for
1526 +# now than making the sysdeps/gnu/Makefile code conditional on a
1527 +# variable we set here.  If some sysdeps/.../Makefile that is later
1528 +# in the list than sysdeps/gnu needed to add to sysdep_headers, this
1529 +# would break it.  But sysdeps/gnu is close to last in the list and
1530 +# this coming up seems unlikely.
1531 +override sysdep_headers := $(sysdep_headers)
1532  endif
1533 diff --git a/sysdeps/nacl/dl-map-segments.h b/sysdeps/nacl/dl-map-segments.h
1534 index f305da3..f2d5d84 100644
1535 --- a/sysdeps/nacl/dl-map-segments.h
1536 +++ b/sysdeps/nacl/dl-map-segments.h
1537 @@ -53,7 +53,7 @@ _dl_map_segments (struct link_map *l, int fd,
1538                   const size_t maplength, bool has_holes,
1539                   struct link_map *loader)
1540  {
1541 -  if (__builtin_expect (type, ET_DYN) == ET_DYN)
1542 +  if (__glibc_likely (type == ET_DYN))
1543      {
1544        /* This is a position-independent shared object.  Let the system
1545          choose where to place it.
1546 @@ -165,6 +165,32 @@ _dl_map_segments (struct link_map *l, int fd,
1547                     errno = error;
1548                     return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
1549                   }
1550 +                if (__glibc_unlikely (type != ET_DYN))
1551 +                  {
1552 +                    /* A successful PROT_EXEC mmap would have implicitly
1553 +                       updated the bookkeeping so that a future
1554 +                       allocate_code_data call would know that this range
1555 +                       of the address space is already occupied.  That
1556 +                       doesn't happen implicitly with dyncode_create, so
1557 +                       it's necessary to do an explicit call to update the
1558 +                       bookkeeping.  */
1559 +                    uintptr_t allocated_address;
1560 +                    error = __nacl_irt_code_data_alloc.allocate_code_data
1561 +                      (l->l_addr + c->mapstart, len, 0, 0, &allocated_address);
1562 +                    if (__glibc_unlikely (error))
1563 +                      {
1564 +                        errno = error;
1565 +                        return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
1566 +                      }
1567 +                    if (__glibc_unlikely
1568 +                        (allocated_address != l->l_addr + c->mapstart))
1569 +                      {
1570 +                        /* This is not a very helpful error for this case,
1571 +                           but there isn't really anything better to use.  */
1572 +                        errno = ENOMEM;
1573 +                        return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
1574 +                      }
1575 +                  }
1576               }
1577             else
1578               {
1579 diff --git a/sysdeps/nacl/dl-sysdep-open.h b/sysdeps/nacl/dl-sysdep-open.h
1580 new file mode 100644
1581 index 0000000..38b0f9e
1582 --- /dev/null
1583 +++ b/sysdeps/nacl/dl-sysdep-open.h
1584 @@ -0,0 +1,40 @@
1585 +/* System-specific call to open a shared object by name.  NaCl version.
1586 +   Copyright (C) 2015 Free Software Foundation, Inc.
1587 +   This file is part of the GNU C Library.
1588 +
1589 +   The GNU C Library is free software; you can redistribute it and/or
1590 +   modify it under the terms of the GNU Lesser General Public
1591 +   License as published by the Free Software Foundation; either
1592 +   version 2.1 of the License, or (at your option) any later version.
1593 +
1594 +   The GNU C Library is distributed in the hope that it will be useful,
1595 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
1596 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1597 +   Lesser General Public License for more details.
1598 +
1599 +   You should have received a copy of the GNU Lesser General Public
1600 +   License along with the GNU C Library; if not, see
1601 +   <http://www.gnu.org/licenses/>.  */
1602 +
1603 +#ifndef _DL_SYSDEP_OPEN_H
1604 +#define _DL_SYSDEP_OPEN_H      1
1605 +
1606 +#include <stddef.h>
1607 +
1608 +/* NAME is a name without slashes, as it appears in a DT_NEEDED entry
1609 +   or a dlopen call's argument or suchlike.  NAMELEN is (strlen (NAME) + 1).
1610 +
1611 +   Find NAME in an OS-dependent fashion, and return its "real" name.
1612 +   Optionally fill in *FD with a file descriptor open on that file (or
1613 +   else leave its initial value of -1).  The return value is a new
1614 +   malloc'd string, which will be free'd by the caller.  If NAME is
1615 +   resolved to an actual file that can be opened, then the return
1616 +   value should name that file (and if *FD was not set, then a normal
1617 +   __open call on that string will be made).  If *FD was set by some
1618 +   other means than a normal open and there is no "real" name to use,
1619 +   then __strdup (NAME) is fine (modulo error checking).  */
1620 +
1621 +extern char *_dl_sysdep_open_object (const char *name, size_t namelen, int *fd)
1622 +  internal_function attribute_hidden;
1623 +
1624 +#endif  /* dl-sysdep-open.h */
1625 diff --git a/sysdeps/nacl/dl-sysdep.c b/sysdeps/nacl/dl-sysdep.c
1626 index 3e902c2..3a04aa1 100644
1627 --- a/sysdeps/nacl/dl-sysdep.c
1628 +++ b/sysdeps/nacl/dl-sysdep.c
1629 @@ -87,3 +87,26 @@ _dl_start_user (void (*user_entry) (uint32_t info[]), uint32_t info[])
1630  #endif  /* SHARED */
1631  
1632  #include <elf/dl-sysdep.c>
1633 +
1634 +#include <dl-sysdep-open.h>
1635 +#include <nacl-interfaces.h>
1636 +#include <assert.h>
1637 +#include <string.h>
1638 +#include <unistd.h>
1639 +
1640 +char *
1641 +internal_function
1642 +_dl_sysdep_open_object (const char *name, size_t namelen, int *fd)
1643 +{
1644 +  int error = __nacl_irt_resource_open.open_resource (name, fd);
1645 +  if (error)
1646 +    return NULL;
1647 +  assert (*fd != -1);
1648 +  char *realname = __strdup (name);
1649 +  if (__glibc_unlikely (realname == NULL))
1650 +    {
1651 +      __close (*fd);
1652 +      *fd = -1;
1653 +    }
1654 +  return realname;
1655 +}
1656 diff --git a/sysdeps/nacl/nacl-interface-list.h b/sysdeps/nacl/nacl-interface-list.h
1657 index cb33751..c68faed 100644
1658 --- a/sysdeps/nacl/nacl-interface-list.h
1659 +++ b/sysdeps/nacl/nacl-interface-list.h
1660 @@ -28,7 +28,7 @@ NACL_MANDATORY_INTERFACE (rtld,
1661                           NACL_IRT_FUTEX_v0_1, nacl_irt_futex)
1662  NACL_MANDATORY_INTERFACE (rtld,
1663                           NACL_IRT_TLS_v0_1, nacl_irt_tls)
1664 -NACL_MANDATORY_INTERFACE (libc,
1665 +NACL_MANDATORY_INTERFACE (rtld,
1666                           NACL_IRT_RESOURCE_OPEN_v0_1, nacl_irt_resource_open)
1667  NACL_MANDATORY_INTERFACE (rtld,
1668                           NACL_IRT_CODE_DATA_ALLOC_v0_1,
1669 diff --git a/sysdeps/nacl/start.c b/sysdeps/nacl/start.c
1670 index a4b6dd3..8e8bc1a 100644
1671 --- a/sysdeps/nacl/start.c
1672 +++ b/sysdeps/nacl/start.c
1673 @@ -44,6 +44,10 @@
1674  /* The application defines this, of course.  */
1675  extern int main (int argc, char **argv, char **envp);
1676  
1677 +/* But maybe it defines this too, in which case it takes precedence.  */
1678 +extern int __nacl_main (int argc, char **argv, char **envp)
1679 +  __attribute__ ((weak));
1680 +
1681  /* These are defined in libc.  */
1682  extern int __libc_csu_init (int argc, char **argv, char **envp);
1683  extern void __libc_csu_fini (void);
1684 @@ -59,7 +63,7 @@ _start (uint32_t info[])
1685  {
1686    /* The generic code actually assumes that envp follows argv.  */
1687  
1688 -  __libc_start_main (&main,
1689 +  __libc_start_main (&__nacl_main ?: &main,
1690                      nacl_startup_argc (info),
1691                      nacl_startup_argv (info),
1692                      nacl_startup_auxv (info),
1693 diff --git a/sysdeps/posix/opendir.c b/sysdeps/posix/opendir.c
1694 index 6509f5c..9edf056 100644
1695 --- a/sysdeps/posix/opendir.c
1696 +++ b/sysdeps/posix/opendir.c
1697 @@ -105,7 +105,7 @@ need_isdir_precheck (void)
1698      tryopen_o_directory ();
1699  
1700    /* We can skip the expensive `stat' call if O_DIRECTORY works.  */
1701 -  return o_directory_works > 0;
1702 +  return o_directory_works < 0;
1703  #endif
1704    return true;
1705  }
1706 diff --git a/sysdeps/powerpc/nptl/elide.h b/sysdeps/powerpc/nptl/elide.h
1707 index 389f5a5..2e1e443 100644
1708 --- a/sysdeps/powerpc/nptl/elide.h
1709 +++ b/sysdeps/powerpc/nptl/elide.h
1710 @@ -23,67 +23,78 @@
1711  # include <htm.h>
1712  # include <elision-conf.h>
1713  
1714 -/* Returns true if the lock defined by is_lock_free as elided.
1715 -   ADAPT_COUNT is a pointer to per-lock state variable. */
1716 -
1717 +/* Get the new value of adapt_count according to the elision
1718 +   configurations.  Returns true if the system should retry again or false
1719 +   otherwise.  */
1720  static inline bool
1721 -__elide_lock (uint8_t *adapt_count, int is_lock_free)
1722 +__get_new_count (uint8_t *adapt_count, int attempt)
1723  {
1724 -  if (*adapt_count > 0)
1725 +  /* A persistent failure indicates that a retry will probably
1726 +     result in another failure.  Use normal locking now and
1727 +     for the next couple of calls.  */
1728 +  if (_TEXASRU_FAILURE_PERSISTENT (__builtin_get_texasru ()))
1729      {
1730 -      (*adapt_count)--;
1731 +      if (__elision_aconf.skip_lock_internal_abort > 0)
1732 +       *adapt_count = __elision_aconf.skip_lock_internal_abort;
1733        return false;
1734      }
1735 -
1736 -  for (int i = __elision_aconf.try_tbegin; i > 0; i--)
1737 -    {
1738 -      if (__builtin_tbegin (0))
1739 -       {
1740 -         if (is_lock_free)
1741 -           return true;
1742 -         /* Lock was busy.  */
1743 -         __builtin_tabort (_ABORT_LOCK_BUSY);
1744 -       }
1745 -      else
1746 -       {
1747 -         /* A persistent failure indicates that a retry will probably
1748 -            result in another failure.  Use normal locking now and
1749 -            for the next couple of calls.  */
1750 -         if (_TEXASRU_FAILURE_PERSISTENT (__builtin_get_texasru ()))
1751 -           {
1752 -             if (__elision_aconf.skip_lock_internal_abort > 0)
1753 -               *adapt_count = __elision_aconf.skip_lock_internal_abort;
1754 -             break;
1755 -           }
1756 -         /* Same logic as above, but for a number of temporary failures in a
1757 -            a row.  */
1758 -         else if (__elision_aconf.skip_lock_out_of_tbegin_retries > 0
1759 -                  && __elision_aconf.try_tbegin > 0)
1760 -           *adapt_count = __elision_aconf.skip_lock_out_of_tbegin_retries;
1761 -       }
1762 -     }
1763 -
1764 -  return false;
1765 +  /* Same logic as above, but for a number of temporary failures in a
1766 +     a row.  */
1767 +  else if (attempt <= 1 && __elision_aconf.skip_lock_out_of_tbegin_retries > 0
1768 +          && __elision_aconf.try_tbegin > 0)
1769 +    *adapt_count = __elision_aconf.skip_lock_out_of_tbegin_retries;
1770 +  return true;
1771  }
1772  
1773 -# define ELIDE_LOCK(adapt_count, is_lock_free) \
1774 -  __elide_lock (&(adapt_count), is_lock_free)
1775 -
1776 -
1777 -static inline bool
1778 -__elide_trylock (uint8_t *adapt_count, int is_lock_free, int write)
1779 -{
1780 -  if (__elision_aconf.try_tbegin > 0)
1781 -    {
1782 -      if (write)
1783 -       __builtin_tabort (_ABORT_NESTED_TRYLOCK);
1784 -      return __elide_lock (adapt_count, is_lock_free);
1785 -    }
1786 -  return false;
1787 -}
1788 +/* CONCURRENCY NOTES:
1789 +
1790 +   The evaluation of the macro expression is_lock_free encompasses one or
1791 +   more loads from memory locations that are concurrently modified by other
1792 +   threads.  For lock elision to work, this evaluation and the rest of the
1793 +   critical section protected by the lock must be atomic because an
1794 +   execution with lock elision must be equivalent to an execution in which
1795 +   the lock would have been actually acquired and released.  Therefore, we
1796 +   evaluate is_lock_free inside of the transaction that represents the
1797 +   critical section for which we want to use lock elision, which ensures
1798 +   the atomicity that we require.  */
1799 +
1800 +/* Returns 0 if the lock defined by is_lock_free was elided.
1801 +   ADAPT_COUNT is a per-lock state variable.  */
1802 +# define ELIDE_LOCK(adapt_count, is_lock_free)                         \
1803 +  ({                                                                   \
1804 +    int ret = 0;                                                       \
1805 +    if (adapt_count > 0)                                               \
1806 +      (adapt_count)--;                                                 \
1807 +    else                                                               \
1808 +      for (int i = __elision_aconf.try_tbegin; i > 0; i--)             \
1809 +       {                                                               \
1810 +         if (__builtin_tbegin (0))                                     \
1811 +           {                                                           \
1812 +             if (is_lock_free)                                         \
1813 +               {                                                       \
1814 +                 ret = 1;                                              \
1815 +                 break;                                                \
1816 +               }                                                       \
1817 +             __builtin_tabort (_ABORT_LOCK_BUSY);                      \
1818 +           }                                                           \
1819 +         else                                                          \
1820 +           if (!__get_new_count (&adapt_count,i))                      \
1821 +             break;                                                    \
1822 +       }                                                               \
1823 +    ret;                                                               \
1824 +  })
1825  
1826  # define ELIDE_TRYLOCK(adapt_count, is_lock_free, write)       \
1827 -  __elide_trylock (&(adapt_count), is_lock_free, write)
1828 +  ({                                                           \
1829 +    int ret = 0;                                               \
1830 +    if (__elision_aconf.try_tbegin > 0)                                \
1831 +      {                                                                \
1832 +       if (write)                                              \
1833 +         __builtin_tabort (_ABORT_NESTED_TRYLOCK);             \
1834 +       ret = ELIDE_LOCK (adapt_count, is_lock_free);           \
1835 +      }                                                                \
1836 +    ret;                                                       \
1837 +  })
1838  
1839  
1840  static inline bool
1841 diff --git a/sysdeps/sparc/sparc32/sem_open.c b/sysdeps/sparc/sparc32/sem_open.c
1842 index 16cb9ad..59df2d7 100644
1843 --- a/sysdeps/sparc/sparc32/sem_open.c
1844 +++ b/sysdeps/sparc/sparc32/sem_open.c
1845 @@ -29,6 +29,7 @@
1846  #include <sys/mman.h>
1847  #include <sys/stat.h>
1848  #include "semaphoreP.h"
1849 +#include <futex-internal.h>
1850  #include <shm-directory.h>
1851  
1852  
1853 diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
1854 index 58c8b32..aa20e22 100644
1855 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
1856 +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
1857 @@ -1822,9 +1822,6 @@ GLIBC_2.17
1858  GLIBC_2.18
1859   GLIBC_2.18 A
1860   __cxa_thread_atexit_impl F
1861 -GLIBC_2.22
1862 - GLIBC_2.22 A
1863 - fmemopen F
1864  GLIBC_2.2
1865   GLIBC_2.2 A
1866   _IO_adjust_wcolumn F
1867 @@ -2015,6 +2012,9 @@ GLIBC_2.2.4
1868  GLIBC_2.2.6
1869   GLIBC_2.2.6 A
1870   __nanosleep F
1871 +GLIBC_2.22
1872 + GLIBC_2.22 A
1873 + fmemopen F
1874  GLIBC_2.3
1875   GLIBC_2.3 A
1876   __ctype_b_loc F
1877 diff --git a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
1878 index abde83e..6e73504 100644
1879 --- a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
1880 +++ b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
1881 @@ -56,42 +56,41 @@ typedef uintmax_t uatomic_max_t;
1882  #define _LWS "0xb0"
1883  #define _LWS_CAS "0"
1884  /* Note r31 is the link register.  */
1885 -#define _LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory"
1886 +#define _LWS_CLOBBER "r1", "r23", "r22", "r20", "r31", "memory"
1887  /* String constant for -EAGAIN.  */
1888  #define _ASM_EAGAIN "-11"
1889  /* String constant for -EDEADLOCK.  */
1890  #define _ASM_EDEADLOCK "-45"
1891  
1892  #if __ASSUME_LWS_CAS
1893 -/* The only basic operation needed is compare and exchange.  */
1894 +/* The only basic operation needed is compare and exchange.  The mem
1895 +   pointer must be word aligned.  */
1896  # define atomic_compare_and_exchange_val_acq(mem, newval, oldval)      \
1897    ({                                                                   \
1898 -     volatile int lws_errno;                                           \
1899 -     __typeof__ (*mem) lws_ret;                                                \
1900 -     asm volatile(                                                     \
1901 +     register long lws_errno asm("r21");                               \
1902 +     register unsigned long lws_ret asm("r28");                                \
1903 +     register unsigned long lws_mem asm("r26") = (unsigned long)(mem); \
1904 +     register unsigned long lws_old asm("r25") = (unsigned long)(oldval);\
1905 +     register unsigned long lws_new asm("r24") = (unsigned long)(newval);\
1906 +     __asm__ __volatile__(                                             \
1907         "0:                                     \n\t"                   \
1908 -       "copy   %2, %%r26                       \n\t"                   \
1909 -       "copy   %3, %%r25                       \n\t"                   \
1910 -       "copy   %4, %%r24                       \n\t"                   \
1911         "ble    " _LWS "(%%sr2, %%r0)           \n\t"                   \
1912         "ldi    " _LWS_CAS ", %%r20             \n\t"                   \
1913 -       "ldi    " _ASM_EAGAIN ", %%r24          \n\t"                   \
1914 -       "cmpb,=,n %%r24, %%r21, 0b              \n\t"                   \
1915 +       "ldi    " _ASM_EAGAIN ", %%r20          \n\t"                   \
1916 +       "cmpb,=,n %%r20, %%r21, 0b              \n\t"                   \
1917         "nop                                    \n\t"                   \
1918 -       "ldi    " _ASM_EDEADLOCK ", %%r25       \n\t"                   \
1919 -       "cmpb,=,n %%r25, %%r21, 0b              \n\t"                   \
1920 +       "ldi    " _ASM_EDEADLOCK ", %%r20       \n\t"                   \
1921 +       "cmpb,=,n %%r20, %%r21, 0b              \n\t"                   \
1922         "nop                                    \n\t"                   \
1923 -       "stw    %%r28, %0                       \n\t"                   \
1924 -       "stw    %%r21, %1                       \n\t"                   \
1925 -       : "=m" (lws_ret), "=m" (lws_errno)                              \
1926 -        : "r" (mem), "r" (oldval), "r" (newval)                                \
1927 +       : "=r" (lws_ret), "=r" (lws_errno)                              \
1928 +       : "r" (lws_mem), "r" (lws_old), "r" (lws_new)                   \
1929         : _LWS_CLOBBER                                                  \
1930       );                                                                        \
1931                                                                         \
1932 -     if(lws_errno == -EFAULT || lws_errno == -ENOSYS)                  \
1933 +     if (lws_errno == -EFAULT || lws_errno == -ENOSYS)                 \
1934         ABORT_INSTRUCTION;                                              \
1935                                                                         \
1936 -     lws_ret;                                                          \
1937 +     (__typeof (oldval)) lws_ret;                                      \
1938     })
1939  
1940  # define atomic_compare_and_exchange_bool_acq(mem, newval, oldval)     \
1941 diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
1942 index cf0ad90..224e1f3 100644
1943 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
1944 +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
1945 @@ -95,9 +95,6 @@ GLIBC_2.18
1946  GLIBC_2.19
1947   GLIBC_2.19 A
1948   fanotify_mark F
1949 -GLIBC_2.22
1950 - GLIBC_2.22 A
1951 - fmemopen F
1952  GLIBC_2.2
1953   GLIBC_2.2 A
1954   _Exit F
1955 @@ -1863,6 +1860,9 @@ GLIBC_2.2.4
1956  GLIBC_2.2.6
1957   GLIBC_2.2.6 A
1958   __nanosleep F
1959 +GLIBC_2.22
1960 + GLIBC_2.22 A
1961 + fmemopen F
1962  GLIBC_2.3
1963   GLIBC_2.3 A
1964   __ctype_b_loc F
1965 diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.h b/sysdeps/unix/sysv/linux/microblaze/sysdep.h
1966 index 83c0340..9d5c542 100644
1967 --- a/sysdeps/unix/sysv/linux/microblaze/sysdep.h
1968 +++ b/sysdeps/unix/sysv/linux/microblaze/sysdep.h
1969 @@ -16,8 +16,11 @@
1970     License along with the GNU C Library; if not, see
1971     <http://www.gnu.org/licenses/>.  */
1972  
1973 +#ifndef _LINUX_MICROBLAZE_SYSDEP_H
1974 +#define _LINUX_MICROBLAZE_SYSDEP_H 1
1975 +
1976 +#include <sysdeps/unix/sysdep.h>
1977  #include <sysdeps/microblaze/sysdep.h>
1978 -#include <sys/syscall.h>
1979  
1980  /* Defines RTLD_PRIVATE_ERRNO.  */
1981  #include <dl-sysdep.h>
1982 @@ -305,3 +308,5 @@ SYSCALL_ERROR_LABEL_DCL:                            \
1983  # define PTR_DEMANGLE(var) (void) (var)
1984  
1985  #endif /* not __ASSEMBLER__ */
1986 +
1987 +#endif /* _LINUX_MICROBLAZE_SYSDEP_H */
1988 diff --git a/sysdeps/unix/sysv/linux/openat.c b/sysdeps/unix/sysv/linux/openat.c
1989 index 6777123..ad8e31d 100644
1990 --- a/sysdeps/unix/sysv/linux/openat.c
1991 +++ b/sysdeps/unix/sysv/linux/openat.c
1992 @@ -68,6 +68,11 @@ __OPENAT (int fd, const char *file, int oflag, ...)
1993        va_end (arg);
1994      }
1995  
1996 +  /* We have to add the O_LARGEFILE flag for openat64.  */
1997 +#ifdef MORE_OFLAGS
1998 +  oflag |= MORE_OFLAGS;
1999 +#endif
2000 +
2001    return SYSCALL_CANCEL (openat, fd, file, oflag, mode);
2002  }
2003  libc_hidden_def (__OPENAT)
2004 diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-lock.c b/sysdeps/unix/sysv/linux/powerpc/elision-lock.c
2005 index 7f9bcc2..c6731ca 100644
2006 --- a/sysdeps/unix/sysv/linux/powerpc/elision-lock.c
2007 +++ b/sysdeps/unix/sysv/linux/powerpc/elision-lock.c
2008 @@ -72,8 +72,7 @@ __lll_lock_elision (int *lock, short *adapt_count, EXTRAARG int pshared)
2009        goto use_lock;
2010      }
2011  
2012 -  int try_begin = aconf.try_tbegin;
2013 -  while (1)
2014 +  for (int i = aconf.try_tbegin; i > 0; i--)
2015      {
2016        if (__builtin_tbegin (0))
2017         {
2018 @@ -87,21 +86,19 @@ __lll_lock_elision (int *lock, short *adapt_count, EXTRAARG int pshared)
2019           /* A persistent failure indicates that a retry will probably
2020              result in another failure.  Use normal locking now and
2021              for the next couple of calls.  */
2022 -         if (try_begin-- <= 0
2023 -             || _TEXASRU_FAILURE_PERSISTENT (__builtin_get_texasru ()))
2024 +         if (_TEXASRU_FAILURE_PERSISTENT (__builtin_get_texasru ()))
2025             {
2026               if (aconf.skip_lock_internal_abort > 0)
2027                 *adapt_count = aconf.skip_lock_internal_abort;
2028               goto use_lock;
2029             }
2030 -         /* Same logic as above, but for for a number of temporary failures
2031 -            in a row.  */
2032 -         else if (aconf.skip_lock_out_of_tbegin_retries > 0
2033 -                   && aconf.try_tbegin > 0)
2034 -           *adapt_count = aconf.skip_lock_out_of_tbegin_retries;
2035         }
2036       }
2037  
2038 +  /* Fall back to locks for a bit if retries have been exhausted */
2039 +  if (aconf.try_tbegin > 0 && aconf.skip_lock_out_of_tbegin_retries > 0)
2040 +    *adapt_count = aconf.skip_lock_out_of_tbegin_retries;
2041 +
2042  use_lock:
2043    return LLL_LOCK ((*lock), pshared);
2044  }
2045 diff --git a/sysdeps/x86/fpu/bits/math-vector.h b/sysdeps/x86/fpu/bits/math-vector.h
2046 index f9e798b..f3bfb86 100644
2047 --- a/sysdeps/x86/fpu/bits/math-vector.h
2048 +++ b/sysdeps/x86/fpu/bits/math-vector.h
2049 @@ -53,34 +53,5 @@
2050  #  undef __DECL_SIMD_powf
2051  #  define __DECL_SIMD_powf __DECL_SIMD_x86_64
2052  
2053 -/* Workaround to exclude unnecessary symbol aliases in libmvec
2054 -   while GCC creates the vector names based on scalar asm name.
2055 -   Corresponding discussion started at
2056 -   <https://gcc.gnu.org/ml/gcc/2015-06/msg00173.html>.  */
2057 -__asm__ ("_ZGVbN2v___log_finite = _ZGVbN2v_log");
2058 -__asm__ ("_ZGVcN4v___log_finite = _ZGVcN4v_log");
2059 -__asm__ ("_ZGVdN4v___log_finite = _ZGVdN4v_log");
2060 -__asm__ ("_ZGVeN8v___log_finite = _ZGVeN8v_log");
2061 -__asm__ ("_ZGVbN4v___logf_finite = _ZGVbN4v_logf");
2062 -__asm__ ("_ZGVcN8v___logf_finite = _ZGVcN8v_logf");
2063 -__asm__ ("_ZGVdN8v___logf_finite = _ZGVdN8v_logf");
2064 -__asm__ ("_ZGVeN16v___logf_finite = _ZGVeN16v_logf");
2065 -__asm__ ("_ZGVbN2v___exp_finite = _ZGVbN2v_exp");
2066 -__asm__ ("_ZGVcN4v___exp_finite = _ZGVcN4v_exp");
2067 -__asm__ ("_ZGVdN4v___exp_finite = _ZGVdN4v_exp");
2068 -__asm__ ("_ZGVeN8v___exp_finite = _ZGVeN8v_exp");
2069 -__asm__ ("_ZGVbN4v___expf_finite = _ZGVbN4v_expf");
2070 -__asm__ ("_ZGVcN8v___expf_finite = _ZGVcN8v_expf");
2071 -__asm__ ("_ZGVdN8v___expf_finite = _ZGVdN8v_expf");
2072 -__asm__ ("_ZGVeN16v___expf_finite = _ZGVeN16v_expf");
2073 -__asm__ ("_ZGVbN2vv___pow_finite = _ZGVbN2vv_pow");
2074 -__asm__ ("_ZGVcN4vv___pow_finite = _ZGVcN4vv_pow");
2075 -__asm__ ("_ZGVdN4vv___pow_finite = _ZGVdN4vv_pow");
2076 -__asm__ ("_ZGVeN8vv___pow_finite = _ZGVeN8vv_pow");
2077 -__asm__ ("_ZGVbN4vv___powf_finite = _ZGVbN4vv_powf");
2078 -__asm__ ("_ZGVcN8vv___powf_finite = _ZGVcN8vv_powf");
2079 -__asm__ ("_ZGVdN8vv___powf_finite = _ZGVdN8vv_powf");
2080 -__asm__ ("_ZGVeN16vv___powf_finite = _ZGVeN16vv_powf");
2081 -
2082  # endif
2083  #endif
2084 diff --git a/sysdeps/x86_64/fpu/Makefile b/sysdeps/x86_64/fpu/Makefile
2085 index 1ebe511..b32b852 100644
2086 --- a/sysdeps/x86_64/fpu/Makefile
2087 +++ b/sysdeps/x86_64/fpu/Makefile
2088 @@ -20,7 +20,10 @@ libmvec-support += svml_d_cos2_core svml_d_cos4_core_avx \
2089                    svml_d_pow_data svml_s_powf4_core svml_s_powf8_core_avx \
2090                    svml_s_powf8_core svml_s_powf16_core svml_s_powf_data \
2091                    svml_s_sincosf4_core svml_s_sincosf8_core_avx \
2092 -                  svml_s_sincosf8_core svml_s_sincosf16_core init-arch
2093 +                  svml_s_sincosf8_core svml_s_sincosf16_core init-arch \
2094 +                  svml_finite_alias
2095 +
2096 +libmvec-static-only-routines = svml_finite_alias
2097  endif
2098  
2099  # Variables for libmvec tests.
2100 diff --git a/sysdeps/x86_64/fpu/svml_finite_alias.S b/sysdeps/x86_64/fpu/svml_finite_alias.S
2101 new file mode 100644
2102 index 0000000..f8bcfeb
2103 --- /dev/null
2104 +++ b/sysdeps/x86_64/fpu/svml_finite_alias.S
2105 @@ -0,0 +1,59 @@
2106 +/* These aliases added as workaround to exclude unnecessary symbol
2107 +   aliases in libmvec.so while compiler creates the vector names
2108 +   based on scalar asm name.  Corresponding discussion is at
2109 +   <https://gcc.gnu.org/ml/gcc/2015-06/msg00173.html>.
2110 +   Copyright (C) 2015 Free Software Foundation, Inc.
2111 +   This file is part of the GNU C Library.
2112 +
2113 +   The GNU C Library is free software; you can redistribute it and/or
2114 +   modify it under the terms of the GNU Lesser General Public
2115 +   License as published by the Free Software Foundation; either
2116 +   version 2.1 of the License, or (at your option) any later version.
2117 +
2118 +   The GNU C Library is distributed in the hope that it will be useful,
2119 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
2120 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2121 +   Lesser General Public License for more details.
2122 +
2123 +   You should have received a copy of the GNU Lesser General Public
2124 +   License along with the GNU C Library; if not, see
2125 +   <http://www.gnu.org/licenses/>.  */
2126 +
2127 +#include <sysdep.h>
2128 +
2129 +#define ALIAS_IMPL(alias, target) \
2130 +ENTRY (alias); \
2131 +       call target; \
2132 +       ret; \
2133 +END (alias)
2134 +
2135 +       .text
2136 +ALIAS_IMPL (_ZGVbN2v___log_finite, _ZGVbN2v_log)
2137 +ALIAS_IMPL (_ZGVcN4v___log_finite, _ZGVcN4v_log)
2138 +ALIAS_IMPL (_ZGVdN4v___log_finite, _ZGVdN4v_log)
2139 +ALIAS_IMPL (_ZGVeN8v___log_finite, _ZGVeN8v_log)
2140 +
2141 +ALIAS_IMPL (_ZGVbN4v___logf_finite, _ZGVbN4v_logf)
2142 +ALIAS_IMPL (_ZGVcN8v___logf_finite, _ZGVcN8v_logf)
2143 +ALIAS_IMPL (_ZGVdN8v___logf_finite, _ZGVdN8v_logf)
2144 +ALIAS_IMPL (_ZGVeN16v___logf_finite, _ZGVeN16v_logf)
2145 +
2146 +ALIAS_IMPL (_ZGVbN2v___exp_finite, _ZGVbN2v_exp)
2147 +ALIAS_IMPL (_ZGVcN4v___exp_finite, _ZGVcN4v_exp)
2148 +ALIAS_IMPL (_ZGVdN4v___exp_finite, _ZGVdN4v_exp)
2149 +ALIAS_IMPL (_ZGVeN8v___exp_finite, _ZGVeN8v_exp)
2150 +
2151 +ALIAS_IMPL (_ZGVbN4v___expf_finite, _ZGVbN4v_expf)
2152 +ALIAS_IMPL (_ZGVcN8v___expf_finite, _ZGVcN8v_expf)
2153 +ALIAS_IMPL (_ZGVdN8v___expf_finite, _ZGVdN8v_expf)
2154 +ALIAS_IMPL (_ZGVeN16v___expf_finite, _ZGVeN16v_expf)
2155 +
2156 +ALIAS_IMPL (_ZGVbN2vv___pow_finite, _ZGVbN2vv_pow)
2157 +ALIAS_IMPL (_ZGVcN4vv___pow_finite, _ZGVcN4vv_pow)
2158 +ALIAS_IMPL (_ZGVdN4vv___pow_finite, _ZGVdN4vv_pow)
2159 +ALIAS_IMPL (_ZGVeN8vv___pow_finite, _ZGVeN8vv_pow)
2160 +
2161 +ALIAS_IMPL (_ZGVbN4vv___powf_finite, _ZGVbN4vv_powf)
2162 +ALIAS_IMPL (_ZGVcN8vv___powf_finite, _ZGVcN8vv_powf)
2163 +ALIAS_IMPL (_ZGVdN8vv___powf_finite, _ZGVdN8vv_powf)
2164 +ALIAS_IMPL (_ZGVeN16vv___powf_finite, _ZGVeN16vv_powf)
2165 diff --git a/wcsmbs/wcscoll_l.c b/wcsmbs/wcscoll_l.c
2166 index 6d9384a..87f240d 100644
2167 --- a/wcsmbs/wcscoll_l.c
2168 +++ b/wcsmbs/wcscoll_l.c
2169 @@ -23,7 +23,6 @@
2170  #define STRING_TYPE wchar_t
2171  #define USTRING_TYPE wint_t
2172  #define STRCOLL __wcscoll_l
2173 -#define STRDIFF __wcsdiff
2174  #define STRCMP __wcscmp
2175  #define WEIGHT_H "../locale/weightwc.h"
2176  #define SUFFIX WC
This page took 0.235053 seconds and 4 git commands to generate.