summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps')
-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/bits/wchar.h32
-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
309 files changed, 2511 insertions, 3346 deletions
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/bits/wchar.h b/libc/sysdeps/unix/sysv/linux/x86/bits/wchar.h
deleted file mode 100644
index 16b8b77c8..000000000
--- a/libc/sysdeps/unix/sysv/linux/x86/bits/wchar.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* wchar_t type related definitions. i386/x86-64 version.
- Copyright (C) 2000-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 _BITS_WCHAR_H
-#define _BITS_WCHAR_H 1
-
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-# define __WCHAR_MIN (-2147483647 - 1)
-# define __WCHAR_MAX (2147483647)
-#else
-# define __WCHAR_MIN (-2147483647l - 1l)
-# define __WCHAR_MAX (2147483647l)
-#endif
-
-#endif /* bits/wchar.h */
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)