summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-05-26 17:46:57 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-05-26 17:46:57 +0000
commitd8d5895e420d4976fca22b9bd9e1edc3094ebf30 (patch)
treef96c015c14ac0428150153ba98f7a681ff021931 /libc
parent62eb53f68d92687a028f3c515489b30e3df1d979 (diff)
Merge changes between r18519 and r18730 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@18731 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc')
-rw-r--r--libc/ChangeLog1884
-rw-r--r--libc/INSTALL31
-rw-r--r--libc/Makeconfig9
-rw-r--r--libc/Makerules28
-rw-r--r--libc/NEWS119
-rw-r--r--libc/README.libm856
-rw-r--r--libc/argp/argp-help.c4
-rw-r--r--libc/argp/argp-parse.c4
-rw-r--r--libc/assert/assert.c5
-rw-r--r--libc/bits/types.h11
-rw-r--r--libc/bits/typesizes.h6
-rw-r--r--libc/config.h.in4
-rw-r--r--libc/config.make.in2
-rwxr-xr-xlibc/configure629
-rw-r--r--libc/configure.in183
-rw-r--r--libc/conform/data/stdio.h-data32
-rw-r--r--libc/conform/data/stdlib.h-data24
-rw-r--r--libc/crypt/sha512c-test.c2
-rw-r--r--libc/csu/.gitignore1
-rw-r--r--libc/debug/fgets_chk.c5
-rw-r--r--libc/debug/fgets_u_chk.c5
-rw-r--r--libc/debug/fread_chk.c5
-rw-r--r--libc/debug/fread_u_chk.c6
-rw-r--r--libc/debug/gets_chk.c5
-rw-r--r--libc/debug/obprintf_chk.c5
-rw-r--r--libc/debug/vasprintf_chk.c5
-rw-r--r--libc/debug/vdprintf_chk.c11
-rw-r--r--libc/debug/vsnprintf_chk.c5
-rw-r--r--libc/debug/vsprintf_chk.c19
-rw-r--r--libc/elf/Makefile3
-rw-r--r--libc/elf/dl-support.c2
-rw-r--r--libc/elf/dl-sysdep.c9
-rw-r--r--libc/elf/rtld-Rules5
-rw-r--r--libc/elf/rtld.c2
-rw-r--r--libc/elf/stackguard-macros.h32
-rw-r--r--libc/elf/tst-execstack.c71
-rw-r--r--libc/elf/tst-relsort1.c2
-rw-r--r--libc/extra-lib.mk2
-rw-r--r--libc/iconvdata/tcvn5712-1.c5
-rw-r--r--libc/include/argz.h7
-rw-r--r--libc/include/libintl.h10
-rw-r--r--libc/include/libio.h7
-rw-r--r--libc/include/shlib-compat.h10
-rw-r--r--libc/include/stap-probe.h80
-rw-r--r--libc/include/stdc-predef.h5
-rw-r--r--libc/include/stdio.h7
-rw-r--r--libc/include/stdio_ext.h2
-rw-r--r--libc/include/sys/time.h9
-rw-r--r--libc/intl/dcgettext.c3
-rw-r--r--libc/intl/dgettext.c4
-rw-r--r--libc/intl/gettext.c4
-rw-r--r--libc/intl/l10nflist.c11
-rw-r--r--libc/libio/__fpurge.c6
-rw-r--r--libc/libio/__fsetlocking.c4
-rw-r--r--libc/libio/filedoalloc.c4
-rw-r--r--libc/libio/fileops.c145
-rw-r--r--libc/libio/freopen.c4
-rw-r--r--libc/libio/freopen64.c4
-rw-r--r--libc/libio/genops.c85
-rw-r--r--libc/libio/iofclose.c6
-rw-r--r--libc/libio/iofdopen.c13
-rw-r--r--libc/libio/iofflush.c7
-rw-r--r--libc/libio/iofflush_u.c4
-rw-r--r--libc/libio/iofgets.c5
-rw-r--r--libc/libio/iofgets_u.c4
-rw-r--r--libc/libio/iofopen.c10
-rw-r--r--libc/libio/iofopncook.c49
-rw-r--r--libc/libio/iofread.c7
-rw-r--r--libc/libio/iofread_u.c4
-rw-r--r--libc/libio/ioftell.c5
-rw-r--r--libc/libio/iofwrite.c5
-rw-r--r--libc/libio/iogetline.c12
-rw-r--r--libc/libio/iogets.c4
-rw-r--r--libc/libio/iogetwline.c4
-rw-r--r--libc/libio/iolibio.h35
-rw-r--r--libc/libio/iopadn.c4
-rw-r--r--libc/libio/iopopen.c21
-rw-r--r--libc/libio/ioseekoff.c7
-rw-r--r--libc/libio/ioseekpos.c6
-rw-r--r--libc/libio/iosetbuffer.c5
-rw-r--r--libc/libio/iosetvbuf.c5
-rw-r--r--libc/libio/ioungetc.c4
-rw-r--r--libc/libio/ioungetwc.c5
-rw-r--r--libc/libio/iovdprintf.c11
-rw-r--r--libc/libio/iovsprintf.c6
-rw-r--r--libc/libio/iovsscanf.c4
-rw-r--r--libc/libio/libioP.h178
-rw-r--r--libc/libio/memstream.c22
-rw-r--r--libc/libio/obprintf.c5
-rw-r--r--libc/libio/oldfileops.c52
-rw-r--r--libc/libio/oldiofclose.c7
-rw-r--r--libc/libio/oldiofdopen.c5
-rw-r--r--libc/libio/oldiofopen.c5
-rw-r--r--libc/libio/oldiopopen.c18
-rw-r--r--libc/libio/oldstdfiles.c4
-rw-r--r--libc/libio/putc.c5
-rw-r--r--libc/libio/setbuf.c4
-rw-r--r--libc/libio/setlinebuf.c4
-rw-r--r--libc/libio/stdfiles.c4
-rw-r--r--libc/libio/strops.c36
-rw-r--r--libc/libio/vasprintf.c5
-rw-r--r--libc/libio/vscanf.c4
-rw-r--r--libc/libio/vsnprintf.c22
-rw-r--r--libc/libio/vswprintf.c17
-rw-r--r--libc/libio/wfiledoalloc.c7
-rw-r--r--libc/libio/wfileops.c110
-rw-r--r--libc/libio/wgenops.c65
-rw-r--r--libc/libio/wmemstream.c10
-rw-r--r--libc/libio/wstrops.c20
-rw-r--r--libc/localedata/ChangeLog15
-rw-r--r--libc/localedata/Makefile8
-rw-r--r--libc/localedata/SUPPORTED2
-rw-r--r--libc/localedata/locales/mag_IN168
-rw-r--r--libc/localedata/tst-strptime.c54
-rw-r--r--libc/malloc/malloc.c165
-rw-r--r--libc/malloc/mtrace.c4
-rw-r--r--libc/manual/.gitignore30
-rw-r--r--libc/manual/Makefile177
-rw-r--r--libc/manual/contrib.texi337
-rw-r--r--libc/manual/examples/search.c5
-rw-r--r--libc/manual/install.texi23
-rw-r--r--libc/manual/libc-texinfo.sh19
-rw-r--r--libc/manual/startup.texi30
-rw-r--r--libc/manual/string.texi11
-rw-r--r--libc/math/bug-nextafter.c6
-rw-r--r--libc/math/bug-nexttoward.c6
-rwxr-xr-xlibc/math/gen-libm-test.pl17
-rw-r--r--libc/math/libm-test.inc443
-rw-r--r--libc/math/s_ccosh.c43
-rw-r--r--libc/math/s_ccoshf.c43
-rw-r--r--libc/math/s_ccoshl.c43
-rw-r--r--libc/math/s_csin.c43
-rw-r--r--libc/math/s_csinf.c43
-rw-r--r--libc/math/s_csinh.c43
-rw-r--r--libc/math/s_csinhf.c43
-rw-r--r--libc/math/s_csinhl.c43
-rw-r--r--libc/math/s_csinl.c43
-rw-r--r--libc/math/test-fenv.c6
-rw-r--r--libc/math/test-misc.c6
-rw-r--r--libc/misc/Makefile4
-rw-r--r--libc/misc/Versions3
-rw-r--r--libc/misc/error.c6
-rw-r--r--libc/misc/getauxval.c (renamed from libc/sysdeps/powerpc/soft-fp/q_qtoi.c)31
-rw-r--r--libc/misc/sys/auxv.h (renamed from libc/sysdeps/powerpc/soft-fp/q_qtoull.c)35
-rw-r--r--libc/misc/syslog.c2
-rw-r--r--libc/nptl/ChangeLog189
-rw-r--r--libc/nptl/DESIGN-systemtap-probes.txt89
-rw-r--r--libc/nptl/Makefile2
-rw-r--r--libc/nptl/descr.h15
-rw-r--r--libc/nptl/pthreadP.h17
-rw-r--r--libc/nptl/pthread_cancel.c8
-rw-r--r--libc/nptl/pthread_cond_broadcast.c3
-rw-r--r--libc/nptl/pthread_cond_destroy.c19
-rw-r--r--libc/nptl/pthread_cond_init.c6
-rw-r--r--libc/nptl/pthread_cond_signal.c5
-rw-r--r--libc/nptl/pthread_cond_wait.c9
-rw-r--r--libc/nptl/pthread_create.c8
-rw-r--r--libc/nptl/pthread_getattr_np.c16
-rw-r--r--libc/nptl/pthread_join.c8
-rw-r--r--libc/nptl/pthread_mutex_destroy.c6
-rw-r--r--libc/nptl/pthread_mutex_init.c7
-rw-r--r--libc/nptl/pthread_mutex_lock.c10
-rw-r--r--libc/nptl/pthread_mutex_timedlock.c14
-rw-r--r--libc/nptl/pthread_mutex_unlock.c10
-rw-r--r--libc/nptl/pthread_rwlock_destroy.c5
-rw-r--r--libc/nptl/pthread_rwlock_rdlock.c7
-rw-r--r--libc/nptl/pthread_rwlock_unlock.c5
-rw-r--r--libc/nptl/pthread_rwlock_wrlock.c7
-rw-r--r--libc/nptl/shlib-versions1
-rw-r--r--libc/nptl/sysdeps/pthread/pthread.h11
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S7
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S5
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S6
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S6
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S6
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S5
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S5
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h6
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h5
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.c3
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h41
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S6
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S10
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h75
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S19
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S13
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S53
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S67
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S6
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S7
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S7
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S2
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S18
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S12
-rw-r--r--libc/nptl/sysdeps/x86_64/64/shlib-versions3
-rw-r--r--libc/nptl/sysdeps/x86_64/tls.h7
-rw-r--r--libc/nptl/sysdeps/x86_64/x32/shlib-versions3
-rw-r--r--libc/nptl/tst-cancel-self-cancelstate.c65
-rw-r--r--libc/nptl/tst-cancel-self-canceltype.c53
-rw-r--r--libc/nptl/tst-cancel-self-cleanup.c (renamed from libc/sysdeps/powerpc/soft-fp/q_qtoll.c)24
-rw-r--r--libc/nptl/tst-cancel-self-testcancel.c (renamed from libc/sysdeps/powerpc/soft-fp/q_fge.c)49
-rw-r--r--libc/nptl/tst-cancel-self.c (renamed from libc/sysdeps/powerpc/soft-fp/q_cmpe.c)51
-rw-r--r--libc/nptl/tst-stackguard1.c4
-rw-r--r--libc/nptl/vars.c4
-rw-r--r--libc/nscd/nscd-client.h22
-rw-r--r--libc/nscd/nscd_gethst_r.c21
-rw-r--r--libc/nscd/nscd_helper.c15
-rw-r--r--libc/nss/nsswitch.c94
-rw-r--r--libc/posix/regex_internal.h4
-rw-r--r--libc/scripts/data/c++-types-x32-linux-gnu.data67
-rw-r--r--libc/shlib-versions2
-rw-r--r--libc/stdio-common/Makefile5
-rw-r--r--libc/stdio-common/_itoa.c11
-rw-r--r--libc/stdio-common/asprintf.c5
-rw-r--r--libc/stdio-common/bug15.c10
-rw-r--r--libc/stdio-common/bug22.c2
-rw-r--r--libc/stdio-common/bug25.c70
-rw-r--r--libc/stdio-common/fxprintf.c4
-rw-r--r--libc/stdio-common/getw.c4
-rw-r--r--libc/stdio-common/isoc99_fscanf.c4
-rw-r--r--libc/stdio-common/isoc99_scanf.c5
-rw-r--r--libc/stdio-common/isoc99_vfscanf.c4
-rw-r--r--libc/stdio-common/isoc99_vscanf.c4
-rw-r--r--libc/stdio-common/isoc99_vsscanf.c4
-rw-r--r--libc/stdio-common/printf-prs.c5
-rw-r--r--libc/stdio-common/printf_fp.c4
-rw-r--r--libc/stdio-common/printf_fphex.c4
-rw-r--r--libc/stdio-common/printf_size.c4
-rw-r--r--libc/stdio-common/putw.c4
-rw-r--r--libc/stdio-common/scanf.c5
-rw-r--r--libc/stdio-common/sprintf.c5
-rw-r--r--libc/stdio-common/tmpfile.c5
-rw-r--r--libc/stdio-common/vfprintf.c31
-rw-r--r--libc/stdio-common/vfscanf.c11
-rw-r--r--libc/stdlib/bug-getcontext.c4
-rw-r--r--libc/stdlib/strfmon_l.c7
-rw-r--r--libc/string/argz-count.c4
-rw-r--r--libc/string/argz-stringify.c4
-rw-r--r--libc/sunrpc/Makefile8
-rw-r--r--libc/sunrpc/openchild.c4
-rw-r--r--libc/sunrpc/svc_simple.c5
-rw-r--r--libc/sunrpc/xcrypt.c3
-rw-r--r--libc/sunrpc/xdr_stdio.c8
-rw-r--r--libc/sysdeps/generic/bits/hwcap.h23
-rw-r--r--libc/sysdeps/generic/ldsodefs.h3
-rw-r--r--libc/sysdeps/generic/stackguard-macros.h4
-rw-r--r--libc/sysdeps/gnu/bits/utmp.h7
-rw-r--r--libc/sysdeps/gnu/bits/utmpx.h4
-rw-r--r--libc/sysdeps/i386/__longjmp.S8
-rw-r--r--libc/sysdeps/i386/bsd-_setjmp.S4
-rw-r--r--libc/sysdeps/i386/bsd-setjmp.S4
-rw-r--r--libc/sysdeps/i386/dl-machine.h4
-rw-r--r--libc/sysdeps/i386/fpu/bits/mathinline.h37
-rw-r--r--libc/sysdeps/i386/fpu/libm-test-ulps219
-rw-r--r--libc/sysdeps/i386/i686/fpu/multiarch/Makefile3
-rw-r--r--libc/sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S22
-rw-r--r--libc/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S324
-rw-r--r--libc/sysdeps/i386/i686/fpu/multiarch/e_expf.c15
-rw-r--r--libc/sysdeps/i386/i686/multiarch/Makefile1
-rw-r--r--libc/sysdeps/i386/i686/multiarch/test-multiarch.c1
-rw-r--r--libc/sysdeps/i386/i686/multiarch/wcschr-c.c12
-rw-r--r--libc/sysdeps/i386/setjmp.S5
-rw-r--r--libc/sysdeps/i386/stackguard-macros.h4
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_log10.c59
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_log2.c114
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c86
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c128
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c2
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_acosf.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-opt/Makefile1
-rw-r--r--libc/sysdeps/ieee754/ldbl-opt/nldbl-compat.c10
-rw-r--r--libc/sysdeps/mach/gettimeofday.c8
-rw-r--r--libc/sysdeps/mach/hurd/bits/typesizes.h6
-rw-r--r--libc/sysdeps/mach/hurd/tmpfile.c4
-rw-r--r--libc/sysdeps/posix/gettimeofday.c8
-rw-r--r--libc/sysdeps/powerpc/bits/hwcap.h53
-rw-r--r--libc/sysdeps/powerpc/fpu/libm-test-ulps216
-rw-r--r--libc/sysdeps/powerpc/memmove.c6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/bits/wordsize.h2
-rw-r--r--libc/sysdeps/powerpc/powerpc32/dl-irel.h4
-rw-r--r--libc/sysdeps/powerpc/powerpc32/dl-machine.c13
-rw-r--r--libc/sysdeps/powerpc/powerpc32/dl-machine.h5
-rw-r--r--libc/sysdeps/powerpc/powerpc32/dl-start.S7
-rw-r--r--libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S9
-rw-r--r--libc/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S8
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/Makefile4
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/fpu/Makefile2
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S9
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S11
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c77
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logbf.c60
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c72
-rw-r--r--libc/sysdeps/powerpc/powerpc32/stackguard-macros.h4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/__longjmp-common.S8
-rw-r--r--libc/sysdeps/powerpc/powerpc64/bits/wordsize.h2
-rw-r--r--libc/sysdeps/powerpc/powerpc64/dl-irel.h4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/dl-machine.h12
-rw-r--r--libc/sysdeps/powerpc/powerpc64/dl-trampoline.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power4/Makefile4
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power4/fpu/Makefile2
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S7
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S9
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c1
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c1
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c1
-rw-r--r--libc/sysdeps/powerpc/powerpc64/setjmp-common.S8
-rw-r--r--libc/sysdeps/powerpc/powerpc64/stackguard-macros.h4
-rw-r--r--libc/sysdeps/powerpc/soft-fp/Makefile35
-rw-r--r--libc/sysdeps/powerpc/soft-fp/Subdirs1
-rw-r--r--libc/sysdeps/powerpc/soft-fp/Versions9
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_add.c38
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_cmp.c40
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_div.c38
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_fgt.c39
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_fle.c39
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_flt.c39
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_fne.c39
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_itoq.c37
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_lltoq.c37
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_mul.c38
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_neg.c46
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_stoq.c42
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_sub.c38
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_ulltoq.c37
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_util.c56
-rw-r--r--libc/sysdeps/powerpc/soft-fp/q_utoq.c37
-rw-r--r--libc/sysdeps/powerpc/soft-fp/sfp-machine.h62
-rw-r--r--libc/sysdeps/powerpc/sysdep.h29
-rw-r--r--libc/sysdeps/s390/fpu/libm-test-ulps4
-rw-r--r--libc/sysdeps/s390/s390-32/stackguard-macros.h4
-rw-r--r--libc/sysdeps/s390/s390-64/stackguard-macros.h4
-rw-r--r--libc/sysdeps/sparc/bits/hwcap.h47
-rw-r--r--libc/sysdeps/sparc/fpu/libm-test-ulps294
-rw-r--r--libc/sysdeps/sparc/sparc32/bits/wordsize.h2
-rw-r--r--libc/sysdeps/sparc/sparc32/stackguard-macros.h4
-rw-r--r--libc/sysdeps/sparc/sparc64/bits/wordsize.h2
-rw-r--r--libc/sysdeps/sparc/sparc64/stackguard-macros.h4
-rw-r--r--libc/sysdeps/sparc/sysdep.h29
-rw-r--r--libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h6
-rw-r--r--libc/sysdeps/unix/make-syscalls.sh146
-rw-r--r--libc/sysdeps/unix/syscalls.list2
-rw-r--r--libc/sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/in.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/ipc.h6
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/mqueue.h14
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/resource.h95
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/statfs.h24
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/statvfs.h5
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/sysctl.h1
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/timex.h47
-rw-r--r--libc/sysdeps/unix/sysv/linux/check_pf.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/configure39
-rw-r--r--libc/sysdeps/unix/sysv/linux/configure.in39
-rw-r--r--libc/sysdeps/unix/sysv/linux/dl-osinfo.h14
-rw-r--r--libc/sysdeps/unix/sysv/linux/dl-vdso.h23
-rw-r--r--libc/sysdeps/unix/sysv/linux/getcwd.c170
-rw-r--r--libc/sysdeps/unix/sysv/linux/getdents.c15
-rw-r--r--libc/sysdeps/unix/sysv/linux/getsysstats.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S8
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/bits/mman.h6
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/chown.c96
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/fchown.c37
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/fchownat.c13
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/getegid.c31
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/geteuid.c31
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/getgid.c32
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/getgroups.c45
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/getresgid.c51
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/getresuid.c50
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/getrlimit.c47
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/getuid.c35
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/lchown.c42
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/msgctl.c88
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist2
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/semctl.c86
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setegid.c24
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/seteuid.c23
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setfsgid.c40
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setfsuid.c40
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setgid.c43
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setgroups.c54
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setregid.c42
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setresgid.c51
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setresuid.c51
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setreuid.c41
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setrlimit.c42
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setuid.c41
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/shmctl.c100
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/sigaction.c101
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/sysdep.h21
-rw-r--r--libc/sysdeps/unix/sysv/linux/if_index.c201
-rw-r--r--libc/sysdeps/unix/sysv/linux/ifreq.c57
-rw-r--r--libc/sysdeps/unix/sysv/linux/kernel-features.h117
-rw-r--r--libc/sysdeps/unix/sysv/linux/local-setxid.h15
-rw-r--r--libc/sysdeps/unix/sysv/linux/opendir.c9
-rw-r--r--libc/sysdeps/unix/sysv/linux/opensock.c9
-rw-r--r--libc/sysdeps/unix/sysv/linux/poll.c104
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/bits/mman.h3
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/chown.c92
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/fchownat.c12
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c29
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c28
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c28
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c28
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c28
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c28
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c28
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c28
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/pread.c23
-rw-r--r--libc/sysdeps/unix/sysv/linux/pread64.c24
-rw-r--r--libc/sysdeps/unix/sysv/linux/pselect.c8
-rw-r--r--libc/sysdeps/unix/sysv/linux/ptsname.c8
-rw-r--r--libc/sysdeps/unix/sysv/linux/pwrite.c23
-rw-r--r--libc/sysdeps/unix/sysv/linux/pwrite64.c24
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/bits/hwcap.h (renamed from libc/sysdeps/powerpc/soft-fp/q_dtoq.c)45
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/bits/mman.h3
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h6
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/gettimeofday.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c51
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/lchown.c37
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist2
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist2
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/sys/ucontext.h6
-rw-r--r--libc/sysdeps/unix/sysv/linux/setegid.c24
-rw-r--r--libc/sysdeps/unix/sysv/linux/seteuid.c24
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/bits/mman.h3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/chown.c37
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/pread.c29
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/pread64.c29
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/pwrite.c29
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/pwrite64.c29
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigaction.c99
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigpending.c29
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigprocmask.c31
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigsuspend.c33
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/bits/mman.h3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h6
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c86
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c108
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sys/reboot.h8
-rw-r--r--libc/sysdeps/unix/sysv/linux/sys/sysctl.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/syscalls.list1
-rw-r--r--libc/sysdeps/unix/sysv/linux/sysctl.mk3
-rw-r--r--libc/sysdeps/unix/sysv/linux/syslog.c8
-rw-r--r--libc/sysdeps/unix/sysv/linux/testrtsig.h8
-rw-r--r--libc/sysdeps/unix/sysv/linux/ttyname.c10
-rw-r--r--libc/sysdeps/unix/sysv/linux/ttyname_r.c10
-rw-r--r--libc/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/wordsize-64/preadv.c73
-rw-r--r--libc/sysdeps/unix/sysv/linux/wordsize-64/pwritev.c73
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist2
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/Makefile4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S55
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/a.out.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h8
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/ipctypes.h (renamed from libc/sysdeps/powerpc/soft-fp/q_qtou.c)32
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/mman.h6
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/msq.h19
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h12
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/shm.h43
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h62
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/siginfo.h330
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/stat.h42
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/sysctl.h20
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/typesizes.h75
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/clone.S2
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c25
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S14
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sigaltstack-offsets.sym15
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h13
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h7
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h8
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sys/reg.h5
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h13
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sys/user.h94
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sysdep.S4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h202
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/Makefile7
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c62
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/configure18
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/dl-cache.h23
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/ftw.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/ftw64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/getcpu.c (renamed from libc/sysdeps/powerpc/soft-fp/q_sqrt.c)28
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/glob.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/init-first.c (renamed from libc/sysdeps/powerpc/soft-fp/q_qtos.c)44
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/llseek.S1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/lseek.S (renamed from libc/sysdeps/powerpc/soft-fp/q_feq.c)44
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/ld.abilist11
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libBrokenLocale.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libanl.abilist6
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist2080
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libcrypt.abilist9
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libdl.abilist11
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libm.abilist397
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libnsl.abilist123
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist225
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libresolv.abilist93
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/librt.abilist42
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libthread_db.abilist42
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libutil.abilist8
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu-static.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S (renamed from libc/sysdeps/powerpc/soft-fp/q_qtod.c)60
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list8
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/sysctl.mk1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h25
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile64.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort.c1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort64.c1
-rw-r--r--libc/sysdeps/unix/x86_64/sysdep.S6
-rw-r--r--libc/sysdeps/x86_64/64/Implies-after1
-rw-r--r--libc/sysdeps/x86_64/64/shlib-versions4
-rw-r--r--libc/sysdeps/x86_64/Implies1
-rw-r--r--libc/sysdeps/x86_64/Makefile4
-rw-r--r--libc/sysdeps/x86_64/__longjmp.S28
-rw-r--r--libc/sysdeps/x86_64/bits/wordsize.h7
-rw-r--r--libc/sysdeps/x86_64/dl-machine.h6
-rw-r--r--libc/sysdeps/x86_64/dl-trampoline.h16
-rw-r--r--libc/sysdeps/x86_64/fpu/bits/mathinline.h7
-rw-r--r--libc/sysdeps/x86_64/fpu/libm-test-ulps116
-rw-r--r--libc/sysdeps/x86_64/memcpy.S4
-rw-r--r--libc/sysdeps/x86_64/multiarch/Makefile1
-rw-r--r--libc/sysdeps/x86_64/multiarch/init-arch.c27
-rw-r--r--libc/sysdeps/x86_64/multiarch/init-arch.h51
-rw-r--r--libc/sysdeps/x86_64/multiarch/memcmp-sse4.S8
-rw-r--r--libc/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S20
-rw-r--r--libc/sysdeps/x86_64/multiarch/memcpy-ssse3.S24
-rw-r--r--libc/sysdeps/x86_64/multiarch/strcmp-sse42.S12
-rw-r--r--libc/sysdeps/x86_64/multiarch/strcmp.S9
-rw-r--r--libc/sysdeps/x86_64/multiarch/test-multiarch.c90
-rw-r--r--libc/sysdeps/x86_64/setjmp.S25
-rw-r--r--libc/sysdeps/x86_64/stackguard-macros.h6
-rw-r--r--libc/sysdeps/x86_64/stackinfo.h4
-rw-r--r--libc/sysdeps/x86_64/start.S37
-rw-r--r--libc/sysdeps/x86_64/strcmp.S12
-rw-r--r--libc/sysdeps/x86_64/sysdep.h61
-rw-r--r--libc/sysdeps/x86_64/tst-mallocalign1.c72
-rw-r--r--libc/sysdeps/x86_64/x32/Implies-after1
-rw-r--r--libc/sysdeps/x86_64/x32/_itoa.h4
-rw-r--r--libc/sysdeps/x86_64/x32/divdi3.c1
-rw-r--r--libc/sysdeps/x86_64/x32/dl-machine.h86
-rw-r--r--libc/sysdeps/x86_64/x32/ffs.c4
-rw-r--r--libc/sysdeps/x86_64/x32/gmp-mparam.h33
-rw-r--r--libc/sysdeps/x86_64/x32/shlib-versions8
-rw-r--r--libc/sysdeps/x86_64/x32/symbol-hacks.h1
-rw-r--r--libc/sysdeps/x86_64/x32/sysdep.h92
-rw-r--r--libc/sysvipc/sys/msg.h2
-rw-r--r--libc/time/ctime.c6
-rw-r--r--libc/time/gettimeofday.c11
-rw-r--r--libc/time/mktime.c216
-rw-r--r--libc/time/time.h4
-rw-r--r--libc/wcsmbs/Makefile2
-rw-r--r--libc/wcsmbs/tst-mbsnrtowcs.c83
585 files changed, 13497 insertions, 8103 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index 8a10d6ab0..7ee459ba4 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,1887 @@
+2012-05-26 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ [BZ #12416]
+ * elf/tst-execstack.c: Include stackinfo.h.
+ (do_test): Adjust test case to ensure that pthread_getattr_np
+ behaviour remains the same after marking stack executable.
+
+2012-05-25 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_NEW_GETRLIMIT_SYSCALL): Remove all definitions.
+ * sysdeps/unix/sysv/linux/i386/getrlimit.c: Do not include
+ kernel-features.h.
+ [!__ASSUME_NEW_GETRLIMIT_SYSCALL]: Remove conditional code.
+ [__ASSUME_NEW_GETRLIMIT_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/i386/setrlimit.c Do not include
+ kernel-features.h.
+ [!__ASSUME_NEW_GETRLIMIT_SYSCALL]: Remove conditional code.
+ [__ASSUME_NEW_GETRLIMIT_SYSCALL]: Make code unconditional.
+
+2012-05-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * configure.in: Define the default includes to being none.
+ * configure: Regenerated.
+
+2012-05-25 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/x86_64/__longjmp.S: Add a static probe here.
+ * sysdeps/x86_64/setjmp.S: Likewise.
+ * sysdeps/i386/bsd-setjmp.S: Likewise.
+ * sysdeps/i386/bsd-_setjmp.S: Likewise.
+ * sysdeps/i386/setjmp.S: Likewise.
+ * sysdeps/i386/__longjmp.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/____longjmp_chk.S: Likewise.
+
+ * include/stap-probe.h: New file.
+ * configure.in: Handle --enable-systemtap.
+ * configure: Regenerated.
+ * config.h.in (USE_STAP_PROBE): New #undef.
+ * extra-lib.mk (CPPFLAGS-$(lib)): Add -DIN_LIB=$(lib).
+ * elf/Makefile (CPPFLAGS-.os): Add -DIN_LIB=rtld.
+ * elf/rtld-Rules (rtld-CPPFLAGS): Likewise.
+
+2012-05-25 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13717]
+ * sysdeps/unix/sysv/linux/configure.in (arch_minimum_kernel): Set
+ to 2.4.0 where earlier.
+ * sysdeps/unix/sysv/linux/configure: Regenerated.
+ * sysdeps/unix/sysv/linux/i386/chown.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/fchown.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/fchownat.c (fchownat)
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ (fchownat) [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/getegid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/geteuid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/getgid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/getgroups.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/getresgid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/getresuid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/getuid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/lchown.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/msgctl.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/semctl.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/setegid.c: Do not include
+ <kernel-features.h>.
+ [__NR_setresgid] (__setresgid): Do not declare.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/seteuid.c: Do not include
+ <kernel-features.h>.
+ [__NR_setresuid] (__setresuid): Do not declare.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/setfsgid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/setfsuid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/setgid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/setgroups.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/setregid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/setresgid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/setresuid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/setreuid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/setuid.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/i386/shmctl.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_SETRESUID_SYSCALL): Remove.
+ (__ASSUME_SETRESGID_SYSCALL): Likewise.
+ (__ASSUME_32BITUIDS): Likewise.
+ (__ASSUME_LDT_WORKS): Likewise.
+ (__ASSUME_O_DIRECTORY): Likewise.
+ (__ASSUME_NEW_GETRLIMIT_SYSCALL): Define conditional on
+ architecture but not kernel version.
+ (__ASSUME_TRUNCATE64_SYSCALL): Likewise.
+ (__ASSUME_MMAP2_SYSCALL): Likewise.
+ (__ASSUME_STAT64_SYSCALL): Likewise.
+ (__ASSUME_IPC64): Likewise.
+ * sysdeps/unix/sysv/linux/local-setxid.h: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/opendir.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_O_DIRECTORY]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/opensock.c [__LINUX_KERNEL_VERSION <
+ 132096]: Remove conditional code.
+ [__LINUX_KERNEL_VERSION >= 132096]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/s390/s390-32/chown.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/s390/s390-32/lchown.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/setegid.c: Do not include
+ <kernel-features.h>.
+ [__NR_setresgid || __ASSUME_SETRESGID_SYSCALL]: Make code
+ unconditional.
+ (__setresgid): Do not declare.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/seteuid.c: Do not include
+ <kernel-features.h>.
+ [__NR_setresuid || __ASSUME_SETRESUID_SYSCALL]: Make code
+ unconditional.
+ (__setresuid): Do not declare.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/sh/chown.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c: Do not include
+ <kernel-features.h>.
+ [__ASSUME_32BITUIDS]: Make code unconditional.
+ [!__ASSUME_32BITUIDS]: Remove conditional code.
+
+2012-05-25 Richard Henderson <rth@twiddle.net>
+
+ * sysdeps/powerpc/powerpc32/dl-irel.h (elf_ifunc_invoke): Pass
+ dl_hwcap to ifunc resolver.
+ * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Use
+ elf_ifunc_invoke.
+ * sysdeps/powerpc/powerpc64/dl-irel.h (elf_ifunc_invoke): Pass
+ dl_hwcap to ifunc resolver.
+ * sysdeps/powerpc/powerpc64/dl-machine.h (resolve_ifunc): Likewise.
+
+2012-05-24 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14153]
+ * sysdeps/ieee754/flt-32/e_acosf.c (__ieee754_acosf): Return pi/2
+ for |x| <= 2**-26, not 2**-57.
+ * math/libm-test.inc (acos_test): Do not allow spurious underflow
+ exception.
+
+2012-05-24 Jeff Law <law@redhat.com>
+
+ * stdio-common/Makefile (tests): Add bug25.
+ * stdio-common/bug25.c: New test.
+
+2012-05-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #13576]
+ * malloc/malloc.c (sYSMALLOc): Free the old top chunk with a
+ multiple of MALLOC_ALIGNMENT in size.
+ (_int_free): Check chunk size is a multiple of MALLOC_ALIGNMENT.
+
+2012-05-24 Joseph Myers <joseph@codesourcery.com>
+
+ * conform/data/stdio.h-data (BUFSIZ): Use macro-int-constant.
+ Require >= 256.
+ (FILENAME_MAX): Use macro-int-constant.
+ (FOPEN_MAX): Use macro-int-constant. Require >= 8.
+ (_IOFBF): Use macro-int-constant.
+ (_IOLBF): Likewise.
+ (_IONBF): Likewise.
+ (SEEK_CUR): Likewise.
+ (SEEK_END): Likewise.
+ (SEEK_SET): Likewise.
+ (TMP_MAX): Likewise.
+ (EOF): Use macro-int-constant. Require < 0.
+ (NULL): Use macro-constant. Require == 0.
+ (stdin): Require type to be FILE *.
+ (stdout): Likewise.
+ (stderr): Likewise.
+ * conform/data/stdlib.h-data (EXIT_FAILURE): Use
+ macro-int-constant.
+ (EXIT_SUCCESS): Likewise.
+ (NULL): Use macro-constant. Require == 0.
+ (RAND_MAX): Use macro-int-constant.
+ [ISO99 || ISO11] (lldiv_t): Require also for these standards.
+ [C99-based standards] (strtof): Require function.
+ [C99-based standards] (strtold): Likewise.
+ [C99-based standards] (strtoll): Likewise.
+ [C99-based standards] (strtoull): Likewise.
+ [ISO || ISO99 || ISO11] (stddef.h): Do not allow header.
+ [ISO || ISO99 || ISO11] (limits.h): Likewise.
+ [ISO || ISO99 || ISO11] (math.h): Likewise.
+ [ISO || ISO99 || ISO11] (sys/wait.h): Likewise.
+ (str*): Change to str[abcdefghijklmnopqrstuvwxyz]*.
+ [ISO || ISO99 || ISO11] (*_t): Do not allow.
+
+2012-05-24 Andreas Schwab <schwab@linux-m68k.org>
+
+ [BZ #14132]
+ * argp/argp-help.c (dgettext) [_LIBC]: Remove use of INTUSE.
+ * argp/argp-parse.c (dgettext) [_LIBC]: Likewise.
+ * intl/dgettext.c (DCGETTEXT): Likewise.
+ * intl/gettext.c (DCGETTEXT): Likewise.
+ * intl/l10nflist.c (__argz_count, __argz_stringify): Likewise.
+ * posix/regex_internal.h (gettext): Likewise.
+ * include/libintl.h (__dcgettext_internal, __dcngettext_internal):
+ Remove declaration.
+ * include/argz.h (__argz_count_internal)
+ (__argz_stringify_internal): Remove declaration.
+ (__argz_count, __argz_stringify): Declare hidden proto.
+ * intl/dcgettext.c: Remove use of INTDEF.
+ * string/argz-count.c: Replace INTDEF with libc_hidden_def.
+ * string/argz-stringify.c: Likewise.
+ * include/libio.h (_IO_free_backup_area, _IO_free_wbackup_area)
+ (_IO_padn, _IO_putc, _IO_sgetn, _IO_vfprintf, _IO_vfscanf):
+ Declare hidden proto.
+ * include/libio.h (_IO_free_backup_area, _IO_free_wbackup_area)
+ (_IO_padn, _IO_putc, _IO_sgetn, _IO_vfprintf, _IO_vfscanf):
+ Declare hidden proto.
+ * include/stdio.h (__asprintf_internal): Don't declare.
+ (__asprintf): Don't define as macro. Declare hidden proto.
+ * include/stdio_ext.h (__fsetlocking_internal): Don't declare.
+ (__fsetlocking): Declare hidden proto.
+ * libio/iolibio.h (_IO_fdopen, _IO_fflush, _IO_ftell, _IO_fread)
+ (_IO_fwrite, _IO_setbuffer, _IO_setvbuf, _IO_vsprintf): Declare
+ hidden proto.
+ (_IO_vprintf, _IO_freopen, _IO_freopen64, _IO_setbuf)
+ (_IO_setlinebuf): Remove use of INTUSE.
+ (_IO_setbuffer_internal, _IO_fread_internal, _IO_fdopen_internal)
+ (_IO_vsprintf_internal, _IO_fflush_internal, _IO_fwrite_internal)
+ (_IO_ftell_internal, _IO_fputs_internal, _IO_setvbuf_internal):
+ Remove declaration.
+ * libio/libioP.h (INTUSE, INTDEF, INTDEF2): Don't define.
+ (_IO_do_flush): Remove use of INTUSE.
+ (_IO_switch_to_get_mode, _IO_init, _IO_sputbackc, _IO_un_link)
+ (_IO_link_in, _IO_doallocbuf, _IO_unsave_markers, _IO_setb)
+ (_IO_adjust_column, _IO_least_wmarker)
+ (_IO_switch_to_main_wget_area, _IO_switch_to_wbackup_area)
+ (_IO_switch_to_wget_mode, _IO_wsetb, _IO_sputbackwc)
+ (_IO_wdoallocbuf, _IO_default_uflow, _IO_wdefault_uflow)
+ (_IO_default_doallocate, _IO_wdefault_doallocate)
+ (_IO_default_finish, _IO_wdefault_finish, _IO_default_pbackfail)
+ (_IO_wdefault_pbackfail, _IO_default_xsputn, _IO_wdefault_xsputn)
+ (_IO_default_xsgetn, _IO_wdefault_xsgetn, _IO_do_write)
+ (_IO_wdo_write, _IO_flush_all, _IO_flush_all_linebuffered)
+ (_IO_file_doallocate, _IO_file_setbuf, _IO_file_seekoff)
+ (_IO_file_xsputn, _IO_file_xsgetn, _IO_file_stat, _IO_file_close)
+ (_IO_file_underflow, _IO_file_overflow, _IO_file_init)
+ (_IO_file_attach, _IO_file_fopen, _IO_file_read, _IO_file_sync)
+ (_IO_file_close_it, _IO_file_seek, _IO_file_finish)
+ (_IO_wfile_xsputn, _IO_wfile_sync, _IO_wfile_underflow)
+ (_IO_wfile_overflow, _IO_wfile_seekoff, _IO_str_underflow)
+ (_IO_str_overflow, _IO_str_pbackfail, _IO_str_seekoff)
+ (_IO_getline, _IO_getline_info, _IO_list_all): Declare hidden
+ proto.
+ (_IO_flush_all_internal, _IO_adjust_column_internal)
+ (_IO_default_uflow_internal, _IO_default_finish_internal)
+ (_IO_default_pbackfail_internal, _IO_default_xsputn_internal)
+ (_IO_default_xsgetn_internal, _IO_default_doallocate_internal)
+ (_IO_wdefault_finish_internal, _IO_wdefault_pbackfail_internal)
+ (_IO_wdefault_xsputn_internal, _IO_wdefault_xsgetn_internal)
+ (_IO_wdefault_doallocate_internal, _IO_wdefault_uflow_internal)
+ (_IO_file_doallocate_internal, _IO_file_setbuf_internal)
+ (_IO_file_seekoff_internal, _IO_file_xsputn_internal)
+ (_IO_file_xsgetn_internal, _IO_file_stat_internal)
+ (_IO_file_close_internal, _IO_file_close_it_internal)
+ (_IO_file_underflow_internal, _IO_file_overflow_internal)
+ (_IO_file_init_internal, _IO_file_attach_internal)
+ (_IO_file_fopen_internal, _IO_file_read_internal)
+ (_IO_file_sync_internal, _IO_file_seek_internal)
+ (_IO_file_finish_internal, _IO_wfile_xsputn_internal)
+ (_IO_wfile_seekoff_internal, _IO_wfile_sync_internal)
+ (_IO_str_underflow_internal, _IO_str_overflow_internal)
+ (_IO_str_pbackfail_internal, _IO_str_seekoff_internal)
+ (_IO_file_jumps_internal, _IO_wfile_jumps_internal)
+ (_IO_list_all_internal, _IO_link_in_internal)
+ (_IO_sputbackc_internal, _IO_wdoallocbuf_internal)
+ (_IO_sgetn_internal, _IO_flush_all_linebuffered_internal)
+ (_IO_switch_to_wget_mode_internal, _IO_unsave_markers_internal)
+ (_IO_switch_to_main_wget_area_internal, _IO_wdo_write_internal)
+ (_IO_do_write_internal, _IO_padn_internal)
+ (_IO_getline_info_internal, _IO_getline_internal)
+ (_IO_free_wbackup_area_internal, _IO_free_backup_area_internal)
+ (_IO_switch_to_wbackup_area_internal, _IO_setb_internal)
+ (_IO_sputbackwc_internal, _IO_switch_to_get_mode_internal)
+ (_IO_vfscanf_internal, _IO_vfprintf_internal)
+ (_IO_doallocbuf_internal, _IO_wsetb_internal, _IO_putc_internal)
+ (_IO_init_internal, _IO_un_link_internal): Don't declare.
+ * libio/fileops.c: Replace INTDEF with libc_hidden_def and INTDEF2
+ with libc_hidden_ver, remove use of INTUSE.
+ * libio/genops.c: Likewise.
+ * libio/freopen.c: Likewise.
+ * libio/freopen64.c: Likewise.
+ * libio/iofclose.c: Likewise.
+ * libio/iofdopen.c: Likewise.
+ * libio/iofflush.c: Likewise.
+ * libio/iofflush_u.c: Likewise.
+ * libio/iofgets.c: Likewise.
+ * libio/iofgets_u.c: Likewise.
+ * libio/iofopen.c: Likewise.
+ * libio/iofopncook.c: Likewise.
+ * libio/iofread.c: Likewise.
+ * libio/iofread_u.c: Likewise.
+ * libio/ioftell.c: Likewise.
+ * libio/iofwrite.c: Likewise.
+ * libio/iogetline.c: Likewise.
+ * libio/iogets.c: Likewise.
+ * libio/iogetwline.c: Likewise.
+ * libio/iopadn.c: Likewise.
+ * libio/iopopen.c: Likewise.
+ * libio/ioseekoff.c: Likewise.
+ * libio/ioseekpos.c: Likewise.
+ * libio/iosetbuffer.c: Likewise.
+ * libio/iosetvbuf.c: Likewise.
+ * libio/ioungetc.c: Likewise.
+ * libio/ioungetwc.c: Likewise.
+ * libio/iovdprintf.c: Likewise.
+ * libio/iovsprintf.c: Likewise.
+ * libio/iovsscanf.c: Likewise.
+ * libio/memstream.c: Likewise.
+ * libio/obprintf.c: Likewise.
+ * libio/oldfileops.c: Likewise.
+ * libio/oldiofclose.c: Likewise.
+ * libio/oldiofdopen.c: Likewise.
+ * libio/oldiofopen.c: Likewise.
+ * libio/oldiopopen.c: Likewise.
+ * libio/oldstdfiles.c: Likewise.
+ * libio/putc.c: Likewise.
+ * libio/setbuf.c: Likewise.
+ * libio/setlinebuf.c: Likewise.
+ * libio/stdfiles.c: Likewise.
+ * libio/strops.c: Likewise.
+ * libio/vasprintf.c: Likewise.
+ * libio/vscanf.c: Likewise.
+ * libio/vsnprintf.c: Likewise.
+ * libio/vswprintf.c: Likewise.
+ * libio/wfiledoalloc.c: Likewise.
+ * libio/wfileops.c: Likewise.
+ * libio/wgenops.c: Likewise.
+ * libio/wmemstream.c: Likewise.
+ * libio/wstrops.c: Likewise.
+ * libio/__fpurge.c: Likewise.
+ * libio/__fsetlocking.c: Likewise.
+ * assert/assert.c: Likewise.
+ * debug/fgets_chk.c: Likewise.
+ * debug/fgets_u_chk.c: Likewise.
+ * debug/fread_chk.c: Likewise.
+ * debug/fread_u_chk.c: Likewise.
+ * debug/gets_chk.c: Likewise.
+ * debug/obprintf_chk.c: Likewise.
+ * debug/vasprintf_chk.c: Likewise.
+ * debug/vdprintf_chk.c: Likewise.
+ * debug/vsnprintf_chk.c: Likewise.
+ * debug/vsprintf_chk.c: Likewise.
+ * malloc/mtrace.c: Likewise.
+ * misc/error.c: Likewise.
+ * misc/syslog.c: Likewise.
+ * stdio-common/asprintf.c: Likewise.
+ * stdio-common/fxprintf.c: Likewise.
+ * stdio-common/getw.c: Likewise.
+ * stdio-common/isoc99_fscanf.c: Likewise.
+ * stdio-common/isoc99_scanf.c: Likewise.
+ * stdio-common/isoc99_vfscanf.c: Likewise.
+ * stdio-common/isoc99_vscanf.c: Likewise.
+ * stdio-common/isoc99_vsscanf.c: Likewise.
+ * stdio-common/printf-prs.c: Likewise.
+ * stdio-common/printf_fp.c: Likewise.
+ * stdio-common/printf_fphex.c: Likewise.
+ * stdio-common/printf_size.c: Likewise.
+ * stdio-common/putw.c: Likewise.
+ * stdio-common/scanf.c: Likewise.
+ * stdio-common/sprintf.c: Likewise.
+ * stdio-common/tmpfile.c: Likewise.
+ * stdio-common/vfprintf.c: Likewise.
+ * stdio-common/vfscanf.c: Likewise.
+ * stdlib/strfmon_l.c: Likewise.
+ * sunrpc/openchild.c: Likewise.
+ * sunrpc/xdr_stdio.c: Likewise.
+ * sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Likewise.
+ * sysdeps/mach/hurd/tmpfile.c: Likewise.
+
+2012-05-24 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list: New file.
+
+ * sysdeps/unix/make-syscalls.sh: Support "syscall:vdso_name@VDSOVER"
+ in the third column, to generate for the shared library an IFUNC
+ that uses _dl_vdso_vsym.
+ * Makerules (COMPILE.c, compile-stdin.c): New variables.
+ * Makeconfig (object-suffixes-noshared): New variable.
+
+ * sysdeps/unix/sysv/linux/dl-vdso.h (PREPARE_VERSION_KNOWN): New macro.
+ (VDSO_NAME_LINUX_2_6, VDSO_HASH_LINUX_2_6): New macros.
+ (VDSO_NAME_LINUX_2_6_15, VDSO_HASH_LINUX_2_6_15): New macros.
+ (VDSO_NAME_LINUX_2_6_29, VDSO_HASH_LINUX_2_6_29): New macros.
+
+ [BZ #14132]
+ * include/sys/time.h (__gettimeofday): Remove macro.
+ (__gettimeofday, gettimeofday): Add libc_hidden_proto.
+ * time/gettimeofday.c (__gettimeofday): Remove #undef.
+ Remove INTDEF.
+ (__gettimeofday): Add libc_hidden_def.
+ (gettimeofday): Add libc_hidden_weak.
+ * sysdeps/mach/gettimeofday.c: Likewise.
+ * sysdeps/posix/gettimeofday.c: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c: Likewise.
+ * sysdeps/unix/sysv/linux/s390/gettimeofday.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
+ (__gettimeofday_internal): Remove strong_alias.
+ (__gettimeofday): Add libc_hidden_def.
+ (gettimeofday): Add libc_hidden_weak.
+ * sysdeps/unix/syscalls.list (gettimeofday):
+ Remove __gettimeofday_internal alias.
+
+2012-05-24 Daniel Jacobowitz <drow@false.org>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #12495]
+ * malloc/malloc.c (SMALLBIN_CORRECTION): New.
+ (MIN_LARGE_SIZE, smallbin_index): Use it to handle 16-byte alignment.
+ (largebin_index_32_big): New.
+ (largebin_index): Use it for 16-byte alignment.
+ (sYSMALLOc): Handle MALLOC_ALIGNMENT > 2 * SIZE_SZ. Don't update
+ correction with front_misalign.
+
+2012-05-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/ld.abilist: New file.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libBrokenLocale.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libanl.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libcrypt.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libdl.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libnsl.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libresolv.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/librt.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libthread_db.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libutil.abilist:
+ Likewise.
+
+ * scripts/data/c++-types-x32-linux-gnu.data: New file.
+ * sysdeps/x86_64/x32/shlib-versions: Add x32 ABI entry.
+
+2012-05-24 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #10846]
+ [BZ #14036]
+ * math/libm-test.inc (exp_test): Add test from bug 14036.
+ (pow_test): Add test from bug 10846.
+
+ * math/gen-libm-test.pl (%beautify): Remove entries for exceptions
+ and other flags.
+ (special_function): Do not include flags in test name.
+ (parse_args): Likewise.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/powerpc/fpu/libm-test-ulps: Likewise.
+ * sysdeps/s390/fpu/libm-test-ulps: Likewise.
+ * sysdeps/sparc/fpu/libm-test-ulps: Likewise.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+ * math/gen-libm-test.pl (%beautify): Add entries for underflow
+ exceptions.
+ * math/libm-test.inc ("Philosophy"): Update comment about
+ exception testing.
+ (UNDERFLOW_EXCEPTION): New macro.
+ (UNDERFLOW_EXCEPTION_OK): Likewise.
+ (UNDERFLOW_EXCEPTION_FLOAT): Likewise.
+ (UNDERFLOW_EXCEPTION_OK_FLOAT): Likewise.
+ (UNDERFLOW_EXCEPTION_DOUBLE): Likewise.
+ (UNDERFLOW_EXCEPTION_LDOUBLE_IBM): Likewise.
+ (INVALID_EXCEPTION_OK): Update value.
+ (DIVIDE_BY_ZERO_EXCEPTION_OK): Likewise.
+ (OVERFLOW_EXCEPTION_OK): Likewise.
+ (IGNORE_ZERO_INF_SIGN): Likewise.
+ (test_exceptions): Handle underflow exceptions.
+ (acos_test): Update for underflow exception expectations.
+ (cexp_test): Likewise.
+ (clog_test): Likewise.
+ (clog10_test): Likewise.
+ (csqrt_test): Likewise.
+ (ctan_test): Likewise.
+ (ctanh_test): Likewise.
+ (exp_test): Likewise.
+ (exp10_test): Likewise.
+ (exp2_test): Likewise.
+ (expm1_test): Likewise.
+ (fma_test): Likewise.
+ (j0_test): Likewise.
+ (jn_test): Likewise.
+ (nexttoward_test): Likewise.
+ (pow_test): Likewise.
+ (scalbn_test): Likewise.
+ (scalbln_test): Likewise.
+ (tan_test): Likewise.
+ (y1_test): Likewise.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+2012-05-23 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
+ (__libc_sigaction): Remove unused local variables.
+
+2012-05-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/x32/configure: New file.
+
+2012-05-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ mktime: avoid signed integer overflow
+ * time/mktime.c (__mktime_internal): Do not mishandle the case
+ where diff == INT_MIN.
+
+ mktime: simplify computation of average
+ * time/mktime.c (ranged_convert): Use new time_t_avg function
+ instead of rolling our own (probably-slower) code.
+
+ mktime: do not assume signed right shift propagates sign bit
+ * time/mktime.c (isdst_differ): New static function.
+ (__mktime_internal): No need to normalize tm_isdst now.
+ (__mktime_internal, not_equal_tm): Use isdst_differ to compare
+ tm_isdst values.
+
+ mktime: merge another wrapv change from gnulib
+ * time/mktime.c (TYPE_MAXIMUM): Rework slightly to avoid diagnostics
+ from some compilers.
+
+ mktime: remove incorrect attempt at unusual arithmetics
+ * time/mktime.c (TYPE_ONES_COMPLEMENT, TYPE_SIGNED_MAGNITUDE): Remove.
+ The code didn't really work on such machines anyway.
+ (TYPE_MINIMUM): Assume two's complement.
+ (twos_complement_arithmetic): Verify that long_int and time_t
+ are two's complement (or unsigned, in the latter case).
+
+ mktime: check signed shifts on long_int and time_t, too
+ * time/mktime.c (SHR): Check that shifts work as desired
+ on the types long_int and time_t too, as SHR is used on
+ such types.
+
+ mktime: do not assume 'long' is wide enough
+ * time/mktime.c (verify): Move decl up.
+ (long_int): New type.
+ (leapyear, ydhms_diff, guess_time_tm, __mktime_internal): Use it,
+ to remove assumption in the code that 'long' is wide enough to
+ store year values. This assumption is not true on x32 and on
+ some non-glibc platforms.
+
+ mktime: merge wrapv change from gnulib
+ * time/mktime.c (WRAPV): New macro.
+ (time_t_avg, time_t_add_ok, time_t_int_add_ok): New static functions.
+ (guess_time_tm, __mktime_internal): Do not assume that signed
+ integer overflow wraps around; modern compilers generate code
+ where this assumption is no longer valid.
+
+2012-05-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/sysdep.h (SYSCALL_ERROR_HANDLER):
+ Replace "jmp L(pseudo_end)" with "ret".
+ * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER):
+ Likewise.
+
+2012-05-23 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/syscalls.list: Add poll.
+ * sysdeps/unix/sysv/linux/poll.c: Remove file.
+
+2012-05-23 Andreas Jaeger <aj@suse.de>
+ Maximilian Attems <max@stro.at>
+
+ * sysdeps/unix/sysv/linux/sys/reboot.h (RB_SW_SUSPEND, RB_KEXEC):
+ New macros.
+
+2012-05-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S: Rearrange
+ code so that pseudo_end is just ret and the stack pointer is
+ correct also for static library in error case.
+
+2012-05-23 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/powerpc/chown.c: Add comment suggesting
+ move to syscalls.list.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c: Likewise.
+
+ * manual/install.texi (Running make install): Do not mention Linux
+ kernel version for which pt_chown is not needed.
+ (Linux): Do not mention problems with nscd with 2.0 kernels.
+ * INSTALL: Regenerated.
+
+2012-05-23 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/powerpc/bits/mman.h
+ (MADV_DONTDUMP,MADV_DODUMP): New macros from Linux 3.4.
+ macro.
+ * sysdeps/unix/sysv/linux/s390/bits/mman.h
+ (MADV_DONTDUMP,MADV_DODUMP): Likewise.
+ * sysdeps/unix/sysv/linux/sh/bits/mman.h
+ (MADV_DONTDUMP,MADV_DODUMP): Likewise.
+ * sysdeps/unix/sysv/linux/i386/bits/mman.h
+ (MADV_DONTDUMP,MADV_DODUMP): Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/mman.h
+ (MADV_DONTDUMP,MADV_DODUMP): Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/bits/mman.h
+ (MADV_DONTDUMP,MADV_DODUMP): Likewise.
+ * sysdeps/unix/sysv/linux/bits/in.h
+ (IP_MULTICAST_ALL,IP_UNICAST_IF): Likewise.
+
+2012-05-22 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/unix/sysv/linux/dl-vdso.h (CHECK_HASH): Macro removed.
+ (PREPARE_VERSION): Just use assert instead, it will be elided
+ under [NDEBUG] anyway.
+
+2012-05-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/Makefile: Include
+ $(firstword $(wildcard $(sysdirs:=/sysctl.mk))).
+ (sysdep_routines): Remove sysctl.
+ * sysdeps/unix/sysv/linux/bits/sysctl.h: New file.
+ * sysdeps/unix/sysv/linux/sysctl.mk: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/bits/sysctl.h: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/sysctl.mk: Likewise.
+ * sysdeps/unix/sysv/linux/sys/sysctl.h: Include <bits/sysctl.h>.
+
+2012-05-22 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S: Rearrange code so
+ that pseudo_end is just ret and the stack pointer is correct also
+ for static library in error case.
+
+2012-05-22 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ [BZ #14122]
+ * nss/nsswitch.c (defconfig_entries): New variable.
+ (__nss_database_lookup): Don't leak defconfig entries.
+ (nss_parse_service_list): Don't leak on error paths.
+ (free_database_entries): New function.
+ (free_defconfig): New function.
+ (free_mem): Move common code to free_database_entries.
+
+2012-05-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/x32/Makefile (sysdep_routines):
+ Add arch_prctl.
+ * sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c: New file.
+
+ * sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
+ (posix_fallocate): Use INTERNAL_SYSCALL_TYPES if it is defined.
+ * sysdeps/unix/sysv/linux/x86_64/sysdep.h (INLINE_SYSCALL_TYPES):
+ New macro.
+ (INTERNAL_SYSCALL_NCS_TYPES): Likewise.
+ (INTERNAL_SYSCALL_TYPES): Likewise.
+ (LOAD_ARGS_TYPES_[1-6]): Likewise.
+ (LOAD_REGS_TYPES_[1-6]): Likewise.
+ (LOAD_ARGS_[1-6]): Use LOAD_ARGS_TYPES_[1-6].
+ (LOAD_REGS_[1-6]): Use LOAD_REGS_TYPES_[1-6].
+
+2012-05-22 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Add compat symbol
+ copysignl for GLIBC_2_0.
+ * sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S: Add compat symbol
+ finitel for GLIBC_2.0 and __finitel for GLIBC_2_1.
+ * sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c: Add compat symbol
+ logbl for GLIBC_2_0.
+ * sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Likewise.
+ * sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S: Likewise.
+
+2012-05-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Don't include
+ <bits/wordsize.h>. Check __x86_64__ instead of __WORDSIZE.
+
+ * sysdeps/unix/sysv/linux/i386/sysdep.h (SYSCALL_ERROR_HANDLER):
+ Use "neg %eax".
+
+ * time/mktime.c: Update copyright years.
+
+2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ mktime: merge comment-quoting-style change from gnulib
+ * time/mktime.c: Quote 'like this' in comments.
+ The GNU coding standards suggest that we no longer quote `like this',
+ as "`" and "'" are typically rendered asymmetrically nowadays.
+ The typical gnulib style is to quote 'like this' when quoting
+ code, and "like this" when quoting English.
+
+ * time/mktime.c (compile-command): Add "-I.".
+
+ mktime: merge mktime-internal.h change from gnulib
+ * time/mktime.c [!_LIBC]: Include "mktime-internal.h".
+
+ mktime: merge time_r change from gnulib
+ * time/mktime.c [!_LIBC]: Do not include "time_r.h".
+
+ mktime: merge DEBUG change from gnulib
+ * time/mktime.c (mktime) [DEBUG]: #undef before #define-ing, in
+ case system <time.h> has a #define.
+
+ mktime: merge <sys/types.h> change from gnulib
+ * time/mktime.c: Do not include <sys/types.h>; no longer needed,
+ since <time.t> is now guaranteed to define time_t.
+
+ mktime: merge HAVE_CONFIG_H change from gnulib
+ * time/mktime.c: Include <config.h> if !_LIBC, not if HAVE_CONFIG_H.
+
+2012-05-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_SET_ERRNO):
+ Use "neg %eax".
+
+ * sysdeps/unix/sysv/linux/bits/resource.h (RLIM_INFINITY): Use
+ __rlim_t cast.
+ (struct rusage): Use anonymous union to pad each field to
+ __syscall_slong_t.
+
+2012-05-21 David S. Miller <davem@davemloft.net>
+
+ * Makefules (o-iterator): Remove .s cases.
+ (compile-command.s): Delete.
+ (COMPILE.s): Delete.
+ * sysdeps/unix/make-syscalls.sh: Remove .s file tests.
+
+2012-05-21 Joseph Myers <joseph@codesourcery.com>
+
+ * configure.in (libc_cv_predef_stack_protector): Only consider
+ "foobar" and "__stack_chk_fail" lines in libc_undefs.
+ * configure: Regenerated.
+
+2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_SET_ERRNO):
+ New macro. Use R*LP on int and pointer.
+ (SYSCALL_ERROR_HANDLER): Use SYSCALL_SET_ERRNO.
+ * sysdeps/unix/sysv/linux/x86_64/x32/lseek.S: New file.
+ * sysdeps/unix/sysv/linux/x86_64/x32/llseek.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h: Likewise.
+
+ * sysdeps/gnu/bits/utmp.h (struct lastlog): Check
+ [__WORDSIZE_TIME64_COMPAT32] instead of
+ [__WORDSIZE == 64 && __WORDSIZE_COMPAT32].
+ (struct utmp): Likewise.
+ * sysdeps/gnu/bits/utmpx.h (struct utmpx): Likewise.
+ * sysdeps/powerpc/powerpc32/bits/wordsize.h (__WORDSIZE_COMPAT32):
+ Renamed to ...
+ (__WORDSIZE_TIME64_COMPAT32): This.
+ * sysdeps/powerpc/powerpc64/bits/wordsize.h: Likewise.
+ * sysdeps/sparc/sparc32/bits/wordsize.h: Likewise.
+ * sysdeps/sparc/sparc64/bits/wordsize.h: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h: Likewise.
+ * sysdeps/x86_64/bits/wordsize.h (__WORDSIZE_COMPAT32): Removed.
+ (__WORDSIZE_TIME64_COMPAT32): New macro.
+
+2012-05-21 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/i386/i686/multiarch/wcschr-c.c: Redefine libc_hidden_def
+ only if [SHARED]. Add prototype for __wcschr_ia32.
+
+2012-05-21 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/x86_64/setjmp.S [PTR_MANGLE] [__ILP32__]: Preserve high bits
+ of %rbp unmolested in the jmp_buf while mangling the low bits.
+ * sysdeps/x86_64/__longjmp.S [PTR_DEMANGLE] [__ILP32__]: Restore the
+ unmolested high bits of %rbp while demangling the low bits.
+ * sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S: Likewise.
+
+2012-05-21 Andreas Jaeger <aj@suse.de>
+
+ * include/shlib-compat.h (libc_sunrpc_symbol): New macro.
+ * sunrpc/svc_simple.c: Use it for registerrpc.
+ * sunrpc/xcrypt.c: Use it for passwd2des.
+
+ * malloc/malloc.c: Include shlib-compat.h for SHLIB_COMPAT.
+
+2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/bits/statvfs.h (_STATVFSBUF_F_UNUSED):
+ Don't define if [__SYSCALL_WORDSIZE != 32].
+ * sysdeps/x86_64/bits/wordsize.h (__SYSCALL_WORDSIZE):
+ New macro.
+
+2012-05-21 Bruno Haible <bruno@clisp.org>
+ Andreas Jaeger <aj@suse.de>
+
+ [BZ #13691], Revert breakage of iconv() converter for TCVN-5712.
+ * iconvdata/tcvn5712-1.c (BODY for FROM_LOOP): Don't consider
+ inptr and inend for must_buffer_ch.
+ * wcsmbs/tst-mbsnrtowcs.c: Remove file.
+ * wcsmbs/Makefile (tests): Remove tst-mbsnrtowcs.
+ * stdio-common/Makefile (tests): Remove bug15.
+ (bug15-ENV): Remove macro.
+ * stdio-common/bug15.c: Remove, we do not support vi_VN.TCVN5712-1
+ anymore.
+
+2012-05-19 Andreas Jaeger <aj@suse.de>
+ Roland McGrath <roland@hack.frob.com>
+
+ * manual/contrib.texi: Completely rewritten. It contains now an
+ alphabetical list of contributors and their contributions.
+
+2012-05-21 Richard Henderson <rth@twiddle.net>
+
+ * misc/getauxval.c (__getauxval): Use unsigned long int.
+ * misc/sys/auxv.h: Include <sys/cdefs.h>.
+ (getauxval): Use unsigned long int.
+
+2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list: New file.
+
+2012-05-21 Roland McGrath <roland@hack.frob.com>
+
+ * malloc/malloc.c [!SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_16)]
+ (MALLOC_ALIGNMENT): Set it to the greater of 2 * SIZE_SZ and
+ __alignof__ (long double).
+
+2012-05-21 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+
+ * sysdeps/powerpc/fpu/libm-test-ulps: Update.
+
+2012-05-20 Richard Henderson <rth@twiddle.net>
+
+ * misc/getauxval.c: New file.
+ * misc/sys/auxv.h: New file.
+ * misc/Makefile (headers): Add sys/auxv.h, bits/hwcap.h.
+ (routines): Add getauxval.
+ * misc/Versions (GLIBC_2.16): Add __getauxval, getauxval.
+ * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Add _dl_auxv.
+ * elf/dl-sysdep.c (_dl_auxv): Remove.
+ (_dl_sysdep_start, _dl_show_auxv): Use GLRO to access _dl_auxv.
+ * elf/dl-support.c (_dl_auxv): New variable.
+ (_dl_aux_init): Initialize it.
+ * manual/startup.texi (Auxiliary Vector): New node.
+ * sysdeps/generic/bits/hwcap.h: New file.
+ * sysdeps/powerpc/bits/hwcap.h: New file, split out from ...
+ * sysdeps/powerpc/sysdep.h: ... here. Include it.
+ * sysdeps/sparc/bits/hwcap.h: New file, split out from ...
+ * sysdeps/sparc/sysdep.h: ... here. Include it.
+ * sysdeps/unix/sysv/linux/s390/bits/hwcap.h: New file.
+ * sysdeps/unix/sysv/linux/i386/nptl/libc.abilist: Update.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist:
+ Update.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist: Update.
+ * sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist: Update.
+ * sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist: Update.
+ * sysdeps/unix/sysv/linux/sh/nptl/libc.abilist: Update.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist: Update.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist: Update.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist: Update.
+ * sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist: Update.
+
+2012-05-19 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+
+ * sysdeps/powerpc/fpu/libm-test-ulps: Update.
+
+2012-05-19 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/fpu/libm-test-ulps: Update.
+
+2012-05-19 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14123]
+ * math/s_ccosh.c: Include <float.h>
+ (__ccosh): Avoid internal overflow calculating sinh and cosh
+ values before multiplying by sin and cos values.
+ * math/s_ccoshf.c: Likewise.
+ * math/s_ccoshl.c: Likewise.
+ * math/s_csin.c: Likewise.
+ * math/s_csinf.c: Likewise.
+ * math/s_csinl.c: Likewise.
+ * math/s_csinh.c: Likewise.
+ * math/s_csinhf.c: Likewise.
+ * math/s_csinhl.c: Likewise.
+ * math/libm-test.inc (ccos_test): Add more tests.
+ (ccosh_test): Likewise.
+ (csin_test): Likewise.
+ (csinh_test): Likewise.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+2012-05-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/wordsize-64/preadv.c: New file.
+ * sysdeps/unix/sysv/linux/wordsize-64/pwritev.c: Likewise.
+
+ * sysdeps/x86_64/x32/_itoa.h: Add comment.
+
+2012-05-19 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/powerpc/soft-fp/Makefile: Remove file.
+ * sysdeps/powerpc/soft-fp/Subdirs: Likewise.
+ * sysdeps/powerpc/soft-fp/Versions: Likewise.
+ * sysdeps/powerpc/soft-fp/q_add.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_cmp.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_cmpe.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_div.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_dtoq.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_feq.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_fge.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_fgt.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_fle.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_flt.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_fne.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_itoq.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_lltoq.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_mul.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_neg.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_qtod.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_qtoi.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_qtoll.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_qtos.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_qtou.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_qtoull.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_sqrt.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_stoq.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_sub.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_ulltoq.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_util.c: Likewise.
+ * sysdeps/powerpc/soft-fp/q_utoq.c: Likewise.
+ * sysdeps/powerpc/soft-fp/sfp-machine.h: Likewise.
+
+2012-05-18 Andreas Jaeger <aj@suse.de>
+
+ * csu/.gitignore: Delete.
+
+2012-05-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/bits/timex.h: Include <bits/types.h>.
+ (timex): Use __syscall_slong_t.
+
+2012-05-18 Andreas Jaeger <aj@suse.de>
+ Carlos O'Donell <carlos_odonell@mentor.com>
+
+ * manual/install.texi (Configuring and compiling): Update
+ description about files modified in the source directory.
+ * INSTALL: Regenerated.
+
+2012-05-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/x86_64/sysdep.S: Use RAX_LP to access return
+ value. Use "or" to set return value to -1.
+ * sysdeps/unix/sysv/linux/x86_64/sysdep.S: Use RAX_LP to
+ negate return value.
+
+2012-05-18 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/power4/Makefile (CFLAGS-wordcopy.c,
+ CFLAGS-memmove.c): remove -ftree-loop-linear which causes a build
+ failure if the compiler has Graphite support disabled.
+ * sysdeps/powerpc/powerpc32/power4/fpu/Makefile (CFLAGS-mpa.c):
+ Likewise.
+ * sysdeps/powerpc/powerpc64/power4/Makefile (CFLAGS-wordcopy.c,
+ CFLAGS-memmove.c): Likewise.
+ * sysdeps/powerpc/powerpc64/power4/fpu/Makefile (CFLAGS-mpa.c):
+ Likewise.
+
+2012-05-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/x32/_itoa.h: New file.
+
+ * sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): Use
+ getdents system call only if kernel and user dirents have the
+ same d_ino and d_off.
+
+ * stdio-common/_itoa.c: Check _ITOA_NEEDED instead of
+ LLONG_MAX != LONG_MAX.
+ (_itoa_word): Use _ITOA_WORD_TYPE on value.
+ (_fitoa_word): Likewise.
+
+ * sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h: Fold copyright
+ years.
+ * sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/sys/procfs.h: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/sys/reg.h: Likewise.
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h: Don't
+ include <bits/wordsize.h>. Check __x86_64__ instead of
+ __WORDSIZE.
+ (sigcontext): Use "__uint64_t" instead of "unsigned long int"
+ if __x86_64__ is defined. Use anonymous union on fpstate.
+
+ * sysdeps/unix/sysv/linux/x86_64/sys/user.h (user): Use
+ anonymous union.
+
+2012-05-18 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/powerpc/powerpc32/dl-start.S (_dl_start_user): Use
+ INTUSE on _dl_argv, and _rtld_local instead of _rtld_global.
+ * sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S [IS_IN_rtld]:
+ Refer to _rtld_local_ro instead of _rtld_global_ro.
+ * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S [IS_IN_rtld]:
+ Likewise.
+ * sysdeps/powerpc/powerpc64/__longjmp-common.S [IS_IN_rtld]:
+ Likewise.
+ * sysdeps/powerpc/powerpc64/setjmp-common.S [IS_IN_rtld]:
+ Likewise.
+ * sysdeps/powerpc/powerpc64/dl-trampoline.S [SHARED]: Likewise.
+ * sysdeps/powerpc/powerpc64/dl-machine.h: Use _rtld_local instead
+ of _rtld_global, and rtld_progname instead of _dl_argv[0].
+
+ * sysdeps/powerpc/powerpc32/dl-machine.c
+ (__elf_machine_runtime_setup) [PROF]: Don't reference
+ _dl_prof_resolve.
+
+2012-05-18 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/x86_64/fpu/bits/mathinline.h (lrintf): Make inline
+ function only available for GCCs before 3.4 since GCC 3.4
+ introduced a builtin.
+ (lrint): Likewise.
+ (llrintf): Likewise.
+ (llrint): Likewise.
+ (fmaxf): Likewise.
+ (fmax): Likewise.
+ (fminf): Likewise.
+ (fmin): Likewise.
+ (rint): Likewise.
+ (rintf): Likewise.
+ (nearbyint): Likewise.
+ (nearbyintf): Likewise.
+ (ceil): Likewise.
+ (ceilf): Likewise.
+ (floor): Likewise.
+ (floorf): Likewise.
+
+2012-05-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/pselect.c (data): Use __syscall_ulong_t
+ on both fields and cast pointer to __syscall_ulong_t.
+
+ * bits/types.h (__fsword_t): New type.
+ * bits/typesizes.h (__FSWORD_T_TYPE): New macro.
+ sysdeps/mach/hurd/bits/typesizes.h (__FSWORD_T_TYPE): Likewise.
+ * sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
+ (__FSWORD_T_TYPE): Likewise.
+ * sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+ (__FSWORD_T_TYPE): Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+ (__FSWORD_T_TYPE): Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/bits/typesizes.h
+ (__FSWORD_T_TYPE): Likewise.
+ * sysdeps/unix/sysv/linux/bits/statfs.h (statfs): Replace
+ __SWORD_TYPE with __fsword_t.
+ (statfs64): Likewise.
+
+2012-05-17 David S. Miller <davem@davemloft.net>
+
+ * crypt/sha512c-test.c (TIMEOUT): Increase to 32.
+
+2012-05-17 Andreas Jaeger <aj@suse.de>
+
+ * elf/tst-relsort1.c (do_test): Fix function declaration to avoid
+ warning.
+
+2012-05-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/tst-mallocalign1.c (test): Cast to unsigned long.
+
+2012-05-17 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/i386/dl-machine.h (elf_machine_rel): Declare refsym only
+ when it is used.
+
+2012-05-17 Chris Metcalf <cmetcalf@tilera.com>
+
+ * stdio-common/bug22.c (TIMEOUT): Bump up from 30 to 60.
+
+2012-05-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/Makefile (tests): Add tst-mallocalign1.
+ * sysdeps/x86_64/tst-mallocalign1.c: New file.
+
+2012-05-17 Andreas Jaeger <aj@suse.de>
+ Carlos O'Donell <carlos_odonell@mentor.com>
+
+ [BZ #14059]
+ * sysdeps/x86_64/multiarch/init-arch.h
+ (bit_YMM_Usable): Rename to...
+ (bit_AVX_Usable): ... this.
+ (bit_FMA4_Usable): New macro.
+ (bit_XMM_state): New macro.
+ (bit_YMM_state): New macro.
+ [__ASSEMBLER__] (index_YMM_Usable): Rename to...
+ [__ASSEMBLER__] (index_AVX_Usable): ... this.
+ [__ASSEMBLER__] (index_FMA4_Usable): New macro.
+ (CPUID_OSXSAVE): New macro.
+ (CPUID_AVX): New macro.
+ (CPUID_FMA4): New macro.
+ (index_YMM_Usable): Rename to...
+ (index_AVX_Usable): ... this.
+ (HAS_AVX): Use HAS_ARCH_FEATURE.
+ (HAS_FMA4): Likewise.
+ (HAS_YMM_USABLE): Remove.
+ * sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):
+ Enable AVX or FMA4 IFF YMM and XMM states are usable and the features
+ are present.
+ * sysdeps/x86_64/multiarch/strcmp.S: Use bit_AVX_Usable.
+ * sysdeps/i386/i686/multiarch/Makefile: Add test-multiarch to tests.
+ * sysdeps/x86_64/multiarch/Makefile: Likewise.
+ * sysdeps/i386/i686/multiarch/test-multiarch.c: New file.
+ * sysdeps/x86_64/multiarch/test-multiarch.c: New file.
+
+2012-05-17 Chris Metcalf <cmetcalf@tilera.com>
+
+ * math/libm-test.c: Support platforms without multiple rounding modes.
+ * math/bug-nextafter.c: Support platforms without FP exceptions.
+ * math/bug-nexttoward.c: Likewise.
+ * math/test-fenv.c: Likewise.
+ * math/test-misc.c: Likewise.
+ * stdlib/bug-getcontext.c: Likewise.
+
+2012-05-17 Andreas Jaeger <aj@suse.de>
+
+ * manual/examples/search.c (critter_cmp): Change signature to
+ avoid warnings.
+ * manual/string.texi (Collation Functions): Likewise.
+
+2012-05-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * bits/types.h: Fold copyright years.
+ * bits/typesizes.h: Likewise.
+ * sysdeps/mach/hurd/bits/typesizes.h: Likewise.
+ * sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h: Likewise.
+ * sysdeps/unix/sysv/linux/s390/bits/typesizes.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h: Likewise.
+ * time/time.h: Likewise.
+
+2012-05-16 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ [BZ #208]
+ * malloc.c (int_mallinfo): Add parameter to accumulate statistics
+ in instead of returning them. Return void.
+ (__libc_mallinfo): Accumulate over all arenas.
+ (__malloc_stats): Adjust for change in int_mallinfo interface.
+
+2012-05-16 Roland McGrath <roland@hack.frob.com>
+
+ [BZ #10375]
+ * configure.in (NM): Add AC_CHECK_TOOL for it.
+ (libc_extra_cflags): New substituted variable.
+ Check for -fstack-protector being used implicitly.
+ * configure: Regenerated.
+ * config.make.in (config-extra-cflags): New variable,
+ gets @libc_extra_cflags@.
+ * Makeconfig (CFLAGS): Add $(config-extra-cflags) near the front.
+
+ [BZ #10375]
+ * configure.in: Check for _FORTIFY_SOURCE being predefined.
+ (CPPUNDEFS): New substituted variable; add -U_FORTIFY_SOURCE if needed.
+ * configure: Regenerated.
+ * config.make.in (CPPUNDEFS): New substituted variable.
+ * Makeconfig (CPPFLAGS): Put $(CPPUNDEFS) at the beginning.
+ * Makerules ($(stdio_lim:h=st)): Use $(CPPUNDEFS).
+ * time/ctime.c: Don't #undef __OPTIMIZE__ and ctime.
+
+2012-05-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/bits/mqueue.h: Include <bits/types.h>.
+ (mq_attr): Use __syscall_slong_t.
+
+2012-05-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/stat.h (_STAT_VER_SVR4):
+ Check __x86_64__ instead of __WORDSIZE.
+ (_STAT_VER_LINUX): Likewise.
+ (stat): Check __x86_64__ instead of __WORDSIZE. Use
+ __syscall_ulong_t and __syscall_slong_t.
+ (stat64): Likewise.
+
+2012-05-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/typesizes.h: New file.
+
+2012-05-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/ipctypes.h: New file.
+
+2012-05-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/bits/ipc.h (ipc_perm): Use
+ __syscall_ulong_t.
+
+ * sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h: Don't
+ include <bits/wordsize.h>. Check __x86_64__ instead of
+ __WORDSIZE.
+ (greg_t): Use "__extension__ long long int" if __x86_64__ is
+ defined.
+ (mcontext_t): Replace "unsigned long" with "unsigned long long".
+
+ * sysdeps/unix/sysv/linux/x86_64/sys/user.h: Don't
+ include <bits/wordsize.h>. Check __x86_64__ instead of
+ __WORDSIZE.
+ (user_regs_struct): Use "__extension__ unsigned long long"
+ instead of "unsigned long" if __x86_64__ is defined.
+ (user): Likewise. Pad after pointer field if __ILP32__ is
+ defined.
+
+2012-05-16 Joseph Myers <joseph@codesourcery.com>
+
+ * configure.in (makeinfo): Require version 4.5 or later. Allow
+ versions 5 to 9.
+ * configure: Regenerated.
+ * manual/install.texi (texinfo): Increase version requirement to
+ 4.5 or later.
+ * INSTALL: Regenerated.
+
+ * include/stdc-predef.h (__STDC_ISO_10646__): Increase to 201103L.
+
+2012-05-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/x32/gmp-mparam.h: New file.
+
+ * sysdeps/x86_64/x32/ffs.c: New file.
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/shm.h (shmatt_t): Use
+ __syscall_ulong_t.
+ (shmid_ds): Add __unused1 and __unused2 only if __x86_64__ isn't
+ defined. Use __syscall_ulong_t.
+ (shminfo): Use __syscall_ulong_t.
+ (shm_info): Likewise.
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/sem.h (semid_ds): Use
+ __syscall_ulong_t.
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/msq.h: Don't include
+ <bits/wordsize.h>.
+ (msgqnum_t): Use __syscall_ulong_t.
+ (msglen_t): Likewise.
+ (msqid_ds): Check __x86_64__ instead of __WORDSIZE. Use
+ __syscall_ulong_t.
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/a.out.h: Don't include
+ <bits/wordsize.h>. Check __x86_64__ instead of __WORDSIZE.
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/siginfo.h: New file.
+
+ * sysdeps/x86_64/x32/divdi3.c: New dummy file.
+ * sysdeps/x86_64/x32/symbol-hacks.h: Likewise.
+
+ * sysvipc/sys/msg.h (msgbuf): Replace long int with
+ __syscall_slong_t.
+
+ * sysdeps/unix/sysv/linux/x86_64/sys/reg.h: Don't
+ include <bits/wordsize.h>. Check __x86_64__ instead of
+ __WORDSIZE.
+
+ * sysdeps/unix/sysv/linux/x86_64/sys/procfs.h (elf_greg_t): Use
+ "unsigned long long int" if __x86_64__ is defined.
+ (elf_fpregset_t): Check __x86_64__ instead of __WORDSIZE.
+
+ * sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h: Don't include
+ <bits/wordsize.h>. Check __x86_64__ instead of __WORDSIZE.
+ (DR_CONTROL_RESERVED): Use ULL instead of UL suffix.
+
+ * sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h: Include
+ <stdint.h>.
+ (GET_PC): Cast to uintptr_t first.
+ (GET_FRAME): Likewise.
+ (GET_STACK): Likewise.
+
+ * sysdeps/unix/sysv/linux/x86_64/x32/alphasort.c: New file.
+ * sysdeps/unix/sysv/linux/x86_64/x32/alphasort64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/fseeko.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/fseeko64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/ftello.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/ftello64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/ftw.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/ftw64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/glob.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofopen.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofopen64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/lockf.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/lockf64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/mkostemp.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/mkostemp64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/mkstemp.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/mkstemp64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/scandir.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/scandir64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/scandirat.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/scandirat64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/tmpfile.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/tmpfile64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/versionsort.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/versionsort64.c: Likewise.
+
+2012-05-16 Andreas Schwab <schwab@linux-m68k.org>
+
+ * Makerules (+depfiles): Also collect depfiles from .oS in
+ $(extra-objs).
+ * sysdeps/ieee754/ldbl-opt/Makefile (extra-objs): Add $(addsuffix
+ .oS, $(libnldbl-routines)).
+
+ * Makerules (native-compile-mkdep-flags): Define.
+ * sunrpc/Makefile (extra-objs): Add $(addprefix
+ cross-,$(rpcgen-objs)), don't add $(cross-rpcgen-objs).
+ ($(cross-rpcgen-objs)): Use $(native-compile-mkdep-flags) instead
+ of $(compile-mkdep-flags). Depend on $(before-compile) instead of
+ calling $(make-target-directory).
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * bits/types.h (__snseconds_t): Removed.
+ * time/time.h (struct timespec): Replace __snseconds_t with
+ __syscall_slong_t.
+ * bits/typesizes.h (__SNSECONDS_T_TYPE): Removed.
+ * sysdeps/mach/hurd/bits/typesizes.h (__SNSECONDS_T_TYPE):
+ Likewise.
+ * sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
+ (__SNSECONDS_T_TYPE): Likewise.
+ * sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+ (__SNSECONDS_T_TYPE): Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+ (__SNSECONDS_T_TYPE): Likewise.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/mach/hurd/bits/typesizes.h
+ (__SYSCALL_SLONG_TYPE): New macro.
+ (__SYSCALL_ULONG_TYPE): Likewise.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * bits/types.h (__syscall_slong_t): New type.
+ (__syscall_ulong_t): Likewise.
+
+ * bits/typesizes.h (__SYSCALL_SLONG_TYPE): New macro.
+ (__SYSCALL_ULONG_TYPE): Likewise.
+ * sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
+ (__SYSCALL_SLONG_TYPE): Likewise.
+ (__SYSCALL_ULONG_TYPE): Likewise.
+ * sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+ (__SYSCALL_SLONG_TYPE): Likewise.
+ (__SYSCALL_ULONG_TYPE): Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+ (__SYSCALL_SLONG_TYPE): Likewise.
+ (__SYSCALL_ULONG_TYPE): Likewise.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/Makefile (gen-as-const-headers):
+ Add sigaltstack-offsets.sym.
+ * sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S: Include
+ <sigaltstack-offsets.h>.
+ (CALL_FAIL): Use RSP_LP to operate on stack. Use RDI_LP on
+ longjmp_msg pointer.
+ (____longjmp_chk): Use R8_LP and RDX_LP on SP and PC. Use
+ R*_LP, sizeSS, oSS_FLAGS, oSS_SP and oSS_SIZE for alternate
+ signal stack.
+ * sysdeps/unix/sysv/linux/x86_64/sigaltstack-offsets.sym: New.
+
+2012-05-15 Joseph Myers <joseph@codesourcery.com>
+
+ * elf/stackguard-macros.h: Remove file.
+ * sysdeps/generic/stackguard-macros.h: New file.
+ * sysdeps/i386/stackguard-macros.h: Likewise.
+ * sysdeps/powerpc/powerpc32/stackguard-macros.h: Likewise.
+ * sysdeps/powerpc/powerpc64/stackguard-macros.h: Likewise.
+ * sysdeps/s390/s390-32/stackguard-macros.h: Likewise.
+ * sysdeps/s390/s390-64/stackguard-macros.h: Likewise.
+ * sysdeps/sparc/sparc32/stackguard-macros.h: Likewise.
+ * sysdeps/sparc/sparc64/stackguard-macros.h: Likewise.
+ * sysdeps/x86_64/stackguard-macros.h: Likewise.
+ * nptl/tst-stackguard1.c: Include <stackguard-macros.h> not
+ <elf/stackguard-macros.h>.
+
+ [BZ #14109]
+ * sysdeps/unix/sysv/linux/powerpc/sys/procfs.h (elf_vrreg_t): Use
+ __aligned__ in attribute.
+ * sysdeps/unix/sysv/linux/s390/sys/ucontext.h (__psw_t): Likewise.
+ (gregset_t): Likewise.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/Implies (wordsize-64): Moved to ....
+ * sysdeps/x86_64/64/Implies-after: Here. New file.
+ * sysdeps/x86_64/x32/Implies-after: New file.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/dl-trampoline.h: Use R*_LP to pass arguments
+ and access return value for _dl_profile_fixup. Use R10_LP to
+ load frame size.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/x32/init-first.c: New.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/sysdep.h: Allowed to be include more than once.
+ * sysdeps/x86_64/x32/sysdep.h: New file.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/__longjmp.S: Use R*_LP on SP and PC.
+ * sysdeps/x86_64/setjmp.S: Likewise.
+
+2012-05-15 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+
+ * sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c: New file.
+ * sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c: New file.
+ * sysdeps/ieee754/dbl-64/e_log2.c: Fixing indents.
+ * sysdeps/ieee754/dbl-64/e_log10.c: Likewise and also
+ remove unused global constant.
+
+2012-05-15 Chris Metcalf <cmetcalf@tilera.com>
+
+ * sysdeps/unix/sysv/linux/getsysstats.c: Remove duplicate
+ include of <not-cancel.h>.
+
+2012-05-15 Roland McGrath <roland@hack.frob.com>
+
+ * nscd/nscd-client.h (__nscd_acquire_maplock): Fix formatting.
+
+2012-05-15 Jeff Law <law@redhat.com>
+ Andreas Jaeger <aj@suse.de>
+
+ [BZ #13594]
+ * nscd/nscd-client.h (__nscd_acquire_maplock): New function, split
+ out from...
+ * nscd/nscd_helper.c (__nscd_get_map_ref): ... here.
+ * nscd/nscd-client.h: Add __nscd_acquire_maplock.
+ * nscd/nscd_gethst_r.c (__nscd_get_nl_timestamp): Add locking to
+ code changing __hst_map_handle.map.
+
+2012-05-15 Roland McGrath <roland@hack.frob.com>
+
+ * configure.in (sysnames): Look for Implies-before and Implies-after
+ files.
+ * configure: Regenerated.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/sigaction.c (RESTORE2): Replace
+ 8-byte data alignment with LP_SIZE alignment.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/clone.S: Load pointer to TID
+ into R10_LP.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/x32/dl-cache.h: New.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/x32/Makefile: New file.
+ * sysdeps/unix/sysv/linux/x86_64/x32/getcpu.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu-static.c:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S: Likewise.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/stackinfo.h (stackinfo_get_sp): Use RSP_LP.
+ (stackinfo_sub_sp): Likewise.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/multiarch/strcmp-sse42.S: Load pointers into
+ RAX_LP.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/multiarch/memcpy-ssse3.S: Load cache sizes
+ into R*_LP.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: Load cache
+ sizes into R*_LP.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/strcmp.S: Load pointers into R*_LP.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/memcpy.S: Load __x86_64_data_cache_size_half
+ into R11_LP and load __x86_64_shared_cache_size_half into
+ R8_LP.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/multiarch/memcmp-sse4.S: Load cache size into
+ R8_LP.
+
+2012-05-15 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c: New file. Optimized
+ logb for POWER7.
+ * sysdeps/powerpc/powerpc32/power7/fpu/s_logbf.c: New file. Optimized
+ logbf for POWER7.
+ * sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c: New file. Optimized
+ logbl for POWER7.
+ * sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c: New file. Use
+ powerpc32/power7/fpu/s_logb.c via #include.
+ * sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c: New file. Use
+ powerpc32/power7/fpu/s_logbf.c via #include.
+ * sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c: New file. Use
+ powerpc32/power7/fpu/s_logbl.c via #include.
+
+2012-05-15 Joseph Myers <joseph@codesourcery.com>
+
+ * README.libm: Remove file.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/start.S: Simulate popping 4-byte argument
+ count for x32. Use R*_LP and omit operand-size suffix.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * shlib-versions: Move x86_64-.*-linux.* entries to ...
+ * sysdeps/x86_64/64/shlib-versions: Here. New file.
+ * sysdeps/x86_64/x32/shlib-versions: New file.
+
+2012-05-14 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/unix/sysv/linux/dl-osinfo.h (dl_fatal): Function removed.
+ * elf/rtld.c (dl_main) [DL_SYSDEP_OSCHECK]:
+ Use _dl_fatal_printf instead.
+
+2012-05-14 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/configure.in (minimum_kernel): Always
+ set if not set by the user. Do not allow for being unset.
+ * sysdeps/unix/sysv/linux/configure: Regenerated.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/dl-machine.h (elf_machine_load_address): Remove
+ the `q' suffix from lea and replace .quad with ASM_ADDR.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/sysdep.h (PTR_MANGLE): Remove
+ the `q' suffix from xor/rol instructions. Use $2*LP_SIZE+1
+ instead of $17.
+ (PTR_DEMANGLE): Likewise.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/sysdep.h (LP_SIZE): New macro.
+ (LP_OP): Likewise.
+ (ASM_ADDR): Likewise.
+ (RAX_LP): Likewise.
+ (RBP_LP): Likewise.
+ (RBX_LP): Likewise.
+ (RCX_LP): Likewise.
+ (RDI_LP): Likewise.
+ (RSI_LP): Likewise.
+ (RSP_LP): Likewise.
+ (R8_LP): Likewise.
+ (R9_LP): Likewise.
+ (R10_LP): Likewise.
+ (R10_LP): Likewise.
+ (R11_LP): Likewise.
+ (R12_LP): Likewise.
+ (R13_LP): Likewise.
+ (R14_LP): Likewise.
+ (R15_LP): Likewise.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/x32/dl-machine.h: New file.
+
+2012-05-14 Andreas Jaeger <aj@suse.de>
+
+ * manual/Makefile (subdir): Remove export of subdir.
+ (all): Remove target.
+ (.PHONY): Remove all from list.
+ (mkinstalldirs): Remove.
+ (.PHONY): Remove installdirs from list.
+ ($(inst_infodir)/libc.info): Use make-target-directory.
+ (installdirs): Remove.
+ (subdir_%): Remove.
+ (glibc-targets): Remove.
+ (lib): Remove.
+ (stubs): Remove.
+ ($(objpfx)stubs ../po/manual.pot): Remove.
+ ($(objpfx)stamp%): Remove.
+ (make-target-directory): Remove.
+ (subdir_install): Remove.
+ (routines): Remove.
+ (aux): Remove.
+ (sources): Remove.
+ (objects): Remove.
+ (headers): Remove.
+
+ [BZ #13750]
+ * manual/.gitignore: Remove, it's not needed anymore.
+ * manual/libc-texinfo.sh: Pass OUTDIR as extra argument, create
+ all files in it.
+ * manual/Makefile (dvi, pdf, info, html): Depend on files in build
+ directory.
+ (texis): Renamed to $(objpfx)texis.
+ (texis-path): New, contains path to generated files.
+ (chapters.%): Use texis-path for complete path, add extra argument
+ libc-texinfo.sh.
+ (libc.dvi, libc.pdf, libc.info, libc.pdf): Add $(objfpx) as prefix.
+ (libc/index.html, summary.texi): Add $(objpfx) as prefix.
+ (summary,texi, stamp-summary): Use complete path of
+ files. Generate files in build dir.
+ (dir-add.texi): Build in build dir.
+ (libm-err.texi,stamp-libm-err): Likewise.
+ (version.texi, stamp-version): Likewise.
+ (.%c.texi): Likewise.
+ (%.info,%.dvi,%.pdf): Add $(objpfx) as prefix, build in build dir.
+ (mostlyclean): Remove target.
+ (realclean): Remove target.
+ (generated): Add new variable with contents from mostlyclean and
+ realclean, remove entries duplicated in common-mostlyclean, add
+ stamp-libm-err and stamp-version.
+ (generated-dirs): Add libc directory.
+ ($(inst_infodir)/libc.info): Install files from build dir.
+
+ * manual/install.texi (Configuring and compiling): Adjust since
+ the info files are not part of the tar ball anymore.
+
+2012-05-14 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/getcwd.c (__getcwd): Remove unused
+ variable.
+
+2012-05-14 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13717]
+ * sysdeps/unix/sysv/linux/configure.in (arch_minimum_kernel): Set
+ to 2.2.0 where earlier.
+ * sysdeps/unix/sysv/linux/configure: Regenerated.
+ * sysdeps/unix/sysv/linux/getcwd.c [!__ASSUME_GETCWD_SYSCALL]:
+ Remove conditional code.
+ [__ASSUME_GETCWD_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/i386/chown.c [!__ASSUME_LCHOWN_SYSCALL]:
+ Remove conditional code.
+ [!__NR_lchown]: Likewise.
+ [__ASSUME_LCHOWN_SYSCALL]: Make code unconditional.
+ [__NR_lchown]: Likewise.
+ * sysdeps/unix/sysv/linux/i386/fchownat.c (fchownat): Remove
+ comment referencing __ASSUME_LCHOWN_SYSCALL.
+ * sysdeps/unix/sysv/linux/i386/sigaction.c
+ [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code.
+ [__ASSUME_REALTIME_SIGNALS]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/if_index.c [!__ASSUME_SIOCGIFNAME]:
+ Remove conditional code.
+ [__ASSUME_SIOCGIFNAME ]: Make code unconditional.
+ (__protocol_available): Remove #if 0 code.
+ * sysdeps/unix/sysv/linux/ifreq.c [!__ASSUME_SIOCGIFNAME]: Remove
+ conditional code.
+ [__ASSUME_SIOCGIFNAME]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_GETCWD_SYSCALL): Don't define.
+ (__ASSUME_REALTIME_SIGNALS): Likewise.
+ (__ASSUME_PREAD_SYSCALL): Likewise.
+ (__ASSUME_PWRITE_SYSCALL): Likewise.
+ (__ASSUME_POLL_SYSCALL): Likewise.
+ (__ASSUME_LCHOWN_SYSCALL): Likewise.
+ (__ASSUME_SETRESUID_SYSCALL): Define for all kernel versions for
+ non-SPARC.
+ (__ASSUME_SIOCGIFNAME): Don't define.
+ (__ASSUME_MSG_NOSIGNAL): Likewise.
+ (__ASSUME_SENDFILE): Define unconditionally.
+ (__ASSUME_PROC_SELF_FD_SYMLINK): Don't define.
+ * sysdeps/unix/sysv/linux/poll.c [!__ASSUME_POLL_SYSCALL]: Remove
+ conditional code.
+ [__ASSUME_POLL_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/powerpc/chown.c (__chown)
+ [!__ASSUME_LCHOWN_SYSCALL]: Remove conditional code.
+ (__chown) [__ASSUME_LCHOWN_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/powerpc/fchownat.c (fchownat)
+ [!__ASSUME_LCHOWN_SYSCALL]: Remove conditional code.
+ (fchownat) [__ASSUME_LCHOWN_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
+ [!__ASSUME_PREAD_SYSCALL]: Remove conditional code.
+ [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
+ [!__ASSUME_PREAD_SYSCALL]: Remove conditional code.
+ [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
+ [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code.
+ [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
+ [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code.
+ [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c
+ [!__ASSUME_PREAD_SYSCALL]: Remove conditional code.
+ [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
+ [!__ASSUME_PREAD_SYSCALL]: Remove conditional code.
+ [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c
+ [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code.
+ [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
+ [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code.
+ [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/pread.c [!__ASSUME_PREAD_SYSCALL]:
+ Remove conditional code.
+ [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/pread64.c [!__ASSUME_PREAD_SYSCALL]:
+ Remove conditional code.
+ [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_internal)
+ [__LINUX_KERNEL_VERSION < 131443]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/pwrite.c [!__ASSUME_PWRITE_SYSCALL]:
+ Remove conditional code.
+ [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/pwrite64.c [!__ASSUME_PWRITE_SYSCALL]:
+ Remove conditional code.
+ [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/sh/pread.c [!__ASSUME_PREAD_SYSCALL]:
+ Remove conditional code.
+ [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/sh/pread64.c [!__ASSUME_PREAD_SYSCALL]:
+ Remove conditional code.
+ [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/sh/pwrite.c [!__ASSUME_PWRITE_SYSCALL]:
+ Remove conditional code.
+ [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/sh/pwrite64.c
+ [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code.
+ [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/sigaction.c
+ [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code.
+ [__ASSUME_REALTIME_SIGNALS]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/sigpending.c
+ [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code.
+ [__ASSUME_REALTIME_SIGNALS]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/sigprocmask.c
+ [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code.
+ [__ASSUME_REALTIME_SIGNALS]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/sigsuspend.c
+ [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code.
+ [__ASSUME_REALTIME_SIGNALS]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
+ (__libc_missing_rt_sigs): Remove.
+ (__libc_sigaction) [__NR_rt_sigaction]: Make code unconditional.
+ (__libc_sigaction): Do not handle ENOSYS from rt_sigaction.
+ * sysdeps/unix/sysv/linux/syslog.c [!__ASSUME_MSG_NOSIGNAL]:
+ Remove conditional code.
+ [__ASSUME_MSG_NOSIGNAL]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/testrtsig.h (kernel_has_rtsig): Always
+ return 1.
+ * sysdeps/unix/sysv/linux/ttyname.c (ttyname)
+ [!__ASSUME_PROC_SELF_FD_SYMLINK]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r)
+ [!__ASSUME_PROC_SELF_FD_SYMLINK]: Likewise.
+
+2012-05-14 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/i386/fpu/bits/mathinline.h (__pow2): Remove,
+ it's not used in glibc.
+ (__coshm1): Likewise.
+ (__acosh1p): Likewise.
+ (__sgn): Likewise.
+
+ * manual/string.texi (Copying and Concatenation): Add missing
+ variable in concat example.
+ Reported by David C. Rankin <drankinatty@suddenlinkmail.com>.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #14103]
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c (__logb): Replace
+ __builtin_clzl with __builtin_clzll.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #14104]
+ * sysdeps/unix/sysv/linux/check_pf.c (cache): Use
+ libc_freeres_ptr.
+
+2012-05-14 Liubov Dmitrieva <liubov.dmitrieva@gmail.com>
+
+ * sysdeps/i386/i686/fpu/multiarch/Makefile: New file.
+ * sysdeps/i386/i686fpu/multiarch/e_expf.c: New file.
+ * sysdeps/i386/i686fpu/multiarch/e_expf-ia32.S: New file.
+ * sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S: New file.
+
+2012-05-14 Mike Frysinger <vapier@gentoo.org>
+
+ * NEWS: Update ia64 info.
+
+2012-05-12 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/powerpc/memmove.c (MEMMOVE): Don't return a value if
+ used as bcopy.
+
2012-05-12 Thomas Schwinge <thomas@codesourcery.com>
* io/dup3.c (dup3): Rename to __dup3, add weak alias for dup3.
diff --git a/libc/INSTALL b/libc/INSTALL
index e8f05df9d..e6e4ab588 100644
--- a/libc/INSTALL
+++ b/libc/INSTALL
@@ -13,10 +13,10 @@ Here are the original GLIBC installation instructions:
Installing the GNU C Library
****************************
-Before you do anything else, you should read the file `FAQ' located at
-the top level of the source tree. This file answers common questions
+Before you do anything else, you should read the FAQ at
+`http://sourceware.org/glibc/wiki/FAQ'. It answers common questions
and describes problems you may experience with compilation and
-installation. It is updated more frequently than this manual.
+installation.
Features can be added to the GNU C Library via "add-on" bundles.
These are separate tar files, which you unpack into the top level of
@@ -43,8 +43,8 @@ at the top level of the source tree. In the scenario above, you'd type
$ ../glibc-VERSION/configure ARGS...
Please note that even though you're building in a separate build
-directory, the compilation needs to modify a few files in the source
-directory, especially some files in the manual subdirectory.
+directory, the compilation may need to create or modify files and
+directories in the source directory.
`configure' takes many options, but the only one that is usually
mandatory is `--prefix'. This option tells `configure' where you want
@@ -189,9 +189,9 @@ files must all contain correct and sensible content.
To format the `GNU C Library Reference Manual' for printing, type
`make dvi'. You need a working TeX installation to do this. The
-distribution already includes the on-line formatted version of the
-manual, as Info files. You can regenerate those with `make info', but
-it shouldn't be necessary.
+distribution builds the on-line formatted version of the manual, as
+Info files, as part of the build process. You can build them manually
+with `make info'.
The library has a number of special-purpose configuration parameters
which you can find in `Makeconfig'. These can be overwritten with the
@@ -256,9 +256,9 @@ well.
permissions on a pseudoterminal so it can be used by the calling
process. This means programs like `xterm' and `screen' do not have to
be setuid to get a pty. (There may be other reasons why they need
-privileges.) If you are using a 2.1 or newer Linux kernel with the
-`devptsfs' or `devfs' filesystems providing pty slaves, you don't need
-this program; otherwise you do. The source for `pt_chown' is in
+privileges.) If you are using a Linux kernel with the `devptsfs' or
+`devfs' filesystems providing pty slaves, you don't need this program;
+otherwise you do. The source for `pt_chown' is in
`login/programs/pt_chown.c'.
After installation you might want to configure the timezone and
@@ -309,7 +309,7 @@ build the GNU C Library:
No other assembler or linker has the necessary functionality at the
moment.
- * GNU `texinfo' 3.12f
+ * GNU `texinfo' 4.5 or later
To correctly translate and install the Texinfo documentation you
need this version of the `texinfo' package. Earlier versions do
@@ -389,11 +389,6 @@ C Library with `--prefix=/usr'. If you set some other prefix or allow
it to default to `/usr/local', then all the components are installed
there.
- You cannot use `nscd' with 2.0 kernels, due to bugs in the
-kernel-side thread support. `nscd' happens to hit these bugs
-particularly hard, but you might have problems with any threaded
-program.
-
Reporting Bugs
==============
@@ -405,7 +400,7 @@ remain unfixed for all eternity, if not longer.
It is a good idea to verify that the problem has not already been
reported. Bugs are documented in two places: The file `BUGS' describes
a number of well known bugs and the bug tracking system has a WWW
-interface at `http://sources.redhat.com/bugzilla/'. The WWW interface
+interface at `http://sourceware.org/bugzilla/'. The WWW interface
gives you access to open and closed reports. A closed report normally
includes a patch or a hint on solving the problem.
diff --git a/libc/Makeconfig b/libc/Makeconfig
index 933c143f1..d4885bc2d 100644
--- a/libc/Makeconfig
+++ b/libc/Makeconfig
@@ -669,13 +669,14 @@ libio-include = -I$(..)libio
# Note that we can't use -std=* in CPPFLAGS, because it overrides
# the implicit -lang-asm and breaks cpp behavior for .S files--notably
# it causes cpp to stop predefining __ASSEMBLER__.
-CPPFLAGS = $(CPPFLAGS-config) $($(subdir)-CPPFLAGS) $(+includes) $(defines) \
+CPPFLAGS = $(CPPUNDEFS) $(CPPFLAGS-config) $($(subdir)-CPPFLAGS) \
+ $(+includes) $(defines) \
-include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
$(CPPFLAGS-$(suffix $@)) \
$(foreach lib,$(libof-$(basename $(@F))) \
$(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
$(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
-override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
+override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) $(config-extra-cflags) \
$(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
$(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
$(CFLAGS-$(@F)) \
@@ -727,6 +728,10 @@ CFLAGS-.op = -pg
libtype.op = lib%_p.a
endif
+# Convenience variable for when we want to treat shared-library cases
+# differently from the rest.
+object-suffixes-noshared := $(filter-out .os,$(object-suffixes))
+
bppfx = BP-
ifeq (yes,$(build-bounded))
# Under --enable-bounded, we build the library with `-fbounded-pointers -g'
diff --git a/libc/Makerules b/libc/Makerules
index c69d0f4b9..eb06a7a5d 100644
--- a/libc/Makerules
+++ b/libc/Makerules
@@ -244,7 +244,7 @@ $(common-objpfx)sysd-rules: $(common-objpfx)config.make $(..)Makerules \
/*) ;; \
*) dir="\$$(..)$$dir" ;; \
esac; \
- asm='.S .s'; \
+ asm='.S'; \
$(check-inhibit-asm) \
for o in $(all-object-suffixes); do \
set $(subst :, ,$(sysd-rules-patterns)); \
@@ -276,12 +276,6 @@ object-suffixes-left := $(all-object-suffixes)
include $(o-iterator)
define o-iterator-doit
-$(objpfx)%$o: %.s $(before-compile); $$(compile-command.s)
-endef
-object-suffixes-left := $(all-object-suffixes)
-include $(o-iterator)
-
-define o-iterator-doit
$(objpfx)%$o: %.c $(before-compile); $$(compile-command.c)
endef
object-suffixes-left := $(all-object-suffixes)
@@ -305,12 +299,6 @@ object-suffixes-left := $(all-object-suffixes)
include $(o-iterator)
define o-iterator-doit
-$(objpfx)%$o: $(objpfx)%.s $(before-compile); $$(compile-command.s)
-endef
-object-suffixes-left := $(all-object-suffixes)
-include $(o-iterator)
-
-define o-iterator-doit
$(objpfx)%$o: $(objpfx)%.c $(before-compile); $$(compile-command.c)
endef
object-suffixes-left := $(all-object-suffixes)
@@ -369,24 +357,31 @@ endif # sysd-sorted-done
# Generate .dT files as we compile.
compile-mkdep-flags = -MD -MP -MF $@.dt -MT $@
compile-command.S = $(compile.S) $(OUTPUT_OPTION) $(compile-mkdep-flags)
-compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
+# Like compile-mkdep-flags, but for use with $(BUILD_CC). We don't want to
+# track system includes here, they may spuriously trigger an install rule,
+# and would cause the check-local-headers test to fail.
+native-compile-mkdep-flags = -MMD -MP -MF $@.dt -MT $@
+
# GCC can grok options after the file name, and it looks nicer that way.
compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
compile.cc = $(CXX) $< -c $(CXXFLAGS) $(CPPFLAGS)
compile.S = $(CC) $< -c $(CPPFLAGS) $(S-CPPFLAGS) \
$(ASFLAGS) $(ASFLAGS-$(suffix $@))
+COMPILE.c = $(CC) -c $(CFLAGS) $(CPPFLAGS)
COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
$(ASFLAGS) $(ASFLAGS-$(suffix $@))
-COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
# We need this for the output to go in the right place. It will default to
# empty if make was configured to work with a cc that can't grok -c and -o
# together. You can't compile the C library with such a compiler.
OUTPUT_OPTION = -o $@
+# This is the end of the pipeline for compiling generated C code.
+compile-stdin.c = $(COMPILE.c) -o $@ -x c - $(compile-mkdep-flags)
+
# We need the $(CFLAGS) to be in there to have the right predefines during
# the dependency run for C sources. But having it for assembly sources can
# get the wrong predefines.
@@ -674,6 +669,7 @@ endif
+depfiles := $(sources:.c=.d) \
$(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \
+ $(patsubst %.oS,%.d,$(filter %.oS,$(extra-objs))) \
$(patsubst %.o,%.d,$(filter %.o,$(extra-test-objs:.os=.o))) \
$(addsuffix .d,$(tests) $(xtests) $(test-srcs))
ifeq ($(build-programs),yes)
@@ -1294,7 +1290,7 @@ $(stdio_lim:h=st): $(..)stdio-common/stdio_lim.h.in $(..)Rules \
echo '#define _LIBC 1'; \
echo '#include "$(..)misc/sys/uio.h"'; } | \
$(CC) -E -dM -MD -MP -MF $(@:st=dT) -MT '$(@:st=h) $(@:st=d)' \
- $(+includes) -xc - -o $(@:st=hT)
+ $(CPPUNDEFS) $(+includes) -xc - -o $(@:st=hT)
sed $(sed-remove-objpfx) $(sed-remove-dotdot) \
$(@:st=dT) > $(@:st=dt)
mv -f $(@:st=dt) $(@:st=d)
diff --git a/libc/NEWS b/libc/NEWS
index f9b3855a5..9583748a8 100644
--- a/libc/NEWS
+++ b/libc/NEWS
@@ -9,23 +9,26 @@ Version 2.16
* The following bugs are resolved with this release:
- 174, 350, 369, 411, 706, 766, 887, 2074, 2541, 2547, 2548, 2550, 2551,
- 2552, 2553, 2554, 2562, 2563, 2565, 2566, 2570, 2576, 2636, 2678, 3335,
- 3440, 3748, 3768, 3866, 3868, 3906, 3976, 3992, 4026, 4108, 4596, 4822,
- 5077, 5461, 5805, 5993, 6471, 6486, 6578, 6649, 6730, 6770, 6794, 6884,
- 6890, 6894, 6895, 6907, 6911, 6959, 7064, 9739, 9902, 10110, 10135, 10140,
- 10153, 10210, 10254, 10346, 10545, 10716, 11174, 11322, 11365, 11451,
- 11494, 11521, 11837, 11959, 12047, 12340, 13058, 13525, 13526, 13527,
- 13528, 13529, 13530, 13531, 13532, 13533, 13547, 13551, 13552, 13553,
- 13555, 13559, 13563, 13566, 13583, 13592, 13618, 13637, 13656, 13658,
- 13673, 13691, 13695, 13704, 13705, 13706, 13726, 13738, 13739, 13758,
- 13760, 13761, 13775, 13786, 13787, 13792, 13806, 13824, 13840, 13841,
- 13844, 13846, 13851, 13852, 13854, 13871, 13872, 13873, 13879, 13883,
- 13884, 13885, 13886, 13892, 13895, 13908, 13910, 13911, 13912, 13913,
- 13914, 13915, 13916, 13917, 13918, 13919, 13920, 13921, 13922, 13923,
- 13924, 13926, 13927, 13928, 13938, 13941, 13942, 13954, 13955, 13956,
- 13963, 13967, 13970, 13973, 13979, 13983, 14012, 14027, 14033, 14034,
- 14040, 14049, 14053, 14055, 14064, 14080, 14083
+ 174, 208, 350, 369, 411, 706, 766, 887, 2074, 2541, 2547, 2548, 2550,
+ 2551, 2552, 2553, 2554, 2562, 2563, 2565, 2566, 2570, 2576, 2636, 2678,
+ 3335, 3440, 3748, 3768, 3866, 3868, 3906, 3976, 3992, 4026, 4108, 4596,
+ 4822, 5077, 5461, 5805, 5993, 6471, 6486, 6578, 6649, 6730, 6770, 6794,
+ 6884, 6890, 6894, 6895, 6907, 6911, 6959, 7064, 9739, 9902, 10110, 10135,
+ 10140, 10153, 10210, 10254, 10346, 10375, 10545, 10716, 10846, 11174,
+ 11322, 11365, 11451, 11494, 11521, 11677, 11837, 11959, 12047, 12097,
+ 12193, 12297, 12298, 12301, 12340, 12354, 12416, 12495, 13058, 13361,
+ 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532, 13533, 13547,
+ 13551, 13552, 13553, 13555, 13556, 13559, 13563, 13566, 13576, 13583,
+ 13592, 13594, 13613, 13618, 13637, 13656, 13658, 13673, 13691, 13695,
+ 13704, 13705, 13706, 13726, 13738, 13739, 13750, 13758, 13760, 13761,
+ 13775, 13786, 13787, 13792, 13806, 13824, 13840, 13841, 13844, 13846,
+ 13851, 13852, 13854, 13871, 13872, 13873, 13879, 13883, 13884, 13885,
+ 13886, 13892, 13895, 13908, 13910, 13911, 13912, 13913, 13914, 13915,
+ 13916, 13917, 13918, 13919, 13920, 13921, 13922, 13923, 13924, 13926,
+ 13927, 13928, 13938, 13941, 13942, 13954, 13955, 13956, 13963, 13967,
+ 13968, 13970, 13973, 13979, 13983, 13986, 14012, 14027, 14033, 14034,
+ 14036, 14040, 14043, 14044, 14049, 14053, 14055, 14059, 14064, 14080,
+ 14083, 14103, 14104, 14109, 14122, 14123, 14153
* ISO C11 support:
@@ -48,7 +51,7 @@ Version 2.16
Implemented by Ulrich Drepper.
-* Support for the IA-64 is removed and could live in ports.
+* Support for the IA-64 has been moved to ports.
* Remove support for anything but ELF binary format
@@ -63,6 +66,22 @@ Version 2.16
version 2.14. This option will be removed at some time in the future
after the TI-RPC library becomes fully sufficient for the needs of
existing applications.
+
+* Compatibility code for Linux kernel versions before 2.4 has been removed.
+ Note that glibc is not expected to work with any Linux kernel version
+ before 2.6.
+
+* New header <sys/auxv.h> and function getauxval allowing easy access to
+ the AT_* key-value pairs passed from the Linux kernel. The header also
+ defines the HWCAP_* bits associated with the AT_HWCAP key.
+
+* New locales: mag_IN
+
+* New configure option --enable-systemtap builds SystemTap static probes
+ into libc for setjmp and longjmp and into libpthread for various operations.
+ So far the setjmp/longjmp probes and some of the libpthread probes are
+ provided only for i*86 and x86_64.
+ Implemented by Roland McGrath and Rayson Ho.
Version 2.15
@@ -425,7 +444,7 @@ Version 2.8
Implemented by Ulrich Drepper.
* Faster sqrt and sqrtf implemention for some PPC variants.
- Implemented by Stephen Munroe.
+ Implemented by Steven Munroe.
Version 2.7
@@ -989,68 +1008,6 @@ Version 2.2
Masahide Washizawa.
* IA-64 port by Jes Sorensen and HJ Lu.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Compiling the GNU C Library for Linux/ia64
-******************************************
-
- Please refer to the file INSTALL in the same directory as you found
-this file for general information about configuring and compiling
-glibc.
-
- For general inquiries about glibc under Linux/ia64 please use the
-following mailing list linux-ia64@linuxia64.org or one of the relevant
-glibc mailing lists.
-
-Recommended Tools for Compilation
-=================================
-
- In order for glibc-2.2 to build correctly on the ia64 you need at
-least the following versions of the GNU tools (the :
-
- * The Cygnus toolchain snapshot for the ia64 as of August 4
- including the provided set of patches. It is however recommend
- you use the October 24 toolchain snapshot or a more recent version.
-
- OR alternatively you can try the following (the Cygnus toolchain is
- the recommended solution):
-
- * GCC and binutils, GAS and GNU LD out of CVS from
- sources.redhat.com as of August 28, 2000 or later. The CVS tree
- may require special patches to work properly on the ia64.
-
-Configuring and compiling GNU Libc for Linux/ia64
-=================================================
-
- The library requires Linux kernel version 2.4.0-test4-000728 or
-later to funtion properly. Besides that it support for debug libraries
-is currently untested. Hence the following options
-are required for configuring the library:
-
- --disable-debug --enable-kernel=2.4.0
-
- It is also important that you make sure the library picks up the
-appropriate kernel header files, if you do not have recent enough
-kernel headers in /usr/src/linux/include, you should use the
---with-headers=<path> option to specify the location.
-
- As an example I personally use the following options to configure
-the library:
-
- --disable-debug
- --disable-cvs
- --enable-kernel=2.4.0
- --host=ia64-linux
- --enable-add-ons=yes
- --prefix=/usr
- --with-headers=/home/jes/linux/include
-
-
-Good luck
-
-Jes Sorensen <jes@linuxcare.com>,
-November 14th, 2000
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Version 2.1.3
diff --git a/libc/README.libm b/libc/README.libm
deleted file mode 100644
index f058cf846..000000000
--- a/libc/README.libm
+++ /dev/null
@@ -1,856 +0,0 @@
-The following functions for the `long double' versions of the libm
-function have to be written:
-
-e_acosl.c
-e_asinl.c
-e_atan2l.c
-e_expl.c
-e_fmodl.c
-e_hypotl.c
-e_j0l.c
-e_j1l.c
-e_jnl.c
-e_lgammal_r.c
-e_logl.c
-e_log10l.c
-e_powl.c
-e_rem_pio2l.c
-e_sinhl.c
-e_sqrtl.c
-
-k_cosl.c
-k_rem_pio2l.c
-k_sinl.c
-k_tanl.c
-
-s_atanl.c
-s_erfl.c
-s_expm1l.c
-s_log1pl.c
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Methods
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-arcsin
-~~~~~~
- * Since asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ...
- * we approximate asin(x) on [0,0.5] by
- * asin(x) = x + x*x^2*R(x^2)
- * where
- * R(x^2) is a rational approximation of (asin(x)-x)/x^3
- * and its remez error is bounded by
- * |(asin(x)-x)/x^3 - R(x^2)| < 2^(-58.75)
- *
- * For x in [0.5,1]
- * asin(x) = pi/2-2*asin(sqrt((1-x)/2))
- * Let y = (1-x), z = y/2, s := sqrt(z), and pio2_hi+pio2_lo=pi/2;
- * then for x>0.98
- * asin(x) = pi/2 - 2*(s+s*z*R(z))
- * = pio2_hi - (2*(s+s*z*R(z)) - pio2_lo)
- * For x<=0.98, let pio4_hi = pio2_hi/2, then
- * f = hi part of s;
- * c = sqrt(z) - f = (z-f*f)/(s+f) ...f+c=sqrt(z)
- * and
- * asin(x) = pi/2 - 2*(s+s*z*R(z))
- * = pio4_hi+(pio4-2s)-(2s*z*R(z)-pio2_lo)
- * = pio4_hi+(pio4-2f)-(2s*z*R(z)-(pio2_lo+2c))
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-arccos
-~~~~~~
- * Method :
- * acos(x) = pi/2 - asin(x)
- * acos(-x) = pi/2 + asin(x)
- * For |x|<=0.5
- * acos(x) = pi/2 - (x + x*x^2*R(x^2)) (see asin.c)
- * For x>0.5
- * acos(x) = pi/2 - (pi/2 - 2asin(sqrt((1-x)/2)))
- * = 2asin(sqrt((1-x)/2))
- * = 2s + 2s*z*R(z) ...z=(1-x)/2, s=sqrt(z)
- * = 2f + (2c + 2s*z*R(z))
- * where f=hi part of s, and c = (z-f*f)/(s+f) is the correction term
- * for f so that f+c ~ sqrt(z).
- * For x<-0.5
- * acos(x) = pi - 2asin(sqrt((1-|x|)/2))
- * = pi - 0.5*(s+s*z*R(z)), where z=(1-|x|)/2,s=sqrt(z)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-atan2
-~~~~~
- * Method :
- * 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x).
- * 2. Reduce x to positive by (if x and y are unexceptional):
- * ARG (x+iy) = arctan(y/x) ... if x > 0,
- * ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0,
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-atan
-~~~~
- * Method
- * 1. Reduce x to positive by atan(x) = -atan(-x).
- * 2. According to the integer k=4t+0.25 chopped, t=x, the argument
- * is further reduced to one of the following intervals and the
- * arctangent of t is evaluated by the corresponding formula:
- *
- * [0,7/16] atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...)
- * [7/16,11/16] atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) )
- * [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) )
- * [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) )
- * [39/16,INF] atan(x) = atan(INF) + atan( -1/t )
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-exp
-~~~
- * Method
- * 1. Argument reduction:
- * Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658.
- * Given x, find r and integer k such that
- *
- * x = k*ln2 + r, |r| <= 0.5*ln2.
- *
- * Here r will be represented as r = hi-lo for better
- * accuracy.
- *
- * 2. Approximation of exp(r) by a special rational function on
- * the interval [0,0.34658]:
- * Write
- * R(r**2) = r*(exp(r)+1)/(exp(r)-1) = 2 + r*r/6 - r**4/360 + ...
- * We use a special Reme algorithm on [0,0.34658] to generate
- * a polynomial of degree 5 to approximate R. The maximum error
- * of this polynomial approximation is bounded by 2**-59. In
- * other words,
- * R(z) ~ 2.0 + P1*z + P2*z**2 + P3*z**3 + P4*z**4 + P5*z**5
- * (where z=r*r, and the values of P1 to P5 are listed below)
- * and
- * | 5 | -59
- * | 2.0+P1*z+...+P5*z - R(z) | <= 2
- * | |
- * The computation of exp(r) thus becomes
- * 2*r
- * exp(r) = 1 + -------
- * R - r
- * r*R1(r)
- * = 1 + r + ----------- (for better accuracy)
- * 2 - R1(r)
- * where
- * 2 4 10
- * R1(r) = r - (P1*r + P2*r + ... + P5*r ).
- *
- * 3. Scale back to obtain exp(x):
- * From step 1, we have
- * exp(x) = 2^k * exp(r)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-hypot
-~~~~~
- * If (assume round-to-nearest) z=x*x+y*y
- * has error less than sqrt(2)/2 ulp, than
- * sqrt(z) has error less than 1 ulp (exercise).
- *
- * So, compute sqrt(x*x+y*y) with some care as
- * follows to get the error below 1 ulp:
- *
- * Assume x>y>0;
- * (if possible, set rounding to round-to-nearest)
- * 1. if x > 2y use
- * x1*x1+(y*y+(x2*(x+x1))) for x*x+y*y
- * where x1 = x with lower 32 bits cleared, x2 = x-x1; else
- * 2. if x <= 2y use
- * t1*y1+((x-y)*(x-y)+(t1*y2+t2*y))
- * where t1 = 2x with lower 32 bits cleared, t2 = 2x-t1,
- * y1= y with lower 32 bits chopped, y2 = y-y1.
- *
- * NOTE: scaling may be necessary if some argument is too
- * large or too tiny
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-j0/y0
-~~~~~
- * Method -- j0(x):
- * 1. For tiny x, we use j0(x) = 1 - x^2/4 + x^4/64 - ...
- * 2. Reduce x to |x| since j0(x)=j0(-x), and
- * for x in (0,2)
- * j0(x) = 1-z/4+ z^2*R0/S0, where z = x*x;
- * (precision: |j0-1+z/4-z^2R0/S0 |<2**-63.67 )
- * for x in (2,inf)
- * j0(x) = sqrt(2/(pi*x))*(p0(x)*cos(x0)-q0(x)*sin(x0))
- * where x0 = x-pi/4. It is better to compute sin(x0),cos(x0)
- * as follow:
- * cos(x0) = cos(x)cos(pi/4)+sin(x)sin(pi/4)
- * = 1/sqrt(2) * (cos(x) + sin(x))
- * sin(x0) = sin(x)cos(pi/4)-cos(x)sin(pi/4)
- * = 1/sqrt(2) * (sin(x) - cos(x))
- * (To avoid cancellation, use
- * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
- * to compute the worse one.)
- *
- * Method -- y0(x):
- * 1. For x<2.
- * Since
- * y0(x) = 2/pi*(j0(x)*(ln(x/2)+Euler) + x^2/4 - ...)
- * therefore y0(x)-2/pi*j0(x)*ln(x) is an even function.
- * We use the following function to approximate y0,
- * y0(x) = U(z)/V(z) + (2/pi)*(j0(x)*ln(x)), z= x^2
- * where
- * U(z) = u00 + u01*z + ... + u06*z^6
- * V(z) = 1 + v01*z + ... + v04*z^4
- * with absolute approximation error bounded by 2**-72.
- * Note: For tiny x, U/V = u0 and j0(x)~1, hence
- * y0(tiny) = u0 + (2/pi)*ln(tiny), (choose tiny<2**-27)
- * 2. For x>=2.
- * y0(x) = sqrt(2/(pi*x))*(p0(x)*cos(x0)+q0(x)*sin(x0))
- * where x0 = x-pi/4. It is better to compute sin(x0),cos(x0)
- * by the method mentioned above.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-j1/y1
-~~~~~
- * Method -- j1(x):
- * 1. For tiny x, we use j1(x) = x/2 - x^3/16 + x^5/384 - ...
- * 2. Reduce x to |x| since j1(x)=-j1(-x), and
- * for x in (0,2)
- * j1(x) = x/2 + x*z*R0/S0, where z = x*x;
- * (precision: |j1/x - 1/2 - R0/S0 |<2**-61.51 )
- * for x in (2,inf)
- * j1(x) = sqrt(2/(pi*x))*(p1(x)*cos(x1)-q1(x)*sin(x1))
- * y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
- * where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
- * as follow:
- * cos(x1) = cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
- * = 1/sqrt(2) * (sin(x) - cos(x))
- * sin(x1) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
- * = -1/sqrt(2) * (sin(x) + cos(x))
- * (To avoid cancellation, use
- * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
- * to compute the worse one.)
- *
- * Method -- y1(x):
- * 1. screen out x<=0 cases: y1(0)=-inf, y1(x<0)=NaN
- * 2. For x<2.
- * Since
- * y1(x) = 2/pi*(j1(x)*(ln(x/2)+Euler)-1/x-x/2+5/64*x^3-...)
- * therefore y1(x)-2/pi*j1(x)*ln(x)-1/x is an odd function.
- * We use the following function to approximate y1,
- * y1(x) = x*U(z)/V(z) + (2/pi)*(j1(x)*ln(x)-1/x), z= x^2
- * where for x in [0,2] (abs err less than 2**-65.89)
- * U(z) = U0[0] + U0[1]*z + ... + U0[4]*z^4
- * V(z) = 1 + v0[0]*z + ... + v0[4]*z^5
- * Note: For tiny x, 1/x dominate y1 and hence
- * y1(tiny) = -2/pi/tiny, (choose tiny<2**-54)
- * 3. For x>=2.
- * y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
- * where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
- * by method mentioned above.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-jn/yn
-~~~~~
- * Note 2. About jn(n,x), yn(n,x)
- * For n=0, j0(x) is called,
- * for n=1, j1(x) is called,
- * for n<x, forward recursion us used starting
- * from values of j0(x) and j1(x).
- * for n>x, a continued fraction approximation to
- * j(n,x)/j(n-1,x) is evaluated and then backward
- * recursion is used starting from a supposed value
- * for j(n,x). The resulting value of j(0,x) is
- * compared with the actual value to correct the
- * supposed value of j(n,x).
- *
- * yn(n,x) is similar in all respects, except
- * that forward recursion is used for all
- * values of n>1.
-
-jn:
- /* (x >> n**2)
- * Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
- * Yn(x) = sin(x-(2n+1)*pi/4)*sqrt(2/x*pi)
- * Let s=sin(x), c=cos(x),
- * xn=x-(2n+1)*pi/4, sqt2 = sqrt(2),then
- *
- * n sin(xn)*sqt2 cos(xn)*sqt2
- * ----------------------------------
- * 0 s-c c+s
- * 1 -s-c -c+s
- * 2 -s+c -c-s
- * 3 s+c c-s
-...
- /* x is tiny, return the first Taylor expansion of J(n,x)
- * J(n,x) = 1/n!*(x/2)^n - ...
-...
- /* use backward recurrence */
- /* x x^2 x^2
- * J(n,x)/J(n-1,x) = ---- ------ ------ .....
- * 2n - 2(n+1) - 2(n+2)
- *
- * 1 1 1
- * (for large x) = ---- ------ ------ .....
- * 2n 2(n+1) 2(n+2)
- * -- - ------ - ------ -
- * x x x
- *
- * Let w = 2n/x and h=2/x, then the above quotient
- * is equal to the continued fraction:
- * 1
- * = -----------------------
- * 1
- * w - -----------------
- * 1
- * w+h - ---------
- * w+2h - ...
- *
- * To determine how many terms needed, let
- * Q(0) = w, Q(1) = w(w+h) - 1,
- * Q(k) = (w+k*h)*Q(k-1) - Q(k-2),
- * When Q(k) > 1e4 good for single
- * When Q(k) > 1e9 good for double
- * When Q(k) > 1e17 good for quadruple
-
-...
- /* estimate log((2/x)^n*n!) = n*log(2/x)+n*ln(n)
- * Hence, if n*(log(2n/x)) > ...
- * single 8.8722839355e+01
- * double 7.09782712893383973096e+02
- * long double 1.1356523406294143949491931077970765006170e+04
- * then recurrent value may overflow and the result is
- * likely underflow to zero
-
-yn:
- /* (x >> n**2)
- * Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
- * Yn(x) = sin(x-(2n+1)*pi/4)*sqrt(2/x*pi)
- * Let s=sin(x), c=cos(x),
- * xn=x-(2n+1)*pi/4, sqt2 = sqrt(2),then
- *
- * n sin(xn)*sqt2 cos(xn)*sqt2
- * ----------------------------------
- * 0 s-c c+s
- * 1 -s-c -c+s
- * 2 -s+c -c-s
- * 3 s+c c-s
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-lgamma
-~~~~~~
- * Method:
- * 1. Argument Reduction for 0 < x <= 8
- * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may
- * reduce x to a number in [1.5,2.5] by
- * lgamma(1+s) = log(s) + lgamma(s)
- * for example,
- * lgamma(7.3) = log(6.3) + lgamma(6.3)
- * = log(6.3*5.3) + lgamma(5.3)
- * = log(6.3*5.3*4.3*3.3*2.3) + lgamma(2.3)
- * 2. Polynomial approximation of lgamma around its
- * minimun ymin=1.461632144968362245 to maintain monotonicity.
- * On [ymin-0.23, ymin+0.27] (i.e., [1.23164,1.73163]), use
- * Let z = x-ymin;
- * lgamma(x) = -1.214862905358496078218 + z^2*poly(z)
- * where
- * poly(z) is a 14 degree polynomial.
- * 2. Rational approximation in the primary interval [2,3]
- * We use the following approximation:
- * s = x-2.0;
- * lgamma(x) = 0.5*s + s*P(s)/Q(s)
- * with accuracy
- * |P/Q - (lgamma(x)-0.5s)| < 2**-61.71
- * Our algorithms are based on the following observation
- *
- * zeta(2)-1 2 zeta(3)-1 3
- * lgamma(2+s) = s*(1-Euler) + --------- * s - --------- * s + ...
- * 2 3
- *
- * where Euler = 0.5771... is the Euler constant, which is very
- * close to 0.5.
- *
- * 3. For x>=8, we have
- * lgamma(x)~(x-0.5)log(x)-x+0.5*log(2pi)+1/(12x)-1/(360x**3)+....
- * (better formula:
- * lgamma(x)~(x-0.5)*(log(x)-1)-.5*(log(2pi)-1) + ...)
- * Let z = 1/x, then we approximation
- * f(z) = lgamma(x) - (x-0.5)(log(x)-1)
- * by
- * 3 5 11
- * w = w0 + w1*z + w2*z + w3*z + ... + w6*z
- * where
- * |w - f(z)| < 2**-58.74
- *
- * 4. For negative x, since (G is gamma function)
- * -x*G(-x)*G(x) = pi/sin(pi*x),
- * we have
- * G(x) = pi/(sin(pi*x)*(-x)*G(-x))
- * since G(-x) is positive, sign(G(x)) = sign(sin(pi*x)) for x<0
- * Hence, for x<0, signgam = sign(sin(pi*x)) and
- * lgamma(x) = log(|Gamma(x)|)
- * = log(pi/(|x*sin(pi*x)|)) - lgamma(-x);
- * Note: one should avoid compute pi*(-x) directly in the
- * computation of sin(pi*(-x)).
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-log
-~~~
- * Method :
- * 1. Argument Reduction: find k and f such that
- * x = 2^k * (1+f),
- * where sqrt(2)/2 < 1+f < sqrt(2) .
- *
- * 2. Approximation of log(1+f).
- * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
- * = 2s + 2/3 s**3 + 2/5 s**5 + .....,
- * = 2s + s*R
- * We use a special Reme algorithm on [0,0.1716] to generate
- * a polynomial of degree 14 to approximate R The maximum error
- * of this polynomial approximation is bounded by 2**-58.45. In
- * other words,
- * 2 4 6 8 10 12 14
- * R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s
- * (the values of Lg1 to Lg7 are listed in the program)
- * and
- * | 2 14 | -58.45
- * | Lg1*s +...+Lg7*s - R(z) | <= 2
- * | |
- * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
- * In order to guarantee error in log below 1ulp, we compute log
- * by
- * log(1+f) = f - s*(f - R) (if f is not too large)
- * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy)
- *
- * 3. Finally, log(x) = k*ln2 + log(1+f).
- * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
- * Here ln2 is split into two floating point number:
- * ln2_hi + ln2_lo,
- * where n*ln2_hi is always exact for |n| < 2000.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-log10
-~~~~~
- * Method :
- * Let log10_2hi = leading 40 bits of log10(2) and
- * log10_2lo = log10(2) - log10_2hi,
- * ivln10 = 1/log(10) rounded.
- * Then
- * n = ilogb(x),
- * if(n<0) n = n+1;
- * x = scalbn(x,-n);
- * log10(x) := n*log10_2hi + (n*log10_2lo + ivln10*log(x))
- *
- * Note 1:
- * To guarantee log10(10**n)=n, where 10**n is normal, the rounding
- * mode must set to Round-to-Nearest.
- * Note 2:
- * [1/log(10)] rounded to 53 bits has error .198 ulps;
- * log10 is monotonic at all binary break points.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-pow
-~~~
- * Method: Let x = 2 * (1+f)
- * 1. Compute and return log2(x) in two pieces:
- * log2(x) = w1 + w2,
- * where w1 has 53-24 = 29 bit trailing zeros.
- * 2. Perform y*log2(x) = n+y' by simulating muti-precision
- * arithmetic, where |y'|<=0.5.
- * 3. Return x**y = 2**n*exp(y'*log2)
- *
- * Special cases:
- * 1. (anything) ** 0 is 1
- * 2. (anything) ** 1 is itself
- * 3. (anything) ** NAN is NAN
- * 4. NAN ** (anything except 0) is NAN
- * 5. +-(|x| > 1) ** +INF is +INF
- * 6. +-(|x| > 1) ** -INF is +0
- * 7. +-(|x| < 1) ** +INF is +0
- * 8. +-(|x| < 1) ** -INF is +INF
- * 9. +-1 ** +-INF is NAN
- * 10. +0 ** (+anything except 0, NAN) is +0
- * 11. -0 ** (+anything except 0, NAN, odd integer) is +0
- * 12. +0 ** (-anything except 0, NAN) is +INF
- * 13. -0 ** (-anything except 0, NAN, odd integer) is +INF
- * 14. -0 ** (odd integer) = -( +0 ** (odd integer) )
- * 15. +INF ** (+anything except 0,NAN) is +INF
- * 16. +INF ** (-anything except 0,NAN) is +0
- * 17. -INF ** (anything) = -0 ** (-anything)
- * 18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer)
- * 19. (-anything except 0 and inf) ** (non-integer) is NAN
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rem_pio2 return the remainder of x rem pi/2 in y[0]+y[1]
-~~~~~~~~
-This is one of the basic functions which is written with highest accuracy
-in mind.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sinh
-~~~~
- * Method :
- * mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2
- * 1. Replace x by |x| (sinh(-x) = -sinh(x)).
- * 2.
- * E + E/(E+1)
- * 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x)
- * 2
- *
- * 22 <= x <= lnovft : sinh(x) := exp(x)/2
- * lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2)
- * ln2ovft < x : sinh(x) := x*shuge (overflow)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sqrt
-~~~~
- * Method:
- * Bit by bit method using integer arithmetic. (Slow, but portable)
- * 1. Normalization
- * Scale x to y in [1,4) with even powers of 2:
- * find an integer k such that 1 <= (y=x*2^(-2k)) < 4, then
- * sqrt(x) = 2^k * sqrt(y)
- * 2. Bit by bit computation
- * Let q = sqrt(y) truncated to i bit after binary point (q = 1),
- * i 0
- * i+1 2
- * s = 2*q , and y = 2 * ( y - q ). (1)
- * i i i i
- *
- * To compute q from q , one checks whether
- * i+1 i
- *
- * -(i+1) 2
- * (q + 2 ) <= y. (2)
- * i
- * -(i+1)
- * If (2) is false, then q = q ; otherwise q = q + 2 .
- * i+1 i i+1 i
- *
- * With some algebric manipulation, it is not difficult to see
- * that (2) is equivalent to
- * -(i+1)
- * s + 2 <= y (3)
- * i i
- *
- * The advantage of (3) is that s and y can be computed by
- * i i
- * the following recurrence formula:
- * if (3) is false
- *
- * s = s , y = y ; (4)
- * i+1 i i+1 i
- *
- * otherwise,
- * -i -(i+1)
- * s = s + 2 , y = y - s - 2 (5)
- * i+1 i i+1 i i
- *
- * One may easily use induction to prove (4) and (5).
- * Note. Since the left hand side of (3) contain only i+2 bits,
- * it does not necessary to do a full (53-bit) comparison
- * in (3).
- * 3. Final rounding
- * After generating the 53 bits result, we compute one more bit.
- * Together with the remainder, we can decide whether the
- * result is exact, bigger than 1/2ulp, or less than 1/2ulp
- * (it will never equal to 1/2ulp).
- * The rounding mode can be detected by checking whether
- * huge + tiny is equal to huge, and whether huge - tiny is
- * equal to huge for some floating point number "huge" and "tiny".
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-cos
-~~~
- * kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164
- * Input x is assumed to be bounded by ~pi/4 in magnitude.
- * Input y is the tail of x.
- *
- * Algorithm
- * 1. Since cos(-x) = cos(x), we need only to consider positive x.
- * 2. if x < 2^-27 (hx<0x3e400000 0), return 1 with inexact if x!=0.
- * 3. cos(x) is approximated by a polynomial of degree 14 on
- * [0,pi/4]
- * 4 14
- * cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x
- * where the remez error is
- *
- * | 2 4 6 8 10 12 14 | -58
- * |cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x +C6*x )| <= 2
- * | |
- *
- * 4 6 8 10 12 14
- * 4. let r = C1*x +C2*x +C3*x +C4*x +C5*x +C6*x , then
- * cos(x) = 1 - x*x/2 + r
- * since cos(x+y) ~ cos(x) - sin(x)*y
- * ~ cos(x) - x*y,
- * a correction term is necessary in cos(x) and hence
- * cos(x+y) = 1 - (x*x/2 - (r - x*y))
- * For better accuracy when x > 0.3, let qx = |x|/4 with
- * the last 32 bits mask off, and if x > 0.78125, let qx = 0.28125.
- * Then
- * cos(x+y) = (1-qx) - ((x*x/2-qx) - (r-x*y)).
- * Note that 1-qx and (x*x/2-qx) is EXACT here, and the
- * magnitude of the latter is at least a quarter of x*x/2,
- * thus, reducing the rounding error in the subtraction.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sin
-~~~
- * kernel sin function on [-pi/4, pi/4], pi/4 ~ 0.7854
- * Input x is assumed to be bounded by ~pi/4 in magnitude.
- * Input y is the tail of x.
- * Input iy indicates whether y is 0. (if iy=0, y assume to be 0).
- *
- * Algorithm
- * 1. Since sin(-x) = -sin(x), we need only to consider positive x.
- * 2. if x < 2^-27 (hx<0x3e400000 0), return x with inexact if x!=0.
- * 3. sin(x) is approximated by a polynomial of degree 13 on
- * [0,pi/4]
- * 3 13
- * sin(x) ~ x + S1*x + ... + S6*x
- * where
- *
- * |sin(x) 2 4 6 8 10 12 | -58
- * |----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x +S6*x )| <= 2
- * | x |
- *
- * 4. sin(x+y) = sin(x) + sin'(x')*y
- * ~ sin(x) + (1-x*x/2)*y
- * For better accuracy, let
- * 3 2 2 2 2
- * r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6))))
- * then 3 2
- * sin(x) = x + (S1*x + (x *(r-y/2)+y))
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-tan
-~~~
- * kernel tan function on [-pi/4, pi/4], pi/4 ~ 0.7854
- * Input x is assumed to be bounded by ~pi/4 in magnitude.
- * Input y is the tail of x.
- * Input k indicates whether tan (if k=1) or
- * -1/tan (if k= -1) is returned.
- *
- * Algorithm
- * 1. Since tan(-x) = -tan(x), we need only to consider positive x.
- * 2. if x < 2^-28 (hx<0x3e300000 0), return x with inexact if x!=0.
- * 3. tan(x) is approximated by a odd polynomial of degree 27 on
- * [0,0.67434]
- * 3 27
- * tan(x) ~ x + T1*x + ... + T13*x
- * where
- *
- * |tan(x) 2 4 26 | -59.2
- * |----- - (1+T1*x +T2*x +.... +T13*x )| <= 2
- * | x |
- *
- * Note: tan(x+y) = tan(x) + tan'(x)*y
- * ~ tan(x) + (1+x*x)*y
- * Therefore, for better accuracy in computing tan(x+y), let
- * 3 2 2 2 2
- * r = x *(T2+x *(T3+x *(...+x *(T12+x *T13))))
- * then
- * 3 2
- * tan(x+y) = x + (T1*x + (x *(r+y)+y))
- *
- * 4. For x in [0.67434,pi/4], let y = pi/4 - x, then
- * tan(x) = tan(pi/4-y) = (1-tan(y))/(1+tan(y))
- * = 1 - 2*(tan(y) - (tan(y)^2)/(1+tan(y)))
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-atan
-~~~~
- * Method
- * 1. Reduce x to positive by atan(x) = -atan(-x).
- * 2. According to the integer k=4t+0.25 chopped, t=x, the argument
- * is further reduced to one of the following intervals and the
- * arctangent of t is evaluated by the corresponding formula:
- *
- * [0,7/16] atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...)
- * [7/16,11/16] atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) )
- * [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) )
- * [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) )
- * [39/16,INF] atan(x) = atan(INF) + atan( -1/t )
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-erf
-~~~
- * x
- * 2 |\
- * erf(x) = --------- | exp(-t*t)dt
- * sqrt(pi) \|
- * 0
- *
- * erfc(x) = 1-erf(x)
- * Note that
- * erf(-x) = -erf(x)
- * erfc(-x) = 2 - erfc(x)
- *
- * Method:
- * 1. For |x| in [0, 0.84375]
- * erf(x) = x + x*R(x^2)
- * erfc(x) = 1 - erf(x) if x in [-.84375,0.25]
- * = 0.5 + ((0.5-x)-x*R) if x in [0.25,0.84375]
- * where R = P/Q where P is an odd poly of degree 8 and
- * Q is an odd poly of degree 10.
- * -57.90
- * | R - (erf(x)-x)/x | <= 2
- *
- *
- * Remark. The formula is derived by noting
- * erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....)
- * and that
- * 2/sqrt(pi) = 1.128379167095512573896158903121545171688
- * is close to one. The interval is chosen because the fix
- * point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is
- * near 0.6174), and by some experiment, 0.84375 is chosen to
- * guarantee the error is less than one ulp for erf.
- *
- * 2. For |x| in [0.84375,1.25], let s = |x| - 1, and
- * c = 0.84506291151 rounded to single (24 bits)
- * erf(x) = sign(x) * (c + P1(s)/Q1(s))
- * erfc(x) = (1-c) - P1(s)/Q1(s) if x > 0
- * 1+(c+P1(s)/Q1(s)) if x < 0
- * |P1/Q1 - (erf(|x|)-c)| <= 2**-59.06
- * Remark: here we use the taylor series expansion at x=1.
- * erf(1+s) = erf(1) + s*Poly(s)
- * = 0.845.. + P1(s)/Q1(s)
- * That is, we use rational approximation to approximate
- * erf(1+s) - (c = (single)0.84506291151)
- * Note that |P1/Q1|< 0.078 for x in [0.84375,1.25]
- * where
- * P1(s) = degree 6 poly in s
- * Q1(s) = degree 6 poly in s
- *
- * 3. For x in [1.25,1/0.35(~2.857143)],
- * erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1)
- * erf(x) = 1 - erfc(x)
- * where
- * R1(z) = degree 7 poly in z, (z=1/x^2)
- * S1(z) = degree 8 poly in z
- *
- * 4. For x in [1/0.35,28]
- * erfc(x) = (1/x)*exp(-x*x-0.5625+R2/S2) if x > 0
- * = 2.0 - (1/x)*exp(-x*x-0.5625+R2/S2) if -6<x<0
- * = 2.0 - tiny (if x <= -6)
- * erf(x) = sign(x)*(1.0 - erfc(x)) if x < 6, else
- * erf(x) = sign(x)*(1.0 - tiny)
- * where
- * R2(z) = degree 6 poly in z, (z=1/x^2)
- * S2(z) = degree 7 poly in z
- *
- * Note1:
- * To compute exp(-x*x-0.5625+R/S), let s be a single
- * precision number and s := x; then
- * -x*x = -s*s + (s-x)*(s+x)
- * exp(-x*x-0.5626+R/S) =
- * exp(-s*s-0.5625)*exp((s-x)*(s+x)+R/S);
- * Note2:
- * Here 4 and 5 make use of the asymptotic series
- * exp(-x*x)
- * erfc(x) ~ ---------- * ( 1 + Poly(1/x^2) )
- * x*sqrt(pi)
- * We use rational approximation to approximate
- * g(s)=f(1/x^2) = log(erfc(x)*x) - x*x + 0.5625
- * Here is the error bound for R1/S1 and R2/S2
- * |R1/S1 - f(x)| < 2**(-62.57)
- * |R2/S2 - f(x)| < 2**(-61.52)
- *
- * 5. For inf > x >= 28
- * erf(x) = sign(x) *(1 - tiny) (raise inexact)
- * erfc(x) = tiny*tiny (raise underflow) if x > 0
- * = 2 - tiny if x<0
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-expm1 Returns exp(x)-1, the exponential of x minus 1
-~~~~~
- * Method
- * 1. Argument reduction:
- * Given x, find r and integer k such that
- *
- * x = k*ln2 + r, |r| <= 0.5*ln2 ~ 0.34658
- *
- * Here a correction term c will be computed to compensate
- * the error in r when rounded to a floating-point number.
- *
- * 2. Approximating expm1(r) by a special rational function on
- * the interval [0,0.34658]:
- * Since
- * r*(exp(r)+1)/(exp(r)-1) = 2+ r^2/6 - r^4/360 + ...
- * we define R1(r*r) by
- * r*(exp(r)+1)/(exp(r)-1) = 2+ r^2/6 * R1(r*r)
- * That is,
- * R1(r**2) = 6/r *((exp(r)+1)/(exp(r)-1) - 2/r)
- * = 6/r * ( 1 + 2.0*(1/(exp(r)-1) - 1/r))
- * = 1 - r^2/60 + r^4/2520 - r^6/100800 + ...
- * We use a special Reme algorithm on [0,0.347] to generate
- * a polynomial of degree 5 in r*r to approximate R1. The
- * maximum error of this polynomial approximation is bounded
- * by 2**-61. In other words,
- * R1(z) ~ 1.0 + Q1*z + Q2*z**2 + Q3*z**3 + Q4*z**4 + Q5*z**5
- * where Q1 = -1.6666666666666567384E-2,
- * Q2 = 3.9682539681370365873E-4,
- * Q3 = -9.9206344733435987357E-6,
- * Q4 = 2.5051361420808517002E-7,
- * Q5 = -6.2843505682382617102E-9;
- * (where z=r*r, and the values of Q1 to Q5 are listed below)
- * with error bounded by
- * | 5 | -61
- * | 1.0+Q1*z+...+Q5*z - R1(z) | <= 2
- * | |
- *
- * expm1(r) = exp(r)-1 is then computed by the following
- * specific way which minimize the accumulation rounding error:
- * 2 3
- * r r [ 3 - (R1 + R1*r/2) ]
- * expm1(r) = r + --- + --- * [--------------------]
- * 2 2 [ 6 - r*(3 - R1*r/2) ]
- *
- * To compensate the error in the argument reduction, we use
- * expm1(r+c) = expm1(r) + c + expm1(r)*c
- * ~ expm1(r) + c + r*c
- * Thus c+r*c will be added in as the correction terms for
- * expm1(r+c). Now rearrange the term to avoid optimization
- * screw up:
- * ( 2 2 )
- * ({ ( r [ R1 - (3 - R1*r/2) ] ) } r )
- * expm1(r+c)~r - ({r*(--- * [--------------------]-c)-c} - --- )
- * ({ ( 2 [ 6 - r*(3 - R1*r/2) ] ) } 2 )
- * ( )
- *
- * = r - E
- * 3. Scale back to obtain expm1(x):
- * From step 1, we have
- * expm1(x) = either 2^k*[expm1(r)+1] - 1
- * = or 2^k*[expm1(r) + (1-2^-k)]
- * 4. Implementation notes:
- * (A). To save one multiplication, we scale the coefficient Qi
- * to Qi*2^i, and replace z by (x^2)/2.
- * (B). To achieve maximum accuracy, we compute expm1(x) by
- * (i) if x < -56*ln2, return -1.0, (raise inexact if x!=inf)
- * (ii) if k=0, return r-E
- * (iii) if k=-1, return 0.5*(r-E)-0.5
- * (iv) if k=1 if r < -0.25, return 2*((r+0.5)- E)
- * else return 1.0+2.0*(r-E);
- * (v) if (k<-2||k>56) return 2^k(1-(E-r)) - 1 (or exp(x)-1)
- * (vi) if k <= 20, return 2^k((1-2^-k)-(E-r)), else
- * (vii) return 2^k(1-((E+2^-k)-r))
- *
- * Special cases:
- * expm1(INF) is INF, expm1(NaN) is NaN;
- * expm1(-INF) is -1, and
- * for finite argument, only expm1(0)=0 is exact.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-log1p
-~~~~~
- * Method :
- * 1. Argument Reduction: find k and f such that
- * 1+x = 2^k * (1+f),
- * where sqrt(2)/2 < 1+f < sqrt(2) .
- *
- * Note. If k=0, then f=x is exact. However, if k!=0, then f
- * may not be representable exactly. In that case, a correction
- * term is need. Let u=1+x rounded. Let c = (1+x)-u, then
- * log(1+x) - log(u) ~ c/u. Thus, we proceed to compute log(u),
- * and add back the correction term c/u.
- * (Note: when x > 2**53, one can simply return log(x))
- *
- * 2. Approximation of log1p(f).
- * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
- * = 2s + 2/3 s**3 + 2/5 s**5 + .....,
- * = 2s + s*R
- * We use a special Reme algorithm on [0,0.1716] to generate
- * a polynomial of degree 14 to approximate R The maximum error
- * of this polynomial approximation is bounded by 2**-58.45. In
- * other words,
- * 2 4 6 8 10 12 14
- * R(z) ~ Lp1*s +Lp2*s +Lp3*s +Lp4*s +Lp5*s +Lp6*s +Lp7*s
- * (the values of Lp1 to Lp7 are listed in the program)
- * and
- * | 2 14 | -58.45
- * | Lp1*s +...+Lp7*s - R(z) | <= 2
- * | |
- * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
- * In order to guarantee error in log below 1ulp, we compute log
- * by
- * log1p(f) = f - (hfsq - s*(hfsq+R)).
- *
- * 3. Finally, log1p(x) = k*ln2 + log1p(f).
- * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
- * Here ln2 is split into two floating point number:
- * ln2_hi + ln2_lo,
- * where n*ln2_hi is always exact for |n| < 2000.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/libc/argp/argp-help.c b/libc/argp/argp-help.c
index da489c63d..6a8f022cd 100644
--- a/libc/argp/argp-help.c
+++ b/libc/argp/argp-help.c
@@ -1,5 +1,5 @@
/* Hierarchial argument parsing help output
- Copyright (C) 1995-2007, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -60,7 +60,7 @@ char *alloca ();
# ifdef _LIBC
# undef dgettext
# define dgettext(domain, msgid) \
- INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
+ __dcgettext (domain, msgid, LC_MESSAGES)
# endif
# else
# define dgettext(domain, msgid) (msgid)
diff --git a/libc/argp/argp-parse.c b/libc/argp/argp-parse.c
index 5a2124ec7..9ac1a1720 100644
--- a/libc/argp/argp-parse.c
+++ b/libc/argp/argp-parse.c
@@ -1,5 +1,5 @@
/* Hierarchial argument parsing, layered over getopt
- Copyright (C) 1995-2000, 2002, 2003, 2004, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -51,7 +51,7 @@ char *alloca ();
# ifdef _LIBC
# undef dgettext
# define dgettext(domain, msgid) \
- INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
+ __dcgettext (domain, msgid, LC_MESSAGES)
# endif
# else
# define dgettext(domain, msgid) (msgid)
diff --git a/libc/assert/assert.c b/libc/assert/assert.c
index 0830ac038..e4e2f21a1 100644
--- a/libc/assert/assert.c
+++ b/libc/assert/assert.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991,1994-1996,1998,2001,2002,2005,2009,2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +30,7 @@ extern const char *__progname;
#include <wchar.h>
#include <libio/iolibio.h>
-#define fflush(s) INTUSE(_IO_fflush) (s)
+#define fflush(s) _IO_fflush (s)
/* This function, when passed a string containing an asserted
expression, a filename, and a line number, prints a message
diff --git a/libc/bits/types.h b/libc/bits/types.h
index ae79a6f47..041ace631 100644
--- a/libc/bits/types.h
+++ b/libc/bits/types.h
@@ -1,5 +1,5 @@
/* bits/types.h -- definitions of __*_t types underlying *_t types.
- Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -148,7 +148,6 @@ __STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */
__STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */
__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */
__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */
-__STD_TYPE __SNSECONDS_T_TYPE __snseconds_t; /* Signed count of nanoseconds. */
__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */
__STD_TYPE __SWBLK_T_TYPE __swblk_t; /* Type of a swap block maybe? */
@@ -177,8 +176,16 @@ __STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t;
__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t;
__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t;
+/* Type of miscellaneous file system fields. */
+__STD_TYPE __FSWORD_T_TYPE __fsword_t;
+
__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */
+/* Signed long type used in system calls. */
+__STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t;
+/* Unsigned long type used in system calls. */
+__STD_TYPE __SYSCALL_ULONG_TYPE __syscall_ulong_t;
+
/* These few don't really vary by system, they always correspond
to one of the other defined types. */
typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
diff --git a/libc/bits/typesizes.h b/libc/bits/typesizes.h
index 179fe5f56..3fd4a2e06 100644
--- a/libc/bits/typesizes.h
+++ b/libc/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. Generic version.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,6 +44,7 @@
#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __FSWORD_T_TYPE __SWORD_TYPE
#define __ID_T_TYPE __U32_TYPE
#define __CLOCK_T_TYPE __SLONGWORD_TYPE
#define __TIME_T_TYPE __SLONGWORD_TYPE
@@ -57,7 +58,8 @@
#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
#define __FSID_T_TYPE struct { int __val[2]; }
#define __SSIZE_T_TYPE __SWORD_TYPE
-#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
diff --git a/libc/config.h.in b/libc/config.h.in
index 377aec369..225575196 100644
--- a/libc/config.h.in
+++ b/libc/config.h.in
@@ -187,6 +187,10 @@
/* Define if obsolete RPC code should be made available for user-level code
to link against. */
#undef LINK_OBSOLETE_RPC
+
+/* Define if Systemtap <sys/sdt.h> probes should be defined. */
+#undef USE_STAP_PROBE
+
/*
*/
diff --git a/libc/config.make.in b/libc/config.make.in
index 8e33fb776..0a0c54ae1 100644
--- a/libc/config.make.in
+++ b/libc/config.make.in
@@ -34,6 +34,7 @@ config-sysdirs = @sysnames@
cflags-cpu = @libc_cv_cc_submachine@
asflags-cpu = @libc_cv_cc_submachine@
+config-extra-cflags = @libc_extra_cflags@
config-cflags-sse4 = @libc_cv_cc_sse4@
config-cflags-avx = @libc_cv_cc_avx@
config-cflags-sse2avx = @libc_cv_cc_sse2avx@
@@ -104,6 +105,7 @@ CXX = @CXX@
BUILD_CC = @BUILD_CC@
CFLAGS = @CFLAGS@
CPPFLAGS-config = @CPPFLAGS@
+CPPUNDEFS = @CPPUNDEFS@
ASFLAGS-config = @ASFLAGS_config@
AR = @AR@
NM = @NM@
diff --git a/libc/configure b/libc/configure
index c7599df99..4b2d4c28c 100755
--- a/libc/configure
+++ b/libc/configure
@@ -567,42 +567,7 @@ PACKAGE_URL='http://www.gnu.org/software/glibc/'
ac_unique_file="include/features.h"
enable_option_checking=no
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
+ac_includes_default='/* none */'
ac_subst_vars='LTLIBOBJS
LIBOBJS
RELEASE
@@ -632,9 +597,9 @@ libc_cv_localedir
libc_cv_slibdir
old_glibc_headers
libc_cv_gcc_unwind_find_fde
+libc_extra_cflags
+CPPUNDEFS
sizeof_long_double
-EGREP
-GREP
have_selinux
have_libcap
have_libaudit
@@ -788,6 +753,7 @@ with_bugurl
enable_multi_arch
enable_nss_crypt
enable_obsolete_rpc
+enable_systemtap
with_cpu
'
ac_precious_vars='build_alias
@@ -1445,6 +1411,7 @@ Optional Features:
--enable-nss-crypt enable libcrypt to use nss
--enable-obsolete-rpc build and install the obsolete RPC code for
link-time usage
+ --enable-systemtap enable systemtap static probe points [default=no]
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1934,37 +1901,6 @@ rm -f conftest.val
as_fn_set_status $ac_retval
} # ac_fn_c_compute_int
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -2350,6 +2286,9 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+# Glibc should not depend on any header files
+
+
subdirs="$subdirs "
@@ -3817,6 +3756,7 @@ else
fi
+
# Check whether --enable-obsolete-rpc was given.
if test "${enable_obsolete_rpc+set}" = set; then :
enableval=$enable_obsolete_rpc; link_obsolete_rpc=$enableval
@@ -3831,6 +3771,51 @@ if test "$link_obsolete_rpc" = yes; then
fi
+# Check whether --enable-systemtap was given.
+if test "${enable_systemtap+set}" = set; then :
+ enableval=$enable_systemtap; systemtap=$enableval
+else
+ systemtap=no
+fi
+
+if test "x$systemtap" != xno; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemtap static probe support" >&5
+$as_echo_n "checking for systemtap static probe support... " >&6; }
+if ${libc_cv_sdt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ old_CFLAGS="$CFLAGS"
+ CFLAGS="-std=gnu99 $CFLAGS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/sdt.h>
+void foo (int i, void *p)
+{
+ asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
+ :: STAP_PROBE_ASM_OPERANDS (2, i, p));
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ libc_cv_sdt=yes
+else
+ libc_cv_sdt=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$old_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sdt" >&5
+$as_echo "$libc_cv_sdt" >&6; }
+ if test $libc_cv_sdt = yes; then
+ $as_echo "#define USE_STAP_PROBE 1" >>confdefs.h
+
+ elif test "x$systemtap" != xauto; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "systemtap support needs sys/sdt.h with asm support
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+fi
+
# The way shlib-versions is used to generate soversions.mk uses a
# fairly simplistic model for name recognition that can't distinguish
# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
@@ -4396,60 +4381,61 @@ while test $# -gt 0; do
test -n "$enable_debug_configure" &&
echo "DEBUG: name/Implies $xsrcdir$name/Implies" >&2
- if test -f $xsrcdir$name/Implies; then
- # Collect more names from the `Implies' file (removing comments).
- implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
- implied=
- for x in $implied_candidate; do
- found=no
- if test -d $xsrcdir$name_base/$x; then
- # If !OPTION_EGLIBC_LIBM_BIG, add ieee754/dbl-wrap just before
- # ieee754/dbl-64.
- if test "$use_dbl_wrap" = "0"; then
- case $x in
- ieee754/dbl-64) implied="$implied $name_base/ieee754/dbl-wrap" ;;
- ieee754/ldbl-*) implied="$implied $name_base/ieee754/ldbl-wrap" ;;
- esac
- fi
- implied="$implied $name_base/$x";
- found=yes
- fi
- for d in $add_ons_pfx ''; do
- try="${d}sysdeps/$x"
- case $d in
- /*) try_srcdir= ;;
- *) try_srcdir=$srcdir/ ;;
- esac
- test -n "$enable_debug_configure" &&
- echo "DEBUG: $name implied $x try($d) {$try_srcdir}$try" >&2
- if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
- then
+ for implies_file in Implies Implies-before Implies-after; do
+ implies_type=`echo $implies_file | sed s/-/_/`
+ eval ${implies_type}=
+ if test -f $xsrcdir$name/$implies_file; then
+ # Collect more names from the `Implies' file (removing comments).
+ implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/$implies_file`"
+ for x in $implied_candidate; do
+ found=no
+ if test -d $xsrcdir$name_base/$x; then
# If !OPTION_EGLIBC_LIBM_BIG, add ieee754/dbl-wrap just before
# ieee754/dbl-64.
if test "$use_dbl_wrap" = "0"; then
- case $try in
- sysdeps/ieee754/dbl-64)
- implied="$implied sysdeps/ieee754/dbl-wrap" ;;
- sysdeps/ieee754/ldbl-*)
- implied="$implied sysdeps/ieee754/ldbl-wrap" ;;
+ case $x in
+ ieee754/dbl-64) eval "${implies_type}=\"\$${implies_type} \$name_base/ieee754/dbl-wrap\"" ;;
+ ieee754/ldbl-*) eval "${implies_type}=\"\$${implies_type} \$name_base/ieee754/ldbl-wrap\"" ;;
esac
fi
- implied="$implied $try"
+ eval "${implies_type}=\"\$${implies_type} \$name_base/\$x\""
found=yes
- case "$sysnames_add_ons" in
- *" $d "*) ;;
- *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
+ fi
+ for d in $add_ons_pfx ''; do
+ try="${d}sysdeps/$x"
+ case $d in
+ /*) try_srcdir= ;;
+ *) try_srcdir=$srcdir/ ;;
esac
+ test -n "$enable_debug_configure" &&
+ echo "DEBUG: $name $implies_file $x try($d) {$try_srcdir}$try" >&2
+ if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
+ then
+ # If !OPTION_EGLIBC_LIBM_BIG, add ieee754/dbl-wrap just before
+ # ieee754/dbl-64.
+ if test "$use_dbl_wrap" = "0"; then
+ case $try in
+ sysdeps/ieee754/dbl-64)
+ eval "${implies_type}=\"\$${implies_type} sysdeps/ieee754/dbl-wrap\"" ;;
+ sysdeps/ieee754/ldbl-*)
+ eval "${implies_type}=\"\$${implies_type} sysdeps/ieee754/ldbl-wrap\"" ;;
+ esac
+ fi
+ eval "${implies_type}=\"\$${implies_type} \$try\""
+ found=yes
+ case "$sysnames_add_ons" in
+ *" $d "*) ;;
+ *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
+ esac
+ fi
+ done
+ if test $found = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $name/$implies_file specifies nonexistent $x" >&5
+$as_echo "$as_me: WARNING: $name/$implies_file specifies nonexistent $x" >&2;}
fi
done
- if test $found = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $name/Implies specifies nonexistent $x" >&5
-$as_echo "$as_me: WARNING: $name/Implies specifies nonexistent $x" >&2;}
- fi
- done
- else
- implied=
- fi
+ fi
+ done
# Add NAME to the list of names.
names="$names $name"
@@ -4457,6 +4443,10 @@ $as_echo "$as_me: WARNING: $name/Implies specifies nonexistent $x" >&2;}
# Find the parent of NAME, using the empty string if it has none.
parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
+ test -n "$enable_debug_configure" &&
+ echo "DEBUG: $name Implies='$Implies' rest='$*' parent='$parent' \
+Implies_before='$Implies_after' Implies_after='$Implies_after'" >&2
+
# Add the names implied by NAME, and NAME's parent (if it has one), to
# the list of names to be processed (the argument list). We prepend the
# implied names to the list and append the parent. We want implied
@@ -4464,7 +4454,7 @@ $as_echo "$as_me: WARNING: $name/Implies specifies nonexistent $x" >&2;}
# configuration components; this ensures that for sysv4, unix/common
# (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
# after sysv4).
- sysnames="`echo $implied $* $parent`"
+ sysnames="`echo $Implies $* $Implies_before $parent $Implies_after`"
test -n "$sysnames" && set $sysnames
done
@@ -5072,7 +5062,7 @@ $as_echo_n "checking version of $MAKEINFO... " >&6; }
ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 4.*)
+ 4.[5-9]*|4.[1-9][0-9]*|[5-9].*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
@@ -5240,6 +5230,98 @@ else
READELF="$ac_cv_prog_READELF"
fi
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nm; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ ac_cv_prog_NM="$NM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NM="${ac_tool_prefix}nm"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NM=$ac_cv_prog_NM
+if test -n "$NM"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5
+$as_echo "$NM" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NM"; then
+ ac_ct_NM=$NM
+ # Extract the first word of "nm", so it can be a program name with args.
+set dummy nm; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NM"; then
+ ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NM="nm"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NM=$ac_cv_prog_ac_ct_NM
+if test -n "$ac_ct_NM"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5
+$as_echo "$ac_ct_NM" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NM" = x; then
+ NM="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NM=$ac_ct_NM
+ fi
+else
+ NM="$ac_cv_prog_NM"
+fi
+
for ac_prog in autoconf
do
@@ -7313,299 +7395,126 @@ fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5
+$as_echo_n "checking size of long double... " >&6; }
+if ${ac_cv_sizeof_long_double+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then :
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
else
- ac_cv_path_GREP=$GREP
+ if test "$ac_cv_type_long_double" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long double)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_double=0
+ fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5
+$as_echo "$ac_cv_sizeof_long_double" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
+_ACEOF
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
+sizeof_long_double=$ac_cv_sizeof_long_double
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
+
+CPPUNDEFS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FORTIFY_SOURCE predefine" >&5
+$as_echo_n "checking for _FORTIFY_SOURCE predefine... " >&6; }
+if ${libc_cv_predef_fortify_source+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
int
main ()
{
+#ifdef _FORTIFY_SOURCE
+# error bogon
+#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
+ libc_cv_predef_fortify_source=no
else
- ac_cv_header_stdc=no
+ libc_cv_predef_fortify_source=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
fi
-rm -f conftest*
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_predef_fortify_source" >&5
+$as_echo "$libc_cv_predef_fortify_source" >&6; }
+if test $libc_cv_predef_fortify_source = yes; then
+ CPPUNDEFS="${CPPUNDEFS:+$CPPUNDEFS }-U_FORTIFY_SOURCE"
fi
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC implicitly enables -fstack-protector" >&5
+$as_echo_n "checking whether $CC implicitly enables -fstack-protector... " >&6; }
+if ${libc_cv_predef_stack_protector+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+extern void foobar (char *);
int
main ()
{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
+char large_array[2048]; foobar (large_array);
+ ;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"; then :
+libc_undefs=`$NM -u conftest.o |
+ LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
+ 2>&5` || {
+ as_fn_error $? "confusing output from $NM -u" "$LINENO" 5
+}
+echo >&5 "libc_undefs='$libc_undefs'"
+# On some architectures, there are architecture-specific undefined
+# symbols (resolved by the linker), so filter out unknown symbols.
+# This will fail to produce the correct result if the compiler
+# defaults to -fstack-protector but this produces an undefined symbol
+# other than __stack_chk_fail. However, compilers like that have not
+# been encountered in practice.
+libc_undefs=`echo "$libc_undefs" | egrep '^(foobar|__stack_chk_fail)$'`
+case "$libc_undefs" in
+foobar) libc_cv_predef_stack_protector=no ;;
+'__stack_chk_fail
+foobar') libc_cv_predef_stack_protector=yes ;;
+*) as_fn_error $? "unexpected symbols in test: $libc_undefs" "$LINENO" 5 ;;
+esac
else
- ac_cv_header_stdc=no
+ as_fn_error $? "test compilation failed" "$LINENO" 5
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5
-$as_echo_n "checking size of long double... " >&6; }
-if ${ac_cv_sizeof_long_double+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then :
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- if test "$ac_cv_type_long_double" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long double)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long_double=0
- fi
fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_predef_stack_protector" >&5
+$as_echo "$libc_cv_predef_stack_protector" >&6; }
+libc_extra_cflags=
+if test $libc_cv_predef_stack_protector = yes; then
+ libc_extra_cflags=-fno-stack-protector
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5
-$as_echo "$ac_cv_sizeof_long_double" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
-_ACEOF
-
-
-sizeof_long_double=$ac_cv_sizeof_long_double
### End of automated tests.
diff --git a/libc/configure.in b/libc/configure.in
index 8ba667140..987010d0c 100644
--- a/libc/configure.in
+++ b/libc/configure.in
@@ -5,6 +5,11 @@ AC_CONFIG_SRCDIR([include/features.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([scripts])
+# Glibc should not depend on any header files
+AC_DEFUN([_AC_INCLUDES_DEFAULT_REQUIREMENTS],
+ [m4_divert_text([DEFAULTS],
+ [ac_includes_default='/* none */'])])
+
dnl This is here so we can set $subdirs directly based on configure fragments.
AC_CONFIG_SUBDIRS()
@@ -257,6 +262,7 @@ else
fi
AC_SUBST(libc_cv_nss_crypt)
+
AC_ARG_ENABLE([obsolete-rpc],
AC_HELP_STRING([--enable-obsolete-rpc],
[build and install the obsolete RPC code for link-time usage]),
@@ -268,6 +274,29 @@ if test "$link_obsolete_rpc" = yes; then
AC_DEFINE(LINK_OBSOLETE_RPC)
fi
+AC_ARG_ENABLE([systemtap],
+ [AS_HELP_STRING([--enable-systemtap],
+ [enable systemtap static probe points @<:@default=no@:>@])],
+ [systemtap=$enableval],
+ [systemtap=no])
+if test "x$systemtap" != xno; then
+ AC_CACHE_CHECK([for systemtap static probe support], libc_cv_sdt, [dnl
+ old_CFLAGS="$CFLAGS"
+ CFLAGS="-std=gnu99 $CFLAGS"
+ AC_COMPILE_IFELSE([#include <sys/sdt.h>
+void foo (int i, void *p)
+{
+ asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
+ :: STAP_PROBE_ASM_OPERANDS (2, i, p));
+}], [libc_cv_sdt=yes], [libc_cv_sdt=no])
+ CFLAGS="$old_CFLAGS"])
+ if test $libc_cv_sdt = yes; then
+ AC_DEFINE([USE_STAP_PROBE])
+ elif test "x$systemtap" != xauto; then
+ AC_MSG_FAILURE([systemtap support needs sys/sdt.h with asm support])
+ fi
+fi
+
# The way shlib-versions is used to generate soversions.mk uses a
# fairly simplistic model for name recognition that can't distinguish
# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
@@ -771,59 +800,60 @@ while test $# -gt 0; do
test -n "$enable_debug_configure" &&
echo "[DEBUG]: name/Implies $xsrcdir$name/Implies" >&2
- if test -f $xsrcdir$name/Implies; then
- # Collect more names from the `Implies' file (removing comments).
- implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/Implies`"
- implied=
- for x in $implied_candidate; do
- found=no
- if test -d $xsrcdir$name_base/$x; then
- # If !OPTION_EGLIBC_LIBM_BIG, add ieee754/dbl-wrap just before
- # ieee754/dbl-64.
- if test "$use_dbl_wrap" = "0"; then
- case $x in
- ieee754/dbl-64) implied="$implied $name_base/ieee754/dbl-wrap" ;;
- ieee754/ldbl-*) implied="$implied $name_base/ieee754/ldbl-wrap" ;;
- esac
- fi
- implied="$implied $name_base/$x";
- found=yes
- fi
- for d in $add_ons_pfx ''; do
- try="${d}sysdeps/$x"
- case $d in
- /*) try_srcdir= ;;
- *) try_srcdir=$srcdir/ ;;
- esac
- test -n "$enable_debug_configure" &&
- echo "[DEBUG]: $name implied $x try($d) {$try_srcdir}$try" >&2
- if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
- then
+ for implies_file in Implies Implies-before Implies-after; do
+ implies_type=`echo $implies_file | sed s/-/_/`
+ eval ${implies_type}=
+ if test -f $xsrcdir$name/$implies_file; then
+ # Collect more names from the `Implies' file (removing comments).
+ implied_candidate="`sed 's/#.*$//' < $xsrcdir$name/$implies_file`"
+ for x in $implied_candidate; do
+ found=no
+ if test -d $xsrcdir$name_base/$x; then
# If !OPTION_EGLIBC_LIBM_BIG, add ieee754/dbl-wrap just before
# ieee754/dbl-64.
if test "$use_dbl_wrap" = "0"; then
- case $try in
- sysdeps/ieee754/dbl-64)
- implied="$implied sysdeps/ieee754/dbl-wrap" ;;
- sysdeps/ieee754/ldbl-*)
- implied="$implied sysdeps/ieee754/ldbl-wrap" ;;
+ case $x in
+ ieee754/dbl-64) eval "${implies_type}=\"\$${implies_type} \$name_base/ieee754/dbl-wrap\"" ;;
+ ieee754/ldbl-*) eval "${implies_type}=\"\$${implies_type} \$name_base/ieee754/ldbl-wrap\"" ;;
esac
fi
- implied="$implied $try"
+ eval "${implies_type}=\"\$${implies_type} \$name_base/\$x\""
found=yes
- case "$sysnames_add_ons" in
- *" $d "*) ;;
- *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
+ fi
+ for d in $add_ons_pfx ''; do
+ try="${d}sysdeps/$x"
+ case $d in
+ /*) try_srcdir= ;;
+ *) try_srcdir=$srcdir/ ;;
esac
+ test -n "$enable_debug_configure" &&
+ echo "[DEBUG]: $name $implies_file $x try($d) {$try_srcdir}$try" >&2
+ if test $try != $xsrcdir$name_base/$x && test -d $try_srcdir$try;
+ then
+ # If !OPTION_EGLIBC_LIBM_BIG, add ieee754/dbl-wrap just before
+ # ieee754/dbl-64.
+ if test "$use_dbl_wrap" = "0"; then
+ case $try in
+ sysdeps/ieee754/dbl-64)
+ eval "${implies_type}=\"\$${implies_type} sysdeps/ieee754/dbl-wrap\"" ;;
+ sysdeps/ieee754/ldbl-*)
+ eval "${implies_type}=\"\$${implies_type} sysdeps/ieee754/ldbl-wrap\"" ;;
+ esac
+ fi
+ eval "${implies_type}=\"\$${implies_type} \$try\""
+ found=yes
+ case "$sysnames_add_ons" in
+ *" $d "*) ;;
+ *|'') sysnames_add_ons="$sysnames_add_ons $d" ;;
+ esac
+ fi
+ done
+ if test $found = no; then
+ AC_MSG_WARN($name/$implies_file specifies nonexistent $x)
fi
done
- if test $found = no; then
- AC_MSG_WARN($name/Implies specifies nonexistent $x)
- fi
- done
- else
- implied=
- fi
+ fi
+ done
# Add NAME to the list of names.
names="$names $name"
@@ -833,6 +863,10 @@ changequote(,)dnl
parent="`echo $name | sed -n -e 's=/[^/]*$==' -e '/sysdeps$/q' -e p`"
changequote([,])dnl
+ test -n "$enable_debug_configure" &&
+ echo "[DEBUG]: $name Implies='$Implies' rest='$*' parent='$parent' \
+Implies_before='$Implies_after' Implies_after='$Implies_after'" >&2
+
# Add the names implied by NAME, and NAME's parent (if it has one), to
# the list of names to be processed (the argument list). We prepend the
# implied names to the list and append the parent. We want implied
@@ -840,7 +874,7 @@ changequote([,])dnl
# configuration components; this ensures that for sysv4, unix/common
# (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
# after sysv4).
- sysnames="`echo $implied $* $parent`"
+ sysnames="`echo $Implies $* $Implies_before $parent $Implies_after`"
test -n "$sysnames" && set $sysnames
done
@@ -942,7 +976,7 @@ AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
MSGFMT=: aux_missing="$aux_missing msgfmt")
AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
[GNU texinfo.* \([0-9][0-9.]*\)],
- [4.*],
+ [4.[5-9]*|4.[1-9][0-9]*|[5-9].*],
MAKEINFO=: aux_missing="$aux_missing makeinfo")
AC_CHECK_PROG_VER(SED, sed, --version,
[GNU sed version \([0-9]*\.[0-9.]*\)],
@@ -950,6 +984,7 @@ AC_CHECK_PROG_VER(SED, sed, --version,
SED=: aux_missing="$aux_missing sed")
AC_CHECK_TOOL(READELF, readelf, false)
+AC_CHECK_TOOL(NM, nm, false)
AC_CHECK_PROGS(AUTOCONF, autoconf, no)
case "x$AUTOCONF" in
@@ -2055,6 +2090,62 @@ AC_CHECK_SIZEOF(long double, 0)
sizeof_long_double=$ac_cv_sizeof_long_double
AC_SUBST(sizeof_long_double)
+CPPUNDEFS=
+dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
+dnl Since we are building the implementations of the fortified functions here,
+dnl having the macro defined interacts very badly.
+AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
+[AC_TRY_COMPILE([], [
+#ifdef _FORTIFY_SOURCE
+# error bogon
+#endif],
+ [libc_cv_predef_fortify_source=no],
+ [libc_cv_predef_fortify_source=yes])])
+if test $libc_cv_predef_fortify_source = yes; then
+ CPPUNDEFS="${CPPUNDEFS:+$CPPUNDEFS }-U_FORTIFY_SOURCE"
+fi
+AC_SUBST(CPPUNDEFS)
+
+dnl Check for silly hacked compilers inserting -fstack-protector.
+dnl This breaks badly for the early startup code we compile, since
+dnl the compiled code can refer to a magic machine-dependent location
+dnl for the canary value before we have sufficient setup for that to
+dnl work. It's also questionable to build all of libc with this flag
+dnl even when you're doing that for most applications you build, since
+dnl libc's code is so heavily-used and performance-sensitive. If we
+dnl ever really want to make that work, it should be enabled explicitly
+dnl in the libc build, not inherited from implicit compiler settings.
+AC_CACHE_CHECK([whether $CC implicitly enables -fstack-protector],
+ libc_cv_predef_stack_protector, [
+AC_TRY_COMPILE([extern void foobar (char *);],
+ [char large_array[2048]; foobar (large_array);], [
+libc_undefs=`$NM -u conftest.o |
+ LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
+ 2>&AS_MESSAGE_LOG_FD` || {
+ AC_MSG_ERROR([confusing output from $NM -u])
+}
+echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
+# On some architectures, there are architecture-specific undefined
+# symbols (resolved by the linker), so filter out unknown symbols.
+# This will fail to produce the correct result if the compiler
+# defaults to -fstack-protector but this produces an undefined symbol
+# other than __stack_chk_fail. However, compilers like that have not
+# been encountered in practice.
+libc_undefs=`echo "$libc_undefs" | egrep '^(foobar|__stack_chk_fail)$'`
+case "$libc_undefs" in
+foobar) libc_cv_predef_stack_protector=no ;;
+'__stack_chk_fail
+foobar') libc_cv_predef_stack_protector=yes ;;
+*) AC_MSG_ERROR([unexpected symbols in test: $libc_undefs]) ;;
+esac],
+ [AC_MSG_ERROR([test compilation failed])])
+])
+libc_extra_cflags=
+if test $libc_cv_predef_stack_protector = yes; then
+ libc_extra_cflags=-fno-stack-protector
+fi
+AC_SUBST(libc_extra_cflags)
+
### End of automated tests.
### Now run sysdeps configure fragments.
diff --git a/libc/conform/data/stdio.h-data b/libc/conform/data/stdio.h-data
index abd3a8e8c..816cf9ea2 100644
--- a/libc/conform/data/stdio.h-data
+++ b/libc/conform/data/stdio.h-data
@@ -1,10 +1,10 @@
-constant BUFSIZ
-constant FILENAME_MAX
-constant FOPEN_MAX >= 8
+macro-int-constant BUFSIZ >= 256
+macro-int-constant FILENAME_MAX
+macro-int-constant FOPEN_MAX >= 8
-constant _IOFBF
-constant _IOLBF
-constant _IONBF
+macro-int-constant _IOFBF
+macro-int-constant _IOLBF
+macro-int-constant _IONBF
#if !defined ISO && !defined ISO99 && !defined ISO11
constant L_ctermid
@@ -12,25 +12,25 @@ constant L_ctermid
constant L_cuserid
# endif
#endif
-constant L_tmpnam
+macro-int-constant L_tmpnam
-constant SEEK_CUR
-constant SEEK_END
-constant SEEK_SET
+macro-int-constant SEEK_CUR
+macro-int-constant SEEK_END
+macro-int-constant SEEK_SET
-constant TMP_MAX >= 10000
+macro-int-constant TMP_MAX >= 10000
-constant EOF
+macro-int-constant EOF < 0
-constant NULL
+macro-constant NULL == 0
#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008
constant P_tmpdir
#endif
-macro stdin
-macro stdout
-macro stderr
+macro stdin {FILE *}
+macro stdout {FILE *}
+macro stderr {FILE *}
type FILE
type fpos_t
diff --git a/libc/conform/data/stdlib.h-data b/libc/conform/data/stdlib.h-data
index f13bf3c29..0b8dc3d12 100644
--- a/libc/conform/data/stdlib.h-data
+++ b/libc/conform/data/stdlib.h-data
@@ -5,14 +5,14 @@ type ldiv_t
element ldiv_t long quot
element ldiv_t long rem
-macro EXIT_FAILURE
-macro EXIT_SUCCESS == 0
+macro-int-constant EXIT_FAILURE
+macro-int-constant EXIT_SUCCESS == 0
-macro NULL
-constant RAND_MAX >= 32767
+macro-constant NULL == 0
+macro-int-constant RAND_MAX >= 32767
macro MB_CUR_MAX
-#if defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008
+#if defined ISO99 || defined ISO11 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008
type lldiv_t
element lldiv_t {long long} quot
element lldiv_t {long long} rem
@@ -151,8 +151,16 @@ function void srand48 (long int)
function void srandom (unsigned)
#endif
function double strtod (const char*, char**)
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
+function float strtof (const char*, char**)
+function {long double} strtold (const char*, char**)
+#endif
function {long int} strtol (const char*, char**, int)
function {unsigned long int} strtoul (const char*, char**, int)
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
+function {long long int} strtoll (const char*, char**, int)
+function {unsigned long long int} strtoull (const char*, char**, int)
+#endif
function int system (const char*)
#if defined XPG3 || defined XPG4 || defined UNIX98
function int ttyslot (void)
@@ -169,10 +177,14 @@ function {void*} valloc (size_t)
function size_t wcstombs (char*, const wchar_t*, size_t)
function int wctomb (char*, wchar_t)
+#if !defined ISO && !defined ISO99 && !defined ISO11
allow-header stddef.h
allow-header limits.h
allow-header math.h
allow-header sys/wait.h
+#endif
-allow str*
+allow str[abcdefghijklmnopqrstuvwxyz]*
+#if !defined ISO && !defined ISO99 && !defined ISO11
allow *_t
+#endif
diff --git a/libc/crypt/sha512c-test.c b/libc/crypt/sha512c-test.c
index f12234448..75afc67e6 100644
--- a/libc/crypt/sha512c-test.c
+++ b/libc/crypt/sha512c-test.c
@@ -58,7 +58,7 @@ do_test (void)
return result;
}
-#define TIMEOUT 6
+#define TIMEOUT 32
#define TEST_FUNCTION do_test ()
#define TIMEOUT 4
#include "../test-skeleton.c"
diff --git a/libc/csu/.gitignore b/libc/csu/.gitignore
deleted file mode 100644
index d8933cf69..000000000
--- a/libc/csu/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-specs
diff --git a/libc/debug/fgets_chk.c b/libc/debug/fgets_chk.c
index 720ba5d06..046ac1d12 100644
--- a/libc/debug/fgets_chk.c
+++ b/libc/debug/fgets_chk.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2005
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -47,7 +46,7 @@ __fgets_chk (buf, size, n, fp)
case. We return an error only when there is a new error. */
int old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
fp->_IO_file_flags &= ~_IO_ERR_SEEN;
- count = INTUSE(_IO_getline) (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
+ count = _IO_getline (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
/* If we read in some bytes and errno is EAGAIN, that error will
be reported for next read. */
if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
diff --git a/libc/debug/fgets_u_chk.c b/libc/debug/fgets_u_chk.c
index 7784d24fe..5de92e050 100644
--- a/libc/debug/fgets_u_chk.c
+++ b/libc/debug/fgets_u_chk.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2005
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -46,7 +45,7 @@ __fgets_unlocked_chk (buf, size, n, fp)
case. We return an error only when there is a new error. */
int old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
fp->_IO_file_flags &= ~_IO_ERR_SEEN;
- count = INTUSE(_IO_getline) (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
+ count = _IO_getline (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
/* If we read in some bytes and errno is EAGAIN, that error will
be reported for next read. */
if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
diff --git a/libc/debug/fread_chk.c b/libc/debug/fread_chk.c
index 7d5eded57..bb8bada0f 100644
--- a/libc/debug/fread_chk.c
+++ b/libc/debug/fread_chk.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2002, 2003, 2007
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -49,7 +48,7 @@ __fread_chk (void *__restrict ptr, size_t ptrlen,
size_t bytes_read;
_IO_acquire_lock (stream);
- bytes_read = INTUSE(_IO_sgetn) (stream, (char *) ptr, bytes_requested);
+ bytes_read = _IO_sgetn (stream, (char *) ptr, bytes_requested);
_IO_release_lock (stream);
return bytes_requested == bytes_read ? n : bytes_read / size;
}
diff --git a/libc/debug/fread_u_chk.c b/libc/debug/fread_u_chk.c
index 50c2291f4..fa4c9a9ce 100644
--- a/libc/debug/fread_u_chk.c
+++ b/libc/debug/fread_u_chk.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2002, 2003, 2007
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -47,7 +46,6 @@ __fread_unlocked_chk (void *__restrict ptr, size_t ptrlen,
if (bytes_requested == 0)
return 0;
- size_t bytes_read
- = INTUSE(_IO_sgetn) (stream, (char *) ptr, bytes_requested);
+ size_t bytes_read = _IO_sgetn (stream, (char *) ptr, bytes_requested);
return bytes_requested == bytes_read ? n : bytes_read / size;
}
diff --git a/libc/debug/gets_chk.c b/libc/debug/gets_chk.c
index 01b772731..3a462edb8 100644
--- a/libc/debug/gets_chk.c
+++ b/libc/debug/gets_chk.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1996, 1997, 1998, 2002, 2003, 2004
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -55,7 +54,7 @@ __gets_chk (char *buf, size_t size)
int old_error = _IO_stdin->_IO_file_flags & _IO_ERR_SEEN;
_IO_stdin->_IO_file_flags &= ~_IO_ERR_SEEN;
buf[0] = (char) ch;
- count = INTUSE(_IO_getline) (_IO_stdin, buf + 1, size - 1, '\n', 0) + 1;
+ count = _IO_getline (_IO_stdin, buf + 1, size - 1, '\n', 0) + 1;
if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
{
retval = NULL;
diff --git a/libc/debug/obprintf_chk.c b/libc/debug/obprintf_chk.c
index 0163a7572..bca23f765 100644
--- a/libc/debug/obprintf_chk.c
+++ b/libc/debug/obprintf_chk.c
@@ -1,6 +1,5 @@
/* Print output of stream to given obstack.
- Copyright (C) 1996,1997,1999,2000,2001,2002,2003,2004,2005,2006,2008
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -92,7 +91,7 @@ __obstack_vprintf_chk (struct obstack *obstack, int flags, const char *format,
if (flags > 0)
new_f.ofile.file.file._flags2 |= _IO_FLAGS2_FORTIFY;
- result = INTUSE(_IO_vfprintf) (&new_f.ofile.file.file, format, args);
+ result = _IO_vfprintf (&new_f.ofile.file.file, format, args);
/* Shrink the buffer to the space we really currently need. */
obstack_blank_fast (obstack, (new_f.ofile.file.file._IO_write_ptr
diff --git a/libc/debug/vasprintf_chk.c b/libc/debug/vasprintf_chk.c
index 087945f26..a8ca32bad 100644
--- a/libc/debug/vasprintf_chk.c
+++ b/libc/debug/vasprintf_chk.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,1997,1999-2002,2004,2006,2008,2009
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -64,7 +63,7 @@ __vasprintf_chk (char **result_ptr, int flags, const char *format,
if (flags > 0)
sf._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
- ret = INTUSE(_IO_vfprintf) (&sf._sbf._f, format, args);
+ ret = _IO_vfprintf (&sf._sbf._f, format, args);
if (ret < 0)
{
free (sf._sbf._f._IO_buf_base);
diff --git a/libc/debug/vdprintf_chk.c b/libc/debug/vdprintf_chk.c
index 4de3f75bf..16c1f7eac 100644
--- a/libc/debug/vdprintf_chk.c
+++ b/libc/debug/vdprintf_chk.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006, 2008, 2010
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,13 +39,13 @@ __vdprintf_chk (int d, int flags, const char *format, va_list arg)
#endif
_IO_no_init (&tmpfil.file, _IO_USER_LOCK, 0, &wd, &_IO_wfile_jumps);
_IO_JUMPS (&tmpfil) = &_IO_file_jumps;
- INTUSE(_IO_file_init) (&tmpfil);
+ _IO_file_init (&tmpfil);
#if !_IO_UNIFIED_JUMPTABLES
tmpfil.vtable = NULL;
#endif
- if (INTUSE(_IO_file_attach) (&tmpfil.file, d) == NULL)
+ if (_IO_file_attach (&tmpfil.file, d) == NULL)
{
- INTUSE(_IO_un_link) (&tmpfil);
+ _IO_un_link (&tmpfil);
return EOF;
}
tmpfil.file._flags |= _IO_DELETE_DONT_CLOSE;
@@ -59,7 +58,7 @@ __vdprintf_chk (int d, int flags, const char *format, va_list arg)
if (flags > 0)
tmpfil.file._flags2 |= _IO_FLAGS2_FORTIFY;
- done = INTUSE(_IO_vfprintf) (&tmpfil.file, format, arg);
+ done = _IO_vfprintf (&tmpfil.file, format, arg);
_IO_FINISH (&tmpfil.file);
diff --git a/libc/debug/vsnprintf_chk.c b/libc/debug/vsnprintf_chk.c
index 258a05025..525503912 100644
--- a/libc/debug/vsnprintf_chk.c
+++ b/libc/debug/vsnprintf_chk.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991, 1995, 1997, 1998, 2004, 2006, 2009
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -61,7 +60,7 @@ ___vsnprintf_chk (char *s, size_t maxlen, int flags, size_t slen,
sf.f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
_IO_str_init_static_internal (&sf.f, s, maxlen - 1, s);
- ret = INTUSE(_IO_vfprintf) (&sf.f._sbf._f, format, args);
+ ret = _IO_vfprintf (&sf.f._sbf._f, format, args);
if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
*sf.f._sbf._f._IO_write_ptr = '\0';
diff --git a/libc/debug/vsprintf_chk.c b/libc/debug/vsprintf_chk.c
index b5379caf5..2258ee355 100644
--- a/libc/debug/vsprintf_chk.c
+++ b/libc/debug/vsprintf_chk.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1994, 1997, 1999-2003, 2004, 2006, 2009
- Free Software Foundation, Inc.
+/* Copyright (C) 1994-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,16 +39,16 @@ static const struct _IO_jump_t _IO_str_chk_jumps =
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_str_finish),
JUMP_INIT(overflow, _IO_str_chk_overflow),
- JUMP_INIT(underflow, INTUSE(_IO_str_underflow)),
- JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT(pbackfail, INTUSE(_IO_str_pbackfail)),
- JUMP_INIT(xsputn, INTUSE(_IO_default_xsputn)),
- JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)),
- JUMP_INIT(seekoff, INTUSE(_IO_str_seekoff)),
+ JUMP_INIT(underflow, _IO_str_underflow),
+ JUMP_INIT(uflow, _IO_default_uflow),
+ JUMP_INIT(pbackfail, _IO_str_pbackfail),
+ JUMP_INIT(xsputn, _IO_default_xsputn),
+ JUMP_INIT(xsgetn, _IO_default_xsgetn),
+ JUMP_INIT(seekoff, _IO_str_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_default_setbuf),
JUMP_INIT(sync, _IO_default_sync),
- JUMP_INIT(doallocate, INTUSE(_IO_default_doallocate)),
+ JUMP_INIT(doallocate, _IO_default_doallocate),
JUMP_INIT(read, _IO_default_read),
JUMP_INIT(write, _IO_default_write),
JUMP_INIT(seek, _IO_default_seek),
@@ -83,7 +82,7 @@ ___vsprintf_chk (char *s, int flags, size_t slen, const char *format,
if (flags > 0)
f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
- ret = INTUSE(_IO_vfprintf) (&f._sbf._f, format, args);
+ ret = _IO_vfprintf (&f._sbf._f, format, args);
*f._sbf._f._IO_write_ptr = '\0';
return ret;
diff --git a/libc/elf/Makefile b/libc/elf/Makefile
index 2db29b0e9..fd78f523d 100644
--- a/libc/elf/Makefile
+++ b/libc/elf/Makefile
@@ -428,7 +428,8 @@ CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
CFLAGS-cache.c = $(SYSCONF-FLAGS)
CFLAGS-rtld.c = $(SYSCONF-FLAGS)
-CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
+CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
+ -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
generated += $(addsuffix .so,$(strip $(modules-names)))
diff --git a/libc/elf/dl-support.c b/libc/elf/dl-support.c
index 7f88a2cf7..dff9aa074 100644
--- a/libc/elf/dl-support.c
+++ b/libc/elf/dl-support.c
@@ -128,6 +128,7 @@ int _dl_debug_fd = STDERR_FILENO;
int _dl_correct_cache_id = _DL_CACHE_DEFAULT_ID;
+ElfW(auxv_t) *_dl_auxv;
ElfW(Phdr) *_dl_phdr;
size_t _dl_phnum;
uint64_t _dl_hwcap __attribute__ ((nocommon));
@@ -190,6 +191,7 @@ _dl_aux_init (ElfW(auxv_t) *av)
uid_t uid = 0;
gid_t gid = 0;
+ _dl_auxv = av;
for (; av->a_type != AT_NULL; ++av)
switch (av->a_type)
{
diff --git a/libc/elf/dl-sysdep.c b/libc/elf/dl-sysdep.c
index ea505a646..e2a9d935a 100644
--- a/libc/elf/dl-sysdep.c
+++ b/libc/elf/dl-sysdep.c
@@ -61,7 +61,6 @@ int __libc_multiple_libcs = 0; /* Defining this here avoids the inclusion
/* This variable contains the lowest stack address ever used. */
void *__libc_stack_end attribute_relro = NULL;
rtld_hidden_data_def(__libc_stack_end)
-static ElfW(auxv_t) *_dl_auxv attribute_relro;
void *_dl_random attribute_relro = NULL;
#ifndef DL_FIND_ARG_COMPONENTS
@@ -111,12 +110,12 @@ _dl_sysdep_start (void **start_argptr,
__libc_stack_end = DL_STACK_END (start_argptr);
DL_FIND_ARG_COMPONENTS (start_argptr, _dl_argc, INTUSE(_dl_argv), _environ,
- _dl_auxv);
+ GLRO(dl_auxv));
user_entry = (ElfW(Addr)) ENTRY_POINT;
GLRO(dl_platform) = NULL; /* Default to nothing known about the platform. */
- for (av = _dl_auxv; av->a_type != AT_NULL; set_seen (av++))
+ for (av = GLRO(dl_auxv); av->a_type != AT_NULL; set_seen (av++))
switch (av->a_type)
{
case AT_PHDR:
@@ -240,7 +239,7 @@ _dl_sysdep_start (void **start_argptr,
if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
__libc_check_standard_fds ();
- (*dl_main) (phdr, phnum, &user_entry, _dl_auxv);
+ (*dl_main) (phdr, phnum, &user_entry, GLRO(dl_auxv));
return user_entry;
}
@@ -265,7 +264,7 @@ _dl_show_auxv (void)
close by (otherwise the array will be too large). In case we have
to support a platform where these requirements are not fulfilled
some alternative implementation has to be used. */
- for (av = _dl_auxv; av->a_type != AT_NULL; ++av)
+ for (av = GLRO(dl_auxv); av->a_type != AT_NULL; ++av)
{
static const struct
{
diff --git a/libc/elf/rtld-Rules b/libc/elf/rtld-Rules
index 6526aec19..1e03332ca 100644
--- a/libc/elf/rtld-Rules
+++ b/libc/elf/rtld-Rules
@@ -1,7 +1,6 @@
# Subroutine makefile for compiling libc modules linked into dynamic linker.
-# Copyright (C) 2002,2003,2005,2006,2008,2010,2011
-# Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -130,6 +129,6 @@ ifdef rtld-depfiles
endif
# This here is the whole point of all the shenanigans.
-rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1
+rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
endif
diff --git a/libc/elf/rtld.c b/libc/elf/rtld.c
index 352c18df0..bfa487d24 100644
--- a/libc/elf/rtld.c
+++ b/libc/elf/rtld.c
@@ -1433,7 +1433,7 @@ of this helper program; chances are you did not intend to run this program.\n\
#endif
#ifdef DL_SYSDEP_OSCHECK
- DL_SYSDEP_OSCHECK (dl_fatal);
+ DL_SYSDEP_OSCHECK (_dl_fatal_printf);
#endif
/* Initialize the data structures for the search paths for shared
diff --git a/libc/elf/stackguard-macros.h b/libc/elf/stackguard-macros.h
deleted file mode 100644
index 0cad31550..000000000
--- a/libc/elf/stackguard-macros.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <stdint.h>
-
-#ifdef __i386__
-# define STACK_CHK_GUARD \
- ({ uintptr_t x; asm ("movl %%gs:0x14, %0" : "=r" (x)); x; })
-#elif defined __x86_64__
-# define STACK_CHK_GUARD \
- ({ uintptr_t x; \
- asm ("mov %%fs:%c1, %0" : "=r" (x) \
- : "i" (offsetof (tcbhead_t, stack_guard))); x; })
-#elif defined __powerpc64__
-# define STACK_CHK_GUARD \
- ({ uintptr_t x; asm ("ld %0,-28688(13)" : "=r" (x)); x; })
-#elif defined __powerpc__
-# define STACK_CHK_GUARD \
- ({ uintptr_t x; asm ("lwz %0,-28680(2)" : "=r" (x)); x; })
-#elif defined __sparc__ && defined __arch64__
-# define STACK_CHK_GUARD \
- ({ uintptr_t x; asm ("ldx [%%g7+0x28], %0" : "=r" (x)); x; })
-#elif defined __sparc__
-# define STACK_CHK_GUARD \
- ({ uintptr_t x; asm ("ld [%%g7+0x14], %0" : "=r" (x)); x; })
-#elif defined __s390x__
-# define STACK_CHK_GUARD \
- ({ uintptr_t x; asm ("ear %0,%%a0; sllg %0,%0,32; ear %0,%%a1; lg %0,0x28(%0)" : "=a" (x)); x; })
-#elif defined __s390__
-# define STACK_CHK_GUARD \
- ({ uintptr_t x; asm ("ear %0,%%a0; l %0,0x14(%0)" : "=a" (x)); x; })
-#elif !defined STACK_CHK_GUARD
-extern uintptr_t __stack_chk_guard;
-# define STACK_CHK_GUARD __stack_chk_guard
-#endif
diff --git a/libc/elf/tst-execstack.c b/libc/elf/tst-execstack.c
index 6632e5336..02cc270d8 100644
--- a/libc/elf/tst-execstack.c
+++ b/libc/elf/tst-execstack.c
@@ -7,6 +7,7 @@
#include <string.h>
#include <unistd.h>
#include <error.h>
+#include <stackinfo.h>
static void
print_maps (void)
@@ -46,7 +47,6 @@ waiter_thread (void *arg)
}
#endif
-
static bool allow_execstack = true;
@@ -107,6 +107,35 @@ do_test (void)
print_maps ();
+#if USE_PTHREADS
+ void *old_stack_addr, *new_stack_addr;
+ size_t stack_size;
+ pthread_t me = pthread_self ();
+ pthread_attr_t attr;
+ int ret = 0;
+
+ ret = pthread_getattr_np (me, &attr);
+ if (ret)
+ {
+ printf ("before execstack: pthread_getattr_np returned error: %s\n",
+ strerror (ret));
+ return 1;
+ }
+
+ ret = pthread_attr_getstack (&attr, &old_stack_addr, &stack_size);
+ if (ret)
+ {
+ printf ("before execstack: pthread_attr_getstack returned error: %s\n",
+ strerror (ret));
+ return 1;
+ }
+# if _STACK_GROWS_DOWN
+ old_stack_addr += stack_size;
+# else
+ old_stack_addr -= stack_size;
+# endif
+#endif
+
/* Loading this module should force stacks to become executable. */
void *h = dlopen ("tst-execstack-mod.so", RTLD_LAZY);
if (h == NULL)
@@ -129,6 +158,46 @@ do_test (void)
print_maps ();
+#if USE_PTHREADS
+ ret = pthread_getattr_np (me, &attr);
+ if (ret)
+ {
+ printf ("after execstack: pthread_getattr_np returned error: %s\n",
+ strerror (ret));
+ return 1;
+ }
+
+ ret = pthread_attr_getstack (&attr, &new_stack_addr, &stack_size);
+ if (ret)
+ {
+ printf ("after execstack: pthread_attr_getstack returned error: %s\n",
+ strerror (ret));
+ return 1;
+ }
+
+# if _STACK_GROWS_DOWN
+ new_stack_addr += stack_size;
+# else
+ new_stack_addr -= stack_size;
+# endif
+
+ /* It is possible that the dlopen'd module may have been mmapped just below
+ the stack. The stack size is taken as MIN(stack rlimit size, end of last
+ vma) in pthread_getattr_np. If rlimit is set high enough, it is possible
+ that the size may have changed. A subsequent call to
+ pthread_attr_getstack returns the size and (bottom - size) as the
+ stacksize and stackaddr respectively. If the size changes due to the
+ above, then both stacksize and stackaddr can change, but the stack bottom
+ should remain the same, which is computed as stackaddr + stacksize. */
+ if (old_stack_addr != new_stack_addr)
+ {
+ printf ("Stack end changed, old: %p, new: %p\n",
+ old_stack_addr, new_stack_addr);
+ return 1;
+ }
+ printf ("Stack address remains the same: %p\n", old_stack_addr);
+#endif
+
/* Test that growing the stack region gets new executable pages too. */
deeper ((void (*) (void)) f);
diff --git a/libc/elf/tst-relsort1.c b/libc/elf/tst-relsort1.c
index 972100c0e..a87b13828 100644
--- a/libc/elf/tst-relsort1.c
+++ b/libc/elf/tst-relsort1.c
@@ -3,7 +3,7 @@
static int
-do_test ()
+do_test (void)
{
const char lib[] = "$ORIGIN/tst-relsort1mod1.so";
void *h = dlopen (lib, RTLD_NOW);
diff --git a/libc/extra-lib.mk b/libc/extra-lib.mk
index 5e1a617f3..d87626e11 100644
--- a/libc/extra-lib.mk
+++ b/libc/extra-lib.mk
@@ -103,4 +103,4 @@ ifneq (,$(cpp-srcs-left))
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
endif
-CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1
+CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1 -DIN_LIB=$(lib)
diff --git a/libc/iconvdata/tcvn5712-1.c b/libc/iconvdata/tcvn5712-1.c
index 90c8610f9..f6a0c4faa 100644
--- a/libc/iconvdata/tcvn5712-1.c
+++ b/libc/iconvdata/tcvn5712-1.c
@@ -378,9 +378,8 @@ static const struct
/* Determine whether there is a buffered character pending. */ \
last_ch = *statep >> 3; \
\
- /* We have to buffer ch if it is a possible match in comp_table_data \
- and if it isn't the last char of the string. */ \
- must_buffer_ch = (ch >= 0x0041 && ch <= 0x01b0) && (inptr + 1 != inend); \
+ /* We have to buffer ch if it is a possible match in comp_table_data. */ \
+ must_buffer_ch = (ch >= 0x0041 && ch <= 0x01b0); \
\
if (last_ch) \
{ \
diff --git a/libc/include/argz.h b/libc/include/argz.h
index 4f45b0bf1..4eab0b680 100644
--- a/libc/include/argz.h
+++ b/libc/include/argz.h
@@ -3,10 +3,7 @@
#include <string/argz.h>
libc_hidden_proto (argz_delete)
-
-extern size_t __argz_count_internal (const char *__argz, size_t __len)
- __attribute_pure__ attribute_hidden;
-extern void __argz_stringify_internal (char *__argz, size_t __len, int __sep)
- attribute_hidden;
+libc_hidden_proto (__argz_count)
+libc_hidden_proto (__argz_stringify)
#endif
diff --git a/libc/include/libintl.h b/libc/include/libintl.h
index d15a6c0a0..0551a0408 100644
--- a/libc/include/libintl.h
+++ b/libc/include/libintl.h
@@ -12,10 +12,6 @@ extern char *__dcgettext (const char *__domainname,
const char *__msgid, int __category)
__attribute_format_arg__ (2);
libc_hidden_proto (__dcgettext)
-extern char *__dcgettext_internal (const char *__domainname,
- const char *__msgid, int __category)
- __attribute_format_arg__ (2)
- attribute_hidden;
extern char *__ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n)
@@ -28,12 +24,6 @@ extern char *__dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category)
__attribute_format_arg__ (2) __attribute_format_arg__ (3);
-extern char *__dcngettext_internal (const char *__domainname,
- const char *__msgid1,
- const char *__msgid2,
- unsigned long int __n, int __category)
- __attribute_format_arg__ (2) __attribute_format_arg__ (3)
- attribute_hidden;
extern char *__textdomain (const char *__domainname);
extern char *__bindtextdomain (const char *__domainname,
diff --git a/libc/include/libio.h b/libc/include/libio.h
index aca7000f8..735941d23 100644
--- a/libc/include/libio.h
+++ b/libc/include/libio.h
@@ -10,6 +10,13 @@ libc_hidden_proto (__uflow)
libc_hidden_proto (__woverflow)
libc_hidden_proto (__wunderflow)
libc_hidden_proto (__wuflow)
+libc_hidden_proto (_IO_free_backup_area)
+libc_hidden_proto (_IO_free_wbackup_area)
+libc_hidden_proto (_IO_padn)
+libc_hidden_proto (_IO_putc)
+libc_hidden_proto (_IO_sgetn)
+libc_hidden_proto (_IO_vfprintf)
+libc_hidden_proto (_IO_vfscanf)
#if defined _IO_MTSAFE_IO && _IO_lock_inexpensive
# undef _IO_flockfile
diff --git a/libc/include/shlib-compat.h b/libc/include/shlib-compat.h
index 7a84f299f..28fdd9987 100644
--- a/libc/include/shlib-compat.h
+++ b/libc/include/shlib-compat.h
@@ -109,4 +109,14 @@
#endif
+# ifdef LINK_OBSOLETE_RPC
+/* Export the symbol for both static and dynamic linking. */
+# define libc_sunrpc_symbol(name, aliasname, version) \
+ strong_alias (name, aliasname)
+# else
+/* Export the symbol only for shared-library compatibility. */
+# define libc_sunrpc_symbol(name, aliasname, version) \
+ compat_symbol (libc, name, aliasname, version);
+# endif
+
#endif /* shlib-compat.h */
diff --git a/libc/include/stap-probe.h b/libc/include/stap-probe.h
new file mode 100644
index 000000000..1051ad198
--- /dev/null
+++ b/libc/include/stap-probe.h
@@ -0,0 +1,80 @@
+/* Macros for defining Systemtap <sys/sdt.h> static probe points.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _STAP_PROBE_H
+#define _STAP_PROBE_H 1
+
+#ifdef USE_STAP_PROBE
+
+# include <sys/sdt.h>
+
+/* Our code uses one macro LIBC_PROBE (name, n, arg1, ..., argn).
+
+ Without USE_STAP_PROBE, that does nothing but evaluates all
+ its arguments (to prevent bit rot, unlike e.g. assert).
+
+ Systemtap's header defines the macros STAP_PROBE (provider, name) and
+ STAP_PROBEn (provider, name, arg1, ..., argn). For "provider" we paste
+ in the IN_LIB name (libc, libpthread, etc.) automagically. */
+
+# ifndef NOT_IN_libc
+# define IN_LIB libc
+# elif !defined IN_LIB
+/* This is intentionally defined with extra unquoted commas in it so
+ that macro substitution will bomb out when it is used. We don't
+ just use #error here, so that this header can be included by
+ other headers that use LIBC_PROBE inside their own macros. We
+ only want such headers to fail to compile if those macros are
+ actually used in a context where IN_LIB has not been defined. */
+# define IN_LIB ,,,missing -DIN_LIB=... -- not extra-lib.mk?,,,
+# endif
+
+# define LIBC_PROBE(name, n, ...) \
+ LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
+
+# define LIBC_PROBE_1(lib, name, n, ...) \
+ STAP_PROBE##n (lib, name, ## __VA_ARGS__)
+
+# define STAP_PROBE0 STAP_PROBE
+
+# define LIBC_PROBE_ASM(name, template) \
+ STAP_PROBE_ASM (IN_LIB, name, template)
+
+# define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
+
+#else /* Not USE_STAP_PROBE. */
+
+# ifndef __ASSEMBLER__
+/* Evaluate all the arguments and verify that N matches their number. */
+# define LIBC_PROBE(name, n, ...) \
+ do { \
+ _Bool __libc_probe_args[] = { 0, ## __VA_ARGS__ }; \
+ _Bool __libc_probe_verify_n[(sizeof __libc_probe_args / sizeof (_Bool)) \
+ == n + 1 ? 1 : -1]; \
+ (void) __libc_probe_verify_n; \
+ } while (0)
+# else
+# define LIBC_PROBE(name, n, ...) /* Nothing. */
+# endif
+
+# define LIBC_PROBE_ASM(name, template) /* Nothing. */
+# define LIBC_PROBE_ASM_OPERANDS(n, ...) /* Nothing. */
+
+#endif /* USE_STAP_PROBE. */
+
+#endif /* stap-probe.h */
diff --git a/libc/include/stdc-predef.h b/libc/include/stdc-predef.h
index 823bf5810..b713d2ca1 100644
--- a/libc/include/stdc-predef.h
+++ b/libc/include/stdc-predef.h
@@ -29,8 +29,9 @@
/* Define __STDC_IEC_559__ and other similar macros. */
#include <bits/predefs.h>
-/* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.1. */
-#define __STDC_ISO_10646__ 200009L
+/* wchar_t uses ISO/IEC 10646 (2nd ed., published 2011-03-15) /
+ Unicode 6.0. */
+#define __STDC_ISO_10646__ 201103L
/* We do not support C11 <threads.h>. */
#define __STDC_NO_THREADS__ 1
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index a2c73a452..9f2ea31bc 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -116,13 +116,8 @@ extern int __fxprintf (FILE *__fp, const char *__fmt, ...)
extern const char *const _sys_errlist_internal[] attribute_hidden;
extern int _sys_nerr_internal attribute_hidden;
-extern int __asprintf_internal (char **__restrict __ptr,
- const char *__restrict __fmt, ...)
- attribute_hidden __attribute__ ((__format__ (__printf__, 2, 3)));
+libc_hidden_proto (__asprintf)
# if !defined NOT_IN_libc
-# define __asprintf(ptr, fmt, args...) \
- INTUSE(__asprintf) (ptr, fmt, ##args)
-
extern _IO_FILE *_IO_new_fopen (const char*, const char*);
# define fopen(fname, mode) _IO_new_fopen (fname, mode)
extern _IO_FILE *_IO_new_fdopen (int, const char*);
diff --git a/libc/include/stdio_ext.h b/libc/include/stdio_ext.h
index c7b77246b..354146f8e 100644
--- a/libc/include/stdio_ext.h
+++ b/libc/include/stdio_ext.h
@@ -2,7 +2,7 @@
# include <stdio-common/stdio_ext.h>
-extern int __fsetlocking_internal (FILE *__fp, int __type) attribute_hidden;
+libc_hidden_proto (__fsetlocking)
#define __fsetlocking(fp, type) \
({ int __result = ((fp->_flags & _IO_USER_LOCK) \
diff --git a/libc/include/sys/time.h b/libc/include/sys/time.h
index d5de942ed..599e189bc 100644
--- a/libc/include/sys/time.h
+++ b/libc/include/sys/time.h
@@ -5,9 +5,8 @@
/* Now document the internal interfaces. */
extern int __gettimeofday (struct timeval *__tv,
struct timezone *__tz);
-extern int __gettimeofday_internal (struct timeval *__tv,
- struct timezone *__tz)
- attribute_hidden;
+libc_hidden_proto (__gettimeofday)
+libc_hidden_proto (gettimeofday)
extern int __settimeofday (const struct timeval *__tv,
const struct timezone *__tz)
attribute_hidden;
@@ -23,9 +22,5 @@ extern int __utimes (const char *__file, const struct timeval __tvp[2])
attribute_hidden;
extern int __futimes (int fd, const struct timeval tvp[2]) attribute_hidden;
-#ifndef NOT_IN_libc
-# define __gettimeofday(tv, tz) INTUSE(__gettimeofday) (tv, tz)
-#endif
-
#endif
#endif
diff --git a/libc/intl/dcgettext.c b/libc/intl/dcgettext.c
index 3074340d1..0f2942be4 100644
--- a/libc/intl/dcgettext.c
+++ b/libc/intl/dcgettext.c
@@ -1,5 +1,5 @@
/* Implementation of the dcgettext(3) function.
- Copyright (C) 1995-2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -54,7 +54,6 @@ DCGETTEXT (domainname, msgid, category)
#ifdef _LIBC
/* Alias for function name in GNU C Library. */
-INTDEF(__dcgettext)
weak_alias (__dcgettext, dcgettext);
libc_hidden_def (__dcgettext)
#endif
diff --git a/libc/intl/dgettext.c b/libc/intl/dgettext.c
index d805f982c..7718f4e4e 100644
--- a/libc/intl/dgettext.c
+++ b/libc/intl/dgettext.c
@@ -1,5 +1,5 @@
/* Implementation of the dgettext(3) function.
- Copyright (C) 1995-1997, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,7 +37,7 @@
prefix. So we have to make a difference here. */
#ifdef _LIBC
# define DGETTEXT __dgettext
-# define DCGETTEXT INTUSE(__dcgettext)
+# define DCGETTEXT __dcgettext
#else
# define DGETTEXT libintl_dgettext
# define DCGETTEXT libintl_dcgettext
diff --git a/libc/intl/gettext.c b/libc/intl/gettext.c
index b24b62339..fbc598407 100644
--- a/libc/intl/gettext.c
+++ b/libc/intl/gettext.c
@@ -1,5 +1,5 @@
/* Implementation of gettext(3) function.
- Copyright (C) 1995, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -42,7 +42,7 @@
prefix. So we have to make a difference here. */
#ifdef _LIBC
# define GETTEXT __gettext
-# define DCGETTEXT INTUSE(__dcgettext)
+# define DCGETTEXT __dcgettext
#else
# define GETTEXT libintl_gettext
# define DCGETTEXT libintl_dcgettext
diff --git a/libc/intl/l10nflist.c b/libc/intl/l10nflist.c
index b67f8d423..32d8a01b5 100644
--- a/libc/intl/l10nflist.c
+++ b/libc/intl/l10nflist.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2002, 2004, 2005, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
@@ -85,10 +85,6 @@ argz_count__ (argz, len)
}
# undef __argz_count
# define __argz_count(argz, len) argz_count__ (argz, len)
-#else
-# ifdef _LIBC
-# define __argz_count(argz, len) INTUSE(__argz_count) (argz, len)
-# endif
#endif /* !_LIBC && !HAVE___ARGZ_COUNT */
#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
@@ -113,11 +109,6 @@ argz_stringify__ (argz, len, sep)
}
# undef __argz_stringify
# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
-#else
-# ifdef _LIBC
-# define __argz_stringify(argz, len, sep) \
- INTUSE(__argz_stringify) (argz, len, sep)
-# endif
#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
#if !defined _LIBC && !defined HAVE___ARGZ_NEXT
diff --git a/libc/libio/__fpurge.c b/libc/libio/__fpurge.c
index 908eb0bbf..89344b772 100644
--- a/libc/libio/__fpurge.c
+++ b/libc/libio/__fpurge.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,7 @@ __fpurge (FILE *fp)
{
/* Wide-char stream. */
if (_IO_in_backup (fp))
- INTUSE(_IO_free_wbackup_area) (fp);
+ _IO_free_wbackup_area (fp);
fp->_wide_data->_IO_read_end = fp->_wide_data->_IO_read_ptr;
fp->_wide_data->_IO_write_ptr = fp->_wide_data->_IO_write_base;
@@ -34,7 +34,7 @@ __fpurge (FILE *fp)
{
/* Byte stream. */
if (_IO_in_backup (fp))
- INTUSE(_IO_free_backup_area) (fp);
+ _IO_free_backup_area (fp);
fp->_IO_read_end = fp->_IO_read_ptr;
fp->_IO_write_ptr = fp->_IO_write_base;
diff --git a/libc/libio/__fsetlocking.c b/libc/libio/__fsetlocking.c
index b1453292d..8b0b52fa3 100644
--- a/libc/libio/__fsetlocking.c
+++ b/libc/libio/__fsetlocking.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,4 +34,4 @@ __fsetlocking (FILE *fp, int type)
return result;
}
-INTDEF(__fsetlocking)
+libc_hidden_def (__fsetlocking)
diff --git a/libc/libio/filedoalloc.c b/libc/libio/filedoalloc.c
index 64eb731c0..b7733c7f8 100644
--- a/libc/libio/filedoalloc.c
+++ b/libc/libio/filedoalloc.c
@@ -126,7 +126,7 @@ _IO_file_doallocate (fp)
#endif
}
ALLOC_BUF (p, size, EOF);
- INTUSE(_IO_setb) (fp, p, p + size, 1);
+ _IO_setb (fp, p, p + size, 1);
return 1;
}
-INTDEF(_IO_file_doallocate)
+libc_hidden_def (_IO_file_doallocate)
diff --git a/libc/libio/fileops.c b/libc/libio/fileops.c
index a0cb71806..9a6e51885 100644
--- a/libc/libio/fileops.c
+++ b/libc/libio/fileops.c
@@ -61,8 +61,6 @@ extern int errno;
# define lseek(FD, Offset, Whence) __lseek (FD, Offset, Whence)
# define read(FD, Buf, NBytes) __read (FD, Buf, NBytes)
# define write(FD, Buf, NBytes) __write (FD, Buf, NBytes)
-# define _IO_do_write _IO_new_do_write /* For macro uses. */
-# define _IO_file_close_it _IO_new_file_close_it
#else
# define _IO_new_do_write _IO_do_write
# define _IO_new_file_attach _IO_file_attach
@@ -149,10 +147,10 @@ _IO_new_file_init (fp)
fp->file._offset = _IO_pos_BAD;
fp->file._IO_file_flags |= CLOSED_FILEBUF_FLAGS;
- INTUSE(_IO_link_in) (fp);
+ _IO_link_in (fp);
fp->file._fileno = -1;
}
-INTDEF2(_IO_new_file_init, _IO_file_init)
+libc_hidden_ver (_IO_new_file_init, _IO_file_init)
int
_IO_new_file_close_it (fp)
@@ -176,7 +174,7 @@ _IO_new_file_close_it (fp)
else
write_status = 0;
- INTUSE(_IO_unsave_markers) (fp);
+ _IO_unsave_markers (fp);
int close_status = ((fp->_flags2 & _IO_FLAGS2_NOCLOSE) == 0
? _IO_SYSCLOSE (fp) : 0);
@@ -186,24 +184,24 @@ _IO_new_file_close_it (fp)
if (_IO_is_wide (fp))
{
if (_IO_have_wbackup (fp))
- INTUSE(_IO_free_wbackup_area) (fp);
- INTUSE(_IO_wsetb) (fp, NULL, NULL, 0);
+ _IO_free_wbackup_area (fp);
+ _IO_wsetb (fp, NULL, NULL, 0);
_IO_wsetg (fp, NULL, NULL, NULL);
_IO_wsetp (fp, NULL, NULL);
}
#endif
- INTUSE(_IO_setb) (fp, NULL, NULL, 0);
+ _IO_setb (fp, NULL, NULL, 0);
_IO_setg (fp, NULL, NULL, NULL);
_IO_setp (fp, NULL, NULL);
- INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
+ _IO_un_link ((struct _IO_FILE_plus *) fp);
fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;
fp->_fileno = -1;
fp->_offset = _IO_pos_BAD;
return close_status ? close_status : write_status;
}
-INTDEF2(_IO_new_file_close_it, _IO_file_close_it)
+libc_hidden_ver (_IO_new_file_close_it, _IO_file_close_it)
void
_IO_new_file_finish (fp, dummy)
@@ -216,9 +214,9 @@ _IO_new_file_finish (fp, dummy)
if (!(fp->_flags & _IO_DELETE_DONT_CLOSE))
_IO_SYSCLOSE (fp);
}
- INTUSE(_IO_default_finish) (fp, 0);
+ _IO_default_finish (fp, 0);
}
-INTDEF2(_IO_new_file_finish, _IO_file_finish)
+libc_hidden_ver (_IO_new_file_finish, _IO_file_finish)
_IO_FILE *
_IO_file_open (fp, filename, posix_mode, prot, read_write, is32not64)
@@ -250,7 +248,7 @@ _IO_file_open (fp, filename, posix_mode, prot, read_write, is32not64)
close_not_cancel (fdesc);
return NULL;
}
- INTUSE(_IO_link_in) ((struct _IO_FILE_plus *) fp);
+ _IO_link_in ((struct _IO_FILE_plus *) fp);
return fp;
}
libc_hidden_def (_IO_file_open)
@@ -380,7 +378,7 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
/* Something went wrong, we cannot load the conversion modules.
This means we cannot proceed since the user explicitly asked
for these. */
- (void) INTUSE(_IO_file_close_it) (fp);
+ (void) _IO_file_close_it (fp);
__set_errno (EINVAL);
return NULL;
}
@@ -439,7 +437,7 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
return result;
}
-INTDEF2(_IO_new_file_fopen, _IO_file_fopen)
+libc_hidden_ver (_IO_new_file_fopen, _IO_file_fopen)
_IO_FILE *
_IO_new_file_attach (fp, fd)
@@ -461,7 +459,7 @@ _IO_new_file_attach (fp, fd)
__set_errno (save_errno);
return fp;
}
-INTDEF2(_IO_new_file_attach, _IO_file_attach)
+libc_hidden_ver (_IO_new_file_attach, _IO_file_attach)
_IO_FILE *
_IO_new_file_setbuf (fp, p, len)
@@ -478,7 +476,7 @@ _IO_new_file_setbuf (fp, p, len)
return fp;
}
-INTDEF2(_IO_new_file_setbuf, _IO_file_setbuf)
+libc_hidden_ver (_IO_new_file_setbuf, _IO_file_setbuf)
_IO_FILE *
@@ -520,7 +518,7 @@ _IO_new_do_write (fp, data, to_do)
return (to_do == 0
|| (_IO_size_t) new_do_write (fp, data, to_do) == to_do) ? 0 : EOF;
}
-INTDEF2(_IO_new_do_write, _IO_do_write)
+libc_hidden_ver (_IO_new_do_write, _IO_do_write)
static
_IO_size_t
@@ -547,8 +545,7 @@ new_do_write (fp, data, to_do)
}
count = _IO_SYSWRITE (fp, data, to_do);
if (fp->_cur_column && count)
- fp->_cur_column = INTUSE(_IO_adjust_column) (fp->_cur_column - 1, data,
- count) + 1;
+ fp->_cur_column = _IO_adjust_column (fp->_cur_column - 1, data, count) + 1;
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_buf_base;
fp->_IO_write_end = (fp->_mode <= 0
@@ -585,7 +582,7 @@ _IO_new_file_underflow (fp)
free (fp->_IO_save_base);
fp->_flags &= ~_IO_IN_BACKUP;
}
- INTUSE(_IO_doallocbuf) (fp);
+ _IO_doallocbuf (fp);
}
/* Flush all line buffered files before reading. */
@@ -593,7 +590,7 @@ _IO_new_file_underflow (fp)
if (fp->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED))
{
#if 0
- INTUSE(_IO_flush_all_linebuffered) ();
+ _IO_flush_all_linebuffered ();
#else
/* We used to flush all line-buffered stream. This really isn't
required by any standard. My recollection is that
@@ -610,7 +607,7 @@ _IO_new_file_underflow (fp)
#endif
}
- INTUSE(_IO_switch_to_get_mode) (fp);
+ _IO_switch_to_get_mode (fp);
/* This is very tricky. We have to adjust those
pointers before we call _IO_SYSREAD () since
@@ -637,7 +634,7 @@ _IO_new_file_underflow (fp)
_IO_pos_adjust (fp->_offset, count);
return *(unsigned char *) fp->_IO_read_ptr;
}
-INTDEF2(_IO_new_file_underflow, _IO_file_underflow)
+libc_hidden_ver (_IO_new_file_underflow, _IO_file_underflow)
/* Guts of underflow callback if we mmap the file. This stats the file and
updates the stream state to match. In the normal case we return zero.
@@ -810,7 +807,7 @@ decide_maybe_mmap (_IO_FILE *fp)
}
else
{
- INTUSE(_IO_setb) (fp, p, (char *) p + st.st_size, 0);
+ _IO_setb (fp, p, (char *) p + st.st_size, 0);
if (fp->_offset == _IO_pos_BAD)
fp->_offset = 0;
@@ -865,7 +862,7 @@ _IO_new_file_overflow (f, ch)
/* Allocate a buffer if needed. */
if (f->_IO_write_base == NULL)
{
- INTUSE(_IO_doallocbuf) (f);
+ _IO_doallocbuf (f);
_IO_setg (f, f->_IO_buf_base, f->_IO_buf_base, f->_IO_buf_base);
}
/* Otherwise must be currently reading.
@@ -878,7 +875,7 @@ _IO_new_file_overflow (f, ch)
if (__builtin_expect (_IO_in_backup (f), 0))
{
size_t nbackup = f->_IO_read_end - f->_IO_read_ptr;
- INTUSE(_IO_free_backup_area) (f);
+ _IO_free_backup_area (f);
f->_IO_read_base -= MIN (nbackup,
f->_IO_read_base - f->_IO_buf_base);
f->_IO_read_ptr = f->_IO_read_base;
@@ -896,20 +893,20 @@ _IO_new_file_overflow (f, ch)
f->_IO_write_end = f->_IO_write_ptr;
}
if (ch == EOF)
- return INTUSE(_IO_do_write) (f, f->_IO_write_base,
- f->_IO_write_ptr - f->_IO_write_base);
+ return _IO_do_write (f, f->_IO_write_base,
+ f->_IO_write_ptr - f->_IO_write_base);
if (f->_IO_write_ptr == f->_IO_buf_end ) /* Buffer is really full */
if (_IO_do_flush (f) == EOF)
return EOF;
*f->_IO_write_ptr++ = ch;
if ((f->_flags & _IO_UNBUFFERED)
|| ((f->_flags & _IO_LINE_BUF) && ch == '\n'))
- if (INTUSE(_IO_do_write) (f, f->_IO_write_base,
- f->_IO_write_ptr - f->_IO_write_base) == EOF)
+ if (_IO_do_write (f, f->_IO_write_base,
+ f->_IO_write_ptr - f->_IO_write_base) == EOF)
return EOF;
return (unsigned char) ch;
}
-INTDEF2(_IO_new_file_overflow, _IO_file_overflow)
+libc_hidden_ver (_IO_new_file_overflow, _IO_file_overflow)
int
_IO_new_file_sync (fp)
@@ -944,7 +941,7 @@ _IO_new_file_sync (fp)
/* setg(base(), ptr, ptr); */
return retval;
}
-INTDEF2(_IO_new_file_sync, _IO_file_sync)
+libc_hidden_ver (_IO_new_file_sync, _IO_file_sync)
static int
_IO_file_sync_mmap (_IO_FILE *fp)
@@ -1001,7 +998,7 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
FIXME: simulate mem-papped files. */
if (fp->_IO_write_ptr > fp->_IO_write_base || _IO_in_put_mode (fp))
- if (INTUSE(_IO_switch_to_get_mode) (fp))
+ if (_IO_switch_to_get_mode (fp))
return EOF;
if (fp->_IO_buf_base == NULL)
@@ -1012,7 +1009,7 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
free (fp->_IO_read_base);
fp->_flags &= ~_IO_IN_BACKUP;
}
- INTUSE(_IO_doallocbuf) (fp);
+ _IO_doallocbuf (fp);
_IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
}
@@ -1120,7 +1117,7 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
return offset;
dumb:
- INTUSE(_IO_unsave_markers) (fp);
+ _IO_unsave_markers (fp);
result = _IO_SYSSEEK (fp, offset, dir);
if (result != EOF)
{
@@ -1141,7 +1138,7 @@ resync:
return offset;
}
-INTDEF2(_IO_new_file_seekoff, _IO_file_seekoff)
+libc_hidden_ver (_IO_new_file_seekoff, _IO_file_seekoff)
_IO_off64_t
_IO_file_seekoff_mmap (fp, offset, dir, mode)
@@ -1228,7 +1225,7 @@ _IO_file_read (fp, buf, size)
? read_not_cancel (fp->_fileno, buf, size)
: read (fp->_fileno, buf, size));
}
-INTDEF(_IO_file_read)
+libc_hidden_def (_IO_file_read)
_IO_off64_t
_IO_file_seek (fp, offset, dir)
@@ -1242,7 +1239,7 @@ _IO_file_seek (fp, offset, dir)
return lseek (fp->_fileno, offset, dir);
#endif
}
-INTDEF(_IO_file_seek)
+libc_hidden_def (_IO_file_seek)
int
_IO_file_stat (fp, st)
@@ -1255,7 +1252,7 @@ _IO_file_stat (fp, st)
return fstat (fp->_fileno, (struct stat *) st);
#endif
}
-INTDEF(_IO_file_stat)
+libc_hidden_def (_IO_file_stat)
int
_IO_file_close_mmap (fp)
@@ -1277,7 +1274,7 @@ _IO_file_close (fp)
unrecoverable state behind. */
return close_not_cancel (fp->_fileno);
}
-INTDEF(_IO_file_close)
+libc_hidden_def (_IO_file_close)
_IO_ssize_t
_IO_new_file_write (f, data, n)
@@ -1384,11 +1381,11 @@ _IO_new_file_xsputn (f, data, n)
buffer, but it's somewhat messier for line-buffered files,
so we let _IO_default_xsputn handle the general case. */
if (to_do)
- to_do -= INTUSE(_IO_default_xsputn) (f, s+do_write, to_do);
+ to_do -= _IO_default_xsputn (f, s+do_write, to_do);
}
return n - to_do;
}
-INTDEF2(_IO_new_file_xsputn, _IO_file_xsputn)
+libc_hidden_ver (_IO_new_file_xsputn, _IO_file_xsputn)
_IO_size_t
_IO_file_xsgetn (fp, data, n)
@@ -1410,7 +1407,7 @@ _IO_file_xsgetn (fp, data, n)
free (fp->_IO_save_base);
fp->_flags &= ~_IO_IN_BACKUP;
}
- INTUSE(_IO_doallocbuf) (fp);
+ _IO_doallocbuf (fp);
}
while (want > 0)
@@ -1489,7 +1486,7 @@ _IO_file_xsgetn (fp, data, n)
return n - want;
}
-INTDEF(_IO_file_xsgetn)
+libc_hidden_def (_IO_file_xsgetn)
static _IO_size_t _IO_file_xsgetn_mmap (_IO_FILE *, void *, _IO_size_t);
static _IO_size_t
@@ -1565,8 +1562,6 @@ _IO_file_xsgetn_maybe_mmap (fp, data, n)
}
#ifdef _LIBC
-# undef _IO_do_write
-# undef _IO_file_close_it
versioned_symbol (libc, _IO_new_do_write, _IO_do_write, GLIBC_2_1);
versioned_symbol (libc, _IO_new_file_attach, _IO_file_attach, GLIBC_2_1);
versioned_symbol (libc, _IO_new_file_close_it, _IO_file_close_it, GLIBC_2_1);
@@ -1585,23 +1580,23 @@ versioned_symbol (libc, _IO_new_file_xsputn, _IO_file_xsputn, GLIBC_2_1);
const struct _IO_jump_t _IO_file_jumps =
{
JUMP_INIT_DUMMY,
- JUMP_INIT(finish, INTUSE(_IO_file_finish)),
- JUMP_INIT(overflow, INTUSE(_IO_file_overflow)),
- JUMP_INIT(underflow, INTUSE(_IO_file_underflow)),
- JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)),
- JUMP_INIT(xsputn, INTUSE(_IO_file_xsputn)),
- JUMP_INIT(xsgetn, INTUSE(_IO_file_xsgetn)),
+ JUMP_INIT(finish, _IO_file_finish),
+ JUMP_INIT(overflow, _IO_file_overflow),
+ JUMP_INIT(underflow, _IO_file_underflow),
+ JUMP_INIT(uflow, _IO_default_uflow),
+ JUMP_INIT(pbackfail, _IO_default_pbackfail),
+ JUMP_INIT(xsputn, _IO_file_xsputn),
+ JUMP_INIT(xsgetn, _IO_file_xsgetn),
JUMP_INIT(seekoff, _IO_new_file_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_new_file_setbuf),
JUMP_INIT(sync, _IO_new_file_sync),
- JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)),
- JUMP_INIT(read, INTUSE(_IO_file_read)),
+ JUMP_INIT(doallocate, _IO_file_doallocate),
+ JUMP_INIT(read, _IO_file_read),
JUMP_INIT(write, _IO_new_file_write),
- JUMP_INIT(seek, INTUSE(_IO_file_seek)),
- JUMP_INIT(close, INTUSE(_IO_file_close)),
- JUMP_INIT(stat, INTUSE(_IO_file_stat)),
+ JUMP_INIT(seek, _IO_file_seek),
+ JUMP_INIT(close, _IO_file_close),
+ JUMP_INIT(stat, _IO_file_stat),
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)
};
@@ -1610,23 +1605,23 @@ libc_hidden_data_def (_IO_file_jumps)
const struct _IO_jump_t _IO_file_jumps_mmap =
{
JUMP_INIT_DUMMY,
- JUMP_INIT(finish, INTUSE(_IO_file_finish)),
- JUMP_INIT(overflow, INTUSE(_IO_file_overflow)),
+ JUMP_INIT(finish, _IO_file_finish),
+ JUMP_INIT(overflow, _IO_file_overflow),
JUMP_INIT(underflow, _IO_file_underflow_mmap),
- JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)),
+ JUMP_INIT(uflow, _IO_default_uflow),
+ JUMP_INIT(pbackfail, _IO_default_pbackfail),
JUMP_INIT(xsputn, _IO_new_file_xsputn),
JUMP_INIT(xsgetn, _IO_file_xsgetn_mmap),
JUMP_INIT(seekoff, _IO_file_seekoff_mmap),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, (_IO_setbuf_t) _IO_file_setbuf_mmap),
JUMP_INIT(sync, _IO_file_sync_mmap),
- JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)),
- JUMP_INIT(read, INTUSE(_IO_file_read)),
+ JUMP_INIT(doallocate, _IO_file_doallocate),
+ JUMP_INIT(read, _IO_file_read),
JUMP_INIT(write, _IO_new_file_write),
- JUMP_INIT(seek, INTUSE(_IO_file_seek)),
+ JUMP_INIT(seek, _IO_file_seek),
JUMP_INIT(close, _IO_file_close_mmap),
- JUMP_INIT(stat, INTUSE(_IO_file_stat)),
+ JUMP_INIT(stat, _IO_file_stat),
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)
};
@@ -1634,23 +1629,23 @@ const struct _IO_jump_t _IO_file_jumps_mmap =
const struct _IO_jump_t _IO_file_jumps_maybe_mmap =
{
JUMP_INIT_DUMMY,
- JUMP_INIT(finish, INTUSE(_IO_file_finish)),
- JUMP_INIT(overflow, INTUSE(_IO_file_overflow)),
+ JUMP_INIT(finish, _IO_file_finish),
+ JUMP_INIT(overflow, _IO_file_overflow),
JUMP_INIT(underflow, _IO_file_underflow_maybe_mmap),
- JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)),
+ JUMP_INIT(uflow, _IO_default_uflow),
+ JUMP_INIT(pbackfail, _IO_default_pbackfail),
JUMP_INIT(xsputn, _IO_new_file_xsputn),
JUMP_INIT(xsgetn, _IO_file_xsgetn_maybe_mmap),
JUMP_INIT(seekoff, _IO_file_seekoff_maybe_mmap),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, (_IO_setbuf_t) _IO_file_setbuf_mmap),
JUMP_INIT(sync, _IO_new_file_sync),
- JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)),
- JUMP_INIT(read, INTUSE(_IO_file_read)),
+ JUMP_INIT(doallocate, _IO_file_doallocate),
+ JUMP_INIT(read, _IO_file_read),
JUMP_INIT(write, _IO_new_file_write),
- JUMP_INIT(seek, INTUSE(_IO_file_seek)),
+ JUMP_INIT(seek, _IO_file_seek),
JUMP_INIT(close, _IO_file_close),
- JUMP_INIT(stat, INTUSE(_IO_file_stat)),
+ JUMP_INIT(stat, _IO_file_stat),
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)
};
diff --git a/libc/libio/freopen.c b/libc/libio/freopen.c
index fa89c277c..9303106c3 100644
--- a/libc/libio/freopen.c
+++ b/libc/libio/freopen.c
@@ -65,11 +65,11 @@ freopen (filename, mode, fp)
else
#endif
{
- INTUSE(_IO_file_close_it) (fp);
+ _IO_file_close_it (fp);
_IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps;
if (_IO_vtable_offset (fp) == 0 && fp->_wide_data != NULL)
fp->_wide_data->_wide_vtable = &_IO_wfile_jumps;
- result = INTUSE(_IO_file_fopen) (fp, gfilename, mode, 1);
+ result = _IO_file_fopen (fp, gfilename, mode, 1);
if (result != NULL)
result = __fopen_maybe_mmap (result);
}
diff --git a/libc/libio/freopen64.c b/libc/libio/freopen64.c
index c28a9925f..135049ff7 100644
--- a/libc/libio/freopen64.c
+++ b/libc/libio/freopen64.c
@@ -50,11 +50,11 @@ freopen64 (filename, mode, fp)
const char *gfilename = (filename == NULL && fd >= 0
? fd_to_filename (fd) : filename);
fp->_flags2 |= _IO_FLAGS2_NOCLOSE;
- INTUSE(_IO_file_close_it) (fp);
+ _IO_file_close_it (fp);
_IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps;
if (_IO_vtable_offset (fp) == 0 && fp->_wide_data != NULL)
fp->_wide_data->_wide_vtable = &_IO_wfile_jumps;
- result = INTUSE(_IO_file_fopen) (fp, gfilename, mode, 0);
+ result = _IO_file_fopen (fp, gfilename, mode, 0);
fp->_flags2 &= ~_IO_FLAGS2_NOCLOSE;
if (result != NULL)
result = __fopen_maybe_mmap (result);
diff --git a/libc/libio/genops.c b/libc/libio/genops.c
index 272b94d22..b7dd86362 100644
--- a/libc/libio/genops.c
+++ b/libc/libio/genops.c
@@ -68,16 +68,15 @@ _IO_un_link (fp)
run_fp = (_IO_FILE *) fp;
_IO_flockfile ((_IO_FILE *) fp);
#endif
- if (INTUSE(_IO_list_all) == NULL)
+ if (_IO_list_all == NULL)
;
- else if (fp == INTUSE(_IO_list_all))
+ else if (fp == _IO_list_all)
{
- INTUSE(_IO_list_all)
- = (struct _IO_FILE_plus *) INTUSE(_IO_list_all)->file._chain;
+ _IO_list_all = (struct _IO_FILE_plus *) _IO_list_all->file._chain;
++_IO_list_all_stamp;
}
else
- for (f = &INTUSE(_IO_list_all)->file._chain; *f; f = &(*f)->_chain)
+ for (f = &_IO_list_all->file._chain; *f; f = &(*f)->_chain)
if (*f == (_IO_FILE *) fp)
{
*f = fp->file._chain;
@@ -93,7 +92,7 @@ _IO_un_link (fp)
#endif
}
}
-INTDEF(_IO_un_link)
+libc_hidden_def (_IO_un_link)
void
_IO_link_in (fp)
@@ -108,8 +107,8 @@ _IO_link_in (fp)
run_fp = (_IO_FILE *) fp;
_IO_flockfile ((_IO_FILE *) fp);
#endif
- fp->file._chain = (_IO_FILE *) INTUSE(_IO_list_all);
- INTUSE(_IO_list_all) = fp;
+ fp->file._chain = (_IO_FILE *) _IO_list_all;
+ _IO_list_all = fp;
++_IO_list_all_stamp;
#ifdef _IO_MTSAFE_IO
_IO_funlockfile ((_IO_FILE *) fp);
@@ -119,7 +118,7 @@ _IO_link_in (fp)
#endif
}
}
-INTDEF(_IO_link_in)
+libc_hidden_def (_IO_link_in)
/* Return minimum _pos markers
Assumes the current get area is the main get area. */
@@ -200,7 +199,7 @@ _IO_switch_to_get_mode (fp)
fp->_flags &= ~_IO_CURRENTLY_PUTTING;
return 0;
}
-INTDEF(_IO_switch_to_get_mode)
+libc_hidden_def (_IO_switch_to_get_mode)
void
_IO_free_backup_area (fp)
@@ -213,7 +212,7 @@ _IO_free_backup_area (fp)
fp->_IO_save_end = NULL;
fp->_IO_backup_base = NULL;
}
-INTDEF(_IO_free_backup_area)
+libc_hidden_def (_IO_free_backup_area)
#if 0
int
@@ -338,7 +337,7 @@ __underflow (fp)
if (fp->_mode == 0)
_IO_fwide (fp, -1);
if (_IO_in_put_mode (fp))
- if (INTUSE(_IO_switch_to_get_mode) (fp) == EOF)
+ if (_IO_switch_to_get_mode (fp) == EOF)
return EOF;
if (fp->_IO_read_ptr < fp->_IO_read_end)
return *(unsigned char *) fp->_IO_read_ptr;
@@ -354,7 +353,7 @@ __underflow (fp)
return EOF;
}
else if (_IO_have_backup (fp))
- INTUSE(_IO_free_backup_area) (fp);
+ _IO_free_backup_area (fp);
return _IO_UNDERFLOW (fp);
}
libc_hidden_def (__underflow)
@@ -371,7 +370,7 @@ __uflow (fp)
if (fp->_mode == 0)
_IO_fwide (fp, -1);
if (_IO_in_put_mode (fp))
- if (INTUSE(_IO_switch_to_get_mode) (fp) == EOF)
+ if (_IO_switch_to_get_mode (fp) == EOF)
return EOF;
if (fp->_IO_read_ptr < fp->_IO_read_end)
return *(unsigned char *) fp->_IO_read_ptr++;
@@ -387,7 +386,7 @@ __uflow (fp)
return EOF;
}
else if (_IO_have_backup (fp))
- INTUSE(_IO_free_backup_area) (fp);
+ _IO_free_backup_area (fp);
return _IO_UFLOW (fp);
}
libc_hidden_def (__uflow)
@@ -408,7 +407,7 @@ _IO_setb (f, b, eb, a)
else
f->_flags |= _IO_USER_BUF;
}
-INTDEF(_IO_setb)
+libc_hidden_def (_IO_setb)
void
_IO_doallocbuf (fp)
@@ -419,9 +418,9 @@ _IO_doallocbuf (fp)
if (!(fp->_flags & _IO_UNBUFFERED) || fp->_mode > 0)
if (_IO_DOALLOCATE (fp) != EOF)
return;
- INTUSE(_IO_setb) (fp, fp->_shortbuf, fp->_shortbuf+1, 0);
+ _IO_setb (fp, fp->_shortbuf, fp->_shortbuf+1, 0);
}
-INTDEF(_IO_doallocbuf)
+libc_hidden_def (_IO_doallocbuf)
int
_IO_default_underflow (fp)
@@ -439,7 +438,7 @@ _IO_default_uflow (fp)
return EOF;
return *(unsigned char *) fp->_IO_read_ptr++;
}
-INTDEF(_IO_default_uflow)
+libc_hidden_def (_IO_default_uflow)
_IO_size_t
_IO_default_xsputn (f, data, n)
@@ -485,7 +484,7 @@ _IO_default_xsputn (f, data, n)
}
return n - more;
}
-INTDEF(_IO_default_xsputn)
+libc_hidden_def (_IO_default_xsputn)
_IO_size_t
_IO_sgetn (fp, data, n)
@@ -496,7 +495,7 @@ _IO_sgetn (fp, data, n)
/* FIXME handle putback buffer here! */
return _IO_XSGETN (fp, data, n);
}
-INTDEF(_IO_sgetn)
+libc_hidden_def (_IO_sgetn)
_IO_size_t
_IO_default_xsgetn (fp, data, n)
@@ -539,7 +538,7 @@ _IO_default_xsgetn (fp, data, n)
}
return n - more;
}
-INTDEF(_IO_default_xsgetn)
+libc_hidden_def (_IO_default_xsgetn)
#if 0
/* Seems not to be needed. --drepper */
@@ -562,12 +561,12 @@ _IO_default_setbuf (fp, p, len)
if (p == NULL || len == 0)
{
fp->_flags |= _IO_UNBUFFERED;
- INTUSE(_IO_setb) (fp, fp->_shortbuf, fp->_shortbuf+1, 0);
+ _IO_setb (fp, fp->_shortbuf, fp->_shortbuf+1, 0);
}
else
{
fp->_flags &= ~_IO_UNBUFFERED;
- INTUSE(_IO_setb) (fp, p, p+len, 0);
+ _IO_setb (fp, p, p+len, 0);
}
fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end = 0;
fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_read_end = 0;
@@ -590,10 +589,10 @@ _IO_default_doallocate (fp)
char *buf;
ALLOC_BUF (buf, _IO_BUFSIZ, EOF);
- INTUSE(_IO_setb) (fp, buf, buf+_IO_BUFSIZ, 1);
+ _IO_setb (fp, buf, buf+_IO_BUFSIZ, 1);
return 1;
}
-INTDEF(_IO_default_doallocate)
+libc_hidden_def (_IO_default_doallocate)
void
_IO_init (fp, flags)
@@ -602,7 +601,7 @@ _IO_init (fp, flags)
{
_IO_no_init (fp, flags, -1, NULL, NULL);
}
-INTDEF(_IO_init)
+libc_hidden_def (_IO_init)
void
_IO_old_init (fp, flags)
@@ -698,14 +697,14 @@ _IO_default_finish (fp, dummy)
fp->_IO_save_base = NULL;
}
- INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
+ _IO_un_link ((struct _IO_FILE_plus *) fp);
#ifdef _IO_MTSAFE_IO
if (fp->_lock != NULL)
_IO_lock_fini (*fp->_lock);
#endif
}
-INTDEF(_IO_default_finish)
+libc_hidden_def (_IO_default_finish)
_IO_off64_t
_IO_default_seekoff (fp, offset, dir, mode)
@@ -738,7 +737,7 @@ _IO_sputbackc (fp, c)
return result;
}
-INTDEF(_IO_sputbackc)
+libc_hidden_def (_IO_sputbackc)
int
_IO_sungetc (fp)
@@ -798,7 +797,7 @@ _IO_adjust_column (start, line, count)
return line + count - ptr - 1;
return start + count;
}
-INTDEF(_IO_adjust_column)
+libc_hidden_def (_IO_adjust_column)
#if 0
/* Seems not to be needed. --drepper */
@@ -829,7 +828,7 @@ _IO_flush_all_lockp (int do_lock)
#endif
last_stamp = _IO_list_all_stamp;
- fp = (_IO_FILE *) INTUSE(_IO_list_all);
+ fp = (_IO_FILE *) _IO_list_all;
while (fp != NULL)
{
run_fp = fp;
@@ -853,7 +852,7 @@ _IO_flush_all_lockp (int do_lock)
if (last_stamp != _IO_list_all_stamp)
{
/* Something was added to the list. Start all over again. */
- fp = (_IO_FILE *) INTUSE(_IO_list_all);
+ fp = (_IO_FILE *) _IO_list_all;
last_stamp = _IO_list_all_stamp;
}
else
@@ -876,7 +875,7 @@ _IO_flush_all ()
/* We want locking. */
return _IO_flush_all_lockp (1);
}
-INTDEF(_IO_flush_all)
+libc_hidden_def (_IO_flush_all)
void
_IO_flush_all_linebuffered ()
@@ -890,7 +889,7 @@ _IO_flush_all_linebuffered ()
#endif
last_stamp = _IO_list_all_stamp;
- fp = (_IO_FILE *) INTUSE(_IO_list_all);
+ fp = (_IO_FILE *) _IO_list_all;
while (fp != NULL)
{
run_fp = fp;
@@ -905,7 +904,7 @@ _IO_flush_all_linebuffered ()
if (last_stamp != _IO_list_all_stamp)
{
/* Something was added to the list. Start all over again. */
- fp = (_IO_FILE *) INTUSE(_IO_list_all);
+ fp = (_IO_FILE *) _IO_list_all;
last_stamp = _IO_list_all_stamp;
}
else
@@ -917,7 +916,7 @@ _IO_flush_all_linebuffered ()
_IO_cleanup_region_end (0);
#endif
}
-INTDEF(_IO_flush_all_linebuffered)
+libc_hidden_def (_IO_flush_all_linebuffered)
#ifdef _LIBC
weak_alias (_IO_flush_all_linebuffered, _flushlbf)
#endif
@@ -945,7 +944,7 @@ static void
_IO_unbuffer_write (void)
{
struct _IO_FILE *fp;
- for (fp = (_IO_FILE *) INTUSE(_IO_list_all); fp; fp = fp->_chain)
+ for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain)
{
if (! (fp->_flags & _IO_UNBUFFERED)
&& (! (fp->_flags & _IO_NO_WRITES)
@@ -1026,7 +1025,7 @@ _IO_init_marker (marker, fp)
{
marker->_sbuf = fp;
if (_IO_in_put_mode (fp))
- INTUSE(_IO_switch_to_get_mode) (fp);
+ _IO_switch_to_get_mode (fp);
if (_IO_in_backup (fp))
marker->_pos = fp->_IO_read_ptr - fp->_IO_read_end;
else
@@ -1132,9 +1131,9 @@ _IO_unsave_markers (fp)
}
if (_IO_have_backup (fp))
- INTUSE(_IO_free_backup_area) (fp);
+ _IO_free_backup_area (fp);
}
-INTDEF(_IO_unsave_markers)
+libc_hidden_def (_IO_unsave_markers)
#if 0
/* Seems not to be needed. --drepper */
@@ -1208,7 +1207,7 @@ _IO_default_pbackfail (fp, c)
}
return (unsigned char) c;
}
-INTDEF(_IO_default_pbackfail)
+libc_hidden_def (_IO_default_pbackfail)
_IO_off64_t
_IO_default_seek (fp, offset, dir)
@@ -1262,7 +1261,7 @@ _IO_default_imbue (fp, locale)
_IO_ITER
_IO_iter_begin()
{
- return (_IO_ITER) INTUSE(_IO_list_all);
+ return (_IO_ITER) _IO_list_all;
}
libc_hidden_def (_IO_iter_begin)
diff --git a/libc/libio/iofclose.c b/libc/libio/iofclose.c
index 1b7494581..fc049318b 100644
--- a/libc/libio/iofclose.c
+++ b/libc/libio/iofclose.c
@@ -52,11 +52,11 @@ _IO_new_fclose (fp)
/* First unlink the stream. */
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
- INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
+ _IO_un_link ((struct _IO_FILE_plus *) fp);
_IO_acquire_lock (fp);
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
- status = INTUSE(_IO_file_close_it) (fp);
+ status = _IO_file_close_it (fp);
else
status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
_IO_release_lock (fp);
@@ -77,7 +77,7 @@ _IO_new_fclose (fp)
else
{
if (_IO_have_backup (fp))
- INTUSE(_IO_free_backup_area) (fp);
+ _IO_free_backup_area (fp);
}
if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
{
diff --git a/libc/libio/iofdopen.c b/libc/libio/iofdopen.c
index f30df181d..b4ea76b03 100644
--- a/libc/libio/iofdopen.c
+++ b/libc/libio/iofdopen.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,1994,1997,1998,1999,2000,2002,2003,2010,2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -156,14 +155,14 @@ _IO_new_fdopen (fd, mode)
(use_mmap && (read_write & _IO_NO_WRITES)) ? &_IO_file_jumps_maybe_mmap :
#endif
&_IO_file_jumps;
- INTUSE(_IO_file_init) (&new_f->fp);
+ _IO_file_init (&new_f->fp);
#if !_IO_UNIFIED_JUMPTABLES
new_f->fp.vtable = NULL;
#endif
- if (INTUSE(_IO_file_attach) ((_IO_FILE *) &new_f->fp, fd) == NULL)
+ if (_IO_file_attach ((_IO_FILE *) &new_f->fp, fd) == NULL)
{
- INTUSE(_IO_setb) (&new_f->fp.file, NULL, NULL, 0);
- INTUSE(_IO_un_link) (&new_f->fp);
+ _IO_setb (&new_f->fp.file, NULL, NULL, 0);
+ _IO_un_link (&new_f->fp);
free (new_f);
return NULL;
}
@@ -174,7 +173,7 @@ _IO_new_fdopen (fd, mode)
return &new_f->fp.file;
}
-INTDEF2(_IO_new_fdopen, _IO_fdopen)
+libc_hidden_ver (_IO_new_fdopen, _IO_fdopen)
strong_alias (_IO_new_fdopen, __new_fdopen)
versioned_symbol (libc, _IO_new_fdopen, _IO_fdopen, GLIBC_2_1);
diff --git a/libc/libio/iofflush.c b/libc/libio/iofflush.c
index 82d7958ab..57e0eafab 100644
--- a/libc/libio/iofflush.c
+++ b/libc/libio/iofflush.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 2002, 2003
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +32,7 @@ _IO_fflush (fp)
_IO_FILE *fp;
{
if (fp == NULL)
- return INTUSE(_IO_flush_all) ();
+ return _IO_flush_all ();
else
{
int result;
@@ -44,7 +43,7 @@ _IO_fflush (fp)
return result;
}
}
-INTDEF(_IO_fflush)
+libc_hidden_def (_IO_fflush)
#ifdef weak_alias
weak_alias (_IO_fflush, fflush)
diff --git a/libc/libio/iofflush_u.c b/libc/libio/iofflush_u.c
index f60e68463..353c7abf6 100644
--- a/libc/libio/iofflush_u.c
+++ b/libc/libio/iofflush_u.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,7 +32,7 @@ fflush_unlocked (fp)
_IO_FILE *fp;
{
if (fp == NULL)
- return INTUSE(_IO_flush_all) ();
+ return _IO_flush_all ();
else
{
CHECK_FILE (fp, EOF);
diff --git a/libc/libio/iofgets.c b/libc/libio/iofgets.c
index a48edfc10..984cb8610 100644
--- a/libc/libio/iofgets.c
+++ b/libc/libio/iofgets.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2005
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -54,7 +53,7 @@ _IO_fgets (buf, n, fp)
case. We return an error only when there is a new error. */
old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
fp->_IO_file_flags &= ~_IO_ERR_SEEN;
- count = INTUSE(_IO_getline) (fp, buf, n - 1, '\n', 1);
+ count = _IO_getline (fp, buf, n - 1, '\n', 1);
/* If we read in some bytes and errno is EAGAIN, that error will
be reported for next read. */
if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
diff --git a/libc/libio/iofgets_u.c b/libc/libio/iofgets_u.c
index b8f15e43d..e524943a5 100644
--- a/libc/libio/iofgets_u.c
+++ b/libc/libio/iofgets_u.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1995-1998,2002,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -52,7 +52,7 @@ fgets_unlocked (buf, n, fp)
case. We return an error only when there is a new error. */
old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
fp->_IO_file_flags &= ~_IO_ERR_SEEN;
- count = INTUSE(_IO_getline) (fp, buf, n - 1, '\n', 1);
+ count = _IO_getline (fp, buf, n - 1, '\n', 1);
/* If we read in some bytes and errno is EAGAIN, that error will
be reported for next read. */
if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
diff --git a/libc/libio/iofopen.c b/libc/libio/iofopen.c
index 491d44388..8edd32ebd 100644
--- a/libc/libio/iofopen.c
+++ b/libc/libio/iofopen.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,1997,1998,1999,2000,2002,2003,2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -83,15 +82,14 @@ __fopen_internal (filename, mode, is32)
_IO_no_init (&new_f->fp.file, 1, 0, NULL, NULL);
#endif
_IO_JUMPS (&new_f->fp) = &_IO_file_jumps;
- INTUSE(_IO_file_init) (&new_f->fp);
+ _IO_file_init (&new_f->fp);
#if !_IO_UNIFIED_JUMPTABLES
new_f->fp.vtable = NULL;
#endif
- if (INTUSE(_IO_file_fopen) ((_IO_FILE *) new_f, filename, mode, is32)
- != NULL)
+ if (_IO_file_fopen ((_IO_FILE *) new_f, filename, mode, is32) != NULL)
return __fopen_maybe_mmap (&new_f->fp.file);
- INTUSE(_IO_un_link) (&new_f->fp);
+ _IO_un_link (&new_f->fp);
free (new_f);
return NULL;
}
diff --git a/libc/libio/iofopncook.c b/libc/libio/iofopncook.c
index b95632f5f..7797e8e0b 100644
--- a/libc/libio/iofopncook.c
+++ b/libc/libio/iofopncook.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,95,97,99,2000,2002,2004, 2005, 2010
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -113,24 +112,24 @@ _IO_cookie_seekoff (fp, offset, dir, mode)
/* We must force the fileops code to always use seek to determine
the position. */
fp->_offset = _IO_pos_BAD;
- return INTUSE(_IO_file_seekoff) (fp, offset, dir, mode);
+ return _IO_file_seekoff (fp, offset, dir, mode);
}
static const struct _IO_jump_t _IO_cookie_jumps = {
JUMP_INIT_DUMMY,
- JUMP_INIT(finish, INTUSE(_IO_file_finish)),
- JUMP_INIT(overflow, INTUSE(_IO_file_overflow)),
- JUMP_INIT(underflow, INTUSE(_IO_file_underflow)),
- JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)),
- JUMP_INIT(xsputn, INTUSE(_IO_file_xsputn)),
- JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)),
+ JUMP_INIT(finish, _IO_file_finish),
+ JUMP_INIT(overflow, _IO_file_overflow),
+ JUMP_INIT(underflow, _IO_file_underflow),
+ JUMP_INIT(uflow, _IO_default_uflow),
+ JUMP_INIT(pbackfail, _IO_default_pbackfail),
+ JUMP_INIT(xsputn, _IO_file_xsputn),
+ JUMP_INIT(xsgetn, _IO_default_xsgetn),
JUMP_INIT(seekoff, _IO_cookie_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
- JUMP_INIT(setbuf, INTUSE(_IO_file_setbuf)),
- JUMP_INIT(sync, INTUSE(_IO_file_sync)),
- JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)),
+ JUMP_INIT(setbuf, _IO_file_setbuf),
+ JUMP_INIT(sync, _IO_file_sync),
+ JUMP_INIT(doallocate, _IO_file_doallocate),
JUMP_INIT(read, _IO_cookie_read),
JUMP_INIT(write, _IO_cookie_write),
JUMP_INIT(seek, _IO_cookie_seek),
@@ -145,13 +144,13 @@ void
_IO_cookie_init (struct _IO_cookie_file *cfile, int read_write,
void *cookie, _IO_cookie_io_functions_t io_functions)
{
- INTUSE(_IO_init) (&cfile->__fp.file, 0);
+ _IO_init (&cfile->__fp.file, 0);
_IO_JUMPS (&cfile->__fp) = &_IO_cookie_jumps;
cfile->__cookie = cookie;
cfile->__io_functions = io_functions;
- INTUSE(_IO_file_init) (&cfile->__fp);
+ _IO_file_init (&cfile->__fp);
_IO_mask_flags (&cfile->__fp.file, read_write,
_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
@@ -238,18 +237,18 @@ _IO_old_cookie_seek (fp, offset, dir)
static const struct _IO_jump_t _IO_old_cookie_jumps = {
JUMP_INIT_DUMMY,
- JUMP_INIT(finish, INTUSE(_IO_file_finish)),
- JUMP_INIT(overflow, INTUSE(_IO_file_overflow)),
- JUMP_INIT(underflow, INTUSE(_IO_file_underflow)),
- JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)),
- JUMP_INIT(xsputn, INTUSE(_IO_file_xsputn)),
- JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)),
+ JUMP_INIT(finish, _IO_file_finish),
+ JUMP_INIT(overflow, _IO_file_overflow),
+ JUMP_INIT(underflow, _IO_file_underflow),
+ JUMP_INIT(uflow, _IO_default_uflow),
+ JUMP_INIT(pbackfail, _IO_default_pbackfail),
+ JUMP_INIT(xsputn, _IO_file_xsputn),
+ JUMP_INIT(xsgetn, _IO_default_xsgetn),
JUMP_INIT(seekoff, _IO_cookie_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
- JUMP_INIT(setbuf, INTUSE(_IO_file_setbuf)),
- JUMP_INIT(sync, INTUSE(_IO_file_sync)),
- JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)),
+ JUMP_INIT(setbuf, _IO_file_setbuf),
+ JUMP_INIT(sync, _IO_file_sync),
+ JUMP_INIT(doallocate, _IO_file_doallocate),
JUMP_INIT(read, _IO_cookie_read),
JUMP_INIT(write, _IO_cookie_write),
JUMP_INIT(seek, _IO_old_cookie_seek),
diff --git a/libc/libio/iofread.c b/libc/libio/iofread.c
index 0c980f14c..1f04aaec4 100644
--- a/libc/libio/iofread.c
+++ b/libc/libio/iofread.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2002, 2003
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,11 +39,11 @@ _IO_fread (buf, size, count, fp)
if (bytes_requested == 0)
return 0;
_IO_acquire_lock (fp);
- bytes_read = INTUSE(_IO_sgetn) (fp, (char *) buf, bytes_requested);
+ bytes_read = _IO_sgetn (fp, (char *) buf, bytes_requested);
_IO_release_lock (fp);
return bytes_requested == bytes_read ? count : bytes_read / size;
}
-INTDEF(_IO_fread)
+libc_hidden_def (_IO_fread)
#ifdef weak_alias
weak_alias (_IO_fread, fread)
diff --git a/libc/libio/iofread_u.c b/libc/libio/iofread_u.c
index 587e7cb3f..a314d22e1 100644
--- a/libc/libio/iofread_u.c
+++ b/libc/libio/iofread_u.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -41,7 +41,7 @@ fread_unlocked (buf, size, count, fp)
CHECK_FILE (fp, 0);
if (bytes_requested == 0)
return 0;
- bytes_read = INTUSE(_IO_sgetn) (fp, (char *) buf, bytes_requested);
+ bytes_read = _IO_sgetn (fp, (char *) buf, bytes_requested);
return bytes_requested == bytes_read ? count : bytes_read / size;
}
libc_hidden_def (fread_unlocked)
diff --git a/libc/libio/ioftell.c b/libc/libio/ioftell.c
index 089935237..a1e061844 100644
--- a/libc/libio/ioftell.c
+++ b/libc/libio/ioftell.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995-2000, 2001, 2002, 2003, 2004
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -61,7 +60,7 @@ _IO_ftell (fp)
}
return pos;
}
-INTDEF(_IO_ftell)
+libc_hidden_def (_IO_ftell)
#ifdef weak_alias
weak_alias (_IO_ftell, ftell)
diff --git a/libc/libio/iofwrite.c b/libc/libio/iofwrite.c
index ac0194f98..d4610f78c 100644
--- a/libc/libio/iofwrite.c
+++ b/libc/libio/iofwrite.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2008
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -52,7 +51,7 @@ _IO_fwrite (buf, size, count, fp)
else
return written / size;
}
-INTDEF(_IO_fwrite)
+libc_hidden_def (_IO_fwrite)
#ifdef weak_alias
# include <stdio.h>
diff --git a/libc/libio/iogetline.c b/libc/libio/iogetline.c
index deeefb6bc..f097f8002 100644
--- a/libc/libio/iogetline.c
+++ b/libc/libio/iogetline.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,1997,1998,2000,2001,2002,2005
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,10 +37,9 @@ _IO_getline (fp, buf, n, delim, extract_delim)
int delim;
int extract_delim;
{
- return INTUSE(_IO_getline_info) (fp, buf, n, delim, extract_delim,
- (int *) 0);
+ return _IO_getline_info (fp, buf, n, delim, extract_delim, (int *) 0);
}
-INTDEF(_IO_getline)
+libc_hidden_def (_IO_getline)
/* Algorithm based on that used by Berkeley pre-4.4 fgets implementation.
@@ -82,7 +80,7 @@ _IO_getline_info (fp, buf, n, delim, extract_delim, eof)
if (extract_delim > 0)
*ptr++ = c;
else if (extract_delim < 0)
- INTUSE(_IO_sputbackc) (fp, c);
+ _IO_sputbackc (fp, c);
if (extract_delim > 0)
++len;
return ptr - buf;
@@ -118,6 +116,6 @@ _IO_getline_info (fp, buf, n, delim, extract_delim, eof)
}
return ptr - buf;
}
-INTDEF(_IO_getline_info)
+libc_hidden_def (_IO_getline_info)
#endif /* Defined _LIBC || !_G_HAVE_IO_GETLINE_INFO */
diff --git a/libc/libio/iogets.c b/libc/libio/iogets.c
index 39103dcf1..77353fe14 100644
--- a/libc/libio/iogets.c
+++ b/libc/libio/iogets.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1996,1997,1998,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -52,7 +52,7 @@ _IO_gets (buf)
int old_error = _IO_stdin->_IO_file_flags & _IO_ERR_SEEN;
_IO_stdin->_IO_file_flags &= ~_IO_ERR_SEEN;
buf[0] = (char) ch;
- count = INTUSE(_IO_getline) (_IO_stdin, buf + 1, INT_MAX, '\n', 0) + 1;
+ count = _IO_getline (_IO_stdin, buf + 1, INT_MAX, '\n', 0) + 1;
if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
{
retval = NULL;
diff --git a/libc/libio/iogetwline.c b/libc/libio/iogetwline.c
index 167d32a1b..598ece173 100644
--- a/libc/libio/iogetwline.c
+++ b/libc/libio/iogetwline.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1997-2000,2002,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -85,7 +85,7 @@ _IO_getwline_info (fp, buf, n, delim, extract_delim, eof)
if (extract_delim > 0)
*ptr++ = wc;
else if (extract_delim < 0)
- INTUSE(_IO_sputbackc) (fp, wc);
+ _IO_sputbackc (fp, wc);
if (extract_delim > 0)
++len;
return ptr - buf;
diff --git a/libc/libio/iolibio.h b/libc/libio/iolibio.h
index 00a4f56c5..f215fcef0 100644
--- a/libc/libio/iolibio.h
+++ b/libc/libio/iolibio.h
@@ -11,9 +11,11 @@ extern int _IO_fclose (_IO_FILE*);
extern int _IO_new_fclose (_IO_FILE*);
extern int _IO_old_fclose (_IO_FILE*);
extern _IO_FILE *_IO_fdopen (int, const char*) __THROW;
+libc_hidden_proto (_IO_fdopen)
extern _IO_FILE *_IO_old_fdopen (int, const char*) __THROW;
extern _IO_FILE *_IO_new_fdopen (int, const char*) __THROW;
extern int _IO_fflush (_IO_FILE*);
+libc_hidden_proto (_IO_fflush)
extern int _IO_fgetpos (_IO_FILE*, _IO_fpos_t*);
extern int _IO_fgetpos64 (_IO_FILE*, _IO_fpos64_t*);
extern char* _IO_fgets (char*, int, _IO_FILE*);
@@ -29,20 +31,26 @@ libc_hidden_proto (_IO_fputs)
extern int _IO_fsetpos (_IO_FILE*, const _IO_fpos_t *);
extern int _IO_fsetpos64 (_IO_FILE*, const _IO_fpos64_t *);
extern long int _IO_ftell (_IO_FILE*);
+libc_hidden_proto (_IO_ftell)
extern _IO_size_t _IO_fread (void*, _IO_size_t, _IO_size_t, _IO_FILE*);
+libc_hidden_proto (_IO_fread)
extern _IO_size_t _IO_fwrite (const void*, _IO_size_t, _IO_size_t, _IO_FILE*);
+libc_hidden_proto (_IO_fwrite)
extern char* _IO_gets (char*);
extern void _IO_perror (const char*) __THROW;
extern int _IO_printf (const char*, ...);
extern int _IO_puts (const char*);
extern int _IO_scanf (const char*, ...);
extern void _IO_setbuffer (_IO_FILE *, char*, _IO_size_t) __THROW;
+libc_hidden_proto (_IO_setbuffer)
extern int _IO_setvbuf (_IO_FILE*, char*, int, _IO_size_t) __THROW;
+libc_hidden_proto (_IO_setvbuf)
extern int _IO_sscanf (const char*, const char*, ...) __THROW;
extern int _IO_sprintf (char *, const char*, ...) __THROW;
extern int _IO_ungetc (int, _IO_FILE*) __THROW;
extern int _IO_vsscanf (const char *, const char *, _IO_va_list) __THROW;
extern int _IO_vsprintf (char*, const char*, _IO_va_list) __THROW;
+libc_hidden_proto (_IO_vsprintf)
extern int _IO_vswprintf (wchar_t*, _IO_size_t, const wchar_t*, _IO_va_list)
__THROW;
@@ -60,15 +68,15 @@ extern int _IO_obstack_printf (struct obstack *, const char *, ...) __THROW;
#define _IO_rewind(FILE) \
(void) _IO_seekoff_unlocked (FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
#define _IO_vprintf(FORMAT, ARGS) \
- INTUSE(_IO_vfprintf) (_IO_stdout, FORMAT, ARGS)
+ _IO_vfprintf (_IO_stdout, FORMAT, ARGS)
#define _IO_freopen(FILENAME, MODE, FP) \
- (INTUSE(_IO_file_close_it)(FP), \
- INTUSE(_IO_file_fopen)(FP, FILENAME, MODE, 1))
+ (_IO_file_close_it (FP), \
+ _IO_file_fopen (FP, FILENAME, MODE, 1))
#define _IO_old_freopen(FILENAME, MODE, FP) \
(_IO_old_file_close_it (FP), _IO_old_file_fopen(FP, FILENAME, MODE))
#define _IO_freopen64(FILENAME, MODE, FP) \
- (INTUSE(_IO_file_close_it)(FP), \
- INTUSE(_IO_file_fopen)(FP, FILENAME, MODE, 0))
+ (_IO_file_close_it (FP), \
+ _IO_file_fopen (FP, FILENAME, MODE, 0))
#define _IO_fileno(FP) ((FP)->_fileno)
extern _IO_FILE* _IO_popen (const char*, const char*) __THROW;
extern _IO_FILE* _IO_new_popen (const char*, const char*) __THROW;
@@ -76,25 +84,12 @@ extern _IO_FILE* _IO_old_popen (const char*, const char*) __THROW;
extern int __new_pclose (_IO_FILE *) __THROW;
extern int __old_pclose (_IO_FILE *) __THROW;
#define _IO_pclose _IO_fclose
-#define _IO_setbuf(_FP, _BUF) INTUSE(_IO_setbuffer)(_FP, _BUF, _IO_BUFSIZ)
-#define _IO_setlinebuf(_FP) INTUSE(_IO_setvbuf)(_FP, NULL, 1, 0)
+#define _IO_setbuf(_FP, _BUF) _IO_setbuffer (_FP, _BUF, _IO_BUFSIZ)
+#define _IO_setlinebuf(_FP) _IO_setvbuf (_FP, NULL, 1, 0)
_IO_FILE *__new_freopen (const char *, const char *, _IO_FILE *) __THROW;
_IO_FILE *__old_freopen (const char *, const char *, _IO_FILE *) __THROW;
-/* Prototype for functions with alternative entry point. */
-extern void _IO_setbuffer_internal (_IO_FILE *, char*, _IO_size_t) __THROW;
-extern _IO_size_t _IO_fread_internal (void*, _IO_size_t, _IO_size_t, _IO_FILE*)
- __THROW;
-extern _IO_FILE *_IO_fdopen_internal (int, const char*) __THROW;
-extern int _IO_vsprintf_internal (char*, const char*, _IO_va_list) __THROW;
-extern int _IO_fflush_internal (_IO_FILE*);
-extern _IO_size_t _IO_fwrite_internal (const void*, _IO_size_t,
- _IO_size_t, _IO_FILE*);
-extern long int _IO_ftell_internal (_IO_FILE*);
-extern int _IO_fputs_internal (const char*, _IO_FILE*);
-extern int _IO_setvbuf_internal (_IO_FILE*, char*, int, _IO_size_t) __THROW;
-
#ifdef __cplusplus
}
#endif
diff --git a/libc/libio/iopadn.c b/libc/libio/iopadn.c
index 17670ef90..7e374508f 100644
--- a/libc/libio/iopadn.c
+++ b/libc/libio/iopadn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -69,4 +69,4 @@ _IO_padn (fp, pad, count)
}
return written;
}
-INTDEF(_IO_padn)
+libc_hidden_def (_IO_padn)
diff --git a/libc/libio/iopopen.c b/libc/libio/iopopen.c
index 967473d9c..4f67e8cca 100644
--- a/libc/libio/iopopen.c
+++ b/libc/libio/iopopen.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1997-2002, 2003, 2004, 2007, 2008, 2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
@@ -300,7 +299,7 @@ _IO_new_popen (command, mode)
new_f->fpx.file.file._lock = &new_f->lock;
#endif
fp = &new_f->fpx.file.file;
- INTUSE(_IO_init) (fp, 0);
+ _IO_init (fp, 0);
_IO_JUMPS (&new_f->fpx.file) = &_IO_proc_jumps;
_IO_new_file_init (&new_f->fpx.file);
#if !_IO_UNIFIED_JUMPTABLES
@@ -308,7 +307,7 @@ _IO_new_popen (command, mode)
#endif
if (_IO_new_proc_open (fp, command, mode) != NULL)
return (_IO_FILE *) &new_f->fpx.file;
- INTUSE(_IO_un_link) (&new_f->fpx.file);
+ _IO_un_link (&new_f->fpx.file);
free (new_f);
return NULL;
}
@@ -367,20 +366,20 @@ static const struct _IO_jump_t _IO_proc_jumps = {
JUMP_INIT(finish, _IO_new_file_finish),
JUMP_INIT(overflow, _IO_new_file_overflow),
JUMP_INIT(underflow, _IO_new_file_underflow),
- JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)),
+ JUMP_INIT(uflow, _IO_default_uflow),
+ JUMP_INIT(pbackfail, _IO_default_pbackfail),
JUMP_INIT(xsputn, _IO_new_file_xsputn),
- JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)),
+ JUMP_INIT(xsgetn, _IO_default_xsgetn),
JUMP_INIT(seekoff, _IO_new_file_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_new_file_setbuf),
JUMP_INIT(sync, _IO_new_file_sync),
- JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)),
- JUMP_INIT(read, INTUSE(_IO_file_read)),
+ JUMP_INIT(doallocate, _IO_file_doallocate),
+ JUMP_INIT(read, _IO_file_read),
JUMP_INIT(write, _IO_new_file_write),
- JUMP_INIT(seek, INTUSE(_IO_file_seek)),
+ JUMP_INIT(seek, _IO_file_seek),
JUMP_INIT(close, _IO_new_proc_close),
- JUMP_INIT(stat, INTUSE(_IO_file_stat)),
+ JUMP_INIT(stat, _IO_file_stat),
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)
};
diff --git a/libc/libio/ioseekoff.c b/libc/libio/ioseekoff.c
index 974974b7b..9b9e8c4b8 100644
--- a/libc/libio/ioseekoff.c
+++ b/libc/libio/ioseekoff.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002, 2003
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -62,9 +61,9 @@ _IO_seekoff_unlocked (fp, offset, dir, mode)
abort ();
}
if (! _IO_is_wide (fp))
- INTUSE(_IO_free_backup_area) (fp);
+ _IO_free_backup_area (fp);
else
- INTUSE(_IO_free_wbackup_area) (fp);
+ _IO_free_wbackup_area (fp);
}
return _IO_SEEKOFF (fp, offset, dir, mode);
diff --git a/libc/libio/ioseekpos.c b/libc/libio/ioseekpos.c
index 5f126e259..c87a5e8f6 100644
--- a/libc/libio/ioseekpos.c
+++ b/libc/libio/ioseekpos.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1997-1999,2002,2003,2004 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,12 +38,12 @@ _IO_seekpos_unlocked (fp, pos, mode)
if (! _IO_is_wide (fp))
{
if (_IO_have_backup (fp))
- INTUSE(_IO_free_backup_area) (fp);
+ _IO_free_backup_area (fp);
}
else
{
if (_IO_have_wbackup (fp))
- INTUSE(_IO_free_wbackup_area) (fp);
+ _IO_free_wbackup_area (fp);
}
return _IO_SEEKOFF (fp, pos, 0, mode);
diff --git a/libc/libio/iosetbuffer.c b/libc/libio/iosetbuffer.c
index 1e8208150..f3cb7fbb6 100644
--- a/libc/libio/iosetbuffer.c
+++ b/libc/libio/iosetbuffer.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -48,7 +47,7 @@ _IO_setbuffer (fp, buf, size)
#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
_IO_release_lock (fp);
}
-INTDEF(_IO_setbuffer)
+libc_hidden_def (_IO_setbuffer)
#ifdef weak_alias
weak_alias (_IO_setbuffer, setbuffer)
diff --git a/libc/libio/iosetvbuf.c b/libc/libio/iosetvbuf.c
index 65248ff5e..3df9d23c8 100644
--- a/libc/libio/iosetvbuf.c
+++ b/libc/libio/iosetvbuf.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -98,7 +97,7 @@ unlock_return:
_IO_release_lock (fp);
return result;
}
-INTDEF(_IO_setvbuf)
+libc_hidden_def (_IO_setvbuf)
#ifdef weak_alias
weak_alias (_IO_setvbuf, setvbuf)
diff --git a/libc/libio/ioungetc.c b/libc/libio/ioungetc.c
index 7ba087a12..7ebd3e592 100644
--- a/libc/libio/ioungetc.c
+++ b/libc/libio/ioungetc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1996,1997,1998,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,7 +36,7 @@ _IO_ungetc (c, fp)
if (c == EOF)
return EOF;
_IO_acquire_lock (fp);
- result = INTUSE(_IO_sputbackc) (fp, (unsigned char) c);
+ result = _IO_sputbackc (fp, (unsigned char) c);
_IO_release_lock (fp);
return result;
}
diff --git a/libc/libio/ioungetwc.c b/libc/libio/ioungetwc.c
index 47d5fba83..9ee9a281d 100644
--- a/libc/libio/ioungetwc.c
+++ b/libc/libio/ioungetwc.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,7 +39,7 @@ ungetwc (c, fp)
if (c == WEOF)
result = WEOF;
else
- result = INTUSE(_IO_sputbackwc) (fp, c);
+ result = _IO_sputbackwc (fp, c);
_IO_release_lock (fp);
return result;
}
diff --git a/libc/libio/iovdprintf.c b/libc/libio/iovdprintf.c
index c6fdccdde..43dbb8783 100644
--- a/libc/libio/iovdprintf.c
+++ b/libc/libio/iovdprintf.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006, 2010
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -43,13 +42,13 @@ _IO_vdprintf (d, format, arg)
#endif
_IO_no_init (&tmpfil.file, _IO_USER_LOCK, 0, &wd, &_IO_wfile_jumps);
_IO_JUMPS (&tmpfil) = &_IO_file_jumps;
- INTUSE(_IO_file_init) (&tmpfil);
+ _IO_file_init (&tmpfil);
#if !_IO_UNIFIED_JUMPTABLES
tmpfil.vtable = NULL;
#endif
- if (INTUSE(_IO_file_attach) (&tmpfil.file, d) == NULL)
+ if (_IO_file_attach (&tmpfil.file, d) == NULL)
{
- INTUSE(_IO_un_link) (&tmpfil);
+ _IO_un_link (&tmpfil);
return EOF;
}
tmpfil.file._flags |= _IO_DELETE_DONT_CLOSE;
@@ -57,7 +56,7 @@ _IO_vdprintf (d, format, arg)
_IO_mask_flags (&tmpfil.file, _IO_NO_READS,
_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
- done = INTUSE(_IO_vfprintf) (&tmpfil.file, format, arg);
+ done = _IO_vfprintf (&tmpfil.file, format, arg);
if (done != EOF && _IO_do_flush (&tmpfil.file) == EOF)
done = EOF;
diff --git a/libc/libio/iovsprintf.c b/libc/libio/iovsprintf.c
index f5a2fc1fa..f50b96189 100644
--- a/libc/libio/iovsprintf.c
+++ b/libc/libio/iovsprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2003, 2006, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,11 +39,11 @@ __IO_vsprintf (char *string, const char *format, _IO_va_list args)
_IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, string, -1, string);
- ret = INTUSE(_IO_vfprintf) (&sf._sbf._f, format, args);
+ ret = _IO_vfprintf (&sf._sbf._f, format, args);
_IO_putc_unlocked ('\0', &sf._sbf._f);
return ret;
}
-INTDEF2(__IO_vsprintf, _IO_vsprintf)
+ldbl_hidden_def (__IO_vsprintf, _IO_vsprintf)
ldbl_strong_alias (__IO_vsprintf, _IO_vsprintf)
ldbl_weak_alias (__IO_vsprintf, vsprintf)
diff --git a/libc/libio/iovsscanf.c b/libc/libio/iovsscanf.c
index 8afc5003a..2ae586cd8 100644
--- a/libc/libio/iovsscanf.c
+++ b/libc/libio/iovsscanf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2003, 2006, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -41,7 +41,7 @@ _IO_vsscanf (string, format, args)
_IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, (char*)string, 0, NULL);
- ret = INTUSE(_IO_vfscanf) (&sf._sbf._f, format, args, NULL);
+ ret = _IO_vfscanf (&sf._sbf._f, format, args, NULL);
return ret;
}
ldbl_weak_alias (_IO_vsscanf, __vsscanf)
diff --git a/libc/libio/libioP.h b/libc/libio/libioP.h
index 6f492cc17..4138e2aff 100644
--- a/libc/libio/libioP.h
+++ b/libc/libio/libioP.h
@@ -45,15 +45,6 @@
/* Control of exported symbols. Used in glibc. By default we don't
do anything. */
-#ifndef INTUSE
-# define INTUSE(name) name
-#endif
-#ifndef INTDEF
-# define INTDEF(name)
-#endif
-#ifndef INTDEF2
-# define INTDEF2(name)
-#endif
#ifndef libc_hidden_proto
# define libc_hidden_proto(name)
#endif
@@ -384,24 +375,41 @@ typedef struct _IO_FILE *_IO_ITER;
extern void _IO_switch_to_main_get_area (_IO_FILE *) __THROW;
extern void _IO_switch_to_backup_area (_IO_FILE *) __THROW;
extern int _IO_switch_to_get_mode (_IO_FILE *);
+libc_hidden_proto (_IO_switch_to_get_mode)
extern void _IO_init (_IO_FILE *, int) __THROW;
+libc_hidden_proto (_IO_init)
extern int _IO_sputbackc (_IO_FILE *, int) __THROW;
+libc_hidden_proto (_IO_sputbackc)
extern int _IO_sungetc (_IO_FILE *) __THROW;
extern void _IO_un_link (struct _IO_FILE_plus *) __THROW;
+libc_hidden_proto (_IO_un_link)
extern void _IO_link_in (struct _IO_FILE_plus *) __THROW;
+libc_hidden_proto (_IO_link_in)
extern void _IO_doallocbuf (_IO_FILE *) __THROW;
+libc_hidden_proto (_IO_doallocbuf)
extern void _IO_unsave_markers (_IO_FILE *) __THROW;
+libc_hidden_proto (_IO_unsave_markers)
extern void _IO_setb (_IO_FILE *, char *, char *, int) __THROW;
+libc_hidden_proto (_IO_setb)
extern unsigned _IO_adjust_column (unsigned, const char *, int) __THROW;
+libc_hidden_proto (_IO_adjust_column)
#define _IO_sputn(__fp, __s, __n) _IO_XSPUTN (__fp, __s, __n)
+_IO_ssize_t _IO_least_wmarker (_IO_FILE *, wchar_t *) __THROW;
+libc_hidden_proto (_IO_least_wmarker)
extern void _IO_switch_to_main_wget_area (_IO_FILE *) __THROW;
+libc_hidden_proto (_IO_switch_to_main_wget_area)
extern void _IO_switch_to_wbackup_area (_IO_FILE *) __THROW;
+libc_hidden_proto (_IO_switch_to_wbackup_area)
extern int _IO_switch_to_wget_mode (_IO_FILE *);
+libc_hidden_proto (_IO_switch_to_wget_mode)
extern void _IO_wsetb (_IO_FILE *, wchar_t *, wchar_t *, int) __THROW;
+libc_hidden_proto (_IO_wsetb)
extern wint_t _IO_sputbackwc (_IO_FILE *, wint_t) __THROW;
+libc_hidden_proto (_IO_sputbackwc)
extern wint_t _IO_sungetwc (_IO_FILE *) __THROW;
extern void _IO_wdoallocbuf (_IO_FILE *) __THROW;
+libc_hidden_proto (_IO_wdoallocbuf)
extern void _IO_unsave_wmarkers (_IO_FILE *) __THROW;
extern unsigned _IO_adjust_wcolumn (unsigned, const wchar_t *, int) __THROW;
@@ -438,18 +446,30 @@ libc_hidden_proto (_IO_list_resetlock)
extern int _IO_default_underflow (_IO_FILE *) __THROW;
extern int _IO_default_uflow (_IO_FILE *);
+libc_hidden_proto (_IO_default_uflow)
extern wint_t _IO_wdefault_uflow (_IO_FILE *);
+libc_hidden_proto (_IO_wdefault_uflow)
extern int _IO_default_doallocate (_IO_FILE *) __THROW;
+libc_hidden_proto (_IO_default_doallocate)
extern int _IO_wdefault_doallocate (_IO_FILE *) __THROW;
+libc_hidden_proto (_IO_wdefault_doallocate)
extern void _IO_default_finish (_IO_FILE *, int) __THROW;
+libc_hidden_proto (_IO_default_finish)
extern void _IO_wdefault_finish (_IO_FILE *, int) __THROW;
+libc_hidden_proto (_IO_wdefault_finish)
extern int _IO_default_pbackfail (_IO_FILE *, int) __THROW;
+libc_hidden_proto (_IO_default_pbackfail)
extern wint_t _IO_wdefault_pbackfail (_IO_FILE *, wint_t) __THROW;
+libc_hidden_proto (_IO_wdefault_pbackfail)
extern _IO_FILE* _IO_default_setbuf (_IO_FILE *, char *, _IO_ssize_t);
extern _IO_size_t _IO_default_xsputn (_IO_FILE *, const void *, _IO_size_t);
+libc_hidden_proto (_IO_default_xsputn)
extern _IO_size_t _IO_wdefault_xsputn (_IO_FILE *, const void *, _IO_size_t);
+libc_hidden_proto (_IO_wdefault_xsputn)
extern _IO_size_t _IO_default_xsgetn (_IO_FILE *, void *, _IO_size_t);
+libc_hidden_proto (_IO_default_xsgetn)
extern _IO_size_t _IO_wdefault_xsgetn (_IO_FILE *, void *, _IO_size_t);
+libc_hidden_proto (_IO_wdefault_xsgetn)
extern _IO_off64_t _IO_default_seekoff (_IO_FILE *, _IO_off64_t, int, int)
__THROW;
extern _IO_off64_t _IO_default_seekpos (_IO_FILE *, _IO_off64_t, int);
@@ -477,13 +497,17 @@ extern const struct _IO_jump_t _IO_str_jumps attribute_hidden;
extern const struct _IO_jump_t _IO_wstr_jumps attribute_hidden;
extern const struct _IO_codecvt __libio_codecvt attribute_hidden;
extern int _IO_do_write (_IO_FILE *, const char *, _IO_size_t);
+libc_hidden_proto (_IO_do_write)
extern int _IO_new_do_write (_IO_FILE *, const char *, _IO_size_t);
extern int _IO_old_do_write (_IO_FILE *, const char *, _IO_size_t);
extern int _IO_wdo_write (_IO_FILE *, const wchar_t *, _IO_size_t);
+libc_hidden_proto (_IO_wdo_write)
extern int _IO_flush_all_lockp (int);
extern int _IO_flush_all (void);
+libc_hidden_proto (_IO_flush_all)
extern int _IO_cleanup (void);
extern void _IO_flush_all_linebuffered (void);
+libc_hidden_proto (_IO_flush_all_linebuffered)
extern int _IO_new_fgetpos (_IO_FILE *, _IO_fpos_t *);
extern int _IO_old_fgetpos (_IO_FILE *, _IO_fpos_t *);
extern int _IO_new_fsetpos (_IO_FILE *, const _IO_fpos_t *);
@@ -510,15 +534,15 @@ extern void _IO_old_init (_IO_FILE *fp, int flags) __THROW;
# define _IO_do_flush(_f) \
(! _IO_is_wide (_f) \
- ? INTUSE(_IO_do_write)(_f, (_f)->_IO_write_base, \
- (_f)->_IO_write_ptr-(_f)->_IO_write_base) \
- : INTUSE(_IO_wdo_write)(_f, (_f)->_wide_data->_IO_write_base, \
- ((_f)->_wide_data->_IO_write_ptr \
- - (_f)->_wide_data->_IO_write_base)))
+ ? _IO_do_write(_f, (_f)->_IO_write_base, \
+ (_f)->_IO_write_ptr-(_f)->_IO_write_base) \
+ : _IO_wdo_write(_f, (_f)->_wide_data->_IO_write_base, \
+ ((_f)->_wide_data->_IO_write_ptr \
+ - (_f)->_wide_data->_IO_write_base)))
#else
# define _IO_do_flush(_f) \
- INTUSE(_IO_do_write)(_f, (_f)->_IO_write_base, \
- (_f)->_IO_write_ptr-(_f)->_IO_write_base)
+ _IO_do_write(_f, (_f)->_IO_write_base, \
+ (_f)->_IO_write_ptr-(_f)->_IO_write_base)
#endif
#define _IO_old_do_flush(_f) \
_IO_old_do_write(_f, (_f)->_IO_write_base, \
@@ -549,31 +573,48 @@ extern void _IO_old_init (_IO_FILE *fp, int flags) __THROW;
/* Jumptable functions for files. */
extern int _IO_file_doallocate (_IO_FILE *) __THROW;
+libc_hidden_proto (_IO_file_doallocate)
extern _IO_FILE* _IO_file_setbuf (_IO_FILE *, char *, _IO_ssize_t);
+libc_hidden_proto (_IO_file_setbuf)
extern _IO_off64_t _IO_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);
+libc_hidden_proto (_IO_file_seekoff)
extern _IO_off64_t _IO_file_seekoff_mmap (_IO_FILE *, _IO_off64_t, int, int)
__THROW;
extern _IO_size_t _IO_file_xsputn (_IO_FILE *, const void *, _IO_size_t);
+libc_hidden_proto (_IO_file_xsputn)
extern _IO_size_t _IO_file_xsgetn (_IO_FILE *, void *, _IO_size_t);
+libc_hidden_proto (_IO_file_xsgetn)
extern int _IO_file_stat (_IO_FILE *, void *) __THROW;
+libc_hidden_proto (_IO_file_stat)
extern int _IO_file_close (_IO_FILE *) __THROW;
+libc_hidden_proto (_IO_file_close)
extern int _IO_file_close_mmap (_IO_FILE *) __THROW;
extern int _IO_file_underflow (_IO_FILE *);
+libc_hidden_proto (_IO_file_underflow)
extern int _IO_file_underflow_mmap (_IO_FILE *);
extern int _IO_file_underflow_maybe_mmap (_IO_FILE *);
extern int _IO_file_overflow (_IO_FILE *, int);
+libc_hidden_proto (_IO_file_overflow)
#define _IO_file_is_open(__fp) ((__fp)->_fileno != -1)
extern void _IO_file_init (struct _IO_FILE_plus *) __THROW;
+libc_hidden_proto (_IO_file_init)
extern _IO_FILE* _IO_file_attach (_IO_FILE *, int);
+libc_hidden_proto (_IO_file_attach)
extern _IO_FILE* _IO_file_open (_IO_FILE *, const char *, int, int, int, int);
libc_hidden_proto (_IO_file_open)
extern _IO_FILE* _IO_file_fopen (_IO_FILE *, const char *, const char *, int);
+libc_hidden_proto (_IO_file_fopen)
extern _IO_ssize_t _IO_file_write (_IO_FILE *, const void *, _IO_ssize_t);
extern _IO_ssize_t _IO_file_read (_IO_FILE *, void *, _IO_ssize_t);
+libc_hidden_proto (_IO_file_read)
extern int _IO_file_sync (_IO_FILE *);
+libc_hidden_proto (_IO_file_sync)
extern int _IO_file_close_it (_IO_FILE *);
+libc_hidden_proto (_IO_file_close_it)
extern _IO_off64_t _IO_file_seek (_IO_FILE *, _IO_off64_t, int) __THROW;
+libc_hidden_proto (_IO_file_seek)
extern void _IO_file_finish (_IO_FILE *, int);
+libc_hidden_proto (_IO_file_finish)
extern _IO_FILE* _IO_new_file_attach (_IO_FILE *, int);
extern int _IO_new_file_close_it (_IO_FILE *);
@@ -607,11 +648,16 @@ extern void _IO_old_file_finish (_IO_FILE *, int);
extern int _IO_wfile_doallocate (_IO_FILE *) __THROW;
extern _IO_size_t _IO_wfile_xsputn (_IO_FILE *, const void *, _IO_size_t);
+libc_hidden_proto (_IO_wfile_xsputn)
extern _IO_FILE* _IO_wfile_setbuf (_IO_FILE *, wchar_t *, _IO_ssize_t);
extern wint_t _IO_wfile_sync (_IO_FILE *);
+libc_hidden_proto (_IO_wfile_sync)
extern wint_t _IO_wfile_underflow (_IO_FILE *);
+libc_hidden_proto (_IO_wfile_underflow)
extern wint_t _IO_wfile_overflow (_IO_FILE *, wint_t);
+libc_hidden_proto (_IO_wfile_overflow)
extern _IO_off64_t _IO_wfile_seekoff (_IO_FILE *, _IO_off64_t, int, int);
+libc_hidden_proto (_IO_wfile_seekoff)
/* Jumptable functions for proc_files. */
extern _IO_FILE* _IO_proc_open (_IO_FILE *, const char *, const char *)
@@ -625,9 +671,13 @@ extern int _IO_old_proc_close (_IO_FILE *);
/* Jumptable functions for strfiles. */
extern int _IO_str_underflow (_IO_FILE *) __THROW;
+libc_hidden_proto (_IO_str_underflow)
extern int _IO_str_overflow (_IO_FILE *, int) __THROW;
+libc_hidden_proto (_IO_str_overflow)
extern int _IO_str_pbackfail (_IO_FILE *, int) __THROW;
+libc_hidden_proto (_IO_str_pbackfail)
extern _IO_off64_t _IO_str_seekoff (_IO_FILE *, _IO_off64_t, int, int) __THROW;
+libc_hidden_proto (_IO_str_seekoff)
extern void _IO_str_finish (_IO_FILE *, int) __THROW;
/* Other strfile functions */
@@ -657,115 +707,25 @@ extern int _IO_vsnprintf (char *string, _IO_size_t maxlen,
extern _IO_size_t _IO_getline (_IO_FILE *,char *, _IO_size_t, int, int);
+libc_hidden_proto (_IO_getline)
extern _IO_size_t _IO_getline_info (_IO_FILE *,char *, _IO_size_t,
int, int, int *);
+libc_hidden_proto (_IO_getline_info)
extern _IO_ssize_t _IO_getdelim (char **, _IO_size_t *, int, _IO_FILE *);
extern _IO_size_t _IO_getwline (_IO_FILE *,wchar_t *, _IO_size_t, wint_t, int);
extern _IO_size_t _IO_getwline_info (_IO_FILE *,wchar_t *, _IO_size_t,
wint_t, int, wint_t *);
extern struct _IO_FILE_plus *_IO_list_all;
+libc_hidden_proto (_IO_list_all)
extern void (*_IO_cleanup_registration_needed) (void);
-/* Prototype for functions with alternative entry point. */
-extern int _IO_flush_all_internal (void);
-extern unsigned _IO_adjust_column_internal (unsigned, const char *, int);
-
-extern int _IO_default_uflow_internal (_IO_FILE *);
-extern void _IO_default_finish_internal (_IO_FILE *, int) __THROW;
-extern int _IO_default_pbackfail_internal (_IO_FILE *, int) __THROW;
-extern _IO_size_t _IO_default_xsputn_internal (_IO_FILE *, const void *,
- _IO_size_t);
-extern _IO_size_t _IO_default_xsgetn_internal (_IO_FILE *, void *, _IO_size_t);
-extern int _IO_default_doallocate_internal (_IO_FILE *) __THROW;
-extern void _IO_wdefault_finish_internal (_IO_FILE *, int) __THROW;
-extern wint_t _IO_wdefault_pbackfail_internal (_IO_FILE *, wint_t) __THROW;
-extern _IO_size_t _IO_wdefault_xsputn_internal (_IO_FILE *, const void *,
- _IO_size_t);
-extern _IO_size_t _IO_wdefault_xsgetn_internal (_IO_FILE *, void *,
- _IO_size_t);
-extern int _IO_wdefault_doallocate_internal (_IO_FILE *) __THROW;
-extern wint_t _IO_wdefault_uflow_internal (_IO_FILE *);
-
-extern int _IO_file_doallocate_internal (_IO_FILE *) __THROW;
-extern _IO_FILE* _IO_file_setbuf_internal (_IO_FILE *, char *, _IO_ssize_t);
-extern _IO_off64_t _IO_file_seekoff_internal (_IO_FILE *, _IO_off64_t,
- int, int);
-extern _IO_size_t _IO_file_xsputn_internal (_IO_FILE *, const void *,
- _IO_size_t);
-extern _IO_size_t _IO_file_xsgetn_internal (_IO_FILE *, void *, _IO_size_t);
-extern int _IO_file_stat_internal (_IO_FILE *, void *) __THROW;
-extern int _IO_file_close_internal (_IO_FILE *) __THROW;
-extern int _IO_file_close_it_internal (_IO_FILE *);
-extern int _IO_file_underflow_internal (_IO_FILE *);
-extern int _IO_file_overflow_internal (_IO_FILE *, int);
-extern void _IO_file_init_internal (struct _IO_FILE_plus *) __THROW;
-extern _IO_FILE* _IO_file_attach_internal (_IO_FILE *, int);
-extern _IO_FILE* _IO_file_fopen_internal (_IO_FILE *, const char *,
- const char *, int);
-extern _IO_ssize_t _IO_file_read_internal (_IO_FILE *, void *,
- _IO_ssize_t);
-extern int _IO_file_sync_internal (_IO_FILE *);
-extern _IO_off64_t _IO_file_seek_internal (_IO_FILE *, _IO_off64_t, int)
- __THROW;
-extern void _IO_file_finish_internal (_IO_FILE *, int);
-
-extern _IO_size_t _IO_wfile_xsputn_internal (_IO_FILE *, const void *,
- _IO_size_t);
-extern _IO_off64_t _IO_wfile_seekoff_internal (_IO_FILE *, _IO_off64_t,
- int, int);
-extern wint_t _IO_wfile_sync_internal (_IO_FILE *);
-
-extern int _IO_str_underflow_internal (_IO_FILE *) __THROW;
-extern int _IO_str_overflow_internal (_IO_FILE *, int) __THROW;
-extern int _IO_str_pbackfail_internal (_IO_FILE *, int) __THROW;
-extern _IO_off64_t _IO_str_seekoff_internal (_IO_FILE *, _IO_off64_t,
- int, int) __THROW;
extern void _IO_str_init_static_internal (struct _IO_strfile_ *, char *,
_IO_size_t, char *) __THROW;
-
-extern struct _IO_jump_t _IO_file_jumps_internal attribute_hidden;
-extern struct _IO_jump_t _IO_wfile_jumps_internal attribute_hidden;
-
-extern struct _IO_FILE_plus *_IO_list_all_internal attribute_hidden;
-
-extern void _IO_link_in_internal (struct _IO_FILE_plus *) __THROW;
-extern int _IO_sputbackc_internal (_IO_FILE *, int) __THROW;
-extern void _IO_wdoallocbuf_internal (_IO_FILE *) __THROW;
-
-extern _IO_size_t _IO_sgetn_internal (_IO_FILE *, void *, _IO_size_t);
-extern void _IO_flush_all_linebuffered_internal (void) __THROW;
-extern int _IO_switch_to_wget_mode_internal (_IO_FILE *);
-extern void _IO_unsave_markers_internal (_IO_FILE *) __THROW;
-extern void _IO_switch_to_main_wget_area_internal (_IO_FILE *) __THROW;
-extern int _IO_wdo_write_internal (_IO_FILE *, const wchar_t *, _IO_size_t);
-extern int _IO_do_write_internal (_IO_FILE *, const char *, _IO_size_t);
-extern _IO_ssize_t _IO_padn_internal (_IO_FILE *, int, _IO_ssize_t);
-extern _IO_size_t _IO_getline_info_internal (_IO_FILE *,char *, _IO_size_t,
- int, int, int *);
-extern _IO_size_t _IO_getline_internal (_IO_FILE *, char *, _IO_size_t, int,
- int);
-extern void _IO_free_wbackup_area_internal (_IO_FILE *) __THROW;
-extern void _IO_free_backup_area_internal (_IO_FILE *) __THROW;
-extern void _IO_switch_to_wbackup_area_internal (_IO_FILE *) __THROW;
-extern void _IO_setb_internal (_IO_FILE *, char *, char *, int) __THROW;
-extern wint_t _IO_sputbackwc_internal (_IO_FILE *, wint_t) __THROW;
-extern int _IO_switch_to_get_mode_internal (_IO_FILE *);
-extern int _IO_vfscanf_internal (_IO_FILE * __restrict,
- const char * __restrict,
- _IO_va_list, int *__restrict);
-extern int _IO_vfprintf_internal (_IO_FILE *__restrict, const char *__restrict,
- _IO_va_list);
-extern void _IO_doallocbuf_internal (_IO_FILE *) __THROW;
-extern void _IO_wsetb_internal (_IO_FILE *, wchar_t *, wchar_t *, int)
- __THROW;
extern _IO_off64_t _IO_seekoff_unlocked (_IO_FILE *, _IO_off64_t, int, int)
attribute_hidden;
extern _IO_off64_t _IO_seekpos_unlocked (_IO_FILE *, _IO_off64_t, int)
attribute_hidden;
-extern int _IO_putc_internal (int __c, _IO_FILE *__fp);
-extern void _IO_init_internal (_IO_FILE *, int) __THROW;
-extern void _IO_un_link_internal (struct _IO_FILE_plus *) __THROW;
#ifndef EOF
# define EOF (-1)
diff --git a/libc/libio/memstream.c b/libc/libio/memstream.c
index bbdc5ba48..37bbbfcca 100644
--- a/libc/libio/memstream.c
+++ b/libc/libio/memstream.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-97,99,2000,2002-2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,17 +37,17 @@ static const struct _IO_jump_t _IO_mem_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT (finish, _IO_mem_finish),
- JUMP_INIT (overflow, INTUSE(_IO_str_overflow)),
- JUMP_INIT (underflow, INTUSE(_IO_str_underflow)),
- JUMP_INIT (uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT (pbackfail, INTUSE(_IO_str_pbackfail)),
- JUMP_INIT (xsputn, INTUSE(_IO_default_xsputn)),
- JUMP_INIT (xsgetn, INTUSE(_IO_default_xsgetn)),
- JUMP_INIT (seekoff, INTUSE(_IO_str_seekoff)),
+ JUMP_INIT (overflow, _IO_str_overflow),
+ JUMP_INIT (underflow, _IO_str_underflow),
+ JUMP_INIT (uflow, _IO_default_uflow),
+ JUMP_INIT (pbackfail, _IO_str_pbackfail),
+ JUMP_INIT (xsputn, _IO_default_xsputn),
+ JUMP_INIT (xsgetn, _IO_default_xsgetn),
+ JUMP_INIT (seekoff, _IO_str_seekoff),
JUMP_INIT (seekpos, _IO_default_seekpos),
JUMP_INIT (setbuf, _IO_default_setbuf),
JUMP_INIT (sync, _IO_mem_sync),
- JUMP_INIT (doallocate, INTUSE(_IO_default_doallocate)),
+ JUMP_INIT (doallocate, _IO_default_doallocate),
JUMP_INIT (read, _IO_default_read),
JUMP_INIT (write, _IO_default_write),
JUMP_INIT (seek, _IO_default_seek),
@@ -85,7 +85,7 @@ open_memstream (bufloc, sizeloc)
buf = calloc (1, _IO_BUFSIZ);
if (buf == NULL)
return NULL;
- INTUSE(_IO_init) (&new_f->fp._sf._sbf._f, 0);
+ _IO_init (&new_f->fp._sf._sbf._f, 0);
_IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fp._sf._sbf) = &_IO_mem_jumps;
_IO_str_init_static_internal (&new_f->fp._sf, buf, _IO_BUFSIZ, buf);
new_f->fp._sf._sbf._f._flags &= ~_IO_USER_BUF;
@@ -108,7 +108,7 @@ _IO_mem_sync (fp)
if (fp->_IO_write_ptr == fp->_IO_write_end)
{
- INTUSE(_IO_str_overflow) (fp, '\0');
+ _IO_str_overflow (fp, '\0');
--fp->_IO_write_ptr;
}
else
diff --git a/libc/libio/obprintf.c b/libc/libio/obprintf.c
index f2f93b2b2..ef2cfc32e 100644
--- a/libc/libio/obprintf.c
+++ b/libc/libio/obprintf.c
@@ -1,6 +1,5 @@
/* Print output of stream to given obstack.
- Copyright (C) 1996,1997,1999,2000,2001,2002,2003,2004,2005,2006,2008,2012
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -165,7 +164,7 @@ _IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
new_f.ofile.obstack = obstack;
- result = INTUSE(_IO_vfprintf) (&new_f.ofile.file.file, format, args);
+ result = _IO_vfprintf (&new_f.ofile.file.file, format, args);
/* Shrink the buffer to the space we really currently need. */
obstack_blank_fast (obstack, (new_f.ofile.file.file._IO_write_ptr
diff --git a/libc/libio/oldfileops.c b/libc/libio/oldfileops.c
index 6e25b5e0a..c68ca6a76 100644
--- a/libc/libio/oldfileops.c
+++ b/libc/libio/oldfileops.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997-2004, 2005, 2007, 2011-2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
@@ -123,7 +122,7 @@ _IO_old_file_init (fp)
fp->file._old_offset = _IO_pos_BAD;
fp->file._IO_file_flags |= CLOSED_FILEBUF_FLAGS;
- INTUSE(_IO_link_in) (fp);
+ _IO_link_in (fp);
fp->file._vtable_offset = ((int) sizeof (struct _IO_FILE)
- (int) sizeof (struct _IO_FILE_complete));
fp->file._fileno = -1;
@@ -150,17 +149,17 @@ _IO_old_file_close_it (fp)
write_status = _IO_old_do_flush (fp);
- INTUSE(_IO_unsave_markers) (fp);
+ _IO_unsave_markers (fp);
close_status = ((fp->_flags2 & _IO_FLAGS2_NOCLOSE) == 0
? _IO_SYSCLOSE (fp) : 0);
/* Free buffer. */
- INTUSE(_IO_setb) (fp, NULL, NULL, 0);
+ _IO_setb (fp, NULL, NULL, 0);
_IO_setg (fp, NULL, NULL, NULL);
_IO_setp (fp, NULL, NULL);
- INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
+ _IO_un_link ((struct _IO_FILE_plus *) fp);
fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;
fp->_fileno = -1;
fp->_old_offset = _IO_pos_BAD;
@@ -180,7 +179,7 @@ _IO_old_file_finish (fp, dummy)
if (!(fp->_flags & _IO_DELETE_DONT_CLOSE))
_IO_SYSCLOSE (fp);
}
- INTUSE(_IO_default_finish) (fp, 0);
+ _IO_default_finish (fp, 0);
}
_IO_FILE *
@@ -229,7 +228,7 @@ _IO_old_file_fopen (fp, filename, mode)
if (_IO_SEEKOFF (fp, (_IO_off_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
== _IO_pos_BAD && errno != ESPIPE)
return NULL;
- INTUSE(_IO_link_in) ((struct _IO_FILE_plus *) fp);
+ _IO_link_in ((struct _IO_FILE_plus *) fp);
return fp;
}
@@ -311,8 +310,7 @@ old_do_write (fp, data, to_do)
}
count = _IO_SYSWRITE (fp, data, to_do);
if (fp->_cur_column && count)
- fp->_cur_column = INTUSE(_IO_adjust_column) (fp->_cur_column - 1, data,
- count) + 1;
+ fp->_cur_column = _IO_adjust_column (fp->_cur_column - 1, data, count) + 1;
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_buf_base;
fp->_IO_write_end = ((fp->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
@@ -349,15 +347,15 @@ _IO_old_file_underflow (fp)
free (fp->_IO_save_base);
fp->_flags &= ~_IO_IN_BACKUP;
}
- INTUSE(_IO_doallocbuf) (fp);
+ _IO_doallocbuf (fp);
}
/* Flush all line buffered files before reading. */
/* FIXME This can/should be moved to genops ?? */
if (fp->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED))
- INTUSE(_IO_flush_all_linebuffered) ();
+ _IO_flush_all_linebuffered ();
- INTUSE(_IO_switch_to_get_mode) (fp);
+ _IO_switch_to_get_mode (fp);
/* This is very tricky. We have to adjust those
pointers before we call _IO_SYSREAD () since
@@ -403,7 +401,7 @@ _IO_old_file_overflow (f, ch)
/* Allocate a buffer if needed. */
if (f->_IO_write_base == 0)
{
- INTUSE(_IO_doallocbuf) (f);
+ _IO_doallocbuf (f);
_IO_setg (f, f->_IO_buf_base, f->_IO_buf_base, f->_IO_buf_base);
}
/* Otherwise must be currently reading.
@@ -500,7 +498,7 @@ _IO_old_file_seekoff (fp, offset, dir, mode)
FIXME: simulate mem-papped files. */
if (fp->_IO_write_ptr > fp->_IO_write_base || _IO_in_put_mode (fp))
- if (INTUSE(_IO_switch_to_get_mode) (fp))
+ if (_IO_switch_to_get_mode (fp))
return EOF;
if (fp->_IO_buf_base == NULL)
@@ -511,7 +509,7 @@ _IO_old_file_seekoff (fp, offset, dir, mode)
free (fp->_IO_read_base);
fp->_flags &= ~_IO_IN_BACKUP;
}
- INTUSE(_IO_doallocbuf) (fp);
+ _IO_doallocbuf (fp);
_IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
}
@@ -597,7 +595,7 @@ _IO_old_file_seekoff (fp, offset, dir, mode)
}
#ifdef TODO
- INTUSE(_IO_unsave_markers) (fp);
+ _IO_unsave_markers (fp);
#endif
if (fp->_flags & _IO_NO_READS)
@@ -637,7 +635,7 @@ _IO_old_file_seekoff (fp, offset, dir, mode)
return offset;
dumb:
- INTUSE(_IO_unsave_markers) (fp);
+ _IO_unsave_markers (fp);
result = _IO_SYSSEEK (fp, offset, dir);
if (result != EOF)
{
@@ -772,7 +770,7 @@ _IO_old_file_xsputn (f, data, n)
buffer, but it's somewhat messier for line-buffered files,
so we let _IO_default_xsputn handle the general case. */
if (to_do)
- to_do -= INTUSE(_IO_default_xsputn) (f, s+do_write, to_do);
+ to_do -= _IO_default_xsputn (f, s+do_write, to_do);
}
return n - to_do;
}
@@ -784,20 +782,20 @@ const struct _IO_jump_t _IO_old_file_jumps =
JUMP_INIT(finish, _IO_old_file_finish),
JUMP_INIT(overflow, _IO_old_file_overflow),
JUMP_INIT(underflow, _IO_old_file_underflow),
- JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)),
+ JUMP_INIT(uflow, _IO_default_uflow),
+ JUMP_INIT(pbackfail, _IO_default_pbackfail),
JUMP_INIT(xsputn, _IO_old_file_xsputn),
- JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)),
+ JUMP_INIT(xsgetn, _IO_default_xsgetn),
JUMP_INIT(seekoff, _IO_old_file_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_old_file_setbuf),
JUMP_INIT(sync, _IO_old_file_sync),
- JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)),
- JUMP_INIT(read, INTUSE(_IO_file_read)),
+ JUMP_INIT(doallocate, _IO_file_doallocate),
+ JUMP_INIT(read, _IO_file_read),
JUMP_INIT(write, _IO_old_file_write),
- JUMP_INIT(seek, INTUSE(_IO_file_seek)),
- JUMP_INIT(close, INTUSE(_IO_file_close)),
- JUMP_INIT(stat, INTUSE(_IO_file_stat))
+ JUMP_INIT(seek, _IO_file_seek),
+ JUMP_INIT(close, _IO_file_close),
+ JUMP_INIT(stat, _IO_file_stat)
};
compat_symbol (libc, _IO_old_do_write, _IO_do_write, GLIBC_2_0);
diff --git a/libc/libio/oldiofclose.c b/libc/libio/oldiofclose.c
index 1ce2cd4be..ff2e1d9cf 100644
--- a/libc/libio/oldiofclose.c
+++ b/libc/libio/oldiofclose.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,1995,1997-2002,2004,2005,2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -49,7 +48,7 @@ _IO_old_fclose (fp)
/* First unlink the stream. */
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
- INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
+ _IO_un_link ((struct _IO_FILE_plus *) fp);
_IO_acquire_lock (fp);
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
@@ -59,7 +58,7 @@ _IO_old_fclose (fp)
_IO_release_lock (fp);
_IO_FINISH (fp);
if (_IO_have_backup (fp))
- INTUSE(_IO_free_backup_area) (fp);
+ _IO_free_backup_area (fp);
if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
{
fp->_IO_file_flags = 0;
diff --git a/libc/libio/oldiofdopen.c b/libc/libio/oldiofdopen.c
index 50fcf3319..d692e30f8 100644
--- a/libc/libio/oldiofdopen.c
+++ b/libc/libio/oldiofdopen.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,94,97,99,2000,2002,2003,2004,2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -121,7 +120,7 @@ _IO_old_fdopen (fd, mode)
#endif
if (_IO_old_file_attach (&new_f->fp.file._file, fd) == NULL)
{
- INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) &new_f->fp);
+ _IO_un_link ((struct _IO_FILE_plus *) &new_f->fp);
free (new_f);
return NULL;
}
diff --git a/libc/libio/oldiofopen.c b/libc/libio/oldiofopen.c
index 417bc2c94..716b5cdc1 100644
--- a/libc/libio/oldiofopen.c
+++ b/libc/libio/oldiofopen.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,1997,1999,2000,2002,2003,2004,2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -60,7 +59,7 @@ _IO_old_fopen (filename, mode)
#endif
if (_IO_old_file_fopen ((_IO_FILE *) &new_f->fp, filename, mode) != NULL)
return (_IO_FILE *) &new_f->fp;
- INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) &new_f->fp);
+ _IO_un_link ((struct _IO_FILE_plus *) &new_f->fp);
free (new_f);
return NULL;
}
diff --git a/libc/libio/oldiopopen.c b/libc/libio/oldiopopen.c
index 5d808cb61..e14961ad8 100644
--- a/libc/libio/oldiopopen.c
+++ b/libc/libio/oldiopopen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2002, 2004, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@cygnus.com>.
@@ -229,7 +229,7 @@ _IO_old_popen (command, mode)
#endif
if (_IO_old_proc_open (fp, command, mode) != NULL)
return fp;
- INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) &new_f->fpx.file);
+ _IO_un_link ((struct _IO_FILE_plus *) &new_f->fpx.file);
free (new_f);
return NULL;
}
@@ -289,20 +289,20 @@ const struct _IO_jump_t _IO_old_proc_jumps = {
JUMP_INIT(finish, _IO_old_file_finish),
JUMP_INIT(overflow, _IO_old_file_overflow),
JUMP_INIT(underflow, _IO_old_file_underflow),
- JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT(pbackfail, INTUSE(_IO_default_pbackfail)),
+ JUMP_INIT(uflow, _IO_default_uflow),
+ JUMP_INIT(pbackfail, _IO_default_pbackfail),
JUMP_INIT(xsputn, _IO_old_file_xsputn),
- JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)),
+ JUMP_INIT(xsgetn, _IO_default_xsgetn),
JUMP_INIT(seekoff, _IO_old_file_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_old_file_setbuf),
JUMP_INIT(sync, _IO_old_file_sync),
- JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)),
- JUMP_INIT(read, INTUSE(_IO_file_read)),
+ JUMP_INIT(doallocate, _IO_file_doallocate),
+ JUMP_INIT(read, _IO_file_read),
JUMP_INIT(write, _IO_old_file_write),
- JUMP_INIT(seek, INTUSE(_IO_file_seek)),
+ JUMP_INIT(seek, _IO_file_seek),
JUMP_INIT(close, _IO_old_proc_close),
- JUMP_INIT(stat, INTUSE(_IO_file_stat)),
+ JUMP_INIT(stat, _IO_file_stat),
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)
};
diff --git a/libc/libio/oldstdfiles.c b/libc/libio/oldstdfiles.c
index a2d77d136..5a67d73e2 100644
--- a/libc/libio/oldstdfiles.c
+++ b/libc/libio/oldstdfiles.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,94,96,97,99,2000,2002,2004 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -81,7 +81,7 @@ _IO_check_libio ()
_IO_stdin = stdin = (_IO_FILE *) &_IO_stdin_;
_IO_stdout = stdout = (_IO_FILE *) &_IO_stdout_;
_IO_stderr = stderr = (_IO_FILE *) &_IO_stderr_;
- INTUSE(_IO_list_all) = &_IO_stderr_;
+ _IO_list_all = &_IO_stderr_;
_IO_stdin->_vtable_offset = _IO_stdout->_vtable_offset =
_IO_stderr->_vtable_offset = stdin->_vtable_offset =
stdout->_vtable_offset = stderr->_vtable_offset =
diff --git a/libc/libio/putc.c b/libc/libio/putc.c
index bb4624fba..4d97b505a 100644
--- a/libc/libio/putc.c
+++ b/libc/libio/putc.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 1998, 2002, 2003
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +32,7 @@ _IO_putc (c, fp)
_IO_release_lock (fp);
return result;
}
-INTDEF(_IO_putc)
+libc_hidden_def (_IO_putc)
#undef putc
diff --git a/libc/libio/setbuf.c b/libc/libio/setbuf.c
index 1868578c7..a20ef1f8f 100644
--- a/libc/libio/setbuf.c
+++ b/libc/libio/setbuf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,5 +32,5 @@ setbuf (fp, buf)
_IO_FILE *fp;
char *buf;
{
- INTUSE(_IO_setbuffer) (fp, buf, _IO_BUFSIZ);
+ _IO_setbuffer (fp, buf, _IO_BUFSIZ);
}
diff --git a/libc/libio/setlinebuf.c b/libc/libio/setlinebuf.c
index 65f7fdca9..e0db23ced 100644
--- a/libc/libio/setlinebuf.c
+++ b/libc/libio/setlinebuf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,5 +33,5 @@ void
setlinebuf (stream)
_IO_FILE *stream;
{
- INTUSE(_IO_setvbuf) (stream, NULL, 1, 0);
+ _IO_setvbuf (stream, NULL, 1, 0);
}
diff --git a/libc/libio/stdfiles.c b/libc/libio/stdfiles.c
index 752164b3e..1acef3f9f 100644
--- a/libc/libio/stdfiles.c
+++ b/libc/libio/stdfiles.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-1997,1999,2000,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -70,4 +70,4 @@ DEF_STDFILE(_IO_2_1_stdout_, 1, &_IO_2_1_stdin_, _IO_NO_READS);
DEF_STDFILE(_IO_2_1_stderr_, 2, &_IO_2_1_stdout_, _IO_NO_READS+_IO_UNBUFFERED);
struct _IO_FILE_plus *_IO_list_all = &_IO_2_1_stderr_;
-INTVARDEF(_IO_list_all)
+libc_hidden_data_def (_IO_list_all)
diff --git a/libc/libio/strops.c b/libc/libio/strops.c
index 9dbf3222a..ccbfc9982 100644
--- a/libc/libio/strops.c
+++ b/libc/libio/strops.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -46,7 +46,7 @@ _IO_str_init_static_internal (sf, ptr, size, pstart)
end = ptr + size;
else
end = (char *) -1;
- INTUSE(_IO_setb) (fp, ptr, end, 0);
+ _IO_setb (fp, ptr, end, 0);
fp->_IO_write_base = ptr;
fp->_IO_read_base = ptr;
@@ -131,7 +131,7 @@ _IO_str_overflow (fp, c)
}
memset (new_buf + old_blen, '\0', new_size - old_blen);
- INTUSE(_IO_setb) (fp, new_buf, new_buf + new_size, 1);
+ _IO_setb (fp, new_buf, new_buf + new_size, 1);
fp->_IO_read_base = new_buf + (fp->_IO_read_base - old_buf);
fp->_IO_read_ptr = new_buf + (fp->_IO_read_ptr - old_buf);
fp->_IO_read_end = new_buf + (fp->_IO_read_end - old_buf);
@@ -148,7 +148,7 @@ _IO_str_overflow (fp, c)
fp->_IO_read_end = fp->_IO_write_ptr;
return c;
}
-INTDEF(_IO_str_overflow)
+libc_hidden_def (_IO_str_overflow)
int
_IO_str_underflow (fp)
@@ -167,7 +167,7 @@ _IO_str_underflow (fp)
else
return EOF;
}
-INTDEF(_IO_str_underflow)
+libc_hidden_def (_IO_str_underflow)
/* The size of the valid part of the buffer. */
@@ -210,7 +210,7 @@ enlarge_userbuf (_IO_FILE *fp, _IO_off64_t offset, int reading)
fp->_IO_buf_base = NULL;
}
- INTUSE(_IO_setb) (fp, newbuf, newbuf + newsize, 1);
+ _IO_setb (fp, newbuf, newbuf + newsize, 1);
if (reading)
{
@@ -320,7 +320,7 @@ _IO_str_seekoff (fp, offset, dir, mode)
}
return new_pos;
}
-INTDEF(_IO_str_seekoff)
+libc_hidden_def (_IO_str_seekoff)
int
_IO_str_pbackfail (fp, c)
@@ -329,9 +329,9 @@ _IO_str_pbackfail (fp, c)
{
if ((fp->_flags & _IO_NO_WRITES) && c != EOF)
return EOF;
- return INTUSE(_IO_default_pbackfail) (fp, c);
+ return _IO_default_pbackfail (fp, c);
}
-INTDEF(_IO_str_pbackfail)
+libc_hidden_def (_IO_str_pbackfail)
void
_IO_str_finish (fp, dummy)
@@ -342,24 +342,24 @@ _IO_str_finish (fp, dummy)
(((_IO_strfile *) fp)->_s._free_buffer) (fp->_IO_buf_base);
fp->_IO_buf_base = NULL;
- INTUSE(_IO_default_finish) (fp, 0);
+ _IO_default_finish (fp, 0);
}
const struct _IO_jump_t _IO_str_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_str_finish),
- JUMP_INIT(overflow, INTUSE(_IO_str_overflow)),
- JUMP_INIT(underflow, INTUSE(_IO_str_underflow)),
- JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT(pbackfail, INTUSE(_IO_str_pbackfail)),
- JUMP_INIT(xsputn, INTUSE(_IO_default_xsputn)),
- JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)),
- JUMP_INIT(seekoff, INTUSE(_IO_str_seekoff)),
+ JUMP_INIT(overflow, _IO_str_overflow),
+ JUMP_INIT(underflow, _IO_str_underflow),
+ JUMP_INIT(uflow, _IO_default_uflow),
+ JUMP_INIT(pbackfail, _IO_str_pbackfail),
+ JUMP_INIT(xsputn, _IO_default_xsputn),
+ JUMP_INIT(xsgetn, _IO_default_xsgetn),
+ JUMP_INIT(seekoff, _IO_str_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_default_setbuf),
JUMP_INIT(sync, _IO_default_sync),
- JUMP_INIT(doallocate, INTUSE(_IO_default_doallocate)),
+ JUMP_INIT(doallocate, _IO_default_doallocate),
JUMP_INIT(read, _IO_default_read),
JUMP_INIT(write, _IO_default_write),
JUMP_INIT(seek, _IO_default_seek),
diff --git a/libc/libio/vasprintf.c b/libc/libio/vasprintf.c
index 8f7438025..494efa6d0 100644
--- a/libc/libio/vasprintf.c
+++ b/libc/libio/vasprintf.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,1997,1999-2002,2004,2006,2009
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -60,7 +59,7 @@ _IO_vasprintf (result_ptr, format, args)
sf._sbf._f._flags &= ~_IO_USER_BUF;
sf._s._allocate_buffer = (_IO_alloc_type) malloc;
sf._s._free_buffer = (_IO_free_type) free;
- ret = INTUSE(_IO_vfprintf) (&sf._sbf._f, format, args);
+ ret = _IO_vfprintf (&sf._sbf._f, format, args);
if (ret < 0)
{
free (sf._sbf._f._IO_buf_base);
diff --git a/libc/libio/vscanf.c b/libc/libio/vscanf.c
index 895109d65..12bfb3477 100644
--- a/libc/libio/vscanf.c
+++ b/libc/libio/vscanf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 2002, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,6 +34,6 @@ _IO_vscanf (format, args)
const char *format;
_IO_va_list args;
{
- return INTUSE(_IO_vfscanf) (_IO_stdin, format, args, NULL);
+ return _IO_vfscanf (_IO_stdin, format, args, NULL);
}
ldbl_weak_alias (_IO_vscanf, vscanf)
diff --git a/libc/libio/vsnprintf.c b/libc/libio/vsnprintf.c
index 8d6edfa96..e0402d37a 100644
--- a/libc/libio/vsnprintf.c
+++ b/libc/libio/vsnprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994,1997,1999-2004,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -48,8 +48,8 @@ _IO_strn_overflow (fp, c)
a size to make this possible. */
*fp->_IO_write_ptr = '\0';
- INTUSE(_IO_setb) (fp, snf->overflow_buf,
- snf->overflow_buf + sizeof (snf->overflow_buf), 0);
+ _IO_setb (fp, snf->overflow_buf,
+ snf->overflow_buf + sizeof (snf->overflow_buf), 0);
fp->_IO_write_base = snf->overflow_buf;
fp->_IO_read_base = snf->overflow_buf;
@@ -71,16 +71,16 @@ const struct _IO_jump_t _IO_strn_jumps attribute_hidden =
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_str_finish),
JUMP_INIT(overflow, _IO_strn_overflow),
- JUMP_INIT(underflow, INTUSE(_IO_str_underflow)),
- JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT(pbackfail, INTUSE(_IO_str_pbackfail)),
- JUMP_INIT(xsputn, INTUSE(_IO_default_xsputn)),
- JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)),
- JUMP_INIT(seekoff, INTUSE(_IO_str_seekoff)),
+ JUMP_INIT(underflow, _IO_str_underflow),
+ JUMP_INIT(uflow, _IO_default_uflow),
+ JUMP_INIT(pbackfail, _IO_str_pbackfail),
+ JUMP_INIT(xsputn, _IO_default_xsputn),
+ JUMP_INIT(xsgetn, _IO_default_xsgetn),
+ JUMP_INIT(seekoff, _IO_str_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_default_setbuf),
JUMP_INIT(sync, _IO_default_sync),
- JUMP_INIT(doallocate, INTUSE(_IO_default_doallocate)),
+ JUMP_INIT(doallocate, _IO_default_doallocate),
JUMP_INIT(read, _IO_default_read),
JUMP_INIT(write, _IO_default_write),
JUMP_INIT(seek, _IO_default_seek),
@@ -116,7 +116,7 @@ _IO_vsnprintf (string, maxlen, format, args)
_IO_JUMPS (&sf.f._sbf) = &_IO_strn_jumps;
string[0] = '\0';
_IO_str_init_static_internal (&sf.f, string, maxlen - 1, string);
- ret = INTUSE(_IO_vfprintf) (&sf.f._sbf._f, format, args);
+ ret = _IO_vfprintf (&sf.f._sbf._f, format, args);
if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
*sf.f._sbf._f._IO_write_ptr = '\0';
diff --git a/libc/libio/vswprintf.c b/libc/libio/vswprintf.c
index c61dcc67b..4003e266e 100644
--- a/libc/libio/vswprintf.c
+++ b/libc/libio/vswprintf.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1994, 1997, 1999-2002, 2004, 2005, 2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1994-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -45,9 +44,9 @@ _IO_wstrn_overflow (fp, c)
if (fp->_wide_data->_IO_buf_base != snf->overflow_buf)
{
- INTUSE(_IO_wsetb) (fp, snf->overflow_buf,
- snf->overflow_buf + (sizeof (snf->overflow_buf)
- / sizeof (wchar_t)), 0);
+ _IO_wsetb (fp, snf->overflow_buf,
+ snf->overflow_buf + (sizeof (snf->overflow_buf)
+ / sizeof (wchar_t)), 0);
fp->_wide_data->_IO_write_base = snf->overflow_buf;
fp->_wide_data->_IO_read_base = snf->overflow_buf;
@@ -72,15 +71,15 @@ const struct _IO_jump_t _IO_wstrn_jumps attribute_hidden =
JUMP_INIT(finish, _IO_wstr_finish),
JUMP_INIT(overflow, (_IO_overflow_t) _IO_wstrn_overflow),
JUMP_INIT(underflow, (_IO_underflow_t) _IO_wstr_underflow),
- JUMP_INIT(uflow, (_IO_underflow_t) INTUSE(_IO_wdefault_uflow)),
+ JUMP_INIT(uflow, (_IO_underflow_t) _IO_wdefault_uflow),
JUMP_INIT(pbackfail, (_IO_pbackfail_t) _IO_wstr_pbackfail),
- JUMP_INIT(xsputn, INTUSE(_IO_wdefault_xsputn)),
- JUMP_INIT(xsgetn, INTUSE(_IO_wdefault_xsgetn)),
+ JUMP_INIT(xsputn, _IO_wdefault_xsputn),
+ JUMP_INIT(xsgetn, _IO_wdefault_xsgetn),
JUMP_INIT(seekoff, _IO_wstr_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_default_setbuf),
JUMP_INIT(sync, _IO_default_sync),
- JUMP_INIT(doallocate, INTUSE(_IO_wdefault_doallocate)),
+ JUMP_INIT(doallocate, _IO_wdefault_doallocate),
JUMP_INIT(read, _IO_default_read),
JUMP_INIT(write, _IO_default_write),
JUMP_INIT(seek, _IO_default_seek),
diff --git a/libc/libio/wfiledoalloc.c b/libc/libio/wfiledoalloc.c
index d52ebb172..10f4270ce 100644
--- a/libc/libio/wfiledoalloc.c
+++ b/libc/libio/wfiledoalloc.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1997, 1999, 2000, 2002, 2006, 2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -87,7 +86,7 @@ _IO_wfile_doallocate (fp)
/* Allocate room for the external buffer. */
if (fp->_IO_buf_base == NULL)
- INTUSE(_IO_file_doallocate) (fp);
+ _IO_file_doallocate (fp);
/* If narrow buffer is user allocated (set by setvbuf etc.),
use that size as the size of the wide buffer, when it is
@@ -97,6 +96,6 @@ _IO_wfile_doallocate (fp)
if ((fp->_flags & _IO_USER_BUF))
size = (size + sizeof (wchar_t) - 1) / sizeof (wchar_t);
ALLOC_WBUF (p, size * sizeof (wchar_t), EOF);
- INTUSE(_IO_wsetb) (fp, p, p + size, 1);
+ _IO_wsetb (fp, p, p + size, 1);
return 1;
}
diff --git a/libc/libio/wfileops.c b/libc/libio/wfileops.c
index 13c2db58b..3f628bfd1 100644
--- a/libc/libio/wfileops.c
+++ b/libc/libio/wfileops.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1995,1997-2004,2006,2009,2011 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@cygnus.com>.
Based on the single byte version by Per Bothner <bothner@cygnus.com>.
@@ -112,7 +112,7 @@ _IO_wdo_write (fp, data, to_do)
return to_do == 0 ? 0 : WEOF;
}
-INTDEF(_IO_wdo_write)
+libc_hidden_def (_IO_wdo_write)
wint_t
@@ -183,7 +183,7 @@ _IO_wfile_underflow (fp)
free (fp->_IO_save_base);
fp->_flags &= ~_IO_IN_BACKUP;
}
- INTUSE(_IO_doallocbuf) (fp);
+ _IO_doallocbuf (fp);
fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_read_end =
fp->_IO_buf_base;
@@ -200,7 +200,7 @@ _IO_wfile_underflow (fp)
free (fp->_wide_data->_IO_save_base);
fp->_flags &= ~_IO_IN_BACKUP;
}
- INTUSE(_IO_wdoallocbuf) (fp);
+ _IO_wdoallocbuf (fp);
}
/* Flush all line buffered files before reading. */
@@ -208,7 +208,7 @@ _IO_wfile_underflow (fp)
if (fp->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED))
{
#if 0
- INTUSE(_IO_flush_all_linebuffered) ();
+ _IO_flush_all_linebuffered ();
#else
/* We used to flush all line-buffered stream. This really isn't
required by any standard. My recollection is that
@@ -225,7 +225,7 @@ _IO_wfile_underflow (fp)
#endif
}
- INTUSE(_IO_switch_to_get_mode) (fp);
+ _IO_switch_to_get_mode (fp);
fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_read_ptr =
fp->_wide_data->_IO_buf_base;
@@ -332,7 +332,7 @@ _IO_wfile_underflow (fp)
return *fp->_wide_data->_IO_read_ptr;
}
-INTDEF(_IO_wfile_underflow)
+libc_hidden_def (_IO_wfile_underflow)
static wint_t
@@ -371,7 +371,7 @@ _IO_wfile_underflow_mmap (_IO_FILE *fp)
free (fp->_wide_data->_IO_save_base);
fp->_flags &= ~_IO_IN_BACKUP;
}
- INTUSE(_IO_wdoallocbuf) (fp);
+ _IO_wdoallocbuf (fp);
}
fp->_wide_data->_IO_last_state = fp->_wide_data->_IO_state;
@@ -426,13 +426,13 @@ _IO_wfile_overflow (f, wch)
/* Allocate a buffer if needed. */
if (f->_wide_data->_IO_write_base == 0)
{
- INTUSE(_IO_wdoallocbuf) (f);
+ _IO_wdoallocbuf (f);
_IO_wsetg (f, f->_wide_data->_IO_buf_base,
f->_wide_data->_IO_buf_base, f->_wide_data->_IO_buf_base);
if (f->_IO_write_base == NULL)
{
- INTUSE(_IO_doallocbuf) (f);
+ _IO_doallocbuf (f);
_IO_setg (f, f->_IO_buf_base, f->_IO_buf_base, f->_IO_buf_base);
}
}
@@ -481,7 +481,7 @@ _IO_wfile_overflow (f, wch)
return WEOF;
return wch;
}
-INTDEF(_IO_wfile_overflow)
+libc_hidden_def (_IO_wfile_overflow)
wint_t
_IO_wfile_sync (fp)
@@ -543,7 +543,7 @@ _IO_wfile_sync (fp)
/* setg(base(), ptr, ptr); */
return retval;
}
-INTDEF(_IO_wfile_sync)
+libc_hidden_def (_IO_wfile_sync)
_IO_off64_t
_IO_wfile_seekoff (fp, offset, dir, mode)
@@ -580,7 +580,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
/* There is no more data in the backup buffer. We can
switch back. */
- INTUSE(_IO_switch_to_main_wget_area) (fp);
+ _IO_switch_to_main_wget_area (fp);
}
dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */
@@ -596,7 +596,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
if (fp->_wide_data->_IO_write_ptr > fp->_wide_data->_IO_write_base
|| _IO_in_put_mode (fp))
- if (INTUSE(_IO_switch_to_wget_mode) (fp))
+ if (_IO_switch_to_wget_mode (fp))
return WEOF;
if (fp->_wide_data->_IO_buf_base == NULL)
@@ -607,7 +607,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
free (fp->_wide_data->_IO_read_base);
fp->_flags &= ~_IO_IN_BACKUP;
}
- INTUSE(_IO_doallocbuf) (fp);
+ _IO_doallocbuf (fp);
_IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
_IO_wsetp (fp, fp->_wide_data->_IO_buf_base,
@@ -738,7 +738,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
return offset;
dumb:
- INTUSE(_IO_unsave_markers) (fp);
+ _IO_unsave_markers (fp);
result = _IO_SYSSEEK (fp, offset, dir);
if (result != EOF)
{
@@ -763,7 +763,7 @@ resync:
return offset;
}
-INTDEF(_IO_wfile_seekoff)
+libc_hidden_def (_IO_wfile_seekoff)
_IO_size_t
@@ -829,38 +829,38 @@ _IO_wfile_xsputn (f, data, n)
to_do -= count;
}
if (to_do > 0)
- to_do -= INTUSE(_IO_wdefault_xsputn) (f, s, to_do);
+ to_do -= _IO_wdefault_xsputn (f, s, to_do);
if (must_flush
&& f->_wide_data->_IO_write_ptr != f->_wide_data->_IO_write_base)
- INTUSE(_IO_wdo_write) (f, f->_wide_data->_IO_write_base,
- f->_wide_data->_IO_write_ptr
- - f->_wide_data->_IO_write_base);
+ _IO_wdo_write (f, f->_wide_data->_IO_write_base,
+ f->_wide_data->_IO_write_ptr
+ - f->_wide_data->_IO_write_base);
return n - to_do;
}
-INTDEF(_IO_wfile_xsputn)
+libc_hidden_def (_IO_wfile_xsputn)
const struct _IO_jump_t _IO_wfile_jumps =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_new_file_finish),
- JUMP_INIT(overflow, (_IO_overflow_t) INTUSE(_IO_wfile_overflow)),
- JUMP_INIT(underflow, (_IO_underflow_t) INTUSE(_IO_wfile_underflow)),
- JUMP_INIT(uflow, (_IO_underflow_t) INTUSE(_IO_wdefault_uflow)),
- JUMP_INIT(pbackfail, (_IO_pbackfail_t) INTUSE(_IO_wdefault_pbackfail)),
- JUMP_INIT(xsputn, INTUSE(_IO_wfile_xsputn)),
- JUMP_INIT(xsgetn, INTUSE(_IO_file_xsgetn)),
- JUMP_INIT(seekoff, INTUSE(_IO_wfile_seekoff)),
+ JUMP_INIT(overflow, (_IO_overflow_t) _IO_wfile_overflow),
+ JUMP_INIT(underflow, (_IO_underflow_t) _IO_wfile_underflow),
+ JUMP_INIT(uflow, (_IO_underflow_t) _IO_wdefault_uflow),
+ JUMP_INIT(pbackfail, (_IO_pbackfail_t) _IO_wdefault_pbackfail),
+ JUMP_INIT(xsputn, _IO_wfile_xsputn),
+ JUMP_INIT(xsgetn, _IO_file_xsgetn),
+ JUMP_INIT(seekoff, _IO_wfile_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_new_file_setbuf),
- JUMP_INIT(sync, (_IO_sync_t) INTUSE(_IO_wfile_sync)),
+ JUMP_INIT(sync, (_IO_sync_t) _IO_wfile_sync),
JUMP_INIT(doallocate, _IO_wfile_doallocate),
- JUMP_INIT(read, INTUSE(_IO_file_read)),
+ JUMP_INIT(read, _IO_file_read),
JUMP_INIT(write, _IO_new_file_write),
- JUMP_INIT(seek, INTUSE(_IO_file_seek)),
- JUMP_INIT(close, INTUSE(_IO_file_close)),
- JUMP_INIT(stat, INTUSE(_IO_file_stat)),
+ JUMP_INIT(seek, _IO_file_seek),
+ JUMP_INIT(close, _IO_file_close),
+ JUMP_INIT(stat, _IO_file_stat),
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)
};
@@ -871,22 +871,22 @@ const struct _IO_jump_t _IO_wfile_jumps_mmap =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_new_file_finish),
- JUMP_INIT(overflow, (_IO_overflow_t) INTUSE(_IO_wfile_overflow)),
+ JUMP_INIT(overflow, (_IO_overflow_t) _IO_wfile_overflow),
JUMP_INIT(underflow, (_IO_underflow_t) _IO_wfile_underflow_mmap),
- JUMP_INIT(uflow, (_IO_underflow_t) INTUSE(_IO_wdefault_uflow)),
- JUMP_INIT(pbackfail, (_IO_pbackfail_t) INTUSE(_IO_wdefault_pbackfail)),
- JUMP_INIT(xsputn, INTUSE(_IO_wfile_xsputn)),
- JUMP_INIT(xsgetn, INTUSE(_IO_file_xsgetn)),
- JUMP_INIT(seekoff, INTUSE(_IO_wfile_seekoff)),
+ JUMP_INIT(uflow, (_IO_underflow_t) _IO_wdefault_uflow),
+ JUMP_INIT(pbackfail, (_IO_pbackfail_t) _IO_wdefault_pbackfail),
+ JUMP_INIT(xsputn, _IO_wfile_xsputn),
+ JUMP_INIT(xsgetn, _IO_file_xsgetn),
+ JUMP_INIT(seekoff, _IO_wfile_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_file_setbuf_mmap),
- JUMP_INIT(sync, (_IO_sync_t) INTUSE(_IO_wfile_sync)),
+ JUMP_INIT(sync, (_IO_sync_t) _IO_wfile_sync),
JUMP_INIT(doallocate, _IO_wfile_doallocate),
- JUMP_INIT(read, INTUSE(_IO_file_read)),
+ JUMP_INIT(read, _IO_file_read),
JUMP_INIT(write, _IO_new_file_write),
- JUMP_INIT(seek, INTUSE(_IO_file_seek)),
+ JUMP_INIT(seek, _IO_file_seek),
JUMP_INIT(close, _IO_file_close_mmap),
- JUMP_INIT(stat, INTUSE(_IO_file_stat)),
+ JUMP_INIT(stat, _IO_file_stat),
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)
};
@@ -895,22 +895,22 @@ const struct _IO_jump_t _IO_wfile_jumps_maybe_mmap =
{
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_new_file_finish),
- JUMP_INIT(overflow, (_IO_overflow_t) INTUSE(_IO_wfile_overflow)),
+ JUMP_INIT(overflow, (_IO_overflow_t) _IO_wfile_overflow),
JUMP_INIT(underflow, (_IO_underflow_t) _IO_wfile_underflow_maybe_mmap),
- JUMP_INIT(uflow, (_IO_underflow_t) INTUSE(_IO_wdefault_uflow)),
- JUMP_INIT(pbackfail, (_IO_pbackfail_t) INTUSE(_IO_wdefault_pbackfail)),
- JUMP_INIT(xsputn, INTUSE(_IO_wfile_xsputn)),
- JUMP_INIT(xsgetn, INTUSE(_IO_file_xsgetn)),
- JUMP_INIT(seekoff, INTUSE(_IO_wfile_seekoff)),
+ JUMP_INIT(uflow, (_IO_underflow_t) _IO_wdefault_uflow),
+ JUMP_INIT(pbackfail, (_IO_pbackfail_t) _IO_wdefault_pbackfail),
+ JUMP_INIT(xsputn, _IO_wfile_xsputn),
+ JUMP_INIT(xsgetn, _IO_file_xsgetn),
+ JUMP_INIT(seekoff, _IO_wfile_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_file_setbuf_mmap),
- JUMP_INIT(sync, (_IO_sync_t) INTUSE(_IO_wfile_sync)),
+ JUMP_INIT(sync, (_IO_sync_t) _IO_wfile_sync),
JUMP_INIT(doallocate, _IO_wfile_doallocate),
- JUMP_INIT(read, INTUSE(_IO_file_read)),
+ JUMP_INIT(read, _IO_file_read),
JUMP_INIT(write, _IO_new_file_write),
- JUMP_INIT(seek, INTUSE(_IO_file_seek)),
- JUMP_INIT(close, INTUSE(_IO_file_close)),
- JUMP_INIT(stat, INTUSE(_IO_file_stat)),
+ JUMP_INIT(seek, _IO_file_seek),
+ JUMP_INIT(close, _IO_file_close),
+ JUMP_INIT(stat, _IO_file_stat),
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)
};
diff --git a/libc/libio/wgenops.c b/libc/libio/wgenops.c
index 886b25e1a..f8f27b04a 100644
--- a/libc/libio/wgenops.c
+++ b/libc/libio/wgenops.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,1995,1997-2002,2004,2006,2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@cygnus.com>.
Based on the single byte version by Per Bothner <bothner@cygnus.com>.
@@ -48,8 +47,6 @@ static int save_for_wbackup (_IO_FILE *fp, wchar_t *end_p) __THROW
/* Return minimum _pos markers
Assumes the current get area is the main get area. */
-_IO_ssize_t _IO_least_wmarker (_IO_FILE *fp, wchar_t *end_p) __THROW;
-
_IO_ssize_t
_IO_least_wmarker (fp, end_p)
_IO_FILE *fp;
@@ -62,7 +59,7 @@ _IO_least_wmarker (fp, end_p)
least_so_far = mark->_pos;
return least_so_far;
}
-INTDEF(_IO_least_wmarker)
+libc_hidden_def (_IO_least_wmarker)
/* Switch current get area from backup buffer to (start of) main get area. */
void
@@ -82,7 +79,7 @@ _IO_switch_to_main_wget_area (fp)
/* Set _IO_read_ptr. */
fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_base;
}
-INTDEF(_IO_switch_to_main_wget_area)
+libc_hidden_def (_IO_switch_to_main_wget_area)
/* Switch current get area from main get area to (end of) backup area. */
@@ -103,7 +100,7 @@ _IO_switch_to_wbackup_area (fp)
/* Set _IO_read_ptr. */
fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end;
}
-INTDEF(_IO_switch_to_wbackup_area)
+libc_hidden_def (_IO_switch_to_wbackup_area)
void
@@ -122,7 +119,7 @@ _IO_wsetb (f, b, eb, a)
else
f->_flags2 |= _IO_FLAGS2_USER_WBUF;
}
-INTDEF(_IO_wsetb)
+libc_hidden_def (_IO_wsetb)
wint_t
@@ -162,7 +159,7 @@ _IO_wdefault_pbackfail (fp, c)
fp->_wide_data->_IO_backup_base = fp->_wide_data->_IO_save_end;
}
fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_read_ptr;
- INTUSE(_IO_switch_to_wbackup_area) (fp);
+ _IO_switch_to_wbackup_area (fp);
}
else if (fp->_wide_data->_IO_read_ptr <= fp->_wide_data->_IO_read_base)
{
@@ -187,7 +184,7 @@ _IO_wdefault_pbackfail (fp, c)
}
return c;
}
-INTDEF(_IO_wdefault_pbackfail)
+libc_hidden_def (_IO_wdefault_pbackfail)
void
@@ -217,9 +214,9 @@ _IO_wdefault_finish (fp, dummy)
_IO_lock_fini (*fp->_lock);
#endif
- INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
+ _IO_un_link ((struct _IO_FILE_plus *) fp);
}
-INTDEF(_IO_wdefault_finish)
+libc_hidden_def (_IO_wdefault_finish)
wint_t
@@ -232,7 +229,7 @@ _IO_wdefault_uflow (fp)
return WEOF;
return *fp->_wide_data->_IO_read_ptr++;
}
-INTDEF(_IO_wdefault_uflow)
+libc_hidden_def (_IO_wdefault_uflow)
wint_t
@@ -257,13 +254,13 @@ __wuflow (fp)
if (fp->_mode == 0)
_IO_fwide (fp, 1);
if (_IO_in_put_mode (fp))
- if (INTUSE(_IO_switch_to_wget_mode) (fp) == EOF)
+ if (_IO_switch_to_wget_mode (fp) == EOF)
return WEOF;
if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end)
return *fp->_wide_data->_IO_read_ptr++;
if (_IO_in_backup (fp))
{
- INTUSE(_IO_switch_to_main_wget_area) (fp);
+ _IO_switch_to_main_wget_area (fp);
if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end)
return *fp->_wide_data->_IO_read_ptr++;
}
@@ -273,7 +270,7 @@ __wuflow (fp)
return WEOF;
}
else if (_IO_have_wbackup (fp))
- INTUSE(_IO_free_wbackup_area) (fp);
+ _IO_free_wbackup_area (fp);
return _IO_UFLOW (fp);
}
libc_hidden_def (__wuflow)
@@ -288,13 +285,13 @@ __wunderflow (fp)
if (fp->_mode == 0)
_IO_fwide (fp, 1);
if (_IO_in_put_mode (fp))
- if (INTUSE(_IO_switch_to_wget_mode) (fp) == EOF)
+ if (_IO_switch_to_wget_mode (fp) == EOF)
return WEOF;
if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end)
return *fp->_wide_data->_IO_read_ptr;
if (_IO_in_backup (fp))
{
- INTUSE(_IO_switch_to_main_wget_area) (fp);
+ _IO_switch_to_main_wget_area (fp);
if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end)
return *fp->_wide_data->_IO_read_ptr;
}
@@ -304,7 +301,7 @@ __wunderflow (fp)
return WEOF;
}
else if (_IO_have_backup (fp))
- INTUSE(_IO_free_wbackup_area) (fp);
+ _IO_free_wbackup_area (fp);
return _IO_UNDERFLOW (fp);
}
libc_hidden_def (__wunderflow)
@@ -358,7 +355,7 @@ _IO_wdefault_xsputn (f, data, n)
}
return n - more;
}
-INTDEF(_IO_wdefault_xsputn)
+libc_hidden_def (_IO_wdefault_xsputn)
_IO_size_t
@@ -405,7 +402,7 @@ _IO_wdefault_xsgetn (fp, data, n)
}
return n - more;
}
-INTDEF(_IO_wdefault_xsgetn)
+libc_hidden_def (_IO_wdefault_xsgetn)
void
@@ -417,10 +414,10 @@ _IO_wdoallocbuf (fp)
if (!(fp->_flags & _IO_UNBUFFERED))
if ((wint_t)_IO_WDOALLOCATE (fp) != WEOF)
return;
- INTUSE(_IO_wsetb) (fp, fp->_wide_data->_shortbuf,
+ _IO_wsetb (fp, fp->_wide_data->_shortbuf,
fp->_wide_data->_shortbuf + 1, 0);
}
-INTDEF(_IO_wdoallocbuf)
+libc_hidden_def (_IO_wdoallocbuf)
int
@@ -430,10 +427,10 @@ _IO_wdefault_doallocate (fp)
wchar_t *buf;
ALLOC_WBUF (buf, _IO_BUFSIZ, EOF);
- INTUSE(_IO_wsetb) (fp, buf, buf + _IO_BUFSIZ, 1);
+ _IO_wsetb (fp, buf, buf + _IO_BUFSIZ, 1);
return 1;
}
-INTDEF(_IO_wdefault_doallocate)
+libc_hidden_def (_IO_wdefault_doallocate)
int
@@ -459,20 +456,20 @@ _IO_switch_to_wget_mode (fp)
fp->_flags &= ~_IO_CURRENTLY_PUTTING;
return 0;
}
-INTDEF(_IO_switch_to_wget_mode)
+libc_hidden_def (_IO_switch_to_wget_mode)
void
_IO_free_wbackup_area (fp)
_IO_FILE *fp;
{
if (_IO_in_backup (fp))
- INTUSE(_IO_switch_to_main_wget_area) (fp); /* Just in case. */
+ _IO_switch_to_main_wget_area (fp); /* Just in case. */
free (fp->_wide_data->_IO_save_base);
fp->_wide_data->_IO_save_base = NULL;
fp->_wide_data->_IO_save_end = NULL;
fp->_wide_data->_IO_backup_base = NULL;
}
-INTDEF(_IO_free_wbackup_area)
+libc_hidden_def (_IO_free_wbackup_area)
#if 0
int
@@ -504,7 +501,7 @@ save_for_wbackup (fp, end_p)
wchar_t *end_p;
{
/* Append [_IO_read_base..end_p] to backup area. */
- _IO_ssize_t least_mark = INTUSE(_IO_least_wmarker) (fp, end_p);
+ _IO_ssize_t least_mark = _IO_least_wmarker (fp, end_p);
/* needed_size is how much space we need in the backup area. */
_IO_size_t needed_size = ((end_p - fp->_wide_data->_IO_read_base)
- least_mark);
@@ -616,7 +613,7 @@ _IO_sputbackwc (fp, c)
return result;
}
-INTDEF(_IO_sputbackwc)
+libc_hidden_def (_IO_sputbackwc)
wint_t
_IO_sungetwc (fp)
@@ -659,7 +656,7 @@ _IO_init_wmarker (marker, fp)
{
marker->_sbuf = fp;
if (_IO_in_put_mode (fp))
- INTUSE(_IO_switch_to_wget_mode) (fp);
+ _IO_switch_to_wget_mode (fp);
if (_IO_in_backup (fp))
marker->_pos = fp->_wide_data->_IO_read_ptr - fp->_wide_data->_IO_read_end;
else
@@ -701,14 +698,14 @@ _IO_seekwmark (fp, mark, delta)
if (mark->_pos >= 0)
{
if (_IO_in_backup (fp))
- INTUSE(_IO_switch_to_main_wget_area) (fp);
+ _IO_switch_to_main_wget_area (fp);
fp->_wide_data->_IO_read_ptr = (fp->_wide_data->_IO_read_base
+ mark->_pos);
}
else
{
if (!_IO_in_backup (fp))
- INTUSE(_IO_switch_to_wbackup_area) (fp);
+ _IO_switch_to_wbackup_area (fp);
fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end + mark->_pos;
}
return 0;
@@ -739,5 +736,5 @@ _IO_unsave_wmarkers (fp)
}
if (_IO_have_backup (fp))
- INTUSE(_IO_free_wbackup_area) (fp);
+ _IO_free_wbackup_area (fp);
}
diff --git a/libc/libio/wmemstream.c b/libc/libio/wmemstream.c
index 83ba52e73..f6b505f3b 100644
--- a/libc/libio/wmemstream.c
+++ b/libc/libio/wmemstream.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-97,99,2000,2002-2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,15 +40,15 @@ static const struct _IO_jump_t _IO_wmem_jumps =
JUMP_INIT (finish, _IO_wmem_finish),
JUMP_INIT (overflow, (_IO_overflow_t) _IO_wstr_overflow),
JUMP_INIT (underflow, (_IO_underflow_t) _IO_wstr_underflow),
- JUMP_INIT (uflow, (_IO_underflow_t) INTUSE(_IO_wdefault_uflow)),
+ JUMP_INIT (uflow, (_IO_underflow_t) _IO_wdefault_uflow),
JUMP_INIT (pbackfail, (_IO_pbackfail_t) _IO_wstr_pbackfail),
- JUMP_INIT (xsputn, INTUSE(_IO_wdefault_xsputn)),
- JUMP_INIT (xsgetn, INTUSE(_IO_wdefault_xsgetn)),
+ JUMP_INIT (xsputn, _IO_wdefault_xsputn),
+ JUMP_INIT (xsgetn, _IO_wdefault_xsgetn),
JUMP_INIT (seekoff, _IO_wstr_seekoff),
JUMP_INIT (seekpos, _IO_default_seekpos),
JUMP_INIT (setbuf, _IO_default_setbuf),
JUMP_INIT (sync, _IO_wmem_sync),
- JUMP_INIT (doallocate, INTUSE(_IO_wdefault_doallocate)),
+ JUMP_INIT (doallocate, _IO_wdefault_doallocate),
JUMP_INIT (read, _IO_default_read),
JUMP_INIT (write, _IO_default_write),
JUMP_INIT (seek, _IO_default_seek),
diff --git a/libc/libio/wstrops.c b/libc/libio/wstrops.c
index 3e26b1382..1c0f7e214 100644
--- a/libc/libio/wstrops.c
+++ b/libc/libio/wstrops.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1997-1999,2001-2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -48,7 +48,7 @@ _IO_wstr_init_static (fp, ptr, size, pstart)
/* Even for misaligned ptr make sure there is integral number of wide
characters. */
end = ptr + (-1 - (_IO_size_t) ptr) / sizeof (wchar_t);
- INTUSE(_IO_wsetb) (fp, ptr, end, 0);
+ _IO_wsetb (fp, ptr, end, 0);
fp->_wide_data->_IO_write_base = ptr;
fp->_wide_data->_IO_read_base = ptr;
@@ -115,7 +115,7 @@ _IO_wstr_overflow (fp, c)
wmemset (new_buf + old_wblen, L'\0', new_size - old_wblen);
- INTUSE(_IO_wsetb) (fp, new_buf, new_buf + new_size, 1);
+ _IO_wsetb (fp, new_buf, new_buf + new_size, 1);
fp->_wide_data->_IO_read_base =
new_buf + (fp->_wide_data->_IO_read_base - old_buf);
fp->_wide_data->_IO_read_ptr =
@@ -202,7 +202,7 @@ enlarge_userbuf (_IO_FILE *fp, _IO_off64_t offset, int reading)
wd->_IO_buf_base = NULL;
}
- INTUSE(_IO_wsetb) (fp, newbuf, newbuf + newsize, 1);
+ _IO_wsetb (fp, newbuf, newbuf + newsize, 1);
if (reading)
{
@@ -326,7 +326,7 @@ _IO_wstr_pbackfail (fp, c)
{
if ((fp->_flags & _IO_NO_WRITES) && c != WEOF)
return WEOF;
- return INTUSE(_IO_wdefault_pbackfail) (fp, c);
+ return _IO_wdefault_pbackfail (fp, c);
}
void
@@ -338,7 +338,7 @@ _IO_wstr_finish (fp, dummy)
(((_IO_strfile *) fp)->_s._free_buffer) (fp->_wide_data->_IO_buf_base);
fp->_wide_data->_IO_buf_base = NULL;
- INTUSE(_IO_wdefault_finish) (fp, 0);
+ _IO_wdefault_finish (fp, 0);
}
const struct _IO_jump_t _IO_wstr_jumps =
@@ -347,15 +347,15 @@ const struct _IO_jump_t _IO_wstr_jumps =
JUMP_INIT(finish, _IO_wstr_finish),
JUMP_INIT(overflow, (_IO_overflow_t) _IO_wstr_overflow),
JUMP_INIT(underflow, (_IO_underflow_t) _IO_wstr_underflow),
- JUMP_INIT(uflow, (_IO_underflow_t) INTUSE(_IO_wdefault_uflow)),
+ JUMP_INIT(uflow, (_IO_underflow_t) _IO_wdefault_uflow),
JUMP_INIT(pbackfail, (_IO_pbackfail_t) _IO_wstr_pbackfail),
- JUMP_INIT(xsputn, INTUSE(_IO_wdefault_xsputn)),
- JUMP_INIT(xsgetn, INTUSE(_IO_wdefault_xsgetn)),
+ JUMP_INIT(xsputn, _IO_wdefault_xsputn),
+ JUMP_INIT(xsgetn, _IO_wdefault_xsgetn),
JUMP_INIT(seekoff, _IO_wstr_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_default_setbuf),
JUMP_INIT(sync, _IO_default_sync),
- JUMP_INIT(doallocate, INTUSE(_IO_wdefault_doallocate)),
+ JUMP_INIT(doallocate, _IO_wdefault_doallocate),
JUMP_INIT(read, _IO_default_read),
JUMP_INIT(write, _IO_default_write),
JUMP_INIT(seek, _IO_default_seek),
diff --git a/libc/localedata/ChangeLog b/libc/localedata/ChangeLog
index 6ef7dc78d..975e59fff 100644
--- a/libc/localedata/ChangeLog
+++ b/libc/localedata/ChangeLog
@@ -1,3 +1,18 @@
+2012-04-20 Chandan Kumar <chandankumar.093047@gmail.com>
+
+ [BZ#13968]
+ * locales/mag_IN: New file.
+ * SUPPORTED (SUPPORTED-LOCALES): Add appropriate entry.
+
+2012-05-21 Bruno Haible <bruno@clisp.org>
+ Andreas Jaeger <aj@suse.de>
+
+ * SUPPORTED: Remove vi_VN.TCVN/TCVN5712-1.
+ * tst-strptime.c: Remove, we do not support vi_VN.TCVN5712-1
+ anymore.
+ * Makefile (LOCALES): Remove vi_VN.TCVN5712-1 from list.
+ (tests): Remove tst-strptime.
+
2012-05-11 Andreas Schwab <schwab@linux-m68k.org>
[BZ #11837]
diff --git a/libc/localedata/Makefile b/libc/localedata/Makefile
index e18a3fa8c..5e40e0fca 100644
--- a/libc/localedata/Makefile
+++ b/libc/localedata/Makefile
@@ -92,7 +92,7 @@ locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+= $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
- tst-strfmon1 tst-sscanf tst-strptime bug-setlocale1 tst-setlocale2
+ tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2
ifeq (yesy,$(build-shared)$(OPTION_EGLIBC_LOCALE_CODE))
ifneq (no,$(PERL))
tests: $(objpfx)mtrace-tst-leaks
@@ -133,9 +133,9 @@ CFLAGS-tst-trans.c = -Wno-format
LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
en_US.ISO-8859-1 en_US.UTF-8 ja_JP.EUC-JP da_DK.ISO-8859-1 \
hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 ja_JP.SJIS fr_FR.ISO-8859-1 \
- vi_VN.TCVN5712-1 nb_NO.ISO-8859-1 nn_NO.ISO-8859-1 \
- tr_TR.UTF-8 cs_CZ.UTF-8 zh_TW.EUC-TW fa_IR.UTF-8 fr_FR.UTF-8 \
- ja_JP.UTF-8 si_LK.UTF-8 tr_TR.ISO-8859-9
+ nb_NO.ISO-8859-1 nn_NO.ISO-8859-1 tr_TR.UTF-8 cs_CZ.UTF-8 \
+ zh_TW.EUC-TW fa_IR.UTF-8 fr_FR.UTF-8 ja_JP.UTF-8 si_LK.UTF-8 \
+ tr_TR.ISO-8859-9
LOCALE_SRCS := $(shell echo "$(LOCALES)"|sed 's/\([^ .]*\)[^ ]*/\1/g')
CHARMAPS := $(shell echo "$(LOCALES)" | \
sed -e 's/[^ .]*[.]\([^ ]*\)/\1/g' -e s/SJIS/SHIFT_JIS/g)
diff --git a/libc/localedata/SUPPORTED b/libc/localedata/SUPPORTED
index 1fd78472c..9a1699fdb 100644
--- a/libc/localedata/SUPPORTED
+++ b/libc/localedata/SUPPORTED
@@ -285,6 +285,7 @@ lt_LT.UTF-8/UTF-8 \
lt_LT/ISO-8859-13 \
lv_LV.UTF-8/UTF-8 \
lv_LV/ISO-8859-13 \
+mag_IN/UTF-8 \
mai_IN/UTF-8 \
mg_MG.UTF-8/UTF-8 \
mg_MG/ISO-8859-15 \
@@ -409,7 +410,6 @@ ur_PK/UTF-8 \
uz_UZ/ISO-8859-1 \
uz_UZ@cyrillic/UTF-8 \
ve_ZA/UTF-8 \
-vi_VN.TCVN/TCVN5712-1 \
vi_VN/UTF-8 \
wa_BE/ISO-8859-1 \
wa_BE@euro/ISO-8859-15 \
diff --git a/libc/localedata/locales/mag_IN b/libc/localedata/locales/mag_IN
new file mode 100644
index 000000000..f4aff4556
--- /dev/null
+++ b/libc/localedata/locales/mag_IN
@@ -0,0 +1,168 @@
+comment_char %
+escape_char /
+% Magahi language locale for India.
+% Contributed by Chandan Kumar <chandankumar.093047@gmail.com>,
+# Rajesh Ranjan <rajeshkajha@yahoo.com>
+% and Pravin Satpute <psatpute@redhat.com>
+
+LC_IDENTIFICATION
+title "Magahi language locale for India"
+source ""
+address ""
+contact ""
+email "bhashaghar@googlegroups.com"
+tel ""
+fax ""
+language "Magahi"
+territory "India"
+revision "0.1"
+date "2012-04-11"
+%
+category "mag_IN:2012";LC_IDENTIFICATION
+category "mag_IN:2012";LC_CTYPE
+category "mag_IN:2012";LC_COLLATE
+category "mag_IN:2012";LC_TIME
+category "mag_IN:2012";LC_NUMERIC
+category "mag_IN:2012";LC_MONETARY
+category "mag_IN:2012";LC_MESSAGES
+category "mag_IN:2012";LC_PAPER
+category "mag_IN:2012";LC_NAME
+category "mag_IN:2012";LC_ADDRESS
+category "mag_IN:2012";LC_TELEPHONE
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "hi_IN"
+END LC_CTYPE
+
+LC_COLLATE
+copy "hi_IN"
+END LC_COLLATE
+
+LC_MONETARY
+copy "hi_IN"
+END LC_MONETARY
+
+
+LC_NUMERIC
+copy "hi_IN"
+END LC_NUMERIC
+
+
+LC_TIME
+% This is the POSIX Locale definition for the LC_TIME category.
+% These are generated based on XML base Locale definition file
+% for IBM Class for Unicode/Java
+%
+% Abbreviated weekday names (%a)
+abday "<U090f><U0924><U0935><U093e><U0930><U0020>";/
+ "<U0938><U094b><U092e><U093e><U0930><U0020>";/
+ "<U092e><U0902><U0917><U0930><U0020>";/
+ "<U092c><U0941><U0927><U0020>";/
+ "<U092c><U093f><U092b><U0947><U0020>";/
+ "<U0938><U0942><U0915><U0020>";/
+ "<U0938><U0928><U093f><U091a><U0930><U0020>"
+%
+% Full weekday names (%A)
+day "<U090f><U0924><U0935><U093e><U0930><U0020>";/
+ "<U0938><U094b><U092e><U093e><U0930><U0020>";/
+ "<U092e><U0902><U0917><U0930><U0020>";/
+ "<U092c><U0941><U0927><U0020>";/
+ "<U092c><U093f><U092b><U0947><U0020>";/
+ "<U0938><U0942><U0915><U0020>";/
+ "<U0938><U0928><U093f><U091a><U0930><U0020>"
+%
+% Abbreviated month names (%b)
+abmon "<U091C><U0928><U0935><U0930><U0940>";/
+ "<U092B><U093C><U0930><U0935><U0930><U0940>";/
+ "<U092E><U093E><U0930><U094D><U091A>";/
+ "<U0905><U092A><U094D><U0930><U0947><U0932>";/
+ "<U092E><U0908>";"<U091C><U0942><U0928>";/
+ "<U091C><U0941><U0932><U093E><U0908>";/
+ "<U0905><U0917><U0938><U094D><U0924>";/
+ "<U0938><U093F><U0924><U092E><U094D><U092C><U0930>";/
+ "<U0905><U0915><U094D><U091F><U0942><U092C><U0930>";/
+ "<U0928><U0935><U092E><U094D><U092C><U0930>";/
+ "<U0926><U093F><U0938><U092E><U094D><U092C><U0930>"
+%
+% Full month names (%B)
+mon "<U091C><U0928><U0935><U0930><U0940>";/
+ "<U092B><U093C><U0930><U0935><U0930><U0940>";/
+ "<U092E><U093E><U0930><U094D><U091A>";/
+ "<U0905><U092A><U094D><U0930><U0947><U0932>";/
+ "<U092E><U0908>";"<U091C><U0942><U0928>";/
+ "<U091C><U0941><U0932><U093E><U0908>";/
+ "<U0905><U0917><U0938><U094D><U0924>";/
+ "<U0938><U093F><U0924><U092E><U094D><U092C><U0930>";/
+ "<U0905><U0915><U094D><U091F><U0942><U092C><U0930>";/
+ "<U0928><U0935><U092E><U094D><U092C><U0930>";/
+ "<U0926><U093F><U0938><U092E><U094D><U092C><U0930>"
+%
+% Equivalent of AM PM
+am_pm "<U092A><U0942><U0930><U094D><U0935><U093E><U0939><U094D><U0928>";/
+ "<U0905><U092A><U0930><U093E><U0939><U094D><U0928>"
+%
+% Appropriate date and time representation
+% %A %d %b %Y%I:%M:%S %Z
+d_t_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/
+<U0020><U0025><U0059><U0020><U0025><U0049><U003A><U0025><U004D><U003A>/
+<U0025><U0053><U0020><U0025><U0070><U0020><U0025><U005A>"
+%
+% Appropriate date representation
+% %A %d %b %Y
+d_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/
+<U0020><U0025><U0059>"
+%
+% Appropriate time representation
+% %I:%M:%S %Z
+t_fmt "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0020><U0025><U005A>"
+%
+% Appropriate 12 h time representation (%r)
+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0025><U0070><U0020><U0025><U005A>"
+%
+date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
+<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U005A><U0020><U0025><U0059>"
+END LC_TIME
+
+LC_MESSAGES
+copy "hi_IN"
+END LC_MESSAGES
+
+
+LC_PAPER
+copy "hi_IN"
+END LC_PAPER
+
+
+LC_NAME
+% This is the ISO_IEC TR14652 Locale definition for the
+% LC_NAME category.
+%
+name_fmt "<U0025><U0070><U0025><U0074><U0025><U0066><U0025><U0074>/
+<U0025><U0067>"
+name_gen ""
+name_mr "<U0936><U094d><U0930><U0940><U002E>"
+name_mrs "U0936><U094d><U0930><U0940><U092e><U0924><U0940><U002E>"
+name_miss "<U0938><U0941><U0936><U094d><U0930><U0940><U002E>"
+name_ms "<U0938><U0941><U0936><U094d><U0930><U0940><U002E>"
+
+END LC_NAME
+
+
+LC_ADDRESS
+copy "hi_IN"
+END LC_ADDRESS
+
+
+LC_TELEPHONE
+copy "hi_IN"
+END LC_TELEPHONE
+
+
+LC_MEASUREMENT
+copy "hi_IN"
+END LC_MEASUREMENT
diff --git a/libc/localedata/tst-strptime.c b/libc/localedata/tst-strptime.c
deleted file mode 100644
index bc2c7f1b6..000000000
--- a/libc/localedata/tst-strptime.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <locale.h>
-#include <time.h>
-#include <stdio.h>
-#include <string.h>
-
-static int
-do_test (void)
-{
- int result = 0;
-
- if (setlocale (LC_ALL, "vi_VN.TCVN5712-1") == NULL)
- {
- puts ("cannot set locale");
- return 1;
- }
- struct tm tm;
- memset (&tm, '\0', sizeof (tm));
- /* This is November in Vietnamese encoded using TCVN5712-1. */
- static const char s[] = "\
-\x54\x68\xb8\x6e\x67\x20\x6d\xad\xea\x69\x20\x6d\xe9\x74\0";
- char *r = strptime (s, "%b", &tm);
- printf ("r = %p, r-s = %tu, tm.tm_mon = %d\n", r, r - s, tm.tm_mon);
- result = r == NULL || r - s != 14 || tm.tm_mon != 10;
-
- if (setlocale (LC_ALL, "ja_JP.UTF-8") == NULL)
- {
- puts ("cannot set locale");
- return 1;
- }
- static const char s2[] = "\
-\x32\x35\x20\x30\x36\x20\xe5\xb9\xb3\xe6\x88\x90\x32\x30\0";
- memset (&tm, '\0', sizeof (tm));
- r = strptime (s2, "%d %m %EC%Ey", &tm);
- printf ("\
-r = %p, r-s2 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n",
- r, r - s2, tm.tm_mday, tm.tm_mon, tm.tm_year);
- result |= (r == NULL || r - s2 != 14 || tm.tm_mday != 25 || tm.tm_mon != 5
- || tm.tm_year != 108);
-
- static const char s3[] = "\
-\x32\x35\x20\x30\x36\x20\xe5\xb9\xb3\xe6\x88\x90\x32\x30\xe5\xb9\xb4\0";
- memset (&tm, '\0', sizeof (tm));
- r = strptime (s3, "%d %m %EY", &tm);
- printf ("\
-r = %p, r-s3 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n",
- r, r - s3, tm.tm_mday, tm.tm_mon, tm.tm_year);
- result |= (r == NULL || r - s3 != 17 || tm.tm_mday != 25 || tm.tm_mon != 5
- || tm.tm_year != 108);
-
- return result;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/libc/malloc/malloc.c b/libc/malloc/malloc.c
index 79cdc5233..28039b472 100644
--- a/libc/malloc/malloc.c
+++ b/libc/malloc/malloc.c
@@ -228,6 +228,8 @@
#include <stdio.h> /* needed for malloc_stats */
#include <errno.h>
+#include <shlib-compat.h>
+
/* For uintptr_t. */
#include <stdint.h>
@@ -337,16 +339,20 @@ __malloc_assert (const char *assertion, const char *file, unsigned int line,
#ifndef MALLOC_ALIGNMENT
-/* XXX This is the correct definition. It differs from 2*SIZE_SZ only on
- powerpc32. For the time being, changing this is causing more
- compatibility problems due to malloc_get_state/malloc_set_state than
- will returning blocks not adequately aligned for long double objects
- under -mlong-double-128.
-
-#define MALLOC_ALIGNMENT (2 * SIZE_SZ < __alignof__ (long double) \
- ? __alignof__ (long double) : 2 * SIZE_SZ)
-*/
-#define MALLOC_ALIGNMENT (2 * SIZE_SZ)
+# if !SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_16)
+/* This is the correct definition when there is no past ABI to constrain it.
+
+ Among configurations with a past ABI constraint, it differs from
+ 2*SIZE_SZ only on powerpc32. For the time being, changing this is
+ causing more compatibility problems due to malloc_get_state and
+ malloc_set_state than will returning blocks not adequately aligned for
+ long double objects under -mlong-double-128. */
+
+# define MALLOC_ALIGNMENT (2 * SIZE_SZ < __alignof__ (long double) \
+ ? __alignof__ (long double) : 2 * SIZE_SZ)
+# else
+# define MALLOC_ALIGNMENT (2 * SIZE_SZ)
+# endif
#endif
/* The corresponding bit mask value */
@@ -1466,18 +1472,23 @@ typedef struct malloc_chunk* mbinptr;
The bins top out around 1MB because we expect to service large
requests via mmap.
+
+ Bin 0 does not exist. Bin 1 is the unordered list; if that would be
+ a valid chunk size the small bins are bumped up one.
*/
#define NBINS 128
#define NSMALLBINS 64
#define SMALLBIN_WIDTH MALLOC_ALIGNMENT
-#define MIN_LARGE_SIZE (NSMALLBINS * SMALLBIN_WIDTH)
+#define SMALLBIN_CORRECTION (MALLOC_ALIGNMENT > 2 * SIZE_SZ)
+#define MIN_LARGE_SIZE ((NSMALLBINS - SMALLBIN_CORRECTION) * SMALLBIN_WIDTH)
#define in_smallbin_range(sz) \
((unsigned long)(sz) < (unsigned long)MIN_LARGE_SIZE)
#define smallbin_index(sz) \
- (SMALLBIN_WIDTH == 16 ? (((unsigned)(sz)) >> 4) : (((unsigned)(sz)) >> 3))
+ ((SMALLBIN_WIDTH == 16 ? (((unsigned)(sz)) >> 4) : (((unsigned)(sz)) >> 3)) \
+ + SMALLBIN_CORRECTION)
#define largebin_index_32(sz) \
(((((unsigned long)(sz)) >> 6) <= 38)? 56 + (((unsigned long)(sz)) >> 6): \
@@ -1487,6 +1498,14 @@ typedef struct malloc_chunk* mbinptr;
((((unsigned long)(sz)) >> 18) <= 2)? 124 + (((unsigned long)(sz)) >> 18): \
126)
+#define largebin_index_32_big(sz) \
+(((((unsigned long)(sz)) >> 6) <= 45)? 49 + (((unsigned long)(sz)) >> 6): \
+ ((((unsigned long)(sz)) >> 9) <= 20)? 91 + (((unsigned long)(sz)) >> 9): \
+ ((((unsigned long)(sz)) >> 12) <= 10)? 110 + (((unsigned long)(sz)) >> 12): \
+ ((((unsigned long)(sz)) >> 15) <= 4)? 119 + (((unsigned long)(sz)) >> 15): \
+ ((((unsigned long)(sz)) >> 18) <= 2)? 124 + (((unsigned long)(sz)) >> 18): \
+ 126)
+
// XXX It remains to be seen whether it is good to keep the widths of
// XXX the buckets the same or whether it should be scaled by a factor
// XXX of two as well.
@@ -1499,7 +1518,9 @@ typedef struct malloc_chunk* mbinptr;
126)
#define largebin_index(sz) \
- (SIZE_SZ == 8 ? largebin_index_64 (sz) : largebin_index_32 (sz))
+ (SIZE_SZ == 8 ? largebin_index_64 (sz) \
+ : MALLOC_ALIGNMENT == 16 ? largebin_index_32_big (sz) \
+ : largebin_index_32 (sz))
#define bin_index(sz) \
((in_smallbin_range(sz)) ? smallbin_index(sz) : largebin_index(sz))
@@ -2267,8 +2288,12 @@ static void* sysmalloc(INTERNAL_SIZE_T nb, mstate av)
is no following chunk whose prev_size field could be used.
See the front_misalign handling below, for glibc there is no
- need for further alignments. */
- size = (nb + SIZE_SZ + pagemask) & ~pagemask;
+ need for further alignments unless we have have high alignment.
+ */
+ if (MALLOC_ALIGNMENT == 2 * SIZE_SZ)
+ size = (nb + SIZE_SZ + pagemask) & ~pagemask;
+ else
+ size = (nb + SIZE_SZ + MALLOC_ALIGN_MASK + pagemask) & ~pagemask;
tried_mmap = true;
/* Don't try if size wraps around 0 */
@@ -2284,14 +2309,29 @@ static void* sysmalloc(INTERNAL_SIZE_T nb, mstate av)
returned start address to meet alignment requirements here
and in memalign(), and still be able to compute proper
address argument for later munmap in free() and realloc().
+ */
- For glibc, chunk2mem increases the address by 2*SIZE_SZ and
- MALLOC_ALIGN_MASK is 2*SIZE_SZ-1. Each mmap'ed area is page
- aligned and therefore definitely MALLOC_ALIGN_MASK-aligned. */
- assert (((INTERNAL_SIZE_T)chunk2mem(mm) & MALLOC_ALIGN_MASK) == 0);
-
- p = (mchunkptr)mm;
- set_head(p, size|IS_MMAPPED);
+ if (MALLOC_ALIGNMENT == 2 * SIZE_SZ)
+ {
+ /* For glibc, chunk2mem increases the address by 2*SIZE_SZ and
+ MALLOC_ALIGN_MASK is 2*SIZE_SZ-1. Each mmap'ed area is page
+ aligned and therefore definitely MALLOC_ALIGN_MASK-aligned. */
+ assert (((INTERNAL_SIZE_T)chunk2mem(mm) & MALLOC_ALIGN_MASK) == 0);
+ front_misalign = 0;
+ }
+ else
+ front_misalign = (INTERNAL_SIZE_T)chunk2mem(mm) & MALLOC_ALIGN_MASK;
+ if (front_misalign > 0) {
+ correction = MALLOC_ALIGNMENT - front_misalign;
+ p = (mchunkptr)(mm + correction);
+ p->prev_size = correction;
+ set_head(p, (size - correction) |IS_MMAPPED);
+ }
+ else
+ {
+ p = (mchunkptr)mm;
+ set_head(p, size|IS_MMAPPED);
+ }
/* update statistics */
@@ -2356,11 +2396,12 @@ static void* sysmalloc(INTERNAL_SIZE_T nb, mstate av)
top(av) = chunk_at_offset(heap, sizeof(*heap));
set_head(top(av), (heap->size - sizeof(*heap)) | PREV_INUSE);
- /* Setup fencepost and free the old top chunk. */
+ /* Setup fencepost and free the old top chunk with a multiple of
+ MALLOC_ALIGNMENT in size. */
/* The fencepost takes at least MINSIZE bytes, because it might
become the top chunk again later. Note that a footer is set
up, too, although the chunk is marked in use. */
- old_size -= MINSIZE;
+ old_size = (old_size - MINSIZE) & ~MALLOC_ALIGN_MASK;
set_head(chunk_at_offset(old_top, old_size + 2*SIZE_SZ), 0|PREV_INUSE);
if (old_size >= MINSIZE) {
set_head(chunk_at_offset(old_top, old_size), (2*SIZE_SZ)|PREV_INUSE);
@@ -2559,8 +2600,24 @@ static void* sysmalloc(INTERNAL_SIZE_T nb, mstate av)
/* handle non-contiguous cases */
else {
- /* MORECORE/mmap must correctly align */
- assert(((unsigned long)chunk2mem(brk) & MALLOC_ALIGN_MASK) == 0);
+ if (MALLOC_ALIGNMENT == 2 * SIZE_SZ)
+ /* MORECORE/mmap must correctly align */
+ assert(((unsigned long)chunk2mem(brk) & MALLOC_ALIGN_MASK) == 0);
+ else {
+ front_misalign = (INTERNAL_SIZE_T)chunk2mem(brk) & MALLOC_ALIGN_MASK;
+ if (front_misalign > 0) {
+
+ /*
+ Skip over some bytes to arrive at an aligned position.
+ We don't need to specially mark these wasted front bytes.
+ They will never be accessed anyway because
+ prev_inuse of av->top (and any chunk created from its start)
+ is always true after initialization.
+ */
+
+ aligned_brk += MALLOC_ALIGNMENT - front_misalign;
+ }
+ }
/* Find out current end of memory */
if (snd_brk == (char*)(MORECORE_FAILURE)) {
@@ -3753,8 +3810,9 @@ _int_free(mstate av, mchunkptr p, int have_lock)
malloc_printerr (check_action, errstr, chunk2mem(p));
return;
}
- /* We know that each chunk is at least MINSIZE bytes in size. */
- if (__builtin_expect (size < MINSIZE, 0))
+ /* We know that each chunk is at least MINSIZE bytes in size or a
+ multiple of MALLOC_ALIGNMENT. */
+ if (__builtin_expect (size < MINSIZE || !aligned_OK (size), 0))
{
errstr = "free(): invalid size";
goto errout;
@@ -4513,12 +4571,12 @@ __malloc_usable_size(void* m)
/*
------------------------------ mallinfo ------------------------------
+ Accumulate malloc statistics for arena AV into M.
*/
-static struct mallinfo
-int_mallinfo(mstate av)
+static void
+int_mallinfo(mstate av, struct mallinfo *m)
{
- struct mallinfo mi;
size_t i;
mbinptr b;
mchunkptr p;
@@ -4558,29 +4616,40 @@ int_mallinfo(mstate av)
}
}
- mi.smblks = nfastblocks;
- mi.ordblks = nblocks;
- mi.fordblks = avail;
- mi.uordblks = av->system_mem - avail;
- mi.arena = av->system_mem;
- mi.hblks = mp_.n_mmaps;
- mi.hblkhd = mp_.mmapped_mem;
- mi.fsmblks = fastavail;
- mi.keepcost = chunksize(av->top);
- mi.usmblks = mp_.max_total_mem;
- return mi;
+ m->smblks += nfastblocks;
+ m->ordblks += nblocks;
+ m->fordblks += avail;
+ m->uordblks += av->system_mem - avail;
+ m->arena += av->system_mem;
+ m->fsmblks += fastavail;
+ if (av == &main_arena)
+ {
+ m->hblks = mp_.n_mmaps;
+ m->hblkhd = mp_.mmapped_mem;
+ m->usmblks = mp_.max_total_mem;
+ m->keepcost = chunksize(av->top);
+ }
}
struct mallinfo __libc_mallinfo()
{
struct mallinfo m;
+ mstate ar_ptr;
if(__malloc_initialized < 0)
ptmalloc_init ();
- (void)mutex_lock(&main_arena.mutex);
- m = int_mallinfo(&main_arena);
- (void)mutex_unlock(&main_arena.mutex);
+
+ memset(&m, 0, sizeof (m));
+ ar_ptr = &main_arena;
+ do {
+ (void)mutex_lock(&ar_ptr->mutex);
+ int_mallinfo(ar_ptr, &m);
+ (void)mutex_unlock(&ar_ptr->mutex);
+
+ ar_ptr = ar_ptr->next;
+ } while (ar_ptr != &main_arena);
+
return m;
}
@@ -4593,7 +4662,6 @@ __malloc_stats()
{
int i;
mstate ar_ptr;
- struct mallinfo mi;
unsigned int in_use_b = mp_.mmapped_mem, system_b = in_use_b;
#if THREAD_STATS
long stat_lock_direct = 0, stat_lock_loop = 0, stat_lock_wait = 0;
@@ -4605,8 +4673,11 @@ __malloc_stats()
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
for (i=0, ar_ptr = &main_arena;; i++) {
+ struct mallinfo mi;
+
+ memset(&mi, 0, sizeof(mi));
(void)mutex_lock(&ar_ptr->mutex);
- mi = int_mallinfo(ar_ptr);
+ int_mallinfo(ar_ptr, &mi);
fprintf(stderr, "Arena %d:\n", i);
fprintf(stderr, "system bytes = %10u\n", (unsigned int)mi.arena);
fprintf(stderr, "in use bytes = %10u\n", (unsigned int)mi.uordblks);
diff --git a/libc/malloc/mtrace.c b/libc/malloc/mtrace.c
index e299a1623..d1049c982 100644
--- a/libc/malloc/mtrace.c
+++ b/libc/malloc/mtrace.c
@@ -1,5 +1,5 @@
/* More debugging hooks for `malloc'.
- Copyright (C) 1991-1994,1996-2004, 2008, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written April 2, 1991 by John Gilmore of Cygnus Support.
Based on mcheck.c by Mike Haertel.
@@ -36,7 +36,7 @@
#include <libc-internal.h>
#include <libio/iolibio.h>
-#define setvbuf(s, b, f, l) INTUSE(_IO_setvbuf) (s, b, f, l)
+#define setvbuf(s, b, f, l) _IO_setvbuf (s, b, f, l)
#define fwrite(buf, size, count, fp) _IO_fwrite (buf, size, count, fp)
#include <kernel-features.h>
diff --git a/libc/manual/.gitignore b/libc/manual/.gitignore
deleted file mode 100644
index 55c49c998..000000000
--- a/libc/manual/.gitignore
+++ /dev/null
@@ -1,30 +0,0 @@
-*.aux
-*.c.texi
-*.cp
-*.cps
-*.dvi*
-*.fn
-*.fns
-*.info*
-*.ky
-*.kys
-*.log
-*.pdf
-*.pg
-*.pgs
-*.ps
-*.tmp
-*.toc
-*.tp
-*.tps
-*.vr
-*.vrs
-chapters.texi
-dir-add.texi
-dir-add.texinfo
-libm-err.texi
-stamp-*
-summary.texi
-texis
-top-menu.texi
-version.texi
diff --git a/libc/manual/Makefile b/libc/manual/Makefile
index 89fe3b29b..52c51cf0a 100644
--- a/libc/manual/Makefile
+++ b/libc/manual/Makefile
@@ -19,29 +19,25 @@
# Makefile for the GNU C Library manual.
subdir := manual
-export subdir := $(subdir)
# Allow override
INSTALL_INFO = install-info
-.PHONY: all dvi pdf info html
-all: dvi
-dvi: libc.dvi
-pdf: libc.pdf
+.PHONY: dvi pdf info html
# Get glibc's configuration info.
include ../Makeconfig
+dvi: $(objpfx)libc.dvi
+pdf: $(objpfx)libc.pdf
+
TEXI2DVI = texi2dvi
TEXI2PDF = texi2dvi --pdf
ifneq ($(strip $(MAKEINFO)),:)
-all: info
-info: libc.info
+info: $(objpfx)libc.info
endif
-mkinstalldirs = $(..)scripts/mkinstalldirs
-
chapters = $(addsuffix .texi, \
intro errno memory ctype string charset locale \
message search pattern io stdio llio filesys \
@@ -62,34 +58,45 @@ nonexamples = $(filter-out $(add-chapters) %.c.texi, $(texis))
examples = $(filter-out $(foreach d, $(add-ons), ../$d/%.c.texi), \
$(filter %.c.texi, $(texis)))
+# Generated files directly included from libc.texinfo.
+libc-texi-generated = chapters.texi top-menu.texi dir-add.texi \
+ libm-err.texi version.texi pkgvers.texi
+
+# Add path to build dir for generated files
+texis-path := $(filter-out $(libc-texi-generated) summary.texi $(examples), \
+ $(texis)) \
+ $(addprefix $(objpfx),$(filter $(libc-texi-generated) summary.texi \
+ $(examples), $(texis)))
+
# Kludge: implicit rule so Make knows the one command does it all.
-chapters.% top-menu.%: libc-texinfo.sh $(texis) Makefile
- AWK=$(AWK) $(SHELL) $< '$(chapters)' \
+chapters.% top-menu.%: libc-texinfo.sh $(texis-path) Makefile
+ AWK=$(AWK) $(SHELL) $< $(objpfx) \
+ '$(chapters)' \
'$(add-chapters)' \
'$(appendices) $(licenses)'
-# Generated files directly included from libc.texinfo.
-libc-texi-generated = chapters.texi top-menu.texi dir-add.texi \
- libm-err.texi version.texi pkgvers.texi
-libc.dvi libc.pdf libc.info: $(libc-texi-generated)
-libc.dvi libc.pdf: texinfo.tex
+$(objpfx)libc.dvi $(objpfx)libc.pdf $(objpfx)libc.info: \
+ $(addprefix $(objpfx),$(libc-texi-generated))
+$(objpfx)libc.dvi $(objpfx)libc.pdf: texinfo.tex
-html: libc/index.html
-libc/index.html: $(libc-texi-generated)
- $(MAKEINFO) --html libc.texinfo
+html: $(objpfx)libc/index.html
+$(objpfx)libc/index.html: $(addprefix $(objpfx),$(libc-texi-generated))
+ $(MAKEINFO) -P $(objpfx) -o $(objpfx)libc --html libc.texinfo
# Generate the summary from the Texinfo source files for each chapter.
-summary.texi: stamp-summary ;
-stamp-summary: summary.awk $(filter-out summary.texi, $(texis))
- $(AWK) -f $^ | sort -t' ' -df -k 1,1 | tr '\014' '\012' > summary-tmp
- $(move-if-change) summary-tmp summary.texi
+$(objpfx)summary.texi: $(objpfx)stamp-summary ;
+$(objpfx)stamp-summary: summary.awk $(filter-out $(objpfx)summary.texi, \
+ $(texis-path))
+ $(AWK) -f $^ | sort -t' ' -df -k 1,1 | tr '\014' '\012' \
+ > $(objpfx)summary-tmp
+ $(move-if-change) $(objpfx)summary-tmp $(objpfx)summary.texi
touch $@
# Generate a file which can be added to the `dir' content to provide direct
# access to the documentation of the function, variables, and other
# definitions.
-dir-add.texi: xtract-typefun.awk $(texis)
+$(objpfx)dir-add.texi: xtract-typefun.awk $(texis-path)
(echo "@dircategory GNU C library functions and macros"; \
echo "@direntry"; \
$(AWK) -f $^ | sort; \
@@ -97,31 +104,31 @@ dir-add.texi: xtract-typefun.awk $(texis)
mv -f $@.new $@
# The table with the math errors is generated.
-libm-err.texi: stamp-libm-err
-stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
+$(objpfx)libm-err.texi: $(objpfx)stamp-libm-err
+$(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
$(dir)/libm-test-ulps))
pwd=`pwd`; \
- $(PERL) $< $$pwd/.. > libm-err-tmp
- $(move-if-change) libm-err-tmp libm-err.texi
+ $(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp
+ $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi
touch $@
# Package version and bug reporting URL.
-pkgvers.texi: stamp-pkgvers
-stamp-pkgvers:
- echo "@set PKGVERSION $(PKGVERSION_TEXI)" > pkgvers-tmp
- echo "@set REPORT_BUGS_TO $(REPORT_BUGS_TEXI)" >> pkgvers-tmp
- $(move-if-change) pkgvers-tmp pkgvers.texi
+$(objpfx)pkgvers.texi: $(objpfx)stamp-pkgvers
+$(objpfx)stamp-pkgvers:
+ echo "@set PKGVERSION $(PKGVERSION_TEXI)" > $(objpfx)pkgvers-tmp
+ echo "@set REPORT_BUGS_TO $(REPORT_BUGS_TEXI)" >> $(objpfx)pkgvers-tmp
+ $(move-if-change) $(objpfx)pkgvers-tmp $(objpfx)pkgvers.texi
touch $@
# Generate a file with the version number.
-version.texi: stamp-version ;
-stamp-version: $(common-objpfx)config.make
- echo "@set VERSION $(version)" > version-tmp
- $(move-if-change) version-tmp version.texi
+$(objpfx)version.texi: $(objpfx)stamp-version ;
+$(objpfx)stamp-version: $(common-objpfx)config.make
+ echo "@set VERSION $(version)" > $(objpfx)version-tmp
+ $(move-if-change) $(objpfx)version-tmp $(objpfx)version.texi
touch $@
# Generate Texinfo files from the C source for the example programs.
-%.c.texi: examples/%.c
+$(objpfx)%.c.texi: examples/%.c
sed -e '1,/^\*\/$$/d' \
-e 's,[{}],@&,g' \
-e 's,/\*\(@.*\)\*/,\1,g' \
@@ -130,14 +137,17 @@ stamp-version: $(common-objpfx)config.make
$< | expand > $@.new
mv -f $@.new $@
-%.info: %.texinfo
- LANGUAGE=C LC_ALL=C $(MAKEINFO) $<
+$(objpfx)%.info: %.texinfo
+ LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=$@ $<
-%.dvi: %.texinfo
- $(TEXI2DVI) $<
+$(objpfx)%.dvi: %.texinfo
+ cd $(objpfx);$(TEXI2DVI) -I $(shell cd $(<D) && pwd) --output=$@ \
+ $(shell cd $(<D) && pwd)/$<
+
+$(objpfx)%.pdf: %.texinfo
+ cd $(objpfx);$(TEXI2PDF) -I $(shell cd $(<D) && pwd) --output=$@ \
+ $(shell cd $(<D) && pwd)/$<
-%.pdf: %.texinfo
- $(TEXI2PDF) $<
# Distribution.
minimal-dist = summary.awk texis.awk tsort.awk libc-texinfo.sh libc.texinfo \
@@ -145,21 +155,19 @@ minimal-dist = summary.awk texis.awk tsort.awk libc-texinfo.sh libc.texinfo \
$(filter-out summary.texi, $(nonexamples)) \
$(patsubst %.c.texi,examples/%.c, $(examples))
-.PHONY: mostlyclean distclean realclean clean
-mostlyclean:
- -rm -f libc.dvi libc.pdf libc.tmp libc.info*
- -rm -f $(objpfx)stubs
- -rm -f $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
-clean: mostlyclean
-distclean: clean
indices = cp fn pg tp vr ky
-realclean: distclean
- -rm -f texis summary.texi stamp-summary *.c.texi
- -rm -f $(foreach index,$(indices),libc.$(index) libc.$(index)s)
- -rm -f libc.log libc.aux libc.toc
- -rm -f $(libc-texi-generated)
-
-.PHONY: install subdir_install installdirs install-data
+generated-dirs := libc
+generated = libc.dvi libc.pdf libc.tmp libc.info* \
+ stubs \
+ texis summary.texi stamp-summary *.c.texi \
+ $(foreach index,$(indices),libc.$(index) libc.$(index)s) \
+ libc.log libc.aux libc.toc \
+ $(libc-texi-generated) \
+ stamp-libm-err stamp-version
+
+include ../Rules
+
+.PHONY: install subdir_install install-data
install-data subdir_install: install
ifneq ($(strip $(MAKEINFO)),:)
install: $(inst_infodir)/libc.info
@@ -171,58 +179,11 @@ endif
# Catchall implicit rule for other installation targets from the parent.
install-%: ;
-$(inst_infodir)/libc.info: libc.info installdirs
+$(inst_infodir)/libc.info: $(objpfx)libc.info
+ $(make-target-directory)
for file in $<*; do \
- $(INSTALL_DATA) $$file $(@D)/$$file; \
+ $(INSTALL_DATA) $$file $(@D)/; \
done
-installdirs:
- $(mkinstalldirs) $(inst_infodir)
-
TAGS: $(minimal-dist)
$(ETAGS) -o $@ $^
-
-# The parent makefile sometimes invokes us with targets `subdir_REAL-TARGET'.
-subdir_%: % ;
-# For targets we don't define, do nothing.
-subdir_%: ;
-
-# These are targets that each glibc subdirectory is expected to understand.
-# ../Rules defines them for code subdirectories; for us, they are no-ops.
-# None of these should be `subdir_TARGET'; those targets are transformed
-# by the implicit rule above into `TARGET' deps.
-glibc-targets := lib objects objs others tests xtests lint.out echo-headers
-.PHONY: $(glibc-targets)
-$(glibc-targets):
-
-# Create stamp files if they don't exist, so the parent makefile's rules for
-# updating the library archives are happy with us, and never think we have
-# changed the library.
-lib: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
-ifdef objpfx
-.PHONY: stubs
-stubs: $(objpfx)stubs
-endif
-$(objpfx)stubs ../po/manual.pot:
- $(make-target-directory)
- touch $@
-$(objpfx)stamp%:
- $(make-target-directory)
- touch $@
-
-# Make the target directory if it doesn't exist, using the `mkinstalldirs'
-# script that does `mkdir -p' even if `mkdir' doesn't support that flag.
-define make-target-directory
-$(addprefix $(mkinstalldirs) ,\
- $(filter-out $(wildcard $(@D:%/=%)),$(@D:%/=%)))
-endef
-
-# The top-level glibc Makefile expects subdir_install to update the stubs file.
-subdir_install: stubs
-
-# Get rid of these variables if they came from the parent.
-routines =
-aux =
-sources =
-objects =
-headers =
diff --git a/libc/manual/contrib.texi b/libc/manual/contrib.texi
index ed1065659..4d16f4e6e 100644
--- a/libc/manual/contrib.texi
+++ b/libc/manual/contrib.texi
@@ -2,175 +2,301 @@
@c %MENU% Who wrote what parts of the GNU C Library
@appendix Contributors to @theglibc{}
-@Theglibc{} was written originally by Roland McGrath, and is
-currently maintained by Ulrich Drepper. Some parts of the library were
-contributed or worked on by other people.
+@Theglibc{} project would like to thank its many contributors.
+Without them the project would not have been nearly as successful as
+it has been. Any omissions in this list are accidental. Feel free to
+file a bug in bugzilla if you have been left out or some of your
+contributions are not listed. Please keep this list in alphabetical
+order.
@itemize @bullet
+
@item
-The @code{getopt} function and related code was written by
-Richard Stallman, @w{David J.} MacKenzie, and @w{Roland McGrath}.
+Ryan S. Arnold for his improvements for Linux on PowerPC.
@item
-The merge sort function @code{qsort} was written by Michael J. Haertel.
+Miles Bader for writing the @code{argp} argument-parsing package, and the
+@code{argz}/@code{envz} interfaces.
@item
-The quick sort function used as a fallback by @code{qsort} was written
-by Douglas C. Schmidt.
+Jeff Bailey for his maintainership of the HPPA architecture.
@item
-The memory allocation functions @code{malloc}, @code{realloc} and
-@code{free} and related code were written by Michael J. Haertel,
-@w{Wolfram Gloger}, and @w{Doug Lea}.
+Petr Baudis for bug fixes and testing.
@item
-Fast implementations of many of the string functions (@code{memcpy},
-@code{strlen}, etc.) were written by Torbj@"orn Granlund.
+Stephen R. van den Berg for contributing a highly-optimized
+@code{strstr} function.
@item
-The @file{tar.h} header file was written by David J. MacKenzie.
+Eric Blake for adding O(n) implementations of @code{memmem},
+@code{strstr} and @code{strcasestr}.
@item
-The port to the MIPS DECStation running Ultrix 4
-(@code{mips-dec-ultrix4})
-was contributed by Brendan Kehoe and Ian Lance Taylor.
+Philip Blundell for the ports to Linux/ARM
+(@code{arm-@var{ANYTHING}-linuxaout}) and ARM standalone
+(@code{arm-@var{ANYTHING}-none}), as well as for parts of the IPv6
+support code.
@item
-The DES encryption function @code{crypt} and related functions were
-contributed by Michael Glad.
+Per Bothner for the implementation of the @code{libio} library which
+is used to implement @code{stdio} functions.
@item
-The @code{ftw} and @code{nftw} functions were contributed by Ulrich Drepper.
+Mark Brown for his direction as part of @theglibc{} steering
+committee.
@item
-The startup code to support SunOS shared libraries was contributed by
-Tom Quinn.
+Thomas Bushnell for his contributions to Hurd.
@item
-The @code{mktime} function was contributed by Paul Eggert.
+Liubov Dmitrieva for optimzed string functions on x86-64 and x86.
@item
-The port to the Sequent Symmetry running Dynix version 3
-(@code{i386-sequent-bsd}) was contributed by Jason Merrill.
+Ulrich Drepper for his many contributions in almost all parts of
+@theglibc{}, including:
+@itemize @bullet
+@item internationalization support, including the @code{locale} and
+@code{localedef} utilities.
+@item Linux i386/ELF support
+@item the @code{hsearch} and @code{drand48} families of functions,
+reentrant @samp{@dots{}@code{_r}} versions of the @code{random}
+family; System V shared memory and IPC support code
+@item several highly-optimized string functions for i@var{x}86
+processors
+@item many math functions
+@item the character conversion functions (@code{iconv})
+@item the @code{ftw} and @code{nftw} functions
+@item the floating-point printing function used by @code{printf} and friends
+and the floating-point reading function used by @code{scanf},
+@code{strtod} and friends
+@item the @code{catgets} support and the entire suite of multi-byte
+and wide-character support functions (@file{wctype.h}, @file{wchar.h}, etc.).
+@item versioning of objects on the symbol level
+@end itemize
@item
-The timezone support code is derived from the public-domain timezone
-package by Arthur David Olson and his many contributors.
+Paul Eggert for the @code{mktime} function and for his direction as
+part of @theglibc{} steering committee.
@item
-The port to the DEC Alpha running OSF/1 (@code{alpha-dec-osf1}) was
-contributed by Brendan Kehoe, using some code written by Roland McGrath.
+Mike Frysinger for his maintaining of the IA64 architecture and for
+testing and bug fixing.
@item
-The port to SGI machines running Irix 4 (@code{mips-sgi-irix4}) was
-contributed by Tom Quinn.
+Michael Glad for the DES encryption function @code{crypt} and related
+functions.
@item
-The port of the Mach and Hurd code to the MIPS architecture
-(@code{mips-@var{anything}-gnu}) was contributed by Kazumoto Kojima.
+Wolfram Gloger for contributing the memory allocation functions
+functions @code{malloc}, @code{realloc} and @code{free} and related
+code.
@item
-The floating-point printing function used by @code{printf} and friends
-and the floating-point reading function used by @code{scanf},
-@code{strtod} and friends were written by Ulrich Drepper. The
-multi-precision integer functions used in those functions are taken from
-GNU MP, which was contributed by Torbj@"orn Granlund.
+Torbj@"orn Granlund for fast implementations of many of the string
+functions (@code{memcpy}, @code{strlen}, etc.).
@item
-The internationalization support in the library, and the support
-programs @code{locale} and @code{localedef}, were written by Ulrich
-Drepper. Ulrich Drepper adapted the support code for message catalogs
-(@file{libintl.h}, etc.) from the GNU @code{gettext} package, which he
-also wrote. He also contributed the @code{catgets} support and the
-entire suite of multi-byte and wide-character support functions
-(@file{wctype.h}, @file{wchar.h}, etc.).
+Michael J. Haertel for writing the merge sort function @code{qsort}
+and malloc checking functions like @code{mcheck}.
@item
-The implementations of the @file{nsswitch.conf} mechanism and the files
-and DNS backends for it were designed and written by Ulrich Drepper and
-Roland McGrath, based on a backend interface defined by Peter Eriksson.
+Bruno Haible for his improvements to the @code{iconv} and locale
+implementations.
@item
-The port to Linux i386/ELF (@code{i386-@var{anything}-linux}) was
-contributed by Ulrich Drepper, based in large part on work done in
-Hongjiu Lu's Linux version of @theglibc{}.
+Richard Henderson for the port to Linux on Alpha
+(@code{alpha-@var{anything}-linux}).
@item
-The port to Linux/m68k (@code{m68k-@var{anything}-linux}) was
-contributed by Andreas Schwab.
+Daniel Jacobowitz for various fixes and enhancements.
@item
-The ports to Linux/ARM (@code{arm-@var{ANYTHING}-linuxaout}) and ARM
-standalone (@code{arm-@var{ANYTHING}-none}), as well as parts of the
-IPv6 support code, were contributed by Philip Blundell.
+Andreas Jaeger for the port to Linux on x86-64
+(@code{x86_64-@var{anything}-linux} and his work on Linux for MIPS
+(@code{mips-@var{anything}-linux}), implementing the @file{ldconfig}
+program, providing a test suite for the math library and for his
+direction as part of @theglibc{} steering committee.
@item
-Richard Henderson contributed the ELF dynamic linking code and other
-support for the Alpha processor.
+Aurelien Jarno for various fixes.
@item
-David Mosberger-Tang contributed the port to Linux/Alpha
+Jakub Jelinek for implementing a number of checking functions and for
+his direction as part of @theglibc{} steering committee.
+
+@item
+Geoffrey Keating for the port to Linux on PowerPC
+(@code{powerpc-@var{anything}-linux}).
+
+@item
+Brendan Kehoe for contributing the port to the MIPS DECStation running
+Ultrix 4 (@code{mips-dec-ultrix4}) and the port to the DEC Alpha
+running OSF/1 (@code{alpha-dec-osf1}).
+
+@item
+Mark Kettenis for implementing the @code{utmpx} interface and an utmp
+daemon, and for a Hesiod NSS module.
+
+@item
+Kazumoto Kojima for the port of the Mach and Hurd code to the MIPS
+architecture (@code{mips-@var{anything}-gnu}) and for his work on the
+SH architecture.
+
+@item
+Andreas Krebbel for his work on Linux for s390 and s390x.
+
+@item
+Thorsten Kukuk for providing an implementation for NIS (YP) and NIS+,
+securelevel 0, 1 and 2 and for the implementation for a caching daemon
+for NSS (@file{nscd}).
+
+@item
+Jeff Law for various fixes.
+
+@item
+Doug Lea for contributing the memory allocation functions
+functions @code{malloc}, @code{realloc} and @code{free} and related
+code.
+
+@item
+Hongjiu Lu for providing the support for a Linux 32-bit runtime
+environment under x86-64 (x32), for porting to Linux on IA64, for
+improved string functions and many bug fixes.
+
+@item
+Luis Machado for optimized functions on PowerPC.
+
+@item
+David J. MacKenzie for his contribution to the @code{getopt}
+function and writing the @file{tar.h} header.
+
+@item
+Greg McGary for adding runtime support for bounds checking.
+
+@item
+Roland McGrath for writing most of @theglibc{} originally, for his
+work on the Hurd port, his direction as part of @theglibc{} steering
+committee, and for many bug fixes and reviewing of contributions.
+
+@item
+Jason Merrill for the port to the Sequent Symmetry running Dynix
+version 3 (@code{i386-sequent-bsd}).
+
+@item
+Chris Metcalf for the port to Linux/Tile
+(@code{tilegx-@var{anything}-linux} and
+@code{tilepro-@var{anything}-linux}).
+
+@item
+David Miller for contributing the port to Linux/Sparc
+(@code{sparc*-@var{anything}-linux}).
+
+@item
+Alan Modra for his improvements for Linux on PowerPC.
+
+@item
+David Mosberger-Tang for contributing the port to Linux/Alpha
(@code{alpha-@var{anything}-linux}).
@item
-The port to Linux on PowerPC (@code{powerpc-@var{anything}-linux})
-was contributed by Geoffrey Keating.
+Stephen Moshier for implementing some 128-bit long double format math
+functions.
@item
-Miles Bader wrote the argp argument-parsing package, and the argz/envz
-interfaces.
+Stephen Munroe for his port to Linux on PowerPC64
+(@code{powerpc64-@var{anything}-linux}) and for adding optimized
+implementations for PowerPC.
@item
-Stephen R. van den Berg contributed a highly-optimized @code{strstr} function.
+Joseph S. Myers for numerous bug fixes for the libm functions and for
+his maintainership of the ARM and MIPS architectures.
@item
-Ulrich Drepper contributed the @code{hsearch} and @code{drand48}
-families of functions; reentrant @samp{@dots{}@code{_r}} versions of the
-@code{random} family; System V shared memory and IPC support code; and
-several highly-optimized string functions for i@var{x}86 processors.
+Carlos O'Donell for his maintainership of the HPPA architecture and
+maintaining @theglibc{} web pages.
@item
-The math functions are taken from @code{fdlibm-5.1} by Sun
-Microsystems, as modified by J.T. Conklin, Ian Lance Taylor,
-Ulrich Drepper, Andreas Schwab, and Roland McGrath.
+Alexandra Oliva for adding TLS descriptors for LD and GD on x86 and
+x86-64.
@item
-The @code{libio} library used to implement @code{stdio} functions on
-some platforms was written by Per Bothner and modified by Ulrich Drepper.
+Paul Pluzhnikov for various fixes.
@item
-Eric Youngdale and Ulrich Drepper implemented versioning of objects on
-the symbol level.
+Marek Polacek for various fixes.
@item
-Thorsten Kukuk provided an implementation for NIS (YP) and NIS+,
-securelevel 0, 1 and 2.
+Siddhesh Poyarekar for various fixes.
@item
-Andreas Jaeger provided a test suite for the math library.
+Pravin Satpute for writing sorting rules for some Indian languages.
@item
-Mark Kettenis implemented the utmpx interface and an utmp daemon.
+Martin Schwidefsky for porting to Linux on s390
+(@code{s390-@var{anything}-linux}) and s390x
+(@code{s390x-@var{anything}-linux}).
@item
-Ulrich Drepper added character conversion functions (@code{iconv}).
+Carlos Eduardo Seo for optimized functions on PowerPC.
@item
-Thorsten Kukuk provided an implementation for a caching daemon for NSS
-(nscd).
+Franz Sirl for various fixes.
@item
-Tim Waugh provided an implementation of the POSIX.2 wordexp function family.
+Jes Sorensen for porting to Linux on IA64 (@code{ia64-@var{anything}-linux}).
@item
-Mark Kettenis provided a Hesiod NSS module.
+Richard Stallman for his contribution to the @code{getopt} function.
@item
-The Internet-related code (most of the @file{inet} subdirectory) and
-several other miscellaneous functions and header files have been
-included from 4.4 BSD with little or no modification. The copying
-permission notice for this code can be found in the file @file{LICENSES}
-in the source distribution.
+Douglas C. Schmidt for writing the quick sort function used as a
+fallback by @code{qsort}.
+
+@item
+Andreas Schwab for the port to Linux/m68k
+(@code{m68k-@var{anything}-linux}) and for his direction as part of
+@theglibc{} steering committee.
+
+@item
+Thomas Schwinge for his contribution to Hurd and the SH architecture.
+
+@item
+Alfred M. Szmidt for various fixes.
+
+@item
+Ian Lance Taylor for contributing the port to the MIPS DECStation
+running Ultrix 4 (@code{mips-dec-ultrix4}).
+
+@item
+Tom Quinn for contributing the startup code to support SunOS shared
+libraries and the port to SGI machines running Irix 4
+(@code{mips-sgi-irix4}).
+
+@item
+Tim Waugh for the implementation of the POSIX.2 @code{wordexp}
+function family.
+
+@item
+Eric Youngdale for implementing versioning of objects on the symbol level.
+
+@item
+Adhemerval Zanella for optimized functions on PowerPC.
+
+@end itemize
+
+Some code in @theglibc{} comes from other projects and might be under
+a different license:
+
+@itemize @bullet
+@item
+The timezone support code is derived from the public-domain timezone
+package by Arthur David Olson and his many contributors.
+
+@item
+Some of the support code for Mach is taken from Mach 3.0 by CMU;
+the file if_ppp.h is also copyright by CMU, but under a different license;
+see the file @file{LICENSES} for the text of the licenses.
@item
The random number generation functions @code{random}, @code{srandom},
@@ -182,6 +308,18 @@ changes to fit into @theglibc{} and to fit the @w{ISO C} standard,
but the functional code is Berkeley's.@refill
@item
+The Internet-related code (most of the @file{inet} subdirectory) and
+several other miscellaneous functions and header files have been
+included from 4.4 BSD with little or no modification. The copying
+permission notice for this code can be found in the file @file{LICENSES}
+in the source distribution.
+
+@item
+The @code{getaddrinfo} and @code{getnameinfo} functions and supporting
+code were written by Craig Metz; see the file @file{LICENSES} for
+details on their licensing.
+
+@item
The DNS resolver code is taken directly from BIND 4.9.5, which
includes copyrighted code from UC Berkeley and from Digital Equipment
Corporation. See the file @file{LICENSES} for the text of the DEC license.
@@ -192,9 +330,14 @@ The code to support Sun RPC is taken verbatim from Sun's
text of the license.
@item
-Some of the support code for Mach is taken from Mach 3.0 by CMU;
-the file if_ppp.h is also copyright by CMU, but under a different license;
-see the file @file{LICENSES} for the text of the licenses.
+The math functions are taken from @code{fdlibm-5.1} by Sun
+Microsystems, as modified by J.T. Conklin, Ian Lance Taylor,
+Ulrich Drepper, Andreas Schwab, and Roland McGrath.
+
+@item
+Many of the IEEE 64-bit double precision math functions
+(in the @file{sysdeps/ieee754/dbl-64} subdirectory) come
+from the IBM Accurate Mathematical Library, contributed by IBM.
@item
Many of the IA64 math functions are taken from a collection of
@@ -202,14 +345,4 @@ Many of the IA64 math functions are taken from a collection of
makes available under a free license; see the file @file{LICENSES} for
details.
-@item
-The @code{getaddrinfo} and @code{getnameinfo} functions and supporting
-code were written by Craig Metz; see the file @file{LICENSES} for
-details on their licensing.
-
-@item
-Many of the IEEE 64-bit double precision math functions
-(in the @file{sysdeps/ieee754/dbl-64} subdirectory) come
-from the IBM Accurate Mathematical Library, contributed by IBM.
-
@end itemize
diff --git a/libc/manual/examples/search.c b/libc/manual/examples/search.c
index e37656721..7fe05ea2d 100644
--- a/libc/manual/examples/search.c
+++ b/libc/manual/examples/search.c
@@ -53,8 +53,11 @@ int count = sizeof (muppets) / sizeof (struct critter);
/* This is the comparison function used for sorting and searching. */
int
-critter_cmp (const struct critter *c1, const struct critter *c2)
+critter_cmp (const void *v1, const void *v2)
{
+ const struct critter *c1 = v1;
+ const struct critter *c2 = v2;
+
return strcmp (c1->name, c2->name);
}
diff --git a/libc/manual/install.texi b/libc/manual/install.texi
index 655654429..2661ee04a 100644
--- a/libc/manual/install.texi
+++ b/libc/manual/install.texi
@@ -50,8 +50,8 @@ $ ../glibc-@var{version}/configure @var{args@dots{}}
@end smallexample
Please note that even though you're building in a separate build
-directory, the compilation needs to modify a few files in the source
-directory, especially some files in the manual subdirectory.
+directory, the compilation may need to create or modify files and
+directories in the source directory.
@noindent
@code{configure} takes many options, but the only one that is usually
@@ -203,10 +203,10 @@ system such as @file{/etc/passwd}, @file{/etc/nsswitch.conf} and others.
These files must all contain correct and sensible content.
To format the @cite{GNU C Library Reference Manual} for printing, type
-@w{@code{make dvi}}. You need a working @TeX{} installation to do this.
-The distribution already includes the on-line formatted version of the
-manual, as Info files. You can regenerate those with @w{@code{make
-info}}, but it shouldn't be necessary.
+@w{@code{make dvi}}. You need a working @TeX{} installation to do
+this. The distribution builds the on-line formatted version of the
+manual, as Info files, as part of the build process. You can build
+them manually with @w{@code{make info}}.
The library has a number of special-purpose configuration parameters
which you can find in @file{Makeconfig}. These can be overwritten with
@@ -275,8 +275,8 @@ One auxiliary program, @file{/usr/libexec/pt_chown}, is installed setuid
sets the permissions on a pseudoterminal so it can be used by the
calling process. This means programs like @code{xterm} and
@code{screen} do not have to be setuid to get a pty. (There may be
-other reasons why they need privileges.) If you are using a 2.1 or
-newer Linux kernel with the @code{devptsfs} or @code{devfs} filesystems
+other reasons why they need privileges.) If you are using a
+Linux kernel with the @code{devptsfs} or @code{devfs} filesystems
providing pty slaves, you don't need this program; otherwise you do.
The source for @file{pt_chown} is in @file{login/programs/pt_chown.c}.
@@ -334,7 +334,7 @@ No other assembler or linker has the necessary functionality at the
moment.
@item
-GNU @code{texinfo} 3.12f
+GNU @code{texinfo} 4.5 or later
To correctly translate and install the Texinfo documentation you need
this version of the @code{texinfo} package. Earlier versions do not
@@ -428,11 +428,6 @@ if you configure @theglibc{} with @samp{--prefix=/usr}. If you set some other
prefix or allow it to default to @file{/usr/local}, then all the
components are installed there.
-You cannot use @code{nscd} with 2.0 kernels, due to bugs in the
-kernel-side thread support. @code{nscd} happens to hit these bugs
-particularly hard, but you might have problems with any threaded
-program.
-
@node Reporting Bugs
@appendixsec Reporting Bugs
@cindex reporting bugs
diff --git a/libc/manual/libc-texinfo.sh b/libc/manual/libc-texinfo.sh
index 79ac9773e..60e224bb8 100644
--- a/libc/manual/libc-texinfo.sh
+++ b/libc/manual/libc-texinfo.sh
@@ -1,10 +1,13 @@
#! /bin/sh
+OUTDIR=$1
+shift
+
# Create libc.texinfo from the chapter files.
-trap "rm -f *.$$; exit 1" 1 2 15
+trap "rm -f ${OUTDIR}*.$$; exit 1" 1 2 15
-exec 3>incl.$$ 4>smenu.$$ 5>lmenu.$$
+exec 3>${OUTDIR}incl.$$ 4>${OUTDIR}smenu.$$ 5>${OUTDIR}lmenu.$$
build_menu () {
while IFS=: read file node; do
@@ -51,7 +54,7 @@ collect_nodes $3 | build_menu
exec 3>&- 4>&- 5>&-
-mv -f incl.$$ chapters.texi
+mv -f ${OUTDIR}incl.$$ ${OUTDIR}chapters.texi
{
echo '@menu'
@@ -72,7 +75,7 @@ mv -f incl.$$ chapters.texi
}
!/^\*/ { print; }
- ' smenu.$$
+ ' ${OUTDIR}smenu.$$
cat <<EOF
* Free Manuals:: Free Software Needs Free Documentation.
* Copying:: The GNU Lesser General Public License says
@@ -90,8 +93,8 @@ Indices
--- The Detailed Node Listing ---
EOF
- cat lmenu.$$
- echo '@end menu'; } >top-menu.texi.$$
-mv -f top-menu.texi.$$ top-menu.texi
+ cat ${OUTDIR}lmenu.$$
+ echo '@end menu'; } >${OUTDIR}top-menu.texi.$$
+mv -f ${OUTDIR}top-menu.texi.$$ ${OUTDIR}top-menu.texi
-rm -f *.$$
+rm -f ${OUTDIR}*.$$
diff --git a/libc/manual/startup.texi b/libc/manual/startup.texi
index ed75e7bdc..0420e9328 100644
--- a/libc/manual/startup.texi
+++ b/libc/manual/startup.texi
@@ -34,8 +34,9 @@ This chapter looks at program startup from the execee's point of view. To
see the event from the execor's point of view, see @ref{Executing a File}.
@menu
-* Program Arguments:: Parsing your program's command-line arguments.
+* Program Arguments:: Parsing your program's command-line arguments
* Environment Variables:: Less direct parameters affecting your program
+* Auxiliary Vector:: Least direct parameters affecting your program
* System Calls:: Requesting service from the system
* Program Termination:: Telling the system you're done; return status
@end menu
@@ -590,6 +591,33 @@ reordering of command line arguments by @code{getopt} and
@c !!! GNU also has COREFILE, CORESERVER, EXECSERVERS
@end table
+@node Auxiliary Vector
+@section Auxiliary Vector
+@cindex auxiliary vector
+
+When a program is executed, it receives information from the operating
+system about the environment in which it is operating. The form of this
+information is a table of key-value pairs, where the keys are from the
+set of @samp{AT_} values in @file{elf.h}. Some of the data is provided
+by the kernel for libc consumption, and may be obtained by ordinary
+interfaces, such as @code{sysconf}. However, on a platform-by-platform
+basis there may be information that is not available any other way.
+
+@subsection Definition of @code{getauxval}
+@comment sys/auxv.h
+@deftypefun {unsigned long int} getauxval (unsigned long int @var{type})
+This function is used to inquire about the entries in the auxiliary
+vector. The @var{type} argument should be one of the @samp{AT_} symbols
+defined in @file{elf.h}. If a matching entry is found, the value is
+returned; if the entry is not found, zero is returned.
+@end deftypefun
+
+For some platforms, the key @code{AT_HWCAP} is the easiest way to inquire
+about any instruction set extensions available at runtime. In this case,
+there will (of necessity) be a platform-specific set of @samp{HWCAP_}
+values masked together that describe the capabilities of the cpu on which
+the program is being executed.
+
@node System Calls
@section System Calls
diff --git a/libc/manual/string.texi b/libc/manual/string.texi
index af21bccf4..831873b12 100644
--- a/libc/manual/string.texi
+++ b/libc/manual/string.texi
@@ -886,6 +886,7 @@ concat (const char *str, @dots{})
@{
char *newp;
char *wp;
+ const char *s;
va_start (ap, str);
@@ -1369,8 +1370,11 @@ efficiently using @code{strxfrm}.)
/* @r{This is the comparison function used with @code{qsort}.} */
int
-compare_elements (char **p1, char **p2)
+compare_elements (const void *v1, const void *v2)
@{
+ char * const *p1 = v1;
+ char * const *p1 = v2;
+
return strcoll (*p1, *p2);
@}
@@ -1461,8 +1465,11 @@ struct sorter @{ char *input; char *transformed; @};
@r{to sort an array of @code{struct sorter}.} */
int
-compare_elements (struct sorter *p1, struct sorter *p2)
+compare_elements (const void *v1, const void *v2)
@{
+ const struct sorter *p1 = v1;
+ const struct sorter *p2 = v2;
+
return strcmp (p1->transformed, p2->transformed);
@}
diff --git a/libc/math/bug-nextafter.c b/libc/math/bug-nextafter.c
index 1d21841ea..558b15839 100644
--- a/libc/math/bug-nextafter.c
+++ b/libc/math/bug-nextafter.c
@@ -4,6 +4,12 @@
#include <stdlib.h>
#include <stdio.h>
+#if !defined(FE_OVERFLOW) && !defined(FE_UNDERFLOW)
+/* If there's no support for the exceptions this test is checking,
+ then just return success and allow the test to be compiled. */
+# define fetestexcept(e) 1
+#endif
+
float zero = 0.0;
float inf = INFINITY;
diff --git a/libc/math/bug-nexttoward.c b/libc/math/bug-nexttoward.c
index ff57e5e3f..cedb7767b 100644
--- a/libc/math/bug-nexttoward.c
+++ b/libc/math/bug-nexttoward.c
@@ -4,6 +4,12 @@
#include <stdlib.h>
#include <stdio.h>
+#if !defined(FE_OVERFLOW) && !defined(FE_UNDERFLOW)
+/* If there's no support for the exceptions this test is checking,
+ then just return success and allow the test to be compiled. */
+# define fetestexcept(e) 1
+#endif
+
float zero = 0.0;
float inf = INFINITY;
diff --git a/libc/math/gen-libm-test.pl b/libc/math/gen-libm-test.pl
index ae00427a0..c2c22a5b1 100755
--- a/libc/math/gen-libm-test.pl
+++ b/libc/math/gen-libm-test.pl
@@ -76,15 +76,6 @@ use vars qw ($output_dir $ulps_file $default_ulp);
"M_LOG_2_SQRT_PIl" => "log(2*sqrt(pi))",
"M_2_SQRT_PIl" => "2 sqrt (pi)",
"M_SQRT_PIl" => "sqrt (pi)",
- "INVALID_EXCEPTION" => "invalid exception",
- "DIVIDE_BY_ZERO_EXCEPTION" => "division by zero exception",
- "OVERFLOW_EXCEPTION" => "overflow exception",
- "INVALID_EXCEPTION_OK" => "invalid exception allowed",
- "DIVIDE_BY_ZERO_EXCEPTION_OK" => "division by zero exception allowed",
- "OVERFLOW_EXCEPTION_OK" => "overflow exception allowed",
- "EXCEPTIONS_OK" => "exceptions allowed",
- "IGNORE_ZERO_INF_SIGN" => "sign of zero/inf not specified",
-"INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN" => "invalid exception and sign of zero/inf not specified"
);
@@ -220,9 +211,6 @@ sub special_functions {
$str = 'sincos (' . &beautify ($args[1]) . ', &sin_res, &cos_res)';
# handle sin
$test = $str . ' puts ' . &beautify ($args[2]) . ' in sin_res';
- if ($#args == 4) {
- $test .= " plus " . &beautify ($args[4]);
- }
$cline = " check_float (\"$test\", sin_res, $args[2]";
$cline .= &new_test ($test, $args[4]);
@@ -316,11 +304,6 @@ sub parse_args {
}
- # check for exceptions
- if ($current_arg <= $#args) {
- $str .= " plus " . &beautify ($args[$current_arg]);
- }
-
# Put the C program line together
# Reset some variables to start again
$current_arg = 1;
diff --git a/libc/math/libm-test.inc b/libc/math/libm-test.inc
index 98e46a32e..04ee0067a 100644
--- a/libc/math/libm-test.inc
+++ b/libc/math/libm-test.inc
@@ -78,8 +78,8 @@
against. These implemented tests should check all cases that are
specified in ISO C99.
- Exception testing: At the moment only divide-by-zero, invalid and
- overflow exceptions are tested. Underflow and inexact exceptions
+ Exception testing: At the moment only divide-by-zero, invalid,
+ overflow and underflow exceptions are tested. Inexact exceptions
aren't checked at the moment.
NaN values: There exist signalling and quiet NaNs. This implementation
@@ -129,18 +129,60 @@
#include <argp.h>
#include <gnu/option-groups.h>
+/* Allow platforms without all rounding modes to test properly,
+ assuming they provide an __FE_UNDEFINED in <bits/fenv.h> which
+ causes fesetround() to return failure. */
+#ifndef FE_TONEAREST
+# define FE_TONEAREST __FE_UNDEFINED
+#endif
+#ifndef FE_TOWARDZERO
+# define FE_TOWARDZERO __FE_UNDEFINED
+#endif
+#ifndef FE_UPWARD
+# define FE_UPWARD __FE_UNDEFINED
+#endif
+#ifndef FE_DOWNWARD
+# define FE_DOWNWARD __FE_UNDEFINED
+#endif
+
/* Possible exceptions */
#define NO_EXCEPTION 0x0
#define INVALID_EXCEPTION 0x1
#define DIVIDE_BY_ZERO_EXCEPTION 0x2
#define OVERFLOW_EXCEPTION 0x4
+#define UNDERFLOW_EXCEPTION 0x8
/* The next flags signals that those exceptions are allowed but not required. */
-#define INVALID_EXCEPTION_OK 0x8
-#define DIVIDE_BY_ZERO_EXCEPTION_OK 0x10
-#define OVERFLOW_EXCEPTION_OK 0x20
+#define INVALID_EXCEPTION_OK 0x10
+#define DIVIDE_BY_ZERO_EXCEPTION_OK 0x20
+#define OVERFLOW_EXCEPTION_OK 0x40
+#define UNDERFLOW_EXCEPTION_OK 0x80
#define EXCEPTIONS_OK INVALID_EXCEPTION_OK+DIVIDE_BY_ZERO_EXCEPTION_OK
-/* Some special test flags, passed togther with exceptions. */
-#define IGNORE_ZERO_INF_SIGN 0x40
+/* Some special test flags, passed together with exceptions. */
+#define IGNORE_ZERO_INF_SIGN 0x100
+
+/* Values underflowing only for float. */
+#ifdef TEST_FLOAT
+# define UNDERFLOW_EXCEPTION_FLOAT UNDERFLOW_EXCEPTION
+# define UNDERFLOW_EXCEPTION_OK_FLOAT UNDERFLOW_EXCEPTION_OK
+#else
+# define UNDERFLOW_EXCEPTION_FLOAT 0
+# define UNDERFLOW_EXCEPTION_OK_FLOAT 0
+#endif
+/* Values underflowing only for double or types with a larger least
+ positive normal value. */
+#if defined TEST_FLOAT || defined TEST_DOUBLE \
+ || (defined TEST_LDOUBLE && LDBL_MIN_EXP >= DBL_MIN_EXP)
+# define UNDERFLOW_EXCEPTION_DOUBLE UNDERFLOW_EXCEPTION
+#else
+# define UNDERFLOW_EXCEPTION_DOUBLE 0
+#endif
+/* Values underflowing only for IBM long double or types with a larger least
+ positive normal value. */
+#if defined TEST_FLOAT || (defined TEST_LDOUBLE && LDBL_MIN_EXP > DBL_MIN_EXP)
+# define UNDERFLOW_EXCEPTION_LDOUBLE_IBM UNDERFLOW_EXCEPTION
+#else
+# define UNDERFLOW_EXCEPTION_LDOUBLE_IBM 0
+#endif
/* Various constants (we must supply them precalculated for accuracy). */
#define M_PI_6l .52359877559829887307710723054658383L
@@ -466,6 +508,11 @@ test_exceptions (const char *test_name, int exception)
test_single_exception (test_name, exception, OVERFLOW_EXCEPTION,
FE_OVERFLOW, "Overflow");
#endif
+#ifdef FE_UNDERFLOW
+ if ((exception & UNDERFLOW_EXCEPTION_OK) == 0)
+ test_single_exception (test_name, exception, UNDERFLOW_EXCEPTION,
+ FE_UNDERFLOW, "Underflow");
+#endif
feclearexcept (FE_ALL_EXCEPT);
}
@@ -1947,6 +1994,37 @@ ccos_test (void)
TEST_c_c (ccos, 0.75L, 1.25L, 1.38173873063425888530729933139078645L, -1.09193013555397466170919531722024128L);
TEST_c_c (ccos, -2, -3, -4.18962569096880723013255501961597373L, -9.10922789375533659797919726277886212L);
+ TEST_c_c (ccos, 0.75, 89.5, 2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
+ TEST_c_c (ccos, 0.75, -89.5, 2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
+ TEST_c_c (ccos, -0.75, 89.5, 2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
+ TEST_c_c (ccos, -0.75, -89.5, 2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
+
+#ifndef TEST_FLOAT
+ TEST_c_c (ccos, 0.75, 710.5, 1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
+ TEST_c_c (ccos, 0.75, -710.5, 1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
+ TEST_c_c (ccos, -0.75, 710.5, 1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
+ TEST_c_c (ccos, -0.75, -710.5, 1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (ccos, 0.75, 11357.25, 9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
+ TEST_c_c (ccos, 0.75, -11357.25, 9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
+ TEST_c_c (ccos, -0.75, 11357.25, 9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
+ TEST_c_c (ccos, -0.75, -11357.25, 9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
+#endif
+
+#ifdef TEST_FLOAT
+ TEST_c_c (ccos, 0x1p-149, 180, plus_infty, -1.043535896672617552965983803453927655332e33L, OVERFLOW_EXCEPTION);
+#endif
+
+#if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
+ TEST_c_c (ccos, 0x1p-1074, 1440, plus_infty, -5.981479269486130556466515778180916082415e301L, OVERFLOW_EXCEPTION);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (ccos, 0x1p-16434L, 22730, plus_infty, -1.217853148905605987081057582351152052687e4924L, OVERFLOW_EXCEPTION);
+#endif
+
END (ccos, complex);
}
@@ -2016,6 +2094,37 @@ ccosh_test (void)
TEST_c_c (ccosh, -2, -3, -3.72454550491532256547397070325597253L, 0.511822569987384608834463849801875634L);
+ TEST_c_c (ccosh, 89.5, 0.75, 2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
+ TEST_c_c (ccosh, -89.5, 0.75, 2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
+ TEST_c_c (ccosh, 89.5, -0.75, 2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
+ TEST_c_c (ccosh, -89.5, -0.75, 2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
+
+#ifndef TEST_FLOAT
+ TEST_c_c (ccosh, 710.5, 0.75, 1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
+ TEST_c_c (ccosh, -710.5, 0.75, 1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
+ TEST_c_c (ccosh, 710.5, -0.75, 1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
+ TEST_c_c (ccosh, -710.5, -0.75, 1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (ccosh, 11357.25, 0.75, 9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
+ TEST_c_c (ccosh, -11357.25, 0.75, 9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
+ TEST_c_c (ccosh, 11357.25, -0.75, 9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
+ TEST_c_c (ccosh, -11357.25, -0.75, 9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
+#endif
+
+#ifdef TEST_FLOAT
+ TEST_c_c (ccosh, 180, 0x1p-149, plus_infty, 1.043535896672617552965983803453927655332e33L, OVERFLOW_EXCEPTION);
+#endif
+
+#if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
+ TEST_c_c (ccosh, 1440, 0x1p-1074, plus_infty, 5.981479269486130556466515778180916082415e301L, OVERFLOW_EXCEPTION);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (ccosh, 22730, 0x1p-16434L, plus_infty, 1.217853148905605987081057582351152052687e4924L, OVERFLOW_EXCEPTION);
+#endif
+
END (ccosh, complex);
}
@@ -2190,16 +2299,16 @@ cexp_test (void)
#endif
TEST_c_c (cexp, 88.75, 0.75, 2.558360358486542817001900410314204322891e38L, 2.383359453227311447654736314679677655100e38L);
- TEST_c_c (cexp, -95, 0.75, 4.039714446238306526889476684000081624047e-42L, 3.763383677300535390271646960780570275931e-42L);
+ TEST_c_c (cexp, -95, 0.75, 4.039714446238306526889476684000081624047e-42L, 3.763383677300535390271646960780570275931e-42L, UNDERFLOW_EXCEPTION_FLOAT);
#ifndef TEST_FLOAT
TEST_c_c (cexp, 709.8125, 0.75, 1.355121963080879535248452862759108365762e308L, 1.262426823598609432507811340856186873507e308L);
- TEST_c_c (cexp, -720, 0.75, 1.486960657116368433685753325516638551722e-313L, 1.385247284245720590980701226843815229385e-313L);
+ TEST_c_c (cexp, -720, 0.75, 1.486960657116368433685753325516638551722e-313L, 1.385247284245720590980701226843815229385e-313L, UNDERFLOW_EXCEPTION_DOUBLE);
#endif
#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
TEST_c_c (cexp, 11356.5625, 0.75, 9.052188470850960144814815984311663764287e4931L, 8.432986734191301036267148978260970230200e4931L);
- TEST_c_c (cexp, -11370, 0.75, 8.631121063182211587489310508568170739592e-4939L, 8.040721827809267291427062346918413482824e-4939L);
+ TEST_c_c (cexp, -11370, 0.75, 8.631121063182211587489310508568170739592e-4939L, 8.040721827809267291427062346918413482824e-4939L, UNDERFLOW_EXCEPTION);
#endif
#ifdef TEST_FLOAT
@@ -2301,7 +2410,7 @@ clog_test (void)
TEST_c_c (clog, -2, -3, 1.2824746787307683680267437207826593L, -2.1587989303424641704769327722648368L);
TEST_c_c (clog, 0x1.fffffep+127L, 0x1.fffffep+127L, 89.06941264234832570836679262104313101776L, M_PI_4l);
- TEST_c_c (clog, 0x1.fffffep+127L, 1.0L, 88.72283905206835305365817656031404273372L, 2.938736052218037251011746307725933020145e-39L);
+ TEST_c_c (clog, 0x1.fffffep+127L, 1.0L, 88.72283905206835305365817656031404273372L, 2.938736052218037251011746307725933020145e-39L, UNDERFLOW_EXCEPTION_FLOAT);
TEST_c_c (clog, 0x1p-149L, 0x1p-149L, -102.9323563131518784484589700365392203592L, M_PI_4l);
TEST_c_c (clog, 0x1p-147L, 0x1p-147L, -101.5460619520319878296245057936228672231L, M_PI_4l);
@@ -2385,7 +2494,7 @@ clog10_test (void)
TEST_c_c (clog10, -2, -3, 0.556971676153418384603252578971164214L, -0.937554462986374708541507952140189646L);
TEST_c_c (clog10, 0x1.fffffep+127L, 0x1.fffffep+127L, 38.68235441693561449174780668781319348761L, M_PI4_LOG10El);
- TEST_c_c (clog10, 0x1.fffffep+127L, 1.0L, 38.53183941910362389414093724045094697423L, 1.276276851248440096917018665609900318458e-39L);
+ TEST_c_c (clog10, 0x1.fffffep+127L, 1.0L, 38.53183941910362389414093724045094697423L, 1.276276851248440096917018665609900318458e-39L, UNDERFLOW_EXCEPTION_FLOAT);
TEST_c_c (clog10, 0x1p-149L, 0x1p-149L, -44.70295435610120748924022586658721447508L, M_PI4_LOG10El);
TEST_c_c (clog10, 0x1p-147L, 0x1p-147L, -44.10089436477324509881274807713822842154L, M_PI4_LOG10El);
@@ -2900,6 +3009,37 @@ csin_test (void)
TEST_c_c (csin, 0.75L, 1.25L, 1.28722291002649188575873510790565441L, 1.17210635989270256101081285116138863L);
TEST_c_c (csin, -2, -3, -9.15449914691142957346729954460983256L, 4.16890695996656435075481305885375484L);
+ TEST_c_c (csin, 0.75, 89.5, 2.522786001038096774676288412995370563339e38L, 2.708024460708609732016532185663087200560e38L);
+ TEST_c_c (csin, 0.75, -89.5, 2.522786001038096774676288412995370563339e38L, -2.708024460708609732016532185663087200560e38L);
+ TEST_c_c (csin, -0.75, 89.5, -2.522786001038096774676288412995370563339e38L, 2.708024460708609732016532185663087200560e38L);
+ TEST_c_c (csin, -0.75, -89.5, -2.522786001038096774676288412995370563339e38L, -2.708024460708609732016532185663087200560e38L);
+
+#ifndef TEST_FLOAT
+ TEST_c_c (csin, 0.75, 710.5, 1.255317763348154410745082950806112487736e308L, 1.347490911916428129246890157395342279438e308L);
+ TEST_c_c (csin, 0.75, -710.5, 1.255317763348154410745082950806112487736e308L, -1.347490911916428129246890157395342279438e308L);
+ TEST_c_c (csin, -0.75, 710.5, -1.255317763348154410745082950806112487736e308L, 1.347490911916428129246890157395342279438e308L);
+ TEST_c_c (csin, -0.75, -710.5, -1.255317763348154410745082950806112487736e308L, -1.347490911916428129246890157395342279438e308L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (csin, 0.75, 11357.25, 8.385498349388321535962327491346664141020e4931L, 9.001213196851067077465606717616495588201e4931L);
+ TEST_c_c (csin, 0.75, -11357.25, 8.385498349388321535962327491346664141020e4931L, -9.001213196851067077465606717616495588201e4931L);
+ TEST_c_c (csin, -0.75, 11357.25, -8.385498349388321535962327491346664141020e4931L, 9.001213196851067077465606717616495588201e4931L);
+ TEST_c_c (csin, -0.75, -11357.25, -8.385498349388321535962327491346664141020e4931L, -9.001213196851067077465606717616495588201e4931L);
+#endif
+
+#ifdef TEST_FLOAT
+ TEST_c_c (csin, 0x1p-149, 180, 1.043535896672617552965983803453927655332e33L, plus_infty, OVERFLOW_EXCEPTION);
+#endif
+
+#if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
+ TEST_c_c (csin, 0x1p-1074, 1440, 5.981479269486130556466515778180916082415e301L, plus_infty, OVERFLOW_EXCEPTION);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (csin, 0x1p-16434L, 22730, 1.217853148905605987081057582351152052687e4924L, plus_infty, OVERFLOW_EXCEPTION);
+#endif
+
END (csin, complex);
}
@@ -2968,6 +3108,37 @@ csinh_test (void)
TEST_c_c (csinh, 0.75L, 1.25L, 0.259294854551162779153349830618433028L, 1.22863452409509552219214606515777594L);
TEST_c_c (csinh, -2, -3, 3.59056458998577995201256544779481679L, -0.530921086248519805267040090660676560L);
+ TEST_c_c (csinh, 89.5, 0.75, 2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
+ TEST_c_c (csinh, -89.5, 0.75, -2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
+ TEST_c_c (csinh, 89.5, -0.75, 2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
+ TEST_c_c (csinh, -89.5, -0.75, -2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
+
+#ifndef TEST_FLOAT
+ TEST_c_c (csinh, 710.5, 0.75, 1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
+ TEST_c_c (csinh, -710.5, 0.75, -1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
+ TEST_c_c (csinh, 710.5, -0.75, 1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
+ TEST_c_c (csinh, -710.5, -0.75, -1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (csinh, 11357.25, 0.75, 9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
+ TEST_c_c (csinh, -11357.25, 0.75, -9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
+ TEST_c_c (csinh, 11357.25, -0.75, 9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
+ TEST_c_c (csinh, -11357.25, -0.75, -9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
+#endif
+
+#ifdef TEST_FLOAT
+ TEST_c_c (csinh, 180, 0x1p-149, plus_infty, 1.043535896672617552965983803453927655332e33L, OVERFLOW_EXCEPTION);
+#endif
+
+#if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
+ TEST_c_c (csinh, 1440, 0x1p-1074, plus_infty, 5.981479269486130556466515778180916082415e301L, OVERFLOW_EXCEPTION);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (csinh, 22730, 0x1p-16434L, plus_infty, 1.217853148905605987081057582351152052687e4924L, OVERFLOW_EXCEPTION);
+#endif
+
END (csinh, complex);
}
@@ -3046,7 +3217,8 @@ csqrt_test (void)
#ifndef TEST_FLOAT
TEST_c_c (csqrt, 0x1.fffffffffffffp+1023L, 0x1.fffffffffffffp+1023L, 1.473094556905565378990473658199034571917e+154L, 6.101757441282702188537080005372547713595e+153L);
TEST_c_c (csqrt, 0x1.fffffffffffffp+1023L, 0x1p+1023L, 1.379778091031440685006200821918878702861e+154L, 3.257214233483129514781233066898042490248e+153L);
- TEST_c_c (csqrt, 0x1p-1074L, 0x1p-1074L, 2.442109726130830256743814843868934877597e-162L, 1.011554969366634726113090867589031782487e-162L);
+ /* Bug 14157: spurious exception may occur. */
+ TEST_c_c (csqrt, 0x1p-1074L, 0x1p-1074L, 2.442109726130830256743814843868934877597e-162L, 1.011554969366634726113090867589031782487e-162L, UNDERFLOW_EXCEPTION_OK);
TEST_c_c (csqrt, 0x1p-1073L, 0x1p-1073L, 3.453664695497464982856905711457966660085e-162L, 1.430554756764195530630723976279903095110e-162L);
#endif
@@ -3113,17 +3285,17 @@ ctan_test (void)
TEST_c_c (ctan, 0.75L, 1.25L, 0.160807785916206426725166058173438663L, 0.975363285031235646193581759755216379L);
TEST_c_c (ctan, -2, -3, 0.376402564150424829275122113032269084e-2L, -1.00323862735360980144635859782192726L);
- TEST_c_c (ctan, 1, 45, 1.490158918874345552942703234806348520895e-39L, 1.000000000000000000000000000000000000001L);
- TEST_c_c (ctan, 1, 47, 2.729321264492904590777293425576722354636e-41L, 1.0);
+ TEST_c_c (ctan, 1, 45, 1.490158918874345552942703234806348520895e-39L, 1.000000000000000000000000000000000000001L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_c_c (ctan, 1, 47, 2.729321264492904590777293425576722354636e-41L, 1.0, UNDERFLOW_EXCEPTION_FLOAT);
#ifndef TEST_FLOAT
- TEST_c_c (ctan, 1, 355, 8.140551093483276762350406321792653551513e-309L, 1.0);
- TEST_c_c (ctan, 1, 365, 1.677892637497921890115075995898773550884e-317L, 1.0);
+ TEST_c_c (ctan, 1, 355, 8.140551093483276762350406321792653551513e-309L, 1.0, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_c_c (ctan, 1, 365, 1.677892637497921890115075995898773550884e-317L, 1.0, UNDERFLOW_EXCEPTION_DOUBLE);
#endif
#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
- TEST_c_c (ctan, 1, 5680, 4.725214596136812019616700920476949798307e-4934L, 1.0);
- TEST_c_c (ctan, 1, 5690, 9.739393181626937151720816611272607059057e-4943L, 1.0);
+ TEST_c_c (ctan, 1, 5680, 4.725214596136812019616700920476949798307e-4934L, 1.0, UNDERFLOW_EXCEPTION);
+ TEST_c_c (ctan, 1, 5690, 9.739393181626937151720816611272607059057e-4943L, 1.0, UNDERFLOW_EXCEPTION);
#endif
TEST_c_c (ctan, 0x3.243f6cp-1, 0, -2.287733242885645987394874673945769518150e7L, 0.0);
@@ -3138,10 +3310,10 @@ ctan_test (void)
TEST_c_c (ctan, 0x1p16383L, 1, 0.1608598776370396607204448234354670036772L, 0.8133818522051542536316746743877629761488L);
#endif
- TEST_c_c (ctan, 50000, 50000, plus_zero, 1.0);
- TEST_c_c (ctan, 50000, -50000, plus_zero, -1.0);
- TEST_c_c (ctan, -50000, 50000, minus_zero, 1.0);
- TEST_c_c (ctan, -50000, -50000, minus_zero, -1.0);
+ TEST_c_c (ctan, 50000, 50000, plus_zero, 1.0, UNDERFLOW_EXCEPTION);
+ TEST_c_c (ctan, 50000, -50000, plus_zero, -1.0, UNDERFLOW_EXCEPTION);
+ TEST_c_c (ctan, -50000, 50000, minus_zero, 1.0, UNDERFLOW_EXCEPTION);
+ TEST_c_c (ctan, -50000, -50000, minus_zero, -1.0, UNDERFLOW_EXCEPTION);
END (ctan, complex);
}
@@ -3202,17 +3374,17 @@ ctanh_test (void)
TEST_c_c (ctanh, 0.75L, 1.25L, 1.37260757053378320258048606571226857L, 0.385795952609750664177596760720790220L);
TEST_c_c (ctanh, -2, -3, -0.965385879022133124278480269394560686L, 0.988437503832249372031403430350121098e-2L);
- TEST_c_c (ctanh, 45, 1, 1.000000000000000000000000000000000000001L, 1.490158918874345552942703234806348520895e-39L);
- TEST_c_c (ctanh, 47, 1, 1.0, 2.729321264492904590777293425576722354636e-41L);
+ TEST_c_c (ctanh, 45, 1, 1.000000000000000000000000000000000000001L, 1.490158918874345552942703234806348520895e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_c_c (ctanh, 47, 1, 1.0, 2.729321264492904590777293425576722354636e-41L, UNDERFLOW_EXCEPTION_FLOAT);
#ifndef TEST_FLOAT
- TEST_c_c (ctanh, 355, 1, 1.0, 8.140551093483276762350406321792653551513e-309L);
- TEST_c_c (ctanh, 365, 1, 1.0, 1.677892637497921890115075995898773550884e-317L);
+ TEST_c_c (ctanh, 355, 1, 1.0, 8.140551093483276762350406321792653551513e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_c_c (ctanh, 365, 1, 1.0, 1.677892637497921890115075995898773550884e-317L, UNDERFLOW_EXCEPTION_DOUBLE);
#endif
#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
- TEST_c_c (ctanh, 5680, 1, 1.0, 4.725214596136812019616700920476949798307e-4934L);
- TEST_c_c (ctanh, 5690, 1, 1.0, 9.739393181626937151720816611272607059057e-4943L);
+ TEST_c_c (ctanh, 5680, 1, 1.0, 4.725214596136812019616700920476949798307e-4934L, UNDERFLOW_EXCEPTION);
+ TEST_c_c (ctanh, 5690, 1, 1.0, 9.739393181626937151720816611272607059057e-4943L, UNDERFLOW_EXCEPTION);
#endif
TEST_c_c (ctanh, 0, 0x3.243f6cp-1, 0.0, -2.287733242885645987394874673945769518150e7L);
@@ -3227,10 +3399,10 @@ ctanh_test (void)
TEST_c_c (ctanh, 1, 0x1p16383L, 0.8133818522051542536316746743877629761488L, 0.1608598776370396607204448234354670036772L);
#endif
- TEST_c_c (ctanh, 50000, 50000, 1.0, plus_zero);
- TEST_c_c (ctanh, 50000, -50000, 1.0, minus_zero);
- TEST_c_c (ctanh, -50000, 50000, -1.0, plus_zero);
- TEST_c_c (ctanh, -50000, -50000, -1.0, minus_zero);
+ TEST_c_c (ctanh, 50000, 50000, 1.0, plus_zero, UNDERFLOW_EXCEPTION);
+ TEST_c_c (ctanh, 50000, -50000, 1.0, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_c_c (ctanh, -50000, 50000, -1.0, plus_zero, UNDERFLOW_EXCEPTION);
+ TEST_c_c (ctanh, -50000, -50000, -1.0, minus_zero, UNDERFLOW_EXCEPTION);
END (ctanh, complex);
}
@@ -3341,10 +3513,11 @@ exp_test (void)
#if !(defined TEST_LDOUBLE && LDBL_MAX_EXP > 1024)
TEST_f_f (exp, 710, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (exp, -1234, plus_zero, UNDERFLOW_EXCEPTION);
#endif
TEST_f_f (exp, 1e5, plus_infty, OVERFLOW_EXCEPTION);
TEST_f_f (exp, max_value, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp, -max_value, 0);
+ TEST_f_f (exp, -max_value, 0, UNDERFLOW_EXCEPTION);
END (exp);
}
@@ -3481,16 +3654,16 @@ exp10_test (void)
TEST_f_f (exp10, -36, 1.0e-36L);
#ifndef TEST_FLOAT
TEST_f_f (exp10, 305, 1.0e305L);
- TEST_f_f (exp10, -305, 1.0e-305L);
+ TEST_f_f (exp10, -305, 1.0e-305L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
#endif
#if defined TEST_LDOUBLE && LDBL_MAX_10_EXP >= 4932
TEST_f_f (exp10, 4932, 1.0e4932L);
- TEST_f_f (exp10, -4932, 1.0e-4932L);
+ TEST_f_f (exp10, -4932, 1.0e-4932L, UNDERFLOW_EXCEPTION);
#endif
TEST_f_f (exp10, 1e6, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp10, -1e6, 0);
+ TEST_f_f (exp10, -1e6, 0, UNDERFLOW_EXCEPTION);
TEST_f_f (exp10, max_value, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp10, -max_value, 0);
+ TEST_f_f (exp10, -max_value, 0, UNDERFLOW_EXCEPTION);
TEST_f_f (exp10, 0.75L, 5.62341325190349080394951039776481231L);
END (exp10);
@@ -3517,9 +3690,9 @@ exp2_test (void)
TEST_f_f (exp2, 10, 1024);
TEST_f_f (exp2, -1, 0.5);
TEST_f_f (exp2, 1e6, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp2, -1e6, 0);
+ TEST_f_f (exp2, -1e6, 0, UNDERFLOW_EXCEPTION);
TEST_f_f (exp2, max_value, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp2, -max_value, 0);
+ TEST_f_f (exp2, -max_value, 0, UNDERFLOW_EXCEPTION);
TEST_f_f (exp2, 0.75L, 1.68179283050742908606225095246642979L);
TEST_f_f (exp2, 100.5, 1.792728671193156477399422023278661496394e+30L);
@@ -3579,7 +3752,8 @@ expm1_test (void)
TEST_f_f (expm1, 100000.0, plus_infty, OVERFLOW_EXCEPTION);
check_int ("errno for expm1(large) == ERANGE", errno, ERANGE, 0, 0, 0);
TEST_f_f (expm1, max_value, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (expm1, -max_value, -1);
+ /* Bug 6778: spurious underflow exception. */
+ TEST_f_f (expm1, -max_value, -1, UNDERFLOW_EXCEPTION_OK);
END (expm1);
}
@@ -3801,16 +3975,16 @@ fma_test (void)
TEST_fff_f (fma, 0x1.fffffffffffffp+1023, 0x1.001p+0, -0x1.fffffffffffffp+1023, 0x1.fffffffffffffp+1011);
TEST_fff_f (fma, -0x1.fffffffffffffp+1023, 0x1.fffffffffffffp+0, 0x1.fffffffffffffp+1023, -0x1.ffffffffffffdp+1023);
TEST_fff_f (fma, 0x1.fffffffffffffp+1023, 2.0, -0x1.fffffffffffffp+1023, 0x1.fffffffffffffp+1023);
- TEST_fff_f (fma, 0x1.6a09e667f3bccp-538, 0x1.6a09e667f3bccp-538, 0.0, 0.0);
- TEST_fff_f (fma, 0x1.deadbeef2feedp-495, 0x1.deadbeef2feedp-495, -0x1.bf86a5786a574p-989, 0x0.0000042625a1fp-1022);
- TEST_fff_f (fma, 0x1.deadbeef2feedp-503, 0x1.deadbeef2feedp-503, -0x1.bf86a5786a574p-1005, 0x0.0000000004262p-1022);
- TEST_fff_f (fma, 0x1p-537, 0x1p-538, 0x1p-1074, 0x0.0000000000002p-1022);
- TEST_fff_f (fma, 0x1.7fffff8p-968, 0x1p-106, 0x0.000001p-1022, 0x0.0000010000001p-1022);
- TEST_fff_f (fma, 0x1.4000004p-967, 0x1p-106, 0x0.000001p-1022, 0x0.0000010000003p-1022);
- TEST_fff_f (fma, 0x1.4p-967, -0x1p-106, -0x0.000001p-1022, -0x0.0000010000002p-1022);
- TEST_fff_f (fma, -0x1.19cab66d73e17p-959, 0x1.c7108a8c5ff51p-107, -0x0.80b0ad65d9b64p-1022, -0x0.80b0ad65d9d59p-1022);
- TEST_fff_f (fma, -0x1.d2eaed6e8e9d3p-979, -0x1.4e066c62ac9ddp-63, -0x0.9245e6b003454p-1022, -0x0.9245c09c5fb5dp-1022);
- TEST_fff_f (fma, 0x1.153d650bb9f06p-907, 0x1.2d01230d48407p-125, -0x0.b278d5acfc3cp-1022, -0x0.b22757123bbe9p-1022);
+ TEST_fff_f (fma, 0x1.6a09e667f3bccp-538, 0x1.6a09e667f3bccp-538, 0.0, 0.0, UNDERFLOW_EXCEPTION);
+ TEST_fff_f (fma, 0x1.deadbeef2feedp-495, 0x1.deadbeef2feedp-495, -0x1.bf86a5786a574p-989, 0x0.0000042625a1fp-1022, UNDERFLOW_EXCEPTION);
+ TEST_fff_f (fma, 0x1.deadbeef2feedp-503, 0x1.deadbeef2feedp-503, -0x1.bf86a5786a574p-1005, 0x0.0000000004262p-1022, UNDERFLOW_EXCEPTION);
+ TEST_fff_f (fma, 0x1p-537, 0x1p-538, 0x1p-1074, 0x0.0000000000002p-1022, UNDERFLOW_EXCEPTION);
+ TEST_fff_f (fma, 0x1.7fffff8p-968, 0x1p-106, 0x0.000001p-1022, 0x0.0000010000001p-1022, UNDERFLOW_EXCEPTION);
+ TEST_fff_f (fma, 0x1.4000004p-967, 0x1p-106, 0x0.000001p-1022, 0x0.0000010000003p-1022, UNDERFLOW_EXCEPTION);
+ TEST_fff_f (fma, 0x1.4p-967, -0x1p-106, -0x0.000001p-1022, -0x0.0000010000002p-1022, UNDERFLOW_EXCEPTION);
+ TEST_fff_f (fma, -0x1.19cab66d73e17p-959, 0x1.c7108a8c5ff51p-107, -0x0.80b0ad65d9b64p-1022, -0x0.80b0ad65d9d59p-1022, UNDERFLOW_EXCEPTION);
+ TEST_fff_f (fma, -0x1.d2eaed6e8e9d3p-979, -0x1.4e066c62ac9ddp-63, -0x0.9245e6b003454p-1022, -0x0.9245c09c5fb5dp-1022, UNDERFLOW_EXCEPTION);
+ TEST_fff_f (fma, 0x1.153d650bb9f06p-907, 0x1.2d01230d48407p-125, -0x0.b278d5acfc3cp-1022, -0x0.b22757123bbe9p-1022, UNDERFLOW_EXCEPTION);
TEST_fff_f (fma, -0x1.fffffffffffffp-711, 0x1.fffffffffffffp-275, 0x1.fffffe00007ffp-983, 0x1.7ffffe00007ffp-983);
#endif
#if defined (TEST_LDOUBLE) && LDBL_MANT_DIG == 64
@@ -3819,12 +3993,13 @@ fma_test (void)
TEST_fff_f (fma, 0xc.7fc000003ffffffp-1194L, 0x8.1e0003fffffffffp+15327L, -0x8.fffep+14072L, 0xc.ae9f164020effffp+14136L);
TEST_fff_f (fma, -0x8.0001fc000000003p+1798L, 0xcp-2230L, 0x8.f7e000000000007p-468L, -0xc.0002f9ffee10404p-429L);
TEST_fff_f (fma, 0xc.0000000000007ffp+10130L, -0x8.000000000000001p+4430L, 0xc.07000000001ffffp+14513L, -0xb.fffffffffffd7e4p+14563L);
- TEST_fff_f (fma, 0xb.ffffp-4777L, 0x8.000000fffffffffp-11612L, -0x0.3800fff8p-16385L, 0x5.c7fe80c7ffeffffp-16385L);
+ /* Bug 14152: underflow exception may be missing. */
+ TEST_fff_f (fma, 0xb.ffffp-4777L, 0x8.000000fffffffffp-11612L, -0x0.3800fff8p-16385L, 0x5.c7fe80c7ffeffffp-16385L, UNDERFLOW_EXCEPTION_OK);
#endif
#if defined (TEST_LDOUBLE) && LDBL_MANT_DIG == 113
TEST_fff_f (fma, 0x1.bb2de33e02ccbbfa6e245a7c1f71p-2584L, -0x1.6b500daf0580d987f1bc0cadfcddp-13777L, 0x1.613cd91d9fed34b33820e5ab9d8dp-16378L, -0x1.3a79fb50eb9ce887cffa0f09bd9fp-16360L);
- TEST_fff_f (fma, -0x1.f949b880cacb0f0c61540105321dp-5954L, -0x1.3876cec84b4140f3bd6198731b7ep-10525L, -0x0.a5dc1c6cfbc498c54fb0b504bf19p-16382L, -0x0.a5dc1c6cfbc498c54fb0b5038abbp-16382L);
- TEST_fff_f (fma, -0x1.0000fffffffffp-16221L, 0x1.0000001fffff8007fep-239L, 0x0.ff87ffffffffffffe000003fffffp-16382L, 0x0.ff87ffffffffffffdffc003bff7fp-16382L);
+ TEST_fff_f (fma, -0x1.f949b880cacb0f0c61540105321dp-5954L, -0x1.3876cec84b4140f3bd6198731b7ep-10525L, -0x0.a5dc1c6cfbc498c54fb0b504bf19p-16382L, -0x0.a5dc1c6cfbc498c54fb0b5038abbp-16382L, UNDERFLOW_EXCEPTION);
+ TEST_fff_f (fma, -0x1.0000fffffffffp-16221L, 0x1.0000001fffff8007fep-239L, 0x0.ff87ffffffffffffe000003fffffp-16382L, 0x0.ff87ffffffffffffdffc003bff7fp-16382L, UNDERFLOW_EXCEPTION);
TEST_fff_f (fma, -0x1.ac79c9376ef447f3827c9e9de008p-2228L, -0x1.5ba830022b6139e21fbe7270cad8p-6314L, 0x1.e8282b6a26bb6a9daf5c8e73e9f9p-8616L, 0x1.22f14a0253878a730cd1aee373adp-8541L);
TEST_fff_f (fma, -0x1.c69749ec574caaa2ab8e97ddb9f3p+2652L, 0x1.f34235ff9d095449c29b4831b62dp+3311L, 0x1.fbe4302df23354dbd0c4d3cfe606p+5879L, -0x1.bb473bfdfb7a6e18886ce6e57eafp+5964L);
TEST_fff_f (fma, -0x1.ca8835fc6ecfb5398625fc891be5p-1686L, 0x1.621e1972bbe2180e5be9dd7d8df5p-7671L, -0x1.7d2d21b73b52cf20dec2a83902a4p-9395L, -0x1.3d2322191c9c88bc68a62ab8042cp-9356L);
@@ -4177,7 +4352,8 @@ j0_test (void)
TEST_f_f (j0, 4.0, -3.9714980986384737228659076845169804197562E-1L);
TEST_f_f (j0, -4.0, -3.9714980986384737228659076845169804197562E-1L);
- TEST_f_f (j0, 0x1.d7ce3ap+107L, 2.775523647291230802651040996274861694514e-17L);
+ /* Bug 14155: spurious exception may occur. */
+ TEST_f_f (j0, 0x1.d7ce3ap+107L, 2.775523647291230802651040996274861694514e-17L, UNDERFLOW_EXCEPTION_OK);
#ifndef TEST_FLOAT
TEST_f_f (j0, -0x1.001000001p+593L, -3.927269966354206207832593635798954916263e-90L);
@@ -4306,7 +4482,8 @@ jn_test (void)
TEST_ff_f (jn, 8, 2.4048255576957729L, 0.92165786705344923232879022467054148E-4L);
TEST_ff_f (jn, 9, 2.4048255576957729L, 0.12517270977961513005428966643852564E-4L);
- TEST_ff_f (jn, 2, 0x1.ffff62p+99L, -4.43860668048170034334926693188979974489e-16L);
+ /* Bug 14155: spurious exception may occur. */
+ TEST_ff_f (jn, 2, 0x1.ffff62p+99L, -4.43860668048170034334926693188979974489e-16L, UNDERFLOW_EXCEPTION_OK);
END (jn);
}
@@ -5797,7 +5974,7 @@ nexttoward_test (void)
TEST_ff_f (nexttoward, -1.0, -0.9L, -0x0.ffffffp0);
TEST_ff_f (nexttoward, -1.0, LDBL_MAX, -0x0.ffffffp0);
TEST_ff_f (nexttoward, -1.0, -0x0.fffffffffffff8p0, -0x0.ffffffp0);
- TEST_ff_f (nexttoward, -0x1.3p-145, -0xap-148L, -0x1.4p-145);
+ TEST_ff_f (nexttoward, -0x1.3p-145, -0xap-148L, -0x1.4p-145, UNDERFLOW_EXCEPTION);
# if LDBL_MANT_DIG >= 64
TEST_ff_f (nexttoward, 1.0, 0x1.000000000000002p0L, 0x1.000002p0);
TEST_ff_f (nexttoward, 1.0, 0x0.ffffffffffffffffp0L, 0x0.ffffffp0);
@@ -5831,7 +6008,7 @@ nexttoward_test (void)
TEST_ff_f (nexttoward, -1.0, LDBL_MAX, -0x0.fffffffffffff8p0);
TEST_ff_f (nexttoward, -1.0, -0x0.fffffffffffff8p0, -0x0.fffffffffffff8p0);
TEST_ff_f (nexttoward, -1.0, -0x8.00346dc5d6388p-3L, -0x1.0000000000001p0);
- TEST_ff_f (nexttoward, 0x1p-1074, 0x1p-1073L, 0x1p-1073);
+ TEST_ff_f (nexttoward, 0x1p-1074, 0x1p-1073L, 0x1p-1073, UNDERFLOW_EXCEPTION);
# if LDBL_MANT_DIG >= 64
TEST_ff_f (nexttoward, 1.0, 0x1.000000000000002p0L, 0x1.0000000000001p0);
TEST_ff_f (nexttoward, 1.0, 0x0.ffffffffffffffffp0L, 0x0.fffffffffffff8p0);
@@ -6098,9 +6275,9 @@ pow_test (void)
check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
TEST_ff_f (pow, 0x1p72L, 0x1p72L, plus_infty, OVERFLOW_EXCEPTION);
- TEST_ff_f (pow, 10, -0x1p72L, 0);
+ TEST_ff_f (pow, 10, -0x1p72L, 0, UNDERFLOW_EXCEPTION);
TEST_ff_f (pow, max_value, max_value, plus_infty, OVERFLOW_EXCEPTION);
- TEST_ff_f (pow, 10, -max_value, 0);
+ TEST_ff_f (pow, 10, -max_value, 0, UNDERFLOW_EXCEPTION);
TEST_ff_f (pow, 0, 1, 0);
TEST_ff_f (pow, 0, 11, 0);
@@ -6290,7 +6467,7 @@ pow_test (void)
TEST_ff_f (pow, 0.75L, 1.25L, 0.697953644326574699205914060237425566L);
#if defined TEST_DOUBLE || defined TEST_LDOUBLE
- TEST_ff_f (pow, -7.49321e+133, -9.80818e+16, 0);
+ TEST_ff_f (pow, -7.49321e+133, -9.80818e+16, 0, UNDERFLOW_EXCEPTION);
#endif
TEST_ff_f (pow, -1.0, -0xffffff, -1.0);
@@ -6339,30 +6516,31 @@ pow_test (void)
TEST_ff_f (pow, -2.0, 126, 0x1p126);
TEST_ff_f (pow, -2.0, 127, -0x1p127);
- TEST_ff_f (pow, -2.0, -126, 0x1p-126);
- TEST_ff_f (pow, -2.0, -127, -0x1p-127);
+ /* Allow inexact results for float to be considered to underflow. */
+ TEST_ff_f (pow, -2.0, -126, 0x1p-126, UNDERFLOW_EXCEPTION_OK_FLOAT);
+ TEST_ff_f (pow, -2.0, -127, -0x1p-127, UNDERFLOW_EXCEPTION_OK_FLOAT);
- TEST_ff_f (pow, -2.0, -0xffffff, minus_zero);
- TEST_ff_f (pow, -2.0, -0x1fffffe, plus_zero);
+ TEST_ff_f (pow, -2.0, -0xffffff, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -2.0, -0x1fffffe, plus_zero, UNDERFLOW_EXCEPTION);
#ifndef TEST_FLOAT
- TEST_ff_f (pow, -2.0, -0x1.fffffffffffffp+52L, minus_zero);
- TEST_ff_f (pow, -2.0, -0x1.fffffffffffffp+53L, plus_zero);
+ TEST_ff_f (pow, -2.0, -0x1.fffffffffffffp+52L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -2.0, -0x1.fffffffffffffp+53L, plus_zero, UNDERFLOW_EXCEPTION);
#endif
#ifdef TEST_LDOUBLE
# if LDBL_MANT_DIG >= 64
- TEST_ff_f (pow, -2.0, -0x1.fffffffffffffffep+63L, minus_zero);
- TEST_ff_f (pow, -2.0, -0x1.fffffffffffffffep+64L, plus_zero);
+ TEST_ff_f (pow, -2.0, -0x1.fffffffffffffffep+63L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -2.0, -0x1.fffffffffffffffep+64L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
# if LDBL_MANT_DIG >= 106
- TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
- TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
+ TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffff8p+105L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffff8p+106L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
# if LDBL_MANT_DIG >= 113
- TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
- TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
+ TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffffffp+112L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffffffp+113L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
#endif
- TEST_ff_f (pow, -2.0, -max_value, plus_zero);
+ TEST_ff_f (pow, -2.0, -max_value, plus_zero, UNDERFLOW_EXCEPTION);
TEST_ff_f (pow, -2.0, 0xffffff, minus_infty, OVERFLOW_EXCEPTION);
TEST_ff_f (pow, -2.0, 0x1fffffe, plus_infty, OVERFLOW_EXCEPTION);
@@ -6389,32 +6567,32 @@ pow_test (void)
TEST_ff_f (pow, -max_value, 0.5, nan_value, INVALID_EXCEPTION);
TEST_ff_f (pow, -max_value, 1.5, nan_value, INVALID_EXCEPTION);
TEST_ff_f (pow, -max_value, 1000.5, nan_value, INVALID_EXCEPTION);
- TEST_ff_f (pow, -max_value, -2, plus_zero);
- TEST_ff_f (pow, -max_value, -3, minus_zero);
+ TEST_ff_f (pow, -max_value, -2, plus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, -3, minus_zero, UNDERFLOW_EXCEPTION);
TEST_ff_f (pow, -max_value, 2, plus_infty, OVERFLOW_EXCEPTION);
TEST_ff_f (pow, -max_value, 3, minus_infty, OVERFLOW_EXCEPTION);
- TEST_ff_f (pow, -max_value, -0xffffff, minus_zero);
- TEST_ff_f (pow, -max_value, -0x1fffffe, plus_zero);
+ TEST_ff_f (pow, -max_value, -0xffffff, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, -0x1fffffe, plus_zero, UNDERFLOW_EXCEPTION);
#ifndef TEST_FLOAT
- TEST_ff_f (pow, -max_value, -0x1.fffffffffffffp+52L, minus_zero);
- TEST_ff_f (pow, -max_value, -0x1.fffffffffffffp+53L, plus_zero);
+ TEST_ff_f (pow, -max_value, -0x1.fffffffffffffp+52L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, -0x1.fffffffffffffp+53L, plus_zero, UNDERFLOW_EXCEPTION);
#endif
#ifdef TEST_LDOUBLE
# if LDBL_MANT_DIG >= 64
- TEST_ff_f (pow, -max_value, -0x1.fffffffffffffffep+63L, minus_zero);
- TEST_ff_f (pow, -max_value, -0x1.fffffffffffffffep+64L, plus_zero);
+ TEST_ff_f (pow, -max_value, -0x1.fffffffffffffffep+63L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, -0x1.fffffffffffffffep+64L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
# if LDBL_MANT_DIG >= 106
- TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
- TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
+ TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffff8p+105L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffff8p+106L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
# if LDBL_MANT_DIG >= 113
- TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
- TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
+ TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffffffp+112L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffffffp+113L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
#endif
- TEST_ff_f (pow, -max_value, -max_value, plus_zero);
+ TEST_ff_f (pow, -max_value, -max_value, plus_zero, UNDERFLOW_EXCEPTION);
TEST_ff_f (pow, -max_value, 0xffffff, minus_infty, OVERFLOW_EXCEPTION);
TEST_ff_f (pow, -max_value, 0x1fffffe, plus_infty, OVERFLOW_EXCEPTION);
@@ -6465,36 +6643,37 @@ pow_test (void)
#endif
TEST_ff_f (pow, -0.5, -max_value, plus_infty, OVERFLOW_EXCEPTION);
- TEST_ff_f (pow, -0.5, 0xffffff, minus_zero);
- TEST_ff_f (pow, -0.5, 0x1fffffe, plus_zero);
+ TEST_ff_f (pow, -0.5, 0xffffff, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -0.5, 0x1fffffe, plus_zero, UNDERFLOW_EXCEPTION);
#ifndef TEST_FLOAT
- TEST_ff_f (pow, -0.5, 0x1.fffffffffffffp+52L, minus_zero);
- TEST_ff_f (pow, -0.5, 0x1.fffffffffffffp+53L, plus_zero);
+ TEST_ff_f (pow, -0.5, 0x1.fffffffffffffp+52L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -0.5, 0x1.fffffffffffffp+53L, plus_zero, UNDERFLOW_EXCEPTION);
#endif
#ifdef TEST_LDOUBLE
# if LDBL_MANT_DIG >= 64
- TEST_ff_f (pow, -0.5, 0x1.fffffffffffffffep+63L, minus_zero);
- TEST_ff_f (pow, -0.5, 0x1.fffffffffffffffep+64L, plus_zero);
+ TEST_ff_f (pow, -0.5, 0x1.fffffffffffffffep+63L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -0.5, 0x1.fffffffffffffffep+64L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
# if LDBL_MANT_DIG >= 106
- TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
- TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
+ TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffff8p+105L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffff8p+106L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
# if LDBL_MANT_DIG >= 113
- TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
- TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
+ TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffffffp+112L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffffffp+113L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
#endif
- TEST_ff_f (pow, -0.5, max_value, plus_zero);
+ TEST_ff_f (pow, -0.5, max_value, plus_zero, UNDERFLOW_EXCEPTION);
TEST_ff_f (pow, -min_value, 0.5, nan_value, INVALID_EXCEPTION);
TEST_ff_f (pow, -min_value, 1.5, nan_value, INVALID_EXCEPTION);
TEST_ff_f (pow, -min_value, 1000.5, nan_value, INVALID_EXCEPTION);
TEST_ff_f (pow, -min_value, -2, plus_infty, OVERFLOW_EXCEPTION);
TEST_ff_f (pow, -min_value, -3, minus_infty, OVERFLOW_EXCEPTION);
- TEST_ff_f (pow, -min_value, 1, -min_value);
- TEST_ff_f (pow, -min_value, 2, plus_zero);
- TEST_ff_f (pow, -min_value, 3, minus_zero);
+ /* Allow inexact results to be considered to underflow. */
+ TEST_ff_f (pow, -min_value, 1, -min_value, UNDERFLOW_EXCEPTION_OK);
+ TEST_ff_f (pow, -min_value, 2, plus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, 3, minus_zero, UNDERFLOW_EXCEPTION);
TEST_ff_f (pow, -min_value, -0xffffff, minus_infty, OVERFLOW_EXCEPTION);
TEST_ff_f (pow, -min_value, -0x1fffffe, plus_infty, OVERFLOW_EXCEPTION);
@@ -6518,27 +6697,27 @@ pow_test (void)
#endif
TEST_ff_f (pow, -min_value, -max_value, plus_infty, OVERFLOW_EXCEPTION);
- TEST_ff_f (pow, -min_value, 0xffffff, minus_zero);
- TEST_ff_f (pow, -min_value, 0x1fffffe, plus_zero);
+ TEST_ff_f (pow, -min_value, 0xffffff, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, 0x1fffffe, plus_zero, UNDERFLOW_EXCEPTION);
#ifndef TEST_FLOAT
- TEST_ff_f (pow, -min_value, 0x1.fffffffffffffp+52L, minus_zero);
- TEST_ff_f (pow, -min_value, 0x1.fffffffffffffp+53L, plus_zero);
+ TEST_ff_f (pow, -min_value, 0x1.fffffffffffffp+52L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, 0x1.fffffffffffffp+53L, plus_zero, UNDERFLOW_EXCEPTION);
#endif
#ifdef TEST_LDOUBLE
# if LDBL_MANT_DIG >= 64
- TEST_ff_f (pow, -min_value, 0x1.fffffffffffffffep+63L, minus_zero);
- TEST_ff_f (pow, -min_value, 0x1.fffffffffffffffep+64L, plus_zero);
+ TEST_ff_f (pow, -min_value, 0x1.fffffffffffffffep+63L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, 0x1.fffffffffffffffep+64L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
# if LDBL_MANT_DIG >= 106
- TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
- TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
+ TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffff8p+105L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffff8p+106L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
# if LDBL_MANT_DIG >= 113
- TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
- TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
+ TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffffffp+112L, minus_zero, UNDERFLOW_EXCEPTION);
+ TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffffffp+113L, plus_zero, UNDERFLOW_EXCEPTION);
# endif
#endif
- TEST_ff_f (pow, -min_value, max_value, plus_zero);
+ TEST_ff_f (pow, -min_value, max_value, plus_zero, UNDERFLOW_EXCEPTION);
#ifndef TEST_LDOUBLE /* Bug 13881. */
TEST_ff_f (pow, 0x0.ffffffp0, 10, 0.999999403953712118183885036774764444747L);
@@ -6566,6 +6745,8 @@ pow_test (void)
TEST_ff_f (pow, 0x1.0000000000001p0L, -0x1.23456789abcdfp61L, 1.0118762747828234466621210689458255908670e-253L);
#endif
+ TEST_ff_f (pow, 2.0L, -100000.0L, plus_zero, UNDERFLOW_EXCEPTION);
+
END (pow);
}
@@ -7391,13 +7572,13 @@ scalbn_test (void)
TEST_fi_f (scalbn, 1, 0L, 1);
TEST_fi_f (scalbn, 1, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbn, 1, INT_MIN, plus_zero);
+ TEST_fi_f (scalbn, 1, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbn, max_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbn, max_value, INT_MIN, plus_zero);
+ TEST_fi_f (scalbn, max_value, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbn, min_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbn, min_value, INT_MIN, plus_zero);
+ TEST_fi_f (scalbn, min_value, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbn, min_value / 4, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbn, min_value / 4, INT_MIN, plus_zero);
+ TEST_fi_f (scalbn, min_value / 4, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
END (scalbn);
}
@@ -7422,32 +7603,32 @@ scalbln_test (void)
TEST_fl_f (scalbln, 1, 0L, 1);
TEST_fi_f (scalbln, 1, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, 1, INT_MIN, plus_zero);
+ TEST_fi_f (scalbln, 1, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbln, max_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, max_value, INT_MIN, plus_zero);
+ TEST_fi_f (scalbln, max_value, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, min_value, INT_MIN, plus_zero);
+ TEST_fi_f (scalbln, min_value, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value / 4, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, min_value / 4, INT_MIN, plus_zero);
+ TEST_fi_f (scalbln, min_value / 4, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbln, 1, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, 1, LONG_MIN, plus_zero);
+ TEST_fi_f (scalbln, 1, LONG_MIN, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbln, max_value, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, max_value, LONG_MIN, plus_zero);
+ TEST_fi_f (scalbln, max_value, LONG_MIN, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, min_value, LONG_MIN, plus_zero);
+ TEST_fi_f (scalbln, min_value, LONG_MIN, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value / 4, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, min_value / 4, LONG_MIN, plus_zero);
+ TEST_fi_f (scalbln, min_value / 4, LONG_MIN, plus_zero, UNDERFLOW_EXCEPTION);
#if LONG_MAX >= 0x100000000
TEST_fi_f (scalbln, 1, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, 1, -0x88000000L, plus_zero);
+ TEST_fi_f (scalbln, 1, -0x88000000L, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbln, max_value, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, max_value, -0x88000000L, plus_zero);
+ TEST_fi_f (scalbln, max_value, -0x88000000L, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, min_value, -0x88000000L, plus_zero);
+ TEST_fi_f (scalbln, min_value, -0x88000000L, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value / 4, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
- TEST_fi_f (scalbln, min_value / 4, -0x88000000L, plus_zero);
+ TEST_fi_f (scalbln, min_value / 4, -0x88000000L, plus_zero, UNDERFLOW_EXCEPTION);
#endif
END (scalbn);
@@ -7898,7 +8079,8 @@ tan_test (void)
TEST_f_f (tan, nan_value, nan_value);
check_int ("errno for tan(NaN) == 0", errno, 0, 0, 0, 0);
- TEST_f_f (tan, M_PI_4l, 1);
+ /* Bug 14154: spurious exception may occur. */
+ TEST_f_f (tan, M_PI_4l, 1, UNDERFLOW_EXCEPTION_OK_FLOAT);
TEST_f_f (tan, 0.75L, 0.931596459944072461165202756573936428L);
TEST_f_f (tan, 0x1p65, -0.0472364872359047946798414219288370688827L);
@@ -8301,7 +8483,8 @@ y1_test (void)
TEST_f_f (y1, 8.0, -0.158060461731247494255555266187483550L);
TEST_f_f (y1, 10.0, 0.249015424206953883923283474663222803L);
- TEST_f_f (y1, 0x1.27e204p+99L, -8.881610148467797208469612080785210013461e-16L);
+ /* Bug 14155: spurious exception may occur. */
+ TEST_f_f (y1, 0x1.27e204p+99L, -8.881610148467797208469612080785210013461e-16L, UNDERFLOW_EXCEPTION_OK);
#ifndef TEST_FLOAT
TEST_f_f (y1, 0x1.001000001p+593L, 3.927269966354206207832593635798954916263e-90L);
diff --git a/libc/math/s_ccosh.c b/libc/math/s_ccosh.c
index 2c2b71cea..44c994446 100644
--- a/libc/math/s_ccosh.c
+++ b/libc/math/s_ccosh.c
@@ -1,5 +1,5 @@
/* Complex cosine hyperbole function for double.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,8 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
#include <math_private.h>
-
+#include <float.h>
__complex__ double
__ccosh (__complex__ double x)
@@ -37,14 +36,44 @@ __ccosh (__complex__ double x)
if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
- double sinh_val = __ieee754_sinh (__real__ x);
- double cosh_val = __ieee754_cosh (__real__ x);
+ const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
double sinix, cosix;
__sincos (__imag__ x, &sinix, &cosix);
- __real__ retval = cosh_val * cosix;
- __imag__ retval = sinh_val * sinix;
+ if (fabs (__real__ x) > t)
+ {
+ double exp_t = __ieee754_exp (t);
+ double rx = fabs (__real__ x);
+ if (signbit (__real__ x))
+ sinix = -sinix;
+ rx -= t;
+ sinix *= exp_t / 2.0;
+ cosix *= exp_t / 2.0;
+ if (rx > t)
+ {
+ rx -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (rx > t)
+ {
+ /* Overflow (original real part of x > 3t). */
+ __real__ retval = DBL_MAX * cosix;
+ __imag__ retval = DBL_MAX * sinix;
+ }
+ else
+ {
+ double exp_val = __ieee754_exp (rx);
+ __real__ retval = exp_val * cosix;
+ __imag__ retval = exp_val * sinix;
+ }
+ }
+ else
+ {
+ __real__ retval = __ieee754_cosh (__real__ x) * cosix;
+ __imag__ retval = __ieee754_sinh (__real__ x) * sinix;
+ }
}
else
{
diff --git a/libc/math/s_ccoshf.c b/libc/math/s_ccoshf.c
index a5a12c13e..d6f811049 100644
--- a/libc/math/s_ccoshf.c
+++ b/libc/math/s_ccoshf.c
@@ -1,5 +1,5 @@
/* Complex cosine hyperbole function for float.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,8 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
#include <math_private.h>
-
+#include <float.h>
__complex__ float
__ccoshf (__complex__ float x)
@@ -37,14 +36,44 @@ __ccoshf (__complex__ float x)
if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
- float sinh_val = __ieee754_sinhf (__real__ x);
- float cosh_val = __ieee754_coshf (__real__ x);
+ const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
float sinix, cosix;
__sincosf (__imag__ x, &sinix, &cosix);
- __real__ retval = cosh_val * cosix;
- __imag__ retval = sinh_val * sinix;
+ if (fabsf (__real__ x) > t)
+ {
+ float exp_t = __ieee754_expf (t);
+ float rx = fabsf (__real__ x);
+ if (signbit (__real__ x))
+ sinix = -sinix;
+ rx -= t;
+ sinix *= exp_t / 2.0f;
+ cosix *= exp_t / 2.0f;
+ if (rx > t)
+ {
+ rx -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (rx > t)
+ {
+ /* Overflow (original real part of x > 3t). */
+ __real__ retval = FLT_MAX * cosix;
+ __imag__ retval = FLT_MAX * sinix;
+ }
+ else
+ {
+ float exp_val = __ieee754_expf (rx);
+ __real__ retval = exp_val * cosix;
+ __imag__ retval = exp_val * sinix;
+ }
+ }
+ else
+ {
+ __real__ retval = __ieee754_coshf (__real__ x) * cosix;
+ __imag__ retval = __ieee754_sinhf (__real__ x) * sinix;
+ }
}
else
{
diff --git a/libc/math/s_ccoshl.c b/libc/math/s_ccoshl.c
index 32fdd8cf8..77a9ae386 100644
--- a/libc/math/s_ccoshl.c
+++ b/libc/math/s_ccoshl.c
@@ -1,5 +1,5 @@
/* Complex cosine hyperbole function for long double.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,8 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
#include <math_private.h>
-
+#include <float.h>
__complex__ long double
__ccoshl (__complex__ long double x)
@@ -37,14 +36,44 @@ __ccoshl (__complex__ long double x)
if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
- long double sinh_val = __ieee754_sinhl (__real__ x);
- long double cosh_val = __ieee754_coshl (__real__ x);
+ const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
long double sinix, cosix;
__sincosl (__imag__ x, &sinix, &cosix);
- __real__ retval = cosh_val * cosix;
- __imag__ retval = sinh_val * sinix;
+ if (fabsl (__real__ x) > t)
+ {
+ long double exp_t = __ieee754_expl (t);
+ long double rx = fabsl (__real__ x);
+ if (signbit (__real__ x))
+ sinix = -sinix;
+ rx -= t;
+ sinix *= exp_t / 2.0L;
+ cosix *= exp_t / 2.0L;
+ if (rx > t)
+ {
+ rx -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (rx > t)
+ {
+ /* Overflow (original real part of x > 3t). */
+ __real__ retval = LDBL_MAX * cosix;
+ __imag__ retval = LDBL_MAX * sinix;
+ }
+ else
+ {
+ long double exp_val = __ieee754_expl (rx);
+ __real__ retval = exp_val * cosix;
+ __imag__ retval = exp_val * sinix;
+ }
+ }
+ else
+ {
+ __real__ retval = __ieee754_coshl (__real__ x) * cosix;
+ __imag__ retval = __ieee754_sinhl (__real__ x) * sinix;
+ }
}
else
{
diff --git a/libc/math/s_csin.c b/libc/math/s_csin.c
index cd4c8f020..602c14e53 100644
--- a/libc/math/s_csin.c
+++ b/libc/math/s_csin.c
@@ -1,5 +1,5 @@
/* Complex sine function for double.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,8 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
#include <math_private.h>
-
+#include <float.h>
__complex__ double
__csin (__complex__ double x)
@@ -40,14 +39,44 @@ __csin (__complex__ double x)
if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- double sinh_val = __ieee754_sinh (__imag__ x);
- double cosh_val = __ieee754_cosh (__imag__ x);
+ const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
double sinix, cosix;
__sincos (__real__ x, &sinix, &cosix);
- __real__ retval = cosh_val * sinix;
- __imag__ retval = sinh_val * cosix;
+ if (fabs (__imag__ x) > t)
+ {
+ double exp_t = __ieee754_exp (t);
+ double ix = fabs (__imag__ x);
+ if (signbit (__imag__ x))
+ cosix = -cosix;
+ ix -= t;
+ sinix *= exp_t / 2.0;
+ cosix *= exp_t / 2.0;
+ if (ix > t)
+ {
+ ix -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (ix > t)
+ {
+ /* Overflow (original imaginary part of x > 3t). */
+ __real__ retval = DBL_MAX * sinix;
+ __imag__ retval = DBL_MAX * cosix;
+ }
+ else
+ {
+ double exp_val = __ieee754_exp (ix);
+ __real__ retval = exp_val * sinix;
+ __imag__ retval = exp_val * cosix;
+ }
+ }
+ else
+ {
+ __real__ retval = __ieee754_cosh (__imag__ x) * sinix;
+ __imag__ retval = __ieee754_sinh (__imag__ x) * cosix;
+ }
if (negate)
__real__ retval = -__real__ retval;
diff --git a/libc/math/s_csinf.c b/libc/math/s_csinf.c
index d86cd3b4a..c1d6a4f28 100644
--- a/libc/math/s_csinf.c
+++ b/libc/math/s_csinf.c
@@ -1,5 +1,5 @@
/* Complex sine function for float.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,8 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
#include <math_private.h>
-
+#include <float.h>
__complex__ float
__csinf (__complex__ float x)
@@ -40,14 +39,44 @@ __csinf (__complex__ float x)
if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- float sinh_val = __ieee754_sinhf (__imag__ x);
- float cosh_val = __ieee754_coshf (__imag__ x);
+ const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
float sinix, cosix;
__sincosf (__real__ x, &sinix, &cosix);
- __real__ retval = cosh_val * sinix;
- __imag__ retval = sinh_val * cosix;
+ if (fabsf (__imag__ x) > t)
+ {
+ float exp_t = __ieee754_expf (t);
+ float ix = fabsf (__imag__ x);
+ if (signbit (__imag__ x))
+ cosix = -cosix;
+ ix -= t;
+ sinix *= exp_t / 2.0f;
+ cosix *= exp_t / 2.0f;
+ if (ix > t)
+ {
+ ix -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (ix > t)
+ {
+ /* Overflow (original imaginary part of x > 3t). */
+ __real__ retval = FLT_MAX * sinix;
+ __imag__ retval = FLT_MAX * cosix;
+ }
+ else
+ {
+ float exp_val = __ieee754_expf (ix);
+ __real__ retval = exp_val * sinix;
+ __imag__ retval = exp_val * cosix;
+ }
+ }
+ else
+ {
+ __real__ retval = __ieee754_coshf (__imag__ x) * sinix;
+ __imag__ retval = __ieee754_sinhf (__imag__ x) * cosix;
+ }
if (negate)
__real__ retval = -__real__ retval;
diff --git a/libc/math/s_csinh.c b/libc/math/s_csinh.c
index f054dfc27..56bb25623 100644
--- a/libc/math/s_csinh.c
+++ b/libc/math/s_csinh.c
@@ -1,5 +1,5 @@
/* Complex sine hyperbole function for double.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,8 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
#include <math_private.h>
-
+#include <float.h>
__complex__ double
__csinh (__complex__ double x)
@@ -40,14 +39,44 @@ __csinh (__complex__ double x)
if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
- double sinh_val = __ieee754_sinh (__real__ x);
- double cosh_val = __ieee754_cosh (__real__ x);
+ const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
double sinix, cosix;
__sincos (__imag__ x, &sinix, &cosix);
- __real__ retval = sinh_val * cosix;
- __imag__ retval = cosh_val * sinix;
+ if (fabs (__real__ x) > t)
+ {
+ double exp_t = __ieee754_exp (t);
+ double rx = fabs (__real__ x);
+ if (signbit (__real__ x))
+ cosix = -cosix;
+ rx -= t;
+ sinix *= exp_t / 2.0;
+ cosix *= exp_t / 2.0;
+ if (rx > t)
+ {
+ rx -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (rx > t)
+ {
+ /* Overflow (original real part of x > 3t). */
+ __real__ retval = DBL_MAX * cosix;
+ __imag__ retval = DBL_MAX * sinix;
+ }
+ else
+ {
+ double exp_val = __ieee754_exp (rx);
+ __real__ retval = exp_val * cosix;
+ __imag__ retval = exp_val * sinix;
+ }
+ }
+ else
+ {
+ __real__ retval = __ieee754_sinh (__real__ x) * cosix;
+ __imag__ retval = __ieee754_cosh (__real__ x) * sinix;
+ }
if (negate)
__real__ retval = -__real__ retval;
diff --git a/libc/math/s_csinhf.c b/libc/math/s_csinhf.c
index 926bb3799..ba85e79b8 100644
--- a/libc/math/s_csinhf.c
+++ b/libc/math/s_csinhf.c
@@ -1,5 +1,5 @@
/* Complex sine hyperbole function for float.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,8 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
#include <math_private.h>
-
+#include <float.h>
__complex__ float
__csinhf (__complex__ float x)
@@ -40,14 +39,44 @@ __csinhf (__complex__ float x)
if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
- float sinh_val = __ieee754_sinhf (__real__ x);
- float cosh_val = __ieee754_coshf (__real__ x);
+ const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
float sinix, cosix;
__sincosf (__imag__ x, &sinix, &cosix);
- __real__ retval = sinh_val * cosix;
- __imag__ retval = cosh_val * sinix;
+ if (fabsf (__real__ x) > t)
+ {
+ float exp_t = __ieee754_expf (t);
+ float rx = fabsf (__real__ x);
+ if (signbit (__real__ x))
+ cosix = -cosix;
+ rx -= t;
+ sinix *= exp_t / 2.0f;
+ cosix *= exp_t / 2.0f;
+ if (rx > t)
+ {
+ rx -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (rx > t)
+ {
+ /* Overflow (original real part of x > 3t). */
+ __real__ retval = FLT_MAX * cosix;
+ __imag__ retval = FLT_MAX * sinix;
+ }
+ else
+ {
+ float exp_val = __ieee754_expf (rx);
+ __real__ retval = exp_val * cosix;
+ __imag__ retval = exp_val * sinix;
+ }
+ }
+ else
+ {
+ __real__ retval = __ieee754_sinhf (__real__ x) * cosix;
+ __imag__ retval = __ieee754_coshf (__real__ x) * sinix;
+ }
if (negate)
__real__ retval = -__real__ retval;
diff --git a/libc/math/s_csinhl.c b/libc/math/s_csinhl.c
index ff0e8b387..e482e3a62 100644
--- a/libc/math/s_csinhl.c
+++ b/libc/math/s_csinhl.c
@@ -1,5 +1,5 @@
/* Complex sine hyperbole function for long double.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,8 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
#include <math_private.h>
-
+#include <float.h>
__complex__ long double
__csinhl (__complex__ long double x)
@@ -40,14 +39,44 @@ __csinhl (__complex__ long double x)
if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
- long double sinh_val = __ieee754_sinhl (__real__ x);
- long double cosh_val = __ieee754_coshl (__real__ x);
+ const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
long double sinix, cosix;
__sincosl (__imag__ x, &sinix, &cosix);
- __real__ retval = sinh_val * cosix;
- __imag__ retval = cosh_val * sinix;
+ if (fabsl (__real__ x) > t)
+ {
+ long double exp_t = __ieee754_expl (t);
+ long double rx = fabsl (__real__ x);
+ if (signbit (__real__ x))
+ cosix = -cosix;
+ rx -= t;
+ sinix *= exp_t / 2.0L;
+ cosix *= exp_t / 2.0L;
+ if (rx > t)
+ {
+ rx -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (rx > t)
+ {
+ /* Overflow (original real part of x > 3t). */
+ __real__ retval = LDBL_MAX * cosix;
+ __imag__ retval = LDBL_MAX * sinix;
+ }
+ else
+ {
+ long double exp_val = __ieee754_expl (rx);
+ __real__ retval = exp_val * cosix;
+ __imag__ retval = exp_val * sinix;
+ }
+ }
+ else
+ {
+ __real__ retval = __ieee754_sinhl (__real__ x) * cosix;
+ __imag__ retval = __ieee754_coshl (__real__ x) * sinix;
+ }
if (negate)
__real__ retval = -__real__ retval;
diff --git a/libc/math/s_csinl.c b/libc/math/s_csinl.c
index df20e8b33..ff43256e5 100644
--- a/libc/math/s_csinl.c
+++ b/libc/math/s_csinl.c
@@ -1,5 +1,5 @@
/* Complex sine function for long double.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,8 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
#include <math_private.h>
-
+#include <float.h>
__complex__ long double
__csinl (__complex__ long double x)
@@ -40,14 +39,44 @@ __csinl (__complex__ long double x)
if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- long double sinh_val = __ieee754_sinhl (__imag__ x);
- long double cosh_val = __ieee754_coshl (__imag__ x);
+ const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
long double sinix, cosix;
__sincosl (__real__ x, &sinix, &cosix);
- __real__ retval = cosh_val * sinix;
- __imag__ retval = sinh_val * cosix;
+ if (fabsl (__imag__ x) > t)
+ {
+ long double exp_t = __ieee754_expl (t);
+ long double ix = fabsl (__imag__ x);
+ if (signbit (__imag__ x))
+ cosix = -cosix;
+ ix -= t;
+ sinix *= exp_t / 2.0L;
+ cosix *= exp_t / 2.0L;
+ if (ix > t)
+ {
+ ix -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (ix > t)
+ {
+ /* Overflow (original imaginary part of x > 3t). */
+ __real__ retval = LDBL_MAX * sinix;
+ __imag__ retval = LDBL_MAX * cosix;
+ }
+ else
+ {
+ long double exp_val = __ieee754_expl (ix);
+ __real__ retval = exp_val * sinix;
+ __imag__ retval = exp_val * cosix;
+ }
+ }
+ else
+ {
+ __real__ retval = __ieee754_coshl (__imag__ x) * sinix;
+ __imag__ retval = __ieee754_sinhl (__imag__ x) * cosix;
+ }
if (negate)
__real__ retval = -__real__ retval;
diff --git a/libc/math/test-fenv.c b/libc/math/test-fenv.c
index 39c7c3345..19e5415f7 100644
--- a/libc/math/test-fenv.c
+++ b/libc/math/test-fenv.c
@@ -664,9 +664,11 @@ feholdexcept_tests (void)
}
#endif
test_exceptions ("feholdexcept_tests 0 test", NO_EXC, 0);
+#ifdef FE_INVALID
feraiseexcept (FE_INVALID);
test_exceptions ("feholdexcept_tests FE_INVALID test",
INVALID_EXC, 0);
+#endif
res = feupdateenv (&saved);
if (res != 0)
{
@@ -684,7 +686,9 @@ feholdexcept_tests (void)
test_exceptions ("feholdexcept_tests FE_DIVBYZERO|FE_INVALID test",
DIVBYZERO_EXC | INVALID_EXC, 0);
feclearexcept (FE_ALL_EXCEPT);
+#ifdef FE_INVALID
feraiseexcept (FE_INVALID);
+#endif
#if defined FE_TONEAREST && defined FE_UPWARD
res = fesetround (FE_UPWARD);
if (res != 0)
@@ -708,9 +712,11 @@ feholdexcept_tests (void)
}
#endif
test_exceptions ("feholdexcept_tests 0 2nd test", NO_EXC, 0);
+#ifdef FE_INEXACT
feraiseexcept (FE_INEXACT);
test_exceptions ("feholdexcept_tests FE_INEXACT test",
INEXACT_EXC, 0);
+#endif
res = feupdateenv (&saved2);
if (res != 0)
{
diff --git a/libc/math/test-misc.c b/libc/math/test-misc.c
index c0fe5f7a1..55da359ce 100644
--- a/libc/math/test-misc.c
+++ b/libc/math/test-misc.c
@@ -1186,12 +1186,14 @@ main (void)
(void) &f2;
feclearexcept (FE_ALL_EXCEPT);
f2 += f1;
+#if defined(FE_OVERFLOW) && defined(FE_INEXACT)
int fe = fetestexcept (FE_ALL_EXCEPT);
if (fe != (FE_OVERFLOW | FE_INEXACT))
{
printf ("float overflow test failed: %x\n", fe);
result = 1;
}
+#endif
volatile double d1 = DBL_MAX;
volatile double d2 = DBL_MAX / 2;
@@ -1199,12 +1201,14 @@ main (void)
(void) &d2;
feclearexcept (FE_ALL_EXCEPT);
d2 += d1;
+#if defined(FE_OVERFLOW) && defined(FE_INEXACT)
fe = fetestexcept (FE_ALL_EXCEPT);
if (fe != (FE_OVERFLOW | FE_INEXACT))
{
printf ("double overflow test failed: %x\n", fe);
result = 1;
}
+#endif
#ifndef NO_LONG_DOUBLE
volatile long double ld1 = LDBL_MAX;
@@ -1213,12 +1217,14 @@ main (void)
(void) &ld2;
feclearexcept (FE_ALL_EXCEPT);
ld2 += ld1;
+# if defined(FE_OVERFLOW) && defined(FE_INEXACT)
fe = fetestexcept (FE_ALL_EXCEPT);
if (fe != (FE_OVERFLOW | FE_INEXACT))
{
printf ("long double overflow test failed: %x\n", fe);
result = 1;
}
+# endif
#endif
#if !defined NO_LONG_DOUBLE && LDBL_MANT_DIG == 113
diff --git a/libc/misc/Makefile b/libc/misc/Makefile
index 67247bfca..a814ecd09 100644
--- a/libc/misc/Makefile
+++ b/libc/misc/Makefile
@@ -35,7 +35,7 @@ headers := sys/uio.h bits/uio.h sys/ioctl.h bits/ioctls.h bits/ioctl-types.h \
regexp.h bits/select.h bits/mman.h sys/xattr.h \
syslog.h sys/syslog.h \
bits/syslog.h bits/syslog-ldbl.h bits/syslog-path.h bits/error.h \
- bits/select2.h
+ bits/select2.h bits/hwcap.h sys/auxv.h
routines := brk sbrk sstk ioctl \
readv writev preadv preadv64 pwritev pwritev64 \
@@ -66,7 +66,7 @@ routines := brk sbrk sstk ioctl \
getloadavg getclktck \
fgetxattr flistxattr fremovexattr fsetxattr getxattr \
listxattr lgetxattr llistxattr lremovexattr lsetxattr \
- removexattr setxattr
+ removexattr setxattr getauxval
routines-$(OPTION_POSIX_REGEXP) += regexp
routines-$(OPTION_EGLIBC_FSTAB) += fstab
diff --git a/libc/misc/Versions b/libc/misc/Versions
index 3a31c7fe6..7f525eaf5 100644
--- a/libc/misc/Versions
+++ b/libc/misc/Versions
@@ -146,4 +146,7 @@ libc {
GLIBC_2.14 {
syncfs;
}
+ GLIBC_2.16 {
+ __getauxval; getauxval;
+ }
}
diff --git a/libc/misc/error.c b/libc/misc/error.c
index f51fefdd0..9866e0941 100644
--- a/libc/misc/error.c
+++ b/libc/misc/error.c
@@ -1,5 +1,5 @@
/* Error handler for noninteractive utilities
- Copyright (C) 1990-1998, 2000-2006, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1990-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -70,9 +70,9 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
# define error_at_line __error_at_line
# include <libio/iolibio.h>
-# define fflush(s) INTUSE(_IO_fflush) (s)
+# define fflush(s) _IO_fflush (s)
# undef putc
-# define putc(c, fp) INTUSE(_IO_putc) (c, fp)
+# define putc(c, fp) _IO_putc (c, fp)
# include <bits/libc-lock.h>
diff --git a/libc/sysdeps/powerpc/soft-fp/q_qtoi.c b/libc/misc/getauxval.c
index 8c53719af..bff456084 100644
--- a/libc/sysdeps/powerpc/soft-fp/q_qtoi.c
+++ b/libc/misc/getauxval.c
@@ -1,9 +1,5 @@
-/* Software floating-point emulation.
- Return (int)a
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,19 +15,22 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FP_ROUNDMODE FP_RND_ZERO
-#include "soft-fp.h"
-#include "quad.h"
+#include <sys/auxv.h>
+#include <ldsodefs.h>
-int _q_qtoi(const long double a)
+
+unsigned long int
+__getauxval (unsigned long int type)
{
- FP_DECL_EX;
- FP_DECL_Q(A);
- unsigned int r;
+ ElfW(auxv_t) *p;
- FP_UNPACK_RAW_Q(A, a);
- FP_TO_INT_Q(r, A, 32, 1);
- FP_HANDLE_EXCEPTIONS;
+ if (type == AT_HWCAP)
+ return GLRO(dl_hwcap);
- return r;
+ for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++)
+ if (p->a_type == type)
+ return p->a_un.a_val;
+ return 0;
}
+
+weak_alias (__getauxval, getauxval)
diff --git a/libc/sysdeps/powerpc/soft-fp/q_qtoull.c b/libc/misc/sys/auxv.h
index 446c9fe07..34df04a6e 100644
--- a/libc/sysdeps/powerpc/soft-fp/q_qtoull.c
+++ b/libc/misc/sys/auxv.h
@@ -1,9 +1,6 @@
-/* Software floating-point emulation.
- Return (long)a
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
+/* Access to the auxiliary vector.
+ Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,19 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FP_ROUNDMODE FP_RND_ZERO
-#include "soft-fp.h"
-#include "quad.h"
+#ifndef _SYS_AUXV_H
+#define _SYS_AUXV_H 1
-unsigned long long _q_qtoull(const long double a)
-{
- FP_DECL_EX;
- FP_DECL_Q(A);
- unsigned long long r;
+#include <elf.h>
+#include <sys/cdefs.h>
+#include <bits/hwcap.h>
- FP_UNPACK_RAW_Q(A, a);
- FP_TO_INT_Q(r, A, 64, -1);
- FP_HANDLE_EXCEPTIONS;
+__BEGIN_DECLS
- return r;
-}
+/* Return the value associated with an Elf*_auxv_t type from the auxv list
+ passed to the program on startup. If TYPE was not present in the auxv
+ list, returns zero. */
+extern unsigned long int getauxval (unsigned long int __type)
+ __THROW __attribute_const__;
+
+__END_DECLS
+
+#endif /* sys/auxv.h */
diff --git a/libc/misc/syslog.c b/libc/misc/syslog.c
index 4e18883f5..748361fc8 100644
--- a/libc/misc/syslog.c
+++ b/libc/misc/syslog.c
@@ -58,7 +58,7 @@ static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#include <kernel-features.h>
-#define ftell(s) INTUSE(_IO_ftell) (s)
+#define ftell(s) _IO_ftell (s)
static int LogType = SOCK_DGRAM; /* type of socket connection */
static int LogFile = -1; /* fd for log */
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog
index 49e42efc4..492668bde 100644
--- a/libc/nptl/ChangeLog
+++ b/libc/nptl/ChangeLog
@@ -1,3 +1,192 @@
+2012-05-26 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ [BZ #12416]
+ * nptl/pthread_getattr_np.c (pthread_getattr_np): Use
+ __libc_stack_end rounded to the end of containing page as the
+ real stack end.
+
+2012-05-25 Rayson Ho <rho@redhat.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Low-level SystemTap
+ probes for i386.
+ * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
+
+2012-05-25 Rayson Ho <rho@redhat.com>
+ Roland McGrath <roland@hack.frob.com>
+
+ * DESIGN-systemtap-probes.txt: New file.
+ * pthread_cond_broadcast.c: SystemTap probes.
+ * pthread_cond_init.c: Likewise.
+ * pthread_cond_signal.c: Likewise.
+ * pthread_cond_wait.c: Likewise.
+ * pthread_cond_destroy.c: Likewise.
+ * pthread_create.c: Likewise.
+ * pthread_join.c: Likewise.
+ * pthread_mutex_destroy.c: Likewise.
+ * pthread_mutex_init.c: Likewise.
+ * pthread_mutex_lock.c: Likewise.
+ * pthread_mutex_timedlock.c: Likewise.
+ * pthread_mutex_unlock.c: Likewise.
+ * pthread_rwlock_destroy.c: Likewise.
+ * pthread_rwlock_rdlock.c: Likewise.
+ * pthread_rwlock_unlock.c: Likewise.
+ * pthread_rwlock_wrlock.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
+
+2012-05-24 Roland McGrath <roland@hack.frob.com>
+
+ * pthread_create.c (start_thread): Define pthread_start LIBC_PROBE.
+
+2012-05-17 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
+ (HAVE_DL_DISCOVER_OSVERSION): Don't declare _dl_discover_osversion
+ only for older kernels.
+
+2012-05-15 Joseph Myers <joseph@codesourcery.com>
+
+ * pthreadP.h [!__NR_set_robust_list] (__NR_set_robust_list): Do
+ not define.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_lock): Load
+ futex pointer into RDI_LP. Use RSP_LP to operate on stack.
+ (lll_robust_lock): Likewise.
+ (lll_cond_lock): Likewise.
+ (lll_robust_cond_lock): Likewise.
+ (lll_timedlock): Likewise.
+ (lll_robust_timedlock): Likewise.
+ (lll_unlock): Likewise.
+ (lll_robust_unlock): Likewise.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use
+ LP_OP(cmp) and RCX_LP on dep_mutex pointer.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Use LP_OP(op)
+ on NWAITERS.
+ (__gcc_personality_v0): Replace 8-byte data alignment with
+ LP_SIZE alignment and .quad with ASM_ADDR.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Use LP_OP(op)
+ on NWAITERS.
+ (__gcc_personality_v0): Replace 8-byte data alignment with
+ LP_SIZE alignment and .quad with ASM_ADDR.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Use LP_OP(cmp) on
+ NWAITERS, which is unsigned long int.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
+ (__gcc_personality_v0): Replace 8-byte data alignment with
+ LP_SIZE alignment and .quad with ASM_ADDR.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Use
+ LP_OP(cmp), RSI_LP and R8_LP on dep_mutex pointer. Load
+ __vdso_clock_gettime pointer into RAX_LP.
+ (__gcc_personality_v0): Replace 8-byte data alignment with
+ LP_SIZE alignment and .quad with ASM_ADDR.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Use
+ LP_OP(cmp), RSI_LP and R8_LP on dep_mutex pointer. Load
+ __vdso_clock_gettime pointer into RAX_LP.
+ (__gcc_personality_v0): Replace 8-byte data alignment with
+ LP_SIZE alignment and .quad with ASM_ADDR.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Use
+ LP_OP(cmp) and R8_LP on dep_mutex pointer.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Use LP_OP(mov)
+ to update pointer in memory. Load pointer into RDI_LP.
+
+2012-05-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+ (LLL_STUB_UNWIND_INFO_START): Align label to LP_SIZE instead
+ of 8.
+ (LLL_STUB_UNWIND_INFO_END): Likewise.
+ (lll_timedlock): Load timeout pointer into RDX_LP.
+ (lll_robust_timedlock): Likewise.
+
+2012-05-15 Siddhesh Poyarekar <siddhesh@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ [BZ #13613]
+ * Makefile (tests): Add test cases.
+ * descr.h (struct pthread): Add a comment describing multiple_threads.
+ * pthreadP.h (__pthread_multiple_threads): Expand comment to include
+ single-process case.
+ * pthread_cancel.c (pthread_cancel): Enable multiple_threads
+ before setting cancelstate of the thread.
+ * sysdeps/unix/sysv/linux/libc_multiple_threads.c
+ (__libc_multiple_threads): Add explanatory comment.
+ * tst-cancel-self-cancelstate.c: New test case.
+ * tst-cancel-self-canceltype.c: Likewise.
+ * tst-cancel-self-cleanup.c: Supporting file for test cases.
+ * tst-cancel-self-testcancel.c: New test case.
+ * tst-cancel-self.c: Likewise.
+ * vars.c: Expand comment to include single-process case.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/tls.h: Don't include <bits/wordsize.h>.
+ (tcbhead_t): Remove __x86_64__ check. Align rtld_savespace_sse
+ to 32 bytes.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/pthread/pthread.h (__PTHREAD_RWLOCK_INT_FLAGS_SHARED):
+ New.
+ (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Check
+ __PTHREAD_RWLOCK_INT_FLAGS_SHARED instead of __WORDSIZE.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * shlib-versions: Move x86_64-.*-linux.* entry to ...
+ * sysdeps/x86_64/64/shlib-versions: Here. New file.
+ * sysdeps/x86_64/x32/shlib-versions: New file.
+
+2012-05-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Define x32
+ __SIZEOF_PTHREAD_XXX_T.
+ (__pthread_internal_list): Check __x86_64__ instead of __WORDSIZE.
+ (pthread_mutex_t): Likewise.
+ (pthread_rwlock_t): Likewise.
+ (__PTHREAD_RWLOCK_INT_FLAGS_SHARED): New. Defined if __x86_64__
+ is defined.
+
2012-05-11 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/x86_64/x32/tls.h: New file.
diff --git a/libc/nptl/DESIGN-systemtap-probes.txt b/libc/nptl/DESIGN-systemtap-probes.txt
new file mode 100644
index 000000000..16d7c4513
--- /dev/null
+++ b/libc/nptl/DESIGN-systemtap-probes.txt
@@ -0,0 +1,89 @@
+Systemtap is a dynamic tracing/instrumenting tool available on Linux. Probes
+that are not fired at run time have close to zero overhead.
+
+The following probes are available for NPTL:
+
+Thread creation & Join Probes
+=============================
+pthread_create - probe for pthread_create
+ arg1 = pointer (pthread_t*) to thread
+ arg2 = pointer (pthread_attr_t*) to attr
+ arg3 = pointer (void *) to start_routine
+ arg4 = arguments to start_routine
+pthread_start - probe for actual thread creation
+ arg1 = struct pthread (members include thread ID, process ID)
+ arg2 = address of start_routine
+ arg3 = pointer to the list of arguments
+pthread_join - probe for pthread_join
+ arg1 = thread ID
+pthread_join_ret - probe for pthread_join return
+ arg1 = thread ID
+ arg2 = return value
+
+Lock-related Probes
+===================
+mutex_init - probe for pthread_mutex_init
+ arg1 = address of mutex lock
+mutex_acquired - probe for succ. return of pthread_mutex_lock
+ arg1 = address of mutex lock
+mutex_timedlock_acquired - probe for succ. return of pthread_mutex_timedlock
+ arg1 = address of mutex lock
+mutex_entry - probe for entry to the pthread_mutex_lock function
+ arg1 = address of mutex lock
+mutex_timedlock_entry - probe for entry to the pthread_mutex_timedlock function
+ arg1 = address of mutex lock, arg2 = address of timespec
+mutex_release - probe for pthread_mutex_unlock after the successful release of a
+ mutex lock
+ arg1 = address of mutex lock
+mutex_destroy - probe for pthread_mutex_destroy
+ arg1 = address of mutex lock
+
+wrlock_entry - probe for entry to the pthread_rwlock_wrlock function
+ arg1 = address of rw lock
+rdlock_entry - probe for entry to the pthread_rwlock_rdlock function
+ arg1 = address of rw lock
+
+rwlock_destroy - probe for pthread_rwlock_destroy
+ arg1 = address of rw lock
+wrlock_acquire_write - probe for pthread_rwlock_wrlock (after getting the lock)
+ arg1 = address of rw lock
+rdlock_acquire_read - probe for pthread_rwlock_rdlock after successfully getting
+ the lock
+ arg1 = address of rw lock
+rwlock_unlock - probe for pthread_rwlock_unlock
+ arg1 = address of rw lock
+
+lll_lock_wait - probe in low-level (assembly language) locking code, only fired
+ when futex/FUTEX_WAIT is called (i.e. when trying to acquire a
+ contented lock)
+ arg1 = pointer to futex
+ arg2 = flags passed to the futex system call
+lll_lock_wait_private - probe in low-level (assembly language) locking code,
+ only fired when futex/FUTEX_WAIT is called (i.e. when
+ trying to acquire a contented lock)
+ arg1 = pointer to futex
+
+lll_futex_wake - probe in low-level (assembly language) locking code, only fired
+ when futex (FUTEX_WAKE) is called
+ arg1 = pointer to futex
+ arg2 = number of processes to wake
+ arg3 = additional flags
+
+Condition variable Probes
+=========================
+cond_init - probe for pthread_cond_init
+ arg1 = condition
+ arg2 = attr
+cond_destroy - probe for pthread_cond_destroy
+ arg1 = cond
+cond_wait - probe for pthread_cond_wait
+ arg1 = condition
+ arg2 = mutex lock
+cond_timedwait - probe for pthread_cond_timedwait
+ arg1 = condition
+ arg2 = mutex lock
+ arg3 = timespec
+cond_signal - probe for pthread_cond_signal
+ arg1 = condition
+cond_broadcast - probe for pthread_cond_broadcast
+ arg1 = condition
diff --git a/libc/nptl/Makefile b/libc/nptl/Makefile
index b715304af..b7ecef547 100644
--- a/libc/nptl/Makefile
+++ b/libc/nptl/Makefile
@@ -240,6 +240,8 @@ tests = tst-typesizes \
tst-cancel11 tst-cancel12 tst-cancel13 tst-cancel14 tst-cancel15 \
tst-cancel16 tst-cancel17 tst-cancel18 tst-cancel19 tst-cancel20 \
tst-cancel21 tst-cancel22 tst-cancel23 tst-cancel25 \
+ tst-cancel-self tst-cancel-self-cancelstate \
+ tst-cancel-self-canceltype tst-cancel-self-testcancel \
tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 tst-cleanup4 \
tst-flock1 tst-flock2 \
tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \
diff --git a/libc/nptl/descr.h b/libc/nptl/descr.h
index c2fabeb1a..60d2d22e7 100644
--- a/libc/nptl/descr.h
+++ b/libc/nptl/descr.h
@@ -131,6 +131,21 @@ struct pthread
#else
struct
{
+ /* multiple_threads is enabled either when the process has spawned at
+ least one thread or when a single-threaded process cancels itself.
+ This enables additional code to introduce locking before doing some
+ compare_and_exchange operations and also enable cancellation points.
+ The concepts of multiple threads and cancellation points ideally
+ should be separate, since it is not necessary for multiple threads to
+ have been created for cancellation points to be enabled, as is the
+ case is when single-threaded process cancels itself.
+
+ Since enabling multiple_threads enables additional code in
+ cancellation points and compare_and_exchange operations, there is a
+ potential for an unneeded performance hit when it is enabled in a
+ single-threaded, self-canceling process. This is OK though, since a
+ single-threaded process will enable async cancellation only when it
+ looks to cancel itself and is hence going to end anyway. */
int multiple_threads;
int gscope_flag;
# ifndef __ASSUME_PRIVATE_FUTEX
diff --git a/libc/nptl/pthreadP.h b/libc/nptl/pthreadP.h
index 68c690e88..6427e3d2e 100644
--- a/libc/nptl/pthreadP.h
+++ b/libc/nptl/pthreadP.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -378,7 +378,9 @@ extern int *__libc_pthread_init (unsigned long int *ptr,
const struct pthread_functions *functions)
internal_function;
-/* Variable set to a nonzero value if more than one thread runs or ran. */
+/* Variable set to a nonzero value either if more than one thread runs or ran,
+ or if a single-threaded process is trying to cancel itself. See
+ nptl/descr.h for more context on the single-threaded process case. */
extern int __pthread_multiple_threads attribute_hidden;
/* Pointer to the corresponding variable in libc. */
extern int *__libc_multiple_threads_ptr attribute_hidden;
@@ -580,15 +582,4 @@ extern void __wait_lookup_done (void) attribute_hidden;
# define PTHREAD_STATIC_FN_REQUIRE(name) __asm (".globl " #name);
#endif
-
-#ifndef __NR_set_robust_list
-/* XXX For the time being... Once we can rely on the kernel headers
- having the definition remove these lines. */
-# if defined __i386__
-# define __NR_set_robust_list 311
-# elif defined __x86_64__
-# define __NR_set_robust_list 273
-# endif
-#endif
-
#endif /* pthreadP.h */
diff --git a/libc/nptl/pthread_cancel.c b/libc/nptl/pthread_cancel.c
index 249aa1109..1bfca6358 100644
--- a/libc/nptl/pthread_cancel.c
+++ b/libc/nptl/pthread_cancel.c
@@ -95,6 +95,14 @@ pthread_cancel (th)
break;
}
+
+ /* A single-threaded process should be able to kill itself, since there is
+ nothing in the POSIX specification that says that it cannot. So we set
+ multiple_threads to true so that cancellation points get executed. */
+ THREAD_SETMEM (THREAD_SELF, header.multiple_threads, 1);
+#ifndef TLS_MULTIPLE_THREADS_IN_TCB
+ __pthread_multiple_threads = *__libc_multiple_threads_ptr = 1;
+#endif
}
/* Mark the thread as canceled. This has to be done
atomically since other bits could be modified as well. */
diff --git a/libc/nptl/pthread_cond_broadcast.c b/libc/nptl/pthread_cond_broadcast.c
index 9b67f755f..7bc76ac0e 100644
--- a/libc/nptl/pthread_cond_broadcast.c
+++ b/libc/nptl/pthread_cond_broadcast.c
@@ -22,6 +22,7 @@
#include <lowlevellock.h>
#include <pthread.h>
#include <pthreadP.h>
+#include <stap-probe.h>
#include <shlib-compat.h>
#include <kernel-features.h>
@@ -31,6 +32,8 @@ int
__pthread_cond_broadcast (cond)
pthread_cond_t *cond;
{
+ LIBC_PROBE (cond_broadcast, 1, cond);
+
int pshared = (cond->__data.__mutex == (void *) ~0l)
? LLL_SHARED : LLL_PRIVATE;
/* Make sure we are alone. */
diff --git a/libc/nptl/pthread_cond_destroy.c b/libc/nptl/pthread_cond_destroy.c
index 0f03b294b..5f57b563c 100644
--- a/libc/nptl/pthread_cond_destroy.c
+++ b/libc/nptl/pthread_cond_destroy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,6 +19,7 @@
#include <errno.h>
#include <shlib-compat.h>
#include "pthreadP.h"
+#include <stap-probe.h>
int
@@ -28,6 +29,8 @@ __pthread_cond_destroy (cond)
int pshared = (cond->__data.__mutex == (void *) ~0l)
? LLL_SHARED : LLL_PRIVATE;
+ LIBC_PROBE (cond_destroy, 1, cond);
+
/* Make sure we are alone. */
lll_lock (cond->__data.__lock, pshared);
@@ -50,13 +53,13 @@ __pthread_cond_destroy (cond)
if (nwaiters >= (1 << COND_NWAITERS_SHIFT))
{
/* Wake everybody on the associated mutex in case there are
- threads that have been requeued to it.
- Without this, pthread_cond_destroy could block potentially
- for a long time or forever, as it would depend on other
- thread's using the mutex.
- When all threads waiting on the mutex are woken up, pthread_cond_wait
- only waits for threads to acquire and release the internal
- condvar lock. */
+ threads that have been requeued to it.
+ Without this, pthread_cond_destroy could block potentially
+ for a long time or forever, as it would depend on other
+ thread's using the mutex.
+ When all threads waiting on the mutex are woken up, pthread_cond_wait
+ only waits for threads to acquire and release the internal
+ condvar lock. */
if (cond->__data.__mutex != NULL
&& cond->__data.__mutex != (void *) ~0l)
{
diff --git a/libc/nptl/pthread_cond_init.c b/libc/nptl/pthread_cond_init.c
index dcc6b3c14..554fe6fed 100644
--- a/libc/nptl/pthread_cond_init.c
+++ b/libc/nptl/pthread_cond_init.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008
- Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,6 +18,7 @@
#include <shlib-compat.h>
#include "pthreadP.h"
+#include <stap-probe.h>
int
@@ -41,6 +41,8 @@ __pthread_cond_init (cond, cond_attr)
? NULL : (void *) ~0l);
cond->__data.__broadcast_seq = 0;
+ LIBC_PROBE (cond_init, 2, cond, cond_attr);
+
return 0;
}
versioned_symbol (libpthread, __pthread_cond_init,
diff --git a/libc/nptl/pthread_cond_signal.c b/libc/nptl/pthread_cond_signal.c
index e4716f2b0..063dcbc32 100644
--- a/libc/nptl/pthread_cond_signal.c
+++ b/libc/nptl/pthread_cond_signal.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -25,6 +25,7 @@
#include <shlib-compat.h>
#include <kernel-features.h>
+#include <stap-probe.h>
int
@@ -34,6 +35,8 @@ __pthread_cond_signal (cond)
int pshared = (cond->__data.__mutex == (void *) ~0l)
? LLL_SHARED : LLL_PRIVATE;
+ LIBC_PROBE (cond_signal, 1, cond);
+
/* Make sure we are alone. */
lll_lock (cond->__data.__lock, pshared);
diff --git a/libc/nptl/pthread_cond_wait.c b/libc/nptl/pthread_cond_wait.c
index c05d06c14..35505d9a1 100644
--- a/libc/nptl/pthread_cond_wait.c
+++ b/libc/nptl/pthread_cond_wait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003,2004,2006,2007,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -24,6 +24,7 @@
#include <pthreadP.h>
#include <shlib-compat.h>
+#include <stap-probe.h>
struct _condvar_cleanup_buffer
@@ -43,7 +44,7 @@ __condvar_cleanup (void *arg)
(struct _condvar_cleanup_buffer *) arg;
unsigned int destroying;
int pshared = (cbuffer->cond->__data.__mutex == (void *) ~0l)
- ? LLL_SHARED : LLL_PRIVATE;
+ ? LLL_SHARED : LLL_PRIVATE;
/* We are going to modify shared data. */
lll_lock (cbuffer->cond->__data.__lock, pshared);
@@ -98,7 +99,9 @@ __pthread_cond_wait (cond, mutex)
struct _condvar_cleanup_buffer cbuffer;
int err;
int pshared = (cond->__data.__mutex == (void *) ~0l)
- ? LLL_SHARED : LLL_PRIVATE;
+ ? LLL_SHARED : LLL_PRIVATE;
+
+ LIBC_PROBE (cond_wait, 2, cond, mutex);
/* Make sure we are alone. */
lll_lock (cond->__data.__lock, pshared);
diff --git a/libc/nptl/pthread_create.c b/libc/nptl/pthread_create.c
index 561682588..96ca51f4e 100644
--- a/libc/nptl/pthread_create.c
+++ b/libc/nptl/pthread_create.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007,2008,2009,2010,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -32,6 +32,8 @@
#include <shlib-compat.h>
+#include <stap-probe.h>
+
/* Local function to start thread and handle cleanup. */
static int start_thread (void *arg);
@@ -302,6 +304,8 @@ start_thread (void *arg)
CANCEL_RESET (oldtype);
}
+ LIBC_PROBE (pthread_start, 3, (pthread_t) pd, pd->start_routine, pd->arg);
+
/* Run the code the user provided. */
#ifdef CALL_THREAD_FCT
THREAD_SETMEM (pd, result, CALL_THREAD_FCT (pd));
@@ -561,6 +565,8 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
/* Pass the descriptor to the caller. */
*newthread = (pthread_t) pd;
+ LIBC_PROBE (pthread_create, 4, newthread, attr, start_routine, arg);
+
/* Start the thread. */
return create_thread (pd, iattr, STACK_VARIABLES_ARGS);
}
diff --git a/libc/nptl/pthread_getattr_np.c b/libc/nptl/pthread_getattr_np.c
index f1268dd82..75d717bb1 100644
--- a/libc/nptl/pthread_getattr_np.c
+++ b/libc/nptl/pthread_getattr_np.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004, 2006, 2007, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -84,6 +84,18 @@ pthread_getattr_np (thread_id, attr)
ret = errno;
else
{
+ /* We consider the main process stack to have ended with
+ the page containing __libc_stack_end. There is stuff below
+ it in the stack too, like the program arguments, environment
+ variables and auxv info, but we ignore those pages when
+ returning size so that the output is consistent when the
+ stack is marked executable due to a loaded DSO requiring
+ it. */
+ void *stack_end = (void *) ((uintptr_t) __libc_stack_end
+ & -(uintptr_t) GLRO(dl_pagesize));
+#if _STACK_GROWS_DOWN
+ stack_end += GLRO(dl_pagesize);
+#endif
/* We need no locking. */
__fsetlocking (fp, FSETLOCKING_BYCALLER);
@@ -109,7 +121,7 @@ pthread_getattr_np (thread_id, attr)
{
/* Found the entry. Now we have the info we need. */
iattr->stacksize = rl.rlim_cur;
- iattr->stackaddr = (void *) to;
+ iattr->stackaddr = stack_end;
/* The limit might be too high. */
if ((size_t) iattr->stacksize
diff --git a/libc/nptl/pthread_join.c b/libc/nptl/pthread_join.c
index b8834cc9c..bf1a01dbc 100644
--- a/libc/nptl/pthread_join.c
+++ b/libc/nptl/pthread_join.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -22,6 +22,8 @@
#include <atomic.h>
#include "pthreadP.h"
+#include <stap-probe.h>
+
static void
cleanup (void *arg)
@@ -54,6 +56,8 @@ pthread_join (threadid, thread_return)
struct pthread *self = THREAD_SELF;
int result = 0;
+ LIBC_PROBE (pthread_join, 1, threadid);
+
/* During the wait we change to asynchronous cancellation. If we
are canceled the thread we are waiting for must be marked as
un-wait-ed for again. */
@@ -109,5 +113,7 @@ pthread_join (threadid, thread_return)
__free_tcb (pd);
}
+ LIBC_PROBE (pthread_join_ret, 3, threadid, result, pd->result);
+
return result;
}
diff --git a/libc/nptl/pthread_mutex_destroy.c b/libc/nptl/pthread_mutex_destroy.c
index 408b16a7b..107ec8e4e 100644
--- a/libc/nptl/pthread_mutex_destroy.c
+++ b/libc/nptl/pthread_mutex_destroy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,11 +19,15 @@
#include <errno.h>
#include "pthreadP.h"
+#include <stap-probe.h>
+
int
__pthread_mutex_destroy (mutex)
pthread_mutex_t *mutex;
{
+ LIBC_PROBE (mutex_destroy, 1, mutex);
+
if ((mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP) == 0
&& mutex->__data.__nusers != 0)
return EBUSY;
diff --git a/libc/nptl/pthread_mutex_init.c b/libc/nptl/pthread_mutex_init.c
index 0596e07f3..6536e44d0 100644
--- a/libc/nptl/pthread_mutex_init.c
+++ b/libc/nptl/pthread_mutex_init.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,6 +22,8 @@
#include <kernel-features.h>
#include "pthreadP.h"
+#include <stap-probe.h>
+
static const struct pthread_mutexattr default_attr =
{
/* Default is a normal mutex, not shared between processes. */
@@ -134,6 +135,8 @@ __pthread_mutex_init (mutex, mutexattr)
// mutex->__spins = 0; already done by memset
// mutex->__next = NULL; already done by memset
+ LIBC_PROBE (mutex_init, 1, mutex);
+
return 0;
}
strong_alias (__pthread_mutex_init, pthread_mutex_init)
diff --git a/libc/nptl/pthread_mutex_lock.c b/libc/nptl/pthread_mutex_lock.c
index c747355e4..2b30bad48 100644
--- a/libc/nptl/pthread_mutex_lock.c
+++ b/libc/nptl/pthread_mutex_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,6 +23,7 @@
#include <not-cancel.h>
#include "pthreadP.h"
#include <lowlevellock.h>
+#include <stap-probe.h>
#ifndef LLL_MUTEX_LOCK
@@ -47,6 +48,9 @@ __pthread_mutex_lock (mutex)
assert (sizeof (mutex->__size) >= sizeof (mutex->__data));
unsigned int type = PTHREAD_MUTEX_TYPE (mutex);
+
+ LIBC_PROBE (mutex_entry, 1, mutex);
+
if (__builtin_expect (type & ~PTHREAD_MUTEX_KIND_MASK_NP, 0))
return __pthread_mutex_lock_full (mutex);
@@ -126,6 +130,8 @@ __pthread_mutex_lock (mutex)
++mutex->__data.__nusers;
#endif
+ LIBC_PROBE (mutex_acquired, 1, mutex);
+
return 0;
}
@@ -466,6 +472,8 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
++mutex->__data.__nusers;
#endif
+ LIBC_PROBE (mutex_acquired, 1, mutex);
+
return 0;
}
#ifndef __pthread_mutex_lock
diff --git a/libc/nptl/pthread_mutex_timedlock.c b/libc/nptl/pthread_mutex_timedlock.c
index b7f34d4fd..52fa74c0d 100644
--- a/libc/nptl/pthread_mutex_timedlock.c
+++ b/libc/nptl/pthread_mutex_timedlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,6 +23,8 @@
#include <lowlevellock.h>
#include <not-cancel.h>
+#include <stap-probe.h>
+
int
pthread_mutex_timedlock (mutex, abstime)
@@ -33,6 +35,8 @@ pthread_mutex_timedlock (mutex, abstime)
pid_t id = THREAD_GETMEM (THREAD_SELF, tid);
int result = 0;
+ LIBC_PROBE (mutex_timedlock_entry, 2, mutex, abstime);
+
/* We must not check ABSTIME here. If the thread does not block
abstime must not be checked for a valid value. */
@@ -171,6 +175,8 @@ pthread_mutex_timedlock (mutex, abstime)
++mutex->__data.__count;
+ LIBC_PROBE (mutex_timedlock_acquired, 1, mutex);
+
return 0;
}
}
@@ -241,6 +247,8 @@ pthread_mutex_timedlock (mutex, abstime)
++mutex->__data.__count;
+ LIBC_PROBE (mutex_timedlock_acquired, 1, mutex);
+
return 0;
}
}
@@ -376,6 +384,8 @@ pthread_mutex_timedlock (mutex, abstime)
++mutex->__data.__count;
+ LIBC_PROBE (mutex_timedlock_acquired, 1, mutex);
+
return 0;
}
}
@@ -476,6 +486,8 @@ pthread_mutex_timedlock (mutex, abstime)
/* Record the ownership. */
mutex->__data.__owner = id;
++mutex->__data.__nusers;
+
+ LIBC_PROBE (mutex_timedlock_acquired, 1, mutex);
}
out:
diff --git a/libc/nptl/pthread_mutex_unlock.c b/libc/nptl/pthread_mutex_unlock.c
index 0f35f6203..aa8ecbd58 100644
--- a/libc/nptl/pthread_mutex_unlock.c
+++ b/libc/nptl/pthread_mutex_unlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include "pthreadP.h"
#include <lowlevellock.h>
+#include <stap-probe.h>
static int
internal_function
@@ -49,6 +50,9 @@ __pthread_mutex_unlock_usercnt (mutex, decr)
/* Unlock. */
lll_unlock (mutex->__data.__lock, PTHREAD_MUTEX_PSHARED (mutex));
+
+ LIBC_PROBE (mutex_release, 1, mutex);
+
return 0;
}
else if (__builtin_expect (type == PTHREAD_MUTEX_RECURSIVE_NP, 1))
@@ -271,6 +275,9 @@ __pthread_mutex_unlock_full (pthread_mutex_t *mutex, int decr)
PTHREAD_MUTEX_PSHARED (mutex));
int oldprio = newval >> PTHREAD_MUTEX_PRIO_CEILING_SHIFT;
+
+ LIBC_PROBE (mutex_release, 1, mutex);
+
return __pthread_tpp_change_priority (oldprio, -1);
default:
@@ -278,6 +285,7 @@ __pthread_mutex_unlock_full (pthread_mutex_t *mutex, int decr)
return EINVAL;
}
+ LIBC_PROBE (mutex_release, 1, mutex);
return 0;
}
diff --git a/libc/nptl/pthread_rwlock_destroy.c b/libc/nptl/pthread_rwlock_destroy.c
index 606833acf..78abe5ece 100644
--- a/libc/nptl/pthread_rwlock_destroy.c
+++ b/libc/nptl/pthread_rwlock_destroy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -17,12 +17,15 @@
<http://www.gnu.org/licenses/>. */
#include "pthreadP.h"
+#include <stap-probe.h>
int
__pthread_rwlock_destroy (rwlock)
pthread_rwlock_t *rwlock;
{
+ LIBC_PROBE (rwlock_destroy, 1, rwlock);
+
/* Nothing to be done. For now. */
return 0;
}
diff --git a/libc/nptl/pthread_rwlock_rdlock.c b/libc/nptl/pthread_rwlock_rdlock.c
index 4aa1c5bb5..14688e298 100644
--- a/libc/nptl/pthread_rwlock_rdlock.c
+++ b/libc/nptl/pthread_rwlock_rdlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003,2004,2007,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -21,6 +21,7 @@
#include <lowlevellock.h>
#include <pthread.h>
#include <pthreadP.h>
+#include <stap-probe.h>
/* Acquire read lock for RWLOCK. */
@@ -30,6 +31,8 @@ __pthread_rwlock_rdlock (rwlock)
{
int result = 0;
+ LIBC_PROBE (rdlock_entry, 1, rwlock);
+
/* Make sure we are alone. */
lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
@@ -48,6 +51,8 @@ __pthread_rwlock_rdlock (rwlock)
--rwlock->__data.__nr_readers;
result = EAGAIN;
}
+ else
+ LIBC_PROBE (rdlock_acquire_read, 1, rwlock);
break;
}
diff --git a/libc/nptl/pthread_rwlock_unlock.c b/libc/nptl/pthread_rwlock_unlock.c
index 15418c82f..a727d89b9 100644
--- a/libc/nptl/pthread_rwlock_unlock.c
+++ b/libc/nptl/pthread_rwlock_unlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -21,11 +21,14 @@
#include <lowlevellock.h>
#include <pthread.h>
#include <pthreadP.h>
+#include <stap-probe.h>
/* Unlock RWLOCK. */
int
__pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
{
+ LIBC_PROBE (rwlock_unlock, 1, rwlock);
+
lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
if (rwlock->__data.__writer)
rwlock->__data.__writer = 0;
diff --git a/libc/nptl/pthread_rwlock_wrlock.c b/libc/nptl/pthread_rwlock_wrlock.c
index a64548787..6d8fb93c3 100644
--- a/libc/nptl/pthread_rwlock_wrlock.c
+++ b/libc/nptl/pthread_rwlock_wrlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003,2007,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -21,6 +21,7 @@
#include <lowlevellock.h>
#include <pthread.h>
#include <pthreadP.h>
+#include <stap-probe.h>
/* Acquire write lock for RWLOCK. */
@@ -30,6 +31,8 @@ __pthread_rwlock_wrlock (rwlock)
{
int result = 0;
+ LIBC_PROBE (wrlock_entry, 1, rwlock);
+
/* Make sure we are alone. */
lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
@@ -40,6 +43,8 @@ __pthread_rwlock_wrlock (rwlock)
{
/* Mark self as writer. */
rwlock->__data.__writer = THREAD_GETMEM (THREAD_SELF, tid);
+
+ LIBC_PROBE (wrlock_acquire_write, 1, rwlock);
break;
}
diff --git a/libc/nptl/shlib-versions b/libc/nptl/shlib-versions
index ee86161fd..e49e7ca41 100644
--- a/libc/nptl/shlib-versions
+++ b/libc/nptl/shlib-versions
@@ -1,6 +1,5 @@
sparc64.*-.*-linux.* libpthread=0 GLIBC_2.2
sh.*-.*-linux.* libpthread=0 GLIBC_2.2
s390x-.*-linux.* libpthread=0 GLIBC_2.2
-x86_64-.*-linux.* libpthread=0 GLIBC_2.2.5
powerpc64-.*-linux.* libpthread=0 GLIBC_2.3
.*-.*-linux.* libpthread=0
diff --git a/libc/nptl/sysdeps/pthread/pthread.h b/libc/nptl/sysdeps/pthread/pthread.h
index fcc0ce846..88c7c257a 100644
--- a/libc/nptl/sysdeps/pthread/pthread.h
+++ b/libc/nptl/sysdeps/pthread/pthread.h
@@ -118,11 +118,20 @@ enum
PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
};
+/* Define __PTHREAD_RWLOCK_INT_FLAGS_SHARED to 1 if pthread_rwlock_t
+ has the shared field. All 64-bit architectures have the shared field
+ in pthread_rwlock_t. */
+#ifndef __PTHREAD_RWLOCK_INT_FLAGS_SHARED
+# if __WORDSIZE == 64
+# define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1
+# endif
+#endif
+
/* Read-write lock initializers. */
# define PTHREAD_RWLOCK_INITIALIZER \
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
# ifdef __USE_GNU
-# if __WORDSIZE == 64
+# ifdef __PTHREAD_RWLOCK_INT_FLAGS_SHARED
# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
index fe6d4b678..7c3212cb6 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004,2006,2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -21,6 +21,8 @@
#include <kernel-features.h>
#include <lowlevellock.h>
+#include <stap-probe.h>
+
.text
#ifdef __ASSUME_PRIVATE_FUTEX
@@ -90,7 +92,8 @@ __lll_lock_wait_private:
cmpl %edx, %eax /* NB: %edx == 2 */
jne 2f
-1: movl $SYS_futex, %eax
+1: LIBC_PROBE (lll_lock_wait_private, 1, %ebx)
+ movl $SYS_futex, %eax
ENTER_KERNEL
2: movl %edx, %eax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
index 71a668686..99f9bc901 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2004,2006,2007,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,6 +23,7 @@
#include <kernel-features.h>
#include <pthread-pi-defines.h>
#include <pthread-errnos.h>
+#include <stap-probe.h>
.text
@@ -48,6 +49,8 @@ __pthread_cond_broadcast:
movl 20(%esp), %ebx
+ LIBC_PROBE (cond_broadcast, 1, %edx)
+
/* Get internal lock. */
movl $1, %edx
xorl %eax, %eax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
index 2af611aed..e204805a9 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005,2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,7 +23,7 @@
#include <kernel-features.h>
#include <pthread-pi-defines.h>
#include <pthread-errnos.h>
-
+#include <stap-probe.h>
.text
@@ -44,6 +44,8 @@ __pthread_cond_signal:
movl 12(%esp), %edi
+ LIBC_PROBE (cond_signal, 1, %edi)
+
/* Get internal lock. */
movl $1, %edx
xorl %eax, %eax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
index ff3da370d..8170ab321 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004,2006-2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,7 +23,7 @@
#include <pthread-errnos.h>
#include <pthread-pi-defines.h>
#include <kernel-features.h>
-
+#include <stap-probe.h>
.text
@@ -60,6 +60,8 @@ __pthread_cond_timedwait:
movl 20(%esp), %ebx
movl 28(%esp), %ebp
+ LIBC_PROBE (cond_timedwait, 3, %ebx, 24(%esp), %ebp)
+
cmpl $1000000000, 4(%ebp)
movl $EINVAL, %eax
jae 18f
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
index 1d7e75105..2ae7af261 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
@@ -1,5 +1,4 @@
-/* Copyright (C) 2002-2004,2006-2007,2009,2010,2012
- Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -25,6 +24,7 @@
#include <pthread-errnos.h>
#include <pthread-pi-defines.h>
#include <kernel-features.h>
+#include <stap-probe.h>
.text
@@ -61,6 +61,8 @@ __pthread_cond_wait:
xorl %esi, %esi
movl 20(%esp), %ebx
+ LIBC_PROBE (cond_wait, 2, 24(%esp), %ebx)
+
/* Get internal lock. */
movl $1, %edx
xorl %eax, %eax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
index 156fce868..ebbe80971 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -22,6 +22,7 @@
#include <pthread-errnos.h>
#include <kernel-features.h>
+#include <stap-probe.h>
.text
@@ -40,6 +41,8 @@ __pthread_rwlock_rdlock:
xorl %esi, %esi
movl 12(%esp), %ebx
+ LIBC_PROBE (rdlock_entry, 1, %ebx)
+
/* Get the lock. */
movl $1, %edx
xorl %eax, %eax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
index 3994b06c0..d30e93a2d 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -22,6 +22,7 @@
#include <pthread-errnos.h>
#include <kernel-features.h>
+#include <stap-probe.h>
.text
@@ -40,6 +41,8 @@ __pthread_rwlock_wrlock:
xorl %esi, %esi
movl 12(%esp), %ebx
+ LIBC_PROBE (wrlock_entry, 1, %ebx)
+
/* Get the lock. */
movl $1, %edx
xorl %eax, %eax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h b/libc/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
index a2fa3ee21..12533438c 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. IA-32 version.
- Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,9 +58,7 @@ extern void _dl_sysinfo_int80 (void) attribute_hidden;
#endif
-/* The _dl_discover_osversion function is so far only needed in sysconf
- to check for kernels later than 2.6.23. */
-#if !defined __ASSEMBLER__ && __LINUX_KERNEL_VERSION < 0x020617
+#ifndef __ASSEMBLER__
/* Get version of the OS. */
extern int _dl_discover_osversion (void) attribute_hidden;
# define HAVE_DL_DISCOVER_OSVERSION 1
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
index 497d4739b..3d805ff43 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004, 2006-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,6 +19,8 @@
#ifndef _LOWLEVELLOCK_H
#define _LOWLEVELLOCK_H 1
+#include <stap-probe.h>
+
#ifndef __ASSEMBLER__
# include <time.h>
# include <sys/param.h>
@@ -225,6 +227,7 @@ LLL_STUB_UNWIND_INFO_END
do { \
int __ignore; \
register __typeof (nr) _nr asm ("edx") = (nr); \
+ LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \
__asm __volatile (LLL_EBX_LOAD \
LLL_ENTER_KERNEL \
LLL_EBX_LOAD \
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.c b/libc/nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.c
index 7fffb0d80..459b8cf7c 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/libc_multiple_threads.c
@@ -20,6 +20,9 @@
#ifndef NOT_IN_libc
# ifndef TLS_MULTIPLE_THREADS_IN_TCB
+/* Variable set to a nonzero value either if more than one thread runs or ran,
+ or if a single-threaded process is trying to cancel itself. See
+ nptl/descr.h for more context on the single-threaded process case. */
int __libc_multiple_threads attribute_hidden;
# endif
#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
index e05b8f5c3..e22947f34 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
@@ -20,16 +20,28 @@
#include <bits/wordsize.h>
-#if __WORDSIZE == 64
-# define __SIZEOF_PTHREAD_ATTR_T 56
-# define __SIZEOF_PTHREAD_MUTEX_T 40
-# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
-# define __SIZEOF_PTHREAD_COND_T 48
-# define __SIZEOF_PTHREAD_CONDATTR_T 4
-# define __SIZEOF_PTHREAD_RWLOCK_T 56
-# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
-# define __SIZEOF_PTHREAD_BARRIER_T 32
-# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+#ifdef __x86_64__
+# if __WORDSIZE == 64
+# define __SIZEOF_PTHREAD_ATTR_T 56
+# define __SIZEOF_PTHREAD_MUTEX_T 40
+# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+# define __SIZEOF_PTHREAD_COND_T 48
+# define __SIZEOF_PTHREAD_CONDATTR_T 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 56
+# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+# define __SIZEOF_PTHREAD_BARRIER_T 32
+# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+# else
+# define __SIZEOF_PTHREAD_ATTR_T 32
+# define __SIZEOF_PTHREAD_MUTEX_T 32
+# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+# define __SIZEOF_PTHREAD_COND_T 48
+# define __SIZEOF_PTHREAD_CONDATTR_T 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 44
+# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+# define __SIZEOF_PTHREAD_BARRIER_T 20
+# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+# endif
#else
# define __SIZEOF_PTHREAD_ATTR_T 36
# define __SIZEOF_PTHREAD_MUTEX_T 24
@@ -59,7 +71,7 @@ typedef union pthread_attr_t pthread_attr_t;
#endif
-#if __WORDSIZE == 64
+#ifdef __x86_64__
typedef struct __pthread_internal_list
{
struct __pthread_internal_list *__prev;
@@ -82,13 +94,13 @@ typedef union
int __lock;
unsigned int __count;
int __owner;
-#if __WORDSIZE == 64
+#ifdef __x86_64__
unsigned int __nusers;
#endif
/* KIND must stay at this position in the structure to maintain
binary compatibility. */
int __kind;
-#if __WORDSIZE == 64
+#ifdef __x86_64__
int __spins;
__pthread_list_t __list;
# define __PTHREAD_MUTEX_HAVE_PREV 1
@@ -151,7 +163,7 @@ typedef int pthread_once_t;
structure of the attribute type is not exposed on purpose. */
typedef union
{
-# if __WORDSIZE == 64
+# ifdef __x86_64__
struct
{
int __lock;
@@ -167,6 +179,7 @@ typedef union
/* FLAGS must stay at this position in the structure to maintain
binary compatibility. */
unsigned int __flags;
+# define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1
} __data;
# else
struct
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
index d7c7e80ce..31bb08b37 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
@@ -72,10 +72,10 @@ ENTRY(__pthread_enable_asynccancel)
3: subq $8, %rsp
cfi_adjust_cfa_offset(8)
- movq $TCB_PTHREAD_CANCELED, %fs:RESULT
+ LP_OP(mov) $TCB_PTHREAD_CANCELED, %fs:RESULT
lock
orl $TCB_EXITING_BITMASK, %fs:CANCELHANDLING
- movq %fs:CLEANUP_JMP_BUF, %rdi
+ mov %fs:CLEANUP_JMP_BUF, %RDI_LP
#ifdef SHARED
call __pthread_unwind@PLT
#else
@@ -106,7 +106,7 @@ ENTRY(__pthread_disable_asynccancel)
/* Performance doesn't matter in this loop. We will
delay until the thread is canceled. And we will unlikely
enter the loop twice. */
-4: movq %fs:0, %rdi
+4: mov %fs:0, %RDI_LP
movl $__NR_futex, %eax
xorq %r10, %r10
addq $CANCELHANDLING, %rdi
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index b7bfc3706..dc9542102 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -21,6 +21,8 @@
#include <kernel-features.h>
#include <lowlevellock.h>
+#include <stap-probe.h>
+
.text
#ifdef __ASSUME_PRIVATE_FUTEX
@@ -86,7 +88,8 @@ __lll_lock_wait_private:
cmpl %edx, %eax /* NB: %edx == 2 */
jne 2f
-1: movl $SYS_futex, %eax
+1: LIBC_PROBE (lll_lock_wait_private, 1, %rdi)
+ movl $SYS_futex, %eax
syscall
2: movl %edx, %eax
@@ -125,7 +128,8 @@ __lll_lock_wait:
cmpl %edx, %eax /* NB: %edx == 2 */
jne 2f
-1: movl $SYS_futex, %eax
+1: LIBC_PROBE (lll_lock_wait, 2, %rdi, %rsi)
+ movl $SYS_futex, %eax
syscall
2: movl %edx, %eax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index dada21c2a..3686970f0 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004, 2006-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,6 +19,8 @@
#ifndef _LOWLEVELLOCK_H
#define _LOWLEVELLOCK_H 1
+#include <stap-probe.h>
+
#ifndef __ASSEMBLER__
# include <time.h>
# include <sys/param.h>
@@ -119,7 +121,7 @@
".byte 0x12 # DW_CFA_def_cfa_sf\n\t" \
".uleb128 0x7\n\t" \
".sleb128 16\n\t" \
- ".align 8\n" \
+ ".align " LP_SIZE "\n" \
"9:\t" ".long 23f-10f # FDE Length\n" \
"10:\t" ".long 10b-7b # FDE CIE offset\n\t" \
".long 1b-. # FDE initial location\n\t" \
@@ -166,7 +168,7 @@
".uleb128 22f-21f\n" \
"21:\t" ".byte 0x80 # DW_OP_breg16\n\t" \
".sleb128 4b-5b\n" \
-"22:\t" ".align 8\n" \
+"22:\t" ".align " LP_SIZE "\n" \
"23:\t" ".previous\n"
/* Unwind info for
@@ -226,6 +228,7 @@ LLL_STUB_UNWIND_INFO_END
do { \
int __ignore; \
register __typeof (nr) _nr __asm ("edx") = (nr); \
+ LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \
__asm __volatile ("syscall" \
: "=a" (__ignore) \
: "0" (SYS_futex), "D" (futex), \
@@ -285,7 +288,7 @@ LLL_STUB_UNWIND_INFO_END
"je 0f\n\t" \
"lock; cmpxchgl %4, %2\n\t" \
"jnz 1f\n\t" \
- "jmp 24f\n" \
+ "jmp 24f\n" \
"0:\tcmpxchgl %4, %2\n\t" \
"jnz 1f\n\t"
#endif
@@ -298,10 +301,10 @@ LLL_STUB_UNWIND_INFO_END
".subsection 1\n\t" \
".type _L_lock_%=, @function\n" \
"_L_lock_%=:\n" \
- "1:\tleaq %2, %%rdi\n" \
- "2:\tsubq $128, %%rsp\n" \
+ "1:\tlea %2, %%" RDI_LP "\n" \
+ "2:\tsub $128, %%" RSP_LP "\n" \
"3:\tcallq __lll_lock_wait_private\n" \
- "4:\taddq $128, %%rsp\n" \
+ "4:\tadd $128, %%" RSP_LP "\n" \
"5:\tjmp 24f\n" \
"6:\t.size _L_lock_%=, 6b-1b\n\t" \
".previous\n" \
@@ -316,10 +319,10 @@ LLL_STUB_UNWIND_INFO_END
".subsection 1\n\t" \
".type _L_lock_%=, @function\n" \
"_L_lock_%=:\n" \
- "1:\tleaq %2, %%rdi\n" \
- "2:\tsubq $128, %%rsp\n" \
+ "1:\tlea %2, %%" RDI_LP "\n" \
+ "2:\tsub $128, %%" RSP_LP "\n" \
"3:\tcallq __lll_lock_wait\n" \
- "4:\taddq $128, %%rsp\n" \
+ "4:\tadd $128, %%" RSP_LP "\n" \
"5:\tjmp 24f\n" \
"6:\t.size _L_lock_%=, 6b-1b\n\t" \
".previous\n" \
@@ -338,10 +341,10 @@ LLL_STUB_UNWIND_INFO_END
".subsection 1\n\t" \
".type _L_robust_lock_%=, @function\n" \
"_L_robust_lock_%=:\n" \
- "1:\tleaq %2, %%rdi\n" \
- "2:\tsubq $128, %%rsp\n" \
+ "1:\tlea %2, %%" RDI_LP "\n" \
+ "2:\tsub $128, %%" RSP_LP "\n" \
"3:\tcallq __lll_robust_lock_wait\n" \
- "4:\taddq $128, %%rsp\n" \
+ "4:\tadd $128, %%" RSP_LP "\n" \
"5:\tjmp 24f\n" \
"6:\t.size _L_robust_lock_%=, 6b-1b\n\t" \
".previous\n" \
@@ -361,10 +364,10 @@ LLL_STUB_UNWIND_INFO_END
".subsection 1\n\t" \
".type _L_cond_lock_%=, @function\n" \
"_L_cond_lock_%=:\n" \
- "1:\tleaq %2, %%rdi\n" \
- "2:\tsubq $128, %%rsp\n" \
+ "1:\tlea %2, %%" RDI_LP "\n" \
+ "2:\tsub $128, %%" RSP_LP "\n" \
"3:\tcallq __lll_lock_wait\n" \
- "4:\taddq $128, %%rsp\n" \
+ "4:\tadd $128, %%" RSP_LP "\n" \
"5:\tjmp 24f\n" \
"6:\t.size _L_cond_lock_%=, 6b-1b\n\t" \
".previous\n" \
@@ -383,10 +386,10 @@ LLL_STUB_UNWIND_INFO_END
".subsection 1\n\t" \
".type _L_robust_cond_lock_%=, @function\n" \
"_L_robust_cond_lock_%=:\n" \
- "1:\tleaq %2, %%rdi\n" \
- "2:\tsubq $128, %%rsp\n" \
+ "1:\tlea %2, %%" RDI_LP "\n" \
+ "2:\tsub $128, %%" RSP_LP "\n" \
"3:\tcallq __lll_robust_lock_wait\n" \
- "4:\taddq $128, %%rsp\n" \
+ "4:\tadd $128, %%" RSP_LP "\n" \
"5:\tjmp 24f\n" \
"6:\t.size _L_robust_cond_lock_%=, 6b-1b\n\t" \
".previous\n" \
@@ -406,11 +409,11 @@ LLL_STUB_UNWIND_INFO_END
".subsection 1\n\t" \
".type _L_timedlock_%=, @function\n" \
"_L_timedlock_%=:\n" \
- "1:\tleaq %4, %%rdi\n" \
- "0:\tmovq %8, %%rdx\n" \
- "2:\tsubq $128, %%rsp\n" \
+ "1:\tlea %4, %%" RDI_LP "\n" \
+ "0:\tmov %8, %%" RDX_LP "\n" \
+ "2:\tsub $128, %%" RSP_LP "\n" \
"3:\tcallq __lll_timedlock_wait\n" \
- "4:\taddq $128, %%rsp\n" \
+ "4:\tadd $128, %%" RSP_LP "\n" \
"5:\tjmp 24f\n" \
"6:\t.size _L_timedlock_%=, 6b-1b\n\t" \
".previous\n" \
@@ -430,11 +433,11 @@ LLL_STUB_UNWIND_INFO_END
".subsection 1\n\t" \
".type _L_robust_timedlock_%=, @function\n" \
"_L_robust_timedlock_%=:\n" \
- "1:\tleaq %4, %%rdi\n" \
- "0:\tmovq %8, %%rdx\n" \
- "2:\tsubq $128, %%rsp\n" \
+ "1:\tlea %4, %%" RDI_LP "\n" \
+ "0:\tmov %8, %%" RDX_LP "\n" \
+ "2:\tsub $128, %%" RSP_LP "\n" \
"3:\tcallq __lll_robust_timedlock_wait\n" \
- "4:\taddq $128, %%rsp\n" \
+ "4:\tadd $128, %%" RSP_LP "\n" \
"5:\tjmp 24f\n" \
"6:\t.size _L_robust_timedlock_%=, 6b-1b\n\t" \
".previous\n" \
@@ -468,10 +471,10 @@ LLL_STUB_UNWIND_INFO_END
".subsection 1\n\t" \
".type _L_unlock_%=, @function\n" \
"_L_unlock_%=:\n" \
- "1:\tleaq %0, %%rdi\n" \
- "2:\tsubq $128, %%rsp\n" \
+ "1:\tlea %0, %%" RDI_LP "\n" \
+ "2:\tsub $128, %%" RSP_LP "\n" \
"3:\tcallq __lll_unlock_wake_private\n" \
- "4:\taddq $128, %%rsp\n" \
+ "4:\tadd $128, %%" RSP_LP "\n" \
"5:\tjmp 24f\n" \
"6:\t.size _L_unlock_%=, 6b-1b\n\t" \
".previous\n" \
@@ -485,10 +488,10 @@ LLL_STUB_UNWIND_INFO_END
".subsection 1\n\t" \
".type _L_unlock_%=, @function\n" \
"_L_unlock_%=:\n" \
- "1:\tleaq %0, %%rdi\n" \
- "2:\tsubq $128, %%rsp\n" \
+ "1:\tlea %0, %%" RDI_LP "\n" \
+ "2:\tsub $128, %%" RSP_LP "\n" \
"3:\tcallq __lll_unlock_wake\n" \
- "4:\taddq $128, %%rsp\n" \
+ "4:\tadd $128, %%" RSP_LP "\n" \
"5:\tjmp 24f\n" \
"6:\t.size _L_unlock_%=, 6b-1b\n\t" \
".previous\n" \
@@ -508,10 +511,10 @@ LLL_STUB_UNWIND_INFO_END
".subsection 1\n\t" \
".type _L_robust_unlock_%=, @function\n" \
"_L_robust_unlock_%=:\n" \
- "1:\tleaq %0, %%rdi\n" \
- "2:\tsubq $128, %%rsp\n" \
+ "1:\tlea %0, %%" RDI_LP "\n" \
+ "2:\tsub $128, %%" RSP_LP "\n" \
"3:\tcallq __lll_unlock_wake\n" \
- "4:\taddq $128, %%rsp\n" \
+ "4:\tadd $128, %%" RSP_LP "\n" \
"5:\tjmp 24f\n" \
"6:\t.size _L_robust_unlock_%=, 6b-1b\n\t" \
".previous\n" \
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
index 0db3af1cc..67ff5fc4c 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
@@ -1,5 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009
- Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -24,7 +23,7 @@
#include <kernel-features.h>
#include <pthread-pi-defines.h>
#include <pthread-errnos.h>
-
+#include <stap-probe.h>
.text
@@ -34,6 +33,8 @@
.align 16
__pthread_cond_broadcast:
+ LIBC_PROBE (cond_broadcast, 1, %rdi)
+
/* Get internal lock. */
movl $1, %esi
xorl %eax, %eax
@@ -59,14 +60,14 @@ __pthread_cond_broadcast:
incl broadcast_seq-cond_futex(%rdi)
/* Get the address of the mutex used. */
- movq dep_mutex-cond_futex(%rdi), %r8
+ mov dep_mutex-cond_futex(%rdi), %R8_LP
/* Unlock. */
LOCK
decl cond_lock-cond_futex(%rdi)
jne 7f
-8: cmpq $-1, %r8
+8: cmp $-1, %R8_LP
je 9f
/* Do not use requeue for pshared condvars. */
@@ -128,7 +129,7 @@ __pthread_cond_broadcast:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -140,7 +141,7 @@ __pthread_cond_broadcast:
/* Unlock in loop requires wakeup. */
5: addq $cond_lock-cond_futex, %rdi
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -149,7 +150,7 @@ __pthread_cond_broadcast:
/* Unlock in loop requires wakeup. */
7: addq $cond_lock-cond_futex, %rdi
- cmpq $-1, %r8
+ cmp $-1, %R8_LP
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -158,7 +159,7 @@ __pthread_cond_broadcast:
jmp 8b
9: /* The futex requeue functionality is not available. */
- cmpq $-1, %r8
+ cmp $-1, %R8_LP
movl $0x7fffffff, %edx
#ifdef __ASSUME_PRIVATE_FUTEX
movl $FUTEX_WAKE, %eax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
index bb9a8134d..3bff19bd1 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,6 +23,7 @@
#include <pthread-pi-defines.h>
#include <kernel-features.h>
#include <pthread-errnos.h>
+#include <stap-probe.h>
.text
@@ -33,6 +34,8 @@
.align 16
__pthread_cond_signal:
+ LIBC_PROBE (cond_signal, 1, %rdi)
+
/* Get internal lock. */
movq %rdi, %r8
movl $1, %esi
@@ -55,14 +58,14 @@ __pthread_cond_signal:
addl $1, (%rdi)
/* Wake up one thread. */
- cmpq $-1, dep_mutex(%r8)
+ LP_OP(cmp) $-1, dep_mutex(%r8)
movl $FUTEX_WAKE_OP, %esi
movl $1, %edx
movl $SYS_futex, %eax
je 8f
/* Get the address of the mutex used. */
- movq dep_mutex(%r8), %rcx
+ mov dep_mutex(%r8), %RCX_LP
movl MUTEX_KIND(%rcx), %r11d
andl $(ROBUST_BIT|PI_BIT), %r11d
cmpl $PI_BIT, %r11d
@@ -134,7 +137,7 @@ __pthread_cond_signal:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -150,7 +153,7 @@ __pthread_cond_signal:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
index cdc2bf68b..50e1ffd55 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005,2007,2009,2010,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -22,6 +22,7 @@
#include <lowlevelcond.h>
#include <pthread-pi-defines.h>
#include <pthread-errnos.h>
+#include <stap-probe.h>
#include <kernel-features.h>
@@ -67,6 +68,8 @@ __pthread_cond_timedwait:
cfi_adjust_cfa_offset(FRAME_SIZE)
cfi_remember_state
+ LIBC_PROBE (cond_timedwait, 3, %rdi, %rsi, %rdx)
+
cmpq $1000000000, 8(%rdx)
movl $EINVAL, %eax
jae 48f
@@ -89,7 +92,7 @@ __pthread_cond_timedwait:
+--------------------------+
*/
- cmpq $-1, dep_mutex(%rdi)
+ LP_OP(cmp) $-1, dep_mutex(%rdi)
/* Prepare structure passed to cancellation handler. */
movq %rdi, 8(%rsp)
@@ -97,7 +100,7 @@ __pthread_cond_timedwait:
movq %rdx, %r13
je 22f
- movq %rsi, dep_mutex(%rdi)
+ mov %RSI_LP, dep_mutex(%rdi)
22:
xorl %r15d, %r15d
@@ -163,10 +166,10 @@ __pthread_cond_timedwait:
movq %r13, %r10
movl $FUTEX_WAIT_BITSET, %esi
- cmpq $-1, dep_mutex(%rdi)
+ LP_OP(cmp) $-1, dep_mutex(%rdi)
je 60f
- movq dep_mutex(%rdi), %r8
+ mov dep_mutex(%rdi), %R8_LP
/* Requeue to a non-robust PI mutex if the PI bit is set and
the robust bit is not set. */
movl MUTEX_KIND(%r8), %eax
@@ -268,7 +271,7 @@ __pthread_cond_timedwait:
jne 55f
addq $cond_nwaiters, %rdi
- cmpq $-1, dep_mutex-cond_nwaiters(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_nwaiters(%rdi)
movl $1, %edx
#ifdef __ASSUME_PRIVATE_FUTEX
movl $FUTEX_WAKE, %eax
@@ -331,7 +334,7 @@ __pthread_cond_timedwait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -343,7 +346,7 @@ __pthread_cond_timedwait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -355,7 +358,7 @@ __pthread_cond_timedwait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -370,7 +373,7 @@ __pthread_cond_timedwait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -391,7 +394,7 @@ __pthread_cond_timedwait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -446,9 +449,9 @@ __pthread_cond_timedwait:
kernel. */
leaq 32(%rsp), %rsi
# ifdef SHARED
- movq __vdso_clock_gettime@GOTPCREL(%rip), %rax
- movq (%rax), %rax
- PTR_DEMANGLE (%rax)
+ mov __vdso_clock_gettime@GOTPCREL(%rip), %RAX_LP
+ mov (%rax), %RAX_LP
+ PTR_DEMANGLE (%RAX_LP)
call *%rax
# else
movl $__NR_clock_gettime, %eax
@@ -508,7 +511,7 @@ __pthread_cond_timedwait:
movl %eax, (%rsp)
leaq 32(%rsp), %r10
- cmpq $-1, dep_mutex(%rdi)
+ LP_OP(cmp) $-1, dep_mutex(%rdi)
movq %r12, %rdx
# ifdef __ASSUME_PRIVATE_FUTEX
movl $FUTEX_WAIT, %eax
@@ -568,7 +571,7 @@ __pthread_cond_timedwait:
# if cond_lock != 0
addq $cond_lock, %rdi
# endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -580,7 +583,7 @@ __pthread_cond_timedwait:
# if cond_lock != 0
addq $cond_lock, %rdi
# endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -592,7 +595,7 @@ __pthread_cond_timedwait:
# if cond_lock != 0
addq $cond_lock, %rdi
# endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -675,7 +678,7 @@ __condvar_cleanup2:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -708,7 +711,7 @@ __condvar_cleanup2:
andl $~((1 << nwaiters_shift) - 1), %eax
jne 4f
- cmpq $-1, dep_mutex(%rdi)
+ LP_OP(cmp) $-1, dep_mutex(%rdi)
leaq cond_nwaiters(%rdi), %rdi
movl $1, %edx
#ifdef __ASSUME_PRIVATE_FUTEX
@@ -736,7 +739,7 @@ __condvar_cleanup2:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -746,7 +749,7 @@ __condvar_cleanup2:
2: testq %r12, %r12
jnz 5f
addq $cond_futex, %rdi
- cmpq $-1, dep_mutex-cond_futex(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_futex(%rdi)
movl $0x7fffffff, %edx
#ifdef __ASSUME_PRIVATE_FUTEX
movl $FUTEX_WAKE, %eax
@@ -805,9 +808,9 @@ __condvar_cleanup2:
.hidden DW.ref.__gcc_personality_v0
.weak DW.ref.__gcc_personality_v0
.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
- .align 8
+ .align LP_SIZE
.type DW.ref.__gcc_personality_v0, @object
- .size DW.ref.__gcc_personality_v0, 8
+ .size DW.ref.__gcc_personality_v0, LP_SIZE
DW.ref.__gcc_personality_v0:
- .quad __gcc_personality_v0
+ ASM_ADDR __gcc_personality_v0
#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
index fa0455f35..61948523a 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,6 +23,7 @@
#include <tcb-offsets.h>
#include <pthread-pi-defines.h>
#include <pthread-errnos.h>
+#include <stap-probe.h>
#include <kernel-features.h>
@@ -54,25 +55,27 @@ __pthread_cond_wait:
rsp + 32
+--------------------------+
rsp + 24 | old wake_seq value |
- +--------------------------+
+ +--------------------------+
rsp + 16 | mutex pointer |
- +--------------------------+
+ +--------------------------+
rsp + 8 | condvar pointer |
- +--------------------------+
+ +--------------------------+
rsp + 4 | old broadcast_seq value |
- +--------------------------+
+ +--------------------------+
rsp + 0 | old cancellation mode |
- +--------------------------+
+ +--------------------------+
*/
- cmpq $-1, dep_mutex(%rdi)
+ LIBC_PROBE (cond_wait, 2, %rdi, %rsi)
+
+ LP_OP(cmp) $-1, dep_mutex(%rdi)
- /* Prepare structure passed to cancellation handler. */
+ /* Prepare structure passed to cancellation handler. */
movq %rdi, 8(%rsp)
movq %rsi, 16(%rsp)
je 15f
- movq %rsi, dep_mutex(%rdi)
+ mov %RSI_LP, dep_mutex(%rdi)
/* Get internal lock. */
15: movl $1, %esi
@@ -120,12 +123,12 @@ __pthread_cond_wait:
movl %eax, (%rsp)
xorq %r10, %r10
- cmpq $-1, dep_mutex(%rdi)
+ LP_OP(cmp) $-1, dep_mutex(%rdi)
leaq cond_futex(%rdi), %rdi
movl $FUTEX_WAIT, %esi
je 60f
- movq dep_mutex-cond_futex(%rdi), %r8
+ mov dep_mutex-cond_futex(%rdi), %R8_LP
/* Requeue to a non-robust PI mutex if the PI bit is set and
the robust bit is not set. */
movl MUTEX_KIND(%r8), %eax
@@ -206,7 +209,7 @@ __pthread_cond_wait:
jne 17f
addq $cond_nwaiters, %rdi
- cmpq $-1, dep_mutex-cond_nwaiters(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_nwaiters(%rdi)
movl $1, %edx
#ifdef __ASSUME_PRIVATE_FUTEX
movl $FUTEX_WAKE, %eax
@@ -255,7 +258,7 @@ __pthread_cond_wait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -267,7 +270,7 @@ __pthread_cond_wait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -283,7 +286,7 @@ __pthread_cond_wait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -298,7 +301,7 @@ __pthread_cond_wait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -319,7 +322,7 @@ __pthread_cond_wait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -348,7 +351,7 @@ __pthread_cond_wait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -374,7 +377,7 @@ __pthread_cond_wait:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -386,7 +389,7 @@ __pthread_cond_wait:
93:
/* Set the rest of SYS_futex args for FUTEX_WAIT_REQUEUE_PI. */
xorq %r10, %r10
- movq dep_mutex(%rdi), %r8
+ mov dep_mutex(%rdi), %R8_LP
leaq cond_futex(%rdi), %rdi
jmp 90b
.LcleanupEND2:
@@ -406,15 +409,15 @@ __condvar_cleanup1:
rsp + 32
+--------------------------+
rsp + 24 | unused |
- +--------------------------+
+ +--------------------------+
rsp + 16 | mutex pointer |
- +--------------------------+
+ +--------------------------+
rsp + 8 | condvar pointer |
- +--------------------------+
+ +--------------------------+
rsp + 4 | old broadcast_seq value |
- +--------------------------+
+ +--------------------------+
rsp + 0 | old cancellation mode |
- +--------------------------+
+ +--------------------------+
*/
movq %rax, 24(%rsp)
@@ -434,7 +437,7 @@ __condvar_cleanup1:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -467,7 +470,7 @@ __condvar_cleanup1:
andl $~((1 << nwaiters_shift) - 1), %eax
jne 4f
- cmpq $-1, dep_mutex(%rdi)
+ LP_OP(cmp) $-1, dep_mutex(%rdi)
leaq cond_nwaiters(%rdi), %rdi
movl $1, %edx
#ifdef __ASSUME_PRIVATE_FUTEX
@@ -495,7 +498,7 @@ __condvar_cleanup1:
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- cmpq $-1, dep_mutex-cond_lock(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
movl $LLL_PRIVATE, %eax
movl $LLL_SHARED, %esi
cmovne %eax, %esi
@@ -506,7 +509,7 @@ __condvar_cleanup1:
2: testl %ecx, %ecx
jnz 5f
addq $cond_futex, %rdi
- cmpq $-1, dep_mutex-cond_futex(%rdi)
+ LP_OP(cmp) $-1, dep_mutex-cond_futex(%rdi)
movl $0x7fffffff, %edx
#ifdef __ASSUME_PRIVATE_FUTEX
movl $FUTEX_WAKE, %eax
@@ -559,9 +562,9 @@ __condvar_cleanup1:
.hidden DW.ref.__gcc_personality_v0
.weak DW.ref.__gcc_personality_v0
.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
- .align 8
+ .align LP_SIZE
.type DW.ref.__gcc_personality_v0, @object
- .size DW.ref.__gcc_personality_v0, 8
+ .size DW.ref.__gcc_personality_v0, LP_SIZE
DW.ref.__gcc_personality_v0:
- .quad __gcc_personality_v0
+ ASM_ADDR __gcc_personality_v0
#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S
index 4dc5bacc3..d766ae7f4 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S
@@ -188,9 +188,9 @@ clear_once_control:
.hidden DW.ref.__gcc_personality_v0
.weak DW.ref.__gcc_personality_v0
.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
- .align 8
+ .align LP_SIZE
.type DW.ref.__gcc_personality_v0, @object
- .size DW.ref.__gcc_personality_v0, 8
+ .size DW.ref.__gcc_personality_v0, LP_SIZE
DW.ref.__gcc_personality_v0:
- .quad __gcc_personality_v0
+ ASM_ADDR __gcc_personality_v0
#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
index c0761850d..abb305791 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -21,7 +21,7 @@
#include <lowlevelrwlock.h>
#include <pthread-errnos.h>
#include <kernel-features.h>
-
+#include <stap-probe.h>
.text
@@ -30,6 +30,9 @@
.align 16
__pthread_rwlock_rdlock:
cfi_startproc
+
+ LIBC_PROBE (rdlock_entry, 1, %rdi)
+
xorq %r10, %r10
/* Get the lock. */
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
index b349554ed..f6a6bff09 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -21,7 +21,7 @@
#include <lowlevelrwlock.h>
#include <pthread-errnos.h>
#include <kernel-features.h>
-
+#include <stap-probe.h>
.text
@@ -30,6 +30,9 @@
.align 16
__pthread_rwlock_wrlock:
cfi_startproc
+
+ LIBC_PROBE (wrlock_entry, 1, %rdi)
+
xorq %r10, %r10
/* Get the lock. */
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
index 0e0898cbb..65e715d2d 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
@@ -45,7 +45,7 @@ sem_post:
#endif
jnz 0b
- cmpq $0, NWAITERS(%rdi)
+ LP_OP(cmp) $0, NWAITERS(%rdi)
je 2f
movl $SYS_futex, %eax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
index a60023809..acb79dbd1 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
@@ -83,7 +83,7 @@ sem_timedwait:
movq %rsi, %r10
LOCK
- addq $1, NWAITERS(%rdi)
+ LP_OP(add) $1, NWAITERS(%rdi)
.LcleanupSTART:
13: call __pthread_enable_asynccancel
@@ -134,7 +134,7 @@ sem_timedwait:
xorl %eax, %eax
15: LOCK
- subq $1, NWAITERS(%rdi)
+ LP_OP(sub) $1, NWAITERS(%rdi)
leaq 8(%rsp), %rsp
cfi_adjust_cfa_offset(-8)
@@ -189,7 +189,7 @@ sem_timedwait:
movq %rsi, %r13
LOCK
- addq $1, NWAITERS(%r12)
+ LP_OP(add) $1, NWAITERS(%r12)
7: xorl %esi, %esi
movq %rsp,%rdi
@@ -266,7 +266,7 @@ sem_timedwait:
xorl %eax, %eax
45: LOCK
- subq $1, NWAITERS(%r12)
+ LP_OP(sub) $1, NWAITERS(%r12)
addq $STACKFRAME, %rsp
cfi_adjust_cfa_offset(-STACKFRAME)
@@ -304,7 +304,7 @@ sem_timedwait_cleanup:
movq (%rsp), %rdi
LOCK
- subq $1, NWAITERS(%rdi)
+ LP_OP(sub) $1, NWAITERS(%rdi)
movq %rax, %rdi
.LcallUR:
call _Unwind_Resume@PLT
@@ -324,7 +324,7 @@ sem_timedwait_cleanup2:
cfi_rel_offset(%r14, STACKFRAME)
LOCK
- subq $1, NWAITERS(%r12)
+ LP_OP(sub) $1, NWAITERS(%r12)
movq %rax, %rdi
movq STACKFRAME(%rsp), %r14
movq STACKFRAME+8(%rsp), %r13
@@ -372,9 +372,9 @@ sem_timedwait_cleanup2:
.hidden DW.ref.__gcc_personality_v0
.weak DW.ref.__gcc_personality_v0
.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
- .align 8
+ .align LP_SIZE
.type DW.ref.__gcc_personality_v0, @object
- .size DW.ref.__gcc_personality_v0, 8
+ .size DW.ref.__gcc_personality_v0, LP_SIZE
DW.ref.__gcc_personality_v0:
- .quad __gcc_personality_v0
+ ASM_ADDR __gcc_personality_v0
#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
index c6c6c26f8..7f911488a 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
@@ -66,7 +66,7 @@ sem_wait:
cfi_adjust_cfa_offset(8)
LOCK
- addq $1, NWAITERS(%rdi)
+ LP_OP(add) $1, NWAITERS(%rdi)
.LcleanupSTART:
6: call __pthread_enable_asynccancel
@@ -115,7 +115,7 @@ sem_wait:
xorl %eax, %eax
9: LOCK
- subq $1, NWAITERS(%rdi)
+ LP_OP(sub) $1, NWAITERS(%rdi)
leaq 8(%rsp), %rsp
cfi_adjust_cfa_offset(-8)
@@ -136,7 +136,7 @@ sem_wait:
sem_wait_cleanup:
movq (%rsp), %rdi
LOCK
- subq $1, NWAITERS(%rdi)
+ LP_OP(sub) $1, NWAITERS(%rdi)
movq %rax, %rdi
.LcallUR:
call _Unwind_Resume@PLT
@@ -168,9 +168,9 @@ sem_wait_cleanup:
.hidden DW.ref.__gcc_personality_v0
.weak DW.ref.__gcc_personality_v0
.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
- .align 8
+ .align LP_SIZE
.type DW.ref.__gcc_personality_v0, @object
- .size DW.ref.__gcc_personality_v0, 8
+ .size DW.ref.__gcc_personality_v0, LP_SIZE
DW.ref.__gcc_personality_v0:
- .quad __gcc_personality_v0
+ ASM_ADDR __gcc_personality_v0
#endif
diff --git a/libc/nptl/sysdeps/x86_64/64/shlib-versions b/libc/nptl/sysdeps/x86_64/64/shlib-versions
new file mode 100644
index 000000000..5093c4c18
--- /dev/null
+++ b/libc/nptl/sysdeps/x86_64/64/shlib-versions
@@ -0,0 +1,3 @@
+# Configuration DEFAULT Earliest symbol set
+# ------------- --------------- ------------------------------
+x86_64-.*-linux.* libpthread=0 GLIBC_2.2.5
diff --git a/libc/nptl/sysdeps/x86_64/tls.h b/libc/nptl/sysdeps/x86_64/tls.h
index 77f04f202..f83891605 100644
--- a/libc/nptl/sysdeps/x86_64/tls.h
+++ b/libc/nptl/sysdeps/x86_64/tls.h
@@ -27,7 +27,6 @@
# include <stdlib.h>
# include <sysdep.h>
# include <kernel-features.h>
-# include <bits/wordsize.h>
# include <xmmintrin.h>
@@ -60,18 +59,14 @@ typedef struct
# else
int __unused1;
# endif
-# if __WORDSIZE == 64
int rtld_must_xmm_save;
-# endif
/* Reservation of some values for the TM ABI. */
void *__private_tm[5];
-# if __WORDSIZE == 64
long int __unused2;
/* Have space for the post-AVX register size. */
- __m128 rtld_savespace_sse[8][4];
+ __m128 rtld_savespace_sse[8][4] __attribute__ ((aligned (32)));
void *__padding[8];
-# endif
} tcbhead_t;
#else /* __ASSEMBLER__ */
diff --git a/libc/nptl/sysdeps/x86_64/x32/shlib-versions b/libc/nptl/sysdeps/x86_64/x32/shlib-versions
new file mode 100644
index 000000000..8fcad2e56
--- /dev/null
+++ b/libc/nptl/sysdeps/x86_64/x32/shlib-versions
@@ -0,0 +1,3 @@
+# Configuration DEFAULT Earliest symbol set
+# ------------- --------------- ------------------------------
+x86_64-.*-linux.* libpthread=0 GLIBC_2.16
diff --git a/libc/nptl/tst-cancel-self-cancelstate.c b/libc/nptl/tst-cancel-self-cancelstate.c
new file mode 100644
index 000000000..c82e6f3ce
--- /dev/null
+++ b/libc/nptl/tst-cancel-self-cancelstate.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include "tst-cancel-self-cleanup.c"
+
+
+static int
+do_test (void)
+{
+ int ret = 0;
+ volatile int should_fail = 1;
+
+ pthread_cleanup_push (cleanup, &should_fail);
+
+ if ((ret = pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL)) != 0)
+ {
+ printf ("setcancelstate(disable) failed: %s\n", strerror (ret));
+ exit (1);
+ }
+
+ if ((ret = pthread_cancel (pthread_self ())) != 0)
+ {
+ printf ("cancel failed: %s\n", strerror (ret));
+ exit (1);
+ }
+
+ usleep (100);
+ should_fail = 0;
+
+ if ((ret = pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL)) != 0)
+ {
+ printf ("setcancelstate(enable) failed: %s\n", strerror (ret));
+ exit (1);
+ }
+
+ /* The write syscall within this printf should give us our cancellation
+ point. */
+ printf ("Could not cancel self.\n");
+ pthread_cleanup_pop (0);
+
+ return 1;
+}
+
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/nptl/tst-cancel-self-canceltype.c b/libc/nptl/tst-cancel-self-canceltype.c
new file mode 100644
index 000000000..c9bb65313
--- /dev/null
+++ b/libc/nptl/tst-cancel-self-canceltype.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include "tst-cancel-self-cleanup.c"
+
+
+static int
+do_test (void)
+{
+ int ret = 0, should_fail = 0;
+
+ pthread_cleanup_push (cleanup, &should_fail);
+
+ if ((ret = pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL)) != 0)
+ {
+ printf ("setcanceltype failed: %s\n", strerror (ret));
+ exit (1);
+ }
+
+ if ((ret = pthread_cancel (pthread_self ())) != 0)
+ {
+ printf ("cancel failed: %s\n", strerror (ret));
+ exit (1);
+ }
+
+ /* Wait to be canceled. Don't give any cancellation points to play with. */
+ while (1);
+ pthread_cleanup_pop (0);
+
+ return 1;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/sysdeps/powerpc/soft-fp/q_qtoll.c b/libc/nptl/tst-cancel-self-cleanup.c
index 0bdce8336..9b15f555d 100644
--- a/libc/sysdeps/powerpc/soft-fp/q_qtoll.c
+++ b/libc/nptl/tst-cancel-self-cleanup.c
@@ -1,9 +1,5 @@
-/* Software floating-point emulation.
- Return (long)a
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,19 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FP_ROUNDMODE FP_RND_ZERO
-#include "soft-fp.h"
-#include "quad.h"
-
-long long _q_qtoll(const long double a)
+static void
+cleanup (void *cleanup_should_fail)
{
- FP_DECL_EX;
- FP_DECL_Q(A);
- unsigned long long r;
-
- FP_UNPACK_RAW_Q(A, a);
- FP_TO_INT_Q(r, A, 64, 1);
- FP_HANDLE_EXCEPTIONS;
-
- return r;
+ printf ("Main thread got cancelled and is being cleaned up now\n");
+ exit (*(int *)cleanup_should_fail);
}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_fge.c b/libc/nptl/tst-cancel-self-testcancel.c
index 867264f59..c9422321c 100644
--- a/libc/sysdeps/powerpc/soft-fp/q_fge.c
+++ b/libc/nptl/tst-cancel-self-testcancel.c
@@ -1,9 +1,5 @@
-/* Software floating-point emulation.
- Return 1 if a >= b
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,21 +15,34 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include "soft-fp.h"
-#include "quad.h"
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include "tst-cancel-self-cleanup.c"
-int _q_fge(const long double a, const long double b)
+
+static int
+do_test (void)
{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B);
- int r;
-
- FP_UNPACK_RAW_Q(A, a);
- FP_UNPACK_RAW_Q(B, b);
- FP_CMP_Q(r, B, A, 3);
- if (r == 3)
- FP_SET_EXCEPTION(FP_EX_INVALID);
- FP_HANDLE_EXCEPTIONS;
-
- return (r <= 0);
+ int ret = 0, should_fail = 0;
+
+ pthread_cleanup_push (cleanup, &should_fail);
+ if ((ret = pthread_cancel (pthread_self ())) != 0)
+ {
+ printf ("cancel failed: %s\n", strerror (ret));
+ exit (1);
+ }
+
+ pthread_testcancel ();
+
+ printf ("Could not cancel self.\n");
+ pthread_cleanup_pop (0);
+
+ return 1;
}
+
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/sysdeps/powerpc/soft-fp/q_cmpe.c b/libc/nptl/tst-cancel-self.c
index f336fa7af..966698ca3 100644
--- a/libc/sysdeps/powerpc/soft-fp/q_cmpe.c
+++ b/libc/nptl/tst-cancel-self.c
@@ -1,10 +1,5 @@
-/* Software floating-point emulation.
- Compare a and b, return float condition code.
- Signal exception (unless masked) if unordered.
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -20,22 +15,34 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include "soft-fp.h"
-#include "quad.h"
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include "tst-cancel-self-cleanup.c"
-int _q_cmpe(const long double a, const long double b)
+
+static int
+do_test (void)
{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B);
- int r;
-
- FP_UNPACK_RAW_Q(A, a);
- FP_UNPACK_RAW_Q(B, b);
- FP_CMP_Q(r, B, A, 3);
- if (r == -1) r = 2;
- if (r == 3)
- FP_SET_EXCEPTION(FP_EX_INVALID);
- FP_HANDLE_EXCEPTIONS;
-
- return r;
+ int ret = 0, should_fail = 0;
+
+ pthread_cleanup_push (cleanup, &should_fail);
+ if ((ret = pthread_cancel (pthread_self ())) != 0)
+ {
+ printf ("cancel failed: %s\n", strerror (ret));
+ exit (1);
+ }
+
+ /* The write syscall within this printf should give us our cancellation
+ point. */
+ printf ("Could not cancel self.\n");
+ pthread_cleanup_pop (0);
+
+ return 1;
}
+
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/nptl/tst-stackguard1.c b/libc/nptl/tst-stackguard1.c
index 4af16c9c1..c45604663 100644
--- a/libc/nptl/tst-stackguard1.c
+++ b/libc/nptl/tst-stackguard1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2005.
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
-#include <elf/stackguard-macros.h>
+#include <stackguard-macros.h>
#include <unistd.h>
static const char *command;
diff --git a/libc/nptl/vars.c b/libc/nptl/vars.c
index 8f3023cfc..43a6e3957 100644
--- a/libc/nptl/vars.c
+++ b/libc/nptl/vars.c
@@ -32,7 +32,9 @@ size_t __default_stacksize attribute_hidden
int __is_smp attribute_hidden;
#ifndef TLS_MULTIPLE_THREADS_IN_TCB
-/* Variable set to a nonzero value if more than one thread runs or ran. */
+/* Variable set to a nonzero value either if more than one thread runs or ran,
+ or if a single-threaded process is trying to cancel itself. See
+ nptl/descr.h for more context on the single-threaded process case. */
int __pthread_multiple_threads attribute_hidden;
#endif
diff --git a/libc/nscd/nscd-client.h b/libc/nscd/nscd-client.h
index e57a23c05..aef76e8fd 100644
--- a/libc/nscd/nscd-client.h
+++ b/libc/nscd/nscd-client.h
@@ -1,5 +1,4 @@
-/* Copyright (c) 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2011
- Free Software Foundation, Inc.
+/* Copyright (c) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
@@ -322,6 +321,25 @@ struct locked_map_ptr
};
#define libc_locked_map_ptr(class, name) class struct locked_map_ptr name
+/* Try acquiring lock for mapptr, returns true if it succeeds, false
+ if not. */
+static inline bool
+__nscd_acquire_maplock (volatile struct locked_map_ptr *mapptr)
+{
+ int cnt = 0;
+ while (__builtin_expect (atomic_compare_and_exchange_val_acq (&mapptr->lock,
+ 1, 0) != 0, 0))
+ {
+ // XXX Best number of rounds?
+ if (__builtin_expect (++cnt > 5, 0))
+ return false;
+
+ atomic_delay ();
+ }
+
+ return true;
+}
+
/* Open socket connection to nscd server. */
extern int __nscd_open_socket (const char *key, size_t keylen,
diff --git a/libc/nscd/nscd_gethst_r.c b/libc/nscd/nscd_gethst_r.c
index c1661f86d..d64ad2e7b 100644
--- a/libc/nscd/nscd_gethst_r.c
+++ b/libc/nscd/nscd_gethst_r.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1998-2005, 2006, 2007, 2008, 2009, 2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -100,9 +99,18 @@ libc_freeres_fn (hst_map_free)
uint32_t
__nscd_get_nl_timestamp (void)
{
+ uint32_t retval;
if (__nss_not_use_nscd_hosts != 0)
return 0;
+ /* __nscd_get_mapping can change hst_map_handle.mapped to NO_MAPPING.
+ However, __nscd_get_mapping assumes the prior value was not NO_MAPPING.
+ Thus we have to acquire the lock to prevent this thread from changing
+ hst_map_handle.mapped to NO_MAPPING while another thread is inside
+ __nscd_get_mapping. */
+ if (!__nscd_acquire_maplock (&__hst_map_handle))
+ return 0;
+
struct mapped_database *map = __hst_map_handle.mapped;
if (map == NULL
@@ -112,9 +120,14 @@ __nscd_get_nl_timestamp (void)
map = __nscd_get_mapping (GETFDHST, "hosts", &__hst_map_handle.mapped);
if (map == NO_MAPPING)
- return 0;
+ retval = 0;
+ else
+ retval = map->head->extra_data[NSCD_HST_IDX_CONF_TIMESTAMP];
+
+ /* Release the lock. */
+ __hst_map_handle.lock = 0;
- return map->head->extra_data[NSCD_HST_IDX_CONF_TIMESTAMP];
+ return retval;
}
diff --git a/libc/nscd/nscd_helper.c b/libc/nscd/nscd_helper.c
index 92558b6a5..96fb93db7 100644
--- a/libc/nscd/nscd_helper.c
+++ b/libc/nscd/nscd_helper.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -419,7 +419,6 @@ __nscd_get_mapping (request_type type, const char *key,
return result;
}
-
struct mapped_database *
__nscd_get_map_ref (request_type type, const char *name,
volatile struct locked_map_ptr *mapptr, int *gc_cyclep)
@@ -428,16 +427,8 @@ __nscd_get_map_ref (request_type type, const char *name,
if (cur == NO_MAPPING)
return cur;
- int cnt = 0;
- while (__builtin_expect (atomic_compare_and_exchange_val_acq (&mapptr->lock,
- 1, 0) != 0, 0))
- {
- // XXX Best number of rounds?
- if (__builtin_expect (++cnt > 5, 0))
- return NO_MAPPING;
-
- atomic_delay ();
- }
+ if (!__nscd_acquire_maplock (mapptr))
+ return NO_MAPPING;
cur = mapptr->mapped;
diff --git a/libc/nss/nsswitch.c b/libc/nss/nsswitch.c
index 8e893328e..0614b526a 100644
--- a/libc/nss/nsswitch.c
+++ b/libc/nss/nsswitch.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1996-2012
- Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -99,6 +98,12 @@ static const char *const __nss_shlib_revision = LIBNSS_FILES_SO + 15;
/* The root of the whole data base. */
static name_database *service_table;
+/* List of default service lists that were generated by glibc because
+ /etc/nsswitch.conf did not provide a value.
+ The list is only maintained so we can free such service lists in
+ __libc_freeres. */
+static name_database_entry *defconfig_entries;
+
#else /* __OPTION_EGLIBC_NSSWITCH */
/* Bring in the statically initialized service table we generated at
@@ -171,8 +176,27 @@ __nss_database_lookup (const char *database, const char *alternate_name,
DEFCONFIG specifies the default service list for this database,
or null to use the most common default. */
if (*ni == NULL)
- *ni = nss_parse_service_list (defconfig
- ?: "nis [NOTFOUND=return] files");
+ {
+ *ni = nss_parse_service_list (defconfig
+ ?: "nis [NOTFOUND=return] files");
+ if (*ni != NULL)
+ {
+ /* Record the memory we've just allocated in defconfig_entries list,
+ so we can free it later. */
+ name_database_entry *entry;
+
+ /* Allocate ENTRY plus size of name (1 here). */
+ entry = (name_database_entry *) malloc (sizeof (*entry) + 1);
+
+ if (entry != NULL)
+ {
+ entry->next = defconfig_entries;
+ entry->service = *ni;
+ entry->name[0] = '\0';
+ defconfig_entries = entry;
+ }
+ }
+ }
#else
/* Without the dynamic behavior, we can't process defconfig. The
databases the user specified at library build time are all you
@@ -717,7 +741,7 @@ nss_parse_service_list (const char *line)
else if (__strncasecmp (name, "UNAVAIL", 7) == 0)
status = NSS_STATUS_UNAVAIL;
else
- return result;
+ goto finish;
}
else if (line - name == 8)
{
@@ -726,15 +750,15 @@ nss_parse_service_list (const char *line)
else if (__strncasecmp (name, "TRYAGAIN", 8) == 0)
status = NSS_STATUS_TRYAGAIN;
else
- return result;
+ goto finish;
}
else
- return result;
+ goto finish;
while (isspace (line[0]))
++line;
if (line[0] != '=')
- return result;
+ goto finish;
do
++line;
while (isspace (line[0]));
@@ -750,7 +774,7 @@ nss_parse_service_list (const char *line)
&& __strncasecmp (name, "CONTINUE", 8) == 0)
action = NSS_ACTION_CONTINUE;
else
- return result;
+ goto finish;
if (not)
{
@@ -778,6 +802,11 @@ nss_parse_service_list (const char *line)
*nextp = new_service;
nextp = &new_service->next;
+ continue;
+
+ finish:
+ free (new_service);
+ return result;
}
}
@@ -893,23 +922,10 @@ __nss_disable_nscd (void (*cb) (size_t, struct traced_file *))
#endif /* __OPTION_EGLIBC_INET */
#endif
-
#if __OPTION_EGLIBC_NSSWITCH
-/* Free all resources if necessary. */
-libc_freeres_fn (free_mem)
+static void
+free_database_entries (name_database_entry *entry)
{
- name_database *top = service_table;
- name_database_entry *entry;
- service_library *library;
-
- if (top == NULL)
- /* Maybe we have not read the nsswitch.conf file. */
- return;
-
- /* Don't disturb ongoing other threads (if there are any). */
- service_table = NULL;
-
- entry = top->entry;
while (entry != NULL)
{
name_database_entry *olde = entry;
@@ -929,6 +945,36 @@ libc_freeres_fn (free_mem)
entry = entry->next;
free (olde);
}
+}
+
+/* Free all resources if necessary. */
+libc_freeres_fn (free_defconfig)
+{
+ name_database_entry *entry = defconfig_entries;
+
+ if (entry == NULL)
+ /* defconfig was not used. */
+ return;
+
+ /* Don't disturb ongoing other threads (if there are any). */
+ defconfig_entries = NULL;
+
+ free_database_entries (entry);
+}
+
+libc_freeres_fn (free_mem)
+{
+ name_database *top = service_table;
+ service_library *library;
+
+ if (top == NULL)
+ /* Maybe we have not read the nsswitch.conf file. */
+ return;
+
+ /* Don't disturb ongoing other threads (if there are any). */
+ service_table = NULL;
+
+ free_database_entries (top->entry);
library = top->library;
while (library != NULL)
diff --git a/libc/posix/regex_internal.h b/libc/posix/regex_internal.h
index db4276f60..1291ce64a 100644
--- a/libc/posix/regex_internal.h
+++ b/libc/posix/regex_internal.h
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2005, 2007, 2008, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -77,7 +77,7 @@
# ifdef _LIBC
# undef gettext
# define gettext(msgid) \
- INTUSE(__dcgettext) (_libc_intl_domainname, msgid, LC_MESSAGES)
+ __dcgettext (_libc_intl_domainname, msgid, LC_MESSAGES)
# endif
#else
# define gettext(msgid) (msgid)
diff --git a/libc/scripts/data/c++-types-x32-linux-gnu.data b/libc/scripts/data/c++-types-x32-linux-gnu.data
new file mode 100644
index 000000000..348bf52b2
--- /dev/null
+++ b/libc/scripts/data/c++-types-x32-linux-gnu.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:x
+blksize_t:x
+caddr_t:Pc
+clockid_t:i
+clock_t:x
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:y
+fsfilcnt64_t:y
+fsfilcnt_t:y
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:y
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:y
+off64_t:x
+off_t:x
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:x
+rlim64_t:y
+rlim_t:y
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:x
+time_t:x
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/libc/shlib-versions b/libc/shlib-versions
index 840e08fbd..b8ed1e9b7 100644
--- a/libc/shlib-versions
+++ b/libc/shlib-versions
@@ -27,7 +27,6 @@
# ------------- --------------- ------------------------------
s390x-.*-linux.* DEFAULT GLIBC_2.2
-x86_64-.*-linux.* DEFAULT GLIBC_2.2.5
powerpc64-.*-linux.* DEFAULT GLIBC_2.3
.*-.*-gnu-gnu.* DEFAULT GLIBC_2.2.6
@@ -77,7 +76,6 @@ sparc.*-.*-linux.* ld=ld-linux.so.2
sh.*-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2
s390x-.*-linux.* ld=ld64.so.1 GLIBC_2.2
powerpc64.*-.*-linux.* ld=ld64.so.1 GLIBC_2.3
-x86_64-.*-linux.* ld=ld-linux-x86-64.so.2 GLIBC_2.2.5
# We use the ELF ABI standard name for the default.
.*-.*-.* ld=ld.so.1
diff --git a/libc/stdio-common/Makefile b/libc/stdio-common/Makefile
index 3d52697ae..03d78b801 100644
--- a/libc/stdio-common/Makefile
+++ b/libc/stdio-common/Makefile
@@ -63,9 +63,9 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \
tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
tst-fwrite bug16 bug17 tst-sprintf2 bug18 \
bug19 tst-popen2 scanf14 scanf15 bug21 bug22 scanf16 scanf17 \
- tst-setvbuf1 bug23 bug24 bug-vfprintf-nargs tst-sprintf3
+ tst-setvbuf1 bug23 bug24 bug-vfprintf-nargs tst-sprintf3 bug25
tests-$(OPTION_EGLIBC_LOCALE_CODE) \
- += tst-sscanf tst-swprintf bug15 test-vfprintf bug14 scanf13 tst-grouping
+ += tst-sscanf tst-swprintf test-vfprintf bug14 scanf13 tst-grouping
tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
+= tst-perror bug19a bug20 tst-long-dbl-fphex tst-fphex-wide
tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
@@ -133,7 +133,6 @@ tst-swprintf-ENV = LOCPATH=$(common-objpfx)localedata
test-vfprintf-ENV = LOCPATH=$(common-objpfx)localedata
scanf13-ENV = LOCPATH=$(common-objpfx)localedata
bug14-ENV = LOCPATH=$(common-objpfx)localedata
-bug15-ENV = LOCPATH=$(common-objpfx)localedata
tst-grouping-ENV = LOCPATH=$(common-objpfx)localedata
ifneq (,$(filter %REENTRANT, $(defines)))
diff --git a/libc/stdio-common/_itoa.c b/libc/stdio-common/_itoa.c
index 3dfff8ff6..12d69541b 100644
--- a/libc/stdio-common/_itoa.c
+++ b/libc/stdio-common/_itoa.c
@@ -79,7 +79,7 @@ struct base_table_t
/* We do not compile _itoa if we always can use _itoa_word. */
-#if LLONG_MAX != LONG_MAX
+#if _ITOA_NEEDED
/* Local variables. */
const struct base_table_t _itoa_base_table[] attribute_hidden =
{
@@ -169,7 +169,7 @@ extern const char _itoa_upper_digits_internal[] attribute_hidden;
char *
-_itoa_word (unsigned long value, char *buflim,
+_itoa_word (_ITOA_WORD_TYPE value, char *buflim,
unsigned int base, int upper_case)
{
const char *digits = (upper_case
@@ -204,7 +204,7 @@ _itoa_word (unsigned long value, char *buflim,
#undef SPECIAL
-#if LLONG_MAX != LONG_MAX
+#if _ITOA_NEEDED
char *
_itoa (value, buflim, base, upper_case)
unsigned long long int value;
@@ -470,7 +470,8 @@ _itoa (value, buflim, base, upper_case)
#endif
char *
-_fitoa_word (unsigned long value, char *buf, unsigned int base, int upper_case)
+_fitoa_word (_ITOA_WORD_TYPE value, char *buf, unsigned int base,
+ int upper_case)
{
char tmpbuf[sizeof (value) * 4]; /* Worst case length: base 2. */
char *cp = _itoa_word (value, tmpbuf + sizeof (value) * 4, base, upper_case);
@@ -479,7 +480,7 @@ _fitoa_word (unsigned long value, char *buf, unsigned int base, int upper_case)
return buf;
}
-#if LLONG_MAX != LONG_MAX
+#if _ITOA_NEEDED
char *
_fitoa (unsigned long long value, char *buf, unsigned int base, int upper_case)
{
diff --git a/libc/stdio-common/asprintf.c b/libc/stdio-common/asprintf.c
index 1f58a2067..c98de3f90 100644
--- a/libc/stdio-common/asprintf.c
+++ b/libc/stdio-common/asprintf.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991, 1995, 1997, 1998, 2002, 2004, 2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,7 +37,7 @@ ___asprintf (char **string_ptr, const char *format, ...)
return done;
}
-INTDEF2(___asprintf, __asprintf)
+ldbl_hidden_def (___asprintf, __asprintf)
ldbl_strong_alias (___asprintf, __asprintf)
ldbl_weak_alias (___asprintf, asprintf)
diff --git a/libc/stdio-common/bug15.c b/libc/stdio-common/bug15.c
deleted file mode 100644
index 825ca2f98..000000000
--- a/libc/stdio-common/bug15.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <stdio.h>
-#include <locale.h>
-
-int
-main (void)
-{
- char buf[10];
- setlocale (LC_ALL, "vi_VN.TCVN-5712");
- return sprintf (buf, "%.*s", 2, "vi") != 2;
-}
diff --git a/libc/stdio-common/bug22.c b/libc/stdio-common/bug22.c
index efd950136..b26399acb 100644
--- a/libc/stdio-common/bug22.c
+++ b/libc/stdio-common/bug22.c
@@ -51,6 +51,6 @@ do_test (void)
return ret != -1 || errno != EOVERFLOW;
}
-#define TIMEOUT 30
+#define TIMEOUT 60
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
diff --git a/libc/stdio-common/bug25.c b/libc/stdio-common/bug25.c
new file mode 100644
index 000000000..30c133974
--- /dev/null
+++ b/libc/stdio-common/bug25.c
@@ -0,0 +1,70 @@
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+static const char expected[] = "\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55\
+\n\
+a\n\
+abbcd55%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
+
+static int
+do_test (void)
+{
+ char *buf = malloc (strlen (expected) + 1);
+ snprintf (buf, strlen (expected) + 1,
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+ "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+ "a", "b", "c", "d", 5);
+ return strcmp (buf, expected) != 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/stdio-common/fxprintf.c b/libc/stdio-common/fxprintf.c
index eaf106ecf..1d6c02479 100644
--- a/libc/stdio-common/fxprintf.c
+++ b/libc/stdio-common/fxprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>.
@@ -52,7 +52,7 @@ __fxprintf (FILE *fp, const char *fmt, ...)
#endif
}
else
- res = INTUSE(_IO_vfprintf) (fp, fmt, ap);
+ res = _IO_vfprintf (fp, fmt, ap);
va_end (ap);
diff --git a/libc/stdio-common/getw.c b/libc/stdio-common/getw.c
index 2cd5ab0a8..34b82c3de 100644
--- a/libc/stdio-common/getw.c
+++ b/libc/stdio-common/getw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1997, 1998, 2002, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <libio/iolibio.h>
-#define fread(p, m, n, s) INTUSE(_IO_fread) (p, m, n, s)
+#define fread(p, m, n, s) _IO_fread (p, m, n, s)
/* Read a word (int) from STREAM. */
int
diff --git a/libc/stdio-common/isoc99_fscanf.c b/libc/stdio-common/isoc99_fscanf.c
index 6e5e33d68..4b689fa0b 100644
--- a/libc/stdio-common/isoc99_fscanf.c
+++ b/libc/stdio-common/isoc99_fscanf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1997, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@ __isoc99_fscanf (FILE *stream, const char *format, ...)
stream->_flags2 |= _IO_FLAGS2_SCANF_STD;
va_start (arg, format);
- done = INTUSE(_IO_vfscanf) (stream, format, arg, NULL);
+ done = _IO_vfscanf (stream, format, arg, NULL);
va_end (arg);
_IO_release_lock (stream);
diff --git a/libc/stdio-common/isoc99_scanf.c b/libc/stdio-common/isoc99_scanf.c
index d91ef94bb..2e04e700e 100644
--- a/libc/stdio-common/isoc99_scanf.c
+++ b/libc/stdio-common/isoc99_scanf.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2002, 2004, 2006, 2007
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +32,7 @@ __isoc99_scanf (const char *format, ...)
stdin->_flags2 |= _IO_FLAGS2_SCANF_STD;
va_start (arg, format);
- done = INTUSE(_IO_vfscanf) (stdin, format, arg, NULL);
+ done = _IO_vfscanf (stdin, format, arg, NULL);
va_end (arg);
_IO_release_lock (stdin);
diff --git a/libc/stdio-common/isoc99_vfscanf.c b/libc/stdio-common/isoc99_vfscanf.c
index 658d5ff36..bd6087bd6 100644
--- a/libc/stdio-common/isoc99_vfscanf.c
+++ b/libc/stdio-common/isoc99_vfscanf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1997, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,7 @@ __isoc99_vfscanf (FILE *stream, const char *format, _IO_va_list args)
_IO_acquire_lock_clear_flags2 (stream);
stream->_flags2 |= _IO_FLAGS2_SCANF_STD;
- done = INTUSE(_IO_vfscanf) (stream, format, args, NULL);
+ done = _IO_vfscanf (stream, format, args, NULL);
_IO_release_lock (stream);
return done;
}
diff --git a/libc/stdio-common/isoc99_vscanf.c b/libc/stdio-common/isoc99_vscanf.c
index c9c187cb3..4d9f3b820 100644
--- a/libc/stdio-common/isoc99_vscanf.c
+++ b/libc/stdio-common/isoc99_vscanf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1997, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,7 @@ __isoc99_vscanf (const char *format, _IO_va_list args)
_IO_acquire_lock_clear_flags2 (stdin);
stdin->_flags2 |= _IO_FLAGS2_SCANF_STD;
- done = INTUSE(_IO_vfscanf) (stdin, format, args, NULL);
+ done = _IO_vfscanf (stdin, format, args, NULL);
_IO_release_lock (stdin);
return done;
}
diff --git a/libc/stdio-common/isoc99_vsscanf.c b/libc/stdio-common/isoc99_vsscanf.c
index 628856a6d..a6dc007dd 100644
--- a/libc/stdio-common/isoc99_vsscanf.c
+++ b/libc/stdio-common/isoc99_vsscanf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1997-2003,2006,2007,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,7 +40,7 @@ __isoc99_vsscanf (const char *string, const char *format, _IO_va_list args)
_IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
_IO_str_init_static_internal (&sf, (char*)string, 0, NULL);
sf._sbf._f._flags2 |= _IO_FLAGS2_SCANF_STD;
- ret = INTUSE(_IO_vfscanf) (&sf._sbf._f, format, args, NULL);
+ ret = _IO_vfscanf (&sf._sbf._f, format, args, NULL);
return ret;
}
libc_hidden_def (__isoc99_vsscanf)
diff --git a/libc/stdio-common/printf-prs.c b/libc/stdio-common/printf-prs.c
index 68a9c61a1..32f08bac1 100644
--- a/libc/stdio-common/printf-prs.c
+++ b/libc/stdio-common/printf-prs.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995, 1996, 1999, 2000, 2002-2005, 2007, 2009
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,7 +36,7 @@
# define PUT(F, S, N) _IO_sputn (F, S, N)
# define PAD(Padchar) \
if (width > 0) \
- done += INTUSE(_IO_padn) (s, Padchar, width)
+ done += _IO_padn (s, Padchar, width)
#else
# define vfprintf vfwprintf
# define CHAR_T wchar_t
diff --git a/libc/stdio-common/printf_fp.c b/libc/stdio-common/printf_fp.c
index a6dbb0ecd..5bb77f99f 100644
--- a/libc/stdio-common/printf_fp.c
+++ b/libc/stdio-common/printf_fp.c
@@ -1,5 +1,5 @@
/* Floating point output for `printf'.
- Copyright (C) 1995-2003, 2006-2008, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
@@ -57,7 +57,7 @@
/* This defines make it possible to use the same code for GNU C library and
the GNU I/O library. */
#define PUT(f, s, n) _IO_sputn (f, s, n)
-#define PAD(f, c, n) (wide ? _IO_wpadn (f, c, n) : INTUSE(_IO_padn) (f, c, n))
+#define PAD(f, c, n) (wide ? _IO_wpadn (f, c, n) : _IO_padn (f, c, n))
/* We use this file GNU C library and GNU I/O library. So make
names equal. */
#undef putc
diff --git a/libc/stdio-common/printf_fphex.c b/libc/stdio-common/printf_fphex.c
index 1c9469bcd..cd8a1f972 100644
--- a/libc/stdio-common/printf_fphex.c
+++ b/libc/stdio-common/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 1997-2002,2004,2006,2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -37,7 +37,7 @@
the GNU I/O library. */
#include <libioP.h>
#define PUT(f, s, n) _IO_sputn (f, s, n)
-#define PAD(f, c, n) (wide ? _IO_wpadn (f, c, n) : INTUSE(_IO_padn) (f, c, n))
+#define PAD(f, c, n) (wide ? _IO_wpadn (f, c, n) : _IO_padn (f, c, n))
/* We use this file GNU C library and GNU I/O library. So make
names equal. */
#undef putc
diff --git a/libc/stdio-common/printf_size.c b/libc/stdio-common/printf_size.c
index 58203136f..a36d3aa23 100644
--- a/libc/stdio-common/printf_size.c
+++ b/libc/stdio-common/printf_size.c
@@ -1,5 +1,5 @@
/* Print size value using units for orders of magnitude.
- Copyright (C) 1997-2002, 2004, 2006, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
Based on a proposal by Larry McVoy <lm@sgi.com>.
@@ -29,7 +29,7 @@
/* This defines make it possible to use the same code for GNU C library and
the GNU I/O library. */
#define PUT(f, s, n) _IO_sputn (f, s, n)
-#define PAD(f, c, n) (wide ? _IO_wpadn (f, c, n) : INTUSE(_IO_padn) (f, c, n))
+#define PAD(f, c, n) (wide ? _IO_wpadn (f, c, n) : _IO_padn (f, c, n))
/* We use this file GNU C library and GNU I/O library. So make
names equal. */
#undef putc
diff --git a/libc/stdio-common/putw.c b/libc/stdio-common/putw.c
index ecfdcd8b6..09902bfc6 100644
--- a/libc/stdio-common/putw.c
+++ b/libc/stdio-common/putw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1997, 1998, 2002, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,7 @@
#include <stdio.h>
#include <libio/iolibio.h>
-#define fwrite(p, n, m, s) INTUSE(_IO_fwrite) (p, n, m, s)
+#define fwrite(p, n, m, s) _IO_fwrite (p, n, m, s)
/* Write the word (int) W to STREAM. */
int
diff --git a/libc/stdio-common/scanf.c b/libc/stdio-common/scanf.c
index e7ef18dcb..0a8eecf01 100644
--- a/libc/stdio-common/scanf.c
+++ b/libc/stdio-common/scanf.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2002, 2004, 2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +30,7 @@ __scanf (const char *format, ...)
int done;
va_start (arg, format);
- done = INTUSE(_IO_vfscanf) (stdin, format, arg, NULL);
+ done = _IO_vfscanf (stdin, format, arg, NULL);
va_end (arg);
return done;
diff --git a/libc/stdio-common/sprintf.c b/libc/stdio-common/sprintf.c
index 817844a44..00be3bdcc 100644
--- a/libc/stdio-common/sprintf.c
+++ b/libc/stdio-common/sprintf.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991, 1995, 1997, 1998, 2002, 2004, 2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +18,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <libioP.h>
-#define vsprintf(s, f, a) INTUSE(_IO_vsprintf) (s, f, a)
+#define vsprintf(s, f, a) _IO_vsprintf (s, f, a)
/* Write formatted output into S, according to the format string FORMAT. */
/* VARARGS2 */
diff --git a/libc/stdio-common/tmpfile.c b/libc/stdio-common/tmpfile.c
index 113999b18..c6da9acb0 100644
--- a/libc/stdio-common/tmpfile.c
+++ b/libc/stdio-common/tmpfile.c
@@ -1,6 +1,5 @@
/* Open a stdio stream on an anonymous temporary file. Generic/POSIX version.
- Copyright (C) 1991,1993,1996-2000,2002,2003,2007,2009,2011
- Free Software Foundation, Inc.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +21,7 @@
#include <unistd.h>
#include <iolibio.h>
-#define __fdopen INTUSE(_IO_fdopen)
+#define __fdopen _IO_fdopen
#ifndef tmpfile
# define tmpfile __new_tmpfile
#endif
diff --git a/libc/stdio-common/vfprintf.c b/libc/stdio-common/vfprintf.c
index 609bcf994..a76b03acf 100644
--- a/libc/stdio-common/vfprintf.c
+++ b/libc/stdio-common/vfprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2011, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -89,7 +89,7 @@
# define PUT(F, S, N) _IO_sputn ((F), (S), (N))
# define PAD(Padchar) \
if (width > 0) \
- done_add (INTUSE(_IO_padn) (s, (Padchar), width))
+ done_add (_IO_padn (s, (Padchar), width))
# define PUTC(C, F) _IO_putc_unlocked (C, F)
# define ORIENT if (_IO_vtable_offset (s) == 0 && _IO_fwide (s, -1) != -1)\
return -1
@@ -2250,18 +2250,18 @@ _IO_helper_overflow (_IO_FILE *s, int c)
static const struct _IO_jump_t _IO_helper_jumps =
{
JUMP_INIT_DUMMY,
- JUMP_INIT (finish, INTUSE(_IO_wdefault_finish)),
+ JUMP_INIT (finish, _IO_wdefault_finish),
JUMP_INIT (overflow, _IO_helper_overflow),
JUMP_INIT (underflow, _IO_default_underflow),
- JUMP_INIT (uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT (pbackfail, (_IO_pbackfail_t) INTUSE(_IO_wdefault_pbackfail)),
- JUMP_INIT (xsputn, INTUSE(_IO_wdefault_xsputn)),
- JUMP_INIT (xsgetn, INTUSE(_IO_wdefault_xsgetn)),
+ JUMP_INIT (uflow, _IO_default_uflow),
+ JUMP_INIT (pbackfail, (_IO_pbackfail_t) _IO_wdefault_pbackfail),
+ JUMP_INIT (xsputn, _IO_wdefault_xsputn),
+ JUMP_INIT (xsgetn, _IO_wdefault_xsgetn),
JUMP_INIT (seekoff, _IO_default_seekoff),
JUMP_INIT (seekpos, _IO_default_seekpos),
JUMP_INIT (setbuf, _IO_default_setbuf),
JUMP_INIT (sync, _IO_default_sync),
- JUMP_INIT (doallocate, INTUSE(_IO_wdefault_doallocate)),
+ JUMP_INIT (doallocate, _IO_wdefault_doallocate),
JUMP_INIT (read, _IO_default_read),
JUMP_INIT (write, _IO_default_write),
JUMP_INIT (seek, _IO_default_seek),
@@ -2272,18 +2272,18 @@ static const struct _IO_jump_t _IO_helper_jumps =
static const struct _IO_jump_t _IO_helper_jumps =
{
JUMP_INIT_DUMMY,
- JUMP_INIT (finish, INTUSE(_IO_default_finish)),
+ JUMP_INIT (finish, _IO_default_finish),
JUMP_INIT (overflow, _IO_helper_overflow),
JUMP_INIT (underflow, _IO_default_underflow),
- JUMP_INIT (uflow, INTUSE(_IO_default_uflow)),
- JUMP_INIT (pbackfail, INTUSE(_IO_default_pbackfail)),
- JUMP_INIT (xsputn, INTUSE(_IO_default_xsputn)),
- JUMP_INIT (xsgetn, INTUSE(_IO_default_xsgetn)),
+ JUMP_INIT (uflow, _IO_default_uflow),
+ JUMP_INIT (pbackfail, _IO_default_pbackfail),
+ JUMP_INIT (xsputn, _IO_default_xsputn),
+ JUMP_INIT (xsgetn, _IO_default_xsgetn),
JUMP_INIT (seekoff, _IO_default_seekoff),
JUMP_INIT (seekpos, _IO_default_seekpos),
JUMP_INIT (setbuf, _IO_default_setbuf),
JUMP_INIT (sync, _IO_default_sync),
- JUMP_INIT (doallocate, INTUSE(_IO_default_doallocate)),
+ JUMP_INIT (doallocate, _IO_default_doallocate),
JUMP_INIT (read, _IO_default_read),
JUMP_INIT (write, _IO_default_write),
JUMP_INIT (seek, _IO_default_seek),
@@ -2329,7 +2329,7 @@ buffered_vfprintf (register _IO_FILE *s, const CHAR_T *format,
/* Now print to helper instead. */
#ifndef COMPILE_WPRINTF
- result = INTUSE(_IO_vfprintf) (hp, format, args);
+ result = _IO_vfprintf (hp, format, args);
#else
result = vfprintf (hp, format, args);
#endif
@@ -2370,4 +2370,5 @@ ldbl_weak_alias (_IO_vfwprintf, vfwprintf);
ldbl_strong_alias (_IO_vfprintf_internal, vfprintf);
ldbl_hidden_def (_IO_vfprintf_internal, vfprintf)
ldbl_strong_alias (_IO_vfprintf_internal, _IO_vfprintf);
+ldbl_hidden_def (_IO_vfprintf_internal, _IO_vfprintf)
#endif
diff --git a/libc/stdio-common/vfscanf.c b/libc/stdio-common/vfscanf.c
index 555798a53..8720ffa35 100644
--- a/libc/stdio-common/vfscanf.c
+++ b/libc/stdio-common/vfscanf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2007, 2010, 2011, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -78,9 +78,9 @@
#ifdef COMPILE_WSCANF
# define ungetc(c, s) ((void) (c == WEOF \
|| (--read_in, \
- INTUSE(_IO_sputbackwc) (s, c))))
+ _IO_sputbackwc (s, c))))
# define ungetc_not_eof(c, s) ((void) (--read_in, \
- INTUSE(_IO_sputbackwc) (s, c)))
+ _IO_sputbackwc (s, c)))
# define inchar() (c == WEOF ? ((errno = inchar_errno), WEOF) \
: ((c = _IO_getwc_unlocked (s)), \
(void) (c != WEOF \
@@ -110,9 +110,9 @@
#else
# define ungetc(c, s) ((void) ((int) c == EOF \
|| (--read_in, \
- INTUSE(_IO_sputbackc) (s, (unsigned char) c))))
+ _IO_sputbackc (s, (unsigned char) c))))
# define ungetc_not_eof(c, s) ((void) (--read_in, \
- INTUSE(_IO_sputbackc) (s, (unsigned char) c)))
+ _IO_sputbackc (s, (unsigned char) c)))
# define inchar() (c == EOF ? ((errno = inchar_errno), EOF) \
: ((c = _IO_getc_unlocked (s)), \
(void) (c != EOF \
@@ -2978,6 +2978,7 @@ ___vfscanf (FILE *s, const char *format, va_list argptr)
return _IO_vfscanf_internal (s, format, argptr, NULL);
}
ldbl_strong_alias (_IO_vfscanf_internal, _IO_vfscanf)
+ldbl_hidden_def (_IO_vfscanf_internal, _IO_vfscanf)
ldbl_strong_alias (___vfscanf, __vfscanf)
ldbl_hidden_def (___vfscanf, __vfscanf)
ldbl_weak_alias (___vfscanf, vfscanf)
diff --git a/libc/stdlib/bug-getcontext.c b/libc/stdlib/bug-getcontext.c
index 745aa1f20..7db49c849 100644
--- a/libc/stdlib/bug-getcontext.c
+++ b/libc/stdlib/bug-getcontext.c
@@ -9,6 +9,9 @@
static int
do_test (void)
{
+#if FE_ALL_EXCEPT == 0
+ printf("Skipping test; no support for FP exceptions.\n");
+#else
int except_mask = FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW;
int status = feenableexcept (except_mask);
@@ -41,6 +44,7 @@ do_test (void)
printf("\nAt end fegetexcept() returned %d, expected: %d.\n",
mask, except_mask);
+#endif
return 0;
}
diff --git a/libc/stdlib/strfmon_l.c b/libc/stdlib/strfmon_l.c
index d3e9d7103..8fb7deccc 100644
--- a/libc/stdlib/strfmon_l.c
+++ b/libc/stdlib/strfmon_l.c
@@ -1,5 +1,5 @@
/* Formatting a monetary value according to the given locale.
- Copyright (C) 1996,1997,2002,2004,2006,2009,2010 Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -515,10 +515,9 @@ __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format,
#ifdef _IO_MTSAFE_IO
f._sbf._f._lock = NULL;
#endif
- INTUSE(_IO_init) (&f._sbf._f, 0);
+ _IO_init (&f._sbf._f, 0);
_IO_JUMPS (&f._sbf) = &_IO_str_jumps;
- INTUSE(_IO_str_init_static) (&f, dest,
- (s + maxsize) - dest, dest);
+ _IO_str_init_static_internal (&f, dest, (s + maxsize) - dest, dest);
/* We clear the last available byte so we can find out whether
the numeric representation is too long. */
s[maxsize - 1] = '\0';
diff --git a/libc/string/argz-count.c b/libc/string/argz-count.c
index 723e9f207..b6baf8d25 100644
--- a/libc/string/argz-count.c
+++ b/libc/string/argz-count.c
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -34,5 +34,5 @@ __argz_count (const char *argz, size_t len)
}
return count;
}
-INTDEF(__argz_count)
+libc_hidden_def (__argz_count)
weak_alias (__argz_count, argz_count)
diff --git a/libc/string/argz-stringify.c b/libc/string/argz-stringify.c
index 7ff8f6bf8..5b8582ecd 100644
--- a/libc/string/argz-stringify.c
+++ b/libc/string/argz-stringify.c
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995,96,97,2000,2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.org>
@@ -36,5 +36,5 @@ __argz_stringify (char *argz, size_t len, int sep)
*argz++ = sep;
}
}
-INTDEF(__argz_stringify)
+libc_hidden_def (__argz_stringify)
weak_alias (__argz_stringify, argz_stringify)
diff --git a/libc/sunrpc/Makefile b/libc/sunrpc/Makefile
index cc8132095..a6dba28ad 100644
--- a/libc/sunrpc/Makefile
+++ b/libc/sunrpc/Makefile
@@ -102,7 +102,7 @@ install-bin-$(OPTION_EGLIBC_SUNRPC) += rpcgen
rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
rpc_scan.o rpc_util.o rpc_svcout.o rpc_clntout.o \
rpc_tblout.o rpc_sample.o
-extra-objs-$(OPTION_EGLIBC_SUNRPC) += $(rpcgen-objs)
+extra-objs-$(OPTION_EGLIBC_SUNRPC) = $(rpcgen-objs) $(addprefix cross-,$(rpcgen-objs))
others-$(OPTION_EGLIBC_SUNRPC) += rpcgen
all: # Make this the default target; it will be defined in Rules.
@@ -171,15 +171,13 @@ $(objpfx)tst-xdrmem2: $(common-objpfx)linkobj/libc.so
$(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs))
cross-rpcgen-objs := $(addprefix $(objpfx)cross-,$(rpcgen-objs))
-extra-objs += $(cross-rpcgen-objs)
# When generic makefile support for build system programs is
# available, it should replace this code. See
# <http://sourceware.org/bugzilla/show_bug.cgi?id=14087>.
-$(cross-rpcgen-objs): $(objpfx)cross-%.o: %.c
- $(make-target-directory)
+$(cross-rpcgen-objs): $(objpfx)cross-%.o: %.c $(before-compile)
$(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) $< \
- $(OUTPUT_OPTION) $(compile-mkdep-flags) -c
+ $(OUTPUT_OPTION) $(native-compile-mkdep-flags) -c
$(objpfx)cross-rpcgen: $(cross-rpcgen-objs)
$(BUILD_CC) $^ $(BUILD_LDFLAGS) -o $@
diff --git a/libc/sunrpc/openchild.c b/libc/sunrpc/openchild.c
index 541a223bc..29f274a8a 100644
--- a/libc/sunrpc/openchild.c
+++ b/libc/sunrpc/openchild.c
@@ -42,8 +42,8 @@
#include <rpc/clnt.h>
#include <libio/iolibio.h>
-#define fflush(s) INTUSE(_IO_fflush) (s)
-#define __fdopen(fd,m) INTUSE(_IO_fdopen) (fd,m)
+#define fflush(s) _IO_fflush (s)
+#define __fdopen(fd,m) _IO_fdopen (fd,m)
/*
* returns pid, or -1 for failure
diff --git a/libc/sunrpc/svc_simple.c b/libc/sunrpc/svc_simple.c
index b8ba4ab38..baa177eec 100644
--- a/libc/sunrpc/svc_simple.c
+++ b/libc/sunrpc/svc_simple.c
@@ -43,6 +43,7 @@
#include <wchar.h>
#include <libio/iolibio.h>
+#include <shlib-compat.h>
struct proglst_
{
@@ -121,7 +122,9 @@ __registerrpc (u_long prognum, u_long versnum, u_long procnum,
free (buf);
return -1;
}
-compat_symbol (libc, __registerrpc, registerrpc, GLIBC_2_0);
+
+libc_sunrpc_symbol (__registerrpc, registerrpc, GLIBC_2_0)
+
static void
universal (struct svc_req *rqstp, SVCXPRT *transp_l)
diff --git a/libc/sunrpc/xcrypt.c b/libc/sunrpc/xcrypt.c
index 2e53f2d9e..da7c4e66b 100644
--- a/libc/sunrpc/xcrypt.c
+++ b/libc/sunrpc/xcrypt.c
@@ -47,6 +47,7 @@ static char sccsid[] = "@(#)xcrypt.c 1.3 89/03/24 Copyr 1986 Sun Micro";
#include <string.h>
#include <sys/types.h>
#include <rpc/des_crypt.h>
+#include <shlib-compat.h>
static const char hex[16] =
{
@@ -89,7 +90,7 @@ passwd2des_internal (char *pw, char *key)
#ifdef _LIBC
libc_hidden_def (passwd2des_internal)
-compat_symbol (libc, passwd2des_internal, passwd2des, GLIBC_2_1);
+libc_sunrpc_symbol(passwd2des_internal, passwd2des, GLIBC_2_1)
#else
void passwd2des (char *pw, char *key)
{
diff --git a/libc/sunrpc/xdr_stdio.c b/libc/sunrpc/xdr_stdio.c
index 667515e0a..faa646d29 100644
--- a/libc/sunrpc/xdr_stdio.c
+++ b/libc/sunrpc/xdr_stdio.c
@@ -40,10 +40,10 @@
#include <rpc/xdr.h>
#include <libio/iolibio.h>
-#define fflush(s) INTUSE(_IO_fflush) (s)
-#define fread(p, m, n, s) INTUSE(_IO_fread) (p, m, n, s)
-#define ftell(s) INTUSE(_IO_ftell) (s)
-#define fwrite(p, m, n, s) INTUSE(_IO_fwrite) (p, m, n, s)
+#define fflush(s) _IO_fflush (s)
+#define fread(p, m, n, s) _IO_fread (p, m, n, s)
+#define ftell(s) _IO_ftell (s)
+#define fwrite(p, m, n, s) _IO_fwrite (p, m, n, s)
static bool_t xdrstdio_getlong (XDR *, long *);
static bool_t xdrstdio_putlong (XDR *, const long *);
diff --git a/libc/sysdeps/generic/bits/hwcap.h b/libc/sysdeps/generic/bits/hwcap.h
new file mode 100644
index 000000000..b27d2febb
--- /dev/null
+++ b/libc/sysdeps/generic/bits/hwcap.h
@@ -0,0 +1,23 @@
+/* Defines for bits in AT_HWCAP.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_AUXV_H
+# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
+#endif
+
+/* No bits defined for this architecture. */
diff --git a/libc/sysdeps/generic/ldsodefs.h b/libc/sysdeps/generic/ldsodefs.h
index 16bcfd10c..40fdf3c27 100644
--- a/libc/sysdeps/generic/ldsodefs.h
+++ b/libc/sysdeps/generic/ldsodefs.h
@@ -605,6 +605,9 @@ struct rtld_global_ro
/* Mask for important hardware capabilities we honour. */
EXTERN uint64_t _dl_hwcap_mask;
+ /* Pointer to the auxv list supplied to the program at startup. */
+ EXTERN ElfW(auxv_t) *_dl_auxv;
+
/* Get architecture specific definitions. */
#define PROCINFO_DECL
#ifndef PROCINFO_CLASS
diff --git a/libc/sysdeps/generic/stackguard-macros.h b/libc/sysdeps/generic/stackguard-macros.h
new file mode 100644
index 000000000..ababf65d3
--- /dev/null
+++ b/libc/sysdeps/generic/stackguard-macros.h
@@ -0,0 +1,4 @@
+#include <stdint.h>
+
+extern uintptr_t __stack_chk_guard;
+#define STACK_CHK_GUARD __stack_chk_guard
diff --git a/libc/sysdeps/gnu/bits/utmp.h b/libc/sysdeps/gnu/bits/utmp.h
index c13380ab8..aed2750bb 100644
--- a/libc/sysdeps/gnu/bits/utmp.h
+++ b/libc/sysdeps/gnu/bits/utmp.h
@@ -1,6 +1,5 @@
/* The `struct utmp' type, describing entries in the utmp file. GNU version.
- Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,7 +35,7 @@
previous logins. */
struct lastlog
{
-#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+#ifdef __WORDSIZE_TIME64_COMPAT32
int32_t ll_time;
#else
__time_t ll_time;
@@ -69,7 +68,7 @@ struct utmp
/* The ut_session and ut_tv fields must be the same size when compiled
32- and 64-bit. This allows data files and shared memory to be
shared between 32- and 64-bit applications. */
-#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+#ifdef __WORDSIZE_TIME64_COMPAT32
int32_t ut_session; /* Session ID, used for windowing. */
struct
{
diff --git a/libc/sysdeps/gnu/bits/utmpx.h b/libc/sysdeps/gnu/bits/utmpx.h
index 87626f085..f8716ca12 100644
--- a/libc/sysdeps/gnu/bits/utmpx.h
+++ b/libc/sysdeps/gnu/bits/utmpx.h
@@ -1,5 +1,5 @@
/* Structures and definitions for the user accounting database. GNU version.
- Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,7 +66,7 @@ struct utmpx
/* The fields ut_session and ut_tv must be the same size when compiled
32- and 64-bit. This allows files and shared memory to be shared
between 32- and 64-bit applications. */
-#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+#ifdef __WORDSIZE_TIME64_COMPAT32
__int32_t ut_session; /* Session ID, used for windowing. */
struct
{
diff --git a/libc/sysdeps/i386/__longjmp.S b/libc/sysdeps/i386/__longjmp.S
index 264eb7e0d..74c8347d8 100644
--- a/libc/sysdeps/i386/__longjmp.S
+++ b/libc/sysdeps/i386/__longjmp.S
@@ -1,6 +1,5 @@
/* longjmp for i386.
- Copyright (C) 1995-1998,2000,2002,2005,2006,2009
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +19,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
.text
ENTRY (__longjmp)
@@ -32,6 +32,7 @@ ENTRY (__longjmp)
movl (JB_SP*4)(%eax), %ecx
PTR_DEMANGLE (%edx)
PTR_DEMANGLE (%ecx)
+ LIBC_PROBE (longjmp, 3, 4@%eax, -4@8(%esp), 4@%edx)
cfi_def_cfa(%eax, 0)
cfi_register(%eip, %edx)
cfi_register(%esp, %ecx)
@@ -49,6 +50,7 @@ ENTRY (__longjmp)
cfi_restore(%edi)
cfi_restore(%ebp)
+ LIBC_PROBE (longjmp_target, 3, 4@%eax, -4@8(%esp), 4@%edx)
movl 8(%esp), %eax /* Second argument is return value. */
movl %ecx, %esp
#else
@@ -56,12 +58,14 @@ ENTRY (__longjmp)
movl 8(%esp), %eax /* Second argument is return value. */
/* Save the return address now. */
movl (JB_PC*4)(%ecx), %edx
+ LIBC_PROBE (longjmp, 3, 4@%ecx, -4@%eax, 4@%edx)
/* Restore registers. */
movl (JB_BX*4)(%ecx), %ebx
movl (JB_SI*4)(%ecx), %esi
movl (JB_DI*4)(%ecx), %edi
movl (JB_BP*4)(%ecx), %ebp
movl (JB_SP*4)(%ecx), %esp
+ LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%ecx, 4@%edx)
#endif
/* Jump to saved PC. */
jmp *%edx
diff --git a/libc/sysdeps/i386/bsd-_setjmp.S b/libc/sysdeps/i386/bsd-_setjmp.S
index 549aefa18..8a5d0d862 100644
--- a/libc/sysdeps/i386/bsd-_setjmp.S
+++ b/libc/sysdeps/i386/bsd-_setjmp.S
@@ -1,5 +1,5 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. i386 version.
- Copyright (C) 1994-1997,2000-2002,2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1994-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
#include <jmpbuf-offsets.h>
#include "bp-sym.h"
#include "bp-asm.h"
+#include <stap-probe.h>
#define PARMS LINKAGE /* no space for saved regs */
#define JMPBUF PARMS
@@ -46,6 +47,7 @@ ENTRY (BP_SYM (_setjmp))
#endif
movl %ecx, (JB_SP*4)(%edx)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, 4@%edx, -4@$0, 4@%ecx)
#ifdef PTR_MANGLE
PTR_MANGLE (%ecx)
#endif
diff --git a/libc/sysdeps/i386/bsd-setjmp.S b/libc/sysdeps/i386/bsd-setjmp.S
index 447fd7d12..d3a284ef2 100644
--- a/libc/sysdeps/i386/bsd-setjmp.S
+++ b/libc/sysdeps/i386/bsd-setjmp.S
@@ -1,5 +1,5 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. i386 version.
- Copyright (C) 1994-1997,2000,2001,2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1994-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
#include <jmpbuf-offsets.h>
#include "bp-sym.h"
#include "bp-asm.h"
+#include <stap-probe.h>
#define PARMS LINKAGE /* no space for saved regs */
#define JMPBUF PARMS
@@ -48,6 +49,7 @@ ENTRY (BP_SYM (setjmp))
#endif
movl %ecx, (JB_SP*4)(%eax)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, 4@%eax, -4@$1, 4@%ecx)
#ifdef PTR_MANGLE
PTR_MANGLE (%ecx)
#endif
diff --git a/libc/sysdeps/i386/dl-machine.h b/libc/sysdeps/i386/dl-machine.h
index e20a961f9..33847f0ff 100644
--- a/libc/sysdeps/i386/dl-machine.h
+++ b/libc/sysdeps/i386/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. i386 version.
- Copyright (C) 1995-2005, 2006, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -333,7 +333,9 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
else
# endif /* !RTLD_BOOTSTRAP and have no -z combreloc */
{
+# ifndef RTLD_BOOTSTRAP
const Elf32_Sym *const refsym = sym;
+# endif
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
diff --git a/libc/sysdeps/i386/fpu/bits/mathinline.h b/libc/sysdeps/i386/fpu/bits/mathinline.h
index 6561ebaa3..2a7e96ba3 100644
--- a/libc/sysdeps/i386/fpu/bits/mathinline.h
+++ b/libc/sysdeps/i386/fpu/bits/mathinline.h
@@ -290,35 +290,8 @@ __NTH (__signbitl (long double __x))
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
/* Miscellaneous functions */
-__inline_mathcode (__sgn, __x, \
- return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0))
-
/* __FAST_MATH__ is defined by gcc -ffast-math. */
#ifdef __FAST_MATH__
-__inline_mathcode (__pow2, __x, \
- register long double __value; \
- register long double __exponent; \
- __extension__ long long int __p = (long long int) __x; \
- if (__x == (long double) __p) \
- { \
- __asm __volatile__ \
- ("fscale" \
- : "=t" (__value) : "0" (1.0), "u" (__x)); \
- return __value; \
- } \
- __asm __volatile__ \
- ("fld %%st(0)\n\t" \
- "frndint # int(x)\n\t" \
- "fxch\n\t" \
- "fsub %%st(1) # fract(x)\n\t" \
- "f2xm1 # 2^(fract(x)) - 1\n\t" \
- : "=t" (__value), "=u" (__exponent) : "0" (__x)); \
- __value += 1.0; \
- __asm __volatile__ \
- ("fscale" \
- : "=t" (__value) : "0" (__value), "u" (__exponent)); \
- return __value)
-
# ifdef __USE_GNU
# define __sincos_code \
register long double __cosr; \
@@ -733,16 +706,6 @@ __NTH (__finite (double __x))
| 0x800fffffu) + 1) >> 31));
}
-/* Miscellaneous functions */
-# ifdef __FAST_MATH__
-__inline_mathcode (__coshm1, __x, \
- register long double __exm1 = __expm1l (__fabsl (__x)); \
- return 0.5 * (__exm1 / (__exm1 + 1.0)) * __exm1)
-
-__inline_mathcode (__acosh1p, __x, \
- return log1pl (__x + __libc_sqrtl (__x) * __libc_sqrtl (__x + 2.0)))
-
-# endif /* __FAST_MATH__ */
#endif /* __USE_MISC */
/* Undefine some of the large macros which are not used anymore. */
diff --git a/libc/sysdeps/i386/fpu/libm-test-ulps b/libc/sysdeps/i386/fpu/libm-test-ulps
index cdc26a0c6..38a69e670 100644
--- a/libc/sysdeps/i386/fpu/libm-test-ulps
+++ b/libc/sysdeps/i386/fpu/libm-test-ulps
@@ -576,6 +576,33 @@ ildouble: 1
ldouble: 1
# ccos
+Test "Real part of: ccos (-0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (-0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: ccos (-0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccos (-0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: ccos (-0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (-0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: ccos (-0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccos (-0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
+float: 1
+ifloat: 1
Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
float: 1
ifloat: 1
@@ -583,12 +610,41 @@ ildouble: 1
ldouble: 1
Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
ildouble: 1
ldouble: 1
+Test "Real part of: ccos (0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: ccos (0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccos (0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: ccos (0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: ccos (0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccos (0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccos (0x1p-1074 + 1440 i) == inf - 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
# ccosh
Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
@@ -598,6 +654,30 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: ccosh (-710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (-710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: ccosh (-710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (-710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: ccosh (-89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccosh (-89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: ccosh (-89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccosh (-89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
double: 1
float: 1
@@ -608,6 +688,33 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Imaginary part of: ccosh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
+Test "Real part of: ccosh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: ccosh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: ccosh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccosh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: ccosh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccosh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
# cexp
Test "Real part of: cexp (-10000 + 0x1p16383 i) == 1.045876464564882298442774542991176546722e-4343 + 4.421154026488516836023811173959413420548e-4344 i":
@@ -646,7 +753,7 @@ ldouble: 1
Test "Imaginary part of: cexp (11356.5625 + 0.75 i) == 9.052188470850960144814815984311663764287e4931 + 8.432986734191301036267148978260970230200e4931 i":
ildouble: 1
ldouble: 1
-Test "Imaginary part of: cexp (1440 + 0x1p-1074 i) == inf + 1.196295853897226111293303155636183216483e302 i plus overflow exception":
+Test "Imaginary part of: cexp (1440 + 0x1p-1074 i) == inf + 1.196295853897226111293303155636183216483e302 i":
double: 1
idouble: 1
Test "Real part of: cexp (50 + 0x1p127 i) == 4.053997150228616856622417636046265337193e21 + 3.232070315463388524466674772633810238819e21 i":
@@ -1130,6 +1237,30 @@ ildouble: 1
ldouble: 1
# csin
+Test "Real part of: csin (-0.75 + 710.5 i) == -1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csin (-0.75 + 710.5 i) == -1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (-0.75 + 89.5 i) == -2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csin (-0.75 + 89.5 i) == -2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: csin (-0.75 - 710.5 i) == -1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csin (-0.75 - 710.5 i) == -1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (-0.75 - 89.5 i) == -2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csin (-0.75 - 89.5 i) == -2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
float: 1
ifloat: 1
@@ -1141,6 +1272,33 @@ ldouble: 1
Test "Imaginary part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
float: 1
ifloat: 1
+Test "Real part of: csin (0.75 + 710.5 i) == 1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csin (0.75 + 710.5 i) == 1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (0.75 + 89.5 i) == 2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csin (0.75 + 89.5 i) == 2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: csin (0.75 - 710.5 i) == 1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csin (0.75 - 710.5 i) == 1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (0.75 - 89.5 i) == 2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csin (0.75 - 89.5 i) == 2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: csin (0x1p-1074 + 1440 i) == 5.981479269486130556466515778180916082415e301 + inf i":
+double: 1
+idouble: 1
# csinh
Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
@@ -1153,6 +1311,30 @@ idouble: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Real part of: csinh (-710.5 + 0.75 i) == -1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (-710.5 + 0.75 i) == -1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csinh (-710.5 - 0.75 i) == -1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (-710.5 - 0.75 i) == -1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csinh (-89.5 + 0.75 i) == -2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csinh (-89.5 + 0.75 i) == -2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: csinh (-89.5 - 0.75 i) == -2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csinh (-89.5 - 0.75 i) == -2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
double: 1
float: 1
@@ -1163,6 +1345,33 @@ ldouble: 1
Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
float: 1
ifloat: 1
+Test "Imaginary part of: csinh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
+Test "Real part of: csinh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csinh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csinh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csinh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: csinh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csinh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
# csqrt
Test "Imaginary part of: csqrt (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 1.379778091031440685006200821918878702861e+154 + 3.257214233483129514781233066898042490248e+153 i":
@@ -2474,12 +2683,16 @@ ldouble: 1
Function: Real part of "ccos":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "ccos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2616,13 +2829,17 @@ ildouble: 4
ldouble: 4
Function: Real part of "csin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "csin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Function: Real part of "csinh":
diff --git a/libc/sysdeps/i386/i686/fpu/multiarch/Makefile b/libc/sysdeps/i386/i686/fpu/multiarch/Makefile
new file mode 100644
index 000000000..1de37fe4a
--- /dev/null
+++ b/libc/sysdeps/i386/i686/fpu/multiarch/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),math)
+libm-sysdep_routines += e_expf-sse2 e_expf-ia32
+endif
diff --git a/libc/sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S b/libc/sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S
new file mode 100644
index 000000000..f16c2ef7a
--- /dev/null
+++ b/libc/sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S
@@ -0,0 +1,22 @@
+/*
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define __ieee754_expf __ieee754_expf_ia32
+#define __expf_finite __expf_finite_ia32
+
+#include <sysdeps/i386/fpu/e_expf.S>
diff --git a/libc/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S b/libc/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S
new file mode 100644
index 000000000..31cdffdb0
--- /dev/null
+++ b/libc/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S
@@ -0,0 +1,324 @@
+/* SSE2 version of __ieee754_expf and __expf_finite
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+
+#include <sysdep.h>
+
+/* Short algorithm description:
+ *
+ * Let K = 64 (table size).
+ * e^x = 2^(x/log(2)) = 2^n * T[j] * (1 + P(y))
+ * where
+ * x = m*log(2)/K + y, y in [0.0..log(2)/K]
+ * m = n*K + j, m,n,j - signed integer, j in [0..K-1]
+ * values of 2^(j/K) are tabulated as T[j].
+ *
+ * P(y) is a minimax polynomial approximation of expf(x)-1
+ * on small interval [0.0..log(2)/K].
+ *
+ * P(y) = P3*y*y*y*y + P2*y*y*y + P1*y*y + P0*y, calculated as
+ * z = y*y; P(y) = (P3*z + P1)*z + (P2*z + P0)*y
+ *
+ * Special cases:
+ * __ieee754_expf_sse2(NaN) = NaN
+ * __ieee754_expf_sse2(+INF) = +INF
+ * __ieee754_expf_sse2(-INF) = 0
+ * __ieee754_expf_sse2(x) = 1 for subnormals
+ * for finite argument, only __ieee754_expf_sse2(0)=1 is exact
+ * __ieee754_expf_sse2(x) overflows if x>700
+ * __ieee754_expf_sse2(x) underflows if x<-700
+ *
+ * Note:
+ * For |x|<700, __ieee754_expf_sse2 computes result in double precision,
+ * with accuracy a bit more than needed for expf, and does not round it
+ * to single precision.
+ */
+
+
+#ifdef PIC
+# define MO1(symbol) L(symbol)##@GOTOFF(%edx)
+# define MO2(symbol,reg2,_scale) L(symbol)##@GOTOFF(%edx,reg2,_scale)
+#else
+# define MO1(symbol) L(symbol)
+# define MO2(symbol,reg2,_scale) L(symbol)(,reg2,_scale)
+#endif
+
+ .text
+ENTRY(__ieee754_expf_sse2)
+ /* Input: single precision x on stack at address 4(%esp) */
+
+#ifdef PIC
+ LOAD_PIC_REG(dx)
+#endif
+
+ cvtss2sd 4(%esp), %xmm1 /* Convert x to double precision */
+ mov 4(%esp), %ecx /* Copy x */
+ movsd MO1(DP_KLN2), %xmm2 /* DP K/log(2) */
+ movsd MO1(DP_P2), %xmm3 /* DP P2 */
+ movl %ecx, %eax /* x */
+ mulsd %xmm1, %xmm2 /* DP x*K/log(2) */
+ andl $0x7fffffff, %ecx /* |x| */
+ cmpl $0x442f0000, %ecx /* |x|<700 ? */
+ movsd MO1(DP_P3), %xmm4 /* DP P3 */
+ addsd MO1(DP_RS), %xmm2 /* DP x*K/log(2)+RS */
+ jae L(special_paths)
+
+ /* Here if |x|<700 */
+ cmpl $0x31800000, %ecx /* |x|<2^(-28) ? */
+ jb L(small_arg)
+
+ /* Main path: here if 2^(-28)<=|x|<700 */
+ cvtsd2ss %xmm2, %xmm2 /* SP x*K/log(2)+RS */
+ movd %xmm2, %eax /* bits of n*K+j with trash */
+ subss MO1(SP_RS), %xmm2 /* SP t=round(x*K/log(2)) */
+ movl %eax, %ecx /* n*K+j with trash */
+ cvtss2sd %xmm2, %xmm2 /* DP t */
+ andl $0x3f, %eax /* bits of j */
+ mulsd MO1(DP_NLN2K), %xmm2 /* DP -t*log(2)/K */
+ andl $0xffffffc0, %ecx /* bits of n */
+#ifdef __AVX__
+ vaddsd %xmm1, %xmm2, %xmm0 /* DP y=x-t*log(2)/K */
+ vmulsd %xmm0, %xmm0, %xmm2 /* DP z=y*y */
+#else
+ addsd %xmm1, %xmm2 /* DP y=x-t*log(2)/K */
+ movaps %xmm2, %xmm0 /* DP y */
+ mulsd %xmm2, %xmm2 /* DP z=y*y */
+#endif
+ mulsd %xmm2, %xmm4 /* DP P3*z */
+ addl $0xffc0, %ecx /* bits of n + DP exponent bias */
+ mulsd %xmm2, %xmm3 /* DP P2*z */
+ shrl $2, %ecx /* High 2 bytes of DP 2^n */
+ pxor %xmm1, %xmm1 /* clear %xmm1 */
+ addsd MO1(DP_P1), %xmm4 /* DP P3*z+P1 */
+ addsd MO1(DP_P0), %xmm3 /* DP P2*z+P0 */
+ pinsrw $3, %ecx, %xmm1 /* DP 2^n */
+ mulsd %xmm2, %xmm4 /* DP (P3*z+P1)*z */
+ mulsd %xmm3, %xmm0 /* DP (P2*z+P0)*y */
+ addsd %xmm4, %xmm0 /* DP P(y) */
+ mulsd MO2(DP_T,%eax,8), %xmm0 /* DP P(y)*T[j] */
+ addsd MO2(DP_T,%eax,8), %xmm0 /* DP T[j]*(P(y)+1) */
+ mulsd %xmm1, %xmm0 /* DP result=2^n*(T[j]*(P(y)+1)) */
+
+ lea -8(%esp), %esp /* Borrow 8 bytes of stack frame */
+ movsd %xmm0, 0(%esp) /* Move result from sse... */
+ fldl 0(%esp) /* ...to FPU. */
+ lea 8(%esp), %esp /* Return back 8 bytes of stack frame */
+ ret
+
+ .p2align 4
+L(small_arg):
+ /* Here if 0<=|x|<2^(-28) */
+ movss 4(%esp), %xmm0 /* load x */
+ addss MO1(SP_ONE), %xmm0 /* 1.0 + x */
+ /* Return 1.0 with inexact raised, except for x==0 */
+ jmp L(epilogue)
+
+ .p2align 4
+L(special_paths):
+ /* Here if x is NaN, or Inf, or finite |x|>=700 */
+ movss 4(%esp), %xmm0 /* load x */
+
+ cmpl $0x7f800000, %ecx /* |x| is finite ? */
+ jae L(arg_inf_or_nan)
+
+ /* Here if finite |x|>=700 */
+ testl $0x80000000, %eax /* sign of x nonzero ? */
+ je L(res_overflow)
+
+ /* Here if finite x<=-700 */
+ movss MO1(SP_SMALL), %xmm0 /* load small value 2^(-100) */
+ mulss %xmm0, %xmm0 /* Return underflowed result (zero or subnormal) */
+ jmp L(epilogue)
+
+ .p2align 4
+L(res_overflow):
+ /* Here if finite x>=700 */
+ movss MO1(SP_LARGE), %xmm0 /* load large value 2^100 */
+ mulss %xmm0, %xmm0 /* Return overflowed result (Inf or max normal) */
+ jmp L(epilogue)
+
+ .p2align 4
+L(arg_inf_or_nan):
+ /* Here if |x| is Inf or NAN */
+ jne L(arg_nan) /* |x| is Inf ? */
+
+ /* Here if |x| is Inf */
+ shrl $31, %eax /* Get sign bit of x */
+ movss MO2(SP_INF_0,%eax,4), %xmm0/* return zero or Inf, depending on sign of x */
+ jmp L(epilogue)
+
+ .p2align 4
+L(arg_nan):
+ /* Here if |x| is NaN */
+ addss %xmm0, %xmm0 /* Return x+x (raise invalid) */
+
+ .p2align 4
+L(epilogue):
+ lea -4(%esp), %esp /* Borrow 4 bytes of stack frame */
+ movss %xmm0, 0(%esp) /* Move result from sse... */
+ flds 0(%esp) /* ...to FPU. */
+ lea 4(%esp), %esp /* Return back 4 bytes of stack frame */
+ ret
+END(__ieee754_expf_sse2)
+
+ .section .rodata, "a"
+ .p2align 3
+L(DP_T): /* table of double precision values 2^(j/K) for j=[0..K-1] */
+ .long 0x00000000, 0x3ff00000
+ .long 0x3e778061, 0x3ff02c9a
+ .long 0xd3158574, 0x3ff059b0
+ .long 0x18759bc8, 0x3ff08745
+ .long 0x6cf9890f, 0x3ff0b558
+ .long 0x32d3d1a2, 0x3ff0e3ec
+ .long 0xd0125b51, 0x3ff11301
+ .long 0xaea92de0, 0x3ff1429a
+ .long 0x3c7d517b, 0x3ff172b8
+ .long 0xeb6fcb75, 0x3ff1a35b
+ .long 0x3168b9aa, 0x3ff1d487
+ .long 0x88628cd6, 0x3ff2063b
+ .long 0x6e756238, 0x3ff2387a
+ .long 0x65e27cdd, 0x3ff26b45
+ .long 0xf51fdee1, 0x3ff29e9d
+ .long 0xa6e4030b, 0x3ff2d285
+ .long 0x0a31b715, 0x3ff306fe
+ .long 0xb26416ff, 0x3ff33c08
+ .long 0x373aa9cb, 0x3ff371a7
+ .long 0x34e59ff7, 0x3ff3a7db
+ .long 0x4c123422, 0x3ff3dea6
+ .long 0x21f72e2a, 0x3ff4160a
+ .long 0x6061892d, 0x3ff44e08
+ .long 0xb5c13cd0, 0x3ff486a2
+ .long 0xd5362a27, 0x3ff4bfda
+ .long 0x769d2ca7, 0x3ff4f9b2
+ .long 0x569d4f82, 0x3ff5342b
+ .long 0x36b527da, 0x3ff56f47
+ .long 0xdd485429, 0x3ff5ab07
+ .long 0x15ad2148, 0x3ff5e76f
+ .long 0xb03a5585, 0x3ff6247e
+ .long 0x82552225, 0x3ff66238
+ .long 0x667f3bcd, 0x3ff6a09e
+ .long 0x3c651a2f, 0x3ff6dfb2
+ .long 0xe8ec5f74, 0x3ff71f75
+ .long 0x564267c9, 0x3ff75feb
+ .long 0x73eb0187, 0x3ff7a114
+ .long 0x36cf4e62, 0x3ff7e2f3
+ .long 0x994cce13, 0x3ff82589
+ .long 0x9b4492ed, 0x3ff868d9
+ .long 0x422aa0db, 0x3ff8ace5
+ .long 0x99157736, 0x3ff8f1ae
+ .long 0xb0cdc5e5, 0x3ff93737
+ .long 0x9fde4e50, 0x3ff97d82
+ .long 0x82a3f090, 0x3ff9c491
+ .long 0x7b5de565, 0x3ffa0c66
+ .long 0xb23e255d, 0x3ffa5503
+ .long 0x5579fdbf, 0x3ffa9e6b
+ .long 0x995ad3ad, 0x3ffae89f
+ .long 0xb84f15fb, 0x3ffb33a2
+ .long 0xf2fb5e47, 0x3ffb7f76
+ .long 0x904bc1d2, 0x3ffbcc1e
+ .long 0xdd85529c, 0x3ffc199b
+ .long 0x2e57d14b, 0x3ffc67f1
+ .long 0xdcef9069, 0x3ffcb720
+ .long 0x4a07897c, 0x3ffd072d
+ .long 0xdcfba487, 0x3ffd5818
+ .long 0x03db3285, 0x3ffda9e6
+ .long 0x337b9b5f, 0x3ffdfc97
+ .long 0xe78b3ff6, 0x3ffe502e
+ .long 0xa2a490da, 0x3ffea4af
+ .long 0xee615a27, 0x3ffefa1b
+ .long 0x5b6e4540, 0x3fff5076
+ .long 0x819e90d8, 0x3fffa7c1
+ ASM_TYPE_DIRECTIVE(L(DP_T), @object)
+ ASM_SIZE_DIRECTIVE(L(DP_T))
+
+ .section .rodata.cst8,"aM",@progbits,8
+ .p2align 3
+L(DP_KLN2): /* double precision K/log(2) */
+ .long 0x652b82fe, 0x40571547
+ ASM_TYPE_DIRECTIVE(L(DP_KLN2), @object)
+ ASM_SIZE_DIRECTIVE(L(DP_KLN2))
+
+ .p2align 3
+L(DP_NLN2K): /* double precision -log(2)/K */
+ .long 0xfefa39ef, 0xbf862e42
+ ASM_TYPE_DIRECTIVE(L(DP_NLN2K), @object)
+ ASM_SIZE_DIRECTIVE(L(DP_NLN2K))
+
+ .p2align 3
+L(DP_RS): /* double precision 2^23+2^22 */
+ .long 0x00000000, 0x41680000
+ ASM_TYPE_DIRECTIVE(L(DP_RS), @object)
+ ASM_SIZE_DIRECTIVE(L(DP_RS))
+
+ .p2align 3
+L(DP_P3): /* double precision polynomial coefficient P3 */
+ .long 0xeb78fa85, 0x3fa56420
+ ASM_TYPE_DIRECTIVE(L(DP_P3), @object)
+ ASM_SIZE_DIRECTIVE(L(DP_P3))
+
+ .p2align 3
+L(DP_P1): /* double precision polynomial coefficient P1 */
+ .long 0x008d6118, 0x3fe00000
+ ASM_TYPE_DIRECTIVE(L(DP_P1), @object)
+ ASM_SIZE_DIRECTIVE(L(DP_P1))
+
+ .p2align 3
+L(DP_P2): /* double precision polynomial coefficient P2 */
+ .long 0xda752d4f, 0x3fc55550
+ ASM_TYPE_DIRECTIVE(L(DP_P2), @object)
+ ASM_SIZE_DIRECTIVE(L(DP_P2))
+
+ .p2align 3
+L(DP_P0): /* double precision polynomial coefficient P0 */
+ .long 0xffffe7c6, 0x3fefffff
+ ASM_TYPE_DIRECTIVE(L(DP_P0), @object)
+ ASM_SIZE_DIRECTIVE(L(DP_P0))
+
+ .p2align 2
+L(SP_INF_0):
+ .long 0x7f800000 /* single precision Inf */
+ .long 0 /* single precision zero */
+ ASM_TYPE_DIRECTIVE(L(SP_INF_0), @object)
+ ASM_SIZE_DIRECTIVE(L(SP_INF_0))
+
+ .section .rodata.cst4,"aM",@progbits,4
+ .p2align 2
+L(SP_RS): /* single precision 2^23+2^22 */
+ .long 0x4b400000
+ ASM_TYPE_DIRECTIVE(L(SP_RS), @object)
+ ASM_SIZE_DIRECTIVE(L(SP_RS))
+
+ .p2align 2
+L(SP_SMALL): /* single precision small value 2^(-100) */
+ .long 0x0d800000
+ ASM_TYPE_DIRECTIVE(L(SP_SMALL), @object)
+ ASM_SIZE_DIRECTIVE(L(SP_SMALL))
+
+ .p2align 2
+L(SP_LARGE): /* single precision large value 2^100 */
+ .long 0x71800000
+ ASM_TYPE_DIRECTIVE(L(SP_LARGE), @object)
+ ASM_SIZE_DIRECTIVE(L(SP_LARGE))
+
+ .p2align 2
+L(SP_ONE): /* single precision 1.0 */
+ .long 0x3f800000
+ ASM_TYPE_DIRECTIVE(L(SP_ONE), @object)
+ ASM_SIZE_DIRECTIVE(L(SP_ONE))
+
+strong_alias (__ieee754_expf_sse2, __expf_finite_sse2)
diff --git a/libc/sysdeps/i386/i686/fpu/multiarch/e_expf.c b/libc/sysdeps/i386/i686/fpu/multiarch/e_expf.c
new file mode 100644
index 000000000..65858a311
--- /dev/null
+++ b/libc/sysdeps/i386/i686/fpu/multiarch/e_expf.c
@@ -0,0 +1,15 @@
+#include <init-arch.h>
+
+extern double __ieee754_expf_sse2 (double);
+extern double __ieee754_expf_ia32 (double);
+
+double __ieee754_expf (double);
+libm_ifunc (__ieee754_expf,
+ HAS_SSE2 ? __ieee754_expf_sse2 : __ieee754_expf_ia32);
+
+extern double __expf_finite_sse2 (double);
+extern double __expf_finite_ia32 (double);
+
+double __expf_finite (double);
+libm_ifunc (__expf_finite,
+ HAS_SSE2 ? __expf_finite_sse2 : __expf_finite_ia32);
diff --git a/libc/sysdeps/i386/i686/multiarch/Makefile b/libc/sysdeps/i386/i686/multiarch/Makefile
index b764e5b82..8946bfa58 100644
--- a/libc/sysdeps/i386/i686/multiarch/Makefile
+++ b/libc/sysdeps/i386/i686/multiarch/Makefile
@@ -1,5 +1,6 @@
ifeq ($(subdir),csu)
aux += init-arch
+tests += test-multiarch
gen-as-const-headers += ifunc-defines.sym
endif
diff --git a/libc/sysdeps/i386/i686/multiarch/test-multiarch.c b/libc/sysdeps/i386/i686/multiarch/test-multiarch.c
new file mode 100644
index 000000000..593cfec27
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/test-multiarch.c
@@ -0,0 +1 @@
+#include <sysdeps/x86_64/multiarch/test-multiarch.c>
diff --git a/libc/sysdeps/i386/i686/multiarch/wcschr-c.c b/libc/sysdeps/i386/i686/multiarch/wcschr-c.c
index a63e50e28..c23af2620 100644
--- a/libc/sysdeps/i386/i686/multiarch/wcschr-c.c
+++ b/libc/sysdeps/i386/i686/multiarch/wcschr-c.c
@@ -1,8 +1,14 @@
+#include <wchar.h>
+
#ifndef NOT_IN_libc
-# undef libc_hidden_def
-# define libc_hidden_def(name) \
- __hidden_ver1 (__wcschr_ia32, __GI_wcschr, __wcschr_ia32);
+# ifdef SHARED
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__wcschr_ia32, __GI_wcschr, __wcschr_ia32);
+# endif
# define WCSCHR __wcschr_ia32
#endif
+extern __typeof (wcschr) __wcschr_ia32;
+
#include "wcsmbs/wcschr.c"
diff --git a/libc/sysdeps/i386/setjmp.S b/libc/sysdeps/i386/setjmp.S
index 741674482..bf47f667b 100644
--- a/libc/sysdeps/i386/setjmp.S
+++ b/libc/sysdeps/i386/setjmp.S
@@ -1,6 +1,5 @@
/* setjmp for i386.
- Copyright (C) 1995,1996,1997,2000,2001,2005,2006
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +21,7 @@
#include <asm-syntax.h>
#include "bp-sym.h"
#include "bp-asm.h"
+#include <stap-probe.h>
#define PARMS LINKAGE /* no space for saved regs */
#define JMPBUF PARMS
@@ -43,6 +43,7 @@ ENTRY (BP_SYM (__sigsetjmp))
#endif
movl %ecx, (JB_SP*4)(%eax)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, 4@%eax, -4@SIGMSK(%esp), 4@%ecx)
#ifdef PTR_MANGLE
PTR_MANGLE (%ecx)
#endif
diff --git a/libc/sysdeps/i386/stackguard-macros.h b/libc/sysdeps/i386/stackguard-macros.h
new file mode 100644
index 000000000..8c31e197e
--- /dev/null
+++ b/libc/sysdeps/i386/stackguard-macros.h
@@ -0,0 +1,4 @@
+#include <stdint.h>
+
+#define STACK_CHK_GUARD \
+ ({ uintptr_t x; asm ("movl %%gs:0x14, %0" : "=r" (x)); x; })
diff --git a/libc/sysdeps/ieee754/dbl-64/e_log10.c b/libc/sysdeps/ieee754/dbl-64/e_log10.c
index 9fce93708..ab5069e58 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_log10.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_log10.c
@@ -46,39 +46,40 @@
#include <math.h>
#include <math_private.h>
-static const double
-two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
-ivln10 = 4.34294481903251816668e-01, /* 0x3FDBCB7B, 0x1526E50E */
-log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */
-log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */
-
-static const double zero = 0.0;
+static const double two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */
+static const double ivln10 = 4.34294481903251816668e-01; /* 0x3FDBCB7B, 0x1526E50E */
+static const double log10_2hi = 3.01029995663611771306e-01; /* 0x3FD34413, 0x509F6000 */
+static const double log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */
double
-__ieee754_log10(double x)
+__ieee754_log10 (double x)
{
- double y,z;
- int32_t i,k,hx;
- u_int32_t lx;
+ double y, z;
+ int32_t i, k, hx;
+ u_int32_t lx;
- EXTRACT_WORDS(hx,lx,x);
+ EXTRACT_WORDS (hx, lx, x);
- k=0;
- if (hx < 0x00100000) { /* x < 2**-1022 */
- if (__builtin_expect(((hx&0x7fffffff)|lx)==0, 0))
- return -two54/(x-x); /* log(+-0)=-inf */
- if (__builtin_expect(hx<0, 0))
- return (x-x)/(x-x); /* log(-#) = NaN */
- k -= 54; x *= two54; /* subnormal number, scale up x */
- GET_HIGH_WORD(hx,x);
- }
- if (__builtin_expect(hx >= 0x7ff00000, 0)) return x+x;
- k += (hx>>20)-1023;
- i = ((u_int32_t)k&0x80000000)>>31;
- hx = (hx&0x000fffff)|((0x3ff-i)<<20);
- y = (double)(k+i);
- SET_HIGH_WORD(x,hx);
- z = y*log10_2lo + ivln10*__ieee754_log(x);
- return z+y*log10_2hi;
+ k = 0;
+ if (hx < 0x00100000)
+ { /* x < 2**-1022 */
+ if (__builtin_expect (((hx & 0x7fffffff) | lx) == 0, 0))
+ return -two54 / (x - x); /* log(+-0)=-inf */
+ if (__builtin_expect (hx < 0, 0))
+ return (x - x) / (x - x); /* log(-#) = NaN */
+ k -= 54;
+ x *= two54; /* subnormal number, scale up x */
+ GET_HIGH_WORD (hx, x);
+ }
+ if (__builtin_expect (hx >= 0x7ff00000, 0))
+ return x + x;
+ k += (hx >> 20) - 1023;
+ i = ((u_int32_t) k & 0x80000000) >> 31;
+ hx = (hx & 0x000fffff) | ((0x3ff - i) << 20);
+ y = (double) (k + i);
+ SET_HIGH_WORD (x, hx);
+ z = y * log10_2lo + ivln10 * __ieee754_log (x);
+ return z + y * log10_2hi;
}
+
strong_alias (__ieee754_log10, __log10_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_log2.c b/libc/sysdeps/ieee754/dbl-64/e_log2.c
index 6891ee238..4d5cab0ed 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_log2.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_log2.c
@@ -57,64 +57,72 @@
#include <math.h>
#include <math_private.h>
-static const double
-ln2 = 0.69314718055994530942,
-two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */
-Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */
-Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */
-Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */
-Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */
-Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */
-Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */
-Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */
+static const double ln2 = 0.69314718055994530942;
+static const double two54 = 1.80143985094819840000e+16; /* 43500000 00000000 */
+static const double Lg1 = 6.666666666666735130e-01; /* 3FE55555 55555593 */
+static const double Lg2 = 3.999999999940941908e-01; /* 3FD99999 9997FA04 */
+static const double Lg3 = 2.857142874366239149e-01; /* 3FD24924 94229359 */
+static const double Lg4 = 2.222219843214978396e-01; /* 3FCC71C5 1D8E78AF */
+static const double Lg5 = 1.818357216161805012e-01; /* 3FC74664 96CB03DE */
+static const double Lg6 = 1.531383769920937332e-01; /* 3FC39A09 D078C69F */
+static const double Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */
-static const double zero = 0.0;
+static const double zero = 0.0;
double
-__ieee754_log2(double x)
+__ieee754_log2 (double x)
{
- double hfsq,f,s,z,R,w,t1,t2,dk;
- int32_t k,hx,i,j;
- u_int32_t lx;
+ double hfsq, f, s, z, R, w, t1, t2, dk;
+ int32_t k, hx, i, j;
+ u_int32_t lx;
- EXTRACT_WORDS(hx,lx,x);
+ EXTRACT_WORDS (hx, lx, x);
- k=0;
- if (hx < 0x00100000) { /* x < 2**-1022 */
- if (__builtin_expect(((hx&0x7fffffff)|lx)==0, 0))
- return -two54/(x-x); /* log(+-0)=-inf */
- if (__builtin_expect(hx<0, 0))
- return (x-x)/(x-x); /* log(-#) = NaN */
- k -= 54; x *= two54; /* subnormal number, scale up x */
- GET_HIGH_WORD(hx,x);
- }
- if (__builtin_expect(hx >= 0x7ff00000, 0)) return x+x;
- k += (hx>>20)-1023;
- hx &= 0x000fffff;
- i = (hx+0x95f64)&0x100000;
- SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */
- k += (i>>20);
- dk = (double) k;
- f = x-1.0;
- if((0x000fffff&(2+hx))<3) { /* |f| < 2**-20 */
- if(f==zero) return dk;
- R = f*f*(0.5-0.33333333333333333*f);
- return dk-(R-f)/ln2;
- }
- s = f/(2.0+f);
- z = s*s;
- i = hx-0x6147a;
- w = z*z;
- j = 0x6b851-hx;
- t1= w*(Lg2+w*(Lg4+w*Lg6));
- t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7)));
- i |= j;
- R = t2+t1;
- if(i>0) {
- hfsq=0.5*f*f;
- return dk-((hfsq-(s*(hfsq+R)))-f)/ln2;
- } else {
- return dk-((s*(f-R))-f)/ln2;
- }
+ k = 0;
+ if (hx < 0x00100000)
+ { /* x < 2**-1022 */
+ if (__builtin_expect (((hx & 0x7fffffff) | lx) == 0, 0))
+ return -two54 / (x - x); /* log(+-0)=-inf */
+ if (__builtin_expect (hx < 0, 0))
+ return (x - x) / (x - x); /* log(-#) = NaN */
+ k -= 54;
+ x *= two54; /* subnormal number, scale up x */
+ GET_HIGH_WORD (hx, x);
+ }
+ if (__builtin_expect (hx >= 0x7ff00000, 0))
+ return x + x;
+ k += (hx >> 20) - 1023;
+ hx &= 0x000fffff;
+ i = (hx + 0x95f64) & 0x100000;
+ SET_HIGH_WORD (x, hx | (i ^ 0x3ff00000)); /* normalize x or x/2 */
+ k += (i >> 20);
+ dk = (double) k;
+ f = x - 1.0;
+ if ((0x000fffff & (2 + hx)) < 3)
+ { /* |f| < 2**-20 */
+ if (f == zero)
+ return dk;
+ R = f * f * (0.5 - 0.33333333333333333 * f);
+ return dk - (R - f) / ln2;
+ }
+ s = f / (2.0 + f);
+ z = s * s;
+ i = hx - 0x6147a;
+ w = z * z;
+ j = 0x6b851 - hx;
+ t1 = w * (Lg2 + w * (Lg4 + w * Lg6));
+ t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));
+ i |= j;
+ R = t2 + t1;
+ if (i > 0)
+ {
+ hfsq = 0.5 * f * f;
+ return dk - ((hfsq - (s * (hfsq + R))) - f) / ln2;
+ }
+ else
+ {
+ return dk - ((s * (f - R)) - f) / ln2;
+ }
}
+
strong_alias (__ieee754_log2, __log2_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
new file mode 100644
index 000000000..488a0efae
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
@@ -0,0 +1,86 @@
+/* @(#)e_log10.c 5.1 93/09/24 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/* __ieee754_log10(x)
+ * Return the base 10 logarithm of x
+ *
+ * Method :
+ * Let log10_2hi = leading 40 bits of log10(2) and
+ * log10_2lo = log10(2) - log10_2hi,
+ * ivln10 = 1/log(10) rounded.
+ * Then
+ * n = ilogb(x),
+ * if(n<0) n = n+1;
+ * x = scalbn(x,-n);
+ * log10(x) := n*log10_2hi + (n*log10_2lo + ivln10*log(x))
+ *
+ * Note 1:
+ * To guarantee log10(10**n)=n, where 10**n is normal, the rounding
+ * mode must set to Round-to-Nearest.
+ * Note 2:
+ * [1/log(10)] rounded to 53 bits has error .198 ulps;
+ * log10 is monotonic at all binary break points.
+ *
+ * Special cases:
+ * log10(x) is NaN with signal if x < 0;
+ * log10(+INF) is +INF with no signal; log10(0) is -INF with signal;
+ * log10(NaN) is that NaN with no signal;
+ * log10(10**N) = N for N=0,1,...,22.
+ *
+ * Constants:
+ * The hexadecimal values are the intended ones for the following constants.
+ * The decimal values may be used, provided that the compiler will convert
+ * from decimal to binary accurately enough to produce the hexadecimal values
+ * shown.
+ */
+
+#include <math.h>
+#include <math_private.h>
+
+static const double two54 = 1.80143985094819840000e+16; /* 0x4350000000000000 */
+static const double ivln10 = 4.34294481903251816668e-01; /* 0x3FDBCB7B1526E50E */
+static const double log10_2hi = 3.01029995663611771306e-01; /* 0x3FD34413509F6000 */
+static const double log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF311F12B36 */
+
+double
+__ieee754_log10 (double x)
+{
+ double y, z;
+ int64_t i, hx;
+ int32_t k;
+
+ EXTRACT_WORDS64 (hx, x);
+
+ k = 0;
+ if (hx < INT64_C(0x0010000000000000))
+ { /* x < 2**-1022 */
+ if (__builtin_expect ((hx & UINT64_C(0x7fffffffffffffff)) == 0, 0))
+ return -two54 / (x - x); /* log(+-0)=-inf */
+ if (__builtin_expect (hx < 0, 0))
+ return (x - x) / (x - x); /* log(-#) = NaN */
+ k -= 54;
+ x *= two54; /* subnormal number, scale up x */
+ EXTRACT_WORDS64 (hx, x);
+ }
+ /* scale up resulted in a NaN number */
+ if (__builtin_expect (hx >= UINT64_C(0x7ff0000000000000), 0))
+ return x + x;
+ k += (hx >> 52) - 1023;
+ i = ((uint64_t) k & UINT64_C(0x8000000000000000)) >> 63;
+ hx = (hx & UINT64_C(0x000fffffffffffff)) | ((0x3ff - i) << 52);
+ y = (double) (k + i);
+ INSERT_WORDS64 (x, hx);
+ z = y * log10_2lo + ivln10 * __ieee754_log (x);
+ return z + y * log10_2hi;
+}
+
+strong_alias (__ieee754_log10, __log10_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
new file mode 100644
index 000000000..6dc7b7d21
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
@@ -0,0 +1,128 @@
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/* __ieee754_log2(x)
+ * Return the logarithm to base 2 of x
+ *
+ * Method :
+ * 1. Argument Reduction: find k and f such that
+ * x = 2^k * (1+f),
+ * where sqrt(2)/2 < 1+f < sqrt(2) .
+ *
+ * 2. Approximation of log(1+f).
+ * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
+ * = 2s + 2/3 s**3 + 2/5 s**5 + .....,
+ * = 2s + s*R
+ * We use a special Reme algorithm on [0,0.1716] to generate
+ * a polynomial of degree 14 to approximate R The maximum error
+ * of this polynomial approximation is bounded by 2**-58.45. In
+ * other words,
+ * 2 4 6 8 10 12 14
+ * R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s
+ * (the values of Lg1 to Lg7 are listed in the program)
+ * and
+ * | 2 14 | -58.45
+ * | Lg1*s +...+Lg7*s - R(z) | <= 2
+ * | |
+ * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
+ * In order to guarantee error in log below 1ulp, we compute log
+ * by
+ * log(1+f) = f - s*(f - R) (if f is not too large)
+ * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy)
+ *
+ * 3. Finally, log(x) = k + log(1+f).
+ * = k+(f-(hfsq-(s*(hfsq+R))))
+ *
+ * Special cases:
+ * log2(x) is NaN with signal if x < 0 (including -INF) ;
+ * log2(+INF) is +INF; log(0) is -INF with signal;
+ * log2(NaN) is that NaN with no signal.
+ *
+ * Constants:
+ * The hexadecimal values are the intended ones for the following
+ * constants. The decimal values may be used, provided that the
+ * compiler will convert from decimal to binary accurately enough
+ * to produce the hexadecimal values shown.
+ */
+
+#include <math.h>
+#include <math_private.h>
+
+static const double ln2 = 0.69314718055994530942;
+static const double two54 = 1.80143985094819840000e+16; /* 4350000000000000 */
+static const double Lg1 = 6.666666666666735130e-01; /* 3FE5555555555593 */
+static const double Lg2 = 3.999999999940941908e-01; /* 3FD999999997FA04 */
+static const double Lg3 = 2.857142874366239149e-01; /* 3FD2492494229359 */
+static const double Lg4 = 2.222219843214978396e-01; /* 3FCC71C51D8E78AF */
+static const double Lg5 = 1.818357216161805012e-01; /* 3FC7466496CB03DE */
+static const double Lg6 = 1.531383769920937332e-01; /* 3FC39A09D078C69F */
+static const double Lg7 = 1.479819860511658591e-01; /* 3FC2F112DF3E5244 */
+
+static const double zero = 0.0;
+
+double
+__ieee754_log2 (double x)
+{
+ double hfsq, f, s, z, R, w, t1, t2, dk;
+ int64_t hx, i, j;
+ int32_t k;
+
+ EXTRACT_WORDS64 (hx, x);
+
+ k = 0;
+ if (hx < INT64_C(0x0010000000000000))
+ { /* x < 2**-1022 */
+ if (__builtin_expect ((hx & UINT64_C(0x7fffffffffffffff)) == 0, 0))
+ return -two54 / (x - x); /* log(+-0)=-inf */
+ if (__builtin_expect (hx < 0, 0))
+ return (x - x) / (x - x); /* log(-#) = NaN */
+ k -= 54;
+ x *= two54; /* subnormal number, scale up x */
+ EXTRACT_WORDS64 (hx, x);
+ }
+ if (__builtin_expect (hx >= UINT64_C(0x7ff0000000000000), 0))
+ return x + x;
+ k += (hx >> 52) - 1023;
+ hx &= UINT64_C(0x000fffffffffffff);
+ i = (hx + UINT64_C(0x95f6400000000)) & UINT64_C(0x10000000000000);
+ /* normalize x or x/2 */
+ INSERT_WORDS64 (x, hx | (i ^ UINT64_C(0x3ff0000000000000)));
+ k += (i >> 52);
+ dk = (double) k;
+ f = x - 1.0;
+ if ((UINT64_C(0x000fffffffffffff) & (2 + hx)) < 3)
+ { /* |f| < 2**-20 */
+ if (f == zero)
+ return dk;
+ R = f * f * (0.5 - 0.33333333333333333 * f);
+ return dk - (R - f) / ln2;
+ }
+ s = f / (2.0 + f);
+ z = s * s;
+ i = hx - UINT64_C(0x6147a00000000);
+ w = z * z;
+ j = UINT64_C(0x6b85100000000) - hx;
+ t1 = w * (Lg2 + w * (Lg4 + w * Lg6));
+ t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));
+ i |= j;
+ R = t2 + t1;
+ if (i > 0)
+ {
+ hfsq = 0.5 * f * f;
+ return dk - ((hfsq - (s * (hfsq + R))) - f) / ln2;
+ }
+ else
+ {
+ return dk - ((s * (f - R)) - f) / ln2;
+ }
+}
+
+strong_alias (__ieee754_log2, __log2_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
index 474eeef36..185dd05be 100644
--- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
@@ -36,7 +36,7 @@ __logb (double x)
return x * x;
if (__builtin_expect (ex == 0, 0))
{
- int m = (ix == 0) ? 0 : __builtin_clzl (ix);
+ int m = (ix == 0) ? 0 : __builtin_clzll (ix);
return -1022.0 + (double)(11 -m);
}
return (double) (ex - 1023);
diff --git a/libc/sysdeps/ieee754/flt-32/e_acosf.c b/libc/sysdeps/ieee754/flt-32/e_acosf.c
index c0f1d4ea7..6f792f660 100644
--- a/libc/sysdeps/ieee754/flt-32/e_acosf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_acosf.c
@@ -46,7 +46,7 @@ __ieee754_acosf(float x)
return (x-x)/(x-x); /* acos(|x|>1) is NaN */
}
if(ix<0x3f000000) { /* |x| < 0.5 */
- if(ix<=0x23000000) return pio2_hi+pio2_lo;/*if|x|<2**-57*/
+ if(ix<=0x32800000) return pio2_hi+pio2_lo;/*if|x|<=2**-26*/
z = x*x;
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
diff --git a/libc/sysdeps/ieee754/ldbl-opt/Makefile b/libc/sysdeps/ieee754/ldbl-opt/Makefile
index 332ffbdb9..d73d328b2 100644
--- a/libc/sysdeps/ieee754/ldbl-opt/Makefile
+++ b/libc/sysdeps/ieee754/ldbl-opt/Makefile
@@ -49,5 +49,6 @@ libnldbl-calls += $(libnldbl-calls-y)
libnldbl-routines = $(libnldbl-calls:%=nldbl-%)
libnldbl-inhibit-o = $(object-suffixes)
libnldbl-static-only-routines = $(libnldbl-routines)
+extra-objs += $(addsuffix .oS, $(libnldbl-routines))
endif
diff --git a/libc/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/libc/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
index 6d78e0f2f..f5c12f324 100644
--- a/libc/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
+++ b/libc/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
@@ -1,5 +1,5 @@
/* *printf* family compatibility routines for IEEE double as long double
- Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2006-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@cygnus.com>, 2006.
@@ -173,7 +173,7 @@ __nldbl_vfprintf (FILE *s, const char *fmt, va_list ap)
{
int done;
set_no_long_double ();
- done = INTUSE(_IO_vfprintf) (s, fmt, ap);
+ done = _IO_vfprintf (s, fmt, ap);
clear_no_long_double ();
return done;
}
@@ -186,7 +186,7 @@ __nldbl__IO_vsprintf (char *string, const char *fmt, va_list ap)
{
int done;
__no_long_double = 1;
- done = INTUSE(_IO_vsprintf) (string, fmt, ap);
+ done = _IO_vsprintf (string, fmt, ap);
__no_long_double = 0;
return done;
}
@@ -350,7 +350,7 @@ __nldbl__IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap,
{
int res;
set_no_long_double ();
- res = INTUSE(_IO_vfscanf) (s, fmt, ap, errp);
+ res = _IO_vfscanf (s, fmt, ap, errp);
clear_no_long_double ();
return res;
}
@@ -361,7 +361,7 @@ __nldbl___vfscanf (FILE *s, const char *fmt, va_list ap)
{
int res;
set_no_long_double ();
- res = INTUSE(_IO_vfscanf) (s, fmt, ap, NULL);
+ res = _IO_vfscanf (s, fmt, ap, NULL);
clear_no_long_double ();
return res;
}
diff --git a/libc/sysdeps/mach/gettimeofday.c b/libc/sysdeps/mach/gettimeofday.c
index 88dca8e89..293a77595 100644
--- a/libc/sysdeps/mach/gettimeofday.c
+++ b/libc/sysdeps/mach/gettimeofday.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1995-1997,2001,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,8 +20,6 @@
#include <sys/time.h>
#include <mach.h>
-#undef __gettimeofday
-
/* Get the current time of day and timezone information,
putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled.
Returns 0 on success, -1 on errors. */
@@ -42,6 +40,6 @@ __gettimeofday (tv, tz)
}
return 0;
}
-
-INTDEF(__gettimeofday)
+libc_hidden_def (__gettimeofday)
weak_alias (__gettimeofday, gettimeofday)
+libc_hidden_weak (gettimeofday)
diff --git a/libc/sysdeps/mach/hurd/bits/typesizes.h b/libc/sysdeps/mach/hurd/bits/typesizes.h
index bca63ed92..efc13143e 100644
--- a/libc/sysdeps/mach/hurd/bits/typesizes.h
+++ b/libc/sysdeps/mach/hurd/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. Hurd version.
- Copyright (C) 2002,2003 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,6 +44,7 @@
#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __FSWORD_T_TYPE __SWORD_TYPE
#define __ID_T_TYPE __U32_TYPE
#define __CLOCK_T_TYPE __SLONGWORD_TYPE
#define __TIME_T_TYPE __SLONGWORD_TYPE
@@ -57,7 +58,8 @@
#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
#define __FSID_T_TYPE __UQUAD_TYPE
#define __SSIZE_T_TYPE __SWORD_TYPE
-#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 256
diff --git a/libc/sysdeps/mach/hurd/tmpfile.c b/libc/sysdeps/mach/hurd/tmpfile.c
index 5b16d85ed..94b1380da 100644
--- a/libc/sysdeps/mach/hurd/tmpfile.c
+++ b/libc/sysdeps/mach/hurd/tmpfile.c
@@ -1,5 +1,5 @@
/* Open a stdio stream on an anonymous temporary file. Hurd version.
- Copyright (C) 2001,2002,2003 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -56,7 +56,7 @@ __tmpfile (void)
/* Open a stream on the unnamed file.
It will cease to exist when this stream is closed. */
- if ((f = INTUSE(_IO_fdopen) (fd, "w+b")) == NULL)
+ if ((f = _IO_fdopen (fd, "w+b")) == NULL)
__close (fd);
return f;
diff --git a/libc/sysdeps/posix/gettimeofday.c b/libc/sysdeps/posix/gettimeofday.c
index 31b3dd3fa..1108ff016 100644
--- a/libc/sysdeps/posix/gettimeofday.c
+++ b/libc/sysdeps/posix/gettimeofday.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1994-1997,2002,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,8 +19,6 @@
#include <time.h>
#include <sys/time.h>
-#undef __gettimeofday
-
/* Get the current time of day and timezone information,
putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled.
Returns 0 on success, -1 on errors. */
@@ -66,6 +64,6 @@ __gettimeofday (tv, tz)
return 0;
}
-
-INTDEF(__gettimeofday)
+libc_hidden_def (__gettimeofday)
weak_alias (__gettimeofday, gettimeofday)
+libc_hidden_weak (gettimeofday)
diff --git a/libc/sysdeps/powerpc/bits/hwcap.h b/libc/sysdeps/powerpc/bits/hwcap.h
new file mode 100644
index 000000000..89e7d8b73
--- /dev/null
+++ b/libc/sysdeps/powerpc/bits/hwcap.h
@@ -0,0 +1,53 @@
+/* Defines for bits in AT_HWCAP.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_AUXV_H
+# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
+#endif
+
+/*
+ * The following must match the kernels asm/cputable.h.
+ */
+#define PPC_FEATURE_32 0x80000000 /* 32-bit mode. */
+#define PPC_FEATURE_64 0x40000000 /* 64-bit mode. */
+#define PPC_FEATURE_601_INSTR 0x20000000 /* 601 chip, Old POWER ISA. */
+#define PPC_FEATURE_HAS_ALTIVEC 0x10000000 /* SIMD/Vector Unit. */
+#define PPC_FEATURE_HAS_FPU 0x08000000 /* Floating Point Unit. */
+#define PPC_FEATURE_HAS_MMU 0x04000000 /* Memory Management Unit. */
+#define PPC_FEATURE_HAS_4xxMAC 0x02000000 /* 4xx Multiply Accumulator. */
+#define PPC_FEATURE_UNIFIED_CACHE 0x01000000 /* Unified I/D cache. */
+#define PPC_FEATURE_HAS_SPE 0x00800000 /* Signal Processing ext. */
+#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 /* SPE Float. */
+#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 /* SPE Double. */
+#define PPC_FEATURE_NO_TB 0x00100000 /* 601/403gx have no timebase */
+#define PPC_FEATURE_POWER4 0x00080000 /* POWER4 ISA 2.00 */
+#define PPC_FEATURE_POWER5 0x00040000 /* POWER5 ISA 2.02 */
+#define PPC_FEATURE_POWER5_PLUS 0x00020000 /* POWER5+ ISA 2.03 */
+#define PPC_FEATURE_CELL_BE 0x00010000 /* CELL Broadband Engine */
+#define PPC_FEATURE_BOOKE 0x00008000
+#define PPC_FEATURE_SMT 0x00004000 /* Simultaneous Multi-Threading */
+#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
+#define PPC_FEATURE_ARCH_2_05 0x00001000 /* ISA 2.05 */
+#define PPC_FEATURE_PA6T 0x00000800 /* PA Semi 6T Core */
+#define PPC_FEATURE_HAS_DFP 0x00000400 /* Decimal FP Unit */
+#define PPC_FEATURE_POWER6_EXT 0x00000200 /* P6 + mffgpr/mftgpr */
+#define PPC_FEATURE_ARCH_2_06 0x00000100 /* ISA 2.06 */
+#define PPC_FEATURE_HAS_VSX 0x00000080 /* P7 Vector Extension. */
+#define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040
+#define PPC_FEATURE_TRUE_LE 0x00000002
+#define PPC_FEATURE_PPC_LE 0x00000001
diff --git a/libc/sysdeps/powerpc/fpu/libm-test-ulps b/libc/sysdeps/powerpc/fpu/libm-test-ulps
index 5abff41b0..85a923545 100644
--- a/libc/sysdeps/powerpc/fpu/libm-test-ulps
+++ b/libc/sysdeps/powerpc/fpu/libm-test-ulps
@@ -12,6 +12,12 @@ ldouble: 1
ildouble: 1
# acos_downward
+Test "acos_downward (-0) == pi/2":
+float: 1
+ifloat: 1
+Test "acos_downward (0) == pi/2":
+float: 1
+ifloat: 1
Test "acos_downward (-0.5) == M_PI_6l*4.0":
double: 1
idouble: 1
@@ -24,8 +30,17 @@ double: 1
idouble: 1
ldouble: 1
ildouble: 1
+Test "acos_downward (-1) == pi":
+float: 1
+ifloat: 1
# acos_towardzero
+Test "acos_towardzero (-0) == pi/2":
+float: 1
+ifloat: 1
+Test "acos_towardzero (0) == pi/2":
+float: 1
+ifloat: 1
Test "acos_towardzero (-0.5) == M_PI_6l*4.0":
double: 1
idouble: 1
@@ -38,6 +53,9 @@ double: 1
idouble: 1
ldouble: 1
ildouble: 1
+Test "acos_towardzero (-1) == pi":
+float: 1
+ifloat: 1
# acos_upward
Test "acos_upward (-0) == pi/2":
@@ -586,6 +604,22 @@ double: 1
idouble: 1
# ccos
+Test "Imaginary part of: ccos (-0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (-0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (-0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Imaginary part of: ccos (-0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
float: 1
ifloat: 1
@@ -597,8 +631,43 @@ ifloat: 1
Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
float: 1
ifloat: 1
+Test "Imaginary part of: ccos (0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Imaginary part of: ccos (0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Imaginary part of: ccos (0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (0x1p-1074 + 1440 i) == inf - 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
# ccosh
+Test "Imaginary part of: ccosh (-710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (-710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (-89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Imaginary part of: ccosh (-89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
float: 1
ifloat: 1
@@ -617,6 +686,25 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: ccosh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Imaginary part of: ccosh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Imaginary part of: ccosh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
# cexp
Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
@@ -635,7 +723,7 @@ ldouble: 2
Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
ildouble: 1
ldouble: 1
-Test "Imaginary part of: cexp (1440 + 0x1p-1074 i) == inf + 1.196295853897226111293303155636183216483e302 i plus overflow exception":
+Test "Imaginary part of: cexp (1440 + 0x1p-1074 i) == inf + 1.196295853897226111293303155636183216483e302 i":
double: 1
idouble: 1
Test "Real part of: cexp (50 + 0x1p127 i) == 4.053997150228616856622417636046265337193e21 + 3.232070315463388524466674772633810238819e21 i":
@@ -1077,7 +1165,60 @@ ifloat: 2
ildouble: 2
ldouble: 2
+# csin
+Test "Real part of: csin (-0.75 + 710.5 i) == -1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (-0.75 - 710.5 i) == -1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (-0.75 + 89.5 i) == -2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Real part of: csin (-0.75 - 89.5 i) == -2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Real part of: csin (0.75 + 89.5 i) == 2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Real part of: csin (0.75 - 89.5 i) == 2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Real part of: csin (0.75 + 710.5 i) == 1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (0.75 - 710.5 i) == 1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (0x1p-1074 + 1440 i) == 5.981479269486130556466515778180916082415e301 + inf i":
+double: 1
+idouble: 1
+
# csinh
+Test "Imaginary part of: csinh (-710.5 + 0.75 i) == -1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (-710.5 - 0.75 i) == -1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (-89.5 + 0.75 i) == -2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Imaginary part of: csinh (-89.5 - 0.75 i) == -2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
double: 1
idouble: 1
@@ -1093,6 +1234,26 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+float: 1
+Test "Imaginary part of: csinh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Imaginary part of: csinh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ldouble: 1
+ildouble: 1
+Test "Imaginary part of: csinh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
# csqrt
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
@@ -1269,6 +1430,11 @@ ildouble: 1
ldouble: 1
# exp10
+Test "exp10 (-305) == 1.0e-305":
+double: 1
+idouble: 1
+ldouble: 1
+ildouble: 1
Test "exp10 (-1) == 0.1":
double: 2
float: 1
@@ -1283,13 +1449,19 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "exp10 (-36) == 1.0e-36":
+double: 1
+idouble: 1
+Test "exp10 (36) == 1.0e36":
+double: 1
+idouble: 1
Test "exp10 (3) == 1000":
-double: 6
-float: 2
-idouble: 6
-ifloat: 2
-ildouble: 8
-ldouble: 8
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
# exp2
Test "exp2 (10) == 1024":
@@ -1332,6 +1504,9 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "expm1 (500.0) == 1.4035922178528374107397703328409120821806e+217":
+double: 1
+idouble: 1
# hypot
Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271":
@@ -2333,6 +2508,7 @@ ldouble: 1
Function: Real part of "ccos":
double: 1
float: 1
+double: 1
idouble: 1
ifloat: 1
ildouble: 1
@@ -2341,6 +2517,8 @@ ldouble: 1
Function: Imaginary part of "ccos":
float: 1
ifloat: 1
+double: 1
+idouble: 1
ildouble: 1
ldouble: 1
@@ -2355,6 +2533,8 @@ ldouble: 1
Function: Imaginary part of "ccosh":
float: 1
ifloat: 1
+double: 1
+idouble: 1
ildouble: 2
ldouble: 2
@@ -2483,9 +2663,17 @@ ildouble: 1
ldouble: 1
Function: Real part of "csin":
+float: 1
+ifloat: 1
+double: 1
+idouble: 1
ildouble: 1
ldouble: 1
+Function: Imaginary part of "csin":
+ldouble: 1
+ildouble: 1
+
Function: Real part of "csinh":
float: 1
ifloat: 1
@@ -2567,12 +2755,12 @@ ildouble: 1
ldouble: 1
Function: "exp10":
-double: 6
-float: 2
-idouble: 6
-ifloat: 2
-ildouble: 8
-ldouble: 8
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Function: "exp2":
ildouble: 2
@@ -2605,6 +2793,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+ldouble: 1
+ildouble: 1
Function: "gamma":
ildouble: 1
diff --git a/libc/sysdeps/powerpc/memmove.c b/libc/sysdeps/powerpc/memmove.c
index 89182838e..1617ecea9 100644
--- a/libc/sysdeps/powerpc/memmove.c
+++ b/libc/sysdeps/powerpc/memmove.c
@@ -50,12 +50,12 @@ MEMMOVE (a1, a2, len)
unsigned long int srcp = (long int) src;
/* If there is no overlap between ranges, call the builtin memcpy. */
- if ( (dstp >= (srcp + len)) || (srcp > (dstp + len)) )
- return __builtin_memcpy (dest, src, len);
+ if (dstp >= srcp + len || srcp > dstp + len)
+ __builtin_memcpy (dest, src, len);
/* This test makes the forward copying code be used whenever possible.
Reduces the working set. */
- if (dstp - srcp >= len) /* *Unsigned* compare! */
+ else if (dstp - srcp >= len) /* *Unsigned* compare! */
{
/* Copy from the beginning to the end. */
diff --git a/libc/sysdeps/powerpc/powerpc32/bits/wordsize.h b/libc/sysdeps/powerpc/powerpc32/bits/wordsize.h
index 1a79c8636..f31ac9ab0 100644
--- a/libc/sysdeps/powerpc/powerpc32/bits/wordsize.h
+++ b/libc/sysdeps/powerpc/powerpc32/bits/wordsize.h
@@ -2,7 +2,7 @@
#if defined __powerpc64__
# define __WORDSIZE 64
-# define __WORDSIZE_COMPAT32 1
+# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
#endif
diff --git a/libc/sysdeps/powerpc/powerpc32/dl-irel.h b/libc/sysdeps/powerpc/powerpc32/dl-irel.h
index c8e50ee10..ebaf44a1e 100644
--- a/libc/sysdeps/powerpc/powerpc32/dl-irel.h
+++ b/libc/sysdeps/powerpc/powerpc32/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
PowerPC version.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,7 +29,7 @@ static inline Elf32_Addr
__attribute ((always_inline))
elf_ifunc_invoke (Elf32_Addr addr)
{
- return ((Elf32_Addr (*) (void)) (addr)) ();
+ return ((Elf32_Addr (*) (unsigned long int)) (addr)) (GLRO(dl_hwcap));
}
static inline void
diff --git a/libc/sysdeps/powerpc/powerpc32/dl-machine.c b/libc/sysdeps/powerpc/powerpc32/dl-machine.c
index 3f49707f4..6267af3a1 100644
--- a/libc/sysdeps/powerpc/powerpc32/dl-machine.c
+++ b/libc/sysdeps/powerpc/powerpc32/dl-machine.c
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation functions. PowerPC version.
- Copyright (C) 1995-2006, 2008, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -236,16 +236,21 @@ __elf_machine_runtime_setup (struct link_map *map, int lazy, int profile)
if (lazy)
{
Elf32_Word *tramp = plt + PLT_TRAMPOLINE_ENTRY_WORDS;
- Elf32_Word dlrr = (Elf32_Word)(profile
- ? _dl_prof_resolve
- : _dl_runtime_resolve);
+ Elf32_Word dlrr;
Elf32_Word offset;
+#ifndef PROF
+ dlrr = (Elf32_Word) (profile
+ ? _dl_prof_resolve
+ : _dl_runtime_resolve);
if (profile && GLRO(dl_profile) != NULL
&& _dl_name_match_p (GLRO(dl_profile), map))
/* This is the object we are looking for. Say that we really
want profiling and the timers are started. */
GL(dl_profile_map) = map;
+#else
+ dlrr = (Elf32_Word) _dl_runtime_resolve;
+#endif
/* For the long entries, subtract off data_words. */
tramp[0] = OPCODE_ADDIS_HI (11, 11, -data_words);
diff --git a/libc/sysdeps/powerpc/powerpc32/dl-machine.h b/libc/sysdeps/powerpc/powerpc32/dl-machine.h
index 45868f5de..3ae27a492 100644
--- a/libc/sysdeps/powerpc/powerpc32/dl-machine.h
+++ b/libc/sysdeps/powerpc/powerpc32/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. PowerPC version.
- Copyright (C) 1995-2003, 2005, 2006, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,6 +23,7 @@
#include <assert.h>
#include <dl-tls.h>
+#include <dl-irel.h>
/* Translate a processor specific dynamic tag to the index
in l_info array. */
@@ -308,7 +309,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
&& __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
&& __builtin_expect (!skip_ifunc, 1))
- value = ((Elf32_Addr (*) (void)) value) ();
+ value = elf_ifunc_invoke (value);
/* A small amount of code is duplicated here for speed. In libc,
more than 90% of the relocs are R_PPC_RELATIVE; in the X11 shared
diff --git a/libc/sysdeps/powerpc/powerpc32/dl-start.S b/libc/sysdeps/powerpc/powerpc32/dl-start.S
index 2546fa52a..b2d019403 100644
--- a/libc/sysdeps/powerpc/powerpc32/dl-start.S
+++ b/libc/sysdeps/powerpc/powerpc32/dl-start.S
@@ -1,6 +1,5 @@
/* Machine-dependent ELF startup code. PowerPC version.
- Copyright (C) 1995-2000, 2002, 2004, 2005, 2006, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -53,9 +52,9 @@ _dl_start_user:
/* the address of _start in r30, */
mr r30,r3
/* &_dl_argc in 29, &_dl_argv in 27, and _dl_loaded in 28. */
- lwz r28,_rtld_global@got(r31)
+ lwz r28,_rtld_local@got(r31)
lwz r29,_dl_argc@got(r31)
- lwz r27,_dl_argv@got(r31)
+ lwz r27,INTUSE(_dl_argv)@got(r31)
/* Call _dl_init (_dl_loaded, _dl_argc, _dl_argv, _dl_argv+_dl_argc+1). */
lwz r3,0(r28)
diff --git a/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S b/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
index 4cfde6b70..53af0437c 100644
--- a/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
+++ b/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
@@ -1,6 +1,5 @@
/* longjmp for PowerPC.
- Copyright (C) 1995-99, 2000, 2003-2006, 2009, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,7 +37,13 @@ ENTRY (BP_SYM (__longjmp))
addis r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@ha
addi r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@l
# ifdef SHARED
+# ifdef IS_IN_rtld
+ /* Inside ld.so we use the local alias to avoid runtime GOT
+ relocations. */
+ lwz r5,_rtld_local_ro@got(r5)
+# else
lwz r5,_rtld_global_ro@got(r5)
+# endif
mtlr r6
cfi_same_value (lr)
lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r5)
diff --git a/libc/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S b/libc/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
index b3c9f56d6..1f08b8b4a 100644
--- a/libc/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
+++ b/libc/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
@@ -1,5 +1,5 @@
/* setjmp for PowerPC.
- Copyright (C) 1995-2000, 2003-2005, 2006, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -90,7 +90,13 @@ ENTRY (BP_SYM (__sigsetjmp))
mtlr r6
cfi_same_value (lr)
# ifdef SHARED
+# ifdef IS_IN_rtld
+ /* Inside ld.so we use the local alias to avoid runtime GOT
+ relocations. */
+ lwz r5,_rtld_local_ro@got(r5)
+# else
lwz r5,_rtld_global_ro@got(r5)
+# endif
lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r5)
# else
lwz r5,_dl_hwcap@got(r5)
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/Makefile b/libc/sysdeps/powerpc/powerpc32/power4/Makefile
index 60aa508ba..ba06adb5d 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/Makefile
+++ b/libc/sysdeps/powerpc/powerpc32/power4/Makefile
@@ -1,6 +1,6 @@
# Makefile fragment for POWER4/5/5+.
ifeq ($(subdir),string)
-CFLAGS-wordcopy.c += --param max-variable-expansions-in-unroller=2 --param max-unroll-times=2 -funroll-loops -fpeel-loops -ftree-loop-linear
-CFLAGS-memmove.c += --param max-variable-expansions-in-unroller=2 --param max-unroll-times=2 -funroll-loops -fpeel-loops -ftree-loop-linear
+CFLAGS-wordcopy.c += --param max-variable-expansions-in-unroller=2 --param max-unroll-times=2 -funroll-loops -fpeel-loops
+CFLAGS-memmove.c += --param max-variable-expansions-in-unroller=2 --param max-unroll-times=2 -funroll-loops -fpeel-loops
endif
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/fpu/Makefile b/libc/sysdeps/powerpc/powerpc32/power4/fpu/Makefile
index a6fa75ecb..f487ed601 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/fpu/Makefile
+++ b/libc/sysdeps/powerpc/powerpc32/power4/fpu/Makefile
@@ -1,5 +1,5 @@
# Makefile fragment for POWER4/5/5+ with FPU.
ifeq ($(subdir),math)
-CFLAGS-mpa.c += --param max-unroll-times=4 -funroll-loops -fpeel-loops -ftree-loop-linear
+CFLAGS-mpa.c += --param max-unroll-times=4 -funroll-loops -fpeel-loops
endif
diff --git a/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S b/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
index beb5baea7..e147ba78a 100644
--- a/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
+++ b/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
@@ -47,9 +47,12 @@ strong_alias (__copysign, __copysignl)
weak_alias (__copysign, copysignl)
#endif
-#ifndef IS_IN_libm
-# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
-compat_symbol (libc, __copysign, __copysignl, GLIBC_2_0);
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, copysign, copysignl, GLIBC_2_0)
+# endif
+#else
+# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, copysign, copysignl, GLIBC_2_0);
# endif
#endif
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S b/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
index 7640d3ca9..106cf543e 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
@@ -79,8 +79,15 @@ strong_alias (__finite, __finitel)
weak_alias (__finite, finitel)
#endif
-#ifndef IS_IN_libm
-# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, finite, finitel, GLIBC_2_0)
+# endif
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
+compat_symbol (libm, __finite, __finitel, GLIBC_2_1)
+# endif
+#else
+# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
compat_symbol (libc, finite, finitel, GLIBC_2_0);
# endif
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c b/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c
new file mode 100644
index 000000000..fba482290
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c
@@ -0,0 +1,77 @@
+/* logb(). PowerPC/POWER7 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math_ldbl_opt.h>
+
+/* This implementation avoids FP to INT conversions by using VSX
+ bitwise instructions over FP values. */
+
+static const double two1div52 = 2.220446049250313e-16; /* 1/2**52 */
+static const double two10m1 = -1023.0; /* 2**10 -1 */
+
+/* FP mask to extract the exponent. */
+static const union {
+ unsigned long long mask;
+ double d;
+} mask = { 0x7ff0000000000000ULL };
+
+double
+__logb (double x)
+{
+ double ret;
+
+ if (__builtin_expect (x == 0.0, 0))
+ /* Raise FE_DIVBYZERO and return -HUGE_VAL[LF]. */
+ return -1.0 / __builtin_fabs (x);
+
+ /* ret = x & 0x7ff0000000000000; */
+ asm (
+ "xxland %x0,%x1,%x2\n"
+ "fcfid %0,%0"
+ : "=f" (ret)
+ : "f" (x), "f" (mask.d));
+ /* ret = (ret >> 52) - 1023.0; */
+ ret = (ret * two1div52) + two10m1;
+ if (__builtin_expect (ret > -two10m1, 0))
+ /* Multiplication is used to set logb (+-INF) = INF. */
+ return (x * x);
+ else if (__builtin_expect (ret == two10m1, 0))
+ {
+ /* POSIX specifies that denormal numbers are treated as
+ though they were normalized. */
+ int32_t lx, ix;
+ int m1, m2, ma;
+
+ EXTRACT_WORDS (ix , lx, x);
+ m1 = (ix == 0) ? 0 : __builtin_clz (ix);
+ m2 = (lx == 0) ? 0 : __builtin_clz (lx);
+ ma = (m1 == 0) ? m2 + 32 : m1;
+ return -1022.0 + (double)(11 - ma);
+ }
+ /* Test to avoid logb_downward (0.0) == -0.0. */
+ return ret == -0.0 ? 0.0 : ret;
+}
+weak_alias (__logb, logb)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__logb, __logbl)
+weak_alias (__logb, logbl)
+#endif
+
+#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, logb, logbl, GLIBC_2_0);
+#endif
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logbf.c b/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logbf.c
new file mode 100644
index 000000000..aa8499a14
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logbf.c
@@ -0,0 +1,60 @@
+/* logbf(). PowerPC/POWER7 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "math_private.h"
+
+/* This implementation avoids FP to INT conversions by using VSX
+ bitwise instructions over FP values. */
+
+static const double two1div52 = 2.220446049250313e-16; /* 1/2**52 */
+static const double two10m1 = -1023.0; /* -2**10 + 1 */
+static const double two7m1 = -127.0; /* -2**7 + 1 */
+
+/* FP mask to extract the exponent. */
+static const union {
+ unsigned long long mask;
+ double d;
+} mask = { 0x7ff0000000000000ULL };
+
+float
+__logbf (float x)
+{
+ /* VSX operation are all done internally as double. */
+ double ret;
+
+ if (__builtin_expect (x == 0.0, 0))
+ /* Raise FE_DIVBYZERO and return -HUGE_VAL[LF]. */
+ return -1.0 / __builtin_fabsf (x);
+
+ /* ret = x & 0x7f800000; */
+ asm (
+ "xxland %x0,%x1,%x2\n"
+ "fcfid %0,%0"
+ : "=f"(ret)
+ : "f" (x), "f" (mask.d));
+ /* ret = (ret >> 52) - 1023.0, since ret is double. */
+ ret = (ret * two1div52) + two10m1;
+ if (__builtin_expect (ret > -two7m1, 0))
+ /* Multiplication is used to set logb (+-INF) = INF. */
+ return (x * x);
+ /* Since operations are done with double we don't need
+ additional tests for subnormal numbers.
+ The test is to avoid logb_downward (0.0) == -0.0. */
+ return ret == -0.0 ? 0.0 : ret;
+}
+weak_alias (__logbf, logbf)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c b/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c
new file mode 100644
index 000000000..03942ca53
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c
@@ -0,0 +1,72 @@
+/* logbl(). PowerPC/POWER7 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <math_ldbl_opt.h>
+
+/* This implementation avoids FP to INT conversions by using VSX
+ bitwise instructions over FP values. */
+
+static const double two1div52 = 2.220446049250313e-16; /* 1/2**52 */
+static const double two10m1 = -1023.0; /* 2**10 -1 */
+
+/* FP mask to extract the exponent. */
+static const union {
+ unsigned long long mask;
+ double d;
+} mask = { 0x7ff0000000000000ULL };
+
+long double
+__logbl (long double x)
+{
+ double xh, xl;
+ double ret;
+
+ if (__builtin_expect (x == 0.0L, 0))
+ /* Raise FE_DIVBYZERO and return -HUGE_VAL[LF]. */
+ return -1.0L / __builtin_fabsl (x);
+
+ ldbl_unpack (x, &xh, &xl);
+ /* ret = x & 0x7ff0000000000000; */
+ asm (
+ "xxland %x0,%x1,%x2\n"
+ "fcfid %0,%0"
+ : "=f" (ret)
+ : "f" (xh), "f" (mask.d));
+ /* ret = (ret >> 52) - 1023.0; */
+ ret = (ret * two1div52) + two10m1;
+ if (__builtin_expect (ret > -two10m1, 0))
+ /* Multiplication is used to set logb (+-INF) = INF. */
+ return (xh * xh);
+ else if (__builtin_expect (ret == two10m1, 0))
+ {
+ int64_t lx, hx;
+ int m1, m2, ma;
+
+ GET_LDOUBLE_WORDS64 (hx, lx, x);
+ m1 = (hx == 0) ? 0 : __builtin_clzll (hx);
+ m2 = (lx == 0) ? 0 : __builtin_clzll (lx);
+ ma = (m1 == 0) ? m2 + 64 : m1;
+ return -1022.0 + (double)(11 - ma);
+ }
+ /* Test to avoid logb_downward (0.0) == -0.0. */
+ return ret == -0.0 ? 0.0 : ret;
+}
+
+long_double_symbol (libm, __logbl, logbl);
diff --git a/libc/sysdeps/powerpc/powerpc32/stackguard-macros.h b/libc/sysdeps/powerpc/powerpc32/stackguard-macros.h
new file mode 100644
index 000000000..839f6a4b9
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc32/stackguard-macros.h
@@ -0,0 +1,4 @@
+#include <stdint.h>
+
+#define STACK_CHK_GUARD \
+ ({ uintptr_t x; asm ("lwz %0,-28680(2)" : "=r" (x)); x; })
diff --git a/libc/sysdeps/powerpc/powerpc64/__longjmp-common.S b/libc/sysdeps/powerpc/powerpc64/__longjmp-common.S
index 2ff9078ec..716b8ab7b 100644
--- a/libc/sysdeps/powerpc/powerpc64/__longjmp-common.S
+++ b/libc/sysdeps/powerpc/powerpc64/__longjmp-common.S
@@ -1,5 +1,5 @@
/* longjmp for PowerPC64.
- Copyright (C) 1995, 1996,1997,1999-2006,2009 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,13 @@
.section ".toc","aw"
.LC__dl_hwcap:
# ifdef SHARED
+# ifdef IS_IN_rtld
+ /* Inside ld.so we use the local alias to avoid runtime GOT
+ relocations. */
+ .tc _rtld_local_ro[TC],_rtld_local_ro
+# else
.tc _rtld_global_ro[TC],_rtld_global_ro
+# endif
# else
.tc _dl_hwcap[TC],_dl_hwcap
# endif
diff --git a/libc/sysdeps/powerpc/powerpc64/bits/wordsize.h b/libc/sysdeps/powerpc/powerpc64/bits/wordsize.h
index 1a79c8636..f31ac9ab0 100644
--- a/libc/sysdeps/powerpc/powerpc64/bits/wordsize.h
+++ b/libc/sysdeps/powerpc/powerpc64/bits/wordsize.h
@@ -2,7 +2,7 @@
#if defined __powerpc64__
# define __WORDSIZE 64
-# define __WORDSIZE_COMPAT32 1
+# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
#endif
diff --git a/libc/sysdeps/powerpc/powerpc64/dl-irel.h b/libc/sysdeps/powerpc/powerpc64/dl-irel.h
index 727027594..ced0f3f6d 100644
--- a/libc/sysdeps/powerpc/powerpc64/dl-irel.h
+++ b/libc/sysdeps/powerpc/powerpc64/dl-irel.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF indirect relocation inline functions.
PowerPC64 version.
- Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2009-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@ static inline Elf64_Addr
__attribute ((always_inline))
elf_ifunc_invoke (Elf64_Addr addr)
{
- return ((Elf64_Addr (*) (void)) (addr)) ();
+ return ((Elf64_Addr (*) (unsigned long int)) (addr)) (GLRO(dl_hwcap));
}
static inline void
diff --git a/libc/sysdeps/powerpc/powerpc64/dl-machine.h b/libc/sysdeps/powerpc/powerpc64/dl-machine.h
index 7c0475711..7c7d76899 100644
--- a/libc/sysdeps/powerpc/powerpc64/dl-machine.h
+++ b/libc/sysdeps/powerpc/powerpc64/dl-machine.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF dynamic relocation inline functions.
PowerPC64 version.
- Copyright 1995-2005, 2006, 2008, 2010, 2011 Free Software Foundation, Inc.
+ Copyright 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -161,8 +161,8 @@ BODY_PREFIX "_start:\n" \
" .popsection\n" \
" .pushsection \".toc\",\"aw\"\n" \
DL_STARTING_UP_DEF \
-".LC__rtld_global:\n" \
-" .tc _rtld_global[TC],_rtld_global\n" \
+".LC__rtld_local:\n" \
+" .tc _rtld_local[TC],_rtld_local\n" \
".LC__dl_argc:\n" \
" .tc _dl_argc[TC],_dl_argc\n" \
".LC__dl_argv:\n" \
@@ -181,7 +181,7 @@ BODY_PREFIX "_dl_start_user:\n" \
/* the address of _start in r30. */ \
" mr 30,3\n" \
/* &_dl_argc in 29, &_dl_argv in 27, and _dl_loaded in 28. */ \
-" ld 28,.LC__rtld_global@toc(2)\n" \
+" ld 28,.LC__rtld_local@toc(2)\n" \
" ld 29,.LC__dl_argc@toc(2)\n" \
" ld 27,.LC__dl_argv@toc(2)\n" \
/* _dl_init (_dl_loaded, _dl_argc, _dl_argv, _dl_argv+_dl_argc+1). */ \
@@ -545,7 +545,7 @@ resolve_ifunc (Elf64_Addr value,
value = (Elf64_Addr) &opd;
}
#endif
- return ((Elf64_Addr (*) (void)) value) ();
+ return ((Elf64_Addr (*) (unsigned long int)) value) (GLRO(dl_hwcap));
}
/* Perform the relocation specified by RELOC and SYM (which is fully
@@ -734,7 +734,7 @@ elf_machine_rela (struct link_map *map,
_dl_error_printf ("%s: Symbol `%s' has different size" \
" in shared object," \
" consider re-linking\n",
- _dl_argv[0] ?: "<program name unknown>",
+ rtld_progname ?: "<program name unknown>",
strtab + refsym->st_name);
}
memcpy (reloc_addr_arg, (char *) value,
diff --git a/libc/sysdeps/powerpc/powerpc64/dl-trampoline.S b/libc/sysdeps/powerpc/powerpc64/dl-trampoline.S
index 266efe38f..7bdabe017 100644
--- a/libc/sysdeps/powerpc/powerpc64/dl-trampoline.S
+++ b/libc/sysdeps/powerpc/powerpc64/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. PPC64 version.
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2005-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -169,7 +169,7 @@ END(_dl_runtime_resolve)
.section ".toc","aw"
.LC__dl_hwcap:
# ifdef SHARED
- .tc _rtld_global_ro[TC],_rtld_global_ro
+ .tc _rtld_local_ro[TC],_rtld_local_ro
# else
.tc _dl_hwcap[TC],_dl_hwcap
# endif
@@ -217,7 +217,7 @@ EALIGN(_dl_profile_resolve, 4, 0)
std r0,FRAME_SIZE+8(r1)
ld r12,.LC__dl_hwcap@toc(r2)
#ifdef SHARED
- /* Load _rtld-global._dl_hwcap. */
+ /* Load _rtld_local_ro._dl_hwcap. */
ld r12,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r12)
#else
ld r12,0(r12) /* Load extern _dl_hwcap. */
diff --git a/libc/sysdeps/powerpc/powerpc64/power4/Makefile b/libc/sysdeps/powerpc/powerpc64/power4/Makefile
index 60aa508ba..ba06adb5d 100644
--- a/libc/sysdeps/powerpc/powerpc64/power4/Makefile
+++ b/libc/sysdeps/powerpc/powerpc64/power4/Makefile
@@ -1,6 +1,6 @@
# Makefile fragment for POWER4/5/5+.
ifeq ($(subdir),string)
-CFLAGS-wordcopy.c += --param max-variable-expansions-in-unroller=2 --param max-unroll-times=2 -funroll-loops -fpeel-loops -ftree-loop-linear
-CFLAGS-memmove.c += --param max-variable-expansions-in-unroller=2 --param max-unroll-times=2 -funroll-loops -fpeel-loops -ftree-loop-linear
+CFLAGS-wordcopy.c += --param max-variable-expansions-in-unroller=2 --param max-unroll-times=2 -funroll-loops -fpeel-loops
+CFLAGS-memmove.c += --param max-variable-expansions-in-unroller=2 --param max-unroll-times=2 -funroll-loops -fpeel-loops
endif
diff --git a/libc/sysdeps/powerpc/powerpc64/power4/fpu/Makefile b/libc/sysdeps/powerpc/powerpc64/power4/fpu/Makefile
index 89dfa5ef3..f8bb3ef04 100644
--- a/libc/sysdeps/powerpc/powerpc64/power4/fpu/Makefile
+++ b/libc/sysdeps/powerpc/powerpc64/power4/fpu/Makefile
@@ -1,5 +1,5 @@
# Makefile fragment for POWER4/5/5+ platforms with FPU.
ifeq ($(subdir),math)
-CFLAGS-mpa.c += --param max-unroll-times=4 -funroll-loops -fpeel-loops -ftree-loop-linear
+CFLAGS-mpa.c += --param max-unroll-times=4 -funroll-loops -fpeel-loops
endif
diff --git a/libc/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S b/libc/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
index 0765d8a47..b632773eb 100644
--- a/libc/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
+++ b/libc/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
@@ -47,9 +47,12 @@ strong_alias (__copysign, __copysignl)
weak_alias (__copysign, copysignl)
#endif
-#ifndef IS_IN_libm
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, copysign, copysignl, GLIBC_2_0)
+# endif
+#else
# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
-compat_symbol (libc, __copysign, __copysignl, GLIBC_2_0);
compat_symbol (libc, copysign, copysignl, GLIBC_2_0);
# endif
#endif
diff --git a/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S b/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
index 319d07f81..7ab29482a 100644
--- a/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
+++ b/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
@@ -59,8 +59,13 @@ strong_alias (__finite, __finitef)
hidden_def (__finitef)
weak_alias (__finitef, finitef)
-#ifndef IS_IN_libm
-# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, __finite, __finitel, GLIBC_2_0)
+compat_symbol (libm, finite, finitel, GLIBC_2_0)
+# endif
+#else
+# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
compat_symbol (libc, finite, finitel, GLIBC_2_0);
# endif
diff --git a/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c b/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c
new file mode 100644
index 000000000..ff3a9e0c7
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logb.c
@@ -0,0 +1 @@
+#include <sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c>
diff --git a/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c b/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c
new file mode 100644
index 000000000..e79a28f77
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logbf.c
@@ -0,0 +1 @@
+#include <sysdeps/powerpc/powerpc32/power7/fpu/s_logbf.c>
diff --git a/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c b/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c
new file mode 100644
index 000000000..463e411b4
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_logbl.c
@@ -0,0 +1 @@
+#include <sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c>
diff --git a/libc/sysdeps/powerpc/powerpc64/setjmp-common.S b/libc/sysdeps/powerpc/powerpc64/setjmp-common.S
index 1a1326e36..bf8bb76f9 100644
--- a/libc/sysdeps/powerpc/powerpc64/setjmp-common.S
+++ b/libc/sysdeps/powerpc/powerpc64/setjmp-common.S
@@ -1,5 +1,5 @@
/* setjmp for PowerPC64.
- Copyright (C) 1995-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,7 +30,13 @@
.section ".toc","aw"
.LC__dl_hwcap:
# ifdef SHARED
+# ifdef IS_IN_rtld
+ /* Inside ld.so we use the local alias to avoid runtime GOT
+ relocations. */
+ .tc _rtld_local_ro[TC],_rtld_local_ro
+# else
.tc _rtld_global_ro[TC],_rtld_global_ro
+# endif
# else
.tc _dl_hwcap[TC],_dl_hwcap
# endif
diff --git a/libc/sysdeps/powerpc/powerpc64/stackguard-macros.h b/libc/sysdeps/powerpc/powerpc64/stackguard-macros.h
new file mode 100644
index 000000000..9da879c61
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc64/stackguard-macros.h
@@ -0,0 +1,4 @@
+#include <stdint.h>
+
+#define STACK_CHK_GUARD \
+ ({ uintptr_t x; asm ("ld %0,-28688(13)" : "=r" (x)); x; })
diff --git a/libc/sysdeps/powerpc/soft-fp/Makefile b/libc/sysdeps/powerpc/soft-fp/Makefile
deleted file mode 100644
index 3cb104e31..000000000
--- a/libc/sysdeps/powerpc/soft-fp/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-# Software floating-point emulation.
-# Makefile for PowerPC SVR4 ABI mandated long double utility
-# functions (_q_*).
-# Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-# Contributed by Jakub Jelinek (jj@ultra.linux.cz).
-#
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <http://www.gnu.org/licenses/>.
-
-ifeq ($(subdir),soft-fp)
-ifeq ($(sizeof-long-double),16)
-powerpc-quad-routines := q_add q_cmp q_cmpe q_div q_dtoq q_feq q_fge \
- q_fgt q_fle q_flt q_fne q_itoq q_mul q_neg q_qtod q_qtoi \
- q_qtos q_qtou q_qtoull q_qtoll q_sqrt q_stoq q_sub q_utoq \
- q_ulltoq q_lltoq q_util
-sysdep_routines += $(powerpc-quad-routines)
-endif
-endif
-
-ifeq ($(subdir),math)
-CPPFLAGS += -I../soft-fp/
-endif
diff --git a/libc/sysdeps/powerpc/soft-fp/Subdirs b/libc/sysdeps/powerpc/soft-fp/Subdirs
deleted file mode 100644
index 87eadf302..000000000
--- a/libc/sysdeps/powerpc/soft-fp/Subdirs
+++ /dev/null
@@ -1 +0,0 @@
-soft-fp
diff --git a/libc/sysdeps/powerpc/soft-fp/Versions b/libc/sysdeps/powerpc/soft-fp/Versions
deleted file mode 100644
index 935c9c8ef..000000000
--- a/libc/sysdeps/powerpc/soft-fp/Versions
+++ /dev/null
@@ -1,9 +0,0 @@
-libc {
- GLIBC_2.2 {
- _q_add; _q_cmp; _q_cmpe; _q_div; _q_dtoq; _q_feq; _q_fge; _q_fgt;
- _q_fle; _q_flt; _q_fne; _q_itoq; _q_mul; _q_neg; _q_qtod; _q_qtoi;
- _q_qtos; _q_qtou; _q_sqrt; _q_stoq; _q_sub;
- _q_utoq;
- _q_lltoq; _q_qtoll; _q_qtoull; _q_ulltoq;
- }
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_add.c b/libc/sysdeps/powerpc/soft-fp/q_add.c
deleted file mode 100644
index b7ddb98a9..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_add.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
- Return a + b
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _q_add(const long double a, const long double b)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C);
- long double c;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_SEMIRAW_Q(A, a);
- FP_UNPACK_SEMIRAW_Q(B, b);
- FP_ADD_Q(C, A, B);
- FP_PACK_SEMIRAW_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_cmp.c b/libc/sysdeps/powerpc/soft-fp/q_cmp.c
deleted file mode 100644
index 7f1ff9573..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_cmp.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Software floating-point emulation.
- Compare a and b, return float condition code.
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-int _q_cmp(const long double a, const long double b)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B);
- int r;
-
- FP_UNPACK_RAW_Q(A, a);
- FP_UNPACK_RAW_Q(B, b);
- FP_CMP_Q(r, B, A, 3);
- if (r == -1) r = 2;
- if (r == 3 && (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B)))
- FP_SET_EXCEPTION(FP_EX_INVALID);
- FP_HANDLE_EXCEPTIONS;
-
- return r;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_div.c b/libc/sysdeps/powerpc/soft-fp/q_div.c
deleted file mode 100644
index 1694b825b..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_div.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
- Return a / b
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _q_div(const long double a, const long double b)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C);
- long double c;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_Q(A, a);
- FP_UNPACK_Q(B, b);
- FP_DIV_Q(C, A, B);
- FP_PACK_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_fgt.c b/libc/sysdeps/powerpc/soft-fp/q_fgt.c
deleted file mode 100644
index 0cc7515c2..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_fgt.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Software floating-point emulation.
- Return 1 if a > b
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-int _q_fgt(const long double a, const long double b)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B);
- int r;
-
- FP_UNPACK_RAW_Q(A, a);
- FP_UNPACK_RAW_Q(B, b);
- FP_CMP_Q(r, B, A, 3);
- if (r == 3)
- FP_SET_EXCEPTION(FP_EX_INVALID);
- FP_HANDLE_EXCEPTIONS;
-
- return (r == -1);
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_fle.c b/libc/sysdeps/powerpc/soft-fp/q_fle.c
deleted file mode 100644
index 3a8270ee5..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_fle.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Software floating-point emulation.
- Return 1 if a <= b
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-int _q_fle(const long double a, const long double b)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B);
- int r;
-
- FP_UNPACK_RAW_Q(A, a);
- FP_UNPACK_RAW_Q(B, b);
- FP_CMP_Q(r, B, A, -2);
- if (r == -2)
- FP_SET_EXCEPTION(FP_EX_INVALID);
- FP_HANDLE_EXCEPTIONS;
-
- return (r >= 0);
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_flt.c b/libc/sysdeps/powerpc/soft-fp/q_flt.c
deleted file mode 100644
index 3a0acee53..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_flt.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Software floating-point emulation.
- Return 1 if a < b
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-int _q_flt(const long double a, const long double b)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B);
- int r;
-
- FP_UNPACK_RAW_Q(A, a);
- FP_UNPACK_RAW_Q(B, b);
- FP_CMP_Q(r, B, A, 3);
- if (r == 3)
- FP_SET_EXCEPTION(FP_EX_INVALID);
- FP_HANDLE_EXCEPTIONS;
-
- return (r == 1);
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_fne.c b/libc/sysdeps/powerpc/soft-fp/q_fne.c
deleted file mode 100644
index 7e17f78d5..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_fne.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Software floating-point emulation.
- Return 1 if a != b
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-int _q_fne(const long double a, const long double b)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B);
- int r;
-
- FP_UNPACK_RAW_Q(A, a);
- FP_UNPACK_RAW_Q(B, b);
- FP_CMP_EQ_Q(r, A, B);
- if (r && (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B)))
- FP_SET_EXCEPTION(FP_EX_INVALID);
- FP_HANDLE_EXCEPTIONS;
-
- return r;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_itoq.c b/libc/sysdeps/powerpc/soft-fp/q_itoq.c
deleted file mode 100644
index f58508b5c..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_itoq.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Software floating-point emulation.
- Return (long double)(a)
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _q_itoq(const int a)
-{
- FP_DECL_EX;
- FP_DECL_Q(C);
- int b = a;
- long double c;
-
- FP_FROM_INT_Q(C, b, 32, unsigned int);
- FP_PACK_RAW_Q(c, C);
- FP_CLEAR_EXCEPTIONS;
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_lltoq.c b/libc/sysdeps/powerpc/soft-fp/q_lltoq.c
deleted file mode 100644
index d496851ff..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_lltoq.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Software floating-point emulation.
- Return (long double)a
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _q_lltoq(const long long a)
-{
- FP_DECL_EX;
- FP_DECL_Q(C);
- long double c;
- long long b = a;
-
- FP_FROM_INT_Q(C, b, 64, unsigned long long);
- FP_PACK_RAW_Q(c, C);
- FP_CLEAR_EXCEPTIONS;
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_mul.c b/libc/sysdeps/powerpc/soft-fp/q_mul.c
deleted file mode 100644
index 9589f6bee..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_mul.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
- Return a * b
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _q_mul(const long double a, const long double b)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C);
- long double c;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_Q(A, a);
- FP_UNPACK_Q(B, b);
- FP_MUL_Q(C, A, B);
- FP_PACK_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_neg.c b/libc/sysdeps/powerpc/soft-fp/q_neg.c
deleted file mode 100644
index 6e89c89ef..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_neg.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Software floating-point emulation.
- Return !a
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _q_neg(const long double a)
-{
- FP_DECL_EX;
- long double c = a;
-
-#if (__BYTE_ORDER == __BIG_ENDIAN)
- ((UWtype *)&c)[0] ^= (((UWtype)1) << (W_TYPE_SIZE - 1));
-#elif (__BYTE_ORDER == __LITTLE_ENDIAN) && (W_TYPE_SIZE == 64)
- ((UWtype *)&c)[1] ^= (((UWtype)1) << (W_TYPE_SIZE - 1));
-#elif (__BYTE_ORDER == __LITTLE_ENDIAN) && (W_TYPE_SIZE == 32)
- ((UWtype *)&c)[3] ^= (((UWtype)1) << (W_TYPE_SIZE - 1));
-#else
- FP_DECL_Q(A); FP_DECL_Q(C);
-
- FP_UNPACK_Q(A, a);
- FP_NEG_Q(C, A);
- FP_PACK_Q(c, C);
-#endif
- FP_CLEAR_EXCEPTIONS;
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_stoq.c b/libc/sysdeps/powerpc/soft-fp/q_stoq.c
deleted file mode 100644
index e656b8f54..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_stoq.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Software floating-point emulation.
- c = (long double)(a)
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "single.h"
-#include "quad.h"
-
-long double _q_stoq(const float a)
-{
- FP_DECL_EX;
- FP_DECL_S(A);
- FP_DECL_Q(C);
- long double c;
-
- FP_UNPACK_RAW_S(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
- FP_EXTEND(Q,S,4,1,C,A);
-#else
- FP_EXTEND(Q,S,2,1,C,A);
-#endif
- FP_PACK_RAW_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_sub.c b/libc/sysdeps/powerpc/soft-fp/q_sub.c
deleted file mode 100644
index eedf2c2a3..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_sub.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Software floating-point emulation.
- c = a - b
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _q_sub(const long double a, const long double b)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(C);
- long double c;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_SEMIRAW_Q(A, a);
- FP_UNPACK_SEMIRAW_Q(B, b);
- FP_SUB_Q(C, A, B);
- FP_PACK_SEMIRAW_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_ulltoq.c b/libc/sysdeps/powerpc/soft-fp/q_ulltoq.c
deleted file mode 100644
index 818dcafb4..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_ulltoq.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Software floating-point emulation.
- Return (long double)a
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _q_ulltoq(const unsigned long long a)
-{
- FP_DECL_EX;
- FP_DECL_Q(C);
- long double c;
- unsigned long long b = a;
-
- FP_FROM_INT_Q(C, b, 64, unsigned long long);
- FP_PACK_RAW_Q(c, C);
- FP_CLEAR_EXCEPTIONS;
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_util.c b/libc/sysdeps/powerpc/soft-fp/q_util.c
deleted file mode 100644
index 301b95f63..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_util.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Software floating-point emulation.
- Helper routine for _q_* routines.
- Simulate exceptions using double arithmetics.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-
-unsigned long long ___q_numbers [] = {
-0x0000000000000000ULL, /* Zero */
-0x0010100000000000ULL, /* Very tiny number */
-0x0010000000000000ULL, /* Minimum normalized number */
-0x7fef000000000000ULL, /* A huge double number */
-};
-
-double ___q_simulate_exceptions(int exceptions)
-{
- double d, *p = (double *)___q_numbers;
- if (exceptions & FP_EX_INVALID)
- d = p[0]/p[0];
- if (exceptions & FP_EX_OVERFLOW)
- {
- d = p[3] + p[3];
- exceptions &= ~FP_EX_INEXACT;
- }
- if (exceptions & FP_EX_UNDERFLOW)
- {
- if (exceptions & FP_EX_INEXACT)
- {
- d = p[2] * p[2];
- exceptions &= ~FP_EX_INEXACT;
- }
- else
- d = p[1] - p[2];
- }
- if (exceptions & FP_EX_DIVZERO)
- d = 1.0/p[0];
- if (exceptions & FP_EX_INEXACT)
- d = p[3] - p[2];
- return d;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/q_utoq.c b/libc/sysdeps/powerpc/soft-fp/q_utoq.c
deleted file mode 100644
index 280734c0b..000000000
--- a/libc/sysdeps/powerpc/soft-fp/q_utoq.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Software floating-point emulation.
- c = (long double)(a)
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include "soft-fp.h"
-#include "quad.h"
-
-long double _q_uitoq(const unsigned int a)
-{
- FP_DECL_EX;
- FP_DECL_Q(C);
- long double c;
- unsigned int b = a;
-
- FP_FROM_INT_Q(C, b, 32, unsigned int);
- FP_PACK_RAW_Q(c, C);
- FP_CLEAR_EXCEPTIONS;
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
diff --git a/libc/sysdeps/powerpc/soft-fp/sfp-machine.h b/libc/sysdeps/powerpc/soft-fp/sfp-machine.h
deleted file mode 100644
index 44a9184f2..000000000
--- a/libc/sysdeps/powerpc/soft-fp/sfp-machine.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#define _FP_W_TYPE_SIZE 32
-#define _FP_W_TYPE unsigned long
-#define _FP_WS_TYPE signed long
-#define _FP_I_TYPE long
-
-#define _FP_MUL_MEAT_S(R,X,Y) \
- _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_D(R,X,Y) \
- _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_Q(R,X,Y) \
- _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
-
-#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y)
-#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
-#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
-
-#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
-#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
-#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
-#define _FP_NANSIGN_S 0
-#define _FP_NANSIGN_D 0
-#define _FP_NANSIGN_Q 0
-
-#define _FP_KEEPNANFRACP 1
-
-/* Someone please check this. */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
- do { \
- if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
- && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
- { \
- R##_s = Y##_s; \
- _FP_FRAC_COPY_##wc(R,Y); \
- } \
- else \
- { \
- R##_s = X##_s; \
- _FP_FRAC_COPY_##wc(R,X); \
- } \
- R##_c = FP_CLS_NAN; \
- } while (0)
-
-/* Exception flags. We use the bit positions of the appropriate bits
- in the FPSCR, which also correspond to the FE_* bits. This makes
- everything easier ;-). */
-#define FP_EX_INVALID (1 << (31 - 2))
-#define FP_EX_OVERFLOW (1 << (31 - 3))
-#define FP_EX_UNDERFLOW (1 << (31 - 4))
-#define FP_EX_DIVZERO (1 << (31 - 5))
-#define FP_EX_INEXACT (1 << (31 - 6))
-
-#define FP_HANDLE_EXCEPTIONS __simulate_exceptions (_fex)
-#define FP_ROUNDMODE __sim_round_mode
-
-extern int __sim_exceptions;
-libc_hidden_proto (__sim_exceptions);
-extern int __sim_disabled_exceptions;
-libc_hidden_proto (__sim_disabled_exceptions);
-extern int __sim_round_mode;
-libc_hidden_proto (__sim_round_mode);
-
-extern void __simulate_exceptions (int x) attribute_hidden;
diff --git a/libc/sysdeps/powerpc/sysdep.h b/libc/sysdeps/powerpc/sysdep.h
index 5cd8613d3..7682ae918 100644
--- a/libc/sysdeps/powerpc/sysdep.h
+++ b/libc/sysdeps/powerpc/sysdep.h
@@ -18,33 +18,10 @@
/*
* Powerpc Feature masks for the Aux Vector Hardware Capabilities (AT_HWCAP).
* This entry is copied to _dl_hwcap or rtld_global._dl_hwcap during startup.
- * The following must match the kernels linux/asm/cputable.h.
*/
-#define PPC_FEATURE_32 0x80000000 /* 32-bit mode. */
-#define PPC_FEATURE_64 0x40000000 /* 64-bit mode. */
-#define PPC_FEATURE_601_INSTR 0x20000000 /* 601 chip, Old POWER ISA. */
-#define PPC_FEATURE_HAS_ALTIVEC 0x10000000 /* SIMD/Vector Unit. */
-#define PPC_FEATURE_HAS_FPU 0x08000000 /* Floating Point Unit. */
-#define PPC_FEATURE_HAS_MMU 0x04000000 /* Memory Management Unit. */
-#define PPC_FEATURE_HAS_4xxMAC 0x02000000 /* 4xx Multiply Accumulator. */
-#define PPC_FEATURE_UNIFIED_CACHE 0x01000000 /* Unified I/D cache. */
-#define PPC_FEATURE_HAS_SPE 0x00800000 /* Signal Processing ext. */
-#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 /* SPE Float. */
-#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 /* SPE Double. */
-#define PPC_FEATURE_NO_TB 0x00100000 /* 601/403gx have no timebase */
-#define PPC_FEATURE_POWER4 0x00080000 /* POWER4 ISA 2.00 */
-#define PPC_FEATURE_POWER5 0x00040000 /* POWER5 ISA 2.02 */
-#define PPC_FEATURE_POWER5_PLUS 0x00020000 /* POWER5+ ISA 2.03 */
-#define PPC_FEATURE_CELL_BE 0x00010000 /* CELL Broadband Engine */
-#define PPC_FEATURE_BOOKE 0x00008000
-#define PPC_FEATURE_SMT 0x00004000 /* Simultaneous Multi-Threading */
-#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
-#define PPC_FEATURE_ARCH_2_05 0x00001000 /* ISA 2.05 */
-#define PPC_FEATURE_PA6T 0x00000800 /* PA Semi 6T Core */
-#define PPC_FEATURE_HAS_DFP 0x00000400 /* Decimal FP Unit */
-#define PPC_FEATURE_POWER6_EXT 0x00000200 /* P6 + mffgpr/mftgpr */
-#define PPC_FEATURE_ARCH_2_06 0x00000100 /* ISA 2.06 */
-#define PPC_FEATURE_HAS_VSX 0x00000080 /* P7 Vector Extension. */
+#define _SYS_AUXV_H
+#include <bits/hwcap.h>
+
#define PPC_FEATURE_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC)
#ifdef __ASSEMBLER__
diff --git a/libc/sysdeps/s390/fpu/libm-test-ulps b/libc/sysdeps/s390/fpu/libm-test-ulps
index 9dace19c1..5667d1b57 100644
--- a/libc/sysdeps/s390/fpu/libm-test-ulps
+++ b/libc/sysdeps/s390/fpu/libm-test-ulps
@@ -612,10 +612,10 @@ ifloat: 1
Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
ildouble: 1
ldouble: 1
-Test "Imaginary part of: cexp (1440 + 0x1p-1074 i) == inf + 1.196295853897226111293303155636183216483e302 i plus overflow exception":
+Test "Imaginary part of: cexp (1440 + 0x1p-1074 i) == inf + 1.196295853897226111293303155636183216483e302 i":
double: 1
idouble: 1
-Test "Imaginary part of: cexp (22730 + 0x1p-16434 i) == inf + 2.435706297811211974162115164702304105374e4924 i plus overflow exception":
+Test "Imaginary part of: cexp (22730 + 0x1p-16434 i) == inf + 2.435706297811211974162115164702304105374e4924 i":
ildouble: 1
ldouble: 1
Test "Real part of: cexp (50 + 0x1p127 i) == 4.053997150228616856622417636046265337193e21 + 3.232070315463388524466674772633810238819e21 i":
diff --git a/libc/sysdeps/s390/s390-32/stackguard-macros.h b/libc/sysdeps/s390/s390-32/stackguard-macros.h
new file mode 100644
index 000000000..b74c5799b
--- /dev/null
+++ b/libc/sysdeps/s390/s390-32/stackguard-macros.h
@@ -0,0 +1,4 @@
+#include <stdint.h>
+
+#define STACK_CHK_GUARD \
+ ({ uintptr_t x; asm ("ear %0,%%a0; l %0,0x14(%0)" : "=a" (x)); x; })
diff --git a/libc/sysdeps/s390/s390-64/stackguard-macros.h b/libc/sysdeps/s390/s390-64/stackguard-macros.h
new file mode 100644
index 000000000..0cebb5f02
--- /dev/null
+++ b/libc/sysdeps/s390/s390-64/stackguard-macros.h
@@ -0,0 +1,4 @@
+#include <stdint.h>
+
+#define STACK_CHK_GUARD \
+ ({ uintptr_t x; asm ("ear %0,%%a0; sllg %0,%0,32; ear %0,%%a1; lg %0,0x28(%0)" : "=a" (x)); x; })
diff --git a/libc/sysdeps/sparc/bits/hwcap.h b/libc/sysdeps/sparc/bits/hwcap.h
new file mode 100644
index 000000000..d922d7b0e
--- /dev/null
+++ b/libc/sysdeps/sparc/bits/hwcap.h
@@ -0,0 +1,47 @@
+/* Defines for bits in AT_HWCAP.
+ Copyright (C) 2011-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_AUXV_H
+# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
+#endif
+
+#define HWCAP_SPARC_FLUSH 0x00000001
+#define HWCAP_SPARC_STBAR 0x00000002
+#define HWCAP_SPARC_SWAP 0x00000004
+#define HWCAP_SPARC_MULDIV 0x00000008
+#define HWCAP_SPARC_V9 0x00000010
+#define HWCAP_SPARC_ULTRA3 0x00000020
+#define HWCAP_SPARC_BLKINIT 0x00000040
+#define HWCAP_SPARC_N2 0x00000080
+#define HWCAP_SPARC_MUL32 0x00000100
+#define HWCAP_SPARC_DIV32 0x00000200
+#define HWCAP_SPARC_FSMULD 0x00000400
+#define HWCAP_SPARC_V8PLUS 0x00000800
+#define HWCAP_SPARC_POPC 0x00001000
+#define HWCAP_SPARC_VIS 0x00002000
+#define HWCAP_SPARC_VIS2 0x00004000
+#define HWCAP_SPARC_ASI_BLK_INIT 0x00008000
+#define HWCAP_SPARC_FMAF 0x00010000
+#define HWCAP_SPARC_VIS3 0x00020000
+#define HWCAP_SPARC_HPC 0x00040000
+#define HWCAP_SPARC_RANDOM 0x00080000
+#define HWCAP_SPARC_TRANS 0x00100000
+#define HWCAP_SPARC_FJFMAU 0x00200000
+#define HWCAP_SPARC_IMA 0x00400000
+#define HWCAP_SPARC_ASI_CACHE_SPARING \
+ 0x00800000
diff --git a/libc/sysdeps/sparc/fpu/libm-test-ulps b/libc/sysdeps/sparc/fpu/libm-test-ulps
index c9030879d..d4e5e35bf 100644
--- a/libc/sysdeps/sparc/fpu/libm-test-ulps
+++ b/libc/sysdeps/sparc/fpu/libm-test-ulps
@@ -580,6 +580,38 @@ double: 1
idouble: 1
# ccos
+Test "Imaginary part of: ccos (-0.75 + 11357.25 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (-0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccos (-0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (-0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (-0.75 - 11357.25 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (-0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccos (-0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (-0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
ildouble: 1
ldouble: 1
@@ -596,8 +628,52 @@ ifloat: 1
Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
float: 1
ifloat: 1
+Test "Imaginary part of: ccos (0.75 + 11357.25 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccos (0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0.75 - 11357.25 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccos (0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (0x1p-1074 + 1440 i) == inf - 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (0x1p-16434 + 22730 i) == inf - 1.217853148905605987081057582351152052687e4924 i":
+ildouble: 1
+ldouble: 1
# ccosh
+Test "Imaginary part of: ccosh (-11357.25 + 0.75 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (-11357.25 - 0.75 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
float: 1
ifloat: 1
@@ -608,6 +684,32 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: ccosh (-710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (-710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccosh (-89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (-89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccosh (-89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (-89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
double: 1
float: 1
@@ -616,6 +718,44 @@ ifloat: 1
Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
float: 1
ifloat: 1
+Test "Imaginary part of: ccosh (11357.25 + 0.75 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (11357.25 - 0.75 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (22730 + 0x1p-16434 i) == inf + 1.217853148905605987081057582351152052687e4924 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccosh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccosh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
# cexp
Test "Imaginary part of: cexp (-10000 + 0x1p16383 i) == 1.045876464564882298442774542991176546722e-4343 + 4.421154026488516836023811173959413420548e-4344 i":
@@ -641,10 +781,10 @@ ifloat: 1
Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
ildouble: 1
ldouble: 1
-Test "Imaginary part of: cexp (1440 + 0x1p-1074 i) == inf + 1.196295853897226111293303155636183216483e302 i plus overflow exception":
+Test "Imaginary part of: cexp (1440 + 0x1p-1074 i) == inf + 1.196295853897226111293303155636183216483e302 i":
double: 1
idouble: 1
-Test "Imaginary part of: cexp (22730 + 0x1p-16434 i) == inf + 2.435706297811211974162115164702304105374e4924 i plus overflow exception":
+Test "Imaginary part of: cexp (22730 + 0x1p-16434 i) == inf + 2.435706297811211974162115164702304105374e4924 i":
ildouble: 1
ldouble: 1
Test "Real part of: cexp (50 + 0x1p127 i) == 4.053997150228616856622417636046265337193e21 + 3.232070315463388524466674772633810238819e21 i":
@@ -1027,26 +1167,166 @@ ildouble: 1
ldouble: 1
# csin
+Test "Real part of: csin (-0.75 + 11357.25 i) == -8.385498349388321535962327491346664141020e4931 + 9.001213196851067077465606717616495588201e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (-0.75 + 710.5 i) == -1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (-0.75 + 89.5 i) == -2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csin (-0.75 + 89.5 i) == -2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (-0.75 - 11357.25 i) == -8.385498349388321535962327491346664141020e4931 - 9.001213196851067077465606717616495588201e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (-0.75 - 710.5 i) == -1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (-0.75 - 89.5 i) == -2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csin (-0.75 - 89.5 i) == -2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
ildouble: 1
ldouble: 1
Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
ildouble: 1
ldouble: 1
+Test "Real part of: csin (0.75 + 11357.25 i) == 8.385498349388321535962327491346664141020e4931 + 9.001213196851067077465606717616495588201e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 + 710.5 i) == 1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 + 89.5 i) == 2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csin (0.75 + 89.5 i) == 2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 - 11357.25 i) == 8.385498349388321535962327491346664141020e4931 - 9.001213196851067077465606717616495588201e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 - 710.5 i) == 1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 - 89.5 i) == 2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csin (0.75 - 89.5 i) == 2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0x1p-1074 + 1440 i) == 5.981479269486130556466515778180916082415e301 + inf i":
+double: 1
+idouble: 1
+Test "Real part of: csin (0x1p-16434 + 22730 i) == 1.217853148905605987081057582351152052687e4924 + inf i":
+ildouble: 1
+ldouble: 1
# csinh
+Test "Imaginary part of: csinh (-11357.25 + 0.75 i) == -9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (-11357.25 - 0.75 i) == -9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
ildouble: 1
ldouble: 1
Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
double: 1
idouble: 1
+Test "Imaginary part of: csinh (-710.5 + 0.75 i) == -1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (-710.5 - 0.75 i) == -1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csinh (-89.5 + 0.75 i) == -2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (-89.5 + 0.75 i) == -2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csinh (-89.5 - 0.75 i) == -2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (-89.5 - 0.75 i) == -2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
float: 1
ifloat: 1
Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
float: 1
ifloat: 1
+Test "Imaginary part of: csinh (11357.25 + 0.75 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (11357.25 - 0.75 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (22730 + 0x1p-16434 i) == inf + 1.217853148905605987081057582351152052687e4924 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csinh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csinh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
# csqrt
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
@@ -2266,7 +2546,9 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "ccos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2280,7 +2562,9 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "ccosh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2392,6 +2676,10 @@ ildouble: 1
ldouble: 1
Function: Real part of "csin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -2410,6 +2698,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "csqrt":
double: 1
diff --git a/libc/sysdeps/sparc/sparc32/bits/wordsize.h b/libc/sysdeps/sparc/sparc32/bits/wordsize.h
index 0dee88b28..d8fd1a513 100644
--- a/libc/sysdeps/sparc/sparc32/bits/wordsize.h
+++ b/libc/sysdeps/sparc/sparc32/bits/wordsize.h
@@ -2,7 +2,7 @@
#if defined __arch64__ || defined __sparcv9
# define __WORDSIZE 64
-# define __WORDSIZE_COMPAT32 1
+# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
#endif
diff --git a/libc/sysdeps/sparc/sparc32/stackguard-macros.h b/libc/sysdeps/sparc/sparc32/stackguard-macros.h
new file mode 100644
index 000000000..c0b02b0bb
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/stackguard-macros.h
@@ -0,0 +1,4 @@
+#include <stdint.h>
+
+#define STACK_CHK_GUARD \
+ ({ uintptr_t x; asm ("ld [%%g7+0x14], %0" : "=r" (x)); x; })
diff --git a/libc/sysdeps/sparc/sparc64/bits/wordsize.h b/libc/sysdeps/sparc/sparc64/bits/wordsize.h
index 0dee88b28..d8fd1a513 100644
--- a/libc/sysdeps/sparc/sparc64/bits/wordsize.h
+++ b/libc/sysdeps/sparc/sparc64/bits/wordsize.h
@@ -2,7 +2,7 @@
#if defined __arch64__ || defined __sparcv9
# define __WORDSIZE 64
-# define __WORDSIZE_COMPAT32 1
+# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
#endif
diff --git a/libc/sysdeps/sparc/sparc64/stackguard-macros.h b/libc/sysdeps/sparc/sparc64/stackguard-macros.h
new file mode 100644
index 000000000..80f063558
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/stackguard-macros.h
@@ -0,0 +1,4 @@
+#include <stdint.h>
+
+#define STACK_CHK_GUARD \
+ ({ uintptr_t x; asm ("ldx [%%g7+0x28], %0" : "=r" (x)); x; })
diff --git a/libc/sysdeps/sparc/sysdep.h b/libc/sysdeps/sparc/sysdep.h
index bcffec94f..2d7b7f021 100644
--- a/libc/sysdeps/sparc/sysdep.h
+++ b/libc/sysdeps/sparc/sysdep.h
@@ -15,33 +15,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* Bits present in AT_HWCAP on SPARC. */
-
-#define HWCAP_SPARC_FLUSH 0x00000001
-#define HWCAP_SPARC_STBAR 0x00000002
-#define HWCAP_SPARC_SWAP 0x00000004
-#define HWCAP_SPARC_MULDIV 0x00000008
-#define HWCAP_SPARC_V9 0x00000010
-#define HWCAP_SPARC_ULTRA3 0x00000020
-#define HWCAP_SPARC_BLKINIT 0x00000040
-#define HWCAP_SPARC_N2 0x00000080
-#define HWCAP_SPARC_MUL32 0x00000100
-#define HWCAP_SPARC_DIV32 0x00000200
-#define HWCAP_SPARC_FSMULD 0x00000400
-#define HWCAP_SPARC_V8PLUS 0x00000800
-#define HWCAP_SPARC_POPC 0x00001000
-#define HWCAP_SPARC_VIS 0x00002000
-#define HWCAP_SPARC_VIS2 0x00004000
-#define HWCAP_SPARC_ASI_BLK_INIT 0x00008000
-#define HWCAP_SPARC_FMAF 0x00010000
-#define HWCAP_SPARC_VIS3 0x00020000
-#define HWCAP_SPARC_HPC 0x00040000
-#define HWCAP_SPARC_RANDOM 0x00080000
-#define HWCAP_SPARC_TRANS 0x00100000
-#define HWCAP_SPARC_FJFMAU 0x00200000
-#define HWCAP_SPARC_IMA 0x00400000
-#define HWCAP_SPARC_ASI_CACHE_SPARING \
- 0x00800000
+#define _SYS_AUXV_H 1
+#include <bits/hwcap.h>
#ifdef __ASSEMBLER__
diff --git a/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h b/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
index 1c763c247..02c24e44c 100644
--- a/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
+++ b/libc/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. FreeBSD version.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,6 +44,7 @@
#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __FSWORD_T_TYPE __SWORD_TYPE
#define __ID_T_TYPE __U32_TYPE
#define __CLOCK_T_TYPE __S32_TYPE
#define __TIME_T_TYPE __SLONGWORD_TYPE
@@ -57,7 +58,8 @@
#define __BLKSIZE_T_TYPE __U32_TYPE
#define __FSID_T_TYPE struct { int __val[2]; }
#define __SSIZE_T_TYPE __SWORD_TYPE
-#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
diff --git a/libc/sysdeps/unix/make-syscalls.sh b/libc/sysdeps/unix/make-syscalls.sh
index ff452d678..cedce3193 100644
--- a/libc/sysdeps/unix/make-syscalls.sh
+++ b/libc/sysdeps/unix/make-syscalls.sh
@@ -54,11 +54,9 @@ while read file caller rest; do
for dir in $sysdirs; do
{ test -f $dir/$file.c && srcfile=$dir/$file.c; } ||
{ test -f $dir/$file.S && srcfile=$dir/$file.S; } ||
- { test -f $dir/$file.s && srcfile=$dir/$file.s; } ||
{ test x$caller != x- &&
{ { test -f $dir/$caller.c && srcfile=$dir/$caller.c; } ||
- { test -f $dir/$caller.S && srcfile=$dir/$caller.S; } ||
- { test -f $dir/$caller.s && srcfile=$dir/$caller.s; }; }; } && break;
+ { test -f $dir/$caller.S && srcfile=$dir/$caller.S; }; }; } && break;
done;
echo $file $srcfile $caller $rest;
done`
@@ -66,10 +64,67 @@ done`
# Any calls left?
test -n "$calls" || exit 0
+# This uses variables $weak and $strong.
+emit_weak_aliases()
+{
+ # A shortcoming in the current gas is that it will only allow one
+ # version-alias per symbol. So we create new strong aliases as needed.
+ vcount=""
+
+ for name in $weak; do
+ case $name in
+ *@@*)
+ base=`echo $name | sed 's/@@.*//'`
+ ver=`echo $name | sed 's/.*@@//'`
+ if test -z "$vcount" ; then
+ source=$strong
+ vcount=1
+ else
+ source="${strong}_${vcount}"
+ vcount=`expr $vcount + 1`
+ echo " echo 'strong_alias ($strong, $source)'; \\"
+ fi
+ echo " echo 'default_symbol_version($source, $base, $ver)'; \\"
+ ;;
+ *@*)
+ base=`echo $name | sed 's/@.*//'`
+ ver=`echo $name | sed 's/.*@//'`
+ if test -z "$vcount" ; then
+ source=$strong
+ vcount=1
+ else
+ source="${strong}_${vcount}"
+ vcount=`expr $vcount + 1`
+ echo " echo 'strong_alias ($strong, $source)'; \\"
+ fi
+ echo " echo 'symbol_version ($source, $base, $ver)'; \\"
+ ;;
+ !*)
+ name=`echo $name | sed 's/.//'`
+ echo " echo 'strong_alias ($strong, $name)'; \\"
+ echo " echo 'libc_hidden_def ($name)'; \\"
+ ;;
+ *)
+ echo " echo 'weak_alias ($strong, $name)'; \\"
+ echo " echo 'libc_hidden_weak ($name)'; \\"
+ ;;
+ esac
+ done
+}
+
+
# Emit rules to compile the syscalls remaining in $calls.
echo "$calls" |
while read file srcfile caller syscall args strong weak; do
+ vdso_syscall=
+ case x"$syscall" in
+ *:*@*)
+ vdso_syscall="${syscall#*:}"
+ syscall="${syscall%:*}"
+ ;;
+ esac
+
case x"$syscall" in
x-) callnum=_ ;;
*)
@@ -146,13 +201,14 @@ while read file srcfile caller syscall args strong weak; do
# Emit a compilation rule for this syscall.
if test $shared_only = t; then
# The versioned symbols are only in the shared library.
- echo "\
-shared-only-routines += $file
-\$(objpfx)${file}.os: \\"
+ echo "shared-only-routines += $file"
+ test -n "$vdso_syscall" || echo "\$(objpfx)${file}.os: \\"
else
+ object_suffixes='$(object-suffixes)'
+ test -z "$vdso_syscall" || object_suffixes='$(object-suffixes-noshared)'
echo "\
\$(foreach p,\$(sysd-rules-targets),\
-\$(foreach o,\$(object-suffixes),\$(objpfx)\$(patsubst %,\$p,$file)\$o)): \\"
+\$(foreach o,${object_suffixes},\$(objpfx)\$(patsubst %,\$p,$file)\$o)): \\"
fi
echo " \$(..)sysdeps/unix/make-syscalls.sh"
@@ -180,55 +236,43 @@ shared-only-routines += $file
esac
# Append any weak aliases or versions defined for this syscall function.
-
- # A shortcoming in the current gas is that it will only allow one
- # version-alias per symbol. So we create new strong aliases as needed.
- vcount=""
-
- for name in $weak; do
- case $name in
- *@@*)
- base=`echo $name | sed 's/@@.*//'`
- ver=`echo $name | sed 's/.*@@//'`
- if test -z "$vcount" ; then
- source=$strong
- vcount=1
- else
- source="${strong}_${vcount}"
- vcount=`expr $vcount + 1`
- echo " echo 'strong_alias ($strong, $source)'; \\"
- fi
- echo " echo 'default_symbol_version($source, $base, $ver)'; \\"
- ;;
- *@*)
- base=`echo $name | sed 's/@.*//'`
- ver=`echo $name | sed 's/.*@//'`
- if test -z "$vcount" ; then
- source=$strong
- vcount=1
- else
- source="${strong}_${vcount}"
- vcount=`expr $vcount + 1`
- echo " echo 'strong_alias ($strong, $source)'; \\"
- fi
- echo " echo 'symbol_version ($source, $base, $ver)'; \\"
- ;;
- !*)
- name=`echo $name | sed 's/.//'`
- echo " echo 'strong_alias ($strong, $name)'; \\"
- echo " echo 'libc_hidden_def ($name)'; \\"
- ;;
- *)
- echo " echo 'weak_alias ($strong, $name)'; \\"
- echo " echo 'libc_hidden_weak ($name)'; \\"
- ;;
- esac
- done
+ emit_weak_aliases
# And finally, pipe this all into the compiler.
echo ' ) | $(compile-syscall) '"\
\$(foreach p,\$(patsubst %$file,%,\$(basename \$(@F))),\$(\$(p)CPPFLAGS))"
+ if test -n "$vdso_syscall"; then
+ # In the shared library, we're going to emit an IFUNC using a vDSO function.
+ # $vdso_syscall looks like "name@KERNEL_X.Y" where "name" is the symbol
+ # name in the vDSO and KERNEL_X.Y is its symbol version.
+ vdso_symbol="${vdso_syscall%@*}"
+ vdso_symver="${vdso_syscall#*@}"
+ vdso_symver="${vdso_symver//./_}"
+ echo "\
+\$(foreach p,\$(sysd-rules-targets),\$(objpfx)\$(patsubst %,\$p,$file).os): \\
+ \$(..)sysdeps/unix/make-syscalls.sh\
+ \$(make-target-directory)
+ (echo '#include <dl-vdso.h>'; \\
+ echo 'extern void *${strong}_ifunc (void) __asm (\"${strong}\");'; \\
+ echo 'void *'; \\
+ echo '${strong}_ifunc (void)'; \\
+ echo '{'; \\
+ echo ' PREPARE_VERSION_KNOWN (symver, ${vdso_symver});'; \\
+ echo ' return _dl_vdso_vsym (\"${vdso_symbol}\", &symver);'; \\
+ echo '}'; \\
+ echo 'asm (\".type ${strong}, %gnu_indirect_function\");'; \\"
+ # This is doing "libc_hidden_def (${strong})", but the compiler
+ # doesn't know that we've defined ${strong} in the same file, so
+ # we can't do it the normal way.
+ echo "\
+ echo 'asm (\".globl __GI_${strong}\\n\"'; \\
+ echo ' \"__GI_${strong} = ${strong}\");'; \\"
+ emit_weak_aliases
+ echo ' ) | $(compile-stdin.c) '"\
+\$(foreach p,\$(patsubst %$file,%,\$(basename \$(@F))),\$(\$(p)CPPFLAGS))"
+ fi
+
if test $shared_only = t; then
# The versioned symbols are only in the shared library.
echo endif
diff --git a/libc/sysdeps/unix/syscalls.list b/libc/sysdeps/unix/syscalls.list
index 39c40ed7f..bd780f569 100644
--- a/libc/sysdeps/unix/syscalls.list
+++ b/libc/sysdeps/unix/syscalls.list
@@ -26,7 +26,7 @@ getpid - getpid Ei: __getpid getpid
getpriority - getpriority i:ii getpriority
getrlimit - getrlimit i:ip __getrlimit getrlimit
getrusage - getrusage i:ip __getrusage getrusage
-gettimeofday - gettimeofday i:PP __gettimeofday gettimeofday __gettimeofday_internal
+gettimeofday - gettimeofday i:pP __gettimeofday gettimeofday
getuid - getuid Ei: __getuid getuid
ioctl - ioctl i:iiI __ioctl ioctl
kill - kill i:ii __kill kill
diff --git a/libc/sysdeps/unix/sysv/linux/Makefile b/libc/sysdeps/unix/sysv/linux/Makefile
index 120d54428..70fd137db 100644
--- a/libc/sysdeps/unix/sysv/linux/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/Makefile
@@ -17,7 +17,9 @@ sysdep_routines += internal_accept4 recvmmsg internal_recvmmsg sendmmsg \
endif
ifeq ($(subdir),misc)
-sysdep_routines += sysctl clone llseek umount umount2 readahead \
+include $(firstword $(wildcard $(sysdirs:=/sysctl.mk)))
+
+sysdep_routines += clone llseek umount umount2 readahead \
setfsuid setfsgid makedev epoll_pwait signalfd \
eventfd eventfd_read eventfd_write prlimit
diff --git a/libc/sysdeps/unix/sysv/linux/bits/in.h b/libc/sysdeps/unix/sysv/linux/bits/in.h
index 672757e66..4686ae217 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/in.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2000,2004,2008,2010,2011 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -50,6 +50,8 @@
# define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */
# define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr*/
# define MCAST_MSFILTER 48
+# define IP_MULTICAST_ALL 49
+# define IP_UNICAST_IF 50
# define MCAST_EXCLUDE 0
# define MCAST_INCLUDE 1
diff --git a/libc/sysdeps/unix/sysv/linux/bits/ipc.h b/libc/sysdeps/unix/sysv/linux/bits/ipc.h
index 3bd5f1b6f..f1d5d37af 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/ipc.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -50,6 +50,6 @@ struct ipc_perm
unsigned short int __pad1;
unsigned short int __seq; /* Sequence number. */
unsigned short int __pad2;
- unsigned long int __unused1;
- unsigned long int __unused2;
+ __syscall_ulong_t __unused1;
+ __syscall_ulong_t __unused2;
};
diff --git a/libc/sysdeps/unix/sysv/linux/bits/mqueue.h b/libc/sysdeps/unix/sysv/linux/bits/mqueue.h
index e755f8722..c21246d16 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/mqueue.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/mqueue.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,13 +19,15 @@
# error "Never use <bits/mqueue.h> directly; include <mqueue.h> instead."
#endif
+#include <bits/types.h>
+
typedef int mqd_t;
struct mq_attr
{
- long int mq_flags; /* Message queue flags. */
- long int mq_maxmsg; /* Maximum number of messages. */
- long int mq_msgsize; /* Maximum message size. */
- long int mq_curmsgs; /* Number of messages currently queued. */
- long int __pad[4];
+ __syscall_slong_t mq_flags; /* Message queue flags. */
+ __syscall_slong_t mq_maxmsg; /* Maximum number of messages. */
+ __syscall_slong_t mq_msgsize; /* Maximum message size. */
+ __syscall_slong_t mq_curmsgs; /* Number of messages currently queued. */
+ __syscall_slong_t __pad[4];
};
diff --git a/libc/sysdeps/unix/sysv/linux/bits/resource.h b/libc/sysdeps/unix/sysv/linux/bits/resource.h
index be852e524..62cb25741 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/resource.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/resource.h
@@ -1,6 +1,5 @@
/* Bit values & structures for resource limits. Linux version.
- Copyright (C) 1994, 1996-2000, 2004, 2005, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1994-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -113,7 +112,7 @@ enum __rlimit_resource
/* Value to indicate that there is no limit. */
#ifndef __USE_FILE_OFFSET64
-# define RLIM_INFINITY ((unsigned long int)(~0UL))
+# define RLIM_INFINITY ((__rlim_t) -1)
#else
# define RLIM_INFINITY 0xffffffffffffffffuLL
#endif
@@ -180,6 +179,11 @@ enum __rusage_who
#include <bits/time.h> /* For `struct timeval'. */
/* Structure which says how much of each resource has been used. */
+
+/* The purpose of all the unions is to have the kernel-compatible layout
+ while keeping the API type as 'long int', and among machines where
+ __syscall_slong_t is not 'long int', this only does the right thing
+ for little-endian ones, like x32. */
struct rusage
{
/* Total amount of user time used. */
@@ -187,39 +191,96 @@ struct rusage
/* Total amount of system time used. */
struct timeval ru_stime;
/* Maximum resident set size (in kilobytes). */
- long int ru_maxrss;
+ __extension__ union
+ {
+ long int ru_maxrss;
+ __syscall_slong_t __ru_maxrss_word;
+ };
/* Amount of sharing of text segment memory
with other processes (kilobyte-seconds). */
- long int ru_ixrss;
+ /* Maximum resident set size (in kilobytes). */
+ __extension__ union
+ {
+ long int ru_ixrss;
+ __syscall_slong_t __ru_ixrss_word;
+ };
/* Amount of data segment memory used (kilobyte-seconds). */
- long int ru_idrss;
+ __extension__ union
+ {
+ long int ru_idrss;
+ __syscall_slong_t __ru_idrss_word;
+ };
/* Amount of stack memory used (kilobyte-seconds). */
- long int ru_isrss;
+ __extension__ union
+ {
+ long int ru_isrss;
+ __syscall_slong_t __ru_isrss_word;
+ };
/* Number of soft page faults (i.e. those serviced by reclaiming
a page from the list of pages awaiting reallocation. */
- long int ru_minflt;
+ __extension__ union
+ {
+ long int ru_minflt;
+ __syscall_slong_t __ru_minflt_word;
+ };
/* Number of hard page faults (i.e. those that required I/O). */
- long int ru_majflt;
+ __extension__ union
+ {
+ long int ru_majflt;
+ __syscall_slong_t __ru_majflt_word;
+ };
/* Number of times a process was swapped out of physical memory. */
- long int ru_nswap;
+ __extension__ union
+ {
+ long int ru_nswap;
+ __syscall_slong_t __ru_nswap_word;
+ };
/* Number of input operations via the file system. Note: This
and `ru_oublock' do not include operations with the cache. */
- long int ru_inblock;
+ __extension__ union
+ {
+ long int ru_inblock;
+ __syscall_slong_t __ru_inblock_word;
+ };
/* Number of output operations via the file system. */
- long int ru_oublock;
+ __extension__ union
+ {
+ long int ru_oublock;
+ __syscall_slong_t __ru_oublock_word;
+ };
/* Number of IPC messages sent. */
- long int ru_msgsnd;
+ __extension__ union
+ {
+ long int ru_msgsnd;
+ __syscall_slong_t __ru_msgsnd_word;
+ };
/* Number of IPC messages received. */
- long int ru_msgrcv;
+ __extension__ union
+ {
+ long int ru_msgrcv;
+ __syscall_slong_t __ru_msgrcv_word;
+ };
/* Number of signals delivered. */
- long int ru_nsignals;
+ __extension__ union
+ {
+ long int ru_nsignals;
+ __syscall_slong_t __ru_nsignals_word;
+ };
/* Number of voluntary context switches, i.e. because the process
gave up the process before it had to (usually to wait for some
resource to be available). */
- long int ru_nvcsw;
+ __extension__ union
+ {
+ long int ru_nvcsw;
+ __syscall_slong_t __ru_nvcsw_word;
+ };
/* Number of involuntary context switches, i.e. a higher priority process
became runnable or the current process used up its time slice. */
- long int ru_nivcsw;
+ __extension__ union
+ {
+ long int ru_nivcsw;
+ __syscall_slong_t __ru_nivcsw_word;
+ };
};
/* Priority limits. */
diff --git a/libc/sysdeps/unix/sysv/linux/bits/statfs.h b/libc/sysdeps/unix/sysv/linux/bits/statfs.h
index 5019eb1b8..bfff7723b 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/statfs.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/statfs.h
@@ -23,8 +23,8 @@
struct statfs
{
- __SWORD_TYPE f_type;
- __SWORD_TYPE f_bsize;
+ __fsword_t f_type;
+ __fsword_t f_bsize;
#ifndef __USE_FILE_OFFSET64
__fsblkcnt_t f_blocks;
__fsblkcnt_t f_bfree;
@@ -39,27 +39,27 @@ struct statfs
__fsfilcnt64_t f_ffree;
#endif
__fsid_t f_fsid;
- __SWORD_TYPE f_namelen;
- __SWORD_TYPE f_frsize;
- __SWORD_TYPE f_flags;
- __SWORD_TYPE f_spare[4];
+ __fsword_t f_namelen;
+ __fsword_t f_frsize;
+ __fsword_t f_flags;
+ __fsword_t f_spare[4];
};
#ifdef __USE_LARGEFILE64
struct statfs64
{
- __SWORD_TYPE f_type;
- __SWORD_TYPE f_bsize;
+ __fsword_t f_type;
+ __fsword_t f_bsize;
__fsblkcnt64_t f_blocks;
__fsblkcnt64_t f_bfree;
__fsblkcnt64_t f_bavail;
__fsfilcnt64_t f_files;
__fsfilcnt64_t f_ffree;
__fsid_t f_fsid;
- __SWORD_TYPE f_namelen;
- __SWORD_TYPE f_frsize;
- __SWORD_TYPE f_flags;
- __SWORD_TYPE f_spare[4];
+ __fsword_t f_namelen;
+ __fsword_t f_frsize;
+ __fsword_t f_flags;
+ __fsword_t f_spare[4];
};
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/bits/statvfs.h b/libc/sysdeps/unix/sysv/linux/bits/statvfs.h
index 4b3fc5733..d835dff01 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/statvfs.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/statvfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,2000,2001,2002,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,8 @@
#include <bits/types.h> /* For __fsblkcnt_t and __fsfilcnt_t. */
-#if __WORDSIZE == 32
+#if (__WORDSIZE == 32 \
+ && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
#define _STATVFSBUF_F_UNUSED
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/bits/sysctl.h b/libc/sysdeps/unix/sysv/linux/bits/sysctl.h
new file mode 100644
index 000000000..81447b2f7
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/bits/sysctl.h
@@ -0,0 +1 @@
+/* Empty file. */
diff --git a/libc/sysdeps/unix/sysv/linux/bits/timex.h b/libc/sysdeps/unix/sysv/linux/bits/timex.h
index 6d494b157..0d733f090 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/timex.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/timex.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-1997,1999,2007,2009,2011 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,32 +18,33 @@
#ifndef _BITS_TIMEX_H
#define _BITS_TIMEX_H 1
+#include <bits/types.h>
+
/* These definitions from linux/timex.h as of 2.6.30. */
struct timex
{
- unsigned int modes; /* mode selector */
- long int offset; /* time offset (usec) */
- long int freq; /* frequency offset (scaled ppm) */
- long int maxerror; /* maximum error (usec) */
- long int esterror; /* estimated error (usec) */
- int status; /* clock command/status */
- long int constant; /* pll time constant */
- long int precision; /* clock precision (usec) (read only) */
- long int tolerance; /* clock frequency tolerance (ppm) (read only) */
- struct timeval time; /* (read only) */
- long int tick; /* (modified) usecs between clock ticks */
-
- long int ppsfreq; /* pps frequency (scaled ppm) (ro) */
- long int jitter; /* pps jitter (us) (ro) */
- int shift; /* interval duration (s) (shift) (ro) */
- long int stabil; /* pps stability (scaled ppm) (ro) */
- long int jitcnt; /* jitter limit exceeded (ro) */
- long int calcnt; /* calibration intervals (ro) */
- long int errcnt; /* calibration errors (ro) */
- long int stbcnt; /* stability limit exceeded (ro) */
-
- int tai; /* TAI offset (ro) */
+ unsigned int modes; /* mode selector */
+ __syscall_slong_t offset; /* time offset (usec) */
+ __syscall_slong_t freq; /* frequency offset (scaled ppm) */
+ __syscall_slong_t maxerror; /* maximum error (usec) */
+ __syscall_slong_t esterror; /* estimated error (usec) */
+ int status; /* clock command/status */
+ __syscall_slong_t constant; /* pll time constant */
+ __syscall_slong_t precision; /* clock precision (usec) (ro) */
+ __syscall_slong_t tolerance; /* clock frequency tolerance (ppm) (ro) */
+ struct timeval time; /* (read only) */
+ __syscall_slong_t tick; /* (modified) usecs between clock ticks */
+ __syscall_slong_t ppsfreq; /* pps frequency (scaled ppm) (ro) */
+ __syscall_slong_t jitter; /* pps jitter (us) (ro) */
+ int shift; /* interval duration (s) (shift) (ro) */
+ __syscall_slong_t stabil; /* pps stability (scaled ppm) (ro) */
+ __syscall_slong_t jitcnt; /* jitter limit exceeded (ro) */
+ __syscall_slong_t calcnt; /* calibration intervals (ro) */
+ __syscall_slong_t errcnt; /* calibration errors (ro) */
+ __syscall_slong_t stbcnt; /* stability limit exceeded (ro) */
+
+ int tai; /* TAI offset (ro) */
/* ??? */
int :32; int :32; int :32; int :32;
diff --git a/libc/sysdeps/unix/sysv/linux/check_pf.c b/libc/sysdeps/unix/sysv/linux/check_pf.c
index 7d839062d..793d27db4 100644
--- a/libc/sysdeps/unix/sysv/linux/check_pf.c
+++ b/libc/sysdeps/unix/sysv/linux/check_pf.c
@@ -61,7 +61,7 @@ static struct cached_data noai6ai_cached =
.in6ailen = 0
};
-static struct cached_data *cache;
+libc_freeres_ptr (static struct cached_data *cache);
__libc_lock_define_initialized (static, lock);
diff --git a/libc/sysdeps/unix/sysv/linux/configure b/libc/sysdeps/unix/sysv/linux/configure
index d571d0b62..ef2f71578 100644
--- a/libc/sysdeps/unix/sysv/linux/configure
+++ b/libc/sysdeps/unix/sysv/linux/configure
@@ -284,25 +284,25 @@ test -n "$arch_minimum_kernel" ||
case "$machine" in
i386*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.0.10
+ arch_minimum_kernel=2.4.0
;;
powerpc/powerpc32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.0.10
+ arch_minimum_kernel=2.4.0
;;
powerpc/powerpc64)
arch_minimum_kernel=2.4.21
;;
s390/s390-32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.2.10
+ arch_minimum_kernel=2.4.0
;;
s390/s390-64)
libc_cv_gcc_unwind_find_fde=yes
arch_minimum_kernel=2.4.0
;;
sh*)
- arch_minimum_kernel=2.3.99
+ arch_minimum_kernel=2.4.0
libc_cv_gcc_unwind_find_fde=yes
;;
sparc/sparc64*)
@@ -311,13 +311,10 @@ case "$machine" in
;;
sparc*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.0.10
- ;;
- x86_64*)
arch_minimum_kernel=2.4.0
;;
*)
- arch_minimum_kernel=2.0.10
+ arch_minimum_kernel=2.4.0
;;
esac
if test -n "$minimum_kernel"; then
@@ -331,17 +328,14 @@ $as_echo "$as_me: WARNING: minimum kernel version reset to $arch_minimum_kernel"
minimum_kernel=$arch_minimum_kernel
fi
else
- if test $arch_minimum_kernel != '2.0.10'; then
- minimum_kernel=$arch_minimum_kernel
- fi
+ minimum_kernel=$arch_minimum_kernel
fi
-if test -n "$minimum_kernel"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5
$as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; }
- decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
- abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <linux/version.h>
#if LINUX_VERSION_CODE < $decnum
@@ -356,21 +350,20 @@ else
fi
rm -f conftest*
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
$as_echo "$libc_minimum_kernel" >&6; }
- if test "$libc_minimum_kernel" = ok; then
- cat >>confdefs.h <<_ACEOF
+if test "$libc_minimum_kernel" = ok; then
+ cat >>confdefs.h <<_ACEOF
#define __LINUX_KERNEL_VERSION $decnum
_ACEOF
- cat >>confdefs.h <<_ACEOF
+ cat >>confdefs.h <<_ACEOF
#define __ABI_TAG_VERSION $abinum
_ACEOF
- else
- as_fn_error $? "*** The available kernel headers are older than the requested
+else
+ as_fn_error $? "*** The available kernel headers are older than the requested
*** compatible kernel version" "$LINENO" 5
- fi
fi
# The result of the above test for the use of the FDE code is invalid if
diff --git a/libc/sysdeps/unix/sysv/linux/configure.in b/libc/sysdeps/unix/sysv/linux/configure.in
index 916d64a60..c3ec328b9 100644
--- a/libc/sysdeps/unix/sysv/linux/configure.in
+++ b/libc/sysdeps/unix/sysv/linux/configure.in
@@ -41,25 +41,25 @@ test -n "$arch_minimum_kernel" ||
case "$machine" in
i386*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.0.10
+ arch_minimum_kernel=2.4.0
;;
powerpc/powerpc32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.0.10
+ arch_minimum_kernel=2.4.0
;;
powerpc/powerpc64)
arch_minimum_kernel=2.4.21
;;
s390/s390-32)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.2.10
+ arch_minimum_kernel=2.4.0
;;
s390/s390-64)
libc_cv_gcc_unwind_find_fde=yes
arch_minimum_kernel=2.4.0
;;
sh*)
- arch_minimum_kernel=2.3.99
+ arch_minimum_kernel=2.4.0
libc_cv_gcc_unwind_find_fde=yes
;;
sparc/sparc64*)
@@ -68,13 +68,10 @@ case "$machine" in
;;
sparc*)
libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.0.10
- ;;
- x86_64*)
arch_minimum_kernel=2.4.0
;;
*)
- arch_minimum_kernel=2.0.10
+ arch_minimum_kernel=2.4.0
;;
esac
if test -n "$minimum_kernel"; then
@@ -87,29 +84,25 @@ if test -n "$minimum_kernel"; then
minimum_kernel=$arch_minimum_kernel
fi
else
- if test $arch_minimum_kernel != '2.0.10'; then
- minimum_kernel=$arch_minimum_kernel
- fi
+ minimum_kernel=$arch_minimum_kernel
fi
-if test -n "$minimum_kernel"; then
- AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
+AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
changequote(,)dnl
- decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
- abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
+decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
changequote([,])dnl
- AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
+AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
#if LINUX_VERSION_CODE < $decnum
eat flaming death
#endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
- AC_MSG_RESULT($libc_minimum_kernel)
- if test "$libc_minimum_kernel" = ok; then
- AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
- AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
- else
- AC_MSG_ERROR([*** The available kernel headers are older than the requested
+AC_MSG_RESULT($libc_minimum_kernel)
+if test "$libc_minimum_kernel" = ok; then
+ AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
+ AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
+else
+ AC_MSG_ERROR([*** The available kernel headers are older than the requested
*** compatible kernel version])
- fi
fi
# The result of the above test for the use of the FDE code is invalid if
diff --git a/libc/sysdeps/unix/sysv/linux/dl-osinfo.h b/libc/sysdeps/unix/sysv/linux/dl-osinfo.h
index d0f41a7b2..82d6e22ae 100644
--- a/libc/sysdeps/unix/sysv/linux/dl-osinfo.h
+++ b/libc/sysdeps/unix/sysv/linux/dl-osinfo.h
@@ -1,5 +1,5 @@
/* Operating system specific code for generic dynamic loader functions. Linux.
- Copyright (C) 2000-2002,2004-2009,2011 Free Software Foundation, Inc.
+ Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,18 +27,6 @@
# define MIN(a,b) (((a)<(b))?(a):(b))
#endif
-#ifdef SHARED
-/* This is the function used in the dynamic linker to print the fatal error
- message. */
-static void
-__attribute__ ((__noreturn__))
-dl_fatal (const char *str)
-{
- _dl_dprintf (2, str);
- _exit (1);
-}
-#endif
-
#define DL_SYSDEP_OSCHECK(FATAL) \
do { \
/* Test whether the kernel is new enough. This test is only performed \
diff --git a/libc/sysdeps/unix/sysv/linux/dl-vdso.h b/libc/sysdeps/unix/sysv/linux/dl-vdso.h
index 03f03788b..4149bacdc 100644
--- a/libc/sysdeps/unix/sysv/linux/dl-vdso.h
+++ b/libc/sysdeps/unix/sysv/linux/dl-vdso.h
@@ -1,5 +1,5 @@
/* ELF symbol resolve functions for VDSO objects.
- Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2005-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,13 +21,7 @@
#include <assert.h>
#include <ldsodefs.h>
-
-#ifdef NDEBUG
-# define CHECK_HASH(var) do {} while (0)
-#else
-# include <dl-hash.h>
-# define CHECK_HASH(var) assert (var.hash == _dl_elf_hash (var.name))
-#endif
+#include <dl-hash.h>
/* Create version number record for lookup. */
#define PREPARE_VERSION(var, vname, vhash) \
@@ -35,10 +29,21 @@
var.name = vname; \
var.hidden = 1; \
var.hash = vhash; \
- CHECK_HASH (var); \
+ assert (var.hash == _dl_elf_hash (var.name)); \
/* We don't have a specific file where the symbol can be found. */ \
var.filename = NULL
+/* Use this for the known version sets defined below, where we
+ record their precomputed hash values only once, in this file. */
+#define PREPARE_VERSION_KNOWN(var, vname) \
+ PREPARE_VERSION (var, VDSO_NAME_##vname, VDSO_HASH_##vname)
+
+#define VDSO_NAME_LINUX_2_6 "LINUX_2.6"
+#define VDSO_HASH_LINUX_2_6 61765110
+#define VDSO_NAME_LINUX_2_6_15 "LINUX_2.6.15"
+#define VDSO_HASH_LINUX_2_6_15 123718565
+#define VDSO_NAME_LINUX_2_6_29 "LINUX_2.6.29"
+#define VDSO_HASH_LINUX_2_6_29 123718585
/* Functions for resolving symbols in the VDSO link map. */
extern void *_dl_vdso_vsym (const char *name,
diff --git a/libc/sysdeps/unix/sysv/linux/getcwd.c b/libc/sysdeps/unix/sysv/linux/getcwd.c
index 6e3c5e064..52dd975ec 100644
--- a/libc/sysdeps/unix/sysv/linux/getcwd.c
+++ b/libc/sysdeps/unix/sysv/linux/getcwd.c
@@ -38,27 +38,6 @@
#endif
-#if __ASSUME_GETCWD_SYSCALL > 0
-/* Kernel 2.1.92 introduced a third way to get the current working
- directory: a syscall. We've got to be careful that even when
- compiling under 2.1.92+ the libc still runs under older kernels. */
-# define no_syscall_getcwd 0
-# define have_new_dcache 1
-#else
-# if __NR_getcwd
-/* Kernel 2.1.92 introduced a third way to get the current working
- directory: a syscall. We've got to be careful that even when
- compiling under 2.1.92+ the libc still runs under older kernels.
- An additional problem is that the system call does not return
- the path of directories longer than one page. */
-static int no_syscall_getcwd;
-static int have_new_dcache;
-# else
-# define no_syscall_getcwd 1
-static int have_new_dcache = 1;
-# endif
-#endif
-
/* The "proc" filesystem provides an easy method to retrieve the value.
For each process, the corresponding directory contains a symbolic link
named `cwd'. Reading the content of this link immediate gives us the
@@ -70,12 +49,8 @@ char *
__getcwd (char *buf, size_t size)
{
char *path;
- int n;
char *result;
- if (no_syscall_getcwd && !have_new_dcache)
- return generic_getcwd (buf, size);
-
#ifndef NO_ALLOCATION
size_t alloc_size = size;
if (size == 0)
@@ -101,138 +76,59 @@ __getcwd (char *buf, size_t size)
#endif
path = buf;
-#if defined __NR_getcwd || __LINUX_GETCWD_SYSCALL > 0
- if (!no_syscall_getcwd)
- {
- int retval;
-
- retval = INLINE_SYSCALL (getcwd, 2, CHECK_STRING (path), alloc_size);
- if (retval >= 0)
- {
-# ifndef NO_ALLOCATION
- if (buf == NULL && size == 0)
- /* Ensure that the buffer is only as large as necessary. */
- buf = realloc (path, (size_t) retval);
-
- if (buf == NULL)
- /* Either buf was NULL all along, or `realloc' failed but
- we still have the original string. */
- buf = path;
-# endif
-
- return buf;
- }
-
- /* The system call cannot handle paths longer than a page.
- Neither can the magic symlink in /proc/self. Just use the
- generic implementation right away. */
- if (errno == ENAMETOOLONG)
- {
-# ifndef NO_ALLOCATION
- if (buf == NULL && size == 0)
- {
- free (path);
- path = NULL;
- }
-# endif
-
- result = generic_getcwd (path, size);
-
-# ifndef NO_ALLOCATION
- if (result == NULL && buf == NULL && size != 0)
- free (path);
-# endif
-
- return result;
- }
+ int retval;
-# if __ASSUME_GETCWD_SYSCALL
- /* It should never happen that the `getcwd' syscall failed because
- the buffer is too small if we allocated the buffer ourselves
- large enough. */
- assert (errno != ERANGE || buf != NULL || size != 0);
+ retval = INLINE_SYSCALL (getcwd, 2, CHECK_STRING (path), alloc_size);
+ if (retval >= 0)
+ {
+#ifndef NO_ALLOCATION
+ if (buf == NULL && size == 0)
+ /* Ensure that the buffer is only as large as necessary. */
+ buf = realloc (path, (size_t) retval);
-# ifndef NO_ALLOCATION
if (buf == NULL)
- free (path);
-# endif
+ /* Either buf was NULL all along, or `realloc' failed but
+ we still have the original string. */
+ buf = path;
+#endif
- return NULL;
-# else
- if (errno == ENOSYS)
- {
- no_syscall_getcwd = 1;
- have_new_dcache = 1; /* Now we will try the /proc method. */
- }
- else if (errno != ERANGE || buf != NULL)
- {
-# ifndef NO_ALLOCATION
- if (buf == NULL)
- free (path);
-# endif
- return NULL;
- }
-# endif
+ return buf;
}
-#endif
- n = __readlink ("/proc/self/cwd", path, alloc_size - 1);
- if (n != -1)
+ /* The system call cannot handle paths longer than a page.
+ Neither can the magic symlink in /proc/self. Just use the
+ generic implementation right away. */
+ if (errno == ENAMETOOLONG)
{
- if (path[0] == '/')
- {
- if ((size_t) n >= alloc_size - 1)
- {
#ifndef NO_ALLOCATION
- if (buf == NULL)
- free (path);
-#endif
- return NULL;
- }
-
- path[n] = '\0';
-#ifndef NO_ALLOCATION
- if (buf == NULL && size == 0)
- /* Ensure that the buffer is only as large as necessary. */
- buf = realloc (path, (size_t) n + 1);
- if (buf == NULL)
- /* Either buf was NULL all along, or `realloc' failed but
- we still have the original string. */
- buf = path;
-#endif
-
- return buf;
+ if (buf == NULL && size == 0)
+ {
+ free (path);
+ path = NULL;
}
-#ifndef have_new_dcache
- else
- have_new_dcache = 0;
#endif
- }
-#if __ASSUME_GETCWD_SYSCALL == 0
- /* Set to have_new_dcache only if error indicates that proc doesn't
- exist. */
- if (errno != EACCES && errno != ENAMETOOLONG)
- have_new_dcache = 0;
-#endif
+ result = generic_getcwd (path, size);
#ifndef NO_ALLOCATION
- /* Don't put restrictions on the length of the path unless the user does. */
- if (buf == NULL && size == 0)
- {
- free (path);
- path = NULL;
- }
+ if (result == NULL && buf == NULL && size != 0)
+ free (path);
#endif
- result = generic_getcwd (path, size);
+ return result;
+ }
+
+ /* It should never happen that the `getcwd' syscall failed because
+ the buffer is too small if we allocated the buffer ourselves
+ large enough. */
+ assert (errno != ERANGE || buf != NULL || size != 0);
#ifndef NO_ALLOCATION
- if (result == NULL && buf == NULL && size != 0)
+ if (buf == NULL)
free (path);
#endif
- return result;
+ return NULL;
}
weak_alias (__getcwd, getcwd)
diff --git a/libc/sysdeps/unix/sysv/linux/getdents.c b/libc/sysdeps/unix/sysv/linux/getdents.c
index eb9cfefbc..ac4979efb 100644
--- a/libc/sysdeps/unix/sysv/linux/getdents.c
+++ b/libc/sysdeps/unix/sysv/linux/getdents.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995-2004, 2006, 2007, 2010
- Free Software Foundation, Inc.
+/* Copyright (C) 19932-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -99,7 +98,17 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
ssize_t retval;
#ifdef __ASSUME_GETDENTS32_D_TYPE
- if (sizeof (DIRENT_TYPE) == sizeof (struct dirent))
+ /* The d_ino and d_off fields in kernel_dirent and dirent must have
+ the same sizes and alignments. */
+ if (sizeof (DIRENT_TYPE) == sizeof (struct dirent)
+ && (sizeof (((struct kernel_dirent *) 0)->d_ino)
+ == sizeof (((struct dirent *) 0)->d_ino))
+ && (sizeof (((struct kernel_dirent *) 0)->d_off)
+ == sizeof (((struct dirent *) 0)->d_off))
+ && (offsetof (struct kernel_dirent, d_off)
+ == offsetof (struct dirent, d_off))
+ && (offsetof (struct kernel_dirent, d_reclen)
+ == offsetof (struct dirent, d_reclen)))
{
retval = INLINE_SYSCALL (getdents, 3, fd, CHECK_N(buf, nbytes), nbytes);
diff --git a/libc/sysdeps/unix/sysv/linux/getsysstats.c b/libc/sysdeps/unix/sysv/linux/getsysstats.c
index 09603c027..22285f39f 100644
--- a/libc/sysdeps/unix/sysv/linux/getsysstats.c
+++ b/libc/sysdeps/unix/sysv/linux/getsysstats.c
@@ -49,8 +49,6 @@
But not all systems have support for the /proc filesystem. If it
is not available we simply return 1 since there is no way. */
-#include <not-cancel.h>
-
/* Other architectures use different formats for /proc/cpuinfo. This
provides a hook for alternative parsers. */
diff --git a/libc/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S b/libc/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
index b2cc36883..e1350767b 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
.section .rodata.str1.1,"aMS",@progbits,1
@@ -78,7 +79,9 @@ ENTRY (____longjmp_chk)
cfi_adjust_cfa_offset(-12)
movl 4(%esp), %ecx
-.Lok: /* We add unwind information for the target here. */
+.Lok:
+ LIBC_PROBE (longjmp, 3, 4@%ecx, -4@8(%esp), 4@%edx)
+ /* We add unwind information for the target here. */
cfi_def_cfa(%ecx, 0)
cfi_register(%eip, %edx)
cfi_register(%esp, %edi)
@@ -101,5 +104,6 @@ ENTRY (____longjmp_chk)
cfi_restore(%ebp)
/* Jump to saved PC. */
+ LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%eax, 4@%edx)
jmp *%edx
END (____longjmp_chk)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/bits/mman.h b/libc/sysdeps/unix/sysv/linux/i386/bits/mman.h
index 9677053cf..2bc2ca9d3 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/bits/mman.h
+++ b/libc/sysdeps/unix/sysv/linux/i386/bits/mman.h
@@ -1,6 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/i386 version.
- Copyright (C) 1997,2000,2003,2005,2006,2009,2010,2011
- Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -97,6 +96,9 @@
# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
+# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
+ overrides the coredump filter bits. */
+# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
# define MADV_HWPOISON 100 /* Poison a page for testing. */
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/chown.c b/libc/sysdeps/unix/sysv/linux/i386/chown.c
index b87605f60..5ea3cfd86 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/chown.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/chown.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1998,1999,2000,2002,2003,2004,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +24,6 @@
#include <bp-checks.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
/*
In Linux 2.1.x the chown functions have been changed. A new function lchown
@@ -42,98 +40,16 @@ extern int __chown_is_lchown (const char *__file, uid_t __owner,
extern int __real_chown (const char *__file, uid_t __owner, gid_t __group);
-#if defined __NR_lchown || __ASSUME_LCHOWN_SYSCALL > 0
-/* Running under Linux > 2.1.80. */
-
-# ifdef __NR_chown32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-# endif /* __NR_chown32 */
+/* Consider moving to syscalls.list. */
int
__real_chown (const char *file, uid_t owner, gid_t group)
{
-# if __ASSUME_LCHOWN_SYSCALL == 0
- static int __libc_old_chown;
- int result;
-
- if (!__libc_old_chown)
- {
- int saved_errno = errno;
-# ifdef __NR_chown32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
- int saved_errno = errno;
-
- result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
- if (result == 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_chown32 */
- if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- result = INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);
-
- if (result >= 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_old_chown = 1;
- }
-
- return __lchown (file, owner, group);
-# elif __ASSUME_32BITUIDS
- /* This implies __ASSUME_LCHOWN_SYSCALL. */
return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
-# else
- /* !__ASSUME_32BITUIDS && ASSUME_LCHOWN_SYSCALL */
-# ifdef __NR_chown32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
- int saved_errno = errno;
-
- result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
- if (result == 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_chown32 */
- if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);
-# endif
}
-#endif
-#if !defined __NR_lchown && __ASSUME_LCHOWN_SYSCALL == 0
-/* Compiling under older kernels. */
-int
-__chown_is_lchown (const char *file, uid_t owner, gid_t group)
-{
- return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);
-}
-#elif SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
/* Compiling for compatibiity. */
int
attribute_compat_text_section
@@ -147,12 +63,6 @@ __chown_is_lchown (const char *file, uid_t owner, gid_t group)
compat_symbol (libc, __chown_is_lchown, chown, GLIBC_2_0);
#endif
-#ifdef __NR_lchown
versioned_symbol (libc, __real_chown, chown, GLIBC_2_1);
strong_alias (__real_chown, __chown)
-#else
-strong_alias (__chown_is_lchown, __chown_is_lchown21)
-versioned_symbol (libc, __chown_is_lchown21, chown, GLIBC_2_1);
-strong_alias (__chown_is_lchown, __chown)
-#endif
libc_hidden_def (__chown)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/fchown.c b/libc/sysdeps/unix/sysv/linux/i386/fchown.c
index e520db9fe..4d76538b6 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/fchown.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/fchown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,46 +22,13 @@
#include <sys/syscall.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-#ifdef __NR_fchown32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif /* __NR_fchown32 */
+/* Consider moving to syscalls.list. */
int
__fchown (int fd, uid_t owner, gid_t group)
{
-#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (fchown32, 3, fd, owner, group);
-#else
-# ifdef __NR_fchown32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
- int saved_errno = errno;
-
- result = INLINE_SYSCALL (fchown32, 3, fd, owner, group);
- if (result == 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_fchown32 */
-
- if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- return INLINE_SYSCALL (fchown, 3, fd, owner, group);
-#endif
}
weak_alias (__fchown, fchown)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/fchownat.c b/libc/sysdeps/unix/sysv/linux/i386/fchownat.c
index 573a9b33c..18c8f0b31 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/fchownat.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/fchownat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -83,8 +83,6 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
file = buf;
}
-# if __ASSUME_32BITUIDS > 0
- /* This implies __ASSUME_LCHOWN_SYSCALL. */
INTERNAL_SYSCALL_DECL (err);
if (flag & AT_SYMLINK_NOFOLLOW)
@@ -99,15 +97,6 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
__atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
return -1;
}
-# else
- /* Don't inline the rest to avoid unnecessary code duplication. */
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = __lchown (file, owner, group);
- else
- result = __chown (file, owner, group);
- if (result < 0)
- __atfct_seterrno (errno, fd, buf);
-# endif
return result;
diff --git a/libc/sysdeps/unix/sysv/linux/i386/getegid.c b/libc/sysdeps/unix/sysv/linux/i386/getegid.c
index 8461be9e4..41c4d08c8 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getegid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/getegid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,41 +20,14 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
-#ifdef __NR_getegid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids attribute_hidden;
-# endif
-#endif /* __NR_getegid32 */
+/* Consider moving to syscalls.list. */
gid_t
__getegid (void)
{
INTERNAL_SYSCALL_DECL (err);
-#if __ASSUME_32BITUIDS > 0
- /* No error checking. */
return INTERNAL_SYSCALL (getegid32, err, 0);
-#else
-# ifdef __NR_getegid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
-
- result = INTERNAL_SYSCALL (getegid32, err, 0);
- if (! INTERNAL_SYSCALL_ERROR_P (result, err)
- || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- return result;
-
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_getegid32 */
-
- /* No error checking. */
- return INTERNAL_SYSCALL (getegid, err, 0);
-#endif
}
weak_alias (__getegid, getegid)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/geteuid.c b/libc/sysdeps/unix/sysv/linux/i386/geteuid.c
index a0e4864de..42e768617 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/geteuid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/geteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,41 +20,14 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
-#ifdef __NR_geteuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids attribute_hidden;
-# endif
-#endif /* __NR_geteuid32 */
+/* Consider moving to syscalls.list. */
uid_t
__geteuid (void)
{
INTERNAL_SYSCALL_DECL (err);
-#if __ASSUME_32BITUIDS > 0
- /* No error checking. */
return INTERNAL_SYSCALL (geteuid32, err, 0);
-#else
-# ifdef __NR_geteuid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
-
- result = INTERNAL_SYSCALL (geteuid32, err, 0);
- if (! INTERNAL_SYSCALL_ERROR_P (result, err)
- || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- return result;
-
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_geteuid32 */
-
- /* No error checking. */
- return INTERNAL_SYSCALL (geteuid, err, 0);
-#endif
}
weak_alias (__geteuid, geteuid)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/getgid.c b/libc/sysdeps/unix/sysv/linux/i386/getgid.c
index 30c4bc840..e611fb494 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getgid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/getgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,41 +21,13 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
-
-#ifdef __NR_getgid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids attribute_hidden;
-# endif
-#endif /* __NR_getgid32 */
+/* Consider moving to syscalls.list. */
gid_t
__getgid (void)
{
INTERNAL_SYSCALL_DECL (err);
-#if __ASSUME_32BITUIDS > 0
- /* No error checking. */
return INTERNAL_SYSCALL (getgid32, err, 0);
-#else
-# ifdef __NR_getgid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
-
- result = INTERNAL_SYSCALL (getgid32, err, 0);
- if (! INTERNAL_SYSCALL_ERROR_P (result, err)
- || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- return result;
-
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_getgid32 */
-
- /* No error checking. */
- return INTERNAL_SYSCALL (getgid, err, 0);
-#endif
}
weak_alias (__getgid, getgid)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/getgroups.c b/libc/sysdeps/unix/sysv/linux/i386/getgroups.c
index 97e1b0abe..e0871ec2d 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getgroups.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/getgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,57 +25,16 @@
#include <bp-checks.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-#ifdef __NR_getgroups32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids attribute_hidden;
-# endif
-#endif /* __NR_getgroups32 */
+/* Consider moving to syscalls.list. */
/* For Linux we must convert the array of groups from the format that the
kernel returns. */
int
__getgroups (int n, gid_t *groups)
{
-#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (getgroups32, 2, n, CHECK_N (groups, n));
-#else
- if (__builtin_expect (n, 1) < 0)
- {
- __set_errno (EINVAL);
- return -1;
- }
- else
- {
-# ifdef __NR_getgroups32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
- int saved_errno = errno;
-
- result = INLINE_SYSCALL (getgroups32, 2, n, CHECK_N (groups, n));
- if (result != -1 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_getgroups32 */
-
- int i, ngids;
- __kernel_gid_t kernel_groups[n = MIN (n, __sysconf (_SC_NGROUPS_MAX))];
-
- ngids = INLINE_SYSCALL (getgroups, 2, n, CHECK_N (kernel_groups, n));
- if (n != 0 && ngids > 0)
- for (i = 0; i < ngids; i++)
- (__ptrvalue (groups))[i] = kernel_groups[i];
- return ngids;
- }
-#endif
}
weak_alias (__getgroups, getgroups)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/getresgid.c b/libc/sysdeps/unix/sysv/linux/i386/getresgid.c
index c01497e7e..d9ce513b1 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getresgid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/getresgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,60 +25,13 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
-
-#ifdef __NR_getresgid
-
-# ifdef __NR_getresgid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-# endif /* __NR_getresgid32 */
-
+/* Consider moving to syscalls.list. */
int
__getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid)
{
-# if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (getresgid32, 3, CHECK_1 (rgid),
CHECK_1 (egid), CHECK_1 (sgid));
-# else
- __kernel_gid_t k_rgid, k_egid, k_sgid;
- int result;
-# ifdef __NR_getresgid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int r;
- int saved_errno = errno;
-
- r = INLINE_SYSCALL (getresgid32, 3, CHECK_1 (rgid),
- CHECK_1 (egid), CHECK_1 (sgid));
- if (r == 0 || errno != ENOSYS)
- return r;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_getresgid32 */
-
- result = INLINE_SYSCALL (getresgid, 3, __ptrvalue (&k_rgid),
- __ptrvalue (&k_egid), __ptrvalue (&k_sgid));
-
- if (result == 0)
- {
- *rgid = (gid_t) k_rgid;
- *egid = (gid_t) k_egid;
- *sgid = (gid_t) k_sgid;
- }
-
- return result;
-# endif
}
libc_hidden_def (__getresgid)
weak_alias (__getresgid, getresgid)
-
-#else
-# include <posix/getresgid.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/getresuid.c b/libc/sysdeps/unix/sysv/linux/i386/getresuid.c
index cbad2d3da..f9c3180fb 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getresuid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/getresuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,59 +25,13 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
-
-#ifdef __NR_getresuid
-
-# ifdef __NR_getresuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-# endif /* __NR_getresuid32 */
+/* Consider moving to syscalls.list. */
int
__getresuid (uid_t *ruid, uid_t *euid, uid_t *suid)
{
-# if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (getresuid32, 3, CHECK_1 (ruid),
CHECK_1 (euid), CHECK_1 (suid));
-# else
- __kernel_uid_t k_ruid, k_euid, k_suid;
- int result;
-# ifdef __NR_getresuid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int r;
- int saved_errno = errno;
-
- r = INLINE_SYSCALL (getresuid32, 3, CHECK_1 (ruid),
- CHECK_1 (euid), CHECK_1 (suid));
- if (r == 0 || errno != ENOSYS)
- return r;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_getresuid32 */
-
- result = INLINE_SYSCALL (getresuid, 3, __ptrvalue (&k_ruid),
- __ptrvalue (&k_euid), __ptrvalue (&k_suid));
-
- if (result == 0)
- {
- *ruid = (uid_t) k_ruid;
- *euid = (uid_t) k_euid;
- *suid = (uid_t) k_suid;
- }
-
- return result;
-# endif
}
libc_hidden_def (__getresuid)
weak_alias (__getresuid, getresuid)
-
-#else
-# include <posix/getresuid.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/getrlimit.c b/libc/sysdeps/unix/sysv/linux/i386/getrlimit.c
index 21a2c0082..e18f9de09 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getrlimit.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/getrlimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,58 +23,15 @@
#include <shlib-compat.h>
#include <bp-checks.h>
-#include <kernel-features.h>
-
extern int __new_getrlimit (enum __rlimit_resource resource,
struct rlimit *__unbounded rlimits);
-
-/* Linux 2.3.25 introduced a new system call since the types used for
- the limits are now unsigned. */
-#if defined __NR_ugetrlimit && !defined __ASSUME_NEW_GETRLIMIT_SYSCALL
-int __have_no_new_getrlimit;
-#endif
+/* Consider moving to syscalls.list. */
int
__new_getrlimit (enum __rlimit_resource resource, struct rlimit *rlimits)
{
-#ifdef __ASSUME_NEW_GETRLIMIT_SYSCALL
return INLINE_SYSCALL (ugetrlimit, 2, resource, CHECK_1 (rlimits));
-#else
- int result;
-
-# ifdef __NR_ugetrlimit
- if (__have_no_new_getrlimit <= 0)
- {
- result = INLINE_SYSCALL (ugetrlimit, 2, resource, CHECK_1 (rlimits));
-
- /* If the system call is available remember this fact and return. */
- if (result != -1 || errno != ENOSYS)
- {
- __have_no_new_getrlimit = -1;
- return result;
- }
-
- /* Remember that the system call is not available. */
- __have_no_new_getrlimit = 1;
- }
-# endif
-
- /* Fall back to the old system call. */
- result = INLINE_SYSCALL (getrlimit, 2, resource, CHECK_1 (rlimits));
-
- if (result == -1)
- return result;
-
- /* We might have to correct the limits values. Since the old values
- were signed the infinity value is too small. */
- if (rlimits->rlim_cur == RLIM_INFINITY >> 1)
- rlimits->rlim_cur = RLIM_INFINITY;
- if (rlimits->rlim_max == RLIM_INFINITY >> 1)
- rlimits->rlim_max = RLIM_INFINITY;
-
- return result;
-#endif
}
weak_alias (__new_getrlimit, __getrlimit);
diff --git a/libc/sysdeps/unix/sysv/linux/i386/getuid.c b/libc/sysdeps/unix/sysv/linux/i386/getuid.c
index 6bbc74d4c..67d63a416 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getuid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/getuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,44 +21,13 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
-
-#ifdef __NR_getuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. This is the definition.
- -1 if libc does not know yet whether kernel has 32bit uids or not.
- 0 if it does have them.
- 1 if it does not have them. */
-int __libc_missing_32bit_uids attribute_hidden = -1;
-# endif
-#endif /* __NR_getuid32 */
+/* Consider moving to syscalls.list. */
uid_t
__getuid (void)
{
INTERNAL_SYSCALL_DECL (err);
-#if __ASSUME_32BITUIDS > 0
- /* No error checking. */
return INTERNAL_SYSCALL (getuid32, err, 0);
-#else
-# ifdef __NR_getuid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
-
- result = INTERNAL_SYSCALL (getuid32, err, 0);
- if (! INTERNAL_SYSCALL_ERROR_P (result, err)
- || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- return result;
-
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_getuid32 */
-
- /* No error checking. */
- return INTERNAL_SYSCALL (getuid, err, 0);
-#endif
}
weak_alias (__getuid, getuid)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/lchown.c b/libc/sysdeps/unix/sysv/linux/i386/lchown.c
index 2184c2860..6190d02a6 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/lchown.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/lchown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,51 +23,13 @@
#include <bp-checks.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-#ifdef __NR_lchown
-# ifdef __NR_lchown32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-# endif /* __NR_lchown32 */
+/* Consider moving to syscalls.list. */
int
__lchown (const char *file, uid_t owner, gid_t group)
{
-# if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group);
-# else
-# ifdef __NR_lchown32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
- int saved_errno = errno;
-
- result = INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group);
- if (result == 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_lchown32 */
-
- if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- return INLINE_SYSCALL (lchown, 3, CHECK_STRING (file), owner, group);
-# endif
}
weak_alias (__lchown, lchown)
-
-#else
-# include <io/lchown.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/msgctl.c b/libc/sysdeps/unix/sysv/linux/i386/msgctl.c
index fa5a82fa3..2125ae192 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/msgctl.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/msgctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -25,7 +25,6 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
#include <shlib-compat.h>
struct __old_msqid_ds
@@ -52,14 +51,6 @@ int __old_msgctl (int, int, struct __old_msqid_ds *);
#endif
int __new_msgctl (int, int, struct msqid_ds *);
-#ifdef __NR_getuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif
-
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
int
attribute_compat_text_section
@@ -74,85 +65,8 @@ compat_symbol (libc, __old_msgctl, msgctl, GLIBC_2_0);
int
__new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
{
-#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
msqid, cmd | __IPC_64, 0, CHECK_1 (buf));
-#else
- switch (cmd) {
- case MSG_STAT:
- case IPC_STAT:
- case IPC_SET:
- break;
- default:
- return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
- msqid, cmd, 0, CHECK_1 (buf));
- }
-
- {
- int result;
- struct __old_msqid_ds old;
-
-#ifdef __NR_getuid32
- if (__libc_missing_32bit_uids <= 0)
- {
- if (__libc_missing_32bit_uids < 0)
- {
- int save_errno = errno;
-
- /* Test presence of new IPC by testing for getuid32 syscall. */
- result = INLINE_SYSCALL (getuid32, 0);
- if (result == -1 && errno == ENOSYS)
- __libc_missing_32bit_uids = 1;
- else
- __libc_missing_32bit_uids = 0;
- __set_errno(save_errno);
- }
- if (__libc_missing_32bit_uids <= 0)
- {
- result = INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
- msqid, cmd | __IPC_64, 0, CHECK_1 (buf));
- return result;
- }
- }
-#endif
- if (cmd == IPC_SET)
- {
- old.msg_perm.uid = buf->msg_perm.uid;
- old.msg_perm.gid = buf->msg_perm.gid;
- old.msg_perm.mode = buf->msg_perm.mode;
- old.msg_qbytes = buf->msg_qbytes;
- if (old.msg_perm.uid != buf->msg_perm.uid ||
- old.msg_perm.gid != buf->msg_perm.gid ||
- old.msg_qbytes != buf->msg_qbytes)
- {
- __set_errno (EINVAL);
- return -1;
- }
- }
- result = INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
- msqid, cmd, 0, __ptrvalue (&old));
- if (result != -1 && cmd != IPC_SET)
- {
- memset(buf, 0, sizeof(*buf));
- buf->msg_perm.__key = old.msg_perm.__key;
- buf->msg_perm.uid = old.msg_perm.uid;
- buf->msg_perm.gid = old.msg_perm.gid;
- buf->msg_perm.cuid = old.msg_perm.cuid;
- buf->msg_perm.cgid = old.msg_perm.cgid;
- buf->msg_perm.mode = old.msg_perm.mode;
- buf->msg_perm.__seq = old.msg_perm.__seq;
- buf->msg_stime = old.msg_stime;
- buf->msg_rtime = old.msg_rtime;
- buf->msg_ctime = old.msg_ctime;
- buf->__msg_cbytes = old.__msg_cbytes;
- buf->msg_qnum = old.msg_qnum;
- buf->msg_qbytes = old.msg_qbytes;
- buf->msg_lspid = old.msg_lspid;
- buf->msg_lrpid = old.msg_lrpid;
- }
- return result;
- }
-#endif
}
versioned_symbol (libc, __new_msgctl, msgctl, GLIBC_2_2);
diff --git a/libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
index ccb8f9f6e..d6695ebb9 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
@@ -1801,11 +1801,13 @@ GLIBC_2.15
scandirat64 F
GLIBC_2.16
GLIBC_2.16 A
+ __getauxval F
__poll_chk F
__ppoll_chk F
aligned_alloc F
c16rtomb F
c32rtomb F
+ getauxval F
mbrtoc16 F
mbrtoc32 F
timespec_get F
diff --git a/libc/sysdeps/unix/sysv/linux/i386/semctl.c b/libc/sysdeps/unix/sysv/linux/i386/semctl.c
index 0c4ad89f8..5e2d94805 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/semctl.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/semctl.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2003,2004,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -26,7 +25,6 @@
#include <string.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
#include <shlib-compat.h>
struct __old_semid_ds
@@ -54,14 +52,6 @@ union semun
#include <bp-checks.h>
#include <bp-semctl.h> /* definition of CHECK_SEMCTL needs union semum */
-#ifdef __NR_getuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif
-
/* Return identifier for array of NSEMS semaphores associated with
KEY. */
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
@@ -103,82 +93,8 @@ __new_semctl (int semid, int semnum, int cmd, ...)
va_end (ap);
-#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
-#else
- switch (cmd) {
- case SEM_STAT:
- case IPC_STAT:
- case IPC_SET:
- break;
- default:
- return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd));
- }
-
- {
- int result;
- struct __old_semid_ds old;
- struct semid_ds *buf;
-
-#ifdef __NR_getuid32
- if (__libc_missing_32bit_uids <= 0)
- {
- if (__libc_missing_32bit_uids < 0)
- {
- int save_errno = errno;
-
- /* Test presence of new IPC by testing for getuid32 syscall. */
- result = INLINE_SYSCALL (getuid32, 0);
- if (result == -1 && errno == ENOSYS)
- __libc_missing_32bit_uids = 1;
- else
- __libc_missing_32bit_uids = 0;
- __set_errno(save_errno);
- }
- if (__libc_missing_32bit_uids <= 0)
- {
- result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
- CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
- return result;
- }
- }
-#endif
-
- buf = arg.buf;
- arg.__old_buf = &old;
- if (cmd == IPC_SET)
- {
- old.sem_perm.uid = buf->sem_perm.uid;
- old.sem_perm.gid = buf->sem_perm.gid;
- old.sem_perm.mode = buf->sem_perm.mode;
- if (old.sem_perm.uid != buf->sem_perm.uid ||
- old.sem_perm.gid != buf->sem_perm.gid)
- {
- __set_errno (EINVAL);
- return -1;
- }
- }
- result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd));
- if (result != -1 && cmd != IPC_SET)
- {
- memset(buf, 0, sizeof(*buf));
- buf->sem_perm.__key = old.sem_perm.__key;
- buf->sem_perm.uid = old.sem_perm.uid;
- buf->sem_perm.gid = old.sem_perm.gid;
- buf->sem_perm.cuid = old.sem_perm.cuid;
- buf->sem_perm.cgid = old.sem_perm.cgid;
- buf->sem_perm.mode = old.sem_perm.mode;
- buf->sem_perm.__seq = old.sem_perm.__seq;
- buf->sem_otime = old.sem_otime;
- buf->sem_ctime = old.sem_ctime;
- buf->sem_nsems = old.sem_nsems;
- }
- return result;
- }
-#endif
}
versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2);
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setegid.c b/libc/sysdeps/unix/sysv/linux/i386/setegid.c
index e0b82ccf9..20170e327 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setegid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setegid.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995-1998,2000,2002,2003,2004,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,13 +18,8 @@
#include <errno.h>
#include <unistd.h>
#include <setxid.h>
-#include <kernel-features.h>
-#ifdef __NR_setresgid
-extern int __setresgid (uid_t rgid, uid_t egid, uid_t sgid);
-#endif
-
int
setegid (gid)
gid_t gid;
@@ -38,23 +32,7 @@ setegid (gid)
return -1;
}
-#if __ASSUME_32BITUIDS > 0
result = INLINE_SETXID_SYSCALL (setresgid32, 3, -1, gid, -1);
-#else
- /* First try the syscall. */
-# ifdef __NR_setresgid
- result = __setresgid (-1, gid, -1);
-# if __ASSUME_SETRESGID_SYSCALL > 0
- if (0)
-# else
- if (result == -1 && errno == ENOSYS)
-# endif
- /* No system call available. Use emulation. This may not work
- since `setregid' also sets the saved user ID when GID is not
- equal to the real user ID, making it impossible to switch back. */
-# endif
- result = __setregid (-1, gid);
-#endif
return result;
}
diff --git a/libc/sysdeps/unix/sysv/linux/i386/seteuid.c b/libc/sysdeps/unix/sysv/linux/i386/seteuid.c
index af3231d84..d41e51b29 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/seteuid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/seteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,13 +18,8 @@
#include <errno.h>
#include <unistd.h>
#include <setxid.h>
-#include <kernel-features.h>
-#ifdef __NR_setresuid
-extern int __setresuid (uid_t ruid, uid_t euid, uid_t suid);
-#endif
-
int
seteuid (uid_t uid)
{
@@ -36,23 +31,7 @@ seteuid (uid_t uid)
return -1;
}
-#if __ASSUME_32BITUIDS > 0
result = INLINE_SETXID_SYSCALL (setresuid32, 3, -1, uid, -1);
-#else
- /* First try the syscall. */
-# ifdef __NR_setresuid
- result = __setresuid (-1, uid, -1);
-# if __ASSUME_SETRESUID_SYSCALL > 0
- if (0)
-# else
- if (result == -1 && errno == ENOSYS)
-# endif
- /* No system call available. Use emulation. This may not work
- since `setreuid' also sets the saved user ID when UID is not
- equal to the real user ID, making it impossible to switch back. */
-# endif
- result = __setreuid (-1, uid);
-#endif
return result;
}
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setfsgid.c b/libc/sysdeps/unix/sysv/linux/i386/setfsgid.c
index 12c66c5b6..fe5fd8659 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setfsgid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setfsgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,48 +22,12 @@
#include <sysdep.h>
#include <sys/syscall.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-
-#ifdef __NR_setfsgid
-
-# ifdef __NR_setfsgid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids attribute_hidden;
-# endif
-# endif /* __NR_setfsgid32 */
+/* Consider moving to syscalls.list. */
int
setfsgid (gid_t gid)
{
INTERNAL_SYSCALL_DECL (err);
-# if __ASSUME_32BITUIDS > 0
- /* No error checking. */
return INTERNAL_SYSCALL (setfsgid32, err, 1, gid);
-# else
-# ifdef __NR_setfsgid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
-
- result = INTERNAL_SYSCALL (setfsgid32, err, 1, gid);
- if (! INTERNAL_SYSCALL_ERROR_P (result, err)
- || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- return result;
-
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_setfsgid32 */
- if (gid != (gid_t) ((__kernel_gid_t) gid))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- /* No error checking. */
- return INTERNAL_SYSCALL (setfsgid, err, 1, gid);
-# endif
}
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setfsuid.c b/libc/sysdeps/unix/sysv/linux/i386/setfsuid.c
index 5194ce1ed..3e0dc9728 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setfsuid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setfsuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,48 +23,12 @@
#include <sys/syscall.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-#ifdef __NR_setfsuid
-
-# ifdef __NR_setfsuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids attribute_hidden;
-# endif
-# endif /* __NR_setfsuid32 */
+/* Consider moving to syscalls.list. */
int
setfsuid (uid_t uid)
{
INTERNAL_SYSCALL_DECL (err);
-# if __ASSUME_32BITUIDS > 0
- /* No error checking. */
return INTERNAL_SYSCALL (setfsuid32, err, 1, uid);
-# else
-# ifdef __NR_setfsuid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
-
- result = INTERNAL_SYSCALL (setfsuid32, err, 1, uid);
- if (! INTERNAL_SYSCALL_ERROR_P (result, err)
- || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- return result;
-
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_setfsuid32 */
-
- if (uid != (uid_t) ((__kernel_uid_t) uid))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- /* No error checking. */
- return INTERNAL_SYSCALL (setfsuid, err, 1, uid);
-# endif
}
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setgid.c b/libc/sysdeps/unix/sysv/linux/i386/setgid.c
index dacc41dab..b06736820 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setgid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,54 +19,13 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-
-
-#ifdef __NR_setgid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif /* __NR_setgid32 */
int
__setgid (gid_t gid)
{
int result;
-#if __ASSUME_32BITUIDS > 0
result = INLINE_SETXID_SYSCALL (setgid32, 1, gid);
-#else
-# ifdef __NR_setgid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int saved_errno = errno;
-
- result = INLINE_SETXID_SYSCALL (setgid32, 1, gid);
-
- if (result == 0)
- goto out;
- if (errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_setgid32 */
-
- if (gid == (gid_t) ~0
- || gid != (gid_t) ((__kernel_gid_t) gid))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- result = INLINE_SETXID_SYSCALL (setgid, 1, gid);
-# ifdef __NR_setgid32
- out:
-# endif
-#endif
return result;
}
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setgroups.c b/libc/sysdeps/unix/sysv/linux/i386/setgroups.c
index dd74cd286..73b341ac5 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setgroups.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setgroups.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,2000,2002,2004,2006,2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,16 +26,6 @@
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-
-
-#ifdef __NR_setgroups32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif /* __NR_setgroups32 */
/* Set the group set for the current user to GROUPS (N of them). For
Linux we must convert the array of groups into the format that the
@@ -44,47 +33,6 @@ extern int __libc_missing_32bit_uids;
int
setgroups (size_t n, const gid_t *groups)
{
-#if __ASSUME_32BITUIDS > 0
return INLINE_SETXID_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
-#else
- if (n > (size_t) __sysconf (_SC_NGROUPS_MAX))
- {
- __set_errno (EINVAL);
- return -1;
- }
- else
- {
- size_t i;
- __kernel_gid_t kernel_groups[n];
-
-# ifdef __NR_setgroups32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
- int saved_errno = errno;
-
- result = INLINE_SETXID_SYSCALL (setgroups32, 2, n,
- CHECK_N (groups, n));
- if (result == 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_setgroups32 */
- for (i = 0; i < n; i++)
- {
- kernel_groups[i] = (__ptrvalue (groups))[i];
- if (groups[i] != (gid_t) ((__kernel_gid_t) groups[i]))
- {
- __set_errno (EINVAL);
- return -1;
- }
- }
-
- return INLINE_SETXID_SYSCALL (setgroups, 2, n,
- CHECK_N (kernel_groups, n));
- }
-#endif
}
libc_hidden_def (setgroups)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setregid.c b/libc/sysdeps/unix/sysv/linux/i386/setregid.c
index b48baf7b4..d2a1d55d5 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setregid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setregid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,53 +19,13 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-
-
-#ifdef __NR_setregid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif /* __NR_setregid32 */
int
__setregid (gid_t rgid, gid_t egid)
{
int result;
-#if __ASSUME_32BITUIDS > 0
result = INLINE_SETXID_SYSCALL (setregid32, 2, rgid, egid);
-#else
-# ifdef __NR_setregid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int saved_errno = errno;
-
- result = INLINE_SETXID_SYSCALL (setregid32, 2, rgid, egid);
-
- if (result == 0)
- goto out;
- if (errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_setregid32 */
- if (((rgid + 1) > (gid_t) ((__kernel_gid_t) -1U))
- || ((egid + 1) > (gid_t) ((__kernel_gid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- result = INLINE_SETXID_SYSCALL (setregid, 2, rgid, egid);
-# ifdef __NR_setregid32
- out:
-# endif
-#endif
return result;
}
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setresgid.c b/libc/sysdeps/unix/sysv/linux/i386/setresgid.c
index 24a0dd8eb..569745bef 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setresgid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setresgid.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2004,2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,56 +19,14 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-#if defined __NR_setresgid || defined __NR_setresgid32
-
-# ifdef __NR_setresgid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-# endif /* __NR_setresgid32 */
-
int
__setresgid (gid_t rgid, gid_t egid, gid_t sgid)
{
int result;
-# if __ASSUME_32BITUIDS > 0 || !defined __NR_setresgid
result = INLINE_SETXID_SYSCALL (setresgid32, 3, rgid, egid, sgid);
-# else
-# ifdef __NR_setresgid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int saved_errno = errno;
-
- result = INLINE_SETXID_SYSCALL (setresgid32, 3, rgid, egid, sgid);
- if (result == 0)
- goto out;
- if (errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_setresgid32 */
-
- if (((rgid + 1) > (gid_t) ((__kernel_gid_t) -1U))
- || ((egid + 1) > (gid_t) ((__kernel_gid_t) -1U))
- || ((sgid + 1) > (gid_t) ((__kernel_gid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- result = INLINE_SETXID_SYSCALL (setresgid, 3, rgid, egid, sgid);
-# ifdef __NR_setresgid32
- out:
-# endif
-# endif
return result;
}
@@ -77,9 +34,3 @@ libc_hidden_def (__setresgid)
#ifndef __setresgid
weak_alias (__setresgid, setresgid)
#endif
-
-#else
-
-#include <posix/setresgid.c>
-
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setresuid.c b/libc/sysdeps/unix/sysv/linux/i386/setresuid.c
index 1015dd74d..33e464b7f 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setresuid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setresuid.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2004,2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,56 +19,14 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-#if defined __NR_setresuid || defined __NR_setresuid32
-
-# ifdef __NR_setresuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-# endif /* __NR_setresuid32 */
-
int
__setresuid (uid_t ruid, uid_t euid, uid_t suid)
{
int result;
-# if __ASSUME_32BITUIDS > 0 || !defined __NR_setresuid
result = INLINE_SETXID_SYSCALL (setresuid32, 3, ruid, euid, suid);
-# else
-# ifdef __NR_setresuid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int saved_errno = errno;
-
- result = INLINE_SETXID_SYSCALL (setresuid32, 3, ruid, euid, suid);
- if (result == 0)
- goto out;
- if (errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_setresuid32 */
-
- if (((ruid + 1) > (uid_t) ((__kernel_uid_t) -1U))
- || ((euid + 1) > (uid_t) ((__kernel_uid_t) -1U))
- || ((suid + 1) > (uid_t) ((__kernel_uid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- result = INLINE_SETXID_SYSCALL (setresuid, 3, ruid, euid, suid);
-# ifdef __NR_setresuid32
- out:
-# endif
-# endif
return result;
}
@@ -77,9 +34,3 @@ libc_hidden_def (__setresuid)
#ifndef __setresuid
weak_alias (__setresuid, setresuid)
#endif
-
-#else
-
-#include <posix/setresuid.c>
-
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setreuid.c b/libc/sysdeps/unix/sysv/linux/i386/setreuid.c
index 7c8b4af9d..e17455f8c 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setreuid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setreuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,53 +19,14 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-#ifdef __NR_setreuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif /* __NR_setreuid32 */
-
int
__setreuid (uid_t ruid, uid_t euid)
{
int result;
-#if __ASSUME_32BITUIDS > 0
result = INLINE_SETXID_SYSCALL (setreuid32, 2, ruid, euid);
-#else
-# ifdef __NR_setreuid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int saved_errno = errno;
-
- result = INLINE_SETXID_SYSCALL (setreuid32, 2, ruid, euid);
-
- if (result == 0)
- goto out;
- if (errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_setreuid32 */
- if (((ruid + 1) > (uid_t) ((__kernel_uid_t) -1U))
- || ((euid + 1) > (uid_t) ((__kernel_uid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- result = INLINE_SETXID_SYSCALL (setreuid, 2, ruid, euid);
-# ifdef __NR_setreuid32
- out:
-# endif
-#endif
return result;
}
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setrlimit.c b/libc/sysdeps/unix/sysv/linux/i386/setrlimit.c
index d6f904f83..7683b858f 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setrlimit.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setrlimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,53 +24,15 @@
#include <shlib-compat.h>
#include <bp-checks.h>
-#include <kernel-features.h>
-
extern int __new_setrlimit (enum __rlimit_resource resource,
const struct rlimit *__unboundedrlimits);
-/* Linux 2.3.25 introduced a new system call since the types used for
- the limits are now unsigned. */
-#if defined __NR_ugetrlimit && !defined __ASSUME_NEW_GETRLIMIT_SYSCALL
-extern int __have_no_new_getrlimit; /* from getrlimit.c */
-#endif
+/* Consider moving to syscalls.list. */
int
__new_setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits)
{
-#ifdef __ASSUME_NEW_GETRLIMIT_SYSCALL
return INLINE_SYSCALL (setrlimit, 2, resource, CHECK_1 (rlimits));
-#else
- struct rlimit rlimits_small;
-
-# ifdef __NR_ugetrlimit
- if (__have_no_new_getrlimit == 0)
- {
- /* Check if the new ugetrlimit syscall exists. We must do this
- first because older kernels don't reject negative rlimit
- values in setrlimit. */
- int result = INLINE_SYSCALL (ugetrlimit, 2, resource, __ptrvalue (&rlimits_small));
- if (result != -1 || errno != ENOSYS)
- /* The syscall exists. */
- __have_no_new_getrlimit = -1;
- else
- /* The syscall does not exist. */
- __have_no_new_getrlimit = 1;
- }
- if (__have_no_new_getrlimit < 0)
- return INLINE_SYSCALL (setrlimit, 2, resource, CHECK_1 (rlimits));
-# endif
-
- /* We might have to correct the limits values. Since the old values
- were signed the new values might be too large. */
- rlimits_small.rlim_cur = MIN ((unsigned long int) rlimits->rlim_cur,
- RLIM_INFINITY >> 1);
- rlimits_small.rlim_max = MIN ((unsigned long int) rlimits->rlim_max,
- RLIM_INFINITY >> 1);
-
- /* Use the adjusted values. */
- return INLINE_SYSCALL (setrlimit, 2, resource, __ptrvalue (&rlimits_small));
-#endif
}
weak_alias (__new_setrlimit, __setrlimit);
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setuid.c b/libc/sysdeps/unix/sysv/linux/i386/setuid.c
index 54ed9ba34..cab40671e 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setuid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,53 +19,14 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-#ifdef __NR_setuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif /* __NR_setuid32 */
-
int
__setuid (uid_t uid)
{
int result;
-#if __ASSUME_32BITUIDS > 0 && defined __NR_setuid32
result = INLINE_SETXID_SYSCALL (setuid32, 1, uid);
-#else
-# ifdef __NR_setuid32
- if (__libc_missing_32bit_uids <= 0)
- {
- int saved_errno = errno;
-
- result = INLINE_SETXID_SYSCALL (setuid32, 1, uid);
- if (result == 0)
- goto out;
- if (errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_setuid32 */
-
- if (uid == (uid_t) ~0
- || uid != (uid_t) ((__kernel_uid_t) uid))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- result = INLINE_SETXID_SYSCALL (setuid, 1, uid);
-# ifdef __NR_setuid32
- out:
-# endif
-#endif
return result;
}
diff --git a/libc/sysdeps/unix/sysv/linux/i386/shmctl.c b/libc/sysdeps/unix/sysv/linux/i386/shmctl.c
index fb38ed79c..dd2167d9a 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/shmctl.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/shmctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -26,7 +26,6 @@
#include <bits/wordsize.h>
#include <bp-checks.h>
-#include <kernel-features.h>
#include <shlib-compat.h>
struct __old_shmid_ds
@@ -53,14 +52,6 @@ struct __old_shminfo
int shmall;
};
-#ifdef __NR_getuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif
-
/* Provide operations to control over shared memory segments. */
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
int __old_shmctl (int, int, struct __old_shmid_ds *);
@@ -81,97 +72,8 @@ compat_symbol (libc, __old_shmctl, shmctl, GLIBC_2_0);
int
__new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
{
-#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
shmid, cmd | __IPC_64, 0, CHECK_1 (buf));
-#else
- switch (cmd) {
- case SHM_STAT:
- case IPC_STAT:
- case IPC_SET:
-# if __WORDSIZE != 32
- case IPC_INFO:
-# endif
- break;
- default:
- return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
- shmid, cmd, 0, CHECK_1 (buf));
- }
-
- {
- struct __old_shmid_ds old;
- int result;
-
-# ifdef __NR_getuid32
- if (__libc_missing_32bit_uids <= 0)
- {
- if (__libc_missing_32bit_uids < 0)
- {
- int save_errno = errno;
-
- /* Test presence of new IPC by testing for getuid32 syscall. */
- result = INLINE_SYSCALL (getuid32, 0);
- if (result == -1 && errno == ENOSYS)
- __libc_missing_32bit_uids = 1;
- else
- __libc_missing_32bit_uids = 0;
- __set_errno(save_errno);
- }
- if (__libc_missing_32bit_uids <= 0)
- return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
- shmid, cmd | __IPC_64, 0, CHECK_1 (buf));
- }
-# endif
-
- if (cmd == IPC_SET)
- {
- old.shm_perm.uid = buf->shm_perm.uid;
- old.shm_perm.gid = buf->shm_perm.gid;
- old.shm_perm.mode = buf->shm_perm.mode;
- if (old.shm_perm.uid != buf->shm_perm.uid ||
- old.shm_perm.gid != buf->shm_perm.gid)
- {
- __set_errno (EINVAL);
- return -1;
- }
- }
- result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
- shmid, cmd, 0, __ptrvalue (&old));
- if (result != -1 && (cmd == SHM_STAT || cmd == IPC_STAT))
- {
- memset(buf, 0, sizeof(*buf));
- buf->shm_perm.__key = old.shm_perm.__key;
- buf->shm_perm.uid = old.shm_perm.uid;
- buf->shm_perm.gid = old.shm_perm.gid;
- buf->shm_perm.cuid = old.shm_perm.cuid;
- buf->shm_perm.cgid = old.shm_perm.cgid;
- buf->shm_perm.mode = old.shm_perm.mode;
- buf->shm_perm.__seq = old.shm_perm.__seq;
- buf->shm_atime = old.shm_atime;
- buf->shm_dtime = old.shm_dtime;
- buf->shm_ctime = old.shm_ctime;
- buf->shm_segsz = old.shm_segsz;
- buf->shm_nattch = old.shm_nattch;
- buf->shm_cpid = old.shm_cpid;
- buf->shm_lpid = old.shm_lpid;
- }
-# if __WORDSIZE != 32
- else if (result != -1 && cmd == IPC_INFO)
- {
- struct __old_shminfo *oldi = (struct __old_shminfo *)&old;
- struct shminfo *i = (struct shminfo *)buf;
-
- memset(i, 0, sizeof(*i));
- i->shmmax = oldi->shmmax;
- i->shmmin = oldi->shmmin;
- i->shmmni = oldi->shmmni;
- i->shmseg = oldi->shmseg;
- i->shmall = oldi->shmall;
- }
-# endif
- return result;
- }
-#endif
}
versioned_symbol (libc, __new_shmctl, shmctl, GLIBC_2_2);
diff --git a/libc/sysdeps/unix/sysv/linux/i386/sigaction.c b/libc/sysdeps/unix/sysv/linux/i386/sigaction.c
index 6424c7c24..df5c235e5 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/sigaction.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/sigaction.c
@@ -1,5 +1,5 @@
/* POSIX.1 `sigaction' call for Linux/i386.
- Copyright (C) 1991,1995-2000,2002-2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,12 +37,6 @@
#define SA_RESTORER 0x04000000
-#if __ASSUME_REALTIME_SIGNALS == 0
-/* The variable is shared between all wrappers around signal handling
- functions which have RT equivalents. */
-int __libc_missing_rt_sigs;
-#endif
-
/* Using the hidden attribute here does not change the code but it
helps to avoid warnings. */
#ifdef __NR_rt_sigaction
@@ -56,92 +50,39 @@ extern void restore (void) asm ("__restore") attribute_hidden;
int
__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
{
-#if __ASSUME_REALTIME_SIGNALS == 0
- struct old_kernel_sigaction k_newact, k_oldact;
-#endif
int result;
-#ifdef __NR_rt_sigaction
+ struct kernel_sigaction kact, koact;
- /* First try the RT signals. */
-# if __ASSUME_REALTIME_SIGNALS == 0
- if (!__libc_missing_rt_sigs)
-# endif
+ if (act)
{
- struct kernel_sigaction kact, koact;
-# if __ASSUME_REALTIME_SIGNALS == 0
- int saved_errno = errno;
-# endif
+ kact.k_sa_handler = act->sa_handler;
+ kact.sa_flags = act->sa_flags;
+ memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
- if (act)
+ if (GLRO(dl_sysinfo_dso) == NULL)
{
- kact.k_sa_handler = act->sa_handler;
- kact.sa_flags = act->sa_flags;
- memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+ kact.sa_flags |= SA_RESTORER;
- if (GLRO(dl_sysinfo_dso) == NULL)
- {
- kact.sa_flags |= SA_RESTORER;
-
- kact.sa_restorer = ((act->sa_flags & SA_SIGINFO)
- ? &restore_rt : &restore);
- }
- }
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- result = INLINE_SYSCALL (rt_sigaction, 4,
- sig, act ? __ptrvalue (&kact) : NULL,
- oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
-
-# if __ASSUME_REALTIME_SIGNALS == 0
- if (result >= 0 || errno != ENOSYS)
-# endif
- {
- if (oact && result >= 0)
- {
- oact->sa_handler = koact.k_sa_handler;
- memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
- oact->sa_flags = koact.sa_flags;
- oact->sa_restorer = koact.sa_restorer;
- }
- return result;
+ kact.sa_restorer = ((act->sa_flags & SA_SIGINFO)
+ ? &restore_rt : &restore);
}
-
-# if __ASSUME_REALTIME_SIGNALS == 0
- __set_errno (saved_errno);
- __libc_missing_rt_sigs = 1;
-# endif
- }
-#endif
-
-#if __ASSUME_REALTIME_SIGNALS == 0
- if (act)
- {
- k_newact.k_sa_handler = act->sa_handler;
- k_newact.sa_mask = act->sa_mask.__val[0];
- k_newact.sa_flags = act->sa_flags | SA_RESTORER;
-
- k_newact.sa_restorer = &restore;
}
- result = INLINE_SYSCALL (sigaction, 3, sig,
- act ? __ptrvalue (&k_newact) : 0,
- oact ? __ptrvalue (&k_oldact) : 0);
-
- if (result < 0)
- return -1;
+ /* XXX The size argument hopefully will have to be changed to the
+ real size of the user-level sigset_t. */
+ result = INLINE_SYSCALL (rt_sigaction, 4,
+ sig, act ? __ptrvalue (&kact) : NULL,
+ oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
- if (oact)
+ if (oact && result >= 0)
{
- oact->sa_handler = k_oldact.k_sa_handler;
- oact->sa_mask.__val[0] = k_oldact.sa_mask;
- oact->sa_flags = k_oldact.sa_flags;
- oact->sa_restorer = k_oldact.sa_restorer;
+ oact->sa_handler = koact.k_sa_handler;
+ memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+ oact->sa_flags = koact.sa_flags;
+ oact->sa_restorer = koact.sa_restorer;
}
-
- return 0;
-#endif
+ return result;
}
libc_hidden_def (__libc_sigaction)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/sysdep.h b/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
index 38031fc98..4b7acb9a5 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -116,11 +116,10 @@
# define SYSCALL_ERROR_HANDLER \
0:SETUP_PIC_REG(cx); \
addl $_GLOBAL_OFFSET_TABLE_, %ecx; \
- xorl %edx, %edx; \
- subl %eax, %edx; \
- movl %edx, rtld_errno@GOTOFF(%ecx); \
+ negl %eax; \
+ movl %eax, rtld_errno@GOTOFF(%ecx); \
orl $-1, %eax; \
- jmp L(pseudo_end);
+ ret;
# elif defined _LIBC_REENTRANT
@@ -133,11 +132,10 @@
0:SETUP_PIC_REG (cx); \
addl $_GLOBAL_OFFSET_TABLE_, %ecx; \
movl SYSCALL_ERROR_ERRNO@GOTNTPOFF(%ecx), %ecx; \
- xorl %edx, %edx; \
- subl %eax, %edx; \
- SYSCALL_ERROR_HANDLER_TLS_STORE (%edx, %ecx); \
+ negl %eax; \
+ SYSCALL_ERROR_HANDLER_TLS_STORE (%eax, %ecx); \
orl $-1, %eax; \
- jmp L(pseudo_end);
+ ret;
# ifndef NO_TLS_DIRECT_SEG_REFS
# define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \
movl src, %gs:(destoff)
@@ -151,12 +149,11 @@
# define SYSCALL_ERROR_HANDLER \
0:SETUP_PIC_REG(cx); \
addl $_GLOBAL_OFFSET_TABLE_, %ecx; \
- xorl %edx, %edx; \
- subl %eax, %edx; \
+ negl %eax; \
movl errno@GOT(%ecx), %ecx; \
- movl %edx, (%ecx); \
+ movl %eax, (%ecx); \
orl $-1, %eax; \
- jmp L(pseudo_end);
+ ret;
# endif /* _LIBC_REENTRANT */
#endif /* PIC */
diff --git a/libc/sysdeps/unix/sysv/linux/if_index.c b/libc/sysdeps/unix/sysv/linux/if_index.c
index 8d9b4871e..3c86bb865 100644
--- a/libc/sysdeps/unix/sysv/linux/if_index.c
+++ b/libc/sysdeps/unix/sysv/linux/if_index.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2007
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,14 +31,6 @@
#include "netlinkaccess.h"
-/* Variable to signal whether SIOCGIFCONF is not available. */
-# if __ASSUME_SIOCGIFNAME == 0
-static int old_siocgifconf;
-#else
-# define old_siocgifconf 0
-#endif
-
-
unsigned int
if_nametoindex (const char *ifname)
{
@@ -101,38 +92,20 @@ if_nameindex_ioctl (void)
/* We may be able to get the needed buffer size directly, rather than
guessing. */
- if (! old_siocgifconf)
- {
- ifc.ifc_buf = NULL;
- ifc.ifc_len = 0;
- if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
- {
-# if __ASSUME_SIOCGIFNAME == 0
- old_siocgifconf = 1;
-# endif
- rq_len = RQ_IFS * sizeof (struct ifreq);
- }
- else
- rq_len = ifc.ifc_len;
- }
- else
+ ifc.ifc_buf = NULL;
+ ifc.ifc_len = 0;
+ if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
rq_len = RQ_IFS * sizeof (struct ifreq);
+ else
+ rq_len = ifc.ifc_len;
/* Read all the interfaces out of the kernel. */
ifc.ifc_buf = alloca (rq_len);
ifc.ifc_len = rq_len;
- while (1)
+ if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0)
{
- if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0)
- {
- close_not_cancel_no_status (fd);
- return NULL;
- }
- if (ifc.ifc_len < rq_len || ! old_siocgifconf)
- break;
-
- ifc.ifc_buf = extend_alloca (ifc.ifc_buf, rq_len, 2 * rq_len);
- ifc.ifc_len = rq_len;
+ close_not_cancel_no_status (fd);
+ return NULL;
}
nifs = ifc.ifc_len / sizeof (struct ifreq);
@@ -314,161 +287,31 @@ libc_hidden_def (if_nameindex)
char *
if_indextoname (unsigned int ifindex, char *ifname)
{
-#if !defined SIOCGIFINDEX && __ASSUME_SIOCGIFNAME == 0
- __set_errno (ENOSYS);
- return NULL;
-#else
-# if __ASSUME_SIOCGIFNAME == 0
- struct if_nameindex *idx;
- struct if_nameindex *p;
- char *result = NULL;
-# endif
-
-# if defined SIOCGIFNAME || __ASSUME_SIOCGIFNAME > 0
/* We may be able to do the conversion directly, rather than searching a
list. This ioctl is not present in kernels before version 2.1.50. */
struct ifreq ifr;
int fd;
-# if __ASSUME_SIOCGIFNAME == 0
- static int siocgifname_works_not;
-
- if (!siocgifname_works_not)
-# endif
- {
-# if __ASSUME_SIOCGIFNAME == 0
- int serrno = errno;
-# endif
- int status;
-
- fd = __opensock ();
-
- if (fd < 0)
- return NULL;
-
- ifr.ifr_ifindex = ifindex;
- status = __ioctl (fd, SIOCGIFNAME, &ifr);
-
- close_not_cancel_no_status (fd);
+ int status;
- if (status < 0)
- {
-# if __ASSUME_SIOCGIFNAME == 0
- if (errno == EINVAL)
- siocgifname_works_not = 1; /* Don't make the same mistake twice. */
- else
-# endif
- {
- if (errno == ENODEV)
- /* POSIX requires ENXIO. */
- __set_errno (ENXIO);
+ fd = __opensock ();
- return NULL;
- }
- }
- else
- return strncpy (ifname, ifr.ifr_name, IFNAMSIZ);
+ if (fd < 0)
+ return NULL;
-# if __ASSUME_SIOCGIFNAME == 0
- __set_errno (serrno);
-# endif
- }
-# endif
+ ifr.ifr_ifindex = ifindex;
+ status = __ioctl (fd, SIOCGIFNAME, &ifr);
-# if __ASSUME_SIOCGIFNAME == 0
- idx = if_nameindex ();
+ close_not_cancel_no_status (fd);
- if (idx != NULL)
+ if (status < 0)
{
- for (p = idx; p->if_index || p->if_name; ++p)
- if (p->if_index == ifindex)
- {
- result = strncpy (ifname, p->if_name, IFNAMSIZ);
- break;
- }
-
- if_freenameindex (idx);
-
- if (result == NULL)
+ if (errno == ENODEV)
+ /* POSIX requires ENXIO. */
__set_errno (ENXIO);
- }
- return result;
-# endif
-#endif
-}
-libc_hidden_def (if_indextoname)
-
-
-#if 0
-void
-internal_function
-__protocol_available (int *have_inet, int *have_inet6)
-{
- int fd = __opensock ();
- unsigned int nifs;
- int rq_len;
- struct ifconf ifc;
-# define RQ_IFS 4
- /* Wirst case assumption. */
- *have_inet = 0;
- *have_inet6 = 0;
-
- if (fd < 0)
- /* We cannot open the socket. No networking at all? */
- return;
-
- /* We may be able to get the needed buffer size directly, rather than
- guessing. */
- if (! old_siocgifconf)
- {
- ifc.ifc_buf = NULL;
- ifc.ifc_len = 0;
- if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
- {
-# if __ASSUME_SIOCGIFNAME == 0
- old_siocgifconf = 1;
-# endif
- rq_len = RQ_IFS * sizeof (struct ifreq);
- }
- else
- rq_len = ifc.ifc_len;
+ return NULL;
}
else
- rq_len = RQ_IFS * sizeof (struct ifreq);
-
- /* Read all the interfaces out of the kernel. */
- do
- {
- ifc.ifc_buf = alloca (ifc.ifc_len = rq_len);
- if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0)
- {
- close_not_cancel_no_status (fd);
- return;
- }
- rq_len *= 2;
- }
- while (ifc.ifc_len == rq_len && old_siocgifconf);
-
- nifs = ifc.ifc_len / sizeof (struct ifreq);
-
- /* Go through all the interfaces and get the address. */
- while (nifs-- > 0)
- if (__ioctl (fd, SIOCGIFADDR, &ifc.ifc_req[nifs]) >= 0)
- {
- /* We successfully got information about this interface. Now
- test whether it is an IPv4 or IPv6 address. */
- if (ifc.ifc_req[nifs].ifr_addr.sa_family == AF_INET)
- *have_inet = 1;
- else if (ifc.ifc_req[nifs].ifr_addr.sa_family == AF_INET6)
- *have_inet6 = 1;
-
- /* Note, this is & not &&. It works since the values are always
- 0 or 1. */
- if (*have_inet & *have_inet6)
- /* We can stop early. */
- break;
- }
-
- close_not_cancel_no_status (fd);
+ return strncpy (ifname, ifr.ifr_name, IFNAMSIZ);
}
-#endif
+libc_hidden_def (if_indextoname)
diff --git a/libc/sysdeps/unix/sysv/linux/ifreq.c b/libc/sysdeps/unix/sysv/linux/ifreq.c
index bd0d17e5d..551af725b 100644
--- a/libc/sysdeps/unix/sysv/linux/ifreq.c
+++ b/libc/sysdeps/unix/sysv/linux/ifreq.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>.
@@ -19,13 +19,6 @@
#include "ifreq.h"
#include <kernel-features.h>
-/* Variable to signal whether SIOCGIFCONF is not available. */
-#if __ASSUME_SIOCGIFNAME == 0 || 1
-static int old_siocgifconf;
-#else
-# define old_siocgifconf 0
-#endif
-
void
__ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
@@ -49,45 +42,27 @@ __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
/* We may be able to get the needed buffer size directly, rather than
guessing. */
- if (! old_siocgifconf)
- {
- ifc.ifc_buf = NULL;
- ifc.ifc_len = 0;
- if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
- {
-# if __ASSUME_SIOCGIFNAME == 0
- old_siocgifconf = 1;
-# endif
- rq_len = RQ_IFS * sizeof (struct ifreq);
- }
- else
- rq_len = ifc.ifc_len;
- }
- else
+ ifc.ifc_buf = NULL;
+ ifc.ifc_len = 0;
+ if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
rq_len = RQ_IFS * sizeof (struct ifreq);
+ else
+ rq_len = ifc.ifc_len;
/* Read all the interfaces out of the kernel. */
- while (1)
+ ifc.ifc_len = rq_len;
+ void *newp = realloc (ifc.ifc_buf, ifc.ifc_len);
+ if (newp == NULL
+ || (ifc.ifc_buf = newp, __ioctl (fd, SIOCGIFCONF, &ifc)) < 0)
{
- ifc.ifc_len = rq_len;
- void *newp = realloc (ifc.ifc_buf, ifc.ifc_len);
- if (newp == NULL
- || (ifc.ifc_buf = newp, __ioctl (fd, SIOCGIFCONF, &ifc)) < 0)
- {
- free (ifc.ifc_buf);
+ free (ifc.ifc_buf);
- if (fd != sockfd)
- __close (fd);
+ if (fd != sockfd)
+ __close (fd);
- *num_ifs = 0;
- *ifreqs = NULL;
- return;
- }
-
- if (!old_siocgifconf || ifc.ifc_len < rq_len)
- break;
-
- rq_len *= 2;
+ *num_ifs = 0;
+ *ifreqs = NULL;
+ return;
}
nifs = ifc.ifc_len / sizeof (struct ifreq);
diff --git a/libc/sysdeps/unix/sysv/linux/kernel-features.h b/libc/sysdeps/unix/sysv/linux/kernel-features.h
index ffaae5d14..0ea453d99 100644
--- a/libc/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/libc/sysdeps/unix/sysv/linux/kernel-features.h
@@ -35,137 +35,50 @@
version given by __LINUX_KERNEL_VERSION. We are not always exactly
recording the correct versions in which the features were
introduced. If somebody cares these values can afterwards be
- corrected. Most of the numbers here are set corresponding to
- 2.2.0. */
-
-/* `getcwd' system call. */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_GETCWD_SYSCALL 1
-#endif
-
-/* Real-time signal became usable in 2.1.70. */
-#if __LINUX_KERNEL_VERSION >= 131398
-# define __ASSUME_REALTIME_SIGNALS 1
-#endif
-
-/* When were the `pread'/`pwrite' syscalls introduced? */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_PREAD_SYSCALL 1
-# define __ASSUME_PWRITE_SYSCALL 1
-#endif
-
-/* When was `poll' introduced? */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_POLL_SYSCALL 1
-#endif
-
-/* The `lchown' syscall was introduced in 2.1.80. */
-#if __LINUX_KERNEL_VERSION >= 131408
-# define __ASSUME_LCHOWN_SYSCALL 1
-#endif
-
-/* When did the `setresuid' syscall became available? */
-#if __LINUX_KERNEL_VERSION >= 131584 && !defined __sparc__
-# define __ASSUME_SETRESUID_SYSCALL 1
-#endif
-
-/* The SIOCGIFNAME ioctl is available starting with 2.1.50. */
-#if __LINUX_KERNEL_VERSION >= 131408
-# define __ASSUME_SIOCGIFNAME 1
-#endif
-
-/* MSG_NOSIGNAL was at least available with Linux 2.2.0. */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_MSG_NOSIGNAL 1
-#endif
+ corrected. */
/* The sendfile syscall was introduced in 2.2.0. */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_SENDFILE 1
-#endif
-
-/* Only very old kernels had no real symlinks for terminal descriptors
- in /proc/self/fd. */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_PROC_SELF_FD_SYMLINK 1
-#endif
-
-/* On x86 another `getrlimit' syscall was added in 2.3.25. */
-#if __LINUX_KERNEL_VERSION >= 131865 && defined __i386__
-# define __ASSUME_NEW_GETRLIMIT_SYSCALL 1
-#endif
+#define __ASSUME_SENDFILE 1
/* On x86 the truncate64/ftruncate64 syscalls were introduced in 2.3.31. */
-#if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__
+#ifdef __i386__
# define __ASSUME_TRUNCATE64_SYSCALL 1
#endif
/* On x86 the mmap2 syscall was introduced in 2.3.31. */
-#if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__
+#ifdef __i386__
# define __ASSUME_MMAP2_SYSCALL 1
#endif
/* On x86 the stat64/lstat64/fstat64 syscalls were introduced in 2.3.34. */
-#if __LINUX_KERNEL_VERSION >= 131874 && defined __i386__
+#ifdef __i386__
# define __ASSUME_STAT64_SYSCALL 1
#endif
/* On sparc the truncate64/ftruncate64/mmap2/stat64/lstat64/fstat64
syscalls were introduced in 2.3.35. */
-#if __LINUX_KERNEL_VERSION >= 131875 \
- && (defined __sparc__ && !defined __arch64__)
+#if defined __sparc__ && !defined __arch64__
# define __ASSUME_TRUNCATE64_SYSCALL 1
# define __ASSUME_MMAP2_SYSCALL 1
# define __ASSUME_STAT64_SYSCALL 1
#endif
-/* I know for sure that getrlimit are in 2.3.35 on powerpc. */
-#if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__
-# define __ASSUME_NEW_GETRLIMIT_SYSCALL 1
-#endif
-
/* I know for sure that these are in 2.3.35 on powerpc. But PowerPC64 does not
support separate 64-bit syscalls, already 64-bit. */
-#if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__ \
- && !defined __powerpc64__
+#if defined __powerpc__ && !defined __powerpc64__
# define __ASSUME_TRUNCATE64_SYSCALL 1
# define __ASSUME_STAT64_SYSCALL 1
#endif
-/* Linux 2.3.39 introduced 32bit UID/GIDs. Some platforms had 32
- bit type all along. */
-#if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__
-# define __ASSUME_32BITUIDS 1
-#endif
-
-/* Linux 2.3.39 sparc added setresuid. */
-#if __LINUX_KERNEL_VERSION >= 131879 && defined __sparc__
-# define __ASSUME_SETRESUID_SYSCALL 1
-#endif
-
-#if __LINUX_KERNEL_VERSION >= 131879
-# define __ASSUME_SETRESGID_SYSCALL 1
-#endif
-
-/* Linux 2.3.39 introduced IPC64. Except for powerpc. */
-#if __LINUX_KERNEL_VERSION >= 131879 && !defined __powerpc__
+/* Linux 2.3.39 introduced IPC64. Except for powerpc. Linux 2.4.0 on
+ PPC introduced a correct IPC64. But PowerPC64 does not support a
+ separate 64-bit syscall, already 64-bit. */
+#ifndef __powerpc64__
# define __ASSUME_IPC64 1
#endif
-/* We can use the LDTs for threading with Linux 2.3.99 and newer. */
-#if __LINUX_KERNEL_VERSION >= 131939
-# define __ASSUME_LDT_WORKS 1
-#endif
-
-/* Linux 2.4.0 on PPC introduced a correct IPC64. But PowerPC64 does not
- support a separate 64-bit syscall, already 64-bit. */
-#if __LINUX_KERNEL_VERSION >= 132096 && defined __powerpc__ \
- && !defined __powerpc64__
-# define __ASSUME_IPC64 1
-#endif
-
/* SH kernels got stat64, mmap2, and truncate64 during 2.4.0-test. */
-#if __LINUX_KERNEL_VERSION >= 132096 && defined __sh__
+#ifdef __sh__
# define __ASSUME_TRUNCATE64_SYSCALL 1
# define __ASSUME_MMAP2_SYSCALL 1
# define __ASSUME_STAT64_SYSCALL 1
@@ -207,12 +120,6 @@
# define __ASSUME_GETDENTS64_SYSCALL 1
#endif
-/* When did O_DIRECTORY become available? Early in 2.3 but when?
- Be safe, use 2.3.99. */
-#if __LINUX_KERNEL_VERSION >= 131939
-# define __ASSUME_O_DIRECTORY 1
-#endif
-
/* Starting with one of the 2.4.0 pre-releases the Linux kernel passes
up the page size information. */
#if __LINUX_KERNEL_VERSION >= 132097
diff --git a/libc/sysdeps/unix/sysv/linux/local-setxid.h b/libc/sysdeps/unix/sysv/linux/local-setxid.h
index 057968798..97d787d94 100644
--- a/libc/sysdeps/unix/sysv/linux/local-setxid.h
+++ b/libc/sysdeps/unix/sysv/linux/local-setxid.h
@@ -1,23 +1,16 @@
/* SETxID functions which only have to change the local thread and
none of the possible other threads. */
-#include <kernel-features.h>
#include <sysdep.h>
-/* If we can use the syscall directly, use it. */
-#if __ASSUME_32BITUIDS > 0 && defined __NR_setresuid32
+#ifdef __NR_setresuid32
# define local_seteuid(id) INLINE_SYSCALL (setresuid32, 3, -1, id, -1)
-#elif __ASSUME_SETRESUID_SYSCALL > 0
-# define local_seteuid(id) INLINE_SYSCALL (setresuid, 3, -1, id, -1)
#else
-# define local_seteuid(id) seteuid (id)
+# define local_seteuid(id) INLINE_SYSCALL (setresuid, 3, -1, id, -1)
#endif
-/* If we can use the syscall directly, use it. */
-#if __ASSUME_32BITUIDS > 0 && defined __NR_setresgid32
+#ifdef __NR_setresgid32
# define local_setegid(id) INLINE_SYSCALL (setresgid32, 3, -1, id, -1)
-#elif __ASSUME_SETRESGID_SYSCALL > 0
-# define local_setegid(id) INLINE_SYSCALL (setresgid, 3, -1, id, -1)
#else
-# define local_setegid(id) setegid (id)
+# define local_setegid(id) INLINE_SYSCALL (setresgid, 3, -1, id, -1)
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/opendir.c b/libc/sysdeps/unix/sysv/linux/opendir.c
index 2c6c557a0..b0bb80d39 100644
--- a/libc/sysdeps/unix/sysv/linux/opendir.c
+++ b/libc/sysdeps/unix/sysv/linux/opendir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -15,11 +15,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <kernel-features.h>
-
-
-#ifdef __ASSUME_O_DIRECTORY
-# define O_DIRECTORY_WORKS 1
-#endif
+#define O_DIRECTORY_WORKS 1
#include <sysdeps/unix/opendir.c>
diff --git a/libc/sysdeps/unix/sysv/linux/opensock.c b/libc/sysdeps/unix/sysv/linux/opensock.c
index 595938062..d4674229e 100644
--- a/libc/sysdeps/unix/sysv/linux/opensock.c
+++ b/libc/sysdeps/unix/sysv/linux/opensock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,15 +36,8 @@ __opensock (void)
const char procname[15];
} afs[] =
{
- /* The 2.2 kernels cannot handle ioctl(SIOCGIFCONF) on AF_UNIX sockets.
- Give the kernel a chance to user inet sockets on old kernels. */
-#if __LINUX_KERNEL_VERSION < 132096
- { AF_INET, "" },
- { AF_UNIX, "net/unix" },
-#else
{ AF_UNIX, "net/unix" },
{ AF_INET, "" },
-#endif
{ AF_INET6, "net/if_inet6" },
{ AF_AX25, "net/ax25" },
{ AF_NETROM, "net/nr" },
diff --git a/libc/sysdeps/unix/sysv/linux/poll.c b/libc/sysdeps/unix/sysv/linux/poll.c
deleted file mode 100644
index c8f5e6deb..000000000
--- a/libc/sysdeps/unix/sysv/linux/poll.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Poll system call, with emulation if it is not available.
- Copyright (C) 1997,1998,1999,2000,2001,2002,2006
- Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <sys/poll.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-#include <bp-checks.h>
-
-#include <kernel-features.h>
-
-#if defined __NR_poll || __ASSUME_POLL_SYSCALL > 0
-
-# if __ASSUME_POLL_SYSCALL == 0
-static int __emulate_poll (struct pollfd *fds, nfds_t nfds,
- int timeout) internal_function;
-# endif
-
-
-# if __ASSUME_POLL_SYSCALL == 0
-/* For loser kernels. */
-static int
-loser_poll (struct pollfd *fds, nfds_t nfds, int timeout)
-{
- static int must_emulate;
-
- if (!must_emulate)
- {
- int errno_saved = errno;
- int retval = INLINE_SYSCALL (poll, 3, CHECK_N (fds, nfds), nfds,
- timeout);
-
- if (retval >= 0 || errno != ENOSYS)
- return retval;
-
- __set_errno (errno_saved);
- must_emulate = 1;
- }
-
- return __emulate_poll (fds, nfds, timeout);
-}
-# endif
-
-
-/* The real implementation. */
-int
-__poll (fds, nfds, timeout)
- struct pollfd *fds;
- nfds_t nfds;
- int timeout;
-{
-# if __ASSUME_POLL_SYSCALL == 0
- if (SINGLE_THREAD_P)
- return loser_poll (CHECK_N (fds, nfds), nfds, timeout);
-
- int oldtype = LIBC_CANCEL_ASYNC ();
-
- int result = loser_poll (CHECK_N (fds, nfds), nfds, timeout);
-
- LIBC_CANCEL_RESET (oldtype);
-
- return result;
-# else
- if (SINGLE_THREAD_P)
- return INLINE_SYSCALL (poll, 3, CHECK_N (fds, nfds), nfds, timeout);
-
- int oldtype = LIBC_CANCEL_ASYNC ();
-
- int result = INLINE_SYSCALL (poll, 3, CHECK_N (fds, nfds), nfds, timeout);
-
- LIBC_CANCEL_RESET (oldtype);
-
- return result;
-# endif
-}
-libc_hidden_def (__poll)
-weak_alias (__poll, poll)
-strong_alias (__poll, __libc_poll)
-
-/* Get the emulation code. */
-# define __poll(fds, nfds, timeout) \
- static internal_function __emulate_poll (fds, nfds, timeout)
-#endif
-
-#if __ASSUME_POLL_SYSCALL == 0
-# include <sysdeps/unix/bsd/poll.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/bits/mman.h b/libc/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
index c02492cfb..e9cc5a83b 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
@@ -98,6 +98,9 @@
# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
+# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
+ overrides the coredump filter bits. */
+# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
# define MADV_HWPOISON 100 /* Poison a page for testing. */
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h b/libc/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
index cf934234f..3e8a1e0a1 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
@@ -2,7 +2,7 @@
#if defined __powerpc64__
# define __WORDSIZE 64
-# define __WORDSIZE_COMPAT32 1
+# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/chown.c b/libc/sysdeps/unix/sysv/linux/powerpc/chown.c
index 33bb4921c..4e3e49549 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/chown.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/chown.c
@@ -1,5 +1,5 @@
/* chown() compatibility.
- Copyright (C) 1998, 2000, 2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +25,8 @@
#include <kernel-features.h>
+/* Consider moving to syscalls.list. */
+
/*
In Linux 2.1.x the chown functions have been changed. A new function lchown
was introduced. The new chown now follows symlinks - the old chown and the
@@ -35,95 +37,7 @@
int
__chown (const char *file, uid_t owner, gid_t group)
{
-#if __ASSUME_LCHOWN_SYSCALL
return INLINE_SYSCALL (chown, 3, file, owner, group);
-#else
- int err;
- int old_errno;
- char link[PATH_MAX + 2];
- char path[2 * PATH_MAX + 4];
- int loopct;
- size_t filelen;
- static int libc_old_chown = 0 /* -1=old linux, 1=new linux, 0=unknown */;
-
- if (libc_old_chown == 1)
- return INLINE_SYSCALL (chown, 3, __ptrvalue (file), owner, group);
-
- old_errno = errno;
-
-# ifdef __NR_lchown
- if (libc_old_chown == 0)
- {
- err = INLINE_SYSCALL (chown, 3, __ptrvalue (file), owner, group);
- if (err != -1 || errno != ENOSYS)
- {
- libc_old_chown = 1;
- return err;
- }
- libc_old_chown = -1;
- }
-# endif
-
- err = __readlink (file, link, PATH_MAX + 1);
- if (err == -1)
- {
- __set_errno (old_errno);
- return __lchown (file, owner, group);
- }
-
- filelen = strlen (file) + 1;
- if (filelen > sizeof (path))
- {
- __set_errno (ENAMETOOLONG);
- return -1;
- }
- memcpy (path, file, filelen);
-
- /* 'The system has an arbitrary limit...' In practise, we'll hit
- ENAMETOOLONG before this, usually. */
- for (loopct = 0; loopct < 128; ++loopct)
- {
- size_t linklen;
-
- if (err >= PATH_MAX + 1)
- {
- __set_errno (ENAMETOOLONG);
- return -1;
- }
-
- link[err] = 0; /* Null-terminate string, just-in-case. */
-
- linklen = strlen (link) + 1;
-
- if (link[0] == '/')
- memcpy (path, link, linklen);
- else
- {
- filelen = strlen (path);
-
- while (filelen > 1 && path[filelen - 1] == '/')
- --filelen;
- while (filelen > 0 && path[filelen - 1] != '/')
- --filelen;
- if (filelen + linklen > sizeof (path))
- {
- errno = ENAMETOOLONG;
- return -1;
- }
- memcpy (path + filelen, link, linklen);
- }
-
- err = __readlink (path, link, PATH_MAX + 1);
-
- if (err == -1)
- {
- __set_errno (old_errno);
- return __lchown (path, owner, group);
- }
- }
- __set_errno (ELOOP);
- return -1;
-#endif
}
libc_hidden_def (__chown)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/fchownat.c b/libc/sysdeps/unix/sysv/linux/powerpc/fchownat.c
index 16aacb36f..b92e35a9e 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/fchownat.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/fchownat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -86,7 +86,6 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
file = buf;
}
-# if __ASSUME_LCHOWN_SYSCALL
INTERNAL_SYSCALL_DECL (err);
if (flag & AT_SYMLINK_NOFOLLOW)
@@ -99,15 +98,6 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
__atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
return -1;
}
-# else
- /* Don't inline the rest to avoid unnecessary code duplication. */
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = __lchown (file, owner, group);
- else
- result = __chown (file, owner, group);
- if (result < 0)
- __atfct_seterrno (errno, fd, buf);
-# endif
return result;
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
index b2ef2da97..737613516 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,6 @@
#include <time.h>
#include <hp-timing.h>
-#undef __gettimeofday
#include <bits/libc-vdso.h>
/* Get the current time of day and timezone information,
@@ -36,6 +35,6 @@ __gettimeofday (tv, tz)
{
return INLINE_VSYSCALL (gettimeofday, 2, CHECK_1 (tv), CHECK_1 (tz));
}
-
-INTDEF (__gettimeofday)
+libc_hidden_def (__gettimeofday)
weak_alias (__gettimeofday, gettimeofday)
+libc_hidden_weak (gettimeofday)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
index 41d08819c..bacdb6aab 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
@@ -1761,11 +1761,13 @@ GLIBC_2.15
scandirat64 F
GLIBC_2.16
GLIBC_2.16 A
+ __getauxval F
__poll_chk F
__ppoll_chk F
aligned_alloc F
c16rtomb F
c32rtomb F
+ getauxval F
mbrtoc16 F
mbrtoc32 F
timespec_get F
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
index 9229aa4c7..364834f1d 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -27,14 +26,6 @@
#include <kernel-features.h>
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread (int fd, void *buf, size_t count,
- off_t offset) internal_function;
-# endif
-
-
ssize_t
__libc_pread (fd, buf, count, offset)
int fd;
@@ -49,11 +40,6 @@ __libc_pread (fd, buf, count, offset)
/* On PPC32 64bit values are aligned in odd/even register pairs. */
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
0, offset >> 31, offset);
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread (fd, buf, count, offset);
-# endif
return result;
}
@@ -63,11 +49,6 @@ __libc_pread (fd, buf, count, offset)
/* On PPC32 64bit values are aligned in odd/even register pairs. */
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
0, offset >> 31, offset);
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -76,11 +57,3 @@ __libc_pread (fd, buf, count, offset)
strong_alias (__libc_pread, __pread)
weak_alias (__libc_pread, pread)
-
-# define __libc_pread(fd, buf, count, offset) \
- static internal_function __emulate_pread (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
index 21c1f7b95..5b1445ff2 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -26,13 +25,6 @@
#include <kernel-features.h>
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
- off64_t offset) internal_function;
-# endif
-
ssize_t
__libc_pread64 (fd, buf, count, offset)
@@ -49,11 +41,6 @@ __libc_pread64 (fd, buf, count, offset)
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
0, (long) (offset >> 32),
(long) offset);
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread64 (fd, buf, count, offset);
-# endif
return result;
}
@@ -64,11 +51,6 @@ __libc_pread64 (fd, buf, count, offset)
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
0, (long) (offset >> 32),
(long) offset);
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread64 (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -77,11 +59,3 @@ __libc_pread64 (fd, buf, count, offset)
weak_alias (__libc_pread64, __pread64)
weak_alias (__libc_pread64, pread64)
-
-# define __libc_pread64(fd, buf, count, offset) \
- static internal_function __emulate_pread64 (fd, buf, count, offset)
-#endif
-
-# if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread64.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
index bf0e3414c..ed1878bc5 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -27,13 +26,6 @@
#include <kernel-features.h>
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
- off_t offset) internal_function;
-# endif
-
ssize_t
__libc_pwrite (fd, buf, count, offset)
@@ -49,11 +41,6 @@ __libc_pwrite (fd, buf, count, offset)
/* On PPC32 64bit values are aligned in odd/even register pairs. */
result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
0, offset >> 31, offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite (fd, buf, count, offset);
-# endif
return result;
}
@@ -63,11 +50,6 @@ __libc_pwrite (fd, buf, count, offset)
/* On PPC32 64bit values are aligned in odd/even register pairs. */
result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
0, offset >> 31, offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -76,11 +58,3 @@ __libc_pwrite (fd, buf, count, offset)
strong_alias (__libc_pwrite, __pwrite)
weak_alias (__libc_pwrite, pwrite)
-
-# define __libc_pwrite(fd, buf, count, offset) \
- static internal_function __emulate_pwrite (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
index 0162d8839..dedeb7e97 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -26,13 +25,6 @@
#include <kernel-features.h>
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
- off64_t offset) internal_function;
-# endif
-
ssize_t
__libc_pwrite64 (fd, buf, count, offset)
@@ -49,11 +41,6 @@ __libc_pwrite64 (fd, buf, count, offset)
result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
0, (long) (offset >> 32),
(long) offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
return result;
}
@@ -64,11 +51,6 @@ __libc_pwrite64 (fd, buf, count, offset)
result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
0, (long) (offset >> 32),
(long) offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -78,11 +60,3 @@ __libc_pwrite64 (fd, buf, count, offset)
weak_alias (__libc_pwrite64, __pwrite64)
libc_hidden_weak (__pwrite64)
weak_alias (__libc_pwrite64, pwrite64)
-
-# define __libc_pwrite64(fd, buf, count, offset) \
- static internal_function __emulate_pwrite64 (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite64.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
index c59395207..a0d362e11 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
@@ -68,11 +68,13 @@ GLIBC_2.15
scandirat64 F
GLIBC_2.16
GLIBC_2.16 A
+ __getauxval F
__poll_chk F
__ppoll_chk F
aligned_alloc F
c16rtomb F
c32rtomb F
+ getauxval F
mbrtoc16 F
mbrtoc32 F
timespec_get F
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c
index 6b8f3ea4f..ed4708f2d 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -27,13 +26,8 @@
#include <kernel-features.h>
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread (int fd, void *buf, size_t count,
- off_t offset) internal_function;
-# endif
+/* Consider moving to syscalls.list. */
ssize_t
__libc_pread (fd, buf, count, offset)
@@ -48,11 +42,6 @@ __libc_pread (fd, buf, count, offset)
{
result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
offset);
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread (fd, buf, count, offset);
-# endif
return result;
}
@@ -61,11 +50,6 @@ __libc_pread (fd, buf, count, offset)
result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
offset);
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -74,11 +58,3 @@ __libc_pread (fd, buf, count, offset)
strong_alias (__libc_pread, __pread)
weak_alias (__libc_pread, pread)
-
-# define __libc_pread(fd, buf, count, offset) \
- static internal_function __emulate_pread (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
index 0933806b0..63ba30df2 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -26,13 +25,8 @@
#include <kernel-features.h>
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
- off64_t offset) internal_function;
-# endif
+/* Consider moving to syscalls.list. */
ssize_t
__libc_pread64 (fd, buf, count, offset)
@@ -47,11 +41,6 @@ __libc_pread64 (fd, buf, count, offset)
{
result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
offset);
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread64 (fd, buf, count, offset);
-# endif
return result;
}
@@ -60,11 +49,6 @@ __libc_pread64 (fd, buf, count, offset)
result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
offset);
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread64 (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -73,11 +57,3 @@ __libc_pread64 (fd, buf, count, offset)
weak_alias (__libc_pread64, __pread64)
weak_alias (__libc_pread64, pread64)
-
-# define __libc_pread64(fd, buf, count, offset) \
- static internal_function __emulate_pread64 (fd, buf, count, offset)
-#endif
-
-# if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread64.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c
index b956b48ba..68f26dfb7 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -27,13 +26,8 @@
#include <kernel-features.h>
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
- off_t offset) internal_function;
-# endif
+/* Consider moving to syscalls.list. */
ssize_t
__libc_pwrite (fd, buf, count, offset)
@@ -48,11 +42,6 @@ __libc_pwrite (fd, buf, count, offset)
{
result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite (fd, buf, count, offset);
-# endif
return result;
}
@@ -61,11 +50,6 @@ __libc_pwrite (fd, buf, count, offset)
result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -74,11 +58,3 @@ __libc_pwrite (fd, buf, count, offset)
strong_alias (__libc_pwrite, __pwrite)
weak_alias (__libc_pwrite, pwrite)
-
-# define __libc_pwrite(fd, buf, count, offset) \
- static internal_function __emulate_pwrite (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
index ec9bba53c..71ffa17c5 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -26,13 +25,8 @@
#include <kernel-features.h>
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
- off64_t offset) internal_function;
-# endif
+/* Consider moving to syscalls.list. */
ssize_t
__libc_pwrite64 (fd, buf, count, offset)
@@ -47,11 +41,6 @@ __libc_pwrite64 (fd, buf, count, offset)
{
result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
return result;
}
@@ -60,11 +49,6 @@ __libc_pwrite64 (fd, buf, count, offset)
result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -74,11 +58,3 @@ __libc_pwrite64 (fd, buf, count, offset)
weak_alias (__libc_pwrite64, __pwrite64)
libc_hidden_weak (__pwrite64)
weak_alias (__libc_pwrite64, pwrite64)
-
-# define __libc_pwrite64(fd, buf, count, offset) \
- static internal_function __emulate_pwrite64 (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite64.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h b/libc/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h
index 146b28ed4..dc41bdf33 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1999, 2002, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -52,7 +52,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
/* Altivec registers */
typedef struct {
unsigned int u[4];
-} __attribute__ ((aligned (16))) elf_vrreg_t;
+} __attribute__ ((__aligned__ (16))) elf_vrreg_t;
typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/pread.c b/libc/sysdeps/unix/sysv/linux/pread.c
index dd8c5e767..4ea67fcb0 100644
--- a/libc/sysdeps/unix/sysv/linux/pread.c
+++ b/libc/sysdeps/unix/sysv/linux/pread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -34,13 +34,6 @@
# define __NR_pread __NR_pread64
#endif
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread (int fd, void *buf, size_t count,
- off_t offset) internal_function;
-# endif
-
static ssize_t
#ifdef NO_CANCELLATION
@@ -50,15 +43,9 @@ do_pread (int fd, void *buf, size_t count, off_t offset)
{
ssize_t result;
- /* First try the syscall. */
assert (sizeof (offset) == 4);
result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count,
__LONG_LONG_PAIR (offset >> 31, offset));
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread (fd, buf, count, offset);
-# endif
return result;
}
@@ -85,11 +72,3 @@ __libc_pread (fd, buf, count, offset)
strong_alias (__libc_pread, __pread)
weak_alias (__libc_pread, pread)
-
-# define __libc_pread(fd, buf, count, offset) \
- static internal_function __emulate_pread (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/pread64.c b/libc/sysdeps/unix/sysv/linux/pread64.c
index 8d2d02bfe..897b5674a 100644
--- a/libc/sysdeps/unix/sysv/linux/pread64.c
+++ b/libc/sysdeps/unix/sysv/linux/pread64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -34,28 +33,15 @@
# define __NR_pread __NR_pread64
#endif
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
- off64_t offset) internal_function;
-# endif
-
static ssize_t
do_pread64 (int fd, void *buf, size_t count, off64_t offset)
{
ssize_t result;
- /* First try the syscall. */
result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread64 (fd, buf, count, offset);
-# endif
return result;
}
@@ -82,11 +68,3 @@ __libc_pread64 (fd, buf, count, offset)
weak_alias (__libc_pread64, __pread64)
weak_alias (__libc_pread64, pread64)
-
-# define __libc_pread64(fd, buf, count, offset) \
- static internal_function __emulate_pread64 (fd, buf, count, offset)
-#endif
-
-# if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread64.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/pselect.c b/libc/sysdeps/unix/sysv/linux/pselect.c
index 8864d7806..11aa7d1b0 100644
--- a/libc/sysdeps/unix/sysv/linux/pselect.c
+++ b/libc/sysdeps/unix/sysv/linux/pselect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
@@ -52,11 +52,11 @@ __pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
be created. */
struct
{
- const sigset_t *ss;
- size_t ss_len;
+ __syscall_ulong_t ss;
+ __syscall_ulong_t ss_len;
} data;
- data.ss = sigmask;
+ data.ss = (__syscall_ulong_t) (uintptr_t) sigmask;
data.ss_len = _NSIG / 8;
int result;
diff --git a/libc/sysdeps/unix/sysv/linux/ptsname.c b/libc/sysdeps/unix/sysv/linux/ptsname.c
index fb097698f..bf8ca864a 100644
--- a/libc/sysdeps/unix/sysv/linux/ptsname.c
+++ b/libc/sysdeps/unix/sysv/linux/ptsname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2001, 2002, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
@@ -127,12 +127,6 @@ __ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
}
ptyno = minor (stp->st_rdev);
-#if __LINUX_KERNEL_VERSION < 131443
- /* This is for the old BSD pseudo terminals. As of Linux
- 2.1.115 these are no longer supported. */
- if (major (stp->st_rdev) == 4)
- ptyno -= 128;
-#endif
if (ptyno / 16 >= strlen (__libc_ptyname1))
{
diff --git a/libc/sysdeps/unix/sysv/linux/pwrite.c b/libc/sysdeps/unix/sysv/linux/pwrite.c
index 6d1ab8624..c4940fcdd 100644
--- a/libc/sysdeps/unix/sysv/linux/pwrite.c
+++ b/libc/sysdeps/unix/sysv/linux/pwrite.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -34,13 +34,6 @@
# define __NR_pwrite __NR_pwrite64
#endif
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
- off_t offset) internal_function;
-# endif
-
static ssize_t
#ifdef NO_CANCELLATION
@@ -50,15 +43,9 @@ do_pwrite (int fd, const void *buf, size_t count, off_t offset)
{
ssize_t result;
- /* First try the syscall. */
assert (sizeof (offset) == 4);
result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count,
__LONG_LONG_PAIR (offset >> 31, offset));
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite (fd, buf, count, offset);
-# endif
return result;
}
@@ -85,11 +72,3 @@ __libc_pwrite (fd, buf, count, offset)
strong_alias (__libc_pwrite, __pwrite)
weak_alias (__libc_pwrite, pwrite)
-
-# define __libc_pwrite(fd, buf, count, offset) \
- static internal_function __emulate_pwrite (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/pwrite64.c b/libc/sysdeps/unix/sysv/linux/pwrite64.c
index 5deab9d64..ad945a290 100644
--- a/libc/sysdeps/unix/sysv/linux/pwrite64.c
+++ b/libc/sysdeps/unix/sysv/linux/pwrite64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -34,28 +33,15 @@
# define __NR_pwrite __NR_pwrite64
#endif
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
- off64_t offset) internal_function;
-# endif
-
static ssize_t
do_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
{
ssize_t result;
- /* First try the syscall. */
result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
return result;
}
@@ -83,11 +69,3 @@ __libc_pwrite64 (fd, buf, count, offset)
weak_alias (__libc_pwrite64, __pwrite64)
libc_hidden_weak (__pwrite64)
weak_alias (__libc_pwrite64, pwrite64)
-
-# define __libc_pwrite64(fd, buf, count, offset) \
- static internal_function __emulate_pwrite64 (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite64.c>
-#endif
diff --git a/libc/sysdeps/powerpc/soft-fp/q_dtoq.c b/libc/sysdeps/unix/sysv/linux/s390/bits/hwcap.h
index cf496e5a8..7f03ffe46 100644
--- a/libc/sysdeps/powerpc/soft-fp/q_dtoq.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/bits/hwcap.h
@@ -1,9 +1,6 @@
-/* Software floating-point emulation.
- Return (long double)(a)
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
+/* Defines for bits in AT_HWCAP.
+ Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,25 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include "soft-fp.h"
-#include "double.h"
-#include "quad.h"
-
-long double _q_dtoq(const double a)
-{
- FP_DECL_EX;
- FP_DECL_D(A);
- FP_DECL_Q(C);
- long double c;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_RAW_D(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
- FP_EXTEND(Q,D,4,2,C,A);
-#else
- FP_EXTEND(Q,D,2,1,C,A);
+#ifndef _SYS_AUXV_H
+# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
#endif
- FP_PACK_RAW_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
-}
+
+/*
+ * The following must match the kernels asm/elf.h.
+ * Note that these are *not* the same as the STORE FACILITY LIST bits.
+ */
+#define HWCAP_S390_ESAN3 1
+#define HWCAP_S390_ZARCH 2
+#define HWCAP_S390_STFLE 4
+#define HWCAP_S390_MSA 8
+#define HWCAP_S390_LDISP 16
+#define HWCAP_S390_EIMM 32
+#define HWCAP_S390_DFP 64
+#define HWCAP_S390_HPAGE 128
+#define HWCAP_S390_ETF3EH 256
+#define HWCAP_S390_HIGH_GPRS 512
diff --git a/libc/sysdeps/unix/sysv/linux/s390/bits/mman.h b/libc/sysdeps/unix/sysv/linux/s390/bits/mman.h
index 094afbe56..6369e8a81 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/bits/mman.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/bits/mman.h
@@ -97,6 +97,9 @@
# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
+# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
+ overrides the coredump filter bits. */
+# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
# define MADV_HWPOISON 100 /* Poison a page for testing. */
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
index af7021f1e..def84cc79 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. Linux/s390 version.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,6 +44,7 @@
#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __FSWORD_T_TYPE __SWORD_TYPE
#define __ID_T_TYPE __U32_TYPE
#define __CLOCK_T_TYPE __SLONGWORD_TYPE
#define __TIME_T_TYPE __SLONGWORD_TYPE
@@ -63,7 +64,8 @@
/* size_t is unsigned long int on s390 -m31. */
#define __SSIZE_T_TYPE __SLONGWORD_TYPE
#endif
-#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
diff --git a/libc/sysdeps/unix/sysv/linux/s390/gettimeofday.c b/libc/sysdeps/unix/sysv/linux/s390/gettimeofday.c
index 63faef85b..efbf1e811 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/gettimeofday.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/gettimeofday.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,6 @@
#include <time.h>
#include <hp-timing.h>
-#undef __gettimeofday
#include <bits/libc-vdso.h>
/* Get the current time of day and timezone information,
@@ -36,6 +35,6 @@ __gettimeofday (tv, tz)
{
return INLINE_VSYSCALL (gettimeofday, 2, CHECK_1 (tv), CHECK_1 (tz));
}
-
-INTDEF (__gettimeofday)
+libc_hidden_def (__gettimeofday)
weak_alias (__gettimeofday, gettimeofday)
+libc_hidden_weak (gettimeofday)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c b/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c
index bc471454e..cc0503cbc 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2001,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,6 @@
#include <bp-checks.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
/*
In Linux 2.1.x the chown functions have been changed. A new function lchown
@@ -38,58 +37,12 @@
/* Running under Linux > 2.1.80. */
-#ifdef __NR_chown32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif /* __NR_chown32 */
+/* Consider moving to syscalls.list. */
int
__real_chown (const char *file, uid_t owner, gid_t group)
{
-#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
-#else
- static int __libc_old_chown;
- int result;
-
- if (!__libc_old_chown)
- {
- int saved_errno = errno;
-# ifdef __NR_chown32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
- int saved_errno = errno;
-
- result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
- if (result == 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_chown32 */
- if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- result = INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);
-
- if (result >= 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_old_chown = 1;
- }
-
- return __lchown (file, owner, group);
-#endif
}
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/lchown.c b/libc/sysdeps/unix/sysv/linux/s390/s390-32/lchown.c
index 754245a8f..6190d02a6 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/lchown.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/lchown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,46 +23,13 @@
#include <bp-checks.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-# ifdef __NR_lchown32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-# endif /* __NR_lchown32 */
+/* Consider moving to syscalls.list. */
int
__lchown (const char *file, uid_t owner, gid_t group)
{
-# if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group);
-# else
-# ifdef __NR_lchown32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
- int saved_errno = errno;
-
- result = INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group);
- if (result == 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_lchown32 */
-
- if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- return INLINE_SYSCALL (lchown, 3, CHECK_STRING (file), owner, group);
-# endif
}
weak_alias (__lchown, lchown)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
index c015dafbf..728550bdf 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
@@ -1758,11 +1758,13 @@ GLIBC_2.15
scandirat64 F
GLIBC_2.16
GLIBC_2.16 A
+ __getauxval F
__poll_chk F
__ppoll_chk F
aligned_alloc F
c16rtomb F
c32rtomb F
+ getauxval F
mbrtoc16 F
mbrtoc32 F
timespec_get F
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
index 8d57add92..1ca4811ea 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
@@ -75,11 +75,13 @@ GLIBC_2.15
scandirat64 F
GLIBC_2.16
GLIBC_2.16 A
+ __getauxval F
__poll_chk F
__ppoll_chk F
aligned_alloc F
c16rtomb F
c32rtomb F
+ getauxval F
mbrtoc16 F
mbrtoc32 F
timespec_get F
diff --git a/libc/sysdeps/unix/sysv/linux/s390/sys/ucontext.h b/libc/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
index 5dd023461..e66854d9d 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
This file is part of the GNU C Library.
@@ -33,7 +33,7 @@ typedef struct
{
unsigned long mask;
unsigned long addr;
-} __attribute__ ((aligned(8))) __psw_t;
+} __attribute__ ((__aligned__(8))) __psw_t;
/* Type for a general-purpose register. */
typedef unsigned long greg_t;
@@ -49,7 +49,7 @@ typedef unsigned long greg_t;
# define NGREG 36
#endif
/* Must match kernels psw_t alignment. */
-typedef greg_t gregset_t[NGREG] __attribute__ ((aligned(8)));
+typedef greg_t gregset_t[NGREG] __attribute__ ((__aligned__(8)));
typedef union
{
diff --git a/libc/sysdeps/unix/sysv/linux/setegid.c b/libc/sysdeps/unix/sysv/linux/setegid.c
index bc26c99ef..5ed44ed70 100644
--- a/libc/sysdeps/unix/sysv/linux/setegid.c
+++ b/libc/sysdeps/unix/sysv/linux/setegid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,13 +18,8 @@
#include <errno.h>
#include <unistd.h>
#include <setxid.h>
-#include <kernel-features.h>
-#if defined __NR_setresgid || __ASSUME_SETRESGID_SYSCALL > 0
-
-extern int __setresgid (gid_t rgid, gid_t egid, gid_t sgid);
-
int
setegid (gid_t gid)
{
@@ -36,25 +31,14 @@ setegid (gid_t gid)
return -1;
}
-# if __ASSUME_32BITUIDS > 0 && defined __NR_setresgid32
+#ifdef __NR_setresgid32
result = INLINE_SETXID_SYSCALL (setresgid32, 3, -1, gid, -1);
-# else
- /* First try the syscall. */
+#else
result = INLINE_SETXID_SYSCALL (setresgid, 3, -1, gid, -1);
-# if __ASSUME_SETRESGID_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use emulation. This may not work
- since `setregid' also sets the saved group ID when GID is not
- equal to the real group ID, making it impossible to switch back. */
- result = __setregid (-1, gid);
-# endif
-# endif
+#endif
return result;
}
#ifndef setegid
libc_hidden_def (setegid)
#endif
-#else
-# include <sysdeps/unix/bsd/setegid.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/seteuid.c b/libc/sysdeps/unix/sysv/linux/seteuid.c
index 21625b406..e9bd82d86 100644
--- a/libc/sysdeps/unix/sysv/linux/seteuid.c
+++ b/libc/sysdeps/unix/sysv/linux/seteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,1999,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,13 +18,8 @@
#include <errno.h>
#include <unistd.h>
#include <setxid.h>
-#include <kernel-features.h>
-#if defined __NR_setresuid || __ASSUME_SETRESUID_SYSCALL > 0
-
-extern int __setresuid (uid_t ruid, uid_t euid, uid_t suid);
-
int
seteuid (uid_t uid)
{
@@ -36,25 +31,14 @@ seteuid (uid_t uid)
return -1;
}
-# if __ASSUME_32BITUIDS > 0 && defined __NR_setresuid32
+#ifdef __NR_setresuid32
result = INLINE_SETXID_SYSCALL (setresuid32, 3, -1, uid, -1);
-# else
- /* First try the syscall. */
+#else
result = INLINE_SETXID_SYSCALL (setresuid, 3, -1, uid, -1);
-# if __ASSUME_SETRESUID_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use emulation. This may not work
- since `setreuid' also sets the saved user ID when UID is not
- equal to the real user ID, making it impossible to switch back. */
- result = __setreuid (-1, uid);
-# endif
-# endif
+#endif
return result;
}
#ifndef seteuid
libc_hidden_def (seteuid)
#endif
-#else
-# include <sysdeps/unix/bsd/seteuid.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/sh/bits/mman.h b/libc/sysdeps/unix/sysv/linux/sh/bits/mman.h
index d7f2ed53a..c535b7c30 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/bits/mman.h
+++ b/libc/sysdeps/unix/sysv/linux/sh/bits/mman.h
@@ -96,6 +96,9 @@
# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
+# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
+ overrides the coredump filter bits. */
+# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
# define MADV_HWPOISON 100 /* Poison a page for testing. */
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/sh/chown.c b/libc/sysdeps/unix/sysv/linux/sh/chown.c
index 72582b9a4..5ae94b6b2 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/chown.c
+++ b/libc/sysdeps/unix/sysv/linux/sh/chown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,46 +23,13 @@
#include <bp-checks.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
-#ifdef __NR_chown32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif /* __NR_chown32 */
+/* Consider moving to syscalls.list. */
int
__chown (const char *file, uid_t owner, gid_t group)
{
-#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
-#else
-# ifdef __NR_chown32
- if (__libc_missing_32bit_uids <= 0)
- {
- int result;
- int saved_errno = errno;
-
- result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
- if (result == 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_32bit_uids = 1;
- }
-# endif /* __NR_chown32 */
-
- if (((owner + 1) > (gid_t) ((__kernel_uid_t) -1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);
-#endif
}
libc_hidden_def (__chown)
weak_alias (__chown, chown)
diff --git a/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
index ce6b549ac..ae57b67f0 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
@@ -75,11 +75,13 @@ GLIBC_2.15
scandirat64 F
GLIBC_2.16
GLIBC_2.16 A
+ __getauxval F
__poll_chk F
__ppoll_chk F
aligned_alloc F
c16rtomb F
c32rtomb F
+ getauxval F
mbrtoc16 F
mbrtoc32 F
timespec_get F
diff --git a/libc/sysdeps/unix/sysv/linux/sh/pread.c b/libc/sysdeps/unix/sysv/linux/sh/pread.c
index 30cbec63a..3e7702f10 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/pread.c
+++ b/libc/sysdeps/unix/sysv/linux/sh/pread.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -35,12 +34,6 @@
# define __NR_pread __NR_pread64
#endif
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread (int fd, void *buf, size_t count,
- off_t offset) internal_function;
-# endif
ssize_t
__libc_pread (fd, buf, count, offset)
@@ -53,27 +46,15 @@ __libc_pread (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- /* First try the syscall. */
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread (fd, buf, count, offset);
-# endif
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
- /* First try the syscall. */
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -82,11 +63,3 @@ __libc_pread (fd, buf, count, offset)
strong_alias (__libc_pread, __pread)
weak_alias (__libc_pread, pread)
-
-# define __libc_pread(fd, buf, count, offset) \
- static internal_function __emulate_pread (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/sh/pread64.c b/libc/sysdeps/unix/sysv/linux/sh/pread64.c
index 6c0bf5d2f..523ed7f82 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/pread64.c
+++ b/libc/sysdeps/unix/sysv/linux/sh/pread64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -34,12 +33,6 @@
# define __NR_pread __NR_pread64
#endif
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
- off64_t offset) internal_function;
-# endif
ssize_t
__libc_pread64 (fd, buf, count, offset)
@@ -52,29 +45,17 @@ __libc_pread64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- /* First try the syscall. */
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread64 (fd, buf, count, offset);
-# endif
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
- /* First try the syscall. */
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
-# if __ASSUME_PREAD_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pread64 (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -83,11 +64,3 @@ __libc_pread64 (fd, buf, count, offset)
weak_alias (__libc_pread64, __pread64)
weak_alias (__libc_pread64, pread64)
-
-# define __libc_pread64(fd, buf, count, offset) \
- static internal_function __emulate_pread64 (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread64.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/sh/pwrite.c b/libc/sysdeps/unix/sysv/linux/sh/pwrite.c
index 75e0e9850..e8052757a 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/pwrite.c
+++ b/libc/sysdeps/unix/sysv/linux/sh/pwrite.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -35,12 +34,6 @@
# define __NR_pwrite __NR_pwrite64
#endif
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
- off_t offset) internal_function;
-# endif
ssize_t
__libc_pwrite (fd, buf, count, offset)
@@ -53,27 +46,15 @@ __libc_pwrite (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- /* First try the syscall. */
result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite (fd, buf, count, offset);
-# endif
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
- /* First try the syscall. */
result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -82,11 +63,3 @@ __libc_pwrite (fd, buf, count, offset)
strong_alias (__libc_pwrite, __pwrite)
weak_alias (__libc_pwrite, pwrite)
-
-# define __libc_pwrite(fd, buf, count, offset) \
- static internal_function __emulate_pwrite (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c b/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c
index 0fd21af12..8f80fea49 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c
+++ b/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ralf Baechle <ralf@gnu.org>, 1998.
@@ -34,12 +33,6 @@
# define __NR_pwrite __NR_pwrite64
#endif
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
- off64_t offset) internal_function;
-# endif
ssize_t
__libc_pwrite64 (fd, buf, count, offset)
@@ -52,30 +45,18 @@ __libc_pwrite64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- /* First try the syscall. */
result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
- /* First try the syscall. */
result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
-# if __ASSUME_PWRITE_SYSCALL == 0
- if (result == -1 && errno == ENOSYS)
- /* No system call available. Use the emulation. */
- result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
LIBC_CANCEL_RESET (oldtype);
@@ -85,11 +66,3 @@ __libc_pwrite64 (fd, buf, count, offset)
weak_alias (__libc_pwrite64, __pwrite64)
libc_hidden_weak (__pwrite64)
weak_alias (__libc_pwrite64, pwrite64)
-
-# define __libc_pwrite64(fd, buf, count, offset) \
- static internal_function __emulate_pwrite64 (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite64.c>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/sigaction.c b/libc/sysdeps/unix/sysv/linux/sigaction.c
index 37f7a2c14..01fb16e55 100644
--- a/libc/sysdeps/unix/sysv/linux/sigaction.c
+++ b/libc/sysdeps/unix/sysv/linux/sigaction.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2000,2002,2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,12 +29,6 @@
translate it here. */
#include <kernel_sigaction.h>
-#if __ASSUME_REALTIME_SIGNALS == 0
-/* The variable is shared between all wrappers around signal handling
- functions which have RT equivalents. This is the definition. */
-int __libc_missing_rt_sigs;
-#endif
-
/* If ACT is not NULL, change the action for SIG to *ACT.
If OACT is not NULL, put the old action for SIG in *OACT. */
@@ -44,87 +38,36 @@ __libc_sigaction (sig, act, oact)
const struct sigaction *act;
struct sigaction *oact;
{
-#if __ASSUME_REALTIME_SIGNALS == 0
- struct old_kernel_sigaction k_sigact, k_osigact;
-#endif
int result;
-#if defined __NR_rt_sigaction || __ASSUME_REALTIME_SIGNALS > 0
- /* First try the RT signals. */
-# if __ASSUME_REALTIME_SIGNALS == 0
- if (!__libc_missing_rt_sigs)
-# endif
- {
- struct kernel_sigaction kact, koact;
- /* Save the current error value for later. We need not do this
- if we are guaranteed to have realtime signals. */
-# if __ASSUME_REALTIME_SIGNALS == 0
- int saved_errno = errno;
-# endif
-
- if (act)
- {
- kact.k_sa_handler = act->sa_handler;
- memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
- kact.sa_flags = act->sa_flags;
-# ifdef HAVE_SA_RESTORER
- kact.sa_restorer = act->sa_restorer;
-# endif
- }
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- result = INLINE_SYSCALL (rt_sigaction, 4, sig,
- act ? __ptrvalue (&kact) : NULL,
- oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
+ struct kernel_sigaction kact, koact;
-# if __ASSUME_REALTIME_SIGNALS == 0
- if (result >= 0 || errno != ENOSYS)
-# endif
- {
- if (oact && result >= 0)
- {
- oact->sa_handler = koact.k_sa_handler;
- memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
- oact->sa_flags = koact.sa_flags;
-# ifdef HAVE_SA_RESTORER
- oact->sa_restorer = koact.sa_restorer;
-# endif
- }
- return result;
- }
-
-# if __ASSUME_REALTIME_SIGNALS == 0
- __set_errno (saved_errno);
- __libc_missing_rt_sigs = 1;
-# endif
- }
-#endif
-
-#if __ASSUME_REALTIME_SIGNALS == 0
if (act)
{
- k_sigact.k_sa_handler = act->sa_handler;
- k_sigact.sa_mask = act->sa_mask.__val[0];
- k_sigact.sa_flags = act->sa_flags;
-# ifdef HAVE_SA_RESTORER
- k_sigact.sa_restorer = act->sa_restorer;
-# endif
+ kact.k_sa_handler = act->sa_handler;
+ memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+ kact.sa_flags = act->sa_flags;
+#ifdef HAVE_SA_RESTORER
+ kact.sa_restorer = act->sa_restorer;
+#endif
}
- result = INLINE_SYSCALL (sigaction, 3, sig,
- act ? __ptrvalue (&k_sigact) : NULL,
- oact ? __ptrvalue (&k_osigact) : NULL);
+
+ /* XXX The size argument hopefully will have to be changed to the
+ real size of the user-level sigset_t. */
+ result = INLINE_SYSCALL (rt_sigaction, 4, sig,
+ act ? __ptrvalue (&kact) : NULL,
+ oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
+
if (oact && result >= 0)
{
- oact->sa_handler = k_osigact.k_sa_handler;
- oact->sa_mask.__val[0] = k_osigact.sa_mask;
- oact->sa_flags = k_osigact.sa_flags;
-# ifdef HAVE_SA_RESTORER
- oact->sa_restorer = k_osigact.sa_restorer;
-# endif
+ oact->sa_handler = koact.k_sa_handler;
+ memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+ oact->sa_flags = koact.sa_flags;
+#ifdef HAVE_SA_RESTORER
+ oact->sa_restorer = koact.sa_restorer;
+#endif
}
return result;
-#endif
}
libc_hidden_def (__libc_sigaction)
diff --git a/libc/sysdeps/unix/sysv/linux/sigpending.c b/libc/sysdeps/unix/sysv/linux/sigpending.c
index 91d08db17..7174b4ae3 100644
--- a/libc/sysdeps/unix/sysv/linux/sigpending.c
+++ b/libc/sysdeps/unix/sysv/linux/sigpending.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,37 +26,11 @@
#include <kernel-features.h>
-/* The variable is shared between all wrappers around signal handling
- functions which have RT equivalents. The definition is in sigaction.c. */
-extern int __libc_missing_rt_sigs;
-
-
/* Change the set of blocked signals to SET,
wait until a signal arrives, and restore the set of blocked signals. */
int
sigpending (set)
sigset_t *set;
{
-#if __ASSUME_REALTIME_SIGNALS > 0
return INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8);
-#else
-# ifdef __NR_rt_sigpending
- /* First try the RT signals. */
- if (!__libc_missing_rt_sigs)
- {
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- int saved_errno = errno;
- int result = INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8);
-
- if (result >= 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_rt_sigs = 1;
- }
-# endif
-
- return INLINE_SYSCALL (sigpending, 1, CHECK_SIGSET (set));
-#endif
}
diff --git a/libc/sysdeps/unix/sysv/linux/sigprocmask.c b/libc/sysdeps/unix/sysv/linux/sigprocmask.c
index 2e91660f9..a5ac4dd50 100644
--- a/libc/sysdeps/unix/sysv/linux/sigprocmask.c
+++ b/libc/sysdeps/unix/sysv/linux/sigprocmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2001,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,11 +27,6 @@
#include <kernel-features.h>
-/* The variable is shared between all wrappers around signal handling
- functions which have RT equivalents. The definition is in sigaction.c. */
-extern int __libc_missing_rt_sigs;
-
-
/* Get and/or change the set of blocked signals. */
int
__sigprocmask (how, set, oset)
@@ -60,31 +55,7 @@ __sigprocmask (how, set, oset)
}
#endif
-#if __ASSUME_REALTIME_SIGNALS > 0
return INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET_NULL_OK (set),
CHECK_SIGSET_NULL_OK (oset), _NSIG / 8);
-#else
-# ifdef __NR_rt_sigprocmask
- /* First try the RT signals. */
- if (!__libc_missing_rt_sigs)
- {
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- int saved_errno = errno;
- int result = INLINE_SYSCALL (rt_sigprocmask, 4, how,
- CHECK_SIGSET_NULL_OK (set),
- CHECK_SIGSET_NULL_OK (oset), _NSIG / 8);
-
- if (result >= 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_rt_sigs = 1;
- }
-# endif
-
- return INLINE_SYSCALL (sigprocmask, 3, how, CHECK_SIGSET_NULL_OK (set),
- CHECK_SIGSET_NULL_OK (oset));
-#endif
}
weak_alias (__sigprocmask, sigprocmask)
diff --git a/libc/sysdeps/unix/sysv/linux/sigsuspend.c b/libc/sysdeps/unix/sysv/linux/sigsuspend.c
index 30b8b585b..e1ee87b29 100644
--- a/libc/sysdeps/unix/sysv/linux/sigsuspend.c
+++ b/libc/sysdeps/unix/sysv/linux/sigsuspend.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,41 +26,11 @@
#include <kernel-features.h>
-#if !__ASSUME_REALTIME_SIGNALS
-/* The variable is shared between all wrappers around signal handling
- functions which have RT equivalents. The definition is in sigaction.c. */
-extern int __libc_missing_rt_sigs;
-
-
-static int
-do_sigsuspend (const sigset_t *set)
-{
-# ifdef __NR_rt_sigsuspend
- /* First try the RT signals. */
- if (!__libc_missing_rt_sigs)
- {
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- int saved_errno = errno;
- int result = INLINE_SYSCALL (rt_sigsuspend, 2,
- CHECK_SIGSET (set), _NSIG / 8);
- if (result >= 0 || errno != ENOSYS)
- return result;
-
- __set_errno (saved_errno);
- __libc_missing_rt_sigs = 1;
- }
-# endif
-
- return INLINE_SYSCALL (sigsuspend, 3, 0, 0, set->__val[0]);
-}
-#else
static inline int __attribute__ ((always_inline))
do_sigsuspend (const sigset_t *set)
{
return INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set), _NSIG / 8);
}
-#endif
/* Change the set of blocked signals to SET,
wait until a signal arrives, and restore the set of blocked signals. */
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/bits/mman.h b/libc/sysdeps/unix/sysv/linux/sparc/bits/mman.h
index fb9c75fe2..6d4dd7ee5 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/bits/mman.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/bits/mman.h
@@ -99,6 +99,9 @@
# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
+# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
+ overrides the coredump filter bits. */
+# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
# define MADV_HWPOISON 100 /* Poison a page for testing. */
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
index bba82b37a..b65a1a5cd 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,6 +44,7 @@
#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __FSWORD_T_TYPE __SWORD_TYPE
#define __ID_T_TYPE __U32_TYPE
#define __CLOCK_T_TYPE __SLONGWORD_TYPE
#define __TIME_T_TYPE __SLONGWORD_TYPE
@@ -57,7 +58,8 @@
#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
#define __FSID_T_TYPE struct { int __val[2]; }
#define __SSIZE_T_TYPE __SWORD_TYPE
-#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist
index 815e8af40..1804348cf 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist
@@ -1753,6 +1753,7 @@ GLIBC_2.15
scandirat64 F
GLIBC_2.16
GLIBC_2.16 A
+ __getauxval F
__getshmlba F
__poll_chk F
__ppoll_chk F
@@ -1761,6 +1762,7 @@ GLIBC_2.16
aligned_alloc F
c16rtomb F
c32rtomb F
+ getauxval F
mbrtoc16 F
mbrtoc32 F
sys_errlist D 0x220
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c
index 87cb23a51..464f0b502 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c
@@ -1,6 +1,5 @@
/* Semctl for architectures where word sized unions are passed indirectly
- Copyright (C) 1995,1997,1998,2000,2002,2003,2004,2006
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -27,7 +26,6 @@
#include <string.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
#include <shlib-compat.h>
struct __old_semid_ds
@@ -55,14 +53,6 @@ union semun
#include <bp-checks.h>
#include <bp-semctl.h> /* definition of CHECK_SEMCTL needs union semum */
-#ifdef __NR_getuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
- uids. */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif
-
/* Return identifier for array of NSEMS semaphores associated with
KEY. */
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
@@ -126,82 +116,8 @@ __new_semctl (int semid, int semnum, int cmd, ...)
break;
}
-#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
-#else
- switch (cmd) {
- case SEM_STAT:
- case IPC_STAT:
- case IPC_SET:
- break;
- default:
- return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd));
- }
-
- {
- int result;
- struct __old_semid_ds old;
- struct semid_ds *buf;
-
-#ifdef __NR_getuid32
- if (__libc_missing_32bit_uids <= 0)
- {
- if (__libc_missing_32bit_uids < 0)
- {
- int save_errno = errno;
-
- /* Test presence of new IPC by testing for getuid32 syscall. */
- result = INLINE_SYSCALL (getuid32, 0);
- if (result == -1 && errno == ENOSYS)
- __libc_missing_32bit_uids = 1;
- else
- __libc_missing_32bit_uids = 0;
- __set_errno(save_errno);
- }
- if (__libc_missing_32bit_uids <= 0)
- {
- result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
- CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
- return result;
- }
- }
-#endif
-
- buf = arg.buf;
- arg.__old_buf = &old;
- if (cmd == IPC_SET)
- {
- old.sem_perm.uid = buf->sem_perm.uid;
- old.sem_perm.gid = buf->sem_perm.gid;
- old.sem_perm.mode = buf->sem_perm.mode;
- if (old.sem_perm.uid != buf->sem_perm.uid ||
- old.sem_perm.gid != buf->sem_perm.gid)
- {
- __set_errno (EINVAL);
- return -1;
- }
- }
- result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd));
- if (result != -1 && cmd != IPC_SET)
- {
- memset(buf, 0, sizeof(*buf));
- buf->sem_perm.__key = old.sem_perm.__key;
- buf->sem_perm.uid = old.sem_perm.uid;
- buf->sem_perm.gid = old.sem_perm.gid;
- buf->sem_perm.cuid = old.sem_perm.cuid;
- buf->sem_perm.cgid = old.sem_perm.cgid;
- buf->sem_perm.mode = old.sem_perm.mode;
- buf->sem_perm.__seq = old.sem_perm.__seq;
- buf->sem_otime = old.sem_otime;
- buf->sem_ctime = old.sem_ctime;
- buf->sem_nsems = old.sem_nsems;
- }
- return result;
- }
-#endif
}
versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2);
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
index c3201b8a9..9a535e801 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
@@ -27,106 +27,38 @@
static void __rt_sigreturn_stub (void);
static void __sigreturn_stub (void);
-/* The variable is shared between all wrappers around signal handling
- functions which have RT equivalents. */
-int __libc_missing_rt_sigs;
-
int
__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
{
- struct old_kernel_sigaction k_sigact, k_osigact;
+ struct kernel_sigaction kact, koact;
+ unsigned long stub = 0;
int ret;
-#ifdef __NR_rt_sigaction
- /* First try the RT signals. */
- if (!__libc_missing_rt_sigs)
- {
- struct kernel_sigaction kact, koact;
- unsigned long stub = 0;
- int saved_errno = errno;
-
- if (act)
- {
- kact.k_sa_handler = act->sa_handler;
- memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
- if (((kact.sa_flags = act->sa_flags) & SA_SIGINFO) != 0)
- stub = (unsigned long) &__rt_sigreturn_stub;
- else
- stub = (unsigned long) &__sigreturn_stub;
- stub -= 8;
- kact.sa_restorer = NULL;
- }
-
- /* XXX The size argument hopefully will have to be changed to the
- real size of the user-level sigset_t. */
- ret = INLINE_SYSCALL (rt_sigaction, 5, sig, act ? &kact : 0,
- oact ? &koact : 0, stub, _NSIG / 8);
-
- if (ret >= 0 || errno != ENOSYS)
- {
- if (oact && ret >= 0)
- {
- oact->sa_handler = koact.k_sa_handler;
- memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
- oact->sa_flags = koact.sa_flags;
- oact->sa_restorer = koact.sa_restorer;
- }
- return ret;
- }
-
- __set_errno (saved_errno);
- __libc_missing_rt_sigs = 1;
- }
-#endif
-
- /* Magic to tell the kernel we are using "new-style" signals, in that
- the signal table is not kept in userspace. Not the same as the
- really-new-style rt signals. */
- sig = -sig;
-
if (act)
{
- k_sigact.k_sa_handler = act->sa_handler;
- k_sigact.sa_mask = act->sa_mask.__val[0];
- k_sigact.sa_flags = act->sa_flags;
- k_sigact.sa_restorer = NULL;
+ kact.k_sa_handler = act->sa_handler;
+ memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+ if (((kact.sa_flags = act->sa_flags) & SA_SIGINFO) != 0)
+ stub = (unsigned long) &__rt_sigreturn_stub;
+ else
+ stub = (unsigned long) &__sigreturn_stub;
+ stub -= 8;
+ kact.sa_restorer = NULL;
}
- {
- register int r_syscallnr __asm__("%g1") = __NR_sigaction;
- register int r_sig __asm__("%o0") = sig;
- register struct old_kernel_sigaction *r_act __asm__("%o1");
- register struct old_kernel_sigaction *r_oact __asm__("%o2");
-
- r_act = act ? &k_sigact : NULL;
- r_oact = oact ? &k_osigact : NULL;
+ /* XXX The size argument hopefully will have to be changed to the
+ real size of the user-level sigset_t. */
+ ret = INLINE_SYSCALL (rt_sigaction, 5, sig, act ? &kact : 0,
+ oact ? &koact : 0, stub, _NSIG / 8);
- __asm__ __volatile__("t 0x10\n\t"
- "bcc 1f\n\t"
- " nop\n\t"
- "sub %%g0,%%o0,%%o0\n"
- "1:"
- : "=r"(r_sig)
- : "r"(r_syscallnr), "r"(r_act), "r"(r_oact),
- "0"(r_sig));
-
- ret = r_sig;
- }
-
- if (ret >= 0)
+ if (oact && ret >= 0)
{
- if (oact)
- {
- oact->sa_handler = k_osigact.k_sa_handler;
- oact->sa_mask.__val[0] = k_osigact.sa_mask;
- oact->sa_flags = k_osigact.sa_flags;
- oact->sa_restorer = NULL;
- }
- return ret;
+ oact->sa_handler = koact.k_sa_handler;
+ memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+ oact->sa_flags = koact.sa_flags;
+ oact->sa_restorer = koact.sa_restorer;
}
-
- __set_errno (-ret);
- return -1;
+ return ret;
}
libc_hidden_def (__libc_sigaction)
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist
index 39c06427a..2914d1c21 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist
@@ -74,6 +74,7 @@ GLIBC_2.15
scandirat64 F
GLIBC_2.16
GLIBC_2.16 A
+ __getauxval F
__getshmlba F
__poll_chk F
__ppoll_chk F
@@ -82,6 +83,7 @@ GLIBC_2.16
aligned_alloc F
c16rtomb F
c32rtomb F
+ getauxval F
mbrtoc16 F
mbrtoc32 F
sys_errlist D 0x440
diff --git a/libc/sysdeps/unix/sysv/linux/sys/reboot.h b/libc/sysdeps/unix/sysv/linux/sys/reboot.h
index bc685aebb..39a151f58 100644
--- a/libc/sysdeps/unix/sysv/linux/sys/reboot.h
+++ b/libc/sysdeps/unix/sysv/linux/sys/reboot.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,6 +38,12 @@
/* Stop system and switch power off if possible. */
#define RB_POWER_OFF 0x4321fedc
+/* Suspend system using software suspend. */
+#define RB_SW_SUSPEND 0xd000fce2
+
+/* Reboot system into new kernel. */
+#define RB_KEXEC 0x45584543
+
__BEGIN_DECLS
/* Reboot or halt the system. */
diff --git a/libc/sysdeps/unix/sysv/linux/sys/sysctl.h b/libc/sysdeps/unix/sysv/linux/sys/sysctl.h
index 2c2d68819..cfa71ad27 100644
--- a/libc/sysdeps/unix/sysv/linux/sys/sysctl.h
+++ b/libc/sysdeps/unix/sysv/linux/sys/sysctl.h
@@ -60,6 +60,8 @@
# undef __undef__LINUX_COMPILER_H
#endif
+#include <bits/sysctl.h>
+
__BEGIN_DECLS
/* Read or write system parameters. */
diff --git a/libc/sysdeps/unix/sysv/linux/syscalls.list b/libc/sysdeps/unix/sysv/linux/syscalls.list
index eef6d82b5..9ec0028e6 100644
--- a/libc/sysdeps/unix/sysv/linux/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/syscalls.list
@@ -51,6 +51,7 @@ personality EXTRA personality i:i __personality personality
pipe - pipe i:f __pipe pipe
pipe2 - pipe2 i:fi __pipe2 pipe2
pivot_root EXTRA pivot_root i:ss pivot_root
+poll - poll Ci:pii __libc_poll __poll poll
prctl EXTRA prctl i:iiiii __prctl prctl
putpmsg - putpmsg i:ippii putpmsg
query_module EXTRA query_module i:sipip query_module
diff --git a/libc/sysdeps/unix/sysv/linux/sysctl.mk b/libc/sysdeps/unix/sysv/linux/sysctl.mk
new file mode 100644
index 000000000..8d04d12e2
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/sysctl.mk
@@ -0,0 +1,3 @@
+# sysctl system call has been deprecated. It is provided for backward
+# compatility. New target shouldn't add it (see x86_64/x32/sysctl.mk).
+sysdep_routines += sysctl
diff --git a/libc/sysdeps/unix/sysv/linux/syslog.c b/libc/sysdeps/unix/sysv/linux/syslog.c
index 145e22b52..d01a91ad6 100644
--- a/libc/sysdeps/unix/sysv/linux/syslog.c
+++ b/libc/sysdeps/unix/sysv/linux/syslog.c
@@ -1,10 +1,6 @@
#include <kernel-features.h>
-#if __ASSUME_MSG_NOSIGNAL
-# define NO_SIGPIPE
-# define send_flags MSG_NOSIGNAL
-#else
-# define send_flags 0
-#endif
+#define NO_SIGPIPE
+#define send_flags MSG_NOSIGNAL
#include <misc/syslog.c>
diff --git a/libc/sysdeps/unix/sysv/linux/testrtsig.h b/libc/sysdeps/unix/sysv/linux/testrtsig.h
index cab587b09..f7650ccf3 100644
--- a/libc/sysdeps/unix/sysv/linux/testrtsig.h
+++ b/libc/sysdeps/unix/sysv/linux/testrtsig.h
@@ -1,5 +1,5 @@
/* Test whether RT signals are really available.
- Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -25,11 +25,5 @@
static int
kernel_has_rtsig (void)
{
-#if __ASSUME_REALTIME_SIGNALS
return 1;
-#else
- struct utsname name;
-
- return uname (&name) == 0 && __strverscmp (name.release, "2.1.70") >= 0;
-#endif
}
diff --git a/libc/sysdeps/unix/sysv/linux/ttyname.c b/libc/sysdeps/unix/sysv/linux/ttyname.c
index 0cfb4740b..3dacd40c2 100644
--- a/libc/sysdeps/unix/sysv/linux/ttyname.c
+++ b/libc/sysdeps/unix/sysv/linux/ttyname.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991-1993,1996-2002,2006,2009,2010
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -155,12 +154,7 @@ ttyname (int fd)
return NULL;
}
- if (__builtin_expect (len != -1
-#ifndef __ASSUME_PROC_SELF_FD_SYMLINK
- /* This is for Linux 2.0. */
- && ttyname_buf[0] != '['
-#endif
- , 1))
+ if (__builtin_expect (len != -1, 1))
{
if ((size_t) len >= buflen)
return NULL;
diff --git a/libc/sysdeps/unix/sysv/linux/ttyname_r.c b/libc/sysdeps/unix/sysv/linux/ttyname_r.c
index f097311a1..2dd678134 100644
--- a/libc/sysdeps/unix/sysv/linux/ttyname_r.c
+++ b/libc/sysdeps/unix/sysv/linux/ttyname_r.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991-1993,1995-2001,2003,2006,2010
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -141,12 +140,7 @@ __ttyname_r (int fd, char *buf, size_t buflen)
return ERANGE;
}
- if (__builtin_expect (ret != -1
-#ifndef __ASSUME_PROC_SELF_FD_SYMLINK
- /* This is for Linux 2.0. */
- && buf[0] != '['
-#endif
- , 1))
+ if (__builtin_expect (ret != -1, 1))
{
#define UNREACHABLE_LEN strlen ("(unreachable)")
if (ret > UNREACHABLE_LEN
diff --git a/libc/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c b/libc/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
index 906b5c228..f79142283 100644
--- a/libc/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
+++ b/libc/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
@@ -38,7 +38,13 @@ posix_fallocate (int fd, __off_t offset, __off_t len)
# endif
{
INTERNAL_SYSCALL_DECL (err);
+# ifdef INTERNAL_SYSCALL_TYPES
+ int res = INTERNAL_SYSCALL_TYPES (fallocate, err, 4, int, fd,
+ int, 0, off_t, offset,
+ off_t, len);
+# else
int res = INTERNAL_SYSCALL (fallocate, err, 4, fd, 0, offset, len);
+# endif
if (! INTERNAL_SYSCALL_ERROR_P (res, err))
return 0;
diff --git a/libc/sysdeps/unix/sysv/linux/wordsize-64/preadv.c b/libc/sysdeps/unix/sysv/linux/wordsize-64/preadv.c
new file mode 100644
index 000000000..e36ca8690
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/wordsize-64/preadv.c
@@ -0,0 +1,73 @@
+/* 64-bit preadv.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/param.h>
+/* Hide the preadv64 declaration. */
+#define preadv64 __redirect_preadv64
+#include <sys/uio.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <kernel-features.h>
+
+#ifndef __ASSUME_PREADV
+static ssize_t __atomic_preadv_replacement (int, const struct iovec *,
+ int, off_t) internal_function;
+#endif
+
+ssize_t
+preadv (int fd, const struct iovec *vector, int count, off_t offset)
+{
+#ifdef __NR_preadv
+ ssize_t result;
+
+ if (SINGLE_THREAD_P)
+ result = INLINE_SYSCALL (preadv, 4, fd, vector, count, offset);
+ else
+ {
+ int oldtype = LIBC_CANCEL_ASYNC ();
+
+ result = INLINE_SYSCALL (preadv, 4, fd, vector, count, offset);
+
+ LIBC_CANCEL_RESET (oldtype);
+ }
+# ifdef __ASSUME_PREADV
+ return result;
+# endif
+#endif
+
+#ifndef __ASSUME_PREADV
+# ifdef __NR_preadv
+ if (result >= 0 || errno != ENOSYS)
+ return result;
+# endif
+
+ return __atomic_preadv_replacement (fd, vector, count, offset);
+#endif
+}
+#undef preadv64
+strong_alias (preadv, preadv64)
+
+#ifndef __ASSUME_PREADV
+# define PREADV static internal_function __atomic_preadv_replacement
+# define PREAD __pread
+# define OFF_T off_t
+# include <sysdeps/posix/preadv.c>
+#endif
diff --git a/libc/sysdeps/unix/sysv/linux/wordsize-64/pwritev.c b/libc/sysdeps/unix/sysv/linux/wordsize-64/pwritev.c
new file mode 100644
index 000000000..05644dd0a
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/wordsize-64/pwritev.c
@@ -0,0 +1,73 @@
+/* 64-bit pwritev.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/param.h>
+/* Hide the pwritev64 declaration. */
+#define pwritev64 __redirect_pwritev64
+#include <sys/uio.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <kernel-features.h>
+
+#ifndef __ASSUME_PWRITEV
+static ssize_t __atomic_pwritev_replacement (int, const struct iovec *,
+ int, off_t) internal_function;
+#endif
+
+ssize_t
+pwritev (int fd, const struct iovec *vector, int count, off_t offset)
+{
+#ifdef __NR_pwritev
+ ssize_t result;
+
+ if (SINGLE_THREAD_P)
+ result = INLINE_SYSCALL (pwritev, 4, fd, vector, count, offset);
+ else
+ {
+ int oldtype = LIBC_CANCEL_ASYNC ();
+
+ result = INLINE_SYSCALL (pwritev, 4, fd, vector, count, offset);
+
+ LIBC_CANCEL_RESET (oldtype);
+ }
+# ifdef __ASSUME_PWRITEV
+ return result;
+# endif
+#endif
+
+#ifndef __ASSUME_PWRITEV
+# ifdef __NR_pwritev
+ if (result >= 0 || errno != ENOSYS)
+ return result;
+# endif
+
+ return __atomic_pwritev_replacement (fd, vector, count, offset);
+#endif
+}
+#undef pwritev64
+strong_alias (pwritev, pwritev64)
+
+#ifndef __ASSUME_PWRITEV
+# define PWRITE __pwrite
+# define PWRITEV static internal_function __atomic_pwritev_replacement
+# define OFF_T off_t
+# include <sysdeps/posix/pwritev.c>
+#endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist
index 6f15f00e1..2a1b8e9f9 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist
@@ -70,11 +70,13 @@ GLIBC_2.15
scandirat64 F
GLIBC_2.16
GLIBC_2.16 A
+ __getauxval F
__poll_chk F
__ppoll_chk F
aligned_alloc F
c16rtomb F
c32rtomb F
+ getauxval F
mbrtoc16 F
mbrtoc32 F
timespec_get F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/Makefile b/libc/sysdeps/unix/sysv/linux/x86_64/Makefile
index 9c9e6151d..59a6b0a8b 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/Makefile
@@ -17,6 +17,10 @@ ifeq ($(subdir),csu)
gen-as-const-headers += ucontext_i.sym
endif
+ifeq ($(subdir),misc)
+gen-as-const-headers += sigaltstack-offsets.sym
+endif
+
ifeq ($(subdir),elf)
sysdep_routines += dl-vdso
endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
index 1de7e09e8..d9bdb67d5 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2004,2005,2006,2009,2010,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,9 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
+
+#include <sigaltstack-offsets.h>
.section .rodata.str1.1,"aMS",@progbits,1
.type longjmp_msg,@object
@@ -29,18 +32,18 @@ longjmp_msg:
//#define __longjmp ____longjmp_chk
#ifdef PIC
-# define CALL_FAIL subq $8, %rsp; \
+# define CALL_FAIL sub $8, %RSP_LP; \
cfi_remember_state; \
cfi_def_cfa_offset(16); \
- leaq longjmp_msg(%rip), %rdi; \
+ lea longjmp_msg(%rip), %RDI_LP; \
call HIDDEN_JUMPTARGET(__fortify_fail); \
nop; \
cfi_restore_state
#else
-# define CALL_FAIL subq $8, %rsp; \
+# define CALL_FAIL sub $8, %RSP_LP; \
cfi_remember_state; \
cfi_def_cfa_offset(16); \
- movq $longjmp_msg, %rdi; \
+ mov $longjmp_msg, %RDI_LP; \
call HIDDEN_JUMPTARGET(__fortify_fail); \
nop; \
cfi_restore_state
@@ -52,16 +55,24 @@ longjmp_msg:
.text
ENTRY(____longjmp_chk)
/* Restore registers. */
- movq (JB_RSP*8)(%rdi), %r8
- movq (JB_RBP*8)(%rdi), %r9
- movq (JB_PC*8)(%rdi), %rdx
+ mov (JB_RSP*8)(%rdi), %R8_LP
+ mov (JB_RBP*8)(%rdi),%R9_LP
+ mov (JB_PC*8)(%rdi), %RDX_LP
#ifdef PTR_DEMANGLE
- PTR_DEMANGLE (%r8)
- PTR_DEMANGLE (%r9)
- PTR_DEMANGLE (%rdx)
+ PTR_DEMANGLE (%R8_LP)
+ PTR_DEMANGLE (%R9_LP)
+ PTR_DEMANGLE (%RDX_LP)
+# ifdef __ILP32__
+ /* We ignored the high bits of the %rbp value because only the low
+ bits are mangled. But we cannot presume that %rbp is being used
+ as a pointer and truncate it, so recover the high bits. */
+ movl (JB_RBP*8 + 4)(%rdi), %eax
+ shlq $32, %rax
+ orq %rax, %r9
+# endif
#endif
- cmpq %r8, %rsp
+ cmp %R8_LP, %RSP_LP
jbe .Lok
/* Save function parameters. */
@@ -71,19 +82,19 @@ ENTRY(____longjmp_chk)
cfi_register (%rsi, %rbx)
xorl %edi, %edi
- leaq -24(%rsp), %rsi
+ lea -sizeSS(%rsp), %RSI_LP
movl $__NR_sigaltstack, %eax
syscall
/* Without working sigaltstack we cannot perform the test. */
testl %eax, %eax
jne .Lok2
- testl $1, -16(%rsp)
+ testl $1, (-sizeSS + oSS_FLAGS)(%rsp)
jz .Lfail
- movq -24(%rsp), %rax
- addq -8(%rsp), %rax
- subq %r8, %rax
- cmpq -8(%rsp), %rax
+ mov (-sizeSS + oSS_SP)(%rsp), %RAX_LP
+ add (-sizeSS + oSS_SIZE)(%rsp), %RAX_LP
+ sub %R8_LP, %RAX_LP
+ cmp (-sizeSS + oSS_SIZE)(%rsp), %RAX_LP
jae .Lok2
.Lfail: CALL_FAIL
@@ -93,7 +104,9 @@ ENTRY(____longjmp_chk)
movl %ebx, %esi
cfi_restore (%rsi)
-.Lok: /* We add unwind information for the target here. */
+.Lok:
+ LIBC_PROBE (longjmp, 3, LP_SIZE@%RDI_LP, -4@%esi, LP_SIZE@%RDX_LP)
+ /* We add unwind information for the target here. */
cfi_def_cfa(%rdi, 0)
cfi_register(%rsp,%r8)
cfi_register(%rbp,%r9)
@@ -110,7 +123,9 @@ ENTRY(____longjmp_chk)
movq (JB_R15*8)(%rdi), %r15
/* Set return value for setjmp. */
movl %esi, %eax
- movq %r8,%rsp
+ mov %R8_LP, %RSP_LP
movq %r9,%rbp
+ LIBC_PROBE (longjmp_target, 3,
+ LP_SIZE@%RDI_LP, -4@%eax, LP_SIZE@%RDX_LP)
jmpq *%rdx
END (____longjmp_chk)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/a.out.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/a.out.h
index 228a8d41a..0e4a7c911 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/bits/a.out.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/a.out.h
@@ -2,9 +2,7 @@
# error "Never use <bits/a.out.h> directly; include <a.out.h> instead."
#endif
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
+#ifdef __x86_64__
/* Signal to users of this header that this architecture really doesn't
support a.out binary format. */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
index b38d55cf5..9fa5ecb72 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
@@ -1,6 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/x86-64.
- Copyright (C) 2001,2002,2004,2006,2007,2009,2010,2011
- Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +21,6 @@
#endif
#include <sys/types.h>
-#include <bits/wordsize.h>
#ifdef __USE_GNU
# include <bits/uio.h>
#endif
@@ -65,7 +63,7 @@
#endif
#ifdef __USE_LARGEFILE64
-# if __WORDSIZE == 64
+# ifdef __x86_64__
# define O_LARGEFILE 0
# else
# define O_LARGEFILE 0100000
@@ -78,7 +76,7 @@
#define F_SETFD 2 /* Set file descriptor flags. */
#define F_GETFL 3 /* Get file status flags. */
#define F_SETFL 4 /* Set file status flags. */
-#if __WORDSIZE == 64
+#ifdef __x86_64__
# define F_GETLK 5 /* Get record locking info. */
# define F_SETLK 6 /* Set record locking info (non-blocking). */
# define F_SETLKW 7 /* Set record locking info (blocking). */
diff --git a/libc/sysdeps/powerpc/soft-fp/q_qtou.c b/libc/sysdeps/unix/sysv/linux/x86_64/bits/ipctypes.h
index 48990cd13..7c242adfa 100644
--- a/libc/sysdeps/powerpc/soft-fp/q_qtou.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/ipctypes.h
@@ -1,9 +1,6 @@
-/* Software floating-point emulation.
- Return (unsigned int)a
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
+/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM.
+ Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,19 +16,18 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FP_ROUNDMODE FP_RND_ZERO
-#include "soft-fp.h"
-#include "quad.h"
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipctypes.h> directly; include <sys/ipc.h> instead."
+#endif
-unsigned int _q_qtou(const long double a)
-{
- FP_DECL_EX;
- FP_DECL_Q(A);
- unsigned int r;
+#ifndef _BITS_IPCTYPES_H
+#define _BITS_IPCTYPES_H 1
- FP_UNPACK_RAW_Q(A, a);
- FP_TO_INT_Q(r, A, 32, -1);
- FP_HANDLE_EXCEPTIONS;
+/* Used in `struct shmid_ds'. */
+# ifdef __x86_64__
+typedef int __ipc_pid_t;
+# else
+typedef unsigned short int __ipc_pid_t;
+# endif
- return r;
-}
+#endif /* bits/ipctypes.h */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/mman.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
index 7ec224798..28b91603c 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
@@ -1,6 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/x86_64 version.
- Copyright (C) 2001,2003,2005,2006,2009,2010,2011
- Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -98,6 +97,9 @@
# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
+# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
+ overrides the coredump filter bits. */
+# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
# define MADV_HWPOISON 100 /* Poison a page for testing. */
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/msq.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/msq.h
index 838910713..7f2350074 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/bits/msq.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/msq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,6 @@
#endif
#include <bits/types.h>
-#include <bits/wordsize.h>
/* Define options for message queue functions. */
#define MSG_NOERROR 010000 /* no error if message is too big */
@@ -29,8 +28,8 @@
#endif
/* Types used in the structure definition. */
-typedef unsigned long int msgqnum_t;
-typedef unsigned long int msglen_t;
+typedef __syscall_ulong_t msgqnum_t;
+typedef __syscall_ulong_t msglen_t;
/* Structure of record for one message inside the kernel.
The type `struct msg' is opaque. */
@@ -38,24 +37,24 @@ struct msqid_ds
{
struct ipc_perm msg_perm; /* structure describing operation permission */
__time_t msg_stime; /* time of last msgsnd command */
-#if __WORDSIZE == 32
+#ifndef __x86_64__
unsigned long int __unused1;
#endif
__time_t msg_rtime; /* time of last msgrcv command */
-#if __WORDSIZE == 32
+#ifndef __x86_64__
unsigned long int __unused2;
#endif
__time_t msg_ctime; /* time of last change */
-#if __WORDSIZE == 32
+#ifndef __x86_64__
unsigned long int __unused3;
#endif
- unsigned long int __msg_cbytes; /* current number of bytes on queue */
+ __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */
msgqnum_t msg_qnum; /* number of messages currently on queue */
msglen_t msg_qbytes; /* max number of bytes allowed on queue */
__pid_t msg_lspid; /* pid of last msgsnd() */
__pid_t msg_lrpid; /* pid of last msgrcv() */
- unsigned long int __unused4;
- unsigned long int __unused5;
+ __syscall_ulong_t __unused4;
+ __syscall_ulong_t __unused5;
};
#ifdef __USE_MISC
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h
index f5831d708..92bbceff9 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,12 +39,12 @@ struct semid_ds
{
struct ipc_perm sem_perm; /* operation permission struct */
__time_t sem_otime; /* last semop() time */
- unsigned long int __unused1;
+ __syscall_ulong_t __unused1;
__time_t sem_ctime; /* last time changed by semctl() */
- unsigned long int __unused2;
- unsigned long int sem_nsems; /* number of semaphores in set */
- unsigned long int __unused3;
- unsigned long int __unused4;
+ __syscall_ulong_t __unused2;
+ __syscall_ulong_t sem_nsems; /* number of semaphores in set */
+ __syscall_ulong_t __unused3;
+ __syscall_ulong_t __unused4;
};
/* The user should define a union like the following to use it for arguments
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/shm.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/shm.h
index d95d544bd..cba25ed25 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/bits/shm.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/shm.h
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 2000, 2002, 2004, 2009
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,7 +43,7 @@ extern int __getpagesize (void) __THROW __attribute__ ((__const__));
/* Type to count number of attaches. */
-typedef unsigned long int shmatt_t;
+typedef __syscall_ulong_t shmatt_t;
/* Data structure describing a shared memory segment. */
struct shmid_ds
@@ -52,22 +51,22 @@ struct shmid_ds
struct ipc_perm shm_perm; /* operation permission struct */
size_t shm_segsz; /* size of segment in bytes */
__time_t shm_atime; /* time of last shmat() */
-#if __WORDSIZE == 32
+#ifndef __x86_64__
unsigned long int __unused1;
#endif
__time_t shm_dtime; /* time of last shmdt() */
-#if __WORDSIZE == 32
+#ifndef __x86_64__
unsigned long int __unused2;
#endif
__time_t shm_ctime; /* time of last change by shmctl() */
-#if __WORDSIZE == 32
+#ifndef __x86_64__
unsigned long int __unused3;
#endif
__pid_t shm_cpid; /* pid of creator */
__pid_t shm_lpid; /* pid of last shmop */
shmatt_t shm_nattch; /* number of current attaches */
- unsigned long int __unused4;
- unsigned long int __unused5;
+ __syscall_ulong_t __unused4;
+ __syscall_ulong_t __unused5;
};
#ifdef __USE_MISC
@@ -84,25 +83,25 @@ struct shmid_ds
struct shminfo
{
- unsigned long int shmmax;
- unsigned long int shmmin;
- unsigned long int shmmni;
- unsigned long int shmseg;
- unsigned long int shmall;
- unsigned long int __unused1;
- unsigned long int __unused2;
- unsigned long int __unused3;
- unsigned long int __unused4;
+ __syscall_ulong_t shmmax;
+ __syscall_ulong_t shmmin;
+ __syscall_ulong_t shmmni;
+ __syscall_ulong_t shmseg;
+ __syscall_ulong_t shmall;
+ __syscall_ulong_t __unused1;
+ __syscall_ulong_t __unused2;
+ __syscall_ulong_t __unused3;
+ __syscall_ulong_t __unused4;
};
struct shm_info
{
int used_ids;
- unsigned long int shm_tot; /* total allocated shm */
- unsigned long int shm_rss; /* total resident shm */
- unsigned long int shm_swp; /* total swapped shm */
- unsigned long int swap_attempts;
- unsigned long int swap_successes;
+ __syscall_ulong_t shm_tot; /* total allocated shm */
+ __syscall_ulong_t shm_rss; /* total resident shm */
+ __syscall_ulong_t shm_swp; /* total swapped shm */
+ __syscall_ulong_t swap_attempts;
+ __syscall_ulong_t swap_successes;
};
#endif /* __USE_MISC */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
index 197c14883..d9ba716bc 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,8 +22,6 @@
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
#endif
-#include <bits/wordsize.h>
-
struct _fpreg
{
unsigned short significand[4];
@@ -44,7 +42,7 @@ struct _xmmreg
-#if __WORDSIZE == 32
+#ifndef __x86_64__
struct _fpstate
{
@@ -103,7 +101,7 @@ struct sigcontext
unsigned long cr2;
};
-#else /* __WORDSIZE == 64 */
+#else /* __x86_64__ */
struct _fpstate
{
@@ -123,36 +121,40 @@ struct _fpstate
struct sigcontext
{
- unsigned long r8;
- unsigned long r9;
- unsigned long r10;
- unsigned long r11;
- unsigned long r12;
- unsigned long r13;
- unsigned long r14;
- unsigned long r15;
- unsigned long rdi;
- unsigned long rsi;
- unsigned long rbp;
- unsigned long rbx;
- unsigned long rdx;
- unsigned long rax;
- unsigned long rcx;
- unsigned long rsp;
- unsigned long rip;
- unsigned long eflags;
+ __uint64_t r8;
+ __uint64_t r9;
+ __uint64_t r10;
+ __uint64_t r11;
+ __uint64_t r12;
+ __uint64_t r13;
+ __uint64_t r14;
+ __uint64_t r15;
+ __uint64_t rdi;
+ __uint64_t rsi;
+ __uint64_t rbp;
+ __uint64_t rbx;
+ __uint64_t rdx;
+ __uint64_t rax;
+ __uint64_t rcx;
+ __uint64_t rsp;
+ __uint64_t rip;
+ __uint64_t eflags;
unsigned short cs;
unsigned short gs;
unsigned short fs;
unsigned short __pad0;
- unsigned long err;
- unsigned long trapno;
- unsigned long oldmask;
- unsigned long cr2;
- struct _fpstate * fpstate;
- unsigned long __reserved1 [8];
+ __uint64_t err;
+ __uint64_t trapno;
+ __uint64_t oldmask;
+ __uint64_t cr2;
+ __extension__ union
+ {
+ struct _fpstate * fpstate;
+ __uint64_t __fpstate_word;
+ };
+ __uint64_t __reserved1 [8];
};
-#endif /* __WORDSIZE == 64 */
+#endif /* __x86_64__ */
#endif /* _BITS_SIGCONTEXT_H */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/siginfo.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/siginfo.h
new file mode 100644
index 000000000..2e05e6528
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/siginfo.h
@@ -0,0 +1,330 @@
+/* siginfo_t, sigevent and constants. Linux x86-64 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+ && !defined __need_sigevent_t
+# error "Never include this file directly. Use <signal.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+#if (!defined __have_sigval_t \
+ && (defined _SIGNAL_H || defined __need_siginfo_t \
+ || defined __need_sigevent_t))
+# define __have_sigval_t 1
+
+/* Type for data associated with a signal. */
+typedef union sigval
+ {
+ int sival_int;
+ void *sival_ptr;
+ } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+ && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t 1
+
+# define __SI_MAX_SIZE 128
+# if __WORDSIZE == 64
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
+# else
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+# if defined __x86_64__ && __WORDSIZE == 32
+/* si_utime and si_stime must be 4 byte aligned for x32 to match the
+ kernel. We align siginfo_t to 8 bytes so that si_utime and si_stime
+ are actually aligned to 8 bytes since their offsets are multiple of
+ 8 bytes. */
+typedef __clock_t __attribute__ ((__aligned__ (4))) __sigchld_clock_t;
+# define __SI_ALIGNMENT __attribute__ ((__aligned__ (8)))
+# else
+typedef __clock_t __sigchld_clock_t;
+# define __SI_ALIGNMENT
+# endif
+
+typedef struct
+ {
+ int si_signo; /* Signal number. */
+ int si_errno; /* If non-zero, an errno value associated with
+ this signal, as defined in <errno.h>. */
+ int si_code; /* Signal code. */
+
+ union
+ {
+ int _pad[__SI_PAD_SIZE];
+
+ /* kill(). */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ } _kill;
+
+ /* POSIX.1b timers. */
+ struct
+ {
+ int si_tid; /* Timer ID. */
+ int si_overrun; /* Overrun count. */
+ sigval_t si_sigval; /* Signal value. */
+ } _timer;
+
+ /* POSIX.1b signals. */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ sigval_t si_sigval; /* Signal value. */
+ } _rt;
+
+ /* SIGCHLD. */
+ struct
+ {
+ __pid_t si_pid; /* Which child. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ int si_status; /* Exit value or signal. */
+ __sigchld_clock_t si_utime;
+ __sigchld_clock_t si_stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
+ struct
+ {
+ void *si_addr; /* Faulting insn/memory ref. */
+ } _sigfault;
+
+ /* SIGPOLL. */
+ struct
+ {
+ long int si_band; /* Band event for SIGPOLL. */
+ int si_fd;
+ } _sigpoll;
+ } _sifields;
+ } siginfo_t __SI_ALIGNMENT;
+
+
+/* X/Open requires some more fields with fixed names. */
+# define si_pid _sifields._kill.si_pid
+# define si_uid _sifields._kill.si_uid
+# define si_timerid _sifields._timer.si_tid
+# define si_overrun _sifields._timer.si_overrun
+# define si_status _sifields._sigchld.si_status
+# define si_utime _sifields._sigchld.si_utime
+# define si_stime _sifields._sigchld.si_stime
+# define si_value _sifields._rt.si_sigval
+# define si_int _sifields._rt.si_sigval.sival_int
+# define si_ptr _sifields._rt.si_sigval.sival_ptr
+# define si_addr _sifields._sigfault.si_addr
+# define si_band _sifields._sigpoll.si_band
+# define si_fd _sifields._sigpoll.si_fd
+
+
+/* Values for `si_code'. Positive values are reserved for kernel-generated
+ signals. */
+enum
+{
+ SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */
+# define SI_ASYNCNL SI_ASYNCNL
+ SI_TKILL = -6, /* Sent by tkill. */
+# define SI_TKILL SI_TKILL
+ SI_SIGIO, /* Sent by queued SIGIO. */
+# define SI_SIGIO SI_SIGIO
+ SI_ASYNCIO, /* Sent by AIO completion. */
+# define SI_ASYNCIO SI_ASYNCIO
+ SI_MESGQ, /* Sent by real time mesq state change. */
+# define SI_MESGQ SI_MESGQ
+ SI_TIMER, /* Sent by timer expiration. */
+# define SI_TIMER SI_TIMER
+ SI_QUEUE, /* Sent by sigqueue. */
+# define SI_QUEUE SI_QUEUE
+ SI_USER, /* Sent by kill, sigsend. */
+# define SI_USER SI_USER
+ SI_KERNEL = 0x80 /* Send by kernel. */
+#define SI_KERNEL SI_KERNEL
+};
+
+
+/* `si_code' values for SIGILL signal. */
+enum
+{
+ ILL_ILLOPC = 1, /* Illegal opcode. */
+# define ILL_ILLOPC ILL_ILLOPC
+ ILL_ILLOPN, /* Illegal operand. */
+# define ILL_ILLOPN ILL_ILLOPN
+ ILL_ILLADR, /* Illegal addressing mode. */
+# define ILL_ILLADR ILL_ILLADR
+ ILL_ILLTRP, /* Illegal trap. */
+# define ILL_ILLTRP ILL_ILLTRP
+ ILL_PRVOPC, /* Privileged opcode. */
+# define ILL_PRVOPC ILL_PRVOPC
+ ILL_PRVREG, /* Privileged register. */
+# define ILL_PRVREG ILL_PRVREG
+ ILL_COPROC, /* Coprocessor error. */
+# define ILL_COPROC ILL_COPROC
+ ILL_BADSTK /* Internal stack error. */
+# define ILL_BADSTK ILL_BADSTK
+};
+
+/* `si_code' values for SIGFPE signal. */
+enum
+{
+ FPE_INTDIV = 1, /* Integer divide by zero. */
+# define FPE_INTDIV FPE_INTDIV
+ FPE_INTOVF, /* Integer overflow. */
+# define FPE_INTOVF FPE_INTOVF
+ FPE_FLTDIV, /* Floating point divide by zero. */
+# define FPE_FLTDIV FPE_FLTDIV
+ FPE_FLTOVF, /* Floating point overflow. */
+# define FPE_FLTOVF FPE_FLTOVF
+ FPE_FLTUND, /* Floating point underflow. */
+# define FPE_FLTUND FPE_FLTUND
+ FPE_FLTRES, /* Floating point inexact result. */
+# define FPE_FLTRES FPE_FLTRES
+ FPE_FLTINV, /* Floating point invalid operation. */
+# define FPE_FLTINV FPE_FLTINV
+ FPE_FLTSUB /* Subscript out of range. */
+# define FPE_FLTSUB FPE_FLTSUB
+};
+
+/* `si_code' values for SIGSEGV signal. */
+enum
+{
+ SEGV_MAPERR = 1, /* Address not mapped to object. */
+# define SEGV_MAPERR SEGV_MAPERR
+ SEGV_ACCERR /* Invalid permissions for mapped object. */
+# define SEGV_ACCERR SEGV_ACCERR
+};
+
+/* `si_code' values for SIGBUS signal. */
+enum
+{
+ BUS_ADRALN = 1, /* Invalid address alignment. */
+# define BUS_ADRALN BUS_ADRALN
+ BUS_ADRERR, /* Non-existant physical address. */
+# define BUS_ADRERR BUS_ADRERR
+ BUS_OBJERR /* Object specific hardware error. */
+# define BUS_OBJERR BUS_OBJERR
+};
+
+/* `si_code' values for SIGTRAP signal. */
+enum
+{
+ TRAP_BRKPT = 1, /* Process breakpoint. */
+# define TRAP_BRKPT TRAP_BRKPT
+ TRAP_TRACE /* Process trace trap. */
+# define TRAP_TRACE TRAP_TRACE
+};
+
+/* `si_code' values for SIGCHLD signal. */
+enum
+{
+ CLD_EXITED = 1, /* Child has exited. */
+# define CLD_EXITED CLD_EXITED
+ CLD_KILLED, /* Child was killed. */
+# define CLD_KILLED CLD_KILLED
+ CLD_DUMPED, /* Child terminated abnormally. */
+# define CLD_DUMPED CLD_DUMPED
+ CLD_TRAPPED, /* Traced child has trapped. */
+# define CLD_TRAPPED CLD_TRAPPED
+ CLD_STOPPED, /* Child has stopped. */
+# define CLD_STOPPED CLD_STOPPED
+ CLD_CONTINUED /* Stopped child has continued. */
+# define CLD_CONTINUED CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal. */
+enum
+{
+ POLL_IN = 1, /* Data input available. */
+# define POLL_IN POLL_IN
+ POLL_OUT, /* Output buffers available. */
+# define POLL_OUT POLL_OUT
+ POLL_MSG, /* Input message available. */
+# define POLL_MSG POLL_MSG
+ POLL_ERR, /* I/O error. */
+# define POLL_ERR POLL_ERR
+ POLL_PRI, /* High priority input available. */
+# define POLL_PRI POLL_PRI
+ POLL_HUP /* Device disconnected. */
+# define POLL_HUP POLL_HUP
+};
+
+# undef __need_siginfo_t
+#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
+
+
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+ && !defined __have_sigevent_t
+# define __have_sigevent_t 1
+
+/* Structure to transport application-defined values with signals. */
+# define __SIGEV_MAX_SIZE 64
+# if __WORDSIZE == 64
+# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+# else
+# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+/* Forward declaration. */
+# ifndef __have_pthread_attr_t
+typedef union pthread_attr_t pthread_attr_t;
+# define __have_pthread_attr_t 1
+# endif
+
+typedef struct sigevent
+ {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+
+ union
+ {
+ int _pad[__SIGEV_PAD_SIZE];
+
+ /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+ thread to receive the signal. */
+ __pid_t _tid;
+
+ struct
+ {
+ void (*_function) (sigval_t); /* Function to start. */
+ pthread_attr_t *_attribute; /* Thread attributes. */
+ } _sigev_thread;
+ } _sigev_un;
+ } sigevent_t;
+
+/* POSIX names to access some of the members. */
+# define sigev_notify_function _sigev_un._sigev_thread._function
+# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+/* `sigev_notify' values. */
+enum
+{
+ SIGEV_SIGNAL = 0, /* Notify via signal. */
+# define SIGEV_SIGNAL SIGEV_SIGNAL
+ SIGEV_NONE, /* Other notification: meaningless. */
+# define SIGEV_NONE SIGEV_NONE
+ SIGEV_THREAD, /* Deliver via thread creation. */
+# define SIGEV_THREAD SIGEV_THREAD
+
+ SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
+#define SIGEV_THREAD_ID SIGEV_THREAD_ID
+};
+
+#endif /* have _SIGNAL_H. */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/stat.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
index 0c196f59f..691c4370e 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2003,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,7 @@
/* Versions of the `struct stat' data structure. */
#define _STAT_VER_KERNEL 0
-#if __WORDSIZE == 32
+#ifndef __x86_64__
# define _STAT_VER_SVR4 2
# define _STAT_VER_LINUX 3
@@ -45,15 +45,15 @@
struct stat
{
__dev_t st_dev; /* Device. */
-#if __WORDSIZE == 32
+#ifndef __x86_64__
unsigned short int __pad1;
#endif
-#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
__ino_t st_ino; /* File serial number. */
#else
__ino_t __st_ino; /* 32bit file serial number. */
#endif
-#if __WORDSIZE == 32
+#ifndef __x86_64__
__mode_t st_mode; /* File mode. */
__nlink_t st_nlink; /* Link count. */
#else
@@ -62,20 +62,20 @@ struct stat
#endif
__uid_t st_uid; /* User ID of the file's owner. */
__gid_t st_gid; /* Group ID of the file's group.*/
-#if __WORDSIZE == 64
+#ifdef __x86_64__
int __pad0;
#endif
__dev_t st_rdev; /* Device number, if device. */
-#if __WORDSIZE == 32
+#ifndef __x86_64__
unsigned short int __pad2;
#endif
-#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
__off_t st_size; /* Size of file, in bytes. */
#else
__off64_t st_size; /* Size of file, in bytes. */
#endif
__blksize_t st_blksize; /* Optimal block size for I/O. */
-#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
__blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
#else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
@@ -95,14 +95,14 @@ struct stat
# define st_ctime st_ctim.tv_sec
#else
__time_t st_atime; /* Time of last access. */
- unsigned long int st_atimensec; /* Nscecs of last access. */
+ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */
__time_t st_mtime; /* Time of last modification. */
- unsigned long int st_mtimensec; /* Nsecs of last modification. */
+ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */
__time_t st_ctime; /* Time of last status change. */
- unsigned long int st_ctimensec; /* Nsecs of last status change. */
+ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */
#endif
-#if __WORDSIZE == 64
- long int __unused[3];
+#ifdef __x86_64__
+ __syscall_slong_t __unused[3];
#else
# ifndef __USE_FILE_OFFSET64
unsigned long int __unused4;
@@ -118,7 +118,7 @@ struct stat
struct stat64
{
__dev_t st_dev; /* Device. */
-# if __WORDSIZE == 64
+# ifdef __x86_64__
__ino64_t st_ino; /* File serial number. */
__nlink_t st_nlink; /* Link count. */
__mode_t st_mode; /* File mode. */
@@ -130,7 +130,7 @@ struct stat64
# endif
__uid_t st_uid; /* User ID of the file's owner. */
__gid_t st_gid; /* Group ID of the file's group.*/
-# if __WORDSIZE == 64
+# ifdef __x86_64__
int __pad0;
__dev_t st_rdev; /* Device number, if device. */
__off_t st_size; /* Size of file, in bytes. */
@@ -156,14 +156,14 @@ struct stat64
# define st_ctime st_ctim.tv_sec
# else
__time_t st_atime; /* Time of last access. */
- unsigned long int st_atimensec; /* Nscecs of last access. */
+ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */
__time_t st_mtime; /* Time of last modification. */
- unsigned long int st_mtimensec; /* Nsecs of last modification. */
+ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */
__time_t st_ctime; /* Time of last status change. */
- unsigned long int st_ctimensec; /* Nsecs of last status change. */
+ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */
# endif
-# if __WORDSIZE == 64
- long int __unused[3];
+# ifdef __x86_64__
+ __syscall_slong_t __unused[3];
# else
__ino64_t st_ino; /* File serial number. */
# endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/sysctl.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/sysctl.h
new file mode 100644
index 000000000..520ccb97e
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/sysctl.h
@@ -0,0 +1,20 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#if defined __x86_64__ && defined __ILP32__
+# error "sysctl system call is unsupported in x32 kernel"
+#endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/typesizes.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/typesizes.h
new file mode 100644
index 000000000..cbad9a3b1
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/typesizes.h
@@ -0,0 +1,75 @@
+/* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef _BITS_TYPESIZES_H
+#define _BITS_TYPESIZES_H 1
+
+/* See <bits/types.h> for the meaning of these macros. This file exists so
+ that <bits/types.h> need not vary across different GNU platforms. */
+
+/* X32 kernel interface is 64-bit. */
+#if defined __x86_64__ && defined __ILP32__
+# define __SYSCALL_SLONG_TYPE __SQUAD_TYPE
+# define __SYSCALL_ULONG_TYPE __UQUAD_TYPE
+#else
+# define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
+# define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
+#endif
+
+#define __DEV_T_TYPE __UQUAD_TYPE
+#define __UID_T_TYPE __U32_TYPE
+#define __GID_T_TYPE __U32_TYPE
+#define __INO_T_TYPE __SYSCALL_ULONG_TYPE
+#define __INO64_T_TYPE __UQUAD_TYPE
+#define __MODE_T_TYPE __U32_TYPE
+#define __NLINK_T_TYPE __SYSCALL_ULONG_TYPE
+#define __OFF_T_TYPE __SYSCALL_SLONG_TYPE
+#define __OFF64_T_TYPE __SQUAD_TYPE
+#define __PID_T_TYPE __S32_TYPE
+#define __RLIM_T_TYPE __SYSCALL_ULONG_TYPE
+#define __RLIM64_T_TYPE __UQUAD_TYPE
+#define __BLKCNT_T_TYPE __SYSCALL_SLONG_TYPE
+#define __BLKCNT64_T_TYPE __SQUAD_TYPE
+#define __FSBLKCNT_T_TYPE __SYSCALL_ULONG_TYPE
+#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
+#define __FSFILCNT_T_TYPE __SYSCALL_ULONG_TYPE
+#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __FSWORD_T_TYPE __SYSCALL_SLONG_TYPE
+#define __ID_T_TYPE __U32_TYPE
+#define __CLOCK_T_TYPE __SYSCALL_SLONG_TYPE
+#define __TIME_T_TYPE __SYSCALL_SLONG_TYPE
+#define __USECONDS_T_TYPE __U32_TYPE
+#define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE
+#define __DADDR_T_TYPE __S32_TYPE
+#define __SWBLK_T_TYPE __SYSCALL_SLONG_TYPE
+#define __KEY_T_TYPE __S32_TYPE
+#define __CLOCKID_T_TYPE __S32_TYPE
+#define __TIMER_T_TYPE void *
+#define __BLKSIZE_T_TYPE __SYSCALL_SLONG_TYPE
+#define __FSID_T_TYPE struct { int __val[2]; }
+#define __SSIZE_T_TYPE __SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'. */
+#define __FD_SETSIZE 1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/clone.S b/libc/sysdeps/unix/sysv/linux/x86_64/clone.S
index 7b82217d3..6bcb542e7 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/clone.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/clone.S
@@ -72,7 +72,7 @@ ENTRY (BP_SYM (__clone))
movq %rdx, %rdi
movq %r8, %rdx
movq %r9, %r8
- movq 8(%rsp), %r10
+ mov 8(%rsp), %R10_LP
movl $SYS_ify(clone),%eax
/* End FDE now, because in the child the unwind info will be
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c b/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
index e41fddb29..d52f938e7 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2007, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -15,13 +15,14 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <dl-vdso.h>
+#include <sys/time.h>
+#ifdef SHARED
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000ul
+# include <dl-vdso.h>
+# define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000ul
-#ifdef SHARED
void *gettimeofday_ifunc (void) __asm__ ("__gettimeofday");
void *
@@ -33,9 +34,16 @@ gettimeofday_ifunc (void)
return (_dl_vdso_vsym ("__vdso_gettimeofday", &linux26)
?: (void *) VSYSCALL_ADDR_vgettimeofday);
}
-__asm (".type __gettimeofday, %gnu_indirect_function");
+asm (".type __gettimeofday, %gnu_indirect_function");
+
+/* This is doing "libc_hidden_def (__gettimeofday)" but the compiler won't
+ let us do it in C because it doesn't know we're defining __gettimeofday
+ here in this file. */
+asm (".globl __GI___gettimeofday\n"
+ "__GI___gettimeofday = __gettimeofday");
+
#else
-# include <sys/time.h>
+
# include <sysdep.h>
# include <errno.h>
@@ -44,7 +52,8 @@ __gettimeofday (struct timeval *tv, struct timezone *tz)
{
return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
}
-#endif
+libc_hidden_def (__gettimeofday)
+#endif
weak_alias (__gettimeofday, gettimeofday)
-strong_alias (__gettimeofday, __gettimeofday_internal)
+libc_hidden_weak (gettimeofday)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S b/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
index 4c3cebe88..896deb065 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -59,13 +59,17 @@ ENTRY (sched_getcpu)
# endif
#endif
+ /* Local variable is result if the call is successful. */
+ movl (%rsp), %edx
+ /* Restore stack pointer before we might jump to
+ SYSCALL_ERROR_LABEL which returns to the caller. */
+ add $0x8, %rsp
+ cfi_adjust_cfa_offset(-8)
+
cmpq $-4095, %rax
jae SYSCALL_ERROR_LABEL
- movl (%rsp), %eax
-
+ movl %edx, %eax
L(pseudo_end):
- add $0x8, %rsp
- cfi_adjust_cfa_offset(-8)
ret
PSEUDO_END(sched_getcpu)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c b/libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
index 89e02d5d0..5a3ad1830 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
@@ -146,7 +146,7 @@ asm \
".LSTARTAUGMNT_" #name ":\n" \
" .byte 0x1b\n" /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ \
".LENDAUGMNT_" #name ":\n" \
- " .align 8\n" \
+ " .align " LP_SIZE "\n" \
".LENDCIE_" #name ":\n" \
" .long .LENDFDE_" #name "-.LSTARTFDE_" #name "\n" /* FDE len */ \
".LSTARTFDE_" #name ":\n" \
@@ -177,7 +177,7 @@ asm \
/* do_expr (49 |* rflags *|, oEFL) */ \
/* `cs'/`ds'/`fs' are unaligned and a different size. */ \
/* gas: Error: register save offset not a multiple of 8 */ \
- " .align 8\n" \
+ " .align " LP_SIZE "\n" \
".LENDFDE_" #name ":\n" \
" .previous\n" \
);
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sigaltstack-offsets.sym b/libc/sysdeps/unix/sysv/linux/x86_64/sigaltstack-offsets.sym
new file mode 100644
index 000000000..5ff3af4a8
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sigaltstack-offsets.sym
@@ -0,0 +1,15 @@
+#ifndef _XOPEN_EXTENDED
+# define _XOPEN_EXTENDED
+#endif
+
+#include <stddef.h>
+#include <signal.h>
+
+--
+
+#define sigaltstack(member) offsetof (stack_t, member)
+
+sizeSS sizeof (stack_t)
+oSS_SP sigaltstack (ss_sp)
+oSS_SIZE sigaltstack (ss_size)
+oSS_FLAGS sigaltstack (ss_flags)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h b/libc/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h
index 1c4b89240..c0d894cf4 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -15,11 +15,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <stdint.h>
+
#define SIGCONTEXT siginfo_t *_si, struct ucontext *
#define SIGCONTEXT_EXTRA_ARGS _si,
-#define GET_PC(ctx) ((void *) (ctx)->uc_mcontext.gregs[REG_RIP])
-#define GET_FRAME(ctx) ((void *) (ctx)->uc_mcontext.gregs[REG_RBP])
-#define GET_STACK(ctx) ((void *) (ctx)->uc_mcontext.gregs[REG_RSP])
+#define GET_PC(ctx) \
+ ((void *) (uintptr_t) (ctx)->uc_mcontext.gregs[REG_RIP])
+#define GET_FRAME(ctx) \
+ ((void *) (uintptr_t) (ctx)->uc_mcontext.gregs[REG_RBP])
+#define GET_STACK(ctx) \
+ ((void *) (uintptr_t) (ctx)->uc_mcontext.gregs[REG_RSP])
#define CALL_SIGHANDLER(handler, signo, ctx) \
(handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h b/libc/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h
index 170431ed0..84a901743 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,6 @@
#ifndef _SYS_DEBUGREG_H
#define _SYS_DEBUGREG_H 1
-#include <bits/wordsize.h>
/* Indicate the register numbers for a number of the specific
debug registers. Registers 0-3 contain the addresses we wish to trap on */
@@ -76,8 +75,8 @@
-#if __WORDSIZE == 64
-# define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */
+#ifdef __x86_64__
+# define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00ULL) /* Reserved */
#else
# define DR_CONTROL_RESERVED (0x00FC00U) /* Reserved */
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h b/libc/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h
index bfb7d8cd1..d7a0c88cd 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,7 +35,11 @@
__BEGIN_DECLS
/* Type for a general-purpose register. */
+#ifdef __x86_64__
+typedef unsigned long long elf_greg_t;
+#else
typedef unsigned long elf_greg_t;
+#endif
/* And the whole bunch of them. We could have used `struct
user_regs_struct' directly in the typedef, but tradition says that
@@ -44,7 +48,7 @@ typedef unsigned long elf_greg_t;
#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-#if __WORDSIZE == 32
+#ifndef __x86_64__
/* Register set for the floating-point registers. */
typedef struct user_fpregs_struct elf_fpregset_t;
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sys/reg.h b/libc/sysdeps/unix/sysv/linux/x86_64/sys/reg.h
index 33b08cc9b..9a23ee0e4 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sys/reg.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sys/reg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,10 +17,9 @@
#ifndef _SYS_REG_H
#define _SYS_REG_H 1
-#include <bits/wordsize.h>
-#if __WORDSIZE == 64
+#ifdef __x86_64__
/* Index into an array of 8 byte longs returned from ptrace for
location of the users' stored general purpose registers. */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h b/libc/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h
index a39762058..7a3938cbc 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,16 +20,15 @@
#include <features.h>
#include <signal.h>
-#include <bits/wordsize.h>
/* We need the signal context definitions even if they are not used
included in <signal.h>. */
#include <bits/sigcontext.h>
-#if __WORDSIZE == 64
+#ifdef __x86_64__
/* Type for general register. */
-typedef long int greg_t;
+__extension__ typedef long long int greg_t;
/* Number of general registers. */
#define NGREG 23
@@ -127,7 +126,7 @@ typedef struct
gregset_t gregs;
/* Note that fpregs is a pointer. */
fpregset_t fpregs;
- unsigned long __reserved1 [8];
+ __extension__ unsigned long long __reserved1 [8];
} mcontext_t;
/* Userlevel context. */
@@ -141,7 +140,7 @@ typedef struct ucontext
struct _libc_fpstate __fpregs_mem;
} ucontext_t;
-#else /* __WORDSIZE == 32 */
+#else /* !__x86_64__ */
/* Type for general register. */
typedef int greg_t;
@@ -242,6 +241,6 @@ typedef struct ucontext
struct _libc_fpstate __fpregs_mem;
} ucontext_t;
-#endif /* __WORDSIZE == 32 */
+#endif /* !__x86_64__ */
#endif /* sys/ucontext.h */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sys/user.h b/libc/sysdeps/unix/sysv/linux/x86_64/sys/user.h
index 3cecfa882..9db293713 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sys/user.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2004, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,9 +22,7 @@
too much into it. Don't use it for anything other than GDB unless
you know what you are doing. */
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
+#ifdef __x86_64__
struct user_fpregs_struct
{
@@ -32,8 +30,8 @@ struct user_fpregs_struct
unsigned short int swd;
unsigned short int ftw;
unsigned short int fop;
- unsigned long int rip;
- unsigned long int rdp;
+ __extension__ unsigned long long int rip;
+ __extension__ unsigned long long int rdp;
unsigned int mxcsr;
unsigned int mxcr_mask;
unsigned int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
@@ -43,33 +41,33 @@ struct user_fpregs_struct
struct user_regs_struct
{
- unsigned long int r15;
- unsigned long int r14;
- unsigned long int r13;
- unsigned long int r12;
- unsigned long int rbp;
- unsigned long int rbx;
- unsigned long int r11;
- unsigned long int r10;
- unsigned long int r9;
- unsigned long int r8;
- unsigned long int rax;
- unsigned long int rcx;
- unsigned long int rdx;
- unsigned long int rsi;
- unsigned long int rdi;
- unsigned long int orig_rax;
- unsigned long int rip;
- unsigned long int cs;
- unsigned long int eflags;
- unsigned long int rsp;
- unsigned long int ss;
- unsigned long int fs_base;
- unsigned long int gs_base;
- unsigned long int ds;
- unsigned long int es;
- unsigned long int fs;
- unsigned long int gs;
+ __extension__ unsigned long long int r15;
+ __extension__ unsigned long long int r14;
+ __extension__ unsigned long long int r13;
+ __extension__ unsigned long long int r12;
+ __extension__ unsigned long long int rbp;
+ __extension__ unsigned long long int rbx;
+ __extension__ unsigned long long int r11;
+ __extension__ unsigned long long int r10;
+ __extension__ unsigned long long int r9;
+ __extension__ unsigned long long int r8;
+ __extension__ unsigned long long int rax;
+ __extension__ unsigned long long int rcx;
+ __extension__ unsigned long long int rdx;
+ __extension__ unsigned long long int rsi;
+ __extension__ unsigned long long int rdi;
+ __extension__ unsigned long long int orig_rax;
+ __extension__ unsigned long long int rip;
+ __extension__ unsigned long long int cs;
+ __extension__ unsigned long long int eflags;
+ __extension__ unsigned long long int rsp;
+ __extension__ unsigned long long int ss;
+ __extension__ unsigned long long int fs_base;
+ __extension__ unsigned long long int gs_base;
+ __extension__ unsigned long long int ds;
+ __extension__ unsigned long long int es;
+ __extension__ unsigned long long int fs;
+ __extension__ unsigned long long int gs;
};
struct user
@@ -77,18 +75,26 @@ struct user
struct user_regs_struct regs;
int u_fpvalid;
struct user_fpregs_struct i387;
- unsigned long int u_tsize;
- unsigned long int u_dsize;
- unsigned long int u_ssize;
- unsigned long int start_code;
- unsigned long int start_stack;
- long int signal;
+ __extension__ unsigned long long int u_tsize;
+ __extension__ unsigned long long int u_dsize;
+ __extension__ unsigned long long int u_ssize;
+ __extension__ unsigned long long int start_code;
+ __extension__ unsigned long long int start_stack;
+ __extension__ long long int signal;
int reserved;
- struct user_regs_struct* u_ar0;
- struct user_fpregs_struct* u_fpstate;
- unsigned long int magic;
+ __extension__ union
+ {
+ struct user_regs_struct* u_ar0;
+ __extension__ unsigned long long int __u_ar0_word;
+ };
+ __extension__ union
+ {
+ struct user_fpregs_struct* u_fpstate;
+ __extension__ unsigned long long int __u_fpstate_word;
+ };
+ __extension__ unsigned long long int magic;
char u_comm [32];
- unsigned long int u_debugreg [8];
+ __extension__ unsigned long long int u_debugreg [8];
};
#else
@@ -161,7 +167,7 @@ struct user
char u_comm [32];
int u_debugreg [8];
};
-#endif /* __WORDSIZE */
+#endif /* __x86_64__ */
#define PAGE_SHIFT 12
#define PAGE_SIZE (1UL << PAGE_SHIFT)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.S b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.S
index 0de339a13..4372c5610 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,7 +32,7 @@
.text
ENTRY (__syscall_error)
- negq %rax
+ neg %RAX_LP
#define __syscall_error __syscall_error_1
#include <sysdeps/unix/x86_64/sysdep.S>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index c9c4dbdc5..1c3cbd6de 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -112,31 +112,31 @@
# define ret_ERRVAL ret
-# ifndef PIC
-# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
-# elif RTLD_PRIVATE_ERRNO
-# define SYSCALL_ERROR_HANDLER \
-0: \
- leaq rtld_errno(%rip), %rcx; \
- xorl %edx, %edx; \
- subq %rax, %rdx; \
- movl %edx, (%rcx); \
- orq $-1, %rax; \
- jmp L(pseudo_end);
+# if defined PIC && defined RTLD_PRIVATE_ERRNO
+# define SYSCALL_SET_ERRNO \
+ lea rtld_errno(%rip), %RCX_LP; \
+ neg %eax; \
+ movl %eax, (%rcx)
# else
# ifndef NOT_IN_libc
# define SYSCALL_ERROR_ERRNO __libc_errno
# else
# define SYSCALL_ERROR_ERRNO errno
# endif
+# define SYSCALL_SET_ERRNO \
+ movq SYSCALL_ERROR_ERRNO@GOTTPOFF(%rip), %rcx;\
+ neg %eax; \
+ movl %eax, %fs:(%rcx);
+# endif
+
+# ifndef PIC
+# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
+# else
# define SYSCALL_ERROR_HANDLER \
0: \
- movq SYSCALL_ERROR_ERRNO@GOTTPOFF(%rip), %rcx;\
- xorl %edx, %edx; \
- subq %rax, %rdx; \
- movl %edx, %fs:(%rcx); \
- orq $-1, %rax; \
- jmp L(pseudo_end);
+ SYSCALL_SET_ERRNO; \
+ or $-1, %RAX_LP; \
+ ret;
# endif /* PIC */
/* The Linux/x86-64 kernel expects the system call parameters in
@@ -203,6 +203,20 @@
} \
(long int) resultvar; })
+/* Define a macro with explicit types for arguments, which expands inline
+ into the wrapper code for a system call. It should be used when size
+ of any argument > size of long int. */
+# undef INLINE_SYSCALL_TYPES
+# define INLINE_SYSCALL_TYPES(name, nr, args...) \
+ ({ \
+ unsigned long int resultvar = INTERNAL_SYSCALL_TYPES (name, , nr, args); \
+ if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0)) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, )); \
+ resultvar = (unsigned long int) -1; \
+ } \
+ (long int) resultvar; })
+
# undef INTERNAL_SYSCALL_DECL
# define INTERNAL_SYSCALL_DECL(err) do { } while (0)
@@ -220,6 +234,20 @@
# define INTERNAL_SYSCALL(name, err, nr, args...) \
INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args)
+# define INTERNAL_SYSCALL_NCS_TYPES(name, err, nr, args...) \
+ ({ \
+ unsigned long int resultvar; \
+ LOAD_ARGS_TYPES_##nr (args) \
+ LOAD_REGS_TYPES_##nr (args) \
+ asm volatile ( \
+ "syscall\n\t" \
+ : "=a" (resultvar) \
+ : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx"); \
+ (long int) resultvar; })
+# undef INTERNAL_SYSCALL_TYPES
+# define INTERNAL_SYSCALL_TYPES(name, err, nr, args...) \
+ INTERNAL_SYSCALL_NCS_TYPES (__NR_##name, err, nr, ##args)
+
# undef INTERNAL_SYSCALL_ERROR_P
# define INTERNAL_SYSCALL_ERROR_P(val, err) \
((unsigned long int) (long int) (val) >= -4095L)
@@ -286,53 +314,83 @@
# define LOAD_REGS_0
# define ASM_ARGS_0
-# define LOAD_ARGS_1(a1) \
- long int __arg1 = (long int) (a1); \
+# define LOAD_ARGS_TYPES_1(t1, a1) \
+ t1 __arg1 = (t1) (a1); \
LOAD_ARGS_0 ()
-# define LOAD_REGS_1 \
- register long int _a1 asm ("rdi") = __arg1; \
+# define LOAD_REGS_TYPES_1(t1, a1) \
+ register t1 _a1 asm ("rdi") = __arg1; \
LOAD_REGS_0
# define ASM_ARGS_1 ASM_ARGS_0, "r" (_a1)
-
-# define LOAD_ARGS_2(a1, a2) \
- long int __arg2 = (long int) (a2); \
- LOAD_ARGS_1 (a1)
-# define LOAD_REGS_2 \
- register long int _a2 asm ("rsi") = __arg2; \
- LOAD_REGS_1
+# define LOAD_ARGS_1(a1) \
+ LOAD_ARGS_TYPES_1 (long int, a1)
+# define LOAD_REGS_1 \
+ LOAD_REGS_TYPES_1 (long int, a1)
+
+# define LOAD_ARGS_TYPES_2(t1, a1, t2, a2) \
+ t2 __arg2 = (t2) (a2); \
+ LOAD_ARGS_TYPES_1 (t1, a1)
+# define LOAD_REGS_TYPES_2(t1, a1, t2, a2) \
+ register t2 _a2 asm ("rsi") = __arg2; \
+ LOAD_REGS_TYPES_1(t1, a1)
# define ASM_ARGS_2 ASM_ARGS_1, "r" (_a2)
-
-# define LOAD_ARGS_3(a1, a2, a3) \
- long int __arg3 = (long int) (a3); \
- LOAD_ARGS_2 (a1, a2)
-# define LOAD_REGS_3 \
- register long int _a3 asm ("rdx") = __arg3; \
- LOAD_REGS_2
+# define LOAD_ARGS_2(a1, a2) \
+ LOAD_ARGS_TYPES_2 (long int, a1, long int, a2)
+# define LOAD_REGS_2 \
+ LOAD_REGS_TYPES_2 (long int, a1, long int, a2)
+
+# define LOAD_ARGS_TYPES_3(t1, a1, t2, a2, t3, a3) \
+ t3 __arg3 = (t3) (a3); \
+ LOAD_ARGS_TYPES_2 (t1, a1, t2, a2)
+# define LOAD_REGS_TYPES_3(t1, a1, t2, a2, t3, a3) \
+ register t3 _a3 asm ("rdx") = __arg3; \
+ LOAD_REGS_TYPES_2(t1, a1, t2, a2)
# define ASM_ARGS_3 ASM_ARGS_2, "r" (_a3)
-
-# define LOAD_ARGS_4(a1, a2, a3, a4) \
- long int __arg4 = (long int) (a4); \
- LOAD_ARGS_3 (a1, a2, a3)
-# define LOAD_REGS_4 \
- register long int _a4 asm ("r10") = __arg4; \
- LOAD_REGS_3
+# define LOAD_ARGS_3(a1, a2, a3) \
+ LOAD_ARGS_TYPES_3 (long int, a1, long int, a2, long int, a3)
+# define LOAD_REGS_3 \
+ LOAD_REGS_TYPES_3 (long int, a1, long int, a2, long int, a3)
+
+# define LOAD_ARGS_TYPES_4(t1, a1, t2, a2, t3, a3, t4, a4) \
+ t4 __arg4 = (t4) (a4); \
+ LOAD_ARGS_TYPES_3 (t1, a1, t2, a2, t3, a3)
+# define LOAD_REGS_TYPES_4(t1, a1, t2, a2, t3, a3, t4, a4) \
+ register t4 _a4 asm ("r10") = __arg4; \
+ LOAD_REGS_TYPES_3(t1, a2, t2, a2, t3, a3)
# define ASM_ARGS_4 ASM_ARGS_3, "r" (_a4)
-
-# define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
- long int __arg5 = (long int) (a5); \
- LOAD_ARGS_4 (a1, a2, a3, a4)
-# define LOAD_REGS_5 \
- register long int _a5 asm ("r8") = __arg5; \
- LOAD_REGS_4
+# define LOAD_ARGS_4(a1, a2, a3, a4) \
+ LOAD_ARGS_TYPES_4 (long int, a1, long int, a2, long int, a3, \
+ long int, a4)
+# define LOAD_REGS_4 \
+ LOAD_REGS_TYPES_4 (long int, a1, long int, a2, long int, a3, \
+ long int, a4)
+
+# define LOAD_ARGS_TYPES_5(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5) \
+ t5 __arg5 = (t5) (a5); \
+ LOAD_ARGS_TYPES_4 (t1, a1, t2, a2, t3, a3, t4, a4)
+# define LOAD_REGS_TYPES_5(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5) \
+ register t5 _a5 asm ("r8") = __arg5; \
+ LOAD_REGS_TYPES_4 (t1, a1, t2, a2, t3, a3, t4, a4)
# define ASM_ARGS_5 ASM_ARGS_4, "r" (_a5)
-
-# define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
- long int __arg6 = (long int) (a6); \
- LOAD_ARGS_5 (a1, a2, a3, a4, a5)
-# define LOAD_REGS_6 \
- register long int _a6 asm ("r9") = __arg6; \
- LOAD_REGS_5
+# define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
+ LOAD_ARGS_TYPES_5 (long int, a1, long int, a2, long int, a3, \
+ long int, a4, long int, a5)
+# define LOAD_REGS_5 \
+ LOAD_REGS_TYPES_5 (long int, a1, long int, a2, long int, a3, \
+ long int, a4, long int, a5)
+
+# define LOAD_ARGS_TYPES_6(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5, t6, a6) \
+ t6 __arg6 = (t6) (a6); \
+ LOAD_ARGS_TYPES_5 (t1, a1, t2, a2, t3, a3, t4, a4, t5, a5)
+# define LOAD_REGS_TYPES_6(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5, t6, a6) \
+ register t6 _a6 asm ("r9") = __arg6; \
+ LOAD_REGS_TYPES_5 (t1, a1, t2, a2, t3, a3, t4, a4, t5, a5)
# define ASM_ARGS_6 ASM_ARGS_5, "r" (_a6)
+# define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
+ LOAD_ARGS_TYPES_6 (long int, a1, long int, a2, long int, a3, \
+ long int, a4, long int, a5, long int, a6)
+# define LOAD_REGS_6 \
+ LOAD_REGS_TYPES_6 (long int, a1, long int, a2, long int, a3, \
+ long int, a4, long int, a5, long int, a6)
#endif /* __ASSEMBLER__ */
@@ -342,33 +400,33 @@
/* We cannot use the thread descriptor because in ld.so we use setjmp
earlier than the descriptor is initialized. */
# ifdef __ASSEMBLER__
-# define PTR_MANGLE(reg) xorq __pointer_chk_guard_local(%rip), reg; \
- rolq $17, reg
-# define PTR_DEMANGLE(reg) rorq $17, reg; \
- xorq __pointer_chk_guard_local(%rip), reg
+# define PTR_MANGLE(reg) xor __pointer_chk_guard_local(%rip), reg; \
+ rol $2*LP_SIZE+1, reg
+# define PTR_DEMANGLE(reg) ror $2*LP_SIZE+1, reg; \
+ xor __pointer_chk_guard_local(%rip), reg
# else
-# define PTR_MANGLE(reg) asm ("xorq __pointer_chk_guard_local(%%rip), %0\n" \
- "rolq $17, %0" \
+# define PTR_MANGLE(reg) asm ("xor __pointer_chk_guard_local(%%rip), %0\n" \
+ "rol $2*" LP_SIZE "+1, %0" \
: "=r" (reg) : "0" (reg))
-# define PTR_DEMANGLE(reg) asm ("rorq $17, %0\n" \
- "xorq __pointer_chk_guard_local(%%rip), %0" \
+# define PTR_DEMANGLE(reg) asm ("ror $2*" LP_SIZE "+1, %0\n" \
+ "xor __pointer_chk_guard_local(%%rip), %0" \
: "=r" (reg) : "0" (reg))
# endif
#else
# ifdef __ASSEMBLER__
-# define PTR_MANGLE(reg) xorq %fs:POINTER_GUARD, reg; \
- rolq $17, reg
-# define PTR_DEMANGLE(reg) rorq $17, reg; \
- xorq %fs:POINTER_GUARD, reg
+# define PTR_MANGLE(reg) xor %fs:POINTER_GUARD, reg; \
+ rol $2*LP_SIZE+1, reg
+# define PTR_DEMANGLE(reg) ror $2*LP_SIZE+1, reg; \
+ xor %fs:POINTER_GUARD, reg
# else
-# define PTR_MANGLE(var) asm ("xorq %%fs:%c2, %0\n" \
- "rolq $17, %0" \
+# define PTR_MANGLE(var) asm ("xor %%fs:%c2, %0\n" \
+ "rol $2*" LP_SIZE "+1, %0" \
: "=r" (var) \
: "0" (var), \
"i" (offsetof (tcbhead_t, \
pointer_guard)))
-# define PTR_DEMANGLE(var) asm ("rorq $17, %0\n" \
- "xorq %%fs:%c2, %0" \
+# define PTR_DEMANGLE(var) asm ("ror $2*" LP_SIZE "+1, %0\n" \
+ "xor %%fs:%c2, %0" \
: "=r" (var) \
: "0" (var), \
"i" (offsetof (tcbhead_t, \
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/Makefile b/libc/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
new file mode 100644
index 000000000..aa78238a0
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
@@ -0,0 +1,7 @@
+ifeq ($(subdir),misc)
+sysdep_routines += arch_prctl
+endif
+
+ifeq ($(subdir),posix)
+sysdep_routines += getcpu sched_getcpu-static
+endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort.c
new file mode 100644
index 000000000..69ec42721
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/alphasort.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort64.c
new file mode 100644
index 000000000..6c5b2a1e0
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/alphasort64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/alphasort64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c
new file mode 100644
index 000000000..6933306de
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c
@@ -0,0 +1,62 @@
+/* arch_prctl call for Linux/x32.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <sys/prctl.h>
+#include <sys/syscall.h>
+#include <sysdep.h>
+
+/* Since x32 arch_prctl stores 32-bit base address of segment registers
+ %fs and %gs as unsigned 64-bit value via ARCH_GET_FS and ARCH_GET_GS,
+ we use an unsigned 64-bit variable to hold the base address and copy
+ it to ADDR after the system call returns. */
+
+int
+__arch_prctl (int code, uintptr_t *addr)
+{
+ int res;
+ uint64_t addr64;
+ void *prctl_arg = addr;
+
+ switch (code)
+ {
+ case ARCH_GET_FS:
+ case ARCH_GET_GS:
+ prctl_arg = &addr64;
+ break;
+ }
+
+ res = INLINE_SYSCALL (arch_prctl, 2, code, prctl_arg);
+ if (res == 0)
+ switch (code)
+ {
+ case ARCH_GET_FS:
+ case ARCH_GET_GS:
+ /* Check for a large value that overflows. */
+ if ((uintptr_t) addr64 != addr64)
+ {
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+ *addr = (uintptr_t) addr64;
+ break;
+ }
+
+ return res;
+}
+weak_alias (__arch_prctl, arch_prctl)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/configure b/libc/sysdeps/unix/sysv/linux/x86_64/x32/configure
new file mode 100644
index 000000000..51fc1e620
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/configure
@@ -0,0 +1,18 @@
+# Local configure fragment for sysdeps/unix/sysv/linux/86_64/x32.
+
+case "$machine" in
+x86_64/x32)
+ test -n "$arch_minimum_kernel" || arch_minimum_kernel=3.4.0
+ test -n "$libc_cv_slibdir" ||
+ case "$prefix" in
+ /usr | /usr/)
+ libc_cv_slibdir="/libx32"
+ if test "$libdir" = '${exec_prefix}/lib'; then
+ libdir='${exec_prefix}/libx32';
+ # Locale data can be shared.
+ libc_cv_localedir='${exec_prefix}/lib/locale'
+ fi
+ ;;
+ esac
+ ;;
+esac
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/dl-cache.h b/libc/sysdeps/unix/sysv/linux/x86_64/x32/dl-cache.h
new file mode 100644
index 000000000..90f960b6b
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/dl-cache.h
@@ -0,0 +1,23 @@
+/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdeps/unix/sysv/linux/x86_64/dl-cache.h>
+
+/* Defined as (FLAG_ELF_LIBC6 | FLAG_X8664_LIBX32). */
+#undef _DL_CACHE_DEFAULT_ID
+#define _DL_CACHE_DEFAULT_ID 0x803
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko.c
new file mode 100644
index 000000000..dc47698f2
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/fseeko.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko64.c
new file mode 100644
index 000000000..3e554ec1e
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/fseeko64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/fseeko64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello.c
new file mode 100644
index 000000000..735e3e16b
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/ftello.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello64.c
new file mode 100644
index 000000000..eb155ed57
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftello64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/ftello64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftw.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftw.c
new file mode 100644
index 000000000..a21dfe569
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftw.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/ftw.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftw64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftw64.c
new file mode 100644
index 000000000..3c025b738
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/ftw64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/ftw64.c>
diff --git a/libc/sysdeps/powerpc/soft-fp/q_sqrt.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/getcpu.c
index c2eab2446..b01840e6c 100644
--- a/libc/sysdeps/powerpc/soft-fp/q_sqrt.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/getcpu.c
@@ -1,9 +1,5 @@
-/* Software floating-point emulation.
- Return sqrtl(a)
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,19 +15,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include "soft-fp.h"
-#include "quad.h"
+#ifdef SHARED
+# include <dl-vdso.h>
-long double _q_sqrt(const long double a)
+void *getcpu_ifunc (void) __asm__ ("__getcpu");
+
+void *
+getcpu_ifunc (void)
{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(C);
- long double c;
+ PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
- FP_INIT_ROUNDMODE;
- FP_UNPACK_Q(A, a);
- FP_SQRT_Q(C, A);
- FP_PACK_Q(c, C);
- FP_HANDLE_EXCEPTIONS;
- return c;
+ return _dl_vdso_vsym ("__vdso_getcpu", &linux26);
}
+__asm (".type __getcpu, %gnu_indirect_function");
+#endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/glob.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/glob.c
new file mode 100644
index 000000000..e5427475f
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/glob.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/glob.c>
diff --git a/libc/sysdeps/powerpc/soft-fp/q_qtos.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/init-first.c
index f33eb3bbb..c2aea9d4e 100644
--- a/libc/sysdeps/powerpc/soft-fp/q_qtos.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/init-first.c
@@ -1,9 +1,5 @@
-/* Software floating-point emulation.
- Return (float)a
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,26 +15,26 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include "soft-fp.h"
-#include "single.h"
-#include "quad.h"
+#ifdef SHARED
+# include <dl-vdso.h>
+# include <bits/libc-vdso.h>
-float _q_qtos(const long double a)
+long int (*__vdso_clock_gettime) (clockid_t, struct timespec *)
+ __attribute__ ((nocommon));
+libc_hidden_proto (__vdso_clock_gettime)
+libc_hidden_data_def (__vdso_clock_gettime)
+
+static inline void
+_libc_vdso_platform_setup (void)
{
- FP_DECL_EX;
- FP_DECL_Q(A);
- FP_DECL_S(R);
- float r;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_SEMIRAW_Q(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
- FP_TRUNC(S,Q,1,4,R,A);
-#else
- FP_TRUNC(S,Q,1,2,R,A);
-#endif
- FP_PACK_SEMIRAW_S(r, R);
- FP_HANDLE_EXCEPTIONS;
+ PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
- return r;
+ void *p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux26);
+ PTR_MANGLE (p);
+ __vdso_clock_gettime = p;
}
+
+# define VDSO_SETUP _libc_vdso_platform_setup
+#endif
+
+#include "../../init-first.c"
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos.c
new file mode 100644
index 000000000..de2ff015d
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/iofgetpos.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos64.c
new file mode 100644
index 000000000..34aabfc6b
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofgetpos64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/iofgetpos64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen.c
new file mode 100644
index 000000000..e39bb5518
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/iofopen.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen64.c
new file mode 100644
index 000000000..af0c6ae49
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofopen64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/iofopen64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos.c
new file mode 100644
index 000000000..a4c99c93c
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/iofsetpos.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos64.c
new file mode 100644
index 000000000..e83fbba19
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/iofsetpos64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/iofsetpos64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/llseek.S b/libc/sysdeps/unix/sysv/linux/x86_64/x32/llseek.S
new file mode 100644
index 000000000..5084d0ebd
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/llseek.S
@@ -0,0 +1 @@
+/* No llseek for x32. */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf.c
new file mode 100644
index 000000000..42306a08a
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/lockf.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf64.c
new file mode 100644
index 000000000..3b4b55abc
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/lockf64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/lockf64.c>
diff --git a/libc/sysdeps/powerpc/soft-fp/q_feq.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/lseek.S
index fee5910b5..bec302e9a 100644
--- a/libc/sysdeps/powerpc/soft-fp/q_feq.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/lseek.S
@@ -1,9 +1,6 @@
-/* Software floating-point emulation.
- Return 1 if a == b
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+/* The lseek system call with 64-bit offset. Linux/x32 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,21 +16,28 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include "soft-fp.h"
-#include "quad.h"
+#include <sysdep-cancel.h>
-int _q_feq(const long double a, const long double b)
-{
- FP_DECL_EX;
- FP_DECL_Q(A); FP_DECL_Q(B);
- int r;
+/* Return -1LL in a full 64 bits. */
+#undef SYSCALL_ERROR_HANDLER
+#define SYSCALL_ERROR_HANDLER \
+0: \
+ SYSCALL_SET_ERRNO; \
+ orq $-1, %rax; \
+ ret;
- FP_UNPACK_RAW_Q(A, a);
- FP_UNPACK_RAW_Q(B, b);
- FP_CMP_EQ_Q(r, A, B);
- if (r && (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B)))
- FP_SET_EXCEPTION(FP_EX_INVALID);
- FP_HANDLE_EXCEPTIONS;
+/* Always use our own error handler. */
+#undef SYSCALL_ERROR_LABEL
+#define SYSCALL_ERROR_LABEL 0f
- return !r;
-}
+PSEUDO (__libc_lseek64, lseek, 3)
+ ret
+PSEUDO_END (__libc_lseek64)
+
+weak_alias (__libc_lseek64, __lseek64)
+libc_hidden_weak (__lseek64)
+weak_alias (__libc_lseek64, lseek64)
+libc_hidden_weak (lseek64)
+weak_alias (__libc_lseek64, __lseek)
+libc_hidden_weak (__lseek)
+weak_alias (__libc_lseek64, lseek)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp.c
new file mode 100644
index 000000000..177f68a55
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/mkostemp.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp64.c
new file mode 100644
index 000000000..68455a84c
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkostemp64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/mkostemp64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp.c
new file mode 100644
index 000000000..4bc129bac
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/mkstemp.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp64.c
new file mode 100644
index 000000000..76a836372
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/mkstemp64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/mkstemp64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/ld.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/ld.abilist
new file mode 100644
index 000000000..96c34e833
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/ld.abilist
@@ -0,0 +1,11 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ __libc_memalign F
+ __libc_stack_end D 0x4
+ __tls_get_addr F
+ _dl_mcount F
+ _r_debug D 0x14
+ calloc F
+ free F
+ malloc F
+ realloc F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libBrokenLocale.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libBrokenLocale.abilist
new file mode 100644
index 000000000..824add05e
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libBrokenLocale.abilist
@@ -0,0 +1,3 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ __ctype_get_mb_cur_max F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libanl.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libanl.abilist
new file mode 100644
index 000000000..6ebf32981
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libanl.abilist
@@ -0,0 +1,6 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ gai_cancel F
+ gai_error F
+ gai_suspend F
+ getaddrinfo_a F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist
new file mode 100644
index 000000000..13b1d91cf
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist
@@ -0,0 +1,2080 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ _Exit F
+ _IO_2_1_stderr_ D 0xa0
+ _IO_2_1_stdin_ D 0xa0
+ _IO_2_1_stdout_ D 0xa0
+ _IO_adjust_column F
+ _IO_adjust_wcolumn F
+ _IO_default_doallocate F
+ _IO_default_finish F
+ _IO_default_pbackfail F
+ _IO_default_uflow F
+ _IO_default_xsgetn F
+ _IO_default_xsputn F
+ _IO_do_write F
+ _IO_doallocbuf F
+ _IO_fclose F
+ _IO_fdopen F
+ _IO_feof F
+ _IO_ferror F
+ _IO_fflush F
+ _IO_fgetpos F
+ _IO_fgetpos64 F
+ _IO_fgets F
+ _IO_file_attach F
+ _IO_file_close F
+ _IO_file_close_it F
+ _IO_file_doallocate F
+ _IO_file_finish F
+ _IO_file_fopen F
+ _IO_file_init F
+ _IO_file_jumps D 0x54
+ _IO_file_open F
+ _IO_file_overflow F
+ _IO_file_read F
+ _IO_file_seek F
+ _IO_file_seekoff F
+ _IO_file_setbuf F
+ _IO_file_stat F
+ _IO_file_sync F
+ _IO_file_underflow F
+ _IO_file_write F
+ _IO_file_xsputn F
+ _IO_flockfile F
+ _IO_flush_all F
+ _IO_flush_all_linebuffered F
+ _IO_fopen F
+ _IO_fprintf F
+ _IO_fputs F
+ _IO_fread F
+ _IO_free_backup_area F
+ _IO_free_wbackup_area F
+ _IO_fsetpos F
+ _IO_fsetpos64 F
+ _IO_ftell F
+ _IO_ftrylockfile F
+ _IO_funlockfile F
+ _IO_fwrite F
+ _IO_getc F
+ _IO_getline F
+ _IO_getline_info F
+ _IO_gets F
+ _IO_init F
+ _IO_init_marker F
+ _IO_init_wmarker F
+ _IO_iter_begin F
+ _IO_iter_end F
+ _IO_iter_file F
+ _IO_iter_next F
+ _IO_least_wmarker F
+ _IO_link_in F
+ _IO_list_all D 0x4
+ _IO_list_lock F
+ _IO_list_resetlock F
+ _IO_list_unlock F
+ _IO_marker_delta F
+ _IO_marker_difference F
+ _IO_padn F
+ _IO_peekc_locked F
+ _IO_popen F
+ _IO_printf F
+ _IO_proc_close F
+ _IO_proc_open F
+ _IO_putc F
+ _IO_puts F
+ _IO_remove_marker F
+ _IO_seekmark F
+ _IO_seekoff F
+ _IO_seekpos F
+ _IO_seekwmark F
+ _IO_setb F
+ _IO_setbuffer F
+ _IO_setvbuf F
+ _IO_sgetn F
+ _IO_sprintf F
+ _IO_sputbackc F
+ _IO_sputbackwc F
+ _IO_sscanf F
+ _IO_str_init_readonly F
+ _IO_str_init_static F
+ _IO_str_overflow F
+ _IO_str_pbackfail F
+ _IO_str_seekoff F
+ _IO_str_underflow F
+ _IO_sungetc F
+ _IO_sungetwc F
+ _IO_switch_to_get_mode F
+ _IO_switch_to_main_wget_area F
+ _IO_switch_to_wbackup_area F
+ _IO_switch_to_wget_mode F
+ _IO_un_link F
+ _IO_ungetc F
+ _IO_unsave_markers F
+ _IO_unsave_wmarkers F
+ _IO_vfprintf F
+ _IO_vfscanf F
+ _IO_vsprintf F
+ _IO_wdefault_doallocate F
+ _IO_wdefault_finish F
+ _IO_wdefault_pbackfail F
+ _IO_wdefault_uflow F
+ _IO_wdefault_xsgetn F
+ _IO_wdefault_xsputn F
+ _IO_wdo_write F
+ _IO_wdoallocbuf F
+ _IO_wfile_jumps D 0x54
+ _IO_wfile_overflow F
+ _IO_wfile_seekoff F
+ _IO_wfile_sync F
+ _IO_wfile_underflow F
+ _IO_wfile_xsputn F
+ _IO_wmarker_delta F
+ _IO_wsetb F
+ __adjtimex F
+ __after_morecore_hook D 0x4
+ __arch_prctl F
+ __argz_count F
+ __argz_next F
+ __argz_stringify F
+ __asprintf F
+ __asprintf_chk F
+ __assert F
+ __assert_fail F
+ __assert_perror_fail F
+ __backtrace F
+ __backtrace_symbols F
+ __backtrace_symbols_fd F
+ __bsd_getpgrp F
+ __bzero F
+ __check_rhosts_file D 0x4
+ __chk_fail F
+ __clone F
+ __close F
+ __cmsg_nxthdr F
+ __confstr_chk F
+ __connect F
+ __ctype_b_loc F
+ __ctype_get_mb_cur_max F
+ __ctype_tolower_loc F
+ __ctype_toupper_loc F
+ __curbrk D 0x4
+ __cxa_at_quick_exit F
+ __cxa_atexit F
+ __cxa_finalize F
+ __cyg_profile_func_enter F
+ __cyg_profile_func_exit F
+ __daylight D 0x4
+ __dcgettext F
+ __default_morecore F
+ __dgettext F
+ __dprintf_chk F
+ __dup2 F
+ __duplocale F
+ __endmntent F
+ __environ D 0x4
+ __errno_location F
+ __fbufsize F
+ __fcntl F
+ __fdelt_chk F
+ __fdelt_warn F
+ __fentry__ F
+ __ffs F
+ __fgets_chk F
+ __fgets_unlocked_chk F
+ __fgetws_chk F
+ __fgetws_unlocked_chk F
+ __finite F
+ __finitef F
+ __finitel F
+ __flbf F
+ __fork F
+ __fpending F
+ __fprintf_chk F
+ __fpu_control D 0x2
+ __fpurge F
+ __fread_chk F
+ __fread_unlocked_chk F
+ __freadable F
+ __freading F
+ __free_hook D 0x4
+ __freelocale F
+ __fsetlocking F
+ __fwprintf_chk F
+ __fwritable F
+ __fwriting F
+ __fxstat F
+ __fxstat64 F
+ __fxstatat F
+ __fxstatat64 F
+ __getauxval F
+ __getcwd_chk F
+ __getdelim F
+ __getdomainname_chk F
+ __getgroups_chk F
+ __gethostname_chk F
+ __getlogin_r_chk F
+ __getmntent_r F
+ __getpagesize F
+ __getpgid F
+ __getpid F
+ __gets_chk F
+ __gettimeofday F
+ __getwd_chk F
+ __gmtime_r F
+ __h_errno_location F
+ __isalnum_l F
+ __isalpha_l F
+ __isascii_l F
+ __isblank_l F
+ __iscntrl_l F
+ __isctype F
+ __isdigit_l F
+ __isgraph_l F
+ __isinf F
+ __isinff F
+ __isinfl F
+ __islower_l F
+ __isnan F
+ __isnanf F
+ __isnanl F
+ __isoc99_fscanf F
+ __isoc99_fwscanf F
+ __isoc99_scanf F
+ __isoc99_sscanf F
+ __isoc99_swscanf F
+ __isoc99_vfscanf F
+ __isoc99_vfwscanf F
+ __isoc99_vscanf F
+ __isoc99_vsscanf F
+ __isoc99_vswscanf F
+ __isoc99_vwscanf F
+ __isoc99_wscanf F
+ __isprint_l F
+ __ispunct_l F
+ __isspace_l F
+ __isupper_l F
+ __iswalnum_l F
+ __iswalpha_l F
+ __iswblank_l F
+ __iswcntrl_l F
+ __iswctype F
+ __iswctype_l F
+ __iswdigit_l F
+ __iswgraph_l F
+ __iswlower_l F
+ __iswprint_l F
+ __iswpunct_l F
+ __iswspace_l F
+ __iswupper_l F
+ __iswxdigit_l F
+ __isxdigit_l F
+ __ivaliduser F
+ __key_decryptsession_pk_LOCAL D 0x4
+ __key_encryptsession_pk_LOCAL D 0x4
+ __key_gendes_LOCAL D 0x4
+ __libc_allocate_rtsig F
+ __libc_calloc F
+ __libc_current_sigrtmax F
+ __libc_current_sigrtmin F
+ __libc_free F
+ __libc_freeres F
+ __libc_init_first F
+ __libc_mallinfo F
+ __libc_malloc F
+ __libc_mallopt F
+ __libc_memalign F
+ __libc_pvalloc F
+ __libc_realloc F
+ __libc_sa_len F
+ __libc_start_main F
+ __libc_valloc F
+ __longjmp_chk F
+ __lseek F
+ __lxstat F
+ __lxstat64 F
+ __malloc_hook D 0x4
+ __malloc_initialize_hook D 0x4
+ __mbrlen F
+ __mbrtowc F
+ __mbsnrtowcs_chk F
+ __mbsrtowcs_chk F
+ __mbstowcs_chk F
+ __memalign_hook D 0x4
+ __memcpy_chk F
+ __memmove_chk F
+ __mempcpy F
+ __mempcpy_chk F
+ __mempcpy_small F
+ __memset_chk F
+ __monstartup F
+ __morecore D 0x4
+ __nanosleep F
+ __newlocale F
+ __nl_langinfo_l F
+ __nss_configure_lookup F
+ __nss_database_lookup F
+ __nss_group_lookup F
+ __nss_hostname_digits_dots F
+ __nss_hosts_lookup F
+ __nss_next F
+ __nss_passwd_lookup F
+ __obstack_printf_chk F
+ __obstack_vprintf_chk F
+ __open F
+ __open64 F
+ __open64_2 F
+ __open_2 F
+ __openat64_2 F
+ __openat_2 F
+ __overflow F
+ __pipe F
+ __poll F
+ __poll_chk F
+ __posix_getopt F
+ __ppoll_chk F
+ __pread64 F
+ __pread64_chk F
+ __pread_chk F
+ __printf_chk F
+ __printf_fp F
+ __profile_frequency F
+ __progname D 0x4
+ __progname_full D 0x4
+ __ptsname_r_chk F
+ __pwrite64 F
+ __rawmemchr F
+ __rcmd_errstr D 0x4
+ __read F
+ __read_chk F
+ __readlink_chk F
+ __readlinkat_chk F
+ __realloc_hook D 0x4
+ __realpath_chk F
+ __recv_chk F
+ __recvfrom_chk F
+ __register_atfork F
+ __res_init F
+ __res_nclose F
+ __res_ninit F
+ __res_randomid F
+ __res_state F
+ __rpc_thread_createerr F
+ __rpc_thread_svc_fdset F
+ __rpc_thread_svc_max_pollfd F
+ __rpc_thread_svc_pollfd F
+ __sbrk F
+ __sched_cpualloc F
+ __sched_cpucount F
+ __sched_cpufree F
+ __sched_get_priority_max F
+ __sched_get_priority_min F
+ __sched_getparam F
+ __sched_getscheduler F
+ __sched_setscheduler F
+ __sched_yield F
+ __secure_getenv F
+ __select F
+ __send F
+ __setmntent F
+ __setpgid F
+ __sigaction F
+ __sigaddset F
+ __sigdelset F
+ __sigismember F
+ __signbit F
+ __signbitf F
+ __signbitl F
+ __sigpause F
+ __sigsetjmp F
+ __sigsuspend F
+ __snprintf_chk F
+ __sprintf_chk F
+ __stack_chk_fail F
+ __statfs F
+ __stpcpy F
+ __stpcpy_chk F
+ __stpcpy_small F
+ __stpncpy F
+ __stpncpy_chk F
+ __strcasecmp F
+ __strcasecmp_l F
+ __strcasestr F
+ __strcat_chk F
+ __strcoll_l F
+ __strcpy_chk F
+ __strcpy_small F
+ __strcspn_c1 F
+ __strcspn_c2 F
+ __strcspn_c3 F
+ __strdup F
+ __strerror_r F
+ __strfmon_l F
+ __strftime_l F
+ __strncasecmp_l F
+ __strncat_chk F
+ __strncpy_chk F
+ __strndup F
+ __strpbrk_c2 F
+ __strpbrk_c3 F
+ __strsep_1c F
+ __strsep_2c F
+ __strsep_3c F
+ __strsep_g F
+ __strspn_c1 F
+ __strspn_c2 F
+ __strspn_c3 F
+ __strtod_internal F
+ __strtod_l F
+ __strtof_internal F
+ __strtof_l F
+ __strtok_r F
+ __strtok_r_1c F
+ __strtol_internal F
+ __strtol_l F
+ __strtold_internal F
+ __strtold_l F
+ __strtoll_internal F
+ __strtoll_l F
+ __strtoul_internal F
+ __strtoul_l F
+ __strtoull_internal F
+ __strtoull_l F
+ __strverscmp F
+ __strxfrm_l F
+ __swprintf_chk F
+ __sysconf F
+ __syslog_chk F
+ __sysv_signal F
+ __timezone D 0x4
+ __toascii_l F
+ __tolower_l F
+ __toupper_l F
+ __towctrans F
+ __towctrans_l F
+ __towlower_l F
+ __towupper_l F
+ __ttyname_r_chk F
+ __tzname D 0x8
+ __uflow F
+ __underflow F
+ __uselocale F
+ __vasprintf_chk F
+ __vdprintf_chk F
+ __vfork F
+ __vfprintf_chk F
+ __vfscanf F
+ __vfwprintf_chk F
+ __vprintf_chk F
+ __vsnprintf F
+ __vsnprintf_chk F
+ __vsprintf_chk F
+ __vsscanf F
+ __vswprintf_chk F
+ __vsyslog_chk F
+ __vwprintf_chk F
+ __wait F
+ __waitpid F
+ __wcpcpy_chk F
+ __wcpncpy_chk F
+ __wcrtomb_chk F
+ __wcscasecmp_l F
+ __wcscat_chk F
+ __wcscoll_l F
+ __wcscpy_chk F
+ __wcsftime_l F
+ __wcsncasecmp_l F
+ __wcsncat_chk F
+ __wcsncpy_chk F
+ __wcsnrtombs_chk F
+ __wcsrtombs_chk F
+ __wcstod_internal F
+ __wcstod_l F
+ __wcstof_internal F
+ __wcstof_l F
+ __wcstol_internal F
+ __wcstol_l F
+ __wcstold_internal F
+ __wcstold_l F
+ __wcstoll_internal F
+ __wcstoll_l F
+ __wcstombs_chk F
+ __wcstoul_internal F
+ __wcstoul_l F
+ __wcstoull_internal F
+ __wcstoull_l F
+ __wcsxfrm_l F
+ __wctomb_chk F
+ __wctrans_l F
+ __wctype_l F
+ __wmemcpy_chk F
+ __wmemmove_chk F
+ __wmempcpy_chk F
+ __wmemset_chk F
+ __woverflow F
+ __wprintf_chk F
+ __write F
+ __wuflow F
+ __wunderflow F
+ __xmknod F
+ __xmknodat F
+ __xpg_basename F
+ __xpg_sigpause F
+ __xpg_strerror_r F
+ __xstat F
+ __xstat64 F
+ _authenticate F
+ _dl_mcount_wrapper F
+ _dl_mcount_wrapper_check F
+ _environ D 0x4
+ _exit F
+ _flushlbf F
+ _libc_intl_domainname D 0x5
+ _longjmp F
+ _mcleanup F
+ _mcount F
+ _nl_default_dirname D 0x12
+ _nl_domain_bindings D 0x4
+ _nl_msg_cat_cntr D 0x4
+ _null_auth D 0xc
+ _obstack_allocated_p F
+ _obstack_begin F
+ _obstack_begin_1 F
+ _obstack_free F
+ _obstack_memory_used F
+ _obstack_newchunk F
+ _res D 0x200
+ _res_hconf D 0x30
+ _rpc_dtablesize F
+ _seterr_reply F
+ _setjmp F
+ _sys_errlist D 0x21c
+ _sys_nerr D 0x4
+ _sys_siglist D 0x104
+ _tolower F
+ _toupper F
+ a64l F
+ abort F
+ abs F
+ accept F
+ accept4 F
+ access F
+ acct F
+ addmntent F
+ addseverity F
+ adjtime F
+ adjtimex F
+ advance F
+ alarm F
+ aligned_alloc F
+ alphasort F
+ alphasort64 F
+ arch_prctl F
+ argp_err_exit_status D 0x4
+ argp_error F
+ argp_failure F
+ argp_help F
+ argp_parse F
+ argp_program_bug_address D 0x4
+ argp_program_version D 0x4
+ argp_program_version_hook D 0x4
+ argp_state_help F
+ argp_usage F
+ argz_add F
+ argz_add_sep F
+ argz_append F
+ argz_count F
+ argz_create F
+ argz_create_sep F
+ argz_delete F
+ argz_extract F
+ argz_insert F
+ argz_next F
+ argz_replace F
+ argz_stringify F
+ asctime F
+ asctime_r F
+ asprintf F
+ atof F
+ atoi F
+ atol F
+ atoll F
+ authdes_create F
+ authdes_getucred F
+ authdes_pk_create F
+ authnone_create F
+ authunix_create F
+ authunix_create_default F
+ backtrace F
+ backtrace_symbols F
+ backtrace_symbols_fd F
+ basename F
+ bcmp F
+ bcopy F
+ bdflush F
+ bind F
+ bind_textdomain_codeset F
+ bindresvport F
+ bindtextdomain F
+ brk F
+ bsd_signal F
+ bsearch F
+ btowc F
+ bzero F
+ c16rtomb F
+ c32rtomb F
+ calloc F
+ callrpc F
+ canonicalize_file_name F
+ capget F
+ capset F
+ catclose F
+ catgets F
+ catopen F
+ cbc_crypt F
+ cfgetispeed F
+ cfgetospeed F
+ cfmakeraw F
+ cfree F
+ cfsetispeed F
+ cfsetospeed F
+ cfsetspeed F
+ chdir F
+ chflags F
+ chmod F
+ chown F
+ chroot F
+ clearenv F
+ clearerr F
+ clearerr_unlocked F
+ clnt_broadcast F
+ clnt_create F
+ clnt_pcreateerror F
+ clnt_perrno F
+ clnt_perror F
+ clnt_spcreateerror F
+ clnt_sperrno F
+ clnt_sperror F
+ clntraw_create F
+ clnttcp_create F
+ clntudp_bufcreate F
+ clntudp_create F
+ clntunix_create F
+ clock F
+ clock_adjtime F
+ clone F
+ close F
+ closedir F
+ closelog F
+ confstr F
+ connect F
+ copysign F
+ copysignf F
+ copysignl F
+ creat F
+ creat64 F
+ create_module F
+ ctermid F
+ ctime F
+ ctime_r F
+ cuserid F
+ daemon F
+ daylight D 0x4
+ dcgettext F
+ dcngettext F
+ delete_module F
+ des_setparity F
+ dgettext F
+ difftime F
+ dirfd F
+ dirname F
+ div F
+ dl_iterate_phdr F
+ dngettext F
+ dprintf F
+ drand48 F
+ drand48_r F
+ dup F
+ dup2 F
+ dup3 F
+ duplocale F
+ dysize F
+ eaccess F
+ ecb_crypt F
+ ecvt F
+ ecvt_r F
+ endaliasent F
+ endfsent F
+ endgrent F
+ endhostent F
+ endmntent F
+ endnetent F
+ endnetgrent F
+ endprotoent F
+ endpwent F
+ endrpcent F
+ endservent F
+ endsgent F
+ endspent F
+ endttyent F
+ endusershell F
+ endutent F
+ endutxent F
+ environ D 0x4
+ envz_add F
+ envz_entry F
+ envz_get F
+ envz_merge F
+ envz_remove F
+ envz_strip F
+ epoll_create F
+ epoll_create1 F
+ epoll_ctl F
+ epoll_pwait F
+ epoll_wait F
+ erand48 F
+ erand48_r F
+ err F
+ error F
+ error_at_line F
+ error_message_count D 0x4
+ error_one_per_line D 0x4
+ error_print_progname D 0x4
+ errx F
+ ether_aton F
+ ether_aton_r F
+ ether_hostton F
+ ether_line F
+ ether_ntoa F
+ ether_ntoa_r F
+ ether_ntohost F
+ euidaccess F
+ eventfd F
+ eventfd_read F
+ eventfd_write F
+ execl F
+ execle F
+ execlp F
+ execv F
+ execve F
+ execvp F
+ execvpe F
+ exit F
+ faccessat F
+ fallocate F
+ fallocate64 F
+ fanotify_init F
+ fanotify_mark F
+ fattach F
+ fchdir F
+ fchflags F
+ fchmod F
+ fchmodat F
+ fchown F
+ fchownat F
+ fclose F
+ fcloseall F
+ fcntl F
+ fcvt F
+ fcvt_r F
+ fdatasync F
+ fdetach F
+ fdopen F
+ fdopendir F
+ feof F
+ feof_unlocked F
+ ferror F
+ ferror_unlocked F
+ fexecve F
+ fflush F
+ fflush_unlocked F
+ ffs F
+ ffsl F
+ ffsll F
+ fgetc F
+ fgetc_unlocked F
+ fgetgrent F
+ fgetgrent_r F
+ fgetpos F
+ fgetpos64 F
+ fgetpwent F
+ fgetpwent_r F
+ fgets F
+ fgets_unlocked F
+ fgetsgent F
+ fgetsgent_r F
+ fgetspent F
+ fgetspent_r F
+ fgetwc F
+ fgetwc_unlocked F
+ fgetws F
+ fgetws_unlocked F
+ fgetxattr F
+ fileno F
+ fileno_unlocked F
+ finite F
+ finitef F
+ finitel F
+ flistxattr F
+ flock F
+ flockfile F
+ fmemopen F
+ fmtmsg F
+ fnmatch F
+ fopen F
+ fopen64 F
+ fopencookie F
+ fork F
+ fpathconf F
+ fprintf F
+ fputc F
+ fputc_unlocked F
+ fputs F
+ fputs_unlocked F
+ fputwc F
+ fputwc_unlocked F
+ fputws F
+ fputws_unlocked F
+ fread F
+ fread_unlocked F
+ free F
+ freeaddrinfo F
+ freeifaddrs F
+ freelocale F
+ fremovexattr F
+ freopen F
+ freopen64 F
+ frexp F
+ frexpf F
+ frexpl F
+ fscanf F
+ fseek F
+ fseeko F
+ fseeko64 F
+ fsetpos F
+ fsetpos64 F
+ fsetxattr F
+ fstatfs F
+ fstatfs64 F
+ fstatvfs F
+ fstatvfs64 F
+ fsync F
+ ftell F
+ ftello F
+ ftello64 F
+ ftime F
+ ftok F
+ ftruncate F
+ ftruncate64 F
+ ftrylockfile F
+ fts_children F
+ fts_close F
+ fts_open F
+ fts_read F
+ fts_set F
+ ftw F
+ ftw64 F
+ funlockfile F
+ futimens F
+ futimes F
+ futimesat F
+ fwide F
+ fwprintf F
+ fwrite F
+ fwrite_unlocked F
+ fwscanf F
+ gai_strerror F
+ gcvt F
+ get_avphys_pages F
+ get_current_dir_name F
+ get_kernel_syms F
+ get_myaddress F
+ get_nprocs F
+ get_nprocs_conf F
+ get_phys_pages F
+ getaddrinfo F
+ getaliasbyname F
+ getaliasbyname_r F
+ getaliasent F
+ getaliasent_r F
+ getauxval F
+ getc F
+ getc_unlocked F
+ getchar F
+ getchar_unlocked F
+ getcontext F
+ getcwd F
+ getdate F
+ getdate_err D 0x4
+ getdate_r F
+ getdelim F
+ getdirentries F
+ getdirentries64 F
+ getdomainname F
+ getdtablesize F
+ getegid F
+ getenv F
+ geteuid F
+ getfsent F
+ getfsfile F
+ getfsspec F
+ getgid F
+ getgrent F
+ getgrent_r F
+ getgrgid F
+ getgrgid_r F
+ getgrnam F
+ getgrnam_r F
+ getgrouplist F
+ getgroups F
+ gethostbyaddr F
+ gethostbyaddr_r F
+ gethostbyname F
+ gethostbyname2 F
+ gethostbyname2_r F
+ gethostbyname_r F
+ gethostent F
+ gethostent_r F
+ gethostid F
+ gethostname F
+ getifaddrs F
+ getipv4sourcefilter F
+ getitimer F
+ getline F
+ getloadavg F
+ getlogin F
+ getlogin_r F
+ getmntent F
+ getmntent_r F
+ getmsg F
+ getnameinfo F
+ getnetbyaddr F
+ getnetbyaddr_r F
+ getnetbyname F
+ getnetbyname_r F
+ getnetent F
+ getnetent_r F
+ getnetgrent F
+ getnetgrent_r F
+ getnetname F
+ getopt F
+ getopt_long F
+ getopt_long_only F
+ getpagesize F
+ getpass F
+ getpeername F
+ getpgid F
+ getpgrp F
+ getpid F
+ getpmsg F
+ getppid F
+ getpriority F
+ getprotobyname F
+ getprotobyname_r F
+ getprotobynumber F
+ getprotobynumber_r F
+ getprotoent F
+ getprotoent_r F
+ getpt F
+ getpublickey F
+ getpw F
+ getpwent F
+ getpwent_r F
+ getpwnam F
+ getpwnam_r F
+ getpwuid F
+ getpwuid_r F
+ getresgid F
+ getresuid F
+ getrlimit F
+ getrlimit64 F
+ getrpcbyname F
+ getrpcbyname_r F
+ getrpcbynumber F
+ getrpcbynumber_r F
+ getrpcent F
+ getrpcent_r F
+ getrpcport F
+ getrusage F
+ gets F
+ getsecretkey F
+ getservbyname F
+ getservbyname_r F
+ getservbyport F
+ getservbyport_r F
+ getservent F
+ getservent_r F
+ getsgent F
+ getsgent_r F
+ getsgnam F
+ getsgnam_r F
+ getsid F
+ getsockname F
+ getsockopt F
+ getsourcefilter F
+ getspent F
+ getspent_r F
+ getspnam F
+ getspnam_r F
+ getsubopt F
+ gettext F
+ gettimeofday F
+ getttyent F
+ getttynam F
+ getuid F
+ getusershell F
+ getutent F
+ getutent_r F
+ getutid F
+ getutid_r F
+ getutline F
+ getutline_r F
+ getutmp F
+ getutmpx F
+ getutxent F
+ getutxid F
+ getutxline F
+ getw F
+ getwc F
+ getwc_unlocked F
+ getwchar F
+ getwchar_unlocked F
+ getwd F
+ getxattr F
+ glob F
+ glob64 F
+ glob_pattern_p F
+ globfree F
+ globfree64 F
+ gmtime F
+ gmtime_r F
+ gnu_dev_major F
+ gnu_dev_makedev F
+ gnu_dev_minor F
+ gnu_get_libc_release F
+ gnu_get_libc_version F
+ grantpt F
+ group_member F
+ gsignal F
+ gtty F
+ h_errlist D 0x14
+ h_nerr D 0x4
+ hasmntopt F
+ hcreate F
+ hcreate_r F
+ hdestroy F
+ hdestroy_r F
+ herror F
+ host2netname F
+ hsearch F
+ hsearch_r F
+ hstrerror F
+ htonl F
+ htons F
+ iconv F
+ iconv_close F
+ iconv_open F
+ if_freenameindex F
+ if_indextoname F
+ if_nameindex F
+ if_nametoindex F
+ imaxabs F
+ imaxdiv F
+ in6addr_any D 0x10
+ in6addr_loopback D 0x10
+ index F
+ inet6_opt_append F
+ inet6_opt_find F
+ inet6_opt_finish F
+ inet6_opt_get_val F
+ inet6_opt_init F
+ inet6_opt_next F
+ inet6_opt_set_val F
+ inet6_option_alloc F
+ inet6_option_append F
+ inet6_option_find F
+ inet6_option_init F
+ inet6_option_next F
+ inet6_option_space F
+ inet6_rth_add F
+ inet6_rth_getaddr F
+ inet6_rth_init F
+ inet6_rth_reverse F
+ inet6_rth_segments F
+ inet6_rth_space F
+ inet_addr F
+ inet_aton F
+ inet_lnaof F
+ inet_makeaddr F
+ inet_netof F
+ inet_network F
+ inet_nsap_addr F
+ inet_nsap_ntoa F
+ inet_ntoa F
+ inet_ntop F
+ inet_pton F
+ init_module F
+ initgroups F
+ initstate F
+ initstate_r F
+ innetgr F
+ inotify_add_watch F
+ inotify_init F
+ inotify_init1 F
+ inotify_rm_watch F
+ insque F
+ ioctl F
+ ioperm F
+ iopl F
+ iruserok F
+ iruserok_af F
+ isalnum F
+ isalnum_l F
+ isalpha F
+ isalpha_l F
+ isascii F
+ isastream F
+ isatty F
+ isblank F
+ isblank_l F
+ iscntrl F
+ iscntrl_l F
+ isctype F
+ isdigit F
+ isdigit_l F
+ isfdtype F
+ isgraph F
+ isgraph_l F
+ isinf F
+ isinff F
+ isinfl F
+ islower F
+ islower_l F
+ isnan F
+ isnanf F
+ isnanl F
+ isprint F
+ isprint_l F
+ ispunct F
+ ispunct_l F
+ isspace F
+ isspace_l F
+ isupper F
+ isupper_l F
+ iswalnum F
+ iswalnum_l F
+ iswalpha F
+ iswalpha_l F
+ iswblank F
+ iswblank_l F
+ iswcntrl F
+ iswcntrl_l F
+ iswctype F
+ iswctype_l F
+ iswdigit F
+ iswdigit_l F
+ iswgraph F
+ iswgraph_l F
+ iswlower F
+ iswlower_l F
+ iswprint F
+ iswprint_l F
+ iswpunct F
+ iswpunct_l F
+ iswspace F
+ iswspace_l F
+ iswupper F
+ iswupper_l F
+ iswxdigit F
+ iswxdigit_l F
+ isxdigit F
+ isxdigit_l F
+ jrand48 F
+ jrand48_r F
+ key_decryptsession F
+ key_decryptsession_pk F
+ key_encryptsession F
+ key_encryptsession_pk F
+ key_gendes F
+ key_get_conv F
+ key_secretkey_is_set F
+ key_setnet F
+ key_setsecret F
+ kill F
+ killpg F
+ klogctl F
+ l64a F
+ labs F
+ lchmod F
+ lchown F
+ lckpwdf F
+ lcong48 F
+ lcong48_r F
+ ldexp F
+ ldexpf F
+ ldexpl F
+ ldiv F
+ lfind F
+ lgetxattr F
+ link F
+ linkat F
+ listen F
+ listxattr F
+ llabs F
+ lldiv F
+ llistxattr F
+ loc1 D 0x4
+ loc2 D 0x4
+ localeconv F
+ localtime F
+ localtime_r F
+ lockf F
+ lockf64 F
+ locs D 0x4
+ longjmp F
+ lrand48 F
+ lrand48_r F
+ lremovexattr F
+ lsearch F
+ lseek F
+ lseek64 F
+ lsetxattr F
+ lutimes F
+ madvise F
+ makecontext F
+ mallinfo F
+ malloc F
+ malloc_get_state F
+ malloc_info F
+ malloc_set_state F
+ malloc_stats F
+ malloc_trim F
+ malloc_usable_size F
+ mallopt F
+ mallwatch D 0x4
+ mblen F
+ mbrlen F
+ mbrtoc16 F
+ mbrtoc32 F
+ mbrtowc F
+ mbsinit F
+ mbsnrtowcs F
+ mbsrtowcs F
+ mbstowcs F
+ mbtowc F
+ mcheck F
+ mcheck_check_all F
+ mcheck_pedantic F
+ mcount F
+ memalign F
+ memccpy F
+ memchr F
+ memcmp F
+ memcpy F
+ memfrob F
+ memmem F
+ memmove F
+ mempcpy F
+ memrchr F
+ memset F
+ mincore F
+ mkdir F
+ mkdirat F
+ mkdtemp F
+ mkfifo F
+ mkfifoat F
+ mkostemp F
+ mkostemp64 F
+ mkostemps F
+ mkostemps64 F
+ mkstemp F
+ mkstemp64 F
+ mkstemps F
+ mkstemps64 F
+ mktemp F
+ mktime F
+ mlock F
+ mlockall F
+ mmap F
+ mmap64 F
+ modf F
+ modff F
+ modfl F
+ modify_ldt F
+ moncontrol F
+ monstartup F
+ mount F
+ mprobe F
+ mprotect F
+ mrand48 F
+ mrand48_r F
+ mremap F
+ msgctl F
+ msgget F
+ msgrcv F
+ msgsnd F
+ msync F
+ mtrace F
+ munlock F
+ munlockall F
+ munmap F
+ muntrace F
+ name_to_handle_at F
+ nanosleep F
+ netname2host F
+ netname2user F
+ newlocale F
+ nfsservctl F
+ nftw F
+ nftw64 F
+ ngettext F
+ nice F
+ nl_langinfo F
+ nl_langinfo_l F
+ nrand48 F
+ nrand48_r F
+ ntohl F
+ ntohs F
+ ntp_adjtime F
+ ntp_gettime F
+ ntp_gettimex F
+ obstack_alloc_failed_handler D 0x4
+ obstack_exit_failure D 0x4
+ obstack_free F
+ obstack_printf F
+ obstack_vprintf F
+ on_exit F
+ open F
+ open64 F
+ open_by_handle_at F
+ open_memstream F
+ open_wmemstream F
+ openat F
+ openat64 F
+ opendir F
+ openlog F
+ optarg D 0x4
+ opterr D 0x4
+ optind D 0x4
+ optopt D 0x4
+ parse_printf_format F
+ passwd2des F
+ pathconf F
+ pause F
+ pclose F
+ perror F
+ personality F
+ pipe F
+ pipe2 F
+ pivot_root F
+ pmap_getmaps F
+ pmap_getport F
+ pmap_rmtcall F
+ pmap_set F
+ pmap_unset F
+ poll F
+ popen F
+ posix_fadvise F
+ posix_fadvise64 F
+ posix_fallocate F
+ posix_fallocate64 F
+ posix_madvise F
+ posix_memalign F
+ posix_openpt F
+ posix_spawn F
+ posix_spawn_file_actions_addclose F
+ posix_spawn_file_actions_adddup2 F
+ posix_spawn_file_actions_addopen F
+ posix_spawn_file_actions_destroy F
+ posix_spawn_file_actions_init F
+ posix_spawnattr_destroy F
+ posix_spawnattr_getflags F
+ posix_spawnattr_getpgroup F
+ posix_spawnattr_getschedparam F
+ posix_spawnattr_getschedpolicy F
+ posix_spawnattr_getsigdefault F
+ posix_spawnattr_getsigmask F
+ posix_spawnattr_init F
+ posix_spawnattr_setflags F
+ posix_spawnattr_setpgroup F
+ posix_spawnattr_setschedparam F
+ posix_spawnattr_setschedpolicy F
+ posix_spawnattr_setsigdefault F
+ posix_spawnattr_setsigmask F
+ posix_spawnp F
+ ppoll F
+ prctl F
+ pread F
+ pread64 F
+ preadv F
+ preadv64 F
+ printf F
+ printf_size F
+ printf_size_info F
+ prlimit F
+ prlimit64 F
+ process_vm_readv F
+ process_vm_writev F
+ profil F
+ program_invocation_name D 0x4
+ program_invocation_short_name D 0x4
+ pselect F
+ psiginfo F
+ psignal F
+ pthread_attr_destroy F
+ pthread_attr_getdetachstate F
+ pthread_attr_getinheritsched F
+ pthread_attr_getschedparam F
+ pthread_attr_getschedpolicy F
+ pthread_attr_getscope F
+ pthread_attr_init F
+ pthread_attr_setdetachstate F
+ pthread_attr_setinheritsched F
+ pthread_attr_setschedparam F
+ pthread_attr_setschedpolicy F
+ pthread_attr_setscope F
+ pthread_cond_broadcast F
+ pthread_cond_destroy F
+ pthread_cond_init F
+ pthread_cond_signal F
+ pthread_cond_timedwait F
+ pthread_cond_wait F
+ pthread_condattr_destroy F
+ pthread_condattr_init F
+ pthread_equal F
+ pthread_exit F
+ pthread_getschedparam F
+ pthread_mutex_destroy F
+ pthread_mutex_init F
+ pthread_mutex_lock F
+ pthread_mutex_unlock F
+ pthread_self F
+ pthread_setcancelstate F
+ pthread_setcanceltype F
+ pthread_setschedparam F
+ ptrace F
+ ptsname F
+ ptsname_r F
+ putc F
+ putc_unlocked F
+ putchar F
+ putchar_unlocked F
+ putenv F
+ putgrent F
+ putmsg F
+ putpmsg F
+ putpwent F
+ puts F
+ putsgent F
+ putspent F
+ pututline F
+ pututxline F
+ putw F
+ putwc F
+ putwc_unlocked F
+ putwchar F
+ putwchar_unlocked F
+ pvalloc F
+ pwrite F
+ pwrite64 F
+ pwritev F
+ pwritev64 F
+ qecvt F
+ qecvt_r F
+ qfcvt F
+ qfcvt_r F
+ qgcvt F
+ qsort F
+ qsort_r F
+ query_module F
+ quick_exit F
+ quotactl F
+ raise F
+ rand F
+ rand_r F
+ random F
+ random_r F
+ rawmemchr F
+ rcmd F
+ rcmd_af F
+ re_comp F
+ re_compile_fastmap F
+ re_compile_pattern F
+ re_exec F
+ re_match F
+ re_match_2 F
+ re_search F
+ re_search_2 F
+ re_set_registers F
+ re_set_syntax F
+ re_syntax_options D 0x4
+ read F
+ readahead F
+ readdir F
+ readdir64 F
+ readdir64_r F
+ readdir_r F
+ readlink F
+ readlinkat F
+ readv F
+ realloc F
+ realpath F
+ reboot F
+ recv F
+ recvfrom F
+ recvmmsg F
+ recvmsg F
+ regcomp F
+ regerror F
+ regexec F
+ regfree F
+ register_printf_function F
+ register_printf_modifier F
+ register_printf_specifier F
+ register_printf_type F
+ registerrpc F
+ remap_file_pages F
+ remove F
+ removexattr F
+ remque F
+ rename F
+ renameat F
+ revoke F
+ rewind F
+ rewinddir F
+ rexec F
+ rexec_af F
+ rexecoptions D 0x4
+ rindex F
+ rmdir F
+ rpc_createerr D 0x10
+ rpmatch F
+ rresvport F
+ rresvport_af F
+ rtime F
+ ruserok F
+ ruserok_af F
+ ruserpass F
+ sbrk F
+ scalbn F
+ scalbnf F
+ scalbnl F
+ scandir F
+ scandir64 F
+ scandirat F
+ scandirat64 F
+ scanf F
+ sched_get_priority_max F
+ sched_get_priority_min F
+ sched_getaffinity F
+ sched_getcpu F
+ sched_getparam F
+ sched_getscheduler F
+ sched_rr_get_interval F
+ sched_setaffinity F
+ sched_setparam F
+ sched_setscheduler F
+ sched_yield F
+ seed48 F
+ seed48_r F
+ seekdir F
+ select F
+ semctl F
+ semget F
+ semop F
+ semtimedop F
+ send F
+ sendfile F
+ sendfile64 F
+ sendmmsg F
+ sendmsg F
+ sendto F
+ setaliasent F
+ setbuf F
+ setbuffer F
+ setcontext F
+ setdomainname F
+ setegid F
+ setenv F
+ seteuid F
+ setfsent F
+ setfsgid F
+ setfsuid F
+ setgid F
+ setgrent F
+ setgroups F
+ sethostent F
+ sethostid F
+ sethostname F
+ setipv4sourcefilter F
+ setitimer F
+ setjmp F
+ setlinebuf F
+ setlocale F
+ setlogin F
+ setlogmask F
+ setmntent F
+ setnetent F
+ setnetgrent F
+ setns F
+ setpgid F
+ setpgrp F
+ setpriority F
+ setprotoent F
+ setpwent F
+ setregid F
+ setresgid F
+ setresuid F
+ setreuid F
+ setrlimit F
+ setrlimit64 F
+ setrpcent F
+ setservent F
+ setsgent F
+ setsid F
+ setsockopt F
+ setsourcefilter F
+ setspent F
+ setstate F
+ setstate_r F
+ settimeofday F
+ setttyent F
+ setuid F
+ setusershell F
+ setutent F
+ setutxent F
+ setvbuf F
+ setxattr F
+ sgetsgent F
+ sgetsgent_r F
+ sgetspent F
+ sgetspent_r F
+ shmat F
+ shmctl F
+ shmdt F
+ shmget F
+ shutdown F
+ sigaction F
+ sigaddset F
+ sigaltstack F
+ sigandset F
+ sigblock F
+ sigdelset F
+ sigemptyset F
+ sigfillset F
+ siggetmask F
+ sighold F
+ sigignore F
+ siginterrupt F
+ sigisemptyset F
+ sigismember F
+ siglongjmp F
+ signal F
+ signalfd F
+ sigorset F
+ sigpause F
+ sigpending F
+ sigprocmask F
+ sigqueue F
+ sigrelse F
+ sigreturn F
+ sigset F
+ sigsetmask F
+ sigstack F
+ sigsuspend F
+ sigtimedwait F
+ sigvec F
+ sigwait F
+ sigwaitinfo F
+ sleep F
+ snprintf F
+ sockatmark F
+ socket F
+ socketpair F
+ splice F
+ sprintf F
+ sprofil F
+ srand F
+ srand48 F
+ srand48_r F
+ srandom F
+ srandom_r F
+ sscanf F
+ ssignal F
+ sstk F
+ statfs F
+ statfs64 F
+ statvfs F
+ statvfs64 F
+ stderr D 0x4
+ stdin D 0x4
+ stdout D 0x4
+ step F
+ stime F
+ stpcpy F
+ stpncpy F
+ strcasecmp F
+ strcasecmp_l F
+ strcasestr F
+ strcat F
+ strchr F
+ strchrnul F
+ strcmp F
+ strcoll F
+ strcoll_l F
+ strcpy F
+ strcspn F
+ strdup F
+ strerror F
+ strerror_l F
+ strerror_r F
+ strfmon F
+ strfmon_l F
+ strfry F
+ strftime F
+ strftime_l F
+ strlen F
+ strncasecmp F
+ strncasecmp_l F
+ strncat F
+ strncmp F
+ strncpy F
+ strndup F
+ strnlen F
+ strpbrk F
+ strptime F
+ strptime_l F
+ strrchr F
+ strsep F
+ strsignal F
+ strspn F
+ strstr F
+ strtod F
+ strtod_l F
+ strtof F
+ strtof_l F
+ strtoimax F
+ strtok F
+ strtok_r F
+ strtol F
+ strtol_l F
+ strtold F
+ strtold_l F
+ strtoll F
+ strtoll_l F
+ strtoq F
+ strtoul F
+ strtoul_l F
+ strtoull F
+ strtoull_l F
+ strtoumax F
+ strtouq F
+ strverscmp F
+ strxfrm F
+ strxfrm_l F
+ stty F
+ svc_exit F
+ svc_fdset D 0x80
+ svc_getreq F
+ svc_getreq_common F
+ svc_getreq_poll F
+ svc_getreqset F
+ svc_max_pollfd D 0x4
+ svc_pollfd D 0x4
+ svc_register F
+ svc_run F
+ svc_sendreply F
+ svc_unregister F
+ svcauthdes_stats D 0xc
+ svcerr_auth F
+ svcerr_decode F
+ svcerr_noproc F
+ svcerr_noprog F
+ svcerr_progvers F
+ svcerr_systemerr F
+ svcerr_weakauth F
+ svcfd_create F
+ svcraw_create F
+ svctcp_create F
+ svcudp_bufcreate F
+ svcudp_create F
+ svcudp_enablecache F
+ svcunix_create F
+ svcunixfd_create F
+ swab F
+ swapcontext F
+ swapoff F
+ swapon F
+ swprintf F
+ swscanf F
+ symlink F
+ symlinkat F
+ sync F
+ sync_file_range F
+ syncfs F
+ sys_errlist D 0x21c
+ sys_nerr D 0x4
+ sys_sigabbrev D 0x104
+ sys_siglist D 0x104
+ syscall F
+ sysconf F
+ sysinfo F
+ syslog F
+ system F
+ sysv_signal F
+ tcdrain F
+ tcflow F
+ tcflush F
+ tcgetattr F
+ tcgetpgrp F
+ tcgetsid F
+ tcsendbreak F
+ tcsetattr F
+ tcsetpgrp F
+ tdelete F
+ tdestroy F
+ tee F
+ telldir F
+ tempnam F
+ textdomain F
+ tfind F
+ time F
+ timegm F
+ timelocal F
+ timerfd_create F
+ timerfd_gettime F
+ timerfd_settime F
+ times F
+ timespec_get F
+ timezone D 0x4
+ tmpfile F
+ tmpfile64 F
+ tmpnam F
+ tmpnam_r F
+ toascii F
+ tolower F
+ tolower_l F
+ toupper F
+ toupper_l F
+ towctrans F
+ towctrans_l F
+ towlower F
+ towlower_l F
+ towupper F
+ towupper_l F
+ tr_break F
+ truncate F
+ truncate64 F
+ tsearch F
+ ttyname F
+ ttyname_r F
+ ttyslot F
+ twalk F
+ tzname D 0x8
+ tzset F
+ ualarm F
+ ulckpwdf F
+ ulimit F
+ umask F
+ umount F
+ umount2 F
+ uname F
+ ungetc F
+ ungetwc F
+ unlink F
+ unlinkat F
+ unlockpt F
+ unsetenv F
+ unshare F
+ updwtmp F
+ updwtmpx F
+ uselib F
+ uselocale F
+ user2netname F
+ usleep F
+ ustat F
+ utime F
+ utimensat F
+ utimes F
+ utmpname F
+ utmpxname F
+ valloc F
+ vasprintf F
+ vdprintf F
+ verr F
+ verrx F
+ versionsort F
+ versionsort64 F
+ vfork F
+ vfprintf F
+ vfscanf F
+ vfwprintf F
+ vfwscanf F
+ vhangup F
+ vlimit F
+ vmsplice F
+ vprintf F
+ vscanf F
+ vsnprintf F
+ vsprintf F
+ vsscanf F
+ vswprintf F
+ vswscanf F
+ vsyslog F
+ vtimes F
+ vwarn F
+ vwarnx F
+ vwprintf F
+ vwscanf F
+ wait F
+ wait3 F
+ wait4 F
+ waitid F
+ waitpid F
+ warn F
+ warnx F
+ wcpcpy F
+ wcpncpy F
+ wcrtomb F
+ wcscasecmp F
+ wcscasecmp_l F
+ wcscat F
+ wcschr F
+ wcschrnul F
+ wcscmp F
+ wcscoll F
+ wcscoll_l F
+ wcscpy F
+ wcscspn F
+ wcsdup F
+ wcsftime F
+ wcsftime_l F
+ wcslen F
+ wcsncasecmp F
+ wcsncasecmp_l F
+ wcsncat F
+ wcsncmp F
+ wcsncpy F
+ wcsnlen F
+ wcsnrtombs F
+ wcspbrk F
+ wcsrchr F
+ wcsrtombs F
+ wcsspn F
+ wcsstr F
+ wcstod F
+ wcstod_l F
+ wcstof F
+ wcstof_l F
+ wcstoimax F
+ wcstok F
+ wcstol F
+ wcstol_l F
+ wcstold F
+ wcstold_l F
+ wcstoll F
+ wcstoll_l F
+ wcstombs F
+ wcstoq F
+ wcstoul F
+ wcstoul_l F
+ wcstoull F
+ wcstoull_l F
+ wcstoumax F
+ wcstouq F
+ wcswcs F
+ wcswidth F
+ wcsxfrm F
+ wcsxfrm_l F
+ wctob F
+ wctomb F
+ wctrans F
+ wctrans_l F
+ wctype F
+ wctype_l F
+ wcwidth F
+ wmemchr F
+ wmemcmp F
+ wmemcpy F
+ wmemmove F
+ wmempcpy F
+ wmemset F
+ wordexp F
+ wordfree F
+ wprintf F
+ write F
+ writev F
+ wscanf F
+ xdecrypt F
+ xdr_accepted_reply F
+ xdr_array F
+ xdr_authdes_cred F
+ xdr_authdes_verf F
+ xdr_authunix_parms F
+ xdr_bool F
+ xdr_bytes F
+ xdr_callhdr F
+ xdr_callmsg F
+ xdr_char F
+ xdr_cryptkeyarg F
+ xdr_cryptkeyarg2 F
+ xdr_cryptkeyres F
+ xdr_des_block F
+ xdr_double F
+ xdr_enum F
+ xdr_float F
+ xdr_free F
+ xdr_getcredres F
+ xdr_hyper F
+ xdr_int F
+ xdr_int16_t F
+ xdr_int32_t F
+ xdr_int64_t F
+ xdr_int8_t F
+ xdr_key_netstarg F
+ xdr_key_netstres F
+ xdr_keybuf F
+ xdr_keystatus F
+ xdr_long F
+ xdr_longlong_t F
+ xdr_netnamestr F
+ xdr_netobj F
+ xdr_opaque F
+ xdr_opaque_auth F
+ xdr_pmap F
+ xdr_pmaplist F
+ xdr_pointer F
+ xdr_quad_t F
+ xdr_reference F
+ xdr_rejected_reply F
+ xdr_replymsg F
+ xdr_rmtcall_args F
+ xdr_rmtcallres F
+ xdr_short F
+ xdr_sizeof F
+ xdr_string F
+ xdr_u_char F
+ xdr_u_hyper F
+ xdr_u_int F
+ xdr_u_long F
+ xdr_u_longlong_t F
+ xdr_u_quad_t F
+ xdr_u_short F
+ xdr_uint16_t F
+ xdr_uint32_t F
+ xdr_uint64_t F
+ xdr_uint8_t F
+ xdr_union F
+ xdr_unixcred F
+ xdr_vector F
+ xdr_void F
+ xdr_wrapstring F
+ xdrmem_create F
+ xdrrec_create F
+ xdrrec_endofrecord F
+ xdrrec_eof F
+ xdrrec_skiprecord F
+ xdrstdio_create F
+ xencrypt F
+ xprt_register F
+ xprt_unregister F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libcrypt.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libcrypt.abilist
new file mode 100644
index 000000000..1a52738c4
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libcrypt.abilist
@@ -0,0 +1,9 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ crypt F
+ crypt_r F
+ encrypt F
+ encrypt_r F
+ fcrypt F
+ setkey F
+ setkey_r F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libdl.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libdl.abilist
new file mode 100644
index 000000000..295ea7dc2
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libdl.abilist
@@ -0,0 +1,11 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ dladdr F
+ dladdr1 F
+ dlclose F
+ dlerror F
+ dlinfo F
+ dlmopen F
+ dlopen F
+ dlsym F
+ dlvsym F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libm.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libm.abilist
new file mode 100644
index 000000000..0f3ea4ba4
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libm.abilist
@@ -0,0 +1,397 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ _LIB_VERSION D 0x4
+ __acos_finite F
+ __acosf_finite F
+ __acosh_finite F
+ __acoshf_finite F
+ __acoshl_finite F
+ __acosl_finite F
+ __asin_finite F
+ __asinf_finite F
+ __asinl_finite F
+ __atan2_finite F
+ __atan2f_finite F
+ __atan2l_finite F
+ __atanh_finite F
+ __atanhf_finite F
+ __atanhl_finite F
+ __clog10 F
+ __clog10f F
+ __clog10l F
+ __cosh_finite F
+ __coshf_finite F
+ __coshl_finite F
+ __exp10_finite F
+ __exp10f_finite F
+ __exp10l_finite F
+ __exp2_finite F
+ __exp2f_finite F
+ __exp2l_finite F
+ __exp_finite F
+ __expf_finite F
+ __expl_finite F
+ __finite F
+ __finitef F
+ __finitel F
+ __fmod_finite F
+ __fmodf_finite F
+ __fmodl_finite F
+ __fpclassify F
+ __fpclassifyf F
+ __fpclassifyl F
+ __gamma_r_finite F
+ __gammaf_r_finite F
+ __gammal_r_finite F
+ __hypot_finite F
+ __hypotf_finite F
+ __hypotl_finite F
+ __j0_finite F
+ __j0f_finite F
+ __j0l_finite F
+ __j1_finite F
+ __j1f_finite F
+ __j1l_finite F
+ __jn_finite F
+ __jnf_finite F
+ __jnl_finite F
+ __lgamma_r_finite F
+ __lgammaf_r_finite F
+ __lgammal_r_finite F
+ __log10_finite F
+ __log10f_finite F
+ __log10l_finite F
+ __log2_finite F
+ __log2f_finite F
+ __log2l_finite F
+ __log_finite F
+ __logf_finite F
+ __logl_finite F
+ __pow_finite F
+ __powf_finite F
+ __powl_finite F
+ __remainder_finite F
+ __remainderf_finite F
+ __remainderl_finite F
+ __scalb_finite F
+ __scalbf_finite F
+ __scalbl_finite F
+ __signbit F
+ __signbitf F
+ __signbitl F
+ __sinh_finite F
+ __sinhf_finite F
+ __sinhl_finite F
+ __sqrt_finite F
+ __sqrtf_finite F
+ __sqrtl_finite F
+ __y0_finite F
+ __y0f_finite F
+ __y0l_finite F
+ __y1_finite F
+ __y1f_finite F
+ __y1l_finite F
+ __yn_finite F
+ __ynf_finite F
+ __ynl_finite F
+ acos F
+ acosf F
+ acosh F
+ acoshf F
+ acoshl F
+ acosl F
+ asin F
+ asinf F
+ asinh F
+ asinhf F
+ asinhl F
+ asinl F
+ atan F
+ atan2 F
+ atan2f F
+ atan2l F
+ atanf F
+ atanh F
+ atanhf F
+ atanhl F
+ atanl F
+ cabs F
+ cabsf F
+ cabsl F
+ cacos F
+ cacosf F
+ cacosh F
+ cacoshf F
+ cacoshl F
+ cacosl F
+ carg F
+ cargf F
+ cargl F
+ casin F
+ casinf F
+ casinh F
+ casinhf F
+ casinhl F
+ casinl F
+ catan F
+ catanf F
+ catanh F
+ catanhf F
+ catanhl F
+ catanl F
+ cbrt F
+ cbrtf F
+ cbrtl F
+ ccos F
+ ccosf F
+ ccosh F
+ ccoshf F
+ ccoshl F
+ ccosl F
+ ceil F
+ ceilf F
+ ceill F
+ cexp F
+ cexpf F
+ cexpl F
+ cimag F
+ cimagf F
+ cimagl F
+ clog F
+ clog10 F
+ clog10f F
+ clog10l F
+ clogf F
+ clogl F
+ conj F
+ conjf F
+ conjl F
+ copysign F
+ copysignf F
+ copysignl F
+ cos F
+ cosf F
+ cosh F
+ coshf F
+ coshl F
+ cosl F
+ cpow F
+ cpowf F
+ cpowl F
+ cproj F
+ cprojf F
+ cprojl F
+ creal F
+ crealf F
+ creall F
+ csin F
+ csinf F
+ csinh F
+ csinhf F
+ csinhl F
+ csinl F
+ csqrt F
+ csqrtf F
+ csqrtl F
+ ctan F
+ ctanf F
+ ctanh F
+ ctanhf F
+ ctanhl F
+ ctanl F
+ drem F
+ dremf F
+ dreml F
+ erf F
+ erfc F
+ erfcf F
+ erfcl F
+ erff F
+ erfl F
+ exp F
+ exp10 F
+ exp10f F
+ exp10l F
+ exp2 F
+ exp2f F
+ exp2l F
+ expf F
+ expl F
+ expm1 F
+ expm1f F
+ expm1l F
+ fabs F
+ fabsf F
+ fabsl F
+ fdim F
+ fdimf F
+ fdiml F
+ feclearexcept F
+ fedisableexcept F
+ feenableexcept F
+ fegetenv F
+ fegetexcept F
+ fegetexceptflag F
+ fegetround F
+ feholdexcept F
+ feraiseexcept F
+ fesetenv F
+ fesetexceptflag F
+ fesetround F
+ fetestexcept F
+ feupdateenv F
+ finite F
+ finitef F
+ finitel F
+ floor F
+ floorf F
+ floorl F
+ fma F
+ fmaf F
+ fmal F
+ fmax F
+ fmaxf F
+ fmaxl F
+ fmin F
+ fminf F
+ fminl F
+ fmod F
+ fmodf F
+ fmodl F
+ frexp F
+ frexpf F
+ frexpl F
+ gamma F
+ gammaf F
+ gammal F
+ hypot F
+ hypotf F
+ hypotl F
+ ilogb F
+ ilogbf F
+ ilogbl F
+ j0 F
+ j0f F
+ j0l F
+ j1 F
+ j1f F
+ j1l F
+ jn F
+ jnf F
+ jnl F
+ ldexp F
+ ldexpf F
+ ldexpl F
+ lgamma F
+ lgamma_r F
+ lgammaf F
+ lgammaf_r F
+ lgammal F
+ lgammal_r F
+ llrint F
+ llrintf F
+ llrintl F
+ llround F
+ llroundf F
+ llroundl F
+ log F
+ log10 F
+ log10f F
+ log10l F
+ log1p F
+ log1pf F
+ log1pl F
+ log2 F
+ log2f F
+ log2l F
+ logb F
+ logbf F
+ logbl F
+ logf F
+ logl F
+ lrint F
+ lrintf F
+ lrintl F
+ lround F
+ lroundf F
+ lroundl F
+ matherr F
+ modf F
+ modff F
+ modfl F
+ nan F
+ nanf F
+ nanl F
+ nearbyint F
+ nearbyintf F
+ nearbyintl F
+ nextafter F
+ nextafterf F
+ nextafterl F
+ nexttoward F
+ nexttowardf F
+ nexttowardl F
+ pow F
+ pow10 F
+ pow10f F
+ pow10l F
+ powf F
+ powl F
+ remainder F
+ remainderf F
+ remainderl F
+ remquo F
+ remquof F
+ remquol F
+ rint F
+ rintf F
+ rintl F
+ round F
+ roundf F
+ roundl F
+ scalb F
+ scalbf F
+ scalbl F
+ scalbln F
+ scalblnf F
+ scalblnl F
+ scalbn F
+ scalbnf F
+ scalbnl F
+ signgam D 0x4
+ significand F
+ significandf F
+ significandl F
+ sin F
+ sincos F
+ sincosf F
+ sincosl F
+ sinf F
+ sinh F
+ sinhf F
+ sinhl F
+ sinl F
+ sqrt F
+ sqrtf F
+ sqrtl F
+ tan F
+ tanf F
+ tanh F
+ tanhf F
+ tanhl F
+ tanl F
+ tgamma F
+ tgammaf F
+ tgammal F
+ trunc F
+ truncf F
+ truncl F
+ y0 F
+ y0f F
+ y0l F
+ y1 F
+ y1f F
+ y1l F
+ yn F
+ ynf F
+ ynl F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libnsl.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libnsl.abilist
new file mode 100644
index 000000000..3accaa07a
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libnsl.abilist
@@ -0,0 +1,123 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ __free_fdresult F
+ __nis_default_access F
+ __nis_default_group F
+ __nis_default_owner F
+ __nis_default_ttl F
+ __nis_finddirectory F
+ __nis_hash F
+ __nisbind_connect F
+ __nisbind_create F
+ __nisbind_destroy F
+ __nisbind_next F
+ __yp_check F
+ nis_add F
+ nis_add_entry F
+ nis_addmember F
+ nis_checkpoint F
+ nis_clone_directory F
+ nis_clone_object F
+ nis_clone_result F
+ nis_creategroup F
+ nis_destroy_object F
+ nis_destroygroup F
+ nis_dir_cmp F
+ nis_domain_of F
+ nis_domain_of_r F
+ nis_first_entry F
+ nis_free_directory F
+ nis_free_object F
+ nis_free_request F
+ nis_freenames F
+ nis_freeresult F
+ nis_freeservlist F
+ nis_freetags F
+ nis_getnames F
+ nis_getservlist F
+ nis_ismember F
+ nis_leaf_of F
+ nis_leaf_of_r F
+ nis_lerror F
+ nis_list F
+ nis_local_directory F
+ nis_local_group F
+ nis_local_host F
+ nis_local_principal F
+ nis_lookup F
+ nis_mkdir F
+ nis_modify F
+ nis_modify_entry F
+ nis_name_of F
+ nis_name_of_r F
+ nis_next_entry F
+ nis_perror F
+ nis_ping F
+ nis_print_directory F
+ nis_print_entry F
+ nis_print_group F
+ nis_print_group_entry F
+ nis_print_link F
+ nis_print_object F
+ nis_print_result F
+ nis_print_rights F
+ nis_print_table F
+ nis_read_obj F
+ nis_remove F
+ nis_remove_entry F
+ nis_removemember F
+ nis_rmdir F
+ nis_servstate F
+ nis_sperrno F
+ nis_sperror F
+ nis_sperror_r F
+ nis_stats F
+ nis_verifygroup F
+ nis_write_obj F
+ readColdStartFile F
+ writeColdStartFile F
+ xdr_cback_data F
+ xdr_domainname F
+ xdr_keydat F
+ xdr_mapname F
+ xdr_obj_p F
+ xdr_peername F
+ xdr_valdat F
+ xdr_yp_buf F
+ xdr_ypall F
+ xdr_ypbind_binding F
+ xdr_ypbind_resp F
+ xdr_ypbind_resptype F
+ xdr_ypbind_setdom F
+ xdr_ypdelete_args F
+ xdr_ypmap_parms F
+ xdr_ypmaplist F
+ xdr_yppush_status F
+ xdr_yppushresp_xfr F
+ xdr_ypreq_key F
+ xdr_ypreq_nokey F
+ xdr_ypreq_xfr F
+ xdr_ypresp_all F
+ xdr_ypresp_key_val F
+ xdr_ypresp_maplist F
+ xdr_ypresp_master F
+ xdr_ypresp_order F
+ xdr_ypresp_val F
+ xdr_ypresp_xfr F
+ xdr_ypstat F
+ xdr_ypupdate_args F
+ xdr_ypxfrstat F
+ yp_all F
+ yp_bind F
+ yp_first F
+ yp_get_default_domain F
+ yp_maplist F
+ yp_master F
+ yp_match F
+ yp_next F
+ yp_order F
+ yp_unbind F
+ yp_update F
+ ypbinderr_string F
+ yperr_string F
+ ypprot_err F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist
new file mode 100644
index 000000000..ee6993291
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist
@@ -0,0 +1,225 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ _IO_flockfile F
+ _IO_ftrylockfile F
+ _IO_funlockfile F
+ __close F
+ __connect F
+ __errno_location F
+ __fcntl F
+ __fork F
+ __h_errno_location F
+ __libc_allocate_rtsig F
+ __libc_current_sigrtmax F
+ __libc_current_sigrtmin F
+ __lseek F
+ __nanosleep F
+ __open F
+ __open64 F
+ __pread64 F
+ __pthread_cleanup_routine F
+ __pthread_getspecific F
+ __pthread_key_create F
+ __pthread_mutex_destroy F
+ __pthread_mutex_init F
+ __pthread_mutex_lock F
+ __pthread_mutex_trylock F
+ __pthread_mutex_unlock F
+ __pthread_mutexattr_destroy F
+ __pthread_mutexattr_init F
+ __pthread_mutexattr_settype F
+ __pthread_once F
+ __pthread_register_cancel F
+ __pthread_register_cancel_defer F
+ __pthread_rwlock_destroy F
+ __pthread_rwlock_init F
+ __pthread_rwlock_rdlock F
+ __pthread_rwlock_tryrdlock F
+ __pthread_rwlock_trywrlock F
+ __pthread_rwlock_unlock F
+ __pthread_rwlock_wrlock F
+ __pthread_setspecific F
+ __pthread_unregister_cancel F
+ __pthread_unregister_cancel_restore F
+ __pthread_unwind_next F
+ __pwrite64 F
+ __read F
+ __res_state F
+ __send F
+ __sigaction F
+ __vfork F
+ __wait F
+ __write F
+ _pthread_cleanup_pop F
+ _pthread_cleanup_pop_restore F
+ _pthread_cleanup_push F
+ _pthread_cleanup_push_defer F
+ accept F
+ close F
+ connect F
+ fcntl F
+ flockfile F
+ fork F
+ fsync F
+ ftrylockfile F
+ funlockfile F
+ longjmp F
+ lseek F
+ lseek64 F
+ msync F
+ nanosleep F
+ open F
+ open64 F
+ pause F
+ pread F
+ pread64 F
+ pthread_atfork F
+ pthread_attr_destroy F
+ pthread_attr_getaffinity_np F
+ pthread_attr_getdetachstate F
+ pthread_attr_getguardsize F
+ pthread_attr_getinheritsched F
+ pthread_attr_getschedparam F
+ pthread_attr_getschedpolicy F
+ pthread_attr_getscope F
+ pthread_attr_getstack F
+ pthread_attr_getstackaddr F
+ pthread_attr_getstacksize F
+ pthread_attr_init F
+ pthread_attr_setaffinity_np F
+ pthread_attr_setdetachstate F
+ pthread_attr_setguardsize F
+ pthread_attr_setinheritsched F
+ pthread_attr_setschedparam F
+ pthread_attr_setschedpolicy F
+ pthread_attr_setscope F
+ pthread_attr_setstack F
+ pthread_attr_setstackaddr F
+ pthread_attr_setstacksize F
+ pthread_barrier_destroy F
+ pthread_barrier_init F
+ pthread_barrier_wait F
+ pthread_barrierattr_destroy F
+ pthread_barrierattr_getpshared F
+ pthread_barrierattr_init F
+ pthread_barrierattr_setpshared F
+ pthread_cancel F
+ pthread_cond_broadcast F
+ pthread_cond_destroy F
+ pthread_cond_init F
+ pthread_cond_signal F
+ pthread_cond_timedwait F
+ pthread_cond_wait F
+ pthread_condattr_destroy F
+ pthread_condattr_getclock F
+ pthread_condattr_getpshared F
+ pthread_condattr_init F
+ pthread_condattr_setclock F
+ pthread_condattr_setpshared F
+ pthread_create F
+ pthread_detach F
+ pthread_equal F
+ pthread_exit F
+ pthread_getaffinity_np F
+ pthread_getattr_np F
+ pthread_getconcurrency F
+ pthread_getcpuclockid F
+ pthread_getname_np F
+ pthread_getschedparam F
+ pthread_getspecific F
+ pthread_join F
+ pthread_key_create F
+ pthread_key_delete F
+ pthread_kill F
+ pthread_kill_other_threads_np F
+ pthread_mutex_consistent F
+ pthread_mutex_consistent_np F
+ pthread_mutex_destroy F
+ pthread_mutex_getprioceiling F
+ pthread_mutex_init F
+ pthread_mutex_lock F
+ pthread_mutex_setprioceiling F
+ pthread_mutex_timedlock F
+ pthread_mutex_trylock F
+ pthread_mutex_unlock F
+ pthread_mutexattr_destroy F
+ pthread_mutexattr_getkind_np F
+ pthread_mutexattr_getprioceiling F
+ pthread_mutexattr_getprotocol F
+ pthread_mutexattr_getpshared F
+ pthread_mutexattr_getrobust F
+ pthread_mutexattr_getrobust_np F
+ pthread_mutexattr_gettype F
+ pthread_mutexattr_init F
+ pthread_mutexattr_setkind_np F
+ pthread_mutexattr_setprioceiling F
+ pthread_mutexattr_setprotocol F
+ pthread_mutexattr_setpshared F
+ pthread_mutexattr_setrobust F
+ pthread_mutexattr_setrobust_np F
+ pthread_mutexattr_settype F
+ pthread_once F
+ pthread_rwlock_destroy F
+ pthread_rwlock_init F
+ pthread_rwlock_rdlock F
+ pthread_rwlock_timedrdlock F
+ pthread_rwlock_timedwrlock F
+ pthread_rwlock_tryrdlock F
+ pthread_rwlock_trywrlock F
+ pthread_rwlock_unlock F
+ pthread_rwlock_wrlock F
+ pthread_rwlockattr_destroy F
+ pthread_rwlockattr_getkind_np F
+ pthread_rwlockattr_getpshared F
+ pthread_rwlockattr_init F
+ pthread_rwlockattr_setkind_np F
+ pthread_rwlockattr_setpshared F
+ pthread_self F
+ pthread_setaffinity_np F
+ pthread_setcancelstate F
+ pthread_setcanceltype F
+ pthread_setconcurrency F
+ pthread_setname_np F
+ pthread_setschedparam F
+ pthread_setschedprio F
+ pthread_setspecific F
+ pthread_sigmask F
+ pthread_sigqueue F
+ pthread_spin_destroy F
+ pthread_spin_init F
+ pthread_spin_lock F
+ pthread_spin_trylock F
+ pthread_spin_unlock F
+ pthread_testcancel F
+ pthread_timedjoin_np F
+ pthread_tryjoin_np F
+ pthread_yield F
+ pwrite F
+ pwrite64 F
+ raise F
+ read F
+ recv F
+ recvfrom F
+ recvmsg F
+ sem_close F
+ sem_destroy F
+ sem_getvalue F
+ sem_init F
+ sem_open F
+ sem_post F
+ sem_timedwait F
+ sem_trywait F
+ sem_unlink F
+ sem_wait F
+ send F
+ sendmsg F
+ sendto F
+ sigaction F
+ siglongjmp F
+ sigwait F
+ system F
+ tcdrain F
+ vfork F
+ wait F
+ waitpid F
+ write F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libresolv.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libresolv.abilist
new file mode 100644
index 000000000..0cb56606f
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libresolv.abilist
@@ -0,0 +1,93 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ __b64_ntop F
+ __b64_pton F
+ __dn_comp F
+ __dn_count_labels F
+ __dn_expand F
+ __dn_skipname F
+ __fp_nquery F
+ __fp_query F
+ __fp_resstat F
+ __hostalias F
+ __loc_aton F
+ __loc_ntoa F
+ __p_cdname F
+ __p_cdnname F
+ __p_class F
+ __p_class_syms D 0x54
+ __p_fqname F
+ __p_fqnname F
+ __p_option F
+ __p_query F
+ __p_rcode F
+ __p_secstodate F
+ __p_time F
+ __p_type F
+ __p_type_syms D 0x228
+ __putlong F
+ __putshort F
+ __res_close F
+ __res_dnok F
+ __res_hnok F
+ __res_hostalias F
+ __res_isourserver F
+ __res_mailok F
+ __res_mkquery F
+ __res_nameinquery F
+ __res_nmkquery F
+ __res_nquery F
+ __res_nquerydomain F
+ __res_nsearch F
+ __res_nsend F
+ __res_ownok F
+ __res_queriesmatch F
+ __res_query F
+ __res_querydomain F
+ __res_search F
+ __res_send F
+ __sym_ntop F
+ __sym_ntos F
+ __sym_ston F
+ _gethtbyaddr F
+ _gethtbyname F
+ _gethtbyname2 F
+ _gethtent F
+ _getlong F
+ _getshort F
+ _res_opcodes D 0x40
+ _sethtent F
+ inet_net_ntop F
+ inet_net_pton F
+ inet_neta F
+ ns_datetosecs F
+ ns_format_ttl F
+ ns_get16 F
+ ns_get32 F
+ ns_initparse F
+ ns_makecanon F
+ ns_msg_getflag F
+ ns_name_compress F
+ ns_name_ntol F
+ ns_name_ntop F
+ ns_name_pack F
+ ns_name_pton F
+ ns_name_rollback F
+ ns_name_skip F
+ ns_name_uncompress F
+ ns_name_unpack F
+ ns_parse_ttl F
+ ns_parserr F
+ ns_put16 F
+ ns_put32 F
+ ns_samedomain F
+ ns_samename F
+ ns_skiprr F
+ ns_sprintrr F
+ ns_sprintrrf F
+ ns_subdomain F
+ res_gethostbyaddr F
+ res_gethostbyname F
+ res_gethostbyname2 F
+ res_send_setqhook F
+ res_send_setrhook F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/librt.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/librt.abilist
new file mode 100644
index 000000000..3748949eb
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/librt.abilist
@@ -0,0 +1,42 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ __mq_open_2 F
+ aio_cancel F
+ aio_cancel64 F
+ aio_error F
+ aio_error64 F
+ aio_fsync F
+ aio_fsync64 F
+ aio_init F
+ aio_read F
+ aio_read64 F
+ aio_return F
+ aio_return64 F
+ aio_suspend F
+ aio_suspend64 F
+ aio_write F
+ aio_write64 F
+ clock_getcpuclockid F
+ clock_getres F
+ clock_gettime F
+ clock_nanosleep F
+ clock_settime F
+ lio_listio F
+ lio_listio64 F
+ mq_close F
+ mq_getattr F
+ mq_notify F
+ mq_open F
+ mq_receive F
+ mq_send F
+ mq_setattr F
+ mq_timedreceive F
+ mq_timedsend F
+ mq_unlink F
+ shm_open F
+ shm_unlink F
+ timer_create F
+ timer_delete F
+ timer_getoverrun F
+ timer_gettime F
+ timer_settime F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libthread_db.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libthread_db.abilist
new file mode 100644
index 000000000..6ee3113a3
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libthread_db.abilist
@@ -0,0 +1,42 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ td_init F
+ td_log F
+ td_symbol_list F
+ td_ta_clear_event F
+ td_ta_delete F
+ td_ta_enable_stats F
+ td_ta_event_addr F
+ td_ta_event_getmsg F
+ td_ta_get_nthreads F
+ td_ta_get_ph F
+ td_ta_get_stats F
+ td_ta_map_id2thr F
+ td_ta_map_lwp2thr F
+ td_ta_new F
+ td_ta_reset_stats F
+ td_ta_set_event F
+ td_ta_setconcurrency F
+ td_ta_thr_iter F
+ td_ta_tsd_iter F
+ td_thr_clear_event F
+ td_thr_dbresume F
+ td_thr_dbsuspend F
+ td_thr_event_enable F
+ td_thr_event_getmsg F
+ td_thr_get_info F
+ td_thr_getfpregs F
+ td_thr_getgregs F
+ td_thr_getxregs F
+ td_thr_getxregsize F
+ td_thr_set_event F
+ td_thr_setfpregs F
+ td_thr_setgregs F
+ td_thr_setprio F
+ td_thr_setsigpending F
+ td_thr_setxregs F
+ td_thr_sigsetmask F
+ td_thr_tls_get_addr F
+ td_thr_tlsbase F
+ td_thr_tsd F
+ td_thr_validate F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libutil.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libutil.abilist
new file mode 100644
index 000000000..3e738ffc6
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libutil.abilist
@@ -0,0 +1,8 @@
+GLIBC_2.16
+ GLIBC_2.16 A
+ forkpty F
+ login F
+ login_tty F
+ logout F
+ logwtmp F
+ openpty F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir.c
new file mode 100644
index 000000000..9288ca258
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/scandir.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir64.c
new file mode 100644
index 000000000..6d2205759
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandir64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/scandir64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat.c
new file mode 100644
index 000000000..5b8899367
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/scandirat.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat64.c
new file mode 100644
index 000000000..0d7893d29
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/scandirat64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/scandirat64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu-static.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu-static.c
new file mode 100644
index 000000000..38bbf9abd
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu-static.c
@@ -0,0 +1,3 @@
+#ifndef SHARED
+#include "../../sched_getcpu.c"
+#endif
diff --git a/libc/sysdeps/powerpc/soft-fp/q_qtod.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S
index 2c735808a..789552ebb 100644
--- a/libc/sysdeps/powerpc/soft-fp/q_qtod.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S
@@ -1,9 +1,5 @@
-/* Software floating-point emulation.
- Return (double)a
- Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@cygnus.com) and
- Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,26 +15,36 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include "soft-fp.h"
-#include "double.h"
-#include "quad.h"
-
-double _q_qtod(const long double a)
-{
- FP_DECL_EX;
- FP_DECL_Q(A);
- FP_DECL_D(R);
- double r;
-
- FP_INIT_ROUNDMODE;
- FP_UNPACK_SEMIRAW_Q(A, a);
-#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
- FP_TRUNC(D,Q,2,4,R,A);
-#else
- FP_TRUNC(D,Q,1,2,R,A);
-#endif
- FP_PACK_SEMIRAW_D(r, R);
- FP_HANDLE_EXCEPTIONS;
+#ifdef SHARED
+#include <sysdep.h>
+#include <tls.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+ENTRY (sched_getcpu)
+ /* Align stack and create local variable for result. */
+ sub $0x8, %esp
+ cfi_adjust_cfa_offset(8)
+
+ mov %esp, %edi
+ xor %esi, %esi
+ mov $VGETCPU_CACHE_OFFSET, %edx
+ add %fs:0, %edx
+
+ call __getcpu
- return r;
-}
+ /* Local variable is result if the call is successful. */
+ mov (%rsp), %edx
+ /* Restore stack pointer before we might jump to
+ SYSCALL_ERROR_LABEL which returns to the caller. */
+ add $0x8, %esp
+ cfi_adjust_cfa_offset(-8)
+
+ cmp $-4095, %eax
+ jae SYSCALL_ERROR_LABEL
+
+ mov %edx, %eax
+L(pseudo_end):
+ ret
+PSEUDO_END(sched_getcpu)
+#endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list b/libc/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list
new file mode 100644
index 000000000..2cc58af2d
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list
@@ -0,0 +1,8 @@
+# File name Caller Syscall name # args Strong name Weak names
+
+fallocate - fallocate Ci:iiii fallocate fallocate64
+gettimeofday - gettimeofday:__vdso_gettimeofday@LINUX_2.6 i:pP __gettimeofday gettimeofday
+posix_fadvise - fadvise64 Vi:iiii posix_fadvise posix_fadvise64
+preadv - preadv Ci:ipii preadv preadv64
+pwritev - pwritev Ci:ipii pwritev pwritev64
+time - time:__vdso_time@LINUX_2.6 Ei:P time
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/sysctl.mk b/libc/sysdeps/unix/sysv/linux/x86_64/x32/sysctl.mk
new file mode 100644
index 000000000..da018fe62
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/sysctl.mk
@@ -0,0 +1 @@
+# X32 doesn't support sysctl.
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h b/libc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h
new file mode 100644
index 000000000..35e4c84c1
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LINUX_X32_SYSDEP_H
+#define _LINUX_X32_SYSDEP_H 1
+
+/* There is some commonality. */
+#include <sysdeps/unix/sysv/linux/x86_64/sysdep.h>
+#include <sysdeps/x86_64/x32/sysdep.h>
+
+#endif /* linux/x86_64/x32/sysdep.h */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile.c
new file mode 100644
index 000000000..f24f361bb
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/tmpfile.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile64.c
new file mode 100644
index 000000000..55feef2a6
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/tmpfile64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/tmpfile64.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort.c
new file mode 100644
index 000000000..af5a668c2
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/versionsort.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort64.c b/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort64.c
new file mode 100644
index 000000000..fe220c90e
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/versionsort64.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/versionsort64.c>
diff --git a/libc/sysdeps/unix/x86_64/sysdep.S b/libc/sysdeps/unix/x86_64/sysdep.S
index 66d90f2d8..b13fdf4ae 100644
--- a/libc/sysdeps/unix/x86_64/sysdep.S
+++ b/libc/sysdeps/unix/x86_64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2002,2004,2005,2011,2012 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,7 +34,7 @@ __syscall_error:
/* We translate the system's EWOULDBLOCK error into EAGAIN.
The GNU C library always defines EWOULDBLOCK==EAGAIN.
EWOULDBLOCK_sys is the original number. */
- cmpq $EWOULDBLOCK_sys, %rax /* Is it the old EWOULDBLOCK? */
+ cmp $EWOULDBLOCK_sys, %RAX_LP /* Is it the old EWOULDBLOCK? */
jne notb /* Branch if not. */
movl $EAGAIN, %eax /* Yes; translate it to EAGAIN. */
notb:
@@ -45,7 +45,7 @@ notb:
#else
movl %eax, %fs:C_SYMBOL_NAME(errno@TPOFF)
#endif
- movq $-1, %rax
+ or $-1, %RAX_LP
ret
#undef __syscall_error
diff --git a/libc/sysdeps/x86_64/64/Implies-after b/libc/sysdeps/x86_64/64/Implies-after
new file mode 100644
index 000000000..a8cae95f9
--- /dev/null
+++ b/libc/sysdeps/x86_64/64/Implies-after
@@ -0,0 +1 @@
+wordsize-64
diff --git a/libc/sysdeps/x86_64/64/shlib-versions b/libc/sysdeps/x86_64/64/shlib-versions
new file mode 100644
index 000000000..c79748734
--- /dev/null
+++ b/libc/sysdeps/x86_64/64/shlib-versions
@@ -0,0 +1,4 @@
+# Configuration DEFAULT Earliest symbol set
+# ------------- --------------- ------------------------------
+x86_64-.*-linux.* DEFAULT GLIBC_2.2.5
+x86_64-.*-linux.* ld=ld-linux-x86-64.so.2 GLIBC_2.2.5
diff --git a/libc/sysdeps/x86_64/Implies b/libc/sysdeps/x86_64/Implies
index 2e0a323e1..c8d7d2d91 100644
--- a/libc/sysdeps/x86_64/Implies
+++ b/libc/sysdeps/x86_64/Implies
@@ -1,4 +1,3 @@
-wordsize-64
ieee754/ldbl-96
ieee754/dbl-64/wordsize-64
ieee754/dbl-64
diff --git a/libc/sysdeps/x86_64/Makefile b/libc/sysdeps/x86_64/Makefile
index 81c9128a9..d4525bc7c 100644
--- a/libc/sysdeps/x86_64/Makefile
+++ b/libc/sysdeps/x86_64/Makefile
@@ -11,6 +11,10 @@ ifeq ($(subdir),gmon)
sysdep_routines += _mcount
endif
+ifeq ($(subdir),malloc)
+tests += tst-mallocalign1
+endif
+
ifeq ($(subdir),string)
sysdep_routines += cacheinfo strcasecmp_l-nonascii strncase_l-nonascii
gen-as-const-headers += locale-defines.sym
diff --git a/libc/sysdeps/x86_64/__longjmp.S b/libc/sysdeps/x86_64/__longjmp.S
index 3963f9ca1..ef1147abc 100644
--- a/libc/sysdeps/x86_64/__longjmp.S
+++ b/libc/sysdeps/x86_64/__longjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
/* Jump to the position specified by ENV, causing the
setjmp call there to return VAL, or 1 if VAL is 0.
@@ -25,14 +26,23 @@
.text
ENTRY(__longjmp)
/* Restore registers. */
- movq (JB_RSP*8)(%rdi),%r8
- movq (JB_RBP*8)(%rdi),%r9
- movq (JB_PC*8)(%rdi),%rdx
+ mov (JB_RSP*8)(%rdi),%R8_LP
+ mov (JB_RBP*8)(%rdi),%R9_LP
+ mov (JB_PC*8)(%rdi),%RDX_LP
#ifdef PTR_DEMANGLE
- PTR_DEMANGLE (%r8)
- PTR_DEMANGLE (%r9)
- PTR_DEMANGLE (%rdx)
+ PTR_DEMANGLE (%R8_LP)
+ PTR_DEMANGLE (%R9_LP)
+ PTR_DEMANGLE (%RDX_LP)
+# ifdef __ILP32__
+ /* We ignored the high bits of the %rbp value because only the low
+ bits are mangled. But we cannot presume that %rbp is being used
+ as a pointer and truncate it, so recover the high bits. */
+ movl (JB_RBP*8 + 4)(%rdi), %eax
+ shlq $32, %rax
+ orq %rax, %r9
+# endif
#endif
+ LIBC_PROBE (longjmp, 3, LP_SIZE@%RDI_LP, -4@%esi, LP_SIZE@%RDX_LP)
/* We add unwind information for the target here. */
cfi_def_cfa(%rdi, 0)
cfi_register(%rsp,%r8)
@@ -50,7 +60,9 @@ ENTRY(__longjmp)
movq (JB_R15*8)(%rdi),%r15
/* Set return value for setjmp. */
mov %esi, %eax
- movq %r8,%rsp
+ mov %R8_LP,%RSP_LP
movq %r9,%rbp
+ LIBC_PROBE (longjmp_target, 3,
+ LP_SIZE@%RDI_LP, -4@%eax, LP_SIZE@%RDX_LP)
jmpq *%rdx
END (__longjmp)
diff --git a/libc/sysdeps/x86_64/bits/wordsize.h b/libc/sysdeps/x86_64/bits/wordsize.h
index 9b38756fd..e25af287e 100644
--- a/libc/sysdeps/x86_64/bits/wordsize.h
+++ b/libc/sysdeps/x86_64/bits/wordsize.h
@@ -2,7 +2,12 @@
#if defined __x86_64__ && !defined __ILP32__
# define __WORDSIZE 64
-# define __WORDSIZE_COMPAT32 1
#else
# define __WORDSIZE 32
#endif
+
+#ifdef __x86_64__
+# define __WORDSIZE_TIME64_COMPAT32 1
+/* Both x86-64 and x32 use the 64-bit system call interface. */
+# define __SYSCALL_WORDSIZE 64
+#endif
diff --git a/libc/sysdeps/x86_64/dl-machine.h b/libc/sysdeps/x86_64/dl-machine.h
index 32814b14f..9c27ecffd 100644
--- a/libc/sysdeps/x86_64/dl-machine.h
+++ b/libc/sysdeps/x86_64/dl-machine.h
@@ -72,10 +72,10 @@ elf_machine_load_address (void)
load offset which is zero if the binary was loaded at the address
it is prelinked for. */
- asm ("leaq _dl_start(%%rip), %0\n\t"
- "subq 1f(%%rip), %0\n\t"
+ asm ("lea _dl_start(%%rip), %0\n\t"
+ "sub 1f(%%rip), %0\n\t"
".section\t.data.rel.ro\n"
- "1:\t.quad _dl_start\n\t"
+ "1:\t" ASM_ADDR " _dl_start\n\t"
".previous\n\t"
: "=r" (addr) : : "cc");
diff --git a/libc/sysdeps/x86_64/dl-trampoline.h b/libc/sysdeps/x86_64/dl-trampoline.h
index 4c18e692d..0f3de3d3d 100644
--- a/libc/sysdeps/x86_64/dl-trampoline.h
+++ b/libc/sysdeps/x86_64/dl-trampoline.h
@@ -40,14 +40,14 @@
vmovdqa %xmm7, (LR_SIZE + XMM_SIZE*7)(%rsp)
#endif
- movq %rsp, %rcx # La_x86_64_regs pointer to %rcx.
- movq 48(%rbx), %rdx # Load return address if needed.
- movq 40(%rbx), %rsi # Copy args pushed by PLT in register.
- movq 32(%rbx), %rdi # %rdi: link_map, %rsi: reloc_index
- leaq 16(%rbx), %r8
+ mov %RSP_LP, %RCX_LP # La_x86_64_regs pointer to %rcx.
+ mov 48(%rbx), %RDX_LP # Load return address if needed.
+ mov 40(%rbx), %RSI_LP # Copy args pushed by PLT in register.
+ mov 32(%rbx), %RDI_LP # %rdi: link_map, %rsi: reloc_index
+ lea 16(%rbx), %R8_LP # Address of framesize
call _dl_profile_fixup # Call resolver.
- movq %rax, %r11 # Save return value.
+ mov %RAX_LP, %R11_LP # Save return value.
movq 8(%rbx), %rax # Get back register content.
movq LR_RDX_OFFSET(%rsp), %rdx
@@ -140,8 +140,8 @@
1:
#endif
- movq 16(%rbx), %r10 # Anything in framesize?
- testq %r10, %r10
+ mov 16(%rbx), %R10_LP # Anything in framesize?
+ test %R10_LP, %R10_LP
jns 3f
/* There's nothing in the frame size, so there
diff --git a/libc/sysdeps/x86_64/fpu/bits/mathinline.h b/libc/sysdeps/x86_64/fpu/bits/mathinline.h
index 49a199b60..7cfe68874 100644
--- a/libc/sysdeps/x86_64/fpu/bits/mathinline.h
+++ b/libc/sysdeps/x86_64/fpu/bits/mathinline.h
@@ -1,5 +1,5 @@
/* Inline math functions for x86-64.
- Copyright (C) 2002-2004,2007,2009,2011,2012 Free Software Foundation, Inc.
+ Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -68,7 +68,10 @@ __END_NAMESPACE_C99
#endif
-#if __GNUC_PREREQ (2, 8) && !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+#if __GNUC_PREREQ (2, 8) && !__GNUC_PREREQ (3, 4) \
+ && !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+/* GCC 3.4 introduced builtins for all functions below, so
+ there's no need to define any of these inline functions. */
# ifdef __USE_ISOC99
__BEGIN_NAMESPACE_C99
diff --git a/libc/sysdeps/x86_64/fpu/libm-test-ulps b/libc/sysdeps/x86_64/fpu/libm-test-ulps
index 9bb26d1fe..3374b5fbd 100644
--- a/libc/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/libc/sysdeps/x86_64/fpu/libm-test-ulps
@@ -576,6 +576,18 @@ ildouble: 1
ldouble: 1
# ccos
+Test "Imaginary part of: ccos (-0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (-0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccos (-0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (-0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
double: 1
idouble: 1
@@ -596,6 +608,21 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: ccos (0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccos (0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccos (0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccos (0x1p-1074 + 1440 i) == inf - 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
# ccosh
Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
@@ -608,6 +635,18 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: ccosh (-710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (-710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (-89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccosh (-89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
double: 1
float: 1
@@ -616,6 +655,21 @@ ifloat: 1
Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
float: 1
ifloat: 1
+Test "Imaginary part of: ccosh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: ccosh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ccosh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
# cexp
Test "Real part of: cexp (-10000 + 0x1p16383 i) == 1.045876464564882298442774542991176546722e-4343 + 4.421154026488516836023811173959413420548e-4344 i":
@@ -639,7 +693,7 @@ ldouble: 1
Test "Imaginary part of: cexp (11356.5625 + 0.75 i) == 9.052188470850960144814815984311663764287e4931 + 8.432986734191301036267148978260970230200e4931 i":
ildouble: 1
ldouble: 1
-Test "Imaginary part of: cexp (1440 + 0x1p-1074 i) == inf + 1.196295853897226111293303155636183216483e302 i plus overflow exception":
+Test "Imaginary part of: cexp (1440 + 0x1p-1074 i) == inf + 1.196295853897226111293303155636183216483e302 i":
double: 1
idouble: 1
Test "Real part of: cexp (50 + 0x1p127 i) == 4.053997150228616856622417636046265337193e21 + 3.232070315463388524466674772633810238819e21 i":
@@ -1085,6 +1139,18 @@ ildouble: 1
ldouble: 1
# csin
+Test "Real part of: csin (-0.75 + 710.5 i) == -1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (-0.75 + 89.5 i) == -2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: csin (-0.75 - 710.5 i) == -1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (-0.75 - 89.5 i) == -2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
double: 1
idouble: 1
@@ -1094,6 +1160,21 @@ ldouble: 1
Test "Imaginary part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
float: 1
ifloat: 1
+Test "Real part of: csin (0.75 + 710.5 i) == 1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (0.75 + 89.5 i) == 2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: csin (0.75 - 710.5 i) == 1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i":
+double: 1
+idouble: 1
+Test "Real part of: csin (0.75 - 89.5 i) == 2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i":
+float: 1
+ifloat: 1
+Test "Real part of: csin (0x1p-1074 + 1440 i) == 5.981479269486130556466515778180916082415e301 + inf i":
+double: 1
+idouble: 1
# csinh
Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
@@ -1104,6 +1185,18 @@ double: 1
idouble: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: csinh (-710.5 + 0.75 i) == -1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (-710.5 - 0.75 i) == -1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (-89.5 + 0.75 i) == -2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csinh (-89.5 - 0.75 i) == -2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
float: 1
ifloat: 1
@@ -1112,6 +1205,21 @@ ldouble: 1
Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
float: 1
ifloat: 1
+Test "Imaginary part of: csinh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csinh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csinh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i":
+float: 1
+ifloat: 1
# csqrt
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
@@ -2368,7 +2476,9 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "ccos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2500,6 +2610,10 @@ ildouble: 4
ldouble: 4
Function: Real part of "csin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
diff --git a/libc/sysdeps/x86_64/memcpy.S b/libc/sysdeps/x86_64/memcpy.S
index d74e5329b..9e693f2a9 100644
--- a/libc/sysdeps/x86_64/memcpy.S
+++ b/libc/sysdeps/x86_64/memcpy.S
@@ -254,7 +254,7 @@ L(32after):
L(fasttry): /* first 1/2 L1 */
#ifndef NOT_IN_libc /* only up to this algorithm outside of libc.so */
- movq __x86_64_data_cache_size_half(%rip), %r11
+ mov __x86_64_data_cache_size_half(%rip), %R11_LP
cmpq %rdx, %r11 /* calculate the smaller of */
cmovaq %rdx, %r11 /* remaining bytes and 1/2 L1 */
#endif
@@ -303,7 +303,7 @@ L(fastafter):
/* Handle large blocks smaller than 1/2 L2. */
L(pretry): /* first 1/2 L2 */
- movq __x86_64_shared_cache_size_half (%rip), %r8
+ mov __x86_64_shared_cache_size_half (%rip), %R8_LP
cmpq %rdx, %r8 /* calculate the lesser of */
cmovaq %rdx, %r8 /* remaining bytes and 1/2 L2 */
diff --git a/libc/sysdeps/x86_64/multiarch/Makefile b/libc/sysdeps/x86_64/multiarch/Makefile
index 9a183f068..dd6c27d0b 100644
--- a/libc/sysdeps/x86_64/multiarch/Makefile
+++ b/libc/sysdeps/x86_64/multiarch/Makefile
@@ -1,5 +1,6 @@
ifeq ($(subdir),csu)
aux += init-arch
+tests += test-multiarch
gen-as-const-headers += ifunc-defines.sym
endif
diff --git a/libc/sysdeps/x86_64/multiarch/init-arch.c b/libc/sysdeps/x86_64/multiarch/init-arch.c
index 80527ec59..fb44dcfcf 100644
--- a/libc/sysdeps/x86_64/multiarch/init-arch.c
+++ b/libc/sysdeps/x86_64/multiarch/init-arch.c
@@ -1,6 +1,6 @@
/* Initialize CPU feature data.
This file is part of the GNU C Library.
- Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2012 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@redhat.com>.
The GNU C Library is free software; you can redistribute it and/or
@@ -143,16 +143,23 @@ __init_cpu_features (void)
else
kind = arch_kind_other;
- if (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX)
+ /* Can we call xgetbv? */
+ if (CPUID_OSXSAVE)
{
- /* Reset the AVX bit in case OSXSAVE is disabled. */
- if ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_OSXSAVE) != 0
- && ({ unsigned int xcrlow;
- unsigned int xcrhigh;
- asm ("xgetbv"
- : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
- (xcrlow & 6) == 6; }))
- __cpu_features.feature[index_YMM_Usable] |= bit_YMM_Usable;
+ unsigned int xcrlow;
+ unsigned int xcrhigh;
+ asm ("xgetbv" : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
+ /* Is YMM and XMM state usable? */
+ if ((xcrlow & (bit_YMM_state | bit_XMM_state)) ==
+ (bit_YMM_state | bit_XMM_state))
+ {
+ /* Determine if AVX is usable. */
+ if (CPUID_AVX)
+ __cpu_features.feature[index_AVX_Usable] |= bit_AVX_Usable;
+ /* Determine if FMA4 is usable. */
+ if (CPUID_FMA4)
+ __cpu_features.feature[index_FMA4_Usable] |= bit_FMA4_Usable;
+ }
}
__cpu_features.family = family;
diff --git a/libc/sysdeps/x86_64/multiarch/init-arch.h b/libc/sysdeps/x86_64/multiarch/init-arch.h
index 5054e46f6..45e265167 100644
--- a/libc/sysdeps/x86_64/multiarch/init-arch.h
+++ b/libc/sysdeps/x86_64/multiarch/init-arch.h
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2012 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -21,8 +21,10 @@
#define bit_Prefer_SSE_for_memop (1 << 3)
#define bit_Fast_Unaligned_Load (1 << 4)
#define bit_Prefer_PMINUB_for_stringop (1 << 5)
-#define bit_YMM_Usable (1 << 6)
+#define bit_AVX_Usable (1 << 6)
+#define bit_FMA4_Usable (1 << 7)
+/* CPUID Feature flags. */
#define bit_SSE2 (1 << 26)
#define bit_SSSE3 (1 << 9)
#define bit_SSE4_1 (1 << 19)
@@ -33,6 +35,10 @@
#define bit_FMA (1 << 12)
#define bit_FMA4 (1 << 16)
+/* XCR0 Feature flags. */
+#define bit_XMM_state (1 << 1)
+#define bit_YMM_state (2 << 1)
+
#ifdef __ASSEMBLER__
# include <ifunc-defines.h>
@@ -49,7 +55,8 @@
# define index_Prefer_SSE_for_memop FEATURE_INDEX_1*FEATURE_SIZE
# define index_Fast_Unaligned_Load FEATURE_INDEX_1*FEATURE_SIZE
# define index_Prefer_PMINUB_for_stringop FEATURE_INDEX_1*FEATURE_SIZE
-# define index_YMM_Usable FEATURE_INDEX_1*FEATURE_SIZE
+# define index_AVX_Usable FEATURE_INDEX_1*FEATURE_SIZE
+# define index_FMA4_Usable FEATURE_INDEX_1*FEATURE_SIZE
#else /* __ASSEMBLER__ */
@@ -113,35 +120,45 @@ extern const struct cpu_features *__get_cpu_features (void)
/* Following are the feature tests used throughout libc. */
+/* CPUID_* evaluates to true if the feature flag is enabled.
+ We always use &__cpu_features because the HAS_CPUID_* macros
+ are called only within __init_cpu_features, where we can't
+ call __get_cpu_features without infinite recursion. */
+# define HAS_CPUID_FLAG(idx, reg, bit) \
+ (((&__cpu_features)->cpuid[idx].reg & (bit)) != 0)
+
+# define CPUID_OSXSAVE \
+ HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_OSXSAVE)
+# define CPUID_AVX \
+ HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_AVX)
+# define CPUID_FMA4 \
+ HAS_CPUID_FLAG (COMMON_CPUID_INDEX_80000001, ecx, bit_FMA4)
+
+/* HAS_* evaluates to true if we may use the feature at runtime. */
# define HAS_SSE2 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, edx, bit_SSE2)
# define HAS_POPCOUNT HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_POPCOUNT)
# define HAS_SSSE3 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSSE3)
# define HAS_SSE4_1 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSE4_1)
# define HAS_SSE4_2 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSE4_2)
# define HAS_FMA HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_FMA)
-# define HAS_AVX HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_AVX)
-# define HAS_FMA4 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_80000001, ecx, bit_FMA4)
# define index_Fast_Rep_String FEATURE_INDEX_1
# define index_Fast_Copy_Backward FEATURE_INDEX_1
# define index_Slow_BSF FEATURE_INDEX_1
# define index_Prefer_SSE_for_memop FEATURE_INDEX_1
# define index_Fast_Unaligned_Load FEATURE_INDEX_1
-# define index_YMM_Usable FEATURE_INDEX_1
+# define index_AVX_Usable FEATURE_INDEX_1
+# define index_FMA4_Usable FEATURE_INDEX_1
# define HAS_ARCH_FEATURE(name) \
((__get_cpu_features ()->feature[index_##name] & (bit_##name)) != 0)
-# define HAS_FAST_REP_STRING HAS_ARCH_FEATURE (Fast_Rep_String)
-
-# define HAS_FAST_COPY_BACKWARD HAS_ARCH_FEATURE (Fast_Copy_Backward)
-
-# define HAS_SLOW_BSF HAS_ARCH_FEATURE (Slow_BSF)
-
-# define HAS_PREFER_SSE_FOR_MEMOP HAS_ARCH_FEATURE (Prefer_SSE_for_memop)
-
-# define HAS_FAST_UNALIGNED_LOAD HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-
-# define HAS_YMM_USABLE HAS_ARCH_FEATURE (YMM_Usable)
+# define HAS_FAST_REP_STRING HAS_ARCH_FEATURE (Fast_Rep_String)
+# define HAS_FAST_COPY_BACKWARD HAS_ARCH_FEATURE (Fast_Copy_Backward)
+# define HAS_SLOW_BSF HAS_ARCH_FEATURE (Slow_BSF)
+# define HAS_PREFER_SSE_FOR_MEMOP HAS_ARCH_FEATURE (Prefer_SSE_for_memop)
+# define HAS_FAST_UNALIGNED_LOAD HAS_ARCH_FEATURE (Fast_Unaligned_Load)
+# define HAS_AVX HAS_ARCH_FEATURE (AVX_Usable)
+# define HAS_FMA4 HAS_ARCH_FEATURE (FMA4_Usable)
#endif /* __ASSEMBLER__ */
diff --git a/libc/sysdeps/x86_64/multiarch/memcmp-sse4.S b/libc/sysdeps/x86_64/multiarch/memcmp-sse4.S
index 530bf8ecd..2c8786599 100644
--- a/libc/sysdeps/x86_64/multiarch/memcmp-sse4.S
+++ b/libc/sysdeps/x86_64/multiarch/memcmp-sse4.S
@@ -319,9 +319,9 @@ L(less32bytesin256):
ALIGN (4)
L(512bytesormore):
# ifdef DATA_CACHE_SIZE_HALF
- mov $DATA_CACHE_SIZE_HALF, %r8
+ mov $DATA_CACHE_SIZE_HALF, %R8_LP
# else
- mov __x86_64_data_cache_size_half(%rip), %r8
+ mov __x86_64_data_cache_size_half(%rip), %R8_LP
# endif
mov %r8, %r9
shr $1, %r8
@@ -635,9 +635,9 @@ L(less32bytesin256in2alinged):
ALIGN (4)
L(512bytesormorein2aligned):
# ifdef DATA_CACHE_SIZE_HALF
- mov $DATA_CACHE_SIZE_HALF, %r8
+ mov $DATA_CACHE_SIZE_HALF, %R8_LP
# else
- mov __x86_64_data_cache_size_half(%rip), %r8
+ mov __x86_64_data_cache_size_half(%rip), %R8_LP
# endif
mov %r8, %r9
shr $1, %r8
diff --git a/libc/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S b/libc/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
index 0252f1636..5af9f4993 100644
--- a/libc/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
+++ b/libc/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
@@ -106,9 +106,9 @@ L(144bytesormore):
and $0xf, %r9
jz L(shl_0)
#ifdef DATA_CACHE_SIZE
- mov $DATA_CACHE_SIZE, %rcx
+ mov $DATA_CACHE_SIZE, %RCX_LP
#else
- mov __x86_64_data_cache_size(%rip), %rcx
+ mov __x86_64_data_cache_size(%rip), %RCX_LP
#endif
cmp %rcx, %rdx
jae L(gobble_mem_fwd)
@@ -122,9 +122,9 @@ L(144bytesormore):
ALIGN (4)
L(copy_backward):
#ifdef DATA_CACHE_SIZE
- mov $DATA_CACHE_SIZE, %rcx
+ mov $DATA_CACHE_SIZE, %RCX_LP
#else
- mov __x86_64_data_cache_size(%rip), %rcx
+ mov __x86_64_data_cache_size(%rip), %RCX_LP
#endif
shl $1, %rcx
cmp %rcx, %rdx
@@ -156,9 +156,9 @@ L(shl_0):
shr $8, %r9
add %rdx, %r9
#ifdef DATA_CACHE_SIZE
- cmp $DATA_CACHE_SIZE_HALF, %r9
+ cmp $DATA_CACHE_SIZE_HALF, %R9_LP
#else
- cmp __x86_64_data_cache_size_half(%rip), %r9
+ cmp __x86_64_data_cache_size_half(%rip), %R9_LP
#endif
jae L(gobble_mem_fwd)
sub $0x80, %rdx
@@ -1478,9 +1478,9 @@ L(gobble_mem_fwd):
add $16, %rdi
#ifdef SHARED_CACHE_SIZE_HALF
- mov $SHARED_CACHE_SIZE_HALF, %rcx
+ mov $SHARED_CACHE_SIZE_HALF, %RCX_LP
#else
- mov __x86_64_shared_cache_size_half(%rip), %rcx
+ mov __x86_64_shared_cache_size_half(%rip), %RCX_LP
#endif
#ifdef USE_AS_MEMMOVE
mov %rsi, %r9
@@ -1585,9 +1585,9 @@ L(gobble_mem_bwd):
#ifdef SHARED_CACHE_SIZE_HALF
- mov $SHARED_CACHE_SIZE_HALF, %rcx
+ mov $SHARED_CACHE_SIZE_HALF, %RCX_LP
#else
- mov __x86_64_shared_cache_size_half(%rip), %rcx
+ mov __x86_64_shared_cache_size_half(%rip), %RCX_LP
#endif
#ifdef USE_AS_MEMMOVE
mov %rdi, %r9
diff --git a/libc/sysdeps/x86_64/multiarch/memcpy-ssse3.S b/libc/sysdeps/x86_64/multiarch/memcpy-ssse3.S
index b71ac33df..3f7d54258 100644
--- a/libc/sysdeps/x86_64/multiarch/memcpy-ssse3.S
+++ b/libc/sysdeps/x86_64/multiarch/memcpy-ssse3.S
@@ -97,9 +97,9 @@ L(80bytesormore):
sub %rcx, %rsi
#ifdef SHARED_CACHE_SIZE_HALF
- mov $SHARED_CACHE_SIZE_HALF, %rcx
+ mov $SHARED_CACHE_SIZE_HALF, %RCX_LP
#else
- mov __x86_64_shared_cache_size_half(%rip), %rcx
+ mov __x86_64_shared_cache_size_half(%rip), %RCX_LP
#endif
cmp %rcx, %rdx
mov %rsi, %r9
@@ -107,9 +107,9 @@ L(80bytesormore):
and $0xf, %r9
jz L(shl_0)
#ifdef DATA_CACHE_SIZE_HALF
- mov $DATA_CACHE_SIZE_HALF, %rcx
+ mov $DATA_CACHE_SIZE_HALF, %RCX_LP
#else
- mov __x86_64_data_cache_size_half(%rip), %rcx
+ mov __x86_64_data_cache_size_half(%rip), %RCX_LP
#endif
BRANCH_TO_JMPTBL_ENTRY (L(shl_table), %r9, 4)
@@ -127,9 +127,9 @@ L(copy_backward):
sub %rcx, %rsi
#ifdef SHARED_CACHE_SIZE_HALF
- mov $SHARED_CACHE_SIZE_HALF, %rcx
+ mov $SHARED_CACHE_SIZE_HALF, %RCX_LP
#else
- mov __x86_64_shared_cache_size_half(%rip), %rcx
+ mov __x86_64_shared_cache_size_half(%rip), %RCX_LP
#endif
cmp %rcx, %rdx
@@ -138,9 +138,9 @@ L(copy_backward):
and $0xf, %r9
jz L(shl_0_bwd)
#ifdef DATA_CACHE_SIZE_HALF
- mov $DATA_CACHE_SIZE_HALF, %rcx
+ mov $DATA_CACHE_SIZE_HALF, %RCX_LP
#else
- mov __x86_64_data_cache_size_half(%rip), %rcx
+ mov __x86_64_data_cache_size_half(%rip), %RCX_LP
#endif
BRANCH_TO_JMPTBL_ENTRY (L(shl_table_bwd), %r9, 4)
@@ -175,9 +175,9 @@ L(shl_0_less_64bytes):
ALIGN (4)
L(shl_0_gobble):
#ifdef DATA_CACHE_SIZE_HALF
- cmp $DATA_CACHE_SIZE_HALF, %rdx
+ cmp $DATA_CACHE_SIZE_HALF, %RDX_LP
#else
- cmp __x86_64_data_cache_size_half(%rip), %rdx
+ cmp __x86_64_data_cache_size_half(%rip), %RDX_LP
#endif
lea -128(%rdx), %rdx
jae L(shl_0_gobble_mem_loop)
@@ -316,9 +316,9 @@ L(shl_0_less_64bytes_bwd):
ALIGN (4)
L(shl_0_gobble_bwd):
#ifdef DATA_CACHE_SIZE_HALF
- cmp $DATA_CACHE_SIZE_HALF, %rdx
+ cmp $DATA_CACHE_SIZE_HALF, %RDX_LP
#else
- cmp __x86_64_data_cache_size_half(%rip), %rdx
+ cmp __x86_64_data_cache_size_half(%rip), %RDX_LP
#endif
lea -128(%rdx), %rdx
jae L(shl_0_gobble_mem_bwd_loop)
diff --git a/libc/sysdeps/x86_64/multiarch/strcmp-sse42.S b/libc/sysdeps/x86_64/multiarch/strcmp-sse42.S
index 52cb70693..9d00bbc5a 100644
--- a/libc/sysdeps/x86_64/multiarch/strcmp-sse42.S
+++ b/libc/sysdeps/x86_64/multiarch/strcmp-sse42.S
@@ -51,7 +51,7 @@
#ifdef USE_AS_STRCASECMP_L
ENTRY (GLABEL(__strcasecmp))
movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
- movq %fs:(%rax),%rdx
+ mov %fs:(%rax),%RDX_LP
// XXX 5 byte should be before the function
/* 5-byte NOP. */
@@ -62,7 +62,7 @@ END (GLABEL(__strcasecmp))
#ifdef USE_AS_STRNCASECMP_L
ENTRY (GLABEL(__strncasecmp))
movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
- movq %fs:(%rax),%rcx
+ mov %fs:(%rax),%RCX_LP
// XXX 5 byte should be before the function
/* 5-byte NOP. */
@@ -99,9 +99,9 @@ STRCMP_SSE42:
/* We have to fall back on the C implementation for locales
with encodings not matching ASCII for single bytes. */
# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
- movq LOCALE_T___LOCALES+LC_CTYPE*8(%rdx), %rax
+ mov LOCALE_T___LOCALES+LC_CTYPE*LP_SIZE(%rdx), %RAX_LP
# else
- movq (%rdx), %rax
+ mov (%rdx), %RAX_LP
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
jne __strcasecmp_l_nonascii
@@ -110,9 +110,9 @@ STRCMP_SSE42:
/* We have to fall back on the C implementation for locales
with encodings not matching ASCII for single bytes. */
# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
- movq LOCALE_T___LOCALES+LC_CTYPE*8(%rcx), %rax
+ mov LOCALE_T___LOCALES+LC_CTYPE*LP_SIZE(%rcx), %RAX_LP
# else
- movq (%rcx), %rax
+ mov (%rcx), %RAX_LP
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
jne __strncasecmp_l_nonascii
diff --git a/libc/sysdeps/x86_64/multiarch/strcmp.S b/libc/sysdeps/x86_64/multiarch/strcmp.S
index 2b9870ba9..d366d0969 100644
--- a/libc/sysdeps/x86_64/multiarch/strcmp.S
+++ b/libc/sysdeps/x86_64/multiarch/strcmp.S
@@ -1,5 +1,5 @@
/* strcmp with SSE4.2
- Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2009-2012 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -83,6 +83,7 @@
.text
ENTRY(STRCMP)
.type STRCMP, @gnu_indirect_function
+ /* Manually inlined call to __get_cpu_features. */
cmpl $0, __cpu_features+KIND_OFFSET(%rip)
jne 1f
call __init_cpu_features
@@ -100,13 +101,14 @@ END(STRCMP)
# ifdef USE_AS_STRCASECMP_L
ENTRY(__strcasecmp)
.type __strcasecmp, @gnu_indirect_function
+ /* Manually inlined call to __get_cpu_features. */
cmpl $0, __cpu_features+KIND_OFFSET(%rip)
jne 1f
call __init_cpu_features
1:
# ifdef HAVE_AVX_SUPPORT
leaq __strcasecmp_avx(%rip), %rax
- testl $bit_AVX, __cpu_features+CPUID_OFFSET+index_AVX(%rip)
+ testl $bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip)
jnz 2f
# endif
leaq __strcasecmp_sse42(%rip), %rax
@@ -123,13 +125,14 @@ weak_alias (__strcasecmp, strcasecmp)
# ifdef USE_AS_STRNCASECMP_L
ENTRY(__strncasecmp)
.type __strncasecmp, @gnu_indirect_function
+ /* Manually inlined call to __get_cpu_features. */
cmpl $0, __cpu_features+KIND_OFFSET(%rip)
jne 1f
call __init_cpu_features
1:
# ifdef HAVE_AVX_SUPPORT
leaq __strncasecmp_avx(%rip), %rax
- testl $bit_AVX, __cpu_features+CPUID_OFFSET+index_AVX(%rip)
+ testl $bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip)
jnz 2f
# endif
leaq __strncasecmp_sse42(%rip), %rax
diff --git a/libc/sysdeps/x86_64/multiarch/test-multiarch.c b/libc/sysdeps/x86_64/multiarch/test-multiarch.c
new file mode 100644
index 000000000..76b1af2f8
--- /dev/null
+++ b/libc/sysdeps/x86_64/multiarch/test-multiarch.c
@@ -0,0 +1,90 @@
+/* Test CPU feature data.
+ This file is part of the GNU C Library.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <init-arch.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static char *cpu_flags;
+
+/* Search for flags in /proc/cpuinfo and store line
+ in cpu_flags. */
+void
+get_cpuinfo (void)
+{
+ FILE *f;
+ char *line = NULL;
+ size_t len = 0;
+ ssize_t read;
+
+ f = fopen ("/proc/cpuinfo", "r");
+ if (f == NULL)
+ {
+ printf ("cannot open /proc/cpuinfo");
+ exit (1);
+ }
+
+ while ((read = getline (&line, &len, f)) != -1)
+ {
+ if (strncmp (line, "flags", 5) == 0)
+ {
+ cpu_flags = strdup (line);
+ break;
+ }
+ }
+ fclose (f);
+ free (line);
+}
+
+int
+check_proc (const char *proc_name, int flag, const char *name)
+{
+ int found = 0;
+
+ printf ("Checking %s:\n", name);
+ printf (" init-arch %d\n", flag);
+ if (strstr (cpu_flags, proc_name) != NULL)
+ found = 1;
+ printf (" cpuinfo (%s) %d\n", proc_name, found);
+
+ if (found != flag)
+ printf (" *** failure ***\n");
+
+ return (found != flag);
+}
+
+static int
+do_test (int argc, char **argv)
+{
+ int fails;
+
+ get_cpuinfo ();
+ fails = check_proc ("avx", HAS_AVX, "HAS_AVX");
+ fails += check_proc ("fma4", HAS_FMA4, "HAS_FMA4");
+ fails += check_proc ("sse4_2", HAS_SSE4_2, "HAS_SSE4_2");
+ fails += check_proc ("sse4_1", HAS_SSE4_1, "HAS_SSE4_1");
+ fails += check_proc ("ssse3", HAS_SSSE3, "HAS_SSSE3");
+ fails += check_proc ("popcnt", HAS_POPCOUNT, "HAS_POPCOUNT");
+
+ printf ("%d differences between /proc/cpuinfo and glibc code.\n", fails);
+
+ return (fails != 0);
+}
+
+#include "../../../test-skeleton.c"
diff --git a/libc/sysdeps/x86_64/setjmp.S b/libc/sysdeps/x86_64/setjmp.S
index 1902d1458..82ac73151 100644
--- a/libc/sysdeps/x86_64/setjmp.S
+++ b/libc/sysdeps/x86_64/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for x86-64.
- Copyright (C) 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,14 +19,22 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
ENTRY (__sigsetjmp)
/* Save registers. */
movq %rbx, (JB_RBX*8)(%rdi)
#ifdef PTR_MANGLE
- movq %rbp, %rax
- PTR_MANGLE (%rax)
- movq %rax, (JB_RBP*8)(%rdi)
+# ifdef __ILP32__
+ /* Save the high bits of %rbp first, since PTR_MANGLE will
+ only handle the low bits but we cannot presume %rbp is
+ being used as a pointer and truncate it. Here we write all
+ of %rbp, but the low bits will be overwritten below. */
+ movq %rbp, (JB_RBP*8)(%rdi)
+# endif
+ mov %RBP_LP, %RAX_LP
+ PTR_MANGLE (%RAX_LP)
+ mov %RAX_LP, (JB_RBP*8)(%rdi)
#else
movq %rbp, (JB_RBP*8)(%rdi)
#endif
@@ -34,14 +42,15 @@ ENTRY (__sigsetjmp)
movq %r13, (JB_R13*8)(%rdi)
movq %r14, (JB_R14*8)(%rdi)
movq %r15, (JB_R15*8)(%rdi)
- leaq 8(%rsp), %rdx /* Save SP as it will be after we return. */
+ lea 8(%rsp), %RDX_LP /* Save SP as it will be after we return. */
#ifdef PTR_MANGLE
- PTR_MANGLE (%rdx)
+ PTR_MANGLE (%RDX_LP)
#endif
movq %rdx, (JB_RSP*8)(%rdi)
- movq (%rsp), %rax /* Save PC we are returning to now. */
+ mov (%rsp), %RAX_LP /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, LP_SIZE@%RDI_LP, -4@%esi, LP_SIZE@%RAX_LP)
#ifdef PTR_MANGLE
- PTR_MANGLE (%rax)
+ PTR_MANGLE (%RAX_LP)
#endif
movq %rax, (JB_PC*8)(%rdi)
diff --git a/libc/sysdeps/x86_64/stackguard-macros.h b/libc/sysdeps/x86_64/stackguard-macros.h
new file mode 100644
index 000000000..d7fedb373
--- /dev/null
+++ b/libc/sysdeps/x86_64/stackguard-macros.h
@@ -0,0 +1,6 @@
+#include <stdint.h>
+
+#define STACK_CHK_GUARD \
+ ({ uintptr_t x; \
+ asm ("mov %%fs:%c1, %0" : "=r" (x) \
+ : "i" (offsetof (tcbhead_t, stack_guard))); x; })
diff --git a/libc/sysdeps/x86_64/stackinfo.h b/libc/sysdeps/x86_64/stackinfo.h
index ee859e030..aad8dd435 100644
--- a/libc/sysdeps/x86_64/stackinfo.h
+++ b/libc/sysdeps/x86_64/stackinfo.h
@@ -34,10 +34,10 @@
for which they need to act as barriers as well, hence the additional
(unnecessary) parameters. */
#define stackinfo_get_sp() \
- ({ void *p__; asm volatile ("mov %%rsp, %0" : "=r" (p__)); p__; })
+ ({ void *p__; asm volatile ("mov %%" RSP_LP ", %0" : "=r" (p__)); p__; })
#define stackinfo_sub_sp(ptr) \
({ ptrdiff_t d__; \
- asm volatile ("sub %%rsp, %0" : "=r" (d__) : "0" (ptr)); \
+ asm volatile ("sub %%" RSP_LP " , %0" : "=r" (d__) : "0" (ptr)); \
d__; })
#endif /* stackinfo.h */
diff --git a/libc/sysdeps/x86_64/start.S b/libc/sysdeps/x86_64/start.S
index 5e01d2117..e60346304 100644
--- a/libc/sysdeps/x86_64/start.S
+++ b/libc/sysdeps/x86_64/start.S
@@ -44,13 +44,13 @@
before this code runs.
%rsp The stack contains the arguments and environment:
- 0(%rsp) argc
- 8(%rsp) argv[0]
+ 0(%rsp) argc
+ LP_SIZE(%rsp) argv[0]
...
- (8*argc)(%rsp) NULL
- (8*(argc+1))(%rsp) envp[0]
+ (LP_SIZE*argc)(%rsp) NULL
+ (LP_SIZE*(argc+1))(%rsp) envp[0]
...
- NULL
+ NULL
*/
#include <sysdep.h>
@@ -81,14 +81,21 @@ _start:
rtld_fini: %r9
stack_end: stack. */
- movq %rdx, %r9 /* Address of the shared library termination
+ mov %RDX_LP, %R9_LP /* Address of the shared library termination
function. */
+#ifdef __ILP32__
+ mov (%rsp), %esi /* Simulate popping 4-byte argument count. */
+ add $4, %esp
+#else
popq %rsi /* Pop the argument count. */
- movq %rsp, %rdx /* argv starts just at the current stack top. */
+#endif
+ /* argv starts just at the current stack top. */
+ mov %RSP_LP, %RDX_LP
/* Align the stack to a 16 byte boundary to follow the ABI. */
- andq $~15, %rsp
+ and $~15, %RSP_LP
- pushq %rax /* Push garbage because we push 8 more bytes. */
+ /* Push garbage because we push 8 more bytes. */
+ pushq %rax
/* Provide the highest stack address to the user code (for stacks
which grow downwards). */
@@ -96,20 +103,20 @@ _start:
#ifdef SHARED
/* Pass address of our own entry points to .fini and .init. */
- movq __libc_csu_fini@GOTPCREL(%rip), %r8
- movq __libc_csu_init@GOTPCREL(%rip), %rcx
+ mov __libc_csu_fini@GOTPCREL(%rip), %R8_LP
+ mov __libc_csu_init@GOTPCREL(%rip), %RCX_LP
- movq BP_SYM (main)@GOTPCREL(%rip), %rdi
+ mov BP_SYM (main)@GOTPCREL(%rip), %RDI_LP
/* Call the user's main function, and exit with its value.
But let the libc call main. */
call BP_SYM (__libc_start_main)@PLT
#else
/* Pass address of our own entry points to .fini and .init. */
- movq $__libc_csu_fini, %r8
- movq $__libc_csu_init, %rcx
+ mov $__libc_csu_fini, %R8_LP
+ mov $__libc_csu_init, %RCX_LP
- movq $BP_SYM (main), %rdi
+ mov $BP_SYM (main), %RDI_LP
/* Call the user's main function, and exit with its value.
But let the libc call main. */
diff --git a/libc/sysdeps/x86_64/strcmp.S b/libc/sysdeps/x86_64/strcmp.S
index 4da2bc406..a16d67d37 100644
--- a/libc/sysdeps/x86_64/strcmp.S
+++ b/libc/sysdeps/x86_64/strcmp.S
@@ -96,7 +96,7 @@
ENTRY2 (__strcasecmp)
movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
- movq %fs:(%rax),%rdx
+ mov %fs:(%rax),%RDX_LP
// XXX 5 byte should be before the function
/* 5-byte NOP. */
@@ -115,7 +115,7 @@ libc_hidden_def (__strcasecmp)
ENTRY2 (__strncasecmp)
movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
- movq %fs:(%rax),%rcx
+ mov %fs:(%rax),%RCX_LP
// XXX 5 byte should be before the function
/* 5-byte NOP. */
@@ -152,9 +152,9 @@ END (BP_SYM (STRCMP))
/* We have to fall back on the C implementation for locales
with encodings not matching ASCII for single bytes. */
# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
- movq LOCALE_T___LOCALES+LC_CTYPE*8(%rdx), %rax
+ mov LOCALE_T___LOCALES+LC_CTYPE*LP_SIZE(%rdx), %RAX_LP
# else
- movq (%rdx), %rax
+ mov (%rdx), %RAX_LP
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
jne __strcasecmp_l_nonascii
@@ -162,9 +162,9 @@ END (BP_SYM (STRCMP))
/* We have to fall back on the C implementation for locales
with encodings not matching ASCII for single bytes. */
# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
- movq LOCALE_T___LOCALES+LC_CTYPE*8(%rcx), %rax
+ mov LOCALE_T___LOCALES+LC_CTYPE*LP_SIZE(%rcx), %RAX_LP
# else
- movq (%rcx), %rax
+ mov (%rcx), %RAX_LP
# endif
testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
jne __strncasecmp_l_nonascii
diff --git a/libc/sysdeps/x86_64/sysdep.h b/libc/sysdeps/x86_64/sysdep.h
index e455c6087..af6949975 100644
--- a/libc/sysdeps/x86_64/sysdep.h
+++ b/libc/sysdeps/x86_64/sysdep.h
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _X86_64_SYSDEP_H
+#define _X86_64_SYSDEP_H 1
+
#include <sysdeps/generic/sysdep.h>
#ifdef __ASSEMBLER__
@@ -95,4 +98,62 @@ lose: \
#define atom_text_section .section ".text.atom", "ax"
+/* Long and pointer size in bytes. */
+#define LP_SIZE 8
+
+/* Instruction to operate on long and pointer. */
+#define LP_OP(insn) insn##q
+
+/* Assembler address directive. */
+#define ASM_ADDR .quad
+
+/* Registers to hold long and pointer. */
+#define RAX_LP rax
+#define RBP_LP rbp
+#define RBX_LP rbx
+#define RCX_LP rcx
+#define RDI_LP rdi
+#define RDX_LP rdx
+#define RSI_LP rsi
+#define RSP_LP rsp
+#define R8_LP r8
+#define R9_LP r9
+#define R10_LP r10
+#define R11_LP r11
+#define R12_LP r12
+#define R13_LP r13
+#define R14_LP r14
+#define R15_LP r15
+
+#else /* __ASSEMBLER__ */
+
+/* Long and pointer size in bytes. */
+#define LP_SIZE "8"
+
+/* Instruction to operate on long and pointer. */
+#define LP_OP(insn) #insn "q"
+
+/* Assembler address directive. */
+#define ASM_ADDR ".quad"
+
+/* Registers to hold long and pointer. */
+#define RAX_LP "rax"
+#define RBP_LP "rbp"
+#define RBX_LP "rbx"
+#define RCX_LP "rcx"
+#define RDI_LP "rdi"
+#define RDX_LP "rdx"
+#define RSI_LP "rsi"
+#define RSP_LP "rsp"
+#define R8_LP "r8"
+#define R9_LP "r9"
+#define R10_LP "r10"
+#define R11_LP "r11"
+#define R12_LP "r12"
+#define R13_LP "r13"
+#define R14_LP "r14"
+#define R15_LP "r15"
+
#endif /* __ASSEMBLER__ */
+
+#endif /* _X86_64_SYSDEP_H */
diff --git a/libc/sysdeps/x86_64/tst-mallocalign1.c b/libc/sysdeps/x86_64/tst-mallocalign1.c
new file mode 100644
index 000000000..d4e603609
--- /dev/null
+++ b/libc/sysdeps/x86_64/tst-mallocalign1.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Specified by x86-64 psABI. */
+#define ALIGN_MASK (16 - 1)
+
+void *
+test (size_t s)
+{
+ void *p = malloc (s);
+
+ printf ("malloc: %ld, %p: %ld\n", (unsigned long) s, p,
+ ((unsigned long) p) & ALIGN_MASK);
+ return p;
+}
+
+static int
+do_test (void)
+{
+ void *p;
+ int ret = 0;
+
+ p = test (2);
+ ret |= (unsigned long) p & ALIGN_MASK;
+ free (p);
+
+ p = test (8);
+ ret |= (unsigned long) p & ALIGN_MASK;
+ free (p);
+
+ p = test (13);
+ ret |= (unsigned long) p & ALIGN_MASK;
+ free (p);
+
+ p = test (16);
+ ret |= (unsigned long) p & ALIGN_MASK;
+ free (p);
+
+ p = test (23);
+ ret |= (unsigned long) p & ALIGN_MASK;
+ free (p);
+
+ p = test (43);
+ ret |= (unsigned long) p & ALIGN_MASK;
+ free (p);
+
+ p = test (123);
+ ret |= (unsigned long) p & ALIGN_MASK;
+ free (p);
+
+ return ret;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/sysdeps/x86_64/x32/Implies-after b/libc/sysdeps/x86_64/x32/Implies-after
new file mode 100644
index 000000000..39a34c5f5
--- /dev/null
+++ b/libc/sysdeps/x86_64/x32/Implies-after
@@ -0,0 +1 @@
+wordsize-32
diff --git a/libc/sysdeps/x86_64/x32/_itoa.h b/libc/sysdeps/x86_64/x32/_itoa.h
new file mode 100644
index 000000000..0f9ed4772
--- /dev/null
+++ b/libc/sysdeps/x86_64/x32/_itoa.h
@@ -0,0 +1,4 @@
+/* X32 uses 64-bit _itoa_word and _itoa is mapped to _itoa_word. */
+#define _ITOA_NEEDED 0
+#define _ITOA_WORD_TYPE unsigned long long int
+#include_next <_itoa.h>
diff --git a/libc/sysdeps/x86_64/x32/divdi3.c b/libc/sysdeps/x86_64/x32/divdi3.c
new file mode 100644
index 000000000..bc7b4c444
--- /dev/null
+++ b/libc/sysdeps/x86_64/x32/divdi3.c
@@ -0,0 +1 @@
+/* Fortunately nothing to do. */
diff --git a/libc/sysdeps/x86_64/x32/dl-machine.h b/libc/sysdeps/x86_64/x32/dl-machine.h
new file mode 100644
index 000000000..bdc1f4b1f
--- /dev/null
+++ b/libc/sysdeps/x86_64/x32/dl-machine.h
@@ -0,0 +1,86 @@
+/* Machine-dependent ELF dynamic relocation inline functions. x32 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Must allow <sysdeps/x86_64/dl-machine.h> to be included more than once.
+ See #ifdef RESOLVE_MAP in sysdeps/x86_64/dl-machine.h. */
+#include <sysdeps/x86_64/dl-machine.h>
+
+#ifndef _X32_DL_MACHINE_H
+#define _X32_DL_MACHINE_H
+
+#undef ARCH_LA_PLTENTER
+#undef ARCH_LA_PLTEXIT
+#undef RTLD_START
+
+/* Names of the architecture-specific auditing callback functions. */
+#define ARCH_LA_PLTENTER x32_gnu_pltenter
+#define ARCH_LA_PLTEXIT x32_gnu_pltexit
+
+/* Initial entry point code for the dynamic linker.
+ The C function `_dl_start' is the real entry point;
+ its return value is the user program's entry point. */
+#define RTLD_START asm ("\n\
+.text\n\
+ .p2align 4\n\
+.globl _start\n\
+.globl _dl_start_user\n\
+_start:\n\
+ movl %esp, %edi\n\
+ call _dl_start\n\
+_dl_start_user:\n\
+ # Save the user entry point address in %r12.\n\
+ movl %eax, %r12d\n\
+ # See if we were run as a command with the executable file\n\
+ # name as an extra leading argument.\n\
+ movl _dl_skip_args(%rip), %eax\n\
+ # Pop the original argument count.\n\
+ movl (%rsp), %edx\n\
+ # Adjust the stack pointer to skip _dl_skip_args words.\n\
+ lea 4(%rsp,%rax,4), %esp\n\
+ # Subtract _dl_skip_args from argc.\n\
+ subl %eax, %edx\n\
+ # Push argc back on the stack.\n\
+ subl $4, %esp\n\
+ movl %edx, (%rsp)\n\
+ # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env)\n\
+ # argc -> rsi\n\
+ movl %edx, %esi\n\
+ # Save %rsp value in %r13.\n\
+ movl %esp, %r13d\n\
+ # And align stack for the _dl_init_internal call.\n\
+ and $-16, %esp\n\
+ # _dl_loaded -> rdi\n\
+ movl _rtld_local(%rip), %edi\n\
+ # env -> rcx\n\
+ lea 8(%r13,%rdx,4), %ecx\n\
+ # argv -> rdx\n\
+ lea 4(%r13), %edx\n\
+ # Clear %rbp to mark outermost frame obviously even for constructors.\n\
+ xorl %ebp, %ebp\n\
+ # Call the function to run the initializers.\n\
+ call _dl_init_internal\n\
+ # Pass our finalizer function to the user in %rdx, as per ELF ABI.\n\
+ lea _dl_fini(%rip), %edx\n\
+ # And make sure %rsp points to argc stored on the stack.\n\
+ movl %r13d, %esp\n\
+ # Jump to the user's entry point.\n\
+ jmp *%r12\n\
+.previous\n\
+");
+
+#endif /* !_X32_DL_MACHINE_H */
diff --git a/libc/sysdeps/x86_64/x32/ffs.c b/libc/sysdeps/x86_64/x32/ffs.c
new file mode 100644
index 000000000..fa7de8b88
--- /dev/null
+++ b/libc/sysdeps/x86_64/x32/ffs.c
@@ -0,0 +1,4 @@
+#define ffsl __something_else
+#include <sysdeps/x86_64/ffs.c>
+#undef ffsl
+weak_alias (__ffs, ffsl)
diff --git a/libc/sysdeps/x86_64/x32/gmp-mparam.h b/libc/sysdeps/x86_64/x32/gmp-mparam.h
new file mode 100644
index 000000000..69ced24d4
--- /dev/null
+++ b/libc/sysdeps/x86_64/x32/gmp-mparam.h
@@ -0,0 +1,33 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at your
+option) any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MP Library; see the file COPYING.LIB. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#if defined __GMP_H__ && ! defined _LONG_LONG_LIMB
+#error "Included too late for _LONG_LONG_LIMB to take effect"
+#endif
+
+#define _LONG_LONG_LIMB
+#define BITS_PER_MP_LIMB 64
+#define BYTES_PER_MP_LIMB 8
+#define BITS_PER_LONGINT 32
+#define BITS_PER_INT 32
+#define BITS_PER_SHORTINT 16
+#define BITS_PER_CHAR 8
+
+#define IEEE_DOUBLE_BIG_ENDIAN 0
diff --git a/libc/sysdeps/x86_64/x32/shlib-versions b/libc/sysdeps/x86_64/x32/shlib-versions
new file mode 100644
index 000000000..d9f63e106
--- /dev/null
+++ b/libc/sysdeps/x86_64/x32/shlib-versions
@@ -0,0 +1,8 @@
+# Configuration DEFAULT Earliest symbol set
+# ------------- --------------- ------------------------------
+x86_64-.*-linux.* DEFAULT GLIBC_2.16
+x86_64-.*-linux.* ld=ld-linux-x32.so.2 GLIBC_2.16
+
+# Configuration ABI Identifier for ABI data files
+# ------------- ---------- -----------------------------
+x86_64-.*-.* ABI x32-@OS@
diff --git a/libc/sysdeps/x86_64/x32/symbol-hacks.h b/libc/sysdeps/x86_64/x32/symbol-hacks.h
new file mode 100644
index 000000000..bc7b4c444
--- /dev/null
+++ b/libc/sysdeps/x86_64/x32/symbol-hacks.h
@@ -0,0 +1 @@
+/* Fortunately nothing to do. */
diff --git a/libc/sysdeps/x86_64/x32/sysdep.h b/libc/sysdeps/x86_64/x32/sysdep.h
new file mode 100644
index 000000000..cbe2e5f41
--- /dev/null
+++ b/libc/sysdeps/x86_64/x32/sysdep.h
@@ -0,0 +1,92 @@
+/* Assembler macros for x32.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdeps/x86_64/sysdep.h>
+
+#undef LP_SIZE
+#undef LP_OP
+#undef ASM_ADDR
+
+#undef RAX_LP
+#undef RBP_LP
+#undef RBX_LP
+#undef RCX_LP
+#undef RDI_LP
+#undef RDX_LP
+#undef RSP_LP
+#undef RSI_LP
+#undef R8_LP
+#undef R9_LP
+#undef R10_LP
+#undef R11_LP
+#undef R12_LP
+#undef R13_LP
+#undef R14_LP
+#undef R15_LP
+
+#ifdef __ASSEMBLER__
+
+# define LP_SIZE 4
+
+# define LP_OP(insn) insn##l
+
+# define ASM_ADDR .long
+
+# define RAX_LP eax
+# define RBP_LP ebp
+# define RBX_LP ebx
+# define RCX_LP ecx
+# define RDI_LP edi
+# define RDX_LP edx
+# define RSI_LP esi
+# define RSP_LP esp
+# define R8_LP r8d
+# define R9_LP r9d
+# define R10_LP r10d
+# define R11_LP r11d
+# define R12_LP r12d
+# define R13_LP r13d
+# define R14_LP r14d
+# define R15_LP r15d
+
+#else /* __ASSEMBLER__ */
+
+# define LP_SIZE "4"
+
+# define LP_OP(insn) #insn "l"
+
+# define ASM_ADDR ".long"
+
+# define RAX_LP "eax"
+# define RBP_LP "ebp"
+# define RBX_LP "ebx"
+# define RCX_LP "ecx"
+# define RDI_LP "edi"
+# define RDX_LP "edx"
+# define RSI_LP "esi"
+# define RSP_LP "esp"
+# define R8_LP "r8d"
+# define R9_LP "r9d"
+# define R10_LP "r10d"
+# define R11_LP "r11d"
+# define R12_LP "r12d"
+# define R13_LP "r13d"
+# define R14_LP "r14d"
+# define R15_LP "r15d"
+
+#endif /* __ASSEMBLER__ */
diff --git a/libc/sysvipc/sys/msg.h b/libc/sysvipc/sys/msg.h
index 4c8d62cbf..0dd98991a 100644
--- a/libc/sysvipc/sys/msg.h
+++ b/libc/sysvipc/sys/msg.h
@@ -51,7 +51,7 @@ typedef __ssize_t ssize_t;
/* Template for struct to be used as argument for `msgsnd' and `msgrcv'. */
struct msgbuf
{
- long int mtype; /* type of received/sent message */
+ __syscall_slong_t mtype; /* type of received/sent message */
char mtext[1]; /* text of the message */
};
#endif
diff --git a/libc/time/ctime.c b/libc/time/ctime.c
index 28321af32..ca2d3ea2f 100644
--- a/libc/time/ctime.c
+++ b/libc/time/ctime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -15,12 +15,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#undef __OPTIMIZE__ /* Avoid inline `ctime' function. */
#include <time.h>
-#undef ctime
-
-
/* Return a string as returned by asctime which
is the representation of *T in that form. */
char *
diff --git a/libc/time/gettimeofday.c b/libc/time/gettimeofday.c
index cfe6549db..7eb770c2d 100644
--- a/libc/time/gettimeofday.c
+++ b/libc/time/gettimeofday.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,8 +18,6 @@
#include <errno.h>
#include <sys/time.h>
-#undef __gettimeofday
-
/* Get the current time of day and timezone information,
putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled.
Returns 0 on success, -1 on errors. */
@@ -31,8 +29,9 @@ __gettimeofday (tv, tz)
__set_errno (ENOSYS);
return -1;
}
-stub_warning (gettimeofday)
-
-INTDEF(__gettimeofday)
+libc_hidden_def (__gettimeofday)
weak_alias (__gettimeofday, gettimeofday)
+libc_hidden_weak (gettimeofday)
+
+stub_warning (gettimeofday)
#include <stub-tag.h>
diff --git a/libc/time/mktime.c b/libc/time/mktime.c
index 683d46823..e1fbf9ea1 100644
--- a/libc/time/mktime.c
+++ b/libc/time/mktime.c
@@ -1,5 +1,5 @@
-/* Convert a `struct tm' to a time_t value.
- Copyright (C) 1993-1999, 2002-2007, 2008 Free Software Foundation, Inc.
+/* Convert a 'struct tm' to a time_t value.
+ Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Eggert <eggert@twinsun.com>.
@@ -21,18 +21,17 @@
mktime. */
/* #define DEBUG 1 */
-#ifdef HAVE_CONFIG_H
+#ifndef _LIBC
# include <config.h>
#endif
/* Assume that leap seconds are possible, unless told otherwise.
- If the host has a `zic' command with a `-L leapsecondfilename' option,
+ If the host has a 'zic' command with a '-L leapsecondfilename' option,
then it supports leap seconds; otherwise it probably doesn't. */
#ifndef LEAP_SECONDS_POSSIBLE
# define LEAP_SECONDS_POSSIBLE 1
#endif
-#include <sys/types.h> /* Some systems define `time_t' here. */
#include <time.h>
#include <limits.h>
@@ -43,9 +42,43 @@
# include <stdio.h>
# include <stdlib.h>
/* Make it work even if the system's libc has its own mktime routine. */
+# undef mktime
# define mktime my_mktime
#endif /* DEBUG */
+/* Some of the code in this file assumes that signed integer overflow
+ silently wraps around. This assumption can't easily be programmed
+ around, nor can it be checked for portably at compile-time or
+ easily eliminated at run-time.
+
+ Define WRAPV to 1 if the assumption is valid and if
+ #pragma GCC optimize ("wrapv")
+ does not trigger GCC bug 51793
+ <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51793>.
+ Otherwise, define it to 0; this forces the use of slower code that,
+ while not guaranteed by the C Standard, works on all production
+ platforms that we know about. */
+#ifndef WRAPV
+# if (((__GNUC__ == 4 && 4 <= __GNUC_MINOR__) || 4 < __GNUC__) \
+ && defined __GLIBC__)
+# pragma GCC optimize ("wrapv")
+# define WRAPV 1
+# else
+# define WRAPV 0
+# endif
+#endif
+
+/* Verify a requirement at compile-time (unlike assert, which is runtime). */
+#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
+
+/* A signed type that is at least one bit wider than int. */
+#if INT_MAX <= LONG_MAX / 2
+typedef long int long_int;
+#else
+typedef long long int long_int;
+#endif
+verify (long_int_is_wide_enough, INT_MAX == INT_MAX * (long_int) 2 / 2);
+
/* Shift A right by B bits portably, by dividing A by 2**B and
truncating towards minus infinity. A and B should be free of side
effects, and B should be in the range 0 <= B <= INT_BITS - 2, where
@@ -56,9 +89,11 @@
implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift
right in the usual way when A < 0, so SHR falls back on division if
ordinary A >> B doesn't seem to be the usual signed shift. */
-#define SHR(a, b) \
- (-1 >> 1 == -1 \
- ? (a) >> (b) \
+#define SHR(a, b) \
+ ((-1 >> 1 == -1 \
+ && (long_int) -1 >> 1 == -1 \
+ && ((time_t) -1 >> 1 == -1 || ! TYPE_SIGNED (time_t))) \
+ ? (a) >> (b) \
: (a) / (1 << (b)) - ((a) % (1 << (b)) < 0))
/* The extra casts in the following macros work around compiler bugs,
@@ -69,12 +104,8 @@
#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
/* True if negative values of the signed integer type T use two's
- complement, ones' complement, or signed magnitude representation,
- respectively. Much GNU code assumes two's complement, but some
- people like to be portable to all possible C hosts. */
+ complement, or if T is an unsigned integer type. */
#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
-#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
-#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
/* True if the arithmetic type T is signed. */
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
@@ -86,13 +117,11 @@
#define TYPE_MINIMUM(t) \
((t) (! TYPE_SIGNED (t) \
? (t) 0 \
- : TYPE_SIGNED_MAGNITUDE (t) \
- ? ~ (t) 0 \
- : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+ : ~ TYPE_MAXIMUM (t)))
#define TYPE_MAXIMUM(t) \
((t) (! TYPE_SIGNED (t) \
? (t) -1 \
- : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
#ifndef TIME_T_MIN
# define TIME_T_MIN TYPE_MINIMUM (time_t)
@@ -102,14 +131,11 @@
#endif
#define TIME_T_MIDPOINT (SHR (TIME_T_MIN + TIME_T_MAX, 1) + 1)
-/* Verify a requirement at compile-time (unlike assert, which is runtime). */
-#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
-
verify (time_t_is_integer, TYPE_IS_INTEGER (time_t));
-verify (twos_complement_arithmetic, TYPE_TWOS_COMPLEMENT (int));
-/* The code also assumes that signed integer overflow silently wraps
- around, but this assumption can't be stated without causing a
- diagnostic on some hosts. */
+verify (twos_complement_arithmetic,
+ (TYPE_TWOS_COMPLEMENT (int)
+ && TYPE_TWOS_COMPLEMENT (long_int)
+ && TYPE_TWOS_COMPLEMENT (time_t)));
#define EPOCH_YEAR 1970
#define TM_YEAR_BASE 1900
@@ -117,7 +143,7 @@ verify (base_year_is_a_multiple_of_100, TM_YEAR_BASE % 100 == 0);
/* Return 1 if YEAR + TM_YEAR_BASE is a leap year. */
static inline int
-leapyear (long int year)
+leapyear (long_int year)
{
/* Don't add YEAR to TM_YEAR_BASE, as that might overflow.
Also, work even if YEAR is negative. */
@@ -141,16 +167,24 @@ const unsigned short int __mon_yday[2][13] =
#ifndef _LIBC
-/* Portable standalone applications should supply a "time_r.h" that
+/* Portable standalone applications should supply a <time.h> that
declares a POSIX-compliant localtime_r, for the benefit of older
implementations that lack localtime_r or have a nonstandard one.
See the gnulib time_r module for one way to implement this. */
-# include "time_r.h"
# undef __localtime_r
# define __localtime_r localtime_r
# define __mktime_internal mktime_internal
+# include "mktime-internal.h"
#endif
+/* Return 1 if the values A and B differ according to the rules for
+ tm_isdst: A and B differ if one is zero and the other positive. */
+static int
+isdst_differ (int a, int b)
+{
+ return (!a != !b) && (0 <= a) && (0 <= b);
+}
+
/* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) -
(YEAR0-YDAY0 HOUR0:MIN0:SEC0) in seconds, assuming that the clocks
were not adjusted between the time stamps.
@@ -163,12 +197,10 @@ const unsigned short int __mon_yday[2][13] =
detect overflow. */
static inline time_t
-ydhms_diff (long int year1, long int yday1, int hour1, int min1, int sec1,
+ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1,
int year0, int yday0, int hour0, int min0, int sec0)
{
verify (C99_integer_division, -1 / 2 == 0);
- verify (long_int_year_and_yday_are_wide_enough,
- INT_MAX <= LONG_MAX / 2 || TIME_T_MAX <= UINT_MAX);
/* Compute intervening leap days correctly even if year is negative.
Take care to avoid integer overflow here. */
@@ -191,6 +223,53 @@ ydhms_diff (long int year1, long int yday1, int hour1, int min1, int sec1,
return seconds;
}
+/* Return the average of A and B, even if A + B would overflow. */
+static time_t
+time_t_avg (time_t a, time_t b)
+{
+ return SHR (a, 1) + SHR (b, 1) + (a & b & 1);
+}
+
+/* Return 1 if A + B does not overflow. If time_t is unsigned and if
+ B's top bit is set, assume that the sum represents A - -B, and
+ return 1 if the subtraction does not wrap around. */
+static int
+time_t_add_ok (time_t a, time_t b)
+{
+ if (! TYPE_SIGNED (time_t))
+ {
+ time_t sum = a + b;
+ return (sum < a) == (TIME_T_MIDPOINT <= b);
+ }
+ else if (WRAPV)
+ {
+ time_t sum = a + b;
+ return (sum < a) == (b < 0);
+ }
+ else
+ {
+ time_t avg = time_t_avg (a, b);
+ return TIME_T_MIN / 2 <= avg && avg <= TIME_T_MAX / 2;
+ }
+}
+
+/* Return 1 if A + B does not overflow. */
+static int
+time_t_int_add_ok (time_t a, int b)
+{
+ verify (int_no_wider_than_time_t, INT_MAX <= TIME_T_MAX);
+ if (WRAPV)
+ {
+ time_t sum = a + b;
+ return (sum < a) == (b < 0);
+ }
+ else
+ {
+ int a_odd = a & 1;
+ time_t avg = SHR (a, 1) + (SHR (b, 1) + (a_odd & b));
+ return TIME_T_MIN / 2 <= avg && avg <= TIME_T_MAX / 2;
+ }
+}
/* Return a time_t value corresponding to (YEAR-YDAY HOUR:MIN:SEC),
assuming that *T corresponds to *TP and that no clock adjustments
@@ -199,7 +278,7 @@ ydhms_diff (long int year1, long int yday1, int hour1, int min1, int sec1,
If overflow occurs, yield the minimal or maximal value, except do not
yield a value equal to *T. */
static time_t
-guess_time_tm (long int year, long int yday, int hour, int min, int sec,
+guess_time_tm (long_int year, long_int yday, int hour, int min, int sec,
const time_t *t, const struct tm *tp)
{
if (tp)
@@ -207,9 +286,8 @@ guess_time_tm (long int year, long int yday, int hour, int min, int sec,
time_t d = ydhms_diff (year, yday, hour, min, sec,
tp->tm_year, tp->tm_yday,
tp->tm_hour, tp->tm_min, tp->tm_sec);
- time_t t1 = *t + d;
- if ((t1 < *t) == (TYPE_SIGNED (time_t) ? d < 0 : TIME_T_MAX / 2 < d))
- return t1;
+ if (time_t_add_ok (*t, d))
+ return *t + d;
}
/* Overflow occurred one way or another. Return the nearest result
@@ -241,9 +319,7 @@ ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
they differ by 1. */
while (bad != ok + (bad < 0 ? -1 : 1))
{
- time_t mid = *t = (bad < 0
- ? bad + ((ok - bad) >> 1)
- : ok + ((bad - ok) >> 1));
+ time_t mid = *t = time_t_avg (ok, bad);
r = convert (t, tp);
if (r)
ok = mid;
@@ -292,9 +368,7 @@ __mktime_internal (struct tm *tp,
int mday = tp->tm_mday;
int mon = tp->tm_mon;
int year_requested = tp->tm_year;
- /* Normalize the value. */
- int isdst = ((tp->tm_isdst >> (8 * sizeof (tp->tm_isdst) - 1))
- | (tp->tm_isdst != 0));
+ int isdst = tp->tm_isdst;
/* 1 if the previous probe was DST. */
int dst2;
@@ -303,8 +377,8 @@ __mktime_internal (struct tm *tp,
int mon_remainder = mon % 12;
int negative_mon_remainder = mon_remainder < 0;
int mon_years = mon / 12 - negative_mon_remainder;
- long int lyear_requested = year_requested;
- long int year = lyear_requested + mon_years;
+ long_int lyear_requested = year_requested;
+ long_int year = lyear_requested + mon_years;
/* The other values need not be in range:
the remaining code handles minor overflows correctly,
@@ -316,8 +390,8 @@ __mktime_internal (struct tm *tp,
int mon_yday = ((__mon_yday[leapyear (year)]
[mon_remainder + 12 * negative_mon_remainder])
- 1);
- long int lmday = mday;
- long int yday = mon_yday + lmday;
+ long_int lmday = mday;
+ long_int yday = mon_yday + lmday;
time_t guessed_offset = *offset;
@@ -371,7 +445,7 @@ __mktime_internal (struct tm *tp,
int approx_biennia = SHR (t0, ALOG2_SECONDS_PER_BIENNIUM);
int diff = approx_biennia - approx_requested_biennia;
- int abs_diff = diff < 0 ? - diff : diff;
+ int approx_abs_diff = diff < 0 ? -1 - diff : diff;
/* IRIX 4.0.5 cc miscalculates TIME_T_MIN / 3: it erroneously
gives a positive value of 715827882. Setting a variable
@@ -382,15 +456,15 @@ __mktime_internal (struct tm *tp,
time_t overflow_threshold =
(time_t_max / 3 - time_t_min / 3) >> ALOG2_SECONDS_PER_BIENNIUM;
- if (overflow_threshold < abs_diff)
+ if (overflow_threshold < approx_abs_diff)
{
/* Overflow occurred. Try repairing it; this might work if
the time zone offset is enough to undo the overflow. */
time_t repaired_t0 = -1 - t0;
approx_biennia = SHR (repaired_t0, ALOG2_SECONDS_PER_BIENNIUM);
diff = approx_biennia - approx_requested_biennia;
- abs_diff = diff < 0 ? - diff : diff;
- if (overflow_threshold < abs_diff)
+ approx_abs_diff = diff < 0 ? -1 - diff : diff;
+ if (overflow_threshold < approx_abs_diff)
return -1;
guessed_offset += repaired_t0 - t0;
t0 = repaired_t0;
@@ -424,7 +498,7 @@ __mktime_internal (struct tm *tp,
/* We have a match. Check whether tm.tm_isdst has the requested
value, if any. */
- if (isdst != tm.tm_isdst && 0 <= isdst && 0 <= tm.tm_isdst)
+ if (isdst_differ (isdst, tm.tm_isdst))
{
/* tm.tm_isdst has the wrong value. Look for a neighboring
time with the right value, and use its UTC offset.
@@ -457,22 +531,20 @@ __mktime_internal (struct tm *tp,
for (delta = stride; delta < delta_bound; delta += stride)
for (direction = -1; direction <= 1; direction += 2)
- {
- time_t ot = t + delta * direction;
- if ((ot < t) == (direction < 0))
- {
- struct tm otm;
- ranged_convert (convert, &ot, &otm);
- if (otm.tm_isdst == isdst)
- {
- /* We found the desired tm_isdst.
- Extrapolate back to the desired time. */
- t = guess_time_tm (year, yday, hour, min, sec, &ot, &otm);
- ranged_convert (convert, &t, &tm);
- goto offset_found;
- }
- }
- }
+ if (time_t_int_add_ok (t, delta * direction))
+ {
+ time_t ot = t + delta * direction;
+ struct tm otm;
+ ranged_convert (convert, &ot, &otm);
+ if (! isdst_differ (isdst, otm.tm_isdst))
+ {
+ /* We found the desired tm_isdst.
+ Extrapolate back to the desired time. */
+ t = guess_time_tm (year, yday, hour, min, sec, &ot, &otm);
+ ranged_convert (convert, &t, &tm);
+ goto offset_found;
+ }
+ }
}
offset_found:
@@ -483,11 +555,13 @@ __mktime_internal (struct tm *tp,
/* Adjust time to reflect the tm_sec requested, not the normalized value.
Also, repair any damage from a false match due to a leap second. */
int sec_adjustment = (sec == 0 && tm.tm_sec == 60) - sec;
+ if (! time_t_int_add_ok (t, sec_requested))
+ return -1;
t1 = t + sec_requested;
+ if (! time_t_int_add_ok (t1, sec_adjustment))
+ return -1;
t2 = t1 + sec_adjustment;
- if (((t1 < t) != (sec_requested < 0))
- | ((t2 < t1) != (sec_adjustment < 0))
- | ! convert (&t2, &tm))
+ if (! convert (&t2, &tm))
return -1;
t = t2;
}
@@ -509,7 +583,7 @@ mktime (struct tm *tp)
{
#ifdef _LIBC
/* POSIX.1 8.1.1 requires that whenever mktime() is called, the
- time zone names contained in the external variable `tzname' shall
+ time zone names contained in the external variable 'tzname' shall
be set as if the tzset() function had been called. */
__tzset ();
#endif
@@ -538,7 +612,7 @@ not_equal_tm (const struct tm *a, const struct tm *b)
| (a->tm_mon ^ b->tm_mon)
| (a->tm_year ^ b->tm_year)
| (a->tm_yday ^ b->tm_yday)
- | (a->tm_isdst ^ b->tm_isdst));
+ | isdst_differ (a->tm_isdst, b->tm_isdst));
}
static void
@@ -662,6 +736,6 @@ main (int argc, char **argv)
/*
Local Variables:
-compile-command: "gcc -DDEBUG -Wall -W -O -g mktime.c -o mktime"
+compile-command: "gcc -DDEBUG -I. -Wall -W -O2 -g mktime.c -o mktime"
End:
*/
diff --git a/libc/time/time.h b/libc/time/time.h
index 776dc401a..17e580e59 100644
--- a/libc/time/time.h
+++ b/libc/time/time.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2003,2006,2009,2011,2012 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -120,7 +120,7 @@ typedef __timer_t timer_t;
struct timespec
{
__time_t tv_sec; /* Seconds. */
- __snseconds_t tv_nsec; /* Nanoseconds. */
+ __syscall_slong_t tv_nsec; /* Nanoseconds. */
};
#endif /* timespec not defined and <time.h> or need timespec. */
diff --git a/libc/wcsmbs/Makefile b/libc/wcsmbs/Makefile
index 1d8dd3831..660469f1c 100644
--- a/libc/wcsmbs/Makefile
+++ b/libc/wcsmbs/Makefile
@@ -54,7 +54,7 @@ tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+= tst-btowc tst-mbrtowc tst-mbrtowc2 tst-wcrtomb tst-c16c32-1
tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
+= tst-wcstof wcsmbs-tst1 tst-wcsnlen \
- tst-wcpncpy tst-mbsrtowcs tst-mbsnrtowcs \
+ tst-wcpncpy tst-mbsrtowcs \
wcsatcliff $(addprefix test-,$(strop-tests))
include ../Rules
diff --git a/libc/wcsmbs/tst-mbsnrtowcs.c b/libc/wcsmbs/tst-mbsnrtowcs.c
deleted file mode 100644
index 29ff7c26a..000000000
--- a/libc/wcsmbs/tst-mbsnrtowcs.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Copyright (C) 2012 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>,
- 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* Test bugzilla 13691 */
-
-#include <stdio.h>
-#include <string.h>
-#include <wchar.h>
-#include <locale.h>
-
-static int
-do_test (void)
-{
- const char * in = "A";
- const char *inbuf = in;
- size_t inlen = strchr (in, '\0') - inbuf;
-
- wchar_t out[5];
- mbstate_t ps;
-
- const char *locale = "vi_VN.TCVN5712-1";
- if (!setlocale (LC_ALL, locale))
- {
- printf ("Locale not available.\n");
- return 1;
- }
-
- memset (&ps, '\0', sizeof (ps));
- memset (out, '\0', sizeof (out));
-
- /* If the bug isn't fixed, it isn't going to return from mbsnrtowcs due to
- an assert(). */
- size_t n = mbsnrtowcs (out, &inbuf, inlen, sizeof(out) - 1, &ps);
-
- int result = 0;
-
- if (n != 1)
- {
- printf ("n = %zu, expected 1\n", n);
- result = 1;
- }
-
- int i;
- printf ("in = ");
- for (i = 0; i < inlen; i++)
- {
- printf ("0x%X ", in[i]);
- }
- printf ("\n");
-
- char * outb = (char *) out;
- printf ("out =");
- for (i = 0; i < sizeof (out); i++)
- {
- if (i % 4 == 0)
- {
- printf (" 0x");
- }
- printf ("%X", outb[i]);
- }
- printf ("\n");
-
- return result;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"