summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
Diffstat (limited to 'ports')
-rw-r--r--ports/ChangeLog.aarch6445
-rw-r--r--ports/ChangeLog.alpha53
-rw-r--r--ports/ChangeLog.am3325
-rw-r--r--ports/ChangeLog.arm325
-rw-r--r--ports/ChangeLog.hppa13
-rw-r--r--ports/ChangeLog.ia6487
-rw-r--r--ports/ChangeLog.m68k33
-rw-r--r--ports/ChangeLog.mips319
-rw-r--r--ports/ChangeLog.powerpc51
-rw-r--r--ports/ChangeLog.tile31
-rw-r--r--ports/sysdeps/aarch64/libm-test-ulps364
-rw-r--r--ports/sysdeps/alpha/memchr.c3
-rw-r--r--ports/sysdeps/am33/dl-machine.h8
-rw-r--r--ports/sysdeps/am33/elf/start.S8
-rw-r--r--ports/sysdeps/arm/__longjmp.S38
-rw-r--r--ports/sysdeps/arm/add_n.S99
-rw-r--r--ports/sysdeps/arm/addmul_1.S73
-rw-r--r--ports/sysdeps/arm/arm-features.h20
-rw-r--r--ports/sysdeps/arm/arm-mcount.S22
-rw-r--r--ports/sysdeps/arm/armv6/rawmemchr.S109
-rw-r--r--ports/sysdeps/arm/armv6/stpcpy.S1
-rw-r--r--ports/sysdeps/arm/armv6/strchr.S147
-rw-r--r--ports/sysdeps/arm/armv6/strcpy.S231
-rw-r--r--ports/sysdeps/arm/armv6/strlen.S103
-rw-r--r--ports/sysdeps/arm/armv6/strrchr.S131
-rw-r--r--ports/sysdeps/arm/armv6t2/Implies2
-rw-r--r--ports/sysdeps/arm/armv6t2/ffs.S (renamed from ports/sysdeps/arm/jmpbuf-offsets.h)22
-rw-r--r--ports/sysdeps/arm/armv6t2/ffsll.S50
-rw-r--r--ports/sysdeps/arm/armv6t2/memchr.S62
-rw-r--r--ports/sysdeps/arm/bits/setjmp.h2
-rw-r--r--ports/sysdeps/arm/configure6
-rw-r--r--ports/sysdeps/arm/configure.in4
-rw-r--r--ports/sysdeps/arm/crti.S6
-rw-r--r--ports/sysdeps/arm/crtn.S10
-rw-r--r--ports/sysdeps/arm/dl-machine.h2
-rw-r--r--ports/sysdeps/arm/dl-tlsdesc.S77
-rw-r--r--ports/sysdeps/arm/dl-trampoline.S19
-rw-r--r--ports/sysdeps/arm/frame.h6
-rw-r--r--ports/sysdeps/arm/include/bits/setjmp.h34
-rw-r--r--ports/sysdeps/arm/jmpbuf-unwind.h1
-rw-r--r--ports/sysdeps/arm/memcpy.S249
-rw-r--r--ports/sysdeps/arm/memmove.S249
-rw-r--r--ports/sysdeps/arm/memset.S46
-rw-r--r--ports/sysdeps/arm/preconfigure97
-rw-r--r--ports/sysdeps/arm/preconfigure.in58
-rw-r--r--ports/sysdeps/arm/setjmp.S35
-rw-r--r--ports/sysdeps/arm/start.S10
-rw-r--r--ports/sysdeps/arm/strlen.S11
-rw-r--r--ports/sysdeps/arm/sub_n.S2
-rw-r--r--ports/sysdeps/arm/submul_1.S74
-rw-r--r--ports/sysdeps/arm/sysdep.h250
-rw-r--r--ports/sysdeps/ia64/dl-fptr.h10
-rw-r--r--ports/sysdeps/ia64/dl-machine.h4
-rw-r--r--ports/sysdeps/ia64/entry.h5
-rw-r--r--ports/sysdeps/ia64/fpu/libm_error.c115
-rw-r--r--ports/sysdeps/ia64/memchr.S3
-rw-r--r--ports/sysdeps/m68k/memchr.S3
-rw-r--r--ports/sysdeps/mips/__longjmp.c6
-rw-r--r--ports/sysdeps/mips/abort-instr.h6
-rw-r--r--ports/sysdeps/mips/add_n.S2
-rw-r--r--ports/sysdeps/mips/bits/atomic.h45
-rw-r--r--ports/sysdeps/mips/bits/nan.h28
-rw-r--r--ports/sysdeps/mips/bsd-_setjmp.S4
-rw-r--r--ports/sysdeps/mips/bsd-setjmp.S4
-rw-r--r--ports/sysdeps/mips/dl-machine.h102
-rw-r--r--ports/sysdeps/mips/dl-trampoline.c130
-rw-r--r--ports/sysdeps/mips/fpu/e_sqrt.c2
-rw-r--r--ports/sysdeps/mips/fpu/e_sqrtf.c2
-rw-r--r--ports/sysdeps/mips/fpu_control.h11
-rw-r--r--ports/sysdeps/mips/include/sys/asm.h53
-rw-r--r--ports/sysdeps/mips/machine-gmon.h14
-rw-r--r--ports/sysdeps/mips/memset.S1
-rw-r--r--ports/sysdeps/mips/mips32/crti.S2
-rw-r--r--ports/sysdeps/mips/mips32/crtn.S2
-rw-r--r--ports/sysdeps/mips/mips32/fpu/Versions5
-rw-r--r--ports/sysdeps/mips/mips32/fpu/fpu_control.c34
-rw-r--r--ports/sysdeps/mips/mips32/mips16/add_n.c1
-rw-r--r--ports/sysdeps/mips/mips32/mips16/addmul_1.c1
-rw-r--r--ports/sysdeps/mips/mips32/mips16/fpu/Makefile5
-rw-r--r--ports/sysdeps/mips/mips32/mips16/lshift.c1
-rw-r--r--ports/sysdeps/mips/mips32/mips16/mul_1.c1
-rw-r--r--ports/sysdeps/mips/mips32/mips16/rshift.c1
-rw-r--r--ports/sysdeps/mips/mips32/mips16/sub_n.c1
-rw-r--r--ports/sysdeps/mips/mips32/mips16/submul_1.c1
-rw-r--r--ports/sysdeps/mips/mips64/add_n.S8
-rw-r--r--ports/sysdeps/mips/mips64/addmul_1.S8
-rw-r--r--ports/sysdeps/mips/mips64/bsd-_setjmp.S6
-rw-r--r--ports/sysdeps/mips/mips64/bsd-setjmp.S6
-rw-r--r--ports/sysdeps/mips/mips64/lshift.S8
-rw-r--r--ports/sysdeps/mips/mips64/mul_1.S8
-rw-r--r--ports/sysdeps/mips/mips64/n32/crti.S2
-rw-r--r--ports/sysdeps/mips/mips64/n32/crtn.S2
-rw-r--r--ports/sysdeps/mips/mips64/n64/crti.S2
-rw-r--r--ports/sysdeps/mips/mips64/n64/crtn.S2
-rw-r--r--ports/sysdeps/mips/mips64/rshift.S8
-rw-r--r--ports/sysdeps/mips/mips64/setjmp.S6
-rw-r--r--ports/sysdeps/mips/mips64/sub_n.S8
-rw-r--r--ports/sysdeps/mips/mips64/submul_1.S8
-rw-r--r--ports/sysdeps/mips/nptl/tls.h5
-rw-r--r--ports/sysdeps/mips/preconfigure7
-rw-r--r--ports/sysdeps/mips/setjmp.S4
-rw-r--r--ports/sysdeps/mips/setjmp_aux.c2
-rw-r--r--ports/sysdeps/mips/start.S80
-rw-r--r--ports/sysdeps/mips/sys/asm.h13
-rw-r--r--ports/sysdeps/mips/sys/tas.h5
-rw-r--r--ports/sysdeps/mips/tls-macros.h63
-rw-r--r--ports/sysdeps/powerpc/nofpu/fegetenv.c5
-rw-r--r--ports/sysdeps/powerpc/nofpu/fesetenv.c5
-rw-r--r--ports/sysdeps/powerpc/nofpu/feupdateenv.c5
-rw-r--r--ports/sysdeps/powerpc/nofpu/fgetexcptflg.c5
-rw-r--r--ports/sysdeps/powerpc/nofpu/fraiseexcpt.c5
-rw-r--r--ports/sysdeps/powerpc/nofpu/fsetexcptflg.c5
-rw-r--r--ports/sysdeps/powerpc/powerpc32/405/memcmp.S6
-rw-r--r--ports/sysdeps/powerpc/powerpc32/405/memcpy.S6
-rw-r--r--ports/sysdeps/powerpc/powerpc32/405/memset.S6
-rw-r--r--ports/sysdeps/powerpc/powerpc32/405/strcmp.S6
-rw-r--r--ports/sysdeps/powerpc/powerpc32/405/strcpy.S6
-rw-r--r--ports/sysdeps/powerpc/powerpc32/405/strlen.S6
-rw-r--r--ports/sysdeps/powerpc/powerpc32/405/strncmp.S6
-rw-r--r--ports/sysdeps/powerpc/powerpc32/476/memset.S6
-rw-r--r--ports/sysdeps/unix/alpha/sysdep.h3
-rw-r--r--ports/sysdeps/unix/arm/sysdep.S39
-rw-r--r--ports/sysdeps/unix/mips/mips32/sysdep.h6
-rw-r--r--ports/sysdeps/unix/mips/mips64/n32/sysdep.h8
-rw-r--r--ports/sysdeps/unix/mips/mips64/n64/sysdep.h8
-rw-r--r--ports/sysdeps/unix/mips/sysdep.S2
-rw-r--r--ports/sysdeps/unix/mips/sysdep.h12
-rw-r--r--ports/sysdeps/unix/sysv/linux/aarch64/bits/mman.h76
-rw-r--r--ports/sysdeps/unix/sysv/linux/aarch64/configure14
-rw-r--r--ports/sysdeps/unix/sysv/linux/aarch64/configure.in13
-rw-r--r--ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist1
-rw-r--r--ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c4
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h3
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/bits/msq.h1
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c1
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/gethostname.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/msgctl.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h25
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/shmctl.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/sigaction.c4
-rw-r--r--ports/sysdeps/unix/sysv/linux/am33/bits/mman.h63
-rw-r--r--ports/sysdeps/unix/sysv/linux/am33/brk.c2
-rw-r--r--ports/sysdeps/unix/sysv/linux/am33/clone.S7
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/Makefile5
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S6
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S9
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/bits/mman.h76
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/clone.S17
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/configure1
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/configure.in1
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/dl-cache.h9
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/getcontext.S2
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/mmap.S9
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/mmap64.S14
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist1
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h28
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S21
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h313
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c13
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c13
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S24
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/pread.c5
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/pread64.c5
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/pwrite.c5
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/pwrite64.c5
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/readelflib.c6
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/setcontext.S4
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/sigaction.c4
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/syscall.S5
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/sysdep.h234
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/truncate64.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/vfork.S3
-rw-r--r--ports/sysdeps/unix/sysv/linux/generic/bits/msq.h1
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h3
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/bits/msq.h1
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c12
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h2
-rw-r--r--ports/sysdeps/unix/sysv/linux/ia64/bits/mman.h76
-rw-r--r--ports/sysdeps/unix/sysv/linux/ia64/bits/msq.h6
-rw-r--r--ports/sysdeps/unix/sysv/linux/ia64/makecontext.c20
-rw-r--r--ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h27
-rw-r--r--ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/ia64/sigaction.c4
-rw-r--r--ports/sysdeps/unix/sysv/linux/ia64/sysdep.h7
-rw-r--r--ports/sysdeps/unix/sysv/linux/ia64/umount.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/m68k/bits/mman.h76
-rw-r--r--ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist1
-rw-r--r--ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h20
-rw-r--r--ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/Makefile3
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/bits/mman.h78
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/bits/msq.h1
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/brk.c13
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/clone.S20
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/configure3
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/configure.in2
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/getcontext.S12
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/makecontext.S7
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile13
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions6
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h89
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c30
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c32
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c32
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c32
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c32
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c33
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c33
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c33
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist21
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h204
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c7
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c4
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h150
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S4
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h150
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h1
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c4
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S8
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h30
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h2
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/pread.c10
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/pread64.c10
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/pwrite.c10
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/pwrite64.c10
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/setcontext.S9
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/sigaction.c4
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/swapcontext.S7
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/ustat.c3
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/vfork.S13
-rw-r--r--ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/bits/mman.h76
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h28
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist1
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist1
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist3
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist1
250 files changed, 5532 insertions, 1859 deletions
diff --git a/ports/ChangeLog.aarch64 b/ports/ChangeLog.aarch64
index 5a42510cb6..f01388f384 100644
--- a/ports/ChangeLog.aarch64
+++ b/ports/ChangeLog.aarch64
@@ -1,3 +1,48 @@
+2013-03-19 Andreas Schwab <schwab@suse.de>
+
+ * sysdeps/unix/sysv/linux/aarch64/configure.in: Set
+ libc_cv_rtlddir.
+ * sysdeps/unix/sysv/linux/aarch64/configure: Regenerate.
+
+2013-03-14 Andreas Schwab <schwab@suse.de>
+
+ * sysdeps/unix/sysv/linux/aarch64/configure.in: Set
+ libc_cv_slibdir, libdir and libc_cv_localedir.
+ * sysdeps/unix/sysv/linux/aarch64/configure: Regenerate.
+
+2013-03-11 Andreas Schwab <schwab@suse.de>
+
+ [BZ #15234]
+ * sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist
+ (GLIBC_2.17): Remove pthread_atfork.
+
+2013-03-07 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/aarch64/bits/mman.h: Remove all defines
+ provided by bits/mman-linux.h and include <bits/mman-linux.h>.
+
+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.
diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha
index 758e97c950..9a77d276ab 100644
--- a/ports/ChangeLog.alpha
+++ b/ports/ChangeLog.alpha
@@ -1,3 +1,56 @@
+2013-03-06 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/mman.h (MAP_HUGE_MASK)
+ (MAP_HUGE_SHIFT): Define.
+ * sysdeps/unix/sysv/linux/alpha/bits/msq.h (MSG_COPY): Define.
+
+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]
diff --git a/ports/ChangeLog.am33 b/ports/ChangeLog.am33
index 015fa9066e..42548b2c2b 100644
--- a/ports/ChangeLog.am33
+++ b/ports/ChangeLog.am33
@@ -1,3 +1,28 @@
+2013-03-11 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/am33/bits/mman.h: Remove all defines
+ provided by bits/mman-linux.h and include <bits/mman-linux.h>.
+
+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/ports/ChangeLog.arm b/ports/ChangeLog.arm
index d44ea76244..355d980ba5 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,3 +1,328 @@
+2013-03-26 Mans Rullgard <mans@mansr.com>
+
+ * sysdeps/arm/preconfigure.in: Use "test" instead of [ ].
+ * sysdeps/arm/preconfigure: Regenerated.
+
+2013-03-20 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/arm/configure.in (default-abi): Set using
+ LIBC_CONFIG_VAR.
+ * sysdeps/arm/configure: Regenerated.
+ * sysdeps/unix/sysv/linux/arm/Makefile: Do not include
+ default-abi.make.
+
+2013-03-18 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/arm/dl-tlsdesc.S: Include <arm-features.h>.
+ Use sfi_breg macro throughout.
+ (_dl_tlsdesc_dynamic) [!ARM_NO_INDEX_REGISTER]: Avoid two-register
+ addressing mode.
+ (_dl_tlsdesc_dynamic) [ARM_ALWAYS_BX]: Don't pop into pc.
+
+ * sysdeps/arm/arm-features.h: Add comment for ARM_NO_INDEX_REGISTER.
+
+2013-03-15 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/arm/sysdep.h [!ARM_SFI_MACROS] (sfi_sp): New macro.
+ * sysdeps/arm/__longjmp.S: Use it.
+
+ * sysdeps/arm/sysdep.h [!ARM_SFI_MACROS]
+ (ARM_SFI_MACROS): Define it.
+ (sfi_breg, sfi_pld): New assembler macros.
+ * sysdeps/arm/__longjmp.S: Use them for all memory references not
+ through the pc or sp registers.
+ * sysdeps/arm/add_n.S: Likewise.
+ * sysdeps/arm/addmul_1.S: Likewise.
+ * sysdeps/arm/arm-mcount.S: Likewise.
+ * sysdeps/arm/armv6/rawmemchr.S: Likewise.
+ * sysdeps/arm/armv6/strchr.S: Likewise.
+ * sysdeps/arm/armv6/strcpy.S: Likewise.
+ * sysdeps/arm/armv6/strlen.S: Likewise.
+ * sysdeps/arm/armv6/strrchr.S: Likewise.
+ * sysdeps/arm/armv6t2/memchr.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/arm/submul_1.S: Likewise.
+
+2013-03-13 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/arm/arm-features.h (ARM_BX_ALIGN_LOG2): New macro.
+ * sysdeps/arm/memcpy.S: Respect ARM_BX_ALIGN_LOG2.
+ * sysdeps/arm/memmove.S: Likewise.
+
+ * sysdeps/arm/add_n.S: Include <arm-features.h>.
+ [ARM_ALWAYS_BX]: Don't pop into pc.
+
+ * sysdeps/arm/arm-features.h: Add comment about ARM_ALWAYS_BX.
+ * sysdeps/arm/memcpy.S: Include <arm-features.h>.
+ [ARM_ALWAYS_BX]: Avoid pc as destination.
+ * sysdeps/arm/memmove.S: Likewise.
+
+2013-03-12 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/arm/armv6t2/memchr.S [NO_THUMB]:
+ Use .arm rather than .thumb, .thumb_func. Avoid cbz/cnbz instructions.
+
+ * sysdeps/arm/armv6t2/memchr.S: Change register allocation so ldrd use
+ is r4,r5 rather than r5,r6; this way ARM mode will allow that ldrd.
+
+2013-03-11 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/arm/preconfigure.in: Add comment about
+ -fno-unwind-tables addition to CFLAGS.
+ * sysdeps/arm/preconfigure: Regenerated.
+ * sysdeps/unix/sysv/linux/arm/configure.in: Add comment about
+ -fno-unwind-tables removal from CFLAGS.
+ * sysdeps/unix/sysv/linux/arm/configure: Regenerated.
+
+2013-03-11 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/arm/bits/setjmp.h: Test [!__ASSEMBLER__] rather than [!_ASM].
+ * sysdeps/arm/jmpbuf-offsets.h: File removed.
+ * sysdeps/arm/jmpbuf-unwind.h: Don't #include it.
+ * sysdeps/arm/include/bits/setjmp.h: New file.
+ * sysdeps/arm/setjmp.S (_SETJMP_H, _ASM): Macros removed.
+ Use JMP_BUF_REGLIST macro.
+ * sysdeps/arm/__longjmp.S: Likewise.
+
+ * sysdeps/arm/memcpy.S: Convert to unified assembly syntax.
+ * sysdeps/arm/memmove.S: Likewise.
+ * sysdeps/arm/memset.S: Likewise.
+ * sysdeps/arm/strlen.S: Likewise.
+
+ * sysdeps/arm/memcpy.S: Use r10 instead of r9.
+ * sysdeps/arm/memmove.S: Likewise.
+
+ * sysdeps/arm/preconfigure.in: New file.
+ * sysdeps/arm/preconfigure: Replaced with generated file.
+
+2013-03-11 Andreas Schwab <schwab@suse.de>
+
+ [BZ #15234]
+ * sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist (GLIBC_2.4):
+ Remove pthread_atfork.
+
+2013-03-06 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/arm/armv6/rawmemchr.S: New file.
+ * sysdeps/arm/armv6/stpcpy.S: New file.
+ * sysdeps/arm/armv6/strchr.S: New file.
+ * sysdeps/arm/armv6/strcpy.S: New file.
+ * sysdeps/arm/armv6/strlen.S: New file.
+ * sysdeps/arm/armv6/strrchr.S: New file.
+ * sysdeps/arm/armv6t2/Implies: New file.
+
+2013-03-06 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/arm/add_n.S: New file.
+ * sysdeps/arm/sub_n.S: New file.
+ * sysdeps/arm/submul_1.S: New file.
+ * sysdeps/arm/addmul_1.S: New file.
+ * sysdeps/arm/armv6t2/ffs.S: New file.
+ * sysdeps/arm/armv6t2/ffsll.S: New file.
+
+ * sysdeps/arm/sysdep.h (ARCH_HAS_HARD_TP): New macro.
+ (GET_TLS): Use hard-tp if ARCH_HAS_HARD_TP.
+ * sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h (GET_TLS): Don't override
+ the default definition if ARCH_HAS_HARD_TP.
+
+ * sysdeps/arm/sysdep.h (__ARM_ARCH): New macro.
+ (ARCH_HAS_BX, ARCH_HAS_BLX, ARCH_HAS_T2): New macros.
+ (BX): Select on ARCH_HAS_BX instead of __USE_BX__.
+ (BLX): Select on ARCH_HAS_BLX instead of __ARM_ARCH_4T__.
+ * ports/sysdeps/arm/dl-machine.h (BX): Select on ARCH_HAS_BX
+ instead of __USE_BX__.
+
+ * sysdeps/arm/arm-mcount.S (_mcount): Use pop into pc unless
+ __ARM_ARCH_4T__ and __THUMB_INTERWORK__.
+ * sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Likewise.
+
+ * sysdeps/arm/sysdep.h (BX, BXC, BLX): New macros.
+ (DO_RET): Use BX.
+ (RETINSTR): Use BXC.
+ * sysdeps/arm/dl-tlsdesc.S (BX): Remove.
+ * sysdeps/arm/dl-trampoline.S (BX): Remove.
+ (_dl_runtime_profile): Use BLX.
+
+ * sysdeps/arm/__longjmp.S (__longjmp): Use ldmia insn directly.
+ * sysdeps/arm/sysdep.h (LOADREGS): Remove.
+
+ * sysdeps/arm/arm-mcount.S (_mcount): Use push/pop mnemonics.
+ * sysdeps/arm/crti.S, sysdeps/arm/crtn.S: Likewise.
+ * sysdeps/arm/dl-tlsdesc.S: Likewise.
+ * sysdeps/arm/dl-trampoline.S: Likewise.
+ * sysdeps/arm/start.S: Likewise.
+ * sysdeps/arm/memcpy.S (PULL): Rename macro from pull.
+ (PUSH): Rename macro from push.
+ (memcpy): Use push/pop mnemonics.
+ * sysdeps/arm/memmove.S: Similarly.
+ * sysdeps/arm/sysdep.h (CALL_MCOUNT): Use push/pop mnemonics.
+ * sysdeps/unix/sysv/linux/arm/____longjmp_chk.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/clone.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/mmap.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/mmap64.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h: Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c: Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c: Likewise.
+ * sysdeps/unix/sysv/linux/arm/syscall.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/arm/vfork.S: Likewise.
+
+ * sysdeps/arm/sysdep.h [__ASSEMBLER__]: Enable thumb2 if __thumb2__.
+ (PC_OFS): Respect __thumb__ if __ASSEMBLER__.
+
+ * sysdeps/arm/sysdep.h (GET_TLS): New macro.
+ * sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_undefweak): Use it.
+ (_dl_tlsdesc_dynamic): Likewise.
+ * sysdeps/unix/arm/sysdep.S (__syscall_error): Likewise.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h (GET_TLS): New macro.
+ * sysdeps/unix/sysv/linux/arm/clone.S (__clone): Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S (SAVE_PID): Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/vfork.S (SAVE_PID): Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h (SINGLE_THREAD_P):
+ Likewise.
+ * sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S (__aeabi_read_tp):
+ Add thumb2 alternative.
+
+ * sysdeps/arm/sysdep.h (NEGOFF_ADJ_BASE): New macro.
+ (NEGOFF_ADJ_BASE2, NEGOFF_OFF1, NEGOFF_OFF2): New macros.
+ * sysdeps/unix/sysv/linux/arm/clone.S (__clone): Use them.
+ * sysdeps/unix/sysv/linux/arm/nptl/vfork.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S: Likewise.
+ * sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h (SINGLE_THREAD_P):
+ Likewise.
+
+ * sysdeps/arm/sysdep.h (LDST_PCREL): New macro.
+ * sysdeps/unix/arm/sysdep.S (__syscall_error): Use LDST_PCREL.
+ Fix up gottpoff load of errno for thumb2.
+ * sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+ (SINGLE_THREAD_P): Use LDST_PCREL.
+ (PSEUDO_PROLOGUE): Remove.
+ (PSEUDO): Don't use it.
+ * sysdeps/unix/sysv/linux/arm/sysdep.h (SYSCALL_ERROR_HANDLER):
+ Use LDST_PCREL.
+
+2013-03-06 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/arm/bits/mman.h: Remove all defines
+ provided by bits/mman-linux.h and include <bits/mman-linux.h>.
+
+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/ports/ChangeLog.hppa b/ports/ChangeLog.hppa
index ef904c2671..0610c177d9 100644
--- a/ports/ChangeLog.hppa
+++ b/ports/ChangeLog.hppa
@@ -1,3 +1,16 @@
+2013-03-06 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/hppa/bits/msq.h (MSG_COPY): Define.
+ * ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h (MAP_HUGE_MASK)
+ (MAP_HUGE_SHIFT): Define.
+
+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/ports/ChangeLog.ia64 b/ports/ChangeLog.ia64
index 4b76b4f6bf..50b5604ec1 100644
--- a/ports/ChangeLog.ia64
+++ b/ports/ChangeLog.ia64
@@ -1,3 +1,90 @@
+2013-03-12 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/unix/sysv/linux/ia64/sysdep.h (INTERNAL_SYSCALL_DECL): Add
+ __attribute__ ((unused)) to err decl.
+ (INTERNAL_SYSCALL_ERROR_P): Add (void)val dummy reference.
+
+2013-03-12 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/ia64/fpu/libm_error.c (STATIC): Delete redundant definition.
+ (_DECL_NUM, DECL_FLOAT, DECL_DOUBLE, DECL_LONG_DOUBLE): New defines.
+ (float_inf): Change definition to use DECL_FLOAT.
+ (float_huge, float_zero, float_neg_inf, float_neg_huge,
+ float_neg_zero): Likewise.
+ (double_inf): Change definition to use DECL_DOUBLE.
+ (double_huge, double_zero, double_neg_inf, double_neg_huge,
+ double_neg_zero): Likewise.
+ (long_double_inf): Change definition to use DECL_LONG_DOUBLE.
+ (long_double_huge, long_double_zero, long_double_neg_inf,
+ long_double_neg_huge, long_double_neg_zero): Likewise.
+ (RETVAL_HUGE_VALL): Change from casting a pointer to using the num
+ field of the union.
+ (RETVAL_NEG_HUGE_VALL, RETVAL_HUGEL, RETVAL_NEG_HUGEL,
+ RETVAL_HUGE_VALL, RETVAL_NEG_HUGE_VALL, RETVAL_HUGEL,
+ RETVAL_NEG_HUGEL, RETVAL_HUGE_VALD, RETVAL_NEG_HUGE_VALD,
+ RETVAL_HUGED, RETVAL_NEG_HUGED, RETVAL_HUGE_VALF,
+ RETVAL_NEG_HUGE_VALF, RETVAL_HUGEF, RETVAL_NEG_HUGEF,
+ ZEROL_VALUE, ZEROD_VALUE, ZEROF_VALUE, RETVAL_ZEROL,
+ RETVAL_ZEROD, RETVAL_ZEROF, RETVAL_NEG_ZEROL, RETVAL_NEG_ZEROD,
+ RETVAL_NEG_ZEROF): Likewise.
+
+2013-03-12 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/ia64/dl-fptr.h (ELF_PTR_TO_FDESC): New definition.
+ * sysdeps/ia64/dl-machine.h (elf_machine_runtime_setup): Change
+ struct fdesc * casts to use new ELF_PTR_TO_FDESC helper.
+ * sysdeps/ia64/entry.h: Include link.h and dl-fptr.h.
+ (ENTRY_POINT): Change cast to use new ELF_PTR_TO_FDESC helper.
+ * sysdeps/unix/sysv/linux/ia64/makecontext.c: Include link.h and
+ dl-fptr.h.
+ (struct fdesc): Remove structure, now redundant.
+ (makecontext): Change casts to use new ELF_PTR_TO_FDESC helper.
+
+2013-03-11 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/ia64/bits/mman.h: Remove all defines
+ provided by bits/mman-linux.h and include <bits/mman-linux.h>.
+
+2013-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/unix/sysv/linux/ia64/makecontext.c (__makecontext): Change
+ type of rbs to unsigned. Change stack_start cast to unsigned.
+
+2013-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h:
+ Change multiple inclusion guard to _LINUX_IA64_DL_SYSDEP_H.
+ Use #include_next.
+ (RTLD_PRIVATE_ERRNO): Remove definition, now redundant.
+ (NEED_DL_SYSINFO, _dl_discover_osversion,
+ HAVE_DL_DISCOVER_OSVERSION): Likewise.
+
+2013-03-06 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/ia64/bits/msq.h (MSG_COPY): Define.
+ (MSG_EXCEPT): Make conditional on __USE_GNU.
+
+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]
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
index 688cce431a..5e4fc6c468 100644
--- a/ports/ChangeLog.m68k
+++ b/ports/ChangeLog.m68k
@@ -1,3 +1,36 @@
+2013-03-11 Andreas Schwab <schwab@suse.de>
+
+ [BZ #15234]
+ * sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist
+ (GLIBC_2.4): Remove pthread_atfork.
+
+2013-03-06 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/m68k/bits/mman.h: Remove all defines
+ provided by bits/mman-linux.h and include <bits/mman-linux.h>.
+
+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.
diff --git a/ports/ChangeLog.mips b/ports/ChangeLog.mips
index 49a3938314..539cacf19d 100644
--- a/ports/ChangeLog.mips
+++ b/ports/ChangeLog.mips
@@ -1,3 +1,322 @@
+2013-03-20 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/configure.in (default-abi): Set
+ using LIBC_CONFIG_VAR.
+ * sysdeps/unix/sysv/linux/mips/configure: Regenerated.
+ * sysdeps/unix/sysv/linux/mips/Makefile: Do not include
+ default-abi.make.
+
+2013-03-15 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/mman.h [__USE_MISC]
+ (MAP_ANONYMOUS): Don't define.
+
+2013-03-06 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/mips/bits/mman.h: Remove all defines
+ provided by bits/mman-linux.h and include <bits/mman-linux.h>.
+ (__MAP_ANONYMOUS): Define.
+
+ * sysdeps/unix/sysv/linux/mips/bits/msq.h (MSG_COPY): Define.
+
+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]
diff --git a/ports/ChangeLog.powerpc b/ports/ChangeLog.powerpc
index 2746f37669..2ba8e3754f 100644
--- a/ports/ChangeLog.powerpc
+++ b/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/ports/ChangeLog.tile b/ports/ChangeLog.tile
index a5eaec3a9b..f63bde486b 100644
--- a/ports/ChangeLog.tile
+++ b/ports/ChangeLog.tile
@@ -1,3 +1,34 @@
+2013-03-11 Andreas Schwab <schwab@suse.de>
+
+ [BZ #15234]
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist
+ (GLIBC_2.12): Remove pthread_atfork.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist
+ (GLIBC_2.12): Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist
+ (GLIBC_2.12): Likewise.
+
+2013-03-05 Andreas Jaeger <aj@suse.de>
+
+ * sysdeps/unix/sysv/linux/tile/bits/mman.h: Remove all defines
+ provided by bits/mman-linux.h and include <bits/mman-linux.h>.
+
+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/ports/sysdeps/aarch64/libm-test-ulps b/ports/sysdeps/aarch64/libm-test-ulps
index eda0e77f88..aebc46f469 100644
--- a/ports/sysdeps/aarch64/libm-test-ulps
+++ b/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/ports/sysdeps/alpha/memchr.c b/ports/sysdeps/alpha/memchr.c
index 70416d5575..67f718a50e 100644
--- a/ports/sysdeps/alpha/memchr.c
+++ b/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/ports/sysdeps/am33/dl-machine.h b/ports/sysdeps/am33/dl-machine.h
index 2db27378db..924319d039 100644
--- a/ports/sysdeps/am33/dl-machine.h
+++ b/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/ports/sysdeps/am33/elf/start.S b/ports/sysdeps/am33/elf/start.S
index 0ca71f14a4..e89f9db15c 100644
--- a/ports/sysdeps/am33/elf/start.S
+++ b/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/ports/sysdeps/arm/__longjmp.S b/ports/sysdeps/arm/__longjmp.S
index 5c04f36457..8de9fa1c7b 100644
--- a/ports/sysdeps/arm/__longjmp.S
+++ b/ports/sysdeps/arm/__longjmp.S
@@ -16,9 +16,9 @@
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
#include <bits/setjmp.h>
#include <rtld-global-offsets.h>
#include <arm-features.h>
@@ -31,11 +31,13 @@ ENTRY (__longjmp)
moveq r0, #1 /* can't let setjmp() return zero! */
#ifdef CHECK_SP
- ldr r4, [ip, #32] /* jmpbuf's sp */
+ sfi_breg ip, \
+ ldr r4, [\B, #32] /* jmpbuf's sp */
cfi_undefined (r4)
CHECK_SP (r4)
#endif
- LOADREGS(ia, ip!, {v1-v6, sl, fp, sp, lr})
+ sfi_sp sfi_breg ip, \
+ ldmia \B!, JMP_BUF_REGLIST
cfi_restore (v1)
cfi_restore (v2)
cfi_restore (v3)
@@ -79,9 +81,11 @@ ENTRY (__longjmp)
/* Restore the VFP registers. */
/* Following instruction is vldmia ip!, {d8-d15}. */
- ldc p11, cr8, [r12], #64
+ sfi_breg r12, \
+ ldc p11, cr8, [\B], #64
/* Restore the floating-point status register. */
- ldr a3, [ip], #4
+ sfi_breg ip, \
+ ldr a3, [\B], #4
/* Following instruction is fmxr fpscr, a3. */
mcr p10, 7, a3, cr1, cr0, 0
.Lno_vfp:
@@ -92,12 +96,18 @@ ENTRY (__longjmp)
/* Restore the call-preserved iWMMXt registers. */
/* Following instructions are wldrd wr10, [ip], #8 (etc.) */
- ldcl p1, cr10, [r12], #8
- ldcl p1, cr11, [r12], #8
- ldcl p1, cr12, [r12], #8
- ldcl p1, cr13, [r12], #8
- ldcl p1, cr14, [r12], #8
- ldcl p1, cr15, [r12], #8
+ sfi_breg r12, \
+ ldcl p1, cr10, [\B], #8
+ sfi_breg r12, \
+ ldcl p1, cr11, [\B], #8
+ sfi_breg r12, \
+ ldcl p1, cr12, [\B], #8
+ sfi_breg r12, \
+ ldcl p1, cr13, [\B], #8
+ sfi_breg r12, \
+ ldcl p1, cr14, [\B], #8
+ sfi_breg r12, \
+ ldcl p1, cr15, [\B], #8
.Lno_iwmmxt:
#endif
@@ -105,12 +115,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/ports/sysdeps/arm/add_n.S b/ports/sysdeps/arm/add_n.S
new file mode 100644
index 0000000000..c6b0147972
--- /dev/null
+++ b/ports/sysdeps/arm/add_n.S
@@ -0,0 +1,99 @@
+/* mpn_add_n -- add (or subtract) bignums.
+ 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 <arm-features.h>
+
+ .syntax unified
+ .text
+
+#ifdef USE_AS_SUB_N
+# define INITC cmp r0, r0
+# define OPC sbcs
+# define RETC sbc r0, r0, r0; neg r0, r0
+# define FUNC __mpn_sub_n
+#else
+# define INITC cmn r0, #0
+# define OPC adcs
+# define RETC mov r0, #0; adc r0, r0, r0
+# define FUNC __mpn_add_n
+#endif
+
+/* mp_limb_t mpn_add_n(res_ptr, src1_ptr, src2_ptr, size) */
+
+ENTRY (FUNC)
+ push { r4, r5, r6, r7, r8, r10, lr }
+ cfi_adjust_cfa_offset (28)
+ cfi_rel_offset (r4, 0)
+ cfi_rel_offset (r5, 4)
+ cfi_rel_offset (r6, 8)
+ cfi_rel_offset (r7, 12)
+ cfi_rel_offset (r8, 16)
+ cfi_rel_offset (r10, 20)
+ cfi_rel_offset (lr, 24)
+
+ INITC /* initialize carry flag */
+ tst r3, #1 /* count & 1 == 1? */
+ add lr, r1, r3, lsl #2 /* compute end src1 */
+ beq 1f
+
+ sfi_breg r1, \
+ ldr r4, [\B], #4 /* do one to make count even */
+ sfi_breg r2, \
+ ldr r5, [\B], #4
+ OPC r4, r4, r5
+ teq r1, lr /* end of count? (preserve carry) */
+ sfi_breg r0, \
+ str r4, [\B], #4
+ beq 9f
+1:
+ tst r3, #2 /* count & 2 == 2? */
+ beq 2f
+ sfi_breg r1, \
+ ldm \B!, { r4, r5 } /* do two to make count 0 mod 4 */
+ sfi_breg r2, \
+ ldm \B!, { r6, r7 }
+ OPC r4, r4, r6
+ OPC r5, r5, r7
+ teq r1, lr /* end of count? */
+ sfi_breg r0, \
+ stm \B!, { r4, r5 }
+ beq 9f
+2:
+ sfi_breg r1, \
+ ldm \B!, { r3, r5, r7, r10 } /* do four each loop */
+ sfi_breg r2, \
+ ldm \B!, { r4, r6, r8, ip }
+ OPC r3, r3, r4
+ OPC r5, r5, r6
+ OPC r7, r7, r8
+ OPC r10, r10, ip
+ teq r1, lr
+ sfi_breg r0, \
+ stm \B!, { r3, r5, r7, r10 }
+ bne 2b
+
+9:
+ RETC /* copy carry out */
+#ifndef ARM_ALWAYS_BX
+ pop { r4, r5, r6, r7, r8, r10, pc }
+#else
+ pop { r4, r5, r6, r7, r8, r10, lr }
+ bx lr
+#endif
+END (FUNC)
diff --git a/ports/sysdeps/arm/addmul_1.S b/ports/sysdeps/arm/addmul_1.S
new file mode 100644
index 0000000000..d204c887e3
--- /dev/null
+++ b/ports/sysdeps/arm/addmul_1.S
@@ -0,0 +1,73 @@
+/* mpn_addmul_1 -- multiply and accumulate bignums.
+ 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>
+
+ .syntax unified
+ .text
+
+@ cycles/limb
+@ StrongArm ?
+@ Cortex-A8 ?
+@ Cortex-A9 ?
+@ Cortex-A15 4
+
+/* mp_limb_t mpn_addmul_1(res_ptr, src1_ptr, size, s2_limb) */
+
+ENTRY (__mpn_addmul_1)
+ push { 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)
+
+ sfi_breg r1, \
+ ldr r6, [\B], #4
+ sfi_breg r0, \
+ ldr r5, [\B]
+ mov r4, #0 /* init carry in */
+ b 1f
+0:
+ sfi_breg r1, \
+ ldr r6, [\B], #4 /* load next ul */
+ adds r7, r4, r5 /* (out, c) = cl + lpl */
+ sfi_breg r0, \
+ ldr r5, [\B, #4] /* load next rl */
+ adc r4, ip, #0 /* cl = hpl + c */
+ sfi_breg r0, \
+ str r7, [\B], #4
+1:
+ mov ip, #0 /* zero-extend rl */
+ umlal r5, ip, r6, r3 /* (hpl, lpl) = ul * vl + rl */
+ subs r2, r2, #1
+ bne 0b
+
+ adds r4, r4, r5 /* (out, c) = cl + llpl */
+ sfi_breg r0, \
+ str r4, [\B]
+ adc r0, ip, #0 /* return hpl + c */
+
+ pop { r4, r5, r6, r7 }
+ cfi_adjust_cfa_offset (-16)
+ cfi_restore (r4)
+ cfi_restore (r5)
+ cfi_restore (r6)
+ cfi_restore (r7)
+ DO_RET (lr)
+END (__mpn_addmul_1)
diff --git a/ports/sysdeps/arm/arm-features.h b/ports/sysdeps/arm/arm-features.h
index 31801cf408..336b6905af 100644
--- a/ports/sysdeps/arm/arm-features.h
+++ b/ports/sysdeps/arm/arm-features.h
@@ -36,4 +36,24 @@
at runtime (or that we never care about its state) and so need not
be checked for. */
+/* A more-specific arm-features.h file may define ARM_ALWAYS_BX to indicate
+ that instructions using pc as a destination register must never be used,
+ so a "bx" (or "blx") instruction is always required. */
+
+/* The log2 of the minimum alignment required for an address that
+ is the target of a computed branch (i.e. a "bx" instruction).
+ A more-specific arm-features.h file may define this to set a more
+ stringent requirement.
+
+ Using this only makes sense for code in ARM mode (where instructions
+ always have a fixed size of four bytes), or for Thumb-mode code that is
+ specifically aligning all the related branch targets to match (since
+ Thumb instructions might be either two or four bytes). */
+#ifndef ARM_BX_ALIGN_LOG2
+# define ARM_BX_ALIGN_LOG2 2
+#endif
+
+/* An OS-specific arm-features.h file may define ARM_NO_INDEX_REGISTER to
+ indicate that the two-register addressing modes must never be used. */
+
#endif /* arm-features.h */
diff --git a/ports/sysdeps/arm/arm-mcount.S b/ports/sysdeps/arm/arm-mcount.S
index 6c24271396..f61e978f5e 100644
--- a/ports/sysdeps/arm/arm-mcount.S
+++ b/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
@@ -69,7 +69,7 @@ END(__gnu_mcount_nc)
code be compiled with APCS frame pointers. */
ENTRY(_mcount)
- stmdb sp!, {r0, r1, r2, r3, fp, lr}
+ push {r0, r1, r2, r3, fp, lr}
cfi_adjust_cfa_offset (24)
cfi_rel_offset (r0, 0)
cfi_rel_offset (r1, 4)
@@ -77,20 +77,14 @@ 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
+ sfi_breg r0, \
+ ldrne r0, [\B, #-4]
+ movsne r1, lr
blne __mcount_internal
-#ifdef __thumb2__
- ldmia sp!, {r0, r1, r2, r3, fp, pc}
-#else
- ldmia sp!, {r0, r1, r2, r3, fp, lr}
+#if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
+ pop {r0, r1, r2, r3, fp, lr}
cfi_adjust_cfa_offset (-24)
cfi_restore (r0)
cfi_restore (r1)
@@ -99,6 +93,8 @@ ENTRY(_mcount)
cfi_restore (fp)
cfi_restore (lr)
bx lr
+#else
+ pop {r0, r1, r2, r3, fp, pc}
#endif
END(_mcount)
diff --git a/ports/sysdeps/arm/armv6/rawmemchr.S b/ports/sysdeps/arm/armv6/rawmemchr.S
new file mode 100644
index 0000000000..b5e4a16f03
--- /dev/null
+++ b/ports/sysdeps/arm/armv6/rawmemchr.S
@@ -0,0 +1,109 @@
+/* rawmemchr -- find a byte within an unsized memory block.
+ 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>
+
+ .syntax unified
+ .text
+
+ENTRY (__rawmemchr)
+ @ r0 = start of string
+ @ r1 = character to match
+ @ returns a pointer to the match, which must be present.
+ sfi_breg r0, \
+ ldrb r2, [\B] @ load first byte asap
+
+ @ To cater to long strings, we want to search through a few
+ @ characters until we reach an aligned pointer. To cater to
+ @ small strings, we don't want to start doing word operations
+ @ immediately. The compromise is a maximum of 16 bytes less
+ @ whatever is required to end with an aligned pointer.
+ @ r3 = number of characters to search in alignment loop
+ and r3, r0, #7
+ uxtb r1, r1
+ rsb r3, r3, #15 @ 16 - 1 peeled loop iteration
+ cmp r2, r1
+ it eq
+ bxeq lr
+
+ @ Loop until we find ...
+1: sfi_breg r0, \
+ ldrb r2, [\B, #1]!
+ subs r3, r3, #1 @ ... the alignment point
+ it ne
+ cmpne r2, r1 @ ... or C
+ bne 1b
+
+ @ Disambiguate the exit possibilites above
+ cmp r2, r1 @ Found C
+ it eq
+ bxeq lr
+ add r0, r0, #1
+
+ @ So now we're aligned.
+ sfi_breg r0, \
+ ldrd r2, r3, [\B], #8
+ orr r1, r1, r1, lsl #8 @ Replicate C to all bytes
+#ifdef ARCH_HAS_T2
+ movw ip, #0x0101
+ sfi_pld r0, #64
+ movt ip, #0x0101
+#else
+ ldr ip, =0x01010101
+ sfi_pld r0, #64
+#endif
+ orr r1, r1, r1, lsl #16
+
+ @ Loop searching for C, 8 bytes at a time.
+ @ Subtracting (unsigned saturating) from 1 means result of 1 for
+ @ any byte that was originally zero and 0 otherwise. Therefore
+ @ we consider the lsb of each byte the "found" bit.
+2: eor r2, r2, r1 @ Convert C bytes to 0
+ eor r3, r3, r1
+ uqsub8 r2, ip, r2 @ Find C
+ uqsub8 r3, ip, r3
+ sfi_pld r0, #128
+ orrs r3, r3, r2 @ Test both words for found
+ it eq
+ sfi_breg r0, \
+ ldrdeq r2, r3, [\B], #8
+ beq 2b
+
+ @ Found something. Disambiguate between first and second words.
+ @ Adjust r0 to point to the word containing the match.
+ @ Adjust r2 to the found bits for the word containing the match.
+ cmp r2, #0
+ sub r0, r0, #4
+ ite eq
+ moveq r2, r3
+ subne r0, r0, #4
+
+ @ Find the bit-offset of the match within the word. Note that the
+ @ bit result from clz will be 7 higher than "true", but we'll
+ @ immediately discard those bits converting to a byte offset.
+#ifdef __ARMEL__
+ rev r2, r2 @ For LE, count from the little end
+#endif
+ clz r2, r2
+ add r0, r0, r2, lsr #3 @ Adjust the pointer to the found byte
+ bx lr
+
+END (__rawmemchr)
+
+weak_alias (__rawmemchr, rawmemchr)
+libc_hidden_def (__rawmemchr)
diff --git a/ports/sysdeps/arm/armv6/stpcpy.S b/ports/sysdeps/arm/armv6/stpcpy.S
new file mode 100644
index 0000000000..21a4f385be
--- /dev/null
+++ b/ports/sysdeps/arm/armv6/stpcpy.S
@@ -0,0 +1 @@
+/* Defined in strcpy.S. */
diff --git a/ports/sysdeps/arm/armv6/strchr.S b/ports/sysdeps/arm/armv6/strchr.S
new file mode 100644
index 0000000000..936c2be666
--- /dev/null
+++ b/ports/sysdeps/arm/armv6/strchr.S
@@ -0,0 +1,147 @@
+/* strchr -- find the first instance of C in a nul-terminated string.
+ 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>
+
+ .syntax unified
+ .text
+
+ENTRY (strchr)
+ @ r0 = start of string
+ @ r1 = character to match
+ @ returns NULL for no match, or a pointer to the match
+ sfi_breg r0, \
+ ldrb r2, [\B] @ load the first byte asap
+ uxtb r1, r1
+
+ @ To cater to long strings, we want to search through a few
+ @ characters until we reach an aligned pointer. To cater to
+ @ small strings, we don't want to start doing word operations
+ @ immediately. The compromise is a maximum of 16 bytes less
+ @ whatever is required to end with an aligned pointer.
+ @ r3 = number of characters to search in alignment loop
+ and r3, r0, #7
+ rsb r3, r3, #15 @ 16 - 1 peeled loop iteration
+ cmp r2, r1 @ Found C?
+ it ne
+ cmpne r2, #0 @ Found EOS?
+ beq 99f
+
+ @ Loop until we find ...
+1: sfi_breg r0, \
+ ldrb r2, [\B, #1]!
+ subs r3, r3, #1 @ ... the aligment point
+ it ne
+ cmpne r2, r1 @ ... or the character
+ it ne
+ cmpne r2, #0 @ ... or EOS
+ bne 1b
+
+ @ Disambiguate the exit possibilites above
+ cmp r2, r1 @ Found the character
+ it ne
+ cmpne r2, #0 @ Found EOS
+ beq 99f
+ add r0, r0, #1
+
+ @ So now we're aligned. Now we actually need a stack frame.
+ push { 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)
+
+ sfi_breg r0, \
+ ldrd r2, r3, [\B], #8
+ orr r1, r1, r1, lsl #8 @ Replicate C to all bytes
+#ifdef ARCH_HAS_T2
+ movw ip, #0x0101
+ sfi_pld r0, #64
+ movt ip, #0x0101
+#else
+ ldr ip, =0x01010101
+ sfi_pld r0, #64
+#endif
+ orr r1, r1, r1, lsl #16
+
+ @ Loop searching for EOS or C, 8 bytes at a time.
+2:
+ @ Subtracting (unsigned saturating) from 1 means result of 1 for
+ @ any byte that was originally zero and 0 otherwise. Therefore
+ @ we consider the lsb of each byte the "found" bit.
+ uqsub8 r4, ip, r2 @ Find EOS
+ eor r6, r2, r1 @ Convert C bytes to 0
+ uqsub8 r5, ip, r3
+ eor r7, r3, r1
+ uqsub8 r6, ip, r6 @ Find C
+ sfi_pld r0, #128 @ Prefetch 2 lines ahead
+ uqsub8 r7, ip, r7
+ orr r4, r4, r6 @ Combine found for EOS and C
+ orr r5, r5, r7
+ orrs r6, r4, r5 @ Combine the two words
+ it eq
+ sfi_breg r0, \
+ ldrdeq r2, r3, [\B], #8
+ beq 2b
+
+ @ Found something. Disambiguate between first and second words.
+ @ Adjust r0 to point to the word containing the match.
+ @ Adjust r2 to the contents of the word containing the match.
+ @ Adjust r4 to the found bits for the word containing the match.
+ cmp r4, #0
+ sub r0, r0, #4
+ itte eq
+ moveq r4, r5
+ moveq r2, r3
+ subne r0, r0, #4
+
+ @ Find the bit-offset of the match within the word.
+#if defined(__ARMEL__)
+ @ For LE, swap the found word so clz searches from the little end.
+ rev r4, r4
+#else
+ @ For BE, byte swap the word to make it easier to extract the byte.
+ rev r2, r2
+#endif
+ @ We're counting 0x01 (not 0x80), so the bit offset is 7 too high.
+ clz r3, r4
+ sub r3, r3, #7
+ lsr r2, r2, r3 @ Shift down found byte
+ uxtb r1, r1 @ Undo replication of C
+ uxtb r2, r2 @ Extract found byte
+ add r0, r0, r3, lsr #3 @ Adjust the pointer to the found byte
+
+ pop { r4, r5, r6, r7 }
+ cfi_adjust_cfa_offset (-16)
+ cfi_restore (r4)
+ cfi_restore (r5)
+ cfi_restore (r6)
+ cfi_restore (r7)
+
+ @ Disambiguate between EOS and C.
+99:
+ cmp r2, r1
+ it ne
+ movne r0, #0 @ Found EOS, return NULL
+ bx lr
+
+END (strchr)
+
+weak_alias (strchr, index)
+libc_hidden_builtin_def (strchr)
diff --git a/ports/sysdeps/arm/armv6/strcpy.S b/ports/sysdeps/arm/armv6/strcpy.S
new file mode 100644
index 0000000000..cd13ff7ecf
--- /dev/null
+++ b/ports/sysdeps/arm/armv6/strcpy.S
@@ -0,0 +1,231 @@
+/* strcpy -- copy a nul-terminated string.
+ 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>
+
+/* Endian independent macros for shifting bytes within registers. */
+#ifdef __ARMEB__
+#define lsh_gt lsr
+#define lsh_ls lsl
+#else
+#define lsh_gt lsl
+#define lsh_ls lsr
+#endif
+
+ .syntax unified
+ .text
+
+ENTRY (__stpcpy)
+ @ Signal stpcpy with NULL in IP.
+ mov ip, #0
+ b 0f
+END (__stpcpy)
+
+weak_alias (__stpcpy, stpcpy)
+libc_hidden_def (__stpcpy)
+libc_hidden_builtin_def (stpcpy)
+
+ENTRY (strcpy)
+ @ Signal strcpy with DEST in IP.
+ mov ip, r0
+0:
+ sfi_pld r0
+ sfi_pld r1
+
+ @ To cater to long strings, we want 8 byte alignment in the source.
+ @ To cater to small strings, we don't want to start that right away.
+ @ Loop up to 16 times, less whatever it takes to reach alignment.
+ and r3, r1, #7
+ rsb r3, r3, #16
+
+ @ Loop until we find ...
+1: sfi_breg r1, \
+ ldrb r2, [\B], #1
+ subs r3, r3, #1 @ ... the alignment point
+ sfi_breg r0, \
+ strb r2, [\B], #1
+ it ne
+ cmpne r2, #0 @ ... or EOS
+ bne 1b
+
+ @ Disambiguate the exit possibilites above
+ cmp r2, #0 @ Found EOS
+ beq .Lreturn
+
+ @ Load the next two words asap
+ sfi_breg r1, \
+ ldrd r2, r3, [\B], #8
+ sfi_pld r0, #64
+ sfi_pld r1, #64
+
+ @ For longer strings, we actaully need a stack frame.
+ push { 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)
+
+ @ Subtracting (unsigned saturating) from 1 for any byte means result
+ @ of 1 for any byte that was originally zero and 0 otherwise.
+ @ Therefore we consider the lsb of each byte the "found" bit.
+#ifdef ARCH_HAS_T2
+ movw r7, #0x0101
+ tst r0, #3 @ Test alignment of DEST
+ movt r7, #0x0101
+#else
+ ldr ip, =0x01010101
+ tst r0, #3
+#endif
+ bne .Lunaligned
+
+ @ So now source (r1) is aligned to 8, and dest (r0) is aligned to 4.
+ @ Loop, reading 8 bytes at a time, searching for EOS.
+ .balign 16
+2: uqsub8 r4, r7, r2 @ Find EOS
+ uqsub8 r5, r7, r3
+ sfi_pld r1, #128
+ cmp r4, #0 @ EOS in first word?
+ sfi_pld r0, #128
+ bne 3f
+ sfi_breg r0, \
+ str r2, [\B], #4
+ cmp r5, #0 @ EOS in second word?
+ bne 4f
+ sfi_breg r0, \
+ str r3, [\B], #4
+ sfi_breg r1, \
+ ldrd r2, r3, [\B], #8
+ b 2b
+
+3: sub r1, r1, #4 @ backup to first word
+4: sub r1, r1, #4 @ backup to second word
+
+ @ ... then finish up any tail a byte at a time.
+ @ Note that we generally back up and re-read source bytes,
+ @ but we'll not re-write dest bytes.
+.Lbyte_loop:
+ sfi_breg r1, \
+ ldrb r2, [\B], #1
+ cmp r2, #0
+ sfi_breg r0, \
+ strb r2, [\B], #1
+ bne .Lbyte_loop
+
+ pop { r4, r5, r6, r7 }
+ cfi_remember_state
+ cfi_adjust_cfa_offset (-16)
+ cfi_restore (r4)
+ cfi_restore (r5)
+ cfi_restore (r6)
+ cfi_restore (r7)
+
+.Lreturn:
+ cmp ip, #0 @ Was this strcpy or stpcpy?
+ ite eq
+ subeq r0, r0, #1 @ stpcpy: undo post-inc from store
+ movne r0, ip @ strcpy: return original dest
+ bx lr
+
+.Lunaligned:
+ cfi_restore_state
+ @ Here, source is aligned to 8, but the destination is not word
+ @ aligned. Therefore we have to shift the data in order to be
+ @ able to perform aligned word stores.
+
+ @ Find out which misalignment we're dealing with.
+ tst r0, #1
+ beq .Lunaligned2
+ tst r0, #2
+ bne .Lunaligned3
+ @ Fallthru to .Lunaligned1.
+
+.macro unaligned_copy unalign
+ @ Prologue to unaligned loop. Seed shifted non-zero bytes.
+ uqsub8 r4, r7, r2 @ Find EOS
+ uqsub8 r5, r7, r3
+ mvns r4, r4 @ EOS in first word?
+ it ne
+ subne r1, r1, #8
+ bne .Lbyte_loop
+#ifdef __ARMEB__
+ rev r2, r2 @ Byte stores below need LE data
+#endif
+ @ Store a few bytes from the first word.
+ @ At the same time we align r0 and shift out bytes from r2.
+.rept 4-\unalign
+ sfi_breg r0, \
+ strb r2, [\B], #1
+ lsr r2, r2, #8
+.endr
+#ifdef __ARMEB__
+ rev r2, r2 @ Undo previous rev
+#endif
+ @ Rotated unaligned copy loop. The tail of the prologue is
+ @ shared with the loop itself.
+ .balign 8
+1: mvns r5, r5 @ EOS in second word?
+ bne 4f
+ @ Combine first and second words
+ orr r2, r2, r3, lsh_gt #(\unalign*8)
+ @ Save leftover bytes from the two words
+ lsh_ls r6, r3, #((4-\unalign)*8)
+ sfi_breg r0, \
+ str r2, [\B], #4
+ @ The "real" start of the unaligned copy loop.
+ sfi_breg r1, \
+ ldrd r2, r3, [\B], #8 @ Load 8 more bytes
+ uqsub8 r4, r7, r2 @ Find EOS
+ sfi_pld r1, #128
+ uqsub8 r5, r7, r3
+ sfi_pld r0, #128
+ mvns r4, r4 @ EOS in first word?
+ bne 3f
+ @ Combine the leftover and the first word
+ orr r6, r6, r2, lsh_gt #(\unalign*8)
+ @ Discard used bytes from the first word.
+ lsh_ls r2, r2, #((4-\unalign)*8)
+ sfi_breg r0, \
+ str r6, [\B], #4
+ b 1b
+ @ Found EOS in one of the words; adjust backward
+3: sub r1, r1, #4
+ mov r2, r6
+4: sub r1, r1, #4
+ @ And store the remaining bytes from the leftover
+#ifdef __ARMEB__
+ rev r2, r2
+#endif
+.rept \unalign
+ sfi_breg r0, \
+ strb r2, [\B], #1
+ lsr r2, r2, #8
+.endr
+ b .Lbyte_loop
+.endm
+
+.Lunaligned1:
+ unaligned_copy 1
+.Lunaligned2:
+ unaligned_copy 2
+.Lunaligned3:
+ unaligned_copy 3
+
+END (strcpy)
+
+libc_hidden_builtin_def (strcpy)
diff --git a/ports/sysdeps/arm/armv6/strlen.S b/ports/sysdeps/arm/armv6/strlen.S
new file mode 100644
index 0000000000..59ff6b5d93
--- /dev/null
+++ b/ports/sysdeps/arm/armv6/strlen.S
@@ -0,0 +1,103 @@
+/* strlen -- find the length of a nul-terminated string.
+ 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>
+
+ .syntax unified
+ .text
+
+ENTRY (strlen)
+ @ r0 = start of string
+ sfi_breg r0, \
+ ldrb r2, [\B] @ load the first byte asap
+
+ @ To cater to long strings, we want to search through a few
+ @ characters until we reach an aligned pointer. To cater to
+ @ small strings, we don't want to start doing word operations
+ @ immediately. The compromise is a maximum of 16 bytes less
+ @ whatever is required to end with an aligned pointer.
+ @ r3 = number of characters to search in alignment loop
+ and r3, r0, #7
+ mov r1, r0 @ Save the input pointer
+ rsb r3, r3, #15 @ 16 - 1 peeled loop iteration
+ cmp r2, #0
+ beq 99f
+
+ @ Loop until we find ...
+1: sfi_breg r0, \
+ ldrb r2, [\B, #1]!
+ subs r3, r3, #1 @ ... the aligment point
+ it ne
+ cmpne r2, #0 @ ... or EOS
+ bne 1b
+
+ @ Disambiguate the exit possibilites above
+ cmp r2, #0 @ Found EOS
+ beq 99f
+ add r0, r0, #1
+
+ @ So now we're aligned.
+ sfi_breg r0, \
+ ldrd r2, r3, [\B], #8
+#ifdef ARCH_HAS_T2
+ movw ip, #0x0101
+ sfi_pld r0, #64
+ movt ip, #0x0101
+#else
+ ldr ip, =0x01010101
+ sfi_pld r0, #64
+#endif
+
+ @ Loop searching for EOS, 8 bytes at a time.
+ @ Subtracting (unsigned saturating) from 1 for any byte means that
+ @ we get 1 for any byte that was originally zero and 0 otherwise.
+ @ Therefore we consider the lsb of each byte the "found" bit.
+ .balign 16
+2: uqsub8 r2, ip, r2 @ Find EOS
+ uqsub8 r3, ip, r3
+ sfi_pld r0, #128 @ Prefetch 2 lines ahead
+ orrs r3, r3, r2 @ Combine the two words
+ it eq
+ sfi_breg r0, \
+ ldrdeq r2, r3, [\B], #8
+ beq 2b
+
+ @ Found something. Disambiguate between first and second words.
+ @ Adjust r0 to point to the word containing the match.
+ @ Adjust r2 to the found bits for the word containing the match.
+ cmp r2, #0
+ sub r0, r0, #4
+ ite eq
+ moveq r2, r3
+ subne r0, r0, #4
+
+ @ Find the bit-offset of the match within the word. Note that the
+ @ bit result from clz will be 7 higher than "true", but we'll
+ @ immediately discard those bits converting to a byte offset.
+#ifdef __ARMEL__
+ rev r2, r2 @ For LE, count from the little end
+#endif
+ clz r2, r2
+ add r0, r0, r2, lsr #3 @ Adjust the pointer to the found byte
+99:
+ sub r0, r0, r1 @ Subtract input to compute length
+ bx lr
+
+END (strlen)
+
+libc_hidden_builtin_def (strlen)
diff --git a/ports/sysdeps/arm/armv6/strrchr.S b/ports/sysdeps/arm/armv6/strrchr.S
new file mode 100644
index 0000000000..e40df90a72
--- /dev/null
+++ b/ports/sysdeps/arm/armv6/strrchr.S
@@ -0,0 +1,131 @@
+/* strrchr -- find the last occurence of C in a nul-terminated string
+ 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>
+
+ .syntax unified
+ .text
+
+ENTRY (strrchr)
+ @ r0 = start of string
+ @ r1 = character to match
+ @ returns NULL for no match, or a pointer to the match
+
+ mov r3, r0
+ mov r0, #0
+ uxtb r1, r1
+
+ @ Loop a few times until we're aligned.
+ tst r3, #7
+ beq 2f
+1: sfi_breg r3, \
+ ldrb r2, [\B], #1
+ cmp r2, r1 @ Find the character
+ it eq
+ subeq r0, r3, #1
+ cmp r2, #0 @ Find EOS
+ it eq
+ bxeq lr
+ tst r3, #7 @ Find the aligment point
+ bne 1b
+
+ @ So now we're aligned. Now we actually need a stack frame.
+2: push { 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)
+
+ orr r1, r1, r1, lsl #8 @ Replicate C to all bytes
+#ifdef ARCH_HAS_T2
+ movw ip, #0x0101
+ movt ip, #0x0101
+#else
+ ldr ip, =0x01010101
+#endif
+ orr r1, r1, r1, lsl #16
+ mov r2, #0 @ No found bits yet
+
+ @ Loop searching for EOS and C, 8 bytes at a time.
+ @ Any time we find a match in a word, we copy the address of
+ @ the word to r0, and the found bits to r2.
+3: sfi_breg r3, \
+ ldrd r4, r5, [\B], #8
+ @ Subtracting (unsigned saturating) from 1 means result of 1 for
+ @ any byte that was originally zero and 0 otherwise. Therefore
+ @ we consider the lsb of each byte the "found" bit.
+ uqsub8 r6, ip, r4 @ Find EOS
+ uqsub8 r7, ip, r5
+ eor r4, r4, r1 @ Convert C bytes to 0
+ eor r5, r5, r1
+ uqsub8 r4, ip, r4 @ Find C
+ uqsub8 r5, ip, r5
+ cmp r6, #0 @ Found EOS, first word
+ bne 4f
+ cmp r4, #0 @ Handle C, first word
+ itt ne
+ subne r0, r3, #8
+ movne r2, r4
+ cmp r7, #0 @ Found EOS, second word
+ bne 5f
+ cmp r5, #0 @ Handle C, second word
+ itt ne
+ subne r0, r3, #4
+ movne r2, r5
+ b 3b
+
+ @ Found EOS in second word; fold to first word.
+5: add r3, r3, #4 @ Dec pointer to 2nd word, with below
+ mov r4, r5 @ Overwrite first word C found
+ mov r6, r7 @ Overwrite first word EOS found
+
+ @ Found EOS. Zap found C after EOS.
+4: sub r3, r3, #8 @ Decrement pointer to first word
+#ifdef __ARMEB__
+ @ Byte swap to be congruent with LE, which is easier from here on.
+ rev r6, r6 @ Byte swap found EOS,
+ rev r4, r4 @ ... this found C
+ rev r2, r2 @ ... prev found C
+#endif
+ sub r7, r6, #1 @ Toggle EOS lsb and below
+ eor r6, r6, r7 @ All bits below and including lsb
+ ands r4, r4, r6 @ Zap C above EOS
+ itt ne
+ movne r2, r4 @ Copy to result, if still non-zero
+ movne r0, r3
+
+ pop { r4, r5, r6, r7 }
+ cfi_adjust_cfa_offset (-16)
+ cfi_restore (r4)
+ cfi_restore (r5)
+ cfi_restore (r6)
+ cfi_restore (r7)
+
+ @ Adjust the result pointer if we found a word containing C.
+ cmp r2, #0
+ clz r2, r2 @ Find the bit offset of the last C
+ itt ne
+ rsbne r2, r2, #32 @ Convert to a count from the right
+ addne r0, r0, r2, lsr #3 @ Convert to byte offset and add.
+ bx lr
+
+END (strrchr)
+
+weak_alias (strrchr, rindex)
+libc_hidden_builtin_def (strrchr)
diff --git a/ports/sysdeps/arm/armv6t2/Implies b/ports/sysdeps/arm/armv6t2/Implies
new file mode 100644
index 0000000000..20a87fc8a5
--- /dev/null
+++ b/ports/sysdeps/arm/armv6t2/Implies
@@ -0,0 +1,2 @@
+# We can do everything that 6 can
+arm/armv6
diff --git a/ports/sysdeps/arm/jmpbuf-offsets.h b/ports/sysdeps/arm/armv6t2/ffs.S
index beeccbb40f..b2c88b9460 100644
--- a/ports/sysdeps/arm/jmpbuf-offsets.h
+++ b/ports/sysdeps/arm/armv6t2/ffs.S
@@ -1,5 +1,5 @@
-/* Private macros for accessing __jmp_buf contents. ARM EABI version.
- Copyright (C) 2007-2013 Free Software Foundation, Inc.
+/* ffs -- find first set bit in an int, from least significant end.
+ Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,4 +16,20 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#define __JMP_BUF_SP 8
+#include <sysdep.h>
+
+ .syntax unified
+ .text
+
+ENTRY (__ffs)
+ cmp r0, #0
+ rbit r0, r0
+ itt ne
+ clzne r0, r0
+ addne r0, r0, #1
+ bx lr
+END (__ffs)
+
+weak_alias (__ffs, ffs)
+weak_alias (__ffs, ffsl)
+libc_hidden_builtin_def (ffs)
diff --git a/ports/sysdeps/arm/armv6t2/ffsll.S b/ports/sysdeps/arm/armv6t2/ffsll.S
new file mode 100644
index 0000000000..e49c70fdf1
--- /dev/null
+++ b/ports/sysdeps/arm/armv6t2/ffsll.S
@@ -0,0 +1,50 @@
+/* ffsll -- find first set bit in a long long, from least significant end.
+ 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>
+
+ .syntax unified
+ .text
+
+ENTRY (ffsll)
+ @ If low part is 0, operate on the high part. Ensure that the
+ @ word on which we operate is in r0. Set r2 to the bit offset
+ @ of the word being considered. Set the flags for the word
+ @ being operated on.
+#ifdef __ARMEL__
+ cmp r0, #0
+ itee ne
+ movne r2, #0
+ moveq r2, #32
+ movseq r0, r1
+#else
+ cmp r1, #0
+ ittee ne
+ movne r2, #0
+ movne r0, r1
+ moveq r2, #32
+ cmpeq r0, #0
+#endif
+ @ Perform the ffs on r0.
+ rbit r0, r0
+ ittt ne
+ clzne r0, r0
+ addne r2, r2, #1
+ addne r0, r0, r2
+ bx lr
+END (ffsll)
diff --git a/ports/sysdeps/arm/armv6t2/memchr.S b/ports/sysdeps/arm/armv6t2/memchr.S
index 6d35f478b7..f758971438 100644
--- a/ports/sysdeps/arm/armv6t2/memchr.S
+++ b/ports/sysdeps/arm/armv6t2/memchr.S
@@ -42,10 +42,12 @@
.syntax unified
.text
+#ifdef NO_THUMB
+ .arm
+#else
.thumb
-
-@ ---------------------------------------------------------------------------
.thumb_func
+#endif
.global memchr
.type memchr,%function
ENTRY(memchr)
@@ -63,7 +65,8 @@ ENTRY(memchr)
@ Work up to an aligned point
5:
- ldrb r3, [r0],#1
+ sfi_breg r0, \
+ ldrb r3, [\B],#1
subs r2, r2, #1
cmp r3, r1
beq 50f @ If it matches exit found
@@ -83,20 +86,29 @@ ENTRY(memchr)
orr r1, r1, r1, lsl #8 @ expand the match word across to all bytes
orr r1, r1, r1, lsl #16
- bic r4, r2, #7 @ Number of double words to work with * 8
+ bic r6, r2, #7 @ Number of double words to work with * 8
mvns r7, #0 @ all F's
movs r3, #0
15:
- ldrd r5,r6, [r0],#8
- subs r4, r4, #8
- eor r5,r5, r1 @ Get it so that r5,r6 have 00's where the bytes match the target
- eor r6,r6, r1
+ sfi_breg r0, \
+ ldrd r4,r5, [\B],#8
+#ifndef NO_THUMB
+ subs r6, r6, #8
+#endif
+ eor r4,r4, r1 @ Get it so that r4,r5 have 00's where the bytes match the target
+ eor r5,r5, r1
+ uadd8 r4, r4, r7 @ Parallel add 0xff - sets the GE bits for anything that wasn't 0
+ sel r4, r3, r7 @ bytes are 00 for none-00 bytes, or ff for 00 bytes - NOTE INVERSION
uadd8 r5, r5, r7 @ Parallel add 0xff - sets the GE bits for anything that wasn't 0
- sel r5, r3, r7 @ bytes are 00 for none-00 bytes, or ff for 00 bytes - NOTE INVERSION
- uadd8 r6, r6, r7 @ Parallel add 0xff - sets the GE bits for anything that wasn't 0
- sel r6, r5, r7 @ chained....bytes are 00 for none-00 bytes, or ff for 00 bytes - NOTE INVERSION
- cbnz r6, 60f
+ sel r5, r4, r7 @ chained....bytes are 00 for none-00 bytes, or ff for 00 bytes - NOTE INVERSION
+#ifndef NO_THUMB
+ cbnz r5, 60f
+#else
+ cmp r5, #0
+ bne 60f
+ subs r6, r6, #8
+#endif
bne 15b @ (Flags from the subs above) If not run out of bytes then go around again
pop {r4,r5,r6,r7}
@@ -110,13 +122,25 @@ ENTRY(memchr)
and r2,r2,#7 @ Leave the count remaining as the number after the double words have been done
20:
+#ifndef NO_THUMB
cbz r2, 40f @ 0 length or hit the end already then not found
+#else
+ cmp r2, #0
+ beq 40f
+#endif
21: @ Post aligned section, or just a short call
- ldrb r3,[r0],#1
+ sfi_breg r0, \
+ ldrb r3,[\B],#1
+#ifndef NO_THUMB
subs r2,r2,#1
eor r3,r3,r1 @ r3 = 0 if match - doesn't break flags from sub
cbz r3, 50f
+#else
+ eors r3, r3, r1
+ beq 50f
+ subs r2, r2, #1
+#endif
bne 21b @ on r2 flags
40:
@@ -129,22 +153,22 @@ ENTRY(memchr)
60: @ We're here because the fast path found a hit - now we have to track down exactly which word it was
@ r0 points to the start of the double word after the one that was tested
- @ r5 has the 00/ff pattern for the first word, r6 has the chained value
+ @ r4 has the 00/ff pattern for the first word, r5 has the chained value
cfi_restore_state
- cmp r5, #0
+ cmp r4, #0
itte eq
- moveq r5, r6 @ the end is in the 2nd word
+ moveq r4, r5 @ the end is in the 2nd word
subeq r0,r0,#3 @ Points to 2nd byte of 2nd word
subne r0,r0,#7 @ or 2nd byte of 1st word
@ r0 currently points to the 2nd byte of the word containing the hit
- tst r5, # CHARTSTMASK(0) @ 1st character
+ tst r4, # CHARTSTMASK(0) @ 1st character
bne 61f
adds r0,r0,#1
- tst r5, # CHARTSTMASK(1) @ 2nd character
+ tst r4, # CHARTSTMASK(1) @ 2nd character
ittt eq
addeq r0,r0,#1
- tsteq r5, # (3<<15) @ 2nd & 3rd character
+ tsteq r4, # (3<<15) @ 2nd & 3rd character
@ If not the 3rd must be the last one
addeq r0,r0,#1
diff --git a/ports/sysdeps/arm/bits/setjmp.h b/ports/sysdeps/arm/bits/setjmp.h
index 1f7ddd3653..21bbf7f57d 100644
--- a/ports/sysdeps/arm/bits/setjmp.h
+++ b/ports/sysdeps/arm/bits/setjmp.h
@@ -24,7 +24,7 @@
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
-#ifndef _ASM
+#ifndef __ASSEMBLER__
/* The exact set of registers saved may depend on the particular core
in use, as some coprocessor registers may need to be saved. The C
Library ABI requires that the buffer be 8-byte aligned, and
diff --git a/ports/sysdeps/arm/configure b/ports/sysdeps/arm/configure
index 91239cdf3e..b84b3f69a9 100644
--- a/ports/sysdeps/arm/configure
+++ b/ports/sysdeps/arm/configure
@@ -197,7 +197,9 @@ $as_echo "$libc_cv_arm_pcs_vfp" >&6; }
if test $libc_cv_arm_pcs_vfp = yes; then
$as_echo "#define HAVE_ARM_PCS_VFP 1" >>confdefs.h
- echo "default-abi := hard" > default-abi.make
+ config_vars="$config_vars
+default-abi = hard"
else
- echo "default-abi := soft" > default-abi.make
+ config_vars="$config_vars
+default-abi = soft"
fi
diff --git a/ports/sysdeps/arm/configure.in b/ports/sysdeps/arm/configure.in
index 6073d0ee86..d66500b3fd 100644
--- a/ports/sysdeps/arm/configure.in
+++ b/ports/sysdeps/arm/configure.in
@@ -40,7 +40,7 @@ AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
if test $libc_cv_arm_pcs_vfp = yes; then
AC_DEFINE(HAVE_ARM_PCS_VFP)
- echo "default-abi := hard" > default-abi.make
+ LIBC_CONFIG_VAR([default-abi], [hard])
else
- echo "default-abi := soft" > default-abi.make
+ LIBC_CONFIG_VAR([default-abi], [soft])
fi
diff --git a/ports/sysdeps/arm/crti.S b/ports/sysdeps/arm/crti.S
index 44e20f0c11..be20a11995 100644
--- a/ports/sysdeps/arm/crti.S
+++ b/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>
@@ -78,7 +80,7 @@ call_weak_fn:
.globl _init
.type _init, %function
_init:
- stmfd sp!, {r3, lr}
+ push {r3, lr}
#if PREINIT_FUNCTION_WEAK
bl call_weak_fn
#else
@@ -90,4 +92,4 @@ _init:
.globl _fini
.type _fini, %function
_fini:
- stmfd sp!, {r3, lr}
+ push {r3, lr}
diff --git a/ports/sysdeps/arm/crtn.S b/ports/sysdeps/arm/crtn.S
index 5ff3661f18..ae7546c5e7 100644
--- a/ports/sysdeps/arm/crtn.S
+++ b/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
@@ -40,16 +42,16 @@
.section .init,"ax",%progbits
#ifdef __ARM_ARCH_4T__
- ldmfd sp!, {r3, lr}
+ pop {r3, lr}
bx lr
#else
- ldmfd sp!, {r3, pc}
+ pop {r3, pc}
#endif
.section .fini,"ax",%progbits
#ifdef __ARM_ARCH_4T__
- ldmfd sp!, {r3, lr}
+ pop {r3, lr}
bx lr
#else
- ldmfd sp!, {r3, pc}
+ pop {r3, pc}
#endif
diff --git a/ports/sysdeps/arm/dl-machine.h b/ports/sysdeps/arm/dl-machine.h
index 30ad46c255..5a424f841f 100644
--- a/ports/sysdeps/arm/dl-machine.h
+++ b/ports/sysdeps/arm/dl-machine.h
@@ -136,7 +136,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
return lazy;
}
-#if defined(__USE_BX__)
+#if defined(ARCH_HAS_BX)
#define BX(x) "bx\t" #x
#else
#define BX(x) "mov\tpc, " #x
diff --git a/ports/sysdeps/arm/dl-tlsdesc.S b/ports/sysdeps/arm/dl-tlsdesc.S
index 0ae3abb38d..7203c06ae6 100644
--- a/ports/sysdeps/arm/dl-tlsdesc.S
+++ b/ports/sysdeps/arm/dl-tlsdesc.S
@@ -17,19 +17,14 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <arm-features.h>
#include <tls.h>
#include "tlsdesc.h"
-#ifdef __USE_BX__
- #define BX(x) bx x
-#else
- #define BX(x) mov pc, x
-#endif
-
.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
@@ -37,7 +32,8 @@
.fnstart
.align 2
_dl_tlsdesc_return:
- ldr r0, [r0]
+ sfi_breg r0, \
+ ldr r0, [\B]
BX (lr)
.fnend
cfi_endproc
@@ -50,18 +46,9 @@ _dl_tlsdesc_return:
.fnstart
.align 2
_dl_tlsdesc_undefweak:
- @ Are we allowed a misaligned stack pointer calling read_tp?
- .save {lr}
- stmdb sp!, {lr}
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (lr,0)
- bl __aeabi_read_tp
+ GET_TLS (r1)
rsb r0, r0, #0
- ldmia sp!, {lr}
- cfi_adjust_cfa_offset (-4)
- cfi_restore (lr)
BX (lr)
-
cfi_endproc
.fnend
.size _dl_tlsdesc_undefweak, .-_dl_tlsdesc_undefweak
@@ -99,23 +86,35 @@ _dl_tlsdesc_dynamic:
/* Our calling convention is to clobber r0, r1 and the processor
flags. All others that are modified must be saved */
.save {r2,r3,r4,lr}
- stmdb sp!, {r2,r3,r4,lr}
+ push {r2,r3,r4,lr}
cfi_adjust_cfa_offset (16)
cfi_rel_offset (r2,0)
cfi_rel_offset (r3,4)
cfi_rel_offset (r4,8)
cfi_rel_offset (lr,12)
- ldr r1, [r0] /* td */
- bl __aeabi_read_tp
+ sfi_breg r0, \
+ ldr r1, [\B] /* td */
+ GET_TLS (lr)
mov r4, r0 /* r4 = tp */
- ldr r0, [r0]
- ldr r2, [r1, #8] /* gen_count */
- ldr r3, [r0]
+ sfi_breg r0, \
+ ldr r0, [\B]
+ sfi_breg r1, \
+ ldr r2, [\B, #8] /* gen_count */
+ sfi_breg r0, \
+ ldr r3, [\B]
cmp r2, r3
bhi 1f
- ldr r3, [r1]
+ sfi_breg r1, \
+ ldr r3, [\B]
+#ifndef ARM_NO_INDEX_REGISTER
ldr r2, [r0, r3, lsl #3]
+#else
+ add lr, r0, r3, lsl #3
+ sfi_breg lr, \
+ ldr r2, [\B]
+#endif
cmn r2, #1
+ ittt ne
ldrne r3, [r1, #4]
addne r3, r2, r3
rsbne r0, r4, r3
@@ -123,13 +122,19 @@ _dl_tlsdesc_dynamic:
1: mov r0, r1
bl __tls_get_addr
rsb r0, r4, r0
-2: ldmia sp!, {r2,r3,r4, lr}
+2:
+#if ((defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)) \
+ || defined (ARM_ALWAYS_BX))
+ pop {r2,r3,r4, lr}
cfi_adjust_cfa_offset (-16)
cfi_restore (lr)
cfi_restore (r4)
cfi_restore (r3)
cfi_restore (r2)
- BX (lr)
+ bx lr
+#else
+ pop {r2,r3,r4, pc}
+#endif
.fnend
cfi_endproc
.size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic
@@ -154,7 +159,7 @@ _dl_tlsdesc_lazy_resolver:
cfi_adjust_cfa_offset (4)
cfi_rel_offset (r2, 0)
.save {r0,r1,r3,ip,lr}
- stmdb sp!, {r0, r1, r3, ip, lr}
+ push {r0, r1, r3, ip, lr}
cfi_adjust_cfa_offset (20)
cfi_rel_offset (r0, 0)
cfi_rel_offset (r1, 4)
@@ -162,17 +167,18 @@ _dl_tlsdesc_lazy_resolver:
cfi_rel_offset (ip, 12)
cfi_rel_offset (lr, 16)
bl _dl_tlsdesc_lazy_resolver_fixup
- ldmia sp!, {r0, r1, r3, ip, lr}
+ pop {r0, r1, r3, ip, lr}
cfi_adjust_cfa_offset (-20)
cfi_restore (lr)
cfi_restore (ip)
cfi_restore (r3)
cfi_restore (r1)
cfi_restore (r0)
- ldmia sp!, {r2}
+ pop {r2}
cfi_adjust_cfa_offset (-4)
cfi_restore (r2)
- ldr r1, [r0, #4]
+ sfi_breg r0, \
+ ldr r1, [\B, #4]
BX (r1)
.fnend
cfi_endproc
@@ -192,7 +198,7 @@ _dl_tlsdesc_resolve_hold:
cfi_adjust_cfa_offset (4)
cfi_rel_offset (r2, 0)
.save {r0,r1,r3,ip,lr}
- stmdb sp!, {r0, r1, r3, ip, lr}
+ push {r0, r1, r3, ip, lr}
cfi_adjust_cfa_offset (20)
cfi_rel_offset (r0, 0)
cfi_rel_offset (r1, 4)
@@ -201,17 +207,18 @@ _dl_tlsdesc_resolve_hold:
cfi_rel_offset (lr, 16)
adr r2, _dl_tlsdesc_resolve_hold
bl _dl_tlsdesc_resolve_hold_fixup
- ldmia sp!, {r0, r1, r3, ip, lr}
+ pop {r0, r1, r3, ip, lr}
cfi_adjust_cfa_offset (-20)
cfi_restore (lr)
cfi_restore (ip)
cfi_restore (r3)
cfi_restore (r1)
cfi_restore (r0)
- ldmia sp!, {r2}
+ pop {r2}
cfi_adjust_cfa_offset (-4)
cfi_restore (r2)
- ldr r1, [r0, #4]
+ sfi_breg r0, \
+ ldr r1, [\B, #4]
BX (r1)
.fnend
cfi_endproc
diff --git a/ports/sysdeps/arm/dl-trampoline.S b/ports/sysdeps/arm/dl-trampoline.S
index ebf221c85c..9366976762 100644
--- a/ports/sysdeps/arm/dl-trampoline.S
+++ b/ports/sysdeps/arm/dl-trampoline.S
@@ -16,19 +16,15 @@
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>
-#if defined(__USE_BX__)
-#define BX(x) bx x
-#else
-#define BX(x) mov pc, x
-#endif
-
.text
.globl _dl_runtime_resolve
.type _dl_runtime_resolve, #function
- .cfi_sections .debug_frame
+ CFI_SECTIONS
cfi_startproc
.align 2
_dl_runtime_resolve:
@@ -41,7 +37,7 @@ _dl_runtime_resolve:
@ lr points to &GOT[2]
@ Save arguments. We save r4 to realign the stack.
- stmdb sp!,{r0-r4}
+ push {r0-r4}
cfi_adjust_cfa_offset (20)
cfi_rel_offset (r0, 0)
cfi_rel_offset (r1, 4)
@@ -65,7 +61,7 @@ _dl_runtime_resolve:
@ get arguments and return address back. We restore r4
@ only to realign the stack.
- ldmia sp!, {r0-r4,lr}
+ pop {r0-r4,lr}
cfi_adjust_cfa_offset (-24)
@ jump to the newly found address
@@ -77,7 +73,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:
@@ -190,8 +186,7 @@ _dl_runtime_profile:
add ip, r7, #72
ldmia ip, {r0-r3}
ldr ip, [r7, #264]
- mov lr, pc
- BX(ip)
+ BLX(ip)
stmia r7, {r0-r3}
@ Call pltexit.
diff --git a/ports/sysdeps/arm/frame.h b/ports/sysdeps/arm/frame.h
index c5a8ed17ec..db3529939b 100644
--- a/ports/sysdeps/arm/frame.h
+++ b/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/ports/sysdeps/arm/include/bits/setjmp.h b/ports/sysdeps/arm/include/bits/setjmp.h
new file mode 100644
index 0000000000..23d8f75cf2
--- /dev/null
+++ b/ports/sysdeps/arm/include/bits/setjmp.h
@@ -0,0 +1,34 @@
+/* Private jmp_buf-related definitions. ARM EABI version.
+ 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 _INCLUDE_BITS_SETJMP_H
+#define _INCLUDE_BITS_SETJMP_H 1
+
+#ifndef __ASSEMBLER__
+/* Get the public declarations. */
+# include <sysdeps/arm/bits/setjmp.h>
+#endif
+
+/* Register list for a ldm/stm instruction to load/store
+ the general registers from a __jmp_buf. */
+#define JMP_BUF_REGLIST {v1-v6, sl, fp, sp, lr}
+
+/* Index of __jmp_buf where the sp register resides. */
+#define __JMP_BUF_SP 8
+
+#endif /* include/bits/setjmp.h */
diff --git a/ports/sysdeps/arm/jmpbuf-unwind.h b/ports/sysdeps/arm/jmpbuf-unwind.h
index 7f7770aea0..0863540ce0 100644
--- a/ports/sysdeps/arm/jmpbuf-unwind.h
+++ b/ports/sysdeps/arm/jmpbuf-unwind.h
@@ -16,7 +16,6 @@
<http://www.gnu.org/licenses/>. */
#include <setjmp.h>
-#include <jmpbuf-offsets.h>
#include <stdint.h>
#include <unwind.h>
diff --git a/ports/sysdeps/arm/memcpy.S b/ports/sysdeps/arm/memcpy.S
index d8164b4d70..add82e2d18 100644
--- a/ports/sysdeps/arm/memcpy.S
+++ b/ports/sysdeps/arm/memcpy.S
@@ -17,7 +17,10 @@
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>
+#include <arm-features.h>
/*
* Data preload for architectures that support it (ARM V5TE and above)
@@ -43,20 +46,21 @@
* Endian independent macros for shifting bytes within registers.
*/
#ifndef __ARMEB__
-#define pull lsr
-#define push lsl
+#define PULL lsr
+#define PUSH lsl
#else
-#define pull lsl
-#define push lsr
+#define PULL lsl
+#define PUSH lsr
#endif
.text
+ .syntax unified
/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
ENTRY(memcpy)
- stmfd sp!, {r0, r4, lr}
+ push {r0, r4, lr}
cfi_adjust_cfa_offset (12)
cfi_rel_offset (r4, 4)
cfi_rel_offset (lr, 8)
@@ -66,13 +70,13 @@ ENTRY(memcpy)
subs r2, r2, #4
blt 8f
ands ip, r0, #3
- PLD( pld [r1, #0] )
+ PLD( sfi_pld r1, #0 )
bne 9f
ands ip, r1, #3
bne 10f
1: subs r2, r2, #(28)
- stmfd sp!, {r5 - r8}
+ push {r5 - r8}
cfi_adjust_cfa_offset (16)
cfi_rel_offset (r5, 0)
cfi_rel_offset (r6, 4)
@@ -82,54 +86,112 @@ ENTRY(memcpy)
CALGN( ands ip, r1, #31 )
CALGN( rsb r3, ip, #32 )
- CALGN( sbcnes r4, r3, r2 ) @ C is always set here
+ CALGN( sbcsne r4, r3, r2 ) @ C is always set here
CALGN( bcs 2f )
CALGN( adr r4, 6f )
CALGN( subs r2, r2, r3 ) @ C gets set
- CALGN( add pc, r4, ip )
+#ifndef ARM_ALWAYS_BX
+ CALGN( add pc, r4, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2))
+#else
+ CALGN( add r4, r4, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2))
+ CALGN( bx r4 )
+#endif
- PLD( pld [r1, #0] )
+ PLD( sfi_pld r1, #0 )
2: PLD( subs r2, r2, #96 )
- PLD( pld [r1, #28] )
+ PLD( sfi_pld r1, #28 )
PLD( blt 4f )
- PLD( pld [r1, #60] )
- PLD( pld [r1, #92] )
+ PLD( sfi_pld r1, #60 )
+ PLD( sfi_pld r1, #92 )
-3: PLD( pld [r1, #124] )
-4: ldmia r1!, {r3, r4, r5, r6, r7, r8, ip, lr}
+3: PLD( sfi_pld r1, #124 )
+4: sfi_breg r1, \
+ ldmia \B!, {r3, r4, r5, r6, r7, r8, ip, lr}
subs r2, r2, #32
- stmia r0!, {r3, r4, r5, r6, r7, r8, ip, lr}
+ sfi_breg r0, \
+ stmia \B!, {r3, r4, r5, r6, r7, r8, ip, lr}
bge 3b
PLD( cmn r2, #96 )
PLD( bge 4b )
5: ands ip, r2, #28
rsb ip, ip, #32
- addne pc, pc, ip @ C is always clear here
+#ifndef ARM_ALWAYS_BX
+ /* C is always clear here. */
+ addne pc, pc, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2)
b 7f
+#else
+ beq 7f
+ push {r10}
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (r10, 0)
+ add r10, pc, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2)
+ bx r10
+#endif
+ .p2align ARM_BX_ALIGN_LOG2
6: nop
- ldr r3, [r1], #4
- ldr r4, [r1], #4
- ldr r5, [r1], #4
- ldr r6, [r1], #4
- ldr r7, [r1], #4
- ldr r8, [r1], #4
- ldr lr, [r1], #4
-
- add pc, pc, ip
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r3, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r4, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r5, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r6, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r7, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r8, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr lr, [\B], #4
+
+#ifndef ARM_ALWAYS_BX
+ add pc, pc, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2)
nop
+#else
+ add r10, pc, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2)
+ bx r10
+#endif
+ .p2align ARM_BX_ALIGN_LOG2
nop
- str r3, [r0], #4
- str r4, [r0], #4
- str r5, [r0], #4
- str r6, [r0], #4
- str r7, [r0], #4
- str r8, [r0], #4
- str lr, [r0], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r3, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r4, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r5, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r6, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r7, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r8, [\B], #4
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str lr, [\B], #4
+
+#ifdef ARM_ALWAYS_BX
+ pop {r10}
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (r10)
+#endif
CALGN( bcs 2b )
-7: ldmfd sp!, {r5 - r8}
+7: pop {r5 - r8}
cfi_adjust_cfa_offset (-16)
cfi_restore (r5)
cfi_restore (r6)
@@ -137,41 +199,55 @@ ENTRY(memcpy)
cfi_restore (r8)
8: movs r2, r2, lsl #31
- ldrneb r3, [r1], #1
- ldrcsb r4, [r1], #1
- ldrcsb ip, [r1]
- strneb r3, [r0], #1
- strcsb r4, [r0], #1
- strcsb ip, [r0]
-
-#if defined (__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
- ldmfd sp!, {r0, r4, lr}
+ sfi_breg r1, \
+ ldrbne r3, [\B], #1
+ sfi_breg r1, \
+ ldrbcs r4, [\B], #1
+ sfi_breg r1, \
+ ldrbcs ip, [\B]
+ sfi_breg r0, \
+ strbne r3, [\B], #1
+ sfi_breg r0, \
+ strbcs r4, [\B], #1
+ sfi_breg r0, \
+ strbcs ip, [\B]
+
+#if ((defined (__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)) \
+ || defined (ARM_ALWAYS_BX))
+ pop {r0, r4, lr}
cfi_adjust_cfa_offset (-12)
cfi_restore (r4)
cfi_restore (lr)
bx lr
#else
- ldmfd sp!, {r0, r4, pc}
+ pop {r0, r4, pc}
#endif
cfi_restore_state
9: rsb ip, ip, #4
cmp ip, #2
- ldrgtb r3, [r1], #1
- ldrgeb r4, [r1], #1
- ldrb lr, [r1], #1
- strgtb r3, [r0], #1
- strgeb r4, [r0], #1
+ sfi_breg r1, \
+ ldrbgt r3, [\B], #1
+ sfi_breg r1, \
+ ldrbge r4, [\B], #1
+ sfi_breg r1, \
+ ldrb lr, [\B], #1
+ sfi_breg r0, \
+ strbgt r3, [\B], #1
+ sfi_breg r0, \
+ strbge r4, [\B], #1
subs r2, r2, ip
- strb lr, [r0], #1
+ sfi_breg r0, \
+ strb lr, [\B], #1
blt 8b
ands ip, r1, #3
beq 1b
10: bic r1, r1, #3
cmp ip, #2
- ldr lr, [r1], #4
+ sfi_breg r1, \
+ ldr lr, [\B], #4
beq 17f
bgt 18f
@@ -183,66 +259,71 @@ ENTRY(memcpy)
CALGN( ands ip, r1, #31 )
CALGN( rsb ip, ip, #32 )
- CALGN( sbcnes r4, ip, r2 ) @ C is always set here
+ CALGN( sbcsne r4, ip, r2 ) @ C is always set here
CALGN( subcc r2, r2, ip )
CALGN( bcc 15f )
-11: stmfd sp!, {r5 - r9}
+11: push {r5 - r8, r10}
cfi_adjust_cfa_offset (20)
cfi_rel_offset (r5, 0)
cfi_rel_offset (r6, 4)
cfi_rel_offset (r7, 8)
cfi_rel_offset (r8, 12)
- cfi_rel_offset (r9, 16)
+ cfi_rel_offset (r10, 16)
- PLD( pld [r1, #0] )
+ PLD( sfi_pld r1, #0 )
PLD( subs r2, r2, #96 )
- PLD( pld [r1, #28] )
+ PLD( sfi_pld r1, #28 )
PLD( blt 13f )
- PLD( pld [r1, #60] )
- PLD( pld [r1, #92] )
+ PLD( sfi_pld r1, #60 )
+ PLD( sfi_pld r1, #92 )
-12: PLD( pld [r1, #124] )
-13: ldmia r1!, {r4, r5, r6, r7}
- mov r3, lr, pull #\pull
+12: PLD( sfi_pld r1, #124 )
+13: sfi_breg r1, \
+ ldmia \B!, {r4, r5, r6, r7}
+ mov r3, lr, PULL #\pull
subs r2, r2, #32
- ldmia r1!, {r8, r9, ip, lr}
- orr r3, r3, r4, push #\push
- mov r4, r4, pull #\pull
- orr r4, r4, r5, push #\push
- mov r5, r5, pull #\pull
- orr r5, r5, r6, push #\push
- mov r6, r6, pull #\pull
- orr r6, r6, r7, push #\push
- mov r7, r7, pull #\pull
- orr r7, r7, r8, push #\push
- mov r8, r8, pull #\pull
- orr r8, r8, r9, push #\push
- mov r9, r9, pull #\pull
- orr r9, r9, ip, push #\push
- mov ip, ip, pull #\pull
- orr ip, ip, lr, push #\push
- stmia r0!, {r3, r4, r5, r6, r7, r8, r9, ip}
+ sfi_breg r1, \
+ ldmia \B!, {r8, r10, ip, lr}
+ orr r3, r3, r4, PUSH #\push
+ mov r4, r4, PULL #\pull
+ orr r4, r4, r5, PUSH #\push
+ mov r5, r5, PULL #\pull
+ orr r5, r5, r6, PUSH #\push
+ mov r6, r6, PULL #\pull
+ orr r6, r6, r7, PUSH #\push
+ mov r7, r7, PULL #\pull
+ orr r7, r7, r8, PUSH #\push
+ mov r8, r8, PULL #\pull
+ orr r8, r8, r10, PUSH #\push
+ mov r10, r10, PULL #\pull
+ orr r10, r10, ip, PUSH #\push
+ mov ip, ip, PULL #\pull
+ orr ip, ip, lr, PUSH #\push
+ sfi_breg r0, \
+ stmia \B!, {r3, r4, r5, r6, r7, r8, r10, ip}
bge 12b
PLD( cmn r2, #96 )
PLD( bge 13b )
- ldmfd sp!, {r5 - r9}
+ pop {r5 - r8, r10}
cfi_adjust_cfa_offset (-20)
cfi_restore (r5)
cfi_restore (r6)
cfi_restore (r7)
cfi_restore (r8)
- cfi_restore (r9)
+ cfi_restore (r10)
14: ands ip, r2, #28
beq 16f
-15: mov r3, lr, pull #\pull
- ldr lr, [r1], #4
+15: mov r3, lr, PULL #\pull
+ sfi_breg r1, \
+ ldr lr, [\B], #4
subs ip, ip, #4
- orr r3, r3, lr, push #\push
- str r3, [r0], #4
+ orr r3, r3, lr, PUSH #\push
+ sfi_breg r0, \
+ str r3, [\B], #4
bgt 15b
CALGN( cmp r2, #0 )
CALGN( bge 11b )
diff --git a/ports/sysdeps/arm/memmove.S b/ports/sysdeps/arm/memmove.S
index d33c1cef84..9d4d5b099e 100644
--- a/ports/sysdeps/arm/memmove.S
+++ b/ports/sysdeps/arm/memmove.S
@@ -17,7 +17,10 @@
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>
+#include <arm-features.h>
/*
* Data preload for architectures that support it (ARM V5TE and above)
@@ -43,14 +46,15 @@
* Endian independent macros for shifting bytes within registers.
*/
#ifndef __ARMEB__
-#define pull lsr
-#define push lsl
+#define PULL lsr
+#define PUSH lsl
#else
-#define pull lsl
-#define push lsr
+#define PULL lsl
+#define PUSH lsr
#endif
.text
+ .syntax unified
/*
* Prototype: void *memmove(void *dest, const void *src, size_t n);
@@ -71,7 +75,7 @@ ENTRY(memmove)
bls HIDDEN_JUMPTARGET(memcpy)
#endif
- stmfd sp!, {r0, r4, lr}
+ push {r0, r4, lr}
cfi_adjust_cfa_offset (12)
cfi_rel_offset (r4, 4)
cfi_rel_offset (lr, 8)
@@ -83,13 +87,13 @@ ENTRY(memmove)
subs r2, r2, #4
blt 8f
ands ip, r0, #3
- PLD( pld [r1, #-4] )
+ PLD( sfi_pld r1, #-4 )
bne 9f
ands ip, r1, #3
bne 10f
1: subs r2, r2, #(28)
- stmfd sp!, {r5 - r8}
+ push {r5 - r8}
cfi_adjust_cfa_offset (16)
cfi_rel_offset (r5, 0)
cfi_rel_offset (r6, 4)
@@ -98,54 +102,112 @@ ENTRY(memmove)
blt 5f
CALGN( ands ip, r1, #31 )
- CALGN( sbcnes r4, ip, r2 ) @ C is always set here
+ CALGN( sbcsne r4, ip, r2 ) @ C is always set here
CALGN( bcs 2f )
CALGN( adr r4, 6f )
CALGN( subs r2, r2, ip ) @ C is set here
- CALGN( add pc, r4, ip )
+#ifndef ARM_ALWAYS_BX
+ CALGN( add pc, r4, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2))
+#else
+ CALGN( add r4, r4, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2))
+ CALGN( bx r4 )
+#endif
- PLD( pld [r1, #-4] )
+ PLD( sfi_pld r1, #-4 )
2: PLD( subs r2, r2, #96 )
- PLD( pld [r1, #-32] )
+ PLD( sfi_pld r1, #-32 )
PLD( blt 4f )
- PLD( pld [r1, #-64] )
- PLD( pld [r1, #-96] )
+ PLD( sfi_pld r1, #-64 )
+ PLD( sfi_pld r1, #-96 )
-3: PLD( pld [r1, #-128] )
-4: ldmdb r1!, {r3, r4, r5, r6, r7, r8, ip, lr}
+3: PLD( sfi_pld r1, #-128 )
+4: sfi_breg r1, \
+ ldmdb \B!, {r3, r4, r5, r6, r7, r8, ip, lr}
subs r2, r2, #32
- stmdb r0!, {r3, r4, r5, r6, r7, r8, ip, lr}
+ sfi_breg r0, \
+ stmdb \B!, {r3, r4, r5, r6, r7, r8, ip, lr}
bge 3b
PLD( cmn r2, #96 )
PLD( bge 4b )
5: ands ip, r2, #28
rsb ip, ip, #32
- addne pc, pc, ip @ C is always clear here
+#ifndef ARM_ALWAYS_BX
+ /* C is always clear here. */
+ addne pc, pc, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2)
b 7f
+#else
+ beq 7f
+ push {r10}
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (r10, 0)
+ add r10, pc, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2)
+ bx r10
+#endif
+ .p2align ARM_BX_ALIGN_LOG2
6: nop
- ldr r3, [r1, #-4]!
- ldr r4, [r1, #-4]!
- ldr r5, [r1, #-4]!
- ldr r6, [r1, #-4]!
- ldr r7, [r1, #-4]!
- ldr r8, [r1, #-4]!
- ldr lr, [r1, #-4]!
-
- add pc, pc, ip
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r3, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r4, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r5, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r6, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r7, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr r8, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r1, \
+ ldr lr, [\B, #-4]!
+
+#ifndef ARM_ALWAYS_BX
+ add pc, pc, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2)
nop
+#else
+ add r10, pc, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2)
+ bx r10
+#endif
+ .p2align ARM_BX_ALIGN_LOG2
nop
- str r3, [r0, #-4]!
- str r4, [r0, #-4]!
- str r5, [r0, #-4]!
- str r6, [r0, #-4]!
- str r7, [r0, #-4]!
- str r8, [r0, #-4]!
- str lr, [r0, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r3, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r4, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r5, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r6, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r7, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str r8, [\B, #-4]!
+ .p2align ARM_BX_ALIGN_LOG2
+ sfi_breg r0, \
+ str lr, [\B, #-4]!
+
+#ifdef ARM_ALWAYS_BX
+ pop {r10}
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (r10)
+#endif
CALGN( bcs 2b )
-7: ldmfd sp!, {r5 - r8}
+7: pop {r5 - r8}
cfi_adjust_cfa_offset (-16)
cfi_restore (r5)
cfi_restore (r6)
@@ -153,40 +215,54 @@ ENTRY(memmove)
cfi_restore (r8)
8: movs r2, r2, lsl #31
- ldrneb r3, [r1, #-1]!
- ldrcsb r4, [r1, #-1]!
- ldrcsb ip, [r1, #-1]
- strneb r3, [r0, #-1]!
- strcsb r4, [r0, #-1]!
- strcsb ip, [r0, #-1]
-
-#if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
- ldmfd sp!, {r0, r4, lr}
+ sfi_breg r1, \
+ ldrbne r3, [\B, #-1]!
+ sfi_breg r1, \
+ ldrbcs r4, [\B, #-1]!
+ sfi_breg r1, \
+ ldrbcs ip, [\B, #-1]
+ sfi_breg r0, \
+ strbne r3, [\B, #-1]!
+ sfi_breg r0, \
+ strbcs r4, [\B, #-1]!
+ sfi_breg r0, \
+ strbcs ip, [\B, #-1]
+
+#if ((defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)) \
+ || defined (ARM_ALWAYS_BX))
+ pop {r0, r4, lr}
cfi_adjust_cfa_offset (-12)
cfi_restore (r4)
cfi_restore (lr)
bx lr
#else
- ldmfd sp!, {r0, r4, pc}
+ pop {r0, r4, pc}
#endif
cfi_restore_state
9: cmp ip, #2
- ldrgtb r3, [r1, #-1]!
- ldrgeb r4, [r1, #-1]!
- ldrb lr, [r1, #-1]!
- strgtb r3, [r0, #-1]!
- strgeb r4, [r0, #-1]!
+ sfi_breg r1, \
+ ldrbgt r3, [\B, #-1]!
+ sfi_breg r1, \
+ ldrbge r4, [\B, #-1]!
+ sfi_breg r1, \
+ ldrb lr, [\B, #-1]!
+ sfi_breg r0, \
+ strbgt r3, [\B, #-1]!
+ sfi_breg r0, \
+ strbge r4, [\B, #-1]!
subs r2, r2, ip
- strb lr, [r0, #-1]!
+ sfi_breg r0, \
+ strb lr, [\B, #-1]!
blt 8b
ands ip, r1, #3
beq 1b
10: bic r1, r1, #3
cmp ip, #2
- ldr r3, [r1, #0]
+ sfi_breg r1, \
+ ldr r3, [\B, #0]
beq 17f
blt 18f
@@ -198,66 +274,71 @@ ENTRY(memmove)
CALGN( ands ip, r1, #31 )
CALGN( rsb ip, ip, #32 )
- CALGN( sbcnes r4, ip, r2 ) @ C is always set here
+ CALGN( sbcsne r4, ip, r2 ) @ C is always set here
CALGN( subcc r2, r2, ip )
CALGN( bcc 15f )
-11: stmfd sp!, {r5 - r9}
+11: push {r5 - r8, r10}
cfi_adjust_cfa_offset (20)
cfi_rel_offset (r5, 0)
cfi_rel_offset (r6, 4)
cfi_rel_offset (r7, 8)
cfi_rel_offset (r8, 12)
- cfi_rel_offset (r9, 16)
+ cfi_rel_offset (r10, 16)
- PLD( pld [r1, #-4] )
+ PLD( sfi_pld r1, #-4 )
PLD( subs r2, r2, #96 )
- PLD( pld [r1, #-32] )
+ PLD( sfi_pld r1, #-32 )
PLD( blt 13f )
- PLD( pld [r1, #-64] )
- PLD( pld [r1, #-96] )
+ PLD( sfi_pld r1, #-64 )
+ PLD( sfi_pld r1, #-96 )
-12: PLD( pld [r1, #-128] )
-13: ldmdb r1!, {r7, r8, r9, ip}
- mov lr, r3, push #\push
+12: PLD( sfi_pld r1, #-128 )
+13: sfi_breg r1, \
+ ldmdb \B!, {r7, r8, r10, ip}
+ mov lr, r3, PUSH #\push
subs r2, r2, #32
- ldmdb r1!, {r3, r4, r5, r6}
- orr lr, lr, ip, pull #\pull
- mov ip, ip, push #\push
- orr ip, ip, r9, pull #\pull
- mov r9, r9, push #\push
- orr r9, r9, r8, pull #\pull
- mov r8, r8, push #\push
- orr r8, r8, r7, pull #\pull
- mov r7, r7, push #\push
- orr r7, r7, r6, pull #\pull
- mov r6, r6, push #\push
- orr r6, r6, r5, pull #\pull
- mov r5, r5, push #\push
- orr r5, r5, r4, pull #\pull
- mov r4, r4, push #\push
- orr r4, r4, r3, pull #\pull
- stmdb r0!, {r4 - r9, ip, lr}
+ sfi_breg r1, \
+ ldmdb \B!, {r3, r4, r5, r6}
+ orr lr, lr, ip, PULL #\pull
+ mov ip, ip, PUSH #\push
+ orr ip, ip, r10, PULL #\pull
+ mov r10, r10, PUSH #\push
+ orr r10, r10, r8, PULL #\pull
+ mov r8, r8, PUSH #\push
+ orr r8, r8, r7, PULL #\pull
+ mov r7, r7, PUSH #\push
+ orr r7, r7, r6, PULL #\pull
+ mov r6, r6, PUSH #\push
+ orr r6, r6, r5, PULL #\pull
+ mov r5, r5, PUSH #\push
+ orr r5, r5, r4, PULL #\pull
+ mov r4, r4, PUSH #\push
+ orr r4, r4, r3, PULL #\pull
+ sfi_breg r0, \
+ stmdb \B!, {r4 - r8, r10, ip, lr}
bge 12b
PLD( cmn r2, #96 )
PLD( bge 13b )
- ldmfd sp!, {r5 - r9}
+ pop {r5 - r8, r10}
cfi_adjust_cfa_offset (-20)
cfi_restore (r5)
cfi_restore (r6)
cfi_restore (r7)
cfi_restore (r8)
- cfi_restore (r9)
+ cfi_restore (r10)
14: ands ip, r2, #28
beq 16f
-15: mov lr, r3, push #\push
- ldr r3, [r1, #-4]!
+15: mov lr, r3, PUSH #\push
+ sfi_breg r1, \
+ ldr r3, [\B, #-4]!
subs ip, ip, #4
- orr lr, lr, r3, pull #\pull
- str lr, [r0, #-4]!
+ orr lr, lr, r3, PULL #\pull
+ sfi_breg r0, \
+ str lr, [\B, #-4]!
bgt 15b
CALGN( cmp r2, #0 )
CALGN( bge 11b )
diff --git a/ports/sysdeps/arm/memset.S b/ports/sysdeps/arm/memset.S
index 3152a84e80..a28cdc6205 100644
--- a/ports/sysdeps/arm/memset.S
+++ b/ports/sysdeps/arm/memset.S
@@ -16,8 +16,13 @@
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>
+ .text
+ .syntax unified
+
/* void *memset (dstpp, c, len) */
ENTRY(memset)
@@ -27,7 +32,8 @@ ENTRY(memset)
1:
tst r3, #3 @ aligned yet?
- strneb r1, [r3], #1
+ sfi_breg r3, \
+ strbne r1, [\B], #1
subne r2, r2, #1
bne 1b
@@ -38,27 +44,35 @@ ENTRY(memset)
1:
subs r2, r2, #8
- stmcsia r3!, {r1, ip} @ store up to 32 bytes per loop iteration
- subcss r2, r2, #8
- stmcsia r3!, {r1, ip}
- subcss r2, r2, #8
- stmcsia r3!, {r1, ip}
- subcss r2, r2, #8
- stmcsia r3!, {r1, ip}
+ sfi_breg r3, \
+ stmiacs \B!, {r1, ip} @ store up to 32 bytes per loop iteration
+ subscs r2, r2, #8
+ sfi_breg r3, \
+ stmiacs \B!, {r1, ip}
+ subscs r2, r2, #8
+ sfi_breg r3, \
+ stmiacs \B!, {r1, ip}
+ subscs r2, r2, #8
+ sfi_breg r3, \
+ stmiacs \B!, {r1, ip}
bcs 1b
and r2, r2, #7
2:
subs r2, r2, #1 @ store up to 4 bytes per loop iteration
- strcsb r1, [r3], #1
- subcss r2, r2, #1
- strcsb r1, [r3], #1
- subcss r2, r2, #1
- strcsb r1, [r3], #1
- subcss r2, r2, #1
- strcsb r1, [r3], #1
+ sfi_breg r3, \
+ strbcs r1, [\B], #1
+ subscs r2, r2, #1
+ sfi_breg r3, \
+ strbcs r1, [\B], #1
+ subscs r2, r2, #1
+ sfi_breg r3, \
+ strbcs r1, [\B], #1
+ subscs r2, r2, #1
+ sfi_breg r3, \
+ strbcs r1, [\B], #1
bcs 2b
-
+
DO_RET(lr)
END(memset)
libc_hidden_builtin_def (memset)
diff --git a/ports/sysdeps/arm/preconfigure b/ports/sysdeps/arm/preconfigure
index 20f6d91a12..908cd34303 100644
--- a/ports/sysdeps/arm/preconfigure
+++ b/ports/sysdeps/arm/preconfigure
@@ -1,50 +1,63 @@
+# This file is generated from configure.in by Autoconf. DO NOT EDIT!
+ # Local preconfigure fragment for sysdeps/arm
+
case "$machine" in
arm*)
- base_machine=arm
- case $config_os in
- linux-gnueabi*)
- # Lets ask the compiler which ARM family we've got
- # Unfortunately it doesn't define any flags for implementations
- # that you might pass to -mcpu or -mtune
- # Note if you add patterns here you must ensure that
- # an appropriate directory exists in sysdeps/arm
- archcppflag=`echo "" |
- $CC $CFLAGS $CPPFLAGS -E -dM - |
- grep __ARM_ARCH |
- sed -e 's/^#define //' -e 's/ .*//'`
+ case $config_os in
+ linux-gnueabi*)
+ # If the compiler enables unwind tables by default, this causes
+ # problems with undefined symbols in -nostdlib link tests. To
+ # avoid this, add -fno-unwind-tables here and remove it in
+ # sysdeps/unix/sysv/linux/arm/configure.in after those tests have
+ # been run.
+ if test "${CFLAGS+set}" != "set"; then
+ CFLAGS="-g -O2"
+ fi
+ CFLAGS="$CFLAGS -fno-unwind-tables"
+ ;;
+ linux*)
+ as_fn_error $? "Old ABI no longer supported" "$LINENO" 5
+ ;;
+ esac
- case x$archcppflag in
- x__ARM_ARCH_[89]*__)
- machine=armv7
- echo "Found compiler is configured for something newer than v7 - using v7"
- ;;
+ base_machine=arm
+ # Lets ask the compiler which ARM family we've got
+ # Unfortunately it doesn't define any flags for implementations
+ # that you might pass to -mcpu or -mtune
+ # Note if you add patterns here you must ensure that
+ # an appropriate directory exists in sysdeps/arm
+ archcppflag=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null |
+ sed -n 's/^#define \(__ARM_ARCH_[0-9].*__\) .*$/\1/p'`
- x__ARM_ARCH_7A__)
- machine=armv7
- echo "Found compiler is configured for $machine"
- ;;
+ case "x$archcppflag" in
+ x__ARM_ARCH_89*__)
+ machine=armv7
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for something newer than v7 - using v7" >&5
+$as_echo "$as_me: Found compiler is configured for something newer than v7 - using v7" >&6;}
+ ;;
- x__ARM_ARCH_6T2__)
- machine=armv6t2
- echo "Found compiler is configured for $machine"
- ;;
+ x__ARM_ARCH_7A__)
+ machine=armv7
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for $machine" >&5
+$as_echo "$as_me: Found compiler is configured for $machine" >&6;}
+ ;;
- *)
- machine=arm
- echo 2>&1 "arm/preconfigure: Did not find ARM architecture type; using default"
- ;;
- esac
+ x__ARM_ARCH_6T2__)
+ machine=armv6t2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for $machine" >&5
+$as_echo "$as_me: Found compiler is configured for $machine" >&6;}
+ ;;
+ x__ARM_ARCH_6*__)
+ machine=armv6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for $machine" >&5
+$as_echo "$as_me: Found compiler is configured for $machine" >&6;}
+ ;;
+ *)
+ machine=arm
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: arm/preconfigure: Did not find ARM architecture type; using default" >&5
+$as_echo "$as_me: WARNING: arm/preconfigure: Did not find ARM architecture type; using default" >&2;}
+ ;;
+ esac
- machine=arm/$machine
- if [ "${CFLAGS+set}" != "set" ]; then
- CFLAGS="-g -O2"
- fi
- CFLAGS="$CFLAGS -fno-unwind-tables"
- ;;
- linux*)
- echo "Old ABI no longer supported" 2>&1
- exit 1
- ;;
- esac
- ;;
+ machine=arm/$machine
esac
diff --git a/ports/sysdeps/arm/preconfigure.in b/ports/sysdeps/arm/preconfigure.in
new file mode 100644
index 0000000000..f8357955eb
--- /dev/null
+++ b/ports/sysdeps/arm/preconfigure.in
@@ -0,0 +1,58 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local preconfigure fragment for sysdeps/arm
+
+case "$machine" in
+arm*)
+ case $config_os in
+ linux-gnueabi*)
+ # If the compiler enables unwind tables by default, this causes
+ # problems with undefined symbols in -nostdlib link tests. To
+ # avoid this, add -fno-unwind-tables here and remove it in
+ # sysdeps/unix/sysv/linux/arm/configure.in after those tests have
+ # been run.
+ if test "${CFLAGS+set}" != "set"; then
+ CFLAGS="-g -O2"
+ fi
+ CFLAGS="$CFLAGS -fno-unwind-tables"
+ ;;
+ linux*)
+ AC_MSG_ERROR([Old ABI no longer supported])
+ ;;
+ esac
+
+ base_machine=arm
+ # Lets ask the compiler which ARM family we've got
+ # Unfortunately it doesn't define any flags for implementations
+ # that you might pass to -mcpu or -mtune
+ # Note if you add patterns here you must ensure that
+ # an appropriate directory exists in sysdeps/arm
+ archcppflag=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null |
+ sed -n 's/^#define \(__ARM_ARCH_[0-9].*__\) .*$/\1/p'`
+
+ case "x$archcppflag" in
+ x__ARM_ARCH_[89]*__)
+ machine=armv7
+ AC_MSG_NOTICE([Found compiler is configured for something newer than v7 - using v7])
+ ;;
+
+ x__ARM_ARCH_7A__)
+ machine=armv7
+ AC_MSG_NOTICE([Found compiler is configured for $machine])
+ ;;
+
+ x__ARM_ARCH_6T2__)
+ machine=armv6t2
+ AC_MSG_NOTICE([Found compiler is configured for $machine])
+ ;;
+ x__ARM_ARCH_6*__)
+ machine=armv6
+ AC_MSG_NOTICE([Found compiler is configured for $machine])
+ ;;
+ *)
+ machine=arm
+ AC_MSG_WARN([arm/preconfigure: Did not find ARM architecture type; using default])
+ ;;
+ esac
+
+ machine=arm/$machine
+esac
diff --git a/ports/sysdeps/arm/setjmp.S b/ports/sysdeps/arm/setjmp.S
index 4b7542ad35..f750470652 100644
--- a/ports/sysdeps/arm/setjmp.S
+++ b/ports/sysdeps/arm/setjmp.S
@@ -16,9 +16,9 @@
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
#include <bits/setjmp.h>
#include <rtld-global-offsets.h>
#include <arm-features.h>
@@ -27,7 +27,8 @@ ENTRY (__sigsetjmp)
mov ip, r0
/* Save registers */
- stmia ip!, {v1-v6, sl, fp, sp, lr}
+ sfi_breg ip, \
+ stmia \B!, JMP_BUF_REGLIST
#if !defined ARM_ASSUME_NO_IWMMXT || defined __SOFTFP__
# define NEED_HWCAP 1
@@ -64,11 +65,13 @@ ENTRY (__sigsetjmp)
Don't use VFP instructions directly because this code
is used in non-VFP multilibs. */
/* Following instruction is vstmia ip!, {d8-d15}. */
- stc p11, cr8, [ip], #64
+ sfi_breg ip, \
+ stc p11, cr8, [\B], #64
/* Store the floating-point status register. */
/* Following instruction is vmrs a4, fpscr. */
mrc p10, 7, a4, cr1, cr0, 0
- str a4, [ip], #4
+ sfi_breg ip, \
+ str a4, [\B], #4
.Lno_vfp:
#ifndef ARM_ASSUME_NO_IWMMXT
@@ -77,12 +80,18 @@ ENTRY (__sigsetjmp)
/* Save the call-preserved iWMMXt registers. */
/* Following instructions are wstrd wr10, [ip], #8 (etc.) */
- stcl p1, cr10, [r12], #8
- stcl p1, cr11, [r12], #8
- stcl p1, cr12, [r12], #8
- stcl p1, cr13, [r12], #8
- stcl p1, cr14, [r12], #8
- stcl p1, cr15, [r12], #8
+ sfi_breg r12, \
+ stcl p1, cr10, [\B], #8
+ sfi_breg r12, \
+ stcl p1, cr11, [\B], #8
+ sfi_breg r12, \
+ stcl p1, cr12, [\B], #8
+ sfi_breg r12, \
+ stcl p1, cr13, [\B], #8
+ sfi_breg r12, \
+ stcl p1, cr14, [\B], #8
+ sfi_breg r12, \
+ stcl p1, cr15, [\B], #8
.Lno_iwmmxt:
#endif
@@ -91,12 +100,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/ports/sysdeps/arm/start.S b/ports/sysdeps/arm/start.S
index a1d15b8104..0a57b0becb 100644
--- a/ports/sysdeps/arm/start.S
+++ b/ports/sysdeps/arm/start.S
@@ -80,14 +80,14 @@ _start:
mov lr, #0
/* Pop argc off the stack and save a pointer to argv */
- ldr a2, [sp], #4
+ pop { a2 }
mov a3, sp
/* Push stack limit */
- str a3, [sp, #-4]!
+ push { a3 }
/* Push rtld_fini */
- str a1, [sp, #-4]!
+ push { a1 }
#ifdef SHARED
ldr sl, .L_GOT
@@ -97,7 +97,7 @@ _start:
ldr ip, .L_GOT+4 /* __libc_csu_fini */
ldr ip, [sl, ip]
- str ip, [sp, #-4]! /* Push __libc_csu_fini */
+ push { ip } /* Push __libc_csu_fini */
ldr a4, .L_GOT+8 /* __libc_csu_init */
ldr a4, [sl, a4]
@@ -113,7 +113,7 @@ _start:
ldr ip, =__libc_csu_fini
/* Push __libc_csu_fini */
- str ip, [sp, #-4]!
+ push { ip }
/* Set up the other arguments in registers */
ldr a1, =main
diff --git a/ports/sysdeps/arm/strlen.S b/ports/sysdeps/arm/strlen.S
index 15e922118a..7d358a7249 100644
--- a/ports/sysdeps/arm/strlen.S
+++ b/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)
@@ -23,9 +25,13 @@
* exit: r0 = len
*/
+ .syntax unified
+ .text
+
ENTRY(strlen)
bic r1, r0, $3 @ addr of word containing first byte
- ldr r2, [r1], $4 @ get the first word
+ sfi_breg r1, \
+ ldr r2, [\B], $4 @ get the first word
ands r3, r0, $3 @ how many bytes are duff?
rsb r0, r3, $0 @ get - that number into counter.
beq Laligned @ skip into main check routine if no
@@ -49,7 +55,8 @@ Laligned: @ here, we have a word in r2. Does it
tstne r2, $0x00ff0000 @
tstne r2, $0xff000000 @
addne r0, r0, $4 @ if not, the string is 4 bytes longer
- ldrne r2, [r1], $4 @ and we continue to the next word
+ sfi_breg r1, \
+ ldrne r2, [\B], $4 @ and we continue to the next word
bne Laligned @
Llastword: @ drop through to here once we find a
#ifdef __ARMEB__
diff --git a/ports/sysdeps/arm/sub_n.S b/ports/sysdeps/arm/sub_n.S
new file mode 100644
index 0000000000..8eafa41e64
--- /dev/null
+++ b/ports/sysdeps/arm/sub_n.S
@@ -0,0 +1,2 @@
+#define USE_AS_SUB_N
+#include "add_n.S"
diff --git a/ports/sysdeps/arm/submul_1.S b/ports/sysdeps/arm/submul_1.S
new file mode 100644
index 0000000000..2d17490d8b
--- /dev/null
+++ b/ports/sysdeps/arm/submul_1.S
@@ -0,0 +1,74 @@
+/* mpn_submul_1 -- multiply and subtract bignums.
+ 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>
+
+ .syntax unified
+ .text
+
+@ cycles/limb
+@ StrongArm ?
+@ Cortex-A8 ?
+@ Cortex-A9 ?
+@ Cortex-A15 4
+
+/* mp_limb_t mpn_submul_1(res_ptr, src1_ptr, size, s2_limb) */
+
+ENTRY (__mpn_submul_1)
+ push { 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)
+
+ sfi_breg r1, \
+ ldr r6, [\B], #4
+ sfi_breg r0, \
+ ldr r7, [\B]
+ mov r4, #0 /* init carry in */
+ b 1f
+0:
+ sfi_breg r1, \
+ ldr r6, [\B], #4 /* load next ul */
+ adds r5, r5, r4 /* (lpl, c) = lpl + cl */
+ adc r4, ip, #0 /* cl = hpl + c */
+ subs r5, r7, r5 /* (lpl, !c) = rl - lpl */
+ sfi_breg r0, \
+ ldr r7, [\B, #4] /* load next rl */
+ it cc
+ addcc r4, r4, #1 /* cl += !c */
+ sfi_breg r0, \
+ str r5, [\B], #4
+1:
+ umull r5, ip, r6, r3 /* (hpl, lpl) = ul * vl */
+ subs r2, r2, #1
+ bne 0b
+
+ adds r5, r5, r4 /* (lpl, c) = lpl + cl */
+ adc r4, ip, #0 /* cl = hpl + c */
+ subs r5, r7, r5 /* (lpl, !c) = rl - lpl */
+ sfi_breg r0, \
+ str r5, [\B], #4
+ it cc
+ addcc r4, r4, #1 /* cl += !c */
+ mov r0, r4 /* return carry */
+
+ pop { r4, r5, r6, r7 }
+ DO_RET (lr)
+END (__mpn_submul_1)
diff --git a/ports/sysdeps/arm/sysdep.h b/ports/sysdeps/arm/sysdep.h
index 0e6f645e80..83df7ebc3a 100644
--- a/ports/sysdeps/arm/sysdep.h
+++ b/ports/sysdeps/arm/sysdep.h
@@ -19,9 +19,42 @@
#include <sysdeps/generic/sysdep.h>
#include <features.h>
-#if (!defined (__ARM_ARCH_2__) && !defined (__ARM_ARCH_3__) \
- && !defined (__ARM_ARCH_3M__) && !defined (__ARM_ARCH_4__))
-# define __USE_BX__
+/* The __ARM_ARCH define is provided by gcc 4.8. Construct it otherwise. */
+#ifndef __ARM_ARCH
+# ifdef __ARM_ARCH_2__
+# define __ARM_ARCH 2
+# elif defined (__ARM_ARCH_3__) || defined (__ARM_ARCH_3M__)
+# define __ARM_ARCH 3
+# elif defined (__ARM_ARCH_4__) || defined (__ARM_ARCH_4T__)
+# define __ARM_ARCH 4
+# elif defined (__ARM_ARCH_5__) || defined (__ARM_ARCH_5E__) \
+ || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__) \
+ || defined(__ARM_ARCH_5TEJ__)
+# define __ARM_ARCH 5
+# elif defined (__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
+ || defined (__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
+ || defined (__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__)
+# define __ARM_ARCH 6
+# elif defined (__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
+ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
+ || defined(__ARM_ARCH_7EM__)
+# define __ARM_ARCH 7
+# else
+# error unknown arm architecture
+# endif
+#endif
+
+#if __ARM_ARCH > 4 || defined (__ARM_ARCH_4T__)
+# define ARCH_HAS_BX
+#endif
+#if __ARM_ARCH > 4
+# define ARCH_HAS_BLX
+#endif
+#if __ARM_ARCH > 6 || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__)
+# define ARCH_HAS_HARD_TP
+#endif
+#if __ARM_ARCH > 6 || defined (__ARM_ARCH_6T2__)
+# define ARCH_HAS_T2
#endif
#ifdef __ASSEMBLER__
@@ -33,65 +66,61 @@
#define PLTJMP(_x) _x##(PLT)
-/* APCS-32 doesn't preserve the condition codes across function call. */
-#ifdef __APCS_32__
-#define LOADREGS(cond, base, reglist...)\
- ldm##cond base,reglist
-#ifdef __USE_BX__
-#define RETINSTR(cond, reg) \
- bx##cond reg
-#define DO_RET(_reg) \
- bx _reg
+#ifdef ARCH_HAS_BX
+# define BX(R) bx R
+# define BXC(C, R) bx##C R
+# ifdef ARCH_HAS_BLX
+# define BLX(R) blx R
+# else
+# define BLX(R) mov lr, pc; bx R
+# endif
#else
-#define RETINSTR(cond, reg) \
- mov##cond pc, reg
-#define DO_RET(_reg) \
- mov pc, _reg
-#endif
-#else /* APCS-26 */
-#define LOADREGS(cond, base, reglist...)\
- ldm##cond base,reglist^
-#define RETINSTR(cond, reg) \
- mov##cond##s pc, reg
-#define DO_RET(_reg) \
- movs pc, _reg
+# define BX(R) mov pc, R
+# define BXC(C, R) mov##C pc, R
+# define BLX(R) mov lr, pc; mov pc, R
#endif
+#define DO_RET(R) BX(R)
+#define RETINSTR(C, R) BXC(C, R)
+
/* 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 \
+ push {lr}; \
+ 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 \
+ push {lr}; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
+ bl PLTJMP(mcount); \
+ pops {lr}; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr)
#endif
#else
#define CALL_MCOUNT /* Do nothing. */
@@ -114,4 +143,125 @@
the caller. */
.eabi_attribute 24, 1
+/* The thumb2 encoding is reasonably complete. Unless suppressed, use it. */
+ .syntax unified
+# if defined(__thumb2__) && !defined(NO_THUMB)
+ .thumb
+#else
+# undef __thumb__
+# undef __thumb2__
+ .arm
+# endif
+
+/* Load or store to/from a pc-relative EXPR into/from R, using T. */
+# ifdef __thumb2__
+# define LDST_PCREL(OP, R, T, EXPR) \
+ ldr T, 98f; \
+ .subsection 2; \
+98: .word EXPR - 99f - PC_OFS; \
+ .previous; \
+99: add T, T, pc; \
+ OP R, [T]
+# else
+# define LDST_PCREL(OP, R, T, EXPR) \
+ ldr T, 98f; \
+ .subsection 2; \
+98: .word EXPR - 99f - PC_OFS; \
+ .previous; \
+99: OP R, [pc, T]
+# endif
+
+/* Cope with negative memory offsets, which thumb can't encode.
+ Use NEGOFF_ADJ_BASE to (conditionally) alter the base register,
+ and then NEGOFF_OFF1 to use 0 for thumb and the offset for arm,
+ or NEGOFF_OFF2 to use A-B for thumb and A for arm. */
+# ifdef __thumb2__
+# define NEGOFF_ADJ_BASE(R, OFF) add R, R, $OFF
+# define NEGOFF_ADJ_BASE2(D, S, OFF) add D, S, $OFF
+# define NEGOFF_OFF1(R, OFF) [R]
+# define NEGOFF_OFF2(R, OFFA, OFFB) [R, $((OFFA) - (OFFB))]
+# else
+# define NEGOFF_ADJ_BASE(R, OFF)
+# define NEGOFF_ADJ_BASE2(D, S, OFF) mov D, S
+# define NEGOFF_OFF1(R, OFF) [R, $OFF]
+# define NEGOFF_OFF2(R, OFFA, OFFB) [R, $OFFA]
+# endif
+
+/* Helper to get the TLS base pointer. The interface is that TMP is a
+ register that may be used to hold the LR, if necessary. TMP may be
+ LR itself to indicate that LR need not be saved. The base pointer
+ is returned in R0. Only R0 and TMP are modified. */
+
+# ifdef ARCH_HAS_HARD_TP
+/* If the cpu has cp15 available, use it. */
+# define GET_TLS(TMP) mrc p15, 0, r0, c13, c0, 3
+# else
+/* At this generic level we have no tricks to pull. Call the ABI routine. */
+# define GET_TLS(TMP) \
+ push { r1, r2, r3, lr }; \
+ cfi_remember_state; \
+ cfi_adjust_cfa_offset (16); \
+ cfi_rel_offset (r1, 0); \
+ cfi_rel_offset (r2, 4); \
+ cfi_rel_offset (r3, 8); \
+ cfi_rel_offset (lr, 12); \
+ bl __aeabi_read_tp; \
+ pop { r1, r2, r3, lr }; \
+ cfi_restore_state
+# endif /* ARCH_HAS_HARD_TP */
+
+# ifndef ARM_SFI_MACROS
+# define ARM_SFI_MACROS 1
+/* This assembly macro is prepended to any load/store instruction,
+ pulling the base register out of the addressing mode syntax and
+ making it the first operand of the macro. For example:
+ ldr r0, [r1]
+ becomes:
+ sfi_breg r1, ldr r0, [\B]
+ The \B stands in for the base register that is the first operand
+ to the macro, so we can avoid error-prone repetition of the base
+ register in two places on the line.
+
+ This is used for all memory access through a base register other
+ than PC or SP. It's intended to support SFI schemes such as
+ Native Client, where the OS will enforce that all load/store
+ instructions use a special form. In any such configuration,
+ another sysdep.h file will have defined ARM_SFI_MACROS and
+ provided its own assembly macros with the same interface. */
+
+ .macro sfi_breg basereg, insn, operands:vararg
+ .macro _sfi_breg_doit B
+ \insn \operands
+ .endm
+ _sfi_breg_doit \basereg
+ .purgem _sfi_breg_doit
+ .endm
+
+/* This assembly macro replaces the "pld" instruction.
+ The syntax:
+ sfi_pld REGISTER, #OFFSET
+ is exactly equivalent to:
+ sfi_breg REGISTER, pld [\B, #OFFSET]
+ (and ", #OFFSET" is optional). We have a separate macro
+ only to work around a bug in GAS versions prior to 2.23.2,
+ that misparses the sfi_breg macro expansion in this case. */
+
+ .macro sfi_pld basereg, offset=#0
+ pld [\basereg, \offset]
+ .endm
+
+/* This macro precedes any instruction that directly changes the SP.
+ It's not needed for push/pop or for any kind of load or store that
+ implicitly changes the SP via the ! syntax. */
+# define sfi_sp /* Nothing to do. */
+
+# endif
+
#endif /* __ASSEMBLER__ */
+
+/* This number is the offset from the pc at the current location. */
+#ifdef __thumb__
+# define PC_OFS 4
+#else
+# define PC_OFS 8
+#endif
diff --git a/ports/sysdeps/ia64/dl-fptr.h b/ports/sysdeps/ia64/dl-fptr.h
index c2bef6c288..447c098aff 100644
--- a/ports/sysdeps/ia64/dl-fptr.h
+++ b/ports/sysdeps/ia64/dl-fptr.h
@@ -32,4 +32,14 @@
#define ELF_MACHINE_LOAD_ADDRESS(var, symbol) \
asm ("movl %0 = @gprel (" #symbol ");; add %0 = %0, gp" : "=&r" (var));
+/* We don't have a gcc helper to extract the plabel info. */
+#define ELF_PTR_TO_FDESC(ptr) \
+ ({ union { \
+ void *_ptr; \
+ struct fdesc *_fdesc; \
+ } _u; \
+ _u._ptr = ptr; \
+ _u._fdesc; \
+ })
+
#endif /* !dl_ia64_fptr_h */
diff --git a/ports/sysdeps/ia64/dl-machine.h b/ports/sysdeps/ia64/dl-machine.h
index 2eb80d752f..dd469d7a73 100644
--- a/ports/sysdeps/ia64/dl-machine.h
+++ b/ports/sysdeps/ia64/dl-machine.h
@@ -119,7 +119,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
/* This function will be called to perform the relocation. */
if (!profile)
- doit = (Elf64_Addr) ((struct fdesc *) &_dl_runtime_resolve)->ip;
+ doit = (Elf64_Addr) ELF_PTR_TO_FDESC (&_dl_runtime_resolve)->ip;
else
{
if (GLRO(dl_profile) != NULL
@@ -129,7 +129,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
want profiling and the timers are started. */
GL(dl_profile_map) = l;
}
- doit = (Elf64_Addr) ((struct fdesc *) &_dl_runtime_profile)->ip;
+ doit = (Elf64_Addr) ELF_PTR_TO_FDESC (&_dl_runtime_profile)->ip;
}
reserve[1] = doit;
diff --git a/ports/sysdeps/ia64/entry.h b/ports/sysdeps/ia64/entry.h
index b93e1b6a57..e11b49fc53 100644
--- a/ports/sysdeps/ia64/entry.h
+++ b/ports/sysdeps/ia64/entry.h
@@ -1,10 +1,13 @@
+#include <link.h>
+#include <dl-fptr.h>
+
#ifndef __ASSEMBLY__
extern void _start (void);
#endif
/* The function's entry point is stored in the first word of the
function descriptor (plabel) of _start(). */
-#define ENTRY_POINT (((long int *) _start)[0])
+#define ENTRY_POINT ELF_PTR_TO_FDESC (_start)->ip
/* We have to provide a special declaration. */
#define ENTRY_POINT_DECL(class) class void _start (void);
diff --git a/ports/sysdeps/ia64/fpu/libm_error.c b/ports/sysdeps/ia64/fpu/libm_error.c
index 8ef4bb5a73..a9307dd4b5 100644
--- a/ports/sysdeps/ia64/fpu/libm_error.c
+++ b/ports/sysdeps/ia64/fpu/libm_error.c
@@ -162,80 +162,79 @@ struct exceptionl excl;
# endif
-#define STATIC static
+#define _DECL_NUM(type, prefix, var, bytes...) \
+ ALIGNIT static const union { \
+ const char _bytes[sizeof (type)]; \
+ const type num; \
+ } prefix ## var = { \
+ ._bytes = bytes, \
+ }
+
+#define DECL_FLOAT(var, bytes...) \
+ _DECL_NUM (float, float_, var, ##bytes)
+
+DECL_FLOAT(inf, {0x00,0x00,0x80,0x7F});
+DECL_FLOAT(huge, {0xFF,0xFF,0x7F,0x7F});
+DECL_FLOAT(zero, {0x00,0x00,0x00,0x00});
+DECL_FLOAT(neg_inf, {0x00,0x00,0x80,0xFF});
+DECL_FLOAT(neg_huge, {0xFF,0xFF,0x7F,0xFF});
+DECL_FLOAT(neg_zero, {0x00,0x00,0x00,0x80});
-ALIGNIT
-STATIC const char float_inf[4] = {0x00,0x00,0x80,0x7F};
-ALIGNIT
-STATIC const char float_huge[4] = {0xFF,0xFF,0x7F,0x7F};
-ALIGNIT
-STATIC const char float_zero[4] = {0x00,0x00,0x00,0x00};
-ALIGNIT
-STATIC const char float_neg_inf[4] = {0x00,0x00,0x80,0xFF};
-ALIGNIT
-STATIC const char float_neg_huge[4] = {0xFF,0xFF,0x7F,0xFF};
-ALIGNIT
-STATIC const char float_neg_zero[4] = {0x00,0x00,0x00,0x80};
-ALIGNIT
-STATIC const char double_inf[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x7F};
+#define DECL_DOUBLE(var, bytes...) \
+ _DECL_NUM (double, double_, var, ##bytes)
+
+DECL_DOUBLE(inf, {0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x7F});
#ifndef _LIBC
-ALIGNIT
-STATIC const char double_huge[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0x7F};
+DECL_DOUBLE(huge, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0x7F});
#endif
-ALIGNIT
-STATIC const char double_zero[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
-ALIGNIT
-STATIC const char double_neg_inf[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xFF};
+DECL_DOUBLE(zero, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
+DECL_DOUBLE(neg_inf, {0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xFF});
#ifndef _LIBC
-ALIGNIT
-STATIC const char double_neg_huge[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF};
+DECL_DOUBLE(neg_huge, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF});
#endif
-ALIGNIT
-STATIC const char double_neg_zero[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80};
-ALIGNIT
-STATIC const char long_double_inf[16] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0x7F,0x00,0x00,0x00,0x00,0x00,0x00};
-ALIGNIT
+DECL_DOUBLE(neg_zero, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80});
+
+#define DECL_LONG_DOUBLE(var, bytes...) \
+ _DECL_NUM (long double, long_double_, var, ##bytes)
+
+DECL_LONG_DOUBLE(inf, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0x7F,0x00,0x00,0x00,0x00,0x00,0x00});
#ifndef _LIBC
-STATIC const char long_double_huge[16] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x7F,0x00,0x00,0x00,0x00,0x00,0x00};
+DECL_LONG_DOUBLE(huge, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x7F,0x00,0x00,0x00,0x00,0x00,0x00});
#endif
-ALIGNIT
-STATIC const char long_double_zero[16] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
-ALIGNIT
-STATIC const char long_double_neg_inf[16] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00};
-ALIGNIT
+DECL_LONG_DOUBLE(zero, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
+DECL_LONG_DOUBLE(neg_inf, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00});
#ifndef _LIBC
-STATIC const char long_double_neg_huge[16] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0x00,0x00,0x00,0x00,0x00,0x00};
+DECL_LONG_DOUBLE(neg_huge, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0x00,0x00,0x00,0x00,0x00,0x00});
#endif
-ALIGNIT
-STATIC const char long_double_neg_zero[16] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00};
+DECL_LONG_DOUBLE(neg_zero, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00});
-#define RETVAL_HUGE_VALL *(long double *)retval = *(long double *)long_double_inf
-#define RETVAL_NEG_HUGE_VALL *(long double *)retval = *(long double *)long_double_neg_inf
-#define RETVAL_HUGEL *(long double *)retval = (long double)*(float *)float_huge
-#define RETVAL_NEG_HUGEL *(long double *)retval =(long double)*(float*)float_neg_huge
+#define RETVAL_HUGE_VALL *(long double *)retval = long_double_inf.num
+#define RETVAL_NEG_HUGE_VALL *(long double *)retval = long_double_neg_inf.num
+#define RETVAL_HUGEL *(long double *)retval = (long double)float_huge.num
+#define RETVAL_NEG_HUGEL *(long double *)retval = (long double)float_neg_huge.num
-#define RETVAL_HUGE_VALD *(double *)retval = *(double *) double_inf
-#define RETVAL_NEG_HUGE_VALD *(double *)retval = *(double *) double_neg_inf
-#define RETVAL_HUGED *(double *)retval = (double) *(float *)float_huge
-#define RETVAL_NEG_HUGED *(double *)retval = (double) *(float *) float_neg_huge
+#define RETVAL_HUGE_VALD *(double *)retval = double_inf.num
+#define RETVAL_NEG_HUGE_VALD *(double *)retval = double_neg_inf.num
+#define RETVAL_HUGED *(double *)retval = (double)float_huge.num
+#define RETVAL_NEG_HUGED *(double *)retval = (double)float_neg_huge.num
-#define RETVAL_HUGE_VALF *(float *)retval = *(float *) float_inf
-#define RETVAL_NEG_HUGE_VALF *(float *)retval = *(float *) float_neg_inf
-#define RETVAL_HUGEF *(float *)retval = *(float *) float_huge
-#define RETVAL_NEG_HUGEF *(float *)retval = *(float *) float_neg_huge
+#define RETVAL_HUGE_VALF *(float *)retval = float_inf.num
+#define RETVAL_NEG_HUGE_VALF *(float *)retval = float_neg_inf.num
+#define RETVAL_HUGEF *(float *)retval = float_huge.num
+#define RETVAL_NEG_HUGEF *(float *)retval = float_neg_huge.num
-#define ZEROL_VALUE *(long double *)long_double_zero
-#define ZEROD_VALUE *(double *)double_zero
-#define ZEROF_VALUE *(float *)float_zero
+#define ZEROL_VALUE long_double_zero.num
+#define ZEROD_VALUE double_zero.num
+#define ZEROF_VALUE float_zero.num
-#define RETVAL_ZEROL *(long double *)retval = *(long double *)long_double_zero
-#define RETVAL_ZEROD *(double *)retval = *(double *)double_zero
-#define RETVAL_ZEROF *(float *)retval = *(float *)float_zero
+#define RETVAL_ZEROL *(long double *)retval = long_double_zero.num
+#define RETVAL_ZEROD *(double *)retval = double_zero.num
+#define RETVAL_ZEROF *(float *)retval = float_zero.num
-#define RETVAL_NEG_ZEROL *(long double *)retval = *(long double *)long_double_neg_zero
-#define RETVAL_NEG_ZEROD *(double *)retval = *(double *)double_neg_zero
-#define RETVAL_NEG_ZEROF *(float *)retval = *(float *)float_neg_zero
+#define RETVAL_NEG_ZEROL *(long double *)retval = long_double_neg_zero.num
+#define RETVAL_NEG_ZEROD *(double *)retval = double_neg_zero.num
+#define RETVAL_NEG_ZEROF *(float *)retval = float_neg_zero.num
#define RETVAL_ONEL *(long double *)retval = (long double) 1.0
#define RETVAL_ONED *(double *)retval = 1.0
diff --git a/ports/sysdeps/ia64/memchr.S b/ports/sysdeps/ia64/memchr.S
index f23a41cb76..6102644071 100644
--- a/ports/sysdeps/ia64/memchr.S
+++ b/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/ports/sysdeps/m68k/memchr.S b/ports/sysdeps/m68k/memchr.S
index a15ebded00..07b102523d 100644
--- a/ports/sysdeps/m68k/memchr.S
+++ b/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/ports/sysdeps/mips/__longjmp.c b/ports/sysdeps/mips/__longjmp.c
index a9efb0dac4..67bdb86cf8 100644
--- a/ports/sysdeps/mips/__longjmp.c
+++ b/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/ports/sysdeps/mips/abort-instr.h b/ports/sysdeps/mips/abort-instr.h
index d7d8d501b3..7ccae5736b 100644
--- a/ports/sysdeps/mips/abort-instr.h
+++ b/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/ports/sysdeps/mips/add_n.S b/ports/sysdeps/mips/add_n.S
index 7a3848f600..e83fc81707 100644
--- a/ports/sysdeps/mips/add_n.S
+++ b/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/ports/sysdeps/mips/bits/atomic.h b/ports/sysdeps/mips/bits/atomic.h
index 566b3dd2b8..bdc3acef7b 100644
--- a/ports/sysdeps/mips/bits/atomic.h
+++ b/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/ports/sysdeps/mips/bits/nan.h b/ports/sysdeps/mips/bits/nan.h
index ffbb3b5d5d..80f7866a97 100644
--- a/ports/sysdeps/mips/bits/nan.h
+++ b/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. IEEE 754-1985 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
@@ -42,13 +43,14 @@
# include <endian.h>
# if __BYTE_ORDER == __BIG_ENDIAN
-# define __nan_bytes { 0x7f, 0xbf, 0xff, 0xff }
+# define __qnan_bytes { 0x7f, 0xbf, 0xff, 0xff }
# endif
# if __BYTE_ORDER == __LITTLE_ENDIAN
-# define __nan_bytes { 0xff, 0xff, 0xbf, 0x7f }
+# define __qnan_bytes { 0xff, 0xff, 0xbf, 0x7f }
# endif
-static union { unsigned char __c[4]; float __d; } __nan_union = { __nan_bytes };
-# define NAN (__nan_union.__d)
+static union { unsigned char __c[4]; float __d; } __qnan_union
+ __attribute__ ((__unused__)) = { __qnan_bytes };
+# define NAN (__qnan_union.__d)
#endif /* GCC. */
diff --git a/ports/sysdeps/mips/bsd-_setjmp.S b/ports/sysdeps/mips/bsd-_setjmp.S
index a932096a0a..50cce7e725 100644
--- a/ports/sysdeps/mips/bsd-_setjmp.S
+++ b/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/ports/sysdeps/mips/bsd-setjmp.S b/ports/sysdeps/mips/bsd-setjmp.S
index 406c8492dd..18e8b0f908 100644
--- a/ports/sysdeps/mips/bsd-setjmp.S
+++ b/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/ports/sysdeps/mips/dl-machine.h b/ports/sysdeps/mips/dl-machine.h
index 91f7a7bb5e..a7c784fec5 100644
--- a/ports/sysdeps/mips/dl-machine.h
+++ b/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/ports/sysdeps/mips/dl-trampoline.c b/ports/sysdeps/mips/dl-trampoline.c
index 57fb05b86d..605e44e181 100644
--- a/ports/sysdeps/mips/dl-trampoline.c
+++ b/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/ports/sysdeps/mips/fpu/e_sqrt.c b/ports/sysdeps/mips/fpu/e_sqrt.c
index cff9cec6ec..26314b0109 100644
--- a/ports/sysdeps/mips/fpu/e_sqrt.c
+++ b/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/ports/sysdeps/mips/fpu/e_sqrtf.c b/ports/sysdeps/mips/fpu/e_sqrtf.c
index 87d242d82c..0f7bfd94ba 100644
--- a/ports/sysdeps/mips/fpu/e_sqrtf.c
+++ b/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/ports/sysdeps/mips/fpu_control.h b/ports/sysdeps/mips/fpu_control.h
index 30e54f9c3a..6aecb3bc8b 100644
--- a/ports/sysdeps/mips/fpu_control.h
+++ b/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/ports/sysdeps/mips/include/sys/asm.h b/ports/sysdeps/mips/include/sys/asm.h
new file mode 100644
index 0000000000..7b356e12e0
--- /dev/null
+++ b/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/ports/sysdeps/mips/machine-gmon.h b/ports/sysdeps/mips/machine-gmon.h
index 8c62d84a93..144c044026 100644
--- a/ports/sysdeps/mips/machine-gmon.h
+++ b/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/ports/sysdeps/mips/memset.S b/ports/sysdeps/mips/memset.S
index 8c8606c834..78dab481dd 100644
--- a/ports/sysdeps/mips/memset.S
+++ b/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/ports/sysdeps/mips/mips32/crti.S b/ports/sysdeps/mips/mips32/crti.S
index 5b46279c1e..5f3e9ba43d 100644
--- a/ports/sysdeps/mips/mips32/crti.S
+++ b/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/ports/sysdeps/mips/mips32/crtn.S b/ports/sysdeps/mips/mips32/crtn.S
index 44cdff0a1a..42381c5129 100644
--- a/ports/sysdeps/mips/mips32/crtn.S
+++ b/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/ports/sysdeps/mips/mips32/fpu/Versions b/ports/sysdeps/mips/mips32/fpu/Versions
new file mode 100644
index 0000000000..91bbf564b3
--- /dev/null
+++ b/ports/sysdeps/mips/mips32/fpu/Versions
@@ -0,0 +1,5 @@
+libc {
+ GLIBC_2.18 {
+ __mips_fpu_getcw; __mips_fpu_setcw;
+ }
+}
diff --git a/ports/sysdeps/mips/mips32/fpu/fpu_control.c b/ports/sysdeps/mips/mips32/fpu/fpu_control.c
new file mode 100644
index 0000000000..cd107c533a
--- /dev/null
+++ b/ports/sysdeps/mips/mips32/fpu/fpu_control.c
@@ -0,0 +1,34 @@
+/* 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.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math/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/ports/sysdeps/mips/mips32/mips16/add_n.c b/ports/sysdeps/mips/mips32/mips16/add_n.c
new file mode 100644
index 0000000000..fbb4120418
--- /dev/null
+++ b/ports/sysdeps/mips/mips32/mips16/add_n.c
@@ -0,0 +1 @@
+#include <stdlib/add_n.c>
diff --git a/ports/sysdeps/mips/mips32/mips16/addmul_1.c b/ports/sysdeps/mips/mips32/mips16/addmul_1.c
new file mode 100644
index 0000000000..c0e4a0bd7e
--- /dev/null
+++ b/ports/sysdeps/mips/mips32/mips16/addmul_1.c
@@ -0,0 +1 @@
+#include <stdlib/addmul_1.c>
diff --git a/ports/sysdeps/mips/mips32/mips16/fpu/Makefile b/ports/sysdeps/mips/mips32/mips16/fpu/Makefile
new file mode 100644
index 0000000000..b58c4eeb0c
--- /dev/null
+++ b/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/ports/sysdeps/mips/mips32/mips16/lshift.c b/ports/sysdeps/mips/mips32/mips16/lshift.c
new file mode 100644
index 0000000000..2f945d2c59
--- /dev/null
+++ b/ports/sysdeps/mips/mips32/mips16/lshift.c
@@ -0,0 +1 @@
+#include <stdlib/lshift.c>
diff --git a/ports/sysdeps/mips/mips32/mips16/mul_1.c b/ports/sysdeps/mips/mips32/mips16/mul_1.c
new file mode 100644
index 0000000000..8e758d6039
--- /dev/null
+++ b/ports/sysdeps/mips/mips32/mips16/mul_1.c
@@ -0,0 +1 @@
+#include <stdlib/mul_1.c>
diff --git a/ports/sysdeps/mips/mips32/mips16/rshift.c b/ports/sysdeps/mips/mips32/mips16/rshift.c
new file mode 100644
index 0000000000..4e350a0dcb
--- /dev/null
+++ b/ports/sysdeps/mips/mips32/mips16/rshift.c
@@ -0,0 +1 @@
+#include <stdlib/rshift.c>
diff --git a/ports/sysdeps/mips/mips32/mips16/sub_n.c b/ports/sysdeps/mips/mips32/mips16/sub_n.c
new file mode 100644
index 0000000000..d8b54925b1
--- /dev/null
+++ b/ports/sysdeps/mips/mips32/mips16/sub_n.c
@@ -0,0 +1 @@
+#include <stdlib/sub_n.c>
diff --git a/ports/sysdeps/mips/mips32/mips16/submul_1.c b/ports/sysdeps/mips/mips32/mips16/submul_1.c
new file mode 100644
index 0000000000..44cadf5cc0
--- /dev/null
+++ b/ports/sysdeps/mips/mips32/mips16/submul_1.c
@@ -0,0 +1 @@
+#include <stdlib/submul_1.c>
diff --git a/ports/sysdeps/mips/mips64/add_n.S b/ports/sysdeps/mips/mips64/add_n.S
index efb6cf4240..020d4af090 100644
--- a/ports/sysdeps/mips/mips64/add_n.S
+++ b/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/ports/sysdeps/mips/mips64/addmul_1.S b/ports/sysdeps/mips/mips64/addmul_1.S
index 43838fd2f9..46729a65d9 100644
--- a/ports/sysdeps/mips/mips64/addmul_1.S
+++ b/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/ports/sysdeps/mips/mips64/bsd-_setjmp.S b/ports/sysdeps/mips/mips64/bsd-_setjmp.S
index de36cf0e89..5d0f76c13c 100644
--- a/ports/sysdeps/mips/mips64/bsd-_setjmp.S
+++ b/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/ports/sysdeps/mips/mips64/bsd-setjmp.S b/ports/sysdeps/mips/mips64/bsd-setjmp.S
index c3e26bfc22..784e16e33f 100644
--- a/ports/sysdeps/mips/mips64/bsd-setjmp.S
+++ b/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/ports/sysdeps/mips/mips64/lshift.S b/ports/sysdeps/mips/mips64/lshift.S
index e0b02bc25b..740408d75a 100644
--- a/ports/sysdeps/mips/mips64/lshift.S
+++ b/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/ports/sysdeps/mips/mips64/mul_1.S b/ports/sysdeps/mips/mips64/mul_1.S
index 2fe28d369d..e1360658ae 100644
--- a/ports/sysdeps/mips/mips64/mul_1.S
+++ b/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/ports/sysdeps/mips/mips64/n32/crti.S b/ports/sysdeps/mips/mips64/n32/crti.S
index d9066b2d64..ddcc9cc7f5 100644
--- a/ports/sysdeps/mips/mips64/n32/crti.S
+++ b/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/ports/sysdeps/mips/mips64/n32/crtn.S b/ports/sysdeps/mips/mips64/n32/crtn.S
index daf7d4256d..5eb2b4f489 100644
--- a/ports/sysdeps/mips/mips64/n32/crtn.S
+++ b/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/ports/sysdeps/mips/mips64/n64/crti.S b/ports/sysdeps/mips/mips64/n64/crti.S
index 2111ba5394..0c66d0de6f 100644
--- a/ports/sysdeps/mips/mips64/n64/crti.S
+++ b/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/ports/sysdeps/mips/mips64/n64/crtn.S b/ports/sysdeps/mips/mips64/n64/crtn.S
index c66a2e5550..4c014b711b 100644
--- a/ports/sysdeps/mips/mips64/n64/crtn.S
+++ b/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/ports/sysdeps/mips/mips64/rshift.S b/ports/sysdeps/mips/mips64/rshift.S
index 75ac68bb2e..0d821f2b79 100644
--- a/ports/sysdeps/mips/mips64/rshift.S
+++ b/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/ports/sysdeps/mips/mips64/setjmp.S b/ports/sysdeps/mips/mips64/setjmp.S
index 53ed92ca49..5afbbe7562 100644
--- a/ports/sysdeps/mips/mips64/setjmp.S
+++ b/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/ports/sysdeps/mips/mips64/sub_n.S b/ports/sysdeps/mips/mips64/sub_n.S
index ea8f4bd4cb..dd6f691841 100644
--- a/ports/sysdeps/mips/mips64/sub_n.S
+++ b/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/ports/sysdeps/mips/mips64/submul_1.S b/ports/sysdeps/mips/mips64/submul_1.S
index 22239d52b3..bf5d6ffce0 100644
--- a/ports/sysdeps/mips/mips64/submul_1.S
+++ b/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/ports/sysdeps/mips/nptl/tls.h b/ports/sysdeps/mips/nptl/tls.h
index 0c91995342..2529408f2f 100644
--- a/ports/sysdeps/mips/nptl/tls.h
+++ b/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/ports/sysdeps/mips/preconfigure b/ports/sysdeps/mips/preconfigure
index 9190eee87a..b215eb2c17 100644
--- a/ports/sysdeps/mips/preconfigure
+++ b/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/ports/sysdeps/mips/setjmp.S b/ports/sysdeps/mips/setjmp.S
index 7c53b97b2d..f014b73b3f 100644
--- a/ports/sysdeps/mips/setjmp.S
+++ b/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/ports/sysdeps/mips/setjmp_aux.c b/ports/sysdeps/mips/setjmp_aux.c
index a955a4ffa1..cb9ea245bb 100644
--- a/ports/sysdeps/mips/setjmp_aux.c
+++ b/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/ports/sysdeps/mips/start.S b/ports/sysdeps/mips/start.S
index 82b7a229f3..83a68959a3 100644
--- a/ports/sysdeps/mips/start.S
+++ b/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/ports/sysdeps/mips/sys/asm.h b/ports/sysdeps/mips/sys/asm.h
index 605451a884..293cf364e0 100644
--- a/ports/sysdeps/mips/sys/asm.h
+++ b/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/ports/sysdeps/mips/sys/tas.h b/ports/sysdeps/mips/sys/tas.h
index 603346ac3b..871818565e 100644
--- a/ports/sysdeps/mips/sys/tas.h
+++ b/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/ports/sysdeps/mips/tls-macros.h b/ports/sysdeps/mips/tls-macros.h
index 8fe2e4a150..3e87e42ea1 100644
--- a/ports/sysdeps/mips/tls-macros.h
+++ b/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/ports/sysdeps/powerpc/nofpu/fegetenv.c b/ports/sysdeps/powerpc/nofpu/fegetenv.c
index 75e89408df..51bcef30a1 100644
--- a/ports/sysdeps/powerpc/nofpu/fegetenv.c
+++ b/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/ports/sysdeps/powerpc/nofpu/fesetenv.c b/ports/sysdeps/powerpc/nofpu/fesetenv.c
index 810e1da56e..3f35909b6d 100644
--- a/ports/sysdeps/powerpc/nofpu/fesetenv.c
+++ b/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/ports/sysdeps/powerpc/nofpu/feupdateenv.c b/ports/sysdeps/powerpc/nofpu/feupdateenv.c
index 94366a8d5e..163f673102 100644
--- a/ports/sysdeps/powerpc/nofpu/feupdateenv.c
+++ b/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/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c b/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c
index e8b2a3a48c..2373fa4002 100644
--- a/ports/sysdeps/powerpc/nofpu/fgetexcptflg.c
+++ b/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/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c b/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c
index a0861d4a2b..cd142b60be 100644
--- a/ports/sysdeps/powerpc/nofpu/fraiseexcpt.c
+++ b/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/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c b/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c
index 108df304c9..3dc368fdda 100644
--- a/ports/sysdeps/powerpc/nofpu/fsetexcptflg.c
+++ b/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/ports/sysdeps/powerpc/powerpc32/405/memcmp.S b/ports/sysdeps/powerpc/powerpc32/405/memcmp.S
index 6a6439f5c6..2849461cd7 100644
--- a/ports/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/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/ports/sysdeps/powerpc/powerpc32/405/memcpy.S b/ports/sysdeps/powerpc/powerpc32/405/memcpy.S
index bca4f74bc4..761e9675af 100644
--- a/ports/sysdeps/powerpc/powerpc32/405/memcpy.S
+++ b/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/ports/sysdeps/powerpc/powerpc32/405/memset.S b/ports/sysdeps/powerpc/powerpc32/405/memset.S
index d07a976da0..b73dba8873 100644
--- a/ports/sysdeps/powerpc/powerpc32/405/memset.S
+++ b/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/ports/sysdeps/powerpc/powerpc32/405/strcmp.S b/ports/sysdeps/powerpc/powerpc32/405/strcmp.S
index faa7cf33bb..c0b21907be 100644
--- a/ports/sysdeps/powerpc/powerpc32/405/strcmp.S
+++ b/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/ports/sysdeps/powerpc/powerpc32/405/strcpy.S b/ports/sysdeps/powerpc/powerpc32/405/strcpy.S
index 88f8c8ea71..d7c84569d9 100644
--- a/ports/sysdeps/powerpc/powerpc32/405/strcpy.S
+++ b/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/ports/sysdeps/powerpc/powerpc32/405/strlen.S b/ports/sysdeps/powerpc/powerpc32/405/strlen.S
index e267f4dfca..77d22ea673 100644
--- a/ports/sysdeps/powerpc/powerpc32/405/strlen.S
+++ b/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/ports/sysdeps/powerpc/powerpc32/405/strncmp.S b/ports/sysdeps/powerpc/powerpc32/405/strncmp.S
index a613869b78..3e2ba5f855 100644
--- a/ports/sysdeps/powerpc/powerpc32/405/strncmp.S
+++ b/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/ports/sysdeps/powerpc/powerpc32/476/memset.S b/ports/sysdeps/powerpc/powerpc32/476/memset.S
index f681a898d9..48c21d6209 100644
--- a/ports/sysdeps/powerpc/powerpc32/476/memset.S
+++ b/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/ports/sysdeps/unix/alpha/sysdep.h b/ports/sysdeps/unix/alpha/sysdep.h
index 3b71a5ec6c..d20bcd6d31 100644
--- a/ports/sysdeps/unix/alpha/sysdep.h
+++ b/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/ports/sysdeps/unix/arm/sysdep.S b/ports/sysdeps/unix/arm/sysdep.S
index da07d85f18..d82ad258a0 100644
--- a/ports/sysdeps/unix/arm/sysdep.S
+++ b/ports/sysdeps/unix/arm/sysdep.S
@@ -31,33 +31,30 @@ __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
- mov ip, lr
- cfi_register (lr, ip)
- mov r1, r0
-
- mov r0, #0xffff0fff
- mov lr, pc
- sub pc, r0, #31
-
- ldr r2, 1f
-2: ldr r2, [pc, r2]
- str r1, [r0, r2]
- mvn r0, #0
- RETINSTR (, ip)
+ mov r1, r0
+ GET_TLS (r2)
+ ldr r2, 1f
+#ifdef __thumb__
+2: add r2, r2, pc
+ ldr r2, [r2]
+#else
+2: ldr r2, [pc, r2]
+#endif
+ str r1, [r0, r2]
+ mvn r0, #0
+ DO_RET(lr)
-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
+ LDST_PCREL(str, r0, r1, C_SYMBOL_NAME(rtld_errno))
+ mvn r0, #0
DO_RET(r14)
-
-1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8
#else
#error "Unsupported non-TLS case"
#endif
diff --git a/ports/sysdeps/unix/mips/mips32/sysdep.h b/ports/sysdeps/unix/mips/mips32/sysdep.h
index d7d389253d..5d96d05c65 100644
--- a/ports/sysdeps/unix/mips/mips32/sysdep.h
+++ b/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/ports/sysdeps/unix/mips/mips64/n32/sysdep.h b/ports/sysdeps/unix/mips/mips64/n32/sysdep.h
index 37a67a2e69..c55b95cc2a 100644
--- a/ports/sysdeps/unix/mips/mips64/n32/sysdep.h
+++ b/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/ports/sysdeps/unix/mips/mips64/n64/sysdep.h b/ports/sysdeps/unix/mips/mips64/n64/sysdep.h
index 871184bd0f..445e6ff738 100644
--- a/ports/sysdeps/unix/mips/mips64/n64/sysdep.h
+++ b/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/ports/sysdeps/unix/mips/sysdep.S b/ports/sysdeps/unix/mips/sysdep.S
index e778918573..e27aada1db 100644
--- a/ports/sysdeps/unix/mips/sysdep.S
+++ b/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/ports/sysdeps/unix/mips/sysdep.h b/ports/sysdeps/unix/mips/sysdep.h
index bab3bc04c9..4d7667ea9c 100644
--- a/ports/sysdeps/unix/mips/sysdep.h
+++ b/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/ports/sysdeps/unix/sysv/linux/aarch64/bits/mman.h b/ports/sysdeps/unix/sysv/linux/aarch64/bits/mman.h
index 67c563ce2b..770607b83e 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/bits/mman.h
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/bits/mman.h
@@ -25,38 +25,8 @@
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
-
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-#endif
-
-#ifdef __USE_MISC
/* These are Linux-specific. */
+#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
# define MAP_DENYWRITE 0x00800 /* ETXTBSY */
# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
@@ -68,47 +38,7 @@
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
-/* Flags for `mlockall'. */
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 2 /* Lock all additions to address
- space. */
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
-# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
-# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
-# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
-# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
-# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
- overrides the coredump filter bits. */
-# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
-# define MADV_HWPOISON 100 /* Poison a page for testing. */
-#endif
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/configure b/ports/sysdeps/unix/sysv/linux/aarch64/configure
index 5a22126fe8..6b2608acd7 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/configure
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/configure
@@ -1,3 +1,17 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
+ # Local configure fragment for sysdeps/unix/sysv/linux/aarch64.
arch_minimum_kernel=3.7.0
+
+test -n "$libc_cv_slibdir" ||
+case "$prefix" in
+ /usr | /usr/)
+ libc_cv_slibdir="/lib64"
+ libc_cv_rtlddir="/lib"
+ if test "$libdir" = '${exec_prefix}/lib'; then
+ libdir='${exec_prefix}/lib64';
+ # Locale data can be shared between 32bit and 64bit libraries
+ libc_cv_localedir='${exec_prefix}/lib/locale'
+ fi
+ ;;
+esac
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/configure.in b/ports/sysdeps/unix/sysv/linux/aarch64/configure.in
index d1995d486d..b090702134 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/configure.in
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/configure.in
@@ -2,3 +2,16 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/unix/sysv/linux/aarch64.
arch_minimum_kernel=3.7.0
+
+test -n "$libc_cv_slibdir" ||
+case "$prefix" in
+ /usr | /usr/)
+ libc_cv_slibdir="/lib64"
+ libc_cv_rtlddir="/lib"
+ if test "$libdir" = '${exec_prefix}/lib'; then
+ libdir='${exec_prefix}/lib64';
+ # Locale data can be shared between 32bit and 64bit libraries
+ libc_cv_localedir='${exec_prefix}/lib/locale'
+ fi
+ ;;
+esac
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c b/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
index 1da284dec8..4d1ec3b101 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
+++ b/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/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist
index f83e8806a7..b04a761fed 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist
index 031c70e8ab..696158aef7 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist
@@ -73,7 +73,6 @@ GLIBC_2.17
pause F
pread F
pread64 F
- pthread_atfork F
pthread_attr_destroy F
pthread_attr_getaffinity_np F
pthread_attr_getdetachstate F
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c b/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c
index 74b6675647..dbaa2246b7 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/sigaction.c
+++ b/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/ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h
index 2238c2c72b..c51b05d37f 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h
+++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/mman.h
@@ -51,6 +51,9 @@
# define MAP_FILE 0
# define MAP_ANONYMOUS 0x10 /* Don't use a file. */
# define MAP_ANON MAP_ANONYMOUS
+/* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */
+# define MAP_HUGE_SHIFT 26
+# define MAP_HUGE_MASK 0x3f
#endif
/* Not used by Linux, but here to make sure we don't clash with
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/msq.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/msq.h
index 1b07465d45..8bb057b4ee 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/msq.h
+++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/msq.h
@@ -25,6 +25,7 @@
#define MSG_NOERROR 010000 /* no error if message is too big */
#ifdef __USE_GNU
# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+# define MSG_COPY 040000 /* copy (not remove) all queue messages */
#endif
/* Types used in the structure definition. */
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c b/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c
index 1906741721..fdcad0bfbb 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c
+++ b/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/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c b/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c
index d6439505ec..48f3cec9d9 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/gethostname.c
+++ b/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/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c b/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c
index b4633f4135..dbd03c1b2c 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/msgctl.c
+++ b/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/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist
index 1d0cc7ec31..980e08857a 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
index e50324cdd7..cf6b8bfd9b 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
+++ b/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/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c b/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c
index 5e52200442..f2217a2b5a 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/shmctl.c
+++ b/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/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c b/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c
index 77c0115c4b..ad3860dfc0 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/sigaction.c
+++ b/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/ports/sysdeps/unix/sysv/linux/am33/bits/mman.h b/ports/sysdeps/unix/sysv/linux/am33/bits/mman.h
index 5dd8ae13fc..a6e85f99d0 100644
--- a/ports/sysdeps/unix/sysv/linux/am33/bits/mman.h
+++ b/ports/sysdeps/unix/sysv/linux/am33/bits/mman.h
@@ -24,35 +24,6 @@
But the kernel header is not namespace clean. */
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-#endif
-
/* These are Linux-specific. */
#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */
@@ -62,35 +33,5 @@
# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
-/* Flags for `mlockall'. */
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 2 /* Lock all additions to address
- space. */
-
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
-
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
diff --git a/ports/sysdeps/unix/sysv/linux/am33/brk.c b/ports/sysdeps/unix/sysv/linux/am33/brk.c
index 51b59adc9d..8fd2ff01d9 100644
--- a/ports/sysdeps/unix/sysv/linux/am33/brk.c
+++ b/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/ports/sysdeps/unix/sysv/linux/am33/clone.S b/ports/sysdeps/unix/sysv/linux/am33/clone.S
index 151950c5db..cece99bf34 100644
--- a/ports/sysdeps/unix/sysv/linux/am33/clone.S
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/Makefile b/ports/sysdeps/unix/sysv/linux/arm/Makefile
index be7946e966..aa7526a258 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/Makefile
+++ b/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)
@@ -70,9 +70,6 @@ LDFLAGS-tst-rfc3484-2 += $(common-objpfx)csu/libc-do-syscall.o
LDFLAGS-tst-rfc3484-3 += $(common-objpfx)csu/libc-do-syscall.o
endif
-# Get value of default-abi.
-include $(common-objpfx)default-abi.make
-
abi-variants := soft hard
ifeq (,$(filter $(default-abi),$(abi-variants)))
diff --git a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
index bdcfa206ec..6ee7a1aebd 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
+++ b/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
@@ -51,7 +53,7 @@ longjmp_msg:
cfi_remember_state; \
cmp sp, reg; \
bls .Lok; \
- str r7, [sp, #-4]!; \
+ push { r7 }; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (r7, 0); \
mov r5, r0; \
@@ -77,7 +79,7 @@ longjmp_msg:
.Lfail: \
add sp, sp, #12; \
cfi_adjust_cfa_offset (-12); \
- ldr r7, [sp], #4; \
+ pop { r7 }; \
cfi_adjust_cfa_offset (-4); \
cfi_restore (r7); \
CALL_FAIL \
diff --git a/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S b/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
index c4ddbc69ff..21e322986a 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
@@ -41,6 +41,15 @@
.hidden __aeabi_read_tp
ENTRY (__aeabi_read_tp)
+#ifdef ARCH_HAS_HARD_TP
+ mrc p15, 0, r0, c13, c0, 3
+ bx lr
+#elif defined(__thumb2__)
+ movw r0, #0x0fe0
+ movt r0, #0xffff
+ bx r0
+#else
mov r0, #0xffff0fff
sub pc, r0, #31
+#endif
END (__aeabi_read_tp)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/bits/mman.h b/ports/sysdeps/unix/sysv/linux/arm/bits/mman.h
index f5ca3c9b6e..11ecbca03a 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/bits/mman.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/bits/mman.h
@@ -23,36 +23,6 @@
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
-
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-#endif
-
/* These are Linux-specific. */
#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
@@ -66,47 +36,5 @@
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
-/* Flags for `mlockall'. */
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 2 /* Lock all additions to address
- space. */
-
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
-# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
-# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
-# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
-# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
-# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
- overrides the coredump filter bits. */
-# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
-# define MADV_HWPOISON 100 /* Poison a page for testing. */
-#endif
-
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
diff --git a/ports/sysdeps/unix/sysv/linux/arm/clone.S b/ports/sysdeps/unix/sysv/linux/arm/clone.S
index de25db1609..ce9c2a5ba1 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/clone.S
+++ b/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)
@@ -48,7 +49,7 @@ ENTRY(__clone)
mov ip, r2
#endif
@ new sp is already in r1
- stmfd sp!, {r4, r7}
+ push {r4, r7}
cfi_adjust_cfa_offset (8)
cfi_rel_offset (r4, 0)
cfi_rel_offset (r7, 4)
@@ -60,7 +61,7 @@ ENTRY(__clone)
cfi_endproc
cmp r0, #0
beq 1f
- ldmfd sp!, {r4, r7}
+ pop {r4, r7}
blt PLTJMP(C_SYMBOL_NAME(__syscall_error))
RETINSTR(, lr)
@@ -73,16 +74,16 @@ PSEUDO_END (__clone)
#ifdef RESET_PID
tst ip, #CLONE_THREAD
bne 3f
- mov r0, #0xffff0fff
- mov lr, pc
- sub pc, r0, #31
+ GET_TLS (lr)
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]
+ NEGOFF_ADJ_BASE (r1, TID_OFFSET)
+ str r0, NEGOFF_OFF1 (r1, TID_OFFSET)
+ str r0, NEGOFF_OFF2 (r1, PID_OFFSET, TID_OFFSET)
3:
#endif
@ pick the function arg and call address off the stack and execute
diff --git a/ports/sysdeps/unix/sysv/linux/arm/configure b/ports/sysdeps/unix/sysv/linux/arm/configure
index cb94cc5eb4..f66b158289 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/configure
+++ b/ports/sysdeps/unix/sysv/linux/arm/configure
@@ -2,4 +2,5 @@
# Local configure fragment for sysdeps/unix/sysv/linux/arm.
libc_cv_gcc_unwind_find_fde=no
+# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.in.
CFLAGS=${CFLAGS% -fno-unwind-tables}
diff --git a/ports/sysdeps/unix/sysv/linux/arm/configure.in b/ports/sysdeps/unix/sysv/linux/arm/configure.in
index 3e67dee425..8fffe94051 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/configure.in
+++ b/ports/sysdeps/unix/sysv/linux/arm/configure.in
@@ -2,4 +2,5 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/unix/sysv/linux/arm.
libc_cv_gcc_unwind_find_fde=no
+# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.in.
CFLAGS=${CFLAGS% -fno-unwind-tables}
diff --git a/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h b/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
index acc4f28645..504fecab58 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/getcontext.S b/ports/sysdeps/unix/sysv/linux/arm/getcontext.S
index f7857c1996..fa00c0b789 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/getcontext.S
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/mmap.S b/ports/sysdeps/unix/sysv/linux/arm/mmap.S
index fa8a2b86c8..06b737eebe 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/mmap.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/mmap.S
@@ -23,11 +23,11 @@
ENTRY (__mmap)
/* shuffle args */
- str r5, [sp, #-4]!
+ push { r5 }
cfi_adjust_cfa_offset (4)
cfi_rel_offset (r5, 0)
ldr r5, [sp, #8]
- str r4, [sp, #-4]!
+ push { r4 }
cfi_adjust_cfa_offset (4)
cfi_rel_offset (r4, 0)
cfi_remember_state
@@ -43,14 +43,15 @@ ENTRY (__mmap)
/* restore registers */
2:
- ldr r4, [sp], #4
+ pop { r4 }
cfi_adjust_cfa_offset (-4)
cfi_restore (r4)
- ldr r5, [sp], #4
+ pop { r5 }
cfi_adjust_cfa_offset (-4)
cfi_restore (r5)
cmn r0, $4096
+ it cc
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/mmap64.S b/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
index 2eafd1b413..d039129b29 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
@@ -17,6 +17,8 @@
#include <sysdep.h>
+ .syntax unified
+
#define EINVAL 22
#ifdef __ARMEB__
@@ -32,33 +34,35 @@
.text
ENTRY (__mmap64)
ldr ip, [sp, $LOW_OFFSET]
- str r5, [sp, #-4]!
+ push { r5 }
cfi_adjust_cfa_offset (4)
cfi_rel_offset (r5, 0)
ldr r5, [sp, $HIGH_OFFSET]
- str r4, [sp, #-4]!
+ push { r4 }
cfi_adjust_cfa_offset (4)
cfi_rel_offset (r4, 0)
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
DO_CALL (mmap2, 0)
cmn r0, $4096
- ldmfd sp!, {r4, r5}
+ pop {r4, r5}
cfi_adjust_cfa_offset (-8)
cfi_restore (r4)
cfi_restore (r5)
+ it cc
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
cfi_restore_state
.Linval:
mov r0, $-EINVAL
- ldmfd sp!, {r4, r5}
+ pop {r4, r5}
cfi_adjust_cfa_offset (-8)
cfi_restore (r4)
cfi_restore (r5)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist
index ceab6b2cd9..ce45208b5f 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist
index 6c0bbde672..de8095a606 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist
@@ -83,7 +83,6 @@ GLIBC_2.4
pause F
pread F
pread64 F
- pthread_atfork F
pthread_attr_destroy F
pthread_attr_getaffinity_np F
pthread_attr_getdetachstate F
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
index 0278812f7c..fe21cdaf29 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S
index a38d56419c..ca50457070 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/pt-vfork.S
@@ -19,23 +19,16 @@
/* Save the PID value. */
#define SAVE_PID \
- str lr, [sp, #-4]!; /* Save LR. */ \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (lr, 0); \
- mov r0, #0xffff0fff; /* Point to the high page. */ \
- mov lr, pc; /* Save our return address. */ \
- sub pc, r0, #31; /* Jump to the TLS entry. */ \
- ldr lr, [sp], #4; /* Restore LR. */ \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (lr); \
- mov r2, r0; /* Save the TLS addr in r2. */ \
- ldr r3, [r2, #PID_OFFSET]; /* Load the saved PID. */ \
- rsb r0, r3, #0; /* Negate it. */ \
- str r0, [r2, #PID_OFFSET] /* Store the temporary PID. */
+ GET_TLS (r2); \
+ NEGOFF_ADJ_BASE2 (r2, r0, PID_OFFSET); /* Save the TLS addr in r2. */ \
+ ldr r3, NEGOFF_OFF1 (r2, PID_OFFSET); /* Load the saved PID. */ \
+ rsb r0, r3, #0; /* Negate it. */ \
+ str r0, NEGOFF_OFF1 (r2, PID_OFFSET); /* Store the temp PID. */
/* Restore the old PID value in the parent. */
#define RESTORE_PID \
cmp r0, #0; /* If we are the parent... */ \
- strne r3, [r2, #PID_OFFSET] /* ... restore the saved PID. */
+ it ne; \
+ strne r3, NEGOFF_OFF1 (r2, PID_OFFSET); /* restore the saved PID. */
#include "../vfork.S"
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
index 1b0a2447f2..59b826ded4 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
@@ -30,161 +30,156 @@
# 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; \
+ 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}; \
+ push {lr}; \
+ 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 \
+ pop {lr}; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr)
+
+# define DOCARGS_1 \
+ .save {r7}; \
+ push {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}; \
+ push {r0, r1, lr}; \
+ cfi_adjust_cfa_offset (12); \
+ cfi_rel_offset (lr, 8); \
+ .save {lr}; \
+ .pad #8
+# define UNDOCARGS_2 \
+ pop {r0, r1}; \
+ cfi_adjust_cfa_offset (-8); \
+ RESTART_UNWIND
+# define RESTORE_LR_2 \
+ RESTORE_LR_0
+
+# define DOCARGS_3 \
+ .save {r7}; \
+ push {r0, r1, r2, r3, lr}; \
+ cfi_adjust_cfa_offset (20); \
+ cfi_rel_offset (lr, 16); \
+ .save {lr}; \
+ .pad #16
+# define UNDOCARGS_3 \
+ pop {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ RESTART_UNWIND
+# define RESTORE_LR_3 \
+ RESTORE_LR_0
+
+# define DOCARGS_4 \
+ .save {r7}; \
+ push {r0, r1, r2, r3, lr}; \
+ cfi_adjust_cfa_offset (20); \
+ cfi_rel_offset (lr, 16); \
+ .save {lr}; \
+ .pad #16
+# define UNDOCARGS_4 \
+ pop {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}; \
+ push {r0, r1, r2, r3, r4, lr}; \
+ cfi_adjust_cfa_offset (24); \
+ cfi_rel_offset (lr, 20); \
+ .save {lr}; \
+ .pad #20
+# define UNDOCARGS_5 \
+ pop {r0, r1, r2, r3}; \
+ cfi_adjust_cfa_offset (-16); \
+ .fnend; \
+ .fnstart; \
+ .save {r4, r7}; \
+ .save {lr}; \
+ .pad #4
+# define RESTORE_LR_5 \
+ pop {r4, lr}; \
+ cfi_adjust_cfa_offset (-8); \
+ /* r4 will be marked as restored later. */ \
+ cfi_restore (lr)
+
+# define DOCARGS_6 \
+ .save {r4, r5, r7}; \
+ push {r0, r1, r2, r3, lr}; \
+ cfi_adjust_cfa_offset (20); \
+ cfi_rel_offset (lr, 16); \
+ .save {lr}; \
+ .pad #16
+# define UNDOCARGS_6 \
+ pop {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 +202,8 @@ 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;
-# define PSEUDO_PROLOGUE \
- 1: .word __local_multiple_threads - 2f - 8;
+ LDST_PCREL(ldr, ip, ip, __local_multiple_threads); \
+ teq ip, #0
# endif
# else
/* There is no __local_multiple_threads for librt, so use the TCB. */
@@ -221,17 +212,17 @@ extern int __local_multiple_threads attribute_hidden;
__builtin_expect (THREAD_GETMEM (THREAD_SELF, \
header.multiple_threads) == 0, 1)
# 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
+ push {r0, lr}; \
+ cfi_adjust_cfa_offset (8); \
+ cfi_rel_offset (lr, 4); \
+ GET_TLS (lr); \
+ NEGOFF_ADJ_BASE (r0, MULTIPLE_THREADS_OFFSET); \
+ ldr ip, NEGOFF_OFF1 (r0, MULTIPLE_THREADS_OFFSET); \
+ pop {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/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
index 58ca9acf64..108924d8b3 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
@@ -84,13 +84,16 @@ __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"
"_Unwind_Resume:\n"
" .cfi_sections .debug_frame\n"
" " CFI_STARTPROC "\n"
-" stmfd sp!, {r4, r5, r6, lr}\n"
+" push {r4, r5, r6, lr}\n"
" " CFI_ADJUST_CFA_OFFSET (16)" \n"
" " CFI_REL_OFFSET (r4, 0) "\n"
" " CFI_REL_OFFSET (r5, 4) "\n"
@@ -105,7 +108,7 @@ asm (
" cmp r3, #0\n"
" beq 4f\n"
"5: mov r0, r6\n"
-" ldmfd sp!, {r4, r5, r6, lr}\n"
+" pop {r4, r5, r6, lr}\n"
" " CFI_ADJUST_CFA_OFFSET (-16) "\n"
" " CFI_RESTORE (r4) "\n"
" " CFI_RESTORE (r5) "\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/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
index 0a3ad953b8..d155ea7dc4 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
@@ -47,13 +47,16 @@ 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"
"_Unwind_Resume:\n"
" .cfi_sections .debug_frame\n"
" " CFI_STARTPROC "\n"
-" stmfd sp!, {r4, r5, r6, lr}\n"
+" push {r4, r5, r6, lr}\n"
" " CFI_ADJUST_CFA_OFFSET (16)" \n"
" " CFI_REL_OFFSET (r4, 0) "\n"
" " CFI_REL_OFFSET (r5, 4) "\n"
@@ -68,7 +71,7 @@ asm (
" cmp r3, #0\n"
" beq 4f\n"
"5: mov r0, r6\n"
-" ldmfd sp!, {r4, r5, r6, lr}\n"
+" pop {r4, r5, r6, lr}\n"
" " CFI_ADJUST_CFA_OFFSET (-16) "\n"
" " CFI_RESTORE (r4) "\n"
" " CFI_RESTORE (r5) "\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/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S b/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S
index 3fce2d1afa..216fb2d2eb 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/vfork.S
@@ -19,24 +19,18 @@
/* Save the PID value. */
#define SAVE_PID \
- str lr, [sp, #-4]!; /* Save LR. */ \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (lr, 0); \
- mov r0, #0xffff0fff; /* Point to the high page. */ \
- mov lr, pc; /* Save our return address. */ \
- sub pc, r0, #31; /* Jump to the TLS entry. */ \
- ldr lr, [sp], #4; /* Restore LR. */ \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (lr); \
- mov r2, r0; /* Save the TLS addr in r2. */ \
- ldr r3, [r2, #PID_OFFSET]; /* Load the saved PID. */ \
- rsbs r0, r3, #0; /* Negate it. */ \
- moveq r0, #0x80000000; /* Use 0x80000000 if it was 0. */ \
- str r0, [r2, #PID_OFFSET] /* Store the temporary PID. */
+ GET_TLS (r2); \
+ NEGOFF_ADJ_BASE2 (r2, r0, PID_OFFSET); /* Save the TLS addr in r2. */ \
+ ldr r3, NEGOFF_OFF1 (r2, PID_OFFSET); /* Load the saved PID. */ \
+ rsbs r0, r3, #0; /* Negate it. */ \
+ it eq; \
+ moveq r0, #0x80000000; /* Use 0x80000000 if it was 0. */ \
+ str r0, NEGOFF_OFF1 (r2, PID_OFFSET); /* Store the temp PID. */
/* Restore the old PID value in the parent. */
#define RESTORE_PID \
cmp r0, #0; /* If we are the parent... */ \
- strne r3, [r2, #PID_OFFSET] /* ... restore the saved PID. */
+ it ne; \
+ strne r3, NEGOFF_OFF1 (r2, PID_OFFSET); /* restore the saved PID. */
#include "../vfork.S"
diff --git a/ports/sysdeps/unix/sysv/linux/arm/pread.c b/ports/sysdeps/unix/sysv/linux/arm/pread.c
index dafee3d551..e178402a8c 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/pread.c
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/pread64.c b/ports/sysdeps/unix/sysv/linux/arm/pread64.c
index 6d1d9148aa..c7863a35c6 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/pread64.c
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/pwrite.c b/ports/sysdeps/unix/sysv/linux/arm/pwrite.c
index f188950af3..4ae2e83304 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/pwrite.c
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c b/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c
index 29c63ee33f..bd6fca5832 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/pwrite64.c
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/readelflib.c b/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
index 81e5ccb55f..3efb6134c3 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/setcontext.S b/ports/sysdeps/unix/sysv/linux/arm/setcontext.S
index 8e71f5b4e4..b3148c8943 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/setcontext.S
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/sigaction.c b/ports/sysdeps/unix/sysv/linux/arm/sigaction.c
index c039b857f0..21bf506ef7 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/sigaction.c
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/syscall.S b/ports/sysdeps/unix/sysv/linux/arm/syscall.S
index c6dd57d698..bdd5a52be8 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/syscall.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/syscall.S
@@ -23,7 +23,7 @@
ENTRY (syscall)
mov ip, sp
- stmfd sp!, {r4, r5, r6, r7}
+ push {r4, r5, r6, r7}
cfi_adjust_cfa_offset (16)
cfi_rel_offset (r4, 0)
cfi_rel_offset (r5, 4)
@@ -35,13 +35,14 @@ ENTRY (syscall)
mov r2, r3
ldmfd ip, {r3, r4, r5, r6}
swi 0x0
- ldmfd sp!, {r4, r5, r6, r7}
+ pop {r4, r5, r6, r7}
cfi_adjust_cfa_offset (-16)
cfi_restore (r4)
cfi_restore (r5)
cfi_restore (r6)
cfi_restore (r7)
cmn r0, #4096
+ it cc
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
PSEUDO_END (syscall)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/sysdep.h b/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
index 6b5bb14c95..b195d8ea1d 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -45,6 +45,38 @@
#ifdef __ASSEMBLER__
+#ifndef ARCH_HAS_HARD_TP
+/* Internal macro calling the linux kernel kuser_get_tls helper.
+ Note that in thumb mode, a constant pool break is often out of range, so
+ we always expand the constant inline. */
+# ifdef __thumb2__
+# define GET_TLS_BODY \
+ movw r0, #0x0fe0; \
+ movt r0, #0xffff; \
+ blx r0
+# else
+# define GET_TLS_BODY \
+ mov r0, #0xffff0fff; /* Point to the high page. */ \
+ mov lr, pc; /* Save our return address. */ \
+ sub pc, r0, #31 /* Jump to the TLS entry. */
+# endif
+
+/* Helper to get the TLS base pointer. Save LR in TMP, return in R0,
+ and no other registers clobbered. TMP may be LR itself to indicate
+ that no save is necessary. */
+# undef GET_TLS
+# define GET_TLS(TMP) \
+ .ifnc TMP, lr; \
+ mov TMP, lr; \
+ cfi_register (lr, TMP); \
+ GET_TLS_BODY; \
+ mov lr, TMP; \
+ cfi_restore (lr); \
+ .else; \
+ GET_TLS_BODY; \
+ .endif
+#endif /* ARCH_HAS_HARD_TP */
+
/* Linux uses a negative return value to indicate syscall errors,
unlike most Unices, which use the condition codes' carry flag.
@@ -57,49 +89,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
@@ -109,32 +142,29 @@
# if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_HANDLER \
__local_syscall_error: \
- ldr r1, 1f; \
- rsb r0, r0, #0; \
-0: str r0, [pc, r1]; \
- mvn r0, #0; \
- DO_RET(lr); \
-1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8;
+ rsb r0, r0, #0; \
+ LDST_PCREL(str, r0, r1, C_SYMBOL_NAME(rtld_errno)); \
+ mvn r0, #0; \
+ DO_RET(lr)
# else
# if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
# define POP_PC \
- ldr lr, [sp], #4; \
+ pop { lr }; \
cfi_adjust_cfa_offset (-4); \
cfi_restore (lr); \
bx lr
# else
-# define POP_PC \
- ldr pc, [sp], #4
+# define POP_PC pop { pc }
# endif
# define SYSCALL_ERROR_HANDLER \
__local_syscall_error: \
- str lr, [sp, #-4]!; \
+ push { lr }; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (lr, 0); \
- str r0, [sp, #-4]!; \
+ push { r0 }; \
cfi_adjust_cfa_offset (4); \
bl PLTJMP(C_SYMBOL_NAME(__errno_location)); \
- ldr r1, [sp], #4; \
+ pop { r1 }; \
cfi_adjust_cfa_offset (-4); \
rsb r1, r1, #0; \
str r1, [r0]; \
@@ -192,19 +222,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; \
+ push { r7 }; \
+ 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 +244,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; \
+ push {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; \
+ push {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; \
+ push {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 \
+ pop {r7}; \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (r7); \
+ .fnend
#undef UNDOARGS_1
#define UNDOARGS_1 UNDOARGS_0
#undef UNDOARGS_2
@@ -261,29 +291,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 \
+ pop {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 \
+ pop {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 \
+ pop {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/ports/sysdeps/unix/sysv/linux/arm/truncate64.c b/ports/sysdeps/unix/sysv/linux/arm/truncate64.c
index 4367d1efee..6e52e32637 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/truncate64.c
+++ b/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/ports/sysdeps/unix/sysv/linux/arm/vfork.S b/ports/sysdeps/unix/sysv/linux/arm/vfork.S
index 4f84c57f22..128a6402b9 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/vfork.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/vfork.S
@@ -37,7 +37,7 @@ ENTRY (__vfork)
mov ip, r7
cfi_register (r7, ip)
.fnstart
- str r7, [sp, #-4]!
+ push { r7 }
cfi_adjust_cfa_offset (4)
.save { r7 }
ldr r7, =SYS_ify (vfork)
@@ -51,6 +51,7 @@ ENTRY (__vfork)
RESTORE_PID
#endif
cmn a1, #4096
+ it cc
RETINSTR(cc, lr)
b PLTJMP(SYSCALL_ERROR)
diff --git a/ports/sysdeps/unix/sysv/linux/generic/bits/msq.h b/ports/sysdeps/unix/sysv/linux/generic/bits/msq.h
index 87f37b4d65..49cbf0611d 100644
--- a/ports/sysdeps/unix/sysv/linux/generic/bits/msq.h
+++ b/ports/sysdeps/unix/sysv/linux/generic/bits/msq.h
@@ -27,6 +27,7 @@
#define MSG_NOERROR 010000 /* no error if message is too big */
#ifdef __USE_GNU
# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+# define MSG_COPY 040000 /* copy (not remove) all queue messages */
#endif
/* Types used in the structure definition. */
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h
index c216ddb1fc..2835b0ff07 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h
+++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h
@@ -44,6 +44,9 @@
# define MAP_ANONYMOUS 0x10 /* Don't use a file */
# define MAP_ANON MAP_ANONYMOUS
# define MAP_VARIABLE 0
+/* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */
+# define MAP_HUGE_SHIFT 26
+# define MAP_HUGE_MASK 0x3f
#endif
/* These are Linux-specific. */
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/msq.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/msq.h
index e56286b283..ac35f510b5 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/bits/msq.h
+++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/msq.h
@@ -26,6 +26,7 @@
#define MSG_NOERROR 010000 /* no error if message is too big */
#ifdef __USE_GNU
# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+# define MSG_COPY 040000 /* copy (not remove) all queue messages */
#endif
/* Types used in the structure definition. */
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c b/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
index 618edf7bc2..af63e1b9a8 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
+++ b/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/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
index f37a7bbd74..b88703fbaf 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/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/ports/sysdeps/unix/sysv/linux/ia64/bits/mman.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/mman.h
index fba16db471..c3b1caf9d2 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/bits/mman.h
+++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/mman.h
@@ -23,36 +23,6 @@
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
-
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-#endif
-
/* These are Linux-specific. */
#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
@@ -67,47 +37,5 @@
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 0x1 /* Sync memory asynchronously. */
-#define MS_INVALIDATE 0x2 /* Invalidate the caches. */
-#define MS_SYNC 0x4 /* Synchronous memory sync. */
-
-/* Flags for `mlockall'. */
-#define MCL_CURRENT 0x1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 0x2 /* Lock all additions to address
- space. */
-
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
-# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
-# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
-# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
-# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
-# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
- overrides the coredump filter bits. */
-# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
-# define MADV_HWPOISON 100 /* Poison a page for testing. */
-#endif
-
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
diff --git a/ports/sysdeps/unix/sysv/linux/ia64/bits/msq.h b/ports/sysdeps/unix/sysv/linux/ia64/bits/msq.h
index 68d3ed7929..8519390c48 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/bits/msq.h
+++ b/ports/sysdeps/unix/sysv/linux/ia64/bits/msq.h
@@ -24,8 +24,10 @@
/* Define options for message queue functions. */
#define MSG_NOERROR 010000 /* no error if message is too big */
-#define MSG_EXCEPT 020000 /* recv any msg except of specified type */
-
+#ifdef __USE_GNU
+# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+# define MSG_COPY 040000 /* copy (not remove) all queue messages */
+#endif
/* Structure of record for one message inside the kernel.
The type `struct __msg' is opaque. */
diff --git a/ports/sysdeps/unix/sysv/linux/ia64/makecontext.c b/ports/sysdeps/unix/sysv/linux/ia64/makecontext.c
index 79fa05af62..c3bb5de197 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/makecontext.c
+++ b/ports/sysdeps/unix/sysv/linux/ia64/makecontext.c
@@ -22,14 +22,10 @@
#include <stdlib.h>
#include <ucontext.h>
#include <sys/rse.h>
+#include <link.h>
+#include <dl-fptr.h>
-struct fdesc
- {
- unsigned long ip;
- unsigned long gp;
- };
-
#define PUSH(val) \
do { \
if (ia64_rse_is_rnat_slot (rbs)) \
@@ -48,7 +44,7 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
extern void __start_context (ucontext_t *link, long gp, ...);
unsigned long stack_start, stack_end;
va_list ap;
- long *rbs;
+ unsigned long *rbs;
int i;
stack_start = (long) sc->sc_stack.ss_sp;
@@ -65,16 +61,16 @@ makecontext: does not know how to handle more than 8 arguments\n"));
}
/* set the entry point and global pointer: */
- sc->sc_br[0] = ((struct fdesc *) &__start_context)->ip;
- sc->sc_br[1] = ((struct fdesc *) func)->ip;
- sc->sc_gr[1] = ((struct fdesc *) func)->gp;
+ sc->sc_br[0] = ELF_PTR_TO_FDESC (&__start_context)->ip;
+ sc->sc_br[1] = ELF_PTR_TO_FDESC (func)->ip;
+ sc->sc_gr[1] = ELF_PTR_TO_FDESC (func)->gp;
/* set up the call frame: */
sc->sc_ar_pfs = ((sc->sc_ar_pfs & ~0x3fffffffffUL)
| (argc + 2) | ((argc + 2) << 7));
- rbs = (long *) stack_start;
+ rbs = (unsigned long *) stack_start;
PUSH((long) ucp->uc_link);
- PUSH(((struct fdesc *) &__start_context)->gp);
+ PUSH(ELF_PTR_TO_FDESC (&__start_context)->gp);
va_start (ap, argc);
for (i = 0; i < argc; ++i)
PUSH(va_arg (ap, long));
diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h b/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h
index e87b0fe692..886a4f0e50 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h
+++ b/ports/sysdeps/unix/sysv/linux/ia64/nptl/dl-sysdep.h
@@ -16,22 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _DL_SYSDEP_H
-#define _DL_SYSDEP_H 1
+#ifndef _LINUX_IA64_DL_SYSDEP_H
+#define _LINUX_IA64_DL_SYSDEP_H 1
-/* This macro must be defined to either 0 or 1.
-
- If 1, then an errno global variable hidden in ld.so will work right with
- all the errno-using libc code compiled for ld.so, and there is never a
- need to share the errno location with libc. This is appropriate only if
- all the libc functions that ld.so uses are called without PLT and always
- get the versions linked into ld.so rather than the libc ones. */
-
-#ifdef IS_IN_rtld
-# define RTLD_PRIVATE_ERRNO 1
-#else
-# define RTLD_PRIVATE_ERRNO 0
-#endif
+#include_next <dl-sysdep.h>
/* Traditionally system calls have been made using break 0x100000. A
second method was introduced which, if possible, will use the EPC
@@ -41,7 +29,7 @@
#define NEED_DL_SYSINFO 1
#define USE_DL_SYSINFO 1
-#if defined NEED_DL_SYSINFO && !defined __ASSEMBLER__
+#ifndef __ASSEMBLER__
/* Don't declare this as a function---we want it's entry-point, not
it's function descriptor... */
extern int _dl_sysinfo_break attribute_hidden;
@@ -64,11 +52,4 @@ extern int _dl_sysinfo_break attribute_hidden;
might write into it after _dl_start returns. */
#define DL_ARGV_NOT_RELRO 1
-
-#ifndef __ASSEMBLER__
-/* Get version of the OS. */
-extern int _dl_discover_osversion (void) attribute_hidden;
-# define HAVE_DL_DISCOVER_OSVERSION 1
-#endif
-
#endif /* dl-sysdep.h */
diff --git a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist
index b3510fe2a2..067552d175 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c b/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c
index b41c6c3a7e..664d0e12b9 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/sigaction.c
+++ b/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/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h b/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h
index c6fce1313e..96f6a4e8a5 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h
+++ b/ports/sysdeps/unix/sysv/linux/ia64/sysdep.h
@@ -252,7 +252,7 @@
_retval; })
#undef INTERNAL_SYSCALL_DECL
-#define INTERNAL_SYSCALL_DECL(err) long int err
+#define INTERNAL_SYSCALL_DECL(err) long int err __attribute__ ((unused))
#undef INTERNAL_SYSCALL
#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
@@ -264,7 +264,10 @@
INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args)
#undef INTERNAL_SYSCALL_ERROR_P
-#define INTERNAL_SYSCALL_ERROR_P(val, err) (err == -1)
+#define INTERNAL_SYSCALL_ERROR_P(val, err) \
+ ({ (void) (val); \
+ (err == -1); \
+ })
#undef INTERNAL_SYSCALL_ERRNO
#define INTERNAL_SYSCALL_ERRNO(val, err) (val)
diff --git a/ports/sysdeps/unix/sysv/linux/ia64/umount.c b/ports/sysdeps/unix/sysv/linux/ia64/umount.c
index a15a716869..a3df7863fa 100644
--- a/ports/sysdeps/unix/sysv/linux/ia64/umount.c
+++ b/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/ports/sysdeps/unix/sysv/linux/m68k/bits/mman.h b/ports/sysdeps/unix/sysv/linux/m68k/bits/mman.h
index d2fb69d832..b89011aee1 100644
--- a/ports/sysdeps/unix/sysv/linux/m68k/bits/mman.h
+++ b/ports/sysdeps/unix/sysv/linux/m68k/bits/mman.h
@@ -23,36 +23,6 @@
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
-
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-#endif
-
/* These are Linux-specific. */
#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
@@ -66,47 +36,5 @@
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
-/* Flags for `mlockall'. */
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 2 /* Lock all additions to address
- space. */
-
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
-# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
-# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
-# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
-# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
-# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
- overrides the coredump filter bits. */
-# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
-# define MADV_HWPOISON 100 /* Poison a page for testing. */
-#endif
-
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist
index 3c40379aac..f06cc8ef8b 100644
--- a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist
index 6c0bbde672..de8095a606 100644
--- a/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist
+++ b/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist
@@ -83,7 +83,6 @@ GLIBC_2.4
pause F
pread F
pread64 F
- pthread_atfork F
pthread_attr_destroy F
pthread_attr_getaffinity_np F
pthread_attr_getdetachstate F
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index 743538e460..4203780276 100644
--- a/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/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/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist
index f998b1b276..9010ea733b 100644
--- a/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/Makefile b/ports/sysdeps/unix/sysv/linux/mips/Makefile
index 66ba621dae..1e54036bfe 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/Makefile
+++ b/ports/sysdeps/unix/sysv/linux/mips/Makefile
@@ -8,9 +8,6 @@ sysdep_routines += cachectl cacheflush sysmips _test_and_set
sysdep_headers += sys/cachectl.h sys/sysmips.h sys/tas.h
endif
-# Get value of default-abi.
-include $(common-objpfx)default-abi.make
-
abi-variants := o32_soft o32_hard n32_soft n32_hard n64_soft n64_hard
ifeq (,$(filter $(default-abi),$(abi-variants)))
diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/mman.h b/ports/sysdeps/unix/sysv/linux/mips/bits/mman.h
index a13a900961..b327795f89 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/bits/mman.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/bits/mman.h
@@ -23,41 +23,9 @@
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
-
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x0800 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-# define MAP_RENAME MAP_ANONYMOUS
-#endif
-
/* These are Linux-specific. */
#ifdef __USE_MISC
# define MAP_NORESERVE 0x0400 /* don't check for reservations */
-# define MAP_ANONYMOUS 0x0800 /* don't use a file */
# define MAP_GROWSDOWN 0x1000 /* stack-like segment */
# define MAP_DENYWRITE 0x2000 /* ETXTBSY */
# define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
@@ -68,47 +36,11 @@
# define MAP_HUGETLB 0x80000 /* Create huge page mapping. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
-/* Flags for `mlockall'. */
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 2 /* Lock all additions to address
- space. */
-
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
+#define __MAP_ANONYMOUS 0x0800
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
-# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
-# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
-# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
-# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
-# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
- overrides the coredump filter bits. */
-# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
-# define MADV_HWPOISON 100 /* Poison a page for testing. */
-#endif
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
+#ifdef __USE_MISC
+# define MAP_RENAME MAP_ANONYMOUS
#endif
diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/msq.h b/ports/sysdeps/unix/sysv/linux/mips/bits/msq.h
index 8439069cd7..e814bc722f 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/bits/msq.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/bits/msq.h
@@ -25,6 +25,7 @@
#define MSG_NOERROR 010000 /* no error if message is too big */
#ifdef __USE_GNU
# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+# define MSG_COPY 040000 /* copy (not remove) all queue messages */
#endif
/* Types used in the structure definition. */
diff --git a/ports/sysdeps/unix/sysv/linux/mips/brk.c b/ports/sysdeps/unix/sysv/linux/mips/brk.c
index 9bd6d94bd1..07c8a9649f 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/brk.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/clone.S b/ports/sysdeps/unix/sysv/linux/mips/clone.S
index 72360f9621..f6f2f05659 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/clone.S
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/configure b/ports/sysdeps/unix/sysv/linux/mips/configure
index cecfc9d84c..b4ee83e3ae 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/configure
+++ b/ports/sysdeps/unix/sysv/linux/mips/configure
@@ -105,7 +105,8 @@ if test -z "$libc_mips_float"; then
as_fn_error $? "could not determine if compiler is using hard or soft floating point ABI" "$LINENO" 5
fi
-echo "default-abi := ${libc_mips_abi}_${libc_mips_float}" > default-abi.make
+config_vars="$config_vars
+default-abi = ${libc_mips_abi}_${libc_mips_float}"
case "$prefix" in
/usr | /usr/)
diff --git a/ports/sysdeps/unix/sysv/linux/mips/configure.in b/ports/sysdeps/unix/sysv/linux/mips/configure.in
index 167779eaf9..b8dde6ef7a 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/configure.in
+++ b/ports/sysdeps/unix/sysv/linux/mips/configure.in
@@ -44,7 +44,7 @@ if test -z "$libc_mips_float"; then
AC_MSG_ERROR([could not determine if compiler is using hard or soft floating point ABI])
fi
-echo "default-abi := ${libc_mips_abi}_${libc_mips_float}" > default-abi.make
+LIBC_CONFIG_VAR([default-abi], [${libc_mips_abi}_${libc_mips_float}])
case "$prefix" in
/usr | /usr/)
diff --git a/ports/sysdeps/unix/sysv/linux/mips/getcontext.S b/ports/sysdeps/unix/sysv/linux/mips/getcontext.S
index 0e3d35b54f..268098c0b1 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/getcontext.S
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/makecontext.S b/ports/sysdeps/unix/sysv/linux/mips/makecontext.S
index 65f1a6aaa2..a8bbebbcc0 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/makecontext.S
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile b/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile
new file mode 100644
index 0000000000..fa9fcb7e6f
--- /dev/null
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions b/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions
new file mode 100644
index 0000000000..73bcfb566c
--- /dev/null
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h b/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h
new file mode 100644
index 0000000000..8449836d32
--- /dev/null
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c
new file mode 100644
index 0000000000..0cdf94c22c
--- /dev/null
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c
new file mode 100644
index 0000000000..5e60a59d56
--- /dev/null
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c
new file mode 100644
index 0000000000..7750c519ce
--- /dev/null
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c
new file mode 100644
index 0000000000..7fc1c4e435
--- /dev/null
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c
new file mode 100644
index 0000000000..b8b4198c78
--- /dev/null
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c
new file mode 100644
index 0000000000..e1322d107f
--- /dev/null
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c
new file mode 100644
index 0000000000..a9e5cd9dfe
--- /dev/null
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c
new file mode 100644
index 0000000000..d87b5ba5a8
--- /dev/null
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist
index 7378869236..f01278e4a4 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index e79fda9372..0faf68c4fc 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c b/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c
index 4367d1efee..6e52e32637 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips32/truncate64.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
index 017b39d608..624994022f 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
index 32571e717d..ca2f2f6153 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
index 106271f759..b01204deb7 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
index b8905edd7d..3b94b1befe 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/msgctl.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist
index df2e63728a..9dbbd97c8e 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index 3ebbf892f7..452c2c70eb 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -71,25 +71,57 @@
#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"); \
+ 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" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set reorder" \
: "=r" (__v0), "=r" (__a3) \
@@ -101,17 +133,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 long __v0 asm("$2") ncs_init; \
- register long long __a0 asm("$4") = ARGIFY (arg1); \
- register long long __a3 asm("$7"); \
+ 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" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set reorder" \
: "=r" (__v0), "=r" (__a3) \
@@ -123,18 +157,20 @@
_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"); \
+ 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" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "=r" (__a3) \
@@ -146,19 +182,22 @@
_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"); \
+ 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" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "=r" (__a3) \
@@ -170,19 +209,22 @@
_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); \
+ 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" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
@@ -194,20 +236,23 @@
_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); \
+ 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" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
@@ -219,21 +264,24 @@
_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); \
+ 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" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
index b3bed4663c..c5f1c350ed 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist
index 22b3068d8f..c7e46aa869 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
index 9d949955be..d16ed6941c 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
@@ -67,25 +67,57 @@
#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"); \
+ 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 +129,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,18 +153,20 @@
_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" \
: "=r" (__v0), "=r" (__a3) \
@@ -142,19 +178,22 @@
_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" \
: "=r" (__v0), "=r" (__a3) \
@@ -166,19 +205,22 @@
_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" \
: "=r" (__v0), "+r" (__a3) \
@@ -190,20 +232,23 @@
_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); \
+ 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" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
@@ -215,21 +260,24 @@
_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); \
+ 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" \
- cs_init \
+ v0_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
index 354eba2f3d..6565225662 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
index 9b183f335c..197f7eb809 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/shmctl.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S b/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
index 839276d7ad..850025c635 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c b/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
index 2408e5e374..89cde2b33a 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
index fe7c747cde..4f27b8b827 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h
index e1dd672528..3b0eccc77f 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/pread.c b/ports/sysdeps/unix/sysv/linux/mips/pread.c
index b269e1c25a..db18265e3d 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/pread.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/pread64.c b/ports/sysdeps/unix/sysv/linux/mips/pread64.c
index 8c2c403a9d..3b8c8aa720 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/pread64.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/pwrite.c b/ports/sysdeps/unix/sysv/linux/mips/pwrite.c
index aa3501414b..94213bc8ba 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/pwrite.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c b/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c
index 1d14e0761a..aa8a4dec35 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/pwrite64.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/setcontext.S b/ports/sysdeps/unix/sysv/linux/mips/setcontext.S
index 42f709d846..2d5aee013b 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/setcontext.S
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/sigaction.c b/ports/sysdeps/unix/sysv/linux/mips/sigaction.c
index c490dd144e..9d8ee76d02 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/sigaction.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S b/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S
index d965f3919b..ec271b0584 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/ustat.c b/ports/sysdeps/unix/sysv/linux/mips/ustat.c
index f05bba6294..6db482e96b 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/ustat.c
+++ b/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/ports/sysdeps/unix/sysv/linux/mips/vfork.S b/ports/sysdeps/unix/sysv/linux/mips/vfork.S
index b9503c3943..ae76a91d38 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/vfork.S
+++ b/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/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist
index 0efc6b55c4..9b6d663748 100644
--- a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/tile/bits/mman.h b/ports/sysdeps/unix/sysv/linux/tile/bits/mman.h
index 7494ee5e5f..02fddecc15 100644
--- a/ports/sysdeps/unix/sysv/linux/tile/bits/mman.h
+++ b/ports/sysdeps/unix/sysv/linux/tile/bits/mman.h
@@ -23,36 +23,6 @@
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
-
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-#endif
-
#ifdef __USE_MISC
/* These are Linux-specific. */
# define MAP_NONBLOCK 0x00080 /* Do not block on IO. */
@@ -66,47 +36,5 @@
# define MAP_HUGETLB 0x04000 /* Create huge page mapping. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
-/* Flags for `mlockall'. */
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 2 /* Lock all additions to address
- space. */
-
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
-# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
-# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
-# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
-# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
-# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
- overrides the coredump filter bits. */
-# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
-# define MADV_HWPOISON 100 /* Poison a page for testing. */
-#endif
-
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
index e6f5d1905e..a9822ec960 100644
--- a/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
+++ b/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/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist
index d79b2df55d..caf74b89e1 100644
--- a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist
index 3ab004605a..658c4bf999 100644
--- a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist
+++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist
@@ -73,7 +73,6 @@ GLIBC_2.12
pause F
pread F
pread64 F
- pthread_atfork F
pthread_attr_destroy F
pthread_attr_getaffinity_np F
pthread_attr_getdetachstate F
diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist
index f617405675..68d975be55 100644
--- a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist
+++ b/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/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist
index 3ab004605a..658c4bf999 100644
--- a/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist
+++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist
@@ -73,7 +73,6 @@ GLIBC_2.12
pause F
pread F
pread64 F
- pthread_atfork F
pthread_attr_destroy F
pthread_attr_getaffinity_np F
pthread_attr_getdetachstate F
diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist
index d79b2df55d..caf74b89e1 100644
--- a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist
+++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist
@@ -2088,3 +2088,6 @@ GLIBC_2.17
clock_nanosleep F
clock_settime F
secure_getenv F
+GLIBC_2.18
+ GLIBC_2.18 A
+ __cxa_thread_atexit_impl F
diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist
index 3ab004605a..658c4bf999 100644
--- a/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist
+++ b/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist
@@ -73,7 +73,6 @@ GLIBC_2.12
pause F
pread F
pread64 F
- pthread_atfork F
pthread_attr_destroy F
pthread_attr_getaffinity_np F
pthread_attr_getdetachstate F