summaryrefslogtreecommitdiff
path: root/libc/ports
diff options
context:
space:
mode:
Diffstat (limited to 'libc/ports')
-rw-r--r--libc/ports/ChangeLog.aarch6431
-rw-r--r--libc/ports/ChangeLog.alpha54
-rw-r--r--libc/ports/ChangeLog.am3320
-rw-r--r--libc/ports/ChangeLog.arm112
-rw-r--r--libc/ports/ChangeLog.hppa7
-rw-r--r--libc/ports/ChangeLog.ia6431
-rw-r--r--libc/ports/ChangeLog.m68k35
-rw-r--r--libc/ports/ChangeLog.mips315
-rw-r--r--libc/ports/ChangeLog.powerpc51
-rw-r--r--libc/ports/ChangeLog.tile16
-rw-r--r--libc/ports/sysdeps/aarch64/libm-test-ulps364
-rw-r--r--libc/ports/sysdeps/aarch64/strncmp.S204
-rw-r--r--libc/ports/sysdeps/aarch64/strnlen.S161
-rw-r--r--libc/ports/sysdeps/aarch64/sysdep.h16
-rw-r--r--libc/ports/sysdeps/alpha/memchr.c3
-rw-r--r--libc/ports/sysdeps/am33/dl-machine.h8
-rw-r--r--libc/ports/sysdeps/am33/elf/start.S8
-rw-r--r--libc/ports/sysdeps/arm/__longjmp.S6
-rw-r--r--libc/ports/sysdeps/arm/arm-mcount.S9
-rw-r--r--libc/ports/sysdeps/arm/crti.S2
-rw-r--r--libc/ports/sysdeps/arm/crtn.S2
-rw-r--r--libc/ports/sysdeps/arm/dl-tlsdesc.S3
-rw-r--r--libc/ports/sysdeps/arm/dl-trampoline.S6
-rw-r--r--libc/ports/sysdeps/arm/frame.h6
-rw-r--r--libc/ports/sysdeps/arm/memcpy.S2
-rw-r--r--libc/ports/sysdeps/arm/memmove.S2
-rw-r--r--libc/ports/sysdeps/arm/memset.S2
-rw-r--r--libc/ports/sysdeps/arm/preconfigure7
-rw-r--r--libc/ports/sysdeps/arm/setjmp.S6
-rw-r--r--libc/ports/sysdeps/arm/strlen.S2
-rw-r--r--libc/ports/sysdeps/arm/sysdep.h63
-rw-r--r--libc/ports/sysdeps/ia64/memchr.S3
-rw-r--r--libc/ports/sysdeps/m68k/Makefile6
-rw-r--r--libc/ports/sysdeps/m68k/backtrace.c159
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps24
-rw-r--r--libc/ports/sysdeps/m68k/memchr.S3
-rw-r--r--libc/ports/sysdeps/mips/__longjmp.c6
-rw-r--r--libc/ports/sysdeps/mips/abort-instr.h6
-rw-r--r--libc/ports/sysdeps/mips/add_n.S2
-rw-r--r--libc/ports/sysdeps/mips/bits/atomic.h45
-rw-r--r--libc/ports/sysdeps/mips/bits/nan.h22
-rw-r--r--libc/ports/sysdeps/mips/bsd-_setjmp.S4
-rw-r--r--libc/ports/sysdeps/mips/bsd-setjmp.S4
-rw-r--r--libc/ports/sysdeps/mips/dl-machine.h102
-rw-r--r--libc/ports/sysdeps/mips/dl-trampoline.c130
-rw-r--r--libc/ports/sysdeps/mips/fpu/e_sqrt.c2
-rw-r--r--libc/ports/sysdeps/mips/fpu/e_sqrtf.c2
-rw-r--r--libc/ports/sysdeps/mips/fpu_control.h11
-rw-r--r--libc/ports/sysdeps/mips/include/sys/asm.h53
-rw-r--r--libc/ports/sysdeps/mips/machine-gmon.h14
-rw-r--r--libc/ports/sysdeps/mips/memset.S1
-rw-r--r--libc/ports/sysdeps/mips/mips32/crti.S2
-rw-r--r--libc/ports/sysdeps/mips/mips32/crtn.S2
-rw-r--r--libc/ports/sysdeps/mips/mips32/fpu/Versions5
-rw-r--r--libc/ports/sysdeps/mips/mips32/fpu/fpu_control.c (renamed from libc/ports/sysdeps/mips/memmove.c)25
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/add_n.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/addmul_1.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/fpu/Makefile5
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/lshift.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/mul_1.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/rshift.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/sub_n.c1
-rw-r--r--libc/ports/sysdeps/mips/mips32/mips16/submul_1.c1
-rw-r--r--libc/ports/sysdeps/mips/mips64/add_n.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/addmul_1.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/bsd-_setjmp.S6
-rw-r--r--libc/ports/sysdeps/mips/mips64/bsd-setjmp.S6
-rw-r--r--libc/ports/sysdeps/mips/mips64/lshift.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/mul_1.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/n32/crti.S2
-rw-r--r--libc/ports/sysdeps/mips/mips64/n32/crtn.S2
-rw-r--r--libc/ports/sysdeps/mips/mips64/n64/crti.S2
-rw-r--r--libc/ports/sysdeps/mips/mips64/n64/crtn.S2
-rw-r--r--libc/ports/sysdeps/mips/mips64/rshift.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/setjmp.S6
-rw-r--r--libc/ports/sysdeps/mips/mips64/sub_n.S8
-rw-r--r--libc/ports/sysdeps/mips/mips64/submul_1.S8
-rw-r--r--libc/ports/sysdeps/mips/nptl/tls.h5
-rw-r--r--libc/ports/sysdeps/mips/preconfigure7
-rw-r--r--libc/ports/sysdeps/mips/setjmp.S4
-rw-r--r--libc/ports/sysdeps/mips/setjmp_aux.c2
-rw-r--r--libc/ports/sysdeps/mips/start.S80
-rw-r--r--libc/ports/sysdeps/mips/sys/asm.h13
-rw-r--r--libc/ports/sysdeps/mips/sys/tas.h5
-rw-r--r--libc/ports/sysdeps/mips/tls-macros.h63
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/fegetenv.c5
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/fesetenv.c5
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/feupdateenv.c5
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c5
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c5
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c5
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/memcmp.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/memcpy.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/memset.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/strcmp.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/strcpy.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/strlen.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/405/strncmp.S6
-rw-r--r--libc/ports/sysdeps/powerpc/powerpc32/476/memset.S6
-rw-r--r--libc/ports/sysdeps/unix/alpha/sysdep.h3
-rw-r--r--libc/ports/sysdeps/unix/arm/sysdep.S9
-rw-r--r--libc/ports/sysdeps/unix/mips/mips32/sysdep.h6
-rw-r--r--libc/ports/sysdeps/unix/mips/mips64/n32/sysdep.h8
-rw-r--r--libc/ports/sysdeps/unix/mips/mips64/n64/sysdep.h8
-rw-r--r--libc/ports/sysdeps/unix/mips/sysdep.S2
-rw-r--r--libc/ports/sysdeps/unix/mips/sysdep.h12
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h25
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/semctl.c6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/am33/brk.c2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/am33/clone.S7
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/Makefile2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/clone.S4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h9
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/mmap.S1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/mmap64.S6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h28
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h314
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c9
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c9
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/pread.c5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/pread64.c5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/pwrite.c5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/sigaction.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/syscall.S1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h183
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/truncate64.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/vfork.S1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c12
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/ia64/umount.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h20
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/brk.c13
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/clone.S20
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/getcontext.S12
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/makecontext.S7
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile13
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h89
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c30
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c32
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c32
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c32
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c32
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c33
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c33
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c33
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist21
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h204
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c7
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h266
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h266
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S8
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h30
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/pread.c10
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/pread64.c10
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/pwrite.c10
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c10
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/setcontext.S9
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/sigaction.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S7
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/ustat.c3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/vfork.S13
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h28
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist3
202 files changed, 3766 insertions, 930 deletions
diff --git a/libc/ports/ChangeLog.aarch64 b/libc/ports/ChangeLog.aarch64
index c7487f5b7..c427f988a 100644
--- a/libc/ports/ChangeLog.aarch64
+++ b/libc/ports/ChangeLog.aarch64
@@ -1,3 +1,34 @@
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+
+2013-02-14 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/libm-test-ulps: Regenerate.
+
+2013-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/aarch64/sigaction.c (__libc_sigaction):
+ Do not use __ptrvalue.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/aarch64/gettimeofday.c: Do not include
+ <bp-checks.h>.
+ (__gettimeofday): Do not use CHECK_1.
+
+2013-01-23 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/strncmp.S: New file.
+
+2013-01-23 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/sysdep.h (ENTRY_ALIGN_AND_PAD): New.
+ * sysdeps/aarch64/strnlen.S: New file.
+
2013-01-17 Marcus Shawcroft <marcus.shawcroft@linaro.org>
* sysdeps/aarch64/strlen.S: New file.
diff --git a/libc/ports/ChangeLog.alpha b/libc/ports/ChangeLog.alpha
index 2284ae3fa..2814559a0 100644
--- a/libc/ports/ChangeLog.alpha
+++ b/libc/ports/ChangeLog.alpha
@@ -1,3 +1,57 @@
+2013-02-19 Richard Henderson <rth@redhat.com>
+
+ [BZ #14920]
+ * sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+ (FUTEX_WAIT_REQUEUE_PI): Define.
+ (FUTEX_CMP_REQUEUE_PI): Likewise.
+ (lll_futex_wait_requeue_pi): Likewise.
+ (lll_futex_timed_wait_requeue_pi): Likewise.
+ (lll_futex_cmp_requeue_pi): Likewise.
+
+2013-02-20 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/unix/alpha/sysdep.h: Include <errno.h>.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+
+2013-02-14 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/alpha/memchr.c: Do not include <bp-sym.h>.
+ (memchr): Do not use BP_SYM in weak_alias.
+
+2013-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/alpha/sigaction.c
+ (__syscall_rt_sigaction): Do not use __unbounded in prototype.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/alpha/fdatasync.c: Don't include
+ <bp-checks.h>.
+ * sysdeps/unix/sysv/linux/alpha/gethostname.c: Likewise.
+ (__gethostname): Don't use CHECK_N.
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/alpha/msgctl.c: Do not include
+ <bp-checks.h>.
+ (__new_msgctl): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/alpha/shmctl.c: Do not include
+ <bp-checks.h>.
+ (__new_shmctl): Do not use CHECK_1.
+
+2013-01-31 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/alpha/semctl.c: Don't include
+ <bp-checks.h> and <bp-semctl.h>.
+ (__new_semctl): Don't use CHECK_SEMCTL.
+
2013-01-08 Andreas Jaeger <aj@suse.de>
[BZ# 14985]
diff --git a/libc/ports/ChangeLog.am33 b/libc/ports/ChangeLog.am33
index 015fa9066..2bb7893f9 100644
--- a/libc/ports/ChangeLog.am33
+++ b/libc/ports/ChangeLog.am33
@@ -1,3 +1,23 @@
+2013-02-28 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/am33/elf/start.S: Don't include "bp-sym.h".
+ (_start): Don't use BP_SYM.
+ * sysdeps/unix/sysv/linux/am33/clone.S: Don't include <bp-sym.h>.
+ (__clone): Don't use BP_SYM.
+
+2013-02-14 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/am33/dl-machine.h [!PROF && !__BOUNDED_POINTERS__]:
+ Remove __BOUNDED_POINTERS__ from condition.
+
+2013-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/am33/dl-machine.h (fixup): Do not use __unbounded.
+ * sysdeps/unix/sysv/linux/am33/brk.c (__brk): Do not use
+ __ptrvalue.
+
2013-01-02 Joseph Myers <joseph@codesourcery.com>
* All files with FSF copyright notices: Update copyright dates
diff --git a/libc/ports/ChangeLog.arm b/libc/ports/ChangeLog.arm
index d44ea7624..28ec8f96a 100644
--- a/libc/ports/ChangeLog.arm
+++ b/libc/ports/ChangeLog.arm
@@ -1,3 +1,115 @@
+2013-02-28 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/arm/preconfigure: Adjust scan for __ARM_ARCH_* defines.
+
+ * sysdeps/arm/preconfigure: Handle __ARM_ARCH_6*__.
+
+ * sysdeps/unix/sysv/linux/arm/Makefile [elf] (sysdep-rtld-routines):
+ Include libc-do-syscall.
+
+ * sysdeps/arm/sysdep.h: Fix assembly whitespace.
+ * ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h: Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise.
+
+ * sysdeps/arm/sysdep.h (PC_OFS): New macros.
+ * sysdeps/arm/__longjmp.S (__longjmp): Use PC_OFS.
+ * sysdeps/arm/setjmp.S (__sigsetjmp): Likewise.
+ * sysdeps/unix/arm/sysdep.S (__syscall_error): Likewise.
+ * sysdeps/unix/sysv/linux/arm/getcontext.S (__getcontext): Likewise.
+ * sysdeps/unix/sysv/linux/arm/setcontext.S (__startcontext): Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+ (SINGLE_THREAD_P): Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h
+ (SYSCALL_ERROR_HANDLER): Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+ (_Unwind_Resume): Use stringified PC_OFS.
+ * sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+ (_Unwind_Resume): Likewise.
+
+ * ports/sysdeps/arm/arm-mcount.S: Always use unified syntax and
+ always add IT markup.
+ * sysdeps/unix/sysv/linux/arm/mmap64.S (__mmap64): Likewise.
+ * sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Add IT markup.
+ * sysdeps/unix/arm/sysdep.S (__syscall_error): Likewise.
+ * sysdeps/unix/sysv/linux/arm/clone.S (__clone): Likewise.
+ * sysdeps/unix/sysv/linux/arm/mmap.S (__mmap): Likewise.
+ * sysdeps/unix/sysv/linux/arm/syscall.S (syscall): Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h (PSEUDO_RET): Likewise.
+ * sysdeps/unix/sysv/linux/arm/vfork.S (__vfork): Likewise.
+
+ * ports/sysdeps/arm/__longjmp.S: Define NO_THUMB before <sysdep.h>
+ * sysdeps/arm/crti.S, sysdeps/arm/crtn.S: Likewise.
+ * sysdeps/arm/dl-trampoline.S: Likewise.
+ * sysdeps/arm/memcpy.S: Likewise.
+ * sysdeps/arm/memmove.S: Likewise.
+ * sysdeps/arm/memset.S: Likewise.
+ * sysdeps/arm/setjmp.S: Likewise.
+ * sysdeps/arm/strlen.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/____longjmp_chk.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/setcontext.S: Likewise.
+
+2013-02-27 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/arm/sysdep.h (CFI_SECTIONS): New macro.
+ (ENTRY): Use it.
+ * sysdeps/arm/dl-tlsdesc.S: Likewise.
+ * sysdeps/arm/dl-trampoline.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h (PSEUDO): Likewise.
+
+2013-02-18 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14920]
+ * sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+ (FUTEX_WAIT_REQUEUE_PI): Define.
+ (FUTEX_CMP_REQUEUE_PI): Likewise.
+ (lll_futex_wait_requeue_pi): Likewise.
+ (lll_futex_timed_wait_requeue_pi): Likewise.
+ (lll_futex_cmp_requeue_pi): Likewise.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/arm/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+
+2013-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/arm/frame.h (struct layout): Do not use __unbounded.
+ * sysdeps/unix/sysv/linux/arm/sigaction.c (__libc_sigaction): Do
+ not use __ptrvalue.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/arm/pread.c: Don't include
+ <bp-checks.h>.
+ (__libc_pread): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/arm/pread64.c: Don't include
+ <bp-checks.h>.
+ (__libc_pread64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/arm/pwrite.c: Don't include
+ <bp-checks.h>.
+ (__libc_pwrite): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/arm/pwrite64.c: Don't include
+ <bp-checks.h>.
+ (__libc_pwrite64): Don't use CHECK_N.
+
+2013-02-08 Carlos O'Donell <carlos@redhat.com>
+
+ [BZ #15006]
+ * sysdeps/unix/sysv/linux/arm/dl-cache.h
+ [__ARM_PCS_VFP] (_dl_cache_check_flags): Allow plain FLAG_ELF_LIBC6.
+ [!__ARM_PCS_VFP] (_dl_cache_check_flags): Likewise.
+ * sysdeps/unix/sysv/linux/arm/readelflib.c (process_elf_file):
+ Set FLAG_ARM_LIBSF for soft-float ABI otherwise just FLAG_ELF_LIBC6.
+
+2013-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/arm/truncate64.c: Do not include
+ <bp-checks.h>.
+ (truncate64): Do not use CHECK_STRING.
+
2013-01-02 Joseph Myers <joseph@codesourcery.com>
* All files with FSF copyright notices: Update copyright dates
diff --git a/libc/ports/ChangeLog.hppa b/libc/ports/ChangeLog.hppa
index ef904c267..6314f1269 100644
--- a/libc/ports/ChangeLog.hppa
+++ b/libc/ports/ChangeLog.hppa
@@ -1,3 +1,10 @@
+2013-02-14 Carlos O'Donell <carlos@redhat.com>
+
+ * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
+ (lll_unlock_wake_cb): Remove.
+ * ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:
+ Remove prototype for lll_unlock_wake_cb.
+
2013-01-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/hppa/fpu/fpu_control.h (_FPU_GETCW): Use __extension__
diff --git a/libc/ports/ChangeLog.ia64 b/libc/ports/ChangeLog.ia64
index 28d507675..d9fda457f 100644
--- a/libc/ports/ChangeLog.ia64
+++ b/libc/ports/ChangeLog.ia64
@@ -1,3 +1,34 @@
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/ia64/sigaction.c: Do not include
+ <bp-checks.h>.
+ (__libc_sigaction): Do not use CHECK_1_NULL_OK.
+
+2013-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/ia64/memchr.S [!__BOUNDED_POINTERS__] (__ubp_memchr):
+ Remove alias.
+ * sysdeps/unix/sysv/linux/ia64/umount.c: Do not include
+ <bp-checks.h>.
+ (umount): Do not use CHECK_STRING.
+
+2013-01-31 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/ia64/sigpending.c: Don't include
+ <bp-checks.h>.
+ (sigpending): Don't use CHECK_SIGSET.
+ * sysdeps/unix/sysv/linux/ia64/sigprocmask.c: Don't include
+ <bp-checks.h>.
+ (__sigprocmask): Don't use CHECK_SIGSET and CHECK_SIGSET_NULL_OK.
+
2013-01-02 Joseph Myers <joseph@codesourcery.com>
* All files with FSF copyright notices: Update copyright dates
diff --git a/libc/ports/ChangeLog.m68k b/libc/ports/ChangeLog.m68k
index 20eaac716..e7cb81e8f 100644
--- a/libc/ports/ChangeLog.m68k
+++ b/libc/ports/ChangeLog.m68k
@@ -1,3 +1,38 @@
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist:
+ Likewise.
+
+2013-02-08 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/kernel-features.h
+ (__ASSUME_O_CLOEXEC): Define for 2.6.23 or later.
+ (__ASSUME_SOCK_CLOEXEC, __ASSUME_IN_NONBLOCK, __ASSUME_PIPE2)
+ (__ASSUME_EVENTFD2, __ASSUME_SIGNALFD4, __ASSUME_DUP3): Define for
+ 2.6.27 or later.
+ (__ASSUME_ACCEPT4): Define for 2.6.28 or later.
+
+2013-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/m68k/memchr.S [!__BOUNDED_POINTERS__] (__ubp_memchr):
+ Remove alias.
+
+2013-01-20 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update.
+
+ * sysdeps/m68k/Makefile (CFLAGS-backtrace.c): Add -funwind-tables.
+
+2013-01-19 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/backtrace.c: New file.
+
+ * sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h: New file.
+ * sysdeps/unix/sysv/linux/m68k/syscalls.list: Add waitpid.
+
2013-01-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/m68k/bits/byteswap.h (__bswap_64): Use __extension__
diff --git a/libc/ports/ChangeLog.mips b/libc/ports/ChangeLog.mips
index 9e2bcffc6..251806572 100644
--- a/libc/ports/ChangeLog.mips
+++ b/libc/ports/ChangeLog.mips
@@ -1,3 +1,318 @@
+2013-02-27 Chung-Lin Tang <cltang@codesourcery.com>
+ Maciej W. Rozycki <macro@codesourcery.com>
+ Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * sysdeps/mips/abort-instr.h (ABORT_INSTRUCTION) [__mips16]:
+ New macro.
+ * sysdeps/mips/dl-machine.h (elf_machine_load_address): Add
+ MIPS16 version of assembly code.
+ (RTLD_START) [__mips16]: New macro.
+ * sysdeps/mips/fpu_control.h (__mips_fpu_getcw): New prototype.
+ (__mips_fpu_setcw): Likewise.
+ (_FPU_GETCW) [__mips16]: New macro.
+ (_FPU_SETCW) [__mips16]: Likewise.
+ * sysdeps/mips/machine-gmon.h (MCOUNT): Add `.set nomips16'.
+ * sysdeps/mips/tls-macros.h (LOAD_GP) [__mips16]: New macro.
+ (TLS_GD, TLS_LD, TLS_IE, TLS_LE) [__mips16]: Likewise.
+ * sysdeps/mips/bits/atomic.h: Also use __atomic_* builtins with
+ GCC 4.7 in MIPS16 code.
+ (atomic_compare_and_exchange_val_acq) [__mips16]: New macro.
+ (atomic_compare_and_exchange_bool_acq) [__mips16]: Likewise.
+ (atomic_exchange_acq) [__mips16]: Likewise.
+ (atomic_exchange_and_add) [__mips16]: Likewise.
+ (atomic_bit_test_set) [__mips16]: Likewise.
+ (atomic_and, atomic_and_val) [__mips16]: Likewise.
+ (atomic_or, atomic_or_val) [__mips16]: Likewise.
+ (atomic_full_barrier) [__mips16]: Likewise.
+ * sysdeps/mips/nptl/tls.h (READ_THREAD_POINTER) [__mips16]:
+ Likewise.
+ * sysdeps/mips/sys/tas.h (_test_and_set): Add `__nomips16__'
+ attribute.
+ * sysdeps/unix/mips/sysdep.h (PSEUDO_NOERRNO): Add
+ `.set nomips16'.
+ (PSEUDO_ERRVAL): Likewise.
+ * sysdeps/unix/mips/mips32/sysdep.h (PSEUDO): Likewise.
+ * sysdeps/unix/mips/mips64/n32/sysdep.h (PSEUDO): Likewise.
+ * sysdeps/unix/mips/mips64/n64/sysdep.h (PSEUDO): Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+ (INTERNAL_SYSCALL, INTERNAL_SYSCALL_NCS) [__mips16]: New macros.
+ (INTERNAL_SYSCALL_MIPS16) [__mips16]: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h (PSEUDO):
+ Add `.set nomips16'.
+ * sysdeps/mips/bsd-_setjmp.S (_setjmp): Likewise.
+ * sysdeps/mips/bsd-setjmp.S (setjmp): Likewise.
+ * sysdeps/mips/memset.S (memset): Likewise.
+ * sysdeps/mips/setjmp.S (__sigsetjmp): Likewise.
+ * sysdeps/mips/start.S (ENTRY_POINT) [__mips16]: New function.
+ * sysdeps/mips/mips32/crti.S: Add `.set nomips16'.
+ * sysdeps/mips/mips32/crtn.S: Likewise.
+ * sysdeps/mips/mips64/n32/crti.S: Likewise.
+ * sysdeps/mips/mips64/n32/crtn.S: Likewise.
+ * sysdeps/mips/mips64/n64/crti.S: Likewise.
+ * sysdeps/mips/mips64/n64/crtn.S: Likewise.
+ * sysdeps/unix/mips/sysdep.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/clone.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/getcontext.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/makecontext.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/setcontext.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/swapcontext.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/vfork.S: Likewise.
+ * sysdeps/mips/__longjmp.c (__longjmp): Rename function to...
+ (____longjmp): ... this. Make static and add `nomips16'
+ attribute.
+ (__longjmp): New alias.
+ * sysdeps/mips/dl-trampoline.c (_dl_runtime_resolve) [__mips16]:
+ New function.
+ (_dl_runtime_pltresolve): Likewise.
+ * sysdeps/mips/setjmp_aux.c (__sigsetjmp_aux): Add `nomips16'
+ attribute.
+ * sysdeps/mips/fpu/e_sqrt.c (__ieee754_sqrt): Likewise.
+ * sysdeps/mips/fpu/e_sqrtf.c (__ieee754_sqrtf): Likewise.
+ * sysdeps/unix/sysv/linux/mips/brk.c (__brk): Rewrite in terms
+ of INTERNAL_SYSCALL.
+ * sysdeps/mips/mips32/fpu/fpu_control.c: New file.
+ * sysdeps/mips/mips32/mips16/add_n.c: New file.
+ * sysdeps/mips/mips32/mips16/addmul_1.c: New file.
+ * sysdeps/mips/mips32/mips16/lshift.c: New file.
+ * sysdeps/mips/mips32/mips16/mul_1.c: New file.
+ * sysdeps/mips/mips32/mips16/rshift.c: New file.
+ * sysdeps/mips/mips32/mips16/sub_n.c: New file.
+ * sysdeps/mips/mips32/mips16/submul_1.c: New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c:
+ New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c:
+ New file.
+ * sysdeps/mips/mips32/fpu/Versions: New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions: New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist: New
+ file.
+ * sysdeps/mips/mips32/mips16/fpu/Makefile: New file.
+ * sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile: New file.
+ * sysdeps/mips/preconfigure: Handle o32 MIPS16 compilation.
+
+2013-02-20 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/mips/bits/nan.h [!__GNUC__] (__nan_union): Change
+ __attribute__ ((unused)) to __attribute__ ((__unused__)).
+
+ * sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist: Sort
+ properly.
+
+ * sysdeps/mips/bits/nan.h [!__GNUC__] (__nan_union): Change
+ __attribute_used__ to __attribute__ ((unused)).
+
+ * sysdeps/mips/bits/nan.h [!__GNUC__] (__nan_union): Add
+ __attribute_used__.
+
+ * sysdeps/mips/bits/nan.h: Align to generic IEEE 754 file.
+
+2013-02-19 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14920]
+ * sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
+ (FUTEX_WAIT_REQUEUE_PI): Define.
+ (FUTEX_CMP_REQUEUE_PI): Likewise.
+ (lll_futex_wait_requeue_pi): Likewise.
+ (lll_futex_timed_wait_requeue_pi): Likewise.
+ (lll_futex_cmp_requeue_pi): Likewise.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist: Add
+ __cxa_thread_atexit_impl.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist:
+ Likewise.
+
+2013-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c (__fxstat64): Do
+ not use __ptrvalue.
+ * sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c (__fxstatat64):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c (__lxstat64):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/xstat64.c (__xstat64):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/sigaction.c (__libc_sigaction):
+ Likewise.
+
+2013-02-11 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/mips/include/sys/asm.h: New file.
+ * sysdeps/mips/mips64/bsd-_setjmp.S (_setjmp): Use SETUP_GP64_REG
+ and RESTORE_GP64_REG.
+ * sysdeps/mips/mips64/bsd-setjmp.S (setjmp): Likewise.
+ * sysdeps/mips/mips64/setjmp.S (__sigsetjmp): Likewise.
+ * sysdeps/mips/sys/asm.h (__mips_cfi_startproc): Define to empty.
+ (__mips_cfi_endproc): Likewise.
+ (LEAF): Use __mips_cfi_startproc.
+ (NESTED): Likewise.
+ (END): Use __mips_cfi_endproc.
+ (EXPORT): Use __mips_cfi_startproc.
+ * sysdeps/unix/mips/mips32/sysdep.h (PSEUDO): Add CFI information
+ for error-handling code in both definitions.
+ * sysdeps/unix/mips/mips64/n32/sysdep.h (PSEUDO): Likewise.
+ * sysdeps/unix/mips/mips64/n64/sysdep.h (PSEUDO): Likewise.
+ * sysdeps/unix/mips/sysdep.h (ENTRY): Use cfi_startproc.
+ (END): Use cfi_endproc.
+ (PSEUDO_END): Likewise.
+ (PSEUDO_END_NOERRNO): Likewise.
+ (PSEUDO_END_ERRVAL): Likewise.
+ * sysdeps/unix/sysv/linux/mips/clone.S (__clone): Add CFI
+ information. Use SETUP_GP64_STACK and RESTORE_GP64_STACK.
+ * sysdeps/unix/sysv/linux/mips/getcontext.S (__getcontext):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/makecontext.S (__makecontext):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl): Use
+ SETUP_GP64_REG and RESTORE_GP64_REG.
+ * sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
+ [(!NOT_IN_libc || IS_IN_libpthread || IS_IN_librt) && __PIC__]
+ (PSEUDO): Use cfi_endproc before ENTRY.
+ * sysdeps/unix/sysv/linux/mips/mips64/syscall.S (syscall): Add CFI
+ information. Use SETUP_GP64_REG and RESTORE_GP64_REG.
+ * sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h [(!NOT_IN_libc
+ || IS_IN_libpthread || IS_IN_librt) && __PIC__] (PSEUDO): Use
+ cfi_endproc before ENTRY.
+ * sysdeps/unix/sysv/linux/mips/setcontext.S (__setcontext): Add
+ CFI information. Use SETUP_GP64_STACK and RESTORE_GP64_STACK.
+ * sysdeps/unix/sysv/linux/mips/swapcontext.S (__swapcontext):
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/vfork.S (__vfork): Add CFI
+ information. Use SETUP_GP64_REG and RESTORE_GP64_REG.
+
+2013-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c: Don't include
+ <bp-checks.h>.
+ * sysdeps/unix/sysv/linux/mips/pread.c: Likewise.
+ (__libc_pread): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/mips/pread64.c: Don't include
+ <bp-checks.h>.
+ (__libc_pread64): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/mips/pwrite.c: Don't include
+ <bp-checks.h>.
+ (__libc_pwrite): Don't use CHECK_N.
+ * sysdeps/unix/sysv/linux/mips/pwrite64.c: Don't include
+ <bp-checks.h>.
+ (__libc_pwrite64): Don't use CHECK_N.
+
+ * sysdeps/mips/add_n.S (__mpn_add_n): Use END.
+ * sysdeps/mips/bsd-_setjmp.S (_setjmp): Likewise.
+ * sysdeps/mips/bsd-setjmp.S (setjmp): Likewise.
+ * sysdeps/mips/mips64/add_n.S (__mpn_add_n): Use ENTRY and END.
+ * sysdeps/mips/mips64/addmul_1.S (__mpn_addmul_1): Likewise.
+ * sysdeps/mips/mips64/bsd-_setjmp.S (_setjmp): Use END.
+ * sysdeps/mips/mips64/bsd-setjmp.S (setjmp): Likewise.
+ * sysdeps/mips/mips64/lshift.S (__mpn_lshift): Use ENTRY and END.
+ * sysdeps/mips/mips64/mul_1.S (__mpn_mul_1): Likewise.
+ * sysdeps/mips/mips64/rshift.S (__mpn_rshift): Likewise.
+ * sysdeps/mips/mips64/setjmp.S (__sigsetjmp): Use END.
+ * sysdeps/mips/mips64/sub_n.S (__mpn_sub_n): Use ENTRY and END.
+ * sysdeps/mips/mips64/submul_1.S (__mpn_submul_1): Likewise.
+ * sysdeps/mips/setjmp.S (__sigsetjmp): Use END.
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/mips/mips64/msgctl.c: Do not include
+ <bp-checks.h>.
+ (__msgctl): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/mips/mips64/shmctl.c: Do not include
+ <bp-checks.h>.
+ (__shmctl): Do not use CHECK_1.
+ * sysdeps/unix/sysv/linux/mips/ustat.c: Do not include
+ <bp-checks.h>.
+ (ustat): Do not use CHECK_1.
+
+2013-02-05 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Add a missing
+ space in asm register specifiers throughout.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
+
+ [BZ #15054]
+ * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (MOVE32):
+ New macro.
+ (INTERNAL_SYSCALL_NCS): Use it. Rewrite to respect the syscall
+ restart convention.
+ (INTERNAL_SYSCALL): Rewrite to respect the syscall restart
+ convention.
+ (internal_syscall0, internal_syscall1): Likewise.
+ (internal_syscall2, internal_syscall3): Likewise.
+ (internal_syscall4, internal_syscall5): Likewise.
+ (internal_syscall6, internal_syscall7): Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (MOVE32):
+ New macro.
+ (INTERNAL_SYSCALL_NCS): Use it. Rewrite to respect the syscall
+ restart convention.
+ (INTERNAL_SYSCALL): Rewrite to respect the syscall restart
+ convention.
+ (internal_syscall0, internal_syscall1): Likewise.
+ (internal_syscall2, internal_syscall3): Likewise.
+ (internal_syscall4, internal_syscall5): Likewise.
+ (internal_syscall6): Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (MOVE32):
+ New macro.
+ (INTERNAL_SYSCALL_NCS): Use it. Rewrite to respect the syscall
+ restart convention.
+ (INTERNAL_SYSCALL): Rewrite to respect the syscall restart
+ convention.
+ (internal_syscall0, internal_syscall1): Likewise.
+ (internal_syscall2, internal_syscall3): Likewise.
+ (internal_syscall4, internal_syscall5): Likewise.
+ (internal_syscall6): Likewise.
+
+2013-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/mips/mips32/truncate64.c: Do not include
+ <bp-checks.h>.
+ (truncate64): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c: Do not include
+ <bp-checks.h>.
+ (__fxstatat64): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c: Do not include
+ <bp-checks.h>.
+ (__lxstat64): Do not use CHECK_STRING.
+ * sysdeps/unix/sysv/linux/mips/mips64/xstat64.c: Do not include
+ <bp-checks.h>.
+ (__xstat64): Do not use CHECK_STRING.
+
+2013-01-31 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/unix/sysv/linux/mips/mips64/semctl.c: Don't include
+ <bp-checks.h> and <bp-semctl.h>.
+ (__semctl): Don't use CHECK_SEMCTL.
+
+2013-01-29 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Correct
+ whitespace damage throughout.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
+
+2013-01-25 Steve Ellcey <sellcey@mips.com>
+
+ * sysdeps/mips/memmove.c: Remove.
+
2013-01-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/bits/sigcontext.h (struct
diff --git a/libc/ports/ChangeLog.powerpc b/libc/ports/ChangeLog.powerpc
index 2746f3766..2ba8e3754 100644
--- a/libc/ports/ChangeLog.powerpc
+++ b/libc/ports/ChangeLog.powerpc
@@ -1,3 +1,54 @@
+2013-02-28 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/powerpc/powerpc32/405/memcmp.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (memcmp): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/memcpy.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (memcpy): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/memset.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (memset): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/strcmp.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (strcmp): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/strcpy.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (strcpy): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/strlen.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (strlen): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/405/strncmp.S: Don't include
+ <bp-sym.h> and <bp-asm.h>.
+ (strncmp): Don't use BP_SYM.
+ * sysdeps/powerpc/powerpc32/476/memset.S: Don't include <bp-sym.h>
+ and <bp-asm.h>.
+ (memset): Don't use BP_SYM.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist:
+ Add __cxa_thread_atexit_impl.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist:
+ Likewise.
+
+2013-02-14 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13550]
+ * sysdeps/powerpc/nofpu/fegetenv.c: Do not include <bp-sym.h>.
+ (fegetenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/nofpu/fesetenv.c: Do not include <bp-sym.h>.
+ (fesetenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/nofpu/feupdateenv.c: Do not include <bp-sym.h>.
+ (feupdateenv): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/nofpu/fgetexcptflg.c: Do not include <bp-sym.h>.
+ (fegetexceptflag): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/nofpu/fraiseexcpt.c: Do not include <bp-sym.h>.
+ (feraiseexcept): Do not use BP_SYM in versioned symbols.
+ * sysdeps/powerpc/nofpu/fsetexcptflg.c: Do not include <bp-sym.h>.
+ (fesetexceptflag): Do not use BP_SYM in versioned symbols.
+
2013-01-02 Joseph Myers <joseph@codesourcery.com>
* All files with FSF copyright notices: Update copyright dates
diff --git a/libc/ports/ChangeLog.tile b/libc/ports/ChangeLog.tile
index a5eaec3a9..6184bf6a0 100644
--- a/libc/ports/ChangeLog.tile
+++ b/libc/ports/ChangeLog.tile
@@ -1,3 +1,19 @@
+2013-02-28 Chris Metcalf <cmetcalf@tilera.com>
+
+ * sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
+ (FUTEX_WAIT_REQUEUE_PI): Define.
+ (FUTEX_CMP_REQUEUE_PI): Likewise.
+ (lll_futex_wait_requeue_pi): Likewise.
+ (lll_futex_timed_wait_requeue_pi): Likewise.
+ (lll_futex_cmp_requeue_pi): Likewise.
+
+2013-02-18 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist:
+ Add __cxa_thread_atexit_impl.
+ * sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist:
+ Likewise.
+
2013-01-10 Chris Metcalf <cmetcalf@tilera.com>
* sysdeps/unix/sysv/linux/tile/tilegx/ldd-rewrite.sed: New file.
diff --git a/libc/ports/sysdeps/aarch64/libm-test-ulps b/libc/ports/sysdeps/aarch64/libm-test-ulps
index eda0e77f8..aebc46f46 100644
--- a/libc/ports/sysdeps/aarch64/libm-test-ulps
+++ b/libc/ports/sysdeps/aarch64/libm-test-ulps
@@ -146,6 +146,8 @@ ldouble: 2
Test "Imaginary part of: cacos (+0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (+0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i":
double: 1
float: 1
@@ -182,6 +184,8 @@ ldouble: 2
Test "Imaginary part of: cacos (-0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (-0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i":
double: 1
float: 1
@@ -194,6 +198,74 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "Real part of: cacos (-0.5 + +0 i) == 2.094395102393195492308428922186335256131 - 0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-0.5 - 0 i) == 2.094395102393195492308428922186335256131 + +0 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-1025 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-1025 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442100 - 1.194763217287109304111930828519090523536 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442100 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442100 + 1.194763217287109304111930828519090523536 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442100 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-16385 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1.fp-16385 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1p500 + 1.0 i) == 3.141592653589793238462643383279502884197 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1p500 - 1.0 i) == 3.141592653589793238462643383279502884197 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1p5000 + 1.0 i) == 3.141592653589793238462643383279502884197 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0x1p5000 - 1.0 i) == 3.141592653589793238462643383279502884197 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-1.0 + 0x1p50 i) == 1.570796326794897507409741391764983781004 - 3.535050620855721078027883819436759661753e1 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-1.0 + 0x1p500 i) == 1.570796326794896619231321691639751442099 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.0 + 0x1p5000 i) == 1.570796326794896619231321691639751442099 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (-1.0 - 0x1p50 i) == 1.570796326794897507409741391764983781004 + 3.535050620855721078027883819436759661753e1 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-1.0 - 0x1p500 i) == 1.570796326794896619231321691639751442099 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.0 - 0x1p5000 i) == 1.570796326794896619231321691639751442099 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (-1.5 + +0 i) == pi - 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -201,6 +273,11 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: cacos (-2 - 3 i) == 2.1414491111159960199416055713254211 + 1.9833870299165354323470769028940395 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: cacos (0.5 + +0 i) == 1.047197551196597746154214461093167628066 - 0 i":
double: 1
idouble: 1
@@ -214,6 +291,65 @@ ldouble: 1
Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-1025 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-1025 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-129 + 1.5 i) == 1.570796326794896619231321691639751442097 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-129 - 1.5 i) == 1.570796326794896619231321691639751442097 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-16385 + 1.5 i) == 1.570796326794896619231321691639751442099 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp-16385 - 1.5 i) == 1.570796326794896619231321691639751442099 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 - 7.107906849659093345062145442726115449315e2 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (0x1.fp127 + 0x1.fp127 i) == 7.853981633974483096156608458198757210493e-1 - 8.973081118419833726837456344608533993585e1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (0x1.fp16383 + 0x1.fp16383 i) == 7.853981633974483096156608458198757210493e-1 - 1.135753137836666928715489992987020363057e4 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1p500 + 1.0 i) == 3.054936363499604682051979393213617699789e-151 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1p500 - 1.0 i) == 3.054936363499604682051979393213617699789e-151 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1p5000 + 1.0 i) == 7.079811261048172892385615158694057552948e-1506 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1p5000 - 1.0 i) == 7.079811261048172892385615158694057552948e-1506 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.0 + 0x1p500 i) == 1.570796326794896619231321691639751442099 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.0 + 0x1p5000 i) == 1.570796326794896619231321691639751442099 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.0 - 0x1p500 i) == 1.570796326794896619231321691639751442099 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (1.0 - 0x1p5000 i) == 1.570796326794896619231321691639751442099 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (1.5 + +0 i) == +0 - 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -332,6 +468,8 @@ ldouble: 2
Test "Imaginary part of: casin (+0 - 0.5 i) == +0 - 0.4812118250596034474977589134243684231352 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (+0 - 1.0 i) == +0 - 0.8813735870195430252326093249797923090282 i":
double: 1
float: 1
@@ -368,6 +506,8 @@ ldouble: 2
Test "Imaginary part of: casin (-0 - 0.5 i) == -0 - 0.4812118250596034474977589134243684231352 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (-0 - 1.0 i) == -0 - 0.8813735870195430252326093249797923090282 i":
double: 1
float: 1
@@ -380,6 +520,56 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-1025 + 1.5 i) == -2.989196569048182929051881765490354365918e-309 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-1025 - 1.5 i) == -2.989196569048182929051881765490354365918e-309 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-129 + 1.5 i) == -1.579176199917649005841160751101628985741e-39 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-129 - 1.5 i) == -1.579176199917649005841160751101628985741e-39 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-16385 + 1.5 i) == -4.516698239814521372306784062043266700598e-4933 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1.fp-16385 - 1.5 i) == -4.516698239814521372306784062043266700598e-4933 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1p500 + 1.0 i) == -1.570796326794896619231321691639751442099 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1p500 - 1.0 i) == -1.570796326794896619231321691639751442099 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1p5000 + 1.0 i) == -1.570796326794896619231321691639751442099 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0x1p5000 - 1.0 i) == -1.570796326794896619231321691639751442099 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.0 + 0x1p500 i) == -3.054936363499604682051979393213617699789e-151 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.0 + 0x1p5000 i) == -7.079811261048172892385615158694057552948e-1506 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.0 - 0x1p500 i) == -3.054936363499604682051979393213617699789e-151 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.0 - 0x1p5000 i) == -7.079811261048172892385615158694057552948e-1506 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (-1.5 + +0 i) == -pi/2 + 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -395,6 +585,65 @@ ifloat: 1
Test "Imaginary part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-1025 + 1.5 i) == 2.989196569048182929051881765490354365918e-309 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-1025 - 1.5 i) == 2.989196569048182929051881765490354365918e-309 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-129 + 1.5 i) == 1.579176199917649005841160751101628985741e-39 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-129 - 1.5 i) == 1.579176199917649005841160751101628985741e-39 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-16385 + 1.5 i) == 4.516698239814521372306784062043266700598e-4933 + 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp-16385 - 1.5 i) == 4.516698239814521372306784062043266700598e-4933 - 1.194763217287109304111930828519090523536 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 + 7.107906849659093345062145442726115449315e2 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (0x1.fp127 + 0x1.fp127 i) == 7.853981633974483096156608458198757210493e-1 + 8.973081118419833726837456344608533993585e1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (0x1.fp16383 + 0x1.fp16383 i) == 7.853981633974483096156608458198757210493e-1 + 1.135753137836666928715489992987020363057e4 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1p500 + 1.0 i) == 1.570796326794896619231321691639751442099 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1p500 - 1.0 i) == 1.570796326794896619231321691639751442099 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1p5000 + 1.0 i) == 1.570796326794896619231321691639751442099 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1p5000 - 1.0 i) == 1.570796326794896619231321691639751442099 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.0 + 0x1p500 i) == 3.054936363499604682051979393213617699789e-151 + 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.0 + 0x1p5000 i) == 7.079811261048172892385615158694057552948e-1506 + 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.0 - 0x1p500 i) == 3.054936363499604682051979393213617699789e-151 - 3.472667374605326000180332928505464606058e2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (1.0 - 0x1p5000 i) == 7.079811261048172892385615158694057552948e-1506 - 3.466429049980286492395577839412341016946e3 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casin (1.5 + +0 i) == pi/2 + 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -432,6 +681,18 @@ idouble: 2
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (-0x1p500 + 1.0 i) == -3.472667374605326000180332928505464606058e2 + 3.054936363499604682051979393213617699789e-151 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1p500 - 1.0 i) == -3.472667374605326000180332928505464606058e2 - 3.054936363499604682051979393213617699789e-151 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1p5000 + 1.0 i) == -3.466429049980286492395577839412341016946e3 + 7.079811261048172892385615158694057552948e-1506 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0x1p5000 - 1.0 i) == -3.466429049980286492395577839412341016946e3 - 7.079811261048172892385615158694057552948e-1506 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-1.0 + +0 i) == -0.8813735870195430252326093249797923090282 + +0 i":
double: 2
float: 1
@@ -439,6 +700,12 @@ idouble: 2
ifloat: 1
ildouble: 3
ldouble: 3
+Test "Real part of: casinh (-1.0 + 0x1p500 i) == -3.472667374605326000180332928505464606058e2 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.0 + 0x1p5000 i) == -3.466429049980286492395577839412341016946e3 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-1.0 - 0 i) == -0.8813735870195430252326093249797923090282 - 0 i":
double: 2
float: 1
@@ -446,6 +713,12 @@ idouble: 2
ifloat: 1
ildouble: 3
ldouble: 3
+Test "Real part of: casinh (-1.0 - 0x1p500 i) == -3.472667374605326000180332928505464606058e2 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.0 - 0x1p5000 i) == -3.466429049980286492395577839412341016946e3 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-1.5 + +0 i) == -1.194763217287109304111930828519090523536 + +0 i":
double: 2
float: 1
@@ -453,6 +726,19 @@ idouble: 2
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Real part of: casinh (-1.5 + 0x1.fp-1025 i) == -1.194763217287109304111930828519090523536 + 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 + 0x1.fp-129 i) == -1.194763217287109304111930828519090523536 + 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 + 0x1.fp-16385 i) == -1.194763217287109304111930828519090523536 + 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-1.5 - 0 i) == -1.194763217287109304111930828519090523536 - 0 i":
double: 2
float: 1
@@ -460,6 +746,19 @@ idouble: 2
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Real part of: casinh (-1.5 - 0x1.fp-1025 i) == -1.194763217287109304111930828519090523536 - 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 - 0x1.fp-129 i) == -1.194763217287109304111930828519090523536 - 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 - 0x1.fp-16385 i) == -1.194763217287109304111930828519090523536 - 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
double: 5
float: 1
@@ -477,9 +776,13 @@ ldouble: 2
Test "Real part of: casinh (0.5 + +0 i) == 0.4812118250596034474977589134243684231352 + +0 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (0.5 - 0 i) == 0.4812118250596034474977589134243684231352 - 0 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
float: 1
ifloat: 1
@@ -492,6 +795,27 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (0x1.fp1023 + 0x1.fp1023 i) == 7.107906849659093345062145442726115449315e2 + 7.853981633974483096156608458198757210493e-1 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (0x1.fp127 + 0x1.fp127 i) == 8.973081118419833726837456344608533993585e1 + 7.853981633974483096156608458198757210493e-1 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (0x1.fp16383 + 0x1.fp16383 i) == 1.135753137836666928715489992987020363057e4 + 7.853981633974483096156608458198757210493e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1p500 + 1.0 i) == 3.472667374605326000180332928505464606058e2 + 3.054936363499604682051979393213617699789e-151 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1p500 - 1.0 i) == 3.472667374605326000180332928505464606058e2 - 3.054936363499604682051979393213617699789e-151 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1p5000 + 1.0 i) == 3.466429049980286492395577839412341016946e3 + 7.079811261048172892385615158694057552948e-1506 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1p5000 - 1.0 i) == 3.466429049980286492395577839412341016946e3 - 7.079811261048172892385615158694057552948e-1506 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (1.0 + +0 i) == 0.8813735870195430252326093249797923090282 + +0 i":
double: 1
float: 1
@@ -499,6 +823,12 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.0 + 0x1p500 i) == 3.472667374605326000180332928505464606058e2 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.0 + 0x1p5000 i) == 3.466429049980286492395577839412341016946e3 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (1.0 - 0 i) == 0.8813735870195430252326093249797923090282 - 0 i":
double: 1
float: 1
@@ -506,16 +836,48 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.0 - 0x1p500 i) == 3.472667374605326000180332928505464606058e2 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.0 - 0x1p5000 i) == 3.466429049980286492395577839412341016946e3 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (1.5 + +0 i) == 1.194763217287109304111930828519090523536 + +0 i":
double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-1025 i) == 1.194763217287109304111930828519090523536 + 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-129 i) == 1.194763217287109304111930828519090523536 + 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 + 0x1.fp-16385 i) == 1.194763217287109304111930828519090523536 + 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (1.5 - 0 i) == 1.194763217287109304111930828519090523536 - 0 i":
double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-1025 i) == 1.194763217287109304111930828519090523536 - 2.989196569048182929051881765490354365918e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-129 i) == 1.194763217287109304111930828519090523536 - 1.579176199917649005841160751101628985741e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 - 0x1.fp-16385 i) == 1.194763217287109304111930828519090523536 - 4.516698239814521372306784062043266700598e-4933 i":
+ildouble: 1
+ldouble: 1
# catan
Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
@@ -3090,7 +3452,9 @@ ifloat: 1
Function: Real part of "cacos":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
diff --git a/libc/ports/sysdeps/aarch64/strncmp.S b/libc/ports/sysdeps/aarch64/strncmp.S
new file mode 100644
index 000000000..341d5ced5
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/strncmp.S
@@ -0,0 +1,204 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+/* Assumptions:
+ *
+ * ARMv8-a, AArch64
+ */
+
+#define REP8_01 0x0101010101010101
+#define REP8_7f 0x7f7f7f7f7f7f7f7f
+#define REP8_80 0x8080808080808080
+
+/* Parameters and result. */
+#define src1 x0
+#define src2 x1
+#define limit x2
+#define result x0
+
+/* Internal variables. */
+#define data1 x3
+#define data1w w3
+#define data2 x4
+#define data2w w4
+#define has_nul x5
+#define diff x6
+#define syndrome x7
+#define tmp1 x8
+#define tmp2 x9
+#define tmp3 x10
+#define zeroones x11
+#define pos x12
+#define limit_wd x13
+#define mask x14
+#define endloop x15
+
+ENTRY_ALIGN_AND_PAD (strncmp, 6, 7)
+ cbz limit, L(ret0)
+ eor tmp1, src1, src2
+ mov zeroones, #REP8_01
+ tst tmp1, #7
+ b.ne L(misaligned8)
+ ands tmp1, src1, #7
+ b.ne L(mutual_align)
+ /* Calculate the number of full and partial words -1. */
+ sub limit_wd, limit, #1 /* limit != 0, so no underflow. */
+ lsr limit_wd, limit_wd, #3 /* Convert to Dwords. */
+
+ /* NUL detection works on the principle that (X - 1) & (~X) & 0x80
+ (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
+ can be done in parallel across the entire word. */
+ /* Start of performance-critical section -- one 64B cache line. */
+L(loop_aligned):
+ ldr data1, [src1], #8
+ ldr data2, [src2], #8
+L(start_realigned):
+ subs limit_wd, limit_wd, #1
+ sub tmp1, data1, zeroones
+ orr tmp2, data1, #REP8_7f
+ eor diff, data1, data2 /* Non-zero if differences found. */
+ csinv endloop, diff, xzr, pl /* Last Dword or differences. */
+ bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
+ ccmp endloop, #0, #0, eq
+ b.eq L(loop_aligned)
+ /* End of performance-critical section -- one 64B cache line. */
+
+ /* Not reached the limit, must have found the end or a diff. */
+ tbz limit_wd, #63, L(not_limit)
+
+ /* Limit % 8 == 0 => all bytes significant. */
+ ands limit, limit, #7
+ b.eq L(not_limit)
+
+ lsl limit, limit, #3 /* Bits -> bytes. */
+ mov mask, #~0
+#ifdef __AARCH64EB__
+ lsr mask, mask, limit
+#else
+ lsl mask, mask, limit
+#endif
+ bic data1, data1, mask
+ bic data2, data2, mask
+
+ /* Make sure that the NUL byte is marked in the syndrome. */
+ orr has_nul, has_nul, mask
+
+L(not_limit):
+ orr syndrome, diff, has_nul
+
+#ifndef __AARCH64EB__
+ rev syndrome, syndrome
+ rev data1, data1
+ /* The MS-non-zero bit of the syndrome marks either the first bit
+ that is different, or the top bit of the first zero byte.
+ Shifting left now will bring the critical information into the
+ top bits. */
+ clz pos, syndrome
+ rev data2, data2
+ lsl data1, data1, pos
+ lsl data2, data2, pos
+ /* But we need to zero-extend (char is unsigned) the value and then
+ perform a signed 32-bit subtraction. */
+ lsr data1, data1, #56
+ sub result, data1, data2, lsr #56
+ RET
+#else
+ /* For big-endian we cannot use the trick with the syndrome value
+ as carry-propagation can corrupt the upper bits if the trailing
+ bytes in the string contain 0x01. */
+ /* However, if there is no NUL byte in the dword, we can generate
+ the result directly. We can't just subtract the bytes as the
+ MSB might be significant. */
+ cbnz has_nul, 1f
+ cmp data1, data2
+ cset result, ne
+ cneg result, result, lo
+ RET
+1:
+ /* Re-compute the NUL-byte detection, using a byte-reversed value. */
+ rev tmp3, data1
+ sub tmp1, tmp3, zeroones
+ orr tmp2, tmp3, #REP8_7f
+ bic has_nul, tmp1, tmp2
+ rev has_nul, has_nul
+ orr syndrome, diff, has_nul
+ clz pos, syndrome
+ /* The MS-non-zero bit of the syndrome marks either the first bit
+ that is different, or the top bit of the first zero byte.
+ Shifting left now will bring the critical information into the
+ top bits. */
+ lsl data1, data1, pos
+ lsl data2, data2, pos
+ /* But we need to zero-extend (char is unsigned) the value and then
+ perform a signed 32-bit subtraction. */
+ lsr data1, data1, #56
+ sub result, data1, data2, lsr #56
+ RET
+#endif
+
+L(mutual_align):
+ /* Sources are mutually aligned, but are not currently at an
+ alignment boundary. Round down the addresses and then mask off
+ the bytes that precede the start point.
+ We also need to adjust the limit calculations, but without
+ overflowing if the limit is near ULONG_MAX. */
+ bic src1, src1, #7
+ bic src2, src2, #7
+ ldr data1, [src1], #8
+ neg tmp3, tmp1, lsl #3 /* 64 - bits(bytes beyond align). */
+ ldr data2, [src2], #8
+ mov tmp2, #~0
+ sub limit_wd, limit, #1 /* limit != 0, so no underflow. */
+#ifdef __AARCH64EB__
+ /* Big-endian. Early bytes are at MSB. */
+ lsl tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */
+#else
+ /* Little-endian. Early bytes are at LSB. */
+ lsr tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */
+#endif
+ and tmp3, limit_wd, #7
+ lsr limit_wd, limit_wd, #3
+ /* Adjust the limit. Only low 3 bits used, so overflow irrelevant. */
+ add limit, limit, tmp1
+ add tmp3, tmp3, tmp1
+ orr data1, data1, tmp2
+ orr data2, data2, tmp2
+ add limit_wd, limit_wd, tmp3, lsr #3
+ b L(start_realigned)
+
+L(ret0):
+ mov result, #0
+ RET
+
+ .p2align 6
+L(misaligned8):
+ sub limit, limit, #1
+1:
+ /* Perhaps we can do better than this. */
+ ldrb data1w, [src1], #1
+ ldrb data2w, [src2], #1
+ subs limit, limit, #1
+ ccmp data1w, #1, #0, cs /* NZCV = 0b0000. */
+ ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
+ b.eq 1b
+ sub result, data1, data2
+ RET
+END (strncmp)
+libc_hidden_builtin_def (strncmp)
diff --git a/libc/ports/sysdeps/aarch64/strnlen.S b/libc/ports/sysdeps/aarch64/strnlen.S
new file mode 100644
index 000000000..e582e8ad2
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/strnlen.S
@@ -0,0 +1,161 @@
+/* strnlen - calculate the length of a string with limit.
+
+ Copyright (C) 2013 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+/* Assumptions:
+ *
+ * ARMv8-a, AArch64
+ */
+
+/* Arguments and results. */
+#define srcin x0
+#define len x0
+#define limit x1
+
+/* Locals and temporaries. */
+#define src x2
+#define data1 x3
+#define data2 x4
+#define data2a x5
+#define has_nul1 x6
+#define has_nul2 x7
+#define tmp1 x8
+#define tmp2 x9
+#define tmp3 x10
+#define tmp4 x11
+#define zeroones x12
+#define pos x13
+#define limit_wd x14
+
+#define REP8_01 0x0101010101010101
+#define REP8_7f 0x7f7f7f7f7f7f7f7f
+#define REP8_80 0x8080808080808080
+
+ENTRY_ALIGN_AND_PAD (__strnlen, 6, 9)
+ cbz limit, L(hit_limit)
+ mov zeroones, #REP8_01
+ bic src, srcin, #15
+ ands tmp1, srcin, #15
+ b.ne L(misaligned)
+ /* Calculate the number of full and partial words -1. */
+ sub limit_wd, limit, #1 /* Limit != 0, so no underflow. */
+ lsr limit_wd, limit_wd, #4 /* Convert to Qwords. */
+
+ /* NUL detection works on the principle that (X - 1) & (~X) & 0x80
+ (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
+ can be done in parallel across the entire word. */
+ /* The inner loop deals with two Dwords at a time. This has a
+ slightly higher start-up cost, but we should win quite quickly,
+ especially on cores with a high number of issue slots per
+ cycle, as we get much better parallelism out of the operations. */
+
+ /* Start of critial section -- keep to one 64Byte cache line. */
+L(loop):
+ ldp data1, data2, [src], #16
+L(realigned):
+ sub tmp1, data1, zeroones
+ orr tmp2, data1, #REP8_7f
+ sub tmp3, data2, zeroones
+ orr tmp4, data2, #REP8_7f
+ bic has_nul1, tmp1, tmp2
+ bic has_nul2, tmp3, tmp4
+ subs limit_wd, limit_wd, #1
+ orr tmp1, has_nul1, has_nul2
+ ccmp tmp1, #0, #0, pl /* NZCV = 0000 */
+ b.eq L(loop)
+ /* End of critical section -- keep to one 64Byte cache line. */
+
+ orr tmp1, has_nul1, has_nul2
+ cbz tmp1, L(hit_limit) /* No null in final Qword. */
+
+ /* We know there's a null in the final Qword. The easiest thing
+ to do now is work out the length of the string and return
+ MIN (len, limit). */
+
+ sub len, src, srcin
+ cbz has_nul1, L(nul_in_data2)
+#ifdef __AARCH64EB__
+ mov data2, data1
+#endif
+ sub len, len, #8
+ mov has_nul2, has_nul1
+L(nul_in_data2):
+#ifdef __AARCH64EB__
+ /* For big-endian, carry propagation (if the final byte in the
+ string is 0x01) means we cannot use has_nul directly. The
+ easiest way to get the correct byte is to byte-swap the data
+ and calculate the syndrome a second time. */
+ rev data2, data2
+ sub tmp1, data2, zeroones
+ orr tmp2, data2, #REP8_7f
+ bic has_nul2, tmp1, tmp2
+#endif
+ sub len, len, #8
+ rev has_nul2, has_nul2
+ clz pos, has_nul2
+ add len, len, pos, lsr #3 /* Bits to bytes. */
+ cmp len, limit
+ csel len, len, limit, ls /* Return the lower value. */
+ RET
+
+L(misaligned):
+ /* Deal with a partial first word.
+ We're doing two things in parallel here;
+ 1) Calculate the number of words (but avoiding overflow if
+ limit is near ULONG_MAX) - to do this we need to work out
+ limit + tmp1 - 1 as a 65-bit value before shifting it;
+ 2) Load and mask the initial data words - we force the bytes
+ before the ones we are interested in to 0xff - this ensures
+ early bytes will not hit any zero detection. */
+ sub limit_wd, limit, #1
+ neg tmp4, tmp1
+ cmp tmp1, #8
+
+ and tmp3, limit_wd, #15
+ lsr limit_wd, limit_wd, #4
+ mov tmp2, #~0
+
+ ldp data1, data2, [src], #16
+ lsl tmp4, tmp4, #3 /* Bytes beyond alignment -> bits. */
+ add tmp3, tmp3, tmp1
+
+#ifdef __AARCH64EB__
+ /* Big-endian. Early bytes are at MSB. */
+ lsl tmp2, tmp2, tmp4 /* Shift (tmp1 & 63). */
+#else
+ /* Little-endian. Early bytes are at LSB. */
+ lsr tmp2, tmp2, tmp4 /* Shift (tmp1 & 63). */
+#endif
+ add limit_wd, limit_wd, tmp3, lsr #4
+
+ orr data1, data1, tmp2
+ orr data2a, data2, tmp2
+
+ csinv data1, data1, xzr, le
+ csel data2, data2, data2a, le
+ b L(realigned)
+
+L(hit_limit):
+ mov len, limit
+ RET
+END (__strnlen)
+weak_alias (__strnlen, strnlen)
+libc_hidden_def (strnlen)
diff --git a/libc/ports/sysdeps/aarch64/sysdep.h b/libc/ports/sysdeps/aarch64/sysdep.h
index 6b75ada14..9349471e3 100644
--- a/libc/ports/sysdeps/aarch64/sysdep.h
+++ b/libc/ports/sysdeps/aarch64/sysdep.h
@@ -42,6 +42,22 @@
cfi_startproc; \
CALL_MCOUNT
+/* Define an entry point visible from C with a specified alignment and
+ pre-padding with NOPs. This can be used to ensure that a critical
+ loop within a function is cache line aligned. Note this version
+ does not adjust the padding if CALL_MCOUNT is defined. */
+
+#define ENTRY_ALIGN_AND_PAD(name, align, padding) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),%function; \
+ .p2align align; \
+ .rep padding; \
+ nop; \
+ .endr; \
+ C_LABEL(name) \
+ cfi_startproc; \
+ CALL_MCOUNT
+
#undef END
#define END(name) \
cfi_endproc; \
diff --git a/libc/ports/sysdeps/alpha/memchr.c b/libc/ports/sysdeps/alpha/memchr.c
index 70416d557..67f718a50 100644
--- a/libc/ports/sysdeps/alpha/memchr.c
+++ b/libc/ports/sysdeps/alpha/memchr.c
@@ -16,7 +16,6 @@
<http://www.gnu.org/licenses/>. */
#include <string.h>
-#include <bp-sym.h>
typedef unsigned long word;
@@ -170,6 +169,6 @@ __memchr (const void *s, int xc, size_t n)
}
#ifdef weak_alias
-weak_alias (__memchr, BP_SYM (memchr))
+weak_alias (__memchr, memchr)
#endif
libc_hidden_builtin_def (memchr)
diff --git a/libc/ports/sysdeps/am33/dl-machine.h b/libc/ports/sysdeps/am33/dl-machine.h
index 2db27378d..924319d03 100644
--- a/libc/ports/sysdeps/am33/dl-machine.h
+++ b/libc/ports/sysdeps/am33/dl-machine.h
@@ -55,16 +55,14 @@ elf_machine_load_address (void)
return off + gotaddr - gotval;
}
-#if !defined PROF && !__BOUNDED_POINTERS__
+#ifndef PROF
/* We add a declaration of this function here so that in dl-runtime.c
the ELF_MACHINE_RUNTIME_TRAMPOLINE macro really can pass the parameters
in registers.
We cannot use this scheme for profiling because the _mcount call
destroys the passed register information. */
-/* GKM FIXME: Fix trampoline to pass bounds so we can do
- without the `__unbounded' qualifier. */
-static ElfW(Addr) fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset)
+static ElfW(Addr) fixup (struct link_map *l, ElfW(Word) reloc_offset)
__attribute__ ((unused));
static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
ElfW(Addr) retaddr)
@@ -116,7 +114,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
/* This code is used in dl-runtime.c to call the `fixup' function
and then redirect to the address it returns. */
-#if !defined PROF && !__BOUNDED_POINTERS__
+#ifndef PROF
# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
.text\n\
.globl _dl_runtime_resolve\n\
diff --git a/libc/ports/sysdeps/am33/elf/start.S b/libc/ports/sysdeps/am33/elf/start.S
index 0ca71f14a..e89f9db15 100644
--- a/libc/ports/sysdeps/am33/elf/start.S
+++ b/libc/ports/sysdeps/am33/elf/start.S
@@ -37,8 +37,6 @@
NULL
*/
-#include "bp-sym.h"
-
.text
.globl _start
.type _start,@function
@@ -63,13 +61,13 @@ _start:
mov 0,a3
mov (32,sp), d1 /* argc. */
- mov BP_SYM (main), d0 /* main. */
+ mov main, d0 /* main. */
/* Call the user's main function, and exit with its value.
But let the libc call main. */
- call BP_SYM (__libc_start_main),[],0
+ call __libc_start_main,[],0
- call BP_SYM (abort),[],0 /* Crash if somehow `exit' does return. */
+ call abort,[],0 /* Crash if somehow `exit' does return. */
/* Define a symbol for the first piece of initialized data. */
.data
diff --git a/libc/ports/sysdeps/arm/__longjmp.S b/libc/ports/sysdeps/arm/__longjmp.S
index 5c04f3645..a3a2a8aec 100644
--- a/libc/ports/sysdeps/arm/__longjmp.S
+++ b/libc/ports/sysdeps/arm/__longjmp.S
@@ -16,6 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* ??? Needs more rearrangement for the LDM to handle thumb mode. */
+#define NO_THUMB
#include <sysdep.h>
#define _SETJMP_H
#define _ASM
@@ -105,12 +107,12 @@ ENTRY (__longjmp)
#ifdef NEED_HWCAP
# ifdef IS_IN_rtld
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_local_ro:
.long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
# else
# ifdef PIC
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_global_ro:
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
# else
diff --git a/libc/ports/sysdeps/arm/arm-mcount.S b/libc/ports/sysdeps/arm/arm-mcount.S
index 6c2427139..679d042ba 100644
--- a/libc/ports/sysdeps/arm/arm-mcount.S
+++ b/libc/ports/sysdeps/arm/arm-mcount.S
@@ -24,8 +24,8 @@
#ifdef __thumb2__
.thumb
- .syntax unified
#endif
+ .syntax unified
/* Use an assembly stub with a special ABI. The calling lr has been
@@ -77,15 +77,10 @@ ENTRY(_mcount)
cfi_rel_offset (r3, 12)
cfi_rel_offset (fp, 16)
cfi_rel_offset (lr, 20)
-#ifdef __thumb2__
movs r0, fp
ittt ne
ldrne r0, [r0, #-4]
-#else
- movs fp, fp
- ldrne r0, [fp, #-4]
-#endif
- movnes r1, lr
+ movsne r1, lr
blne __mcount_internal
#ifdef __thumb2__
ldmia sp!, {r0, r1, r2, r3, fp, pc}
diff --git a/libc/ports/sysdeps/arm/crti.S b/libc/ports/sysdeps/arm/crti.S
index 44e20f0c1..1d55ae27a 100644
--- a/libc/ports/sysdeps/arm/crti.S
+++ b/libc/ports/sysdeps/arm/crti.S
@@ -38,6 +38,8 @@
they can be called as functions. The symbols _init and _fini are
magic and cause the linker to emit DT_INIT and DT_FINI. */
+/* Always build .init and .fini sections in ARM mode. */
+#define NO_THUMB
#include <libc-symbols.h>
#include <sysdep.h>
diff --git a/libc/ports/sysdeps/arm/crtn.S b/libc/ports/sysdeps/arm/crtn.S
index 5ff3661f1..a01eb0139 100644
--- a/libc/ports/sysdeps/arm/crtn.S
+++ b/libc/ports/sysdeps/arm/crtn.S
@@ -33,6 +33,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Always build .init and .fini sections in ARM mode. */
+#define NO_THUMB
#include <sysdep.h>
/* crtn.S puts function epilogues in the .init and .fini sections
diff --git a/libc/ports/sysdeps/arm/dl-tlsdesc.S b/libc/ports/sysdeps/arm/dl-tlsdesc.S
index 0ae3abb38..7b4c8dfcb 100644
--- a/libc/ports/sysdeps/arm/dl-tlsdesc.S
+++ b/libc/ports/sysdeps/arm/dl-tlsdesc.S
@@ -29,7 +29,7 @@
.text
@ emit debug information with cfi
@ use arm-specific pseudos for unwinding itself
- .cfi_sections .debug_frame
+ CFI_SECTIONS
.hidden _dl_tlsdesc_return
.global _dl_tlsdesc_return
.type _dl_tlsdesc_return,#function
@@ -116,6 +116,7 @@ _dl_tlsdesc_dynamic:
ldr r3, [r1]
ldr r2, [r0, r3, lsl #3]
cmn r2, #1
+ ittt ne
ldrne r3, [r1, #4]
addne r3, r2, r3
rsbne r0, r4, r3
diff --git a/libc/ports/sysdeps/arm/dl-trampoline.S b/libc/ports/sysdeps/arm/dl-trampoline.S
index ebf221c85..561d8ae6f 100644
--- a/libc/ports/sysdeps/arm/dl-trampoline.S
+++ b/libc/ports/sysdeps/arm/dl-trampoline.S
@@ -16,6 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* ??? Needs more rearrangement for the LDM to handle thumb mode. */
+#define NO_THUMB
#include <sysdep.h>
#include <libc-symbols.h>
@@ -28,7 +30,7 @@
.text
.globl _dl_runtime_resolve
.type _dl_runtime_resolve, #function
- .cfi_sections .debug_frame
+ CFI_SECTIONS
cfi_startproc
.align 2
_dl_runtime_resolve:
@@ -77,7 +79,7 @@ _dl_runtime_resolve:
#ifndef PROF
.globl _dl_runtime_profile
.type _dl_runtime_profile, #function
- .cfi_sections .debug_frame
+ CFI_SECTIONS
cfi_startproc
.align 2
_dl_runtime_profile:
diff --git a/libc/ports/sysdeps/arm/frame.h b/libc/ports/sysdeps/arm/frame.h
index c5a8ed17e..db3529939 100644
--- a/libc/ports/sysdeps/arm/frame.h
+++ b/libc/ports/sysdeps/arm/frame.h
@@ -19,9 +19,9 @@
/* This is the APCS stack backtrace structure. */
struct layout
{
- struct layout *__unbounded next;
- void *__unbounded sp;
- void *__unbounded return_address;
+ struct layout *next;
+ void *sp;
+ void *return_address;
};
#define FIRST_FRAME_POINTER ADVANCE_STACK_FRAME (__builtin_frame_address (0))
diff --git a/libc/ports/sysdeps/arm/memcpy.S b/libc/ports/sysdeps/arm/memcpy.S
index d8164b4d7..98b9b47e3 100644
--- a/libc/ports/sysdeps/arm/memcpy.S
+++ b/libc/ports/sysdeps/arm/memcpy.S
@@ -17,6 +17,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Thumb requires excessive IT insns here. */
+#define NO_THUMB
#include <sysdep.h>
/*
diff --git a/libc/ports/sysdeps/arm/memmove.S b/libc/ports/sysdeps/arm/memmove.S
index d33c1cef8..059ca7ac3 100644
--- a/libc/ports/sysdeps/arm/memmove.S
+++ b/libc/ports/sysdeps/arm/memmove.S
@@ -17,6 +17,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Thumb requires excessive IT insns here. */
+#define NO_THUMB
#include <sysdep.h>
/*
diff --git a/libc/ports/sysdeps/arm/memset.S b/libc/ports/sysdeps/arm/memset.S
index 3152a84e8..9924cb911 100644
--- a/libc/ports/sysdeps/arm/memset.S
+++ b/libc/ports/sysdeps/arm/memset.S
@@ -16,6 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Thumb requires excessive IT insns here. */
+#define NO_THUMB
#include <sysdep.h>
/* void *memset (dstpp, c, len) */
diff --git a/libc/ports/sysdeps/arm/preconfigure b/libc/ports/sysdeps/arm/preconfigure
index 20f6d91a1..6d61b1428 100644
--- a/libc/ports/sysdeps/arm/preconfigure
+++ b/libc/ports/sysdeps/arm/preconfigure
@@ -10,7 +10,7 @@ arm*)
# an appropriate directory exists in sysdeps/arm
archcppflag=`echo "" |
$CC $CFLAGS $CPPFLAGS -E -dM - |
- grep __ARM_ARCH |
+ grep '__ARM_ARCH_[0-9].*__' |
sed -e 's/^#define //' -e 's/ .*//'`
case x$archcppflag in
@@ -28,7 +28,10 @@ arm*)
machine=armv6t2
echo "Found compiler is configured for $machine"
;;
-
+ x__ARM_ARCH_6*__)
+ machine=armv6
+ echo "Found compiler is configured for $machine"
+ ;;
*)
machine=arm
echo 2>&1 "arm/preconfigure: Did not find ARM architecture type; using default"
diff --git a/libc/ports/sysdeps/arm/setjmp.S b/libc/ports/sysdeps/arm/setjmp.S
index 4b7542ad3..6776cab38 100644
--- a/libc/ports/sysdeps/arm/setjmp.S
+++ b/libc/ports/sysdeps/arm/setjmp.S
@@ -16,6 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* ??? Needs more rearrangement for the STM to handle thumb mode. */
+#define NO_THUMB
#include <sysdep.h>
#define _SETJMP_H
#define _ASM
@@ -91,12 +93,12 @@ ENTRY (__sigsetjmp)
#ifdef NEED_HWCAP
# ifdef IS_IN_rtld
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_local_ro:
.long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
# else
# ifdef PIC
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_global_ro:
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
# else
diff --git a/libc/ports/sysdeps/arm/strlen.S b/libc/ports/sysdeps/arm/strlen.S
index 15e922118..2b947e240 100644
--- a/libc/ports/sysdeps/arm/strlen.S
+++ b/libc/ports/sysdeps/arm/strlen.S
@@ -16,6 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* Thumb requires excessive IT insns here. */
+#define NO_THUMB
#include <sysdep.h>
/* size_t strlen(const char *S)
diff --git a/libc/ports/sysdeps/arm/sysdep.h b/libc/ports/sysdeps/arm/sysdep.h
index 0e6f645e8..4af7429ac 100644
--- a/libc/ports/sysdeps/arm/sysdep.h
+++ b/libc/ports/sysdeps/arm/sysdep.h
@@ -58,40 +58,43 @@
#endif
/* Define an entry point visible from C. */
-#define ENTRY(name) \
- .globl C_SYMBOL_NAME(name); \
- .type C_SYMBOL_NAME(name),%function; \
- .align ALIGNARG(4); \
- C_LABEL(name) \
- .cfi_sections .debug_frame; \
- cfi_startproc; \
- CALL_MCOUNT
+#define ENTRY(name) \
+ .globl C_SYMBOL_NAME(name); \
+ .type C_SYMBOL_NAME(name),%function; \
+ .align ALIGNARG(4); \
+ C_LABEL(name) \
+ CFI_SECTIONS; \
+ cfi_startproc; \
+ CALL_MCOUNT
+
+#define CFI_SECTIONS \
+ .cfi_sections .debug_frame
#undef END
-#define END(name) \
- cfi_endproc; \
- ASM_SIZE_DIRECTIVE(name)
+#define END(name) \
+ cfi_endproc; \
+ ASM_SIZE_DIRECTIVE(name)
/* If compiled for profiling, call `mcount' at the start of each function. */
#ifdef PROF
/* Call __gnu_mcount_nc if GCC >= 4.4. */
#if __GNUC_PREREQ(4,4)
-#define CALL_MCOUNT \
- str lr,[sp, #-4]!; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (lr, 0); \
- bl PLTJMP(mcount); \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (lr)
+#define CALL_MCOUNT \
+ str lr,[sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
+ bl PLTJMP(mcount); \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr)
#else /* else call _mcount */
-#define CALL_MCOUNT \
- str lr,[sp, #-4]!; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (lr, 0); \
- bl PLTJMP(mcount); \
- ldr lr, [sp], #4; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (lr)
+#define CALL_MCOUNT \
+ str lr,[sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
+ bl PLTJMP(mcount); \
+ ldr lr, [sp], #4; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr)
#endif
#else
#define CALL_MCOUNT /* Do nothing. */
@@ -115,3 +118,11 @@
.eabi_attribute 24, 1
#endif /* __ASSEMBLER__ */
+
+/* This number is the offset from the pc at the current location. */
+/* ??? At the moment we're not turning on thumb mode in assembly. */
+#if defined(__thumb__) && !defined(__ASSEMBLER__)
+# define PC_OFS 4
+#else
+# define PC_OFS 8
+#endif
diff --git a/libc/ports/sysdeps/ia64/memchr.S b/libc/ports/sysdeps/ia64/memchr.S
index f23a41cb7..610264407 100644
--- a/libc/ports/sysdeps/ia64/memchr.S
+++ b/libc/ports/sysdeps/ia64/memchr.S
@@ -154,7 +154,4 @@ ENTRY(__memchr)
END(__memchr)
weak_alias (__memchr, memchr)
-#if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
-#endif
libc_hidden_builtin_def (memchr)
diff --git a/libc/ports/sysdeps/m68k/Makefile b/libc/ports/sysdeps/m68k/Makefile
index ef798306b..c5b5318f0 100644
--- a/libc/ports/sysdeps/m68k/Makefile
+++ b/libc/ports/sysdeps/m68k/Makefile
@@ -26,8 +26,14 @@ asm-CPPFLAGS += $(m68k-syntax-flag)
pic-ccflag = -fpic
+ifeq ($(subdir),setjmp)
# Make sure setjmp.c is compiled with a frame pointer
CFLAGS-setjmp.c := -fno-omit-frame-pointer
+endif
+
+ifeq ($(subdir),debug)
+CFLAGS-backtrace.c += -funwind-tables
+endif
ifeq ($(subdir),elf)
CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
diff --git a/libc/ports/sysdeps/m68k/backtrace.c b/libc/ports/sysdeps/m68k/backtrace.c
new file mode 100644
index 000000000..decd03c11
--- /dev/null
+++ b/libc/ports/sysdeps/m68k/backtrace.c
@@ -0,0 +1,159 @@
+/* Return backtrace of current program state.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <bits/libc-lock.h>
+#include <dlfcn.h>
+#include <execinfo.h>
+#include <stdlib.h>
+#include <unwind.h>
+
+struct trace_arg
+{
+ void **array;
+ int cnt, size;
+ void *lastfp, *lastsp;
+};
+
+#ifdef SHARED
+static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *);
+static _Unwind_Ptr (*unwind_getip) (struct _Unwind_Context *);
+static _Unwind_Ptr (*unwind_getcfa) (struct _Unwind_Context *);
+static _Unwind_Ptr (*unwind_getgr) (struct _Unwind_Context *, int);
+static void *libgcc_handle;
+
+static void
+init (void)
+{
+ libgcc_handle = __libc_dlopen ("libgcc_s.so.2");
+
+ if (libgcc_handle == NULL)
+ return;
+
+ unwind_backtrace = __libc_dlsym (libgcc_handle, "_Unwind_Backtrace");
+ unwind_getip = __libc_dlsym (libgcc_handle, "_Unwind_GetIP");
+ unwind_getcfa = __libc_dlsym (libgcc_handle, "_Unwind_GetCFA");
+ unwind_getgr = __libc_dlsym (libgcc_handle, "_Unwind_GetGR");
+ if (unwind_getip == NULL || unwind_getgr == NULL || unwind_getcfa == NULL)
+ {
+ unwind_backtrace = NULL;
+ __libc_dlclose (libgcc_handle);
+ libgcc_handle = NULL;
+ }
+}
+#else
+# define unwind_backtrace _Unwind_Backtrace
+# define unwind_getip _Unwind_GetIP
+# define unwind_getcfa _Unwind_GetCFA
+# define unwind_getgr _Unwind_GetGR
+#endif
+
+static _Unwind_Reason_Code
+backtrace_helper (struct _Unwind_Context *ctx, void *a)
+{
+ struct trace_arg *arg = a;
+
+ /* We are first called with address in the __backtrace function.
+ Skip it. */
+ if (arg->cnt != -1)
+ arg->array[arg->cnt] = (void *) unwind_getip (ctx);
+ if (++arg->cnt == arg->size)
+ return _URC_END_OF_STACK;
+
+ /* %fp is DWARF2 register 14 on M68K. */
+ arg->lastfp = (void *) unwind_getgr (ctx, 14);
+ arg->lastsp = (void *) unwind_getcfa (ctx);
+ return _URC_NO_REASON;
+}
+
+
+/* This is a global variable set at program start time. It marks the
+ highest used stack address. */
+extern void *__libc_stack_end;
+
+
+/* This is the stack layout we see with every stack frame
+ if not compiled without frame pointer.
+
+ +-----------------+ +-----------------+
+ %fp -> | %fp last frame--------> | %fp last frame--->...
+ | | | |
+ | return address | | return address |
+ +-----------------+ +-----------------+
+
+ First try as far to get as far as possible using
+ _Unwind_Backtrace which handles -fomit-frame-pointer
+ as well, but requires .eh_frame info. Then fall back to
+ walking the stack manually. */
+
+struct layout
+{
+ struct layout *fp;
+ void *ret;
+};
+
+
+int
+__backtrace (void **array, int size)
+{
+ struct trace_arg arg = { .array = array, .size = size, .cnt = -1 };
+#ifdef SHARED
+ __libc_once_define (static, once);
+
+ __libc_once (once, init);
+ if (unwind_backtrace == NULL)
+ return 0;
+#endif
+
+ if (size >= 1)
+ unwind_backtrace (backtrace_helper, &arg);
+
+ if (arg.cnt > 1 && arg.array[arg.cnt - 1] == NULL)
+ --arg.cnt;
+ else if (arg.cnt < size)
+ {
+ struct layout *fp = (struct layout *) arg.lastfp;
+
+ while (arg.cnt < size)
+ {
+ /* Check for out of range. */
+ if ((void *) fp < arg.lastsp || (void *) fp > __libc_stack_end
+ || ((long) fp & 1))
+ break;
+
+ array[arg.cnt++] = fp->ret;
+ fp = fp->fp;
+ }
+ }
+ return arg.cnt != -1 ? arg.cnt : 0;
+}
+weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
+
+
+#ifdef SHARED
+/* Free all resources if necessary. */
+libc_freeres_fn (free_mem)
+{
+ unwind_backtrace = NULL;
+ if (libgcc_handle != NULL)
+ {
+ __libc_dlclose (libgcc_handle);
+ libgcc_handle = NULL;
+ }
+}
+#endif
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps b/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
index 96caef5df..59b057693 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
@@ -251,6 +251,14 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: cacos (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 - 7.107906849659093345062145442726115449315e2 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (0x1.fp127 + 0x1.fp127 i) == 7.853981633974483096156608458198757210493e-1 - 8.973081118419833726837456344608533993585e1 i":
+double: 1
+idouble: 1
Test "Imaginary part of: cacos (1.5 + +0 i) == +0 - 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -471,6 +479,14 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: casin (0x1.fp1023 + 0x1.fp1023 i) == 7.853981633974483096156608458198757210493e-1 + 7.107906849659093345062145442726115449315e2 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (0x1.fp127 + 0x1.fp127 i) == 7.853981633974483096156608458198757210493e-1 + 8.973081118419833726837456344608533993585e1 i":
+double: 1
+idouble: 1
Test "Imaginary part of: casin (1.5 + +0 i) == pi/2 + 0.9624236501192068949955178268487368462704 i":
double: 1
float: 1
@@ -581,6 +597,14 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (0x1.fp1023 + 0x1.fp1023 i) == 7.107906849659093345062145442726115449315e2 + 7.853981633974483096156608458198757210493e-1 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0x1.fp127 + 0x1.fp127 i) == 8.973081118419833726837456344608533993585e1 + 7.853981633974483096156608458198757210493e-1 i":
+double: 1
+idouble: 1
Test "Real part of: casinh (1.0 + +0 i) == 0.8813735870195430252326093249797923090282 + +0 i":
double: 1
float: 1
diff --git a/libc/ports/sysdeps/m68k/memchr.S b/libc/ports/sysdeps/m68k/memchr.S
index a15ebded0..07b102523 100644
--- a/libc/ports/sysdeps/m68k/memchr.S
+++ b/libc/ports/sysdeps/m68k/memchr.S
@@ -304,7 +304,4 @@ L(L9:)
END(__memchr)
weak_alias (__memchr, memchr)
-#if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
-#endif
libc_hidden_builtin_def (memchr)
diff --git a/libc/ports/sysdeps/mips/__longjmp.c b/libc/ports/sysdeps/mips/__longjmp.c
index a9efb0dac..67bdb86cf 100644
--- a/libc/ports/sysdeps/mips/__longjmp.c
+++ b/libc/ports/sysdeps/mips/__longjmp.c
@@ -23,8 +23,8 @@
#error This file uses GNU C extensions; you must compile with GCC.
#endif
-void
-__longjmp (env_arg, val_arg)
+static void __attribute__ ((nomips16))
+____longjmp (env_arg, val_arg)
__jmp_buf env_arg;
int val_arg;
{
@@ -86,3 +86,5 @@ __longjmp (env_arg, val_arg)
/* Avoid `volatile function does return' warnings. */
for (;;);
}
+
+strong_alias (____longjmp, __longjmp);
diff --git a/libc/ports/sysdeps/mips/abort-instr.h b/libc/ports/sysdeps/mips/abort-instr.h
index d7d8d501b..7ccae5736 100644
--- a/libc/ports/sysdeps/mips/abort-instr.h
+++ b/libc/ports/sysdeps/mips/abort-instr.h
@@ -1,2 +1,6 @@
/* An instruction which should crash any program is a breakpoint. */
-#define ABORT_INSTRUCTION asm ("break 255")
+#ifdef __mips16
+# define ABORT_INSTRUCTION asm ("break 63")
+#else
+# define ABORT_INSTRUCTION asm ("break 255")
+#endif
diff --git a/libc/ports/sysdeps/mips/add_n.S b/libc/ports/sysdeps/mips/add_n.S
index 7a3848f60..e83fc8170 100644
--- a/libc/ports/sysdeps/mips/add_n.S
+++ b/libc/ports/sysdeps/mips/add_n.S
@@ -118,4 +118,4 @@ L(end): addu $11,$11,$2
sw $11,0($4)
j $31
or $2,$2,$8
- .end __mpn_add_n
+END (__mpn_add_n)
diff --git a/libc/ports/sysdeps/mips/bits/atomic.h b/libc/ports/sysdeps/mips/bits/atomic.h
index 566b3dd2b..bdc3acef7 100644
--- a/libc/ports/sysdeps/mips/bits/atomic.h
+++ b/libc/ports/sysdeps/mips/bits/atomic.h
@@ -78,9 +78,12 @@ typedef uintmax_t uatomic_max_t;
#define MIPS_SYNC_STR_1(X) MIPS_SYNC_STR_2(X)
#define MIPS_SYNC_STR MIPS_SYNC_STR_1(MIPS_SYNC)
-#if __GNUC_PREREQ (4, 8)
+#if __GNUC_PREREQ (4, 8) || (defined __mips16 && __GNUC_PREREQ (4, 7))
/* The __atomic_* builtins are available in GCC 4.7 and later, but MIPS
- support for their efficient implementation was added only in GCC 4.8. */
+ support for their efficient implementation was added only in GCC 4.8.
+ We still want to use them even with GCC 4.7 for MIPS16 code where we
+ have no assembly alternative available and want to avoid the __sync_*
+ if at all possible. */
/* Compare and exchange.
For all "bool" routines, we return FALSE if exchange succesful. */
@@ -200,7 +203,33 @@ typedef uintmax_t uatomic_max_t;
# define atomic_exchange_and_add_rel(mem, value) \
__atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
__ATOMIC_RELEASE)
-#else /* !__GNUC_PREREQ (4, 8) */
+
+#elif defined __mips16 /* !__GNUC_PREREQ (4, 7) */
+/* This implementation using __sync* builtins will be removed once glibc
+ requires GCC 4.7 or later to build. */
+
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+ __sync_val_compare_and_swap ((mem), (oldval), (newval))
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ (!__sync_bool_compare_and_swap ((mem), (oldval), (newval)))
+
+# define atomic_exchange_acq(mem, newval) \
+ __sync_lock_test_and_set ((mem), (newval))
+
+# define atomic_exchange_and_add(mem, val) \
+ __sync_fetch_and_add ((mem), (val))
+
+# define atomic_bit_test_set(mem, bit) \
+ ({ __typeof (bit) __bit = (bit); \
+ (__sync_fetch_and_or ((mem), 1 << (__bit)) & (1 << (__bit))); })
+
+# define atomic_and(mem, mask) (void) __sync_fetch_and_and ((mem), (mask))
+# define atomic_and_val(mem, mask) __sync_fetch_and_and ((mem), (mask))
+
+# define atomic_or(mem, mask) (void) __sync_fetch_and_or ((mem), (mask))
+# define atomic_or_val(mem, mask) __sync_fetch_and_or ((mem), (mask))
+
+#else /* !__mips16 && !__GNUC_PREREQ (4, 8) */
/* This implementation using inline assembly will be removed once glibc
requires GCC 4.8 or later to build. */
@@ -443,15 +472,21 @@ typedef uintmax_t uatomic_max_t;
# define atomic_exchange_and_add_rel(mem, value) \
__atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
MIPS_SYNC_STR, "")
-#endif /* __GNUC_PREREQ (4, 8) */
+
+#endif /* !__mips16 && !__GNUC_PREREQ (4, 8) */
/* TODO: More atomic operations could be implemented efficiently; only the
basic requirements are done. */
-#define atomic_full_barrier() \
+#ifdef __mips16
+# define atomic_full_barrier() __sync_synchronize ()
+
+#else /* !__mips16 */
+# define atomic_full_barrier() \
__asm__ __volatile__ (".set push\n\t" \
MIPS_PUSH_MIPS2 \
MIPS_SYNC_STR "\n\t" \
".set pop" : : : "memory")
+#endif /* !__mips16 */
#endif /* bits/atomic.h */
diff --git a/libc/ports/sysdeps/mips/bits/nan.h b/libc/ports/sysdeps/mips/bits/nan.h
index ffbb3b5d5..7aa157b1d 100644
--- a/libc/ports/sysdeps/mips/bits/nan.h
+++ b/libc/ports/sysdeps/mips/bits/nan.h
@@ -1,4 +1,4 @@
-/* `NAN' constant for IEEE 754 machines.
+/* `NAN' constant for IEEE 754 machines. MIPS version.
Copyright (C) 1992-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -13,7 +13,7 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
+ License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _MATH_H
@@ -21,20 +21,21 @@
#endif
-/* IEEE Not A Number (QNaN). Note that MIPS has the QNaN and SNaN patterns
- reversed compared to most other architectures. The IEEE spec left
- the definition of this open to implementations, and for MIPS the top
- bit of the mantissa must be SET to indicate a SNaN. */
+/* IEEE Not A Number. */
+/* Note that MIPS has the QNaN and SNaN patterns reversed compared to most
+ other architectures. The IEEE spec left the definition of this open to
+ implementations, and for MIPS the top bit of the mantissa must be SET to
+ indicate a SNaN. */
#if __GNUC_PREREQ(3,3)
-# define NAN (__builtin_nanf(""))
+# define NAN (__builtin_nanf (""))
#elif defined __GNUC__
# define NAN \
- (__extension__ \
- ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
+ (__extension__ \
+ ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \
{ __l: 0x7fbfffffUL }).__d)
#else
@@ -48,7 +49,8 @@
# define __nan_bytes { 0xff, 0xff, 0xbf, 0x7f }
# endif
-static union { unsigned char __c[4]; float __d; } __nan_union = { __nan_bytes };
+static union { unsigned char __c[4]; float __d; } __nan_union
+ __attribute__ ((__unused__)) = { __nan_bytes };
# define NAN (__nan_union.__d)
#endif /* GCC. */
diff --git a/libc/ports/sysdeps/mips/bsd-_setjmp.S b/libc/ports/sysdeps/mips/bsd-_setjmp.S
index a932096a0..50cce7e72 100644
--- a/libc/ports/sysdeps/mips/bsd-_setjmp.S
+++ b/libc/ports/sysdeps/mips/bsd-_setjmp.S
@@ -22,6 +22,8 @@
#include <sysdep.h>
+ .set nomips16
+
#ifdef __PIC__
.option pic2
#endif
@@ -38,5 +40,5 @@ ENTRY (_setjmp)
#else
j C_SYMBOL_NAME (__sigsetjmp)
#endif
- .end _setjmp
+END (_setjmp)
libc_hidden_def (_setjmp)
diff --git a/libc/ports/sysdeps/mips/bsd-setjmp.S b/libc/ports/sysdeps/mips/bsd-setjmp.S
index 406c8492d..18e8b0f90 100644
--- a/libc/ports/sysdeps/mips/bsd-setjmp.S
+++ b/libc/ports/sysdeps/mips/bsd-setjmp.S
@@ -22,6 +22,8 @@
#include <sysdep.h>
+ .set nomips16
+
#ifdef __PIC__
.option pic2
#endif
@@ -38,4 +40,4 @@ ENTRY (setjmp)
#else
j C_SYMBOL_NAME (__sigsetjmp)
#endif
- .end setjmp
+END (setjmp)
diff --git a/libc/ports/sysdeps/mips/dl-machine.h b/libc/ports/sysdeps/mips/dl-machine.h
index 91f7a7bb5..a7c784fec 100644
--- a/libc/ports/sysdeps/mips/dl-machine.h
+++ b/libc/ports/sysdeps/mips/dl-machine.h
@@ -119,6 +119,7 @@ static inline ElfW(Addr)
elf_machine_load_address (void)
{
ElfW(Addr) addr;
+#ifndef __mips16
asm (" .set noreorder\n"
" " STRINGXP (PTR_LA) " %0, 0f\n"
" bltzal $0, 0f\n"
@@ -128,6 +129,19 @@ elf_machine_load_address (void)
: "=r" (addr)
: /* No inputs */
: "$31");
+#else
+ ElfW(Addr) tmp;
+ asm (" .set noreorder\n"
+ " move %1,$gp\n"
+ " lw %1,%%got(0f)(%1)\n"
+ "0: .fill 0\n" /* Clear the ISA bit on 0:. */
+ " la %0,0b\n"
+ " addiu %1,%%lo(0b)\n"
+ " subu %0,%1\n"
+ " .set reorder\n"
+ : "=d" (addr), "=d" (tmp)
+ : /* No inputs */);
+#endif
return addr;
}
@@ -210,7 +224,8 @@ do { \
2) That under Unix the entry is named __start
and not just plain _start. */
-#define RTLD_START asm (\
+#ifndef __mips16
+# define RTLD_START asm (\
".text\n\
" _RTLD_PROLOGUE(ENTRY_POINT) "\
" STRINGXV(SETUP_GPX($25)) "\n\
@@ -283,6 +298,91 @@ do { \
".previous"\
);
+#else /* __mips16 */
+/* MIPS16 version. We currently only support O32 under MIPS16; the proper
+ assembly preprocessor abstractions will need to be added if other ABIs
+ are to be supported. */
+
+# define RTLD_START asm (\
+ ".text\n\
+ .set mips16\n\
+ " _RTLD_PROLOGUE (ENTRY_POINT) "\
+ # Construct GP value in $3.\n\
+ li $3, %hi(_gp_disp)\n\
+ addiu $4, $pc, %lo(_gp_disp)\n\
+ sll $3, 16\n\
+ addu $3, $4\n\
+ move $28, $3\n\
+ lw $4, %got(_DYNAMIC)($3)\n\
+ sw $4, -0x7ff0($3)\n\
+ move $4, $sp\n\
+ addiu $sp, -16\n\
+ # _dl_start() is sufficiently near to use pc-relative\n\
+ # load address.\n\
+ la $3, _dl_start\n\
+ move $25, $3\n\
+ jalr $3\n\
+ addiu $sp, 16\n\
+ " _RTLD_EPILOGUE (ENTRY_POINT) "\
+ \n\
+ \n\
+ " _RTLD_PROLOGUE (_dl_start_user) "\
+ li $16, %hi(_gp_disp)\n\
+ addiu $4, $pc, %lo(_gp_disp)\n\
+ sll $16, 16\n\
+ addu $16, $4\n\
+ move $17, $2\n\
+ move $28, $16\n\
+ lw $4, %got(_dl_skip_args)($16)\n\
+ lw $4, 0($4)\n\
+ beqz $4, 1f\n\
+ # Load the original argument count.\n\
+ lw $5, 0($sp)\n\
+ # Subtract _dl_skip_args from it.\n\
+ subu $5, $4\n\
+ # Adjust the stack pointer to skip _dl_skip_args words.\n\
+ sll $4, " STRINGXP (PTRLOG) "\n\
+ move $6, $sp\n\
+ addu $6, $4\n\
+ move $sp, $6\n\
+ # Save back the modified argument count.\n\
+ sw $5, 0($sp)\n\
+1: # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env) \n\
+ lw $4, %got(_rtld_local)($16)\n\
+ lw $4, 0($4)\n\
+ lw $5, 0($sp)\n\
+ addiu $6, $sp, " STRINGXP (PTRSIZE) "\n\
+ sll $7, $5, " STRINGXP (PTRLOG) "\n\
+ addu $7, $6\n\
+ addu $7, " STRINGXP (PTRSIZE) "\n\
+ # Make sure the stack pointer is aligned for _dl_init_internal.\n\
+ li $2, 2 * " STRINGXP (SZREG) "\n\
+ neg $2, $2\n\
+ move $3, $sp\n\
+ and $2, $3\n\
+ sw $3, -" STRINGXP (SZREG) "($2)\n\
+ addiu $2, -32\n\
+ move $sp, $2\n\
+ sw $16, 16($sp)\n\
+ # Call the function to run the initializers.\n\
+ lw $2, %call16(_dl_init_internal)($16)\n\
+ move $25, $2\n\
+ jalr $2\n\
+ # Restore the stack pointer for _start.\n\
+ lw $2, 32-" STRINGXP (SZREG) "($sp)\n\
+ move $sp, $2\n\
+ move $28, $16\n\
+ # Pass our finalizer function to the user in $2 as per ELF ABI.\n\
+ lw $2, %call16(_dl_fini)($16)\n\
+ # Jump to the user entry point.\n\
+ move $25, $17\n\
+ jr $17\n\t"\
+ _RTLD_EPILOGUE (_dl_start_user)\
+ ".previous"\
+);
+
+#endif /* __mips16 */
+
/* Names of the architecture-specific auditing callback functions. */
# if _MIPS_SIM == _ABIO32
# define ARCH_LA_PLTENTER mips_o32_gnu_pltenter
diff --git a/libc/ports/sysdeps/mips/dl-trampoline.c b/libc/ports/sysdeps/mips/dl-trampoline.c
index 57fb05b86..605e44e18 100644
--- a/libc/ports/sysdeps/mips/dl-trampoline.c
+++ b/libc/ports/sysdeps/mips/dl-trampoline.c
@@ -292,9 +292,11 @@ __dl_runtime_resolve (ElfW(Word) sym_index,
#endif
+#ifndef __mips16
asm ("\n\
.text\n\
.align 2\n\
+ .set nomips16\n\
.globl _dl_runtime_resolve\n\
.type _dl_runtime_resolve,@function\n\
.ent _dl_runtime_resolve\n\
@@ -351,6 +353,7 @@ _dl_runtime_resolve:\n\
asm ("\n\
.text\n\
.align 2\n\
+ .set nomips16\n\
.globl _dl_runtime_pltresolve\n\
.type _dl_runtime_pltresolve,@function\n\
.ent _dl_runtime_pltresolve\n\
@@ -381,3 +384,130 @@ _dl_runtime_pltresolve:\n\
.previous\n\
");
+#elif _MIPS_SIM == _ABIO32 /* __mips16 */
+/* MIPS16 version, O32 only. */
+asm ("\n\
+ .text\n\
+ .align 2\n\
+ .set mips16\n\
+ .globl _dl_runtime_resolve\n\
+ .type _dl_runtime_resolve,@function\n\
+ .ent _dl_runtime_resolve\n\
+_dl_runtime_resolve:\n\
+ .frame $29, " STRINGXP (ELF_DL_FRAME_SIZE) ", $31\n\
+ # Save arguments and sp value in stack.\n\t"
+# if _MIPS_ISA >= _MIPS_ISA_MIPS32
+ "save " STRINGXP (ELF_DL_FRAME_SIZE) ", $4-$7, $ra\n\t"
+# else
+ "addiu $sp, -" STRINGXP (ELF_DL_FRAME_SIZE) "\n\
+ sw $7, 32($sp)\n\
+ sw $6, 28($sp)\n\
+ sw $5, 24($sp)\n\
+ sw $4, 20($sp)\n\t"
+# endif
+ "# Preserve caller's $ra, for RESTORE instruction below.\n\
+ move $5, $15\n\
+ sw $5, 36($sp)\n\
+ # Compute GP into $2.\n\
+ li $2, %hi(_gp_disp)\n\
+ addiu $3, $pc, %lo(_gp_disp)\n\
+ sll $2, 16\n\
+ addu $2, $3\n\
+ lw $3, %got(__dl_runtime_resolve)($2)\n\
+ move $4, $24\n\
+ addiu $3, %lo(__dl_runtime_resolve)\n\
+ move $7, $ra\n\
+ move $6, $28\n\
+ move $25, $3\n\
+ jalr $3\n\t"
+# if _MIPS_ISA >= _MIPS_ISA_MIPS32
+ "restore " STRINGXP(ELF_DL_FRAME_SIZE) ", $4-$7, $ra\n\t"
+# else
+ "# Restore $ra, move placed further down to hide latency.\n\
+ lw $4, 36($sp)\n\
+ lw $5, 24($sp)\n\
+ lw $6, 28($sp)\n\
+ lw $7, 32($sp)\n\
+ move $ra, $4\n\
+ lw $4, 20($sp)\n\
+ addiu $sp, " STRINGXP(ELF_DL_FRAME_SIZE) "\n\t"
+# endif
+ "move $25, $2\n\
+ jr $2\n\
+ .end _dl_runtime_resolve\n\
+ .previous\n\
+");
+
+asm ("\n\
+ .text\n\
+ .align 2\n\
+ .set mips16\n\
+ .globl _dl_runtime_pltresolve\n\
+ .type _dl_runtime_pltresolve,@function\n\
+ .ent _dl_runtime_pltresolve\n\
+_dl_runtime_pltresolve:\n\
+ .frame $29, " STRINGXP(ELF_DL_PLT_FRAME_SIZE) ", $31\n\
+ # Save arguments and sp value in stack.\n\t"
+# if _MIPS_ISA >= _MIPS_ISA_MIPS32
+ "save " STRINGXP(ELF_DL_PLT_FRAME_SIZE) ", $4-$7, $ra\n\t"
+# else
+ "addiu $sp, -" STRINGXP(ELF_DL_PLT_FRAME_SIZE) "\n\
+ sw $7, 40($sp)\n\
+ sw $6, 36($sp)\n\
+ sw $5, 32($sp)\n\
+ sw $4, 28($sp)\n\t"
+# endif
+ "# Preserve MIPS16 stub function arguments.\n\
+ sw $3, 20($sp)\n\
+ sw $2, 16($sp)\n\
+ # Preserve caller's $ra, for RESTORE instruction below.\n\
+ move $3, $15\n\
+ sw $3, 44($sp)\n\
+ # Compute GP into $2.\n\
+ li $2, %hi(_gp_disp)\n\
+ addiu $3, $pc, %lo(_gp_disp)\n\
+ sll $2, 16\n\
+ addu $2, $3\n\
+ # Save GP value in slot.\n\
+ sw $2, 24($sp)\n\
+ # Load _dl_fixup address.\n\
+ lw $6, %call16(_dl_fixup)($2)\n\
+ # Load link map address.\n\
+ move $3, $28\n\
+ lw $4, " STRINGXP (PTRSIZE) "($3)\n\
+ move $5, $24\n\
+ sll $5, " STRINGXP (PTRLOG) " + 1\n\
+ # Call _dl_fixup.\n\
+ move $25, $6\n\
+ jalr $6\n\
+ move $25, $2\n\
+ # Reload GP value into $28.\n\
+ lw $3, 24($sp)\n\
+ move $28, $3\n\
+ lw $3, 16($sp)\n\
+ move $15, $3\n\
+ lw $3, 20($sp)\n\t"
+# if _MIPS_ISA >= _MIPS_ISA_MIPS32
+ "restore " STRINGXP (ELF_DL_PLT_FRAME_SIZE) ", $4-$7, $ra\n\t"
+# else
+ "# Restore $ra, move placed further down to hide latency.\n\
+ lw $4, 44($sp)\n\
+ lw $5, 32($sp)\n\
+ lw $6, 36($sp)\n\
+ lw $7, 40($sp)\n\
+ move $ra, $4\n\
+ lw $4, 28($sp)\n\
+ addiu $sp, " STRINGXP (ELF_DL_PLT_FRAME_SIZE) "\n\t"
+# endif
+ ".set noreorder\n\
+ jr $2\n\
+ move $2, $15\n\
+ .set reorder\n\
+ .end _dl_runtime_pltresolve\n\
+ .previous\n\
+");
+
+#else /* __mips16 && _MIPS_SIM != _ABIO32 */
+# error "MIPS16 support for N32/N64 not implemented"
+
+#endif /* __mips16 */
diff --git a/libc/ports/sysdeps/mips/fpu/e_sqrt.c b/libc/ports/sysdeps/mips/fpu/e_sqrt.c
index cff9cec6e..26314b010 100644
--- a/libc/ports/sysdeps/mips/fpu/e_sqrt.c
+++ b/libc/ports/sysdeps/mips/fpu/e_sqrt.c
@@ -22,7 +22,7 @@
#if (_MIPS_ISA >= _MIPS_ISA_MIPS2)
-double
+double __attribute__ ((nomips16))
__ieee754_sqrt (double x)
{
double z;
diff --git a/libc/ports/sysdeps/mips/fpu/e_sqrtf.c b/libc/ports/sysdeps/mips/fpu/e_sqrtf.c
index 87d242d82..0f7bfd94b 100644
--- a/libc/ports/sysdeps/mips/fpu/e_sqrtf.c
+++ b/libc/ports/sysdeps/mips/fpu/e_sqrtf.c
@@ -22,7 +22,7 @@
#if (_MIPS_ISA >= _MIPS_ISA_MIPS2)
-float
+float __attribute__ ((nomips16))
__ieee754_sqrtf (float x)
{
float z;
diff --git a/libc/ports/sysdeps/mips/fpu_control.h b/libc/ports/sysdeps/mips/fpu_control.h
index 30e54f9c3..6aecb3bc8 100644
--- a/libc/ports/sysdeps/mips/fpu_control.h
+++ b/libc/ports/sysdeps/mips/fpu_control.h
@@ -99,8 +99,15 @@ extern fpu_control_t __fpu_control;
typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
/* Macros for accessing the hardware control word. */
-#define _FPU_GETCW(cw) __asm__ volatile ("cfc1 %0,$31" : "=r" (cw))
-#define _FPU_SETCW(cw) __asm__ volatile ("ctc1 %0,$31" : : "r" (cw))
+extern fpu_control_t __mips_fpu_getcw (void) __THROW;
+extern void __mips_fpu_setcw (fpu_control_t) __THROW;
+#ifdef __mips16
+# define _FPU_GETCW(cw) do { (cw) = __mips_fpu_getcw (); } while (0)
+# define _FPU_SETCW(cw) __mips_fpu_setcw (cw)
+#else
+# define _FPU_GETCW(cw) __asm__ volatile ("cfc1 %0,$31" : "=r" (cw))
+# define _FPU_SETCW(cw) __asm__ volatile ("ctc1 %0,$31" : : "r" (cw))
+#endif
/* Default control word set at startup. */
extern fpu_control_t __fpu_control;
diff --git a/libc/ports/sysdeps/mips/include/sys/asm.h b/libc/ports/sysdeps/mips/include/sys/asm.h
new file mode 100644
index 000000000..7b356e12e
--- /dev/null
+++ b/libc/ports/sysdeps/mips/include/sys/asm.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_ASM_H
+
+# include_next <sys/asm.h>
+
+# undef __mips_cfi_startproc
+# define __mips_cfi_startproc cfi_startproc
+# undef __mips_cfi_endproc
+# define __mips_cfi_endproc cfi_endproc
+
+# if _MIPS_SIM == _ABIO32
+# define SETUP_GP64_REG_CFI(a)
+# define SETUP_GP64_REG(a, b)
+# define SETUP_GP64_STACK_CFI(a)
+# define SETUP_GP64_STACK(a, b)
+# define RESTORE_GP64_REG
+# define RESTORE_GP64_STACK
+# else
+# define SETUP_GP64_REG_CFI(gpsavereg) \
+ cfi_register (gp, gpsavereg)
+# define SETUP_GP64_REG(gpsavereg, proc) \
+ SETUP_GP64 (gpsavereg, proc); \
+ SETUP_GP64_REG_CFI (gpsavereg)
+# define SETUP_GP64_STACK_CFI(gpoffset) \
+ cfi_rel_offset (gp, gpoffset)
+# define SETUP_GP64_STACK(gpoffset, proc) \
+ SETUP_GP64 (gpoffset, proc); \
+ SETUP_GP64_STACK_CFI (gpoffset)
+# define RESTORE_GP64_REG \
+ RESTORE_GP64; \
+ cfi_restore (gp)
+# define RESTORE_GP64_STACK \
+ RESTORE_GP64; \
+ cfi_restore (gp)
+# endif
+
+#endif
diff --git a/libc/ports/sysdeps/mips/machine-gmon.h b/libc/ports/sysdeps/mips/machine-gmon.h
index 8c62d84a9..144c04402 100644
--- a/libc/ports/sysdeps/mips/machine-gmon.h
+++ b/libc/ports/sysdeps/mips/machine-gmon.h
@@ -37,6 +37,8 @@ static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
#define MCOUNT asm(\
".globl _mcount;\n\t" \
".align 2;\n\t" \
+ ".set push;\n\t" \
+ ".set nomips16;\n\t" \
".type _mcount,@function;\n\t" \
".ent _mcount\n\t" \
"_mcount:\n\t" \
@@ -67,9 +69,8 @@ static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
"addu $29,$29,56;\n\t" \
"j $31;\n\t" \
"move $31,$1;\n\t" \
- ".set reorder;\n\t" \
- ".set at\n\t" \
- ".end _mcount");
+ ".end _mcount;\n\t" \
+ ".set pop");
#else
@@ -94,6 +95,8 @@ static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
#define MCOUNT asm(\
".globl _mcount;\n\t" \
".align 3;\n\t" \
+ ".set push;\n\t" \
+ ".set nomips16;\n\t" \
".type _mcount,@function;\n\t" \
".ent _mcount\n\t" \
"_mcount:\n\t" \
@@ -132,8 +135,7 @@ static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
PTR_ADDU_STRING " $29,$29,96;\n\t" \
"j $31;\n\t" \
"move $31,$1;\n\t" \
- ".set reorder;\n\t" \
- ".set at\n\t" \
- ".end _mcount");
+ ".end _mcount;\n\t" \
+ ".set pop");
#endif
diff --git a/libc/ports/sysdeps/mips/memset.S b/libc/ports/sysdeps/mips/memset.S
index 8c8606c83..78dab481d 100644
--- a/libc/ports/sysdeps/mips/memset.S
+++ b/libc/ports/sysdeps/mips/memset.S
@@ -18,6 +18,7 @@
#include <sysdep.h>
+ .set nomips16
/* void *memset(void *s, int c, size_t n). */
diff --git a/libc/ports/sysdeps/mips/mips32/crti.S b/libc/ports/sysdeps/mips/mips32/crti.S
index 5b46279c1..5f3e9ba43 100644
--- a/libc/ports/sysdeps/mips/mips32/crti.S
+++ b/libc/ports/sysdeps/mips/mips32/crti.S
@@ -54,6 +54,8 @@
.hidden PREINIT_FUNCTION
#endif
+ .set nomips16
+
.section .init,"ax",@progbits
.p2align 2
.globl _init
diff --git a/libc/ports/sysdeps/mips/mips32/crtn.S b/libc/ports/sysdeps/mips/mips32/crtn.S
index 44cdff0a1..42381c512 100644
--- a/libc/ports/sysdeps/mips/mips32/crtn.S
+++ b/libc/ports/sysdeps/mips/mips32/crtn.S
@@ -36,6 +36,8 @@
/* crtn.S puts function epilogues in the .init and .fini sections
corresponding to the prologues in crti.S. */
+ .set nomips16
+
.section .init,"ax",@progbits
lw $31,28($sp)
.set noreorder
diff --git a/libc/ports/sysdeps/mips/mips32/fpu/Versions b/libc/ports/sysdeps/mips/mips32/fpu/Versions
new file mode 100644
index 000000000..91bbf564b
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/fpu/Versions
@@ -0,0 +1,5 @@
+libc {
+ GLIBC_2.18 {
+ __mips_fpu_getcw; __mips_fpu_setcw;
+ }
+}
diff --git a/libc/ports/sysdeps/mips/memmove.c b/libc/ports/sysdeps/mips/mips32/fpu/fpu_control.c
index fd36859e6..cd107c533 100644
--- a/libc/ports/sysdeps/mips/memmove.c
+++ b/libc/ports/sysdeps/mips/mips32/fpu/fpu_control.c
@@ -1,8 +1,6 @@
-/* Copy memory to memory until the specified number of bytes
- has been copied. Overlap is handled correctly.
- Copyright (C) 2012-2013 Free Software Foundation, Inc.
+/* FPU control word handling, MIPS version, needed by MIPS16 callers.
+ Copyright (C) 1996-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,6 +16,19 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* MIPS' implementation of memcpy is safe to use for memmove. */
-#define MEMCPY_OK_FOR_FWD_MEMMOVE 1
-#include <string/memmove.c>
+#include <math/fpu_control.c>
+
+fpu_control_t
+__mips_fpu_getcw (void)
+{
+ fpu_control_t cw;
+
+ _FPU_GETCW (cw);
+ return cw;
+}
+
+void
+__mips_fpu_setcw (fpu_control_t cw)
+{
+ _FPU_SETCW (cw);
+}
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/add_n.c b/libc/ports/sysdeps/mips/mips32/mips16/add_n.c
new file mode 100644
index 000000000..fbb412041
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/add_n.c
@@ -0,0 +1 @@
+#include <stdlib/add_n.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/addmul_1.c b/libc/ports/sysdeps/mips/mips32/mips16/addmul_1.c
new file mode 100644
index 000000000..c0e4a0bd7
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/addmul_1.c
@@ -0,0 +1 @@
+#include <stdlib/addmul_1.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/fpu/Makefile b/libc/ports/sysdeps/mips/mips32/mips16/fpu/Makefile
new file mode 100644
index 000000000..b58c4eeb0
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/fpu/Makefile
@@ -0,0 +1,5 @@
+# Building hard-float libm as MIPS16 actually produces larger code size,
+# so avoid doing so.
+ifeq ($(subdir),math)
+sysdep-CFLAGS += -mno-mips16
+endif
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/lshift.c b/libc/ports/sysdeps/mips/mips32/mips16/lshift.c
new file mode 100644
index 000000000..2f945d2c5
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/lshift.c
@@ -0,0 +1 @@
+#include <stdlib/lshift.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/mul_1.c b/libc/ports/sysdeps/mips/mips32/mips16/mul_1.c
new file mode 100644
index 000000000..8e758d603
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/mul_1.c
@@ -0,0 +1 @@
+#include <stdlib/mul_1.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/rshift.c b/libc/ports/sysdeps/mips/mips32/mips16/rshift.c
new file mode 100644
index 000000000..4e350a0dc
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/rshift.c
@@ -0,0 +1 @@
+#include <stdlib/rshift.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/sub_n.c b/libc/ports/sysdeps/mips/mips32/mips16/sub_n.c
new file mode 100644
index 000000000..d8b54925b
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/sub_n.c
@@ -0,0 +1 @@
+#include <stdlib/sub_n.c>
diff --git a/libc/ports/sysdeps/mips/mips32/mips16/submul_1.c b/libc/ports/sysdeps/mips/mips32/mips16/submul_1.c
new file mode 100644
index 000000000..44cadf5cc
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips32/mips16/submul_1.c
@@ -0,0 +1 @@
+#include <stdlib/submul_1.c>
diff --git a/libc/ports/sysdeps/mips/mips64/add_n.S b/libc/ports/sysdeps/mips/mips64/add_n.S
index efb6cf424..020d4af09 100644
--- a/libc/ports/sysdeps/mips/mips64/add_n.S
+++ b/libc/ports/sysdeps/mips/mips64/add_n.S
@@ -33,11 +33,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 2
- .globl __mpn_add_n
- .ent __mpn_add_n
-__mpn_add_n:
+ENTRY (__mpn_add_n)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -126,4 +122,4 @@ L(Lend): daddu $11,$11,$2
j $31
or $2,$2,$8
- .end __mpn_add_n
+END (__mpn_add_n)
diff --git a/libc/ports/sysdeps/mips/mips64/addmul_1.S b/libc/ports/sysdeps/mips/mips64/addmul_1.S
index 43838fd2f..46729a65d 100644
--- a/libc/ports/sysdeps/mips/mips64/addmul_1.S
+++ b/libc/ports/sysdeps/mips/mips64/addmul_1.S
@@ -32,11 +32,7 @@
#ifdef PIC
.option pic2
#endif
- .text
- .align 4
- .globl __mpn_addmul_1
- .ent __mpn_addmul_1
-__mpn_addmul_1:
+ENTRY (__mpn_addmul_1)
#ifdef PIC
SETUP_GP /* ??? unused */
#endif
@@ -102,4 +98,4 @@ L(LC0): ld $10,0($4)
j $31
daddu $2,$9,$2 # add high product limb and carry from addition
- .end __mpn_addmul_1
+END (__mpn_addmul_1)
diff --git a/libc/ports/sysdeps/mips/mips64/bsd-_setjmp.S b/libc/ports/sysdeps/mips/mips64/bsd-_setjmp.S
index de36cf0e8..5d0f76c13 100644
--- a/libc/ports/sysdeps/mips/mips64/bsd-_setjmp.S
+++ b/libc/ports/sysdeps/mips/mips64/bsd-_setjmp.S
@@ -31,17 +31,17 @@ ENTRY (_setjmp)
#ifdef __PIC__
SETUP_GP
#endif
- SETUP_GP64 (v0, C_SYMBOL_NAME (_setjmp))
+ SETUP_GP64_REG (v0, C_SYMBOL_NAME (_setjmp))
PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp)
#if _MIPS_SIM == _ABIO32
nop
#endif
- RESTORE_GP64
+ RESTORE_GP64_REG
move a1, zero /* Pass a second argument of zero. */
#ifdef __PIC__
jr t9
#else
j C_SYMBOL_NAME (__sigsetjmp)
#endif
- .end _setjmp
+END (_setjmp)
libc_hidden_def (_setjmp)
diff --git a/libc/ports/sysdeps/mips/mips64/bsd-setjmp.S b/libc/ports/sysdeps/mips/mips64/bsd-setjmp.S
index c3e26bfc2..784e16e33 100644
--- a/libc/ports/sysdeps/mips/mips64/bsd-setjmp.S
+++ b/libc/ports/sysdeps/mips/mips64/bsd-setjmp.S
@@ -31,16 +31,16 @@ ENTRY (setjmp)
#ifdef __PIC__
SETUP_GP
#endif
- SETUP_GP64 (v0, C_SYMBOL_NAME (setjmp))
+ SETUP_GP64_REG (v0, C_SYMBOL_NAME (setjmp))
PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp)
#if _MIPS_SIM == _ABIO32
nop
#endif
- RESTORE_GP64
+ RESTORE_GP64_REG
dli a1, 1 /* Pass a second argument of one. */
#ifdef __PIC__
jr t9
#else
j C_SYMBOL_NAME (__sigsetjmp)
#endif
- .end setjmp
+END (setjmp)
diff --git a/libc/ports/sysdeps/mips/mips64/lshift.S b/libc/ports/sysdeps/mips/mips64/lshift.S
index e0b02bc25..740408d75 100644
--- a/libc/ports/sysdeps/mips/mips64/lshift.S
+++ b/libc/ports/sysdeps/mips/mips64/lshift.S
@@ -32,11 +32,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 2
- .globl __mpn_lshift
- .ent __mpn_lshift
-__mpn_lshift:
+ENTRY (__mpn_lshift)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -101,4 +97,4 @@ L(Loop): ld $3,-16($5)
L(Lend): dsll $8,$10,$7
j $31
sd $8,-8($4)
- .end __mpn_lshift
+END (__mpn_lshift)
diff --git a/libc/ports/sysdeps/mips/mips64/mul_1.S b/libc/ports/sysdeps/mips/mips64/mul_1.S
index 2fe28d369..e1360658a 100644
--- a/libc/ports/sysdeps/mips/mips64/mul_1.S
+++ b/libc/ports/sysdeps/mips/mips64/mul_1.S
@@ -33,11 +33,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 4
- .globl __mpn_mul_1
- .ent __mpn_mul_1
-__mpn_mul_1:
+ENTRY (__mpn_mul_1)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -91,4 +87,4 @@ L(LC0): mflo $10
j $31
daddu $2,$9,$2 # add high product limb and carry from addition
- .end __mpn_mul_1
+END (__mpn_mul_1)
diff --git a/libc/ports/sysdeps/mips/mips64/n32/crti.S b/libc/ports/sysdeps/mips/mips64/n32/crti.S
index d9066b2d6..ddcc9cc7f 100644
--- a/libc/ports/sysdeps/mips/mips64/n32/crti.S
+++ b/libc/ports/sysdeps/mips/mips64/n32/crti.S
@@ -54,6 +54,8 @@
.hidden PREINIT_FUNCTION
#endif
+ .set nomips16
+
.section .init,"ax",@progbits
.p2align 2
.globl _init
diff --git a/libc/ports/sysdeps/mips/mips64/n32/crtn.S b/libc/ports/sysdeps/mips/mips64/n32/crtn.S
index daf7d4256..5eb2b4f48 100644
--- a/libc/ports/sysdeps/mips/mips64/n32/crtn.S
+++ b/libc/ports/sysdeps/mips/mips64/n32/crtn.S
@@ -36,6 +36,8 @@
/* crtn.S puts function epilogues in the .init and .fini sections
corresponding to the prologues in crti.S. */
+ .set nomips16
+
.section .init,"ax",@progbits
ld $31,8($sp)
ld $28,0($sp)
diff --git a/libc/ports/sysdeps/mips/mips64/n64/crti.S b/libc/ports/sysdeps/mips/mips64/n64/crti.S
index 2111ba539..0c66d0de6 100644
--- a/libc/ports/sysdeps/mips/mips64/n64/crti.S
+++ b/libc/ports/sysdeps/mips/mips64/n64/crti.S
@@ -54,6 +54,8 @@
.hidden PREINIT_FUNCTION
#endif
+ .set nomips16
+
.section .init,"ax",@progbits
.p2align 2
.globl _init
diff --git a/libc/ports/sysdeps/mips/mips64/n64/crtn.S b/libc/ports/sysdeps/mips/mips64/n64/crtn.S
index c66a2e555..4c014b711 100644
--- a/libc/ports/sysdeps/mips/mips64/n64/crtn.S
+++ b/libc/ports/sysdeps/mips/mips64/n64/crtn.S
@@ -36,6 +36,8 @@
/* crtn.S puts function epilogues in the .init and .fini sections
corresponding to the prologues in crti.S. */
+ .set nomips16
+
.section .init,"ax",@progbits
ld $31,8($sp)
ld $28,0($sp)
diff --git a/libc/ports/sysdeps/mips/mips64/rshift.S b/libc/ports/sysdeps/mips/mips64/rshift.S
index 75ac68bb2..0d821f2b7 100644
--- a/libc/ports/sysdeps/mips/mips64/rshift.S
+++ b/libc/ports/sysdeps/mips/mips64/rshift.S
@@ -32,11 +32,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 2
- .globl __mpn_rshift
- .ent __mpn_rshift
-__mpn_rshift:
+ENTRY (__mpn_rshift)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -98,4 +94,4 @@ L(Loop): ld $3,8($5)
L(Lend): dsrl $8,$10,$7
j $31
sd $8,0($4)
- .end __mpn_rshift
+END (__mpn_rshift)
diff --git a/libc/ports/sysdeps/mips/mips64/setjmp.S b/libc/ports/sysdeps/mips/mips64/setjmp.S
index 53ed92ca4..5afbbe756 100644
--- a/libc/ports/sysdeps/mips/mips64/setjmp.S
+++ b/libc/ports/sysdeps/mips/mips64/setjmp.S
@@ -29,16 +29,16 @@ ENTRY (__sigsetjmp)
#ifdef __PIC__
SETUP_GP
#endif
- SETUP_GP64 (v0, C_SYMBOL_NAME (__sigsetjmp))
+ SETUP_GP64_REG (v0, C_SYMBOL_NAME (__sigsetjmp))
move a2, sp
move a3, fp
PTR_LA t9, __sigsetjmp_aux
#if _MIPS_SIM == _ABIO32
nop
#endif
- RESTORE_GP64
+ RESTORE_GP64_REG
#if _MIPS_SIM != _ABIO32
move a4, gp
#endif
jr t9
- .end __sigsetjmp
+END (__sigsetjmp)
diff --git a/libc/ports/sysdeps/mips/mips64/sub_n.S b/libc/ports/sysdeps/mips/mips64/sub_n.S
index ea8f4bd4c..dd6f69184 100644
--- a/libc/ports/sysdeps/mips/mips64/sub_n.S
+++ b/libc/ports/sysdeps/mips/mips64/sub_n.S
@@ -33,11 +33,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 2
- .globl __mpn_sub_n
- .ent __mpn_sub_n
-__mpn_sub_n:
+ENTRY (__mpn_sub_n)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -126,4 +122,4 @@ L(Lend): daddu $11,$11,$2
j $31
or $2,$2,$8
- .end __mpn_sub_n
+END (__mpn_sub_n)
diff --git a/libc/ports/sysdeps/mips/mips64/submul_1.S b/libc/ports/sysdeps/mips/mips64/submul_1.S
index 22239d52b..bf5d6ffce 100644
--- a/libc/ports/sysdeps/mips/mips64/submul_1.S
+++ b/libc/ports/sysdeps/mips/mips64/submul_1.S
@@ -33,11 +33,7 @@
#ifdef __PIC__
.option pic2
#endif
- .text
- .align 4
- .globl __mpn_submul_1
- .ent __mpn_submul_1
-__mpn_submul_1:
+ENTRY (__mpn_submul_1)
#ifdef __PIC__
SETUP_GP /* ??? unused */
#endif
@@ -103,4 +99,4 @@ L(LC0): ld $10,0($4)
j $31
daddu $2,$9,$2 # add high product limb and carry from addition
- .end __mpn_submul_1
+END (__mpn_submul_1)
diff --git a/libc/ports/sysdeps/mips/nptl/tls.h b/libc/ports/sysdeps/mips/nptl/tls.h
index 0c9199534..2529408f2 100644
--- a/libc/ports/sysdeps/mips/nptl/tls.h
+++ b/libc/ports/sysdeps/mips/nptl/tls.h
@@ -37,12 +37,17 @@ typedef union dtv
} pointer;
} dtv_t;
+#ifdef __mips16
+/* MIPS16 uses GCC builtin to access the TP. */
+# define READ_THREAD_POINTER() (__builtin_thread_pointer ())
+#else
/* Note: rd must be $v1 to be ABI-conformant. */
# define READ_THREAD_POINTER() \
({ void *__result; \
asm volatile (".set\tpush\n\t.set\tmips32r2\n\t" \
"rdhwr\t%0, $29\n\t.set\tpop" : "=v" (__result)); \
__result; })
+#endif
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
diff --git a/libc/ports/sysdeps/mips/preconfigure b/libc/ports/sysdeps/mips/preconfigure
index 9190eee87..b215eb2c1 100644
--- a/libc/ports/sysdeps/mips/preconfigure
+++ b/libc/ports/sysdeps/mips/preconfigure
@@ -25,5 +25,10 @@ mips64*) base_machine=mips64
CPPFLAGS="$CPPFLAGS -mabi=$mips_config_abi"
fi
;;
-mips*) base_machine=mips machine=mips/mips32/$machine ;;
+mips*) base_machine=mips
+ case "$CC $CFLAGS $CPPFLAGS " in
+ *" -mips16 "*) machine=mips/mips32/mips16/$machine ;;
+ *) machine=mips/mips32/$machine ;;
+ esac
+ ;;
esac
diff --git a/libc/ports/sysdeps/mips/setjmp.S b/libc/ports/sysdeps/mips/setjmp.S
index 7c53b97b2..f014b73b3 100644
--- a/libc/ports/sysdeps/mips/setjmp.S
+++ b/libc/ports/sysdeps/mips/setjmp.S
@@ -17,6 +17,8 @@
#include <sysdep.h>
+ .set nomips16
+
/* The function __sigsetjmp_aux saves all the registers, but it can't
reliably access the stack or frame pointers, so we pass them in as
extra arguments. */
@@ -41,4 +43,4 @@ ENTRY (__sigsetjmp)
#else
j __sigsetjmp_aux
#endif
- .end __sigsetjmp
+END (__sigsetjmp)
diff --git a/libc/ports/sysdeps/mips/setjmp_aux.c b/libc/ports/sysdeps/mips/setjmp_aux.c
index a955a4ffa..cb9ea245b 100644
--- a/libc/ports/sysdeps/mips/setjmp_aux.c
+++ b/libc/ports/sysdeps/mips/setjmp_aux.c
@@ -23,7 +23,7 @@
pointer. We do things this way because it's difficult to reliably
access them in C. */
-int
+int __attribute__ ((nomips16))
__sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp)
{
#ifdef __mips_hard_float
diff --git a/libc/ports/sysdeps/mips/start.S b/libc/ports/sysdeps/mips/start.S
index 82b7a229f..83a68959a 100644
--- a/libc/ports/sysdeps/mips/start.S
+++ b/libc/ports/sysdeps/mips/start.S
@@ -74,14 +74,15 @@
.text
.globl ENTRY_POINT
.type ENTRY_POINT,@function
+#ifndef __mips16
ENTRY_POINT:
-#ifdef __PIC__
+# ifdef __PIC__
SETUP_GPX($0)
SETUP_GPX64($25,$0)
-#else
+# else
PTR_LA $28, _gp /* Setup GP correctly if we're non-PIC. */
move $31, $0
-#endif
+# endif
PTR_LA $4, main /* main */
PTR_L $5, 0($29) /* argc */
@@ -92,22 +93,85 @@ ENTRY_POINT:
on o32 and quad words (16 bytes) on n32 and n64. */
and $29, -2 * SZREG
-#if _MIPS_SIM == _ABIO32
+# if _MIPS_SIM == _ABIO32
PTR_SUBIU $29, 32
-#endif
+# endif
PTR_LA $7, __libc_csu_init /* init */
PTR_LA $8, __libc_csu_fini
-#if _MIPS_SIM == _ABIO32
+# if _MIPS_SIM == _ABIO32
PTR_S $8, 16($29) /* fini */
PTR_S $2, 20($29) /* rtld_fini */
PTR_S $29, 24($29) /* stack_end */
-#else
+# else
move $9, $2 /* rtld_fini */
move $10, $29 /* stack_end */
-#endif
+# endif
jal __libc_start_main
hlt: b hlt /* Crash if somehow it does return. */
+#elif _MIPS_SIM == _ABIO32 /* __mips16 */
+ /* MIPS16 entry point. */
+ .set mips16
+ENTRY_POINT:
+# ifdef __PIC__
+ li $3, %hi(_gp_disp)
+ addiu $4, $pc, %lo(_gp_disp)
+ sll $3, 16
+ addu $3, $4
+ move $gp, $3
+# else
+ li $3, %hi(_gp)
+ sll $3, 16
+ addiu $3, %lo(_gp)
+ move $gp, $3
+# endif
+ /* Tie end of stack frames. */
+ li $4, 0
+ move $31, $4
+ /* Create new SP value in $7, including alignment. */
+ li $4, 2 * SZREG
+ neg $4, $4
+ move $7, $sp
+ and $7, $4
+ addiu $7, -32
+ /* Load arguments with original SP. */
+ lw $5, 0($sp)
+ addiu $6, $sp, PTRSIZE
+ /* Update SP. */
+ move $sp, $7
+ /* Lay out last arguments, and call __libc_start_main(). */
+# ifdef __PIC__
+ sw $7, 24($sp) /* stack_end */
+ lw $4, %got(__libc_csu_fini)($3)
+ lw $7, %got(__libc_csu_init)($3) /* init */
+ sw $4, 16($sp) /* fini */
+ lw $4, %got(main)($3) /* main */
+ lw $3, %call16(__libc_start_main)($3)
+ sw $2, 20($sp) /* rtld_fini */
+ move $25, $3
+ jalr $3
+# else
+ lw $4, 1f
+ sw $7, 24($sp) /* stack_end */
+ lw $7, 2f /* init */
+ sw $4, 16($sp) /* fini */
+ lw $4, 3f /* main */
+ sw $2, 20($sp) /* rtld_fini */
+ jal __libc_start_main
+# endif
+hlt: b hlt /* Crash if somehow it does return. */
+# ifndef __PIC__
+ .align 2
+1: .word __libc_csu_fini
+2: .word __libc_csu_init
+3: .word main
+# endif
+
+#else /* __mips16 && _MIPS_SIM != _ABIO32 */
+# error "MIPS16 support for N32/N64 not implemented"
+
+#endif /* __mips16 */
+
/* Define a symbol for the first piece of initialized data. */
.data
.globl __data_start
diff --git a/libc/ports/sysdeps/mips/sys/asm.h b/libc/ports/sysdeps/mips/sys/asm.h
index 605451a88..293cf364e 100644
--- a/libc/ports/sysdeps/mips/sys/asm.h
+++ b/libc/ports/sysdeps/mips/sys/asm.h
@@ -26,6 +26,10 @@
# define CAT(str1,str2) __CAT(str1,str2)
#endif
+/* Redefined as nonempty in the internal header. */
+#define __mips_cfi_startproc /* Empty. */
+#define __mips_cfi_endproc /* Empty. */
+
/*
* Macros to handle different pointer/register sizes for 32/64-bit code
*
@@ -147,7 +151,8 @@ l: \
.align 2; \
.type symbol,@function; \
.ent symbol,0; \
-symbol: .frame sp,0,ra
+symbol: .frame sp,0,ra; \
+ __mips_cfi_startproc
/*
* NESTED - declare nested routine entry point
@@ -157,13 +162,15 @@ symbol: .frame sp,0,ra
.align 2; \
.type symbol,@function; \
.ent symbol,0; \
-symbol: .frame sp, framesize, rpc
+symbol: .frame sp, framesize, rpc; \
+ __mips_cfi_startproc
/*
* END - mark end of function
*/
#ifndef END
# define END(function) \
+ __mips_cfi_endproc; \
.end function; \
.size function,.-function
#endif
@@ -173,7 +180,7 @@ symbol: .frame sp, framesize, rpc
*/
#define EXPORT(symbol) \
.globl symbol; \
-symbol:
+symbol: __mips_cfi_startproc
/*
* ABS - export absolute symbol
diff --git a/libc/ports/sysdeps/mips/sys/tas.h b/libc/ports/sysdeps/mips/sys/tas.h
index 603346ac3..871818565 100644
--- a/libc/ports/sysdeps/mips/sys/tas.h
+++ b/libc/ports/sysdeps/mips/sys/tas.h
@@ -24,7 +24,8 @@
__BEGIN_DECLS
-extern int _test_and_set (int *__p, int __v) __THROW;
+extern int _test_and_set (int *__p, int __v)
+ __THROW __attribute__ ((__nomips16__));
#ifdef __USE_EXTERN_INLINES
@@ -32,7 +33,7 @@ extern int _test_and_set (int *__p, int __v) __THROW;
# define _EXTERN_INLINE __extern_inline
# endif
-_EXTERN_INLINE int
+_EXTERN_INLINE int __attribute__ ((__nomips16__))
__NTH (_test_and_set (int *__p, int __v))
{
int __r, __t;
diff --git a/libc/ports/sysdeps/mips/tls-macros.h b/libc/ports/sysdeps/mips/tls-macros.h
index 8fe2e4a15..3e87e42ea 100644
--- a/libc/ports/sysdeps/mips/tls-macros.h
+++ b/libc/ports/sysdeps/mips/tls-macros.h
@@ -12,16 +12,33 @@
(abicalls pic0) function. */
#ifndef __PIC__
# if _MIPS_SIM != _ABI64
-# define LOAD_GP "move %[tmp], $28\n\tla $28, __gnu_local_gp\n\t"
+# ifndef __mips16
+# define LOAD_GP "move %[tmp], $28\n\tla $28, __gnu_local_gp\n\t"
+# else
+# define LOAD_GP \
+ "li %[tmp], %%hi(__gnu_local_gp)\n\t" \
+ "sll %[tmp], 16\n\t" \
+ "addiu %[tmp], %%lo(__gnu_local_gp)\n\t"
+# endif
# else
# define LOAD_GP "move %[tmp], $28\n\tdla $28, __gnu_local_gp\n\t"
# endif
# define UNLOAD_GP "\n\tmove $28, %[tmp]"
#else
-# define LOAD_GP
+/* MIPS16 (re)creates the GP value using PC-relative instructions. */
+# ifdef __mips16
+# define LOAD_GP \
+ "li %[tmp], %%hi(_gp_disp)\n\t" \
+ "addiu %0, $pc, %%lo(_gp_disp)\n\t" \
+ "sll %[tmp], 16\n\t" \
+ "addu %[tmp], %0\n\t"
+# else
+# define LOAD_GP
+# endif
# define UNLOAD_GP
#endif
+#ifndef __mips16
# define TLS_GD(x) \
({ void *__result, *__tmp; \
extern void *__tls_get_addr (void *); \
@@ -62,3 +79,45 @@
ADDU " %0,%0,$3" \
: "+r" (__result) : : "$3"); \
__result; })
+
+#else /* __mips16 */
+/* MIPS16 version. */
+# define TLS_GD(x) \
+ ({ void *__result, *__tmp; \
+ extern void *__tls_get_addr (void *); \
+ asm (LOAD_GP ADDIU " %1, %%tlsgd(" #x ")" \
+ "\n\tmove %0, %1" \
+ : "=d" (__result), [tmp] "=&d" (__tmp)); \
+ (int *) __tls_get_addr (__result); })
+# define TLS_LD(x) \
+ ({ void *__result, *__tmp; \
+ extern void *__tls_get_addr (void *); \
+ asm (LOAD_GP ADDIU " %1, %%tlsldm(" #x ")" \
+ "\n\tmove %0, %1" \
+ : "=d" (__result), [tmp] "=&d" (__tmp)); \
+ __result = __tls_get_addr (__result); \
+ asm ("li $3,%%dtprel_hi(" #x ")\n\t" \
+ "sll $3,16\n\t" \
+ "addiu $3,%%dtprel_lo(" #x ")\n\t" \
+ ADDU " %0,%0,$3" \
+ : "+d" (__result) : : "$3"); \
+ __result; })
+# define TLS_IE(x) \
+ ({ void *__result, *__tmp, *__tp; \
+ __tp = __builtin_thread_pointer (); \
+ asm (LOAD_GP LW " $3,%%gottprel(" #x ")(%1)\n\t" \
+ ADDU " %0,%[tp],$3" \
+ : "=&d" (__result), [tmp] "=&d" (__tmp) \
+ : [tp] "d" (__tp) : "$3"); \
+ __result; })
+# define TLS_LE(x) \
+ ({ void *__result, *__tp; \
+ __tp = __builtin_thread_pointer (); \
+ asm ("li $3,%%tprel_hi(" #x ")\n\t" \
+ "sll $3,16\n\t" \
+ "addiu $3,%%tprel_lo(" #x ")\n\t" \
+ ADDU " %0,%[tp],$3" \
+ : "=d" (__result) : [tp] "d" (__tp) : "$3"); \
+ __result; })
+
+#endif /* __mips16 */
diff --git a/libc/ports/sysdeps/powerpc/nofpu/fegetenv.c b/libc/ports/sysdeps/powerpc/nofpu/fegetenv.c
index 75e89408d..51bcef30a 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/fegetenv.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/fegetenv.c
@@ -19,7 +19,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
-#include <bp-sym.h>
extern int __sim_exceptions;
extern int __sim_disabled_exceptions;
@@ -42,8 +41,8 @@ __fegetenv (fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fegetenv, __old_fegetenv)
-compat_symbol (libm, BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2_1);
+compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1);
#endif
libm_hidden_ver (__fegetenv, fegetenv)
-versioned_symbol (libm, BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2_2);
+versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/nofpu/fesetenv.c b/libc/ports/sysdeps/powerpc/nofpu/fesetenv.c
index 810e1da56..3f35909b6 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/fesetenv.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/fesetenv.c
@@ -19,7 +19,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
-#include <bp-sym.h>
int
__fesetenv (const fenv_t *envp)
@@ -36,8 +35,8 @@ __fesetenv (const fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fesetenv, __old_fesetenv)
-compat_symbol (libm, BP_SYM (__old_fesetenv), BP_SYM (fesetenv), GLIBC_2_1);
+compat_symbol (libm, __old_fesetenv, fesetenv, GLIBC_2_1);
#endif
libm_hidden_ver (__fesetenv, fesetenv)
-versioned_symbol (libm, BP_SYM (__fesetenv), BP_SYM (fesetenv), GLIBC_2_2);
+versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/nofpu/feupdateenv.c b/libc/ports/sysdeps/powerpc/nofpu/feupdateenv.c
index 94366a8d5..163f67310 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/feupdateenv.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/feupdateenv.c
@@ -21,7 +21,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
#include <signal.h>
-#include <bp-sym.h>
int
__feupdateenv (const fenv_t *envp)
@@ -45,8 +44,8 @@ __feupdateenv (const fenv_t *envp)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feupdateenv, __old_feupdateenv)
-compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
+compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
libm_hidden_ver (__feupdateenv, feupdateenv)
-versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);
+versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c b/libc/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c
index e8b2a3a48..2373fa400 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c
@@ -19,7 +19,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
-#include <bp-sym.h>
int
__fegetexceptflag (fexcept_t *flagp, int excepts)
@@ -32,7 +31,7 @@ __fegetexceptflag (fexcept_t *flagp, int excepts)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fegetexceptflag, __old_fegetexceptflag)
-compat_symbol (libm, BP_SYM (__old_fegetexceptflag), BP_SYM (fegetexceptflag), GLIBC_2_1);
+compat_symbol (libm, __old_fegetexceptflag, fegetexceptflag, GLIBC_2_1);
#endif
-versioned_symbol (libm, BP_SYM (__fegetexceptflag), BP_SYM (fegetexceptflag), GLIBC_2_2);
+versioned_symbol (libm, __fegetexceptflag, fegetexceptflag, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c b/libc/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c
index a0861d4a2..cd142b60b 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c
@@ -20,7 +20,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
#include <signal.h>
-#include <bp-sym.h>
#undef feraiseexcept
int
@@ -35,8 +34,8 @@ __feraiseexcept (int x)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feraiseexcept, __old_feraiseexcept)
-compat_symbol (libm, BP_SYM (__old_feraiseexcept), BP_SYM (feraiseexcept), GLIBC_2_1);
+compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1);
#endif
libm_hidden_ver (__feraiseexcept, feraiseexcept)
-versioned_symbol (libm, BP_SYM (__feraiseexcept), BP_SYM (feraiseexcept), GLIBC_2_2);
+versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c b/libc/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c
index 108df304c..3dc368fdd 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c
+++ b/libc/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c
@@ -19,7 +19,6 @@
#include "soft-fp.h"
#include "soft-supp.h"
-#include <bp-sym.h>
int
__fesetexceptflag(const fexcept_t *flagp, int excepts)
@@ -33,7 +32,7 @@ __fesetexceptflag(const fexcept_t *flagp, int excepts)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
-compat_symbol (libm, BP_SYM (__old_fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2_1);
+compat_symbol (libm, __old_fesetexceptflag, fesetexceptflag, GLIBC_2_1);
#endif
-versioned_symbol (libm, BP_SYM (__fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2_2);
+versioned_symbol (libm, __fesetexceptflag, fesetexceptflag, GLIBC_2_2);
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/memcmp.S b/libc/ports/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6439f5c..2849461cd 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* memcmp
@@ -32,7 +30,7 @@
return src1 > src2, src1 < src2 or src1 = src2.
If src1 = src2 and no null, repeat. */
-EALIGN (BP_SYM (memcmp), 5, 0)
+EALIGN (memcmp, 5, 0)
srwi. r6,r5,5
beq L(preword2_count_loop)
mtctr r6
@@ -125,6 +123,6 @@ L(st2):
blt cr5,L(l_r)
addi r3,r0,-1
blr
-END (BP_SYM (memcmp))
+END (memcmp)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp,bcmp)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/memcpy.S b/libc/ports/sysdeps/powerpc/powerpc32/405/memcpy.S
index bca4f74bc..761e9675a 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/memcpy.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/memcpy.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* memcpy
@@ -33,7 +31,7 @@
If 32 or more bytes to copy we use 32 byte copy loop.
Finaly we copy 0-31 extra bytes. */
-EALIGN (BP_SYM (memcpy), 5, 0)
+EALIGN (memcpy, 5, 0)
/* Check if bytes to copy are greater than 256 and if
source and destination are unaligned */
cmpwi r5,0x0100
@@ -128,5 +126,5 @@ L(word4_count_loop_no_dcbt): /* Copy 32 bytes at a time */
L(end_memcpy):
mr r3,r0
blr
-END (BP_SYM (memcpy))
+END (memcpy)
libc_hidden_builtin_def (memcpy)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/memset.S b/libc/ports/sysdeps/powerpc/powerpc32/405/memset.S
index d07a976da..b73dba887 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/memset.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/memset.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* memset
@@ -37,7 +35,7 @@
If 16 or more words to set we use 16 word copy loop.
Finaly we set 0-15 extra bytes with string store. */
-EALIGN (BP_SYM (memset), 5, 0)
+EALIGN (memset, 5, 0)
rlwinm r11,r4,0,24,31
rlwimi r11,r4,8,16,23
rlwimi r11,r11,16,0,15
@@ -150,5 +148,5 @@ L(postword2_count_loop):
mtxer r7
stswx r8,0,r3
b L(end_memset)
-END (BP_SYM (memset))
+END (memset)
libc_hidden_builtin_def (memset)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/strcmp.S b/libc/ports/sysdeps/powerpc/powerpc32/405/strcmp.S
index faa7cf33b..c0b21907b 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/strcmp.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/strcmp.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* strcmp
@@ -34,7 +32,7 @@
return src1 > src2, src1 < src2 or src1 = src2.
If src1 = src2 and no null, repeat. */
-EALIGN (BP_SYM(strcmp),5,0)
+EALIGN (strcmp,5,0)
neg r7,r3
clrlwi r7,r7,20
neg r8,r4
@@ -132,5 +130,5 @@ L(byte_loop):
cmpwi r5,0
beq L(end_strcmp)
b L(byte_loop)
-END (BP_SYM (strcmp))
+END (strcmp)
libc_hidden_builtin_def (strcmp)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/strcpy.S b/libc/ports/sysdeps/powerpc/powerpc32/405/strcpy.S
index 88f8c8ea7..d7c84569d 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/strcpy.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/strcpy.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* strcpy
@@ -33,7 +31,7 @@
where in the last 8 bytes it is. Copy the appropriate bytes of the last
8 according to the null position. */
-EALIGN (BP_SYM (strcpy), 5, 0)
+EALIGN (strcpy, 5, 0)
neg r7,r4
subi r4,r4,1
clrlwi. r8,r7,29
@@ -105,5 +103,5 @@ L(last_bytes_copy_loop2):
L(end_strcpy):
blr
-END (BP_SYM (strcpy))
+END (strcpy)
libc_hidden_builtin_def (strcpy)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/strlen.S b/libc/ports/sysdeps/powerpc/powerpc32/405/strlen.S
index e267f4dfc..77d22ea67 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/strlen.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/strlen.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* strlen
@@ -31,7 +29,7 @@
the count and return the count value. We need to subtract one because
we don't count the null character as a byte. */
-EALIGN (BP_SYM (strlen),5,0)
+EALIGN (strlen,5,0)
neg r7,r3
clrlwi. r8,r7,29
addi r4,0,0
@@ -73,5 +71,5 @@ L(byte_count_loop):
L(end_strlen):
addi r3,r4,-1
blr
-END (BP_SYM (strlen))
+END (strlen)
libc_hidden_builtin_def (strlen)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/405/strncmp.S b/libc/ports/sysdeps/powerpc/powerpc32/405/strncmp.S
index a613869b7..3e2ba5f85 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/405/strncmp.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/405/strncmp.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* strncmp
@@ -39,7 +37,7 @@
return src1 > src2, src1 < src2 or src1 = src2.
If src1 = src2 and no null, repeat. */
-EALIGN (BP_SYM(strncmp),5,0)
+EALIGN (strncmp,5,0)
neg r7,r3
clrlwi r7,r7,20
neg r8,r4
@@ -126,5 +124,5 @@ L(end_strncmp):
L(st1):
mfcr r3
blr
-END (BP_SYM (strncmp))
+END (strncmp)
libc_hidden_builtin_def (strncmp)
diff --git a/libc/ports/sysdeps/powerpc/powerpc32/476/memset.S b/libc/ports/sysdeps/powerpc/powerpc32/476/memset.S
index f681a898d..48c21d620 100644
--- a/libc/ports/sysdeps/powerpc/powerpc32/476/memset.S
+++ b/libc/ports/sysdeps/powerpc/powerpc32/476/memset.S
@@ -17,8 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
/* memset
@@ -37,7 +35,7 @@
If 16 or more words to set we use 16 word copy loop.
Finaly we set 0-15 extra bytes with string store. */
-EALIGN (BP_SYM (memset), 5, 0)
+EALIGN (memset, 5, 0)
rlwinm r11,r4,0,24,31
rlwimi r11,r4,8,16,23
rlwimi r11,r11,16,0,15
@@ -150,5 +148,5 @@ L(postword2_count_loop):
mtxer r7
stswx r8,0,r3
b L(end_memset)
-END (BP_SYM (memset))
+END (memset)
libc_hidden_builtin_def (memset)
diff --git a/libc/ports/sysdeps/unix/alpha/sysdep.h b/libc/ports/sysdeps/unix/alpha/sysdep.h
index 3b71a5ec6..d20bcd6d3 100644
--- a/libc/ports/sysdeps/unix/alpha/sysdep.h
+++ b/libc/ports/sysdeps/unix/alpha/sysdep.h
@@ -161,6 +161,9 @@ __LABEL(name) \
#else /* !ASSEMBLER */
+/* In order to get __set_errno() definition in INLINE_SYSCALL. */
+#include <errno.h>
+
/* ??? Linux needs to be able to override INLINE_SYSCALL for one
particular special case. Make this easy. */
diff --git a/libc/ports/sysdeps/unix/arm/sysdep.S b/libc/ports/sysdeps/unix/arm/sysdep.S
index da07d85f1..40e4d80ec 100644
--- a/libc/ports/sysdeps/unix/arm/sysdep.S
+++ b/libc/ports/sysdeps/unix/arm/sysdep.S
@@ -31,8 +31,9 @@ __syscall_error:
/* We translate the system's EWOULDBLOCK error into EAGAIN.
The GNU C library always defines EWOULDBLOCK==EAGAIN.
EWOULDBLOCK_sys is the original number. */
- cmp r0, $EWOULDBLOCK_sys /* Is it the old EWOULDBLOCK? */
- moveq r0, $EAGAIN /* Yes; translate it to EAGAIN. */
+ cmp r0, $EWOULDBLOCK_sys /* Is it the old EWOULDBLOCK? */
+ it eq
+ moveq r0, $EAGAIN /* Yes; translate it to EAGAIN. */
#endif
#ifndef IS_IN_rtld
@@ -50,14 +51,14 @@ __syscall_error:
mvn r0, #0
RETINSTR (, ip)
-1: .word errno(gottpoff) + (. - 2b - 8)
+1: .word errno(gottpoff) + (. - 2b - PC_OFS)
#elif RTLD_PRIVATE_ERRNO
ldr r1, 1f
0: str r0, [pc, r1]
mvn r0, $0
DO_RET(r14)
-1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8
+1: .word C_SYMBOL_NAME(rtld_errno) - 0b - PC_OFS
#else
#error "Unsupported non-TLS case"
#endif
diff --git a/libc/ports/sysdeps/unix/mips/mips32/sysdep.h b/libc/ports/sysdeps/unix/mips/mips32/sysdep.h
index d7d389253..5d96d05c6 100644
--- a/libc/ports/sysdeps/unix/mips/mips32/sysdep.h
+++ b/libc/ports/sysdeps/unix/mips/mips32/sysdep.h
@@ -24,8 +24,11 @@
#ifdef __PIC__
#define PSEUDO(name, syscall_name, args) \
.align 2; \
+ .set nomips16; \
+ cfi_startproc; \
99: la t9,__syscall_error; \
jr t9; \
+ cfi_endproc; \
ENTRY(name) \
.set noreorder; \
.cpload t9; \
@@ -37,9 +40,12 @@ L(syse1):
#else
#define PSEUDO(name, syscall_name, args) \
.set noreorder; \
+ .set nomips16; \
.align 2; \
+ cfi_startproc; \
99: j __syscall_error; \
nop; \
+ cfi_endproc; \
ENTRY(name) \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
diff --git a/libc/ports/sysdeps/unix/mips/mips64/n32/sysdep.h b/libc/ports/sysdeps/unix/mips/mips64/n32/sysdep.h
index 37a67a2e6..c55b95cc2 100644
--- a/libc/ports/sysdeps/unix/mips/mips64/n32/sysdep.h
+++ b/libc/ports/sysdeps/unix/mips/mips64/n32/sysdep.h
@@ -26,13 +26,18 @@
#ifdef __PIC__
#define PSEUDO(name, syscall_name, args) \
.align 2; \
+ .set nomips16; \
+ cfi_startproc; \
99:; \
.set noat; \
.cpsetup t9, $1, name; \
+ cfi_register (gp, $1); \
.set at; \
la t9,__syscall_error; \
.cpreturn; \
+ cfi_restore (gp); \
jr t9; \
+ cfi_endproc; \
ENTRY(name) \
li v0, SYS_ify(syscall_name); \
syscall; \
@@ -42,8 +47,11 @@ L(syse1):
#define PSEUDO(name, syscall_name, args) \
.set noreorder; \
.align 2; \
+ .set nomips16; \
+ cfi_startproc; \
99: j __syscall_error; \
nop; \
+ cfi_endproc; \
ENTRY(name) \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
diff --git a/libc/ports/sysdeps/unix/mips/mips64/n64/sysdep.h b/libc/ports/sysdeps/unix/mips/mips64/n64/sysdep.h
index 871184bd0..445e6ff73 100644
--- a/libc/ports/sysdeps/unix/mips/mips64/n64/sysdep.h
+++ b/libc/ports/sysdeps/unix/mips/mips64/n64/sysdep.h
@@ -26,13 +26,18 @@
#ifdef __PIC__
#define PSEUDO(name, syscall_name, args) \
.align 2; \
+ .set nomips16; \
+ cfi_startproc; \
99:; \
.set noat; \
.cpsetup t9, $1, name; \
+ cfi_register (gp, $1); \
.set at; \
dla t9,__syscall_error; \
.cpreturn; \
+ cfi_restore (gp); \
jr t9; \
+ cfi_endproc; \
ENTRY(name) \
li v0, SYS_ify(syscall_name); \
syscall; \
@@ -42,8 +47,11 @@ L(syse1):
#define PSEUDO(name, syscall_name, args) \
.set noreorder; \
.align 2; \
+ .set nomips16; \
+ cfi_startproc; \
99: j __syscall_error; \
nop; \
+ cfi_endproc; \
ENTRY(name) \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
diff --git a/libc/ports/sysdeps/unix/mips/sysdep.S b/libc/ports/sysdeps/unix/mips/sysdep.S
index e77891857..e27aada1d 100644
--- a/libc/ports/sysdeps/unix/mips/sysdep.S
+++ b/libc/ports/sysdeps/unix/mips/sysdep.S
@@ -21,6 +21,8 @@
#include <bits/errno.h>
#include <sys/asm.h>
+ .set nomips16
+
#ifdef _LIBC_REENTRANT
LOCALSZ= 3
diff --git a/libc/ports/sysdeps/unix/mips/sysdep.h b/libc/ports/sysdeps/unix/mips/sysdep.h
index bab3bc04c..4d7667ea9 100644
--- a/libc/ports/sysdeps/unix/mips/sysdep.h
+++ b/libc/ports/sysdeps/unix/mips/sysdep.h
@@ -27,39 +27,43 @@
.globl name; \
.align 2; \
.ent name,0; \
- name##:
+ name##: \
+ cfi_startproc;
#undef END
#define END(function) \
+ cfi_endproc; \
.end function; \
.size function,.-function
#define ret j ra ; nop
#undef PSEUDO_END
-#define PSEUDO_END(sym) .end sym; .size sym,.-sym
+#define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
#define PSEUDO_NOERRNO(name, syscall_name, args) \
.align 2; \
ENTRY(name) \
+ .set nomips16; \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
syscall
#undef PSEUDO_END_NOERRNO
-#define PSEUDO_END_NOERRNO(sym) .end sym; .size sym,.-sym
+#define PSEUDO_END_NOERRNO(sym) cfi_endproc; .end sym; .size sym,.-sym
#define ret_NOERRNO ret
#define PSEUDO_ERRVAL(name, syscall_name, args) \
.align 2; \
ENTRY(name) \
+ .set nomips16; \
.set noreorder; \
li v0, SYS_ify(syscall_name); \
syscall
#undef PSEUDO_END_ERRVAL
-#define PSEUDO_END_ERRVAL(sym) .end sym; .size sym,.-sym
+#define PSEUDO_END_ERRVAL(sym) cfi_endproc; .end sym; .size sym,.-sym
#define ret_ERRVAL ret
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c b/libc/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
index 1da284dec..4d1ec3b10 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
@@ -22,7 +22,6 @@
#undef __gettimeofday
#include <bits/libc-vdso.h>
-#include <bp-checks.h>
/* Get the current time of day and timezone information,
putting it into *tv and *tz. If tz is null, *tz is not filled.
@@ -32,7 +31,7 @@ __gettimeofday (tv, tz)
struct timeval *tv;
struct timezone *tz;
{
- return INLINE_VSYSCALL (gettimeofday, 2, CHECK_1 (tv), CHECK_1 (tz));
+ return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
}
libc_hidden_def (__gettimeofday)
weak_alias (__gettimeofday, gettimeofday)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist
index f83e8806a..b04a761fe 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist
@@ -2077,3 +2077,6 @@ GLIBC_2.17
xencrypt F
xprt_register F
xprt_unregister F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c b/libc/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c
index 74b667564..dbaa2246b 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c
@@ -51,8 +51,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
}
result = INLINE_SYSCALL (rt_sigaction, 4, sig,
- act ? __ptrvalue (&kact) : NULL,
- oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
+ act ? &kact : NULL,
+ oact ? &koact : NULL, _NSIG / 8);
if (result >= 0 || errno != ENOSYS)
{
if (oact && result >= 0)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c
index 190674172..fdcad0bfb 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c
@@ -23,7 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c
index d6439505e..48f3cec9d 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c
@@ -22,14 +22,13 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
int
__gethostname (char *name, size_t len)
{
int result;
- result = INLINE_SYSCALL (gethostname, 2, CHECK_N (name, len), len);
+ result = INLINE_SYSCALL (gethostname, 2, name, len);
if (result == 0
/* See whether the string is terminated. If not we will return
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c
index b4633f413..dbd03c1b2 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c
@@ -21,13 +21,12 @@
#include <ipc_priv.h>
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
int
__new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
{
- return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, CHECK_1 (buf));
+ return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, buf);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist
index 1d0cc7ec3..980e08857 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist
@@ -1819,6 +1819,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index e50324cdd..cf6b8bfd9 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
@@ -38,6 +38,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -143,8 +145,31 @@
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ })
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
static inline int __attribute__((always_inline))
__lll_trylock(int *futex)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/semctl.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/semctl.c
index c18c695e3..31278a06c 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/semctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/semctl.c
@@ -33,10 +33,6 @@ union semun
struct seminfo *__buf; /* buffer for IPC_INFO */
};
-#include <bp-checks.h>
-#include <bp-semctl.h>
-
-
int
__new_semctl (int semid, int semnum, int cmd, ...)
{
@@ -51,7 +47,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
va_end (ap);
return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
- CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)->array);
+ arg.array);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c
index 5e5220044..f2217a2b5 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c
@@ -22,13 +22,12 @@
#include <sysdep.h>
#include <sys/syscall.h>
#include <bits/wordsize.h>
-#include <bp-checks.h>
int
__new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
{
- return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, CHECK_1 (buf));
+ return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, buf);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c
index 77c0115c4..ad3860dfc 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c
@@ -32,7 +32,7 @@
: INLINE_SYSCALL1(name, nr, args))
struct kernel_sigaction;
-extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded,
- struct kernel_sigaction *__unbounded, size_t);
+extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
+ struct kernel_sigaction *, size_t);
#include <sysdeps/unix/sysv/linux/sigaction.c>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/am33/brk.c b/libc/ports/sysdeps/unix/sysv/linux/am33/brk.c
index 51b59adc9..8fd2ff01d 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/am33/brk.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/am33/brk.c
@@ -30,7 +30,7 @@ __brk (void *addr)
{
void *newbrk;
- newbrk = INLINE_SYSCALL (brk, 1, __ptrvalue (addr));
+ newbrk = INLINE_SYSCALL (brk, 1, addr);
__curbrk = newbrk;
diff --git a/libc/ports/sysdeps/unix/sysv/linux/am33/clone.S b/libc/ports/sysdeps/unix/sysv/linux/am33/clone.S
index 151950c5d..cece99bf3 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/am33/clone.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/am33/clone.S
@@ -24,12 +24,11 @@
#define _ERRNO_H 1
#include <bits/errno.h>
#include <asm-syntax.h>
-#include <bp-sym.h>
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
.text
-ENTRY (BP_SYM (__clone))
+ENTRY (__clone)
/* Sanity check arguments. */
cmp 0,d0 /* no NULL function pointers */
beq L(error_inval)
@@ -75,6 +74,6 @@ L(here):
#endif
call JUMPTARGET (_exit),[],0
-PSEUDO_END (BP_SYM (__clone))
+PSEUDO_END (__clone)
-weak_alias (BP_SYM (__clone), BP_SYM (clone))
+weak_alias (__clone, clone)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile b/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile
index be7946e96..56ef15967 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile
@@ -10,7 +10,7 @@ shared-only-routines += libc-aeabi_read_tp
endif
ifeq ($(subdir),elf)
-sysdep-rtld-routines += aeabi_read_tp
+sysdep-rtld-routines += aeabi_read_tp libc-do-syscall
endif
ifeq ($(subdir),misc)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S b/libc/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
index bdcfa206e..29edec69d 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
@@ -15,6 +15,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+/* ??? Needs more rearrangement for the LDM to handle thumb mode. */
+#define NO_THUMB
#include <sysdep.h>
.section .rodata.str1.1,"aMS",%progbits,1
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/clone.S b/libc/ports/sysdeps/unix/sysv/linux/arm/clone.S
index de25db160..732a3ffd0 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/clone.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/clone.S
@@ -33,6 +33,7 @@
ENTRY(__clone)
@ sanity check args
cmp r0, #0
+ ite ne
cmpne r1, #0
moveq r0, #-EINVAL
beq PLTJMP(syscall_error)
@@ -78,8 +79,9 @@ PSEUDO_END (__clone)
sub pc, r0, #31
mov r1, r0
tst ip, #CLONE_VM
- movne r0, #-1
ldr r7, =SYS_ify(getpid)
+ ite ne
+ movne r0, #-1
swieq 0x0
str r0, [r1, #PID_OFFSET]
str r0, [r1, #TID_OFFSET]
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h b/libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
index acc4f2864..504fecab5 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
@@ -18,12 +18,17 @@
#include <ldconfig.h>
+/* In order to support the transition from unmarked objects
+ to marked objects we must treat unmarked objects as
+ compatible with either FLAG_ARM_LIBHF or FLAG_ARM_LIBSF. */
#ifdef __ARM_PCS_VFP
# define _dl_cache_check_flags(flags) \
- ((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6))
+ ((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6) \
+ || (flags) == FLAG_ELF_LIBC6)
#else
# define _dl_cache_check_flags(flags) \
- ((flags) == FLAG_ELF_LIBC6)
+ ((flags) == (FLAG_ARM_LIBSF | FLAG_ELF_LIBC6) \
+ || (flags) == FLAG_ELF_LIBC6)
#endif
#include_next <dl-cache.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S b/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S
index f7857c199..fa00c0b78 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/getcontext.S
@@ -103,7 +103,7 @@ ENTRY(__getcontext)
END(__getcontext)
#ifdef PIC
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_global_ro:
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
#else
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/mmap.S b/libc/ports/sysdeps/unix/sysv/linux/arm/mmap.S
index fa8a2b86c..68560b065 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/mmap.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/mmap.S
@@ -51,6 +51,7 @@ ENTRY (__mmap)
cfi_restore (r5)
cmn r0, $4096
+ it cc
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/mmap64.S b/libc/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
index 2eafd1b41..dcbab3aed 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
@@ -17,6 +17,8 @@
#include <sysdep.h>
+ .syntax unified
+
#define EINVAL 22
#ifdef __ARMEB__
@@ -42,7 +44,8 @@ ENTRY (__mmap64)
cfi_remember_state
movs r4, ip, lsl $20 @ check that offset is page-aligned
mov ip, ip, lsr $12
- moveqs r4, r5, lsr $12 @ check for overflow
+ it eq
+ movseq r4, r5, lsr $12 @ check for overflow
bne .Linval
ldr r4, [sp, $8] @ load fd
orr r5, ip, r5, lsl $20 @ compose page offset
@@ -52,6 +55,7 @@ ENTRY (__mmap64)
cfi_adjust_cfa_offset (-8)
cfi_restore (r4)
cfi_restore (r5)
+ it cc
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist
index ceab6b2cd..ce45208b5 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist
@@ -86,6 +86,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.4
GLIBC_2.4 A
_Exit F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
index 0278812f7..fe21cdaf2 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
@@ -36,6 +36,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -141,6 +143,32 @@
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ })
+
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
#define lll_trylock(lock) \
atomic_compare_and_exchange_val_acq(&(lock), 1, 0)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
index 1b0a2447f..df85d5199 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
@@ -30,161 +30,157 @@
# undef PSEUDO
# define PSEUDO(name, syscall_name, args) \
- .section ".text"; \
- PSEUDO_PROLOGUE; \
- .type __##syscall_name##_nocancel,%function; \
- .globl __##syscall_name##_nocancel; \
- __##syscall_name##_nocancel: \
- .cfi_sections .debug_frame; \
- cfi_startproc; \
- DO_CALL (syscall_name, args); \
- cmn r0, $4096; \
- PSEUDO_RET; \
- cfi_endproc; \
- .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
+ .text; \
+ PSEUDO_PROLOGUE; \
+ ENTRY (__##syscall_name##_nocancel); \
+ CFI_SECTIONS; \
+ DO_CALL (syscall_name, args); \
+ cmn r0, $4096; \
+ PSEUDO_RET; \
+ END (__##syscall_name##_nocancel); \
ENTRY (name); \
- SINGLE_THREAD_P; \
- DOARGS_##args; \
- bne .Lpseudo_cancel; \
- cfi_remember_state; \
- ldr r7, =SYS_ify (syscall_name); \
- swi 0x0; \
- UNDOARGS_##args; \
- cmn r0, $4096; \
- PSEUDO_RET; \
- cfi_restore_state; \
+ SINGLE_THREAD_P; \
+ DOARGS_##args; \
+ bne .Lpseudo_cancel; \
+ cfi_remember_state; \
+ ldr r7, =SYS_ify (syscall_name); \
+ swi 0x0; \
+ UNDOARGS_##args; \
+ cmn r0, $4096; \
+ PSEUDO_RET; \
+ cfi_restore_state; \
.Lpseudo_cancel: \
- .fnstart; /* matched by the .fnend in UNDOARGS below. */ \
- DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \
- CENABLE; \
- mov ip, r0; /* put mask in safe place. */ \
- UNDOCARGS_##args; /* restore syscall args. */ \
- ldr r7, =SYS_ify (syscall_name); \
- swi 0x0; /* do the call. */ \
- mov r7, r0; /* save syscall return value. */ \
- mov r0, ip; /* get mask back. */ \
- CDISABLE; \
- mov r0, r7; /* retrieve return value. */ \
- RESTORE_LR_##args; \
- UNDOARGS_##args; \
- cmn r0, $4096
+ .fnstart; /* matched by the .fnend in UNDOARGS below. */ \
+ DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \
+ CENABLE; \
+ mov ip, r0; /* put mask in safe place. */ \
+ UNDOCARGS_##args; /* restore syscall args. */ \
+ ldr r7, =SYS_ify (syscall_name); \
+ swi 0x0; /* do the call. */ \
+ mov r7, r0; /* save syscall return value. */ \
+ mov r0, ip; /* get mask back. */ \
+ CDISABLE; \
+ mov r0, r7; /* retrieve return value. */ \
+ RESTORE_LR_##args; \
+ UNDOARGS_##args; \
+ cmn r0, $4096
/* DOARGS pushes eight bytes on the stack for five arguments, twelve bytes for
six arguments, and four bytes for fewer. In order to preserve doubleword
alignment, sometimes we must save an extra register. */
-# define RESTART_UNWIND \
- .fnend; \
- .fnstart; \
- .save {r7}; \
- .save {lr}
-
-# define DOCARGS_0 \
- .save {r7}; \
- str lr, [sp, #-4]!; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (lr, 0); \
- .save {lr}
+# define RESTART_UNWIND \
+ .fnend; \
+ .fnstart; \
+ .save {r7}; \
+ .save {lr}
+
+# define DOCARGS_0 \
+ .save {r7}; \
+ str lr, [sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
+ .save {lr}
# define UNDOCARGS_0
-# define RESTORE_LR_0 \
- ldr lr, [sp], #4; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (lr)
-
-# define DOCARGS_1 \
- .save {r7}; \
- stmfd sp!, {r0, r1, lr}; \
- cfi_adjust_cfa_offset (12); \
- cfi_rel_offset (lr, 8); \
- .save {lr}; \
- .pad #8
-# define UNDOCARGS_1 \
- ldr r0, [sp], #8; \
- cfi_adjust_cfa_offset (-8); \
- RESTART_UNWIND
-# define RESTORE_LR_1 \
- RESTORE_LR_0
-
-# define DOCARGS_2 \
- .save {r7}; \
- stmfd sp!, {r0, r1, lr}; \
- cfi_adjust_cfa_offset (12); \
- cfi_rel_offset (lr, 8); \
- .save {lr}; \
- .pad #8
-# define UNDOCARGS_2 \
- ldmfd sp!, {r0, r1}; \
- cfi_adjust_cfa_offset (-8); \
- RESTART_UNWIND
-# define RESTORE_LR_2 \
- RESTORE_LR_0
-
-# define DOCARGS_3 \
- .save {r7}; \
- stmfd sp!, {r0, r1, r2, r3, lr}; \
- cfi_adjust_cfa_offset (20); \
- cfi_rel_offset (lr, 16); \
- .save {lr}; \
- .pad #16
-# define UNDOCARGS_3 \
- ldmfd sp!, {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- RESTART_UNWIND
-# define RESTORE_LR_3 \
- RESTORE_LR_0
-
-# define DOCARGS_4 \
- .save {r7}; \
- stmfd sp!, {r0, r1, r2, r3, lr}; \
- cfi_adjust_cfa_offset (20); \
- cfi_rel_offset (lr, 16); \
- .save {lr}; \
- .pad #16
-# define UNDOCARGS_4 \
- ldmfd sp!, {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- RESTART_UNWIND
-# define RESTORE_LR_4 \
- RESTORE_LR_0
+# define RESTORE_LR_0 \
+ ldr lr, [sp], #4; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr)
+
+# define DOCARGS_1 \
+ .save {r7}; \
+ stmfd sp!, {r0, r1, lr}; \
+ cfi_adjust_cfa_offset (12); \
+ cfi_rel_offset (lr, 8); \
+ .save {lr}; \
+ .pad #8
+# define UNDOCARGS_1 \
+ ldr r0, [sp], #8; \
+ cfi_adjust_cfa_offset (-8); \
+ RESTART_UNWIND
+# define RESTORE_LR_1 \
+ RESTORE_LR_0
+
+# define DOCARGS_2 \
+ .save {r7}; \
+ stmfd sp!, {r0, r1, lr}; \
+ cfi_adjust_cfa_offset (12); \
+ cfi_rel_offset (lr, 8); \
+ .save {lr}; \
+ .pad #8
+# define UNDOCARGS_2 \
+ ldmfd sp!, {r0, r1}; \
+ cfi_adjust_cfa_offset (-8); \
+ RESTART_UNWIND
+# define RESTORE_LR_2 \
+ RESTORE_LR_0
+
+# define DOCARGS_3 \
+ .save {r7}; \
+ stmfd sp!, {r0, r1, r2, r3, lr}; \
+ cfi_adjust_cfa_offset (20); \
+ cfi_rel_offset (lr, 16); \
+ .save {lr}; \
+ .pad #16
+# define UNDOCARGS_3 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ RESTART_UNWIND
+# define RESTORE_LR_3 \
+ RESTORE_LR_0
+
+# define DOCARGS_4 \
+ .save {r7}; \
+ stmfd sp!, {r0, r1, r2, r3, lr}; \
+ cfi_adjust_cfa_offset (20); \
+ cfi_rel_offset (lr, 16); \
+ .save {lr}; \
+ .pad #16
+# define UNDOCARGS_4 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ RESTART_UNWIND
+# define RESTORE_LR_4 \
+ RESTORE_LR_0
/* r4 is only stmfd'ed for correct stack alignment. */
-# define DOCARGS_5 \
- .save {r4, r7}; \
- stmfd sp!, {r0, r1, r2, r3, r4, lr}; \
- cfi_adjust_cfa_offset (24); \
- cfi_rel_offset (lr, 20); \
- .save {lr}; \
- .pad #20
-# define UNDOCARGS_5 \
- ldmfd sp!, {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- .fnend; \
- .fnstart; \
- .save {r4, r7}; \
- .save {lr}; \
- .pad #4
-# define RESTORE_LR_5 \
- ldmfd sp!, {r4, lr}; \
- cfi_adjust_cfa_offset (-8); \
- /* r4 will be marked as restored later. */ \
- cfi_restore (lr)
-
-# define DOCARGS_6 \
- .save {r4, r5, r7}; \
- stmfd sp!, {r0, r1, r2, r3, lr}; \
- cfi_adjust_cfa_offset (20); \
- cfi_rel_offset (lr, 16); \
- .save {lr}; \
- .pad #16
-# define UNDOCARGS_6 \
- ldmfd sp!, {r0, r1, r2, r3}; \
- cfi_adjust_cfa_offset (-16); \
- .fnend; \
- .fnstart; \
- .save {r4, r5, r7}; \
- .save {lr};
-# define RESTORE_LR_6 \
- RESTORE_LR_0
+# define DOCARGS_5 \
+ .save {r4, r7}; \
+ stmfd sp!, {r0, r1, r2, r3, r4, lr}; \
+ cfi_adjust_cfa_offset (24); \
+ cfi_rel_offset (lr, 20); \
+ .save {lr}; \
+ .pad #20
+# define UNDOCARGS_5 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ .fnend; \
+ .fnstart; \
+ .save {r4, r7}; \
+ .save {lr}; \
+ .pad #4
+# define RESTORE_LR_5 \
+ ldmfd sp!, {r4, lr}; \
+ cfi_adjust_cfa_offset (-8); \
+ /* r4 will be marked as restored later. */ \
+ cfi_restore (lr)
+
+# define DOCARGS_6 \
+ .save {r4, r5, r7}; \
+ stmfd sp!, {r0, r1, r2, r3, lr}; \
+ cfi_adjust_cfa_offset (20); \
+ cfi_rel_offset (lr, 16); \
+ .save {lr}; \
+ .pad #16
+# define UNDOCARGS_6 \
+ ldmfd sp!, {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ .fnend; \
+ .fnstart; \
+ .save {r4, r5, r7}; \
+ .save {lr};
+# define RESTORE_LR_6 \
+ RESTORE_LR_0
# ifdef IS_IN_libpthread
# define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
@@ -207,12 +203,12 @@ extern int __local_multiple_threads attribute_hidden;
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
# else
# define SINGLE_THREAD_P \
- ldr ip, 1b; \
-2: \
- ldr ip, [pc, ip]; \
- teq ip, #0;
+ ldr ip, 1b; \
+ 2: \
+ ldr ip, [pc, ip]; \
+ teq ip, #0;
# define PSEUDO_PROLOGUE \
- 1: .word __local_multiple_threads - 2f - 8;
+ 1: .word __local_multiple_threads - 2f - PC_OFS;
# endif
# else
/* There is no __local_multiple_threads for librt, so use the TCB. */
@@ -223,15 +219,15 @@ extern int __local_multiple_threads attribute_hidden;
# else
# define PSEUDO_PROLOGUE
# define SINGLE_THREAD_P \
- stmfd sp!, {r0, lr}; \
- cfi_adjust_cfa_offset (8); \
- cfi_rel_offset (lr, 4); \
- bl __aeabi_read_tp; \
- ldr ip, [r0, #MULTIPLE_THREADS_OFFSET]; \
- ldmfd sp!, {r0, lr}; \
- cfi_adjust_cfa_offset (-8); \
- cfi_restore (lr); \
- teq ip, #0
+ stmfd sp!, {r0, lr}; \
+ cfi_adjust_cfa_offset (8); \
+ cfi_rel_offset (lr, 4); \
+ bl __aeabi_read_tp; \
+ ldr ip, [r0, #MULTIPLE_THREADS_OFFSET]; \
+ ldmfd sp!, {r0, lr}; \
+ cfi_adjust_cfa_offset (-8); \
+ cfi_restore (lr); \
+ teq ip, #0
# define SINGLE_THREAD_P_PIC(x) SINGLE_THREAD_P
# endif
# endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
index 58ca9acf6..caa6a2626 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
@@ -84,6 +84,9 @@ __unwind_freeres (void)
ARM unwinder relies on register state at entrance. So we write this in
assembly. */
+#define STR1(S) #S
+#define STR(S) STR1(S)
+
asm (
" .globl _Unwind_Resume\n"
" .type _Unwind_Resume, %function\n"
@@ -118,11 +121,7 @@ asm (
" b 5b\n"
" " CFI_ENDPROC "\n"
" .align 2\n"
-#ifdef __thumb2__
-"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 4\n"
-#else
-"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 8\n"
-#endif
+"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - " STR (PC_OFS) "\n"
"2: .word libgcc_s_resume(GOTOFF)\n"
" .size _Unwind_Resume, .-_Unwind_Resume\n"
);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
index 0a3ad953b..121159913 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
@@ -47,6 +47,9 @@ init (void)
ARM unwinder relies on register state at entrance. So we write this in
assembly. */
+#define STR1(S) #S
+#define STR(S) STR1(S)
+
asm (
" .globl _Unwind_Resume\n"
" .type _Unwind_Resume, %function\n"
@@ -81,11 +84,7 @@ asm (
" b 5b\n"
" " CFI_ENDPROC "\n"
" .align 2\n"
-#ifdef __thumb2__
-"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 4\n"
-#else
-"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 8\n"
-#endif
+"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - " STR (PC_OFS) "\n"
"2: .word libgcc_s_resume(GOTOFF)\n"
" .size _Unwind_Resume, .-_Unwind_Resume\n"
);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/pread.c b/libc/ports/sysdeps/unix/sysv/linux/arm/pread.c
index dafee3d55..e178402a8 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/pread.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/pread.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
ssize_t
__libc_pread (fd, buf, count, offset)
@@ -37,7 +36,7 @@ __libc_pread (fd, buf, count, offset)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
return result;
@@ -47,7 +46,7 @@ __libc_pread (fd, buf, count, offset)
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/pread64.c b/libc/ports/sysdeps/unix/sysv/linux/arm/pread64.c
index 6d1d9148a..c7863a35c 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/pread64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/pread64.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
ssize_t
__libc_pread64 (fd, buf, count, offset)
@@ -37,7 +36,7 @@ __libc_pread64 (fd, buf, count, offset)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
@@ -48,7 +47,7 @@ __libc_pread64 (fd, buf, count, offset)
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite.c b/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite.c
index f188950af..4ae2e8330 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
ssize_t
__libc_pwrite (fd, buf, count, offset)
@@ -37,7 +36,7 @@ __libc_pwrite (fd, buf, count, offset)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
return result;
@@ -47,7 +46,7 @@ __libc_pwrite (fd, buf, count, offset)
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
LIBC_CANCEL_RESET (oldtype);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c b/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c
index 29c63ee33..bd6fca583 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c
@@ -22,7 +22,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
ssize_t
__libc_pwrite64 (fd, buf, count, offset)
@@ -37,7 +36,7 @@ __libc_pwrite64 (fd, buf, count, offset)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
@@ -48,7 +47,7 @@ __libc_pwrite64 (fd, buf, count, offset)
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
- result = INLINE_SYSCALL (pwrite64, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c b/libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
index 81e5ccb55..3efb6134c 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
@@ -46,6 +46,12 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD)
*flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6;
else if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_SOFT)
+ *flag = FLAG_ARM_LIBSF|FLAG_ELF_LIBC6;
+ else
+ /* We must assume the unmarked objects are compatible
+ with all ABI variants. Such objects may have been
+ generated in a transitional period when the ABI
+ tags were not added to all objects. */
*flag = FLAG_ELF_LIBC6;
}
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S b/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S
index 8e71f5b4e..b3148c894 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/setcontext.S
@@ -15,6 +15,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* ??? Needs more rearrangement for the LDM to handle thumb mode. */
+#define NO_THUMB
#include <sysdep.h>
#include <rtld-global-offsets.h>
@@ -93,7 +95,7 @@ ENTRY(__startcontext)
END(__startcontext)
#ifdef PIC
-1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
+1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_global_ro:
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
#else
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/sigaction.c b/libc/ports/sysdeps/unix/sysv/linux/arm/sigaction.c
index c039b857f..21bf506ef 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/sigaction.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/sigaction.c
@@ -83,8 +83,8 @@ __libc_sigaction (sig, act, oact)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
result = INLINE_SYSCALL (rt_sigaction, 4, sig,
- act ? __ptrvalue (&kact) : NULL,
- oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
+ act ? &kact : NULL,
+ oact ? &koact : NULL, _NSIG / 8);
if (oact && result >= 0)
{
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/syscall.S b/libc/ports/sysdeps/unix/sysv/linux/arm/syscall.S
index c6dd57d69..665ecb4de 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/syscall.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/syscall.S
@@ -42,6 +42,7 @@ ENTRY (syscall)
cfi_restore (r6)
cfi_restore (r7)
cmn r0, #4096
+ it cc
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
PSEUDO_END (syscall)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
index 6b5bb14c9..f40cb95e8 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -57,49 +57,50 @@
test with -4095. */
#undef PSEUDO
-#define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY (name); \
- DO_CALL (syscall_name, args); \
- cmn r0, $4096;
-
-#define PSEUDO_RET \
- RETINSTR(cc, lr); \
- b PLTJMP(SYSCALL_ERROR)
+#define PSEUDO(name, syscall_name, args) \
+ .text; \
+ ENTRY (name); \
+ DO_CALL (syscall_name, args); \
+ cmn r0, $4096;
+
+#define PSEUDO_RET \
+ it cc; \
+ RETINSTR(cc, lr); \
+ b PLTJMP(SYSCALL_ERROR)
#undef ret
#define ret PSEUDO_RET
#undef PSEUDO_END
-#define PSEUDO_END(name) \
- SYSCALL_ERROR_HANDLER; \
+#define PSEUDO_END(name) \
+ SYSCALL_ERROR_HANDLER; \
END (name)
#undef PSEUDO_NOERRNO
-#define PSEUDO_NOERRNO(name, syscall_name, args) \
- .text; \
- ENTRY (name); \
- DO_CALL (syscall_name, args);
+#define PSEUDO_NOERRNO(name, syscall_name, args) \
+ .text; \
+ ENTRY (name); \
+ DO_CALL (syscall_name, args);
-#define PSEUDO_RET_NOERRNO \
- DO_RET (lr);
+#define PSEUDO_RET_NOERRNO \
+ DO_RET (lr);
#undef ret_NOERRNO
#define ret_NOERRNO PSEUDO_RET_NOERRNO
#undef PSEUDO_END_NOERRNO
-#define PSEUDO_END_NOERRNO(name) \
+#define PSEUDO_END_NOERRNO(name) \
END (name)
/* The function has to return the error code. */
#undef PSEUDO_ERRVAL
-#define PSEUDO_ERRVAL(name, syscall_name, args) \
- .text; \
- ENTRY (name) \
- DO_CALL (syscall_name, args); \
- rsb r0, r0, #0
+#define PSEUDO_ERRVAL(name, syscall_name, args) \
+ .text; \
+ ENTRY (name) \
+ DO_CALL (syscall_name, args); \
+ rsb r0, r0, #0
#undef PSEUDO_END_ERRVAL
-#define PSEUDO_END_ERRVAL(name) \
+#define PSEUDO_END_ERRVAL(name) \
END (name)
#define ret_ERRVAL PSEUDO_RET_NOERRNO
@@ -114,7 +115,7 @@ __local_syscall_error: \
0: str r0, [pc, r1]; \
mvn r0, #0; \
DO_RET(lr); \
-1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8;
+1: .word C_SYMBOL_NAME(rtld_errno) - 0b - PC_OFS;
# else
# if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
# define POP_PC \
@@ -192,19 +193,19 @@ __local_syscall_error: \
syscalls. */
#undef DO_CALL
-#define DO_CALL(syscall_name, args) \
- DOARGS_##args; \
- ldr r7, =SYS_ify (syscall_name); \
- swi 0x0; \
- UNDOARGS_##args
+#define DO_CALL(syscall_name, args) \
+ DOARGS_##args; \
+ ldr r7, =SYS_ify (syscall_name); \
+ swi 0x0; \
+ UNDOARGS_##args
#undef DOARGS_0
-#define DOARGS_0 \
- .fnstart; \
- str r7, [sp, #-4]!; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (r7, 0); \
- .save { r7 }
+#define DOARGS_0 \
+ .fnstart; \
+ str r7, [sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (r7, 0); \
+ .save { r7 }
#undef DOARGS_1
#define DOARGS_1 DOARGS_0
#undef DOARGS_2
@@ -214,44 +215,44 @@ __local_syscall_error: \
#undef DOARGS_4
#define DOARGS_4 DOARGS_0
#undef DOARGS_5
-#define DOARGS_5 \
- .fnstart; \
- stmfd sp!, {r4, r7}; \
- cfi_adjust_cfa_offset (8); \
- cfi_rel_offset (r4, 0); \
- cfi_rel_offset (r7, 4); \
- .save { r4, r7 }; \
- ldr r4, [sp, #8]
+#define DOARGS_5 \
+ .fnstart; \
+ stmfd sp!, {r4, r7}; \
+ cfi_adjust_cfa_offset (8); \
+ cfi_rel_offset (r4, 0); \
+ cfi_rel_offset (r7, 4); \
+ .save { r4, r7 }; \
+ ldr r4, [sp, #8]
#undef DOARGS_6
-#define DOARGS_6 \
- .fnstart; \
- mov ip, sp; \
- stmfd sp!, {r4, r5, r7}; \
- cfi_adjust_cfa_offset (12); \
- cfi_rel_offset (r4, 0); \
- cfi_rel_offset (r5, 4); \
- cfi_rel_offset (r7, 8); \
- .save { r4, r5, r7 }; \
- ldmia ip, {r4, r5}
+#define DOARGS_6 \
+ .fnstart; \
+ mov ip, sp; \
+ stmfd sp!, {r4, r5, r7}; \
+ cfi_adjust_cfa_offset (12); \
+ cfi_rel_offset (r4, 0); \
+ cfi_rel_offset (r5, 4); \
+ cfi_rel_offset (r7, 8); \
+ .save { r4, r5, r7 }; \
+ ldmia ip, {r4, r5}
#undef DOARGS_7
-#define DOARGS_7 \
- .fnstart; \
- mov ip, sp; \
- stmfd sp!, {r4, r5, r6, r7}; \
- cfi_adjust_cfa_offset (16); \
- cfi_rel_offset (r4, 0); \
- cfi_rel_offset (r5, 4); \
- cfi_rel_offset (r6, 8); \
- cfi_rel_offset (r7, 12); \
- .save { r4, r5, r6, r7 }; \
- ldmia ip, {r4, r5, r6}
+#define DOARGS_7 \
+ .fnstart; \
+ mov ip, sp; \
+ stmfd sp!, {r4, r5, r6, r7}; \
+ cfi_adjust_cfa_offset (16); \
+ cfi_rel_offset (r4, 0); \
+ cfi_rel_offset (r5, 4); \
+ cfi_rel_offset (r6, 8); \
+ cfi_rel_offset (r7, 12); \
+ .save { r4, r5, r6, r7 }; \
+ ldmia ip, {r4, r5, r6}
#undef UNDOARGS_0
-#define UNDOARGS_0 \
- ldr r7, [sp], #4; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (r7); \
- .fnend
+#define UNDOARGS_0 \
+ ldr r7, [sp], #4; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (r7); \
+ .fnend
#undef UNDOARGS_1
#define UNDOARGS_1 UNDOARGS_0
#undef UNDOARGS_2
@@ -261,29 +262,29 @@ __local_syscall_error: \
#undef UNDOARGS_4
#define UNDOARGS_4 UNDOARGS_0
#undef UNDOARGS_5
-#define UNDOARGS_5 \
- ldmfd sp!, {r4, r7}; \
- cfi_adjust_cfa_offset (-8); \
- cfi_restore (r4); \
- cfi_restore (r7); \
- .fnend
+#define UNDOARGS_5 \
+ ldmfd sp!, {r4, r7}; \
+ cfi_adjust_cfa_offset (-8); \
+ cfi_restore (r4); \
+ cfi_restore (r7); \
+ .fnend
#undef UNDOARGS_6
-#define UNDOARGS_6 \
- ldmfd sp!, {r4, r5, r7}; \
- cfi_adjust_cfa_offset (-12); \
- cfi_restore (r4); \
- cfi_restore (r5); \
- cfi_restore (r7); \
- .fnend
+#define UNDOARGS_6 \
+ ldmfd sp!, {r4, r5, r7}; \
+ cfi_adjust_cfa_offset (-12); \
+ cfi_restore (r4); \
+ cfi_restore (r5); \
+ cfi_restore (r7); \
+ .fnend
#undef UNDOARGS_7
-#define UNDOARGS_7 \
- ldmfd sp!, {r4, r5, r6, r7}; \
- cfi_adjust_cfa_offset (-16); \
- cfi_restore (r4); \
- cfi_restore (r5); \
- cfi_restore (r6); \
- cfi_restore (r7); \
- .fnend
+#define UNDOARGS_7 \
+ ldmfd sp!, {r4, r5, r6, r7}; \
+ cfi_adjust_cfa_offset (-16); \
+ cfi_restore (r4); \
+ cfi_restore (r5); \
+ cfi_restore (r6); \
+ cfi_restore (r7); \
+ .fnend
#else /* not __ASSEMBLER__ */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/truncate64.c b/libc/ports/sysdeps/unix/sysv/linux/arm/truncate64.c
index 4367d1efe..6e52e3263 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/truncate64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/truncate64.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Truncate the file FD refers to to LENGTH bytes. */
int
@@ -30,7 +29,7 @@ truncate64 (const char *path, off64_t length)
{
unsigned int low = length & 0xffffffff;
unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (truncate64, 4, CHECK_STRING (path), 0,
+ int result = INLINE_SYSCALL (truncate64, 4, path, 0,
__LONG_LONG_PAIR (high, low));
return result;
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/vfork.S b/libc/ports/sysdeps/unix/sysv/linux/arm/vfork.S
index 4f84c57f2..ae931f79c 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/vfork.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/vfork.S
@@ -51,6 +51,7 @@ ENTRY (__vfork)
RESTORE_PID
#endif
cmn a1, #4096
+ it cc
RETINSTR(cc, lr)
b PLTJMP(SYSCALL_ERROR)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
index 618edf7bc..af63e1b9a 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
@@ -87,17 +87,6 @@ __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *abstime, int pri
/* These don't get included in libc.so */
#ifdef IS_IN_libpthread
int
-lll_unlock_wake_cb (lll_lock_t *futex)
-{
- int val = atomic_exchange_rel (futex, 0);
-
- if (__builtin_expect (val > 1, 0))
- lll_private_futex_wake (futex, 1);
- return 0;
-}
-
-
-int
__lll_timedwait_tid (int *tidp, const struct timespec *abstime)
{
int tid;
@@ -134,6 +123,5 @@ __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
return 0;
}
-
#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
index f37a7bbd7..b88703fba 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
@@ -317,8 +317,6 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime,
#define THREAD_INIT_LOCK(PD, LOCK) \
(PD)->LOCK = LLL_LOCK_INITIALIZER
-extern int lll_unlock_wake_cb (lll_lock_t *__futex) attribute_hidden;
-
/* The kernel notifies a process which uses CLONE_CHILD_CLEARTID via futex
wakeup when the clone terminates. The memory location contains the
thread ID while the clone is running and is reset to zero
diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist
index b3510fe2a..067552d17 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist
@@ -86,6 +86,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c
index b41c6c3a7..664d0e12b 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c
@@ -26,7 +26,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* The variable is shared between all wrappers around signal handling
functions which have RT equivalents. This is the definition. */
@@ -42,8 +41,7 @@ __libc_sigaction (sig, act, oact)
{
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigaction, 4, sig,
- CHECK_1_NULL_OK (act), CHECK_1_NULL_OK (oact), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigaction, 4, sig, act, oact, _NSIG / 8);
}
libc_hidden_def (__libc_sigaction)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c
index 9aac2b75c..42fce5022 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigpending.c
@@ -24,7 +24,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Change the set of blocked signals to SET,
wait until a signal arrives, and restore the set of blocked signals. */
@@ -34,5 +33,5 @@ sigpending (set)
{
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
index f074abc8a..53b85800b 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/sigprocmask.c
@@ -26,7 +26,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Get and/or change the set of blocked signals. */
int
@@ -38,7 +37,6 @@ __sigprocmask (how, set, oset)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
- return INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET (set),
- CHECK_SIGSET_NULL_OK (oset), _NSIG / 8);
+ return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
}
weak_alias (__sigprocmask, sigprocmask)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/umount.c b/libc/ports/sysdeps/unix/sysv/linux/ia64/umount.c
index a15a71686..a3df7863f 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/ia64/umount.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/umount.c
@@ -20,11 +20,10 @@
#include <errno.h>
#include <sysdep.h>
-#include <bp-checks.h>
/* Unmount a filesystem. */
int
umount (const char *special_file)
{
- return INLINE_SYSCALL (umount, 2, CHECK_STRING (special_file), 0);
+ return INLINE_SYSCALL (umount, 2, special_file, 0);
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist
index 3c40379aa..f06cc8ef8 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist
@@ -87,6 +87,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.4
GLIBC_2.4 A
_Exit F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index bf8ace7a1..31a8c3c8c 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -20,6 +20,26 @@
/* Many syscalls were added in 2.6.10 for m68k. */
#define __ASSUME_UTIMES 1
+/* Support for various CLOEXEC and NONBLOCK flags was added 2.6.23. */
+#if __LINUX_KERNEL_VERSION >= 0x020617
+# define __ASSUME_O_CLOEXEC 1
+#endif
+
+/* Support for various CLOEXEC and NONBLOCK flags was added in 2.6.27. */
+#if __LINUX_KERNEL_VERSION >= 0x02061b
+# define __ASSUME_SOCK_CLOEXEC 1
+# define __ASSUME_IN_NONBLOCK 1
+# define __ASSUME_PIPE2 1
+# define __ASSUME_EVENTFD2 1
+# define __ASSUME_SIGNALFD4 1
+# define __ASSUME_DUP3 1
+#endif
+
+/* Support for the accept4 syscall was added in 2.6.28. */
+#if __LINUX_KERNEL_VERSION >= 0x02061c
+# define __ASSUME_ACCEPT4 1
+#endif
+
#include_next <kernel-features.h>
/* These syscalls were added only in 3.0 for m68k. */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist
index f998b1b27..9010ea733 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist
@@ -1775,6 +1775,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h
new file mode 100644
index 000000000..e6a0d135c
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h
@@ -0,0 +1 @@
+#include <nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list b/libc/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list
index 1e27d8de7..aee1011a6 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/syscalls.list
@@ -1,6 +1,7 @@
# File name Caller Syscall name Args Strong name Weak names
chown - chown32 i:sii __chown chown
+waitpid - waitpid Ci:ipi __waitpid waitpid __libc_waitpid
cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush
prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/brk.c b/libc/ports/sysdeps/unix/sysv/linux/mips/brk.c
index 9bd6d94bd..07c8a9649 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/brk.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/brk.c
@@ -30,19 +30,10 @@ weak_alias (__curbrk, ___brk_addr)
int
__brk (void *addr)
{
+ INTERNAL_SYSCALL_DECL (err);
void *newbrk;
- {
- register long int res __asm__ ("$2");
-
- asm ("move\t$4,%2\n\t"
- "li\t%0,%1\n\t"
- "syscall" /* Perform the system call. */
- : "=r" (res)
- : "I" (SYS_ify (brk)), "r" (addr)
- : "$4", "$7", __SYSCALL_CLOBBERS);
- newbrk = (void *) res;
- }
+ newbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr);
__curbrk = newbrk;
if (newbrk < addr)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/clone.S b/libc/ports/sysdeps/unix/sysv/linux/mips/clone.S
index 72360f962..f6f2f0565 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/clone.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/clone.S
@@ -34,6 +34,7 @@
void *parent_tidptr, void *tls, void *child_tidptr) */
.text
+ .set nomips16
#if _MIPS_SIM == _ABIO32
# define EXTRA_LOCALS 1
#else
@@ -47,7 +48,8 @@ NESTED(__clone,4*SZREG,sp)
SETUP_GP
#endif
PTR_SUBU sp, FRAMESZ
- SETUP_GP64 (GPOFF, __clone)
+ cfi_adjust_cfa_offset (FRAMESZ)
+ SETUP_GP64_STACK (GPOFF, __clone)
#ifdef __PIC__
SAVE_GP (GPOFF)
#endif
@@ -88,26 +90,35 @@ NESTED(__clone,4*SZREG,sp)
/* Do the system call */
li v0,__NR_clone
+ cfi_endproc
syscall
bnez a3,L(error)
beqz v0,L(thread_start)
/* Successful return from the parent */
- RESTORE_GP64
+ cfi_startproc
+ cfi_adjust_cfa_offset (FRAMESZ)
+ SETUP_GP64_STACK_CFI (GPOFF)
+ cfi_remember_state
+ RESTORE_GP64_STACK
PTR_ADDU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
ret
/* Something bad happened -- no child created */
L(error):
+ cfi_restore_state
#ifdef __PIC__
PTR_LA t9,__syscall_error
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
jr t9
#else
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
j __syscall_error
#endif
END(__clone)
@@ -118,6 +129,7 @@ L(error):
ENTRY(__thread_start)
L(thread_start):
+ cfi_undefined ($31)
/* cp is already loaded. */
SAVE_GP (GPOFF)
/* The stackframe has been created on entry of clone(). */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/getcontext.S b/libc/ports/sysdeps/unix/sysv/linux/mips/getcontext.S
index 0e3d35b54..268098c0b 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/getcontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/getcontext.S
@@ -27,6 +27,7 @@
/* int getcontext (ucontext_t *ucp) */
.text
+ .set nomips16
LOCALSZ = 0
MASK = 0x00000000
#ifdef __PIC__
@@ -54,7 +55,8 @@ NESTED (__getcontext, FRAMESZ, ra)
# endif
PTR_ADDIU sp, -FRAMESZ
- SETUP_GP64 (GPOFF, __getcontext)
+ cfi_adjust_cfa_offset (FRAMESZ)
+ SETUP_GP64_STACK (GPOFF, __getcontext)
SAVE_GP (GPOFF)
#else /* ! __PIC__ */
@@ -124,19 +126,23 @@ NESTED (__getcontext, FRAMESZ, ra)
li v0, SYS_ify (rt_sigprocmask)
syscall
bnez a3, 99f
+ cfi_remember_state
#ifdef __PIC__
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDIU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
#endif
move v0, zero
jr ra
99:
+ cfi_restore_state
#ifdef __PIC__
PTR_LA t9, JUMPTARGET (__syscall_error)
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDIU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
jr t9
#else /* ! __PIC__ */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/makecontext.S b/libc/ports/sysdeps/unix/sysv/linux/mips/makecontext.S
index 65f1a6aaa..a8bbebbcc 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/makecontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/makecontext.S
@@ -27,6 +27,7 @@
/* int makecontext (ucontext_t *ucp, (void *func) (), int argc, ...) */
.text
+ .set nomips16
LOCALSZ = 0
ARGSZ = 0
MASK = 0x00000000
@@ -63,9 +64,10 @@ NESTED (__makecontext, FRAMESZ, ra)
#endif
PTR_ADDIU sp, -FRAMESZ
+ cfi_adjust_cfa_offset (FRAMESZ)
#ifdef __PIC__
- SETUP_GP64 (GPOFF, __makecontext)
+ SETUP_GP64_STACK (GPOFF, __makecontext)
SAVE_GP (GPOFF)
#endif
@@ -145,8 +147,9 @@ NESTED (__makecontext, FRAMESZ, ra)
REG_S a1, MCONTEXT_PC(a0)
#ifdef __PIC__
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDIU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
#endif
jr ra
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile
new file mode 100644
index 000000000..fa9fcb7e6
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile
@@ -0,0 +1,13 @@
+ifeq ($(subdir),misc)
+sysdep_routines += mips16-syscall0 mips16-syscall1 mips16-syscall2
+sysdep_routines += mips16-syscall3 mips16-syscall4 mips16-syscall5
+sysdep_routines += mips16-syscall6 mips16-syscall7
+CFLAGS-mips16-syscall0.c += -fexceptions
+CFLAGS-mips16-syscall1.c += -fexceptions
+CFLAGS-mips16-syscall2.c += -fexceptions
+CFLAGS-mips16-syscall3.c += -fexceptions
+CFLAGS-mips16-syscall4.c += -fexceptions
+CFLAGS-mips16-syscall5.c += -fexceptions
+CFLAGS-mips16-syscall6.c += -fexceptions
+CFLAGS-mips16-syscall7.c += -fexceptions
+endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions
new file mode 100644
index 000000000..73bcfb566
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions
@@ -0,0 +1,6 @@
+libc {
+ GLIBC_PRIVATE {
+ __mips16_syscall0; __mips16_syscall1; __mips16_syscall2; __mips16_syscall3;
+ __mips16_syscall4; __mips16_syscall5; __mips16_syscall6; __mips16_syscall7;
+ }
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h
new file mode 100644
index 000000000..8449836d3
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h
@@ -0,0 +1,89 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef MIPS16_SYSCALL_H
+#define MIPS16_SYSCALL_H 1
+
+#define __nomips16 __attribute__ ((nomips16))
+
+union __mips16_syscall_return
+ {
+ long long val;
+ struct
+ {
+ long v0;
+ long v1;
+ }
+ reg;
+ };
+
+long long __nomips16 __mips16_syscall0 (long number);
+#define __mips16_syscall0(dummy, number) \
+ __mips16_syscall0 ((long) (number))
+
+long long __nomips16 __mips16_syscall1 (long a0,
+ long number);
+#define __mips16_syscall1(a0, number) \
+ __mips16_syscall1 ((long) (a0), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall2 (long a0, long a1,
+ long number);
+#define __mips16_syscall2(a0, a1, number) \
+ __mips16_syscall2 ((long) (a0), (long) (a1), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall3 (long a0, long a1, long a2,
+ long number);
+#define __mips16_syscall3(a0, a1, a2, number) \
+ __mips16_syscall3 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall4 (long a0, long a1, long a2, long a3,
+ long number);
+#define __mips16_syscall4(a0, a1, a2, a3, number) \
+ __mips16_syscall4 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (a3), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall5 (long a0, long a1, long a2, long a3,
+ long a4,
+ long number);
+#define __mips16_syscall5(a0, a1, a2, a3, a4, number) \
+ __mips16_syscall5 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (a3), (long) (a4), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall6 (long a0, long a1, long a2, long a3,
+ long a4, long a5,
+ long number);
+#define __mips16_syscall6(a0, a1, a2, a3, a4, a5, number) \
+ __mips16_syscall6 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (a3), (long) (a4), (long) (a5), \
+ (long) (number))
+
+long long __nomips16 __mips16_syscall7 (long a0, long a1, long a2, long a3,
+ long a4, long a5, long a6,
+ long number);
+#define __mips16_syscall7(a0, a1, a2, a3, a4, a5, a6, number) \
+ __mips16_syscall7 ((long) (a0), (long) (a1), (long) (a2), \
+ (long) (a3), (long) (a4), (long) (a5), \
+ (long) (a6), \
+ (long) (number))
+
+#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c
new file mode 100644
index 000000000..0cdf94c22
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c
@@ -0,0 +1,30 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall0
+
+long long __nomips16
+__mips16_syscall0 (long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 0);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c
new file mode 100644
index 000000000..5e60a59d5
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c
@@ -0,0 +1,32 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall1
+
+long long __nomips16
+__mips16_syscall1 (long a0,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 1,
+ a0);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c
new file mode 100644
index 000000000..7750c519c
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c
@@ -0,0 +1,32 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall2
+
+long long __nomips16
+__mips16_syscall2 (long a0, long a1,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 2,
+ a0, a1);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c
new file mode 100644
index 000000000..7fc1c4e43
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c
@@ -0,0 +1,32 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall3
+
+long long __nomips16
+__mips16_syscall3 (long a0, long a1, long a2,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 3,
+ a0, a1, a2);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c
new file mode 100644
index 000000000..b8b4198c7
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c
@@ -0,0 +1,32 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall4
+
+long long __nomips16
+__mips16_syscall4 (long a0, long a1, long a2, long a3,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 4,
+ a0, a1, a2, a3);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c
new file mode 100644
index 000000000..e1322d107
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c
@@ -0,0 +1,33 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall5
+
+long long __nomips16
+__mips16_syscall5 (long a0, long a1, long a2, long a3,
+ long a4,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 5,
+ a0, a1, a2, a3, a4);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c
new file mode 100644
index 000000000..a9e5cd9df
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c
@@ -0,0 +1,33 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall6
+
+long long __nomips16
+__mips16_syscall6 (long a0, long a1, long a2, long a3,
+ long a4, long a5,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 6,
+ a0, a1, a2, a3, a4, a5);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c
new file mode 100644
index 000000000..d87b5ba5a
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c
@@ -0,0 +1,33 @@
+/* MIPS16 syscall wrappers.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+#include <mips16-syscall.h>
+
+#undef __mips16_syscall7
+
+long long __nomips16
+__mips16_syscall7 (long a0, long a1, long a2, long a3,
+ long a4, long a5, long a6,
+ long number)
+{
+ union __mips16_syscall_return ret;
+ ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 7,
+ a0, a1, a2, a3, a4, a5, a6);
+ return ret.val;
+}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist
index 737886923..f01278e4a 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist
@@ -1390,6 +1390,19 @@ GLIBC_2.16
mbrtoc16 F
mbrtoc32 F
timespec_get F
+GLIBC_2.17
+ GLIBC_2.17 A
+ clock_getcpuclockid F
+ clock_getres F
+ clock_gettime F
+ clock_nanosleep F
+ clock_settime F
+ secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
+ __mips_fpu_getcw F
+ __mips_fpu_setcw F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
@@ -2242,11 +2255,3 @@ GLIBC_2.9
pipe2 F
_gp_disp
_gp_disp A
-GLIBC_2.17
- GLIBC_2.17 A
- clock_getcpuclockid F
- clock_getres F
- clock_gettime F
- clock_nanosleep F
- clock_settime F
- secure_getenv F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index e79fda937..0faf68c4f 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -67,25 +67,86 @@
#undef INTERNAL_SYSCALL_ERRNO
#define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val)
-#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err, nr, args...) \
- internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
- "i" (SYS_ify (name)), err, args)
+/* Note that the original Linux syscall restart convention required the
+ instruction immediately preceding SYSCALL to initialize $v0 with the
+ syscall number. Then if a restart triggered, $v0 would have been
+ clobbered by the syscall interrupted, and needed to be reinititalized.
+ The kernel would decrement the PC by 4 before switching back to the
+ user mode so that $v0 had been reloaded before SYSCALL was executed
+ again. This implied the place $v0 was loaded from must have been
+ preserved across a syscall, e.g. an immediate, static register, stack
+ slot, etc.
+
+ The convention was relaxed in Linux with a change applied to the kernel
+ GIT repository as commit 96187fb0bc30cd7919759d371d810e928048249d, that
+ first appeared in the 2.6.36 release. Since then the kernel has had
+ code that reloads $v0 upon syscall restart and resumes right at the
+ SYSCALL instruction, so no special arrangement is needed anymore.
+
+ For backwards compatibility with existing kernel binaries we support
+ the old convention by choosing the instruction preceding SYSCALL
+ carefully. This also means we have to force a 32-bit encoding of the
+ microMIPS MOVE instruction if one is used. */
+
+#ifdef __mips_micromips
+# define MOVE32 "move32"
+#else
+# define MOVE32 "move"
+#endif
+#undef INTERNAL_SYSCALL
#undef INTERNAL_SYSCALL_NCS
-#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
- internal_syscall##nr (= number, , "r" (__v0), err, args)
-#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
+#ifdef __mips16
+/* There's no MIPS16 syscall instruction, so we go through out-of-line
+ standard MIPS wrappers. These do use inline snippets below though,
+ through INTERNAL_SYSCALL_MIPS16. Spilling the syscall number to
+ memory gives the best code in that case, avoiding the need to save
+ and restore a static register. */
+
+# include <mips16-syscall.h>
+
+# define INTERNAL_SYSCALL(name, err, nr, args...) \
+ INTERNAL_SYSCALL_NCS (SYS_ify (name), err, nr, args)
+
+# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+({ \
+ union __mips16_syscall_return ret; \
+ ret.val = __mips16_syscall##nr (args, number); \
+ err = ret.reg.v1; \
+ ret.reg.v0; \
+})
+
+# define INTERNAL_SYSCALL_MIPS16(number, err, nr, args...) \
+ internal_syscall##nr ("lw\t%0, %2\n\t", \
+ "R" (number), \
+ 0, err, args)
+
+#else /* !__mips16 */
+# define INTERNAL_SYSCALL(name, err, nr, args...) \
+ internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t", \
+ "IK" (SYS_ify (name)), \
+ 0, err, args)
+
+# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ internal_syscall##nr (MOVE32 "\t%0, %2\n\t", \
+ "r" (__s0), \
+ number, err, args)
+
+#endif /* !__mips16 */
+
+#define internal_syscall0(v0_init, input, number, err, dummy...) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a3 asm("$7"); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a3 asm ("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set reorder" \
: "=r" (__v0), "=r" (__a3) \
@@ -97,17 +158,19 @@
_sys_result; \
})
-#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
+#define internal_syscall1(v0_init, input, number, err, arg1) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a3 asm("$7"); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a3 asm ("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set reorder" \
: "=r" (__v0), "=r" (__a3) \
@@ -119,20 +182,22 @@
_sys_result; \
})
-#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
+#define internal_syscall2(v0_init, input, number, err, arg1, arg2) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a3 asm("$7"); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a3 asm ("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1) \
: __SYSCALL_CLOBBERS); \
@@ -142,21 +207,24 @@
_sys_result; \
})
-#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3)\
+#define internal_syscall3(v0_init, input, number, err, \
+ arg1, arg2, arg3) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7"); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2) \
: __SYSCALL_CLOBBERS); \
@@ -166,21 +234,24 @@
_sys_result; \
})
-#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4)\
+#define internal_syscall4(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2) \
: __SYSCALL_CLOBBERS); \
@@ -197,25 +268,28 @@
#define FORCE_FRAME_POINTER \
void *volatile __fp_force __attribute__ ((unused)) = alloca (4)
-#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5)\
+#define internal_syscall5(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5) \
({ \
long _sys_result; \
\
FORCE_FRAME_POINTER; \
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"subu\t$29, 32\n\t" \
"sw\t%6, 16($29)\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
"addiu\t$29, 32\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), \
"r" ((long) (arg5)) \
@@ -226,26 +300,29 @@
_sys_result; \
})
-#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6)\
+#define internal_syscall6(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
long _sys_result; \
\
FORCE_FRAME_POINTER; \
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"subu\t$29, 32\n\t" \
"sw\t%6, 16($29)\n\t" \
"sw\t%7, 20($29)\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
"addiu\t$29, 32\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), \
"r" ((long) (arg5)), "r" ((long) (arg6)) \
@@ -256,27 +333,30 @@
_sys_result; \
})
-#define internal_syscall7(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\
+#define internal_syscall7(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
({ \
long _sys_result; \
\
FORCE_FRAME_POINTER; \
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"subu\t$29, 32\n\t" \
"sw\t%6, 16($29)\n\t" \
"sw\t%7, 20($29)\n\t" \
"sw\t%8, 24($29)\n\t" \
- cs_init \
+ v0_init \
"syscall\n\t" \
"addiu\t$29, 32\n\t" \
- ".set\treorder" \
+ ".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), \
"r" ((long) (arg5)), "r" ((long) (arg6)), "r" ((long) (arg7)) \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c
index 4367d1efe..6e52e3263 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
/* Truncate the file FD refers to to LENGTH bytes. */
int
@@ -30,7 +29,7 @@ truncate64 (const char *path, off64_t length)
{
unsigned int low = length & 0xffffffff;
unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (truncate64, 4, CHECK_STRING (path), 0,
+ int result = INLINE_SYSCALL (truncate64, 4, path, 0,
__LONG_LONG_PAIR (high, low));
return result;
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
index 017b39d60..624994022 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
@@ -23,7 +23,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <xstatconv.h>
@@ -35,7 +34,7 @@ __fxstat64 (int vers, int fd, struct stat64 *buf)
int result;
struct kernel_stat kbuf;
- result = INLINE_SYSCALL (fstat, 2, fd, __ptrvalue (&kbuf));
+ result = INLINE_SYSCALL (fstat, 2, fd, &kbuf);
if (result == 0)
result = __xstat64_conv (vers, &kbuf, buf);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
index 32571e717..ca2f2f615 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
@@ -25,7 +25,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -96,11 +95,9 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
}
if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
+ result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
else
- result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
+ result = INTERNAL_SYSCALL (stat, err, 2, file, &kst);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat64_conv (vers, &kst, st);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
index 106271f75..b01204deb 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
@@ -23,7 +23,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <xstatconv.h>
@@ -34,7 +33,7 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf)
int result;
struct kernel_stat kbuf;
- result = INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), __ptrvalue (&kbuf));
+ result = INLINE_SYSCALL (lstat, 2, name, &kbuf);
if (result == 0)
result = __xstat64_conv (vers, &kbuf, buf);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
index b8905edd7..3b94b1bef 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
@@ -20,14 +20,12 @@
#include <ipc_priv.h>
#include <sysdep.h>
-#include <bp-checks.h>
-
int __msgctl (int msqid, int cmd, struct msqid_ds *buf);
int
__msgctl (int msqid, int cmd, struct msqid_ds *buf)
{
- return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, CHECK_1 (buf));
+ return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, buf);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist
index df2e63728..9dbbd97c8 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist
@@ -1398,6 +1398,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index 73cc8479a..452c2c70e 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -52,14 +52,14 @@
/* Define a macro which expands into the inline wrapper code for a system
call. */
#undef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...) \
+#define INLINE_SYSCALL(name, nr, args...) \
({ INTERNAL_SYSCALL_DECL(err); \
- long result_var = INTERNAL_SYSCALL (name, err, nr, args); \
- if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \
- { \
- __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \
- result_var = -1L; \
- } \
+ long result_var = INTERNAL_SYSCALL (name, err, nr, args); \
+ if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \
+ result_var = -1L; \
+ } \
result_var; })
#undef INTERNAL_SYSCALL_DECL
@@ -71,175 +71,223 @@
#undef INTERNAL_SYSCALL_ERRNO
#define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val)
+/* Note that the original Linux syscall restart convention required the
+ instruction immediately preceding SYSCALL to initialize $v0 with the
+ syscall number. Then if a restart triggered, $v0 would have been
+ clobbered by the syscall interrupted, and needed to be reinititalized.
+ The kernel would decrement the PC by 4 before switching back to the
+ user mode so that $v0 had been reloaded before SYSCALL was executed
+ again. This implied the place $v0 was loaded from must have been
+ preserved across a syscall, e.g. an immediate, static register, stack
+ slot, etc.
+
+ The convention was relaxed in Linux with a change applied to the kernel
+ GIT repository as commit 96187fb0bc30cd7919759d371d810e928048249d, that
+ first appeared in the 2.6.36 release. Since then the kernel has had
+ code that reloads $v0 upon syscall restart and resumes right at the
+ SYSCALL instruction, so no special arrangement is needed anymore.
+
+ For backwards compatibility with existing kernel binaries we support
+ the old convention by choosing the instruction preceding SYSCALL
+ carefully. This also means we have to force a 32-bit encoding of the
+ microMIPS MOVE instruction if one is used. */
+
+#ifdef __mips_micromips
+# define MOVE32 "move32"
+#else
+# define MOVE32 "move"
+#endif
+
#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err, nr, args...) \
- internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
- "i" (SYS_ify (name)), err, args)
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t", \
+ "IK" (SYS_ify (name)), \
+ 0, err, args)
#undef INTERNAL_SYSCALL_NCS
-#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
- internal_syscall##nr (= number, , "r" (__v0), err, args)
+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ internal_syscall##nr (MOVE32 "\t%0, %2\n\t", \
+ "r" (__s0), \
+ number, err, args)
-#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
-({ \
+#define internal_syscall0(v0_init, input, number, err, dummy...) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set reorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
-({ \
+#define internal_syscall1(v0_init, input, number, err, arg1) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set reorder" \
- : "=r" (__v0), "=r" (__a3) \
- : input, "r" (__a0) \
- : __SYSCALL_CLOBBERS); \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
+ : input, "r" (__a0) \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
-({ \
+#define internal_syscall2(v0_init, input, number, err, arg1, arg2) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a1 asm("$5") = ARGIFY (arg2); \
- register long long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a1 asm ("$5") = ARGIFY (arg2); \
+ register long long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \
-({ \
+#define internal_syscall3(v0_init, input, number, err, \
+ arg1, arg2, arg3) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a1 asm("$5") = ARGIFY (arg2); \
- register long long __a2 asm("$6") = ARGIFY (arg3); \
- register long long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a1 asm ("$5") = ARGIFY (arg2); \
+ register long long __a2 asm ("$6") = ARGIFY (arg3); \
+ register long long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \
-({ \
+#define internal_syscall4(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a1 asm("$5") = ARGIFY (arg2); \
- register long long __a2 asm("$6") = ARGIFY (arg3); \
- register long long __a3 asm("$7") = ARGIFY (arg4); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
- : input, "r" (__a0), "r" (__a1), "r" (__a2) \
- : __SYSCALL_CLOBBERS); \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a1 asm ("$5") = ARGIFY (arg2); \
+ register long long __a2 asm ("$6") = ARGIFY (arg3); \
+ register long long __a3 asm ("$7") = ARGIFY (arg4); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \
-({ \
+#define internal_syscall5(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a1 asm("$5") = ARGIFY (arg2); \
- register long long __a2 asm("$6") = ARGIFY (arg3); \
- register long long __a3 asm("$7") = ARGIFY (arg4); \
- register long long __a4 asm("$8") = ARGIFY (arg5); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a1 asm ("$5") = ARGIFY (arg2); \
+ register long long __a2 asm ("$6") = ARGIFY (arg3); \
+ register long long __a3 asm ("$7") = ARGIFY (arg4); \
+ register long long __a4 asm ("$8") = ARGIFY (arg5); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \
-({ \
+#define internal_syscall6(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5, arg6) \
+({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a1 asm("$5") = ARGIFY (arg2); \
- register long long __a2 asm("$6") = ARGIFY (arg3); \
- register long long __a3 asm("$7") = ARGIFY (arg4); \
- register long long __a4 asm("$8") = ARGIFY (arg5); \
- register long long __a5 asm("$9") = ARGIFY (arg6); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
+ register long long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long long __v0 asm ("$2"); \
+ register long long __a0 asm ("$4") = ARGIFY (arg1); \
+ register long long __a1 asm ("$5") = ARGIFY (arg2); \
+ register long long __a2 asm ("$6") = ARGIFY (arg3); \
+ register long long __a3 asm ("$7") = ARGIFY (arg4); \
+ register long long __a4 asm ("$8") = ARGIFY (arg5); \
+ register long long __a5 asm ("$9") = ARGIFY (arg6); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \
"r" (__a5) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
index b3bed4663..c5f1c350e 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
@@ -31,9 +31,9 @@ ENTRY (__ioctl)
ret
L(error):
- SETUP_GP64 (a0, __ioctl)
+ SETUP_GP64_REG (a0, __ioctl)
PTR_LA t9, __syscall_error
- RESTORE_GP64
+ RESTORE_GP64_REG
jr t9
PSEUDO_END (__ioctl)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist
index 22b3068d8..c7e46aa86 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist
@@ -1396,6 +1396,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_Exit F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
index 86a57e02f..d16ed6941 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
@@ -48,14 +48,14 @@
/* Define a macro which expands into the inline wrapper code for a system
call. */
#undef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...) \
+#define INLINE_SYSCALL(name, nr, args...) \
({ INTERNAL_SYSCALL_DECL(err); \
- long result_var = INTERNAL_SYSCALL (name, err, nr, args); \
- if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \
- { \
- __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \
- result_var = -1L; \
- } \
+ long result_var = INTERNAL_SYSCALL (name, err, nr, args); \
+ if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \
+ result_var = -1L; \
+ } \
result_var; })
#undef INTERNAL_SYSCALL_DECL
@@ -67,175 +67,223 @@
#undef INTERNAL_SYSCALL_ERRNO
#define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val)
+/* Note that the original Linux syscall restart convention required the
+ instruction immediately preceding SYSCALL to initialize $v0 with the
+ syscall number. Then if a restart triggered, $v0 would have been
+ clobbered by the syscall interrupted, and needed to be reinititalized.
+ The kernel would decrement the PC by 4 before switching back to the
+ user mode so that $v0 had been reloaded before SYSCALL was executed
+ again. This implied the place $v0 was loaded from must have been
+ preserved across a syscall, e.g. an immediate, static register, stack
+ slot, etc.
+
+ The convention was relaxed in Linux with a change applied to the kernel
+ GIT repository as commit 96187fb0bc30cd7919759d371d810e928048249d, that
+ first appeared in the 2.6.36 release. Since then the kernel has had
+ code that reloads $v0 upon syscall restart and resumes right at the
+ SYSCALL instruction, so no special arrangement is needed anymore.
+
+ For backwards compatibility with existing kernel binaries we support
+ the old convention by choosing the instruction preceding SYSCALL
+ carefully. This also means we have to force a 32-bit encoding of the
+ microMIPS MOVE instruction if one is used. */
+
+#ifdef __mips_micromips
+# define MOVE32 "move32"
+#else
+# define MOVE32 "move"
+#endif
+
#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err, nr, args...) \
- internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
- "i" (SYS_ify (name)), err, args)
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t", \
+ "IK" (SYS_ify (name)), \
+ 0, err, args)
#undef INTERNAL_SYSCALL_NCS
-#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
- internal_syscall##nr (= number, , "r" (__v0), err, args)
+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ internal_syscall##nr (MOVE32 "\t%0, %2\n\t", \
+ "r" (__s0), \
+ number, err, args)
-#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
-({ \
+#define internal_syscall0(v0_init, input, number, err, dummy...) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set reorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
-({ \
+#define internal_syscall1(v0_init, input, number, err, arg1) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set reorder" \
- : "=r" (__v0), "=r" (__a3) \
- : input, "r" (__a0) \
- : __SYSCALL_CLOBBERS); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
+ : input, "r" (__a0) \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
-({ \
+#define internal_syscall2(v0_init, input, number, err, arg1, arg2) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \
-({ \
+#define internal_syscall3(v0_init, input, number, err, \
+ arg1, arg2, arg3) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7"); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "=r" (__a3) \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \
-({ \
+#define internal_syscall4(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
- : input, "r" (__a0), "r" (__a1), "r" (__a2) \
- : __SYSCALL_CLOBBERS); \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \
-({ \
+#define internal_syscall5(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
- register long __a4 asm("$8") = (long) (arg5); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
+ register long __a4 asm ("$8") = (long) (arg5); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
_sys_result; \
})
-#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \
-({ \
+#define internal_syscall6(v0_init, input, number, err, \
+ arg1, arg2, arg3, arg4, arg5, arg6) \
+({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) (arg1); \
- register long __a1 asm("$5") = (long) (arg2); \
- register long __a2 asm("$6") = (long) (arg3); \
- register long __a3 asm("$7") = (long) (arg4); \
- register long __a4 asm("$8") = (long) (arg5); \
- register long __a5 asm("$9") = (long) (arg6); \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- cs_init \
- "syscall\n\t" \
- ".set\treorder" \
- : "=r" (__v0), "+r" (__a3) \
+ register long __s0 asm ("$16") __attribute__ ((unused)) \
+ = (number); \
+ register long __v0 asm ("$2"); \
+ register long __a0 asm ("$4") = (long) (arg1); \
+ register long __a1 asm ("$5") = (long) (arg2); \
+ register long __a2 asm ("$6") = (long) (arg3); \
+ register long __a3 asm ("$7") = (long) (arg4); \
+ register long __a4 asm ("$8") = (long) (arg5); \
+ register long __a5 asm ("$9") = (long) (arg6); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+ v0_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \
"r" (__a5) \
- : __SYSCALL_CLOBBERS); \
+ : __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
} \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
index 354eba2f3..656522566 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
@@ -57,6 +57,7 @@
cfi_same_value (gp); \
RESTORESTK; \
ret; \
+ cfi_endproc; \
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
ENTRY (name) \
SAVESTK; \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
index 7e5488dbd..e43e8937a 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/semctl.c
@@ -30,9 +30,6 @@ union semun
struct seminfo *__buf; /* buffer for IPC_INFO */
};
-#include <bp-checks.h>
-#include <bp-semctl.h> /* definition of CHECK_SEMCTL needs union semum */
-
int __semctl (int semid, int semnum, int cmd, ...);
int
@@ -49,7 +46,7 @@ __semctl (int semid, int semnum, int cmd, ...)
va_end (ap);
return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
- CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)->array);
+ arg.array);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
index 9b183f335..197f7eb80 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
@@ -20,14 +20,12 @@
#include <ipc_priv.h>
#include <sysdep.h>
-#include <bp-checks.h>
-
int __shmctl (int shmid, int cmd, struct shmid_ds *buf);
int
__shmctl (int shmid, int cmd, struct shmid_ds *buf)
{
- return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, CHECK_1 (buf));
+ return INLINE_SYSCALL (shmctl, 3, shmid, cmd | __IPC_64, buf);
}
#include <shlib-compat.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
index 839276d7a..850025c63 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
@@ -30,7 +30,9 @@ NESTED (syscall, SZREG, ra)
.mask 0x00010000, -SZREG
.fmask 0x00000000, 0
PTR_ADDIU sp, -SZREG
+ cfi_adjust_cfa_offset (SZREG)
REG_S s0, (sp)
+ cfi_rel_offset (s0, 0)
move s0, a0
move a0, a1 /* shift arg1 - arg7. */
@@ -45,15 +47,17 @@ NESTED (syscall, SZREG, ra)
syscall /* Do the system call. */
REG_L s0, (sp)
+ cfi_restore (s0)
PTR_ADDIU sp, SZREG
+ cfi_adjust_cfa_offset (-SZREG)
bne a3, zero, L(error)
ret
L(error):
- SETUP_GP64 (a0, syscall)
+ SETUP_GP64_REG (a0, syscall)
PTR_LA t9, __syscall_error
- RESTORE_GP64
+ RESTORE_GP64_REG
jr t9
END (syscall)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
index 2408e5e37..89cde2b33 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
@@ -23,7 +23,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <xstatconv.h>
@@ -35,7 +34,7 @@ __xstat64 (int vers, const char *name, struct stat64 *buf)
int result;
struct kernel_stat kbuf;
- result = INLINE_SYSCALL (stat, 2, CHECK_STRING (name), __ptrvalue (&kbuf));
+ result = INLINE_SYSCALL (stat, 2, name, &kbuf);
if (result == 0)
result = __xstat64_conv (vers, &kbuf, buf);
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
index fe7c747cd..4f27b8b82 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
@@ -36,6 +36,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -141,6 +143,34 @@
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
+ })
+
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
static inline int __attribute__((always_inline))
__lll_trylock(int *futex)
{
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h
index e1dd67252..3b0eccc77 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h
@@ -39,6 +39,7 @@
# undef PSEUDO
# define PSEUDO(name, syscall_name, args) \
.align 2; \
+ .set nomips16; \
L(pseudo_start): \
cfi_startproc; \
99: PSEUDO_ERRJMP \
@@ -52,6 +53,7 @@
.set reorder; \
bne a3, zero, 99b; \
ret; \
+ cfi_endproc; \
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
ENTRY (name) \
.set noreorder; \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/pread.c b/libc/ports/sysdeps/unix/sysv/linux/mips/pread.c
index b269e1c25..db18265e3 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/pread.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/pread.c
@@ -26,7 +26,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -54,10 +53,9 @@ __libc_pread (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
#endif
return result;
@@ -66,9 +64,9 @@ __libc_pread (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/pread64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/pread64.c
index 8c2c403a9..3b8c8aa72 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/pread64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/pread64.c
@@ -25,7 +25,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -50,10 +49,9 @@ __libc_pread64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
#endif
@@ -63,9 +61,9 @@ __libc_pread64 (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset);
+ result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite.c b/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite.c
index aa3501414..94213bc8b 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite.c
@@ -26,7 +26,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -54,10 +53,9 @@ __libc_pwrite (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
#endif
return result;
@@ -66,9 +64,9 @@ __libc_pwrite (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c
index 1d14e0761..aa8a4dec3 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c
@@ -25,7 +25,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <kernel-features.h>
@@ -49,10 +48,9 @@ __libc_pwrite64 (fd, buf, count, offset)
if (SINGLE_THREAD_P)
{
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
- offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
#endif
@@ -63,9 +61,9 @@ __libc_pwrite64 (fd, buf, count, offset)
int oldtype = LIBC_CANCEL_ASYNC ();
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
- result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset);
+ result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
#else
- result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
#endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/setcontext.S b/libc/ports/sysdeps/unix/sysv/linux/mips/setcontext.S
index 42f709d84..2d5aee013 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/setcontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/setcontext.S
@@ -27,6 +27,7 @@
/* int setcontext (const ucontext_t *ucp) */
.text
+ .set nomips16
LOCALSZ = 0
ARGSZ = 0
MASK = 0x00000000
@@ -56,9 +57,10 @@ NESTED (__setcontext, FRAMESZ, ra)
#endif
PTR_ADDIU sp, -FRAMESZ
+ cfi_adjust_cfa_offset (FRAMESZ)
#ifdef __PIC__
- SETUP_GP64 (GPOFF, __setcontext)
+ SETUP_GP64_STACK (GPOFF, __setcontext)
SAVE_GP (GPOFF)
#endif
@@ -152,6 +154,7 @@ NESTED (__setcontext, FRAMESZ, ra)
and call the signal return syscall as if a signal
handler exited normally. */
PTR_ADDIU sp, -((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
+ cfi_adjust_cfa_offset ((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
/* Only ucontext is referred to from rt_sigreturn,
copy it. */
@@ -175,11 +178,13 @@ NESTED (__setcontext, FRAMESZ, ra)
path. Successful rt_sigreturn never returns to
its calling place. */
PTR_ADDIU sp, ((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
+ cfi_adjust_cfa_offset (-((RT_SIGFRAME_SIZE + ALSZ) & ALMASK))
99:
#ifdef __PIC__
PTR_LA t9, JUMPTARGET (__syscall_error)
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDIU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
jr t9
#else /* ! __PIC__ */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/sigaction.c b/libc/ports/sysdeps/unix/sysv/linux/mips/sigaction.c
index c490dd144..9d8ee76d0 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/sigaction.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/sigaction.c
@@ -71,8 +71,8 @@ __libc_sigaction (sig, act, oact)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
result = INLINE_SYSCALL (rt_sigaction, 4, sig,
- act ? __ptrvalue (&kact) : NULL,
- oact ? __ptrvalue (&koact) : NULL,
+ act ? &kact : NULL,
+ oact ? &koact : NULL,
sizeof (kernel_sigset_t));
if (oact && result >= 0)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S b/libc/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S
index d965f3919..ec271b058 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S
@@ -27,6 +27,7 @@
/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
.text
+ .set nomips16
LOCALSZ = 0
ARGSZ = 0
MASK = 0x00000000
@@ -63,7 +64,8 @@ NESTED (__swapcontext, FRAMESZ, ra)
# endif
PTR_ADDIU sp, -FRAMESZ
- SETUP_GP64 (GPOFF, __swapcontext)
+ cfi_adjust_cfa_offset (FRAMESZ)
+ SETUP_GP64_STACK (GPOFF, __swapcontext)
SAVE_GP (GPOFF)
#else /* ! __PIC__ */
@@ -198,8 +200,9 @@ NESTED (__swapcontext, FRAMESZ, ra)
99:
#ifdef __PIC__
PTR_LA t9, JUMPTARGET (__syscall_error)
- RESTORE_GP64
+ RESTORE_GP64_STACK
PTR_ADDIU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
jr t9
#else /* ! __PIC__ */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/ustat.c b/libc/ports/sysdeps/unix/sysv/linux/mips/ustat.c
index f05bba629..6db482e96 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/ustat.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/ustat.c
@@ -22,7 +22,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
int
ustat (dev_t dev, struct ustat *ubuf)
@@ -32,5 +31,5 @@ ustat (dev_t dev, struct ustat *ubuf)
/* We must convert the value to dev_t type used by the kernel. */
k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff);
- return INLINE_SYSCALL (ustat, 2, k_dev, CHECK_1 (ubuf));
+ return INLINE_SYSCALL (ustat, 2, k_dev, ubuf);
}
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/vfork.S b/libc/ports/sysdeps/unix/sysv/linux/mips/vfork.S
index b9503c394..ae76a91d3 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/vfork.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/vfork.S
@@ -34,6 +34,7 @@
/* int vfork() */
.text
+ .set nomips16
LOCALSZ= 1
FRAMESZ= (((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
GPOFF= FRAMESZ-(1*SZREG)
@@ -42,7 +43,8 @@ NESTED(__vfork,FRAMESZ,sp)
SETUP_GP
#endif
PTR_SUBU sp, FRAMESZ
- SETUP_GP64 (a5, __vfork)
+ cfi_adjust_cfa_offset (FRAMESZ)
+ SETUP_GP64_REG (a5, __vfork)
#ifdef __PIC__
SAVE_GP (GPOFF)
#endif
@@ -63,6 +65,7 @@ NESTED(__vfork,FRAMESZ,sp)
#endif
PTR_ADDU sp, FRAMESZ
+ cfi_adjust_cfa_offset (-FRAMESZ)
SAVE_PID
@@ -75,20 +78,22 @@ NESTED(__vfork,FRAMESZ,sp)
RESTORE_PID
+ cfi_remember_state
bnez a3,L(error)
/* Successful return from the parent or child. */
- RESTORE_GP64
+ RESTORE_GP64_REG
ret
/* Something bad happened -- no child created. */
L(error):
+ cfi_restore_state
#ifdef __PIC__
PTR_LA t9, __syscall_error
- RESTORE_GP64
+ RESTORE_GP64_REG
jr t9
#else
- RESTORE_GP64
+ RESTORE_GP64_REG
j __syscall_error
#endif
END(__vfork)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist
index 0efc6b55c..9b6d66374 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist
@@ -1781,6 +1781,9 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
GLIBC_2.2
GLIBC_2.2 A
_IO_adjust_wcolumn F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
index e6f5d1905..a9822ec96 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
@@ -38,6 +38,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -139,7 +141,33 @@
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
static inline int __attribute__ ((always_inline))
diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist
index d79b2df55..caf74b89e 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist
@@ -2088,3 +2088,6 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist
index f61740567..68d975be5 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist
@@ -2088,3 +2088,6 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist
index d79b2df55..caf74b89e 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist
+++ b/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist
@@ -2088,3 +2088,6 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F