Merge remote-tracking branch 'goog/master' into merge
diff --git a/benchmarks/unistd_benchmark.cpp b/benchmarks/unistd_benchmark.cpp
index e839bf8..12b788a 100644
--- a/benchmarks/unistd_benchmark.cpp
+++ b/benchmarks/unistd_benchmark.cpp
@@ -28,3 +28,14 @@
   StopBenchmarkTiming();
 }
 BENCHMARK(BM_unistd_getpid);
+
+static void BM_unistd_gettid(int iters) {
+  StartBenchmarkTiming();
+
+  for (int i = 0; i < iters; ++i) {
+    gettid();
+  }
+
+  StopBenchmarkTiming();
+}
+BENCHMARK(BM_unistd_gettid);
diff --git a/libc/Android.mk b/libc/Android.mk
index c573e30..4783bd3 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -128,6 +128,7 @@
     bionic/getauxval.cpp \
     bionic/getcwd.cpp \
     bionic/getpgrp.cpp \
+    bionic/gettid.cpp \
     bionic/inotify_init.cpp \
     bionic/lchown.cpp \
     bionic/lfs64_support.cpp \
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index 785d191..584c1ae 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -38,7 +38,6 @@
 uid_t   getresuid:getresuid(uid_t* ruid, uid_t* euid, uid_t* suid)     arm64,mips,mips64,x86_64
 gid_t   getresgid:getresgid32(gid_t* rgid, gid_t* egid, gid_t* sgid)   arm,x86
 gid_t   getresgid:getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid)     arm64,mips,mips64,x86_64
-pid_t   gettid()                   all
 ssize_t readahead(int, off64_t, size_t)     all
 int     getgroups:getgroups32(int, gid_t*)    arm,x86
 int     getgroups:getgroups(int, gid_t*)      arm64,mips,mips64,x86_64
diff --git a/libc/arch-arm/syscalls/gettid.S b/libc/arch-arm/syscalls/gettid.S
deleted file mode 100644
index 3928be1..0000000
--- a/libc/arch-arm/syscalls/gettid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(gettid)
-    mov     ip, r7
-    ldr     r7, =__NR_gettid
-    swi     #0
-    mov     r7, ip
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno
-END(gettid)
diff --git a/libc/arch-arm64/syscalls/gettid.S b/libc/arch-arm64/syscalls/gettid.S
deleted file mode 100644
index 44ca913..0000000
--- a/libc/arch-arm64/syscalls/gettid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(gettid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
-    mov     x8, __NR_gettid
-    svc     #0
-
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno
-
-    ret
-END(gettid)
diff --git a/libc/arch-mips/syscalls/gettid.S b/libc/arch-mips/syscalls/gettid.S
deleted file mode 100644
index cfdc57b..0000000
--- a/libc/arch-mips/syscalls/gettid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(gettid)
-    .set noreorder
-    .cpload t9
-    li v0, __NR_gettid
-    syscall
-    bnez a3, 1f
-    move a0, v0
-    j ra
-    nop
-1:
-    la t9,__set_errno
-    j t9
-    nop
-    .set reorder
-END(gettid)
diff --git a/libc/arch-mips64/syscalls/gettid.S b/libc/arch-mips64/syscalls/gettid.S
deleted file mode 100644
index 30c30c8..0000000
--- a/libc/arch-mips64/syscalls/gettid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(gettid)
-    .set push
-    .set noreorder
-    li v0, __NR_gettid
-    syscall
-    bnez a3, 1f
-    move a0, v0
-    j ra
-    nop
-1:
-    move t0, ra
-    bal     2f
-    nop
-2:
-    .cpsetup ra, t1, 2b
-    LA t9,__set_errno
-    .cpreturn
-    j t9
-    move ra, t0
-    .set pop
-END(gettid)
diff --git a/libc/arch-x86/bionic/__bionic_clone.S b/libc/arch-x86/bionic/__bionic_clone.S
index af6ef19..7c972de 100644
--- a/libc/arch-x86/bionic/__bionic_clone.S
+++ b/libc/arch-x86/bionic/__bionic_clone.S
@@ -38,6 +38,8 @@
         jmp     .L_bc_return
 
 .L_bc_child:
+        # We don't want anyone to unwind past this point.
+        .cfi_undefined %eip
         call    __bionic_clone_entry
         hlt
 
diff --git a/libc/arch-x86/syscalls/__accept4.S b/libc/arch-x86/syscalls/__accept4.S
index 573eddb..18a76a1 100644
--- a/libc/arch-x86/syscalls/__accept4.S
+++ b/libc/arch-x86/syscalls/__accept4.S
@@ -4,10 +4,11 @@
 
 ENTRY(__accept4)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $18, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/__brk.S b/libc/arch-x86/syscalls/__brk.S
index 728bf81..2439752 100644
--- a/libc/arch-x86/syscalls/__brk.S
+++ b/libc/arch-x86/syscalls/__brk.S
@@ -4,7 +4,7 @@
 
 ENTRY(__brk)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_brk, %eax
diff --git a/libc/arch-x86/syscalls/__connect.S b/libc/arch-x86/syscalls/__connect.S
index 2f53b33..3149e8c 100644
--- a/libc/arch-x86/syscalls/__connect.S
+++ b/libc/arch-x86/syscalls/__connect.S
@@ -4,10 +4,11 @@
 
 ENTRY(__connect)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $3, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/__epoll_pwait.S b/libc/arch-x86/syscalls/__epoll_pwait.S
index 9bcc142..67545b1 100644
--- a/libc/arch-x86/syscalls/__epoll_pwait.S
+++ b/libc/arch-x86/syscalls/__epoll_pwait.S
@@ -4,18 +4,23 @@
 
 ENTRY(__epoll_pwait)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    pushl   %ebp
-    .cfi_def_cfa_offset 24
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
-    .cfi_rel_offset ebp, 20
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
+    pushl   %ebp
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ebp, 0
     mov     28(%esp), %ebx
     mov     32(%esp), %ecx
     mov     36(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__exit.S b/libc/arch-x86/syscalls/__exit.S
index eaddc5e..d768306 100644
--- a/libc/arch-x86/syscalls/__exit.S
+++ b/libc/arch-x86/syscalls/__exit.S
@@ -4,7 +4,7 @@
 
 ENTRY(__exit)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_exit, %eax
diff --git a/libc/arch-x86/syscalls/__fcntl64.S b/libc/arch-x86/syscalls/__fcntl64.S
index faefa65..b2d5664 100644
--- a/libc/arch-x86/syscalls/__fcntl64.S
+++ b/libc/arch-x86/syscalls/__fcntl64.S
@@ -4,12 +4,14 @@
 
 ENTRY(__fcntl64)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__fstatfs64.S b/libc/arch-x86/syscalls/__fstatfs64.S
index dfd04af..d80ecc5 100644
--- a/libc/arch-x86/syscalls/__fstatfs64.S
+++ b/libc/arch-x86/syscalls/__fstatfs64.S
@@ -4,12 +4,14 @@
 
 ENTRY(__fstatfs64)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__getcpu.S b/libc/arch-x86/syscalls/__getcpu.S
index d1da871..23ce3f0 100644
--- a/libc/arch-x86/syscalls/__getcpu.S
+++ b/libc/arch-x86/syscalls/__getcpu.S
@@ -4,12 +4,14 @@
 
 ENTRY(__getcpu)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__getcwd.S b/libc/arch-x86/syscalls/__getcwd.S
index a9834e2..5454d7a 100644
--- a/libc/arch-x86/syscalls/__getcwd.S
+++ b/libc/arch-x86/syscalls/__getcwd.S
@@ -4,10 +4,11 @@
 
 ENTRY(__getcwd)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_getcwd, %eax
diff --git a/libc/arch-x86/syscalls/__getpriority.S b/libc/arch-x86/syscalls/__getpriority.S
index 99d33bb..2d97f0d 100644
--- a/libc/arch-x86/syscalls/__getpriority.S
+++ b/libc/arch-x86/syscalls/__getpriority.S
@@ -4,10 +4,11 @@
 
 ENTRY(__getpriority)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_getpriority, %eax
diff --git a/libc/arch-x86/syscalls/__ioctl.S b/libc/arch-x86/syscalls/__ioctl.S
index ad617f0..eb248fb 100644
--- a/libc/arch-x86/syscalls/__ioctl.S
+++ b/libc/arch-x86/syscalls/__ioctl.S
@@ -4,12 +4,14 @@
 
 ENTRY(__ioctl)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__llseek.S b/libc/arch-x86/syscalls/__llseek.S
index 2dab8a9..7a1ea83 100644
--- a/libc/arch-x86/syscalls/__llseek.S
+++ b/libc/arch-x86/syscalls/__llseek.S
@@ -4,16 +4,20 @@
 
 ENTRY(__llseek)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__mmap2.S b/libc/arch-x86/syscalls/__mmap2.S
index 963abf3..603ee2b 100644
--- a/libc/arch-x86/syscalls/__mmap2.S
+++ b/libc/arch-x86/syscalls/__mmap2.S
@@ -4,18 +4,23 @@
 
 ENTRY(__mmap2)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    pushl   %ebp
-    .cfi_def_cfa_offset 24
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
-    .cfi_rel_offset ebp, 20
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
+    pushl   %ebp
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ebp, 0
     mov     28(%esp), %ebx
     mov     32(%esp), %ecx
     mov     36(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__openat.S b/libc/arch-x86/syscalls/__openat.S
index 6b05bec..a6db672 100644
--- a/libc/arch-x86/syscalls/__openat.S
+++ b/libc/arch-x86/syscalls/__openat.S
@@ -4,14 +4,17 @@
 
 ENTRY(__openat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__ppoll.S b/libc/arch-x86/syscalls/__ppoll.S
index e5af93c..d8ac98a 100644
--- a/libc/arch-x86/syscalls/__ppoll.S
+++ b/libc/arch-x86/syscalls/__ppoll.S
@@ -4,16 +4,20 @@
 
 ENTRY(__ppoll)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__pselect6.S b/libc/arch-x86/syscalls/__pselect6.S
index 984a67e..9c66a3c 100644
--- a/libc/arch-x86/syscalls/__pselect6.S
+++ b/libc/arch-x86/syscalls/__pselect6.S
@@ -4,18 +4,23 @@
 
 ENTRY(__pselect6)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    pushl   %ebp
-    .cfi_def_cfa_offset 24
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
-    .cfi_rel_offset ebp, 20
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
+    pushl   %ebp
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ebp, 0
     mov     28(%esp), %ebx
     mov     32(%esp), %ecx
     mov     36(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__ptrace.S b/libc/arch-x86/syscalls/__ptrace.S
index d3b8031..54e8221 100644
--- a/libc/arch-x86/syscalls/__ptrace.S
+++ b/libc/arch-x86/syscalls/__ptrace.S
@@ -4,14 +4,17 @@
 
 ENTRY(__ptrace)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__reboot.S b/libc/arch-x86/syscalls/__reboot.S
index b644906..daea66e 100644
--- a/libc/arch-x86/syscalls/__reboot.S
+++ b/libc/arch-x86/syscalls/__reboot.S
@@ -4,14 +4,17 @@
 
 ENTRY(__reboot)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__rt_sigaction.S b/libc/arch-x86/syscalls/__rt_sigaction.S
index 1c5fdcc..d182a82 100644
--- a/libc/arch-x86/syscalls/__rt_sigaction.S
+++ b/libc/arch-x86/syscalls/__rt_sigaction.S
@@ -4,14 +4,17 @@
 
 ENTRY(__rt_sigaction)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__rt_sigpending.S b/libc/arch-x86/syscalls/__rt_sigpending.S
index 5522195..d83ccc0 100644
--- a/libc/arch-x86/syscalls/__rt_sigpending.S
+++ b/libc/arch-x86/syscalls/__rt_sigpending.S
@@ -4,10 +4,11 @@
 
 ENTRY(__rt_sigpending)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_rt_sigpending, %eax
diff --git a/libc/arch-x86/syscalls/__rt_sigprocmask.S b/libc/arch-x86/syscalls/__rt_sigprocmask.S
index 0df7301..4ca9443 100644
--- a/libc/arch-x86/syscalls/__rt_sigprocmask.S
+++ b/libc/arch-x86/syscalls/__rt_sigprocmask.S
@@ -4,14 +4,17 @@
 
 ENTRY(__rt_sigprocmask)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__rt_sigsuspend.S b/libc/arch-x86/syscalls/__rt_sigsuspend.S
index 0e7dbdf..f1a4cf3 100644
--- a/libc/arch-x86/syscalls/__rt_sigsuspend.S
+++ b/libc/arch-x86/syscalls/__rt_sigsuspend.S
@@ -4,10 +4,11 @@
 
 ENTRY(__rt_sigsuspend)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_rt_sigsuspend, %eax
diff --git a/libc/arch-x86/syscalls/__rt_sigtimedwait.S b/libc/arch-x86/syscalls/__rt_sigtimedwait.S
index cfbc7a6..4fae0f7 100644
--- a/libc/arch-x86/syscalls/__rt_sigtimedwait.S
+++ b/libc/arch-x86/syscalls/__rt_sigtimedwait.S
@@ -4,14 +4,17 @@
 
 ENTRY(__rt_sigtimedwait)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__sched_getaffinity.S b/libc/arch-x86/syscalls/__sched_getaffinity.S
index a9b9f79..bddbab5 100644
--- a/libc/arch-x86/syscalls/__sched_getaffinity.S
+++ b/libc/arch-x86/syscalls/__sched_getaffinity.S
@@ -4,12 +4,14 @@
 
 ENTRY(__sched_getaffinity)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__set_thread_area.S b/libc/arch-x86/syscalls/__set_thread_area.S
index ce06233..0772ffe 100644
--- a/libc/arch-x86/syscalls/__set_thread_area.S
+++ b/libc/arch-x86/syscalls/__set_thread_area.S
@@ -4,7 +4,7 @@
 
 ENTRY(__set_thread_area)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_set_thread_area, %eax
diff --git a/libc/arch-x86/syscalls/__set_tid_address.S b/libc/arch-x86/syscalls/__set_tid_address.S
index 6a3943d..e61c2ac 100644
--- a/libc/arch-x86/syscalls/__set_tid_address.S
+++ b/libc/arch-x86/syscalls/__set_tid_address.S
@@ -4,7 +4,7 @@
 
 ENTRY(__set_tid_address)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_set_tid_address, %eax
diff --git a/libc/arch-x86/syscalls/__sigaction.S b/libc/arch-x86/syscalls/__sigaction.S
index 8824a85..b4ca292 100644
--- a/libc/arch-x86/syscalls/__sigaction.S
+++ b/libc/arch-x86/syscalls/__sigaction.S
@@ -4,12 +4,14 @@
 
 ENTRY(__sigaction)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__signalfd4.S b/libc/arch-x86/syscalls/__signalfd4.S
index 7cbe474..1faafac 100644
--- a/libc/arch-x86/syscalls/__signalfd4.S
+++ b/libc/arch-x86/syscalls/__signalfd4.S
@@ -4,14 +4,17 @@
 
 ENTRY(__signalfd4)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__socket.S b/libc/arch-x86/syscalls/__socket.S
index 5e52d8f..2386b98 100644
--- a/libc/arch-x86/syscalls/__socket.S
+++ b/libc/arch-x86/syscalls/__socket.S
@@ -4,10 +4,11 @@
 
 ENTRY(__socket)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $1, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/__statfs64.S b/libc/arch-x86/syscalls/__statfs64.S
index 7a91f1d..69dd87e 100644
--- a/libc/arch-x86/syscalls/__statfs64.S
+++ b/libc/arch-x86/syscalls/__statfs64.S
@@ -4,12 +4,14 @@
 
 ENTRY(__statfs64)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__timer_create.S b/libc/arch-x86/syscalls/__timer_create.S
index 68480d1..520046f 100644
--- a/libc/arch-x86/syscalls/__timer_create.S
+++ b/libc/arch-x86/syscalls/__timer_create.S
@@ -4,12 +4,14 @@
 
 ENTRY(__timer_create)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__timer_delete.S b/libc/arch-x86/syscalls/__timer_delete.S
index a2732e1..8fff727 100644
--- a/libc/arch-x86/syscalls/__timer_delete.S
+++ b/libc/arch-x86/syscalls/__timer_delete.S
@@ -4,7 +4,7 @@
 
 ENTRY(__timer_delete)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_timer_delete, %eax
diff --git a/libc/arch-x86/syscalls/__timer_getoverrun.S b/libc/arch-x86/syscalls/__timer_getoverrun.S
index a340bfe..372625b 100644
--- a/libc/arch-x86/syscalls/__timer_getoverrun.S
+++ b/libc/arch-x86/syscalls/__timer_getoverrun.S
@@ -4,7 +4,7 @@
 
 ENTRY(__timer_getoverrun)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_timer_getoverrun, %eax
diff --git a/libc/arch-x86/syscalls/__timer_gettime.S b/libc/arch-x86/syscalls/__timer_gettime.S
index 4aeb8eb..9588bf7 100644
--- a/libc/arch-x86/syscalls/__timer_gettime.S
+++ b/libc/arch-x86/syscalls/__timer_gettime.S
@@ -4,10 +4,11 @@
 
 ENTRY(__timer_gettime)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_timer_gettime, %eax
diff --git a/libc/arch-x86/syscalls/__timer_settime.S b/libc/arch-x86/syscalls/__timer_settime.S
index f93bca4..7b0ab43 100644
--- a/libc/arch-x86/syscalls/__timer_settime.S
+++ b/libc/arch-x86/syscalls/__timer_settime.S
@@ -4,14 +4,17 @@
 
 ENTRY(__timer_settime)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/__waitid.S b/libc/arch-x86/syscalls/__waitid.S
index cda5238..7e63f8a 100644
--- a/libc/arch-x86/syscalls/__waitid.S
+++ b/libc/arch-x86/syscalls/__waitid.S
@@ -4,16 +4,20 @@
 
 ENTRY(__waitid)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/_exit.S b/libc/arch-x86/syscalls/_exit.S
index 793c9d5..5b569b9 100644
--- a/libc/arch-x86/syscalls/_exit.S
+++ b/libc/arch-x86/syscalls/_exit.S
@@ -4,7 +4,7 @@
 
 ENTRY(_exit)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_exit_group, %eax
diff --git a/libc/arch-x86/syscalls/acct.S b/libc/arch-x86/syscalls/acct.S
index 6abaffc..7fa4508 100644
--- a/libc/arch-x86/syscalls/acct.S
+++ b/libc/arch-x86/syscalls/acct.S
@@ -4,7 +4,7 @@
 
 ENTRY(acct)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_acct, %eax
diff --git a/libc/arch-x86/syscalls/bind.S b/libc/arch-x86/syscalls/bind.S
index 7c2acb5..c99ada1 100644
--- a/libc/arch-x86/syscalls/bind.S
+++ b/libc/arch-x86/syscalls/bind.S
@@ -4,10 +4,11 @@
 
 ENTRY(bind)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $2, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/capget.S b/libc/arch-x86/syscalls/capget.S
index aa7b432..82065cf 100644
--- a/libc/arch-x86/syscalls/capget.S
+++ b/libc/arch-x86/syscalls/capget.S
@@ -4,10 +4,11 @@
 
 ENTRY(capget)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_capget, %eax
diff --git a/libc/arch-x86/syscalls/capset.S b/libc/arch-x86/syscalls/capset.S
index 6c31083..8c9367f 100644
--- a/libc/arch-x86/syscalls/capset.S
+++ b/libc/arch-x86/syscalls/capset.S
@@ -4,10 +4,11 @@
 
 ENTRY(capset)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_capset, %eax
diff --git a/libc/arch-x86/syscalls/chdir.S b/libc/arch-x86/syscalls/chdir.S
index a51ac6e..00986d4 100644
--- a/libc/arch-x86/syscalls/chdir.S
+++ b/libc/arch-x86/syscalls/chdir.S
@@ -4,7 +4,7 @@
 
 ENTRY(chdir)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_chdir, %eax
diff --git a/libc/arch-x86/syscalls/chroot.S b/libc/arch-x86/syscalls/chroot.S
index be8f686..cb8a099 100644
--- a/libc/arch-x86/syscalls/chroot.S
+++ b/libc/arch-x86/syscalls/chroot.S
@@ -4,7 +4,7 @@
 
 ENTRY(chroot)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_chroot, %eax
diff --git a/libc/arch-x86/syscalls/clock_getres.S b/libc/arch-x86/syscalls/clock_getres.S
index ce7e6f7..5fef51a 100644
--- a/libc/arch-x86/syscalls/clock_getres.S
+++ b/libc/arch-x86/syscalls/clock_getres.S
@@ -4,10 +4,11 @@
 
 ENTRY(clock_getres)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_clock_getres, %eax
diff --git a/libc/arch-x86/syscalls/clock_gettime.S b/libc/arch-x86/syscalls/clock_gettime.S
index b1cdb1a..4275edc 100644
--- a/libc/arch-x86/syscalls/clock_gettime.S
+++ b/libc/arch-x86/syscalls/clock_gettime.S
@@ -4,10 +4,11 @@
 
 ENTRY(clock_gettime)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_clock_gettime, %eax
diff --git a/libc/arch-x86/syscalls/clock_nanosleep.S b/libc/arch-x86/syscalls/clock_nanosleep.S
index 6c025e3..1f0fcc6 100644
--- a/libc/arch-x86/syscalls/clock_nanosleep.S
+++ b/libc/arch-x86/syscalls/clock_nanosleep.S
@@ -4,14 +4,17 @@
 
 ENTRY(clock_nanosleep)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/clock_settime.S b/libc/arch-x86/syscalls/clock_settime.S
index 7c863e1..4f59a10 100644
--- a/libc/arch-x86/syscalls/clock_settime.S
+++ b/libc/arch-x86/syscalls/clock_settime.S
@@ -4,10 +4,11 @@
 
 ENTRY(clock_settime)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_clock_settime, %eax
diff --git a/libc/arch-x86/syscalls/close.S b/libc/arch-x86/syscalls/close.S
index 3eb3be1..3f4e034 100644
--- a/libc/arch-x86/syscalls/close.S
+++ b/libc/arch-x86/syscalls/close.S
@@ -4,7 +4,7 @@
 
 ENTRY(close)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_close, %eax
diff --git a/libc/arch-x86/syscalls/delete_module.S b/libc/arch-x86/syscalls/delete_module.S
index 11ff762..8923f46 100644
--- a/libc/arch-x86/syscalls/delete_module.S
+++ b/libc/arch-x86/syscalls/delete_module.S
@@ -4,10 +4,11 @@
 
 ENTRY(delete_module)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_delete_module, %eax
diff --git a/libc/arch-x86/syscalls/dup.S b/libc/arch-x86/syscalls/dup.S
index 98070e2..ed922de 100644
--- a/libc/arch-x86/syscalls/dup.S
+++ b/libc/arch-x86/syscalls/dup.S
@@ -4,7 +4,7 @@
 
 ENTRY(dup)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_dup, %eax
diff --git a/libc/arch-x86/syscalls/dup3.S b/libc/arch-x86/syscalls/dup3.S
index 4380e6a..d1a714d 100644
--- a/libc/arch-x86/syscalls/dup3.S
+++ b/libc/arch-x86/syscalls/dup3.S
@@ -4,12 +4,14 @@
 
 ENTRY(dup3)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/epoll_create1.S b/libc/arch-x86/syscalls/epoll_create1.S
index ca5d4d1..69ddd9b 100644
--- a/libc/arch-x86/syscalls/epoll_create1.S
+++ b/libc/arch-x86/syscalls/epoll_create1.S
@@ -4,7 +4,7 @@
 
 ENTRY(epoll_create1)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_epoll_create1, %eax
diff --git a/libc/arch-x86/syscalls/epoll_ctl.S b/libc/arch-x86/syscalls/epoll_ctl.S
index df345cd..2a50db8 100644
--- a/libc/arch-x86/syscalls/epoll_ctl.S
+++ b/libc/arch-x86/syscalls/epoll_ctl.S
@@ -4,14 +4,17 @@
 
 ENTRY(epoll_ctl)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/eventfd.S b/libc/arch-x86/syscalls/eventfd.S
index 333bca4..48a07a2 100644
--- a/libc/arch-x86/syscalls/eventfd.S
+++ b/libc/arch-x86/syscalls/eventfd.S
@@ -4,10 +4,11 @@
 
 ENTRY(eventfd)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_eventfd2, %eax
diff --git a/libc/arch-x86/syscalls/execve.S b/libc/arch-x86/syscalls/execve.S
index 95523bc..345b5a4 100644
--- a/libc/arch-x86/syscalls/execve.S
+++ b/libc/arch-x86/syscalls/execve.S
@@ -4,12 +4,14 @@
 
 ENTRY(execve)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/faccessat.S b/libc/arch-x86/syscalls/faccessat.S
index 0ad6224..1f340f7 100644
--- a/libc/arch-x86/syscalls/faccessat.S
+++ b/libc/arch-x86/syscalls/faccessat.S
@@ -4,14 +4,17 @@
 
 ENTRY(faccessat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/fallocate64.S b/libc/arch-x86/syscalls/fallocate64.S
index 7e03c54..be3d45b 100644
--- a/libc/arch-x86/syscalls/fallocate64.S
+++ b/libc/arch-x86/syscalls/fallocate64.S
@@ -4,18 +4,23 @@
 
 ENTRY(fallocate64)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    pushl   %ebp
-    .cfi_def_cfa_offset 24
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
-    .cfi_rel_offset ebp, 20
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
+    pushl   %ebp
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ebp, 0
     mov     28(%esp), %ebx
     mov     32(%esp), %ecx
     mov     36(%esp), %edx
diff --git a/libc/arch-x86/syscalls/fchdir.S b/libc/arch-x86/syscalls/fchdir.S
index 4298c2a..da95c0b 100644
--- a/libc/arch-x86/syscalls/fchdir.S
+++ b/libc/arch-x86/syscalls/fchdir.S
@@ -4,7 +4,7 @@
 
 ENTRY(fchdir)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_fchdir, %eax
diff --git a/libc/arch-x86/syscalls/fchmod.S b/libc/arch-x86/syscalls/fchmod.S
index d4ef36f..fe189f4 100644
--- a/libc/arch-x86/syscalls/fchmod.S
+++ b/libc/arch-x86/syscalls/fchmod.S
@@ -4,10 +4,11 @@
 
 ENTRY(fchmod)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_fchmod, %eax
diff --git a/libc/arch-x86/syscalls/fchmodat.S b/libc/arch-x86/syscalls/fchmodat.S
index 4fb6995..794450b 100644
--- a/libc/arch-x86/syscalls/fchmodat.S
+++ b/libc/arch-x86/syscalls/fchmodat.S
@@ -4,14 +4,17 @@
 
 ENTRY(fchmodat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/fchown.S b/libc/arch-x86/syscalls/fchown.S
index 326fe16..5e82388 100644
--- a/libc/arch-x86/syscalls/fchown.S
+++ b/libc/arch-x86/syscalls/fchown.S
@@ -4,12 +4,14 @@
 
 ENTRY(fchown)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/fchownat.S b/libc/arch-x86/syscalls/fchownat.S
index 802dc44..bfe61e9 100644
--- a/libc/arch-x86/syscalls/fchownat.S
+++ b/libc/arch-x86/syscalls/fchownat.S
@@ -4,16 +4,20 @@
 
 ENTRY(fchownat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/fdatasync.S b/libc/arch-x86/syscalls/fdatasync.S
index 02e09be..17846ce 100644
--- a/libc/arch-x86/syscalls/fdatasync.S
+++ b/libc/arch-x86/syscalls/fdatasync.S
@@ -4,7 +4,7 @@
 
 ENTRY(fdatasync)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_fdatasync, %eax
diff --git a/libc/arch-x86/syscalls/fgetxattr.S b/libc/arch-x86/syscalls/fgetxattr.S
index 99a920d..335d298 100644
--- a/libc/arch-x86/syscalls/fgetxattr.S
+++ b/libc/arch-x86/syscalls/fgetxattr.S
@@ -4,14 +4,17 @@
 
 ENTRY(fgetxattr)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/flistxattr.S b/libc/arch-x86/syscalls/flistxattr.S
index a1691fc..5cab5ad 100644
--- a/libc/arch-x86/syscalls/flistxattr.S
+++ b/libc/arch-x86/syscalls/flistxattr.S
@@ -4,12 +4,14 @@
 
 ENTRY(flistxattr)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/flock.S b/libc/arch-x86/syscalls/flock.S
index a4388e9..277dd2a 100644
--- a/libc/arch-x86/syscalls/flock.S
+++ b/libc/arch-x86/syscalls/flock.S
@@ -4,10 +4,11 @@
 
 ENTRY(flock)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_flock, %eax
diff --git a/libc/arch-x86/syscalls/fremovexattr.S b/libc/arch-x86/syscalls/fremovexattr.S
index 6377974..a60e031 100644
--- a/libc/arch-x86/syscalls/fremovexattr.S
+++ b/libc/arch-x86/syscalls/fremovexattr.S
@@ -4,10 +4,11 @@
 
 ENTRY(fremovexattr)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_fremovexattr, %eax
diff --git a/libc/arch-x86/syscalls/fsetxattr.S b/libc/arch-x86/syscalls/fsetxattr.S
index 2f926a5..c4d4854 100644
--- a/libc/arch-x86/syscalls/fsetxattr.S
+++ b/libc/arch-x86/syscalls/fsetxattr.S
@@ -4,16 +4,20 @@
 
 ENTRY(fsetxattr)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/fstat64.S b/libc/arch-x86/syscalls/fstat64.S
index 4e85c71..054f6de 100644
--- a/libc/arch-x86/syscalls/fstat64.S
+++ b/libc/arch-x86/syscalls/fstat64.S
@@ -4,10 +4,11 @@
 
 ENTRY(fstat64)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_fstat64, %eax
diff --git a/libc/arch-x86/syscalls/fstatat64.S b/libc/arch-x86/syscalls/fstatat64.S
index 05cec7b..928d071 100644
--- a/libc/arch-x86/syscalls/fstatat64.S
+++ b/libc/arch-x86/syscalls/fstatat64.S
@@ -4,14 +4,17 @@
 
 ENTRY(fstatat64)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/fsync.S b/libc/arch-x86/syscalls/fsync.S
index 71183cb..f12d010 100644
--- a/libc/arch-x86/syscalls/fsync.S
+++ b/libc/arch-x86/syscalls/fsync.S
@@ -4,7 +4,7 @@
 
 ENTRY(fsync)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_fsync, %eax
diff --git a/libc/arch-x86/syscalls/ftruncate.S b/libc/arch-x86/syscalls/ftruncate.S
index 1003077..062982c 100644
--- a/libc/arch-x86/syscalls/ftruncate.S
+++ b/libc/arch-x86/syscalls/ftruncate.S
@@ -4,10 +4,11 @@
 
 ENTRY(ftruncate)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_ftruncate, %eax
diff --git a/libc/arch-x86/syscalls/ftruncate64.S b/libc/arch-x86/syscalls/ftruncate64.S
index 586086d..71920be 100644
--- a/libc/arch-x86/syscalls/ftruncate64.S
+++ b/libc/arch-x86/syscalls/ftruncate64.S
@@ -4,12 +4,14 @@
 
 ENTRY(ftruncate64)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/getdents.S b/libc/arch-x86/syscalls/getdents.S
index 9823feb..0b045b2 100644
--- a/libc/arch-x86/syscalls/getdents.S
+++ b/libc/arch-x86/syscalls/getdents.S
@@ -4,12 +4,14 @@
 
 ENTRY(getdents)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/getgroups.S b/libc/arch-x86/syscalls/getgroups.S
index e4247e7..d9b7d80 100644
--- a/libc/arch-x86/syscalls/getgroups.S
+++ b/libc/arch-x86/syscalls/getgroups.S
@@ -4,10 +4,11 @@
 
 ENTRY(getgroups)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_getgroups32, %eax
diff --git a/libc/arch-x86/syscalls/getitimer.S b/libc/arch-x86/syscalls/getitimer.S
index 2deebc9..8f3a0ee 100644
--- a/libc/arch-x86/syscalls/getitimer.S
+++ b/libc/arch-x86/syscalls/getitimer.S
@@ -4,10 +4,11 @@
 
 ENTRY(getitimer)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_getitimer, %eax
diff --git a/libc/arch-x86/syscalls/getpeername.S b/libc/arch-x86/syscalls/getpeername.S
index e894093..1ea42a0 100644
--- a/libc/arch-x86/syscalls/getpeername.S
+++ b/libc/arch-x86/syscalls/getpeername.S
@@ -4,10 +4,11 @@
 
 ENTRY(getpeername)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $7, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/getpgid.S b/libc/arch-x86/syscalls/getpgid.S
index c50a09f..179c7db 100644
--- a/libc/arch-x86/syscalls/getpgid.S
+++ b/libc/arch-x86/syscalls/getpgid.S
@@ -4,7 +4,7 @@
 
 ENTRY(getpgid)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_getpgid, %eax
diff --git a/libc/arch-x86/syscalls/getresgid.S b/libc/arch-x86/syscalls/getresgid.S
index ad74e56..ce8d89a 100644
--- a/libc/arch-x86/syscalls/getresgid.S
+++ b/libc/arch-x86/syscalls/getresgid.S
@@ -4,12 +4,14 @@
 
 ENTRY(getresgid)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/getresuid.S b/libc/arch-x86/syscalls/getresuid.S
index 6cf60b3..f444d16 100644
--- a/libc/arch-x86/syscalls/getresuid.S
+++ b/libc/arch-x86/syscalls/getresuid.S
@@ -4,12 +4,14 @@
 
 ENTRY(getresuid)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/getrlimit.S b/libc/arch-x86/syscalls/getrlimit.S
index 5e75b6b..66f4e6f 100644
--- a/libc/arch-x86/syscalls/getrlimit.S
+++ b/libc/arch-x86/syscalls/getrlimit.S
@@ -4,10 +4,11 @@
 
 ENTRY(getrlimit)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_ugetrlimit, %eax
diff --git a/libc/arch-x86/syscalls/getrusage.S b/libc/arch-x86/syscalls/getrusage.S
index 2dfd005..8d4fd7b 100644
--- a/libc/arch-x86/syscalls/getrusage.S
+++ b/libc/arch-x86/syscalls/getrusage.S
@@ -4,10 +4,11 @@
 
 ENTRY(getrusage)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_getrusage, %eax
diff --git a/libc/arch-x86/syscalls/getsid.S b/libc/arch-x86/syscalls/getsid.S
index 1f60309..39e5551 100644
--- a/libc/arch-x86/syscalls/getsid.S
+++ b/libc/arch-x86/syscalls/getsid.S
@@ -4,7 +4,7 @@
 
 ENTRY(getsid)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_getsid, %eax
diff --git a/libc/arch-x86/syscalls/getsockname.S b/libc/arch-x86/syscalls/getsockname.S
index 5c22bdf..ec0cc84 100644
--- a/libc/arch-x86/syscalls/getsockname.S
+++ b/libc/arch-x86/syscalls/getsockname.S
@@ -4,10 +4,11 @@
 
 ENTRY(getsockname)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $6, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/getsockopt.S b/libc/arch-x86/syscalls/getsockopt.S
index 9c02d23..cf109f1 100644
--- a/libc/arch-x86/syscalls/getsockopt.S
+++ b/libc/arch-x86/syscalls/getsockopt.S
@@ -4,10 +4,11 @@
 
 ENTRY(getsockopt)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $15, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/gettid.S b/libc/arch-x86/syscalls/gettid.S
deleted file mode 100644
index 1f264b1..0000000
--- a/libc/arch-x86/syscalls/gettid.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(gettid)
-    movl    $__NR_gettid, %eax
-    int     $0x80
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno
-    addl    $4, %esp
-    orl     $-1, %eax
-1:
-    ret
-END(gettid)
diff --git a/libc/arch-x86/syscalls/gettimeofday.S b/libc/arch-x86/syscalls/gettimeofday.S
index 10c5de9..801e7ab 100644
--- a/libc/arch-x86/syscalls/gettimeofday.S
+++ b/libc/arch-x86/syscalls/gettimeofday.S
@@ -4,10 +4,11 @@
 
 ENTRY(gettimeofday)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_gettimeofday, %eax
diff --git a/libc/arch-x86/syscalls/getxattr.S b/libc/arch-x86/syscalls/getxattr.S
index f491a0c..5bd1ab8 100644
--- a/libc/arch-x86/syscalls/getxattr.S
+++ b/libc/arch-x86/syscalls/getxattr.S
@@ -4,14 +4,17 @@
 
 ENTRY(getxattr)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/init_module.S b/libc/arch-x86/syscalls/init_module.S
index 1a159d3..8afd644 100644
--- a/libc/arch-x86/syscalls/init_module.S
+++ b/libc/arch-x86/syscalls/init_module.S
@@ -4,12 +4,14 @@
 
 ENTRY(init_module)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/inotify_add_watch.S b/libc/arch-x86/syscalls/inotify_add_watch.S
index 424698d..0de8f88 100644
--- a/libc/arch-x86/syscalls/inotify_add_watch.S
+++ b/libc/arch-x86/syscalls/inotify_add_watch.S
@@ -4,12 +4,14 @@
 
 ENTRY(inotify_add_watch)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/inotify_init1.S b/libc/arch-x86/syscalls/inotify_init1.S
index 1b437c6..0920618 100644
--- a/libc/arch-x86/syscalls/inotify_init1.S
+++ b/libc/arch-x86/syscalls/inotify_init1.S
@@ -4,7 +4,7 @@
 
 ENTRY(inotify_init1)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_inotify_init1, %eax
diff --git a/libc/arch-x86/syscalls/inotify_rm_watch.S b/libc/arch-x86/syscalls/inotify_rm_watch.S
index 18ec3ca..37394c5 100644
--- a/libc/arch-x86/syscalls/inotify_rm_watch.S
+++ b/libc/arch-x86/syscalls/inotify_rm_watch.S
@@ -4,10 +4,11 @@
 
 ENTRY(inotify_rm_watch)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_inotify_rm_watch, %eax
diff --git a/libc/arch-x86/syscalls/ioprio_get.S b/libc/arch-x86/syscalls/ioprio_get.S
index 6dfc767..ff78773 100644
--- a/libc/arch-x86/syscalls/ioprio_get.S
+++ b/libc/arch-x86/syscalls/ioprio_get.S
@@ -4,10 +4,11 @@
 
 ENTRY(ioprio_get)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_ioprio_get, %eax
diff --git a/libc/arch-x86/syscalls/ioprio_set.S b/libc/arch-x86/syscalls/ioprio_set.S
index bcefacb..7a3e919 100644
--- a/libc/arch-x86/syscalls/ioprio_set.S
+++ b/libc/arch-x86/syscalls/ioprio_set.S
@@ -4,12 +4,14 @@
 
 ENTRY(ioprio_set)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/kill.S b/libc/arch-x86/syscalls/kill.S
index 499158b..fbf5fa8 100644
--- a/libc/arch-x86/syscalls/kill.S
+++ b/libc/arch-x86/syscalls/kill.S
@@ -4,10 +4,11 @@
 
 ENTRY(kill)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_kill, %eax
diff --git a/libc/arch-x86/syscalls/klogctl.S b/libc/arch-x86/syscalls/klogctl.S
index f422ac8..03f24b8 100644
--- a/libc/arch-x86/syscalls/klogctl.S
+++ b/libc/arch-x86/syscalls/klogctl.S
@@ -4,12 +4,14 @@
 
 ENTRY(klogctl)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/lgetxattr.S b/libc/arch-x86/syscalls/lgetxattr.S
index def7c66..6ee2c55 100644
--- a/libc/arch-x86/syscalls/lgetxattr.S
+++ b/libc/arch-x86/syscalls/lgetxattr.S
@@ -4,14 +4,17 @@
 
 ENTRY(lgetxattr)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/linkat.S b/libc/arch-x86/syscalls/linkat.S
index ffb1b5d..d9876eb 100644
--- a/libc/arch-x86/syscalls/linkat.S
+++ b/libc/arch-x86/syscalls/linkat.S
@@ -4,16 +4,20 @@
 
 ENTRY(linkat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/listen.S b/libc/arch-x86/syscalls/listen.S
index 7e4d2f3..b671b25 100644
--- a/libc/arch-x86/syscalls/listen.S
+++ b/libc/arch-x86/syscalls/listen.S
@@ -4,10 +4,11 @@
 
 ENTRY(listen)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $4, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/listxattr.S b/libc/arch-x86/syscalls/listxattr.S
index 5b94a72..e86b82e 100644
--- a/libc/arch-x86/syscalls/listxattr.S
+++ b/libc/arch-x86/syscalls/listxattr.S
@@ -4,12 +4,14 @@
 
 ENTRY(listxattr)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/llistxattr.S b/libc/arch-x86/syscalls/llistxattr.S
index 1c64591..8d13da8 100644
--- a/libc/arch-x86/syscalls/llistxattr.S
+++ b/libc/arch-x86/syscalls/llistxattr.S
@@ -4,12 +4,14 @@
 
 ENTRY(llistxattr)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/lremovexattr.S b/libc/arch-x86/syscalls/lremovexattr.S
index d67b221..9dab0a3 100644
--- a/libc/arch-x86/syscalls/lremovexattr.S
+++ b/libc/arch-x86/syscalls/lremovexattr.S
@@ -4,10 +4,11 @@
 
 ENTRY(lremovexattr)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_lremovexattr, %eax
diff --git a/libc/arch-x86/syscalls/lseek.S b/libc/arch-x86/syscalls/lseek.S
index 5a58b81..2d03f46 100644
--- a/libc/arch-x86/syscalls/lseek.S
+++ b/libc/arch-x86/syscalls/lseek.S
@@ -4,12 +4,14 @@
 
 ENTRY(lseek)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/lsetxattr.S b/libc/arch-x86/syscalls/lsetxattr.S
index f2dba39..1452298 100644
--- a/libc/arch-x86/syscalls/lsetxattr.S
+++ b/libc/arch-x86/syscalls/lsetxattr.S
@@ -4,16 +4,20 @@
 
 ENTRY(lsetxattr)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/madvise.S b/libc/arch-x86/syscalls/madvise.S
index edd37b5..fd4af11 100644
--- a/libc/arch-x86/syscalls/madvise.S
+++ b/libc/arch-x86/syscalls/madvise.S
@@ -4,12 +4,14 @@
 
 ENTRY(madvise)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/mincore.S b/libc/arch-x86/syscalls/mincore.S
index 44ea364..01eb519 100644
--- a/libc/arch-x86/syscalls/mincore.S
+++ b/libc/arch-x86/syscalls/mincore.S
@@ -4,12 +4,14 @@
 
 ENTRY(mincore)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/mkdirat.S b/libc/arch-x86/syscalls/mkdirat.S
index d80e3fb..b022838 100644
--- a/libc/arch-x86/syscalls/mkdirat.S
+++ b/libc/arch-x86/syscalls/mkdirat.S
@@ -4,12 +4,14 @@
 
 ENTRY(mkdirat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/mknodat.S b/libc/arch-x86/syscalls/mknodat.S
index 20560df..233c0b2 100644
--- a/libc/arch-x86/syscalls/mknodat.S
+++ b/libc/arch-x86/syscalls/mknodat.S
@@ -4,14 +4,17 @@
 
 ENTRY(mknodat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/mlock.S b/libc/arch-x86/syscalls/mlock.S
index 78cfa58..fb4641f 100644
--- a/libc/arch-x86/syscalls/mlock.S
+++ b/libc/arch-x86/syscalls/mlock.S
@@ -4,10 +4,11 @@
 
 ENTRY(mlock)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_mlock, %eax
diff --git a/libc/arch-x86/syscalls/mlockall.S b/libc/arch-x86/syscalls/mlockall.S
index 4e78fef..9403351 100644
--- a/libc/arch-x86/syscalls/mlockall.S
+++ b/libc/arch-x86/syscalls/mlockall.S
@@ -4,7 +4,7 @@
 
 ENTRY(mlockall)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_mlockall, %eax
diff --git a/libc/arch-x86/syscalls/mount.S b/libc/arch-x86/syscalls/mount.S
index cc1a518..d99f5f4 100644
--- a/libc/arch-x86/syscalls/mount.S
+++ b/libc/arch-x86/syscalls/mount.S
@@ -4,16 +4,20 @@
 
 ENTRY(mount)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/mprotect.S b/libc/arch-x86/syscalls/mprotect.S
index 9c30af4..3205f83 100644
--- a/libc/arch-x86/syscalls/mprotect.S
+++ b/libc/arch-x86/syscalls/mprotect.S
@@ -4,12 +4,14 @@
 
 ENTRY(mprotect)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/mremap.S b/libc/arch-x86/syscalls/mremap.S
index 1439ef5..2b20079 100644
--- a/libc/arch-x86/syscalls/mremap.S
+++ b/libc/arch-x86/syscalls/mremap.S
@@ -4,14 +4,17 @@
 
 ENTRY(mremap)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/msync.S b/libc/arch-x86/syscalls/msync.S
index d330967..339e381 100644
--- a/libc/arch-x86/syscalls/msync.S
+++ b/libc/arch-x86/syscalls/msync.S
@@ -4,12 +4,14 @@
 
 ENTRY(msync)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/munlock.S b/libc/arch-x86/syscalls/munlock.S
index ce6197d..5fb29cb 100644
--- a/libc/arch-x86/syscalls/munlock.S
+++ b/libc/arch-x86/syscalls/munlock.S
@@ -4,10 +4,11 @@
 
 ENTRY(munlock)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_munlock, %eax
diff --git a/libc/arch-x86/syscalls/munmap.S b/libc/arch-x86/syscalls/munmap.S
index be7eec6..2d348db 100644
--- a/libc/arch-x86/syscalls/munmap.S
+++ b/libc/arch-x86/syscalls/munmap.S
@@ -4,10 +4,11 @@
 
 ENTRY(munmap)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_munmap, %eax
diff --git a/libc/arch-x86/syscalls/nanosleep.S b/libc/arch-x86/syscalls/nanosleep.S
index 9faa06b..9d8ae9d 100644
--- a/libc/arch-x86/syscalls/nanosleep.S
+++ b/libc/arch-x86/syscalls/nanosleep.S
@@ -4,10 +4,11 @@
 
 ENTRY(nanosleep)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_nanosleep, %eax
diff --git a/libc/arch-x86/syscalls/personality.S b/libc/arch-x86/syscalls/personality.S
index 8116e2d..412bbed 100644
--- a/libc/arch-x86/syscalls/personality.S
+++ b/libc/arch-x86/syscalls/personality.S
@@ -4,7 +4,7 @@
 
 ENTRY(personality)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_personality, %eax
diff --git a/libc/arch-x86/syscalls/pipe2.S b/libc/arch-x86/syscalls/pipe2.S
index c2e11a2..bfe03a2 100644
--- a/libc/arch-x86/syscalls/pipe2.S
+++ b/libc/arch-x86/syscalls/pipe2.S
@@ -4,10 +4,11 @@
 
 ENTRY(pipe2)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_pipe2, %eax
diff --git a/libc/arch-x86/syscalls/prctl.S b/libc/arch-x86/syscalls/prctl.S
index 1a5daca..fca343f 100644
--- a/libc/arch-x86/syscalls/prctl.S
+++ b/libc/arch-x86/syscalls/prctl.S
@@ -4,16 +4,20 @@
 
 ENTRY(prctl)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/pread64.S b/libc/arch-x86/syscalls/pread64.S
index 32a76c5..6cf4e4b 100644
--- a/libc/arch-x86/syscalls/pread64.S
+++ b/libc/arch-x86/syscalls/pread64.S
@@ -4,16 +4,20 @@
 
 ENTRY(pread64)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/prlimit64.S b/libc/arch-x86/syscalls/prlimit64.S
index 2256425..65316a7 100644
--- a/libc/arch-x86/syscalls/prlimit64.S
+++ b/libc/arch-x86/syscalls/prlimit64.S
@@ -4,14 +4,17 @@
 
 ENTRY(prlimit64)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/pwrite64.S b/libc/arch-x86/syscalls/pwrite64.S
index b003435..cccea8b 100644
--- a/libc/arch-x86/syscalls/pwrite64.S
+++ b/libc/arch-x86/syscalls/pwrite64.S
@@ -4,16 +4,20 @@
 
 ENTRY(pwrite64)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/read.S b/libc/arch-x86/syscalls/read.S
index ad1c19a..f80db31 100644
--- a/libc/arch-x86/syscalls/read.S
+++ b/libc/arch-x86/syscalls/read.S
@@ -4,12 +4,14 @@
 
 ENTRY(read)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/readahead.S b/libc/arch-x86/syscalls/readahead.S
index a4d634f..f53769a 100644
--- a/libc/arch-x86/syscalls/readahead.S
+++ b/libc/arch-x86/syscalls/readahead.S
@@ -4,14 +4,17 @@
 
 ENTRY(readahead)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/readlinkat.S b/libc/arch-x86/syscalls/readlinkat.S
index 37df8d8..229dafe 100644
--- a/libc/arch-x86/syscalls/readlinkat.S
+++ b/libc/arch-x86/syscalls/readlinkat.S
@@ -4,14 +4,17 @@
 
 ENTRY(readlinkat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/readv.S b/libc/arch-x86/syscalls/readv.S
index 05445c0..8cb01a0 100644
--- a/libc/arch-x86/syscalls/readv.S
+++ b/libc/arch-x86/syscalls/readv.S
@@ -4,12 +4,14 @@
 
 ENTRY(readv)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/recvfrom.S b/libc/arch-x86/syscalls/recvfrom.S
index df489c8..dd99a09 100644
--- a/libc/arch-x86/syscalls/recvfrom.S
+++ b/libc/arch-x86/syscalls/recvfrom.S
@@ -4,10 +4,11 @@
 
 ENTRY(recvfrom)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $12, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/recvmmsg.S b/libc/arch-x86/syscalls/recvmmsg.S
index a7adac8..f916fcd 100644
--- a/libc/arch-x86/syscalls/recvmmsg.S
+++ b/libc/arch-x86/syscalls/recvmmsg.S
@@ -4,10 +4,11 @@
 
 ENTRY(recvmmsg)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $19, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/recvmsg.S b/libc/arch-x86/syscalls/recvmsg.S
index a587b00..12dad28 100644
--- a/libc/arch-x86/syscalls/recvmsg.S
+++ b/libc/arch-x86/syscalls/recvmsg.S
@@ -4,10 +4,11 @@
 
 ENTRY(recvmsg)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $17, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/removexattr.S b/libc/arch-x86/syscalls/removexattr.S
index 99192f0..3974a07 100644
--- a/libc/arch-x86/syscalls/removexattr.S
+++ b/libc/arch-x86/syscalls/removexattr.S
@@ -4,10 +4,11 @@
 
 ENTRY(removexattr)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_removexattr, %eax
diff --git a/libc/arch-x86/syscalls/renameat.S b/libc/arch-x86/syscalls/renameat.S
index 831b24c..2982f51 100644
--- a/libc/arch-x86/syscalls/renameat.S
+++ b/libc/arch-x86/syscalls/renameat.S
@@ -4,14 +4,17 @@
 
 ENTRY(renameat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/sched_get_priority_max.S b/libc/arch-x86/syscalls/sched_get_priority_max.S
index 0b7c269..3205c72 100644
--- a/libc/arch-x86/syscalls/sched_get_priority_max.S
+++ b/libc/arch-x86/syscalls/sched_get_priority_max.S
@@ -4,7 +4,7 @@
 
 ENTRY(sched_get_priority_max)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_sched_get_priority_max, %eax
diff --git a/libc/arch-x86/syscalls/sched_get_priority_min.S b/libc/arch-x86/syscalls/sched_get_priority_min.S
index ce28f8c..39c4d2c 100644
--- a/libc/arch-x86/syscalls/sched_get_priority_min.S
+++ b/libc/arch-x86/syscalls/sched_get_priority_min.S
@@ -4,7 +4,7 @@
 
 ENTRY(sched_get_priority_min)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_sched_get_priority_min, %eax
diff --git a/libc/arch-x86/syscalls/sched_getparam.S b/libc/arch-x86/syscalls/sched_getparam.S
index 2c3b7b9..47cb4af 100644
--- a/libc/arch-x86/syscalls/sched_getparam.S
+++ b/libc/arch-x86/syscalls/sched_getparam.S
@@ -4,10 +4,11 @@
 
 ENTRY(sched_getparam)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_sched_getparam, %eax
diff --git a/libc/arch-x86/syscalls/sched_getscheduler.S b/libc/arch-x86/syscalls/sched_getscheduler.S
index 6a3842a..07fbe6b 100644
--- a/libc/arch-x86/syscalls/sched_getscheduler.S
+++ b/libc/arch-x86/syscalls/sched_getscheduler.S
@@ -4,7 +4,7 @@
 
 ENTRY(sched_getscheduler)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_sched_getscheduler, %eax
diff --git a/libc/arch-x86/syscalls/sched_rr_get_interval.S b/libc/arch-x86/syscalls/sched_rr_get_interval.S
index c1055da..e7a1038 100644
--- a/libc/arch-x86/syscalls/sched_rr_get_interval.S
+++ b/libc/arch-x86/syscalls/sched_rr_get_interval.S
@@ -4,10 +4,11 @@
 
 ENTRY(sched_rr_get_interval)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_sched_rr_get_interval, %eax
diff --git a/libc/arch-x86/syscalls/sched_setaffinity.S b/libc/arch-x86/syscalls/sched_setaffinity.S
index bd3d0ab..bb35259 100644
--- a/libc/arch-x86/syscalls/sched_setaffinity.S
+++ b/libc/arch-x86/syscalls/sched_setaffinity.S
@@ -4,12 +4,14 @@
 
 ENTRY(sched_setaffinity)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/sched_setparam.S b/libc/arch-x86/syscalls/sched_setparam.S
index 2329268..3e93c4c 100644
--- a/libc/arch-x86/syscalls/sched_setparam.S
+++ b/libc/arch-x86/syscalls/sched_setparam.S
@@ -4,10 +4,11 @@
 
 ENTRY(sched_setparam)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_sched_setparam, %eax
diff --git a/libc/arch-x86/syscalls/sched_setscheduler.S b/libc/arch-x86/syscalls/sched_setscheduler.S
index a3ce8ab..fcabf12 100644
--- a/libc/arch-x86/syscalls/sched_setscheduler.S
+++ b/libc/arch-x86/syscalls/sched_setscheduler.S
@@ -4,12 +4,14 @@
 
 ENTRY(sched_setscheduler)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/sched_yield.S b/libc/arch-x86/syscalls/sched_yield.S
index fb563c4..a8b22e3 100644
--- a/libc/arch-x86/syscalls/sched_yield.S
+++ b/libc/arch-x86/syscalls/sched_yield.S
@@ -4,7 +4,7 @@
 
 ENTRY(sched_yield)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_sched_yield, %eax
diff --git a/libc/arch-x86/syscalls/sendfile.S b/libc/arch-x86/syscalls/sendfile.S
index 280a4ae..30bf3ad 100644
--- a/libc/arch-x86/syscalls/sendfile.S
+++ b/libc/arch-x86/syscalls/sendfile.S
@@ -4,14 +4,17 @@
 
 ENTRY(sendfile)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/sendfile64.S b/libc/arch-x86/syscalls/sendfile64.S
index 383c8c6..5a7f2bb 100644
--- a/libc/arch-x86/syscalls/sendfile64.S
+++ b/libc/arch-x86/syscalls/sendfile64.S
@@ -4,14 +4,17 @@
 
 ENTRY(sendfile64)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/sendmmsg.S b/libc/arch-x86/syscalls/sendmmsg.S
index 46dd6cd..09a3292 100644
--- a/libc/arch-x86/syscalls/sendmmsg.S
+++ b/libc/arch-x86/syscalls/sendmmsg.S
@@ -4,10 +4,11 @@
 
 ENTRY(sendmmsg)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $20, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/sendmsg.S b/libc/arch-x86/syscalls/sendmsg.S
index 70bad29..eaf7fb3 100644
--- a/libc/arch-x86/syscalls/sendmsg.S
+++ b/libc/arch-x86/syscalls/sendmsg.S
@@ -4,10 +4,11 @@
 
 ENTRY(sendmsg)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $16, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/sendto.S b/libc/arch-x86/syscalls/sendto.S
index dbe520d..0cf5e0a 100644
--- a/libc/arch-x86/syscalls/sendto.S
+++ b/libc/arch-x86/syscalls/sendto.S
@@ -4,10 +4,11 @@
 
 ENTRY(sendto)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $11, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/setgid.S b/libc/arch-x86/syscalls/setgid.S
index 69ac15b..b0b7185 100644
--- a/libc/arch-x86/syscalls/setgid.S
+++ b/libc/arch-x86/syscalls/setgid.S
@@ -4,7 +4,7 @@
 
 ENTRY(setgid)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_setgid32, %eax
diff --git a/libc/arch-x86/syscalls/setgroups.S b/libc/arch-x86/syscalls/setgroups.S
index f704c46..be227ca 100644
--- a/libc/arch-x86/syscalls/setgroups.S
+++ b/libc/arch-x86/syscalls/setgroups.S
@@ -4,10 +4,11 @@
 
 ENTRY(setgroups)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_setgroups32, %eax
diff --git a/libc/arch-x86/syscalls/setitimer.S b/libc/arch-x86/syscalls/setitimer.S
index 1573816..4a323da 100644
--- a/libc/arch-x86/syscalls/setitimer.S
+++ b/libc/arch-x86/syscalls/setitimer.S
@@ -4,12 +4,14 @@
 
 ENTRY(setitimer)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/setns.S b/libc/arch-x86/syscalls/setns.S
index 2c39a21..fa69b4a 100644
--- a/libc/arch-x86/syscalls/setns.S
+++ b/libc/arch-x86/syscalls/setns.S
@@ -4,10 +4,11 @@
 
 ENTRY(setns)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_setns, %eax
diff --git a/libc/arch-x86/syscalls/setpgid.S b/libc/arch-x86/syscalls/setpgid.S
index ae69633..eba780c 100644
--- a/libc/arch-x86/syscalls/setpgid.S
+++ b/libc/arch-x86/syscalls/setpgid.S
@@ -4,10 +4,11 @@
 
 ENTRY(setpgid)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_setpgid, %eax
diff --git a/libc/arch-x86/syscalls/setpriority.S b/libc/arch-x86/syscalls/setpriority.S
index b58cd13..5ea0519 100644
--- a/libc/arch-x86/syscalls/setpriority.S
+++ b/libc/arch-x86/syscalls/setpriority.S
@@ -4,12 +4,14 @@
 
 ENTRY(setpriority)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/setregid.S b/libc/arch-x86/syscalls/setregid.S
index 561a658..ae5bfca 100644
--- a/libc/arch-x86/syscalls/setregid.S
+++ b/libc/arch-x86/syscalls/setregid.S
@@ -4,10 +4,11 @@
 
 ENTRY(setregid)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_setregid32, %eax
diff --git a/libc/arch-x86/syscalls/setresgid.S b/libc/arch-x86/syscalls/setresgid.S
index a210975..64b5f7e 100644
--- a/libc/arch-x86/syscalls/setresgid.S
+++ b/libc/arch-x86/syscalls/setresgid.S
@@ -4,12 +4,14 @@
 
 ENTRY(setresgid)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/setresuid.S b/libc/arch-x86/syscalls/setresuid.S
index 920e68b..2a29fa5 100644
--- a/libc/arch-x86/syscalls/setresuid.S
+++ b/libc/arch-x86/syscalls/setresuid.S
@@ -4,12 +4,14 @@
 
 ENTRY(setresuid)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/setreuid.S b/libc/arch-x86/syscalls/setreuid.S
index 7f911ad..200a83a 100644
--- a/libc/arch-x86/syscalls/setreuid.S
+++ b/libc/arch-x86/syscalls/setreuid.S
@@ -4,10 +4,11 @@
 
 ENTRY(setreuid)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_setreuid32, %eax
diff --git a/libc/arch-x86/syscalls/setrlimit.S b/libc/arch-x86/syscalls/setrlimit.S
index e103ecf..64a46c0 100644
--- a/libc/arch-x86/syscalls/setrlimit.S
+++ b/libc/arch-x86/syscalls/setrlimit.S
@@ -4,10 +4,11 @@
 
 ENTRY(setrlimit)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_setrlimit, %eax
diff --git a/libc/arch-x86/syscalls/setsockopt.S b/libc/arch-x86/syscalls/setsockopt.S
index f56f812..e57c9d2 100644
--- a/libc/arch-x86/syscalls/setsockopt.S
+++ b/libc/arch-x86/syscalls/setsockopt.S
@@ -4,10 +4,11 @@
 
 ENTRY(setsockopt)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $14, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/settimeofday.S b/libc/arch-x86/syscalls/settimeofday.S
index 1ae4d58..4b2eca9 100644
--- a/libc/arch-x86/syscalls/settimeofday.S
+++ b/libc/arch-x86/syscalls/settimeofday.S
@@ -4,10 +4,11 @@
 
 ENTRY(settimeofday)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_settimeofday, %eax
diff --git a/libc/arch-x86/syscalls/setuid.S b/libc/arch-x86/syscalls/setuid.S
index 6549fd4..cf10ad6 100644
--- a/libc/arch-x86/syscalls/setuid.S
+++ b/libc/arch-x86/syscalls/setuid.S
@@ -4,7 +4,7 @@
 
 ENTRY(setuid)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_setuid32, %eax
diff --git a/libc/arch-x86/syscalls/setxattr.S b/libc/arch-x86/syscalls/setxattr.S
index fae04df..5edba2d 100644
--- a/libc/arch-x86/syscalls/setxattr.S
+++ b/libc/arch-x86/syscalls/setxattr.S
@@ -4,16 +4,20 @@
 
 ENTRY(setxattr)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    pushl   %edi
-    .cfi_def_cfa_offset 20
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
-    .cfi_rel_offset edi, 16
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
+    pushl   %edi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edi, 0
     mov     24(%esp), %ebx
     mov     28(%esp), %ecx
     mov     32(%esp), %edx
diff --git a/libc/arch-x86/syscalls/shutdown.S b/libc/arch-x86/syscalls/shutdown.S
index 13e8fd9..f1d606a 100644
--- a/libc/arch-x86/syscalls/shutdown.S
+++ b/libc/arch-x86/syscalls/shutdown.S
@@ -4,10 +4,11 @@
 
 ENTRY(shutdown)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $13, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/sigaltstack.S b/libc/arch-x86/syscalls/sigaltstack.S
index 71fdb12..64872df 100644
--- a/libc/arch-x86/syscalls/sigaltstack.S
+++ b/libc/arch-x86/syscalls/sigaltstack.S
@@ -4,10 +4,11 @@
 
 ENTRY(sigaltstack)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_sigaltstack, %eax
diff --git a/libc/arch-x86/syscalls/socketpair.S b/libc/arch-x86/syscalls/socketpair.S
index 3681c4f..4027752 100644
--- a/libc/arch-x86/syscalls/socketpair.S
+++ b/libc/arch-x86/syscalls/socketpair.S
@@ -4,10 +4,11 @@
 
 ENTRY(socketpair)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     $8, %ebx
     mov     %esp, %ecx
     addl    $12, %ecx
diff --git a/libc/arch-x86/syscalls/swapoff.S b/libc/arch-x86/syscalls/swapoff.S
index 31f8be1..1657e64 100644
--- a/libc/arch-x86/syscalls/swapoff.S
+++ b/libc/arch-x86/syscalls/swapoff.S
@@ -4,7 +4,7 @@
 
 ENTRY(swapoff)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_swapoff, %eax
diff --git a/libc/arch-x86/syscalls/swapon.S b/libc/arch-x86/syscalls/swapon.S
index 687c492..16d0617 100644
--- a/libc/arch-x86/syscalls/swapon.S
+++ b/libc/arch-x86/syscalls/swapon.S
@@ -4,10 +4,11 @@
 
 ENTRY(swapon)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_swapon, %eax
diff --git a/libc/arch-x86/syscalls/symlinkat.S b/libc/arch-x86/syscalls/symlinkat.S
index 1f33f7b..78f9fa7 100644
--- a/libc/arch-x86/syscalls/symlinkat.S
+++ b/libc/arch-x86/syscalls/symlinkat.S
@@ -4,12 +4,14 @@
 
 ENTRY(symlinkat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/sync.S b/libc/arch-x86/syscalls/sync.S
index f80296f..a0cf66f 100644
--- a/libc/arch-x86/syscalls/sync.S
+++ b/libc/arch-x86/syscalls/sync.S
@@ -4,7 +4,7 @@
 
 ENTRY(sync)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_sync, %eax
diff --git a/libc/arch-x86/syscalls/sysinfo.S b/libc/arch-x86/syscalls/sysinfo.S
index 8b9a23e..1619edb 100644
--- a/libc/arch-x86/syscalls/sysinfo.S
+++ b/libc/arch-x86/syscalls/sysinfo.S
@@ -4,7 +4,7 @@
 
 ENTRY(sysinfo)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_sysinfo, %eax
diff --git a/libc/arch-x86/syscalls/tgkill.S b/libc/arch-x86/syscalls/tgkill.S
index e57645c..69ffdf8 100644
--- a/libc/arch-x86/syscalls/tgkill.S
+++ b/libc/arch-x86/syscalls/tgkill.S
@@ -4,12 +4,14 @@
 
 ENTRY(tgkill)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/timerfd_create.S b/libc/arch-x86/syscalls/timerfd_create.S
index 33b2980..c0bc5b5 100644
--- a/libc/arch-x86/syscalls/timerfd_create.S
+++ b/libc/arch-x86/syscalls/timerfd_create.S
@@ -4,10 +4,11 @@
 
 ENTRY(timerfd_create)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_timerfd_create, %eax
diff --git a/libc/arch-x86/syscalls/timerfd_gettime.S b/libc/arch-x86/syscalls/timerfd_gettime.S
index 66b004b..5dd7ad7 100644
--- a/libc/arch-x86/syscalls/timerfd_gettime.S
+++ b/libc/arch-x86/syscalls/timerfd_gettime.S
@@ -4,10 +4,11 @@
 
 ENTRY(timerfd_gettime)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_timerfd_gettime, %eax
diff --git a/libc/arch-x86/syscalls/timerfd_settime.S b/libc/arch-x86/syscalls/timerfd_settime.S
index 3f4035e..bb027df 100644
--- a/libc/arch-x86/syscalls/timerfd_settime.S
+++ b/libc/arch-x86/syscalls/timerfd_settime.S
@@ -4,14 +4,17 @@
 
 ENTRY(timerfd_settime)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/times.S b/libc/arch-x86/syscalls/times.S
index b9e2845..075750d 100644
--- a/libc/arch-x86/syscalls/times.S
+++ b/libc/arch-x86/syscalls/times.S
@@ -4,7 +4,7 @@
 
 ENTRY(times)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_times, %eax
diff --git a/libc/arch-x86/syscalls/truncate.S b/libc/arch-x86/syscalls/truncate.S
index 019894c..9270a53 100644
--- a/libc/arch-x86/syscalls/truncate.S
+++ b/libc/arch-x86/syscalls/truncate.S
@@ -4,10 +4,11 @@
 
 ENTRY(truncate)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_truncate, %eax
diff --git a/libc/arch-x86/syscalls/truncate64.S b/libc/arch-x86/syscalls/truncate64.S
index 99b71b0..89c2c4a 100644
--- a/libc/arch-x86/syscalls/truncate64.S
+++ b/libc/arch-x86/syscalls/truncate64.S
@@ -4,12 +4,14 @@
 
 ENTRY(truncate64)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/umask.S b/libc/arch-x86/syscalls/umask.S
index 485b326..81df64d 100644
--- a/libc/arch-x86/syscalls/umask.S
+++ b/libc/arch-x86/syscalls/umask.S
@@ -4,7 +4,7 @@
 
 ENTRY(umask)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_umask, %eax
diff --git a/libc/arch-x86/syscalls/umount2.S b/libc/arch-x86/syscalls/umount2.S
index 100d38c..cd21623 100644
--- a/libc/arch-x86/syscalls/umount2.S
+++ b/libc/arch-x86/syscalls/umount2.S
@@ -4,10 +4,11 @@
 
 ENTRY(umount2)
     pushl   %ebx
-    pushl   %ecx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
     mov     12(%esp), %ebx
     mov     16(%esp), %ecx
     movl    $__NR_umount2, %eax
diff --git a/libc/arch-x86/syscalls/uname.S b/libc/arch-x86/syscalls/uname.S
index f1ba3b9..9d65e85 100644
--- a/libc/arch-x86/syscalls/uname.S
+++ b/libc/arch-x86/syscalls/uname.S
@@ -4,7 +4,7 @@
 
 ENTRY(uname)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_uname, %eax
diff --git a/libc/arch-x86/syscalls/unlinkat.S b/libc/arch-x86/syscalls/unlinkat.S
index 1a573d4..68bf05b 100644
--- a/libc/arch-x86/syscalls/unlinkat.S
+++ b/libc/arch-x86/syscalls/unlinkat.S
@@ -4,12 +4,14 @@
 
 ENTRY(unlinkat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/unshare.S b/libc/arch-x86/syscalls/unshare.S
index 95fdbf6..7e48cb1 100644
--- a/libc/arch-x86/syscalls/unshare.S
+++ b/libc/arch-x86/syscalls/unshare.S
@@ -4,7 +4,7 @@
 
 ENTRY(unshare)
     pushl   %ebx
-    .cfi_def_cfa_offset 4
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
     mov     8(%esp), %ebx
     movl    $__NR_unshare, %eax
diff --git a/libc/arch-x86/syscalls/utimensat.S b/libc/arch-x86/syscalls/utimensat.S
index 099f551..4b2a9b6 100644
--- a/libc/arch-x86/syscalls/utimensat.S
+++ b/libc/arch-x86/syscalls/utimensat.S
@@ -4,14 +4,17 @@
 
 ENTRY(utimensat)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/wait4.S b/libc/arch-x86/syscalls/wait4.S
index b6196f8..bd4bd50 100644
--- a/libc/arch-x86/syscalls/wait4.S
+++ b/libc/arch-x86/syscalls/wait4.S
@@ -4,14 +4,17 @@
 
 ENTRY(wait4)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    pushl   %esi
-    .cfi_def_cfa_offset 16
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
-    .cfi_rel_offset esi, 12
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
+    pushl   %esi
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset esi, 0
     mov     20(%esp), %ebx
     mov     24(%esp), %ecx
     mov     28(%esp), %edx
diff --git a/libc/arch-x86/syscalls/write.S b/libc/arch-x86/syscalls/write.S
index 971cb30..a464196 100644
--- a/libc/arch-x86/syscalls/write.S
+++ b/libc/arch-x86/syscalls/write.S
@@ -4,12 +4,14 @@
 
 ENTRY(write)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86/syscalls/writev.S b/libc/arch-x86/syscalls/writev.S
index ab8e705..da9ae7c 100644
--- a/libc/arch-x86/syscalls/writev.S
+++ b/libc/arch-x86/syscalls/writev.S
@@ -4,12 +4,14 @@
 
 ENTRY(writev)
     pushl   %ebx
-    pushl   %ecx
-    pushl   %edx
-    .cfi_def_cfa_offset 12
+    .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
-    .cfi_rel_offset ecx, 4
-    .cfi_rel_offset edx, 8
+    pushl   %ecx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset ecx, 0
+    pushl   %edx
+    .cfi_adjust_cfa_offset 4
+    .cfi_rel_offset edx, 0
     mov     16(%esp), %ebx
     mov     20(%esp), %ecx
     mov     24(%esp), %edx
diff --git a/libc/arch-x86_64/syscalls/gettid.S b/libc/arch-x86_64/syscalls/gettid.S
deleted file mode 100644
index 65ecc16..0000000
--- a/libc/arch-x86_64/syscalls/gettid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(gettid)
-    movl    $__NR_gettid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno
-    orq     $-1, %rax
-1:
-    ret
-END(gettid)
diff --git a/libc/bionic/clone.cpp b/libc/bionic/clone.cpp
index 2c507c4..d38a422 100644
--- a/libc/bionic/clone.cpp
+++ b/libc/bionic/clone.cpp
@@ -32,7 +32,7 @@
 #include <stdarg.h>
 
 extern "C" pid_t __bionic_clone(uint32_t flags, void* child_stack, int* parent_tid, void* tls, int* child_tid, int (*fn)(void*), void* arg);
-extern "C" void __exit(int status);
+extern "C" __noreturn void __exit(int status);
 
 // Called from the __bionic_clone assembler to call the thread function then exit.
 extern "C" __LIBC_HIDDEN__ void __bionic_clone_entry(int (*fn)(void*), void* arg) {
diff --git a/libc/bionic/gettid.cpp b/libc/bionic/gettid.cpp
new file mode 100644
index 0000000..f42e36a
--- /dev/null
+++ b/libc/bionic/gettid.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <unistd.h>
+
+#include "pthread_internal.h"
+
+pid_t gettid() {
+  return __get_thread()->tid;
+}
diff --git a/libc/bionic/pthread_exit.cpp b/libc/bionic/pthread_exit.cpp
index de818cd..2470c9c 100644
--- a/libc/bionic/pthread_exit.cpp
+++ b/libc/bionic/pthread_exit.cpp
@@ -34,8 +34,8 @@
 
 #include "pthread_internal.h"
 
-extern "C" void _exit_with_stack_teardown(void*, size_t);
-extern "C" void __exit(int);
+extern "C" __noreturn void _exit_with_stack_teardown(void*, size_t);
+extern "C" __noreturn void __exit(int);
 extern "C" int __set_tid_address(int*);
 
 /* CAVEAT: our implementation of pthread_cleanup_push/pop doesn't support C++ exceptions
@@ -127,7 +127,4 @@
 
     _exit_with_stack_teardown(stack_base, stack_size);
   }
-
-  // NOTREACHED, but we told the compiler this function is noreturn, and it doesn't believe us.
-  abort();
 }
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index c6b2d32..90f595c 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -253,8 +253,6 @@
 int dprintf(int, const char * __restrict, ...) __printflike(2, 3);
 int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0);
 
-int fdprintf(int, const char * __restrict, ...) __printflike(2, 3); /* Note: this is only in the preview release. */
-
 #ifndef __AUDIT__
 char* gets(char*) __warnattr("gets is very unsafe; consider using fgets");
 int sprintf(char* __restrict, const char* __restrict, ...)
diff --git a/libc/include/sys/atomics.h b/libc/include/sys/atomics.h
deleted file mode 100644
index 3366f0e..0000000
--- a/libc/include/sys/atomics.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-#ifndef _SYS_ATOMICS_H
-#define _SYS_ATOMICS_H
-
-#include <sys/cdefs.h>
-#include <sys/time.h>
-
-/* Note: this is only in the preview release. */
-
-__BEGIN_DECLS
-
-#define __ATOMIC_INLINE__ static __inline__ __attribute__((always_inline))
-
-__ATOMIC_INLINE__ int
-__atomic_cmpxchg(int old_value, int new_value, volatile int* ptr)
-{
-    /* We must return 0 on success */
-    return __sync_val_compare_and_swap(ptr, old_value, new_value) != old_value;
-}
-
-__ATOMIC_INLINE__ int
-__atomic_swap(int new_value, volatile int *ptr)
-{
-    int old_value;
-    do {
-        old_value = *ptr;
-    } while (__sync_val_compare_and_swap(ptr, old_value, new_value) != old_value);
-    return old_value;
-}
-
-__ATOMIC_INLINE__ int
-__atomic_dec(volatile int *ptr)
-{
-  return __sync_fetch_and_sub (ptr, 1);
-}
-
-__ATOMIC_INLINE__ int
-__atomic_inc(volatile int *ptr)
-{
-  return __sync_fetch_and_add (ptr, 1);
-}
-
-
-__END_DECLS
-
-#endif /* _SYS_ATOMICS_H */
diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py
index 87d51e3..5e4ddc5 100755
--- a/libc/tools/gensyscalls.py
+++ b/libc/tools/gensyscalls.py
@@ -323,17 +323,20 @@
     stack_bias = numparams*4 + 4
     offset = 0
     mov_result = ""
-    cfi_result = "    .cfi_def_cfa_offset %d\n" % (numparams*4)
+    first_push = True
     for register in x86_registers[:numparams]:
         result     += "    pushl   %%%s\n" % register
+        if first_push:
+          result   += "    .cfi_def_cfa_offset 8\n"
+          result   += "    .cfi_rel_offset %s, 0\n" % register
+          first_push = False
+        else:
+          result   += "    .cfi_adjust_cfa_offset 4\n"
+          result   += "    .cfi_rel_offset %s, 0\n" % register
         mov_result += "    mov     %d(%%esp), %%%s\n" % (stack_bias+offset, register)
-        cfi_result += "    .cfi_rel_offset %s, %d\n" % (register, offset)
         offset += 4
 
-    if numparams:
-        result += cfi_result
-        result += mov_result
-
+    result += mov_result
     result += x86_call % syscall
 
     for register in reversed(x86_registers[:numparams]):
@@ -353,10 +356,11 @@
 
     # save the regs we need
     result += "    pushl   %ebx\n"
-    result += "    pushl   %ecx\n"
     result += "    .cfi_def_cfa_offset 8\n"
     result += "    .cfi_rel_offset ebx, 0\n"
-    result += "    .cfi_rel_offset ecx, 4\n"
+    result += "    pushl   %ecx\n"
+    result += "    .cfi_adjust_cfa_offset 4\n"
+    result += "    .cfi_rel_offset ecx, 0\n"
     stack_bias = 12
 
     # set the call id (%ebx)
diff --git a/tests/Android.mk b/tests/Android.mk
index d753acc..db8dd8c 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -86,7 +86,6 @@
     signal_test.cpp \
     stack_protector_test.cpp \
     stack_unwinding_test.cpp \
-    stack_unwinding_test_impl.c \
     stdatomic_test.cpp \
     stdint_test.cpp \
     stdio_test.cpp \
@@ -121,6 +120,9 @@
 libBionicStandardTests_ldlibs_host := \
     -lrt \
 
+libBionicStandardTests_whole_static_libraries := \
+    libBionicUnwindTest \
+
 module := libBionicStandardTests
 module_tag := optional
 build_type := target
@@ -130,6 +132,25 @@
 include $(LOCAL_PATH)/Android.build.mk
 
 # -----------------------------------------------------------------------------
+# Special stack unwinding test library compiled with special flags.
+# -----------------------------------------------------------------------------
+libBionicUnwindTest_cflags := \
+    $(test_cflags) \
+    -fexceptions \
+    -fnon-call-exceptions \
+
+libBionicUnwindTest_src_files := \
+    stack_unwinding_test_impl.c \
+
+module := libBionicUnwindTest
+module_tag := optional
+build_type := target
+build_target := STATIC_TEST_LIBRARY
+include $(LOCAL_PATH)/Android.build.mk
+build_type := host
+include $(LOCAL_PATH)/Android.build.mk
+
+# -----------------------------------------------------------------------------
 # Fortify tests.
 # -----------------------------------------------------------------------------
 $(foreach compiler,gcc clang, \
@@ -291,8 +312,10 @@
     atexit_testlib.cpp
 
 module := libtest_atexit
-build_type := target
 build_target := SHARED_LIBRARY
+build_type := target
+include $(LOCAL_PATH)/Android.build.mk
+build_type := host
 include $(LOCAL_PATH)/Android.build.mk
 
 # -----------------------------------------------------------------------------
diff --git a/tests/atexit_testlib.cpp b/tests/atexit_testlib.cpp
index 1fefdf0..d35f57b 100644
--- a/tests/atexit_testlib.cpp
+++ b/tests/atexit_testlib.cpp
@@ -71,6 +71,5 @@
   atexit_valid_this_in_static_dtor = valid_this_in_static_dtor;
   atexit(atexit_handler_regular);
   atexit(atexit_handler_with_atexit);
-  atexit(NULL);
 }