]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blob - glibc/patches/glibc-fedora.patch
glibc: Update to 2.15.
[people/arne_f/ipfire-3.x.git] / glibc / patches / glibc-fedora.patch
1 diff -Nrup a/ChangeLog b/ChangeLog
2 --- a/ChangeLog 2012-01-01 05:16:32.000000000 -0700
3 +++ b/ChangeLog 2012-01-01 20:41:26.621439845 -0700
4 @@ -2542,6 +2542,11 @@
5
6 * sysdeps/mach/hurd/sys/param.h (DEV_BSIZE): New macro.
7
8 +2011-09-02 Andreas Schwab <schwab@redhat.com>
9 +
10 + * nscd/selinux.c (avc_create_thread): Set PR_SET_KEEPCAPS before
11 + spawning AVC thread.
12 +
13 2011-09-08 Andreas Schwab <schwab@redhat.com>
14
15 * elf/dl-load.c (lose): Check for non-null L.
16 @@ -2804,6 +2809,11 @@
17 * sysdeps/i386/dl-trampoline.S (_dl_runtime_profile): Fix cfi
18 directive.
19
20 +2011-08-31 Andreas Schwab <schwab@redhat.com>
21 +
22 + * include/link.h (FORCED_DYNAMIC_TLS_OFFSET) [NO_TLS_OFFSET == 0]:
23 + Change to -1.
24 +
25 2011-08-24 David S. Miller <davem@davemloft.net>
26
27 * sysdeps/sparc/sparc64/strcmp.S: Rewrite.
28 @@ -3609,6 +3619,14 @@
29 * config.make.in: Likewise.
30 * malloc/Makefile: Likewise.
31
32 +2011-06-28 Andreas Schwab <schwab@redhat.com>
33 +
34 + * iconvdata/gb18030.c: Update tables.
35 + (BODY for FROM_LOOP): Handle non-BMP characters specially.
36 +
37 + * sysdeps/posix/getaddrinfo.c (gaih_inet): Don't use gethostbyaddr
38 + to determine canonical name.
39 +
40 2011-06-27 Andreas Schwab <schwab@redhat.com>
41
42 * iconvdata/gb18030.c (BODY for TO_LOOP): Fix encoding of non-BMP
43 @@ -3740,6 +3758,10 @@
44
45 * inet/getnetgrent_r.c: Use DL_CALL_FCT in several places.
46
47 +2011-06-21 Andreas Schwab <schwab@redhat.com>
48 +
49 + * iconvdata/gb18030.c: Regenerate tables.
50 +
51 2011-06-20 David S. Miller <davem@davemloft.net>
52
53 * sysdeps/sparc/sparc32/dl-plt.h: Protect against multiple
54 @@ -4362,6 +4384,13 @@
55 * libio/Makefile (tests): Add bug-fclose1.
56 * libio/bug-fclose1.c: New file.
57
58 +2011-05-13 Andreas Schwab <schwab@redhat.com>
59 +
60 + * elf/dl-load.c (is_dst): Remove parameter secure, all callers
61 + changed. Move check for valid use of $ORIGIN ...
62 + (_dl_dst_substitute): ... here. Reset check_for_trusted when a
63 + path element is skipped.
64 +
65 2011-05-12 Ulrich Drepper <drepper@gmail.com>
66
67 [BZ #12511]
68 @@ -4639,13 +4668,6 @@
69 * stdlib/bug-getcontext.c: New file.
70 * stdlib/Makefile: Add rules to build and run bug-getcontext.
71
72 -2011-04-13 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
73 -
74 - * sysdeps/s390/s390-64/utf16-utf32-z9.c: Wrap the z9-109
75 - instructions into .machine "z9-109".
76 - * sysdeps/s390/s390-64/utf8-utf16-z9.c: Likewise.
77 - * sysdeps/s390/s390-64/utf8-utf32-z9.c: Likewise.
78 -
79 2011-04-11 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
80
81 * sysdeps/s390/s390-32/elf/start.S (_start): Skip extra zeroes
82 @@ -4883,6 +4905,31 @@
83 * sysdeps/unix/sysv/linux/Versions [GLIBC_2.14] (clock_adjtime):
84 Export.
85
86 +2011-04-06 Andreas Schwab <schwab@redhat.com>
87 +
88 + * scripts/check-local-headers.sh: Ignore systemtap headers.
89 +
90 +2011-02-21 Roland McGrath <roland@redhat.com>
91 +
92 + * sysdeps/x86_64/__longjmp.S: Add a static probe here.
93 + * sysdeps/x86_64/setjmp.S: Likewise.
94 + * sysdeps/i386/bsd-setjmp.S: Likewise.
95 + * sysdeps/i386/bsd-_setjmp.S: Likewise.
96 + * sysdeps/i386/setjmp.S: Likewise.
97 + * sysdeps/i386/__longjmp.S: Likewise.
98 + * sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S: Likewise.
99 + * sysdeps/unix/sysv/linux/i386/____longjmp_chk.S: Likewise.
100 +
101 +2011-02-08 Roland McGrath <roland@redhat.com>
102 +
103 + * include/stap-probe.h: New file.
104 + * configure.in: Handle --enable-systemtap.
105 + * configure: Regenerated.
106 + * config.h.in (USE_STAP_PROBE): New #undef.
107 + * extra-lib.mk (CPPFLAGS-$(lib)): Add -DIN_LIB=$(lib).
108 + * elf/Makefile (CPPFLAGS-.os): Add -DIN_LIB=rtld.
109 + * elf/rtld-Rules (rtld-CPPFLAGS): Likewise.
110 +
111 2011-03-22 Ulrich Drepper <drepper@gmail.com>
112
113 * sysdeps/unix/sysv/linux/i386/sysconf.c (intel_check_word): Increment
114 @@ -4943,6 +4990,16 @@
115 $LDFLAGS and -nostdlib -nostartfiles to linking step. Change main
116 to _start.
117
118 +2011-03-18 Andreas Schwab <schwab@redhat.com>
119 +
120 + * elf/ldd.bash.in: Never run file directly.
121 +
122 +2011-03-07 Andreas Schwab <schwab@redhat.com>
123 +
124 + * include/link.h (struct link_map): Remove l_orig_initfini.
125 + * elf/dl-close.c (_dl_close_worker): Revert its use.
126 + * elf/dl-deps.c (_dl_map_object_deps): Likewise.
127 +
128 2011-03-06 Ulrich Drepper <drepper@gmail.com>
129
130 * elf/dl-load.c (_dl_map_object): If we are looking for the first
131 @@ -5159,6 +5216,12 @@
132 * shadow/sgetspent.c: Check return value of __sgetspent_r instead
133 of errno.
134
135 +2011-02-03 Andreas Schwab <schwab@redhat.com>
136 +
137 + * login/programs/pt_chown.c (main): Check for valid file
138 + descriptor instead of privileges. Be careful to drop all
139 + capabilities when not needed.
140 +
141 2011-01-19 Ulrich Drepper <drepper@gmail.com>
142
143 [BZ #11724]
144 @@ -5846,6 +5909,26 @@
145 * sysdeps/unix/sysv/linux/internal_statvfs.c (INTERNAL_STATVFS):
146 Mask out sign-bit copies when constructing f_fsid.
147
148 +2010-09-27 Andreas Schwab <schwab@redhat.com>
149 +
150 + * include/link.h (struct link_map): Add l_free_initfini.
151 + * elf/dl-deps.c (_dl_map_object_deps): Set it when assigning
152 + l_initfini.
153 + * elf/rtld.c (dl_main): Clear it on all objects loaded on startup.
154 + * elf/dl-libc.c (free_mem): Free l_initfini if l_free_initfini is
155 + set.
156 +
157 + [BZ #11561]
158 + * posix/regcomp.c (parse_bracket_exp): When looking up collating
159 + elements compare against the byte sequence of it, not its name.
160 +
161 + [BZ #6530]
162 + * stdio-common/vfprintf.c (process_string_arg): Revert 2000-07-22
163 + change.
164 +
165 + * nss/nss_files/files-XXX.c (internal_getent): Declare linebuflen
166 + as size_t.
167 +
168 2010-09-24 Petr Baudis <pasky@suse.cz>
169
170 * debug/stack_chk_fail_local.c: Add missing licence exception.
171 @@ -6638,6 +6721,17 @@
172 call returning > 0 value.
173 * sysdeps/unix/sysv/linux/getlogin.c (getlogin): Likewise.
174
175 +2010-07-01 Andreas Schwab <schwab@redhat.com>
176 +
177 + * include/sys/resource.h (__getrlimit): Add hidden proto.
178 + * sysdeps/unix/sysv/linux/i386/getrlimit.c: Add libc_hidden_weak.
179 + * sysdeps/mach/hurd/getrlimit.c: Add libc_hidden_def.
180 + * resource/getrlimit.c: Likewise.
181 +
182 +2010-06-21 Andreas Schwab <schwab@redhat.com>
183 +
184 + * sysdeps/i386/i686/Makefile: Don't pass -mtune to assembler.
185 +
186 2010-06-07 Andreas Schwab <schwab@redhat.com>
187
188 * dlfcn/Makefile: Remove explicit dependencies on libc.so and
189 @@ -6690,6 +6784,21 @@
190 * hurd/hurd/fd.h (__file_name_lookup_at): Update comment.
191 * sysdeps/mach/hurd/linkat.c (linkat): Pass O_NOLINK in FLAGS.
192
193 +2010-06-11 Andreas Schwab <schwab@redhat.com>
194 +
195 + * elf/rtld.c (_dl_starting_up): Always define.
196 + (dl_main): Always set _dl_starting_up.
197 + * elf/dl-support.c (_dl_starting_up): Always define.
198 + * elf/dl-init.c (_dl_init): Always clear _dl_starting_up.
199 +
200 +2010-06-10 Andreas Schwab <schwab@redhat.com>
201 +
202 + * sysdeps/unix/sysv/linux/i386/Versions: Export __uname under
203 + GLIBC_PRIVATE.
204 + * nptl/Versions: Export __getrlimit under GLIBC_PRIVATE.
205 + * sysdeps/unix/sysv/linux/i386/smp.h: Call __uname instead of uname.
206 + * nptl/nptl-init.c: Call __getrlimit instead of getrlimit.
207 +
208 2010-05-28 Luis Machado <luisgpm@br.ibm.com>
209
210 * sysdeps/powerpc/powerpc32/power7/memcpy.S: Exchange srdi for srwi.
211 diff -Nrup a/ChangeLog.15 b/ChangeLog.15
212 --- a/ChangeLog.15 2012-01-01 05:16:32.000000000 -0700
213 +++ b/ChangeLog.15 2012-01-01 20:41:26.623439845 -0700
214 @@ -477,6 +477,14 @@
215
216 2004-11-26 Jakub Jelinek <jakub@redhat.com>
217
218 + * posix/Makefile (generated: Add getconf.speclist.
219 + ($(inst_libexecdir)/getconf): Use getconf.speclist instead of
220 + getconf output.
221 + ($(objpfx)getconf.speclist): New rule.
222 + * posix/getconf.speclist.h: New file.
223 +
224 +2004-11-26 Jakub Jelinek <jakub@redhat.com>
225 +
226 * sysdeps/generic/unsecvars.h (UNSECURE_ENVVARS): Add GETCONF_DIR.
227
228 2004-11-26 Kaz Kojima <kkojima@rr.iij4u.or.jp>
229 @@ -1103,6 +1111,13 @@
230 * sysdeps/generic/tempname.c (__path_search): Add missing argument
231 TRY_TMPDIR.
232
233 +2004-11-02 Jakub Jelinek <jakub@redhat.com>
234 +
235 + * include/features.h (__USE_FORTIFY_LEVEL): Also set for Red Hat
236 + GCC 3.4.x-RH >= 3.4.2-8.
237 + * debug/tst-chk1.c (do_test): Deal with GCC 3.4.x-RH not
238 + being able to recognize subobjects.
239 +
240 2004-10-31 Mariusz Mazur <mmazur@kernel.pl>
241
242 * sysdeps/unix/sysv/linux/alpha/setregid.c: New file.
243 @@ -1443,6 +1458,11 @@
244 * sysdeps/generic/readonly-area.c (__readonly_str): Renamed to ...
245 (__readonly_area): ... this.
246
247 +2004-10-19 Jakub Jelinek <jakub@redhat.com>
248 +
249 + * include/features.h (__USE_FORTIFY_LEVEL): Enable even with
250 + Red Hat gcc4 4.0.0 and above.
251 +
252 2004-10-18 Jakub Jelinek <jakub@redhat.com>
253
254 * sysdeps/generic/strcpy_chk.c (__strcpy_chk): Speed up by checking
255 @@ -3182,6 +3202,23 @@
256 before return type.
257 * locale/localename.c (__current_locale_name): Likewise.
258
259 +2004-08-31 Jakub Jelinek <jakub@redhat.com>
260 +
261 + * elf/ldconfig.c (parse_conf): Add prefix argument, prepend it
262 + before arguments to add_dir and pass to parse_conf_include.
263 + (parse_conf_include): Add prefix argument, pass it down to
264 + parse_conf.
265 + (main): Call arch_startup. Adjust parse_conf caller.
266 + Call add_arch_dirs.
267 + * sysdeps/generic/dl-cache.h (arch_startup, add_arch_dirs): Define.
268 + * sysdeps/unix/sysv/linux/i386/dl-cache.h: New file.
269 + * sysdeps/unix/sysv/linux/ia64/dl-cache.h (EMUL_HACK, arch_startup,
270 + add_arch_dirs): Define.
271 + * sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed: Prepend
272 + /emul/ia32-linux before the 32-bit ld.so pathname.
273 + * sysdeps/unix/sysv/linux/ia64/dl-procinfo.c: New file.
274 + * sysdeps/unix/sysv/linux/ia64/dl-procinfo.h: New file.
275 +
276 2004-08-30 Roland McGrath <roland@frob.com>
277
278 * scripts/extract-abilist.awk: If `lastversion' variable defined, omit
279 diff -Nrup a/ChangeLog.16 b/ChangeLog.16
280 --- a/ChangeLog.16 2012-01-01 05:16:32.000000000 -0700
281 +++ b/ChangeLog.16 2012-01-01 20:41:26.626439845 -0700
282 @@ -2042,6 +2042,9 @@
283 (__MATHDECL_2): Use __REDIRECT_NTH instead of __REDIRECT
284 followed by __THROW.
285
286 + * sysdeps/unix/sysv/linux/futimesat.c (futimesat): If
287 + file == NULL, use __futimes unconditionally.
288 +
289 2006-02-02 Ulrich Drepper <drepper@redhat.com>
290
291 * sysdeps/unix/sysv/linux/futimesat.c [__NR_futimesat]
292 @@ -2101,6 +2104,11 @@
293 * sysdeps/ieee754/ldbl-128/s_llrintl.c (__llrintl): Fix a typo.
294 * sysdeps/s390/fpu/libm-test-ulps: Remove llrint ulps.
295
296 +2006-01-30 Jakub Jelinek <jakub@redhat.com>
297 +
298 + * include/bits/stdlib-ldbl.h: New file.
299 + * include/bits/wchar-ldbl.h: New file.
300 +
301 2006-01-19 Thomas Schwinge <tschwinge@gnu.org>
302
303 * libio/genops.c: Include <stdbool.h>.
304 diff -Nrup a/ChangeLog.17 b/ChangeLog.17
305 --- a/ChangeLog.17 2012-01-01 05:16:32.000000000 -0700
306 +++ b/ChangeLog.17 2012-01-01 20:41:26.629439844 -0700
307 @@ -256,6 +256,12 @@
308
309 * Makerules (libc-abis): Fix search for libc-abis in add-ons.
310
311 +2010-04-06 Ulrich Drepper <drepper@redhat.com>
312 +
313 + * sysdeps/posix/getaddrinfo.c (default_scopes): Assign global
314 + scope to RFC 1918 addresses.
315 + * posix/gai.conf: Document difference from RFC 3484.
316 +
317 2010-04-05 Thomas Schwinge <thomas@schwinge.name>
318
319 * sysdeps/gnu/unwind-resume.c: New, moved from nptl/sysdeps/pthread/.
320 @@ -2953,6 +2959,11 @@ d2009-10-30 Ulrich Drepper <drepper@re
321 * sysdeps/generic/ldsodefs.h (struct rtld_global): The map element in
322 the unique symbol hash table should not be const.
323
324 +2009-07-22 Jakub Jelinek <jakub@redhat.com>
325 +
326 + * Makeconfig (ASFLAGS): Append $(sysdep-ASFLAGS).
327 + * sysdeps/i386/Makefile (sysdep-ASFLAGS): Add -U__i686.
328 +
329 2009-07-21 Ulrich Drepper <drepper@redhat.com>
330
331 * sysdeps/x86_64/multiarch/strstr.c: Minor cleanups. Remove
332 @@ -3218,6 +3229,11 @@ d2009-10-30 Ulrich Drepper <drepper@re
333 out common code into new function get_common_indeces. Determine
334 extended family and model for Intel processors.
335
336 +2009-06-26 Andreas Schwab <aschwab@redhat.com>
337 +
338 + * timezone/zic.c (stringzone): Don't try to generate a POSIX TZ
339 + string when the timezone ends in DST.
340 +
341 2009-06-26 Ulrich Drepper <drepper@redhat.com>
342
343 * resolv/resolv.h: Define RES_SNGLKUPREOP.
344 @@ -11818,6 +11834,10 @@ d2009-10-30 Ulrich Drepper <drepper@re
345 [BZ #4368]
346 * stdlib/stdlib.h: Remove obsolete part of comment for realpath.
347
348 +2007-04-16 Jakub Jelinek <jakub@redhat.com>
349 +
350 + * locale/programs/locarchive.c (add_alias, insert_name): Remove static.
351 +
352 2007-04-16 Ulrich Drepper <drepper@redhat.com>
353
354 [BZ #4364]
355 @@ -13075,6 +13095,15 @@ d2009-10-30 Ulrich Drepper <drepper@re
356 separators also if no non-zero digits found.
357 * stdlib/Makefile (tests): Add tst-strtod3.
358
359 +2006-12-10 Jakub Jelinek <jakub@redhat.com>
360 +
361 + * sysdeps/unix/sysv/linux/netlinkaccess.h: Include linux/if_addr.h
362 + if IFA_MAX is not defined.
363 + (IFA_RTA, IFA_PAYLOAD, IFLA_RTA, IFLA_PAYLOAD): Define if not
364 + defined.
365 + * sysdeps/unix/sysv/linux/check_pf.c: Include netlinkaccess.h
366 + instead of asm/types.h, linux/netlink.h and linux/rtnetlink.h.
367 +
368 2006-12-09 Ulrich Drepper <drepper@redhat.com>
369
370 [BZ #3632]
371 diff -Nrup a/Makeconfig b/Makeconfig
372 --- a/Makeconfig 2012-01-01 05:16:32.000000000 -0700
373 +++ b/Makeconfig 2012-01-01 20:41:26.630439843 -0700
374 @@ -803,12 +803,12 @@ endif
375 # The assembler can generate debug information too.
376 ifndef ASFLAGS
377 ifeq ($(have-cpp-asm-debuginfo),yes)
378 -ASFLAGS := $(filter -g% -fdebug-prefix-map=%,$(CFLAGS))
379 +ASFLAGS = $(filter -g% -fdebug-prefix-map=%,$(CFLAGS))
380 else
381 -ASFLAGS :=
382 +ASFLAGS =
383 endif
384 endif
385 -ASFLAGS += $(ASFLAGS-config) $(asflags-cpu)
386 +ASFLAGS += $(ASFLAGS-config) $(asflags-cpu) $(sysdep-ASFLAGS)
387
388 ifndef BUILD_CC
389 BUILD_CC = $(CC)
390 diff -Nrup a/NEWS b/NEWS
391 --- a/NEWS 2012-01-01 05:16:32.000000000 -0700
392 +++ b/NEWS 2012-01-01 20:41:26.631439843 -0700
393 @@ -84,16 +84,6 @@ Version 2.14
394 12724, 12734, 12738, 12746, 12766, 12775, 12777, 12782, 12788, 12792,
395 12795, 12811, 12813, 12814, 12841
396
397 -* The RPC implementation in libc is obsoleted. Old programs keep working
398 - but new programs cannot be linked with the routines in libc anymore.
399 - Programs in need of RPC functionality must be linked against TI-RPC.
400 - The TI-RPC implementation is IPv6 enabled and there are other benefits.
401 -
402 - Visible changes of this change include (obviously) the inability to link
403 - programs using RPC functions without referencing the TI-RPC library and the
404 - removal of the RPC headers from the glibc headers.
405 - Implemented by Ulrich Drepper.
406 -
407 * New Linux interfaces: clock_adjtime, name_to_handle_at, open_by_handle_at,
408 syncfs, setns, sendmmsg
409
410 diff -Nrup a/config.h.in b/config.h.in
411 --- a/config.h.in 2012-01-01 05:16:32.000000000 -0700
412 +++ b/config.h.in 2012-01-01 20:41:26.632439843 -0700
413 @@ -187,6 +187,9 @@
414 /* Define if `.ctors' and `.dtors' sections shouldn't be used. */
415 #undef NO_CTORS_DTORS_SECTIONS
416
417 +/* Define if Systemtap <sys/sdt.h> probes should be defined. */
418 +#undef USE_STAP_PROBE
419 +
420 /*
421 \f */
422
423 diff -Nrup a/configure b/configure
424 --- a/configure 2012-01-01 20:40:50.423446105 -0700
425 +++ b/configure 2012-01-01 20:41:26.634439843 -0700
426 @@ -791,6 +791,7 @@ enable_kernel
427 enable_all_warnings
428 enable_multi_arch
429 enable_nss_crypt
430 +enable_systemtap
431 with_cpu
432 '
433 ac_precious_vars='build_alias
434 @@ -1450,6 +1451,7 @@ Optional Features:
435 --enable-multi-arch enable single DSO with optimizations for multiple
436 architectures
437 --enable-nss-crypt enable libcrypt to use nss
438 + --enable-systemtap enable systemtap static probe points [default=no]
439
440 Optional Packages:
441 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
442 @@ -3804,6 +3806,51 @@ else
443 fi
444
445
446 +# Check whether --enable-systemtap was given.
447 +if test "${enable_systemtap+set}" = set; then :
448 + enableval=$enable_systemtap; systemtap=$enableval
449 +else
450 + systemtap=no
451 +fi
452 +
453 +if test x$systemtap != xno; then
454 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemtap static probe support" >&5
455 +$as_echo_n "checking for systemtap static probe support... " >&6; }
456 +if test "${libc_cv_sdt+set}" = set; then :
457 + $as_echo_n "(cached) " >&6
458 +else
459 + old_CFLAGS="$CFLAGS"
460 + CFLAGS="-std=gnu99 $CFLAGS"
461 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
462 +/* end confdefs.h. */
463 +#include <sys/sdt.h>
464 +void foo (int i, void *p)
465 +{
466 + asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
467 + :: STAP_PROBE_ASM_OPERANDS (2, i, p));
468 +}
469 +_ACEOF
470 +if ac_fn_c_try_compile "$LINENO"; then :
471 + libc_cv_sdt=yes
472 +else
473 + libc_cv_sdt=no
474 +fi
475 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
476 + CFLAGS="$old_CFLAGS"
477 +fi
478 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sdt" >&5
479 +$as_echo "$libc_cv_sdt" >&6; }
480 + if test $libc_cv_sdt = yes; then
481 + $as_echo "#define USE_STAP_PROBE 1" >>confdefs.h
482 +
483 + else
484 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
485 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
486 +as_fn_error $? "systemtap support needs sys/sdt.h with asm support
487 +See \`config.log' for more details" "$LINENO" 5; }
488 + fi
489 +fi
490 +
491 # The way shlib-versions is used to generate soversions.mk uses a
492 # fairly simplistic model for name recognition that can't distinguish
493 # i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
494 diff -Nrup a/configure.in b/configure.in
495 --- a/configure.in 2012-01-01 05:16:32.000000000 -0700
496 +++ b/configure.in 2012-01-01 20:41:26.635439843 -0700
497 @@ -290,6 +290,29 @@ else
498 fi
499 AC_SUBST(libc_cv_nss_crypt)
500
501 +AC_ARG_ENABLE([systemtap],
502 + [AS_HELP_STRING([--enable-systemtap],
503 + [enable systemtap static probe points @<:@default=no@:>@])],
504 + [systemtap=$enableval],
505 + [systemtap=no])
506 +if test x$systemtap != xno; then
507 + AC_CACHE_CHECK([for systemtap static probe support], libc_cv_sdt, [dnl
508 + old_CFLAGS="$CFLAGS"
509 + CFLAGS="-std=gnu99 $CFLAGS"
510 + AC_COMPILE_IFELSE([#include <sys/sdt.h>
511 +void foo (int i, void *p)
512 +{
513 + asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
514 + :: STAP_PROBE_ASM_OPERANDS (2, i, p));
515 +}], [libc_cv_sdt=yes], [libc_cv_sdt=no])
516 + CFLAGS="$old_CFLAGS"])
517 + if test $libc_cv_sdt = yes; then
518 + AC_DEFINE([USE_STAP_PROBE])
519 + else
520 + AC_MSG_FAILURE([systemtap support needs sys/sdt.h with asm support])
521 + fi
522 +fi
523 +
524 # The way shlib-versions is used to generate soversions.mk uses a
525 # fairly simplistic model for name recognition that can't distinguish
526 # i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
527 diff -Nrup a/csu/Makefile b/csu/Makefile
528 --- a/csu/Makefile 2012-01-01 05:16:32.000000000 -0700
529 +++ b/csu/Makefile 2012-01-01 20:41:26.635439843 -0700
530 @@ -93,7 +93,8 @@ omit-deps += $(crtstuff)
531 $(crtstuff:%=$(objpfx)%.o): %.o: %.S $(objpfx)defs.h
532 $(compile.S) -g0 $(ASFLAGS-.os) -o $@
533
534 -CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time)
535 +CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time) \
536 + -fno-asynchronous-unwind-tables
537
538 vpath initfini.c $(sysdirs)
539
540 diff -Nrup a/csu/elf-init.c b/csu/elf-init.c
541 --- a/csu/elf-init.c 2012-01-01 05:16:32.000000000 -0700
542 +++ b/csu/elf-init.c 2012-01-01 20:41:26.636439843 -0700
543 @@ -64,6 +64,23 @@ extern void (*__init_array_end []) (int,
544 extern void (*__fini_array_start []) (void) attribute_hidden;
545 extern void (*__fini_array_end []) (void) attribute_hidden;
546
547 +#if defined HAVE_VISIBILITY_ATTRIBUTE \
548 + && (defined SHARED || defined LIBC_NONSHARED)
549 +# define hidden_undef_2(x) #x
550 +# define hidden_undef_1(x) hidden_undef_2 (x)
551 +# define hidden_undef(x) \
552 + __asm (hidden_undef_1 (ASM_GLOBAL_DIRECTIVE) " " #x); \
553 + __asm (".hidden " #x);
554 +#else
555 +# define hidden_undef(x)
556 +#endif
557 +
558 +hidden_undef (__preinit_array_start)
559 +hidden_undef (__preinit_array_end)
560 +hidden_undef (__init_array_start)
561 +hidden_undef (__init_array_end)
562 +hidden_undef (__fini_array_start)
563 +hidden_undef (__fini_array_end)
564
565 /* These function symbols are provided for the .init/.fini section entry
566 points automagically by the linker. */
567 diff -Nrup a/debug/tst-chk1.c b/debug/tst-chk1.c
568 --- a/debug/tst-chk1.c 2012-01-01 05:16:32.000000000 -0700
569 +++ b/debug/tst-chk1.c 2012-01-01 20:41:26.636439843 -0700
570 @@ -17,6 +17,9 @@
571 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
572 02111-1307 USA. */
573
574 +/* Hack: make sure GCC doesn't know __chk_fail () will not return. */
575 +#define __noreturn__
576 +
577 #include <assert.h>
578 #include <fcntl.h>
579 #include <locale.h>
580 @@ -243,7 +246,7 @@ do_test (void)
581 if (memcmp (a.buf1, "aabcdabcjj", 10))
582 FAIL ();
583
584 -#if __USE_FORTIFY_LEVEL < 2
585 +#if __USE_FORTIFY_LEVEL < 2 || !__GNUC_PREREQ (4, 0)
586 /* The following tests are supposed to crash with -D_FORTIFY_SOURCE=2
587 and sufficient GCC support, as the string operations overflow
588 from a.buf1 into a.buf2. */
589 @@ -358,7 +361,7 @@ do_test (void)
590 memset (a.buf1 + 9, 'j', l0 + 2);
591 CHK_FAIL_END
592
593 -# if __USE_FORTIFY_LEVEL >= 2
594 +# if __USE_FORTIFY_LEVEL >= 2 && __GNUC_PREREQ (4, 0)
595 # define O 0
596 # else
597 # define O 1
598 diff -Nrup a/elf/Makefile b/elf/Makefile
599 --- a/elf/Makefile 2012-01-01 05:16:32.000000000 -0700
600 +++ b/elf/Makefile 2012-01-01 20:41:26.637439843 -0700
601 @@ -135,6 +135,7 @@ include ../Makeconfig
602 ifeq ($(unwind-find-fde),yes)
603 routines += unwind-dw2-fde-glibc
604 shared-only-routines += unwind-dw2-fde-glibc
605 +CFLAGS-unwind-dw2-fde-glibc.c += -fno-strict-aliasing
606 endif
607
608 before-compile = $(objpfx)trusted-dirs.h
609 @@ -505,7 +506,8 @@ CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'
610 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
611 CFLAGS-cache.c = $(SYSCONF-FLAGS)
612
613 -CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
614 +CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
615 + -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
616
617 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
618 generated += $(addsuffix .so,$(strip $(modules-names)))
619 diff -Nrup a/elf/dl-close.c b/elf/dl-close.c
620 --- a/elf/dl-close.c 2012-01-01 05:16:32.000000000 -0700
621 +++ b/elf/dl-close.c 2012-01-01 20:41:26.638439843 -0700
622 @@ -119,17 +119,8 @@ _dl_close_worker (struct link_map *map)
623 if (map->l_direct_opencount > 0 || map->l_type != lt_loaded
624 || dl_close_state != not_pending)
625 {
626 - if (map->l_direct_opencount == 0)
627 - {
628 - if (map->l_type == lt_loaded)
629 - dl_close_state = rerun;
630 - else if (map->l_type == lt_library)
631 - {
632 - struct link_map **oldp = map->l_initfini;
633 - map->l_initfini = map->l_orig_initfini;
634 - _dl_scope_free (oldp);
635 - }
636 - }
637 + if (map->l_direct_opencount == 0 && map->l_type == lt_loaded)
638 + dl_close_state = rerun;
639
640 /* There are still references to this object. Do nothing more. */
641 if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
642 diff -Nrup a/elf/dl-deps.c b/elf/dl-deps.c
643 --- a/elf/dl-deps.c 2012-01-01 05:16:32.000000000 -0700
644 +++ b/elf/dl-deps.c 2012-01-01 20:41:26.638439843 -0700
645 @@ -489,6 +489,7 @@ _dl_map_object_deps (struct link_map *ma
646 nneeded * sizeof needed[0]);
647 atomic_write_barrier ();
648 l->l_initfini = l_initfini;
649 + l->l_free_initfini = 1;
650 }
651
652 /* If we have no auxiliary objects just go on to the next map. */
653 @@ -689,6 +690,7 @@ Filters not supported with LD_TRACE_PREL
654 l_initfini[nlist] = NULL;
655 atomic_write_barrier ();
656 map->l_initfini = l_initfini;
657 + map->l_free_initfini = 1;
658 if (l_reldeps != NULL)
659 {
660 atomic_write_barrier ();
661 @@ -697,7 +699,7 @@ Filters not supported with LD_TRACE_PREL
662 _dl_scope_free (old_l_reldeps);
663 }
664 if (old_l_initfini != NULL)
665 - map->l_orig_initfini = old_l_initfini;
666 + _dl_scope_free (old_l_initfini);
667
668 if (errno_reason)
669 _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
670 diff -Nrup a/elf/dl-init.c b/elf/dl-init.c
671 --- a/elf/dl-init.c 2012-01-01 05:16:32.000000000 -0700
672 +++ b/elf/dl-init.c 2012-01-01 20:41:26.639439843 -0700
673 @@ -24,11 +24,9 @@
674 /* Type of the initializer. */
675 typedef void (*init_t) (int, char **, char **);
676
677 -#ifndef HAVE_INLINED_SYSCALLS
678 /* Flag, nonzero during startup phase. */
679 extern int _dl_starting_up;
680 extern int _dl_starting_up_internal attribute_hidden;
681 -#endif
682
683
684 static void
685 @@ -133,9 +131,7 @@ _dl_init (struct link_map *main_map, int
686 while (i-- > 0)
687 call_init (main_map->l_initfini[i], argc, argv, env);
688
689 -#ifndef HAVE_INLINED_SYSCALLS
690 /* Finished starting up. */
691 INTUSE(_dl_starting_up) = 0;
692 -#endif
693 }
694 INTDEF (_dl_init)
695 diff -Nrup a/elf/dl-libc.c b/elf/dl-libc.c
696 --- a/elf/dl-libc.c 2012-01-01 05:16:32.000000000 -0700
697 +++ b/elf/dl-libc.c 2012-01-01 20:41:26.639439843 -0700
698 @@ -270,13 +270,13 @@ libc_freeres_fn (free_mem)
699
700 for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
701 {
702 - /* Remove all additional names added to the objects. */
703 for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
704 {
705 struct libname_list *lnp = l->l_libname->next;
706
707 l->l_libname->next = NULL;
708
709 + /* Remove all additional names added to the objects. */
710 while (lnp != NULL)
711 {
712 struct libname_list *old = lnp;
713 @@ -284,6 +284,10 @@ libc_freeres_fn (free_mem)
714 if (! old->dont_free)
715 free (old);
716 }
717 +
718 + /* Free the initfini dependency list. */
719 + if (l->l_free_initfini)
720 + free (l->l_initfini);
721 }
722
723 if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0
724 diff -Nrup a/elf/dl-load.c b/elf/dl-load.c
725 --- a/elf/dl-load.c 2012-01-01 05:16:32.000000000 -0700
726 +++ b/elf/dl-load.c 2012-01-01 20:41:26.640439842 -0700
727 @@ -250,8 +250,7 @@ is_trusted_path_normalize (const char *p
728
729
730 static size_t
731 -is_dst (const char *start, const char *name, const char *str,
732 - int is_path, int secure)
733 +is_dst (const char *start, const char *name, const char *str, int is_path)
734 {
735 size_t len;
736 bool is_curly = false;
737 @@ -280,12 +279,6 @@ is_dst (const char *start, const char *n
738 && (!is_path || name[len] != ':'))
739 return 0;
740
741 - if (__builtin_expect (secure, 0)
742 - && ((name[len] != '\0' && name[len] != '/'
743 - && (!is_path || name[len] != ':'))
744 - || (name != start + 1 && (!is_path || name[-2] != ':'))))
745 - return 0;
746 -
747 return len;
748 }
749
750 @@ -300,13 +293,10 @@ _dl_dst_count (const char *name, int is_
751 {
752 size_t len;
753
754 - /* $ORIGIN is not expanded for SUID/GUID programs (except if it
755 - is $ORIGIN alone) and it must always appear first in path. */
756 ++name;
757 - if ((len = is_dst (start, name, "ORIGIN", is_path,
758 - INTUSE(__libc_enable_secure))) != 0
759 - || (len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0
760 - || (len = is_dst (start, name, "LIB", is_path, 0)) != 0)
761 + if ((len = is_dst (start, name, "ORIGIN", is_path)) != 0
762 + || (len = is_dst (start, name, "PLATFORM", is_path)) != 0
763 + || (len = is_dst (start, name, "LIB", is_path)) != 0)
764 ++cnt;
765
766 name = strchr (name + len, '$');
767 @@ -339,9 +329,16 @@ _dl_dst_substitute (struct link_map *l,
768 size_t len;
769
770 ++name;
771 - if ((len = is_dst (start, name, "ORIGIN", is_path,
772 - INTUSE(__libc_enable_secure))) != 0)
773 + if ((len = is_dst (start, name, "ORIGIN", is_path)) != 0)
774 {
775 + /* For SUID/GUID programs $ORIGIN must always appear
776 + first in a path element. */
777 + if (__builtin_expect (INTUSE(__libc_enable_secure), 0)
778 + && ((name[len] != '\0' && name[len] != '/'
779 + && (!is_path || name[len] != ':'))
780 + || (name != start + 1 && (!is_path || name[-2] != ':'))))
781 + repl = (const char *) -1;
782 + else
783 #ifndef SHARED
784 if (l == NULL)
785 repl = _dl_get_origin ();
786 @@ -352,9 +349,9 @@ _dl_dst_substitute (struct link_map *l,
787 check_for_trusted = (INTUSE(__libc_enable_secure)
788 && l->l_type == lt_executable);
789 }
790 - else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0)
791 + else if ((len = is_dst (start, name, "PLATFORM", is_path)) != 0)
792 repl = GLRO(dl_platform);
793 - else if ((len = is_dst (start, name, "LIB", is_path, 0)) != 0)
794 + else if ((len = is_dst (start, name, "LIB", is_path)) != 0)
795 repl = DL_DST_LIB;
796
797 if (repl != NULL && repl != (const char *) -1)
798 @@ -374,6 +371,7 @@ _dl_dst_substitute (struct link_map *l,
799 element, but keep an empty element at the end. */
800 if (wp == result && is_path && *name == ':' && name[1] != '\0')
801 ++name;
802 + check_for_trusted = false;
803 }
804 else
805 /* No DST we recognize. */
806 diff -Nrup a/elf/dl-support.c b/elf/dl-support.c
807 --- a/elf/dl-support.c 2012-01-01 05:16:32.000000000 -0700
808 +++ b/elf/dl-support.c 2012-01-01 20:41:26.641439841 -0700
809 @@ -82,10 +82,8 @@ unsigned long long _dl_load_adds;
810 create a fake scope containing nothing. */
811 struct r_scope_elem _dl_initial_searchlist;
812
813 -#ifndef HAVE_INLINED_SYSCALLS
814 /* Nonzero during startup. */
815 int _dl_starting_up = 1;
816 -#endif
817
818 /* Random data provided by the kernel. */
819 void *_dl_random;
820 diff -Nrup a/elf/ldconfig.c b/elf/ldconfig.c
821 --- a/elf/ldconfig.c 2012-01-01 05:16:32.000000000 -0700
822 +++ b/elf/ldconfig.c 2012-01-01 20:41:26.641439841 -0700
823 @@ -1034,17 +1034,19 @@ search_dirs (void)
824
825
826 static void parse_conf_include (const char *config_file, unsigned int lineno,
827 - bool do_chroot, const char *pattern);
828 + const char *prefix, bool do_chroot,
829 + const char *pattern);
830
831 /* Parse configuration file. */
832 static void
833 -parse_conf (const char *filename, bool do_chroot)
834 +parse_conf (const char *filename, const char *prefix, bool do_chroot)
835 {
836 FILE *file = NULL;
837 char *line = NULL;
838 const char *canon;
839 size_t len = 0;
840 unsigned int lineno;
841 + size_t prefix_len = prefix ? strlen (prefix) : 0;
842
843 if (do_chroot && opt_chroot)
844 {
845 @@ -1105,7 +1107,14 @@ parse_conf (const char *filename, bool d
846 cp += 8;
847 while ((dir = strsep (&cp, " \t")) != NULL)
848 if (dir[0] != '\0')
849 - parse_conf_include (filename, lineno, do_chroot, dir);
850 + parse_conf_include (filename, lineno, prefix, do_chroot, dir);
851 + }
852 + else if (prefix != NULL)
853 + {
854 + size_t cp_len = strlen (cp);
855 + char new_cp [prefix_len + cp_len + 1];
856 + memcpy (mempcpy (new_cp, prefix, prefix_len), cp, cp_len + 1);
857 + add_dir (new_cp);
858 }
859 else if (!strncasecmp (cp, "hwcap", 5) && isblank (cp[5]))
860 {
861 @@ -1168,7 +1177,7 @@ parse_conf (const char *filename, bool d
862 config files to read. */
863 static void
864 parse_conf_include (const char *config_file, unsigned int lineno,
865 - bool do_chroot, const char *pattern)
866 + const char *prefix, bool do_chroot, const char *pattern)
867 {
868 if (opt_chroot && pattern[0] != '/')
869 error (EXIT_FAILURE, 0,
870 @@ -1200,7 +1209,7 @@ parse_conf_include (const char *config_f
871 {
872 case 0:
873 for (size_t i = 0; i < gl.gl_pathc; ++i)
874 - parse_conf (gl.gl_pathv[i], false);
875 + parse_conf (gl.gl_pathv[i], prefix, false);
876 globfree64 (&gl);
877 break;
878
879 @@ -1243,6 +1252,8 @@ main (int argc, char **argv)
880 /* Set the text message domain. */
881 textdomain (_libc_intl_domainname);
882
883 + arch_startup (argc, argv);
884 +
885 /* Parse and process arguments. */
886 int remaining;
887 argp_parse (&argp, argc, argv, 0, &remaining, NULL);
888 @@ -1352,12 +1363,14 @@ main (int argc, char **argv)
889
890 if (!opt_only_cline)
891 {
892 - parse_conf (config_file, true);
893 + parse_conf (config_file, NULL, true);
894
895 /* Always add the standard search paths. */
896 add_system_dir (SLIBDIR);
897 if (strcmp (SLIBDIR, LIBDIR))
898 add_system_dir (LIBDIR);
899 +
900 + add_arch_dirs (config_file);
901 }
902
903 const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
904 diff -Nrup a/elf/ldd.bash.in b/elf/ldd.bash.in
905 --- a/elf/ldd.bash.in 2012-01-01 05:16:32.000000000 -0700
906 +++ b/elf/ldd.bash.in 2012-01-01 20:41:26.642439841 -0700
907 @@ -167,18 +167,6 @@ warning: you do not have execution permi
908 fi
909 done
910 case $ret in
911 - 0)
912 - # If the program exits with exit code 5, it means the process has been
913 - # invoked with __libc_enable_secure. Fall back to running it through
914 - # the dynamic linker.
915 - try_trace "$file"
916 - rc=$?
917 - if [ $rc = 5 ]; then
918 - try_trace "$RTLD" "$file"
919 - rc=$?
920 - fi
921 - [ $rc = 0 ] || result=1
922 - ;;
923 1)
924 # This can be a non-ELF binary or no binary at all.
925 nonelf "$file" || {
926 @@ -186,7 +174,7 @@ warning: you do not have execution permi
927 result=1
928 }
929 ;;
930 - 2)
931 + 0|2)
932 try_trace "$RTLD" "$file" || result=1
933 ;;
934 *)
935 diff -Nrup a/elf/rtld-Rules b/elf/rtld-Rules
936 --- a/elf/rtld-Rules 2012-01-01 05:16:32.000000000 -0700
937 +++ b/elf/rtld-Rules 2012-01-01 20:41:26.642439841 -0700
938 @@ -1,7 +1,7 @@
939 # Subroutine makefile for compiling libc modules linked into dynamic linker.
940
941 # Copyright (C) 2002,2003,2005,2006,2008,2010,2011
942 -# Free Software Foundation, Inc.
943 +# Free Software Foundation, Inc.
944 # This file is part of the GNU C Library.
945
946 # The GNU C Library is free software; you can redistribute it and/or
947 @@ -131,6 +131,6 @@ ifdef rtld-depfiles
948 endif
949
950 # This here is the whole point of all the shenanigans.
951 -rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1
952 +rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
953
954 endif
955 diff -Nrup a/elf/rtld.c b/elf/rtld.c
956 --- a/elf/rtld.c 2012-01-01 05:16:32.000000000 -0700
957 +++ b/elf/rtld.c 2012-01-01 20:41:26.643439841 -0700
958 @@ -107,7 +107,6 @@ static struct audit_list
959 struct audit_list *next;
960 } *audit_list;
961
962 -#ifndef HAVE_INLINED_SYSCALLS
963 /* Set nonzero during loading and initialization of executable and
964 libraries, cleared before the executable's entry point runs. This
965 must not be initialized to nonzero, because the unused dynamic
966 @@ -117,7 +116,6 @@ static struct audit_list
967 never be called. */
968 int _dl_starting_up = 0;
969 INTVARDEF(_dl_starting_up)
970 -#endif
971
972 /* This is the structure which defines all variables global to ld.so
973 (except those which cannot be added for some reason). */
974 @@ -929,10 +927,8 @@ dl_main (const ElfW(Phdr) *phdr,
975 /* Process the environment variable which control the behaviour. */
976 process_envvars (&mode);
977
978 -#ifndef HAVE_INLINED_SYSCALLS
979 /* Set up a flag which tells we are just starting. */
980 INTUSE(_dl_starting_up) = 1;
981 -#endif
982
983 if (*user_entry == (ElfW(Addr)) ENTRY_POINT)
984 {
985 @@ -1397,7 +1393,9 @@ of this helper program; chances are you
986 char *copy = malloc (len);
987 if (copy == NULL)
988 _dl_fatal_printf ("out of memory\n");
989 - l->l_libname->name = l->l_name = memcpy (copy, dsoname, len);
990 + l->l_libname->name = memcpy (copy, dsoname, len);
991 + if (GLRO(dl_debug_mask))
992 + l->l_name = copy;
993 }
994
995 /* Add the vDSO to the object list. */
996 @@ -2276,6 +2274,7 @@ ERROR: ld.so: object '%s' cannot be load
997 lnp->dont_free = 1;
998 lnp = lnp->next;
999 }
1000 + l->l_free_initfini = 0;
1001
1002 if (l != &GL(dl_rtld_map))
1003 _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
1004 @@ -2327,7 +2326,6 @@ ERROR: ld.so: object '%s' cannot be load
1005
1006 /* Make sure no new search directories have been added. */
1007 assert (GLRO(dl_init_all_dirs) == GL(dl_all_dirs));
1008 -
1009 if (! prelinked && rtld_multiple_ref)
1010 {
1011 /* There was an explicit ref to the dynamic linker as a shared lib.
1012 diff -Nrup a/extra-lib.mk b/extra-lib.mk
1013 --- a/extra-lib.mk 2012-01-01 05:16:32.000000000 -0700
1014 +++ b/extra-lib.mk 2012-01-01 20:41:26.644439841 -0700
1015 @@ -101,4 +101,4 @@ ifneq (,$(cpp-srcs-left))
1016 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
1017 endif
1018
1019 -CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1
1020 +CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1 -DIN_LIB=$(lib)
1021 diff -Nrup a/include/bits/stdlib-ldbl.h b/include/bits/stdlib-ldbl.h
1022 --- a/include/bits/stdlib-ldbl.h 1969-12-31 17:00:00.000000000 -0700
1023 +++ b/include/bits/stdlib-ldbl.h 2012-01-01 20:41:26.644439841 -0700
1024 @@ -0,0 +1 @@
1025 +#include <stdlib/bits/stdlib-ldbl.h>
1026 diff -Nrup a/include/bits/wchar-ldbl.h b/include/bits/wchar-ldbl.h
1027 --- a/include/bits/wchar-ldbl.h 1969-12-31 17:00:00.000000000 -0700
1028 +++ b/include/bits/wchar-ldbl.h 2012-01-01 20:41:26.644439841 -0700
1029 @@ -0,0 +1 @@
1030 +#include <wcsmbs/bits/wchar-ldbl.h>
1031 diff -Nrup a/include/features.h b/include/features.h
1032 --- a/include/features.h 2012-01-01 05:16:32.000000000 -0700
1033 +++ b/include/features.h 2012-01-01 20:41:26.644439841 -0700
1034 @@ -310,8 +310,13 @@
1035 #endif
1036
1037 #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
1038 - && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
1039 -# if _FORTIFY_SOURCE > 1
1040 + && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
1041 +# if !__GNUC_PREREQ (4, 1)
1042 +# ifdef __GNUC_RH_RELEASE__
1043 +# warning _FORTIFY_SOURCE supported only with GCC 4.1 and later
1044 +# endif
1045 +# define __USE_FORTIFY_LEVEL 0
1046 +# elif _FORTIFY_SOURCE > 1
1047 # define __USE_FORTIFY_LEVEL 2
1048 # else
1049 # define __USE_FORTIFY_LEVEL 1
1050 diff -Nrup a/include/libc-symbols.h b/include/libc-symbols.h
1051 --- a/include/libc-symbols.h 2012-01-01 05:16:32.000000000 -0700
1052 +++ b/include/libc-symbols.h 2012-01-01 20:41:26.645439841 -0700
1053 @@ -626,7 +626,7 @@ for linking")
1054 # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
1055 # define libc_hidden_def(name) hidden_def (name)
1056 # define libc_hidden_weak(name) hidden_weak (name)
1057 -# define libc_hidden_nolink(name, version) hidden_nolink (name, libc, version)
1058 +# define libc_hidden_nolink(name, version) hidden_def (name)
1059 # define libc_hidden_ver(local, name) hidden_ver (local, name)
1060 # define libc_hidden_data_def(name) hidden_data_def (name)
1061 # define libc_hidden_data_weak(name) hidden_data_weak (name)
1062 diff -Nrup a/include/link.h b/include/link.h
1063 --- a/include/link.h 2012-01-01 05:16:32.000000000 -0700
1064 +++ b/include/link.h 2012-01-01 20:41:26.646439841 -0700
1065 @@ -1,6 +1,6 @@
1066 /* Data structure for communication from the run-time dynamic linker for
1067 loaded ELF shared objects.
1068 - Copyright (C) 1995-2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
1069 + Copyright (C) 1995-2006, 2007, 2009, 2010 Free Software Foundation, Inc.
1070 This file is part of the GNU C Library.
1071
1072 The GNU C Library is free software; you can redistribute it and/or
1073 @@ -192,6 +192,9 @@ struct link_map
1074 during LD_TRACE_PRELINKING=1
1075 contains any DT_SYMBOLIC
1076 libraries. */
1077 + unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be
1078 + freed, ie. not allocated with
1079 + the dummy malloc in ld.so. */
1080
1081 /* Collected information about own RPATH directories. */
1082 struct r_search_path_struct l_rpath_dirs;
1083 @@ -240,9 +243,6 @@ struct link_map
1084
1085 /* List of object in order of the init and fini calls. */
1086 struct link_map **l_initfini;
1087 - /* The init and fini list generated at startup, saved when the
1088 - object is also loaded dynamically. */
1089 - struct link_map **l_orig_initfini;
1090
1091 /* List of the dependencies introduced through symbol binding. */
1092 struct link_map_reldeps
1093 @@ -290,7 +290,7 @@ struct link_map
1094 #endif
1095 #ifndef FORCED_DYNAMIC_TLS_OFFSET
1096 # if NO_TLS_OFFSET == 0
1097 -# define FORCED_DYNAMIC_TLS_OFFSET 1
1098 +# define FORCED_DYNAMIC_TLS_OFFSET -1
1099 # elif NO_TLS_OFFSET == -1
1100 # define FORCED_DYNAMIC_TLS_OFFSET -2
1101 # else
1102 diff -Nrup a/include/stap-probe.h b/include/stap-probe.h
1103 --- a/include/stap-probe.h 1969-12-31 17:00:00.000000000 -0700
1104 +++ b/include/stap-probe.h 2012-01-01 20:41:26.646439841 -0700
1105 @@ -0,0 +1,140 @@
1106 +/* Macros for defining Systemtap <sys/sdt.h> static probe points.
1107 + Copyright (C) 2011 Free Software Foundation, Inc.
1108 + This file is part of the GNU C Library.
1109 +
1110 + The GNU C Library is free software; you can redistribute it and/or
1111 + modify it under the terms of the GNU Lesser General Public
1112 + License as published by the Free Software Foundation; either
1113 + version 2.1 of the License, or (at your option) any later version.
1114 +
1115 + The GNU C Library is distributed in the hope that it will be useful,
1116 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1117 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1118 + Lesser General Public License for more details.
1119 +
1120 + You should have received a copy of the GNU Lesser General Public
1121 + License along with the GNU C Library; if not, write to the Free
1122 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1123 + 02111-1307 USA. */
1124 +
1125 +#ifndef _STAP_PROBE_H
1126 +#define _STAP_PROBE_H 1
1127 +
1128 +#ifdef USE_STAP_PROBE
1129 +
1130 +# include <sys/sdt.h>
1131 +
1132 +/* Our code uses one macro LIBC_PROBE (name, n, arg1, ..., argn).
1133 +
1134 + Without USE_STAP_PROBE, that does nothing but evaluates all
1135 + its arguments (to prevent bit rot, unlike e.g. assert).
1136 +
1137 + Systemtap's header defines the macros STAP_PROBE (provider, name) and
1138 + STAP_PROBEn (provider, name, arg1, ..., argn). For "provider" we paste
1139 + in the IN_LIB name (libc, libpthread, etc.) automagically. */
1140 +
1141 +# ifndef NOT_IN_libc
1142 +# define IN_LIB libc
1143 +# elif !defined IN_LIB
1144 +/* This is intentionally defined with extra unquoted commas in it so
1145 + that macro substitution will bomb out when it is used. We don't
1146 + just use #error here, so that this header can be included by
1147 + other headers that use LIBC_PROBE inside their own macros. We
1148 + only want such headers to fail to compile if those macros are
1149 + actually used in a context where IN_LIB has not been defined. */
1150 +# define IN_LIB ,,,missing -DIN_LIB=... -- not extra-lib.mk?,,,
1151 +# endif
1152 +
1153 +# define LIBC_PROBE(name, n, ...) \
1154 + LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
1155 +
1156 +# define LIBC_PROBE_1(lib, name, n, ...) \
1157 + STAP_PROBE##n (lib, name, ## __VA_ARGS__)
1158 +
1159 +# define STAP_PROBE0 STAP_PROBE
1160 +
1161 +# define LIBC_PROBE_ASM(name, template) \
1162 + STAP_PROBE_ASM (IN_LIB, name, template)
1163 +
1164 +# define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
1165 +
1166 +#else /* Not USE_STAP_PROBE. */
1167 +
1168 +# ifndef __ASSEMBLER__
1169 +# define LIBC_PROBE(name, n, ...) DUMMY_PROBE##n (__VA_ARGS__)
1170 +# else
1171 +# define LIBC_PROBE(name, n, ...) /* Nothing. */
1172 +# endif
1173 +
1174 +# define LIBC_PROBE_ASM(name, template) /* Nothing. */
1175 +# define LIBC_PROBE_ASM_OPERANDS(n, ...) /* Nothing. */
1176 +
1177 +/* This silliness lets us evaluate all the arguments for each arity
1178 + of probe. My kingdom for a real macro system. */
1179 +
1180 +# define DUMMY_PROBE0() do {} while (0)
1181 +# define DUMMY_PROBE1(a1) do {} while ((void) (a1), 0)
1182 +# define DUMMY_PROBE2(a1, a2) do {} while ((void) (a1), \
1183 + (void) (a2), 0)
1184 +# define DUMMY_PROBE3(a1, a2, a3) do {} while ((void) (a1), \
1185 + (void) (a2), \
1186 + (void) (a3), 0)
1187 +# define DUMMY_PROBE4(a1, a2, a3, a4) do {} while ((void) (a1), \
1188 + (void) (a2), \
1189 + (void) (a3), \
1190 + (void) (a4), 0)
1191 +# define DUMMY_PROBE5(a1, a2, a3, a4, a5) \
1192 + do {} while ((void) (a1), \
1193 + (void) (a2), \
1194 + (void) (a3), \
1195 + (void) (a4), \
1196 + (void) (a5), 0)
1197 +# define DUMMY_PROBE6(a1, a2, a3, a4, a5, a6) \
1198 + do {} while ((void) (a1), \
1199 + (void) (a2), \
1200 + (void) (a3), \
1201 + (void) (a4), \
1202 + (void) (a5), \
1203 + (void) (a6), 0)
1204 +# define DUMMY_PROBE7(a1, a2, a3, a4, a5, a6, a7) \
1205 + do {} while ((void) (a1), \
1206 + (void) (a2), \
1207 + (void) (a3), \
1208 + (void) (a4), \
1209 + (void) (a5), \
1210 + (void) (a6), \
1211 + (void) (a7), 0)
1212 +# define DUMMY_PROBE8(a1, a2, a3, a4, a5, a6, a7, a8) \
1213 + do {} while ((void) (a1), \
1214 + (void) (a2), \
1215 + (void) (a3), \
1216 + (void) (a4), \
1217 + (void) (a5), \
1218 + (void) (a6), \
1219 + (void) (a7), \
1220 + (void) (a8), 0)
1221 +# define DUMMY_PROBE9(a1, a2, a3, a4, a5, a6, a7, a8, a9) \
1222 + do {} while ((void) (a1), \
1223 + (void) (a2), \
1224 + (void) (a3), \
1225 + (void) (a4), \
1226 + (void) (a5), \
1227 + (void) (a6), \
1228 + (void) (a7), \
1229 + (void) (a8), \
1230 + (void) (a9), 0)
1231 +# define DUMMY_PROBE10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) \
1232 + do {} while ((void) (a1), \
1233 + (void) (a2), \
1234 + (void) (a3), \
1235 + (void) (a4), \
1236 + (void) (a5), \
1237 + (void) (a6), \
1238 + (void) (a7), \
1239 + (void) (a8), \
1240 + (void) (a9), \
1241 + (void) (a10), 0)
1242 +
1243 +#endif /* USE_STAP_PROBE. */
1244 +
1245 +#endif /* stap-probe.h */
1246 diff -Nrup a/include/sys/resource.h b/include/sys/resource.h
1247 --- a/include/sys/resource.h 2012-01-01 05:16:32.000000000 -0700
1248 +++ b/include/sys/resource.h 2012-01-01 20:41:26.647439841 -0700
1249 @@ -13,4 +13,5 @@ extern int __getrusage (enum __rusage_wh
1250
1251 extern int __setrlimit (enum __rlimit_resource __resource,
1252 const struct rlimit *__rlimits);
1253 +libc_hidden_proto (__getrlimit)
1254 #endif
1255 diff -Nrup a/inet/Makefile b/inet/Makefile
1256 --- a/inet/Makefile 2012-01-01 05:16:32.000000000 -0700
1257 +++ b/inet/Makefile 2012-01-01 20:41:26.647439841 -0700
1258 @@ -57,6 +57,8 @@ tests := htontest test_ifindex tst-ntoa
1259
1260 include ../Rules
1261
1262 +CFLAGS-tst-inet6_rth.c += -fno-strict-aliasing
1263 +
1264 ifeq ($(have-thread-library),yes)
1265
1266 CFLAGS-gethstbyad_r.c = -DUSE_NSCD=1 -fexceptions
1267 diff -Nrup a/intl/locale.alias b/intl/locale.alias
1268 --- a/intl/locale.alias 2012-01-01 05:16:32.000000000 -0700
1269 +++ b/intl/locale.alias 2012-01-01 20:41:26.647439841 -0700
1270 @@ -57,8 +57,6 @@ korean ko_KR.eucKR
1271 korean.euc ko_KR.eucKR
1272 ko_KR ko_KR.eucKR
1273 lithuanian lt_LT.ISO-8859-13
1274 -no_NO nb_NO.ISO-8859-1
1275 -no_NO.ISO-8859-1 nb_NO.ISO-8859-1
1276 norwegian nb_NO.ISO-8859-1
1277 nynorsk nn_NO.ISO-8859-1
1278 polish pl_PL.ISO-8859-2
1279 diff -Nrup a/libio/stdio.h b/libio/stdio.h
1280 --- a/libio/stdio.h 2012-01-01 05:16:32.000000000 -0700
1281 +++ b/libio/stdio.h 2012-01-01 20:41:26.648439841 -0700
1282 @@ -169,10 +169,12 @@ typedef _G_fpos64_t fpos64_t;
1283 extern struct _IO_FILE *stdin; /* Standard input stream. */
1284 extern struct _IO_FILE *stdout; /* Standard output stream. */
1285 extern struct _IO_FILE *stderr; /* Standard error output stream. */
1286 +#ifdef __STDC__
1287 /* C89/C99 say they're macros. Make them happy. */
1288 #define stdin stdin
1289 #define stdout stdout
1290 #define stderr stderr
1291 +#endif
1292
1293 __BEGIN_NAMESPACE_STD
1294 /* Remove file FILENAME. */
1295 diff -Nrup a/locale/iso-4217.def b/locale/iso-4217.def
1296 --- a/locale/iso-4217.def 2012-01-01 05:16:32.000000000 -0700
1297 +++ b/locale/iso-4217.def 2012-01-01 20:41:26.649439841 -0700
1298 @@ -8,6 +8,7 @@
1299 *
1300 * !!! The list has to be sorted !!!
1301 */
1302 +DEFINE_INT_CURR("ADP") /* Andorran Peseta -> EUR */
1303 DEFINE_INT_CURR("AED") /* United Arab Emirates Dirham */
1304 DEFINE_INT_CURR("AFN") /* Afghanistan Afgani */
1305 DEFINE_INT_CURR("ALL") /* Albanian Lek */
1306 @@ -15,12 +16,14 @@ DEFINE_INT_CURR("AMD") /* Armenia Dram
1307 DEFINE_INT_CURR("ANG") /* Netherlands Antilles */
1308 DEFINE_INT_CURR("AOA") /* Angolan Kwanza */
1309 DEFINE_INT_CURR("ARS") /* Argentine Peso */
1310 +DEFINE_INT_CURR("ATS") /* Austrian Schilling -> EUR */
1311 DEFINE_INT_CURR("AUD") /* Australian Dollar */
1312 DEFINE_INT_CURR("AWG") /* Aruba Guilder */
1313 DEFINE_INT_CURR("AZM") /* Azerbaijan Manat */
1314 DEFINE_INT_CURR("BAM") /* Bosnian and Herzegovina Convertible Mark */
1315 DEFINE_INT_CURR("BBD") /* Barbados Dollar */
1316 DEFINE_INT_CURR("BDT") /* Bangladesh Taka */
1317 +DEFINE_INT_CURR("BEF") /* Belgian Franc -> EUR */
1318 DEFINE_INT_CURR("BGN") /* Bulgarian Lev */
1319 DEFINE_INT_CURR("BHD") /* Bahraini Dinar */
1320 DEFINE_INT_CURR("BIF") /* Burundi Franc */
1321 @@ -44,6 +47,7 @@ DEFINE_INT_CURR("CUP") /* Cuban Peso *
1322 DEFINE_INT_CURR("CVE") /* Cape Verde Escudo */
1323 DEFINE_INT_CURR("CYP") /* Cypriot Pound */
1324 DEFINE_INT_CURR("CZK") /* Czech Koruna */
1325 +DEFINE_INT_CURR("DEM") /* German Mark -> EUR */
1326 DEFINE_INT_CURR("DJF") /* Djibouti Franc */
1327 DEFINE_INT_CURR("DKK") /* Danish Krone (Faroe Islands, Greenland) */
1328 DEFINE_INT_CURR("DOP") /* Dominican Republic */
1329 @@ -51,16 +55,20 @@ DEFINE_INT_CURR("DZD") /* Algerian Dina
1330 DEFINE_INT_CURR("EEK") /* Estonian Kroon */
1331 DEFINE_INT_CURR("EGP") /* Egyptian Pound */
1332 DEFINE_INT_CURR("ERN") /* Eritrean Nakfa */
1333 +DEFINE_INT_CURR("ESP") /* Spanish Peseta -> EUR */
1334 DEFINE_INT_CURR("ETB") /* Ethiopian Birr */
1335 DEFINE_INT_CURR("EUR") /* European Union Euro */
1336 +DEFINE_INT_CURR("FIM") /* Finnish Markka -> EUR */
1337 DEFINE_INT_CURR("FJD") /* Fiji Dollar */
1338 DEFINE_INT_CURR("FKP") /* Falkland Islands Pound (Malvinas) */
1339 +DEFINE_INT_CURR("FRF") /* French Franc -> EUR */
1340 DEFINE_INT_CURR("GBP") /* British Pound */
1341 DEFINE_INT_CURR("GEL") /* Georgia Lari */
1342 DEFINE_INT_CURR("GHC") /* Ghana Cedi */
1343 DEFINE_INT_CURR("GIP") /* Gibraltar Pound */
1344 DEFINE_INT_CURR("GMD") /* Gambian Dalasi */
1345 DEFINE_INT_CURR("GNF") /* Guinea Franc */
1346 +DEFINE_INT_CURR("GRD") /* Greek Drachma -> EUR */
1347 DEFINE_INT_CURR("GTQ") /* Guatemala Quetzal */
1348 DEFINE_INT_CURR("GYD") /* Guyana Dollar */
1349 DEFINE_INT_CURR("HKD") /* Hong Kong Dollar */
1350 @@ -69,12 +77,14 @@ DEFINE_INT_CURR("HRK") /* Croatia Kuna
1351 DEFINE_INT_CURR("HTG") /* Haiti Gourde */
1352 DEFINE_INT_CURR("HUF") /* Hungarian Forint */
1353 DEFINE_INT_CURR("IDR") /* Indonesia Rupiah */
1354 +DEFINE_INT_CURR("IEP") /* Irish Pound -> EUR */
1355 DEFINE_INT_CURR("ILS") /* Israeli Shekel */
1356 DEFINE_INT_CURR("IMP") /* Isle of Man Pounds */
1357 DEFINE_INT_CURR("INR") /* Indian Rupee (Bhutan) */
1358 DEFINE_INT_CURR("IQD") /* Iraqi Dinar */
1359 DEFINE_INT_CURR("IRR") /* Iranian Rial */
1360 DEFINE_INT_CURR("ISK") /* Iceland Krona */
1361 +DEFINE_INT_CURR("ITL") /* Italian Lira -> EUR */
1362 DEFINE_INT_CURR("JEP") /* Jersey Pound */
1363 DEFINE_INT_CURR("JMD") /* Jamaican Dollar */
1364 DEFINE_INT_CURR("JOD") /* Jordanian Dinar */
1365 @@ -94,6 +104,7 @@ DEFINE_INT_CURR("LKR") /* Sri Lankan Ru
1366 DEFINE_INT_CURR("LRD") /* Liberian Dollar */
1367 DEFINE_INT_CURR("LSL") /* Lesotho Maloti */
1368 DEFINE_INT_CURR("LTL") /* Lithuanian Litas */
1369 +DEFINE_INT_CURR("LUF") /* Luxembourg Franc -> EUR */
1370 DEFINE_INT_CURR("LVL") /* Latvia Lat */
1371 DEFINE_INT_CURR("LYD") /* Libyan Arab Jamahiriya Dinar */
1372 DEFINE_INT_CURR("MAD") /* Moroccan Dirham */
1373 @@ -114,6 +125,7 @@ DEFINE_INT_CURR("MZM") /* Mozambique Me
1374 DEFINE_INT_CURR("NAD") /* Namibia Dollar */
1375 DEFINE_INT_CURR("NGN") /* Nigeria Naira */
1376 DEFINE_INT_CURR("NIO") /* Nicaragua Cordoba Oro */
1377 +DEFINE_INT_CURR("NLG") /* Netherlands Guilder -> EUR */
1378 DEFINE_INT_CURR("NOK") /* Norwegian Krone */
1379 DEFINE_INT_CURR("NPR") /* Nepalese Rupee */
1380 DEFINE_INT_CURR("NZD") /* New Zealand Dollar */
1381 @@ -124,6 +136,7 @@ DEFINE_INT_CURR("PGK") /* Papau New Gui
1382 DEFINE_INT_CURR("PHP") /* Philippines Peso */
1383 DEFINE_INT_CURR("PKR") /* Pakistan Rupee */
1384 DEFINE_INT_CURR("PLN") /* Polish Zloty */
1385 +DEFINE_INT_CURR("PTE") /* Portugese Escudo -> EUR */
1386 DEFINE_INT_CURR("PYG") /* Paraguay Guarani */
1387 DEFINE_INT_CURR("QAR") /* Qatar Rial */
1388 DEFINE_INT_CURR("ROL") /* Romanian Leu */
1389 diff -Nrup a/locale/programs/locarchive.c b/locale/programs/locarchive.c
1390 --- a/locale/programs/locarchive.c 2012-01-01 05:16:32.000000000 -0700
1391 +++ b/locale/programs/locarchive.c 2012-01-01 20:41:26.649439841 -0700
1392 @@ -253,9 +253,9 @@ oldlocrecentcmp (const void *a, const vo
1393 /* forward decls for below */
1394 static uint32_t add_locale (struct locarhandle *ah, const char *name,
1395 locale_data_t data, bool replace);
1396 -static void add_alias (struct locarhandle *ah, const char *alias,
1397 - bool replace, const char *oldname,
1398 - uint32_t *locrec_offset_p);
1399 +void add_alias (struct locarhandle *ah, const char *alias,
1400 + bool replace, const char *oldname,
1401 + uint32_t *locrec_offset_p);
1402
1403
1404 static bool
1405 @@ -636,7 +636,7 @@ close_archive (struct locarhandle *ah)
1406 #include "../../intl/explodename.c"
1407 #include "../../intl/l10nflist.c"
1408
1409 -static struct namehashent *
1410 +struct namehashent *
1411 insert_name (struct locarhandle *ah,
1412 const char *name, size_t name_len, bool replace)
1413 {
1414 @@ -694,7 +694,7 @@ insert_name (struct locarhandle *ah,
1415 return &namehashtab[idx];
1416 }
1417
1418 -static void
1419 +void
1420 add_alias (struct locarhandle *ah, const char *alias, bool replace,
1421 const char *oldname, uint32_t *locrec_offset_p)
1422 {
1423 diff -Nrup a/localedata/ChangeLog b/localedata/ChangeLog
1424 --- a/localedata/ChangeLog 2012-01-01 05:16:32.000000000 -0700
1425 +++ b/localedata/ChangeLog 2012-01-01 20:41:26.651439841 -0700
1426 @@ -90,6 +90,14 @@
1427 * tests-mbwc/tst_funcs.h (TST_DECL_VARS, TST_HEAD_LOCALE):
1428 Remove unused variable.
1429
1430 +2011-06-28 Andreas Schwab <schwab@redhat.com>
1431 +
1432 + * charmaps/GB18030: Correct some entries.
1433 +
1434 +2011-06-21 Andreas Schwab <schwab@redhat.com>
1435 +
1436 + * charmaps/GB18030: Readd lost characters.
1437 +
1438 2011-05-21 Ulrich Drepper <drepper@gmail.com>
1439
1440 [BZ #12788]
1441 diff -Nrup a/localedata/Makefile b/localedata/Makefile
1442 --- a/localedata/Makefile 2012-01-01 05:16:32.000000000 -0700
1443 +++ b/localedata/Makefile 2012-01-01 20:41:26.652439840 -0700
1444 @@ -224,6 +224,7 @@ $(INSTALL-SUPPORTED-LOCALES): install-lo
1445 echo -n '...'; \
1446 input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
1447 $(LOCALEDEF) --alias-file=../intl/locale.alias \
1448 + --no-archive \
1449 -i locales/$$input -c -f charmaps/$$charset \
1450 $(addprefix --prefix=,$(install_root)) $$locale; \
1451 echo ' done'; \
1452 diff -Nrup a/localedata/SUPPORTED b/localedata/SUPPORTED
1453 --- a/localedata/SUPPORTED 2012-01-01 05:16:32.000000000 -0700
1454 +++ b/localedata/SUPPORTED 2012-01-01 20:41:26.652439840 -0700
1455 @@ -88,6 +88,7 @@ cy_GB.UTF-8/UTF-8 \
1456 cy_GB/ISO-8859-14 \
1457 da_DK.UTF-8/UTF-8 \
1458 da_DK/ISO-8859-1 \
1459 +da_DK.ISO-8859-15/ISO-8859-15 \
1460 de_AT.UTF-8/UTF-8 \
1461 de_AT/ISO-8859-1 \
1462 de_AT@euro/ISO-8859-15 \
1463 @@ -119,6 +120,7 @@ en_DK.UTF-8/UTF-8 \
1464 en_DK/ISO-8859-1 \
1465 en_GB.UTF-8/UTF-8 \
1466 en_GB/ISO-8859-1 \
1467 +en_GB.ISO-8859-15/ISO-8859-15 \
1468 en_HK.UTF-8/UTF-8 \
1469 en_HK/ISO-8859-1 \
1470 en_IE.UTF-8/UTF-8 \
1471 @@ -134,6 +136,7 @@ en_SG.UTF-8/UTF-8 \
1472 en_SG/ISO-8859-1 \
1473 en_US.UTF-8/UTF-8 \
1474 en_US/ISO-8859-1 \
1475 +en_US.ISO-8859-15/ISO-8859-15 \
1476 en_ZA.UTF-8/UTF-8 \
1477 en_ZA/ISO-8859-1 \
1478 en_ZM/UTF-8 \
1479 @@ -316,6 +319,8 @@ nl_NL/ISO-8859-1 \
1480 nl_NL@euro/ISO-8859-15 \
1481 nn_NO.UTF-8/UTF-8 \
1482 nn_NO/ISO-8859-1 \
1483 +no_NO.UTF-8/UTF-8 \
1484 +no_NO/ISO-8859-1 \
1485 nr_ZA/UTF-8 \
1486 nso_ZA/UTF-8 \
1487 oc_FR.UTF-8/UTF-8 \
1488 @@ -377,6 +382,7 @@ sv_FI/ISO-8859-1 \
1489 sv_FI@euro/ISO-8859-15 \
1490 sv_SE.UTF-8/UTF-8 \
1491 sv_SE/ISO-8859-1 \
1492 +sv_SE.ISO-8859-15/ISO-8859-15 \
1493 sw_KE/UTF-8 \
1494 sw_TZ/UTF-8 \
1495 ta_IN/UTF-8 \
1496 diff -Nrup a/localedata/locales/cy_GB b/localedata/locales/cy_GB
1497 --- a/localedata/locales/cy_GB 2012-01-01 05:16:32.000000000 -0700
1498 +++ b/localedata/locales/cy_GB 2012-01-01 20:41:26.653439839 -0700
1499 @@ -248,8 +248,11 @@ mon "<U0049><U006F><U006E><U0061
1500 d_t_fmt "<U0044><U0079><U0064><U0064><U0020><U0025><U0041><U0020><U0025><U0064><U0020><U006d><U0069><U0073><U0020><U0025><U0042><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
1501 d_fmt "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0079>"
1502 t_fmt "<U0025><U0054>"
1503 -am_pm "";""
1504 -t_fmt_ampm ""
1505 +am_pm "<U0041><U004D>";"<U0050><U004D>"
1506 +t_fmt_ampm "<U0025><U006C><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0050><U0020><U0025><U005A>"
1507 +date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
1508 +<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
1509 +<U0025><U005A><U0020><U0025><U0059>"
1510 END LC_TIME
1511
1512 LC_MESSAGES
1513 diff -Nrup a/localedata/locales/en_GB b/localedata/locales/en_GB
1514 --- a/localedata/locales/en_GB 2012-01-01 05:16:32.000000000 -0700
1515 +++ b/localedata/locales/en_GB 2012-01-01 20:41:26.653439839 -0700
1516 @@ -116,8 +116,8 @@ mon "<U004A><U0061><U006E><U0075
1517 d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
1518 d_fmt "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0079>"
1519 t_fmt "<U0025><U0054>"
1520 -am_pm "";""
1521 -t_fmt_ampm ""
1522 +am_pm "<U0041><U004D>";"<U0050><U004D>"
1523 +t_fmt_ampm "<U0025><U006C><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0050><U0020><U0025><U005A>"
1524 date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
1525 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
1526 <U0025><U005A><U0020><U0025><U0059>"
1527 diff -Nrup a/localedata/locales/no_NO b/localedata/locales/no_NO
1528 --- a/localedata/locales/no_NO 1969-12-31 17:00:00.000000000 -0700
1529 +++ b/localedata/locales/no_NO 2012-01-01 20:41:26.653439839 -0700
1530 @@ -0,0 +1,69 @@
1531 +escape_char /
1532 +comment_char %
1533 +
1534 +% Norwegian language locale for Norway
1535 +% Source: Norsk Standardiseringsforbund
1536 +% Address: University Library,
1537 +% Drammensveien 41, N-9242 Oslo, Norge
1538 +% Contact: Kolbjoern Aamboe
1539 +% Tel: +47 - 22859109
1540 +% Fax: +47 - 22434497
1541 +% Email: kolbjorn.aambo@usit.uio.no
1542 +% Language: no
1543 +% Territory: NO
1544 +% Revision: 4.3
1545 +% Date: 1996-10-15
1546 +% Application: general
1547 +% Users: general
1548 +% Repertoiremap: mnemonic.ds
1549 +% Charset: ISO-8859-1
1550 +% Distribution and use is free, also
1551 +% for commercial purposes.
1552 +
1553 +LC_IDENTIFICATION
1554 +copy "nb_NO"
1555 +END LC_IDENTIFICATION
1556 +
1557 +LC_COLLATE
1558 +copy "nb_NO"
1559 +END LC_COLLATE
1560 +
1561 +LC_CTYPE
1562 +copy "nb_NO"
1563 +END LC_CTYPE
1564 +
1565 +LC_MONETARY
1566 +copy "nb_NO"
1567 +END LC_MONETARY
1568 +
1569 +LC_NUMERIC
1570 +copy "nb_NO"
1571 +END LC_NUMERIC
1572 +
1573 +LC_TIME
1574 +copy "nb_NO"
1575 +END LC_TIME
1576 +
1577 +LC_MESSAGES
1578 +copy "nb_NO"
1579 +END LC_MESSAGES
1580 +
1581 +LC_PAPER
1582 +copy "nb_NO"
1583 +END LC_PAPER
1584 +
1585 +LC_TELEPHONE
1586 +copy "nb_NO"
1587 +END LC_TELEPHONE
1588 +
1589 +LC_MEASUREMENT
1590 +copy "nb_NO"
1591 +END LC_MEASUREMENT
1592 +
1593 +LC_NAME
1594 +copy "nb_NO"
1595 +END LC_NAME
1596 +
1597 +LC_ADDRESS
1598 +copy "nb_NO"
1599 +END LC_ADDRESS
1600 diff -Nrup a/localedata/locales/zh_TW b/localedata/locales/zh_TW
1601 --- a/localedata/locales/zh_TW 2012-01-01 05:16:32.000000000 -0700
1602 +++ b/localedata/locales/zh_TW 2012-01-01 20:41:26.653439839 -0700
1603 @@ -1,7 +1,7 @@
1604 comment_char %
1605 escape_char /
1606 %
1607 -% Chinese language locale for Taiwan R.O.C.
1608 +% Chinese language locale for Taiwan
1609 % charmap: BIG5-CP950
1610 %
1611 % Original Author:
1612 @@ -17,7 +17,7 @@ escape_char /
1613 % Reference: http://wwwold.dkuug.dk/JTC1/SC22/WG20/docs/n690.pdf
1614
1615 LC_IDENTIFICATION
1616 -title "Chinese locale for Taiwan R.O.C."
1617 +title "Chinese locale for Taiwan"
1618 source ""
1619 address ""
1620 contact ""
1621 @@ -25,7 +25,7 @@ email "bug-glibc-locales@gnu.org"
1622 tel ""
1623 fax ""
1624 language "Chinese"
1625 -territory "Taiwan R.O.C."
1626 +territory "Taiwan"
1627 revision "0.2"
1628 date "2000-08-02"
1629 %
1630 diff -Nrup a/login/programs/pt_chown.c b/login/programs/pt_chown.c
1631 --- a/login/programs/pt_chown.c 2012-01-01 05:16:32.000000000 -0700
1632 +++ b/login/programs/pt_chown.c 2012-01-01 20:41:26.654439839 -0700
1633 @@ -29,6 +29,7 @@
1634 #include <string.h>
1635 #include <sys/stat.h>
1636 #include <unistd.h>
1637 +#include <fcntl.h>
1638 #ifdef HAVE_LIBCAP
1639 # include <sys/capability.h>
1640 # include <sys/prctl.h>
1641 @@ -143,7 +144,7 @@ main (int argc, char *argv[])
1642 uid_t uid = getuid ();
1643 int remaining;
1644
1645 - if (argc == 1 && euid == 0)
1646 + if (argc == 1 && fcntl (PTY_FILENO, F_GETFD) == 0)
1647 {
1648 #ifdef HAVE_LIBCAP
1649 /* Drop privileges. */
1650 @@ -176,6 +177,13 @@ main (int argc, char *argv[])
1651
1652 /* We aren't going to be using privileges, so drop them right now. */
1653 setuid (uid);
1654 +#ifdef HAVE_LIBCAP
1655 + cap_t caps = cap_init ();
1656 + if (caps == NULL)
1657 + error (1, errno, "cap_init");
1658 + cap_set_proc (caps);
1659 + cap_free (caps);
1660 +#endif
1661
1662 /* Set locale via LC_ALL. */
1663 setlocale (LC_ALL, "");
1664 @@ -195,9 +203,5 @@ main (int argc, char *argv[])
1665 return EXIT_FAILURE;
1666 }
1667
1668 - /* Check if we are properly installed. */
1669 - if (euid != 0)
1670 - error (FAIL_EXEC, 0, gettext ("needs to be installed setuid `root'"));
1671 -
1672 return EXIT_SUCCESS;
1673 }
1674 diff -Nrup a/malloc/mcheck.c b/malloc/mcheck.c
1675 --- a/malloc/mcheck.c 2012-01-01 05:16:32.000000000 -0700
1676 +++ b/malloc/mcheck.c 2012-01-01 20:41:26.654439839 -0700
1677 @@ -25,10 +25,26 @@
1678 # include <mcheck.h>
1679 # include <stdint.h>
1680 # include <stdio.h>
1681 +# include <stdlib.h>
1682 # include <libintl.h>
1683 # include <errno.h>
1684 #endif
1685
1686 +#ifdef _LIBC
1687 +extern __typeof (malloc) __libc_malloc;
1688 +extern __typeof (free) __libc_free;
1689 +extern __typeof (realloc) __libc_realloc;
1690 +libc_hidden_proto (__libc_malloc)
1691 +libc_hidden_proto (__libc_realloc)
1692 +libc_hidden_proto (__libc_free)
1693 +libc_hidden_proto (__libc_memalign)
1694 +#else
1695 +# define __libc_malloc(sz) malloc (sz)
1696 +# define __libc_free(ptr) free (ptr)
1697 +# define __libc_realloc(ptr, sz) realloc (ptr, sz)
1698 +# define __libc_memalign(al, sz) memalign (al, sz)
1699 +#endif
1700 +
1701 /* Old hook values. */
1702 static void (*old_free_hook) (__ptr_t ptr, __const __ptr_t);
1703 static __ptr_t (*old_malloc_hook) (__malloc_size_t size, const __ptr_t);
1704 @@ -199,7 +215,7 @@ freehook (__ptr_t ptr, const __ptr_t cal
1705 if (old_free_hook != NULL)
1706 (*old_free_hook) (ptr, caller);
1707 else
1708 - free (ptr);
1709 + __libc_free (ptr);
1710 __free_hook = freehook;
1711 }
1712
1713 @@ -222,7 +238,7 @@ mallochook (__malloc_size_t size, const
1714 hdr = (struct hdr *) (*old_malloc_hook) (sizeof (struct hdr) + size + 1,
1715 caller);
1716 else
1717 - hdr = (struct hdr *) malloc (sizeof (struct hdr) + size + 1);
1718 + hdr = (struct hdr *) __libc_malloc (sizeof (struct hdr) + size + 1);
1719 __malloc_hook = mallochook;
1720 if (hdr == NULL)
1721 return NULL;
1722 @@ -259,7 +275,7 @@ memalignhook (__malloc_size_t alignment,
1723 if (old_memalign_hook != NULL)
1724 block = (*old_memalign_hook) (alignment, slop + size + 1, caller);
1725 else
1726 - block = memalign (alignment, slop + size + 1);
1727 + block = __libc_memalign (alignment, slop + size + 1);
1728 __memalign_hook = memalignhook;
1729 if (block == NULL)
1730 return NULL;
1731 @@ -320,8 +336,8 @@ reallochook (__ptr_t ptr, __malloc_size_
1732 sizeof (struct hdr) + size + 1,
1733 caller);
1734 else
1735 - hdr = (struct hdr *) realloc ((__ptr_t) hdr,
1736 - sizeof (struct hdr) + size + 1);
1737 + hdr = (struct hdr *) __libc_realloc ((__ptr_t) hdr,
1738 + sizeof (struct hdr) + size + 1);
1739 __free_hook = freehook;
1740 __malloc_hook = mallochook;
1741 __memalign_hook = memalignhook;
1742 @@ -381,8 +397,8 @@ mcheck (func)
1743 if (__malloc_initialized <= 0 && !mcheck_used)
1744 {
1745 /* We call malloc() once here to ensure it is initialized. */
1746 - void *p = malloc (0);
1747 - free (p);
1748 + void *p = __libc_malloc (0);
1749 + __libc_free (p);
1750
1751 old_free_hook = __free_hook;
1752 __free_hook = freehook;
1753 diff -Nrup a/manual/libc.texinfo b/manual/libc.texinfo
1754 --- a/manual/libc.texinfo 2012-01-01 05:16:32.000000000 -0700
1755 +++ b/manual/libc.texinfo 2012-01-01 20:41:26.655439839 -0700
1756 @@ -5,7 +5,7 @@
1757 @c setchapternewpage odd
1758
1759 @comment Tell install-info what to do.
1760 -@dircategory Software libraries
1761 +@dircategory Libraries
1762 @direntry
1763 * Libc: (libc). C library.
1764 @end direntry
1765 diff -Nrup a/misc/sys/cdefs.h b/misc/sys/cdefs.h
1766 --- a/misc/sys/cdefs.h 2012-01-01 05:16:32.000000000 -0700
1767 +++ b/misc/sys/cdefs.h 2012-01-01 20:41:26.655439839 -0700
1768 @@ -146,7 +146,10 @@
1769 #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
1770 #define __bos0(ptr) __builtin_object_size (ptr, 0)
1771
1772 -#if __GNUC_PREREQ (4,3)
1773 +#if __GNUC_PREREQ (4,3) \
1774 + || (defined __GNUC_RH_RELEASE__ && __GNUC__ == 4 \
1775 + && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ == 2 \
1776 + && __GNUC_RH_RELEASE__ >= 31)
1777 # define __warndecl(name, msg) \
1778 extern void name (void) __attribute__((__warning__ (msg)))
1779 # define __warnattr(msg) __attribute__((__warning__ (msg)))
1780 @@ -316,10 +319,16 @@
1781
1782 /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
1783 inline semantics, unless -fgnu89-inline is used. */
1784 -#if !defined __cplusplus || __GNUC_PREREQ (4,3)
1785 +#if !defined __cplusplus || __GNUC_PREREQ (4,3) \
1786 + || (defined __GNUC_RH_RELEASE__ && __GNUC__ == 4 \
1787 + && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ == 2 \
1788 + && __GNUC_RH_RELEASE__ >= 31)
1789 # if defined __GNUC_STDC_INLINE__ || defined __cplusplus
1790 # define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
1791 -# if __GNUC_PREREQ (4,3)
1792 +# if __GNUC_PREREQ (4,3) \
1793 + || (defined __GNUC_RH_RELEASE__ && __GNUC__ == 4 \
1794 + && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ == 2 \
1795 + && __GNUC_RH_RELEASE__ >= 31)
1796 # define __extern_always_inline \
1797 extern __always_inline __attribute__ ((__gnu_inline__, __artificial__))
1798 # else
1799 @@ -339,7 +348,10 @@
1800
1801 /* GCC 4.3 and above allow passing all anonymous arguments of an
1802 __extern_always_inline function to some other vararg function. */
1803 -#if __GNUC_PREREQ (4,3)
1804 +#if __GNUC_PREREQ (4,3) \
1805 + || (defined __GNUC_RH_RELEASE__ && __GNUC__ == 4 \
1806 + && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ == 2 \
1807 + && __GNUC_RH_RELEASE__ >= 31)
1808 # define __va_arg_pack() __builtin_va_arg_pack ()
1809 # define __va_arg_pack_len() __builtin_va_arg_pack_len ()
1810 #endif
1811 diff -Nrup a/nis/Makefile b/nis/Makefile
1812 --- a/nis/Makefile 2012-01-01 05:16:32.000000000 -0700
1813 +++ b/nis/Makefile 2012-01-01 20:41:26.656439839 -0700
1814 @@ -23,9 +23,9 @@ subdir := nis
1815
1816 aux := nis_hash
1817
1818 +headers := $(wildcard rpcsvc/*.[hx])
1819 distribute := nss-nis.h nss-nisplus.h nis_intern.h Banner \
1820 - nisplus-parser.h nis_xdr.h nss \
1821 - $(wildcard rpcsvc/*.[hx])
1822 + nisplus-parser.h nis_xdr.h nss
1823
1824 # These are the databases available for the nis (and perhaps later nisplus)
1825 # service. This must be a superset of the services in nss.
1826 @@ -69,6 +69,8 @@ libnss_nisplus-inhibit-o = $(filter-out
1827
1828 include ../Rules
1829
1830 +CFLAGS-nis_findserv.c += -fno-strict-aliasing
1831 +CFLAGS-ypclnt.c += -fno-strict-aliasing
1832
1833 $(objpfx)libnss_compat.so: $(objpfx)libnsl.so$(libnsl.so-version)
1834 $(objpfx)libnss_nis.so: $(objpfx)libnsl.so$(libnsl.so-version) \
1835 diff -Nrup a/nis/nss b/nis/nss
1836 --- a/nis/nss 2012-01-01 05:16:32.000000000 -0700
1837 +++ b/nis/nss 2012-01-01 20:41:26.656439839 -0700
1838 @@ -25,7 +25,7 @@
1839 # memory with every getXXent() call. Otherwise each getXXent() call
1840 # might result into a network communication with the server to get
1841 # the next entry.
1842 -#SETENT_BATCH_READ=TRUE
1843 +SETENT_BATCH_READ=TRUE
1844 #
1845 # ADJUNCT_AS_SHADOW
1846 # If set to TRUE, the passwd routines in the NIS NSS module will not
1847 diff -Nrup a/nptl/ChangeLog b/nptl/ChangeLog
1848 --- a/nptl/ChangeLog 2012-01-01 05:16:32.000000000 -0700
1849 +++ b/nptl/ChangeLog 2012-01-01 20:41:26.659439839 -0700
1850 @@ -210,6 +210,51 @@
1851 clearing memory.
1852 Patch partly by Robert Rex <robert.rex@exasol.com>.
1853
1854 +2011-02-22 Rayson Ho <rho@redhat.com>
1855 +
1856 + * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Low-level SystemTap
1857 + probes for i386.
1858 + * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1859 + * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1860 + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1861 + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1862 + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1863 + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1864 + * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1865 + * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1866 +
1867 +2011-02-09 Rayson Ho <rho@redhat.com>
1868 +
1869 + * DESIGN-systemtap-probes.txt: New file.
1870 + * pthread_cond_broadcast.c: SystemTap probes.
1871 + * pthread_cond_init.c: Likewise.
1872 + * pthread_cond_signal.c: Likewise.
1873 + * pthread_cond_wait.c: Likewise.
1874 + * pthread_cond_destroy.c: Likewise.
1875 + * pthread_create.c: Likewise.
1876 + * pthread_join.c: Likewise.
1877 + * pthread_mutex_destroy.c: Likewise.
1878 + * pthread_mutex_init.c: Likewise.
1879 + * pthread_mutex_lock.c: Likewise.
1880 + * pthread_mutex_timedlock.c: Likewise.
1881 + * pthread_mutex_unlock.c: Likewise.
1882 + * pthread_rwlock_destroy.c: Likewise.
1883 + * pthread_rwlock_rdlock.c: Likewise.
1884 + * pthread_rwlock_unlock.c: Likewise.
1885 + * pthread_rwlock_wrlock.c: Likewise.
1886 + * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1887 + * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1888 + * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
1889 + * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1890 + * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1891 + * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1892 + * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1893 + * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1894 +
1895 +2010-07-23 Roland McGrath <roland@redhat.com>
1896 +
1897 + * pthread_create.c (start_thread): Define pthread_start LIBC_PROBE.
1898 +
1899 2011-01-19 Roland McGrath <roland@redhat.com>
1900
1901 * pthread_cond_wait.c (__pthread_cond_wait): Fix comment typo.
1902 @@ -4939,6 +4984,11 @@
1903 Move definition inside libpthread, libc, librt check. Provide
1904 definition for rtld.
1905
1906 +2004-09-02 Jakub Jelinek <jakub@redhat.com>
1907 +
1908 + * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
1909 + waiters, awake all waiters on the associated mutex.
1910 +
1911 2004-09-02 Ulrich Drepper <drepper@redhat.com>
1912
1913 * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
1914 @@ -7013,6 +7063,11 @@
1915
1916 * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
1917
1918 +2003-07-22 Jakub Jelinek <jakub@redhat.com>
1919 +
1920 + * descr.h: Don't include lowlevellock.h, pthreaddef.h and dl-sysdep.h
1921 + if __need_struct_pthread_size, instead define lll_lock_t.
1922 +
1923 2003-07-25 Jakub Jelinek <jakub@redhat.com>
1924
1925 * tst-cancel17.c (do_test): Check if aio_cancel failed.
1926 diff -Nrup a/nptl/DESIGN-systemtap-probes.txt b/nptl/DESIGN-systemtap-probes.txt
1927 --- a/nptl/DESIGN-systemtap-probes.txt 1969-12-31 17:00:00.000000000 -0700
1928 +++ b/nptl/DESIGN-systemtap-probes.txt 2012-01-01 20:41:26.660439839 -0700
1929 @@ -0,0 +1,89 @@
1930 +Systemtap is a dynamic tracing/instrumenting tool available on Linux. Probes
1931 +that are not fired at run time have close to zero overhead.
1932 +
1933 +The following probes are available for NPTL:
1934 +
1935 +Thread creation & Join Probes
1936 +=============================
1937 +pthread_create - probe for pthread_create
1938 + arg1 = pointer (pthread_t*) to thread
1939 + arg2 = pointer (pthread_attr_t*) to attr
1940 + arg3 = pointer (void *) to start_routine
1941 + arg4 = arguments to start_routine
1942 +pthread_start - probe for actual thread creation
1943 + arg1 = struct pthread (members include thread ID, process ID)
1944 + arg2 = address of start_routine
1945 + arg3 = pointer to the list of arguments
1946 +pthread_join - probe for pthread_join
1947 + arg1 = thread ID
1948 +pthread_join_ret - probe for pthread_join return
1949 + arg1 = thread ID
1950 + arg2 = return value
1951 +
1952 +Lock-related Probes
1953 +===================
1954 +mutex_init - probe for pthread_mutex_init
1955 + arg1 = address of mutex lock
1956 +mutex_acquired - probe for succ. return of pthread_mutex_lock
1957 + arg1 = address of mutex lock
1958 +mutex_timedlock_acquired - probe for succ. return of pthread_mutex_timedlock
1959 + arg1 = address of mutex lock
1960 +mutex_entry - probe for entry to the pthread_mutex_lock function
1961 + arg1 = address of mutex lock
1962 +mutex_timedlock_entry - probe for entry to the pthread_mutex_timedlock function
1963 + arg1 = address of mutex lock, arg2 = address of timespec
1964 +mutex_release - probe for pthread_mutex_unlock after the successful release of a
1965 + mutex lock
1966 + arg1 = address of mutex lock
1967 +mutex_destroy - probe for pthread_mutex_destroy
1968 + arg1 = address of mutex lock
1969 +
1970 +wrlock_entry - probe for entry to the pthread_rwlock_wrlock function
1971 + arg1 = address of rw lock
1972 +rdlock_entry - probe for entry to the pthread_rwlock_rdlock function
1973 + arg1 = address of rw lock
1974 +
1975 +rwlock_destroy - probe for pthread_rwlock_destroy
1976 + arg1 = address of rw lock
1977 +wrlock_acquire_write - probe for pthread_rwlock_wrlock (after getting the lock)
1978 + arg1 = address of rw lock
1979 +rdlock_acquire_read - probe for pthread_rwlock_rdlock after successfully getting
1980 + the lock
1981 + arg1 = address of rw lock
1982 +rwlock_unlock - probe for pthread_rwlock_unlock
1983 + arg1 = address of rw lock
1984 +
1985 +lll_lock_wait - probe in low-level (assembly language) locking code, only fired
1986 + when futex/FUTEX_WAIT is called (i.e. when trying to acquire a
1987 + contented lock)
1988 + arg1 = pointer to futex
1989 + arg2 = flags passed to the futex system call
1990 +lll_lock_wait_private - probe in low-level (assembly language) locking code,
1991 + only fired when futex/FUTEX_WAIT is called (i.e. when
1992 + trying to acquire a contented lock)
1993 + arg1 = pointer to futex
1994 +
1995 +lll_futex_wake - probe in low-level (assembly language) locking code, only fired
1996 + when futex (FUTEX_WAKE) is called
1997 + arg1 = pointer to futex
1998 + arg2 = number of processes to wake
1999 + arg3 = additional flags
2000 +
2001 +Condition variable Probes
2002 +=========================
2003 +cond_init - probe for pthread_cond_init
2004 + arg1 = condition
2005 + arg2 = attr
2006 +cond_destroy - probe for pthread_cond_destroy
2007 + arg1 = cond
2008 +cond_wait - probe for pthread_cond_wait
2009 + arg1 = condition
2010 + arg2 = mutex lock
2011 +cond_timedwait - probe for pthread_cond_timedwait
2012 + arg1 = condition
2013 + arg2 = mutex lock
2014 + arg3 = timespec
2015 +cond_signal - probe for pthread_cond_signal
2016 + arg1 = condition
2017 +cond_broadcast - probe for pthread_cond_broadcast
2018 + arg1 = condition
2019 diff -Nrup a/nptl/Makefile b/nptl/Makefile
2020 --- a/nptl/Makefile 2012-01-01 05:16:32.000000000 -0700
2021 +++ b/nptl/Makefile 2012-01-01 20:41:26.660439839 -0700
2022 @@ -342,7 +342,8 @@ endif
2023 extra-objs += $(crti-objs) $(crtn-objs)
2024 omit-deps += crti crtn
2025
2026 -CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time)
2027 +CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions $(fno-unit-at-a-time) \
2028 + -fno-asynchronous-unwind-tables
2029 endif
2030
2031 CFLAGS-flockfile.c = -D_IO_MTSAFE_IO
2032 @@ -529,15 +530,19 @@ $(addprefix $(objpfx), \
2033 $(tests) $(xtests) $(test-srcs))): $(objpfx)libpthread.so \
2034 $(objpfx)libpthread_nonshared.a
2035 $(objpfx)tst-unload: $(common-objpfx)dlfcn/libdl.so
2036 -# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,
2037 +# $(objpfx)linklibc.so is used instead of $(common-objpfx)libc.so,
2038 # since otherwise libpthread.so comes before libc.so when linking.
2039 $(addprefix $(objpfx), $(tests-reverse)): \
2040 - $(objpfx)../libc.so $(objpfx)libpthread.so \
2041 + $(objpfx)linklibc.so $(objpfx)libpthread.so \
2042 $(objpfx)libpthread_nonshared.a
2043 $(objpfx)../libc.so: $(common-objpfx)libc.so ;
2044 $(addprefix $(objpfx),$(tests-static) $(xtests-static)): $(objpfx)libpthread.a
2045
2046 $(objpfx)tst-atfork2.out: $(objpfx)tst-atfork2mod.so
2047 +
2048 +$(objpfx)linklibc.so: $(common-objpfx)libc.so
2049 + ln -s ../libc.so $@
2050 +generated += libclink.so
2051 else
2052 $(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a
2053 endif
2054 diff -Nrup a/nptl/Versions b/nptl/Versions
2055 --- a/nptl/Versions 2012-01-01 05:16:32.000000000 -0700
2056 +++ b/nptl/Versions 2012-01-01 20:41:26.661439839 -0700
2057 @@ -30,6 +30,7 @@ libc {
2058 __libc_alloca_cutoff;
2059 # Internal libc interface to libpthread
2060 __libc_dl_error_tsd;
2061 + __getrlimit;
2062 }
2063 }
2064
2065 diff -Nrup a/nptl/nptl-init.c b/nptl/nptl-init.c
2066 --- a/nptl/nptl-init.c 2012-01-01 05:16:32.000000000 -0700
2067 +++ b/nptl/nptl-init.c 2012-01-01 20:41:26.661439839 -0700
2068 @@ -415,7 +415,7 @@ __pthread_initialize_minimal_internal (v
2069 /* Determine the default allowed stack size. This is the size used
2070 in case the user does not specify one. */
2071 struct rlimit limit;
2072 - if (getrlimit (RLIMIT_STACK, &limit) != 0
2073 + if (__getrlimit (RLIMIT_STACK, &limit) != 0
2074 || limit.rlim_cur == RLIM_INFINITY)
2075 /* The system limit is not usable. Use an architecture-specific
2076 default. */
2077 diff -Nrup a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c
2078 --- a/nptl/pthread_cond_broadcast.c 2012-01-01 05:16:32.000000000 -0700
2079 +++ b/nptl/pthread_cond_broadcast.c 2012-01-01 20:41:26.662439839 -0700
2080 @@ -23,6 +23,7 @@
2081 #include <lowlevellock.h>
2082 #include <pthread.h>
2083 #include <pthreadP.h>
2084 +#include <stap-probe.h>
2085
2086 #include <shlib-compat.h>
2087 #include <kernel-features.h>
2088 @@ -32,6 +33,8 @@ int
2089 __pthread_cond_broadcast (cond)
2090 pthread_cond_t *cond;
2091 {
2092 + LIBC_PROBE (cond_broadcast, 1, cond);
2093 +
2094 int pshared = (cond->__data.__mutex == (void *) ~0l)
2095 ? LLL_SHARED : LLL_PRIVATE;
2096 /* Make sure we are alone. */
2097 diff -Nrup a/nptl/pthread_cond_destroy.c b/nptl/pthread_cond_destroy.c
2098 --- a/nptl/pthread_cond_destroy.c 2012-01-01 05:16:32.000000000 -0700
2099 +++ b/nptl/pthread_cond_destroy.c 2012-01-01 20:41:26.662439839 -0700
2100 @@ -20,6 +20,7 @@
2101 #include <errno.h>
2102 #include <shlib-compat.h>
2103 #include "pthreadP.h"
2104 +#include <stap-probe.h>
2105
2106
2107 int
2108 @@ -29,6 +30,8 @@ __pthread_cond_destroy (cond)
2109 int pshared = (cond->__data.__mutex == (void *) ~0l)
2110 ? LLL_SHARED : LLL_PRIVATE;
2111
2112 + LIBC_PROBE (cond_destroy, 1, cond);
2113 +
2114 /* Make sure we are alone. */
2115 lll_lock (cond->__data.__lock, pshared);
2116
2117 diff -Nrup a/nptl/pthread_cond_init.c b/nptl/pthread_cond_init.c
2118 --- a/nptl/pthread_cond_init.c 2012-01-01 05:16:32.000000000 -0700
2119 +++ b/nptl/pthread_cond_init.c 2012-01-01 20:41:26.662439839 -0700
2120 @@ -20,6 +20,7 @@
2121
2122 #include <shlib-compat.h>
2123 #include "pthreadP.h"
2124 +#include <stap-probe.h>
2125
2126
2127 int
2128 @@ -42,6 +43,8 @@ __pthread_cond_init (cond, cond_attr)
2129 ? NULL : (void *) ~0l);
2130 cond->__data.__broadcast_seq = 0;
2131
2132 + LIBC_PROBE (cond_init, 2, cond, cond_attr);
2133 +
2134 return 0;
2135 }
2136 versioned_symbol (libpthread, __pthread_cond_init,
2137 diff -Nrup a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c
2138 --- a/nptl/pthread_cond_signal.c 2012-01-01 05:16:32.000000000 -0700
2139 +++ b/nptl/pthread_cond_signal.c 2012-01-01 20:41:26.663439839 -0700
2140 @@ -26,6 +26,7 @@
2141
2142 #include <shlib-compat.h>
2143 #include <kernel-features.h>
2144 +#include <stap-probe.h>
2145
2146
2147 int
2148 @@ -35,6 +36,8 @@ __pthread_cond_signal (cond)
2149 int pshared = (cond->__data.__mutex == (void *) ~0l)
2150 ? LLL_SHARED : LLL_PRIVATE;
2151
2152 + LIBC_PROBE (cond_signal, 1, cond);
2153 +
2154 /* Make sure we are alone. */
2155 lll_lock (cond->__data.__lock, pshared);
2156
2157 diff -Nrup a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
2158 --- a/nptl/pthread_cond_wait.c 2012-01-01 05:16:32.000000000 -0700
2159 +++ b/nptl/pthread_cond_wait.c 2012-01-01 20:41:26.663439839 -0700
2160 @@ -25,6 +25,7 @@
2161 #include <pthreadP.h>
2162
2163 #include <shlib-compat.h>
2164 +#include <stap-probe.h>
2165
2166
2167 struct _condvar_cleanup_buffer
2168 @@ -101,6 +102,8 @@ __pthread_cond_wait (cond, mutex)
2169 int pshared = (cond->__data.__mutex == (void *) ~0l)
2170 ? LLL_SHARED : LLL_PRIVATE;
2171
2172 + LIBC_PROBE (cond_wait, 2, cond, mutex);
2173 +
2174 /* Make sure we are alone. */
2175 lll_lock (cond->__data.__lock, pshared);
2176
2177 diff -Nrup a/nptl/pthread_create.c b/nptl/pthread_create.c
2178 --- a/nptl/pthread_create.c 2012-01-01 05:16:32.000000000 -0700
2179 +++ b/nptl/pthread_create.c 2012-01-01 20:41:26.664439838 -0700
2180 @@ -32,6 +32,8 @@
2181
2182 #include <shlib-compat.h>
2183
2184 +#include <stap-probe.h>
2185 +
2186
2187 /* Local function to start thread and handle cleanup. */
2188 static int start_thread (void *arg);
2189 @@ -300,6 +302,8 @@ start_thread (void *arg)
2190 CANCEL_RESET (oldtype);
2191 }
2192
2193 + LIBC_PROBE (pthread_start, 3, (pthread_t) pd, pd->start_routine, pd->arg);
2194 +
2195 /* Run the code the user provided. */
2196 #ifdef CALL_THREAD_FCT
2197 THREAD_SETMEM (pd, result, CALL_THREAD_FCT (pd));
2198 @@ -557,6 +561,8 @@ __pthread_create_2_1 (newthread, attr, s
2199 /* Pass the descriptor to the caller. */
2200 *newthread = (pthread_t) pd;
2201
2202 + LIBC_PROBE (pthread_create, 4, newthread, attr, start_routine, arg);
2203 +
2204 /* Start the thread. */
2205 return create_thread (pd, iattr, STACK_VARIABLES_ARGS);
2206 }
2207 diff -Nrup a/nptl/pthread_join.c b/nptl/pthread_join.c
2208 --- a/nptl/pthread_join.c 2012-01-01 05:16:32.000000000 -0700
2209 +++ b/nptl/pthread_join.c 2012-01-01 20:41:26.664439838 -0700
2210 @@ -23,6 +23,8 @@
2211 #include <atomic.h>
2212 #include "pthreadP.h"
2213
2214 +#include <stap-probe.h>
2215 +
2216
2217 static void
2218 cleanup (void *arg)
2219 @@ -55,6 +57,8 @@ pthread_join (threadid, thread_return)
2220 struct pthread *self = THREAD_SELF;
2221 int result = 0;
2222
2223 + LIBC_PROBE (pthread_join, 1, threadid);
2224 +
2225 /* During the wait we change to asynchronous cancellation. If we
2226 are canceled the thread we are waiting for must be marked as
2227 un-wait-ed for again. */
2228 @@ -110,5 +114,7 @@ pthread_join (threadid, thread_return)
2229 __free_tcb (pd);
2230 }
2231
2232 + LIBC_PROBE (pthread_join_ret, 3, threadid, result, pd->result);
2233 +
2234 return result;
2235 }
2236 diff -Nrup a/nptl/pthread_mutex_destroy.c b/nptl/pthread_mutex_destroy.c
2237 --- a/nptl/pthread_mutex_destroy.c 2012-01-01 05:16:32.000000000 -0700
2238 +++ b/nptl/pthread_mutex_destroy.c 2012-01-01 20:41:26.665439837 -0700
2239 @@ -20,11 +20,15 @@
2240 #include <errno.h>
2241 #include "pthreadP.h"
2242
2243 +#include <stap-probe.h>
2244 +
2245
2246 int
2247 __pthread_mutex_destroy (mutex)
2248 pthread_mutex_t *mutex;
2249 {
2250 + LIBC_PROBE (mutex_destroy, 1, mutex);
2251 +
2252 if ((mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP) == 0
2253 && mutex->__data.__nusers != 0)
2254 return EBUSY;
2255 diff -Nrup a/nptl/pthread_mutex_init.c b/nptl/pthread_mutex_init.c
2256 --- a/nptl/pthread_mutex_init.c 2012-01-01 05:16:32.000000000 -0700
2257 +++ b/nptl/pthread_mutex_init.c 2012-01-01 20:41:26.665439837 -0700
2258 @@ -24,6 +24,8 @@
2259 #include <kernel-features.h>
2260 #include "pthreadP.h"
2261
2262 +#include <stap-probe.h>
2263 +
2264 static const struct pthread_mutexattr default_attr =
2265 {
2266 /* Default is a normal mutex, not shared between processes. */
2267 @@ -135,6 +137,8 @@ __pthread_mutex_init (mutex, mutexattr)
2268 // mutex->__spins = 0; already done by memset
2269 // mutex->__next = NULL; already done by memset
2270
2271 + LIBC_PROBE (mutex_init, 1, mutex);
2272 +
2273 return 0;
2274 }
2275 strong_alias (__pthread_mutex_init, pthread_mutex_init)
2276 diff -Nrup a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c
2277 --- a/nptl/pthread_mutex_lock.c 2012-01-01 05:16:32.000000000 -0700
2278 +++ b/nptl/pthread_mutex_lock.c 2012-01-01 20:41:26.665439837 -0700
2279 @@ -24,6 +24,7 @@
2280 #include <not-cancel.h>
2281 #include "pthreadP.h"
2282 #include <lowlevellock.h>
2283 +#include <stap-probe.h>
2284
2285
2286 #ifndef LLL_MUTEX_LOCK
2287 @@ -48,6 +49,9 @@ __pthread_mutex_lock (mutex)
2288 assert (sizeof (mutex->__size) >= sizeof (mutex->__data));
2289
2290 unsigned int type = PTHREAD_MUTEX_TYPE (mutex);
2291 +
2292 + LIBC_PROBE (mutex_entry, 1, mutex);
2293 +
2294 if (__builtin_expect (type & ~PTHREAD_MUTEX_KIND_MASK_NP, 0))
2295 return __pthread_mutex_lock_full (mutex);
2296
2297 @@ -127,6 +131,8 @@ __pthread_mutex_lock (mutex)
2298 ++mutex->__data.__nusers;
2299 #endif
2300
2301 + LIBC_PROBE (mutex_acquired, 1, mutex);
2302 +
2303 return 0;
2304 }
2305
2306 @@ -467,6 +473,8 @@ __pthread_mutex_lock_full (pthread_mutex
2307 ++mutex->__data.__nusers;
2308 #endif
2309
2310 + LIBC_PROBE (mutex_acquired, 1, mutex);
2311 +
2312 return 0;
2313 }
2314 #ifndef __pthread_mutex_lock
2315 diff -Nrup a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c
2316 --- a/nptl/pthread_mutex_timedlock.c 2012-01-01 05:16:32.000000000 -0700
2317 +++ b/nptl/pthread_mutex_timedlock.c 2012-01-01 20:41:26.666439837 -0700
2318 @@ -24,6 +24,8 @@
2319 #include <lowlevellock.h>
2320 #include <not-cancel.h>
2321
2322 +#include <stap-probe.h>
2323 +
2324
2325 int
2326 pthread_mutex_timedlock (mutex, abstime)
2327 @@ -34,6 +36,8 @@ pthread_mutex_timedlock (mutex, abstime)
2328 pid_t id = THREAD_GETMEM (THREAD_SELF, tid);
2329 int result = 0;
2330
2331 + LIBC_PROBE (mutex_timedlock_entry, 2, mutex, abstime);
2332 +
2333 /* We must not check ABSTIME here. If the thread does not block
2334 abstime must not be checked for a valid value. */
2335
2336 @@ -172,6 +176,8 @@ pthread_mutex_timedlock (mutex, abstime)
2337
2338 ++mutex->__data.__count;
2339
2340 + LIBC_PROBE (mutex_timedlock_acquired, 1, mutex);
2341 +
2342 return 0;
2343 }
2344 }
2345 @@ -242,6 +248,8 @@ pthread_mutex_timedlock (mutex, abstime)
2346
2347 ++mutex->__data.__count;
2348
2349 + LIBC_PROBE (mutex_timedlock_acquired, 1, mutex);
2350 +
2351 return 0;
2352 }
2353 }
2354 @@ -377,6 +385,8 @@ pthread_mutex_timedlock (mutex, abstime)
2355
2356 ++mutex->__data.__count;
2357
2358 + LIBC_PROBE (mutex_timedlock_acquired, 1, mutex);
2359 +
2360 return 0;
2361 }
2362 }
2363 @@ -477,6 +487,8 @@ pthread_mutex_timedlock (mutex, abstime)
2364 /* Record the ownership. */
2365 mutex->__data.__owner = id;
2366 ++mutex->__data.__nusers;
2367 +
2368 + LIBC_PROBE (mutex_timedlock_acquired, 1, mutex);
2369 }
2370
2371 out:
2372 diff -Nrup a/nptl/pthread_mutex_unlock.c b/nptl/pthread_mutex_unlock.c
2373 --- a/nptl/pthread_mutex_unlock.c 2012-01-01 05:16:32.000000000 -0700
2374 +++ b/nptl/pthread_mutex_unlock.c 2012-01-01 20:41:26.666439837 -0700
2375 @@ -22,6 +22,7 @@
2376 #include <stdlib.h>
2377 #include "pthreadP.h"
2378 #include <lowlevellock.h>
2379 +#include <stap-probe.h>
2380
2381 static int
2382 internal_function
2383 @@ -50,6 +51,9 @@ __pthread_mutex_unlock_usercnt (mutex, d
2384
2385 /* Unlock. */
2386 lll_unlock (mutex->__data.__lock, PTHREAD_MUTEX_PSHARED (mutex));
2387 +
2388 + LIBC_PROBE (mutex_release, 1, mutex);
2389 +
2390 return 0;
2391 }
2392 else if (__builtin_expect (type == PTHREAD_MUTEX_RECURSIVE_NP, 1))
2393 @@ -272,6 +276,9 @@ __pthread_mutex_unlock_full (pthread_mut
2394 PTHREAD_MUTEX_PSHARED (mutex));
2395
2396 int oldprio = newval >> PTHREAD_MUTEX_PRIO_CEILING_SHIFT;
2397 +
2398 + LIBC_PROBE (mutex_release, 1, mutex);
2399 +
2400 return __pthread_tpp_change_priority (oldprio, -1);
2401
2402 default:
2403 @@ -279,6 +286,7 @@ __pthread_mutex_unlock_full (pthread_mut
2404 return EINVAL;
2405 }
2406
2407 + LIBC_PROBE (mutex_release, 1, mutex);
2408 return 0;
2409 }
2410
2411 diff -Nrup a/nptl/pthread_rwlock_destroy.c b/nptl/pthread_rwlock_destroy.c
2412 --- a/nptl/pthread_rwlock_destroy.c 2012-01-01 05:16:32.000000000 -0700
2413 +++ b/nptl/pthread_rwlock_destroy.c 2012-01-01 20:41:26.667439837 -0700
2414 @@ -18,12 +18,15 @@
2415 02111-1307 USA. */
2416
2417 #include "pthreadP.h"
2418 +#include <stap-probe.h>
2419
2420
2421 int
2422 __pthread_rwlock_destroy (rwlock)
2423 pthread_rwlock_t *rwlock;
2424 {
2425 + LIBC_PROBE (rwlock_destroy, 1, rwlock);
2426 +
2427 /* Nothing to be done. For now. */
2428 return 0;
2429 }
2430 diff -Nrup a/nptl/pthread_rwlock_rdlock.c b/nptl/pthread_rwlock_rdlock.c
2431 --- a/nptl/pthread_rwlock_rdlock.c 2012-01-01 05:16:32.000000000 -0700
2432 +++ b/nptl/pthread_rwlock_rdlock.c 2012-01-01 20:41:26.667439837 -0700
2433 @@ -22,6 +22,7 @@
2434 #include <lowlevellock.h>
2435 #include <pthread.h>
2436 #include <pthreadP.h>
2437 +#include <stap-probe.h>
2438
2439
2440 /* Acquire read lock for RWLOCK. */
2441 @@ -31,6 +32,8 @@ __pthread_rwlock_rdlock (rwlock)
2442 {
2443 int result = 0;
2444
2445 + LIBC_PROBE (rdlock_entry, 1, rwlock);
2446 +
2447 /* Make sure we are alone. */
2448 lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
2449
2450 @@ -49,6 +52,8 @@ __pthread_rwlock_rdlock (rwlock)
2451 --rwlock->__data.__nr_readers;
2452 result = EAGAIN;
2453 }
2454 + else
2455 + LIBC_PROBE (rdlock_acquire_read, 1, rwlock);
2456
2457 break;
2458 }
2459 diff -Nrup a/nptl/pthread_rwlock_unlock.c b/nptl/pthread_rwlock_unlock.c
2460 --- a/nptl/pthread_rwlock_unlock.c 2012-01-01 05:16:32.000000000 -0700
2461 +++ b/nptl/pthread_rwlock_unlock.c 2012-01-01 20:41:26.668439837 -0700
2462 @@ -22,11 +22,14 @@
2463 #include <lowlevellock.h>
2464 #include <pthread.h>
2465 #include <pthreadP.h>
2466 +#include <stap-probe.h>
2467
2468 /* Unlock RWLOCK. */
2469 int
2470 __pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
2471 {
2472 + LIBC_PROBE (rwlock_unlock, 1, rwlock);
2473 +
2474 lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
2475 if (rwlock->__data.__writer)
2476 rwlock->__data.__writer = 0;
2477 diff -Nrup a/nptl/pthread_rwlock_wrlock.c b/nptl/pthread_rwlock_wrlock.c
2478 --- a/nptl/pthread_rwlock_wrlock.c 2012-01-01 05:16:32.000000000 -0700
2479 +++ b/nptl/pthread_rwlock_wrlock.c 2012-01-01 20:41:26.668439837 -0700
2480 @@ -22,6 +22,7 @@
2481 #include <lowlevellock.h>
2482 #include <pthread.h>
2483 #include <pthreadP.h>
2484 +#include <stap-probe.h>
2485
2486
2487 /* Acquire write lock for RWLOCK. */
2488 @@ -31,6 +32,8 @@ __pthread_rwlock_wrlock (rwlock)
2489 {
2490 int result = 0;
2491
2492 + LIBC_PROBE (wrlock_entry, 1, rwlock);
2493 +
2494 /* Make sure we are alone. */
2495 lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
2496
2497 @@ -41,6 +44,8 @@ __pthread_rwlock_wrlock (rwlock)
2498 {
2499 /* Mark self as writer. */
2500 rwlock->__data.__writer = THREAD_GETMEM (THREAD_SELF, tid);
2501 +
2502 + LIBC_PROBE (wrlock_acquire_write, 1, rwlock);
2503 break;
2504 }
2505
2506 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h b/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h
2507 --- a/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h 2012-01-01 05:16:32.000000000 -0700
2508 +++ b/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h 2012-01-01 20:41:26.668439837 -0700
2509 @@ -189,4 +189,7 @@
2510 /* Typed memory objects are not available. */
2511 #define _POSIX_TYPED_MEMORY_OBJECTS -1
2512
2513 +/* Streams are not available. */
2514 +#define _XOPEN_STREAMS -1
2515 +
2516 #endif /* bits/posix_opt.h */
2517 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/i386/Versions b/nptl/sysdeps/unix/sysv/linux/i386/Versions
2518 --- a/nptl/sysdeps/unix/sysv/linux/i386/Versions 1969-12-31 17:00:00.000000000 -0700
2519 +++ b/nptl/sysdeps/unix/sysv/linux/i386/Versions 2012-01-01 20:41:26.669439837 -0700
2520 @@ -0,0 +1,6 @@
2521 +libc {
2522 + GLIBC_PRIVATE {
2523 + # Internal libc interface to libpthread
2524 + __uname;
2525 + }
2526 +}
2527 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2528 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S 2012-01-01 05:16:32.000000000 -0700
2529 +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S 2012-01-01 20:41:26.669439837 -0700
2530 @@ -22,6 +22,8 @@
2531 #include <kernel-features.h>
2532 #include <lowlevellock.h>
2533
2534 +#include <stap-probe.h>
2535 +
2536 .text
2537
2538 #ifdef __ASSUME_PRIVATE_FUTEX
2539 @@ -91,7 +93,8 @@ __lll_lock_wait_private:
2540 cmpl %edx, %eax /* NB: %edx == 2 */
2541 jne 2f
2542
2543 -1: movl $SYS_futex, %eax
2544 +1: LIBC_PROBE (lll_lock_wait_private, 1, %ebx)
2545 + movl $SYS_futex, %eax
2546 ENTER_KERNEL
2547
2548 2: movl %edx, %eax
2549 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
2550 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S 2012-01-01 05:16:32.000000000 -0700
2551 +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S 2012-01-01 20:41:26.670439837 -0700
2552 @@ -24,6 +24,7 @@
2553 #include <kernel-features.h>
2554 #include <pthread-pi-defines.h>
2555 #include <pthread-errnos.h>
2556 +#include <stap-probe.h>
2557
2558 .text
2559
2560 @@ -49,6 +50,8 @@ __pthread_cond_broadcast:
2561
2562 movl 20(%esp), %ebx
2563
2564 + LIBC_PROBE (cond_broadcast, 1, %edx)
2565 +
2566 /* Get internal lock. */
2567 movl $1, %edx
2568 xorl %eax, %eax
2569 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
2570 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S 2012-01-01 05:16:32.000000000 -0700
2571 +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S 2012-01-01 20:41:26.670439837 -0700
2572 @@ -24,7 +24,7 @@
2573 #include <kernel-features.h>
2574 #include <pthread-pi-defines.h>
2575 #include <pthread-errnos.h>
2576 -
2577 +#include <stap-probe.h>
2578
2579 .text
2580
2581 @@ -45,6 +45,8 @@ __pthread_cond_signal:
2582
2583 movl 12(%esp), %edi
2584
2585 + LIBC_PROBE (cond_signal, 1, %edi)
2586 +
2587 /* Get internal lock. */
2588 movl $1, %edx
2589 xorl %eax, %eax
2590 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2591 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S 2012-01-01 05:16:32.000000000 -0700
2592 +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S 2012-01-01 20:41:26.670439837 -0700
2593 @@ -24,7 +24,7 @@
2594 #include <pthread-errnos.h>
2595 #include <pthread-pi-defines.h>
2596 #include <kernel-features.h>
2597 -
2598 +#include <stap-probe.h>
2599
2600 .text
2601
2602 @@ -61,6 +61,8 @@ __pthread_cond_timedwait:
2603 movl 20(%esp), %ebx
2604 movl 28(%esp), %ebp
2605
2606 + LIBC_PROBE (cond_timedwait, 3, %ebx, 24(%esp), %ebp)
2607 +
2608 cmpl $1000000000, 4(%ebp)
2609 movl $EINVAL, %eax
2610 jae 18f
2611 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2612 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S 2012-01-01 05:16:32.000000000 -0700
2613 +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S 2012-01-01 20:41:26.671439837 -0700
2614 @@ -25,6 +25,7 @@
2615 #include <pthread-errnos.h>
2616 #include <pthread-pi-defines.h>
2617 #include <kernel-features.h>
2618 +#include <stap-probe.h>
2619
2620
2621 .text
2622 @@ -61,6 +62,8 @@ __pthread_cond_wait:
2623 xorl %esi, %esi
2624 movl 20(%esp), %ebx
2625
2626 + LIBC_PROBE (cond_wait, 2, 24(%esp), %ebx)
2627 +
2628 /* Get internal lock. */
2629 movl $1, %edx
2630 xorl %eax, %eax
2631 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
2632 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S 2012-01-01 05:16:32.000000000 -0700
2633 +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S 2012-01-01 20:41:26.671439837 -0700
2634 @@ -23,6 +23,7 @@
2635 #include <pthread-errnos.h>
2636 #include <kernel-features.h>
2637
2638 +#include <stap-probe.h>
2639
2640 .text
2641
2642 @@ -41,6 +42,8 @@ __pthread_rwlock_rdlock:
2643 xorl %esi, %esi
2644 movl 12(%esp), %ebx
2645
2646 + LIBC_PROBE (rdlock_entry, 1, %ebx)
2647 +
2648 /* Get the lock. */
2649 movl $1, %edx
2650 xorl %eax, %eax
2651 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
2652 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S 2012-01-01 05:16:32.000000000 -0700
2653 +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S 2012-01-01 20:41:26.672439837 -0700
2654 @@ -23,6 +23,7 @@
2655 #include <pthread-errnos.h>
2656 #include <kernel-features.h>
2657
2658 +#include <stap-probe.h>
2659
2660 .text
2661
2662 @@ -41,6 +42,8 @@ __pthread_rwlock_wrlock:
2663 xorl %esi, %esi
2664 movl 12(%esp), %ebx
2665
2666 + LIBC_PROBE (wrlock_entry, 1, %ebx)
2667 +
2668 /* Get the lock. */
2669 movl $1, %edx
2670 xorl %eax, %eax
2671 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
2672 --- a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h 2012-01-01 05:16:32.000000000 -0700
2673 +++ b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h 2012-01-01 20:41:26.672439837 -0700
2674 @@ -20,6 +20,8 @@
2675 #ifndef _LOWLEVELLOCK_H
2676 #define _LOWLEVELLOCK_H 1
2677
2678 +#include <stap-probe.h>
2679 +
2680 #ifndef __ASSEMBLER__
2681 # include <time.h>
2682 # include <sys/param.h>
2683 @@ -226,6 +228,7 @@ LLL_STUB_UNWIND_INFO_END
2684 do { \
2685 int __ignore; \
2686 register __typeof (nr) _nr asm ("edx") = (nr); \
2687 + LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \
2688 __asm __volatile (LLL_EBX_LOAD \
2689 LLL_ENTER_KERNEL \
2690 LLL_EBX_LOAD \
2691 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/i386/smp.h b/nptl/sysdeps/unix/sysv/linux/i386/smp.h
2692 --- a/nptl/sysdeps/unix/sysv/linux/i386/smp.h 2012-01-01 05:16:32.000000000 -0700
2693 +++ b/nptl/sysdeps/unix/sysv/linux/i386/smp.h 2012-01-01 20:41:26.673439836 -0700
2694 @@ -37,7 +37,7 @@ is_smp_system (void)
2695 char *cp;
2696
2697 /* Try reading the number using `sysctl' first. */
2698 - if (uname (&u.uts) == 0)
2699 + if (__uname (&u.uts) == 0)
2700 cp = u.uts.version;
2701 else
2702 {
2703 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/kernel-features.h b/nptl/sysdeps/unix/sysv/linux/kernel-features.h
2704 --- a/nptl/sysdeps/unix/sysv/linux/kernel-features.h 1969-12-31 17:00:00.000000000 -0700
2705 +++ b/nptl/sysdeps/unix/sysv/linux/kernel-features.h 2012-01-01 20:41:26.673439836 -0700
2706 @@ -0,0 +1,6 @@
2707 +#include_next <kernel-features.h>
2708 +
2709 +/* NPTL can always assume all clone thread flags work. */
2710 +#ifndef __ASSUME_CLONE_THREAD_FLAGS
2711 +# define __ASSUME_CLONE_THREAD_FLAGS 1
2712 +#endif
2713 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2714 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S 2012-01-01 05:16:32.000000000 -0700
2715 +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S 2012-01-01 20:41:26.673439836 -0700
2716 @@ -22,6 +22,8 @@
2717 #include <kernel-features.h>
2718 #include <lowlevellock.h>
2719
2720 +#include <stap-probe.h>
2721 +
2722 .text
2723
2724 #ifdef __ASSUME_PRIVATE_FUTEX
2725 @@ -87,7 +89,8 @@ __lll_lock_wait_private:
2726 cmpl %edx, %eax /* NB: %edx == 2 */
2727 jne 2f
2728
2729 -1: movl $SYS_futex, %eax
2730 +1: LIBC_PROBE (lll_lock_wait_private, 1, %rdi)
2731 + movl $SYS_futex, %eax
2732 syscall
2733
2734 2: movl %edx, %eax
2735 @@ -126,7 +129,8 @@ __lll_lock_wait:
2736 cmpl %edx, %eax /* NB: %edx == 2 */
2737 jne 2f
2738
2739 -1: movl $SYS_futex, %eax
2740 +1: LIBC_PROBE (lll_lock_wait, 2, %rdi, %rsi)
2741 + movl $SYS_futex, %eax
2742 syscall
2743
2744 2: movl %edx, %eax
2745 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2746 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h 2012-01-01 05:16:32.000000000 -0700
2747 +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h 2012-01-01 20:41:26.674439835 -0700
2748 @@ -20,6 +20,8 @@
2749 #ifndef _LOWLEVELLOCK_H
2750 #define _LOWLEVELLOCK_H 1
2751
2752 +#include <stap-probe.h>
2753 +
2754 #ifndef __ASSEMBLER__
2755 # include <time.h>
2756 # include <sys/param.h>
2757 @@ -227,6 +229,7 @@ LLL_STUB_UNWIND_INFO_END
2758 do { \
2759 int __ignore; \
2760 register __typeof (nr) _nr __asm ("edx") = (nr); \
2761 + LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \
2762 __asm __volatile ("syscall" \
2763 : "=a" (__ignore) \
2764 : "0" (SYS_futex), "D" (futex), \
2765 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2766 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S 2012-01-01 05:16:32.000000000 -0700
2767 +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S 2012-01-01 20:41:26.674439835 -0700
2768 @@ -25,7 +25,7 @@
2769 #include <kernel-features.h>
2770 #include <pthread-pi-defines.h>
2771 #include <pthread-errnos.h>
2772 -
2773 +#include <stap-probe.h>
2774
2775 .text
2776
2777 @@ -35,6 +35,8 @@
2778 .align 16
2779 __pthread_cond_broadcast:
2780
2781 + LIBC_PROBE (cond_broadcast, 1, %rdi)
2782 +
2783 /* Get internal lock. */
2784 movl $1, %esi
2785 xorl %eax, %eax
2786 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
2787 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S 2012-01-01 05:16:32.000000000 -0700
2788 +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S 2012-01-01 20:41:26.675439835 -0700
2789 @@ -24,6 +24,7 @@
2790 #include <pthread-pi-defines.h>
2791 #include <kernel-features.h>
2792 #include <pthread-errnos.h>
2793 +#include <stap-probe.h>
2794
2795
2796 .text
2797 @@ -34,6 +35,8 @@
2798 .align 16
2799 __pthread_cond_signal:
2800
2801 + LIBC_PROBE (cond_signal, 1, %rdi)
2802 +
2803 /* Get internal lock. */
2804 movq %rdi, %r8
2805 movl $1, %esi
2806 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2807 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S 2012-01-01 05:16:32.000000000 -0700
2808 +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S 2012-01-01 20:41:26.675439835 -0700
2809 @@ -23,6 +23,7 @@
2810 #include <lowlevelcond.h>
2811 #include <pthread-pi-defines.h>
2812 #include <pthread-errnos.h>
2813 +#include <stap-probe.h>
2814
2815 #include <kernel-features.h>
2816
2817 @@ -68,6 +69,8 @@ __pthread_cond_timedwait:
2818 cfi_adjust_cfa_offset(FRAME_SIZE)
2819 cfi_remember_state
2820
2821 + LIBC_PROBE (cond_timedwait, 3, %rdi, %rsi, %rdx)
2822 +
2823 cmpq $1000000000, 8(%rdx)
2824 movl $EINVAL, %eax
2825 jae 48f
2826 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2827 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S 2012-01-01 05:16:32.000000000 -0700
2828 +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S 2012-01-01 20:41:26.676439836 -0700
2829 @@ -24,6 +24,7 @@
2830 #include <tcb-offsets.h>
2831 #include <pthread-pi-defines.h>
2832 #include <pthread-errnos.h>
2833 +#include <stap-probe.h>
2834
2835 #include <kernel-features.h>
2836
2837 @@ -66,6 +67,8 @@ __pthread_cond_wait:
2838 +--------------------------+
2839 */
2840
2841 + LIBC_PROBE (cond_wait, 2, %rdi, %rsi)
2842 +
2843 cmpq $-1, dep_mutex(%rdi)
2844
2845 /* Prepare structure passed to cancellation handler. */
2846 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
2847 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S 2012-01-01 05:16:32.000000000 -0700
2848 +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S 2012-01-01 20:41:26.677439836 -0700
2849 @@ -22,7 +22,7 @@
2850 #include <lowlevelrwlock.h>
2851 #include <pthread-errnos.h>
2852 #include <kernel-features.h>
2853 -
2854 +#include <stap-probe.h>
2855
2856 .text
2857
2858 @@ -31,6 +31,9 @@
2859 .align 16
2860 __pthread_rwlock_rdlock:
2861 cfi_startproc
2862 +
2863 + LIBC_PROBE (rdlock_entry, 1, %rdi)
2864 +
2865 xorq %r10, %r10
2866
2867 /* Get the lock. */
2868 diff -Nrup a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
2869 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S 2012-01-01 05:16:32.000000000 -0700
2870 +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S 2012-01-01 20:41:26.677439836 -0700
2871 @@ -22,7 +22,7 @@
2872 #include <lowlevelrwlock.h>
2873 #include <pthread-errnos.h>
2874 #include <kernel-features.h>
2875 -
2876 +#include <stap-probe.h>
2877
2878 .text
2879
2880 @@ -31,6 +31,9 @@
2881 .align 16
2882 __pthread_rwlock_wrlock:
2883 cfi_startproc
2884 +
2885 + LIBC_PROBE (wrlock_entry, 1, %rdi)
2886 +
2887 xorq %r10, %r10
2888
2889 /* Get the lock. */
2890 diff -Nrup a/nscd/nscd.conf b/nscd/nscd.conf
2891 --- a/nscd/nscd.conf 2012-01-01 05:16:32.000000000 -0700
2892 +++ b/nscd/nscd.conf 2012-01-01 20:41:26.677439836 -0700
2893 @@ -33,7 +33,7 @@
2894 # logfile /var/log/nscd.log
2895 # threads 4
2896 # max-threads 32
2897 -# server-user nobody
2898 + server-user nscd
2899 # stat-user somebody
2900 debug-level 0
2901 # reload-count 5
2902 diff -Nrup a/nscd/nscd.init b/nscd/nscd.init
2903 --- a/nscd/nscd.init 2012-01-01 05:16:32.000000000 -0700
2904 +++ b/nscd/nscd.init 2012-01-01 20:41:26.678439836 -0700
2905 @@ -9,6 +9,7 @@
2906 # slow naming services like NIS, NIS+, LDAP, or hesiod.
2907 # processname: /usr/sbin/nscd
2908 # config: /etc/nscd.conf
2909 +# config: /etc/sysconfig/nscd
2910 #
2911 ### BEGIN INIT INFO
2912 # Provides: nscd
2913 @@ -28,20 +29,8 @@
2914 # Source function library.
2915 . /etc/init.d/functions
2916
2917 -# nscd does not run on any kernel lower than 2.2.0 because of threading
2918 -# problems, so we require that in first place.
2919 -case $(uname -r) in
2920 - 2.[2-9].*)
2921 - # this is okay
2922 - ;;
2923 - [3-9]*)
2924 - # these are of course also okay
2925 - ;;
2926 - *)
2927 - #this is not
2928 - exit 1
2929 - ;;
2930 -esac
2931 +# Source an auxiliary options file if we have one, and pick up NSCD_OPTIONS.
2932 +[ -r /etc/sysconfig/nscd ] && . /etc/sysconfig/nscd
2933
2934 RETVAL=0
2935 prog=nscd
2936 @@ -50,7 +39,7 @@ start () {
2937 [ -d /var/run/nscd ] || mkdir /var/run/nscd
2938 [ -d /var/db/nscd ] || mkdir /var/db/nscd
2939 echo -n $"Starting $prog: "
2940 - daemon /usr/sbin/nscd
2941 + daemon /usr/sbin/nscd $NSCD_OPTIONS
2942 RETVAL=$?
2943 echo
2944 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
2945 @@ -83,11 +72,11 @@ restart() {
2946 # See how we were called.
2947 case "$1" in
2948 start)
2949 - start
2950 + [ -e /var/lock/subsys/nscd ] || start
2951 RETVAL=$?
2952 ;;
2953 stop)
2954 - stop
2955 + [ ! -e /var/lock/subsys/nscd ] || stop
2956 RETVAL=$?
2957 ;;
2958 status)
2959 @@ -99,14 +88,17 @@ case "$1" in
2960 RETVAL=$?
2961 ;;
2962 try-restart | condrestart)
2963 - [ -e /var/lock/subsys/nscd ] && restart
2964 + [ ! -e /var/lock/subsys/nscd ] || restart
2965 RETVAL=$?
2966 ;;
2967 force-reload | reload)
2968 echo -n $"Reloading $prog: "
2969 - killproc /usr/sbin/nscd -HUP
2970 - RETVAL=$?
2971 - echo
2972 + RETVAL=0
2973 + /usr/sbin/nscd -i passwd || RETVAL=$?
2974 + /usr/sbin/nscd -i group || RETVAL=$?
2975 + /usr/sbin/nscd -i hosts || RETVAL=$?
2976 + /usr/sbin/nscd -i services || RETVAL=$?
2977 + echo
2978 ;;
2979 *)
2980 echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
2981 diff -Nrup a/nscd/selinux.c b/nscd/selinux.c
2982 --- a/nscd/selinux.c 2012-01-01 05:16:32.000000000 -0700
2983 +++ b/nscd/selinux.c 2012-01-01 20:41:26.678439836 -0700
2984 @@ -270,6 +270,18 @@ avc_create_thread (void (*run) (void))
2985 {
2986 int rc;
2987
2988 +#if defined HAVE_LIBAUDIT && defined HAVE_LIBCAP
2989 + if (server_user != NULL && getuid () == 0)
2990 + {
2991 + /* We need to preserve the capabilities in the AVC thread. */
2992 + if (prctl (PR_SET_KEEPCAPS, 1) == -1)
2993 + {
2994 + dbg_log (_("Failed to set keep-capabilities"));
2995 + error (EXIT_FAILURE, errno, _("prctl(KEEPCAPS) failed"));
2996 + }
2997 + }
2998 +#endif
2999 +
3000 rc =
3001 pthread_create (&avc_notify_thread, NULL, (void *(*) (void *)) run, NULL);
3002 if (rc != 0)
3003 diff -Nrup a/nss/Makefile b/nss/Makefile
3004 --- a/nss/Makefile 2012-01-01 05:16:32.000000000 -0700
3005 +++ b/nss/Makefile 2012-01-01 20:41:26.679439836 -0700
3006 @@ -88,6 +88,7 @@ endif
3007
3008 include ../Rules
3009
3010 +CFLAGS-files-hosts.c += -fno-strict-aliasing
3011
3012 ifeq (yes,$(build-static-nss))
3013 $(objpfx)getent: $(objpfx)libnss_files.a
3014 diff -Nrup a/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c
3015 --- a/nss/nss_files/files-XXX.c 2012-01-01 05:16:32.000000000 -0700
3016 +++ b/nss/nss_files/files-XXX.c 2012-01-01 20:41:26.679439836 -0700
3017 @@ -190,7 +190,7 @@ internal_getent (struct STRUCTURE *resul
3018 {
3019 char *p;
3020 struct parser_data *data = (void *) buffer;
3021 - int linebuflen = buffer + buflen - data->linebuffer;
3022 + size_t linebuflen = buffer + buflen - data->linebuffer;
3023 int parse_result;
3024
3025 if (buflen < sizeof *data + 2)
3026 diff -Nrup a/posix/Makefile b/posix/Makefile
3027 --- a/posix/Makefile 2012-01-01 05:16:32.000000000 -0700
3028 +++ b/posix/Makefile 2012-01-01 20:41:26.680439836 -0700
3029 @@ -320,15 +320,8 @@ $(inst_libexecdir)/getconf: $(inst_bindi
3030 mv -f $@/$$spec.new $@/$$spec; \
3031 done < $(objpfx)getconf.speclist
3032
3033 -$(objpfx)getconf.speclist: $(objpfx)getconf
3034 -ifeq (no,$(cross-compiling))
3035 - LC_ALL=C GETCONF_DIR=/dev/null \
3036 - $(run-program-prefix) $< _POSIX_V7_WIDTH_RESTRICTED_ENVS > $@.new
3037 - LC_ALL=C GETCONF_DIR=/dev/null \
3038 - $(run-program-prefix) $< _POSIX_V6_WIDTH_RESTRICTED_ENVS >> $@.new
3039 - LC_ALL=C GETCONF_DIR=/dev/null \
3040 - $(run-program-prefix) $< _XBS5_WIDTH_RESTRICTED_ENVS >> $@.new
3041 -else
3042 - > $@.new
3043 -endif
3044 +$(objpfx)getconf.speclist: getconf.speclist.h
3045 + $(CC) -E $(CFLAGS) $(CPPFLAGS) $< \
3046 + | sed -n -e '/START_OF_STRINGS/,$${/\(POSIX_V[67]\|XBS5\)_/{s/^[^"]*"//;s/".*$$//;p}}' \
3047 + > $@.new
3048 mv -f $@.new $@
3049 diff -Nrup a/posix/gai.conf b/posix/gai.conf
3050 --- a/posix/gai.conf 2012-01-01 05:16:32.000000000 -0700
3051 +++ b/posix/gai.conf 2012-01-01 20:41:26.680439836 -0700
3052 @@ -41,7 +41,7 @@
3053 #
3054 # precedence <mask> <value>
3055 # Add another rule to the RFC 3484 precedence table. See section 2.1
3056 -# and 10.3 in RFC 3484. The default is:
3057 +# and 10.3 in RFC 3484. The RFC requires:
3058 #
3059 #precedence ::1/128 50
3060 #precedence ::/0 40
3061 @@ -58,7 +58,7 @@
3062 # Add another rule to the RFC 3484 scope table for IPv4 addresses.
3063 # By default the scope IDs described in section 3.2 in RFC 3484 are
3064 # used. Changing these defaults should hardly ever be necessary.
3065 -# The defaults are equivalent to:
3066 +# The definitions in RFC 1918 are equivalent to:
3067 #
3068 #scopev4 ::ffff:169.254.0.0/112 2
3069 #scopev4 ::ffff:127.0.0.0/104 2
3070 @@ -75,3 +75,5 @@
3071 #scopev4 ::ffff:169.254.0.0/112 2
3072 #scopev4 ::ffff:127.0.0.0/104 2
3073 #scopev4 ::ffff:0.0.0.0/96 14
3074 +#
3075 +# This is what the Red Hat setting currently uses.
3076 diff -Nrup a/posix/getconf.speclist.h b/posix/getconf.speclist.h
3077 --- a/posix/getconf.speclist.h 1969-12-31 17:00:00.000000000 -0700
3078 +++ b/posix/getconf.speclist.h 2012-01-01 20:41:26.680439836 -0700
3079 @@ -0,0 +1,39 @@
3080 +#include <unistd.h>
3081 +const char *START_OF_STRINGS =
3082 +#if _POSIX_V7_ILP32_OFF32 == 1
3083 +"POSIX_V7_ILP32_OFF32"
3084 +#endif
3085 +#if _POSIX_V7_ILP32_OFFBIG == 1
3086 +"POSIX_V7_ILP32_OFFBIG"
3087 +#endif
3088 +#if _POSIX_V7_LP64_OFF64 == 1
3089 +"POSIX_V7_LP64_OFF64"
3090 +#endif
3091 +#if _POSIX_V7_LPBIG_OFFBIG == 1
3092 +"POSIX_V7_LPBIG_OFFBIG"
3093 +#endif
3094 +#if _POSIX_V6_ILP32_OFF32 == 1
3095 +"POSIX_V6_ILP32_OFF32"
3096 +#endif
3097 +#if _POSIX_V6_ILP32_OFFBIG == 1
3098 +"POSIX_V6_ILP32_OFFBIG"
3099 +#endif
3100 +#if _POSIX_V6_LP64_OFF64 == 1
3101 +"POSIX_V6_LP64_OFF64"
3102 +#endif
3103 +#if _POSIX_V6_LPBIG_OFFBIG == 1
3104 +"POSIX_V6_LPBIG_OFFBIG"
3105 +#endif
3106 +#if _XBS5_ILP32_OFF32 == 1
3107 +"XBS5_ILP32_OFF32"
3108 +#endif
3109 +#if _XBS5_ILP32_OFFBIG == 1
3110 +"XBS5_ILP32_OFFBIG"
3111 +#endif
3112 +#if _XBS5_LP64_OFF64 == 1
3113 +"XBS5_LP64_OFF64"
3114 +#endif
3115 +#if _XBS5_LPBIG_OFFBIG == 1
3116 +"XBS5_LPBIG_OFFBIG"
3117 +#endif
3118 +"";
3119 diff -Nrup a/posix/regcomp.c b/posix/regcomp.c
3120 --- a/posix/regcomp.c 2012-01-01 05:16:32.000000000 -0700
3121 +++ b/posix/regcomp.c 2012-01-01 20:41:26.681439836 -0700
3122 @@ -2745,40 +2745,29 @@ parse_bracket_exp (re_string_t *regexp,
3123
3124 /* Local function for parse_bracket_exp used in _LIBC environement.
3125 Seek the collating symbol entry correspondings to NAME.
3126 - Return the index of the symbol in the SYMB_TABLE. */
3127 + Return the index of the symbol in the SYMB_TABLE,
3128 + or -1 if not found. */
3129
3130 auto inline int32_t
3131 __attribute ((always_inline))
3132 - seek_collating_symbol_entry (name, name_len)
3133 - const unsigned char *name;
3134 - size_t name_len;
3135 + seek_collating_symbol_entry (const unsigned char *name, size_t name_len)
3136 {
3137 - int32_t hash = elem_hash ((const char *) name, name_len);
3138 - int32_t elem = hash % table_size;
3139 - if (symb_table[2 * elem] != 0)
3140 - {
3141 - int32_t second = hash % (table_size - 2) + 1;
3142 + int32_t elem;
3143
3144 - do
3145 - {
3146 - /* First compare the hashing value. */
3147 - if (symb_table[2 * elem] == hash
3148 - /* Compare the length of the name. */
3149 - && name_len == extra[symb_table[2 * elem + 1]]
3150 - /* Compare the name. */
3151 - && memcmp (name, &extra[symb_table[2 * elem + 1] + 1],
3152 - name_len) == 0)
3153 - {
3154 - /* Yep, this is the entry. */
3155 - break;
3156 - }
3157 -
3158 - /* Next entry. */
3159 - elem += second;
3160 - }
3161 - while (symb_table[2 * elem] != 0);
3162 - }
3163 - return elem;
3164 + for (elem = 0; elem < table_size; elem++)
3165 + if (symb_table[2 * elem] != 0)
3166 + {
3167 + int32_t idx = symb_table[2 * elem + 1];
3168 + /* Skip the name of collating element name. */
3169 + idx += 1 + extra[idx];
3170 + if (/* Compare the length of the name. */
3171 + name_len == extra[idx]
3172 + /* Compare the name. */
3173 + && memcmp (name, &extra[idx + 1], name_len) == 0)
3174 + /* Yep, this is the entry. */
3175 + return elem;
3176 + }
3177 + return -1;
3178 }
3179
3180 /* Local function for parse_bracket_exp used in _LIBC environment.
3181 @@ -2787,8 +2776,7 @@ parse_bracket_exp (re_string_t *regexp,
3182
3183 auto inline unsigned int
3184 __attribute ((always_inline))
3185 - lookup_collation_sequence_value (br_elem)
3186 - bracket_elem_t *br_elem;
3187 + lookup_collation_sequence_value (bracket_elem_t *br_elem)
3188 {
3189 if (br_elem->type == SB_CHAR)
3190 {
3191 @@ -2816,7 +2804,7 @@ parse_bracket_exp (re_string_t *regexp,
3192 int32_t elem, idx;
3193 elem = seek_collating_symbol_entry (br_elem->opr.name,
3194 sym_name_len);
3195 - if (symb_table[2 * elem] != 0)
3196 + if (elem != -1)
3197 {
3198 /* We found the entry. */
3199 idx = symb_table[2 * elem + 1];
3200 @@ -2834,7 +2822,7 @@ parse_bracket_exp (re_string_t *regexp,
3201 /* Return the collation sequence value. */
3202 return *(unsigned int *) (extra + idx);
3203 }
3204 - else if (symb_table[2 * elem] == 0 && sym_name_len == 1)
3205 + else if (sym_name_len == 1)
3206 {
3207 /* No valid character. Match it as a single byte
3208 character. */
3209 @@ -2856,11 +2844,8 @@ parse_bracket_exp (re_string_t *regexp,
3210
3211 auto inline reg_errcode_t
3212 __attribute ((always_inline))
3213 - build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem)
3214 - re_charset_t *mbcset;
3215 - int *range_alloc;
3216 - bitset_t sbcset;
3217 - bracket_elem_t *start_elem, *end_elem;
3218 + build_range_exp (bitset_t sbcset, re_charset_t *mbcset, int *range_alloc,
3219 + bracket_elem_t *start_elem, bracket_elem_t *end_elem)
3220 {
3221 unsigned int ch;
3222 uint32_t start_collseq;
3223 @@ -2939,25 +2924,22 @@ parse_bracket_exp (re_string_t *regexp,
3224
3225 auto inline reg_errcode_t
3226 __attribute ((always_inline))
3227 - build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name)
3228 - re_charset_t *mbcset;
3229 - int *coll_sym_alloc;
3230 - bitset_t sbcset;
3231 - const unsigned char *name;
3232 + build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
3233 + int *coll_sym_alloc, const unsigned char *name)
3234 {
3235 int32_t elem, idx;
3236 size_t name_len = strlen ((const char *) name);
3237 if (nrules != 0)
3238 {
3239 elem = seek_collating_symbol_entry (name, name_len);
3240 - if (symb_table[2 * elem] != 0)
3241 + if (elem != -1)
3242 {
3243 /* We found the entry. */
3244 idx = symb_table[2 * elem + 1];
3245 /* Skip the name of collating element name. */
3246 idx += 1 + extra[idx];
3247 }
3248 - else if (symb_table[2 * elem] == 0 && name_len == 1)
3249 + else if (name_len == 1)
3250 {
3251 /* No valid character, treat it as a normal
3252 character. */
3253 diff -Nrup a/resolv/Makefile b/resolv/Makefile
3254 --- a/resolv/Makefile 2012-01-01 05:16:32.000000000 -0700
3255 +++ b/resolv/Makefile 2012-01-01 20:41:26.682439836 -0700
3256 @@ -81,6 +81,7 @@ ifeq (yes,$(have-ssp))
3257 CFLAGS-libresolv += -fstack-protector
3258 endif
3259 CFLAGS-res_hconf.c = -fexceptions
3260 +CFLAGS-res_send.c += -fno-strict-aliasing
3261
3262 # The BIND code elicits some harmless warnings.
3263 +cflags += -Wno-strict-prototypes -Wno-write-strings
3264 diff -Nrup a/resource/getrlimit.c b/resource/getrlimit.c
3265 --- a/resource/getrlimit.c 2012-01-01 05:16:32.000000000 -0700
3266 +++ b/resource/getrlimit.c 2012-01-01 20:41:26.682439836 -0700
3267 @@ -28,6 +28,7 @@ __getrlimit (enum __rlimit_resource reso
3268 __set_errno (ENOSYS);
3269 return -1;
3270 }
3271 +libc_hidden_def (__getrlimit)
3272 weak_alias (__getrlimit, getrlimit)
3273
3274 stub_warning (getrlimit)
3275 diff -Nrup a/scripts/check-local-headers.sh b/scripts/check-local-headers.sh
3276 --- a/scripts/check-local-headers.sh 2012-01-01 05:16:32.000000000 -0700
3277 +++ b/scripts/check-local-headers.sh 2012-01-01 20:41:26.683439836 -0700
3278 @@ -29,7 +29,7 @@ exec ${AWK} -v includedir="$includedir"
3279 BEGIN {
3280 status = 0
3281 exclude = "^" includedir \
3282 - "/(asm[-/]|linux/|selinux/|gd|nss3/|sys/capability\\.h|libaudit\\.h)"
3283 + "/(asm[-/]|linux/|selinux/|gd|nss3/|sys/capability\\.h|libaudit\\.h|sys/sdt(-config)?\\.h))"
3284 }
3285 /^[^ ]/ && $1 ~ /.*:/ { obj = $1 }
3286 {
3287 diff -Nrup a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
3288 --- a/stdio-common/vfprintf.c 2012-01-01 05:16:32.000000000 -0700
3289 +++ b/stdio-common/vfprintf.c 2012-01-01 20:41:26.683439836 -0700
3290 @@ -1161,41 +1161,9 @@ vfprintf (FILE *s, const CHAR_T *format,
3291 else if (!is_long && spec != L_('S')) \
3292 { \
3293 if (prec != -1) \
3294 - { \
3295 - /* Search for the end of the string, but don't search past \
3296 - the length (in bytes) specified by the precision. Also \
3297 - don't use incomplete characters. */ \
3298 - if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX) == 1) \
3299 - len = __strnlen (string, prec); \
3300 - else \
3301 - { \
3302 - /* In case we have a multibyte character set the \
3303 - situation is more complicated. We must not copy \
3304 - bytes at the end which form an incomplete character. */\
3305 - size_t ignore_size = (unsigned) prec > 1024 ? 1024 : prec;\
3306 - wchar_t ignore[ignore_size]; \
3307 - const char *str2 = string; \
3308 - const char *strend = string + prec; \
3309 - if (strend < string) \
3310 - strend = (const char *) UINTPTR_MAX; \
3311 - \
3312 - mbstate_t ps; \
3313 - memset (&ps, '\0', sizeof (ps)); \
3314 - \
3315 - while (str2 != NULL && str2 < strend) \
3316 - if (__mbsnrtowcs (ignore, &str2, strend - str2, \
3317 - ignore_size, &ps) == (size_t) -1) \
3318 - { \
3319 - done = -1; \
3320 - goto all_done; \
3321 - } \
3322 - \
3323 - if (str2 == NULL) \
3324 - len = strlen (string); \
3325 - else \
3326 - len = str2 - string - (ps.__count & 7); \
3327 - } \
3328 - } \
3329 + /* Search for the end of the string, but don't search past \
3330 + the length (in bytes) specified by the precision. */ \
3331 + len = __strnlen (string, prec); \
3332 else \
3333 len = strlen (string); \
3334 } \
3335 diff -Nrup a/streams/Makefile b/streams/Makefile
3336 --- a/streams/Makefile 2012-01-01 05:16:32.000000000 -0700
3337 +++ b/streams/Makefile 2012-01-01 20:41:26.684439835 -0700
3338 @@ -21,7 +21,7 @@
3339 #
3340 subdir := streams
3341
3342 -headers = stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h
3343 +#headers = stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h
3344 routines = isastream getmsg getpmsg putmsg putpmsg fattach fdetach
3345
3346 include ../Rules
3347 diff -Nrup a/sunrpc/Makefile b/sunrpc/Makefile
3348 --- a/sunrpc/Makefile 2012-01-01 05:16:32.000000000 -0700
3349 +++ b/sunrpc/Makefile 2012-01-01 20:41:26.684439835 -0700
3350 @@ -53,7 +53,7 @@ headers-in-tirpc = $(addprefix rpc/,auth
3351 des_crypt.h)
3352 headers-not-in-tirpc = $(addprefix rpc/,key_prot.h rpc_des.h) \
3353 $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h
3354 -headers = rpc/netdb.h
3355 +headers = rpc/netdb.h $(headers-in-tirpc) $(headers-not-in-tirpc)
3356 install-others = $(inst_sysconfdir)/rpc
3357 generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
3358 $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen
3359 @@ -152,6 +152,10 @@ CFLAGS-openchild.c = -fexceptions
3360
3361 CPPFLAGS += -D_RPC_THREAD_SAFE_
3362
3363 +CFLAGS-clnt_tcp.c += -fno-strict-aliasing
3364 +CFLAGS-clnt_udp.c += -fno-strict-aliasing
3365 +CFLAGS-clnt_unix.c += -fno-strict-aliasing
3366 +
3367 $(objpfx)tst-getmyaddr: $(common-objpfx)linkobj/libc.so
3368 $(objpfx)tst-xdrmem: $(common-objpfx)linkobj/libc.so
3369 $(objpfx)tst-xdrmem2: $(common-objpfx)linkobj/libc.so
3370 diff -Nrup a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
3371 --- a/sysdeps/generic/dl-cache.h 2012-01-01 05:16:32.000000000 -0700
3372 +++ b/sysdeps/generic/dl-cache.h 2012-01-01 20:41:26.685439835 -0700
3373 @@ -36,6 +36,14 @@
3374 # define add_system_dir(dir) add_dir (dir)
3375 #endif
3376
3377 +#ifndef arch_startup
3378 +# define arch_startup(argc, argv) do { } while (0)
3379 +#endif
3380 +
3381 +#ifndef add_arch_dirs
3382 +# define add_arch_dirs(config_file) do { } while (0)
3383 +#endif
3384 +
3385 #define CACHEMAGIC "ld.so-1.7.0"
3386
3387 /* libc5 and glibc 2.0/2.1 use the same format. For glibc 2.2 another
3388 diff -Nrup a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile
3389 --- a/sysdeps/i386/Makefile 2012-01-01 05:16:32.000000000 -0700
3390 +++ b/sysdeps/i386/Makefile 2012-01-01 20:41:26.685439835 -0700
3391 @@ -2,6 +2,8 @@
3392 # Every i386 port in use uses gas syntax (I think).
3393 asm-CPPFLAGS += -DGAS_SYNTAX
3394
3395 +sysdep-ASFLAGS += -U__i686
3396 +
3397 # The i386 `long double' is a distinct type we support.
3398 long-double-fcts = yes
3399
3400 @@ -68,6 +70,14 @@ endif
3401
3402 ifneq (,$(filter -mno-tls-direct-seg-refs,$(CFLAGS)))
3403 defines += -DNO_TLS_DIRECT_SEG_REFS
3404 +else
3405 +# .a libraries are not performance critical and so we
3406 +# build them without direct TLS segment references
3407 +# always.
3408 +CPPFLAGS-.o += -DNO_TLS_DIRECT_SEG_REFS
3409 +CFLAGS-.o += -mno-tls-direct-seg-refs
3410 +CPPFLAGS-.oS += -DNO_TLS_DIRECT_SEG_REFS
3411 +CFLAGS-.oS += -mno-tls-direct-seg-refs
3412 endif
3413
3414 ifeq ($(subdir),elf)
3415 diff -Nrup a/sysdeps/i386/__longjmp.S b/sysdeps/i386/__longjmp.S
3416 --- a/sysdeps/i386/__longjmp.S 2012-01-01 05:16:32.000000000 -0700
3417 +++ b/sysdeps/i386/__longjmp.S 2012-01-01 20:41:26.686439835 -0700
3418 @@ -1,5 +1,5 @@
3419 /* longjmp for i386.
3420 - Copyright (C) 1995-1998,2000,2002,2005,2006,2009
3421 + Copyright (C) 1995-1998,2000,2002,2005,2006,2009,2011
3422 Free Software Foundation, Inc.
3423 This file is part of the GNU C Library.
3424
3425 @@ -21,6 +21,7 @@
3426 #include <sysdep.h>
3427 #include <jmpbuf-offsets.h>
3428 #include <asm-syntax.h>
3429 +#include <stap-probe.h>
3430
3431 .text
3432 ENTRY (__longjmp)
3433 @@ -33,6 +34,7 @@ ENTRY (__longjmp)
3434 movl (JB_SP*4)(%eax), %ecx
3435 PTR_DEMANGLE (%edx)
3436 PTR_DEMANGLE (%ecx)
3437 + LIBC_PROBE (longjmp, 3, 4@%eax, -4@8(%esp), 4@%edx)
3438 cfi_def_cfa(%eax, 0)
3439 cfi_register(%eip, %edx)
3440 cfi_register(%esp, %ecx)
3441 @@ -50,6 +52,7 @@ ENTRY (__longjmp)
3442 cfi_restore(%edi)
3443 cfi_restore(%ebp)
3444
3445 + LIBC_PROBE (longjmp_target, 3, 4@%eax, -4@8(%esp), 4@%edx)
3446 movl 8(%esp), %eax /* Second argument is return value. */
3447 movl %ecx, %esp
3448 #else
3449 @@ -57,12 +60,14 @@ ENTRY (__longjmp)
3450 movl 8(%esp), %eax /* Second argument is return value. */
3451 /* Save the return address now. */
3452 movl (JB_PC*4)(%ecx), %edx
3453 + LIBC_PROBE (longjmp, 3, 4@%ecx, -4@%eax, 4@%edx)
3454 /* Restore registers. */
3455 movl (JB_BX*4)(%ecx), %ebx
3456 movl (JB_SI*4)(%ecx), %esi
3457 movl (JB_DI*4)(%ecx), %edi
3458 movl (JB_BP*4)(%ecx), %ebp
3459 movl (JB_SP*4)(%ecx), %esp
3460 + LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%ecx, 4@%edx)
3461 #endif
3462 /* Jump to saved PC. */
3463 jmp *%edx
3464 diff -Nrup a/sysdeps/i386/bsd-_setjmp.S b/sysdeps/i386/bsd-_setjmp.S
3465 --- a/sysdeps/i386/bsd-_setjmp.S 2012-01-01 05:16:32.000000000 -0700
3466 +++ b/sysdeps/i386/bsd-_setjmp.S 2012-01-01 20:41:26.686439835 -0700
3467 @@ -1,5 +1,6 @@
3468 /* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. i386 version.
3469 - Copyright (C) 1994-1997,2000-2002,2005, 2006 Free Software Foundation, Inc.
3470 + Copyright (C) 1994-1997,2000-2002,2005,2006,2011
3471 + Free Software Foundation, Inc.
3472 This file is part of the GNU C Library.
3473
3474 The GNU C Library is free software; you can redistribute it and/or
3475 @@ -25,6 +26,7 @@
3476 #include <jmpbuf-offsets.h>
3477 #include "bp-sym.h"
3478 #include "bp-asm.h"
3479 +#include <stap-probe.h>
3480
3481 #define PARMS LINKAGE /* no space for saved regs */
3482 #define JMPBUF PARMS
3483 @@ -47,6 +49,7 @@ ENTRY (BP_SYM (_setjmp))
3484 #endif
3485 movl %ecx, (JB_SP*4)(%edx)
3486 movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
3487 + LIBC_PROBE (setjmp, 3, 4@%edx, -4@$0, 4@%ecx)
3488 #ifdef PTR_MANGLE
3489 PTR_MANGLE (%ecx)
3490 #endif
3491 diff -Nrup a/sysdeps/i386/bsd-setjmp.S b/sysdeps/i386/bsd-setjmp.S
3492 --- a/sysdeps/i386/bsd-setjmp.S 2012-01-01 05:16:32.000000000 -0700
3493 +++ b/sysdeps/i386/bsd-setjmp.S 2012-01-01 20:41:26.687439834 -0700
3494 @@ -1,5 +1,6 @@
3495 /* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. i386 version.
3496 - Copyright (C) 1994-1997,2000,2001,2005, 2006 Free Software Foundation, Inc.
3497 + Copyright (C) 1994-1997,2000,2001,2005,2006,2011
3498 + Free Software Foundation, Inc.
3499 This file is part of the GNU C Library.
3500
3501 The GNU C Library is free software; you can redistribute it and/or
3502 @@ -25,6 +26,7 @@
3503 #include <jmpbuf-offsets.h>
3504 #include "bp-sym.h"
3505 #include "bp-asm.h"
3506 +#include <stap-probe.h>
3507
3508 #define PARMS LINKAGE /* no space for saved regs */
3509 #define JMPBUF PARMS
3510 @@ -49,6 +51,7 @@ ENTRY (BP_SYM (setjmp))
3511 #endif
3512 movl %ecx, (JB_SP*4)(%eax)
3513 movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
3514 + LIBC_PROBE (setjmp, 3, 4@%eax, -4@$1, 4@%ecx)
3515 #ifdef PTR_MANGLE
3516 PTR_MANGLE (%ecx)
3517 #endif
3518 diff -Nrup a/sysdeps/i386/i686/Makefile b/sysdeps/i386/i686/Makefile
3519 --- a/sysdeps/i386/i686/Makefile 2012-01-01 05:16:32.000000000 -0700
3520 +++ b/sysdeps/i386/i686/Makefile 2012-01-01 20:41:26.687439834 -0700
3521 @@ -9,19 +9,3 @@ stack-align-test-flags += -msse
3522 ifeq ($(subdir),string)
3523 sysdep_routines += cacheinfo
3524 endif
3525 -
3526 -ifeq (yes,$(config-asflags-i686))
3527 -CFLAGS-.o += -Wa,-mtune=i686
3528 -CFLAGS-.os += -Wa,-mtune=i686
3529 -CFLAGS-.op += -Wa,-mtune=i686
3530 -CFLAGS-.og += -Wa,-mtune=i686
3531 -CFLAGS-.ob += -Wa,-mtune=i686
3532 -CFLAGS-.oS += -Wa,-mtune=i686
3533 -
3534 -ASFLAGS-.o += -Wa,-mtune=i686
3535 -ASFLAGS-.os += -Wa,-mtune=i686
3536 -ASFLAGS-.op += -Wa,-mtune=i686
3537 -ASFLAGS-.og += -Wa,-mtune=i686
3538 -ASFLAGS-.ob += -Wa,-mtune=i686
3539 -ASFLAGS-.oS += -Wa,-mtune=i686
3540 -endif
3541 diff -Nrup a/sysdeps/i386/setjmp.S b/sysdeps/i386/setjmp.S
3542 --- a/sysdeps/i386/setjmp.S 2012-01-01 05:16:32.000000000 -0700
3543 +++ b/sysdeps/i386/setjmp.S 2012-01-01 20:41:26.687439834 -0700
3544 @@ -1,5 +1,5 @@
3545 /* setjmp for i386.
3546 - Copyright (C) 1995,1996,1997,2000,2001,2005,2006
3547 + Copyright (C) 1995,1996,1997,2000,2001,2005,2006,2011
3548 Free Software Foundation, Inc.
3549 This file is part of the GNU C Library.
3550
3551 @@ -23,6 +23,7 @@
3552 #include <asm-syntax.h>
3553 #include "bp-sym.h"
3554 #include "bp-asm.h"
3555 +#include <stap-probe.h>
3556
3557 #define PARMS LINKAGE /* no space for saved regs */
3558 #define JMPBUF PARMS
3559 @@ -44,6 +45,7 @@ ENTRY (BP_SYM (__sigsetjmp))
3560 #endif
3561 movl %ecx, (JB_SP*4)(%eax)
3562 movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
3563 + LIBC_PROBE (setjmp, 3, 4@%eax, -4@SIGMSK(%esp), 4@%ecx)
3564 #ifdef PTR_MANGLE
3565 PTR_MANGLE (%ecx)
3566 #endif
3567 diff -Nrup a/sysdeps/ia64/Makefile b/sysdeps/ia64/Makefile
3568 --- a/sysdeps/ia64/Makefile 2012-01-01 05:16:32.000000000 -0700
3569 +++ b/sysdeps/ia64/Makefile 2012-01-01 20:41:26.688439833 -0700
3570 @@ -12,8 +12,8 @@ elide-routines.os += hp-timing
3571
3572 ifeq (yes,$(build-shared))
3573 # Compatibility
3574 -sysdep_routines += ia64libgcc
3575 -shared-only-routines += ia64libgcc
3576 +sysdep_routines += libgcc-compat
3577 +shared-only-routines += libgcc-compat
3578 endif
3579 endif
3580
3581 diff -Nrup a/sysdeps/ia64/ia64libgcc.S b/sysdeps/ia64/ia64libgcc.S
3582 --- a/sysdeps/ia64/ia64libgcc.S 2012-01-01 05:16:32.000000000 -0700
3583 +++ b/sysdeps/ia64/ia64libgcc.S 1969-12-31 17:00:00.000000000 -0700
3584 @@ -1,350 +0,0 @@
3585 -/* From the Intel IA-64 Optimization Guide, choose the minimum latency
3586 - alternative. */
3587 -
3588 -#include <sysdep.h>
3589 -#undef ret
3590 -
3591 -#include <shlib-compat.h>
3592 -
3593 -#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_2_6)
3594 -
3595 -/* __divtf3
3596 - Compute a 80-bit IEEE double-extended quotient.
3597 - farg0 holds the dividend. farg1 holds the divisor. */
3598 -
3599 -ENTRY(___divtf3)
3600 - cmp.eq p7, p0 = r0, r0
3601 - frcpa.s0 f10, p6 = farg0, farg1
3602 - ;;
3603 -(p6) cmp.ne p7, p0 = r0, r0
3604 - .pred.rel.mutex p6, p7
3605 -(p6) fnma.s1 f11 = farg1, f10, f1
3606 -(p6) fma.s1 f12 = farg0, f10, f0
3607 - ;;
3608 -(p6) fma.s1 f13 = f11, f11, f0
3609 -(p6) fma.s1 f14 = f11, f11, f11
3610 - ;;
3611 -(p6) fma.s1 f11 = f13, f13, f11
3612 -(p6) fma.s1 f13 = f14, f10, f10
3613 - ;;
3614 -(p6) fma.s1 f10 = f13, f11, f10
3615 -(p6) fnma.s1 f11 = farg1, f12, farg0
3616 - ;;
3617 -(p6) fma.s1 f11 = f11, f10, f12
3618 -(p6) fnma.s1 f12 = farg1, f10, f1
3619 - ;;
3620 -(p6) fma.s1 f10 = f12, f10, f10
3621 -(p6) fnma.s1 f12 = farg1, f11, farg0
3622 - ;;
3623 -(p6) fma.s0 fret0 = f12, f10, f11
3624 -(p7) mov fret0 = f10
3625 - br.ret.sptk rp
3626 -END(___divtf3)
3627 - .symver ___divtf3, __divtf3@GLIBC_2.2
3628 -
3629 -/* __divdf3
3630 - Compute a 64-bit IEEE double quotient.
3631 - farg0 holds the dividend. farg1 holds the divisor. */
3632 -
3633 -ENTRY(___divdf3)
3634 - cmp.eq p7, p0 = r0, r0
3635 - frcpa.s0 f10, p6 = farg0, farg1
3636 - ;;
3637 -(p6) cmp.ne p7, p0 = r0, r0
3638 - .pred.rel.mutex p6, p7
3639 -(p6) fmpy.s1 f11 = farg0, f10
3640 -(p6) fnma.s1 f12 = farg1, f10, f1
3641 - ;;
3642 -(p6) fma.s1 f11 = f12, f11, f11
3643 -(p6) fmpy.s1 f13 = f12, f12
3644 - ;;
3645 -(p6) fma.s1 f10 = f12, f10, f10
3646 -(p6) fma.s1 f11 = f13, f11, f11
3647 - ;;
3648 -(p6) fmpy.s1 f12 = f13, f13
3649 -(p6) fma.s1 f10 = f13, f10, f10
3650 - ;;
3651 -(p6) fma.d.s1 f11 = f12, f11, f11
3652 -(p6) fma.s1 f10 = f12, f10, f10
3653 - ;;
3654 -(p6) fnma.d.s1 f8 = farg1, f11, farg0
3655 - ;;
3656 -(p6) fma.d fret0 = f8, f10, f11
3657 -(p7) mov fret0 = f10
3658 - br.ret.sptk rp
3659 - ;;
3660 -END(___divdf3)
3661 - .symver ___divdf3, __divdf3@GLIBC_2.2
3662 -
3663 -/* __divsf3
3664 - Compute a 32-bit IEEE float quotient.
3665 - farg0 holds the dividend. farg1 holds the divisor. */
3666 -
3667 -ENTRY(___divsf3)
3668 - cmp.eq p7, p0 = r0, r0
3669 - frcpa.s0 f10, p6 = farg0, farg1
3670 - ;;
3671 -(p6) cmp.ne p7, p0 = r0, r0
3672 - .pred.rel.mutex p6, p7
3673 -(p6) fmpy.s1 f8 = farg0, f10
3674 -(p6) fnma.s1 f9 = farg1, f10, f1
3675 - ;;
3676 -(p6) fma.s1 f8 = f9, f8, f8
3677 -(p6) fmpy.s1 f9 = f9, f9
3678 - ;;
3679 -(p6) fma.s1 f8 = f9, f8, f8
3680 -(p6) fmpy.s1 f9 = f9, f9
3681 - ;;
3682 -(p6) fma.d.s1 f10 = f9, f8, f8
3683 - ;;
3684 -(p6) fnorm.s.s0 fret0 = f10
3685 -(p7) mov fret0 = f10
3686 - br.ret.sptk rp
3687 - ;;
3688 -END(___divsf3)
3689 - .symver ___divsf3, __divsf3@GLIBC_2.2
3690 -
3691 -/* __divdi3
3692 - Compute a 64-bit integer quotient.
3693 - in0 holds the dividend. in1 holds the divisor. */
3694 -
3695 -ENTRY(___divdi3)
3696 - .regstk 2,0,0,0
3697 - /* Transfer inputs to FP registers. */
3698 - setf.sig f8 = in0
3699 - setf.sig f9 = in1
3700 - ;;
3701 - /* Convert the inputs to FP, so that they won't be treated as
3702 - unsigned. */
3703 - fcvt.xf f8 = f8
3704 - fcvt.xf f9 = f9
3705 - ;;
3706 - /* Compute the reciprocal approximation. */
3707 - frcpa.s1 f10, p6 = f8, f9
3708 - ;;
3709 - /* 3 Newton-Raphson iterations. */
3710 -(p6) fnma.s1 f11 = f9, f10, f1
3711 -(p6) fmpy.s1 f12 = f8, f10
3712 - ;;
3713 -(p6) fmpy.s1 f13 = f11, f11
3714 -(p6) fma.s1 f12 = f11, f12, f12
3715 - ;;
3716 -(p6) fma.s1 f10 = f11, f10, f10
3717 -(p6) fma.s1 f11 = f13, f12, f12
3718 - ;;
3719 -(p6) fma.s1 f10 = f13, f10, f10
3720 -(p6) fnma.s1 f12 = f9, f11, f8
3721 - ;;
3722 -(p6) fma.s1 f10 = f12, f10, f11
3723 - ;;
3724 - /* Round quotient to an integer. */
3725 - fcvt.fx.trunc.s1 f10 = f10
3726 - ;;
3727 - /* Transfer result to GP registers. */
3728 - getf.sig ret0 = f10
3729 - br.ret.sptk rp
3730 - ;;
3731 -END(___divdi3)
3732 - .symver ___divdi3, __divdi3@GLIBC_2.2
3733 -
3734 -/* __moddi3
3735 - Compute a 64-bit integer modulus.
3736 - in0 holds the dividend (a). in1 holds the divisor (b). */
3737 -
3738 -ENTRY(___moddi3)
3739 - .regstk 2,0,0,0
3740 - /* Transfer inputs to FP registers. */
3741 - setf.sig f14 = in0
3742 - setf.sig f9 = in1
3743 - ;;
3744 - /* Convert the inputs to FP, so that they won't be treated as
3745 - unsigned. */
3746 - fcvt.xf f8 = f14
3747 - fcvt.xf f9 = f9
3748 - ;;
3749 - /* Compute the reciprocal approximation. */
3750 - frcpa.s1 f10, p6 = f8, f9
3751 - ;;
3752 - /* 3 Newton-Raphson iterations. */
3753 -(p6) fmpy.s1 f12 = f8, f10
3754 -(p6) fnma.s1 f11 = f9, f10, f1
3755 - ;;
3756 -(p6) fma.s1 f12 = f11, f12, f12
3757 -(p6) fmpy.s1 f13 = f11, f11
3758 - ;;
3759 -(p6) fma.s1 f10 = f11, f10, f10
3760 -(p6) fma.s1 f11 = f13, f12, f12
3761 - ;;
3762 - sub in1 = r0, in1
3763 -(p6) fma.s1 f10 = f13, f10, f10
3764 -(p6) fnma.s1 f12 = f9, f11, f8
3765 - ;;
3766 - setf.sig f9 = in1
3767 -(p6) fma.s1 f10 = f12, f10, f11
3768 - ;;
3769 - fcvt.fx.trunc.s1 f10 = f10
3770 - ;;
3771 - /* r = q * (-b) + a */
3772 - xma.l f10 = f10, f9, f14
3773 - ;;
3774 - /* Transfer result to GP registers. */
3775 - getf.sig ret0 = f10
3776 - br.ret.sptk rp
3777 - ;;
3778 -END(___moddi3)
3779 - .symver ___moddi3, __moddi3@GLIBC_2.2
3780 -
3781 -/* __udivdi3
3782 - Compute a 64-bit unsigned integer quotient.
3783 - in0 holds the dividend. in1 holds the divisor. */
3784 -
3785 -ENTRY(___udivdi3)
3786 - .regstk 2,0,0,0
3787 - /* Transfer inputs to FP registers. */
3788 - setf.sig f8 = in0
3789 - setf.sig f9 = in1
3790 - ;;
3791 - /* Convert the inputs to FP, to avoid FP software-assist faults. */
3792 - fcvt.xuf.s1 f8 = f8
3793 - fcvt.xuf.s1 f9 = f9
3794 - ;;
3795 - /* Compute the reciprocal approximation. */
3796 - frcpa.s1 f10, p6 = f8, f9
3797 - ;;
3798 - /* 3 Newton-Raphson iterations. */
3799 -(p6) fnma.s1 f11 = f9, f10, f1
3800 -(p6) fmpy.s1 f12 = f8, f10
3801 - ;;
3802 -(p6) fmpy.s1 f13 = f11, f11
3803 -(p6) fma.s1 f12 = f11, f12, f12
3804 - ;;
3805 -(p6) fma.s1 f10 = f11, f10, f10
3806 -(p6) fma.s1 f11 = f13, f12, f12
3807 - ;;
3808 -(p6) fma.s1 f10 = f13, f10, f10
3809 -(p6) fnma.s1 f12 = f9, f11, f8
3810 - ;;
3811 -(p6) fma.s1 f10 = f12, f10, f11
3812 - ;;
3813 - /* Round quotient to an unsigned integer. */
3814 - fcvt.fxu.trunc.s1 f10 = f10
3815 - ;;
3816 - /* Transfer result to GP registers. */
3817 - getf.sig ret0 = f10
3818 - br.ret.sptk rp
3819 - ;;
3820 -END(___udivdi3)
3821 - .symver ___udivdi3, __udivdi3@GLIBC_2.2
3822 -
3823 -/* __umoddi3
3824 - Compute a 64-bit unsigned integer modulus.
3825 - in0 holds the dividend (a). in1 holds the divisor (b). */
3826 -
3827 -ENTRY(___umoddi3)
3828 - .regstk 2,0,0,0
3829 - /* Transfer inputs to FP registers. */
3830 - setf.sig f14 = in0
3831 - setf.sig f9 = in1
3832 - ;;
3833 - /* Convert the inputs to FP, to avoid FP software assist faults. */
3834 - fcvt.xuf.s1 f8 = f14
3835 - fcvt.xuf.s1 f9 = f9
3836 - ;;
3837 - /* Compute the reciprocal approximation. */
3838 - frcpa.s1 f10, p6 = f8, f9
3839 - ;;
3840 - /* 3 Newton-Raphson iterations. */
3841 -(p6) fmpy.s1 f12 = f8, f10
3842 -(p6) fnma.s1 f11 = f9, f10, f1
3843 - ;;
3844 -(p6) fma.s1 f12 = f11, f12, f12
3845 -(p6) fmpy.s1 f13 = f11, f11
3846 - ;;
3847 -(p6) fma.s1 f10 = f11, f10, f10
3848 -(p6) fma.s1 f11 = f13, f12, f12
3849 - ;;
3850 - sub in1 = r0, in1
3851 -(p6) fma.s1 f10 = f13, f10, f10
3852 -(p6) fnma.s1 f12 = f9, f11, f8
3853 - ;;
3854 - setf.sig f9 = in1
3855 -(p6) fma.s1 f10 = f12, f10, f11
3856 - ;;
3857 - /* Round quotient to an unsigned integer. */
3858 - fcvt.fxu.trunc.s1 f10 = f10
3859 - ;;
3860 - /* r = q * (-b) + a */
3861 - xma.l f10 = f10, f9, f14
3862 - ;;
3863 - /* Transfer result to GP registers. */
3864 - getf.sig ret0 = f10
3865 - br.ret.sptk rp
3866 - ;;
3867 -END(___umoddi3)
3868 - .symver ___umoddi3, __umoddi3@GLIBC_2.2
3869 -
3870 -/* __multi3
3871 - Compute a 128-bit multiply of 128-bit multiplicands.
3872 - in0/in1 holds one multiplicand (a), in2/in3 holds the other one (b). */
3873 -
3874 -ENTRY(___multi3)
3875 - .regstk 4,0,0,0
3876 - setf.sig f6 = in1
3877 - movl r19 = 0xffffffff
3878 - setf.sig f7 = in2
3879 - ;;
3880 - and r14 = r19, in0
3881 - ;;
3882 - setf.sig f10 = r14
3883 - and r14 = r19, in2
3884 - xmpy.l f9 = f6, f7
3885 - ;;
3886 - setf.sig f6 = r14
3887 - shr.u r14 = in0, 32
3888 - ;;
3889 - setf.sig f7 = r14
3890 - shr.u r14 = in2, 32
3891 - ;;
3892 - setf.sig f8 = r14
3893 - xmpy.l f11 = f10, f6
3894 - xmpy.l f6 = f7, f6
3895 - ;;
3896 - getf.sig r16 = f11
3897 - xmpy.l f7 = f7, f8
3898 - ;;
3899 - shr.u r14 = r16, 32
3900 - and r16 = r19, r16
3901 - getf.sig r17 = f6
3902 - setf.sig f6 = in0
3903 - ;;
3904 - setf.sig f11 = r14
3905 - getf.sig r21 = f7
3906 - setf.sig f7 = in3
3907 - ;;
3908 - xma.l f11 = f10, f8, f11
3909 - xma.l f6 = f6, f7, f9
3910 - ;;
3911 - getf.sig r18 = f11
3912 - ;;
3913 - add r18 = r18, r17
3914 - ;;
3915 - and r15 = r19, r18
3916 - cmp.ltu p7, p6 = r18, r17
3917 - ;;
3918 - getf.sig r22 = f6
3919 -(p7) adds r14 = 1, r19
3920 - ;;
3921 -(p7) add r21 = r21, r14
3922 - shr.u r14 = r18, 32
3923 - shl r15 = r15, 32
3924 - ;;
3925 - add r20 = r21, r14
3926 - ;;
3927 - add ret0 = r15, r16
3928 - add ret1 = r22, r20
3929 - br.ret.sptk rp
3930 - ;;
3931 -END(___multi3)
3932 - .symver ___multi3, __multi3@GLIBC_2.2
3933 -
3934 -#endif
3935 diff -Nrup a/sysdeps/ia64/libgcc-compat.c b/sysdeps/ia64/libgcc-compat.c
3936 --- a/sysdeps/ia64/libgcc-compat.c 1969-12-31 17:00:00.000000000 -0700
3937 +++ b/sysdeps/ia64/libgcc-compat.c 2012-01-01 20:41:26.694439833 -0700
3938 @@ -0,0 +1,84 @@
3939 +/* pre-.hidden libgcc compatibility
3940 + Copyright (C) 2002 Free Software Foundation, Inc.
3941 + This file is part of the GNU C Library.
3942 +
3943 + The GNU C Library is free software; you can redistribute it and/or
3944 + modify it under the terms of the GNU Lesser General Public
3945 + License as published by the Free Software Foundation; either
3946 + version 2.1 of the License, or (at your option) any later version.
3947 +
3948 + The GNU C Library is distributed in the hope that it will be useful,
3949 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3950 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3951 + Lesser General Public License for more details.
3952 +
3953 + You should have received a copy of the GNU Lesser General Public
3954 + License along with the GNU C Library; if not, write to the Free
3955 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
3956 + 02111-1307 USA. */
3957 +
3958 +
3959 +#include <stdint.h>
3960 +#include <shlib-compat.h>
3961 +
3962 +#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_2_6)
3963 +
3964 +typedef int int128_t __attribute__((__mode__(TI)));
3965 +
3966 +extern long double __divtf3 (long double, long double) attribute_hidden;
3967 +long double INTUSE (__divtf3) (long double x, long double y)
3968 +{
3969 + return __divtf3 (x, y);
3970 +}
3971 +symbol_version (INTUSE (__divtf3), __divtf3, GLIBC_2.2);
3972 +
3973 +extern double __divdf3 (double, double) attribute_hidden;
3974 +double INTUSE (__divdf3) (double x, double y)
3975 +{
3976 + return __divdf3 (x, y);
3977 +}
3978 +symbol_version (INTUSE (__divdf3), __divdf3, GLIBC_2.2);
3979 +
3980 +extern float __divsf3 (float, float) attribute_hidden;
3981 +float INTUSE (__divsf3) (float x, float y)
3982 +{
3983 + return __divsf3 (x, y);
3984 +}
3985 +symbol_version (INTUSE (__divsf3), __divsf3, GLIBC_2.2);
3986 +
3987 +extern int64_t __divdi3 (int64_t, int64_t) attribute_hidden;
3988 +int64_t INTUSE (__divdi3) (int64_t x, int64_t y)
3989 +{
3990 + return __divdi3 (x, y);
3991 +}
3992 +symbol_version (INTUSE (__divdi3), __divdi3, GLIBC_2.2);
3993 +
3994 +extern int64_t __moddi3 (int64_t, int64_t) attribute_hidden;
3995 +int64_t INTUSE (__moddi3) (int64_t x, int64_t y)
3996 +{
3997 + return __moddi3 (x, y);
3998 +}
3999 +symbol_version (INTUSE (__moddi3), __moddi3, GLIBC_2.2);
4000 +
4001 +extern uint64_t __udivdi3 (uint64_t, uint64_t) attribute_hidden;
4002 +uint64_t INTUSE (__udivdi3) (uint64_t x, uint64_t y)
4003 +{
4004 + return __udivdi3 (x, y);
4005 +}
4006 +symbol_version (INTUSE (__udivdi3), __udivdi3, GLIBC_2.2);
4007 +
4008 +extern uint64_t __umoddi3 (uint64_t, uint64_t) attribute_hidden;
4009 +uint64_t INTUSE (__umoddi3) (uint64_t x, uint64_t y)
4010 +{
4011 + return __umoddi3 (x, y);
4012 +}
4013 +symbol_version (INTUSE (__umoddi3), __umoddi3, GLIBC_2.2);
4014 +
4015 +extern int128_t __multi3 (int128_t, int128_t) attribute_hidden;
4016 +int128_t INTUSE (__multi3) (int128_t x, int128_t y)
4017 +{
4018 + return __multi3 (x, y);
4019 +}
4020 +symbol_version (INTUSE (__multi3), __multi3, GLIBC_2.2);
4021 +
4022 +#endif
4023 diff -Nrup a/sysdeps/mach/hurd/getrlimit.c b/sysdeps/mach/hurd/getrlimit.c
4024 --- a/sysdeps/mach/hurd/getrlimit.c 2012-01-01 05:16:32.000000000 -0700
4025 +++ b/sysdeps/mach/hurd/getrlimit.c 2012-01-01 20:41:26.694439833 -0700
4026 @@ -44,4 +44,5 @@ __getrlimit (enum __rlimit_resource reso
4027
4028 return 0;
4029 }
4030 +libc_hidden_def (__getrlimit)
4031 weak_alias (__getrlimit, getrlimit)
4032 diff -Nrup a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
4033 --- a/sysdeps/posix/getaddrinfo.c 2012-01-01 05:16:32.000000000 -0700
4034 +++ b/sysdeps/posix/getaddrinfo.c 2012-01-01 20:41:26.695439833 -0700
4035 @@ -565,8 +565,8 @@ gaih_inet (const char *name, const struc
4036
4037 /* If we do not have to look for IPv6 addresses, use
4038 the simple, old functions, which do not support
4039 - IPv6 scope ids. */
4040 - if (req->ai_family == AF_INET)
4041 + IPv6 scope ids, nor retrieving the canonical name. */
4042 + if (req->ai_family == AF_INET && (req->ai_flags & AI_CANONNAME) == 0)
4043 {
4044 size_t tmpbuflen = 512;
4045 assert (tmpbuf == NULL);
4046 @@ -1105,68 +1105,10 @@ gaih_inet (const char *name, const struc
4047 /* Only the first entry gets the canonical name. */
4048 if (at2 == at && (req->ai_flags & AI_CANONNAME) != 0)
4049 {
4050 - char *tmpbuf2 = NULL;
4051 - bool malloc_tmpbuf2 = false;
4052 -
4053 if (canon == NULL)
4054 - {
4055 - struct hostent *h = NULL;
4056 - int herrno;
4057 - struct hostent th;
4058 - size_t tmpbuf2len = 512;
4059 -
4060 - do
4061 - {
4062 - if (__libc_use_alloca (alloca_used + 2 * tmpbuf2len))
4063 - tmpbuf2 = extend_alloca_account (tmpbuf2, tmpbuf2len,
4064 - tmpbuf2len * 2,
4065 - alloca_used);
4066 - else
4067 - {
4068 - char *newp = realloc (malloc_tmpbuf2 ? tmpbuf2 : NULL,
4069 - 2 * tmpbuf2len);
4070 - if (newp == NULL)
4071 - {
4072 - if (malloc_tmpbuf2)
4073 - free (tmpbuf2);
4074 - result = -EAI_MEMORY;
4075 - goto free_and_return;
4076 - }
4077 -
4078 - tmpbuf2 = newp;
4079 - tmpbuf2len = 2 * tmpbuf2len;
4080 - malloc_tmpbuf2 = true;
4081 - }
4082 -
4083 - rc = __gethostbyaddr_r (at2->addr,
4084 - ((at2->family == AF_INET6)
4085 - ? sizeof (struct in6_addr)
4086 - : sizeof (struct in_addr)),
4087 - at2->family, &th, tmpbuf2,
4088 - tmpbuf2len, &h, &herrno);
4089 - }
4090 - while (rc == ERANGE && herrno == NETDB_INTERNAL);
4091 -
4092 - if (rc != 0 && herrno == NETDB_INTERNAL)
4093 - {
4094 - if (malloc_tmpbuf2)
4095 - free (tmpbuf2);
4096 -
4097 - __set_h_errno (herrno);
4098 - result = -EAI_SYSTEM;
4099 - goto free_and_return;
4100 - }
4101 -
4102 - if (h != NULL)
4103 - canon = h->h_name;
4104 - else
4105 - {
4106 - assert (orig_name != NULL);
4107 - /* If the canonical name cannot be determined, use
4108 - the passed in string. */
4109 - canon = orig_name;
4110 - }
4111 - }
4112 + /* If the canonical name cannot be determined, use
4113 + the passed in string. */
4114 + canon = orig_name;
4115
4116 #ifdef HAVE_LIBIDN
4117 if (req->ai_flags & AI_CANONIDN)
4118 @@ -1181,9 +1123,6 @@ gaih_inet (const char *name, const struc
4119 int rc = __idna_to_unicode_lzlz (canon, &out, idn_flags);
4120 if (rc != IDNA_SUCCESS)
4121 {
4122 - if (malloc_tmpbuf2)
4123 - free (tmpbuf2);
4124 -
4125 if (rc == IDNA_MALLOC_ERROR)
4126 result = -EAI_MEMORY;
4127 else if (rc == IDNA_DLOPEN_ERROR)
4128 @@ -1213,17 +1152,11 @@ gaih_inet (const char *name, const struc
4129 canon = strdup (canon);
4130 if (canon == NULL)
4131 {
4132 - if (malloc_tmpbuf2)
4133 - free (tmpbuf2);
4134 -
4135 result = -EAI_MEMORY;
4136 goto free_and_return;
4137 }
4138 }
4139 }
4140 -
4141 - if (malloc_tmpbuf2)
4142 - free (tmpbuf2);
4143 }
4144
4145 family = at2->family;
4146 @@ -1360,10 +1293,12 @@ static const struct scopeentry
4147 /* Link-local addresses: scope 2. */
4148 { { { 169, 254, 0, 0 } }, htonl_c (0xffff0000), 2 },
4149 { { { 127, 0, 0, 0 } }, htonl_c (0xff000000), 2 },
4150 +#if 0
4151 /* Site-local addresses: scope 5. */
4152 { { { 10, 0, 0, 0 } }, htonl_c (0xff000000), 5 },
4153 { { { 172, 16, 0, 0 } }, htonl_c (0xfff00000), 5 },
4154 { { { 192, 168, 0, 0 } }, htonl_c (0xffff0000), 5 },
4155 +#endif
4156 /* Default: scope 14. */
4157 { { { 0, 0, 0, 0 } }, htonl_c (0x00000000), 14 }
4158 };
4159 diff -Nrup a/sysdeps/powerpc/powerpc64/Makefile b/sysdeps/powerpc/powerpc64/Makefile
4160 --- a/sysdeps/powerpc/powerpc64/Makefile 2012-01-01 05:16:32.000000000 -0700
4161 +++ b/sysdeps/powerpc/powerpc64/Makefile 2012-01-01 20:41:26.695439833 -0700
4162 @@ -33,6 +33,7 @@ ifneq ($(elf),no)
4163 # we use -fpic instead which is much better.
4164 CFLAGS-initfini.s += -fpic -O1
4165 endif
4166 +CFLAGS-libc-start.c += -fno-asynchronous-unwind-tables
4167 endif
4168
4169 ifeq ($(subdir),elf)
4170 diff -Nrup a/sysdeps/powerpc/powerpc64/elf/Makefile b/sysdeps/powerpc/powerpc64/elf/Makefile
4171 --- a/sysdeps/powerpc/powerpc64/elf/Makefile 2012-01-01 05:16:32.000000000 -0700
4172 +++ b/sysdeps/powerpc/powerpc64/elf/Makefile 2012-01-01 20:41:26.696439833 -0700
4173 @@ -9,3 +9,5 @@ CFLAGS-rtld-mempcpy.os = $(no-special-re
4174 CFLAGS-rtld-memmove.os = $(no-special-regs)
4175 CFLAGS-rtld-memchr.os = $(no-special-regs)
4176 CFLAGS-rtld-strnlen.os = $(no-special-regs)
4177 +
4178 +CFLAGS-gmon-start.c = -fno-strict-aliasing
4179 diff -Nrup a/sysdeps/s390/s390-64/utf16-utf32-z9.c b/sysdeps/s390/s390-64/utf16-utf32-z9.c
4180 --- a/sysdeps/s390/s390-64/utf16-utf32-z9.c 2012-01-01 05:16:32.000000000 -0700
4181 +++ b/sysdeps/s390/s390-64/utf16-utf32-z9.c 2012-01-01 20:41:26.696439833 -0700
4182 @@ -169,10 +169,7 @@ gconv_end (struct __gconv_step *data)
4183 register unsigned long long outlen asm("11") = outend - outptr; \
4184 uint64_t cc = 0; \
4185 \
4186 - asm volatile (".machine push \n\t" \
4187 - ".machine \"z9-109\" \n\t" \
4188 - "0: " INSTRUCTION " \n\t" \
4189 - ".machine pop \n\t" \
4190 + asm volatile ("0: " INSTRUCTION " \n\t" \
4191 " jo 0b \n\t" \
4192 " ipm %2 \n" \
4193 : "+a" (pOutput), "+a" (pInput), "+d" (cc), \
4194 diff -Nrup a/sysdeps/s390/s390-64/utf8-utf16-z9.c b/sysdeps/s390/s390-64/utf8-utf16-z9.c
4195 --- a/sysdeps/s390/s390-64/utf8-utf16-z9.c 2012-01-01 05:16:32.000000000 -0700
4196 +++ b/sysdeps/s390/s390-64/utf8-utf16-z9.c 2012-01-01 20:41:26.697439833 -0700
4197 @@ -151,10 +151,7 @@ gconv_end (struct __gconv_step *data)
4198 register unsigned long long outlen asm("11") = outend - outptr; \
4199 uint64_t cc = 0; \
4200 \
4201 - asm volatile (".machine push \n\t" \
4202 - ".machine \"z9-109\" \n\t" \
4203 - "0: " INSTRUCTION " \n\t" \
4204 - ".machine pop \n\t" \
4205 + asm volatile ("0: " INSTRUCTION " \n\t" \
4206 " jo 0b \n\t" \
4207 " ipm %2 \n" \
4208 : "+a" (pOutput), "+a" (pInput), "+d" (cc), \
4209 diff -Nrup a/sysdeps/s390/s390-64/utf8-utf32-z9.c b/sysdeps/s390/s390-64/utf8-utf32-z9.c
4210 --- a/sysdeps/s390/s390-64/utf8-utf32-z9.c 2012-01-01 05:16:32.000000000 -0700
4211 +++ b/sysdeps/s390/s390-64/utf8-utf32-z9.c 2012-01-01 20:41:26.697439833 -0700
4212 @@ -155,10 +155,7 @@ gconv_end (struct __gconv_step *data)
4213 register unsigned long long outlen asm("11") = outend - outptr; \
4214 uint64_t cc = 0; \
4215 \
4216 - asm volatile (".machine push \n\t" \
4217 - ".machine \"z9-109\" \n\t" \
4218 - "0: " INSTRUCTION " \n\t" \
4219 - ".machine pop \n\t" \
4220 + asm volatile ("0: " INSTRUCTION " \n\t" \
4221 " jo 0b \n\t" \
4222 " ipm %2 \n" \
4223 : "+a" (pOutput), "+a" (pInput), "+d" (cc), \
4224 diff -Nrup a/sysdeps/unix/nice.c b/sysdeps/unix/nice.c
4225 --- a/sysdeps/unix/nice.c 2012-01-01 05:16:32.000000000 -0700
4226 +++ b/sysdeps/unix/nice.c 2012-01-01 20:41:26.698439833 -0700
4227 @@ -42,7 +42,12 @@ nice (int incr)
4228 __set_errno (save);
4229 }
4230
4231 - result = setpriority (PRIO_PROCESS, 0, prio + incr);
4232 + prio += incr;
4233 + if (prio < PRIO_MIN)
4234 + prio = PRIO_MIN;
4235 + else if (prio >= PRIO_MAX)
4236 + prio = PRIO_MAX - 1;
4237 + result = setpriority (PRIO_PROCESS, 0, prio);
4238 if (result == -1)
4239 {
4240 if (errno == EACCES)
4241 diff -Nrup a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
4242 --- a/sysdeps/unix/sysv/linux/check_pf.c 2012-01-01 05:16:32.000000000 -0700
4243 +++ b/sysdeps/unix/sysv/linux/check_pf.c 2012-01-01 20:41:26.698439833 -0700
4244 @@ -27,16 +27,14 @@
4245 #include <unistd.h>
4246 #include <sys/socket.h>
4247
4248 -#include <asm/types.h>
4249 -#include <linux/netlink.h>
4250 -#include <linux/rtnetlink.h>
4251 -
4252 #include <not-cancel.h>
4253 #include <kernel-features.h>
4254 #include <bits/libc-lock.h>
4255 #include <atomic.h>
4256 #include <nscd/nscd-client.h>
4257
4258 +#include "netlinkaccess.h"
4259 +
4260
4261 #ifndef IFA_F_HOMEADDRESS
4262 # define IFA_F_HOMEADDRESS 0
4263 diff -Nrup a/sysdeps/unix/sysv/linux/futimesat.c b/sysdeps/unix/sysv/linux/futimesat.c
4264 --- a/sysdeps/unix/sysv/linux/futimesat.c 2012-01-01 05:16:32.000000000 -0700
4265 +++ b/sysdeps/unix/sysv/linux/futimesat.c 2012-01-01 20:41:26.699439832 -0700
4266 @@ -37,14 +37,14 @@ futimesat (fd, file, tvp)
4267 {
4268 int result;
4269
4270 + if (file == NULL)
4271 + return __futimes (fd, tvp);
4272 +
4273 #ifdef __NR_futimesat
4274 # ifndef __ASSUME_ATFCTS
4275 if (__have_atfcts >= 0)
4276 # endif
4277 {
4278 - if (file == NULL)
4279 - return __futimes (fd, tvp);
4280 -
4281 result = INLINE_SYSCALL (futimesat, 3, fd, file, tvp);
4282 # ifndef __ASSUME_ATFCTS
4283 if (result == -1 && errno == ENOSYS)
4284 @@ -58,22 +58,7 @@ futimesat (fd, file, tvp)
4285 #ifndef __ASSUME_ATFCTS
4286 char *buf = NULL;
4287
4288 - if (file == NULL)
4289 - {
4290 - static const char procfd[] = "/proc/self/fd/%d";
4291 - /* Buffer for the path name we are going to use. It consists of
4292 - - the string /proc/self/fd/
4293 - - the file descriptor number.
4294 - The final NUL is included in the sizeof. A bit of overhead
4295 - due to the format elements compensates for possible negative
4296 - numbers. */
4297 - size_t buflen = sizeof (procfd) + sizeof (int) * 3;
4298 - buf = alloca (buflen);
4299 -
4300 - __snprintf (buf, buflen, procfd, fd);
4301 - file = buf;
4302 - }
4303 - else if (fd != AT_FDCWD && file[0] != '/')
4304 + if (fd != AT_FDCWD && file[0] != '/')
4305 {
4306 size_t filelen = strlen (file);
4307 if (__builtin_expect (filelen == 0, 0))
4308 diff -Nrup a/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S b/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
4309 --- a/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S 2012-01-01 05:16:32.000000000 -0700
4310 +++ b/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S 2012-01-01 20:41:26.699439832 -0700
4311 @@ -1,4 +1,5 @@
4312 -/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
4313 +/* Copyright (C) 2001,2004,2005,2006,2009,2011
4314 + Free Software Foundation, Inc.
4315 This file is part of the GNU C Library.
4316
4317 The GNU C Library is free software; you can redistribute it and/or
4318 @@ -19,6 +20,7 @@
4319 #include <sysdep.h>
4320 #include <jmpbuf-offsets.h>
4321 #include <asm-syntax.h>
4322 +#include <stap-probe.h>
4323
4324
4325 .section .rodata.str1.1,"aMS",@progbits,1
4326 @@ -79,7 +81,9 @@ ENTRY (____longjmp_chk)
4327 cfi_adjust_cfa_offset(-12)
4328 movl 4(%esp), %ecx
4329
4330 -.Lok: /* We add unwind information for the target here. */
4331 +.Lok:
4332 + LIBC_PROBE (longjmp, 3, 4@%ecx, -4@8(%esp), 4@%edx)
4333 + /* We add unwind information for the target here. */
4334 cfi_def_cfa(%ecx, 0)
4335 cfi_register(%eip, %edx)
4336 cfi_register(%esp, %edi)
4337 @@ -102,5 +106,6 @@ ENTRY (____longjmp_chk)
4338 cfi_restore(%ebp)
4339
4340 /* Jump to saved PC. */
4341 + LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%eax, 4@%edx)
4342 jmp *%edx
4343 END (____longjmp_chk)
4344 diff -Nrup a/sysdeps/unix/sysv/linux/i386/dl-cache.h b/sysdeps/unix/sysv/linux/i386/dl-cache.h
4345 --- a/sysdeps/unix/sysv/linux/i386/dl-cache.h 1969-12-31 17:00:00.000000000 -0700
4346 +++ b/sysdeps/unix/sysv/linux/i386/dl-cache.h 2012-01-01 20:41:26.700439831 -0700
4347 @@ -0,0 +1,59 @@
4348 +/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
4349 + Copyright (C) 2004 Free Software Foundation, Inc.
4350 + This file is part of the GNU C Library.
4351 +
4352 + The GNU C Library is free software; you can redistribute it and/or
4353 + modify it under the terms of the GNU Lesser General Public
4354 + License as published by the Free Software Foundation; either
4355 + version 2.1 of the License, or (at your option) any later version.
4356 +
4357 + The GNU C Library is distributed in the hope that it will be useful,
4358 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4359 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4360 + Lesser General Public License for more details.
4361 +
4362 + You should have received a copy of the GNU Lesser General Public
4363 + License along with the GNU C Library; if not, write to the Free
4364 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4365 + 02111-1307 USA. */
4366 +
4367 +static inline int
4368 +is_ia64 (void)
4369 +{
4370 + unsigned int fl1, fl2;
4371 +
4372 + /* See if we can use cpuid. */
4373 + __asm__ ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;"
4374 + "pushl %0; popfl; pushfl; popl %0; popfl"
4375 + : "=&r" (fl1), "=&r" (fl2)
4376 + : "i" (0x00200000));
4377 + if (((fl1 ^ fl2) & 0x00200000) == 0)
4378 + return 0;
4379 +
4380 + /* Host supports cpuid. See if cpuid gives capabilities, try
4381 + CPUID(0). Preserve %ebx and %ecx; cpuid insn clobbers these, we
4382 + don't need their CPUID values here, and %ebx may be the PIC
4383 + register. */
4384 + __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx"
4385 + : "=a" (fl1) : "0" (0) : "edx", "cc");
4386 + if (fl1 == 0)
4387 + return 0;
4388 +
4389 + /* Invoke CPUID(1), return %edx; caller can examine bits to
4390 + determine what's supported. */
4391 + __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx"
4392 + : "=d" (fl2), "=a" (fl1) : "1" (1) : "cc");
4393 + return (fl2 & (1 << 30)) != 0;
4394 +}
4395 +
4396 +#define arch_startup(argc, argv) \
4397 + do { \
4398 + /* On IA-64, try to execute 64-bit ldconfig if possible. \
4399 + This is because the badly designed /emul/ia32-linux hack \
4400 + will cause 32-bit ldconfig to do all sorts of weird things. */ \
4401 + if (is_ia64 ()) \
4402 + execv ("/emul/ia32-linux/../../sbin/ldconfig", \
4403 + (char *const *) argv); \
4404 + } while (0)
4405 +
4406 +#include_next <dl-cache.h>
4407 diff -Nrup a/sysdeps/unix/sysv/linux/i386/getrlimit.c b/sysdeps/unix/sysv/linux/i386/getrlimit.c
4408 --- a/sysdeps/unix/sysv/linux/i386/getrlimit.c 2012-01-01 05:16:32.000000000 -0700
4409 +++ b/sysdeps/unix/sysv/linux/i386/getrlimit.c 2012-01-01 20:41:26.700439831 -0700
4410 @@ -79,4 +79,5 @@ __new_getrlimit (enum __rlimit_resource
4411 }
4412
4413 weak_alias (__new_getrlimit, __getrlimit);
4414 +libc_hidden_weak (__getrlimit)
4415 versioned_symbol (libc, __new_getrlimit, getrlimit, GLIBC_2_2);
4416 diff -Nrup a/sysdeps/unix/sysv/linux/ia64/dl-cache.h b/sysdeps/unix/sysv/linux/ia64/dl-cache.h
4417 --- a/sysdeps/unix/sysv/linux/ia64/dl-cache.h 2012-01-01 05:16:32.000000000 -0700
4418 +++ b/sysdeps/unix/sysv/linux/ia64/dl-cache.h 2012-01-01 20:41:26.701439831 -0700
4419 @@ -22,4 +22,31 @@
4420 #define _dl_cache_check_flags(flags) \
4421 ((flags) == _DL_CACHE_DEFAULT_ID)
4422
4423 +#define EMUL_HACK "/emul/ia32-linux"
4424 +
4425 +#define arch_startup(argc, argv) unlink (EMUL_HACK LD_SO_CACHE)
4426 +
4427 +#define add_arch_dirs(config_file) \
4428 + do { \
4429 + int save_verbose = opt_verbose; \
4430 + opt_verbose = 0; \
4431 + \
4432 + parse_conf (config_file, EMUL_HACK, true); \
4433 + \
4434 + /* Always add the standard search paths. */ \
4435 + add_system_dir (EMUL_HACK SLIBDIR); \
4436 + if (strcmp (SLIBDIR, LIBDIR)) \
4437 + add_system_dir (EMUL_HACK LIBDIR); \
4438 + \
4439 + char emul_config_file[strlen (config_file) \
4440 + + sizeof EMUL_HACK]; \
4441 + strcpy (mempcpy (emul_config_file, EMUL_HACK, \
4442 + strlen (EMUL_HACK)), config_file); \
4443 + \
4444 + if (! access (emul_config_file, R_OK)) \
4445 + parse_conf (emul_config_file, EMUL_HACK, true); \
4446 + \
4447 + opt_verbose = save_verbose; \
4448 + } while (0)
4449 +
4450 #include_next <dl-cache.h>
4451 diff -Nrup a/sysdeps/unix/sysv/linux/ia64/dl-procinfo.c b/sysdeps/unix/sysv/linux/ia64/dl-procinfo.c
4452 --- a/sysdeps/unix/sysv/linux/ia64/dl-procinfo.c 1969-12-31 17:00:00.000000000 -0700
4453 +++ b/sysdeps/unix/sysv/linux/ia64/dl-procinfo.c 2012-01-01 20:41:26.701439831 -0700
4454 @@ -0,0 +1,5 @@
4455 +#ifdef IS_IN_ldconfig
4456 +#include <sysdeps/i386/dl-procinfo.c>
4457 +#else
4458 +#include <sysdeps/generic/dl-procinfo.c>
4459 +#endif
4460 diff -Nrup a/sysdeps/unix/sysv/linux/ia64/dl-procinfo.h b/sysdeps/unix/sysv/linux/ia64/dl-procinfo.h
4461 --- a/sysdeps/unix/sysv/linux/ia64/dl-procinfo.h 1969-12-31 17:00:00.000000000 -0700
4462 +++ b/sysdeps/unix/sysv/linux/ia64/dl-procinfo.h 2012-01-01 20:41:26.701439831 -0700
4463 @@ -0,0 +1,5 @@
4464 +#ifdef IS_IN_ldconfig
4465 +#include <sysdeps/unix/sysv/linux/i386/dl-procinfo.h>
4466 +#else
4467 +#include <sysdeps/generic/dl-procinfo.h>
4468 +#endif
4469 diff -Nrup a/sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed b/sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
4470 --- a/sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed 2012-01-01 05:16:32.000000000 -0700
4471 +++ b/sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed 2012-01-01 20:41:26.701439831 -0700
4472 @@ -1 +1 @@
4473 -s_^\(RTLDLIST=\)\([^ ]*\)-ia64\(\.so\.[0-9.]*\)[ ]*$_\1"\2-ia64\3 \2\3"_
4474 +s_^\(RTLDLIST=\)\([^ ]*\)-ia64\(\.so\.[0-9.]*\)[ ]*$_\1"\2-ia64\3 /emul/ia32-linux\2\3"_
4475 diff -Nrup a/sysdeps/unix/sysv/linux/netlinkaccess.h b/sysdeps/unix/sysv/linux/netlinkaccess.h
4476 --- a/sysdeps/unix/sysv/linux/netlinkaccess.h 2012-01-01 05:16:32.000000000 -0700
4477 +++ b/sysdeps/unix/sysv/linux/netlinkaccess.h 2012-01-01 20:41:26.702439831 -0700
4478 @@ -25,6 +25,24 @@
4479
4480 #include <kernel-features.h>
4481
4482 +#ifndef IFA_MAX
4483 +/* 2.6.19 kernel headers helpfully removed some macros and
4484 + moved lots of stuff into new headers, some of which aren't
4485 + included by linux/rtnetlink.h. */
4486 +#include <linux/if_addr.h>
4487 +#endif
4488 +
4489 +#ifndef IFA_RTA
4490 +# define IFA_RTA(r) \
4491 + ((struct rtattr*) ((char*)(r) + NLMSG_ALIGN (sizeof (struct ifaddrmsg))))
4492 +# define IFA_PAYLOAD(n) NLMSG_PAYLOAD (n, sizeof (struct ifaddrmsg))
4493 +#endif
4494 +
4495 +#ifndef IFLA_RTA
4496 +# define IFLA_RTA(r) \
4497 + ((struct rtattr*) ((char*)(r) + NLMSG_ALIGN (sizeof (struct ifinfomsg))))
4498 +# define IFLA_PAYLOAD(n) NLMSG_PAYLOAD (n, sizeof (struct ifinfomsg))
4499 +#endif
4500
4501 struct netlink_res
4502 {
4503 diff -Nrup a/sysdeps/unix/sysv/linux/paths.h b/sysdeps/unix/sysv/linux/paths.h
4504 --- a/sysdeps/unix/sysv/linux/paths.h 2012-01-01 05:16:32.000000000 -0700
4505 +++ b/sysdeps/unix/sysv/linux/paths.h 2012-01-01 20:41:26.702439831 -0700
4506 @@ -62,7 +62,7 @@
4507 #define _PATH_TTY "/dev/tty"
4508 #define _PATH_UNIX "/boot/vmlinux"
4509 #define _PATH_UTMP "/var/run/utmp"
4510 -#define _PATH_VI "/usr/bin/vi"
4511 +#define _PATH_VI "/bin/vi"
4512 #define _PATH_WTMP "/var/log/wtmp"
4513
4514 /* Provide trailing slash, since mostly used for building pathnames. */
4515 diff -Nrup a/sysdeps/unix/sysv/linux/tcsetattr.c b/sysdeps/unix/sysv/linux/tcsetattr.c
4516 --- a/sysdeps/unix/sysv/linux/tcsetattr.c 2012-01-01 05:16:32.000000000 -0700
4517 +++ b/sysdeps/unix/sysv/linux/tcsetattr.c 2012-01-01 20:41:26.703439831 -0700
4518 @@ -49,6 +49,7 @@ tcsetattr (fd, optional_actions, termios
4519 {
4520 struct __kernel_termios k_termios;
4521 unsigned long int cmd;
4522 + int retval;
4523
4524 switch (optional_actions)
4525 {
4526 @@ -80,6 +81,35 @@ tcsetattr (fd, optional_actions, termios
4527 memcpy (&k_termios.c_cc[0], &termios_p->c_cc[0],
4528 __KERNEL_NCCS * sizeof (cc_t));
4529
4530 - return INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios);
4531 + retval = INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios);
4532 +
4533 + if (retval == 0 && cmd == TCSETS)
4534 + {
4535 + /* The Linux kernel has a bug which silently ignore the invalid
4536 + c_cflag on pty. We have to check it here. */
4537 + int save = errno;
4538 + retval = INLINE_SYSCALL (ioctl, 3, fd, TCGETS, &k_termios);
4539 + if (retval)
4540 + {
4541 + /* We cannot verify if the setting is ok. We don't return
4542 + an error (?). */
4543 + __set_errno (save);
4544 + retval = 0;
4545 + }
4546 + else if ((termios_p->c_cflag & (PARENB | CREAD))
4547 + != (k_termios.c_cflag & (PARENB | CREAD))
4548 + || ((termios_p->c_cflag & CSIZE)
4549 + && ((termios_p->c_cflag & CSIZE)
4550 + != (k_termios.c_cflag & CSIZE))))
4551 + {
4552 + /* It looks like the Linux kernel silently changed the
4553 + PARENB/CREAD/CSIZE bits in c_cflag. Report it as an
4554 + error. */
4555 + __set_errno (EINVAL);
4556 + retval = -1;
4557 + }
4558 + }
4559 +
4560 + return retval;
4561 }
4562 libc_hidden_def (tcsetattr)
4563 diff -Nrup a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
4564 --- a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S 2012-01-01 05:16:32.000000000 -0700
4565 +++ b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S 2012-01-01 20:41:26.703439831 -0700
4566 @@ -19,6 +19,7 @@
4567 #include <sysdep.h>
4568 #include <jmpbuf-offsets.h>
4569 #include <asm-syntax.h>
4570 +#include <stap-probe.h>
4571
4572 .section .rodata.str1.1,"aMS",@progbits,1
4573 .type longjmp_msg,@object
4574 @@ -94,7 +95,9 @@ ENTRY(____longjmp_chk)
4575 movl %ebx, %esi
4576 cfi_restore (%rsi)
4577
4578 -.Lok: /* We add unwind information for the target here. */
4579 +.Lok:
4580 + LIBC_PROBE (longjmp, 3, 8@%rdi, -4@%esi, 8@%rdx)
4581 + /* We add unwind information for the target here. */
4582 cfi_def_cfa(%rdi, 0)
4583 cfi_register(%rsp,%r8)
4584 cfi_register(%rbp,%r9)
4585 @@ -113,5 +116,6 @@ ENTRY(____longjmp_chk)
4586 movl %esi, %eax
4587 movq %r8,%rsp
4588 movq %r9,%rbp
4589 + LIBC_PROBE (longjmp_target, 3, 8@%rdi, -4@%eax, 8@%rdx)
4590 jmpq *%rdx
4591 END (____longjmp_chk)
4592 diff -Nrup a/sysdeps/x86_64/__longjmp.S b/sysdeps/x86_64/__longjmp.S
4593 --- a/sysdeps/x86_64/__longjmp.S 2012-01-01 05:16:32.000000000 -0700
4594 +++ b/sysdeps/x86_64/__longjmp.S 2012-01-01 20:41:26.703439831 -0700
4595 @@ -1,4 +1,4 @@
4596 -/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
4597 +/* Copyright (C) 2001,2004,2005,2006,2009,2011 Free Software Foundation, Inc.
4598 This file is part of the GNU C Library.
4599
4600 The GNU C Library is free software; you can redistribute it and/or
4601 @@ -19,6 +19,7 @@
4602 #include <sysdep.h>
4603 #include <jmpbuf-offsets.h>
4604 #include <asm-syntax.h>
4605 +#include <stap-probe.h>
4606
4607 /* Jump to the position specified by ENV, causing the
4608 setjmp call there to return VAL, or 1 if VAL is 0.
4609 @@ -34,6 +35,7 @@ ENTRY(__longjmp)
4610 PTR_DEMANGLE (%r9)
4611 PTR_DEMANGLE (%rdx)
4612 #endif
4613 + LIBC_PROBE (longjmp, 3, 8@%rdi, -4@%esi, 8@%rdx)
4614 /* We add unwind information for the target here. */
4615 cfi_def_cfa(%rdi, 0)
4616 cfi_register(%rsp,%r8)
4617 @@ -53,5 +55,6 @@ ENTRY(__longjmp)
4618 mov %esi, %eax
4619 movq %r8,%rsp
4620 movq %r9,%rbp
4621 + LIBC_PROBE (longjmp_target, 3, 8@%rdi, -4@%eax, 8@%rdx)
4622 jmpq *%rdx
4623 END (__longjmp)
4624 diff -Nrup a/sysdeps/x86_64/setjmp.S b/sysdeps/x86_64/setjmp.S
4625 --- a/sysdeps/x86_64/setjmp.S 2012-01-01 05:16:32.000000000 -0700
4626 +++ b/sysdeps/x86_64/setjmp.S 2012-01-01 20:41:26.704439831 -0700
4627 @@ -1,5 +1,5 @@
4628 /* setjmp for x86-64.
4629 - Copyright (C) 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
4630 + Copyright (C) 2001,2003,2005,2006,2011 Free Software Foundation, Inc.
4631 This file is part of the GNU C Library.
4632
4633 The GNU C Library is free software; you can redistribute it and/or
4634 @@ -20,6 +20,7 @@
4635 #include <sysdep.h>
4636 #include <jmpbuf-offsets.h>
4637 #include <asm-syntax.h>
4638 +#include <stap-probe.h>
4639
4640 ENTRY (__sigsetjmp)
4641 /* Save registers. */
4642 @@ -41,6 +42,7 @@ ENTRY (__sigsetjmp)
4643 #endif
4644 movq %rdx, (JB_RSP*8)(%rdi)
4645 movq (%rsp), %rax /* Save PC we are returning to now. */
4646 + LIBC_PROBE (setjmp, 3, 8@%rdi, -4@%esi, 8@%rax)
4647 #ifdef PTR_MANGLE
4648 PTR_MANGLE (%rax)
4649 #endif
4650 diff -Nrup a/timezone/zic.c b/timezone/zic.c
4651 --- a/timezone/zic.c 2012-01-01 05:16:32.000000000 -0700
4652 +++ b/timezone/zic.c 2012-01-01 20:41:26.705439831 -0700
4653 @@ -1921,7 +1921,7 @@ const int zonecount;
4654 if (stdrp != NULL && stdrp->r_hiyear == 2037)
4655 return;
4656 }
4657 - if (stdrp == NULL && zp->z_nrules != 0)
4658 + if (stdrp == NULL && (zp->z_nrules != 0 || zp->z_stdoff != 0))
4659 return;
4660 abbrvar = (stdrp == NULL) ? "" : stdrp->r_abbrvar;
4661 doabbr(result, zp->z_format, abbrvar, FALSE, TRUE);