summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2013-03-03 17:10:55 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2013-03-03 17:10:55 +0000
commitd15f124ff59606604c0243ee19cd67bc99ecd09f (patch)
treef0b18e431b15b797d5f5dc980928cd1a26b8f74a
parentc1078e9067234e88d5c1ca8af18ae67b64141d66 (diff)
Merge changes between r22241 and r22552 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@22553 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r--libc/ChangeLog1999
-rw-r--r--libc/Makeconfig68
-rw-r--r--libc/Makerules31
-rw-r--r--libc/NEWS15
-rw-r--r--libc/Rules18
-rw-r--r--libc/Versions.def1
-rw-r--r--libc/bits/stdlib-bsearch.h43
-rw-r--r--libc/bits/wchar.h31
-rw-r--r--libc/catgets/gencat.c8
-rw-r--r--libc/config.h.in2
-rw-r--r--libc/config.make.in1
-rwxr-xr-xlibc/configure268
-rw-r--r--libc/configure.in22
-rw-r--r--libc/crypt/Makefile3
-rw-r--r--libc/csu/Makefile9
-rw-r--r--libc/csu/gmon-start.c17
-rw-r--r--libc/csu/libc-start.c32
-rw-r--r--libc/csu/libc-tls.c4
-rw-r--r--libc/debug/backtrace.c9
-rw-r--r--libc/debug/segfault.c2
-rw-r--r--libc/debug/tst-backtrace.h48
-rw-r--r--libc/debug/tst-backtrace2.c20
-rw-r--r--libc/debug/tst-backtrace3.c18
-rw-r--r--libc/debug/tst-backtrace4.c20
-rw-r--r--libc/debug/tst-backtrace5.c24
-rw-r--r--libc/elf/Makefile3
-rw-r--r--libc/elf/Versions23
-rw-r--r--libc/elf/cache.c4
-rw-r--r--libc/elf/dl-addr.c18
-rw-r--r--libc/elf/dl-cache.c5
-rw-r--r--libc/elf/dl-deps.c4
-rw-r--r--libc/elf/dl-hwcaps.c9
-rw-r--r--libc/elf/dl-open.c43
-rw-r--r--libc/elf/dl-runtime.c6
-rw-r--r--libc/elf/dl-support.c4
-rw-r--r--libc/elf/dl-sym.c14
-rw-r--r--libc/elf/dl-sysdep.c2
-rw-r--r--libc/elf/elf.h137
-rw-r--r--libc/elf/link.h3
-rw-r--r--libc/elf/pldd.c5
-rw-r--r--libc/elf/rtld.c4
-rw-r--r--libc/elf/setup-vdso.h2
-rw-r--r--libc/elf/tlsdeschtab.h4
-rw-r--r--libc/elf/tst-stackguard1.c1
-rw-r--r--libc/hesiod/Depend2
-rw-r--r--libc/iconv/Versions4
-rw-r--r--libc/iconv/iconv_charmap.c5
-rw-r--r--libc/iconv/iconvconfig.c7
-rw-r--r--libc/iconv/strtab.c3
-rw-r--r--libc/include/errno.h4
-rw-r--r--libc/include/libc-symbols.h3
-rw-r--r--libc/include/link.h6
-rw-r--r--libc/include/netdb.h22
-rw-r--r--libc/include/programs/xmalloc.h33
-rw-r--r--libc/include/rounding-mode.h2
-rw-r--r--libc/include/set-hooks.h2
-rw-r--r--libc/include/stdlib.h5
-rw-r--r--libc/include/sys/cdefs.h2
-rw-r--r--libc/intl/Makefile3
-rw-r--r--libc/io/lseek.c7
-rw-r--r--libc/libio/wfileops.c2
-rw-r--r--libc/locale/elem-hash.h2
-rw-r--r--libc/locale/programs/locale.c5
-rw-r--r--libc/locale/programs/localedef.h8
-rw-r--r--libc/locale/programs/locarchive.c2
-rw-r--r--libc/locale/programs/simple-hash.c5
-rw-r--r--libc/locale/setlocale.c2
-rw-r--r--libc/localedata/CHECKSUMS424
-rw-r--r--libc/localedata/ChangeLog4
-rw-r--r--libc/malloc/memusagestat.c97
-rw-r--r--libc/manual/arith.texi14
-rw-r--r--libc/manual/conf.texi4
-rw-r--r--libc/manual/errno.texi2
-rw-r--r--libc/manual/examples/mkfsock.c5
-rw-r--r--libc/manual/filesys.texi22
-rw-r--r--libc/manual/getopt.texi2
-rw-r--r--libc/manual/libc-texinfo.sh2
-rw-r--r--libc/manual/llio.texi30
-rw-r--r--libc/manual/math.texi8
-rw-r--r--libc/manual/message.texi3
-rw-r--r--libc/manual/nss.texi2
-rw-r--r--libc/manual/resource.texi14
-rw-r--r--libc/manual/search.texi2
-rw-r--r--libc/manual/signal.texi4
-rw-r--r--libc/manual/socket.texi24
-rw-r--r--libc/manual/startup.texi2
-rw-r--r--libc/manual/stdio.texi4
-rw-r--r--libc/manual/string.texi14
-rw-r--r--libc/manual/sysinfo.texi8
-rw-r--r--libc/manual/syslog.texi4
-rw-r--r--libc/manual/terminal.texi8
-rw-r--r--libc/manual/time.texi4
-rw-r--r--libc/manual/users.texi6
-rw-r--r--libc/math/Makefile3
-rw-r--r--libc/math/atest-exp.c4
-rw-r--r--libc/math/atest-exp2.c4
-rw-r--r--libc/math/atest-sincos.c33
-rw-r--r--libc/math/fegetenv.c5
-rw-r--r--libc/math/k_casinh.c20
-rw-r--r--libc/math/k_casinhf.c20
-rw-r--r--libc/math/k_casinhl.c20
-rw-r--r--libc/math/libm-test.inc87
-rw-r--r--libc/misc/Makefile4
-rw-r--r--libc/misc/sys/cdefs.h25
-rw-r--r--libc/misc/sys/mman.h2
-rw-r--r--libc/misc/tst-pselect.c1
-rw-r--r--libc/nis/nss-nisplus.h3
-rw-r--r--libc/nptl/ChangeLog75
-rw-r--r--libc/nptl/Makeconfig1
-rw-r--r--libc/nptl/pthreadP.h12
-rw-r--r--libc/nptl/pthread_cond_broadcast.c45
-rw-r--r--libc/nptl/pthread_cond_signal.c33
-rw-r--r--libc/nptl/pthread_cond_timedwait.c59
-rw-r--r--libc/nptl/pthread_cond_wait.c57
-rw-r--r--libc/nptl/pthread_create.c3
-rw-r--r--libc/nptl/sysdeps/pthread/bits/libc-lockP.h45
-rw-r--r--libc/nptl/sysdeps/pthread/tst-timer.c1
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/fork.c2
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h30
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h28
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h30
-rw-r--r--libc/nptl/tst-barrier4.c1
-rw-r--r--libc/nptl/tst-cancel14.c1
-rw-r--r--libc/nptl/tst-cancel15.c1
-rw-r--r--libc/nptl/tst-mutex9.c3
-rw-r--r--libc/nptl/tst-oddstacklimit.c1
-rw-r--r--libc/nptl/tst-robust7.c1
-rw-r--r--libc/nptl/tst-stackguard1.c1
-rw-r--r--libc/nscd/connections.c150
-rw-r--r--libc/nscd/nscd-client.h5
-rw-r--r--libc/nscd/nscd.h7
-rw-r--r--libc/nss/getent.c10
-rw-r--r--libc/nss/makedb.c5
-rw-r--r--libc/po/de.po4
-rw-r--r--libc/ports/ChangeLog.aarch6431
-rw-r--r--libc/ports/ChangeLog.alpha54
-rw-r--r--libc/ports/ChangeLog.am3320
-rw-r--r--libc/ports/ChangeLog.arm112
-rw-r--r--libc/ports/ChangeLog.hppa7
-rw-r--r--libc/ports/ChangeLog.ia6431
-rw-r--r--libc/ports/ChangeLog.m68k35
-rw-r--r--libc/ports/ChangeLog.mips315
-rw-r--r--libc/ports/ChangeLog.powerpc51
-rw-r--r--libc/ports/ChangeLog.tile16
-rw-r--r--libc/ports/sysdeps/aarch64/libm-test-ulps364
-rw-r--r--libc/ports/sysdeps/aarch64/strncmp.S204
-rw-r--r--libc/ports/sysdeps/aarch64/strnlen.S161
-rw-r--r--libc/ports/sysdeps/aarch64/sysdep.h16
-rw-r--r--libc/ports/sysdeps/alpha/memchr.c3
-rw-r--r--libc/ports/sysdeps/am33/dl-machine.h8
-rw-r--r--libc/ports/sysdeps/am33/elf/start.S8
-rw-r--r--libc/ports/sysdeps/arm/__longjmp.S6
-rw-r--r--libc/ports/sysdeps/arm/arm-mcount.S9
-rw-r--r--libc/ports/sysdeps/arm/crti.S2
-rw-r--r--libc/ports/sysdeps/arm/crtn.S2
-rw-r--r--libc/ports/sysdeps/arm/dl-tlsdesc.S3
-rw-r--r--libc/ports/sysdeps/arm/dl-trampoline.S6
-rw-r--r--libc/ports/sysdeps/arm/frame.h6
-rw-r--r--libc/ports/sysdeps/arm/memcpy.S2
-rw-r--r--libc/ports/sysdeps/arm/memmove.S2
-rw-r--r--libc/ports/sysdeps/arm/memset.S2
-rw-r--r--libc/ports/sysdeps/arm/preconfigure7
-rw-r--r--libc/ports/sysdeps/arm/setjmp.S6
-rw-r--r--libc/ports/sysdeps/arm/strlen.S2
-rw-r--r--libc/ports/sysdeps/arm/sysdep.h63
-rw-r--r--libc/ports/sysdeps/ia64/memchr.S3
-rw-r--r--libc/ports/sysdeps/m68k/Makefile6
-rw-r--r--libc/ports/sysdeps/m68k/backtrace.c159
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps24
-rw-r--r--libc/ports/sysdeps/m68k/memchr.S3
-rw-r--r--libc/ports/sysdeps/mips/__longjmp.c6
-rw-r--r--libc/ports/sysdeps/mips/abort-instr.h6
-rw-r--r--libc/ports/sysdeps/mips/add_n.S2
-rw-r--r--libc/ports/sysdeps/mips/bits/atomic.h45
-rw-r--r--libc/ports/sysdeps/mips/bits/nan.h22
-rw-r--r--libc/ports/sysdeps/mips/bsd-_setjmp.S4
-rw-r--r--libc/ports/sysdeps/mips/bsd-setjmp.S4
-rw-r--r--libc/ports/sysdeps/mips/dl-machine.h102
-rw-r--r--libc/ports/sysdeps/mips/dl-trampoline.c130
-rw-r--r--libc/ports/sysdeps/mips/fpu/e_sqrt.c2
-rw-r--r--libc/ports/sysdeps/mips/fpu/e_sqrtf.c2
-rw-r--r--libc/ports/sysdeps/mips/fpu_control.h11
-rw-r--r--libc/ports/sysdeps/mips/include/sys/asm.h53
-rw-r--r--libc/ports/sysdeps/mips/machine-gmon.h14
-rw-r--r--libc/ports/sysdeps/mips/memset.S1
-rw-r--r--libc/ports/sysdeps/mips/mips32/crti.S2
-rw-r--r--libc/ports/sysdeps/mips/mips32/crtn.S2
-rw-r--r--libc/ports/sysdeps/mips/mips32/fpu/Versions5
-rw-r--r--libc/ports/sysdeps/mips/mips32/fpu/fpu_control.c (renamed from libc/ports/sysdeps/mips/memmove.c)25
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/add_n.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/addmul_1.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/fpu/Makefile5
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/lshift.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/mul_1.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/rshift.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/sub_n.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/submul_1.c1
-rw-r--r--libc/ports/sysdeps/mips/mips64/add_n.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/addmul_1.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/bsd-_setjmp.S6
-rw-r--r--libc/ports/sysdeps/mips/mips64/bsd-setjmp.S6
-rw-r--r--libc/ports/sysdeps/mips/mips64/lshift.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/mul_1.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/n32/crti.S2
-rw-r--r--libc/ports/sysdeps/mips/mips64/n32/crtn.S2
-rw-r--r--libc/ports/sysdeps/mips/mips64/n64/crti.S2
-rw-r--r--libc/ports/sysdeps/mips/mips64/n64/crtn.S2
-rw-r--r--libc/ports/sysdeps/mips/mips64/rshift.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/setjmp.S6
-rw-r--r--libc/ports/sysdeps/mips/mips64/sub_n.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/submul_1.S8
-rw-r--r--libc/ports/sysdeps/mips/nptl/tls.h5
-rw-r--r--libc/ports/sysdeps/mips/preconfigure7
-rw-r--r--libc/ports/sysdeps/mips/setjmp.S4
-rw-r--r--libc/ports/sysdeps/mips/setjmp_aux.c2
-rw-r--r--libc/ports/sysdeps/mips/start.S80
-rw-r--r--libc/ports/sysdeps/mips/sys/asm.h13
-rw-r--r--libc/ports/sysdeps/mips/sys/tas.h5
-rw-r--r--libc/ports/sysdeps/mips/tls-macros.h63
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/fegetenv.c5
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/fesetenv.c5
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/feupdateenv.c5
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c5
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c5
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c5
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/memcmp.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/memcpy.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/memset.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/strcmp.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/strcpy.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/strlen.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/strncmp.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/476/memset.S6
-rw-r--r--libc/ports/sysdeps/unix/alpha/sysdep.h3
-rw-r--r--libc/ports/sysdeps/unix/arm/sysdep.S9
-rw-r--r--libc/ports/sysdeps/unix/mips/mips32/sysdep.h6
-rw-r--r--libc/ports/sysdeps/unix/mips/mips64/n32/sysdep.h8
-rw-r--r--libc/ports/sysdeps/unix/mips/mips64/n64/sysdep.h8
-rw-r--r--libc/ports/sysdeps/unix/mips/sysdep.S2
-rw-r--r--libc/ports/sysdeps/unix/mips/sysdep.h12
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h25
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/semctl.c6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/am33/brk.c2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/am33/clone.S7
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/Makefile2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/clone.S4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h9
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/mmap.S1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/mmap64.S6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h28
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h314
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c9
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c9
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/pread.c5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/pread64.c5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/pwrite.c5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/sigaction.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/syscall.S1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h183
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/truncate64.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/vfork.S1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c12
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/umount.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h20
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/brk.c13
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/clone.S20
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/getcontext.S12
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/makecontext.S7
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile13
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h89
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c30
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c32
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c32
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c32
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c32
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c33
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c33
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c33
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist21
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h204
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c7
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h266
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h266
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S8
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h30
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/pread.c10
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/pread64.c10
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/pwrite.c10
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c10
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/setcontext.S9
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/sigaction.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S7
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/ustat.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/vfork.S13
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h28
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist3
-rw-r--r--libc/posix/Makefile4
-rw-r--r--libc/posix/Versions4
-rw-r--r--libc/posix/bug-regex34.c46
-rw-r--r--libc/posix/bug-regex35.c52
-rw-r--r--libc/posix/regcomp.c72
-rw-r--r--libc/posix/regex_internal.h27
-rw-r--r--libc/posix/regexec.c16
-rw-r--r--libc/posix/wordexp.c14
-rw-r--r--libc/resolv/Versions2
-rw-r--r--libc/resolv/res_send.c4
-rw-r--r--libc/rt/Makefile3
-rwxr-xr-xlibc/scripts/config.guess31
-rwxr-xr-xlibc/scripts/config.sub72
-rw-r--r--libc/stdio-common/vfprintf.c4
-rw-r--r--libc/stdlib/Makefile15
-rw-r--r--libc/stdlib/Versions4
-rw-r--r--libc/stdlib/bsearch.c31
-rw-r--r--libc/stdlib/cxa_thread_atexit_impl.c102
-rw-r--r--libc/stdlib/exit.c3
-rw-r--r--libc/stdlib/getenv.c4
-rw-r--r--libc/stdlib/stdlib.h6
-rw-r--r--libc/stdlib/strtod_l.c44
-rw-r--r--libc/stdlib/tst-tls-atexit-lib.c (renamed from libc/sysdeps/unix/sysv/linux/x86/bits/wchar.h)30
-rw-r--r--libc/stdlib/tst-tls-atexit.c111
-rw-r--r--libc/string/Makefile6
-rw-r--r--libc/string/Versions4
-rw-r--r--libc/string/bits/string2.h2
-rw-r--r--libc/string/memchr.c7
-rw-r--r--libc/string/memcmp.c3
-rw-r--r--libc/string/mempcpy.c38
-rw-r--r--libc/string/str-two-way.h12
-rw-r--r--libc/string/strcpy.c10
-rw-r--r--libc/sysdeps/generic/bp-checks.h128
-rw-r--r--libc/sysdeps/generic/bp-semctl.h66
-rw-r--r--libc/sysdeps/generic/bp-start.h71
-rw-r--r--libc/sysdeps/generic/bp-thunks.h69
-rw-r--r--libc/sysdeps/generic/frame.h4
-rw-r--r--libc/sysdeps/generic/ldconfig.h9
-rw-r--r--libc/sysdeps/generic/ldsodefs.h6
-rw-r--r--libc/sysdeps/generic/malloc-sysdep.h3
-rw-r--r--libc/sysdeps/gnu/bits/msq.h8
-rw-r--r--libc/sysdeps/i386/add_n.S23
-rw-r--r--libc/sysdeps/i386/addmul_1.S20
-rw-r--r--libc/sysdeps/i386/bp-asm.h143
-rw-r--r--libc/sysdeps/i386/bsd-_setjmp.S15
-rw-r--r--libc/sysdeps/i386/bsd-setjmp.S17
-rw-r--r--libc/sysdeps/i386/dl-machine.h6
-rw-r--r--libc/sysdeps/i386/fpu/fegetenv.c5
-rw-r--r--libc/sysdeps/i386/fpu/fesetenv.c5
-rw-r--r--libc/sysdeps/i386/fpu/feupdateenv.c5
-rw-r--r--libc/sysdeps/i386/fpu/fsetexcptflg.c5
-rw-r--r--libc/sysdeps/i386/fpu/libm-test-ulps180
-rw-r--r--libc/sysdeps/i386/fpu/s_frexp.S13
-rw-r--r--libc/sysdeps/i386/fpu/s_frexpf.S13
-rw-r--r--libc/sysdeps/i386/fpu/s_frexpl.S13
-rw-r--r--libc/sysdeps/i386/fpu/s_remquo.S13
-rw-r--r--libc/sysdeps/i386/fpu/s_remquof.S13
-rw-r--r--libc/sysdeps/i386/fpu/s_remquol.S13
-rw-r--r--libc/sysdeps/i386/i486/strcat.S22
-rw-r--r--libc/sysdeps/i386/i486/strlen.S14
-rw-r--r--libc/sysdeps/i386/i586/add_n.S23
-rw-r--r--libc/sysdeps/i386/i586/addmul_1.S20
-rw-r--r--libc/sysdeps/i386/i586/bzero.S2
-rw-r--r--libc/sysdeps/i386/i586/lshift.S21
-rw-r--r--libc/sysdeps/i386/i586/memcpy.S20
-rw-r--r--libc/sysdeps/i386/i586/mempcpy.S4
-rw-r--r--libc/sysdeps/i386/i586/memset.S20
-rw-r--r--libc/sysdeps/i386/i586/mul_1.S20
-rw-r--r--libc/sysdeps/i386/i586/rshift.S21
-rw-r--r--libc/sysdeps/i386/i586/strchr.S42
-rw-r--r--libc/sysdeps/i386/i586/strcpy.S20
-rw-r--r--libc/sysdeps/i386/i586/strlen.S14
-rw-r--r--libc/sysdeps/i386/i586/sub_n.S23
-rw-r--r--libc/sysdeps/i386/i586/submul_1.S20
-rw-r--r--libc/sysdeps/i386/i686/Makefile2
-rw-r--r--libc/sysdeps/i386/i686/add_n.S23
-rw-r--r--libc/sysdeps/i386/i686/bzero.S2
-rw-r--r--libc/sysdeps/i386/i686/memcmp.S20
-rw-r--r--libc/sysdeps/i386/i686/memcpy.S19
-rw-r--r--libc/sysdeps/i386/i686/memmove.S31
-rw-r--r--libc/sysdeps/i386/i686/mempcpy.S25
-rw-r--r--libc/sysdeps/i386/i686/memset.S20
-rw-r--r--libc/sysdeps/i386/i686/strcmp.S27
-rw-r--r--libc/sysdeps/i386/i686/strtok.S60
-rw-r--r--libc/sysdeps/i386/i686/strtok_r.S4
-rw-r--r--libc/sysdeps/i386/lshift.S21
-rw-r--r--libc/sysdeps/i386/memchr.S33
-rw-r--r--libc/sysdeps/i386/memcmp.S24
-rw-r--r--libc/sysdeps/i386/mul_1.S20
-rw-r--r--libc/sysdeps/i386/rawmemchr.S23
-rw-r--r--libc/sysdeps/i386/rshift.S21
-rw-r--r--libc/sysdeps/i386/setjmp.S15
-rw-r--r--libc/sysdeps/i386/start.S10
-rw-r--r--libc/sysdeps/i386/stpcpy.S22
-rw-r--r--libc/sysdeps/i386/stpncpy.S33
-rw-r--r--libc/sysdeps/i386/strchr.S25
-rw-r--r--libc/sysdeps/i386/strchrnul.S23
-rw-r--r--libc/sysdeps/i386/strcspn.S14
-rw-r--r--libc/sysdeps/i386/strpbrk.S24
-rw-r--r--libc/sysdeps/i386/strrchr.S23
-rw-r--r--libc/sysdeps/i386/strspn.S14
-rw-r--r--libc/sysdeps/i386/strtok.S56
-rw-r--r--libc/sysdeps/i386/strtok_r.S4
-rw-r--r--libc/sysdeps/i386/sub_n.S23
-rw-r--r--libc/sysdeps/i386/submul_1.S20
-rw-r--r--libc/sysdeps/ieee754/bits/nan.h2
-rw-r--r--libc/sysdeps/ieee754/dbl-64/mpa.c389
-rw-r--r--libc/sysdeps/ieee754/dbl-64/mpa.h1
-rw-r--r--libc/sysdeps/ieee754/dbl-64/mpatan.c107
-rw-r--r--libc/sysdeps/ieee754/dbl-64/mpatan2.c45
-rw-r--r--libc/sysdeps/ieee754/dbl-64/mpexp.c57
-rw-r--r--libc/sysdeps/ieee754/dbl-64/mplog.c44
-rw-r--r--libc/sysdeps/ieee754/dbl-64/mpsqrt.c78
-rw-r--r--libc/sysdeps/ieee754/dbl-64/mptan.c28
-rw-r--r--libc/sysdeps/ieee754/dbl-64/sincos32.c26
-rw-r--r--libc/sysdeps/ieee754/dbl-64/slowexp.c54
-rw-r--r--libc/sysdeps/ieee754/dbl-64/slowpow.c79
-rw-r--r--libc/sysdeps/ieee754/dbl-64/x2y2m1.c2
-rw-r--r--libc/sysdeps/posix/open64.c7
-rw-r--r--libc/sysdeps/posix/ulimit.c (renamed from libc/sysdeps/unix/sysv/linux/ulimit.c)1
-rw-r--r--libc/sysdeps/powerpc/bits/fenvinline.h (renamed from libc/sysdeps/powerpc/fpu/bits/fenvinline.h)0
-rw-r--r--libc/sysdeps/powerpc/bits/mathinline.h (renamed from libc/sysdeps/powerpc/fpu/bits/mathinline.h)0
-rw-r--r--libc/sysdeps/powerpc/fpu/fegetenv.c5
-rw-r--r--libc/sysdeps/powerpc/fpu/fesetenv.c5
-rw-r--r--libc/sysdeps/powerpc/fpu/feupdateenv.c5
-rw-r--r--libc/sysdeps/powerpc/fpu/fgetexcptflg.c5
-rw-r--r--libc/sysdeps/powerpc/fpu/fraiseexcpt.c5
-rw-r--r--libc/sysdeps/powerpc/fpu/fsetexcptflg.c5
-rw-r--r--libc/sysdeps/powerpc/fpu_control.h (renamed from libc/sysdeps/powerpc/fpu/fpu_control.h)0
-rw-r--r--libc/sysdeps/powerpc/powerpc32/__longjmp-common.S7
-rw-r--r--libc/sysdeps/powerpc/powerpc32/a2/memcpy.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/add_n.S12
-rw-r--r--libc/sysdeps/powerpc/powerpc32/addmul_1.S11
-rw-r--r--libc/sysdeps/powerpc/powerpc32/backtrace.c8
-rw-r--r--libc/sysdeps/powerpc/powerpc32/bp-asm.h112
-rw-r--r--libc/sysdeps/powerpc/powerpc32/bsd-_setjmp.S25
-rw-r--r--libc/sysdeps/powerpc/powerpc32/bsd-setjmp.S1
-rw-r--r--libc/sysdeps/powerpc/powerpc32/bzero.S17
-rw-r--r--libc/sysdeps/powerpc/powerpc32/cell/memcpy.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S7
-rw-r--r--libc/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S9
-rw-r--r--libc/sysdeps/powerpc/powerpc32/lshift.S11
-rw-r--r--libc/sysdeps/powerpc/powerpc32/memset.S30
-rw-r--r--libc/sysdeps/powerpc/powerpc32/mul_1.S11
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c238
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/memcmp.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/memcpy.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/memset.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/strncmp.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power6/memcpy.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power6/memset.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/memchr.S8
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/memcmp.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/memcpy.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/mempcpy.S10
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/memrchr.S8
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/memset.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/rawmemchr.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/strcasecmp.S8
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/strchr.S8
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/strchrnul.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/strlen.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/strncmp.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/strnlen.S8
-rw-r--r--libc/sysdeps/powerpc/powerpc32/rshift.S11
-rw-r--r--libc/sysdeps/powerpc/powerpc32/setjmp-common.S9
-rw-r--r--libc/sysdeps/powerpc/powerpc32/start.S5
-rw-r--r--libc/sysdeps/powerpc/powerpc32/stpcpy.S28
-rw-r--r--libc/sysdeps/powerpc/powerpc32/strchr.S27
-rw-r--r--libc/sysdeps/powerpc/powerpc32/strcmp.S16
-rw-r--r--libc/sysdeps/powerpc/powerpc32/strcpy.S27
-rw-r--r--libc/sysdeps/powerpc/powerpc32/strlen.S8
-rw-r--r--libc/sysdeps/powerpc/powerpc32/strncmp.S6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/sub_n.S13
-rw-r--r--libc/sysdeps/powerpc/powerpc32/submul_1.S11
-rw-r--r--libc/sysdeps/powerpc/powerpc64/backtrace.c8
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c238
-rw-r--r--libc/sysdeps/s390/bits/setjmp.h2
-rw-r--r--libc/sysdeps/s390/s390-32/dl-trampoline.S16
-rw-r--r--libc/sysdeps/s390/s390-64/__longjmp.c12
-rw-r--r--libc/sysdeps/s390/s390-64/dl-trampoline.S70
-rw-r--r--libc/sysdeps/s390/s390-64/setjmp.S12
-rw-r--r--libc/sysdeps/sparc/Makefile4
-rw-r--r--libc/sysdeps/sparc/backtrace.c159
-rw-r--r--libc/sysdeps/sparc/fpu/libm-test-ulps162
-rw-r--r--libc/sysdeps/sparc/sparc32/backtrace.h7
-rw-r--r--libc/sysdeps/sparc/sparc32/memchr.S3
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/Makefile2
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/backtrace.h7
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h14
-rw-r--r--libc/sysdeps/sparc/sparc64/Makefile1
-rw-r--r--libc/sysdeps/sparc/sparc64/backtrace.c57
-rw-r--r--libc/sysdeps/sparc/sparc64/backtrace.h7
-rw-r--r--libc/sysdeps/sparc/sparc64/bits/atomic.h28
-rw-r--r--libc/sysdeps/sparc/sparc64/memchr.S3
-rw-r--r--libc/sysdeps/unix/Makefile11
-rw-r--r--libc/sysdeps/unix/bsd/ulimit.c91
-rw-r--r--libc/sysdeps/unix/i386/sysdep.S2
-rw-r--r--libc/sysdeps/unix/inet/Subdirs1
-rw-r--r--libc/sysdeps/unix/make-syscalls.sh114
-rw-r--r--libc/sysdeps/unix/s-proto-bp.S4
-rw-r--r--libc/sysdeps/unix/sysv/linux/aio_sigqueue.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/dl-sysdep.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/execve.c31
-rw-r--r--libc/sysdeps/unix/sysv/linux/fips-private.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/fxstat.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/fxstat64.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/fxstatat.c15
-rw-r--r--libc/sysdeps/unix/sysv/linux/fxstatat64.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/gai_sigqueue.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/getcwd.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/getdents.c9
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/bp-thunks.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/brk.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/chown.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/clone.S18
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/fchownat.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/fxstat.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/fxstatat.c15
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/getgroups.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/getresgid.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/getresuid.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/lchown.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/lxstat.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/mmap64.S12
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/msgctl.c14
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S8
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/semctl.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/semtimedop.S8
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setgroups.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/setrlimit.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/shmctl.c10
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/sigaction.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/sysdep.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/xstat.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/kernel-features.h5
-rw-r--r--libc/sysdeps/unix/sysv/linux/llseek.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/lxstat.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/lxstat64.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/mmap64.c9
-rw-r--r--libc/sysdeps/unix/sysv/linux/msgctl.c20
-rw-r--r--libc/sysdeps/unix/sysv/linux/msgrcv.c11
-rw-r--r--libc/sysdeps/unix/sysv/linux/msgsnd.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c36
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S9
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S11
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/pread.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/pread64.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/ptrace.c75
-rw-r--r--libc/sysdeps/unix/sysv/linux/pwrite.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/pwrite64.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/readv.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/gettimeofday.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/lchown.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/semctl.c21
-rw-r--r--libc/sysdeps/unix/sysv/linux/semop.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/semtimedop.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/chown.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/pread.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/pread64.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/pwrite.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/pwrite64.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/shmat.c18
-rw-r--r--libc/sysdeps/unix/sysv/linux/shmctl.c18
-rw-r--r--libc/sysdeps/unix/sysv/linux/shmdt.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigaction.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigpending.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigprocmask.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigqueue.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigsuspend.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigtimedwait.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigwait.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/sigwaitinfo.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/msgctl.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/shmctl.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/sysctl.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/truncate64.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/ustat.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/wordsize-64/fxstat.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/wordsize-64/lxstat.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/wordsize-64/xstat.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/writev.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/clone.S8
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sigpending.c3
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist3
-rw-r--r--libc/sysdeps/unix/sysv/linux/xmknod.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/xmknodat.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/xstat.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/xstat64.c3
-rw-r--r--libc/sysdeps/unix/x86_64/sysdep.S2
-rw-r--r--libc/sysdeps/x86/bits/string.h2
-rw-r--r--libc/sysdeps/x86_64/bp-asm.h140
-rw-r--r--libc/sysdeps/x86_64/bsd-_setjmp.S8
-rw-r--r--libc/sysdeps/x86_64/bsd-setjmp.S8
-rw-r--r--libc/sysdeps/x86_64/fpu/libm-test-ulps186
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/mpa-avx.c1
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/mpa-fma4.c1
-rw-r--r--libc/sysdeps/x86_64/mempcpy.S4
-rw-r--r--libc/sysdeps/x86_64/multiarch/strcasestr-nonascii.c2
-rw-r--r--libc/sysdeps/x86_64/multiarch/strstr.c7
-rw-r--r--libc/sysdeps/x86_64/rtld-strchr.S8
-rw-r--r--libc/sysdeps/x86_64/rtld-strlen.S2
-rw-r--r--libc/sysdeps/x86_64/setjmp.S6
-rw-r--r--libc/sysdeps/x86_64/start.S9
-rw-r--r--libc/sysdeps/x86_64/strcat.S6
-rw-r--r--libc/sysdeps/x86_64/strcmp.S8
-rw-r--r--libc/sysdeps/x86_64/strcpy.S6
-rw-r--r--libc/sysdeps/x86_64/strcpy_chk.S2
-rw-r--r--libc/sysdeps/x86_64/strtok.S6
-rw-r--r--libc/sysdeps/x86_64/strtok_r.S4
-rw-r--r--libc/time/Versions8
-rw-r--r--libc/time/mktime.c2
-rw-r--r--libc/time/tzfile.c1
-rw-r--r--libc/wcsmbs/Versions8
680 files changed, 10126 insertions, 5892 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index 730538e0c..bd1fb0d7e 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,2000 @@
+2013-03-01 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/powerpc/fpu/fpu_control.h: Move to ...
+ * sysdeps/powerpc/fpu_control.h: ... here.
+ * sysdeps/powerpc/fpu/bits/fenvinline.h: Move to ...
+ * sysdeps/powerpc/bits/fenvinline.h: ... here.
+ * sysdeps/powerpc/fpu/bits/mathinline.h: Move to ...
+ * sysdeps/powerpc/bits/mathinline.h: ... here.
+
+2013-03-01 Roland McGrath <roland@hack.frob.com>
+
+ * elf/dl-hwcaps.c (_dl_important_hwcaps):
+ Change [NEED_DL_SYSINFO || NEED_DL_SYSINFO_DSO] conditionals
+ to just [NEED_DL_SYSINFO_DSO].
+ * elf/dl-support.c: Likewise.
+ * elf/dl-sysdep.c (_dl_sysdep_start): Likewise.
+ * elf/rtld.c (dl_main): Likewise.
+ * elf/setup-vdso.h (setup_vdso): Likewise.
+ * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Likewise.
+ * sysdeps/unix/sysv/linux/dl-sysdep.c
+ (_dl_discover_osversion): Likewise.
+
+2013-03-01 Carlos O'Donell <carlos@redhat.com>
+
+ * csu/libc-start.c (__pthread_initialize_minimal): Revert last change.
+ * csu/libc-tls.c (__pthread_initialize_minimal): Likewise.
+
+2013-03-01 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * NEWS: Mention libm performance improvements and non-x86 PI
+ futex support.
+
+ * csu/libc-start.c (__pthread_initialize_minimal): Change
+ function arguments.
+ * csu/libc-tls.c (__pthread_initialize_minimal): Likewise.
+
+2013-02-28 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/powerpc/powerpc32/bp-asm.h: Remove file.
+ * sysdeps/powerpc/powerpc32/__longjmp-common.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__longjmp): Don't use BP_SYM and CHECK_BOUNDS_BOTH_WIDE_LIT.
+ * sysdeps/powerpc/powerpc32/a2/memcpy.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (memcpy): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/add_n.S: Don't include <bp-sym.h> and
+ <bp-asm.h>.
+ (__mpn_add_n): Don't use BP_SYM.
+ (__mpn_add_n) [__BOUNDED_POINTERS_]: Remove conditional code.
+ * sysdeps/powerpc/powerpc32/addmul_1.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (__mpn_addmul_1): Don't use BP_SYM.
+ (__mpn_addmul_1) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/powerpc/powerpc32/bsd-_setjmp.S: Don't include
+ <bp-sym.h>.
+ (_setjmp): Don't use BP_SYM.
+ (__novmx_setjmp): Likewise.
+ (__GI__setjmp): Likewise.
+ (__vmx_setjmp): Likewise.
+ * sysdeps/powerpc/powerpc32/bsd-setjmp.S: Don't include
+ <bp-sym.h>.
+ * sysdeps/powerpc/powerpc32/bzero.S: Don't include <bp-sym.h>.
+ (__bzero): Don't use BP_SYM.
+ (__bzero) [__BOUNDED_POINTERS__]: Remove conditional code.
+ (__bzero) [!__BOUNDED_POINTERS__]: Make code unconditional.
+ * sysdeps/powerpc/powerpc32/cell/memcpy.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (memcpy): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__longjmp): Don't use BP_SYM and CHECK_BOUNDS_BOTH_WIDE_LIT.
+ * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__sigsetjmp): Don't use BP_SYM and CHECK_BOUNDS_BOTH_WIDE_LIT.
+ * sysdeps/powerpc/powerpc32/lshift.S: Don't include <bp-sym.h> and
+ <bp-asm.h>.
+ (__mpn_lshift): Don't use BP_SYM.
+ (__mpn_lshift) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/powerpc/powerpc32/memset.S: Don't include <bp-sym.h> and
+ <bp-asm.h>.
+ (memset): Don't use BP_SYM.
+ (memset) [__BOUNDED_POINTERS__]: Remove conditional code.
+ (memset) [!__BOUNDED_POINTERS__]: Make code unconditional.
+ * sysdeps/powerpc/powerpc32/mul_1.S: Don't include <bp-sym.h> and
+ <bp-asm.h>.
+ (__mpn_mul_1): Don't use BP_SYM.
+ (__mpn_mul_1) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/powerpc/powerpc32/power4/memcmp.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (memcmp): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power4/memcpy.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (memcpy): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power4/memset.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (memset): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power4/strncmp.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (strncmp): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power6/memcpy.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (memcpy): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power6/memset.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (memset): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/memchr.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__memchr): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/memcmp.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (memcmp): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/memcpy.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (memcpy): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/mempcpy.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__mempcpy): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/memrchr.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__memrchr): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/memset.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (memset): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/rawmemchr.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__rawmemchr): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/strcasecmp.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__STRCMP): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/strchr.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (strchr): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/strchrnul.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__strchrnul): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/strlen.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (strlen): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/strncmp.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (strncmp): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/power7/strnlen.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__strnlen): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/rshift.S: Don't include <bp-sym.h> and
+ <bp-asm.h>.
+ (__mpn_rshift): Don't use BP_SYM.
+ (__mpn_rshift) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/powerpc/powerpc32/setjmp-common.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__sigsetjmp): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/start.S: Don't include "bp-sym.h".
+ (L(start_addresses)): Don't use BP_SYM.
+ (_start): Likewise.
+ * sysdeps/powerpc/powerpc32/stpcpy.S: Don't include <bp-sym.h> and
+ <bp-asm.h>.
+ (__stpcpy): Don't use BP_SYM and macros from bp-asm.h.
+ (__stpcpy) [__BOUNDED_POINTERS__]: Remove conditional code.
+ (__stpcpy) [!__BOUNDED_POINTERS__]: Make code unconditional.
+ * sysdeps/powerpc/powerpc32/strchr.S: Don't include <bp-sym.h> and
+ <bp-asm.h>.
+ (strchr): Don't use BP_SYM.h and macros from bp-asm.h.
+ (strchr) [__BOUNDED_POINTERS__]: Remove conditional code.
+ (strchr) [!__BOUNDED_POINTERS__]: Make code unconditional.
+ * sysdeps/powerpc/powerpc32/strcmp.S: Don't include <bp-sym.h> and
+ <bp-asm.h>.
+ (strcmp): Don't use BP_SYM and CHECK_BOUNDS_LOW. Remove GKM FIXME
+ comments.
+ (strcmp) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/powerpc/powerpc32/strcpy.S: Don't include <bp-sym.h> and
+ <bp-asm.h>.
+ (strcpy): Don't use BP_SYM and macros from bp-asm.h. Remove GKM
+ FIXME comments.
+ (strcpy) [__BOUNDED_POINTERS__]: Remove conditional code.
+ (strcpy) [!__BOUNDED_POINTERS__]: Make code unconditional.
+ * sysdeps/powerpc/powerpc32/strlen.S: Don't include <bp-sym.h> and
+ <bp-asm.h>.
+ (strlen): Don't use BP_SYM and CHECK_BOUNDS_LOW. Remove GKM FIXME
+ comment.
+ * sysdeps/powerpc/powerpc32/strncmp.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (strncmp): Don't use BP_SYM,
+ * sysdeps/powerpc/powerpc32/sub_n.S: Don't include <bp-sym.h> and
+ <bp-asm.h>.
+ (__mpn_sub_n): Don't use BP_SYM.
+ (__mpn_sub_n) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/powerpc/powerpc32/submul_1.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (__mpn_submul_1): Don't use BP_SYM.
+ (__mpn_submul_1) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__brk): Don't use BP_SYM and DISCARD_BOUNDS.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (__clone): Don't use BP_SYM and DISCARD_BOUNDS. Remove GKM FIXME
+ comment.
+
+2013-02-28 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c (add_magnitudes):
+ Use ZK to minimize writes to Z.
+ (sub_magnitudes): Simplify code a bit.
+ * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c (add_magnitudes):
+ Use ZK to minimize writes to Z.
+ (sub_magnitudes): Simplify code a bit.
+
+2013-02-27 Roland McGrath <roland@hack.frob.com>
+
+ * csu/gmon-start.c: Add special exception to license text.
+
+2013-02-27 Richard Henderson <rth@redhat.com>
+
+ * scripts/config.guess: Update from config.git.
+ * scripts/config.sub: Likewise.
+
+2013-02-27 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/ieee754/dbl-64/mpsqrt.c: Reformat.
+
+ * sysdeps/ieee754/dbl-64/mpatan2.c: Reformat.
+
+ * sysdeps/ieee754/dbl-64/mpatan.c: Reformat.
+
+ * sysdeps/ieee754/dbl-64/mptan.c: Reformat.
+
+ * sysdeps/ieee754/dbl-64/mplog.c: Reformat.
+
+2013-02-26 Roland McGrath <roland@hack.frob.com>
+
+ * Makeconfig (%.v.i, %.v): Move these pattern rules outside of
+ [$(build-shared = yes].
+
+2013-02-26 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/ieee754/dbl-64/mpa.c: Include alloca.h.
+ (__mul): Reduce iterations for calculating mantissa.
+
+ * sysdeps/ieee754/dbl-64/sincos32.c (__c32): Use MPONE and
+ MPTWO.
+ (__mpranred): Likewise.
+
+ [BZ #15160]
+ * malloc/memusagestat.c (main): Draw graphs for heap and stack
+ only if MAXSIZE_HEAP and MAXSIZE_STACK are non-zero.
+
+2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * posix/regex_internal.h [__GNUC__ < 3 + (__GNUC_MINOR__ < 1]:
+ Define __attribute__.
+
+2013-02-26 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * locale/elem-hash.h (elem_hash): Mark as pure and possibly
+ unused.
+ * posix/regex_internal.h (__attribute): Remove.
+ [!_LIBC && __i386__]: Use __attribute__ instead of __attribute.
+ (re_string_context_at): Likewise.
+ (bitset_not): Use __attribute__ and mark function as possibly
+ unused.
+ (bitset_merge): Likewise.
+ (bitset_mask): Likewise.
+ (re_string_char_size_at): Likewise.
+ (re_string_wchar_at): Likewise.
+ (re_string_elem_size_at): Likewise.
+
+2013-02-25 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/ieee754/dbl-64/sincos32.c (ss32): Remove commented
+ code.
+ (cc32): Likewise.
+
+ * sysdeps/ieee754/dbl-64/mpa.c (mcr): Use long instead of int.
+ (__acr): Likewise.
+ (__cpy): Likewise.
+ (norm): Likewise.
+ (denorm): Likewise.
+ (__dbl_mp): Likewise.
+ (add_magnitudes): Likewise.
+ (sub_magnitudes): Likewise.
+ (__mul): Likewise.
+ (__inv): Likewise.
+
+ * sysdeps/ieee754/dbl-64/slowexp.c: Reformat in GNU coding
+ style.
+
+ * sysdeps/ieee754/dbl-64/slowpow.c: Reformat in GNU coding
+ style.
+
+ * sysdeps/ieee754/dbl-64/slowexp.c (__slowexp): Remove commented
+ code.
+
+ * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c (__mp_dbl): Sync
+ up changes with default code.
+ * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c (__mp_dbl):
+ Likewise.
+
+2013-02-24 Allan McRae <allan@archlinux.org>
+
+ * manual/socket.texi (The Internet Namespace): Order menu items
+ to match that in the file.
+
+ * manual/libc-texinfo.sh: Use @detailmenu around the detailed
+ node listing of the info page menu.
+
+2013-02-21 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/i386/bp-asm.h: Remove file.
+ * sysdeps/i386/add_n.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S1): Likewise.
+ (S2): Likewise.
+ (SIZE): Likewise.
+ (__mpn_add_n): Do not use BP_SYM
+ * sysdeps/i386/addmul_1.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S1): Likewise.
+ (SIZE): Likewise.
+ (__mpn_addmul_1): Do not use BP_SYM
+ * sysdeps/i386/bsd-_setjmp.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (SIGMSK): Likewise.
+ (_setjmp): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/bsd-setjmp.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (SIGMSK): Likewise.
+ (setjmp): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/fpu/s_frexp.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (__frexp): Do not use BP_SYM.
+ (frexp): Likewise.
+ * sysdeps/i386/fpu/s_frexpf.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (__frexpf): Do not use BP_SYM.
+ (frexpf): Likewise.
+ * sysdeps/i386/fpu/s_frexpl.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (__frexpl): Do not use BP_SYM.
+ (frexpl): Likewise.
+ * sysdeps/i386/fpu/s_remquo.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (__remquo): Do not use BP_SYM.
+ (remquo): Likewise.
+ * sysdeps/i386/fpu/s_remquof.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (__remquof): Do not use BP_SYM.
+ (remquof): Likewise.
+ * sysdeps/i386/fpu/s_remquol.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (__remquol): Do not use BP_SYM.
+ (remquol): Likewise.
+ * sysdeps/i386/i486/strcat.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (DEST): Likewise.
+ (SRC): Likewise.
+ (strcat): Remove GKM FIXME comment. Do not use BP_SYM.
+ * sysdeps/i386/i486/strlen.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (strlen): Do not use BP_SYM.
+ * sysdeps/i386/i586/add_n.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S1): Likewise.
+ (S2): Likewise.
+ (SIZE): Likewise.
+ (__mpn_add_n): Do not use BP_SYM.
+ * sysdeps/i386/i586/addmul_1.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S1): Likewise.
+ (SIZE): Likewise.
+ (__mpn_addmul_1): Do not use BP_SYM.
+ * sysdeps/i386/i586/bzero.S (__bzero): Do not use BP_SYM in
+ weak_alias.
+ (bzero): Likewise.
+ * sysdeps/i386/i586/lshift.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S): Likewise.
+ (SIZE): Likewise.
+ (__mpn_lshift): Do not use BP_SYM.
+ * sysdeps/i386/i586/memcpy.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (DEST): Likewise.
+ (SRC): Likewise.
+ (LEN): Likewise.
+ (memcpy): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/i586/mempcpy.S (__mempcpy): Do not use BP_SYM in
+ libc_hidden_def and weak_alias.
+ (mempcpy): Do not use BP_SYM in weak_alias.
+ * sysdeps/i386/i586/memset.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (DEST): Likewise.
+ (LEN): Likewise.
+ [!BZERO_P] (CHR): Likewise.
+ (memset): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/i586/mul_1.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S1): Likewise.
+ (SIZE): Likewise.
+ (__mpn_mul_1): Do not use BP_SYM.
+ * sysdeps/i386/i586/rshift.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S): Likewise.
+ (SIZE): Likewise.
+ (__mpn_rshift): Do not use BP_SYM.
+ * sysdeps/i386/i586/strchr.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (STR): Likewise.
+ (CHR): Likewise.
+ (strchr): Likewise. Do not use BP_SYM.
+ (index): Do not use BP_SYM in weak_alias.
+ * sysdeps/i386/i586/strcpy.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (DEST): Likewise.
+ (SRC): Likewise.
+ (STRCPY): Likewise. Remove GKM FIXME comment. Do not use BP_SYM.
+ * sysdeps/i386/i586/strlen.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (strlen): Do not use BP_SYM.
+ * sysdeps/i386/i586/sub_n.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S1): Likewise.
+ (S2): Likewise.
+ (SIZE): Likewise.
+ (__mpn_sub_n): Do not use BP_SYM.
+ * sysdeps/i386/i586/submul_1.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S1): Likewise.
+ (SIZE): Likewise.
+ (__mpn_submul_1): Do not use BP_SYM.
+ * sysdeps/i386/i686/add_n.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S1): Likewise.
+ (S2): Likewise.
+ (SIZE): Likewise.
+ (__mpn_add_n): Do not use BP_SYM.
+ * sysdeps/i386/i686/bzero.S (__bzero): Do not use BP_SYM in
+ weak_alias.
+ (bzero): Likewise.
+ * sysdeps/i386/i686/memcmp.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (BLK2): Likewise.
+ (LEN): Likewise.
+ (memcmp): Do not use BP_SYM.
+ (bcmp): Do not use BP_SYM in weak_alias.
+ * sysdeps/i386/i686/memcpy.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (DEST): Likewise.
+ (SRC): Likewise.
+ (LEN): Likewise.
+ (memcpy): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/i686/memmove.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (DEST): Likewise.
+ (SRC): Likewise.
+ (LEN): Likewise.
+ (memmove): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/i686/mempcpy.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (DEST): Likewise.
+ (SRC): Likewise.
+ (LEN): Likewise.
+ (__mempcpy): Likewise. Do not use BP_SYM.
+ (mempcpy): Do not use BP_SYM in weak_alias.
+ * sysdeps/i386/i686/memset.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (DEST): Likewise.
+ (LEN): Likewise.
+ [!BZERO_P] (CHR): Likewise.
+ (memset): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/i686/strcmp.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (STR2): Likewise.
+ (strcmp): Do not use BP_SYM.
+ * sysdeps/i386/i686/strtok.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (STR): Likewise.
+ (DELIM): Likewise.
+ [USE_AS_STRTOK_R] (SAVE): Likewise.
+ (FUNCTION): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/i686/strtok_r.S (__strtok_r): Do not use BP_SYM in
+ aliases.
+ (strtok_r): Likewise.
+ (__GI___strtok_r): Likewise.
+ * sysdeps/i386/lshift.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S): Likewise.
+ (SIZE): Likewise.
+ (__mpn_lshift): Do not use BP_SYM.
+ * sysdeps/i386/memchr.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (STR): Likewise.
+ (CHR): Likewise.
+ (__memchr): Do not use BP_SYM.
+ (memchr): Do not use BP_SYM in weak_alias.
+ * sysdeps/i386/memcmp.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (BLK2): Likewise.
+ (LEN): Likewise.
+ (memcmp): Do not use BP_SYM.
+ (bcmp): Do not use BP_SYM in weak_alias.
+ * sysdeps/i386/mul_1.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S1): Likewise.
+ (SIZE): Likewise.
+ (__mpn_mul_1): Do not use BP_SYM.
+ * sysdeps/i386/rawmemchr.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (STR): Likewise.
+ (CHR): Likewise.
+ (__rawmemchr): Do not use BP_SYM.
+ (rawmemchr): Do not use BP_SYM in weak_alias.
+ * sysdeps/i386/rshift.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S): Likewise.
+ (SIZE): Likewise.
+ (__mpn_rshift): Do not use BP_SYM.
+ * sysdeps/i386/setjmp.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (SIGMSK): Likewise.
+ (__sigsetjmp): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/start.S: Do not include "bp-sym.h".
+ (_start): Do not use BP_SYM.
+ * sysdeps/i386/stpcpy.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (DEST): Likewise.
+ (SRC): Likewise.
+ (__stpcpy): Likewise. Do not use BP_SYM.
+ (stpcpy): Do not use BP_SYM in weak_alias.
+ * sysdeps/i386/stpncpy.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (DEST): Likewise.
+ (SRC): Likewise.
+ (LEN): Likewise.
+ (__stpncpy): Likewise. Do not use BP_SYM.
+ (stpncpy): Do not use BP_SYM in weak_alias.
+ * sysdeps/i386/strchr.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (STR): Likewise.
+ (CHR): Likewise.
+ (strchr): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/strchrnul.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (STR): Likewise.
+ (CHR): Likewise.
+ (__strchrnul): Likewise. Do not use BP_SYM.
+ (strchrnul): Do not use BP_SYM in weak_alias.
+ * sysdeps/i386/strcspn.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (STOP): Likewise.
+ (strcspn): Do not use BP_SYM.
+ * sysdeps/i386/strpbrk.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (STR): Likewise.
+ (STOP): Likewise.
+ (strpbrk): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/strrchr.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (STR): Likewise.
+ (CHR): Likewise.
+ (strrchr): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/strspn.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (SKIP): Likewise.
+ (strspn): Do not use BP_SYM.
+ * sysdeps/i386/strtok.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (STR): Likewise.
+ (DELIM): Likewise.
+ (SAVE): Likewise.
+ (FUNCTION): Likewise. Do not use BP_SYM.
+ * sysdeps/i386/strtok_r.S (__strtok_r): Do not use BP_SYM in
+ aliases.
+ (strtok_r): Likewise.
+ (__GI___strtok_r): Likewise.
+ * sysdeps/i386/sub_n.S: Do not include "bp-sym.h" and "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S1): Likewise.
+ (S2): Likewise.
+ (SIZE): Likewise.
+ (__mpn_sub_n): Do not use BP_SYM.
+ * sysdeps/i386/submul_1.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (PARMS): Do not use macros from bp-asm.h.
+ (S1): Likewise.
+ (SIZE): Likewise.
+ (__mpn_submul_1): Do not use BP_SYM.
+ * sysdeps/unix/i386/sysdep.S: Do not include <bp-asm.h> and
+ <bp-sym.h>.
+ * sysdeps/unix/sysv/linux/i386/clone.S: Do not include <bp-sym.h>
+ and <bp-asm.h>.
+ (PARMS): Do not use macros from bp-asm.h.
+ (FLAGS): Likewise.
+ (PTID): Likewise.
+ (TLS): Likewise.
+ (CTID): Likewise.
+ (__clone): Do not use BP_SYM.
+ (clone): Do not use BP_SYM in weak_alias.
+ * sysdeps/unix/sysv/linux/i386/mmap64.S: Do not include <bp-sym.h>
+ and <bp-asm.h>.
+ (PARMS): Do not use macros from bp-asm.h.
+ (LEN): Likewise.
+ (__mmap64): Do not use BP_SYM.
+ (mmap64): Do not use BP_SYM in weak_alias.
+ * sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: Do not include
+ <bp-sym.h> and <bp-asm.h>.
+ (PARMS): Do not use macros from bp-asm.h.
+ (__posix_fadvise64_l64): Do not use BP_SYM.
+ * sysdeps/unix/sysv/linux/i386/semtimedop.S
+ (PARMS): Do not use macros from bp-asm.h.
+ (NSOPS): Likewise.
+ (semtimedop): Do not use BP_SYM.
+ * sysdeps/unix/sysv/linux/i386/sysdep.h: Do not include <bp-sym.h>
+ and <bp-asm.h>.
+
+2013-02-21 Allan McRae <allan@archlinux.org>
+
+ * manual/message.texi (Charset conversion in gettext):
+ Move @end statement to beginning of line.
+
+2013-02-21 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c (__inv): Mark as
+ static.
+ * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c (__inv):
+ Likewise.
+
+ * sysdeps/ieee754/dbl-64/mpa.c (norm): Fix whitespace.
+ (denorm): Likewise.
+ * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c (norm): Likewise.
+ * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c (norm): Likewise.
+
+2013-02-21 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * sysdeps/s390/s390-32/dl-trampoline.S (_dl_runtime_profile): Do a
+ tail-call to the resolved function if pltexit isn't needed.
+
+2013-02-21 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c (__mul): Mark X
+ or Y being zero as being unlikely.
+ * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c (__mul):
+ Likewise.
+
+2013-02-20 Carlos O'Donell <carlos@redhat.com>
+
+ * manual/nss.texi (System Databases and Name Service Switch):
+ Remove frobnicate @pxref.
+
+2013-02-20 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/ieee754/bits/nan.h [!__GNUC__] (__nan_union): Change
+ __attribute__ ((unused)) to __attribute__ ((__unused__)).
+
+2013-02-20 Petr Machata <pmachata@redhat.com>
+
+ * elf/elf.h (R_ARM_TARGET1): New macro.
+ (R_ARM_SBREL31, R_ARM_V4BX, R_ARM_TARGET2): Likewise.
+ (R_ARM_PREL31, R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS): Likewise.
+ (R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL): Likewise.
+ (R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS): Likewise.
+ (R_ARM_THM_MOVW_PREL_NC, R_ARM_THM_MOVT_PREL): Likewise.
+ (R_ARM_THM_JUMP19, R_ARM_THM_JUMP6): Likewise.
+ (R_ARM_THM_ALU_PREL_11_0, R_ARM_THM_PC12): Likewise.
+ (R_ARM_ABS32_NOI, R_ARM_REL32_NOI): Likewise.
+ (R_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G0): Likewise.
+ (R_ARM_ALU_PC_G1_NC, R_ARM_ALU_PC_G1): Likewise.
+ (R_ARM_ALU_PC_G2, R_ARM_LDR_PC_G1, R_ARM_LDR_PC_G2): Likewise.
+ (R_ARM_LDRS_PC_G0, R_ARM_LDRS_PC_G1): Likewise.
+ (R_ARM_LDRS_PC_G2, R_ARM_LDC_PC_G0): Likewise.
+ (R_ARM_LDC_PC_G1, R_ARM_LDC_PC_G2): Likewise.
+ (R_ARM_ALU_SB_G0_NC, R_ARM_ALU_SB_G0): Likewise.
+ (R_ARM_ALU_SB_G1_NC, R_ARM_ALU_SB_G1): Likewise.
+ (R_ARM_ALU_SB_G2, R_ARM_LDR_SB_G0, R_ARM_LDR_SB_G1): Likewise.
+ (R_ARM_LDR_SB_G2, R_ARM_LDRS_SB_G0): Likewise.
+ (R_ARM_LDRS_SB_G1, R_ARM_LDRS_SB_G2): Likewise.
+ (R_ARM_LDC_SB_G0, R_ARM_LDC_SB_G1, R_ARM_LDC_SB_G2): Likewise.
+ (R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL): Likewise.
+ (R_ARM_MOVW_BREL, R_ARM_THM_MOVW_BREL_NC): Likewise.
+ (R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL): Likewise.
+ (R_ARM_PLT32_ABS, R_ARM_GOT_ABS, R_ARM_GOT_PREL): Likewise.
+ (R_ARM_GOT_BREL12, R_ARM_GOTOFF12, R_ARM_GOTRELAX): Likewise.
+ (R_ARM_TLS_LDO12, R_ARM_TLS_LE12, R_ARM_TLS_IE12GP): Likewise.
+ (R_ARM_PRIVATE_0, R_ARM_PRIVATE_1, R_ARM_PRIVATE_2): Likewise.
+ (R_ARM_PRIVATE_3, R_ARM_PRIVATE_4, R_ARM_PRIVATE_5): Likewise.
+ (R_ARM_PRIVATE_6, R_ARM_PRIVATE_7, R_ARM_PRIVATE_8): Likewise.
+ (R_ARM_PRIVATE_9, R_ARM_PRIVATE_10): Likewise.
+ (R_ARM_PRIVATE_11, R_ARM_PRIVATE_12): Likewise.
+ (R_ARM_PRIVATE_13, R_ARM_PRIVATE_14): Likewise.
+ (R_ARM_PRIVATE_15, R_ARM_ME_TOO): Likewise.
+ (R_ARM_THM_TLS_DESCSEQ16, R_ARM_THM_TLS_DESCSEQ32): Likewise.
+ (R_ARM_THM_GOT_BREL12): Likewise.
+ (R_ARM_PC24, R_ARM_PLT32): Updated a comment at this macro.
+ (R_ARM_THM_PC11, R_ARM_THM_PC9): Likewise.
+ (R_ARM_THM_ABS5, R_ARM_THM_PC22): Added a comment to this macro.
+ (R_ARM_THM_PC8, R_ARM_THM_SWI8, R_ARM_XPC25): Likewise.
+ (R_ARM_THM_XPC22, R_ARM_ALU_PCREL_7_0): Likewise.
+ (R_ARM_ALU_PCREL_15_8, R_ARM_ALU_PCREL_23_15): Likewise.
+ (R_ARM_LDR_SBREL_11_0, R_ARM_ALU_SBREL_19_12): Likewise.
+ (R_ARM_ALU_SBREL_27_20, R_ARM_TLS_DESCSEQ): Likewise.
+ (R_ARM_THM_TLS_DESCSEQ): Fixed whitespace.
+
+2013-02-20 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/ieee754/bits/nan.h [!__GNUC__] (__nan_union): Change
+ __attribute_used__ to __attribute__ ((unused)).
+
+2013-02-20 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/ieee754/dbl-64/mpa.c (__sqr): Copy over comment from
+ powerpc mpa.c.
+ * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c (__mul): Fix
+ comment formatting.
+ * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c (__mul): Likewise.
+
+2013-02-19 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/i386/bp-asm.h [__BOUNDED_POINTERS__] (BOUNDS_VIOLATED):
+ Remove macro.
+ (ENTER): Remove both macro definitions.
+ (LEAVE): Likewise.
+ (CHECK_BOUNDS_LOW): Likewise.
+ (CHECK_BOUNDS_HIGH): Likewise.
+ (CHECK_BOUNDS_BOTH): Likewise.
+ (CHECK_BOUNDS_BOTH_WIDE): Likewise.
+ (RETURN_BOUNDED_POINTER): Likewise.
+ (RETURN_NULL_BOUNDED_POINTER): Likewise.
+ (PUSH_ERRNO_LOCATION_RETURN): Likewise.
+ (POP_ERRNO_LOCATION_RETURN): Likewise.
+ * sysdeps/i386/add_n.S (__mpn_add_n): Do not use removed macros.
+ (__mpn_add_n) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/addmul_1.S (__mpn_addmul_1): Do not use removed
+ macros.
+ (__mpn_addmul_1) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/bsd-_setjmp.S (_setjmp): Do not use removed macros.
+ * sysdeps/i386/bsd-setjmp.S (setjmp): Likewise.
+ * sysdeps/i386/fpu/s_frexp.S (__frexp): Likewise.
+ * sysdeps/i386/fpu/s_frexpf.S (__frexpf): Likewise.
+ * sysdeps/i386/fpu/s_frexpl.S (__frexpl): Likewise.
+ * sysdeps/i386/fpu/s_remquo.S (__remquo): Likewise.
+ * sysdeps/i386/fpu/s_remquof.S (__remquof): Likewise.
+ * sysdeps/i386/fpu/s_remquol.S (__remquol): Likewise.
+ * sysdeps/i386/i486/strcat.S (strcat): Likewise.
+ * sysdeps/i386/i486/strlen.S (strlen): Likewise.
+ * sysdeps/i386/i586/add_n.S (__mpn_add_n): Likewise.
+ (__mpn_add_n) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/i586/addmul_1.S (__mpn_addmul_1): Do not use
+ removed macros.
+ (__mpn_addmul_1) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/i586/lshift.S (__mpn_lshift): Do not use removed
+ macros.
+ (__mpn_lshift) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/i586/memcpy.S (memcpy): Do not use removed macros.
+ * sysdeps/i386/i586/memset.S (memset): Likewise.
+ * sysdeps/i386/i586/mul_1.S (__mpn_mul_1): Likewise.
+ (__mpn_mul_1) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/i586/rshift.S (__mpn_rshift): Do not use removed
+ macros.
+ (__mpn_rshift) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/i586/strchr.S (strchr): Do not use removed macros.
+ Change uses of L(2) to L(out).
+ * sysdeps/i386/i586/strcpy.S (STRCPY): Do not use removed macros.
+ * sysdeps/i386/i586/strlen.S (strlen): Likewise.
+ * sysdeps/i386/i586/sub_n.S (__mpn_sub_n): Likewise.
+ (__mpn_sub_n) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/i586/submul_1.S (__mpn_submul_1): Do not use
+ removed macros.
+ (__mpn_submul_1) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/i686/add_n.S (__mpn_add_n): Do not use removed
+ macros.
+ (__mpn_add_n) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/i686/memcmp.S (ENTRANCE): Do not use macro ENTER.
+ (RETURN): Do not use macro LEAVE.
+ * sysdeps/i386/i686/memcpy.S (memcpy): Do not use removed macros.
+ * sysdeps/i386/i686/memmove.S (memmove): Likewise.
+ * sysdeps/i386/i686/mempcpy.S (mempcpy): Likewise.
+ * sysdeps/i386/i686/memset.S (memset): Likewise.
+ * sysdeps/i386/i686/strcmp.S (strcmp): Likewise.
+ (strcmp) [!__BOUNDED_POINTERS__]: Make code unconditional.
+ (strcmp) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/i686/strtok.S (save_ptr) [__BOUNDED_POINTERS__]:
+ Likewise.
+ (save_ptr) [!__BOUNDED_POINTERS__]: Make code unconditional.
+ (FUNCTION): Do not use removed macros. Combine labels L(1_1),
+ L(1_2) and L(1_3) into L(1).
+ (FUNCTION) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/lshift.S (__mpn_lshift): Do not use removed macros.
+ (__mpn_lshift) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/memchr.S (__memchr): Do not use removed macros.
+ (__memchr) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/memcmp.S (memcmp): Do not use removed macros.
+ * sysdeps/i386/mul_1.S (__mpn_mul_1): Likewise.
+ (__mpn_mul_1) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/rawmemchr.S (__rawmemchr): Do not use removed
+ macros.
+ * sysdeps/i386/rshift.S (__mpn_rshift): Likewise.
+ (__mpn_rshift) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/setjmp.S (__sigsetjmp): Do not use removed macros.
+ * sysdeps/i386/stpcpy.S (__stpcpy): Likewise.
+ * sysdeps/i386/stpncpy.S (__stpncpy): Likewise.
+ (__stpncpy) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/strchr.S (strchr): Do not use removed macros.
+ * sysdeps/i386/strchrnul.S (__strchrnul): Likewise.
+ * sysdeps/i386/strcspn.S (strcspn): Likewise.
+ * sysdeps/i386/strpbrk.S (strpbrk): Likewise.
+ * sysdeps/i386/strrchr.S (strrchr): Likewise.
+ * sysdeps/i386/strspn.S (strspn): Likewise.
+ * sysdeps/i386/strtok.S (save_ptr) [__BOUNDED_POINTERS__]: Remove
+ conditional code.
+ (save_ptr) [!__BOUNDED_POINTERS__]: Make code unconditional.
+ (FUNCTION) [!__BOUNDED_POINTERS__]: Likewise.
+ (FUNCTION) [__BOUNDED_POINTERS__]: Remove conditional code.
+ (FUNCTION): Do not use removed macros. Combine labels L(1_2) and
+ L(1_3) into L(1_1).
+ * sysdeps/i386/sub_n.S (__mpn_sub_n): Do not use removed macros.
+ (__mpn_sub_n) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/i386/submul_1.S (__mpn_submul_1): Do not use removed
+ macros.
+ (__mpn_submul_1) [__BOUNDED_POINTERS__]: Remove conditional code.
+
+2013-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ * stdlib/strtod_l.c (__mpn_lshift_1): Rewritten as function-like
+ macro.
+
+2013-02-19 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * math/atest-exp.c (exp_mpn): Remove ROUND.
+ * math/atest-exp2.c (exp_mpn): Likewise.
+ * math/atest-sincos.c (sincosx_mpn): Remove ROUND and CHK.
+
+ * stdlib/cxa_thread_atexit_impl.c: Fix Copyright year.
+ * stdlib/tst-tls-atexit-lib.c: Likewise.
+ * stdlib/tst-tls-atexit.c: Likewise.
+
+2013-02-18 Mike Frysinger <vapier@gentoo.org>
+
+ * stdlib/stdlib.h (aligned_alloc): Use __attribute_malloc__
+ and __attribute_alloc_size__.
+
+2013-02-18 Mike Frysinger <vapier@gentoo.org>
+
+ * include/programs/xmalloc.h: Change __attribute_alloc_size to
+ __attribute_alloc_size__.
+ * include/sys/cdefs.h (__attribute_alloc_size): Macro removed.
+ * misc/sys/cdefs.h (__attribute_alloc_size__): New macro.
+
+2013-02-18 Mike Frysinger <vapier@gentoo.org>
+
+ * include/programs/xmalloc.h: New file.
+ * catgets/gencat.c: Include it.
+ (xmalloc, xcalloc, xrealloc, xstrdup): Don't declare them.
+ * elf/pldd.c: Likewise.
+ * iconv/iconv_charmap.c: Likewise.
+ * iconv/iconvconfig.c: Likewise.
+ * iconv/strtab.c: Likewise.
+ * locale/programs/locale.c: Likewise.
+ * locale/programs/localedef.h: Likewise.
+ * locale/programs/simple-hash.c: Likewise.
+ * nscd/nscd.h: Likewise.
+ * nss/makedb.c: Likewise.
+ * sysdeps/generic/ldconfig.h: Likewise.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * Versions.def: Add GLIBC_2.18.
+ * include/link.h (struct link_map): New member l_tls_dtor_count.
+ * include/stdlib.h (__cxa_thread_atexit_impl): Declare.
+ (__call_tls_dtors): Likewise.
+ * sysdeps/unix/sysv/linux/i386/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/sh/nptl/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist:
+ Likewise.
+ * stdlib/Makefile (routines): Add __cxa_thread_atexit_impl.
+ (tests): Add test case tst-tls-atexit.
+ (modules-names): Add shared library for tst-tls-atexit.
+ * stdlib/Versions (GLIBC_2.17): Add __cxa_thread_atexit_impl.
+ (GLIBC_PRIVATE): Add __call_tls_dtors.
+ * stdlib/cxa_thread_atexit_impl.c: New file with helper function
+ for libstdc++.
+ * stdlib/exit.c (__run_exit_handlers): Call __call_tls_dtors.
+ * stdlib/tst-tls-atexit.c: New test case.
+ * stdlib/tst-tls-atexit-lib.c: New test case.
+
+ * misc/tst-pselect.c: Include stdlib.h for declaration of exit.
+
+ * elf/Versions (ld): Add _dl_find_dso_for_object.
+ * elf/dl-addr.c (_dl_addr): Use _dl_find_dso_for_object.
+ * elf/dl-open.c (_dl_find_dso_for_object): New function.
+ (dl_open_worker): Use _dl_find_dso_for_object.
+ * elf/dl-sym.c (do_sym): Likewise.
+ * sysdeps/generic/ldsodefs.h: Declare _dl_find_dso_for_object.
+
+2013-02-18 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * sysdeps/s390/s390-64/dl-trampoline.S (_dl_runtime_resolve):
+ Syntactic changes only.
+ (_dl_runtime_profile): Do a tail-call to the resolved function.
+
+2013-02-17 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/x86_64/bp-asm.h: Remove file.
+ * sysdeps/unix/sysv/linux/x86_64/clone.S: Do not include
+ <bp-sym.h> and <bp-asm.h>.
+ (__clone): Do not use BP_SYM.
+ * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Do not include
+ <bp-sym.h> and <bp-asm.h>.
+ * sysdeps/unix/x86_64/sysdep.S: Likewise.
+ * sysdeps/x86_64/bsd-_setjmp.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (_setjmp): Do not use BP_SYM.
+ * sysdeps/x86_64/bsd-setjmp.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (setjmp): Do not use BP_SYM.
+ * sysdeps/x86_64/mempcpy.S (__mempcpy): Do not use BP_SYM in
+ libc_hidden_def.
+ (mempcpy): Do not use BP_SYM in weak_alias.
+ * sysdeps/x86_64/rtld-strchr.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (strchr): Do not use BP_SYM.
+ * sysdeps/x86_64/rtld-strlen.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ * sysdeps/x86_64/setjmp.S (__sigsetjmp): Do not use BP_SYM.
+ * sysdeps/x86_64/start.S: Do not include "bp-sym.h".
+ (_start): Do not use BP_SYM.
+ * sysdeps/x86_64/strcat.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (strcat): Do not use BP_SYM.
+ * sysdeps/x86_64/strcmp.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (STRCMP): Do not use BP_SYM.
+ * sysdeps/x86_64/strcpy.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (STRCPY): Do not use BP_SYM.
+ * sysdeps/x86_64/strcpy_chk.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ * sysdeps/x86_64/strtok.S: Do not include "bp-sym.h" and
+ "bp-asm.h".
+ (FUNCTION): Do not use BP_SYM.
+ * sysdeps/x86_64/strtok_r.S (strtok_r): Do not use BP_SYM in
+ weak_alias.
+ (__GI___strtok_r): Do not use BP_SYM in strong_alias.
+
+2013-02-17 Andreas Jaeger <aj@suse.de>
+
+ * time/Versions: Sort entries.
+ * string/Versions: Likewise.
+ * resolv/Versions: Likewise.
+ * posix/Versions: Likewise.
+ * iconv/Versions: Likewise.
+ * elf/Versions: Likewise.
+ * wcsmbs/Versions: Likewise.
+
+2013-02-15 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/ieee754/dbl-64/mpa.c (__sqr): Avoid using LIM in
+ loop termination condition.
+
+ * sysdeps/ieee754/dbl-64/mpa.c (__mul): Use intermediate
+ variable to calculate EZ.
+ (__sqr): Likewise.
+
+ * sysdeps/ieee754/dbl-64/mpa.c (__mul): Fix determination of
+ the lower precision input.
+
+2013-02-15 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * Makeconfig [!+link-bounded] (+link-bounded): Remove variable.
+ [!link-extra-libs] (link-extra-libs-bounded): Likewise.
+ (run-via-rtld-prefix): Do not handle %-bp tests.
+ (test-via-rtld-prefix): Do not mention %-bp tests in comment.
+ (all-object-suffixes): Remove .ob.
+ (bppfx): Remove variable.
+ [$(build-bounded) = yes] (object-suffixes): Do not add .ob.
+ [$(build-bounded) = yes] (CPPFLAGS-.ob): Remove variable.
+ [$(build-bounded) = yes] (CFLAGS-.ob): Likewise.
+ [$(build-bounded) = yes] (libtype.ob): Likewise.
+ * Makerules (elide-routines.ob): Remove variable.
+ (do-tests-clean): Do not handle *-bp.out.
+ (common-mostlyclean): Do not handle *-bp and *-bp.out.
+ * Rules [$(build-bounded) = yes] (tests-bp.out): Remove variable.
+ [$(build-bounded) = yes] (xtests-bp.out): Likewise.
+ (tests): Do not include $(tests-bp.out).
+ (xtests): Do not include $(xtests-bp.out).
+ [$(build-bounded) = yes] (binaries-bounded): Remove variable.
+ [$(build-bounded) = yes] ($(addprefix
+ $(objpfx),$(binaries-bounded))): Remove rule.
+ ($(objpfx)%-bp.out): Remove rule.
+ * config.make.in (build-bounded): Remove variable.
+ * crypt/Makefile [$(build-bounded) = yes]
+ ($(tests:%=$(objpfx)%-bp)): Remove dependency.
+ * csu/Makefile [$(build-bounded) = yes] (extra-objs): Do not
+ append to variable.
+ [$(build-bounded) = yes] (install-lib): Likewise.
+ [$(build-bounded) = yes] (generated): Likewise.
+ [!start-installed-name-rule] ($(objpfx)b$(start-installed-name)):
+ Remove rule.
+ * intl/Makefile [$(build-bounded) = yes]
+ ($(multithread-test-srcs:%=$(objpfx)%-bp)): Remove dependency.
+ * math/Makefile [$(build-bounded) = yes]
+ ($(tests:%=$(objpfx)%-bp): Likewise.
+ * misc/Makefile [$(build-bounded) = yes]
+ ($(objpfx)tst-tsearch-bp): Likewise.
+ * nptl/Makeconfig (bounded-thread-library): Remove variable.
+ * rt/Makefile [$(build-bounded) = yes] ($(tests:%=$(objpfx)%-bp)):
+ Remove dependency.
+ * string/Makefile (o-objects.ob): Remove variable.
+ * sysdeps/i386/i686/Makefile [$(config-asflags-i686) = yes]
+ (CFLAGS-.ob): Remove variable.
+ [$(config-asflags-i686) = yes] (ASFLAGS-.ob): Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/Makefile (ASFLAGS-.ob): Remove
+ both definitions of variable.
+ * sysdeps/sparc/sparc64/Makefile [$(have-as-vis3) = yes]
+ (ASFLAGS-.ob): Remove variable.
+
+2013-02-14 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * config.h.in [USE_REGPARMS && !PROF && !__BOUNDED_POINTERS__]:
+ Remove __BOUNDED_POINTERS__ from condition.
+ * elf/dl-runtime.c [!PROF && !__BOUNDED_POINTERS__]: Likewise.
+ * string/bits/string2.h [!__NO_STRING_INLINES &&
+ !__BOUNDED_POINTERS__]: Likewise.
+ * sysdeps/i386/dl-machine.h [!PROF && !__BOUNDED_POINTERS__]:
+ Likewise.
+ * sysdeps/unix/sysv/linux/shmat.c (shmat) [__BOUNDED_POINTERS__]:
+ Remove conditional code.
+ * sysdeps/x86/bits/string.h [!__NO_STRING_INLINES &&
+ __USE_STRING_INLINES && __GNUC__ && __GNUC__ >= 2 &&
+ !__BOUNDED_POINTERS__]: Remove __BOUNDED_POINTERS__ from
+ condition.
+
+ [BZ #13550]
+ * csu/libc-start.c: Do not include <bp-sym.h>.
+ [!LIBC_START_MAIN] (LIBC_START_MAIN): Do not use BP_SYM.
+ * elf/dl-open.c: Do not include <bp-sym.h>.
+ (_dl_sysdep_start): Do not use BP_SYM in weak_extern.
+ * math/fegetenv.c: Do not include <bp-sym.h>.
+ (fegetenv): Do not use BP_SYM in versioned symbols.
+ * nptl/sysdeps/pthread/bits/libc-lockP.h
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]: Do not include
+ <bp-sym.h>.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_mutex_init): Do not use BP_SYM in weak_extern.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_mutex_destroy): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_mutex_lock): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_mutex_trylock): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_mutex_unlock): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_mutexattr_init): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_mutexattr_destroy): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_mutexattr_settype): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_rwlock_init): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_rwlock_destroy): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_rwlock_rdlock): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_rwlock_tryrdlock): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_rwlock_wrlock): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_rwlock_trywrlock): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_rwlock_unlock): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_key_create): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_setspecific): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (__pthread_getspecific): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern] (__pthread_once):
+ Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (_pthread_cleanup_push_defer): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (_pthread_cleanup_pop_restore): Likewise.
+ [!__NO_WEAK_PTHREAD_ALIASES && weak_extern]
+ (pthread_setcancelstate): Likewise.
+ * string/memchr.c [HAVE_BP_SYM_H || _LIBC]: Do not include
+ <bp-sym.h>.
+ [!(HAVE_BP_SYM_H || _LIBC)] (BP_SYM): Remove macro definition.
+ (memchr): Do not use BP_SYM in weak_alias.
+ * sysdeps/i386/fpu/fegetenv.c: Do not include <bp-sym.h>.
+ (fegetenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/i386/fpu/fesetenv.c: Do not include <bp-sym.h>.
+ (fesetenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/i386/fpu/feupdateenv.c: Do not include <bp-sym.h>.
+ (feupdateenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/i386/fpu/fsetexcptflg.c: Do not include <bp-sym.h>.
+ (fesetexceptflag): Do not use BP_SYM in versioned symbols.
+ * sysdeps/posix/open64.c: Do not include <bp-sym.h>.
+ (__open64): Do not use BP_SYM in weak_alias and libc_hidden_weak.
+ (open64): Do not use BP_SYM in weak_alias.
+ * sysdeps/powerpc/fpu/fegetenv.c: Do not include <bp-sym.h>.
+ (fegetenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/fpu/fesetenv.c: Do not include <bp-sym.h>.
+ (fesetenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/fpu/feupdateenv.c: Do not include <bp-sym.h>.
+ (feupdateenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/fpu/fgetexcptflg.c: Do not include <bp-sym.h>.
+ (fegetexceptflag): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/fpu/fraiseexcpt.c: Do not include <bp-sym.h>.
+ (feraiseexcept): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/fpu/fsetexcptflg.c: Do not include <bp-sym.h>.
+ (fesetexceptflag): Do not use BP_SYM in versioned symbols.
+ * sysdeps/unix/sysv/linux/powerpc/libc-start.c: Do not include
+ <bp-sym.h>.
+ (__libc_start_main): Do not use BP_SYM.
+
+2013-02-14 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c (__cpy): Remove
+ redundant return line.
+ (norm): Likewise.
+ (denorm): Likewise.
+ (dbl_mp): Likewise.
+ (sub_magnitudes): Likewise.
+ (__add): Likewise.
+ (__sub): Likewise.
+ (__mul): Likewise.
+ (__inv): Likewise.
+ (__dvd): Likewise.
+ * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c (__cpy): Likewise.
+ (norm): Likewise.
+ (denorm): Likewise.
+ (dbl_mp): Likewise.
+ (sub_magnitudes): Likewise.
+ (__add): Likewise.
+ (__sub): Likewise.
+ (__mul): Likewise.
+ (__inv): Likewise.
+ (__dvd): Likewise.
+
+ * sysdeps/ieee754/dbl-64/mpatan.c (__mpatan): Use __sqr
+ instead of __mul.
+ * sysdeps/ieee754/dbl-64/mpsqrt.c (__mpsqrt): Likewise.
+ * sysdeps/ieee754/dbl-64/sincos32.c (ss32): Likewise.
+ (cc32): Likewise.
+
+ * sysdeps/ieee754/dbl-64/mpa.c (__sqr): New function.
+ * sysdeps/ieee754/dbl-64/mpa.h (__sqr): Declare.
+ * sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): use __sqr instead
+ of __mul for squares.
+ * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c (__sqr): New
+ function
+ * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c (__sqr):
+ Likewise.
+ * sysdeps/x86_64/fpu/multiarch/mpa-avx.c: Define __sqr.
+ * sysdeps/x86_64/fpu/multiarch/mpa-fma4.c: Likewise.
+
+2013-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * misc/sys/cdefs.h [!__BOUNDED_POINTERS__]: Remove conditional
+ code.
+ * csu/libc-start.c (LIBC_START_MAIN): Do not use __unbounded in
+ prototype or function definition. Rename ubp_* variables and
+ parameters. Remove argv definitions conditional on
+ [__BOUNDED_POINTERS__].
+ * debug/backtrace.c (__backtrace): Do not use __unbounded.
+ * elf/dl-runtime.c (_dl_fixup): Likewise.
+ * include/set-hooks.h (RUN_HOOK): Likewise.
+ * stdio-common/vfprintf.c (JUMP): Do not use __unbounded in either
+ definition.
+ * string/strcpy.c (strcpy): Do not use __unbounded.
+ * sysdeps/generic/frame.h (struct layout): Likewise.
+ * sysdeps/gnu/bits/msq.h (struct msqid_ds): Likewise.
+ * sysdeps/i386/dl-machine.h (_dl_fixup): Likewise.
+ * sysdeps/powerpc/powerpc32/backtrace.c (struct layout): Likewise.
+ * sysdeps/powerpc/powerpc64/backtrace.c (struct layout): Likewise.
+ * sysdeps/sparc/backtrace.c (struct layout): Likewise.
+ (__backtrace): Likewise.
+ * sysdeps/unix/sysv/linux/aio_sigqueue.c (__aio_sigqueue): Do not
+ use __ptrvalue.
+ * sysdeps/unix/sysv/linux/fxstat.c (__fxstat): Likewise.
+ * sysdeps/unix/sysv/linux/fxstatat.c (__fxstatat): Likewise.
+ * sysdeps/unix/sysv/linux/gai_sigqueue.c (__gai_sigqueue):
+ Likewise.
+ * sysdeps/unix/sysv/linux/i386/brk.c (__brk): Likewise.
+ * sysdeps/unix/sysv/linux/i386/fxstat.c (__fxstat): Likewise.
+ * sysdeps/unix/sysv/linux/i386/fxstatat.c (__fxstatat): Likewise.
+ * sysdeps/unix/sysv/linux/i386/lxstat.c (__lxstat): Likewise.
+ * sysdeps/unix/sysv/linux/i386/msgctl.c (struct __old_msqid_ds):
+ Do not use __unbounded.
+ * sysdeps/unix/sysv/linux/i386/setrlimit.c (__new_setrlimit):
+ Rename __unboundedrlimits parameter to rlimits in prototype.
+ * sysdeps/unix/sysv/linux/i386/shmctl.c (struct __old_shmid_ds):
+ Do not use __unbounded.
+ * sysdeps/unix/sysv/linux/i386/sigaction.c (__libc_sigaction): Do
+ not use __ptrvalue.
+ * sysdeps/unix/sysv/linux/i386/xstat.c (__xstat): Likewise.
+ * sysdeps/unix/sysv/linux/llseek.c (__llseek): Likewise.
+ * sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Likewise.
+ * sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Do not use
+ __ptrvalue or __unbounded.
+ (__mmap64) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/msgctl.c (struct __old_msqid_ds): Do not
+ use __unbounded.
+ (__new_msgctl): Do not use __ptrvalue.
+ * sysdeps/unix/sysv/linux/msgrcv.c (struct ipc_kludge): Do not use
+ __unbounded.
+ (__libc_msgrcv): Do not use __ptrvalue.
+ * sysdeps/unix/sysv/linux/powerpc/libc-start.c (struct
+ startup_info): Do not use __unbounded.
+ (__libc_start_main): Likewise. Rename ubp_* variables and
+ parameters. Remove argv definitions conditional on
+ [__BOUNDED_POINTERS__].
+ * sysdeps/unix/sysv/linux/ptrace.c (ptrace): Do not use
+ __ptrvalue.
+ * sysdeps/unix/sysv/linux/semctl.c (struct __old_semid_ds): Do not
+ use __unbounded.
+ * sysdeps/unix/sysv/linux/shmat.c (shmat): Do not use __unbounded
+ or __ptrvalue.
+ * sysdeps/unix/sysv/linux/shmctl.c (struct __old_shmid_ds): Do not
+ use __unbounded.
+ (__new_shmctl): Do not use __ptrvalue.
+ * sysdeps/unix/sysv/linux/shmdt.c (shmdt): Likewise.
+ * sysdeps/unix/sysv/linux/sigaction.c (__libc_sigaction):
+ Likewise.
+ * sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
+ (__libc_sigaction): Likewise.
+ * sysdeps/unix/sysv/linux/sysctl.c (__sysctl): Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/sigaction.c (__libc_sigaction):
+ Likewise.
+ * sysdeps/unix/sysv/linux/xstat.c (__xstat): Likewise.
+
+2013-02-13 Ondřej Bílka <neleai@seznam.cz>
+
+ * stdlib/Makefile (headers): Add bits/stdlib-bsearch.h.
+
+ * string/mempcpy.c: Implement by calling memcpy.
+
+2013-02-13 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): Remove NFA.
+
+ * sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): Faster polynomial
+ evaluation.
+
+ * sysdeps/ieee754/dbl-64/mpa.c (__mul): Don't bother with zero
+ values in the mantissa.
+
+ * sysdeps/ieee754/dbl-64/mpa.c (add_magnitudes): Use ZK to
+ minimize writes to Z.
+ (sub_magnitudes): Simplify code a bit.
+
+2013-02-12 Roland McGrath <roland@hack.frob.com>
+
+ * include/libc-symbols.h (stub_warning): Remove "warning: " prefix
+ from the message. The linker prefixes all warnings with that already.
+
+2013-02-12 Andreas Schwab <schwab@suse.de>
+
+ [BZ #15078]
+ * posix/regexec.c (extend_buffers): Add parameter min_len.
+ (check_matching): Pass minimum needed length.
+ (clean_state_log_if_needed): Likewise.
+ (get_subexp): Likewise.
+ * posix/Makefile (tests): Add bug-regex34.
+ (bug-regex34-ENV): Define.
+ * posix/bug-regex34.c: New file.
+
+ [BZ #11561]
+ * posix/regcomp.c (parse_bracket_exp): When looking up collating
+ elements compare against the byte sequence of it, not its name.
+ * posix/Makefile (tests): Add bug-regex35.
+ (bug-regex35-ENV): Define.
+ * posix/bug-regex35.c: New file.
+
+2013-02-11 Tom de Vries <tom@codesourcery.com>
+
+ * string/str-two-way.h: Fix typo RESULT_TYPE -> RETURN_TYPE in
+ comment.
+ Add RET0_IF_0 and CHECK_EOL to macro list in comment.
+ (AVAILABLE1, AVAILABLE2, AVAILABLE1_USES_J): Remove superfluous undef.
+ (CHECK_EOL): Add undef.
+
+2013-02-11 Ondřej Bílka <neleai@seznam.cz>
+
+ * bits/stdlib-bsearch.h: New file.
+ * stdlib/bsearch.c: Include bits/stdlib-bsearch.h.
+ * stdlib/stdlib.h: Likewise.
+
+2013-02-11 Roland McGrath <roland@hack.frob.com>
+
+ * manual/conf.texi (General Limits): Fix SSIZE_MAX type to ssize_t.
+ * manual/errno.texi (Error Messages): Fix typo in error_print_progname
+ declaration.
+ * manual/search.texi (Array Search Function): Add missing const in
+ lfind prototype.
+ * manual/resource.texi (Limits on Resources): Fix RLIM_INFINITY
+ declaration to use rlim_t.
+ (Basic Scheduling Functions): Remove erroneous const from
+ sched_getparam prototype. Remove erroneous * from
+ sched_get_priority_max and sched_get_priority_min prototypes.
+ (Resource Usage): Fix summary @comment on vtimes to refer to
+ sys/vtimes.h rather than vtimes.h.
+ Add missing *s in vtimes prototype.
+ (Limits on Resources): Fix ulimit prototype to return long int.
+ * manual/math.texi (SVID Random): Fix lrand48_r and mrand48_r
+ prototypes to use long int rather than double.
+ (BSD Random): Fix initstate and setstate to use char *, not void *.
+ * manual/llio.texi (Asynchronous Reads/Writes): Fix lio_listio64
+ prototype to make second argument 'struct aiocb64 *const[]'.
+ Fix aio_read64 and aio_write64 prototypes to use struct aiocb64.
+ (Status of AIO Operations): Remove erroneous const in aio_return and
+ aio_return64 prototypes.
+ (Synchronizing I/O): Fix sync prototype to return void.
+ * manual/startup.texi (Suboptions): Remove an erroneous const in
+ getsubopt prototype.
+ * manual/getopt.texi (Using Getopt): Add a const in getopt prototype.
+ * manual/users.texi (Lookup Netgroup): Fix getnetgrent_r prototype to
+ use size_t rather than int.
+ (Scanning All Users): Likewise for getpwent_r.
+ (Setting Groups): Add missing const to setgroups prototype.
+ * manual/sysinfo.texi (mtab): Fix typo in getmntent_r prototype.
+ * manual/socket.texi (Host Names): Fix gethostbyaddr and
+ gethostbyaddr_r prototypes to use socklen_t rather than size_t and
+ 'const void *' rather than 'const char *'.
+ (Host Address Functions): Likewise for inet_ntop.
+ (Networks Database): Fix getnetbyaddr prototype to use uint32_t.
+ (Receiving Data): Fix recv, recvfrom, recvmsg prototypes to use
+ ssize_t for return value.
+ (Sending Data): Likewise for send, sendto, sendmsg.
+ (Socket Option Functions): Add a missing const in setsockopt prototype.
+ * manual/stdio.texi (Simple Output): Fix fputwc_unlocked prototype to
+ use wchar_t for the argument.
+ (Formatted Input Functions): Fix swscanf prototype to use wchar_t *.
+ * manual/arith.texi (Control Functions): Fix fegetexcept prototype to
+ take no arguments.
+ (Normalization Functions): Fix scalb, scalbf, scalbl prototypes to use
+ double/float/long double for second argument.
+ Fix return types of significand, significandf, significandl.
+ * manual/filesys.texi (Setting Permissions): Use mode_t for second
+ argument in fchmod prototype.
+ (File Owner): Use uid_t and gid_t in fchown prototype.
+ (File Times): Add const to utimes, futimes, and lutimes prototypes.
+ (Making Special Files): Use mode_t and dev_t in mknod prototype.
+ (Scanning Directory Content): Fix scandir and scandir64 prototypes to
+ use 'const struct dirent **' as argument types to CMP function pointer
+ argument.
+ (Symbolic Links): Fix readlink prototype with ssize_t as return value.
+ (File Times): Fix summary magic @comment for struct utimbuf and utime
+ to refer to utime.h, not time.h.
+ * manual/string.texi (Argz Functions): Add missing const in
+ argz_extract and argz_next prototypes.
+ (Finding Tokens in a String): Likewise for basename.
+ (String/Array Comparison): Fix typo in wcscasecmp prototype.
+ (Copying and Concatenation): Fix typo in wmemmove prototype.
+ * manual/signal.texi (Using Pause): Use (void) in pause prototype.
+ (Signal Stack): Remove erroneous const in sigstack prototype.
+ * manual/time.texi (Setting an Alarm): Add missing const in setitimer
+ prototype.
+ (Simple Calendar Time): Likewise for stime.
+ * manual/terminal.texi (BSD Terminal Modes): Add missing const in stty
+ prototype.
+ * manual/sysinfo.texi (System Parameters): Fix mentions of sysctl.h to
+ say sys/sysctl.h instead.
+ * manual/syslog.texi (syslog; vsyslog): Add missing const in syslog
+ and vsyslog prototypes.
+
+2013-02-11 Tom de Vries <tom@codesourcery.com>
+
+ * string/Makefile (CFLAGS-bug-strstr1.c, CFLAGS-bug-strcasestr1.c):
+ Remove.
+
+2013-02-11 Roland McGrath <roland@hack.frob.com>
+
+ * misc/sys/mman.h: Fix typo in mremap comment.
+
+2013-02-08 Roland McGrath <roland@hack.frob.com>
+
+ * manual/examples/mkfsock.c (make_named_socket): Don't add one for
+ the '\0' terminator.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * debug/segfault.c: Don't include <bp-checks.h>.
+ * sysdeps/generic/bp-checks.h: Remove file.
+ * sysdeps/unix/sysv/linux/getdents.c: Don't include <bp-checks.h>.
+ (__GETDENTS): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/i386/brk.c: Don't include <bp-checks.h>.
+ * sysdeps/unix/sysv/linux/i386/getgroups.c: Likewise.
+ (__getgroups): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise.
+ (setgroups): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/mmap64.c: Don't include <bp-checks.h>.
+ * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.
+ (__libc_msgrcv): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/msgsnd.c: Don't include <bp-checks.h>.
+ (__libc_msgsnd): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c: Don't include
+ <bp-checks.h>.
+ (__libc_pread): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c: Don't
+ include <bp-checks.h>.
+ (__libc_pread64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c: Don't
+ include <bp-checks.h>.
+ (__libc_pwrite): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c: Don't
+ include <bp-checks.h>.
+ (__libc_pwrite64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c: Don't include
+ <bp-checks.h>.
+ (__libc_pread): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c: Don't
+ include <bp-checks.h>.
+ (__libc_pread64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c: Don't
+ include <bp-checks.h>.
+ (__libc_pwrite): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c: Don't
+ include <bp-checks.h>.
+ (__libc_pwrite64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/pread.c: Don't include <bp-checks.h>.
+ (do_pread): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/pread64.c: Don't include <bp-checks.h>.
+ (do_pread64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/pwrite.c: Don't include <bp-checks.h>.
+ (do_pwrite): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/pwrite64.c: Don't include <bp-checks.h>.
+ (do_pwrite64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/readv.c: Don't include <bp-checks.h>.
+ (__libc_readv): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/semop.c: Don't include <bp-checks.h>.
+ (semop): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/semtimedop.c: Don't include
+ <bp-checks.h>.
+ (semtimedop): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/sh/pread.c: Don't include <bp-checks.h>.
+ (__libc_pread): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/sh/pread64.c: Don't include
+ <bp-checks.h>.
+ (__libc_pread64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/sh/pwrite.c: Don't include
+ <bp-checks.h>.
+ (__libc_pwrite): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/sh/pwrite64.c: Don't include
+ <bp-checks.h>.
+ (__libc_pwrite64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c: Don't include
+ <bp-checks.h>.
+ (__libc_msgrcv): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/sysctl.c: Don't include <bp-checks.h>.
+ (__sysctl): Don't use CHECK_N. Remove GKM FIXME comment.
+ * sysdeps/unix/sysv/linux/writev.c: Don't include <bp-checks.h>.
+ (__libc_writev): Don't use CHECK_N.
+
+2013-02-08 Roland McGrath <roland@hack.frob.com>
+
+ * string/strcpy.c: Removed unused variable.
+
+ * Makeconfig (+sysdep-includes): Define with := rather than =.
+ Use an existing include/ subdir of each sysdeps dir before it.
+
+2013-02-08 Carlos O'Donell <carlos@redhat.com>
+
+ * nscd/connection.c (register_traced_file): Comment function.
+ [HAVE_INOTIFY] (union __inev): Define.
+ [HAVE_INOTIFY] (inotify_check_files): New function.
+ [HAVE_INOTIFY] (clear_db_cache): Likewise.
+ [HAVE_INOTIFY] (main_loop_poll): Call inotify_check_files and
+ clear_db_cache.
+ [HAVE_INOTIFY] (main_loop_epoll): Likewise.
+
+2013-02-08 Carlos O'Donell <carlos@redhat.com>
+
+ * elf/dl-cache.c (_dl_load_cache_lookup): Comment that cache is
+ loaded if not already and that a failure is permanent.
+
+2013-02-08 Carlos O'Donell <carlos@redhat.com>
+
+ [BZ #15006]
+ * sysdeps/generic/ldconfig.h: Define FLAG_ARM_LIBSF.
+ * elf/cache.c (print_entry): Add FLAG_ARM_LIBSF support.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/generic/bp-checks.h (CHECK_1): Remove all definitions.
+ (CHECK_1_NULL_OK): Likewise.
+ * sysdeps/unix/sysv/linux/fxstat.c: Do not include <bp-checks.h>.
+ (__fxstat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/fxstat64.c: Do not include
+ <bp-checks.h>.
+ (___fxstat64): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/fxstatat.c: Do not include
+ <bp-checks.h>.
+ (__fxstatat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/fxstatat64.c: Do not include
+ <bp-checks.h>.
+ (__fxstatat64): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/i386/fxstat.c: Do not include
+ <bp-checks.h>.
+ (__fxstat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/i386/fxstatat.c: Do not include
+ <bp-checks.h>.
+ (__fxstatat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/i386/getresgid.c: Do not include
+ <bp-checks.h>.
+ (__getresgid): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/i386/getresuid.c: Do not include
+ <bp-checks.h>.
+ (__getresuid): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/i386/lxstat.c: Do not include
+ <bp-checks.h>.
+ (__lxstat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/i386/msgctl.c: Do not include
+ <bp-checks.h>.
+ (__old_msgctl): Do not use CHECK_1.
+ (__new_msgctl): Likewise.
+ * sysdeps/unix/sysv/linux/i386/setrlimit.c: Do not include
+ <bp-checks.h>.
+ (__new_setrlimit): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/i386/shmctl.c: Do not include
+ <bp-checks.h>.
+ (__old_shmctl): Do not use CHECK_1.
+ (__new_shmctl): Likewise.
+ * sysdeps/unix/sysv/linux/i386/xstat.c: Do not include
+ <bp-checks.h>.
+ (__xstat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/lxstat.c: Do not include <bp-checks.h>.
+ (__lxstat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/lxstat64.c: Do not include
+ <bp-checks.h>.
+ (___lxstat64): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/msgctl.c: Do not include <bp-checks.h>.
+ (__old_msgctl): Do not use CHECK_1.
+ (__new_msgctl): Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c: Do not include
+ <bp-checks.h>.
+ (__gettimeofday): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/ptrace.c: Do not include <bp-checks.h>.
+ (ptrace) [__BOUNDED_POINTERS__]: Remove conditional code.
+ * sysdeps/unix/sysv/linux/s390/gettimeofday.c: Do not include
+ <bp-checks.h>.
+ (__gettimeofday): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/shmctl.c: Do not include <bp-checks.h>.
+ (__old_shmctl): Do not use CHECK_1_NULL_OK.
+ (__new_shmctl): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/sigtimedwait.c: Do not include
+ <bp-checks.h>.
+ (do_sigtimedwait): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/sigwaitinfo.c: Do not include
+ <bp-checks.h>.
+ (do_sigwaitinfo): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/msgctl.c: Do not include
+ <bp-checks.h>.
+ (msgctl): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/shmctl.c: Do not include
+ <bp-checks.h>.
+ (shmctl): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/ustat.c: Do not include <bp-checks.h>.
+ (ustat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/wordsize-64/fxstat.c: Do not include
+ <bp-checks.h>.
+ (__fxstat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: Do not include
+ <bp-checks.h>.
+ (__fxstatat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/wordsize-64/lxstat.c: Do not include
+ <bp-checks.h>.
+ (__lxstat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/wordsize-64/xstat.c: Do not include
+ <bp-checks.h>.
+ (__xstat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/xstat.c: Do not include <bp-checks.h>.
+ (__xstat): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/xstat64.c: Do not include <bp-checks.h>.
+ (___xstat64): Do not use CHECK_1.
+
+ [BZ #13550]
+ * sysdeps/generic/bp-checks.h (CHECK_BOUNDS_LOW): Remove all
+ definitions.
+ (CHECK_BOUNDS_HIGH): Likewise.
+ * string/strcpy.c: Do not include <bp-checks.h>.
+ (strcpy): Do not use CHECK_BOUNDS_LOW and CHECK_BOUNDS_HIGH.
+
+2013-02-07 Roland McGrath <roland@hack.frob.com>
+
+ * nscd/nscd-client.h (__nscd_drop_map_ref):
+ Add __attribute__ ((unused)).
+ * nis/nss-nisplus.h (niserr2nss): Likewise.
+
+ * sysdeps/x86_64/multiarch/strstr.c (__m128i_strloadu): Define it only
+ under [!(USE_AS_STRCASESTR && STRCASESTR_NONASCII)].
+
+ * csu/libc-tls.c (init_static_tls, init_slotinfo):
+ Remove inline keyword.
+ * include/rounding-mode.h (round_away): Likewise.
+ * libio/wfileops.c (adjust_wide_data): Likewise.
+ * sysdeps/x86_64/multiarch/strstr.c (__m128i_strloadu): Likewise.
+ (__m128i_strloadu_tolower): Likewise.
+ * sysdeps/x86_64/multiarch/strcasestr-nonascii.c
+ (__m128i_strloadu_tolower): Likewise.
+ * time/mktime.c (ydhms_diff): Likewise.
+ * locale/elem-hash.h (elem_hash): Likewise.
+ * locale/setlocale.c (setdata): Likewise.
+ * posix/regex_internal.h (re_string_char_size_at): Likewise.
+ (re_string_wchar_at): Likewise.
+ (bitset_not, bitset_merge, bitset_mask): Likewise.
+ [!(__GNUC__ > 3)] (inline): Remove macro.
+ * nscd/nscd-client.h (__nscd_drop_map_ref): Remove inline keyword.
+ * elf/dl-deps.c (_dl_map_object_deps: preload): Likewise.
+ * elf/tlsdeschtab.h (_dl_tlsdesc_resolve_early_return_p): Likewise.
+ (_dl_tlsdesc_wake_up_held_fixups): Likewise.
+ * string/memcmp.c (memcmp_bytes): Likewise.
+ * locale/programs/locarchive.c (compute_hashval): Likewise.
+ * sysdeps/ieee754/dbl-64/x2y2m1.c (mul_split): Likewise.
+ * sysdeps/unix/sysv/linux/fips-private.h (fips_enabled_p): Likewise.
+ * resolv/res_send.c (evNowTime, evCmpTime): Likewise.
+ * nss/getent.c (print_rpc, print_protocols): Likewise.
+ (print_passwd, print_group, print_aliases): Likewise.
+ * nis/nss-nisplus.h (niserr2nss): Likewise.
+ * nscd/connections.c (restart_p): Likewise.
+ Change return type to bool.
+
+2013-02-05 Roland McGrath <roland@hack.frob.com>
+
+ * Makeconfig (all-Depend-files): Add existing
+ $(sorted-subdirs:=/Depend) files.
+ (all-subdirs): Remove nss.
+ * sysdeps/unix/inet/Subdirs: Add it here instead.
+ * hesiod/Depend: New file.
+
+ * elf/dl-hwcaps.c (_dl_important_hwcaps): Use a variable-length array
+ instead of calling alloca.
+
+ * io/lseek.c (__lseek): Rename to __libc_lseek.
+ Define __lseek as an alias.
+
+ * sysdeps/generic/malloc-sysdep.h: Include <stdbool.h> and <unistd.h>.
+
+2013-02-04 Carlos O'Donell <carlos@redhat.com>
+
+ * stdlib/getenv.c (getenv): Assume __BIG_ENDIAN in the
+ else clause and remove check for non-standard endianness.
+
+2013-02-04 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/fpu/libm-test-ulps: Update.
+
+2013-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/generic/bp-checks.h [__BOUNDED_POINTERS__]
+ (__ubp_memchr): Remove prototype.
+ [__BOUNDED_POINTERS__] (_CHECK_STRING): Remove macro.
+ [__BOUNDED_POINTERS__] (CHECK_STRING): Likewise.
+ [__BOUNDED_POINTERS__] (CHECK_STRING_NULL_OK): Likewise.
+ [!__BOUNDED_POINTERS__] (CHECK_STRING): Likewise.
+ * sysdeps/i386/memchr.S [!__BOUNDED_POINTERS__] (__ubp_memchr):
+ Remove alias.
+ * sysdeps/sparc/sparc32/memchr.S [!__BOUNDED_POINTERS__]
+ (__ubp_memchr): Likewise.
+ * sysdeps/sparc/sparc64/memchr.S [!__BOUNDED_POINTERS__]
+ (__ubp_memchr): Likewise.
+ * sysdeps/unix/sysv/linux/execve.c: Do not include <bp-checks.h>.
+ (__execve) [__BOUNDED_POINTERS__]: Remove conditional code.
+ (__execve) [!__BOUNDED_POINTERS__]: Make code unconditional.
+ * sysdeps/unix/sysv/linux/fxstatat.c (__fxstatat): Do not use
+ CHECK_STRING.
+ * sysdeps/unix/sysv/linux/fxstatat64.c (__fxstatat64): Likewise.
+ * sysdeps/unix/sysv/linux/getcwd.c: Do not include <bp-checks.h>.
+ (__getcwd): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/i386/chown.c: Do not include
+ <bp-checks.h>.
+ (__real_chown): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/i386/fchownat.c: Do not include
+ <bp-checks.h>.
+ (fchownat): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/i386/fxstatat.c (__fxstatat): Do not use
+ CHECK_STRING.
+ * sysdeps/unix/sysv/linux/i386/lchown.c: Do not include
+ <bp-checks.h>.
+ (__lchown): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/i386/lxstat.c (__lxstat): Likewise.
+ * sysdeps/unix/sysv/linux/i386/xstat.c (__xstat): Likewise.
+ * sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Likewise.
+ * sysdeps/unix/sysv/linux/lxstat64.c (___lxstat64): Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c: Do not
+ include <bp-checks.h>.
+ (truncate64): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/s390/s390-32/chown.c: Do not include
+ <bp-checks.h>.
+ (__real_chown): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/s390/s390-32/lchown.c: Do not include
+ <bp-checks.h>.
+ (__lchown): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/sh/chown.c: Do not include
+ <bp-checks.h>.
+ (__chown): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/truncate64.c: Do not include
+ <bp-checks.h>.
+ (truncate64): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/wordsize-64/lxstat.c (__lxstat):
+ Likewise.
+ * sysdeps/unix/sysv/linux/xmknod.c: Do not include <bp-checks.h>.
+ (__xmknod): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/xmknodat.c: Do not include
+ <bp-checks.h>.
+ (__xmknodat): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/xstat.c (__xstat): Likewise.
+ * sysdeps/unix/sysv/linux/xstat64.c (___xstat64): Likewise.
+
+2013-02-04 Andreas Schwab <schwab@suse.de>
+
+ [BZ #14142]
+ * include/errno.h: Redefine errno only if !NOT_IN_libc || IN_LIB.
+ * include/netdb.h: Likewise for h_errno.
+ * elf/tst-stackguard1.c: Include <tls.h>.
+
+2013-02-02 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * elf/link.h (struct link_map): Extend the l_addr comment.
+ * include/link.h (struct link_map): Likewise.
+
+2013-02-01 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/generic/bp-checks.h (BOUNDED_N): Remove all definitions.
+ (BOUNDED_1): Remove macro.
+ * debug/backtrace.c: Don't include <bp-checks.h>.
+ (ADVANCE_STACK_FRAME): Don't use BOUNDED_1.
+ (__backtrace): Likewise.
+ * sysdeps/powerpc/powerpc32/backtrace.c: Don't include
+ <bp-checks.h>.
+ (__backtrace): Don't use BOUNDED_1.
+ * sysdeps/powerpc/powerpc64/backtrace.c: Don't include
+ <bp-checks.h>.
+ (__backtrace): Don't use BOUNDED_1.
+ * sysdeps/sparc/backtrace.c: Don't include <bp-checks.h>.
+ (__backtrace): Don't use BOUNDED_1.
+ * sysdeps/unix/sysv/linux/shmat.c: Don't include <bp-checks.h>.
+ (shmat): Don't use BOUNDED_N.
+
+2013-01-31 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/generic/bp-start.h: Remove file.
+ * csu/libc-start.c: Don't include <bp-start.h>.
+ (LIBC_START_MAIN): Set up __environ directly instead of using
+ INIT_ARGV_and_ENVIRON.
+ * sysdeps/unix/sysv/linux/powerpc/libc-start.c: Don't include
+ <bp-start.h>.
+
+ [BZ #13550]
+ * sysdeps/generic/bp-checks.h (CHECK_IOCTL): Remove both
+ definitions.
+ (CHECK_FCNTL): Likewise.
+ (CHECK_N_PAGES): Likewise.
+
+ [BZ #13550]
+ * sysdeps/generic/bp-checks.h (CHECK_SIGSET): Remove both
+ definitions.
+ (CHECK_SIGSET_NULL_OK): Likewise.
+ * sysdeps/unix/sysv/linux/sigpending.c: Don't include
+ <bp-checks.h>.
+ (sigpending): Don't use CHECK_SIGSET.
+ * sysdeps/unix/sysv/linux/sigprocmask.c: Don't include
+ <bp-checks.h>.
+ (__sigprocmask): Don't use CHECK_SIGSET and CHECK_SIGSET_NULL_OK.
+ * sysdeps/unix/sysv/linux/sigsuspend.c: Don't include
+ <bp-checks.h>.
+ (do_sigsuspend): Don't use CHECK_SIGSET.
+ * sysdeps/unix/sysv/linux/sigtimedwait.c (do_sigtimedwait): Don't
+ use CHECK_SIGSET.
+ * sysdeps/unix/sysv/linux/sigwait.c: Don't include <bp-checks.h>.
+ (do_sigwait): Don't use CHECK_SIGSET.
+ * sysdeps/unix/sysv/linux/sigwaitinfo.c (do_sigwaitinfo): Don't
+ use CHECK_SIGSET.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c: Don't
+ include <bp-checks.h>.
+ (sigpending): Don't use CHECK_SIGSET.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c: Don't
+ include <bp-checks.h>.
+ (__sigprocmask): Don't use CHECK_SIGSET and CHECK_SIGSET_NULL_OK.
+ * sysdeps/unix/sysv/linux/x86_64/sigpending.c: Don't include
+ <bp-checks.h>.
+ (sigpending): Don't use CHECK_SIGSET.
+ * sysdeps/unix/sysv/linux/x86_64/sigprocmask.c: Don't include
+ <bp-checks.h>.
+ (__sigprocmask): Don't use CHECK_SIGSET and CHECK_SIGSET_NULL_OK.
+
+ [BZ #13550]
+ * sysdeps/generic/bp-semctl.h: Remove file.
+ * sysdeps/unix/sysv/linux/i386/semctl.c: Don't include
+ <bp-checks.h> and <bp-semctl.h>.
+ (__old_semctl): Don't use CHECK_SEMCTL.
+ (__new_semctl): Likewise.
+ * sysdeps/unix/sysv/linux/semctl.c: Don't include <bp-checks.h>
+ and <bp-semctl.h>.
+ (__old_semctl): Don't use CHECK_SEMCTL.
+ (__new_semctl): Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c: Don't include
+ <bp-checks.h> and <bp-semctl.h>.
+ (__old_semctl): Don't use CHECK_SEMCTL.
+ (__new_semctl): Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c: Don't include
+ <bp-checks.h> and <bp-semctl.h>.
+ (semctl): Don't use CHECK_SEMCTL.
+
+ [BZ #13550]
+ * Makerules (elide-bp-thunks): Remove variable.
+ (elide-routines.oS): Don't use $(elide-bp-thunks).
+ (elide-routines.os): Likewise.
+ (elide-routines.o): Likewise.
+ (elide-routines.op): Likewise.
+ (elide-routines.og): Likewise.
+ (objects): Don't use $(bp-thunks).
+ * sysdeps/unix/Makefile ($(common-objpfx)s-proto-bp.d): Do not
+ include.
+ (common-generated): Do not add s-proto-bp.d.
+ * sysdeps/unix/make-syscalls.sh (ptr): Remove variable.
+ (int): Likewise.
+ (typ): Likewise.
+ Do not generate makefile rules for bounded-pointer thunks.
+ * sysdeps/generic/bp-thunks.h: Remove file.
+ * sysdeps/unix/sysv/linux/i386/bp-thunks.h: Likewise.
+ * sysdeps/unix/s-proto-bp.S: Likewise.
+
+ [BZ #15062]
+ * math/k_casinh.c (__kernel_casinh): Compute real and imaginary
+ parts of result separately when argument is not close to line from
+ -i to i and one part of argument is small.
+ * math/k_casinhf.c (__kernel_casinhf): Likewise.
+ * math/k_casinhl.c (__kernel_casinhl): Likewise.
+ * math/libm-test.inc (cacos_test): Add more tests.
+ (casin_test): Likewise.
+ (casinh_test): Likewise.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+2013-01-31 David S. Miller <davem@davemloft.net>
+
+ * po/de.po: Update from translation team.
+
+2013-01-25 Maxim Kuvyrkov <maxim.kuvyrkov@gmail.com>
+
+ * time/tzfile.c: Include stdint.h for SIZE_MAX.
+
+2013-01-25 Thomas Schwinge <thomas@codesourcery.com>
+
+ * configure.in (_AC_PROG_CC_C89): New definition.
+ * configure: Regenerate.
+
+ * configure.in (AC_PROG_CPP): New definition.
+ * configure: Regenerate.
+
+2013-01-23 Joseph Myers <joseph@codesourcery.com>
+
+ * debug/tst-backtrace.h: New file.
+ * debug/tst-backtrace2.c: Include tst-backtrace.h.
+ (ret): Remove variable.
+ (x): Likewise.
+ (FAIL): Remove macro.
+ (NO_INLINE): Likewise.
+ (fn1): Use match function instead of strstr.
+ * debug/tst-backtrace3.c: Include tst-backtrace.h.
+ (ret): Remove variable.
+ (x): Likewise.
+ (FAIL): Remove macro.
+ (NO_INLINE): Likewise.
+ (fn): Use match function instead of strstr.
+ * debug/tst-backtrace4.c: Include tst-backtrace.h.
+ (ret): Remove variable.
+ (x): Likewise.
+ (FAIL): Remove macro.
+ (NO_INLINE): Likewise.
+ (handle_signal): Use match function instead of strstr.
+ * debug/tst-backtrace5.c: Include tst-backtrace.h.
+ (ret): Remove variable.
+ (x): Likewise.
+ (FAIL): Remove macro.
+ (NO_INLINE): Likewise.
+ (handle_signal): Use match function instead of strstr.
+
+2013-01-23 Roland McGrath <roland@hack.frob.com>
+
+ * misc/sys/cdefs.h (__glibc_unlikely, __glibc_likely): Fix whitespace.
+
+2013-01-23 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/sparc32/sparcv9/bits/atomic.h
+ (__arch_compare_and_exchange_val_32_acq): Use %g0 as second
+ argument of CAS if possible.
+ * sysdeps/sparc/sparc64/bits/atomic.h
+ (__arch_compare_and_exchange_val_32_acq): Likewise.
+ (__arch_compare_and_exchange_val_64_acq): Likewise.
+
+2013-01-23 Pino Toscano <toscano.pino@tiscali.it>
+
+ * sysdeps/unix/sysv/linux/ulimit.c: Moved to ...
+ * sysdeps/posix/ulimit.c: ... this.
+ Include <limits.h>.
+ * sysdeps/unix/bsd/ulimit.c: Remove file.
+
+2013-01-23 Adam Conrad <adconrad@0c3.net>
+
+ * elf/Makefile (LDFLAGS-tst-array2): Add $(no-as-needed).
+ (LDFLAGS-tst-array5): Likewise.
+
+2013-01-23 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #15036]
+ * bits/wchar.h (__WCHAR_MAX): Define based on __WCHAR_MAX__, or
+ based on [L'\0' - 1 > 0] if [!__WCHAR_MAX__].
+ (__WCHAR_MIN): Likewise, using __WCHAR_MIN__.
+ * sysdeps/unix/sysv/linux/x86/bits/wchar.h: Remove.
+
+2013-01-21 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/backtrace.c: New file.
+ * sysdeps/sparc/sparc32/backtrace.h: New file.
+ * sysdeps/sparc/sparc32/sparcv9/backtrace.h: New file.
+ * sysdeps/sparc/sparc64/backtrace.h: New file.
+ * sysdeps/sparc/sparc64/backtrace.c: Delete.
+ * sysdeps/sparc/Makefile (CFLAGS-backtrace.c): Add
+ -funwind-tables.
+
+2013-01-21 Andreas Schwab <schwab@suse.de>
+
+ [BZ #15020]
+ * posix/wordexp.c (exec_comm): Avoid busy loop when command has
+ closed its stdout.
+
+2013-01-20 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/powerpc/powerpc32/power4/fpu/mpa.c: Don't include
+ "mpa2.h".
+ * sysdeps/powerpc/powerpc64/power4/fpu/mpa.c: Likewise.
+
2013-01-18 Joseph Myers <joseph@codesourcery.com>
Mark Mitchell <mark@codesourcery.com>
Tom de Vries <tom@codesourcery.com>
@@ -4552,7 +6549,7 @@
(do_one_test): Call check_result.
(test_main): Call check1.
* string/bug-strstr1.c (main): Moved to ...
- * string/test-strchr.c (check1): Here. New function.
+ * string/test-strstr.c (check1): Here. New function.
(do_one_test): Break out result checking code into ...
(check_result): This. New function.
(do_one_test): Call check_result.
diff --git a/libc/Makeconfig b/libc/Makeconfig
index 3dcfcc660..c8149ecbb 100644
--- a/libc/Makeconfig
+++ b/libc/Makeconfig
@@ -435,18 +435,6 @@ else
+link-tests = $(+link-static-tests)
endif
endif
-# Command for statically linking bounded-pointer programs with the C library.
-ifndef +link-bounded
-+link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
- $(sysdep-LDFLAGS) $(LDFLAGS) \
- $(addprefix $(csu-objpfx),b$(static-start-installed-name)) \
- $(+preinit) $(+prectorT) \
- $(filter-out $(addprefix $(csu-objpfx),start.ob \
- $(start-installed-name))\
- $(+preinit) $(link-extra-libs-bounded) \
- $(common-objpfx)libc% $(+postinit),$^) \
- $(link-extra-libs-bounded) $(link-libc-bounded) $(+postctorT) $(+postinit)
-endif
ifeq (yes,$(build-shared))
ifndef rtld-LDFLAGS
rtld-LDFLAGS = -Wl,-dynamic-linker=$(slibdir)/$(rtld-installed-name)
@@ -506,13 +494,11 @@ endif
ifndef link-extra-libs
link-extra-libs = $(LDLIBS-$(@F))
link-extra-libs-static = $(link-extra-libs)
-link-extra-libs-bounded = $(link-extra-libs)
endif
# The static libraries.
link-libc-static = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib) -Wl,--end-group
link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib-tests) -Wl,--end-group
-link-libc-bounded = $(common-objpfx)libc_b.a $(gnulib) $(common-objpfx)libc_b.a
# How to link against libgcc. Some libgcc functions, such as those
# for "long long" arithmetic or software floating point, can always be
@@ -617,12 +603,11 @@ $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
# $(run-via-rtld-prefix) is a command that, when prepended to the name
# of a program built with the newly built library, produces a command
# that, executed on the host for which the library is built, runs that
-# program. For the statically-linked %-bp test programs, and for
-# tests listed in tests-static or xtests-static, it is empty.
+# program. For tests listed in tests-static or xtests-static, it is
+# empty.
run-via-rtld-prefix = \
$(if $(strip $(filter $(notdir $(built-program-file)), \
- $(tests-static) $(xtests-static)) \
- $(filter %-bp,$(built-program-file))),, \
+ $(tests-static) $(xtests-static))),, \
$(elf-objpfx)$(rtld-installed-name) \
--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)))
else
@@ -652,9 +637,9 @@ endif
# $(test-via-rtld-prefix) is a command that, when prepended to the name
# of a test program built with the newly built library, produces a command
# that, executed on the host for which the library is built, runs that
-# program. For the statically-linked %-bp test programs, and for
-# tests listed in tests-static or xtests-static as well as when test
-# programs are hardcoded to the newly built libraries, it is empty.
+# program. For tests listed in tests-static or xtests-static as well
+# as when test programs are hardcoded to the newly built libraries, it
+# is empty.
# $(test-program-prefix) is a command that, when prepended to the name
# of a test program built with the newly built library, produces a command
@@ -765,11 +750,18 @@ endif # $(+cflags) == ""
# Don't duplicate options if we inherited variables from the parent.
+cflags := $(sort $(+cflags))
+# Each sysdeps directory can contain header files that both will be
+# used to compile and will be installed. Each can also contain an
+# include/ subdirectory, whose header files will be used to compile
+# but will not be installed, and will take precedence over the
+# installed files. This mirrors the top-level include/ subdirectory.
++sysdep-includes := $(foreach dir,$(+sysdep_dirs),\
+ $(addprefix -I,$(wildcard $(dir)/include) $(dir)))
+
# These are flags given to the C compiler to tell it to look for
# include files (including ones given in angle brackets) in the parent
# library source directory, in the include directory, and in the
# current directory.
-+sysdep-includes = $(addprefix -I,$(+sysdep_dirs))
+includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \
$(+sysdep-includes) $(includes) \
$(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
@@ -810,7 +802,7 @@ endif
# The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
# to pass different flags for each flavor.
libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
-all-object-suffixes := .o .os .op .og .ob .oS
+all-object-suffixes := .o .os .op .og .oS
object-suffixes :=
CPPFLAGS-.o = $(pic-default)
CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
@@ -845,18 +837,6 @@ endif
# 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'
-# to runtime bounds checking. The bounded-pointer objects are named foo.ob.
-# We disable sibling-call optimizations so that stack traces will be complete
-# and thus aid debugging, since after all, BPs are a debugging tool.
-object-suffixes += .ob
-CPPFLAGS-.ob = -fbounded-pointers $(pic-default)
-CFLAGS-.ob = -g -O2 -fno-optimize-sibling-calls -fno-strict-aliasing
-libtype.ob = lib%_b.a
-endif
-
object-suffixes-for-libc := $(object-suffixes)
ifeq (yes,$(build-shared))
@@ -888,8 +868,6 @@ subdirs = $(sorted-subdirs)
subdir-srcdirs = $(foreach dir,$(subdirs),\
$(firstword $($(dir)-srcdir) $(..)$(dir)))
-ifeq (yes, $(build-shared))
-
# This is a pair of implicit rules to preprocess a file with # comments,
# %ifdef et al, based on config.h settings or other %include'd files.
# We use chained rules instead of a pipeline here so that we can properly
@@ -908,6 +886,8 @@ ifeq (yes, $(build-shared))
sed '/^[ ]*#/d;/^[ ]*$$/d' $< > $@T
mv -f $@T $@
+ifeq (yes, $(build-shared))
+
# To generate a header to support more than one ABI for different
# architecture variants, the CPU/Makefile defines abi-variants to be a
# list of names for those variants (e.g. 32 64), and, for each variant,
@@ -1059,13 +1039,19 @@ all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
stdlib stdio-common libio malloc string wcsmbs time dirent \
grp pwd posix io termios resource misc socket sysvipc gmon \
gnulib iconv iconvdata wctype manual shadow gshadow po argp \
- crypt nss localedata timezone rt conform debug \
+ crypt localedata timezone rt conform debug \
$(add-on-subdirs) dlfcn elf
ifndef avoid-generated
-all-Depend-files := $(wildcard $(foreach dir,$(all-subdirs),\
- $(firstword $($(dir)-srcdir) \
- $(..)$(dir))/Depend))
+# sysd-sorted itself will contain rules making the sysd-sorted target
+# depend on Depend files. But if you just added a Depend file to an
+# existing directory not in all-subdirs, then sysd-sorted needs to
+# be regenerated, so it depends on existing $(sorted-subdirs:=/Depend) files.
+all-Depend-files := $(wildcard $(sort \
+ $(foreach dir,$(all-subdirs),\
+ $(firstword $($(dir)-srcdir) \
+ $(..)$(dir))/Depend) \
+ $(sorted-subdirs:=/Depend)))
$(common-objpfx)sysd-sorted: $(..)scripts/gen-sorted.awk \
$(common-objpfx)config.make $(..)Makeconfig \
$(wildcard $(sysdirs:=/Subdirs)) \
diff --git a/libc/Makerules b/libc/Makerules
index 7cc82627b..d1d6ca24f 100644
--- a/libc/Makerules
+++ b/libc/Makerules
@@ -432,20 +432,15 @@ static-only-routines =
endif
endif
-# Bounded pointer thunks are only built for *.ob
-elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
-
elide-routines.oS += $(filter-out $(static-only-routines),\
- $(routines) $(aux) $(sysdep_routines)) \
- $(elide-bp-thunks)
-elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
+ $(routines) $(aux) $(sysdep_routines))
+elide-routines.os += $(static-only-routines)
# If we have versioned code we don't need the old versions in any of the
# static libraries.
-elide-routines.o += $(shared-only-routines) $(elide-bp-thunks)
-elide-routines.op += $(shared-only-routines) $(elide-bp-thunks)
-elide-routines.og += $(shared-only-routines) $(elide-bp-thunks)
-elide-routines.ob += $(shared-only-routines)
+elide-routines.o += $(shared-only-routines)
+elide-routines.op += $(shared-only-routines)
+elide-routines.og += $(shared-only-routines)
# Shared library building.
@@ -633,11 +628,7 @@ headers := $(headers) $(sysdep_headers)
# This is the list of all object files, gotten by
# replacing every ".c" in `sources' with a ".o".
-# We also add bounded-pointer thunks, which are later
-# elided for all suffixes except for `.ob'.
-override objects := $(addprefix $(objpfx),$(sources:.c=.o) \
- $(patsubst %,$(bppfx)%.o,\
- $(filter $(routines) $(sysdep_routines),$(bp-thunks))))
+override objects := $(addprefix $(objpfx),$(sources:.c=.o))
# The makefile may define $(extra-libs) with `libfoo libbar'
@@ -1340,9 +1331,7 @@ mostlyclean: common-mostlyclean
do-tests-clean:
-rm -f $(addprefix $(objpfx),$(addsuffix .out,$(tests) $(xtests) \
- $(test-srcs)) \
- $(addsuffix -bp.out,$(tests) $(xtests) \
- $(test-srcs)))
+ $(test-srcs)))
# Remove the object files.
common-mostlyclean:
@@ -1351,12 +1340,8 @@ common-mostlyclean:
$(addsuffix .o,$(tests) $(xtests) \
$(test-srcs) $(others) \
$(sysdep-others)) \
- $(addsuffix -bp,$(tests) $(xtests) \
- $(test-srcs)) \
$(addsuffix .out,$(tests) $(xtests) \
- $(test-srcs)) \
- $(addsuffix -bp.out,$(tests) $(xtests) \
- $(test-srcs)))
+ $(test-srcs)))
-rm -f $(addprefix $(objpfx),$(extra-objs) $(extra-test-objs) \
$(install-lib) $(install-lib.so) \
$(install-lib.so:%.so=%_pic.a))
diff --git a/libc/NEWS b/libc/NEWS
index cf6191bb3..c5e38b3f6 100644
--- a/libc/NEWS
+++ b/libc/NEWS
@@ -9,8 +9,19 @@ Version 2.18
* The following bugs are resolved with this release:
- 13951, 14200, 14317, 14327, 14496, 14964, 14981, 14982, 14985, 14994,
- 14996, 15003, 15023.
+ 11561, 13951, 14142, 14200, 14317, 14327, 14496, 14920, 14964, 14981,
+ 14982, 14985, 14994, 14996, 15003, 15006, 15020, 15023, 15036, 15054,
+ 15062, 15078, 15160.
+
+* Add support for calling C++11 thread_local object destructors on thread
+ and program exit. This needs compiler support for offloading C++11
+ destructor calls to glibc.
+
+* Improved worst case performance of libm functions with double inputs and
+ output.
+
+* Support for priority inherited mutexes in pthread condition variables on
+ non-x86 architectures.
Version 2.17
diff --git a/libc/Rules b/libc/Rules
index 5728d0955..301a74818 100644
--- a/libc/Rules
+++ b/libc/Rules
@@ -98,12 +98,8 @@ ifeq ($(run-built-tests),no)
tests: $(addprefix $(objpfx),$(tests) $(test-srcs))
xtests: tests
else
-ifeq ($(build-bounded),yes)
-tests-bp.out = $(tests:%=$(objpfx)%-bp.out)
-xtests-bp.out = $(xtests:%=$(objpfx)%-bp.out)
-endif
-tests: $(tests:%=$(objpfx)%.out) $(tests-bp.out)
-xtests: tests $(xtests:%=$(objpfx)%.out) $(xtests-bp.out)
+tests: $(tests:%=$(objpfx)%.out)
+xtests: tests $(xtests:%=$(objpfx)%.out)
endif
ifeq ($(build-programs),yes)
@@ -179,14 +175,6 @@ $(addprefix $(objpfx),$(binaries-static-tests)): %: %.o \
$(+link-static-tests)
endif
-ifeq ($(build-bounded),yes)
-binaries-bounded = $(addsuffix -bp,$(tests) $(xtests) $(test-srcs))
-$(addprefix $(objpfx),$(binaries-bounded)): %-bp: %.ob \
- $(sort $(filter $(common-objpfx)lib%,$(link-libc-bounded))) \
- $(addprefix $(csu-objpfx),start.ob) $(+preinit) $(+postinit)
- $(+link-bounded)
-endif
-
ifneq "$(strip $(tests) $(xtests) $(test-srcs))" ""
# These are the implicit rules for making test outputs
# from the test programs and whatever input files are present.
@@ -194,8 +182,6 @@ ifneq "$(strip $(tests) $(xtests) $(test-srcs))" ""
make-test-out = $(test-wrapper-env) \
GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
$($*-ENV) $(host-test-program-cmd) $($*-ARGS)
-$(objpfx)%-bp.out: %.input $(objpfx)%-bp
- $(make-test-out) > $@ < $(word 1,$^)
$(objpfx)%.out: %.input $(objpfx)%
$(make-test-out) > $@ < $(word 1,$^)
$(objpfx)%.out: /dev/null $(objpfx)% # Make it 2nd arg for canned sequence.
diff --git a/libc/Versions.def b/libc/Versions.def
index 3c9e0aedb..8651992a1 100644
--- a/libc/Versions.def
+++ b/libc/Versions.def
@@ -34,6 +34,7 @@ libc {
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
+ GLIBC_2.18
HURD_CTHREADS_0.3
%ifdef EXPORT_UNWIND_FIND_FDE
GCC_3.0
diff --git a/libc/bits/stdlib-bsearch.h b/libc/bits/stdlib-bsearch.h
new file mode 100644
index 000000000..4cb58abe6
--- /dev/null
+++ b/libc/bits/stdlib-bsearch.h
@@ -0,0 +1,43 @@
+/* Perform binary search - inline version.
+ Copyright (C) 1991-2013 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/>. */
+
+__extern_inline void *
+bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
+ __compar_fn_t __compar)
+{
+ size_t __l, __u, __idx;
+ const void *__p;
+ int __comparison;
+
+ __l = 0;
+ __u = __nmemb;
+ while (__l < __u)
+ {
+ __idx = (__l + __u) / 2;
+ __p = (void *) (((const char *) __base) + (__idx * __size));
+ __comparison = (*__compar) (__key, __p);
+ if (__comparison < 0)
+ __u = __idx;
+ else if (__comparison > 0)
+ __l = __idx + 1;
+ else
+ return (void *) __p;
+ }
+
+ return NULL;
+}
diff --git a/libc/bits/wchar.h b/libc/bits/wchar.h
index 671034ef9..ef93d0e78 100644
--- a/libc/bits/wchar.h
+++ b/libc/bits/wchar.h
@@ -19,24 +19,31 @@
#ifndef _BITS_WCHAR_H
#define _BITS_WCHAR_H 1
-/* Use GCC's __WCHAR_MAX__ when available. */
+/* The fallback definitions, for when __WCHAR_MAX__ or __WCHAR_MIN__
+ are not defined, give the right value and type as long as both int
+ and wchar_t are 32-bit types. Adding L'\0' to a constant value
+ ensures that the type is correct; it is necessary to use (L'\0' +
+ 0) rather than just L'\0' so that the type in C++ is the promoted
+ version of wchar_t rather than the distinct wchar_t type itself.
+ Because wchar_t in preprocessor #if expressions is treated as
+ intmax_t or uintmax_t, the expression (L'\0' - 1) would have the
+ wrong value for WCHAR_MAX in such expressions and so cannot be used
+ to define __WCHAR_MAX in the unsigned case. */
+
#ifdef __WCHAR_MAX__
-#define __WCHAR_MAX __WCHAR_MAX__
+# define __WCHAR_MAX __WCHAR_MAX__
+#elif L'\0' - 1 > 0
+# define __WCHAR_MAX (0xffffffffu + L'\0')
#else
-#define __WCHAR_MAX (2147483647)
+# define __WCHAR_MAX (0x7fffffff + L'\0')
#endif
-/* GCC may also define __WCHAR_UNSIGNED__.
- Use L'\0' to give the expression the correct (unsigned) type. */
-#ifdef __WCHAR_UNSIGNED__
-#define __WCHAR_MIN L'\0'
-
-/* Failing that, rely on the preprocessor's knowledge of the
- signedness of wchar_t. */
+#ifdef __WCHAR_MIN__
+# define __WCHAR_MIN __WCHAR_MIN__
#elif L'\0' - 1 > 0
-#define __WCHAR_MIN L'\0'
+# define __WCHAR_MIN (L'\0' + 0)
#else
-#define __WCHAR_MIN (-__WCHAR_MAX - 1)
+# define __WCHAR_MIN (-__WCHAR_MAX - 1)
#endif
#endif /* bits/wchar.h */
diff --git a/libc/catgets/gencat.c b/libc/catgets/gencat.c
index 4db52ceb2..ae0a643ac 100644
--- a/libc/catgets/gencat.c
+++ b/libc/catgets/gencat.c
@@ -137,13 +137,7 @@ static struct argp argp =
/* Wrapper functions with error checking for standard functions. */
-extern void *xmalloc (size_t n)
- __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
- __attribute_malloc__ __attribute_alloc_size (1, 2);
-extern void *xrealloc (void *o, size_t n)
- __attribute_malloc__ __attribute_alloc_size (2);
-extern char *xstrdup (const char *) __attribute_malloc__;
+#include <programs/xmalloc.h>
/* Prototypes for local functions. */
static void error_print (void);
diff --git a/libc/config.h.in b/libc/config.h.in
index f3fe6b88b..8c2479ef4 100644
--- a/libc/config.h.in
+++ b/libc/config.h.in
@@ -115,7 +115,7 @@
/* Defined to some form of __attribute__ ((...)) if the compiler supports
a different, more efficient calling convention. */
-#if defined USE_REGPARMS && !defined PROF && !defined __BOUNDED_POINTERS__
+#if defined USE_REGPARMS && !defined PROF
# define internal_function __attribute__ ((regparm (3), stdcall))
#endif
diff --git a/libc/config.make.in b/libc/config.make.in
index ed2716385..a966dcae2 100644
--- a/libc/config.make.in
+++ b/libc/config.make.in
@@ -91,7 +91,6 @@ nss-crypt = @libc_cv_nss_crypt@
build-shared = @shared@
build-pic-default= @libc_cv_pic_default@
build-profile = @profile@
-build-bounded = no
build-static-nss = @static_nss@
add-ons = @add_ons@
add-on-subdirs = @add_on_subdirs@
diff --git a/libc/configure b/libc/configure
index be21626b6..000f0aac3 100755
--- a/libc/configure
+++ b/libc/configure
@@ -1573,43 +1573,6 @@ fi
} # ac_fn_c_try_compile
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
# ac_fn_cxx_try_compile LINENO
# ----------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
@@ -2359,6 +2322,16 @@ _ACEOF
# Glibc should not depend on any header files
+# We require GCC, and by default use its preprocessor. Override AC_PROG_CPP
+# here to work around the Autoconf issue discussed in
+# <http://sourceware.org/ml/libc-alpha/2013-01/msg00721.html>.
+# AC_PROG_CPP
+
+# We require GCC. Override _AC_PROG_CC_C89 here to work around the Autoconf
+# issue discussed in
+# <http://sourceware.org/ml/libc-alpha/2013-01/msg00757.html>.
+
+
subdirs="$subdirs "
@@ -2931,96 +2904,6 @@ else
CFLAGS=
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -3073,142 +2956,13 @@ done
fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
+ CPP="$CC -E"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
# We need the C++ compiler only for testing.
ac_ext=cpp
diff --git a/libc/configure.in b/libc/configure.in
index 03e5a8faa..def052413 100644
--- a/libc/configure.in
+++ b/libc/configure.in
@@ -17,6 +17,28 @@ AC_DEFUN([_AC_INCLUDES_DEFAULT_REQUIREMENTS],
[m4_divert_text([DEFAULTS],
[ac_includes_default='/* none */'])])
+# We require GCC, and by default use its preprocessor. Override AC_PROG_CPP
+# here to work around the Autoconf issue discussed in
+# <http://sourceware.org/ml/libc-alpha/2013-01/msg00721.html>.
+AC_DEFUN([AC_PROG_CPP],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_ARG_VAR([CPP], [C preprocessor])dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ CPP="$CC -E"
+fi
+AC_SUBST(CPP)dnl
+])# AC_PROG_CPP
+
+# We require GCC. Override _AC_PROG_CC_C89 here to work around the Autoconf
+# issue discussed in
+# <http://sourceware.org/ml/libc-alpha/2013-01/msg00757.html>.
+AC_DEFUN([_AC_PROG_CC_C89], [[$1]])
+
dnl This is here so we can set $subdirs directly based on configure fragments.
AC_CONFIG_SUBDIRS()
diff --git a/libc/crypt/Makefile b/libc/crypt/Makefile
index 85d8905b9..c0a6efd9e 100644
--- a/libc/crypt/Makefile
+++ b/libc/crypt/Makefile
@@ -74,9 +74,6 @@ $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.so
else
$(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.a
endif
-ifeq (yes,$(build-bounded))
-$(tests:%=$(objpfx)%-bp): $(objpfx)libcrypt_b.a
-endif
endif # eglibc: OPTION_EGLIBC_CRYPT
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
diff --git a/libc/csu/Makefile b/libc/csu/Makefile
index ed6e25df8..cfdb972b7 100644
--- a/libc/csu/Makefile
+++ b/libc/csu/Makefile
@@ -55,12 +55,6 @@ install-lib += S$(start-installed-name)
generated += start.os
endif
-ifeq (yes,$(build-bounded))
-extra-objs += b$(start-installed-name)
-install-lib += b$(start-installed-name)
-generated += start.ob
-endif
-
ifneq ($(start-installed-name),$(static-start-installed-name))
extra-objs += $(static-start-installed-name) g$(static-start-installed-name)
omit-deps += $(patsubst %.o,%,$(static-start-installed-name) \
@@ -100,9 +94,6 @@ $(objpfx)$(start-installed-name): $(objpfx)start.o $(objpfx)abi-note.o \
$(objpfx)S$(start-installed-name): $(objpfx)start.os $(objpfx)abi-note.o \
$(objpfx)init.o
$(link-relocatable)
-$(objpfx)b$(start-installed-name): $(objpfx)start.ob $(objpfx)abi-note.ob \
- $(objpfx)init.ob
- $(link-relocatable)
endif
# The profiling startfile is made by linking together the normal
diff --git a/libc/csu/gmon-start.c b/libc/csu/gmon-start.c
index 371037980..54495eb49 100644
--- a/libc/csu/gmon-start.c
+++ b/libc/csu/gmon-start.c
@@ -7,6 +7,23 @@
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The GNU Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ Note that people who make modified versions of this file are not
+ obligated to grant this special exception for their modified
+ versions; it is their choice whether to do so. The GNU Lesser
+ General Public License gives permission to release a modified
+ version without this exception; this exception also makes it
+ possible to release a modified version which carries forward this
+ exception.
+
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
diff --git a/libc/csu/libc-start.c b/libc/csu/libc-start.c
index edb9c036f..c896dbbd6 100644
--- a/libc/csu/libc-start.c
+++ b/libc/csu/libc-start.c
@@ -19,8 +19,6 @@
#include <stdio.h>
#include <unistd.h>
#include <ldsodefs.h>
-#include <bp-start.h>
-#include <bp-sym.h>
extern void __libc_init_first (int argc, char **argv, char **envp);
#ifndef SHARED
@@ -87,7 +85,7 @@ apply_irel (void)
# endif
#else
# define STATIC
-# define LIBC_START_MAIN BP_SYM (__libc_start_main)
+# define LIBC_START_MAIN __libc_start_main
#endif
#ifdef MAIN_AUXVEC_ARG
@@ -102,14 +100,14 @@ apply_irel (void)
STATIC int LIBC_START_MAIN (int (*main) (int, char **, char **
MAIN_AUXVEC_DECL),
int argc,
- char *__unbounded *__unbounded ubp_av,
+ char **argv,
#ifdef LIBC_START_MAIN_AUXVEC_ARG
- ElfW(auxv_t) *__unbounded auxvec,
+ ElfW(auxv_t) *auxvec,
#endif
__typeof (main) init,
void (*fini) (void),
void (*rtld_fini) (void),
- void *__unbounded stack_end)
+ void *stack_end)
__attribute__ ((noreturn));
@@ -118,29 +116,23 @@ STATIC int LIBC_START_MAIN (int (*main) (int, char **, char **
finalizers were called in more than one place. */
STATIC int
LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
- int argc, char *__unbounded *__unbounded ubp_av,
+ int argc, char **argv,
#ifdef LIBC_START_MAIN_AUXVEC_ARG
- ElfW(auxv_t) *__unbounded auxvec,
+ ElfW(auxv_t) *auxvec,
#endif
__typeof (main) init,
void (*fini) (void),
- void (*rtld_fini) (void), void *__unbounded stack_end)
+ void (*rtld_fini) (void), void *stack_end)
{
-#if __BOUNDED_POINTERS__
- char **argv;
-#else
-# define argv ubp_av
-#endif
-
/* Result of the 'main' function. */
int result;
__libc_multiple_libcs = &_dl_starting_up && !_dl_starting_up;
#ifndef SHARED
- char *__unbounded *__unbounded ubp_ev = &ubp_av[argc + 1];
+ char **ev = &argv[argc + 1];
- INIT_ARGV_and_ENVIRON;
+ __environ = ev;
/* Store the lowest stack address. This is done in ld.so if this is
the code for the DSO. */
@@ -150,12 +142,12 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
/* First process the auxiliary vector since we need to find the
program header to locate an eventually present PT_TLS entry. */
# ifndef LIBC_START_MAIN_AUXVEC_ARG
- ElfW(auxv_t) *__unbounded auxvec;
+ ElfW(auxv_t) *auxvec;
{
- char *__unbounded *__unbounded evp = ubp_ev;
+ char **evp = ev;
while (*evp++ != NULL)
;
- auxvec = (ElfW(auxv_t) *__unbounded) evp;
+ auxvec = (ElfW(auxv_t) *) evp;
}
# endif
_dl_aux_init (auxvec);
diff --git a/libc/csu/libc-tls.c b/libc/csu/libc-tls.c
index 90daaa61c..5fa39eb8d 100644
--- a/libc/csu/libc-tls.c
+++ b/libc/csu/libc-tls.c
@@ -75,7 +75,7 @@ size_t _dl_tls_generation;
TLS_INIT_HELPER
#endif
-static inline void
+static void
init_slotinfo (void)
{
/* Create the slotinfo list. */
@@ -90,7 +90,7 @@ init_slotinfo (void)
GL(dl_tls_dtv_slotinfo_list) = &static_slotinfo.si;
}
-static inline void
+static void
init_static_tls (size_t memsz, size_t align)
{
/* That is the size of the TLS memory for this object. The initialized
diff --git a/libc/debug/backtrace.c b/libc/debug/backtrace.c
index bd60c04d5..84594986c 100644
--- a/libc/debug/backtrace.c
+++ b/libc/debug/backtrace.c
@@ -21,7 +21,6 @@
#include <signal.h>
#include <frame.h>
#include <sigcontextinfo.h>
-#include <bp-checks.h>
#include <ldsodefs.h>
/* This implementation assumes a stack layout that matches the defaults
@@ -50,7 +49,7 @@
/* By default assume the `next' pointer in struct layout points to the
next struct layout. */
#ifndef ADVANCE_STACK_FRAME
-# define ADVANCE_STACK_FRAME(next) BOUNDED_1 ((struct layout *) (next))
+# define ADVANCE_STACK_FRAME(next) ((struct layout *) (next))
#endif
/* By default, the frame pointer is just what we get from gcc. */
@@ -64,15 +63,15 @@ __backtrace (array, size)
int size;
{
struct layout *current;
- void *__unbounded top_frame;
- void *__unbounded top_stack;
+ void *top_frame;
+ void *top_stack;
int cnt = 0;
top_frame = FIRST_FRAME_POINTER;
top_stack = CURRENT_STACK_FRAME;
/* We skip the call to this function, it makes no sense to record it. */
- current = BOUNDED_1 ((struct layout *) top_frame);
+ current = ((struct layout *) top_frame);
while (cnt < size)
{
if ((void *) current INNER_THAN top_stack
diff --git a/libc/debug/segfault.c b/libc/debug/segfault.c
index 934570977..e05138097 100644
--- a/libc/debug/segfault.c
+++ b/libc/debug/segfault.c
@@ -32,8 +32,6 @@
#include <ldsodefs.h>
#include <gnu/option-groups.h>
-#include <bp-checks.h>
-
/* This file defines macros to access the content of the sigcontext element
passed up by the signal handler. */
#include <sigcontextinfo.h>
diff --git a/libc/debug/tst-backtrace.h b/libc/debug/tst-backtrace.h
new file mode 100644
index 000000000..0a89488f0
--- /dev/null
+++ b/libc/debug/tst-backtrace.h
@@ -0,0 +1,48 @@
+/* Test backtrace and backtrace_symbols: common code for examining
+ backtraces.
+ Copyright (C) 2013 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 <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+/* Set to a non-zero value if the test fails. */
+volatile int ret;
+
+/* Accesses to X are used to prevent optimization. */
+volatile int x;
+
+/* Called if the test fails. */
+#define FAIL() \
+ do { printf ("Failure on line %d\n", __LINE__); ret = 1; } while (0)
+
+/* Use this attribute to prevent inlining, so that all expected frames
+ are present. */
+#define NO_INLINE __attribute__ ((noinline))
+
+/* Look for a match in SYM from backtrace_symbols to NAME, a fragment
+ of a function name. Ignore the filename before '(', but presume
+ that the function names are chosen so they cannot accidentally
+ match the hex offset before the closing ')'. */
+
+static inline bool
+match (const char *sym, const char *name)
+{
+ char *p = strchr (sym, '(');
+ return p != NULL && strstr (p, name) != NULL;
+}
diff --git a/libc/debug/tst-backtrace2.c b/libc/debug/tst-backtrace2.c
index e1d4572c3..1bdef0d26 100644
--- a/libc/debug/tst-backtrace2.c
+++ b/libc/debug/tst-backtrace2.c
@@ -22,27 +22,15 @@
#include <stdlib.h>
#include <string.h>
+#include "tst-backtrace.h"
+
static int do_test (void);
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
-/* Set to a non-zero value if the test fails. */
-int ret;
-
-/* Accesses to X are used to prevent optimization. */
-volatile int x;
-
-/* Called if the test fails. */
-#define FAIL() \
- do { printf ("Failure on line %d\n", __LINE__); ret = 1; } while (0)
-
/* The backtrace should include at least f1, f2, f3, and do_test. */
#define NUM_FUNCTIONS 4
-/* Use this attribute to prevent inlining, so that all expected frames
- are present. */
-#define NO_INLINE __attribute__ ((noinline))
-
NO_INLINE void
fn1 (void)
{
@@ -71,14 +59,14 @@ fn1 (void)
for (i = 0; i < n; ++i)
printf ("Function %d: %s\n", i, symbols[i]);
/* Check that the function names obtained are accurate. */
- if (strstr (symbols[0], "fn1") == NULL)
+ if (!match (symbols[0], "fn1"))
{
FAIL ();
return;
}
/* Symbol names are not available for static functions, so we do not
check f2. */
- if (strstr (symbols[2], "fn3") == NULL)
+ if (!match (symbols[2], "fn3"))
{
FAIL ();
return;
diff --git a/libc/debug/tst-backtrace3.c b/libc/debug/tst-backtrace3.c
index 4d3309b3a..182f42392 100644
--- a/libc/debug/tst-backtrace3.c
+++ b/libc/debug/tst-backtrace3.c
@@ -22,27 +22,15 @@
#include <stdlib.h>
#include <string.h>
+#include "tst-backtrace.h"
+
static int do_test (void);
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
-/* Set to a non-zero value if the test fails. */
-int ret;
-
-/* Accesses to X are used to prevent optimization. */
-volatile int x;
-
-/* Called if the test fails. */
-#define FAIL() \
- do { printf ("Failure on line %d\n", __LINE__); ret = 1; } while (0)
-
/* The backtrace should include at least 3 * fn, and do_test. */
#define NUM_FUNCTIONS 4
-/* Use this attribute to prevent inlining, so that all expected frames
- are present. */
-#define NO_INLINE __attribute__ ((noinline))
-
NO_INLINE int
fn (int c)
{
@@ -77,7 +65,7 @@ fn (int c)
printf ("Function %d: %s\n", i, symbols[i]);
/* Check that the function names obtained are accurate. */
for (i = 0; i < n - 1; ++i)
- if (strstr (symbols[i], "fn") == NULL)
+ if (!match (symbols[i], "fn"))
{
FAIL ();
return 1;
diff --git a/libc/debug/tst-backtrace4.c b/libc/debug/tst-backtrace4.c
index 41a3f5134..9c0c2a2a7 100644
--- a/libc/debug/tst-backtrace4.c
+++ b/libc/debug/tst-backtrace4.c
@@ -25,28 +25,16 @@
#include <signal.h>
#include <unistd.h>
+#include "tst-backtrace.h"
+
static int do_test (void);
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
-/* Set to a non-zero value if the test fails. */
-volatile int ret;
-
-/* Accesses to X are used to prevent optimization. */
-volatile int x;
-
-/* Called if the test fails. */
-#define FAIL() \
- do { printf ("Failure on line %d\n", __LINE__); ret = 1; } while (0)
-
/* The backtrace should include at least handle_signal, a signal
trampoline, 3 * fn, and do_test. */
#define NUM_FUNCTIONS 6
-/* Use this attribute to prevent inlining, so that all expected frames
- are present. */
-#define NO_INLINE __attribute__ ((noinline))
-
volatile int sig_handled = 0;
void
@@ -79,14 +67,14 @@ handle_signal (int signum)
for (i = 0; i < n; ++i)
printf ("Function %d: %s\n", i, symbols[i]);
/* Check that the function names obtained are accurate. */
- if (strstr (symbols[0], "handle_signal") == NULL)
+ if (!match (symbols[0], "handle_signal"))
{
FAIL ();
return;
}
/* Do not check name for signal trampoline. */
for (i = 2; i < n - 1; i++)
- if (strstr (symbols[i], "fn") == NULL)
+ if (!match (symbols[i], "fn"))
{
FAIL ();
return;
diff --git a/libc/debug/tst-backtrace5.c b/libc/debug/tst-backtrace5.c
index eb16c23ce..ca47437d9 100644
--- a/libc/debug/tst-backtrace5.c
+++ b/libc/debug/tst-backtrace5.c
@@ -26,28 +26,16 @@
#include <signal.h>
#include <unistd.h>
+#include "tst-backtrace.h"
+
static int do_test (void);
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
-/* Set to a non-zero value if the test fails. */
-volatile int ret;
-
-/* Accesses to X are used to prevent optimization. */
-volatile int x;
-
-/* Called if the test fails. */
-#define FAIL() \
- do { printf ("Failure on line %d\n", __LINE__); ret = 1; } while (0)
-
/* The backtrace should include at least handle_signal, a signal
trampoline, read, 3 * fn, and do_test. */
#define NUM_FUNCTIONS 7
-/* Use this attribute to prevent inlining, so that all expected frames
- are present. */
-#define NO_INLINE __attribute__ ((noinline))
-
void
handle_signal (int signum)
{
@@ -76,24 +64,24 @@ handle_signal (int signum)
for (i = 0; i < n; ++i)
printf ("Function %d: %s\n", i, symbols[i]);
/* Check that the function names obtained are accurate. */
- if (strstr (symbols[0], "handle_signal") == NULL)
+ if (!match (symbols[0], "handle_signal"))
{
FAIL ();
return;
}
/* Do not check name for signal trampoline. */
i = 2;
- if (strstr (symbols[i++], "read") == NULL)
+ if (!match (symbols[i++], "read"))
{
/* Perhaps symbols[2] is __kernel_vsyscall? */
- if (strstr (symbols[i++], "read") == NULL)
+ if (!match (symbols[i++], "read"))
{
FAIL ();
return;
}
}
for (; i < n - 1; i++)
- if (strstr (symbols[i], "fn") == NULL)
+ if (!match (symbols[i], "fn"))
{
FAIL ();
return;
diff --git a/libc/elf/Makefile b/libc/elf/Makefile
index c2b792b5c..f47541389 100644
--- a/libc/elf/Makefile
+++ b/libc/elf/Makefile
@@ -849,6 +849,9 @@ LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack
LDFLAGS-tst-execstack-prog = -Wl,-z,execstack
endif
+LDFLAGS-tst-array2 = $(no-as-needed)
+LDFLAGS-tst-array5 = $(no-as-needed)
+
$(objpfx)tst-array1.out: tst-array1.exp $(objpfx)tst-array1
$(test-program-cmd) > $@
cmp $@ tst-array1.exp > /dev/null
diff --git a/libc/elf/Versions b/libc/elf/Versions
index 87e27c5a7..238399232 100644
--- a/libc/elf/Versions
+++ b/libc/elf/Versions
@@ -1,7 +1,7 @@
libc {
GLIBC_2.0 {
%ifdef EXPORT_UNWIND_FIND_FDE
- __register_frame_info; __deregister_frame_info;
+ __deregister_frame_info; __register_frame_info;
%endif
}
GLIBC_2.1 {
@@ -13,23 +13,23 @@ libc {
}
%ifdef EXPORT_UNWIND_FIND_FDE
GCC_3.0 {
- __register_frame_info_bases; __deregister_frame_info_bases;
+ __deregister_frame_info_bases; __register_frame_info_bases;
__register_frame_info_table_bases; _Unwind_Find_FDE;
}
%endif
GLIBC_PRIVATE {
# functions used in other libraries
_dl_addr;
- _dl_sym; _dl_vsym;
_dl_open_hook;
- __libc_dlopen_mode; __libc_dlsym; __libc_dlclose;
+ _dl_sym; _dl_vsym;
+ __libc_dlclose; __libc_dlopen_mode; __libc_dlsym;
}
}
ld {
GLIBC_2.0 {
# Function from libc.so which must be shared with libc.
- calloc; free; malloc; realloc; __libc_memalign;
+ __libc_memalign; calloc; free; malloc; realloc;
_r_debug;
}
@@ -50,16 +50,15 @@ ld {
GLIBC_PRIVATE {
# Those are in the dynamic linker, but used by libc.so.
__libc_enable_secure;
- _dl_argv;
- _dl_out_of_memory;
- _dl_starting_up;
+ _dl_allocate_tls; _dl_allocate_tls_init;
+ _dl_argv; _dl_find_dso_for_object; _dl_get_tls_static_info;
+ _dl_deallocate_tls; _dl_make_stack_executable; _dl_out_of_memory;
+ _dl_rtld_di_serinfo; _dl_starting_up; _dl_tls_setup;
_rtld_global; _rtld_global_ro;
- _dl_allocate_tls; _dl_deallocate_tls;
- _dl_get_tls_static_info; _dl_allocate_tls_init;
- _dl_tls_setup; _dl_rtld_di_serinfo;
- _dl_make_stack_executable;
+
# Only here for gdb while a better method is developed.
_dl_debug_state;
+
# Pointer protection.
__pointer_chk_guard;
}
diff --git a/libc/elf/cache.c b/libc/elf/cache.c
index 990195272..699550bb6 100644
--- a/libc/elf/cache.c
+++ b/libc/elf/cache.c
@@ -100,6 +100,10 @@ print_entry (const char *lib, int flag, unsigned int osversion,
case FLAG_AARCH64_LIB64:
fputs (",AArch64", stdout);
break;
+ /* Uses the ARM soft-float ABI. */
+ case FLAG_ARM_LIBSF:
+ fputs (",soft-float", stdout);
+ break;
case 0:
break;
default:
diff --git a/libc/elf/dl-addr.c b/libc/elf/dl-addr.c
index 91cc44343..a53346627 100644
--- a/libc/elf/dl-addr.c
+++ b/libc/elf/dl-addr.c
@@ -130,18 +130,14 @@ _dl_addr (const void *address, Dl_info *info,
/* Protect against concurrent loads and unloads. */
__rtld_lock_lock_recursive (GL(dl_load_lock));
- /* Find the highest-addressed object that ADDRESS is not below. */
- for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
- for (struct link_map *l = GL(dl_ns)[ns]._ns_loaded; l; l = l->l_next)
- if (addr >= l->l_map_start && addr < l->l_map_end
- && (l->l_contiguous || _dl_addr_inside_object (l, addr)))
- {
- determine_info (addr, l, info, mapp, symbolp);
- result = 1;
- goto out;
- }
+ struct link_map *l = _dl_find_dso_for_object (addr);
+
+ if (l)
+ {
+ determine_info (addr, l, info, mapp, symbolp);
+ result = 1;
+ }
- out:
__rtld_lock_unlock_recursive (GL(dl_load_lock));
return result;
diff --git a/libc/elf/dl-cache.c b/libc/elf/dl-cache.c
index cbde348f9..404aa942f 100644
--- a/libc/elf/dl-cache.c
+++ b/libc/elf/dl-cache.c
@@ -172,8 +172,9 @@ _dl_cache_libcmp (const char *p1, const char *p2)
}
-/* Look up NAME in ld.so.cache and return the file name stored there,
- or null if none is found. */
+/* Look up NAME in ld.so.cache and return the file name stored there, or null
+ if none is found. The cache is loaded if it was not already. If loading
+ the cache previously failed there will be no more attempts to load it. */
const char *
internal_function
diff --git a/libc/elf/dl-deps.c b/libc/elf/dl-deps.c
index e0ac8925e..1916f96df 100644
--- a/libc/elf/dl-deps.c
+++ b/libc/elf/dl-deps.c
@@ -155,9 +155,7 @@ _dl_map_object_deps (struct link_map *map,
const char *errstring;
const char *objname;
- auto inline void preload (struct link_map *map);
-
- inline void preload (struct link_map *map)
+ void preload (struct link_map *map)
{
known[nlist].done = 0;
known[nlist].map = map;
diff --git a/libc/elf/dl-hwcaps.c b/libc/elf/dl-hwcaps.c
index 3805949e8..8d49383d7 100644
--- a/libc/elf/dl-hwcaps.c
+++ b/libc/elf/dl-hwcaps.c
@@ -42,7 +42,6 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
size_t cnt = platform != NULL;
size_t n, m;
size_t total;
- struct r_strlenpair *temp;
struct r_strlenpair *result;
struct r_strlenpair *rp;
char *cp;
@@ -52,7 +51,7 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
if ((masked & (1ULL << n)) != 0)
++cnt;
-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+#ifdef NEED_DL_SYSINFO_DSO
/* The system-supplied DSO can contain a note of type 2, vendor "GNU".
This gives us a list of names to treat as fake hwcap bits. */
@@ -103,9 +102,9 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
++cnt;
/* Create temporary data structure to generate result table. */
- temp = (struct r_strlenpair *) alloca (cnt * sizeof (*temp));
+ struct r_strlenpair temp[cnt];
m = 0;
-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+#ifdef NEED_DL_SYSINFO_DSO
if (dsocaps != NULL)
{
const ElfW(Word) mask = ((const ElfW(Word) *) dsocaps)[-1];
@@ -199,7 +198,7 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
}
/* Fill in the information. This follows the following scheme
- (indeces from TEMP for four strings):
+ (indices from TEMP for four strings):
entry #0: 0, 1, 2, 3 binary: 1111
#1: 0, 1, 3 1101
#2: 0, 2, 3 1011
diff --git a/libc/elf/dl-open.c b/libc/elf/dl-open.c
index 82e8e0a81..75cb6ab87 100644
--- a/libc/elf/dl-open.c
+++ b/libc/elf/dl-open.c
@@ -28,7 +28,6 @@
#include <sys/param.h>
#include <bits/libc-lock.h>
#include <ldsodefs.h>
-#include <bp-sym.h>
#include <caller.h>
#include <sysdep-cancel.h>
#include <tls.h>
@@ -43,7 +42,7 @@ extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
ElfW(Word) phnum,
ElfW(Addr) *user_entry,
ElfW(auxv_t) *auxv));
-weak_extern (BP_SYM (_dl_sysdep_start))
+weak_extern (_dl_sysdep_start)
extern int __libc_multiple_libcs; /* Defined in init-first.c. */
@@ -166,6 +165,29 @@ add_to_global (struct link_map *new)
return 0;
}
+/* Search link maps in all namespaces for the DSO that containes the object at
+ address ADDR. Returns the pointer to the link map of the matching DSO, or
+ NULL if a match is not found. */
+struct link_map *
+internal_function
+_dl_find_dso_for_object (const ElfW(Addr) addr)
+{
+ struct link_map *l;
+
+ /* Find the highest-addressed object that ADDR is not below. */
+ for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
+ for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
+ if (addr >= l->l_map_start && addr < l->l_map_end
+ && (l->l_contiguous
+ || _dl_addr_inside_object (l, (ElfW(Addr)) addr)))
+ {
+ assert (ns == l->l_ns);
+ return l;
+ }
+ return NULL;
+}
+rtld_hidden_def (_dl_find_dso_for_object);
+
static void
dl_open_worker (void *a)
{
@@ -195,20 +217,11 @@ dl_open_worker (void *a)
call_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
#endif
- struct link_map *l;
- for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
- for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
- if (caller_dlopen >= (const void *) l->l_map_start
- && caller_dlopen < (const void *) l->l_map_end
- && (l->l_contiguous
- || _dl_addr_inside_object (l, (ElfW(Addr)) caller_dlopen)))
- {
- assert (ns == l->l_ns);
- call_map = l;
- goto found_caller;
- }
+ struct link_map *l = _dl_find_dso_for_object ((ElfW(Addr)) caller_dlopen);
+
+ if (l)
+ call_map = l;
- found_caller:
if (args->nsid == __LM_ID_CALLER)
{
#ifndef SHARED
diff --git a/libc/elf/dl-runtime.c b/libc/elf/dl-runtime.c
index 9ac272610..828474838 100644
--- a/libc/elf/dl-runtime.c
+++ b/libc/elf/dl-runtime.c
@@ -62,9 +62,7 @@ _dl_fixup (
# ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
ELF_MACHINE_RUNTIME_FIXUP_ARGS,
# endif
- /* GKM FIXME: Fix trampoline to pass bounds so we can do
- without the `__unbounded' qualifier. */
- struct link_map *__unbounded l, ElfW(Word) reloc_arg)
+ struct link_map *l, ElfW(Word) reloc_arg)
{
const ElfW(Sym) *const symtab
= (const void *) D_PTR (l, l_info[DT_SYMTAB]);
@@ -150,7 +148,7 @@ _dl_fixup (
return elf_machine_fixup_plt (l, result, reloc, rel_addr, value);
}
-#if !defined PROF && !__BOUNDED_POINTERS__
+#ifndef PROF
DL_FIXUP_VALUE_TYPE
__attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE
_dl_profile_fixup (
diff --git a/libc/elf/dl-support.c b/libc/elf/dl-support.c
index 9f013e320..df8524530 100644
--- a/libc/elf/dl-support.c
+++ b/libc/elf/dl-support.c
@@ -161,7 +161,7 @@ struct dl_scope_free_list *_dl_scope_free_list;
/* Needed for improved syscall handling on at least x86/Linux. */
uintptr_t _dl_sysinfo = DL_SYSINFO_DEFAULT;
#endif
-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+#ifdef NEED_DL_SYSINFO_DSO
/* Address of the ELF headers in the vsyscall page. */
const ElfW(Ehdr) *_dl_sysinfo_dso;
@@ -220,7 +220,7 @@ _dl_aux_init (ElfW(auxv_t) *av)
GL(dl_sysinfo) = av->a_un.a_val;
break;
#endif
-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+#ifdef NEED_DL_SYSINFO_DSO
case AT_SYSINFO_EHDR:
GL(dl_sysinfo_dso) = (void *) av->a_un.a_val;
break;
diff --git a/libc/elf/dl-sym.c b/libc/elf/dl-sym.c
index d2b4db7ec..05de6c1c0 100644
--- a/libc/elf/dl-sym.c
+++ b/libc/elf/dl-sym.c
@@ -91,20 +91,10 @@ do_sym (void *handle, const char *name, void *who,
lookup_t result;
ElfW(Addr) caller = (ElfW(Addr)) who;
+ struct link_map *l = _dl_find_dso_for_object (caller);
/* If the address is not recognized the call comes from the main
program (we hope). */
- struct link_map *match = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
-
- /* Find the highest-addressed object that CALLER is not below. */
- for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
- for (struct link_map *l = GL(dl_ns)[ns]._ns_loaded; l != NULL;
- l = l->l_next)
- if (caller >= l->l_map_start && caller < l->l_map_end
- && (l->l_contiguous || _dl_addr_inside_object (l, caller)))
- {
- match = l;
- break;
- }
+ struct link_map *match = l ? l : GL(dl_ns)[LM_ID_BASE]._ns_loaded;
if (handle == RTLD_DEFAULT)
{
diff --git a/libc/elf/dl-sysdep.c b/libc/elf/dl-sysdep.c
index 42bc8145d..d8f3dd2fb 100644
--- a/libc/elf/dl-sysdep.c
+++ b/libc/elf/dl-sysdep.c
@@ -167,7 +167,7 @@ _dl_sysdep_start (void **start_argptr,
new_sysinfo = av->a_un.a_val;
break;
#endif
-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+#ifdef NEED_DL_SYSINFO_DSO
case AT_SYSINFO_EHDR:
GLRO(dl_sysinfo_dso) = (void *) av->a_un.a_val;
break;
diff --git a/libc/elf/elf.h b/libc/elf/elf.h
index 9bc5004c1..d096a97e7 100644
--- a/libc/elf/elf.h
+++ b/libc/elf/elf.h
@@ -2343,23 +2343,25 @@ typedef Elf32_Addr Elf32_Conflict;
/* ARM relocs. */
#define R_ARM_NONE 0 /* No reloc */
-#define R_ARM_PC24 1 /* PC relative 26 bit branch */
+#define R_ARM_PC24 1 /* Deprecated PC relative 26
+ bit branch. */
#define R_ARM_ABS32 2 /* Direct 32 bit */
#define R_ARM_REL32 3 /* PC relative 32 bit */
#define R_ARM_PC13 4
#define R_ARM_ABS16 5 /* Direct 16 bit */
#define R_ARM_ABS12 6 /* Direct 12 bit */
-#define R_ARM_THM_ABS5 7
+#define R_ARM_THM_ABS5 7 /* Direct & 0x7C (LDR, STR). */
#define R_ARM_ABS8 8 /* Direct 8 bit */
#define R_ARM_SBREL32 9
-#define R_ARM_THM_PC22 10
-#define R_ARM_THM_PC8 11
+#define R_ARM_THM_PC22 10 /* PC relative 24 bit (Thumb32 BL). */
+#define R_ARM_THM_PC8 11 /* PC relative & 0x3FC
+ (Thumb16 LDR, ADD, ADR). */
#define R_ARM_AMP_VCALL9 12
#define R_ARM_SWI24 13 /* Obsolete static relocation. */
#define R_ARM_TLS_DESC 13 /* Dynamic relocation. */
-#define R_ARM_THM_SWI8 14
-#define R_ARM_XPC25 15
-#define R_ARM_THM_XPC22 16
+#define R_ARM_THM_SWI8 14 /* Reserved. */
+#define R_ARM_XPC25 15 /* Reserved. */
+#define R_ARM_THM_XPC22 16 /* Reserved. */
#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */
#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */
#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */
@@ -2370,21 +2372,109 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */
#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */
#define R_ARM_GOT32 26 /* 32 bit GOT entry */
-#define R_ARM_PLT32 27 /* 32 bit PLT address */
-#define R_ARM_ALU_PCREL_7_0 32
-#define R_ARM_ALU_PCREL_15_8 33
-#define R_ARM_ALU_PCREL_23_15 34
-#define R_ARM_LDR_SBREL_11_0 35
-#define R_ARM_ALU_SBREL_19_12 36
-#define R_ARM_ALU_SBREL_27_20 37
+#define R_ARM_PLT32 27 /* Deprecated, 32 bit PLT address. */
+#define R_ARM_CALL 28 /* PC relative 24 bit (BL, BLX). */
+#define R_ARM_JUMP24 29 /* PC relative 24 bit
+ (B, BL<cond>). */
+#define R_ARM_THM_JUMP24 30 /* PC relative 24 bit (Thumb32 B.W). */
+#define R_ARM_BASE_ABS 31 /* Adjust by program base. */
+#define R_ARM_ALU_PCREL_7_0 32 /* Obsolete. */
+#define R_ARM_ALU_PCREL_15_8 33 /* Obsolete. */
+#define R_ARM_ALU_PCREL_23_15 34 /* Obsolete. */
+#define R_ARM_LDR_SBREL_11_0 35 /* Deprecated, prog. base relative. */
+#define R_ARM_ALU_SBREL_19_12 36 /* Deprecated, prog. base relative. */
+#define R_ARM_ALU_SBREL_27_20 37 /* Deprecated, prog. base relative. */
+#define R_ARM_TARGET1 38
+#define R_ARM_SBREL31 39 /* Program base relative. */
+#define R_ARM_V4BX 40
+#define R_ARM_TARGET2 41
+#define R_ARM_PREL31 42 /* 32 bit PC relative. */
+#define R_ARM_MOVW_ABS_NC 43 /* Direct 16-bit (MOVW). */
+#define R_ARM_MOVT_ABS 44 /* Direct high 16-bit (MOVT). */
+#define R_ARM_MOVW_PREL_NC 45 /* PC relative 16-bit (MOVW). */
+#define R_ARM_MOVT_PREL 46 /* PC relative (MOVT). */
+#define R_ARM_THM_MOVW_ABS_NC 47 /* Direct 16 bit (Thumb32 MOVW). */
+#define R_ARM_THM_MOVT_ABS 48 /* Direct high 16 bit
+ (Thumb32 MOVT). */
+#define R_ARM_THM_MOVW_PREL_NC 49 /* PC relative 16 bit
+ (Thumb32 MOVW). */
+#define R_ARM_THM_MOVT_PREL 50 /* PC relative high 16 bit
+ (Thumb32 MOVT). */
+#define R_ARM_THM_JUMP19 51 /* PC relative 20 bit
+ (Thumb32 B<cond>.W). */
+#define R_ARM_THM_JUMP6 52 /* PC relative X & 0x7E
+ (Thumb16 CBZ, CBNZ). */
+#define R_ARM_THM_ALU_PREL_11_0 53 /* PC relative 12 bit
+ (Thumb32 ADR.W). */
+#define R_ARM_THM_PC12 54 /* PC relative 12 bit
+ (Thumb32 LDR{D,SB,H,SH}). */
+#define R_ARM_ABS32_NOI 55 /* Direct 32-bit. */
+#define R_ARM_REL32_NOI 56 /* PC relative 32-bit. */
+#define R_ARM_ALU_PC_G0_NC 57 /* PC relative (ADD, SUB). */
+#define R_ARM_ALU_PC_G0 58 /* PC relative (ADD, SUB). */
+#define R_ARM_ALU_PC_G1_NC 59 /* PC relative (ADD, SUB). */
+#define R_ARM_ALU_PC_G1 60 /* PC relative (ADD, SUB). */
+#define R_ARM_ALU_PC_G2 61 /* PC relative (ADD, SUB). */
+#define R_ARM_LDR_PC_G1 62 /* PC relative (LDR,STR,LDRB,STRB). */
+#define R_ARM_LDR_PC_G2 63 /* PC relative (LDR,STR,LDRB,STRB). */
+#define R_ARM_LDRS_PC_G0 64 /* PC relative (STR{D,H},
+ LDR{D,SB,H,SH}). */
+#define R_ARM_LDRS_PC_G1 65 /* PC relative (STR{D,H},
+ LDR{D,SB,H,SH}). */
+#define R_ARM_LDRS_PC_G2 66 /* PC relative (STR{D,H},
+ LDR{D,SB,H,SH}). */
+#define R_ARM_LDC_PC_G0 67 /* PC relative (LDC, STC). */
+#define R_ARM_LDC_PC_G1 68 /* PC relative (LDC, STC). */
+#define R_ARM_LDC_PC_G2 69 /* PC relative (LDC, STC). */
+#define R_ARM_ALU_SB_G0_NC 70 /* Program base relative (ADD,SUB). */
+#define R_ARM_ALU_SB_G0 71 /* Program base relative (ADD,SUB). */
+#define R_ARM_ALU_SB_G1_NC 72 /* Program base relative (ADD,SUB). */
+#define R_ARM_ALU_SB_G1 73 /* Program base relative (ADD,SUB). */
+#define R_ARM_ALU_SB_G2 74 /* Program base relative (ADD,SUB). */
+#define R_ARM_LDR_SB_G0 75 /* Program base relative (LDR,
+ STR, LDRB, STRB). */
+#define R_ARM_LDR_SB_G1 76 /* Program base relative
+ (LDR, STR, LDRB, STRB). */
+#define R_ARM_LDR_SB_G2 77 /* Program base relative
+ (LDR, STR, LDRB, STRB). */
+#define R_ARM_LDRS_SB_G0 78 /* Program base relative
+ (LDR, STR, LDRB, STRB). */
+#define R_ARM_LDRS_SB_G1 79 /* Program base relative
+ (LDR, STR, LDRB, STRB). */
+#define R_ARM_LDRS_SB_G2 80 /* Program base relative
+ (LDR, STR, LDRB, STRB). */
+#define R_ARM_LDC_SB_G0 81 /* Program base relative (LDC,STC). */
+#define R_ARM_LDC_SB_G1 82 /* Program base relative (LDC,STC). */
+#define R_ARM_LDC_SB_G2 83 /* Program base relative (LDC,STC). */
+#define R_ARM_MOVW_BREL_NC 84 /* Program base relative 16
+ bit (MOVW). */
+#define R_ARM_MOVT_BREL 85 /* Program base relative high
+ 16 bit (MOVT). */
+#define R_ARM_MOVW_BREL 86 /* Program base relative 16
+ bit (MOVW). */
+#define R_ARM_THM_MOVW_BREL_NC 87 /* Program base relative 16
+ bit (Thumb32 MOVW). */
+#define R_ARM_THM_MOVT_BREL 88 /* Program base relative high
+ 16 bit (Thumb32 MOVT). */
+#define R_ARM_THM_MOVW_BREL 89 /* Program base relative 16
+ bit (Thumb32 MOVW). */
#define R_ARM_TLS_GOTDESC 90
#define R_ARM_TLS_CALL 91
-#define R_ARM_TLS_DESCSEQ 92
+#define R_ARM_TLS_DESCSEQ 92 /* TLS relaxation. */
#define R_ARM_THM_TLS_CALL 93
+#define R_ARM_PLT32_ABS 94
+#define R_ARM_GOT_ABS 95 /* GOT entry. */
+#define R_ARM_GOT_PREL 96 /* PC relative GOT entry. */
+#define R_ARM_GOT_BREL12 97 /* GOT entry relative to GOT
+ origin (LDR). */
+#define R_ARM_GOTOFF12 98 /* 12 bit, GOT entry relative
+ to GOT origin (LDR, STR). */
+#define R_ARM_GOTRELAX 99
#define R_ARM_GNU_VTENTRY 100
#define R_ARM_GNU_VTINHERIT 101
-#define R_ARM_THM_PC11 102 /* thumb unconditional branch */
-#define R_ARM_THM_PC9 103 /* thumb conditional branch */
+#define R_ARM_THM_PC11 102 /* PC relative & 0xFFE (Thumb16 B). */
+#define R_ARM_THM_PC9 103 /* PC relative & 0x1FE
+ (Thumb16 B/B<cond>). */
#define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic
thread local data */
#define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic
@@ -2395,7 +2485,18 @@ typedef Elf32_Addr Elf32_Conflict;
static TLS block offset */
#define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static
TLS block */
-#define R_ARM_THM_TLS_DESCSEQ 129
+#define R_ARM_TLS_LDO12 109 /* 12 bit relative to TLS
+ block (LDR, STR). */
+#define R_ARM_TLS_LE12 110 /* 12 bit relative to static
+ TLS block (LDR, STR). */
+#define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative
+ to GOT origin (LDR). */
+#define R_ARM_ME_TOO 128 /* Obsolete. */
+#define R_ARM_THM_TLS_DESCSEQ 129
+#define R_ARM_THM_TLS_DESCSEQ16 129
+#define R_ARM_THM_TLS_DESCSEQ32 130
+#define R_ARM_THM_GOT_BREL12 131 /* GOT entry relative to GOT
+ origin, 12 bit (Thumb32 LDR). */
#define R_ARM_IRELATIVE 160
#define R_ARM_RXPC25 249
#define R_ARM_RSBREL32 250
diff --git a/libc/elf/link.h b/libc/elf/link.h
index 500871f45..a50ba8366 100644
--- a/libc/elf/link.h
+++ b/libc/elf/link.h
@@ -86,7 +86,8 @@ struct link_map
/* These first few members are part of the protocol with the debugger.
This is the same format used in SVR4. */
- ElfW(Addr) l_addr; /* Base address shared object is loaded at. */
+ ElfW(Addr) l_addr; /* Difference between the address in the ELF
+ file and the addresses in memory. */
char *l_name; /* Absolute file name object was found in. */
ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
diff --git a/libc/elf/pldd.c b/libc/elf/pldd.c
index b09252d39..d9388a19c 100644
--- a/libc/elf/pldd.c
+++ b/libc/elf/pldd.c
@@ -43,10 +43,7 @@ extern char *program_invocation_short_name;
#define PACKAGE _libc_intl_domainname
/* External functions. */
-extern void *xmalloc (size_t n)
- __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xrealloc (void *o, size_t n)
- __attribute_malloc__ __attribute_alloc_size (2);
+#include <programs/xmalloc.h>
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
diff --git a/libc/elf/rtld.c b/libc/elf/rtld.c
index 1cedc13e5..f27771f78 100644
--- a/libc/elf/rtld.c
+++ b/libc/elf/rtld.c
@@ -1769,7 +1769,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
GL(dl_rtld_map).l_next = (i + 1 < main_map->l_searchlist.r_nlist
? main_map->l_searchlist.r_list[i + 1]
: NULL);
-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+#ifdef NEED_DL_SYSINFO_DSO
if (GLRO(dl_sysinfo_map) != NULL
&& GL(dl_rtld_map).l_prev->l_next == GLRO(dl_sysinfo_map)
&& GL(dl_rtld_map).l_next != GLRO(dl_sysinfo_map))
@@ -1881,7 +1881,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
if (dyn->d_tag == DT_NEEDED)
{
l = l->l_next;
-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+#ifdef NEED_DL_SYSINFO_DSO
/* Skip the VDSO since it's not part of the list
of objects we brought in via DT_NEEDED entries. */
if (l == GLRO(dl_sysinfo_map))
diff --git a/libc/elf/setup-vdso.h b/libc/elf/setup-vdso.h
index 1878fae15..a98dfeca3 100644
--- a/libc/elf/setup-vdso.h
+++ b/libc/elf/setup-vdso.h
@@ -20,7 +20,7 @@ static inline void __attribute__ ((always_inline))
setup_vdso (struct link_map *main_map __attribute__ ((unused)),
struct link_map ***first_preload __attribute__ ((unused)))
{
-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+#ifdef NEED_DL_SYSINFO_DSO
if (GLRO(dl_sysinfo_dso) == NULL)
return;
diff --git a/libc/elf/tlsdeschtab.h b/libc/elf/tlsdeschtab.h
index 8de986111..155f4fdd9 100644
--- a/libc/elf/tlsdeschtab.h
+++ b/libc/elf/tlsdeschtab.h
@@ -129,7 +129,7 @@ _dl_make_tlsdesc_dynamic (struct link_map *map, size_t ti_offset)
or a futex wake to wake up any waiting threads, but let's try to
avoid introducing such dependencies. */
-inline static int
+static int
_dl_tlsdesc_resolve_early_return_p (struct tlsdesc volatile *td, void *caller)
{
if (caller != td->entry)
@@ -147,7 +147,7 @@ _dl_tlsdesc_resolve_early_return_p (struct tlsdesc volatile *td, void *caller)
return 0;
}
-inline static void
+static void
_dl_tlsdesc_wake_up_held_fixups (void)
{
__rtld_lock_unlock_recursive (GL(dl_load_lock));
diff --git a/libc/elf/tst-stackguard1.c b/libc/elf/tst-stackguard1.c
index 2b4fd9a78..fba60bdc9 100644
--- a/libc/elf/tst-stackguard1.c
+++ b/libc/elf/tst-stackguard1.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <sys/wait.h>
#include <stackguard-macros.h>
+#include <tls.h>
#include <unistd.h>
static const char *command;
diff --git a/libc/hesiod/Depend b/libc/hesiod/Depend
new file mode 100644
index 000000000..0554b47da
--- /dev/null
+++ b/libc/hesiod/Depend
@@ -0,0 +1,2 @@
+nss
+resolv
diff --git a/libc/iconv/Versions b/libc/iconv/Versions
index 7f09ed49c..5d50cf11e 100644
--- a/libc/iconv/Versions
+++ b/libc/iconv/Versions
@@ -1,10 +1,10 @@
libc {
GLIBC_2.1 {
# i*
- iconv_open; iconv; iconv_close;
+ iconv; iconv_open; iconv_close;
}
GLIBC_PRIVATE {
# functions shared with iconv program
- __gconv_get_alias_db; __gconv_get_modules_db; __gconv_get_cache;
+ __gconv_get_alias_db; __gconv_get_cache; __gconv_get_modules_db;
}
}
diff --git a/libc/iconv/iconv_charmap.c b/libc/iconv/iconv_charmap.c
index 7a4067b81..b1a061097 100644
--- a/libc/iconv/iconv_charmap.c
+++ b/libc/iconv/iconv_charmap.c
@@ -32,10 +32,7 @@
/* Prototypes for a few program-wide used functions. */
-extern void *xmalloc (size_t n)
- __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
- __attribute_malloc__ __attribute_alloc_size (1, 2);
+#include <programs/xmalloc.h>
struct convtable
diff --git a/libc/iconv/iconvconfig.c b/libc/iconv/iconvconfig.c
index 318c917e9..677620b96 100644
--- a/libc/iconv/iconvconfig.c
+++ b/libc/iconv/iconvconfig.c
@@ -247,12 +247,7 @@ static struct
static const char gconv_module_ext[] = MODULE_EXT;
-extern void *xmalloc (size_t n)
- __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
- __attribute_malloc__ __attribute_alloc_size (1, 2);
-extern void *xrealloc (void *o, size_t n)
- __attribute_malloc__ __attribute_alloc_size (2);
+#include <programs/xmalloc.h>
/* C string table handling. */
diff --git a/libc/iconv/strtab.c b/libc/iconv/strtab.c
index 7160ac88a..c62553e2e 100644
--- a/libc/iconv/strtab.c
+++ b/libc/iconv/strtab.c
@@ -65,8 +65,7 @@ struct Strtab
static size_t ps;
-extern void *xmalloc (size_t n)
- __attribute_malloc__ __attribute_alloc_size (1);
+#include <programs/xmalloc.h>
/* Prototypes for our functions that are used from iconvconfig.c. If
you change these, change also iconvconfig.c. */
diff --git a/libc/include/errno.h b/libc/include/errno.h
index 98c608052..f1b93a881 100644
--- a/libc/include/errno.h
+++ b/libc/include/errno.h
@@ -17,7 +17,7 @@
# define errno rtld_errno
extern int rtld_errno attribute_hidden;
-# else
+# elif !defined NOT_IN_libc || defined IN_LIB
# include <tls.h>
@@ -29,7 +29,7 @@ extern int rtld_errno attribute_hidden;
# endif
extern __thread int errno attribute_tls_model_ie;
-# endif /* RTLD_PRIVATE_ERRNO */
+# endif /* !NOT_IN_libc || IN_LIB */
# define __set_errno(val) (errno = (val))
diff --git a/libc/include/libc-symbols.h b/libc/include/libc-symbols.h
index 583b65ff9..2c39bcbe8 100644
--- a/libc/include/libc-symbols.h
+++ b/libc/include/libc-symbols.h
@@ -228,8 +228,7 @@
/* A canned warning for sysdeps/stub functions. */
#define stub_warning(name) \
__make_section_unallocated (".gnu.glibc-stub." #name) \
- link_warning (name, \
- "warning: " #name " is not implemented and will always fail")
+ link_warning (name, #name " is not implemented and will always fail")
/* Warning for linking functions calling dlopen into static binaries. */
#ifdef SHARED
diff --git a/libc/include/link.h b/libc/include/link.h
index 12dcf038d..7dc3cd1e3 100644
--- a/libc/include/link.h
+++ b/libc/include/link.h
@@ -87,7 +87,8 @@ struct link_map
/* These first few members are part of the protocol with the debugger.
This is the same format used in SVR4. */
- ElfW(Addr) l_addr; /* Base address shared object is loaded at. */
+ ElfW(Addr) l_addr; /* Difference between the address in the ELF
+ file and the addresses in memory. */
char *l_name; /* Absolute file name object was found in. */
ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
@@ -301,6 +302,9 @@ struct link_map
/* Index of the module in the dtv array. */
size_t l_tls_modid;
+ /* Number of thread_local objects constructed by this DSO. */
+ size_t l_tls_dtor_count;
+
/* Information used to change permission after the relocations are
done. */
ElfW(Addr) l_relro_addr;
diff --git a/libc/include/netdb.h b/libc/include/netdb.h
index e0a63c77f..44067cfeb 100644
--- a/libc/include/netdb.h
+++ b/libc/include/netdb.h
@@ -3,18 +3,20 @@
#ifndef _ISOMAC
/* Macros for accessing h_errno from inside libc. */
-# undef h_errno
-# ifdef _LIBC_REENTRANT
-# include <tls.h>
-# ifndef NOT_IN_libc
-# define h_errno __libc_h_errno
-# else
-# define h_errno h_errno /* For #ifndef h_errno tests. */
-# endif
+# if !defined NOT_IN_libc || defined IN_LIB
+# undef h_errno
+# ifdef _LIBC_REENTRANT
+# include <tls.h>
+# ifndef NOT_IN_libc
+# define h_errno __libc_h_errno
+# else
+# define h_errno h_errno /* For #ifndef h_errno tests. */
+# endif
extern __thread int h_errno attribute_tls_model_ie;
-# else
+# else
extern int h_errno;
-# endif /* _LIBC_REENTRANT */
+# endif /* _LIBC_REENTRANT */
+# endif /* !NOT_IN_libc || IN_LIB */
# define __set_h_errno(x) (h_errno = (x))
libc_hidden_proto (hstrerror)
diff --git a/libc/include/programs/xmalloc.h b/libc/include/programs/xmalloc.h
new file mode 100644
index 000000000..f4278852b
--- /dev/null
+++ b/libc/include/programs/xmalloc.h
@@ -0,0 +1,33 @@
+/* Memory related definitions for program modules.
+ Copyright (C) 1998-2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _XMALLOC_H
+#define _XMALLOC_H 1
+
+#include <sys/cdefs.h>
+#include <stddef.h>
+
+/* Prototypes for a few program-wide used functions. */
+extern void *xmalloc (size_t n)
+ __attribute_malloc__ __attribute_alloc_size__ ((1));
+extern void *xcalloc (size_t n, size_t s)
+ __attribute_malloc__ __attribute_alloc_size__ ((1, 2));
+extern void *xrealloc (void *o, size_t n)
+ __attribute_malloc__ __attribute_alloc_size__ ((2));
+extern char *xstrdup (const char *) __attribute_malloc__;
+
+#endif /* xmalloc.h */
diff --git a/libc/include/rounding-mode.h b/libc/include/rounding-mode.h
index 2f1ab55a8..c76555197 100644
--- a/libc/include/rounding-mode.h
+++ b/libc/include/rounding-mode.h
@@ -39,7 +39,7 @@
MORE_BITS is true if the number is not exactly equal to the
truncated value or the half-way value, false otherwise. */
-static inline bool
+static bool
round_away (bool negative, bool last_digit_odd, bool half_bit, bool more_bits,
int mode)
{
diff --git a/libc/include/set-hooks.h b/libc/include/set-hooks.h
index 5c751ee37..e58f444d4 100644
--- a/libc/include/set-hooks.h
+++ b/libc/include/set-hooks.h
@@ -41,7 +41,7 @@
# define RUN_HOOK(NAME, ARGS) \
do { \
- void *const *__unbounded ptr; \
+ void *const *ptr; \
for (ptr = (void *const *) symbol_set_first_element (NAME); \
! symbol_set_end_p (NAME, ptr); ++ptr) \
(*(__##NAME##_hook_function_t *) *ptr) ARGS; \
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index 2e536641b..db1812d85 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -100,6 +100,11 @@ extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
extern int __cxa_atexit_internal (void (*func) (void *), void *arg, void *d)
attribute_hidden;
+extern int __cxa_thread_atexit_impl (void (*func) (void *), void *arg,
+ void *d);
+extern void __call_tls_dtors (void);
+libc_hidden_proto (__call_tls_dtors);
+
extern void __cxa_finalize (void *d);
extern int __posix_memalign (void **memptr, size_t alignment, size_t size);
diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index 71baa1a2d..524fe57a2 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -13,8 +13,6 @@ extern void __chk_fail (void) __attribute__ ((__noreturn__));
libc_hidden_proto (__chk_fail)
rtld_hidden_proto (__chk_fail)
-
-# define __attribute_alloc_size(...) __attribute__ ((alloc_size (__VA_ARGS__)))
#endif
#endif
diff --git a/libc/intl/Makefile b/libc/intl/Makefile
index 3807d89aa..ac2eaa122 100644
--- a/libc/intl/Makefile
+++ b/libc/intl/Makefile
@@ -118,9 +118,6 @@ $(addprefix $(objpfx),$(multithread-test-srcs)): $(shared-thread-library)
else
$(addprefix $(objpfx),$(multithread-test-srcs)): $(static-thread-library)
endif
-ifeq (yes,$(build-bounded))
-$(multithread-test-srcs:%=$(objpfx)%-bp): $(bounded-thread-library)
-endif
endif
$(objpfx)tst-translit.out: $(objpfx)tst-gettext.out
diff --git a/libc/io/lseek.c b/libc/io/lseek.c
index b65c50dae..63cd75fd5 100644
--- a/libc/io/lseek.c
+++ b/libc/io/lseek.c
@@ -21,7 +21,7 @@
/* Seek to OFFSET on FD, starting from WHENCE. */
off_t
-__lseek (fd, offset, whence)
+__libc_lseek (fd, offset, whence)
int fd;
off_t offset;
int whence;
@@ -45,7 +45,8 @@ __lseek (fd, offset, whence)
__set_errno (ENOSYS);
return -1;
}
+weak_alias (__libc_lseek, __lseek)
+weak_alias (__libc_lseek, lseek)
stub_warning (lseek)
-libc_hidden_def (__lseek)
-weak_alias (__lseek, lseek)
+libc_hidden_def (__lseek)
diff --git a/libc/libio/wfileops.c b/libc/libio/wfileops.c
index 9cd039921..d59abbdce 100644
--- a/libc/libio/wfileops.c
+++ b/libc/libio/wfileops.c
@@ -551,7 +551,7 @@ libc_hidden_def (_IO_wfile_sync)
fp->_wide_data->_IO_read_base and fp->_wide_data->_IO_read_end.
Returns 0 on success and -1 on error with the _IO_ERR_SEEN flag set. */
-static inline int
+static int
adjust_wide_data (_IO_FILE *fp, bool do_convert)
{
struct _IO_codecvt *cv = fp->_codecvt;
diff --git a/libc/locale/elem-hash.h b/libc/locale/elem-hash.h
index 4343ef561..eb53c1ee3 100644
--- a/libc/locale/elem-hash.h
+++ b/libc/locale/elem-hash.h
@@ -18,7 +18,7 @@
/* The hashing function used for the table with collation symbols. */
-static inline int32_t
+static int32_t __attribute__ ((pure, unused))
elem_hash (const char *str, int_fast32_t n)
{
int32_t result = n;
diff --git a/libc/locale/programs/locale.c b/libc/locale/programs/locale.c
index 13e523495..8dc528c11 100644
--- a/libc/locale/programs/locale.c
+++ b/libc/locale/programs/locale.c
@@ -42,10 +42,7 @@
#include "localeinfo.h"
#include "charmap-dir.h"
#include "../locarchive.h"
-
-extern void *xmalloc (size_t n)
- __attribute_malloc__ __attribute_alloc_size (1);
-extern char *xstrdup (const char *) __attribute_malloc__;
+#include <programs/xmalloc.h>
#define ARCHIVE_NAME LOCALEDIR "/locale-archive"
diff --git a/libc/locale/programs/localedef.h b/libc/locale/programs/localedef.h
index 7ca65c663..e010c7298 100644
--- a/libc/locale/programs/localedef.h
+++ b/libc/locale/programs/localedef.h
@@ -120,13 +120,7 @@ extern const char *alias_file;
/* Prototypes for a few program-wide used functions. */
-extern void *xmalloc (size_t n)
- __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
- __attribute_malloc__ __attribute_alloc_size (1, 2);
-extern void *xrealloc (void *o, size_t n)
- __attribute_malloc__ __attribute_alloc_size (2);
-extern char *xstrdup (const char *) __attribute_malloc__;
+#include <programs/xmalloc.h>
/* Wrapper to switch LC_CTYPE back to the locale specified in the
diff --git a/libc/locale/programs/locarchive.c b/libc/locale/programs/locarchive.c
index d5f204e19..4cd1ac259 100644
--- a/libc/locale/programs/locarchive.c
+++ b/libc/locale/programs/locarchive.c
@@ -45,7 +45,7 @@
/* Define the hash function. We define the function as static inline.
We must change the name so as not to conflict with simple-hash.h. */
-#define compute_hashval static inline archive_hashval
+#define compute_hashval static archive_hashval
#define hashval_t uint32_t
#include "hashval.h"
#undef compute_hashval
diff --git a/libc/locale/programs/simple-hash.c b/libc/locale/programs/simple-hash.c
index 530ba724e..d65b6fb3f 100644
--- a/libc/locale/programs/simple-hash.c
+++ b/libc/locale/programs/simple-hash.c
@@ -52,10 +52,7 @@
#define hashval_t uint32_t
#include "hashval.h"
-extern void *xmalloc (size_t n)
- __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
- __attribute_malloc__ __attribute_alloc_size (1, 2);
+#include <programs/xmalloc.h>
typedef struct hash_entry
{
diff --git a/libc/locale/setlocale.c b/libc/locale/setlocale.c
index 9155e08dc..f92faee31 100644
--- a/libc/locale/setlocale.c
+++ b/libc/locale/setlocale.c
@@ -174,7 +174,7 @@ setname (int category, const char *name)
}
/* Put DATA in *_nl_current[CATEGORY]. */
-static inline void
+static void
setdata (int category, struct __locale_data *data)
{
if (CATEGORY_USED (category))
diff --git a/libc/localedata/CHECKSUMS b/libc/localedata/CHECKSUMS
deleted file mode 100644
index c0914ebc9..000000000
--- a/libc/localedata/CHECKSUMS
+++ /dev/null
@@ -1,424 +0,0 @@
-de03b81861a80e9fef5c1133360843bb charmaps/ANSI_X3.110-1983
-9cdbf98f2ef33457957ebcaf6a1f8cf4 charmaps/ANSI_X3.4-1968
-951fd6220705423baf0b8a5a102e3352 charmaps/ARMSCII-8
-c2316daf6629c132ba4e6fdadb0e6503 charmaps/ASMO_449
-33f96ca46035ae74ef4b231c5e42acd8 charmaps/BIG5
-56da6c91734e160c7931d268c37438fc charmaps/BIG5-HKSCS
-798dd6b57c3d0c122211aab2fab5736e charmaps/BS_4730
-09f7a9187907a3f3fcfaae8906b01579 charmaps/BS_VIEWDATA
-11013c76150d062df1a5fe899a614cf0 charmaps/CP10007
-284549ebab7699ddde23d273641751b9 charmaps/CP1125
-592572e42aa242f2f30f227bccc5afb0 charmaps/CP1250
-ad9dd6c3f4eaa95fe949fae0a5c1745d charmaps/CP1251
-b24132834355a7d7841a82aed7a83cda charmaps/CP1252
-2f2053bf482cdac273277a292653bdf6 charmaps/CP1253
-d859cd8d447aedcdf7c09c299a6469bf charmaps/CP1254
-c8ed5f1b2cfc26a3370697450be33943 charmaps/CP1255
-9b8e16bde8b9449f8f72bfa7fc7eb772 charmaps/CP1256
-c2d246cb44be36163085e5c6f04a31bc charmaps/CP1257
-1cdd6799992c1d9e238e78bb386876fe charmaps/CP1258
-a4ca07fac87e0c813e77f0cf95daecdb charmaps/CP737
-039969caf1003a6e91cb039df41c2fa0 charmaps/CP775
-d512d19a02da69dafd98ab0f7a27d0df charmaps/CP949
-2467367588810aa21ea1010d09b34d6b charmaps/CSA_Z243.4-1985-1
-02d1072b7e20d5d0d70dede9f51b9a9d charmaps/CSA_Z243.4-1985-2
-f2154153876719004abd05bd3a49c310 charmaps/CSA_Z243.4-1985-GR
-f12d99e29832227d3d659446c3bd1efe charmaps/CSN_369103
-4745e4c913944bb3a842eda1ab84f463 charmaps/CWI
-02795f59b18fd5e0a38a75983ee5f9b1 charmaps/DEC-MCS
-81954d04e26499ce6ebe34674ccb71e1 charmaps/DIN_66003
-8cdcc842a730c5febcda9074c5a9e20f charmaps/DS_2089
-2d23e4b626f5cfa5d40c344d9cdef29a charmaps/EBCDIC-AT-DE
-a3afba3b3742c929cf8228061eff9bce charmaps/EBCDIC-AT-DE-A
-51747fc3a0be01a8864c4ac463e47134 charmaps/EBCDIC-CA-FR
-da9f0a660776bf0a8d787a5512efa30f charmaps/EBCDIC-DK-NO
-4ab022770a9e8e685c9696fd2bb3e5d6 charmaps/EBCDIC-DK-NO-A
-554a94a84c21d7dfe35d2378967901ab charmaps/EBCDIC-ES
-75508c60b07ada5ed9d5511422fdee36 charmaps/EBCDIC-ES-A
-071618eb679d75c272e6f252fc34ef6f charmaps/EBCDIC-ES-S
-eeb2eb499bc7d7e023a49545258cd4c8 charmaps/EBCDIC-FI-SE
-4510fd482c6bf286ab144d2023896992 charmaps/EBCDIC-FI-SE-A
-31c70716871e13e55e3c4d2e409c1f6a charmaps/EBCDIC-FR
-0ccf405badf73924e43f7381015c5e7f charmaps/EBCDIC-IS-FRISS
-e7e3235e426d5484ff681e1e21f76de7 charmaps/EBCDIC-IT
-7ea01bd248ab4f9cf149d5462084a1e9 charmaps/EBCDIC-PT
-06f67e85e3edfaaba2844a11227d4b8e charmaps/EBCDIC-UK
-ab8146d876f7cea2fd79202141a56bf0 charmaps/EBCDIC-US
-4d59ebf5245387e6e48bc28e8ff3f683 charmaps/ECMA-CYRILLIC
-c8aa077828897c01f539f6728867827e charmaps/ES
-56d96f732da26b9c9687cade2559414e charmaps/ES2
-ca3364fd7f65248864973b25b951906c charmaps/EUC-JISX0213
-f33e30fe7a2b9e410a402ba1b8f2d6ab charmaps/EUC-JP
-00f24f0b8b34ec055a8bddf01f059329 charmaps/EUC-JP-MS
-fa30ad5600f0c999abb104f9a64cdf40 charmaps/EUC-KR
-838393203b84e028f76622920458a526 charmaps/EUC-TW
-f5856ca72c25cbbab09b25bd62077df7 charmaps/GB18030
-3ac7955343a281d44278036e69045bc4 charmaps/GB_1988-80
-f49f85a7390e23e7bf9af220b87e98fc charmaps/GB2312
-0469fc4833a4c4d78d9a2429ab7af816 charmaps/GBK
-731aa4c53f5f8a083ab361e6f4f30ad1 charmaps/GEORGIAN-ACADEMY
-145fac3915354997f3ddaa3d8250a229 charmaps/GEORGIAN-PS
-a78b5d94e07ed0290118ed0dc174e43c charmaps/GOST_19768-74
-830992d6e3db2d47c1704b933a823e95 charmaps/GREEK7
-6347508e7de055cbd671b13268aeac23 charmaps/GREEK7-OLD
-3f1bc260f3aa97f5e6cce8f833692e6f charmaps/GREEK-CCITT
-c992fd7297c822d5f8bd25684cbe68b6 charmaps/HP-ROMAN8
-795478f3edc5de4e4ecc9517d9c10258 charmaps/IBM037
-04c69d8a16cda189f3b6ec82e82c85bf charmaps/IBM038
-fcb4591ac80ea22a2c03ce8b4ba6e916 charmaps/IBM1004
-7397fcf22867b7ec839c92c9f6309708 charmaps/IBM1026
-bb438d8c996392cff5ee96001ab8d5ba charmaps/IBM1047
-53d2b26c2688e9cf5991a7c678cc5400 charmaps/IBM1124
-8fd05661e39ba8e2aefe753b44fcb47a charmaps/IBM1129
-f7c54fdfaf67cc97ac2b7db70d042e7a charmaps/IBM1132
-1ec982a6a1e44b504190e0c20ca383b6 charmaps/IBM1133
-cae180a3a7a98e7ca267fd0593e8d4d2 charmaps/IBM1160
-7ff59e7d51c14135ee55cb5b670b7ec9 charmaps/IBM1161
-0d897fe64ee1177bb3efa2e091698a67 charmaps/IBM1162
-0b8a87c4acaeb8b80aa53b02aa74ace7 charmaps/IBM1163
-1bb671b575ce2d5903730a3095a1e9f9 charmaps/IBM1164
-67a6575425a0cd2b1eee477ba3825a79 charmaps/IBM256
-7f4bf7665c80ebb374d340ff9dc6c2d4 charmaps/IBM273
-e833c32c6bc4532f339b073dec83c748 charmaps/IBM274
-b3f81aa5f3eafc70f8681272dfcf3278 charmaps/IBM275
-6d844171463960c44a4389f8733dece1 charmaps/IBM277
-7ab572bda6426937997bc0e793174333 charmaps/IBM278
-b50429e0d3f1d35cd96fbc28b84153a8 charmaps/IBM280
-f8290cb02a3abfedb892d0c8f3234c99 charmaps/IBM281
-455810c2183613b5802711787a895927 charmaps/IBM284
-e6ce68850339e3e7137b26cbaad47a87 charmaps/IBM285
-0fcfa6f27b21b49c5554079f9b5601e3 charmaps/IBM290
-478b0e853b8582b32163c3b923a08217 charmaps/IBM297
-25f4bb6afd2f89e4e765f4be2b111d28 charmaps/IBM420
-4e50f102de50eff1045bf9da4168d8fb charmaps/IBM423
-42332e3613dd030d4ba571cf4a92ca45 charmaps/IBM424
-1fbc46c1d1191bc52b222c306b81c73f charmaps/IBM437
-cd7c5a1ef8d643113e3b4793f3122c8a charmaps/IBM500
-2bd16747d13d214d657ea66342306ddc charmaps/IBM850
-1cdaf2970b6e2ec03ffefdd22a9d447f charmaps/IBM851
-5591da3bdf04653cc68f31b4c2ba3df7 charmaps/IBM852
-e88d449343c4a6f16fd437a5868b3fb0 charmaps/IBM855
-94960aeda652856c46774a9e03cbf808 charmaps/IBM856
-c3256856786484d090c1e938329807bc charmaps/IBM857
-898810c91e5567f2aed5edc47946dc23 charmaps/IBM860
-343745daadaf451e84b71ca9e58048fb charmaps/IBM861
-52c70d49960d46164e4e49acc47826e3 charmaps/IBM862
-6f04d0e070db520338f0d4a68b24cbb3 charmaps/IBM863
-df59b4d4de6059a4064ce31ba931cc8d charmaps/IBM864
-e2edcee690cf123113ed191e466b47a6 charmaps/IBM865
-2e21a8811f9d218ebdb6b3744eef04d3 charmaps/IBM866
-ed3787887442af7cc8e03cb440bd22e3 charmaps/IBM866NAV
-4f28c084eabcfe12bde019374129a161 charmaps/IBM868
-6ac7b3009a8bb910ceaecf75911275a6 charmaps/IBM869
-e1379d157c60f93c6df7fbdc2d565c8f charmaps/IBM870
-c8d9b36f2e44f24f58e5f081db30ff63 charmaps/IBM871
-b6e1d473e843432345c2c0f25284a153 charmaps/IBM874
-3b16722f23d9915bc90a85e8061e9d34 charmaps/IBM875
-c90729a71c9431cbb979a57a697cf83f charmaps/IBM880
-bf9dfd44b19373f7156ed4a082cd2cb3 charmaps/IBM891
-9b408f55af89f8aba5df1e13a676db97 charmaps/IBM903
-70fd65da56a106659a6febcd1fb38643 charmaps/IBM904
-53083d727fa2d49438b8f1fbab617448 charmaps/IBM905
-121bfefb46142b2ddd6e1560aefbd964 charmaps/IBM918
-6ef218728e9ff68b69ab256ba76f5417 charmaps/IBM922
-2a171f0031a60aa49418428df4a7b2dd charmaps/IEC_P27-1
-856d2be4bb0573c19887cbc420580dd8 charmaps/INIS
-a4275626c05a72c6e9305fefd8015863 charmaps/INIS-8
-7b69918d8cd14725a1ccc965808dd39e charmaps/INIS-CYRILLIC
-56896a7ea4bdd08c817be2062e7d16f5 charmaps/INVARIANT
-1f66bdc760ca0a90ec8dd75d9c104d7d charmaps/ISIRI-3342
-6601310ca85ba289b5ce2e1c68df8c03 charmaps/ISO_10367-BOX
-a2fae2a1c29554eaa27fc44b6f2448b7 charmaps/ISO_10646
-f176d328d9a123a02f8736cb77fcfd23 charmaps/ISO_2033-1983
-63d3483ec057bbe25aeab1e12fbd8304 charmaps/ISO_5427
-3e4677b9ffb7bafe85956568d6fce732 charmaps/ISO_5427-EXT
-14f0ee818d06e319a2b24916403250c5 charmaps/ISO_5428
-58298af322e5edc30ce9aa764b095419 charmaps/ISO_646.BASIC
-9931d68b8b4d1d0db5b81d507ce4565e charmaps/ISO_646.IRV
-b738e3b159b9263930b92f19b101e1db charmaps/ISO_6937
-3019d94851ff22768f89ceb055a3470b charmaps/ISO_6937-2-25
-9a3258e87d321373a376839f5ce33bd0 charmaps/ISO_6937-2-ADD
-f7e1941df5107a4da74f0f800eb15e35 charmaps/ISO-8859-1
-af94e14d910651594b816af93bf9475a charmaps/ISO-8859-10
-e16960f25fe12d23dc8b2a44e0440baa charmaps/ISO-8859-11
-e91281017b3d6eab9c2e3e022c28b5b5 charmaps/ISO-8859-13
-1d5e0b232c7c00485a8dd1c5ae036723 charmaps/ISO-8859-14
-f7cf2b0c55b5bb7a34faeca71a08759e charmaps/ISO-8859-15
-d4a91a4bc27e1c681c4c0d7923775801 charmaps/ISO-8859-16
-8106c88f663bad113164494c1c11118d charmaps/ISO_8859-1,GL
-eaee6554170275d650e77034b44a1f86 charmaps/ISO-8859-2
-aad5c3f7f6e0917e82a544782b6fce67 charmaps/ISO-8859-3
-ec512181fb8e766c544d8de815126336 charmaps/ISO-8859-4
-38c1fb70059ee456ed1332107504b00c charmaps/ISO-8859-5
-a8b1087b3179f4318c63bb673b4c7819 charmaps/ISO-8859-6
-3d235e1f1680f23719c98893adf025c9 charmaps/ISO-8859-7
-30f7840f335a536db8d44df7dcf5a048 charmaps/ISO-8859-8
-c920792113cc26d6df988ba81defa022 charmaps/ISO-8859-9
-e784440dbd319ccec8860cbc675f15da charmaps/ISO_8859-SUPP
-ad27186058e7fc2f479d5917ffc33d83 charmaps/ISO-IR-197
-ee62f653713d184ab9b5645c13067aa9 charmaps/ISO-IR-209
-309b5745e52f0c6861a40dce0b20e1af charmaps/ISO-IR-90
-069dbeda500ef8539977fdeaace0fb8d charmaps/IT
-0e8eeddeaf18ff2ea878694a2739463f charmaps/JIS_C6220-1969-JP
-126abc61c9a99e94208bcfa038a4d8ef charmaps/JIS_C6220-1969-RO
-1b0ed357f33c83769d60f871c9ca5f9a charmaps/JIS_C6229-1984-A
-2fcf260bc119cf342134a8fd85a1e49a charmaps/JIS_C6229-1984-B
-127a7f4f39cb025219a5415dadc6601a charmaps/JIS_C6229-1984-B-ADD
-f97432b25a4838f338fb97632d5a1e68 charmaps/JIS_C6229-1984-HAND
-eeb2032e4e26972c0ea298b4add26f1a charmaps/JIS_C6229-1984-HAND-ADD
-f6635f62933ca73d099f7f0deabf98e2 charmaps/JIS_C6229-1984-KANA
-813d074d5cd729ac82c12abec04ef408 charmaps/JIS_X0201
-52c4609d8314f19801e57d00e951fd34 charmaps/JOHAB
-8542d92fd55e8cf99af4b68227b25c3c charmaps/JUS_I.B1.002
-b9a4e70db506f9944225fe5f9ed34597 charmaps/JUS_I.B1.003-MAC
-cc533ff46e14e2b8a03d56cc8f981a14 charmaps/JUS_I.B1.003-SERB
-dabd840e798145212d505a5e2c7c546a charmaps/KOI-8
-7010dc2605d2a8cc38503ae59a50329f charmaps/KOI8-R
-a986f5cae08665f176673ae7ab9149d6 charmaps/KOI8-T
-d24b8e4b73610606debbf3cd15175029 charmaps/KOI8-U
-e5f7b48895785f3c0a30c2b65e3b905e charmaps/KSC5636
-b4a5adcc8e08dfe44c69a2e85abc69da charmaps/LATIN-GREEK
-b87ff4cbc01d181c973c0ee4123e39e8 charmaps/LATIN-GREEK-1
-315486ff388e4195d1a9c4ea783bd9dd charmaps/MAC-CYRILLIC
-0564b198c18a53106aa4ec03203d01e6 charmaps/MACINTOSH
-ebccfbf3bc244c3c40695d8ee457a151 charmaps/MAC-IS
-2bf87a60b752d9e78a9bdc1e1e017421 charmaps/MAC-SAMI
-fe01d972c30c0eb99d68c12e8206828e charmaps/MAC-UK
-0ec89aa18809cce916665c7170eafff3 charmaps/MSZ_7795.3
-b88c7e31d530dcfe1088458bc2cd63e6 charmaps/NATS-DANO
-b3bbdc3f120f8953a4f6aa642427fe15 charmaps/NATS-DANO-ADD
-d513a9143cb5d41c140840f990297ad8 charmaps/NATS-SEFI
-10d8bd8b95e840b9158f429ad5b9365a charmaps/NATS-SEFI-ADD
-5f27e26b7da7764626373fe2a1dcba13 charmaps/NC_NC00-10
-a73be75e967e651a46dda5161259a074 charmaps/NEXTSTEP
-7c0d92699fef4f7cd04b8227656ac007 charmaps/NF_Z_62-010
-aaa5948bb876595c0caa07a5321c06fa charmaps/NF_Z_62-010_1973
-b26ac54d4b66d418284362f9d2bfaf34 charmaps/NS_4551-1
-ca8617473b167f0ddd74a8d4c5eeafab charmaps/NS_4551-2
-f3e6dfcd92af17588d92bb74a00cedc5 charmaps/PT
-3ca88f7f2ceb8e0a34f99faa2fc08b9d charmaps/PT2
-8b6072951526b7ff9d5fbf87b12d21c0 charmaps/SAMI
-fa0a7a36c57f096caefef7e279406379 charmaps/SAMI-WS2
-fc41ad3d839b73901e570a03d444b151 charmaps/SEN_850200_B
-655d147aa9930cc0f4a4f65d85baa28f charmaps/SEN_850200_C
-2d3fed5eab85625db611d698626b869b charmaps/SHIFT_JIS
-d48e132620d65ad9c036f78c81adfde8 charmaps/SHIFT_JISX0213
-e04ceed36f922c7cb08cc0d9ec1214e1 charmaps/T.101-G2
-994af9e3143e52f81a35a3bdbfc09fdd charmaps/T.61-7BIT
-69d66b016c2402128fe490ae7720ecf1 charmaps/T.61-8BIT
-05ed91b9ffe615448ea35dc783d14f50 charmaps/TCVN5712-1
-f42dab98605fd2aa47a6013ee9c187dc charmaps/TIS-620
-e848a5839dffb64ce93f1c7b1f41d939 charmaps/TSCII
-4efdcd39c789eba06c9a1e734cf0fa8c charmaps/UTF-8
-03e4b6c635f3a7e17be55196da899c2e charmaps/VIDEOTEX-SUPPL
-7eae0c62a98fd1da82b0553675cf99d0 charmaps/VISCII
-b04e38295a41a71d3fab0aaaf9edeba2 charmaps/WINDOWS-31J
-9ff9ac74474b20c587ba6f77a387a900 locales/aa_DJ
-8a2e947b19fcae224347c7354f05dd03 locales/aa_ER
-6bbd61e487754a53b60b964daa0efde5 locales/aa_ER@saaho
-ba23148ad4dd3a20e9f8678cd3a7318d locales/aa_ET
-457ee847dd7a116f2f32dc42c4d2e618 locales/af_ZA
-112ef7390f725bbf458148bb1579f0f3 locales/am_ET
-97483db07a72333f6220eb1068bb9774 locales/an_ES
-fec3397642d45c5208fa70d956172626 locales/ar_AE
-64cd23d98b1cb5430d8170ea8ae7cd01 locales/ar_BH
-bec775783856166f021ba99784a3e45d locales/ar_DZ
-7843c84c076edc1b40aa299742e2db62 locales/ar_EG
-36ca1f53ee3459dc8b7625147d6dc9c1 locales/ar_IN
-7f1418fb9cb8fca35dc39f4956e2c542 locales/ar_IQ
-3de70d3d4e2734885cc037b931dc20df locales/ar_JO
-5675e747cde2c3b5fcb9fb137b93e57b locales/ar_KW
-f2f4c3c8d936c6b81665f32b7855466c locales/ar_LB
-ed14bac539f84e457679acd2d30f946f locales/ar_LY
-b8a696a52bae6257fa9568f184ed08d0 locales/ar_MA
-cfb021ac947cc63c38cfad98030b4511 locales/ar_OM
-4c453c63b94b75dcef3afb394b7e09d9 locales/ar_QA
-4a6ccc5c573e36016f9606ca2ec998e2 locales/ar_SA
-d97cc1e38ef6e864ace03970e9f3e5d1 locales/ar_SD
-1c6f4fdfcf1646d19d929c5b888cdc74 locales/ar_SY
-5bf7bc4fec4bb6cca16fdcfb333e7fa7 locales/ar_TN
-8876594529e9dad27cde50df1314b638 locales/ar_YE
-4950332376ac7f49bde921607bf8b3b5 locales/az_AZ
-a7b1e75e62bd39e8c8201f22eee8d09c locales/be_BY
-4ab284f0079d9b20c3b3aa86e0927077 locales/bg_BG
-58a08f84cc830d1c980d02934b9ef1db locales/bn_BD
-0d0f6402010da4cb1bde6088e0a3163e locales/bn_IN
-f29ed6d548c24c2915c5739860b22b70 locales/br_FR
-08a8c7b978907ed61b3c9619274b322a locales/br_FR@euro
-70c92650a64296d270824bd348377cc2 locales/bs_BA
-ff62b390c9f7bdb928842cd0cd505b6d locales/byn_ER
-62b50002731b4242088c94428d8b1695 locales/ca_ES
-3b6ff441ee0b875d04892afc4b2bad63 locales/ca_ES@euro
-6dc1d5ffa23e21feadcf81366d972907 locales/cs_CZ
-a738a1d84e58ced722161a0c63109b21 locales/cy_GB
-999c6345303d86fdcac50bfeedd486d7 locales/da_DK
-d2725690a2288b9a25eae4f591ab337b locales/de_AT
-a1990ce5780d1218cf6f74450900903a locales/de_AT@euro
-4e9abd22096b32897075bc0e2b7784c6 locales/de_BE
-f69f03f7e1949a9fc3821ed4895dce4a locales/de_BE@euro
-493b4c54ac3a8ef6adbec7927fa9a2e3 locales/de_CH
-b27aaab25e031e4bc2e23981842fbb23 locales/de_DE
-fbe2dd1a46614a618b49218d1a3ccaf3 locales/de_DE@euro
-7302e7d47b28997842adac2c0f33e696 locales/de_LU
-bfcf25ca5a25fc6c306597338a4b2ed3 locales/de_LU@euro
-6bb5552e181f4923304b009a1e918c5d locales/el_GR
-2d5da0c3b8eade0a394c65b2c416c728 locales/el_GR@euro
-69cae8537c340f9b715657b56c2fdc8e locales/en_AU
-d43afbe5ba7e63d53d91d43ba81f1186 locales/en_BW
-9342fe09a131f1132b28e7e5fe14f9de locales/en_CA
-a1207363c4095e0b673bcc1b49e83aa5 locales/en_DK
-a0c4f8032f09bbbc642cb72c3fb24b23 locales/en_GB
-c339d79ffb50a5a4f5cbc1b0c3440805 locales/en_HK
-24c117ee23313635ac5992a3d23f3583 locales/en_IE
-c643822f5581e98602da2226b1c9c9bb locales/en_IE@euro
-2fbd7f240fdb5df2ef8930a226c65b4f locales/en_IN
-155f110e81b60919aafc4c19cca69844 locales/en_NZ
-26705f63153dc885cd3ed689950b732a locales/en_PH
-3c0345df097adb223a8b0a3452525d9b locales/en_SG
-92e303b805f4764fc4673c6b91dcc727 locales/en_US
-fa5a491dc297f7238f80874ee496e9c2 locales/en_ZA
-7ad745cfd65235a822a8df609fbde6be locales/en_ZW
-2b8b723bacd503d19c954c114892c6b7 locales/es_AR
-c6a229ca597b87d76f4dab984b81269a locales/es_BO
-82d08d10a6b495642d29e10881db125e locales/es_CL
-d5c0e6d7a7cf3b78c10d01488e56bac6 locales/es_CO
-43c977fb2e8c5cf8ebc22e540394c9c5 locales/es_CR
-e8e40390b325bda7745c35dcf21ed85b locales/es_DO
-4fb0673c208ab98a2e2730d5d276b4ca locales/es_EC
-8b594f3f54feee58b532fd79bc5cb3c4 locales/es_ES
-a22a41f2de517348cda30ae1abf5c9c8 locales/es_ES@euro
-2b48ad6a533e2be0e276309e8d850176 locales/es_GT
-2b93a8311856003ac1a8d99c953384fe locales/es_HN
-8c4dac544d27d7e13be46f41a7faffc1 locales/es_MX
-05a1608d55defa7b3365675fcf877447 locales/es_NI
-52cf11d5a1177f0559184b2c9809a646 locales/es_PA
-7676d6ef45b605dc41ca263a0281e104 locales/es_PE
-8b71100af8e3368b72adb5245ca09ea4 locales/es_PR
-8b018e757da1484cb871b57232d541b6 locales/es_PY
-a127d052ef4296077cf471e74f512ea3 locales/es_SV
-fd0e34704a9924e5c5fa4d8c036ea2cb locales/es_US
-11cf1cc98949dfdd46a809132567708d locales/es_UY
-23d39b096e723bc42bacf47f178fcd8f locales/es_VE
-0cacce3d2ea3cdf629199fa9860cdbc7 locales/et_EE
-9c061ce2fa1ed4840a188f4d6571c467 locales/eu_ES
-425dea94a607159ca347683ad54bd01c locales/eu_ES@euro
-b4d6364a3ded4f5d755ce06ff4113813 locales/fa_IR
-01dd74acb0f9f223b8f10cee4d84a27a locales/fi_FI
-e7788148a070838b2a955f8581b85ecc locales/fi_FI@euro
-72dce48480391d4511ea5652addb7a7f locales/fo_FO
-b20965c23b512815e89d19968943f79f locales/fr_BE
-9d903d1619eee84f9d6f2548a244f16b locales/fr_BE@euro
-27350ff5edcbad23a3cbaf51e5ce9516 locales/fr_CA
-85cfedbae2635ff3cc6c020e4fedae77 locales/fr_CH
-3d1778f0b391280e0f8e659ffd6540c3 locales/fr_FR
-05926a63352664481996d6fc88e89652 locales/fr_FR@euro
-f9a73089ca808e23a1f3baa21bed2d16 locales/fr_LU
-1197cac6a722879b5bb6be9542849126 locales/fr_LU@euro
-f3c44dd40253222ad0e679843129ff93 locales/ga_IE
-d2d4dc4afca993cc23ca3f5b8bd14086 locales/ga_IE@euro
-371b5a1fbfe1c2f85702e73cc422144f locales/gd_GB
-e9a09a754980c57d164542f8836ca7f2 locales/gez_ER
-578aad298eab4b7417f63e84def24b70 locales/gez_ER@abegede
-1c3588c1649830a853a8b3fb6551f216 locales/gez_ET
-5baf61b1452b869a7ef68fb0bc104c93 locales/gez_ET@abegede
-932688c021d50c8c006c69e5dd400916 locales/gl_ES
-96442bb448710d3bb8b8312aa3aeb1bf locales/gl_ES@euro
-843a63c023de548c5bd68a6501b6111f locales/gv_GB
-b224f30f6caeb5b4224055b8dffa4e6e locales/he_IL
-50316cb01e3d71ad62ece1d1d3c07dee locales/hi_IN
-076594c8fca0d8cba6025bc84c632955 locales/hr_HR
-a32f724ac52a0b7b93e4f16634434aa6 locales/hu_HU
-fbbbf45334e1e194ab1a97c86021a0de locales/hy_AM
-d4e0ac1becf81c3d8ee2015149217bec locales/i18n
-ce85601a76ae2614f8bda0f32dffdc1c locales/id_ID
-b4289c043013ae5eea11d3aecb358def locales/is_IS
-41285017b3e92ce96f58b0893693fdd0 locales/iso14651_t1
-3eb074e32f7c47e55b7fc87f4f95ed1f locales/it_CH
-9782bbb990596391294615db31ed354b locales/it_IT
-ca5c8db6da01632a55e456a1b9c5d06a locales/it_IT@euro
-87ec0865bc168f8eb1ccc34f39af3c54 locales/iw_IL
-670e8aa17ac05f3d87e02b7b30d821dc locales/ja_JP
-91e1303b1a2178d1d65fc1680aeeee73 locales/ka_GE
-be1c55fb66abca09de958efda88a2fd2 locales/kl_GL
-7c2b56c107bd690d5f1a02b483251108 locales/ko_KR
-18606681228f2b3657000b540156d26c locales/kw_GB
-8626f9f367ccb8e53ff9134d10e0d3bc locales/lo_LA
-b167f637994d4e0dc63278afead20e70 locales/lt_LT
-ff1ff54d5c81200f10443d38d4ffe5d9 locales/lug_UG
-afc1712af84f72d2ef7df4017d032d0a locales/lv_LV
-736f907d676339c1491ef9b05fd72d43 locales/mi_NZ
-e5ea9d27b7a744398b7172d217e0fcf4 locales/mk_MK
-fd8a499f99ce938a2248a3f15c3734a9 locales/ml_IN
-2e8b7bae428155446d7576b0cb30922c locales/mn_MN
-b84eb46c82ab6b9d62a2488bdcc20424 locales/mr_IN
-cacea2dc23f73bbcb41315b54efa2497 locales/ms_MY
-22032e413b237e3065e45ec826cf4f33 locales/mt_MT
-e0a1935babff9d11ec1a351f32139b66 locales/nb_NO
-f5c3f7b9407b830f81f6fa436025cf8b locales/nl_BE
-b8fe92bcb67bd9ce8881245265bc0921 locales/nl_BE@euro
-398ed78337e7e54b70c326de73419acc locales/nl_NL
-582e91119b249216632792ccc3a4b39c locales/nl_NL@euro
-e0c8f075f207f0eeae0126a828e7b002 locales/nn_NO
-e08b57d42540a5f6b9583cf0b307e16d locales/oc_FR
-291d4f7f52f2de6a12e20a6a772bfa08 locales/om_ET
-aff6f78433e871e621625a9d01cce9b0 locales/om_KE
-5d76d187628194194670c66b6ed087a4 locales/pl_PL
-75a57c202a85a70e526df48b76020fe9 locales/POSIX
-00018d0456c949f1e4e6039667a3ce18 locales/pt_BR
-71504211f33a2912b4883f4fcebc8e49 locales/pt_PT
-ee436677e91daca539d79043c3445cee locales/pt_PT@euro
-7f22da8067aae183e4b9f8f2c4c50bb0 locales/ro_RO
-87030de9292c9b3f11d4947e3ae39389 locales/ru_RU
-b12d40e940af0a7475981a88a7c2efe8 locales/ru_UA
-ded75eac13f8497dbbede7e8c0ea23f2 locales/se_NO
-9ee09dd75dae654dc0cb5a51e3269a8e locales/sid_ET
-b90424a5fa153de8b87d0ea50ddf4b88 locales/sk_SK
-fcc825d97cd9c9c28cc9dcdb9b1765c7 locales/sl_SI
-fe867afa6e46165623fd32d60cb9d10e locales/so_DJ
-bae8167739a8f22df3f11418019a4155 locales/so_ET
-b7aa5b5b6a2bbf7252c4b0addac2a022 locales/so_KE
-ffbdf559e7ce632ef015484de36693a1 locales/so_SO
-62791e8307a9d3752a84e57af6e6a8e2 locales/sq_AL
-4a5f61c9afd6c9a7043eefe61ccfa369 locales/sr_YU
-d0b1a64f76a9362bd3b9cb8640b3f619 locales/sr_YU@cyrillic
-81a23b384860a2f3bbd8589e7093d7de locales/st_ZA
-4ef891cdce4c0a55cfcda7e6af47a1e2 locales/sv_FI
-3bbf9a4b501088ecc575ae72df849afc locales/sv_FI@euro
-79597e3058759603fd29b8a6330264ad locales/sv_SE
-20dfa47f8fcc69a25b409360e21d1e06 locales/ta_IN
-d2bd445b112ea8e998eea01a10b48b97 locales/te_IN
-9c6e97d831e4c5d0007c953608941699 locales/tg_TJ
-dfb05377acb07e76b2894d81d0f4a45b locales/th_TH
-3e68cfdf175a1e2b9d2be63c111dc054 locales/ti_ER
-a91c0d9a6c063ae3cf840581517002fe locales/ti_ET
-ca60e4038ea4d4014469963d1d5c34ec locales/tig_ER
-f536f6552f808199a79f8c0e17e965df locales/tl_PH
-75671aeaff9a0e7bb749c03b60ed4d4e locales/translit_circle
-6ecb21da3b802c875d99f4af1864baa8 locales/translit_cjk_compat
-1974543ca5f2d3ade1381476d43aeb30 locales/translit_cjk_variants
-380e21746526f66ecec28f973c608088 locales/translit_combining
-4c15e69cdfd3f3ee604348663f21983a locales/translit_compat
-a7bf06733aa33711c79b1884ebc1d16b locales/translit_et
-7a9587b2b0a14472ed945d23d99e2479 locales/translit_font
-2c1e80f58ae24a9239da80dab21cfdea locales/translit_fraction
-e51778b0210e1f5bd9538cd108031e98 locales/translit_hangul
-eaa2e353f38bcde0779dc915b45596cd locales/translit_narrow
-355db6a426662caf6cc5a711a42ac18d locales/translit_neutral
-dd772f49ea41f9528569ec1e999e53a3 locales/translit_small
-7f2820edbc0323952e3b9043df95630a locales/translit_wide
-277e145e97d3ae10da1e9f6e6fb24faf locales/tr_TR
-ec6144a5d6bfdcda3f1df77d10e5352f locales/tt_RU
-899c3baab6ceb6525f16107319b6fba1 locales/uk_UA
-a3116f5e4244b9413244e7efd951f18f locales/ur_PK
-10e979f6e29034b3b87478ed532faf8b locales/uz_UZ
-f53b5b9bdc0ece4ba5bbc6851181ddea locales/uz_UZ@cyrillic
-e01a1f876fe923b192f5d8475a24e70c locales/vi_VN
-d32625e7bbdef12e210855d2ed7a1fd9 locales/wa_BE
-5593017a2088448a06a0dededc590ebf locales/wa_BE@euro
-6d741c89481f57554d4803e4810a9e93 locales/xh_ZA
-43e6de668e54a9d5f95dbacd561daed7 locales/yi_US
-e582e3d3526610821f7151d404b6d9f3 locales/zh_CN
-75d7f18534abad8f90d5ee9b09287cce locales/zh_HK
-683fdb012a69950961dd9ff92f67d928 locales/zh_SG
-6342a0bd67a627fc94b9755f0c21e199 locales/zh_TW
-062e7d6c0ddee5bb0b1cbf934f656fe2 locales/zu_ZA
diff --git a/libc/localedata/ChangeLog b/libc/localedata/ChangeLog
index 58890d105..78385399b 100644
--- a/libc/localedata/ChangeLog
+++ b/libc/localedata/ChangeLog
@@ -1,3 +1,7 @@
+2013-02-01 Andreas Jaeger <aj@suse.de>
+
+ * CHECKSUMS: Remove file.
+
2013-01-14 Joseph Myers <joseph@codesourcery.com>
* Makefile (bug-setlocale1-ARGS): Use $(host-test-program-cmd),
diff --git a/libc/malloc/memusagestat.c b/libc/malloc/memusagestat.c
index f561e0dbb..7bbd00996 100644
--- a/libc/malloc/memusagestat.c
+++ b/libc/malloc/memusagestat.c
@@ -319,17 +319,26 @@ main (int argc, char *argv[])
for (line = 1; line <= 3; ++line)
{
- cnt = ((ysize - 40) * (maxsize_heap / 4 * line / heap_scale)) /
- (maxsize_heap / heap_scale);
- gdImageDashedLine (im_out, 40, ysize - 20 - cnt, xsize - 40,
- ysize - 20 - cnt, red);
- snprintf (buf, sizeof (buf), heap_format, maxsize_heap / 4 * line /
- heap_scale);
- gdImageString (im_out, gdFontSmall, 39 - strlen (buf) * 6,
- ysize - 26 - cnt, (unsigned char *) buf, red);
-
- cnt2 = ((ysize - 40) * (maxsize_stack / 4 * line / stack_scale)) /
- (maxsize_stack / stack_scale);
+ if (maxsize_heap > 0)
+ {
+ cnt = (((ysize - 40) * (maxsize_heap / 4 * line / heap_scale))
+ / (maxsize_heap / heap_scale));
+ gdImageDashedLine (im_out, 40, ysize - 20 - cnt, xsize - 40,
+ ysize - 20 - cnt, red);
+ snprintf (buf, sizeof (buf), heap_format,
+ maxsize_heap / 4 * line / heap_scale);
+ gdImageString (im_out, gdFontSmall, 39 - strlen (buf) * 6,
+ ysize - 26 - cnt, (unsigned char *) buf, red);
+ }
+ else
+ cnt = 0;
+
+ if (maxsize_stack > 0)
+ cnt2 = (((ysize - 40) * (maxsize_stack / 4 * line / stack_scale))
+ / (maxsize_stack / stack_scale));
+ else
+ cnt2 = 0;
+
if (cnt != cnt2)
gdImageDashedLine (im_out, 40, ysize - 20 - cnt2, xsize - 40,
ysize - 20 - cnt2, green);
@@ -372,7 +381,7 @@ main (int argc, char *argv[])
ysize - 14, yellow);
previously = now;
- if (also_total)
+ if (also_total && maxsize_heap > 0)
{
size_t new3;
@@ -386,21 +395,27 @@ main (int argc, char *argv[])
last_total = new3;
}
- // assert (entry.heap <= maxsize_heap);
- new[0] = (ysize - 20) - ((((unsigned long long int) (ysize - 40))
- * entry.heap) / maxsize_heap);
- gdImageLine (im_out, 40 + ((xsize - 80) * (cnt - 1)) / total,
- last_heap, 40 + ((xsize - 80) * cnt) / total, new[0],
- red);
- last_heap = new[0];
-
- // assert (entry.stack <= maxsize_stack);
- new[1] = (ysize - 20) - ((((unsigned long long int) (ysize - 40))
- * entry.stack) / maxsize_stack);
- gdImageLine (im_out, 40 + ((xsize - 80) * (cnt - 1)) / total,
- last_stack, 40 + ((xsize - 80) * cnt) / total, new[1],
- green);
- last_stack = new[1];
+ if (maxsize_heap > 0)
+ {
+ new[0] = ((ysize - 20)
+ - ((((unsigned long long int) (ysize - 40))
+ * entry.heap) / maxsize_heap));
+ gdImageLine (im_out, 40 + ((xsize - 80) * (cnt - 1)) / total,
+ last_heap, 40 + ((xsize - 80) * cnt) / total,
+ new[0], red);
+ last_heap = new[0];
+ }
+
+ if (maxsize_stack > 0)
+ {
+ new[1] = ((ysize - 20)
+ - ((((unsigned long long int) (ysize - 40))
+ * entry.stack) / maxsize_stack));
+ gdImageLine (im_out, 40 + ((xsize - 80) * (cnt - 1)) / total,
+ last_stack, 40 + ((xsize - 80) * cnt) / total,
+ new[1], green);
+ last_stack = new[1];
+ }
}
cnt = 0;
@@ -448,7 +463,7 @@ main (int argc, char *argv[])
next_tick += MAX (1, total / 20);
}
- if (also_total)
+ if (also_total && maxsize_heap > 0)
{
size_t new3;
@@ -459,16 +474,24 @@ main (int argc, char *argv[])
last_total = new3;
}
- new[0] = (ysize - 20) - ((((unsigned long long int) (ysize - 40))
- * entry.heap) / maxsize_heap);
- gdImageLine (im_out, last_xpos, last_heap, xpos, new[0], red);
- last_heap = new[0];
+ if (maxsize_heap > 0)
+ {
+ new[0] = ((ysize - 20)
+ - ((((unsigned long long int) (ysize - 40))
+ * entry.heap) / maxsize_heap));
+ gdImageLine (im_out, last_xpos, last_heap, xpos, new[0], red);
+ last_heap = new[0];
+ }
- // assert (entry.stack <= maxsize_stack);
- new[1] = (ysize - 20) - ((((unsigned long long int) (ysize - 40))
- * entry.stack) / maxsize_stack);
- gdImageLine (im_out, last_xpos, last_stack, xpos, new[1], green);
- last_stack = new[1];
+ if (maxsize_stack > 0)
+ {
+ new[1] = ((ysize - 20)
+ - ((((unsigned long long int) (ysize - 40))
+ * entry.stack) / maxsize_stack));
+ gdImageLine (im_out, last_xpos, last_stack, xpos, new[1],
+ green);
+ last_stack = new[1];
+ }
last_xpos = xpos;
}
diff --git a/libc/manual/arith.texi b/libc/manual/arith.texi
index f387c8f1a..faf25cc42 100644
--- a/libc/manual/arith.texi
+++ b/libc/manual/arith.texi
@@ -1086,7 +1086,7 @@ operation was successful, @code{-1} otherwise.
@comment fenv.h
@comment GNU
-@deftypefun int fegetexcept (int @var{excepts})
+@deftypefun int fegetexcept (void)
The function returns a bitmask of all currently enabled exceptions. It
returns @code{-1} in case of failure.
@end deftypefun
@@ -1248,13 +1248,13 @@ equivalent to those of @code{ldexp} and @code{frexp}. See also the
@comment math.h
@comment BSD
-@deftypefun double scalb (double @var{value}, int @var{exponent})
+@deftypefun double scalb (double @var{value}, double @var{exponent})
@comment math.h
@comment BSD
-@deftypefunx float scalbf (float @var{value}, int @var{exponent})
+@deftypefunx float scalbf (float @var{value}, float @var{exponent})
@comment math.h
@comment BSD
-@deftypefunx {long double} scalbl (long double @var{value}, int @var{exponent})
+@deftypefunx {long double} scalbl (long double @var{value}, long double @var{exponent})
The @code{scalb} function is the BSD name for @code{ldexp}.
@end deftypefun
@@ -1286,13 +1286,13 @@ The @code{scalb} function is the BSD name for @code{ldexp}.
@comment math.h
@comment BSD
-@deftypefun {long long int} significand (double @var{x})
+@deftypefun double significand (double @var{x})
@comment math.h
@comment BSD
-@deftypefunx {long long int} significandf (float @var{x})
+@deftypefunx float significandf (float @var{x})
@comment math.h
@comment BSD
-@deftypefunx {long long int} significandl (long double @var{x})
+@deftypefunx {long double} significandl (long double @var{x})
@code{significand} returns the mantissa of @var{x} scaled to the range
@math{[1, 2)}.
It is equivalent to @w{@code{scalb (@var{x}, (double) -ilogb (@var{x}))}}.
diff --git a/libc/manual/conf.texi b/libc/manual/conf.texi
index 55ca4d10c..7eb8b3625 100644
--- a/libc/manual/conf.texi
+++ b/libc/manual/conf.texi
@@ -114,7 +114,7 @@ more (@pxref{Sysconf}).
@comment limits.h
@comment POSIX.1
-@deftypevr Macro int SSIZE_MAX
+@deftypevr Macro ssize_t SSIZE_MAX
The largest value that can fit in an object of type @code{ssize_t}.
Effectively, this is the limit on the number of bytes that can be read
or written in a single operation.
@@ -1121,7 +1121,7 @@ Each parameter also has another macro, with a name starting with
have on @emph{any} POSIX system. @xref{File Minimums}.
@cindex limits, link count of files
-@comment limits.h
+@comment limits.h (optional)
@comment POSIX.1
@deftypevr Macro int LINK_MAX
The uniform system limit (if any) for the number of names for a given
diff --git a/libc/manual/errno.texi b/libc/manual/errno.texi
index fa88b1e8a..2a3c004b2 100644
--- a/libc/manual/errno.texi
+++ b/libc/manual/errno.texi
@@ -1507,7 +1507,7 @@ can be customized by defining a variable named
@comment error.h
@comment GNU
-@deftypevar {void (*) error_print_progname } (void)
+@deftypevar {void (*error_print_progname)} (void)
If the @code{error_print_progname} variable is defined to a non-zero
value the function pointed to is called by @code{error} or
@code{error_at_line}. It is expected to print the program name or do
diff --git a/libc/manual/examples/mkfsock.c b/libc/manual/examples/mkfsock.c
index 1469e02fc..1a2b7f19f 100644
--- a/libc/manual/examples/mkfsock.c
+++ b/libc/manual/examples/mkfsock.c
@@ -45,13 +45,12 @@ make_named_socket (const char *filename)
/* The size of the address is
the offset of the start of the filename,
- plus its length,
- plus one for the terminating null byte.
+ plus its length (not including the terminating null byte).
Alternatively you can just do:
size = SUN_LEN (&name);
*/
size = (offsetof (struct sockaddr_un, sun_path)
- + strlen (name.sun_path) + 1);
+ + strlen (name.sun_path));
if (bind (sock, (struct sockaddr *) &name, size) < 0)
{
diff --git a/libc/manual/filesys.texi b/libc/manual/filesys.texi
index 1b77f069e..1df9cf2b3 100644
--- a/libc/manual/filesys.texi
+++ b/libc/manual/filesys.texi
@@ -615,7 +615,7 @@ the result.
@comment dirent.h
@comment BSD/SVID
-@deftypefun int scandir (const char *@var{dir}, struct dirent ***@var{namelist}, int (*@var{selector}) (const struct dirent *), int (*@var{cmp}) (const void *, const void *))
+@deftypefun int scandir (const char *@var{dir}, struct dirent ***@var{namelist}, int (*@var{selector}) (const struct dirent *), int (*@var{cmp}) (const struct dirent **, const struct dirent **))
The @code{scandir} function scans the contents of the directory selected
by @var{dir}. The result in *@var{namelist} is an array of pointers to
@@ -669,7 +669,7 @@ dirent64}}. To use this we need a new function.
@comment dirent.h
@comment GNU
-@deftypefun int scandir64 (const char *@var{dir}, struct dirent64 ***@var{namelist}, int (*@var{selector}) (const struct dirent64 *), int (*@var{cmp}) (const void *, const void *))
+@deftypefun int scandir64 (const char *@var{dir}, struct dirent64 ***@var{namelist}, int (*@var{selector}) (const struct dirent64 *), int (*@var{cmp}) (const struct dirent64 **, const struct dirent64 **))
The @code{scandir64} function works like the @code{scandir} function
except that the directory entries it returns are described by elements
of type @w{@code{struct dirent64}}. The function pointed to by
@@ -1189,7 +1189,7 @@ exceeded.
@comment unistd.h
@comment BSD
-@deftypefun int readlink (const char *@var{filename}, char *@var{buffer}, size_t @var{size})
+@deftypefun ssize_t readlink (const char *@var{filename}, char *@var{buffer}, size_t @var{size})
The @code{readlink} function gets the value of the symbolic link
@var{filename}. The file name that the link points to is copied into
@var{buffer}. This file name string is @emph{not} null-terminated;
@@ -2189,7 +2189,7 @@ The file is on a read-only file system.
@comment unistd.h
@comment BSD
-@deftypefun int fchown (int @var{filedes}, int @var{owner}, int @var{group})
+@deftypefun int fchown (int @var{filedes}, uid_t @var{owner}, gid_t @var{group})
This is like @code{chown}, except that it changes the owner of the open
file with descriptor @var{filedes}.
@@ -2541,7 +2541,7 @@ for full details on the sticky bit.
@comment sys/stat.h
@comment BSD
-@deftypefun int fchmod (int @var{filedes}, int @var{mode})
+@deftypefun int fchmod (int @var{filedes}, mode_t @var{mode})
This is like @code{chmod}, except that it changes the permissions of the
currently open file given by @var{filedes}.
@@ -2713,7 +2713,7 @@ the @code{utime} function---all except the attribute change time. You
need to include the header file @file{utime.h} to use this facility.
@pindex utime.h
-@comment time.h
+@comment utime.h
@comment POSIX.1
@deftp {Data Type} {struct utimbuf}
The @code{utimbuf} structure is used with the @code{utime} function to
@@ -2729,7 +2729,7 @@ This is the modification time for the file.
@end table
@end deftp
-@comment time.h
+@comment utime.h
@comment POSIX.1
@deftypefun int utime (const char *@var{filename}, const struct utimbuf *@var{times})
This function is used to modify the file times associated with the file
@@ -2782,7 +2782,7 @@ in the header file @file{sys/time.h}.
@comment sys/time.h
@comment BSD
-@deftypefun int utimes (const char *@var{filename}, struct timeval @var{tvp}@t{[2]})
+@deftypefun int utimes (const char *@var{filename}, const struct timeval @var{tvp}@t{[2]})
This function sets the file access and modification times of the file
@var{filename}. The new file access time is specified by
@code{@var{tvp}[0]}, and the new modification time by
@@ -2796,7 +2796,7 @@ function.
@comment sys/time.h
@comment BSD
-@deftypefun int lutimes (const char *@var{filename}, struct timeval @var{tvp}@t{[2]})
+@deftypefun int lutimes (const char *@var{filename}, const struct timeval @var{tvp}@t{[2]})
This function is like @code{utimes}, except that it does not follow
symbolic links. If @var{filename} is the name of a symbolic link,
@code{lutimes} sets the file access and modification times of the
@@ -2812,7 +2812,7 @@ function.
@comment sys/time.h
@comment BSD
-@deftypefun int futimes (int @var{fd}, struct timeval @var{tvp}@t{[2]})
+@deftypefun int futimes (int @var{fd}, const struct timeval @var{tvp}@t{[2]})
This function is like @code{utimes}, except that it takes an open file
descriptor as an argument instead of a file name. @xref{Low-Level
I/O}. This function comes from FreeBSD, and is not available on all
@@ -3049,7 +3049,7 @@ The prototype for @code{mknod} is declared in @file{sys/stat.h}.
@comment sys/stat.h
@comment BSD
-@deftypefun int mknod (const char *@var{filename}, int @var{mode}, int @var{dev})
+@deftypefun int mknod (const char *@var{filename}, mode_t @var{mode}, dev_t @var{dev})
The @code{mknod} function makes a special file with name @var{filename}.
The @var{mode} specifies the mode of the file, and may include the various
special file bits, such as @code{S_IFCHR} (for a character special file)
diff --git a/libc/manual/getopt.texi b/libc/manual/getopt.texi
index 77045157e..f0b7283c8 100644
--- a/libc/manual/getopt.texi
+++ b/libc/manual/getopt.texi
@@ -59,7 +59,7 @@ option argument, for those options that accept arguments.
@comment unistd.h
@comment POSIX.2
-@deftypefun int getopt (int @var{argc}, char **@var{argv}, const char *@var{options})
+@deftypefun int getopt (int @var{argc}, char *const *@var{argv}, const char *@var{options})
The @code{getopt} function gets the next option argument from the
argument list specified by the @var{argv} and @var{argc} arguments.
Normally these values come directly from the arguments received by
diff --git a/libc/manual/libc-texinfo.sh b/libc/manual/libc-texinfo.sh
index 60e224bb8..1ef09fcbb 100644
--- a/libc/manual/libc-texinfo.sh
+++ b/libc/manual/libc-texinfo.sh
@@ -91,9 +91,11 @@ Indices
* Variable Index:: Index of variables and variable-like macros.
* File Index:: Index of programs and files.
+ @detailmenu
--- The Detailed Node Listing ---
EOF
cat ${OUTDIR}lmenu.$$
+ echo '@end detailmenu'
echo '@end menu'; } >${OUTDIR}top-menu.texi.$$
mv -f ${OUTDIR}top-menu.texi.$$ ${OUTDIR}top-menu.texi
diff --git a/libc/manual/llio.texi b/libc/manual/llio.texi
index acafed315..90bd2d71f 100644
--- a/libc/manual/llio.texi
+++ b/libc/manual/llio.texi
@@ -1669,15 +1669,13 @@ they return.
@comment unistd.h
@comment X/Open
-@deftypefun int sync (void)
+@deftypefun void sync (void)
A call to this function will not return as long as there is data which
has not been written to the device. All dirty buffers in the kernel will
be written and so an overall consistent system can be achieved (if no
other process in parallel writes data).
A prototype for @code{sync} can be found in @file{unistd.h}.
-
-The return value is zero to indicate no error.
@end deftypefun
Programs more often want to ensure that data written to a given file is
@@ -1989,7 +1987,7 @@ replaces the normal implementation.
@comment aio.h
@comment Unix98
-@deftypefun int aio_read64 (struct aiocb *@var{aiocbp})
+@deftypefun int aio_read64 (struct aiocb64 *@var{aiocbp})
This function is similar to the @code{aio_read} function. The only
difference is that on @w{32 bit} machines, the file descriptor should
be opened in the large file mode. Internally, @code{aio_read64} uses
@@ -2073,7 +2071,7 @@ replaces the normal implementation.
@comment aio.h
@comment Unix98
-@deftypefun int aio_write64 (struct aiocb *@var{aiocbp})
+@deftypefun int aio_write64 (struct aiocb64 *@var{aiocbp})
This function is similar to the @code{aio_write} function. The only
difference is that on @w{32 bit} machines the file descriptor should
be opened in the large file mode. Internally @code{aio_write64} uses
@@ -2177,7 +2175,7 @@ transparently replaces the normal implementation.
@comment aio.h
@comment Unix98
-@deftypefun int lio_listio64 (int @var{mode}, struct aiocb *const @var{list}, int @var{nent}, struct sigevent *@var{sig})
+@deftypefun int lio_listio64 (int @var{mode}, struct aiocb64 *const @var{list}[], int @var{nent}, struct sigevent *@var{sig})
This function is similar to the @code{lio_listio} function. The only
difference is that on @w{32 bit} machines, the file descriptor should
be opened in the large file mode. Internally, @code{lio_listio64} uses
@@ -2239,7 +2237,7 @@ machines.
@comment aio.h
@comment POSIX.1b
-@deftypefun ssize_t aio_return (const struct aiocb *@var{aiocbp})
+@deftypefun ssize_t aio_return (struct aiocb *@var{aiocbp})
This function can be used to retrieve the return status of the operation
carried out by the request described in the variable pointed to by
@var{aiocbp}. As long as the error status of this request as returned
@@ -2262,7 +2260,7 @@ transparently replaces the normal implementation.
@comment aio.h
@comment Unix98
-@deftypefun int aio_return64 (const struct aiocb64 *@var{aiocbp})
+@deftypefun ssize_t aio_return64 (struct aiocb64 *@var{aiocbp})
This function is similar to @code{aio_return} with the only difference
that the argument is a reference to a variable of type @code{struct
aiocb64}.
@@ -2929,19 +2927,19 @@ access modes. These names are preferred when writing GNU-specific code.
But most programs will want to be portable to other POSIX.1 systems and
should use the POSIX.1 names above instead.
-@comment fcntl.h
+@comment fcntl.h (optional)
@comment GNU
@deftypevr Macro int O_READ
Open the file for reading. Same as @code{O_RDONLY}; only defined on GNU.
@end deftypevr
-@comment fcntl.h
+@comment fcntl.h (optional)
@comment GNU
@deftypevr Macro int O_WRITE
Open the file for writing. Same as @code{O_WRONLY}; only defined on GNU.
@end deftypevr
-@comment fcntl.h
+@comment fcntl.h (optional)
@comment GNU
@deftypevr Macro int O_EXEC
Open the file for executing. Only defined on GNU.
@@ -3045,7 +3043,7 @@ to be portable, use @code{O_NOCTTY} when it is important to avoid this.
The following three file name translation flags exist only on
@gnuhurdsystems{}.
-@comment fcntl.h
+@comment fcntl.h (optional)
@comment GNU
@deftypevr Macro int O_IGNORE_CTTY
Do not recognize the named file as the controlling terminal, even if it
@@ -3054,7 +3052,7 @@ on the new file descriptor will never induce job control signals.
@xref{Job Control}.
@end deftypevr
-@comment fcntl.h
+@comment fcntl.h (optional)
@comment GNU
@deftypevr Macro int O_NOLINK
If the named file is a symbolic link, open the link itself instead of
@@ -3063,7 +3061,7 @@ return the information returned by @code{lstat} on the link's name.)
@cindex symbolic link, opening
@end deftypevr
-@comment fcntl.h
+@comment fcntl.h (optional)
@comment GNU
@deftypevr Macro int O_NOTRANS
If the named file is specially translated, do not invoke the translator.
@@ -3095,7 +3093,7 @@ compatibility.
The remaining operating modes are BSD extensions. They exist only
on some systems. On other systems, these macros are not defined.
-@comment fcntl.h
+@comment fcntl.h (optional)
@comment BSD
@deftypevr Macro int O_SHLOCK
Acquire a shared lock on the file, as with @code{flock}.
@@ -3106,7 +3104,7 @@ creating the file. You are guaranteed that no other process will get
the lock on the new file first.
@end deftypevr
-@comment fcntl.h
+@comment fcntl.h (optional)
@comment BSD
@deftypevr Macro int O_EXLOCK
Acquire an exclusive lock on the file, as with @code{flock}.
diff --git a/libc/manual/math.texi b/libc/manual/math.texi
index 9242b539a..193d415fb 100644
--- a/libc/manual/math.texi
+++ b/libc/manual/math.texi
@@ -1387,7 +1387,7 @@ program runs, do @code{srandom (time (0))}.
@comment stdlib.h
@comment BSD
-@deftypefun {void *} initstate (unsigned int @var{seed}, void *@var{state}, size_t @var{size})
+@deftypefun {char *} initstate (unsigned int @var{seed}, char *@var{state}, size_t @var{size})
The @code{initstate} function is used to initialize the random number
generator state. The argument @var{state} is an array of @var{size}
bytes, used to hold the state information. It is initialized based on
@@ -1401,7 +1401,7 @@ restore that state.
@comment stdlib.h
@comment BSD
-@deftypefun {void *} setstate (void *@var{state})
+@deftypefun {char *} setstate (char *@var{state})
The @code{setstate} function restores the random number state
information @var{state}. The argument must have been the result of
a previous call to @var{initstate} or @var{setstate}.
@@ -1692,7 +1692,7 @@ programs.
@comment stdlib.h
@comment GNU
-@deftypefun int lrand48_r (struct drand48_data *@var{buffer}, double *@var{result})
+@deftypefun int lrand48_r (struct drand48_data *@var{buffer}, long int *@var{result})
This function is similar to @code{lrand48}, but in addition it takes a
pointer to a buffer describing the state of the random number generator
just like @code{drand48}.
@@ -1722,7 +1722,7 @@ programs.
@comment stdlib.h
@comment GNU
-@deftypefun int mrand48_r (struct drand48_data *@var{buffer}, double *@var{result})
+@deftypefun int mrand48_r (struct drand48_data *@var{buffer}, long int *@var{result})
This function is similar to @code{mrand48} but like the other reentrant
functions it uses the random number generator described by the value in
the buffer pointed to by @var{buffer}.
diff --git a/libc/manual/message.texi b/libc/manual/message.texi
index 2b186ee11..ea5e1a132 100644
--- a/libc/manual/message.texi
+++ b/libc/manual/message.texi
@@ -1441,7 +1441,8 @@ string containing the name of the selected codeset. The string is
allocated internally in the function and must not be changed by the
user. If the system went out of core during the execution of
@code{bind_textdomain_codeset}, the return value is @code{NULL} and the
-global variable @var{errno} is set accordingly. @end deftypefun
+global variable @var{errno} is set accordingly.
+@end deftypefun
@node GUI program problems
diff --git a/libc/manual/nss.texi b/libc/manual/nss.texi
index 29fa4cc8d..bf3e69dee 100644
--- a/libc/manual/nss.texi
+++ b/libc/manual/nss.texi
@@ -10,7 +10,7 @@ correctly in the local environment. Traditionally, this was done by
using files (e.g., @file{/etc/passwd}), but other nameservices (like the
Network Information Service (NIS) and the Domain Name Service (DNS))
became popular, and were hacked into the C library, usually with a fixed
-search order (@pxref{frobnicate, , ,jargon, The Jargon File}).
+search order.
@Theglibc{} contains a cleaner solution of this problem. It is
designed after a method used by Sun Microsystems in the C library of
diff --git a/libc/manual/resource.texi b/libc/manual/resource.texi
index cb25d2440..1ec7af29f 100644
--- a/libc/manual/resource.texi
+++ b/libc/manual/resource.texi
@@ -129,9 +129,9 @@ scheduled).
@code{vtimes} and its @code{vtimes} data structure are declared in
@file{sys/vtimes.h}.
@pindex sys/vtimes.h
-@comment vtimes.h
-@deftypefun int vtimes (struct vtimes @var{current}, struct vtimes @var{child})
+@comment sys/vtimes.h
+@deftypefun int vtimes (struct vtimes *@var{current}, struct vtimes *@var{child})
@code{vtimes} reports resource usage totals for a process.
@@ -419,7 +419,7 @@ operand must be less than @code{RLIM_NLIMITS}.
@comment sys/resource.h
@comment BSD
-@deftypevr Constant int RLIM_INFINITY
+@deftypevr Constant rlim_t RLIM_INFINITY
This constant stands for a value of ``infinity'' when supplied as
the limit value in @code{setrlimit}.
@end deftypevr
@@ -433,7 +433,7 @@ above do. The functions above are better choices.
@comment ulimit.h
@comment BSD
-@deftypefun int ulimit (int @var{cmd}, @dots{})
+@deftypefun {long int} ulimit (int @var{cmd}, @dots{})
@code{ulimit} gets the current limit or sets the current and maximum
limit for a particular resource for the calling process according to the
@@ -893,7 +893,7 @@ It is functionally identical to @code{sched_setscheduler} with
@comment sched.h
@comment POSIX
-@deftypefun int sched_getparam (pid_t @var{pid}, const struct sched_param *@var{param})
+@deftypefun int sched_getparam (pid_t @var{pid}, struct sched_param *@var{param})
This function returns a process' absolute priority.
@@ -922,7 +922,7 @@ There is no process with pid @var{pid} and it is not zero.
@comment sched.h
@comment POSIX
-@deftypefun int sched_get_priority_min (int *@var{policy})
+@deftypefun int sched_get_priority_min (int @var{policy})
This function returns the lowest absolute priority value that is
allowable for a process with scheduling policy @var{policy}.
@@ -942,7 +942,7 @@ to this function are:
@comment sched.h
@comment POSIX
-@deftypefun int sched_get_priority_max (int *@var{policy})
+@deftypefun int sched_get_priority_max (int @var{policy})
This function returns the highest absolute priority value that is
allowable for a process that with scheduling policy @var{policy}.
diff --git a/libc/manual/search.texi b/libc/manual/search.texi
index 498832bdd..efd360479 100644
--- a/libc/manual/search.texi
+++ b/libc/manual/search.texi
@@ -71,7 +71,7 @@ two functions can be found in @file{search.h}.
@comment search.h
@comment SVID
-@deftypefun {void *} lfind (const void *@var{key}, void *@var{base}, size_t *@var{nmemb}, size_t @var{size}, comparison_fn_t @var{compar})
+@deftypefun {void *} lfind (const void *@var{key}, const void *@var{base}, size_t *@var{nmemb}, size_t @var{size}, comparison_fn_t @var{compar})
The @code{lfind} function searches in the array with @code{*@var{nmemb}}
elements of @var{size} bytes pointed to by @var{base} for an element
which matches the one pointed to by @var{key}. The function pointed to
diff --git a/libc/manual/signal.texi b/libc/manual/signal.texi
index 18db3d226..adcda3752 100644
--- a/libc/manual/signal.texi
+++ b/libc/manual/signal.texi
@@ -2921,7 +2921,7 @@ you use it.
@comment unistd.h
@comment POSIX.1
-@deftypefun int pause ()
+@deftypefun int pause (void)
The @code{pause} function suspends program execution until a signal
arrives whose action is either to execute a handler function, or to
terminate the process.
@@ -3195,7 +3195,7 @@ This field is true if the process is currently using this stack.
@comment signal.h
@comment BSD
-@deftypefun int sigstack (const struct sigstack *@var{stack}, struct sigstack *@var{oldstack})
+@deftypefun int sigstack (struct sigstack *@var{stack}, struct sigstack *@var{oldstack})
The @code{sigstack} function specifies an alternate stack for use during
signal handling. When a signal is received by the process and its
action indicates that the signal stack is used, the system arranges a
diff --git a/libc/manual/socket.texi b/libc/manual/socket.texi
index b12c59131..e187402ab 100644
--- a/libc/manual/socket.texi
+++ b/libc/manual/socket.texi
@@ -726,12 +726,12 @@ for information about this.
* Internet Address Formats:: How socket addresses are specified in the
Internet namespace.
* Host Addresses:: All about host addresses of Internet host.
-* Protocols Database:: Referring to protocols by name.
* Ports:: Internet port numbers.
* Services Database:: Ports may have symbolic names.
* Byte Order:: Different hosts may use different byte
ordering conventions; you need to
canonicalize host address and port number.
+* Protocols Database:: Referring to protocols by name.
* Inet Example:: Putting it all together.
@end menu
@@ -1127,7 +1127,7 @@ responsibility to make sure the buffer is large enough.
@comment arpa/inet.h
@comment IPv6 basic API
-@deftypefun {const char *} inet_ntop (int @var{af}, const void *@var{cp}, char *@var{buf}, size_t @var{len})
+@deftypefun {const char *} inet_ntop (int @var{af}, const void *@var{cp}, char *@var{buf}, socklen_t @var{len})
This function converts an Internet address (either IPv4 or IPv6) from
network (binary) to presentation (textual) form. @var{af} should be
either @code{AF_INET} or @code{AF_INET6}, as appropriate. @var{cp} is a
@@ -1225,7 +1225,7 @@ allows the caller to specify the desired address family (e.g.@:
@comment netdb.h
@comment BSD
-@deftypefun {struct hostent *} gethostbyaddr (const char *@var{addr}, size_t @var{length}, int @var{format})
+@deftypefun {struct hostent *} gethostbyaddr (const void *@var{addr}, socklen_t @var{length}, int @var{format})
The @code{gethostbyaddr} function returns information about the host
with Internet address @var{addr}. The parameter @var{addr} is not
really a pointer to char - it can be a pointer to an IPv4 or an IPv6
@@ -1339,7 +1339,7 @@ allows the caller to specify the desired address family (e.g.@:
@comment netdb.h
@comment GNU
-@deftypefun int gethostbyaddr_r (const char *@var{addr}, size_t @var{length}, int @var{format}, struct hostent *restrict @var{result_buf}, char *restrict @var{buf}, size_t @var{buflen}, struct hostent **restrict @var{result}, int *restrict @var{h_errnop})
+@deftypefun int gethostbyaddr_r (const void *@var{addr}, socklen_t @var{length}, int @var{format}, struct hostent *restrict @var{result_buf}, char *restrict @var{buf}, size_t @var{buflen}, struct hostent **restrict @var{result}, int *restrict @var{h_errnop})
The @code{gethostbyaddr_r} function returns information about the host
with Internet address @var{addr}. The parameter @var{addr} is not
really a pointer to char - it can be a pointer to an IPv4 or an IPv6
@@ -2248,7 +2248,7 @@ you get a @code{SIGPIPE} signal for any use of @code{send} or
@comment sys/socket.h
@comment BSD
-@deftypefun int send (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags})
+@deftypefun ssize_t send (int @var{socket}, const void *@var{buffer}, size_t @var{size}, int @var{flags})
The @code{send} function is like @code{write}, but with the additional
flags @var{flags}. The possible values of @var{flags} are described
in @ref{Socket Data Options}.
@@ -2315,7 +2315,7 @@ Primitives}.
@comment sys/socket.h
@comment BSD
-@deftypefun int recv (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags})
+@deftypefun ssize_t recv (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags})
The @code{recv} function is like @code{read}, but with the additional
flags @var{flags}. The possible values of @var{flags} are described
in @ref{Socket Data Options}.
@@ -2643,7 +2643,7 @@ more information about the @code{connect} function.
@comment sys/socket.h
@comment BSD
-@deftypefun int sendto (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, socklen_t @var{length})
+@deftypefun ssize_t sendto (int @var{socket}, const void *@var{buffer}, size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, socklen_t @var{length})
The @code{sendto} function transmits the data in the @var{buffer}
through the socket @var{socket} to the destination address specified
by the @var{addr} and @var{length} arguments. The @var{size} argument
@@ -2678,7 +2678,7 @@ also tells you where it was sent from. This function is declared in
@comment sys/socket.h
@comment BSD
-@deftypefun int recvfrom (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, socklen_t *@var{length-ptr})
+@deftypefun ssize_t recvfrom (int @var{socket}, void *@var{buffer}, size_t @var{size}, int @var{flags}, struct sockaddr *@var{addr}, socklen_t *@var{length-ptr})
The @code{recvfrom} function reads one packet from the socket
@var{socket} into the buffer @var{buffer}. The @var{size} argument
specifies the maximum number of bytes to be read.
@@ -2725,7 +2725,7 @@ you don't want to specify @var{flags} (@pxref{I/O Primitives}).
@comment sys/socket.h
@comment BSD
-@deftypefun int sendmsg (int @var{socket}, const struct msghdr *@var{message}, int @var{flags})
+@deftypefun ssize_t sendmsg (int @var{socket}, const struct msghdr *@var{message}, int @var{flags})
This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
@@ -2736,7 +2736,7 @@ whatever) are freed even if the thread is cancel.
@comment sys/socket.h
@comment BSD
-@deftypefun int recvmsg (int @var{socket}, struct msghdr *@var{message}, int @var{flags})
+@deftypefun ssize_t recvmsg (int @var{socket}, struct msghdr *@var{message}, int @var{flags})
This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
@@ -2953,7 +2953,7 @@ The @var{optname} doesn't make sense for the given @var{level}.
@comment sys/socket.h
@comment BSD
-@deftypefun int setsockopt (int @var{socket}, int @var{level}, int @var{optname}, void *@var{optval}, socklen_t @var{optlen})
+@deftypefun int setsockopt (int @var{socket}, int @var{level}, int @var{optname}, const void *@var{optval}, socklen_t @var{optlen})
This function is used to set the socket option @var{optname} at level
@var{level} for socket @var{socket}. The value of the option is passed
in the buffer @var{optval} of size @var{optlen}.
@@ -3157,7 +3157,7 @@ network.
@comment netdb.h
@comment BSD
-@deftypefun {struct netent *} getnetbyaddr (unsigned long int @var{net}, int @var{type})
+@deftypefun {struct netent *} getnetbyaddr (uint32_t @var{net}, int @var{type})
The @code{getnetbyaddr} function returns information about the network
of type @var{type} with number @var{net}. You should specify a value of
@code{AF_INET} for the @var{type} argument for Internet networks.
diff --git a/libc/manual/startup.texi b/libc/manual/startup.texi
index d0be5e65f..a2777141c 100644
--- a/libc/manual/startup.texi
+++ b/libc/manual/startup.texi
@@ -220,7 +220,7 @@ programming of code like this the function @code{getsubopt} is
available.
@comment stdlib.h
-@deftypefun int getsubopt (char **@var{optionp}, const char* const *@var{tokens}, char **@var{valuep})
+@deftypefun int getsubopt (char **@var{optionp}, char *const *@var{tokens}, char **@var{valuep})
The @var{optionp} parameter must be a pointer to a variable containing
the address of the string to process. When the function returns the
diff --git a/libc/manual/stdio.texi b/libc/manual/stdio.texi
index 7b436f080..3f9be9bc5 100644
--- a/libc/manual/stdio.texi
+++ b/libc/manual/stdio.texi
@@ -834,7 +834,7 @@ function except that it does not implicitly lock the stream.
@comment wchar.h
@comment POSIX
-@deftypefun wint_t fputwc_unlocked (wint_t @var{wc}, FILE *@var{stream})
+@deftypefun wint_t fputwc_unlocked (wchar_t @var{wc}, FILE *@var{stream})
The @code{fputwc_unlocked} function is equivalent to the @code{fputwc}
function except that it does not implicitly lock the stream.
@@ -3853,7 +3853,7 @@ as an argument to receive a string read under control of the @samp{%s},
@comment wchar.h
@comment ISO
-@deftypefun int swscanf (const wchar_t *@var{ws}, const char *@var{template}, @dots{})
+@deftypefun int swscanf (const wchar_t *@var{ws}, const wchar_t *@var{template}, @dots{})
This is like @code{wscanf}, except that the characters are taken from the
null-terminated string @var{ws} instead of from a stream. Reaching the
end of the string is treated as an end-of-file condition.
diff --git a/libc/manual/string.texi b/libc/manual/string.texi
index 2844bc61e..246be8445 100644
--- a/libc/manual/string.texi
+++ b/libc/manual/string.texi
@@ -479,7 +479,7 @@ The value returned by @code{memmove} is the value of @var{to}.
@comment wchar.h
@comment ISO
-@deftypefun {wchar_t *} wmemmove (wchar *@var{wto}, const wchar_t *@var{wfrom}, size_t @var{size})
+@deftypefun {wchar_t *} wmemmove (wchar_t *@var{wto}, const wchar_t *@var{wfrom}, size_t @var{size})
@code{wmemmove} copies the @var{size} wide characters at @var{wfrom}
into the @var{size} wide characters at @var{wto}, even if those two
blocks of space overlap. In the case of overlap, @code{memmove} is
@@ -1065,7 +1065,7 @@ If the contents of the two blocks are equal, @code{memcmp} returns
@code{0}.
@end deftypefun
-@comment wcjar.h
+@comment wchar.h
@comment ISO
@deftypefun int wmemcmp (const wchar_t *@var{a1}, const wchar_t *@var{a2}, size_t @var{size})
The function @code{wmemcmp} compares the @var{size} wide characters
@@ -1171,7 +1171,7 @@ regards these characters as parts of the alphabet they do match.
@comment wchar.h
@comment GNU
-@deftypefun int wcscasecmp (const wchar_t *@var{ws1}, const wchar_T *@var{ws2})
+@deftypefun int wcscasecmp (const wchar_t *@var{ws1}, const wchar_t *@var{ws2})
This function is like @code{wcscmp}, except that differences in case are
ignored. How uppercase and lowercase characters are related is
determined by the currently selected locale. In the standard @code{"C"}
@@ -1978,7 +1978,7 @@ separately. The function is not locale-dependent.
@comment wchar.h
@comment ISO
-@deftypefun {wchar_t *} wcstok (wchar_t *@var{newstring}, const char *@var{delimiters})
+@deftypefun {wchar_t *} wcstok (wchar_t *@var{newstring}, const wchar_t *@var{delimiters})
A string can be split into tokens by making a series of calls to the
function @code{wcstok}.
@@ -2175,7 +2175,7 @@ on different systems.
@comment libgen.h
@comment XPG
-@deftypefun {char *} basename (char *@var{path})
+@deftypefun {char *} basename (const char *@var{path})
This is the standard XPG defined @code{basename}. It is similar in
spirit to the GNU version, but may modify the @var{path} by removing
trailing '/' characters. If the @var{path} is made up entirely of '/'
@@ -2483,7 +2483,7 @@ Returns the number of elements in the argz vector @var{argz} and
@comment argz.h
@comment GNU
-@deftypefun {void} argz_extract (char *@var{argz}, size_t @var{argz_len}, char **@var{argv})
+@deftypefun {void} argz_extract (const char *@var{argz}, size_t @var{argz_len}, char **@var{argv})
The @code{argz_extract} function converts the argz vector @var{argz} and
@var{argz_len} into a Unix-style argument vector stored in @var{argv},
by putting pointers to every element in @var{argz} into successive
@@ -2561,7 +2561,7 @@ is @code{0}, @var{entry} is added to the end instead (as if by
@comment argz.h
@comment GNU
-@deftypefun {char *} argz_next (char *@var{argz}, size_t @var{argz_len}, const char *@var{entry})
+@deftypefun {char *} argz_next (const char *@var{argz}, size_t @var{argz_len}, const char *@var{entry})
The @code{argz_next} function provides a convenient way of iterating
over the elements in the argz vector @var{argz}. It returns a pointer
to the next element in @var{argz} after the element @var{entry}, or
diff --git a/libc/manual/sysinfo.texi b/libc/manual/sysinfo.texi
index 1733bc3b5..5df2a0f24 100644
--- a/libc/manual/sysinfo.texi
+++ b/libc/manual/sysinfo.texi
@@ -691,7 +691,7 @@ used in situations where multiple threads access the file.
@comment mntent.h
@comment BSD
-@deftypefun {struct mntent *} getmntent_r (FILE *@var{stream}, struct mentent *@var{result}, char *@var{buffer}, int @var{bufsize})
+@deftypefun {struct mntent *} getmntent_r (FILE *@var{stream}, struct mntent *@var{result}, char *@var{buffer}, int @var{bufsize})
The @code{getmntent_r} function is the reentrant variant of
@code{getmntent}. It also returns the next entry from the file and
returns a pointer. The actual variable the values are stored in is not
@@ -1062,9 +1062,9 @@ when @code{umount2} is also available.
This section describes the @code{sysctl} function, which gets and sets
a variety of system parameters.
-The symbols used in this section are declared in the file @file{sysctl.h}.
+The symbols used in this section are declared in the file @file{sys/sysctl.h}.
-@comment sysctl.h
+@comment sys/sysctl.h
@comment BSD
@deftypefun int sysctl (int *@var{names}, int @var{nlen}, void *@var{oldval}, size_t *@var{oldlenp}, void *@var{newval}, size_t @var{newlen})
@@ -1090,7 +1090,7 @@ in a hierarchical structure like a hierarchical filesystem. To identify
a particular parameter, you specify a path through the structure in a
way analogous to specifying the pathname of a file. Each component of
the path is specified by an integer and each of these integers has a
-macro defined for it by @file{sysctl.h}. @var{names} is the path, in
+macro defined for it by @file{sys/sysctl.h}. @var{names} is the path, in
the form of an array of integers. Each component of the path is one
element of the array, in order. @var{nlen} is the number of components
in the path.
diff --git a/libc/manual/syslog.texi b/libc/manual/syslog.texi
index 15f5e42bd..4e64d2a5e 100644
--- a/libc/manual/syslog.texi
+++ b/libc/manual/syslog.texi
@@ -275,7 +275,7 @@ The symbols referred to in this section are declared in the file
@c syslog() is implemented as a call to vsyslog().
@comment syslog.h
@comment BSD
-@deftypefun void syslog (int @var{facility_priority}, char *@var{format}, @dots{})
+@deftypefun void syslog (int @var{facility_priority}, const char *@var{format}, @dots{})
@code{syslog} submits a message to the Syslog facility. It does this by
writing to the Unix domain socket @code{/dev/log}.
@@ -403,7 +403,7 @@ syslog (LOG_MAKEPRI(LOG_LOCAL1, LOG_ERROR),
@comment syslog.h
@comment BSD
-@deftypefun void vsyslog (int @var{facility_priority}, char *@var{format}, va_list @var{arglist})
+@deftypefun void vsyslog (int @var{facility_priority}, const char *@var{format}, va_list @var{arglist})
This is functionally identical to @code{syslog}, with the BSD style variable
length argument.
diff --git a/libc/manual/terminal.texi b/libc/manual/terminal.texi
index 8321237f6..9e9c05709 100644
--- a/libc/manual/terminal.texi
+++ b/libc/manual/terminal.texi
@@ -621,7 +621,7 @@ If this bit is set, convert the newline character on output into a pair
of characters, carriage return followed by linefeed.
@end deftypevr
-@comment termios.h
+@comment termios.h (optional)
@comment BSD
@deftypevr Macro tcflag_t OXTABS
If this bit is set, convert tab characters on output into the appropriate
@@ -630,7 +630,7 @@ exists only on BSD systems and @gnuhurdsystems{}; on
@gnulinuxsystems{} it is available as @code{XTABS}.
@end deftypevr
-@comment termios.h
+@comment termios.h (optional)
@comment BSD
@deftypevr Macro tcflag_t ONOEOT
If this bit is set, discard @kbd{C-d} characters (code @code{004}) on
@@ -962,7 +962,7 @@ This is the bit that toggles when the user types the DISCARD character.
While this bit is set, all output is discarded. @xref{Other Special}.
@end deftypevr
-@comment termios.h
+@comment termios.h (optional)
@comment BSD
@deftypevr Macro tcflag_t NOKERNINFO
Setting this bit disables handling of the STATUS character.
@@ -1686,7 +1686,7 @@ of the terminal which is open with file descriptor @var{filedes}.
@comment sgtty.h
@comment BSD
-@deftypefun int stty (int @var{filedes}, struct sgttyb *@var{attributes})
+@deftypefun int stty (int @var{filedes}, const struct sgttyb *@var{attributes})
This function sets the attributes of a terminal.
diff --git a/libc/manual/time.texi b/libc/manual/time.texi
index 7dff44f42..ff31e284f 100644
--- a/libc/manual/time.texi
+++ b/libc/manual/time.texi
@@ -420,7 +420,7 @@ current calendar time is not available, the value
@c Linux.
@comment time.h
@comment SVID, XPG
-@deftypefun int stime (time_t *@var{newtime})
+@deftypefun int stime (const time_t *@var{newtime})
@code{stime} sets the system clock, i.e., it tells the system that the
current calendar time is @var{newtime}, where @code{newtime} is
interpreted as described in the above definition of @code{time_t}.
@@ -2314,7 +2314,7 @@ The @code{struct timeval} data type is described in @ref{Elapsed Time}.
@comment sys/time.h
@comment BSD
-@deftypefun int setitimer (int @var{which}, struct itimerval *@var{new}, struct itimerval *@var{old})
+@deftypefun int setitimer (int @var{which}, const struct itimerval *@var{new}, struct itimerval *@var{old})
The @code{setitimer} function sets the timer specified by @var{which}
according to @var{new}. The @var{which} argument can have a value of
@code{ITIMER_REAL}, @code{ITIMER_VIRTUAL}, or @code{ITIMER_PROF}.
diff --git a/libc/manual/users.texi b/libc/manual/users.texi
index 1ee5a0b17..957e34659 100644
--- a/libc/manual/users.texi
+++ b/libc/manual/users.texi
@@ -437,7 +437,7 @@ should include the header file @file{grp.h}.
@comment grp.h
@comment BSD
-@deftypefun int setgroups (size_t @var{count}, gid_t *@var{groups})
+@deftypefun int setgroups (size_t @var{count}, const gid_t *@var{groups})
This function sets the process's supplementary group IDs. It can only
be called from privileged processes. The @var{count} argument specifies
the number of group IDs in the array @var{groups}.
@@ -1655,7 +1655,7 @@ A null pointer is returned when no more entries are available.
@comment pwd.h
@comment GNU
-@deftypefun int getpwent_r (struct passwd *@var{result_buf}, char *@var{buffer}, int @var{buflen}, struct passwd **@var{result})
+@deftypefun int getpwent_r (struct passwd *@var{result_buf}, char *@var{buffer}, size_t @var{buflen}, struct passwd **@var{result})
This function is similar to @code{getpwent} in that it returns the next
entry from the stream initialized by @code{setpwent}. Like
@code{fgetpwent_r}, it uses the user-supplied buffers in
@@ -2005,7 +2005,7 @@ value of @code{0} means no further entries exist or internal errors occurred.
@comment netdb.h
@comment GNU
-@deftypefun int getnetgrent_r (char **@var{hostp}, char **@var{userp}, char **@var{domainp}, char *@var{buffer}, int @var{buflen})
+@deftypefun int getnetgrent_r (char **@var{hostp}, char **@var{userp}, char **@var{domainp}, char *@var{buffer}, size_t @var{buflen})
This function is similar to @code{getnetgrent} with only one exception:
the strings the three string pointers @var{hostp}, @var{userp}, and
@var{domainp} point to, are placed in the buffer of @var{buflen} bytes
diff --git a/libc/math/Makefile b/libc/math/Makefile
index 03b1baff5..ea24f70e5 100644
--- a/libc/math/Makefile
+++ b/libc/math/Makefile
@@ -199,9 +199,6 @@ $(addprefix $(objpfx),$(tests)): $(objpfx)libm.so$(libm.so-version)
else
$(addprefix $(objpfx),$(tests)): $(objpfx)libm.a
endif
-ifeq ($(build-bounded),yes)
-$(tests:%=$(objpfx)%-bp): $(objpfx)libm_b.a
-endif
gmp-objs = $(patsubst %,$(common-objpfx)stdlib/%.o,\
add_n sub_n cmp addmul_1 mul_1 mul_n divmod_1 \
diff --git a/libc/math/atest-exp.c b/libc/math/atest-exp.c
index 2678e743c..d76b9125c 100644
--- a/libc/math/atest-exp.c
+++ b/libc/math/atest-exp.c
@@ -61,7 +61,7 @@ exp_mpn (mp1 ex, mp1 x)
unsigned n;
mp1 xp;
mp2 tmp;
- mp_limb_t chk, round;
+ mp_limb_t chk;
mp1 tol;
memset (xp, 0, sizeof (mp1));
@@ -79,7 +79,7 @@ exp_mpn (mp1 ex, mp1 x)
mpn_mul_n (tmp, xp, x, SZ);
assert (tmp[SZ * 2 - 1] == 0);
if (n > 0)
- round = mpn_divmod_1 (xp, tmp + FRAC / mpbpl, SZ, n);
+ mpn_divmod_1 (xp, tmp + FRAC / mpbpl, SZ, n);
chk = mpn_add_n (ex, ex, xp, SZ);
assert (chk == 0);
n++;
diff --git a/libc/math/atest-exp2.c b/libc/math/atest-exp2.c
index b05d43b40..20836ca0d 100644
--- a/libc/math/atest-exp2.c
+++ b/libc/math/atest-exp2.c
@@ -102,7 +102,7 @@ exp_mpn (mp1 ex, mp1 x)
unsigned int n;
mp1 xp;
mp2 tmp;
- mp_limb_t chk, round;
+ mp_limb_t chk;
mp1 tol;
memset (xp, 0, sizeof (mp1));
@@ -120,7 +120,7 @@ exp_mpn (mp1 ex, mp1 x)
mpn_mul_n (tmp, xp, x, SZ);
assert(tmp[SZ * 2 - 1] == 0);
if (n > 0)
- round = mpn_divmod_1 (xp, tmp + FRAC / mpbpl, SZ, n);
+ mpn_divmod_1 (xp, tmp + FRAC / mpbpl, SZ, n);
chk = mpn_add_n (ex, ex, xp, SZ);
assert (chk == 0);
++n;
diff --git a/libc/math/atest-sincos.c b/libc/math/atest-sincos.c
index bea157c28..313bccb88 100644
--- a/libc/math/atest-sincos.c
+++ b/libc/math/atest-sincos.c
@@ -64,7 +64,6 @@ sincosx_mpn (mp1 si, mp1 co, mp1 xx, mp1 ix)
int i;
mp2 s[4], c[4];
mp1 tmp, x;
- mp_limb_t chk, round;
if (ix == NULL)
{
@@ -79,34 +78,38 @@ sincosx_mpn (mp1 si, mp1 co, mp1 xx, mp1 ix)
for (i = 0; i < 1 << N; i++)
{
#define add_shift_mulh(d,x,s1,s2,sh,n) \
- /* d = (n ? -1 : 1) * (s1 + (s2>>sh)) * x / (1>>N); */ \
do { \
if (s2 != NULL) { \
if (sh > 0) { \
assert (sh < mpbpl); \
mpn_lshift (tmp, s1, SZ, sh); \
- chk = (n ? mpn_sub_n : mpn_add_n)(tmp,tmp,s2+FRAC/mpbpl,SZ); \
- } else \
- chk = (n ? mpn_sub_n : mpn_add_n)(tmp,s1,s2+FRAC/mpbpl,SZ); \
- /* assert(chk == 0); */ \
+ if (n) \
+ mpn_sub_n (tmp,tmp,s2+FRAC/mpbpl,SZ); \
+ else \
+ mpn_add_n (tmp,tmp,s2+FRAC/mpbpl,SZ); \
+ } else { \
+ if (n) \
+ mpn_sub_n (tmp,s1,s2+FRAC/mpbpl,SZ); \
+ else \
+ mpn_add_n (tmp,s1,s2+FRAC/mpbpl,SZ); \
+ } \
mpn_mul_n(d,tmp,x,SZ); \
} else \
mpn_mul_n(d,s1,x,SZ); \
- /* assert(d[SZ*2-1] == 0); */ \
assert(N+sh < mpbpl); \
if (N+sh > 0) mpn_rshift(d,d,2*SZ,N+sh); \
} while(0)
#define summ(d,ss,s,n) \
- /* d = ss +/- (s[0]+2*s[1]+2*s[2]+s[3])/6; */ \
do { \
- chk = mpn_add_n(tmp,s[1]+FRAC/mpbpl,s[2]+FRAC/mpbpl,SZ); \
+ mpn_add_n(tmp,s[1]+FRAC/mpbpl,s[2]+FRAC/mpbpl,SZ); \
mpn_lshift(tmp,tmp,SZ,1); \
- chk |= mpn_add_n(tmp,tmp,s[0]+FRAC/mpbpl,SZ); \
- chk |= mpn_add_n(tmp,tmp,s[3]+FRAC/mpbpl,SZ); \
- round = mpn_divmod_1(tmp,tmp,SZ,6); \
- /* chk |= mpn_add_1(tmp,tmp,SZ, (round > 3) ); */ \
- chk |= (n ? mpn_sub_n : mpn_add_n)(d,ss,tmp,SZ); \
- /* assert(chk == 0); */ \
+ mpn_add_n(tmp,tmp,s[0]+FRAC/mpbpl,SZ); \
+ mpn_add_n(tmp,tmp,s[3]+FRAC/mpbpl,SZ); \
+ mpn_divmod_1(tmp,tmp,SZ,6); \
+ if (n) \
+ mpn_sub_n (d,ss,tmp,SZ); \
+ else \
+ mpn_add_n (d,ss,tmp,SZ); \
} while (0)
add_shift_mulh (s[0], x, co, NULL, 0, 0); /* s0 = h * c; */
diff --git a/libc/math/fegetenv.c b/libc/math/fegetenv.c
index fe08edaa7..14bb80123 100644
--- a/libc/math/fegetenv.c
+++ b/libc/math/fegetenv.c
@@ -19,7 +19,6 @@
#include <fenv.h>
#include <shlib-compat.h>
-#include <bp-sym.h>
int
__fegetenv (fenv_t *envp)
@@ -29,9 +28,9 @@ __fegetenv (fenv_t *envp)
}
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fegetenv, __old_fegetenv)
-compat_symbol (libm, BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2_1);
+compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
#endif
libm_hidden_ver (__fegetenv, fegetenv)
-versioned_symbol (libm, BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2_2);
+versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
stub_warning (fegetenv)
diff --git a/libc/math/k_casinh.c b/libc/math/k_casinh.c
index 7f98f24a8..41cd5ec47 100644
--- a/libc/math/k_casinh.c
+++ b/libc/math/k_casinh.c
@@ -57,6 +57,26 @@ __kernel_casinh (__complex__ double x, int adj)
res = __clog (y);
__real__ res += M_LN2;
}
+ else if (rx >= 0.5 && ix < DBL_EPSILON / 8.0)
+ {
+ double s = __ieee754_hypot (1.0, rx);
+
+ __real__ res = __ieee754_log (rx + s);
+ if (adj)
+ __imag__ res = __ieee754_atan2 (s, __imag__ x);
+ else
+ __imag__ res = __ieee754_atan2 (ix, s);
+ }
+ else if (rx < DBL_EPSILON / 8.0 && ix >= 1.5)
+ {
+ double s = __ieee754_sqrt ((ix + 1.0) * (ix - 1.0));
+
+ __real__ res = __ieee754_log (ix + s);
+ if (adj)
+ __imag__ res = __ieee754_atan2 (rx, __copysign (s, __imag__ x));
+ else
+ __imag__ res = __ieee754_atan2 (s, rx);
+ }
else
{
__real__ y = (rx - ix) * (rx + ix) + 1.0;
diff --git a/libc/math/k_casinhf.c b/libc/math/k_casinhf.c
index 940163634..3152ea2f7 100644
--- a/libc/math/k_casinhf.c
+++ b/libc/math/k_casinhf.c
@@ -57,6 +57,26 @@ __kernel_casinhf (__complex__ float x, int adj)
res = __clogf (y);
__real__ res += (float) M_LN2;
}
+ else if (rx >= 0.5f && ix < FLT_EPSILON / 8.0f)
+ {
+ float s = __ieee754_hypotf (1.0f, rx);
+
+ __real__ res = __ieee754_logf (rx + s);
+ if (adj)
+ __imag__ res = __ieee754_atan2f (s, __imag__ x);
+ else
+ __imag__ res = __ieee754_atan2f (ix, s);
+ }
+ else if (rx < FLT_EPSILON / 8.0f && ix >= 1.5f)
+ {
+ float s = __ieee754_sqrtf ((ix + 1.0f) * (ix - 1.0f));
+
+ __real__ res = __ieee754_logf (ix + s);
+ if (adj)
+ __imag__ res = __ieee754_atan2f (rx, __copysignf (s, __imag__ x));
+ else
+ __imag__ res = __ieee754_atan2f (s, rx);
+ }
else
{
__real__ y = (rx - ix) * (rx + ix) + 1.0;
diff --git a/libc/math/k_casinhl.c b/libc/math/k_casinhl.c
index 641297975..110ae33de 100644
--- a/libc/math/k_casinhl.c
+++ b/libc/math/k_casinhl.c
@@ -64,6 +64,26 @@ __kernel_casinhl (__complex__ long double x, int adj)
res = __clogl (y);
__real__ res += M_LN2l;
}
+ else if (rx >= 0.5L && ix < LDBL_EPSILON / 8.0L)
+ {
+ long double s = __ieee754_hypotl (1.0L, rx);
+
+ __real__ res = __ieee754_logl (rx + s);
+ if (adj)
+ __imag__ res = __ieee754_atan2l (s, __imag__ x);
+ else
+ __imag__ res = __ieee754_atan2l (ix, s);
+ }
+ else if (rx < LDBL_EPSILON / 8.0L && ix >= 1.5L)
+ {
+ long double s = __ieee754_sqrtl ((ix + 1.0L) * (ix - 1.0L));
+
+ __real__ res = __ieee754_logl (ix + s);
+ if (adj)
+ __imag__ res = __ieee754_atan2l (rx, __copysignl (s, __imag__ x));
+ else
+ __imag__ res = __ieee754_atan2l (s, rx);
+ }
else
{
__real__ y = (rx - ix) * (rx + ix) + 1.0;
diff --git a/libc/math/libm-test.inc b/libc/math/libm-test.inc
index 0e640c19c..5435c82b2 100644
--- a/libc/math/libm-test.inc
+++ b/libc/math/libm-test.inc
@@ -1498,6 +1498,35 @@ cacos_test (void)
TEST_c_c (cacos, 0x1.fp16383L, 0x1.fp16383L, 7.853981633974483096156608458198757210493e-1L, -1.135753137836666928715489992987020363057e4L);
#endif
+ TEST_c_c (cacos, 0x1.fp-129L, 1.5L, 1.570796326794896619231321691639751442097L, -1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, 0x1.fp-129L, -1.5L, 1.570796326794896619231321691639751442097L, 1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, -0x1.fp-129L, 1.5L, 1.570796326794896619231321691639751442100L, -1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, -0x1.fp-129L, -1.5L, 1.570796326794896619231321691639751442100L, 1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, 1.5L, 0x1.fp-129L, 2.546345110742945032959687790021055102355e-39L, -9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_c_c (cacos, -1.5L, 0x1.fp-129L, 3.141592653589793238462643383279502884195L, -9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (cacos, 1.5L, -0x1.fp-129L, 2.546345110742945032959687790021055102355e-39L, 9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_c_c (cacos, -1.5L, -0x1.fp-129L, 3.141592653589793238462643383279502884195L, 9.624236501192068949955178268487368462704e-1L);
+#ifndef TEST_FLOAT
+ TEST_c_c (cacos, 0x1.fp-1025L, 1.5L, 1.570796326794896619231321691639751442099L, -1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, 0x1.fp-1025L, -1.5L, 1.570796326794896619231321691639751442099L, 1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, -0x1.fp-1025L, 1.5L, 1.570796326794896619231321691639751442099L, -1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, -0x1.fp-1025L, -1.5L, 1.570796326794896619231321691639751442099L, 1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, 1.5L, 0x1.fp-1025L, 4.819934639999230680322935210539402497827e-309L, -9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_c_c (cacos, -1.5L, 0x1.fp-1025L, 3.141592653589793238462643383279502884197L, -9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (cacos, 1.5L, -0x1.fp-1025L, 4.819934639999230680322935210539402497827e-309L, 9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_c_c (cacos, -1.5L, -0x1.fp-1025L, 3.141592653589793238462643383279502884197L, 9.624236501192068949955178268487368462704e-1L);
+#endif
+#if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
+ TEST_c_c (cacos, 0x1.fp-16385L, 1.5L, 1.570796326794896619231321691639751442099L, -1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, 0x1.fp-16385L, -1.5L, 1.570796326794896619231321691639751442099L, 1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, -0x1.fp-16385L, 1.5L, 1.570796326794896619231321691639751442099L, -1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, -0x1.fp-16385L, -1.5L, 1.570796326794896619231321691639751442099L, 1.194763217287109304111930828519090523536L);
+ TEST_c_c (cacos, 1.5L, 0x1.fp-16385L, 7.282957076134209141226696333885150260319e-4933L, -9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION);
+ TEST_c_c (cacos, -1.5L, 0x1.fp-16385L, 3.141592653589793238462643383279502884197L, -9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (cacos, 1.5L, -0x1.fp-16385L, 7.282957076134209141226696333885150260319e-4933L, 9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION);
+ TEST_c_c (cacos, -1.5L, -0x1.fp-16385L, 3.141592653589793238462643383279502884197L, 9.624236501192068949955178268487368462704e-1L);
+#endif
+
TEST_c_c (cacos, 0.75L, 1.25L, 1.11752014915610270578240049553777969L, -1.13239363160530819522266333696834467L);
TEST_c_c (cacos, -2, -3, 2.1414491111159960199416055713254211L, 1.9833870299165354323470769028940395L);
@@ -1780,6 +1809,35 @@ casin_test (void)
TEST_c_c (casin, 0x1.fp16383L, 0x1.fp16383L, 7.853981633974483096156608458198757210493e-1L, 1.135753137836666928715489992987020363057e4L);
#endif
+ TEST_c_c (casin, 0x1.fp-129L, 1.5L, 1.579176199917649005841160751101628985741e-39L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_c_c (casin, 0x1.fp-129L, -1.5L, 1.579176199917649005841160751101628985741e-39L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_c_c (casin, -0x1.fp-129L, 1.5L, -1.579176199917649005841160751101628985741e-39L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_c_c (casin, -0x1.fp-129L, -1.5L, -1.579176199917649005841160751101628985741e-39L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_c_c (casin, 1.5L, 0x1.fp-129L, 1.570796326794896619231321691639751442096L, 9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (casin, -1.5L, 0x1.fp-129L, -1.570796326794896619231321691639751442096L, 9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (casin, 1.5L, -0x1.fp-129L, 1.570796326794896619231321691639751442096L, -9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (casin, -1.5L, -0x1.fp-129L, -1.570796326794896619231321691639751442096L, -9.624236501192068949955178268487368462704e-1L);
+#ifndef TEST_FLOAT
+ TEST_c_c (casin, 0x1.fp-1025L, 1.5L, 2.989196569048182929051881765490354365918e-309L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_c_c (casin, 0x1.fp-1025L, -1.5L, 2.989196569048182929051881765490354365918e-309L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_c_c (casin, -0x1.fp-1025L, 1.5L, -2.989196569048182929051881765490354365918e-309L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_c_c (casin, -0x1.fp-1025L, -1.5L, -2.989196569048182929051881765490354365918e-309L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_c_c (casin, 1.5L, 0x1.fp-1025L, 1.570796326794896619231321691639751442099L, 9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (casin, -1.5L, 0x1.fp-1025L, -1.570796326794896619231321691639751442099L, 9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (casin, 1.5L, -0x1.fp-1025L, 1.570796326794896619231321691639751442099L, -9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (casin, -1.5L, -0x1.fp-1025L, -1.570796326794896619231321691639751442099L, -9.624236501192068949955178268487368462704e-1L);
+#endif
+#if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
+ TEST_c_c (casin, 0x1.fp-16385L, 1.5L, 4.516698239814521372306784062043266700598e-4933L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION);
+ TEST_c_c (casin, 0x1.fp-16385L, -1.5L, 4.516698239814521372306784062043266700598e-4933L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION);
+ TEST_c_c (casin, -0x1.fp-16385L, 1.5L, -4.516698239814521372306784062043266700598e-4933L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION);
+ TEST_c_c (casin, -0x1.fp-16385L, -1.5L, -4.516698239814521372306784062043266700598e-4933L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION);
+ TEST_c_c (casin, 1.5L, 0x1.fp-16385L, 1.570796326794896619231321691639751442099L, 9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (casin, -1.5L, 0x1.fp-16385L, -1.570796326794896619231321691639751442099L, 9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (casin, 1.5L, -0x1.fp-16385L, 1.570796326794896619231321691639751442099L, -9.624236501192068949955178268487368462704e-1L);
+ TEST_c_c (casin, -1.5L, -0x1.fp-16385L, -1.570796326794896619231321691639751442099L, -9.624236501192068949955178268487368462704e-1L);
+#endif
+
TEST_c_c (casin, 0.75L, 1.25L, 0.453276177638793913448921196101971749L, 1.13239363160530819522266333696834467L);
TEST_c_c (casin, -2, -3, -0.57065278432109940071028387968566963L, -1.9833870299165354323470769028940395L);
@@ -1907,6 +1965,35 @@ casinh_test (void)
TEST_c_c (casinh, 0x1.fp16383L, 0x1.fp16383L, 1.135753137836666928715489992987020363057e4L, 7.853981633974483096156608458198757210493e-1L);
#endif
+ TEST_c_c (casinh, 0x1.fp-129L, 1.5L, 9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442096L);
+ TEST_c_c (casinh, 0x1.fp-129L, -1.5L, 9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442096L);
+ TEST_c_c (casinh, -0x1.fp-129L, 1.5L, -9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442096L);
+ TEST_c_c (casinh, -0x1.fp-129L, -1.5L, -9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442096L);
+ TEST_c_c (casinh, 1.5L, 0x1.fp-129L, 1.194763217287109304111930828519090523536L, 1.579176199917649005841160751101628985741e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_c_c (casinh, -1.5L, 0x1.fp-129L, -1.194763217287109304111930828519090523536L, 1.579176199917649005841160751101628985741e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_c_c (casinh, 1.5L, -0x1.fp-129L, 1.194763217287109304111930828519090523536L, -1.579176199917649005841160751101628985741e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_c_c (casinh, -1.5L, -0x1.fp-129L, -1.194763217287109304111930828519090523536L, -1.579176199917649005841160751101628985741e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+#ifndef TEST_FLOAT
+ TEST_c_c (casinh, 0x1.fp-1025L, 1.5L, 9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442099L);
+ TEST_c_c (casinh, 0x1.fp-1025L, -1.5L, 9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442099L);
+ TEST_c_c (casinh, -0x1.fp-1025L, 1.5L, -9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442099L);
+ TEST_c_c (casinh, -0x1.fp-1025L, -1.5L, -9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442099L);
+ TEST_c_c (casinh, 1.5L, 0x1.fp-1025L, 1.194763217287109304111930828519090523536L, 2.989196569048182929051881765490354365918e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_c_c (casinh, -1.5L, 0x1.fp-1025L, -1.194763217287109304111930828519090523536L, 2.989196569048182929051881765490354365918e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_c_c (casinh, 1.5L, -0x1.fp-1025L, 1.194763217287109304111930828519090523536L, -2.989196569048182929051881765490354365918e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_c_c (casinh, -1.5L, -0x1.fp-1025L, -1.194763217287109304111930828519090523536L, -2.989196569048182929051881765490354365918e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+#endif
+#if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
+ TEST_c_c (casinh, 0x1.fp-16385L, 1.5L, 9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442099L);
+ TEST_c_c (casinh, 0x1.fp-16385L, -1.5L, 9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442099L);
+ TEST_c_c (casinh, -0x1.fp-16385L, 1.5L, -9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442099L);
+ TEST_c_c (casinh, -0x1.fp-16385L, -1.5L, -9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442099L);
+ TEST_c_c (casinh, 1.5L, 0x1.fp-16385L, 1.194763217287109304111930828519090523536L, 4.516698239814521372306784062043266700598e-4933L, UNDERFLOW_EXCEPTION);
+ TEST_c_c (casinh, -1.5L, 0x1.fp-16385L, -1.194763217287109304111930828519090523536L, 4.516698239814521372306784062043266700598e-4933L, UNDERFLOW_EXCEPTION);
+ TEST_c_c (casinh, 1.5L, -0x1.fp-16385L, 1.194763217287109304111930828519090523536L, -4.516698239814521372306784062043266700598e-4933L, UNDERFLOW_EXCEPTION);
+ TEST_c_c (casinh, -1.5L, -0x1.fp-16385L, -1.194763217287109304111930828519090523536L, -4.516698239814521372306784062043266700598e-4933L, UNDERFLOW_EXCEPTION);
+#endif
+
TEST_c_c (casinh, 0.75L, 1.25L, 1.03171853444778027336364058631006594L, 0.911738290968487636358489564316731207L);
TEST_c_c (casinh, -2, -3, -1.9686379257930962917886650952454982L, -0.96465850440760279204541105949953237L);
diff --git a/libc/misc/Makefile b/libc/misc/Makefile
index 4e9f32537..5dc63347d 100644
--- a/libc/misc/Makefile
+++ b/libc/misc/Makefile
@@ -120,10 +120,6 @@ else
$(objpfx)tst-tsearch: $(common-objpfx)math/libm.a
endif
-ifeq ($(build-bounded),yes)
-$(objpfx)tst-tsearch-bp: $(common-objpfx)math/libm_b.a
-endif
-
tst-error1-ENV = MALLOC_TRACE=$(objpfx)tst-error1.mtrace
tst-error1-ARGS = $(objpfx)tst-error1.out
$(objpfx)tst-error1-mem: $(objpfx)tst-error1.out
diff --git a/libc/misc/sys/cdefs.h b/libc/misc/sys/cdefs.h
index 717bb7b6f..f5f18e914 100644
--- a/libc/misc/sys/cdefs.h
+++ b/libc/misc/sys/cdefs.h
@@ -128,14 +128,6 @@
#endif
-/* Support for bounded pointers. */
-#ifndef __BOUNDED_POINTERS__
-# define __bounded /* nothing */
-# define __unbounded /* nothing */
-# define __ptrvalue /* nothing */
-#endif
-
-
/* Fortify support. */
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
#define __bos0(ptr) __builtin_object_size (ptr, 0)
@@ -222,6 +214,15 @@
# define __attribute_malloc__ /* Ignore */
#endif
+/* Tell the compiler which arguments to an allocation function
+ indicate the size of the allocation. */
+#if __GNUC_PREREQ (4, 3)
+# define __attribute_alloc_size__(params) \
+ __attribute__ ((__alloc_size__ params))
+#else
+# define __attribute_alloc_size__(params) /* Ignore. */
+#endif
+
/* At some point during the gcc 2.96 development the `pure' attribute
for functions was introduced. We don't want to use it unconditionally
(although this would be possible) since it generates warnings. */
@@ -376,11 +377,11 @@
#endif
#if __GNUC__ >= 3
-# define __glibc_unlikely(cond) __builtin_expect((cond), 0)
-# define __glibc_likely(cond) __builtin_expect((cond), 1)
+# define __glibc_unlikely(cond) __builtin_expect ((cond), 0)
+# define __glibc_likely(cond) __builtin_expect ((cond), 1)
#else
-# define __glibc_unlikely(cond) (cond)
-# define __glibc_likely(cond) (cond)
+# define __glibc_unlikely(cond) (cond)
+# define __glibc_likely(cond) (cond)
#endif
#include <bits/wordsize.h>
diff --git a/libc/misc/sys/mman.h b/libc/misc/sys/mman.h
index 065fd497d..70454a5bd 100644
--- a/libc/misc/sys/mman.h
+++ b/libc/misc/sys/mman.h
@@ -128,7 +128,7 @@ extern int mincore (void *__start, size_t __len, unsigned char *__vec)
/* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length
NEW_LEN. If MREMAP_MAYMOVE is set in FLAGS the returned address
may differ from ADDR. If MREMAP_FIXED is set in FLAGS the function
- takes another paramter which is a fixed address at which the block
+ takes another parameter which is a fixed address at which the block
resides after a successful call. */
extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
int __flags, ...) __THROW;
diff --git a/libc/misc/tst-pselect.c b/libc/misc/tst-pselect.c
index 35d51d8ee..36bc46da6 100644
--- a/libc/misc/tst-pselect.c
+++ b/libc/misc/tst-pselect.c
@@ -4,6 +4,7 @@
#include <unistd.h>
#include <sys/select.h>
#include <sys/wait.h>
+#include <stdlib.h>
static volatile int handler_called;
diff --git a/libc/nis/nss-nisplus.h b/libc/nis/nss-nisplus.h
index f73ff4727..f28a08f14 100644
--- a/libc/nis/nss-nisplus.h
+++ b/libc/nis/nss-nisplus.h
@@ -28,7 +28,8 @@
extern const enum nss_status __niserr2nss_tab[] attribute_hidden;
extern const unsigned int __niserr2nss_count attribute_hidden;
-static inline enum nss_status
+static enum nss_status
+__attribute__ ((unused))
niserr2nss (int errval)
{
if ((unsigned int) errval >= __niserr2nss_count)
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog
index c4f6c630c..2374bbfd1 100644
--- a/libc/nptl/ChangeLog
+++ b/libc/nptl/ChangeLog
@@ -1,3 +1,78 @@
+2013-03-01 Carlos O'Donell <carlos@redhat.com>
+
+ * Makefile (tests): Revert last change.
+ (tst-pthread-stack-env-ENV): Likewise.
+ * nptl-init.c (set_default_stacksize): Likewise.
+ (__pthread_initialize_minimal_internal): Likewise.
+ * tst-pthread-stack-env.c: Likewise.
+
+2013-03-01 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * tst-oddstacklimit.c: Include stdlib.h.
+
+ * Makefile (tests): Add tst-pthread-stack-env.
+ (tst-pthread-stack-env-ENV): Set environment for test.
+ * nptl-init.c (set_default_stacksize): New function.
+ (__pthread_initialize_minimal_internal): Accept ARGC, ARGV and
+ ENVP. Initialize __ENVIRON and set __DEFAULT_STACKSIZE.
+ * tst-pthread-stack-env.c: New test case.
+
+2013-02-21 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
+ (FUTEX_WAIT_REQUEUE_PI): Define.
+ (FUTEX_CMP_REQUEUE_PI): Likewise.
+ (lll_futex_wait_requeue_pi): Likewise.
+ (lll_futex_timed_wait_requeue_pi): Likewise.
+ (lll_futex_cmp_requeue_pi): Likewise.
+
+2013-02-21 Carlos O'Donell <carlos@redhat.com>
+
+ * sysdeps/unix/sysv/linux/fork.c: Fix comment typo.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/pthread/tst-timer.c: Include stdlib.h for declaration
+ of exit.
+ * tst-barrier4.c: Likewise.
+ * tst-robust7.c: Likewise.
+
+ [BZ #14920]
+ * pthreadP.h (USE_REQUEUE_PI): New macro to check if mutex is
+ PI-aware.
+ * pthread_cond_broadcast.c (__pthread_cond_broadcast): Use
+ PI-aware futex operations if available and mutex is PI-aware.
+ * pthread_cond_signal.c (__pthread_cond_signal): Likewise.
+ * nptl/pthread_cond_timedwait.c (__pthread_cond_timedwait):
+ Likewise.
+ * pthread_cond_wait.c (__condvar_cleanup): Adjust lock if
+ cancellation occurred just after futex returned successfully
+ from a PI operation with the mutex held.
+ (__pthread_cond_wait): Use PI-aware futex operations if
+ available and mutex is PI-aware.
+ * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+ (FUTEX_WAIT_REQUEUE_PI): Define.
+ (FUTEX_CMP_REQUEUE_PI): Likewise.
+ (lll_futex_wait_requeue_pi): Likewise.
+ (lll_futex_timed_wait_requeue_pi): Likewise.
+ (lll_futex_cmp_requeue_pi): Likewise.
+ * nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
+ (FUTEX_WAIT_REQUEUE_PI): Define.
+ (FUTEX_CMP_REQUEUE_PI): Likewise.
+ (lll_futex_wait_requeue_pi): Likewise.
+ (lll_futex_timed_wait_requeue_pi): Likewise.
+ (lll_futex_cmp_requeue_pi): Likewise.
+ * sysdeps/unix/sysv/linux/kernel-features.h: Define
+ __ASSUME_REQUEUE_PI for Linux version higher than 2.6.31.
+
+2013-02-04 Andreas Schwab <schwab@suse.de>
+
+ [BZ #14142]
+ * tst-cancel14.c: Include <sys/time.h>.
+ * tst-cancel15.c: Likewise.
+ * tst-mutex9.c: Include <stdint.h>, <stdlib.h> and <sys/time.h>.
+ * tst-stackguard1.c: Include <tls.h>
+
2013-01-16 Andreas Schwab <schwab@suse.de>
[BZ #14327]
diff --git a/libc/nptl/Makeconfig b/libc/nptl/Makeconfig
index 7be9b0d7c..2a1399d74 100644
--- a/libc/nptl/Makeconfig
+++ b/libc/nptl/Makeconfig
@@ -24,7 +24,6 @@ have-thread-library = yes
shared-thread-library = $(common-objpfx)nptl/libpthread_nonshared.a \
$(common-objpfx)nptl/libpthread.so
static-thread-library = $(common-objpfx)nptl/libpthread.a
-bounded-thread-library = $(common-objpfx)nptl/libpthread_b.a
rpath-dirs += nptl
diff --git a/libc/nptl/pthreadP.h b/libc/nptl/pthreadP.h
index 993a79e25..d08b219b5 100644
--- a/libc/nptl/pthreadP.h
+++ b/libc/nptl/pthreadP.h
@@ -577,4 +577,16 @@ extern void __wait_lookup_done (void) attribute_hidden;
# define PTHREAD_STATIC_FN_REQUIRE(name) __asm (".globl " #name);
#endif
+/* Test if the mutex is suitable for the FUTEX_WAIT_REQUEUE_PI operation. */
+#if (defined lll_futex_wait_requeue_pi \
+ && defined __ASSUME_REQUEUE_PI)
+# define USE_REQUEUE_PI(mut) \
+ ((mut) && (mut) != (void *) ~0l \
+ && (((mut)->__data.__kind \
+ & (PTHREAD_MUTEX_PRIO_INHERIT_NP | PTHREAD_MUTEX_ROBUST_NORMAL_NP)) \
+ == PTHREAD_MUTEX_PRIO_INHERIT_NP))
+#else
+# define USE_REQUEUE_PI(mut) 0
+#endif
+
#endif /* pthreadP.h */
diff --git a/libc/nptl/pthread_cond_broadcast.c b/libc/nptl/pthread_cond_broadcast.c
index 968ee03da..0702ec0ec 100644
--- a/libc/nptl/pthread_cond_broadcast.c
+++ b/libc/nptl/pthread_cond_broadcast.c
@@ -53,34 +53,37 @@ __pthread_cond_broadcast (cond)
/* We are done. */
lll_unlock (cond->__data.__lock, pshared);
- /* Do not use requeue for pshared condvars. */
- if (cond->__data.__mutex == (void *) ~0l)
- goto wake_all;
-
/* Wake everybody. */
pthread_mutex_t *mut = (pthread_mutex_t *) cond->__data.__mutex;
- /* XXX: Kernel so far doesn't support requeue to PI futex. */
- /* XXX: Kernel so far can only requeue to the same type of futex,
- in this case private (we don't requeue for pshared condvars). */
- if (__builtin_expect (mut->__data.__kind
- & (PTHREAD_MUTEX_PRIO_INHERIT_NP
- | PTHREAD_MUTEX_PSHARED_BIT), 0))
+ /* Do not use requeue for pshared condvars. */
+ if (mut == (void *) ~0l
+ || PTHREAD_MUTEX_PSHARED (mut) & PTHREAD_MUTEX_PSHARED_BIT)
goto wake_all;
- /* lll_futex_requeue returns 0 for success and non-zero
- for errors. */
- if (__builtin_expect (lll_futex_requeue (&cond->__data.__futex, 1,
- INT_MAX, &mut->__data.__lock,
- futex_val, LLL_PRIVATE), 0))
+#if (defined lll_futex_cmp_requeue_pi \
+ && defined __ASSUME_REQUEUE_PI)
+ int pi_flag = PTHREAD_MUTEX_PRIO_INHERIT_NP | PTHREAD_MUTEX_ROBUST_NP;
+ pi_flag &= mut->__data.__kind;
+
+ if (pi_flag == PTHREAD_MUTEX_PRIO_INHERIT_NP)
{
- /* The requeue functionality is not available. */
- wake_all:
- lll_futex_wake (&cond->__data.__futex, INT_MAX, pshared);
+ if (lll_futex_cmp_requeue_pi (&cond->__data.__futex, 1, INT_MAX,
+ &mut->__data.__lock, futex_val,
+ LLL_PRIVATE) == 0)
+ return 0;
}
-
- /* That's all. */
- return 0;
+ else
+#endif
+ /* lll_futex_requeue returns 0 for success and non-zero
+ for errors. */
+ if (!__builtin_expect (lll_futex_requeue (&cond->__data.__futex, 1,
+ INT_MAX, &mut->__data.__lock,
+ futex_val, LLL_PRIVATE), 0))
+ return 0;
+
+wake_all:
+ lll_futex_wake (&cond->__data.__futex, INT_MAX, pshared);
}
/* We are done. */
diff --git a/libc/nptl/pthread_cond_signal.c b/libc/nptl/pthread_cond_signal.c
index 908a2acfa..102d0b380 100644
--- a/libc/nptl/pthread_cond_signal.c
+++ b/libc/nptl/pthread_cond_signal.c
@@ -47,12 +47,35 @@ __pthread_cond_signal (cond)
++cond->__data.__wakeup_seq;
++cond->__data.__futex;
- /* Wake one. */
- if (! __builtin_expect (lll_futex_wake_unlock (&cond->__data.__futex, 1,
- 1, &cond->__data.__lock,
- pshared), 0))
- return 0;
+#if (defined lll_futex_cmp_requeue_pi \
+ && defined __ASSUME_REQUEUE_PI)
+ int pi_flag = PTHREAD_MUTEX_PRIO_INHERIT_NP | PTHREAD_MUTEX_ROBUST_NP;
+ pthread_mutex_t *mut = cond->__data.__mutex;
+ /* Do not use requeue for pshared condvars. */
+ if (mut != (void *) ~0l)
+ pi_flag &= mut->__data.__kind;
+
+ if (__builtin_expect (pi_flag == PTHREAD_MUTEX_PRIO_INHERIT_NP, 0)
+ /* This can only really fail with a ENOSYS, since nobody can modify
+ futex while we have the cond_lock. */
+ && lll_futex_cmp_requeue_pi (&cond->__data.__futex, 1, 0,
+ &mut->__data.__lock,
+ cond->__data.__futex, pshared) == 0)
+ {
+ lll_unlock (cond->__data.__lock, pshared);
+ return 0;
+ }
+ else
+#endif
+ /* Wake one. */
+ if (! __builtin_expect (lll_futex_wake_unlock (&cond->__data.__futex,
+ 1, 1,
+ &cond->__data.__lock,
+ pshared), 0))
+ return 0;
+
+ /* Fallback if neither of them work. */
lll_futex_wake (&cond->__data.__futex, 1, pshared);
}
diff --git a/libc/nptl/pthread_cond_timedwait.c b/libc/nptl/pthread_cond_timedwait.c
index 0f52bd885..0a2d092e6 100644
--- a/libc/nptl/pthread_cond_timedwait.c
+++ b/libc/nptl/pthread_cond_timedwait.c
@@ -64,6 +64,11 @@ __pthread_cond_timedwait (cond, mutex, abstime)
int pshared = (cond->__data.__mutex == (void *) ~0l)
? LLL_SHARED : LLL_PRIVATE;
+#if (defined lll_futex_timed_wait_requeue_pi \
+ && defined __ASSUME_REQUEUE_PI)
+ int pi_flag = 0;
+#endif
+
/* Make sure we are alone. */
lll_lock (cond->__data.__lock, pshared);
@@ -155,17 +160,46 @@ __pthread_cond_timedwait (cond, mutex, abstime)
/* Enable asynchronous cancellation. Required by the standard. */
cbuffer.oldtype = __pthread_enable_asynccancel ();
+/* REQUEUE_PI was implemented after FUTEX_CLOCK_REALTIME, so it is sufficient
+ to check just the former. */
+#if (defined lll_futex_timed_wait_requeue_pi \
+ && defined __ASSUME_REQUEUE_PI)
+ /* If pi_flag remained 1 then it means that we had the lock and the mutex
+ but a spurious waker raced ahead of us. Give back the mutex before
+ going into wait again. */
+ if (pi_flag)
+ {
+ __pthread_mutex_cond_lock_adjust (mutex);
+ __pthread_mutex_unlock_usercnt (mutex, 0);
+ }
+ pi_flag = USE_REQUEUE_PI (mutex);
+
+ if (pi_flag)
+ {
+ unsigned int clockbit = (cond->__data.__nwaiters & 1
+ ? 0 : FUTEX_CLOCK_REALTIME);
+ err = lll_futex_timed_wait_requeue_pi (&cond->__data.__futex,
+ futex_val, abstime, clockbit,
+ &mutex->__data.__lock,
+ pshared);
+ pi_flag = (err == 0);
+ }
+ else
+#endif
+
+ {
#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
|| !defined lll_futex_timed_wait_bitset)
- /* Wait until woken by signal or broadcast. */
- err = lll_futex_timed_wait (&cond->__data.__futex,
- futex_val, &rt, pshared);
+ /* Wait until woken by signal or broadcast. */
+ err = lll_futex_timed_wait (&cond->__data.__futex,
+ futex_val, &rt, pshared);
#else
- unsigned int clockbit = (cond->__data.__nwaiters & 1
- ? 0 : FUTEX_CLOCK_REALTIME);
- err = lll_futex_timed_wait_bitset (&cond->__data.__futex, futex_val,
- abstime, clockbit, pshared);
+ unsigned int clockbit = (cond->__data.__nwaiters & 1
+ ? 0 : FUTEX_CLOCK_REALTIME);
+ err = lll_futex_timed_wait_bitset (&cond->__data.__futex, futex_val,
+ abstime, clockbit, pshared);
#endif
+ }
/* Disable asynchronous cancellation. */
__pthread_disable_asynccancel (cbuffer.oldtype);
@@ -217,7 +251,16 @@ __pthread_cond_timedwait (cond, mutex, abstime)
__pthread_cleanup_pop (&buffer, 0);
/* Get the mutex before returning. */
- err = __pthread_mutex_cond_lock (mutex);
+#if (defined lll_futex_timed_wait_requeue_pi \
+ && defined __ASSUME_REQUEUE_PI)
+ if (pi_flag)
+ {
+ __pthread_mutex_cond_lock_adjust (mutex);
+ err = 0;
+ }
+ else
+#endif
+ err = __pthread_mutex_cond_lock (mutex);
return err ?: result;
}
diff --git a/libc/nptl/pthread_cond_wait.c b/libc/nptl/pthread_cond_wait.c
index 0ae320cb8..01d42d783 100644
--- a/libc/nptl/pthread_cond_wait.c
+++ b/libc/nptl/pthread_cond_wait.c
@@ -26,7 +26,6 @@
#include <shlib-compat.h>
#include <stap-probe.h>
-
struct _condvar_cleanup_buffer
{
int oldtype;
@@ -85,8 +84,15 @@ __condvar_cleanup (void *arg)
lll_futex_wake (&cbuffer->cond->__data.__futex, INT_MAX, pshared);
/* Get the mutex before returning unless asynchronous cancellation
- is in effect. */
- __pthread_mutex_cond_lock (cbuffer->mutex);
+ is in effect. We don't try to get the mutex if we already own it. */
+ if (!(USE_REQUEUE_PI (cbuffer->mutex))
+ || ((cbuffer->mutex->__data.__lock & FUTEX_TID_MASK)
+ != THREAD_GETMEM (THREAD_SELF, tid)))
+ {
+ __pthread_mutex_cond_lock (cbuffer->mutex);
+ }
+ else
+ __pthread_mutex_cond_lock_adjust (cbuffer->mutex);
}
@@ -101,6 +107,11 @@ __pthread_cond_wait (cond, mutex)
int pshared = (cond->__data.__mutex == (void *) ~0l)
? LLL_SHARED : LLL_PRIVATE;
+#if (defined lll_futex_wait_requeue_pi \
+ && defined __ASSUME_REQUEUE_PI)
+ int pi_flag = 0;
+#endif
+
LIBC_PROBE (cond_wait, 2, cond, mutex);
/* Make sure we are alone. */
@@ -144,15 +155,36 @@ __pthread_cond_wait (cond, mutex)
do
{
unsigned int futex_val = cond->__data.__futex;
-
/* Prepare to wait. Release the condvar futex. */
lll_unlock (cond->__data.__lock, pshared);
/* Enable asynchronous cancellation. Required by the standard. */
cbuffer.oldtype = __pthread_enable_asynccancel ();
- /* Wait until woken by signal or broadcast. */
- lll_futex_wait (&cond->__data.__futex, futex_val, pshared);
+#if (defined lll_futex_wait_requeue_pi \
+ && defined __ASSUME_REQUEUE_PI)
+ /* If pi_flag remained 1 then it means that we had the lock and the mutex
+ but a spurious waker raced ahead of us. Give back the mutex before
+ going into wait again. */
+ if (pi_flag)
+ {
+ __pthread_mutex_cond_lock_adjust (mutex);
+ __pthread_mutex_unlock_usercnt (mutex, 0);
+ }
+ pi_flag = USE_REQUEUE_PI (mutex);
+
+ if (pi_flag)
+ {
+ err = lll_futex_wait_requeue_pi (&cond->__data.__futex,
+ futex_val, &mutex->__data.__lock,
+ pshared);
+
+ pi_flag = (err == 0);
+ }
+ else
+#endif
+ /* Wait until woken by signal or broadcast. */
+ lll_futex_wait (&cond->__data.__futex, futex_val, pshared);
/* Disable asynchronous cancellation. */
__pthread_disable_asynccancel (cbuffer.oldtype);
@@ -189,8 +221,17 @@ __pthread_cond_wait (cond, mutex)
/* The cancellation handling is back to normal, remove the handler. */
__pthread_cleanup_pop (&buffer, 0);
- /* Get the mutex before returning. */
- return __pthread_mutex_cond_lock (mutex);
+ /* Get the mutex before returning. Not needed for PI. */
+#if (defined lll_futex_wait_requeue_pi \
+ && defined __ASSUME_REQUEUE_PI)
+ if (pi_flag)
+ {
+ __pthread_mutex_cond_lock_adjust (mutex);
+ return 0;
+ }
+ else
+#endif
+ return __pthread_mutex_cond_lock (mutex);
}
versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
diff --git a/libc/nptl/pthread_create.c b/libc/nptl/pthread_create.c
index 6209b60d0..5307a0e6a 100644
--- a/libc/nptl/pthread_create.c
+++ b/libc/nptl/pthread_create.c
@@ -314,6 +314,9 @@ start_thread (void *arg)
#endif
}
+ /* Call destructors for the thread_local TLS variables. */
+ __call_tls_dtors ();
+
/* Run the destructor for the thread-local data. */
__nptl_deallocate_tsd ();
diff --git a/libc/nptl/sysdeps/pthread/bits/libc-lockP.h b/libc/nptl/sysdeps/pthread/bits/libc-lockP.h
index e45c0edcf..5556b81d1 100644
--- a/libc/nptl/sysdeps/pthread/bits/libc-lockP.h
+++ b/libc/nptl/sysdeps/pthread/bits/libc-lockP.h
@@ -413,31 +413,30 @@ extern int __pthread_atfork (void (*__prepare) (void),
single-threaded processes. */
#ifndef __NO_WEAK_PTHREAD_ALIASES
# ifdef weak_extern
-# include <bp-sym.h>
-weak_extern (BP_SYM (__pthread_mutex_init))
-weak_extern (BP_SYM (__pthread_mutex_destroy))
-weak_extern (BP_SYM (__pthread_mutex_lock))
-weak_extern (BP_SYM (__pthread_mutex_trylock))
-weak_extern (BP_SYM (__pthread_mutex_unlock))
-weak_extern (BP_SYM (__pthread_mutexattr_init))
-weak_extern (BP_SYM (__pthread_mutexattr_destroy))
-weak_extern (BP_SYM (__pthread_mutexattr_settype))
-weak_extern (BP_SYM (__pthread_rwlock_init))
-weak_extern (BP_SYM (__pthread_rwlock_destroy))
-weak_extern (BP_SYM (__pthread_rwlock_rdlock))
-weak_extern (BP_SYM (__pthread_rwlock_tryrdlock))
-weak_extern (BP_SYM (__pthread_rwlock_wrlock))
-weak_extern (BP_SYM (__pthread_rwlock_trywrlock))
-weak_extern (BP_SYM (__pthread_rwlock_unlock))
-weak_extern (BP_SYM (__pthread_key_create))
-weak_extern (BP_SYM (__pthread_setspecific))
-weak_extern (BP_SYM (__pthread_getspecific))
-weak_extern (BP_SYM (__pthread_once))
+weak_extern (__pthread_mutex_init)
+weak_extern (__pthread_mutex_destroy)
+weak_extern (__pthread_mutex_lock)
+weak_extern (__pthread_mutex_trylock)
+weak_extern (__pthread_mutex_unlock)
+weak_extern (__pthread_mutexattr_init)
+weak_extern (__pthread_mutexattr_destroy)
+weak_extern (__pthread_mutexattr_settype)
+weak_extern (__pthread_rwlock_init)
+weak_extern (__pthread_rwlock_destroy)
+weak_extern (__pthread_rwlock_rdlock)
+weak_extern (__pthread_rwlock_tryrdlock)
+weak_extern (__pthread_rwlock_wrlock)
+weak_extern (__pthread_rwlock_trywrlock)
+weak_extern (__pthread_rwlock_unlock)
+weak_extern (__pthread_key_create)
+weak_extern (__pthread_setspecific)
+weak_extern (__pthread_getspecific)
+weak_extern (__pthread_once)
weak_extern (__pthread_initialize)
weak_extern (__pthread_atfork)
-weak_extern (BP_SYM (_pthread_cleanup_push_defer))
-weak_extern (BP_SYM (_pthread_cleanup_pop_restore))
-weak_extern (BP_SYM (pthread_setcancelstate))
+weak_extern (_pthread_cleanup_push_defer)
+weak_extern (_pthread_cleanup_pop_restore)
+weak_extern (pthread_setcancelstate)
# else
# pragma weak __pthread_mutex_init
# pragma weak __pthread_mutex_destroy
diff --git a/libc/nptl/sysdeps/pthread/tst-timer.c b/libc/nptl/sysdeps/pthread/tst-timer.c
index f46addd79..fa1b6e72a 100644
--- a/libc/nptl/sysdeps/pthread/tst-timer.c
+++ b/libc/nptl/sysdeps/pthread/tst-timer.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <time.h>
#include <unistd.h>
+#include <stdlib.h>
static void
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/fork.c b/libc/nptl/sysdeps/unix/sysv/linux/fork.c
index 05f3dce03..ff089422e 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/fork.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/fork.c
@@ -35,7 +35,7 @@ unsigned long int *__fork_generation_pointer;
-/* The single linked list of all currently registered for handlers. */
+/* The single linked list of all currently registered fork handlers. */
struct fork_handler *__fork_handlers;
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h b/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
index b4b1fd4af..f33f70334 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
@@ -39,6 +39,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -149,6 +151,34 @@
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
+ })
+
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
#ifdef UP
# define __lll_acq_instr ""
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
index a0163d637..3dab05e05 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
@@ -37,6 +37,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -141,6 +143,32 @@
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ })
+
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
#define lll_compare_and_swap(futex, oldval, newval, operation) \
do { \
__typeof (futex) __futex = (futex); \
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h b/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
index c88ec1643..2d7d9f82f 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
@@ -37,6 +37,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -157,6 +159,34 @@ extern void __cpu_relax (void);
})
#endif
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
+ })
+
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
static inline int
__attribute__ ((always_inline))
__lll_trylock (int *futex)
diff --git a/libc/nptl/tst-barrier4.c b/libc/nptl/tst-barrier4.c
index 8b5b15321..2836fb341 100644
--- a/libc/nptl/tst-barrier4.c
+++ b/libc/nptl/tst-barrier4.c
@@ -20,6 +20,7 @@
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
+#include <stdlib.h>
static pthread_barrier_t b1;
diff --git a/libc/nptl/tst-cancel14.c b/libc/nptl/tst-cancel14.c
index fbaed4940..ca9042d60 100644
--- a/libc/nptl/tst-cancel14.c
+++ b/libc/nptl/tst-cancel14.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <sys/time.h>
static pthread_barrier_t bar;
diff --git a/libc/nptl/tst-cancel15.c b/libc/nptl/tst-cancel15.c
index 0119cc761..3f320ad00 100644
--- a/libc/nptl/tst-cancel15.c
+++ b/libc/nptl/tst-cancel15.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <sys/time.h>
static pthread_barrier_t bar;
diff --git a/libc/nptl/tst-mutex9.c b/libc/nptl/tst-mutex9.c
index adb3b61f0..1d689bd7e 100644
--- a/libc/nptl/tst-mutex9.c
+++ b/libc/nptl/tst-mutex9.c
@@ -18,10 +18,13 @@
#include <errno.h>
#include <pthread.h>
+#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
+#include <sys/time.h>
#include <sys/wait.h>
diff --git a/libc/nptl/tst-oddstacklimit.c b/libc/nptl/tst-oddstacklimit.c
index 2c7783f56..49754fe48 100644
--- a/libc/nptl/tst-oddstacklimit.c
+++ b/libc/nptl/tst-oddstacklimit.c
@@ -21,6 +21,7 @@
#include <string.h>
#include <sys/resource.h>
#include <sys/wait.h>
+#include <stdlib.h>
/* This sets the stack resource limit to 1023kb, which is not a multiple
of the page size since every architecture's page size is > 1k. */
diff --git a/libc/nptl/tst-robust7.c b/libc/nptl/tst-robust7.c
index e64a4fc86..ed1857c4e 100644
--- a/libc/nptl/tst-robust7.c
+++ b/libc/nptl/tst-robust7.c
@@ -20,6 +20,7 @@
#include <pthread.h>
#include <stdbool.h>
#include <stdio.h>
+#include <stdlib.h>
static pthread_barrier_t b;
diff --git a/libc/nptl/tst-stackguard1.c b/libc/nptl/tst-stackguard1.c
index f0f707f43..57a48ad29 100644
--- a/libc/nptl/tst-stackguard1.c
+++ b/libc/nptl/tst-stackguard1.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <sys/wait.h>
#include <stackguard-macros.h>
+#include <tls.h>
#include <unistd.h>
static const char *command;
diff --git a/libc/nscd/connections.c b/libc/nscd/connections.c
index f6e232863..56c327971 100644
--- a/libc/nscd/connections.c
+++ b/libc/nscd/connections.c
@@ -976,9 +976,25 @@ cannot change socket to nonblocking mode: %s"),
}
+/* Register the file in FINFO as a traced file for the database DBS[DBIX].
+
+ We support registering multiple files per database. Each call to
+ register_traced_file adds to the list of registered files.
+
+ When we prune the database, either through timeout or a request to
+ invalidate, we will check to see if any of the registered files has changed.
+ When we accept new connections to handle a cache request we will also
+ check to see if any of the registered files has changed.
+
+ If we have inotify support then we install an inotify fd to notify us of
+ file deletion or modification, both of which will require we invalidate
+ the cache for the database. Without inotify support we stat the file and
+ store st_mtime to determine if the file has been modified. */
void
register_traced_file (size_t dbidx, struct traced_file *finfo)
{
+ /* If the database is disabled or file checking is disabled
+ then ignore the registration. */
if (! dbs[dbidx].enabled || ! dbs[dbidx].check_file)
return;
@@ -1859,7 +1875,7 @@ fd_ready (int fd)
/* Check whether restarting should happen. */
-static inline int
+static bool
restart_p (time_t now)
{
return (paranoia && readylist == NULL && nready == nthreads
@@ -1870,6 +1886,63 @@ restart_p (time_t now)
/* Array for times a connection was accepted. */
static time_t *starttime;
+#ifdef HAVE_INOTIFY
+/* Inotify event for changed file. */
+union __inev
+{
+ struct inotify_event i;
+# ifndef PATH_MAX
+# define PATH_MAX 1024
+# endif
+ char buf[sizeof (struct inotify_event) + PATH_MAX];
+};
+
+/* Process the inotify event in INEV. If the event matches any of the files
+ registered with a database then mark that database as requiring its cache
+ to be cleared. We indicate the cache needs clearing by setting
+ TO_CLEAR[DBCNT] to true for the matching database. */
+static inline void
+inotify_check_files (bool *to_clear, union __inev *inev)
+{
+ /* Check which of the files changed. */
+ for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
+ {
+ struct traced_file *finfo = dbs[dbcnt].traced_files;
+
+ while (finfo != NULL)
+ {
+ /* Inotify event watch descriptor matches. */
+ if (finfo->inotify_descr == inev->i.wd)
+ {
+ /* Mark cache as needing to be cleared and reinitialize. */
+ to_clear[dbcnt] = true;
+ if (finfo->call_res_init)
+ res_init ();
+ return;
+ }
+
+ finfo = finfo->next;
+ }
+ }
+}
+
+/* If an entry in the array of booleans TO_CLEAR is TRUE then clear the cache
+ for the associated database, otherwise do nothing. The TO_CLEAR array must
+ have LASTDB entries. */
+static inline void
+clear_db_cache (bool *to_clear)
+{
+ for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
+ if (to_clear[dbcnt])
+ {
+ pthread_mutex_lock (&dbs[dbcnt].prune_lock);
+ dbs[dbcnt].clear_cache = 1;
+ pthread_mutex_unlock (&dbs[dbcnt].prune_lock);
+ pthread_cond_signal (&dbs[dbcnt].prune_cond);
+ }
+}
+
+#endif
static void
__attribute__ ((__noreturn__))
@@ -1976,15 +2049,10 @@ main_loop_poll (void)
if (conns[1].revents != 0)
{
bool to_clear[lastdb] = { false, };
- union
- {
-# ifndef PATH_MAX
-# define PATH_MAX 1024
-# endif
- struct inotify_event i;
- char buf[sizeof (struct inotify_event) + PATH_MAX];
- } inev;
+ union __inev inev;
+ /* Read all inotify events for files registered via
+ register_traced_file(). */
while (1)
{
ssize_t nb = TEMP_FAILURE_RETRY (read (inotify_fd, &inev,
@@ -2010,35 +2078,11 @@ disabled inotify after read error %d"),
}
/* Check which of the files changed. */
- for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
- {
- struct traced_file *finfo = dbs[dbcnt].traced_files;
-
- while (finfo != NULL)
- {
- if (finfo->inotify_descr == inev.i.wd)
- {
- to_clear[dbcnt] = true;
- if (finfo->call_res_init)
- res_init ();
- goto next;
- }
-
- finfo = finfo->next;
- }
- }
- next:;
+ inotify_check_files (to_clear, &inev);
}
/* Actually perform the cache clearing. */
- for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
- if (to_clear[dbcnt])
- {
- pthread_mutex_lock (&dbs[dbcnt].prune_lock);
- dbs[dbcnt].clear_cache = 1;
- pthread_mutex_unlock (&dbs[dbcnt].prune_lock);
- pthread_cond_signal (&dbs[dbcnt].prune_cond);
- }
+ clear_db_cache (to_clear);
--n;
}
@@ -2208,12 +2252,10 @@ main_loop_epoll (int efd)
else if (revs[cnt].data.fd == inotify_fd)
{
bool to_clear[lastdb] = { false, };
- union
- {
- struct inotify_event i;
- char buf[sizeof (struct inotify_event) + PATH_MAX];
- } inev;
+ union __inev inev;
+ /* Read all inotify events for files registered via
+ register_traced_file(). */
while (1)
{
ssize_t nb = TEMP_FAILURE_RETRY (read (inotify_fd, &inev,
@@ -2235,35 +2277,11 @@ main_loop_epoll (int efd)
}
/* Check which of the files changed. */
- for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
- {
- struct traced_file *finfo = dbs[dbcnt].traced_files;
-
- while (finfo != NULL)
- {
- if (finfo->inotify_descr == inev.i.wd)
- {
- to_clear[dbcnt] = true;
- if (finfo->call_res_init)
- res_init ();
- goto next;
- }
-
- finfo = finfo->next;
- }
- }
- next:;
+ inotify_check_files(to_clear, &inev);
}
/* Actually perform the cache clearing. */
- for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
- if (to_clear[dbcnt])
- {
- pthread_mutex_lock (&dbs[dbcnt].prune_lock);
- dbs[dbcnt].clear_cache = 1;
- pthread_mutex_unlock (&dbs[dbcnt].prune_lock);
- pthread_cond_signal (&dbs[dbcnt].prune_cond);
- }
+ clear_db_cache (to_clear);
}
# endif
# ifdef HAVE_NETLINK
diff --git a/libc/nscd/nscd-client.h b/libc/nscd/nscd-client.h
index 11964f607..360852b2a 100644
--- a/libc/nscd/nscd-client.h
+++ b/libc/nscd/nscd-client.h
@@ -362,8 +362,9 @@ extern struct mapped_database *__nscd_get_map_ref (request_type type,
extern void __nscd_unmap (struct mapped_database *mapped);
/* Drop reference of mapping. */
-static inline int __nscd_drop_map_ref (struct mapped_database *map,
- int *gc_cycle)
+static int
+__attribute__ ((unused))
+__nscd_drop_map_ref (struct mapped_database *map, int *gc_cycle)
{
if (map != NO_MAPPING)
{
diff --git a/libc/nscd/nscd.h b/libc/nscd/nscd.h
index 46d043328..cbd402a95 100644
--- a/libc/nscd/nscd.h
+++ b/libc/nscd/nscd.h
@@ -200,12 +200,7 @@ extern gid_t old_gid;
/* Prototypes for global functions. */
/* Wrapper functions with error checking for standard functions. */
-extern void *xmalloc (size_t n)
- __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
- __attribute_malloc__ __attribute_alloc_size (1, 2);
-extern void *xrealloc (void *o, size_t n)
- __attribute_malloc__ __attribute_alloc_size (2);
+#include <programs/xmalloc.h>
/* nscd.c */
extern void termination_handler (int signum) __attribute__ ((__noreturn__));
diff --git a/libc/nss/getent.c b/libc/nss/getent.c
index 1ccb639d5..f8d9b56f0 100644
--- a/libc/nss/getent.c
+++ b/libc/nss/getent.c
@@ -94,7 +94,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
#if __OPTION_EGLIBC_DB_ALIASES
/* This is for aliases */
-static inline void
+static void
print_aliases (struct aliasent *alias)
{
unsigned int i = 0;
@@ -186,7 +186,7 @@ ethers_keys (int number, char *key[])
#endif /* __OPTION_EGLIBC_INET */
/* This is for group */
-static inline void
+static void
print_group (struct group *grp)
{
unsigned int i = 0;
@@ -607,7 +607,7 @@ networks_keys (int number, char *key[])
#endif /* __OPTION_EGLIBC_INET */
/* Now is all for passwd */
-static inline void
+static void
print_passwd (struct passwd *pwd)
{
printf ("%s:%s:%lu:%lu:%s:%s:%s\n",
@@ -659,7 +659,7 @@ passwd_keys (int number, char *key[])
#if __OPTION_EGLIBC_INET
/* This is for protocols */
-static inline void
+static void
print_protocols (struct protoent *proto)
{
unsigned int i;
@@ -709,7 +709,7 @@ protocols_keys (int number, char *key[])
}
/* Now is all for rpc */
-static inline void
+static void
print_rpc (struct rpcent *rpc)
{
int i;
diff --git a/libc/nss/makedb.c b/libc/nss/makedb.c
index d4a19b359..13bd8461d 100644
--- a/libc/nss/makedb.c
+++ b/libc/nss/makedb.c
@@ -173,10 +173,7 @@ static void reset_file_creation_context (void);
/* External functions. */
-extern void *xmalloc (size_t n)
- __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
- __attribute_malloc__ __attribute_alloc_size (1, 2);
+#include <programs/xmalloc.h>
int
diff --git a/libc/po/de.po b/libc/po/de.po
index 142d7a4ba..28fc94052 100644
--- a/libc/po/de.po
+++ b/libc/po/de.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GNU libc 2.17-pre1\n"
"POT-Creation-Date: 2012-12-07 15:10-0500\n"
-"PO-Revision-Date: 2012-12-08 15:07+0100\n"
+"PO-Revision-Date: 2013-01-31 07:16+0100\n"
"Last-Translator: Jochen Hein <jochen@jochen.org>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
"Language: de\n"
@@ -791,7 +791,7 @@ msgstr "%s ist ein unbekannter Bibliothekstyp"
#: elf/ldconfig.c:409
#, c-format
msgid "Can't stat %s"
-msgstr "Kann »stat()« für »%s« nicht aufrufenen"
+msgstr "Kann »stat()« für »%s« nicht aufrufen"
#: elf/ldconfig.c:483
#, c-format
diff --git a/libc/ports/ChangeLog.aarch64 b/libc/ports/ChangeLog.aarch64
index c7487f5b7..c427f988a 100644
--- a/libc/ports/ChangeLog.aarch64
+++ b/libc/ports/ChangeLog.aarch64
@@ -1,3 +1,34 @@
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+
+2013-02-14 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/libm-test-ulps: Regenerate.
+
+2013-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/aarch64/sigaction.c (__libc_sigaction):
+ Do not use __ptrvalue.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/aarch64/gettimeofday.c: Do not include
+ <bp-checks.h>.
+ (__gettimeofday): Do not use CHECK_1.
+
+2013-01-23 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/strncmp.S: New file.
+
+2013-01-23 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/sysdep.h (ENTRY_ALIGN_AND_PAD): New.
+ * sysdeps/aarch64/strnlen.S: New file.
+
2013-01-17 Marcus Shawcroft <marcus.shawcroft@linaro.org>
* sysdeps/aarch64/strlen.S: New file.
diff --git a/libc/ports/ChangeLog.alpha b/libc/ports/ChangeLog.alpha
index 2284ae3fa..2814559a0 100644
--- a/libc/ports/ChangeLog.alpha
+++ b/libc/ports/ChangeLog.alpha
@@ -1,3 +1,57 @@
+2013-02-19 Richard Henderson <rth@redhat.com>
+
+ [BZ #14920]
+ * sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+ (FUTEX_WAIT_REQUEUE_PI): Define.
+ (FUTEX_CMP_REQUEUE_PI): Likewise.
+ (lll_futex_wait_requeue_pi): Likewise.
+ (lll_futex_timed_wait_requeue_pi): Likewise.
+ (lll_futex_cmp_requeue_pi): Likewise.
+
+2013-02-20 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/unix/alpha/sysdep.h: Include <errno.h>.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+
+2013-02-14 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/alpha/memchr.c: Do not include <bp-sym.h>.
+ (memchr): Do not use BP_SYM in weak_alias.
+
+2013-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/alpha/sigaction.c
+ (__syscall_rt_sigaction): Do not use __unbounded in prototype.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/alpha/fdatasync.c: Don't include
+ <bp-checks.h>.
+ * sysdeps/unix/sysv/linux/alpha/gethostname.c: Likewise.
+ (__gethostname): Don't use CHECK_N.
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/alpha/msgctl.c: Do not include
+ <bp-checks.h>.
+ (__new_msgctl): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/alpha/shmctl.c: Do not include
+ <bp-checks.h>.
+ (__new_shmctl): Do not use CHECK_1.
+
+2013-01-31 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/alpha/semctl.c: Don't include
+ <bp-checks.h> and <bp-semctl.h>.
+ (__new_semctl): Don't use CHECK_SEMCTL.
+
2013-01-08 Andreas Jaeger <aj@suse.de>
[BZ# 14985]
diff --git a/libc/ports/ChangeLog.am33 b/libc/ports/ChangeLog.am33
index 015fa9066..2bb7893f9 100644
--- a/libc/ports/ChangeLog.am33
+++ b/libc/ports/ChangeLog.am33
@@ -1,3 +1,23 @@
+2013-02-28 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/am33/elf/start.S: Don't include "bp-sym.h".
+ (_start): Don't use BP_SYM.
+ * sysdeps/unix/sysv/linux/am33/clone.S: Don't include <bp-sym.h>.
+ (__clone): Don't use BP_SYM.
+
+2013-02-14 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/am33/dl-machine.h [!PROF && !__BOUNDED_POINTERS__]:
+ Remove __BOUNDED_POINTERS__ from condition.
+
+2013-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/am33/dl-machine.h (fixup): Do not use __unbounded.
+ * sysdeps/unix/sysv/linux/am33/brk.c (__brk): Do not use
+ __ptrvalue.
+
2013-01-02 Joseph Myers <joseph@codesourcery.com>
* All files with FSF copyright notices: Update copyright dates
diff --git a/libc/ports/ChangeLog.arm b/libc/ports/ChangeLog.arm
index d44ea7624..28ec8f96a 100644
--- a/libc/ports/ChangeLog.arm
+++ b/libc/ports/ChangeLog.arm
@@ -1,3 +1,115 @@
+2013-02-28 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/arm/preconfigure: Adjust scan for __ARM_ARCH_* defines.
+
+ * sysdeps/arm/preconfigure: Handle __ARM_ARCH_6*__.
+
+ * sysdeps/unix/sysv/linux/arm/Makefile [elf] (sysdep-rtld-routines):
+ Include libc-do-syscall.
+
+ * sysdeps/arm/sysdep.h: Fix assembly whitespace.
+ * ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h: Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise.
+
+ * sysdeps/arm/sysdep.h (PC_OFS): New macros.
+ * sysdeps/arm/__longjmp.S (__longjmp): Use PC_OFS.
+ * sysdeps/arm/setjmp.S (__sigsetjmp): Likewise.
+ * sysdeps/unix/arm/sysdep.S (__syscall_error): Likewise.
+ * sysdeps/unix/sysv/linux/arm/getcontext.S (__getcontext): Likewise.
+ * sysdeps/unix/sysv/linux/arm/setcontext.S (__startcontext): Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+ (SINGLE_THREAD_P): Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h
+ (SYSCALL_ERROR_HANDLER): Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+ (_Unwind_Resume): Use stringified PC_OFS.
+ * sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+ (_Unwind_Resume): Likewise.
+
+ * ports/sysdeps/arm/arm-mcount.S: Always use unified syntax and
+ always add IT markup.
+ * sysdeps/unix/sysv/linux/arm/mmap64.S (__mmap64): Likewise.
+ * sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Add IT markup.
+ * sysdeps/unix/arm/sysdep.S (__syscall_error): Likewise.
+ * sysdeps/unix/sysv/linux/arm/clone.S (__clone): Likewise.
+ * sysdeps/unix/sysv/linux/arm/mmap.S (__mmap): Likewise.
+ * sysdeps/unix/sysv/linux/arm/syscall.S (syscall): Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h (PSEUDO_RET): Likewise.
+ * sysdeps/unix/sysv/linux/arm/vfork.S (__vfork): Likewise.
+
+ * ports/sysdeps/arm/__longjmp.S: Define NO_THUMB before <sysdep.h>
+ * sysdeps/arm/crti.S, sysdeps/arm/crtn.S: Likewise.
+ * sysdeps/arm/dl-trampoline.S: Likewise.
+ * sysdeps/arm/memcpy.S: Likewise.
+ * sysdeps/arm/memmove.S: Likewise.
+ * sysdeps/arm/memset.S: Likewise.
+ * sysdeps/arm/setjmp.S: Likewise.
+ * sysdeps/arm/strlen.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/____longjmp_chk.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/setcontext.S: Likewise.
+
+2013-02-27 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/arm/sysdep.h (CFI_SECTIONS): New macro.
+ (ENTRY): Use it.
+ * sysdeps/arm/dl-tlsdesc.S: Likewise.
+ * sysdeps/arm/dl-trampoline.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h (PSEUDO): Likewise.
+
+2013-02-18 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14920]
+ * sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+ (FUTEX_WAIT_REQUEUE_PI): Define.
+ (FUTEX_CMP_REQUEUE_PI): Likewise.
+ (lll_futex_wait_requeue_pi): Likewise.
+ (lll_futex_timed_wait_requeue_pi): Likewise.
+ (lll_futex_cmp_requeue_pi): Likewise.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/arm/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+
+2013-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/arm/frame.h (struct layout): Do not use __unbounded.
+ * sysdeps/unix/sysv/linux/arm/sigaction.c (__libc_sigaction): Do
+ not use __ptrvalue.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/arm/pread.c: Don't include
+ <bp-checks.h>.
+ (__libc_pread): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/arm/pread64.c: Don't include
+ <bp-checks.h>.
+ (__libc_pread64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/arm/pwrite.c: Don't include
+ <bp-checks.h>.
+ (__libc_pwrite): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/arm/pwrite64.c: Don't include
+ <bp-checks.h>.
+ (__libc_pwrite64): Don't use CHECK_N.
+
+2013-02-08 Carlos O'Donell <carlos@redhat.com>
+
+ [BZ #15006]
+ * sysdeps/unix/sysv/linux/arm/dl-cache.h
+ [__ARM_PCS_VFP] (_dl_cache_check_flags): Allow plain FLAG_ELF_LIBC6.
+ [!__ARM_PCS_VFP] (_dl_cache_check_flags): Likewise.
+ * sysdeps/unix/sysv/linux/arm/readelflib.c (process_elf_file):
+ Set FLAG_ARM_LIBSF for soft-float ABI otherwise just FLAG_ELF_LIBC6.
+
+2013-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/arm/truncate64.c: Do not include
+ <bp-checks.h>.
+ (truncate64): Do not use CHECK_STRING.
+
2013-01-02 Joseph Myers <joseph@codesourcery.com>
* All files with FSF copyright notices: Update copyright dates
diff --git a/libc/ports/ChangeLog.hppa b/libc/ports/ChangeLog.hppa
index ef904c267..6314f1269 100644
--- a/libc/ports/ChangeLog.hppa
+++ b/libc/ports/ChangeLog.hppa
@@ -1,3 +1,10 @@
+2013-02-14 Carlos O'Donell <carlos@redhat.com>
+
+ * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
+ (lll_unlock_wake_cb): Remove.
+ * ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:
+ Remove prototype for lll_unlock_wake_cb.
+
2013-01-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/hppa/fpu/fpu_control.h (_FPU_GETCW): Use __extension__
diff --git a/libc/ports/ChangeLog.ia64 b/libc/ports/ChangeLog.ia64
index 28d507675..d9fda457f 100644
--- a/libc/ports/ChangeLog.ia64
+++ b/libc/ports/ChangeLog.ia64
@@ -1,3 +1,34 @@
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/ia64/sigaction.c: Do not include
+ <bp-checks.h>.
+ (__libc_sigaction): Do not use CHECK_1_NULL_OK.
+
+2013-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/ia64/memchr.S [!__BOUNDED_POINTERS__] (__ubp_memchr):
+ Remove alias.
+ * sysdeps/unix/sysv/linux/ia64/umount.c: Do not include
+ <bp-checks.h>.
+ (umount): Do not use CHECK_STRING.
+
+2013-01-31 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/ia64/sigpending.c: Don't include
+ <bp-checks.h>.
+ (sigpending): Don't use CHECK_SIGSET.
+ * sysdeps/unix/sysv/linux/ia64/sigprocmask.c: Don't include
+ <bp-checks.h>.
+ (__sigprocmask): Don't use CHECK_SIGSET and CHECK_SIGSET_NULL_OK.
+
2013-01-02 Joseph Myers <joseph@codesourcery.com>
* All files with FSF copyright notices: Update copyright dates
diff --git a/libc/ports/ChangeLog.m68k b/libc/ports/ChangeLog.m68k
index 20eaac716..e7cb81e8f 100644
--- a/libc/ports/ChangeLog.m68k
+++ b/libc/ports/ChangeLog.m68k
@@ -1,3 +1,38 @@
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist:
+ Likewise.
+
+2013-02-08 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/kernel-features.h
+ (__ASSUME_O_CLOEXEC): Define for 2.6.23 or later.
+ (__ASSUME_SOCK_CLOEXEC, __ASSUME_IN_NONBLOCK, __ASSUME_PIPE2)
+ (__ASSUME_EVENTFD2, __ASSUME_SIGNALFD4, __ASSUME_DUP3): Define for
+ 2.6.27 or later.
+ (__ASSUME_ACCEPT4): Define for 2.6.28 or later.
+
+2013-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/m68k/memchr.S [!__BOUNDED_POINTERS__] (__ubp_memchr):
+ Remove alias.
+
+2013-01-20 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update.
+
+ * sysdeps/m68k/Makefile (CFLAGS-backtrace.c): Add -funwind-tables.
+
+2013-01-19 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/backtrace.c: New file.
+
+ * sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h: New file.
+ * sysdeps/unix/sysv/linux/m68k/syscalls.list: Add waitpid.
+
2013-01-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/m68k/bits/byteswap.h (__bswap_64): Use __extension__
diff --git a/libc/ports/ChangeLog.mips b/libc/ports/ChangeLog.mips
index 9e2bcffc6..251806572 100644
--- a/libc/ports/ChangeLog.mips
+++ b/libc/ports/ChangeLog.mips
@@ -1,3 +1,318 @@
+2013-02-27 Chung-Lin Tang <cltang@codesourcery.com>
+ Maciej W. Rozycki <macro@codesourcery.com>
+ Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * sysdeps/mips/abort-instr.h (ABORT_INSTRUCTION) [__mips16]:
+ New macro.
+ * sysdeps/mips/dl-machine.h (elf_machine_load_address): Add
+ MIPS16 version of assembly code.
+ (RTLD_START) [__mips16]: New macro.
+ * sysdeps/mips/fpu_control.h (__mips_fpu_getcw): New prototype.
+ (__mips_fpu_setcw): Likewise.
+ (_FPU_GETCW) [__mips16]: New macro.
+ (_FPU_SETCW) [__mips16]: Likewise.
+ * sysdeps/mips/machine-gmon.h (MCOUNT): Add `.set nomips16'.
+ * sysdeps/mips/tls-macros.h (LOAD_GP) [__mips16]: New macro.
+ (TLS_GD, TLS_LD, TLS_IE, TLS_LE) [__mips16]: Likewise.
+ * sysdeps/mips/bits/atomic.h: Also use __atomic_* builtins with
+ GCC 4.7 in MIPS16 code.
+ (atomic_compare_and_exchange_val_acq) [__mips16]: New macro.
+ (atomic_compare_and_exchange_bool_acq) [__mips16]: Likewise.
+ (atomic_exchange_acq) [__mips16]: Likewise.
+ (atomic_exchange_and_add) [__mips16]: Likewise.
+ (atomic_bit_test_set) [__mips16]: Likewise.
+ (atomic_and, atomic_and_val) [__mips16]: Likewise.
+ (atomic_or, atomic_or_val) [__mips16]: Likewise.
+ (atomic_full_barrier) [__mips16]: Likewise.
+ * sysdeps/mips/nptl/tls.h (READ_THREAD_POINTER) [__mips16]:
+ Likewise.
+ * sysdeps/mips/sys/tas.h (_test_and_set): Add `__nomips16__'
+ attribute.
+ * sysdeps/unix/mips/sysdep.h (PSEUDO_NOERRNO): Add
+ `.set nomips16'.
+ (PSEUDO_ERRVAL): Likewise.
+ * sysdeps/unix/mips/mips32/sysdep.h (PSEUDO): Likewise.
+ * sysdeps/unix/mips/mips64/n32/sysdep.h (PSEUDO): Likewise.
+ * sysdeps/unix/mips/mips64/n64/sysdep.h (PSEUDO): Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+ (INTERNAL_SYSCALL, INTERNAL_SYSCALL_NCS) [__mips16]: New macros.
+ (INTERNAL_SYSCALL_MIPS16) [__mips16]: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h (PSEUDO):
+ Add `.set nomips16'.
+ * sysdeps/mips/bsd-_setjmp.S (_setjmp): Likewise.
+ * sysdeps/mips/bsd-setjmp.S (setjmp): Likewise.
+ * sysdeps/mips/memset.S (memset): Likewise.
+ * sysdeps/mips/setjmp.S (__sigsetjmp): Likewise.
+ * sysdeps/mips/start.S (ENTRY_POINT) [__mips16]: New function.
+ * sysdeps/mips/mips32/crti.S: Add `.set nomips16'.
+ * sysdeps/mips/mips32/crtn.S: Likewise.
+ * sysdeps/mips/mips64/n32/crti.S: Likewise.
+ * sysdeps/mips/mips64/n32/crtn.S: Likewise.
+ * sysdeps/mips/mips64/n64/crti.S: Likewise.
+ * sysdeps/mips/mips64/n64/crtn.S: Likewise.
+ * sysdeps/unix/mips/sysdep.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/clone.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/getcontext.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/makecontext.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/setcontext.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/swapcontext.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/vfork.S: Likewise.
+ * sysdeps/mips/__longjmp.c (__longjmp): Rename function to...
+ (____longjmp): ... this. Make static and add `nomips16'
+ attribute.
+ (__longjmp): New alias.
+ * sysdeps/mips/dl-trampoline.c (_dl_runtime_resolve) [__mips16]:
+ New function.
+ (_dl_runtime_pltresolve): Likewise.
+ * sysdeps/mips/setjmp_aux.c (__sigsetjmp_aux): Add `nomips16'
+ attribute.
+ * sysdeps/mips/fpu/e_sqrt.c (__ieee754_sqrt): Likewise.
+ * sysdeps/mips/fpu/e_sqrtf.c (__ieee754_sqrtf): Likewise.
+ * sysdeps/unix/sysv/linux/mips/brk.c (__brk): Rewrite in terms
+ of INTERNAL_SYSCALL.
+ * sysdeps/mips/mips32/fpu/fpu_control.c: New file.
+ * sysdeps/mips/mips32/mips16/add_n.c: New file.
+ * sysdeps/mips/mips32/mips16/addmul_1.c: New file.
+ * sysdeps/mips/mips32/mips16/lshift.c: New file.
+ * sysdeps/mips/mips32/mips16/mul_1.c: New file.
+ * sysdeps/mips/mips32/mips16/rshift.c: New file.
+ * sysdeps/mips/mips32/mips16/sub_n.c: New file.
+ * sysdeps/mips/mips32/mips16/submul_1.c: New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c:
+ New file.
+ * sysdeps/mips/mips32/fpu/Versions: New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions: New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist: New
+ file.
+ * sysdeps/mips/mips32/mips16/fpu/Makefile: New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile: New file.
+ * sysdeps/mips/preconfigure: Handle o32 MIPS16 compilation.
+
+2013-02-20 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/mips/bits/nan.h [!__GNUC__] (__nan_union): Change
+ __attribute__ ((unused)) to __attribute__ ((__unused__)).
+
+ * sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist: Sort
+ properly.
+
+ * sysdeps/mips/bits/nan.h [!__GNUC__] (__nan_union): Change
+ __attribute_used__ to __attribute__ ((unused)).
+
+ * sysdeps/mips/bits/nan.h [!__GNUC__] (__nan_union): Add
+ __attribute_used__.
+
+ * sysdeps/mips/bits/nan.h: Align to generic IEEE 754 file.
+
+2013-02-19 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14920]
+ * sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
+ (FUTEX_WAIT_REQUEUE_PI): Define.
+ (FUTEX_CMP_REQUEUE_PI): Likewise.
+ (lll_futex_wait_requeue_pi): Likewise.
+ (lll_futex_timed_wait_requeue_pi): Likewise.
+ (lll_futex_cmp_requeue_pi): Likewise.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist:
+ Likewise.
+
+2013-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c (__fxstat64): Do
+ not use __ptrvalue.
+ * sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c (__fxstatat64):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c (__lxstat64):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/xstat64.c (__xstat64):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/sigaction.c (__libc_sigaction):
+ Likewise.
+
+2013-02-11 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/mips/include/sys/asm.h: New file.
+ * sysdeps/mips/mips64/bsd-_setjmp.S (_setjmp): Use SETUP_GP64_REG
+ and RESTORE_GP64_REG.
+ * sysdeps/mips/mips64/bsd-setjmp.S (setjmp): Likewise.
+ * sysdeps/mips/mips64/setjmp.S (__sigsetjmp): Likewise.
+ * sysdeps/mips/sys/asm.h (__mips_cfi_startproc): Define to empty.
+ (__mips_cfi_endproc): Likewise.
+ (LEAF): Use __mips_cfi_startproc.
+ (NESTED): Likewise.
+ (END): Use __mips_cfi_endproc.
+ (EXPORT): Use __mips_cfi_startproc.
+ * sysdeps/unix/mips/mips32/sysdep.h (PSEUDO): Add CFI information
+ for error-handling code in both definitions.
+ * sysdeps/unix/mips/mips64/n32/sysdep.h (PSEUDO): Likewise.
+ * sysdeps/unix/mips/mips64/n64/sysdep.h (PSEUDO): Likewise.
+ * sysdeps/unix/mips/sysdep.h (ENTRY): Use cfi_startproc.
+ (END): Use cfi_endproc.
+ (PSEUDO_END): Likewise.
+ (PSEUDO_END_NOERRNO): Likewise.
+ (PSEUDO_END_ERRVAL): Likewise.
+ * sysdeps/unix/sysv/linux/mips/clone.S (__clone): Add CFI
+ information. Use SETUP_GP64_STACK and RESTORE_GP64_STACK.
+ * sysdeps/unix/sysv/linux/mips/getcontext.S (__getcontext):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/makecontext.S (__makecontext):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl): Use
+ SETUP_GP64_REG and RESTORE_GP64_REG.
+ * sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
+ [(!NOT_IN_libc || IS_IN_libpthread || IS_IN_librt) && __PIC__]
+ (PSEUDO): Use cfi_endproc before ENTRY.
+ * sysdeps/unix/sysv/linux/mips/mips64/syscall.S (syscall): Add CFI
+ information. Use SETUP_GP64_REG and RESTORE_GP64_REG.
+ * sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h [(!NOT_IN_libc
+ || IS_IN_libpthread || IS_IN_librt) && __PIC__] (PSEUDO): Use
+ cfi_endproc before ENTRY.
+ * sysdeps/unix/sysv/linux/mips/setcontext.S (__setcontext): Add
+ CFI information. Use SETUP_GP64_STACK and RESTORE_GP64_STACK.
+ * sysdeps/unix/sysv/linux/mips/swapcontext.S (__swapcontext):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/vfork.S (__vfork): Add CFI
+ information. Use SETUP_GP64_REG and RESTORE_GP64_REG.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c: Don't include
+ <bp-checks.h>.
+ * sysdeps/unix/sysv/linux/mips/pread.c: Likewise.
+ (__libc_pread): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/mips/pread64.c: Don't include
+ <bp-checks.h>.
+ (__libc_pread64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/mips/pwrite.c: Don't include
+ <bp-checks.h>.
+ (__libc_pwrite): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/mips/pwrite64.c: Don't include
+ <bp-checks.h>.
+ (__libc_pwrite64): Don't use CHECK_N.
+
+ * sysdeps/mips/add_n.S (__mpn_add_n): Use END.
+ * sysdeps/mips/bsd-_setjmp.S (_setjmp): Likewise.
+ * sysdeps/mips/bsd-setjmp.S (setjmp): Likewise.
+ * sysdeps/mips/mips64/add_n.S (__mpn_add_n): Use ENTRY and END.
+ * sysdeps/mips/mips64/addmul_1.S (__mpn_addmul_1): Likewise.
+ * sysdeps/mips/mips64/bsd-_setjmp.S (_setjmp): Use END.
+ * sysdeps/mips/mips64/bsd-setjmp.S (setjmp): Likewise.
+ * sysdeps/mips/mips64/lshift.S (__mpn_lshift): Use ENTRY and END.
+ * sysdeps/mips/mips64/mul_1.S (__mpn_mul_1): Likewise.
+ * sysdeps/mips/mips64/rshift.S (__mpn_rshift): Likewise.
+ * sysdeps/mips/mips64/setjmp.S (__sigsetjmp): Use END.
+ * sysdeps/mips/mips64/sub_n.S (__mpn_sub_n): Use ENTRY and END.
+ * sysdeps/mips/mips64/submul_1.S (__mpn_submul_1): Likewise.
+ * sysdeps/mips/setjmp.S (__sigsetjmp): Use END.
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/mips/mips64/msgctl.c: Do not include
+ <bp-checks.h>.
+ (__msgctl): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/mips/mips64/shmctl.c: Do not include
+ <bp-checks.h>.
+ (__shmctl): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/mips/ustat.c: Do not include
+ <bp-checks.h>.
+ (ustat): Do not use CHECK_1.
+
+2013-02-05 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Add a missing
+ space in asm register specifiers throughout.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
+
+ [BZ #15054]
+ * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (MOVE32):
+ New macro.
+ (INTERNAL_SYSCALL_NCS): Use it. Rewrite to respect the syscall
+ restart convention.
+ (INTERNAL_SYSCALL): Rewrite to respect the syscall restart
+ convention.
+ (internal_syscall0, internal_syscall1): Likewise.
+ (internal_syscall2, internal_syscall3): Likewise.
+ (internal_syscall4, internal_syscall5): Likewise.
+ (internal_syscall6, internal_syscall7): Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (MOVE32):
+ New macro.
+ (INTERNAL_SYSCALL_NCS): Use it. Rewrite to respect the syscall
+ restart convention.
+ (INTERNAL_SYSCALL): Rewrite to respect the syscall restart
+ convention.
+ (internal_syscall0, internal_syscall1): Likewise.
+ (internal_syscall2, internal_syscall3): Likewise.
+ (internal_syscall4, internal_syscall5): Likewise.
+ (internal_syscall6): Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (MOVE32):
+ New macro.
+ (INTERNAL_SYSCALL_NCS): Use it. Rewrite to respect the syscall
+ restart convention.
+ (INTERNAL_SYSCALL): Rewrite to respect the syscall restart
+ convention.
+ (internal_syscall0, internal_syscall1): Likewise.
+ (internal_syscall2, internal_syscall3): Likewise.
+ (internal_syscall4, internal_syscall5): Likewise.
+ (internal_syscall6): Likewise.
+
+2013-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/mips/mips32/truncate64.c: Do not include
+ <bp-checks.h>.
+ (truncate64): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c: Do not include
+ <bp-checks.h>.
+ (__fxstatat64): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c: Do not include
+ <bp-checks.h>.
+ (__lxstat64): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/mips/mips64/xstat64.c: Do not include
+ <bp-checks.h>.
+ (__xstat64): Do not use CHECK_STRING.
+
+2013-01-31 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/mips/mips64/semctl.c: Don't include
+ <bp-checks.h> and <bp-semctl.h>.
+ (__semctl): Don't use CHECK_SEMCTL.
+
+2013-01-29 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Correct
+ whitespace damage throughout.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
+
+2013-01-25 Steve Ellcey <sellcey@mips.com>
+
+ * sysdeps/mips/memmove.c: Remove.
+
2013-01-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/bits/sigcontext.h (struct
diff --git a/libc/ports/ChangeLog.powerpc b/libc/ports/ChangeLog.powerpc
index 2746f3766..2ba8e3754 100644
--- a/libc/ports/ChangeLog.powerpc
+++ b/libc/ports/ChangeLog.powerpc
@@ -1,3 +1,54 @@
+2013-02-28 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/powerpc/powerpc32/405/memcmp.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (memcmp): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/memcpy.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (memcpy): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/memset.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (memset): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/strcmp.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (strcmp): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/strcpy.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (strcpy): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/strlen.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (strlen): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/strncmp.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (strncmp): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/476/memset.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (memset): Don't use BP_SYM.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist:
+ Add __cxa_thread_atexit_impl.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist:
+ Likewise.
+
+2013-02-14 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/powerpc/nofpu/fegetenv.c: Do not include <bp-sym.h>.
+ (fegetenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/nofpu/fesetenv.c: Do not include <bp-sym.h>.
+ (fesetenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/nofpu/feupdateenv.c: Do not include <bp-sym.h>.
+ (feupdateenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/nofpu/fgetexcptflg.c: Do not include <bp-sym.h>.
+ (fegetexceptflag): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/nofpu/fraiseexcpt.c: Do not include <bp-sym.h>.
+ (feraiseexcept): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/nofpu/fsetexcptflg.c: Do not include <bp-sym.h>.
+ (fesetexceptflag): Do not use BP_SYM in versioned symbols.
+
2013-01-02 Joseph Myers <joseph@codesourcery.com>
* All files with FSF copyright notices: Update copyright dates
diff --git a/libc/ports/ChangeLog.tile b/libc/ports/ChangeLog.tile
index a5eaec3a9..6184bf6a0 100644
--- a/libc/ports/ChangeLog.tile
+++ b/libc/ports/ChangeLog.tile
@@ -1,3 +1,19 @@
+2013-02-28 Chris Metcalf <cmetcalf@tilera.com>
+
+ * sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
+ (FUTEX_WAIT_REQUEUE_PI): Define.
+ (FUTEX_CMP_REQUEUE_PI): Likewise.
+ (lll_futex_wait_requeue_pi): Likewise.
+ (lll_futex_timed_wait_requeue_pi): Likewise.
+ (lll_futex_cmp_requeue_pi): Likewise.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist:
+ Add __cxa_thread_atexit_impl.
+ * sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist:
+ Likewise.
+
2013-01-10 Chris Metcalf <cmetcalf@tilera.com>
* sysdeps/unix/sysv/linux/tile/tilegx/ldd-rewrite.sed: New file.
diff --git a/libc/ports/sysdeps/aarch64/libm-test-ulps b/libc/ports/sysdeps/aarch64/libm-test-ulps
index eda0e77f8..aebc46f46 100644
--- a/libc/ports/sysdeps/aarch64/libm-test-ulps
+++ b/libc/ports/sysdeps/aarch64/libm-test-ulps
@@ -146,6 +146,8 @@ ldouble: 2
Test "Imaginary part of: cacos (+0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (+0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i":
double: 1
float: 1
@@ -182,6 +184,8 @@ ldouble: 2
Test "Imaginary part of: cacos (-0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (-0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i":
double: 1
float: 1
@@ -194,6 +198,74 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "Real part of: cacos (-0.5 + +0 i) == 2.094395102393195492308428922186335256131 - 0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-0.5 - 0 i) == 2.094395102393195492308428922186335256131 + +0 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-1025 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-1025 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442100 - 1.194763217287109304111930828519090523536 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442100 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442100 + 1.194763217287109304111930828519090523536 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442100 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-16385 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-16385 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1p500 + 1.0 i) == 3.141592653589793238462643383279502884197 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1p500 - 1.0 i) == 3.141592653589793238462643383279502884197 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1p5000 + 1.0 i) == 3.141592653589793238462643383279502884197 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1p5000 - 1.0 i) == 3.141592653589793238462643383279502884197 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-1.0 + 0x1p50 i) == 1.570796326794897507409741391764983781004 - 3.535050620855721078027883819436759661753e1 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-1.0 + 0x1p500 i) == 1.570796326794896619231321691639751442099 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.0 + 0x1p5000 i) == 1.570796326794896619231321691639751442099 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-1.0 - 0x1p50 i) == 1.570796326794897507409741391764983781004 + 3.535050620855721078027883819436759661753e1 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-1.0 - 0x1p500 i) == 1.570796326794896619231321691639751442099 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.0 - 0x1p5000 i) == 1.570796326794896619231321691639751442099 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (-1.5 + +0 i) == pi - 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -201,6 +273,11 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: cacos (-2 - 3 i) == 2.1414491111159960199416055713254211 + 1.9833870299165354323470769028940395 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: cacos (0.5 + +0 i) == 1.047197551196597746154214461093167628066 - 0 i":
double: 1
idouble: 1
@@ -214,6 +291,65 @@ ldouble: 1
Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-1025 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-1025 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442097 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442097 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-16385 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-16385 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 - 7.107906849659093345062145442726115449315e2 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (0x1.fp127 + 0x1.fp127 i) == 7.853981633974483096156608458198757210493e-1 - 8.973081118419833726837456344608533993585e1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (0x1.fp16383 + 0x1.fp16383 i) == 7.853981633974483096156608458198757210493e-1 - 1.135753137836666928715489992987020363057e4 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1p500 + 1.0 i) == 3.054936363499604682051979393213617699789e-151 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1p500 - 1.0 i) == 3.054936363499604682051979393213617699789e-151 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1p5000 + 1.0 i) == 7.079811261048172892385615158694057552948e-1506 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1p5000 - 1.0 i) == 7.079811261048172892385615158694057552948e-1506 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.0 + 0x1p500 i) == 1.570796326794896619231321691639751442099 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.0 + 0x1p5000 i) == 1.570796326794896619231321691639751442099 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.0 - 0x1p500 i) == 1.570796326794896619231321691639751442099 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.0 - 0x1p5000 i) == 1.570796326794896619231321691639751442099 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (1.5 + +0 i) == +0 - 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -332,6 +468,8 @@ ldouble: 2
Test "Imaginary part of: casin (+0 - 0.5 i) == +0 - 0.4812118250596034474977589134243684231352 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (+0 - 1.0 i) == +0 - 0.8813735870195430252326093249797923090282 i":
double: 1
float: 1
@@ -368,6 +506,8 @@ ldouble: 2
Test "Imaginary part of: casin (-0 - 0.5 i) == -0 - 0.4812118250596034474977589134243684231352 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (-0 - 1.0 i) == -0 - 0.8813735870195430252326093249797923090282 i":
double: 1
float: 1
@@ -380,6 +520,56 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-1025 + 1.5 i) == -2.989196569048182929051881765490354365918e-309 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-1025 - 1.5 i) == -2.989196569048182929051881765490354365918e-309 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-129 + 1.5 i) == -1.579176199917649005841160751101628985741e-39 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-129 - 1.5 i) == -1.579176199917649005841160751101628985741e-39 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-16385 + 1.5 i) == -4.516698239814521372306784062043266700598e-4933 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-16385 - 1.5 i) == -4.516698239814521372306784062043266700598e-4933 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1p500 + 1.0 i) == -1.570796326794896619231321691639751442099 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1p500 - 1.0 i) == -1.570796326794896619231321691639751442099 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1p5000 + 1.0 i) == -1.570796326794896619231321691639751442099 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1p5000 - 1.0 i) == -1.570796326794896619231321691639751442099 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.0 + 0x1p500 i) == -3.054936363499604682051979393213617699789e-151 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.0 + 0x1p5000 i) == -7.079811261048172892385615158694057552948e-1506 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.0 - 0x1p500 i) == -3.054936363499604682051979393213617699789e-151 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.0 - 0x1p5000 i) == -7.079811261048172892385615158694057552948e-1506 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (-1.5 + +0 i) == -pi/2 + 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -395,6 +585,65 @@ ifloat: 1
Test "Imaginary part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-1025 + 1.5 i) == 2.989196569048182929051881765490354365918e-309 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-1025 - 1.5 i) == 2.989196569048182929051881765490354365918e-309 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-129 + 1.5 i) == 1.579176199917649005841160751101628985741e-39 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-129 - 1.5 i) == 1.579176199917649005841160751101628985741e-39 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-16385 + 1.5 i) == 4.516698239814521372306784062043266700598e-4933 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-16385 - 1.5 i) == 4.516698239814521372306784062043266700598e-4933 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 + 7.107906849659093345062145442726115449315e2 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (0x1.fp127 + 0x1.fp127 i) == 7.853981633974483096156608458198757210493e-1 + 8.973081118419833726837456344608533993585e1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (0x1.fp16383 + 0x1.fp16383 i) == 7.853981633974483096156608458198757210493e-1 + 1.135753137836666928715489992987020363057e4 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1p500 + 1.0 i) == 1.570796326794896619231321691639751442099 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1p500 - 1.0 i) == 1.570796326794896619231321691639751442099 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1p5000 + 1.0 i) == 1.570796326794896619231321691639751442099 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1p5000 - 1.0 i) == 1.570796326794896619231321691639751442099 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.0 + 0x1p500 i) == 3.054936363499604682051979393213617699789e-151 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.0 + 0x1p5000 i) == 7.079811261048172892385615158694057552948e-1506 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.0 - 0x1p500 i) == 3.054936363499604682051979393213617699789e-151 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.0 - 0x1p5000 i) == 7.079811261048172892385615158694057552948e-1506 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (1.5 + +0 i) == pi/2 + 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -432,6 +681,18 @@ idouble: 2
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (-0x1p500 + 1.0 i) == -3.472667374605326000180332928505464606058e2 + 3.054936363499604682051979393213617699789e-151 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1p500 - 1.0 i) == -3.472667374605326000180332928505464606058e2 - 3.054936363499604682051979393213617699789e-151 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1p5000 + 1.0 i) == -3.466429049980286492395577839412341016946e3 + 7.079811261048172892385615158694057552948e-1506 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1p5000 - 1.0 i) == -3.466429049980286492395577839412341016946e3 - 7.079811261048172892385615158694057552948e-1506 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-1.0 + +0 i) == -0.8813735870195430252326093249797923090282 + +0 i":
double: 2
float: 1
@@ -439,6 +700,12 @@ idouble: 2
ifloat: 1
ildouble: 3
ldouble: 3
+Test "Real part of: casinh (-1.0 + 0x1p500 i) == -3.472667374605326000180332928505464606058e2 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.0 + 0x1p5000 i) == -3.466429049980286492395577839412341016946e3 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-1.0 - 0 i) == -0.8813735870195430252326093249797923090282 - 0 i":
double: 2
float: 1
@@ -446,6 +713,12 @@ idouble: 2
ifloat: 1
ildouble: 3
ldouble: 3
+Test "Real part of: casinh (-1.0 - 0x1p500 i) == -3.472667374605326000180332928505464606058e2 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.0 - 0x1p5000 i) == -3.466429049980286492395577839412341016946e3 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-1.5 + +0 i) == -1.194763217287109304111930828519090523536 + +0 i":
double: 2
float: 1
@@ -453,6 +726,19 @@ idouble: 2
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Real part of: casinh (-1.5 + 0x1.fp-1025 i) == -1.194763217287109304111930828519090523536 + 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 + 0x1.fp-129 i) == -1.194763217287109304111930828519090523536 + 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 + 0x1.fp-16385 i) == -1.194763217287109304111930828519090523536 + 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-1.5 - 0 i) == -1.194763217287109304111930828519090523536 - 0 i":
double: 2
float: 1
@@ -460,6 +746,19 @@ idouble: 2
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Real part of: casinh (-1.5 - 0x1.fp-1025 i) == -1.194763217287109304111930828519090523536 - 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 - 0x1.fp-129 i) == -1.194763217287109304111930828519090523536 - 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 - 0x1.fp-16385 i) == -1.194763217287109304111930828519090523536 - 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
double: 5
float: 1
@@ -477,9 +776,13 @@ ldouble: 2
Test "Real part of: casinh (0.5 + +0 i) == 0.4812118250596034474977589134243684231352 + +0 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (0.5 - 0 i) == 0.4812118250596034474977589134243684231352 - 0 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
float: 1
ifloat: 1
@@ -492,6 +795,27 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (0x1.fp1023 + 0x1.fp1023 i) == 7.107906849659093345062145442726115449315e2 + 7.853981633974483096156608458198757210493e-1 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (0x1.fp127 + 0x1.fp127 i) == 8.973081118419833726837456344608533993585e1 + 7.853981633974483096156608458198757210493e-1 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (0x1.fp16383 + 0x1.fp16383 i) == 1.135753137836666928715489992987020363057e4 + 7.853981633974483096156608458198757210493e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1p500 + 1.0 i) == 3.472667374605326000180332928505464606058e2 + 3.054936363499604682051979393213617699789e-151 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1p500 - 1.0 i) == 3.472667374605326000180332928505464606058e2 - 3.054936363499604682051979393213617699789e-151 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1p5000 + 1.0 i) == 3.466429049980286492395577839412341016946e3 + 7.079811261048172892385615158694057552948e-1506 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1p5000 - 1.0 i) == 3.466429049980286492395577839412341016946e3 - 7.079811261048172892385615158694057552948e-1506 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (1.0 + +0 i) == 0.8813735870195430252326093249797923090282 + +0 i":
double: 1
float: 1
@@ -499,6 +823,12 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.0 + 0x1p500 i) == 3.472667374605326000180332928505464606058e2 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.0 + 0x1p5000 i) == 3.466429049980286492395577839412341016946e3 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (1.0 - 0 i) == 0.8813735870195430252326093249797923090282 - 0 i":
double: 1
float: 1
@@ -506,16 +836,48 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.0 - 0x1p500 i) == 3.472667374605326000180332928505464606058e2 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.0 - 0x1p5000 i) == 3.466429049980286492395577839412341016946e3 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (1.5 + +0 i) == 1.194763217287109304111930828519090523536 + +0 i":
double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-1025 i) == 1.194763217287109304111930828519090523536 + 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-129 i) == 1.194763217287109304111930828519090523536 + 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-16385 i) == 1.194763217287109304111930828519090523536 + 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (1.5 - 0 i) == 1.194763217287109304111930828519090523536 - 0 i":
double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-1025 i) == 1.194763217287109304111930828519090523536 - 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-129 i) == 1.194763217287109304111930828519090523536 - 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-16385 i) == 1.194763217287109304111930828519090523536 - 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
# catan
Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
@@ -3090,7 +3452,9 @@ ifloat: 1
Function: Real part of "cacos":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
diff --git a/libc/ports/sysdeps/aarch64/strncmp.S b/libc/ports/sysdeps/aarch64/strncmp.S
new file mode 100644
index 000000000..341d5ced5
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/strncmp.S
@@ -0,0 +1,204 @@
+/* Copyright (C) 2013 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>
+
+/* Assumptions:
+ *
+ * ARMv8-a, AArch64
+ */
+
+#define REP8_01 0x0101010101010101
+#define REP8_7f 0x7f7f7f7f7f7f7f7f
+#define REP8_80 0x8080808080808080
+
+/* Parameters and result. */
+#define src1 x0
+#define src2 x1
+#define limit x2
+#define result x0
+
+/* Internal variables. */
+#define data1 x3
+#define data1w w3
+#define data2 x4
+#define data2w w4
+#define has_nul x5
+#define diff x6
+#define syndrome x7
+#define tmp1 x8
+#define tmp2 x9
+#define tmp3 x10
+#define zeroones x11
+#define pos x12
+#define limit_wd x13
+#define mask x14
+#define endloop x15
+
+ENTRY_ALIGN_AND_PAD (strncmp, 6, 7)
+ cbz limit, L(ret0)
+ eor tmp1, src1, src2
+ mov zeroones, #REP8_01
+ tst tmp1, #7
+ b.ne L(misaligned8)
+ ands tmp1, src1, #7
+ b.ne L(mutual_align)
+ /* Calculate the number of full and partial words -1. */
+ sub limit_wd, limit, #1 /* limit != 0, so no underflow. */
+ lsr limit_wd, limit_wd, #3 /* Convert to Dwords. */
+
+ /* NUL detection works on the principle that (X - 1) & (~X) & 0x80
+ (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
+ can be done in parallel across the entire word. */
+ /* Start of performance-critical section -- one 64B cache line. */
+L(loop_aligned):
+ ldr data1, [src1], #8
+ ldr data2, [src2], #8
+L(start_realigned):
+ subs limit_wd, limit_wd, #1
+ sub tmp1, data1, zeroones
+ orr tmp2, data1, #REP8_7f
+ eor diff, data1, data2 /* Non-zero if differences found. */
+ csinv endloop, diff, xzr, pl /* Last Dword or differences. */
+ bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
+ ccmp endloop, #0, #0, eq
+ b.eq L(loop_aligned)
+ /* End of performance-critical section -- one 64B cache line. */
+
+ /* Not reached the limit, must have found the end or a diff. */
+ tbz limit_wd, #63, L(not_limit)
+
+ /* Limit % 8 == 0 => all bytes significant. */
+ ands limit, limit, #7
+ b.eq L(not_limit)
+
+ lsl limit, limit, #3 /* Bits -> bytes. */
+ mov mask, #~0
+#ifdef __AARCH64EB__
+ lsr mask, mask, limit
+#else
+ lsl mask, mask, limit
+#endif
+ bic data1, data1, mask
+ bic data2, data2, mask
+
+ /* Make sure that the NUL byte is marked in the syndrome. */
+ orr has_nul, has_nul, mask
+
+L(not_limit):
+ orr syndrome, diff, has_nul
+
+#ifndef __AARCH64EB__
+ rev syndrome, syndrome
+ rev data1, data1
+ /* The MS-non-zero bit of the syndrome marks either the first bit
+ that is different, or the top bit of the first zero byte.
+ Shifting left now will bring the critical information into the
+ top bits. */
+ clz pos, syndrome
+ rev data2, data2
+ lsl data1, data1, pos
+ lsl data2, data2, pos
+ /* But we need to zero-extend (char is unsigned) the value and then
+ perform a signed 32-bit subtraction. */
+ lsr data1, data1, #56
+ sub result, data1, data2, lsr #56
+ RET
+#else
+ /* For big-endian we cannot use the trick with the syndrome value
+ as carry-propagation can corrupt the upper bits if the trailing
+ bytes in the string contain 0x01. */
+ /* However, if there is no NUL byte in the dword, we can generate
+ the result directly. We can't just subtract the bytes as the
+ MSB might be significant. */
+ cbnz has_nul, 1f
+ cmp data1, data2
+ cset result, ne
+ cneg result, result, lo
+ RET
+1:
+ /* Re-compute the NUL-byte detection, using a byte-reversed value. */
+ rev tmp3, data1
+ sub tmp1, tmp3, zeroones
+ orr tmp2, tmp3, #REP8_7f
+ bic has_nul, tmp1, tmp2
+ rev has_nul, has_nul
+ orr syndrome, diff, has_nul
+ clz pos, syndrome
+ /* The MS-non-zero bit of the syndrome marks either the first bit
+ that is different, or the top bit of the first zero byte.
+ Shifting left now will bring the critical information into the
+ top bits. */
+ lsl data1, data1, pos
+ lsl data2, data2, pos
+ /* But we need to zero-extend (char is unsigned) the value and then
+ perform a signed 32-bit subtraction. */
+ lsr data1, data1, #56
+ sub result, data1, data2, lsr #56
+ RET
+#endif
+
+L(mutual_align):
+ /* Sources are mutually aligned, but are not currently at an
+ alignment boundary. Round down the addresses and then mask off
+ the bytes that precede the start point.
+ We also need to adjust the limit calculations, but without
+ overflowing if the limit is near ULONG_MAX. */
+ bic src1, src1, #7
+ bic src2, src2, #7
+ ldr data1, [src1], #8
+ neg tmp3, tmp1, lsl #3 /* 64 - bits(bytes beyond align). */
+ ldr data2, [src2], #8
+ mov tmp2, #~0
+ sub limit_wd, limit, #1 /* limit != 0, so no underflow. */
+#ifdef __AARCH64EB__
+ /* Big-endian. Early bytes are at MSB. */
+ lsl tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */
+#else
+ /* Little-endian. Early bytes are at LSB. */
+ lsr tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */
+#endif
+ and tmp3, limit_wd, #7
+ lsr limit_wd, limit_wd, #3
+ /* Adjust the limit. Only low 3 bits used, so overflow irrelevant. */
+ add limit, limit, tmp1
+ add tmp3, tmp3, tmp1
+ orr data1, data1, tmp2
+ orr data2, data2, tmp2
+ add limit_wd, limit_wd, tmp3, lsr #3
+ b L(start_realigned)
+
+L(ret0):
+ mov result, #0
+ RET
+
+ .p2align 6
+L(misaligned8):
+ sub limit, limit, #1
+1:
+ /* Perhaps we can do better than this. */
+ ldrb data1w, [src1], #1
+ ldrb data2w, [src2], #1
+ subs limit, limit, #1
+ ccmp data1w, #1, #0, cs /* NZCV = 0b0000. */
+ ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
+ b.eq 1b
+ sub result, data1, data2
+ RET
+END (strncmp)
+libc_hidden_builtin_def (strncmp)
diff --git a/libc/ports/sysdeps/aarch64/strnlen.S b/libc/ports/sysdeps/aarch64/strnlen.S
new file mode 100644
index 000000000..e582e8ad2
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/strnlen.S
@@ -0,0 +1,161 @@
+/* strnlen - calculate the length of a string with limit.
+
+ Copyright (C) 2013 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>
+
+/* Assumptions:
+ *
+ * ARMv8-a, AArch64
+ */
+
+/* Arguments and results. */
+#define srcin x0
+#define len x0
+#define limit x1
+
+/* Locals and temporaries. */
+#define src x2
+#define data1 x3
+#define data2 x4
+#define data2a x5
+#define has_nul1 x6
+#define has_nul2 x7
+#define tmp1 x8
+#define tmp2 x9
+#define tmp3 x10
+#define tmp4 x11
+#define zeroones x12
+#define pos x13
+#define limit_wd x14
+
+#define REP8_01 0x0101010101010101
+#define REP8_7f 0x7f7f7f7f7f7f7f7f
+#define REP8_80 0x8080808080808080
+
+ENTRY_ALIGN_AND_PAD (__strnlen, 6, 9)
+ cbz limit, L(hit_limit)
+ mov zeroones, #REP8_01
+ bic src, srcin, #15
+ ands tmp1, srcin, #15
+ b.ne L(misaligned)
+ /* Calculate the number of full and partial words -1. */
+ sub limit_wd, limit, #1 /* Limit != 0, so no underflow. */
+ lsr limit_wd, limit_wd, #4 /* Convert to Qwords. */
+
+ /* NUL detection works on the principle that (X - 1) & (~X) & 0x80
+ (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
+ can be done in parallel across the entire word. */
+ /* The inner loop deals with two Dwords at a time. This has a
+ slightly higher start-up cost, but we should win quite quickly,
+ especially on cores with a high number of issue slots per
+ cycle, as we get much better parallelism out of the operations. */
+
+ /* Start of critial section -- keep to one 64Byte cache line. */
+L(loop):
+ ldp data1, data2, [src], #16
+L(realigned):
+ sub tmp1, data1, zeroones
+ orr tmp2, data1, #REP8_7f
+ sub tmp3, data2, zeroones
+ orr tmp4, data2, #REP8_7f
+ bic has_nul1, tmp1, tmp2
+ bic has_nul2, tmp3, tmp4
+ subs limit_wd, limit_wd, #1
+ orr tmp1, has_nul1, has_nul2
+ ccmp tmp1, #0, #0, pl /* NZCV = 0000 */
+ b.eq L(loop)
+ /* End of critical section -- keep to one 64Byte cache line. */
+
+ orr tmp1, has_nul1, has_nul2
+ cbz tmp1, L(hit_limit) /* No null in final Qword. */
+
+ /* We know there's a null in the final Qword. The easiest thing
+ to do now is work out the length of the string and return
+ MIN (len, limit). */
+
+ sub len, src, srcin
+ cbz has_nul1, L(nul_in_data2)
+#ifdef __AARCH64EB__
+ mov data2, data1
+#endif
+ sub len, len, #8
+ mov has_nul2, has_nul1
+L(nul_in_data2):
+#ifdef __AARCH64EB__
+ /* For big-endian, carry propagation (if the final byte in the
+ string is 0x01) means we cannot use has_nul directly. The
+ easiest way to get the correct byte is to byte-swap the data
+ and calculate the syndrome a second time. */
+ rev data2, data2
+ sub tmp1, data2, zeroones
+ orr tmp2, data2, #REP8_7f
+ bic has_nul2, tmp1, tmp2
+#endif
+ sub len, len, #8
+ rev has_nul2, has_nul2
+ clz pos, has_nul2
+ add len, len, pos, lsr #3 /* Bits to bytes. */
+ cmp len, limit
+ csel len, len, limit, ls /* Return the lower value. */
+ RET
+
+L(misaligned):
+ /* Deal with a partial first word.
+ We're doing two things in parallel here;
+ 1) Calculate the number of words (but avoiding overflow if
+ limit is near ULONG_MAX) - to do this we need to work out
+ limit + tmp1 - 1 as a 65-bit value before shifting it;
+ 2) Load and mask the initial data words - we force the bytes
+ before the ones we are interested in to 0xff - this ensures
+ early bytes will not hit any zero detection. */
+ sub limit_wd, limit, #1
+ neg tmp4, tmp1
+ cmp tmp1, #8
+
+ and tmp3, limit_wd, #15
+ lsr limit_wd, limit_wd, #4
+ mov tmp2, #~0
+
+ ldp data1, data2, [src], #16
+ lsl tmp4, tmp4, #3 /* Bytes beyond alignment -> bits. */
+ add tmp3, tmp3, tmp1
+
+#ifdef __AARCH64EB__
+ /* Big-endian. Early bytes are at MSB. */
+ lsl tmp2, tmp2, tmp4 /* Shift (tmp1 & 63). */
+#else
+ /* Little-endian. Early bytes are at LSB. */
+ lsr tmp2, tmp2, tmp4 /* Shift (tmp1 & 63). */
+#endif
+ add limit_wd, limit_wd, tmp3, lsr #4
+
+ orr data1, data1, tmp2
+ orr data2a, data2, tmp2
+
+ csinv data1, data1, xzr, le
+ csel data2, data2, data2a, le
+ b L(realigned)
+
+L(hit_limit):
+ mov len, limit
+ RET
+END (__strnlen)
+weak_alias (__strnlen, strnlen)
+libc_hidden_def (strnlen)
diff --git a/libc/ports/sysdeps/aarch64/sysdep.h b/libc/ports/sysdeps/aarch64/sysdep.h
index 6b75ada14..9349471e3 100644
--- a/libc/ports/sysdeps/aarch64/sysdep.h
+++ b/libc/ports/sysdeps/aarch64/sysdep.h
@@ -42,6 +42,22 @@
cfi_startproc; \
CALL_MCOUNT
+/* Define an entry point visible from C with a specified alignment and
+ pre-padding with NOPs. This can be used to ensure that a critical
+ loop within a function is cache line aligned. Note this version
+ does not adjust the padding if CALL_MCOUNT is defined. */
+
+#define ENTRY_ALIGN_AND_PAD(name, align, padding) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),%function; \
+ .p2align align; \
+ .rep padding; \
+ nop; \
+ .endr; \
+ C_LABEL(name) \
+ cfi_startproc; \
+ CALL_MCOUNT
+
#undef END
#define END(name) \
cfi_endproc; \
diff --git a/libc/ports/sysdeps/alpha/memchr.c b/libc/ports/sysdeps/alpha/memchr.c
index 70416d557..67f718a50 100644
--- a/libc/ports/sysdeps/alpha/memchr.c
+++ b/libc/ports/sysdeps/alpha/memchr.c
@@ -16,7 +16,6 @@
<http://www.gnu.org/licenses/>. */
#include <string.h>
-#include <bp-sym.h>
typedef unsigned long word;
@@ -170,6 +169,6 @@ __memchr (const void *s, int xc, size_t n)
}
#ifdef weak_alias
-weak_alias (__memchr, BP_SYM (memchr))
+weak_alias (__memchr, memchr)
#endif
libc_hidden_builtin_def (memchr)
diff --git a/libc/ports/sysdeps/am33/dl-machine.h b/libc/ports/sysdeps/am33/dl-machine.h
index 2db27378d..924319d03 100644
--- a/libc/ports/sysdeps/am33/dl-machine.h
+++ b/libc/ports/sysdeps/am33/dl-machine.h
@@ -55,16 +55,14 @@ elf_machine_load_address (void)
return off + gotaddr - gotval;
}
-#if !defined PROF && !__BOUNDED_POINTERS__
+#ifndef PROF
/* We add a declaration of this function here so that in dl-runtime.c
the ELF_MACHINE_RUNTIME_TRAMPOLINE macro really can pass the parameters
in registers.
We cannot use this scheme for profiling because the _mcount call
destroys the passed register information. */
-/* GKM FIXME: Fix trampoline to pass bounds so we can do
- without the `__unbounded' qualifier. */
-static ElfW(Addr) fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset)
+static ElfW(Addr) fixup (struct link_map *l, ElfW(Word) reloc_offset)
__attribute__ ((unused));
static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
ElfW(Addr) retaddr)
@@ -116,7 +114,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
/* This code is used in dl-runtime.c to call the `fixup' function
and then redirect to the address it returns. */
-#if !defined PROF && !__BOUNDED_POINTERS__
+#ifndef PROF
# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
.text\n\
.globl _dl_runtime_resolve\n\
diff --git a/libc/ports/sysdeps/am33/elf/start.S b/libc/ports/sysdeps/am33/elf/start.S
index 0ca71f14a..e89f9db15 100644
--- a/libc/ports/sysdeps/am33/elf/start.S
+++ b/libc/ports/sysdeps/am33/elf/start.S
@@ -37,8 +37,6 @@
NULL
*/
-#include "bp-sym.h"
-
.text
.globl _start
.type _start,@function
@@ -63,13 +61,13 @@ _start:
mov 0,a3
mov (32,sp), d1 /* argc. */
- mov BP_SYM (main), d0 /* main. */
+ mov main, d0 /* main. */
/* Call the user's main function, and exit with its value.
But let the libc call main. */
- call BP_SYM (__libc_start_main),[],0
+ call __libc_start_main,[],0
- call BP_SYM (abort),[],0 /* Crash if somehow `exit' does return. */
+ call abort,[],0 /* Crash if somehow `exit' does return. */
/* Define a symbol for the first piece of initialized data. */
.data
diff --git a/libc/ports/sysdeps/arm/__longjmp.S b/libc/ports/sysdeps/arm/__longjmp.S
index 5c04f3645..a3a2a8aec 100644
--- a/libc/ports/sysdeps/arm/__longjmp.S
+++ b/libc/ports/sysdeps/arm/__longjmp.S
@@ -16,6 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* ??? Needs more rearrangement for the LDM to handle thumb mode. */
+#define NO_THUMB
#include <sysdep.h>
#define _SETJMP_H
#define _ASM
@@ -105,12 +107,12 @@ ENTRY (__longjmp)
#ifdef NEED_HWCAP
# ifdef IS_IN_rtld
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_local_ro:
.long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
# else
# ifdef PIC
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_global_ro:
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
# else
diff --git a/libc/ports/sysdeps/arm/arm-mcount.S b/libc/ports/sysdeps/arm/arm-mcount.S
index 6c2427139..679d042ba 100644
--- a/libc/ports/sysdeps/arm/arm-mcount.S
+++ b/libc/ports/sysdeps/arm/arm-mcount.S
@@ -24,8 +24,8 @@
#ifdef __thumb2__
.thumb
- .syntax unified
#endif
+ .syntax unified
/* Use an assembly stub with a special ABI. The calling lr has been
@@ -77,15 +77,10 @@ ENTRY(_mcount)
cfi_rel_offset (r3, 12)
cfi_rel_offset (fp, 16)
cfi_rel_offset (lr, 20)
-#ifdef __thumb2__
movs r0, fp
ittt ne
ldrne r0, [r0, #-4]
-#else
- movs fp, fp
- ldrne r0, [fp, #-4]
-#endif
- movnes r1, lr
+ movsne r1, lr
blne __mcount_internal
#ifdef __thumb2__
ldmia sp!, {r0, r1, r2, r3, fp, pc}
diff --git a/libc/ports/sysdeps/arm/crti.S b/libc/ports/sysdeps/arm/crti.S
index 44e20f0c1..1d55ae27a 100644
--- a/libc/ports/sysdeps/arm/crti.S
+++ b/libc/ports/sysdeps/arm/crti.S
@@ -38,6 +38,8 @@
they can be called as functions. The symbols _init and _fini are
magic and cause the linker to emit DT_INIT and DT_FINI. */
+/* Always build .init and .fini sections in ARM mode. */
+#define NO_THUMB
#include <libc-symbols.h>
#include <sysdep.h>
diff --git a/libc/ports/sysdeps/arm/crtn.S b/libc/ports/sysdeps/arm/crtn.S
index 5ff3661f1..a01eb0139 100644
--- a/libc/ports/sysdeps/arm/crtn.S
+++ b/libc/ports/sysdeps/arm/crtn.S
@@ -33,6 +33,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Always build .init and .fini sections in ARM mode. */
+#define NO_THUMB
#include <sysdep.h>
/* crtn.S puts function epilogues in the .init and .fini sections
diff --git a/libc/ports/sysdeps/arm/dl-tlsdesc.S b/libc/ports/sysdeps/arm/dl-tlsdesc.S
index 0ae3abb38..7b4c8dfcb 100644
--- a/libc/ports/sysdeps/arm/dl-tlsdesc.S
+++ b/libc/ports/sysdeps/arm/dl-tlsdesc.S
@@ -29,7 +29,7 @@
.text
@ emit debug information with cfi
@ use arm-specific pseudos for unwinding itself
- .cfi_sections .debug_frame
+ CFI_SECTIONS
.hidden _dl_tlsdesc_return
.global _dl_tlsdesc_return
.type _dl_tlsdesc_return,#function
@@ -116,6 +116,7 @@ _dl_tlsdesc_dynamic:
ldr r3, [r1]
ldr r2, [r0, r3, lsl #3]
cmn r2, #1
+ ittt ne
ldrne r3, [r1, #4]
addne r3, r2, r3
rsbne r0, r4, r3
diff --git a/libc/ports/sysdeps/arm/dl-trampoline.S b/libc/ports/sysdeps/arm/dl-trampoline.S
index ebf221c85..561d8ae6f 100644
--- a/libc/ports/sysdeps/arm/dl-trampoline.S
+++ b/libc/ports/sysdeps/arm/dl-trampoline.S
@@ -16,6 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* ??? Needs more rearrangement for the LDM to handle thumb mode. */
+#define NO_THUMB
#include <sysdep.h>
#include <libc-symbols.h>
@@ -28,7 +30,7 @@
.text
.globl _dl_runtime_resolve
.type _dl_runtime_resolve, #function
- .cfi_sections .debug_frame
+ CFI_SECTIONS
cfi_startproc
.align 2
_dl_runtime_resolve:
@@ -77,7 +79,7 @@ _dl_runtime_resolve:
#ifndef PROF
.globl _dl_runtime_profile
.type _dl_runtime_profile, #function
- .cfi_sections .debug_frame
+ CFI_SECTIONS
cfi_startproc
.align 2
_dl_runtime_profile:
diff --git a/libc/ports/sysdeps/arm/frame.h b/libc/ports/sysdeps/arm/frame.h
index c5a8ed17e..db3529939 100644
--- a/libc/ports/sysdeps/arm/frame.h
+++ b/libc/ports/sysdeps/arm/frame.h
@@ -19,9 +19,9 @@
/* This is the APCS stack backtrace structure. */
struct layout
{
- struct layout *__unbounded next;
- void *__unbounded sp;
- void *__unbounded return_address;
+ struct layout *next;
+ void *sp;
+ void *return_address;
};
#define FIRST_FRAME_POINTER ADVANCE_STACK_FRAME (__builtin_frame_address (0))
diff --git a/libc/ports/sysdeps/arm/memcpy.S b/libc/ports/sysdeps/arm/memcpy.S
index d8164b4d7..98b9b47e3 100644
--- a/libc/ports/sysdeps/arm/memcpy.S
+++ b/libc/ports/sysdeps/arm/memcpy.S
@@ -17,6 +17,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Thumb requires excessive IT insns here. */
+#define NO_THUMB
#include <sysdep.h>
/*
diff --git a/libc/ports/sysdeps/arm/memmove.S b/libc/ports/sysdeps/arm/memmove.S
index d33c1cef8..059ca7ac3 100644
--- a/libc/ports/sysdeps/arm/memmove.S
+++ b/libc/ports/sysdeps/arm/memmove.S
@@ -17,6 +17,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Thumb requires excessive IT insns here. */
+#define NO_THUMB
#include <sysdep.h>
/*
diff --git a/libc/ports/sysdeps/arm/memset.S b/libc/ports/sysdeps/arm/memset.S
index 3152a84e8..9924cb911 100644
--- a/libc/ports/sysdeps/arm/memset.S
+++ b/libc/ports/sysdeps/arm/memset.S
@@ -16,6 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Thumb requires excessive IT insns here. */
+#define NO_THUMB
#include <sysdep.h>
/* void *memset (dstpp, c, len) */
diff --git a/libc/ports/sysdeps/arm/preconfigure b/libc/ports/sysdeps/arm/preconfigure
index 20f6d91a1..6d61b1428 100644
--- a/libc/ports/sysdeps/arm/preconfigure
+++ b/libc/ports/sysdeps/arm/preconfigure
@@ -10,7 +10,7 @@ arm*)
# an appropriate directory exists in sysdeps/arm
archcppflag=`echo "" |
$CC $CFLAGS $CPPFLAGS -E -dM - |
- grep __ARM_ARCH |
+ grep '__ARM_ARCH_[0-9].*__' |
sed -e 's/^#define //' -e 's/ .*//'`
case x$archcppflag in
@@ -28,7 +28,10 @@ arm*)
machine=armv6t2
echo "Found compiler is configured for $machine"
;;
-
+ x__ARM_ARCH_6*__)
+ machine=armv6
+ echo "Found compiler is configured for $machine"
+ ;;
*)
machine=arm
echo 2>&1 "arm/preconfigure: Did not find ARM architecture type; using default"
diff --git a/libc/ports/sysdeps/arm/setjmp.S b/libc/ports/sysdeps/arm/setjmp.S
index 4b7542ad3..6776cab38 100644
--- a/libc/ports/sysdeps/arm/setjmp.S
+++ b/libc/ports/sysdeps/arm/setjmp.S
@@ -16,6 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* ??? Needs more rearrangement for the STM to handle thumb mode. */
+#define NO_THUMB
#include <sysdep.h>
#define _SETJMP_H
#define _ASM
@@ -91,12 +93,12 @@ ENTRY (__sigsetjmp)
#ifdef NEED_HWCAP
# ifdef IS_IN_rtld
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_local_ro:
.long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
# else
# ifdef PIC
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_global_ro:
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
# else
diff --git a/libc/ports/sysdeps/arm/strlen.S b/libc/ports/sysdeps/arm/strlen.S
index 15e922118..2b947e240 100644
--- a/libc/ports/sysdeps/arm/strlen.S
+++ b/libc/ports/sysdeps/arm/strlen.S
@@ -16,6 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Thumb requires excessive IT insns here. */
+#define NO_THUMB
#include <sysdep.h>
/* size_t strlen(const char *S)
diff --git a/libc/ports/sysdeps/arm/sysdep.h b/libc/ports/sysdeps/arm/sysdep.h
index 0e6f645e8..4af7429ac 100644
--- a/libc/ports/sysdeps/arm/sysdep.h
+++ b/libc/ports/sysdeps/arm/sysdep.h
@@ -58,40 +58,43 @@
#endif
/* Define an entry point visible from C. */
-#define ENTRY(name) \
- .globl C_SYMBOL_NAME(name); \
- .type C_SYMBOL_NAME(name),%function; \
- .align ALIGNARG(4); \
- C_LABEL(name) \
- .cfi_sections .debug_frame; \
- cfi_startproc; \
- CALL_MCOUNT
+#define ENTRY(name) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),%function; \
+ .align ALIGNARG(4); \
+ C_LABEL(name) \
+ CFI_SECTIONS; \
+ cfi_startproc; \
+ CALL_MCOUNT
+
+#define CFI_SECTIONS \
+ .cfi_sections .debug_frame
#undef END
-#define END(name) \
- cfi_endproc; \
- ASM_SIZE_DIRECTIVE(name)
+#define END(name) \
+ cfi_endproc; \
+ ASM_SIZE_DIRECTIVE(name)
/* If compiled for profiling, call `mcount' at the start of each function. */
#ifdef PROF
/* Call __gnu_mcount_nc if GCC >= 4.4. */
#if __GNUC_PREREQ(4,4)
-#define CALL_MCOUNT \
- str lr,[sp, #-4]!; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (lr, 0); \
- bl PLTJMP(mcount); \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (lr)
+#define CALL_MCOUNT \
+ str lr,[sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
+ bl PLTJMP(mcount); \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr)
#else /* else call _mcount */
-#define CALL_MCOUNT \
- str lr,[sp, #-4]!; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (lr, 0); \
- bl PLTJMP(mcount); \
- ldr lr, [sp], #4; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (lr)
+#define CALL_MCOUNT \
+ str lr,[sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
+ bl PLTJMP(mcount); \
+ ldr lr, [sp], #4; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr)
#endif
#else
#define CALL_MCOUNT /* Do nothing. */
@@ -115,3 +118,11 @@
.eabi_attribute 24, 1
#endif /* __ASSEMBLER__ */
+
+/* This number is the offset from the pc at the current location. */
+/* ??? At the moment we're not turning on thumb mode in assembly. */
+#if defined(__thumb__) && !defined(__ASSEMBLER__)
+# define PC_OFS 4
+#else
+# define PC_OFS 8
+#endif
diff --git a/libc/ports/sysdeps/ia64/memchr.S b/libc/ports/sysdeps/ia64/memchr.S
index f23a41cb7..610264407 100644
--- a/libc/ports/sysdeps/ia64/memchr.S
+++ b/libc/ports/sysdeps/ia64/memchr.S
@@ -154,7 +154,4 @@ ENTRY(__memchr)
END(__memchr)
weak_alias (__memchr, memchr)
-#if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
-#endif
libc_hidden_builtin_def (memchr)
diff --git a/libc/ports/sysdeps/m68k/Makefile b/libc/ports/sysdeps/m68k/Makefile
index ef798306b..c5b5318f0 100644
--- a/libc/ports/sysdeps/m68k/Makefile
+++ b/libc/ports/sysdeps/m68k/Makefile
@@ -26,8 +26,14 @@ asm-CPPFLAGS += $(m68k-syntax-flag)
pic-ccflag = -fpic
+ifeq ($(subdir),setjmp)
# Make sure setjmp.c is compiled with a frame pointer
CFLAGS-setjmp.c := -fno-omit-frame-pointer
+endif
+
+ifeq ($(subdir),debug)
+CFLAGS-backtrace.c += -funwind-tables
+endif
ifeq ($(subdir),elf)
CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
diff --git a/libc/ports/sysdeps/m68k/backtrace.c b/libc/ports/sysdeps/m68k/backtrace.c
new file mode 100644
index 000000000..decd03c11
--- /dev/null
+++ b/libc/ports/sysdeps/m68k/backtrace.c
@@ -0,0 +1,159 @@
+/* Return backtrace of current program state.
+ Copyright (C) 2013 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 <bits/libc-lock.h>
+#include <dlfcn.h>
+#include <execinfo.h>
+#include <stdlib.h>
+#include <unwind.h>
+
+struct trace_arg
+{
+ void **array;
+ int cnt, size;
+ void *lastfp, *lastsp;
+};
+
+#ifdef SHARED
+static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *);
+static _Unwind_Ptr (*unwind_getip) (struct _Unwind_Context *);
+static _Unwind_Ptr (*unwind_getcfa) (struct _Unwind_Context *);
+static _Unwind_Ptr (*unwind_getgr) (struct _Unwind_Context *, int);
+static void *libgcc_handle;
+
+static void
+init (void)
+{
+ libgcc_handle = __libc_dlopen ("libgcc_s.so.2");
+
+ if (libgcc_handle == NULL)
+ return;
+
+ unwind_backtrace = __libc_dlsym (libgcc_handle, "_Unwind_Backtrace");
+ unwind_getip = __libc_dlsym (libgcc_handle, "_Unwind_GetIP");
+ unwind_getcfa = __libc_dlsym (libgcc_handle, "_Unwind_GetCFA");
+ unwind_getgr = __libc_dlsym (libgcc_handle, "_Unwind_GetGR");
+ if (unwind_getip == NULL || unwind_getgr == NULL || unwind_getcfa == NULL)
+ {
+ unwind_backtrace = NULL;
+ __libc_dlclose (libgcc_handle);
+ libgcc_handle = NULL;
+ }
+}
+#else
+# define unwind_backtrace _Unwind_Backtrace
+# define unwind_getip _Unwind_GetIP
+# define unwind_getcfa _Unwind_GetCFA
+# define unwind_getgr _Unwind_GetGR
+#endif
+
+static _Unwind_Reason_Code
+backtrace_helper (struct _Unwind_Context *ctx, void *a)
+{
+ struct trace_arg *arg = a;
+
+ /* We are first called with address in the __backtrace function.
+ Skip it. */
+ if (arg->cnt != -1)
+ arg->array[arg->cnt] = (void *) unwind_getip (ctx);
+ if (++arg->cnt == arg->size)
+ return _URC_END_OF_STACK;
+
+ /* %fp is DWARF2 register 14 on M68K. */
+ arg->lastfp = (void *) unwind_getgr (ctx, 14);
+ arg->lastsp = (void *) unwind_getcfa (ctx);
+ return _URC_NO_REASON;
+}
+
+
+/* This is a global variable set at program start time. It marks the
+ highest used stack address. */
+extern void *__libc_stack_end;
+
+
+/* This is the stack layout we see with every stack frame
+ if not compiled without frame pointer.
+
+ +-----------------+ +-----------------+
+ %fp -> | %fp last frame--------> | %fp last frame--->...
+ | | | |
+ | return address | | return address |
+ +-----------------+ +-----------------+
+
+ First try as far to get as far as possible using
+ _Unwind_Backtrace which handles -fomit-frame-pointer
+ as well, but requires .eh_frame info. Then fall back to
+ walking the stack manually. */
+
+struct layout
+{
+ struct layout *fp;
+ void *ret;
+};
+
+
+int
+__backtrace (void **array, int size)
+{
+ struct trace_arg arg = { .array = array, .size = size, .cnt = -1 };
+#ifdef SHARED
+ __libc_once_define (static, once);
+
+ __libc_once (once, init);
+ if (unwind_backtrace == NULL)
+ return 0;
+#endif
+
+ if (size >= 1)
+ unwind_backtrace (backtrace_helper, &arg);
+
+ if (arg.cnt > 1 && arg.array[arg.cnt - 1] == NULL)
+ --arg.cnt;
+ else if (arg.cnt < size)
+ {
+ struct layout *fp = (struct layout *) arg.lastfp;
+
+ while (arg.cnt < size)
+ {
+ /* Check for out of range. */
+ if ((void *) fp < arg.lastsp || (void *) fp > __libc_stack_end
+ || ((long) fp & 1))
+ break;
+
+ array[arg.cnt++] = fp->ret;
+ fp = fp->fp;
+ }
+ }
+ return arg.cnt != -1 ? arg.cnt : 0;
+}
+weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
+
+
+#ifdef SHARED
+/* Free all resources if necessary. */
+libc_freeres_fn (free_mem)
+{
+ unwind_backtrace = NULL;
+ if (libgcc_handle != NULL)
+ {
+ __libc_dlclose (libgcc_handle);
+ libgcc_handle = NULL;
+ }
+}
+#endif
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps b/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
index 96caef5df..59b057693 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
@@ -251,6 +251,14 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: cacos (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 - 7.107906849659093345062145442726115449315e2 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp127 + 0x1.fp127 i) == 7.853981633974483096156608458198757210493e-1 - 8.973081118419833726837456344608533993585e1 i":
+double: 1
+idouble: 1
Test "Imaginary part of: cacos (1.5 + +0 i) == +0 - 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -471,6 +479,14 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: casin (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 + 7.107906849659093345062145442726115449315e2 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp127 + 0x1.fp127 i) == 7.853981633974483096156608458198757210493e-1 + 8.973081118419833726837456344608533993585e1 i":
+double: 1
+idouble: 1
Test "Imaginary part of: casin (1.5 + +0 i) == pi/2 + 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -581,6 +597,14 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (0x1.fp1023 + 0x1.fp1023 i) == 7.107906849659093345062145442726115449315e2 + 7.853981633974483096156608458198757210493e-1 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp127 + 0x1.fp127 i) == 8.973081118419833726837456344608533993585e1 + 7.853981633974483096156608458198757210493e-1 i":
+double: 1
+idouble: 1
Test "Real part of: casinh (1.0 + +0 i) == 0.8813735870195430252326093249797923090282 + +0 i":
double: 1
float: 1
diff --git a/libc/ports/sysdeps/m68k/memchr.S b/libc/ports/sysdeps/m68k/memchr.S
index a15ebded0..07b102523 100644
--- a/libc/ports/sysdeps/m68k/memchr.S
+++ b/libc/ports/sysdeps/m68k/memchr.S
@@ -304,7 +304,4 @@ L(L9:)
END(__memchr)
weak_alias (__memchr, memchr)
-#if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
-#endif
libc_hidden_builtin_def (memchr)
diff --git a/libc/ports/sysdeps/mips/__longjmp.c b/libc/ports/sysdeps/mips/__longjmp.c
index a9efb0dac..67bdb86cf 100644
--- a/libc/ports/sysdeps/mips/__longjmp.c
+++ b/libc/ports/sysdeps/mips/__longjmp.c
@@ -23,8 +23,8 @@
#error This file uses GNU C extensions; you must compile with GCC.
#endif
-void
-__longjmp (env_arg, val_arg)
+static void __attribute__ ((nomips16))
+____longjmp (env_arg, val_arg)
__jmp_buf env_arg;
int val_arg;
{
@@ -86,3 +86,5 @@ __longjmp (env_arg, val_arg)
/* Avoid `volatile function does return' warnings. */
for (;;);
}
+
+strong_alias (____longjmp, __longjmp);
diff --git a/libc/ports/sysdeps/mips/abort-instr.h b/libc/ports/sysdeps/mips/abort-instr.h
index d7d8d501b..7ccae5736 100644
--- a/libc/ports/sysdeps/mips/abort-instr.h
+++ b/libc/ports/sysdeps/mips/abort-instr.h
@@ -1,2 +1,6 @@
/* An instruction which should crash any program is a breakpoint. */
-#define ABORT_INSTRUCTION asm ("break 255")
+#ifdef __mips16
+# define ABORT_INSTRUCTION asm ("break 63")
+#else
+# define ABORT_INSTRUCTION asm ("break 255")
+#endif
diff --git a/libc/ports/sysdeps/mips/add_n.S b/libc/ports/sysdeps/mips/add_n.S
index 7a3848f60..e83fc8170 100644
--- a/libc/ports/sysdeps/mips/add_n.S
+++ b/libc/ports/sysdeps/mips/add_n.S
@@ -118,4 +118,4 @@ L(end): addu $11,$11,$2
sw $11,0($4)
j $31
or $2,$2,$8
- .end __mpn_add_n
+END (__mpn_add_n)
diff --git a/libc/ports/sysdeps/mips/bits/atomic.h b/libc/ports/sysdeps/mips/bits/atomic.h
index 566b3dd2b..bdc3acef7 100644
--- a/libc/ports/sysdeps/mips/bits/atomic.h
+++ b/libc/ports/sysdeps/mips/bits/atomic.h
@@ -78,9 +78,12 @@ typedef uintmax_t uatomic_max_t;
#define MIPS_SYNC_STR_1(X) MIPS_SYNC_STR_2(X)
#define MIPS_SYNC_STR MIPS_SYNC_STR_1(MIPS_SYNC)
-#if __GNUC_PREREQ (4, 8)
+#if __GNUC_PREREQ (4, 8) || (defined __mips16 && __GNUC_PREREQ (4, 7))
/* The __atomic_* builtins are available in GCC 4.7 and later, but MIPS
- support for their efficient implementation was added only in GCC 4.8. */
+ support for their efficient implementation was added only in GCC 4.8.
+ We still want to use them even with GCC 4.7 for MIPS16 code where we
+ have no assembly alternative available and want to avoid the __sync_*
+ if at all possible. */
/* Compare and exchange.
For all "bool" routines, we return FALSE if exchange succesful. */
@@ -200,7 +203,33 @@ typedef uintmax_t uatomic_max_t;
# define atomic_exchange_and_add_rel(mem, value) \
__atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
__ATOMIC_RELEASE)
-#else /* !__GNUC_PREREQ (4, 8) */
+
+#elif defined __mips16 /* !__GNUC_PREREQ (4, 7) */
+/* This implementation using __sync* builtins will be removed once glibc
+ requires GCC 4.7 or later to build. */
+
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+ __sync_val_compare_and_swap ((mem), (oldval), (newval))
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ (!__sync_bool_compare_and_swap ((mem), (oldval), (newval)))
+
+# define atomic_exchange_acq(mem, newval) \
+ __sync_lock_test_and_set ((mem), (newval))
+
+# define atomic_exchange_and_add(mem, val) \
+ __sync_fetch_and_add ((mem), (val))
+
+# define atomic_bit_test_set(mem, bit) \
+ ({ __typeof (bit) __bit = (bit); \
+ (__sync_fetch_and_or ((mem), 1 << (__bit)) & (1 << (__bit))); })
+
+# define atomic_and(mem, mask) (void) __sync_fetch_and_and ((mem), (mask))
+# define atomic_and_val(mem, mask) __sync_fetch_and_and ((mem), (mask))
+
+# define atomic_or(mem, mask) (void) __sync_fetch_and_or ((mem), (mask))
+# define atomic_or_val(mem, mask) __sync_fetch_and_or ((mem), (mask))
+
+#else /* !__mips16 && !__GNUC_PREREQ (4, 8) */
/* This implementation using inline assembly will be removed once glibc
requires GCC 4.8 or later to build. */
@@ -443,15 +472,21 @@ typedef uintmax_t uatomic_max_t;
# define atomic_exchange_and_add_rel(mem, value) \
__atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
MIPS_SYNC_STR, "")
-#endif /* __GNUC_PREREQ (4, 8) */
+
+#endif /* !__mips16 && !__GNUC_PREREQ (4, 8) */
/* TODO: More atomic operations could be implemented efficiently; only the
basic requirements are done. */
-#define atomic_full_barrier() \
+#ifdef __mips16
+# define atomic_full_barrier() __sync_synchronize ()
+
+#else /* !__mips16 */
+# define atomic_full_barrier() \
__asm__ __volatile__ (".set push\n\t" \
MIPS_PUSH_MIPS2 \
MIPS_SYNC_STR "\n\t" \
".set pop" : : : "memory")
+#endif /* !__mips16 */
#endif /* bits/atomic.h */
diff --git a/libc/ports/sysdeps/mips/bits/nan.h b/libc/ports/sysdeps/mips/bits/nan.h
index ffbb3b5d5..7aa157b1d 100644
--- a/libc/ports/sysdeps/mips/bits/nan.h
+++ b/libc/ports/sysdeps/mips/bits/nan.h
@@ -1,4 +1,4 @@
-/* `NAN' constant for IEEE 754 machines.
+/* `NAN' constant for IEEE 754 machines. MIPS version.
Copyright (C) 1992-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -13,7 +13,7 @@
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
+ License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _MATH_H
@@ -21,20 +21,21 @@
#endif
-/* IEEE Not A Number (QNaN). Note that MIPS has the QNaN and SNaN patterns
- reversed compared to most other architectures. The IEEE spec left
- the definition of this open to implementations, and for MIPS the top
- bit of the mantissa must be SET to indicate a SNaN. */
+/* IEEE Not A Number. */
+/* Note that MIPS has the QNaN and SNaN patterns reversed compared to most
+ other architectures. The IEEE spec left the definition of this open to
+ implementations, and for MIPS the top bit of the mantissa must be SET to
+ indicate a SNaN. */
#if __GNUC_PREREQ(3,3)
-# define NAN (__builtin_nanf(""))
+# define NAN (__builtin_nanf (""))
#elif defined __GNUC__
# define NAN \
- (__extension__ \
- ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
+ (__extension__ \
+ ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \
{ __l: 0x7fbfffffUL }).__d)
#else
@@ -48,7 +49,8 @@
# define __nan_bytes { 0xff, 0xff, 0xbf, 0x7f }
# endif
-static union { unsigned char __c[4]; float __d; } __nan_union = { __nan_bytes };
+static union { unsigned char __c[4]; float __d; } __nan_union
+ __attribute__ ((__unused__)) = { __nan_bytes };
# define NAN (__nan_union.__d)
#endif /* GCC. */
diff --git a/libc/ports/sysdeps/mips/bsd-_setjmp.S b/libc/ports/sysdeps/mips/bsd-_setjmp.S
index a932096a0..50cce7e72 100644
--- a/libc/ports/sysdeps/mips/bsd-_setjmp.S
+++ b/libc/ports/sysdeps/mips/bsd-_setjmp.S
@@ -22,6 +22,8 @@
#include <sysdep.h>
+ .set nomips16
+
#ifdef __PIC__
.option pic2
#endif
@@ -38,5 +40,5 @@ ENTRY (_setjmp)
#else
j C_SYMBOL_NAME (__sigsetjmp)
#endif
- .end _setjmp
+END (_setjmp)
libc_hidden_def (_setjmp)
diff --git a/libc/ports/sysdeps/mips/bsd-setjmp.S b/libc/ports/sysdeps/mips/bsd-setjmp.S
index 406c8492d..18e8b0f90 100644
--- a/libc/ports/sysdeps/mips/bsd-setjmp.S
+++ b/libc/ports/sysdeps/mips/bsd-setjmp.S
@@ -22,6 +22,8 @@
#include <sysdep.h>
+ .set nomips16
+
#ifdef __PIC__
.option pic2
#endif
@@ -38,4 +40,4 @@ ENTRY (setjmp)
#else
j C_SYMBOL_NAME (__sigsetjmp)
#endif
- .end setjmp
+END (setjmp)
diff --git a/libc/ports/sysdeps/mips/dl-machine.h b/libc/ports/sysdeps/mips/dl-machine.h
index 91f7a7bb5..a7c784fec 100644
--- a/libc/ports/sysdeps/mips/dl-machine.h
+++ b/libc/ports/sysdeps/mips/dl-machine.h
@@ -119,6 +119,7 @@ static inline ElfW(Addr)
elf_machine_load_address (void)
{
ElfW(Addr) addr;
+#ifndef __mips16
asm (" .set noreorder\n"
" " STRINGXP (PTR_LA) " %0, 0f\n"
" bltzal $0, 0f\n"
@@ -128,6 +129,19 @@ elf_machine_load_address (void)
: "=r" (addr)
: /* No inputs */
: "$31");
+#else
+ ElfW(Addr) tmp;
+ asm (" .set noreorder\n"
+ " move %1,$gp\n"
+ " lw %1,%%got(0f)(%1)\n"
+ "0: .fill 0\n" /* Clear the ISA bit on 0:. */
+ " la %0,0b\n"
+ " addiu %1,%%lo(0b)\n"
+ " subu %0,%1\n"
+ " .set reorder\n"
+ : "=d" (addr), "=d" (tmp)
+ : /* No inputs */);
+#endif
return addr;
}
@@ -210,7 +224,8 @@ do { \
2) That under Unix the entry is named __start
and not just plain _start. */
-#define RTLD_START asm (\
+#ifndef __mips16
+# define RTLD_START asm (\
".text\n\
" _RTLD_PROLOGUE(ENTRY_POINT) "\
" STRINGXV(SETUP_GPX($25)) "\n\
@@ -283,6 +298,91 @@ do { \
".previous"\
);
+#else /* __mips16 */
+/* MIPS16 version. We currently only support O32 under MIPS16; the proper
+ assembly preprocessor abstractions will need to be added if other ABIs
+ are to be supported. */
+
+# define RTLD_START asm (\
+ ".text\n\
+ .set mips16\n\
+ " _RTLD_PROLOGUE (ENTRY_POINT) "\
+ # Construct GP value in $3.\n\
+ li $3, %hi(_gp_disp)\n\
+ addiu $4, $pc, %lo(_gp_disp)\n\
+ sll $3, 16\n\
+ addu $3, $4\n\
+ move $28, $3\n\
+ lw $4, %got(_DYNAMIC)($3)\n\
+ sw $4, -0x7ff0($3)\n\
+ move $4, $sp\n\
+ addiu $sp, -16\n\
+ # _dl_start() is sufficiently near to use pc-relative\n\
+ # load address.\n\
+ la $3, _dl_start\n\
+ move $25, $3\n\
+ jalr $3\n\
+ addiu $sp, 16\n\
+ " _RTLD_EPILOGUE (ENTRY_POINT) "\
+ \n\
+ \n\
+ " _RTLD_PROLOGUE (_dl_start_user) "\
+ li $16, %hi(_gp_disp)\n\
+ addiu $4, $pc, %lo(_gp_disp)\n\
+ sll $16, 16\n\
+ addu $16, $4\n\
+ move $17, $2\n\
+ move $28, $16\n\
+ lw $4, %got(_dl_skip_args)($16)\n\
+ lw $4, 0($4)\n\
+ beqz $4, 1f\n\
+ # Load the original argument count.\n\
+ lw $5, 0($sp)\n\
+ # Subtract _dl_skip_args from it.\n\
+ subu $5, $4\n\
+ # Adjust the stack pointer to skip _dl_skip_args words.\n\
+ sll $4, " STRINGXP (PTRLOG) "\n\
+ move $6, $sp\n\
+ addu $6, $4\n\
+ move $sp, $6\n\
+ # Save back the modified argument count.\n\
+ sw $5, 0($sp)\n\
+1: # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env) \n\
+ lw $4, %got(_rtld_local)($16)\n\
+ lw $4, 0($4)\n\
+ lw $5, 0($sp)\n\
+ addiu $6, $sp, " STRINGXP (PTRSIZE) "\n\
+ sll $7, $5, " STRINGXP (PTRLOG) "\n\
+ addu $7, $6\n\
+ addu $7, " STRINGXP (PTRSIZE) "\n\
+ # Make sure the stack pointer is aligned for _dl_init_internal.\n\
+ li $2, 2 * " STRINGXP (SZREG) "\n\
+ neg $2, $2\n\
+ move $3, $sp\n\
+ and $2, $3\n\
+ sw $3, -" STRINGXP (SZREG) "($2)\n\
+ addiu $2, -32\n\
+ move $sp, $2\n\
+ sw $16, 16($sp)\n\
+ # Call the function to run the initializers.\n\
+ lw $2, %call16(_dl_init_internal)($16)\n\
+ move $25, $2\n\
+ jalr $2\n\
+ # Restore the stack pointer for _start.\n\
+ lw $2, 32-" STRINGXP (SZREG) "($sp)\n\
+ move $sp, $2\n\
+ move $28, $16\n\
+ # Pass our finalizer function to the user in $2 as per ELF ABI.\n\
+ lw $2, %call16(_dl_fini)($16)\n\
+ # Jump to the user entry point.\n\
+ move $25, $17\n\
+ jr $17\n\t"\
+ _RTLD_EPILOGUE (_dl_start_user)\
+ ".previous"\
+);
+
+#endif /* __mips16 */
+
/* Names of the architecture-specific auditing callback functions. */
# if _MIPS_SIM == _ABIO32
# define ARCH_LA_PLTENTER mips_o32_gnu_pltenter
diff --git a/libc/ports/sysdeps/mips/dl-trampoline.c b/libc/ports/sysdeps/mips/dl-trampoline.c
index 57fb05b86..605e44e18 100644
--- a/libc/ports/sysdeps/mips/dl-trampoline.c
+++ b/libc/ports/sysdeps/mips/dl-trampoline.c
@@ -292,9 +292,11 @@ __dl_runtime_resolve (ElfW(Word) sym_index,
#endif
+#ifndef __mips16
asm ("\n\
.text\n\
.align 2\n\
+ .set nomips16\n\
.globl _dl_runtime_resolve\n\
.type _dl_runtime_resolve,@function\n\
.ent _dl_runtime_resolve\n\
@@ -351,6 +353,7 @@ _dl_runtime_resolve:\n\
asm ("\n\
.text\n\
.align 2\n\
+ .set nomips16\n\
.globl _dl_runtime_pltresolve\n\
.type _dl_runtime_pltresolve,@function\n\
.ent _dl_runtime_pltresolve\n\
@@ -381,3 +384,130 @@ _dl_runtime_pltresolve:\n\
.previous\n\
");
+#elif _MIPS_SIM == _ABIO32 /* __mips16 */
+/* MIPS16 version, O32 only. */
+asm ("\n\
+ .text\n\
+ .align 2\n\
+ .set mips16\n\
+ .globl _dl_runtime_resolve\n\
+ .type _dl_runtime_resolve,@function\n\
+ .ent _dl_runtime_resolve\n\
+_dl_runtime_resolve:\n\
+ .frame $29, " STRINGXP (ELF_DL_FRAME_SIZE) ", $31\n\
+ # Save arguments and sp value in stack.\n\t"
+# if _MIPS_ISA >= _MIPS_ISA_MIPS32
+ "save " STRINGXP (ELF_DL_FRAME_SIZE) ", $4-$7, $ra\n\t"
+# else
+ "addiu $sp, -" STRINGXP (ELF_DL_FRAME_SIZE) "\n\
+ sw $7, 32($sp)\n\
+ sw $6, 28($sp)\n\
+ sw $5, 24($sp)\n\
+ sw $4, 20($sp)\n\t"
+# endif
+ "# Preserve caller's $ra, for RESTORE instruction below.\n\
+ move $5, $15\n\
+ sw $5, 36($sp)\n\
+ # Compute GP into $2.\n\
+ li $2, %hi(_gp_disp)\n\
+ addiu $3, $pc, %lo(_gp_disp)\n\
+ sll $2, 16\n\
+ addu $2, $3\n\
+ lw $3, %got(__dl_runtime_resolve)($2)\n\
+ move $4, $24\n\
+ addiu $3, %lo(__dl_runtime_resolve)\n\
+ move $7, $ra\n\
+ move $6, $28\n\
+ move $25, $3\n\
+ jalr $3\n\t"
+# if _MIPS_ISA >= _MIPS_ISA_MIPS32
+ "restore " STRINGXP(ELF_DL_FRAME_SIZE) ", $4-$7, $ra\n\t"
+# else
+ "# Restore $ra, move placed further down to hide latency.\n\
+ lw $4, 36($sp)\n\
+ lw $5, 24($sp)\n\
+ lw $6, 28($sp)\n\
+ lw $7, 32($sp)\n\
+ move $ra, $4\n\
+ lw $4, 20($sp)\n\
+ addiu $sp, " STRINGXP(ELF_DL_FRAME_SIZE) "\n\t"
+# endif
+ "move $25, $2\n\
+ jr $2\n\
+ .end _dl_runtime_resolve\n\
+ .previous\n\
+");
+
+asm ("\n\
+ .text\n\
+ .align 2\n\
+ .set mips16\n\
+ .globl _dl_runtime_pltresolve\n\
+ .type _dl_runtime_pltresolve,@function\n\
+ .ent _dl_runtime_pltresolve\n\
+_dl_runtime_pltresolve:\n\
+ .frame $29, " STRINGXP(ELF_DL_PLT_FRAME_SIZE) ", $31\n\
+ # Save arguments and sp value in stack.\n\t"
+# if _MIPS_ISA >= _MIPS_ISA_MIPS32
+ "save " STRINGXP(ELF_DL_PLT_FRAME_SIZE) ", $4-$7, $ra\n\t"
+# else
+ "addiu $sp, -" STRINGXP(ELF_DL_PLT_FRAME_SIZE) "\n\
+ sw $7, 40($sp)\n\
+ sw $6, 36($sp)\n\
+ sw $5, 32($sp)\n\
+ sw $4, 28($sp)\n\t"
+# endif
+ "# Preserve MIPS16 stub function arguments.\n\
+ sw $3, 20($sp)\n\
+ sw $2, 16($sp)\n\
+ # Preserve caller's $ra, for RESTORE instruction below.\n\
+ move $3, $15\n\
+ sw $3, 44($sp)\n\
+ # Compute GP into $2.\n\
+ li $2, %hi(_gp_disp)\n\
+ addiu $3, $pc, %lo(_gp_disp)\n\
+ sll $2, 16\n\
+ addu $2, $3\n\
+ # Save GP value in slot.\n\
+ sw $2, 24($sp)\n\
+ # Load _dl_fixup address.\n\
+ lw $6, %call16(_dl_fixup)($2)\n\
+ # Load link map address.\n\
+ move $3, $28\n\
+ lw $4, " STRINGXP (PTRSIZE) "($3)\n\
+ move $5, $24\n\
+ sll $5, " STRINGXP (PTRLOG) " + 1\n\
+ # Call _dl_fixup.\n\
+ move $25, $6\n\
+ jalr $6\n\
+ move $25, $2\n\
+ # Reload GP value into $28.\n\
+ lw $3, 24($sp)\n\
+ move $28, $3\n\
+ lw $3, 16($sp)\n\
+ move $15, $3\n\
+ lw $3, 20($sp)\n\t"
+# if _MIPS_ISA >= _MIPS_ISA_MIPS32
+ "restore " STRINGXP (ELF_DL_PLT_FRAME_SIZE) ", $4-$7, $ra\n\t"
+# else
+ "# Restore $ra, move placed further down to hide latency.\n\
+ lw $4, 44($sp)\n\
+ lw $5, 32($sp)\n\
+ lw $6, 36($sp)\n\
+ lw $7, 40($sp)\n\
+ move $ra, $4\n\
+ lw $4, 28($sp)\n\
+ addiu $sp, " STRINGXP (ELF_DL_PLT_FRAME_SIZE) "\n\t"
+# endif
+ ".set noreorder\n\
+ jr $2\n\
+ move $2, $15\n\
+ .set reorder\n\
+ .end _dl_runtime_pltresolve\n\
+ .previous\n\
+");
+
+#else /* __mips16 && _MIPS_SIM != _ABIO32 */
+# error "MIPS16 support for N32/N64 not implemented"
+
+#endif /* __mips16 */
diff --git a/libc/ports/sysdeps/mips/fpu/e_sqrt.c b/libc/ports/sysdeps/mips/fpu/e_sqrt.c
index cff9cec6e..26314b010 100644
--- a/libc/ports/sysdeps/mips/fpu/e_sqrt.c
+++ b/libc/ports/sysdeps/mips/fpu/e_sqrt.c
@@ -22,7 +22,7 @@
#if (_MIPS_ISA >= _MIPS_ISA_MIPS2)
-double
+double __attribute__ ((nomips16))
__ieee754_sqrt (double x)
{
double z;
diff --git a/libc/ports/sysdeps/mips/fpu/e_sqrtf.c b/libc/ports/sysdeps/mips/fpu/e_sqrtf.c
index 87d242d82..0f7bfd94b 100644
--- a/libc/ports/sysdeps/mips/fpu/e_sqrtf.c
+++ b/libc/ports/sysdeps/mips/fpu/e_sqrtf.c
@@ -22,7 +22,7 @@
#if (_MIPS_ISA >= _MIPS_ISA_MIPS2)
-float
+float __attribute__ ((nomips16))
__ieee754_sqrtf (float x)
{
float z;
diff --git a/libc/ports/sysdeps/mips/fpu_control.h b/libc/ports/sysdeps/mips/fpu_control.h
index 30e54f9c3..6aecb3bc8 100644
--- a/libc/ports/sysdeps/mips/fpu_control.h
+++ b/libc/ports/sysdeps/mips/fpu_control.h
@@ -99,8 +99,15 @@ extern fpu_control_t __fpu_control;
typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
/* Macros for accessing the hardware control word. */
-#define _FPU_GETCW(cw) __asm__ volatile ("cfc1 %0,$31" : "=r" (cw))
-#define _FPU_SETCW(cw) __asm__ volatile ("ctc1 %0,$31" : : "r" (cw))
+extern fpu_control_t __mips_fpu_getcw (void) __THROW;
+extern void __mips_fpu_setcw (fpu_control_t) __THROW;
+#ifdef __mips16
+# define _FPU_GETCW(cw) do { (cw) = __mips_fpu_getcw (); } while (0)
+# define _FPU_SETCW(cw) __mips_fpu_setcw (cw)
+#else
+# define _FPU_GETCW(cw) __asm__ volatile ("cfc1 %0,$31" : "=r" (cw))
+# define _FPU_SETCW(cw) __asm__ volatile ("ctc1 %0,$31" : : "r" (cw))
+#endif
/* Default control word set at startup. */
extern fpu_control_t __fpu_control;
diff --git a/libc/ports/sysdeps/mips/include/sys/asm.h b/libc/ports/sysdeps/mips/include/sys/asm.h
new file mode 100644
index 000000000..7b356e12e
--- /dev/null
+++ b/libc/ports/sysdeps/mips/include/sys/asm.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 2013 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_ASM_H
+
+# include_next <sys/asm.h>
+
+# undef __mips_cfi_startproc
+# define __mips_cfi_startproc cfi_startproc
+# undef __mips_cfi_endproc
+# define __mips_cfi_endproc cfi_endproc
+
+# if _MIPS_SIM == _ABIO32
+# define SETUP_GP64_REG_CFI(a)
+# define SETUP_GP64_REG(a, b)
+# define SETUP_GP64_STACK_CFI(a)
+# define SETUP_GP64_STACK(a, b)
+# define RESTORE_GP64_REG
+# define RESTORE_GP64_STACK
+# else
+# define SETUP_GP64_REG_CFI(gpsavereg) \
+ cfi_register (gp, gpsavereg)
+# define SETUP_GP64_REG(gpsavereg, proc) \
+ SETUP_GP64 (gpsavereg, proc); \
+ SETUP_GP64_REG_CFI (gpsavereg)
+# define SETUP_GP64_STACK_CFI(gpoffset) \
+ cfi_rel_offset (gp, gpoffset)
+# define SETUP_GP64_STACK(gpoffset, proc) \
+ SETUP_GP64 (gpoffset, proc); \
+ SETUP_GP64_STACK_CFI (gpoffset)
+# define RESTORE_GP64_REG \
+ RESTORE_GP64; \
+ cfi_restore (gp)
+# define RESTORE_GP64_STACK \
+ RESTORE_GP64; \
+ cfi_restore (gp)
+# endif
+
+#endif
diff --git a/libc/ports/sysdeps/mips/machine-gmon.h b/libc/ports/sysdeps/mips/machine-gmon.h
index 8c62d84a9..144c04402 100644
--- a/libc/ports/sysdeps/mips/machine-gmon.h
+++ b/libc/ports/sysdeps/mips/machine-gmon.h
@@ -37,6 +37,8 @@ static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
#define MCOUNT asm(\
".globl _mcount;\n\t" \
".align 2;\n\t" \
+ ".set push;\n\t" \
+ ".set nomips16;\n\t" \
".type _mcount,@function;\n\t" \
".ent _mcount\n\t" \
"_mcount:\n\t" \
@@ -67,9 +69,8 @@ static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
"addu $29,$29,56;\n\t" \
"j $31;\n\t" \
"move $31,$1;\n\t" \
- ".set reorder;\n\t" \
- ".set at\n\t" \
- ".end _mcount");
+ ".end _mcount;\n\t" \
+ ".set pop");
#else
@@ -94,6 +95,8 @@ static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
#define MCOUNT asm(\
".globl _mcount;\n\t" \
".align 3;\n\t" \
+ ".set push;\n\t" \
+ ".set nomips16;\n\t" \
".type _mcount,@function;\n\t" \
".ent _mcount\n\t" \
"_mcount:\n\t" \
@@ -132,8 +135,7 @@ static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
PTR_ADDU_STRING " $29,$29,96;\n\t" \
"j $31;\n\t" \
"move $31,$1;\n\t" \
- ".set reorder;\n\t" \
- ".set at\n\t" \
- ".end _mcount");
+ ".end _mcount;\n\t" \
+ ".set pop");
#endif
diff --git a/libc/ports/sysdeps/mips/memset.S b/libc/ports/sysdeps/mips/memset.S
index 8c8606c83..78dab481d 100644
--- a/libc/ports/sysdeps/mips/memset.S
+++ b/libc/ports/sysdeps/mips/memset.S
@@ -18,6 +18,7 @@
#include <sysdep.h>
+ .set nomips16
/* void *memset(void *s, int c, size_t n). */
diff --git a/libc/ports/sysdeps/mips/mips32/crti.S b/libc/ports/sysdeps/mips/mips32/crti.S
index 5b46279c1..5f3e9ba43 100644
--- a/libc/ports/sysdeps/mips/mips32/crti.S
+++ b/libc/ports/sysdeps/mips/mips32/crti.S
@@ -54,6 +54,8 @@
.hidden PREINIT_FUNCTION
#endif
+ .set nomips16
+
.section .init,"ax",@progbits
.p2align 2
.globl _init
diff --git a/libc/ports/sysdeps/mips/mips32/crtn.S b/libc/ports/sysdeps/mips/mips32/crtn.S
index 44cdff0a1..42381c512 100644
--- a/libc/ports/sysdeps/mips/mips32/crtn.S
+++ b/libc/ports/sysdeps/mips/mips32/crtn.S
@@ -36,6 +36,8 @@
/* crtn.S puts function epilogues in the .init and .fini sections
corresponding to the prologues in crti.S. */
+ .set nomips16
+
.section .init,"ax",@progbits
lw $31,28($sp)
.set noreorder
diff --git a/libc/ports/sysdeps/mips/mips32/fpu/Versions b/libc/ports/sysdeps/mips/mips32/fpu/Versions
new file mode 100644
index 000000000..91bbf564b
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/fpu/Versions
@@ -0,0 +1,5 @@
+libc {
+ GLIBC_2.18 {
+ __mips_fpu_getcw; __mips_fpu_setcw;
+ }
+}
diff --git a/libc/ports/sysdeps/mips/memmove.c b/libc/ports/sysdeps/mips/mips32/fpu/fpu_control.c
index fd36859e6..cd107c533 100644
--- a/libc/ports/sysdeps/mips/memmove.c
+++ b/libc/ports/sysdeps/mips/mips32/fpu/fpu_control.c
@@ -1,8 +1,6 @@
-/* Copy memory to memory until the specified number of bytes
- has been copied. Overlap is handled correctly.
- Copyright (C) 2012-2013 Free Software Foundation, Inc.
+/* FPU control word handling, MIPS version, needed by MIPS16 callers.
+ Copyright (C) 1996-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,6 +16,19 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* MIPS' implementation of memcpy is safe to use for memmove. */
-#define MEMCPY_OK_FOR_FWD_MEMMOVE 1
-#include <string/memmove.c>
+#include <math/fpu_control.c>
+
+fpu_control_t
+__mips_fpu_getcw (void)
+{
+ fpu_control_t cw;
+
+ _FPU_GETCW (cw);
+ return cw;
+}
+
+void
+__mips_fpu_setcw (fpu_control_t cw)
+{
+ _FPU_SETCW (cw);
+}
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/add_n.c b/libc/ports/sysdeps/mips/mips32/mips16/add_n.c
new file mode 100644
index 000000000..fbb412041
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/add_n.c
@@ -0,0 +1 @@
+#include <stdlib/add_n.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/addmul_1.c b/libc/ports/sysdeps/mips/mips32/mips16/addmul_1.c
new file mode 100644
index 000000000..c0e4a0bd7
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/addmul_1.c
@@ -0,0 +1 @@
+#include <stdlib/addmul_1.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/fpu/Makefile b/libc/ports/sysdeps/mips/mips32/mips16/fpu/Makefile
new file mode 100644
index 000000000..b58c4eeb0
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/fpu/Makefile
@@ -0,0 +1,5 @@
+# Building hard-float libm as MIPS16 actually produces larger code size,
+# so avoid doing so.
+ifeq ($(subdir),math)
+sysdep-CFLAGS += -mno-mips16
+endif
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/lshift.c b/libc/ports/sysdeps/mips/mips32/mips16/lshift.c
new file mode 100644
index 000000000..2f945d2c5
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/lshift.c
@@ -0,0 +1 @@
+#include <stdlib/lshift.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/mul_1.c b/libc/ports/sysdeps/mips/mips32/mips16/mul_1.c
new file mode 100644
index 000000000..8e758d603
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/mul_1.c
@@ -0,0 +1 @@
+#include <stdlib/mul_1.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/rshift.c b/libc/ports/sysdeps/mips/mips32/mips16/rshift.c
new file mode 100644
index 000000000..4e350a0dc
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/rshift.c
@@ -0,0 +1 @@
+#include <stdlib/rshift.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/sub_n.c b/libc/ports/sysdeps/mips/mips32/mips16/sub_n.c
new file mode 100644
index 000000000..d8b54925b
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/sub_n.c
@@ -0,0 +1 @@
+#include <stdlib/sub_n.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/submul_1.c b/libc/ports/sysdeps/mips/mips32/mips16/submul_1.c
new file mode 100644
index 000000000..44cadf5cc
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/submul_1.c
@@ -0,0 +1 @@
+#include <stdlib/submul_1.c>
diff --git a/libc/ports/sysdeps/mips/mips64/add_n.S b/libc/ports/sysdeps/mips/mips64/add_n.S
index efb6cf424..020d4af09 100644
--- a/libc/ports/sysdeps/mips/mips64/add_n.S
+++ b/libc/ports/sysdeps/mips/mips64/add_n.S
@@ -33,11 +33,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 2
- .globl __mpn_add_n
- .ent __mpn_add_n
-__mpn_add_n:
+ENTRY (__mpn_add_n)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -126,4 +122,4 @@ L(Lend): daddu $11,$11,$2
j $31
or $2,$2,$8
- .end __mpn_add_n
+END (__mpn_add_n)
diff --git a/libc/ports/sysdeps/mips/mips64/addmul_1.S b/libc/ports/sysdeps/mips/mips64/addmul_1.S
index 43838fd2f..46729a65d 100644
--- a/libc/ports/sysdeps/mips/mips64/addmul_1.S
+++ b/libc/ports/sysdeps/mips/mips64/addmul_1.S
@@ -32,11 +32,7 @@
#ifdef PIC
.option pic2
#endif
- .text
- .align 4
- .globl __mpn_addmul_1
- .ent __mpn_addmul_1
-__mpn_addmul_1:
+ENTRY (__mpn_addmul_1)
#ifdef PIC
SETUP_GP /* ??? unused */
#endif
@@ -102,4 +98,4 @@ L(LC0): ld $10,0($4)
j $31
daddu $2,$9,$2 # add high product limb and carry from addition
- .end __mpn_addmul_1
+END (__mpn_addmul_1)
diff --git a/libc/ports/sysdeps/mips/mips64/bsd-_setjmp.S b/libc/ports/sysdeps/mips/mips64/bsd-_setjmp.S
index de36cf0e8..5d0f76c13 100644
--- a/libc/ports/sysdeps/mips/mips64/bsd-_setjmp.S
+++ b/libc/ports/sysdeps/mips/mips64/bsd-_setjmp.S
@@ -31,17 +31,17 @@ ENTRY (_setjmp)
#ifdef __PIC__
SETUP_GP
#endif
- SETUP_GP64 (v0, C_SYMBOL_NAME (_setjmp))
+ SETUP_GP64_REG (v0, C_SYMBOL_NAME (_setjmp))
PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp)
#if _MIPS_SIM == _ABIO32
nop
#endif
- RESTORE_GP64
+ RESTORE_GP64_REG
move a1, zero /* Pass a second argument of zero. */
#ifdef __PIC__
jr t9
#else
j C_SYMBOL_NAME (__sigsetjmp)
#endif
- .end _setjmp
+END (_setjmp)
libc_hidden_def (_setjmp)
diff --git a/libc/ports/sysdeps/mips/mips64/bsd-setjmp.S b/libc/ports/sysdeps/mips/mips64/bsd-setjmp.S
index c3e26bfc2..784e16e33 100644
--- a/libc/ports/sysdeps/mips/mips64/bsd-setjmp.S
+++ b/libc/ports/sysdeps/mips/mips64/bsd-setjmp.S
@@ -31,16 +31,16 @@ ENTRY (setjmp)
#ifdef __PIC__
SETUP_GP
#endif
- SETUP_GP64 (v0, C_SYMBOL_NAME (setjmp))
+ SETUP_GP64_REG (v0, C_SYMBOL_NAME (setjmp))
PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp)
#if _MIPS_SIM == _ABIO32
nop
#endif
- RESTORE_GP64
+ RESTORE_GP64_REG
dli a1, 1 /* Pass a second argument of one. */
#ifdef __PIC__
jr t9
#else
j C_SYMBOL_NAME (__sigsetjmp)
#endif
- .end setjmp
+END (setjmp)
diff --git a/libc/ports/sysdeps/mips/mips64/lshift.S b/libc/ports/sysdeps/mips/mips64/lshift.S
index e0b02bc25..740408d75 100644
--- a/libc/ports/sysdeps/mips/mips64/lshift.S
+++ b/libc/ports/sysdeps/mips/mips64/lshift.S
@@ -32,11 +32,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 2
- .globl __mpn_lshift
- .ent __mpn_lshift
-__mpn_lshift:
+ENTRY (__mpn_lshift)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -101,4 +97,4 @@ L(Loop): ld $3,-16($5)
L(Lend): dsll $8,$10,$7
j $31
sd $8,-8($4)
- .end __mpn_lshift
+END (__mpn_lshift)
diff --git a/libc/ports/sysdeps/mips/mips64/mul_1.S b/libc/ports/sysdeps/mips/mips64/mul_1.S
index 2fe28d369..e1360658a 100644
--- a/libc/ports/sysdeps/mips/mips64/mul_1.S
+++ b/libc/ports/sysdeps/mips/mips64/mul_1.S
@@ -33,11 +33,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 4
- .globl __mpn_mul_1
- .ent __mpn_mul_1
-__mpn_mul_1:
+ENTRY (__mpn_mul_1)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -91,4 +87,4 @@ L(LC0): mflo $10
j $31
daddu $2,$9,$2 # add high product limb and carry from addition
- .end __mpn_mul_1
+END (__mpn_mul_1)
diff --git a/libc/ports/sysdeps/mips/mips64/n32/crti.S b/libc/ports/sysdeps/mips/mips64/n32/crti.S
index d9066b2d6..ddcc9cc7f 100644
--- a/libc/ports/sysdeps/mips/mips64/n32/crti.S
+++ b/libc/ports/sysdeps/mips/mips64/n32/crti.S
@@ -54,6 +54,8 @@
.hidden PREINIT_FUNCTION
#endif
+ .set nomips16
+
.section .init,"ax",@progbits
.p2align 2
.globl _init
diff --git a/libc/ports/sysdeps/mips/mips64/n32/crtn.S b/libc/ports/sysdeps/mips/mips64/n32/crtn.S
index daf7d4256..5eb2b4f48 100644
--- a/libc/ports/sysdeps/mips/mips64/n32/crtn.S
+++ b/libc/ports/sysdeps/mips/mips64/n32/crtn.S
@@ -36,6 +36,8 @@
/* crtn.S puts function epilogues in the .init and .fini sections
corresponding to the prologues in crti.S. */
+ .set nomips16
+
.section .init,"ax",@progbits
ld $31,8($sp)
ld $28,0($sp)
diff --git a/libc/ports/sysdeps/mips/mips64/n64/crti.S b/libc/ports/sysdeps/mips/mips64/n64/crti.S
index 2111ba539..0c66d0de6 100644
--- a/libc/ports/sysdeps/mips/mips64/n64/crti.S
+++ b/libc/ports/sysdeps/mips/mips64/n64/crti.S
@@ -54,6 +54,8 @@
.hidden PREINIT_FUNCTION
#endif
+ .set nomips16
+
.section .init,"ax",@progbits
.p2align 2
.globl _init
diff --git a/libc/ports/sysdeps/mips/mips64/n64/crtn.S b/libc/ports/sysdeps/mips/mips64/n64/crtn.S
index c66a2e555..4c014b711 100644
--- a/libc/ports/sysdeps/mips/mips64/n64/crtn.S
+++ b/libc/ports/sysdeps/mips/mips64/n64/crtn.S
@@ -36,6 +36,8 @@
/* crtn.S puts function epilogues in the .init and .fini sections
corresponding to the prologues in crti.S. */
+ .set nomips16
+
.section .init,"ax",@progbits
ld $31,8($sp)
ld $28,0($sp)
diff --git a/libc/ports/sysdeps/mips/mips64/rshift.S b/libc/ports/sysdeps/mips/mips64/rshift.S
index 75ac68bb2..0d821f2b7 100644
--- a/libc/ports/sysdeps/mips/mips64/rshift.S
+++ b/libc/ports/sysdeps/mips/mips64/rshift.S
@@ -32,11 +32,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 2
- .globl __mpn_rshift
- .ent __mpn_rshift
-__mpn_rshift:
+ENTRY (__mpn_rshift)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -98,4 +94,4 @@ L(Loop): ld $3,8($5)
L(Lend): dsrl $8,$10,$7
j $31
sd $8,0($4)
- .end __mpn_rshift
+END (__mpn_rshift)
diff --git a/libc/ports/sysdeps/mips/mips64/setjmp.S b/libc/ports/sysdeps/mips/mips64/setjmp.S
index 53ed92ca4..5afbbe756 100644
--- a/libc/ports/sysdeps/mips/mips64/setjmp.S
+++ b/libc/ports/sysdeps/mips/mips64/setjmp.S
@@ -29,16 +29,16 @@ ENTRY (__sigsetjmp)
#ifdef __PIC__
SETUP_GP
#endif
- SETUP_GP64 (v0, C_SYMBOL_NAME (__sigsetjmp))
+ SETUP_GP64_REG (v0, C_SYMBOL_NAME (__sigsetjmp))
move a2, sp
move a3, fp
PTR_LA t9, __sigsetjmp_aux
#if _MIPS_SIM == _ABIO32
nop
#endif
- RESTORE_GP64
+ RESTORE_GP64_REG
#if _MIPS_SIM != _ABIO32
move a4, gp
#endif
jr t9
- .end __sigsetjmp
+END (__sigsetjmp)
diff --git a/libc/ports/sysdeps/mips/mips64/sub_n.S b/libc/ports/sysdeps/mips/mips64/sub_n.S
index ea8f4bd4c..dd6f69184 100644
--- a/libc/ports/sysdeps/mips/mips64/sub_n.S
+++ b/libc/ports/sysdeps/mips/mips64/sub_n.S
@@ -33,11 +33,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 2
- .globl __mpn_sub_n
- .ent __mpn_sub_n
-__mpn_sub_n:
+ENTRY (__mpn_sub_n)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -126,4 +122,4 @@ L(Lend): daddu $11,$11,$2
j $31
or $2,$2,$8
- .end __mpn_sub_n
+END (__mpn_sub_n)
diff --git a/libc/ports/sysdeps/mips/mips64/submul_1.S b/libc/ports/sysdeps/mips/mips64/submul_1.S
index 22239d52b..bf5d6ffce 100644
--- a/libc/ports/sysdeps/mips/mips64/submul_1.S
+++ b/libc/ports/sysdeps/mips/mips64/submul_1.S
@@ -33,11 +33,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 4
- .globl __mpn_submul_1
- .ent __mpn_submul_1
-__mpn_submul_1:
+ENTRY (__mpn_submul_1)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -103,4 +99,4 @@ L(LC0): ld $10,0($4)
j $31
daddu $2,$9,$2 # add high product limb and carry from addition
- .end __mpn_submul_1
+END (__mpn_submul_1)
diff --git a/libc/ports/sysdeps/mips/nptl/tls.h b/libc/ports/sysdeps/mips/nptl/tls.h
index 0c9199534..2529408f2 100644
--- a/libc/ports/sysdeps/mips/nptl/tls.h
+++ b/libc/ports/sysdeps/mips/nptl/tls.h
@@ -37,12 +37,17 @@ typedef union dtv
} pointer;
} dtv_t;
+#ifdef __mips16
+/* MIPS16 uses GCC builtin to access the TP. */
+# define READ_THREAD_POINTER() (__builtin_thread_pointer ())
+#else
/* Note: rd must be $v1 to be ABI-conformant. */
# define READ_THREAD_POINTER() \
({ void *__result; \
asm volatile (".set\tpush\n\t.set\tmips32r2\n\t" \
"rdhwr\t%0, $29\n\t.set\tpop" : "=v" (__result)); \
__result; })
+#endif
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
diff --git a/libc/ports/sysdeps/mips/preconfigure b/libc/ports/sysdeps/mips/preconfigure
index 9190eee87..b215eb2c1 100644
--- a/libc/ports/sysdeps/mips/preconfigure
+++ b/libc/ports/sysdeps/mips/preconfigure
@@ -25,5 +25,10 @@ mips64*) base_machine=mips64
CPPFLAGS="$CPPFLAGS -mabi=$mips_config_abi"
fi
;;
-mips*) base_machine=mips machine=mips/mips32/$machine ;;
+mips*) base_machine=mips
+ case "$CC $CFLAGS $CPPFLAGS " in
+ *" -mips16 "*) machine=mips/mips32/mips16/$machine ;;
+ *) machine=mips/mips32/$machine ;;
+ esac
+ ;;
esac
diff --git a/libc/ports/sysdeps/mips/setjmp.S b/libc/ports/sysdeps/mips/setjmp.S
index 7c53b97b2..f014b73b3 100644
--- a/libc/ports/sysdeps/mips/setjmp.S
+++ b/libc/ports/sysdeps/mips/setjmp.S
@@ -17,6 +17,8 @@
#include <sysdep.h>
+ .set nomips16
+
/* The function __sigsetjmp_aux saves all the registers, but it can't
reliably access the stack or frame pointers, so we pass them in as
extra arguments. */
@@ -41,4 +43,4 @@ ENTRY (__sigsetjmp)
#else
j __sigsetjmp_aux
#endif
- .end __sigsetjmp
+END (__sigsetjmp)
diff --git a/libc/ports/sysdeps/mips/setjmp_aux.c b/libc/ports/sysdeps/mips/setjmp_aux.c
index a955a4ffa..cb9ea245b 100644
--- a/libc/ports/sysdeps/mips/setjmp_aux.c
+++ b/libc/ports/sysdeps/mips/setjmp_aux.c
@@ -23,7 +23,7 @@
pointer. We do things this way because it's difficult to reliably
access them in C. */
-int
+int __attribute__ ((nomips16))
__sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp)
{
#ifdef __mips_hard_float
diff --git a/libc/ports/sysdeps/mips/start.S b/libc/ports/sysdeps/mips/start.S
index 82b7a229f..83a68959a 100644
--- a/libc/ports/sysdeps/mips/start.S
+++ b/libc/ports/sysdeps/mips/start.S
@@ -74,14 +74,15 @@
.text
.globl ENTRY_POINT
.type ENTRY_POINT,@function
+#ifndef __mips16
ENTRY_POINT:
-#ifdef __PIC__
+# ifdef __PIC__
SETUP_GPX($0)
SETUP_GPX64($25,$0)
-#else
+# else
PTR_LA $28, _gp /* Setup GP correctly if we're non-PIC. */
move $31, $0
-#endif
+# endif
PTR_LA $4, main /* main */
PTR_L $5, 0($29) /* argc */
@@ -92,22 +93,85 @@ ENTRY_POINT:
on o32 and quad words (16 bytes) on n32 and n64. */
and $29, -2 * SZREG
-#if _MIPS_SIM == _ABIO32
+# if _MIPS_SIM == _ABIO32
PTR_SUBIU $29, 32
-#endif
+# endif
PTR_LA $7, __libc_csu_init /* init */
PTR_LA $8, __libc_csu_fini
-#if _MIPS_SIM == _ABIO32
+# if _MIPS_SIM == _ABIO32
PTR_S $8, 16($29) /* fini */
PTR_S $2, 20($29) /* rtld_fini */
PTR_S $29, 24($29) /* stack_end */
-#else
+# else
move $9, $2 /* rtld_fini */
move $10, $29 /* stack_end */
-#endif
+# endif
jal __libc_start_main
hlt: b hlt /* Crash if somehow it does return. */
+#elif _MIPS_SIM == _ABIO32 /* __mips16 */
+ /* MIPS16 entry point. */
+ .set mips16
+ENTRY_POINT:
+# ifdef __PIC__
+ li $3, %hi(_gp_disp)
+ addiu $4, $pc, %lo(_gp_disp)
+ sll $3, 16
+ addu $3, $4
+ move $gp, $3
+# else
+ li $3, %hi(_gp)
+ sll $3, 16
+ addiu $3, %lo(_gp)
+ move $gp, $3
+# endif
+ /* Tie end of stack frames. */
+ li $4, 0
+ move $31, $4
+ /* Create new SP value in $7, including alignment. */
+ li $4, 2 * SZREG
+ neg $4, $4
+ move $7, $sp
+ and $7, $4
+ addiu $7, -32
+ /* Load arguments with original SP. */
+ lw $5, 0($sp)
+ addiu $6, $sp, PTRSIZE
+ /* Update SP. */
+ move $sp, $7
+ /* Lay out last arguments, and call __libc_start_main(). */
+# ifdef __PIC__
+ sw $7, 24($sp) /* stack_end */
+ lw $4, %got(__libc_csu_fini)($3)
+ lw $7, %got(__libc_csu_init)($3) /* init */
+ sw $4, 16($sp) /* fini */
+ lw $4, %got(main)($3) /* main */
+ lw $3, %call16(__libc_start_main)($3)
+ sw $2, 20($sp) /* rtld_fini */
+ move $25, $3
+ jalr $3
+# else
+ lw $4, 1f
+ sw $7, 24($sp) /* stack_end */
+ lw $7, 2f /* init */
+ sw $4, 16($sp) /* fini */
+ lw $4, 3f /* main */
+ sw $2, 20($sp) /* rtld_fini */
+ jal __libc_start_main
+# endif
+hlt: b hlt /* Crash if somehow it does return. */
+# ifndef __PIC__
+ .align 2
+1: .word __libc_csu_fini
+2: .word __libc_csu_init
+3: .word main
+# endif
+
+#else /* __mips16 && _MIPS_SIM != _ABIO32 */
+# error "MIPS16 support for N32/N64 not implemented"
+
+#endif /* __mips16 */
+
/* Define a symbol for the first piece of initialized data. */
.data
.globl __data_start
diff --git a/libc/ports/sysdeps/mips/sys/asm.h b/libc/ports/sysdeps/mips/sys/asm.h
index 605451a88..293cf364e 100644
--- a/libc/ports/sysdeps/mips/sys/asm.h
+++ b/libc/ports/sysdeps/mips/sys/asm.h
@@ -26,6 +26,10 @@
# define CAT(str1,str2) __CAT(str1,str2)
#endif
+/* Redefined as nonempty in the internal header. */
+#define __mips_cfi_startproc /* Empty. */
+#define __mips_cfi_endproc /* Empty. */
+
/*
* Macros to handle different pointer/register sizes for 32/64-bit code
*
@@ -147,7 +151,8 @@ l: \
.align 2; \
.type symbol,@function; \
.ent symbol,0; \
-symbol: .frame sp,0,ra
+symbol: .frame sp,0,ra; \
+ __mips_cfi_startproc
/*
* NESTED - declare nested routine entry point
@@ -157,13 +162,15 @@ symbol: .frame sp,0,ra
.align 2; \
.type symbol,@function; \
.ent symbol,0; \
-symbol: .frame sp, framesize, rpc
+symbol: .frame sp, framesize, rpc; \
+ __mips_cfi_startproc
/*
* END - mark end of function
*/
#ifndef END
# define END(function) \
+ __mips_cfi_endproc; \
.end function; \
.size function,.-function
#endif
@@ -173,7 +180,7 @@ symbol: .frame sp, framesize, rpc
*/
#define EXPORT(symbol) \
.globl symbol; \
-symbol:
+symbol: __mips_cfi_startproc
/*
* ABS - export absolute symbol
diff --git a/libc/ports/sysdeps/mips/sys/tas.h b/libc/ports/sysdeps/mips/sys/tas.h
index 603346ac3..871818565 100644
--- a/libc/ports/sysdeps/mips/sys/tas.h
+++ b/libc/ports/sysdeps/mips/sys/tas.h
@@ -24,7 +24,8 @@
__BEGIN_DECLS
-extern int _test_and_set (int *__p, int __v) __THROW;
+extern int _test_and_set (int *__p, int __v)
+ __THROW __attribute__ ((__nomips16__));
#ifdef __USE_EXTERN_INLINES
@@ -32,7 +33,7 @@ extern int _test_and_set (int *__p, int __v) __THROW;
# define _EXTERN_INLINE __extern_inline
# endif
-_EXTERN_INLINE int
+_EXTERN_INLINE int __attribute__ ((__nomips16__))
__NTH (_test_and_set (int *__p, int __v))
{
int __r, __t;
diff --git a/libc/ports/sysdeps/mips/tls-macros.h b/libc/ports/sysdeps/mips/tls-macros.h
index 8fe2e4a15..3e87e42ea 100644
--- a/libc/ports/sysdeps/mips/tls-macros.h
+++ b/libc/ports/sysdeps/mips/tls-macros.h
@@ -12,16 +12,33 @@
(abicalls pic0) function. */
#ifndef __PIC__
# if _MIPS_SIM != _ABI64
-# define LOAD_GP "move %[tmp], $28\n\tla $28, __gnu_local_gp\n\t"
+# ifndef __mips16
+# define LOAD_GP "move %[tmp], $28\n\tla $28, __gnu_local_gp\n\t"
+# else
+# define LOAD_GP \
+ "li %[tmp], %%hi(__gnu_local_gp)\n\t" \
+ "sll %[tmp], 16\n\t" \
+ "addiu %[tmp], %%lo(__gnu_local_gp)\n\t"
+# endif
# else
# define LOAD_GP "move %[tmp], $28\n\tdla $28, __gnu_local_gp\n\t"
# endif
# define UNLOAD_GP "\n\tmove $28, %[tmp]"
#else
-# define LOAD_GP
+/* MIPS16 (re)creates the GP value using PC-relative instructions. */
+# ifdef __mips16
+# define LOAD_GP \
+ "li %[tmp], %%hi(_gp_disp)\n\t" \
+ "addiu %0, $pc, %%lo(_gp_disp)\n\t" \
+ "sll %[tmp], 16\n\t" \
+ "addu %[tmp], %0\n\t"
+# else
+# define LOAD_GP
+# endif
# define UNLOAD_GP
#endif
+#ifndef __mips16
# define TLS_GD(x) \
({ void *__result, *__tmp; \
extern void *__tls_get_addr (void *); \
@@ -62,3 +79,45 @@
ADDU " %0,%0,$3" \
: "+r" (__result) : : "$3"); \
__result; })
+
+#else /* __mips16 */
+/* MIPS16 version. */
+# define TLS_GD(x) \
+ ({ void *__result, *__tmp; \
+ extern void *__tls_get_addr (void *); \
+ asm (LOAD_GP ADDIU " %1, %%tlsgd(" #x ")" \
+ "\n\tmove %0, %1" \
+ : "=d" (__result), [tmp] "=&d" (__tmp)); \
+ (int *) __tls_get_addr (__result); })
+# define TLS_LD(x) \
+ ({ void *__result, *__tmp; \
+ extern void *__tls_get_addr (void *); \
+ asm (LOAD_GP ADDIU " %1, %%tlsldm(" #x ")" \
+ "\n\tmove %0, %1" \
+ : "=d" (__result), [tmp] "=&d" (__tmp)); \
+ __result = __tls_get_addr (__result); \
+ asm ("li $3,%%dtprel_hi(" #x ")\n\t" \
+ "sll $3,16\n\t" \
+ "addiu $3,%%dtprel_lo(" #x ")\n\t" \
+ ADDU " %0,%0,$3" \
+ : "+d" (__result) : : "$3"); \
+ __result; })
+# define TLS_IE(x) \
+ ({ void *__result, *__tmp, *__tp; \
+ __tp = __builtin_thread_pointer (); \
+ asm (LOAD_GP LW " $3,%%gottprel(" #x ")(%1)\n\t" \
+ ADDU " %0,%[tp],$3" \
+ : "=&d" (__result), [tmp] "=&d" (__tmp) \
+ : [tp] "d" (__tp) : "$3"); \
+ __result; })
+# define TLS_LE(x) \
+ ({ void *__result, *__tp; \
+ __tp = __builtin_thread_pointer (); \
+ asm ("li $3,%%tprel_hi(" #x ")\n\t" \
+ "sll $3,16\n\t" \
+ "addiu $3,%%tprel_lo(" #x ")\n\t" \
+ ADDU " %0,%[tp],$3" \
+ : "=d" (__result) : [tp] "d" (__tp) : "$3"); \
+ __result; })
+
+#endif /* __mips16 */
diff --git a/libc/ports/sysdeps/powerpc/nofpu/fegetenv.c b/libc/ports/sysdeps/powerpc/nofpu/fegetenv.c
index 75e89408d..51bcef30a 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/fegetenv.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/fegetenv.c
@@ -19,7 +19,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
-#include <bp-sym.h>
extern int __sim_exceptions;
extern int __sim_disabled_exceptions;
@@ -42,8 +41,8 @@ __fegetenv (fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fegetenv, __old_fegetenv)
-compat_symbol (libm, BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2_1);
+compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
#endif
libm_hidden_ver (__fegetenv, fegetenv)
-versioned_symbol (libm, BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2_2);
+versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/nofpu/fesetenv.c b/libc/ports/sysdeps/powerpc/nofpu/fesetenv.c
index 810e1da56..3f35909b6 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/fesetenv.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/fesetenv.c
@@ -19,7 +19,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
-#include <bp-sym.h>
int
__fesetenv (const fenv_t *envp)
@@ -36,8 +35,8 @@ __fesetenv (const fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fesetenv, __old_fesetenv)
-compat_symbol (libm, BP_SYM (__old_fesetenv), BP_SYM (fesetenv), GLIBC_2_1);
+compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1);
#endif
libm_hidden_ver (__fesetenv, fesetenv)
-versioned_symbol (libm, BP_SYM (__fesetenv), BP_SYM (fesetenv), GLIBC_2_2);
+versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/nofpu/feupdateenv.c b/libc/ports/sysdeps/powerpc/nofpu/feupdateenv.c
index 94366a8d5..163f67310 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/feupdateenv.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/feupdateenv.c
@@ -21,7 +21,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
#include <signal.h>
-#include <bp-sym.h>
int
__feupdateenv (const fenv_t *envp)
@@ -45,8 +44,8 @@ __feupdateenv (const fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feupdateenv, __old_feupdateenv)
-compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
+compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
libm_hidden_ver (__feupdateenv, feupdateenv)
-versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);
+versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c b/libc/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c
index e8b2a3a48..2373fa400 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c
@@ -19,7 +19,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
-#include <bp-sym.h>
int
__fegetexceptflag (fexcept_t *flagp, int excepts)
@@ -32,7 +31,7 @@ __fegetexceptflag (fexcept_t *flagp, int excepts)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fegetexceptflag, __old_fegetexceptflag)
-compat_symbol (libm, BP_SYM (__old_fegetexceptflag), BP_SYM (fegetexceptflag), GLIBC_2_1);
+compat_symbol (libm, __old_fegetexceptflag, fegetexceptflag, GLIBC_2_1);
#endif
-versioned_symbol (libm, BP_SYM (__fegetexceptflag), BP_SYM (fegetexceptflag), GLIBC_2_2);
+versioned_symbol (libm, __fegetexceptflag, fegetexceptflag, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c b/libc/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c
index a0861d4a2..cd142b60b 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c
@@ -20,7 +20,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
#include <signal.h>
-#include <bp-sym.h>
#undef feraiseexcept
int
@@ -35,8 +34,8 @@ __feraiseexcept (int x)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feraiseexcept, __old_feraiseexcept)
-compat_symbol (libm, BP_SYM (__old_feraiseexcept), BP_SYM (feraiseexcept), GLIBC_2_1);
+compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1);
#endif
libm_hidden_ver (__feraiseexcept, feraiseexcept)
-versioned_symbol (libm, BP_SYM (__feraiseexcept), BP_SYM (feraiseexcept), GLIBC_2_2);
+versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c b/libc/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c
index 108df304c..3dc368fdd 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c
@@ -19,7 +19,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
-#include <bp-sym.h>
int
__fesetexceptflag(const fexcept_t *flagp, int excepts)
@@ -33,7 +32,7 @@ __fesetexceptflag(const fexcept_t *flagp, int excepts)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
-compat_symbol (libm, BP_SYM (__old_fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2_1);
+compat_symbol (libm, __old_fesetexceptflag, fesetexceptflag, GLIBC_2_1);
#endif
-versioned_symbol (libm, BP_SYM (__fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2_2);
+versioned_symbol (libm, __fesetexceptflag, fesetexceptflag, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/memcmp.S b/libc/ports/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6439f5c..2849461cd 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* memcmp
@@ -32,7 +30,7 @@
return src1 > src2, src1 < src2 or src1 = src2.
If src1 = src2 and no null, repeat. */
-EALIGN (BP_SYM (memcmp), 5, 0)
+EALIGN (memcmp, 5, 0)
srwi. r6,r5,5
beq L(preword2_count_loop)
mtctr r6
@@ -125,6 +123,6 @@ L(st2):
blt cr5,L(l_r)
addi r3,r0,-1
blr
-END (BP_SYM (memcmp))
+END (memcmp)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp,bcmp)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/memcpy.S b/libc/ports/sysdeps/powerpc/powerpc32/405/memcpy.S
index bca4f74bc..761e9675a 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/memcpy.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/memcpy.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* memcpy
@@ -33,7 +31,7 @@
If 32 or more bytes to copy we use 32 byte copy loop.
Finaly we copy 0-31 extra bytes. */
-EALIGN (BP_SYM (memcpy), 5, 0)
+EALIGN (memcpy, 5, 0)
/* Check if bytes to copy are greater than 256 and if
source and destination are unaligned */
cmpwi r5,0x0100
@@ -128,5 +126,5 @@ L(word4_count_loop_no_dcbt): /* Copy 32 bytes at a time */
L(end_memcpy):
mr r3,r0
blr
-END (BP_SYM (memcpy))
+END (memcpy)
libc_hidden_builtin_def (memcpy)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/memset.S b/libc/ports/sysdeps/powerpc/powerpc32/405/memset.S
index d07a976da..b73dba887 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/memset.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/memset.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* memset
@@ -37,7 +35,7 @@
If 16 or more words to set we use 16 word copy loop.
Finaly we set 0-15 extra bytes with string store. */
-EALIGN (BP_SYM (memset), 5, 0)
+EALIGN (memset, 5, 0)
rlwinm r11,r4,0,24,31
rlwimi r11,r4,8,16,23
rlwimi r11,r11,16,0,15
@@ -150,5 +148,5 @@ L(postword2_count_loop):
mtxer r7
stswx r8,0,r3
b L(end_memset)
-END (BP_SYM (memset))
+END (memset)
libc_hidden_builtin_def (memset)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/strcmp.S b/libc/ports/sysdeps/powerpc/powerpc32/405/strcmp.S
index faa7cf33b..c0b21907b 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/strcmp.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/strcmp.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* strcmp
@@ -34,7 +32,7 @@
return src1 > src2, src1 < src2 or src1 = src2.
If src1 = src2 and no null, repeat. */
-EALIGN (BP_SYM(strcmp),5,0)
+EALIGN (strcmp,5,0)
neg r7,r3
clrlwi r7,r7,20
neg r8,r4
@@ -132,5 +130,5 @@ L(byte_loop):
cmpwi r5,0
beq L(end_strcmp)
b L(byte_loop)
-END (BP_SYM (strcmp))
+END (strcmp)
libc_hidden_builtin_def (strcmp)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/strcpy.S b/libc/ports/sysdeps/powerpc/powerpc32/405/strcpy.S
index 88f8c8ea7..d7c84569d 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/strcpy.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/strcpy.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* strcpy
@@ -33,7 +31,7 @@
where in the last 8 bytes it is. Copy the appropriate bytes of the last
8 according to the null position. */
-EALIGN (BP_SYM (strcpy), 5, 0)
+EALIGN (strcpy, 5, 0)
neg r7,r4
subi r4,r4,1
clrlwi. r8,r7,29
@@ -105,5 +103,5 @@ L(last_bytes_copy_loop2):
L(end_strcpy):
blr
-END (BP_SYM (strcpy))
+END (strcpy)
libc_hidden_builtin_def (strcpy)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/strlen.S b/libc/ports/sysdeps/powerpc/powerpc32/405/strlen.S
index e267f4dfc..77d22ea67 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/strlen.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/strlen.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* strlen
@@ -31,7 +29,7 @@
the count and return the count value. We need to subtract one because
we don't count the null character as a byte. */
-EALIGN (BP_SYM (strlen),5,0)
+EALIGN (strlen,5,0)
neg r7,r3
clrlwi. r8,r7,29
addi r4,0,0
@@ -73,5 +71,5 @@ L(byte_count_loop):
L(end_strlen):
addi r3,r4,-1
blr
-END (BP_SYM (strlen))
+END (strlen)
libc_hidden_builtin_def (strlen)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/strncmp.S b/libc/ports/sysdeps/powerpc/powerpc32/405/strncmp.S
index a613869b7..3e2ba5f85 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/strncmp.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/strncmp.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* strncmp
@@ -39,7 +37,7 @@
return src1 > src2, src1 < src2 or src1 = src2.
If src1 = src2 and no null, repeat. */
-EALIGN (BP_SYM(strncmp),5,0)
+EALIGN (strncmp,5,0)
neg r7,r3
clrlwi r7,r7,20
neg r8,r4
@@ -126,5 +124,5 @@ L(end_strncmp):
L(st1):
mfcr r3
blr
-END (BP_SYM (strncmp))
+END (strncmp)
libc_hidden_builtin_def (strncmp)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/476/memset.S b/libc/ports/sysdeps/powerpc/powerpc32/476/memset.S
index f681a898d..48c21d620 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/476/memset.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/476/memset.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* memset
@@ -37,7 +35,7 @@
If 16 or more words to set we use 16 word copy loop.
Finaly we set 0-15 extra bytes with string store. */
-EALIGN (BP_SYM (memset), 5, 0)
+EALIGN (memset, 5, 0)
rlwinm r11,r4,0,24,31
rlwimi r11,r4,8,16,23
rlwimi r11,r11,16,0,15
@@ -150,5 +148,5 @@ L(postword2_count_loop):
mtxer r7
stswx r8,0,r3
b L(end_memset)
-END (BP_SYM (memset))
+END (memset)
libc_hidden_builtin_def (memset)
diff --git a/libc/ports/sysdeps/unix/alpha/sysdep.h b/libc/ports/sysdeps/unix/alpha/sysdep.h
index 3b71a5ec6..d20bcd6d3 100644
--- a/libc/ports/sysdeps/unix/alpha/sysdep.h
+++ b/libc/ports/sysdeps/unix/alpha/sysdep.h
@@ -161,6 +161,9 @@ __LABEL(name) \
#else /* !ASSEMBLER */
+/* In order to get __set_errno() definition in INLINE_SYSCALL. */
+#include <errno.h>
+
/* ??? Linux needs to be able to override INLINE_SYSCALL for one
particular special case. Make this easy. */
diff --git a/libc/ports/sysdeps/unix/arm/sysdep.S b/libc/ports/sysdeps/unix/arm/sysdep.S
index da07d85f1..40e4d80ec 100644
--- a/libc/ports/sysdeps/unix/arm/sysdep.S
+++ b/libc/ports/sysdeps/unix/arm/sysdep.S
@@ -31,8 +31,9 @@ __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. */
- cmp r0, $EWOULDBLOCK_sys /* Is it the old EWOULDBLOCK? */
- moveq r0, $EAGAIN /* Yes; translate it to EAGAIN. */
+ cmp r0, $EWOULDBLOCK_sys /* Is it the old EWOULDBLOCK? */
+ it eq
+ moveq r0, $EAGAIN /* Yes; translate it to EAGAIN. */
#endif
#ifndef IS_IN_rtld
@@ -50,14 +51,14 @@ __syscall_error:
mvn r0, #0
RETINSTR (, ip)
-1: .word errno(gottpoff) + (. - 2b - 8)
+1: .word errno(gottpoff) + (. - 2b - PC_OFS)
#elif RTLD_PRIVATE_ERRNO
ldr r1, 1f
0: str r0, [pc, r1]
mvn r0, $0
DO_RET(r14)
-1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8
+1: .word C_SYMBOL_NAME(rtld_errno) - 0b - PC_OFS
#else
#error "Unsupported non-TLS case"
#endif
diff --git a/libc/ports/sysdeps/unix/mips/mips32/sysdep.h b/libc/ports/sysdeps/unix/mips/mips32/sysdep.h
index d7d389253..5d96d05c6 100644
--- a/libc/ports/sysdeps/unix/mips/mips32/sysdep.h
+++ b/libc/ports/sysdeps/unix/mips/mips32/sysdep.h
@@ -24,8 +24,11 @@
#ifdef __PIC__
#define PSEUDO(name, syscall_name, args) \
.align 2; \
+ .set nomips16; \
+ cfi_startproc; \
99: la t9,__syscall_error; \
jr t9; \
+ cfi_endproc; \
ENTRY(name) \
.set noreorder; \
.cpload t9; \
@@ -37,9 +40,12 @@ L(syse1):
#else
#define PSEUDO(name, syscall_name, args) \
.set noreorder; \
+ .set nomips16; \
.align 2; \
+ cfi_startproc; \
99: j __syscall_error; \
nop; \
+ cfi_endproc; \
ENTRY(name) \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
diff --git a/libc/ports/sysdeps/unix/mips/mips64/n32/sysdep.h b/libc/ports/sysdeps/unix/mips/mips64/n32/sysdep.h
index 37a67a2e6..c55b95cc2 100644
--- a/libc/ports/sysdeps/unix/mips/mips64/n32/sysdep.h
+++ b/libc/ports/sysdeps/unix/mips/mips64/n32/sysdep.h
@@ -26,13 +26,18 @@
#ifdef __PIC__
#define PSEUDO(name, syscall_name, args) \
.align 2; \
+ .set nomips16; \
+ cfi_startproc; \
99:; \
.set noat; \
.cpsetup t9, $1, name; \
+ cfi_register (gp, $1); \
.set at; \
la t9,__syscall_error; \
.cpreturn; \
+ cfi_restore (gp); \
jr t9; \
+ cfi_endproc; \
ENTRY(name) \
li v0, SYS_ify(syscall_name); \
syscall; \
@@ -42,8 +47,11 @@ L(syse1):
#define PSEUDO(name, syscall_name, args) \
.set noreorder; \
.align 2; \
+ .set nomips16; \
+ cfi_startproc; \
99: j __syscall_error; \
nop; \
+ cfi_endproc; \
ENTRY(name) \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
diff --git a/libc/ports/sysdeps/unix/mips/mips64/n64/sysdep.h b/libc/ports/sysdeps/unix/mips/mips64/n64/sysdep.h
index 871184bd0..445e6ff73 100644
--- a/libc/ports/sysdeps/unix/mips/mips64/n64/sysdep.h
+++ b/libc/ports/sysdeps/unix/mips/mips64/n64/sysdep.h
@@ -26,13 +26,18 @@
#ifdef __PIC__
#define PSEUDO(name, syscall_name, args) \
.align 2; \
+ .set nomips16; \
+ cfi_startproc; \
99:; \
.set noat; \
.cpsetup t9, $1, name; \
+ cfi_register (gp, $1); \
.set at; \
dla t9,__syscall_error; \
.cpreturn; \
+ cfi_restore (gp); \
jr t9; \
+ cfi_endproc; \
ENTRY(name) \
li v0, SYS_ify(syscall_name); \
syscall; \
@@ -42,8 +47,11 @@ L(syse1):
#define PSEUDO(name, syscall_name, args) \
.set noreorder; \
.align 2; \
+ .set nomips16; \
+ cfi_startproc; \
99: j __syscall_error; \
nop; \
+ cfi_endproc; \
ENTRY(name) \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
diff --git a/libc/ports/sysdeps/unix/mips/sysdep.S b/libc/ports/sysdeps/unix/mips/sysdep.S
index e77891857..e27aada1d 100644
--- a/libc/ports/sysdeps/unix/mips/sysdep.S
+++ b/libc/ports/sysdeps/unix/mips/sysdep.S
@@ -21,6 +21,8 @@
#include <bits/errno.h>
#include <sys/asm.h>
+ .set nomips16
+
#ifdef _LIBC_REENTRANT
LOCALSZ= 3
diff --git a/libc/ports/sysdeps/unix/mips/sysdep.h b/libc/ports/sysdeps/unix/mips/sysdep.h
index bab3bc04c..4d7667ea9 100644
--- a/libc/ports/sysdeps/unix/mips/sysdep.h
+++ b/libc/ports/sysdeps/unix/mips/sysdep.h
@@ -27,39 +27,43 @@
.globl name; \
.align 2; \
.ent name,0; \
- name##:
+ name##: \
+ cfi_startproc;
#undef END
#define END(function) \
+ cfi_endproc; \
.end function; \
.size function,.-function
#define ret j ra ; nop
#undef PSEUDO_END
-#define PSEUDO_END(sym) .end sym; .size sym,.-sym
+#define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
#define PSEUDO_NOERRNO(name, syscall_name, args) \
.align 2; \
ENTRY(name) \
+ .set nomips16; \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
syscall
#undef PSEUDO_END_NOERRNO
-#define PSEUDO_END_NOERRNO(sym) .end sym; .size sym,.-sym
+#define PSEUDO_END_NOERRNO(sym) cfi_endproc; .end sym; .size sym,.-sym
#define ret_NOERRNO ret
#define PSEUDO_ERRVAL(name, syscall_name, args) \
.align 2; \
ENTRY(name) \
+ .set nomips16; \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
syscall
#undef PSEUDO_END_ERRVAL
-#define PSEUDO_END_ERRVAL(sym) .end sym; .size sym,.-sym
+#define PSEUDO_END_ERRVAL(sym) cfi_endproc; .end sym; .size sym,.-sym
#define ret_ERRVAL ret
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c b/libc/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
index 1da284dec..4d1ec3b10 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
@@ -22,7 +22,6 @@
#undef __gettimeofday
#include <bits/libc-vdso.h>
-#include <bp-checks.h>
/* Get the current time of day and timezone information,
putting it into *tv and *tz. If tz is null, *tz is not filled.
@@ -32,7 +31,7 @@ __gettimeofday (tv, tz)
struct timeval *tv;
struct timezone *tz;
{
- return INLINE_VSYSCALL (gettimeofday, 2, CHECK_1 (tv), CHECK_1 (tz));
+ return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
}
libc_hidden_def (__gettimeofday)
weak_alias (__gettimeofday, gettimeofday)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist
index f83e8806a..b04a761fe 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist
@@ -2077,3 +2077,6 @@ GLIBC_2.17
xencrypt F
xprt_register F
xprt_unregister F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c b/libc/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c
index 74b667564..dbaa2246b 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c
@@ -51,8 +51,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
}
result = INLINE_SYSCALL (rt_sigaction, 4, sig,
- act ? __ptrvalue (&kact) : NULL,
- oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
+ act ? &kact : NULL,
+ oact ? &koact : NULL, _NSIG / 8);
if (result >= 0 || errno != ENOSYS)
{
if (oact && result >= 0)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c
index 190674172..fdcad0bfb 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c
@@ -23,7 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c
index d6439505e..48f3cec9d 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c
@@ -22,14 +22,13 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
int
__gethostname (char *name, size_t len)
{
int result;
- result = INLINE_SYSCALL (gethostname, 2, CHECK_N (name, len), len);
+ result = INLINE_SYSCALL (gethostname, 2, name, len);
if (result == 0
/* See whether the string is terminated. If not we will return
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c
index b4633f413..dbd03c1b2 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c
@@ -21,13 +21,12 @@
#include <ipc_priv.h>
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
int
__new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
{
- return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, CHECK_1 (buf));
+ return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, buf);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist
index 1d0cc7ec3..980e08857 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist
@@ -1819,6 +1819,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index e50324cdd..cf6b8bfd9 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
@@ -38,6 +38,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -143,8 +145,31 @@
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ })
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
static inline int __attribute__((always_inline))
__lll_trylock(int *futex)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/semctl.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/semctl.c
index c18c695e3..31278a06c 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/semctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/semctl.c
@@ -33,10 +33,6 @@ union semun
struct seminfo *__buf; /* buffer for IPC_INFO */
};
-#include <bp-checks.h>
-#include <bp-semctl.h>
-
-
int
__new_semctl (int semid, int semnum, int cmd, ...)
{
@@ -51,7 +47,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
va_end (ap);
return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
- CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)->array);
+ arg.array);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c
index 5e5220044..f2217a2b5 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c
@@ -22,13 +22,12 @@
#include <sysdep.h>
#include <sys/syscall.h>
#include <bits/wordsize.h>
-#include <bp-checks.h>
int
__new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
{
- return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, CHECK_1 (buf));
+ return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, buf);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c
index 77c0115c4..ad3860dfc 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c
@@ -32,7 +32,7 @@
: INLINE_SYSCALL1(name, nr, args))
struct kernel_sigaction;
-extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded,
- struct kernel_sigaction *__unbounded, size_t);
+extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
+ struct kernel_sigaction *, size_t);
#include <sysdeps/unix/sysv/linux/sigaction.c>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/am33/brk.c b/libc/ports/sysdeps/unix/sysv/linux/am33/brk.c
index 51b59adc9..8fd2ff01d 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/am33/brk.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/am33/brk.c
@@ -30,7 +30,7 @@ __brk (void *addr)
{
void *newbrk;
- newbrk = INLINE_SYSCALL (brk, 1, __ptrvalue (addr));
+ newbrk = INLINE_SYSCALL (brk, 1, addr);
__curbrk = newbrk;
diff --git a/libc/ports/sysdeps/unix/sysv/linux/am33/clone.S b/libc/ports/sysdeps/unix/sysv/linux/am33/clone.S
index 151950c5d..cece99bf3 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/am33/clone.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/am33/clone.S
@@ -24,12 +24,11 @@
#define _ERRNO_H 1
#include <bits/errno.h>
#include <asm-syntax.h>
-#include <bp-sym.h>
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
.text
-ENTRY (BP_SYM (__clone))
+ENTRY (__clone)
/* Sanity check arguments. */
cmp 0,d0 /* no NULL function pointers */
beq L(error_inval)
@@ -75,6 +74,6 @@ L(here):
#endif
call JUMPTARGET (_exit),[],0
-PSEUDO_END (BP_SYM (__clone))
+PSEUDO_END (__clone)
-weak_alias (BP_SYM (__clone), BP_SYM (clone))
+weak_alias (__clone, clone)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile b/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile
index be7946e96..56ef15967 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile
@@ -10,7 +10,7 @@ shared-only-routines += libc-aeabi_read_tp
endif
ifeq ($(subdir),elf)
-sysdep-rtld-routines += aeabi_read_tp
+sysdep-rtld-routines += aeabi_read_tp libc-do-syscall
endif
ifeq ($(subdir),misc)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S b/libc/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
index bdcfa206e..29edec69d 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
@@ -15,6 +15,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* ??? Needs more rearrangement for the LDM to handle thumb mode. */
+#define NO_THUMB
#include <sysdep.h>
.section .rodata.str1.1,"aMS",%progbits,1
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/clone.S b/libc/ports/sysdeps/unix/sysv/linux/arm/clone.S
index de25db160..732a3ffd0 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/clone.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/clone.S
@@ -33,6 +33,7 @@
ENTRY(__clone)
@ sanity check args
cmp r0, #0
+ ite ne
cmpne r1, #0
moveq r0, #-EINVAL
beq PLTJMP(syscall_error)
@@ -78,8 +79,9 @@ PSEUDO_END (__clone)
sub pc, r0, #31
mov r1, r0
tst ip, #CLONE_VM
- movne r0, #-1
ldr r7, =SYS_ify(getpid)
+ ite ne
+ movne r0, #-1
swieq 0x0
str r0, [r1, #PID_OFFSET]
str r0, [r1, #TID_OFFSET]
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h b/libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
index acc4f2864..504fecab5 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
@@ -18,12 +18,17 @@
#include <ldconfig.h>
+/* In order to support the transition from unmarked objects
+ to marked objects we must treat unmarked objects as
+ compatible with either FLAG_ARM_LIBHF or FLAG_ARM_LIBSF. */
#ifdef __ARM_PCS_VFP
# define _dl_cache_check_flags(flags) \
- ((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6))
+ ((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6) \
+ || (flags) == FLAG_ELF_LIBC6)
#else
# define _dl_cache_check_flags(flags) \
- ((flags) == FLAG_ELF_LIBC6)
+ ((flags) == (FLAG_ARM_LIBSF | FLAG_ELF_LIBC6) \
+ || (flags) == FLAG_ELF_LIBC6)
#endif
#include_next <dl-cache.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S b/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S
index f7857c199..fa00c0b78 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S
@@ -103,7 +103,7 @@ ENTRY(__getcontext)
END(__getcontext)
#ifdef PIC
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_global_ro:
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
#else
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/mmap.S b/libc/ports/sysdeps/unix/sysv/linux/arm/mmap.S
index fa8a2b86c..68560b065 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/mmap.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/mmap.S
@@ -51,6 +51,7 @@ ENTRY (__mmap)
cfi_restore (r5)
cmn r0, $4096
+ it cc
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/mmap64.S b/libc/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
index 2eafd1b41..dcbab3aed 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
@@ -17,6 +17,8 @@
#include <sysdep.h>
+ .syntax unified
+
#define EINVAL 22
#ifdef __ARMEB__
@@ -42,7 +44,8 @@ ENTRY (__mmap64)
cfi_remember_state
movs r4, ip, lsl $20 @ check that offset is page-aligned
mov ip, ip, lsr $12
- moveqs r4, r5, lsr $12 @ check for overflow
+ it eq
+ movseq r4, r5, lsr $12 @ check for overflow
bne .Linval
ldr r4, [sp, $8] @ load fd
orr r5, ip, r5, lsl $20 @ compose page offset
@@ -52,6 +55,7 @@ ENTRY (__mmap64)
cfi_adjust_cfa_offset (-8)
cfi_restore (r4)
cfi_restore (r5)
+ it cc
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist
index ceab6b2cd..ce45208b5 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist
@@ -86,6 +86,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.4
GLIBC_2.4 A
_Exit F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
index 0278812f7..fe21cdaf2 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
@@ -36,6 +36,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -141,6 +143,32 @@
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ })
+
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
#define lll_trylock(lock) \
atomic_compare_and_exchange_val_acq(&(lock), 1, 0)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
index 1b0a2447f..df85d5199 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
@@ -30,161 +30,157 @@
# undef PSEUDO
# define PSEUDO(name, syscall_name, args) \
- .section ".text"; \
- PSEUDO_PROLOGUE; \
- .type __##syscall_name##_nocancel,%function; \
- .globl __##syscall_name##_nocancel; \
- __##syscall_name##_nocancel: \
- .cfi_sections .debug_frame; \
- cfi_startproc; \
- DO_CALL (syscall_name, args); \
- cmn r0, $4096; \
- PSEUDO_RET; \
- cfi_endproc; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
+ .text; \
+ PSEUDO_PROLOGUE; \
+ ENTRY (__##syscall_name##_nocancel); \
+ CFI_SECTIONS; \
+ DO_CALL (syscall_name, args); \
+ cmn r0, $4096; \
+ PSEUDO_RET; \
+ END (__##syscall_name##_nocancel); \
ENTRY (name); \
- SINGLE_THREAD_P; \
- DOARGS_##args; \
- bne .Lpseudo_cancel; \
- cfi_remember_state; \
- ldr r7, =SYS_ify (syscall_name); \
- swi 0x0; \
- UNDOARGS_##args; \
- cmn r0, $4096; \
- PSEUDO_RET; \
- cfi_restore_state; \
+ SINGLE_THREAD_P; \
+ DOARGS_##args; \
+ bne .Lpseudo_cancel; \
+ cfi_remember_state; \
+ ldr r7, =SYS_ify (syscall_name); \
+ swi 0x0; \
+ UNDOARGS_##args; \
+ cmn r0, $4096; \
+ PSEUDO_RET; \
+ cfi_restore_state; \
.Lpseudo_cancel: \
- .fnstart; /* matched by the .fnend in UNDOARGS below. */ \
- DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \
- CENABLE; \
- mov ip, r0; /* put mask in safe place. */ \
- UNDOCARGS_##args; /* restore syscall args. */ \
- ldr r7, =SYS_ify (syscall_name); \
- swi 0x0; /* do the call. */ \
- mov r7, r0; /* save syscall return value. */ \
- mov r0, ip; /* get mask back. */ \
- CDISABLE; \
- mov r0, r7; /* retrieve return value. */ \
- RESTORE_LR_##args; \
- UNDOARGS_##args; \
- cmn r0, $4096
+ .fnstart; /* matched by the .fnend in UNDOARGS below. */ \
+ DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \
+ CENABLE; \
+ mov ip, r0; /* put mask in safe place. */ \
+ UNDOCARGS_##args; /* restore syscall args. */ \
+ ldr r7, =SYS_ify (syscall_name); \
+ swi 0x0; /* do the call. */ \
+ mov r7, r0; /* save syscall return value. */ \
+ mov r0, ip; /* get mask back. */ \
+ CDISABLE; \
+ mov r0, r7; /* retrieve return value. */ \
+ RESTORE_LR_##args; \
+ UNDOARGS_##args; \
+ cmn r0, $4096
/* DOARGS pushes eight bytes on the stack for five arguments, twelve bytes for
six arguments, and four bytes for fewer. In order to preserve doubleword
alignment, sometimes we must save an extra register. */
-# define RESTART_UNWIND \
- .fnend; \
- .fnstart; \
- .save {r7}; \
- .save {lr}
-
-# define DOCARGS_0 \
- .save {r7}; \
- str lr, [sp, #-4]!; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (lr, 0); \
- .save {lr}
+# define RESTART_UNWIND \
+ .fnend; \
+ .fnstart; \
+ .save {r7}; \
+ .save {lr}
+
+# define DOCARGS_0 \
+ .save {r7}; \
+ str lr, [sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
+ .save {lr}
# define UNDOCARGS_0
-# define RESTORE_LR_0 \
- ldr lr, [sp], #4; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (lr)
-
-# define DOCARGS_1 \
- .save {r7}; \
- stmfd sp!, {r0, r1, lr}; \
- cfi_adjust_cfa_offset (12); \
- cfi_rel_offset (lr, 8); \
- .save {lr}; \
- .pad #8
-# define UNDOCARGS_1 \
- ldr r0, [sp], #8; \
- cfi_adjust_cfa_offset (-8); \
- RESTART_UNWIND
-# define RESTORE_LR_1 \
- RESTORE_LR_0
-
-# define DOCARGS_2 \
- .save {r7}; \
- stmfd sp!, {r0, r1, lr}; \
- cfi_adjust_cfa_offset (12); \
- cfi_rel_offset (lr, 8); \
- .save {lr}; \
- .pad #8
-# define UNDOCARGS_2 \
- ldmfd sp!, {r0, r1}; \
- cfi_adjust_cfa_offset (-8); \
- RESTART_UNWIND
-# define RESTORE_LR_2 \
- RESTORE_LR_0
-
-# define DOCARGS_3 \
- .save {r7}; \
- stmfd sp!, {r0, r1, r2, r3, lr}; \
- cfi_adjust_cfa_offset (20); \
- cfi_rel_offset (lr, 16); \
- .save {lr}; \
- .pad #16
-# define UNDOCARGS_3 \
- ldmfd sp!, {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- RESTART_UNWIND
-# define RESTORE_LR_3 \
- RESTORE_LR_0
-
-# define DOCARGS_4 \
- .save {r7}; \
- stmfd sp!, {r0, r1, r2, r3, lr}; \
- cfi_adjust_cfa_offset (20); \
- cfi_rel_offset (lr, 16); \
- .save {lr}; \
- .pad #16
-# define UNDOCARGS_4 \
- ldmfd sp!, {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- RESTART_UNWIND
-# define RESTORE_LR_4 \
- RESTORE_LR_0
+# define RESTORE_LR_0 \
+ ldr lr, [sp], #4; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr)
+
+# define DOCARGS_1 \
+ .save {r7}; \
+ stmfd sp!, {r0, r1, lr}; \
+ cfi_adjust_cfa_offset (12); \
+ cfi_rel_offset (lr, 8); \
+ .save {lr}; \
+ .pad #8
+# define UNDOCARGS_1 \
+ ldr r0, [sp], #8; \
+ cfi_adjust_cfa_offset (-8); \
+ RESTART_UNWIND
+# define RESTORE_LR_1 \
+ RESTORE_LR_0
+
+# define DOCARGS_2 \
+ .save {r7}; \
+ stmfd sp!, {r0, r1, lr}; \
+ cfi_adjust_cfa_offset (12); \
+ cfi_rel_offset (lr, 8); \
+ .save {lr}; \
+ .pad #8
+# define UNDOCARGS_2 \
+ ldmfd sp!, {r0, r1}; \
+ cfi_adjust_cfa_offset (-8); \
+ RESTART_UNWIND
+# define RESTORE_LR_2 \
+ RESTORE_LR_0
+
+# define DOCARGS_3 \
+ .save {r7}; \
+ stmfd sp!, {r0, r1, r2, r3, lr}; \
+ cfi_adjust_cfa_offset (20); \
+ cfi_rel_offset (lr, 16); \
+ .save {lr}; \
+ .pad #16
+# define UNDOCARGS_3 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ RESTART_UNWIND
+# define RESTORE_LR_3 \
+ RESTORE_LR_0
+
+# define DOCARGS_4 \
+ .save {r7}; \
+ stmfd sp!, {r0, r1, r2, r3, lr}; \
+ cfi_adjust_cfa_offset (20); \
+ cfi_rel_offset (lr, 16); \
+ .save {lr}; \
+ .pad #16
+# define UNDOCARGS_4 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ RESTART_UNWIND
+# define RESTORE_LR_4 \
+ RESTORE_LR_0
/* r4 is only stmfd'ed for correct stack alignment. */
-# define DOCARGS_5 \
- .save {r4, r7}; \
- stmfd sp!, {r0, r1, r2, r3, r4, lr}; \
- cfi_adjust_cfa_offset (24); \
- cfi_rel_offset (lr, 20); \
- .save {lr}; \
- .pad #20
-# define UNDOCARGS_5 \
- ldmfd sp!, {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- .fnend; \
- .fnstart; \
- .save {r4, r7}; \
- .save {lr}; \
- .pad #4
-# define RESTORE_LR_5 \
- ldmfd sp!, {r4, lr}; \
- cfi_adjust_cfa_offset (-8); \
- /* r4 will be marked as restored later. */ \
- cfi_restore (lr)
-
-# define DOCARGS_6 \
- .save {r4, r5, r7}; \
- stmfd sp!, {r0, r1, r2, r3, lr}; \
- cfi_adjust_cfa_offset (20); \
- cfi_rel_offset (lr, 16); \
- .save {lr}; \
- .pad #16
-# define UNDOCARGS_6 \
- ldmfd sp!, {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- .fnend; \
- .fnstart; \
- .save {r4, r5, r7}; \
- .save {lr};
-# define RESTORE_LR_6 \
- RESTORE_LR_0
+# define DOCARGS_5 \
+ .save {r4, r7}; \
+ stmfd sp!, {r0, r1, r2, r3, r4, lr}; \
+ cfi_adjust_cfa_offset (24); \
+ cfi_rel_offset (lr, 20); \
+ .save {lr}; \
+ .pad #20
+# define UNDOCARGS_5 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ .fnend; \
+ .fnstart; \
+ .save {r4, r7}; \
+ .save {lr}; \
+ .pad #4
+# define RESTORE_LR_5 \
+ ldmfd sp!, {r4, lr}; \
+ cfi_adjust_cfa_offset (-8); \
+ /* r4 will be marked as restored later. */ \
+ cfi_restore (lr)
+
+# define DOCARGS_6 \
+ .save {r4, r5, r7}; \
+ stmfd sp!, {r0, r1, r2, r3, lr}; \
+ cfi_adjust_cfa_offset (20); \
+ cfi_rel_offset (lr, 16); \
+ .save {lr}; \
+ .pad #16
+# define UNDOCARGS_6 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ .fnend; \
+ .fnstart; \
+ .save {r4, r5, r7}; \
+ .save {lr};
+# define RESTORE_LR_6 \
+ RESTORE_LR_0
# ifdef IS_IN_libpthread
# define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
@@ -207,12 +203,12 @@ extern int __local_multiple_threads attribute_hidden;
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
# else
# define SINGLE_THREAD_P \
- ldr ip, 1b; \
-2: \
- ldr ip, [pc, ip]; \
- teq ip, #0;
+ ldr ip, 1b; \
+ 2: \
+ ldr ip, [pc, ip]; \
+ teq ip, #0;
# define PSEUDO_PROLOGUE \
- 1: .word __local_multiple_threads - 2f - 8;
+ 1: .word __local_multiple_threads - 2f - PC_OFS;
# endif
# else
/* There is no __local_multiple_threads for librt, so use the TCB. */
@@ -223,15 +219,15 @@ extern int __local_multiple_threads attribute_hidden;
# else
# define PSEUDO_PROLOGUE
# define SINGLE_THREAD_P \
- stmfd sp!, {r0, lr}; \
- cfi_adjust_cfa_offset (8); \
- cfi_rel_offset (lr, 4); \
- bl __aeabi_read_tp; \
- ldr ip, [r0, #MULTIPLE_THREADS_OFFSET]; \
- ldmfd sp!, {r0, lr}; \
- cfi_adjust_cfa_offset (-8); \
- cfi_restore (lr); \
- teq ip, #0
+ stmfd sp!, {r0, lr}; \
+ cfi_adjust_cfa_offset (8); \
+ cfi_rel_offset (lr, 4); \
+ bl __aeabi_read_tp; \
+ ldr ip, [r0, #MULTIPLE_THREADS_OFFSET]; \
+ ldmfd sp!, {r0, lr}; \
+ cfi_adjust_cfa_offset (-8); \
+ cfi_restore (lr); \
+ teq ip, #0
# define SINGLE_THREAD_P_PIC(x) SINGLE_THREAD_P
# endif
# endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
index 58ca9acf6..caa6a2626 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
@@ -84,6 +84,9 @@ __unwind_freeres (void)
ARM unwinder relies on register state at entrance. So we write this in
assembly. */
+#define STR1(S) #S
+#define STR(S) STR1(S)
+
asm (
" .globl _Unwind_Resume\n"
" .type _Unwind_Resume, %function\n"
@@ -118,11 +121,7 @@ asm (
" b 5b\n"
" " CFI_ENDPROC "\n"
" .align 2\n"
-#ifdef __thumb2__
-"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 4\n"
-#else
-"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 8\n"
-#endif
+"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - " STR (PC_OFS) "\n"
"2: .word libgcc_s_resume(GOTOFF)\n"
" .size _Unwind_Resume, .-_Unwind_Resume\n"
);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
index 0a3ad953b..121159913 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
@@ -47,6 +47,9 @@ init (void)
ARM unwinder relies on register state at entrance. So we write this in
assembly. */
+#define STR1(S) #S
+#define STR(S) STR1(S)
+
asm (
" .globl _Unwind_Resume\n"
" .type _Unwind_Resume, %function\n"
@@ -81,11 +84,7 @@ asm (
" b 5b\n"
" " CFI_ENDPROC "\n"
" .align 2\n"
-#ifdef __thumb2__
-"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 4\n"
-#else
-"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 8\n"
-#endif
+"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - " STR (PC_OFS) "\n"
"2: .word libgcc_s_resume(GOTOFF)\n"
" .size _Unwind_Resume, .-_Unwind_Resume\n"
);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/pread.c b/libc/ports/sysdeps/unix/sysv/linux/arm/pread.c
index dafee3d55..e178402a8 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/pread.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/pread.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
ssize_t
__libc_pread (fd, buf, count, offset)
@@ -37,7 +36,7 @@ __libc_pread (fd, buf, count, offset)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
return result;
@@ -47,7 +46,7 @@ __libc_pread (fd, buf, count, offset)
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/pread64.c b/libc/ports/sysdeps/unix/sysv/linux/arm/pread64.c
index 6d1d9148a..c7863a35c 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/pread64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/pread64.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
ssize_t
__libc_pread64 (fd, buf, count, offset)
@@ -37,7 +36,7 @@ __libc_pread64 (fd, buf, count, offset)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
@@ -48,7 +47,7 @@ __libc_pread64 (fd, buf, count, offset)
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite.c b/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite.c
index f188950af..4ae2e8330 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
ssize_t
__libc_pwrite (fd, buf, count, offset)
@@ -37,7 +36,7 @@ __libc_pwrite (fd, buf, count, offset)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
return result;
@@ -47,7 +46,7 @@ __libc_pwrite (fd, buf, count, offset)
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c b/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c
index 29c63ee33..bd6fca583 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
ssize_t
__libc_pwrite64 (fd, buf, count, offset)
@@ -37,7 +36,7 @@ __libc_pwrite64 (fd, buf, count, offset)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
@@ -48,7 +47,7 @@ __libc_pwrite64 (fd, buf, count, offset)
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c b/libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
index 81e5ccb55..3efb6134c 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
@@ -46,6 +46,12 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD)
*flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6;
else if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_SOFT)
+ *flag = FLAG_ARM_LIBSF|FLAG_ELF_LIBC6;
+ else
+ /* We must assume the unmarked objects are compatible
+ with all ABI variants. Such objects may have been
+ generated in a transitional period when the ABI
+ tags were not added to all objects. */
*flag = FLAG_ELF_LIBC6;
}
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S b/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S
index 8e71f5b4e..b3148c894 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S
@@ -15,6 +15,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* ??? Needs more rearrangement for the LDM to handle thumb mode. */
+#define NO_THUMB
#include <sysdep.h>
#include <rtld-global-offsets.h>
@@ -93,7 +95,7 @@ ENTRY(__startcontext)
END(__startcontext)
#ifdef PIC
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_global_ro:
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
#else
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/sigaction.c b/libc/ports/sysdeps/unix/sysv/linux/arm/sigaction.c
index c039b857f..21bf506ef 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/sigaction.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/sigaction.c
@@ -83,8 +83,8 @@ __libc_sigaction (sig, act, oact)
/* 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);
+ act ? &kact : NULL,
+ oact ? &koact : NULL, _NSIG / 8);
if (oact && result >= 0)
{
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/syscall.S b/libc/ports/sysdeps/unix/sysv/linux/arm/syscall.S
index c6dd57d69..665ecb4de 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/syscall.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/syscall.S
@@ -42,6 +42,7 @@ ENTRY (syscall)
cfi_restore (r6)
cfi_restore (r7)
cmn r0, #4096
+ it cc
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
PSEUDO_END (syscall)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
index 6b5bb14c9..f40cb95e8 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -57,49 +57,50 @@
test with -4095. */
#undef PSEUDO
-#define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY (name); \
- DO_CALL (syscall_name, args); \
- cmn r0, $4096;
-
-#define PSEUDO_RET \
- RETINSTR(cc, lr); \
- b PLTJMP(SYSCALL_ERROR)
+#define PSEUDO(name, syscall_name, args) \
+ .text; \
+ ENTRY (name); \
+ DO_CALL (syscall_name, args); \
+ cmn r0, $4096;
+
+#define PSEUDO_RET \
+ it cc; \
+ RETINSTR(cc, lr); \
+ b PLTJMP(SYSCALL_ERROR)
#undef ret
#define ret PSEUDO_RET
#undef PSEUDO_END
-#define PSEUDO_END(name) \
- SYSCALL_ERROR_HANDLER; \
+#define PSEUDO_END(name) \
+ SYSCALL_ERROR_HANDLER; \
END (name)
#undef PSEUDO_NOERRNO
-#define PSEUDO_NOERRNO(name, syscall_name, args) \
- .text; \
- ENTRY (name); \
- DO_CALL (syscall_name, args);
+#define PSEUDO_NOERRNO(name, syscall_name, args) \
+ .text; \
+ ENTRY (name); \
+ DO_CALL (syscall_name, args);
-#define PSEUDO_RET_NOERRNO \
- DO_RET (lr);
+#define PSEUDO_RET_NOERRNO \
+ DO_RET (lr);
#undef ret_NOERRNO
#define ret_NOERRNO PSEUDO_RET_NOERRNO
#undef PSEUDO_END_NOERRNO
-#define PSEUDO_END_NOERRNO(name) \
+#define PSEUDO_END_NOERRNO(name) \
END (name)
/* The function has to return the error code. */
#undef PSEUDO_ERRVAL
-#define PSEUDO_ERRVAL(name, syscall_name, args) \
- .text; \
- ENTRY (name) \
- DO_CALL (syscall_name, args); \
- rsb r0, r0, #0
+#define PSEUDO_ERRVAL(name, syscall_name, args) \
+ .text; \
+ ENTRY (name) \
+ DO_CALL (syscall_name, args); \
+ rsb r0, r0, #0
#undef PSEUDO_END_ERRVAL
-#define PSEUDO_END_ERRVAL(name) \
+#define PSEUDO_END_ERRVAL(name) \
END (name)
#define ret_ERRVAL PSEUDO_RET_NOERRNO
@@ -114,7 +115,7 @@ __local_syscall_error: \
0: str r0, [pc, r1]; \
mvn r0, #0; \
DO_RET(lr); \
-1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8;
+1: .word C_SYMBOL_NAME(rtld_errno) - 0b - PC_OFS;
# else
# if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
# define POP_PC \
@@ -192,19 +193,19 @@ __local_syscall_error: \
syscalls. */
#undef DO_CALL
-#define DO_CALL(syscall_name, args) \
- DOARGS_##args; \
- ldr r7, =SYS_ify (syscall_name); \
- swi 0x0; \
- UNDOARGS_##args
+#define DO_CALL(syscall_name, args) \
+ DOARGS_##args; \
+ ldr r7, =SYS_ify (syscall_name); \
+ swi 0x0; \
+ UNDOARGS_##args
#undef DOARGS_0
-#define DOARGS_0 \
- .fnstart; \
- str r7, [sp, #-4]!; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (r7, 0); \
- .save { r7 }
+#define DOARGS_0 \
+ .fnstart; \
+ str r7, [sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (r7, 0); \
+ .save { r7 }
#undef DOARGS_1
#define DOARGS_1 DOARGS_0
#undef DOARGS_2
@@ -214,44 +215,44 @@ __local_syscall_error: \
#undef DOARGS_4
#define DOARGS_4 DOARGS_0
#undef DOARGS_5
-#define DOARGS_5 \
- .fnstart; \
- stmfd sp!, {r4, r7}; \
- cfi_adjust_cfa_offset (8); \
- cfi_rel_offset (r4, 0); \
- cfi_rel_offset (r7, 4); \
- .save { r4, r7 }; \
- ldr r4, [sp, #8]
+#define DOARGS_5 \
+ .fnstart; \
+ stmfd sp!, {r4, r7}; \
+ cfi_adjust_cfa_offset (8); \
+ cfi_rel_offset (r4, 0); \
+ cfi_rel_offset (r7, 4); \
+ .save { r4, r7 }; \
+ ldr r4, [sp, #8]
#undef DOARGS_6
-#define DOARGS_6 \
- .fnstart; \
- mov ip, sp; \
- stmfd sp!, {r4, r5, r7}; \
- cfi_adjust_cfa_offset (12); \
- cfi_rel_offset (r4, 0); \
- cfi_rel_offset (r5, 4); \
- cfi_rel_offset (r7, 8); \
- .save { r4, r5, r7 }; \
- ldmia ip, {r4, r5}
+#define DOARGS_6 \
+ .fnstart; \
+ mov ip, sp; \
+ stmfd sp!, {r4, r5, r7}; \
+ cfi_adjust_cfa_offset (12); \
+ cfi_rel_offset (r4, 0); \
+ cfi_rel_offset (r5, 4); \
+ cfi_rel_offset (r7, 8); \
+ .save { r4, r5, r7 }; \
+ ldmia ip, {r4, r5}
#undef DOARGS_7
-#define DOARGS_7 \
- .fnstart; \
- mov ip, sp; \
- stmfd sp!, {r4, r5, r6, r7}; \
- cfi_adjust_cfa_offset (16); \
- cfi_rel_offset (r4, 0); \
- cfi_rel_offset (r5, 4); \
- cfi_rel_offset (r6, 8); \
- cfi_rel_offset (r7, 12); \
- .save { r4, r5, r6, r7 }; \
- ldmia ip, {r4, r5, r6}
+#define DOARGS_7 \
+ .fnstart; \
+ mov ip, sp; \
+ stmfd sp!, {r4, r5, r6, r7}; \
+ cfi_adjust_cfa_offset (16); \
+ cfi_rel_offset (r4, 0); \
+ cfi_rel_offset (r5, 4); \
+ cfi_rel_offset (r6, 8); \
+ cfi_rel_offset (r7, 12); \
+ .save { r4, r5, r6, r7 }; \
+ ldmia ip, {r4, r5, r6}
#undef UNDOARGS_0
-#define UNDOARGS_0 \
- ldr r7, [sp], #4; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (r7); \
- .fnend
+#define UNDOARGS_0 \
+ ldr r7, [sp], #4; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (r7); \
+ .fnend
#undef UNDOARGS_1
#define UNDOARGS_1 UNDOARGS_0
#undef UNDOARGS_2
@@ -261,29 +262,29 @@ __local_syscall_error: \
#undef UNDOARGS_4
#define UNDOARGS_4 UNDOARGS_0
#undef UNDOARGS_5
-#define UNDOARGS_5 \
- ldmfd sp!, {r4, r7}; \
- cfi_adjust_cfa_offset (-8); \
- cfi_restore (r4); \
- cfi_restore (r7); \
- .fnend
+#define UNDOARGS_5 \
+ ldmfd sp!, {r4, r7}; \
+ cfi_adjust_cfa_offset (-8); \
+ cfi_restore (r4); \
+ cfi_restore (r7); \
+ .fnend
#undef UNDOARGS_6
-#define UNDOARGS_6 \
- ldmfd sp!, {r4, r5, r7}; \
- cfi_adjust_cfa_offset (-12); \
- cfi_restore (r4); \
- cfi_restore (r5); \
- cfi_restore (r7); \
- .fnend
+#define UNDOARGS_6 \
+ ldmfd sp!, {r4, r5, r7}; \
+ cfi_adjust_cfa_offset (-12); \
+ cfi_restore (r4); \
+ cfi_restore (r5); \
+ cfi_restore (r7); \
+ .fnend
#undef UNDOARGS_7
-#define UNDOARGS_7 \
- ldmfd sp!, {r4, r5, r6, r7}; \
- cfi_adjust_cfa_offset (-16); \
- cfi_restore (r4); \
- cfi_restore (r5); \
- cfi_restore (r6); \
- cfi_restore (r7); \
- .fnend
+#define UNDOARGS_7 \
+ ldmfd sp!, {r4, r5, r6, r7}; \
+ cfi_adjust_cfa_offset (-16); \
+ cfi_restore (r4); \
+ cfi_restore (r5); \
+ cfi_restore (r6); \
+ cfi_restore (r7); \
+ .fnend
#else /* not __ASSEMBLER__ */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/truncate64.c b/libc/ports/sysdeps/unix/sysv/linux/arm/truncate64.c
index 4367d1efe..6e52e3263 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/truncate64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/truncate64.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Truncate the file FD refers to to LENGTH bytes. */
int
@@ -30,7 +29,7 @@ truncate64 (const char *path, off64_t length)
{
unsigned int low = length & 0xffffffff;
unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (truncate64, 4, CHECK_STRING (path), 0,
+ int result = INLINE_SYSCALL (truncate64, 4, path, 0,
__LONG_LONG_PAIR (high, low));
return result;
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/vfork.S b/libc/ports/sysdeps/unix/sysv/linux/arm/vfork.S
index 4f84c57f2..ae931f79c 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/vfork.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/vfork.S
@@ -51,6 +51,7 @@ ENTRY (__vfork)
RESTORE_PID
#endif
cmn a1, #4096
+ it cc
RETINSTR(cc, lr)
b PLTJMP(SYSCALL_ERROR)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
index 618edf7bc..af63e1b9a 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
@@ -87,17 +87,6 @@ __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *abstime, int pri
/* These don't get included in libc.so */
#ifdef IS_IN_libpthread
int
-lll_unlock_wake_cb (lll_lock_t *futex)
-{
- int val = atomic_exchange_rel (futex, 0);
-
- if (__builtin_expect (val > 1, 0))
- lll_private_futex_wake (futex, 1);
- return 0;
-}
-
-
-int
__lll_timedwait_tid (int *tidp, const struct timespec *abstime)
{
int tid;
@@ -134,6 +123,5 @@ __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
return 0;
}
-
#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
index f37a7bbd7..b88703fba 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
@@ -317,8 +317,6 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime,
#define THREAD_INIT_LOCK(PD, LOCK) \
(PD)->LOCK = LLL_LOCK_INITIALIZER
-extern int lll_unlock_wake_cb (lll_lock_t *__futex) attribute_hidden;
-
/* The kernel notifies a process which uses CLONE_CHILD_CLEARTID via futex
wakeup when the clone terminates. The memory location contains the
thread ID while the clone is running and is reset to zero
diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist
index b3510fe2a..067552d17 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist
@@ -86,6 +86,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c
index b41c6c3a7..664d0e12b 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c
@@ -26,7 +26,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* The variable is shared between all wrappers around signal handling
functions which have RT equivalents. This is the definition. */
@@ -42,8 +41,7 @@ __libc_sigaction (sig, act, oact)
{
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigaction, 4, sig,
- CHECK_1_NULL_OK (act), CHECK_1_NULL_OK (oact), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigaction, 4, sig, act, oact, _NSIG / 8);
}
libc_hidden_def (__libc_sigaction)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c
index 9aac2b75c..42fce5022 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c
@@ -24,7 +24,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Change the set of blocked signals to SET,
wait until a signal arrives, and restore the set of blocked signals. */
@@ -34,5 +33,5 @@ sigpending (set)
{
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
index f074abc8a..53b85800b 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
@@ -26,7 +26,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Get and/or change the set of blocked signals. */
int
@@ -38,7 +37,6 @@ __sigprocmask (how, set, oset)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET (set),
- CHECK_SIGSET_NULL_OK (oset), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
}
weak_alias (__sigprocmask, sigprocmask)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/umount.c b/libc/ports/sysdeps/unix/sysv/linux/ia64/umount.c
index a15a71686..a3df7863f 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/ia64/umount.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/umount.c
@@ -20,11 +20,10 @@
#include <errno.h>
#include <sysdep.h>
-#include <bp-checks.h>
/* Unmount a filesystem. */
int
umount (const char *special_file)
{
- return INLINE_SYSCALL (umount, 2, CHECK_STRING (special_file), 0);
+ return INLINE_SYSCALL (umount, 2, special_file, 0);
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist
index 3c40379aa..f06cc8ef8 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist
@@ -87,6 +87,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.4
GLIBC_2.4 A
_Exit F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index bf8ace7a1..31a8c3c8c 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -20,6 +20,26 @@
/* Many syscalls were added in 2.6.10 for m68k. */
#define __ASSUME_UTIMES 1
+/* Support for various CLOEXEC and NONBLOCK flags was added 2.6.23. */
+#if __LINUX_KERNEL_VERSION >= 0x020617
+# define __ASSUME_O_CLOEXEC 1
+#endif
+
+/* Support for various CLOEXEC and NONBLOCK flags was added in 2.6.27. */
+#if __LINUX_KERNEL_VERSION >= 0x02061b
+# define __ASSUME_SOCK_CLOEXEC 1
+# define __ASSUME_IN_NONBLOCK 1
+# define __ASSUME_PIPE2 1
+# define __ASSUME_EVENTFD2 1
+# define __ASSUME_SIGNALFD4 1
+# define __ASSUME_DUP3 1
+#endif
+
+/* Support for the accept4 syscall was added in 2.6.28. */
+#if __LINUX_KERNEL_VERSION >= 0x02061c
+# define __ASSUME_ACCEPT4 1
+#endif
+
#include_next <kernel-features.h>
/* These syscalls were added only in 3.0 for m68k. */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist
index f998b1b27..9010ea733 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist
@@ -1775,6 +1775,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h
new file mode 100644
index 000000000..e6a0d135c
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h
@@ -0,0 +1 @@
+#include <nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list b/libc/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list
index 1e27d8de7..aee1011a6 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list
@@ -1,6 +1,7 @@
# File name Caller Syscall name Args Strong name Weak names
chown - chown32 i:sii __chown chown
+waitpid - waitpid Ci:ipi __waitpid waitpid __libc_waitpid
cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush
prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/brk.c b/libc/ports/sysdeps/unix/sysv/linux/mips/brk.c
index 9bd6d94bd..07c8a9649 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/brk.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/brk.c
@@ -30,19 +30,10 @@ weak_alias (__curbrk, ___brk_addr)
int
__brk (void *addr)
{
+ INTERNAL_SYSCALL_DECL (err);
void *newbrk;
- {
- register long int res __asm__ ("$2");
-
- asm ("move\t$4,%2\n\t"
- "li\t%0,%1\n\t"
- "syscall" /* Perform the system call. */
- : "=r" (res)
- : "I" (SYS_ify (brk)), "r" (addr)
- : "$4", "$7", __SYSCALL_CLOBBERS);
- newbrk = (void *) res;
- }
+ newbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr);
__curbrk = newbrk;
if (newbrk < addr)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/clone.S b/libc/ports/sysdeps/unix/sysv/linux/mips/clone.S
index 72360f962..f6f2f0565 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/clone.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/clone.S
@@ -34,6 +34,7 @@
void *parent_tidptr, void *tls, void *child_tidptr) */
.text
+ .set nomips16
#if _MIPS_SIM == _ABIO32
# define EXTRA_LOCALS 1
#else
@@ -47,7 +48,8 @@ NESTED(__clone,4*SZREG,sp)
SETUP_GP
#endif
PTR_SUBU sp, FRAMESZ
- SETUP_GP64 (GPOFF, __clone)
+ cfi_adjust_cfa_offset (FRAMESZ)
+ SETUP_GP64_STACK (GPOFF, __clone)
#ifdef __PIC__
SAVE_GP (GPOFF)
#endif
@@ -88,26 +90,35 @@ NESTED(__clone,4*SZREG,sp)
/* Do the system call */
li v0,__NR_clone
+ cfi_endproc
syscall
bnez a3,L(error)
beqz v0,L(thread_start)
/* Successful return from the parent */
- RESTORE_GP64
+ cfi_startproc
+ cfi_adjust_cfa_offset (FRAMESZ)
+ SETUP_GP64_STACK_CFI (GPOFF)
+ cfi_remember_state
+ RESTORE_GP64_STACK
PTR_ADDU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
ret
/* Something bad happened -- no child created */
L(error):
+ cfi_restore_state
#ifdef __PIC__
PTR_LA t9,__syscall_error
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
jr t9
#else
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
j __syscall_error
#endif
END(__clone)
@@ -118,6 +129,7 @@ L(error):
ENTRY(__thread_start)
L(thread_start):
+ cfi_undefined ($31)
/* cp is already loaded. */
SAVE_GP (GPOFF)
/* The stackframe has been created on entry of clone(). */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/getcontext.S b/libc/ports/sysdeps/unix/sysv/linux/mips/getcontext.S
index 0e3d35b54..268098c0b 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/getcontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/getcontext.S
@@ -27,6 +27,7 @@
/* int getcontext (ucontext_t *ucp) */
.text
+ .set nomips16
LOCALSZ = 0
MASK = 0x00000000
#ifdef __PIC__
@@ -54,7 +55,8 @@ NESTED (__getcontext, FRAMESZ, ra)
# endif
PTR_ADDIU sp, -FRAMESZ
- SETUP_GP64 (GPOFF, __getcontext)
+ cfi_adjust_cfa_offset (FRAMESZ)
+ SETUP_GP64_STACK (GPOFF, __getcontext)
SAVE_GP (GPOFF)
#else /* ! __PIC__ */
@@ -124,19 +126,23 @@ NESTED (__getcontext, FRAMESZ, ra)
li v0, SYS_ify (rt_sigprocmask)
syscall
bnez a3, 99f
+ cfi_remember_state
#ifdef __PIC__
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDIU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
#endif
move v0, zero
jr ra
99:
+ cfi_restore_state
#ifdef __PIC__
PTR_LA t9, JUMPTARGET (__syscall_error)
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDIU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
jr t9
#else /* ! __PIC__ */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/makecontext.S b/libc/ports/sysdeps/unix/sysv/linux/mips/makecontext.S
index 65f1a6aaa..a8bbebbcc 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/makecontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/makecontext.S
@@ -27,6 +27,7 @@
/* int makecontext (ucontext_t *ucp, (void *func) (), int argc, ...) */
.text
+ .set nomips16
LOCALSZ = 0
ARGSZ = 0
MASK = 0x00000000
@@ -63,9 +64,10 @@ NESTED (__makecontext, FRAMESZ, ra)
#endif
PTR_ADDIU sp, -FRAMESZ
+ cfi_adjust_cfa_offset (FRAMESZ)
#ifdef __PIC__
- SETUP_GP64 (GPOFF, __makecontext)
+ SETUP_GP64_STACK (GPOFF, __makecontext)
SAVE_GP (GPOFF)
#endif
@@ -145,8 +147,9 @@ NESTED (__makecontext, FRAMESZ, ra)
REG_S a1, MCONTEXT_PC(a0)
#ifdef __PIC__
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDIU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
#endif
jr ra
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile
new file mode 100644
index 000000000..fa9fcb7e6
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile
@@ -0,0 +1,13 @@
+ifeq ($(subdir),misc)
+sysdep_routines += mips16-syscall0 mips16-syscall1 mips16-syscall2
+sysdep_routines += mips16-syscall3 mips16-syscall4 mips16-syscall5
+sysdep_routines += mips16-syscall6 mips16-syscall7
+CFLAGS-mips16-syscall0.c += -fexceptions
+CFLAGS-mips16-syscall1.c += -fexceptions
+CFLAGS-mips16-syscall2.c += -fexceptions
+CFLAGS-mips16-syscall3.c += -fexceptions
+CFLAGS-mips16-syscall4.c += -fexceptions
+CFLAGS-mips16-syscall5.c += -fexceptions
+CFLAGS-mips16-syscall6.c += -fexceptions
+CFLAGS-mips16-syscall7.c += -fexceptions
+endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions
new file mode 100644
index 000000000..73bcfb566
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions
@@ -0,0 +1,6 @@
+libc {
+ GLIBC_PRIVATE {
+ __mips16_syscall0; __mips16_syscall1; __mips16_syscall2; __mips16_syscall3;
+ __mips16_syscall4; __mips16_syscall5; __mips16_syscall6; __mips16_syscall7;
+ }
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h
new file mode 100644
index 000000000..8449836d3
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h
@@ -0,0 +1,89 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 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 MIPS16_SYSCALL_H
+#define MIPS16_SYSCALL_H 1
+
+#define __nomips16 __attribute__ ((nomips16))
+
+union __mips16_syscall_return
+ {
+ long long val;
+ struct
+ {
+ long v0;
+ long v1;
+ }
+ reg;
+ };
+
+long long __nomips16 __mips16_syscall0 (long number);
+#define __mips16_syscall0(dummy, number) \
+ __mips16_syscall0 ((long) (number))
+
+long long __nomips16 __mips16_syscall1 (long a0,
+ long number);
+#define __mips16_syscall1(a0, number) \
+ __mips16_syscall1 ((long) (a0), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall2 (long a0, long a1,
+ long number);
+#define __mips16_syscall2(a0, a1, number) \
+ __mips16_syscall2 ((long) (a0), (long) (a1), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall3 (long a0, long a1, long a2,
+ long number);
+#define __mips16_syscall3(a0, a1, a2, number) \
+ __mips16_syscall3 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall4 (long a0, long a1, long a2, long a3,
+ long number);
+#define __mips16_syscall4(a0, a1, a2, a3, number) \
+ __mips16_syscall4 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (a3), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall5 (long a0, long a1, long a2, long a3,
+ long a4,
+ long number);
+#define __mips16_syscall5(a0, a1, a2, a3, a4, number) \
+ __mips16_syscall5 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (a3), (long) (a4), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall6 (long a0, long a1, long a2, long a3,
+ long a4, long a5,
+ long number);
+#define __mips16_syscall6(a0, a1, a2, a3, a4, a5, number) \
+ __mips16_syscall6 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (a3), (long) (a4), (long) (a5), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall7 (long a0, long a1, long a2, long a3,
+ long a4, long a5, long a6,
+ long number);
+#define __mips16_syscall7(a0, a1, a2, a3, a4, a5, a6, number) \
+ __mips16_syscall7 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (a3), (long) (a4), (long) (a5), \
+ (long) (a6), \
+ (long) (number))
+
+#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c
new file mode 100644
index 000000000..0cdf94c22
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c
@@ -0,0 +1,30 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 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>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall0
+
+long long __nomips16
+__mips16_syscall0 (long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 0);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c
new file mode 100644
index 000000000..5e60a59d5
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c
@@ -0,0 +1,32 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 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>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall1
+
+long long __nomips16
+__mips16_syscall1 (long a0,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 1,
+ a0);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c
new file mode 100644
index 000000000..7750c519c
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c
@@ -0,0 +1,32 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 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>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall2
+
+long long __nomips16
+__mips16_syscall2 (long a0, long a1,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 2,
+ a0, a1);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c
new file mode 100644
index 000000000..7fc1c4e43
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c
@@ -0,0 +1,32 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 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>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall3
+
+long long __nomips16
+__mips16_syscall3 (long a0, long a1, long a2,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 3,
+ a0, a1, a2);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c
new file mode 100644
index 000000000..b8b4198c7
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c
@@ -0,0 +1,32 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 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>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall4
+
+long long __nomips16
+__mips16_syscall4 (long a0, long a1, long a2, long a3,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 4,
+ a0, a1, a2, a3);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c
new file mode 100644
index 000000000..e1322d107
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c
@@ -0,0 +1,33 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 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>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall5
+
+long long __nomips16
+__mips16_syscall5 (long a0, long a1, long a2, long a3,
+ long a4,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 5,
+ a0, a1, a2, a3, a4);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c
new file mode 100644
index 000000000..a9e5cd9df
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c
@@ -0,0 +1,33 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 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>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall6
+
+long long __nomips16
+__mips16_syscall6 (long a0, long a1, long a2, long a3,
+ long a4, long a5,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 6,
+ a0, a1, a2, a3, a4, a5);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c
new file mode 100644
index 000000000..d87b5ba5a
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c
@@ -0,0 +1,33 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 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>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall7
+
+long long __nomips16
+__mips16_syscall7 (long a0, long a1, long a2, long a3,
+ long a4, long a5, long a6,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 7,
+ a0, a1, a2, a3, a4, a5, a6);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist
index 737886923..f01278e4a 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist
@@ -1390,6 +1390,19 @@ GLIBC_2.16
mbrtoc16 F
mbrtoc32 F
timespec_get F
+GLIBC_2.17
+ GLIBC_2.17 A
+ clock_getcpuclockid F
+ clock_getres F
+ clock_gettime F
+ clock_nanosleep F
+ clock_settime F
+ secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
+ __mips_fpu_getcw F
+ __mips_fpu_setcw F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
@@ -2242,11 +2255,3 @@ GLIBC_2.9
pipe2 F
_gp_disp
_gp_disp A
-GLIBC_2.17
- GLIBC_2.17 A
- clock_getcpuclockid F
- clock_getres F
- clock_gettime F
- clock_nanosleep F
- clock_settime F
- secure_getenv F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index e79fda937..0faf68c4f 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -67,25 +67,86 @@
#undef INTERNAL_SYSCALL_ERRNO
#define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val)
-#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err, nr, args...) \
- internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
- "i" (SYS_ify (name)), err, args)
+/* Note that the original Linux syscall restart convention required the
+ instruction immediately preceding SYSCALL to initialize $v0 with the
+ syscall number. Then if a restart triggered, $v0 would have been
+ clobbered by the syscall interrupted, and needed to be reinititalized.
+ The kernel would decrement the PC by 4 before switching back to the
+ user mode so that $v0 had been reloaded before SYSCALL was executed
+ again. This implied the place $v0 was loaded from must have been
+ preserved across a syscall, e.g. an immediate, static register, stack
+ slot, etc.
+
+ The convention was relaxed in Linux with a change applied to the kernel
+ GIT repository as commit 96187fb0bc30cd7919759d371d810e928048249d, that
+ first appeared in the 2.6.36 release. Since then the kernel has had
+ code that reloads $v0 upon syscall restart and resumes right at the
+ SYSCALL instruction, so no special arrangement is needed anymore.
+
+ For backwards compatibility with existing kernel binaries we support
+ the old convention by choosing the instruction preceding SYSCALL
+ carefully. This also means we have to force a 32-bit encoding of the
+ microMIPS MOVE instruction if one is used. */
+
+#ifdef __mips_micromips
+# define MOVE32 "move32"
+#else
+# define MOVE32 "move"
+#endif
+#undef INTERNAL_SYSCALL
#undef INTERNAL_SYSCALL_NCS
-#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
- internal_syscall##nr (= number, , "r" (__v0), err, args)
-#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
+#ifdef __mips16
+/* There's no MIPS16 syscall instruction, so we go through out-of-line
+ standard MIPS wrappers. These do use inline snippets below though,
+ through INTERNAL_SYSCALL_MIPS16. Spilling the syscall number to
+ memory gives the best code in that case, avoiding the need to save
+ and restore a static register. */
+
+# include <mips16-syscall.h>
+
+# define INTERNAL_SYSCALL(name, err, nr, args...) \
+ INTERNAL_SYSCALL_NCS (SYS_ify (name), err, nr, args)
+
+# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+({ \
+ union __mips16_syscall_return ret; \
+ ret.val = __mips16_syscall##nr (args, number); \
+ err = ret.reg.v1; \
+ ret.reg.v0; \
+})
+
+# define INTERNAL_SYSCALL_MIPS16(number, err, nr, args...) \
+ internal_syscall##nr ("lw\t%0, %2\n\t", \
+ "R" (number), \
+ 0, err, args)
+
+#else /* !__mips16 */
+# define INTERNAL_SYSCALL(name, err, nr, args...) \
+ internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t", \
+ "IK" (SYS_ify (name)), \
+ 0, err, args)
+
+# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ internal_syscall##nr (MOVE32 "\t%0, %2\n\t", \
+ "r" (__s0), \
+ number, err, args)
+
+#endif /* !__mips16 */
+
+#define internal_syscall0(v0_init, input, number, err, dummy...) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a3 asm("$7"); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a3 asm ("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set reorder" \
: "=r" (__v0), "=r" (__a3) \
@@ -97,17 +158,19 @@
_sys_result; \
})
-#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
+#define internal_syscall1(v0_init, input, number, err, arg1) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a3 asm("$7"); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a3 asm ("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set reorder" \
: "=r" (__v0), "=r" (__a3) \
@@ -119,20 +182,22 @@
_sys_result; \
})
-#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
+#define internal_syscall2(v0_init, input, number, err, arg1, arg2) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a3 asm("$7"); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a3 asm ("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1) \
: __SYSCALL_CLOBBERS); \
@@ -142,21 +207,24 @@
_sys_result; \
})
-#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3)\
+#define internal_syscall3(v0_init, input, number, err, \
+ arg1, arg2, arg3) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7"); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2) \
: __SYSCALL_CLOBBERS); \
@@ -166,21 +234,24 @@
_sys_result; \
})
-#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4)\
+#define internal_syscall4(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2) \
: __SYSCALL_CLOBBERS); \
@@ -197,25 +268,28 @@
#define FORCE_FRAME_POINTER \
void *volatile __fp_force __attribute__ ((unused)) = alloca (4)
-#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5)\
+#define internal_syscall5(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5) \
({ \
long _sys_result; \
\
FORCE_FRAME_POINTER; \
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"subu\t$29, 32\n\t" \
"sw\t%6, 16($29)\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
"addiu\t$29, 32\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), \
"r" ((long) (arg5)) \
@@ -226,26 +300,29 @@
_sys_result; \
})
-#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6)\
+#define internal_syscall6(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
long _sys_result; \
\
FORCE_FRAME_POINTER; \
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"subu\t$29, 32\n\t" \
"sw\t%6, 16($29)\n\t" \
"sw\t%7, 20($29)\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
"addiu\t$29, 32\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), \
"r" ((long) (arg5)), "r" ((long) (arg6)) \
@@ -256,27 +333,30 @@
_sys_result; \
})
-#define internal_syscall7(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\
+#define internal_syscall7(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
({ \
long _sys_result; \
\
FORCE_FRAME_POINTER; \
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"subu\t$29, 32\n\t" \
"sw\t%6, 16($29)\n\t" \
"sw\t%7, 20($29)\n\t" \
"sw\t%8, 24($29)\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
"addiu\t$29, 32\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), \
"r" ((long) (arg5)), "r" ((long) (arg6)), "r" ((long) (arg7)) \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c
index 4367d1efe..6e52e3263 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Truncate the file FD refers to to LENGTH bytes. */
int
@@ -30,7 +29,7 @@ truncate64 (const char *path, off64_t length)
{
unsigned int low = length & 0xffffffff;
unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (truncate64, 4, CHECK_STRING (path), 0,
+ int result = INLINE_SYSCALL (truncate64, 4, path, 0,
__LONG_LONG_PAIR (high, low));
return result;
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
index 017b39d60..624994022 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
@@ -23,7 +23,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <xstatconv.h>
@@ -35,7 +34,7 @@ __fxstat64 (int vers, int fd, struct stat64 *buf)
int result;
struct kernel_stat kbuf;
- result = INLINE_SYSCALL (fstat, 2, fd, __ptrvalue (&kbuf));
+ result = INLINE_SYSCALL (fstat, 2, fd, &kbuf);
if (result == 0)
result = __xstat64_conv (vers, &kbuf, buf);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
index 32571e717..ca2f2f615 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
@@ -25,7 +25,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -96,11 +95,9 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
}
if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
+ result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
else
- result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
+ result = INTERNAL_SYSCALL (stat, err, 2, file, &kst);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat64_conv (vers, &kst, st);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
index 106271f75..b01204deb 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
@@ -23,7 +23,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <xstatconv.h>
@@ -34,7 +33,7 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf)
int result;
struct kernel_stat kbuf;
- result = INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), __ptrvalue (&kbuf));
+ result = INLINE_SYSCALL (lstat, 2, name, &kbuf);
if (result == 0)
result = __xstat64_conv (vers, &kbuf, buf);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
index b8905edd7..3b94b1bef 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
@@ -20,14 +20,12 @@
#include <ipc_priv.h>
#include <sysdep.h>
-#include <bp-checks.h>
-
int __msgctl (int msqid, int cmd, struct msqid_ds *buf);
int
__msgctl (int msqid, int cmd, struct msqid_ds *buf)
{
- return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, CHECK_1 (buf));
+ return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, buf);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist
index df2e63728..9dbbd97c8 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist
@@ -1398,6 +1398,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index 73cc8479a..452c2c70e 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -52,14 +52,14 @@
/* Define a macro which expands into the inline wrapper code for a system
call. */
#undef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...) \
+#define INLINE_SYSCALL(name, nr, args...) \
({ INTERNAL_SYSCALL_DECL(err); \
- long result_var = INTERNAL_SYSCALL (name, err, nr, args); \
- if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \
- { \
- __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \
- result_var = -1L; \
- } \
+ long result_var = INTERNAL_SYSCALL (name, err, nr, args); \
+ if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \
+ result_var = -1L; \
+ } \
result_var; })
#undef INTERNAL_SYSCALL_DECL
@@ -71,175 +71,223 @@
#undef INTERNAL_SYSCALL_ERRNO
#define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val)
+/* Note that the original Linux syscall restart convention required the
+ instruction immediately preceding SYSCALL to initialize $v0 with the
+ syscall number. Then if a restart triggered, $v0 would have been
+ clobbered by the syscall interrupted, and needed to be reinititalized.
+ The kernel would decrement the PC by 4 before switching back to the
+ user mode so that $v0 had been reloaded before SYSCALL was executed
+ again. This implied the place $v0 was loaded from must have been
+ preserved across a syscall, e.g. an immediate, static register, stack
+ slot, etc.
+
+ The convention was relaxed in Linux with a change applied to the kernel
+ GIT repository as commit 96187fb0bc30cd7919759d371d810e928048249d, that
+ first appeared in the 2.6.36 release. Since then the kernel has had
+ code that reloads $v0 upon syscall restart and resumes right at the
+ SYSCALL instruction, so no special arrangement is needed anymore.
+
+ For backwards compatibility with existing kernel binaries we support
+ the old convention by choosing the instruction preceding SYSCALL
+ carefully. This also means we have to force a 32-bit encoding of the
+ microMIPS MOVE instruction if one is used. */
+
+#ifdef __mips_micromips
+# define MOVE32 "move32"
+#else
+# define MOVE32 "move"
+#endif
+
#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err, nr, args...) \
- internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
- "i" (SYS_ify (name)), err, args)
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t", \
+ "IK" (SYS_ify (name)), \
+ 0, err, args)
#undef INTERNAL_SYSCALL_NCS
-#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
- internal_syscall##nr (= number, , "r" (__v0), err, args)
+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ internal_syscall##nr (MOVE32 "\t%0, %2\n\t", \
+ "r" (__s0), \
+ number, err, args)
-#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
-({ \
+#define internal_syscall0(v0_init, input, number, err, dummy...) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set reorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
-({ \
+#define internal_syscall1(v0_init, input, number, err, arg1) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set reorder" \
- : "=r" (__v0), "=r" (__a3) \
- : input, "r" (__a0) \
- : __SYSCALL_CLOBBERS); \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
+ : input, "r" (__a0) \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
-({ \
+#define internal_syscall2(v0_init, input, number, err, arg1, arg2) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a1 asm("$5") = ARGIFY (arg2); \
- register long long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a1 asm ("$5") = ARGIFY (arg2); \
+ register long long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \
-({ \
+#define internal_syscall3(v0_init, input, number, err, \
+ arg1, arg2, arg3) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a1 asm("$5") = ARGIFY (arg2); \
- register long long __a2 asm("$6") = ARGIFY (arg3); \
- register long long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a1 asm ("$5") = ARGIFY (arg2); \
+ register long long __a2 asm ("$6") = ARGIFY (arg3); \
+ register long long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \
-({ \
+#define internal_syscall4(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a1 asm("$5") = ARGIFY (arg2); \
- register long long __a2 asm("$6") = ARGIFY (arg3); \
- register long long __a3 asm("$7") = ARGIFY (arg4); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
- : input, "r" (__a0), "r" (__a1), "r" (__a2) \
- : __SYSCALL_CLOBBERS); \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a1 asm ("$5") = ARGIFY (arg2); \
+ register long long __a2 asm ("$6") = ARGIFY (arg3); \
+ register long long __a3 asm ("$7") = ARGIFY (arg4); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \
-({ \
+#define internal_syscall5(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a1 asm("$5") = ARGIFY (arg2); \
- register long long __a2 asm("$6") = ARGIFY (arg3); \
- register long long __a3 asm("$7") = ARGIFY (arg4); \
- register long long __a4 asm("$8") = ARGIFY (arg5); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a1 asm ("$5") = ARGIFY (arg2); \
+ register long long __a2 asm ("$6") = ARGIFY (arg3); \
+ register long long __a3 asm ("$7") = ARGIFY (arg4); \
+ register long long __a4 asm ("$8") = ARGIFY (arg5); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \
-({ \
+#define internal_syscall6(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5, arg6) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a1 asm("$5") = ARGIFY (arg2); \
- register long long __a2 asm("$6") = ARGIFY (arg3); \
- register long long __a3 asm("$7") = ARGIFY (arg4); \
- register long long __a4 asm("$8") = ARGIFY (arg5); \
- register long long __a5 asm("$9") = ARGIFY (arg6); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a1 asm ("$5") = ARGIFY (arg2); \
+ register long long __a2 asm ("$6") = ARGIFY (arg3); \
+ register long long __a3 asm ("$7") = ARGIFY (arg4); \
+ register long long __a4 asm ("$8") = ARGIFY (arg5); \
+ register long long __a5 asm ("$9") = ARGIFY (arg6); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \
"r" (__a5) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
index b3bed4663..c5f1c350e 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
@@ -31,9 +31,9 @@ ENTRY (__ioctl)
ret
L(error):
- SETUP_GP64 (a0, __ioctl)
+ SETUP_GP64_REG (a0, __ioctl)
PTR_LA t9, __syscall_error
- RESTORE_GP64
+ RESTORE_GP64_REG
jr t9
PSEUDO_END (__ioctl)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist
index 22b3068d8..c7e46aa86 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist
@@ -1396,6 +1396,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
index 86a57e02f..d16ed6941 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
@@ -48,14 +48,14 @@
/* Define a macro which expands into the inline wrapper code for a system
call. */
#undef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...) \
+#define INLINE_SYSCALL(name, nr, args...) \
({ INTERNAL_SYSCALL_DECL(err); \
- long result_var = INTERNAL_SYSCALL (name, err, nr, args); \
- if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \
- { \
- __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \
- result_var = -1L; \
- } \
+ long result_var = INTERNAL_SYSCALL (name, err, nr, args); \
+ if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \
+ result_var = -1L; \
+ } \
result_var; })
#undef INTERNAL_SYSCALL_DECL
@@ -67,175 +67,223 @@
#undef INTERNAL_SYSCALL_ERRNO
#define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val)
+/* Note that the original Linux syscall restart convention required the
+ instruction immediately preceding SYSCALL to initialize $v0 with the
+ syscall number. Then if a restart triggered, $v0 would have been
+ clobbered by the syscall interrupted, and needed to be reinititalized.
+ The kernel would decrement the PC by 4 before switching back to the
+ user mode so that $v0 had been reloaded before SYSCALL was executed
+ again. This implied the place $v0 was loaded from must have been
+ preserved across a syscall, e.g. an immediate, static register, stack
+ slot, etc.
+
+ The convention was relaxed in Linux with a change applied to the kernel
+ GIT repository as commit 96187fb0bc30cd7919759d371d810e928048249d, that
+ first appeared in the 2.6.36 release. Since then the kernel has had
+ code that reloads $v0 upon syscall restart and resumes right at the
+ SYSCALL instruction, so no special arrangement is needed anymore.
+
+ For backwards compatibility with existing kernel binaries we support
+ the old convention by choosing the instruction preceding SYSCALL
+ carefully. This also means we have to force a 32-bit encoding of the
+ microMIPS MOVE instruction if one is used. */
+
+#ifdef __mips_micromips
+# define MOVE32 "move32"
+#else
+# define MOVE32 "move"
+#endif
+
#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err, nr, args...) \
- internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
- "i" (SYS_ify (name)), err, args)
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t", \
+ "IK" (SYS_ify (name)), \
+ 0, err, args)
#undef INTERNAL_SYSCALL_NCS
-#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
- internal_syscall##nr (= number, , "r" (__v0), err, args)
+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ internal_syscall##nr (MOVE32 "\t%0, %2\n\t", \
+ "r" (__s0), \
+ number, err, args)
-#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
-({ \
+#define internal_syscall0(v0_init, input, number, err, dummy...) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set reorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
-({ \
+#define internal_syscall1(v0_init, input, number, err, arg1) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set reorder" \
- : "=r" (__v0), "=r" (__a3) \
- : input, "r" (__a0) \
- : __SYSCALL_CLOBBERS); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
+ : input, "r" (__a0) \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
-({ \
+#define internal_syscall2(v0_init, input, number, err, arg1, arg2) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \
-({ \
+#define internal_syscall3(v0_init, input, number, err, \
+ arg1, arg2, arg3) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \
-({ \
+#define internal_syscall4(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
- : input, "r" (__a0), "r" (__a1), "r" (__a2) \
- : __SYSCALL_CLOBBERS); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \
-({ \
+#define internal_syscall5(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
- register long __a4 asm("$8") = (long) (arg5); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
+ register long __a4 asm ("$8") = (long) (arg5); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \
-({ \
+#define internal_syscall6(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5, arg6) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
- register long __a4 asm("$8") = (long) (arg5); \
- register long __a5 asm("$9") = (long) (arg6); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
+ register long __a4 asm ("$8") = (long) (arg5); \
+ register long __a5 asm ("$9") = (long) (arg6); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \
"r" (__a5) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
index 354eba2f3..656522566 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
@@ -57,6 +57,7 @@
cfi_same_value (gp); \
RESTORESTK; \
ret; \
+ cfi_endproc; \
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
ENTRY (name) \
SAVESTK; \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
index 7e5488dbd..e43e8937a 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
@@ -30,9 +30,6 @@ union semun
struct seminfo *__buf; /* buffer for IPC_INFO */
};
-#include <bp-checks.h>
-#include <bp-semctl.h> /* definition of CHECK_SEMCTL needs union semum */
-
int __semctl (int semid, int semnum, int cmd, ...);
int
@@ -49,7 +46,7 @@ __semctl (int semid, int semnum, int cmd, ...)
va_end (ap);
return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
- CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)->array);
+ arg.array);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
index 9b183f335..197f7eb80 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
@@ -20,14 +20,12 @@
#include <ipc_priv.h>
#include <sysdep.h>
-#include <bp-checks.h>
-
int __shmctl (int shmid, int cmd, struct shmid_ds *buf);
int
__shmctl (int shmid, int cmd, struct shmid_ds *buf)
{
- return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, CHECK_1 (buf));
+ return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, buf);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
index 839276d7a..850025c63 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
@@ -30,7 +30,9 @@ NESTED (syscall, SZREG, ra)
.mask 0x00010000, -SZREG
.fmask 0x00000000, 0
PTR_ADDIU sp, -SZREG
+ cfi_adjust_cfa_offset (SZREG)
REG_S s0, (sp)
+ cfi_rel_offset (s0, 0)
move s0, a0
move a0, a1 /* shift arg1 - arg7. */
@@ -45,15 +47,17 @@ NESTED (syscall, SZREG, ra)
syscall /* Do the system call. */
REG_L s0, (sp)
+ cfi_restore (s0)
PTR_ADDIU sp, SZREG
+ cfi_adjust_cfa_offset (-SZREG)
bne a3, zero, L(error)
ret
L(error):
- SETUP_GP64 (a0, syscall)
+ SETUP_GP64_REG (a0, syscall)
PTR_LA t9, __syscall_error
- RESTORE_GP64
+ RESTORE_GP64_REG
jr t9
END (syscall)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
index 2408e5e37..89cde2b33 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
@@ -23,7 +23,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <xstatconv.h>
@@ -35,7 +34,7 @@ __xstat64 (int vers, const char *name, struct stat64 *buf)
int result;
struct kernel_stat kbuf;
- result = INLINE_SYSCALL (stat, 2, CHECK_STRING (name), __ptrvalue (&kbuf));
+ result = INLINE_SYSCALL (stat, 2, name, &kbuf);
if (result == 0)
result = __xstat64_conv (vers, &kbuf, buf);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
index fe7c747cd..4f27b8b82 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
@@ -36,6 +36,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -141,6 +143,34 @@
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
+ })
+
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
static inline int __attribute__((always_inline))
__lll_trylock(int *futex)
{
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h
index e1dd67252..3b0eccc77 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h
@@ -39,6 +39,7 @@
# undef PSEUDO
# define PSEUDO(name, syscall_name, args) \
.align 2; \
+ .set nomips16; \
L(pseudo_start): \
cfi_startproc; \
99: PSEUDO_ERRJMP \
@@ -52,6 +53,7 @@
.set reorder; \
bne a3, zero, 99b; \
ret; \
+ cfi_endproc; \
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
ENTRY (name) \
.set noreorder; \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/pread.c b/libc/ports/sysdeps/unix/sysv/linux/mips/pread.c
index b269e1c25..db18265e3 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/pread.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/pread.c
@@ -26,7 +26,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -54,10 +53,9 @@ __libc_pread (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
#endif
return result;
@@ -66,9 +64,9 @@ __libc_pread (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/pread64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/pread64.c
index 8c2c403a9..3b8c8aa72 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/pread64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/pread64.c
@@ -25,7 +25,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -50,10 +49,9 @@ __libc_pread64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
#endif
@@ -63,9 +61,9 @@ __libc_pread64 (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite.c b/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite.c
index aa3501414..94213bc8b 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite.c
@@ -26,7 +26,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -54,10 +53,9 @@ __libc_pwrite (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
#endif
return result;
@@ -66,9 +64,9 @@ __libc_pwrite (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c
index 1d14e0761..aa8a4dec3 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c
@@ -25,7 +25,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -49,10 +48,9 @@ __libc_pwrite64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
#endif
@@ -63,9 +61,9 @@ __libc_pwrite64 (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/setcontext.S b/libc/ports/sysdeps/unix/sysv/linux/mips/setcontext.S
index 42f709d84..2d5aee013 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/setcontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/setcontext.S
@@ -27,6 +27,7 @@
/* int setcontext (const ucontext_t *ucp) */
.text
+ .set nomips16
LOCALSZ = 0
ARGSZ = 0
MASK = 0x00000000
@@ -56,9 +57,10 @@ NESTED (__setcontext, FRAMESZ, ra)
#endif
PTR_ADDIU sp, -FRAMESZ
+ cfi_adjust_cfa_offset (FRAMESZ)
#ifdef __PIC__
- SETUP_GP64 (GPOFF, __setcontext)
+ SETUP_GP64_STACK (GPOFF, __setcontext)
SAVE_GP (GPOFF)
#endif
@@ -152,6 +154,7 @@ NESTED (__setcontext, FRAMESZ, ra)
and call the signal return syscall as if a signal
handler exited normally. */
PTR_ADDIU sp, -((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
+ cfi_adjust_cfa_offset ((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
/* Only ucontext is referred to from rt_sigreturn,
copy it. */
@@ -175,11 +178,13 @@ NESTED (__setcontext, FRAMESZ, ra)
path. Successful rt_sigreturn never returns to
its calling place. */
PTR_ADDIU sp, ((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
+ cfi_adjust_cfa_offset (-((RT_SIGFRAME_SIZE + ALSZ) & ALMASK))
99:
#ifdef __PIC__
PTR_LA t9, JUMPTARGET (__syscall_error)
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDIU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
jr t9
#else /* ! __PIC__ */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/sigaction.c b/libc/ports/sysdeps/unix/sysv/linux/mips/sigaction.c
index c490dd144..9d8ee76d0 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/sigaction.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/sigaction.c
@@ -71,8 +71,8 @@ __libc_sigaction (sig, act, oact)
/* 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,
+ act ? &kact : NULL,
+ oact ? &koact : NULL,
sizeof (kernel_sigset_t));
if (oact && result >= 0)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S b/libc/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S
index d965f3919..ec271b058 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S
@@ -27,6 +27,7 @@
/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
.text
+ .set nomips16
LOCALSZ = 0
ARGSZ = 0
MASK = 0x00000000
@@ -63,7 +64,8 @@ NESTED (__swapcontext, FRAMESZ, ra)
# endif
PTR_ADDIU sp, -FRAMESZ
- SETUP_GP64 (GPOFF, __swapcontext)
+ cfi_adjust_cfa_offset (FRAMESZ)
+ SETUP_GP64_STACK (GPOFF, __swapcontext)
SAVE_GP (GPOFF)
#else /* ! __PIC__ */
@@ -198,8 +200,9 @@ NESTED (__swapcontext, FRAMESZ, ra)
99:
#ifdef __PIC__
PTR_LA t9, JUMPTARGET (__syscall_error)
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDIU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
jr t9
#else /* ! __PIC__ */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/ustat.c b/libc/ports/sysdeps/unix/sysv/linux/mips/ustat.c
index f05bba629..6db482e96 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/ustat.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/ustat.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
int
ustat (dev_t dev, struct ustat *ubuf)
@@ -32,5 +31,5 @@ ustat (dev_t dev, struct ustat *ubuf)
/* We must convert the value to dev_t type used by the kernel. */
k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff);
- return INLINE_SYSCALL (ustat, 2, k_dev, CHECK_1 (ubuf));
+ return INLINE_SYSCALL (ustat, 2, k_dev, ubuf);
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/vfork.S b/libc/ports/sysdeps/unix/sysv/linux/mips/vfork.S
index b9503c394..ae76a91d3 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/vfork.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/vfork.S
@@ -34,6 +34,7 @@
/* int vfork() */
.text
+ .set nomips16
LOCALSZ= 1
FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
GPOFF= FRAMESZ-(1*SZREG)
@@ -42,7 +43,8 @@ NESTED(__vfork,FRAMESZ,sp)
SETUP_GP
#endif
PTR_SUBU sp, FRAMESZ
- SETUP_GP64 (a5, __vfork)
+ cfi_adjust_cfa_offset (FRAMESZ)
+ SETUP_GP64_REG (a5, __vfork)
#ifdef __PIC__
SAVE_GP (GPOFF)
#endif
@@ -63,6 +65,7 @@ NESTED(__vfork,FRAMESZ,sp)
#endif
PTR_ADDU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
SAVE_PID
@@ -75,20 +78,22 @@ NESTED(__vfork,FRAMESZ,sp)
RESTORE_PID
+ cfi_remember_state
bnez a3,L(error)
/* Successful return from the parent or child. */
- RESTORE_GP64
+ RESTORE_GP64_REG
ret
/* Something bad happened -- no child created. */
L(error):
+ cfi_restore_state
#ifdef __PIC__
PTR_LA t9, __syscall_error
- RESTORE_GP64
+ RESTORE_GP64_REG
jr t9
#else
- RESTORE_GP64
+ RESTORE_GP64_REG
j __syscall_error
#endif
END(__vfork)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist
index 0efc6b55c..9b6d66374 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist
@@ -1781,6 +1781,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
index e6f5d1905..a9822ec96 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
@@ -38,6 +38,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -139,7 +141,33 @@
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
static inline int __attribute__ ((always_inline))
diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist
index d79b2df55..caf74b89e 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist
@@ -2088,3 +2088,6 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist
index f61740567..68d975be5 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist
@@ -2088,3 +2088,6 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist
index d79b2df55..caf74b89e 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist
@@ -2088,3 +2088,6 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
diff --git a/libc/posix/Makefile b/libc/posix/Makefile
index 70d09ea17..489baab72 100644
--- a/libc/posix/Makefile
+++ b/libc/posix/Makefile
@@ -97,7 +97,7 @@ tests := tstgetopt testfnm runtests \
tst-execvp3 tst-execvp4 \
tst-fnmatch2 tst-cpucount tst-cpuset \
bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \
- bug-getopt5 tst-getopt_long1
+ bug-getopt5 tst-getopt_long1 bug-regex34 bug-regex35
tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+= tst-fnmatch tst-regexloc bug-regex1 bug-regex5 \
bug-regex23 bug-regex25 bug-regex32 bug-regex33
@@ -229,6 +229,8 @@ bug-regex26-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex30-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex32-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex33-ENV = LOCPATH=$(common-objpfx)localedata
+bug-regex34-ENV = LOCPATH=$(common-objpfx)localedata
+bug-regex35-ENV = LOCPATH=$(common-objpfx)localedata
tst-rxspencer-ARGS = rxspencer/tests
ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
tst-rxspencer-ARGS += --utf8
diff --git a/libc/posix/Versions b/libc/posix/Versions
index 686c446bc..1bc235acd 100644
--- a/libc/posix/Versions
+++ b/libc/posix/Versions
@@ -1,7 +1,7 @@
libc {
GLIBC_2.0 {
# functions with special/multiple interfaces
- __bsd_getpgrp; __setpgid; __getpgid;
+ __bsd_getpgrp; __getpgid; __setpgid;
# functions with required interface outside normal name space
_exit;
@@ -114,7 +114,7 @@ libc {
# under GLIBC_2.0; the first instance in the script is taken as the
# default, so linux configurations put them in GLIBC_2.0 while other
# configuration put them in GLIBC_2.3.2.
- getresuid; getresgid; setresuid; setresgid;
+ getresgid; getresuid; setresgid; setresuid;
}
GLIBC_2.3.3 {
sched_getaffinity; sched_setaffinity;
diff --git a/libc/posix/bug-regex34.c b/libc/posix/bug-regex34.c
new file mode 100644
index 000000000..bb3b6138f
--- /dev/null
+++ b/libc/posix/bug-regex34.c
@@ -0,0 +1,46 @@
+/* Test re_search with multi-byte characters in UTF-8.
+ Copyright (C) 2013 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 _GNU_SOURCE 1
+#include <stdio.h>
+#include <string.h>
+#include <locale.h>
+#include <regex.h>
+
+static int
+do_test (void)
+{
+ struct re_pattern_buffer r;
+ /* ကျွန်ုပ်x */
+ const char *s = "\xe1\x80\x80\xe1\x80\xbb\xe1\x80\xbd\xe1\x80\x94\xe1\x80\xba\xe1\x80\xaf\xe1\x80\x95\xe1\x80\xbax";
+
+ if (setlocale (LC_ALL, "en_US.UTF-8") == NULL)
+ {
+ puts ("setlocale failed");
+ return 1;
+ }
+ memset (&r, 0, sizeof (r));
+
+ re_compile_pattern ("[^x]x", 5, &r);
+ /* This was triggering a buffer overflow. */
+ re_search (&r, s, strlen (s), 0, strlen (s), 0);
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/posix/bug-regex35.c b/libc/posix/bug-regex35.c
new file mode 100644
index 000000000..7957e7f86
--- /dev/null
+++ b/libc/posix/bug-regex35.c
@@ -0,0 +1,52 @@
+/* Test regcomp with collating symbols in bracket expressions
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <string.h>
+#include <locale.h>
+#include <regex.h>
+
+static int
+do_test (void)
+{
+ regex_t r;
+
+ if (setlocale (LC_ALL, "cs_CZ.UTF-8") == NULL)
+ {
+ puts ("setlocale failed");
+ return 1;
+ }
+
+ if (regcomp (&r, "[[.ch.]]", REG_NOSUB) != 0)
+ {
+ puts ("regcomp failed");
+ return 1;
+ }
+
+ if (regexec (&r, "ch", 0, 0, 0) != 0)
+ {
+ puts ("regexec failed");
+ return 1;
+ }
+
+ regfree (&r);
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/posix/regcomp.c b/libc/posix/regcomp.c
index c6ef42068..b90c8fc25 100644
--- a/libc/posix/regcomp.c
+++ b/libc/posix/regcomp.c
@@ -2792,40 +2792,29 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
/* Local function for parse_bracket_exp used in _LIBC environement.
Seek the collating symbol entry correspondings to NAME.
- Return the index of the symbol in the SYMB_TABLE. */
+ Return the index of the symbol in the SYMB_TABLE,
+ or -1 if not found. */
auto inline int32_t
__attribute ((always_inline))
- seek_collating_symbol_entry (name, name_len)
- const unsigned char *name;
- size_t name_len;
+ seek_collating_symbol_entry (const unsigned char *name, size_t name_len)
{
- int32_t hash = elem_hash ((const char *) name, name_len);
- int32_t elem = hash % table_size;
- if (symb_table[2 * elem] != 0)
- {
- int32_t second = hash % (table_size - 2) + 1;
-
- do
- {
- /* First compare the hashing value. */
- if (symb_table[2 * elem] == hash
- /* Compare the length of the name. */
- && name_len == extra[symb_table[2 * elem + 1]]
- /* Compare the name. */
- && memcmp (name, &extra[symb_table[2 * elem + 1] + 1],
- name_len) == 0)
- {
- /* Yep, this is the entry. */
- break;
- }
+ int32_t elem;
- /* Next entry. */
- elem += second;
- }
- while (symb_table[2 * elem] != 0);
- }
- return elem;
+ for (elem = 0; elem < table_size; elem++)
+ if (symb_table[2 * elem] != 0)
+ {
+ int32_t idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating element name. */
+ idx += 1 + extra[idx];
+ if (/* Compare the length of the name. */
+ name_len == extra[idx]
+ /* Compare the name. */
+ && memcmp (name, &extra[idx + 1], name_len) == 0)
+ /* Yep, this is the entry. */
+ return elem;
+ }
+ return -1;
}
/* Local function for parse_bracket_exp used in _LIBC environment.
@@ -2834,8 +2823,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
auto inline unsigned int
__attribute ((always_inline))
- lookup_collation_sequence_value (br_elem)
- bracket_elem_t *br_elem;
+ lookup_collation_sequence_value (bracket_elem_t *br_elem)
{
if (br_elem->type == SB_CHAR)
{
@@ -2865,7 +2853,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
int32_t elem, idx;
elem = seek_collating_symbol_entry (br_elem->opr.name,
sym_name_len);
- if (symb_table[2 * elem] != 0)
+ if (elem != -1)
{
/* We found the entry. */
idx = symb_table[2 * elem + 1];
@@ -2883,7 +2871,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
/* Return the collation sequence value. */
return *(unsigned int *) (extra + idx);
}
- else if (symb_table[2 * elem] == 0 && sym_name_len == 1)
+ else if (sym_name_len == 1)
{
/* No valid character. Match it as a single byte
character. */
@@ -2905,11 +2893,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
auto inline reg_errcode_t
__attribute ((always_inline))
- build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem)
- re_charset_t *mbcset;
- int *range_alloc;
- bitset_t sbcset;
- bracket_elem_t *start_elem, *end_elem;
+ build_range_exp (bitset_t sbcset, re_charset_t *mbcset, int *range_alloc,
+ bracket_elem_t *start_elem, bracket_elem_t *end_elem)
{
unsigned int ch;
uint32_t start_collseq;
@@ -2988,25 +2973,22 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
auto inline reg_errcode_t
__attribute ((always_inline))
- build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name)
- re_charset_t *mbcset;
- int *coll_sym_alloc;
- bitset_t sbcset;
- const unsigned char *name;
+ build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
+ int *coll_sym_alloc, const unsigned char *name)
{
int32_t elem, idx;
size_t name_len = strlen ((const char *) name);
if (nrules != 0)
{
elem = seek_collating_symbol_entry (name, name_len);
- if (symb_table[2 * elem] != 0)
+ if (elem != -1)
{
/* We found the entry. */
idx = symb_table[2 * elem + 1];
/* Skip the name of collating element name. */
idx += 1 + extra[idx];
}
- else if (symb_table[2 * elem] == 0 && name_len == 1)
+ else if (name_len == 1)
{
/* No valid character, treat it as a normal
character. */
diff --git a/libc/posix/regex_internal.h b/libc/posix/regex_internal.h
index d24cded12..46a1ad2d4 100644
--- a/libc/posix/regex_internal.h
+++ b/libc/posix/regex_internal.h
@@ -102,7 +102,6 @@
# define BE(expr, val) __builtin_expect (expr, val)
#else
# define BE(expr, val) (expr)
-# define inline
#endif
/* Number of single byte character. */
@@ -126,10 +125,8 @@
# define attribute_hidden
#endif /* not _LIBC */
-#ifdef __GNUC__
-# define __attribute(arg) __attribute__ (arg)
-#else
-# define __attribute(arg)
+#if __GNUC__ < 3 + (__GNUC_MINOR__ < 1)
+# define __attribute__(arg)
#endif
extern const char __re_error_msgid[] attribute_hidden;
@@ -390,7 +387,7 @@ typedef struct re_dfa_t re_dfa_t;
#ifndef _LIBC
# ifdef __i386__
-# define internal_function __attribute ((regparm (3), stdcall))
+# define internal_function __attribute__ ((regparm (3), stdcall))
# else
# define internal_function
# endif
@@ -409,7 +406,7 @@ static void build_upper_buffer (re_string_t *pstr) internal_function;
static void re_string_translate_buffer (re_string_t *pstr) internal_function;
static unsigned int re_string_context_at (const re_string_t *input, int idx,
int eflags)
- internal_function __attribute ((pure));
+ internal_function __attribute__ ((pure));
#endif
#define re_string_peek_byte(pstr, offset) \
((pstr)->mbs[(pstr)->cur_idx + offset])
@@ -706,7 +703,7 @@ typedef struct
/* Inline functions for bitset operation. */
-static inline void
+static void __attribute__ ((unused))
bitset_not (bitset_t set)
{
int bitset_i;
@@ -714,7 +711,7 @@ bitset_not (bitset_t set)
set[bitset_i] = ~set[bitset_i];
}
-static inline void
+static void __attribute__ ((unused))
bitset_merge (bitset_t dest, const bitset_t src)
{
int bitset_i;
@@ -722,7 +719,7 @@ bitset_merge (bitset_t dest, const bitset_t src)
dest[bitset_i] |= src[bitset_i];
}
-static inline void
+static void __attribute__ ((unused))
bitset_mask (bitset_t dest, const bitset_t src)
{
int bitset_i;
@@ -732,8 +729,8 @@ bitset_mask (bitset_t dest, const bitset_t src)
#ifdef RE_ENABLE_I18N
/* Inline functions for re_string. */
-static inline int
-internal_function __attribute ((pure))
+static int
+internal_function __attribute__ ((pure, unused))
re_string_char_size_at (const re_string_t *pstr, int idx)
{
int byte_idx;
@@ -745,8 +742,8 @@ re_string_char_size_at (const re_string_t *pstr, int idx)
return byte_idx;
}
-static inline wint_t
-internal_function __attribute ((pure))
+static wint_t
+internal_function __attribute__ ((pure, unused))
re_string_wchar_at (const re_string_t *pstr, int idx)
{
if (string_mb_cur_max (pstr) == 1)
@@ -756,7 +753,7 @@ re_string_wchar_at (const re_string_t *pstr, int idx)
# ifndef NOT_IN_libc
static int
-internal_function __attribute ((pure))
+internal_function __attribute__ ((pure, unused))
re_string_elem_size_at (const re_string_t *pstr, int idx)
{
# ifdef _LIBC
diff --git a/libc/posix/regexec.c b/libc/posix/regexec.c
index 842f6163f..894d363d5 100644
--- a/libc/posix/regexec.c
+++ b/libc/posix/regexec.c
@@ -199,7 +199,7 @@ static int group_nodes_into_DFAstates (const re_dfa_t *dfa,
static int check_node_accept (const re_match_context_t *mctx,
const re_token_t *node, int idx)
internal_function;
-static reg_errcode_t extend_buffers (re_match_context_t *mctx)
+static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len)
internal_function;
/* Entry point for POSIX code. */
@@ -1146,7 +1146,7 @@ check_matching (re_match_context_t *mctx, int fl_longest_match,
|| (BE (next_char_idx >= mctx->input.valid_len, 0)
&& mctx->input.valid_len < mctx->input.len))
{
- err = extend_buffers (mctx);
+ err = extend_buffers (mctx, next_char_idx + 1);
if (BE (err != REG_NOERROR, 0))
{
assert (err == REG_ESPACE);
@@ -1724,7 +1724,7 @@ clean_state_log_if_needed (re_match_context_t *mctx, int next_state_log_idx)
&& mctx->input.valid_len < mctx->input.len))
{
reg_errcode_t err;
- err = extend_buffers (mctx);
+ err = extend_buffers (mctx, next_state_log_idx + 1);
if (BE (err != REG_NOERROR, 0))
return err;
}
@@ -2778,7 +2778,7 @@ get_subexp (re_match_context_t *mctx, int bkref_node, int bkref_str_idx)
if (bkref_str_off >= mctx->input.len)
break;
- err = extend_buffers (mctx);
+ err = extend_buffers (mctx, bkref_str_off + 1);
if (BE (err != REG_NOERROR, 0))
return err;
@@ -4096,7 +4096,7 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
static reg_errcode_t
internal_function __attribute_warn_unused_result__
-extend_buffers (re_match_context_t *mctx)
+extend_buffers (re_match_context_t *mctx, int min_len)
{
reg_errcode_t ret;
re_string_t *pstr = &mctx->input;
@@ -4105,8 +4105,10 @@ extend_buffers (re_match_context_t *mctx)
if (BE (INT_MAX / 2 / sizeof (re_dfastate_t *) <= pstr->bufs_len, 0))
return REG_ESPACE;
- /* Double the lengthes of the buffers. */
- ret = re_string_realloc_buffers (pstr, MIN (pstr->len, pstr->bufs_len * 2));
+ /* Double the lengthes of the buffers, but allocate at least MIN_LEN. */
+ ret = re_string_realloc_buffers (pstr,
+ MAX (min_len,
+ MIN (pstr->len, pstr->bufs_len * 2)));
if (BE (ret != REG_NOERROR, 0))
return ret;
diff --git a/libc/posix/wordexp.c b/libc/posix/wordexp.c
index bf49baab9..96ce8a4b1 100644
--- a/libc/posix/wordexp.c
+++ b/libc/posix/wordexp.c
@@ -953,7 +953,12 @@ exec_comm (char *comm, char **word, size_t *word_length, size_t *max_length,
if ((buflen = TEMP_FAILURE_RETRY (__read (fildes[0], buffer,
bufsize))) < 1)
{
- if (TEMP_FAILURE_RETRY (__waitpid (pid, &status, WNOHANG)) == 0)
+ /* If read returned 0 then the process has closed its
+ stdout. Don't use WNOHANG in that case to avoid busy
+ looping until the process eventually exits. */
+ if (TEMP_FAILURE_RETRY (__waitpid (pid, &status,
+ buflen == 0 ? 0 : WNOHANG))
+ == 0)
continue;
if ((buflen = TEMP_FAILURE_RETRY (__read (fildes[0], buffer,
bufsize))) < 1)
@@ -983,7 +988,12 @@ exec_comm (char *comm, char **word, size_t *word_length, size_t *max_length,
if ((buflen = TEMP_FAILURE_RETRY (__read (fildes[0], buffer,
bufsize))) < 1)
{
- if (TEMP_FAILURE_RETRY (__waitpid (pid, &status, WNOHANG)) == 0)
+ /* If read returned 0 then the process has closed its
+ stdout. Don't use WNOHANG in that case to avoid busy
+ looping until the process eventually exits. */
+ if (TEMP_FAILURE_RETRY (__waitpid (pid, &status,
+ buflen == 0 ? 0 : WNOHANG))
+ == 0)
continue;
if ((buflen = TEMP_FAILURE_RETRY (__read (fildes[0], buffer,
bufsize))) < 1)
diff --git a/libc/resolv/Versions b/libc/resolv/Versions
index 93faf1e2f..6f0259737 100644
--- a/libc/resolv/Versions
+++ b/libc/resolv/Versions
@@ -97,6 +97,6 @@ libnss_dns {
libanl {
GLIBC_2.2.3 {
- getaddrinfo_a; gai_cancel; gai_error; gai_suspend;
+ gai_cancel; gai_error; gai_suspend; getaddrinfo_a;
}
}
diff --git a/libc/resolv/res_send.c b/libc/resolv/res_send.c
index c790031b4..60da5c901 100644
--- a/libc/resolv/res_send.c
+++ b/libc/resolv/res_send.c
@@ -155,7 +155,7 @@ evSubTime(struct timespec *res, const struct timespec *minuend,
}
}
-static inline int
+static int
evCmpTime(struct timespec a, struct timespec b) {
long x = a.tv_sec - b.tv_sec;
@@ -164,7 +164,7 @@ evCmpTime(struct timespec a, struct timespec b) {
return (x < 0L ? (-1) : x > 0L ? (1) : (0));
}
-static inline void
+static void
evNowTime(struct timespec *res) {
struct timeval now;
diff --git a/libc/rt/Makefile b/libc/rt/Makefile
index 6a98c8151..ef356d0aa 100644
--- a/libc/rt/Makefile
+++ b/libc/rt/Makefile
@@ -76,8 +76,5 @@ $(addprefix $(objpfx),$(tests)): $(objpfx)librt.so $(shared-thread-library)
else
$(addprefix $(objpfx),$(tests)): $(objpfx)librt.a $(static-thread-library)
endif
-ifeq (yes,$(build-bounded))
-$(tests:%=$(objpfx)%-bp): $(objpfx)librt_b.a $(bounded-thread-library)
-endif
tst-mqueue7-ARGS = -- $(host-test-program-cmd)
diff --git a/libc/scripts/config.guess b/libc/scripts/config.guess
index 872b96a16..f475ceb41 100755
--- a/libc/scripts/config.guess
+++ b/libc/scripts/config.guess
@@ -1,14 +1,12 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012 Free Software Foundation, Inc.
+# Copyright 1992-2013 Free Software Foundation, Inc.
-timestamp='2012-09-25'
+timestamp='2013-02-12'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -22,19 +20,17 @@ timestamp='2012-09-25'
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner. Please send patches (context
-# diff format) to <config-patches@gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
+# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -54,9 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -959,6 +953,9 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
+ or1k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
or32:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
diff --git a/libc/scripts/config.sub b/libc/scripts/config.sub
index bdda9e4a3..872199acf 100755
--- a/libc/scripts/config.sub
+++ b/libc/scripts/config.sub
@@ -1,24 +1,18 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012 Free Software Foundation, Inc.
+# Copyright 1992-2013 Free Software Foundation, Inc.
-timestamp='2012-08-18'
+timestamp='2013-02-12'
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
-# This program 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 General Public License for more details.
+# This program 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
+# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
@@ -26,11 +20,12 @@ timestamp='2012-08-18'
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -73,9 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -156,7 +149,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze)
+ -apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
@@ -259,8 +252,10 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | be32 | be64 \
+ | arc \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
@@ -273,7 +268,7 @@ case $basic_machine in
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -291,16 +286,17 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
- | nios | nios2 \
+ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 \
- | or32 \
+ | or1k | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
@@ -389,7 +385,8 @@ case $basic_machine in
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -407,12 +404,13 @@ case $basic_machine in
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
@@ -788,7 +786,7 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
- microblaze)
+ microblaze*)
basic_machine=microblaze-xilinx
;;
mingw64)
@@ -1023,7 +1021,11 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
- rdos)
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
basic_machine=i386-pc
os=-rdos
;;
@@ -1350,7 +1352,7 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* \
+ | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
@@ -1496,9 +1498,6 @@ case $os in
-aros*)
os=-aros
;;
- -kaos*)
- os=-kaos
- ;;
-zvmoe)
os=-zvmoe
;;
@@ -1590,6 +1589,9 @@ case $basic_machine in
mips*-*)
os=-elf
;;
+ or1k-*)
+ os=-elf
+ ;;
or32-*)
os=-coff
;;
diff --git a/libc/stdio-common/vfprintf.c b/libc/stdio-common/vfprintf.c
index 1f8ed45f5..b8e5d1b86 100644
--- a/libc/stdio-common/vfprintf.c
+++ b/libc/stdio-common/vfprintf.c
@@ -315,7 +315,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
do \
{ \
int offset; \
- void *__unbounded ptr; \
+ void *ptr; \
spec = (ChExpr); \
offset = NOT_IN_JUMP_RANGE (spec) ? REF (form_unknown) \
: table[CHAR_CLASS (spec)]; \
@@ -328,7 +328,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
# define JUMP(ChExpr, table) \
do \
{ \
- const void *__unbounded ptr; \
+ const void *ptr; \
spec = (ChExpr); \
ptr = NOT_IN_JUMP_RANGE (spec) ? REF (form_unknown) \
: table[CHAR_CLASS (spec)]; \
diff --git a/libc/stdlib/Makefile b/libc/stdlib/Makefile
index 83706707a..45e609185 100644
--- a/libc/stdlib/Makefile
+++ b/libc/stdlib/Makefile
@@ -27,7 +27,8 @@ headers := stdlib.h bits/stdlib.h bits/stdlib-ldbl.h bits/stdlib-float.h \
inttypes.h stdint.h bits/wordsize.h \
errno.h sys/errno.h bits/errno.h \
ucontext.h sys/ucontext.h \
- alloca.h fmtmsg.h
+ alloca.h fmtmsg.h \
+ bits/stdlib-bsearch.h
routines-y := \
atof atoi atol atoll \
@@ -35,7 +36,7 @@ routines-y := \
bsearch qsort msort \
getenv putenv setenv secure-getenv \
exit on_exit atexit cxa_atexit cxa_finalize old_atexit \
- quick_exit at_quick_exit cxa_at_quick_exit \
+ quick_exit at_quick_exit cxa_at_quick_exit cxa_thread_atexit_impl \
abs labs llabs \
div ldiv lldiv \
random random_r rand rand_r \
@@ -79,12 +80,14 @@ tests := tst-strtol tst-strtod testrand testsort testdiv \
tst-makecontext tst-qsort2 tst-makecontext2 tst-strtod6 \
tst-unsetenv1 tst-makecontext3 bug-getcontext bug-fmtmsg1 \
tst-secure-getenv tst-strtod-overflow tst-strtod-round \
- tst-tininess tst-strtod-underflow
+ tst-tininess tst-strtod-underflow tst-tls-atexit
tests-static := tst-secure-getenv
tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+= tst-strtod3 tst-strtod4 tst-strtod5 testmb2
tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
+= testmb
+modules-names = tst-tls-atexit-lib
+
include ../Makeconfig
ifeq ($(build-shared),yes)
@@ -168,3 +171,9 @@ $(objpfx)bug-getcontext: $(link-libm)
$(objpfx)tst-strtod-round: $(link-libm)
$(objpfx)tst-tininess: $(link-libm)
$(objpfx)tst-strtod-underflow: $(link-libm)
+
+tst-tls-atexit-lib.so-no-z-defs = yes
+
+LDFLAGS-tst-tls-atexit = $(common-objpfx)nptl/libpthread.so \
+ $(common-objpfx)dlfcn/libdl.so
+$(objpfx)tst-tls-atexit.out: $(objpfx)tst-tls-atexit-lib.so
diff --git a/libc/stdlib/Versions b/libc/stdlib/Versions
index 250bd5fad..f1777dfcf 100644
--- a/libc/stdlib/Versions
+++ b/libc/stdlib/Versions
@@ -106,6 +106,9 @@ libc {
GLIBC_2.17 {
secure_getenv;
}
+ GLIBC_2.18 {
+ __cxa_thread_atexit_impl;
+ }
GLIBC_PRIVATE {
# functions which have an additional interface since they are
# are cancelable.
@@ -114,5 +117,6 @@ libc {
__abort_msg;
# Used from other libraries
__libc_secure_getenv;
+ __call_tls_dtors;
}
}
diff --git a/libc/stdlib/bsearch.c b/libc/stdlib/bsearch.c
index 55b4f3752..4a357efee 100644
--- a/libc/stdlib/bsearch.c
+++ b/libc/stdlib/bsearch.c
@@ -17,32 +17,7 @@
#include <stdlib.h>
-
-/* Perform a binary search for KEY in BASE which has NMEMB elements
- of SIZE bytes each. The comparisons are done by (*COMPAR)(). */
-void *
-bsearch (const void *key, const void *base, size_t nmemb, size_t size,
- int (*compar) (const void *, const void *))
-{
- size_t l, u, idx;
- const void *p;
- int comparison;
-
- l = 0;
- u = nmemb;
- while (l < u)
- {
- idx = (l + u) / 2;
- p = (void *) (((const char *) base) + (idx * size));
- comparison = (*compar) (key, p);
- if (comparison < 0)
- u = idx;
- else if (comparison > 0)
- l = idx + 1;
- else
- return (void *) p;
- }
-
- return NULL;
-}
+#undef __extern_inline
+#define __extern_inline /* Empty, so we get a normal definition. */
+#include <bits/stdlib-bsearch.h>
libc_hidden_def (bsearch)
diff --git a/libc/stdlib/cxa_thread_atexit_impl.c b/libc/stdlib/cxa_thread_atexit_impl.c
new file mode 100644
index 000000000..ebf3c4ab0
--- /dev/null
+++ b/libc/stdlib/cxa_thread_atexit_impl.c
@@ -0,0 +1,102 @@
+/* Register destructors for C++ TLS variables declared with thread_local.
+ Copyright (C) 2013 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 <stdlib.h>
+#include <ldsodefs.h>
+
+typedef void (*dtor_func) (void *);
+
+struct dtor_list
+{
+ dtor_func func;
+ void *obj;
+ struct link_map *map;
+ struct dtor_list *next;
+};
+
+static __thread struct dtor_list *tls_dtor_list;
+static __thread void *dso_symbol_cache;
+static __thread struct link_map *lm_cache;
+
+/* Register a destructor for TLS variables declared with the 'thread_local'
+ keyword. This function is only called from code generated by the C++
+ compiler. FUNC is the destructor function and OBJ is the object to be
+ passed to the destructor. DSO_SYMBOL is the __dso_handle symbol that each
+ DSO has at a unique address in its map, added from crtbegin.o during the
+ linking phase. */
+int
+__cxa_thread_atexit_impl (dtor_func func, void *obj, void *dso_symbol)
+{
+ /* Prepend. */
+ struct dtor_list *new = calloc (1, sizeof (struct dtor_list));
+ new->func = func;
+ new->obj = obj;
+ new->next = tls_dtor_list;
+ tls_dtor_list = new;
+
+ /* See if we already encountered the DSO. */
+ __rtld_lock_lock_recursive (GL(dl_load_lock));
+
+ if (__builtin_expect (dso_symbol_cache != dso_symbol, 0))
+ {
+ ElfW(Addr) caller = (ElfW(Addr)) dso_symbol;
+
+ struct link_map *l = _dl_find_dso_for_object (caller);
+
+ /* If the address is not recognized the call comes from the main
+ program (we hope). */
+ lm_cache = l ? l : GL(dl_ns)[LM_ID_BASE]._ns_loaded;
+ }
+ /* A destructor could result in a thread_local construction and the former
+ could have cleared the flag. */
+ if (lm_cache->l_type == lt_loaded && lm_cache->l_tls_dtor_count == 0)
+ lm_cache->l_flags_1 |= DF_1_NODELETE;
+
+ new->map = lm_cache;
+ new->map->l_tls_dtor_count++;
+
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
+
+ return 0;
+}
+
+/* Call the destructors. This is called either when a thread returns from the
+ initial function or when the process exits via the exit(3) function. */
+void
+__call_tls_dtors (void)
+{
+ while (tls_dtor_list)
+ {
+ struct dtor_list *cur = tls_dtor_list;
+ tls_dtor_list = tls_dtor_list->next;
+
+ cur->func (cur->obj);
+
+ __rtld_lock_lock_recursive (GL(dl_load_lock));
+
+ /* Allow DSO unload if count drops to zero. */
+ cur->map->l_tls_dtor_count--;
+ if (cur->map->l_tls_dtor_count == 0 && cur->map->l_type == lt_loaded)
+ cur->map->l_flags_1 &= ~DF_1_NODELETE;
+
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
+
+ free (cur);
+ }
+}
+libc_hidden_def (__call_tls_dtors)
diff --git a/libc/stdlib/exit.c b/libc/stdlib/exit.c
index e9a2139f4..2e86caa2d 100644
--- a/libc/stdlib/exit.c
+++ b/libc/stdlib/exit.c
@@ -33,6 +33,9 @@ attribute_hidden
__run_exit_handlers (int status, struct exit_function_list **listp,
bool run_list_atexit)
{
+ /* First, call the TLS destructors. */
+ __call_tls_dtors ();
+
/* We do it this way to handle recursive calls to exit () made by
the functions registered with `atexit' and `on_exit'. We call
everyone on the list and use the status value in the last
diff --git a/libc/stdlib/getenv.c b/libc/stdlib/getenv.c
index ee9d2b39d..f33c22f44 100644
--- a/libc/stdlib/getenv.c
+++ b/libc/stdlib/getenv.c
@@ -48,11 +48,7 @@ getenv (name)
#if __BYTE_ORDER == __LITTLE_ENDIAN || !_STRING_ARCH_unaligned
name_start = ('=' << 8) | *(const unsigned char *) name;
#else
-# if __BYTE_ORDER == __BIG_ENDIAN
name_start = '=' | ((*(const unsigned char *) name) << 8);
-# else
- #error "Funny byte order."
-# endif
#endif
for (ep = __environ; *ep != NULL; ++ep)
{
diff --git a/libc/stdlib/stdlib.h b/libc/stdlib/stdlib.h
index b49a41cc5..f7a818aa6 100644
--- a/libc/stdlib/stdlib.h
+++ b/libc/stdlib/stdlib.h
@@ -507,7 +507,7 @@ extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
#ifdef __USE_ISOC11
/* ISO C variant of aligned allocation. */
extern void *aligned_alloc (size_t __alignment, size_t __size)
- __THROW __wur __attribute__ ((__malloc__, __alloc_size__ (2)));
+ __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
#endif
__BEGIN_NAMESPACE_STD
@@ -756,6 +756,10 @@ extern void *bsearch (const void *__key, const void *__base,
size_t __nmemb, size_t __size, __compar_fn_t __compar)
__nonnull ((1, 2, 5)) __wur;
+#ifdef __USE_EXTERN_INLINES
+# include <bits/stdlib-bsearch.h>
+#endif
+
/* Sort NMEMB elements of BASE, of SIZE bytes each,
using COMPAR to perform the comparisons. */
extern void qsort (void *__base, size_t __nmemb, size_t __size,
diff --git a/libc/stdlib/strtod_l.c b/libc/stdlib/strtod_l.c
index a47b8fd3a..b311cc5fb 100644
--- a/libc/stdlib/strtod_l.c
+++ b/libc/stdlib/strtod_l.c
@@ -445,28 +445,30 @@ str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
/* Shift {PTR, SIZE} COUNT bits to the left, and fill the vacated bits
with the COUNT most significant bits of LIMB.
- Tege doesn't like this function so I have to write it here myself. :)
+ Implemented as a macro, so that __builtin_constant_p works even at -O0.
+
+ Tege doesn't like this macro so I have to write it here myself. :)
--drepper */
-static inline void
-__attribute ((always_inline))
-__mpn_lshift_1 (mp_limb_t *ptr, mp_size_t size, unsigned int count,
- mp_limb_t limb)
-{
- if (__builtin_constant_p (count) && count == BITS_PER_MP_LIMB)
- {
- /* Optimize the case of shifting by exactly a word:
- just copy words, with no actual bit-shifting. */
- mp_size_t i;
- for (i = size - 1; i > 0; --i)
- ptr[i] = ptr[i - 1];
- ptr[0] = limb;
- }
- else
- {
- (void) __mpn_lshift (ptr, ptr, size, count);
- ptr[0] |= limb >> (BITS_PER_MP_LIMB - count);
- }
-}
+#define __mpn_lshift_1(ptr, size, count, limb) \
+ do \
+ { \
+ mp_limb_t *__ptr = (ptr); \
+ if (__builtin_constant_p (count) && count == BITS_PER_MP_LIMB) \
+ { \
+ mp_size_t i; \
+ for (i = (size) - 1; i > 0; --i) \
+ __ptr[i] = __ptr[i - 1]; \
+ __ptr[0] = (limb); \
+ } \
+ else \
+ { \
+ /* We assume count > 0 && count < BITS_PER_MP_LIMB here. */ \
+ unsigned int __count = (count); \
+ (void) __mpn_lshift (__ptr, __ptr, size, __count); \
+ __ptr[0] |= (limb) >> (BITS_PER_MP_LIMB - __count); \
+ } \
+ } \
+ while (0)
#define INTERNAL(x) INTERNAL1(x)
diff --git a/libc/sysdeps/unix/sysv/linux/x86/bits/wchar.h b/libc/stdlib/tst-tls-atexit-lib.c
index 16b8b77c8..9c7021aea 100644
--- a/libc/sysdeps/unix/sysv/linux/x86/bits/wchar.h
+++ b/libc/stdlib/tst-tls-atexit-lib.c
@@ -1,5 +1,5 @@
-/* wchar_t type related definitions. i386/x86-64 version.
- Copyright (C) 2000-2013 Free Software Foundation, Inc.
+/* Verify that DSO is unloaded only if its TLS objects are destroyed - the DSO.
+ Copyright (C) 2013 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
@@ -16,17 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _BITS_WCHAR_H
-#define _BITS_WCHAR_H 1
+extern void *__dso_handle;
-#include <bits/wordsize.h>
+typedef struct
+{
+ void *val;
+} A;
-#if __WORDSIZE == 64
-# define __WCHAR_MIN (-2147483647 - 1)
-# define __WCHAR_MAX (2147483647)
-#else
-# define __WCHAR_MIN (-2147483647l - 1l)
-# define __WCHAR_MAX (2147483647l)
-#endif
+/* We only care about the destructor. */
+void A_dtor (void *obj)
+{
+ ((A *)obj)->val = obj;
+}
-#endif /* bits/wchar.h */
+void do_foo (void)
+{
+ static __thread A b;
+ __cxa_thread_atexit_impl (A_dtor, &b, __dso_handle);
+}
diff --git a/libc/stdlib/tst-tls-atexit.c b/libc/stdlib/tst-tls-atexit.c
new file mode 100644
index 000000000..3d3777c31
--- /dev/null
+++ b/libc/stdlib/tst-tls-atexit.c
@@ -0,0 +1,111 @@
+/* Verify that DSO is unloaded only if its TLS objects are destroyed.
+ Copyright (C) 2013 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/>. */
+
+/* There are two tests in this test case. The first is implicit where it is
+ assumed that the destructor call on exit of the LOAD function does not
+ segfault. The other is a verification that after the thread has exited, a
+ dlclose will unload the DSO. */
+
+#include <dlfcn.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+void *handle;
+pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
+
+void *
+load (void *u)
+{
+ pthread_mutex_lock (&m);
+ handle = dlopen ("$ORIGIN/tst-tls-atexit-lib.so", RTLD_LAZY);
+ if (!handle)
+ {
+ printf ("Unable to load DSO: %s\n", dlerror ());
+ return (void *) (uintptr_t) 1;
+ }
+
+ void (*foo) (void) = (void (*) (void)) dlsym(handle, "do_foo");
+
+ if (!foo)
+ {
+ printf ("Unable to find symbol: %s\n", dlerror ());
+ exit (1);
+ }
+
+ foo ();
+
+ /* This should not unload the DSO. If it does, then the thread exit will
+ result in a segfault. */
+ dlclose (handle);
+ pthread_mutex_unlock (&m);
+
+ return NULL;
+}
+
+int
+main (void)
+{
+ pthread_t t;
+ int ret;
+ void *thr_ret;
+
+ if ((ret = pthread_create (&t, NULL, load, NULL)) != 0)
+ {
+ printf ("pthread_create failed: %s\n", strerror (ret));
+ return 1;
+ }
+
+ if ((ret = pthread_join (t, &thr_ret)) != 0)
+ {
+ printf ("pthread_create failed: %s\n", strerror (ret));
+ return 1;
+ }
+
+ if (thr_ret != NULL)
+ return 1;
+
+ /* Now this should unload the DSO. */
+ dlclose (handle);
+
+ /* Run through our maps and ensure that the DSO is unloaded. */
+ FILE *f = fopen ("/proc/self/maps", "r");
+
+ if (f == NULL)
+ {
+ perror ("Failed to open /proc/self/maps");
+ fprintf (stderr, "Skipping verification of DSO unload\n");
+ return 0;
+ }
+
+ char *line = NULL;
+ size_t s = 0;
+ while (getline (&line, &s, f) > 0)
+ {
+ if (strstr (line, "tst-tls-atexit-lib.so"))
+ {
+ printf ("DSO not unloaded yet:\n%s", line);
+ return 1;
+ }
+ }
+ free (line);
+
+ return 0;
+}
diff --git a/libc/string/Makefile b/libc/string/Makefile
index 6447543c3..2991e1fed 100644
--- a/libc/string/Makefile
+++ b/libc/string/Makefile
@@ -45,10 +45,6 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
routines-$(OPTION_EGLIBC_ENVZ) += envz
-# Gcc internally generates calls to unbounded memcpy and memset
-# for -fbounded-pointer compiles. Glibc uses memchr for explicit checks.
-o-objects.ob := memcpy.o memset.o memchr.o
-
strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \
stpcpy stpncpy strcat strchr strcmp strcpy strcspn \
strlen strncmp strncpy strpbrk strrchr strspn memmem \
@@ -81,8 +77,6 @@ CFLAGS-tst-strlen.c = -fno-builtin
CFLAGS-stratcliff.c = -fno-builtin
CFLAGS-test-ffs.c = -fno-builtin
CFLAGS-tst-inlcall.c = -fno-builtin
-CFLAGS-bug-strstr1.c = -fno-builtin
-CFLAGS-bug-strcasestr1.c = -fno-builtin
ifeq ($(run-built-tests),yes)
tests: $(objpfx)tst-svc.out
diff --git a/libc/string/Versions b/libc/string/Versions
index f145fd34a..59bf35a3b 100644
--- a/libc/string/Versions
+++ b/libc/string/Versions
@@ -7,8 +7,8 @@ libc {
__bzero; __strtok_r;
# functions used in other libraries
- __stpncpy; __stpcpy; __strdup; __mempcpy; __strcasecmp; __strerror_r;
- __ffs;
+ __ffs; __mempcpy; __stpncpy; __stpcpy; __strcasecmp; __strdup;
+ __strerror_r;
# a*
argz_add; argz_add_sep; argz_append; argz_count; argz_create;
diff --git a/libc/string/bits/string2.h b/libc/string/bits/string2.h
index 8b6a36fab..94f5ee917 100644
--- a/libc/string/bits/string2.h
+++ b/libc/string/bits/string2.h
@@ -21,7 +21,7 @@
# error "Never use <bits/string2.h> directly; include <string.h> instead."
#endif
-#if !defined __NO_STRING_INLINES && !defined __BOUNDED_POINTERS__
+#ifndef __NO_STRING_INLINES
/* Unlike the definitions in the header <bits/string.h> the
definitions contained here are not optimized down to assembler
diff --git a/libc/string/memchr.c b/libc/string/memchr.c
index d4c845779..2427c4b4b 100644
--- a/libc/string/memchr.c
+++ b/libc/string/memchr.c
@@ -47,11 +47,6 @@
#endif
#include <sys/types.h>
-#if HAVE_BP_SYM_H || defined _LIBC
-#include <bp-sym.h>
-#else
-# define BP_SYM(sym) sym
-#endif
#undef memchr
#undef __memchr
@@ -203,6 +198,6 @@ __memchr (s, c_in, n)
return 0;
}
#ifdef weak_alias
-weak_alias (__memchr, BP_SYM (memchr))
+weak_alias (__memchr, memchr)
#endif
libc_hidden_builtin_def (memchr)
diff --git a/libc/string/memcmp.c b/libc/string/memcmp.c
index 2a73b1c31..dd76145f0 100644
--- a/libc/string/memcmp.c
+++ b/libc/string/memcmp.c
@@ -88,9 +88,6 @@ typedef unsigned char byte;
static int memcmp_bytes (op_t, op_t) __THROW;
-# ifdef __GNUC__
-__inline
-# endif
static int
memcmp_bytes (a, b)
op_t a, b;
diff --git a/libc/string/mempcpy.c b/libc/string/mempcpy.c
index ba4d1c6bc..c0d244820 100644
--- a/libc/string/mempcpy.c
+++ b/libc/string/mempcpy.c
@@ -20,48 +20,14 @@
<http://www.gnu.org/licenses/>. */
#include <string.h>
-#include <memcopy.h>
-#include <pagecopy.h>
#undef mempcpy
#undef __mempcpy
void *
-__mempcpy (dstpp, srcpp, len)
- void *dstpp;
- const void *srcpp;
- size_t len;
+__mempcpy (void *dest, const void *src, size_t len)
{
- unsigned long int dstp = (long int) dstpp;
- unsigned long int srcp = (long int) srcpp;
-
- /* Copy from the beginning to the end. */
-
- /* If there not too few bytes to copy, use word copy. */
- if (len >= OP_T_THRES)
- {
- /* Copy just a few bytes to make DSTP aligned. */
- len -= (-dstp) % OPSIZ;
- BYTE_COPY_FWD (dstp, srcp, (-dstp) % OPSIZ);
-
- /* Copy whole pages from SRCP to DSTP by virtual address manipulation,
- as much as possible. */
-
- PAGE_COPY_FWD_MAYBE (dstp, srcp, len, len);
-
- /* Copy from SRCP to DSTP taking advantage of the known alignment of
- DSTP. Number of bytes remaining is put in the third argument,
- i.e. in LEN. This number may vary from machine to machine. */
-
- WORD_COPY_FWD (dstp, srcp, len, len);
-
- /* Fall out and copy the tail. */
- }
-
- /* There are just a few bytes to copy. Use byte memory operations. */
- BYTE_COPY_FWD (dstp, srcp, len);
-
- return (void *) dstp;
+ return memcpy (dest, src, len) + len;
}
libc_hidden_def (__mempcpy)
weak_alias (__mempcpy, mempcpy)
diff --git a/libc/string/str-two-way.h b/libc/string/str-two-way.h
index 8912f24e5..1cc20ee47 100644
--- a/libc/string/str-two-way.h
+++ b/libc/string/str-two-way.h
@@ -19,7 +19,7 @@
/* Before including this file, you need to include <string.h> (and
<config.h> before that, if not part of libc), and define:
- RESULT_TYPE A macro that expands to the return type.
+ RETURN_TYPE A macro that expands to the return type.
AVAILABLE(h, h_l, j, n_l)
A macro that returns nonzero if there are
at least N_L bytes left starting at H[J].
@@ -37,7 +37,11 @@
The argument is an 'unsigned char'; the result
must be an 'unsigned char' as well.
- This file undefines the macros documented above, and defines
+ Other macros you may optionally define:
+ RET0_IF_0(a) Documented below at default definition.
+ CHECK_EOL Same.
+
+ This file undefines the macros listed above, and defines
LONG_NEEDLE_THRESHOLD.
*/
@@ -516,10 +520,8 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
}
#undef AVAILABLE
-#undef AVAILABLE1
-#undef AVAILABLE2
-#undef AVAILABLE1_USES_J
#undef CANON_ELEMENT
#undef CMP_FUNC
#undef RET0_IF_0
#undef RETURN_TYPE
+#undef CHECK_EOL
diff --git a/libc/string/strcpy.c b/libc/string/strcpy.c
index a2bb8efcb..b71f7536b 100644
--- a/libc/string/strcpy.c
+++ b/libc/string/strcpy.c
@@ -18,7 +18,6 @@
#include <stddef.h>
#include <string.h>
#include <memcopy.h>
-#include <bp-checks.h>
#undef strcpy
@@ -29,9 +28,8 @@ strcpy (dest, src)
const char *src;
{
char c;
- char *__unbounded s = (char *__unbounded) CHECK_BOUNDS_LOW (src);
- const ptrdiff_t off = CHECK_BOUNDS_LOW (dest) - s - 1;
- size_t n;
+ char *s = (char *) src;
+ const ptrdiff_t off = dest - s - 1;
do
{
@@ -40,10 +38,6 @@ strcpy (dest, src)
}
while (c != '\0');
- n = s - src;
- (void) CHECK_BOUNDS_HIGH (src + n);
- (void) CHECK_BOUNDS_HIGH (dest + n);
-
return dest;
}
libc_hidden_builtin_def (strcpy)
diff --git a/libc/sysdeps/generic/bp-checks.h b/libc/sysdeps/generic/bp-checks.h
deleted file mode 100644
index a6bfbaaed..000000000
--- a/libc/sysdeps/generic/bp-checks.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* Bounded-pointer checking macros for C.
- Copyright (C) 2000-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Greg McGary <greg@mcgary.org>
-
- 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 _bp_checks_h_
-#define _bp_checks_h_ 1
-
-#if __BOUNDED_POINTERS__
-
-# define BOUNDS_VIOLATED (__builtin_trap (), 0)
-
-/* Verify that pointer's value >= low. Return pointer value. */
-# define CHECK_BOUNDS_LOW(ARG) \
- (((__ptrvalue (ARG) < __ptrlow (ARG)) && BOUNDS_VIOLATED), \
- __ptrvalue (ARG))
-
-/* Verify that pointer's value < high. Return pointer value. */
-# define CHECK_BOUNDS_HIGH(ARG) \
- (((__ptrvalue (ARG) > __ptrhigh (ARG)) && BOUNDS_VIOLATED), \
- __ptrvalue (ARG))
-
-# define _CHECK_N(ARG, N, COND) \
- (((COND) \
- && (__ptrvalue (ARG) < __ptrlow (ARG) \
- || __ptrvalue (ARG) + (N) > __ptrhigh (ARG)) \
- && BOUNDS_VIOLATED), \
- __ptrvalue (ARG))
-
-extern void *__unbounded __ubp_memchr (const void *__unbounded, int, unsigned);
-
-# define _CHECK_STRING(ARG, COND) \
- (((COND) \
- && (__ptrvalue (ARG) < __ptrlow (ARG) \
- || !__ubp_memchr (__ptrvalue (ARG), '\0', \
- (__ptrhigh (ARG) - __ptrvalue (ARG)))) \
- && BOUNDS_VIOLATED), \
- __ptrvalue (ARG))
-
-/* Check bounds of a pointer seated to an array of N objects. */
-# define CHECK_N(ARG, N) _CHECK_N ((ARG), (N), 1)
-/* Same as CHECK_N, but tolerate ARG == NULL. */
-# define CHECK_N_NULL_OK(ARG, N) _CHECK_N ((ARG), (N), __ptrvalue (ARG))
-
-/* Check bounds of a pointer seated to a single object. */
-# define CHECK_1(ARG) CHECK_N ((ARG), 1)
-/* Same as CHECK_1, but tolerate ARG == NULL. */
-# define CHECK_1_NULL_OK(ARG) CHECK_N_NULL_OK ((ARG), 1)
-
-/* Check for NUL-terminator within string's bounds. */
-# define CHECK_STRING(ARG) _CHECK_STRING ((ARG), 1)
-/* Same as CHECK_STRING, but tolerate ARG == NULL. */
-# define CHECK_STRING_NULL_OK(ARG) _CHECK_STRING ((ARG), __ptrvalue (ARG))
-
-/* Check bounds of signal syscall args with type sigset_t. */
-# define CHECK_SIGSET(SET) CHECK_N ((SET), _NSIG / (8 * sizeof *(SET)))
-/* Same as CHECK_SIGSET, but tolerate SET == NULL. */
-# define CHECK_SIGSET_NULL_OK(SET) CHECK_N_NULL_OK ((SET), _NSIG / (8 * sizeof *(SET)))
-
-# if defined (_IOC_SIZESHIFT) && defined (_IOC_SIZEBITS)
-/* Extract the size of the ioctl data and check its bounds. */
-# define CHECK_IOCTL(ARG, CMD) \
- CHECK_N ((const char *) (ARG), \
- (((CMD) >> _IOC_SIZESHIFT) & ((1 << _IOC_SIZEBITS) - 1)))
-# else
-/* We don't know the size of the ioctl data, so the best we can do
- is check that the first byte is within bounds. */
-# define CHECK_IOCTL(ARG, CMD) CHECK_1 ((const char *) ARG)
-# endif
-
-/* Check bounds of `struct flock *' for the locking fcntl commands. */
-# define CHECK_FCNTL(ARG, CMD) \
- (((CMD) == F_GETLK || (CMD) == F_SETLK || (CMD) == F_SETLKW) \
- ? CHECK_1 ((struct flock *) ARG) : (unsigned long) (ARG))
-
-/* Check bounds of an array of mincore residency-status flags that
- cover a region of NBYTES. Such a vector occupies one byte per page
- of memory. */
-# define CHECK_N_PAGES(ARG, NBYTES) \
- ({ int _page_size_ = sysconf (_SC_PAGE_SIZE); \
- CHECK_N ((const char *) (ARG), \
- ((NBYTES) + _page_size_ - 1) / _page_size_); })
-
-/* Return a bounded pointer with value PTR that satisfies CHECK_N (PTR, N). */
-# define BOUNDED_N(PTR, N) \
- ({ __typeof (PTR) __bounded _p_; \
- __ptrvalue _p_ = __ptrlow _p_ = __ptrvalue (PTR); \
- __ptrhigh _p_ = __ptrvalue _p_ + (N); \
- _p_; })
-
-#else /* !__BOUNDED_POINTERS__ */
-
-/* Do nothing if not compiling with -fbounded-pointers. */
-
-# define BOUNDS_VIOLATED
-# define CHECK_BOUNDS_LOW(ARG) (ARG)
-# define CHECK_BOUNDS_HIGH(ARG) (ARG)
-# define CHECK_1(ARG) (ARG)
-# define CHECK_1_NULL_OK(ARG) (ARG)
-# define CHECK_N(ARG, N) (ARG)
-# define CHECK_N_NULL_OK(ARG, N) (ARG)
-# define CHECK_STRING(ARG) (ARG)
-# define CHECK_SIGSET(SET) (SET)
-# define CHECK_SIGSET_NULL_OK(SET) (SET)
-# define CHECK_IOCTL(ARG, CMD) (ARG)
-# define CHECK_FCNTL(ARG, CMD) (ARG)
-# define CHECK_N_PAGES(ARG, NBYTES) (ARG)
-# define BOUNDED_N(PTR, N) (PTR)
-
-#endif /* !__BOUNDED_POINTERS__ */
-
-#define BOUNDED_1(PTR) BOUNDED_N (PTR, 1)
-
-#endif /* _bp_checks_h_ */
diff --git a/libc/sysdeps/generic/bp-semctl.h b/libc/sysdeps/generic/bp-semctl.h
deleted file mode 100644
index 1f3ab92c6..000000000
--- a/libc/sysdeps/generic/bp-semctl.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Bounded-pointer checking macros for C.
- Copyright (C) 2000-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Greg McGary <greg@mcgary.org>
-
- 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 _bp_semctl_h_
-#define _bp_semctl_h_ 1
-
-#if __BOUNDED_POINTERS__
-
-# define CHECK_SEMCTL(ARGP, SEMID, CMD) check_semctl (ARGP, SEMID, CMD)
-
-union semun *__unbounded
-check_semctl (union semun *arg, int semid, int cmd)
-{
- int ipc64 = (cmd & __IPC_64);
-
- switch (cmd & ~__IPC_64)
- {
- case IPC_STAT:
- case IPC_SET:
- (void) CHECK_1 (arg->buf);
- break;
-
- case GETALL:
- case SETALL:
- {
- struct semid_ds ds;
- union semun un = { .buf = &ds };
- unsigned int length = ~0;
-
- /* It's unfortunate that we need to make a recursive
- system call to get the size of the semaphore set... */
- if (semctl (semid, 0, IPC_STAT | ipc64, un) == 0)
- length = ds.sem_nsems;
- (void) CHECK_N (arg->array, length);
- break;
- }
-
- case IPC_INFO:
- (void) CHECK_1 (arg->__buf);
- break;
- }
-
- return __ptrvalue (arg);
-}
-
-#else
-# define CHECK_SEMCTL(ARGP, SEMID, CMD) (ARGP)
-#endif
-
-#endif /* _bp_semctl_h_ */
diff --git a/libc/sysdeps/generic/bp-start.h b/libc/sysdeps/generic/bp-start.h
deleted file mode 100644
index 069d616d2..000000000
--- a/libc/sysdeps/generic/bp-start.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Bounded-pointer checking macros for C.
- Copyright (C) 2000-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Greg McGary <greg@mcgary.org>
-
- 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 __BOUNDED_POINTERS__
-
- /* The command-line arg vector and environment vector come to us from
- the OS as an unbounded pointer to an array of unbounded strings.
- The user's main expects argv and __environ to be bounded pointers
- to arrays of bounded strings. */
-# define INIT_ARGV_and_ENVIRON \
- do { \
- int envc; \
- for (envc = 0; *ubp_ev; ubp_ev++, envc++) \
- ; \
- ubp_ev -= envc; \
- \
- /* GKM FIXME: we could save some space by allocating only enough for \
- the additional low & high words, and destructively rewriting \
- argv in place. */ \
- __ptrvalue (argv) = __ptrlow (argv) \
- = alloca ((argc + envc + 2) * sizeof (*argv)); \
- __ptrhigh (argv) = __ptrvalue (argv) + argc + 1; \
- __ptrvalue (__environ) = __ptrlow (__environ) = __ptrhigh (argv); \
- __ptrhigh (__environ) = __ptrvalue (__environ) + envc + 1; \
- boundify_vector (__environ, ubp_ev); \
- boundify_vector (argv, ubp_av); \
- } while (0)
-
-
-/* Copy an unbounded vector of unbounded strings into a bounded
- counterpart. */
-
-static void
-boundify_vector (char **dest, char *__unbounded *__unbounded src)
-{
- char *__unbounded s;
- for (; *src; src++, dest++)
- {
- __ptrvalue (*dest) = __ptrlow (*dest) = *src;
- __ptrhigh (*dest) = src[1];
- }
- *dest = 0;
- /* The OS lays out strings contiguously in vector order,
- so */
- for (s = __ptrvalue (dest[-1]); *s; s++)
- ;
- __ptrhigh (dest[-1]) = ++s;
-}
-
-#else
-
-# define INIT_ARGV_and_ENVIRON __environ = ubp_ev
-
-#endif
diff --git a/libc/sysdeps/generic/bp-thunks.h b/libc/sysdeps/generic/bp-thunks.h
deleted file mode 100644
index 8e4e11d50..000000000
--- a/libc/sysdeps/generic/bp-thunks.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Bounded-pointer syscall thunk support.
- Copyright (C) 2000-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Greg McGary <greg@mcgary.org>
-
- 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 _bpthunks_h_
-#define _bpthunks_h_
-
-#ifndef __ASSEMBLER__
-
-/* This header is included by the syscall BP thunks defined in
- sysd-syscalls, as created by sysdeps/unix/make-syscalls.sh. It
- includes all headers that contain prototype declarations for system
- call functions. */
-
-#include <libc-symbols.h>
-#include <bp-sym.h>
-#include <bp-checks.h>
-
-/* Get `struct timeval' definition for select. */
-#define __need_timeval
-#include <bits/time.h>
-
-#include <stddef.h>
-#include <unistd.h>
-#include <sched.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <time.h>
-#include <utime.h>
-#include <stdio.h>
-
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/klog.h>
-#include <sys/mman.h>
-#include <sys/mount.h>
-#include <sys/quota.h>
-#include <sys/resource.h>
-#include <sys/select.h>
-#include <io/sys/sendfile.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/statfs.h>
-#include <sys/swap.h>
-#include <sys/sysinfo.h>
-#include <sys/time.h>
-#include <sys/times.h>
-#include <sys/timex.h>
-#include <sys/utsname.h>
-#include <sys/wait.h>
-
-#endif /* Not __ASSEMBLER__. */
-
-#endif /* _bpthunks_h_ */
diff --git a/libc/sysdeps/generic/frame.h b/libc/sysdeps/generic/frame.h
index e6dfc72f3..cae84ef3e 100644
--- a/libc/sysdeps/generic/frame.h
+++ b/libc/sysdeps/generic/frame.h
@@ -18,6 +18,6 @@
struct layout
{
- void *__unbounded next;
- void *__unbounded return_address;
+ void *next;
+ void *return_address;
};
diff --git a/libc/sysdeps/generic/ldconfig.h b/libc/sysdeps/generic/ldconfig.h
index 57a9a468a..ca3f0e430 100644
--- a/libc/sysdeps/generic/ldconfig.h
+++ b/libc/sysdeps/generic/ldconfig.h
@@ -36,6 +36,7 @@
#define FLAG_X8664_LIBX32 0x0800
#define FLAG_ARM_LIBHF 0x0900
#define FLAG_AARCH64_LIB64 0x0a00
+#define FLAG_ARM_LIBSF 0x0b00
/* Name of auxiliary cache. */
#define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
@@ -83,12 +84,6 @@ extern int opt_verbose;
extern int opt_format;
/* Prototypes for a few program-wide used functions. */
-extern void *xmalloc (size_t n)
- __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
- __attribute_malloc__ __attribute_alloc_size (1, 2);
-extern void *xrealloc (void *o, size_t n)
- __attribute_malloc__ __attribute_alloc_size (2);
-extern char *xstrdup (const char *) __attribute_malloc__;
+#include <programs/xmalloc.h>
#endif /* ! _LDCONFIG_H */
diff --git a/libc/sysdeps/generic/ldsodefs.h b/libc/sysdeps/generic/ldsodefs.h
index d61824f08..1781574a9 100644
--- a/libc/sysdeps/generic/ldsodefs.h
+++ b/libc/sysdeps/generic/ldsodefs.h
@@ -546,7 +546,7 @@ struct rtld_global_ro
EXTERN uintptr_t _dl_sysinfo;
#endif
-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+#ifdef NEED_DL_SYSINFO_DSO
/* The vsyscall page is a virtual DSO pre-mapped by the kernel.
This points to its ELF header. */
EXTERN const ElfW(Ehdr) *_dl_sysinfo_dso;
@@ -1014,6 +1014,10 @@ extern int _dl_addr_inside_object (struct link_map *l, const ElfW(Addr) addr)
/* Show show of an object. */
extern void _dl_show_scope (struct link_map *new, int from);
+extern struct link_map *_dl_find_dso_for_object (const ElfW(Addr) addr)
+ internal_function;
+rtld_hidden_proto (_dl_find_dso_for_object)
+
__END_DECLS
#endif /* ldsodefs.h */
diff --git a/libc/sysdeps/generic/malloc-sysdep.h b/libc/sysdeps/generic/malloc-sysdep.h
index 3f7892b15..18980bc82 100644
--- a/libc/sysdeps/generic/malloc-sysdep.h
+++ b/libc/sysdeps/generic/malloc-sysdep.h
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <stdbool.h>
+#include <unistd.h>
+
/* Force an unmap when the heap shrinks in a secure exec. This ensures that
the old data pages immediately cease to be accessible. */
static inline bool
diff --git a/libc/sysdeps/gnu/bits/msq.h b/libc/sysdeps/gnu/bits/msq.h
index 33f16a54e..ca70acd52 100644
--- a/libc/sysdeps/gnu/bits/msq.h
+++ b/libc/sysdeps/gnu/bits/msq.h
@@ -38,13 +38,13 @@ typedef unsigned short int msglen_t;
struct msqid_ds
{
struct ipc_perm msg_perm; /* structure describing operation permission */
- struct msg *__unbounded __msg_first; /* pointer to first message on queue */
- struct msg *__unbounded __msg_last; /* pointer to last message on queue */
+ struct msg *__msg_first; /* pointer to first message on queue */
+ struct msg *__msg_last; /* pointer to last message on queue */
__time_t msg_stime; /* time of last msgsnd command */
__time_t msg_rtime; /* time of last msgrcv command */
__time_t msg_ctime; /* time of last change */
- struct wait_queue *__unbounded __wwait; /* ??? */
- struct wait_queue *__unbounded __rwait; /* ??? */
+ struct wait_queue *__wwait; /* ??? */
+ struct wait_queue *__rwait; /* ??? */
unsigned short int __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 */
diff --git a/libc/sysdeps/i386/add_n.S b/libc/sysdeps/i386/add_n.S
index f5ac4e9a7..dddbe7dd1 100644
--- a/libc/sysdeps/i386/add_n.S
+++ b/libc/sysdeps/i386/add_n.S
@@ -19,18 +19,15 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+8 /* space for 2 saved regs */
+#define PARMS 4+8 /* space for 2 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define S2 S1+PTR_SIZE
-#define SIZE S2+PTR_SIZE
+#define S1 RES+4
+#define S2 S1+4
+#define SIZE S2+4
.text
-ENTRY (BP_SYM (__mpn_add_n))
- ENTER
+ENTRY (__mpn_add_n)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -43,13 +40,6 @@ ENTRY (BP_SYM (__mpn_add_n))
cfi_rel_offset (esi, 0)
movl S2(%esp),%edx
movl SIZE(%esp),%ecx
-#if __BOUNDED_POINTERS__
- shll $2, %ecx /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, S1(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%edx, S2(%esp), %ecx)
- shrl $2, %ecx
-#endif
movl %ecx,%eax
shrl $3,%ecx /* compute count for unrolled loop */
negl %eax
@@ -117,6 +107,5 @@ L(oop): movl (%esi),%eax
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (__mpn_add_n))
+END (__mpn_add_n)
diff --git a/libc/sysdeps/i386/addmul_1.S b/libc/sysdeps/i386/addmul_1.S
index c18666fbe..ee2a78b47 100644
--- a/libc/sysdeps/i386/addmul_1.S
+++ b/libc/sysdeps/i386/addmul_1.S
@@ -19,13 +19,11 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+16 /* space for 4 saved regs */
+#define PARMS 4+16 /* space for 4 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define SIZE S1+PTR_SIZE
+#define S1 RES+4
+#define SIZE S1+4
#define S2LIMB SIZE+4
#define res_ptr edi
@@ -34,8 +32,7 @@
#define s2_limb ebx
.text
-ENTRY (BP_SYM (__mpn_addmul_1))
- ENTER
+ENTRY (__mpn_addmul_1)
pushl %res_ptr
cfi_adjust_cfa_offset (4)
@@ -53,12 +50,6 @@ ENTRY (BP_SYM (__mpn_addmul_1))
movl SIZE(%esp), %sizeP
movl S2LIMB(%esp), %s2_limb
cfi_rel_offset (s2_limb, 0)
-#if __BOUNDED_POINTERS__
- shll $2, %sizeP /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%res_ptr, RES(%esp), %sizeP)
- CHECK_BOUNDS_BOTH_WIDE (%s1_ptr, S1(%esp), %sizeP)
- shrl $2, %sizeP
-#endif
leal (%res_ptr,%sizeP,4), %res_ptr
leal (%s1_ptr,%sizeP,4), %s1_ptr
negl %sizeP
@@ -91,6 +82,5 @@ L(oop):
cfi_adjust_cfa_offset (-4)
cfi_restore (res_ptr)
- LEAVE
ret
-END (BP_SYM (__mpn_addmul_1))
+END (__mpn_addmul_1)
diff --git a/libc/sysdeps/i386/bp-asm.h b/libc/sysdeps/i386/bp-asm.h
deleted file mode 100644
index 2026b24f8..000000000
--- a/libc/sysdeps/i386/bp-asm.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Bounded-pointer definitions for x86 assembler.
- Copyright (C) 2000-2013 Free Software Foundation, Inc.
- Contributed by Greg McGary <greg@mcgary.org>
- This file is part of the GNU C Library. Its master source is NOT part of
- the C library, however. The master source lives in the GNU MP 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 _bp_asm_h_
-# define _bp_asm_h_ 1
-
-# if __ASSEMBLER__
-
-# if __BOUNDED_POINTERS__
-
-/* Bounded pointers occupy three words. */
-# define PTR_SIZE 12
-/* Bounded pointer return values are passed back through a hidden
- argument that points to caller-allocate space. The hidden arg
- occupies one word on the stack. */
-# define RTN_SIZE 4
-/* Although the caller pushes the hidden arg, the callee is
- responsible for popping it. */
-# define RET_PTR ret $RTN_SIZE
-/* Maintain frame pointer chain in leaf assembler functions for the benefit
- of debugging stack traces when bounds violations occur. */
-# define ENTER pushl %ebp; movl %esp, %ebp
-# define LEAVE movl %ebp, %esp; popl %ebp
-/* Stack space overhead of procedure-call linkage: return address and
- frame pointer. */
-# define LINKAGE 8
-/* Stack offset of return address after calling ENTER. */
-# define PCOFF 4
-
-/* Int 5 is the "bound range" exception also raised by the "bound"
- instruction. */
-# define BOUNDS_VIOLATED int $5
-
-# define CHECK_BOUNDS_LOW(VAL_REG, BP_MEM) \
- cmpl 4+BP_MEM, VAL_REG; \
- jae 0f; /* continue if value >= low */ \
- BOUNDS_VIOLATED; \
- 0:
-
-# define CHECK_BOUNDS_HIGH(VAL_REG, BP_MEM, Jcc) \
- cmpl 8+BP_MEM, VAL_REG; \
- Jcc 0f; /* continue if value < high */ \
- BOUNDS_VIOLATED; \
- 0:
-
-# define CHECK_BOUNDS_BOTH(VAL_REG, BP_MEM) \
- cmpl 4+BP_MEM, VAL_REG; \
- jb 1f; /* die if value < low */ \
- cmpl 8+BP_MEM, VAL_REG; \
- jb 0f; /* continue if value < high */ \
- 1: BOUNDS_VIOLATED; \
- 0:
-
-# define CHECK_BOUNDS_BOTH_WIDE(VAL_REG, BP_MEM, LENGTH) \
- CHECK_BOUNDS_LOW(VAL_REG, BP_MEM); \
- addl LENGTH, VAL_REG; \
- cmpl 8+BP_MEM, VAL_REG; \
- jbe 0f; /* continue if value <= high */ \
- BOUNDS_VIOLATED; \
- 0: subl LENGTH, VAL_REG /* restore value */
-
-/* Take bounds from BP_MEM and affix them to the pointer
- value in %eax, stuffing all into memory at RTN(%esp).
- Use %edx as a scratch register. */
-
-# define RETURN_BOUNDED_POINTER(BP_MEM) \
- movl RTN(%esp), %edx; \
- movl %eax, 0(%edx); \
- movl 4+BP_MEM, %eax; \
- movl %eax, 4(%edx); \
- movl 8+BP_MEM, %eax; \
- movl %eax, 8(%edx)
-
-# define RETURN_NULL_BOUNDED_POINTER \
- movl RTN(%esp), %edx; \
- movl %eax, 0(%edx); \
- movl %eax, 4(%edx); \
- movl %eax, 8(%edx)
-
-/* The caller of __errno_location is responsible for allocating space
- for the three-word BP return-value and passing pushing its address
- as an implicit first argument. */
-# define PUSH_ERRNO_LOCATION_RETURN \
- subl $8, %esp; \
- subl $4, %esp; \
- pushl %esp
-
-/* __errno_location is responsible for popping the implicit first
- argument, but we must pop the space for the BP itself. We also
- dereference the return value in order to dig out the pointer value. */
-# define POP_ERRNO_LOCATION_RETURN \
- popl %eax; \
- addl $8, %esp
-
-# else /* !__BOUNDED_POINTERS__ */
-
-/* Unbounded pointers occupy one word. */
-# define PTR_SIZE 4
-/* Unbounded pointer return values are passed back in the register %eax. */
-# define RTN_SIZE 0
-/* Use simple return instruction for unbounded pointer values. */
-# define RET_PTR ret
-/* Don't maintain frame pointer chain for leaf assembler functions. */
-# define ENTER
-# define LEAVE
-/* Stack space overhead of procedure-call linkage: return address only. */
-# define LINKAGE 4
-/* Stack offset of return address after calling ENTER. */
-# define PCOFF 0
-
-# define CHECK_BOUNDS_LOW(VAL_REG, BP_MEM)
-# define CHECK_BOUNDS_HIGH(VAL_REG, BP_MEM, Jcc)
-# define CHECK_BOUNDS_BOTH(VAL_REG, BP_MEM)
-# define CHECK_BOUNDS_BOTH_WIDE(VAL_REG, BP_MEM, LENGTH)
-# define RETURN_BOUNDED_POINTER(BP_MEM)
-
-# define RETURN_NULL_BOUNDED_POINTER
-
-# define PUSH_ERRNO_LOCATION_RETURN
-# define POP_ERRNO_LOCATION_RETURN
-
-# endif /* !__BOUNDED_POINTERS__ */
-
-# endif /* __ASSEMBLER__ */
-
-#endif /* _bp_asm_h_ */
diff --git a/libc/sysdeps/i386/bsd-_setjmp.S b/libc/sysdeps/i386/bsd-_setjmp.S
index ae52283b8..54483fea5 100644
--- a/libc/sysdeps/i386/bsd-_setjmp.S
+++ b/libc/sysdeps/i386/bsd-_setjmp.S
@@ -22,20 +22,16 @@
#include <sysdep.h>
#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 PARMS 4 /* no space for saved regs */
#define JMPBUF PARMS
-#define SIGMSK JMPBUF+PTR_SIZE
+#define SIGMSK JMPBUF+4
-ENTRY (BP_SYM (_setjmp))
- ENTER
+ENTRY (_setjmp)
xorl %eax, %eax
movl JMPBUF(%esp), %edx
- CHECK_BOUNDS_BOTH_WIDE (%edx, JMPBUF(%esp), $(JB_SIZE+4))
/* Save registers. */
movl %ebx, (JB_BX*4)(%edx)
@@ -46,16 +42,15 @@ ENTRY (BP_SYM (_setjmp))
PTR_MANGLE (%ecx)
#endif
movl %ecx, (JB_SP*4)(%edx)
- movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ movl 0(%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
movl %ecx, (JB_PC*4)(%edx)
- LEAVE
movl %ebp, (JB_BP*4)(%edx) /* Save caller's frame pointer. */
movl %eax, JB_SIZE(%edx) /* No signal mask set. */
ret
-END (BP_SYM (_setjmp))
+END (_setjmp)
libc_hidden_def (_setjmp)
diff --git a/libc/sysdeps/i386/bsd-setjmp.S b/libc/sysdeps/i386/bsd-setjmp.S
index a84582123..b6daa8c03 100644
--- a/libc/sysdeps/i386/bsd-setjmp.S
+++ b/libc/sysdeps/i386/bsd-setjmp.S
@@ -22,22 +22,18 @@
#include <sysdep.h>
#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 PARMS 4 /* no space for saved regs */
#define JMPBUF PARMS
-#define SIGMSK JMPBUF+PTR_SIZE
+#define SIGMSK JMPBUF+4
-ENTRY (BP_SYM (setjmp))
+ENTRY (setjmp)
/* Note that we have to use a non-exported symbol in the next
jump since otherwise gas will emit it as a jump through the
PLT which is what we cannot use here. */
- ENTER
movl JMPBUF(%esp), %eax
- CHECK_BOUNDS_BOTH_WIDE (%eax, JMPBUF(%esp), $JB_SIZE)
/* Save registers. */
movl %ebx, (JB_BX*4)(%eax)
@@ -48,13 +44,12 @@ ENTRY (BP_SYM (setjmp))
PTR_MANGLE (%ecx)
#endif
movl %ecx, (JB_SP*4)(%eax)
- movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ movl 0(%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
movl %ecx, (JB_PC*4)(%eax)
- LEAVE /* pop frame pointer to prepare for tail-call. */
movl %ebp, (JB_BP*4)(%eax) /* Save caller's frame pointer. */
/* Call __sigjmp_save. */
@@ -62,10 +57,10 @@ ENTRY (BP_SYM (setjmp))
cfi_adjust_cfa_offset (4)
pushl 8(%esp)
cfi_adjust_cfa_offset (4)
- call BP_SYM (__sigjmp_save)
+ call __sigjmp_save
popl %ecx
cfi_adjust_cfa_offset (-4)
popl %edx
cfi_adjust_cfa_offset (-4)
ret
-END (BP_SYM (setjmp))
+END (setjmp)
diff --git a/libc/sysdeps/i386/dl-machine.h b/libc/sysdeps/i386/dl-machine.h
index a1e40d8eb..0b4c46736 100644
--- a/libc/sysdeps/i386/dl-machine.h
+++ b/libc/sysdeps/i386/dl-machine.h
@@ -144,18 +144,16 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
#ifdef IN_DL_RUNTIME
-# if !defined PROF && !__BOUNDED_POINTERS__
+# ifndef PROF
/* We add a declaration of this function here so that in dl-runtime.c
the ELF_MACHINE_RUNTIME_TRAMPOLINE macro really can pass the parameters
in registers.
We cannot use this scheme for profiling because the _mcount call
destroys the passed register information. */
-/* GKM FIXME: Fix trampoline to pass bounds so we can do
- without the `__unbounded' qualifier. */
#define ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), stdcall, unused))
-extern ElfW(Addr) _dl_fixup (struct link_map *__unbounded l,
+extern ElfW(Addr) _dl_fixup (struct link_map *l,
ElfW(Word) reloc_offset)
ARCH_FIXUP_ATTRIBUTE;
extern ElfW(Addr) _dl_profile_fixup (struct link_map *l,
diff --git a/libc/sysdeps/i386/fpu/fegetenv.c b/libc/sysdeps/i386/fpu/fegetenv.c
index df7fced10..c650f9fe0 100644
--- a/libc/sysdeps/i386/fpu/fegetenv.c
+++ b/libc/sysdeps/i386/fpu/fegetenv.c
@@ -18,7 +18,6 @@
<http://www.gnu.org/licenses/>. */
#include <fenv.h>
-#include <bp-sym.h>
int
__fegetenv (fenv_t *envp)
@@ -36,8 +35,8 @@ __fegetenv (fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fegetenv, __old_fegetenv)
-compat_symbol (libm, BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2_1);
+compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
#endif
libm_hidden_ver (__fegetenv, fegetenv)
-versioned_symbol (libm, BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2_2);
+versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
diff --git a/libc/sysdeps/i386/fpu/fesetenv.c b/libc/sysdeps/i386/fpu/fesetenv.c
index aee1ee0b3..94178e13c 100644
--- a/libc/sysdeps/i386/fpu/fesetenv.c
+++ b/libc/sysdeps/i386/fpu/fesetenv.c
@@ -19,7 +19,6 @@
#include <fenv.h>
#include <assert.h>
-#include <bp-sym.h>
int
@@ -80,8 +79,8 @@ __fesetenv (const fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fesetenv, __old_fesetenv)
-compat_symbol (libm, BP_SYM (__old_fesetenv), BP_SYM (fesetenv), GLIBC_2_1);
+compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1);
#endif
libm_hidden_ver (__fesetenv, fesetenv)
-versioned_symbol (libm, BP_SYM (__fesetenv), BP_SYM (fesetenv), GLIBC_2_2);
+versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2);
diff --git a/libc/sysdeps/i386/fpu/feupdateenv.c b/libc/sysdeps/i386/fpu/feupdateenv.c
index e3659798e..b2a810add 100644
--- a/libc/sysdeps/i386/fpu/feupdateenv.c
+++ b/libc/sysdeps/i386/fpu/feupdateenv.c
@@ -18,7 +18,6 @@
<http://www.gnu.org/licenses/>. */
#include <fenv.h>
-#include <bp-sym.h>
#include <unistd.h>
#include <dl-procinfo.h>
#include <ldsodefs.h>
@@ -53,8 +52,8 @@ __feupdateenv (const fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feupdateenv, __old_feupdateenv)
-compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
+compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
libm_hidden_ver (__feupdateenv, feupdateenv)
-versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);
+versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/libc/sysdeps/i386/fpu/fsetexcptflg.c b/libc/sysdeps/i386/fpu/fsetexcptflg.c
index d197aaabb..0c328272d 100644
--- a/libc/sysdeps/i386/fpu/fsetexcptflg.c
+++ b/libc/sysdeps/i386/fpu/fsetexcptflg.c
@@ -19,7 +19,6 @@
#include <fenv.h>
#include <math.h>
-#include <bp-sym.h>
#include <unistd.h>
#include <ldsodefs.h>
#include <dl-procinfo.h>
@@ -64,7 +63,7 @@ __fesetexceptflag (const fexcept_t *flagp, int excepts)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
-compat_symbol (libm, BP_SYM (__old_fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2_1);
+compat_symbol (libm, __old_fesetexceptflag, fesetexceptflag, GLIBC_2_1);
#endif
-versioned_symbol (libm, BP_SYM (__fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2_2);
+versioned_symbol (libm, __fesetexceptflag, fesetexceptflag, GLIBC_2_2);
diff --git a/libc/sysdeps/i386/fpu/libm-test-ulps b/libc/sysdeps/i386/fpu/libm-test-ulps
index 1525b16f3..fd0180ffd 100644
--- a/libc/sysdeps/i386/fpu/libm-test-ulps
+++ b/libc/sysdeps/i386/fpu/libm-test-ulps
@@ -275,6 +275,18 @@ ifloat: 1
Test "Imaginary part of: cacos (-0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i":
double: 1
idouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-1025 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-1025 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442100 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442100 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
Test "Imaginary part of: cacos (-1.5 + +0 i) == pi - 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -282,9 +294,27 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (-1.5 + 0x1.fp-1025 i) == 3.141592653589793238462643383279502884197 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.5 + 0x1.fp-129 i) == 3.141592653589793238462643383279502884195 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.5 + 0x1.fp-16385 i) == 3.141592653589793238462643383279502884197 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (-1.5 - 0 i) == pi + 0.9624236501192068949955178268487368462704 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (-1.5 - 0x1.fp-1025 i) == 3.141592653589793238462643383279502884197 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.5 - 0x1.fp-129 i) == 3.141592653589793238462643383279502884195 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.5 - 0x1.fp-16385 i) == 3.141592653589793238462643383279502884197 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: cacos (0.5 + +0 i) == 1.047197551196597746154214461093167628066 - 0 i":
double: 1
idouble: 1
@@ -303,6 +333,18 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: cacos (0x1.fp-1025 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (0x1.fp-1025 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442097 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442097 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
Test "Imaginary part of: cacos (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 - 7.107906849659093345062145442726115449315e2 i":
double: 1
idouble: 1
@@ -316,9 +358,27 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (1.5 + 0x1.fp-1025 i) == 4.819934639999230680322935210539402497827e-309 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.5 + 0x1.fp-129 i) == 2.546345110742945032959687790021055102355e-39 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.5 + 0x1.fp-16385 i) == 7.282957076134209141226696333885150260319e-4933 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (1.5 - 0 i) == +0 + 0.9624236501192068949955178268487368462704 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (1.5 - 0x1.fp-1025 i) == 4.819934639999230680322935210539402497827e-309 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.5 - 0x1.fp-129 i) == 2.546345110742945032959687790021055102355e-39 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.5 - 0x1.fp-16385 i) == 7.282957076134209141226696333885150260319e-4933 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
# cacosh
Test "Real part of: cacosh (+0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i":
@@ -502,6 +562,18 @@ ifloat: 1
Test "Imaginary part of: casin (-0 - 1.5 i) == -0 - 1.194763217287109304111930828519090523536 i":
double: 1
idouble: 1
+Test "Imaginary part of: casin (-0x1.fp-1025 + 1.5 i) == -2.989196569048182929051881765490354365918e-309 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (-0x1.fp-1025 - 1.5 i) == -2.989196569048182929051881765490354365918e-309 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (-0x1.fp-129 + 1.5 i) == -1.579176199917649005841160751101628985741e-39 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (-0x1.fp-129 - 1.5 i) == -1.579176199917649005841160751101628985741e-39 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
Test "Imaginary part of: casin (-1.5 + +0 i) == -pi/2 + 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -509,9 +581,27 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (-1.5 + 0x1.fp-1025 i) == -1.570796326794896619231321691639751442099 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.5 + 0x1.fp-129 i) == -1.570796326794896619231321691639751442096 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.5 + 0x1.fp-16385 i) == -1.570796326794896619231321691639751442099 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (-1.5 - 0 i) == -pi/2 - 0.9624236501192068949955178268487368462704 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (-1.5 - 0x1.fp-1025 i) == -1.570796326794896619231321691639751442099 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.5 - 0x1.fp-129 i) == -1.570796326794896619231321691639751442096 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.5 - 0x1.fp-16385 i) == -1.570796326794896619231321691639751442099 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
double: 1
float: 1
@@ -524,6 +614,18 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: casin (0x1.fp-1025 + 1.5 i) == 2.989196569048182929051881765490354365918e-309 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (0x1.fp-1025 - 1.5 i) == 2.989196569048182929051881765490354365918e-309 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (0x1.fp-129 + 1.5 i) == 1.579176199917649005841160751101628985741e-39 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (0x1.fp-129 - 1.5 i) == 1.579176199917649005841160751101628985741e-39 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
Test "Imaginary part of: casin (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 + 7.107906849659093345062145442726115449315e2 i":
double: 1
idouble: 1
@@ -537,9 +639,27 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (1.5 + 0x1.fp-1025 i) == 1.570796326794896619231321691639751442099 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.5 + 0x1.fp-129 i) == 1.570796326794896619231321691639751442096 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.5 + 0x1.fp-16385 i) == 1.570796326794896619231321691639751442099 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (1.5 - 0 i) == pi/2 - 0.9624236501192068949955178268487368462704 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (1.5 - 0x1.fp-1025 i) == 1.570796326794896619231321691639751442099 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.5 - 0x1.fp-129 i) == 1.570796326794896619231321691639751442096 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.5 - 0x1.fp-16385 i) == 1.570796326794896619231321691639751442099 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
# casinh
Test "Real part of: casinh (+0 + 1.5 i) == 0.9624236501192068949955178268487368462704 + pi/2 i":
@@ -576,6 +696,24 @@ idouble: 2
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (-0x1.fp-1025 + 1.5 i) == -9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1.fp-1025 - 1.5 i) == -9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1.fp-129 + 1.5 i) == -9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442096 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1.fp-129 - 1.5 i) == -9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442096 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1.fp-16385 + 1.5 i) == -9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1.fp-16385 - 1.5 i) == -9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-1.0 + +0 i) == -0.8813735870195430252326093249797923090282 + +0 i":
double: 2
float: 1
@@ -595,11 +733,23 @@ double: 2
float: 1
idouble: 2
ifloat: 1
+Test "Real part of: casinh (-1.5 + 0x1.fp-1025 i) == -1.194763217287109304111930828519090523536 + 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (-1.5 + 0x1.fp-129 i) == -1.194763217287109304111930828519090523536 + 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
Test "Real part of: casinh (-1.5 - 0 i) == -1.194763217287109304111930828519090523536 - 0 i":
double: 2
float: 1
idouble: 2
ifloat: 1
+Test "Real part of: casinh (-1.5 - 0x1.fp-1025 i) == -1.194763217287109304111930828519090523536 - 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (-1.5 - 0x1.fp-129 i) == -1.194763217287109304111930828519090523536 - 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
double: 5
float: 1
@@ -638,6 +788,24 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (0x1.fp-1025 + 1.5 i) == 9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp-1025 - 1.5 i) == 9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp-129 + 1.5 i) == 9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442096 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp-129 - 1.5 i) == 9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442096 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp-16385 + 1.5 i) == 9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp-16385 - 1.5 i) == 9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (0x1.fp1023 + 0x1.fp1023 i) == 7.107906849659093345062145442726115449315e2 + 7.853981633974483096156608458198757210493e-1 i":
double: 1
idouble: 1
@@ -657,9 +825,21 @@ ifloat: 1
Test "Real part of: casinh (1.5 + +0 i) == 1.194763217287109304111930828519090523536 + +0 i":
double: 1
idouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-1025 i) == 1.194763217287109304111930828519090523536 + 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-129 i) == 1.194763217287109304111930828519090523536 + 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
Test "Real part of: casinh (1.5 - 0 i) == 1.194763217287109304111930828519090523536 - 0 i":
double: 1
idouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-1025 i) == 1.194763217287109304111930828519090523536 - 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-129 i) == 1.194763217287109304111930828519090523536 - 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
# catan
Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
diff --git a/libc/sysdeps/i386/fpu/s_frexp.S b/libc/sysdeps/i386/fpu/s_frexp.S
index 15dc70d48..037019e91 100644
--- a/libc/sysdeps/i386/fpu/s_frexp.S
+++ b/libc/sysdeps/i386/fpu/s_frexp.S
@@ -18,8 +18,6 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
.section .rodata
@@ -34,14 +32,13 @@ two54: .byte 0, 0, 0, 0, 0, 0, 0x50, 0x43
#define MO(op) op
#endif
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define VAL0 PARMS
#define VAL1 VAL0+4
#define EXPP VAL1+4
.text
-ENTRY (BP_SYM (__frexp))
- ENTER
+ENTRY (__frexp)
movl VAL0(%esp), %ecx
movl VAL1(%esp), %eax
@@ -78,11 +75,9 @@ ENTRY (BP_SYM (__frexp))
/* Store %ecx in the variable pointed to by the second argument,
get the factor from the stack and return. */
1: movl EXPP(%esp), %eax
- CHECK_BOUNDS_BOTH_WIDE (%eax, EXPP(%esp), $4)
fldl VAL0(%esp)
movl %ecx, (%eax)
- LEAVE
ret
-END (BP_SYM (__frexp))
-weak_alias (BP_SYM (__frexp), BP_SYM (frexp))
+END (__frexp)
+weak_alias (__frexp, frexp)
diff --git a/libc/sysdeps/i386/fpu/s_frexpf.S b/libc/sysdeps/i386/fpu/s_frexpf.S
index 53dcacff8..f8d903d77 100644
--- a/libc/sysdeps/i386/fpu/s_frexpf.S
+++ b/libc/sysdeps/i386/fpu/s_frexpf.S
@@ -18,8 +18,6 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
.section .rodata
@@ -34,13 +32,12 @@ two25: .byte 0, 0, 0, 0x4c
#define MO(op) op
#endif
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define VAL PARMS
#define EXPP VAL+4
.text
-ENTRY (BP_SYM (__frexpf))
- ENTER
+ENTRY (__frexpf)
movl VAL(%esp), %eax
xorl %ecx, %ecx
@@ -75,11 +72,9 @@ ENTRY (BP_SYM (__frexpf))
/* Store %ecx in the variable pointed to by the second argument,
get the factor from the stack and return. */
1: movl EXPP(%esp), %eax
- CHECK_BOUNDS_BOTH_WIDE (%eax, EXPP(%esp), $4)
flds VAL(%esp)
movl %ecx, (%eax)
- LEAVE
ret
-END (BP_SYM (__frexpf))
-weak_alias (BP_SYM (__frexpf), BP_SYM (frexpf))
+END (__frexpf)
+weak_alias (__frexpf, frexpf)
diff --git a/libc/sysdeps/i386/fpu/s_frexpl.S b/libc/sysdeps/i386/fpu/s_frexpl.S
index 21338a72b..e32b4d5a1 100644
--- a/libc/sysdeps/i386/fpu/s_frexpl.S
+++ b/libc/sysdeps/i386/fpu/s_frexpl.S
@@ -18,8 +18,6 @@
<http://www.gnu.org/licenses/>. */
#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
.section .rodata
@@ -34,15 +32,14 @@ two64: .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x43
#define MO(op) op
#endif
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define VAL0 PARMS
#define VAL1 VAL0+4
#define VAL2 VAL1+4
#define EXPP VAL2+4
.text
-ENTRY (BP_SYM (__frexpl))
- ENTER
+ENTRY (__frexpl)
movl VAL0(%esp), %ecx
movl VAL2(%esp), %eax
@@ -80,11 +77,9 @@ ENTRY (BP_SYM (__frexpl))
/* Store %ecx in the variable pointed to by the second argument,
get the factor from the stack and return. */
1: movl EXPP(%esp), %eax
- CHECK_BOUNDS_BOTH_WIDE (%eax, EXPP(%esp), $4)
fldt VAL0(%esp)
movl %ecx, (%eax)
- LEAVE
ret
-END (BP_SYM (__frexpl))
-weak_alias (BP_SYM (__frexpl), BP_SYM (frexpl))
+END (__frexpl)
+weak_alias (__frexpl, frexpl)
diff --git a/libc/sysdeps/i386/fpu/s_remquo.S b/libc/sysdeps/i386/fpu/s_remquo.S
index 505659321..341285db3 100644
--- a/libc/sysdeps/i386/fpu/s_remquo.S
+++ b/libc/sysdeps/i386/fpu/s_remquo.S
@@ -5,17 +5,14 @@
*/
#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define DVDND PARMS
#define DVSOR DVDND+8
#define QUOP DVSOR+8
.text
-ENTRY (BP_SYM (__remquo))
- ENTER
+ENTRY (__remquo)
fldl DVSOR(%esp)
fldl DVDND(%esp)
@@ -36,7 +33,6 @@ ENTRY (BP_SYM (__remquo))
shrl %cl, %eax
andl $7, %eax
movl QUOP(%esp), %ecx
- CHECK_BOUNDS_BOTH_WIDE (%ecx, QUOP(%esp), $4)
movl DVDND+4(%esp), %edx
xorl DVSOR+4(%esp), %edx
testl $0x80000000, %edx
@@ -44,7 +40,6 @@ ENTRY (BP_SYM (__remquo))
negl %eax
1: movl %eax, (%ecx)
- LEAVE
ret
-END (BP_SYM (__remquo))
-weak_alias (BP_SYM (__remquo), BP_SYM (remquo))
+END (__remquo)
+weak_alias (__remquo, remquo)
diff --git a/libc/sysdeps/i386/fpu/s_remquof.S b/libc/sysdeps/i386/fpu/s_remquof.S
index d3c5965be..62063f068 100644
--- a/libc/sysdeps/i386/fpu/s_remquof.S
+++ b/libc/sysdeps/i386/fpu/s_remquof.S
@@ -5,17 +5,14 @@
*/
#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define DVDND PARMS
#define DVSOR DVDND+4
#define QUOP DVSOR+4
.text
-ENTRY (BP_SYM (__remquof))
- ENTER
+ENTRY (__remquof)
flds DVSOR(%esp)
flds DVDND(%esp)
@@ -36,7 +33,6 @@ ENTRY (BP_SYM (__remquof))
shrl %cl, %eax
andl $7, %eax
movl QUOP(%esp), %ecx
- CHECK_BOUNDS_BOTH_WIDE (%ecx, QUOP(%esp), $4)
movl DVDND(%esp), %edx
xorl DVSOR(%esp), %edx
testl $0x80000000, %edx
@@ -44,7 +40,6 @@ ENTRY (BP_SYM (__remquof))
negl %eax
1: movl %eax, (%ecx)
- LEAVE
ret
-END (BP_SYM (__remquof))
-weak_alias (BP_SYM (__remquof), BP_SYM (remquof))
+END (__remquof)
+weak_alias (__remquof, remquof)
diff --git a/libc/sysdeps/i386/fpu/s_remquol.S b/libc/sysdeps/i386/fpu/s_remquol.S
index 65240adbe..f3d84fc7c 100644
--- a/libc/sysdeps/i386/fpu/s_remquol.S
+++ b/libc/sysdeps/i386/fpu/s_remquol.S
@@ -5,17 +5,14 @@
*/
#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define DVDND PARMS
#define DVSOR DVDND+12
#define QUOP DVSOR+12
.text
-ENTRY (BP_SYM (__remquol))
- ENTER
+ENTRY (__remquol)
fldt DVSOR(%esp)
fldt DVDND(%esp)
@@ -36,7 +33,6 @@ ENTRY (BP_SYM (__remquol))
shrl %cl, %eax
andl $7, %eax
movl QUOP(%esp), %ecx
- CHECK_BOUNDS_BOTH_WIDE (%ecx, QUOP(%esp), $4)
movl DVDND+8(%esp), %edx
xorl DVSOR+8(%esp), %edx
testl $0x8000, %edx
@@ -44,7 +40,6 @@ ENTRY (BP_SYM (__remquol))
negl %eax
1: movl %eax, (%ecx)
- LEAVE
ret
-END (BP_SYM (__remquol))
-weak_alias (BP_SYM (__remquol), BP_SYM (remquol))
+END (__remquol)
+weak_alias (__remquol, remquol)
diff --git a/libc/sysdeps/i386/i486/strcat.S b/libc/sysdeps/i386/i486/strcat.S
index 6549b5c16..7d45862a2 100644
--- a/libc/sysdeps/i386/i486/strcat.S
+++ b/libc/sysdeps/i386/i486/strcat.S
@@ -21,25 +21,20 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+4 /* space for 1 saved reg */
+#define PARMS 4+4 /* space for 1 saved reg */
#define RTN PARMS
-#define DEST RTN+RTN_SIZE
-#define SRC DEST+PTR_SIZE
+#define DEST RTN
+#define SRC DEST+4
.text
-ENTRY (BP_SYM (strcat))
- ENTER
+ENTRY (strcat)
pushl %edi /* Save callee-safe register. */
cfi_adjust_cfa_offset (4)
movl DEST(%esp), %edx
movl SRC(%esp), %ecx
- CHECK_BOUNDS_LOW (%edx, DEST(%esp))
- CHECK_BOUNDS_LOW (%ecx, SRC(%esp))
testb $0xff, (%ecx) /* Is source string empty? */
jz L(8) /* yes => return */
@@ -260,14 +255,11 @@ L(9): movb %al, (%ecx,%edx) /* store first byte of last word */
movb %ah, 3(%ecx,%edx) /* store fourth byte of last word */
-L(8): /* GKM FIXME: check high bounds */
- movl DEST(%esp), %eax /* start address of destination is result */
- RETURN_BOUNDED_POINTER (DEST(%esp))
+L(8): movl DEST(%esp), %eax /* start address of destination is result */
popl %edi /* restore saved register */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
-END (BP_SYM (strcat))
+ ret
+END (strcat)
libc_hidden_builtin_def (strcat)
diff --git a/libc/sysdeps/i386/i486/strlen.S b/libc/sysdeps/i386/i486/strlen.S
index 743918044..67bee4eb2 100644
--- a/libc/sysdeps/i386/i486/strlen.S
+++ b/libc/sysdeps/i386/i486/strlen.S
@@ -20,18 +20,14 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define STR PARMS
.text
-ENTRY (BP_SYM (strlen))
- ENTER
+ENTRY (strlen)
movl STR(%esp), %ecx
- CHECK_BOUNDS_LOW (%ecx, STR(%esp))
movl %ecx, %eax /* duplicate it */
andl $3, %ecx /* mask alignment bits */
@@ -129,10 +125,8 @@ L(3): testb %cl, %cl /* is first byte NUL? */
jz L(2) /* yes => return pointer */
incl %eax /* increment pointer */
-L(2): CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
- subl STR(%esp), %eax /* compute difference to string start */
+L(2): subl STR(%esp), %eax /* compute difference to string start */
- LEAVE
ret
-END (BP_SYM (strlen))
+END (strlen)
libc_hidden_builtin_def (strlen)
diff --git a/libc/sysdeps/i386/i586/add_n.S b/libc/sysdeps/i386/i586/add_n.S
index 395c4b78f..2d6161fa9 100644
--- a/libc/sysdeps/i386/i586/add_n.S
+++ b/libc/sysdeps/i386/i586/add_n.S
@@ -19,18 +19,15 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+16 /* space for 4 saved regs */
+#define PARMS 4+16 /* space for 4 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define S2 S1+PTR_SIZE
-#define SIZE S2+PTR_SIZE
+#define S1 RES+4
+#define S2 S1+4
+#define SIZE S2+4
.text
-ENTRY (BP_SYM (__mpn_add_n))
- ENTER
+ENTRY (__mpn_add_n)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -48,13 +45,6 @@ ENTRY (BP_SYM (__mpn_add_n))
movl S2(%esp),%ebx
cfi_rel_offset (ebx, 0)
movl SIZE(%esp),%ecx
-#if __BOUNDED_POINTERS__
- shll $2, %ecx /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, S1(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%ebx, S2(%esp), %ecx)
- shrl $2, %ecx
-#endif
movl (%ebx),%ebp
cfi_rel_offset (ebp, 4)
@@ -149,6 +139,5 @@ L(end2):
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (__mpn_add_n))
+END (__mpn_add_n)
diff --git a/libc/sysdeps/i386/i586/addmul_1.S b/libc/sysdeps/i386/i586/addmul_1.S
index faf862502..e18e40530 100644
--- a/libc/sysdeps/i386/i586/addmul_1.S
+++ b/libc/sysdeps/i386/i586/addmul_1.S
@@ -19,13 +19,11 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+16 /* space for 4 saved regs */
+#define PARMS 4+16 /* space for 4 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define SIZE S1+PTR_SIZE
+#define S1 RES+4
+#define SIZE S1+4
#define S2LIMB SIZE+4
#define res_ptr edi
@@ -34,8 +32,7 @@
#define s2_limb ebx
.text
-ENTRY (BP_SYM (__mpn_addmul_1))
- ENTER
+ENTRY (__mpn_addmul_1)
pushl %res_ptr
cfi_adjust_cfa_offset (4)
@@ -53,12 +50,6 @@ ENTRY (BP_SYM (__mpn_addmul_1))
movl SIZE(%esp), %size
movl S2LIMB(%esp), %s2_limb
cfi_rel_offset (s2_limb, 0)
-#if __BOUNDED_POINTERS__
- shll $2, %size /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%res_ptr, RES(%esp), %size)
- CHECK_BOUNDS_BOTH_WIDE (%s1_ptr, S1(%esp), %size)
- shrl $2, %size
-#endif
leal (%res_ptr,%size,4), %res_ptr
leal (%s1_ptr,%size,4), %s1_ptr
negl %size
@@ -98,7 +89,6 @@ L(oop): adcl $0, %ebp
cfi_adjust_cfa_offset (-4)
cfi_restore (res_ptr)
- LEAVE
ret
#undef size
-END (BP_SYM (__mpn_addmul_1))
+END (__mpn_addmul_1)
diff --git a/libc/sysdeps/i386/i586/bzero.S b/libc/sysdeps/i386/i586/bzero.S
index 220aa47c3..84d2f709c 100644
--- a/libc/sysdeps/i386/i586/bzero.S
+++ b/libc/sysdeps/i386/i586/bzero.S
@@ -1,3 +1,3 @@
#define memset __bzero
#include <sysdeps/i386/i586/memset.S>
-weak_alias (BP_SYM (__bzero), BP_SYM (bzero))
+weak_alias (__bzero, bzero)
diff --git a/libc/sysdeps/i386/i586/lshift.S b/libc/sysdeps/i386/i586/lshift.S
index 461e32dbe..cda3aecef 100644
--- a/libc/sysdeps/i386/i586/lshift.S
+++ b/libc/sysdeps/i386/i586/lshift.S
@@ -18,18 +18,15 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+16 /* space for 4 saved regs */
+#define PARMS 4+16 /* space for 4 saved regs */
#define RES PARMS
-#define S RES+PTR_SIZE
-#define SIZE S+PTR_SIZE
+#define S RES+4
+#define SIZE S+4
#define CNT SIZE+4
.text
-ENTRY (BP_SYM (__mpn_lshift))
- ENTER
+ENTRY (__mpn_lshift)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -48,12 +45,6 @@ ENTRY (BP_SYM (__mpn_lshift))
movl SIZE(%esp),%ebx
cfi_rel_offset (ebx, 0)
movl CNT(%esp),%ecx
-#if __BOUNDED_POINTERS__
- shll $2, %ebx /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %ebx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, S(%esp), %ebx)
- shrl $2, %ebx
-#endif
/* We can use faster code for shift-by-1 under certain conditions. */
cmp $1,%ecx
@@ -155,7 +146,6 @@ L(end2):
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
/* We loop from least significant end of the arrays, which is only
@@ -261,6 +251,5 @@ L(L1): movl %edx,(%edi) /* store last limb */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (__mpn_lshift))
+END (__mpn_lshift)
diff --git a/libc/sysdeps/i386/i586/memcpy.S b/libc/sysdeps/i386/i586/memcpy.S
index 206715482..49f165241 100644
--- a/libc/sysdeps/i386/i586/memcpy.S
+++ b/libc/sysdeps/i386/i586/memcpy.S
@@ -19,19 +19,17 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
/* BEWARE: `#ifdef memcpy' means that memcpy is redefined as `mempcpy',
and the return value is the byte after the last one copied in
the destination. */
#define MEMPCPY_P (defined memcpy)
-#define PARMS LINKAGE+8 /* space for 2 saved regs */
+#define PARMS 4+8 /* space for 2 saved regs */
#define RTN PARMS
-#define DEST RTN+RTN_SIZE
-#define SRC DEST+PTR_SIZE
-#define LEN SRC+PTR_SIZE
+#define DEST RTN
+#define SRC DEST+4
+#define LEN SRC+4
.text
#if defined PIC && !defined NOT_IN_libc
@@ -41,8 +39,7 @@ ENTRY (__memcpy_chk)
jb HIDDEN_JUMPTARGET (__chk_fail)
END (__memcpy_chk)
#endif
-ENTRY (BP_SYM (memcpy))
- ENTER
+ENTRY (memcpy)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -54,8 +51,6 @@ ENTRY (BP_SYM (memcpy))
movl SRC(%esp), %esi
cfi_rel_offset (esi, 0)
movl LEN(%esp), %ecx
- CHECK_BOUNDS_BOTH_WIDE (%edi, DEST(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, SRC(%esp), %ecx)
movl %edi, %eax
/* We need this in any case. */
@@ -127,9 +122,8 @@ L(1): rep; movsb
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
-END (BP_SYM (memcpy))
+ ret
+END (memcpy)
#if !MEMPCPY_P
libc_hidden_builtin_def (memcpy)
#endif
diff --git a/libc/sysdeps/i386/i586/mempcpy.S b/libc/sysdeps/i386/i586/mempcpy.S
index f492be7ca..afc112d9d 100644
--- a/libc/sysdeps/i386/i586/mempcpy.S
+++ b/libc/sysdeps/i386/i586/mempcpy.S
@@ -2,6 +2,6 @@
#define __memcpy_chk __mempcpy_chk
#include <sysdeps/i386/i586/memcpy.S>
-libc_hidden_def (BP_SYM (__mempcpy))
-weak_alias (BP_SYM (__mempcpy), BP_SYM (mempcpy))
+libc_hidden_def (__mempcpy)
+weak_alias (__mempcpy, mempcpy)
libc_hidden_builtin_def (mempcpy)
diff --git a/libc/sysdeps/i386/i586/memset.S b/libc/sysdeps/i386/i586/memset.S
index 07cd27fbc..c194b102d 100644
--- a/libc/sysdeps/i386/i586/memset.S
+++ b/libc/sysdeps/i386/i586/memset.S
@@ -20,19 +20,17 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
/* BEWARE: `#ifdef memset' means that memset is redefined as `bzero' */
#define BZERO_P (defined memset)
-#define PARMS LINKAGE+4 /* space for 1 saved reg */
+#define PARMS 4+4 /* space for 1 saved reg */
#define RTN PARMS
-#define DEST RTN+RTN_SIZE
+#define DEST RTN
#if BZERO_P
-# define LEN DEST+PTR_SIZE
+# define LEN DEST+4
#else
-# define CHR DEST+PTR_SIZE
+# define CHR DEST+4
# define LEN CHR+4
#endif
@@ -44,8 +42,7 @@ ENTRY (__memset_chk)
jb HIDDEN_JUMPTARGET (__chk_fail)
END (__memset_chk)
#endif
-ENTRY (BP_SYM (memset))
- ENTER
+ENTRY (memset)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -53,7 +50,6 @@ ENTRY (BP_SYM (memset))
movl DEST(%esp), %edi
cfi_rel_offset (edi, 0)
movl LEN(%esp), %edx
- CHECK_BOUNDS_BOTH_WIDE (%edi, DEST(%esp), %edx)
#if BZERO_P
xorl %eax, %eax /* we fill with 0 */
#else
@@ -111,17 +107,15 @@ L(2): shrl $2, %ecx /* convert byte count to longword count */
#if !BZERO_P
/* Load result (only if used as memset). */
movl DEST(%esp), %eax /* start address of destination is result */
- RETURN_BOUNDED_POINTER (DEST(%esp))
#endif
popl %edi
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
#if BZERO_P
ret
#else
- RET_PTR
+ ret
#endif
-END (BP_SYM (memset))
+END (memset)
libc_hidden_builtin_def (memset)
diff --git a/libc/sysdeps/i386/i586/mul_1.S b/libc/sysdeps/i386/i586/mul_1.S
index 002629318..f5bbea2b5 100644
--- a/libc/sysdeps/i386/i586/mul_1.S
+++ b/libc/sysdeps/i386/i586/mul_1.S
@@ -19,13 +19,11 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+16 /* space for 4 saved regs */
+#define PARMS 4+16 /* space for 4 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define SIZE S1+PTR_SIZE
+#define S1 RES+4
+#define SIZE S1+4
#define S2LIMB SIZE+4
#define res_ptr edi
@@ -34,8 +32,7 @@
#define s2_limb ebx
.text
-ENTRY (BP_SYM (__mpn_mul_1))
- ENTER
+ENTRY (__mpn_mul_1)
pushl %res_ptr
cfi_adjust_cfa_offset (4)
@@ -53,12 +50,6 @@ ENTRY (BP_SYM (__mpn_mul_1))
movl SIZE(%esp), %size
movl S2LIMB(%esp), %s2_limb
cfi_rel_offset (s2_limb, 0)
-#if __BOUNDED_POINTERS__
- shll $2, %size /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%res_ptr, RES(%esp), %size)
- CHECK_BOUNDS_BOTH_WIDE (%s1_ptr, S1(%esp), %size)
- shrl $2, %size
-#endif
leal (%res_ptr,%size,4), %res_ptr
leal (%s1_ptr,%size,4), %s1_ptr
negl %size
@@ -94,7 +85,6 @@ L(oop): adcl $0, %ebp
cfi_adjust_cfa_offset (-4)
cfi_restore (res_ptr)
- LEAVE
ret
#undef size
-END (BP_SYM (__mpn_mul_1))
+END (__mpn_mul_1)
diff --git a/libc/sysdeps/i386/i586/rshift.S b/libc/sysdeps/i386/i586/rshift.S
index c5438ffc9..37eff12f3 100644
--- a/libc/sysdeps/i386/i586/rshift.S
+++ b/libc/sysdeps/i386/i586/rshift.S
@@ -18,18 +18,15 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+16 /* space for 4 saved regs */
+#define PARMS 4+16 /* space for 4 saved regs */
#define RES PARMS
-#define S RES+PTR_SIZE
-#define SIZE S+PTR_SIZE
+#define S RES+4
+#define SIZE S+4
#define CNT SIZE+4
.text
-ENTRY (BP_SYM (__mpn_rshift))
- ENTER
+ENTRY (__mpn_rshift)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -48,12 +45,6 @@ ENTRY (BP_SYM (__mpn_rshift))
movl SIZE(%esp),%ebx
cfi_rel_offset (ebx, 0)
movl CNT(%esp),%ecx
-#if __BOUNDED_POINTERS__
- shll $2, %ebx /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %ebx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, S(%esp), %ebx)
- shrl $2, %ebx
-#endif
/* We can use faster code for shift-by-1 under certain conditions. */
cmp $1,%ecx
@@ -152,7 +143,6 @@ L(end2):
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
/* We loop from least significant end of the arrays, which is only
@@ -261,6 +251,5 @@ L(L1): movl %edx,(%edi) /* store last limb */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (__mpn_rshift))
+END (__mpn_rshift)
diff --git a/libc/sysdeps/i386/i586/strchr.S b/libc/sysdeps/i386/i586/strchr.S
index d005b164f..648d52830 100644
--- a/libc/sysdeps/i386/i586/strchr.S
+++ b/libc/sysdeps/i386/i586/strchr.S
@@ -20,8 +20,6 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
/* This version is especially optimized for the i586 (and following?)
processors. This is mainly done by using the two pipelines. The
@@ -36,14 +34,13 @@
/* The magic value which is used throughout in the whole code. */
#define magic 0xfefefeff
-#define PARMS LINKAGE+16 /* space for 4 saved regs */
+#define PARMS 4+16 /* space for 4 saved regs */
#define RTN PARMS
-#define STR RTN+RTN_SIZE
-#define CHR STR+PTR_SIZE
+#define STR RTN
+#define CHR STR+4
.text
-ENTRY (BP_SYM (strchr))
- ENTER
+ENTRY (strchr)
pushl %edi /* Save callee-safe registers. */
cfi_adjust_cfa_offset (-4)
@@ -57,7 +54,6 @@ ENTRY (BP_SYM (strchr))
movl STR(%esp), %eax
movl CHR(%esp), %edx
- CHECK_BOUNDS_LOW (%eax, STR(%esp))
movl %eax, %edi /* duplicate string pointer for later */
cfi_rel_offset (edi, 12)
@@ -82,7 +78,7 @@ ENTRY (BP_SYM (strchr))
jp L(0) /* exactly two bits set */
xorb (%eax), %cl /* is byte the one we are looking for? */
- jz L(2) /* yes => return pointer */
+ jz L(out) /* yes => return pointer */
xorb %dl, %cl /* load single byte and test for NUL */
je L(3) /* yes => return NULL */
@@ -91,7 +87,7 @@ ENTRY (BP_SYM (strchr))
incl %eax
cmpb %cl, %dl /* is byte == C? */
- je L(2) /* aligned => return pointer */
+ je L(out) /* aligned => return pointer */
cmpb $0, %cl /* is byte NUL? */
je L(3) /* yes => return NULL */
@@ -104,7 +100,7 @@ ENTRY (BP_SYM (strchr))
L(0): movb (%eax), %cl /* load single byte */
cmpb %cl, %dl /* is byte == C? */
- je L(2) /* aligned => return pointer */
+ je L(out) /* aligned => return pointer */
cmpb $0, %cl /* is byte NUL? */
je L(3) /* yes => return NULL */
@@ -274,23 +270,21 @@ L(1): xorl %ecx, %ebp /* (word^magic) */
L(5): subl $4, %eax /* adjust pointer */
testb %bl, %bl /* first byte == C? */
- jz L(2) /* yes => return pointer */
+ jz L(out) /* yes => return pointer */
incl %eax /* increment pointer */
testb %bh, %bh /* second byte == C? */
- jz L(2) /* yes => return pointer */
+ jz L(out) /* yes => return pointer */
shrl $16, %ebx /* make upper bytes accessible */
incl %eax /* increment pointer */
cmp $0, %bl /* third byte == C */
- je L(2) /* yes => return pointer */
+ je L(out) /* yes => return pointer */
incl %eax /* increment pointer */
-L(2): CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
- RETURN_BOUNDED_POINTER (STR(%esp))
L(out): popl %ebp /* restore saved registers */
cfi_adjust_cfa_offset (-4)
cfi_restore (ebp)
@@ -305,8 +299,7 @@ L(out): popl %ebp /* restore saved registers */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
+ ret
cfi_adjust_cfa_offset (16)
cfi_rel_offset (edi, 12)
@@ -318,7 +311,7 @@ L(out): popl %ebp /* restore saved registers */
L(4): subl $4, %eax /* adjust pointer */
cmpb %dl, %cl /* first byte == C? */
- je L(2) /* yes => return pointer */
+ je L(out) /* yes => return pointer */
cmpb $0, %cl /* first byte == NUL? */
je L(3) /* yes => return NULL */
@@ -326,7 +319,7 @@ L(4): subl $4, %eax /* adjust pointer */
incl %eax /* increment pointer */
cmpb %dl, %ch /* second byte == C? */
- je L(2) /* yes => return pointer */
+ je L(out) /* yes => return pointer */
cmpb $0, %ch /* second byte == NUL? */
je L(3) /* yes => return NULL */
@@ -335,7 +328,7 @@ L(4): subl $4, %eax /* adjust pointer */
incl %eax /* increment pointer */
cmpb %dl, %cl /* third byte == C? */
- je L(2) /* yes => return pointer */
+ je L(out) /* yes => return pointer */
cmpb $0, %cl /* third byte == NUL? */
je L(3) /* yes => return NULL */
@@ -344,13 +337,12 @@ L(4): subl $4, %eax /* adjust pointer */
/* The test four the fourth byte is necessary! */
cmpb %dl, %ch /* fourth byte == C? */
- je L(2) /* yes => return pointer */
+ je L(out) /* yes => return pointer */
L(3): xorl %eax, %eax
- RETURN_NULL_BOUNDED_POINTER
jmp L(out)
-END (BP_SYM (strchr))
+END (strchr)
#undef index
-weak_alias (BP_SYM (strchr), BP_SYM (index))
+weak_alias (strchr, index)
libc_hidden_builtin_def (strchr)
diff --git a/libc/sysdeps/i386/i586/strcpy.S b/libc/sysdeps/i386/i586/strcpy.S
index af23bf5a2..c94036934 100644
--- a/libc/sysdeps/i386/i586/strcpy.S
+++ b/libc/sysdeps/i386/i586/strcpy.S
@@ -19,13 +19,11 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+12 /* space for 3 saved regs */
+#define PARMS 4+12 /* space for 3 saved regs */
#define RTN PARMS
-#define DEST RTN+RTN_SIZE
-#define SRC DEST+PTR_SIZE
+#define DEST RTN
+#define SRC DEST+4
#ifndef USE_AS_STPCPY
# define STRCPY strcpy
@@ -34,8 +32,7 @@
#define magic 0xfefefeff
.text
-ENTRY (BP_SYM (STRCPY))
- ENTER
+ENTRY (STRCPY)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -48,8 +45,6 @@ ENTRY (BP_SYM (STRCPY))
cfi_rel_offset (edi, 8)
movl SRC(%esp), %esi
cfi_rel_offset (esi, 4)
- CHECK_BOUNDS_LOW (%edi, DEST(%esp))
- CHECK_BOUNDS_LOW (%esi, SRC(%esp))
xorl %eax, %eax
leal -1(%esi), %ecx
@@ -152,13 +147,11 @@ L(4): movb %dl, (%edi)
L(end): movb %ah, (%edi)
L(end2):
- /* GKM FIXME: check high bounds */
#ifdef USE_AS_STPCPY
movl %edi, %eax
#else
movl DEST(%esp), %eax
#endif
- RETURN_BOUNDED_POINTER (DEST(%esp))
popl %ebx
cfi_adjust_cfa_offset (-4)
cfi_restore (ebx)
@@ -169,9 +162,8 @@ L(end2):
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
-END (BP_SYM (STRCPY))
+ ret
+END (STRCPY)
#ifndef USE_AS_STPCPY
libc_hidden_builtin_def (strcpy)
#endif
diff --git a/libc/sysdeps/i386/i586/strlen.S b/libc/sysdeps/i386/i586/strlen.S
index a145cb568..b50fffa1f 100644
--- a/libc/sysdeps/i386/i586/strlen.S
+++ b/libc/sysdeps/i386/i586/strlen.S
@@ -20,8 +20,6 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
/* This version is especially optimized for the i586 (and following?)
processors. This is mainly done by using the two pipelines. The
@@ -36,15 +34,13 @@
/* The magic value which is used throughout in the whole code. */
#define magic 0xfefefeff
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define STR PARMS
.text
-ENTRY (BP_SYM (strlen))
- ENTER
+ENTRY (strlen)
movl STR(%esp), %eax
- CHECK_BOUNDS_LOW (%eax, STR(%esp))
movl $3, %edx /* load mask (= 3) */
andl %eax, %edx /* separate last two bits of address */
@@ -178,11 +174,9 @@ L(3): subl $4, %eax /* correct too early pointer increment */
incl %eax /* increment pointer */
-L(2): CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
- subl STR(%esp), %eax /* now compute the length as difference
+L(2): subl STR(%esp), %eax /* now compute the length as difference
between start and terminating NUL
character */
- LEAVE
ret
-END (BP_SYM (strlen))
+END (strlen)
libc_hidden_builtin_def (strlen)
diff --git a/libc/sysdeps/i386/i586/sub_n.S b/libc/sysdeps/i386/i586/sub_n.S
index 5d3c70235..3b40ff3e4 100644
--- a/libc/sysdeps/i386/i586/sub_n.S
+++ b/libc/sysdeps/i386/i586/sub_n.S
@@ -19,18 +19,15 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+16 /* space for 4 saved regs */
+#define PARMS 4+16 /* space for 4 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define S2 S1+PTR_SIZE
-#define SIZE S2+PTR_SIZE
+#define S1 RES+4
+#define S2 S1+4
+#define SIZE S2+4
.text
-ENTRY (BP_SYM (__mpn_sub_n))
- ENTER
+ENTRY (__mpn_sub_n)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -48,13 +45,6 @@ ENTRY (BP_SYM (__mpn_sub_n))
movl S2(%esp),%ebx
cfi_rel_offset (ebx, 0)
movl SIZE(%esp),%ecx
-#if __BOUNDED_POINTERS__
- shll $2, %ecx /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, S1(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%ebx, S2(%esp), %ecx)
- shrl $2, %ecx
-#endif
movl (%ebx),%ebp
cfi_rel_offset (ebp, 4)
@@ -149,6 +139,5 @@ L(end2):
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (__mpn_sub_n))
+END (__mpn_sub_n)
diff --git a/libc/sysdeps/i386/i586/submul_1.S b/libc/sysdeps/i386/i586/submul_1.S
index 8e2b41a35..97a9048d9 100644
--- a/libc/sysdeps/i386/i586/submul_1.S
+++ b/libc/sysdeps/i386/i586/submul_1.S
@@ -19,13 +19,11 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+16 /* space for 4 saved regs */
+#define PARMS 4+16 /* space for 4 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define SIZE S1+PTR_SIZE
+#define S1 RES+4
+#define SIZE S1+4
#define S2LIMB SIZE+4
#define res_ptr edi
@@ -34,8 +32,7 @@
#define s2_limb ebx
.text
-ENTRY (BP_SYM (__mpn_submul_1))
- ENTER
+ENTRY (__mpn_submul_1)
pushl %res_ptr
cfi_adjust_cfa_offset (4)
@@ -53,12 +50,6 @@ ENTRY (BP_SYM (__mpn_submul_1))
movl SIZE(%esp), %size
movl S2LIMB(%esp), %s2_limb
cfi_rel_offset (s2_limb, 0)
-#if __BOUNDED_POINTERS__
- shll $2, %sizeP /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%res_ptr, RES(%esp), %sizeP)
- CHECK_BOUNDS_BOTH_WIDE (%s1_ptr, S1(%esp), %sizeP)
- shrl $2, %sizeP
-#endif
leal (%res_ptr,%size,4), %res_ptr
leal (%s1_ptr,%size,4), %s1_ptr
negl %size
@@ -98,7 +89,6 @@ L(oop): adcl $0, %ebp
cfi_adjust_cfa_offset (-4)
cfi_restore (res_ptr)
- LEAVE
ret
#undef size
-END (BP_SYM (__mpn_submul_1))
+END (__mpn_submul_1)
diff --git a/libc/sysdeps/i386/i686/Makefile b/libc/sysdeps/i386/i686/Makefile
index e6b292458..01c291789 100644
--- a/libc/sysdeps/i386/i686/Makefile
+++ b/libc/sysdeps/i386/i686/Makefile
@@ -15,13 +15,11 @@ CFLAGS-.o += -Wa,-mtune=i686
CFLAGS-.os += -Wa,-mtune=i686
CFLAGS-.op += -Wa,-mtune=i686
CFLAGS-.og += -Wa,-mtune=i686
-CFLAGS-.ob += -Wa,-mtune=i686
CFLAGS-.oS += -Wa,-mtune=i686
ASFLAGS-.o += -Wa,-mtune=i686
ASFLAGS-.os += -Wa,-mtune=i686
ASFLAGS-.op += -Wa,-mtune=i686
ASFLAGS-.og += -Wa,-mtune=i686
-ASFLAGS-.ob += -Wa,-mtune=i686
ASFLAGS-.oS += -Wa,-mtune=i686
endif
diff --git a/libc/sysdeps/i386/i686/add_n.S b/libc/sysdeps/i386/i686/add_n.S
index 5e91aad74..1e2cdc550 100644
--- a/libc/sysdeps/i386/i686/add_n.S
+++ b/libc/sysdeps/i386/i686/add_n.S
@@ -19,22 +19,19 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+8 /* space for 2 saved regs */
+#define PARMS 4+8 /* space for 2 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define S2 S1+PTR_SIZE
-#define SIZE S2+PTR_SIZE
+#define S1 RES+4
+#define S2 S1+4
+#define SIZE S2+4
.text
#ifdef PIC
L(1): addl (%esp), %eax
ret
#endif
-ENTRY (BP_SYM (__mpn_add_n))
- ENTER
+ENTRY (__mpn_add_n)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -47,13 +44,6 @@ ENTRY (BP_SYM (__mpn_add_n))
cfi_rel_offset (esi, 0)
movl S2(%esp),%edx
movl SIZE(%esp),%ecx
-#if __BOUNDED_POINTERS__
- shll $2, %ecx /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, S1(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%edx, S2(%esp), %ecx)
- shrl $2, %ecx
-#endif
movl %ecx,%eax
shrl $3,%ecx /* compute count for unrolled loop */
negl %eax
@@ -116,6 +106,5 @@ L(oop): movl (%esi),%eax
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (__mpn_add_n))
+END (__mpn_add_n)
diff --git a/libc/sysdeps/i386/i686/bzero.S b/libc/sysdeps/i386/i686/bzero.S
index c1e4a6d50..34b0faa91 100644
--- a/libc/sysdeps/i386/i686/bzero.S
+++ b/libc/sysdeps/i386/i686/bzero.S
@@ -1,3 +1,3 @@
#define memset __bzero
#include <sysdeps/i386/i686/memset.S>
-weak_alias (BP_SYM (__bzero), BP_SYM (bzero))
+weak_alias (__bzero, bzero)
diff --git a/libc/sysdeps/i386/i686/memcmp.S b/libc/sysdeps/i386/i686/memcmp.S
index eacac8ee1..b8091a60e 100644
--- a/libc/sysdeps/i386/i686/memcmp.S
+++ b/libc/sysdeps/i386/i686/memcmp.S
@@ -18,17 +18,15 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+4 /* Preserve EBX. */
+#define PARMS 4+4 /* Preserve EBX. */
#define BLK1 PARMS
-#define BLK2 BLK1+PTR_SIZE
-#define LEN BLK2+PTR_SIZE
+#define BLK2 BLK1+4
+#define LEN BLK2+4
#define ENTRANCE pushl %ebx; cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (ebx, 0); ENTER
+ cfi_rel_offset (ebx, 0)
#define RETURN popl %ebx; cfi_adjust_cfa_offset (-4); \
- cfi_restore (ebx); LEAVE; ret
+ cfi_restore (ebx); ret
/* Load an entry in a jump table into EBX. TABLE is a jump table
with relative offsets. INDEX is a register contains the index
@@ -44,7 +42,7 @@
.text
ALIGN (4)
-ENTRY (BP_SYM (memcmp))
+ENTRY (memcmp)
ENTRANCE
movl BLK1(%esp), %eax
@@ -366,7 +364,7 @@ L(set):
cfi_adjust_cfa_offset (-4)
cfi_restore (esi)
RETURN
-END (BP_SYM (memcmp))
+END (memcmp)
.section .rodata
ALIGN (2)
@@ -406,5 +404,5 @@ L(table_32bytes) :
#undef bcmp
-weak_alias (BP_SYM (memcmp), BP_SYM (bcmp))
-libc_hidden_builtin_def (BP_SYM (memcmp))
+weak_alias (memcmp, bcmp)
+libc_hidden_builtin_def (memcmp)
diff --git a/libc/sysdeps/i386/i686/memcpy.S b/libc/sysdeps/i386/i686/memcpy.S
index e6dc87d77..bb05c3d0b 100644
--- a/libc/sysdeps/i386/i686/memcpy.S
+++ b/libc/sysdeps/i386/i686/memcpy.S
@@ -20,14 +20,12 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define RTN PARMS
-#define DEST RTN+RTN_SIZE
-#define SRC DEST+PTR_SIZE
-#define LEN SRC+PTR_SIZE
+#define DEST RTN
+#define SRC DEST+4
+#define LEN SRC+4
.text
#if defined PIC && !defined NOT_IN_libc
@@ -37,8 +35,7 @@ ENTRY_CHK (__memcpy_chk)
jb HIDDEN_JUMPTARGET (__chk_fail)
END_CHK (__memcpy_chk)
#endif
-ENTRY (BP_SYM (memcpy))
- ENTER
+ENTRY (memcpy)
movl %edi, %eax
movl DEST(%esp), %edi
@@ -81,10 +78,8 @@ ENTRY (BP_SYM (memcpy))
.Lend: movl %eax, %edi
movl %edx, %esi
movl DEST(%esp), %eax
- RETURN_BOUNDED_POINTER (DEST(%esp))
- LEAVE
- RET_PTR
+ ret
/* When we come here the pointers do not have the same
alignment or the length is too short. No need to optimize for
@@ -99,5 +94,5 @@ ENTRY (BP_SYM (memcpy))
2: rep
movsl
jmp .Lend
-END (BP_SYM (memcpy))
+END (memcpy)
libc_hidden_builtin_def (memcpy)
diff --git a/libc/sysdeps/i386/i686/memmove.S b/libc/sysdeps/i386/i686/memmove.S
index 607985147..8c53d4a9a 100644
--- a/libc/sysdeps/i386/i686/memmove.S
+++ b/libc/sysdeps/i386/i686/memmove.S
@@ -20,22 +20,20 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+4 /* one spilled register */
+#define PARMS 4+4 /* one spilled register */
#define RTN PARMS
.text
#ifdef USE_AS_BCOPY
-# define SRC RTN+RTN_SIZE
-# define DEST SRC+PTR_SIZE
-# define LEN DEST+PTR_SIZE
+# define SRC RTN
+# define DEST SRC+4
+# define LEN DEST+4
#else
-# define DEST RTN+RTN_SIZE
-# define SRC DEST+PTR_SIZE
-# define LEN SRC+PTR_SIZE
+# define DEST RTN
+# define SRC DEST+4
+# define LEN SRC+4
# if defined PIC && !defined NOT_IN_libc
ENTRY_CHK (__memmove_chk)
@@ -46,8 +44,7 @@ END_CHK (__memmove_chk)
# endif
#endif
-ENTRY (BP_SYM (memmove))
- ENTER
+ENTRY (memmove)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -58,8 +55,6 @@ ENTRY (BP_SYM (memmove))
movl %esi, %edx
movl SRC(%esp), %esi
cfi_register (esi, edx)
- CHECK_BOUNDS_BOTH_WIDE (%edi, DEST(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, SRC(%esp), %ecx)
movl %edi, %eax
subl %esi, %eax
@@ -79,15 +74,13 @@ ENTRY (BP_SYM (memmove))
cfi_restore (esi)
#ifndef USE_AS_BCOPY
movl DEST(%esp), %eax
- RETURN_BOUNDED_POINTER (DEST(%esp))
#endif
popl %edi
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
+ ret
cfi_adjust_cfa_offset (4)
cfi_rel_offset (edi, 0)
@@ -113,7 +106,6 @@ ENTRY (BP_SYM (memmove))
cfi_restore (esi)
#ifndef USE_AS_BCOPY
movl DEST(%esp), %eax
- RETURN_BOUNDED_POINTER (DEST(%esp))
#endif
cld
@@ -121,9 +113,8 @@ ENTRY (BP_SYM (memmove))
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
-END (BP_SYM (memmove))
+ ret
+END (memmove)
#ifndef USE_AS_BCOPY
libc_hidden_builtin_def (memmove)
#endif
diff --git a/libc/sysdeps/i386/i686/mempcpy.S b/libc/sysdeps/i386/i686/mempcpy.S
index 8022b7b95..97fd4966a 100644
--- a/libc/sysdeps/i386/i686/mempcpy.S
+++ b/libc/sysdeps/i386/i686/mempcpy.S
@@ -20,14 +20,12 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define RTN PARMS
-#define DEST RTN+RTN_SIZE
-#define SRC DEST+PTR_SIZE
-#define LEN SRC+PTR_SIZE
+#define DEST RTN
+#define SRC DEST+4
+#define LEN SRC+4
.text
#if defined PIC && !defined NOT_IN_libc
@@ -37,18 +35,15 @@ ENTRY_CHK (__mempcpy_chk)
jb HIDDEN_JUMPTARGET (__chk_fail)
END_CHK (__mempcpy_chk)
#endif
-ENTRY (BP_SYM (__mempcpy))
- ENTER
+ENTRY (__mempcpy)
movl LEN(%esp), %ecx
movl %edi, %eax
cfi_register (edi, eax)
movl DEST(%esp), %edi
- CHECK_BOUNDS_BOTH_WIDE (%edi, DEST(%esp), %ecx)
movl %esi, %edx
cfi_register (esi, edx)
movl SRC(%esp), %esi
- CHECK_BOUNDS_BOTH_WIDE (%esi, SRC(%esp), %ecx)
cld
shrl $1, %ecx
jnc 1f
@@ -62,11 +57,9 @@ ENTRY (BP_SYM (__mempcpy))
cfi_restore (edi)
movl %edx, %esi
cfi_restore (esi)
- RETURN_BOUNDED_POINTER (DEST(%esp))
- LEAVE
- RET_PTR
-END (BP_SYM (__mempcpy))
-libc_hidden_def (BP_SYM (__mempcpy))
-weak_alias (BP_SYM (__mempcpy), BP_SYM (mempcpy))
+ ret
+END (__mempcpy)
+libc_hidden_def (__mempcpy)
+weak_alias (__mempcpy, mempcpy)
libc_hidden_builtin_def (mempcpy)
diff --git a/libc/sysdeps/i386/i686/memset.S b/libc/sysdeps/i386/i686/memset.S
index ad0c9677f..aed79a8aa 100644
--- a/libc/sysdeps/i386/i686/memset.S
+++ b/libc/sysdeps/i386/i686/memset.S
@@ -20,20 +20,18 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
/* BEWARE: `#ifdef memset' means that memset is redefined as `bzero' */
#define BZERO_P (defined memset)
-#define PARMS LINKAGE+4 /* space for 1 saved reg */
+#define PARMS 4+4 /* space for 1 saved reg */
#if BZERO_P
# define DEST PARMS
-# define LEN DEST+PTR_SIZE
+# define LEN DEST+4
#else
# define RTN PARMS
-# define DEST RTN+RTN_SIZE
-# define CHR DEST+PTR_SIZE
+# define DEST RTN
+# define CHR DEST+4
# define LEN CHR+4
#endif
@@ -45,15 +43,13 @@ ENTRY_CHK (__memset_chk)
jb HIDDEN_JUMPTARGET (__chk_fail)
END_CHK (__memset_chk)
#endif
-ENTRY (BP_SYM (memset))
- ENTER
+ENTRY (memset)
cld
pushl %edi
cfi_adjust_cfa_offset (4)
movl DEST(%esp), %edx
movl LEN(%esp), %ecx
- CHECK_BOUNDS_BOTH_WIDE (%edx, DEST(%esp), %ecx)
#if BZERO_P
xorl %eax, %eax /* fill with 0 */
#else
@@ -90,19 +86,17 @@ ENTRY (BP_SYM (memset))
1:
#if !BZERO_P
movl DEST(%esp), %eax /* start address of destination is result */
- RETURN_BOUNDED_POINTER (DEST(%esp))
#endif
popl %edi
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
#if BZERO_P
ret
#else
- RET_PTR
+ ret
#endif
-END (BP_SYM (memset))
+END (memset)
libc_hidden_builtin_def (memset)
#if defined PIC && !defined NOT_IN_libc && !BZERO_P
diff --git a/libc/sysdeps/i386/i686/strcmp.S b/libc/sysdeps/i386/i686/strcmp.S
index b53260ffd..6ca6220a0 100644
--- a/libc/sysdeps/i386/i686/strcmp.S
+++ b/libc/sysdeps/i386/i686/strcmp.S
@@ -19,21 +19,16 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define STR1 PARMS
-#define STR2 STR1+PTR_SIZE
+#define STR2 STR1+4
.text
-ENTRY (BP_SYM (strcmp))
- ENTER
+ENTRY (strcmp)
movl STR1(%esp), %ecx
movl STR2(%esp), %edx
- CHECK_BOUNDS_LOW (%ecx, STR1(%esp))
- CHECK_BOUNDS_LOW (%edx, STR2(%esp))
L(oop): movb (%ecx), %al
cmpb (%edx), %al
@@ -46,26 +41,12 @@ L(oop): movb (%ecx), %al
xorl %eax, %eax
/* when strings are equal, pointers rest one beyond
the end of the NUL terminators. */
- CHECK_BOUNDS_HIGH (%ecx, STR1(%esp), jbe)
- CHECK_BOUNDS_HIGH (%edx, STR2(%esp), jbe)
- LEAVE
ret
-#ifndef __BOUNDED_POINTERS__
L(neq): movl $1, %eax
movl $-1, %ecx
cmovbl %ecx, %eax
-#else
-L(neq): movl $1, %eax
- ja L(chk)
- negl %eax
- /* When strings differ, pointers rest on
- the unequal characters. */
-L(chk): CHECK_BOUNDS_HIGH (%ecx, STR1(%esp), jb)
- CHECK_BOUNDS_HIGH (%edx, STR2(%esp), jb)
-#endif
- LEAVE
ret
-END (BP_SYM (strcmp))
+END (strcmp)
libc_hidden_builtin_def (strcmp)
diff --git a/libc/sysdeps/i386/i686/strtok.S b/libc/sysdeps/i386/i686/strtok.S
index 794efbaed..8848faf4d 100644
--- a/libc/sysdeps/i386/i686/strtok.S
+++ b/libc/sysdeps/i386/i686/strtok.S
@@ -20,8 +20,6 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
/* This file can be used for three variants of the strtok function:
@@ -46,11 +44,7 @@
.type save_ptr, @object
.size save_ptr, 4
save_ptr:
-# if __BOUNDED_POINTERS__
- .space 12
-# else
.space 4
-# endif
# ifdef PIC
# define SAVE_PTR save_ptr@GOTOFF(%ebx)
@@ -62,15 +56,15 @@ save_ptr:
#endif
#if !defined USE_AS_STRTOK_R && defined PIC
-# define PARMS LINKAGE+256+4 /* space for table and saved PIC register */
+# define PARMS 4+256+4 /* space for table and saved PIC register */
#else
-# define PARMS LINKAGE+256 /* space for table */
+# define PARMS 4+256 /* space for table */
#endif
#define RTN PARMS
-#define STR RTN+RTN_SIZE
-#define DELIM STR+PTR_SIZE
+#define STR RTN
+#define DELIM STR+4
#ifdef USE_AS_STRTOK_R
-# define SAVE DELIM+PTR_SIZE
+# define SAVE DELIM+4
#endif
.text
@@ -80,8 +74,7 @@ save_ptr:
ret
#endif
-ENTRY (BP_SYM (FUNCTION))
- ENTER
+ENTRY (FUNCTION)
#if !defined USE_AS_STRTOK_R && defined PIC
pushl %ebx /* Save PIC register. */
@@ -127,23 +120,7 @@ ENTRY (BP_SYM (FUNCTION))
cmove %eax, %edx
testl %edx, %edx
jz L(returnNULL)
-#if __BOUNDED_POINTERS__
-# ifdef USE_AS_STRTOK_R
- movl SAVE(%esp), %ecx /* borrow %ecx for a moment */
-# endif
- je L(0)
- /* Save bounds of incoming non-NULL STR into save area. */
- movl 4+STR(%esp), %eax
- movl %eax, 4+SAVE_PTR
- movl 8+STR(%esp), %eax
- movl %eax, 8+SAVE_PTR
-L(0): CHECK_BOUNDS_LOW (%edx, SAVE_PTR)
-# ifdef USE_AS_STRTOK_R
- xorl %ecx, %ecx /* restore %ecx to zero */
-# endif
-#endif
movl DELIM(%esp), %eax /* Get start of delimiter set. */
- CHECK_BOUNDS_LOW (%eax, DELIM(%esp))
/* For understanding the following code remember that %ecx == 0 now.
Although all the following instruction only modify %cl we always
@@ -151,17 +128,17 @@ L(0): CHECK_BOUNDS_LOW (%edx, SAVE_PTR)
L(2): movb (%eax), %cl /* get byte from stopset */
testb %cl, %cl /* is NUL char? */
- jz L(1_1) /* yes => start compare loop */
+ jz L(1) /* yes => start compare loop */
movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
movb 1(%eax), %cl /* get byte from stopset */
testb $0xff, %cl /* is NUL char? */
- jz L(1_2) /* yes => start compare loop */
+ jz L(1) /* yes => start compare loop */
movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
movb 2(%eax), %cl /* get byte from stopset */
testb $0xff, %cl /* is NUL char? */
- jz L(1_3) /* yes => start compare loop */
+ jz L(1) /* yes => start compare loop */
movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
movb 3(%eax), %cl /* get byte from stopset */
@@ -170,16 +147,7 @@ L(2): movb (%eax), %cl /* get byte from stopset */
testb $0xff, %cl /* is NUL char? */
jnz L(2) /* no => process next dword from stopset */
-#if __BOUNDED_POINTERS__
- jmp L(1_0) /* pointer is correct for bounds check */
-L(1_3): incl %eax /* adjust pointer for bounds check */
-L(1_2): incl %eax /* ditto */
-L(1_1): incl %eax /* ditto */
-L(1_0): CHECK_BOUNDS_HIGH (%eax, DELIM(%esp), jbe)
-#else
-L(1_3):; L(1_2):; L(1_1): /* fall through */
-#endif
- leal -4(%edx), %eax /* prepare loop */
+L(1): leal -4(%edx), %eax /* prepare loop */
/* We use a neat trick for the following loop. Normally we would
have to test for two termination conditions
@@ -253,8 +221,6 @@ L(8): cmpl %eax, %edx
movl SAVE(%esp), %ecx
#endif
movl %edx, SAVE_PTR
- CHECK_BOUNDS_HIGH (%edx, SAVE_PTR, jb)
- RETURN_BOUNDED_POINTER (SAVE_PTR)
L(epilogue):
/* Remove the stopset table. */
@@ -265,8 +231,7 @@ L(epilogue):
cfi_adjust_cfa_offset (-4)
cfi_restore (ebx)
#endif
- LEAVE
- RET_PTR
+ ret
L(returnNULL):
xorl %eax, %eax
@@ -274,7 +239,6 @@ L(returnNULL):
movl SAVE(%esp), %ecx
#endif
movl %edx, SAVE_PTR
- RETURN_NULL_BOUNDED_POINTER
jmp L(epilogue)
-END (BP_SYM (FUNCTION))
+END (FUNCTION)
diff --git a/libc/sysdeps/i386/i686/strtok_r.S b/libc/sysdeps/i386/i686/strtok_r.S
index 1c24ca85f..353e076ba 100644
--- a/libc/sysdeps/i386/i686/strtok_r.S
+++ b/libc/sysdeps/i386/i686/strtok_r.S
@@ -1,5 +1,5 @@
#define FUNCTION __strtok_r
#define USE_AS_STRTOK_R 1
#include <sysdeps/i386/i686/strtok.S>
-weak_alias (BP_SYM (__strtok_r), BP_SYM (strtok_r))
-strong_alias (BP_SYM (__strtok_r), BP_SYM (__GI___strtok_r))
+weak_alias (__strtok_r, strtok_r)
+strong_alias (__strtok_r, __GI___strtok_r)
diff --git a/libc/sysdeps/i386/lshift.S b/libc/sysdeps/i386/lshift.S
index 170d4e772..771891e57 100644
--- a/libc/sysdeps/i386/lshift.S
+++ b/libc/sysdeps/i386/lshift.S
@@ -18,18 +18,15 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+12 /* space for 3 saved regs */
+#define PARMS 4+12 /* space for 3 saved regs */
#define RES PARMS
-#define S RES+PTR_SIZE
-#define SIZE S+PTR_SIZE
+#define S RES+4
+#define SIZE S+4
#define CNT SIZE+4
.text
-ENTRY (BP_SYM (__mpn_lshift))
- ENTER
+ENTRY (__mpn_lshift)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -44,12 +41,6 @@ ENTRY (BP_SYM (__mpn_lshift))
cfi_rel_offset (esi, 4)
movl SIZE(%esp),%edx
movl CNT(%esp),%ecx
-#if __BOUNDED_POINTERS__
- shll $2, %edx /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %edx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, S(%esp), %edx)
- shrl $2, %edx
-#endif
subl $4,%esi /* adjust s_ptr */
movl (%esi,%edx,4),%ebx /* read most significant limb */
@@ -92,7 +83,6 @@ L(1): movl (%esi,%edx,4),%eax
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
cfi_restore_state
@@ -109,6 +99,5 @@ L(end): shll %cl,%ebx /* compute least significant limb */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (__mpn_lshift))
+END (__mpn_lshift)
diff --git a/libc/sysdeps/i386/memchr.S b/libc/sysdeps/i386/memchr.S
index 53cba1009..67995002e 100644
--- a/libc/sysdeps/i386/memchr.S
+++ b/libc/sysdeps/i386/memchr.S
@@ -28,18 +28,15 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+8 /* space for 2 saved regs */
+#define PARMS 4+8 /* space for 2 saved regs */
#define RTN PARMS
-#define STR RTN+RTN_SIZE
-#define CHR STR+PTR_SIZE
+#define STR RTN
+#define CHR STR+4
#define LEN CHR+4
.text
-ENTRY (BP_SYM (__memchr))
- ENTER
+ENTRY (__memchr)
/* Save callee-safe registers used in this function. */
pushl %esi
@@ -53,7 +50,6 @@ ENTRY (BP_SYM (__memchr))
movl CHR(%esp), %edx /* c: byte we are looking for. */
movl LEN(%esp), %esi /* len: length of memory block. */
cfi_rel_offset (esi, 4)
- CHECK_BOUNDS_LOW (%eax, STR(%esp))
/* If my must not test more than three characters test
them one by one. This is especially true for 0. */
@@ -312,28 +308,15 @@ L(8): testb %cl, %cl /* test first byte in dword */
incl %eax /* increment source pointer */
/* No further test needed we we know it is one of the four bytes. */
-L(9):
-#if __BOUNDED_POINTERS__
- CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
- /* If RTN pointer is phony, don't copy return value into it. */
- movl RTN(%esp), %ecx
- testl %ecx, %ecx
- jz L(pop)
- RETURN_BOUNDED_POINTER (STR(%esp))
-#endif
-L(pop): popl %edi /* pop saved registers */
+L(9): popl %edi /* pop saved registers */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
popl %esi
cfi_adjust_cfa_offset (-4)
cfi_restore (esi)
- LEAVE
- RET_PTR
-END (BP_SYM (__memchr))
+ ret
+END (__memchr)
-weak_alias (BP_SYM (__memchr), BP_SYM (memchr))
-#if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
-#endif
+weak_alias (__memchr, memchr)
libc_hidden_builtin_def (memchr)
diff --git a/libc/sysdeps/i386/memcmp.S b/libc/sysdeps/i386/memcmp.S
index f24ec9383..21e0bfcd1 100644
--- a/libc/sysdeps/i386/memcmp.S
+++ b/libc/sysdeps/i386/memcmp.S
@@ -18,17 +18,14 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+4 /* space for 1 saved reg */
+#define PARMS 4+4 /* space for 1 saved reg */
#define BLK1 PARMS
-#define BLK2 BLK1+PTR_SIZE
-#define LEN BLK2+PTR_SIZE
+#define BLK2 BLK1+4
+#define LEN BLK2+4
.text
-ENTRY (BP_SYM (memcmp))
- ENTER
+ENTRY (memcmp)
pushl %esi /* Save callee-safe registers. */
cfi_adjust_cfa_offset (4)
@@ -40,8 +37,6 @@ ENTRY (BP_SYM (memcmp))
cfi_rel_offset (esi, 0)
movl BLK2(%esp), %edi
movl LEN(%esp), %ecx
- CHECK_BOUNDS_LOW (%esi, BLK1(%esp))
- CHECK_BOUNDS_LOW (%edi, BLK2(%esp))
cld /* Set direction of comparison. */
@@ -64,18 +59,15 @@ ENTRY (BP_SYM (memcmp))
Note that the following operation does not change 0xffffffff. */
orb $1, %al /* Change 0 to 1. */
-L(1): CHECK_BOUNDS_HIGH (%esi, BLK1(%esp), jbe)
- CHECK_BOUNDS_HIGH (%edi, BLK2(%esp), jbe)
- popl %esi /* Restore registers. */
+L(1): popl %esi /* Restore registers. */
cfi_adjust_cfa_offset (-4)
cfi_restore (esi)
movl %edx, %edi
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (memcmp))
+END (memcmp)
#undef bcmp
-weak_alias (BP_SYM (memcmp), BP_SYM (bcmp))
-libc_hidden_builtin_def (BP_SYM (memcmp))
+weak_alias (memcmp, bcmp)
+libc_hidden_builtin_def (memcmp)
diff --git a/libc/sysdeps/i386/mul_1.S b/libc/sysdeps/i386/mul_1.S
index 4ecd33e98..896ba1230 100644
--- a/libc/sysdeps/i386/mul_1.S
+++ b/libc/sysdeps/i386/mul_1.S
@@ -19,13 +19,11 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+16 /* space for 4 saved regs */
+#define PARMS 4+16 /* space for 4 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define SIZE S1+PTR_SIZE
+#define S1 RES+4
+#define SIZE S1+4
#define S2LIMB SIZE+4
#define res_ptr edi
@@ -34,8 +32,7 @@
#define s2_limb ebx
.text
-ENTRY (BP_SYM (__mpn_mul_1))
- ENTER
+ENTRY (__mpn_mul_1)
pushl %res_ptr
cfi_adjust_cfa_offset (4)
@@ -53,12 +50,6 @@ ENTRY (BP_SYM (__mpn_mul_1))
movl SIZE(%esp), %size
movl S2LIMB(%esp), %s2_limb
cfi_rel_offset (s2_limb, 0)
-#if __BOUNDED_POINTERS__
- shll $2, %size /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%res_ptr, RES(%esp), %size)
- CHECK_BOUNDS_BOTH_WIDE (%s1_ptr, S1(%esp), %size)
- shrl $2, %size
-#endif
leal (%res_ptr,%size,4), %res_ptr
leal (%s1_ptr,%size,4), %s1_ptr
negl %size
@@ -90,7 +81,6 @@ L(oop):
cfi_adjust_cfa_offset (-4)
cfi_restore (res_ptr)
- LEAVE
ret
#undef size
-END (BP_SYM (__mpn_mul_1))
+END (__mpn_mul_1)
diff --git a/libc/sysdeps/i386/rawmemchr.S b/libc/sysdeps/i386/rawmemchr.S
index 1a8e33c44..2bd20e045 100644
--- a/libc/sysdeps/i386/rawmemchr.S
+++ b/libc/sysdeps/i386/rawmemchr.S
@@ -28,17 +28,14 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+4 /* space for 1 saved reg */
+#define PARMS 4+4 /* space for 1 saved reg */
#define RTN PARMS
-#define STR RTN+RTN_SIZE
-#define CHR STR+PTR_SIZE
+#define STR RTN
+#define CHR STR+4
.text
-ENTRY (BP_SYM (__rawmemchr))
- ENTER
+ENTRY (__rawmemchr)
/* Save callee-safe register used in this function. */
pushl %edi
@@ -48,7 +45,6 @@ ENTRY (BP_SYM (__rawmemchr))
/* Load parameters into registers. */
movl STR(%esp), %eax
movl CHR(%esp), %edx
- CHECK_BOUNDS_LOW (%eax, STR(%esp))
/* At the moment %edx contains C. What we need for the
algorithm is C in all bytes of the dword. Avoid
@@ -215,15 +211,12 @@ L(8): testb %cl, %cl /* test first byte in dword */
/* No further test needed we we know it is one of the four bytes. */
L(9):
- CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
- RETURN_BOUNDED_POINTER (STR(%esp))
popl %edi /* pop saved register */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
-END (BP_SYM (__rawmemchr))
+ ret
+END (__rawmemchr)
-libc_hidden_def (BP_SYM (__rawmemchr))
-weak_alias (BP_SYM (__rawmemchr), BP_SYM (rawmemchr))
+libc_hidden_def (__rawmemchr)
+weak_alias (__rawmemchr, rawmemchr)
diff --git a/libc/sysdeps/i386/rshift.S b/libc/sysdeps/i386/rshift.S
index 81af68dd7..5f4122712 100644
--- a/libc/sysdeps/i386/rshift.S
+++ b/libc/sysdeps/i386/rshift.S
@@ -18,18 +18,15 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+12 /* space for 3 saved regs */
+#define PARMS 4+12 /* space for 3 saved regs */
#define RES PARMS
-#define S RES+PTR_SIZE
-#define SIZE S+PTR_SIZE
+#define S RES+4
+#define SIZE S+4
#define CNT SIZE+4
.text
-ENTRY (BP_SYM (__mpn_rshift))
- ENTER
+ENTRY (__mpn_rshift)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -44,12 +41,6 @@ ENTRY (BP_SYM (__mpn_rshift))
cfi_rel_offset (esi, 4)
movl SIZE(%esp),%edx
movl CNT(%esp),%ecx
-#if __BOUNDED_POINTERS__
- shll $2, %edx /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %edx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, S(%esp), %edx)
- shrl $2, %edx
-#endif
leal -4(%edi,%edx,4),%edi
leal (%esi,%edx,4),%esi
negl %edx
@@ -94,7 +85,6 @@ L(1): movl (%esi,%edx,4),%eax
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
cfi_restore_state
@@ -111,6 +101,5 @@ L(end): shrl %cl,%ebx /* compute most significant limb */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (__mpn_rshift))
+END (__mpn_rshift)
diff --git a/libc/sysdeps/i386/setjmp.S b/libc/sysdeps/i386/setjmp.S
index 9c872f17a..039f6c4fa 100644
--- a/libc/sysdeps/i386/setjmp.S
+++ b/libc/sysdeps/i386/setjmp.S
@@ -19,19 +19,15 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#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 PARMS 4 /* no space for saved regs */
#define JMPBUF PARMS
-#define SIGMSK JMPBUF+PTR_SIZE
+#define SIGMSK JMPBUF+4
-ENTRY (BP_SYM (__sigsetjmp))
- ENTER
+ENTRY (__sigsetjmp)
movl JMPBUF(%esp), %eax
- CHECK_BOUNDS_BOTH_WIDE (%eax, JMPBUF(%esp), $JB_SIZE)
/* Save registers. */
movl %ebx, (JB_BX*4)(%eax)
@@ -42,13 +38,12 @@ ENTRY (BP_SYM (__sigsetjmp))
PTR_MANGLE (%ecx)
#endif
movl %ecx, (JB_SP*4)(%eax)
- movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ movl 0(%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
movl %ecx, (JB_PC*4)(%eax)
- LEAVE /* pop frame pointer to prepare for tail-call. */
movl %ebp, (JB_BP*4)(%eax) /* Save caller's frame pointer. */
#if defined NOT_IN_libc && defined IS_IN_rtld
@@ -59,4 +54,4 @@ ENTRY (BP_SYM (__sigsetjmp))
/* Make a tail call to __sigjmp_save; it takes the same args. */
jmp __sigjmp_save
#endif
-END (BP_SYM (__sigsetjmp))
+END (__sigsetjmp)
diff --git a/libc/sysdeps/i386/start.S b/libc/sysdeps/i386/start.S
index afaf2cd02..51187652d 100644
--- a/libc/sysdeps/i386/start.S
+++ b/libc/sysdeps/i386/start.S
@@ -52,8 +52,6 @@
NULL
*/
-#include "bp-sym.h"
-
.text
.globl _start
.type _start,@function
@@ -97,11 +95,11 @@ _start:
pushl %ecx /* Push second argument: argv. */
pushl %esi /* Push first argument: argc. */
- pushl BP_SYM (main)@GOT(%ebx)
+ pushl main@GOT(%ebx)
/* Call the user's main function, and exit with its value.
But let the libc call main. */
- call BP_SYM (__libc_start_main)@PLT
+ call __libc_start_main@PLT
#else
/* Push address of our own entry points to .fini and .init. */
pushl $__libc_csu_fini
@@ -110,11 +108,11 @@ _start:
pushl %ecx /* Push second argument: argv. */
pushl %esi /* Push first argument: argc. */
- pushl $BP_SYM (main)
+ pushl $main
/* Call the user's main function, and exit with its value.
But let the libc call main. */
- call BP_SYM (__libc_start_main)
+ call __libc_start_main
#endif
hlt /* Crash if somehow `exit' does return. */
diff --git a/libc/sysdeps/i386/stpcpy.S b/libc/sysdeps/i386/stpcpy.S
index 5c80c8ca2..3c7562ed4 100644
--- a/libc/sysdeps/i386/stpcpy.S
+++ b/libc/sysdeps/i386/stpcpy.S
@@ -23,22 +23,17 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define RTN PARMS
-#define DEST RTN+RTN_SIZE
-#define SRC DEST+PTR_SIZE
+#define DEST RTN
+#define SRC DEST+4
.text
-ENTRY (BP_SYM (__stpcpy))
- ENTER
+ENTRY (__stpcpy)
movl DEST(%esp), %eax
movl SRC(%esp), %ecx
- CHECK_BOUNDS_LOW (%eax, DEST(%esp))
- CHECK_BOUNDS_LOW (%ecx, SRC(%esp))
subl %eax, %ecx /* magic: reduce number of loop variants
to one using addressing mode */
@@ -84,13 +79,10 @@ L(1): addl $4, %eax /* increment loop counter */
L(4): incl %eax
L(3): incl %eax
L(2):
- CHECK_BOUNDS_HIGH (%eax, DEST(%esp), jb)
- RETURN_BOUNDED_POINTER (DEST(%esp))
- LEAVE
- RET_PTR
-END (BP_SYM (__stpcpy))
+ ret
+END (__stpcpy)
-weak_alias (BP_SYM (__stpcpy), BP_SYM (stpcpy))
+weak_alias (__stpcpy, stpcpy)
libc_hidden_def (__stpcpy)
libc_hidden_builtin_def (stpcpy)
diff --git a/libc/sysdeps/i386/stpncpy.S b/libc/sysdeps/i386/stpncpy.S
index 05fd12abc..11882738d 100644
--- a/libc/sysdeps/i386/stpncpy.S
+++ b/libc/sysdeps/i386/stpncpy.S
@@ -25,18 +25,15 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+4 /* space for 1 saved reg */
+#define PARMS 4+4 /* space for 1 saved reg */
#define RTN PARMS
-#define DEST RTN+RTN_SIZE
-#define SRC DEST+PTR_SIZE
-#define LEN SRC+PTR_SIZE
+#define DEST RTN
+#define SRC DEST+4
+#define LEN SRC+4
.text
-ENTRY (BP_SYM (__stpncpy))
- ENTER
+ENTRY (__stpncpy)
pushl %esi
cfi_adjust_cfa_offset (4)
@@ -45,8 +42,6 @@ ENTRY (BP_SYM (__stpncpy))
movl SRC(%esp), %esi
cfi_rel_offset (esi, 0)
movl LEN(%esp), %ecx
- CHECK_BOUNDS_LOW (%eax, DEST(%esp))
- CHECK_BOUNDS_LOW (%esi, SRC(%esp))
subl %eax, %esi /* magic: reduce number of loop variants
to one using addressing mode */
@@ -141,20 +136,12 @@ L(8):
L(3): decl %ecx /* all bytes written? */
jnz L(8) /* no, then again */
-L(9):
-#if __BOUNDED_POINTERS__
- addl %eax, %esi /* undo magic: %esi now points beyond end of SRC */
- CHECK_BOUNDS_HIGH (%esi, SRC(%esp), jbe)
- CHECK_BOUNDS_HIGH (%eax, DEST(%esp), jbe)
- RETURN_BOUNDED_POINTER (DEST(%esp))
-#endif
- popl %esi /* restore saved register content */
+L(9): popl %esi /* restore saved register content */
cfi_adjust_cfa_offset (-4)
cfi_restore (esi)
- LEAVE
- RET_PTR
-END (BP_SYM (__stpncpy))
+ ret
+END (__stpncpy)
-libc_hidden_def (BP_SYM (__stpncpy))
-weak_alias (BP_SYM (__stpncpy), BP_SYM (stpncpy))
+libc_hidden_def (__stpncpy)
+weak_alias (__stpncpy, stpncpy)
diff --git a/libc/sysdeps/i386/strchr.S b/libc/sysdeps/i386/strchr.S
index b0ba99b42..666c7498f 100644
--- a/libc/sysdeps/i386/strchr.S
+++ b/libc/sysdeps/i386/strchr.S
@@ -21,24 +21,20 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+4 /* space for 1 saved reg */
+#define PARMS 4+4 /* space for 1 saved reg */
#define RTN PARMS
-#define STR RTN+RTN_SIZE
-#define CHR STR+PTR_SIZE
+#define STR RTN
+#define CHR STR+4
.text
-ENTRY (BP_SYM (strchr))
- ENTER
+ENTRY (strchr)
pushl %edi /* Save callee-safe registers used here. */
cfi_adjust_cfa_offset (4)
cfi_rel_offset (edi, 0)
movl STR(%esp), %eax
movl CHR(%esp), %edx
- CHECK_BOUNDS_LOW (%eax, STR(%esp))
/* At the moment %edx contains C. What we need for the
algorithm is C in all bytes of the dword. Avoid
@@ -243,13 +239,11 @@ L(11): movl (%eax), %ecx /* get word (= 4 bytes) in question */
L(2): /* Return NULL. */
xorl %eax, %eax
- RETURN_NULL_BOUNDED_POINTER
popl %edi /* restore saved register content */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
+ ret
cfi_adjust_cfa_offset (4)
cfi_rel_offset (edi, 0)
@@ -285,15 +279,12 @@ L(7): testb %cl, %cl /* is first byte C? */
incl %eax
L(6):
- CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
- RETURN_BOUNDED_POINTER (STR(%esp))
popl %edi /* restore saved register content */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
-END (BP_SYM (strchr))
+ ret
+END (strchr)
-weak_alias (BP_SYM (strchr), BP_SYM (index))
+weak_alias (strchr, index)
libc_hidden_builtin_def (strchr)
diff --git a/libc/sysdeps/i386/strchrnul.S b/libc/sysdeps/i386/strchrnul.S
index d2879cf9c..7ceb88ed8 100644
--- a/libc/sysdeps/i386/strchrnul.S
+++ b/libc/sysdeps/i386/strchrnul.S
@@ -22,17 +22,14 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+4 /* space for 1 saved reg */
+#define PARMS 4+4 /* space for 1 saved reg */
#define RTN PARMS
-#define STR RTN+RTN_SIZE
-#define CHR STR+PTR_SIZE
+#define STR RTN
+#define CHR STR+4
.text
-ENTRY (BP_SYM (__strchrnul))
- ENTER
+ENTRY (__strchrnul)
pushl %edi /* Save callee-safe registers used here. */
cfi_adjust_cfa_offset (4)
@@ -40,7 +37,6 @@ ENTRY (BP_SYM (__strchrnul))
movl STR(%esp), %eax
movl CHR(%esp), %edx
- CHECK_BOUNDS_LOW (%eax, STR(%esp))
/* At the moment %edx contains CHR. What we need for the
algorithm is CHR in all bytes of the dword. Avoid
@@ -272,14 +268,11 @@ L(7): testb %cl, %cl /* is first byte CHR? */
/* It must be in the fourth byte and it cannot be NUL. */
incl %eax
-L(6): CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
- RETURN_BOUNDED_POINTER (STR(%esp))
- popl %edi /* restore saved register content */
+L(6): popl %edi /* restore saved register content */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
-END (BP_SYM (__strchrnul))
+ ret
+END (__strchrnul)
-weak_alias (BP_SYM (__strchrnul), BP_SYM (strchrnul))
+weak_alias (__strchrnul, strchrnul)
diff --git a/libc/sysdeps/i386/strcspn.S b/libc/sysdeps/i386/strcspn.S
index 5f6633fea..0c262d600 100644
--- a/libc/sysdeps/i386/strcspn.S
+++ b/libc/sysdeps/i386/strcspn.S
@@ -22,20 +22,16 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define STR PARMS
-#define STOP STR+PTR_SIZE
+#define STOP STR+4
.text
-ENTRY (BP_SYM (strcspn))
- ENTER
+ENTRY (strcspn)
movl STR(%esp), %edx
movl STOP(%esp), %eax
- CHECK_BOUNDS_LOW (%edx, STR(%esp))
/* First we create a table with flags for all possible characters.
For the ASCII (7bit/8bit) or ISO-8859-X character sets which are
@@ -236,11 +232,9 @@ L(5): incl %eax
L(4): addl $256, %esp /* remove stopset */
cfi_adjust_cfa_offset (-256)
- CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
subl %edx, %eax /* we have to return the number of valid
characters, so compute distance to first
non-valid character */
- LEAVE
ret
-END (BP_SYM (strcspn))
+END (strcspn)
libc_hidden_builtin_def (strcspn)
diff --git a/libc/sysdeps/i386/strpbrk.S b/libc/sysdeps/i386/strpbrk.S
index 617a11991..bbc0cbeb6 100644
--- a/libc/sysdeps/i386/strpbrk.S
+++ b/libc/sysdeps/i386/strpbrk.S
@@ -22,21 +22,17 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define RTN PARMS
-#define STR RTN+RTN_SIZE
-#define STOP STR+PTR_SIZE
+#define STR RTN
+#define STOP STR+4
.text
-ENTRY (BP_SYM (strpbrk))
- ENTER
+ENTRY (strpbrk)
movl STR(%esp), %edx
movl STOP(%esp), %eax
- CHECK_BOUNDS_LOW (%edx, STR(%esp))
/* First we create a table with flags for all possible characters.
For the ASCII (7bit/8bit) or ISO-8859-X character sets which are
@@ -238,18 +234,10 @@ L(5): incl %eax
L(4): addl $256, %esp /* remove stopset */
cfi_adjust_cfa_offset (-256)
- CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
orb %cl, %cl /* was last character NUL? */
jnz L(7) /* no => return pointer */
xorl %eax, %eax
- RETURN_NULL_BOUNDED_POINTER
- LEAVE
- RET_PTR
-
-L(7): RETURN_BOUNDED_POINTER (STR(%esp))
-
- LEAVE
- RET_PTR
-END (BP_SYM (strpbrk))
+L(7): ret
+END (strpbrk)
libc_hidden_builtin_def (strpbrk)
diff --git a/libc/sysdeps/i386/strrchr.S b/libc/sysdeps/i386/strrchr.S
index 623cf4e34..31b8a4562 100644
--- a/libc/sysdeps/i386/strrchr.S
+++ b/libc/sysdeps/i386/strrchr.S
@@ -21,17 +21,14 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+8 /* space for 2 saved regs */
+#define PARMS 4+8 /* space for 2 saved regs */
#define RTN PARMS
-#define STR RTN+RTN_SIZE
-#define CHR STR+PTR_SIZE
+#define STR RTN
+#define CHR STR+4
.text
-ENTRY (BP_SYM (strrchr))
- ENTER
+ENTRY (strrchr)
pushl %edi /* Save callee-safe registers used here. */
cfi_adjust_cfa_offset (4)
@@ -43,7 +40,6 @@ ENTRY (BP_SYM (strrchr))
movl STR(%esp), %esi
cfi_rel_offset (esi, 0)
movl CHR(%esp), %ecx
- CHECK_BOUNDS_LOW (%esi, STR(%esp))
/* At the moment %ecx contains C. What we need for the
algorithm is C in all bytes of the dword. Avoid
@@ -324,18 +320,15 @@ L(26): testb %dl, %dl /* is third byte == NUL */
jne L(2) /* no => skip */
leal 3(%esi), %eax /* store address as result */
-L(2): CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
- RETURN_BOUNDED_POINTER (STR(%esp))
- popl %esi /* restore saved register content */
+L(2): popl %esi /* restore saved register content */
cfi_adjust_cfa_offset (-4)
cfi_restore (esi)
popl %edi
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
-END (BP_SYM (strrchr))
+ ret
+END (strrchr)
-weak_alias (BP_SYM (strrchr), BP_SYM (rindex))
+weak_alias (strrchr, rindex)
libc_hidden_builtin_def (strrchr)
diff --git a/libc/sysdeps/i386/strspn.S b/libc/sysdeps/i386/strspn.S
index decb9afdb..1865e4920 100644
--- a/libc/sysdeps/i386/strspn.S
+++ b/libc/sysdeps/i386/strspn.S
@@ -22,20 +22,16 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define STR PARMS
-#define SKIP STR+PTR_SIZE
+#define SKIP STR+4
.text
-ENTRY (BP_SYM (strspn))
- ENTER
+ENTRY (strspn)
movl STR(%esp), %edx
movl SKIP(%esp), %eax
- CHECK_BOUNDS_LOW (%edx, STR(%esp))
/* First we create a table with flags for all possible characters.
For the ASCII (7bit/8bit) or ISO-8859-X character sets which are
@@ -236,11 +232,9 @@ L(5): incl %eax
L(4): addl $256, %esp /* remove stopset */
cfi_adjust_cfa_offset (-256)
- CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
subl %edx, %eax /* we have to return the number of valid
characters, so compute distance to first
non-valid character */
- LEAVE
ret
-END (BP_SYM (strspn))
+END (strspn)
libc_hidden_builtin_def (strspn)
diff --git a/libc/sysdeps/i386/strtok.S b/libc/sysdeps/i386/strtok.S
index 4dde8c70f..79d540b60 100644
--- a/libc/sysdeps/i386/strtok.S
+++ b/libc/sysdeps/i386/strtok.S
@@ -20,8 +20,6 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
/* This file can be used for three variants of the strtok function:
@@ -46,11 +44,7 @@
.type save_ptr, @object
.size save_ptr, 4
save_ptr:
-# if __BOUNDED_POINTERS__
- .space 12
-# else
.space 4
-# endif
# ifdef PIC
# define SAVE_PTR save_ptr@GOTOFF(%ebx)
@@ -61,19 +55,17 @@ save_ptr:
# define FUNCTION strtok
#endif
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define RTN PARMS
-#define STR RTN+RTN_SIZE
-#define DELIM STR+PTR_SIZE
-#define SAVE DELIM+PTR_SIZE
+#define STR RTN
+#define DELIM STR+4
+#define SAVE DELIM+4
.text
-ENTRY (BP_SYM (FUNCTION))
- ENTER
+ENTRY (FUNCTION)
movl STR(%esp), %edx
movl DELIM(%esp), %eax
- CHECK_BOUNDS_LOW (%eax, DELIM(%esp))
#if !defined USE_AS_STRTOK_R && defined PIC
pushl %ebx /* Save PIC register. */
@@ -90,22 +82,7 @@ L(here):
/* If the pointer is NULL we have to use the stored value of
the last run. */
cmpl $0, %edx
-#if __BOUNDED_POINTERS__
- movl SAVE(%esp), %ecx
- je L(0)
- /* Save bounds of incoming non-NULL STR into save area. */
- movl 4+STR(%esp), %eax
- movl %eax, 4+SAVE_PTR
- movl 8+STR(%esp), %eax
- movl %eax, 8+SAVE_PTR
- CHECK_BOUNDS_LOW (%edx, SAVE_PTR)
- jmp L(1)
-L(0): movl SAVE_PTR, %edx
- CHECK_BOUNDS_LOW (%edx, SAVE_PTR)
- jmp L(1)
-#else
jne L(1)
-#endif
#ifdef USE_AS_STRTOK_R
/* The value is stored in the third argument. */
@@ -267,12 +244,12 @@ L(2): movb (%eax), %cl /* get byte from stopset */
movb 1(%eax), %cl /* get byte from stopset */
testb $0xff, %cl /* is NUL char? */
- jz L(1_2) /* yes => start compare loop */
+ jz L(1_1) /* yes => start compare loop */
movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
movb 2(%eax), %cl /* get byte from stopset */
testb $0xff, %cl /* is NUL char? */
- jz L(1_3) /* yes => start compare loop */
+ jz L(1_1) /* yes => start compare loop */
movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
movb 3(%eax), %cl /* get byte from stopset */
@@ -281,16 +258,7 @@ L(2): movb (%eax), %cl /* get byte from stopset */
testb $0xff, %cl /* is NUL char? */
jnz L(2) /* no => process next dword from stopset */
-#if __BOUNDED_POINTERS__
- jmp L(1_0) /* pointer is correct for bounds check */
-L(1_3): incl %eax /* adjust pointer for bounds check */
-L(1_2): incl %eax /* ditto */
-L(1_1): incl %eax /* ditto */
-L(1_0): CHECK_BOUNDS_HIGH (%eax, DELIM(%esp), jbe)
-#else
-L(1_3):; L(1_2):; L(1_1): /* fall through */
-#endif
- leal -4(%edx), %eax /* prepare loop */
+L(1_1): leal -4(%edx), %eax /* prepare loop */
/* We use a neat trick for the following loop. Normally we would
have to test for two termination conditions
@@ -370,8 +338,6 @@ L(11):
movl SAVE(%esp), %ecx
#endif
movl %edx, SAVE_PTR
- CHECK_BOUNDS_HIGH (%edx, SAVE_PTR, jb)
- RETURN_BOUNDED_POINTER (SAVE_PTR)
L(epilogue):
#if !defined USE_AS_STRTOK_R && defined PIC
@@ -379,8 +345,7 @@ L(epilogue):
cfi_adjust_cfa_offset (-4)
cfi_restore (ebx)
#endif
- LEAVE
- RET_PTR
+ ret
L(returnNULL):
xorl %eax, %eax
@@ -388,7 +353,6 @@ L(returnNULL):
movl SAVE(%esp), %ecx
#endif
movl %edx, SAVE_PTR
- RETURN_NULL_BOUNDED_POINTER
jmp L(epilogue)
-END (BP_SYM (FUNCTION))
+END (FUNCTION)
diff --git a/libc/sysdeps/i386/strtok_r.S b/libc/sysdeps/i386/strtok_r.S
index f4a6a2c40..508729370 100644
--- a/libc/sysdeps/i386/strtok_r.S
+++ b/libc/sysdeps/i386/strtok_r.S
@@ -1,5 +1,5 @@
#define FUNCTION __strtok_r
#define USE_AS_STRTOK_R 1
#include <sysdeps/i386/strtok.S>
-weak_alias (BP_SYM (__strtok_r), BP_SYM (strtok_r))
-strong_alias (BP_SYM (__strtok_r), BP_SYM (__GI___strtok_r))
+weak_alias (__strtok_r, strtok_r)
+strong_alias (__strtok_r, __GI___strtok_r)
diff --git a/libc/sysdeps/i386/sub_n.S b/libc/sysdeps/i386/sub_n.S
index 341e84988..40d430d6e 100644
--- a/libc/sysdeps/i386/sub_n.S
+++ b/libc/sysdeps/i386/sub_n.S
@@ -19,18 +19,15 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+8 /* space for 2 saved regs */
+#define PARMS 4+8 /* space for 2 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define S2 S1+PTR_SIZE
-#define SIZE S2+PTR_SIZE
+#define S1 RES+4
+#define S2 S1+4
+#define SIZE S2+4
.text
-ENTRY (BP_SYM (__mpn_sub_n))
- ENTER
+ENTRY (__mpn_sub_n)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -43,13 +40,6 @@ ENTRY (BP_SYM (__mpn_sub_n))
cfi_rel_offset (esi, 0)
movl S2(%esp),%edx
movl SIZE(%esp),%ecx
-#if __BOUNDED_POINTERS__
- shll $2, %ecx /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, S1(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%edx, S2(%esp), %ecx)
- shrl $2, %ecx
-#endif
movl %ecx,%eax
shrl $3,%ecx /* compute count for unrolled loop */
negl %eax
@@ -117,6 +107,5 @@ L(oop): movl (%esi),%eax
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (__mpn_sub_n))
+END (__mpn_sub_n)
diff --git a/libc/sysdeps/i386/submul_1.S b/libc/sysdeps/i386/submul_1.S
index d4588f910..a0ecfb5ed 100644
--- a/libc/sysdeps/i386/submul_1.S
+++ b/libc/sysdeps/i386/submul_1.S
@@ -19,13 +19,11 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+16 /* space for 4 saved regs */
+#define PARMS 4+16 /* space for 4 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define SIZE S1+PTR_SIZE
+#define S1 RES+4
+#define SIZE S1+4
#define S2LIMB SIZE+4
#define res_ptr edi
@@ -34,8 +32,7 @@
#define s2_limb ebx
.text
-ENTRY (BP_SYM (__mpn_submul_1))
- ENTER
+ENTRY (__mpn_submul_1)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -54,12 +51,6 @@ ENTRY (BP_SYM (__mpn_submul_1))
movl S1(%esp), %s1_ptr
movl SIZE(%esp), %sizeP
movl S2LIMB(%esp), %s2_limb
-#if __BOUNDED_POINTERS__
- shll $2, %sizeP /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%res_ptr, RES(%esp), %sizeP)
- CHECK_BOUNDS_BOTH_WIDE (%s1_ptr, S1(%esp), %sizeP)
- shrl $2, %sizeP
-#endif
leal (%res_ptr,%sizeP,4), %res_ptr
leal (%s1_ptr,%sizeP,4), %s1_ptr
negl %sizeP
@@ -91,6 +82,5 @@ L(oop):
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (__mpn_submul_1))
+END (__mpn_submul_1)
diff --git a/libc/sysdeps/ieee754/bits/nan.h b/libc/sysdeps/ieee754/bits/nan.h
index d3ab38ba7..935271a7c 100644
--- a/libc/sysdeps/ieee754/bits/nan.h
+++ b/libc/sysdeps/ieee754/bits/nan.h
@@ -46,7 +46,7 @@
# endif
static union { unsigned char __c[4]; float __d; } __nan_union
- __attribute_used__ = { __nan_bytes };
+ __attribute__ ((__unused__)) = { __nan_bytes };
# define NAN (__nan_union.__d)
#endif /* GCC. */
diff --git a/libc/sysdeps/ieee754/dbl-64/mpa.c b/libc/sysdeps/ieee754/dbl-64/mpa.c
index ede8ed198..8fc2626f7 100644
--- a/libc/sysdeps/ieee754/dbl-64/mpa.c
+++ b/libc/sysdeps/ieee754/dbl-64/mpa.c
@@ -43,6 +43,7 @@
#include "endian.h"
#include "mpa.h"
#include <sys/param.h>
+#include <alloca.h>
#ifndef SECTION
# define SECTION
@@ -59,8 +60,9 @@ const mp_no mptwo = {1, {1.0, 2.0}};
static int
mcr (const mp_no *x, const mp_no *y, int p)
{
- int i;
- for (i = 1; i <= p; i++)
+ long i;
+ long p2 = p;
+ for (i = 1; i <= p2; i++)
{
if (X[i] == Y[i])
continue;
@@ -76,7 +78,7 @@ mcr (const mp_no *x, const mp_no *y, int p)
int
__acr (const mp_no *x, const mp_no *y, int p)
{
- int i;
+ long i;
if (X[0] == ZERO)
{
@@ -107,8 +109,10 @@ __acr (const mp_no *x, const mp_no *y, int p)
void
__cpy (const mp_no *x, mp_no *y, int p)
{
+ long i;
+
EY = EX;
- for (int i = 0; i <= p; i++)
+ for (i = 0; i <= p; i++)
Y[i] = X[i];
}
#endif
@@ -119,8 +123,8 @@ __cpy (const mp_no *x, mp_no *y, int p)
static void
norm (const mp_no *x, double *y, int p)
{
-#define R RADIXI
- int i;
+#define R RADIXI
+ long i;
double a, c, u, v, z[5];
if (p < 5)
{
@@ -194,17 +198,18 @@ norm (const mp_no *x, double *y, int p)
static void
denorm (const mp_no *x, double *y, int p)
{
- int i, k;
+ long i, k;
+ long p2 = p;
double c, u, z[5];
-#define R RADIXI
+#define R RADIXI
if (EX < -44 || (EX == -44 && X[1] < TWO5))
{
*y = ZERO;
return;
}
- if (p == 1)
+ if (p2 == 1)
{
if (EX == -42)
{
@@ -228,7 +233,7 @@ denorm (const mp_no *x, double *y, int p)
k = 1;
}
}
- else if (p == 2)
+ else if (p2 == 2)
{
if (EX == -42)
{
@@ -281,7 +286,7 @@ denorm (const mp_no *x, double *y, int p)
if (u == z[3])
{
- for (i = k + 1; i <= p; i++)
+ for (i = k + 1; i <= p2; i++)
{
if (X[i] == ZERO)
continue;
@@ -323,7 +328,8 @@ void
SECTION
__dbl_mp (double x, mp_no *y, int p)
{
- int i, n;
+ long i, n;
+ long p2 = p;
double u;
/* Sign. */
@@ -347,7 +353,7 @@ __dbl_mp (double x, mp_no *y, int p)
x *= RADIX;
/* Digits. */
- n = MIN (p, 4);
+ n = MIN (p2, 4);
for (i = 1; i <= n; i++)
{
u = (x + TWO52) - TWO52;
@@ -357,7 +363,7 @@ __dbl_mp (double x, mp_no *y, int p)
x -= u;
x *= RADIX;
}
- for (; i <= p; i++)
+ for (; i <= p2; i++)
Y[i] = ZERO;
}
@@ -369,53 +375,64 @@ static void
SECTION
add_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p)
{
- int i, j, k;
+ long i, j, k;
+ long p2 = p;
+ double zk;
EZ = EX;
- i = p;
- j = p + EY - EX;
- k = p + 1;
+ i = p2;
+ j = p2 + EY - EX;
+ k = p2 + 1;
- if (j < 1)
+ if (__glibc_unlikely (j < 1))
{
__cpy (x, z, p);
return;
}
- else
- Z[k] = ZERO;
+
+ zk = ZERO;
for (; j > 0; i--, j--)
{
- Z[k] += X[i] + Y[j];
- if (Z[k] >= RADIX)
+ zk += X[i] + Y[j];
+ if (zk >= RADIX)
{
- Z[k] -= RADIX;
- Z[--k] = ONE;
+ Z[k--] = zk - RADIX;
+ zk = ONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
for (; i > 0; i--)
{
- Z[k] += X[i];
- if (Z[k] >= RADIX)
+ zk += X[i];
+ if (zk >= RADIX)
{
- Z[k] -= RADIX;
- Z[--k] = ONE;
+ Z[k--] = zk - RADIX;
+ zk = ONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
- if (Z[1] == ZERO)
+ if (zk == ZERO)
{
- for (i = 1; i <= p; i++)
+ for (i = 1; i <= p2; i++)
Z[i] = Z[i + 1];
}
else
- EZ += ONE;
+ {
+ Z[1] = zk;
+ EZ += ONE;
+ }
}
/* Subtract the magnitudes of *X and *Y assuming that abs (*x) > abs (*y) > 0.
@@ -426,71 +443,70 @@ static void
SECTION
sub_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p)
{
- int i, j, k;
+ long i, j, k;
+ long p2 = p;
+ double zk;
EZ = EX;
+ i = p2;
+ j = p2 + EY - EX;
+ k = p2;
- if (EX == EY)
+ /* Y is too small compared to X, copy X over to the result. */
+ if (__glibc_unlikely (j < 1))
{
- i = j = k = p;
- Z[k] = Z[k + 1] = ZERO;
+ __cpy (x, z, p);
+ return;
}
- else
+
+ /* The relevant least significant digit in Y is non-zero, so we factor it in
+ to enhance accuracy. */
+ if (j < p2 && Y[j + 1] > ZERO)
{
- j = EX - EY;
- if (j > p)
- {
- __cpy (x, z, p);
- return;
- }
- else
- {
- i = p;
- j = p + 1 - j;
- k = p;
- if (Y[j] > ZERO)
- {
- Z[k + 1] = RADIX - Y[j--];
- Z[k] = MONE;
- }
- else
- {
- Z[k + 1] = ZERO;
- Z[k] = ZERO;
- j--;
- }
- }
+ Z[k + 1] = RADIX - Y[j + 1];
+ zk = MONE;
}
+ else
+ zk = Z[k + 1] = ZERO;
+ /* Subtract and borrow. */
for (; j > 0; i--, j--)
{
- Z[k] += (X[i] - Y[j]);
- if (Z[k] < ZERO)
+ zk += (X[i] - Y[j]);
+ if (zk < ZERO)
{
- Z[k] += RADIX;
- Z[--k] = MONE;
+ Z[k--] = zk + RADIX;
+ zk = MONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
+ /* We're done with digits from Y, so it's just digits in X. */
for (; i > 0; i--)
{
- Z[k] += X[i];
- if (Z[k] < ZERO)
+ zk += X[i];
+ if (zk < ZERO)
{
- Z[k] += RADIX;
- Z[--k] = MONE;
+ Z[k--] = zk + RADIX;
+ zk = MONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
+ /* Normalize. */
for (i = 1; Z[i] == ZERO; i++);
EZ = EZ - i + 1;
- for (k = 1; i <= p + 1;)
+ for (k = 1; i <= p2 + 1;)
Z[k++] = Z[i++];
- for (; k <= p;)
+ for (; k <= p2;)
Z[k++] = ZERO;
}
@@ -602,8 +618,11 @@ void
SECTION
__mul (const mp_no *x, const mp_no *y, mp_no *z, int p)
{
- int i, j, k, k2;
+ long i, j, k, ip, ip2;
+ long p2 = p;
double u, zk;
+ const mp_no *a;
+ double *diag;
/* Is z=0? */
if (__glibc_unlikely (X[0] * Y[0] == ZERO))
@@ -612,48 +631,238 @@ __mul (const mp_no *x, const mp_no *y, mp_no *z, int p)
return;
}
- /* Multiply, add and carry. */
- k2 = (__glibc_unlikely (p < 3)) ? p + p : p + 3;
- zk = Z[k2] = ZERO;
+ /* We need not iterate through all X's and Y's since it's pointless to
+ multiply zeroes. Here, both are zero... */
+ for (ip2 = p2; ip2 > 0; ip2--)
+ if (X[ip2] != ZERO || Y[ip2] != ZERO)
+ break;
+
+ a = X[ip2] != ZERO ? y : x;
+
+ /* ... and here, at least one of them is still zero. */
+ for (ip = ip2; ip > 0; ip--)
+ if (a->d[ip] != ZERO)
+ break;
+
+ /* The product looks like this for p = 3 (as an example):
+
+
+ a1 a2 a3
+ x b1 b2 b3
+ -----------------------------
+ a1*b3 a2*b3 a3*b3
+ a1*b2 a2*b2 a3*b2
+ a1*b1 a2*b1 a3*b1
+
+ So our K needs to ideally be P*2, but we're limiting ourselves to P + 3
+ for P >= 3. We compute the above digits in two parts; the last P-1
+ digits and then the first P digits. The last P-1 digits are a sum of
+ products of the input digits from P to P-k where K is 0 for the least
+ significant digit and increases as we go towards the left. The product
+ term is of the form X[k]*X[P-k] as can be seen in the above example.
+
+ The first P digits are also a sum of products with the same product term,
+ except that the sum is from 1 to k. This is also evident from the above
+ example.
+
+ Another thing that becomes evident is that only the most significant
+ ip+ip2 digits of the result are non-zero, where ip and ip2 are the
+ 'internal precision' of the input numbers, i.e. digits after ip and ip2
+ are all ZERO. */
+
+ k = (__glibc_unlikely (p2 < 3)) ? p2 + p2 : p2 + 3;
+
+ while (k > ip + ip2 + 1)
+ Z[k--] = ZERO;
- for (k = k2; k > p; k--)
+ zk = ZERO;
+
+ /* Precompute sums of diagonal elements so that we can directly use them
+ later. See the next comment to know we why need them. */
+ diag = alloca (k * sizeof (double));
+ double d = ZERO;
+ for (i = 1; i <= ip; i++)
+ {
+ d += X[i] * Y[i];
+ diag[i] = d;
+ }
+ while (i < k)
+ diag[i++] = d;
+
+ while (k > p2)
{
- for (i = k - p, j = p; i < p + 1; i++, j--)
- zk += X[i] * Y[j];
+ long lim = k / 2;
+
+ if (k % 2 == 0)
+ /* We want to add this only once, but since we subtract it in the sum
+ of products above, we add twice. */
+ zk += 2 * X[lim] * Y[lim];
+
+ for (i = k - p2, j = p2; i < j; i++, j--)
+ zk += (X[i] + X[j]) * (Y[i] + Y[j]);
+
+ zk -= diag[k - 1];
u = (zk + CUTTER) - CUTTER;
if (u > zk)
u -= RADIX;
- Z[k] = zk - u;
+ Z[k--] = zk - u;
zk = u * RADIXI;
}
+ /* The real deal. Mantissa digit Z[k] is the sum of all X[i] * Y[j] where i
+ goes from 1 -> k - 1 and j goes the same range in reverse. To reduce the
+ number of multiplications, we halve the range and if k is an even number,
+ add the diagonal element X[k/2]Y[k/2]. Through the half range, we compute
+ X[i] * Y[j] as (X[i] + X[j]) * (Y[i] + Y[j]) - X[i] * Y[i] - X[j] * Y[j].
+
+ This reduction tells us that we're summing two things, the first term
+ through the half range and the negative of the sum of the product of all
+ terms of X and Y in the full range. i.e.
+
+ SUM(X[i] * Y[i]) for k terms. This is precalculated above for each k in
+ a single loop so that it completes in O(n) time and can hence be directly
+ used in the loop below. */
while (k > 1)
{
- for (i = 1, j = k - 1; i < k; i++, j--)
- zk += X[i] * Y[j];
+ long lim = k / 2;
+
+ if (k % 2 == 0)
+ /* We want to add this only once, but since we subtract it in the sum
+ of products above, we add twice. */
+ zk += 2 * X[lim] * Y[lim];
+
+ for (i = 1, j = k - 1; i < j; i++, j--)
+ zk += (X[i] + X[j]) * (Y[i] + Y[j]);
+
+ zk -= diag[k - 1];
u = (zk + CUTTER) - CUTTER;
if (u > zk)
u -= RADIX;
- Z[k] = zk - u;
+ Z[k--] = zk - u;
zk = u * RADIXI;
- k--;
}
Z[k] = zk;
- EZ = EX + EY;
+ /* Get the exponent sum into an intermediate variable. This is a subtle
+ optimization, where given enough registers, all operations on the exponent
+ happen in registers and the result is written out only once into EZ. */
+ int e = EX + EY;
+
/* Is there a carry beyond the most significant digit? */
if (__glibc_unlikely (Z[1] == ZERO))
{
- for (i = 1; i <= p; i++)
+ for (i = 1; i <= p2; i++)
Z[i] = Z[i + 1];
- EZ--;
+ e--;
}
+ EZ = e;
Z[0] = X[0] * Y[0];
}
+/* Square *X and store result in *Y. X and Y may not overlap. For P in
+ [1, 2, 3], the exact result is truncated to P digits. In case P > 3 the
+ error is bounded by 1.001 ULP. This is a faster special case of
+ multiplication. */
+void
+SECTION
+__sqr (const mp_no *x, mp_no *y, int p)
+{
+ long i, j, k, ip;
+ double u, yk;
+
+ /* Is z=0? */
+ if (__glibc_unlikely (X[0] == ZERO))
+ {
+ Y[0] = ZERO;
+ return;
+ }
+
+ /* We need not iterate through all X's since it's pointless to
+ multiply zeroes. */
+ for (ip = p; ip > 0; ip--)
+ if (X[ip] != ZERO)
+ break;
+
+ k = (__glibc_unlikely (p < 3)) ? p + p : p + 3;
+
+ while (k > 2 * ip + 1)
+ Y[k--] = ZERO;
+
+ yk = ZERO;
+
+ while (k > p)
+ {
+ double yk2 = 0.0;
+ long lim = k / 2;
+
+ if (k % 2 == 0)
+ yk += X[lim] * X[lim];
+
+ /* In __mul, this loop (and the one within the next while loop) run
+ between a range to calculate the mantissa as follows:
+
+ Z[k] = X[k] * Y[n] + X[k+1] * Y[n-1] ... + X[n-1] * Y[k+1]
+ + X[n] * Y[k]
+
+ For X == Y, we can get away with summing halfway and doubling the
+ result. For cases where the range size is even, the mid-point needs
+ to be added separately (above). */
+ for (i = k - p, j = p; i < j; i++, j--)
+ yk2 += X[i] * X[j];
+
+ yk += 2.0 * yk2;
+
+ u = (yk + CUTTER) - CUTTER;
+ if (u > yk)
+ u -= RADIX;
+ Y[k--] = yk - u;
+ yk = u * RADIXI;
+ }
+
+ while (k > 1)
+ {
+ double yk2 = 0.0;
+ long lim = k / 2;
+
+ if (k % 2 == 0)
+ yk += X[lim] * X[lim];
+
+ /* Likewise for this loop. */
+ for (i = 1, j = k - 1; i < j; i++, j--)
+ yk2 += X[i] * X[j];
+
+ yk += 2.0 * yk2;
+
+ u = (yk + CUTTER) - CUTTER;
+ if (u > yk)
+ u -= RADIX;
+ Y[k--] = yk - u;
+ yk = u * RADIXI;
+ }
+ Y[k] = yk;
+
+ /* Squares are always positive. */
+ Y[0] = 1.0;
+
+ /* Get the exponent sum into an intermediate variable. This is a subtle
+ optimization, where given enough registers, all operations on the exponent
+ happen in registers and the result is written out only once into EZ. */
+ int e = EX * 2;
+
+ /* Is there a carry beyond the most significant digit? */
+ if (__glibc_unlikely (Y[1] == ZERO))
+ {
+ for (i = 1; i <= p; i++)
+ Y[i] = Y[i + 1];
+ e--;
+ }
+
+ EY = e;
+}
+
/* Invert *X and store in *Y. Relative error bound:
- For P = 2: 1.001 * R ^ (1 - P)
- For P = 3: 1.063 * R ^ (1 - P)
@@ -664,7 +873,7 @@ static void
SECTION
__inv (const mp_no *x, mp_no *y, int p)
{
- int i;
+ long i;
double t;
mp_no z, w;
static const int np1[] =
diff --git a/libc/sysdeps/ieee754/dbl-64/mpa.h b/libc/sysdeps/ieee754/dbl-64/mpa.h
index 06343d46d..168b334ed 100644
--- a/libc/sysdeps/ieee754/dbl-64/mpa.h
+++ b/libc/sysdeps/ieee754/dbl-64/mpa.h
@@ -115,6 +115,7 @@ void __dbl_mp (double, mp_no *, int);
void __add (const mp_no *, const mp_no *, mp_no *, int);
void __sub (const mp_no *, const mp_no *, mp_no *, int);
void __mul (const mp_no *, const mp_no *, mp_no *, int);
+void __sqr (const mp_no *, mp_no *, int);
void __dvd (const mp_no *, const mp_no *, mp_no *, int);
extern void __mpatan (mp_no *, mp_no *, int);
diff --git a/libc/sysdeps/ieee754/dbl-64/mpatan.c b/libc/sysdeps/ieee754/dbl-64/mpatan.c
index db5868092..cc879d8ec 100644
--- a/libc/sysdeps/ieee754/dbl-64/mpatan.c
+++ b/libc/sysdeps/ieee754/dbl-64/mpatan.c
@@ -39,63 +39,78 @@
#include "mpatan.h"
-void __mpsqrt(mp_no *, mp_no *, int);
-
void
SECTION
-__mpatan(mp_no *x, mp_no *y, int p) {
+__mpatan (mp_no *x, mp_no *y, int p)
+{
- int i,m,n;
+ int i, m, n;
double dx;
- mp_no
- mptwoim1 = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
+ mp_no mptwoim1 =
+ {
+ 0,
+ {
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
+ }
+ };
- mp_no mps,mpsm,mpt,mpt1,mpt2,mpt3;
+ mp_no mps, mpsm, mpt, mpt1, mpt2, mpt3;
- /* Choose m and initiate mptwoim1 */
- if (EX>0) m=7;
- else if (EX<0) m=0;
- else {
- __mp_dbl(x,&dx,p); dx=ABS(dx);
- for (m=6; m>0; m--)
- {if (dx>__atan_xm[m].d) break;}
+ /* Choose m and initiate mptwoim1. */
+ if (EX > 0)
+ m = 7;
+ else if (EX < 0)
+ m = 0;
+ else
+ {
+ __mp_dbl (x, &dx, p);
+ dx = ABS (dx);
+ for (m = 6; m > 0; m--)
+ {
+ if (dx > __atan_xm[m].d)
+ break;
+ }
}
- mptwoim1.e = 1;
- mptwoim1.d[0] = ONE;
+ mptwoim1.e = 1;
+ mptwoim1.d[0] = ONE;
- /* Reduce x m times */
- __mul(x,x,&mpsm,p);
- if (m==0) __cpy(x,&mps,p);
- else {
- for (i=0; i<m; i++) {
- __add(&mpone,&mpsm,&mpt1,p);
- __mpsqrt(&mpt1,&mpt2,p);
- __add(&mpt2,&mpt2,&mpt1,p);
- __add(&mptwo,&mpsm,&mpt2,p);
- __add(&mpt1,&mpt2,&mpt3,p);
- __dvd(&mpsm,&mpt3,&mpt1,p);
- __cpy(&mpt1,&mpsm,p);
- }
- __mpsqrt(&mpsm,&mps,p); mps.d[0] = X[0];
+ /* Reduce x m times. */
+ __sqr (x, &mpsm, p);
+ if (m == 0)
+ __cpy (x, &mps, p);
+ else
+ {
+ for (i = 0; i < m; i++)
+ {
+ __add (&mpone, &mpsm, &mpt1, p);
+ __mpsqrt (&mpt1, &mpt2, p);
+ __add (&mpt2, &mpt2, &mpt1, p);
+ __add (&mptwo, &mpsm, &mpt2, p);
+ __add (&mpt1, &mpt2, &mpt3, p);
+ __dvd (&mpsm, &mpt3, &mpt1, p);
+ __cpy (&mpt1, &mpsm, p);
+ }
+ __mpsqrt (&mpsm, &mps, p);
+ mps.d[0] = X[0];
}
- /* Evaluate a truncated power series for Atan(s) */
- n=__atan_np[p]; mptwoim1.d[1] = __atan_twonm1[p].d;
- __dvd(&mpsm,&mptwoim1,&mpt,p);
- for (i=n-1; i>1; i--) {
+ /* Evaluate a truncated power series for Atan(s). */
+ n = __atan_np[p];
+ mptwoim1.d[1] = __atan_twonm1[p].d;
+ __dvd (&mpsm, &mptwoim1, &mpt, p);
+ for (i = n - 1; i > 1; i--)
+ {
mptwoim1.d[1] -= TWO;
- __dvd(&mpsm,&mptwoim1,&mpt1,p);
- __mul(&mpsm,&mpt,&mpt2,p);
- __sub(&mpt1,&mpt2,&mpt,p);
+ __dvd (&mpsm, &mptwoim1, &mpt1, p);
+ __mul (&mpsm, &mpt, &mpt2, p);
+ __sub (&mpt1, &mpt2, &mpt, p);
}
- __mul(&mps,&mpt,&mpt1,p);
- __sub(&mps,&mpt1,&mpt,p);
-
- /* Compute Atan(x) */
- mptwoim1.d[1] = 1 << m;
- __mul(&mptwoim1,&mpt,y,p);
+ __mul (&mps, &mpt, &mpt1, p);
+ __sub (&mps, &mpt1, &mpt, p);
- return;
+ /* Compute Atan(x). */
+ mptwoim1.d[1] = 1 << m;
+ __mul (&mptwoim1, &mpt, y, p);
}
diff --git a/libc/sysdeps/ieee754/dbl-64/mpatan2.c b/libc/sysdeps/ieee754/dbl-64/mpatan2.c
index c0b9aea1e..d29c2fbad 100644
--- a/libc/sysdeps/ieee754/dbl-64/mpatan2.c
+++ b/libc/sysdeps/ieee754/dbl-64/mpatan2.c
@@ -32,37 +32,36 @@
/* */
/******************************************************************/
-
-
#include "mpa.h"
#ifndef SECTION
# define SECTION
#endif
-void __mpsqrt(mp_no *, mp_no *, int);
-void __mpatan(mp_no *, mp_no *, int);
-
-/* Multi-Precision Atan2(y,x) function subroutine, for p >= 4. */
-/* y=0 is not permitted if x<=0. No error messages are given. */
+/* Multi-Precision Atan2 (y, x) function subroutine, for p >= 4.
+ y = 0 is not permitted if x <= 0. No error messages are given. */
void
SECTION
-__mpatan2(mp_no *y, mp_no *x, mp_no *z, int p) {
+__mpatan2 (mp_no *y, mp_no *x, mp_no *z, int p)
+{
+ mp_no mpt1, mpt2, mpt3;
- mp_no mpt1,mpt2,mpt3;
-
-
- if (X[0] <= ZERO) {
- __dvd(x,y,&mpt1,p); __mul(&mpt1,&mpt1,&mpt2,p);
- if (mpt1.d[0] != ZERO) mpt1.d[0] = ONE;
- __add(&mpt2,&mpone,&mpt3,p); __mpsqrt(&mpt3,&mpt2,p);
- __add(&mpt1,&mpt2,&mpt3,p); mpt3.d[0]=Y[0];
- __mpatan(&mpt3,&mpt1,p); __add(&mpt1,&mpt1,z,p);
- }
+ if (X[0] <= ZERO)
+ {
+ __dvd (x, y, &mpt1, p);
+ __mul (&mpt1, &mpt1, &mpt2, p);
+ if (mpt1.d[0] != ZERO)
+ mpt1.d[0] = ONE;
+ __add (&mpt2, &mpone, &mpt3, p);
+ __mpsqrt (&mpt3, &mpt2, p);
+ __add (&mpt1, &mpt2, &mpt3, p);
+ mpt3.d[0] = Y[0];
+ __mpatan (&mpt3, &mpt1, p);
+ __add (&mpt1, &mpt1, z, p);
+ }
else
- { __dvd(y,x,&mpt1,p);
- __mpatan(&mpt1,z,p);
- }
-
- return;
+ {
+ __dvd (y, x, &mpt1, p);
+ __mpatan (&mpt1, z, p);
+ }
}
diff --git a/libc/sysdeps/ieee754/dbl-64/mpexp.c b/libc/sysdeps/ieee754/dbl-64/mpexp.c
index 8d288ff9a..565c6c853 100644
--- a/libc/sysdeps/ieee754/dbl-64/mpexp.c
+++ b/libc/sysdeps/ieee754/dbl-64/mpexp.c
@@ -49,6 +49,7 @@ __mpexp (mp_no *x, mp_no *y, int p)
0, 0, 0, 0, 3, 3, 4, 4, 5, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8
};
+
static const int m1p[33] =
{
0, 0, 0, 0,
@@ -71,16 +72,7 @@ __mpexp (mp_no *x, mp_no *y, int p)
{0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 39, 43, 47, 51, 55, 59, 63},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 47, 50, 54}
};
- mp_no mpk =
- {
- 0,
- {
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
- }
- };
- mp_no mps, mpak, mpt1, mpt2;
+ mp_no mps, mpk, mpt1, mpt2;
/* Choose m,n and compute a=2**(-m). */
n = np[p];
@@ -115,37 +107,52 @@ __mpexp (mp_no *x, mp_no *y, int p)
break;
}
- /* Compute s=x*2**(-m). Put result in mps. */
+ /* Compute s=x*2**(-m). Put result in mps. This is the range-reduced input
+ that we will use to compute e^s. For the final result, simply raise it
+ to 2^m. */
__pow_mp (-m, &mpt1, p);
__mul (x, &mpt1, &mps, p);
- /* Evaluate the polynomial. Put result in mpt2. */
- mpk.e = 1;
- mpk.d[0] = ONE;
- mpk.d[1] = n;
- __dvd (&mps, &mpk, &mpt1, p);
- __add (&mpone, &mpt1, &mpak, p);
- for (k = n - 1; k > 1; k--)
+ /* Compute the Taylor series for e^s:
+
+ 1 + x/1! + x^2/2! + x^3/3! ...
+
+ for N iterations. We compute this as:
+
+ e^x = 1 + (x * n!/1! + x^2 * n!/2! + x^3 * n!/3!) / n!
+ = 1 + (x * (n!/1! + x * (n!/2! + x * (n!/3! + x ...)))) / n!
+
+ k! is computed on the fly as KF and at the end of the polynomial loop, KF
+ is n!, which can be used directly. */
+ __cpy (&mps, &mpt2, p);
+
+ double kf = 1.0;
+
+ /* Evaluate the rest. The result will be in mpt2. */
+ for (k = n - 1; k > 0; k--)
{
- __mul (&mps, &mpak, &mpt1, p);
- mpk.d[1] = k;
- __dvd (&mpt1, &mpk, &mpt2, p);
- __add (&mpone, &mpt2, &mpak, p);
+ /* n! / k! = n * (n - 1) ... * (n - k + 1) */
+ kf *= k + 1;
+
+ __dbl_mp (kf, &mpk, p);
+ __add (&mpt2, &mpk, &mpt1, p);
+ __mul (&mps, &mpt1, &mpt2, p);
}
- __mul (&mps, &mpak, &mpt1, p);
+ __dbl_mp (kf, &mpk, p);
+ __dvd (&mpt2, &mpk, &mpt1, p);
__add (&mpone, &mpt1, &mpt2, p);
/* Raise polynomial value to the power of 2**m. Put result in y. */
for (k = 0, j = 0; k < m;)
{
- __mul (&mpt2, &mpt2, &mpt1, p);
+ __sqr (&mpt2, &mpt1, p);
k++;
if (k == m)
{
j = 1;
break;
}
- __mul (&mpt1, &mpt1, &mpt2, p);
+ __sqr (&mpt1, &mpt2, p);
k++;
}
if (j)
diff --git a/libc/sysdeps/ieee754/dbl-64/mplog.c b/libc/sysdeps/ieee754/dbl-64/mplog.c
index e3d10846e..f8d5c1095 100644
--- a/libc/sysdeps/ieee754/dbl-64/mplog.c
+++ b/libc/sysdeps/ieee754/dbl-64/mplog.c
@@ -1,4 +1,3 @@
-
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
@@ -37,27 +36,30 @@
#include "endian.h"
#include "mpa.h"
-void __mpexp(mp_no *, mp_no *, int);
-
-void __mplog(mp_no *x, mp_no *y, int p) {
- int i,m;
- static const int mp[33] = {0,0,0,0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,
- 4,4,4,4,4,4,4,4,4,4,4,4,4,4};
- mp_no mpt1,mpt2;
+void
+__mplog (mp_no *x, mp_no *y, int p)
+{
+ int i, m;
+ static const int mp[33] =
+ {
+ 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
+ };
+ mp_no mpt1, mpt2;
- /* Choose m */
+ /* Choose m. */
m = mp[p];
- /* Perform m newton iterations to solve for y: exp(y)-x=0. */
- /* The iterations formula is: y(n+1)=y(n)+(x*exp(-y(n))-1). */
- __cpy(y,&mpt1,p);
- for (i=0; i<m; i++) {
- mpt1.d[0]=-mpt1.d[0];
- __mpexp(&mpt1,&mpt2,p);
- __mul(x,&mpt2,&mpt1,p);
- __sub(&mpt1,&mpone,&mpt2,p);
- __add(y,&mpt2,&mpt1,p);
- __cpy(&mpt1,y,p);
- }
- return;
+ /* Perform m newton iterations to solve for y: exp(y) - x = 0. The
+ iterations formula is: y(n + 1) = y(n) + (x * exp(-y(n)) - 1). */
+ __cpy (y, &mpt1, p);
+ for (i = 0; i < m; i++)
+ {
+ mpt1.d[0] = -mpt1.d[0];
+ __mpexp (&mpt1, &mpt2, p);
+ __mul (x, &mpt2, &mpt1, p);
+ __sub (&mpt1, &mpone, &mpt2, p);
+ __add (y, &mpt2, &mpt1, p);
+ __cpy (&mpt1, y, p);
+ }
}
diff --git a/libc/sysdeps/ieee754/dbl-64/mpsqrt.c b/libc/sysdeps/ieee754/dbl-64/mpsqrt.c
index 65df9fd06..71ef5ce77 100644
--- a/libc/sysdeps/ieee754/dbl-64/mpsqrt.c
+++ b/libc/sysdeps/ieee754/dbl-64/mpsqrt.c
@@ -45,33 +45,37 @@
/* p as integer. Routine computes sqrt(*x) and stores result in *y */
/****************************************************************************/
-static double fastiroot(double);
+static double fastiroot (double);
void
SECTION
-__mpsqrt(mp_no *x, mp_no *y, int p) {
- int i,m,ey;
- double dx,dy;
- static const mp_no
- mphalf = {0,{1.0,8388608.0 /* 2^23 */}},
- mp3halfs = {1,{1.0,1.0,8388608.0 /* 2^23 */}};
- mp_no mpxn,mpz,mpu,mpt1,mpt2;
+__mpsqrt (mp_no *x, mp_no *y, int p)
+{
+ int i, m, ey;
+ double dx, dy;
+ static const mp_no mphalf = {0, {1.0, 8388608.0 /* 2^23 */}};
+ static const mp_no mp3halfs = {1, {1.0, 1.0, 8388608.0 /* 2^23 */}};
+ mp_no mpxn, mpz, mpu, mpt1, mpt2;
- ey=EX/2; __cpy(x,&mpxn,p); mpxn.e -= (ey+ey);
- __mp_dbl(&mpxn,&dx,p); dy=fastiroot(dx); __dbl_mp(dy,&mpu,p);
- __mul(&mpxn,&mphalf,&mpz,p);
+ ey = EX / 2;
+ __cpy (x, &mpxn, p);
+ mpxn.e -= (ey + ey);
+ __mp_dbl (&mpxn, &dx, p);
+ dy = fastiroot (dx);
+ __dbl_mp (dy, &mpu, p);
+ __mul (&mpxn, &mphalf, &mpz, p);
- m=__mpsqrt_mp[p];
- for (i=0; i<m; i++) {
- __mul(&mpu,&mpu,&mpt1,p);
- __mul(&mpt1,&mpz,&mpt2,p);
- __sub(&mp3halfs,&mpt2,&mpt1,p);
- __mul(&mpu,&mpt1,&mpt2,p);
- __cpy(&mpt2,&mpu,p);
- }
- __mul(&mpxn,&mpu,y,p); EY += ey;
-
- return;
+ m = __mpsqrt_mp[p];
+ for (i = 0; i < m; i++)
+ {
+ __sqr (&mpu, &mpt1, p);
+ __mul (&mpt1, &mpz, &mpt2, p);
+ __sub (&mp3halfs, &mpt2, &mpt1, p);
+ __mul (&mpu, &mpt1, &mpt2, p);
+ __cpy (&mpt2, &mpu, p);
+ }
+ __mul (&mpxn, &mpu, y, p);
+ EY += ey;
}
/***********************************************************/
@@ -80,22 +84,28 @@ __mpsqrt(mp_no *x, mp_no *y, int p) {
/***********************************************************/
static double
SECTION
-fastiroot(double x) {
- union {int i[2]; double d;} p,q;
- double y,z, t;
+fastiroot (double x)
+{
+ union
+ {
+ int i[2];
+ double d;
+ } p, q;
+ double y, z, t;
int n;
- static const double c0 = 0.99674, c1 = -0.53380, c2 = 0.45472, c3 = -0.21553;
+ static const double c0 = 0.99674, c1 = -0.53380;
+ static const double c2 = 0.45472, c3 = -0.21553;
p.d = x;
- p.i[HIGH_HALF] = (p.i[HIGH_HALF] & 0x3FFFFFFF ) | 0x3FE00000 ;
+ p.i[HIGH_HALF] = (p.i[HIGH_HALF] & 0x3FFFFFFF) | 0x3FE00000;
q.d = x;
y = p.d;
- z = y -1.0;
- n = (q.i[HIGH_HALF] - p.i[HIGH_HALF])>>1;
- z = ((c3*z + c2)*z + c1)*z + c0; /* 2**-7 */
- z = z*(1.5 - 0.5*y*z*z); /* 2**-14 */
- p.d = z*(1.5 - 0.5*y*z*z); /* 2**-28 */
+ z = y - 1.0;
+ n = (q.i[HIGH_HALF] - p.i[HIGH_HALF]) >> 1;
+ z = ((c3 * z + c2) * z + c1) * z + c0; /* 2**-7 */
+ z = z * (1.5 - 0.5 * y * z * z); /* 2**-14 */
+ p.d = z * (1.5 - 0.5 * y * z * z); /* 2**-28 */
p.i[HIGH_HALF] -= n;
- t = x*p.d;
- return p.d*(1.5 - 0.5*p.d*t);
+ t = x * p.d;
+ return p.d * (1.5 - 0.5 * p.d * t);
}
diff --git a/libc/sysdeps/ieee754/dbl-64/mptan.c b/libc/sysdeps/ieee754/dbl-64/mptan.c
index 234108e37..51b5718e7 100644
--- a/libc/sysdeps/ieee754/dbl-64/mptan.c
+++ b/libc/sysdeps/ieee754/dbl-64/mptan.c
@@ -40,23 +40,25 @@
# define SECTION
#endif
-int __mpranred(double, mp_no *, int);
-void __c32(mp_no *, mp_no *, mp_no *, int);
-
void
SECTION
-__mptan(double x, mp_no *mpy, int p) {
+__mptan (double x, mp_no *mpy, int p)
+{
int n;
mp_no mpw, mpc, mps;
- n = __mpranred(x, &mpw, p) & 0x00000001; /* negative or positive result */
- __c32(&mpw, &mpc, &mps, p); /* computing sin(x) and cos(x) */
- if (n) /* second or fourth quarter of unit circle */
- { __dvd(&mpc,&mps,mpy,p);
- mpy->d[0] *= MONE;
- } /* tan is negative in this area */
- else __dvd(&mps,&mpc,mpy,p);
-
- return;
+ /* Negative or positive result. */
+ n = __mpranred (x, &mpw, p) & 0x00000001;
+ /* Computing sin(x) and cos(x). */
+ __c32 (&mpw, &mpc, &mps, p);
+ /* Second or fourth quarter of unit circle. */
+ if (n)
+ {
+ __dvd (&mpc, &mps, mpy, p);
+ mpy->d[0] *= MONE;
+ }
+ /* tan is negative in this area. */
+ else
+ __dvd (&mps, &mpc, mpy, p);
}
diff --git a/libc/sysdeps/ieee754/dbl-64/sincos32.c b/libc/sysdeps/ieee754/dbl-64/sincos32.c
index 6c5ffded5..3d2b2914a 100644
--- a/libc/sysdeps/ieee754/dbl-64/sincos32.c
+++ b/libc/sysdeps/ieee754/dbl-64/sincos32.c
@@ -57,17 +57,10 @@ SECTION
ss32(mp_no *x, mp_no *y, int p) {
int i;
double a;
-#if 0
- double b;
- static const mp_no mpone = {1,{1.0,1.0}};
-#endif
mp_no mpt1,x2,gor,sum ,mpk={1,{1.0}};
-#if 0
- mp_no mpt2;
-#endif
for (i=1;i<=p;i++) mpk.d[i]=0;
- __mul(x,x,&x2,p);
+ __sqr(x,&x2,p);
__cpy(&oofac27,&gor,p);
__cpy(&gor,&sum,p);
for (a=27.0;a>1.0;a-=2.0) {
@@ -89,17 +82,10 @@ SECTION
cc32(mp_no *x, mp_no *y, int p) {
int i;
double a;
-#if 0
- double b;
- static const mp_no mpone = {1,{1.0,1.0}};
-#endif
mp_no mpt1,x2,gor,sum ,mpk={1,{1.0}};
-#if 0
- mp_no mpt2;
-#endif
for (i=1;i<=p;i++) mpk.d[i]=0;
- __mul(x,x,&x2,p);
+ __sqr(x,&x2,p);
mpk.d[1]=27.0;
__mul(&oofac27,&mpk,&gor,p);
__cpy(&gor,&sum,p);
@@ -119,7 +105,6 @@ cc32(mp_no *x, mp_no *y, int p) {
void
SECTION
__c32(mp_no *x, mp_no *y, mp_no *z, int p) {
- static const mp_no mpt={1,{1.0,2.0}}, one={1,{1.0,1.0}};
mp_no u,t,t1,t2,c,s;
int i;
__cpy(x,&u,p);
@@ -130,11 +115,11 @@ __c32(mp_no *x, mp_no *y, mp_no *z, int p) {
__mul(&c,&s,&t,p);
__sub(&s,&t,&t1,p);
__add(&t1,&t1,&s,p);
- __sub(&mpt,&c,&t1,p);
+ __sub(&mptwo,&c,&t1,p);
__mul(&t1,&c,&t2,p);
__add(&t2,&t2,&c,p);
}
- __sub(&one,&c,y,p);
+ __sub(&mpone,&c,y,p);
__cpy(&s,z,p);
}
@@ -251,7 +236,6 @@ __mpranred(double x, mp_no *y, int p)
number v;
double t,xn;
int i,k,n;
- static const mp_no one = {1,{1.0,1.0}};
mp_no a,b,c;
if (ABS(x) < 2.8e14) {
@@ -280,7 +264,7 @@ __mpranred(double x, mp_no *y, int p)
c.e=0;
if (c.d[1] >= 8388608.0)
{ t +=1.0;
- __sub(&c,&one,&b,p);
+ __sub(&c,&mpone,&b,p);
__mul(&b,&hp,y,p);
}
else __mul(&c,&hp,y,p);
diff --git a/libc/sysdeps/ieee754/dbl-64/slowexp.c b/libc/sysdeps/ieee754/dbl-64/slowexp.c
index 34ca3275e..c423fc311 100644
--- a/libc/sysdeps/ieee754/dbl-64/slowexp.c
+++ b/libc/sysdeps/ieee754/dbl-64/slowexp.c
@@ -34,38 +34,36 @@
# define SECTION
#endif
-void __mpexp(mp_no *x, mp_no *y, int p);
+void __mpexp (mp_no *x, mp_no *y, int p);
/*Converting from double precision to Multi-precision and calculating e^x */
double
SECTION
-__slowexp(double x) {
- double w,z,res,eps=3.0e-26;
-#if 0
- double y;
-#endif
+__slowexp (double x)
+{
+ double w, z, res, eps = 3.0e-26;
int p;
-#if 0
- int orig,i;
-#endif
- mp_no mpx, mpy, mpz,mpw,mpeps,mpcor;
+ mp_no mpx, mpy, mpz, mpw, mpeps, mpcor;
- p=6;
- __dbl_mp(x,&mpx,p); /* Convert a double precision number x */
- /* into a multiple precision number mpx with prec. p. */
- __mpexp(&mpx, &mpy, p); /* Multi-Precision exponential function */
- __dbl_mp(eps,&mpeps,p);
- __mul(&mpeps,&mpy,&mpcor,p);
- __add(&mpy,&mpcor,&mpw,p);
- __sub(&mpy,&mpcor,&mpz,p);
- __mp_dbl(&mpw, &w, p);
- __mp_dbl(&mpz, &z, p);
- if (w == z) return w;
- else { /* if calculating is not exactly */
- p = 32;
- __dbl_mp(x,&mpx,p);
- __mpexp(&mpx, &mpy, p);
- __mp_dbl(&mpy, &res, p);
- return res;
- }
+ /* Use the multiple precision __MPEXP function to compute the exponential
+ First at 144 bits and if it is not accurate enough, at 768 bits. */
+ p = 6;
+ __dbl_mp (x, &mpx, p);
+ __mpexp (&mpx, &mpy, p);
+ __dbl_mp (eps, &mpeps, p);
+ __mul (&mpeps, &mpy, &mpcor, p);
+ __add (&mpy, &mpcor, &mpw, p);
+ __sub (&mpy, &mpcor, &mpz, p);
+ __mp_dbl (&mpw, &w, p);
+ __mp_dbl (&mpz, &z, p);
+ if (w == z)
+ return w;
+ else
+ {
+ p = 32;
+ __dbl_mp (x, &mpx, p);
+ __mpexp (&mpx, &mpy, p);
+ __mp_dbl (&mpy, &res, p);
+ return res;
+ }
}
diff --git a/libc/sysdeps/ieee754/dbl-64/slowpow.c b/libc/sysdeps/ieee754/dbl-64/slowpow.c
index c303eaa5a..cccc7e32c 100644
--- a/libc/sysdeps/ieee754/dbl-64/slowpow.c
+++ b/libc/sysdeps/ieee754/dbl-64/slowpow.c
@@ -38,42 +38,59 @@
# define SECTION
#endif
-void __mpexp(mp_no *x, mp_no *y, int p);
-void __mplog(mp_no *x, mp_no *y, int p);
-double ulog(double);
-double __halfulp(double x,double y);
+void __mpexp (mp_no *x, mp_no *y, int p);
+void __mplog (mp_no *x, mp_no *y, int p);
+double ulog (double);
+double __halfulp (double x, double y);
double
SECTION
-__slowpow(double x, double y, double z) {
- double res,res1;
- mp_no mpx, mpy, mpz,mpw,mpp,mpr,mpr1;
- static const mp_no eps = {-3,{1.0,4.0}};
+__slowpow (double x, double y, double z)
+{
+ double res, res1;
+ mp_no mpx, mpy, mpz, mpw, mpp, mpr, mpr1;
+ static const mp_no eps = {-3, {1.0, 4.0}};
int p;
- res = __halfulp(x,y); /* halfulp() returns -10 or x^y */
- if (res >= 0) return res; /* if result was really computed by halfulp */
- /* else, if result was not really computed by halfulp */
- p = 10; /* p=precision */
- __dbl_mp(x,&mpx,p);
- __dbl_mp(y,&mpy,p);
- __dbl_mp(z,&mpz,p);
- __mplog(&mpx, &mpz, p); /* log(x) = z */
- __mul(&mpy,&mpz,&mpw,p); /* y * z =w */
- __mpexp(&mpw, &mpp, p); /* e^w =pp */
- __add(&mpp,&eps,&mpr,p); /* pp+eps =r */
- __mp_dbl(&mpr, &res, p);
- __sub(&mpp,&eps,&mpr1,p); /* pp -eps =r1 */
- __mp_dbl(&mpr1, &res1, p); /* converting into double precision */
- if (res == res1) return res;
+ /* __HALFULP returns -10 or X^Y. */
+ res = __halfulp (x, y);
- p = 32; /* if we get here result wasn't calculated exactly, continue */
- __dbl_mp(x,&mpx,p); /* for more exact calculation */
- __dbl_mp(y,&mpy,p);
- __dbl_mp(z,&mpz,p);
- __mplog(&mpx, &mpz, p); /* log(c)=z */
- __mul(&mpy,&mpz,&mpw,p); /* y*z =w */
- __mpexp(&mpw, &mpp, p); /* e^w=pp */
- __mp_dbl(&mpp, &res, p); /* converting into double precision */
+ /* Return if the result was computed by __HALFULP. */
+ if (res >= 0)
+ return res;
+
+ /* Or else, calculate using multiple precision. P = 10 implies accuracy of
+ 240 bits accuracy, since MP_NO has a radix of 2^24. */
+ p = 10;
+ __dbl_mp (x, &mpx, p);
+ __dbl_mp (y, &mpy, p);
+ __dbl_mp (z, &mpz, p);
+
+ /* z = x ^ y
+ log (z) = y * log (x)
+ z = exp (y * log (x)) */
+ __mplog (&mpx, &mpz, p);
+ __mul (&mpy, &mpz, &mpw, p);
+ __mpexp (&mpw, &mpp, p);
+
+ /* Add and subtract EPS to ensure that the result remains unchanged, i.e. we
+ have last bit accuracy. */
+ __add (&mpp, &eps, &mpr, p);
+ __mp_dbl (&mpr, &res, p);
+ __sub (&mpp, &eps, &mpr1, p);
+ __mp_dbl (&mpr1, &res1, p);
+ if (res == res1)
+ return res;
+
+ /* If we don't, then we repeat using a higher precision. 768 bits of
+ precision ought to be enough for anybody. */
+ p = 32;
+ __dbl_mp (x, &mpx, p);
+ __dbl_mp (y, &mpy, p);
+ __dbl_mp (z, &mpz, p);
+ __mplog (&mpx, &mpz, p);
+ __mul (&mpy, &mpz, &mpw, p);
+ __mpexp (&mpw, &mpp, p);
+ __mp_dbl (&mpp, &res, p);
return res;
}
diff --git a/libc/sysdeps/ieee754/dbl-64/x2y2m1.c b/libc/sysdeps/ieee754/dbl-64/x2y2m1.c
index 0b73f0a2e..d36a950e3 100644
--- a/libc/sysdeps/ieee754/dbl-64/x2y2m1.c
+++ b/libc/sysdeps/ieee754/dbl-64/x2y2m1.c
@@ -37,7 +37,7 @@ add_split (double *hi, double *lo, double x, double y)
given that the values are small enough that no overflow occurs and
large enough (or zero) that no underflow occurs. */
-static inline void
+static void
mul_split (double *hi, double *lo, double x, double y)
{
#ifdef __FP_FAST_FMA
diff --git a/libc/sysdeps/posix/open64.c b/libc/sysdeps/posix/open64.c
index 4e4480256..e0c55b00f 100644
--- a/libc/sysdeps/posix/open64.c
+++ b/libc/sysdeps/posix/open64.c
@@ -17,7 +17,6 @@
#include <fcntl.h>
#include <stdarg.h>
-#include <bp-sym.h>
#include <sysdep-cancel.h>
/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
@@ -46,6 +45,6 @@ __libc_open64 (const char *file, int oflag, ...)
return result;
}
-weak_alias (__libc_open64, BP_SYM (__open64))
-libc_hidden_weak (BP_SYM (__open64))
-weak_alias (__libc_open64, BP_SYM (open64))
+weak_alias (__libc_open64, __open64)
+libc_hidden_weak (__open64)
+weak_alias (__libc_open64, open64)
diff --git a/libc/sysdeps/unix/sysv/linux/ulimit.c b/libc/sysdeps/posix/ulimit.c
index 8c382ac18..f5ee6bfc9 100644
--- a/libc/sysdeps/unix/sysv/linux/ulimit.c
+++ b/libc/sysdeps/posix/ulimit.c
@@ -20,6 +20,7 @@
#include <sysdep.h>
#include <ulimit.h>
#include <unistd.h>
+#include <limits.h>
#include <sys/resource.h>
/* Function depends on CMD:
diff --git a/libc/sysdeps/powerpc/fpu/bits/fenvinline.h b/libc/sysdeps/powerpc/bits/fenvinline.h
index 0720795d5..0720795d5 100644
--- a/libc/sysdeps/powerpc/fpu/bits/fenvinline.h
+++ b/libc/sysdeps/powerpc/bits/fenvinline.h
diff --git a/libc/sysdeps/powerpc/fpu/bits/mathinline.h b/libc/sysdeps/powerpc/bits/mathinline.h
index 140fff08e..140fff08e 100644
--- a/libc/sysdeps/powerpc/fpu/bits/mathinline.h
+++ b/libc/sysdeps/powerpc/bits/mathinline.h
diff --git a/libc/sysdeps/powerpc/fpu/fegetenv.c b/libc/sysdeps/powerpc/fpu/fegetenv.c
index ee60e6df1..a512a91a4 100644
--- a/libc/sysdeps/powerpc/fpu/fegetenv.c
+++ b/libc/sysdeps/powerpc/fpu/fegetenv.c
@@ -17,7 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <fenv_libc.h>
-#include <bp-sym.h>
int
__fegetenv (fenv_t *envp)
@@ -31,8 +30,8 @@ __fegetenv (fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fegetenv, __old_fegetenv)
-compat_symbol (libm, BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2_1);
+compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
#endif
libm_hidden_ver (__fegetenv, fegetenv)
-versioned_symbol (libm, BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2_2);
+versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
diff --git a/libc/sysdeps/powerpc/fpu/fesetenv.c b/libc/sysdeps/powerpc/fpu/fesetenv.c
index 72989c476..953af5ddc 100644
--- a/libc/sysdeps/powerpc/fpu/fesetenv.c
+++ b/libc/sysdeps/powerpc/fpu/fesetenv.c
@@ -18,7 +18,6 @@
#include <fenv_libc.h>
#include <fpu_control.h>
-#include <bp-sym.h>
#define _FPU_MASK_ALL (_FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM | _FPU_MASK_XM | _FPU_MASK_IM)
@@ -54,8 +53,8 @@ __fesetenv (const fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fesetenv, __old_fesetenv)
-compat_symbol (libm, BP_SYM (__old_fesetenv), BP_SYM (fesetenv), GLIBC_2_1);
+compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1);
#endif
libm_hidden_ver (__fesetenv, fesetenv)
-versioned_symbol (libm, BP_SYM (__fesetenv), BP_SYM (fesetenv), GLIBC_2_2);
+versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2);
diff --git a/libc/sysdeps/powerpc/fpu/feupdateenv.c b/libc/sysdeps/powerpc/fpu/feupdateenv.c
index 66f282639..9faf930f3 100644
--- a/libc/sysdeps/powerpc/fpu/feupdateenv.c
+++ b/libc/sysdeps/powerpc/fpu/feupdateenv.c
@@ -19,7 +19,6 @@
#include <fenv_libc.h>
#include <fpu_control.h>
-#include <bp-sym.h>
#define _FPU_MASK_ALL (_FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM | _FPU_MASK_XM | _FPU_MASK_IM)
@@ -61,8 +60,8 @@ __feupdateenv (const fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feupdateenv, __old_feupdateenv)
-compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
+compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
libm_hidden_ver (__feupdateenv, feupdateenv)
-versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);
+versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/libc/sysdeps/powerpc/fpu/fgetexcptflg.c b/libc/sysdeps/powerpc/fpu/fgetexcptflg.c
index 987a20547..f6327ce17 100644
--- a/libc/sysdeps/powerpc/fpu/fgetexcptflg.c
+++ b/libc/sysdeps/powerpc/fpu/fgetexcptflg.c
@@ -17,7 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <fenv_libc.h>
-#include <bp-sym.h>
int
__fegetexceptflag (fexcept_t *flagp, int excepts)
@@ -37,7 +36,7 @@ __fegetexceptflag (fexcept_t *flagp, int excepts)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fegetexceptflag, __old_fegetexceptflag)
-compat_symbol (libm, BP_SYM (__old_fegetexceptflag), BP_SYM (fegetexceptflag), GLIBC_2_1);
+compat_symbol (libm, __old_fegetexceptflag, fegetexceptflag, GLIBC_2_1);
#endif
-versioned_symbol (libm, BP_SYM (__fegetexceptflag), BP_SYM (fegetexceptflag), GLIBC_2_2);
+versioned_symbol (libm, __fegetexceptflag, fegetexceptflag, GLIBC_2_2);
diff --git a/libc/sysdeps/powerpc/fpu/fraiseexcpt.c b/libc/sysdeps/powerpc/fpu/fraiseexcpt.c
index 88d184476..9118c1954 100644
--- a/libc/sysdeps/powerpc/fpu/fraiseexcpt.c
+++ b/libc/sysdeps/powerpc/fpu/fraiseexcpt.c
@@ -17,7 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <fenv_libc.h>
-#include <bp-sym.h>
#undef feraiseexcept
int
@@ -61,8 +60,8 @@ __feraiseexcept (int excepts)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feraiseexcept, __old_feraiseexcept)
-compat_symbol (libm, BP_SYM (__old_feraiseexcept), BP_SYM (feraiseexcept), GLIBC_2_1);
+compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1);
#endif
libm_hidden_ver (__feraiseexcept, feraiseexcept)
-versioned_symbol (libm, BP_SYM (__feraiseexcept), BP_SYM (feraiseexcept), GLIBC_2_2);
+versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2);
diff --git a/libc/sysdeps/powerpc/fpu/fsetexcptflg.c b/libc/sysdeps/powerpc/fpu/fsetexcptflg.c
index 588fb6a0d..c050d4022 100644
--- a/libc/sysdeps/powerpc/fpu/fsetexcptflg.c
+++ b/libc/sysdeps/powerpc/fpu/fsetexcptflg.c
@@ -17,7 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <fenv_libc.h>
-#include <bp-sym.h>
int
__fesetexceptflag (const fexcept_t *flagp, int excepts)
@@ -53,7 +52,7 @@ __fesetexceptflag (const fexcept_t *flagp, int excepts)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
-compat_symbol (libm, BP_SYM (__old_fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2_1);
+compat_symbol (libm, __old_fesetexceptflag, fesetexceptflag, GLIBC_2_1);
#endif
-versioned_symbol (libm, BP_SYM (__fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2_2);
+versioned_symbol (libm, __fesetexceptflag, fesetexceptflag, GLIBC_2_2);
diff --git a/libc/sysdeps/powerpc/fpu/fpu_control.h b/libc/sysdeps/powerpc/fpu_control.h
index d03b8eb80..d03b8eb80 100644
--- a/libc/sysdeps/powerpc/fpu/fpu_control.h
+++ b/libc/sysdeps/powerpc/fpu_control.h
diff --git a/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S b/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S
index 515419931..787447363 100644
--- a/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S
+++ b/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S
@@ -23,11 +23,8 @@
#else
# include <jmpbuf-offsets.h>
#endif
-#include <bp-sym.h>
-#include <bp-asm.h>
-ENTRY (BP_SYM (__longjmp))
- CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
+ENTRY (__longjmp)
#if defined PTR_DEMANGLE || defined CHECK_SP
lwz r24,(JB_GPR1*4)(r3)
@@ -71,4 +68,4 @@ ENTRY (BP_SYM (__longjmp))
lwz r31,((JB_GPRS+17)*4)(r3)
mr r3,r4
blr
-END (BP_SYM (__longjmp))
+END (__longjmp)
diff --git a/libc/sysdeps/powerpc/powerpc32/a2/memcpy.S b/libc/sysdeps/powerpc/powerpc32/a2/memcpy.S
index d1192a3ce..f2f63b180 100644
--- a/libc/sysdeps/powerpc/powerpc32/a2/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/a2/memcpy.S
@@ -18,14 +18,12 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
#define PREFETCH_AHEAD 4 /* no cache lines SRC prefetching ahead */
#define ZERO_AHEAD 2 /* no cache lines DST zeroing ahead */
.machine a2
-EALIGN (BP_SYM (memcpy), 5, 0)
+EALIGN (memcpy, 5, 0)
CALL_MCOUNT
dcbt 0,r4 /* Prefetch ONE SRC cacheline */
@@ -525,5 +523,5 @@ L(endloop2_128):
b L(lessthancacheline)
-END (BP_SYM (memcpy))
+END (memcpy)
libc_hidden_builtin_def (memcpy)
diff --git a/libc/sysdeps/powerpc/powerpc32/add_n.S b/libc/sysdeps/powerpc/powerpc32/add_n.S
index 0db251ad1..7ce77e04d 100644
--- a/libc/sysdeps/powerpc/powerpc32/add_n.S
+++ b/libc/sysdeps/powerpc/powerpc32/add_n.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* mp_limb_t mpn_add_n (mp_ptr res_ptr, mp_srcptr s1_ptr, mp_srcptr s2_ptr,
mp_size_t size)
@@ -28,14 +26,8 @@
possible 2-unrolled inner loop will not be. Also, watch out for the
alignment... */
-EALIGN (BP_SYM (__mpn_add_n), 3, 0)
+EALIGN (__mpn_add_n, 3, 0)
-#if __BOUNDED_POINTERS__
- slwi r10,r6,2 /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (r3, r8, r9, r10)
- CHECK_BOUNDS_BOTH_WIDE (r4, r8, r9, r10)
- CHECK_BOUNDS_BOTH_WIDE (r5, r8, r9, r10)
-#endif
/* Set up for loop below. */
mtcrf 0x01,r6
srwi. r7,r6,1
@@ -73,4 +65,4 @@ L(0): lwz r9,4(r4)
/* Return the carry. */
L(1): addze r3,r10
blr
-END (BP_SYM (__mpn_add_n))
+END (__mpn_add_n)
diff --git a/libc/sysdeps/powerpc/powerpc32/addmul_1.S b/libc/sysdeps/powerpc/powerpc32/addmul_1.S
index 33a52024f..88a01a154 100644
--- a/libc/sysdeps/powerpc/powerpc32/addmul_1.S
+++ b/libc/sysdeps/powerpc/powerpc32/addmul_1.S
@@ -17,18 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* mp_limb_t mpn_addmul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr,
mp_size_t s1_size, mp_limb_t s2_limb)
Calculate res+s1*s2 and put result back in res; return carry. */
-ENTRY (BP_SYM (__mpn_addmul_1))
-#if __BOUNDED_POINTERS__
- slwi r10,r5,2 /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (r3, r8, r9, r10)
- CHECK_BOUNDS_BOTH_WIDE (r4, r8, r9, r10)
-#endif
+ENTRY (__mpn_addmul_1)
mtctr r5
lwz r0,0(r4)
@@ -52,4 +45,4 @@ L(0): lwzu r0,4(r4)
L(1): stw r8,4(r3)
addze r3,r10
blr
-END (BP_SYM (__mpn_addmul_1))
+END (__mpn_addmul_1)
diff --git a/libc/sysdeps/powerpc/powerpc32/backtrace.c b/libc/sysdeps/powerpc/powerpc32/backtrace.c
index b1b4b8e10..b4b11dd03 100644
--- a/libc/sysdeps/powerpc/powerpc32/backtrace.c
+++ b/libc/sysdeps/powerpc/powerpc32/backtrace.c
@@ -18,7 +18,6 @@
#include <execinfo.h>
#include <stddef.h>
-#include <bp-checks.h>
/* This is the stack layout we see with every stack frame.
Note that every routine is required by the ABI to lay out the stack
@@ -32,8 +31,8 @@
*/
struct layout
{
- struct layout *__unbounded next;
- void *__unbounded return_address;
+ struct layout *next;
+ void *return_address;
};
int
@@ -47,11 +46,10 @@ __backtrace (void **array, int size)
/* Get the address on top-of-stack. */
asm volatile ("lwz %0,0(1)" : "=r"(current));
- current = BOUNDED_1 (current);
for ( count = 0;
current != NULL && count < size;
- current = BOUNDED_1 (current->next), count++)
+ current = current->next, count++)
array[count] = current->return_address;
/* It's possible the second-last stack frame can't return
diff --git a/libc/sysdeps/powerpc/powerpc32/bp-asm.h b/libc/sysdeps/powerpc/powerpc32/bp-asm.h
deleted file mode 100644
index 0e5d07be3..000000000
--- a/libc/sysdeps/powerpc/powerpc32/bp-asm.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Bounded-pointer definitions for PowerPC assembler.
- Copyright (C) 2000-2013 Free Software Foundation, Inc.
- Contributed by Greg McGary <greg@mcgary.org>
- This file is part of the GNU C Library. Its master source is NOT part of
- the C library, however. The master source lives in the GNU MP 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 __BOUNDED_POINTERS__
-
-/* Byte offsets of BP components. */
-# define oVALUE 0
-# define oLOW 4
-# define oHIGH 8
-
-/* Don't check bounds, just convert the BP register to its simple
- pointer value. */
-
-# define DISCARD_BOUNDS(rBP) \
- lwz rBP, oVALUE(rBP)
-
-/* Check low bound, with the side effect that the BP register is converted
- its simple pointer value. Move the high bound into a register for
- later use. */
-
-# define CHECK_BOUNDS_LOW(rBP, rLOW, rHIGH) \
- lwz rHIGH, oHIGH(rBP); \
- lwz rLOW, oLOW(rBP); \
- lwz rBP, oVALUE(rBP); \
- twllt rBP, rLOW
-
-/* Check the high bound, which is in a register, using the given
- conditional trap instruction. */
-
-# define CHECK_BOUNDS_HIGH(rVALUE, rHIGH, TWLcc) \
- TWLcc rVALUE, rHIGH
-
-/* Check the high bound, which is stored at the return-value's high
- bound slot, using the given conditional trap instruction. */
-
-# define CHECK_BOUNDS_HIGH_RTN(rVALUE, rHIGH, TWLcc) \
- lwz rHIGH, oHIGH(rRTN); \
- TWLcc rVALUE, rHIGH
-
-/* Check both bounds, with the side effect that the BP register is
- converted to its simple pointer value. */
-
-# define CHECK_BOUNDS_BOTH(rBP, rLOW, rHIGH) \
- CHECK_BOUNDS_LOW(rBP, rLOW, rHIGH); \
- twlge rBP, rHIGH
-
-/* Check bounds on a memory region of given length, with the side
- effect that the BP register is converted to its simple pointer
- value. */
-
-# define CHECK_BOUNDS_BOTH_WIDE(rBP, rLOW, rHIGH, rLENGTH) \
- CHECK_BOUNDS_LOW (rBP, rLOW, rHIGH); \
- sub rHIGH, rHIGH, rLENGTH; \
- twlgt rBP, rHIGH
-
-# define CHECK_BOUNDS_BOTH_WIDE_LIT(rBP, rLOW, rHIGH, LENGTH) \
- CHECK_BOUNDS_LOW (rBP, rLOW, rHIGH); \
- subi rHIGH, rHIGH, LENGTH; \
- twlgt rBP, rHIGH
-
-/* Store a pointer value register into the return-value's pointer
- value slot. */
-
-# define STORE_RETURN_VALUE(rVALUE) \
- stw rVALUE, oVALUE(rRTN)
-
-/* Store a low and high bounds into the return-value's pointer bounds
- slots. */
-
-# define STORE_RETURN_BOUNDS(rLOW, rHIGH) \
- stw rLOW, oLOW(rRTN); \
- stw rHIGH, oHIGH(rRTN)
-
-/* Stuff zero value/low/high into the BP addressed by rRTN. */
-
-# define RETURN_NULL_BOUNDED_POINTER \
- li r4, 0; \
- STORE_RETURN_VALUE (r4); \
- STORE_RETURN_BOUNDS (r4, r4)
-
-#else
-
-# define DISCARD_BOUNDS(rBP)
-# define CHECK_BOUNDS_LOW(rBP, rLOW, rHIGH)
-# define CHECK_BOUNDS_HIGH(rVALUE, rHIGH, TWLcc)
-# define CHECK_BOUNDS_HIGH_RTN(rVALUE, rHIGH, TWLcc)
-# define CHECK_BOUNDS_BOTH(rBP, rLOW, rHIGH)
-# define CHECK_BOUNDS_BOTH_WIDE(rBP, rLOW, rHIGH, rLENGTH)
-# define CHECK_BOUNDS_BOTH_WIDE_LIT(rBP, rLOW, rHIGH, LENGTH)
-# define STORE_RETURN_VALUE(rVALUE)
-# define STORE_RETURN_BOUNDS(rLOW, rHIGH)
-
-# define RETURN_NULL_BOUNDED_POINTER li rRTN, 0
-
-#endif
diff --git a/libc/sysdeps/powerpc/powerpc32/bsd-_setjmp.S b/libc/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
index 24b80d288..95e8a5aa1 100644
--- a/libc/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/bsd-_setjmp.S
@@ -18,14 +18,13 @@
#include <shlib-compat.h>
#include <libc-symbols.h>
#include <sysdep.h>
-#include <bp-sym.h>
#if defined NOT_IN_libc
/* Build a non-versioned object for rtld-*. */
-ENTRY (BP_SYM (_setjmp))
+ENTRY (_setjmp)
li r4,0 /* Set second argument to 0. */
- b BP_SYM (__sigsetjmp@local)
-END (BP_SYM (_setjmp))
+ b __sigsetjmp@local
+END (_setjmp)
libc_hidden_def (_setjmp)
#else
/* Build a versioned object for libc. */
@@ -33,10 +32,10 @@ libc_hidden_def (_setjmp)
# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
symbol_version (__novmx_setjmp,_setjmp,GLIBC_2.0);
-ENTRY (BP_SYM (__novmx_setjmp))
+ENTRY (__novmx_setjmp)
li r4,0 /* Set second argument to 0. */
- b BP_SYM (__novmx__sigsetjmp@local)
-END (BP_SYM (__novmx_setjmp))
+ b __novmx__sigsetjmp@local
+END (__novmx_setjmp)
libc_hidden_def (__novmx_setjmp)
# endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) */
@@ -44,14 +43,14 @@ default_symbol_version (__vmx_setjmp,_setjmp,GLIBC_2.3.4)
/* __GI__setjmp prototype is needed for ntpl i.e. _setjmp is defined
as a libc_hidden_proto & is used in sysdeps/generic/libc-start.c
if HAVE_CLEANUP_JMP_BUF is defined */
-ENTRY (BP_SYM (__GI__setjmp))
+ENTRY (__GI__setjmp)
li r4,0 /* Set second argument to 0. */
- b BP_SYM (__vmx__sigsetjmp@local)
-END (BP_SYM (__GI__setjmp))
+ b __vmx__sigsetjmp@local
+END (__GI__setjmp)
-ENTRY (BP_SYM (__vmx_setjmp))
+ENTRY (__vmx_setjmp)
li r4,0 /* Set second argument to 0. */
- b BP_SYM (__vmx__sigsetjmp@local)
-END (BP_SYM (__vmx_setjmp))
+ b __vmx__sigsetjmp@local
+END (__vmx_setjmp)
libc_hidden_def (__vmx_setjmp)
#endif /* !NOT_IN_libc */
diff --git a/libc/sysdeps/powerpc/powerpc32/bsd-setjmp.S b/libc/sysdeps/powerpc/powerpc32/bsd-setjmp.S
index bf95f0189..1113ea533 100644
--- a/libc/sysdeps/powerpc/powerpc32/bsd-setjmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/bsd-setjmp.S
@@ -18,7 +18,6 @@
#include <shlib-compat.h>
#include <libc-symbols.h>
#include <sysdep.h>
-#include <bp-sym.h>
#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
diff --git a/libc/sysdeps/powerpc/powerpc32/bzero.S b/libc/sysdeps/powerpc/powerpc32/bzero.S
index 2cbcb69d5..b5699243f 100644
--- a/libc/sysdeps/powerpc/powerpc32/bzero.S
+++ b/libc/sysdeps/powerpc/powerpc32/bzero.S
@@ -17,20 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-ENTRY (BP_SYM (__bzero))
+ENTRY (__bzero)
-#if __BOUNDED_POINTERS__
- mr r6,r4
- li r5,0
- mr r4,r3
- /* Tell memset that we don't want a return value. */
- li r3,0
-#else
mr r5,r4
li r4,0
-#endif
- b BP_SYM (memset)@local
-END (BP_SYM (__bzero))
-weak_alias (BP_SYM (__bzero), BP_SYM (bzero))
+ b memset@local
+END (__bzero)
+weak_alias (__bzero, bzero)
diff --git a/libc/sysdeps/powerpc/powerpc32/cell/memcpy.S b/libc/sysdeps/powerpc/powerpc32/cell/memcpy.S
index 6d7d4ce5d..f3605d790 100644
--- a/libc/sysdeps/powerpc/powerpc32/cell/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/cell/memcpy.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
#define PREFETCH_AHEAD 6 /* no cache lines SRC prefetching ahead */
#define ZERO_AHEAD 4 /* no cache lines DST zeroing ahead */
@@ -41,7 +39,7 @@
.align 7
-EALIGN (BP_SYM (memcpy), 5, 0)
+EALIGN (memcpy, 5, 0)
CALL_MCOUNT
dcbt 0,r4 /* Prefetch ONE SRC cacheline */
@@ -240,5 +238,5 @@ EALIGN (BP_SYM (memcpy), 5, 0)
stb r0,0(r6)
1: blr
-END (BP_SYM (memcpy))
+END (memcpy)
libc_hidden_builtin_def (memcpy)
diff --git a/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S b/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
index 50b84e89a..9d34cd916 100644
--- a/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
+++ b/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
@@ -23,12 +23,9 @@
#else
# include <jmpbuf-offsets.h>
#endif
-#include <bp-sym.h>
-#include <bp-asm.h>
.machine "altivec"
-ENTRY (BP_SYM (__longjmp))
- CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
+ENTRY (__longjmp)
#ifndef __NO_VMX__
# ifdef PIC
mflr r6
@@ -173,4 +170,4 @@ L(no_vmx):
lfd fp31,((JB_FPRS+17*2)*4)(r3)
mr r3,r4
blr
-END (BP_SYM (__longjmp))
+END (__longjmp)
diff --git a/libc/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S b/libc/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
index 17edbf679..46ea2b00f 100644
--- a/libc/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
+++ b/libc/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
@@ -23,12 +23,9 @@
#else
# include <jmpbuf-offsets.h>
#endif
-#include <bp-sym.h>
-#include <bp-asm.h>
.machine "altivec"
-ENTRY (BP_SYM (__sigsetjmp))
- CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
+ENTRY (__sigsetjmp)
#ifdef PTR_MANGLE
mr r5,r1
@@ -179,5 +176,5 @@ L(aligned_save_vmx):
stvx 31,0,r6
L(no_vmx):
#endif
- b BP_SYM (__sigjmp_save@local)
-END (BP_SYM (__sigsetjmp))
+ b __sigjmp_save@local
+END (__sigsetjmp)
diff --git a/libc/sysdeps/powerpc/powerpc32/lshift.S b/libc/sysdeps/powerpc/powerpc32/lshift.S
index 8e75084a8..1d83910b3 100644
--- a/libc/sysdeps/powerpc/powerpc32/lshift.S
+++ b/libc/sysdeps/powerpc/powerpc32/lshift.S
@@ -17,19 +17,12 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* mp_limb_t mpn_lshift (mp_ptr wp, mp_srcptr up, mp_size_t usize,
unsigned int cnt) */
-EALIGN (BP_SYM (__mpn_lshift), 3, 0)
+EALIGN (__mpn_lshift, 3, 0)
-#if __BOUNDED_POINTERS__
- slwi r10,r5,2 /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (r3, r8, r9, r10)
- CHECK_BOUNDS_BOTH_WIDE (r4, r8, r9, r10)
-#endif
mtctr r5 # copy size into CTR
cmplwi cr0,r5,16 # is size < 16
slwi r0,r5,2
@@ -129,4 +122,4 @@ L(n): lwzu r10,-4(r4); \
DO_LSHIFT(30)
DO_LSHIFT(31)
-END (BP_SYM (__mpn_lshift))
+END (__mpn_lshift)
diff --git a/libc/sysdeps/powerpc/powerpc32/memset.S b/libc/sysdeps/powerpc/powerpc32/memset.S
index 45c79d858..c49bd039f 100644
--- a/libc/sysdeps/powerpc/powerpc32/memset.S
+++ b/libc/sysdeps/powerpc/powerpc32/memset.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
Returns 's'.
@@ -29,21 +27,14 @@
takes advantage of the dcbz instruction. */
.section ".text"
-EALIGN (BP_SYM (memset), 5, 1)
+EALIGN (memset, 5, 1)
#define rTMP r0
#define rRTN r3 /* initial value of 1st argument */
-#if __BOUNDED_POINTERS__
-# define rMEMP0 r4 /* original value of 1st arg */
-# define rCHR r5 /* char to set in each byte */
-# define rLEN r6 /* length of region to set */
-# define rMEMP r10 /* address at which we are storing */
-#else
-# define rMEMP0 r3 /* original value of 1st arg */
-# define rCHR r4 /* char to set in each byte */
-# define rLEN r5 /* length of region to set */
-# define rMEMP r6 /* address at which we are storing */
-#endif
+#define rMEMP0 r3 /* original value of 1st arg */
+#define rCHR r4 /* char to set in each byte */
+#define rLEN r5 /* length of region to set */
+#define rMEMP r6 /* address at which we are storing */
#define rALIGN r7 /* number of bytes we are setting now (when aligning) */
#define rMEMP2 r8
@@ -55,15 +46,6 @@ EALIGN (BP_SYM (memset), 5, 1)
#define rCLS r8 /* Cache line size obtained from static. */
#define rCLM r9 /* Cache line size mask to check for cache alignment. */
-#if __BOUNDED_POINTERS__
- cmplwi cr1, rRTN, 0
- CHECK_BOUNDS_BOTH_WIDE (rMEMP0, rTMP, rTMP2, rLEN)
- beq cr1, L(b0)
- STORE_RETURN_VALUE (rMEMP0)
- STORE_RETURN_BOUNDS (rTMP, rTMP2)
-L(b0):
-#endif
-
/* take care of case for size <= 4 */
cmplwi cr1, rLEN, 4
andi. rALIGN, rMEMP0, 3
@@ -321,5 +303,5 @@ L(handletail32):
clrrwi. rALIGN, rLEN, 5
b L(nondcbz)
-END (BP_SYM (memset))
+END (memset)
libc_hidden_builtin_def (memset)
diff --git a/libc/sysdeps/powerpc/powerpc32/mul_1.S b/libc/sysdeps/powerpc/powerpc32/mul_1.S
index fc7865875..0b474d491 100644
--- a/libc/sysdeps/powerpc/powerpc32/mul_1.S
+++ b/libc/sysdeps/powerpc/powerpc32/mul_1.S
@@ -17,19 +17,12 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* mp_limb_t mpn_mul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr,
mp_size_t s1_size, mp_limb_t s2_limb)
Calculate s1*s2 and put result in res_ptr; return carry. */
-ENTRY (BP_SYM (__mpn_mul_1))
-#if __BOUNDED_POINTERS__
- slwi r10,r5,2 /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (r3, r8, r9, r10)
- CHECK_BOUNDS_BOTH_WIDE (r4, r8, r9, r10)
-#endif
+ENTRY (__mpn_mul_1)
mtctr r5
lwz r0,0(r4)
@@ -49,4 +42,4 @@ L(0): lwzu r0,4(r4)
L(1): stw r7,4(r3)
addze r3,r10
blr
-END (BP_SYM (__mpn_mul_1))
+END (__mpn_mul_1)
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c b/libc/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
index 16cb57785..b22664772 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
+++ b/libc/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
@@ -43,7 +43,6 @@
#include "endian.h"
#include "mpa.h"
-#include "mpa2.h"
#include <sys/param.h>
const mp_no mpone = {1, {1.0, 1.0}};
@@ -106,8 +105,6 @@ __cpy (const mp_no *x, mp_no *y, int p)
EY = EX;
for (i = 0; i <= p; i++)
Y[i] = X[i];
-
- return;
}
/* Convert a multiple precision number *X into a double precision
@@ -115,7 +112,7 @@ __cpy (const mp_no *x, mp_no *y, int p)
static void
norm (const mp_no *x, double *y, int p)
{
-#define R RADIXI
+#define R RADIXI
long i;
double a, c, u, v, z[5];
if (p < 5)
@@ -182,7 +179,6 @@ norm (const mp_no *x, double *y, int p)
c *= RADIXI;
*y = c;
- return;
#undef R
}
@@ -294,8 +290,6 @@ denorm (const mp_no *x, double *y, int p)
c = X[0] * ((z[1] + R * (z[2] + R * z[3])) - TWO10);
*y = c * TWOM1032;
- return;
-
#undef R
}
@@ -310,9 +304,7 @@ __mp_dbl (const mp_no *x, double *y, int p)
return;
}
- if (EX > -42)
- norm (x, y, p);
- else if (EX == -42 && X[1] >= TWO10)
+ if (__glibc_likely (EX > -42 || (EX == -42 && X[1] >= TWO10)))
norm (x, y, p);
else
denorm (x, y, p);
@@ -360,7 +352,6 @@ __dbl_mp (double x, mp_no *y, int p)
}
for (; i <= p2; i++)
Y[i] = ZERO;
- return;
}
/* Add magnitudes of *X and *Y assuming that abs (*X) >= abs (*Y) > 0. The
@@ -372,6 +363,7 @@ add_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p)
{
long i, j, k;
long p2 = p;
+ double zk;
EZ = EX;
@@ -379,45 +371,54 @@ add_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p)
j = p2 + EY - EX;
k = p2 + 1;
- if (j < 1)
+ if (__glibc_unlikely (j < 1))
{
__cpy (x, z, p);
return;
}
- else
- Z[k] = ZERO;
+
+ zk = ZERO;
for (; j > 0; i--, j--)
{
- Z[k] += X[i] + Y[j];
- if (Z[k] >= RADIX)
+ zk += X[i] + Y[j];
+ if (zk >= RADIX)
{
- Z[k] -= RADIX;
- Z[--k] = ONE;
+ Z[k--] = zk - RADIX;
+ zk = ONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
for (; i > 0; i--)
{
- Z[k] += X[i];
- if (Z[k] >= RADIX)
+ zk += X[i];
+ if (zk >= RADIX)
{
- Z[k] -= RADIX;
- Z[--k] = ONE;
+ Z[k--] = zk - RADIX;
+ zk = ONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
- if (Z[1] == ZERO)
+ if (zk == ZERO)
{
for (i = 1; i <= p2; i++)
Z[i] = Z[i + 1];
}
else
- EZ += ONE;
+ {
+ Z[1] = zk;
+ EZ += ONE;
+ }
}
/* Subtract the magnitudes of *X and *Y assuming that abs (*x) > abs (*y) > 0.
@@ -429,73 +430,69 @@ sub_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p)
{
long i, j, k;
long p2 = p;
+ double zk;
EZ = EX;
+ i = p2;
+ j = p2 + EY - EX;
+ k = p2;
- if (EX == EY)
+ /* Y is too small compared to X, copy X over to the result. */
+ if (__glibc_unlikely (j < 1))
{
- i = j = k = p2;
- Z[k] = Z[k + 1] = ZERO;
+ __cpy (x, z, p);
+ return;
}
- else
+
+ /* The relevant least significant digit in Y is non-zero, so we factor it in
+ to enhance accuracy. */
+ if (j < p2 && Y[j + 1] > ZERO)
{
- j = EX - EY;
- if (j > p2)
- {
- __cpy (x, z, p);
- return;
- }
- else
- {
- i = p2;
- j = p2 + 1 - j;
- k = p2;
- if (Y[j] > ZERO)
- {
- Z[k + 1] = RADIX - Y[j--];
- Z[k] = MONE;
- }
- else
- {
- Z[k + 1] = ZERO;
- Z[k] = ZERO;
- j--;
- }
- }
+ Z[k + 1] = RADIX - Y[j + 1];
+ zk = MONE;
}
+ else
+ zk = Z[k + 1] = ZERO;
+ /* Subtract and borrow. */
for (; j > 0; i--, j--)
{
- Z[k] += (X[i] - Y[j]);
- if (Z[k] < ZERO)
+ zk += (X[i] - Y[j]);
+ if (zk < ZERO)
{
- Z[k] += RADIX;
- Z[--k] = MONE;
+ Z[k--] = zk + RADIX;
+ zk = MONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
+ /* We're done with digits from Y, so it's just digits in X. */
for (; i > 0; i--)
{
- Z[k] += X[i];
- if (Z[k] < ZERO)
+ zk += X[i];
+ if (zk < ZERO)
{
- Z[k] += RADIX;
- Z[--k] = MONE;
+ Z[k--] = zk + RADIX;
+ zk = MONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
+ /* Normalize. */
for (i = 1; Z[i] == ZERO; i++);
EZ = EZ - i + 1;
for (k = 1; i <= p2 + 1;)
Z[k++] = Z[i++];
for (; k <= p2;)
Z[k++] = ZERO;
-
- return;
}
/* Add *X and *Y and store the result in *Z. X and Y may overlap, but not X
@@ -545,7 +542,6 @@ __add (const mp_no *x, const mp_no *y, mp_no *z, int p)
else
Z[0] = ZERO;
}
- return;
}
/* Subtract *Y from *X and return the result in *Z. X and Y may overlap but
@@ -596,7 +592,6 @@ __sub (const mp_no *x, const mp_no *y, mp_no *z, int p)
else
Z[0] = ZERO;
}
- return;
}
/* Multiply *X and *Y and store result in *Z. X and Y may overlap but not X
@@ -609,8 +604,8 @@ __mul (const mp_no *x, const mp_no *y, mp_no *z, int p)
long p2 = p;
double u, zk, zk2;
- /* Is z=0? */
- if (X[0] * Y[0] == ZERO)
+ /* Is z=0? */
+ if (__glibc_unlikely (X[0] * Y[0] == ZERO))
{
Z[0] = ZERO;
return;
@@ -685,7 +680,106 @@ __mul (const mp_no *x, const mp_no *y, mp_no *z, int p)
EZ = EX + EY;
Z[0] = X[0] * Y[0];
- return;
+}
+
+/* Square *X and store result in *Y. X and Y may not overlap. For P in
+ [1, 2, 3], the exact result is truncated to P digits. In case P > 3 the
+ error is bounded by 1.001 ULP. This is a faster special case of
+ multiplication. */
+void
+__sqr (const mp_no *x, mp_no *y, int p)
+{
+ long i, j, k, ip;
+ double u, yk;
+
+ /* Is z=0? */
+ if (__glibc_unlikely (X[0] == ZERO))
+ {
+ Y[0] = ZERO;
+ return;
+ }
+
+ /* We need not iterate through all X's since it's pointless to
+ multiply zeroes. */
+ for (ip = p; ip > 0; ip--)
+ if (X[ip] != ZERO)
+ break;
+
+ k = (__glibc_unlikely (p < 3)) ? p + p : p + 3;
+
+ while (k > 2 * ip + 1)
+ Y[k--] = ZERO;
+
+ yk = ZERO;
+
+ while (k > p)
+ {
+ double yk2 = 0.0;
+ long lim = k / 2;
+
+ if (k % 2 == 0)
+ {
+ yk += X[lim] * X[lim];
+ lim--;
+ }
+
+ /* In __mul, this loop (and the one within the next while loop) run
+ between a range to calculate the mantissa as follows:
+
+ Z[k] = X[k] * Y[n] + X[k+1] * Y[n-1] ... + X[n-1] * Y[k+1]
+ + X[n] * Y[k]
+
+ For X == Y, we can get away with summing halfway and doubling the
+ result. For cases where the range size is even, the mid-point needs
+ to be added separately (above). */
+ for (i = k - p, j = p; i <= lim; i++, j--)
+ yk2 += X[i] * X[j];
+
+ yk += 2.0 * yk2;
+
+ u = (yk + CUTTER) - CUTTER;
+ if (u > yk)
+ u -= RADIX;
+ Y[k--] = yk - u;
+ yk = u * RADIXI;
+ }
+
+ while (k > 1)
+ {
+ double yk2 = 0.0;
+ long lim = k / 2;
+
+ if (k % 2 == 0)
+ {
+ yk += X[lim] * X[lim];
+ lim--;
+ }
+
+ /* Likewise for this loop. */
+ for (i = 1, j = k - 1; i <= lim; i++, j--)
+ yk2 += X[i] * X[j];
+
+ yk += 2.0 * yk2;
+
+ u = (yk + CUTTER) - CUTTER;
+ if (u > yk)
+ u -= RADIX;
+ Y[k--] = yk - u;
+ yk = u * RADIXI;
+ }
+ Y[k] = yk;
+
+ /* Squares are always positive. */
+ Y[0] = 1.0;
+
+ EY = 2 * EX;
+ /* Is there a carry beyond the most significant digit? */
+ if (__glibc_unlikely (Y[1] == ZERO))
+ {
+ for (i = 1; i <= p; i++)
+ Y[i] = Y[i + 1];
+ EY--;
+ }
}
/* Invert *X and store in *Y. Relative error bound:
@@ -694,7 +788,7 @@ __mul (const mp_no *x, const mp_no *y, mp_no *z, int p)
- For P > 3: 2.001 * R ^ (1 - P)
*X = 0 is not permissible. */
-void
+static void
__inv (const mp_no *x, mp_no *y, int p)
{
long i;
@@ -719,7 +813,6 @@ __inv (const mp_no *x, mp_no *y, int p)
__sub (&mptwo, y, &z, p);
__mul (&w, &z, y, p);
}
- return;
}
/* Divide *X by *Y and store result in *Z. X and Y may overlap but not X and Z
@@ -741,5 +834,4 @@ __dvd (const mp_no *x, const mp_no *y, mp_no *z, int p)
__inv (y, &w, p);
__mul (x, &w, z, p);
}
- return;
}
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/memcmp.S b/libc/sysdeps/powerpc/powerpc32/power4/memcmp.S
index bbee6f4d3..edec7ab27 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -17,13 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* int [r3] memcmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5]) */
.machine power4
-EALIGN (BP_SYM(memcmp), 4, 0)
+EALIGN (memcmp, 4, 0)
CALL_MCOUNT
#define rTMP r0
@@ -979,7 +977,7 @@ L(dureturn25):
lwz r24,20(r1)
lwz 1,0(1)
blr
-END (BP_SYM (memcmp))
+END (memcmp)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp, bcmp)
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/memcpy.S b/libc/sysdeps/powerpc/powerpc32/power4/memcpy.S
index aa2aab1ec..d9146631e 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/power4/memcpy.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
Returns 'dst'.
@@ -34,7 +32,7 @@
Each case has an optimized unrolled loop. */
.machine power4
-EALIGN (BP_SYM (memcpy), 5, 0)
+EALIGN (memcpy, 5, 0)
CALL_MCOUNT
stwu 1,-32(1)
@@ -420,6 +418,6 @@ EALIGN (BP_SYM (memcpy), 5, 0)
lwz 31,24(1)
addi 1,1,32
blr
-END (BP_SYM (memcpy))
+END (memcpy)
libc_hidden_builtin_def (memcpy)
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/memset.S b/libc/sysdeps/powerpc/powerpc32/power4/memset.S
index 58497f4b1..1e8785cb4 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/memset.S
+++ b/libc/sysdeps/powerpc/powerpc32/power4/memset.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
Returns 's'.
@@ -28,7 +26,7 @@
to 0, to take advantage of the dcbz instruction. */
.machine power4
-EALIGN (BP_SYM (memset), 5, 0)
+EALIGN (memset, 5, 0)
CALL_MCOUNT
#define rTMP r0
@@ -224,5 +222,5 @@ L(medium_28t):
stw rCHR, -4(rMEMP)
stw rCHR, -8(rMEMP)
blr
-END (BP_SYM (memset))
+END (memset)
libc_hidden_builtin_def (memset)
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/strncmp.S b/libc/sysdeps/powerpc/powerpc32/power4/strncmp.S
index 50d79dc96..b3a69975c 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/strncmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/power4/strncmp.S
@@ -17,14 +17,12 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* See strlen.s for comments on how the end-of-string testing works. */
/* int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5]) */
-EALIGN (BP_SYM(strncmp), 4, 0)
+EALIGN (strncmp, 4, 0)
#define rTMP r0
#define rRTN r3
@@ -171,5 +169,5 @@ L(u4): sub rRTN, rWORD1, rWORD2
L(ux):
li rRTN, 0
blr
-END (BP_SYM (strncmp))
+END (strncmp)
libc_hidden_builtin_def (strncmp)
diff --git a/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S b/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S
index 203c979d1..d900028cb 100644
--- a/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/power6/memcpy.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
Returns 'dst'.
@@ -34,7 +32,7 @@
Each case has an optimized unrolled loop. */
.machine power6
-EALIGN (BP_SYM (memcpy), 5, 0)
+EALIGN (memcpy, 5, 0)
CALL_MCOUNT
stwu 1,-32(1)
@@ -837,6 +835,6 @@ L(wdus_0):
lwz 31,24(1)
addi 1,1,32
blr
-END (BP_SYM (memcpy))
+END (memcpy)
libc_hidden_builtin_def (memcpy)
diff --git a/libc/sysdeps/powerpc/powerpc32/power6/memset.S b/libc/sysdeps/powerpc/powerpc32/power6/memset.S
index 3612e7c35..ce0663001 100644
--- a/libc/sysdeps/powerpc/powerpc32/power6/memset.S
+++ b/libc/sysdeps/powerpc/powerpc32/power6/memset.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
Returns 's'.
@@ -28,7 +26,7 @@
to 0, to take advantage of the dcbz instruction. */
.machine power6
-EALIGN (BP_SYM (memset), 7, 0)
+EALIGN (memset, 7, 0)
CALL_MCOUNT
#define rTMP r0
@@ -537,5 +535,5 @@ L(medium_28t):
stw rCHR, -4(rMEMP)
stw rCHR, -8(rMEMP)
blr
-END (BP_SYM (memset))
+END (memset)
libc_hidden_builtin_def (memset)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/memchr.S b/libc/sysdeps/powerpc/powerpc32/power7/memchr.S
index 3d8389e95..369e5e048 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/memchr.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/memchr.S
@@ -18,12 +18,10 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* int [r3] memchr (char *s [r3], int byte [r4], int size [r5]) */
.machine power7
-ENTRY (BP_SYM (__memchr))
+ENTRY (__memchr)
CALL_MCOUNT
dcbt 0,r3
clrrwi r8,r3,2
@@ -202,6 +200,6 @@ L(loop_small): /* loop_small has been unrolled. */
li r3,0
blr
-END (BP_SYM (__memchr))
-weak_alias (BP_SYM (__memchr), BP_SYM(memchr))
+END (__memchr)
+weak_alias (__memchr, memchr)
libc_hidden_builtin_def (memchr)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/memcmp.S b/libc/sysdeps/powerpc/powerpc32/power7/memcmp.S
index 815e3c395..f764b7ce3 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -17,15 +17,13 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* int [r3] memcmp (const char *s1 [r3],
const char *s2 [r4],
size_t size [r5]) */
.machine power7
-EALIGN (BP_SYM(memcmp),4,0)
+EALIGN (memcmp,4,0)
CALL_MCOUNT
#define rTMP r0
@@ -982,6 +980,6 @@ L(dureturn25):
lwz r24,20(r1)
lwz 1,0(1)
blr
-END (BP_SYM (memcmp))
+END (memcmp)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp,bcmp)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S b/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S
index 4f228d3b6..7f0077823 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S
@@ -18,14 +18,12 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
Returns 'dst'. */
.machine power7
-EALIGN (BP_SYM (memcpy), 5, 0)
+EALIGN (memcpy, 5, 0)
CALL_MCOUNT
stwu 1,-32(1)
@@ -522,5 +520,5 @@ L(end_unaligned_loop):
addi 1,1,32
blr
-END (BP_SYM (memcpy))
+END (memcpy)
libc_hidden_builtin_def (memcpy)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/mempcpy.S b/libc/sysdeps/powerpc/powerpc32/power7/mempcpy.S
index 9a88a1b78..5ad4edb58 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/mempcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/mempcpy.S
@@ -18,14 +18,12 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* __ptr_t [r3] __mempcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]);
Returns 'dst' + 'len'. */
.machine power7
-EALIGN (BP_SYM (__mempcpy), 5, 0)
+EALIGN (__mempcpy, 5, 0)
CALL_MCOUNT
stwu 1,-32(1)
@@ -464,7 +462,7 @@ L(end_unaligned_loop):
addi 1,1,32
blr
-END (BP_SYM (__mempcpy))
-libc_hidden_def (BP_SYM (__mempcpy))
-weak_alias (BP_SYM (__mempcpy), BP_SYM (mempcpy))
+END (__mempcpy)
+libc_hidden_def (__mempcpy)
+weak_alias (__mempcpy, mempcpy)
libc_hidden_builtin_def (mempcpy)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/memrchr.S b/libc/sysdeps/powerpc/powerpc32/power7/memrchr.S
index 9ff8d662f..d1e3fda12 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/memrchr.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/memrchr.S
@@ -18,12 +18,10 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* int [r3] memrchr (char *s [r3], int byte [r4], int size [r5]) */
.machine power7
-ENTRY (BP_SYM (__memrchr))
+ENTRY (__memrchr)
CALL_MCOUNT
dcbt 0,r3
mr r7,r3
@@ -172,6 +170,6 @@ L(loop_small):
ble L(null)
b L(loop_small)
-END (BP_SYM (__memrchr))
-weak_alias (BP_SYM (__memrchr), BP_SYM(memrchr))
+END (__memrchr)
+weak_alias (__memrchr, memrchr)
libc_hidden_builtin_def (memrchr)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/memset.S b/libc/sysdeps/powerpc/powerpc32/power7/memset.S
index 00283ab05..360ea717f 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/memset.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/memset.S
@@ -18,14 +18,12 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
Returns 's'. */
.machine power7
-EALIGN (BP_SYM (memset), 5, 0)
+EALIGN (memset, 5, 0)
CALL_MCOUNT
.align 4
@@ -429,5 +427,5 @@ L(small):
stw 4,4(10)
blr
-END (BP_SYM (memset))
+END (memset)
libc_hidden_builtin_def (memset)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/rawmemchr.S b/libc/sysdeps/powerpc/powerpc32/power7/rawmemchr.S
index e37d1327c..a80c74a09 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/rawmemchr.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/rawmemchr.S
@@ -18,12 +18,10 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* int [r3] rawmemchr (void *s [r3], int c [r4]) */
.machine power7
-ENTRY (BP_SYM(__rawmemchr))
+ENTRY (__rawmemchr)
CALL_MCOUNT
dcbt 0,r3
clrrwi r8,r3,2 /* Align the address to word boundary. */
@@ -96,6 +94,6 @@ L(done):
srwi r0,r0,3 /* Convert leading zeroes to bytes. */
add r3,r8,r0 /* Return address of the matching char. */
blr
-END (BP_SYM (__rawmemchr))
+END (__rawmemchr)
weak_alias (__rawmemchr,rawmemchr)
libc_hidden_builtin_def (__rawmemchr)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp.S b/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp.S
index 52d73d9f8..7f0046c34 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/strcasecmp.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
#include <locale-defines.h>
/* int [r3] strcasecmp (const char *s1 [r3], const char *s2 [r4] )
@@ -33,7 +31,7 @@
# define STRCMP strcasecmp
#endif
-ENTRY (BP_SYM (__STRCMP))
+ENTRY (__STRCMP)
#define rRTN r3 /* Return value */
#define rSTR1 r5 /* 1st string */
@@ -125,7 +123,7 @@ L(loop):
bnelr
bne cr7,L(loop)
blr
-END (BP_SYM (__STRCMP))
+END (__STRCMP)
-weak_alias (BP_SYM (__STRCMP), BP_SYM (STRCMP))
+weak_alias (__STRCMP, STRCMP)
libc_hidden_builtin_def (__STRCMP)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/strchr.S b/libc/sysdeps/powerpc/powerpc32/power7/strchr.S
index 1a3795815..0ecadb271 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/strchr.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/strchr.S
@@ -18,12 +18,10 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* int [r3] strchr (char *s [r3], int c [r4]) */
.machine power7
-ENTRY (BP_SYM(strchr))
+ENTRY (strchr)
CALL_MCOUNT
dcbt 0,r3
clrrwi r8,r3,2 /* Align the address to word boundary. */
@@ -197,6 +195,6 @@ L(done_null):
srwi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of the matching null byte. */
blr
-END (BP_SYM (strchr))
-weak_alias (BP_SYM (strchr), BP_SYM (index))
+END (strchr)
+weak_alias (strchr, index)
libc_hidden_builtin_def (strchr)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/strchrnul.S b/libc/sysdeps/powerpc/powerpc32/power7/strchrnul.S
index ae304ae9e..d4cacab60 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/strchrnul.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/strchrnul.S
@@ -18,12 +18,10 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* int [r3] strchrnul (char *s [r3], int c [r4]) */
.machine power7
-ENTRY (BP_SYM(__strchrnul))
+ENTRY (__strchrnul)
CALL_MCOUNT
dcbt 0,r3
clrrwi r8,r3,2 /* Align the address to word boundary. */
@@ -111,6 +109,6 @@ L(done):
srwi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of matching c/null byte. */
blr
-END (BP_SYM (__strchrnul))
+END (__strchrnul)
weak_alias (__strchrnul,strchrnul)
libc_hidden_builtin_def (__strchrnul)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/strlen.S b/libc/sysdeps/powerpc/powerpc32/power7/strlen.S
index 7694f8a2c..b71a10f5c 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/strlen.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/strlen.S
@@ -18,12 +18,10 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* int [r3] strlen (char *s [r3]) */
.machine power7
-ENTRY (BP_SYM (strlen))
+ENTRY (strlen)
CALL_MCOUNT
dcbt 0,r3
clrrwi r4,r3,2 /* Align the address to word boundary. */
@@ -93,5 +91,5 @@ L(done):
srwi r0,r0,3 /* Convert leading zeroes to bytes. */
add r3,r5,r0 /* Compute final length. */
blr
-END (BP_SYM (strlen))
+END (strlen)
libc_hidden_builtin_def (strlen)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S b/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S
index 3629783bc..b58630e33 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* See strlen.s for comments on how the end-of-string testing works. */
@@ -26,7 +24,7 @@
const char *s2 [r4],
size_t size [r5]) */
-EALIGN (BP_SYM(strncmp),5,0)
+EALIGN (strncmp,5,0)
#define rTMP r0
#define rRTN r3
@@ -175,5 +173,5 @@ L(u4): sub rRTN,rWORD1,rWORD2
L(ux):
li rRTN,0
blr
-END (BP_SYM (strncmp))
+END (strncmp)
libc_hidden_builtin_def (strncmp)
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/strnlen.S b/libc/sysdeps/powerpc/powerpc32/power7/strnlen.S
index ec716e74a..ed088366a 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/strnlen.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/strnlen.S
@@ -18,12 +18,10 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* int [r3] strnlen (char *s [r3], int size [r4]) */
.machine power7
-ENTRY (BP_SYM (__strnlen))
+ENTRY (__strnlen)
CALL_MCOUNT
dcbt 0,r3
clrrwi r8,r3,2 /* Align the address to word boundary. */
@@ -166,6 +164,6 @@ L(loop_small):
cmplw r9,r7
bge L(end_max)
b L(loop_small)
-END (BP_SYM (__strnlen))
-weak_alias (BP_SYM (__strnlen), BP_SYM(strnlen))
+END (__strnlen)
+weak_alias (__strnlen, strnlen)
libc_hidden_builtin_def (strnlen)
diff --git a/libc/sysdeps/powerpc/powerpc32/rshift.S b/libc/sysdeps/powerpc/powerpc32/rshift.S
index 4fd9cb7fb..9cc63aa96 100644
--- a/libc/sysdeps/powerpc/powerpc32/rshift.S
+++ b/libc/sysdeps/powerpc/powerpc32/rshift.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* INPUT PARAMETERS
res_ptr r3
@@ -26,12 +24,7 @@
size r5
cnt r6 */
-ENTRY (BP_SYM (__mpn_rshift))
-#if __BOUNDED_POINTERS__
- slwi r10,r5,2 /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (r3, r8, r9, r10)
- CHECK_BOUNDS_BOTH_WIDE (r4, r8, r9, r10)
-#endif
+ENTRY (__mpn_rshift)
mtctr r5 # copy size into CTR
addi r7,r3,-4 # move adjusted res_ptr to free return reg
subfic r8,r6,32
@@ -59,4 +52,4 @@ L(1): srw r0,r11,r6
L(2): srw r0,r10,r6
stw r0,4(r7)
blr
-END (BP_SYM (__mpn_rshift))
+END (__mpn_rshift)
diff --git a/libc/sysdeps/powerpc/powerpc32/setjmp-common.S b/libc/sysdeps/powerpc/powerpc32/setjmp-common.S
index a35507fa4..60b0026fa 100644
--- a/libc/sysdeps/powerpc/powerpc32/setjmp-common.S
+++ b/libc/sysdeps/powerpc/powerpc32/setjmp-common.S
@@ -23,12 +23,9 @@
#else
# include <jmpbuf-offsets.h>
#endif
-#include <bp-sym.h>
-#include <bp-asm.h>
-ENTRY (BP_SYM (__sigsetjmp))
- CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
+ENTRY (__sigsetjmp)
#ifdef PTR_MANGLE
mr r5,r1
@@ -67,6 +64,6 @@ ENTRY (BP_SYM (__sigsetjmp))
li r3,0
blr
#else
- b BP_SYM (__sigjmp_save@local)
+ b __sigjmp_save@local
#endif
-END (BP_SYM (__sigsetjmp))
+END (__sigsetjmp)
diff --git a/libc/sysdeps/powerpc/powerpc32/start.S b/libc/sysdeps/powerpc/powerpc32/start.S
index 6c6970518..9d5f8d344 100644
--- a/libc/sysdeps/powerpc/powerpc32/start.S
+++ b/libc/sysdeps/powerpc/powerpc32/start.S
@@ -34,7 +34,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include "bp-sym.h"
/* These are the various addresses we require. */
#ifdef PIC
@@ -45,7 +44,7 @@
.align 2
L(start_addresses):
.long _SDA_BASE_
- .long BP_SYM (main)
+ .long main
.long __libc_csu_init
.long __libc_csu_fini
ASM_SIZE_DIRECTIVE(L(start_addresses))
@@ -78,7 +77,7 @@ ENTRY(_start)
lwzu r13,L(start_addresses)@l(r8)
#endif
/* and continue in libc-start, in glibc. */
- b JUMPTARGET(BP_SYM (__libc_start_main))
+ b JUMPTARGET(__libc_start_main)
END(_start)
/* Define a symbol for the first piece of initialized data. */
diff --git a/libc/sysdeps/powerpc/powerpc32/stpcpy.S b/libc/sysdeps/powerpc/powerpc32/stpcpy.S
index 49f993d1c..03c6dddc3 100644
--- a/libc/sysdeps/powerpc/powerpc32/stpcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/stpcpy.S
@@ -17,35 +17,23 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* See strlen.s for comments on how the end-of-string testing works. */
/* char * [r3] stpcpy (char *dest [r3], const char *src [r4]) */
-EALIGN (BP_SYM (__stpcpy), 4, 0)
+EALIGN (__stpcpy, 4, 0)
#define rTMP r0
#define rRTN r3
-#if __BOUNDED_POINTERS__
-# define rDEST r4 /* pointer to previous word in dest */
-# define rSRC r5 /* pointer to previous word in src */
-# define rLOW r11
-# define rHIGH r12
-#else
-# define rDEST r3 /* pointer to previous word in dest */
-# define rSRC r4 /* pointer to previous word in src */
-#endif
+#define rDEST r3 /* pointer to previous word in dest */
+#define rSRC r4 /* pointer to previous word in src */
#define rWORD r6 /* current word from src */
#define rFEFE r7 /* 0xfefefeff */
#define r7F7F r8 /* 0x7f7f7f7f */
#define rNEG r9 /* ~(word in src | 0x7f7f7f7f) */
#define rALT r10 /* alternate word from src */
- CHECK_BOUNDS_LOW (rSRC, rLOW, rHIGH)
- CHECK_BOUNDS_LOW (rDEST, rLOW, rHIGH)
- STORE_RETURN_BOUNDS (rLOW, rHIGH)
or rTMP, rSRC, rDEST
clrlwi. rTMP, rTMP, 30
@@ -84,8 +72,6 @@ L(g1): rlwinm. rTMP, rALT, 8, 24, 31
stbu rTMP, 1(rDEST)
beqlr-
stbu rALT, 1(rDEST)
- CHECK_BOUNDS_HIGH (rDEST, rHIGH, twlgt)
- STORE_RETURN_VALUE (rDEST)
blr
/* Oh well. In this case, we just do a byte-by-byte copy. */
@@ -107,15 +93,11 @@ L(u0): lbzu rALT, 1(rSRC)
cmpwi rWORD, 0
bne+ L(u0)
L(u2): stbu rWORD, 1(rDEST)
- CHECK_BOUNDS_HIGH (rDEST, rHIGH, twlgt)
- STORE_RETURN_VALUE (rDEST)
blr
L(u1): stbu rALT, 1(rDEST)
- CHECK_BOUNDS_HIGH (rDEST, rHIGH, twlgt)
- STORE_RETURN_VALUE (rDEST)
blr
-END (BP_SYM (__stpcpy))
+END (__stpcpy)
-weak_alias (BP_SYM (__stpcpy), BP_SYM (stpcpy))
+weak_alias (__stpcpy, stpcpy)
libc_hidden_def (__stpcpy)
libc_hidden_builtin_def (stpcpy)
diff --git a/libc/sysdeps/powerpc/powerpc32/strchr.S b/libc/sysdeps/powerpc/powerpc32/strchr.S
index f2e0d26c9..c9952eecc 100644
--- a/libc/sysdeps/powerpc/powerpc32/strchr.S
+++ b/libc/sysdeps/powerpc/powerpc32/strchr.S
@@ -17,26 +17,18 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* See strlen.s for comments on how this works. */
/* char * [r3] strchr (const char *s [r3] , int c [r4] ) */
-ENTRY (BP_SYM (strchr))
+ENTRY (strchr)
#define rTMP1 r0
#define rRTN r3 /* outgoing result */
-#if __BOUNDED_POINTERS__
-# define rSTR r4
-# define rCHR r5 /* byte we're looking for, spread over the whole word */
-# define rWORD r8 /* the current word */
-#else
-# define rSTR r8 /* current word pointer */
-# define rCHR r4 /* byte we're looking for, spread over the whole word */
-# define rWORD r5 /* the current word */
-#endif
+#define rSTR r8 /* current word pointer */
+#define rCHR r4 /* byte we're looking for, spread over the whole word */
+#define rWORD r5 /* the current word */
#define rCLZB rCHR /* leading zero byte count */
#define rFEFE r6 /* constant 0xfefefeff (-0x01010101) */
#define r7F7F r7 /* constant 0x7f7f7f7f */
@@ -45,8 +37,6 @@ ENTRY (BP_SYM (strchr))
#define rMASK r11 /* mask with the bits to ignore set to 0 */
#define rTMP3 r12
- CHECK_BOUNDS_LOW (rSTR, rTMP1, rTMP2)
- STORE_RETURN_BOUNDS (rTMP1, rTMP2)
rlwimi rCHR, rCHR, 8, 16, 23
li rMASK, -1
@@ -90,7 +80,6 @@ L(loopentry):
L(missed):
and. rTMP1, rTMP1, rTMP2
li rRTN, 0
- STORE_RETURN_VALUE (rSTR)
beqlr
/* It did happen. Decide which one was first...
I'm not sure if this is actually faster than a sequence of
@@ -108,8 +97,6 @@ L(missed):
cntlzw rCLZB, rTMP2
srwi rCLZB, rCLZB, 3
add rRTN, rSTR, rCLZB
- CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge)
- STORE_RETURN_VALUE (rSTR)
blr
L(foundit):
@@ -121,10 +108,8 @@ L(foundit):
subi rSTR, rSTR, 4
srwi rCLZB, rCLZB, 3
add rRTN, rSTR, rCLZB
- CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge)
- STORE_RETURN_VALUE (rSTR)
blr
-END (BP_SYM (strchr))
+END (strchr)
-weak_alias (BP_SYM (strchr), BP_SYM (index))
+weak_alias (strchr, index)
libc_hidden_builtin_def (strchr)
diff --git a/libc/sysdeps/powerpc/powerpc32/strcmp.S b/libc/sysdeps/powerpc/powerpc32/strcmp.S
index d11e55645..297ca3c1b 100644
--- a/libc/sysdeps/powerpc/powerpc32/strcmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/strcmp.S
@@ -17,23 +17,17 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* See strlen.s for comments on how the end-of-string testing works. */
/* int [r3] strcmp (const char *s1 [r3], const char *s2 [r4]) */
-EALIGN (BP_SYM (strcmp), 4, 0)
+EALIGN (strcmp, 4, 0)
#define rTMP r0
#define rRTN r3
#define rSTR1 r3 /* first string arg */
#define rSTR2 r4 /* second string arg */
-#if __BOUNDED_POINTERS__
-# define rHIGH1 r11
-# define rHIGH2 r12
-#endif
#define rWORD1 r5 /* current word in s1 */
#define rWORD2 r6 /* current word in s2 */
#define rFEFE r7 /* constant 0xfefefeff (-0x01010101) */
@@ -41,8 +35,6 @@ EALIGN (BP_SYM (strcmp), 4, 0)
#define rNEG r9 /* ~(word in s1 | 0x7f7f7f7f) */
#define rBITDIF r10 /* bits that differ in s1 & s2 words */
- CHECK_BOUNDS_LOW (rSTR1, rTMP, rHIGH1)
- CHECK_BOUNDS_LOW (rSTR2, rTMP, rHIGH2)
or rTMP, rSTR2, rSTR1
clrlwi. rTMP, rTMP, 30
@@ -82,7 +74,6 @@ L(endstring):
bgelr+ cr1
L(equal):
li rRTN, 0
- /* GKM FIXME: check high bounds. */
blr
L(different):
@@ -92,7 +83,6 @@ L(different):
bgelr+
L(highbit):
ori rRTN, rWORD2, 1
- /* GKM FIXME: check high bounds. */
blr
@@ -116,11 +106,9 @@ L(u1): cmpwi cr1, rWORD1, 0
cmpw rWORD1, rWORD2
bne+ cr1, L(u0)
L(u3): sub rRTN, rWORD1, rWORD2
- /* GKM FIXME: check high bounds. */
blr
L(u4): lbz rWORD1, -1(rSTR1)
sub rRTN, rWORD1, rWORD2
- /* GKM FIXME: check high bounds. */
blr
-END (BP_SYM (strcmp))
+END (strcmp)
libc_hidden_builtin_def (strcmp)
diff --git a/libc/sysdeps/powerpc/powerpc32/strcpy.S b/libc/sysdeps/powerpc/powerpc32/strcpy.S
index c2405924d..4ae577dbb 100644
--- a/libc/sysdeps/powerpc/powerpc32/strcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/strcpy.S
@@ -17,43 +17,27 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* See strlen.s for comments on how the end-of-string testing works. */
/* char * [r3] strcpy (char *dest [r3], const char *src [r4]) */
-EALIGN (BP_SYM (strcpy), 4, 0)
+EALIGN (strcpy, 4, 0)
#define rTMP r0
#define rRTN r3 /* incoming DEST arg preserved as result */
-#if __BOUNDED_POINTERS__
-# define rDEST r4 /* pointer to previous word in dest */
-# define rSRC r5 /* pointer to previous word in src */
-# define rLOW r11
-# define rHIGH r12
-#else
-# define rSRC r4 /* pointer to previous word in src */
-# define rDEST r5 /* pointer to previous word in dest */
-#endif
+#define rSRC r4 /* pointer to previous word in src */
+#define rDEST r5 /* pointer to previous word in dest */
#define rWORD r6 /* current word from src */
#define rFEFE r7 /* constant 0xfefefeff (-0x01010101) */
#define r7F7F r8 /* constant 0x7f7f7f7f */
#define rNEG r9 /* ~(word in s1 | 0x7f7f7f7f) */
#define rALT r10 /* alternate word from src */
- CHECK_BOUNDS_LOW (rSRC, rLOW, rHIGH)
- CHECK_BOUNDS_LOW (rDEST, rLOW, rHIGH)
- STORE_RETURN_BOUNDS (rLOW, rHIGH)
or rTMP, rSRC, rRTN
clrlwi. rTMP, rTMP, 30
-#if __BOUNDED_POINTERS__
- addi rDEST, rDEST, -4
-#else
addi rDEST, rRTN, -4
-#endif
bne L(unaligned)
lis rFEFE, -0x101
@@ -88,7 +72,6 @@ L(g1): rlwinm. rTMP, rALT, 8, 24, 31
stb rTMP, 6(rDEST)
beqlr-
stb rALT, 7(rDEST)
- /* GKM FIXME: check high bound. */
blr
/* Oh well. In this case, we just do a byte-by-byte copy. */
@@ -110,11 +93,9 @@ L(u0): lbzu rALT, 1(rSRC)
cmpwi rWORD, 0
bne+ L(u0)
L(u2): stb rWORD, 1(rDEST)
- /* GKM FIXME: check high bound. */
blr
L(u1): stb rALT, 1(rDEST)
- /* GKM FIXME: check high bound. */
blr
-END (BP_SYM (strcpy))
+END (strcpy)
libc_hidden_builtin_def (strcpy)
diff --git a/libc/sysdeps/powerpc/powerpc32/strlen.S b/libc/sysdeps/powerpc/powerpc32/strlen.S
index b8193a669..9a6eafc38 100644
--- a/libc/sysdeps/powerpc/powerpc32/strlen.S
+++ b/libc/sysdeps/powerpc/powerpc32/strlen.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* The algorithm here uses the following techniques:
@@ -72,7 +70,7 @@
/* int [r3] strlen (char *s [r3]) */
-ENTRY (BP_SYM (strlen))
+ENTRY (strlen)
#define rTMP1 r0
#define rRTN r3 /* incoming STR arg, outgoing result */
@@ -88,7 +86,6 @@ ENTRY (BP_SYM (strlen))
#define rTMP3 r11
#define rTMP4 r12
- CHECK_BOUNDS_LOW (rRTN, rTMP1, rTMP2)
clrrwi rSTR, rRTN, 2
lis r7F7F, 0x7f7f
@@ -153,7 +150,6 @@ L(done0):
subf rTMP1, rRTN, rSTR
srwi rTMP3, rTMP3, 3
add rRTN, rTMP1, rTMP3
- /* GKM FIXME: check high bound. */
blr
-END (BP_SYM (strlen))
+END (strlen)
libc_hidden_builtin_def (strlen)
diff --git a/libc/sysdeps/powerpc/powerpc32/strncmp.S b/libc/sysdeps/powerpc/powerpc32/strncmp.S
index d9e274b69..3cb6509e2 100644
--- a/libc/sysdeps/powerpc/powerpc32/strncmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/strncmp.S
@@ -17,14 +17,12 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* See strlen.s for comments on how the end-of-string testing works. */
/* int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5]) */
-EALIGN (BP_SYM(strncmp), 4, 0)
+EALIGN (strncmp, 4, 0)
#define rTMP r0
#define rRTN r3
@@ -156,5 +154,5 @@ L(u1):
L(u2): lbzu rWORD1, -1(rSTR1)
L(u3): sub rRTN, rWORD1, rWORD2
blr
-END (BP_SYM (strncmp))
+END (strncmp)
libc_hidden_builtin_def (strncmp)
diff --git a/libc/sysdeps/powerpc/powerpc32/sub_n.S b/libc/sysdeps/powerpc/powerpc32/sub_n.S
index 617680dec..94d3d3e94 100644
--- a/libc/sysdeps/powerpc/powerpc32/sub_n.S
+++ b/libc/sysdeps/powerpc/powerpc32/sub_n.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* mp_limb_t mpn_sub_n (mp_ptr res_ptr, mp_srcptr s1_ptr, mp_srcptr s2_ptr,
mp_size_t size)
@@ -28,14 +26,7 @@
possible 2-unrolled inner loop will not be. Also, watch out for the
alignment... */
-EALIGN (BP_SYM (__mpn_sub_n), 3, 1)
-
-#if __BOUNDED_POINTERS__
- slwi r10,r6,2 /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (r3, r8, r9, r10)
- CHECK_BOUNDS_BOTH_WIDE (r4, r8, r9, r10)
- CHECK_BOUNDS_BOTH_WIDE (r5, r8, r9, r10)
-#endif
+EALIGN (__mpn_sub_n, 3, 1)
/* Set up for loop below. */
mtcrf 0x01,r6
@@ -74,4 +65,4 @@ L(0):
L(1): subfe r3,r3,r3
neg r3,r3
blr
-END (BP_SYM (__mpn_sub_n))
+END (__mpn_sub_n)
diff --git a/libc/sysdeps/powerpc/powerpc32/submul_1.S b/libc/sysdeps/powerpc/powerpc32/submul_1.S
index d32f8333e..d820318c3 100644
--- a/libc/sysdeps/powerpc/powerpc32/submul_1.S
+++ b/libc/sysdeps/powerpc/powerpc32/submul_1.S
@@ -17,19 +17,12 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* mp_limb_t mpn_submul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr,
mp_size_t s1_size, mp_limb_t s2_limb)
Calculate res-s1*s2 and put result back in res; return carry. */
-ENTRY (BP_SYM (__mpn_submul_1))
-#if __BOUNDED_POINTERS__
- slwi r10,r5,2 /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (r3, r8, r9, r10)
- CHECK_BOUNDS_BOTH_WIDE (r4, r8, r9, r10)
-#endif
+ENTRY (__mpn_submul_1)
mtctr r5
lwz r0,0(r4)
@@ -55,4 +48,4 @@ L(0): lwzu r0,4(r4)
L(1): stw r8,4(r3)
addze r3,r10
blr
-END (BP_SYM (__mpn_submul_1))
+END (__mpn_submul_1)
diff --git a/libc/sysdeps/powerpc/powerpc64/backtrace.c b/libc/sysdeps/powerpc/powerpc64/backtrace.c
index b52bb1492..2d3e051cb 100644
--- a/libc/sysdeps/powerpc/powerpc64/backtrace.c
+++ b/libc/sysdeps/powerpc/powerpc64/backtrace.c
@@ -18,7 +18,6 @@
#include <execinfo.h>
#include <stddef.h>
-#include <bp-checks.h>
/* This is the stack layout we see with every stack frame.
Note that every routine is required by the ABI to lay out the stack
@@ -34,9 +33,9 @@
*/
struct layout
{
- struct layout *__unbounded next;
+ struct layout *next;
long condition_register;
- void *__unbounded return_address;
+ void *return_address;
};
int
@@ -50,11 +49,10 @@ __backtrace (void **array, int size)
/* Get the address on top-of-stack. */
asm volatile ("ld %0,0(1)" : "=r"(current));
- current = BOUNDED_1 (current);
for ( count = 0;
current != NULL && count < size;
- current = BOUNDED_1 (current->next), count++)
+ current = current->next, count++)
array[count] = current->return_address;
/* It's possible the second-last stack frame can't return
diff --git a/libc/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c b/libc/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
index 16cb57785..b22664772 100644
--- a/libc/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
+++ b/libc/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
@@ -43,7 +43,6 @@
#include "endian.h"
#include "mpa.h"
-#include "mpa2.h"
#include <sys/param.h>
const mp_no mpone = {1, {1.0, 1.0}};
@@ -106,8 +105,6 @@ __cpy (const mp_no *x, mp_no *y, int p)
EY = EX;
for (i = 0; i <= p; i++)
Y[i] = X[i];
-
- return;
}
/* Convert a multiple precision number *X into a double precision
@@ -115,7 +112,7 @@ __cpy (const mp_no *x, mp_no *y, int p)
static void
norm (const mp_no *x, double *y, int p)
{
-#define R RADIXI
+#define R RADIXI
long i;
double a, c, u, v, z[5];
if (p < 5)
@@ -182,7 +179,6 @@ norm (const mp_no *x, double *y, int p)
c *= RADIXI;
*y = c;
- return;
#undef R
}
@@ -294,8 +290,6 @@ denorm (const mp_no *x, double *y, int p)
c = X[0] * ((z[1] + R * (z[2] + R * z[3])) - TWO10);
*y = c * TWOM1032;
- return;
-
#undef R
}
@@ -310,9 +304,7 @@ __mp_dbl (const mp_no *x, double *y, int p)
return;
}
- if (EX > -42)
- norm (x, y, p);
- else if (EX == -42 && X[1] >= TWO10)
+ if (__glibc_likely (EX > -42 || (EX == -42 && X[1] >= TWO10)))
norm (x, y, p);
else
denorm (x, y, p);
@@ -360,7 +352,6 @@ __dbl_mp (double x, mp_no *y, int p)
}
for (; i <= p2; i++)
Y[i] = ZERO;
- return;
}
/* Add magnitudes of *X and *Y assuming that abs (*X) >= abs (*Y) > 0. The
@@ -372,6 +363,7 @@ add_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p)
{
long i, j, k;
long p2 = p;
+ double zk;
EZ = EX;
@@ -379,45 +371,54 @@ add_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p)
j = p2 + EY - EX;
k = p2 + 1;
- if (j < 1)
+ if (__glibc_unlikely (j < 1))
{
__cpy (x, z, p);
return;
}
- else
- Z[k] = ZERO;
+
+ zk = ZERO;
for (; j > 0; i--, j--)
{
- Z[k] += X[i] + Y[j];
- if (Z[k] >= RADIX)
+ zk += X[i] + Y[j];
+ if (zk >= RADIX)
{
- Z[k] -= RADIX;
- Z[--k] = ONE;
+ Z[k--] = zk - RADIX;
+ zk = ONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
for (; i > 0; i--)
{
- Z[k] += X[i];
- if (Z[k] >= RADIX)
+ zk += X[i];
+ if (zk >= RADIX)
{
- Z[k] -= RADIX;
- Z[--k] = ONE;
+ Z[k--] = zk - RADIX;
+ zk = ONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
- if (Z[1] == ZERO)
+ if (zk == ZERO)
{
for (i = 1; i <= p2; i++)
Z[i] = Z[i + 1];
}
else
- EZ += ONE;
+ {
+ Z[1] = zk;
+ EZ += ONE;
+ }
}
/* Subtract the magnitudes of *X and *Y assuming that abs (*x) > abs (*y) > 0.
@@ -429,73 +430,69 @@ sub_magnitudes (const mp_no *x, const mp_no *y, mp_no *z, int p)
{
long i, j, k;
long p2 = p;
+ double zk;
EZ = EX;
+ i = p2;
+ j = p2 + EY - EX;
+ k = p2;
- if (EX == EY)
+ /* Y is too small compared to X, copy X over to the result. */
+ if (__glibc_unlikely (j < 1))
{
- i = j = k = p2;
- Z[k] = Z[k + 1] = ZERO;
+ __cpy (x, z, p);
+ return;
}
- else
+
+ /* The relevant least significant digit in Y is non-zero, so we factor it in
+ to enhance accuracy. */
+ if (j < p2 && Y[j + 1] > ZERO)
{
- j = EX - EY;
- if (j > p2)
- {
- __cpy (x, z, p);
- return;
- }
- else
- {
- i = p2;
- j = p2 + 1 - j;
- k = p2;
- if (Y[j] > ZERO)
- {
- Z[k + 1] = RADIX - Y[j--];
- Z[k] = MONE;
- }
- else
- {
- Z[k + 1] = ZERO;
- Z[k] = ZERO;
- j--;
- }
- }
+ Z[k + 1] = RADIX - Y[j + 1];
+ zk = MONE;
}
+ else
+ zk = Z[k + 1] = ZERO;
+ /* Subtract and borrow. */
for (; j > 0; i--, j--)
{
- Z[k] += (X[i] - Y[j]);
- if (Z[k] < ZERO)
+ zk += (X[i] - Y[j]);
+ if (zk < ZERO)
{
- Z[k] += RADIX;
- Z[--k] = MONE;
+ Z[k--] = zk + RADIX;
+ zk = MONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
+ /* We're done with digits from Y, so it's just digits in X. */
for (; i > 0; i--)
{
- Z[k] += X[i];
- if (Z[k] < ZERO)
+ zk += X[i];
+ if (zk < ZERO)
{
- Z[k] += RADIX;
- Z[--k] = MONE;
+ Z[k--] = zk + RADIX;
+ zk = MONE;
}
else
- Z[--k] = ZERO;
+ {
+ Z[k--] = zk;
+ zk = ZERO;
+ }
}
+ /* Normalize. */
for (i = 1; Z[i] == ZERO; i++);
EZ = EZ - i + 1;
for (k = 1; i <= p2 + 1;)
Z[k++] = Z[i++];
for (; k <= p2;)
Z[k++] = ZERO;
-
- return;
}
/* Add *X and *Y and store the result in *Z. X and Y may overlap, but not X
@@ -545,7 +542,6 @@ __add (const mp_no *x, const mp_no *y, mp_no *z, int p)
else
Z[0] = ZERO;
}
- return;
}
/* Subtract *Y from *X and return the result in *Z. X and Y may overlap but
@@ -596,7 +592,6 @@ __sub (const mp_no *x, const mp_no *y, mp_no *z, int p)
else
Z[0] = ZERO;
}
- return;
}
/* Multiply *X and *Y and store result in *Z. X and Y may overlap but not X
@@ -609,8 +604,8 @@ __mul (const mp_no *x, const mp_no *y, mp_no *z, int p)
long p2 = p;
double u, zk, zk2;
- /* Is z=0? */
- if (X[0] * Y[0] == ZERO)
+ /* Is z=0? */
+ if (__glibc_unlikely (X[0] * Y[0] == ZERO))
{
Z[0] = ZERO;
return;
@@ -685,7 +680,106 @@ __mul (const mp_no *x, const mp_no *y, mp_no *z, int p)
EZ = EX + EY;
Z[0] = X[0] * Y[0];
- return;
+}
+
+/* Square *X and store result in *Y. X and Y may not overlap. For P in
+ [1, 2, 3], the exact result is truncated to P digits. In case P > 3 the
+ error is bounded by 1.001 ULP. This is a faster special case of
+ multiplication. */
+void
+__sqr (const mp_no *x, mp_no *y, int p)
+{
+ long i, j, k, ip;
+ double u, yk;
+
+ /* Is z=0? */
+ if (__glibc_unlikely (X[0] == ZERO))
+ {
+ Y[0] = ZERO;
+ return;
+ }
+
+ /* We need not iterate through all X's since it's pointless to
+ multiply zeroes. */
+ for (ip = p; ip > 0; ip--)
+ if (X[ip] != ZERO)
+ break;
+
+ k = (__glibc_unlikely (p < 3)) ? p + p : p + 3;
+
+ while (k > 2 * ip + 1)
+ Y[k--] = ZERO;
+
+ yk = ZERO;
+
+ while (k > p)
+ {
+ double yk2 = 0.0;
+ long lim = k / 2;
+
+ if (k % 2 == 0)
+ {
+ yk += X[lim] * X[lim];
+ lim--;
+ }
+
+ /* In __mul, this loop (and the one within the next while loop) run
+ between a range to calculate the mantissa as follows:
+
+ Z[k] = X[k] * Y[n] + X[k+1] * Y[n-1] ... + X[n-1] * Y[k+1]
+ + X[n] * Y[k]
+
+ For X == Y, we can get away with summing halfway and doubling the
+ result. For cases where the range size is even, the mid-point needs
+ to be added separately (above). */
+ for (i = k - p, j = p; i <= lim; i++, j--)
+ yk2 += X[i] * X[j];
+
+ yk += 2.0 * yk2;
+
+ u = (yk + CUTTER) - CUTTER;
+ if (u > yk)
+ u -= RADIX;
+ Y[k--] = yk - u;
+ yk = u * RADIXI;
+ }
+
+ while (k > 1)
+ {
+ double yk2 = 0.0;
+ long lim = k / 2;
+
+ if (k % 2 == 0)
+ {
+ yk += X[lim] * X[lim];
+ lim--;
+ }
+
+ /* Likewise for this loop. */
+ for (i = 1, j = k - 1; i <= lim; i++, j--)
+ yk2 += X[i] * X[j];
+
+ yk += 2.0 * yk2;
+
+ u = (yk + CUTTER) - CUTTER;
+ if (u > yk)
+ u -= RADIX;
+ Y[k--] = yk - u;
+ yk = u * RADIXI;
+ }
+ Y[k] = yk;
+
+ /* Squares are always positive. */
+ Y[0] = 1.0;
+
+ EY = 2 * EX;
+ /* Is there a carry beyond the most significant digit? */
+ if (__glibc_unlikely (Y[1] == ZERO))
+ {
+ for (i = 1; i <= p; i++)
+ Y[i] = Y[i + 1];
+ EY--;
+ }
}
/* Invert *X and store in *Y. Relative error bound:
@@ -694,7 +788,7 @@ __mul (const mp_no *x, const mp_no *y, mp_no *z, int p)
- For P > 3: 2.001 * R ^ (1 - P)
*X = 0 is not permissible. */
-void
+static void
__inv (const mp_no *x, mp_no *y, int p)
{
long i;
@@ -719,7 +813,6 @@ __inv (const mp_no *x, mp_no *y, int p)
__sub (&mptwo, y, &z, p);
__mul (&w, &z, y, p);
}
- return;
}
/* Divide *X by *Y and store result in *Z. X and Y may overlap but not X and Z
@@ -741,5 +834,4 @@ __dvd (const mp_no *x, const mp_no *y, mp_no *z, int p)
__inv (y, &w, p);
__mul (x, &w, z, p);
}
- return;
}
diff --git a/libc/sysdeps/s390/bits/setjmp.h b/libc/sysdeps/s390/bits/setjmp.h
index 285003fe2..e929c161a 100644
--- a/libc/sysdeps/s390/bits/setjmp.h
+++ b/libc/sysdeps/s390/bits/setjmp.h
@@ -34,7 +34,7 @@ typedef struct __s390_jmp_buf
long int __gregs[10];
# if __WORDSIZE == 64
- /* We save fpu registers 1, 3, 5 and 7. */
+ /* We save fpu registers f8 - f15. */
long __fpregs[8];
# else
/* We save fpu registers 4 and 6. */
diff --git a/libc/sysdeps/s390/s390-32/dl-trampoline.S b/libc/sysdeps/s390/s390-32/dl-trampoline.S
index 2846d845c..1ae43cbbc 100644
--- a/libc/sysdeps/s390/s390-32/dl-trampoline.S
+++ b/libc/sysdeps/s390/s390-32/dl-trampoline.S
@@ -95,16 +95,16 @@ _dl_runtime_profile:
lr %r1,%r2 # function addr returned in r2
icm %r0,15,20(%r12) # load & test framesize
jnm 2f
+
lm %r2,%r6,32(%r12)
ld %f0,56(%r12)
ld %f2,64(%r12)
- basr %r14,%r1 # call resolved function
-1: lr %r15,%r12 # remove stack frame
+ lr %r15,%r12 # remove stack frame
cfi_def_cfa_register (15)
l %r14,16(%r15) # restore registers
l %r12,12(%r15)
- l %r6,8(%r15)
- br %r14
+ br %r1 # tail-call to the resolved function
+
cfi_def_cfa_register (12)
2: jz 4f # framesize == 0 ?
ahi %r0,7 # align framesize to 8
@@ -131,7 +131,13 @@ _dl_runtime_profile:
la %r4,32(%r12) # pointer to struct La_s390_32_regs
la %r5,72(%r12) # pointer to struct La_s390_32_retval
basr %r14,%r1 # call _dl_call_pltexit
- j 1b
+
+ lr %r15,%r12 # remove stack frame
+ cfi_def_cfa_register (15)
+ l %r14,16(%r15) # restore registers
+ l %r12,12(%r15)
+ br %r14
+
6: .long _dl_profile_fixup - 0b
7: .long _dl_call_pltexit - 5b
cfi_endproc
diff --git a/libc/sysdeps/s390/s390-64/__longjmp.c b/libc/sysdeps/s390/s390-64/__longjmp.c
index 510b1c2da..2682406fd 100644
--- a/libc/sysdeps/s390/s390-64/__longjmp.c
+++ b/libc/sysdeps/s390/s390-64/__longjmp.c
@@ -42,10 +42,14 @@ __longjmp (__jmp_buf env, int val)
register void *r1 __asm ("%r1") = (void *) env;
#endif
/* Restore registers and jump back. */
- asm volatile ("ld %%f7,104(%1)\n\t"
- "ld %%f5,96(%1)\n\t"
- "ld %%f3,88(%1)\n\t"
- "ld %%f1,80(%1)\n\t"
+ asm volatile ("ld %%f8,80(%1)\n\t"
+ "ld %%f9,88(%1)\n\t"
+ "ld %%f10,96(%1)\n\t"
+ "ld %%f11,104(%1)\n\t"
+ "ld %%f12,112(%1)\n\t"
+ "ld %%f13,120(%1)\n\t"
+ "ld %%f14,128(%1)\n\t"
+ "ld %%f15,136(%1)\n\t"
#ifdef PTR_DEMANGLE
"lmg %%r6,%%r13,0(%1)\n\t"
"lmg %%r4,%%r5,64(%1)\n\t"
diff --git a/libc/sysdeps/s390/s390-64/dl-trampoline.S b/libc/sysdeps/s390/s390-64/dl-trampoline.S
index 81144a0ca..29d374f86 100644
--- a/libc/sysdeps/s390/s390-64/dl-trampoline.S
+++ b/libc/sysdeps/s390/s390-64/dl-trampoline.S
@@ -1,4 +1,4 @@
-/* PLT trampolines. s390 version.
+/* PLT trampolines. s390x version.
Copyright (C) 2005-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -20,8 +20,8 @@
* with the following linkage:
* r2 - r6 : parameter registers
* f0, f2, f4, f6 : floating point parameter registers
- * 24(r15), 28(r15) : PLT arguments PLT1, PLT2
- * 96(r15) : additional stack parameters
+ * 48(r15), 56(r15) : PLT arguments PLT1, PLT2
+ * 160(r15) : additional stack parameters
* The normal clobber rules for function calls apply:
* r0 - r5 : call clobbered
* r6 - r13 : call saved
@@ -39,21 +39,21 @@
cfi_startproc
.align 16
_dl_runtime_resolve:
- stmg 2,5,64(15) # save registers
- stg 14,96(15)
+ stmg %r2,%r5,64(15) # save call-clobbered argument registers
+ stg %r14,96(15)
cfi_offset (r14, -64)
- lgr 0,15 # create stack frame
- aghi 15,-160
+ lgr %r0,%r15
+ aghi %r15,-160 # create stack frame
cfi_adjust_cfa_offset (160)
- stg 0,0(15)
- lmg 2,3,208(15) # load args saved by PLT
- brasl 14,_dl_fixup # call fixup
- lgr 1,2 # function addr returned in r2
- aghi 15,160 # remove stack frame
+ stg %r0,0(%r15) # write backchain
+ lmg %r2,%r3,208(%r15)# load args saved by PLT
+ brasl %r14,_dl_fixup # call fixup
+ lgr %r1,%r2 # function addr returned in r2
+ aghi %r15,160 # remove stack frame
cfi_adjust_cfa_offset (-160)
- lg 14,96(15) # restore registers
- lmg 2,5,64(15)
- br 1
+ lg %r14,96(15) # restore registers
+ lmg %r2,%r5,64(15)
+ br %r1
cfi_endproc
.size _dl_runtime_resolve, .-_dl_runtime_resolve
@@ -64,13 +64,12 @@ _dl_runtime_resolve:
cfi_startproc
.align 16
_dl_runtime_profile:
- stmg %r2,%r6,64(%r15) # save registers
- std %f0,104(%r15)
- std %f2,112(%r15)
+ stmg %r2,%r6,64(%r15) # save call-clobbered arg regs
+ std %f0,104(%r15) # + r6 needed as arg for
+ std %f2,112(%r15) # _dl_profile_fixup
std %f4,120(%r15)
std %f6,128(%r15)
- stg %r6,16(%r15)
- stg %r12,24(%r15)
+ stg %r12,24(%r15) # r12 is used as backup of r15
stg %r14,32(%r15)
cfi_offset (r6, -96)
cfi_offset (f0, -56)
@@ -79,10 +78,10 @@ _dl_runtime_profile:
cfi_offset (f6, -32)
cfi_offset (r12, -136)
cfi_offset (r14, -128)
- lgr %r12,%r15 # create stack frame
+ lgr %r12,%r15 # backup stack pointer
cfi_def_cfa_register (12)
- aghi %r15,-160
- stg %r12,0(%r15)
+ aghi %r15,-160 # create stack frame
+ stg %r12,0(%r15) # save backchain
lmg %r2,%r3,48(%r12) # load arguments saved by PLT
lgr %r4,%r14 # return address as third parameter
la %r5,64(%r12) # pointer to struct La_s390_32_regs
@@ -92,18 +91,19 @@ _dl_runtime_profile:
lg %r0,40(%r12) # load framesize
ltgr %r0,%r0
jnm 1f
- lmg %r2,%r6,64(%r12)
- ld %f0,104(%r12)
- ld %f2,112(%r12)
+
+ lmg %r2,%r6,64(%r12) # framesize < 0 means no pltexit call
+ ld %f0,104(%r12) # so we can do a tail call without
+ ld %f2,112(%r12) # copying the arg overflow area
ld %f4,120(%r12)
ld %f6,128(%r12)
- basr %r14,%r1 # call resolved function
-0: lgr %r15,%r12 # remove stack frame
+
+ lgr %r15,%r12 # remove stack frame
cfi_def_cfa_register (15)
lg %r14,32(%r15) # restore registers
lg %r12,24(%r15)
- lg %r6,16(%r15)
- br %r14
+ br %r1 # tail-call to resolved function
+
cfi_def_cfa_register (12)
1: jz 4f # framesize == 0 ?
aghi %r0,7 # align framesize to 8
@@ -118,7 +118,7 @@ _dl_runtime_profile:
la %r3,8(%r3)
brctg %r0,3b
4: lmg %r2,%r6,64(%r12) # load register parameters
- ld %f0,104(%r12)
+ ld %f0,104(%r12) # restore call-clobbered arg regs
ld %f2,112(%r12)
ld %f4,120(%r12)
ld %f6,128(%r12)
@@ -129,7 +129,13 @@ _dl_runtime_profile:
la %r4,32(%r12) # pointer to struct La_s390_32_regs
la %r5,72(%r12) # pointer to struct La_s390_32_retval
brasl %r14,_dl_call_pltexit
- j 0b
+
+ lgr %r15,%r12 # remove stack frame
+ cfi_def_cfa_register (15)
+ lg %r14,32(%r15) # restore registers
+ lg %r12,24(%r15)
+ br %r14
+
cfi_endproc
.size _dl_runtime_profile, .-_dl_runtime_profile
#endif
diff --git a/libc/sysdeps/s390/s390-64/setjmp.S b/libc/sysdeps/s390/s390-64/setjmp.S
index b12d9059e..6269dbf52 100644
--- a/libc/sysdeps/s390/s390-64/setjmp.S
+++ b/libc/sysdeps/s390/s390-64/setjmp.S
@@ -55,10 +55,14 @@ ENTRY(__sigsetjmp)
#else
stmg %r6,%r15,0(%r2) /* Store registers in jmp_buf. */
#endif
- std %f1,80(%r2)
- std %f3,88(%r2)
- std %f5,96(%r2)
- std %f7,104(%r2)
+ std %f8,80(%r2)
+ std %f9,88(%r2)
+ std %f10,96(%r2)
+ std %f11,104(%r2)
+ std %f12,112(%r2)
+ std %f13,120(%r2)
+ std %f14,128(%r2)
+ std %f15,136(%r2)
#if defined NOT_IN_libc && defined IS_IN_rtld
/* In ld.so we never save the signal mask. */
lghi %r2,0
diff --git a/libc/sysdeps/sparc/Makefile b/libc/sysdeps/sparc/Makefile
index 3f0c09640..31aaeaed8 100644
--- a/libc/sysdeps/sparc/Makefile
+++ b/libc/sysdeps/sparc/Makefile
@@ -3,6 +3,10 @@ long-double-fcts = yes
pie-ccflag = -fPIE
+ifeq ($(subdir),debug)
+CFLAGS-backtrace.c += -funwind-tables
+endif
+
ifeq ($(subdir),gmon)
sysdep_routines += sparc-mcount
endif
diff --git a/libc/sysdeps/sparc/backtrace.c b/libc/sysdeps/sparc/backtrace.c
new file mode 100644
index 000000000..48f3cf6c1
--- /dev/null
+++ b/libc/sysdeps/sparc/backtrace.c
@@ -0,0 +1,159 @@
+/* Return backtrace of current program state.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#include <execinfo.h>
+#include <stddef.h>
+#include <sysdep.h>
+#include <sys/trap.h>
+#include <dlfcn.h>
+#include <unwind.h>
+#include <backtrace.h>
+
+struct layout
+{
+ unsigned long locals[8];
+ unsigned long ins[6];
+ unsigned long next;
+ void *return_address;
+};
+
+struct trace_arg
+{
+ void **array;
+ _Unwind_Word cfa;
+ int cnt;
+ int size;
+};
+
+#ifdef SHARED
+static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *);
+static _Unwind_Ptr (*unwind_getip) (struct _Unwind_Context *);
+static _Unwind_Word (*unwind_getcfa) (struct _Unwind_Context *);
+static void *libgcc_handle;
+
+/* Dummy version in case libgcc_s does not contain the real code. */
+static _Unwind_Word
+dummy_getcfa (struct _Unwind_Context *ctx __attribute__ ((unused)))
+{
+ return 0;
+}
+
+static void
+init (void)
+{
+ libgcc_handle = __libc_dlopen ("libgcc_s.so.1");
+
+ if (libgcc_handle == NULL)
+ return;
+
+ unwind_backtrace = __libc_dlsym (libgcc_handle, "_Unwind_Backtrace");
+ unwind_getip = __libc_dlsym (libgcc_handle, "_Unwind_GetIP");
+ if (unwind_getip == NULL)
+ unwind_backtrace = NULL;
+ unwind_getcfa = (__libc_dlsym (libgcc_handle, "_Unwind_GetCFA")
+ ?: dummy_getcfa);
+}
+#else
+# define unwind_backtrace _Unwind_Backtrace
+# define unwind_getip _Unwind_GetIP
+# define unwind_getcfa _Unwind_GetCFA
+#endif
+
+static _Unwind_Reason_Code
+backtrace_helper (struct _Unwind_Context *ctx, void *a)
+{
+ struct trace_arg *arg = a;
+ _Unwind_Ptr ip;
+
+ /* We are first called with address in the __backtrace function.
+ Skip it. */
+ if (arg->cnt != -1)
+ {
+ ip = unwind_getip (ctx);
+ arg->array[arg->cnt] = (void *) ip;
+
+ /* Check whether we make any progress. */
+ _Unwind_Word cfa = unwind_getcfa (ctx);
+
+ if (arg->cnt > 0 && arg->array[arg->cnt - 1] == arg->array[arg->cnt]
+ && cfa == arg->cfa)
+ return _URC_END_OF_STACK;
+ arg->cfa = cfa;
+ }
+ if (++arg->cnt == arg->size)
+ return _URC_END_OF_STACK;
+ return _URC_NO_REASON;
+}
+
+int
+__backtrace (void **array, int size)
+{
+ struct trace_arg arg = { .array = array, .cfa = 0, .size = size, .cnt = -1 };
+ bool use_unwinder;
+ int count;
+
+ if (!size)
+ return 0;
+
+ use_unwinder = true;
+#ifdef SHARED
+ __libc_once_define (static, once);
+
+ __libc_once (once, init);
+ if (unwind_backtrace == NULL)
+ use_unwinder = false;
+#endif
+
+ if (use_unwinder == false)
+ {
+ struct layout *current;
+ unsigned long fp, i7;
+
+ asm volatile ("mov %%fp, %0" : "=r"(fp));
+ asm volatile ("mov %%i7, %0" : "=r"(i7));
+ current = (struct layout *) (fp + BACKTRACE_STACK_BIAS);
+
+ array[0] = (void *) i7;
+
+ if (size == 1)
+ return 1;
+
+ backtrace_flush_register_windows();
+ for (count = 1; count < size; count++)
+ {
+ array[count] = current->return_address;
+ if (!current->next)
+ break;
+ current = (struct layout *) (current->next + BACKTRACE_STACK_BIAS);
+ }
+ }
+ else
+ {
+ unwind_backtrace (backtrace_helper, &arg);
+
+ /* _Unwind_Backtrace seems to put NULL address above
+ _start. Fix it up here. */
+ if (arg.cnt > 1 && arg.array[arg.cnt - 1] == NULL)
+ --arg.cnt;
+ count = arg.cnt != -1 ? arg.cnt : 0;
+ }
+ return count;
+}
+weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
diff --git a/libc/sysdeps/sparc/fpu/libm-test-ulps b/libc/sysdeps/sparc/fpu/libm-test-ulps
index f282a160a..6eee78843 100644
--- a/libc/sysdeps/sparc/fpu/libm-test-ulps
+++ b/libc/sysdeps/sparc/fpu/libm-test-ulps
@@ -204,6 +204,38 @@ ldouble: 1
Test "Real part of: cacos (-0.5 - 0 i) == 2.094395102393195492308428922186335256131 + +0 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-1025 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-1025 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442100 - 1.194763217287109304111930828519090523536 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442100 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442100 + 1.194763217287109304111930828519090523536 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442100 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-16385 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-16385 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (-0x1p500 + 1.0 i) == 3.141592653589793238462643383279502884197 - 3.472667374605326000180332928505464606058e2 i":
ildouble: 1
ldouble: 1
@@ -262,6 +294,32 @@ ifloat: 1
Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-1025 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-1025 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442097 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442097 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-16385 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-16385 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 - 7.107906849659093345062145442726115449315e2 i":
double: 1
idouble: 1
@@ -481,6 +539,32 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-1025 + 1.5 i) == -2.989196569048182929051881765490354365918e-309 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-1025 - 1.5 i) == -2.989196569048182929051881765490354365918e-309 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-129 + 1.5 i) == -1.579176199917649005841160751101628985741e-39 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-129 - 1.5 i) == -1.579176199917649005841160751101628985741e-39 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-16385 + 1.5 i) == -4.516698239814521372306784062043266700598e-4933 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-16385 - 1.5 i) == -4.516698239814521372306784062043266700598e-4933 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (-0x1p500 + 1.0 i) == -1.570796326794896619231321691639751442099 + 3.472667374605326000180332928505464606058e2 i":
ildouble: 1
ldouble: 1
@@ -520,6 +604,32 @@ ifloat: 1
Test "Imaginary part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-1025 + 1.5 i) == 2.989196569048182929051881765490354365918e-309 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-1025 - 1.5 i) == 2.989196569048182929051881765490354365918e-309 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-129 + 1.5 i) == 1.579176199917649005841160751101628985741e-39 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-129 - 1.5 i) == 1.579176199917649005841160751101628985741e-39 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-16385 + 1.5 i) == 4.516698239814521372306784062043266700598e-4933 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-16385 - 1.5 i) == 4.516698239814521372306784062043266700598e-4933 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 + 7.107906849659093345062145442726115449315e2 i":
double: 1
idouble: 1
@@ -635,6 +745,19 @@ idouble: 2
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Real part of: casinh (-1.5 + 0x1.fp-1025 i) == -1.194763217287109304111930828519090523536 + 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 + 0x1.fp-129 i) == -1.194763217287109304111930828519090523536 + 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 + 0x1.fp-16385 i) == -1.194763217287109304111930828519090523536 + 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-1.5 - 0 i) == -1.194763217287109304111930828519090523536 - 0 i":
double: 2
float: 1
@@ -642,6 +765,19 @@ idouble: 2
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Real part of: casinh (-1.5 - 0x1.fp-1025 i) == -1.194763217287109304111930828519090523536 - 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 - 0x1.fp-129 i) == -1.194763217287109304111930828519090523536 - 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 - 0x1.fp-16385 i) == -1.194763217287109304111930828519090523536 - 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
double: 5
float: 1
@@ -730,11 +866,37 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-1025 i) == 1.194763217287109304111930828519090523536 + 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-129 i) == 1.194763217287109304111930828519090523536 + 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-16385 i) == 1.194763217287109304111930828519090523536 + 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (1.5 - 0 i) == 1.194763217287109304111930828519090523536 - 0 i":
double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-1025 i) == 1.194763217287109304111930828519090523536 - 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-129 i) == 1.194763217287109304111930828519090523536 - 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-16385 i) == 1.194763217287109304111930828519090523536 - 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
# catan
Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
diff --git a/libc/sysdeps/sparc/sparc32/backtrace.h b/libc/sysdeps/sparc/sparc32/backtrace.h
new file mode 100644
index 000000000..089f8b4d2
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/backtrace.h
@@ -0,0 +1,7 @@
+/* Private macros for guiding the backtrace implementation, sparc32
+ version. */
+
+#define backtrace_flush_register_windows() \
+ asm volatile ("ta %0" : : "i" (ST_FLUSH_WINDOWS))
+
+#define BACKTRACE_STACK_BIAS 0
diff --git a/libc/sysdeps/sparc/sparc32/memchr.S b/libc/sysdeps/sparc/sparc32/memchr.S
index 295005dd8..7ea782538 100644
--- a/libc/sysdeps/sparc/sparc32/memchr.S
+++ b/libc/sysdeps/sparc/sparc32/memchr.S
@@ -139,7 +139,4 @@ ENTRY(__memchr)
END(__memchr)
weak_alias (__memchr, memchr)
-#if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
-#endif
libc_hidden_builtin_def (memchr)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/Makefile b/libc/sysdeps/sparc/sparc32/sparcv9/Makefile
index 8a9330f7a..7d475b089 100644
--- a/libc/sysdeps/sparc/sparc32/sparcv9/Makefile
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/Makefile
@@ -10,13 +10,11 @@ ASFLAGS-.o += -Wa,-Av9d
ASFLAGS-.os += -Wa,-Av9d
ASFLAGS-.op += -Wa,-Av9d
ASFLAGS-.og += -Wa,-Av9d
-ASFLAGS-.ob += -Wa,-Av9d
ASFLAGS-.oS += -Wa,-Av9d
else
ASFLAGS-.o += -Wa,-Av9a
ASFLAGS-.os += -Wa,-Av9a
ASFLAGS-.op += -Wa,-Av9a
ASFLAGS-.og += -Wa,-Av9a
-ASFLAGS-.ob += -Wa,-Av9a
ASFLAGS-.oS += -Wa,-Av9a
endif
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/backtrace.h b/libc/sysdeps/sparc/sparc32/sparcv9/backtrace.h
new file mode 100644
index 000000000..8d6c75671
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/backtrace.h
@@ -0,0 +1,7 @@
+/* Private macros for guiding the backtrace implementation, sparc32 v9
+ version. */
+
+#define backtrace_flush_register_windows() \
+ asm volatile ("flushw")
+
+#define BACKTRACE_STACK_BIAS 0
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h b/libc/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h
index b1a89584f..937d7a149 100644
--- a/libc/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h
@@ -55,10 +55,16 @@ typedef uintmax_t uatomic_max_t;
({ \
__typeof (*(mem)) __acev_tmp; \
__typeof (mem) __acev_mem = (mem); \
- __asm __volatile ("cas [%4], %2, %0" \
- : "=r" (__acev_tmp), "=m" (*__acev_mem) \
- : "r" (oldval), "m" (*__acev_mem), "r" (__acev_mem), \
- "0" (newval) : "memory"); \
+ if (__builtin_constant_p (oldval) && (oldval) == 0) \
+ __asm __volatile ("cas [%3], %%g0, %0" \
+ : "=r" (__acev_tmp), "=m" (*__acev_mem) \
+ : "m" (*__acev_mem), "r" (__acev_mem), \
+ "0" (newval) : "memory"); \
+ else \
+ __asm __volatile ("cas [%4], %2, %0" \
+ : "=r" (__acev_tmp), "=m" (*__acev_mem) \
+ : "r" (oldval), "m" (*__acev_mem), "r" (__acev_mem), \
+ "0" (newval) : "memory"); \
__acev_tmp; })
/* This can be implemented if needed. */
diff --git a/libc/sysdeps/sparc/sparc64/Makefile b/libc/sysdeps/sparc/sparc64/Makefile
index 2b7b83035..fb161ea13 100644
--- a/libc/sysdeps/sparc/sparc64/Makefile
+++ b/libc/sysdeps/sparc/sparc64/Makefile
@@ -12,6 +12,5 @@ ASFLAGS-.o += -Wa,-Av9d
ASFLAGS-.os += -Wa,-Av9d
ASFLAGS-.op += -Wa,-Av9d
ASFLAGS-.og += -Wa,-Av9d
-ASFLAGS-.ob += -Wa,-Av9d
ASFLAGS-.oS += -Wa,-Av9d
endif
diff --git a/libc/sysdeps/sparc/sparc64/backtrace.c b/libc/sysdeps/sparc/sparc64/backtrace.c
deleted file mode 100644
index 230ca1fa2..000000000
--- a/libc/sysdeps/sparc/sparc64/backtrace.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Return backtrace of current program state.
- Copyright (C) 2008-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#include <execinfo.h>
-#include <stddef.h>
-#include <bp-checks.h>
-#include <sysdep.h>
-
-struct layout
-{
- unsigned long locals[8];
- unsigned long ins[6];
- unsigned long next;
- void *__unbounded return_address;
-};
-
-int
-__backtrace (void **array, int size)
-{
- struct layout *current;
- unsigned long fp;
- int count;
-
- asm volatile ("flushw");
- asm volatile ("mov %%fp, %0" : "=r"(fp));
- current = (struct layout *__unbounded) (fp + STACK_BIAS);
- current = BOUNDED_1 (current);
-
- for (count = 0; count < size; count++)
- {
- array[count] = current->return_address;
- if (!current->next)
- break;
- current = (struct layout *__unbounded) (current->next + STACK_BIAS);
- current = BOUNDED_1 (current);
- }
-
- return count;
-}
-weak_alias (__backtrace, backtrace)
-libc_hidden_def (__backtrace)
diff --git a/libc/sysdeps/sparc/sparc64/backtrace.h b/libc/sysdeps/sparc/sparc64/backtrace.h
new file mode 100644
index 000000000..b9c95c51c
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/backtrace.h
@@ -0,0 +1,7 @@
+/* Private macros for guiding the backtrace implementation, sparc64
+ version. */
+
+#define backtrace_flush_register_windows() \
+ asm volatile ("flushw")
+
+#define BACKTRACE_STACK_BIAS STACK_BIAS
diff --git a/libc/sysdeps/sparc/sparc64/bits/atomic.h b/libc/sysdeps/sparc/sparc64/bits/atomic.h
index 0afbb4ba5..96611de42 100644
--- a/libc/sysdeps/sparc/sparc64/bits/atomic.h
+++ b/libc/sysdeps/sparc/sparc64/bits/atomic.h
@@ -55,20 +55,32 @@ typedef uintmax_t uatomic_max_t;
({ \
__typeof (*(mem)) __acev_tmp; \
__typeof (mem) __acev_mem = (mem); \
- __asm __volatile ("cas [%4], %2, %0" \
- : "=r" (__acev_tmp), "=m" (*__acev_mem) \
- : "r" (oldval), "m" (*__acev_mem), "r" (__acev_mem), \
- "0" (newval) : "memory"); \
+ if (__builtin_constant_p (oldval) && (oldval) == 0) \
+ __asm __volatile ("cas [%3], %%g0, %0" \
+ : "=r" (__acev_tmp), "=m" (*__acev_mem) \
+ : "m" (*__acev_mem), "r" (__acev_mem), \
+ "0" (newval) : "memory"); \
+ else \
+ __asm __volatile ("cas [%4], %2, %0" \
+ : "=r" (__acev_tmp), "=m" (*__acev_mem) \
+ : "r" (oldval), "m" (*__acev_mem), "r" (__acev_mem), \
+ "0" (newval) : "memory"); \
__acev_tmp; })
#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
({ \
__typeof (*(mem)) __acev_tmp; \
__typeof (mem) __acev_mem = (mem); \
- __asm __volatile ("casx [%4], %2, %0" \
- : "=r" (__acev_tmp), "=m" (*__acev_mem) \
- : "r" ((long) (oldval)), "m" (*__acev_mem), \
- "r" (__acev_mem), "0" ((long) (newval)) : "memory"); \
+ if (__builtin_constant_p (oldval) && (oldval) == 0) \
+ __asm __volatile ("casx [%3], %%g0, %0" \
+ : "=r" (__acev_tmp), "=m" (*__acev_mem) \
+ : "m" (*__acev_mem), "r" (__acev_mem), \
+ "0" ((long) (newval)) : "memory"); \
+ else \
+ __asm __volatile ("casx [%4], %2, %0" \
+ : "=r" (__acev_tmp), "=m" (*__acev_mem) \
+ : "r" ((long) (oldval)), "m" (*__acev_mem), \
+ "r" (__acev_mem), "0" ((long) (newval)) : "memory"); \
__acev_tmp; })
#define atomic_exchange_acq(mem, newvalue) \
diff --git a/libc/sysdeps/sparc/sparc64/memchr.S b/libc/sysdeps/sparc/sparc64/memchr.S
index ee700b6e2..0cd2573a0 100644
--- a/libc/sysdeps/sparc/sparc64/memchr.S
+++ b/libc/sysdeps/sparc/sparc64/memchr.S
@@ -256,7 +256,4 @@ ENTRY(__memchr)
END(__memchr)
weak_alias (__memchr, memchr)
-#if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
-#endif
libc_hidden_builtin_def (memchr)
diff --git a/libc/sysdeps/unix/Makefile b/libc/sysdeps/unix/Makefile
index 7fd0003d6..375561f0d 100644
--- a/libc/sysdeps/unix/Makefile
+++ b/libc/sysdeps/unix/Makefile
@@ -88,21 +88,10 @@ $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \
mv -f $@T $@
endif
-# The $(bppfx)syscall.ob objects depend on s-proto-bp.d, which are
-# generated to specify dependencies generated BP stubs have on headers.
-# These deps use file names relative to a subdir, so don't
-# include them in the parent directory.
-ifneq (,$(filter $(unix-syscalls),$(routines) $(sysdep_routines) $(aux)))
-ifndef no_deps
--include $(common-objpfx)s-proto-bp.d
-endif
-endif
-
$(common-objpfx)s-%.d: $(..)sysdeps/unix/s-%.S \
$(wildcard $(+sysdep_dirs:%=%/syscalls.list))
$(+make-deps)
-common-generated += s-proto-bp.d
postclean-generated += sysd-syscalls
endif
diff --git a/libc/sysdeps/unix/bsd/ulimit.c b/libc/sysdeps/unix/bsd/ulimit.c
deleted file mode 100644
index 366488b91..000000000
--- a/libc/sysdeps/unix/bsd/ulimit.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Copyright (C) 1991-2013 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 <stdarg.h>
-#include <sysdep.h>
-#include <ulimit.h>
-#include <unistd.h>
-#include <sys/resource.h>
-
-
-extern int _etext;
-
-/* Function depends on CMD:
- 1 = Return the limit on the size of a file, in units of 512 bytes.
- 2 = Set the limit on the size of a file to NEWLIMIT. Only the
- super-user can increase the limit.
- 3 = Return the maximum possible address of the data segment.
- 4 = Return the maximum number of files that the calling process
- can open.
- Returns -1 on errors. */
-long int
-ulimit (int cmd, ...)
-{
- struct rlimit limit;
- va_list va;
- long int result = -1;
-
- va_start (va, cmd);
-
- switch (cmd)
- {
- case UL_GETFSIZE:
- /* Get limit on file size. */
- if (getrlimit (RLIMIT_FSIZE, &limit) == 0)
- /* Convert from bytes to 512 byte units. */
- result = limit.rlim_cur / 512;
- break;
-
- case UL_SETFSIZE:
- /* Set limit on file size. */
- {
- long int newlimit = va_arg (va, long int);
-
- if ((rlim_t) newlimit > RLIM_INFINITY / 512)
- {
- limit.rlim_cur = RLIM_INFINITY;
- limit.rlim_max = RLIM_INFINITY;
- }
- else
- {
- limit.rlim_cur = newlimit * 512;
- limit.rlim_max = newlimit * 512;
- }
-
- result = setrlimit (RLIMIT_FSIZE, &limit);
- }
- break;
-
- case __UL_GETMAXBRK:
- /* Get maximum address for `brk'. */
- if (getrlimit (RLIMIT_DATA, &limit) == 0)
- result = ((long int) &_etext) + limit.rlim_cur;
- break;
-
- case __UL_GETOPENMAX:
- result = sysconf (_SC_OPEN_MAX);
- break;
-
- default:
- __set_errno (EINVAL);
- }
-
- va_end (va);
-
- return result;
-}
diff --git a/libc/sysdeps/unix/i386/sysdep.S b/libc/sysdeps/unix/i386/sysdep.S
index 249a11543..24e0b1df4 100644
--- a/libc/sysdeps/unix/i386/sysdep.S
+++ b/libc/sysdeps/unix/i386/sysdep.S
@@ -18,8 +18,6 @@
#include <sysdep.h>
#define _ERRNO_H
#include <bits/errno.h>
-#include <bp-asm.h>
-#include <bp-sym.h>
#ifdef IS_IN_rtld
# include <dl-sysdep.h> /* Defines RTLD_PRIVATE_ERRNO. */
diff --git a/libc/sysdeps/unix/inet/Subdirs b/libc/sysdeps/unix/inet/Subdirs
index 4a191e299..0a02dd444 100644
--- a/libc/sysdeps/unix/inet/Subdirs
+++ b/libc/sysdeps/unix/inet/Subdirs
@@ -4,4 +4,5 @@ hesiod
sunrpc
nis
nscd
+nss
streams
diff --git a/libc/sysdeps/unix/make-syscalls.sh b/libc/sysdeps/unix/make-syscalls.sh
index f7162e218..f04f2abb3 100644
--- a/libc/sysdeps/unix/make-syscalls.sh
+++ b/libc/sysdeps/unix/make-syscalls.sh
@@ -36,10 +36,6 @@
# W: wait status, optionally-NULL pointer to int (e.g., 2nd arg of wait4)
#
-ptr='[abBfFINpPsSWV]' # all pointer keyletters
-int='[inv]' # all scalar keyletters
-typ='[ifnNpP]' # typed-arg keyletters: we capture type for use in thunk
-
##############################################################################
thisdir=$1; shift
@@ -313,114 +309,4 @@ while read file srcfile caller syscall args strong weak; do
;;
esac
- case x"$callnum",$srcfile,$args in
- x[_-],-,* | x*,*.[sS],*V*) ;;
- x*,-,*$ptr* | x*,*.[sS],*$ptr*)
-
- nv_weak=`for name in $weak; do
- case $name in
- *@*) ;;
- *) echo $name;;
- esac; done`
-
- # choose the name with the fewest leading underscores, preferably none
- set `echo $strong $nv_weak |tr '@ \t' ' \n\n' |sort -r`
- callname=$1
-
- # convert signature string to individual numbered arg names
- # e.g., i:ipbN -> i0 i1 p2 b3 N4
- set `echo $args |
- sed -e 's/^\(.\):\(.*\)/\2 <\10>/' \
- -e 's/^\([^ ]\)\(.*\)/\2 <\11>/' \
- -e 's/^\([^ ]\)\(.*\)/\2 <\12>/' \
- -e 's/^\([^ ]\)\(.*\)/\2 <\13>/' \
- -e 's/^\([^ ]\)\(.*\)/\2 <\14>/' \
- -e 's/^\([^ ]\)\(.*\)/\2 <\15>/' \
- -e 's/^\([^ ]\)\(.*\)/\2 <\16>/' \
- -e 's/^\([^ ]\)\(.*\)/\2 <\17>/' \
- -e 's/^\([^ ]\)\(.*\)/\2 <\18>/' \
- -e 's/^\([^ ]\)\(.*\)/\2 <\19>/'`
- rtn=$1; shift
- args=$*
- arglist=`echo $* |sed 's/ /, /g'`
-
- # The best way to understand what's going on here is to examine
- # the output in BUILDDIR/sysd-syscalls.
-
- # generate makefile envelope & rule head
- echo "ifeq (,\$(filter $file,\$(bp-thunks)))"
- echo "bp-thunks += $file"
- echo "\$(objpfx)\$(bppfx)$file.ob: \$(common-objpfx)s-proto-bp.d"
-
- # generate macro head
- echo " (echo '#define $callname(`echo $arglist | \
- sed -e 's/[<>]//g'`) `echo $rtn | \
- sed -e 's/<\('$typ'0\)>/\1v;/g' \
- -e 's/<\(b0\)>/x0; extern char \1v;/g'` \\'; \\"
-
- # generate extern decls of dummy variables for each arg
- echo " echo '`echo $args | \
- sed -e 's/<\('$typ'[1-9]\)>/extern \1, \1v;/g' \
- -e 's/<\([abBFIsSV][1-9]\)>/extern char \1v;/g' \
- -e 's/<\([Wv][1-9]\)>/extern int \1v;/g'` \\'; \\"
-
- # generate bounded-pointer thunk declarator
- echo " echo '`echo $rtn | \
- sed -e 's/<\('$ptr'0\)>/__typeof (\1v) *__bounded/g' \
- -e 's/<\('$int'0\)>/__typeof (\1v)/g'` BP_SYM ($strong) (`echo $arglist | \
- sed -e 's/<\('$ptr'[1-9]\)>/__typeof (\1v) *__bounded \1a/g' \
- -e 's/<\('$int'[1-9]\)>/__typeof (\1v) \1a/g'`) { \\'; \\"
-
- # generate extern primitive syscall declaration
- echo " echo ' extern `echo $rtn | \
- sed -e 's/<\('$ptr'0\)>/__typeof (\1v) *__unbounded/g' \
- -e 's/<\('$int'0\)>/__typeof (\1v)/g'` ($callname) (`echo $arglist | \
- sed -e 's/<\('$ptr'[1-9]\)>/__typeof (\1v) *__unbounded/g' \
- -e 's/<\('$int'[1-9]\)>/__typeof (\1v)/g'`); \\'; \\"
-
- # generate call the primtive system call, optionally wrapping bounds
- # around the result if the signature's return keyletter is `b'.
- echo " echo ' return `echo $rtn |
- sed -e 's/<b0>/BOUNDED_N (/' \
- -e 's/<.0>//'`($callname) (`echo $arglist | \
- sed -e 's/<\(a[1-9]\)>/__ptrvalue (\1a)/g' \
- -e 's/<\(n[1-9]\)>, <\(V[1-9]\)>/\1a, CHECK_N_PAGES (\2a, \1a)/g' \
- -e 's/<\(b[1-9]\)>, <\(n[1-9]\)>/CHECK_N (\1a, \2a), \2a/g' \
- -e 's/<\(b[1-9]\)>, <\(N[1-9]\)>/CHECK_N (\1a, *CHECK_1 (\2a)), __ptrvalue (\2a)/g' \
- -e 's/<\(B[1-9]\)>, <\(n[1-9]\)>/CHECK_N_NULL_OK (\1a, \2a), \2a/g' \
- -e 's/<\(B[1-9]\)>, <\(N[1-9]\)>/CHECK_N_NULL_OK (\1a, *CHECK_1 (\2a)), __ptrvalue (\2a)/g' \
- -e 's/<\(f[1-9]\)>/CHECK_N (\1a, 2)/g' \
- -e 's/<\(i[1-9]\)>, <\(F[1-9]\)>/\1a, CHECK_FCNTL (\2a, \1a)/g' \
- -e 's/<\(i[1-9]\)>, <\(I[1-9]\)>/\1a, CHECK_IOCTL (\2a, \1a)/g' \
- -e 's/<\(p[1-9]\)>/CHECK_1 (\1a)/g' \
- -e 's/<\([PW][1-9]\)>/CHECK_1_NULL_OK (\1a)/g' \
- -e 's/<\(s[1-9]\)>/CHECK_STRING (\1a)/g' \
- -e 's/<\(S[1-9]\)>/CHECK_STRING_NULL_OK (\1a)/g' \
- -e 's/<\([ivn][1-9]\)>/\1a/g'`)`echo $rtn $args |
- sed -e 's/<b0>.*<\(n[1-9]\)>.*/, \1a)/' \
- -e 's/<.0>.*//'`; \\'; \\"
-
- echo " echo '} \\'; \\"
-
- echo " echo 'libc_hidden_def (BP_SYM ($strong)) \\'; \\"
-
- # generate thunk aliases
- for name in $nv_weak; do
- echo " echo 'weak_alias (BP_SYM ($strong), BP_SYM ($name)) \\'; \\"
- echo " echo 'libc_hidden_weak (BP_SYM ($name)) \\'; \\"
- done
-
- # wrap up
- echo "\
- echo ''; \\
- echo '#include <bp-thunks.h>'; \\
- ) | \$(COMPILE.c) -x c -o \$@ -"
-### Use this for debugging intermediate output:
-### ) >\$(@:.ob=.c)
-### \$(subst -c,-E,\$(COMPILE.c)) -o \$(@:.ob=.ib) \$(@:.ob=.c)
-### \$(COMPILE.c) -x cpp-output -o \$@ \$(@:.ob=.ib)"
- echo endif
- ;;
- esac
-
done
diff --git a/libc/sysdeps/unix/s-proto-bp.S b/libc/sysdeps/unix/s-proto-bp.S
deleted file mode 100644
index ba0363e16..000000000
--- a/libc/sysdeps/unix/s-proto-bp.S
+++ /dev/null
@@ -1,4 +0,0 @@
-/* This file exists just to have its dependencies determined.
- Those dependencies are then used for the bp thunk objects. */
-
-#include <bp-thunks.h>
diff --git a/libc/sysdeps/unix/sysv/linux/aio_sigqueue.c b/libc/sysdeps/unix/sysv/linux/aio_sigqueue.c
index 1cd5802d7..9af05e86a 100644
--- a/libc/sysdeps/unix/sysv/linux/aio_sigqueue.c
+++ b/libc/sysdeps/unix/sysv/linux/aio_sigqueue.c
@@ -47,8 +47,7 @@ __aio_sigqueue (sig, val, caller_pid)
info.si_uid = getuid ();
info.si_value = val;
- return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid,
- sig, __ptrvalue (&info));
+ return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, sig, &info);
}
#else
# include <rt/aio_sigqueue.c>
diff --git a/libc/sysdeps/unix/sysv/linux/dl-sysdep.c b/libc/sysdeps/unix/sysv/linux/dl-sysdep.c
index a4ca119d8..e80cb8d9f 100644
--- a/libc/sysdeps/unix/sysv/linux/dl-sysdep.c
+++ b/libc/sysdeps/unix/sysv/linux/dl-sysdep.c
@@ -43,7 +43,7 @@ int
attribute_hidden
_dl_discover_osversion (void)
{
-#if (defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO) && defined SHARED
+#if defined NEED_DL_SYSINFO_DSO && defined SHARED
if (GLRO(dl_sysinfo_map) != NULL)
{
/* If the kernel-supplied DSO contains a note indicating the kernel's
diff --git a/libc/sysdeps/unix/sysv/linux/execve.c b/libc/sysdeps/unix/sysv/linux/execve.c
index 4aae3b430..5ee5ecbe5 100644
--- a/libc/sysdeps/unix/sysv/linux/execve.c
+++ b/libc/sysdeps/unix/sysv/linux/execve.c
@@ -21,7 +21,8 @@
#include <sysdep.h>
#include <alloca.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
+
+/* Consider moving to syscalls.list. */
int
__execve (file, argv, envp)
@@ -29,34 +30,6 @@ __execve (file, argv, envp)
char *const argv[];
char *const envp[];
{
-#if __BOUNDED_POINTERS__
- {
- char *const *v;
- int i;
- char *__unbounded *__unbounded ubp_argv;
- char *__unbounded *__unbounded ubp_envp;
- char *__unbounded *__unbounded ubp_v;
-
- for (v = argv; *v; v++)
- ;
- i = v - argv + 1;
- ubp_argv = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_argv) * i);
- for (v = argv, ubp_v = ubp_argv; --i; v++, ubp_v++)
- *ubp_v = CHECK_STRING (*v);
- *ubp_v = 0;
-
- for (v = envp; *v; v++)
- ;
- i = v - envp + 1;
- ubp_envp = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_envp) * i);
- for (v = envp, ubp_v = ubp_envp; --i; v++, ubp_v++)
- *ubp_v = CHECK_STRING (*v);
- *ubp_v = 0;
-
- return INLINE_SYSCALL (execve, 3, CHECK_STRING (file), ubp_argv, ubp_envp);
- }
-#else
return INLINE_SYSCALL (execve, 3, file, argv, envp);
-#endif
}
weak_alias (__execve, execve)
diff --git a/libc/sysdeps/unix/sysv/linux/fips-private.h b/libc/sysdeps/unix/sysv/linux/fips-private.h
index ceae4891c..271dca3e5 100644
--- a/libc/sysdeps/unix/sysv/linux/fips-private.h
+++ b/libc/sysdeps/unix/sysv/linux/fips-private.h
@@ -29,7 +29,7 @@
/* Return true if FIPS mode is enabled. See
sysdeps/generic/fips-private.h for more information. */
-static inline bool
+static bool
fips_enabled_p (void)
{
static enum
diff --git a/libc/sysdeps/unix/sysv/linux/fxstat.c b/libc/sysdeps/unix/sysv/linux/fxstat.c
index d2dd10910..3623fdf1c 100644
--- a/libc/sysdeps/unix/sysv/linux/fxstat.c
+++ b/libc/sysdeps/unix/sysv/linux/fxstat.c
@@ -28,7 +28,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <xstatconv.h>
@@ -37,7 +36,7 @@ int
__fxstat (int vers, int fd, struct stat *buf)
{
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (fstat, 2, fd, CHECK_1 ((struct kernel_stat *) buf));
+ return INLINE_SYSCALL (fstat, 2, fd, (struct kernel_stat *) buf);
#ifdef STAT_IS_KERNEL_STAT
errno = EINVAL;
@@ -46,7 +45,7 @@ __fxstat (int vers, int fd, struct stat *buf)
struct kernel_stat kbuf;
int result;
- result = INLINE_SYSCALL (fstat, 2, fd, __ptrvalue (&kbuf));
+ result = INLINE_SYSCALL (fstat, 2, fd, &kbuf);
if (result == 0)
result = __xstat_conv (vers, &kbuf, buf);
diff --git a/libc/sysdeps/unix/sysv/linux/fxstat64.c b/libc/sysdeps/unix/sysv/linux/fxstat64.c
index a13beeba5..3cb1c3503 100644
--- a/libc/sysdeps/unix/sysv/linux/fxstat64.c
+++ b/libc/sysdeps/unix/sysv/linux/fxstat64.c
@@ -23,7 +23,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -33,7 +32,7 @@ int
___fxstat64 (int vers, int fd, struct stat64 *buf)
{
int result;
- result = INLINE_SYSCALL (fstat64, 2, fd, CHECK_1 (buf));
+ result = INLINE_SYSCALL (fstat64, 2, fd, buf);
#if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0
if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino)
buf->st_ino = buf->__st_ino;
diff --git a/libc/sysdeps/unix/sysv/linux/fxstatat.c b/libc/sysdeps/unix/sysv/linux/fxstatat.c
index 1cb4acfd2..b8bd8a5c1 100644
--- a/libc/sysdeps/unix/sysv/linux/fxstatat.c
+++ b/libc/sysdeps/unix/sysv/linux/fxstatat.c
@@ -29,7 +29,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
#include <xstatconv.h>
@@ -109,11 +108,11 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
if (vers == _STAT_VER_KERNEL)
{
if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
- CHECK_1 ((struct kernel_stat *) st));
+ result = INTERNAL_SYSCALL (lstat, err, 2, file,
+ (struct kernel_stat *) st);
else
- result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
- CHECK_1 ((struct kernel_stat *) st));
+ result = INTERNAL_SYSCALL (stat, err, 2, file,
+ (struct kernel_stat *) st);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return result;
@@ -126,11 +125,9 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
}
#else
if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
+ result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
else
- result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
+ result = INTERNAL_SYSCALL (stat, err, 2, file, &kst);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat_conv (vers, &kst, st);
diff --git a/libc/sysdeps/unix/sysv/linux/fxstatat64.c b/libc/sysdeps/unix/sysv/linux/fxstatat64.c
index 4837b733e..abd39ea90 100644
--- a/libc/sysdeps/unix/sysv/linux/fxstatat64.c
+++ b/libc/sysdeps/unix/sysv/linux/fxstatat64.c
@@ -25,7 +25,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -99,11 +98,9 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
}
if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat64, err, 2, CHECK_STRING (file),
- CHECK_1 (st));
+ result = INTERNAL_SYSCALL (lstat64, err, 2, file, st);
else
- result = INTERNAL_SYSCALL (stat64, err, 2, CHECK_STRING (file),
- CHECK_1 (st));
+ result = INTERNAL_SYSCALL (stat64, err, 2, file, st);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
{
# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0
diff --git a/libc/sysdeps/unix/sysv/linux/gai_sigqueue.c b/libc/sysdeps/unix/sysv/linux/gai_sigqueue.c
index 5097dc730..5c8cb4498 100644
--- a/libc/sysdeps/unix/sysv/linux/gai_sigqueue.c
+++ b/libc/sysdeps/unix/sysv/linux/gai_sigqueue.c
@@ -47,8 +47,7 @@ __gai_sigqueue (sig, val, caller_pid)
info.si_uid = __getuid ();
info.si_value = val;
- return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid,
- sig, __ptrvalue (&info));
+ return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, sig, &info);
}
#else
# include <resolv/gai_sigqueue.c>
diff --git a/libc/sysdeps/unix/sysv/linux/getcwd.c b/libc/sysdeps/unix/sysv/linux/getcwd.c
index 72fb0c96a..212b6b7a2 100644
--- a/libc/sysdeps/unix/sysv/linux/getcwd.c
+++ b/libc/sysdeps/unix/sysv/linux/getcwd.c
@@ -26,7 +26,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -78,7 +77,7 @@ __getcwd (char *buf, size_t size)
int retval;
- retval = INLINE_SYSCALL (getcwd, 2, CHECK_STRING (path), alloc_size);
+ retval = INLINE_SYSCALL (getcwd, 2, path, alloc_size);
if (retval >= 0)
{
#ifndef NO_ALLOCATION
diff --git a/libc/sysdeps/unix/sysv/linux/getdents.c b/libc/sysdeps/unix/sysv/linux/getdents.c
index eebdee8ec..2d588a602 100644
--- a/libc/sysdeps/unix/sysv/linux/getdents.c
+++ b/libc/sysdeps/unix/sysv/linux/getdents.c
@@ -28,7 +28,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <linux/posix_types.h>
@@ -109,7 +108,7 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
&& (offsetof (struct kernel_dirent, d_reclen)
== offsetof (struct dirent, d_reclen)))
{
- retval = INLINE_SYSCALL (getdents, 3, fd, CHECK_N(buf, nbytes), nbytes);
+ retval = INLINE_SYSCALL (getdents, 3, fd, buf, nbytes);
/* The kernel added the d_type value after the name. Change
this now. */
@@ -158,8 +157,7 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
- offsetof (DIRENT_TYPE, d_name);
kbuf = __alloca(kbytes);
}
- retval = INLINE_SYSCALL (getdents64, 3, fd, CHECK_N(kbuf, kbytes),
- kbytes);
+ retval = INLINE_SYSCALL (getdents64, 3, fd, kbuf, kbytes);
# ifndef __ASSUME_GETDENTS64_SYSCALL
if (retval != -1 || (errno != EINVAL && errno != ENOSYS))
# endif
@@ -255,8 +253,7 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
skdp = kdp = __alloca (red_nbytes);
- retval = INLINE_SYSCALL (getdents, 3, fd,
- CHECK_N ((char *) kdp, red_nbytes), red_nbytes);
+ retval = INLINE_SYSCALL (getdents, 3, fd, (char *) kdp, red_nbytes);
if (retval == -1)
return -1;
diff --git a/libc/sysdeps/unix/sysv/linux/i386/bp-thunks.h b/libc/sysdeps/unix/sysv/linux/i386/bp-thunks.h
deleted file mode 100644
index 59a42ddef..000000000
--- a/libc/sysdeps/unix/sysv/linux/i386/bp-thunks.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __ASSEMBLER__
-# include <sysdeps/generic/bp-thunks.h>
-# include <sys/vm86.h>
-#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/brk.c b/libc/sysdeps/unix/sysv/linux/i386/brk.c
index eea4e02b0..880542a61 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/brk.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/brk.c
@@ -20,8 +20,6 @@
#include <unistd.h>
#include <sysdep.h>
-#include <bp-checks.h>
-
/* This must be initialized data because commons can't have aliases. */
void *__curbrk = 0;
@@ -33,11 +31,10 @@ weak_alias (__curbrk, ___brk_addr)
int
__brk (void *addr)
{
- void *__unbounded newbrk;
+ void *newbrk;
INTERNAL_SYSCALL_DECL (err);
- newbrk = (void *__unbounded) INTERNAL_SYSCALL (brk, err, 1,
- __ptrvalue (addr));
+ newbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr);
__curbrk = newbrk;
diff --git a/libc/sysdeps/unix/sysv/linux/i386/chown.c b/libc/sysdeps/unix/sysv/linux/i386/chown.c
index bb6d7009c..94f294007 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/chown.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/chown.c
@@ -21,7 +21,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
#include <shlib-compat.h>
-#include <bp-checks.h>
#include <linux/posix_types.h>
@@ -45,7 +44,7 @@ extern int __real_chown (const char *__file, uid_t __owner, gid_t __group);
int
__real_chown (const char *file, uid_t owner, gid_t group)
{
- return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
+ return INLINE_SYSCALL (chown32, 3, file, owner, group);
}
diff --git a/libc/sysdeps/unix/sysv/linux/i386/clone.S b/libc/sysdeps/unix/sysv/linux/i386/clone.S
index 4df18c8be..dbd65d8da 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/clone.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/clone.S
@@ -23,20 +23,18 @@
#define _ERRNO_H 1
#include <bits/errno.h>
#include <asm-syntax.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
pid_t *ptid, struct user_desc *tls, pid_t *ctid); */
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define FUNC PARMS
#define STACK FUNC+4
-#define FLAGS STACK+PTR_SIZE
+#define FLAGS STACK+4
#define ARG FLAGS+4
-#define PTID ARG+PTR_SIZE
-#define TLS PTID+PTR_SIZE
-#define CTID TLS+PTR_SIZE
+#define PTID ARG+4
+#define TLS PTID+4
+#define CTID TLS+4
#define __NR_clone 120
#define SYS_clone 120
@@ -45,7 +43,7 @@
#define CLONE_THREAD 0x00010000
.text
-ENTRY (BP_SYM (__clone))
+ENTRY (__clone)
/* Sanity check arguments. */
movl $-EINVAL,%eax
movl FUNC(%esp),%ecx /* no NULL function pointers */
@@ -156,6 +154,6 @@ L(nomoregetpid):
cfi_endproc;
cfi_startproc
-PSEUDO_END (BP_SYM (__clone))
+PSEUDO_END (__clone)
-weak_alias (BP_SYM (__clone), BP_SYM (clone))
+weak_alias (__clone, clone)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/fchownat.c b/libc/sysdeps/unix/sysv/linux/i386/fchownat.c
index 8dab70022..4a8288b37 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/fchownat.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/fchownat.c
@@ -24,7 +24,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
#include <shlib-compat.h>
-#include <bp-checks.h>
#include <linux/posix_types.h>
#include <kernel-features.h>
@@ -86,11 +85,9 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
INTERNAL_SYSCALL_DECL (err);
if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lchown32, err, 3, CHECK_STRING (file), owner,
- group);
+ result = INTERNAL_SYSCALL (lchown32, err, 3, file, owner, group);
else
- result = INTERNAL_SYSCALL (chown32, err, 3, CHECK_STRING (file), owner,
- group);
+ result = INTERNAL_SYSCALL (chown32, err, 3, file, owner, group);
if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
{
diff --git a/libc/sysdeps/unix/sysv/linux/i386/fxstat.c b/libc/sysdeps/unix/sysv/linux/i386/fxstat.c
index 0ab94f53d..4f34a4cef 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/fxstat.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/fxstat.c
@@ -27,7 +27,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -40,12 +39,12 @@ __fxstat (int vers, int fd, struct stat *buf)
int result;
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (fstat, 2, fd, CHECK_1 ((struct kernel_stat *) buf));
+ return INLINE_SYSCALL (fstat, 2, fd, (struct kernel_stat *) buf);
{
struct stat64 buf64;
- result = INLINE_SYSCALL (fstat64, 2, fd, __ptrvalue (&buf64));
+ result = INLINE_SYSCALL (fstat64, 2, fd, &buf64);
if (result == 0)
result = __xstat32_conv (vers, &buf64, buf);
return result;
diff --git a/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c b/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c
index 866a6bc55..7ecbbe089 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c
@@ -29,7 +29,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -102,20 +101,18 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
if (vers == _STAT_VER_KERNEL)
{
if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
- CHECK_1 ((struct kernel_stat *) st));
+ result = INTERNAL_SYSCALL (lstat, err, 2, file,
+ (struct kernel_stat *) st);
else
- result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
- CHECK_1 ((struct kernel_stat *) st));
+ result = INTERNAL_SYSCALL (stat, err, 2, file,
+ (struct kernel_stat *) st);
goto out;
}
if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat64, err, 2, CHECK_STRING (file),
- __ptrvalue (&st64));
+ result = INTERNAL_SYSCALL (lstat64, err, 2, file, &st64);
else
- result = INTERNAL_SYSCALL (stat64, err, 2, CHECK_STRING (file),
- __ptrvalue (&st64));
+ result = INTERNAL_SYSCALL (stat64, err, 2, file, &st64);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat32_conv (vers, &st64, st);
diff --git a/libc/sysdeps/unix/sysv/linux/i386/getgroups.c b/libc/sysdeps/unix/sysv/linux/i386/getgroups.c
index c7e44fd03..7d85f8f39 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getgroups.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/getgroups.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <linux/posix_types.h>
@@ -34,7 +33,7 @@
int
__getgroups (int n, gid_t *groups)
{
- return INLINE_SYSCALL (getgroups32, 2, n, CHECK_N (groups, n));
+ return INLINE_SYSCALL (getgroups32, 2, n, groups);
}
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 e0b6999dd..bdc3b82b6 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getresgid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/getresgid.c
@@ -23,15 +23,13 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Consider moving to syscalls.list. */
int
__getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid)
{
- return INLINE_SYSCALL (getresgid32, 3, CHECK_1 (rgid),
- CHECK_1 (egid), CHECK_1 (sgid));
+ return INLINE_SYSCALL (getresgid32, 3, rgid, egid, sgid);
}
libc_hidden_def (__getresgid)
weak_alias (__getresgid, getresgid)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/getresuid.c b/libc/sysdeps/unix/sysv/linux/i386/getresuid.c
index 5a06ad68d..49b330284 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/getresuid.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/getresuid.c
@@ -23,15 +23,13 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Consider moving to syscalls.list. */
int
__getresuid (uid_t *ruid, uid_t *euid, uid_t *suid)
{
- return INLINE_SYSCALL (getresuid32, 3, CHECK_1 (ruid),
- CHECK_1 (euid), CHECK_1 (suid));
+ return INLINE_SYSCALL (getresuid32, 3, ruid, euid, suid);
}
libc_hidden_def (__getresuid)
weak_alias (__getresuid, getresuid)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/lchown.c b/libc/sysdeps/unix/sysv/linux/i386/lchown.c
index 9357df4b4..0b7073c14 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/lchown.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/lchown.c
@@ -20,7 +20,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <linux/posix_types.h>
@@ -29,7 +28,7 @@
int
__lchown (const char *file, uid_t owner, gid_t group)
{
- return INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group);
+ return INLINE_SYSCALL (lchown32, 3, file, owner, group);
}
weak_alias (__lchown, lchown)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/lxstat.c b/libc/sysdeps/unix/sysv/linux/i386/lxstat.c
index a3d42d49f..8e595b1b5 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/lxstat.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/lxstat.c
@@ -27,7 +27,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -41,12 +40,12 @@ __lxstat (int vers, const char *name, struct stat *buf)
int result;
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), CHECK_1 ((struct kernel_stat *) buf));
+ return INLINE_SYSCALL (lstat, 2, name, (struct kernel_stat *) buf);
{
struct stat64 buf64;
- result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), __ptrvalue (&buf64));
+ result = INLINE_SYSCALL (lstat64, 2, name, &buf64);
if (result == 0)
result = __xstat32_conv (vers, &buf64, buf);
return result;
diff --git a/libc/sysdeps/unix/sysv/linux/i386/mmap64.S b/libc/sysdeps/unix/sysv/linux/i386/mmap64.S
index 4f9c7856f..31a0f6782 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/mmap64.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/mmap64.S
@@ -16,8 +16,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
#include <kernel-features.h>
@@ -25,9 +23,9 @@
#define ENOSYS 38
#define SVRSP 16 /* saved register space */
-#define PARMS LINKAGE+SVRSP /* space for 4 saved regs */
+#define PARMS 4+SVRSP /* space for 4 saved regs */
#define ADDR PARMS
-#define LEN ADDR+PTR_SIZE
+#define LEN ADDR+4
#define PROT LEN+4
#define FLAGS PROT+4
#define FD FLAGS+4
@@ -35,7 +33,7 @@
#define OFFHI OFFLO+4
.text
-ENTRY (BP_SYM (__mmap64))
+ENTRY (__mmap64)
/* Save registers. */
pushl %ebp
@@ -115,6 +113,6 @@ L(einval):
movl $-EINVAL, %eax
jmp SYSCALL_ERROR_LABEL
-PSEUDO_END (BP_SYM (__mmap64))
+PSEUDO_END (__mmap64)
-weak_alias (BP_SYM (__mmap64), BP_SYM (mmap64))
+weak_alias (__mmap64, mmap64)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/msgctl.c b/libc/sysdeps/unix/sysv/linux/i386/msgctl.c
index 37cfcb6fc..e0af4e3e9 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/msgctl.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/msgctl.c
@@ -23,20 +23,19 @@
#include <sysdep.h>
#include <string.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <shlib-compat.h>
struct __old_msqid_ds
{
struct __old_ipc_perm msg_perm; /* structure describing operation permission */
- struct msg *__unbounded __msg_first; /* pointer to first message on queue */
- struct msg *__unbounded __msg_last; /* pointer to last message on queue */
+ struct msg *__msg_first; /* pointer to first message on queue */
+ struct msg *__msg_last; /* pointer to last message on queue */
__time_t msg_stime; /* time of last msgsnd command */
__time_t msg_rtime; /* time of last msgrcv command */
__time_t msg_ctime; /* time of last change */
- struct wait_queue *__unbounded __wwait; /* ??? */
- struct wait_queue *__unbounded __rwait; /* ??? */
+ struct wait_queue *__wwait; /* ??? */
+ struct wait_queue *__rwait; /* ??? */
unsigned short int __msg_cbytes; /* current number of bytes on queue */
unsigned short int msg_qnum; /* number of messages currently on queue */
unsigned short int msg_qbytes; /* max number of bytes allowed on queue */
@@ -56,8 +55,7 @@ int
attribute_compat_text_section
__old_msgctl (int msqid, int cmd, struct __old_msqid_ds *buf)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
- msqid, cmd, 0, CHECK_1 (buf));
+ return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl, msqid, cmd, 0, buf);
}
compat_symbol (libc, __old_msgctl, msgctl, GLIBC_2_0);
#endif
@@ -66,7 +64,7 @@ int
__new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
{
return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
- msqid, cmd | __IPC_64, 0, CHECK_1 (buf));
+ msqid, cmd | __IPC_64, 0, buf);
}
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 67d592959..3cb314ddf 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
@@ -1819,6 +1819,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S b/libc/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S
index 5f9de9d80..6c42c610f 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S
@@ -16,15 +16,13 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
#define EINVAL 22
#define ENOSYS 38
#define EOVERFLOW 75
#define SVRSP 16 /* saved register space */
-#define PARMS LINKAGE+SVRSP /* space for 4 saved regs */
+#define PARMS 4+SVRSP /* space for 4 saved regs */
#define FD PARMS
#define OFFLO FD+4
#define OFFHI OFFLO+4
@@ -33,7 +31,7 @@
#define FLAGS LENHI+4
.text
-ENTRY (BP_SYM (__posix_fadvise64_l64))
+ENTRY (__posix_fadvise64_l64)
/* Save registers. */
pushl %ebp
@@ -81,7 +79,7 @@ ENTRY (BP_SYM (__posix_fadvise64_l64))
/* Successful; return the syscall's value. */
ret
-END (BP_SYM (__posix_fadvise64_l64))
+END (__posix_fadvise64_l64)
.section .text.compat, "ax"
ENTRY (__posix_fadvise64_l32)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/semctl.c b/libc/sysdeps/unix/sysv/linux/i386/semctl.c
index f3299eace..67e75a1c7 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/semctl.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/semctl.c
@@ -49,9 +49,6 @@ union semun
struct __old_semid_ds *__old_buf;
};
-#include <bp-checks.h>
-#include <bp-semctl.h> /* definition of CHECK_SEMCTL needs union semum */
-
/* Return identifier for array of NSEMS semaphores associated with
KEY. */
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
@@ -75,7 +72,7 @@ __old_semctl (int semid, int semnum, int cmd, ...)
va_end (ap);
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd));
+ &arg);
}
compat_symbol (libc, __old_semctl, semctl, GLIBC_2_0);
#endif
@@ -94,7 +91,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
va_end (ap);
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
- CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
+ &arg);
}
versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2);
diff --git a/libc/sysdeps/unix/sysv/linux/i386/semtimedop.S b/libc/sysdeps/unix/sysv/linux/i386/semtimedop.S
index 01250f65e..35eb4a872 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/semtimedop.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/semtimedop.S
@@ -21,14 +21,14 @@
#define SYSOP_semtimedop 4
#define SVRSP 12 /* saved register space */
-#define PARMS LINKAGE+SVRSP /* space for 3 saved regs */
+#define PARMS 4+SVRSP /* space for 3 saved regs */
#define SEMID PARMS
#define SOPS SEMID+4
-#define NSOPS SOPS+PTR_SIZE
+#define NSOPS SOPS+4
#define TIMEOUT NSOPS+4
.text
-ENTRY (BP_SYM (semtimedop))
+ENTRY (semtimedop)
pushl %ebp
cfi_adjust_cfa_offset (4)
@@ -70,4 +70,4 @@ ENTRY (BP_SYM (semtimedop))
#ifdef PIC
.align 4
#endif
-PSEUDO_END (BP_SYM (semtimedop))
+PSEUDO_END (semtimedop)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setgroups.c b/libc/sysdeps/unix/sysv/linux/i386/setgroups.c
index c0895a19b..701ce6ee7 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setgroups.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setgroups.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <setxid.h>
#include <linux/posix_types.h>
@@ -33,6 +32,6 @@
int
setgroups (size_t n, const gid_t *groups)
{
- return INLINE_SETXID_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
+ return INLINE_SETXID_SYSCALL (setgroups32, 2, n, groups);
}
libc_hidden_def (setgroups)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/setrlimit.c b/libc/sysdeps/unix/sysv/linux/i386/setrlimit.c
index cc1184710..0fe31e19d 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/setrlimit.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/setrlimit.c
@@ -22,17 +22,16 @@
#include <sysdep.h>
#include <sys/syscall.h>
#include <shlib-compat.h>
-#include <bp-checks.h>
extern int __new_setrlimit (enum __rlimit_resource resource,
- const struct rlimit *__unboundedrlimits);
+ const struct rlimit *rlimits);
/* Consider moving to syscalls.list. */
int
__new_setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits)
{
- return INLINE_SYSCALL (setrlimit, 2, resource, CHECK_1 (rlimits));
+ return INLINE_SYSCALL (setrlimit, 2, resource, rlimits);
}
weak_alias (__new_setrlimit, __setrlimit);
diff --git a/libc/sysdeps/unix/sysv/linux/i386/shmctl.c b/libc/sysdeps/unix/sysv/linux/i386/shmctl.c
index 15f055d84..8459dff32 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/shmctl.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/shmctl.c
@@ -24,7 +24,6 @@
#include <string.h>
#include <sys/syscall.h>
#include <bits/wordsize.h>
-#include <bp-checks.h>
#include <shlib-compat.h>
@@ -39,8 +38,8 @@ struct __old_shmid_ds
__ipc_pid_t shm_lpid; /* pid of last shmop */
unsigned short int shm_nattch; /* number of current attaches */
unsigned short int __shm_npages; /* size of segment (pages) */
- unsigned long int *__unbounded __shm_pages; /* array of ptrs to frames -> SHMMAX */
- struct vm_area_struct *__unbounded __attaches; /* descriptors for attaches */
+ unsigned long int *__shm_pages; /* array of ptrs to frames -> SHMMAX */
+ struct vm_area_struct *__attaches; /* descriptors for attaches */
};
struct __old_shminfo
@@ -63,8 +62,7 @@ int
attribute_compat_text_section
__old_shmctl (int shmid, int cmd, struct __old_shmid_ds *buf)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
- shmid, cmd, 0, CHECK_1 (buf));
+ return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, buf);
}
compat_symbol (libc, __old_shmctl, shmctl, GLIBC_2_0);
#endif
@@ -73,7 +71,7 @@ int
__new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
{
return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
- shmid, cmd | __IPC_64, 0, CHECK_1 (buf));
+ shmid, cmd | __IPC_64, 0, buf);
}
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 6b70b1541..d2bac9122 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/sigaction.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/sigaction.c
@@ -72,8 +72,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
/* 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);
+ sig, act ? &kact : NULL,
+ oact ? &koact : NULL, _NSIG / 8);
if (oact && result >= 0)
{
diff --git a/libc/sysdeps/unix/sysv/linux/i386/sysdep.h b/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
index 071da7140..684fe27d6 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -21,8 +21,6 @@
/* There is some commonality. */
#include <sysdeps/unix/i386/sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */
#include <dl-sysdep.h>
#include <tls.h>
diff --git a/libc/sysdeps/unix/sysv/linux/i386/xstat.c b/libc/sysdeps/unix/sysv/linux/i386/xstat.c
index 4e7354aaa..e2abe8bb9 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/xstat.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/xstat.c
@@ -27,7 +27,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -41,12 +40,12 @@ __xstat (int vers, const char *name, struct stat *buf)
int result;
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (stat, 2, CHECK_STRING (name), CHECK_1 ((struct kernel_stat *) buf));
+ return INLINE_SYSCALL (stat, 2, name, (struct kernel_stat *) buf);
{
struct stat64 buf64;
- result = INLINE_SYSCALL (stat64, 2, CHECK_STRING (name), __ptrvalue (&buf64));
+ result = INLINE_SYSCALL (stat64, 2, name, &buf64);
if (result == 0)
result = __xstat32_conv (vers, &buf64, buf);
return result;
diff --git a/libc/sysdeps/unix/sysv/linux/kernel-features.h b/libc/sysdeps/unix/sysv/linux/kernel-features.h
index 21eef4372..8fdff7e38 100644
--- a/libc/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/libc/sysdeps/unix/sysv/linux/kernel-features.h
@@ -187,6 +187,11 @@
# define __ASSUME_PWRITEV 1
#endif
+/* Support for FUTEX_*_REQUEUE_PI was added in 2.6.31. */
+#if __LINUX_KERNEL_VERSION >= 0x02061f
+# define __ASSUME_REQUEUE_PI 1
+#endif
+
/* Support for F_GETOWN_EX was introduced in 2.6.32. */
#if __LINUX_KERNEL_VERSION >= 0x020620
# define __ASSUME_F_GETOWN_EX 1
diff --git a/libc/sysdeps/unix/sysv/linux/llseek.c b/libc/sysdeps/unix/sysv/linux/llseek.c
index 4580b872f..a15be3024 100644
--- a/libc/sysdeps/unix/sysv/linux/llseek.c
+++ b/libc/sysdeps/unix/sysv/linux/llseek.c
@@ -32,7 +32,7 @@ __llseek (int fd, loff_t offset, int whence)
return (loff_t) (INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32),
(off_t) (offset & 0xffffffff),
- __ptrvalue (&retval), whence) ?: retval);
+ &retval, whence) ?: retval);
}
weak_alias (__llseek, llseek)
strong_alias (__llseek, __libc_lseek64)
diff --git a/libc/sysdeps/unix/sysv/linux/lxstat.c b/libc/sysdeps/unix/sysv/linux/lxstat.c
index 7abd2b45a..3a838918e 100644
--- a/libc/sysdeps/unix/sysv/linux/lxstat.c
+++ b/libc/sysdeps/unix/sysv/linux/lxstat.c
@@ -27,7 +27,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <xstatconv.h>
@@ -36,8 +35,7 @@ int
__lxstat (int vers, const char *name, struct stat *buf)
{
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (lstat, 2, CHECK_STRING (name),
- CHECK_1 ((struct kernel_stat *) buf));
+ return INLINE_SYSCALL (lstat, 2, name, (struct kernel_stat *) buf);
#ifdef STAT_IS_KERNEL_STAT
errno = EINVAL;
@@ -46,7 +44,7 @@ __lxstat (int vers, const char *name, struct stat *buf)
struct kernel_stat kbuf;
int result;
- result = INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), __ptrvalue (&kbuf));
+ result = INLINE_SYSCALL (lstat, 2, name, &kbuf);
if (result == 0)
result = __xstat_conv (vers, &kbuf, buf);
diff --git a/libc/sysdeps/unix/sysv/linux/lxstat64.c b/libc/sysdeps/unix/sysv/linux/lxstat64.c
index 12ab8202b..de889966f 100644
--- a/libc/sysdeps/unix/sysv/linux/lxstat64.c
+++ b/libc/sysdeps/unix/sysv/linux/lxstat64.c
@@ -23,7 +23,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -32,7 +31,7 @@ int
___lxstat64 (int vers, const char *name, struct stat64 *buf)
{
int result;
- result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), CHECK_1 (buf));
+ result = INLINE_SYSCALL (lstat64, 2, name, buf);
#if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0
if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino)
buf->st_ino = buf->__st_ino;
diff --git a/libc/sysdeps/unix/sysv/linux/mmap64.c b/libc/sysdeps/unix/sysv/linux/mmap64.c
index 7d94c1db9..175e4abba 100644
--- a/libc/sysdeps/unix/sysv/linux/mmap64.c
+++ b/libc/sysdeps/unix/sysv/linux/mmap64.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -54,14 +53,10 @@ __mmap64 (void *addr, size_t len, int prot, int flags, int fd, off64_t offset)
return MAP_FAILED;
}
void *result;
- __ptrvalue (result) = (void *__unbounded)
- INLINE_SYSCALL (mmap2, 6, __ptrvalue (addr),
+ result = (void *)
+ INLINE_SYSCALL (mmap2, 6, addr,
len, prot, flags, fd,
(off_t) (offset >> MMAP2_PAGE_SHIFT));
-#if __BOUNDED_POINTERS__
- __ptrlow (result) = __ptrvalue (result);
- __ptrhigh (result) = __ptrvalue (result) + len;
-#endif
return result;
}
weak_alias (__mmap64, mmap64)
diff --git a/libc/sysdeps/unix/sysv/linux/msgctl.c b/libc/sysdeps/unix/sysv/linux/msgctl.c
index 4dc6b0887..0bbaf086c 100644
--- a/libc/sysdeps/unix/sysv/linux/msgctl.c
+++ b/libc/sysdeps/unix/sysv/linux/msgctl.c
@@ -24,20 +24,19 @@
#include <string.h>
#include <sys/syscall.h>
#include <shlib-compat.h>
-#include <bp-checks.h>
#include <kernel-features.h>
struct __old_msqid_ds
{
struct __old_ipc_perm msg_perm; /* structure describing operation permission */
- struct msg *__unbounded __msg_first; /* pointer to first message on queue */
- struct msg *__unbounded __msg_last; /* pointer to last message on queue */
+ struct msg *__msg_first; /* pointer to first message on queue */
+ struct msg *__msg_last; /* pointer to last message on queue */
__time_t msg_stime; /* time of last msgsnd command */
__time_t msg_rtime; /* time of last msgrcv command */
__time_t msg_ctime; /* time of last change */
- struct wait_queue *__unbounded __wwait; /* ??? */
- struct wait_queue *__unbounded __rwait; /* ??? */
+ struct wait_queue *__wwait; /* ??? */
+ struct wait_queue *__rwait; /* ??? */
unsigned short int __msg_cbytes; /* current number of bytes on queue */
unsigned short int msg_qnum; /* number of messages currently on queue */
unsigned short int msg_qbytes; /* max number of bytes allowed on queue */
@@ -57,7 +56,7 @@ int
attribute_compat_text_section
__old_msgctl (int msqid, int cmd, struct __old_msqid_ds *buf)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl, msqid, cmd, 0, CHECK_1 (buf));
+ return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl, msqid, cmd, 0, buf);
}
compat_symbol (libc, __old_msgctl, msgctl, GLIBC_2_0);
#endif
@@ -67,7 +66,7 @@ __new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
{
#if __ASSUME_IPC64 > 0
return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
- msqid, cmd | __IPC_64, 0, CHECK_1 (buf));
+ msqid, cmd | __IPC_64, 0, buf);
#else
switch (cmd) {
case MSG_STAT:
@@ -76,7 +75,7 @@ __new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
break;
default:
return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
- msqid, cmd, 0, CHECK_1 (buf));
+ msqid, cmd, 0, buf);
}
{
@@ -86,7 +85,7 @@ __new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
/* Unfortunately there is no way how to find out for sure whether
we should use old or new msgctl. */
result = INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
- msqid, cmd | __IPC_64, 0, CHECK_1 (buf));
+ msqid, cmd | __IPC_64, 0, buf);
if (result != -1 || errno != EINVAL)
return result;
@@ -104,8 +103,7 @@ __new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
return -1;
}
}
- result = INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
- msqid, cmd, 0, __ptrvalue (&old));
+ result = INLINE_SYSCALL (ipc, 5, IPCOP_msgctl, msqid, cmd, 0, &old);
if (result != -1 && cmd != IPC_SET)
{
memset(buf, 0, sizeof(*buf));
diff --git a/libc/sysdeps/unix/sysv/linux/msgrcv.c b/libc/sysdeps/unix/sysv/linux/msgrcv.c
index f9b399ebd..7ec9b253b 100644
--- a/libc/sysdeps/unix/sysv/linux/msgrcv.c
+++ b/libc/sysdeps/unix/sysv/linux/msgrcv.c
@@ -23,13 +23,11 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
-
/* Kludge to work around Linux' restriction of only up to five
arguments to a system call. */
struct ipc_kludge
{
- void *__unbounded msgp;
+ void *msgp;
long int msgtyp;
};
@@ -46,17 +44,16 @@ __libc_msgrcv (msqid, msgp, msgsz, msgtyp, msgflg)
fives parameters to a system call. */
struct ipc_kludge tmp;
- tmp.msgp = CHECK_N (msgp, msgsz);
+ tmp.msgp = msgp;
tmp.msgtyp = msgtyp;
if (SINGLE_THREAD_P)
- return INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg,
- __ptrvalue (&tmp));
+ return INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg, &tmp);
int oldtype = LIBC_CANCEL_ASYNC ();
ssize_t result = INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg,
- __ptrvalue (&tmp));
+ &tmp);
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/sysdeps/unix/sysv/linux/msgsnd.c b/libc/sysdeps/unix/sysv/linux/msgsnd.c
index 853ea9174..556159b32 100644
--- a/libc/sysdeps/unix/sysv/linux/msgsnd.c
+++ b/libc/sysdeps/unix/sysv/linux/msgsnd.c
@@ -23,8 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
-
int
__libc_msgsnd (msqid, msgp, msgsz, msgflg)
int msqid;
@@ -34,12 +32,12 @@ __libc_msgsnd (msqid, msgp, msgsz, msgflg)
{
if (SINGLE_THREAD_P)
return INLINE_SYSCALL (ipc, 5, IPCOP_msgsnd, msqid, msgsz,
- msgflg, (void *) CHECK_N (msgp, msgsz));
+ msgflg, (void *) msgp);
int oldtype = LIBC_CANCEL_ASYNC ();
int result = INLINE_SYSCALL (ipc, 5, IPCOP_msgsnd, msqid, msgsz,
- msgflg, (void *) CHECK_N (msgp, msgsz));
+ msgflg, (void *) msgp);
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
index 36512a0fc..f60748507 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
@@ -16,7 +16,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-checks.h>
#include <stddef.h>
#include <sys/time.h>
#include <time.h>
@@ -33,7 +32,7 @@ __gettimeofday (tv, tz)
struct timeval *tv;
struct timezone *tz;
{
- return INLINE_VSYSCALL (gettimeofday, 2, CHECK_1 (tv), CHECK_1 (tz));
+ return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
}
libc_hidden_def (__gettimeofday)
weak_alias (__gettimeofday, gettimeofday)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c b/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c
index c1794227b..ba3dc5a18 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c
@@ -19,8 +19,6 @@
#include <unistd.h>
#include <ldsodefs.h>
#include <sysdep.h>
-#include <bp-start.h>
-#include <bp-sym.h>
int __cache_line_size attribute_hidden;
@@ -34,43 +32,35 @@ int __cache_line_size attribute_hidden;
struct startup_info
{
- void *__unbounded sda_base;
+ void *sda_base;
int (*main) (int, char **, char **, void *);
int (*init) (int, char **, char **, void *);
void (*fini) (void);
};
int
-/* GKM FIXME: GCC: this should get __BP_ prefix by virtue of the
- BPs in the arglist of startup_info.main and startup_info.init. */
- BP_SYM (__libc_start_main) (int argc, char *__unbounded *__unbounded ubp_av,
- char *__unbounded *__unbounded ubp_ev,
- ElfW (auxv_t) * __unbounded auxvec,
- void (*rtld_fini) (void),
- struct startup_info *__unbounded stinfo,
- char *__unbounded *__unbounded stack_on_entry)
+__libc_start_main (int argc, char **argv,
+ char **ev,
+ ElfW (auxv_t) * auxvec,
+ void (*rtld_fini) (void),
+ struct startup_info *stinfo,
+ char **stack_on_entry)
{
-#if __BOUNDED_POINTERS__
- char **argv;
-#else
-# define argv ubp_av
-#endif
-
/* the PPC SVR4 ABI says that the top thing on the stack will
be a NULL pointer, so if not we assume that we're being called
as a statically-linked program by Linux... */
if (*stack_on_entry != NULL)
{
- char *__unbounded * __unbounded temp;
+ char **temp;
/* ...in which case, we have argc as the top thing on the
stack, followed by argv (NULL-terminated), envp (likewise),
and the auxilary vector. */
/* 32/64-bit agnostic load from stack */
- argc = *(long int *__unbounded) stack_on_entry;
- ubp_av = stack_on_entry + 1;
- ubp_ev = ubp_av + argc + 1;
+ argc = *(long int *) stack_on_entry;
+ argv = stack_on_entry + 1;
+ ev = argv + argc + 1;
#ifdef HAVE_AUX_VECTOR
- temp = ubp_ev;
+ temp = ev;
while (*temp != NULL)
++temp;
auxvec = (ElfW (auxv_t) *)++ temp;
@@ -100,7 +90,7 @@ int
break;
}
- return generic_start_main (stinfo->main, argc, ubp_av, auxvec,
+ return generic_start_main (stinfo->main, argc, argv, auxvec,
stinfo->init, stinfo->fini, rtld_fini,
stack_on_entry);
}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S
index 2fc9fa237..eb27f42cd 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S
@@ -19,13 +19,10 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
.comm __curbrk,4,4
.section ".text"
-ENTRY (BP_SYM (__brk))
- DISCARD_BOUNDS (r3) /* the bounds are meaningless, so toss 'em */
+ENTRY (__brk)
mflr r0
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
@@ -50,6 +47,6 @@ ENTRY (BP_SYM (__brk))
blelr+
li r3,ENOMEM
b __syscall_error@local
-END (BP_SYM (__brk))
+END (__brk)
-weak_alias (BP_SYM (__brk), BP_SYM (brk))
+weak_alias (__brk, brk)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
index 197b85203..5790eff4c 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
@@ -20,8 +20,6 @@
#define _ERRNO_H 1
#include <bits/errno.h>
#include <kernel-features.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
#define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000
@@ -35,10 +33,7 @@
int flags [r5], void *arg [r6], void *parent_tid [r7],
void *tls [r8], void *child_tid [r9]); */
-ENTRY (BP_SYM (__clone))
- /* GKM FIXME: add bounds checks, where sensible. */
- DISCARD_BOUNDS (r4)
- DISCARD_BOUNDS (r6)
+ENTRY (__clone)
/* Check for child_stack == NULL || fn == NULL. */
cmpwi cr0,r4,0
@@ -124,6 +119,6 @@ L(badargs):
b __syscall_error@local
cfi_startproc
-END (BP_SYM (__clone))
+END (__clone)
-weak_alias (BP_SYM (__clone), BP_SYM (clone))
+weak_alias (__clone, clone)
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 8e4595825..f27b48b3c 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
@@ -1781,6 +1781,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
index 3695d8fb9..619db3261 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -38,7 +37,7 @@ __libc_pread (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
/* On PPC32 64bit values are aligned in odd/even register pairs. */
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count,
0, offset >> 31, offset);
return result;
@@ -47,7 +46,7 @@ __libc_pread (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
/* On PPC32 64bit values are aligned in odd/even register pairs. */
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count,
0, offset >> 31, offset);
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
index 12e83aa95..75407b316 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
@@ -21,7 +21,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -38,7 +37,7 @@ __libc_pread64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
/* On PPC32 64bit values are aligned in odd/even register pairs. */
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count,
0, (long) (offset >> 32),
(long) offset);
@@ -48,7 +47,7 @@ __libc_pread64 (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
/* On PPC32 64bit values are aligned in odd/even register pairs. */
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count,
0, (long) (offset >> 32),
(long) offset);
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
index 005e24f96..e71c91b26 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -39,7 +38,7 @@ __libc_pwrite (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
/* On PPC32 64bit values are aligned in odd/even register pairs. */
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count,
0, offset >> 31, offset);
return result;
@@ -48,7 +47,7 @@ __libc_pwrite (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
/* On PPC32 64bit values are aligned in odd/even register pairs. */
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count,
0, offset >> 31, offset);
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
index f001c6e97..7094e93d3 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
@@ -21,7 +21,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -38,7 +37,7 @@ __libc_pwrite64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
/* On PPC32 64bit values are aligned in odd/even register pairs. */
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count,
0, (long) (offset >> 32),
(long) offset);
@@ -48,7 +47,7 @@ __libc_pwrite64 (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
/* On PPC32 64bit values are aligned in odd/even register pairs. */
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count,
0, (long) (offset >> 32),
(long) offset);
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
index 3146dde71..c018cecdb 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
@@ -21,7 +21,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Truncate the file referenced by FD to LENGTH bytes. */
int
@@ -30,7 +29,7 @@ truncate64 (path, length)
off64_t length;
{
/* On PPC32 64bit values are aligned in odd/even register pairs. */
- int result = INLINE_SYSCALL (truncate64, 4, CHECK_STRING (path), 0,
+ int result = INLINE_SYSCALL (truncate64, 4, path, 0,
(long) (length >> 32),
(long) length);
return result;
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 8eaaccdfc..195b58757 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
@@ -87,6 +87,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.3
GLIBC_2.3 A
_Exit F
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c
index 896a415d8..70f1d6c58 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -40,16 +39,14 @@ __libc_pread (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
index aaf18e5da..a11f6e31f 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
@@ -21,7 +21,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -39,16 +38,14 @@ __libc_pread64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c
index 9795756f2..0ccb0a98a 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -40,16 +39,14 @@ __libc_pwrite (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
index 65ddefd3c..6a8acb451 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
@@ -21,7 +21,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -39,16 +38,14 @@ __libc_pwrite64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/sysdeps/unix/sysv/linux/pread.c b/libc/sysdeps/unix/sysv/linux/pread.c
index aa3ee6379..1494879ab 100644
--- a/libc/sysdeps/unix/sysv/linux/pread.c
+++ b/libc/sysdeps/unix/sysv/linux/pread.c
@@ -23,7 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -44,7 +43,7 @@ do_pread (int fd, void *buf, size_t count, off_t offset)
ssize_t result;
assert (sizeof (offset) == 4);
- result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pread, 5, fd, buf, count,
__LONG_LONG_PAIR (offset >> 31, offset));
return result;
diff --git a/libc/sysdeps/unix/sysv/linux/pread64.c b/libc/sysdeps/unix/sysv/linux/pread64.c
index 36cb66b8b..be829ce3f 100644
--- a/libc/sysdeps/unix/sysv/linux/pread64.c
+++ b/libc/sysdeps/unix/sysv/linux/pread64.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -39,7 +38,7 @@ do_pread64 (int fd, void *buf, size_t count, off64_t offset)
{
ssize_t result;
- result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pread, 5, fd, buf, count,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
diff --git a/libc/sysdeps/unix/sysv/linux/ptrace.c b/libc/sysdeps/unix/sysv/linux/ptrace.c
index 926dfbd9e..3a6ca6c0e 100644
--- a/libc/sysdeps/unix/sysv/linux/ptrace.c
+++ b/libc/sysdeps/unix/sysv/linux/ptrace.c
@@ -24,7 +24,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
long int
ptrace (enum __ptrace_request request, ...)
@@ -43,79 +42,7 @@ ptrace (enum __ptrace_request request, ...)
if (request > 0 && request < 4)
data = &ret;
-#if __BOUNDED_POINTERS__
- switch (request)
- {
- case PTRACE_PEEKTEXT:
- case PTRACE_PEEKDATA:
- case PTRACE_PEEKUSER:
- case PTRACE_POKETEXT:
- case PTRACE_POKEDATA:
- case PTRACE_POKEUSER:
- (void) CHECK_1 ((int *) addr);
- (void) CHECK_1 ((int *) data);
- break;
-
- case PTRACE_GETREGS:
- case PTRACE_SETREGS:
-#ifdef __i386__
- (void) CHECK_1 ((struct user_regs_struct *) data);
-#else
- /* We don't know the size of data, so the best we can do is ensure
- that `data' is valid for at least one word. */
- (void) CHECK_1 ((int *) data);
-#endif
- break;
-
- case PTRACE_GETFPREGS:
- case PTRACE_SETFPREGS:
-#ifdef __i386__
- (void) CHECK_1 ((struct user_fpregs_struct *) data);
-#else
- /* We don't know the size of data, so the best we can do is ensure
- that `data' is valid for at least one word. */
- (void) CHECK_1 ((int *) data);
-#endif
- break;
-
- case PTRACE_GETFPXREGS:
- case PTRACE_SETFPXREGS:
-#ifdef __i386__
- (void) CHECK_1 ((struct user_fpxregs_struct *) data);
-#else
- /* We don't know the size of data, so the best we can do is ensure
- that `data' is valid for at least one word. */
- (void) CHECK_1 ((int *) data);
-#endif
- break;
-
- case PTRACE_GETSIGINFO:
- case PTRACE_SETSIGINFO:
- (void) CHECK_1 ((siginfo_t *) data);
- break;
-
- case PTRACE_GETEVENTMSG:
- (void) CHECK_1 ((unsigned long *) data);
- break;
-
- case PTRACE_SETOPTIONS:
- (void) CHECK_1 ((long *) data);
- break;
-
- case PTRACE_TRACEME:
- case PTRACE_CONT:
- case PTRACE_KILL:
- case PTRACE_SINGLESTEP:
- case PTRACE_ATTACH:
- case PTRACE_DETACH:
- case PTRACE_SYSCALL:
- /* Neither `data' nor `addr' needs any checks. */
- break;
- };
-#endif
-
- res = INLINE_SYSCALL (ptrace, 4, request, pid,
- __ptrvalue (addr), __ptrvalue (data));
+ res = INLINE_SYSCALL (ptrace, 4, request, pid, addr, data);
if (res >= 0 && request > 0 && request < 4)
{
__set_errno (0);
diff --git a/libc/sysdeps/unix/sysv/linux/pwrite.c b/libc/sysdeps/unix/sysv/linux/pwrite.c
index 25147167d..5a31d17ed 100644
--- a/libc/sysdeps/unix/sysv/linux/pwrite.c
+++ b/libc/sysdeps/unix/sysv/linux/pwrite.c
@@ -23,7 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -44,7 +43,7 @@ do_pwrite (int fd, const void *buf, size_t count, off_t offset)
ssize_t result;
assert (sizeof (offset) == 4);
- result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
__LONG_LONG_PAIR (offset >> 31, offset));
return result;
diff --git a/libc/sysdeps/unix/sysv/linux/pwrite64.c b/libc/sysdeps/unix/sysv/linux/pwrite64.c
index f2a99b662..fb46e4ba5 100644
--- a/libc/sysdeps/unix/sysv/linux/pwrite64.c
+++ b/libc/sysdeps/unix/sysv/linux/pwrite64.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -39,7 +38,7 @@ do_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
{
ssize_t result;
- result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count,
+ result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
diff --git a/libc/sysdeps/unix/sysv/linux/readv.c b/libc/sysdeps/unix/sysv/linux/readv.c
index efee11d4e..8bdb97a0b 100644
--- a/libc/sysdeps/unix/sysv/linux/readv.c
+++ b/libc/sysdeps/unix/sysv/linux/readv.c
@@ -23,7 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
#ifndef __ASSUME_COMPLETE_READV_WRITEV
@@ -47,12 +46,12 @@ __libc_readv (fd, vector, count)
ssize_t result;
if (SINGLE_THREAD_P)
- result = INLINE_SYSCALL (readv, 3, fd, CHECK_N (vector, count), count);
+ result = INLINE_SYSCALL (readv, 3, fd, vector, count);
else
{
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (readv, 3, fd, CHECK_N (vector, count), count);
+ result = INLINE_SYSCALL (readv, 3, fd, vector, count);
LIBC_CANCEL_RESET (oldtype);
}
diff --git a/libc/sysdeps/unix/sysv/linux/s390/gettimeofday.c b/libc/sysdeps/unix/sysv/linux/s390/gettimeofday.c
index 54c5e1d20..22df7282a 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/gettimeofday.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/gettimeofday.c
@@ -16,7 +16,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-checks.h>
#include <stddef.h>
#include <sys/time.h>
#include <time.h>
@@ -33,7 +32,7 @@ __gettimeofday (tv, tz)
struct timeval *tv;
struct timezone *tz;
{
- return INLINE_VSYSCALL (gettimeofday, 2, CHECK_1 (tv), CHECK_1 (tz));
+ return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
}
libc_hidden_def (__gettimeofday)
weak_alias (__gettimeofday, 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 408d24aae..cd0cb743b 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c
@@ -21,7 +21,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
#include <shlib-compat.h>
-#include <bp-checks.h>
#include <linux/posix_types.h>
@@ -42,7 +41,7 @@
int
__real_chown (const char *file, uid_t owner, gid_t group)
{
- return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
+ return INLINE_SYSCALL (chown32, 3, file, owner, group);
}
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 9357df4b4..0b7073c14 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/lchown.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/lchown.c
@@ -20,7 +20,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <linux/posix_types.h>
@@ -29,7 +28,7 @@
int
__lchown (const char *file, uid_t owner, gid_t group)
{
- return INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group);
+ return INLINE_SYSCALL (lchown32, 3, file, owner, group);
}
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 d9914ff53..b6256d5c2 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
@@ -1771,6 +1771,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn 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 ef1ead306..265f66d90 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
@@ -92,6 +92,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/sysdeps/unix/sysv/linux/semctl.c b/libc/sysdeps/unix/sysv/linux/semctl.c
index 40d31f914..b28861d42 100644
--- a/libc/sysdeps/unix/sysv/linux/semctl.c
+++ b/libc/sysdeps/unix/sysv/linux/semctl.c
@@ -33,10 +33,10 @@ struct __old_semid_ds
struct __old_ipc_perm sem_perm; /* operation permission struct */
__time_t sem_otime; /* last semop() time */
__time_t sem_ctime; /* last time changed by semctl() */
- struct sem *__unbounded __sembase; /* ptr to first semaphore in array */
- struct sem_queue *__unbounded __sem_pending; /* pending operations */
- struct sem_queue *__unbounded __sem_pending_last; /* last pending operation */
- struct sem_undo *__unbounded __undo; /* ondo requests on this array */
+ struct sem *__sembase; /* ptr to first semaphore in array */
+ struct sem_queue *__sem_pending; /* pending operations */
+ struct sem_queue *__sem_pending_last; /* last pending operation */
+ struct sem_undo *__undo; /* ondo requests on this array */
unsigned short int sem_nsems; /* number of semaphores in set */
};
@@ -50,9 +50,6 @@ union semun
struct __old_semid_ds *__old_buf;
};
-#include <bp-checks.h>
-#include <bp-semctl.h> /* definition of CHECK_SEMCTL needs union semum */
-
/* Return identifier for array of NSEMS semaphores associated with
KEY. */
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
@@ -91,7 +88,7 @@ __old_semctl (int semid, int semnum, int cmd, ...)
va_end (ap);
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd));
+ &arg);
}
compat_symbol (libc, __old_semctl, semctl, GLIBC_2_0);
#endif
@@ -126,7 +123,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
#if __ASSUME_IPC64 > 0
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
- CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
+ &arg);
#else
switch (cmd)
{
@@ -136,7 +133,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
break;
default:
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd));
+ &arg);
}
{
@@ -147,7 +144,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
/* Unfortunately there is no way how to find out for sure whether
we should use old or new semctl. */
result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
- CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
+ &arg);
if (result != -1 || errno != EINVAL)
return result;
@@ -167,7 +164,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
}
}
result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd));
+ &arg);
if (result != -1 && cmd != IPC_SET)
{
memset(buf, 0, sizeof(*buf));
diff --git a/libc/sysdeps/unix/sysv/linux/semop.c b/libc/sysdeps/unix/sysv/linux/semop.c
index f0ea7780b..cbe42ac62 100644
--- a/libc/sysdeps/unix/sysv/linux/semop.c
+++ b/libc/sysdeps/unix/sysv/linux/semop.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Perform user-defined atomical operation of array of semaphores. */
@@ -32,6 +31,5 @@ semop (semid, sops, nsops)
struct sembuf *sops;
size_t nsops;
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_semop,
- semid, (int) nsops, 0, CHECK_N (sops, nsops));
+ return INLINE_SYSCALL (ipc, 5, IPCOP_semop, semid, (int) nsops, 0, sops);
}
diff --git a/libc/sysdeps/unix/sysv/linux/semtimedop.c b/libc/sysdeps/unix/sysv/linux/semtimedop.c
index 22a50375f..3da355470 100644
--- a/libc/sysdeps/unix/sysv/linux/semtimedop.c
+++ b/libc/sysdeps/unix/sysv/linux/semtimedop.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Perform user-defined atomical operation of array of semaphores. */
@@ -34,6 +33,6 @@ semtimedop (semid, sops, nsops, timeout)
const struct timespec *timeout;
{
return INLINE_SYSCALL (ipc, 6, IPCOP_semtimedop,
- semid, (int) nsops, 0, CHECK_N (sops, nsops),
+ semid, (int) nsops, 0, sops,
timeout);
}
diff --git a/libc/sysdeps/unix/sysv/linux/sh/chown.c b/libc/sysdeps/unix/sysv/linux/sh/chown.c
index 271496936..853d48af8 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/chown.c
+++ b/libc/sysdeps/unix/sysv/linux/sh/chown.c
@@ -20,7 +20,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <linux/posix_types.h>
@@ -29,7 +28,7 @@
int
__chown (const char *file, uid_t owner, gid_t group)
{
- return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
+ return INLINE_SYSCALL (chown32, 3, file, owner, group);
}
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 733b550fe..a653292c2 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
@@ -92,6 +92,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/sysdeps/unix/sysv/linux/sh/pread.c b/libc/sysdeps/unix/sysv/linux/sh/pread.c
index 6f0c3badb..ae338dc21 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/pread.c
+++ b/libc/sysdeps/unix/sysv/linux/sh/pread.c
@@ -23,7 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -46,14 +45,14 @@ __libc_pread (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/sysdeps/unix/sysv/linux/sh/pread64.c b/libc/sysdeps/unix/sysv/linux/sh/pread64.c
index acce914c7..2a46d7034 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/pread64.c
+++ b/libc/sysdeps/unix/sysv/linux/sh/pread64.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -45,7 +44,7 @@ __libc_pread64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
return result;
@@ -53,7 +52,7 @@ __libc_pread64 (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
diff --git a/libc/sysdeps/unix/sysv/linux/sh/pwrite.c b/libc/sysdeps/unix/sysv/linux/sh/pwrite.c
index 441c867bf..4b20e518c 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/pwrite.c
+++ b/libc/sysdeps/unix/sysv/linux/sh/pwrite.c
@@ -23,7 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -46,14 +45,14 @@ __libc_pwrite (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c b/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c
index a4ca56077..5639b3c41 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c
+++ b/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -45,7 +44,7 @@ __libc_pwrite64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
@@ -54,7 +53,7 @@ __libc_pwrite64 (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
diff --git a/libc/sysdeps/unix/sysv/linux/shmat.c b/libc/sysdeps/unix/sysv/linux/shmat.c
index cb5aa50bd..bac1b290a 100644
--- a/libc/sysdeps/unix/sysv/linux/shmat.c
+++ b/libc/sysdeps/unix/sysv/linux/shmat.c
@@ -23,7 +23,6 @@
#include <sysdep.h>
#include <unistd.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Attach the shared memory segment associated with SHMID to the data
segment of the calling process. SHMADDR and SHMFLG determine how
@@ -37,26 +36,17 @@ shmat (shmid, shmaddr, shmflg)
{
INTERNAL_SYSCALL_DECL(err);
unsigned long resultvar;
- void *__unbounded raddr;
-
-#if __BOUNDED_POINTERS__
- size_t length = ~0;
- struct shmid_ds shmds;
- /* It's unfortunate that we need to make another system call to get
- the shared memory segment length... */
- if (shmctl (shmid, IPC_STAT, &shmds) == 0)
- length = shmds.shm_segsz;
-#endif
+ void *raddr;
resultvar = INTERNAL_SYSCALL (ipc, err, 5, IPCOP_shmat,
shmid, shmflg,
- (long int) __ptrvalue (&raddr),
- __ptrvalue ((void *) shmaddr));
+ (long int) &raddr,
+ (void *) shmaddr);
if (INTERNAL_SYSCALL_ERROR_P (resultvar, err))
{
__set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, err));
return (void *) -1l;
}
- return BOUNDED_N (raddr, length);
+ return raddr;
}
diff --git a/libc/sysdeps/unix/sysv/linux/shmctl.c b/libc/sysdeps/unix/sysv/linux/shmctl.c
index 01dbdd087..34806fbb6 100644
--- a/libc/sysdeps/unix/sysv/linux/shmctl.c
+++ b/libc/sysdeps/unix/sysv/linux/shmctl.c
@@ -25,7 +25,6 @@
#include <sys/syscall.h>
#include <bits/wordsize.h>
#include <shlib-compat.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -40,8 +39,8 @@ struct __old_shmid_ds
__ipc_pid_t shm_lpid; /* pid of last shmop */
unsigned short int shm_nattch; /* number of current attaches */
unsigned short int __shm_npages; /* size of segment (pages) */
- unsigned long int *__unbounded __shm_pages; /* array of ptrs to frames -> SHMMAX */
- struct vm_area_struct *__unbounded __attaches; /* descriptors for attaches */
+ unsigned long int *__shm_pages; /* array of ptrs to frames -> SHMMAX */
+ struct vm_area_struct *__attaches; /* descriptors for attaches */
};
struct __old_shminfo
@@ -64,8 +63,7 @@ int
attribute_compat_text_section
__old_shmctl (int shmid, int cmd, struct __old_shmid_ds *buf)
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid,
- cmd, 0, CHECK_1_NULL_OK (buf));
+ return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, buf);
}
compat_symbol (libc, __old_shmctl, shmctl, GLIBC_2_0);
#endif
@@ -75,7 +73,7 @@ __new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
{
#if __ASSUME_IPC64 > 0
return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd | __IPC_64, 0,
- CHECK_1 (buf));
+ buf);
#else
switch (cmd) {
case SHM_STAT:
@@ -86,8 +84,7 @@ __new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
#endif
break;
default:
- return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0,
- CHECK_1 (buf));
+ return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, buf);
}
{
@@ -101,7 +98,7 @@ __new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
/* Unfortunately there is no way how to find out for sure whether
we should use old or new shmctl. */
result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd | __IPC_64, 0,
- CHECK_1 (buf));
+ buf);
if (result != -1 || errno != EINVAL)
return result;
@@ -118,8 +115,7 @@ __new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
return -1;
}
}
- result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0,
- __ptrvalue (&old.ds));
+ result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, &old.ds);
if (result != -1 && (cmd == SHM_STAT || cmd == IPC_STAT))
{
memset(buf, 0, sizeof(*buf));
diff --git a/libc/sysdeps/unix/sysv/linux/shmdt.c b/libc/sysdeps/unix/sysv/linux/shmdt.c
index aac66199b..260526bb7 100644
--- a/libc/sysdeps/unix/sysv/linux/shmdt.c
+++ b/libc/sysdeps/unix/sysv/linux/shmdt.c
@@ -30,5 +30,5 @@ int
shmdt (shmaddr)
const void *shmaddr;
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_shmdt, 0, 0, 0, __ptrvalue ((void *) shmaddr));
+ return INLINE_SYSCALL (ipc, 5, IPCOP_shmdt, 0, 0, 0, (void *) shmaddr);
}
diff --git a/libc/sysdeps/unix/sysv/linux/sigaction.c b/libc/sysdeps/unix/sysv/linux/sigaction.c
index 3fe882eec..336975c51 100644
--- a/libc/sysdeps/unix/sysv/linux/sigaction.c
+++ b/libc/sysdeps/unix/sysv/linux/sigaction.c
@@ -55,8 +55,8 @@ __libc_sigaction (sig, act, oact)
/* 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);
+ act ? &kact : NULL,
+ oact ? &koact : NULL, _NSIG / 8);
if (oact && result >= 0)
{
diff --git a/libc/sysdeps/unix/sysv/linux/sigpending.c b/libc/sysdeps/unix/sysv/linux/sigpending.c
index 74bb9094c..56f581ea4 100644
--- a/libc/sysdeps/unix/sysv/linux/sigpending.c
+++ b/libc/sysdeps/unix/sysv/linux/sigpending.c
@@ -21,7 +21,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -32,5 +31,5 @@ int
sigpending (set)
sigset_t *set;
{
- return INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
}
diff --git a/libc/sysdeps/unix/sysv/linux/sigprocmask.c b/libc/sysdeps/unix/sysv/linux/sigprocmask.c
index a40caf68a..1af03c3cd 100644
--- a/libc/sysdeps/unix/sysv/linux/sigprocmask.c
+++ b/libc/sysdeps/unix/sysv/linux/sigprocmask.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -55,7 +54,6 @@ __sigprocmask (how, set, oset)
}
#endif
- return INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET_NULL_OK (set),
- CHECK_SIGSET_NULL_OK (oset), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
}
weak_alias (__sigprocmask, sigprocmask)
diff --git a/libc/sysdeps/unix/sysv/linux/sigqueue.c b/libc/sysdeps/unix/sysv/linux/sigqueue.c
index eb056f3e9..37d61c8a1 100644
--- a/libc/sysdeps/unix/sysv/linux/sigqueue.c
+++ b/libc/sysdeps/unix/sysv/linux/sigqueue.c
@@ -43,7 +43,7 @@ __sigqueue (pid, sig, val)
info.si_uid = __getuid ();
info.si_value = val;
- return INLINE_SYSCALL (rt_sigqueueinfo, 3, pid, sig, __ptrvalue (&info));
+ return INLINE_SYSCALL (rt_sigqueueinfo, 3, pid, sig, &info);
}
weak_alias (__sigqueue, sigqueue)
#else
diff --git a/libc/sysdeps/unix/sysv/linux/sigsuspend.c b/libc/sysdeps/unix/sysv/linux/sigsuspend.c
index 667ba415a..992a422da 100644
--- a/libc/sysdeps/unix/sysv/linux/sigsuspend.c
+++ b/libc/sysdeps/unix/sysv/linux/sigsuspend.c
@@ -21,7 +21,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -29,7 +28,7 @@
static inline int __attribute__ ((always_inline))
do_sigsuspend (const sigset_t *set)
{
- return INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
}
/* Change the set of blocked signals to SET,
diff --git a/libc/sysdeps/unix/sysv/linux/sigtimedwait.c b/libc/sysdeps/unix/sysv/linux/sigtimedwait.c
index 283215e5b..20fe3550d 100644
--- a/libc/sysdeps/unix/sysv/linux/sigtimedwait.c
+++ b/libc/sysdeps/unix/sysv/linux/sigtimedwait.c
@@ -21,7 +21,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#ifdef __NR_rt_sigtimedwait
@@ -51,8 +50,8 @@ do_sigtimedwait (const sigset_t *set, siginfo_t *info,
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- int result = INLINE_SYSCALL (rt_sigtimedwait, 4, CHECK_SIGSET (set),
- CHECK_1 (info), timeout, _NSIG / 8);
+ int result = INLINE_SYSCALL (rt_sigtimedwait, 4, set,
+ info, timeout, _NSIG / 8);
/* The kernel generates a SI_TKILL code in si_code in case tkill is
used. tkill is transparently used in raise(). Since having
diff --git a/libc/sysdeps/unix/sysv/linux/sigwait.c b/libc/sysdeps/unix/sysv/linux/sigwait.c
index aaea9d680..9ea21d077 100644
--- a/libc/sysdeps/unix/sysv/linux/sigwait.c
+++ b/libc/sysdeps/unix/sysv/linux/sigwait.c
@@ -23,7 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#ifdef __NR_rt_sigtimedwait
@@ -58,7 +57,7 @@ do_sigwait (const sigset_t *set, int *sig)
#ifdef INTERNAL_SYSCALL
INTERNAL_SYSCALL_DECL (err);
do
- ret = INTERNAL_SYSCALL (rt_sigtimedwait, err, 4, CHECK_SIGSET (set),
+ ret = INTERNAL_SYSCALL (rt_sigtimedwait, err, 4, set,
NULL, NULL, _NSIG / 8);
while (INTERNAL_SYSCALL_ERROR_P (ret, err)
&& INTERNAL_SYSCALL_ERRNO (ret, err) == EINTR);
@@ -71,8 +70,7 @@ do_sigwait (const sigset_t *set, int *sig)
ret = INTERNAL_SYSCALL_ERRNO (ret, err);
#else
do
- ret = INLINE_SYSCALL (rt_sigtimedwait, 4, CHECK_SIGSET (set),
- NULL, NULL, _NSIG / 8);
+ ret = INLINE_SYSCALL (rt_sigtimedwait, 4, set, NULL, NULL, _NSIG / 8);
while (ret == -1 && errno == EINTR);
if (ret != -1)
{
diff --git a/libc/sysdeps/unix/sysv/linux/sigwaitinfo.c b/libc/sysdeps/unix/sysv/linux/sigwaitinfo.c
index bd85e9595..50fa72bf4 100644
--- a/libc/sysdeps/unix/sysv/linux/sigwaitinfo.c
+++ b/libc/sysdeps/unix/sysv/linux/sigwaitinfo.c
@@ -23,7 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#ifdef __NR_rt_sigtimedwait
@@ -52,8 +51,8 @@ do_sigwaitinfo (const sigset_t *set, siginfo_t *info)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- int result = INLINE_SYSCALL (rt_sigtimedwait, 4, CHECK_SIGSET (set),
- CHECK_1 (info), NULL, _NSIG / 8);
+ int result = INLINE_SYSCALL (rt_sigtimedwait, 4, set,
+ info, NULL, _NSIG / 8);
/* The kernel generates a SI_TKILL code in si_code in case tkill is
used. tkill is transparently used in raise(). Since having
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 3a96ea883..9defbdf13 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist
@@ -1776,6 +1776,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c
index ef93f8c53..1a4bbac8f 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c
@@ -50,9 +50,6 @@ union semun
struct __old_semid_ds *__old_buf;
};
-#include <bp-checks.h>
-#include <bp-semctl.h> /* definition of CHECK_SEMCTL needs union semum */
-
/* Return identifier for array of NSEMS semaphores associated with
KEY. */
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
@@ -87,7 +84,7 @@ __old_semctl (int semid, int semnum, int cmd, ...)
}
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd));
+ &arg);
}
compat_symbol (libc, __old_semctl, semctl, GLIBC_2_0);
#endif
@@ -117,7 +114,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
}
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
- CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
+ &arg);
}
versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2);
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/msgctl.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/msgctl.c
index 3bda4b275..d55511e10 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/msgctl.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/msgctl.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Allows to control internal state and destruction of message queue
objects. */
@@ -33,5 +32,5 @@ msgctl (msqid, cmd, buf)
int cmd;
struct msqid_ds *buf;
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl, msqid, cmd, 0, CHECK_1 (buf));
+ return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl, msqid, cmd, 0, buf);
}
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c
index bce7a58d2..625eeb27c 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c
@@ -22,8 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
-
ssize_t
__libc_msgrcv (msqid, msgp, msgsz, msgtyp, msgflg)
int msqid;
@@ -34,12 +32,12 @@ __libc_msgrcv (msqid, msgp, msgsz, msgtyp, msgflg)
{
if (SINGLE_THREAD_P)
return INLINE_SYSCALL (ipc, 6, IPCOP_msgrcv, msqid, msgsz, msgflg,
- CHECK_N (msgp, msgsz), msgtyp);
+ msgp, msgtyp);
int oldtype = LIBC_CANCEL_ASYNC ();
ssize_t result = INLINE_SYSCALL (ipc, 6, IPCOP_msgrcv, msqid, msgsz, msgflg,
- CHECK_N (msgp, msgsz), msgtyp);
+ msgp, msgtyp);
LIBC_CANCEL_RESET (oldtype);
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 aa892b8b8..35987faa6 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist
@@ -97,6 +97,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c
index 4303d10e0..9ada8e847 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c
@@ -33,9 +33,6 @@ union semun
struct seminfo *__buf; /* buffer for IPC_INFO */
};
-#include <bp-checks.h>
-#include <bp-semctl.h> /* definition of CHECK_SEMCTL needs union semum */
-
/* Return identifier for array of NSEMS semaphores associated with
KEY. */
@@ -53,5 +50,5 @@ semctl (int semid, int semnum, int cmd, ...)
va_end (ap);
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd)->array);
+ arg.array);
}
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/shmctl.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/shmctl.c
index fc2573905..7c4af7476 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/shmctl.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/shmctl.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Provide operations to control over shared memory segments. */
@@ -32,5 +31,5 @@ shmctl (shmid, cmd, buf)
int cmd;
struct shmid_ds *buf;
{
- return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, CHECK_1 (buf));
+ return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, buf);
}
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
index 988d26662..d5e708777 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
@@ -48,8 +48,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
/* 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 ? __ptrvalue (&kact) : 0,
- oact ? __ptrvalue (&koact) : 0, stub, _NSIG / 8);
+ act ? &kact : 0,
+ oact ? &koact : 0, stub, _NSIG / 8);
if (oact && ret >= 0)
{
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c
index ca6ff6948..57d172d61 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c
@@ -21,7 +21,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Change the set of blocked signals to SET,
wait until a signal arrives, and restore the set of blocked signals. */
@@ -31,5 +30,5 @@ sigpending (set)
{
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
}
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
index 14cda4dd8..c7a30606f 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c
@@ -21,7 +21,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Get and/or change the set of blocked signals. */
int
@@ -32,7 +31,6 @@ __sigprocmask (how, set, oset)
{
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET (set),
- CHECK_SIGSET_NULL_OK (oset), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
}
weak_alias (__sigprocmask, sigprocmask)
diff --git a/libc/sysdeps/unix/sysv/linux/sysctl.c b/libc/sysdeps/unix/sysv/linux/sysctl.c
index 5c6b1fb30..4ff1bf378 100644
--- a/libc/sysdeps/unix/sysv/linux/sysctl.c
+++ b/libc/sysdeps/unix/sysv/linux/sysctl.c
@@ -22,13 +22,11 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
int
__sysctl (int *name, int nlen, void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
- /* GKM FIXME: force __sysctl_args decl to have unbounded pointers. */
struct __sysctl_args args =
{
.name = name,
@@ -38,11 +36,8 @@ __sysctl (int *name, int nlen, void *oldval, size_t *oldlenp,
.newval = newval,
.newlen = newlen
};
- (void) CHECK_N (name, nlen);
- (void) CHECK_N (oldval, *oldlenp);
- (void) CHECK_N (newval, newlen);
- return INLINE_SYSCALL (_sysctl, 1, __ptrvalue (&args));
+ return INLINE_SYSCALL (_sysctl, 1, &args);
}
libc_hidden_def (__sysctl)
weak_alias (__sysctl, sysctl)
diff --git a/libc/sysdeps/unix/sysv/linux/truncate64.c b/libc/sysdeps/unix/sysv/linux/truncate64.c
index 82c132782..8c9e8488b 100644
--- a/libc/sysdeps/unix/sysv/linux/truncate64.c
+++ b/libc/sysdeps/unix/sysv/linux/truncate64.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Truncate the file referenced by FD to LENGTH bytes. */
int
@@ -30,7 +29,7 @@ truncate64 (const char *path, off64_t length)
{
unsigned int low = length & 0xffffffff;
unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (truncate64, 3, CHECK_STRING (path),
+ int result = INLINE_SYSCALL (truncate64, 3, path,
__LONG_LONG_PAIR (high, low));
return result;
}
diff --git a/libc/sysdeps/unix/sysv/linux/ustat.c b/libc/sysdeps/unix/sysv/linux/ustat.c
index 7a57ee1e9..499ed7eaf 100644
--- a/libc/sysdeps/unix/sysv/linux/ustat.c
+++ b/libc/sysdeps/unix/sysv/linux/ustat.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
int
ustat (dev_t dev, struct ustat *ubuf)
@@ -37,5 +36,5 @@ ustat (dev_t dev, struct ustat *ubuf)
return -1;
}
- return INLINE_SYSCALL (ustat, 2, (unsigned int) k_dev, CHECK_1 (ubuf));
+ return INLINE_SYSCALL (ustat, 2, (unsigned int) k_dev, ubuf);
}
diff --git a/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstat.c b/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstat.c
index bbaa0e04d..d6023e2a2 100644
--- a/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstat.c
+++ b/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstat.c
@@ -26,14 +26,13 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Get information about the file FD in BUF. */
int
__fxstat (int vers, int fd, struct stat *buf)
{
if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX)
- return INLINE_SYSCALL (fstat, 2, fd, CHECK_1 (buf));
+ return INLINE_SYSCALL (fstat, 2, fd, buf);
__set_errno (EINVAL);
return -1;
diff --git a/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c b/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
index 733348cbf..73a2e871c 100644
--- a/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
+++ b/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
@@ -29,7 +29,6 @@
#include <sysdep.h>
#include <kernel-features.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Get information about the file NAME relative to FD in ST. */
@@ -95,9 +94,9 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
INTERNAL_SYSCALL_DECL (err);
if (flag & AT_SYMLINK_NOFOLLOW)
- res = INTERNAL_SYSCALL (lstat, err, 2, file, CHECK_1 (st));
+ res = INTERNAL_SYSCALL (lstat, err, 2, file, st);
else
- res = INTERNAL_SYSCALL (stat, err, 2, file, CHECK_1 (st));
+ res = INTERNAL_SYSCALL (stat, err, 2, file, st);
if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (res, err), 0))
{
diff --git a/libc/sysdeps/unix/sysv/linux/wordsize-64/lxstat.c b/libc/sysdeps/unix/sysv/linux/wordsize-64/lxstat.c
index 4a34c8412..62b6c89ba 100644
--- a/libc/sysdeps/unix/sysv/linux/wordsize-64/lxstat.c
+++ b/libc/sysdeps/unix/sysv/linux/wordsize-64/lxstat.c
@@ -26,14 +26,13 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Get information about the file FD in BUF. */
int
__lxstat (int vers, const char *name, struct stat *buf)
{
if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX)
- return INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), CHECK_1 (buf));
+ return INLINE_SYSCALL (lstat, 2, name, buf);
__set_errno (EINVAL);
return -1;
diff --git a/libc/sysdeps/unix/sysv/linux/wordsize-64/xstat.c b/libc/sysdeps/unix/sysv/linux/wordsize-64/xstat.c
index b9b533d30..1fa2280c2 100644
--- a/libc/sysdeps/unix/sysv/linux/wordsize-64/xstat.c
+++ b/libc/sysdeps/unix/sysv/linux/wordsize-64/xstat.c
@@ -26,14 +26,13 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Get information about the file NAME in BUF. */
int
__xstat (int vers, const char *name, struct stat *buf)
{
if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX)
- return INLINE_SYSCALL (stat, 2, name, CHECK_1 (buf));
+ return INLINE_SYSCALL (stat, 2, name, buf);
__set_errno (EINVAL);
return -1;
diff --git a/libc/sysdeps/unix/sysv/linux/writev.c b/libc/sysdeps/unix/sysv/linux/writev.c
index 993660a11..e53c0d345 100644
--- a/libc/sysdeps/unix/sysv/linux/writev.c
+++ b/libc/sysdeps/unix/sysv/linux/writev.c
@@ -23,7 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
#ifndef __ASSUME_COMPLETE_READV_WRITEV
@@ -47,12 +46,12 @@ __libc_writev (fd, vector, count)
ssize_t result;
if (SINGLE_THREAD_P)
- result = INLINE_SYSCALL (writev, 3, fd, CHECK_N (vector, count), count);
+ result = INLINE_SYSCALL (writev, 3, fd, vector, count);
else
{
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (writev, 3, fd, CHECK_N (vector, count), count);
+ result = INLINE_SYSCALL (writev, 3, fd, vector, count);
LIBC_CANCEL_RESET (oldtype);
}
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 a42d424cd..914b5908f 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
@@ -88,6 +88,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2.5
GLIBC_2.2.5 A
_Exit F
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/clone.S b/libc/sysdeps/unix/sysv/linux/x86_64/clone.S
index c131a4024..144eaf752 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/clone.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/clone.S
@@ -22,8 +22,6 @@
#define _ERRNO_H 1
#include <bits/errno.h>
#include <asm-syntax.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
#define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000
@@ -52,7 +50,7 @@
.text
-ENTRY (BP_SYM (__clone))
+ENTRY (__clone)
/* Sanity check arguments. */
movq $-EINVAL,%rax
testq %rdi,%rdi /* no NULL function pointers */
@@ -117,6 +115,6 @@ L(thread_start):
cfi_endproc;
cfi_startproc;
-PSEUDO_END (BP_SYM (__clone))
+PSEUDO_END (__clone)
-weak_alias (BP_SYM (__clone), BP_SYM (clone))
+weak_alias (__clone, clone)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c b/libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
index 0fcb754a5..4b5d1e1a8 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
@@ -62,8 +62,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
/* 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);
+ sig, act ? &kact : NULL,
+ oact ? &koact : NULL, _NSIG / 8);
if (oact && result >= 0)
{
oact->sa_handler = koact.k_sa_handler;
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sigpending.c b/libc/sysdeps/unix/sysv/linux/x86_64/sigpending.c
index 523fb39aa..e68f77622 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sigpending.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sigpending.c
@@ -24,7 +24,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Change the set of blocked signals to SET,
wait until a signal arrives, and restore the set of blocked signals. */
@@ -34,5 +33,5 @@ sigpending (set)
{
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
}
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c b/libc/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
index f755049ea..6d12326db 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sigprocmask.c
@@ -25,7 +25,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Get and/or change the set of blocked signals. */
int
@@ -37,7 +36,6 @@ __sigprocmask (how, set, oset)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET (set),
- CHECK_SIGSET_NULL_OK (oset), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
}
weak_alias (__sigprocmask, sigprocmask)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 763a748bc..d68112a61 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -20,8 +20,6 @@
/* There is some commonality. */
#include <sysdeps/unix/x86_64/sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
#include <tls.h>
#ifdef IS_IN_rtld
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
index 108b80fb4..0f64c8d20 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist
@@ -2086,3 +2086,6 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
diff --git a/libc/sysdeps/unix/sysv/linux/xmknod.c b/libc/sysdeps/unix/sysv/linux/xmknod.c
index 23c83ef24..154dc9a03 100644
--- a/libc/sysdeps/unix/sysv/linux/xmknod.c
+++ b/libc/sysdeps/unix/sysv/linux/xmknod.c
@@ -23,7 +23,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Create a device file named PATH, with permission and special bits MODE
and device number DEV (which can be constructed from major and minor
@@ -47,8 +46,7 @@ __xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
return -1;
}
- return INLINE_SYSCALL (mknod, 3, CHECK_STRING (path), mode,
- (unsigned int) k_dev);
+ return INLINE_SYSCALL (mknod, 3, path, mode, (unsigned int) k_dev);
}
weak_alias (__xmknod, _xmknod)
diff --git a/libc/sysdeps/unix/sysv/linux/xmknodat.c b/libc/sysdeps/unix/sysv/linux/xmknodat.c
index 79f3e55bc..8cb902127 100644
--- a/libc/sysdeps/unix/sysv/linux/xmknodat.c
+++ b/libc/sysdeps/unix/sysv/linux/xmknodat.c
@@ -26,7 +26,6 @@
#include <sysdep.h>
#include <kernel-features.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Create a device file named PATH relative to FD, with permission and
@@ -92,8 +91,7 @@ __xmknodat (int vers, int fd, const char *file, mode_t mode, dev_t *dev)
file = buf;
}
- return INLINE_SYSCALL (mknod, 3, CHECK_STRING (file), mode,
- (unsigned int) k_dev);
+ return INLINE_SYSCALL (mknod, 3, file, mode, (unsigned int) k_dev);
#endif
}
diff --git a/libc/sysdeps/unix/sysv/linux/xstat.c b/libc/sysdeps/unix/sysv/linux/xstat.c
index 07fbcd08e..ac342cec7 100644
--- a/libc/sysdeps/unix/sysv/linux/xstat.c
+++ b/libc/sysdeps/unix/sysv/linux/xstat.c
@@ -27,7 +27,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <xstatconv.h>
@@ -36,8 +35,7 @@ int
__xstat (int vers, const char *name, struct stat *buf)
{
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (stat, 2, CHECK_STRING (name),
- CHECK_1 ((struct kernel_stat *) buf));
+ return INLINE_SYSCALL (stat, 2, name, (struct kernel_stat *) buf);
#ifdef STAT_IS_KERNEL_STAT
errno = EINVAL;
@@ -46,8 +44,7 @@ __xstat (int vers, const char *name, struct stat *buf)
struct kernel_stat kbuf;
int result;
- result = INLINE_SYSCALL (stat, 2, CHECK_STRING (name),
- __ptrvalue (&kbuf));
+ result = INLINE_SYSCALL (stat, 2, name, &kbuf);
if (result == 0)
result = __xstat_conv (vers, &kbuf, buf);
diff --git a/libc/sysdeps/unix/sysv/linux/xstat64.c b/libc/sysdeps/unix/sysv/linux/xstat64.c
index 061de1a4d..2377ac503 100644
--- a/libc/sysdeps/unix/sysv/linux/xstat64.c
+++ b/libc/sysdeps/unix/sysv/linux/xstat64.c
@@ -23,7 +23,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -33,7 +32,7 @@ int
___xstat64 (int vers, const char *name, struct stat64 *buf)
{
int result;
- result = INLINE_SYSCALL (stat64, 2, CHECK_STRING (name), CHECK_1 (buf));
+ result = INLINE_SYSCALL (stat64, 2, name, buf);
#if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0
if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino)
buf->st_ino = buf->__st_ino;
diff --git a/libc/sysdeps/unix/x86_64/sysdep.S b/libc/sysdeps/unix/x86_64/sysdep.S
index 7f2daa666..4ac535e57 100644
--- a/libc/sysdeps/unix/x86_64/sysdep.S
+++ b/libc/sysdeps/unix/x86_64/sysdep.S
@@ -18,8 +18,6 @@
#include <sysdep.h>
#define _ERRNO_H
#include <bits/errno.h>
-#include <bp-asm.h>
-#include <bp-sym.h>
#include <tls.h>
#ifdef IS_IN_rtld
diff --git a/libc/sysdeps/x86/bits/string.h b/libc/sysdeps/x86/bits/string.h
index 41d204199..24b64ec94 100644
--- a/libc/sysdeps/x86/bits/string.h
+++ b/libc/sysdeps/x86/bits/string.h
@@ -36,7 +36,7 @@
/* We only provide optimizations if the user selects them and if
GNU CC is used. */
# if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \
- && defined __GNUC__ && __GNUC__ >= 2 && !__BOUNDED_POINTERS__
+ && defined __GNUC__ && __GNUC__ >= 2
# ifndef __STRING_INLINE
# ifndef __extern_inline
diff --git a/libc/sysdeps/x86_64/bp-asm.h b/libc/sysdeps/x86_64/bp-asm.h
deleted file mode 100644
index 10916fd95..000000000
--- a/libc/sysdeps/x86_64/bp-asm.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* Bounded-pointer definitions for x86-64 assembler.
- Copyright (C) 2001-2013 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/>. */
-
-#ifndef _bp_asm_h_
-# define _bp_asm_h_ 1
-
-# if __ASSEMBLER__
-
-# if __BOUNDED_POINTERS__
-
-/* Bounded pointers occupy three words. */
-# define PTR_SIZE 24
-/* Bounded pointer return values are passed back through a hidden
- argument that points to caller-allocate space. The hidden arg
- occupies one word on the stack. */
-# define RTN_SIZE 6
-/* Although the caller pushes the hidden arg, the callee is
- responsible for popping it. */
-# define RET_PTR ret $RTN_SIZE
-/* Maintain frame pointer chain in leaf assembler functions for the benefit
- of debugging stack traces when bounds violations occur. */
-# define ENTER pushq %rbp; movq %rsp, %rbp
-# define LEAVE movq %rbp, %rsp; popq %rbp
-/* Stack space overhead of procedure-call linkage: return address and
- frame pointer. */
-# define LINKAGE 16
-/* Stack offset of return address after calling ENTER. */
-# define PCOFF 8
-
-/* Int 5 is the "bound range" exception also raised by the "bound"
- instruction. */
-# define BOUNDS_VIOLATED int $5
-
-# define CHECK_BOUNDS_LOW(VAL_REG, BP_MEM) \
- cmpq 8+BP_MEM, VAL_REG; \
- jae 0f; /* continue if value >= low */ \
- BOUNDS_VIOLATED; \
- 0:
-
-# define CHECK_BOUNDS_HIGH(VAL_REG, BP_MEM, Jcc) \
- cmpq 16+BP_MEM, VAL_REG; \
- Jcc 0f; /* continue if value < high */ \
- BOUNDS_VIOLATED; \
- 0:
-
-# define CHECK_BOUNDS_BOTH(VAL_REG, BP_MEM) \
- cmpq 8+BP_MEM, VAL_REG; \
- jb 1f; /* die if value < low */ \
- cmpq 16+BP_MEM, VAL_REG; \
- jb 0f; /* continue if value < high */ \
- 1: BOUNDS_VIOLATED; \
- 0:
-
-# define CHECK_BOUNDS_BOTH_WIDE(VAL_REG, BP_MEM, LENGTH) \
- CHECK_BOUNDS_LOW(VAL_REG, BP_MEM); \
- addl LENGTH, VAL_REG; \
- cmpq 16+BP_MEM, VAL_REG; \
- jbe 0f; /* continue if value <= high */ \
- BOUNDS_VIOLATED; \
- 0: subq LENGTH, VAL_REG /* restore value */
-
-/* Take bounds from BP_MEM and affix them to the pointer
- value in %rax, stuffing all into memory at RTN(%esp).
- Use %rdx as a scratch register. */
-
-# define RETURN_BOUNDED_POINTER(BP_MEM) \
- movq RTN(%rsp), %rdx; \
- movq %rax, 0(%rdx); \
- movq 8+BP_MEM, %rax; \
- movq %rax, 4(%rdx); \
- movq 16+BP_MEM, %rax; \
- movq %rax, 8(%rdx)
-
-# define RETURN_NULL_BOUNDED_POINTER \
- movl RTN(%rsp), %rdx; \
- movl %rax, 0(%rdx); \
- movl %rax, 4(%rdx); \
- movl %rax, 8(%rdx)
-
-/* The caller of __errno_location is responsible for allocating space
- for the three-word BP return-value and passing pushing its address
- as an implicit first argument. */
-# define PUSH_ERRNO_LOCATION_RETURN \
- subl $16, %esp; \
- subl $8, %esp; \
- pushq %rsp
-
-/* __errno_location is responsible for popping the implicit first
- argument, but we must pop the space for the BP itself. We also
- dereference the return value in order to dig out the pointer value. */
-# define POP_ERRNO_LOCATION_RETURN \
- popq %rax; \
- addq $16, %rsp
-
-# else /* !__BOUNDED_POINTERS__ */
-
-/* Unbounded pointers occupy one word. */
-# define PTR_SIZE 8
-/* Unbounded pointer return values are passed back in the register %rax. */
-# define RTN_SIZE 0
-/* Use simple return instruction for unbounded pointer values. */
-# define RET_PTR ret
-/* Don't maintain frame pointer chain for leaf assembler functions. */
-# define ENTER
-# define LEAVE
-/* Stack space overhead of procedure-call linkage: return address only. */
-# define LINKAGE 8
-/* Stack offset of return address after calling ENTER. */
-# define PCOFF 0
-
-# define CHECK_BOUNDS_LOW(VAL_REG, BP_MEM)
-# define CHECK_BOUNDS_HIGH(VAL_REG, BP_MEM, Jcc)
-# define CHECK_BOUNDS_BOTH(VAL_REG, BP_MEM)
-# define CHECK_BOUNDS_BOTH_WIDE(VAL_REG, BP_MEM, LENGTH)
-# define RETURN_BOUNDED_POINTER(BP_MEM)
-
-# define RETURN_NULL_BOUNDED_POINTER
-
-# define PUSH_ERRNO_LOCATION_RETURN
-# define POP_ERRNO_LOCATION_RETURN
-
-# endif /* !__BOUNDED_POINTERS__ */
-
-# endif /* __ASSEMBLER__ */
-
-#endif /* _bp_asm_h_ */
diff --git a/libc/sysdeps/x86_64/bsd-_setjmp.S b/libc/sysdeps/x86_64/bsd-_setjmp.S
index 8769a80fa..4bb4978bf 100644
--- a/libc/sysdeps/x86_64/bsd-_setjmp.S
+++ b/libc/sysdeps/x86_64/bsd-_setjmp.S
@@ -24,16 +24,14 @@
#define _ASM
#define _SETJMP_H
#include <bits/setjmp.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
-ENTRY (BP_SYM (_setjmp))
+ENTRY (_setjmp)
/* Set up arguments, we only need to set the second arg. */
xorl %esi, %esi
#ifdef PIC
jmp HIDDEN_JUMPTARGET (__sigsetjmp)
#else
- jmp BP_SYM (__sigsetjmp)
+ jmp __sigsetjmp
#endif
-END (BP_SYM (_setjmp))
+END (_setjmp)
libc_hidden_def (_setjmp)
diff --git a/libc/sysdeps/x86_64/bsd-setjmp.S b/libc/sysdeps/x86_64/bsd-setjmp.S
index 32fba7020..6a5cfe2f3 100644
--- a/libc/sysdeps/x86_64/bsd-setjmp.S
+++ b/libc/sysdeps/x86_64/bsd-setjmp.S
@@ -24,15 +24,13 @@
#define _ASM
#define _SETJMP_H
#include <bits/setjmp.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
-ENTRY (BP_SYM (setjmp))
+ENTRY (setjmp)
/* Set up arguments, we only need to set the 2nd arg. */
movl $1, %esi
#ifdef PIC
jmp HIDDEN_JUMPTARGET (__sigsetjmp)
#else
- jmp BP_SYM (__sigsetjmp)
+ jmp __sigsetjmp
#endif
-END (BP_SYM (setjmp))
+END (setjmp)
diff --git a/libc/sysdeps/x86_64/fpu/libm-test-ulps b/libc/sysdeps/x86_64/fpu/libm-test-ulps
index 63c6aed2a..b828774c7 100644
--- a/libc/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/libc/sysdeps/x86_64/fpu/libm-test-ulps
@@ -244,6 +244,24 @@ ifloat: 1
Test "Imaginary part of: cacos (-0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i":
double: 1
idouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-1025 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-1025 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Real part of: cacos (-0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442100 - 1.194763217287109304111930828519090523536 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442100 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Real part of: cacos (-0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442100 + 1.194763217287109304111930828519090523536 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442100 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
Test "Real part of: cacos (-1.0 + 0x1p50 i) == 1.570796326794897507409741391764983781004 - 3.535050620855721078027883819436759661753e1 i":
float: 1
ifloat: 1
@@ -257,9 +275,27 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (-1.5 + 0x1.fp-1025 i) == 3.141592653589793238462643383279502884197 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.5 + 0x1.fp-129 i) == 3.141592653589793238462643383279502884195 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.5 + 0x1.fp-16385 i) == 3.141592653589793238462643383279502884197 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (-1.5 - 0 i) == pi + 0.9624236501192068949955178268487368462704 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (-1.5 - 0x1.fp-1025 i) == 3.141592653589793238462643383279502884197 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.5 - 0x1.fp-129 i) == 3.141592653589793238462643383279502884195 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.5 - 0x1.fp-16385 i) == 3.141592653589793238462643383279502884197 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: cacos (-2 - 3 i) == 2.1414491111159960199416055713254211 + 1.9833870299165354323470769028940395 i":
float: 1
ifloat: 1
@@ -281,6 +317,18 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: cacos (0x1.fp-1025 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (0x1.fp-1025 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442097 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442097 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
Test "Imaginary part of: cacos (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 - 7.107906849659093345062145442726115449315e2 i":
double: 1
idouble: 1
@@ -294,9 +342,27 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (1.5 + 0x1.fp-1025 i) == 4.819934639999230680322935210539402497827e-309 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.5 + 0x1.fp-129 i) == 2.546345110742945032959687790021055102355e-39 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.5 + 0x1.fp-16385 i) == 7.282957076134209141226696333885150260319e-4933 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (1.5 - 0 i) == +0 + 0.9624236501192068949955178268487368462704 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (1.5 - 0x1.fp-1025 i) == 4.819934639999230680322935210539402497827e-309 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.5 - 0x1.fp-129 i) == 2.546345110742945032959687790021055102355e-39 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.5 - 0x1.fp-16385 i) == 7.282957076134209141226696333885150260319e-4933 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
# cacosh
Test "Real part of: cacosh (+0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i":
@@ -460,6 +526,18 @@ ifloat: 1
Test "Imaginary part of: casin (-0 - 1.5 i) == -0 - 1.194763217287109304111930828519090523536 i":
double: 1
idouble: 1
+Test "Imaginary part of: casin (-0x1.fp-1025 + 1.5 i) == -2.989196569048182929051881765490354365918e-309 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (-0x1.fp-1025 - 1.5 i) == -2.989196569048182929051881765490354365918e-309 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (-0x1.fp-129 + 1.5 i) == -1.579176199917649005841160751101628985741e-39 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (-0x1.fp-129 - 1.5 i) == -1.579176199917649005841160751101628985741e-39 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
Test "Imaginary part of: casin (-1.5 + +0 i) == -pi/2 + 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -467,9 +545,27 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (-1.5 + 0x1.fp-1025 i) == -1.570796326794896619231321691639751442099 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.5 + 0x1.fp-129 i) == -1.570796326794896619231321691639751442096 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.5 + 0x1.fp-16385 i) == -1.570796326794896619231321691639751442099 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (-1.5 - 0 i) == -pi/2 - 0.9624236501192068949955178268487368462704 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (-1.5 - 0x1.fp-1025 i) == -1.570796326794896619231321691639751442099 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.5 - 0x1.fp-129 i) == -1.570796326794896619231321691639751442096 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.5 - 0x1.fp-16385 i) == -1.570796326794896619231321691639751442099 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
double: 1
float: 1
@@ -482,6 +578,18 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: casin (0x1.fp-1025 + 1.5 i) == 2.989196569048182929051881765490354365918e-309 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (0x1.fp-1025 - 1.5 i) == 2.989196569048182929051881765490354365918e-309 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (0x1.fp-129 + 1.5 i) == 1.579176199917649005841160751101628985741e-39 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (0x1.fp-129 - 1.5 i) == 1.579176199917649005841160751101628985741e-39 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
Test "Imaginary part of: casin (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 + 7.107906849659093345062145442726115449315e2 i":
double: 1
idouble: 1
@@ -495,9 +603,27 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (1.5 + 0x1.fp-1025 i) == 1.570796326794896619231321691639751442099 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.5 + 0x1.fp-129 i) == 1.570796326794896619231321691639751442096 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.5 + 0x1.fp-16385 i) == 1.570796326794896619231321691639751442099 + 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (1.5 - 0 i) == pi/2 - 0.9624236501192068949955178268487368462704 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (1.5 - 0x1.fp-1025 i) == 1.570796326794896619231321691639751442099 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.5 - 0x1.fp-129 i) == 1.570796326794896619231321691639751442096 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.5 - 0x1.fp-16385 i) == 1.570796326794896619231321691639751442099 - 9.624236501192068949955178268487368462704e-1 i":
+ildouble: 1
+ldouble: 1
# casinh
Test "Real part of: casinh (+0 + 1.5 i) == 0.9624236501192068949955178268487368462704 + pi/2 i":
@@ -534,6 +660,24 @@ idouble: 2
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (-0x1.fp-1025 + 1.5 i) == -9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1.fp-1025 - 1.5 i) == -9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1.fp-129 + 1.5 i) == -9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442096 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1.fp-129 - 1.5 i) == -9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442096 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1.fp-16385 + 1.5 i) == -9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1.fp-16385 - 1.5 i) == -9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-1.0 + +0 i) == -0.8813735870195430252326093249797923090282 + +0 i":
double: 2
float: 1
@@ -553,11 +697,23 @@ double: 2
float: 1
idouble: 2
ifloat: 1
+Test "Real part of: casinh (-1.5 + 0x1.fp-1025 i) == -1.194763217287109304111930828519090523536 + 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (-1.5 + 0x1.fp-129 i) == -1.194763217287109304111930828519090523536 + 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
Test "Real part of: casinh (-1.5 - 0 i) == -1.194763217287109304111930828519090523536 - 0 i":
double: 2
float: 1
idouble: 2
ifloat: 1
+Test "Real part of: casinh (-1.5 - 0x1.fp-1025 i) == -1.194763217287109304111930828519090523536 - 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (-1.5 - 0x1.fp-129 i) == -1.194763217287109304111930828519090523536 - 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
double: 5
float: 1
@@ -592,6 +748,24 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (0x1.fp-1025 + 1.5 i) == 9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp-1025 - 1.5 i) == 9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp-129 + 1.5 i) == 9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442096 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp-129 - 1.5 i) == 9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442096 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp-16385 + 1.5 i) == 9.624236501192068949955178268487368462704e-1 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp-16385 - 1.5 i) == 9.624236501192068949955178268487368462704e-1 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (0x1.fp1023 + 0x1.fp1023 i) == 7.107906849659093345062145442726115449315e2 + 7.853981633974483096156608458198757210493e-1 i":
double: 1
idouble: 1
@@ -611,9 +785,21 @@ ifloat: 1
Test "Real part of: casinh (1.5 + +0 i) == 1.194763217287109304111930828519090523536 + +0 i":
double: 1
idouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-1025 i) == 1.194763217287109304111930828519090523536 + 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-129 i) == 1.194763217287109304111930828519090523536 + 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
Test "Real part of: casinh (1.5 - 0 i) == 1.194763217287109304111930828519090523536 - 0 i":
double: 1
idouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-1025 i) == 1.194763217287109304111930828519090523536 - 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-129 i) == 1.194763217287109304111930828519090523536 - 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
# catan
Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/mpa-avx.c b/libc/sysdeps/x86_64/fpu/multiarch/mpa-avx.c
index d3f4d7ab2..366b0b713 100644
--- a/libc/sysdeps/x86_64/fpu/multiarch/mpa-avx.c
+++ b/libc/sysdeps/x86_64/fpu/multiarch/mpa-avx.c
@@ -1,5 +1,6 @@
#define __add __add_avx
#define __mul __mul_avx
+#define __sqr __sqr_avx
#define __sub __sub_avx
#define __dbl_mp __dbl_mp_avx
#define __dvd __dvd_avx
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/mpa-fma4.c b/libc/sysdeps/x86_64/fpu/multiarch/mpa-fma4.c
index 6abb671b5..a4a759407 100644
--- a/libc/sysdeps/x86_64/fpu/multiarch/mpa-fma4.c
+++ b/libc/sysdeps/x86_64/fpu/multiarch/mpa-fma4.c
@@ -1,5 +1,6 @@
#define __add __add_fma4
#define __mul __mul_fma4
+#define __sqr __sqr_fma4
#define __sub __sub_fma4
#define __dbl_mp __dbl_mp_fma4
#define __dvd __dvd_fma4
diff --git a/libc/sysdeps/x86_64/mempcpy.S b/libc/sysdeps/x86_64/mempcpy.S
index 5cb256e65..acee5e56b 100644
--- a/libc/sysdeps/x86_64/mempcpy.S
+++ b/libc/sysdeps/x86_64/mempcpy.S
@@ -3,6 +3,6 @@
#define __memcpy_chk __mempcpy_chk
#include <sysdeps/x86_64/memcpy.S>
-libc_hidden_def (BP_SYM (__mempcpy))
-weak_alias (BP_SYM (__mempcpy), BP_SYM (mempcpy))
+libc_hidden_def (__mempcpy)
+weak_alias (__mempcpy, mempcpy)
libc_hidden_builtin_def (mempcpy)
diff --git a/libc/sysdeps/x86_64/multiarch/strcasestr-nonascii.c b/libc/sysdeps/x86_64/multiarch/strcasestr-nonascii.c
index 85b7b3575..032a6420d 100644
--- a/libc/sysdeps/x86_64/multiarch/strcasestr-nonascii.c
+++ b/libc/sysdeps/x86_64/multiarch/strcasestr-nonascii.c
@@ -22,7 +22,7 @@
/* Similar to __m128i_strloadu. Convert to lower case for none-POSIX/C
locale. */
-static inline __m128i
+static __m128i
__m128i_strloadu_tolower (const unsigned char *p)
{
union
diff --git a/libc/sysdeps/x86_64/multiarch/strstr.c b/libc/sysdeps/x86_64/multiarch/strstr.c
index 1cc015d0c..cd63b68c0 100644
--- a/libc/sysdeps/x86_64/multiarch/strstr.c
+++ b/libc/sysdeps/x86_64/multiarch/strstr.c
@@ -82,11 +82,11 @@
5. failed string compare, go back to scanning
*/
+#if !(defined USE_AS_STRCASESTR && defined STRCASESTR_NONASCII)
/* Simple replacement of movdqu to address 4KB boundary cross issue.
If EOS occurs within less than 16B before 4KB boundary, we don't
cross to next page. */
-
-static inline __m128i
+static __m128i
__m128i_strloadu (const unsigned char * p, __m128i zero)
{
if (__builtin_expect ((int) ((size_t) p & 0xfff) > 0xff0, 0))
@@ -99,13 +99,14 @@ __m128i_strloadu (const unsigned char * p, __m128i zero)
}
return _mm_loadu_si128 ((__m128i *) p);
}
+#endif
#if defined USE_AS_STRCASESTR && !defined STRCASESTR_NONASCII
/* Similar to __m128i_strloadu. Convert to lower case for POSIX/C
locale and other which have single-byte letters only in the ASCII
range. */
-static inline __m128i
+static __m128i
__m128i_strloadu_tolower (const unsigned char *p, __m128i zero, __m128i uclow,
__m128i uchigh, __m128i lcqword)
{
diff --git a/libc/sysdeps/x86_64/rtld-strchr.S b/libc/sysdeps/x86_64/rtld-strchr.S
index 37858d1a4..323da6742 100644
--- a/libc/sysdeps/x86_64/rtld-strchr.S
+++ b/libc/sysdeps/x86_64/rtld-strchr.S
@@ -19,12 +19,10 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
.text
-ENTRY (BP_SYM (strchr))
+ENTRY (strchr)
/* Before we start with the main loop we process single bytes
until the source pointer is aligned. This has two reasons:
@@ -284,7 +282,7 @@ ENTRY (BP_SYM (strchr))
6:
nop
retq
-END (BP_SYM (strchr))
+END (strchr)
-weak_alias (BP_SYM (strchr), BP_SYM (index))
+weak_alias (strchr, index)
libc_hidden_builtin_def (strchr)
diff --git a/libc/sysdeps/x86_64/rtld-strlen.S b/libc/sysdeps/x86_64/rtld-strlen.S
index bb23b5508..c459057d1 100644
--- a/libc/sysdeps/x86_64/rtld-strlen.S
+++ b/libc/sysdeps/x86_64/rtld-strlen.S
@@ -19,8 +19,6 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
.text
diff --git a/libc/sysdeps/x86_64/setjmp.S b/libc/sysdeps/x86_64/setjmp.S
index ecb4cc5bb..71788d1e4 100644
--- a/libc/sysdeps/x86_64/setjmp.S
+++ b/libc/sysdeps/x86_64/setjmp.S
@@ -61,10 +61,10 @@ ENTRY (__sigsetjmp)
#else
/* Make a tail call to __sigjmp_save; it takes the same args. */
# ifdef PIC
- jmp C_SYMBOL_NAME (BP_SYM (__sigjmp_save))@PLT
+ jmp C_SYMBOL_NAME (__sigjmp_save)@PLT
# else
- jmp BP_SYM (__sigjmp_save)
+ jmp __sigjmp_save
# endif
#endif
-END (BP_SYM (__sigsetjmp))
+END (__sigsetjmp)
hidden_def (__sigsetjmp)
diff --git a/libc/sysdeps/x86_64/start.S b/libc/sysdeps/x86_64/start.S
index c4d25d061..7cbc15766 100644
--- a/libc/sysdeps/x86_64/start.S
+++ b/libc/sysdeps/x86_64/start.S
@@ -54,7 +54,6 @@
*/
#include <sysdep.h>
-#include "bp-sym.h"
.text
.globl _start
@@ -106,21 +105,21 @@ _start:
mov __libc_csu_fini@GOTPCREL(%rip), %R8_LP
mov __libc_csu_init@GOTPCREL(%rip), %RCX_LP
- mov BP_SYM (main)@GOTPCREL(%rip), %RDI_LP
+ mov 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
+ call __libc_start_main@PLT
#else
/* Pass address of our own entry points to .fini and .init. */
mov $__libc_csu_fini, %R8_LP
mov $__libc_csu_init, %RCX_LP
- mov $BP_SYM (main), %RDI_LP
+ mov $main, %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)
+ call __libc_start_main
#endif
hlt /* Crash if somehow `exit' does return. */
diff --git a/libc/sysdeps/x86_64/strcat.S b/libc/sysdeps/x86_64/strcat.S
index d108750ce..287ffd24c 100644
--- a/libc/sysdeps/x86_64/strcat.S
+++ b/libc/sysdeps/x86_64/strcat.S
@@ -20,12 +20,10 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
.text
-ENTRY (BP_SYM (strcat))
+ENTRY (strcat)
movq %rdi, %rcx /* Dest. register. */
andl $7, %ecx /* mask alignment bits */
movq %rdi, %rax /* Duplicate destination pointer. */
@@ -255,5 +253,5 @@ ENTRY (BP_SYM (strcat))
24:
movq %rdi, %rax /* Source is return value. */
retq
-END (BP_SYM (strcat))
+END (strcat)
libc_hidden_builtin_def (strcat)
diff --git a/libc/sysdeps/x86_64/strcmp.S b/libc/sysdeps/x86_64/strcmp.S
index 843c9e29f..de9ecc909 100644
--- a/libc/sysdeps/x86_64/strcmp.S
+++ b/libc/sysdeps/x86_64/strcmp.S
@@ -21,8 +21,6 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
#undef UPDATE_STRNCMP_COUNTER
@@ -127,7 +125,7 @@ libc_hidden_def (__strncasecmp)
/* FALLTHROUGH to strncasecmp_l. */
#endif
-ENTRY (BP_SYM (STRCMP))
+ENTRY (STRCMP)
#ifdef NOT_IN_libc
/* Simple version since we can't use SSE registers in ld.so. */
L(oop): movb (%rdi), %al
@@ -145,7 +143,7 @@ L(neq): movl $1, %eax
movl $-1, %ecx
cmovbl %ecx, %eax
ret
-END (BP_SYM (STRCMP))
+END (STRCMP)
#else /* NOT_IN_libc */
# ifdef USE_AS_STRCASECMP_L
/* We have to fall back on the C implementation for locales
@@ -2281,7 +2279,7 @@ LABEL(Byte0):
sub %ecx, %eax
ret
-END (BP_SYM (STRCMP))
+END (STRCMP)
.section .rodata,"a",@progbits
.p2align 3
diff --git a/libc/sysdeps/x86_64/strcpy.S b/libc/sysdeps/x86_64/strcpy.S
index 812248c0b..612824700 100644
--- a/libc/sysdeps/x86_64/strcpy.S
+++ b/libc/sysdeps/x86_64/strcpy.S
@@ -19,15 +19,13 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
#ifndef USE_AS_STPCPY
# define STRCPY strcpy
#endif
.text
-ENTRY (BP_SYM (STRCPY))
+ENTRY (STRCPY)
movq %rsi, %rcx /* Source register. */
andl $7, %ecx /* mask alignment bits */
movq %rdi, %rdx /* Duplicate destination pointer. */
@@ -152,7 +150,7 @@ ENTRY (BP_SYM (STRCPY))
movq %rdi, %rax /* Source is return value. */
#endif
retq
-END (BP_SYM (STRCPY))
+END (STRCPY)
#ifndef USE_AS_STPCPY
libc_hidden_builtin_def (strcpy)
#endif
diff --git a/libc/sysdeps/x86_64/strcpy_chk.S b/libc/sysdeps/x86_64/strcpy_chk.S
index a053c6bb5..7e171deef 100644
--- a/libc/sysdeps/x86_64/strcpy_chk.S
+++ b/libc/sysdeps/x86_64/strcpy_chk.S
@@ -20,8 +20,6 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
#ifndef USE_AS_STPCPY_CHK
# define STRCPY_CHK __strcpy_chk
diff --git a/libc/sysdeps/x86_64/strtok.S b/libc/sysdeps/x86_64/strtok.S
index 48c12cf0c..5636d9a62 100644
--- a/libc/sysdeps/x86_64/strtok.S
+++ b/libc/sysdeps/x86_64/strtok.S
@@ -21,8 +21,6 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
/* This file can be used for the strtok and strtok_r functions:
@@ -59,7 +57,7 @@ save_ptr:
#endif
.text
-ENTRY (BP_SYM (FUNCTION))
+ENTRY (FUNCTION)
/* First we create a table with flags for all possible characters.
For the ASCII (7bit/8bit) or ISO-8859-X character sets which are
supported by the C string functions we have 256 characters.
@@ -207,4 +205,4 @@ L(returnNULL):
mov %RDX_LP, SAVE_PTR
jmp L(epilogue)
-END (BP_SYM (FUNCTION))
+END (FUNCTION)
diff --git a/libc/sysdeps/x86_64/strtok_r.S b/libc/sysdeps/x86_64/strtok_r.S
index 8ce0089c7..f0db78c67 100644
--- a/libc/sysdeps/x86_64/strtok_r.S
+++ b/libc/sysdeps/x86_64/strtok_r.S
@@ -1,5 +1,5 @@
#define FUNCTION __strtok_r
#define USE_AS_STRTOK_R 1
#include <sysdeps/x86_64/strtok.S>
-weak_alias (BP_SYM (__strtok_r), BP_SYM (strtok_r))
-strong_alias (BP_SYM (__strtok_r), BP_SYM (__GI___strtok_r))
+weak_alias (__strtok_r, strtok_r)
+strong_alias (__strtok_r, __GI___strtok_r)
diff --git a/libc/time/Versions b/libc/time/Versions
index a7c263008..fd838181e 100644
--- a/libc/time/Versions
+++ b/libc/time/Versions
@@ -1,7 +1,7 @@
libc {
GLIBC_2.0 {
# global variables
- __timezone; __daylight; __tzname;
+ __daylight; __timezone; __tzname;
# functions with special/multiple interfaces
__adjtimex;
@@ -51,13 +51,13 @@ libc {
wcsftime;
}
GLIBC_2.3 {
+ # these internal names are used by libstdc++
+ __strftime_l; __wcsftime_l;
+
# s*
strftime_l;
# w*
wcsftime_l;
-
- # these internal names are used by libstdc++
- __strftime_l; __wcsftime_l;
}
GLIBC_2.3.2 {
strptime_l;
diff --git a/libc/time/mktime.c b/libc/time/mktime.c
index 688969be8..e75132c2e 100644
--- a/libc/time/mktime.c
+++ b/libc/time/mktime.c
@@ -196,7 +196,7 @@ isdst_differ (int a, int b)
The result may overflow. It is the caller's responsibility to
detect overflow. */
-static inline time_t
+static time_t
ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1,
int year0, int yday0, int hour0, int min0, int sec0)
{
diff --git a/libc/time/tzfile.c b/libc/time/tzfile.c
index 0725e2f6f..2e3a7b69b 100644
--- a/libc/time/tzfile.c
+++ b/libc/time/tzfile.c
@@ -24,6 +24,7 @@
#include <time.h>
#include <unistd.h>
#include <sys/stat.h>
+#include <stdint.h>
#define NOID
#include <timezone/tzfile.h>
diff --git a/libc/wcsmbs/Versions b/libc/wcsmbs/Versions
index 10bccc953..1ff5ff305 100644
--- a/libc/wcsmbs/Versions
+++ b/libc/wcsmbs/Versions
@@ -1,7 +1,7 @@
libc {
GLIBC_2.0 {
# functions used in inline functions or macros
- __wcsto*_internal; __mbrlen; __mbrtowc;
+ __mbrlen; __mbrtowc; __wcsto*_internal;
# b*
btowc;
@@ -25,10 +25,10 @@ libc {
wcschrnul; wmempcpy;
}
GLIBC_2.7 {
- __isoc99_wscanf; __isoc99_vwscanf; __isoc99_fwscanf; __isoc99_vfwscanf;
- __isoc99_swscanf; __isoc99_vswscanf;
+ __isoc99_fwscanf; __isoc99_swscanf; __isoc99_vfwscanf; __isoc99_vswscanf;
+ __isoc99_vwscanf; __isoc99_wscanf;
}
GLIBC_2.16 {
- mbrtoc16; c16rtomb; mbrtoc32; c32rtomb;
+ c16rtomb; c32rtomb; mbrtoc16; mbrtoc32;
}
}