1 diff --git a/ChangeLog b/ChangeLog
2 index cb9124e..b1816c2 100644
6 +2015-11-20 Roland McGrath <roland@hack.frob.com>
8 + * sysdeps/nacl/dl-map-segments.h (_dl_map_segments): Use
9 + __glibc_likely instead of __builtin_expect. After falling back to
10 + dyncode_create in a non-ET_DYN case, use the allocate_code_data
11 + system interface to register the code pages as occupied.
13 +2015-11-14 H.J. Lu <hongjiu.lu@intel.com>
15 + * config.make.in (have-glob-dat-reloc): New.
16 + * configure.ac (libc_cv_has_glob_dat): New. Set to yes if
17 + target supports GLOB_DAT relocaton. AC_SUBST.
18 + * configure: Regenerated.
19 + * elf/Makefile (tests): Add tst-prelink.
20 + (tests-special): Add $(objpfx)tst-prelink-cmp.out.
21 + (tst-prelink-ENV): New.
22 + ($(objpfx)tst-prelink-conflict.out): Likewise.
23 + ($(objpfx)tst-prelink-cmp.out): Likewise.
24 + * sysdeps/x86/tst-prelink.c: Moved to ...
25 + * elf/tst-prelink.c: Here.
26 + * sysdeps/x86/tst-prelink.exp: Moved to ...
27 + * elf/tst-prelink.exp: Here.
28 + * sysdeps/x86/Makefile (tests): Don't add tst-prelink.
29 + (tst-prelink-ENV): Removed.
30 + ($(objpfx)tst-prelink-conflict.out): Likewise.
31 + ($(objpfx)tst-prelink-cmp.out): Likewise.
32 + (tests-special): Don't add $(objpfx)tst-prelink-cmp.out.
34 +2015-11-10 Roland McGrath <roland@hack.frob.com>
36 + * elf/dl-load.c (open_verify): Take new argument FD.
37 + Skip __open call if passed FD is not -1.
38 + (_dl_map_object, open_path): Update callers.
39 + * elf/dl-sysdep-open.h: New file.
40 + * elf/dl-load.c: Include it.
41 + (_dl_map_object): Try _dl_sysdep_open_object before ldconfig cache.
42 + * sysdeps/nacl/dl-sysdep.c (_dl_sysdep_open_object): New function.
43 + * sysdeps/nacl/dl-sysdep-open.h: New file.
44 + * sysdeps/nacl/nacl-interface-list.h: Move nacl_irt_resource_open
47 +2015-11-10 H.J. Lu <hongjiu.lu@intel.com>
50 + * sysdeps/x86/Makefile (tests): Add tst-prelink.
51 + (tst-prelink-ENV): New.
52 + ($(objpfx)tst-prelink-conflict.out): Likewise.
53 + ($(objpfx)tst-prelink-cmp.out): Likewise.
54 + (tests-special): Add $(objpfx)tst-prelink-cmp.out.
55 + * sysdeps/x86/tst-prelink.c: New file.
56 + * sysdeps/x86/tst-prelink.exp: Likewise.
58 +2015-11-07 H.J. Lu <hongjiu.lu@intel.com>
61 + * elf/dl-lookup.c (RTYPE_CLASS_VALID): New.
62 + (RTYPE_CLASS_PLT): Likewise.
63 + (RTYPE_CLASS_COPY): Likewise.
64 + (RTYPE_CLASS_TLS): Likewise.
65 + (_dl_debug_bindings): Use RTYPE_CLASS_TLS and RTYPE_CLASS_VALID
66 + to set relocation type class for DL_DEBUG_PRELINK. Keep only
67 + ELF_RTYPE_CLASS_PLT and ELF_RTYPE_CLASS_COPY bits for
70 +2015-10-20 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
73 + * sysdeps/powerpc/nptl/elide.h (__elide_lock): Move most of this
75 + (ELIDE_LOCK): ...here.
76 + (__get_new_count): New function with part of the code from
77 + __elide_lock that updates the value of adapt_count after a
79 + (__elided_trylock): Moved this code to...
80 + (ELIDE_TRYLOCK): ...here.
82 +2015-10-06 Florian Weimer <fweimer@redhat.com>
85 + * stdlib/cxa_thread_atexit_impl.c (__cxa_thread_atexit_impl):
86 + Mangle function pointer before storing it.
87 + (__call_tls_dtors): Demangle function pointer before calling it.
89 +2015-10-15 Florian Weimer <fweimer@redhat.com>
92 + * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
93 + _dl_pointer_guard member.
94 + * elf/rtld.c (_rtld_global_ro): Remove _dl_pointer_guard
96 + (security_init): Always set up pointer guard.
97 + (process_envvars): Do not process LD_POINTER_GUARD.
99 +2015-10-09 Carlos O'Donell <carlos@redhat.com>
102 + * string/bug-strcoll2.c: Adjust copyright, and remove contributed by.
103 + * string/Makefile ($(objpfx)bug-strcoll2.out): Depend on
106 +2015-10-08 Carlos O'Donell <carlos@redhat.com>
109 + * string/Makefile (tests): Add bug-strcoll2.
110 + (LOCALES): Add cs_CZ.UTF-8.
112 +2015-09-28 Martin Sebor <msebor@redhat.com>
115 + * string/Makefile (LOCALES): Define.
116 + (gen-locales.mk): Include.
117 + (test-strcasecmp.out, test-strncasecmp.out, tst-strxfrm.out)
118 + (tst-strxfrm2.out): Add deppendency on $(gen-locales).
119 + * string/tst-strxfrm2.c (do_test): Print the name of the locale
120 + on setlocale failure.
122 +2015-10-08 Carlos O'Donell <carlos@redhat.com>
125 + * string/bug-strcoll2.c: New file.
126 + * locale/categories.def: Revert commit
127 + f13c2a8dff2329c6692a80176262ceaaf8a6f74e.
128 + * locale/langinfo.h: Likewise.
129 + * locale/localeinfo.h: Likewise.
130 + * locale/C-collate.c: Likewise.
131 + * programs/ld-collate.c (collate_output): Likewise.
132 + * string/strcoll_l.c (STRDIFF): Likewise.
133 + (STRCOLL): Likewise.
134 + * wcsmbs/wcscoll_l.c: Likewise.
136 +2015-09-15 Roland McGrath <roland@hack.frob.com>
138 + * misc/sys/param.h [!MAXHOSTNAMELEN && HOST_NAME_MAX]
139 + (MAXHOSTNAMELEN): Define it to HOST_NAME_MAX.
141 +2015-09-11 Roland McGrath <roland@hack.frob.com>
143 + * sysdeps/nacl/Makefile [$(subdir) = misc] (sysdep_headers):
144 + Use 'override' keyword to freeze the value here, preventing
145 + the addition of sys/mtio.h by sysdeps/gnu/Makefile.
147 +2015-09-04 Roland McGrath <roland@hack.frob.com>
150 + * sysdeps/posix/opendir.c (need_isdir_precheck) [O_DIRECTORY]:
151 + Fix inverted sense of test of 'o_directory_works' value.
152 + Reported by Pádraig Brady <P@draigBrady.com>, diagnosed by
153 + Bernhard Voelker <mail@bernhard-voelker.de>.
155 +2015-08-31 Brett Neumeier <brett@neumeier.us>
158 + * sysdeps/sparc/sparc32/sem_open.c: Add missing #include
160 +2015-08-28 Mike Frysinger <vapier@gentoo.org>
163 + * misc/Makefile (tests): Add tst-mntent-blank-corrupt and
164 + tst-mntent-blank-passno.
165 + * misc/mntent_r.c (__getmntent_r): Do not read past buffer[0].
166 + * misc/tst-mntent-blank-corrupt.c: New test.
167 + * misc/tst-mntent-blank-passno.c: New test ripped from ...
168 + * misc/tst-mntent.c (do_test): ... here.
170 +2015-08-25 Roland McGrath <roland@hack.frob.com>
172 + * sysdeps/nacl/start.c (_start): Call __nacl_main instead of main
173 + if the weak reference is not null.
175 +2015-08-19 Andrew Senkevich <andrew.senkevich@intel.com>
178 + * scripts/test-installation.pl: Don't add -lmvec to build options
179 + if libmvec wasn't built.
180 + * NEWS: Mention this fix.
182 +2015-08-10 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
185 + * elf/Makefile (tests): Add Add tst-nodelete2.
186 + (modules-names): Add tst-nodelete2mod.
187 + (tst-nodelete2mod.so-no-z-defs): New.
188 + ($(objpfx)tst-nodelete2): Likewise.
189 + ($(objpfx)tst-nodelete2.out): Likewise.
190 + (LDFLAGS-tst-nodelete2): Likewise.
191 + * elf/dl-close.c (_dl_close_worker): Move DF_1_NODELETE clearing
192 + out of loop through all loaded libraries.
193 + * elf/tst-nodelete2.c: New file.
194 + * elf/tst-nodelete2mod.c: Likewise.
196 +2015-08-10 Andreas Schwab <schwab@suse.de>
199 + * sysdeps/unix/sysv/linux/openat.c (__OPENAT) [MORE_OFLAGS]: Add
200 + MORE_OFLAGS to oflag.
201 + * io/test-lfs.c (do_test): Test openat64.
203 +2015-08-08 John David Anglin <danglin@gcc.gnu.org>
206 + * sysdeps/unix/sysv/linux/hppa/bits/atomic.h (_LWS_CLOBBER): Revise
208 + (atomic_compare_and_exchange_val_acq): Use register asms to assign
209 + operand registers. Use register %r20 for EAGAIN and EDEADLOCK checks.
210 + Cast return to __typeof (oldval).
212 +2015-08-08 Mike Frysinger <vapier@gentoo.org>
214 + * sysdeps/unix/sysv/linux/microblaze/sysdep.h: Wrap the whole file
215 + in _LINUX_MICROBLAZE_SYSDEP_H defines. Include sysdeps/unix/sysdep.h
216 + and delete sys/syscall.h include.
218 +2015-08-07 Mike Frysinger <vapier@gentoo.org>
220 + * sysdeps/hppa/dl-symaddr.c (_dl_symbol_address): Add rtld_hidden_def.
222 +2015-08-05 Zack Weinberg <zackw@panix.com>
224 + * misc/regexp.h: Update comments.
226 2015-08-05 Carlos O'Donell <carlos@systemhalted.org>
228 * version.h (RELEASE): Set to "stable".
229 diff --git a/NEWS b/NEWS
230 index 4c31de7..30fe67c 100644
233 @@ -5,6 +5,16 @@ See the end for copying conditions.
234 Please send GNU C library bug reports via <http://sourceware.org/bugzilla/>
235 using `glibc' in the "product" field.
239 +* The following bugs are resolved with this release:
241 + 18589, 18743, 18778, 18781, 18787, 18796, 18870, 18887, 18921, 18928,
242 + 18969, 19018, 19178.
244 +* The LD_POINTER_GUARD environment variable can no longer be used to
245 + disable the pointer guard feature. It is always enabled.
249 * The following bugs are resolved with this release:
250 @@ -84,7 +94,7 @@ Version 2.22
251 release. Use of this header will trigger a deprecation warning.
252 Application developers should update their code to use <regex.h> instead.
254 - This header was formerly part of SUSv2, but was deprecated in 1997 and
255 + This header was formerly part of SUS, but was deprecated in 1994 and
256 removed from the standard in 2001. Also, the glibc implementation
257 leaks memory. See BZ#18681 for more details.
259 diff --git a/config.make.in b/config.make.in
260 index a9f5696..46cd9bb 100644
263 @@ -51,6 +51,7 @@ have-z-combreloc = @libc_cv_z_combreloc@
264 have-z-execstack = @libc_cv_z_execstack@
265 have-Bgroup = @libc_cv_Bgroup@
266 have-protected-data = @libc_cv_protected_data@
267 +have-glob-dat-reloc = @libc_cv_has_glob_dat@
269 old-glibc-headers = @old_glibc_headers@
270 unwind-find-fde = @libc_cv_gcc_unwind_find_fde@
271 diff --git a/configure b/configure
272 index 45cc7cb..4f87b31 100755
275 @@ -628,6 +628,7 @@ gnu89_inline
278 libc_cv_output_format
279 +libc_cv_has_glob_dat
283 @@ -6335,6 +6336,39 @@ $as_echo "$libc_cv_use_default_link" >&6; }
284 use_default_link=$libc_cv_use_default_link
287 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_DAT reloc" >&5
288 +$as_echo_n "checking for GLOB_DAT reloc... " >&6; }
289 +if ${libc_cv_has_glob_dat+:} false; then :
290 + $as_echo_n "(cached) " >&6
292 + cat > conftest.c <<EOF
294 +int foo (void) { return mumble; }
296 +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
297 + -fPIC -shared -o conftest.so conftest.c
298 + -nostdlib -nostartfiles
300 + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
301 + (eval $ac_try) 2>&5
303 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
304 + test $ac_status = 0; }; }
306 + if $READELF -rW conftest.so | grep '_GLOB_DAT' > /dev/null; then
307 + libc_cv_has_glob_dat=yes
309 + libc_cv_has_glob_dat=no
312 + libc_cv_has_glob_dat=no
316 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_has_glob_dat" >&5
317 +$as_echo "$libc_cv_has_glob_dat" >&6; }
320 { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker output format" >&5
321 $as_echo_n "checking linker output format... " >&6; }
322 if ${libc_cv_output_format+:} false; then :
323 diff --git a/configure.ac b/configure.ac
324 index 7e9383a..8be612d 100644
327 @@ -1535,6 +1535,29 @@ $ac_try"
328 use_default_link=$libc_cv_use_default_link
331 +AC_CACHE_CHECK(for GLOB_DAT reloc,
332 + libc_cv_has_glob_dat, [dnl
333 +cat > conftest.c <<EOF
335 +int foo (void) { return mumble; }
337 +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
338 + -fPIC -shared -o conftest.so conftest.c
339 + -nostdlib -nostartfiles
340 + 1>&AS_MESSAGE_LOG_FD])
342 +dnl look for GLOB_DAT relocation.
343 + if $READELF -rW conftest.so | grep '_GLOB_DAT' > /dev/null; then
344 + libc_cv_has_glob_dat=yes
346 + libc_cv_has_glob_dat=no
349 + libc_cv_has_glob_dat=no
352 +AC_SUBST(libc_cv_has_glob_dat)
354 AC_CACHE_CHECK(linker output format, libc_cv_output_format, [dnl
355 if libc_cv_output_format=`
356 ${CC-cc} -nostartfiles -nostdlib -Wl,--print-output-format 2>&AS_MESSAGE_LOG_FD`
357 diff --git a/elf/Makefile b/elf/Makefile
358 index 4ceeaf8..a2c43bc 100644
361 @@ -148,7 +148,8 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
362 tst-unique1 tst-unique2 $(if $(CXX),tst-unique3 tst-unique4 \
364 tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
365 - tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened
366 + tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
369 ifeq ($(build-hardcoded-path-in-tests),yes)
370 tests += tst-dlopen-aout
371 @@ -218,7 +219,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
373 tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \
374 tst-array5dep tst-null-argv-lib \
375 - tst-tlsalign-lib tst-nodelete-opened-lib
376 + tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod
377 ifeq (yes,$(have-protected-data))
378 modules-names += tst-protected1moda tst-protected1modb
379 tests += tst-protected1a tst-protected1b
380 @@ -292,6 +293,13 @@ check-abi: $(objpfx)check-abi-ld.out
381 tests-special += $(objpfx)check-abi-ld.out
382 update-abi: update-abi-ld
384 +ifeq ($(have-glob-dat-reloc),yes)
385 +tests += tst-prelink
386 +ifeq ($(run-built-tests),yes)
387 +tests-special += $(objpfx)tst-prelink-cmp.out
393 ifeq (yes,$(build-shared))
394 @@ -594,6 +602,7 @@ tst-auditmod9b.so-no-z-defs = yes
395 tst-nodelete-uniquemod.so-no-z-defs = yes
396 tst-nodelete-rtldmod.so-no-z-defs = yes
397 tst-nodelete-zmod.so-no-z-defs = yes
398 +tst-nodelete2mod.so-no-z-defs = yes
400 ifeq ($(build-shared),yes)
401 # Build all the modules even when not actually running test programs.
402 @@ -1164,6 +1173,11 @@ $(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \
403 LDFLAGS-tst-nodelete = -rdynamic
404 LDFLAGS-tst-nodelete-zmod.so = -Wl,--enable-new-dtags,-z,nodelete
406 +$(objpfx)tst-nodelete2: $(libdl)
407 +$(objpfx)tst-nodelete2.out: $(objpfx)tst-nodelete2mod.so
409 +LDFLAGS-tst-nodelete2 = -rdynamic
411 $(objpfx)tst-initorder-cmp.out: tst-initorder.exp $(objpfx)tst-initorder.out
414 @@ -1205,3 +1219,13 @@ $(objpfx)tst-unused-dep.out: $(objpfx)testobj1.so
415 $(objpfx)tst-unused-dep-cmp.out: $(objpfx)tst-unused-dep.out
416 cmp $< /dev/null > $@; \
419 +tst-prelink-ENV = LD_TRACE_PRELINKING=1
421 +$(objpfx)tst-prelink-conflict.out: $(objpfx)tst-prelink.out
422 + grep stdout $< | grep conflict | $(AWK) '{ print $$10, $$11 }' > $@
424 +$(objpfx)tst-prelink-cmp.out: tst-prelink.exp \
425 + $(objpfx)tst-prelink-conflict.out
428 diff --git a/elf/dl-close.c b/elf/dl-close.c
429 index 9105277..c897247 100644
432 @@ -144,6 +144,14 @@ _dl_close_worker (struct link_map *map, bool force)
434 struct link_map *maps[nloaded];
436 + /* Clear DF_1_NODELETE to force object deletion. We don't need to touch
437 + l_tls_dtor_count because forced object deletion only happens when an
438 + error occurs during object load. Destructor registration for TLS
439 + non-POD objects should not have happened till then for this
442 + map->l_flags_1 &= ~DF_1_NODELETE;
444 /* Run over the list and assign indexes to the link maps and enter
445 them into the MAPS array. */
447 @@ -153,13 +161,6 @@ _dl_close_worker (struct link_map *map, bool force)
451 - /* Clear DF_1_NODELETE to force object deletion. We don't need to touch
452 - l_tls_dtor_count because forced object deletion only happens when an
453 - error occurs during object load. Destructor registration for TLS
454 - non-POD objects should not have happened till then for this
457 - l->l_flags_1 &= ~DF_1_NODELETE;
459 assert (idx == nloaded);
461 diff --git a/elf/dl-load.c b/elf/dl-load.c
462 index 0c052e4..7e6f4c5 100644
466 #include <dl-map-segments.h>
467 #include <dl-unmap-segments.h>
468 #include <dl-machine-reject-phdr.h>
469 +#include <dl-sysdep-open.h>
473 @@ -1471,9 +1472,13 @@ print_search_path (struct r_search_path_elem **list,
474 ignore only ELF files for other architectures. Non-ELF files and
475 ELF files with different header information cause fatal errors since
476 this could mean there is something wrong in the installation and the
477 - user might want to know about this. */
478 + user might want to know about this.
480 + If FD is not -1, then the file is already open and FD refers to it.
481 + In that case, FD is consumed for both successful and error returns. */
483 -open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
484 +open_verify (const char *name, int fd,
485 + struct filebuf *fbp, struct link_map *loader,
486 int whatcode, int mode, bool *found_other_class, bool free_name)
488 /* This is the expected ELF header. */
489 @@ -1514,6 +1519,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
490 if (__glibc_unlikely (GLRO(dl_naudit) > 0) && whatcode != 0
491 && loader->l_auditing == 0)
493 + const char *original_name = name;
494 struct audit_ifaces *afct = GLRO(dl_audit);
495 for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
497 @@ -1528,11 +1534,21 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
502 + if (fd != -1 && name != original_name && strcmp (name, original_name))
504 + /* An audit library changed what we're supposed to open,
505 + so FD no longer matches it. */
512 - /* Open the file. We always open files read-only. */
513 - int fd = __open (name, O_RDONLY | O_CLOEXEC);
515 + /* Open the file. We always open files read-only. */
516 + fd = __open (name, O_RDONLY | O_CLOEXEC);
521 @@ -1801,7 +1817,7 @@ open_path (const char *name, size_t namelen, int mode,
522 if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
523 _dl_debug_printf (" trying file=%s\n", buf);
525 - fd = open_verify (buf, fbp, loader, whatcode, mode,
526 + fd = open_verify (buf, -1, fbp, loader, whatcode, mode,
527 found_other_class, false);
528 if (this_dir->status[cnt] == unknown)
530 @@ -2041,6 +2057,20 @@ _dl_map_object (struct link_map *loader, const char *name,
531 &loader->l_runpath_dirs, &realname, &fb, loader,
532 LA_SER_RUNPATH, &found_other_class);
536 + realname = _dl_sysdep_open_object (name, namelen, &fd);
537 + if (realname != NULL)
539 + fd = open_verify (realname, fd,
540 + &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
541 + LA_SER_CONFIG, mode, &found_other_class,
550 && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
551 @@ -2086,7 +2116,7 @@ _dl_map_object (struct link_map *loader, const char *name,
555 - fd = open_verify (cached,
556 + fd = open_verify (cached, -1,
557 &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
558 LA_SER_CONFIG, mode, &found_other_class,
560 @@ -2121,7 +2151,7 @@ _dl_map_object (struct link_map *loader, const char *name,
564 - fd = open_verify (realname, &fb,
565 + fd = open_verify (realname, -1, &fb,
566 loader ?: GL(dl_ns)[nsid]._ns_loaded, 0, mode,
567 &found_other_class, true);
568 if (__glibc_unlikely (fd == -1))
569 diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
570 index 11cb44b..acf5280 100644
571 --- a/elf/dl-lookup.c
572 +++ b/elf/dl-lookup.c
573 @@ -1016,6 +1016,18 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
575 if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
577 +/* ELF_RTYPE_CLASS_XXX must match RTYPE_CLASS_XXX used by prelink with
578 + LD_TRACE_PRELINKING. */
579 +#define RTYPE_CLASS_VALID 8
580 +#define RTYPE_CLASS_PLT (8|1)
581 +#define RTYPE_CLASS_COPY (8|2)
582 +#define RTYPE_CLASS_TLS (8|4)
583 +#if ELF_RTYPE_CLASS_PLT != 0 && ELF_RTYPE_CLASS_PLT != 1
584 +# error ELF_RTYPE_CLASS_PLT must be 0 or 1!
586 +#if ELF_RTYPE_CLASS_COPY != 0 && ELF_RTYPE_CLASS_COPY != 2
587 +# error ELF_RTYPE_CLASS_COPY must be 0 or 2!
590 struct sym_val val = { NULL, NULL };
592 @@ -1071,12 +1083,17 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
596 + /* Keep only ELF_RTYPE_CLASS_PLT and ELF_RTYPE_CLASS_COPY
597 + bits since since prelink only uses them. */
598 + type_class &= ELF_RTYPE_CLASS_PLT | ELF_RTYPE_CLASS_COPY;
599 if (__glibc_unlikely (ELFW(ST_TYPE) (value->s->st_info)
602 + /* Clear the RTYPE_CLASS_VALID bit in RTYPE_CLASS_TLS. */
603 + type_class = RTYPE_CLASS_TLS & ~RTYPE_CLASS_VALID;
604 else if (__glibc_unlikely (ELFW(ST_TYPE) (value->s->st_info)
607 + /* Set the RTYPE_CLASS_VALID bit. */
608 + type_class |= RTYPE_CLASS_VALID;
612 diff --git a/elf/dl-sysdep-open.h b/elf/dl-sysdep-open.h
614 index 0000000..a63d9f5
616 +++ b/elf/dl-sysdep-open.h
618 +/* System-specific call to open a shared object by name. Stub version.
619 + Copyright (C) 2015 Free Software Foundation, Inc.
620 + This file is part of the GNU C Library.
622 + The GNU C Library is free software; you can redistribute it and/or
623 + modify it under the terms of the GNU Lesser General Public
624 + License as published by the Free Software Foundation; either
625 + version 2.1 of the License, or (at your option) any later version.
627 + The GNU C Library is distributed in the hope that it will be useful,
628 + but WITHOUT ANY WARRANTY; without even the implied warranty of
629 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
630 + Lesser General Public License for more details.
632 + You should have received a copy of the GNU Lesser General Public
633 + License along with the GNU C Library; if not, see
634 + <http://www.gnu.org/licenses/>. */
636 +#ifndef _DL_SYSDEP_OPEN_H
637 +#define _DL_SYSDEP_OPEN_H 1
642 +/* NAME is a name without slashes, as it appears in a DT_NEEDED entry
643 + or a dlopen call's argument or suchlike. NAMELEN is (strlen (NAME) + 1).
645 + Find NAME in an OS-dependent fashion, and return its "real" name.
646 + Optionally fill in *FD with a file descriptor open on that file (or
647 + else leave its initial value of -1). The return value is a new
648 + malloc'd string, which will be free'd by the caller. If NAME is
649 + resolved to an actual file that can be opened, then the return
650 + value should name that file (and if *FD was not set, then a normal
651 + __open call on that string will be made). If *FD was set by some
652 + other means than a normal open and there is no "real" name to use,
653 + then __strdup (NAME) is fine (modulo error checking). */
655 +static inline char *
656 +_dl_sysdep_open_object (const char *name, size_t namelen, int *fd)
658 + assert (*fd == -1);
662 +#endif /* dl-sysdep-open.h */
663 diff --git a/elf/rtld.c b/elf/rtld.c
664 index 69873c2..07e741c 100644
667 @@ -162,7 +162,6 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
668 ._dl_hwcap_mask = HWCAP_IMPORTANT,
670 ._dl_fpu_control = _FPU_DEFAULT,
671 - ._dl_pointer_guard = 1,
672 ._dl_pagesize = EXEC_PAGESIZE,
673 ._dl_inhibit_cache = 0,
675 @@ -709,15 +708,12 @@ security_init (void)
678 /* Set up the pointer guard as well, if necessary. */
679 - if (GLRO(dl_pointer_guard))
681 - uintptr_t pointer_chk_guard = _dl_setup_pointer_guard (_dl_random,
683 + uintptr_t pointer_chk_guard
684 + = _dl_setup_pointer_guard (_dl_random, stack_chk_guard);
685 #ifdef THREAD_SET_POINTER_GUARD
686 - THREAD_SET_POINTER_GUARD (pointer_chk_guard);
687 + THREAD_SET_POINTER_GUARD (pointer_chk_guard);
689 - __pointer_chk_guard_local = pointer_chk_guard;
691 + __pointer_chk_guard_local = pointer_chk_guard;
693 /* We do not need the _dl_random value anymore. The less
694 information we leave behind, the better, so clear the
695 @@ -2471,9 +2467,6 @@ process_envvars (enum mode *modep)
696 GLRO(dl_use_load_bias) = envline[14] == '1' ? -1 : 0;
700 - if (memcmp (envline, "POINTER_GUARD", 13) == 0)
701 - GLRO(dl_pointer_guard) = envline[14] != '0';
705 diff --git a/elf/tst-nodelete2.c b/elf/tst-nodelete2.c
707 index 0000000..388e8af
709 +++ b/elf/tst-nodelete2.c
711 +#include "../dlfcn/dlfcn.h"
714 +#include <gnu/lib-names.h>
721 + printf ("\nOpening pthread library.\n");
722 + void *pthread = dlopen (LIBPTHREAD_SO, RTLD_LAZY);
724 + /* This is a test for correct DF_1_NODELETE clearing when dlopen failure
725 + happens. We should clear DF_1_NODELETE for failed library only, because
726 + doing this for others (e.g. libpthread) might cause them to be unloaded,
727 + that may lead to some global references (e.g. __rtld_lock_unlock) to be
728 + broken. The dlopen should fail because of undefined symbols in shared
729 + library, that cause DF_1_NODELETE to be cleared. For libpthread, this
730 + flag should be set, because if not, SIGSEGV will happen in dlclose. */
731 + if (dlopen ("tst-nodelete2mod.so", RTLD_NOW) != NULL)
733 + printf ("Unique symbols test failed\n");
741 + printf ("SUCCESS\n");
746 +#define TEST_FUNCTION do_test ()
747 +#include "../test-skeleton.c"
748 diff --git a/elf/tst-nodelete2mod.c b/elf/tst-nodelete2mod.c
750 index 0000000..e88c756
752 +++ b/elf/tst-nodelete2mod.c
754 +/* Undefined symbol. */
755 +extern int not_exist (void);
759 + return not_exist ();
761 diff --git a/elf/tst-prelink.c b/elf/tst-prelink.c
763 index 0000000..ab61c4e
765 +++ b/elf/tst-prelink.c
767 +/* Test the output from the environment variable, LD_TRACE_PRELINKING,
769 + Copyright (C) 2015 Free Software Foundation, Inc.
770 + This file is part of the GNU C Library.
772 + The GNU C Library is free software; you can redistribute it and/or
773 + modify it under the terms of the GNU Lesser General Public
774 + License as published by the Free Software Foundation; either
775 + version 2.1 of the License, or (at your option) any later version.
777 + The GNU C Library is distributed in the hope that it will be useful,
778 + but WITHOUT ANY WARRANTY; without even the implied warranty of
779 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
780 + Lesser General Public License for more details.
782 + You should have received a copy of the GNU Lesser General Public
783 + License along with the GNU C Library; if not, see
784 + <http://www.gnu.org/licenses/>. */
791 + fprintf (stdout, "hello\n");
795 +#define TEST_FUNCTION do_test ()
796 +#include "../test-skeleton.c"
797 diff --git a/elf/tst-prelink.exp b/elf/tst-prelink.exp
799 index 0000000..b35b4c9
801 +++ b/elf/tst-prelink.exp
804 diff --git a/elf/tst-znodelete-zlib.cc b/elf/tst-znodelete-zlib.cc
805 deleted file mode 100644
806 index 1e8f368..0000000
807 --- a/elf/tst-znodelete-zlib.cc
810 -extern int not_exist (void);
814 - return not_exist ();
816 diff --git a/io/test-lfs.c b/io/test-lfs.c
817 index 539c2a2..b6ebae4 100644
820 @@ -144,7 +144,7 @@ test_ftello (void)
822 do_test (int argc, char *argv[])
826 struct stat64 statbuf;
828 ret = lseek64 (fd, TWO_GB+100, SEEK_SET);
829 @@ -195,6 +195,25 @@ do_test (int argc, char *argv[])
830 error (EXIT_FAILURE, 0, "stat reported size %lld instead of %lld.",
831 (long long int) statbuf.st_size, (TWO_GB + 100 + 5));
833 + fd2 = openat64 (AT_FDCWD, name, O_RDWR);
836 + if (errno == ENOSYS)
838 + /* Silently ignore this test. */
839 + error (0, 0, "openat64 is not supported");
842 + error (EXIT_FAILURE, errno, "openat64 failed to open big file");
849 + error (EXIT_FAILURE, errno, "error closing file");
855 diff --git a/locale/C-collate.c b/locale/C-collate.c
856 index d7f3c55..06dfdfa 100644
857 --- a/locale/C-collate.c
858 +++ b/locale/C-collate.c
859 @@ -144,8 +144,6 @@ const struct __locale_data _nl_C_LC_COLLATE attribute_hidden =
860 /* _NL_COLLATE_COLLSEQWC */
861 { .string = (const char *) collseqwc },
862 /* _NL_COLLATE_CODESET */
863 - { .string = _nl_C_codeset },
864 - /* _NL_COLLATE_ENCODING_TYPE */
865 - { .word = __cet_8bit }
866 + { .string = _nl_C_codeset }
869 diff --git a/locale/categories.def b/locale/categories.def
870 index 045489d..a8dda53 100644
871 --- a/locale/categories.def
872 +++ b/locale/categories.def
873 @@ -58,7 +58,6 @@ DEFINE_CATEGORY
874 DEFINE_ELEMENT (_NL_COLLATE_COLLSEQMB, "collate-collseqmb", std, wstring)
875 DEFINE_ELEMENT (_NL_COLLATE_COLLSEQWC, "collate-collseqwc", std, wstring)
876 DEFINE_ELEMENT (_NL_COLLATE_CODESET, "collate-codeset", std, string)
877 - DEFINE_ELEMENT (_NL_COLLATE_ENCODING_TYPE, "collate-encoding-type", std, word)
881 diff --git a/locale/langinfo.h b/locale/langinfo.h
882 index ffc5c7f..a565d9d 100644
883 --- a/locale/langinfo.h
884 +++ b/locale/langinfo.h
885 @@ -255,7 +255,6 @@ enum
886 _NL_COLLATE_COLLSEQMB,
887 _NL_COLLATE_COLLSEQWC,
889 - _NL_COLLATE_ENCODING_TYPE,
892 /* LC_CTYPE category: character classification.
893 diff --git a/locale/localeinfo.h b/locale/localeinfo.h
894 index bdab9fe..1d2ee00 100644
895 --- a/locale/localeinfo.h
896 +++ b/locale/localeinfo.h
897 @@ -110,14 +110,6 @@ enum coll_sort_rule
901 -/* Collation encoding type. */
902 -enum collation_encoding_type
909 /* We can map the types of the entries into a few categories. */
912 diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
913 index a39a94f..dc0fe30 100644
914 --- a/locale/programs/ld-collate.c
915 +++ b/locale/programs/ld-collate.c
917 #include "linereader.h"
919 #include "elem-hash.h"
920 -#include "../localeinfo.h"
922 /* Uncomment the following line in the production version. */
923 /* #define NDEBUG 1 */
924 @@ -2131,8 +2130,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
925 /* The words have to be handled specially. */
926 if (idx == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_HASH_SIZEMB))
927 add_locale_uint32 (&file, 0);
928 - else if (idx == _NL_ITEM_INDEX (_NL_COLLATE_ENCODING_TYPE))
929 - add_locale_uint32 (&file, __cet_other);
931 add_locale_empty (&file);
933 @@ -2496,12 +2493,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
934 add_locale_raw_data (&file, collate->mbseqorder, 256);
935 add_locale_collseq_table (&file, &collate->wcseqorder);
936 add_locale_string (&file, charmap->code_set_name);
937 - if (strcmp (charmap->code_set_name, "UTF-8") == 0)
938 - add_locale_uint32 (&file, __cet_utf8);
939 - else if (charmap->mb_cur_max == 1)
940 - add_locale_uint32 (&file, __cet_8bit);
942 - add_locale_uint32 (&file, __cet_other);
943 write_locale_data (output_path, LC_COLLATE, "LC_COLLATE", &file);
945 obstack_free (&weightpool, NULL);
946 diff --git a/misc/Makefile b/misc/Makefile
947 index aecb0da..2f5edf6 100644
950 @@ -76,7 +76,8 @@ install-lib := libg.a
951 gpl2lgpl := error.c error.h
953 tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \
954 - tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1
955 + tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1 \
956 + tst-mntent-blank-corrupt tst-mntent-blank-passno
957 ifeq ($(run-built-tests),yes)
958 tests-special += $(objpfx)tst-error1-mem.out
960 diff --git a/misc/mntent_r.c b/misc/mntent_r.c
961 index 6159873..4f26998 100644
962 --- a/misc/mntent_r.c
963 +++ b/misc/mntent_r.c
964 @@ -136,7 +136,9 @@ __getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz)
965 end_ptr = strchr (buffer, '\n');
966 if (end_ptr != NULL) /* chop newline */
968 - while (end_ptr[-1] == ' ' || end_ptr[-1] == '\t')
969 + /* Do not walk past the start of buffer if it's all whitespace. */
970 + while (end_ptr != buffer
971 + && (end_ptr[-1] == ' ' || end_ptr[-1] == '\t'))
975 diff --git a/misc/regexp.h b/misc/regexp.h
976 index 3460989..42394f7 100644
983 -/* The contents of this header file were standardized in the
984 - Single Unix Specification, Version 2 (1997) but marked as
985 - LEGACY; new applications were already being encouraged to
986 - use <regex.h> instead. POSIX.1-2001 removed this header.
987 +/* The contents of this header file were originally standardized in
988 + the Single Unix Specification, Issue 3 (1992). In Issue 4 (1994)
989 + the header was marked as TO BE WITHDRAWN, and new applications
990 + were encouraged to use <regex.h> instead. It was officially
991 + withdrawn from the standard in Issue 6 (aka POSIX.1-2001).
993 This header is provided only for backward compatibility.
994 It will be removed in the next release of the GNU C Library.
995 diff --git a/misc/sys/param.h b/misc/sys/param.h
996 index 62b7ed2..1908b93 100644
997 --- a/misc/sys/param.h
998 +++ b/misc/sys/param.h
1000 #if !defined NOFILE && defined OPEN_MAX
1001 # define NOFILE OPEN_MAX
1003 +#if !defined MAXHOSTNAMELEN && defined HOST_NAME_MAX
1004 +# define MAXHOSTNAMELEN HOST_NAME_MAX
1008 # define NCARGS ARG_MAX
1009 diff --git a/misc/tst-mntent-blank-corrupt.c b/misc/tst-mntent-blank-corrupt.c
1010 new file mode 100644
1011 index 0000000..92266a3
1013 +++ b/misc/tst-mntent-blank-corrupt.c
1015 +/* Make sure blank lines does not cause memory corruption BZ #18887.
1017 + Copyright (C) 2009-2015 Free Software Foundation, Inc.
1018 + This file is part of the GNU C Library.
1020 + The GNU C Library is free software; you can redistribute it and/or
1021 + modify it under the terms of the GNU Lesser General Public
1022 + License as published by the Free Software Foundation; either
1023 + version 2.1 of the License, or (at your option) any later version.
1025 + The GNU C Library is distributed in the hope that it will be useful,
1026 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1027 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1028 + Lesser General Public License for more details.
1030 + You should have received a copy of the GNU Lesser General Public
1031 + License along with the GNU C Library; if not, see
1032 + <http://www.gnu.org/licenses/>. */
1034 +#include <mntent.h>
1036 +#include <string.h>
1038 +/* Make sure blank lines don't trigger memory corruption. This doesn't happen
1039 + for all targets though, so it's a best effort test BZ #18887. */
1046 + fputs ("\n \n/foo\\040dir /bar\\040dir auto bind \t \n", fp);
1049 + /* The corruption happens here ... */
1051 + /* ... but trigers here. */
1054 + /* If the test failed, we would crash, and not hit this point. */
1058 +#define TEST_FUNCTION do_test ()
1059 +#include "../test-skeleton.c"
1060 diff --git a/misc/tst-mntent-blank-passno.c b/misc/tst-mntent-blank-passno.c
1061 new file mode 100644
1062 index 0000000..fc04291
1064 +++ b/misc/tst-mntent-blank-passno.c
1066 +/* Make sure trailing whitespace is handled properly BZ #17273.
1068 + Copyright (C) 2009-2015 Free Software Foundation, Inc.
1069 + This file is part of the GNU C Library.
1071 + The GNU C Library is free software; you can redistribute it and/or
1072 + modify it under the terms of the GNU Lesser General Public
1073 + License as published by the Free Software Foundation; either
1074 + version 2.1 of the License, or (at your option) any later version.
1076 + The GNU C Library is distributed in the hope that it will be useful,
1077 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1078 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1079 + Lesser General Public License for more details.
1081 + You should have received a copy of the GNU Lesser General Public
1082 + License along with the GNU C Library; if not, see
1083 + <http://www.gnu.org/licenses/>. */
1085 +#include <mntent.h>
1087 +#include <string.h>
1089 +/* Check entries to make sure trailing whitespace is ignored and we return the
1090 + correct passno value BZ #17273. */
1096 + struct mntent *mnt;
1099 + fputs ("/foo\\040dir /bar\\040dir auto bind \t \n", fp);
1102 + mnt = getmntent (fp);
1103 + if (strcmp (mnt->mnt_fsname, "/foo dir") != 0
1104 + || strcmp (mnt->mnt_dir, "/bar dir") != 0
1105 + || strcmp (mnt->mnt_type, "auto") != 0
1106 + || strcmp (mnt->mnt_opts, "bind") != 0
1107 + || mnt->mnt_freq != 0
1108 + || mnt->mnt_passno != 0)
1110 + puts ("Error while reading entry with trailing whitespaces");
1117 +#define TEST_FUNCTION do_test ()
1118 +#include "../test-skeleton.c"
1119 diff --git a/misc/tst-mntent.c b/misc/tst-mntent.c
1120 index 876c89f..820b354 100644
1121 --- a/misc/tst-mntent.c
1122 +++ b/misc/tst-mntent.c
1123 @@ -73,26 +73,6 @@ main (int argc, char *argv[])
1124 puts ("Error while reading written entry back in");
1128 - /* Part III: Entry with whitespaces at the end of a line. */
1131 - fputs ("/foo\\040dir /bar\\040dir auto bind \t \n", fp);
1135 - mnt = getmntent (fp);
1137 - if (strcmp (mnt->mnt_fsname, "/foo dir") != 0
1138 - || strcmp (mnt->mnt_dir, "/bar dir") != 0
1139 - || strcmp (mnt->mnt_type, "auto") != 0
1140 - || strcmp (mnt->mnt_opts, "bind") != 0
1141 - || mnt->mnt_freq != 0
1142 - || mnt->mnt_passno != 0)
1144 - puts ("Error while reading entry with trailing whitespaces");
1150 diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl
1151 index cac1562..79b2b3e 100755
1152 --- a/scripts/test-installation.pl
1153 +++ b/scripts/test-installation.pl
1154 @@ -80,16 +80,25 @@ arglist: while (@ARGV) {
1155 # We expect none or one argument.
1157 $soversions="soversions.mk";
1158 + $config="config.make";
1159 } elsif ($#ARGV == 0) {
1161 $soversions = "$ARGV[0]/soversions.mk";
1162 + $config = "$ARGV[0]/config.make";
1164 - $soversions = $ARGV[0];
1165 + $soversions = $dir = $ARGV[0];
1166 + $dir =~ s!/?[^/]*/*$!!;
1167 + $config = $dir . "/config.make";
1170 die "Wrong number of arguments.";
1173 +if (system ("grep -q \"build-mathvec = yes\" $config") == 0) {
1174 + $build_mathvec = 1;
1176 + $build_mathvec = 0;
1179 # Read names and versions of all shared libraries that are part of
1181 @@ -111,6 +120,8 @@ while (<SOVERSIONS>) {
1182 # - libthread_db since it contains unresolved references
1183 # - it's just a test NSS module
1184 # - We don't provide the libgcc so we don't test it
1185 + # - libmvec if it wasn't built
1186 + next if ($build_mathvec == 0 && $name eq "mvec");
1187 if ($name ne "nss_ldap" && $name ne "db1"
1188 && !($name =~/^nss1_/) && $name ne "thread_db"
1189 && $name ne "nss_test1" && $name ne "libgcc_s") {
1190 diff --git a/stdlib/cxa_thread_atexit_impl.c b/stdlib/cxa_thread_atexit_impl.c
1191 index 2d5d56a..5717f09 100644
1192 --- a/stdlib/cxa_thread_atexit_impl.c
1193 +++ b/stdlib/cxa_thread_atexit_impl.c
1194 @@ -98,6 +98,10 @@ static __thread struct link_map *lm_cache;
1196 __cxa_thread_atexit_impl (dtor_func func, void *obj, void *dso_symbol)
1199 + PTR_MANGLE (func);
1203 struct dtor_list *new = calloc (1, sizeof (struct dtor_list));
1205 @@ -142,9 +146,13 @@ __call_tls_dtors (void)
1206 while (tls_dtor_list)
1208 struct dtor_list *cur = tls_dtor_list;
1209 + dtor_func func = cur->func;
1210 +#ifdef PTR_DEMANGLE
1211 + PTR_DEMANGLE (func);
1214 tls_dtor_list = tls_dtor_list->next;
1215 - cur->func (cur->obj);
1218 /* Ensure that the MAP dereference happens before
1219 l_tls_dtor_count decrement. That way, we protect this access from a
1220 diff --git a/string/Makefile b/string/Makefile
1221 index 8424a61..ebe9354 100644
1222 --- a/string/Makefile
1223 +++ b/string/Makefile
1224 @@ -54,7 +54,7 @@ tests := tester inl-tester noinl-tester testcopy test-ffs \
1225 tst-strtok tst-strxfrm bug-strcoll1 tst-strfry \
1226 bug-strtok1 $(addprefix test-,$(strop-tests)) \
1227 bug-envz1 tst-strxfrm2 tst-endian tst-svc2 \
1229 + tst-strtok_r bug-strcoll2
1231 xtests = tst-strcoll-overflow
1233 @@ -75,4 +75,17 @@ ifeq ($(run-built-tests),yes)
1234 $(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
1238 +LOCALES := de_DE.UTF-8 en_US.ISO-8859-1 en_US.UTF-8 \
1239 + tr_TR.ISO-8859-9 tr_TR.UTF-8 cs_CZ.UTF-8 \
1241 +include ../gen-locales.mk
1243 +$(objpfx)test-strcasecmp.out: $(gen-locales)
1244 +$(objpfx)test-strncasecmp.out: $(gen-locales)
1245 +$(objpfx)tst-strxfrm.out: $(gen-locales)
1246 +$(objpfx)tst-strxfrm2.out: $(gen-locales)
1247 +# bug-strcoll2 needs cs_CZ.UTF-8 and da_DK.ISO-8859-1.
1248 +$(objpfx)bug-strcoll2.out: $(gen-locales)
1251 diff --git a/string/bug-strcoll2.c b/string/bug-strcoll2.c
1252 new file mode 100644
1253 index 0000000..72a9ff2
1255 +++ b/string/bug-strcoll2.c
1257 +/* Bug 18589: sort-test.sh fails at random.
1258 + Copyright (C) 2015 Free Software Foundation, Inc.
1259 + This file is part of the GNU C Library.
1261 + The GNU C Library is free software; you can redistribute it and/or
1262 + modify it under the terms of the GNU Lesser General Public
1263 + License as published by the Free Software Foundation; either
1264 + version 2.1 of the License, or (at your option) any later version.
1266 + The GNU C Library is distributed in the hope that it will be useful,
1267 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1268 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1269 + Lesser General Public License for more details.
1271 + You should have received a copy of the GNU Lesser General Public
1272 + License along with the GNU C Library; if not, see
1273 + <http://www.gnu.org/licenses/>. */
1276 +#include <string.h>
1277 +#include <locale.h>
1279 +/* An incorrect strcoll optimization resulted in incorrect
1280 + results from strcoll for cs_CZ and da_DK. */
1285 + const char t1[] = "config";
1286 + const char t2[] = "choose";
1287 + if (setlocale (LC_ALL, "cs_CZ.UTF-8") == NULL)
1289 + perror ("setlocale");
1292 + /* In Czech the digraph ch sorts after c, therefore we expect
1293 + config to sort before choose. */
1294 + int a = strcoll (t1, t2);
1295 + int b = strcoll (t2, t1);
1296 + printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, a);
1297 + printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, b);
1298 + if (a < 0 && b > 0)
1300 + puts ("PASS: config < choose");
1305 + puts ("FAIL: Wrong sorting in cs_CZ.UTF-8.");
1313 + const char t1[] = "AS";
1314 + const char t2[] = "AA";
1315 + if (setlocale (LC_ALL, "da_DK.ISO-8859-1") == NULL)
1317 + perror ("setlocale");
1320 + /* AA should be treated as the last letter of the Danish alphabet,
1321 + hence sorting after AS. */
1322 + int a = strcoll (t1, t2);
1323 + int b = strcoll (t2, t1);
1324 + printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, a);
1325 + printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, b);
1326 + if (a < 0 && b > 0)
1328 + puts ("PASS: AS < AA");
1333 + puts ("FAIL: Wrong sorting in da_DK.ISO-8859-1");
1342 + err |= test_cs_CZ ();
1343 + err |= test_da_DK ();
1347 +#define TEST_FUNCTION do_test ()
1348 +#include "../test-skeleton.c"
1349 diff --git a/string/strcoll_l.c b/string/strcoll_l.c
1350 index 8f1225f..35bc0e4 100644
1351 --- a/string/strcoll_l.c
1352 +++ b/string/strcoll_l.c
1354 # define STRING_TYPE char
1355 # define USTRING_TYPE unsigned char
1356 # define STRCOLL __strcoll_l
1357 -# define STRDIFF __strdiff
1358 # define STRCMP strcmp
1359 # define WEIGHT_H "../locale/weight.h"
1362 #include "../locale/localeinfo.h"
1365 -#define MASK_UTF8_7BIT (1 << 7)
1366 -#define MASK_UTF8_START (3 << 6)
1369 -STRDIFF (const STRING_TYPE *s, const STRING_TYPE *t)
1373 - for (n = 0; *s != '\0' && *s++ == *t++; ++n)
1379 /* Track status while looking for sequences in a string. */
1382 @@ -269,29 +254,9 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l)
1383 const USTRING_TYPE *extra;
1384 const int32_t *indirect;
1386 - /* In case there is no locale specific sort order (C / POSIX). */
1388 return STRCMP (s1, s2);
1390 - /* Fast forward to the position of the first difference. Needs to be
1391 - encoding aware as the byte-by-byte comparison can stop in the middle
1392 - of a char sequence for multibyte encodings like UTF-8. */
1393 - uint_fast32_t encoding =
1394 - current->values[_NL_ITEM_INDEX (_NL_COLLATE_ENCODING_TYPE)].word;
1395 - if (encoding != __cet_other)
1397 - size_t diff = STRDIFF (s1, s2);
1400 - if (encoding == __cet_utf8 && (*(s1 + diff) & MASK_UTF8_7BIT) != 0)
1403 - while (diff > 0 && (*(s1 + diff) & MASK_UTF8_START) != MASK_UTF8_START);
1409 /* Catch empty strings. */
1410 if (__glibc_unlikely (*s1 == '\0') || __glibc_unlikely (*s2 == '\0'))
1411 return (*s1 != '\0') - (*s2 != '\0');
1412 @@ -358,8 +323,7 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l)
1413 byte-level comparison to ensure that we don't waste time
1414 going through multiple passes for totally equal strings
1415 before proceeding to subsequent passes. */
1416 - if (pass == 0 && encoding == __cet_other &&
1417 - STRCMP (s1, s2) == 0)
1418 + if (pass == 0 && STRCMP (s1, s2) == 0)
1422 diff --git a/string/tst-strxfrm2.c b/string/tst-strxfrm2.c
1423 index d5a1115..bea5aa2 100644
1424 --- a/string/tst-strxfrm2.c
1425 +++ b/string/tst-strxfrm2.c
1430 + static const char test_locale[] = "de_DE.UTF-8";
1435 @@ -38,9 +40,9 @@ do_test (void)
1439 - if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
1440 + if (setlocale (LC_ALL, test_locale) == NULL)
1442 - puts ("setlocale failed");
1443 + printf ("cannot set locale \"%s\"\n", test_locale);
1447 diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
1448 index 7a0fe8d..78e3a97 100644
1449 --- a/sysdeps/generic/ldsodefs.h
1450 +++ b/sysdeps/generic/ldsodefs.h
1451 @@ -592,9 +592,6 @@ struct rtld_global_ro
1452 /* List of auditing interfaces. */
1453 struct audit_ifaces *_dl_audit;
1454 unsigned int _dl_naudit;
1456 - /* 0 if internal pointer values should not be guarded, 1 if they should. */
1457 - EXTERN int _dl_pointer_guard;
1459 # define __rtld_global_attribute__
1461 diff --git a/sysdeps/hppa/dl-symaddr.c b/sysdeps/hppa/dl-symaddr.c
1462 index b707c19..89d8baf 100644
1463 --- a/sysdeps/hppa/dl-symaddr.c
1464 +++ b/sysdeps/hppa/dl-symaddr.c
1465 @@ -33,3 +33,4 @@ _dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref)
1467 return (void *) value;
1469 +rtld_hidden_def (_dl_symbol_address)
1470 diff --git a/sysdeps/nacl/Makefile b/sysdeps/nacl/Makefile
1471 index 6749a44..1748886 100644
1472 --- a/sysdeps/nacl/Makefile
1473 +++ b/sysdeps/nacl/Makefile
1474 @@ -132,4 +132,13 @@ ifeq ($(subdir),misc)
1475 # sysdeps/.../linux/ directories, but it's still a sysdeps decision to
1477 sysdep_headers += bits/mman-linux.h
1479 +# This defeats sysdeps/gnu/Makefile's addition of sys/mtio.h, which
1480 +# we do not want. This is a total kludge, but it seems no worse for
1481 +# now than making the sysdeps/gnu/Makefile code conditional on a
1482 +# variable we set here. If some sysdeps/.../Makefile that is later
1483 +# in the list than sysdeps/gnu needed to add to sysdep_headers, this
1484 +# would break it. But sysdeps/gnu is close to last in the list and
1485 +# this coming up seems unlikely.
1486 +override sysdep_headers := $(sysdep_headers)
1488 diff --git a/sysdeps/nacl/dl-map-segments.h b/sysdeps/nacl/dl-map-segments.h
1489 index f305da3..f2d5d84 100644
1490 --- a/sysdeps/nacl/dl-map-segments.h
1491 +++ b/sysdeps/nacl/dl-map-segments.h
1492 @@ -53,7 +53,7 @@ _dl_map_segments (struct link_map *l, int fd,
1493 const size_t maplength, bool has_holes,
1494 struct link_map *loader)
1496 - if (__builtin_expect (type, ET_DYN) == ET_DYN)
1497 + if (__glibc_likely (type == ET_DYN))
1499 /* This is a position-independent shared object. Let the system
1500 choose where to place it.
1501 @@ -165,6 +165,32 @@ _dl_map_segments (struct link_map *l, int fd,
1503 return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
1505 + if (__glibc_unlikely (type != ET_DYN))
1507 + /* A successful PROT_EXEC mmap would have implicitly
1508 + updated the bookkeeping so that a future
1509 + allocate_code_data call would know that this range
1510 + of the address space is already occupied. That
1511 + doesn't happen implicitly with dyncode_create, so
1512 + it's necessary to do an explicit call to update the
1514 + uintptr_t allocated_address;
1515 + error = __nacl_irt_code_data_alloc.allocate_code_data
1516 + (l->l_addr + c->mapstart, len, 0, 0, &allocated_address);
1517 + if (__glibc_unlikely (error))
1520 + return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
1522 + if (__glibc_unlikely
1523 + (allocated_address != l->l_addr + c->mapstart))
1525 + /* This is not a very helpful error for this case,
1526 + but there isn't really anything better to use. */
1528 + return DL_MAP_SEGMENTS_ERROR_MAP_SEGMENT;
1534 diff --git a/sysdeps/nacl/dl-sysdep-open.h b/sysdeps/nacl/dl-sysdep-open.h
1535 new file mode 100644
1536 index 0000000..38b0f9e
1538 +++ b/sysdeps/nacl/dl-sysdep-open.h
1540 +/* System-specific call to open a shared object by name. NaCl version.
1541 + Copyright (C) 2015 Free Software Foundation, Inc.
1542 + This file is part of the GNU C Library.
1544 + The GNU C Library is free software; you can redistribute it and/or
1545 + modify it under the terms of the GNU Lesser General Public
1546 + License as published by the Free Software Foundation; either
1547 + version 2.1 of the License, or (at your option) any later version.
1549 + The GNU C Library is distributed in the hope that it will be useful,
1550 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1551 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1552 + Lesser General Public License for more details.
1554 + You should have received a copy of the GNU Lesser General Public
1555 + License along with the GNU C Library; if not, see
1556 + <http://www.gnu.org/licenses/>. */
1558 +#ifndef _DL_SYSDEP_OPEN_H
1559 +#define _DL_SYSDEP_OPEN_H 1
1561 +#include <stddef.h>
1563 +/* NAME is a name without slashes, as it appears in a DT_NEEDED entry
1564 + or a dlopen call's argument or suchlike. NAMELEN is (strlen (NAME) + 1).
1566 + Find NAME in an OS-dependent fashion, and return its "real" name.
1567 + Optionally fill in *FD with a file descriptor open on that file (or
1568 + else leave its initial value of -1). The return value is a new
1569 + malloc'd string, which will be free'd by the caller. If NAME is
1570 + resolved to an actual file that can be opened, then the return
1571 + value should name that file (and if *FD was not set, then a normal
1572 + __open call on that string will be made). If *FD was set by some
1573 + other means than a normal open and there is no "real" name to use,
1574 + then __strdup (NAME) is fine (modulo error checking). */
1576 +extern char *_dl_sysdep_open_object (const char *name, size_t namelen, int *fd)
1577 + internal_function attribute_hidden;
1579 +#endif /* dl-sysdep-open.h */
1580 diff --git a/sysdeps/nacl/dl-sysdep.c b/sysdeps/nacl/dl-sysdep.c
1581 index 3e902c2..3a04aa1 100644
1582 --- a/sysdeps/nacl/dl-sysdep.c
1583 +++ b/sysdeps/nacl/dl-sysdep.c
1584 @@ -87,3 +87,26 @@ _dl_start_user (void (*user_entry) (uint32_t info[]), uint32_t info[])
1587 #include <elf/dl-sysdep.c>
1589 +#include <dl-sysdep-open.h>
1590 +#include <nacl-interfaces.h>
1591 +#include <assert.h>
1592 +#include <string.h>
1593 +#include <unistd.h>
1597 +_dl_sysdep_open_object (const char *name, size_t namelen, int *fd)
1599 + int error = __nacl_irt_resource_open.open_resource (name, fd);
1602 + assert (*fd != -1);
1603 + char *realname = __strdup (name);
1604 + if (__glibc_unlikely (realname == NULL))
1611 diff --git a/sysdeps/nacl/nacl-interface-list.h b/sysdeps/nacl/nacl-interface-list.h
1612 index cb33751..c68faed 100644
1613 --- a/sysdeps/nacl/nacl-interface-list.h
1614 +++ b/sysdeps/nacl/nacl-interface-list.h
1615 @@ -28,7 +28,7 @@ NACL_MANDATORY_INTERFACE (rtld,
1616 NACL_IRT_FUTEX_v0_1, nacl_irt_futex)
1617 NACL_MANDATORY_INTERFACE (rtld,
1618 NACL_IRT_TLS_v0_1, nacl_irt_tls)
1619 -NACL_MANDATORY_INTERFACE (libc,
1620 +NACL_MANDATORY_INTERFACE (rtld,
1621 NACL_IRT_RESOURCE_OPEN_v0_1, nacl_irt_resource_open)
1622 NACL_MANDATORY_INTERFACE (rtld,
1623 NACL_IRT_CODE_DATA_ALLOC_v0_1,
1624 diff --git a/sysdeps/nacl/start.c b/sysdeps/nacl/start.c
1625 index a4b6dd3..8e8bc1a 100644
1626 --- a/sysdeps/nacl/start.c
1627 +++ b/sysdeps/nacl/start.c
1629 /* The application defines this, of course. */
1630 extern int main (int argc, char **argv, char **envp);
1632 +/* But maybe it defines this too, in which case it takes precedence. */
1633 +extern int __nacl_main (int argc, char **argv, char **envp)
1634 + __attribute__ ((weak));
1636 /* These are defined in libc. */
1637 extern int __libc_csu_init (int argc, char **argv, char **envp);
1638 extern void __libc_csu_fini (void);
1639 @@ -59,7 +63,7 @@ _start (uint32_t info[])
1641 /* The generic code actually assumes that envp follows argv. */
1643 - __libc_start_main (&main,
1644 + __libc_start_main (&__nacl_main ?: &main,
1645 nacl_startup_argc (info),
1646 nacl_startup_argv (info),
1647 nacl_startup_auxv (info),
1648 diff --git a/sysdeps/posix/opendir.c b/sysdeps/posix/opendir.c
1649 index 6509f5c..9edf056 100644
1650 --- a/sysdeps/posix/opendir.c
1651 +++ b/sysdeps/posix/opendir.c
1652 @@ -105,7 +105,7 @@ need_isdir_precheck (void)
1653 tryopen_o_directory ();
1655 /* We can skip the expensive `stat' call if O_DIRECTORY works. */
1656 - return o_directory_works > 0;
1657 + return o_directory_works < 0;
1661 diff --git a/sysdeps/powerpc/nptl/elide.h b/sysdeps/powerpc/nptl/elide.h
1662 index 389f5a5..12171f4 100644
1663 --- a/sysdeps/powerpc/nptl/elide.h
1664 +++ b/sysdeps/powerpc/nptl/elide.h
1667 # include <elision-conf.h>
1669 -/* Returns true if the lock defined by is_lock_free as elided.
1670 - ADAPT_COUNT is a pointer to per-lock state variable. */
1672 +/* Get the new value of adapt_count according to the elision
1673 + configurations. Returns true if the system should retry again or false
1676 -__elide_lock (uint8_t *adapt_count, int is_lock_free)
1677 +__get_new_count (uint8_t *adapt_count)
1679 - if (*adapt_count > 0)
1680 + /* A persistent failure indicates that a retry will probably
1681 + result in another failure. Use normal locking now and
1682 + for the next couple of calls. */
1683 + if (_TEXASRU_FAILURE_PERSISTENT (__builtin_get_texasru ()))
1686 + if (__elision_aconf.skip_lock_internal_abort > 0)
1687 + *adapt_count = __elision_aconf.skip_lock_internal_abort;
1691 - for (int i = __elision_aconf.try_tbegin; i > 0; i--)
1693 - if (__builtin_tbegin (0))
1697 - /* Lock was busy. */
1698 - __builtin_tabort (_ABORT_LOCK_BUSY);
1702 - /* A persistent failure indicates that a retry will probably
1703 - result in another failure. Use normal locking now and
1704 - for the next couple of calls. */
1705 - if (_TEXASRU_FAILURE_PERSISTENT (__builtin_get_texasru ()))
1707 - if (__elision_aconf.skip_lock_internal_abort > 0)
1708 - *adapt_count = __elision_aconf.skip_lock_internal_abort;
1711 - /* Same logic as above, but for a number of temporary failures in a
1713 - else if (__elision_aconf.skip_lock_out_of_tbegin_retries > 0
1714 - && __elision_aconf.try_tbegin > 0)
1715 - *adapt_count = __elision_aconf.skip_lock_out_of_tbegin_retries;
1720 + /* Same logic as above, but for a number of temporary failures in a
1722 + else if (__elision_aconf.skip_lock_out_of_tbegin_retries > 0
1723 + && __elision_aconf.try_tbegin > 0)
1724 + *adapt_count = __elision_aconf.skip_lock_out_of_tbegin_retries;
1728 -# define ELIDE_LOCK(adapt_count, is_lock_free) \
1729 - __elide_lock (&(adapt_count), is_lock_free)
1733 -__elide_trylock (uint8_t *adapt_count, int is_lock_free, int write)
1735 - if (__elision_aconf.try_tbegin > 0)
1738 - __builtin_tabort (_ABORT_NESTED_TRYLOCK);
1739 - return __elide_lock (adapt_count, is_lock_free);
1743 +/* CONCURRENCY NOTES:
1745 + The evaluation of the macro expression is_lock_free encompasses one or
1746 + more loads from memory locations that are concurrently modified by other
1747 + threads. For lock elision to work, this evaluation and the rest of the
1748 + critical section protected by the lock must be atomic because an
1749 + execution with lock elision must be equivalent to an execution in which
1750 + the lock would have been actually acquired and released. Therefore, we
1751 + evaluate is_lock_free inside of the transaction that represents the
1752 + critical section for which we want to use lock elision, which ensures
1753 + the atomicity that we require. */
1755 +/* Returns 0 if the lock defined by is_lock_free was elided.
1756 + ADAPT_COUNT is a per-lock state variable. */
1757 +# define ELIDE_LOCK(adapt_count, is_lock_free) \
1760 + if (adapt_count > 0) \
1761 + (adapt_count)--; \
1763 + for (int i = __elision_aconf.try_tbegin; i > 0; i--) \
1765 + if (__builtin_tbegin (0)) \
1767 + if (is_lock_free) \
1772 + __builtin_tabort (_ABORT_LOCK_BUSY); \
1775 + if (!__get_new_count(&adapt_count)) \
1781 # define ELIDE_TRYLOCK(adapt_count, is_lock_free, write) \
1782 - __elide_trylock (&(adapt_count), is_lock_free, write)
1785 + if (__elision_aconf.try_tbegin > 0) \
1788 + __builtin_tabort (_ABORT_NESTED_TRYLOCK); \
1789 + ret = ELIDE_LOCK (adapt_count, is_lock_free); \
1796 diff --git a/sysdeps/sparc/sparc32/sem_open.c b/sysdeps/sparc/sparc32/sem_open.c
1797 index 16cb9ad..59df2d7 100644
1798 --- a/sysdeps/sparc/sparc32/sem_open.c
1799 +++ b/sysdeps/sparc/sparc32/sem_open.c
1801 #include <sys/mman.h>
1802 #include <sys/stat.h>
1803 #include "semaphoreP.h"
1804 +#include <futex-internal.h>
1805 #include <shm-directory.h>
1808 diff --git a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
1809 index abde83e..6e73504 100644
1810 --- a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
1811 +++ b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
1812 @@ -56,42 +56,41 @@ typedef uintmax_t uatomic_max_t;
1814 #define _LWS_CAS "0"
1815 /* Note r31 is the link register. */
1816 -#define _LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory"
1817 +#define _LWS_CLOBBER "r1", "r23", "r22", "r20", "r31", "memory"
1818 /* String constant for -EAGAIN. */
1819 #define _ASM_EAGAIN "-11"
1820 /* String constant for -EDEADLOCK. */
1821 #define _ASM_EDEADLOCK "-45"
1823 #if __ASSUME_LWS_CAS
1824 -/* The only basic operation needed is compare and exchange. */
1825 +/* The only basic operation needed is compare and exchange. The mem
1826 + pointer must be word aligned. */
1827 # define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
1829 - volatile int lws_errno; \
1830 - __typeof__ (*mem) lws_ret; \
1832 + register long lws_errno asm("r21"); \
1833 + register unsigned long lws_ret asm("r28"); \
1834 + register unsigned long lws_mem asm("r26") = (unsigned long)(mem); \
1835 + register unsigned long lws_old asm("r25") = (unsigned long)(oldval);\
1836 + register unsigned long lws_new asm("r24") = (unsigned long)(newval);\
1837 + __asm__ __volatile__( \
1839 - "copy %2, %%r26 \n\t" \
1840 - "copy %3, %%r25 \n\t" \
1841 - "copy %4, %%r24 \n\t" \
1842 "ble " _LWS "(%%sr2, %%r0) \n\t" \
1843 "ldi " _LWS_CAS ", %%r20 \n\t" \
1844 - "ldi " _ASM_EAGAIN ", %%r24 \n\t" \
1845 - "cmpb,=,n %%r24, %%r21, 0b \n\t" \
1846 + "ldi " _ASM_EAGAIN ", %%r20 \n\t" \
1847 + "cmpb,=,n %%r20, %%r21, 0b \n\t" \
1849 - "ldi " _ASM_EDEADLOCK ", %%r25 \n\t" \
1850 - "cmpb,=,n %%r25, %%r21, 0b \n\t" \
1851 + "ldi " _ASM_EDEADLOCK ", %%r20 \n\t" \
1852 + "cmpb,=,n %%r20, %%r21, 0b \n\t" \
1854 - "stw %%r28, %0 \n\t" \
1855 - "stw %%r21, %1 \n\t" \
1856 - : "=m" (lws_ret), "=m" (lws_errno) \
1857 - : "r" (mem), "r" (oldval), "r" (newval) \
1858 + : "=r" (lws_ret), "=r" (lws_errno) \
1859 + : "r" (lws_mem), "r" (lws_old), "r" (lws_new) \
1863 - if(lws_errno == -EFAULT || lws_errno == -ENOSYS) \
1864 + if (lws_errno == -EFAULT || lws_errno == -ENOSYS) \
1865 ABORT_INSTRUCTION; \
1868 + (__typeof (oldval)) lws_ret; \
1871 # define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
1872 diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.h b/sysdeps/unix/sysv/linux/microblaze/sysdep.h
1873 index 83c0340..9d5c542 100644
1874 --- a/sysdeps/unix/sysv/linux/microblaze/sysdep.h
1875 +++ b/sysdeps/unix/sysv/linux/microblaze/sysdep.h
1877 License along with the GNU C Library; if not, see
1878 <http://www.gnu.org/licenses/>. */
1880 +#ifndef _LINUX_MICROBLAZE_SYSDEP_H
1881 +#define _LINUX_MICROBLAZE_SYSDEP_H 1
1883 +#include <sysdeps/unix/sysdep.h>
1884 #include <sysdeps/microblaze/sysdep.h>
1885 -#include <sys/syscall.h>
1887 /* Defines RTLD_PRIVATE_ERRNO. */
1888 #include <dl-sysdep.h>
1889 @@ -305,3 +308,5 @@ SYSCALL_ERROR_LABEL_DCL: \
1890 # define PTR_DEMANGLE(var) (void) (var)
1892 #endif /* not __ASSEMBLER__ */
1894 +#endif /* _LINUX_MICROBLAZE_SYSDEP_H */
1895 diff --git a/sysdeps/unix/sysv/linux/openat.c b/sysdeps/unix/sysv/linux/openat.c
1896 index 6777123..ad8e31d 100644
1897 --- a/sysdeps/unix/sysv/linux/openat.c
1898 +++ b/sysdeps/unix/sysv/linux/openat.c
1899 @@ -68,6 +68,11 @@ __OPENAT (int fd, const char *file, int oflag, ...)
1903 + /* We have to add the O_LARGEFILE flag for openat64. */
1905 + oflag |= MORE_OFLAGS;
1908 return SYSCALL_CANCEL (openat, fd, file, oflag, mode);
1910 libc_hidden_def (__OPENAT)
1911 diff --git a/wcsmbs/wcscoll_l.c b/wcsmbs/wcscoll_l.c
1912 index 6d9384a..87f240d 100644
1913 --- a/wcsmbs/wcscoll_l.c
1914 +++ b/wcsmbs/wcscoll_l.c
1916 #define STRING_TYPE wchar_t
1917 #define USTRING_TYPE wint_t
1918 #define STRCOLL __wcscoll_l
1919 -#define STRDIFF __wcsdiff
1920 #define STRCMP __wcscmp
1921 #define WEIGHT_H "../locale/weightwc.h"