Merge "Reland ifuncs for strcmp and strlen."
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 9421e26..8865723 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -53,6 +53,10 @@
 $(call add-clean-step, rm -f $(PRODUCT_OUT)/system/lib/libGLES*)
 $(call add-clean-step, rm -f $(PRODUCT_OUT)/system/lib64/libGLES*)
 
+# /bionic is removed
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/bionic)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/bionic)
+
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
 # ************************************************
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
index f7c8fd7..7b533a4 100644
--- a/PREUPLOAD.cfg
+++ b/PREUPLOAD.cfg
@@ -1,5 +1,2 @@
 [Hook Scripts]
 notice = tools/update_notice.sh
-seccomp = tools/update_seccomp.sh
-syscalls = tools/update_syscalls.sh
-version_scripts = tools/update_version_scripts.sh
diff --git a/README.md b/README.md
index 12c5235..5f78249 100644
--- a/README.md
+++ b/README.md
@@ -162,17 +162,16 @@
 
   1. Add entries to SYSCALLS.TXT.
      See SYSCALLS.TXT itself for documentation on the format.
-  2. Run the gensyscalls.py script.
-  3. Add constants (and perhaps types) to the appropriate header file.
+  2. Add constants (and perhaps types) to the appropriate header file.
      Note that you should check to see whether the constants are already in
      kernel uapi header files, in which case you just need to make sure that
      the appropriate POSIX header file in libc/include/ includes the
      relevant file or files.
-  4. Add function declarations to the appropriate header file. Don't forget
+  3. Add function declarations to the appropriate header file. Don't forget
      to include the appropriate `__INTRODUCED_IN()`.
-  5. Add the function name to the correct section in libc/libc.map.txt and
+  4. Add the function name to the correct section in libc/libc.map.txt and
      run `./libc/tools/genversion-scripts.py`.
-  6. Add at least basic tests. Even a test that deliberately supplies
+  5. Add at least basic tests. Even a test that deliberately supplies
      an invalid argument helps check that we're generating the right symbol
      and have the right declaration in the header file, and that you correctly
      updated the maps in step 5. (You can use strace(1) to confirm that the
diff --git a/TEST_MAPPING b/TEST_MAPPING
new file mode 100644
index 0000000..e4d3d5e
--- /dev/null
+++ b/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+  "presubmit": [
+    {
+      "name": "CtsBionicTestCases"
+    }
+  ]
+}
diff --git a/android-changes-for-ndk-developers.md b/android-changes-for-ndk-developers.md
index 1630db8..1fdb1e4 100644
--- a/android-changes-for-ndk-developers.md
+++ b/android-changes-for-ndk-developers.md
@@ -330,6 +330,16 @@
 configured your build system to generate incorrect SONAME entries (using
 the -soname linker option).
 
+## `__register_atfork` (Available in API level >= 23)
+
+To allow `atfork` and `pthread_atfork` handlers to be unregistered on
+`dlclose`, the implementation changed in API level 23. Unfortunately this
+requires a new libc function `__register_atfork`. Code using these functions
+that is built with a target API level >= 23 therefore will not load on earlier
+versions of Android, with an error referencing `__register_atfork`.
+
+*Resolution*: build your code with an NDK target API level that matches your
+app's minimum API level, or avoid using `atfork`/`pthread_atfork`.
 
 ## DT_RUNPATH support (Available in API level >= 24)
 
@@ -417,3 +427,17 @@
 | No workaround     | Works for static STL       | Broken  | Works |
 | `-Wl,-z,nodelete` | Works for static STL       | Works   | Works |
 | No `dlclose`      | Works                      | Works   | Works |
+
+## Use of IFUNC in libc (True for all API levels on devices running Q)
+
+Starting with Android Q (API level 29), libc uses
+[IFUNC](https://sourceware.org/glibc/wiki/GNU_IFUNC) functionality in
+the dynamic linker to choose optimized assembler routines at run time
+rather than at build time. This lets us use the same `libc.so` on all
+devices, and is similar to what other OSes already did. Because the zygote
+uses the C library, this decision is made long before we know what API
+level an app targets, so all code sees the new IFUNC-using C library.
+Most apps should be unaffected by this change, but apps that hook or try to
+detect hooking of C library functions might need to fix their code to cope
+with IFUNC relocations. The affected functions are from `<string.h>`, but
+may expand to include more functions (and more libraries) in future.
diff --git a/benchmarks/malloc_benchmark.cpp b/benchmarks/malloc_benchmark.cpp
index 2fa1c87..ca54f11 100644
--- a/benchmarks/malloc_benchmark.cpp
+++ b/benchmarks/malloc_benchmark.cpp
@@ -102,22 +102,27 @@
 //       bionic/libc/malloc_debug/tools/gen_malloc.pl -i <THREAD_ID> g_sql_entries kMaxSqlAllocSlots < <ALLOC_FILE> > malloc_sql.h
 #include "malloc_sql.h"
 
-static void BM_malloc_sql_trace_decay_time_0(benchmark::State& state) {
+static void BM_malloc_sql_trace_default(benchmark::State& state) {
+  // The default is expected to be a zero decay time.
   mallopt(M_DECAY_TIME, 0);
-  for (auto _ : state) {
-    BenchmarkMalloc(g_sql_entries, sizeof(g_sql_entries) / sizeof(MallocEntry),
-                    kMaxSqlAllocSlots);
-  }
-}
-BIONIC_BENCHMARK(BM_malloc_sql_trace_decay_time_0);
 
-static void BM_malloc_sql_trace_decay_time_1(benchmark::State& state) {
-  mallopt(M_DECAY_TIME, 1);
   for (auto _ : state) {
     BenchmarkMalloc(g_sql_entries, sizeof(g_sql_entries) / sizeof(MallocEntry),
                     kMaxSqlAllocSlots);
   }
 }
-BIONIC_BENCHMARK(BM_malloc_sql_trace_decay_time_1);
+BIONIC_BENCHMARK(BM_malloc_sql_trace_default);
+
+static void BM_malloc_sql_trace_decay1(benchmark::State& state) {
+  mallopt(M_DECAY_TIME, 1);
+
+  for (auto _ : state) {
+    BenchmarkMalloc(g_sql_entries, sizeof(g_sql_entries) / sizeof(MallocEntry),
+                    kMaxSqlAllocSlots);
+  }
+
+  mallopt(M_DECAY_TIME, 0);
+}
+BIONIC_BENCHMARK(BM_malloc_sql_trace_decay1);
 
 #endif
diff --git a/benchmarks/pthread_benchmark.cpp b/benchmarks/pthread_benchmark.cpp
index 09654c8..9a68a12 100644
--- a/benchmarks/pthread_benchmark.cpp
+++ b/benchmarks/pthread_benchmark.cpp
@@ -100,7 +100,7 @@
 struct PIMutex {
   pthread_mutex_t mutex;
 
-  PIMutex(int type) {
+  explicit PIMutex(int type) {
     pthread_mutexattr_t attr;
     pthread_mutexattr_init(&attr);
     pthread_mutexattr_settype(&attr, type);
diff --git a/benchmarks/semaphore_benchmark.cpp b/benchmarks/semaphore_benchmark.cpp
index ba89137..cf51489 100644
--- a/benchmarks/semaphore_benchmark.cpp
+++ b/benchmarks/semaphore_benchmark.cpp
@@ -80,7 +80,7 @@
 
 class SemaphoreFixture : public benchmark::Fixture {
  public:
-  void SetUp(const benchmark::State&) {
+  void SetUp(const benchmark::State&) override {
     sem_init(&semaphore, 0, 0);
 
     pthread_attr_t attr;
@@ -100,7 +100,7 @@
     setup = true;
   }
 
-  ~SemaphoreFixture() {
+  ~SemaphoreFixture() override {
     if (setup) {
       // Only do this if the test was actually run.
       sched_setscheduler(0, SCHED_OTHER, &param);
diff --git a/benchmarks/stdlib_benchmark.cpp b/benchmarks/stdlib_benchmark.cpp
index 7330dc4..6afe7aa 100644
--- a/benchmarks/stdlib_benchmark.cpp
+++ b/benchmarks/stdlib_benchmark.cpp
@@ -17,30 +17,120 @@
 #include <err.h>
 #include <langinfo.h>
 #include <locale.h>
+#include <malloc.h>
 #include <stdlib.h>
 #include <unistd.h>
 
 #include <benchmark/benchmark.h>
 #include "util.h"
 
-static void BM_stdlib_malloc_free(benchmark::State& state) {
+#if defined(__BIONIC__)
+
+#else
+#endif
+
+static __always_inline void MakeAllocationResident(void* ptr, size_t nbytes, int pagesize) {
+  uint8_t* data = reinterpret_cast<uint8_t*>(ptr);
+  for (size_t i = 0; i < nbytes; i += pagesize) {
+    data[i] = 1;
+  }
+}
+
+static void MallocFree(benchmark::State& state) {
   const size_t nbytes = state.range(0);
   int pagesize = getpagesize();
 
-  void* ptr;
   for (auto _ : state) {
-    ptr = malloc(nbytes);
-    // Make the entire allocation resident.
-    uint8_t* data = reinterpret_cast<uint8_t*>(ptr);
-    for (size_t i = 0; i < nbytes; i += pagesize) {
-      data[i] = 1;
-    }
+    void* ptr;
+    benchmark::DoNotOptimize(ptr = malloc(nbytes));
+    MakeAllocationResident(ptr, nbytes, pagesize);
     free(ptr);
   }
 
   state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes));
 }
-BIONIC_BENCHMARK_WITH_ARG(BM_stdlib_malloc_free, "AT_COMMON_SIZES");
+
+static void BM_stdlib_malloc_free_default(benchmark::State& state) {
+#if defined(__BIONIC__)
+  // The default is expected to be a zero decay time.
+  mallopt(M_DECAY_TIME, 0);
+#endif
+
+  MallocFree(state);
+}
+BIONIC_BENCHMARK_WITH_ARG(BM_stdlib_malloc_free_default, "AT_COMMON_SIZES");
+
+#if defined(__BIONIC__)
+static void BM_stdlib_malloc_free_decay1(benchmark::State& state) {
+  mallopt(M_DECAY_TIME, 1);
+
+  MallocFree(state);
+
+  mallopt(M_DECAY_TIME, 0);
+}
+BIONIC_BENCHMARK_WITH_ARG(BM_stdlib_malloc_free_decay1, "AT_COMMON_SIZES");
+#endif
+
+static void MallocMultiple(benchmark::State& state, size_t nbytes, size_t numAllocs) {
+  int pagesize = getpagesize();
+  void* ptrs[numAllocs];
+  for (auto _ : state) {
+    for (size_t i = 0; i < numAllocs; i++) {
+      benchmark::DoNotOptimize(ptrs[i] = reinterpret_cast<uint8_t*>(malloc(nbytes)));
+      MakeAllocationResident(ptrs[i], nbytes, pagesize);
+    }
+    state.PauseTiming(); // Stop timers while freeing pointers.
+    for (size_t i = 0; i < numAllocs; i++) {
+      free(ptrs[i]);
+    }
+    state.ResumeTiming();
+  }
+
+  state.SetBytesProcessed(uint64_t(state.iterations()) * uint64_t(nbytes) * numAllocs);
+}
+
+void BM_stdlib_malloc_forty_default(benchmark::State& state) {
+
+#if defined(__BIONIC__)
+  // The default is expected to be a zero decay time.
+  mallopt(M_DECAY_TIME, 0);
+#endif
+
+  MallocMultiple(state, state.range(0), 40);
+}
+BIONIC_BENCHMARK_WITH_ARG(BM_stdlib_malloc_forty_default, "AT_COMMON_SIZES");
+
+#if defined(__BIONIC__)
+void BM_stdlib_malloc_forty_decay1(benchmark::State& state) {
+  mallopt(M_DECAY_TIME, 1);
+
+  MallocMultiple(state, state.range(0), 40);
+
+  mallopt(M_DECAY_TIME, 0);
+}
+BIONIC_BENCHMARK_WITH_ARG(BM_stdlib_malloc_forty_decay1, "AT_COMMON_SIZES");
+#endif
+
+void BM_stdlib_malloc_multiple_8192_allocs_default(benchmark::State& state) {
+#if defined(__BIONIC__)
+  // The default is expected to be a zero decay time.
+  mallopt(M_DECAY_TIME, 0);
+#endif
+
+  MallocMultiple(state, 8192, state.range(0));
+}
+BIONIC_BENCHMARK_WITH_ARG(BM_stdlib_malloc_multiple_8192_allocs_default, "AT_SMALL_SIZES");
+
+#if defined(__BIONIC__)
+void BM_stdlib_malloc_multiple_8192_allocs_decay1(benchmark::State& state) {
+  mallopt(M_DECAY_TIME, 1);
+
+  MallocMultiple(state, 8192, state.range(0));
+
+  mallopt(M_DECAY_TIME, 0);
+}
+BIONIC_BENCHMARK_WITH_ARG(BM_stdlib_malloc_multiple_8192_allocs_decay1, "AT_SMALL_SIZES");
+#endif
 
 static void BM_stdlib_mbstowcs(benchmark::State& state) {
   const size_t buf_alignment = state.range(0);
@@ -167,3 +257,4 @@
   }
 }
 BIONIC_BENCHMARK(BM_stdlib_strtoull);
+
diff --git a/docs/status.md b/docs/status.md
index 54385a4..d6a2f4c 100644
--- a/docs/status.md
+++ b/docs/status.md
@@ -45,11 +45,21 @@
   * `getloadavg` (BSD/GNU extension in <stdlib.h>)
 
 New libc behavior in Q (API level 29):
-  * Whole printf family now supports the GNU `%m` extension, rather than a special-case hack in `syslog`
-  * `popen` now always uses `O_CLOEXEC`, not just with the `e` extension
-  * Bug fixes to handling of UTF-8 U+fffe/U+ffff and code points above U+10ffff
+  * Whole printf family now supports the GNU `%m` extension, rather than a
+    special-case hack in `syslog`.
+  * `popen` now always uses `O_CLOEXEC`, not just with the `e` extension.
+  * Bug fixes to handling of UTF-8 U+fffe/U+ffff and code points above U+10ffff.
+  * `aligned_alloc` correctly verifies that `size` is a multiple of `alignment`.
+  * Using `%n` with the printf family is now reported as a FORTIFY failure.
+    Previous versions of Android would ignore the `%n` but not consume the
+    corresponding pointer argument, leading to obscure errors. The scanf family
+    is unchanged.
+  * Support in strptime for `%F`, `%G`, `%g`, `%P`, `%u`, `%V`, and `%v`.
+    (strftime already supported them all.)
+  * [fdsan](fdsan.md) detects common file descriptor errors at runtime.
 
 New libc functions in P (API level 28):
+  * `aligned_alloc`
   * `__freading`/`__fwriting` (completing <stdio_ext.h>)
   * `endhostent`/`endnetent`/`endprotoent`/`getnetent`/`getprotoent`/`sethostent`/`setnetent`/`setprotoent` (completing <netdb.h>)
   * `fexecve`
@@ -67,9 +77,13 @@
   * `syncfs`
 
 New libc behavior in P (API level 28):
-  * `%C` and `%S` support in the printf family (previously only the wprintf family supported these)
-  * `%mc`/`%ms`/`%m[` support in the scanf family
-  * `%s` support in strptime (strftime already supported it)
+  * `%C` and `%S` support in the printf family (previously only the wprintf family supported these).
+  * `%mc`/`%ms`/`%m[` support in the scanf family.
+  * `%s` support in strptime (strftime already supported it).
+  * Using a `pthread_mutex_t` after it's been destroyed will be detected at
+    runtime and reported as a FORTIFY failure.
+  * Passing a null `FILE*` or `DIR*` to libc is now detected at runtime and
+    reported as a FORTIFY failure.
 
 New libc functions in O (API level 26):
   * `sendto` FORTIFY support
@@ -94,6 +108,11 @@
   * `strtod_l`/`strtof_l`/`strtol_l`/`strtoul_l`
   * <wctype.h> `towctrans`/`towctrans_l`/`wctrans`/`wctrans_l`
 
+New libc behavior in O (API level 26):
+  * Passing an invalid `pthread_t` to libc is now detected at runtime and
+    reported as a FORTIFY failure. Most commonly this is a result of confusing
+    `pthread_t` and `pid_t`.
+
 New libc functions in N (API level 24):
   * more FORTIFY support functions (`fread`/`fwrite`/`getcwd`/`pwrite`/`write`)
   * all remaining `_FILE_OFFSET_BITS=64` functions, completing `_FILE_OFFSET_BITS=64` support in bionic (8)
@@ -106,6 +125,9 @@
   * GNU extensions `fileno_unlocked`/`strchrnul`
   * 32-bit `prlimit`
 
+New libc behavior in N (API level 24):
+  * `sem_wait` now returns EINTR when interrupted by a signal.
+
 New libc functions in M (API level 23):
   * <dirent.h> `telldir`, `seekdir`.
   * <malloc.h> `malloc_info`.
diff --git a/libc/Android.bp b/libc/Android.bp
index 0098d07..2217ef7 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -77,8 +77,9 @@
     native_coverage: false,
     recovery_available: true,
 
-    // TODO(ivanlozano): Remove after b/118321713
-    xom: false,
+    // lld complains about duplicate symbols in libcrt and libgcc. Suppress the
+    // warning since this is intended right now.
+    ldflags: ["-Wl,-z,muldefs"],
 }
 
 // ========================================================
@@ -328,13 +329,10 @@
         "upstream-netbsd/lib/libc/regex/regexec.c",
         "upstream-netbsd/lib/libc/regex/regfree.c",
         "upstream-netbsd/lib/libc/stdlib/bsearch.c",
-        "upstream-netbsd/lib/libc/stdlib/div.c",
         "upstream-netbsd/lib/libc/stdlib/drand48.c",
         "upstream-netbsd/lib/libc/stdlib/erand48.c",
         "upstream-netbsd/lib/libc/stdlib/jrand48.c",
         "upstream-netbsd/lib/libc/stdlib/lcong48.c",
-        "upstream-netbsd/lib/libc/stdlib/ldiv.c",
-        "upstream-netbsd/lib/libc/stdlib/lldiv.c",
         "upstream-netbsd/lib/libc/stdlib/lrand48.c",
         "upstream-netbsd/lib/libc/stdlib/mrand48.c",
         "upstream-netbsd/lib/libc/stdlib/nrand48.c",
@@ -343,10 +341,6 @@
         "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
         "upstream-netbsd/lib/libc/stdlib/seed48.c",
         "upstream-netbsd/lib/libc/stdlib/srand48.c",
-        "upstream-netbsd/lib/libc/string/memccpy.c",
-        "upstream-netbsd/lib/libc/string/strcasestr.c",
-        "upstream-netbsd/lib/libc/string/strcoll.c",
-        "upstream-netbsd/lib/libc/string/strxfrm.c",
     ],
     multilib: {
         lib32: {
@@ -456,19 +450,25 @@
         "upstream-openbsd/lib/libc/stdio/wbuf.c",
         "upstream-openbsd/lib/libc/stdio/wsetup.c",
         "upstream-openbsd/lib/libc/stdlib/abs.c",
+        "upstream-openbsd/lib/libc/stdlib/div.c",
         "upstream-openbsd/lib/libc/stdlib/getenv.c",
         "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
         "upstream-openbsd/lib/libc/stdlib/insque.c",
         "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
         "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
         "upstream-openbsd/lib/libc/stdlib/labs.c",
+        "upstream-openbsd/lib/libc/stdlib/ldiv.c",
         "upstream-openbsd/lib/libc/stdlib/llabs.c",
+        "upstream-openbsd/lib/libc/stdlib/lldiv.c",
         "upstream-openbsd/lib/libc/stdlib/lsearch.c",
         "upstream-openbsd/lib/libc/stdlib/remque.c",
         "upstream-openbsd/lib/libc/stdlib/setenv.c",
         "upstream-openbsd/lib/libc/stdlib/tfind.c",
         "upstream-openbsd/lib/libc/stdlib/tsearch.c",
+        "upstream-openbsd/lib/libc/string/memccpy.c",
         "upstream-openbsd/lib/libc/string/strcasecmp.c",
+        "upstream-openbsd/lib/libc/string/strcasestr.c",
+        "upstream-openbsd/lib/libc/string/strcoll.c",
         "upstream-openbsd/lib/libc/string/strcspn.c",
         "upstream-openbsd/lib/libc/string/strdup.c",
         "upstream-openbsd/lib/libc/string/strndup.c",
@@ -477,6 +477,7 @@
         "upstream-openbsd/lib/libc/string/strspn.c",
         "upstream-openbsd/lib/libc/string/strstr.c",
         "upstream-openbsd/lib/libc/string/strtok.c",
+        "upstream-openbsd/lib/libc/string/strxfrm.c",
         "upstream-openbsd/lib/libc/string/wcslcpy.c",
         "upstream-openbsd/lib/libc/string/wcswidth.c",
     ],
@@ -760,10 +761,11 @@
                 "arch-arm/generic/bionic/strcpy.S",
                 "arch-arm/generic/bionic/strlen.c",
 
+                "arch-arm/bionic/__aeabi_read_tp.S",
                 "arch-arm/bionic/atomics_arm.c",
                 "arch-arm/bionic/__bionic_clone.S",
                 "arch-arm/bionic/_exit_with_stack_teardown.S",
-                "arch-arm/bionic/libgcc_compat.c",
+                "arch-arm/bionic/libcrt_compat.c",
                 "arch-arm/bionic/popcount_tab.c",
                 "arch-arm/bionic/__restore.S",
                 "arch-arm/bionic/setjmp.S",
@@ -847,7 +849,7 @@
                 "arch-mips/bionic/__bionic_clone.S",
                 "arch-mips/bionic/cacheflush.cpp",
                 "arch-mips/bionic/_exit_with_stack_teardown.S",
-                "arch-mips/bionic/libgcc_compat.c",
+                "arch-mips/bionic/libcrt_compat.c",
                 "arch-mips/bionic/setjmp.S",
                 "arch-mips/bionic/syscall.S",
                 "arch-mips/bionic/vfork.S",
@@ -917,7 +919,7 @@
 
                 "arch-x86/bionic/__bionic_clone.S",
                 "arch-x86/bionic/_exit_with_stack_teardown.S",
-                "arch-x86/bionic/libgcc_compat.c",
+                "arch-x86/bionic/libcrt_compat.c",
                 "arch-x86/bionic/__restore.S",
                 "arch-x86/bionic/setjmp.S",
                 "arch-x86/bionic/syscall.S",
@@ -1013,6 +1015,7 @@
         "bionic/arpa_inet.cpp",
         "bionic/assert.cpp",
         "bionic/atof.cpp",
+        "bionic/bionic_allocator.cpp",
         "bionic/bionic_arc4random.cpp",
         "bionic/bionic_futex.cpp",
         "bionic/bionic_netlink.cpp",
@@ -1078,7 +1081,6 @@
         "bionic/locale.cpp",
         "bionic/lockf.cpp",
         "bionic/lstat.cpp",
-        "bionic/malloc_info.cpp",
         "bionic/mblen.cpp",
         "bionic/mbrtoc16.cpp",
         "bionic/mbrtoc32.cpp",
@@ -1198,6 +1200,7 @@
 cc_library_static {
     defaults: ["libc_defaults"],
     srcs: [
+        "bionic/bionic_elf_tls.cpp",
         "bionic/pthread_atfork.cpp",
         "bionic/pthread_attr.cpp",
         "bionic/pthread_barrier.cpp",
@@ -1238,27 +1241,53 @@
 // libc_syscalls.a
 // ========================================================
 
+genrule {
+    name: "syscalls-arm.S",
+    out: ["syscalls-arm.S"],
+    srcs: ["SYSCALLS.TXT"],
+    tool_files: [":bionic-gensyscalls"],
+    cmd: "$(location :bionic-gensyscalls) arm $(in) > $(out)",
+}
+
+genrule {
+    name: "syscalls-arm64.S",
+    out: ["syscalls-arm64.S"],
+    srcs: ["SYSCALLS.TXT"],
+    tool_files: [":bionic-gensyscalls"],
+    cmd: "$(location :bionic-gensyscalls) arm64 $(in) > $(out)",
+}
+
+genrule {
+    name: "syscalls-x86.S",
+    out: ["syscalls-x86.S"],
+    srcs: ["SYSCALLS.TXT"],
+    tool_files: [":bionic-gensyscalls"],
+    cmd: "$(location :bionic-gensyscalls) x86 $(in) > $(out)",
+}
+
+genrule {
+    name: "syscalls-x86_64.S",
+    out: ["syscalls-x86_64.S"],
+    srcs: ["SYSCALLS.TXT"],
+    tool_files: [":bionic-gensyscalls"],
+    cmd: "$(location :bionic-gensyscalls) x86_64 $(in) > $(out)",
+}
+
 cc_library_static {
     defaults: ["libc_defaults"],
     srcs: ["bionic/__set_errno.cpp"],
     arch: {
         arm: {
-            srcs: ["arch-arm/syscalls/**/*.S"],
+            srcs: [":syscalls-arm.S"],
         },
         arm64: {
-            srcs: ["arch-arm64/syscalls/**/*.S"],
-        },
-        mips: {
-            srcs: ["arch-mips/syscalls/**/*.S"],
-        },
-        mips64: {
-            srcs: ["arch-mips64/syscalls/**/*.S"],
+            srcs: [":syscalls-arm64.S"],
         },
         x86: {
-            srcs: ["arch-x86/syscalls/**/*.S"],
+            srcs: [":syscalls-x86.S"],
         },
         x86_64: {
-            srcs: ["arch-x86_64/syscalls/**/*.S"],
+            srcs: [":syscalls-x86_64.S"],
         },
     },
     name: "libc_syscalls",
@@ -1297,7 +1326,10 @@
 cc_library_static {
     name: "libc_ndk",
     defaults: ["libc_defaults"],
-    srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
+    srcs: libc_common_src_files + [
+        "bionic/malloc_common.cpp",
+        "bionic/malloc_limit.cpp",
+    ],
     multilib: {
         lib32: {
             srcs: libc_common_src_files_32,
@@ -1485,6 +1517,9 @@
         "arch-common/bionic/crtbrand.S",
         "bionic/icu.cpp",
         "bionic/malloc_common.cpp",
+        "bionic/malloc_common_dynamic.cpp",
+        "bionic/malloc_heapprofd.cpp",
+        "bionic/malloc_limit.cpp",
         "bionic/NetdClient.cpp",
         "arch-common/bionic/crtend_so.S",
     ],
@@ -1495,6 +1530,7 @@
     srcs: [
         "bionic/dl_iterate_phdr_static.cpp",
         "bionic/malloc_common.cpp",
+        "bionic/malloc_limit.cpp",
     ],
 }
 
@@ -1563,6 +1599,9 @@
         "ld-android",
         "libdl",
     ],
+    static_libs: [
+        "libdl_android",
+    ],
     whole_static_libs: [
         "libjemalloc5",
     ],
@@ -1571,12 +1610,11 @@
 
     arch: {
         arm: {
-            //TODO: This is to work around b/24465209. Remove after root cause is fixed
+            // TODO: This is to work around b/24465209. Remove after root cause is fixed.
             pack_relocations: false,
             ldflags: ["-Wl,--hash-style=both"],
 
-            // Don't re-export new/delete and friends, even if the compiler really wants to.
-            version_script: "libc.arm.map",
+            version_script: ":libc.arm.map",
 
             shared: {
                 srcs: [":libc_sources_shared_arm"],
@@ -1588,35 +1626,117 @@
             },
         },
         arm64: {
-            // Don't re-export new/delete and friends, even if the compiler really wants to.
-            version_script: "libc.arm64.map",
-        },
-        mips: {
-            // Don't re-export new/delete and friends, even if the compiler really wants to.
-            version_script: "libc.mips.map",
-        },
-        mips64: {
-            // Don't re-export new/delete and friends, even if the compiler really wants to.
-            version_script: "libc.mips64.map",
+            version_script: ":libc.arm64.map",
         },
         x86: {
-            //TODO: This is to work around b/24465209. Remove after root cause is fixed
+            // TODO: This is to work around b/24465209. Remove after root cause is fixed.
             pack_relocations: false,
             ldflags: ["-Wl,--hash-style=both"],
 
-            // Don't re-export new/delete and friends, even if the compiler really wants to.
-            version_script: "libc.x86.map",
+            version_script: ":libc.x86.map",
         },
         x86_64: {
-            // Don't re-export new/delete and friends, even if the compiler really wants to.
-            version_script: "libc.x86_64.map",
+            version_script: ":libc.x86_64.map",
+        },
+    },
+
+    stubs: {
+        symbol_file: "libc.map.txt",
+        versions: ["10000"],
+    },
+
+    symbol_ordering_file: "symbol_ordering",
+}
+
+genrule {
+    name: "libc.arm.map",
+    out: ["libc.arm.map"],
+    srcs: ["libc.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
+}
+
+genrule {
+    name: "libc.arm64.map",
+    out: ["libc.arm64.map"],
+    srcs: ["libc.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
+}
+
+genrule {
+    name: "libc.x86.map",
+    out: ["libc.x86.map"],
+    srcs: ["libc.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
+}
+
+genrule {
+    name: "libc.x86_64.map",
+    out: ["libc.x86_64.map"],
+    srcs: ["libc.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
+}
+
+// libc_headers for libasync_safe and libpropertyinfoparser
+cc_library_headers {
+    name: "libc_headers",
+
+    host_supported: true,
+    vendor_available: true,
+    recovery_available: true,
+
+    no_libcrt: true,
+    no_libgcc: true,
+    stl: "none",
+    system_shared_libs: [],
+
+    export_include_dirs: [
+        "include",
+        "kernel/uapi",
+        "kernel/android/uapi",
+    ],
+
+    arch: {
+        arm: {
+            export_include_dirs: [
+                "kernel/uapi/asm-arm",
+            ],
+        },
+        arm64: {
+            export_include_dirs: [
+                "kernel/uapi/asm-arm64",
+            ],
+        },
+        mips: {
+            export_include_dirs: [
+                "kernel/uapi/asm-mips",
+            ],
+        },
+        mips64: {
+            export_include_dirs: [
+                "kernel/uapi/asm-mips",
+            ],
+        },
+        x86: {
+            export_include_dirs: [
+                "kernel/uapi/asm-x86",
+            ],
+        },
+        x86_64: {
+            export_include_dirs: [
+                "kernel/uapi/asm-x86",
+            ],
         },
     },
 }
 
 // ========================================================
-// libstdc++.so + libstdc++.a
+// libstdc++.so and libstdc++.a.
 // ========================================================
+
 cc_library {
     defaults: ["libc_defaults"],
     include_dirs: ["bionic/libstdc++/include"],
@@ -1639,30 +1759,61 @@
     //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
     arch: {
         arm: {
+            // TODO: This is to work around b/24465209. Remove after root cause is fixed.
             pack_relocations: false,
             ldflags: ["-Wl,--hash-style=both"],
-            version_script: "libstdc++.arm.map",
+            version_script: ":libstdc++.arm.map",
         },
         arm64: {
-            version_script: "libstdc++.arm64.map",
-        },
-        mips: {
-            version_script: "libstdc++.mips.map",
-        },
-        mips64: {
-            version_script: "libstdc++.mips64.map",
+            version_script: ":libstdc++.arm64.map",
         },
         x86: {
             pack_relocations: false,
             ldflags: ["-Wl,--hash-style=both"],
-            version_script: "libstdc++.x86.map",
+            version_script: ":libstdc++.x86.map",
         },
         x86_64: {
-            version_script: "libstdc++.x86_64.map",
+            version_script: ":libstdc++.x86_64.map",
         },
     },
 }
 
+genrule {
+    name: "libstdc++.arm.map",
+    out: ["libstdc++.arm.map"],
+    srcs: ["libstdc++.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
+}
+
+genrule {
+    name: "libstdc++.arm64.map",
+    out: ["libstdc++.arm64.map"],
+    srcs: ["libstdc++.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
+}
+
+genrule {
+    name: "libstdc++.x86.map",
+    out: ["libstdc++.x86.map"],
+    srcs: ["libstdc++.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
+}
+
+genrule {
+    name: "libstdc++.x86_64.map",
+    out: ["libstdc++.x86_64.map"],
+    srcs: ["libstdc++.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
+}
+
+// ========================================================
+// crt object files.
+// ========================================================
+
 cc_defaults {
     name: "crt_defaults",
     defaults: ["linux_bionic_supported"],
@@ -1697,7 +1848,6 @@
     stl: "none",
 }
 
-// crt obj files
 cc_object {
     name: "crtbrand",
     // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
@@ -1829,6 +1979,10 @@
     defaults: ["crt_defaults"],
 }
 
+// ========================================================
+// NDK headers.
+// ========================================================
+
 versioned_ndk_headers {
     name: "common_libc",
     from: "include",
@@ -1932,47 +2086,39 @@
     symbol_file: "libc.map.txt",
     export_headers_as_system: true,
     export_preprocessed_headers: ["include"],
+    export_include_dirs: [
+        "kernel/android/uapi",
+        "kernel/uapi",
+    ],
     arch: {
         arm: {
             export_include_dirs: [
-                "kernel/uapi",
                 "kernel/uapi/asm-arm",
-                "kernel/android/uapi",
             ],
         },
         arm64: {
             export_include_dirs: [
-                "kernel/uapi",
                 "kernel/uapi/asm-arm64",
-                "kernel/android/uapi",
             ],
         },
         mips: {
             export_include_dirs: [
-                "kernel/uapi",
                 "kernel/uapi/asm-mips",
-                "kernel/android/uapi",
             ],
         },
         mips64: {
             export_include_dirs: [
-                "kernel/uapi",
                 "kernel/uapi/asm-mips",
-                "kernel/android/uapi",
             ],
         },
         x86: {
             export_include_dirs: [
-                "kernel/uapi",
                 "kernel/uapi/asm-x86",
-                "kernel/android/uapi",
             ],
         },
         x86_64: {
             export_include_dirs: [
-                "kernel/uapi",
                 "kernel/uapi/asm-x86",
-                "kernel/android/uapi",
             ],
         },
     },
@@ -2098,6 +2244,91 @@
     },
 }
 
+python_binary_host {
+    name: "genfunctosyscallnrs",
+    main: "tools/genfunctosyscallnrs.py",
+
+    srcs: [
+        "tools/genseccomp.py",
+        "tools/genfunctosyscallnrs.py",
+        "tools/gensyscalls.py",
+    ],
+
+    data: [
+        "kernel/uapi/**/*.h",
+    ],
+
+    version: {
+        py2: {
+            enabled: true,
+        },
+        py3: {
+            enabled: false,
+        },
+    },
+}
+
+cc_genrule {
+    name: "func_to_syscall_nrs",
+    recovery_available: true,
+    cmd: "$(location genfunctosyscallnrs) --out-dir=$(genDir) $(in)",
+
+    tools: [ "genfunctosyscallnrs" ],
+
+    srcs: [
+        "SYSCALLS.TXT",
+        ":libseccomp_gen_syscall_nrs_arm",
+        ":libseccomp_gen_syscall_nrs_arm64",
+        ":libseccomp_gen_syscall_nrs_mips",
+        ":libseccomp_gen_syscall_nrs_mips64",
+        ":libseccomp_gen_syscall_nrs_x86",
+        ":libseccomp_gen_syscall_nrs_x86_64",
+    ],
+
+    out: [
+        "func_to_syscall_nrs.h",
+    ],
+}
+
+// SECCOMP_BLACKLIST_APP_ZYGOTE.TXT = SECCOMP_BLACKLIST_APP.txt - setresgid*
+genrule {
+    name: "generate_app_zygote_blacklist",
+    out: ["SECCOMP_BLACKLIST_APP_ZYGOTE.TXT"],
+    srcs: ["SECCOMP_BLACKLIST_APP.TXT"],
+    cmd: "grep -v '^int[ \t]*setresgid' $(in) > $(out)",
+}
+
+cc_genrule {
+    name: "libseccomp_policy_app_zygote_sources",
+    recovery_available: true,
+    cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
+
+    tools: [ "genseccomp" ],
+
+    srcs: [
+        "SYSCALLS.TXT",
+        "SECCOMP_WHITELIST_COMMON.TXT",
+        "SECCOMP_WHITELIST_APP.TXT",
+        "SECCOMP_BLACKLIST_COMMON.TXT",
+        ":generate_app_zygote_blacklist",
+        ":libseccomp_gen_syscall_nrs_arm",
+        ":libseccomp_gen_syscall_nrs_arm64",
+        ":libseccomp_gen_syscall_nrs_mips",
+        ":libseccomp_gen_syscall_nrs_mips64",
+        ":libseccomp_gen_syscall_nrs_x86",
+        ":libseccomp_gen_syscall_nrs_x86_64",
+    ],
+
+    out: [
+        "arm64_app_zygote_policy.cpp",
+        "arm_app_zygote_policy.cpp",
+        "mips64_app_zygote_policy.cpp",
+        "mips_app_zygote_policy.cpp",
+        "x86_64_app_zygote_policy.cpp",
+        "x86_app_zygote_policy.cpp",
+    ],
+}
+
 cc_genrule {
     name: "libseccomp_policy_app_sources",
     recovery_available: true,
@@ -2194,8 +2425,10 @@
 cc_library {
     name: "libseccomp_policy",
     recovery_available: true,
+    generated_headers: ["func_to_syscall_nrs"],
     generated_sources: [
         "libseccomp_policy_app_sources",
+        "libseccomp_policy_app_zygote_sources",
         "libseccomp_policy_global_sources",
         "libseccomp_policy_system_sources",
     ],
@@ -2216,3 +2449,54 @@
         static_libs: ["libbase"],
     },
 }
+
+// This is a temporary library that will use scudo as the native memory
+// allocator. To use it, add it as the first shared library.
+cc_library_shared {
+    name: "libc_scudo",
+    vendor_available: true,
+    srcs: [
+        "bionic/malloc_common.cpp",
+        "bionic/malloc_common_dynamic.cpp",
+        "bionic/malloc_heapprofd.cpp",
+        "bionic/malloc_limit.cpp",
+        "bionic/scudo_wrapper.cpp",
+        "bionic/__set_errno.cpp",
+    ],
+    cflags: ["-DUSE_SCUDO"],
+    stl: "none",
+    system_shared_libs: [],
+
+    header_libs: ["libc_headers"],
+
+    static_libs: ["libasync_safe"],
+
+    allow_undefined_symbols: true,
+    shared_libs: ["libscudo_wrapper"],
+
+    arch: {
+        arm: {
+            srcs: [":syscalls-arm.S"],
+        },
+        arm64: {
+            srcs: [":syscalls-arm64.S"],
+        },
+        x86: {
+            srcs: [
+                "arch-x86/bionic/__libc_init_sysinfo.cpp",
+                ":syscalls-x86.S",
+            ],
+        },
+        x86_64: {
+            srcs: [":syscalls-x86_64.S"],
+        },
+    },
+
+    // Mark this library as global so it overrides all the allocation
+    // definitions properly.
+    ldflags: ["-Wl,-z,global"],
+}
+
+subdirs = [
+    "bionic/scudo",
+]
diff --git a/libc/NOTICE b/libc/NOTICE
index 40a5704..298901f 100644
--- a/libc/NOTICE
+++ b/libc/NOTICE
@@ -418,50 +418,6 @@
 
 -------------------------------------------------------------------
 
-Copyright (C) 2007 The Android Open Source Project
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
--------------------------------------------------------------------
-
-Copyright (C) 2007 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.
-
--------------------------------------------------------------------
-
 Copyright (C) 2008 The Android Open Source Project
 
 Licensed under the Apache License, Version 2.0 (the "License");
@@ -1068,6 +1024,34 @@
 
 -------------------------------------------------------------------
 
+Copyright (C) 2019 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.
+
+-------------------------------------------------------------------
+
 Copyright (c) 1980, 1983, 1988, 1993
    The Regents of the University of California.  All rights reserved.
 
diff --git a/libc/SECCOMP_BLACKLIST_APP.TXT b/libc/SECCOMP_BLACKLIST_APP.TXT
index 66e24cb..b7a05c4 100644
--- a/libc/SECCOMP_BLACKLIST_APP.TXT
+++ b/libc/SECCOMP_BLACKLIST_APP.TXT
@@ -29,17 +29,21 @@
 # This file is processed by a python script named genseccomp.py.
 
 # Note: Some privileged syscalls are still needed in app process after fork before uid change,
-# including capset and setresuid.
+# including capset and setresuid. This is because the seccomp filter must be installed while
+# the process still has CAP_SYS_ADMIN; changing the uid would remove that capability.
 
 # syscalls to modify IDs
 int     setgid:setgid32(gid_t)     arm,x86
 int     setgid:setgid(gid_t)       arm64,mips,mips64,x86_64
 int     setuid:setuid32(uid_t)    arm,x86
 int     setuid:setuid(uid_t)      arm64,mips,mips64,x86_64
+int     setregid:setregid32(gid_t, gid_t)  arm,x86
+int     setregid:setregid(gid_t, gid_t)    arm64,mips,mips64,x86_64
 int     setreuid:setreuid32(uid_t, uid_t)   arm,x86
 int     setreuid:setreuid(uid_t, uid_t)     arm64,mips,mips64,x86_64
 int     setresgid:setresgid32(gid_t, gid_t, gid_t)   arm,x86
 int     setresgid:setresgid(gid_t, gid_t, gid_t)     arm64,mips,mips64,x86_64
+# setresuid is explicitly allowed, see above.
 int     setfsgid(gid_t)  all
 int     setfsuid(uid_t)  all
 int     setgroups:setgroups32(int, const gid_t*)   arm,x86
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index 772f0e7..e2ea065 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -22,7 +22,8 @@
 #
 #      - Each parameter type is assumed to be stored in 32 bits.
 #
-# This file is processed by a python script named gensyscalls.py.
+# This file is processed by a python script named gensyscalls.py, run via
+# genrules in Android.bp.
 
 int     execve(const char*, char* const*, char* const*)  all
 
diff --git a/libc/arch-arm/bionic/__aeabi_read_tp.S b/libc/arch-arm/bionic/__aeabi_read_tp.S
new file mode 100644
index 0000000..f6f9757
--- /dev/null
+++ b/libc/arch-arm/bionic/__aeabi_read_tp.S
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2018 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 <private/bionic_asm.h>
+
+// For arm32 and -mtp=soft, the compiler uses this function to read the thread
+// pointer for ELF TLS accesses. With -mtp=cp15, the compiler inlines the call
+// instead. GCC defaults to -mtp=auto, which inlines this function with
+// -march=armv7-a. Clang does not yet implement -mtp=auto, and instead defaults
+// to -mtp=soft.
+//  - https://bugs.llvm.org/show_bug.cgi?id=38394.
+//  - https://reviews.llvm.org/D34878?id=114573.
+//
+// This function must preserve every register except r0, ip, lr, and cpsr.
+//
+// See "Run-time ABI for the ARM Architecture"
+// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043d/IHI0043D_rtabi.pdf
+//
+ENTRY(__aeabi_read_tp)
+  // __get_tls()
+  mrc p15, 0, r0, c13, c0, 3
+  bx lr
+END(__aeabi_read_tp)
diff --git a/libc/arch-arm/bionic/libcrt_compat.c b/libc/arch-arm/bionic/libcrt_compat.c
new file mode 100644
index 0000000..ce77a5d
--- /dev/null
+++ b/libc/arch-arm/bionic/libcrt_compat.c
@@ -0,0 +1,225 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+extern char __adddf3;
+extern char __addsf3;
+extern char __aeabi_cdcmpeq;
+extern char __aeabi_cdcmple;
+extern char __aeabi_cdrcmple;
+extern char __aeabi_cfcmpeq;
+extern char __aeabi_cfcmple;
+extern char __aeabi_cfrcmple;
+extern char __aeabi_d2f;
+extern char __aeabi_d2iz;
+extern char __aeabi_d2uiz;
+extern char __aeabi_dadd;
+extern char __aeabi_dcmpeq;
+extern char __aeabi_dcmpge;
+extern char __aeabi_dcmpgt;
+extern char __aeabi_dcmple;
+extern char __aeabi_dcmplt;
+extern char __aeabi_dcmpun;
+extern char __aeabi_ddiv;
+extern char __aeabi_dmul;
+extern char __aeabi_drsub;
+extern char __aeabi_dsub;
+extern char __aeabi_f2d;
+extern char __aeabi_f2iz;
+extern char __aeabi_f2uiz;
+extern char __aeabi_fadd;
+extern char __aeabi_fcmpeq;
+extern char __aeabi_fcmpge;
+extern char __aeabi_fcmpgt;
+extern char __aeabi_fcmple;
+extern char __aeabi_fcmplt;
+extern char __aeabi_fcmpun;
+extern char __aeabi_fdiv;
+extern char __aeabi_fmul;
+extern char __aeabi_frsub;
+extern char __aeabi_fsub;
+extern char __aeabi_i2d;
+extern char __aeabi_i2f;
+extern char __aeabi_idiv;
+extern char __aeabi_idivmod;
+extern char __aeabi_l2d;
+extern char __aeabi_l2f;
+extern char __aeabi_lasr;
+extern char __aeabi_ldivmod;
+extern char __aeabi_llsl;
+extern char __aeabi_llsr;
+extern char __aeabi_lmul;
+extern char __aeabi_ui2d;
+extern char __aeabi_ui2f;
+extern char __aeabi_uidiv;
+extern char __aeabi_uidivmod;
+extern char __aeabi_ul2d;
+extern char __aeabi_ul2f;
+extern char __aeabi_uldivmod;
+extern char __aeabi_unwind_cpp_pr0;
+extern char __aeabi_unwind_cpp_pr1;
+extern char __cmpdf2;
+extern char __cmpsf2;
+extern char __divdf3;
+extern char __divsf3;
+extern char __eqdf2;
+extern char __eqsf2;
+extern char __extendsfdf2;
+extern char __fixdfsi;
+extern char __fixsfsi;
+extern char __fixunsdfsi;
+extern char __floatdidf;
+extern char __floatdisf;
+extern char __floatsidf;
+extern char __floatsisf;
+extern char __floatundidf;
+extern char __floatundisf;
+extern char __floatunsidf;
+extern char __floatunsisf;
+extern char __gedf2;
+extern char __gesf2;
+extern char __gtdf2;
+extern char __gtsf2;
+extern char __gnu_ldivmod_helper;
+extern char __gnu_uldivmod_helper;
+extern char __ledf2;
+extern char __lesf2;
+extern char __ltdf2;
+extern char __ltsf2;
+extern char __muldf3;
+extern char __muldi3;
+extern char __mulsf3;
+extern char __nedf2;
+extern char __nesf2;
+extern char __popcount_tab;
+extern char __popcountsi2;
+extern char __subdf3;
+extern char __subsf3;
+extern char __truncdfsf2;
+extern char __udivdi3;
+extern char __unorddf2;
+extern char __unordsf2;
+
+void* __bionic_libcrt_compat_symbols[] = {
+    &__adddf3,
+    &__addsf3,
+    &__aeabi_cdcmpeq,
+    &__aeabi_cdcmple,
+    &__aeabi_cdrcmple,
+    &__aeabi_cfcmpeq,
+    &__aeabi_cfcmple,
+    &__aeabi_cfrcmple,
+    &__aeabi_d2f,
+    &__aeabi_d2iz,
+    &__aeabi_d2uiz,
+    &__aeabi_dadd,
+    &__aeabi_dcmpeq,
+    &__aeabi_dcmpge,
+    &__aeabi_dcmpgt,
+    &__aeabi_dcmple,
+    &__aeabi_dcmplt,
+    &__aeabi_dcmpun,
+    &__aeabi_ddiv,
+    &__aeabi_dmul,
+    &__aeabi_drsub,
+    &__aeabi_dsub,
+    &__aeabi_f2d,
+    &__aeabi_f2iz,
+    &__aeabi_f2uiz,
+    &__aeabi_fadd,
+    &__aeabi_fcmpeq,
+    &__aeabi_fcmpge,
+    &__aeabi_fcmpgt,
+    &__aeabi_fcmple,
+    &__aeabi_fcmplt,
+    &__aeabi_fcmpun,
+    &__aeabi_fdiv,
+    &__aeabi_fmul,
+    &__aeabi_frsub,
+    &__aeabi_fsub,
+    &__aeabi_i2d,
+    &__aeabi_i2f,
+    &__aeabi_idiv,
+    &__aeabi_idivmod,
+    &__aeabi_l2d,
+    &__aeabi_l2f,
+    &__aeabi_lasr,
+    &__aeabi_ldivmod,
+    &__aeabi_llsl,
+    &__aeabi_llsr,
+    &__aeabi_lmul,
+    &__aeabi_ui2d,
+    &__aeabi_ui2f,
+    &__aeabi_uidiv,
+    &__aeabi_uidivmod,
+    &__aeabi_ul2d,
+    &__aeabi_ul2f,
+    &__aeabi_uldivmod,
+    &__aeabi_unwind_cpp_pr0,
+    &__aeabi_unwind_cpp_pr1,
+    &__cmpdf2,
+    &__cmpsf2,
+    &__divdf3,
+    &__divsf3,
+    &__eqdf2,
+    &__eqsf2,
+    &__extendsfdf2,
+    &__fixdfsi,
+    &__fixsfsi,
+    &__fixunsdfsi,
+    &__floatdidf,
+    &__floatdisf,
+    &__floatsidf,
+    &__floatsisf,
+    &__floatundidf,
+    &__floatundisf,
+    &__floatunsidf,
+    &__floatunsisf,
+    &__gedf2,
+    &__gesf2,
+    &__gtdf2,
+    &__gtsf2,
+    &__gnu_ldivmod_helper,
+    &__gnu_uldivmod_helper,
+    &__ledf2,
+    &__lesf2,
+    &__ltdf2,
+    &__ltsf2,
+    &__muldf3,
+    &__muldi3,
+    &__mulsf3,
+    &__nedf2,
+    &__nesf2,
+    &__popcount_tab,
+    &__popcountsi2,
+    &__subdf3,
+    &__subsf3,
+    &__truncdfsf2,
+    &__udivdi3,
+    &__unorddf2,
+    &__unordsf2,
+};
diff --git a/libc/arch-arm/bionic/libgcc_compat.c b/libc/arch-arm/bionic/libgcc_compat.c
deleted file mode 100644
index abd1422..0000000
--- a/libc/arch-arm/bionic/libgcc_compat.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-extern char __adddf3;
-extern char __addsf3;
-extern char __aeabi_cdcmpeq;
-extern char __aeabi_cdcmple;
-extern char __aeabi_cdrcmple;
-extern char __aeabi_d2f;
-extern char __aeabi_d2iz;
-extern char __aeabi_dadd;
-extern char __aeabi_dcmpeq;
-extern char __aeabi_dcmpge;
-extern char __aeabi_dcmpgt;
-extern char __aeabi_dcmple;
-extern char __aeabi_dcmplt;
-extern char __aeabi_dcmpun;
-extern char __aeabi_ddiv;
-extern char __aeabi_dmul;
-extern char __aeabi_drsub;
-extern char __aeabi_dsub;
-extern char __aeabi_f2d;
-extern char __aeabi_f2iz;
-extern char __aeabi_f2uiz;
-extern char __aeabi_fadd;
-extern char __aeabi_fcmpun;
-extern char __aeabi_fdiv;
-extern char __aeabi_fmul;
-extern char __aeabi_frsub;
-extern char __aeabi_fsub;
-extern char __aeabi_i2d;
-extern char __aeabi_i2f;
-extern char __aeabi_idiv;
-extern char __aeabi_idivmod;
-extern char __aeabi_l2d;
-extern char __aeabi_l2f;
-extern char __aeabi_lasr;
-extern char __aeabi_ldivmod;
-extern char __aeabi_llsl;
-extern char __aeabi_llsr;
-extern char __aeabi_lmul;
-extern char __aeabi_ui2d;
-extern char __aeabi_ui2f;
-extern char __aeabi_uidiv;
-extern char __aeabi_uidivmod;
-extern char __aeabi_ul2d;
-extern char __aeabi_ul2f;
-extern char __aeabi_uldivmod;
-extern char __aeabi_unwind_cpp_pr0;
-extern char __aeabi_unwind_cpp_pr1;
-extern char __cmpdf2;
-extern char __divdf3;
-extern char __divsf3;
-extern char __eqdf2;
-extern char __extendsfdf2;
-extern char __fixdfsi;
-extern char __fixsfsi;
-extern char __floatdidf;
-extern char __floatdisf;
-extern char __floatsidf;
-extern char __floatsisf;
-extern char __floatundidf;
-extern char __floatundisf;
-extern char __floatunsidf;
-extern char __floatunsisf;
-extern char __gedf2;
-extern char __gtdf2;
-extern char __ledf2;
-extern char __ltdf2;
-extern char __muldf3;
-extern char __muldi3;
-extern char __mulsf3;
-extern char __nedf2;
-extern char __popcount_tab;
-extern char __popcountsi2;
-extern char __subdf3;
-extern char __subsf3;
-extern char __truncdfsf2;
-extern char __unorddf2;
-extern char __unordsf2;
-
-void* __bionic_libgcc_compat_symbols[] = {
-    &__adddf3,
-    &__addsf3,
-    &__aeabi_cdcmpeq,
-    &__aeabi_cdcmple,
-    &__aeabi_cdrcmple,
-    &__aeabi_d2f,
-    &__aeabi_d2iz,
-    &__aeabi_dadd,
-    &__aeabi_dcmpeq,
-    &__aeabi_dcmpge,
-    &__aeabi_dcmpgt,
-    &__aeabi_dcmple,
-    &__aeabi_dcmplt,
-    &__aeabi_dcmpun,
-    &__aeabi_ddiv,
-    &__aeabi_dmul,
-    &__aeabi_drsub,
-    &__aeabi_dsub,
-    &__aeabi_f2d,
-    &__aeabi_f2iz,
-    &__aeabi_f2uiz,
-    &__aeabi_fadd,
-    &__aeabi_fcmpun,
-    &__aeabi_fdiv,
-    &__aeabi_fmul,
-    &__aeabi_frsub,
-    &__aeabi_fsub,
-    &__aeabi_i2d,
-    &__aeabi_i2f,
-    &__aeabi_idiv,
-    &__aeabi_idivmod,
-    &__aeabi_l2d,
-    &__aeabi_l2f,
-    &__aeabi_lasr,
-    &__aeabi_ldivmod,
-    &__aeabi_llsl,
-    &__aeabi_llsr,
-    &__aeabi_lmul,
-    &__aeabi_ui2d,
-    &__aeabi_ui2f,
-    &__aeabi_uidiv,
-    &__aeabi_uidivmod,
-    &__aeabi_ul2d,
-    &__aeabi_ul2f,
-    &__aeabi_uldivmod,
-    &__aeabi_unwind_cpp_pr0,
-    &__aeabi_unwind_cpp_pr1,
-    &__cmpdf2,
-    &__divdf3,
-    &__divsf3,
-    &__eqdf2,
-    &__extendsfdf2,
-    &__fixdfsi,
-    &__fixsfsi,
-    &__floatdidf,
-    &__floatdisf,
-    &__floatsidf,
-    &__floatsisf,
-    &__floatundidf,
-    &__floatundisf,
-    &__floatunsidf,
-    &__floatunsisf,
-    &__gedf2,
-    &__gtdf2,
-    &__ledf2,
-    &__ltdf2,
-    &__muldf3,
-    &__muldi3,
-    &__mulsf3,
-    &__nedf2,
-    &__popcount_tab,
-    &__popcountsi2,
-    &__subdf3,
-    &__subsf3,
-    &__truncdfsf2,
-    &__unorddf2,
-    &__unordsf2,
-};
diff --git a/libc/arch-arm/bionic/vfork.S b/libc/arch-arm/bionic/vfork.S
index 8329111..0b17d64 100644
--- a/libc/arch-arm/bionic/vfork.S
+++ b/libc/arch-arm/bionic/vfork.S
@@ -27,12 +27,13 @@
  */
 
 #include <private/bionic_asm.h>
+#include <private/bionic_asm_tls.h>
 
 ENTRY(vfork)
 __BIONIC_WEAK_ASM_FOR_NATIVE_BRIDGE(vfork)
     // __get_tls()[TLS_SLOT_THREAD_ID]->cached_pid_ = 0
     mrc     p15, 0, r3, c13, c0, 3
-    ldr     r3, [r3, #4]
+    ldr     r3, [r3, #(TLS_SLOT_THREAD_ID * 4)]
     mov     r0, #0
     str     r0, [r3, #12]
 
diff --git a/libc/arch-arm/generic/bionic/memcmp.S b/libc/arch-arm/generic/bionic/memcmp.S
index e648720..9fd72e9 100644
--- a/libc/arch-arm/generic/bionic/memcmp.S
+++ b/libc/arch-arm/generic/bionic/memcmp.S
@@ -62,7 +62,7 @@
  * Neon optimization
  * Comparing 32 bytes at a time
  */
-#if defined(__ARM_NEON__) && defined(NEON_UNALIGNED_ACCESS)
+#if defined(__ARM_NEON__)
         subs        r2, r2, #32
         blo         3f
 
diff --git a/libc/arch-arm/syscalls/___clock_nanosleep.S b/libc/arch-arm/syscalls/___clock_nanosleep.S
deleted file mode 100644
index ef8f065..0000000
--- a/libc/arch-arm/syscalls/___clock_nanosleep.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___clock_nanosleep)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_clock_nanosleep
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(___clock_nanosleep)
-.hidden ___clock_nanosleep
diff --git a/libc/arch-arm/syscalls/___close.S b/libc/arch-arm/syscalls/___close.S
deleted file mode 100644
index 05d3352..0000000
--- a/libc/arch-arm/syscalls/___close.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___close)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_close
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(___close)
-.hidden ___close
diff --git a/libc/arch-arm/syscalls/___faccessat.S b/libc/arch-arm/syscalls/___faccessat.S
deleted file mode 100644
index 8bb4cf8..0000000
--- a/libc/arch-arm/syscalls/___faccessat.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___faccessat)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_faccessat
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(___faccessat)
-.hidden ___faccessat
diff --git a/libc/arch-arm/syscalls/___fchmod.S b/libc/arch-arm/syscalls/___fchmod.S
deleted file mode 100644
index b2312cb..0000000
--- a/libc/arch-arm/syscalls/___fchmod.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmod)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fchmod
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(___fchmod)
-.hidden ___fchmod
diff --git a/libc/arch-arm/syscalls/___fchmodat.S b/libc/arch-arm/syscalls/___fchmodat.S
deleted file mode 100644
index 4773610..0000000
--- a/libc/arch-arm/syscalls/___fchmodat.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmodat)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fchmodat
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(___fchmodat)
-.hidden ___fchmodat
diff --git a/libc/arch-arm/syscalls/___fgetxattr.S b/libc/arch-arm/syscalls/___fgetxattr.S
deleted file mode 100644
index 25be039..0000000
--- a/libc/arch-arm/syscalls/___fgetxattr.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fgetxattr)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fgetxattr
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(___fgetxattr)
-.hidden ___fgetxattr
diff --git a/libc/arch-arm/syscalls/___flistxattr.S b/libc/arch-arm/syscalls/___flistxattr.S
deleted file mode 100644
index 904e4ca..0000000
--- a/libc/arch-arm/syscalls/___flistxattr.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___flistxattr)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_flistxattr
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(___flistxattr)
-.hidden ___flistxattr
diff --git a/libc/arch-arm/syscalls/___fsetxattr.S b/libc/arch-arm/syscalls/___fsetxattr.S
deleted file mode 100644
index 5445191..0000000
--- a/libc/arch-arm/syscalls/___fsetxattr.S
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fsetxattr)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_fsetxattr
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(___fsetxattr)
-.hidden ___fsetxattr
diff --git a/libc/arch-arm/syscalls/___mremap.S b/libc/arch-arm/syscalls/___mremap.S
deleted file mode 100644
index ade8d78..0000000
--- a/libc/arch-arm/syscalls/___mremap.S
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___mremap)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_mremap
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(___mremap)
-.hidden ___mremap
diff --git a/libc/arch-arm/syscalls/___rt_sigqueueinfo.S b/libc/arch-arm/syscalls/___rt_sigqueueinfo.S
deleted file mode 100644
index 1367e56..0000000
--- a/libc/arch-arm/syscalls/___rt_sigqueueinfo.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___rt_sigqueueinfo)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_rt_sigqueueinfo
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(___rt_sigqueueinfo)
-.hidden ___rt_sigqueueinfo
diff --git a/libc/arch-arm/syscalls/__accept4.S b/libc/arch-arm/syscalls/__accept4.S
deleted file mode 100644
index 42aa47c..0000000
--- a/libc/arch-arm/syscalls/__accept4.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__accept4)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_accept4
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__accept4)
diff --git a/libc/arch-arm/syscalls/__arm_fadvise64_64.S b/libc/arch-arm/syscalls/__arm_fadvise64_64.S
deleted file mode 100644
index 761c4d6..0000000
--- a/libc/arch-arm/syscalls/__arm_fadvise64_64.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__arm_fadvise64_64)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_arm_fadvise64_64
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__arm_fadvise64_64)
diff --git a/libc/arch-arm/syscalls/__brk.S b/libc/arch-arm/syscalls/__brk.S
deleted file mode 100644
index 246924c..0000000
--- a/libc/arch-arm/syscalls/__brk.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__brk)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_brk
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__brk)
diff --git a/libc/arch-arm/syscalls/__clock_getres.S b/libc/arch-arm/syscalls/__clock_getres.S
deleted file mode 100644
index 439b5b8..0000000
--- a/libc/arch-arm/syscalls/__clock_getres.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_getres)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_clock_getres
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__clock_getres)
diff --git a/libc/arch-arm/syscalls/__clock_gettime.S b/libc/arch-arm/syscalls/__clock_gettime.S
deleted file mode 100644
index 30eff03..0000000
--- a/libc/arch-arm/syscalls/__clock_gettime.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_gettime)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_clock_gettime
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__clock_gettime)
diff --git a/libc/arch-arm/syscalls/__connect.S b/libc/arch-arm/syscalls/__connect.S
deleted file mode 100644
index 873b14d..0000000
--- a/libc/arch-arm/syscalls/__connect.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__connect)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_connect
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__connect)
diff --git a/libc/arch-arm/syscalls/__epoll_pwait.S b/libc/arch-arm/syscalls/__epoll_pwait.S
deleted file mode 100644
index 3642ee3..0000000
--- a/libc/arch-arm/syscalls/__epoll_pwait.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__epoll_pwait)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_epoll_pwait
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__epoll_pwait)
diff --git a/libc/arch-arm/syscalls/__exit.S b/libc/arch-arm/syscalls/__exit.S
deleted file mode 100644
index 4ed31b0..0000000
--- a/libc/arch-arm/syscalls/__exit.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__exit)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_exit
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__exit)
diff --git a/libc/arch-arm/syscalls/__fcntl64.S b/libc/arch-arm/syscalls/__fcntl64.S
deleted file mode 100644
index 0afdbee..0000000
--- a/libc/arch-arm/syscalls/__fcntl64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fcntl64)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fcntl64
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__fcntl64)
diff --git a/libc/arch-arm/syscalls/__fstatfs64.S b/libc/arch-arm/syscalls/__fstatfs64.S
deleted file mode 100644
index 9117313..0000000
--- a/libc/arch-arm/syscalls/__fstatfs64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fstatfs64)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fstatfs64
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__fstatfs64)
diff --git a/libc/arch-arm/syscalls/__getcpu.S b/libc/arch-arm/syscalls/__getcpu.S
deleted file mode 100644
index 430acb3..0000000
--- a/libc/arch-arm/syscalls/__getcpu.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcpu)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getcpu
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__getcpu)
diff --git a/libc/arch-arm/syscalls/__getcwd.S b/libc/arch-arm/syscalls/__getcwd.S
deleted file mode 100644
index 53000b8..0000000
--- a/libc/arch-arm/syscalls/__getcwd.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcwd)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getcwd
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__getcwd)
diff --git a/libc/arch-arm/syscalls/__getdents64.S b/libc/arch-arm/syscalls/__getdents64.S
deleted file mode 100644
index 0ea61b8..0000000
--- a/libc/arch-arm/syscalls/__getdents64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getdents64)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getdents64
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__getdents64)
diff --git a/libc/arch-arm/syscalls/__getpid.S b/libc/arch-arm/syscalls/__getpid.S
deleted file mode 100644
index b555385..0000000
--- a/libc/arch-arm/syscalls/__getpid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getpid
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__getpid)
diff --git a/libc/arch-arm/syscalls/__getpriority.S b/libc/arch-arm/syscalls/__getpriority.S
deleted file mode 100644
index 34f4bea..0000000
--- a/libc/arch-arm/syscalls/__getpriority.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpriority)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getpriority
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__getpriority)
diff --git a/libc/arch-arm/syscalls/__gettimeofday.S b/libc/arch-arm/syscalls/__gettimeofday.S
deleted file mode 100644
index de0eca5..0000000
--- a/libc/arch-arm/syscalls/__gettimeofday.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__gettimeofday)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_gettimeofday
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__gettimeofday)
diff --git a/libc/arch-arm/syscalls/__ioctl.S b/libc/arch-arm/syscalls/__ioctl.S
deleted file mode 100644
index 5871e58..0000000
--- a/libc/arch-arm/syscalls/__ioctl.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ioctl)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_ioctl
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__ioctl)
diff --git a/libc/arch-arm/syscalls/__llseek.S b/libc/arch-arm/syscalls/__llseek.S
deleted file mode 100644
index 3cff318..0000000
--- a/libc/arch-arm/syscalls/__llseek.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__llseek)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR__llseek
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__llseek)
diff --git a/libc/arch-arm/syscalls/__mmap2.S b/libc/arch-arm/syscalls/__mmap2.S
deleted file mode 100644
index f11e467..0000000
--- a/libc/arch-arm/syscalls/__mmap2.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__mmap2)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_mmap2
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__mmap2)
diff --git a/libc/arch-arm/syscalls/__openat.S b/libc/arch-arm/syscalls/__openat.S
deleted file mode 100644
index 403d9b5..0000000
--- a/libc/arch-arm/syscalls/__openat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__openat)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_openat
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__openat)
diff --git a/libc/arch-arm/syscalls/__ppoll.S b/libc/arch-arm/syscalls/__ppoll.S
deleted file mode 100644
index 02de8a8..0000000
--- a/libc/arch-arm/syscalls/__ppoll.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ppoll)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_ppoll
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__ppoll)
diff --git a/libc/arch-arm/syscalls/__preadv64.S b/libc/arch-arm/syscalls/__preadv64.S
deleted file mode 100644
index 19eaaa5..0000000
--- a/libc/arch-arm/syscalls/__preadv64.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__preadv64)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_preadv
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__preadv64)
diff --git a/libc/arch-arm/syscalls/__pselect6.S b/libc/arch-arm/syscalls/__pselect6.S
deleted file mode 100644
index 8f31e1b..0000000
--- a/libc/arch-arm/syscalls/__pselect6.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__pselect6)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_pselect6
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__pselect6)
diff --git a/libc/arch-arm/syscalls/__ptrace.S b/libc/arch-arm/syscalls/__ptrace.S
deleted file mode 100644
index 8ad554d..0000000
--- a/libc/arch-arm/syscalls/__ptrace.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ptrace)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_ptrace
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__ptrace)
diff --git a/libc/arch-arm/syscalls/__pwritev64.S b/libc/arch-arm/syscalls/__pwritev64.S
deleted file mode 100644
index afcbe40..0000000
--- a/libc/arch-arm/syscalls/__pwritev64.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__pwritev64)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_pwritev
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__pwritev64)
diff --git a/libc/arch-arm/syscalls/__reboot.S b/libc/arch-arm/syscalls/__reboot.S
deleted file mode 100644
index 15ca814..0000000
--- a/libc/arch-arm/syscalls/__reboot.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__reboot)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_reboot
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__reboot)
diff --git a/libc/arch-arm/syscalls/__rt_sigaction.S b/libc/arch-arm/syscalls/__rt_sigaction.S
deleted file mode 100644
index 21d9977..0000000
--- a/libc/arch-arm/syscalls/__rt_sigaction.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigaction)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_rt_sigaction
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__rt_sigaction)
diff --git a/libc/arch-arm/syscalls/__rt_sigpending.S b/libc/arch-arm/syscalls/__rt_sigpending.S
deleted file mode 100644
index b726b85..0000000
--- a/libc/arch-arm/syscalls/__rt_sigpending.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigpending)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_rt_sigpending
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__rt_sigpending)
diff --git a/libc/arch-arm/syscalls/__rt_sigprocmask.S b/libc/arch-arm/syscalls/__rt_sigprocmask.S
deleted file mode 100644
index 11b326f..0000000
--- a/libc/arch-arm/syscalls/__rt_sigprocmask.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigprocmask)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_rt_sigprocmask
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__rt_sigprocmask)
diff --git a/libc/arch-arm/syscalls/__rt_sigsuspend.S b/libc/arch-arm/syscalls/__rt_sigsuspend.S
deleted file mode 100644
index 5d06418..0000000
--- a/libc/arch-arm/syscalls/__rt_sigsuspend.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigsuspend)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_rt_sigsuspend
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__rt_sigsuspend)
diff --git a/libc/arch-arm/syscalls/__rt_sigtimedwait.S b/libc/arch-arm/syscalls/__rt_sigtimedwait.S
deleted file mode 100644
index dc7c3e7..0000000
--- a/libc/arch-arm/syscalls/__rt_sigtimedwait.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigtimedwait)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_rt_sigtimedwait
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__rt_sigtimedwait)
diff --git a/libc/arch-arm/syscalls/__sched_getaffinity.S b/libc/arch-arm/syscalls/__sched_getaffinity.S
deleted file mode 100644
index 21f8330..0000000
--- a/libc/arch-arm/syscalls/__sched_getaffinity.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sched_getaffinity)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sched_getaffinity
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__sched_getaffinity)
diff --git a/libc/arch-arm/syscalls/__set_tid_address.S b/libc/arch-arm/syscalls/__set_tid_address.S
deleted file mode 100644
index 79dfd7f..0000000
--- a/libc/arch-arm/syscalls/__set_tid_address.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__set_tid_address)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_set_tid_address
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__set_tid_address)
diff --git a/libc/arch-arm/syscalls/__set_tls.S b/libc/arch-arm/syscalls/__set_tls.S
deleted file mode 100644
index a9a4b9a..0000000
--- a/libc/arch-arm/syscalls/__set_tls.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__set_tls)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__ARM_NR_set_tls
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__set_tls)
diff --git a/libc/arch-arm/syscalls/__sigaction.S b/libc/arch-arm/syscalls/__sigaction.S
deleted file mode 100644
index 8f3f143..0000000
--- a/libc/arch-arm/syscalls/__sigaction.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sigaction)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sigaction
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__sigaction)
diff --git a/libc/arch-arm/syscalls/__signalfd4.S b/libc/arch-arm/syscalls/__signalfd4.S
deleted file mode 100644
index 51a27c8..0000000
--- a/libc/arch-arm/syscalls/__signalfd4.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__signalfd4)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_signalfd4
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__signalfd4)
diff --git a/libc/arch-arm/syscalls/__socket.S b/libc/arch-arm/syscalls/__socket.S
deleted file mode 100644
index c50cd6f..0000000
--- a/libc/arch-arm/syscalls/__socket.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__socket)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_socket
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__socket)
diff --git a/libc/arch-arm/syscalls/__statfs64.S b/libc/arch-arm/syscalls/__statfs64.S
deleted file mode 100644
index 320b0ee..0000000
--- a/libc/arch-arm/syscalls/__statfs64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__statfs64)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_statfs64
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__statfs64)
diff --git a/libc/arch-arm/syscalls/__sync_file_range2.S b/libc/arch-arm/syscalls/__sync_file_range2.S
deleted file mode 100644
index 4346e1b..0000000
--- a/libc/arch-arm/syscalls/__sync_file_range2.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sync_file_range2)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_sync_file_range2
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__sync_file_range2)
diff --git a/libc/arch-arm/syscalls/__timer_create.S b/libc/arch-arm/syscalls/__timer_create.S
deleted file mode 100644
index fd7567b..0000000
--- a/libc/arch-arm/syscalls/__timer_create.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_create)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_timer_create
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__timer_create)
diff --git a/libc/arch-arm/syscalls/__timer_delete.S b/libc/arch-arm/syscalls/__timer_delete.S
deleted file mode 100644
index 6761abb..0000000
--- a/libc/arch-arm/syscalls/__timer_delete.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_delete)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_timer_delete
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__timer_delete)
diff --git a/libc/arch-arm/syscalls/__timer_getoverrun.S b/libc/arch-arm/syscalls/__timer_getoverrun.S
deleted file mode 100644
index a925d83..0000000
--- a/libc/arch-arm/syscalls/__timer_getoverrun.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_getoverrun)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_timer_getoverrun
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__timer_getoverrun)
diff --git a/libc/arch-arm/syscalls/__timer_gettime.S b/libc/arch-arm/syscalls/__timer_gettime.S
deleted file mode 100644
index c0da770..0000000
--- a/libc/arch-arm/syscalls/__timer_gettime.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_gettime)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_timer_gettime
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__timer_gettime)
diff --git a/libc/arch-arm/syscalls/__timer_settime.S b/libc/arch-arm/syscalls/__timer_settime.S
deleted file mode 100644
index de4e7e6..0000000
--- a/libc/arch-arm/syscalls/__timer_settime.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_settime)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_timer_settime
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__timer_settime)
diff --git a/libc/arch-arm/syscalls/__waitid.S b/libc/arch-arm/syscalls/__waitid.S
deleted file mode 100644
index f4dfa59..0000000
--- a/libc/arch-arm/syscalls/__waitid.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__waitid)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_waitid
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(__waitid)
diff --git a/libc/arch-arm/syscalls/_exit.S b/libc/arch-arm/syscalls/_exit.S
deleted file mode 100644
index 1c3d174..0000000
--- a/libc/arch-arm/syscalls/_exit.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(_exit)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_exit_group
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(_exit)
-
-ALIAS_SYMBOL(_Exit, _exit)
diff --git a/libc/arch-arm/syscalls/acct.S b/libc/arch-arm/syscalls/acct.S
deleted file mode 100644
index cdf1099..0000000
--- a/libc/arch-arm/syscalls/acct.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(acct)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_acct
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(acct)
diff --git a/libc/arch-arm/syscalls/adjtimex.S b/libc/arch-arm/syscalls/adjtimex.S
deleted file mode 100644
index 6ebae7e..0000000
--- a/libc/arch-arm/syscalls/adjtimex.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(adjtimex)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_adjtimex
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(adjtimex)
diff --git a/libc/arch-arm/syscalls/bind.S b/libc/arch-arm/syscalls/bind.S
deleted file mode 100644
index af518d8..0000000
--- a/libc/arch-arm/syscalls/bind.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(bind)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_bind
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(bind)
diff --git a/libc/arch-arm/syscalls/cacheflush.S b/libc/arch-arm/syscalls/cacheflush.S
deleted file mode 100644
index 752749a..0000000
--- a/libc/arch-arm/syscalls/cacheflush.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(cacheflush)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__ARM_NR_cacheflush
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(cacheflush)
diff --git a/libc/arch-arm/syscalls/capget.S b/libc/arch-arm/syscalls/capget.S
deleted file mode 100644
index 9be110b..0000000
--- a/libc/arch-arm/syscalls/capget.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capget)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_capget
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(capget)
diff --git a/libc/arch-arm/syscalls/capset.S b/libc/arch-arm/syscalls/capset.S
deleted file mode 100644
index 0bd5009..0000000
--- a/libc/arch-arm/syscalls/capset.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capset)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_capset
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(capset)
diff --git a/libc/arch-arm/syscalls/chdir.S b/libc/arch-arm/syscalls/chdir.S
deleted file mode 100644
index c75f5e2..0000000
--- a/libc/arch-arm/syscalls/chdir.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chdir)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_chdir
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(chdir)
diff --git a/libc/arch-arm/syscalls/chroot.S b/libc/arch-arm/syscalls/chroot.S
deleted file mode 100644
index d197d42..0000000
--- a/libc/arch-arm/syscalls/chroot.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chroot)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_chroot
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(chroot)
diff --git a/libc/arch-arm/syscalls/clock_adjtime.S b/libc/arch-arm/syscalls/clock_adjtime.S
deleted file mode 100644
index e59a240..0000000
--- a/libc/arch-arm/syscalls/clock_adjtime.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_adjtime)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_clock_adjtime
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(clock_adjtime)
diff --git a/libc/arch-arm/syscalls/clock_settime.S b/libc/arch-arm/syscalls/clock_settime.S
deleted file mode 100644
index f00a072..0000000
--- a/libc/arch-arm/syscalls/clock_settime.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_settime)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_clock_settime
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(clock_settime)
diff --git a/libc/arch-arm/syscalls/delete_module.S b/libc/arch-arm/syscalls/delete_module.S
deleted file mode 100644
index 80dd0f5..0000000
--- a/libc/arch-arm/syscalls/delete_module.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(delete_module)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_delete_module
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(delete_module)
diff --git a/libc/arch-arm/syscalls/dup.S b/libc/arch-arm/syscalls/dup.S
deleted file mode 100644
index 0d06bdc..0000000
--- a/libc/arch-arm/syscalls/dup.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_dup
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(dup)
diff --git a/libc/arch-arm/syscalls/dup3.S b/libc/arch-arm/syscalls/dup3.S
deleted file mode 100644
index 7dea858..0000000
--- a/libc/arch-arm/syscalls/dup3.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup3)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_dup3
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(dup3)
diff --git a/libc/arch-arm/syscalls/epoll_create1.S b/libc/arch-arm/syscalls/epoll_create1.S
deleted file mode 100644
index 8b413d9..0000000
--- a/libc/arch-arm/syscalls/epoll_create1.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_create1)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_epoll_create1
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(epoll_create1)
diff --git a/libc/arch-arm/syscalls/epoll_ctl.S b/libc/arch-arm/syscalls/epoll_ctl.S
deleted file mode 100644
index 807dd69..0000000
--- a/libc/arch-arm/syscalls/epoll_ctl.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_ctl)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_epoll_ctl
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(epoll_ctl)
diff --git a/libc/arch-arm/syscalls/eventfd.S b/libc/arch-arm/syscalls/eventfd.S
deleted file mode 100644
index 51f4a49..0000000
--- a/libc/arch-arm/syscalls/eventfd.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(eventfd)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_eventfd2
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(eventfd)
diff --git a/libc/arch-arm/syscalls/execve.S b/libc/arch-arm/syscalls/execve.S
deleted file mode 100644
index 1b72f0e..0000000
--- a/libc/arch-arm/syscalls/execve.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(execve)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_execve
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(execve)
diff --git a/libc/arch-arm/syscalls/fallocate64.S b/libc/arch-arm/syscalls/fallocate64.S
deleted file mode 100644
index 4bfd5e3..0000000
--- a/libc/arch-arm/syscalls/fallocate64.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fallocate64)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_fallocate
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(fallocate64)
diff --git a/libc/arch-arm/syscalls/fchdir.S b/libc/arch-arm/syscalls/fchdir.S
deleted file mode 100644
index dca18c4..0000000
--- a/libc/arch-arm/syscalls/fchdir.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchdir)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fchdir
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(fchdir)
diff --git a/libc/arch-arm/syscalls/fchown.S b/libc/arch-arm/syscalls/fchown.S
deleted file mode 100644
index 51ee60c..0000000
--- a/libc/arch-arm/syscalls/fchown.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchown)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fchown32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(fchown)
diff --git a/libc/arch-arm/syscalls/fchownat.S b/libc/arch-arm/syscalls/fchownat.S
deleted file mode 100644
index 2aac0fe..0000000
--- a/libc/arch-arm/syscalls/fchownat.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchownat)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_fchownat
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(fchownat)
diff --git a/libc/arch-arm/syscalls/fdatasync.S b/libc/arch-arm/syscalls/fdatasync.S
deleted file mode 100644
index f97adc6..0000000
--- a/libc/arch-arm/syscalls/fdatasync.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fdatasync)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fdatasync
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(fdatasync)
diff --git a/libc/arch-arm/syscalls/flock.S b/libc/arch-arm/syscalls/flock.S
deleted file mode 100644
index e2874f6..0000000
--- a/libc/arch-arm/syscalls/flock.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(flock)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_flock
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(flock)
diff --git a/libc/arch-arm/syscalls/fremovexattr.S b/libc/arch-arm/syscalls/fremovexattr.S
deleted file mode 100644
index 89be704..0000000
--- a/libc/arch-arm/syscalls/fremovexattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fremovexattr)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fremovexattr
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(fremovexattr)
diff --git a/libc/arch-arm/syscalls/fstat64.S b/libc/arch-arm/syscalls/fstat64.S
deleted file mode 100644
index c2c7101..0000000
--- a/libc/arch-arm/syscalls/fstat64.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fstat64)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fstat64
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(fstat64)
-
-ALIAS_SYMBOL(fstat, fstat64)
diff --git a/libc/arch-arm/syscalls/fstatat64.S b/libc/arch-arm/syscalls/fstatat64.S
deleted file mode 100644
index 545dc16..0000000
--- a/libc/arch-arm/syscalls/fstatat64.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fstatat64)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fstatat64
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(fstatat64)
-
-ALIAS_SYMBOL(fstatat, fstatat64)
diff --git a/libc/arch-arm/syscalls/fsync.S b/libc/arch-arm/syscalls/fsync.S
deleted file mode 100644
index 24b9a87..0000000
--- a/libc/arch-arm/syscalls/fsync.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fsync)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_fsync
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(fsync)
diff --git a/libc/arch-arm/syscalls/ftruncate64.S b/libc/arch-arm/syscalls/ftruncate64.S
deleted file mode 100644
index ee1a2a6..0000000
--- a/libc/arch-arm/syscalls/ftruncate64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(ftruncate64)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_ftruncate64
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(ftruncate64)
diff --git a/libc/arch-arm/syscalls/getegid.S b/libc/arch-arm/syscalls/getegid.S
deleted file mode 100644
index f4e17b5..0000000
--- a/libc/arch-arm/syscalls/getegid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getegid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getegid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getegid)
diff --git a/libc/arch-arm/syscalls/geteuid.S b/libc/arch-arm/syscalls/geteuid.S
deleted file mode 100644
index 01898f8..0000000
--- a/libc/arch-arm/syscalls/geteuid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(geteuid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_geteuid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(geteuid)
diff --git a/libc/arch-arm/syscalls/getgid.S b/libc/arch-arm/syscalls/getgid.S
deleted file mode 100644
index ee124a6..0000000
--- a/libc/arch-arm/syscalls/getgid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getgid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getgid)
diff --git a/libc/arch-arm/syscalls/getgroups.S b/libc/arch-arm/syscalls/getgroups.S
deleted file mode 100644
index 4c1bfdb..0000000
--- a/libc/arch-arm/syscalls/getgroups.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgroups)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getgroups32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getgroups)
diff --git a/libc/arch-arm/syscalls/getitimer.S b/libc/arch-arm/syscalls/getitimer.S
deleted file mode 100644
index b9773ad..0000000
--- a/libc/arch-arm/syscalls/getitimer.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getitimer)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getitimer
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getitimer)
diff --git a/libc/arch-arm/syscalls/getpeername.S b/libc/arch-arm/syscalls/getpeername.S
deleted file mode 100644
index 6bf6002..0000000
--- a/libc/arch-arm/syscalls/getpeername.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpeername)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getpeername
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getpeername)
diff --git a/libc/arch-arm/syscalls/getpgid.S b/libc/arch-arm/syscalls/getpgid.S
deleted file mode 100644
index d5c9c8a..0000000
--- a/libc/arch-arm/syscalls/getpgid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpgid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getpgid
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getpgid)
diff --git a/libc/arch-arm/syscalls/getppid.S b/libc/arch-arm/syscalls/getppid.S
deleted file mode 100644
index 91db24e..0000000
--- a/libc/arch-arm/syscalls/getppid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getppid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getppid
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getppid)
diff --git a/libc/arch-arm/syscalls/getrandom.S b/libc/arch-arm/syscalls/getrandom.S
deleted file mode 100644
index 3f28af6..0000000
--- a/libc/arch-arm/syscalls/getrandom.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrandom)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getrandom
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getrandom)
diff --git a/libc/arch-arm/syscalls/getresgid.S b/libc/arch-arm/syscalls/getresgid.S
deleted file mode 100644
index 8fb7f28..0000000
--- a/libc/arch-arm/syscalls/getresgid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresgid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getresgid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getresgid)
diff --git a/libc/arch-arm/syscalls/getresuid.S b/libc/arch-arm/syscalls/getresuid.S
deleted file mode 100644
index ebec6e1..0000000
--- a/libc/arch-arm/syscalls/getresuid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresuid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getresuid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getresuid)
diff --git a/libc/arch-arm/syscalls/getrlimit.S b/libc/arch-arm/syscalls/getrlimit.S
deleted file mode 100644
index 0c9e662..0000000
--- a/libc/arch-arm/syscalls/getrlimit.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrlimit)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_ugetrlimit
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getrlimit)
diff --git a/libc/arch-arm/syscalls/getrusage.S b/libc/arch-arm/syscalls/getrusage.S
deleted file mode 100644
index e74a4ad..0000000
--- a/libc/arch-arm/syscalls/getrusage.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrusage)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getrusage
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getrusage)
diff --git a/libc/arch-arm/syscalls/getsid.S b/libc/arch-arm/syscalls/getsid.S
deleted file mode 100644
index c918820..0000000
--- a/libc/arch-arm/syscalls/getsid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getsid
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getsid)
diff --git a/libc/arch-arm/syscalls/getsockname.S b/libc/arch-arm/syscalls/getsockname.S
deleted file mode 100644
index a30a291..0000000
--- a/libc/arch-arm/syscalls/getsockname.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockname)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getsockname
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getsockname)
diff --git a/libc/arch-arm/syscalls/getsockopt.S b/libc/arch-arm/syscalls/getsockopt.S
deleted file mode 100644
index 4143bbd..0000000
--- a/libc/arch-arm/syscalls/getsockopt.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockopt)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_getsockopt
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getsockopt)
diff --git a/libc/arch-arm/syscalls/getuid.S b/libc/arch-arm/syscalls/getuid.S
deleted file mode 100644
index cdc86bc..0000000
--- a/libc/arch-arm/syscalls/getuid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getuid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getuid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getuid)
diff --git a/libc/arch-arm/syscalls/getxattr.S b/libc/arch-arm/syscalls/getxattr.S
deleted file mode 100644
index 116d917..0000000
--- a/libc/arch-arm/syscalls/getxattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getxattr)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_getxattr
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(getxattr)
diff --git a/libc/arch-arm/syscalls/init_module.S b/libc/arch-arm/syscalls/init_module.S
deleted file mode 100644
index 8fecf68..0000000
--- a/libc/arch-arm/syscalls/init_module.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(init_module)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_init_module
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(init_module)
diff --git a/libc/arch-arm/syscalls/inotify_add_watch.S b/libc/arch-arm/syscalls/inotify_add_watch.S
deleted file mode 100644
index 61e666c..0000000
--- a/libc/arch-arm/syscalls/inotify_add_watch.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_add_watch)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_inotify_add_watch
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(inotify_add_watch)
diff --git a/libc/arch-arm/syscalls/inotify_init1.S b/libc/arch-arm/syscalls/inotify_init1.S
deleted file mode 100644
index 6cf066e..0000000
--- a/libc/arch-arm/syscalls/inotify_init1.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_init1)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_inotify_init1
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(inotify_init1)
diff --git a/libc/arch-arm/syscalls/inotify_rm_watch.S b/libc/arch-arm/syscalls/inotify_rm_watch.S
deleted file mode 100644
index 1455da1..0000000
--- a/libc/arch-arm/syscalls/inotify_rm_watch.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_rm_watch)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_inotify_rm_watch
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(inotify_rm_watch)
diff --git a/libc/arch-arm/syscalls/kill.S b/libc/arch-arm/syscalls/kill.S
deleted file mode 100644
index 82df861..0000000
--- a/libc/arch-arm/syscalls/kill.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(kill)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_kill
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(kill)
diff --git a/libc/arch-arm/syscalls/klogctl.S b/libc/arch-arm/syscalls/klogctl.S
deleted file mode 100644
index 47a03c6..0000000
--- a/libc/arch-arm/syscalls/klogctl.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(klogctl)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_syslog
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(klogctl)
diff --git a/libc/arch-arm/syscalls/lgetxattr.S b/libc/arch-arm/syscalls/lgetxattr.S
deleted file mode 100644
index 157271c..0000000
--- a/libc/arch-arm/syscalls/lgetxattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lgetxattr)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_lgetxattr
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(lgetxattr)
diff --git a/libc/arch-arm/syscalls/linkat.S b/libc/arch-arm/syscalls/linkat.S
deleted file mode 100644
index 6e74d06..0000000
--- a/libc/arch-arm/syscalls/linkat.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(linkat)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_linkat
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(linkat)
diff --git a/libc/arch-arm/syscalls/listen.S b/libc/arch-arm/syscalls/listen.S
deleted file mode 100644
index 5ad75c0..0000000
--- a/libc/arch-arm/syscalls/listen.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listen)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_listen
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(listen)
diff --git a/libc/arch-arm/syscalls/listxattr.S b/libc/arch-arm/syscalls/listxattr.S
deleted file mode 100644
index 093927d..0000000
--- a/libc/arch-arm/syscalls/listxattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listxattr)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_listxattr
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(listxattr)
diff --git a/libc/arch-arm/syscalls/llistxattr.S b/libc/arch-arm/syscalls/llistxattr.S
deleted file mode 100644
index 5d0e7c8..0000000
--- a/libc/arch-arm/syscalls/llistxattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(llistxattr)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_llistxattr
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(llistxattr)
diff --git a/libc/arch-arm/syscalls/lremovexattr.S b/libc/arch-arm/syscalls/lremovexattr.S
deleted file mode 100644
index 4e0bcec..0000000
--- a/libc/arch-arm/syscalls/lremovexattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lremovexattr)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_lremovexattr
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(lremovexattr)
diff --git a/libc/arch-arm/syscalls/lseek.S b/libc/arch-arm/syscalls/lseek.S
deleted file mode 100644
index cbdc441..0000000
--- a/libc/arch-arm/syscalls/lseek.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lseek)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_lseek
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(lseek)
diff --git a/libc/arch-arm/syscalls/lsetxattr.S b/libc/arch-arm/syscalls/lsetxattr.S
deleted file mode 100644
index c41fb88..0000000
--- a/libc/arch-arm/syscalls/lsetxattr.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lsetxattr)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_lsetxattr
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(lsetxattr)
diff --git a/libc/arch-arm/syscalls/madvise.S b/libc/arch-arm/syscalls/madvise.S
deleted file mode 100644
index c2d7d20..0000000
--- a/libc/arch-arm/syscalls/madvise.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(madvise)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_madvise
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(madvise)
diff --git a/libc/arch-arm/syscalls/mincore.S b/libc/arch-arm/syscalls/mincore.S
deleted file mode 100644
index c93fe94..0000000
--- a/libc/arch-arm/syscalls/mincore.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mincore)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_mincore
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(mincore)
diff --git a/libc/arch-arm/syscalls/mkdirat.S b/libc/arch-arm/syscalls/mkdirat.S
deleted file mode 100644
index 4f93c61..0000000
--- a/libc/arch-arm/syscalls/mkdirat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mkdirat)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_mkdirat
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(mkdirat)
diff --git a/libc/arch-arm/syscalls/mknodat.S b/libc/arch-arm/syscalls/mknodat.S
deleted file mode 100644
index 91baae8..0000000
--- a/libc/arch-arm/syscalls/mknodat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mknodat)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_mknodat
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(mknodat)
diff --git a/libc/arch-arm/syscalls/mlock.S b/libc/arch-arm/syscalls/mlock.S
deleted file mode 100644
index eb72f6f..0000000
--- a/libc/arch-arm/syscalls/mlock.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlock)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_mlock
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(mlock)
diff --git a/libc/arch-arm/syscalls/mlockall.S b/libc/arch-arm/syscalls/mlockall.S
deleted file mode 100644
index 2984087..0000000
--- a/libc/arch-arm/syscalls/mlockall.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlockall)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_mlockall
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(mlockall)
diff --git a/libc/arch-arm/syscalls/mount.S b/libc/arch-arm/syscalls/mount.S
deleted file mode 100644
index ed28ab2..0000000
--- a/libc/arch-arm/syscalls/mount.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mount)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_mount
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(mount)
diff --git a/libc/arch-arm/syscalls/mprotect.S b/libc/arch-arm/syscalls/mprotect.S
deleted file mode 100644
index 9bb1282..0000000
--- a/libc/arch-arm/syscalls/mprotect.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mprotect)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_mprotect
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(mprotect)
diff --git a/libc/arch-arm/syscalls/msync.S b/libc/arch-arm/syscalls/msync.S
deleted file mode 100644
index bcbab04..0000000
--- a/libc/arch-arm/syscalls/msync.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(msync)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_msync
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(msync)
diff --git a/libc/arch-arm/syscalls/munlock.S b/libc/arch-arm/syscalls/munlock.S
deleted file mode 100644
index bf1b814..0000000
--- a/libc/arch-arm/syscalls/munlock.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlock)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_munlock
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(munlock)
diff --git a/libc/arch-arm/syscalls/munlockall.S b/libc/arch-arm/syscalls/munlockall.S
deleted file mode 100644
index b45a5a2..0000000
--- a/libc/arch-arm/syscalls/munlockall.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlockall)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_munlockall
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(munlockall)
diff --git a/libc/arch-arm/syscalls/munmap.S b/libc/arch-arm/syscalls/munmap.S
deleted file mode 100644
index 2b7a121..0000000
--- a/libc/arch-arm/syscalls/munmap.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munmap)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_munmap
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(munmap)
diff --git a/libc/arch-arm/syscalls/nanosleep.S b/libc/arch-arm/syscalls/nanosleep.S
deleted file mode 100644
index 83fd323..0000000
--- a/libc/arch-arm/syscalls/nanosleep.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(nanosleep)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_nanosleep
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(nanosleep)
diff --git a/libc/arch-arm/syscalls/personality.S b/libc/arch-arm/syscalls/personality.S
deleted file mode 100644
index 5ad6132..0000000
--- a/libc/arch-arm/syscalls/personality.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(personality)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_personality
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(personality)
diff --git a/libc/arch-arm/syscalls/pipe2.S b/libc/arch-arm/syscalls/pipe2.S
deleted file mode 100644
index f543f9d..0000000
--- a/libc/arch-arm/syscalls/pipe2.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pipe2)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_pipe2
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(pipe2)
diff --git a/libc/arch-arm/syscalls/prctl.S b/libc/arch-arm/syscalls/prctl.S
deleted file mode 100644
index a2d869c..0000000
--- a/libc/arch-arm/syscalls/prctl.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prctl)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_prctl
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(prctl)
diff --git a/libc/arch-arm/syscalls/pread64.S b/libc/arch-arm/syscalls/pread64.S
deleted file mode 100644
index dc07bb3..0000000
--- a/libc/arch-arm/syscalls/pread64.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pread64)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_pread64
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(pread64)
diff --git a/libc/arch-arm/syscalls/prlimit64.S b/libc/arch-arm/syscalls/prlimit64.S
deleted file mode 100644
index 0f04aaa..0000000
--- a/libc/arch-arm/syscalls/prlimit64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prlimit64)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_prlimit64
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(prlimit64)
diff --git a/libc/arch-arm/syscalls/process_vm_readv.S b/libc/arch-arm/syscalls/process_vm_readv.S
deleted file mode 100644
index 48c49dc..0000000
--- a/libc/arch-arm/syscalls/process_vm_readv.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_readv)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_process_vm_readv
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(process_vm_readv)
diff --git a/libc/arch-arm/syscalls/process_vm_writev.S b/libc/arch-arm/syscalls/process_vm_writev.S
deleted file mode 100644
index 4c21c43..0000000
--- a/libc/arch-arm/syscalls/process_vm_writev.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_writev)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_process_vm_writev
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(process_vm_writev)
diff --git a/libc/arch-arm/syscalls/pwrite64.S b/libc/arch-arm/syscalls/pwrite64.S
deleted file mode 100644
index 5749f6b..0000000
--- a/libc/arch-arm/syscalls/pwrite64.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pwrite64)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_pwrite64
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(pwrite64)
diff --git a/libc/arch-arm/syscalls/quotactl.S b/libc/arch-arm/syscalls/quotactl.S
deleted file mode 100644
index fde17f4..0000000
--- a/libc/arch-arm/syscalls/quotactl.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(quotactl)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_quotactl
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(quotactl)
diff --git a/libc/arch-arm/syscalls/read.S b/libc/arch-arm/syscalls/read.S
deleted file mode 100644
index 5051358..0000000
--- a/libc/arch-arm/syscalls/read.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(read)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_read
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(read)
diff --git a/libc/arch-arm/syscalls/readahead.S b/libc/arch-arm/syscalls/readahead.S
deleted file mode 100644
index 6952b4e..0000000
--- a/libc/arch-arm/syscalls/readahead.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readahead)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_readahead
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(readahead)
diff --git a/libc/arch-arm/syscalls/readlinkat.S b/libc/arch-arm/syscalls/readlinkat.S
deleted file mode 100644
index 36d46fa..0000000
--- a/libc/arch-arm/syscalls/readlinkat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readlinkat)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_readlinkat
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(readlinkat)
diff --git a/libc/arch-arm/syscalls/readv.S b/libc/arch-arm/syscalls/readv.S
deleted file mode 100644
index 565af6a..0000000
--- a/libc/arch-arm/syscalls/readv.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readv)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_readv
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(readv)
diff --git a/libc/arch-arm/syscalls/recvfrom.S b/libc/arch-arm/syscalls/recvfrom.S
deleted file mode 100644
index 115a09c..0000000
--- a/libc/arch-arm/syscalls/recvfrom.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvfrom)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_recvfrom
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(recvfrom)
diff --git a/libc/arch-arm/syscalls/recvmmsg.S b/libc/arch-arm/syscalls/recvmmsg.S
deleted file mode 100644
index 6cf2b92..0000000
--- a/libc/arch-arm/syscalls/recvmmsg.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmmsg)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_recvmmsg
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(recvmmsg)
diff --git a/libc/arch-arm/syscalls/recvmsg.S b/libc/arch-arm/syscalls/recvmsg.S
deleted file mode 100644
index 19a9fca..0000000
--- a/libc/arch-arm/syscalls/recvmsg.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmsg)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_recvmsg
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(recvmsg)
diff --git a/libc/arch-arm/syscalls/removexattr.S b/libc/arch-arm/syscalls/removexattr.S
deleted file mode 100644
index 46f847d..0000000
--- a/libc/arch-arm/syscalls/removexattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(removexattr)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_removexattr
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(removexattr)
diff --git a/libc/arch-arm/syscalls/renameat.S b/libc/arch-arm/syscalls/renameat.S
deleted file mode 100644
index 89fc513..0000000
--- a/libc/arch-arm/syscalls/renameat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(renameat)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_renameat
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(renameat)
diff --git a/libc/arch-arm/syscalls/sched_get_priority_max.S b/libc/arch-arm/syscalls/sched_get_priority_max.S
deleted file mode 100644
index 23b1d62..0000000
--- a/libc/arch-arm/syscalls/sched_get_priority_max.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_max)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sched_get_priority_max
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sched_get_priority_max)
diff --git a/libc/arch-arm/syscalls/sched_get_priority_min.S b/libc/arch-arm/syscalls/sched_get_priority_min.S
deleted file mode 100644
index 65a967c..0000000
--- a/libc/arch-arm/syscalls/sched_get_priority_min.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_min)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sched_get_priority_min
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sched_get_priority_min)
diff --git a/libc/arch-arm/syscalls/sched_getparam.S b/libc/arch-arm/syscalls/sched_getparam.S
deleted file mode 100644
index 700041e..0000000
--- a/libc/arch-arm/syscalls/sched_getparam.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getparam)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sched_getparam
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sched_getparam)
diff --git a/libc/arch-arm/syscalls/sched_getscheduler.S b/libc/arch-arm/syscalls/sched_getscheduler.S
deleted file mode 100644
index b4f5d13..0000000
--- a/libc/arch-arm/syscalls/sched_getscheduler.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getscheduler)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sched_getscheduler
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sched_getscheduler)
diff --git a/libc/arch-arm/syscalls/sched_rr_get_interval.S b/libc/arch-arm/syscalls/sched_rr_get_interval.S
deleted file mode 100644
index ea30b62..0000000
--- a/libc/arch-arm/syscalls/sched_rr_get_interval.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_rr_get_interval)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sched_rr_get_interval
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sched_rr_get_interval)
diff --git a/libc/arch-arm/syscalls/sched_setaffinity.S b/libc/arch-arm/syscalls/sched_setaffinity.S
deleted file mode 100644
index 636845b..0000000
--- a/libc/arch-arm/syscalls/sched_setaffinity.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setaffinity)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sched_setaffinity
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sched_setaffinity)
diff --git a/libc/arch-arm/syscalls/sched_setparam.S b/libc/arch-arm/syscalls/sched_setparam.S
deleted file mode 100644
index f24b96e..0000000
--- a/libc/arch-arm/syscalls/sched_setparam.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setparam)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sched_setparam
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sched_setparam)
diff --git a/libc/arch-arm/syscalls/sched_setscheduler.S b/libc/arch-arm/syscalls/sched_setscheduler.S
deleted file mode 100644
index 5bfa202..0000000
--- a/libc/arch-arm/syscalls/sched_setscheduler.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setscheduler)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sched_setscheduler
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sched_setscheduler)
diff --git a/libc/arch-arm/syscalls/sched_yield.S b/libc/arch-arm/syscalls/sched_yield.S
deleted file mode 100644
index 7b93a6e..0000000
--- a/libc/arch-arm/syscalls/sched_yield.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_yield)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sched_yield
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sched_yield)
diff --git a/libc/arch-arm/syscalls/sendfile.S b/libc/arch-arm/syscalls/sendfile.S
deleted file mode 100644
index 52e78d0..0000000
--- a/libc/arch-arm/syscalls/sendfile.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendfile)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sendfile
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sendfile)
diff --git a/libc/arch-arm/syscalls/sendfile64.S b/libc/arch-arm/syscalls/sendfile64.S
deleted file mode 100644
index 416e9d2..0000000
--- a/libc/arch-arm/syscalls/sendfile64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendfile64)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sendfile64
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sendfile64)
diff --git a/libc/arch-arm/syscalls/sendmmsg.S b/libc/arch-arm/syscalls/sendmmsg.S
deleted file mode 100644
index f97d264..0000000
--- a/libc/arch-arm/syscalls/sendmmsg.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmmsg)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sendmmsg
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sendmmsg)
diff --git a/libc/arch-arm/syscalls/sendmsg.S b/libc/arch-arm/syscalls/sendmsg.S
deleted file mode 100644
index 215219a..0000000
--- a/libc/arch-arm/syscalls/sendmsg.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmsg)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sendmsg
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sendmsg)
diff --git a/libc/arch-arm/syscalls/sendto.S b/libc/arch-arm/syscalls/sendto.S
deleted file mode 100644
index 29b7b0b..0000000
--- a/libc/arch-arm/syscalls/sendto.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendto)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_sendto
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sendto)
diff --git a/libc/arch-arm/syscalls/setdomainname.S b/libc/arch-arm/syscalls/setdomainname.S
deleted file mode 100644
index 4014a48..0000000
--- a/libc/arch-arm/syscalls/setdomainname.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setdomainname)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setdomainname
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setdomainname)
diff --git a/libc/arch-arm/syscalls/setfsgid.S b/libc/arch-arm/syscalls/setfsgid.S
deleted file mode 100644
index 2f0f08c..0000000
--- a/libc/arch-arm/syscalls/setfsgid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsgid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setfsgid
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setfsgid)
diff --git a/libc/arch-arm/syscalls/setfsuid.S b/libc/arch-arm/syscalls/setfsuid.S
deleted file mode 100644
index ce663e0..0000000
--- a/libc/arch-arm/syscalls/setfsuid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsuid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setfsuid
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setfsuid)
diff --git a/libc/arch-arm/syscalls/setgid.S b/libc/arch-arm/syscalls/setgid.S
deleted file mode 100644
index 6f1cbed..0000000
--- a/libc/arch-arm/syscalls/setgid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setgid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setgid)
diff --git a/libc/arch-arm/syscalls/setgroups.S b/libc/arch-arm/syscalls/setgroups.S
deleted file mode 100644
index 1fb494c..0000000
--- a/libc/arch-arm/syscalls/setgroups.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgroups)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setgroups32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setgroups)
diff --git a/libc/arch-arm/syscalls/sethostname.S b/libc/arch-arm/syscalls/sethostname.S
deleted file mode 100644
index c4c2db5..0000000
--- a/libc/arch-arm/syscalls/sethostname.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sethostname)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sethostname
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sethostname)
diff --git a/libc/arch-arm/syscalls/setitimer.S b/libc/arch-arm/syscalls/setitimer.S
deleted file mode 100644
index 511a5d1..0000000
--- a/libc/arch-arm/syscalls/setitimer.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setitimer)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setitimer
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setitimer)
diff --git a/libc/arch-arm/syscalls/setns.S b/libc/arch-arm/syscalls/setns.S
deleted file mode 100644
index b1902dc..0000000
--- a/libc/arch-arm/syscalls/setns.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setns)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setns
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setns)
diff --git a/libc/arch-arm/syscalls/setpgid.S b/libc/arch-arm/syscalls/setpgid.S
deleted file mode 100644
index fe05fc9..0000000
--- a/libc/arch-arm/syscalls/setpgid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpgid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setpgid
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setpgid)
diff --git a/libc/arch-arm/syscalls/setpriority.S b/libc/arch-arm/syscalls/setpriority.S
deleted file mode 100644
index 960eee0..0000000
--- a/libc/arch-arm/syscalls/setpriority.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpriority)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setpriority
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setpriority)
diff --git a/libc/arch-arm/syscalls/setregid.S b/libc/arch-arm/syscalls/setregid.S
deleted file mode 100644
index 0b5f444..0000000
--- a/libc/arch-arm/syscalls/setregid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setregid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setregid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setregid)
diff --git a/libc/arch-arm/syscalls/setresgid.S b/libc/arch-arm/syscalls/setresgid.S
deleted file mode 100644
index 64677d3..0000000
--- a/libc/arch-arm/syscalls/setresgid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresgid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setresgid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setresgid)
diff --git a/libc/arch-arm/syscalls/setresuid.S b/libc/arch-arm/syscalls/setresuid.S
deleted file mode 100644
index e3888f6..0000000
--- a/libc/arch-arm/syscalls/setresuid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresuid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setresuid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setresuid)
diff --git a/libc/arch-arm/syscalls/setreuid.S b/libc/arch-arm/syscalls/setreuid.S
deleted file mode 100644
index 15c2665..0000000
--- a/libc/arch-arm/syscalls/setreuid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setreuid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setreuid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setreuid)
diff --git a/libc/arch-arm/syscalls/setrlimit.S b/libc/arch-arm/syscalls/setrlimit.S
deleted file mode 100644
index b9014eb..0000000
--- a/libc/arch-arm/syscalls/setrlimit.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setrlimit)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setrlimit
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setrlimit)
diff --git a/libc/arch-arm/syscalls/setsid.S b/libc/arch-arm/syscalls/setsid.S
deleted file mode 100644
index fb71474..0000000
--- a/libc/arch-arm/syscalls/setsid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setsid
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setsid)
diff --git a/libc/arch-arm/syscalls/setsockopt.S b/libc/arch-arm/syscalls/setsockopt.S
deleted file mode 100644
index 8ea3893..0000000
--- a/libc/arch-arm/syscalls/setsockopt.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsockopt)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_setsockopt
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setsockopt)
diff --git a/libc/arch-arm/syscalls/settimeofday.S b/libc/arch-arm/syscalls/settimeofday.S
deleted file mode 100644
index 00dfdeb..0000000
--- a/libc/arch-arm/syscalls/settimeofday.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(settimeofday)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_settimeofday
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(settimeofday)
diff --git a/libc/arch-arm/syscalls/setuid.S b/libc/arch-arm/syscalls/setuid.S
deleted file mode 100644
index 447ed1b..0000000
--- a/libc/arch-arm/syscalls/setuid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setuid)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_setuid32
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setuid)
diff --git a/libc/arch-arm/syscalls/setxattr.S b/libc/arch-arm/syscalls/setxattr.S
deleted file mode 100644
index 8ba4b77..0000000
--- a/libc/arch-arm/syscalls/setxattr.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setxattr)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_setxattr
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(setxattr)
diff --git a/libc/arch-arm/syscalls/shutdown.S b/libc/arch-arm/syscalls/shutdown.S
deleted file mode 100644
index 51ed0cf..0000000
--- a/libc/arch-arm/syscalls/shutdown.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(shutdown)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_shutdown
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(shutdown)
diff --git a/libc/arch-arm/syscalls/sigaltstack.S b/libc/arch-arm/syscalls/sigaltstack.S
deleted file mode 100644
index 2f97800..0000000
--- a/libc/arch-arm/syscalls/sigaltstack.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sigaltstack)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sigaltstack
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sigaltstack)
diff --git a/libc/arch-arm/syscalls/socketpair.S b/libc/arch-arm/syscalls/socketpair.S
deleted file mode 100644
index e537235..0000000
--- a/libc/arch-arm/syscalls/socketpair.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(socketpair)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_socketpair
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(socketpair)
diff --git a/libc/arch-arm/syscalls/splice.S b/libc/arch-arm/syscalls/splice.S
deleted file mode 100644
index 6bc3f0d..0000000
--- a/libc/arch-arm/syscalls/splice.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(splice)
-    mov     ip, sp
-    stmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset r4, 0
-    .cfi_rel_offset r5, 4
-    .cfi_rel_offset r6, 8
-    .cfi_rel_offset r7, 12
-    ldmfd   ip, {r4, r5, r6}
-    ldr     r7, =__NR_splice
-    swi     #0
-    ldmfd   sp!, {r4, r5, r6, r7}
-    .cfi_def_cfa_offset 0
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(splice)
diff --git a/libc/arch-arm/syscalls/swapoff.S b/libc/arch-arm/syscalls/swapoff.S
deleted file mode 100644
index 25832ef..0000000
--- a/libc/arch-arm/syscalls/swapoff.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapoff)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_swapoff
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(swapoff)
diff --git a/libc/arch-arm/syscalls/swapon.S b/libc/arch-arm/syscalls/swapon.S
deleted file mode 100644
index df4c71e..0000000
--- a/libc/arch-arm/syscalls/swapon.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapon)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_swapon
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(swapon)
diff --git a/libc/arch-arm/syscalls/symlinkat.S b/libc/arch-arm/syscalls/symlinkat.S
deleted file mode 100644
index ec2ee4f..0000000
--- a/libc/arch-arm/syscalls/symlinkat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(symlinkat)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_symlinkat
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(symlinkat)
diff --git a/libc/arch-arm/syscalls/sync.S b/libc/arch-arm/syscalls/sync.S
deleted file mode 100644
index b73dcaa..0000000
--- a/libc/arch-arm/syscalls/sync.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sync)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sync
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sync)
diff --git a/libc/arch-arm/syscalls/syncfs.S b/libc/arch-arm/syscalls/syncfs.S
deleted file mode 100644
index 26f2f14..0000000
--- a/libc/arch-arm/syscalls/syncfs.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(syncfs)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_syncfs
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(syncfs)
diff --git a/libc/arch-arm/syscalls/sysinfo.S b/libc/arch-arm/syscalls/sysinfo.S
deleted file mode 100644
index 1584ea4..0000000
--- a/libc/arch-arm/syscalls/sysinfo.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sysinfo)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_sysinfo
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(sysinfo)
diff --git a/libc/arch-arm/syscalls/tee.S b/libc/arch-arm/syscalls/tee.S
deleted file mode 100644
index efd12ca..0000000
--- a/libc/arch-arm/syscalls/tee.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tee)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_tee
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(tee)
diff --git a/libc/arch-arm/syscalls/tgkill.S b/libc/arch-arm/syscalls/tgkill.S
deleted file mode 100644
index 43fe62c..0000000
--- a/libc/arch-arm/syscalls/tgkill.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tgkill)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_tgkill
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(tgkill)
diff --git a/libc/arch-arm/syscalls/timerfd_create.S b/libc/arch-arm/syscalls/timerfd_create.S
deleted file mode 100644
index 4aa3107..0000000
--- a/libc/arch-arm/syscalls/timerfd_create.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_create)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_timerfd_create
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(timerfd_create)
diff --git a/libc/arch-arm/syscalls/timerfd_gettime.S b/libc/arch-arm/syscalls/timerfd_gettime.S
deleted file mode 100644
index 6ae93e4..0000000
--- a/libc/arch-arm/syscalls/timerfd_gettime.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_gettime)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_timerfd_gettime
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(timerfd_gettime)
diff --git a/libc/arch-arm/syscalls/timerfd_settime.S b/libc/arch-arm/syscalls/timerfd_settime.S
deleted file mode 100644
index 2dd4aac..0000000
--- a/libc/arch-arm/syscalls/timerfd_settime.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_settime)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_timerfd_settime
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(timerfd_settime)
diff --git a/libc/arch-arm/syscalls/times.S b/libc/arch-arm/syscalls/times.S
deleted file mode 100644
index 1ff636d..0000000
--- a/libc/arch-arm/syscalls/times.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(times)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_times
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(times)
diff --git a/libc/arch-arm/syscalls/truncate.S b/libc/arch-arm/syscalls/truncate.S
deleted file mode 100644
index 0bee4d2..0000000
--- a/libc/arch-arm/syscalls/truncate.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(truncate)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_truncate
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(truncate)
diff --git a/libc/arch-arm/syscalls/truncate64.S b/libc/arch-arm/syscalls/truncate64.S
deleted file mode 100644
index 74e9eb2..0000000
--- a/libc/arch-arm/syscalls/truncate64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(truncate64)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_truncate64
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(truncate64)
diff --git a/libc/arch-arm/syscalls/umask.S b/libc/arch-arm/syscalls/umask.S
deleted file mode 100644
index ca3e058..0000000
--- a/libc/arch-arm/syscalls/umask.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umask)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_umask
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(umask)
diff --git a/libc/arch-arm/syscalls/umount2.S b/libc/arch-arm/syscalls/umount2.S
deleted file mode 100644
index 6e1ba32..0000000
--- a/libc/arch-arm/syscalls/umount2.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umount2)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_umount2
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(umount2)
diff --git a/libc/arch-arm/syscalls/uname.S b/libc/arch-arm/syscalls/uname.S
deleted file mode 100644
index 4f2b8a2..0000000
--- a/libc/arch-arm/syscalls/uname.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(uname)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_uname
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(uname)
diff --git a/libc/arch-arm/syscalls/unlinkat.S b/libc/arch-arm/syscalls/unlinkat.S
deleted file mode 100644
index ac7bfae..0000000
--- a/libc/arch-arm/syscalls/unlinkat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unlinkat)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_unlinkat
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(unlinkat)
diff --git a/libc/arch-arm/syscalls/unshare.S b/libc/arch-arm/syscalls/unshare.S
deleted file mode 100644
index 4558a60..0000000
--- a/libc/arch-arm/syscalls/unshare.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unshare)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_unshare
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(unshare)
diff --git a/libc/arch-arm/syscalls/utimensat.S b/libc/arch-arm/syscalls/utimensat.S
deleted file mode 100644
index 9524507..0000000
--- a/libc/arch-arm/syscalls/utimensat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(utimensat)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_utimensat
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(utimensat)
diff --git a/libc/arch-arm/syscalls/vmsplice.S b/libc/arch-arm/syscalls/vmsplice.S
deleted file mode 100644
index 90ab8b4..0000000
--- a/libc/arch-arm/syscalls/vmsplice.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(vmsplice)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_vmsplice
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(vmsplice)
diff --git a/libc/arch-arm/syscalls/wait4.S b/libc/arch-arm/syscalls/wait4.S
deleted file mode 100644
index 40bb5a5..0000000
--- a/libc/arch-arm/syscalls/wait4.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(wait4)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_wait4
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(wait4)
diff --git a/libc/arch-arm/syscalls/write.S b/libc/arch-arm/syscalls/write.S
deleted file mode 100644
index 4abbe6b..0000000
--- a/libc/arch-arm/syscalls/write.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(write)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_write
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(write)
diff --git a/libc/arch-arm/syscalls/writev.S b/libc/arch-arm/syscalls/writev.S
deleted file mode 100644
index 3103237..0000000
--- a/libc/arch-arm/syscalls/writev.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(writev)
-    mov     ip, r7
-    .cfi_register r7, ip
-    ldr     r7, =__NR_writev
-    swi     #0
-    mov     r7, ip
-    .cfi_restore r7
-    cmn     r0, #(MAX_ERRNO + 1)
-    bxls    lr
-    neg     r0, r0
-    b       __set_errno_internal
-END(writev)
diff --git a/libc/arch-arm64/bionic/vfork.S b/libc/arch-arm64/bionic/vfork.S
index 0a83cc7..6c01572 100644
--- a/libc/arch-arm64/bionic/vfork.S
+++ b/libc/arch-arm64/bionic/vfork.S
@@ -27,6 +27,7 @@
  */
 
 #include <private/bionic_asm.h>
+#include <private/bionic_asm_tls.h>
 #include <asm/signal.h>
 #include <linux/sched.h>
 
@@ -34,7 +35,7 @@
 __BIONIC_WEAK_ASM_FOR_NATIVE_BRIDGE(vfork)
     // __get_tls()[TLS_SLOT_THREAD_ID]->cached_pid_ = 0
     mrs     x0, tpidr_el0
-    ldr     x0, [x0, #8]
+    ldr     x0, [x0, #(TLS_SLOT_THREAD_ID * 8)]
     str     wzr, [x0, #20]
 
     mov     x0, #(CLONE_VM | CLONE_VFORK | SIGCHLD)
@@ -50,5 +51,26 @@
     cneg    x0, x0, hi
     b.hi    __set_errno_internal
 
+#if __has_feature(hwaddress_sanitizer)
+    cbz x0, .L_exit
+
+    // Clean up stack shadow in the parent process.
+    // https://github.com/google/sanitizers/issues/925
+    stp x0, x30, [sp, #-16]!
+    .cfi_adjust_cfa_offset 16
+    .cfi_rel_offset x0, 0
+    .cfi_rel_offset x30, 8
+
+    add x0, sp, #16
+    bl __hwasan_handle_vfork
+
+    ldp x0, x30, [sp], #16
+    .cfi_adjust_cfa_offset -16
+    .cfi_restore x0
+    .cfi_restore x30
+
+#endif
+
+.L_exit:
     ret
 END(vfork)
diff --git a/libc/arch-arm64/syscalls/___clock_nanosleep.S b/libc/arch-arm64/syscalls/___clock_nanosleep.S
deleted file mode 100644
index 0dcfd4f..0000000
--- a/libc/arch-arm64/syscalls/___clock_nanosleep.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___clock_nanosleep)
-    mov     x8, __NR_clock_nanosleep
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(___clock_nanosleep)
-.hidden ___clock_nanosleep
diff --git a/libc/arch-arm64/syscalls/___close.S b/libc/arch-arm64/syscalls/___close.S
deleted file mode 100644
index 8fb8361..0000000
--- a/libc/arch-arm64/syscalls/___close.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___close)
-    mov     x8, __NR_close
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(___close)
-.hidden ___close
diff --git a/libc/arch-arm64/syscalls/___faccessat.S b/libc/arch-arm64/syscalls/___faccessat.S
deleted file mode 100644
index 6a41b69..0000000
--- a/libc/arch-arm64/syscalls/___faccessat.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___faccessat)
-    mov     x8, __NR_faccessat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(___faccessat)
-.hidden ___faccessat
diff --git a/libc/arch-arm64/syscalls/___fchmod.S b/libc/arch-arm64/syscalls/___fchmod.S
deleted file mode 100644
index a143c65..0000000
--- a/libc/arch-arm64/syscalls/___fchmod.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmod)
-    mov     x8, __NR_fchmod
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(___fchmod)
-.hidden ___fchmod
diff --git a/libc/arch-arm64/syscalls/___fchmodat.S b/libc/arch-arm64/syscalls/___fchmodat.S
deleted file mode 100644
index 1ab3736..0000000
--- a/libc/arch-arm64/syscalls/___fchmodat.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmodat)
-    mov     x8, __NR_fchmodat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(___fchmodat)
-.hidden ___fchmodat
diff --git a/libc/arch-arm64/syscalls/___fgetxattr.S b/libc/arch-arm64/syscalls/___fgetxattr.S
deleted file mode 100644
index c0334cc..0000000
--- a/libc/arch-arm64/syscalls/___fgetxattr.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fgetxattr)
-    mov     x8, __NR_fgetxattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(___fgetxattr)
-.hidden ___fgetxattr
diff --git a/libc/arch-arm64/syscalls/___flistxattr.S b/libc/arch-arm64/syscalls/___flistxattr.S
deleted file mode 100644
index 02c8478..0000000
--- a/libc/arch-arm64/syscalls/___flistxattr.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___flistxattr)
-    mov     x8, __NR_flistxattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(___flistxattr)
-.hidden ___flistxattr
diff --git a/libc/arch-arm64/syscalls/___fsetxattr.S b/libc/arch-arm64/syscalls/___fsetxattr.S
deleted file mode 100644
index 92be8de..0000000
--- a/libc/arch-arm64/syscalls/___fsetxattr.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fsetxattr)
-    mov     x8, __NR_fsetxattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(___fsetxattr)
-.hidden ___fsetxattr
diff --git a/libc/arch-arm64/syscalls/___mremap.S b/libc/arch-arm64/syscalls/___mremap.S
deleted file mode 100644
index aeb93bc..0000000
--- a/libc/arch-arm64/syscalls/___mremap.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___mremap)
-    mov     x8, __NR_mremap
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(___mremap)
-.hidden ___mremap
diff --git a/libc/arch-arm64/syscalls/___rt_sigqueueinfo.S b/libc/arch-arm64/syscalls/___rt_sigqueueinfo.S
deleted file mode 100644
index 85ea132..0000000
--- a/libc/arch-arm64/syscalls/___rt_sigqueueinfo.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___rt_sigqueueinfo)
-    mov     x8, __NR_rt_sigqueueinfo
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(___rt_sigqueueinfo)
-.hidden ___rt_sigqueueinfo
diff --git a/libc/arch-arm64/syscalls/__accept4.S b/libc/arch-arm64/syscalls/__accept4.S
deleted file mode 100644
index 559e6a7..0000000
--- a/libc/arch-arm64/syscalls/__accept4.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__accept4)
-    mov     x8, __NR_accept4
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__accept4)
-.hidden __accept4
diff --git a/libc/arch-arm64/syscalls/__brk.S b/libc/arch-arm64/syscalls/__brk.S
deleted file mode 100644
index fb794bf..0000000
--- a/libc/arch-arm64/syscalls/__brk.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__brk)
-    mov     x8, __NR_brk
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__brk)
-.hidden __brk
diff --git a/libc/arch-arm64/syscalls/__clock_getres.S b/libc/arch-arm64/syscalls/__clock_getres.S
deleted file mode 100644
index 9d0deaa..0000000
--- a/libc/arch-arm64/syscalls/__clock_getres.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_getres)
-    mov     x8, __NR_clock_getres
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__clock_getres)
-.hidden __clock_getres
diff --git a/libc/arch-arm64/syscalls/__clock_gettime.S b/libc/arch-arm64/syscalls/__clock_gettime.S
deleted file mode 100644
index 658ab29..0000000
--- a/libc/arch-arm64/syscalls/__clock_gettime.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_gettime)
-    mov     x8, __NR_clock_gettime
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__clock_gettime)
-.hidden __clock_gettime
diff --git a/libc/arch-arm64/syscalls/__connect.S b/libc/arch-arm64/syscalls/__connect.S
deleted file mode 100644
index c18e6eb..0000000
--- a/libc/arch-arm64/syscalls/__connect.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__connect)
-    mov     x8, __NR_connect
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__connect)
-.hidden __connect
diff --git a/libc/arch-arm64/syscalls/__epoll_pwait.S b/libc/arch-arm64/syscalls/__epoll_pwait.S
deleted file mode 100644
index acf2bbf..0000000
--- a/libc/arch-arm64/syscalls/__epoll_pwait.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__epoll_pwait)
-    mov     x8, __NR_epoll_pwait
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__epoll_pwait)
-.hidden __epoll_pwait
diff --git a/libc/arch-arm64/syscalls/__exit.S b/libc/arch-arm64/syscalls/__exit.S
deleted file mode 100644
index b6b1866..0000000
--- a/libc/arch-arm64/syscalls/__exit.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__exit)
-    mov     x8, __NR_exit
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__exit)
-.hidden __exit
diff --git a/libc/arch-arm64/syscalls/__fadvise64.S b/libc/arch-arm64/syscalls/__fadvise64.S
deleted file mode 100644
index 695d094..0000000
--- a/libc/arch-arm64/syscalls/__fadvise64.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fadvise64)
-    mov     x8, __NR_fadvise64
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__fadvise64)
-.hidden __fadvise64
diff --git a/libc/arch-arm64/syscalls/__fstatfs.S b/libc/arch-arm64/syscalls/__fstatfs.S
deleted file mode 100644
index 7e350d6..0000000
--- a/libc/arch-arm64/syscalls/__fstatfs.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fstatfs)
-    mov     x8, __NR_fstatfs
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__fstatfs)
-.hidden __fstatfs
diff --git a/libc/arch-arm64/syscalls/__getcpu.S b/libc/arch-arm64/syscalls/__getcpu.S
deleted file mode 100644
index 11ed68e..0000000
--- a/libc/arch-arm64/syscalls/__getcpu.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcpu)
-    mov     x8, __NR_getcpu
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__getcpu)
-.hidden __getcpu
diff --git a/libc/arch-arm64/syscalls/__getcwd.S b/libc/arch-arm64/syscalls/__getcwd.S
deleted file mode 100644
index c64f4d2..0000000
--- a/libc/arch-arm64/syscalls/__getcwd.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcwd)
-    mov     x8, __NR_getcwd
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__getcwd)
-.hidden __getcwd
diff --git a/libc/arch-arm64/syscalls/__getdents64.S b/libc/arch-arm64/syscalls/__getdents64.S
deleted file mode 100644
index 9943390..0000000
--- a/libc/arch-arm64/syscalls/__getdents64.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getdents64)
-    mov     x8, __NR_getdents64
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__getdents64)
-.hidden __getdents64
diff --git a/libc/arch-arm64/syscalls/__getpid.S b/libc/arch-arm64/syscalls/__getpid.S
deleted file mode 100644
index fbc96df..0000000
--- a/libc/arch-arm64/syscalls/__getpid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpid)
-    mov     x8, __NR_getpid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__getpid)
-.hidden __getpid
diff --git a/libc/arch-arm64/syscalls/__getpriority.S b/libc/arch-arm64/syscalls/__getpriority.S
deleted file mode 100644
index 9d98e22..0000000
--- a/libc/arch-arm64/syscalls/__getpriority.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpriority)
-    mov     x8, __NR_getpriority
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__getpriority)
-.hidden __getpriority
diff --git a/libc/arch-arm64/syscalls/__gettimeofday.S b/libc/arch-arm64/syscalls/__gettimeofday.S
deleted file mode 100644
index 0c8206a..0000000
--- a/libc/arch-arm64/syscalls/__gettimeofday.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__gettimeofday)
-    mov     x8, __NR_gettimeofday
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__gettimeofday)
-.hidden __gettimeofday
diff --git a/libc/arch-arm64/syscalls/__ioctl.S b/libc/arch-arm64/syscalls/__ioctl.S
deleted file mode 100644
index 62bc28c..0000000
--- a/libc/arch-arm64/syscalls/__ioctl.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ioctl)
-    mov     x8, __NR_ioctl
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__ioctl)
-.hidden __ioctl
diff --git a/libc/arch-arm64/syscalls/__openat.S b/libc/arch-arm64/syscalls/__openat.S
deleted file mode 100644
index 8b6853f..0000000
--- a/libc/arch-arm64/syscalls/__openat.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__openat)
-    mov     x8, __NR_openat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__openat)
-.hidden __openat
diff --git a/libc/arch-arm64/syscalls/__ppoll.S b/libc/arch-arm64/syscalls/__ppoll.S
deleted file mode 100644
index 1f54d67..0000000
--- a/libc/arch-arm64/syscalls/__ppoll.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ppoll)
-    mov     x8, __NR_ppoll
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__ppoll)
-.hidden __ppoll
diff --git a/libc/arch-arm64/syscalls/__pselect6.S b/libc/arch-arm64/syscalls/__pselect6.S
deleted file mode 100644
index 388d84e..0000000
--- a/libc/arch-arm64/syscalls/__pselect6.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__pselect6)
-    mov     x8, __NR_pselect6
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__pselect6)
-.hidden __pselect6
diff --git a/libc/arch-arm64/syscalls/__ptrace.S b/libc/arch-arm64/syscalls/__ptrace.S
deleted file mode 100644
index d68b674..0000000
--- a/libc/arch-arm64/syscalls/__ptrace.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ptrace)
-    mov     x8, __NR_ptrace
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__ptrace)
-.hidden __ptrace
diff --git a/libc/arch-arm64/syscalls/__reboot.S b/libc/arch-arm64/syscalls/__reboot.S
deleted file mode 100644
index 79cd5be..0000000
--- a/libc/arch-arm64/syscalls/__reboot.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__reboot)
-    mov     x8, __NR_reboot
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__reboot)
-.hidden __reboot
diff --git a/libc/arch-arm64/syscalls/__rt_sigaction.S b/libc/arch-arm64/syscalls/__rt_sigaction.S
deleted file mode 100644
index 65fea2e..0000000
--- a/libc/arch-arm64/syscalls/__rt_sigaction.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigaction)
-    mov     x8, __NR_rt_sigaction
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__rt_sigaction)
-.hidden __rt_sigaction
diff --git a/libc/arch-arm64/syscalls/__rt_sigpending.S b/libc/arch-arm64/syscalls/__rt_sigpending.S
deleted file mode 100644
index 6553781..0000000
--- a/libc/arch-arm64/syscalls/__rt_sigpending.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigpending)
-    mov     x8, __NR_rt_sigpending
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__rt_sigpending)
-.hidden __rt_sigpending
diff --git a/libc/arch-arm64/syscalls/__rt_sigprocmask.S b/libc/arch-arm64/syscalls/__rt_sigprocmask.S
deleted file mode 100644
index 95127d6..0000000
--- a/libc/arch-arm64/syscalls/__rt_sigprocmask.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigprocmask)
-    mov     x8, __NR_rt_sigprocmask
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__rt_sigprocmask)
-.hidden __rt_sigprocmask
diff --git a/libc/arch-arm64/syscalls/__rt_sigsuspend.S b/libc/arch-arm64/syscalls/__rt_sigsuspend.S
deleted file mode 100644
index 7cbd8d6..0000000
--- a/libc/arch-arm64/syscalls/__rt_sigsuspend.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigsuspend)
-    mov     x8, __NR_rt_sigsuspend
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__rt_sigsuspend)
-.hidden __rt_sigsuspend
diff --git a/libc/arch-arm64/syscalls/__rt_sigtimedwait.S b/libc/arch-arm64/syscalls/__rt_sigtimedwait.S
deleted file mode 100644
index 8001635..0000000
--- a/libc/arch-arm64/syscalls/__rt_sigtimedwait.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigtimedwait)
-    mov     x8, __NR_rt_sigtimedwait
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__rt_sigtimedwait)
-.hidden __rt_sigtimedwait
diff --git a/libc/arch-arm64/syscalls/__sched_getaffinity.S b/libc/arch-arm64/syscalls/__sched_getaffinity.S
deleted file mode 100644
index 7dad15e..0000000
--- a/libc/arch-arm64/syscalls/__sched_getaffinity.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sched_getaffinity)
-    mov     x8, __NR_sched_getaffinity
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__sched_getaffinity)
-.hidden __sched_getaffinity
diff --git a/libc/arch-arm64/syscalls/__set_tid_address.S b/libc/arch-arm64/syscalls/__set_tid_address.S
deleted file mode 100644
index f7ae16d..0000000
--- a/libc/arch-arm64/syscalls/__set_tid_address.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__set_tid_address)
-    mov     x8, __NR_set_tid_address
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__set_tid_address)
-.hidden __set_tid_address
diff --git a/libc/arch-arm64/syscalls/__signalfd4.S b/libc/arch-arm64/syscalls/__signalfd4.S
deleted file mode 100644
index f6e3497..0000000
--- a/libc/arch-arm64/syscalls/__signalfd4.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__signalfd4)
-    mov     x8, __NR_signalfd4
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__signalfd4)
-.hidden __signalfd4
diff --git a/libc/arch-arm64/syscalls/__socket.S b/libc/arch-arm64/syscalls/__socket.S
deleted file mode 100644
index 344bb2d..0000000
--- a/libc/arch-arm64/syscalls/__socket.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__socket)
-    mov     x8, __NR_socket
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__socket)
-.hidden __socket
diff --git a/libc/arch-arm64/syscalls/__statfs.S b/libc/arch-arm64/syscalls/__statfs.S
deleted file mode 100644
index 962c590..0000000
--- a/libc/arch-arm64/syscalls/__statfs.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__statfs)
-    mov     x8, __NR_statfs
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__statfs)
-.hidden __statfs
diff --git a/libc/arch-arm64/syscalls/__sync_file_range.S b/libc/arch-arm64/syscalls/__sync_file_range.S
deleted file mode 100644
index 776e900..0000000
--- a/libc/arch-arm64/syscalls/__sync_file_range.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sync_file_range)
-    mov     x8, __NR_sync_file_range
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__sync_file_range)
-.hidden __sync_file_range
diff --git a/libc/arch-arm64/syscalls/__timer_create.S b/libc/arch-arm64/syscalls/__timer_create.S
deleted file mode 100644
index 4790845..0000000
--- a/libc/arch-arm64/syscalls/__timer_create.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_create)
-    mov     x8, __NR_timer_create
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__timer_create)
-.hidden __timer_create
diff --git a/libc/arch-arm64/syscalls/__timer_delete.S b/libc/arch-arm64/syscalls/__timer_delete.S
deleted file mode 100644
index ce12613..0000000
--- a/libc/arch-arm64/syscalls/__timer_delete.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_delete)
-    mov     x8, __NR_timer_delete
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__timer_delete)
-.hidden __timer_delete
diff --git a/libc/arch-arm64/syscalls/__timer_getoverrun.S b/libc/arch-arm64/syscalls/__timer_getoverrun.S
deleted file mode 100644
index 2cfdf6a..0000000
--- a/libc/arch-arm64/syscalls/__timer_getoverrun.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_getoverrun)
-    mov     x8, __NR_timer_getoverrun
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__timer_getoverrun)
-.hidden __timer_getoverrun
diff --git a/libc/arch-arm64/syscalls/__timer_gettime.S b/libc/arch-arm64/syscalls/__timer_gettime.S
deleted file mode 100644
index a1ea323..0000000
--- a/libc/arch-arm64/syscalls/__timer_gettime.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_gettime)
-    mov     x8, __NR_timer_gettime
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__timer_gettime)
-.hidden __timer_gettime
diff --git a/libc/arch-arm64/syscalls/__timer_settime.S b/libc/arch-arm64/syscalls/__timer_settime.S
deleted file mode 100644
index 059d705..0000000
--- a/libc/arch-arm64/syscalls/__timer_settime.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_settime)
-    mov     x8, __NR_timer_settime
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__timer_settime)
-.hidden __timer_settime
diff --git a/libc/arch-arm64/syscalls/__waitid.S b/libc/arch-arm64/syscalls/__waitid.S
deleted file mode 100644
index 8bd649d..0000000
--- a/libc/arch-arm64/syscalls/__waitid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__waitid)
-    mov     x8, __NR_waitid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(__waitid)
-.hidden __waitid
diff --git a/libc/arch-arm64/syscalls/_exit.S b/libc/arch-arm64/syscalls/_exit.S
deleted file mode 100644
index d50f38d..0000000
--- a/libc/arch-arm64/syscalls/_exit.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(_exit)
-    mov     x8, __NR_exit_group
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(_exit)
-
-ALIAS_SYMBOL(_Exit, _exit)
diff --git a/libc/arch-arm64/syscalls/acct.S b/libc/arch-arm64/syscalls/acct.S
deleted file mode 100644
index 48cb4e9..0000000
--- a/libc/arch-arm64/syscalls/acct.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(acct)
-    mov     x8, __NR_acct
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(acct)
diff --git a/libc/arch-arm64/syscalls/adjtimex.S b/libc/arch-arm64/syscalls/adjtimex.S
deleted file mode 100644
index 712e468..0000000
--- a/libc/arch-arm64/syscalls/adjtimex.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(adjtimex)
-    mov     x8, __NR_adjtimex
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(adjtimex)
diff --git a/libc/arch-arm64/syscalls/bind.S b/libc/arch-arm64/syscalls/bind.S
deleted file mode 100644
index 47170ff..0000000
--- a/libc/arch-arm64/syscalls/bind.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(bind)
-    mov     x8, __NR_bind
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(bind)
diff --git a/libc/arch-arm64/syscalls/capget.S b/libc/arch-arm64/syscalls/capget.S
deleted file mode 100644
index 7e0dfe9..0000000
--- a/libc/arch-arm64/syscalls/capget.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capget)
-    mov     x8, __NR_capget
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(capget)
diff --git a/libc/arch-arm64/syscalls/capset.S b/libc/arch-arm64/syscalls/capset.S
deleted file mode 100644
index e7b7a8d..0000000
--- a/libc/arch-arm64/syscalls/capset.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capset)
-    mov     x8, __NR_capset
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(capset)
diff --git a/libc/arch-arm64/syscalls/chdir.S b/libc/arch-arm64/syscalls/chdir.S
deleted file mode 100644
index 723cd08..0000000
--- a/libc/arch-arm64/syscalls/chdir.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chdir)
-    mov     x8, __NR_chdir
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(chdir)
diff --git a/libc/arch-arm64/syscalls/chroot.S b/libc/arch-arm64/syscalls/chroot.S
deleted file mode 100644
index e4f6bd9..0000000
--- a/libc/arch-arm64/syscalls/chroot.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chroot)
-    mov     x8, __NR_chroot
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(chroot)
diff --git a/libc/arch-arm64/syscalls/clock_adjtime.S b/libc/arch-arm64/syscalls/clock_adjtime.S
deleted file mode 100644
index c2c191e..0000000
--- a/libc/arch-arm64/syscalls/clock_adjtime.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_adjtime)
-    mov     x8, __NR_clock_adjtime
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(clock_adjtime)
diff --git a/libc/arch-arm64/syscalls/clock_settime.S b/libc/arch-arm64/syscalls/clock_settime.S
deleted file mode 100644
index 62354d1..0000000
--- a/libc/arch-arm64/syscalls/clock_settime.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_settime)
-    mov     x8, __NR_clock_settime
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(clock_settime)
diff --git a/libc/arch-arm64/syscalls/delete_module.S b/libc/arch-arm64/syscalls/delete_module.S
deleted file mode 100644
index db8d947..0000000
--- a/libc/arch-arm64/syscalls/delete_module.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(delete_module)
-    mov     x8, __NR_delete_module
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(delete_module)
diff --git a/libc/arch-arm64/syscalls/dup.S b/libc/arch-arm64/syscalls/dup.S
deleted file mode 100644
index 4e95045..0000000
--- a/libc/arch-arm64/syscalls/dup.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup)
-    mov     x8, __NR_dup
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(dup)
diff --git a/libc/arch-arm64/syscalls/dup3.S b/libc/arch-arm64/syscalls/dup3.S
deleted file mode 100644
index 2e6be32..0000000
--- a/libc/arch-arm64/syscalls/dup3.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup3)
-    mov     x8, __NR_dup3
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(dup3)
diff --git a/libc/arch-arm64/syscalls/epoll_create1.S b/libc/arch-arm64/syscalls/epoll_create1.S
deleted file mode 100644
index 6ef518e..0000000
--- a/libc/arch-arm64/syscalls/epoll_create1.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_create1)
-    mov     x8, __NR_epoll_create1
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(epoll_create1)
diff --git a/libc/arch-arm64/syscalls/epoll_ctl.S b/libc/arch-arm64/syscalls/epoll_ctl.S
deleted file mode 100644
index 1188f38..0000000
--- a/libc/arch-arm64/syscalls/epoll_ctl.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_ctl)
-    mov     x8, __NR_epoll_ctl
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(epoll_ctl)
diff --git a/libc/arch-arm64/syscalls/eventfd.S b/libc/arch-arm64/syscalls/eventfd.S
deleted file mode 100644
index ca5df12..0000000
--- a/libc/arch-arm64/syscalls/eventfd.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(eventfd)
-    mov     x8, __NR_eventfd2
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(eventfd)
diff --git a/libc/arch-arm64/syscalls/execve.S b/libc/arch-arm64/syscalls/execve.S
deleted file mode 100644
index fc8fb68..0000000
--- a/libc/arch-arm64/syscalls/execve.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(execve)
-    mov     x8, __NR_execve
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(execve)
diff --git a/libc/arch-arm64/syscalls/fallocate.S b/libc/arch-arm64/syscalls/fallocate.S
deleted file mode 100644
index d42a0ba..0000000
--- a/libc/arch-arm64/syscalls/fallocate.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fallocate)
-    mov     x8, __NR_fallocate
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(fallocate)
-
-ALIAS_SYMBOL(fallocate64, fallocate)
diff --git a/libc/arch-arm64/syscalls/fchdir.S b/libc/arch-arm64/syscalls/fchdir.S
deleted file mode 100644
index 2e164cb..0000000
--- a/libc/arch-arm64/syscalls/fchdir.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchdir)
-    mov     x8, __NR_fchdir
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(fchdir)
diff --git a/libc/arch-arm64/syscalls/fchown.S b/libc/arch-arm64/syscalls/fchown.S
deleted file mode 100644
index 4456f1b..0000000
--- a/libc/arch-arm64/syscalls/fchown.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchown)
-    mov     x8, __NR_fchown
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(fchown)
diff --git a/libc/arch-arm64/syscalls/fchownat.S b/libc/arch-arm64/syscalls/fchownat.S
deleted file mode 100644
index 7ba6611..0000000
--- a/libc/arch-arm64/syscalls/fchownat.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchownat)
-    mov     x8, __NR_fchownat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(fchownat)
diff --git a/libc/arch-arm64/syscalls/fcntl.S b/libc/arch-arm64/syscalls/fcntl.S
deleted file mode 100644
index e2787ae..0000000
--- a/libc/arch-arm64/syscalls/fcntl.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fcntl)
-    mov     x8, __NR_fcntl
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(fcntl)
diff --git a/libc/arch-arm64/syscalls/fdatasync.S b/libc/arch-arm64/syscalls/fdatasync.S
deleted file mode 100644
index 225ab29..0000000
--- a/libc/arch-arm64/syscalls/fdatasync.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fdatasync)
-    mov     x8, __NR_fdatasync
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(fdatasync)
diff --git a/libc/arch-arm64/syscalls/flock.S b/libc/arch-arm64/syscalls/flock.S
deleted file mode 100644
index 0c036c8..0000000
--- a/libc/arch-arm64/syscalls/flock.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(flock)
-    mov     x8, __NR_flock
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(flock)
diff --git a/libc/arch-arm64/syscalls/fremovexattr.S b/libc/arch-arm64/syscalls/fremovexattr.S
deleted file mode 100644
index cf3a371..0000000
--- a/libc/arch-arm64/syscalls/fremovexattr.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fremovexattr)
-    mov     x8, __NR_fremovexattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(fremovexattr)
diff --git a/libc/arch-arm64/syscalls/fstat64.S b/libc/arch-arm64/syscalls/fstat64.S
deleted file mode 100644
index f7c9f54..0000000
--- a/libc/arch-arm64/syscalls/fstat64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fstat64)
-    mov     x8, __NR_fstat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(fstat64)
-
-ALIAS_SYMBOL(fstat, fstat64)
diff --git a/libc/arch-arm64/syscalls/fstatat64.S b/libc/arch-arm64/syscalls/fstatat64.S
deleted file mode 100644
index 9f8f2c5..0000000
--- a/libc/arch-arm64/syscalls/fstatat64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fstatat64)
-    mov     x8, __NR_newfstatat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(fstatat64)
-
-ALIAS_SYMBOL(fstatat, fstatat64)
diff --git a/libc/arch-arm64/syscalls/fsync.S b/libc/arch-arm64/syscalls/fsync.S
deleted file mode 100644
index 2bc0d0b..0000000
--- a/libc/arch-arm64/syscalls/fsync.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fsync)
-    mov     x8, __NR_fsync
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(fsync)
diff --git a/libc/arch-arm64/syscalls/ftruncate.S b/libc/arch-arm64/syscalls/ftruncate.S
deleted file mode 100644
index c21e098..0000000
--- a/libc/arch-arm64/syscalls/ftruncate.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(ftruncate)
-    mov     x8, __NR_ftruncate
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(ftruncate)
-
-ALIAS_SYMBOL(ftruncate64, ftruncate)
diff --git a/libc/arch-arm64/syscalls/getegid.S b/libc/arch-arm64/syscalls/getegid.S
deleted file mode 100644
index f7d60d9..0000000
--- a/libc/arch-arm64/syscalls/getegid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getegid)
-    mov     x8, __NR_getegid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getegid)
diff --git a/libc/arch-arm64/syscalls/geteuid.S b/libc/arch-arm64/syscalls/geteuid.S
deleted file mode 100644
index 3096a92..0000000
--- a/libc/arch-arm64/syscalls/geteuid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(geteuid)
-    mov     x8, __NR_geteuid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(geteuid)
diff --git a/libc/arch-arm64/syscalls/getgid.S b/libc/arch-arm64/syscalls/getgid.S
deleted file mode 100644
index 2f921ff..0000000
--- a/libc/arch-arm64/syscalls/getgid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgid)
-    mov     x8, __NR_getgid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getgid)
diff --git a/libc/arch-arm64/syscalls/getgroups.S b/libc/arch-arm64/syscalls/getgroups.S
deleted file mode 100644
index a9a897e..0000000
--- a/libc/arch-arm64/syscalls/getgroups.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgroups)
-    mov     x8, __NR_getgroups
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getgroups)
diff --git a/libc/arch-arm64/syscalls/getitimer.S b/libc/arch-arm64/syscalls/getitimer.S
deleted file mode 100644
index f37063c..0000000
--- a/libc/arch-arm64/syscalls/getitimer.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getitimer)
-    mov     x8, __NR_getitimer
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getitimer)
diff --git a/libc/arch-arm64/syscalls/getpeername.S b/libc/arch-arm64/syscalls/getpeername.S
deleted file mode 100644
index 8374d60..0000000
--- a/libc/arch-arm64/syscalls/getpeername.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpeername)
-    mov     x8, __NR_getpeername
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getpeername)
diff --git a/libc/arch-arm64/syscalls/getpgid.S b/libc/arch-arm64/syscalls/getpgid.S
deleted file mode 100644
index ffc0d91..0000000
--- a/libc/arch-arm64/syscalls/getpgid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpgid)
-    mov     x8, __NR_getpgid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getpgid)
diff --git a/libc/arch-arm64/syscalls/getppid.S b/libc/arch-arm64/syscalls/getppid.S
deleted file mode 100644
index 1e21bdf..0000000
--- a/libc/arch-arm64/syscalls/getppid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getppid)
-    mov     x8, __NR_getppid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getppid)
diff --git a/libc/arch-arm64/syscalls/getrandom.S b/libc/arch-arm64/syscalls/getrandom.S
deleted file mode 100644
index c8fe41f..0000000
--- a/libc/arch-arm64/syscalls/getrandom.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrandom)
-    mov     x8, __NR_getrandom
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getrandom)
diff --git a/libc/arch-arm64/syscalls/getresgid.S b/libc/arch-arm64/syscalls/getresgid.S
deleted file mode 100644
index b15357a..0000000
--- a/libc/arch-arm64/syscalls/getresgid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresgid)
-    mov     x8, __NR_getresgid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getresgid)
diff --git a/libc/arch-arm64/syscalls/getresuid.S b/libc/arch-arm64/syscalls/getresuid.S
deleted file mode 100644
index 53de6b7..0000000
--- a/libc/arch-arm64/syscalls/getresuid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresuid)
-    mov     x8, __NR_getresuid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getresuid)
diff --git a/libc/arch-arm64/syscalls/getrlimit.S b/libc/arch-arm64/syscalls/getrlimit.S
deleted file mode 100644
index 03ee9a8..0000000
--- a/libc/arch-arm64/syscalls/getrlimit.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrlimit)
-    mov     x8, __NR_getrlimit
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getrlimit)
-
-ALIAS_SYMBOL(getrlimit64, getrlimit)
diff --git a/libc/arch-arm64/syscalls/getrusage.S b/libc/arch-arm64/syscalls/getrusage.S
deleted file mode 100644
index 676221a..0000000
--- a/libc/arch-arm64/syscalls/getrusage.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrusage)
-    mov     x8, __NR_getrusage
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getrusage)
diff --git a/libc/arch-arm64/syscalls/getsid.S b/libc/arch-arm64/syscalls/getsid.S
deleted file mode 100644
index cfbdfdb..0000000
--- a/libc/arch-arm64/syscalls/getsid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsid)
-    mov     x8, __NR_getsid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getsid)
diff --git a/libc/arch-arm64/syscalls/getsockname.S b/libc/arch-arm64/syscalls/getsockname.S
deleted file mode 100644
index 4cca55d..0000000
--- a/libc/arch-arm64/syscalls/getsockname.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockname)
-    mov     x8, __NR_getsockname
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getsockname)
diff --git a/libc/arch-arm64/syscalls/getsockopt.S b/libc/arch-arm64/syscalls/getsockopt.S
deleted file mode 100644
index 96b8c0f..0000000
--- a/libc/arch-arm64/syscalls/getsockopt.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockopt)
-    mov     x8, __NR_getsockopt
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getsockopt)
diff --git a/libc/arch-arm64/syscalls/getuid.S b/libc/arch-arm64/syscalls/getuid.S
deleted file mode 100644
index ef95ba7..0000000
--- a/libc/arch-arm64/syscalls/getuid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getuid)
-    mov     x8, __NR_getuid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getuid)
diff --git a/libc/arch-arm64/syscalls/getxattr.S b/libc/arch-arm64/syscalls/getxattr.S
deleted file mode 100644
index 2b38f3d..0000000
--- a/libc/arch-arm64/syscalls/getxattr.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getxattr)
-    mov     x8, __NR_getxattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(getxattr)
diff --git a/libc/arch-arm64/syscalls/init_module.S b/libc/arch-arm64/syscalls/init_module.S
deleted file mode 100644
index 913c7cc..0000000
--- a/libc/arch-arm64/syscalls/init_module.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(init_module)
-    mov     x8, __NR_init_module
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(init_module)
diff --git a/libc/arch-arm64/syscalls/inotify_add_watch.S b/libc/arch-arm64/syscalls/inotify_add_watch.S
deleted file mode 100644
index 83a5b57..0000000
--- a/libc/arch-arm64/syscalls/inotify_add_watch.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_add_watch)
-    mov     x8, __NR_inotify_add_watch
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(inotify_add_watch)
diff --git a/libc/arch-arm64/syscalls/inotify_init1.S b/libc/arch-arm64/syscalls/inotify_init1.S
deleted file mode 100644
index d3bc81b..0000000
--- a/libc/arch-arm64/syscalls/inotify_init1.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_init1)
-    mov     x8, __NR_inotify_init1
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(inotify_init1)
diff --git a/libc/arch-arm64/syscalls/inotify_rm_watch.S b/libc/arch-arm64/syscalls/inotify_rm_watch.S
deleted file mode 100644
index c44445f..0000000
--- a/libc/arch-arm64/syscalls/inotify_rm_watch.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_rm_watch)
-    mov     x8, __NR_inotify_rm_watch
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(inotify_rm_watch)
diff --git a/libc/arch-arm64/syscalls/kill.S b/libc/arch-arm64/syscalls/kill.S
deleted file mode 100644
index 0334ff0..0000000
--- a/libc/arch-arm64/syscalls/kill.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(kill)
-    mov     x8, __NR_kill
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(kill)
diff --git a/libc/arch-arm64/syscalls/klogctl.S b/libc/arch-arm64/syscalls/klogctl.S
deleted file mode 100644
index 625f359..0000000
--- a/libc/arch-arm64/syscalls/klogctl.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(klogctl)
-    mov     x8, __NR_syslog
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(klogctl)
diff --git a/libc/arch-arm64/syscalls/lgetxattr.S b/libc/arch-arm64/syscalls/lgetxattr.S
deleted file mode 100644
index 89db206..0000000
--- a/libc/arch-arm64/syscalls/lgetxattr.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lgetxattr)
-    mov     x8, __NR_lgetxattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(lgetxattr)
diff --git a/libc/arch-arm64/syscalls/linkat.S b/libc/arch-arm64/syscalls/linkat.S
deleted file mode 100644
index 62aea3a..0000000
--- a/libc/arch-arm64/syscalls/linkat.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(linkat)
-    mov     x8, __NR_linkat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(linkat)
diff --git a/libc/arch-arm64/syscalls/listen.S b/libc/arch-arm64/syscalls/listen.S
deleted file mode 100644
index ba97be9..0000000
--- a/libc/arch-arm64/syscalls/listen.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listen)
-    mov     x8, __NR_listen
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(listen)
diff --git a/libc/arch-arm64/syscalls/listxattr.S b/libc/arch-arm64/syscalls/listxattr.S
deleted file mode 100644
index 48208e6..0000000
--- a/libc/arch-arm64/syscalls/listxattr.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listxattr)
-    mov     x8, __NR_listxattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(listxattr)
diff --git a/libc/arch-arm64/syscalls/llistxattr.S b/libc/arch-arm64/syscalls/llistxattr.S
deleted file mode 100644
index ed66005..0000000
--- a/libc/arch-arm64/syscalls/llistxattr.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(llistxattr)
-    mov     x8, __NR_llistxattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(llistxattr)
diff --git a/libc/arch-arm64/syscalls/lremovexattr.S b/libc/arch-arm64/syscalls/lremovexattr.S
deleted file mode 100644
index b5e51c7..0000000
--- a/libc/arch-arm64/syscalls/lremovexattr.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lremovexattr)
-    mov     x8, __NR_lremovexattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(lremovexattr)
diff --git a/libc/arch-arm64/syscalls/lseek.S b/libc/arch-arm64/syscalls/lseek.S
deleted file mode 100644
index 93afeb7..0000000
--- a/libc/arch-arm64/syscalls/lseek.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lseek)
-    mov     x8, __NR_lseek
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(lseek)
-
-ALIAS_SYMBOL(lseek64, lseek)
diff --git a/libc/arch-arm64/syscalls/lsetxattr.S b/libc/arch-arm64/syscalls/lsetxattr.S
deleted file mode 100644
index b873513..0000000
--- a/libc/arch-arm64/syscalls/lsetxattr.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lsetxattr)
-    mov     x8, __NR_lsetxattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(lsetxattr)
diff --git a/libc/arch-arm64/syscalls/madvise.S b/libc/arch-arm64/syscalls/madvise.S
deleted file mode 100644
index 6fced41..0000000
--- a/libc/arch-arm64/syscalls/madvise.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(madvise)
-    mov     x8, __NR_madvise
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(madvise)
diff --git a/libc/arch-arm64/syscalls/mincore.S b/libc/arch-arm64/syscalls/mincore.S
deleted file mode 100644
index 5781b4c..0000000
--- a/libc/arch-arm64/syscalls/mincore.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mincore)
-    mov     x8, __NR_mincore
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(mincore)
diff --git a/libc/arch-arm64/syscalls/mkdirat.S b/libc/arch-arm64/syscalls/mkdirat.S
deleted file mode 100644
index fa868a2..0000000
--- a/libc/arch-arm64/syscalls/mkdirat.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mkdirat)
-    mov     x8, __NR_mkdirat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(mkdirat)
diff --git a/libc/arch-arm64/syscalls/mknodat.S b/libc/arch-arm64/syscalls/mknodat.S
deleted file mode 100644
index 13632ec..0000000
--- a/libc/arch-arm64/syscalls/mknodat.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mknodat)
-    mov     x8, __NR_mknodat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(mknodat)
diff --git a/libc/arch-arm64/syscalls/mlock.S b/libc/arch-arm64/syscalls/mlock.S
deleted file mode 100644
index 1eee85c..0000000
--- a/libc/arch-arm64/syscalls/mlock.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlock)
-    mov     x8, __NR_mlock
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(mlock)
diff --git a/libc/arch-arm64/syscalls/mlockall.S b/libc/arch-arm64/syscalls/mlockall.S
deleted file mode 100644
index d4ca185..0000000
--- a/libc/arch-arm64/syscalls/mlockall.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlockall)
-    mov     x8, __NR_mlockall
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(mlockall)
diff --git a/libc/arch-arm64/syscalls/mmap.S b/libc/arch-arm64/syscalls/mmap.S
deleted file mode 100644
index 65371bc..0000000
--- a/libc/arch-arm64/syscalls/mmap.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mmap)
-    mov     x8, __NR_mmap
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(mmap)
-
-ALIAS_SYMBOL(mmap64, mmap)
diff --git a/libc/arch-arm64/syscalls/mount.S b/libc/arch-arm64/syscalls/mount.S
deleted file mode 100644
index cd35017..0000000
--- a/libc/arch-arm64/syscalls/mount.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mount)
-    mov     x8, __NR_mount
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(mount)
diff --git a/libc/arch-arm64/syscalls/mprotect.S b/libc/arch-arm64/syscalls/mprotect.S
deleted file mode 100644
index 9dd8812..0000000
--- a/libc/arch-arm64/syscalls/mprotect.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mprotect)
-    mov     x8, __NR_mprotect
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(mprotect)
diff --git a/libc/arch-arm64/syscalls/msync.S b/libc/arch-arm64/syscalls/msync.S
deleted file mode 100644
index 72387ea..0000000
--- a/libc/arch-arm64/syscalls/msync.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(msync)
-    mov     x8, __NR_msync
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(msync)
diff --git a/libc/arch-arm64/syscalls/munlock.S b/libc/arch-arm64/syscalls/munlock.S
deleted file mode 100644
index d2a248c..0000000
--- a/libc/arch-arm64/syscalls/munlock.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlock)
-    mov     x8, __NR_munlock
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(munlock)
diff --git a/libc/arch-arm64/syscalls/munlockall.S b/libc/arch-arm64/syscalls/munlockall.S
deleted file mode 100644
index ac42cb4..0000000
--- a/libc/arch-arm64/syscalls/munlockall.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlockall)
-    mov     x8, __NR_munlockall
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(munlockall)
diff --git a/libc/arch-arm64/syscalls/munmap.S b/libc/arch-arm64/syscalls/munmap.S
deleted file mode 100644
index 9d3f6a6..0000000
--- a/libc/arch-arm64/syscalls/munmap.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munmap)
-    mov     x8, __NR_munmap
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(munmap)
diff --git a/libc/arch-arm64/syscalls/nanosleep.S b/libc/arch-arm64/syscalls/nanosleep.S
deleted file mode 100644
index d3e6fae..0000000
--- a/libc/arch-arm64/syscalls/nanosleep.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(nanosleep)
-    mov     x8, __NR_nanosleep
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(nanosleep)
diff --git a/libc/arch-arm64/syscalls/personality.S b/libc/arch-arm64/syscalls/personality.S
deleted file mode 100644
index f9f3bf6..0000000
--- a/libc/arch-arm64/syscalls/personality.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(personality)
-    mov     x8, __NR_personality
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(personality)
diff --git a/libc/arch-arm64/syscalls/pipe2.S b/libc/arch-arm64/syscalls/pipe2.S
deleted file mode 100644
index 89181cd..0000000
--- a/libc/arch-arm64/syscalls/pipe2.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pipe2)
-    mov     x8, __NR_pipe2
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(pipe2)
diff --git a/libc/arch-arm64/syscalls/prctl.S b/libc/arch-arm64/syscalls/prctl.S
deleted file mode 100644
index 86f4df5..0000000
--- a/libc/arch-arm64/syscalls/prctl.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prctl)
-    mov     x8, __NR_prctl
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(prctl)
diff --git a/libc/arch-arm64/syscalls/pread64.S b/libc/arch-arm64/syscalls/pread64.S
deleted file mode 100644
index 6c9f0e9..0000000
--- a/libc/arch-arm64/syscalls/pread64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pread64)
-    mov     x8, __NR_pread64
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(pread64)
-
-ALIAS_SYMBOL(pread, pread64)
diff --git a/libc/arch-arm64/syscalls/preadv.S b/libc/arch-arm64/syscalls/preadv.S
deleted file mode 100644
index cb8300d..0000000
--- a/libc/arch-arm64/syscalls/preadv.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(preadv)
-    mov     x8, __NR_preadv
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(preadv)
-
-ALIAS_SYMBOL(preadv64, preadv)
diff --git a/libc/arch-arm64/syscalls/prlimit64.S b/libc/arch-arm64/syscalls/prlimit64.S
deleted file mode 100644
index 9c018ba..0000000
--- a/libc/arch-arm64/syscalls/prlimit64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prlimit64)
-    mov     x8, __NR_prlimit64
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(prlimit64)
-
-ALIAS_SYMBOL(prlimit, prlimit64)
diff --git a/libc/arch-arm64/syscalls/process_vm_readv.S b/libc/arch-arm64/syscalls/process_vm_readv.S
deleted file mode 100644
index 1dd113b..0000000
--- a/libc/arch-arm64/syscalls/process_vm_readv.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_readv)
-    mov     x8, __NR_process_vm_readv
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(process_vm_readv)
diff --git a/libc/arch-arm64/syscalls/process_vm_writev.S b/libc/arch-arm64/syscalls/process_vm_writev.S
deleted file mode 100644
index fb29cf8..0000000
--- a/libc/arch-arm64/syscalls/process_vm_writev.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_writev)
-    mov     x8, __NR_process_vm_writev
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(process_vm_writev)
diff --git a/libc/arch-arm64/syscalls/pwrite64.S b/libc/arch-arm64/syscalls/pwrite64.S
deleted file mode 100644
index 1599c14..0000000
--- a/libc/arch-arm64/syscalls/pwrite64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pwrite64)
-    mov     x8, __NR_pwrite64
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(pwrite64)
-
-ALIAS_SYMBOL(pwrite, pwrite64)
diff --git a/libc/arch-arm64/syscalls/pwritev.S b/libc/arch-arm64/syscalls/pwritev.S
deleted file mode 100644
index 621466a..0000000
--- a/libc/arch-arm64/syscalls/pwritev.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pwritev)
-    mov     x8, __NR_pwritev
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(pwritev)
-
-ALIAS_SYMBOL(pwritev64, pwritev)
diff --git a/libc/arch-arm64/syscalls/quotactl.S b/libc/arch-arm64/syscalls/quotactl.S
deleted file mode 100644
index b67d47e..0000000
--- a/libc/arch-arm64/syscalls/quotactl.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(quotactl)
-    mov     x8, __NR_quotactl
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(quotactl)
diff --git a/libc/arch-arm64/syscalls/read.S b/libc/arch-arm64/syscalls/read.S
deleted file mode 100644
index ddb88c8..0000000
--- a/libc/arch-arm64/syscalls/read.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(read)
-    mov     x8, __NR_read
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(read)
diff --git a/libc/arch-arm64/syscalls/readahead.S b/libc/arch-arm64/syscalls/readahead.S
deleted file mode 100644
index 445abd4..0000000
--- a/libc/arch-arm64/syscalls/readahead.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readahead)
-    mov     x8, __NR_readahead
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(readahead)
diff --git a/libc/arch-arm64/syscalls/readlinkat.S b/libc/arch-arm64/syscalls/readlinkat.S
deleted file mode 100644
index 62cc9e2..0000000
--- a/libc/arch-arm64/syscalls/readlinkat.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readlinkat)
-    mov     x8, __NR_readlinkat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(readlinkat)
diff --git a/libc/arch-arm64/syscalls/readv.S b/libc/arch-arm64/syscalls/readv.S
deleted file mode 100644
index 6e7f151..0000000
--- a/libc/arch-arm64/syscalls/readv.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readv)
-    mov     x8, __NR_readv
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(readv)
diff --git a/libc/arch-arm64/syscalls/recvfrom.S b/libc/arch-arm64/syscalls/recvfrom.S
deleted file mode 100644
index aecf165..0000000
--- a/libc/arch-arm64/syscalls/recvfrom.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvfrom)
-    mov     x8, __NR_recvfrom
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(recvfrom)
diff --git a/libc/arch-arm64/syscalls/recvmmsg.S b/libc/arch-arm64/syscalls/recvmmsg.S
deleted file mode 100644
index b9cae69..0000000
--- a/libc/arch-arm64/syscalls/recvmmsg.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmmsg)
-    mov     x8, __NR_recvmmsg
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(recvmmsg)
diff --git a/libc/arch-arm64/syscalls/recvmsg.S b/libc/arch-arm64/syscalls/recvmsg.S
deleted file mode 100644
index 2dafdc9..0000000
--- a/libc/arch-arm64/syscalls/recvmsg.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmsg)
-    mov     x8, __NR_recvmsg
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(recvmsg)
diff --git a/libc/arch-arm64/syscalls/removexattr.S b/libc/arch-arm64/syscalls/removexattr.S
deleted file mode 100644
index ede36a6..0000000
--- a/libc/arch-arm64/syscalls/removexattr.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(removexattr)
-    mov     x8, __NR_removexattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(removexattr)
diff --git a/libc/arch-arm64/syscalls/renameat.S b/libc/arch-arm64/syscalls/renameat.S
deleted file mode 100644
index 96025df..0000000
--- a/libc/arch-arm64/syscalls/renameat.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(renameat)
-    mov     x8, __NR_renameat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(renameat)
diff --git a/libc/arch-arm64/syscalls/sched_get_priority_max.S b/libc/arch-arm64/syscalls/sched_get_priority_max.S
deleted file mode 100644
index c848889..0000000
--- a/libc/arch-arm64/syscalls/sched_get_priority_max.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_max)
-    mov     x8, __NR_sched_get_priority_max
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sched_get_priority_max)
diff --git a/libc/arch-arm64/syscalls/sched_get_priority_min.S b/libc/arch-arm64/syscalls/sched_get_priority_min.S
deleted file mode 100644
index 74b72a2..0000000
--- a/libc/arch-arm64/syscalls/sched_get_priority_min.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_min)
-    mov     x8, __NR_sched_get_priority_min
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sched_get_priority_min)
diff --git a/libc/arch-arm64/syscalls/sched_getparam.S b/libc/arch-arm64/syscalls/sched_getparam.S
deleted file mode 100644
index 75a32d4..0000000
--- a/libc/arch-arm64/syscalls/sched_getparam.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getparam)
-    mov     x8, __NR_sched_getparam
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sched_getparam)
diff --git a/libc/arch-arm64/syscalls/sched_getscheduler.S b/libc/arch-arm64/syscalls/sched_getscheduler.S
deleted file mode 100644
index e24baf2..0000000
--- a/libc/arch-arm64/syscalls/sched_getscheduler.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getscheduler)
-    mov     x8, __NR_sched_getscheduler
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sched_getscheduler)
diff --git a/libc/arch-arm64/syscalls/sched_rr_get_interval.S b/libc/arch-arm64/syscalls/sched_rr_get_interval.S
deleted file mode 100644
index 2a6936b..0000000
--- a/libc/arch-arm64/syscalls/sched_rr_get_interval.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_rr_get_interval)
-    mov     x8, __NR_sched_rr_get_interval
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sched_rr_get_interval)
diff --git a/libc/arch-arm64/syscalls/sched_setaffinity.S b/libc/arch-arm64/syscalls/sched_setaffinity.S
deleted file mode 100644
index 30b58f6..0000000
--- a/libc/arch-arm64/syscalls/sched_setaffinity.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setaffinity)
-    mov     x8, __NR_sched_setaffinity
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sched_setaffinity)
diff --git a/libc/arch-arm64/syscalls/sched_setparam.S b/libc/arch-arm64/syscalls/sched_setparam.S
deleted file mode 100644
index eaf25ba..0000000
--- a/libc/arch-arm64/syscalls/sched_setparam.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setparam)
-    mov     x8, __NR_sched_setparam
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sched_setparam)
diff --git a/libc/arch-arm64/syscalls/sched_setscheduler.S b/libc/arch-arm64/syscalls/sched_setscheduler.S
deleted file mode 100644
index 31d53c4..0000000
--- a/libc/arch-arm64/syscalls/sched_setscheduler.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setscheduler)
-    mov     x8, __NR_sched_setscheduler
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sched_setscheduler)
diff --git a/libc/arch-arm64/syscalls/sched_yield.S b/libc/arch-arm64/syscalls/sched_yield.S
deleted file mode 100644
index 4cfeeda..0000000
--- a/libc/arch-arm64/syscalls/sched_yield.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_yield)
-    mov     x8, __NR_sched_yield
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sched_yield)
diff --git a/libc/arch-arm64/syscalls/sendfile.S b/libc/arch-arm64/syscalls/sendfile.S
deleted file mode 100644
index 50ac12d..0000000
--- a/libc/arch-arm64/syscalls/sendfile.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendfile)
-    mov     x8, __NR_sendfile
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sendfile)
-
-ALIAS_SYMBOL(sendfile64, sendfile)
diff --git a/libc/arch-arm64/syscalls/sendmmsg.S b/libc/arch-arm64/syscalls/sendmmsg.S
deleted file mode 100644
index e91c246..0000000
--- a/libc/arch-arm64/syscalls/sendmmsg.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmmsg)
-    mov     x8, __NR_sendmmsg
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sendmmsg)
diff --git a/libc/arch-arm64/syscalls/sendmsg.S b/libc/arch-arm64/syscalls/sendmsg.S
deleted file mode 100644
index a343543..0000000
--- a/libc/arch-arm64/syscalls/sendmsg.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmsg)
-    mov     x8, __NR_sendmsg
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sendmsg)
diff --git a/libc/arch-arm64/syscalls/sendto.S b/libc/arch-arm64/syscalls/sendto.S
deleted file mode 100644
index 6a6813e..0000000
--- a/libc/arch-arm64/syscalls/sendto.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendto)
-    mov     x8, __NR_sendto
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sendto)
diff --git a/libc/arch-arm64/syscalls/setdomainname.S b/libc/arch-arm64/syscalls/setdomainname.S
deleted file mode 100644
index 18f8d4b..0000000
--- a/libc/arch-arm64/syscalls/setdomainname.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setdomainname)
-    mov     x8, __NR_setdomainname
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setdomainname)
diff --git a/libc/arch-arm64/syscalls/setfsgid.S b/libc/arch-arm64/syscalls/setfsgid.S
deleted file mode 100644
index 1a45df3..0000000
--- a/libc/arch-arm64/syscalls/setfsgid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsgid)
-    mov     x8, __NR_setfsgid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setfsgid)
diff --git a/libc/arch-arm64/syscalls/setfsuid.S b/libc/arch-arm64/syscalls/setfsuid.S
deleted file mode 100644
index cd4efd7..0000000
--- a/libc/arch-arm64/syscalls/setfsuid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsuid)
-    mov     x8, __NR_setfsuid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setfsuid)
diff --git a/libc/arch-arm64/syscalls/setgid.S b/libc/arch-arm64/syscalls/setgid.S
deleted file mode 100644
index c128fb9..0000000
--- a/libc/arch-arm64/syscalls/setgid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgid)
-    mov     x8, __NR_setgid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setgid)
diff --git a/libc/arch-arm64/syscalls/setgroups.S b/libc/arch-arm64/syscalls/setgroups.S
deleted file mode 100644
index aedabd6..0000000
--- a/libc/arch-arm64/syscalls/setgroups.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgroups)
-    mov     x8, __NR_setgroups
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setgroups)
diff --git a/libc/arch-arm64/syscalls/sethostname.S b/libc/arch-arm64/syscalls/sethostname.S
deleted file mode 100644
index 2dea457..0000000
--- a/libc/arch-arm64/syscalls/sethostname.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sethostname)
-    mov     x8, __NR_sethostname
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sethostname)
diff --git a/libc/arch-arm64/syscalls/setitimer.S b/libc/arch-arm64/syscalls/setitimer.S
deleted file mode 100644
index 7ce8617..0000000
--- a/libc/arch-arm64/syscalls/setitimer.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setitimer)
-    mov     x8, __NR_setitimer
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setitimer)
diff --git a/libc/arch-arm64/syscalls/setns.S b/libc/arch-arm64/syscalls/setns.S
deleted file mode 100644
index 386e8f4..0000000
--- a/libc/arch-arm64/syscalls/setns.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setns)
-    mov     x8, __NR_setns
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setns)
diff --git a/libc/arch-arm64/syscalls/setpgid.S b/libc/arch-arm64/syscalls/setpgid.S
deleted file mode 100644
index 458c88b..0000000
--- a/libc/arch-arm64/syscalls/setpgid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpgid)
-    mov     x8, __NR_setpgid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setpgid)
diff --git a/libc/arch-arm64/syscalls/setpriority.S b/libc/arch-arm64/syscalls/setpriority.S
deleted file mode 100644
index ed58f26..0000000
--- a/libc/arch-arm64/syscalls/setpriority.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpriority)
-    mov     x8, __NR_setpriority
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setpriority)
diff --git a/libc/arch-arm64/syscalls/setregid.S b/libc/arch-arm64/syscalls/setregid.S
deleted file mode 100644
index 30d902d..0000000
--- a/libc/arch-arm64/syscalls/setregid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setregid)
-    mov     x8, __NR_setregid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setregid)
diff --git a/libc/arch-arm64/syscalls/setresgid.S b/libc/arch-arm64/syscalls/setresgid.S
deleted file mode 100644
index f56e6ce..0000000
--- a/libc/arch-arm64/syscalls/setresgid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresgid)
-    mov     x8, __NR_setresgid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setresgid)
diff --git a/libc/arch-arm64/syscalls/setresuid.S b/libc/arch-arm64/syscalls/setresuid.S
deleted file mode 100644
index d5c5cc6..0000000
--- a/libc/arch-arm64/syscalls/setresuid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresuid)
-    mov     x8, __NR_setresuid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setresuid)
diff --git a/libc/arch-arm64/syscalls/setreuid.S b/libc/arch-arm64/syscalls/setreuid.S
deleted file mode 100644
index e76c72e..0000000
--- a/libc/arch-arm64/syscalls/setreuid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setreuid)
-    mov     x8, __NR_setreuid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setreuid)
diff --git a/libc/arch-arm64/syscalls/setrlimit.S b/libc/arch-arm64/syscalls/setrlimit.S
deleted file mode 100644
index 52c75a1..0000000
--- a/libc/arch-arm64/syscalls/setrlimit.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setrlimit)
-    mov     x8, __NR_setrlimit
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setrlimit)
-
-ALIAS_SYMBOL(setrlimit64, setrlimit)
diff --git a/libc/arch-arm64/syscalls/setsid.S b/libc/arch-arm64/syscalls/setsid.S
deleted file mode 100644
index 1bb4cc7..0000000
--- a/libc/arch-arm64/syscalls/setsid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsid)
-    mov     x8, __NR_setsid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setsid)
diff --git a/libc/arch-arm64/syscalls/setsockopt.S b/libc/arch-arm64/syscalls/setsockopt.S
deleted file mode 100644
index 14b0136..0000000
--- a/libc/arch-arm64/syscalls/setsockopt.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsockopt)
-    mov     x8, __NR_setsockopt
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setsockopt)
diff --git a/libc/arch-arm64/syscalls/settimeofday.S b/libc/arch-arm64/syscalls/settimeofday.S
deleted file mode 100644
index 4f0a078..0000000
--- a/libc/arch-arm64/syscalls/settimeofday.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(settimeofday)
-    mov     x8, __NR_settimeofday
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(settimeofday)
diff --git a/libc/arch-arm64/syscalls/setuid.S b/libc/arch-arm64/syscalls/setuid.S
deleted file mode 100644
index 5500dd6..0000000
--- a/libc/arch-arm64/syscalls/setuid.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setuid)
-    mov     x8, __NR_setuid
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setuid)
diff --git a/libc/arch-arm64/syscalls/setxattr.S b/libc/arch-arm64/syscalls/setxattr.S
deleted file mode 100644
index 5ba9e3c..0000000
--- a/libc/arch-arm64/syscalls/setxattr.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setxattr)
-    mov     x8, __NR_setxattr
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(setxattr)
diff --git a/libc/arch-arm64/syscalls/shutdown.S b/libc/arch-arm64/syscalls/shutdown.S
deleted file mode 100644
index ab067fa..0000000
--- a/libc/arch-arm64/syscalls/shutdown.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(shutdown)
-    mov     x8, __NR_shutdown
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(shutdown)
diff --git a/libc/arch-arm64/syscalls/sigaltstack.S b/libc/arch-arm64/syscalls/sigaltstack.S
deleted file mode 100644
index a9cbcaf..0000000
--- a/libc/arch-arm64/syscalls/sigaltstack.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sigaltstack)
-    mov     x8, __NR_sigaltstack
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sigaltstack)
diff --git a/libc/arch-arm64/syscalls/socketpair.S b/libc/arch-arm64/syscalls/socketpair.S
deleted file mode 100644
index bd70dac..0000000
--- a/libc/arch-arm64/syscalls/socketpair.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(socketpair)
-    mov     x8, __NR_socketpair
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(socketpair)
diff --git a/libc/arch-arm64/syscalls/splice.S b/libc/arch-arm64/syscalls/splice.S
deleted file mode 100644
index a5450d9..0000000
--- a/libc/arch-arm64/syscalls/splice.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(splice)
-    mov     x8, __NR_splice
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(splice)
diff --git a/libc/arch-arm64/syscalls/swapoff.S b/libc/arch-arm64/syscalls/swapoff.S
deleted file mode 100644
index 0103bd7..0000000
--- a/libc/arch-arm64/syscalls/swapoff.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapoff)
-    mov     x8, __NR_swapoff
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(swapoff)
diff --git a/libc/arch-arm64/syscalls/swapon.S b/libc/arch-arm64/syscalls/swapon.S
deleted file mode 100644
index 560c960..0000000
--- a/libc/arch-arm64/syscalls/swapon.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapon)
-    mov     x8, __NR_swapon
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(swapon)
diff --git a/libc/arch-arm64/syscalls/symlinkat.S b/libc/arch-arm64/syscalls/symlinkat.S
deleted file mode 100644
index 4a4ea27..0000000
--- a/libc/arch-arm64/syscalls/symlinkat.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(symlinkat)
-    mov     x8, __NR_symlinkat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(symlinkat)
diff --git a/libc/arch-arm64/syscalls/sync.S b/libc/arch-arm64/syscalls/sync.S
deleted file mode 100644
index d285d43..0000000
--- a/libc/arch-arm64/syscalls/sync.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sync)
-    mov     x8, __NR_sync
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sync)
diff --git a/libc/arch-arm64/syscalls/syncfs.S b/libc/arch-arm64/syscalls/syncfs.S
deleted file mode 100644
index 773c0cb..0000000
--- a/libc/arch-arm64/syscalls/syncfs.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(syncfs)
-    mov     x8, __NR_syncfs
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(syncfs)
diff --git a/libc/arch-arm64/syscalls/sysinfo.S b/libc/arch-arm64/syscalls/sysinfo.S
deleted file mode 100644
index 80a8641..0000000
--- a/libc/arch-arm64/syscalls/sysinfo.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sysinfo)
-    mov     x8, __NR_sysinfo
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(sysinfo)
diff --git a/libc/arch-arm64/syscalls/tee.S b/libc/arch-arm64/syscalls/tee.S
deleted file mode 100644
index d7baa26..0000000
--- a/libc/arch-arm64/syscalls/tee.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tee)
-    mov     x8, __NR_tee
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(tee)
diff --git a/libc/arch-arm64/syscalls/tgkill.S b/libc/arch-arm64/syscalls/tgkill.S
deleted file mode 100644
index fd9ec3b..0000000
--- a/libc/arch-arm64/syscalls/tgkill.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tgkill)
-    mov     x8, __NR_tgkill
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(tgkill)
diff --git a/libc/arch-arm64/syscalls/timerfd_create.S b/libc/arch-arm64/syscalls/timerfd_create.S
deleted file mode 100644
index ee805fd..0000000
--- a/libc/arch-arm64/syscalls/timerfd_create.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_create)
-    mov     x8, __NR_timerfd_create
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(timerfd_create)
diff --git a/libc/arch-arm64/syscalls/timerfd_gettime.S b/libc/arch-arm64/syscalls/timerfd_gettime.S
deleted file mode 100644
index 4d5e2f9..0000000
--- a/libc/arch-arm64/syscalls/timerfd_gettime.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_gettime)
-    mov     x8, __NR_timerfd_gettime
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(timerfd_gettime)
diff --git a/libc/arch-arm64/syscalls/timerfd_settime.S b/libc/arch-arm64/syscalls/timerfd_settime.S
deleted file mode 100644
index e925a0c..0000000
--- a/libc/arch-arm64/syscalls/timerfd_settime.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_settime)
-    mov     x8, __NR_timerfd_settime
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(timerfd_settime)
diff --git a/libc/arch-arm64/syscalls/times.S b/libc/arch-arm64/syscalls/times.S
deleted file mode 100644
index d7b9c74..0000000
--- a/libc/arch-arm64/syscalls/times.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(times)
-    mov     x8, __NR_times
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(times)
diff --git a/libc/arch-arm64/syscalls/truncate.S b/libc/arch-arm64/syscalls/truncate.S
deleted file mode 100644
index e01cc7d..0000000
--- a/libc/arch-arm64/syscalls/truncate.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(truncate)
-    mov     x8, __NR_truncate
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(truncate)
-
-ALIAS_SYMBOL(truncate64, truncate)
diff --git a/libc/arch-arm64/syscalls/umask.S b/libc/arch-arm64/syscalls/umask.S
deleted file mode 100644
index 0d71fa6..0000000
--- a/libc/arch-arm64/syscalls/umask.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umask)
-    mov     x8, __NR_umask
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(umask)
diff --git a/libc/arch-arm64/syscalls/umount2.S b/libc/arch-arm64/syscalls/umount2.S
deleted file mode 100644
index c25344e..0000000
--- a/libc/arch-arm64/syscalls/umount2.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umount2)
-    mov     x8, __NR_umount2
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(umount2)
diff --git a/libc/arch-arm64/syscalls/uname.S b/libc/arch-arm64/syscalls/uname.S
deleted file mode 100644
index dfdcc03..0000000
--- a/libc/arch-arm64/syscalls/uname.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(uname)
-    mov     x8, __NR_uname
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(uname)
diff --git a/libc/arch-arm64/syscalls/unlinkat.S b/libc/arch-arm64/syscalls/unlinkat.S
deleted file mode 100644
index b1eba63..0000000
--- a/libc/arch-arm64/syscalls/unlinkat.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unlinkat)
-    mov     x8, __NR_unlinkat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(unlinkat)
diff --git a/libc/arch-arm64/syscalls/unshare.S b/libc/arch-arm64/syscalls/unshare.S
deleted file mode 100644
index 74f5663..0000000
--- a/libc/arch-arm64/syscalls/unshare.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unshare)
-    mov     x8, __NR_unshare
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(unshare)
diff --git a/libc/arch-arm64/syscalls/utimensat.S b/libc/arch-arm64/syscalls/utimensat.S
deleted file mode 100644
index b8c6b04..0000000
--- a/libc/arch-arm64/syscalls/utimensat.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(utimensat)
-    mov     x8, __NR_utimensat
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(utimensat)
diff --git a/libc/arch-arm64/syscalls/vmsplice.S b/libc/arch-arm64/syscalls/vmsplice.S
deleted file mode 100644
index 9490efb..0000000
--- a/libc/arch-arm64/syscalls/vmsplice.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(vmsplice)
-    mov     x8, __NR_vmsplice
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(vmsplice)
diff --git a/libc/arch-arm64/syscalls/wait4.S b/libc/arch-arm64/syscalls/wait4.S
deleted file mode 100644
index 12973b8..0000000
--- a/libc/arch-arm64/syscalls/wait4.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(wait4)
-    mov     x8, __NR_wait4
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(wait4)
diff --git a/libc/arch-arm64/syscalls/write.S b/libc/arch-arm64/syscalls/write.S
deleted file mode 100644
index e8c3270..0000000
--- a/libc/arch-arm64/syscalls/write.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(write)
-    mov     x8, __NR_write
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(write)
diff --git a/libc/arch-arm64/syscalls/writev.S b/libc/arch-arm64/syscalls/writev.S
deleted file mode 100644
index baaffda..0000000
--- a/libc/arch-arm64/syscalls/writev.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(writev)
-    mov     x8, __NR_writev
-    svc     #0
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno_internal
-
-    ret
-END(writev)
diff --git a/libc/arch-mips/bionic/libcrt_compat.c b/libc/arch-mips/bionic/libcrt_compat.c
new file mode 100644
index 0000000..cfa41f2
--- /dev/null
+++ b/libc/arch-mips/bionic/libcrt_compat.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+extern char __divdi3;
+extern char __moddi3;
+extern char __popcountsi2;
+extern char __udivdi3;
+extern char __umoddi3;
+
+void* __bionic_libcrt_compat_symbols[] = {
+    &__divdi3,
+    &__moddi3,
+    &__popcountsi2,
+    &__udivdi3,
+    &__umoddi3,
+};
diff --git a/libc/arch-mips/bionic/libgcc_compat.c b/libc/arch-mips/bionic/libgcc_compat.c
deleted file mode 100644
index 1a0f566..0000000
--- a/libc/arch-mips/bionic/libgcc_compat.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-extern char __divdi3;
-extern char __moddi3;
-extern char __popcountsi2;
-extern char __udivdi3;
-extern char __umoddi3;
-
-void* __bionic_libgcc_compat_symbols[] = {
-    &__divdi3,
-    &__moddi3,
-    &__popcountsi2,
-    &__udivdi3,
-    &__umoddi3,
-};
diff --git a/libc/arch-mips/syscalls/___clock_nanosleep.S b/libc/arch-mips/syscalls/___clock_nanosleep.S
deleted file mode 100644
index 55a77d4..0000000
--- a/libc/arch-mips/syscalls/___clock_nanosleep.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___clock_nanosleep)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_clock_nanosleep
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(___clock_nanosleep)
-.hidden ___clock_nanosleep
diff --git a/libc/arch-mips/syscalls/___close.S b/libc/arch-mips/syscalls/___close.S
deleted file mode 100644
index 592766a..0000000
--- a/libc/arch-mips/syscalls/___close.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___close)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_close
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(___close)
-.hidden ___close
diff --git a/libc/arch-mips/syscalls/___faccessat.S b/libc/arch-mips/syscalls/___faccessat.S
deleted file mode 100644
index 9222c6f..0000000
--- a/libc/arch-mips/syscalls/___faccessat.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___faccessat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_faccessat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(___faccessat)
-.hidden ___faccessat
diff --git a/libc/arch-mips/syscalls/___fchmod.S b/libc/arch-mips/syscalls/___fchmod.S
deleted file mode 100644
index 680c368..0000000
--- a/libc/arch-mips/syscalls/___fchmod.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmod)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fchmod
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(___fchmod)
-.hidden ___fchmod
diff --git a/libc/arch-mips/syscalls/___fchmodat.S b/libc/arch-mips/syscalls/___fchmodat.S
deleted file mode 100644
index 0c8a6bb..0000000
--- a/libc/arch-mips/syscalls/___fchmodat.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmodat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fchmodat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(___fchmodat)
-.hidden ___fchmodat
diff --git a/libc/arch-mips/syscalls/___fgetxattr.S b/libc/arch-mips/syscalls/___fgetxattr.S
deleted file mode 100644
index a1cc13b..0000000
--- a/libc/arch-mips/syscalls/___fgetxattr.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fgetxattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fgetxattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(___fgetxattr)
-.hidden ___fgetxattr
diff --git a/libc/arch-mips/syscalls/___flistxattr.S b/libc/arch-mips/syscalls/___flistxattr.S
deleted file mode 100644
index 77856fd..0000000
--- a/libc/arch-mips/syscalls/___flistxattr.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___flistxattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_flistxattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(___flistxattr)
-.hidden ___flistxattr
diff --git a/libc/arch-mips/syscalls/___fsetxattr.S b/libc/arch-mips/syscalls/___fsetxattr.S
deleted file mode 100644
index 9c6a419..0000000
--- a/libc/arch-mips/syscalls/___fsetxattr.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fsetxattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fsetxattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(___fsetxattr)
-.hidden ___fsetxattr
diff --git a/libc/arch-mips/syscalls/___mremap.S b/libc/arch-mips/syscalls/___mremap.S
deleted file mode 100644
index 768b958..0000000
--- a/libc/arch-mips/syscalls/___mremap.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___mremap)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_mremap
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(___mremap)
-.hidden ___mremap
diff --git a/libc/arch-mips/syscalls/___rt_sigqueueinfo.S b/libc/arch-mips/syscalls/___rt_sigqueueinfo.S
deleted file mode 100644
index dde3782..0000000
--- a/libc/arch-mips/syscalls/___rt_sigqueueinfo.S
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___rt_sigqueueinfo)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_rt_sigqueueinfo
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(___rt_sigqueueinfo)
-.hidden ___rt_sigqueueinfo
diff --git a/libc/arch-mips/syscalls/__accept4.S b/libc/arch-mips/syscalls/__accept4.S
deleted file mode 100644
index 596660c..0000000
--- a/libc/arch-mips/syscalls/__accept4.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__accept4)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_accept4
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__accept4)
diff --git a/libc/arch-mips/syscalls/__brk.S b/libc/arch-mips/syscalls/__brk.S
deleted file mode 100644
index ea0f2c3..0000000
--- a/libc/arch-mips/syscalls/__brk.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__brk)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_brk
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__brk)
diff --git a/libc/arch-mips/syscalls/__clock_getres.S b/libc/arch-mips/syscalls/__clock_getres.S
deleted file mode 100644
index d4e67c5..0000000
--- a/libc/arch-mips/syscalls/__clock_getres.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_getres)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_clock_getres
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__clock_getres)
diff --git a/libc/arch-mips/syscalls/__clock_gettime.S b/libc/arch-mips/syscalls/__clock_gettime.S
deleted file mode 100644
index a68990b..0000000
--- a/libc/arch-mips/syscalls/__clock_gettime.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_gettime)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_clock_gettime
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__clock_gettime)
diff --git a/libc/arch-mips/syscalls/__connect.S b/libc/arch-mips/syscalls/__connect.S
deleted file mode 100644
index 9a87105..0000000
--- a/libc/arch-mips/syscalls/__connect.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__connect)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_connect
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__connect)
diff --git a/libc/arch-mips/syscalls/__epoll_pwait.S b/libc/arch-mips/syscalls/__epoll_pwait.S
deleted file mode 100644
index 68f9d1f..0000000
--- a/libc/arch-mips/syscalls/__epoll_pwait.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__epoll_pwait)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_epoll_pwait
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__epoll_pwait)
diff --git a/libc/arch-mips/syscalls/__exit.S b/libc/arch-mips/syscalls/__exit.S
deleted file mode 100644
index d4d1ab8..0000000
--- a/libc/arch-mips/syscalls/__exit.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__exit)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_exit
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__exit)
diff --git a/libc/arch-mips/syscalls/__fadvise64.S b/libc/arch-mips/syscalls/__fadvise64.S
deleted file mode 100644
index be0694e..0000000
--- a/libc/arch-mips/syscalls/__fadvise64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fadvise64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fadvise64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__fadvise64)
diff --git a/libc/arch-mips/syscalls/__fcntl64.S b/libc/arch-mips/syscalls/__fcntl64.S
deleted file mode 100644
index d6e54e4..0000000
--- a/libc/arch-mips/syscalls/__fcntl64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fcntl64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fcntl64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__fcntl64)
diff --git a/libc/arch-mips/syscalls/__fstatfs64.S b/libc/arch-mips/syscalls/__fstatfs64.S
deleted file mode 100644
index 8dc2ed3..0000000
--- a/libc/arch-mips/syscalls/__fstatfs64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fstatfs64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fstatfs64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__fstatfs64)
diff --git a/libc/arch-mips/syscalls/__getcpu.S b/libc/arch-mips/syscalls/__getcpu.S
deleted file mode 100644
index b159f2c..0000000
--- a/libc/arch-mips/syscalls/__getcpu.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcpu)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getcpu
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__getcpu)
diff --git a/libc/arch-mips/syscalls/__getcwd.S b/libc/arch-mips/syscalls/__getcwd.S
deleted file mode 100644
index 6482244..0000000
--- a/libc/arch-mips/syscalls/__getcwd.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcwd)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getcwd
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__getcwd)
diff --git a/libc/arch-mips/syscalls/__getdents64.S b/libc/arch-mips/syscalls/__getdents64.S
deleted file mode 100644
index 8324a80..0000000
--- a/libc/arch-mips/syscalls/__getdents64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getdents64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getdents64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__getdents64)
diff --git a/libc/arch-mips/syscalls/__getpid.S b/libc/arch-mips/syscalls/__getpid.S
deleted file mode 100644
index 9f122e0..0000000
--- a/libc/arch-mips/syscalls/__getpid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getpid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__getpid)
diff --git a/libc/arch-mips/syscalls/__getpriority.S b/libc/arch-mips/syscalls/__getpriority.S
deleted file mode 100644
index 22aa7c1..0000000
--- a/libc/arch-mips/syscalls/__getpriority.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpriority)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getpriority
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__getpriority)
diff --git a/libc/arch-mips/syscalls/__gettimeofday.S b/libc/arch-mips/syscalls/__gettimeofday.S
deleted file mode 100644
index 021ca7f..0000000
--- a/libc/arch-mips/syscalls/__gettimeofday.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__gettimeofday)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_gettimeofday
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__gettimeofday)
diff --git a/libc/arch-mips/syscalls/__ioctl.S b/libc/arch-mips/syscalls/__ioctl.S
deleted file mode 100644
index fb45f5d..0000000
--- a/libc/arch-mips/syscalls/__ioctl.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ioctl)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_ioctl
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__ioctl)
diff --git a/libc/arch-mips/syscalls/__llseek.S b/libc/arch-mips/syscalls/__llseek.S
deleted file mode 100644
index d622d92..0000000
--- a/libc/arch-mips/syscalls/__llseek.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__llseek)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR__llseek
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__llseek)
diff --git a/libc/arch-mips/syscalls/__mmap2.S b/libc/arch-mips/syscalls/__mmap2.S
deleted file mode 100644
index 435fc77..0000000
--- a/libc/arch-mips/syscalls/__mmap2.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__mmap2)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_mmap2
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__mmap2)
diff --git a/libc/arch-mips/syscalls/__openat.S b/libc/arch-mips/syscalls/__openat.S
deleted file mode 100644
index a30c4a8..0000000
--- a/libc/arch-mips/syscalls/__openat.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__openat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_openat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__openat)
diff --git a/libc/arch-mips/syscalls/__ppoll.S b/libc/arch-mips/syscalls/__ppoll.S
deleted file mode 100644
index e2f4363..0000000
--- a/libc/arch-mips/syscalls/__ppoll.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ppoll)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_ppoll
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__ppoll)
diff --git a/libc/arch-mips/syscalls/__preadv64.S b/libc/arch-mips/syscalls/__preadv64.S
deleted file mode 100644
index 3bc732a..0000000
--- a/libc/arch-mips/syscalls/__preadv64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__preadv64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_preadv
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__preadv64)
diff --git a/libc/arch-mips/syscalls/__pselect6.S b/libc/arch-mips/syscalls/__pselect6.S
deleted file mode 100644
index 34c7df1..0000000
--- a/libc/arch-mips/syscalls/__pselect6.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__pselect6)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_pselect6
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__pselect6)
diff --git a/libc/arch-mips/syscalls/__ptrace.S b/libc/arch-mips/syscalls/__ptrace.S
deleted file mode 100644
index f3879ea..0000000
--- a/libc/arch-mips/syscalls/__ptrace.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ptrace)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_ptrace
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__ptrace)
diff --git a/libc/arch-mips/syscalls/__pwritev64.S b/libc/arch-mips/syscalls/__pwritev64.S
deleted file mode 100644
index 569a0d4..0000000
--- a/libc/arch-mips/syscalls/__pwritev64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__pwritev64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_pwritev
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__pwritev64)
diff --git a/libc/arch-mips/syscalls/__reboot.S b/libc/arch-mips/syscalls/__reboot.S
deleted file mode 100644
index c77d09b..0000000
--- a/libc/arch-mips/syscalls/__reboot.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__reboot)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_reboot
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__reboot)
diff --git a/libc/arch-mips/syscalls/__rt_sigaction.S b/libc/arch-mips/syscalls/__rt_sigaction.S
deleted file mode 100644
index ae18296..0000000
--- a/libc/arch-mips/syscalls/__rt_sigaction.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigaction)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_rt_sigaction
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__rt_sigaction)
diff --git a/libc/arch-mips/syscalls/__rt_sigpending.S b/libc/arch-mips/syscalls/__rt_sigpending.S
deleted file mode 100644
index b3597c8..0000000
--- a/libc/arch-mips/syscalls/__rt_sigpending.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigpending)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_rt_sigpending
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__rt_sigpending)
diff --git a/libc/arch-mips/syscalls/__rt_sigprocmask.S b/libc/arch-mips/syscalls/__rt_sigprocmask.S
deleted file mode 100644
index ca165c3..0000000
--- a/libc/arch-mips/syscalls/__rt_sigprocmask.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigprocmask)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_rt_sigprocmask
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__rt_sigprocmask)
diff --git a/libc/arch-mips/syscalls/__rt_sigsuspend.S b/libc/arch-mips/syscalls/__rt_sigsuspend.S
deleted file mode 100644
index afd6837..0000000
--- a/libc/arch-mips/syscalls/__rt_sigsuspend.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigsuspend)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_rt_sigsuspend
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__rt_sigsuspend)
diff --git a/libc/arch-mips/syscalls/__rt_sigtimedwait.S b/libc/arch-mips/syscalls/__rt_sigtimedwait.S
deleted file mode 100644
index c9d6d3c..0000000
--- a/libc/arch-mips/syscalls/__rt_sigtimedwait.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigtimedwait)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_rt_sigtimedwait
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__rt_sigtimedwait)
diff --git a/libc/arch-mips/syscalls/__sched_getaffinity.S b/libc/arch-mips/syscalls/__sched_getaffinity.S
deleted file mode 100644
index 94ea2a4..0000000
--- a/libc/arch-mips/syscalls/__sched_getaffinity.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sched_getaffinity)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sched_getaffinity
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__sched_getaffinity)
diff --git a/libc/arch-mips/syscalls/__set_tid_address.S b/libc/arch-mips/syscalls/__set_tid_address.S
deleted file mode 100644
index 4a28783..0000000
--- a/libc/arch-mips/syscalls/__set_tid_address.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__set_tid_address)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_set_tid_address
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__set_tid_address)
diff --git a/libc/arch-mips/syscalls/__set_tls.S b/libc/arch-mips/syscalls/__set_tls.S
deleted file mode 100644
index 00825b3..0000000
--- a/libc/arch-mips/syscalls/__set_tls.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__set_tls)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_set_thread_area
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__set_tls)
diff --git a/libc/arch-mips/syscalls/__sigaction.S b/libc/arch-mips/syscalls/__sigaction.S
deleted file mode 100644
index ef91e1d..0000000
--- a/libc/arch-mips/syscalls/__sigaction.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sigaction)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sigaction
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__sigaction)
diff --git a/libc/arch-mips/syscalls/__signalfd4.S b/libc/arch-mips/syscalls/__signalfd4.S
deleted file mode 100644
index 754ad37..0000000
--- a/libc/arch-mips/syscalls/__signalfd4.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__signalfd4)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_signalfd4
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__signalfd4)
diff --git a/libc/arch-mips/syscalls/__socket.S b/libc/arch-mips/syscalls/__socket.S
deleted file mode 100644
index 5d59e03..0000000
--- a/libc/arch-mips/syscalls/__socket.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__socket)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_socket
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__socket)
diff --git a/libc/arch-mips/syscalls/__statfs64.S b/libc/arch-mips/syscalls/__statfs64.S
deleted file mode 100644
index 8ebe9f3..0000000
--- a/libc/arch-mips/syscalls/__statfs64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__statfs64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_statfs64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__statfs64)
diff --git a/libc/arch-mips/syscalls/__sync_file_range.S b/libc/arch-mips/syscalls/__sync_file_range.S
deleted file mode 100644
index ffd9c09..0000000
--- a/libc/arch-mips/syscalls/__sync_file_range.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sync_file_range)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sync_file_range
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__sync_file_range)
diff --git a/libc/arch-mips/syscalls/__timer_create.S b/libc/arch-mips/syscalls/__timer_create.S
deleted file mode 100644
index fc1b9a5..0000000
--- a/libc/arch-mips/syscalls/__timer_create.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_create)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_timer_create
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__timer_create)
diff --git a/libc/arch-mips/syscalls/__timer_delete.S b/libc/arch-mips/syscalls/__timer_delete.S
deleted file mode 100644
index b1ca8b7..0000000
--- a/libc/arch-mips/syscalls/__timer_delete.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_delete)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_timer_delete
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__timer_delete)
diff --git a/libc/arch-mips/syscalls/__timer_getoverrun.S b/libc/arch-mips/syscalls/__timer_getoverrun.S
deleted file mode 100644
index 07e75e5..0000000
--- a/libc/arch-mips/syscalls/__timer_getoverrun.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_getoverrun)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_timer_getoverrun
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__timer_getoverrun)
diff --git a/libc/arch-mips/syscalls/__timer_gettime.S b/libc/arch-mips/syscalls/__timer_gettime.S
deleted file mode 100644
index 7ee9cad..0000000
--- a/libc/arch-mips/syscalls/__timer_gettime.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_gettime)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_timer_gettime
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__timer_gettime)
diff --git a/libc/arch-mips/syscalls/__timer_settime.S b/libc/arch-mips/syscalls/__timer_settime.S
deleted file mode 100644
index 4f7d95a..0000000
--- a/libc/arch-mips/syscalls/__timer_settime.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_settime)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_timer_settime
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__timer_settime)
diff --git a/libc/arch-mips/syscalls/__waitid.S b/libc/arch-mips/syscalls/__waitid.S
deleted file mode 100644
index 274d7b6..0000000
--- a/libc/arch-mips/syscalls/__waitid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__waitid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_waitid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(__waitid)
diff --git a/libc/arch-mips/syscalls/_exit.S b/libc/arch-mips/syscalls/_exit.S
deleted file mode 100644
index f41912c..0000000
--- a/libc/arch-mips/syscalls/_exit.S
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(_exit)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_exit_group
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(_exit)
-
-ALIAS_SYMBOL(_Exit, _exit)
diff --git a/libc/arch-mips/syscalls/_flush_cache.S b/libc/arch-mips/syscalls/_flush_cache.S
deleted file mode 100644
index fa737e8..0000000
--- a/libc/arch-mips/syscalls/_flush_cache.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(_flush_cache)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_cacheflush
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(_flush_cache)
diff --git a/libc/arch-mips/syscalls/acct.S b/libc/arch-mips/syscalls/acct.S
deleted file mode 100644
index 9908c3f..0000000
--- a/libc/arch-mips/syscalls/acct.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(acct)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_acct
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(acct)
diff --git a/libc/arch-mips/syscalls/adjtimex.S b/libc/arch-mips/syscalls/adjtimex.S
deleted file mode 100644
index bc525d0..0000000
--- a/libc/arch-mips/syscalls/adjtimex.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(adjtimex)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_adjtimex
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(adjtimex)
diff --git a/libc/arch-mips/syscalls/bind.S b/libc/arch-mips/syscalls/bind.S
deleted file mode 100644
index cda6e24..0000000
--- a/libc/arch-mips/syscalls/bind.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(bind)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_bind
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(bind)
diff --git a/libc/arch-mips/syscalls/capget.S b/libc/arch-mips/syscalls/capget.S
deleted file mode 100644
index 9c8d430..0000000
--- a/libc/arch-mips/syscalls/capget.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capget)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_capget
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(capget)
diff --git a/libc/arch-mips/syscalls/capset.S b/libc/arch-mips/syscalls/capset.S
deleted file mode 100644
index f30beba..0000000
--- a/libc/arch-mips/syscalls/capset.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capset)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_capset
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(capset)
diff --git a/libc/arch-mips/syscalls/chdir.S b/libc/arch-mips/syscalls/chdir.S
deleted file mode 100644
index 17de18d..0000000
--- a/libc/arch-mips/syscalls/chdir.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chdir)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_chdir
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(chdir)
diff --git a/libc/arch-mips/syscalls/chroot.S b/libc/arch-mips/syscalls/chroot.S
deleted file mode 100644
index c1998af..0000000
--- a/libc/arch-mips/syscalls/chroot.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chroot)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_chroot
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(chroot)
diff --git a/libc/arch-mips/syscalls/clock_adjtime.S b/libc/arch-mips/syscalls/clock_adjtime.S
deleted file mode 100644
index 10f0d39..0000000
--- a/libc/arch-mips/syscalls/clock_adjtime.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_adjtime)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_clock_adjtime
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(clock_adjtime)
diff --git a/libc/arch-mips/syscalls/clock_settime.S b/libc/arch-mips/syscalls/clock_settime.S
deleted file mode 100644
index 651729d..0000000
--- a/libc/arch-mips/syscalls/clock_settime.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_settime)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_clock_settime
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(clock_settime)
diff --git a/libc/arch-mips/syscalls/delete_module.S b/libc/arch-mips/syscalls/delete_module.S
deleted file mode 100644
index def5a16..0000000
--- a/libc/arch-mips/syscalls/delete_module.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(delete_module)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_delete_module
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(delete_module)
diff --git a/libc/arch-mips/syscalls/dup.S b/libc/arch-mips/syscalls/dup.S
deleted file mode 100644
index 0c0ee8d..0000000
--- a/libc/arch-mips/syscalls/dup.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_dup
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(dup)
diff --git a/libc/arch-mips/syscalls/dup3.S b/libc/arch-mips/syscalls/dup3.S
deleted file mode 100644
index cbec960..0000000
--- a/libc/arch-mips/syscalls/dup3.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup3)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_dup3
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(dup3)
diff --git a/libc/arch-mips/syscalls/epoll_create1.S b/libc/arch-mips/syscalls/epoll_create1.S
deleted file mode 100644
index fc268fe..0000000
--- a/libc/arch-mips/syscalls/epoll_create1.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_create1)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_epoll_create1
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(epoll_create1)
diff --git a/libc/arch-mips/syscalls/epoll_ctl.S b/libc/arch-mips/syscalls/epoll_ctl.S
deleted file mode 100644
index 222c97a..0000000
--- a/libc/arch-mips/syscalls/epoll_ctl.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_ctl)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_epoll_ctl
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(epoll_ctl)
diff --git a/libc/arch-mips/syscalls/eventfd.S b/libc/arch-mips/syscalls/eventfd.S
deleted file mode 100644
index 2bca718..0000000
--- a/libc/arch-mips/syscalls/eventfd.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(eventfd)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_eventfd2
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(eventfd)
diff --git a/libc/arch-mips/syscalls/execve.S b/libc/arch-mips/syscalls/execve.S
deleted file mode 100644
index 3dd36a1..0000000
--- a/libc/arch-mips/syscalls/execve.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(execve)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_execve
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(execve)
diff --git a/libc/arch-mips/syscalls/fallocate64.S b/libc/arch-mips/syscalls/fallocate64.S
deleted file mode 100644
index ed50bb5..0000000
--- a/libc/arch-mips/syscalls/fallocate64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fallocate64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fallocate
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(fallocate64)
diff --git a/libc/arch-mips/syscalls/fchdir.S b/libc/arch-mips/syscalls/fchdir.S
deleted file mode 100644
index 5b92e85..0000000
--- a/libc/arch-mips/syscalls/fchdir.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchdir)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fchdir
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(fchdir)
diff --git a/libc/arch-mips/syscalls/fchown.S b/libc/arch-mips/syscalls/fchown.S
deleted file mode 100644
index afd96e8..0000000
--- a/libc/arch-mips/syscalls/fchown.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchown)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fchown
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(fchown)
diff --git a/libc/arch-mips/syscalls/fchownat.S b/libc/arch-mips/syscalls/fchownat.S
deleted file mode 100644
index be2021b..0000000
--- a/libc/arch-mips/syscalls/fchownat.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchownat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fchownat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(fchownat)
diff --git a/libc/arch-mips/syscalls/fdatasync.S b/libc/arch-mips/syscalls/fdatasync.S
deleted file mode 100644
index 0b37d8f..0000000
--- a/libc/arch-mips/syscalls/fdatasync.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fdatasync)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fdatasync
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(fdatasync)
diff --git a/libc/arch-mips/syscalls/flock.S b/libc/arch-mips/syscalls/flock.S
deleted file mode 100644
index badb41d..0000000
--- a/libc/arch-mips/syscalls/flock.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(flock)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_flock
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(flock)
diff --git a/libc/arch-mips/syscalls/fremovexattr.S b/libc/arch-mips/syscalls/fremovexattr.S
deleted file mode 100644
index 290ecc8..0000000
--- a/libc/arch-mips/syscalls/fremovexattr.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fremovexattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fremovexattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(fremovexattr)
diff --git a/libc/arch-mips/syscalls/fstat64.S b/libc/arch-mips/syscalls/fstat64.S
deleted file mode 100644
index 3ecc2ba..0000000
--- a/libc/arch-mips/syscalls/fstat64.S
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fstat64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fstat64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(fstat64)
-
-ALIAS_SYMBOL(fstat, fstat64)
diff --git a/libc/arch-mips/syscalls/fstatat64.S b/libc/arch-mips/syscalls/fstatat64.S
deleted file mode 100644
index 5b7550c..0000000
--- a/libc/arch-mips/syscalls/fstatat64.S
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fstatat64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fstatat64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(fstatat64)
-
-ALIAS_SYMBOL(fstatat, fstatat64)
diff --git a/libc/arch-mips/syscalls/fsync.S b/libc/arch-mips/syscalls/fsync.S
deleted file mode 100644
index 24e86a2..0000000
--- a/libc/arch-mips/syscalls/fsync.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fsync)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_fsync
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(fsync)
diff --git a/libc/arch-mips/syscalls/ftruncate64.S b/libc/arch-mips/syscalls/ftruncate64.S
deleted file mode 100644
index 858141c..0000000
--- a/libc/arch-mips/syscalls/ftruncate64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(ftruncate64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_ftruncate64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(ftruncate64)
diff --git a/libc/arch-mips/syscalls/getegid.S b/libc/arch-mips/syscalls/getegid.S
deleted file mode 100644
index 6bdf47f..0000000
--- a/libc/arch-mips/syscalls/getegid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getegid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getegid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getegid)
diff --git a/libc/arch-mips/syscalls/geteuid.S b/libc/arch-mips/syscalls/geteuid.S
deleted file mode 100644
index 07b571e..0000000
--- a/libc/arch-mips/syscalls/geteuid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(geteuid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_geteuid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(geteuid)
diff --git a/libc/arch-mips/syscalls/getgid.S b/libc/arch-mips/syscalls/getgid.S
deleted file mode 100644
index a2020fa..0000000
--- a/libc/arch-mips/syscalls/getgid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getgid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getgid)
diff --git a/libc/arch-mips/syscalls/getgroups.S b/libc/arch-mips/syscalls/getgroups.S
deleted file mode 100644
index 86510dc..0000000
--- a/libc/arch-mips/syscalls/getgroups.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgroups)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getgroups
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getgroups)
diff --git a/libc/arch-mips/syscalls/getitimer.S b/libc/arch-mips/syscalls/getitimer.S
deleted file mode 100644
index 6d671f5..0000000
--- a/libc/arch-mips/syscalls/getitimer.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getitimer)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getitimer
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getitimer)
diff --git a/libc/arch-mips/syscalls/getpeername.S b/libc/arch-mips/syscalls/getpeername.S
deleted file mode 100644
index b372574..0000000
--- a/libc/arch-mips/syscalls/getpeername.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpeername)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getpeername
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getpeername)
diff --git a/libc/arch-mips/syscalls/getpgid.S b/libc/arch-mips/syscalls/getpgid.S
deleted file mode 100644
index 25a1fdf..0000000
--- a/libc/arch-mips/syscalls/getpgid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpgid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getpgid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getpgid)
diff --git a/libc/arch-mips/syscalls/getppid.S b/libc/arch-mips/syscalls/getppid.S
deleted file mode 100644
index 54f1252..0000000
--- a/libc/arch-mips/syscalls/getppid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getppid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getppid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getppid)
diff --git a/libc/arch-mips/syscalls/getrandom.S b/libc/arch-mips/syscalls/getrandom.S
deleted file mode 100644
index 9a32c78..0000000
--- a/libc/arch-mips/syscalls/getrandom.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrandom)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getrandom
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getrandom)
diff --git a/libc/arch-mips/syscalls/getresgid.S b/libc/arch-mips/syscalls/getresgid.S
deleted file mode 100644
index 8336f66..0000000
--- a/libc/arch-mips/syscalls/getresgid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresgid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getresgid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getresgid)
diff --git a/libc/arch-mips/syscalls/getresuid.S b/libc/arch-mips/syscalls/getresuid.S
deleted file mode 100644
index 9e4cb36..0000000
--- a/libc/arch-mips/syscalls/getresuid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresuid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getresuid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getresuid)
diff --git a/libc/arch-mips/syscalls/getrlimit.S b/libc/arch-mips/syscalls/getrlimit.S
deleted file mode 100644
index 2ae1c04..0000000
--- a/libc/arch-mips/syscalls/getrlimit.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrlimit)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getrlimit
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getrlimit)
diff --git a/libc/arch-mips/syscalls/getrusage.S b/libc/arch-mips/syscalls/getrusage.S
deleted file mode 100644
index c4a5aec..0000000
--- a/libc/arch-mips/syscalls/getrusage.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrusage)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getrusage
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getrusage)
diff --git a/libc/arch-mips/syscalls/getsid.S b/libc/arch-mips/syscalls/getsid.S
deleted file mode 100644
index 26f84c3..0000000
--- a/libc/arch-mips/syscalls/getsid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getsid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getsid)
diff --git a/libc/arch-mips/syscalls/getsockname.S b/libc/arch-mips/syscalls/getsockname.S
deleted file mode 100644
index f54df87..0000000
--- a/libc/arch-mips/syscalls/getsockname.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockname)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getsockname
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getsockname)
diff --git a/libc/arch-mips/syscalls/getsockopt.S b/libc/arch-mips/syscalls/getsockopt.S
deleted file mode 100644
index 32cd721..0000000
--- a/libc/arch-mips/syscalls/getsockopt.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockopt)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getsockopt
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getsockopt)
diff --git a/libc/arch-mips/syscalls/getuid.S b/libc/arch-mips/syscalls/getuid.S
deleted file mode 100644
index d2fe78f..0000000
--- a/libc/arch-mips/syscalls/getuid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getuid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getuid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getuid)
diff --git a/libc/arch-mips/syscalls/getxattr.S b/libc/arch-mips/syscalls/getxattr.S
deleted file mode 100644
index 0e5a33f..0000000
--- a/libc/arch-mips/syscalls/getxattr.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getxattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_getxattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(getxattr)
diff --git a/libc/arch-mips/syscalls/init_module.S b/libc/arch-mips/syscalls/init_module.S
deleted file mode 100644
index e4434c3..0000000
--- a/libc/arch-mips/syscalls/init_module.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(init_module)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_init_module
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(init_module)
diff --git a/libc/arch-mips/syscalls/inotify_add_watch.S b/libc/arch-mips/syscalls/inotify_add_watch.S
deleted file mode 100644
index 3710cb7..0000000
--- a/libc/arch-mips/syscalls/inotify_add_watch.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_add_watch)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_inotify_add_watch
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(inotify_add_watch)
diff --git a/libc/arch-mips/syscalls/inotify_init1.S b/libc/arch-mips/syscalls/inotify_init1.S
deleted file mode 100644
index b38f018..0000000
--- a/libc/arch-mips/syscalls/inotify_init1.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_init1)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_inotify_init1
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(inotify_init1)
diff --git a/libc/arch-mips/syscalls/inotify_rm_watch.S b/libc/arch-mips/syscalls/inotify_rm_watch.S
deleted file mode 100644
index a7b6fbe..0000000
--- a/libc/arch-mips/syscalls/inotify_rm_watch.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_rm_watch)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_inotify_rm_watch
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(inotify_rm_watch)
diff --git a/libc/arch-mips/syscalls/kill.S b/libc/arch-mips/syscalls/kill.S
deleted file mode 100644
index 1075da1..0000000
--- a/libc/arch-mips/syscalls/kill.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(kill)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_kill
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(kill)
diff --git a/libc/arch-mips/syscalls/klogctl.S b/libc/arch-mips/syscalls/klogctl.S
deleted file mode 100644
index c3fa53c..0000000
--- a/libc/arch-mips/syscalls/klogctl.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(klogctl)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_syslog
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(klogctl)
diff --git a/libc/arch-mips/syscalls/lgetxattr.S b/libc/arch-mips/syscalls/lgetxattr.S
deleted file mode 100644
index b05850d..0000000
--- a/libc/arch-mips/syscalls/lgetxattr.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lgetxattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_lgetxattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(lgetxattr)
diff --git a/libc/arch-mips/syscalls/linkat.S b/libc/arch-mips/syscalls/linkat.S
deleted file mode 100644
index eacc488..0000000
--- a/libc/arch-mips/syscalls/linkat.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(linkat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_linkat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(linkat)
diff --git a/libc/arch-mips/syscalls/listen.S b/libc/arch-mips/syscalls/listen.S
deleted file mode 100644
index cbda026..0000000
--- a/libc/arch-mips/syscalls/listen.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listen)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_listen
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(listen)
diff --git a/libc/arch-mips/syscalls/listxattr.S b/libc/arch-mips/syscalls/listxattr.S
deleted file mode 100644
index 0ee14a0..0000000
--- a/libc/arch-mips/syscalls/listxattr.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listxattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_listxattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(listxattr)
diff --git a/libc/arch-mips/syscalls/llistxattr.S b/libc/arch-mips/syscalls/llistxattr.S
deleted file mode 100644
index 46f79df..0000000
--- a/libc/arch-mips/syscalls/llistxattr.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(llistxattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_llistxattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(llistxattr)
diff --git a/libc/arch-mips/syscalls/lremovexattr.S b/libc/arch-mips/syscalls/lremovexattr.S
deleted file mode 100644
index 74aa7c9..0000000
--- a/libc/arch-mips/syscalls/lremovexattr.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lremovexattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_lremovexattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(lremovexattr)
diff --git a/libc/arch-mips/syscalls/lseek.S b/libc/arch-mips/syscalls/lseek.S
deleted file mode 100644
index 9f93986..0000000
--- a/libc/arch-mips/syscalls/lseek.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lseek)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_lseek
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(lseek)
diff --git a/libc/arch-mips/syscalls/lsetxattr.S b/libc/arch-mips/syscalls/lsetxattr.S
deleted file mode 100644
index a87121f..0000000
--- a/libc/arch-mips/syscalls/lsetxattr.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lsetxattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_lsetxattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(lsetxattr)
diff --git a/libc/arch-mips/syscalls/madvise.S b/libc/arch-mips/syscalls/madvise.S
deleted file mode 100644
index 5fd4856..0000000
--- a/libc/arch-mips/syscalls/madvise.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(madvise)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_madvise
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(madvise)
diff --git a/libc/arch-mips/syscalls/mincore.S b/libc/arch-mips/syscalls/mincore.S
deleted file mode 100644
index db74719..0000000
--- a/libc/arch-mips/syscalls/mincore.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mincore)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_mincore
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(mincore)
diff --git a/libc/arch-mips/syscalls/mkdirat.S b/libc/arch-mips/syscalls/mkdirat.S
deleted file mode 100644
index 3ff69c3..0000000
--- a/libc/arch-mips/syscalls/mkdirat.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mkdirat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_mkdirat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(mkdirat)
diff --git a/libc/arch-mips/syscalls/mknodat.S b/libc/arch-mips/syscalls/mknodat.S
deleted file mode 100644
index 651a619..0000000
--- a/libc/arch-mips/syscalls/mknodat.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mknodat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_mknodat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(mknodat)
diff --git a/libc/arch-mips/syscalls/mlock.S b/libc/arch-mips/syscalls/mlock.S
deleted file mode 100644
index d1bb3a4..0000000
--- a/libc/arch-mips/syscalls/mlock.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlock)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_mlock
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(mlock)
diff --git a/libc/arch-mips/syscalls/mlockall.S b/libc/arch-mips/syscalls/mlockall.S
deleted file mode 100644
index 495be12..0000000
--- a/libc/arch-mips/syscalls/mlockall.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlockall)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_mlockall
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(mlockall)
diff --git a/libc/arch-mips/syscalls/mount.S b/libc/arch-mips/syscalls/mount.S
deleted file mode 100644
index 6eccf01..0000000
--- a/libc/arch-mips/syscalls/mount.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mount)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_mount
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(mount)
diff --git a/libc/arch-mips/syscalls/mprotect.S b/libc/arch-mips/syscalls/mprotect.S
deleted file mode 100644
index 486fd5d..0000000
--- a/libc/arch-mips/syscalls/mprotect.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mprotect)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_mprotect
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(mprotect)
diff --git a/libc/arch-mips/syscalls/msync.S b/libc/arch-mips/syscalls/msync.S
deleted file mode 100644
index 6554fd0..0000000
--- a/libc/arch-mips/syscalls/msync.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(msync)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_msync
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(msync)
diff --git a/libc/arch-mips/syscalls/munlock.S b/libc/arch-mips/syscalls/munlock.S
deleted file mode 100644
index 3a3f50c..0000000
--- a/libc/arch-mips/syscalls/munlock.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlock)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_munlock
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(munlock)
diff --git a/libc/arch-mips/syscalls/munlockall.S b/libc/arch-mips/syscalls/munlockall.S
deleted file mode 100644
index 4efb260..0000000
--- a/libc/arch-mips/syscalls/munlockall.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlockall)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_munlockall
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(munlockall)
diff --git a/libc/arch-mips/syscalls/munmap.S b/libc/arch-mips/syscalls/munmap.S
deleted file mode 100644
index 364f0c1..0000000
--- a/libc/arch-mips/syscalls/munmap.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munmap)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_munmap
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(munmap)
diff --git a/libc/arch-mips/syscalls/nanosleep.S b/libc/arch-mips/syscalls/nanosleep.S
deleted file mode 100644
index 7e88d00..0000000
--- a/libc/arch-mips/syscalls/nanosleep.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(nanosleep)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_nanosleep
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(nanosleep)
diff --git a/libc/arch-mips/syscalls/personality.S b/libc/arch-mips/syscalls/personality.S
deleted file mode 100644
index 67f9ec1..0000000
--- a/libc/arch-mips/syscalls/personality.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(personality)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_personality
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(personality)
diff --git a/libc/arch-mips/syscalls/pipe2.S b/libc/arch-mips/syscalls/pipe2.S
deleted file mode 100644
index 4040d1f..0000000
--- a/libc/arch-mips/syscalls/pipe2.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pipe2)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_pipe2
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(pipe2)
diff --git a/libc/arch-mips/syscalls/prctl.S b/libc/arch-mips/syscalls/prctl.S
deleted file mode 100644
index e6b0024..0000000
--- a/libc/arch-mips/syscalls/prctl.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prctl)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_prctl
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(prctl)
diff --git a/libc/arch-mips/syscalls/pread64.S b/libc/arch-mips/syscalls/pread64.S
deleted file mode 100644
index 0181595..0000000
--- a/libc/arch-mips/syscalls/pread64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pread64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_pread64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(pread64)
diff --git a/libc/arch-mips/syscalls/prlimit64.S b/libc/arch-mips/syscalls/prlimit64.S
deleted file mode 100644
index c93af64..0000000
--- a/libc/arch-mips/syscalls/prlimit64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prlimit64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_prlimit64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(prlimit64)
diff --git a/libc/arch-mips/syscalls/process_vm_readv.S b/libc/arch-mips/syscalls/process_vm_readv.S
deleted file mode 100644
index e571db0..0000000
--- a/libc/arch-mips/syscalls/process_vm_readv.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_readv)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_process_vm_readv
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(process_vm_readv)
diff --git a/libc/arch-mips/syscalls/process_vm_writev.S b/libc/arch-mips/syscalls/process_vm_writev.S
deleted file mode 100644
index cab3b6d..0000000
--- a/libc/arch-mips/syscalls/process_vm_writev.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_writev)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_process_vm_writev
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(process_vm_writev)
diff --git a/libc/arch-mips/syscalls/pwrite64.S b/libc/arch-mips/syscalls/pwrite64.S
deleted file mode 100644
index 4f46f75..0000000
--- a/libc/arch-mips/syscalls/pwrite64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pwrite64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_pwrite64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(pwrite64)
diff --git a/libc/arch-mips/syscalls/quotactl.S b/libc/arch-mips/syscalls/quotactl.S
deleted file mode 100644
index 2c8044a..0000000
--- a/libc/arch-mips/syscalls/quotactl.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(quotactl)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_quotactl
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(quotactl)
diff --git a/libc/arch-mips/syscalls/read.S b/libc/arch-mips/syscalls/read.S
deleted file mode 100644
index afc6199..0000000
--- a/libc/arch-mips/syscalls/read.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(read)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_read
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(read)
diff --git a/libc/arch-mips/syscalls/readahead.S b/libc/arch-mips/syscalls/readahead.S
deleted file mode 100644
index 1fe93d8..0000000
--- a/libc/arch-mips/syscalls/readahead.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readahead)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_readahead
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(readahead)
diff --git a/libc/arch-mips/syscalls/readlinkat.S b/libc/arch-mips/syscalls/readlinkat.S
deleted file mode 100644
index 927f86f..0000000
--- a/libc/arch-mips/syscalls/readlinkat.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readlinkat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_readlinkat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(readlinkat)
diff --git a/libc/arch-mips/syscalls/readv.S b/libc/arch-mips/syscalls/readv.S
deleted file mode 100644
index 6af3ac4..0000000
--- a/libc/arch-mips/syscalls/readv.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readv)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_readv
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(readv)
diff --git a/libc/arch-mips/syscalls/recvfrom.S b/libc/arch-mips/syscalls/recvfrom.S
deleted file mode 100644
index 448d892..0000000
--- a/libc/arch-mips/syscalls/recvfrom.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvfrom)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_recvfrom
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(recvfrom)
diff --git a/libc/arch-mips/syscalls/recvmmsg.S b/libc/arch-mips/syscalls/recvmmsg.S
deleted file mode 100644
index 42660e2..0000000
--- a/libc/arch-mips/syscalls/recvmmsg.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmmsg)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_recvmmsg
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(recvmmsg)
diff --git a/libc/arch-mips/syscalls/recvmsg.S b/libc/arch-mips/syscalls/recvmsg.S
deleted file mode 100644
index 71c7990..0000000
--- a/libc/arch-mips/syscalls/recvmsg.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmsg)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_recvmsg
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(recvmsg)
diff --git a/libc/arch-mips/syscalls/removexattr.S b/libc/arch-mips/syscalls/removexattr.S
deleted file mode 100644
index 4830373..0000000
--- a/libc/arch-mips/syscalls/removexattr.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(removexattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_removexattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(removexattr)
diff --git a/libc/arch-mips/syscalls/renameat.S b/libc/arch-mips/syscalls/renameat.S
deleted file mode 100644
index 1486f95..0000000
--- a/libc/arch-mips/syscalls/renameat.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(renameat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_renameat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(renameat)
diff --git a/libc/arch-mips/syscalls/sched_get_priority_max.S b/libc/arch-mips/syscalls/sched_get_priority_max.S
deleted file mode 100644
index f1d35c6..0000000
--- a/libc/arch-mips/syscalls/sched_get_priority_max.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_max)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sched_get_priority_max
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sched_get_priority_max)
diff --git a/libc/arch-mips/syscalls/sched_get_priority_min.S b/libc/arch-mips/syscalls/sched_get_priority_min.S
deleted file mode 100644
index cdb5539..0000000
--- a/libc/arch-mips/syscalls/sched_get_priority_min.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_min)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sched_get_priority_min
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sched_get_priority_min)
diff --git a/libc/arch-mips/syscalls/sched_getparam.S b/libc/arch-mips/syscalls/sched_getparam.S
deleted file mode 100644
index 71724bd..0000000
--- a/libc/arch-mips/syscalls/sched_getparam.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getparam)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sched_getparam
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sched_getparam)
diff --git a/libc/arch-mips/syscalls/sched_getscheduler.S b/libc/arch-mips/syscalls/sched_getscheduler.S
deleted file mode 100644
index 8fae1c2..0000000
--- a/libc/arch-mips/syscalls/sched_getscheduler.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getscheduler)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sched_getscheduler
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sched_getscheduler)
diff --git a/libc/arch-mips/syscalls/sched_rr_get_interval.S b/libc/arch-mips/syscalls/sched_rr_get_interval.S
deleted file mode 100644
index eb53d77..0000000
--- a/libc/arch-mips/syscalls/sched_rr_get_interval.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_rr_get_interval)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sched_rr_get_interval
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sched_rr_get_interval)
diff --git a/libc/arch-mips/syscalls/sched_setaffinity.S b/libc/arch-mips/syscalls/sched_setaffinity.S
deleted file mode 100644
index a4837fa..0000000
--- a/libc/arch-mips/syscalls/sched_setaffinity.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setaffinity)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sched_setaffinity
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sched_setaffinity)
diff --git a/libc/arch-mips/syscalls/sched_setparam.S b/libc/arch-mips/syscalls/sched_setparam.S
deleted file mode 100644
index 4b6d0a2..0000000
--- a/libc/arch-mips/syscalls/sched_setparam.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setparam)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sched_setparam
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sched_setparam)
diff --git a/libc/arch-mips/syscalls/sched_setscheduler.S b/libc/arch-mips/syscalls/sched_setscheduler.S
deleted file mode 100644
index 69d7259..0000000
--- a/libc/arch-mips/syscalls/sched_setscheduler.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setscheduler)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sched_setscheduler
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sched_setscheduler)
diff --git a/libc/arch-mips/syscalls/sched_yield.S b/libc/arch-mips/syscalls/sched_yield.S
deleted file mode 100644
index da6b531..0000000
--- a/libc/arch-mips/syscalls/sched_yield.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_yield)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sched_yield
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sched_yield)
diff --git a/libc/arch-mips/syscalls/sendfile.S b/libc/arch-mips/syscalls/sendfile.S
deleted file mode 100644
index 9145cea..0000000
--- a/libc/arch-mips/syscalls/sendfile.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendfile)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sendfile
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sendfile)
diff --git a/libc/arch-mips/syscalls/sendfile64.S b/libc/arch-mips/syscalls/sendfile64.S
deleted file mode 100644
index 0093917..0000000
--- a/libc/arch-mips/syscalls/sendfile64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendfile64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sendfile64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sendfile64)
diff --git a/libc/arch-mips/syscalls/sendmmsg.S b/libc/arch-mips/syscalls/sendmmsg.S
deleted file mode 100644
index d4e9806..0000000
--- a/libc/arch-mips/syscalls/sendmmsg.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmmsg)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sendmmsg
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sendmmsg)
diff --git a/libc/arch-mips/syscalls/sendmsg.S b/libc/arch-mips/syscalls/sendmsg.S
deleted file mode 100644
index ec019d6..0000000
--- a/libc/arch-mips/syscalls/sendmsg.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmsg)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sendmsg
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sendmsg)
diff --git a/libc/arch-mips/syscalls/sendto.S b/libc/arch-mips/syscalls/sendto.S
deleted file mode 100644
index 884fd06..0000000
--- a/libc/arch-mips/syscalls/sendto.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendto)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sendto
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sendto)
diff --git a/libc/arch-mips/syscalls/setdomainname.S b/libc/arch-mips/syscalls/setdomainname.S
deleted file mode 100644
index 9144a81..0000000
--- a/libc/arch-mips/syscalls/setdomainname.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setdomainname)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setdomainname
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setdomainname)
diff --git a/libc/arch-mips/syscalls/setfsgid.S b/libc/arch-mips/syscalls/setfsgid.S
deleted file mode 100644
index b927d23..0000000
--- a/libc/arch-mips/syscalls/setfsgid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsgid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setfsgid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setfsgid)
diff --git a/libc/arch-mips/syscalls/setfsuid.S b/libc/arch-mips/syscalls/setfsuid.S
deleted file mode 100644
index c95f30f..0000000
--- a/libc/arch-mips/syscalls/setfsuid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsuid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setfsuid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setfsuid)
diff --git a/libc/arch-mips/syscalls/setgid.S b/libc/arch-mips/syscalls/setgid.S
deleted file mode 100644
index a1665cc..0000000
--- a/libc/arch-mips/syscalls/setgid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setgid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setgid)
diff --git a/libc/arch-mips/syscalls/setgroups.S b/libc/arch-mips/syscalls/setgroups.S
deleted file mode 100644
index f8f4c52..0000000
--- a/libc/arch-mips/syscalls/setgroups.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgroups)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setgroups
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setgroups)
diff --git a/libc/arch-mips/syscalls/sethostname.S b/libc/arch-mips/syscalls/sethostname.S
deleted file mode 100644
index 1a3e37b..0000000
--- a/libc/arch-mips/syscalls/sethostname.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sethostname)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sethostname
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sethostname)
diff --git a/libc/arch-mips/syscalls/setitimer.S b/libc/arch-mips/syscalls/setitimer.S
deleted file mode 100644
index 1a32e97..0000000
--- a/libc/arch-mips/syscalls/setitimer.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setitimer)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setitimer
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setitimer)
diff --git a/libc/arch-mips/syscalls/setns.S b/libc/arch-mips/syscalls/setns.S
deleted file mode 100644
index 6021aa6..0000000
--- a/libc/arch-mips/syscalls/setns.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setns)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setns
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setns)
diff --git a/libc/arch-mips/syscalls/setpgid.S b/libc/arch-mips/syscalls/setpgid.S
deleted file mode 100644
index 449eabd..0000000
--- a/libc/arch-mips/syscalls/setpgid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpgid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setpgid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setpgid)
diff --git a/libc/arch-mips/syscalls/setpriority.S b/libc/arch-mips/syscalls/setpriority.S
deleted file mode 100644
index 53f500b..0000000
--- a/libc/arch-mips/syscalls/setpriority.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpriority)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setpriority
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setpriority)
diff --git a/libc/arch-mips/syscalls/setregid.S b/libc/arch-mips/syscalls/setregid.S
deleted file mode 100644
index f251969..0000000
--- a/libc/arch-mips/syscalls/setregid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setregid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setregid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setregid)
diff --git a/libc/arch-mips/syscalls/setresgid.S b/libc/arch-mips/syscalls/setresgid.S
deleted file mode 100644
index 78eb897..0000000
--- a/libc/arch-mips/syscalls/setresgid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresgid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setresgid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setresgid)
diff --git a/libc/arch-mips/syscalls/setresuid.S b/libc/arch-mips/syscalls/setresuid.S
deleted file mode 100644
index c78a4db..0000000
--- a/libc/arch-mips/syscalls/setresuid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresuid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setresuid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setresuid)
diff --git a/libc/arch-mips/syscalls/setreuid.S b/libc/arch-mips/syscalls/setreuid.S
deleted file mode 100644
index 81e8551..0000000
--- a/libc/arch-mips/syscalls/setreuid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setreuid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setreuid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setreuid)
diff --git a/libc/arch-mips/syscalls/setrlimit.S b/libc/arch-mips/syscalls/setrlimit.S
deleted file mode 100644
index ad11caf..0000000
--- a/libc/arch-mips/syscalls/setrlimit.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setrlimit)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setrlimit
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setrlimit)
diff --git a/libc/arch-mips/syscalls/setsid.S b/libc/arch-mips/syscalls/setsid.S
deleted file mode 100644
index c83d39f..0000000
--- a/libc/arch-mips/syscalls/setsid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setsid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setsid)
diff --git a/libc/arch-mips/syscalls/setsockopt.S b/libc/arch-mips/syscalls/setsockopt.S
deleted file mode 100644
index 2d398ef..0000000
--- a/libc/arch-mips/syscalls/setsockopt.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsockopt)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setsockopt
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setsockopt)
diff --git a/libc/arch-mips/syscalls/settimeofday.S b/libc/arch-mips/syscalls/settimeofday.S
deleted file mode 100644
index 4ae8057..0000000
--- a/libc/arch-mips/syscalls/settimeofday.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(settimeofday)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_settimeofday
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(settimeofday)
diff --git a/libc/arch-mips/syscalls/setuid.S b/libc/arch-mips/syscalls/setuid.S
deleted file mode 100644
index 732fb8a..0000000
--- a/libc/arch-mips/syscalls/setuid.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setuid)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setuid
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setuid)
diff --git a/libc/arch-mips/syscalls/setxattr.S b/libc/arch-mips/syscalls/setxattr.S
deleted file mode 100644
index 36a5d47..0000000
--- a/libc/arch-mips/syscalls/setxattr.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setxattr)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_setxattr
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(setxattr)
diff --git a/libc/arch-mips/syscalls/shutdown.S b/libc/arch-mips/syscalls/shutdown.S
deleted file mode 100644
index 885a501..0000000
--- a/libc/arch-mips/syscalls/shutdown.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(shutdown)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_shutdown
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(shutdown)
diff --git a/libc/arch-mips/syscalls/sigaltstack.S b/libc/arch-mips/syscalls/sigaltstack.S
deleted file mode 100644
index 4276d71..0000000
--- a/libc/arch-mips/syscalls/sigaltstack.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sigaltstack)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sigaltstack
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sigaltstack)
diff --git a/libc/arch-mips/syscalls/socketpair.S b/libc/arch-mips/syscalls/socketpair.S
deleted file mode 100644
index ac66b34..0000000
--- a/libc/arch-mips/syscalls/socketpair.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(socketpair)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_socketpair
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(socketpair)
diff --git a/libc/arch-mips/syscalls/splice.S b/libc/arch-mips/syscalls/splice.S
deleted file mode 100644
index afecd83..0000000
--- a/libc/arch-mips/syscalls/splice.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(splice)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_splice
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(splice)
diff --git a/libc/arch-mips/syscalls/swapoff.S b/libc/arch-mips/syscalls/swapoff.S
deleted file mode 100644
index dfe3a5c..0000000
--- a/libc/arch-mips/syscalls/swapoff.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapoff)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_swapoff
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(swapoff)
diff --git a/libc/arch-mips/syscalls/swapon.S b/libc/arch-mips/syscalls/swapon.S
deleted file mode 100644
index 12cfca1..0000000
--- a/libc/arch-mips/syscalls/swapon.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapon)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_swapon
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(swapon)
diff --git a/libc/arch-mips/syscalls/symlinkat.S b/libc/arch-mips/syscalls/symlinkat.S
deleted file mode 100644
index a349ede..0000000
--- a/libc/arch-mips/syscalls/symlinkat.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(symlinkat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_symlinkat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(symlinkat)
diff --git a/libc/arch-mips/syscalls/sync.S b/libc/arch-mips/syscalls/sync.S
deleted file mode 100644
index 80667b3..0000000
--- a/libc/arch-mips/syscalls/sync.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sync)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sync
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sync)
diff --git a/libc/arch-mips/syscalls/syncfs.S b/libc/arch-mips/syscalls/syncfs.S
deleted file mode 100644
index 78ee0e7..0000000
--- a/libc/arch-mips/syscalls/syncfs.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(syncfs)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_syncfs
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(syncfs)
diff --git a/libc/arch-mips/syscalls/sysinfo.S b/libc/arch-mips/syscalls/sysinfo.S
deleted file mode 100644
index 42fa57d..0000000
--- a/libc/arch-mips/syscalls/sysinfo.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sysinfo)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_sysinfo
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(sysinfo)
diff --git a/libc/arch-mips/syscalls/tee.S b/libc/arch-mips/syscalls/tee.S
deleted file mode 100644
index 97867e3..0000000
--- a/libc/arch-mips/syscalls/tee.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tee)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_tee
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(tee)
diff --git a/libc/arch-mips/syscalls/tgkill.S b/libc/arch-mips/syscalls/tgkill.S
deleted file mode 100644
index cded9e5..0000000
--- a/libc/arch-mips/syscalls/tgkill.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tgkill)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_tgkill
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(tgkill)
diff --git a/libc/arch-mips/syscalls/timerfd_create.S b/libc/arch-mips/syscalls/timerfd_create.S
deleted file mode 100644
index 840f7e2..0000000
--- a/libc/arch-mips/syscalls/timerfd_create.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_create)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_timerfd_create
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(timerfd_create)
diff --git a/libc/arch-mips/syscalls/timerfd_gettime.S b/libc/arch-mips/syscalls/timerfd_gettime.S
deleted file mode 100644
index 7ddc25f..0000000
--- a/libc/arch-mips/syscalls/timerfd_gettime.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_gettime)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_timerfd_gettime
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(timerfd_gettime)
diff --git a/libc/arch-mips/syscalls/timerfd_settime.S b/libc/arch-mips/syscalls/timerfd_settime.S
deleted file mode 100644
index b4e7926..0000000
--- a/libc/arch-mips/syscalls/timerfd_settime.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_settime)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_timerfd_settime
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(timerfd_settime)
diff --git a/libc/arch-mips/syscalls/times.S b/libc/arch-mips/syscalls/times.S
deleted file mode 100644
index ad4003b..0000000
--- a/libc/arch-mips/syscalls/times.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(times)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_times
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(times)
diff --git a/libc/arch-mips/syscalls/truncate.S b/libc/arch-mips/syscalls/truncate.S
deleted file mode 100644
index cb077e9..0000000
--- a/libc/arch-mips/syscalls/truncate.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(truncate)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_truncate
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(truncate)
diff --git a/libc/arch-mips/syscalls/truncate64.S b/libc/arch-mips/syscalls/truncate64.S
deleted file mode 100644
index 4ccd2ad..0000000
--- a/libc/arch-mips/syscalls/truncate64.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(truncate64)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_truncate64
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(truncate64)
diff --git a/libc/arch-mips/syscalls/umask.S b/libc/arch-mips/syscalls/umask.S
deleted file mode 100644
index 196dc07..0000000
--- a/libc/arch-mips/syscalls/umask.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umask)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_umask
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(umask)
diff --git a/libc/arch-mips/syscalls/umount2.S b/libc/arch-mips/syscalls/umount2.S
deleted file mode 100644
index f61e3e9..0000000
--- a/libc/arch-mips/syscalls/umount2.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umount2)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_umount2
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(umount2)
diff --git a/libc/arch-mips/syscalls/uname.S b/libc/arch-mips/syscalls/uname.S
deleted file mode 100644
index c3408e0..0000000
--- a/libc/arch-mips/syscalls/uname.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(uname)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_uname
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(uname)
diff --git a/libc/arch-mips/syscalls/unlinkat.S b/libc/arch-mips/syscalls/unlinkat.S
deleted file mode 100644
index 400a0b6..0000000
--- a/libc/arch-mips/syscalls/unlinkat.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unlinkat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_unlinkat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(unlinkat)
diff --git a/libc/arch-mips/syscalls/unshare.S b/libc/arch-mips/syscalls/unshare.S
deleted file mode 100644
index 2e81abb..0000000
--- a/libc/arch-mips/syscalls/unshare.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unshare)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_unshare
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(unshare)
diff --git a/libc/arch-mips/syscalls/utimensat.S b/libc/arch-mips/syscalls/utimensat.S
deleted file mode 100644
index 70d0bdd..0000000
--- a/libc/arch-mips/syscalls/utimensat.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(utimensat)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_utimensat
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(utimensat)
diff --git a/libc/arch-mips/syscalls/vmsplice.S b/libc/arch-mips/syscalls/vmsplice.S
deleted file mode 100644
index e575962..0000000
--- a/libc/arch-mips/syscalls/vmsplice.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(vmsplice)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_vmsplice
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(vmsplice)
diff --git a/libc/arch-mips/syscalls/wait4.S b/libc/arch-mips/syscalls/wait4.S
deleted file mode 100644
index c9572da..0000000
--- a/libc/arch-mips/syscalls/wait4.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(wait4)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_wait4
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(wait4)
diff --git a/libc/arch-mips/syscalls/write.S b/libc/arch-mips/syscalls/write.S
deleted file mode 100644
index 501c211..0000000
--- a/libc/arch-mips/syscalls/write.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(write)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_write
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(write)
diff --git a/libc/arch-mips/syscalls/writev.S b/libc/arch-mips/syscalls/writev.S
deleted file mode 100644
index 597d7fa..0000000
--- a/libc/arch-mips/syscalls/writev.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(writev)
-    .set noreorder
-    .cpload $t9
-    li $v0, __NR_writev
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(writev)
diff --git a/libc/arch-mips64/syscalls/___clock_nanosleep.S b/libc/arch-mips64/syscalls/___clock_nanosleep.S
deleted file mode 100644
index 1633136..0000000
--- a/libc/arch-mips64/syscalls/___clock_nanosleep.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___clock_nanosleep)
-    .set push
-    .set noreorder
-    li $v0, __NR_clock_nanosleep
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(___clock_nanosleep)
-.hidden ___clock_nanosleep
diff --git a/libc/arch-mips64/syscalls/___close.S b/libc/arch-mips64/syscalls/___close.S
deleted file mode 100644
index a8ab9a3..0000000
--- a/libc/arch-mips64/syscalls/___close.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___close)
-    .set push
-    .set noreorder
-    li $v0, __NR_close
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(___close)
-.hidden ___close
diff --git a/libc/arch-mips64/syscalls/___faccessat.S b/libc/arch-mips64/syscalls/___faccessat.S
deleted file mode 100644
index 6e15b92..0000000
--- a/libc/arch-mips64/syscalls/___faccessat.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___faccessat)
-    .set push
-    .set noreorder
-    li $v0, __NR_faccessat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(___faccessat)
-.hidden ___faccessat
diff --git a/libc/arch-mips64/syscalls/___fchmod.S b/libc/arch-mips64/syscalls/___fchmod.S
deleted file mode 100644
index 610c7f7..0000000
--- a/libc/arch-mips64/syscalls/___fchmod.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmod)
-    .set push
-    .set noreorder
-    li $v0, __NR_fchmod
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(___fchmod)
-.hidden ___fchmod
diff --git a/libc/arch-mips64/syscalls/___fchmodat.S b/libc/arch-mips64/syscalls/___fchmodat.S
deleted file mode 100644
index 70ad465..0000000
--- a/libc/arch-mips64/syscalls/___fchmodat.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmodat)
-    .set push
-    .set noreorder
-    li $v0, __NR_fchmodat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(___fchmodat)
-.hidden ___fchmodat
diff --git a/libc/arch-mips64/syscalls/___fgetxattr.S b/libc/arch-mips64/syscalls/___fgetxattr.S
deleted file mode 100644
index fefb416..0000000
--- a/libc/arch-mips64/syscalls/___fgetxattr.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fgetxattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_fgetxattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(___fgetxattr)
-.hidden ___fgetxattr
diff --git a/libc/arch-mips64/syscalls/___flistxattr.S b/libc/arch-mips64/syscalls/___flistxattr.S
deleted file mode 100644
index ff1991d..0000000
--- a/libc/arch-mips64/syscalls/___flistxattr.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___flistxattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_flistxattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(___flistxattr)
-.hidden ___flistxattr
diff --git a/libc/arch-mips64/syscalls/___fsetxattr.S b/libc/arch-mips64/syscalls/___fsetxattr.S
deleted file mode 100644
index 454be4b..0000000
--- a/libc/arch-mips64/syscalls/___fsetxattr.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fsetxattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_fsetxattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(___fsetxattr)
-.hidden ___fsetxattr
diff --git a/libc/arch-mips64/syscalls/___mremap.S b/libc/arch-mips64/syscalls/___mremap.S
deleted file mode 100644
index 4c996a6..0000000
--- a/libc/arch-mips64/syscalls/___mremap.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___mremap)
-    .set push
-    .set noreorder
-    li $v0, __NR_mremap
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(___mremap)
-.hidden ___mremap
diff --git a/libc/arch-mips64/syscalls/___rt_sigqueueinfo.S b/libc/arch-mips64/syscalls/___rt_sigqueueinfo.S
deleted file mode 100644
index 5cb239a..0000000
--- a/libc/arch-mips64/syscalls/___rt_sigqueueinfo.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___rt_sigqueueinfo)
-    .set push
-    .set noreorder
-    li $v0, __NR_rt_sigqueueinfo
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(___rt_sigqueueinfo)
-.hidden ___rt_sigqueueinfo
diff --git a/libc/arch-mips64/syscalls/__accept4.S b/libc/arch-mips64/syscalls/__accept4.S
deleted file mode 100644
index d13222e..0000000
--- a/libc/arch-mips64/syscalls/__accept4.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__accept4)
-    .set push
-    .set noreorder
-    li $v0, __NR_accept4
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__accept4)
-.hidden __accept4
diff --git a/libc/arch-mips64/syscalls/__brk.S b/libc/arch-mips64/syscalls/__brk.S
deleted file mode 100644
index a643a66..0000000
--- a/libc/arch-mips64/syscalls/__brk.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__brk)
-    .set push
-    .set noreorder
-    li $v0, __NR_brk
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__brk)
-.hidden __brk
diff --git a/libc/arch-mips64/syscalls/__clock_getres.S b/libc/arch-mips64/syscalls/__clock_getres.S
deleted file mode 100644
index fb871c9..0000000
--- a/libc/arch-mips64/syscalls/__clock_getres.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_getres)
-    .set push
-    .set noreorder
-    li $v0, __NR_clock_getres
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__clock_getres)
-.hidden __clock_getres
diff --git a/libc/arch-mips64/syscalls/__clock_gettime.S b/libc/arch-mips64/syscalls/__clock_gettime.S
deleted file mode 100644
index fb3486b..0000000
--- a/libc/arch-mips64/syscalls/__clock_gettime.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_gettime)
-    .set push
-    .set noreorder
-    li $v0, __NR_clock_gettime
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__clock_gettime)
-.hidden __clock_gettime
diff --git a/libc/arch-mips64/syscalls/__connect.S b/libc/arch-mips64/syscalls/__connect.S
deleted file mode 100644
index 01f465f..0000000
--- a/libc/arch-mips64/syscalls/__connect.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__connect)
-    .set push
-    .set noreorder
-    li $v0, __NR_connect
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__connect)
-.hidden __connect
diff --git a/libc/arch-mips64/syscalls/__epoll_pwait.S b/libc/arch-mips64/syscalls/__epoll_pwait.S
deleted file mode 100644
index 7362583..0000000
--- a/libc/arch-mips64/syscalls/__epoll_pwait.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__epoll_pwait)
-    .set push
-    .set noreorder
-    li $v0, __NR_epoll_pwait
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__epoll_pwait)
-.hidden __epoll_pwait
diff --git a/libc/arch-mips64/syscalls/__exit.S b/libc/arch-mips64/syscalls/__exit.S
deleted file mode 100644
index d32746a..0000000
--- a/libc/arch-mips64/syscalls/__exit.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__exit)
-    .set push
-    .set noreorder
-    li $v0, __NR_exit
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__exit)
-.hidden __exit
diff --git a/libc/arch-mips64/syscalls/__fadvise64.S b/libc/arch-mips64/syscalls/__fadvise64.S
deleted file mode 100644
index 6170142..0000000
--- a/libc/arch-mips64/syscalls/__fadvise64.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fadvise64)
-    .set push
-    .set noreorder
-    li $v0, __NR_fadvise64
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__fadvise64)
-.hidden __fadvise64
diff --git a/libc/arch-mips64/syscalls/__fstatfs.S b/libc/arch-mips64/syscalls/__fstatfs.S
deleted file mode 100644
index bc57bb1..0000000
--- a/libc/arch-mips64/syscalls/__fstatfs.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fstatfs)
-    .set push
-    .set noreorder
-    li $v0, __NR_fstatfs
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__fstatfs)
-.hidden __fstatfs
diff --git a/libc/arch-mips64/syscalls/__getcpu.S b/libc/arch-mips64/syscalls/__getcpu.S
deleted file mode 100644
index 05acc44..0000000
--- a/libc/arch-mips64/syscalls/__getcpu.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcpu)
-    .set push
-    .set noreorder
-    li $v0, __NR_getcpu
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__getcpu)
-.hidden __getcpu
diff --git a/libc/arch-mips64/syscalls/__getcwd.S b/libc/arch-mips64/syscalls/__getcwd.S
deleted file mode 100644
index 572d52d..0000000
--- a/libc/arch-mips64/syscalls/__getcwd.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcwd)
-    .set push
-    .set noreorder
-    li $v0, __NR_getcwd
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__getcwd)
-.hidden __getcwd
diff --git a/libc/arch-mips64/syscalls/__getdents64.S b/libc/arch-mips64/syscalls/__getdents64.S
deleted file mode 100644
index 9166c5f..0000000
--- a/libc/arch-mips64/syscalls/__getdents64.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getdents64)
-    .set push
-    .set noreorder
-    li $v0, __NR_getdents64
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__getdents64)
-.hidden __getdents64
diff --git a/libc/arch-mips64/syscalls/__getpid.S b/libc/arch-mips64/syscalls/__getpid.S
deleted file mode 100644
index 7344062..0000000
--- a/libc/arch-mips64/syscalls/__getpid.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpid)
-    .set push
-    .set noreorder
-    li $v0, __NR_getpid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__getpid)
-.hidden __getpid
diff --git a/libc/arch-mips64/syscalls/__getpriority.S b/libc/arch-mips64/syscalls/__getpriority.S
deleted file mode 100644
index faa386a..0000000
--- a/libc/arch-mips64/syscalls/__getpriority.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpriority)
-    .set push
-    .set noreorder
-    li $v0, __NR_getpriority
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__getpriority)
-.hidden __getpriority
diff --git a/libc/arch-mips64/syscalls/__gettimeofday.S b/libc/arch-mips64/syscalls/__gettimeofday.S
deleted file mode 100644
index 2316491..0000000
--- a/libc/arch-mips64/syscalls/__gettimeofday.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__gettimeofday)
-    .set push
-    .set noreorder
-    li $v0, __NR_gettimeofday
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__gettimeofday)
-.hidden __gettimeofday
diff --git a/libc/arch-mips64/syscalls/__ioctl.S b/libc/arch-mips64/syscalls/__ioctl.S
deleted file mode 100644
index 7193cc1..0000000
--- a/libc/arch-mips64/syscalls/__ioctl.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ioctl)
-    .set push
-    .set noreorder
-    li $v0, __NR_ioctl
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__ioctl)
-.hidden __ioctl
diff --git a/libc/arch-mips64/syscalls/__openat.S b/libc/arch-mips64/syscalls/__openat.S
deleted file mode 100644
index a1d6d2f..0000000
--- a/libc/arch-mips64/syscalls/__openat.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__openat)
-    .set push
-    .set noreorder
-    li $v0, __NR_openat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__openat)
-.hidden __openat
diff --git a/libc/arch-mips64/syscalls/__ppoll.S b/libc/arch-mips64/syscalls/__ppoll.S
deleted file mode 100644
index 5992310..0000000
--- a/libc/arch-mips64/syscalls/__ppoll.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ppoll)
-    .set push
-    .set noreorder
-    li $v0, __NR_ppoll
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__ppoll)
-.hidden __ppoll
diff --git a/libc/arch-mips64/syscalls/__pselect6.S b/libc/arch-mips64/syscalls/__pselect6.S
deleted file mode 100644
index e55eee7..0000000
--- a/libc/arch-mips64/syscalls/__pselect6.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__pselect6)
-    .set push
-    .set noreorder
-    li $v0, __NR_pselect6
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__pselect6)
-.hidden __pselect6
diff --git a/libc/arch-mips64/syscalls/__ptrace.S b/libc/arch-mips64/syscalls/__ptrace.S
deleted file mode 100644
index 842d778..0000000
--- a/libc/arch-mips64/syscalls/__ptrace.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ptrace)
-    .set push
-    .set noreorder
-    li $v0, __NR_ptrace
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__ptrace)
-.hidden __ptrace
diff --git a/libc/arch-mips64/syscalls/__reboot.S b/libc/arch-mips64/syscalls/__reboot.S
deleted file mode 100644
index 6b1ae9f..0000000
--- a/libc/arch-mips64/syscalls/__reboot.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__reboot)
-    .set push
-    .set noreorder
-    li $v0, __NR_reboot
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__reboot)
-.hidden __reboot
diff --git a/libc/arch-mips64/syscalls/__rt_sigaction.S b/libc/arch-mips64/syscalls/__rt_sigaction.S
deleted file mode 100644
index 484b482..0000000
--- a/libc/arch-mips64/syscalls/__rt_sigaction.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigaction)
-    .set push
-    .set noreorder
-    li $v0, __NR_rt_sigaction
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__rt_sigaction)
-.hidden __rt_sigaction
diff --git a/libc/arch-mips64/syscalls/__rt_sigpending.S b/libc/arch-mips64/syscalls/__rt_sigpending.S
deleted file mode 100644
index 5961578..0000000
--- a/libc/arch-mips64/syscalls/__rt_sigpending.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigpending)
-    .set push
-    .set noreorder
-    li $v0, __NR_rt_sigpending
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__rt_sigpending)
-.hidden __rt_sigpending
diff --git a/libc/arch-mips64/syscalls/__rt_sigprocmask.S b/libc/arch-mips64/syscalls/__rt_sigprocmask.S
deleted file mode 100644
index c962f66..0000000
--- a/libc/arch-mips64/syscalls/__rt_sigprocmask.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigprocmask)
-    .set push
-    .set noreorder
-    li $v0, __NR_rt_sigprocmask
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__rt_sigprocmask)
-.hidden __rt_sigprocmask
diff --git a/libc/arch-mips64/syscalls/__rt_sigsuspend.S b/libc/arch-mips64/syscalls/__rt_sigsuspend.S
deleted file mode 100644
index 7613af2..0000000
--- a/libc/arch-mips64/syscalls/__rt_sigsuspend.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigsuspend)
-    .set push
-    .set noreorder
-    li $v0, __NR_rt_sigsuspend
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__rt_sigsuspend)
-.hidden __rt_sigsuspend
diff --git a/libc/arch-mips64/syscalls/__rt_sigtimedwait.S b/libc/arch-mips64/syscalls/__rt_sigtimedwait.S
deleted file mode 100644
index 0c80a2e..0000000
--- a/libc/arch-mips64/syscalls/__rt_sigtimedwait.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigtimedwait)
-    .set push
-    .set noreorder
-    li $v0, __NR_rt_sigtimedwait
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__rt_sigtimedwait)
-.hidden __rt_sigtimedwait
diff --git a/libc/arch-mips64/syscalls/__sched_getaffinity.S b/libc/arch-mips64/syscalls/__sched_getaffinity.S
deleted file mode 100644
index 5f5dae2..0000000
--- a/libc/arch-mips64/syscalls/__sched_getaffinity.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sched_getaffinity)
-    .set push
-    .set noreorder
-    li $v0, __NR_sched_getaffinity
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__sched_getaffinity)
-.hidden __sched_getaffinity
diff --git a/libc/arch-mips64/syscalls/__set_tid_address.S b/libc/arch-mips64/syscalls/__set_tid_address.S
deleted file mode 100644
index a411701..0000000
--- a/libc/arch-mips64/syscalls/__set_tid_address.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__set_tid_address)
-    .set push
-    .set noreorder
-    li $v0, __NR_set_tid_address
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__set_tid_address)
-.hidden __set_tid_address
diff --git a/libc/arch-mips64/syscalls/__set_tls.S b/libc/arch-mips64/syscalls/__set_tls.S
deleted file mode 100644
index a72c8e3..0000000
--- a/libc/arch-mips64/syscalls/__set_tls.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__set_tls)
-    .set push
-    .set noreorder
-    li $v0, __NR_set_thread_area
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__set_tls)
-.hidden __set_tls
diff --git a/libc/arch-mips64/syscalls/__signalfd4.S b/libc/arch-mips64/syscalls/__signalfd4.S
deleted file mode 100644
index 35e2a0a..0000000
--- a/libc/arch-mips64/syscalls/__signalfd4.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__signalfd4)
-    .set push
-    .set noreorder
-    li $v0, __NR_signalfd4
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__signalfd4)
-.hidden __signalfd4
diff --git a/libc/arch-mips64/syscalls/__socket.S b/libc/arch-mips64/syscalls/__socket.S
deleted file mode 100644
index dce2031..0000000
--- a/libc/arch-mips64/syscalls/__socket.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__socket)
-    .set push
-    .set noreorder
-    li $v0, __NR_socket
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__socket)
-.hidden __socket
diff --git a/libc/arch-mips64/syscalls/__statfs.S b/libc/arch-mips64/syscalls/__statfs.S
deleted file mode 100644
index 9960fc7..0000000
--- a/libc/arch-mips64/syscalls/__statfs.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__statfs)
-    .set push
-    .set noreorder
-    li $v0, __NR_statfs
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__statfs)
-.hidden __statfs
diff --git a/libc/arch-mips64/syscalls/__sync_file_range.S b/libc/arch-mips64/syscalls/__sync_file_range.S
deleted file mode 100644
index eeb470d..0000000
--- a/libc/arch-mips64/syscalls/__sync_file_range.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sync_file_range)
-    .set push
-    .set noreorder
-    li $v0, __NR_sync_file_range
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__sync_file_range)
-.hidden __sync_file_range
diff --git a/libc/arch-mips64/syscalls/__timer_create.S b/libc/arch-mips64/syscalls/__timer_create.S
deleted file mode 100644
index 2fecc4d..0000000
--- a/libc/arch-mips64/syscalls/__timer_create.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_create)
-    .set push
-    .set noreorder
-    li $v0, __NR_timer_create
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__timer_create)
-.hidden __timer_create
diff --git a/libc/arch-mips64/syscalls/__timer_delete.S b/libc/arch-mips64/syscalls/__timer_delete.S
deleted file mode 100644
index be6ac60..0000000
--- a/libc/arch-mips64/syscalls/__timer_delete.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_delete)
-    .set push
-    .set noreorder
-    li $v0, __NR_timer_delete
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__timer_delete)
-.hidden __timer_delete
diff --git a/libc/arch-mips64/syscalls/__timer_getoverrun.S b/libc/arch-mips64/syscalls/__timer_getoverrun.S
deleted file mode 100644
index dfabba6..0000000
--- a/libc/arch-mips64/syscalls/__timer_getoverrun.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_getoverrun)
-    .set push
-    .set noreorder
-    li $v0, __NR_timer_getoverrun
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__timer_getoverrun)
-.hidden __timer_getoverrun
diff --git a/libc/arch-mips64/syscalls/__timer_gettime.S b/libc/arch-mips64/syscalls/__timer_gettime.S
deleted file mode 100644
index 49606c2..0000000
--- a/libc/arch-mips64/syscalls/__timer_gettime.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_gettime)
-    .set push
-    .set noreorder
-    li $v0, __NR_timer_gettime
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__timer_gettime)
-.hidden __timer_gettime
diff --git a/libc/arch-mips64/syscalls/__timer_settime.S b/libc/arch-mips64/syscalls/__timer_settime.S
deleted file mode 100644
index a61d92c..0000000
--- a/libc/arch-mips64/syscalls/__timer_settime.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_settime)
-    .set push
-    .set noreorder
-    li $v0, __NR_timer_settime
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__timer_settime)
-.hidden __timer_settime
diff --git a/libc/arch-mips64/syscalls/__waitid.S b/libc/arch-mips64/syscalls/__waitid.S
deleted file mode 100644
index bc4810c..0000000
--- a/libc/arch-mips64/syscalls/__waitid.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__waitid)
-    .set push
-    .set noreorder
-    li $v0, __NR_waitid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(__waitid)
-.hidden __waitid
diff --git a/libc/arch-mips64/syscalls/_exit.S b/libc/arch-mips64/syscalls/_exit.S
deleted file mode 100644
index 638fdb1..0000000
--- a/libc/arch-mips64/syscalls/_exit.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(_exit)
-    .set push
-    .set noreorder
-    li $v0, __NR_exit_group
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(_exit)
-
-ALIAS_SYMBOL(_Exit, _exit)
diff --git a/libc/arch-mips64/syscalls/acct.S b/libc/arch-mips64/syscalls/acct.S
deleted file mode 100644
index abf4c26..0000000
--- a/libc/arch-mips64/syscalls/acct.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(acct)
-    .set push
-    .set noreorder
-    li $v0, __NR_acct
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(acct)
diff --git a/libc/arch-mips64/syscalls/adjtimex.S b/libc/arch-mips64/syscalls/adjtimex.S
deleted file mode 100644
index 716f46f..0000000
--- a/libc/arch-mips64/syscalls/adjtimex.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(adjtimex)
-    .set push
-    .set noreorder
-    li $v0, __NR_adjtimex
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(adjtimex)
diff --git a/libc/arch-mips64/syscalls/bind.S b/libc/arch-mips64/syscalls/bind.S
deleted file mode 100644
index a0b43ab..0000000
--- a/libc/arch-mips64/syscalls/bind.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(bind)
-    .set push
-    .set noreorder
-    li $v0, __NR_bind
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(bind)
diff --git a/libc/arch-mips64/syscalls/capget.S b/libc/arch-mips64/syscalls/capget.S
deleted file mode 100644
index 1fd3b43..0000000
--- a/libc/arch-mips64/syscalls/capget.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capget)
-    .set push
-    .set noreorder
-    li $v0, __NR_capget
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(capget)
diff --git a/libc/arch-mips64/syscalls/capset.S b/libc/arch-mips64/syscalls/capset.S
deleted file mode 100644
index e183202..0000000
--- a/libc/arch-mips64/syscalls/capset.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capset)
-    .set push
-    .set noreorder
-    li $v0, __NR_capset
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(capset)
diff --git a/libc/arch-mips64/syscalls/chdir.S b/libc/arch-mips64/syscalls/chdir.S
deleted file mode 100644
index c4dc3b7..0000000
--- a/libc/arch-mips64/syscalls/chdir.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chdir)
-    .set push
-    .set noreorder
-    li $v0, __NR_chdir
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(chdir)
diff --git a/libc/arch-mips64/syscalls/chroot.S b/libc/arch-mips64/syscalls/chroot.S
deleted file mode 100644
index 7880087..0000000
--- a/libc/arch-mips64/syscalls/chroot.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chroot)
-    .set push
-    .set noreorder
-    li $v0, __NR_chroot
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(chroot)
diff --git a/libc/arch-mips64/syscalls/clock_adjtime.S b/libc/arch-mips64/syscalls/clock_adjtime.S
deleted file mode 100644
index 3650647..0000000
--- a/libc/arch-mips64/syscalls/clock_adjtime.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_adjtime)
-    .set push
-    .set noreorder
-    li $v0, __NR_clock_adjtime
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(clock_adjtime)
diff --git a/libc/arch-mips64/syscalls/clock_settime.S b/libc/arch-mips64/syscalls/clock_settime.S
deleted file mode 100644
index fa63bad..0000000
--- a/libc/arch-mips64/syscalls/clock_settime.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_settime)
-    .set push
-    .set noreorder
-    li $v0, __NR_clock_settime
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(clock_settime)
diff --git a/libc/arch-mips64/syscalls/delete_module.S b/libc/arch-mips64/syscalls/delete_module.S
deleted file mode 100644
index 41f0333..0000000
--- a/libc/arch-mips64/syscalls/delete_module.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(delete_module)
-    .set push
-    .set noreorder
-    li $v0, __NR_delete_module
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(delete_module)
diff --git a/libc/arch-mips64/syscalls/dup.S b/libc/arch-mips64/syscalls/dup.S
deleted file mode 100644
index b916cd5..0000000
--- a/libc/arch-mips64/syscalls/dup.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup)
-    .set push
-    .set noreorder
-    li $v0, __NR_dup
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(dup)
diff --git a/libc/arch-mips64/syscalls/dup3.S b/libc/arch-mips64/syscalls/dup3.S
deleted file mode 100644
index 975e768..0000000
--- a/libc/arch-mips64/syscalls/dup3.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup3)
-    .set push
-    .set noreorder
-    li $v0, __NR_dup3
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(dup3)
diff --git a/libc/arch-mips64/syscalls/epoll_create1.S b/libc/arch-mips64/syscalls/epoll_create1.S
deleted file mode 100644
index 2cb913a..0000000
--- a/libc/arch-mips64/syscalls/epoll_create1.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_create1)
-    .set push
-    .set noreorder
-    li $v0, __NR_epoll_create1
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(epoll_create1)
diff --git a/libc/arch-mips64/syscalls/epoll_ctl.S b/libc/arch-mips64/syscalls/epoll_ctl.S
deleted file mode 100644
index 2a8f731..0000000
--- a/libc/arch-mips64/syscalls/epoll_ctl.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_ctl)
-    .set push
-    .set noreorder
-    li $v0, __NR_epoll_ctl
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(epoll_ctl)
diff --git a/libc/arch-mips64/syscalls/eventfd.S b/libc/arch-mips64/syscalls/eventfd.S
deleted file mode 100644
index f8eaee7..0000000
--- a/libc/arch-mips64/syscalls/eventfd.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(eventfd)
-    .set push
-    .set noreorder
-    li $v0, __NR_eventfd2
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(eventfd)
diff --git a/libc/arch-mips64/syscalls/execve.S b/libc/arch-mips64/syscalls/execve.S
deleted file mode 100644
index 6f7d1d7..0000000
--- a/libc/arch-mips64/syscalls/execve.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(execve)
-    .set push
-    .set noreorder
-    li $v0, __NR_execve
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(execve)
diff --git a/libc/arch-mips64/syscalls/fallocate.S b/libc/arch-mips64/syscalls/fallocate.S
deleted file mode 100644
index 6685475..0000000
--- a/libc/arch-mips64/syscalls/fallocate.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fallocate)
-    .set push
-    .set noreorder
-    li $v0, __NR_fallocate
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(fallocate)
-
-ALIAS_SYMBOL(fallocate64, fallocate)
diff --git a/libc/arch-mips64/syscalls/fchdir.S b/libc/arch-mips64/syscalls/fchdir.S
deleted file mode 100644
index ba76746..0000000
--- a/libc/arch-mips64/syscalls/fchdir.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchdir)
-    .set push
-    .set noreorder
-    li $v0, __NR_fchdir
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(fchdir)
diff --git a/libc/arch-mips64/syscalls/fchown.S b/libc/arch-mips64/syscalls/fchown.S
deleted file mode 100644
index edbc1f1..0000000
--- a/libc/arch-mips64/syscalls/fchown.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchown)
-    .set push
-    .set noreorder
-    li $v0, __NR_fchown
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(fchown)
diff --git a/libc/arch-mips64/syscalls/fchownat.S b/libc/arch-mips64/syscalls/fchownat.S
deleted file mode 100644
index 219a32e..0000000
--- a/libc/arch-mips64/syscalls/fchownat.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchownat)
-    .set push
-    .set noreorder
-    li $v0, __NR_fchownat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(fchownat)
diff --git a/libc/arch-mips64/syscalls/fcntl.S b/libc/arch-mips64/syscalls/fcntl.S
deleted file mode 100644
index 25571f9..0000000
--- a/libc/arch-mips64/syscalls/fcntl.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fcntl)
-    .set push
-    .set noreorder
-    li $v0, __NR_fcntl
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(fcntl)
diff --git a/libc/arch-mips64/syscalls/fdatasync.S b/libc/arch-mips64/syscalls/fdatasync.S
deleted file mode 100644
index b8f21c7..0000000
--- a/libc/arch-mips64/syscalls/fdatasync.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fdatasync)
-    .set push
-    .set noreorder
-    li $v0, __NR_fdatasync
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(fdatasync)
diff --git a/libc/arch-mips64/syscalls/flock.S b/libc/arch-mips64/syscalls/flock.S
deleted file mode 100644
index 0242f98..0000000
--- a/libc/arch-mips64/syscalls/flock.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(flock)
-    .set push
-    .set noreorder
-    li $v0, __NR_flock
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(flock)
diff --git a/libc/arch-mips64/syscalls/fremovexattr.S b/libc/arch-mips64/syscalls/fremovexattr.S
deleted file mode 100644
index b328c67..0000000
--- a/libc/arch-mips64/syscalls/fremovexattr.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fremovexattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_fremovexattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(fremovexattr)
diff --git a/libc/arch-mips64/syscalls/fsync.S b/libc/arch-mips64/syscalls/fsync.S
deleted file mode 100644
index 197159f..0000000
--- a/libc/arch-mips64/syscalls/fsync.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fsync)
-    .set push
-    .set noreorder
-    li $v0, __NR_fsync
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(fsync)
diff --git a/libc/arch-mips64/syscalls/ftruncate.S b/libc/arch-mips64/syscalls/ftruncate.S
deleted file mode 100644
index 09b06fa..0000000
--- a/libc/arch-mips64/syscalls/ftruncate.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(ftruncate)
-    .set push
-    .set noreorder
-    li $v0, __NR_ftruncate
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(ftruncate)
-
-ALIAS_SYMBOL(ftruncate64, ftruncate)
diff --git a/libc/arch-mips64/syscalls/getegid.S b/libc/arch-mips64/syscalls/getegid.S
deleted file mode 100644
index 9192835..0000000
--- a/libc/arch-mips64/syscalls/getegid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getegid)
-    .set push
-    .set noreorder
-    li $v0, __NR_getegid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getegid)
diff --git a/libc/arch-mips64/syscalls/geteuid.S b/libc/arch-mips64/syscalls/geteuid.S
deleted file mode 100644
index 5a5cbf9..0000000
--- a/libc/arch-mips64/syscalls/geteuid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(geteuid)
-    .set push
-    .set noreorder
-    li $v0, __NR_geteuid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(geteuid)
diff --git a/libc/arch-mips64/syscalls/getgid.S b/libc/arch-mips64/syscalls/getgid.S
deleted file mode 100644
index c434419..0000000
--- a/libc/arch-mips64/syscalls/getgid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgid)
-    .set push
-    .set noreorder
-    li $v0, __NR_getgid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getgid)
diff --git a/libc/arch-mips64/syscalls/getgroups.S b/libc/arch-mips64/syscalls/getgroups.S
deleted file mode 100644
index 29ac854..0000000
--- a/libc/arch-mips64/syscalls/getgroups.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgroups)
-    .set push
-    .set noreorder
-    li $v0, __NR_getgroups
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getgroups)
diff --git a/libc/arch-mips64/syscalls/getitimer.S b/libc/arch-mips64/syscalls/getitimer.S
deleted file mode 100644
index 445fb1d..0000000
--- a/libc/arch-mips64/syscalls/getitimer.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getitimer)
-    .set push
-    .set noreorder
-    li $v0, __NR_getitimer
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getitimer)
diff --git a/libc/arch-mips64/syscalls/getpeername.S b/libc/arch-mips64/syscalls/getpeername.S
deleted file mode 100644
index 0f081c8..0000000
--- a/libc/arch-mips64/syscalls/getpeername.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpeername)
-    .set push
-    .set noreorder
-    li $v0, __NR_getpeername
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getpeername)
diff --git a/libc/arch-mips64/syscalls/getpgid.S b/libc/arch-mips64/syscalls/getpgid.S
deleted file mode 100644
index 7859ad4..0000000
--- a/libc/arch-mips64/syscalls/getpgid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpgid)
-    .set push
-    .set noreorder
-    li $v0, __NR_getpgid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getpgid)
diff --git a/libc/arch-mips64/syscalls/getppid.S b/libc/arch-mips64/syscalls/getppid.S
deleted file mode 100644
index c67ed1f..0000000
--- a/libc/arch-mips64/syscalls/getppid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getppid)
-    .set push
-    .set noreorder
-    li $v0, __NR_getppid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getppid)
diff --git a/libc/arch-mips64/syscalls/getrandom.S b/libc/arch-mips64/syscalls/getrandom.S
deleted file mode 100644
index b4f5ea8..0000000
--- a/libc/arch-mips64/syscalls/getrandom.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrandom)
-    .set push
-    .set noreorder
-    li $v0, __NR_getrandom
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getrandom)
diff --git a/libc/arch-mips64/syscalls/getresgid.S b/libc/arch-mips64/syscalls/getresgid.S
deleted file mode 100644
index ba1aafe..0000000
--- a/libc/arch-mips64/syscalls/getresgid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresgid)
-    .set push
-    .set noreorder
-    li $v0, __NR_getresgid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getresgid)
diff --git a/libc/arch-mips64/syscalls/getresuid.S b/libc/arch-mips64/syscalls/getresuid.S
deleted file mode 100644
index d9c40f9..0000000
--- a/libc/arch-mips64/syscalls/getresuid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresuid)
-    .set push
-    .set noreorder
-    li $v0, __NR_getresuid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getresuid)
diff --git a/libc/arch-mips64/syscalls/getrlimit.S b/libc/arch-mips64/syscalls/getrlimit.S
deleted file mode 100644
index ae1cc86..0000000
--- a/libc/arch-mips64/syscalls/getrlimit.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrlimit)
-    .set push
-    .set noreorder
-    li $v0, __NR_getrlimit
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getrlimit)
-
-ALIAS_SYMBOL(getrlimit64, getrlimit)
diff --git a/libc/arch-mips64/syscalls/getrusage.S b/libc/arch-mips64/syscalls/getrusage.S
deleted file mode 100644
index 4c6d3f1..0000000
--- a/libc/arch-mips64/syscalls/getrusage.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrusage)
-    .set push
-    .set noreorder
-    li $v0, __NR_getrusage
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getrusage)
diff --git a/libc/arch-mips64/syscalls/getsid.S b/libc/arch-mips64/syscalls/getsid.S
deleted file mode 100644
index 6a7b844..0000000
--- a/libc/arch-mips64/syscalls/getsid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsid)
-    .set push
-    .set noreorder
-    li $v0, __NR_getsid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getsid)
diff --git a/libc/arch-mips64/syscalls/getsockname.S b/libc/arch-mips64/syscalls/getsockname.S
deleted file mode 100644
index 742c496..0000000
--- a/libc/arch-mips64/syscalls/getsockname.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockname)
-    .set push
-    .set noreorder
-    li $v0, __NR_getsockname
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getsockname)
diff --git a/libc/arch-mips64/syscalls/getsockopt.S b/libc/arch-mips64/syscalls/getsockopt.S
deleted file mode 100644
index 451006e..0000000
--- a/libc/arch-mips64/syscalls/getsockopt.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockopt)
-    .set push
-    .set noreorder
-    li $v0, __NR_getsockopt
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getsockopt)
diff --git a/libc/arch-mips64/syscalls/getuid.S b/libc/arch-mips64/syscalls/getuid.S
deleted file mode 100644
index 964d5a6..0000000
--- a/libc/arch-mips64/syscalls/getuid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getuid)
-    .set push
-    .set noreorder
-    li $v0, __NR_getuid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getuid)
diff --git a/libc/arch-mips64/syscalls/getxattr.S b/libc/arch-mips64/syscalls/getxattr.S
deleted file mode 100644
index 23fc3d1..0000000
--- a/libc/arch-mips64/syscalls/getxattr.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getxattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_getxattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(getxattr)
diff --git a/libc/arch-mips64/syscalls/init_module.S b/libc/arch-mips64/syscalls/init_module.S
deleted file mode 100644
index 3b02055..0000000
--- a/libc/arch-mips64/syscalls/init_module.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(init_module)
-    .set push
-    .set noreorder
-    li $v0, __NR_init_module
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(init_module)
diff --git a/libc/arch-mips64/syscalls/inotify_add_watch.S b/libc/arch-mips64/syscalls/inotify_add_watch.S
deleted file mode 100644
index 583b8bb..0000000
--- a/libc/arch-mips64/syscalls/inotify_add_watch.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_add_watch)
-    .set push
-    .set noreorder
-    li $v0, __NR_inotify_add_watch
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(inotify_add_watch)
diff --git a/libc/arch-mips64/syscalls/inotify_init1.S b/libc/arch-mips64/syscalls/inotify_init1.S
deleted file mode 100644
index 5ccb9af..0000000
--- a/libc/arch-mips64/syscalls/inotify_init1.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_init1)
-    .set push
-    .set noreorder
-    li $v0, __NR_inotify_init1
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(inotify_init1)
diff --git a/libc/arch-mips64/syscalls/inotify_rm_watch.S b/libc/arch-mips64/syscalls/inotify_rm_watch.S
deleted file mode 100644
index 7f18c0f..0000000
--- a/libc/arch-mips64/syscalls/inotify_rm_watch.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_rm_watch)
-    .set push
-    .set noreorder
-    li $v0, __NR_inotify_rm_watch
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(inotify_rm_watch)
diff --git a/libc/arch-mips64/syscalls/kill.S b/libc/arch-mips64/syscalls/kill.S
deleted file mode 100644
index dcc440b..0000000
--- a/libc/arch-mips64/syscalls/kill.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(kill)
-    .set push
-    .set noreorder
-    li $v0, __NR_kill
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(kill)
diff --git a/libc/arch-mips64/syscalls/klogctl.S b/libc/arch-mips64/syscalls/klogctl.S
deleted file mode 100644
index 62af663..0000000
--- a/libc/arch-mips64/syscalls/klogctl.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(klogctl)
-    .set push
-    .set noreorder
-    li $v0, __NR_syslog
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(klogctl)
diff --git a/libc/arch-mips64/syscalls/lgetxattr.S b/libc/arch-mips64/syscalls/lgetxattr.S
deleted file mode 100644
index 20e3134..0000000
--- a/libc/arch-mips64/syscalls/lgetxattr.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lgetxattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_lgetxattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(lgetxattr)
diff --git a/libc/arch-mips64/syscalls/linkat.S b/libc/arch-mips64/syscalls/linkat.S
deleted file mode 100644
index 425c417..0000000
--- a/libc/arch-mips64/syscalls/linkat.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(linkat)
-    .set push
-    .set noreorder
-    li $v0, __NR_linkat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(linkat)
diff --git a/libc/arch-mips64/syscalls/listen.S b/libc/arch-mips64/syscalls/listen.S
deleted file mode 100644
index 8263ec3..0000000
--- a/libc/arch-mips64/syscalls/listen.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listen)
-    .set push
-    .set noreorder
-    li $v0, __NR_listen
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(listen)
diff --git a/libc/arch-mips64/syscalls/listxattr.S b/libc/arch-mips64/syscalls/listxattr.S
deleted file mode 100644
index 5f04ffc..0000000
--- a/libc/arch-mips64/syscalls/listxattr.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listxattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_listxattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(listxattr)
diff --git a/libc/arch-mips64/syscalls/llistxattr.S b/libc/arch-mips64/syscalls/llistxattr.S
deleted file mode 100644
index 9663fd9..0000000
--- a/libc/arch-mips64/syscalls/llistxattr.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(llistxattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_llistxattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(llistxattr)
diff --git a/libc/arch-mips64/syscalls/lremovexattr.S b/libc/arch-mips64/syscalls/lremovexattr.S
deleted file mode 100644
index 905548a..0000000
--- a/libc/arch-mips64/syscalls/lremovexattr.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lremovexattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_lremovexattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(lremovexattr)
diff --git a/libc/arch-mips64/syscalls/lseek.S b/libc/arch-mips64/syscalls/lseek.S
deleted file mode 100644
index 1eee1fa..0000000
--- a/libc/arch-mips64/syscalls/lseek.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lseek)
-    .set push
-    .set noreorder
-    li $v0, __NR_lseek
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(lseek)
-
-ALIAS_SYMBOL(lseek64, lseek)
diff --git a/libc/arch-mips64/syscalls/lsetxattr.S b/libc/arch-mips64/syscalls/lsetxattr.S
deleted file mode 100644
index 38e3523..0000000
--- a/libc/arch-mips64/syscalls/lsetxattr.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lsetxattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_lsetxattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(lsetxattr)
diff --git a/libc/arch-mips64/syscalls/madvise.S b/libc/arch-mips64/syscalls/madvise.S
deleted file mode 100644
index 5283700..0000000
--- a/libc/arch-mips64/syscalls/madvise.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(madvise)
-    .set push
-    .set noreorder
-    li $v0, __NR_madvise
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(madvise)
diff --git a/libc/arch-mips64/syscalls/mincore.S b/libc/arch-mips64/syscalls/mincore.S
deleted file mode 100644
index c7f419a..0000000
--- a/libc/arch-mips64/syscalls/mincore.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mincore)
-    .set push
-    .set noreorder
-    li $v0, __NR_mincore
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(mincore)
diff --git a/libc/arch-mips64/syscalls/mkdirat.S b/libc/arch-mips64/syscalls/mkdirat.S
deleted file mode 100644
index 2e1a45b..0000000
--- a/libc/arch-mips64/syscalls/mkdirat.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mkdirat)
-    .set push
-    .set noreorder
-    li $v0, __NR_mkdirat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(mkdirat)
diff --git a/libc/arch-mips64/syscalls/mknodat.S b/libc/arch-mips64/syscalls/mknodat.S
deleted file mode 100644
index 42d73c4..0000000
--- a/libc/arch-mips64/syscalls/mknodat.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mknodat)
-    .set push
-    .set noreorder
-    li $v0, __NR_mknodat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(mknodat)
diff --git a/libc/arch-mips64/syscalls/mlock.S b/libc/arch-mips64/syscalls/mlock.S
deleted file mode 100644
index dd6b784..0000000
--- a/libc/arch-mips64/syscalls/mlock.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlock)
-    .set push
-    .set noreorder
-    li $v0, __NR_mlock
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(mlock)
diff --git a/libc/arch-mips64/syscalls/mlockall.S b/libc/arch-mips64/syscalls/mlockall.S
deleted file mode 100644
index a4debce..0000000
--- a/libc/arch-mips64/syscalls/mlockall.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlockall)
-    .set push
-    .set noreorder
-    li $v0, __NR_mlockall
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(mlockall)
diff --git a/libc/arch-mips64/syscalls/mmap.S b/libc/arch-mips64/syscalls/mmap.S
deleted file mode 100644
index e380c72..0000000
--- a/libc/arch-mips64/syscalls/mmap.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mmap)
-    .set push
-    .set noreorder
-    li $v0, __NR_mmap
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(mmap)
-
-ALIAS_SYMBOL(mmap64, mmap)
diff --git a/libc/arch-mips64/syscalls/mount.S b/libc/arch-mips64/syscalls/mount.S
deleted file mode 100644
index 4d2bca1..0000000
--- a/libc/arch-mips64/syscalls/mount.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mount)
-    .set push
-    .set noreorder
-    li $v0, __NR_mount
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(mount)
diff --git a/libc/arch-mips64/syscalls/mprotect.S b/libc/arch-mips64/syscalls/mprotect.S
deleted file mode 100644
index e1f3ab0..0000000
--- a/libc/arch-mips64/syscalls/mprotect.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mprotect)
-    .set push
-    .set noreorder
-    li $v0, __NR_mprotect
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(mprotect)
diff --git a/libc/arch-mips64/syscalls/msync.S b/libc/arch-mips64/syscalls/msync.S
deleted file mode 100644
index ec2d175..0000000
--- a/libc/arch-mips64/syscalls/msync.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(msync)
-    .set push
-    .set noreorder
-    li $v0, __NR_msync
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(msync)
diff --git a/libc/arch-mips64/syscalls/munlock.S b/libc/arch-mips64/syscalls/munlock.S
deleted file mode 100644
index 95c4df1..0000000
--- a/libc/arch-mips64/syscalls/munlock.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlock)
-    .set push
-    .set noreorder
-    li $v0, __NR_munlock
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(munlock)
diff --git a/libc/arch-mips64/syscalls/munlockall.S b/libc/arch-mips64/syscalls/munlockall.S
deleted file mode 100644
index 9862461..0000000
--- a/libc/arch-mips64/syscalls/munlockall.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlockall)
-    .set push
-    .set noreorder
-    li $v0, __NR_munlockall
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(munlockall)
diff --git a/libc/arch-mips64/syscalls/munmap.S b/libc/arch-mips64/syscalls/munmap.S
deleted file mode 100644
index 2ca802d..0000000
--- a/libc/arch-mips64/syscalls/munmap.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munmap)
-    .set push
-    .set noreorder
-    li $v0, __NR_munmap
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(munmap)
diff --git a/libc/arch-mips64/syscalls/nanosleep.S b/libc/arch-mips64/syscalls/nanosleep.S
deleted file mode 100644
index 291bb00..0000000
--- a/libc/arch-mips64/syscalls/nanosleep.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(nanosleep)
-    .set push
-    .set noreorder
-    li $v0, __NR_nanosleep
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(nanosleep)
diff --git a/libc/arch-mips64/syscalls/personality.S b/libc/arch-mips64/syscalls/personality.S
deleted file mode 100644
index a85cd76..0000000
--- a/libc/arch-mips64/syscalls/personality.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(personality)
-    .set push
-    .set noreorder
-    li $v0, __NR_personality
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(personality)
diff --git a/libc/arch-mips64/syscalls/pipe2.S b/libc/arch-mips64/syscalls/pipe2.S
deleted file mode 100644
index 96e25e2..0000000
--- a/libc/arch-mips64/syscalls/pipe2.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pipe2)
-    .set push
-    .set noreorder
-    li $v0, __NR_pipe2
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(pipe2)
diff --git a/libc/arch-mips64/syscalls/prctl.S b/libc/arch-mips64/syscalls/prctl.S
deleted file mode 100644
index 14b7155..0000000
--- a/libc/arch-mips64/syscalls/prctl.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prctl)
-    .set push
-    .set noreorder
-    li $v0, __NR_prctl
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(prctl)
diff --git a/libc/arch-mips64/syscalls/pread64.S b/libc/arch-mips64/syscalls/pread64.S
deleted file mode 100644
index 74dada3..0000000
--- a/libc/arch-mips64/syscalls/pread64.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pread64)
-    .set push
-    .set noreorder
-    li $v0, __NR_pread64
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(pread64)
-
-ALIAS_SYMBOL(pread, pread64)
diff --git a/libc/arch-mips64/syscalls/preadv.S b/libc/arch-mips64/syscalls/preadv.S
deleted file mode 100644
index 744b06c..0000000
--- a/libc/arch-mips64/syscalls/preadv.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(preadv)
-    .set push
-    .set noreorder
-    li $v0, __NR_preadv
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(preadv)
-
-ALIAS_SYMBOL(preadv64, preadv)
diff --git a/libc/arch-mips64/syscalls/prlimit64.S b/libc/arch-mips64/syscalls/prlimit64.S
deleted file mode 100644
index c60cf8e..0000000
--- a/libc/arch-mips64/syscalls/prlimit64.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prlimit64)
-    .set push
-    .set noreorder
-    li $v0, __NR_prlimit64
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(prlimit64)
-
-ALIAS_SYMBOL(prlimit, prlimit64)
diff --git a/libc/arch-mips64/syscalls/process_vm_readv.S b/libc/arch-mips64/syscalls/process_vm_readv.S
deleted file mode 100644
index 38ff7eb..0000000
--- a/libc/arch-mips64/syscalls/process_vm_readv.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_readv)
-    .set push
-    .set noreorder
-    li $v0, __NR_process_vm_readv
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(process_vm_readv)
diff --git a/libc/arch-mips64/syscalls/process_vm_writev.S b/libc/arch-mips64/syscalls/process_vm_writev.S
deleted file mode 100644
index c317cae..0000000
--- a/libc/arch-mips64/syscalls/process_vm_writev.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_writev)
-    .set push
-    .set noreorder
-    li $v0, __NR_process_vm_writev
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(process_vm_writev)
diff --git a/libc/arch-mips64/syscalls/pwrite64.S b/libc/arch-mips64/syscalls/pwrite64.S
deleted file mode 100644
index 1d6ac69..0000000
--- a/libc/arch-mips64/syscalls/pwrite64.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pwrite64)
-    .set push
-    .set noreorder
-    li $v0, __NR_pwrite64
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(pwrite64)
-
-ALIAS_SYMBOL(pwrite, pwrite64)
diff --git a/libc/arch-mips64/syscalls/pwritev.S b/libc/arch-mips64/syscalls/pwritev.S
deleted file mode 100644
index f3044f9..0000000
--- a/libc/arch-mips64/syscalls/pwritev.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pwritev)
-    .set push
-    .set noreorder
-    li $v0, __NR_pwritev
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(pwritev)
-
-ALIAS_SYMBOL(pwritev64, pwritev)
diff --git a/libc/arch-mips64/syscalls/quotactl.S b/libc/arch-mips64/syscalls/quotactl.S
deleted file mode 100644
index 83735ac..0000000
--- a/libc/arch-mips64/syscalls/quotactl.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(quotactl)
-    .set push
-    .set noreorder
-    li $v0, __NR_quotactl
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(quotactl)
diff --git a/libc/arch-mips64/syscalls/read.S b/libc/arch-mips64/syscalls/read.S
deleted file mode 100644
index b44e6af..0000000
--- a/libc/arch-mips64/syscalls/read.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(read)
-    .set push
-    .set noreorder
-    li $v0, __NR_read
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(read)
diff --git a/libc/arch-mips64/syscalls/readahead.S b/libc/arch-mips64/syscalls/readahead.S
deleted file mode 100644
index f111ac4..0000000
--- a/libc/arch-mips64/syscalls/readahead.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readahead)
-    .set push
-    .set noreorder
-    li $v0, __NR_readahead
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(readahead)
diff --git a/libc/arch-mips64/syscalls/readlinkat.S b/libc/arch-mips64/syscalls/readlinkat.S
deleted file mode 100644
index 987943b..0000000
--- a/libc/arch-mips64/syscalls/readlinkat.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readlinkat)
-    .set push
-    .set noreorder
-    li $v0, __NR_readlinkat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(readlinkat)
diff --git a/libc/arch-mips64/syscalls/readv.S b/libc/arch-mips64/syscalls/readv.S
deleted file mode 100644
index 04bf55c..0000000
--- a/libc/arch-mips64/syscalls/readv.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readv)
-    .set push
-    .set noreorder
-    li $v0, __NR_readv
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(readv)
diff --git a/libc/arch-mips64/syscalls/recvfrom.S b/libc/arch-mips64/syscalls/recvfrom.S
deleted file mode 100644
index 7c906ac..0000000
--- a/libc/arch-mips64/syscalls/recvfrom.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvfrom)
-    .set push
-    .set noreorder
-    li $v0, __NR_recvfrom
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(recvfrom)
diff --git a/libc/arch-mips64/syscalls/recvmmsg.S b/libc/arch-mips64/syscalls/recvmmsg.S
deleted file mode 100644
index 0c022cb..0000000
--- a/libc/arch-mips64/syscalls/recvmmsg.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmmsg)
-    .set push
-    .set noreorder
-    li $v0, __NR_recvmmsg
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(recvmmsg)
diff --git a/libc/arch-mips64/syscalls/recvmsg.S b/libc/arch-mips64/syscalls/recvmsg.S
deleted file mode 100644
index a06bcdd..0000000
--- a/libc/arch-mips64/syscalls/recvmsg.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmsg)
-    .set push
-    .set noreorder
-    li $v0, __NR_recvmsg
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(recvmsg)
diff --git a/libc/arch-mips64/syscalls/removexattr.S b/libc/arch-mips64/syscalls/removexattr.S
deleted file mode 100644
index fb5d8de..0000000
--- a/libc/arch-mips64/syscalls/removexattr.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(removexattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_removexattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(removexattr)
diff --git a/libc/arch-mips64/syscalls/renameat.S b/libc/arch-mips64/syscalls/renameat.S
deleted file mode 100644
index 9a8ab45..0000000
--- a/libc/arch-mips64/syscalls/renameat.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(renameat)
-    .set push
-    .set noreorder
-    li $v0, __NR_renameat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(renameat)
diff --git a/libc/arch-mips64/syscalls/sched_get_priority_max.S b/libc/arch-mips64/syscalls/sched_get_priority_max.S
deleted file mode 100644
index 89b3649..0000000
--- a/libc/arch-mips64/syscalls/sched_get_priority_max.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_max)
-    .set push
-    .set noreorder
-    li $v0, __NR_sched_get_priority_max
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sched_get_priority_max)
diff --git a/libc/arch-mips64/syscalls/sched_get_priority_min.S b/libc/arch-mips64/syscalls/sched_get_priority_min.S
deleted file mode 100644
index 31c162d..0000000
--- a/libc/arch-mips64/syscalls/sched_get_priority_min.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_min)
-    .set push
-    .set noreorder
-    li $v0, __NR_sched_get_priority_min
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sched_get_priority_min)
diff --git a/libc/arch-mips64/syscalls/sched_getparam.S b/libc/arch-mips64/syscalls/sched_getparam.S
deleted file mode 100644
index a15aaf5..0000000
--- a/libc/arch-mips64/syscalls/sched_getparam.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getparam)
-    .set push
-    .set noreorder
-    li $v0, __NR_sched_getparam
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sched_getparam)
diff --git a/libc/arch-mips64/syscalls/sched_getscheduler.S b/libc/arch-mips64/syscalls/sched_getscheduler.S
deleted file mode 100644
index 0e48a16..0000000
--- a/libc/arch-mips64/syscalls/sched_getscheduler.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getscheduler)
-    .set push
-    .set noreorder
-    li $v0, __NR_sched_getscheduler
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sched_getscheduler)
diff --git a/libc/arch-mips64/syscalls/sched_rr_get_interval.S b/libc/arch-mips64/syscalls/sched_rr_get_interval.S
deleted file mode 100644
index 8ee4fe7..0000000
--- a/libc/arch-mips64/syscalls/sched_rr_get_interval.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_rr_get_interval)
-    .set push
-    .set noreorder
-    li $v0, __NR_sched_rr_get_interval
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sched_rr_get_interval)
diff --git a/libc/arch-mips64/syscalls/sched_setaffinity.S b/libc/arch-mips64/syscalls/sched_setaffinity.S
deleted file mode 100644
index a5056b4..0000000
--- a/libc/arch-mips64/syscalls/sched_setaffinity.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setaffinity)
-    .set push
-    .set noreorder
-    li $v0, __NR_sched_setaffinity
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sched_setaffinity)
diff --git a/libc/arch-mips64/syscalls/sched_setparam.S b/libc/arch-mips64/syscalls/sched_setparam.S
deleted file mode 100644
index def1e4e..0000000
--- a/libc/arch-mips64/syscalls/sched_setparam.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setparam)
-    .set push
-    .set noreorder
-    li $v0, __NR_sched_setparam
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sched_setparam)
diff --git a/libc/arch-mips64/syscalls/sched_setscheduler.S b/libc/arch-mips64/syscalls/sched_setscheduler.S
deleted file mode 100644
index 0178541..0000000
--- a/libc/arch-mips64/syscalls/sched_setscheduler.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setscheduler)
-    .set push
-    .set noreorder
-    li $v0, __NR_sched_setscheduler
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sched_setscheduler)
diff --git a/libc/arch-mips64/syscalls/sched_yield.S b/libc/arch-mips64/syscalls/sched_yield.S
deleted file mode 100644
index f69ac3c..0000000
--- a/libc/arch-mips64/syscalls/sched_yield.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_yield)
-    .set push
-    .set noreorder
-    li $v0, __NR_sched_yield
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sched_yield)
diff --git a/libc/arch-mips64/syscalls/sendfile.S b/libc/arch-mips64/syscalls/sendfile.S
deleted file mode 100644
index b4d3994..0000000
--- a/libc/arch-mips64/syscalls/sendfile.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendfile)
-    .set push
-    .set noreorder
-    li $v0, __NR_sendfile
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sendfile)
-
-ALIAS_SYMBOL(sendfile64, sendfile)
diff --git a/libc/arch-mips64/syscalls/sendmmsg.S b/libc/arch-mips64/syscalls/sendmmsg.S
deleted file mode 100644
index 2ecd7ef..0000000
--- a/libc/arch-mips64/syscalls/sendmmsg.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmmsg)
-    .set push
-    .set noreorder
-    li $v0, __NR_sendmmsg
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sendmmsg)
diff --git a/libc/arch-mips64/syscalls/sendmsg.S b/libc/arch-mips64/syscalls/sendmsg.S
deleted file mode 100644
index d4f9735..0000000
--- a/libc/arch-mips64/syscalls/sendmsg.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmsg)
-    .set push
-    .set noreorder
-    li $v0, __NR_sendmsg
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sendmsg)
diff --git a/libc/arch-mips64/syscalls/sendto.S b/libc/arch-mips64/syscalls/sendto.S
deleted file mode 100644
index e10abd5..0000000
--- a/libc/arch-mips64/syscalls/sendto.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendto)
-    .set push
-    .set noreorder
-    li $v0, __NR_sendto
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sendto)
diff --git a/libc/arch-mips64/syscalls/setdomainname.S b/libc/arch-mips64/syscalls/setdomainname.S
deleted file mode 100644
index 5e6b7c0..0000000
--- a/libc/arch-mips64/syscalls/setdomainname.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setdomainname)
-    .set push
-    .set noreorder
-    li $v0, __NR_setdomainname
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setdomainname)
diff --git a/libc/arch-mips64/syscalls/setfsgid.S b/libc/arch-mips64/syscalls/setfsgid.S
deleted file mode 100644
index 05d9681..0000000
--- a/libc/arch-mips64/syscalls/setfsgid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsgid)
-    .set push
-    .set noreorder
-    li $v0, __NR_setfsgid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setfsgid)
diff --git a/libc/arch-mips64/syscalls/setfsuid.S b/libc/arch-mips64/syscalls/setfsuid.S
deleted file mode 100644
index 8097b77..0000000
--- a/libc/arch-mips64/syscalls/setfsuid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsuid)
-    .set push
-    .set noreorder
-    li $v0, __NR_setfsuid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setfsuid)
diff --git a/libc/arch-mips64/syscalls/setgid.S b/libc/arch-mips64/syscalls/setgid.S
deleted file mode 100644
index 7ba4874..0000000
--- a/libc/arch-mips64/syscalls/setgid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgid)
-    .set push
-    .set noreorder
-    li $v0, __NR_setgid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setgid)
diff --git a/libc/arch-mips64/syscalls/setgroups.S b/libc/arch-mips64/syscalls/setgroups.S
deleted file mode 100644
index f482d0d..0000000
--- a/libc/arch-mips64/syscalls/setgroups.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgroups)
-    .set push
-    .set noreorder
-    li $v0, __NR_setgroups
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setgroups)
diff --git a/libc/arch-mips64/syscalls/sethostname.S b/libc/arch-mips64/syscalls/sethostname.S
deleted file mode 100644
index 651df0e..0000000
--- a/libc/arch-mips64/syscalls/sethostname.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sethostname)
-    .set push
-    .set noreorder
-    li $v0, __NR_sethostname
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sethostname)
diff --git a/libc/arch-mips64/syscalls/setitimer.S b/libc/arch-mips64/syscalls/setitimer.S
deleted file mode 100644
index 35c2bda..0000000
--- a/libc/arch-mips64/syscalls/setitimer.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setitimer)
-    .set push
-    .set noreorder
-    li $v0, __NR_setitimer
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setitimer)
diff --git a/libc/arch-mips64/syscalls/setns.S b/libc/arch-mips64/syscalls/setns.S
deleted file mode 100644
index d640545..0000000
--- a/libc/arch-mips64/syscalls/setns.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setns)
-    .set push
-    .set noreorder
-    li $v0, __NR_setns
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setns)
diff --git a/libc/arch-mips64/syscalls/setpgid.S b/libc/arch-mips64/syscalls/setpgid.S
deleted file mode 100644
index 8c5f71e..0000000
--- a/libc/arch-mips64/syscalls/setpgid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpgid)
-    .set push
-    .set noreorder
-    li $v0, __NR_setpgid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setpgid)
diff --git a/libc/arch-mips64/syscalls/setpriority.S b/libc/arch-mips64/syscalls/setpriority.S
deleted file mode 100644
index 5777a0c..0000000
--- a/libc/arch-mips64/syscalls/setpriority.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpriority)
-    .set push
-    .set noreorder
-    li $v0, __NR_setpriority
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setpriority)
diff --git a/libc/arch-mips64/syscalls/setregid.S b/libc/arch-mips64/syscalls/setregid.S
deleted file mode 100644
index 03be155..0000000
--- a/libc/arch-mips64/syscalls/setregid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setregid)
-    .set push
-    .set noreorder
-    li $v0, __NR_setregid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setregid)
diff --git a/libc/arch-mips64/syscalls/setresgid.S b/libc/arch-mips64/syscalls/setresgid.S
deleted file mode 100644
index 555e925..0000000
--- a/libc/arch-mips64/syscalls/setresgid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresgid)
-    .set push
-    .set noreorder
-    li $v0, __NR_setresgid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setresgid)
diff --git a/libc/arch-mips64/syscalls/setresuid.S b/libc/arch-mips64/syscalls/setresuid.S
deleted file mode 100644
index 6884f38..0000000
--- a/libc/arch-mips64/syscalls/setresuid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresuid)
-    .set push
-    .set noreorder
-    li $v0, __NR_setresuid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setresuid)
diff --git a/libc/arch-mips64/syscalls/setreuid.S b/libc/arch-mips64/syscalls/setreuid.S
deleted file mode 100644
index 4163765..0000000
--- a/libc/arch-mips64/syscalls/setreuid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setreuid)
-    .set push
-    .set noreorder
-    li $v0, __NR_setreuid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setreuid)
diff --git a/libc/arch-mips64/syscalls/setrlimit.S b/libc/arch-mips64/syscalls/setrlimit.S
deleted file mode 100644
index 5cc8a52..0000000
--- a/libc/arch-mips64/syscalls/setrlimit.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setrlimit)
-    .set push
-    .set noreorder
-    li $v0, __NR_setrlimit
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setrlimit)
-
-ALIAS_SYMBOL(setrlimit64, setrlimit)
diff --git a/libc/arch-mips64/syscalls/setsid.S b/libc/arch-mips64/syscalls/setsid.S
deleted file mode 100644
index 5422096..0000000
--- a/libc/arch-mips64/syscalls/setsid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsid)
-    .set push
-    .set noreorder
-    li $v0, __NR_setsid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setsid)
diff --git a/libc/arch-mips64/syscalls/setsockopt.S b/libc/arch-mips64/syscalls/setsockopt.S
deleted file mode 100644
index 8c3ce62..0000000
--- a/libc/arch-mips64/syscalls/setsockopt.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsockopt)
-    .set push
-    .set noreorder
-    li $v0, __NR_setsockopt
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setsockopt)
diff --git a/libc/arch-mips64/syscalls/settimeofday.S b/libc/arch-mips64/syscalls/settimeofday.S
deleted file mode 100644
index 9723dee..0000000
--- a/libc/arch-mips64/syscalls/settimeofday.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(settimeofday)
-    .set push
-    .set noreorder
-    li $v0, __NR_settimeofday
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(settimeofday)
diff --git a/libc/arch-mips64/syscalls/setuid.S b/libc/arch-mips64/syscalls/setuid.S
deleted file mode 100644
index 4ed7a7c..0000000
--- a/libc/arch-mips64/syscalls/setuid.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setuid)
-    .set push
-    .set noreorder
-    li $v0, __NR_setuid
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setuid)
diff --git a/libc/arch-mips64/syscalls/setxattr.S b/libc/arch-mips64/syscalls/setxattr.S
deleted file mode 100644
index d837b5e..0000000
--- a/libc/arch-mips64/syscalls/setxattr.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setxattr)
-    .set push
-    .set noreorder
-    li $v0, __NR_setxattr
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(setxattr)
diff --git a/libc/arch-mips64/syscalls/shutdown.S b/libc/arch-mips64/syscalls/shutdown.S
deleted file mode 100644
index 3a616bd..0000000
--- a/libc/arch-mips64/syscalls/shutdown.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(shutdown)
-    .set push
-    .set noreorder
-    li $v0, __NR_shutdown
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(shutdown)
diff --git a/libc/arch-mips64/syscalls/sigaltstack.S b/libc/arch-mips64/syscalls/sigaltstack.S
deleted file mode 100644
index 13b539b..0000000
--- a/libc/arch-mips64/syscalls/sigaltstack.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sigaltstack)
-    .set push
-    .set noreorder
-    li $v0, __NR_sigaltstack
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sigaltstack)
diff --git a/libc/arch-mips64/syscalls/socketpair.S b/libc/arch-mips64/syscalls/socketpair.S
deleted file mode 100644
index b95dabd..0000000
--- a/libc/arch-mips64/syscalls/socketpair.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(socketpair)
-    .set push
-    .set noreorder
-    li $v0, __NR_socketpair
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(socketpair)
diff --git a/libc/arch-mips64/syscalls/splice.S b/libc/arch-mips64/syscalls/splice.S
deleted file mode 100644
index 9eae4d0..0000000
--- a/libc/arch-mips64/syscalls/splice.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(splice)
-    .set push
-    .set noreorder
-    li $v0, __NR_splice
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(splice)
diff --git a/libc/arch-mips64/syscalls/swapoff.S b/libc/arch-mips64/syscalls/swapoff.S
deleted file mode 100644
index c70d1bc..0000000
--- a/libc/arch-mips64/syscalls/swapoff.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapoff)
-    .set push
-    .set noreorder
-    li $v0, __NR_swapoff
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(swapoff)
diff --git a/libc/arch-mips64/syscalls/swapon.S b/libc/arch-mips64/syscalls/swapon.S
deleted file mode 100644
index 879c68e..0000000
--- a/libc/arch-mips64/syscalls/swapon.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapon)
-    .set push
-    .set noreorder
-    li $v0, __NR_swapon
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(swapon)
diff --git a/libc/arch-mips64/syscalls/symlinkat.S b/libc/arch-mips64/syscalls/symlinkat.S
deleted file mode 100644
index 2483993..0000000
--- a/libc/arch-mips64/syscalls/symlinkat.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(symlinkat)
-    .set push
-    .set noreorder
-    li $v0, __NR_symlinkat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(symlinkat)
diff --git a/libc/arch-mips64/syscalls/sync.S b/libc/arch-mips64/syscalls/sync.S
deleted file mode 100644
index 61cc1a3..0000000
--- a/libc/arch-mips64/syscalls/sync.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sync)
-    .set push
-    .set noreorder
-    li $v0, __NR_sync
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sync)
diff --git a/libc/arch-mips64/syscalls/syncfs.S b/libc/arch-mips64/syscalls/syncfs.S
deleted file mode 100644
index 8eb2501..0000000
--- a/libc/arch-mips64/syscalls/syncfs.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(syncfs)
-    .set push
-    .set noreorder
-    li $v0, __NR_syncfs
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(syncfs)
diff --git a/libc/arch-mips64/syscalls/sysinfo.S b/libc/arch-mips64/syscalls/sysinfo.S
deleted file mode 100644
index 2c7acc7..0000000
--- a/libc/arch-mips64/syscalls/sysinfo.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sysinfo)
-    .set push
-    .set noreorder
-    li $v0, __NR_sysinfo
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(sysinfo)
diff --git a/libc/arch-mips64/syscalls/tee.S b/libc/arch-mips64/syscalls/tee.S
deleted file mode 100644
index cd60f0b..0000000
--- a/libc/arch-mips64/syscalls/tee.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tee)
-    .set push
-    .set noreorder
-    li $v0, __NR_tee
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(tee)
diff --git a/libc/arch-mips64/syscalls/tgkill.S b/libc/arch-mips64/syscalls/tgkill.S
deleted file mode 100644
index 86d7d4b..0000000
--- a/libc/arch-mips64/syscalls/tgkill.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tgkill)
-    .set push
-    .set noreorder
-    li $v0, __NR_tgkill
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(tgkill)
diff --git a/libc/arch-mips64/syscalls/timerfd_create.S b/libc/arch-mips64/syscalls/timerfd_create.S
deleted file mode 100644
index 8086217..0000000
--- a/libc/arch-mips64/syscalls/timerfd_create.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_create)
-    .set push
-    .set noreorder
-    li $v0, __NR_timerfd_create
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(timerfd_create)
diff --git a/libc/arch-mips64/syscalls/timerfd_gettime.S b/libc/arch-mips64/syscalls/timerfd_gettime.S
deleted file mode 100644
index 4b17e12..0000000
--- a/libc/arch-mips64/syscalls/timerfd_gettime.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_gettime)
-    .set push
-    .set noreorder
-    li $v0, __NR_timerfd_gettime
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(timerfd_gettime)
diff --git a/libc/arch-mips64/syscalls/timerfd_settime.S b/libc/arch-mips64/syscalls/timerfd_settime.S
deleted file mode 100644
index 51c8cd7..0000000
--- a/libc/arch-mips64/syscalls/timerfd_settime.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_settime)
-    .set push
-    .set noreorder
-    li $v0, __NR_timerfd_settime
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(timerfd_settime)
diff --git a/libc/arch-mips64/syscalls/times.S b/libc/arch-mips64/syscalls/times.S
deleted file mode 100644
index 5922b67..0000000
--- a/libc/arch-mips64/syscalls/times.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(times)
-    .set push
-    .set noreorder
-    li $v0, __NR_times
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(times)
diff --git a/libc/arch-mips64/syscalls/truncate.S b/libc/arch-mips64/syscalls/truncate.S
deleted file mode 100644
index a23223b..0000000
--- a/libc/arch-mips64/syscalls/truncate.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(truncate)
-    .set push
-    .set noreorder
-    li $v0, __NR_truncate
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(truncate)
-
-ALIAS_SYMBOL(truncate64, truncate)
diff --git a/libc/arch-mips64/syscalls/umask.S b/libc/arch-mips64/syscalls/umask.S
deleted file mode 100644
index ca0ab49..0000000
--- a/libc/arch-mips64/syscalls/umask.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umask)
-    .set push
-    .set noreorder
-    li $v0, __NR_umask
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(umask)
diff --git a/libc/arch-mips64/syscalls/umount2.S b/libc/arch-mips64/syscalls/umount2.S
deleted file mode 100644
index 45d5c2e..0000000
--- a/libc/arch-mips64/syscalls/umount2.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umount2)
-    .set push
-    .set noreorder
-    li $v0, __NR_umount2
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(umount2)
diff --git a/libc/arch-mips64/syscalls/uname.S b/libc/arch-mips64/syscalls/uname.S
deleted file mode 100644
index 3385cfa..0000000
--- a/libc/arch-mips64/syscalls/uname.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(uname)
-    .set push
-    .set noreorder
-    li $v0, __NR_uname
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(uname)
diff --git a/libc/arch-mips64/syscalls/unlinkat.S b/libc/arch-mips64/syscalls/unlinkat.S
deleted file mode 100644
index 030f643..0000000
--- a/libc/arch-mips64/syscalls/unlinkat.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unlinkat)
-    .set push
-    .set noreorder
-    li $v0, __NR_unlinkat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(unlinkat)
diff --git a/libc/arch-mips64/syscalls/unshare.S b/libc/arch-mips64/syscalls/unshare.S
deleted file mode 100644
index e58a7fc..0000000
--- a/libc/arch-mips64/syscalls/unshare.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unshare)
-    .set push
-    .set noreorder
-    li $v0, __NR_unshare
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(unshare)
diff --git a/libc/arch-mips64/syscalls/utimensat.S b/libc/arch-mips64/syscalls/utimensat.S
deleted file mode 100644
index a524baa..0000000
--- a/libc/arch-mips64/syscalls/utimensat.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(utimensat)
-    .set push
-    .set noreorder
-    li $v0, __NR_utimensat
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(utimensat)
diff --git a/libc/arch-mips64/syscalls/vmsplice.S b/libc/arch-mips64/syscalls/vmsplice.S
deleted file mode 100644
index 5e97d86..0000000
--- a/libc/arch-mips64/syscalls/vmsplice.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(vmsplice)
-    .set push
-    .set noreorder
-    li $v0, __NR_vmsplice
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(vmsplice)
diff --git a/libc/arch-mips64/syscalls/wait4.S b/libc/arch-mips64/syscalls/wait4.S
deleted file mode 100644
index 33b0e61..0000000
--- a/libc/arch-mips64/syscalls/wait4.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(wait4)
-    .set push
-    .set noreorder
-    li $v0, __NR_wait4
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(wait4)
diff --git a/libc/arch-mips64/syscalls/write.S b/libc/arch-mips64/syscalls/write.S
deleted file mode 100644
index 0499094..0000000
--- a/libc/arch-mips64/syscalls/write.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(write)
-    .set push
-    .set noreorder
-    li $v0, __NR_write
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(write)
diff --git a/libc/arch-mips64/syscalls/writev.S b/libc/arch-mips64/syscalls/writev.S
deleted file mode 100644
index 5054af3..0000000
--- a/libc/arch-mips64/syscalls/writev.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(writev)
-    .set push
-    .set noreorder
-    li $v0, __NR_writev
-    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_internal
-    .cpreturn
-    j $t9
-    move $ra, $t0
-    .set pop
-END(writev)
diff --git a/libc/arch-x86/bionic/__libc_init_sysinfo.cpp b/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
index 849d253..5c44b4e 100644
--- a/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
+++ b/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
@@ -32,6 +32,10 @@
 // This file is compiled without stack protection, because it runs before TLS
 // has been set up.
 
+__LIBC_HIDDEN__ __attribute__((__naked__)) void __libc_int0x80() {
+  __asm__ volatile("int $0x80; ret");
+}
+
 __LIBC_HIDDEN__ void __libc_init_sysinfo() {
   bool dummy;
   __libc_sysinfo = reinterpret_cast<void*>(__bionic_getauxval(AT_SYSINFO, dummy));
diff --git a/libc/arch-x86/bionic/libcrt_compat.c b/libc/arch-x86/bionic/libcrt_compat.c
new file mode 100644
index 0000000..cfa41f2
--- /dev/null
+++ b/libc/arch-x86/bionic/libcrt_compat.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+extern char __divdi3;
+extern char __moddi3;
+extern char __popcountsi2;
+extern char __udivdi3;
+extern char __umoddi3;
+
+void* __bionic_libcrt_compat_symbols[] = {
+    &__divdi3,
+    &__moddi3,
+    &__popcountsi2,
+    &__udivdi3,
+    &__umoddi3,
+};
diff --git a/libc/arch-x86/bionic/libgcc_compat.c b/libc/arch-x86/bionic/libgcc_compat.c
deleted file mode 100644
index 1a0f566..0000000
--- a/libc/arch-x86/bionic/libgcc_compat.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-extern char __divdi3;
-extern char __moddi3;
-extern char __popcountsi2;
-extern char __udivdi3;
-extern char __umoddi3;
-
-void* __bionic_libgcc_compat_symbols[] = {
-    &__divdi3,
-    &__moddi3,
-    &__popcountsi2,
-    &__udivdi3,
-    &__umoddi3,
-};
diff --git a/libc/arch-x86/bionic/vfork.S b/libc/arch-x86/bionic/vfork.S
index 79d7899..24ede3d 100644
--- a/libc/arch-x86/bionic/vfork.S
+++ b/libc/arch-x86/bionic/vfork.S
@@ -27,6 +27,7 @@
  */
 
 #include <private/bionic_asm.h>
+#include <private/bionic_asm_tls.h>
 
 // This custom code preserves the return address across the system call.
 
@@ -38,7 +39,7 @@
 
   // __get_tls()[TLS_SLOT_THREAD_ID]->cached_pid_ = 0
   movl    %gs:0, %eax
-  movl    4(%eax), %eax
+  movl    (TLS_SLOT_THREAD_ID * 4)(%eax), %eax
   movl    $0, 12(%eax)
 
   movl    $__NR_vfork, %eax
diff --git a/libc/arch-x86/dynamic_function_dispatch.cpp b/libc/arch-x86/dynamic_function_dispatch.cpp
index 6624385..70f4b3e 100644
--- a/libc/arch-x86/dynamic_function_dispatch.cpp
+++ b/libc/arch-x86/dynamic_function_dispatch.cpp
@@ -30,33 +30,6 @@
 
 extern "C" {
 
-struct __processor_model {
-    unsigned int __cpu_vendor;
-    unsigned int __cpu_type;
-    unsigned int __cpu_subtype;
-    unsigned int __cpu_features[1];
-};
-
-__attribute__((visibility("hidden")))
-extern struct __processor_model __cpu_model;
-
-// These definitions have to match the values in
-// llvm/include/llvm/Support/X86TargetParser.def
-static constexpr int SSSE3  = 6;
-static constexpr int SSE4_1 = 7;
-static constexpr int ATOM   = 1;
-
-// __builtin_cpu_supports and __builtin_cpu_is can not be used here. They
-// don't access __cpu_model directly but use GOT.
-// See https://reviews.llvm.org/D53850
-static bool cpu_supports(unsigned int feature) {
-    return (__cpu_model.__cpu_features[0] & (1U << feature)) != 0;
-}
-
-static bool cpu_is(unsigned int type) {
-    return (__cpu_model.__cpu_type == type);
-}
-
 #define DEFINE_IFUNC_FOR(name) \
     name##_func name __attribute__((ifunc(#name "_resolver"))); \
     __attribute__((visibility("hidden"))) \
@@ -74,29 +47,29 @@
 typedef int memcmp_func(const void* __lhs, const void* __rhs, size_t __n);
 DEFINE_IFUNC_FOR(memcmp) {
     __builtin_cpu_init();
-    if (cpu_is(ATOM)) RETURN_FUNC(memcmp_func, memcmp_atom);
-    if (cpu_supports(SSE4_1)) RETURN_FUNC(memcmp_func, memcmp_sse4);
+    if (__builtin_cpu_is("atom")) RETURN_FUNC(memcmp_func, memcmp_atom);
+    if (__builtin_cpu_supports("sse4.1")) RETURN_FUNC(memcmp_func, memcmp_sse4);
     RETURN_FUNC(memcmp_func, memcmp_generic);
 }
 
 typedef void* memset_func(void* __dst, int __ch, size_t __n);
 DEFINE_IFUNC_FOR(memset) {
     __builtin_cpu_init();
-    if (cpu_is(ATOM)) RETURN_FUNC(memset_func, memset_atom);
+    if (__builtin_cpu_is("atom")) RETURN_FUNC(memset_func, memset_atom);
     RETURN_FUNC(memset_func, memset_generic);
 }
 
 typedef void* __memset_chk_func(void *s, int c, size_t n, size_t n2);
 DEFINE_IFUNC_FOR(__memset_chk) {
     __builtin_cpu_init();
-    if (cpu_is(ATOM)) RETURN_FUNC(__memset_chk_func, __memset_chk_atom);
+    if (__builtin_cpu_is("atom")) RETURN_FUNC(__memset_chk_func, __memset_chk_atom);
     RETURN_FUNC(__memset_chk_func, __memset_chk_generic);
 }
 
 typedef void* memmove_func(void* __dst, const void* __src, size_t __n);
 DEFINE_IFUNC_FOR(memmove) {
     __builtin_cpu_init();
-    if (cpu_is(ATOM)) RETURN_FUNC(memmove_func, memmove_atom);
+    if (__builtin_cpu_is("atom")) RETURN_FUNC(memmove_func, memmove_atom);
     RETURN_FUNC(memmove_func, memmove_generic);
 }
 
@@ -108,85 +81,85 @@
 typedef char* strcpy_func(char* __dst, const char* __src);
 DEFINE_IFUNC_FOR(strcpy) {
     __builtin_cpu_init();
-    if (cpu_is(ATOM)) RETURN_FUNC(strcpy_func, strcpy_atom);
+    if (__builtin_cpu_is("atom")) RETURN_FUNC(strcpy_func, strcpy_atom);
     RETURN_FUNC(strcpy_func, strcpy_generic);
 }
 
 typedef char* strncpy_func(char* __dst, const char* __src, size_t __n);
 DEFINE_IFUNC_FOR(strncpy) {
     __builtin_cpu_init();
-    if (cpu_is(ATOM)) RETURN_FUNC(strncpy_func, strncpy_atom);
+    if (__builtin_cpu_is("atom")) RETURN_FUNC(strncpy_func, strncpy_atom);
     RETURN_FUNC(strncpy_func, strncpy_generic);
 }
 
 typedef size_t strlen_func(const char* __s);
 DEFINE_IFUNC_FOR(strlen) {
     __builtin_cpu_init();
-    if (cpu_is(ATOM)) RETURN_FUNC(strlen_func, strlen_atom);
+    if (__builtin_cpu_is("atom")) RETURN_FUNC(strlen_func, strlen_atom);
     RETURN_FUNC(strlen_func, strlen_generic);
 }
 
 typedef int wmemcmp_func(const wchar_t* __lhs, const wchar_t* __rhs, size_t __n);
 DEFINE_IFUNC_FOR(wmemcmp) {
     __builtin_cpu_init();
-    if (cpu_supports(SSE4_1)) RETURN_FUNC(wmemcmp_func, wmemcmp_sse4);
-    if (cpu_is(ATOM)) RETURN_FUNC(wmemcmp_func, wmemcmp_atom);
+    if (__builtin_cpu_supports("sse4.1")) RETURN_FUNC(wmemcmp_func, wmemcmp_sse4);
+    if (__builtin_cpu_is("atom")) RETURN_FUNC(wmemcmp_func, wmemcmp_atom);
     RETURN_FUNC(wmemcmp_func, wmemcmp_freebsd);
 }
 
 typedef int strcmp_func(const char* __lhs, const char* __rhs);
 DEFINE_IFUNC_FOR(strcmp) {
     __builtin_cpu_init();
-    if (cpu_supports(SSSE3)) RETURN_FUNC(strcmp_func, strcmp_ssse3);
+    if (__builtin_cpu_supports("ssse3")) RETURN_FUNC(strcmp_func, strcmp_ssse3);
     RETURN_FUNC(strcmp_func, strcmp_generic);
 }
 
 typedef int strncmp_func(const char* __lhs, const char* __rhs, size_t __n);
 DEFINE_IFUNC_FOR(strncmp) {
     __builtin_cpu_init();
-    if (cpu_supports(SSSE3)) RETURN_FUNC(strncmp_func, strncmp_ssse3);
+    if (__builtin_cpu_supports("ssse3")) RETURN_FUNC(strncmp_func, strncmp_ssse3);
     RETURN_FUNC(strncmp_func, strncmp_generic);
 }
 
 typedef char* strcat_func(char* __dst, const char* __src);
 DEFINE_IFUNC_FOR(strcat) {
     __builtin_cpu_init();
-    if (cpu_supports(SSSE3)) RETURN_FUNC(strcat_func, strcat_ssse3);
+    if (__builtin_cpu_supports("ssse3")) RETURN_FUNC(strcat_func, strcat_ssse3);
     RETURN_FUNC(strcat_func, strcat_generic);
 }
 
 typedef char* strncat_func(char* __dst, const char* __src, size_t __n);
 DEFINE_IFUNC_FOR(strncat) {
     __builtin_cpu_init();
-    if (cpu_supports(SSSE3)) RETURN_FUNC(strncat_func, strncat_ssse3);
+    if (__builtin_cpu_supports("ssse3")) RETURN_FUNC(strncat_func, strncat_ssse3);
     RETURN_FUNC(strncat_func, strncat_openbsd);
 }
 
 typedef size_t strlcat_func(char *dst, const char *src, size_t dsize);
 DEFINE_IFUNC_FOR(strlcat) {
     __builtin_cpu_init();
-    if (cpu_supports(SSSE3)) RETURN_FUNC(strlcat_func, strlcat_ssse3);
+    if (__builtin_cpu_supports("ssse3")) RETURN_FUNC(strlcat_func, strlcat_ssse3);
     RETURN_FUNC(strlcat_func, strlcat_openbsd);
 }
 
 typedef size_t strlcpy_func(char *dst, const char *src, size_t dsize);
 DEFINE_IFUNC_FOR(strlcpy) {
     __builtin_cpu_init();
-    if (cpu_supports(SSSE3)) RETURN_FUNC(strlcpy_func, strlcpy_ssse3);
+    if (__builtin_cpu_supports("ssse3")) RETURN_FUNC(strlcpy_func, strlcpy_ssse3);
     RETURN_FUNC(strlcpy_func, strlcpy_openbsd);
 }
 
 typedef wchar_t* wcscat_func(wchar_t *s1, const wchar_t *s2);
 DEFINE_IFUNC_FOR(wcscat) {
     __builtin_cpu_init();
-    if (cpu_supports(SSSE3)) RETURN_FUNC(wcscat_func, wcscat_ssse3);
+    if (__builtin_cpu_supports("ssse3")) RETURN_FUNC(wcscat_func, wcscat_ssse3);
     RETURN_FUNC(wcscat_func, wcscat_freebsd);
 }
 
 typedef wchar_t* wcscpy_func(wchar_t *s1, const wchar_t *s2);
 DEFINE_IFUNC_FOR(wcscpy) {
     __builtin_cpu_init();
-    if (cpu_supports(SSSE3)) RETURN_FUNC(wcscpy_func, wcscpy_ssse3);
+    if (__builtin_cpu_supports("ssse3")) RETURN_FUNC(wcscpy_func, wcscpy_ssse3);
     RETURN_FUNC(wcscpy_func, wcscpy_freebsd);
 }
 
diff --git a/libc/arch-x86/syscalls/___clock_nanosleep.S b/libc/arch-x86/syscalls/___clock_nanosleep.S
deleted file mode 100644
index 6998749..0000000
--- a/libc/arch-x86/syscalls/___clock_nanosleep.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___clock_nanosleep)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_clock_nanosleep, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(___clock_nanosleep)
-.hidden ___clock_nanosleep
diff --git a/libc/arch-x86/syscalls/___close.S b/libc/arch-x86/syscalls/___close.S
deleted file mode 100644
index b9ebdaa..0000000
--- a/libc/arch-x86/syscalls/___close.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___close)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_close, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(___close)
-.hidden ___close
diff --git a/libc/arch-x86/syscalls/___faccessat.S b/libc/arch-x86/syscalls/___faccessat.S
deleted file mode 100644
index b92b03d..0000000
--- a/libc/arch-x86/syscalls/___faccessat.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___faccessat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_faccessat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(___faccessat)
-.hidden ___faccessat
diff --git a/libc/arch-x86/syscalls/___fchmod.S b/libc/arch-x86/syscalls/___fchmod.S
deleted file mode 100644
index 92e864c..0000000
--- a/libc/arch-x86/syscalls/___fchmod.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmod)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_fchmod, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(___fchmod)
-.hidden ___fchmod
diff --git a/libc/arch-x86/syscalls/___fchmodat.S b/libc/arch-x86/syscalls/___fchmodat.S
deleted file mode 100644
index 81edf96..0000000
--- a/libc/arch-x86/syscalls/___fchmodat.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmodat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_fchmodat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(___fchmodat)
-.hidden ___fchmodat
diff --git a/libc/arch-x86/syscalls/___fgetxattr.S b/libc/arch-x86/syscalls/___fgetxattr.S
deleted file mode 100644
index 712728d..0000000
--- a/libc/arch-x86/syscalls/___fgetxattr.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fgetxattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_fgetxattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(___fgetxattr)
-.hidden ___fgetxattr
diff --git a/libc/arch-x86/syscalls/___flistxattr.S b/libc/arch-x86/syscalls/___flistxattr.S
deleted file mode 100644
index a22ef35..0000000
--- a/libc/arch-x86/syscalls/___flistxattr.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___flistxattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_flistxattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(___flistxattr)
-.hidden ___flistxattr
diff --git a/libc/arch-x86/syscalls/___fsetxattr.S b/libc/arch-x86/syscalls/___fsetxattr.S
deleted file mode 100644
index b90c972..0000000
--- a/libc/arch-x86/syscalls/___fsetxattr.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fsetxattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_fsetxattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(___fsetxattr)
-.hidden ___fsetxattr
diff --git a/libc/arch-x86/syscalls/___mremap.S b/libc/arch-x86/syscalls/___mremap.S
deleted file mode 100644
index 9d9bfcb..0000000
--- a/libc/arch-x86/syscalls/___mremap.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___mremap)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_mremap, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(___mremap)
-.hidden ___mremap
diff --git a/libc/arch-x86/syscalls/___rt_sigqueueinfo.S b/libc/arch-x86/syscalls/___rt_sigqueueinfo.S
deleted file mode 100644
index e299707..0000000
--- a/libc/arch-x86/syscalls/___rt_sigqueueinfo.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___rt_sigqueueinfo)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_rt_sigqueueinfo, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(___rt_sigqueueinfo)
-.hidden ___rt_sigqueueinfo
diff --git a/libc/arch-x86/syscalls/__accept4.S b/libc/arch-x86/syscalls/__accept4.S
deleted file mode 100644
index 112a8a7..0000000
--- a/libc/arch-x86/syscalls/__accept4.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__accept4)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $18, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__accept4)
diff --git a/libc/arch-x86/syscalls/__brk.S b/libc/arch-x86/syscalls/__brk.S
deleted file mode 100644
index bf2f1d2..0000000
--- a/libc/arch-x86/syscalls/__brk.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__brk)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_brk, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(__brk)
diff --git a/libc/arch-x86/syscalls/__clock_getres.S b/libc/arch-x86/syscalls/__clock_getres.S
deleted file mode 100644
index 77b0aa9..0000000
--- a/libc/arch-x86/syscalls/__clock_getres.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_getres)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_clock_getres, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__clock_getres)
diff --git a/libc/arch-x86/syscalls/__clock_gettime.S b/libc/arch-x86/syscalls/__clock_gettime.S
deleted file mode 100644
index 0c0c1c4..0000000
--- a/libc/arch-x86/syscalls/__clock_gettime.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_gettime)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_clock_gettime, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__clock_gettime)
diff --git a/libc/arch-x86/syscalls/__connect.S b/libc/arch-x86/syscalls/__connect.S
deleted file mode 100644
index 5ea160c..0000000
--- a/libc/arch-x86/syscalls/__connect.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__connect)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $3, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__connect)
diff --git a/libc/arch-x86/syscalls/__epoll_pwait.S b/libc/arch-x86/syscalls/__epoll_pwait.S
deleted file mode 100644
index 3750760..0000000
--- a/libc/arch-x86/syscalls/__epoll_pwait.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__epoll_pwait)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     32(%esp), %ebx
-    mov     36(%esp), %ecx
-    mov     40(%esp), %edx
-    mov     44(%esp), %esi
-    mov     48(%esp), %edi
-    mov     52(%esp), %ebp
-    movl    $__NR_epoll_pwait, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebp
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__epoll_pwait)
diff --git a/libc/arch-x86/syscalls/__exit.S b/libc/arch-x86/syscalls/__exit.S
deleted file mode 100644
index 841c8cf..0000000
--- a/libc/arch-x86/syscalls/__exit.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__exit)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_exit, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(__exit)
diff --git a/libc/arch-x86/syscalls/__fadvise64.S b/libc/arch-x86/syscalls/__fadvise64.S
deleted file mode 100644
index d580a61..0000000
--- a/libc/arch-x86/syscalls/__fadvise64.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fadvise64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     32(%esp), %ebx
-    mov     36(%esp), %ecx
-    mov     40(%esp), %edx
-    mov     44(%esp), %esi
-    mov     48(%esp), %edi
-    mov     52(%esp), %ebp
-    movl    $__NR_fadvise64_64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebp
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__fadvise64)
diff --git a/libc/arch-x86/syscalls/__fcntl64.S b/libc/arch-x86/syscalls/__fcntl64.S
deleted file mode 100644
index c886411..0000000
--- a/libc/arch-x86/syscalls/__fcntl64.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fcntl64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_fcntl64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__fcntl64)
diff --git a/libc/arch-x86/syscalls/__fstatfs64.S b/libc/arch-x86/syscalls/__fstatfs64.S
deleted file mode 100644
index 2c97435..0000000
--- a/libc/arch-x86/syscalls/__fstatfs64.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fstatfs64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_fstatfs64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__fstatfs64)
diff --git a/libc/arch-x86/syscalls/__getcpu.S b/libc/arch-x86/syscalls/__getcpu.S
deleted file mode 100644
index fde7306..0000000
--- a/libc/arch-x86/syscalls/__getcpu.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcpu)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_getcpu, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__getcpu)
diff --git a/libc/arch-x86/syscalls/__getcwd.S b/libc/arch-x86/syscalls/__getcwd.S
deleted file mode 100644
index dc0bded..0000000
--- a/libc/arch-x86/syscalls/__getcwd.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcwd)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_getcwd, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__getcwd)
diff --git a/libc/arch-x86/syscalls/__getdents64.S b/libc/arch-x86/syscalls/__getdents64.S
deleted file mode 100644
index 4228da2..0000000
--- a/libc/arch-x86/syscalls/__getdents64.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getdents64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_getdents64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__getdents64)
diff --git a/libc/arch-x86/syscalls/__getpid.S b/libc/arch-x86/syscalls/__getpid.S
deleted file mode 100644
index aa5d343..0000000
--- a/libc/arch-x86/syscalls/__getpid.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpid)
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    movl    $__NR_getpid, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    ret
-END(__getpid)
diff --git a/libc/arch-x86/syscalls/__getpriority.S b/libc/arch-x86/syscalls/__getpriority.S
deleted file mode 100644
index cf2fbc3..0000000
--- a/libc/arch-x86/syscalls/__getpriority.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpriority)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_getpriority, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__getpriority)
diff --git a/libc/arch-x86/syscalls/__gettimeofday.S b/libc/arch-x86/syscalls/__gettimeofday.S
deleted file mode 100644
index 4e24cdd..0000000
--- a/libc/arch-x86/syscalls/__gettimeofday.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__gettimeofday)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_gettimeofday, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__gettimeofday)
diff --git a/libc/arch-x86/syscalls/__ioctl.S b/libc/arch-x86/syscalls/__ioctl.S
deleted file mode 100644
index 2189638..0000000
--- a/libc/arch-x86/syscalls/__ioctl.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ioctl)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_ioctl, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__ioctl)
diff --git a/libc/arch-x86/syscalls/__llseek.S b/libc/arch-x86/syscalls/__llseek.S
deleted file mode 100644
index 9213891..0000000
--- a/libc/arch-x86/syscalls/__llseek.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__llseek)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR__llseek, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__llseek)
diff --git a/libc/arch-x86/syscalls/__mmap2.S b/libc/arch-x86/syscalls/__mmap2.S
deleted file mode 100644
index 0904a3d..0000000
--- a/libc/arch-x86/syscalls/__mmap2.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__mmap2)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     32(%esp), %ebx
-    mov     36(%esp), %ecx
-    mov     40(%esp), %edx
-    mov     44(%esp), %esi
-    mov     48(%esp), %edi
-    mov     52(%esp), %ebp
-    movl    $__NR_mmap2, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebp
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__mmap2)
diff --git a/libc/arch-x86/syscalls/__openat.S b/libc/arch-x86/syscalls/__openat.S
deleted file mode 100644
index 03c03bd..0000000
--- a/libc/arch-x86/syscalls/__openat.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__openat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_openat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__openat)
diff --git a/libc/arch-x86/syscalls/__ppoll.S b/libc/arch-x86/syscalls/__ppoll.S
deleted file mode 100644
index 1a55b03..0000000
--- a/libc/arch-x86/syscalls/__ppoll.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ppoll)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_ppoll, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__ppoll)
diff --git a/libc/arch-x86/syscalls/__preadv64.S b/libc/arch-x86/syscalls/__preadv64.S
deleted file mode 100644
index 5db22a3..0000000
--- a/libc/arch-x86/syscalls/__preadv64.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__preadv64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_preadv, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__preadv64)
diff --git a/libc/arch-x86/syscalls/__pselect6.S b/libc/arch-x86/syscalls/__pselect6.S
deleted file mode 100644
index 18327fd..0000000
--- a/libc/arch-x86/syscalls/__pselect6.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__pselect6)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     32(%esp), %ebx
-    mov     36(%esp), %ecx
-    mov     40(%esp), %edx
-    mov     44(%esp), %esi
-    mov     48(%esp), %edi
-    mov     52(%esp), %ebp
-    movl    $__NR_pselect6, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebp
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__pselect6)
diff --git a/libc/arch-x86/syscalls/__ptrace.S b/libc/arch-x86/syscalls/__ptrace.S
deleted file mode 100644
index a522e95..0000000
--- a/libc/arch-x86/syscalls/__ptrace.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ptrace)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_ptrace, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__ptrace)
diff --git a/libc/arch-x86/syscalls/__pwritev64.S b/libc/arch-x86/syscalls/__pwritev64.S
deleted file mode 100644
index 19f1865..0000000
--- a/libc/arch-x86/syscalls/__pwritev64.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__pwritev64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_pwritev, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__pwritev64)
diff --git a/libc/arch-x86/syscalls/__reboot.S b/libc/arch-x86/syscalls/__reboot.S
deleted file mode 100644
index 711a4e6..0000000
--- a/libc/arch-x86/syscalls/__reboot.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__reboot)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_reboot, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__reboot)
diff --git a/libc/arch-x86/syscalls/__rt_sigaction.S b/libc/arch-x86/syscalls/__rt_sigaction.S
deleted file mode 100644
index ebc431d..0000000
--- a/libc/arch-x86/syscalls/__rt_sigaction.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigaction)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_rt_sigaction, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__rt_sigaction)
diff --git a/libc/arch-x86/syscalls/__rt_sigpending.S b/libc/arch-x86/syscalls/__rt_sigpending.S
deleted file mode 100644
index ecf2945..0000000
--- a/libc/arch-x86/syscalls/__rt_sigpending.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigpending)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_rt_sigpending, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__rt_sigpending)
diff --git a/libc/arch-x86/syscalls/__rt_sigprocmask.S b/libc/arch-x86/syscalls/__rt_sigprocmask.S
deleted file mode 100644
index cdd0f10..0000000
--- a/libc/arch-x86/syscalls/__rt_sigprocmask.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigprocmask)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_rt_sigprocmask, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__rt_sigprocmask)
diff --git a/libc/arch-x86/syscalls/__rt_sigsuspend.S b/libc/arch-x86/syscalls/__rt_sigsuspend.S
deleted file mode 100644
index ef96949..0000000
--- a/libc/arch-x86/syscalls/__rt_sigsuspend.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigsuspend)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_rt_sigsuspend, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__rt_sigsuspend)
diff --git a/libc/arch-x86/syscalls/__rt_sigtimedwait.S b/libc/arch-x86/syscalls/__rt_sigtimedwait.S
deleted file mode 100644
index 8205221..0000000
--- a/libc/arch-x86/syscalls/__rt_sigtimedwait.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigtimedwait)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_rt_sigtimedwait, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__rt_sigtimedwait)
diff --git a/libc/arch-x86/syscalls/__sched_getaffinity.S b/libc/arch-x86/syscalls/__sched_getaffinity.S
deleted file mode 100644
index ba658af..0000000
--- a/libc/arch-x86/syscalls/__sched_getaffinity.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sched_getaffinity)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_sched_getaffinity, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__sched_getaffinity)
diff --git a/libc/arch-x86/syscalls/__set_thread_area.S b/libc/arch-x86/syscalls/__set_thread_area.S
deleted file mode 100644
index 7fc04bd..0000000
--- a/libc/arch-x86/syscalls/__set_thread_area.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__set_thread_area)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_set_thread_area, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(__set_thread_area)
diff --git a/libc/arch-x86/syscalls/__set_tid_address.S b/libc/arch-x86/syscalls/__set_tid_address.S
deleted file mode 100644
index 4301156..0000000
--- a/libc/arch-x86/syscalls/__set_tid_address.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__set_tid_address)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_set_tid_address, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(__set_tid_address)
diff --git a/libc/arch-x86/syscalls/__sigaction.S b/libc/arch-x86/syscalls/__sigaction.S
deleted file mode 100644
index 6b2b7f3..0000000
--- a/libc/arch-x86/syscalls/__sigaction.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sigaction)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_sigaction, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__sigaction)
diff --git a/libc/arch-x86/syscalls/__signalfd4.S b/libc/arch-x86/syscalls/__signalfd4.S
deleted file mode 100644
index ea817cf..0000000
--- a/libc/arch-x86/syscalls/__signalfd4.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__signalfd4)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_signalfd4, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__signalfd4)
diff --git a/libc/arch-x86/syscalls/__socket.S b/libc/arch-x86/syscalls/__socket.S
deleted file mode 100644
index 06d1f1f..0000000
--- a/libc/arch-x86/syscalls/__socket.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__socket)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $1, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__socket)
diff --git a/libc/arch-x86/syscalls/__statfs64.S b/libc/arch-x86/syscalls/__statfs64.S
deleted file mode 100644
index 79e1f4b..0000000
--- a/libc/arch-x86/syscalls/__statfs64.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__statfs64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_statfs64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__statfs64)
diff --git a/libc/arch-x86/syscalls/__sync_file_range.S b/libc/arch-x86/syscalls/__sync_file_range.S
deleted file mode 100644
index f5bf3ec..0000000
--- a/libc/arch-x86/syscalls/__sync_file_range.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sync_file_range)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     32(%esp), %ebx
-    mov     36(%esp), %ecx
-    mov     40(%esp), %edx
-    mov     44(%esp), %esi
-    mov     48(%esp), %edi
-    mov     52(%esp), %ebp
-    movl    $__NR_sync_file_range, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebp
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__sync_file_range)
diff --git a/libc/arch-x86/syscalls/__timer_create.S b/libc/arch-x86/syscalls/__timer_create.S
deleted file mode 100644
index 4e16b1c..0000000
--- a/libc/arch-x86/syscalls/__timer_create.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_create)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_timer_create, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__timer_create)
diff --git a/libc/arch-x86/syscalls/__timer_delete.S b/libc/arch-x86/syscalls/__timer_delete.S
deleted file mode 100644
index fea422e..0000000
--- a/libc/arch-x86/syscalls/__timer_delete.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_delete)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_timer_delete, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(__timer_delete)
diff --git a/libc/arch-x86/syscalls/__timer_getoverrun.S b/libc/arch-x86/syscalls/__timer_getoverrun.S
deleted file mode 100644
index e921073..0000000
--- a/libc/arch-x86/syscalls/__timer_getoverrun.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_getoverrun)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_timer_getoverrun, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(__timer_getoverrun)
diff --git a/libc/arch-x86/syscalls/__timer_gettime.S b/libc/arch-x86/syscalls/__timer_gettime.S
deleted file mode 100644
index 4e20356..0000000
--- a/libc/arch-x86/syscalls/__timer_gettime.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_gettime)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_timer_gettime, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__timer_gettime)
diff --git a/libc/arch-x86/syscalls/__timer_settime.S b/libc/arch-x86/syscalls/__timer_settime.S
deleted file mode 100644
index 9b8af34..0000000
--- a/libc/arch-x86/syscalls/__timer_settime.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_settime)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_timer_settime, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__timer_settime)
diff --git a/libc/arch-x86/syscalls/__waitid.S b/libc/arch-x86/syscalls/__waitid.S
deleted file mode 100644
index f134b42..0000000
--- a/libc/arch-x86/syscalls/__waitid.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__waitid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_waitid, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(__waitid)
diff --git a/libc/arch-x86/syscalls/_exit.S b/libc/arch-x86/syscalls/_exit.S
deleted file mode 100644
index 1e89261..0000000
--- a/libc/arch-x86/syscalls/_exit.S
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(_exit)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_exit_group, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(_exit)
-
-ALIAS_SYMBOL(_Exit, _exit)
diff --git a/libc/arch-x86/syscalls/acct.S b/libc/arch-x86/syscalls/acct.S
deleted file mode 100644
index 48c4c5c..0000000
--- a/libc/arch-x86/syscalls/acct.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(acct)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_acct, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(acct)
diff --git a/libc/arch-x86/syscalls/adjtimex.S b/libc/arch-x86/syscalls/adjtimex.S
deleted file mode 100644
index 1b0d8b1..0000000
--- a/libc/arch-x86/syscalls/adjtimex.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(adjtimex)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_adjtimex, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(adjtimex)
diff --git a/libc/arch-x86/syscalls/bind.S b/libc/arch-x86/syscalls/bind.S
deleted file mode 100644
index c1f84da..0000000
--- a/libc/arch-x86/syscalls/bind.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(bind)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $2, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(bind)
diff --git a/libc/arch-x86/syscalls/capget.S b/libc/arch-x86/syscalls/capget.S
deleted file mode 100644
index fafde37..0000000
--- a/libc/arch-x86/syscalls/capget.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capget)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_capget, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(capget)
diff --git a/libc/arch-x86/syscalls/capset.S b/libc/arch-x86/syscalls/capset.S
deleted file mode 100644
index 28e5338..0000000
--- a/libc/arch-x86/syscalls/capset.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capset)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_capset, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(capset)
diff --git a/libc/arch-x86/syscalls/chdir.S b/libc/arch-x86/syscalls/chdir.S
deleted file mode 100644
index 4b639eb..0000000
--- a/libc/arch-x86/syscalls/chdir.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chdir)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_chdir, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(chdir)
diff --git a/libc/arch-x86/syscalls/chroot.S b/libc/arch-x86/syscalls/chroot.S
deleted file mode 100644
index 8887f86..0000000
--- a/libc/arch-x86/syscalls/chroot.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chroot)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_chroot, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(chroot)
diff --git a/libc/arch-x86/syscalls/clock_adjtime.S b/libc/arch-x86/syscalls/clock_adjtime.S
deleted file mode 100644
index 4ccf1a6..0000000
--- a/libc/arch-x86/syscalls/clock_adjtime.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_adjtime)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_clock_adjtime, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(clock_adjtime)
diff --git a/libc/arch-x86/syscalls/clock_settime.S b/libc/arch-x86/syscalls/clock_settime.S
deleted file mode 100644
index 62dc021..0000000
--- a/libc/arch-x86/syscalls/clock_settime.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_settime)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_clock_settime, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(clock_settime)
diff --git a/libc/arch-x86/syscalls/delete_module.S b/libc/arch-x86/syscalls/delete_module.S
deleted file mode 100644
index b0c8ff9..0000000
--- a/libc/arch-x86/syscalls/delete_module.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(delete_module)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_delete_module, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(delete_module)
diff --git a/libc/arch-x86/syscalls/dup.S b/libc/arch-x86/syscalls/dup.S
deleted file mode 100644
index 637cfae..0000000
--- a/libc/arch-x86/syscalls/dup.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_dup, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(dup)
diff --git a/libc/arch-x86/syscalls/dup3.S b/libc/arch-x86/syscalls/dup3.S
deleted file mode 100644
index 4d08eab..0000000
--- a/libc/arch-x86/syscalls/dup3.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup3)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_dup3, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(dup3)
diff --git a/libc/arch-x86/syscalls/epoll_create1.S b/libc/arch-x86/syscalls/epoll_create1.S
deleted file mode 100644
index 93d1c00..0000000
--- a/libc/arch-x86/syscalls/epoll_create1.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_create1)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_epoll_create1, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(epoll_create1)
diff --git a/libc/arch-x86/syscalls/epoll_ctl.S b/libc/arch-x86/syscalls/epoll_ctl.S
deleted file mode 100644
index a2d8d27..0000000
--- a/libc/arch-x86/syscalls/epoll_ctl.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_ctl)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_epoll_ctl, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(epoll_ctl)
diff --git a/libc/arch-x86/syscalls/eventfd.S b/libc/arch-x86/syscalls/eventfd.S
deleted file mode 100644
index 89f9442..0000000
--- a/libc/arch-x86/syscalls/eventfd.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(eventfd)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_eventfd2, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(eventfd)
diff --git a/libc/arch-x86/syscalls/execve.S b/libc/arch-x86/syscalls/execve.S
deleted file mode 100644
index 7695635..0000000
--- a/libc/arch-x86/syscalls/execve.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(execve)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_execve, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(execve)
diff --git a/libc/arch-x86/syscalls/fallocate64.S b/libc/arch-x86/syscalls/fallocate64.S
deleted file mode 100644
index eabc642..0000000
--- a/libc/arch-x86/syscalls/fallocate64.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fallocate64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     32(%esp), %ebx
-    mov     36(%esp), %ecx
-    mov     40(%esp), %edx
-    mov     44(%esp), %esi
-    mov     48(%esp), %edi
-    mov     52(%esp), %ebp
-    movl    $__NR_fallocate, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebp
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(fallocate64)
diff --git a/libc/arch-x86/syscalls/fchdir.S b/libc/arch-x86/syscalls/fchdir.S
deleted file mode 100644
index 5701644..0000000
--- a/libc/arch-x86/syscalls/fchdir.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchdir)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_fchdir, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(fchdir)
diff --git a/libc/arch-x86/syscalls/fchown.S b/libc/arch-x86/syscalls/fchown.S
deleted file mode 100644
index 0d41389..0000000
--- a/libc/arch-x86/syscalls/fchown.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchown)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_fchown32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(fchown)
diff --git a/libc/arch-x86/syscalls/fchownat.S b/libc/arch-x86/syscalls/fchownat.S
deleted file mode 100644
index 56b7777..0000000
--- a/libc/arch-x86/syscalls/fchownat.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchownat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_fchownat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(fchownat)
diff --git a/libc/arch-x86/syscalls/fdatasync.S b/libc/arch-x86/syscalls/fdatasync.S
deleted file mode 100644
index 6ee9e15..0000000
--- a/libc/arch-x86/syscalls/fdatasync.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fdatasync)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_fdatasync, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(fdatasync)
diff --git a/libc/arch-x86/syscalls/flock.S b/libc/arch-x86/syscalls/flock.S
deleted file mode 100644
index b65543d..0000000
--- a/libc/arch-x86/syscalls/flock.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(flock)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_flock, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(flock)
diff --git a/libc/arch-x86/syscalls/fremovexattr.S b/libc/arch-x86/syscalls/fremovexattr.S
deleted file mode 100644
index 3511d5d..0000000
--- a/libc/arch-x86/syscalls/fremovexattr.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fremovexattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_fremovexattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(fremovexattr)
diff --git a/libc/arch-x86/syscalls/fstat64.S b/libc/arch-x86/syscalls/fstat64.S
deleted file mode 100644
index 16eca69..0000000
--- a/libc/arch-x86/syscalls/fstat64.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fstat64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_fstat64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(fstat64)
-
-ALIAS_SYMBOL(fstat, fstat64)
diff --git a/libc/arch-x86/syscalls/fstatat64.S b/libc/arch-x86/syscalls/fstatat64.S
deleted file mode 100644
index 402cf60..0000000
--- a/libc/arch-x86/syscalls/fstatat64.S
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fstatat64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_fstatat64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(fstatat64)
-
-ALIAS_SYMBOL(fstatat, fstatat64)
diff --git a/libc/arch-x86/syscalls/fsync.S b/libc/arch-x86/syscalls/fsync.S
deleted file mode 100644
index 53aeee6..0000000
--- a/libc/arch-x86/syscalls/fsync.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fsync)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_fsync, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(fsync)
diff --git a/libc/arch-x86/syscalls/ftruncate64.S b/libc/arch-x86/syscalls/ftruncate64.S
deleted file mode 100644
index 2fa792f..0000000
--- a/libc/arch-x86/syscalls/ftruncate64.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(ftruncate64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_ftruncate64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(ftruncate64)
diff --git a/libc/arch-x86/syscalls/getegid.S b/libc/arch-x86/syscalls/getegid.S
deleted file mode 100644
index cb1921e..0000000
--- a/libc/arch-x86/syscalls/getegid.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getegid)
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    movl    $__NR_getegid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    ret
-END(getegid)
diff --git a/libc/arch-x86/syscalls/geteuid.S b/libc/arch-x86/syscalls/geteuid.S
deleted file mode 100644
index c08d3ae..0000000
--- a/libc/arch-x86/syscalls/geteuid.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(geteuid)
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    movl    $__NR_geteuid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    ret
-END(geteuid)
diff --git a/libc/arch-x86/syscalls/getgid.S b/libc/arch-x86/syscalls/getgid.S
deleted file mode 100644
index 9189ae9..0000000
--- a/libc/arch-x86/syscalls/getgid.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgid)
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    movl    $__NR_getgid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    ret
-END(getgid)
diff --git a/libc/arch-x86/syscalls/getgroups.S b/libc/arch-x86/syscalls/getgroups.S
deleted file mode 100644
index 8737d51..0000000
--- a/libc/arch-x86/syscalls/getgroups.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgroups)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_getgroups32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(getgroups)
diff --git a/libc/arch-x86/syscalls/getitimer.S b/libc/arch-x86/syscalls/getitimer.S
deleted file mode 100644
index e088114..0000000
--- a/libc/arch-x86/syscalls/getitimer.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getitimer)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_getitimer, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(getitimer)
diff --git a/libc/arch-x86/syscalls/getpeername.S b/libc/arch-x86/syscalls/getpeername.S
deleted file mode 100644
index 40bb814..0000000
--- a/libc/arch-x86/syscalls/getpeername.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpeername)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $7, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(getpeername)
diff --git a/libc/arch-x86/syscalls/getpgid.S b/libc/arch-x86/syscalls/getpgid.S
deleted file mode 100644
index 9d362e8..0000000
--- a/libc/arch-x86/syscalls/getpgid.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpgid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_getpgid, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(getpgid)
diff --git a/libc/arch-x86/syscalls/getppid.S b/libc/arch-x86/syscalls/getppid.S
deleted file mode 100644
index afb40a1..0000000
--- a/libc/arch-x86/syscalls/getppid.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getppid)
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    movl    $__NR_getppid, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    ret
-END(getppid)
diff --git a/libc/arch-x86/syscalls/getrandom.S b/libc/arch-x86/syscalls/getrandom.S
deleted file mode 100644
index 2e8ebc9..0000000
--- a/libc/arch-x86/syscalls/getrandom.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrandom)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_getrandom, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(getrandom)
diff --git a/libc/arch-x86/syscalls/getresgid.S b/libc/arch-x86/syscalls/getresgid.S
deleted file mode 100644
index 131c101..0000000
--- a/libc/arch-x86/syscalls/getresgid.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresgid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_getresgid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(getresgid)
diff --git a/libc/arch-x86/syscalls/getresuid.S b/libc/arch-x86/syscalls/getresuid.S
deleted file mode 100644
index 94a8767..0000000
--- a/libc/arch-x86/syscalls/getresuid.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresuid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_getresuid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(getresuid)
diff --git a/libc/arch-x86/syscalls/getrlimit.S b/libc/arch-x86/syscalls/getrlimit.S
deleted file mode 100644
index c686f7c..0000000
--- a/libc/arch-x86/syscalls/getrlimit.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrlimit)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_ugetrlimit, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(getrlimit)
diff --git a/libc/arch-x86/syscalls/getrusage.S b/libc/arch-x86/syscalls/getrusage.S
deleted file mode 100644
index 51d1df1..0000000
--- a/libc/arch-x86/syscalls/getrusage.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrusage)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_getrusage, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(getrusage)
diff --git a/libc/arch-x86/syscalls/getsid.S b/libc/arch-x86/syscalls/getsid.S
deleted file mode 100644
index a4568e6..0000000
--- a/libc/arch-x86/syscalls/getsid.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_getsid, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(getsid)
diff --git a/libc/arch-x86/syscalls/getsockname.S b/libc/arch-x86/syscalls/getsockname.S
deleted file mode 100644
index 0fd5836..0000000
--- a/libc/arch-x86/syscalls/getsockname.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockname)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $6, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(getsockname)
diff --git a/libc/arch-x86/syscalls/getsockopt.S b/libc/arch-x86/syscalls/getsockopt.S
deleted file mode 100644
index fa6fccf..0000000
--- a/libc/arch-x86/syscalls/getsockopt.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockopt)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $15, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(getsockopt)
diff --git a/libc/arch-x86/syscalls/getuid.S b/libc/arch-x86/syscalls/getuid.S
deleted file mode 100644
index 11cc0c6..0000000
--- a/libc/arch-x86/syscalls/getuid.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getuid)
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    movl    $__NR_getuid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    ret
-END(getuid)
diff --git a/libc/arch-x86/syscalls/getxattr.S b/libc/arch-x86/syscalls/getxattr.S
deleted file mode 100644
index 871362e..0000000
--- a/libc/arch-x86/syscalls/getxattr.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getxattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_getxattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(getxattr)
diff --git a/libc/arch-x86/syscalls/init_module.S b/libc/arch-x86/syscalls/init_module.S
deleted file mode 100644
index 0147eee..0000000
--- a/libc/arch-x86/syscalls/init_module.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(init_module)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_init_module, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(init_module)
diff --git a/libc/arch-x86/syscalls/inotify_add_watch.S b/libc/arch-x86/syscalls/inotify_add_watch.S
deleted file mode 100644
index f196440..0000000
--- a/libc/arch-x86/syscalls/inotify_add_watch.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_add_watch)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_inotify_add_watch, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(inotify_add_watch)
diff --git a/libc/arch-x86/syscalls/inotify_init1.S b/libc/arch-x86/syscalls/inotify_init1.S
deleted file mode 100644
index 7f0dcfb..0000000
--- a/libc/arch-x86/syscalls/inotify_init1.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_init1)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_inotify_init1, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(inotify_init1)
diff --git a/libc/arch-x86/syscalls/inotify_rm_watch.S b/libc/arch-x86/syscalls/inotify_rm_watch.S
deleted file mode 100644
index 595e053..0000000
--- a/libc/arch-x86/syscalls/inotify_rm_watch.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_rm_watch)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_inotify_rm_watch, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(inotify_rm_watch)
diff --git a/libc/arch-x86/syscalls/kill.S b/libc/arch-x86/syscalls/kill.S
deleted file mode 100644
index 4ee56e6..0000000
--- a/libc/arch-x86/syscalls/kill.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(kill)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_kill, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(kill)
diff --git a/libc/arch-x86/syscalls/klogctl.S b/libc/arch-x86/syscalls/klogctl.S
deleted file mode 100644
index 3d07942..0000000
--- a/libc/arch-x86/syscalls/klogctl.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(klogctl)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_syslog, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(klogctl)
diff --git a/libc/arch-x86/syscalls/lgetxattr.S b/libc/arch-x86/syscalls/lgetxattr.S
deleted file mode 100644
index 659b088..0000000
--- a/libc/arch-x86/syscalls/lgetxattr.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lgetxattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_lgetxattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(lgetxattr)
diff --git a/libc/arch-x86/syscalls/linkat.S b/libc/arch-x86/syscalls/linkat.S
deleted file mode 100644
index 644172d..0000000
--- a/libc/arch-x86/syscalls/linkat.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(linkat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_linkat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(linkat)
diff --git a/libc/arch-x86/syscalls/listen.S b/libc/arch-x86/syscalls/listen.S
deleted file mode 100644
index ce7c3a9..0000000
--- a/libc/arch-x86/syscalls/listen.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listen)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $4, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(listen)
diff --git a/libc/arch-x86/syscalls/listxattr.S b/libc/arch-x86/syscalls/listxattr.S
deleted file mode 100644
index 2fe799e..0000000
--- a/libc/arch-x86/syscalls/listxattr.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listxattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_listxattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(listxattr)
diff --git a/libc/arch-x86/syscalls/llistxattr.S b/libc/arch-x86/syscalls/llistxattr.S
deleted file mode 100644
index 666d87e..0000000
--- a/libc/arch-x86/syscalls/llistxattr.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(llistxattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_llistxattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(llistxattr)
diff --git a/libc/arch-x86/syscalls/lremovexattr.S b/libc/arch-x86/syscalls/lremovexattr.S
deleted file mode 100644
index bda772b..0000000
--- a/libc/arch-x86/syscalls/lremovexattr.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lremovexattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_lremovexattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(lremovexattr)
diff --git a/libc/arch-x86/syscalls/lseek.S b/libc/arch-x86/syscalls/lseek.S
deleted file mode 100644
index 9142b5c..0000000
--- a/libc/arch-x86/syscalls/lseek.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lseek)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_lseek, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(lseek)
diff --git a/libc/arch-x86/syscalls/lsetxattr.S b/libc/arch-x86/syscalls/lsetxattr.S
deleted file mode 100644
index fa977b3..0000000
--- a/libc/arch-x86/syscalls/lsetxattr.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lsetxattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_lsetxattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(lsetxattr)
diff --git a/libc/arch-x86/syscalls/madvise.S b/libc/arch-x86/syscalls/madvise.S
deleted file mode 100644
index 21f472e..0000000
--- a/libc/arch-x86/syscalls/madvise.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(madvise)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_madvise, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(madvise)
diff --git a/libc/arch-x86/syscalls/mincore.S b/libc/arch-x86/syscalls/mincore.S
deleted file mode 100644
index 4179c9a..0000000
--- a/libc/arch-x86/syscalls/mincore.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mincore)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_mincore, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(mincore)
diff --git a/libc/arch-x86/syscalls/mkdirat.S b/libc/arch-x86/syscalls/mkdirat.S
deleted file mode 100644
index 6a9d94c..0000000
--- a/libc/arch-x86/syscalls/mkdirat.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mkdirat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_mkdirat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(mkdirat)
diff --git a/libc/arch-x86/syscalls/mknodat.S b/libc/arch-x86/syscalls/mknodat.S
deleted file mode 100644
index a1fae7f..0000000
--- a/libc/arch-x86/syscalls/mknodat.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mknodat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_mknodat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(mknodat)
diff --git a/libc/arch-x86/syscalls/mlock.S b/libc/arch-x86/syscalls/mlock.S
deleted file mode 100644
index 1c57ac0..0000000
--- a/libc/arch-x86/syscalls/mlock.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlock)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_mlock, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(mlock)
diff --git a/libc/arch-x86/syscalls/mlockall.S b/libc/arch-x86/syscalls/mlockall.S
deleted file mode 100644
index 9f54de3..0000000
--- a/libc/arch-x86/syscalls/mlockall.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlockall)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_mlockall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(mlockall)
diff --git a/libc/arch-x86/syscalls/mount.S b/libc/arch-x86/syscalls/mount.S
deleted file mode 100644
index 4a9f91a..0000000
--- a/libc/arch-x86/syscalls/mount.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mount)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_mount, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(mount)
diff --git a/libc/arch-x86/syscalls/mprotect.S b/libc/arch-x86/syscalls/mprotect.S
deleted file mode 100644
index 5eec550..0000000
--- a/libc/arch-x86/syscalls/mprotect.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mprotect)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_mprotect, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(mprotect)
diff --git a/libc/arch-x86/syscalls/msync.S b/libc/arch-x86/syscalls/msync.S
deleted file mode 100644
index 7754da6..0000000
--- a/libc/arch-x86/syscalls/msync.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(msync)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_msync, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(msync)
diff --git a/libc/arch-x86/syscalls/munlock.S b/libc/arch-x86/syscalls/munlock.S
deleted file mode 100644
index d2ae9f0..0000000
--- a/libc/arch-x86/syscalls/munlock.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlock)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_munlock, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(munlock)
diff --git a/libc/arch-x86/syscalls/munlockall.S b/libc/arch-x86/syscalls/munlockall.S
deleted file mode 100644
index e709b8c..0000000
--- a/libc/arch-x86/syscalls/munlockall.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlockall)
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    movl    $__NR_munlockall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    ret
-END(munlockall)
diff --git a/libc/arch-x86/syscalls/munmap.S b/libc/arch-x86/syscalls/munmap.S
deleted file mode 100644
index 7ddc5aa..0000000
--- a/libc/arch-x86/syscalls/munmap.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munmap)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_munmap, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(munmap)
diff --git a/libc/arch-x86/syscalls/nanosleep.S b/libc/arch-x86/syscalls/nanosleep.S
deleted file mode 100644
index 580f5e1..0000000
--- a/libc/arch-x86/syscalls/nanosleep.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(nanosleep)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_nanosleep, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(nanosleep)
diff --git a/libc/arch-x86/syscalls/personality.S b/libc/arch-x86/syscalls/personality.S
deleted file mode 100644
index 3e003c4..0000000
--- a/libc/arch-x86/syscalls/personality.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(personality)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_personality, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(personality)
diff --git a/libc/arch-x86/syscalls/pipe2.S b/libc/arch-x86/syscalls/pipe2.S
deleted file mode 100644
index 8a93281..0000000
--- a/libc/arch-x86/syscalls/pipe2.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pipe2)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_pipe2, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(pipe2)
diff --git a/libc/arch-x86/syscalls/prctl.S b/libc/arch-x86/syscalls/prctl.S
deleted file mode 100644
index 22b4a83..0000000
--- a/libc/arch-x86/syscalls/prctl.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prctl)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_prctl, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(prctl)
diff --git a/libc/arch-x86/syscalls/pread64.S b/libc/arch-x86/syscalls/pread64.S
deleted file mode 100644
index 9002f17..0000000
--- a/libc/arch-x86/syscalls/pread64.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pread64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_pread64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(pread64)
diff --git a/libc/arch-x86/syscalls/prlimit64.S b/libc/arch-x86/syscalls/prlimit64.S
deleted file mode 100644
index 13f6682..0000000
--- a/libc/arch-x86/syscalls/prlimit64.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prlimit64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_prlimit64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(prlimit64)
diff --git a/libc/arch-x86/syscalls/process_vm_readv.S b/libc/arch-x86/syscalls/process_vm_readv.S
deleted file mode 100644
index e2cd044..0000000
--- a/libc/arch-x86/syscalls/process_vm_readv.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_readv)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     32(%esp), %ebx
-    mov     36(%esp), %ecx
-    mov     40(%esp), %edx
-    mov     44(%esp), %esi
-    mov     48(%esp), %edi
-    mov     52(%esp), %ebp
-    movl    $__NR_process_vm_readv, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebp
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(process_vm_readv)
diff --git a/libc/arch-x86/syscalls/process_vm_writev.S b/libc/arch-x86/syscalls/process_vm_writev.S
deleted file mode 100644
index de0d218..0000000
--- a/libc/arch-x86/syscalls/process_vm_writev.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_writev)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     32(%esp), %ebx
-    mov     36(%esp), %ecx
-    mov     40(%esp), %edx
-    mov     44(%esp), %esi
-    mov     48(%esp), %edi
-    mov     52(%esp), %ebp
-    movl    $__NR_process_vm_writev, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebp
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(process_vm_writev)
diff --git a/libc/arch-x86/syscalls/pwrite64.S b/libc/arch-x86/syscalls/pwrite64.S
deleted file mode 100644
index 7532729..0000000
--- a/libc/arch-x86/syscalls/pwrite64.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pwrite64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_pwrite64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(pwrite64)
diff --git a/libc/arch-x86/syscalls/quotactl.S b/libc/arch-x86/syscalls/quotactl.S
deleted file mode 100644
index 326cf87..0000000
--- a/libc/arch-x86/syscalls/quotactl.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(quotactl)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_quotactl, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(quotactl)
diff --git a/libc/arch-x86/syscalls/read.S b/libc/arch-x86/syscalls/read.S
deleted file mode 100644
index d4b69b5..0000000
--- a/libc/arch-x86/syscalls/read.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(read)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_read, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(read)
diff --git a/libc/arch-x86/syscalls/readahead.S b/libc/arch-x86/syscalls/readahead.S
deleted file mode 100644
index 8ce22bb..0000000
--- a/libc/arch-x86/syscalls/readahead.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readahead)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_readahead, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(readahead)
diff --git a/libc/arch-x86/syscalls/readlinkat.S b/libc/arch-x86/syscalls/readlinkat.S
deleted file mode 100644
index 8b74a4e..0000000
--- a/libc/arch-x86/syscalls/readlinkat.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readlinkat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_readlinkat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(readlinkat)
diff --git a/libc/arch-x86/syscalls/readv.S b/libc/arch-x86/syscalls/readv.S
deleted file mode 100644
index a1cb08f..0000000
--- a/libc/arch-x86/syscalls/readv.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readv)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_readv, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(readv)
diff --git a/libc/arch-x86/syscalls/recvfrom.S b/libc/arch-x86/syscalls/recvfrom.S
deleted file mode 100644
index cedd703..0000000
--- a/libc/arch-x86/syscalls/recvfrom.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvfrom)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $12, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(recvfrom)
diff --git a/libc/arch-x86/syscalls/recvmmsg.S b/libc/arch-x86/syscalls/recvmmsg.S
deleted file mode 100644
index 130332a..0000000
--- a/libc/arch-x86/syscalls/recvmmsg.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmmsg)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $19, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(recvmmsg)
diff --git a/libc/arch-x86/syscalls/recvmsg.S b/libc/arch-x86/syscalls/recvmsg.S
deleted file mode 100644
index c8d2a08..0000000
--- a/libc/arch-x86/syscalls/recvmsg.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmsg)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $17, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(recvmsg)
diff --git a/libc/arch-x86/syscalls/removexattr.S b/libc/arch-x86/syscalls/removexattr.S
deleted file mode 100644
index ab7891e..0000000
--- a/libc/arch-x86/syscalls/removexattr.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(removexattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_removexattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(removexattr)
diff --git a/libc/arch-x86/syscalls/renameat.S b/libc/arch-x86/syscalls/renameat.S
deleted file mode 100644
index 40caaaf..0000000
--- a/libc/arch-x86/syscalls/renameat.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(renameat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_renameat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(renameat)
diff --git a/libc/arch-x86/syscalls/sched_get_priority_max.S b/libc/arch-x86/syscalls/sched_get_priority_max.S
deleted file mode 100644
index 637c9dd..0000000
--- a/libc/arch-x86/syscalls/sched_get_priority_max.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_max)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_sched_get_priority_max, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(sched_get_priority_max)
diff --git a/libc/arch-x86/syscalls/sched_get_priority_min.S b/libc/arch-x86/syscalls/sched_get_priority_min.S
deleted file mode 100644
index c38a3aa..0000000
--- a/libc/arch-x86/syscalls/sched_get_priority_min.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_min)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_sched_get_priority_min, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(sched_get_priority_min)
diff --git a/libc/arch-x86/syscalls/sched_getparam.S b/libc/arch-x86/syscalls/sched_getparam.S
deleted file mode 100644
index 09901bd..0000000
--- a/libc/arch-x86/syscalls/sched_getparam.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getparam)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_sched_getparam, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sched_getparam)
diff --git a/libc/arch-x86/syscalls/sched_getscheduler.S b/libc/arch-x86/syscalls/sched_getscheduler.S
deleted file mode 100644
index adc4023..0000000
--- a/libc/arch-x86/syscalls/sched_getscheduler.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getscheduler)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_sched_getscheduler, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(sched_getscheduler)
diff --git a/libc/arch-x86/syscalls/sched_rr_get_interval.S b/libc/arch-x86/syscalls/sched_rr_get_interval.S
deleted file mode 100644
index 818f62e..0000000
--- a/libc/arch-x86/syscalls/sched_rr_get_interval.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_rr_get_interval)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_sched_rr_get_interval, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sched_rr_get_interval)
diff --git a/libc/arch-x86/syscalls/sched_setaffinity.S b/libc/arch-x86/syscalls/sched_setaffinity.S
deleted file mode 100644
index b06d778..0000000
--- a/libc/arch-x86/syscalls/sched_setaffinity.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setaffinity)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_sched_setaffinity, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sched_setaffinity)
diff --git a/libc/arch-x86/syscalls/sched_setparam.S b/libc/arch-x86/syscalls/sched_setparam.S
deleted file mode 100644
index dba5bc2..0000000
--- a/libc/arch-x86/syscalls/sched_setparam.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setparam)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_sched_setparam, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sched_setparam)
diff --git a/libc/arch-x86/syscalls/sched_setscheduler.S b/libc/arch-x86/syscalls/sched_setscheduler.S
deleted file mode 100644
index 466a425..0000000
--- a/libc/arch-x86/syscalls/sched_setscheduler.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setscheduler)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_sched_setscheduler, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sched_setscheduler)
diff --git a/libc/arch-x86/syscalls/sched_yield.S b/libc/arch-x86/syscalls/sched_yield.S
deleted file mode 100644
index b17b14e..0000000
--- a/libc/arch-x86/syscalls/sched_yield.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_yield)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_sched_yield, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(sched_yield)
diff --git a/libc/arch-x86/syscalls/sendfile.S b/libc/arch-x86/syscalls/sendfile.S
deleted file mode 100644
index e091706..0000000
--- a/libc/arch-x86/syscalls/sendfile.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendfile)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_sendfile, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sendfile)
diff --git a/libc/arch-x86/syscalls/sendfile64.S b/libc/arch-x86/syscalls/sendfile64.S
deleted file mode 100644
index 317c4f4..0000000
--- a/libc/arch-x86/syscalls/sendfile64.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendfile64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_sendfile64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sendfile64)
diff --git a/libc/arch-x86/syscalls/sendmmsg.S b/libc/arch-x86/syscalls/sendmmsg.S
deleted file mode 100644
index c0097f8..0000000
--- a/libc/arch-x86/syscalls/sendmmsg.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmmsg)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $20, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sendmmsg)
diff --git a/libc/arch-x86/syscalls/sendmsg.S b/libc/arch-x86/syscalls/sendmsg.S
deleted file mode 100644
index 775ebee..0000000
--- a/libc/arch-x86/syscalls/sendmsg.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmsg)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $16, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sendmsg)
diff --git a/libc/arch-x86/syscalls/sendto.S b/libc/arch-x86/syscalls/sendto.S
deleted file mode 100644
index 2df5e4f..0000000
--- a/libc/arch-x86/syscalls/sendto.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendto)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $11, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sendto)
diff --git a/libc/arch-x86/syscalls/setdomainname.S b/libc/arch-x86/syscalls/setdomainname.S
deleted file mode 100644
index 8b6afe2..0000000
--- a/libc/arch-x86/syscalls/setdomainname.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setdomainname)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_setdomainname, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setdomainname)
diff --git a/libc/arch-x86/syscalls/setfsgid.S b/libc/arch-x86/syscalls/setfsgid.S
deleted file mode 100644
index af4ef89..0000000
--- a/libc/arch-x86/syscalls/setfsgid.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsgid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_setfsgid, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(setfsgid)
diff --git a/libc/arch-x86/syscalls/setfsuid.S b/libc/arch-x86/syscalls/setfsuid.S
deleted file mode 100644
index 8001e42..0000000
--- a/libc/arch-x86/syscalls/setfsuid.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsuid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_setfsuid, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(setfsuid)
diff --git a/libc/arch-x86/syscalls/setgid.S b/libc/arch-x86/syscalls/setgid.S
deleted file mode 100644
index c0ddec4..0000000
--- a/libc/arch-x86/syscalls/setgid.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_setgid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(setgid)
diff --git a/libc/arch-x86/syscalls/setgroups.S b/libc/arch-x86/syscalls/setgroups.S
deleted file mode 100644
index 7bd3bfc..0000000
--- a/libc/arch-x86/syscalls/setgroups.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgroups)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_setgroups32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setgroups)
diff --git a/libc/arch-x86/syscalls/sethostname.S b/libc/arch-x86/syscalls/sethostname.S
deleted file mode 100644
index 26ff1e7..0000000
--- a/libc/arch-x86/syscalls/sethostname.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sethostname)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_sethostname, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sethostname)
diff --git a/libc/arch-x86/syscalls/setitimer.S b/libc/arch-x86/syscalls/setitimer.S
deleted file mode 100644
index 063847b..0000000
--- a/libc/arch-x86/syscalls/setitimer.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setitimer)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_setitimer, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setitimer)
diff --git a/libc/arch-x86/syscalls/setns.S b/libc/arch-x86/syscalls/setns.S
deleted file mode 100644
index 28d838e..0000000
--- a/libc/arch-x86/syscalls/setns.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setns)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_setns, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setns)
diff --git a/libc/arch-x86/syscalls/setpgid.S b/libc/arch-x86/syscalls/setpgid.S
deleted file mode 100644
index c5d0d27..0000000
--- a/libc/arch-x86/syscalls/setpgid.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpgid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_setpgid, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setpgid)
diff --git a/libc/arch-x86/syscalls/setpriority.S b/libc/arch-x86/syscalls/setpriority.S
deleted file mode 100644
index 17c81c6..0000000
--- a/libc/arch-x86/syscalls/setpriority.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpriority)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_setpriority, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setpriority)
diff --git a/libc/arch-x86/syscalls/setregid.S b/libc/arch-x86/syscalls/setregid.S
deleted file mode 100644
index dd8101a..0000000
--- a/libc/arch-x86/syscalls/setregid.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setregid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_setregid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setregid)
diff --git a/libc/arch-x86/syscalls/setresgid.S b/libc/arch-x86/syscalls/setresgid.S
deleted file mode 100644
index 6f6de5a..0000000
--- a/libc/arch-x86/syscalls/setresgid.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresgid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_setresgid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setresgid)
diff --git a/libc/arch-x86/syscalls/setresuid.S b/libc/arch-x86/syscalls/setresuid.S
deleted file mode 100644
index ab0059c..0000000
--- a/libc/arch-x86/syscalls/setresuid.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresuid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_setresuid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setresuid)
diff --git a/libc/arch-x86/syscalls/setreuid.S b/libc/arch-x86/syscalls/setreuid.S
deleted file mode 100644
index 7fda62e..0000000
--- a/libc/arch-x86/syscalls/setreuid.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setreuid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_setreuid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setreuid)
diff --git a/libc/arch-x86/syscalls/setrlimit.S b/libc/arch-x86/syscalls/setrlimit.S
deleted file mode 100644
index 595633e..0000000
--- a/libc/arch-x86/syscalls/setrlimit.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setrlimit)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_setrlimit, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setrlimit)
diff --git a/libc/arch-x86/syscalls/setsid.S b/libc/arch-x86/syscalls/setsid.S
deleted file mode 100644
index 80ad8a9..0000000
--- a/libc/arch-x86/syscalls/setsid.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsid)
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    movl    $__NR_setsid, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    ret
-END(setsid)
diff --git a/libc/arch-x86/syscalls/setsockopt.S b/libc/arch-x86/syscalls/setsockopt.S
deleted file mode 100644
index bca34e1..0000000
--- a/libc/arch-x86/syscalls/setsockopt.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsockopt)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $14, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setsockopt)
diff --git a/libc/arch-x86/syscalls/settimeofday.S b/libc/arch-x86/syscalls/settimeofday.S
deleted file mode 100644
index 31437d0..0000000
--- a/libc/arch-x86/syscalls/settimeofday.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(settimeofday)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_settimeofday, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(settimeofday)
diff --git a/libc/arch-x86/syscalls/setuid.S b/libc/arch-x86/syscalls/setuid.S
deleted file mode 100644
index 2461182..0000000
--- a/libc/arch-x86/syscalls/setuid.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setuid)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_setuid32, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(setuid)
diff --git a/libc/arch-x86/syscalls/setxattr.S b/libc/arch-x86/syscalls/setxattr.S
deleted file mode 100644
index 787891e..0000000
--- a/libc/arch-x86/syscalls/setxattr.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setxattr)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     28(%esp), %ebx
-    mov     32(%esp), %ecx
-    mov     36(%esp), %edx
-    mov     40(%esp), %esi
-    mov     44(%esp), %edi
-    movl    $__NR_setxattr, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(setxattr)
diff --git a/libc/arch-x86/syscalls/shutdown.S b/libc/arch-x86/syscalls/shutdown.S
deleted file mode 100644
index 46e5c18..0000000
--- a/libc/arch-x86/syscalls/shutdown.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(shutdown)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $13, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(shutdown)
diff --git a/libc/arch-x86/syscalls/sigaltstack.S b/libc/arch-x86/syscalls/sigaltstack.S
deleted file mode 100644
index 90eae16..0000000
--- a/libc/arch-x86/syscalls/sigaltstack.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sigaltstack)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_sigaltstack, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(sigaltstack)
diff --git a/libc/arch-x86/syscalls/socketpair.S b/libc/arch-x86/syscalls/socketpair.S
deleted file mode 100644
index c9c7595..0000000
--- a/libc/arch-x86/syscalls/socketpair.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(socketpair)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     $8, %ebx
-    mov     %esp, %ecx
-    addl    $16, %ecx
-    movl    $__NR_socketcall, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(socketpair)
diff --git a/libc/arch-x86/syscalls/splice.S b/libc/arch-x86/syscalls/splice.S
deleted file mode 100644
index 2d82a3d..0000000
--- a/libc/arch-x86/syscalls/splice.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(splice)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     32(%esp), %ebx
-    mov     36(%esp), %ecx
-    mov     40(%esp), %edx
-    mov     44(%esp), %esi
-    mov     48(%esp), %edi
-    mov     52(%esp), %ebp
-    movl    $__NR_splice, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebp
-    popl    %edi
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(splice)
diff --git a/libc/arch-x86/syscalls/swapoff.S b/libc/arch-x86/syscalls/swapoff.S
deleted file mode 100644
index d10a748..0000000
--- a/libc/arch-x86/syscalls/swapoff.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapoff)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_swapoff, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(swapoff)
diff --git a/libc/arch-x86/syscalls/swapon.S b/libc/arch-x86/syscalls/swapon.S
deleted file mode 100644
index dc7db64..0000000
--- a/libc/arch-x86/syscalls/swapon.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapon)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_swapon, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(swapon)
diff --git a/libc/arch-x86/syscalls/symlinkat.S b/libc/arch-x86/syscalls/symlinkat.S
deleted file mode 100644
index 51b1330..0000000
--- a/libc/arch-x86/syscalls/symlinkat.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(symlinkat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_symlinkat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(symlinkat)
diff --git a/libc/arch-x86/syscalls/sync.S b/libc/arch-x86/syscalls/sync.S
deleted file mode 100644
index c75e9f9..0000000
--- a/libc/arch-x86/syscalls/sync.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sync)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_sync, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(sync)
diff --git a/libc/arch-x86/syscalls/syncfs.S b/libc/arch-x86/syscalls/syncfs.S
deleted file mode 100644
index c08688a..0000000
--- a/libc/arch-x86/syscalls/syncfs.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(syncfs)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_syncfs, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(syncfs)
diff --git a/libc/arch-x86/syscalls/sysinfo.S b/libc/arch-x86/syscalls/sysinfo.S
deleted file mode 100644
index a40d664..0000000
--- a/libc/arch-x86/syscalls/sysinfo.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sysinfo)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_sysinfo, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(sysinfo)
diff --git a/libc/arch-x86/syscalls/tee.S b/libc/arch-x86/syscalls/tee.S
deleted file mode 100644
index 693ad1e..0000000
--- a/libc/arch-x86/syscalls/tee.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tee)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_tee, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(tee)
diff --git a/libc/arch-x86/syscalls/tgkill.S b/libc/arch-x86/syscalls/tgkill.S
deleted file mode 100644
index 5cce4d8..0000000
--- a/libc/arch-x86/syscalls/tgkill.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tgkill)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_tgkill, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(tgkill)
diff --git a/libc/arch-x86/syscalls/timerfd_create.S b/libc/arch-x86/syscalls/timerfd_create.S
deleted file mode 100644
index 335b7a6..0000000
--- a/libc/arch-x86/syscalls/timerfd_create.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_create)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_timerfd_create, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(timerfd_create)
diff --git a/libc/arch-x86/syscalls/timerfd_gettime.S b/libc/arch-x86/syscalls/timerfd_gettime.S
deleted file mode 100644
index 9dc1a2f..0000000
--- a/libc/arch-x86/syscalls/timerfd_gettime.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_gettime)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_timerfd_gettime, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(timerfd_gettime)
diff --git a/libc/arch-x86/syscalls/timerfd_settime.S b/libc/arch-x86/syscalls/timerfd_settime.S
deleted file mode 100644
index 477b5bb..0000000
--- a/libc/arch-x86/syscalls/timerfd_settime.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_settime)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_timerfd_settime, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(timerfd_settime)
diff --git a/libc/arch-x86/syscalls/times.S b/libc/arch-x86/syscalls/times.S
deleted file mode 100644
index 14fe221..0000000
--- a/libc/arch-x86/syscalls/times.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(times)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_times, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(times)
diff --git a/libc/arch-x86/syscalls/truncate.S b/libc/arch-x86/syscalls/truncate.S
deleted file mode 100644
index dd99942..0000000
--- a/libc/arch-x86/syscalls/truncate.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(truncate)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_truncate, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(truncate)
diff --git a/libc/arch-x86/syscalls/truncate64.S b/libc/arch-x86/syscalls/truncate64.S
deleted file mode 100644
index 35e4037..0000000
--- a/libc/arch-x86/syscalls/truncate64.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(truncate64)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_truncate64, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(truncate64)
diff --git a/libc/arch-x86/syscalls/umask.S b/libc/arch-x86/syscalls/umask.S
deleted file mode 100644
index 3333fac..0000000
--- a/libc/arch-x86/syscalls/umask.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umask)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_umask, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(umask)
diff --git a/libc/arch-x86/syscalls/umount2.S b/libc/arch-x86/syscalls/umount2.S
deleted file mode 100644
index 48e1eb5..0000000
--- a/libc/arch-x86/syscalls/umount2.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umount2)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     16(%esp), %ebx
-    mov     20(%esp), %ecx
-    movl    $__NR_umount2, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ecx
-    popl    %ebx
-    ret
-END(umount2)
diff --git a/libc/arch-x86/syscalls/uname.S b/libc/arch-x86/syscalls/uname.S
deleted file mode 100644
index 9eea2c1..0000000
--- a/libc/arch-x86/syscalls/uname.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(uname)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_uname, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(uname)
diff --git a/libc/arch-x86/syscalls/unlinkat.S b/libc/arch-x86/syscalls/unlinkat.S
deleted file mode 100644
index e039a34..0000000
--- a/libc/arch-x86/syscalls/unlinkat.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unlinkat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_unlinkat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(unlinkat)
diff --git a/libc/arch-x86/syscalls/unshare.S b/libc/arch-x86/syscalls/unshare.S
deleted file mode 100644
index ae68d7e..0000000
--- a/libc/arch-x86/syscalls/unshare.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unshare)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     12(%esp), %ebx
-    movl    $__NR_unshare, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %ebx
-    ret
-END(unshare)
diff --git a/libc/arch-x86/syscalls/utimensat.S b/libc/arch-x86/syscalls/utimensat.S
deleted file mode 100644
index 43eebc7..0000000
--- a/libc/arch-x86/syscalls/utimensat.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(utimensat)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_utimensat, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(utimensat)
diff --git a/libc/arch-x86/syscalls/vmsplice.S b/libc/arch-x86/syscalls/vmsplice.S
deleted file mode 100644
index 195b0bf..0000000
--- a/libc/arch-x86/syscalls/vmsplice.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(vmsplice)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_vmsplice, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(vmsplice)
diff --git a/libc/arch-x86/syscalls/wait4.S b/libc/arch-x86/syscalls/wait4.S
deleted file mode 100644
index 281d5f2..0000000
--- a/libc/arch-x86/syscalls/wait4.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(wait4)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    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
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     24(%esp), %ebx
-    mov     28(%esp), %ecx
-    mov     32(%esp), %edx
-    mov     36(%esp), %esi
-    movl    $__NR_wait4, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %esi
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(wait4)
diff --git a/libc/arch-x86/syscalls/write.S b/libc/arch-x86/syscalls/write.S
deleted file mode 100644
index e9e5f4e..0000000
--- a/libc/arch-x86/syscalls/write.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(write)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_write, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(write)
diff --git a/libc/arch-x86/syscalls/writev.S b/libc/arch-x86/syscalls/writev.S
deleted file mode 100644
index 6649905..0000000
--- a/libc/arch-x86/syscalls/writev.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(writev)
-    pushl   %ebx
-    .cfi_def_cfa_offset 8
-    .cfi_rel_offset ebx, 0
-    pushl   %ecx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset ecx, 0
-    pushl   %edx
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset edx, 0
-
-    call    __kernel_syscall
-    pushl   %eax
-    .cfi_adjust_cfa_offset 4
-    .cfi_rel_offset eax, 0
-
-    mov     20(%esp), %ebx
-    mov     24(%esp), %ecx
-    mov     28(%esp), %edx
-    movl    $__NR_writev, %eax
-    call    *(%esp)
-    addl    $4, %esp
-
-    cmpl    $-MAX_ERRNO, %eax
-    jb      1f
-    negl    %eax
-    pushl   %eax
-    call    __set_errno_internal
-    addl    $4, %esp
-1:
-    popl    %edx
-    popl    %ecx
-    popl    %ebx
-    ret
-END(writev)
diff --git a/libc/arch-x86_64/bionic/vfork.S b/libc/arch-x86_64/bionic/vfork.S
index ce96a8c..e32b517 100644
--- a/libc/arch-x86_64/bionic/vfork.S
+++ b/libc/arch-x86_64/bionic/vfork.S
@@ -27,6 +27,7 @@
  */
 
 #include <private/bionic_asm.h>
+#include <private/bionic_asm_tls.h>
 
 // This custom code preserves the return address across the system call.
 
@@ -36,7 +37,7 @@
 
   // __get_tls()[TLS_SLOT_THREAD_ID]->cached_pid_ = 0
   mov    %fs:0, %rax
-  mov    8(%rax), %rax
+  mov    (TLS_SLOT_THREAD_ID * 8)(%rax), %rax
   movl   $0, 20(%rax)
 
   movl    $__NR_vfork, %eax
diff --git a/libc/arch-x86_64/syscalls/___clock_nanosleep.S b/libc/arch-x86_64/syscalls/___clock_nanosleep.S
deleted file mode 100644
index 3286eb2..0000000
--- a/libc/arch-x86_64/syscalls/___clock_nanosleep.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___clock_nanosleep)
-    movq    %rcx, %r10
-    movl    $__NR_clock_nanosleep, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(___clock_nanosleep)
-.hidden ___clock_nanosleep
diff --git a/libc/arch-x86_64/syscalls/___close.S b/libc/arch-x86_64/syscalls/___close.S
deleted file mode 100644
index 8607f05..0000000
--- a/libc/arch-x86_64/syscalls/___close.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___close)
-    movl    $__NR_close, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(___close)
-.hidden ___close
diff --git a/libc/arch-x86_64/syscalls/___faccessat.S b/libc/arch-x86_64/syscalls/___faccessat.S
deleted file mode 100644
index e8fd3f5..0000000
--- a/libc/arch-x86_64/syscalls/___faccessat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___faccessat)
-    movl    $__NR_faccessat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(___faccessat)
-.hidden ___faccessat
diff --git a/libc/arch-x86_64/syscalls/___fchmod.S b/libc/arch-x86_64/syscalls/___fchmod.S
deleted file mode 100644
index 7bccbef..0000000
--- a/libc/arch-x86_64/syscalls/___fchmod.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmod)
-    movl    $__NR_fchmod, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(___fchmod)
-.hidden ___fchmod
diff --git a/libc/arch-x86_64/syscalls/___fchmodat.S b/libc/arch-x86_64/syscalls/___fchmodat.S
deleted file mode 100644
index 483ec7d..0000000
--- a/libc/arch-x86_64/syscalls/___fchmodat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fchmodat)
-    movl    $__NR_fchmodat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(___fchmodat)
-.hidden ___fchmodat
diff --git a/libc/arch-x86_64/syscalls/___fgetxattr.S b/libc/arch-x86_64/syscalls/___fgetxattr.S
deleted file mode 100644
index 302fd77..0000000
--- a/libc/arch-x86_64/syscalls/___fgetxattr.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fgetxattr)
-    movq    %rcx, %r10
-    movl    $__NR_fgetxattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(___fgetxattr)
-.hidden ___fgetxattr
diff --git a/libc/arch-x86_64/syscalls/___flistxattr.S b/libc/arch-x86_64/syscalls/___flistxattr.S
deleted file mode 100644
index b4695cc..0000000
--- a/libc/arch-x86_64/syscalls/___flistxattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___flistxattr)
-    movl    $__NR_flistxattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(___flistxattr)
-.hidden ___flistxattr
diff --git a/libc/arch-x86_64/syscalls/___fsetxattr.S b/libc/arch-x86_64/syscalls/___fsetxattr.S
deleted file mode 100644
index 125ef20..0000000
--- a/libc/arch-x86_64/syscalls/___fsetxattr.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___fsetxattr)
-    movq    %rcx, %r10
-    movl    $__NR_fsetxattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(___fsetxattr)
-.hidden ___fsetxattr
diff --git a/libc/arch-x86_64/syscalls/___mremap.S b/libc/arch-x86_64/syscalls/___mremap.S
deleted file mode 100644
index cc6dee9..0000000
--- a/libc/arch-x86_64/syscalls/___mremap.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___mremap)
-    movq    %rcx, %r10
-    movl    $__NR_mremap, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(___mremap)
-.hidden ___mremap
diff --git a/libc/arch-x86_64/syscalls/___rt_sigqueueinfo.S b/libc/arch-x86_64/syscalls/___rt_sigqueueinfo.S
deleted file mode 100644
index 8c6b30b..0000000
--- a/libc/arch-x86_64/syscalls/___rt_sigqueueinfo.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(___rt_sigqueueinfo)
-    movl    $__NR_rt_sigqueueinfo, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(___rt_sigqueueinfo)
-.hidden ___rt_sigqueueinfo
diff --git a/libc/arch-x86_64/syscalls/__accept4.S b/libc/arch-x86_64/syscalls/__accept4.S
deleted file mode 100644
index aa5beba..0000000
--- a/libc/arch-x86_64/syscalls/__accept4.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__accept4)
-    movq    %rcx, %r10
-    movl    $__NR_accept4, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__accept4)
-.hidden __accept4
diff --git a/libc/arch-x86_64/syscalls/__arch_prctl.S b/libc/arch-x86_64/syscalls/__arch_prctl.S
deleted file mode 100644
index 0a604f4..0000000
--- a/libc/arch-x86_64/syscalls/__arch_prctl.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__arch_prctl)
-    movl    $__NR_arch_prctl, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__arch_prctl)
-.hidden __arch_prctl
diff --git a/libc/arch-x86_64/syscalls/__brk.S b/libc/arch-x86_64/syscalls/__brk.S
deleted file mode 100644
index b6c0f2f..0000000
--- a/libc/arch-x86_64/syscalls/__brk.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__brk)
-    movl    $__NR_brk, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__brk)
-.hidden __brk
diff --git a/libc/arch-x86_64/syscalls/__clock_getres.S b/libc/arch-x86_64/syscalls/__clock_getres.S
deleted file mode 100644
index aff974e..0000000
--- a/libc/arch-x86_64/syscalls/__clock_getres.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_getres)
-    movl    $__NR_clock_getres, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__clock_getres)
-.hidden __clock_getres
diff --git a/libc/arch-x86_64/syscalls/__clock_gettime.S b/libc/arch-x86_64/syscalls/__clock_gettime.S
deleted file mode 100644
index ccacdb2..0000000
--- a/libc/arch-x86_64/syscalls/__clock_gettime.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__clock_gettime)
-    movl    $__NR_clock_gettime, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__clock_gettime)
-.hidden __clock_gettime
diff --git a/libc/arch-x86_64/syscalls/__connect.S b/libc/arch-x86_64/syscalls/__connect.S
deleted file mode 100644
index d7531ad..0000000
--- a/libc/arch-x86_64/syscalls/__connect.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__connect)
-    movl    $__NR_connect, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__connect)
-.hidden __connect
diff --git a/libc/arch-x86_64/syscalls/__epoll_pwait.S b/libc/arch-x86_64/syscalls/__epoll_pwait.S
deleted file mode 100644
index b486c4a..0000000
--- a/libc/arch-x86_64/syscalls/__epoll_pwait.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__epoll_pwait)
-    movq    %rcx, %r10
-    movl    $__NR_epoll_pwait, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__epoll_pwait)
-.hidden __epoll_pwait
diff --git a/libc/arch-x86_64/syscalls/__exit.S b/libc/arch-x86_64/syscalls/__exit.S
deleted file mode 100644
index 99b11fc..0000000
--- a/libc/arch-x86_64/syscalls/__exit.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__exit)
-    movl    $__NR_exit, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__exit)
-.hidden __exit
diff --git a/libc/arch-x86_64/syscalls/__fadvise64.S b/libc/arch-x86_64/syscalls/__fadvise64.S
deleted file mode 100644
index 8810d88..0000000
--- a/libc/arch-x86_64/syscalls/__fadvise64.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fadvise64)
-    movq    %rcx, %r10
-    movl    $__NR_fadvise64, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__fadvise64)
-.hidden __fadvise64
diff --git a/libc/arch-x86_64/syscalls/__fstatfs.S b/libc/arch-x86_64/syscalls/__fstatfs.S
deleted file mode 100644
index b50e355..0000000
--- a/libc/arch-x86_64/syscalls/__fstatfs.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__fstatfs)
-    movl    $__NR_fstatfs, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__fstatfs)
-.hidden __fstatfs
diff --git a/libc/arch-x86_64/syscalls/__getcpu.S b/libc/arch-x86_64/syscalls/__getcpu.S
deleted file mode 100644
index 3903e9f..0000000
--- a/libc/arch-x86_64/syscalls/__getcpu.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcpu)
-    movl    $__NR_getcpu, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__getcpu)
-.hidden __getcpu
diff --git a/libc/arch-x86_64/syscalls/__getcwd.S b/libc/arch-x86_64/syscalls/__getcwd.S
deleted file mode 100644
index d39c1d7..0000000
--- a/libc/arch-x86_64/syscalls/__getcwd.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getcwd)
-    movl    $__NR_getcwd, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__getcwd)
-.hidden __getcwd
diff --git a/libc/arch-x86_64/syscalls/__getdents64.S b/libc/arch-x86_64/syscalls/__getdents64.S
deleted file mode 100644
index b5eb943..0000000
--- a/libc/arch-x86_64/syscalls/__getdents64.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getdents64)
-    movl    $__NR_getdents64, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__getdents64)
-.hidden __getdents64
diff --git a/libc/arch-x86_64/syscalls/__getpid.S b/libc/arch-x86_64/syscalls/__getpid.S
deleted file mode 100644
index ec4316e..0000000
--- a/libc/arch-x86_64/syscalls/__getpid.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpid)
-    movl    $__NR_getpid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__getpid)
-.hidden __getpid
diff --git a/libc/arch-x86_64/syscalls/__getpriority.S b/libc/arch-x86_64/syscalls/__getpriority.S
deleted file mode 100644
index 7c618a1..0000000
--- a/libc/arch-x86_64/syscalls/__getpriority.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getpriority)
-    movl    $__NR_getpriority, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__getpriority)
-.hidden __getpriority
diff --git a/libc/arch-x86_64/syscalls/__gettimeofday.S b/libc/arch-x86_64/syscalls/__gettimeofday.S
deleted file mode 100644
index 69b9b6e..0000000
--- a/libc/arch-x86_64/syscalls/__gettimeofday.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__gettimeofday)
-    movl    $__NR_gettimeofday, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__gettimeofday)
-.hidden __gettimeofday
diff --git a/libc/arch-x86_64/syscalls/__ioctl.S b/libc/arch-x86_64/syscalls/__ioctl.S
deleted file mode 100644
index 0eb34f0..0000000
--- a/libc/arch-x86_64/syscalls/__ioctl.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ioctl)
-    movl    $__NR_ioctl, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__ioctl)
-.hidden __ioctl
diff --git a/libc/arch-x86_64/syscalls/__openat.S b/libc/arch-x86_64/syscalls/__openat.S
deleted file mode 100644
index 14f53ca..0000000
--- a/libc/arch-x86_64/syscalls/__openat.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__openat)
-    movq    %rcx, %r10
-    movl    $__NR_openat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__openat)
-.hidden __openat
diff --git a/libc/arch-x86_64/syscalls/__ppoll.S b/libc/arch-x86_64/syscalls/__ppoll.S
deleted file mode 100644
index 82b97dd..0000000
--- a/libc/arch-x86_64/syscalls/__ppoll.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ppoll)
-    movq    %rcx, %r10
-    movl    $__NR_ppoll, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__ppoll)
-.hidden __ppoll
diff --git a/libc/arch-x86_64/syscalls/__pselect6.S b/libc/arch-x86_64/syscalls/__pselect6.S
deleted file mode 100644
index c11d814..0000000
--- a/libc/arch-x86_64/syscalls/__pselect6.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__pselect6)
-    movq    %rcx, %r10
-    movl    $__NR_pselect6, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__pselect6)
-.hidden __pselect6
diff --git a/libc/arch-x86_64/syscalls/__ptrace.S b/libc/arch-x86_64/syscalls/__ptrace.S
deleted file mode 100644
index 729e007..0000000
--- a/libc/arch-x86_64/syscalls/__ptrace.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__ptrace)
-    movq    %rcx, %r10
-    movl    $__NR_ptrace, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__ptrace)
-.hidden __ptrace
diff --git a/libc/arch-x86_64/syscalls/__reboot.S b/libc/arch-x86_64/syscalls/__reboot.S
deleted file mode 100644
index b462dc7..0000000
--- a/libc/arch-x86_64/syscalls/__reboot.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__reboot)
-    movq    %rcx, %r10
-    movl    $__NR_reboot, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__reboot)
-.hidden __reboot
diff --git a/libc/arch-x86_64/syscalls/__rt_sigaction.S b/libc/arch-x86_64/syscalls/__rt_sigaction.S
deleted file mode 100644
index 17c5995..0000000
--- a/libc/arch-x86_64/syscalls/__rt_sigaction.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigaction)
-    movq    %rcx, %r10
-    movl    $__NR_rt_sigaction, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__rt_sigaction)
-.hidden __rt_sigaction
diff --git a/libc/arch-x86_64/syscalls/__rt_sigpending.S b/libc/arch-x86_64/syscalls/__rt_sigpending.S
deleted file mode 100644
index b5b81bb..0000000
--- a/libc/arch-x86_64/syscalls/__rt_sigpending.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigpending)
-    movl    $__NR_rt_sigpending, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__rt_sigpending)
-.hidden __rt_sigpending
diff --git a/libc/arch-x86_64/syscalls/__rt_sigprocmask.S b/libc/arch-x86_64/syscalls/__rt_sigprocmask.S
deleted file mode 100644
index e8b3f2a..0000000
--- a/libc/arch-x86_64/syscalls/__rt_sigprocmask.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigprocmask)
-    movq    %rcx, %r10
-    movl    $__NR_rt_sigprocmask, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__rt_sigprocmask)
-.hidden __rt_sigprocmask
diff --git a/libc/arch-x86_64/syscalls/__rt_sigsuspend.S b/libc/arch-x86_64/syscalls/__rt_sigsuspend.S
deleted file mode 100644
index f6366a2..0000000
--- a/libc/arch-x86_64/syscalls/__rt_sigsuspend.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigsuspend)
-    movl    $__NR_rt_sigsuspend, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__rt_sigsuspend)
-.hidden __rt_sigsuspend
diff --git a/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S b/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S
deleted file mode 100644
index 9bcb811..0000000
--- a/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__rt_sigtimedwait)
-    movq    %rcx, %r10
-    movl    $__NR_rt_sigtimedwait, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__rt_sigtimedwait)
-.hidden __rt_sigtimedwait
diff --git a/libc/arch-x86_64/syscalls/__sched_getaffinity.S b/libc/arch-x86_64/syscalls/__sched_getaffinity.S
deleted file mode 100644
index 0ca6818..0000000
--- a/libc/arch-x86_64/syscalls/__sched_getaffinity.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sched_getaffinity)
-    movl    $__NR_sched_getaffinity, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__sched_getaffinity)
-.hidden __sched_getaffinity
diff --git a/libc/arch-x86_64/syscalls/__set_tid_address.S b/libc/arch-x86_64/syscalls/__set_tid_address.S
deleted file mode 100644
index 3dad660..0000000
--- a/libc/arch-x86_64/syscalls/__set_tid_address.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__set_tid_address)
-    movl    $__NR_set_tid_address, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__set_tid_address)
-.hidden __set_tid_address
diff --git a/libc/arch-x86_64/syscalls/__signalfd4.S b/libc/arch-x86_64/syscalls/__signalfd4.S
deleted file mode 100644
index b44bfe5..0000000
--- a/libc/arch-x86_64/syscalls/__signalfd4.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__signalfd4)
-    movq    %rcx, %r10
-    movl    $__NR_signalfd4, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__signalfd4)
-.hidden __signalfd4
diff --git a/libc/arch-x86_64/syscalls/__socket.S b/libc/arch-x86_64/syscalls/__socket.S
deleted file mode 100644
index 0563d2f..0000000
--- a/libc/arch-x86_64/syscalls/__socket.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__socket)
-    movl    $__NR_socket, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__socket)
-.hidden __socket
diff --git a/libc/arch-x86_64/syscalls/__statfs.S b/libc/arch-x86_64/syscalls/__statfs.S
deleted file mode 100644
index 607a809..0000000
--- a/libc/arch-x86_64/syscalls/__statfs.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__statfs)
-    movl    $__NR_statfs, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__statfs)
-.hidden __statfs
diff --git a/libc/arch-x86_64/syscalls/__sync_file_range.S b/libc/arch-x86_64/syscalls/__sync_file_range.S
deleted file mode 100644
index 6a2c430..0000000
--- a/libc/arch-x86_64/syscalls/__sync_file_range.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__sync_file_range)
-    movq    %rcx, %r10
-    movl    $__NR_sync_file_range, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__sync_file_range)
-.hidden __sync_file_range
diff --git a/libc/arch-x86_64/syscalls/__timer_create.S b/libc/arch-x86_64/syscalls/__timer_create.S
deleted file mode 100644
index cb955a4..0000000
--- a/libc/arch-x86_64/syscalls/__timer_create.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_create)
-    movl    $__NR_timer_create, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__timer_create)
-.hidden __timer_create
diff --git a/libc/arch-x86_64/syscalls/__timer_delete.S b/libc/arch-x86_64/syscalls/__timer_delete.S
deleted file mode 100644
index 7abc7d8..0000000
--- a/libc/arch-x86_64/syscalls/__timer_delete.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_delete)
-    movl    $__NR_timer_delete, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__timer_delete)
-.hidden __timer_delete
diff --git a/libc/arch-x86_64/syscalls/__timer_getoverrun.S b/libc/arch-x86_64/syscalls/__timer_getoverrun.S
deleted file mode 100644
index f2a0e24..0000000
--- a/libc/arch-x86_64/syscalls/__timer_getoverrun.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_getoverrun)
-    movl    $__NR_timer_getoverrun, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__timer_getoverrun)
-.hidden __timer_getoverrun
diff --git a/libc/arch-x86_64/syscalls/__timer_gettime.S b/libc/arch-x86_64/syscalls/__timer_gettime.S
deleted file mode 100644
index 62c2b47..0000000
--- a/libc/arch-x86_64/syscalls/__timer_gettime.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_gettime)
-    movl    $__NR_timer_gettime, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__timer_gettime)
-.hidden __timer_gettime
diff --git a/libc/arch-x86_64/syscalls/__timer_settime.S b/libc/arch-x86_64/syscalls/__timer_settime.S
deleted file mode 100644
index 225fa8e..0000000
--- a/libc/arch-x86_64/syscalls/__timer_settime.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__timer_settime)
-    movq    %rcx, %r10
-    movl    $__NR_timer_settime, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__timer_settime)
-.hidden __timer_settime
diff --git a/libc/arch-x86_64/syscalls/__waitid.S b/libc/arch-x86_64/syscalls/__waitid.S
deleted file mode 100644
index ff8a3c5..0000000
--- a/libc/arch-x86_64/syscalls/__waitid.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__waitid)
-    movq    %rcx, %r10
-    movl    $__NR_waitid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(__waitid)
-.hidden __waitid
diff --git a/libc/arch-x86_64/syscalls/_exit.S b/libc/arch-x86_64/syscalls/_exit.S
deleted file mode 100644
index 1ab4d4f..0000000
--- a/libc/arch-x86_64/syscalls/_exit.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(_exit)
-    movl    $__NR_exit_group, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(_exit)
-
-ALIAS_SYMBOL(_Exit, _exit)
diff --git a/libc/arch-x86_64/syscalls/acct.S b/libc/arch-x86_64/syscalls/acct.S
deleted file mode 100644
index a739707..0000000
--- a/libc/arch-x86_64/syscalls/acct.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(acct)
-    movl    $__NR_acct, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(acct)
diff --git a/libc/arch-x86_64/syscalls/adjtimex.S b/libc/arch-x86_64/syscalls/adjtimex.S
deleted file mode 100644
index 292b9f3..0000000
--- a/libc/arch-x86_64/syscalls/adjtimex.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(adjtimex)
-    movl    $__NR_adjtimex, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(adjtimex)
diff --git a/libc/arch-x86_64/syscalls/bind.S b/libc/arch-x86_64/syscalls/bind.S
deleted file mode 100644
index e5bc263..0000000
--- a/libc/arch-x86_64/syscalls/bind.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(bind)
-    movl    $__NR_bind, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(bind)
diff --git a/libc/arch-x86_64/syscalls/capget.S b/libc/arch-x86_64/syscalls/capget.S
deleted file mode 100644
index 9ce1583..0000000
--- a/libc/arch-x86_64/syscalls/capget.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capget)
-    movl    $__NR_capget, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(capget)
diff --git a/libc/arch-x86_64/syscalls/capset.S b/libc/arch-x86_64/syscalls/capset.S
deleted file mode 100644
index 2776756..0000000
--- a/libc/arch-x86_64/syscalls/capset.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(capset)
-    movl    $__NR_capset, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(capset)
diff --git a/libc/arch-x86_64/syscalls/chdir.S b/libc/arch-x86_64/syscalls/chdir.S
deleted file mode 100644
index 269905c..0000000
--- a/libc/arch-x86_64/syscalls/chdir.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chdir)
-    movl    $__NR_chdir, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(chdir)
diff --git a/libc/arch-x86_64/syscalls/chroot.S b/libc/arch-x86_64/syscalls/chroot.S
deleted file mode 100644
index 713b1b3..0000000
--- a/libc/arch-x86_64/syscalls/chroot.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(chroot)
-    movl    $__NR_chroot, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(chroot)
diff --git a/libc/arch-x86_64/syscalls/clock_adjtime.S b/libc/arch-x86_64/syscalls/clock_adjtime.S
deleted file mode 100644
index 0601930..0000000
--- a/libc/arch-x86_64/syscalls/clock_adjtime.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_adjtime)
-    movl    $__NR_clock_adjtime, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(clock_adjtime)
diff --git a/libc/arch-x86_64/syscalls/clock_settime.S b/libc/arch-x86_64/syscalls/clock_settime.S
deleted file mode 100644
index 26070a4..0000000
--- a/libc/arch-x86_64/syscalls/clock_settime.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(clock_settime)
-    movl    $__NR_clock_settime, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(clock_settime)
diff --git a/libc/arch-x86_64/syscalls/delete_module.S b/libc/arch-x86_64/syscalls/delete_module.S
deleted file mode 100644
index 63f17ad..0000000
--- a/libc/arch-x86_64/syscalls/delete_module.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(delete_module)
-    movl    $__NR_delete_module, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(delete_module)
diff --git a/libc/arch-x86_64/syscalls/dup.S b/libc/arch-x86_64/syscalls/dup.S
deleted file mode 100644
index 5016f77..0000000
--- a/libc/arch-x86_64/syscalls/dup.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup)
-    movl    $__NR_dup, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(dup)
diff --git a/libc/arch-x86_64/syscalls/dup3.S b/libc/arch-x86_64/syscalls/dup3.S
deleted file mode 100644
index 9abd168..0000000
--- a/libc/arch-x86_64/syscalls/dup3.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(dup3)
-    movl    $__NR_dup3, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(dup3)
diff --git a/libc/arch-x86_64/syscalls/epoll_create1.S b/libc/arch-x86_64/syscalls/epoll_create1.S
deleted file mode 100644
index d1e4bfc..0000000
--- a/libc/arch-x86_64/syscalls/epoll_create1.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_create1)
-    movl    $__NR_epoll_create1, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(epoll_create1)
diff --git a/libc/arch-x86_64/syscalls/epoll_ctl.S b/libc/arch-x86_64/syscalls/epoll_ctl.S
deleted file mode 100644
index f429b96..0000000
--- a/libc/arch-x86_64/syscalls/epoll_ctl.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(epoll_ctl)
-    movq    %rcx, %r10
-    movl    $__NR_epoll_ctl, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(epoll_ctl)
diff --git a/libc/arch-x86_64/syscalls/eventfd.S b/libc/arch-x86_64/syscalls/eventfd.S
deleted file mode 100644
index dcc5105..0000000
--- a/libc/arch-x86_64/syscalls/eventfd.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(eventfd)
-    movl    $__NR_eventfd2, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(eventfd)
diff --git a/libc/arch-x86_64/syscalls/execve.S b/libc/arch-x86_64/syscalls/execve.S
deleted file mode 100644
index 947baa4..0000000
--- a/libc/arch-x86_64/syscalls/execve.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(execve)
-    movl    $__NR_execve, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(execve)
diff --git a/libc/arch-x86_64/syscalls/fallocate.S b/libc/arch-x86_64/syscalls/fallocate.S
deleted file mode 100644
index f6f891b..0000000
--- a/libc/arch-x86_64/syscalls/fallocate.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fallocate)
-    movq    %rcx, %r10
-    movl    $__NR_fallocate, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(fallocate)
-
-ALIAS_SYMBOL(fallocate64, fallocate)
diff --git a/libc/arch-x86_64/syscalls/fchdir.S b/libc/arch-x86_64/syscalls/fchdir.S
deleted file mode 100644
index d005c14..0000000
--- a/libc/arch-x86_64/syscalls/fchdir.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchdir)
-    movl    $__NR_fchdir, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(fchdir)
diff --git a/libc/arch-x86_64/syscalls/fchown.S b/libc/arch-x86_64/syscalls/fchown.S
deleted file mode 100644
index d5bdc71..0000000
--- a/libc/arch-x86_64/syscalls/fchown.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchown)
-    movl    $__NR_fchown, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(fchown)
diff --git a/libc/arch-x86_64/syscalls/fchownat.S b/libc/arch-x86_64/syscalls/fchownat.S
deleted file mode 100644
index ff05e9e..0000000
--- a/libc/arch-x86_64/syscalls/fchownat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fchownat)
-    movq    %rcx, %r10
-    movl    $__NR_fchownat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(fchownat)
diff --git a/libc/arch-x86_64/syscalls/fcntl.S b/libc/arch-x86_64/syscalls/fcntl.S
deleted file mode 100644
index f28195b..0000000
--- a/libc/arch-x86_64/syscalls/fcntl.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fcntl)
-    movl    $__NR_fcntl, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(fcntl)
diff --git a/libc/arch-x86_64/syscalls/fdatasync.S b/libc/arch-x86_64/syscalls/fdatasync.S
deleted file mode 100644
index 27239b9..0000000
--- a/libc/arch-x86_64/syscalls/fdatasync.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fdatasync)
-    movl    $__NR_fdatasync, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(fdatasync)
diff --git a/libc/arch-x86_64/syscalls/flock.S b/libc/arch-x86_64/syscalls/flock.S
deleted file mode 100644
index 1bc6678..0000000
--- a/libc/arch-x86_64/syscalls/flock.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(flock)
-    movl    $__NR_flock, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(flock)
diff --git a/libc/arch-x86_64/syscalls/fremovexattr.S b/libc/arch-x86_64/syscalls/fremovexattr.S
deleted file mode 100644
index 517094c..0000000
--- a/libc/arch-x86_64/syscalls/fremovexattr.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fremovexattr)
-    movl    $__NR_fremovexattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(fremovexattr)
diff --git a/libc/arch-x86_64/syscalls/fstat64.S b/libc/arch-x86_64/syscalls/fstat64.S
deleted file mode 100644
index a0d4fa1..0000000
--- a/libc/arch-x86_64/syscalls/fstat64.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fstat64)
-    movl    $__NR_fstat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(fstat64)
-
-ALIAS_SYMBOL(fstat, fstat64)
diff --git a/libc/arch-x86_64/syscalls/fstatat64.S b/libc/arch-x86_64/syscalls/fstatat64.S
deleted file mode 100644
index 1984d68..0000000
--- a/libc/arch-x86_64/syscalls/fstatat64.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fstatat64)
-    movq    %rcx, %r10
-    movl    $__NR_newfstatat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(fstatat64)
-
-ALIAS_SYMBOL(fstatat, fstatat64)
diff --git a/libc/arch-x86_64/syscalls/fsync.S b/libc/arch-x86_64/syscalls/fsync.S
deleted file mode 100644
index e7ec6da..0000000
--- a/libc/arch-x86_64/syscalls/fsync.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(fsync)
-    movl    $__NR_fsync, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(fsync)
diff --git a/libc/arch-x86_64/syscalls/ftruncate.S b/libc/arch-x86_64/syscalls/ftruncate.S
deleted file mode 100644
index 7917468..0000000
--- a/libc/arch-x86_64/syscalls/ftruncate.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(ftruncate)
-    movl    $__NR_ftruncate, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(ftruncate)
-
-ALIAS_SYMBOL(ftruncate64, ftruncate)
diff --git a/libc/arch-x86_64/syscalls/getegid.S b/libc/arch-x86_64/syscalls/getegid.S
deleted file mode 100644
index 84ba240..0000000
--- a/libc/arch-x86_64/syscalls/getegid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getegid)
-    movl    $__NR_getegid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getegid)
diff --git a/libc/arch-x86_64/syscalls/geteuid.S b/libc/arch-x86_64/syscalls/geteuid.S
deleted file mode 100644
index 18a991a..0000000
--- a/libc/arch-x86_64/syscalls/geteuid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(geteuid)
-    movl    $__NR_geteuid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(geteuid)
diff --git a/libc/arch-x86_64/syscalls/getgid.S b/libc/arch-x86_64/syscalls/getgid.S
deleted file mode 100644
index 5e4b0ef..0000000
--- a/libc/arch-x86_64/syscalls/getgid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgid)
-    movl    $__NR_getgid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getgid)
diff --git a/libc/arch-x86_64/syscalls/getgroups.S b/libc/arch-x86_64/syscalls/getgroups.S
deleted file mode 100644
index b5dd81c..0000000
--- a/libc/arch-x86_64/syscalls/getgroups.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getgroups)
-    movl    $__NR_getgroups, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getgroups)
diff --git a/libc/arch-x86_64/syscalls/getitimer.S b/libc/arch-x86_64/syscalls/getitimer.S
deleted file mode 100644
index c4bb120..0000000
--- a/libc/arch-x86_64/syscalls/getitimer.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getitimer)
-    movl    $__NR_getitimer, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getitimer)
diff --git a/libc/arch-x86_64/syscalls/getpeername.S b/libc/arch-x86_64/syscalls/getpeername.S
deleted file mode 100644
index 0b212be..0000000
--- a/libc/arch-x86_64/syscalls/getpeername.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpeername)
-    movl    $__NR_getpeername, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getpeername)
diff --git a/libc/arch-x86_64/syscalls/getpgid.S b/libc/arch-x86_64/syscalls/getpgid.S
deleted file mode 100644
index d1b0e8b..0000000
--- a/libc/arch-x86_64/syscalls/getpgid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getpgid)
-    movl    $__NR_getpgid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getpgid)
diff --git a/libc/arch-x86_64/syscalls/getppid.S b/libc/arch-x86_64/syscalls/getppid.S
deleted file mode 100644
index e1cfee0..0000000
--- a/libc/arch-x86_64/syscalls/getppid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getppid)
-    movl    $__NR_getppid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getppid)
diff --git a/libc/arch-x86_64/syscalls/getrandom.S b/libc/arch-x86_64/syscalls/getrandom.S
deleted file mode 100644
index c5e44a9..0000000
--- a/libc/arch-x86_64/syscalls/getrandom.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrandom)
-    movl    $__NR_getrandom, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getrandom)
diff --git a/libc/arch-x86_64/syscalls/getresgid.S b/libc/arch-x86_64/syscalls/getresgid.S
deleted file mode 100644
index 0b7ea7a..0000000
--- a/libc/arch-x86_64/syscalls/getresgid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresgid)
-    movl    $__NR_getresgid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getresgid)
diff --git a/libc/arch-x86_64/syscalls/getresuid.S b/libc/arch-x86_64/syscalls/getresuid.S
deleted file mode 100644
index 0d7a054..0000000
--- a/libc/arch-x86_64/syscalls/getresuid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getresuid)
-    movl    $__NR_getresuid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getresuid)
diff --git a/libc/arch-x86_64/syscalls/getrlimit.S b/libc/arch-x86_64/syscalls/getrlimit.S
deleted file mode 100644
index 00ed08a..0000000
--- a/libc/arch-x86_64/syscalls/getrlimit.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrlimit)
-    movl    $__NR_getrlimit, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getrlimit)
-
-ALIAS_SYMBOL(getrlimit64, getrlimit)
diff --git a/libc/arch-x86_64/syscalls/getrusage.S b/libc/arch-x86_64/syscalls/getrusage.S
deleted file mode 100644
index eef7fb8..0000000
--- a/libc/arch-x86_64/syscalls/getrusage.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getrusage)
-    movl    $__NR_getrusage, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getrusage)
diff --git a/libc/arch-x86_64/syscalls/getsid.S b/libc/arch-x86_64/syscalls/getsid.S
deleted file mode 100644
index 022f959..0000000
--- a/libc/arch-x86_64/syscalls/getsid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsid)
-    movl    $__NR_getsid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getsid)
diff --git a/libc/arch-x86_64/syscalls/getsockname.S b/libc/arch-x86_64/syscalls/getsockname.S
deleted file mode 100644
index 36fdcf7..0000000
--- a/libc/arch-x86_64/syscalls/getsockname.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockname)
-    movl    $__NR_getsockname, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getsockname)
diff --git a/libc/arch-x86_64/syscalls/getsockopt.S b/libc/arch-x86_64/syscalls/getsockopt.S
deleted file mode 100644
index c1e11e7..0000000
--- a/libc/arch-x86_64/syscalls/getsockopt.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getsockopt)
-    movq    %rcx, %r10
-    movl    $__NR_getsockopt, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getsockopt)
diff --git a/libc/arch-x86_64/syscalls/getuid.S b/libc/arch-x86_64/syscalls/getuid.S
deleted file mode 100644
index 93cd0f8..0000000
--- a/libc/arch-x86_64/syscalls/getuid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getuid)
-    movl    $__NR_getuid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getuid)
diff --git a/libc/arch-x86_64/syscalls/getxattr.S b/libc/arch-x86_64/syscalls/getxattr.S
deleted file mode 100644
index 01378b0..0000000
--- a/libc/arch-x86_64/syscalls/getxattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getxattr)
-    movq    %rcx, %r10
-    movl    $__NR_getxattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(getxattr)
diff --git a/libc/arch-x86_64/syscalls/init_module.S b/libc/arch-x86_64/syscalls/init_module.S
deleted file mode 100644
index c005de4..0000000
--- a/libc/arch-x86_64/syscalls/init_module.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(init_module)
-    movl    $__NR_init_module, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(init_module)
diff --git a/libc/arch-x86_64/syscalls/inotify_add_watch.S b/libc/arch-x86_64/syscalls/inotify_add_watch.S
deleted file mode 100644
index edf2930..0000000
--- a/libc/arch-x86_64/syscalls/inotify_add_watch.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_add_watch)
-    movl    $__NR_inotify_add_watch, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(inotify_add_watch)
diff --git a/libc/arch-x86_64/syscalls/inotify_init1.S b/libc/arch-x86_64/syscalls/inotify_init1.S
deleted file mode 100644
index b158018..0000000
--- a/libc/arch-x86_64/syscalls/inotify_init1.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_init1)
-    movl    $__NR_inotify_init1, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(inotify_init1)
diff --git a/libc/arch-x86_64/syscalls/inotify_rm_watch.S b/libc/arch-x86_64/syscalls/inotify_rm_watch.S
deleted file mode 100644
index f2fc10e..0000000
--- a/libc/arch-x86_64/syscalls/inotify_rm_watch.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(inotify_rm_watch)
-    movl    $__NR_inotify_rm_watch, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(inotify_rm_watch)
diff --git a/libc/arch-x86_64/syscalls/kill.S b/libc/arch-x86_64/syscalls/kill.S
deleted file mode 100644
index fe93f34..0000000
--- a/libc/arch-x86_64/syscalls/kill.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(kill)
-    movl    $__NR_kill, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(kill)
diff --git a/libc/arch-x86_64/syscalls/klogctl.S b/libc/arch-x86_64/syscalls/klogctl.S
deleted file mode 100644
index fb2aca3..0000000
--- a/libc/arch-x86_64/syscalls/klogctl.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(klogctl)
-    movl    $__NR_syslog, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(klogctl)
diff --git a/libc/arch-x86_64/syscalls/lgetxattr.S b/libc/arch-x86_64/syscalls/lgetxattr.S
deleted file mode 100644
index 36202a2..0000000
--- a/libc/arch-x86_64/syscalls/lgetxattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lgetxattr)
-    movq    %rcx, %r10
-    movl    $__NR_lgetxattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(lgetxattr)
diff --git a/libc/arch-x86_64/syscalls/linkat.S b/libc/arch-x86_64/syscalls/linkat.S
deleted file mode 100644
index d195e19..0000000
--- a/libc/arch-x86_64/syscalls/linkat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(linkat)
-    movq    %rcx, %r10
-    movl    $__NR_linkat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(linkat)
diff --git a/libc/arch-x86_64/syscalls/listen.S b/libc/arch-x86_64/syscalls/listen.S
deleted file mode 100644
index 756b629..0000000
--- a/libc/arch-x86_64/syscalls/listen.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listen)
-    movl    $__NR_listen, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(listen)
diff --git a/libc/arch-x86_64/syscalls/listxattr.S b/libc/arch-x86_64/syscalls/listxattr.S
deleted file mode 100644
index d0b2112..0000000
--- a/libc/arch-x86_64/syscalls/listxattr.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(listxattr)
-    movl    $__NR_listxattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(listxattr)
diff --git a/libc/arch-x86_64/syscalls/llistxattr.S b/libc/arch-x86_64/syscalls/llistxattr.S
deleted file mode 100644
index 49fb969..0000000
--- a/libc/arch-x86_64/syscalls/llistxattr.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(llistxattr)
-    movl    $__NR_llistxattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(llistxattr)
diff --git a/libc/arch-x86_64/syscalls/lremovexattr.S b/libc/arch-x86_64/syscalls/lremovexattr.S
deleted file mode 100644
index 1e1bc30..0000000
--- a/libc/arch-x86_64/syscalls/lremovexattr.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lremovexattr)
-    movl    $__NR_lremovexattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(lremovexattr)
diff --git a/libc/arch-x86_64/syscalls/lseek.S b/libc/arch-x86_64/syscalls/lseek.S
deleted file mode 100644
index 69d60c2..0000000
--- a/libc/arch-x86_64/syscalls/lseek.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lseek)
-    movl    $__NR_lseek, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(lseek)
-
-ALIAS_SYMBOL(lseek64, lseek)
diff --git a/libc/arch-x86_64/syscalls/lsetxattr.S b/libc/arch-x86_64/syscalls/lsetxattr.S
deleted file mode 100644
index 965ee03..0000000
--- a/libc/arch-x86_64/syscalls/lsetxattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(lsetxattr)
-    movq    %rcx, %r10
-    movl    $__NR_lsetxattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(lsetxattr)
diff --git a/libc/arch-x86_64/syscalls/madvise.S b/libc/arch-x86_64/syscalls/madvise.S
deleted file mode 100644
index 75d47f6..0000000
--- a/libc/arch-x86_64/syscalls/madvise.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(madvise)
-    movl    $__NR_madvise, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(madvise)
diff --git a/libc/arch-x86_64/syscalls/mincore.S b/libc/arch-x86_64/syscalls/mincore.S
deleted file mode 100644
index 2d8a28a..0000000
--- a/libc/arch-x86_64/syscalls/mincore.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mincore)
-    movl    $__NR_mincore, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(mincore)
diff --git a/libc/arch-x86_64/syscalls/mkdirat.S b/libc/arch-x86_64/syscalls/mkdirat.S
deleted file mode 100644
index 8a76013..0000000
--- a/libc/arch-x86_64/syscalls/mkdirat.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mkdirat)
-    movl    $__NR_mkdirat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(mkdirat)
diff --git a/libc/arch-x86_64/syscalls/mknodat.S b/libc/arch-x86_64/syscalls/mknodat.S
deleted file mode 100644
index a8859d4..0000000
--- a/libc/arch-x86_64/syscalls/mknodat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mknodat)
-    movq    %rcx, %r10
-    movl    $__NR_mknodat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(mknodat)
diff --git a/libc/arch-x86_64/syscalls/mlock.S b/libc/arch-x86_64/syscalls/mlock.S
deleted file mode 100644
index d34b3ae..0000000
--- a/libc/arch-x86_64/syscalls/mlock.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlock)
-    movl    $__NR_mlock, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(mlock)
diff --git a/libc/arch-x86_64/syscalls/mlockall.S b/libc/arch-x86_64/syscalls/mlockall.S
deleted file mode 100644
index 31ccaa0..0000000
--- a/libc/arch-x86_64/syscalls/mlockall.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mlockall)
-    movl    $__NR_mlockall, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(mlockall)
diff --git a/libc/arch-x86_64/syscalls/mmap.S b/libc/arch-x86_64/syscalls/mmap.S
deleted file mode 100644
index 0c25473..0000000
--- a/libc/arch-x86_64/syscalls/mmap.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mmap)
-    movq    %rcx, %r10
-    movl    $__NR_mmap, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(mmap)
-
-ALIAS_SYMBOL(mmap64, mmap)
diff --git a/libc/arch-x86_64/syscalls/mount.S b/libc/arch-x86_64/syscalls/mount.S
deleted file mode 100644
index dcbd473..0000000
--- a/libc/arch-x86_64/syscalls/mount.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mount)
-    movq    %rcx, %r10
-    movl    $__NR_mount, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(mount)
diff --git a/libc/arch-x86_64/syscalls/mprotect.S b/libc/arch-x86_64/syscalls/mprotect.S
deleted file mode 100644
index 2ad4b25..0000000
--- a/libc/arch-x86_64/syscalls/mprotect.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(mprotect)
-    movl    $__NR_mprotect, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(mprotect)
diff --git a/libc/arch-x86_64/syscalls/msync.S b/libc/arch-x86_64/syscalls/msync.S
deleted file mode 100644
index 099dbbf..0000000
--- a/libc/arch-x86_64/syscalls/msync.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(msync)
-    movl    $__NR_msync, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(msync)
diff --git a/libc/arch-x86_64/syscalls/munlock.S b/libc/arch-x86_64/syscalls/munlock.S
deleted file mode 100644
index bb5940c..0000000
--- a/libc/arch-x86_64/syscalls/munlock.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlock)
-    movl    $__NR_munlock, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(munlock)
diff --git a/libc/arch-x86_64/syscalls/munlockall.S b/libc/arch-x86_64/syscalls/munlockall.S
deleted file mode 100644
index f9579df..0000000
--- a/libc/arch-x86_64/syscalls/munlockall.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munlockall)
-    movl    $__NR_munlockall, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(munlockall)
diff --git a/libc/arch-x86_64/syscalls/munmap.S b/libc/arch-x86_64/syscalls/munmap.S
deleted file mode 100644
index d1c580e..0000000
--- a/libc/arch-x86_64/syscalls/munmap.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(munmap)
-    movl    $__NR_munmap, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(munmap)
diff --git a/libc/arch-x86_64/syscalls/nanosleep.S b/libc/arch-x86_64/syscalls/nanosleep.S
deleted file mode 100644
index b19f7f5..0000000
--- a/libc/arch-x86_64/syscalls/nanosleep.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(nanosleep)
-    movl    $__NR_nanosleep, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(nanosleep)
diff --git a/libc/arch-x86_64/syscalls/personality.S b/libc/arch-x86_64/syscalls/personality.S
deleted file mode 100644
index 6937e4c..0000000
--- a/libc/arch-x86_64/syscalls/personality.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(personality)
-    movl    $__NR_personality, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(personality)
diff --git a/libc/arch-x86_64/syscalls/pipe2.S b/libc/arch-x86_64/syscalls/pipe2.S
deleted file mode 100644
index d488c87..0000000
--- a/libc/arch-x86_64/syscalls/pipe2.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pipe2)
-    movl    $__NR_pipe2, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(pipe2)
diff --git a/libc/arch-x86_64/syscalls/prctl.S b/libc/arch-x86_64/syscalls/prctl.S
deleted file mode 100644
index 4f3d2ae..0000000
--- a/libc/arch-x86_64/syscalls/prctl.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prctl)
-    movq    %rcx, %r10
-    movl    $__NR_prctl, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(prctl)
diff --git a/libc/arch-x86_64/syscalls/pread64.S b/libc/arch-x86_64/syscalls/pread64.S
deleted file mode 100644
index eaa47b1..0000000
--- a/libc/arch-x86_64/syscalls/pread64.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pread64)
-    movq    %rcx, %r10
-    movl    $__NR_pread64, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(pread64)
-
-ALIAS_SYMBOL(pread, pread64)
diff --git a/libc/arch-x86_64/syscalls/preadv.S b/libc/arch-x86_64/syscalls/preadv.S
deleted file mode 100644
index 7771a44..0000000
--- a/libc/arch-x86_64/syscalls/preadv.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(preadv)
-    movq    %rcx, %r10
-    movl    $__NR_preadv, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(preadv)
-
-ALIAS_SYMBOL(preadv64, preadv)
diff --git a/libc/arch-x86_64/syscalls/prlimit64.S b/libc/arch-x86_64/syscalls/prlimit64.S
deleted file mode 100644
index 737b863..0000000
--- a/libc/arch-x86_64/syscalls/prlimit64.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(prlimit64)
-    movq    %rcx, %r10
-    movl    $__NR_prlimit64, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(prlimit64)
-
-ALIAS_SYMBOL(prlimit, prlimit64)
diff --git a/libc/arch-x86_64/syscalls/process_vm_readv.S b/libc/arch-x86_64/syscalls/process_vm_readv.S
deleted file mode 100644
index 597649e..0000000
--- a/libc/arch-x86_64/syscalls/process_vm_readv.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_readv)
-    movq    %rcx, %r10
-    movl    $__NR_process_vm_readv, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(process_vm_readv)
diff --git a/libc/arch-x86_64/syscalls/process_vm_writev.S b/libc/arch-x86_64/syscalls/process_vm_writev.S
deleted file mode 100644
index 397c007..0000000
--- a/libc/arch-x86_64/syscalls/process_vm_writev.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(process_vm_writev)
-    movq    %rcx, %r10
-    movl    $__NR_process_vm_writev, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(process_vm_writev)
diff --git a/libc/arch-x86_64/syscalls/pwrite64.S b/libc/arch-x86_64/syscalls/pwrite64.S
deleted file mode 100644
index edb60af..0000000
--- a/libc/arch-x86_64/syscalls/pwrite64.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pwrite64)
-    movq    %rcx, %r10
-    movl    $__NR_pwrite64, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(pwrite64)
-
-ALIAS_SYMBOL(pwrite, pwrite64)
diff --git a/libc/arch-x86_64/syscalls/pwritev.S b/libc/arch-x86_64/syscalls/pwritev.S
deleted file mode 100644
index d3bd8fa..0000000
--- a/libc/arch-x86_64/syscalls/pwritev.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(pwritev)
-    movq    %rcx, %r10
-    movl    $__NR_pwritev, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(pwritev)
-
-ALIAS_SYMBOL(pwritev64, pwritev)
diff --git a/libc/arch-x86_64/syscalls/quotactl.S b/libc/arch-x86_64/syscalls/quotactl.S
deleted file mode 100644
index 427358a..0000000
--- a/libc/arch-x86_64/syscalls/quotactl.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(quotactl)
-    movq    %rcx, %r10
-    movl    $__NR_quotactl, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(quotactl)
diff --git a/libc/arch-x86_64/syscalls/read.S b/libc/arch-x86_64/syscalls/read.S
deleted file mode 100644
index df70e7f..0000000
--- a/libc/arch-x86_64/syscalls/read.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(read)
-    movl    $__NR_read, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(read)
diff --git a/libc/arch-x86_64/syscalls/readahead.S b/libc/arch-x86_64/syscalls/readahead.S
deleted file mode 100644
index 38cb1c0..0000000
--- a/libc/arch-x86_64/syscalls/readahead.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readahead)
-    movl    $__NR_readahead, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(readahead)
diff --git a/libc/arch-x86_64/syscalls/readlinkat.S b/libc/arch-x86_64/syscalls/readlinkat.S
deleted file mode 100644
index 9fd64e5..0000000
--- a/libc/arch-x86_64/syscalls/readlinkat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readlinkat)
-    movq    %rcx, %r10
-    movl    $__NR_readlinkat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(readlinkat)
diff --git a/libc/arch-x86_64/syscalls/readv.S b/libc/arch-x86_64/syscalls/readv.S
deleted file mode 100644
index 2510c56..0000000
--- a/libc/arch-x86_64/syscalls/readv.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(readv)
-    movl    $__NR_readv, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(readv)
diff --git a/libc/arch-x86_64/syscalls/recvfrom.S b/libc/arch-x86_64/syscalls/recvfrom.S
deleted file mode 100644
index 6c09078..0000000
--- a/libc/arch-x86_64/syscalls/recvfrom.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvfrom)
-    movq    %rcx, %r10
-    movl    $__NR_recvfrom, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(recvfrom)
diff --git a/libc/arch-x86_64/syscalls/recvmmsg.S b/libc/arch-x86_64/syscalls/recvmmsg.S
deleted file mode 100644
index 78da691..0000000
--- a/libc/arch-x86_64/syscalls/recvmmsg.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmmsg)
-    movq    %rcx, %r10
-    movl    $__NR_recvmmsg, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(recvmmsg)
diff --git a/libc/arch-x86_64/syscalls/recvmsg.S b/libc/arch-x86_64/syscalls/recvmsg.S
deleted file mode 100644
index 945f17b..0000000
--- a/libc/arch-x86_64/syscalls/recvmsg.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(recvmsg)
-    movl    $__NR_recvmsg, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(recvmsg)
diff --git a/libc/arch-x86_64/syscalls/removexattr.S b/libc/arch-x86_64/syscalls/removexattr.S
deleted file mode 100644
index 9b47615..0000000
--- a/libc/arch-x86_64/syscalls/removexattr.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(removexattr)
-    movl    $__NR_removexattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(removexattr)
diff --git a/libc/arch-x86_64/syscalls/renameat.S b/libc/arch-x86_64/syscalls/renameat.S
deleted file mode 100644
index 3a94a75..0000000
--- a/libc/arch-x86_64/syscalls/renameat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(renameat)
-    movq    %rcx, %r10
-    movl    $__NR_renameat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(renameat)
diff --git a/libc/arch-x86_64/syscalls/sched_get_priority_max.S b/libc/arch-x86_64/syscalls/sched_get_priority_max.S
deleted file mode 100644
index 1a0da23..0000000
--- a/libc/arch-x86_64/syscalls/sched_get_priority_max.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_max)
-    movl    $__NR_sched_get_priority_max, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sched_get_priority_max)
diff --git a/libc/arch-x86_64/syscalls/sched_get_priority_min.S b/libc/arch-x86_64/syscalls/sched_get_priority_min.S
deleted file mode 100644
index 3785877..0000000
--- a/libc/arch-x86_64/syscalls/sched_get_priority_min.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_get_priority_min)
-    movl    $__NR_sched_get_priority_min, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sched_get_priority_min)
diff --git a/libc/arch-x86_64/syscalls/sched_getparam.S b/libc/arch-x86_64/syscalls/sched_getparam.S
deleted file mode 100644
index 409b501..0000000
--- a/libc/arch-x86_64/syscalls/sched_getparam.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getparam)
-    movl    $__NR_sched_getparam, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sched_getparam)
diff --git a/libc/arch-x86_64/syscalls/sched_getscheduler.S b/libc/arch-x86_64/syscalls/sched_getscheduler.S
deleted file mode 100644
index 5200504..0000000
--- a/libc/arch-x86_64/syscalls/sched_getscheduler.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_getscheduler)
-    movl    $__NR_sched_getscheduler, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sched_getscheduler)
diff --git a/libc/arch-x86_64/syscalls/sched_rr_get_interval.S b/libc/arch-x86_64/syscalls/sched_rr_get_interval.S
deleted file mode 100644
index 276feb1..0000000
--- a/libc/arch-x86_64/syscalls/sched_rr_get_interval.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_rr_get_interval)
-    movl    $__NR_sched_rr_get_interval, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sched_rr_get_interval)
diff --git a/libc/arch-x86_64/syscalls/sched_setaffinity.S b/libc/arch-x86_64/syscalls/sched_setaffinity.S
deleted file mode 100644
index 1fb87e5..0000000
--- a/libc/arch-x86_64/syscalls/sched_setaffinity.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setaffinity)
-    movl    $__NR_sched_setaffinity, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sched_setaffinity)
diff --git a/libc/arch-x86_64/syscalls/sched_setparam.S b/libc/arch-x86_64/syscalls/sched_setparam.S
deleted file mode 100644
index 91ca83b..0000000
--- a/libc/arch-x86_64/syscalls/sched_setparam.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setparam)
-    movl    $__NR_sched_setparam, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sched_setparam)
diff --git a/libc/arch-x86_64/syscalls/sched_setscheduler.S b/libc/arch-x86_64/syscalls/sched_setscheduler.S
deleted file mode 100644
index 7fa499a..0000000
--- a/libc/arch-x86_64/syscalls/sched_setscheduler.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_setscheduler)
-    movl    $__NR_sched_setscheduler, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sched_setscheduler)
diff --git a/libc/arch-x86_64/syscalls/sched_yield.S b/libc/arch-x86_64/syscalls/sched_yield.S
deleted file mode 100644
index 8eb10f6..0000000
--- a/libc/arch-x86_64/syscalls/sched_yield.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sched_yield)
-    movl    $__NR_sched_yield, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sched_yield)
diff --git a/libc/arch-x86_64/syscalls/sendfile.S b/libc/arch-x86_64/syscalls/sendfile.S
deleted file mode 100644
index c0fa4ee..0000000
--- a/libc/arch-x86_64/syscalls/sendfile.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendfile)
-    movq    %rcx, %r10
-    movl    $__NR_sendfile, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sendfile)
-
-ALIAS_SYMBOL(sendfile64, sendfile)
diff --git a/libc/arch-x86_64/syscalls/sendmmsg.S b/libc/arch-x86_64/syscalls/sendmmsg.S
deleted file mode 100644
index cf4a78d..0000000
--- a/libc/arch-x86_64/syscalls/sendmmsg.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmmsg)
-    movq    %rcx, %r10
-    movl    $__NR_sendmmsg, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sendmmsg)
diff --git a/libc/arch-x86_64/syscalls/sendmsg.S b/libc/arch-x86_64/syscalls/sendmsg.S
deleted file mode 100644
index 84566b5..0000000
--- a/libc/arch-x86_64/syscalls/sendmsg.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendmsg)
-    movl    $__NR_sendmsg, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sendmsg)
diff --git a/libc/arch-x86_64/syscalls/sendto.S b/libc/arch-x86_64/syscalls/sendto.S
deleted file mode 100644
index be3bace..0000000
--- a/libc/arch-x86_64/syscalls/sendto.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sendto)
-    movq    %rcx, %r10
-    movl    $__NR_sendto, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sendto)
diff --git a/libc/arch-x86_64/syscalls/setdomainname.S b/libc/arch-x86_64/syscalls/setdomainname.S
deleted file mode 100644
index 40d1a33..0000000
--- a/libc/arch-x86_64/syscalls/setdomainname.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setdomainname)
-    movl    $__NR_setdomainname, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setdomainname)
diff --git a/libc/arch-x86_64/syscalls/setfsgid.S b/libc/arch-x86_64/syscalls/setfsgid.S
deleted file mode 100644
index 22a36b2..0000000
--- a/libc/arch-x86_64/syscalls/setfsgid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsgid)
-    movl    $__NR_setfsgid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setfsgid)
diff --git a/libc/arch-x86_64/syscalls/setfsuid.S b/libc/arch-x86_64/syscalls/setfsuid.S
deleted file mode 100644
index 0bd0c97..0000000
--- a/libc/arch-x86_64/syscalls/setfsuid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setfsuid)
-    movl    $__NR_setfsuid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setfsuid)
diff --git a/libc/arch-x86_64/syscalls/setgid.S b/libc/arch-x86_64/syscalls/setgid.S
deleted file mode 100644
index 650f8e2..0000000
--- a/libc/arch-x86_64/syscalls/setgid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgid)
-    movl    $__NR_setgid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setgid)
diff --git a/libc/arch-x86_64/syscalls/setgroups.S b/libc/arch-x86_64/syscalls/setgroups.S
deleted file mode 100644
index c798c14..0000000
--- a/libc/arch-x86_64/syscalls/setgroups.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setgroups)
-    movl    $__NR_setgroups, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setgroups)
diff --git a/libc/arch-x86_64/syscalls/sethostname.S b/libc/arch-x86_64/syscalls/sethostname.S
deleted file mode 100644
index 4bcd12d..0000000
--- a/libc/arch-x86_64/syscalls/sethostname.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sethostname)
-    movl    $__NR_sethostname, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sethostname)
diff --git a/libc/arch-x86_64/syscalls/setitimer.S b/libc/arch-x86_64/syscalls/setitimer.S
deleted file mode 100644
index c5fabb2..0000000
--- a/libc/arch-x86_64/syscalls/setitimer.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setitimer)
-    movl    $__NR_setitimer, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setitimer)
diff --git a/libc/arch-x86_64/syscalls/setns.S b/libc/arch-x86_64/syscalls/setns.S
deleted file mode 100644
index c2ae97d..0000000
--- a/libc/arch-x86_64/syscalls/setns.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setns)
-    movl    $__NR_setns, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setns)
diff --git a/libc/arch-x86_64/syscalls/setpgid.S b/libc/arch-x86_64/syscalls/setpgid.S
deleted file mode 100644
index 4d4313c..0000000
--- a/libc/arch-x86_64/syscalls/setpgid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpgid)
-    movl    $__NR_setpgid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setpgid)
diff --git a/libc/arch-x86_64/syscalls/setpriority.S b/libc/arch-x86_64/syscalls/setpriority.S
deleted file mode 100644
index 3c508c3..0000000
--- a/libc/arch-x86_64/syscalls/setpriority.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setpriority)
-    movl    $__NR_setpriority, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setpriority)
diff --git a/libc/arch-x86_64/syscalls/setregid.S b/libc/arch-x86_64/syscalls/setregid.S
deleted file mode 100644
index 181a8b9..0000000
--- a/libc/arch-x86_64/syscalls/setregid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setregid)
-    movl    $__NR_setregid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setregid)
diff --git a/libc/arch-x86_64/syscalls/setresgid.S b/libc/arch-x86_64/syscalls/setresgid.S
deleted file mode 100644
index fe44786..0000000
--- a/libc/arch-x86_64/syscalls/setresgid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresgid)
-    movl    $__NR_setresgid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setresgid)
diff --git a/libc/arch-x86_64/syscalls/setresuid.S b/libc/arch-x86_64/syscalls/setresuid.S
deleted file mode 100644
index 58cd2ca..0000000
--- a/libc/arch-x86_64/syscalls/setresuid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setresuid)
-    movl    $__NR_setresuid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setresuid)
diff --git a/libc/arch-x86_64/syscalls/setreuid.S b/libc/arch-x86_64/syscalls/setreuid.S
deleted file mode 100644
index e25658b..0000000
--- a/libc/arch-x86_64/syscalls/setreuid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setreuid)
-    movl    $__NR_setreuid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setreuid)
diff --git a/libc/arch-x86_64/syscalls/setrlimit.S b/libc/arch-x86_64/syscalls/setrlimit.S
deleted file mode 100644
index 3843ff9..0000000
--- a/libc/arch-x86_64/syscalls/setrlimit.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setrlimit)
-    movl    $__NR_setrlimit, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setrlimit)
-
-ALIAS_SYMBOL(setrlimit64, setrlimit)
diff --git a/libc/arch-x86_64/syscalls/setsid.S b/libc/arch-x86_64/syscalls/setsid.S
deleted file mode 100644
index 01d9269..0000000
--- a/libc/arch-x86_64/syscalls/setsid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsid)
-    movl    $__NR_setsid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setsid)
diff --git a/libc/arch-x86_64/syscalls/setsockopt.S b/libc/arch-x86_64/syscalls/setsockopt.S
deleted file mode 100644
index 629fdf0..0000000
--- a/libc/arch-x86_64/syscalls/setsockopt.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setsockopt)
-    movq    %rcx, %r10
-    movl    $__NR_setsockopt, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setsockopt)
diff --git a/libc/arch-x86_64/syscalls/settimeofday.S b/libc/arch-x86_64/syscalls/settimeofday.S
deleted file mode 100644
index ac5b9b1..0000000
--- a/libc/arch-x86_64/syscalls/settimeofday.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(settimeofday)
-    movl    $__NR_settimeofday, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(settimeofday)
diff --git a/libc/arch-x86_64/syscalls/setuid.S b/libc/arch-x86_64/syscalls/setuid.S
deleted file mode 100644
index f335a76..0000000
--- a/libc/arch-x86_64/syscalls/setuid.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setuid)
-    movl    $__NR_setuid, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setuid)
diff --git a/libc/arch-x86_64/syscalls/setxattr.S b/libc/arch-x86_64/syscalls/setxattr.S
deleted file mode 100644
index d750423..0000000
--- a/libc/arch-x86_64/syscalls/setxattr.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(setxattr)
-    movq    %rcx, %r10
-    movl    $__NR_setxattr, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(setxattr)
diff --git a/libc/arch-x86_64/syscalls/shutdown.S b/libc/arch-x86_64/syscalls/shutdown.S
deleted file mode 100644
index a030c97..0000000
--- a/libc/arch-x86_64/syscalls/shutdown.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(shutdown)
-    movl    $__NR_shutdown, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(shutdown)
diff --git a/libc/arch-x86_64/syscalls/sigaltstack.S b/libc/arch-x86_64/syscalls/sigaltstack.S
deleted file mode 100644
index 71ce537..0000000
--- a/libc/arch-x86_64/syscalls/sigaltstack.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sigaltstack)
-    movl    $__NR_sigaltstack, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sigaltstack)
diff --git a/libc/arch-x86_64/syscalls/socketpair.S b/libc/arch-x86_64/syscalls/socketpair.S
deleted file mode 100644
index dbcf50d..0000000
--- a/libc/arch-x86_64/syscalls/socketpair.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(socketpair)
-    movq    %rcx, %r10
-    movl    $__NR_socketpair, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(socketpair)
diff --git a/libc/arch-x86_64/syscalls/splice.S b/libc/arch-x86_64/syscalls/splice.S
deleted file mode 100644
index 1b2ec84..0000000
--- a/libc/arch-x86_64/syscalls/splice.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(splice)
-    movq    %rcx, %r10
-    movl    $__NR_splice, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(splice)
diff --git a/libc/arch-x86_64/syscalls/swapoff.S b/libc/arch-x86_64/syscalls/swapoff.S
deleted file mode 100644
index df922a0..0000000
--- a/libc/arch-x86_64/syscalls/swapoff.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapoff)
-    movl    $__NR_swapoff, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(swapoff)
diff --git a/libc/arch-x86_64/syscalls/swapon.S b/libc/arch-x86_64/syscalls/swapon.S
deleted file mode 100644
index 036b422..0000000
--- a/libc/arch-x86_64/syscalls/swapon.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(swapon)
-    movl    $__NR_swapon, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(swapon)
diff --git a/libc/arch-x86_64/syscalls/symlinkat.S b/libc/arch-x86_64/syscalls/symlinkat.S
deleted file mode 100644
index fdbced5..0000000
--- a/libc/arch-x86_64/syscalls/symlinkat.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(symlinkat)
-    movl    $__NR_symlinkat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(symlinkat)
diff --git a/libc/arch-x86_64/syscalls/sync.S b/libc/arch-x86_64/syscalls/sync.S
deleted file mode 100644
index a4153fd..0000000
--- a/libc/arch-x86_64/syscalls/sync.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sync)
-    movl    $__NR_sync, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sync)
diff --git a/libc/arch-x86_64/syscalls/syncfs.S b/libc/arch-x86_64/syscalls/syncfs.S
deleted file mode 100644
index 12dee08..0000000
--- a/libc/arch-x86_64/syscalls/syncfs.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(syncfs)
-    movl    $__NR_syncfs, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(syncfs)
diff --git a/libc/arch-x86_64/syscalls/sysinfo.S b/libc/arch-x86_64/syscalls/sysinfo.S
deleted file mode 100644
index 754ef61..0000000
--- a/libc/arch-x86_64/syscalls/sysinfo.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(sysinfo)
-    movl    $__NR_sysinfo, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(sysinfo)
diff --git a/libc/arch-x86_64/syscalls/tee.S b/libc/arch-x86_64/syscalls/tee.S
deleted file mode 100644
index 31d66dc..0000000
--- a/libc/arch-x86_64/syscalls/tee.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tee)
-    movq    %rcx, %r10
-    movl    $__NR_tee, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(tee)
diff --git a/libc/arch-x86_64/syscalls/tgkill.S b/libc/arch-x86_64/syscalls/tgkill.S
deleted file mode 100644
index 9c46887..0000000
--- a/libc/arch-x86_64/syscalls/tgkill.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(tgkill)
-    movl    $__NR_tgkill, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(tgkill)
diff --git a/libc/arch-x86_64/syscalls/timerfd_create.S b/libc/arch-x86_64/syscalls/timerfd_create.S
deleted file mode 100644
index 56b45e8..0000000
--- a/libc/arch-x86_64/syscalls/timerfd_create.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_create)
-    movl    $__NR_timerfd_create, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(timerfd_create)
diff --git a/libc/arch-x86_64/syscalls/timerfd_gettime.S b/libc/arch-x86_64/syscalls/timerfd_gettime.S
deleted file mode 100644
index 8c9b5d6..0000000
--- a/libc/arch-x86_64/syscalls/timerfd_gettime.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_gettime)
-    movl    $__NR_timerfd_gettime, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(timerfd_gettime)
diff --git a/libc/arch-x86_64/syscalls/timerfd_settime.S b/libc/arch-x86_64/syscalls/timerfd_settime.S
deleted file mode 100644
index a524c0c..0000000
--- a/libc/arch-x86_64/syscalls/timerfd_settime.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(timerfd_settime)
-    movq    %rcx, %r10
-    movl    $__NR_timerfd_settime, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(timerfd_settime)
diff --git a/libc/arch-x86_64/syscalls/times.S b/libc/arch-x86_64/syscalls/times.S
deleted file mode 100644
index 89502bd..0000000
--- a/libc/arch-x86_64/syscalls/times.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(times)
-    movl    $__NR_times, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(times)
diff --git a/libc/arch-x86_64/syscalls/truncate.S b/libc/arch-x86_64/syscalls/truncate.S
deleted file mode 100644
index 4b953a3..0000000
--- a/libc/arch-x86_64/syscalls/truncate.S
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(truncate)
-    movl    $__NR_truncate, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(truncate)
-
-ALIAS_SYMBOL(truncate64, truncate)
diff --git a/libc/arch-x86_64/syscalls/umask.S b/libc/arch-x86_64/syscalls/umask.S
deleted file mode 100644
index acd37e8..0000000
--- a/libc/arch-x86_64/syscalls/umask.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umask)
-    movl    $__NR_umask, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(umask)
diff --git a/libc/arch-x86_64/syscalls/umount2.S b/libc/arch-x86_64/syscalls/umount2.S
deleted file mode 100644
index 438aedb..0000000
--- a/libc/arch-x86_64/syscalls/umount2.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(umount2)
-    movl    $__NR_umount2, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(umount2)
diff --git a/libc/arch-x86_64/syscalls/uname.S b/libc/arch-x86_64/syscalls/uname.S
deleted file mode 100644
index 6f077df..0000000
--- a/libc/arch-x86_64/syscalls/uname.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(uname)
-    movl    $__NR_uname, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(uname)
diff --git a/libc/arch-x86_64/syscalls/unlinkat.S b/libc/arch-x86_64/syscalls/unlinkat.S
deleted file mode 100644
index 80f0251..0000000
--- a/libc/arch-x86_64/syscalls/unlinkat.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unlinkat)
-    movl    $__NR_unlinkat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(unlinkat)
diff --git a/libc/arch-x86_64/syscalls/unshare.S b/libc/arch-x86_64/syscalls/unshare.S
deleted file mode 100644
index 8316d20..0000000
--- a/libc/arch-x86_64/syscalls/unshare.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(unshare)
-    movl    $__NR_unshare, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(unshare)
diff --git a/libc/arch-x86_64/syscalls/utimensat.S b/libc/arch-x86_64/syscalls/utimensat.S
deleted file mode 100644
index 3e43826..0000000
--- a/libc/arch-x86_64/syscalls/utimensat.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(utimensat)
-    movq    %rcx, %r10
-    movl    $__NR_utimensat, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(utimensat)
diff --git a/libc/arch-x86_64/syscalls/vmsplice.S b/libc/arch-x86_64/syscalls/vmsplice.S
deleted file mode 100644
index df775c6..0000000
--- a/libc/arch-x86_64/syscalls/vmsplice.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(vmsplice)
-    movq    %rcx, %r10
-    movl    $__NR_vmsplice, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(vmsplice)
diff --git a/libc/arch-x86_64/syscalls/wait4.S b/libc/arch-x86_64/syscalls/wait4.S
deleted file mode 100644
index d392dc7..0000000
--- a/libc/arch-x86_64/syscalls/wait4.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(wait4)
-    movq    %rcx, %r10
-    movl    $__NR_wait4, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(wait4)
diff --git a/libc/arch-x86_64/syscalls/write.S b/libc/arch-x86_64/syscalls/write.S
deleted file mode 100644
index 145c793..0000000
--- a/libc/arch-x86_64/syscalls/write.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(write)
-    movl    $__NR_write, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(write)
diff --git a/libc/arch-x86_64/syscalls/writev.S b/libc/arch-x86_64/syscalls/writev.S
deleted file mode 100644
index 8f8956f..0000000
--- a/libc/arch-x86_64/syscalls/writev.S
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(writev)
-    movl    $__NR_writev, %eax
-    syscall
-    cmpq    $-MAX_ERRNO, %rax
-    jb      1f
-    negl    %eax
-    movl    %eax, %edi
-    call    __set_errno_internal
-1:
-    ret
-END(writev)
diff --git a/libc/async_safe/Android.bp b/libc/async_safe/Android.bp
index 29f90d1..fbaaad1 100644
--- a/libc/async_safe/Android.bp
+++ b/libc/async_safe/Android.bp
@@ -12,6 +12,20 @@
     recovery_available: true,
 
     include_dirs: ["bionic/libc"],
+    header_libs: ["libc_headers", "liblog_headers"],
 
     export_include_dirs: ["include"],
+    export_header_lib_headers: ["liblog_headers"],
+    stl: "none",
+}
+
+cc_library_headers {
+    name: "libasync_safe_headers",
+    recovery_available: true,
+    defaults: ["linux_bionic_supported"],
+
+    export_include_dirs: ["include"],
+
+    system_shared_libs: [],
+    stl: "none",
 }
diff --git a/libc/async_safe/include/async_safe/CHECK.h b/libc/async_safe/include/async_safe/CHECK.h
new file mode 100644
index 0000000..bec89a3
--- /dev/null
+++ b/libc/async_safe/include/async_safe/CHECK.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#pragma once
+
+#include <sys/cdefs.h>
+
+#include <async_safe/log.h>
+
+__BEGIN_DECLS
+
+// TODO: replace this with something more like <android-base/logging.h>'s family of macros.
+
+#define CHECK(predicate) \
+  do { \
+    if (!(predicate)) { \
+      async_safe_fatal("%s:%d: %s CHECK '" #predicate "' failed", \
+          __FILE__, __LINE__, __FUNCTION__); \
+    } \
+  } while(0)
+
+__END_DECLS
diff --git a/libc/async_safe/include/async_safe/log.h b/libc/async_safe/include/async_safe/log.h
index df68062..0e02ea7 100644
--- a/libc/async_safe/include/async_safe/log.h
+++ b/libc/async_safe/include/async_safe/log.h
@@ -34,36 +34,14 @@
 #include <stdint.h>
 #include <stdlib.h>
 
+// This file is an alternative to <android/log.h>, but reuses
+// `android_LogPriority` and should not have conflicting identifiers.
+#include <android/log.h>
+
 // These functions do not allocate memory to send data to the log.
 
 __BEGIN_DECLS
 
-enum {
-  ANDROID_LOG_UNKNOWN = 0,
-  ANDROID_LOG_DEFAULT,    /* only for SetMinPriority() */
-
-  ANDROID_LOG_VERBOSE,
-  ANDROID_LOG_DEBUG,
-  ANDROID_LOG_INFO,
-  ANDROID_LOG_WARN,
-  ANDROID_LOG_ERROR,
-  ANDROID_LOG_FATAL,
-
-  ANDROID_LOG_SILENT,     /* only for SetMinPriority(); must be last */
-};
-
-enum {
-  LOG_ID_MIN = 0,
-
-  LOG_ID_MAIN = 0,
-  LOG_ID_RADIO = 1,
-  LOG_ID_EVENTS = 2,
-  LOG_ID_SYSTEM = 3,
-  LOG_ID_CRASH = 4,
-
-  LOG_ID_MAX
-};
-
 // Formats a message to the log (priority 'fatal'), then aborts.
 // Implemented as a macro so that async_safe_fatal isn't on the stack when we crash:
 // we appear to go straight from the caller to abort, saving an uninteresting stack
@@ -91,16 +69,8 @@
 
 int async_safe_format_fd(int fd, const char* format , ...) __printflike(2, 3);
 int async_safe_format_fd_va_list(int fd, const char* format, va_list args);
-int async_safe_format_log(int pri, const char* tag, const char* fmt, ...) __printflike(3, 4);
-int async_safe_format_log_va_list(int pri, const char* tag, const char* fmt, va_list ap);
-int async_safe_write_log(int pri, const char* tag, const char* msg);
-
-#define CHECK(predicate) \
-  do { \
-    if (!(predicate)) { \
-      async_safe_fatal("%s:%d: %s CHECK '" #predicate "' failed", \
-          __FILE__, __LINE__, __FUNCTION__); \
-    } \
-  } while(0)
+int async_safe_format_log(int priority, const char* tag, const char* fmt, ...) __printflike(3, 4);
+int async_safe_format_log_va_list(int priority, const char* tag, const char* fmt, va_list ap);
+int async_safe_write_log(int priority, const char* tag, const char* msg);
 
 __END_DECLS
diff --git a/libc/bionic/__bionic_get_shell_path.cpp b/libc/bionic/__bionic_get_shell_path.cpp
index 1352815..7aeed18 100644
--- a/libc/bionic/__bionic_get_shell_path.cpp
+++ b/libc/bionic/__bionic_get_shell_path.cpp
@@ -26,6 +26,8 @@
  * SUCH DAMAGE.
  */
 
+#include "private/__bionic_get_shell_path.h"
+
 #include <errno.h>
 #include <string.h>
 #include <sys/cdefs.h>
@@ -51,7 +53,7 @@
   return "/system/bin/sh";
 }
 
-__LIBC_HIDDEN__ extern "C" const char* __bionic_get_shell_path() {
+const char* __bionic_get_shell_path() {
   static const char* sh_path = init_sh_path();
   return sh_path;
 }
diff --git a/libc/bionic/__libc_init_main_thread.cpp b/libc/bionic/__libc_init_main_thread.cpp
index 5abdc07..4984e38 100644
--- a/libc/bionic/__libc_init_main_thread.cpp
+++ b/libc/bionic/__libc_init_main_thread.cpp
@@ -28,9 +28,12 @@
 
 #include "libc_init_common.h"
 
+#include <async_safe/log.h>
+
 #include "private/KernelArgumentBlock.h"
 #include "private/bionic_arc4random.h"
 #include "private/bionic_defs.h"
+#include "private/bionic_elf_tls.h"
 #include "private/bionic_globals.h"
 #include "private/bionic_ssp.h"
 #include "pthread_internal.h"
@@ -43,11 +46,6 @@
 
 static pthread_internal_t main_thread;
 
-__attribute__((no_sanitize("hwaddress")))
-pthread_internal_t* __get_main_thread() {
-  return &main_thread;
-}
-
 // Setup for the main thread. For dynamic executables, this is called by the
 // linker _before_ libc is mapped in memory. This means that all writes to
 // globals from this function will apply to linker-private copies and will not
@@ -69,35 +67,29 @@
 // linker, the linker binary hasn't been relocated yet, so certain kinds of code
 // are hazardous, such as accessing non-hidden global variables.
 __BIONIC_WEAK_FOR_NATIVE_BRIDGE
-void __libc_init_main_thread_early(KernelArgumentBlock& args) {
+extern "C" void __libc_init_main_thread_early(const KernelArgumentBlock& args,
+                                              bionic_tcb* temp_tcb) {
   __libc_shared_globals()->auxv = args.auxv;
 #if defined(__i386__)
-  __libc_init_sysinfo();
+  __libc_init_sysinfo(); // uses AT_SYSINFO auxv entry
 #endif
-  __set_tls(main_thread.tls);
-  __init_tls(&main_thread);
+  __init_tcb(temp_tcb, &main_thread);
+  __init_tcb_dtv(temp_tcb);
+  __set_tls(&temp_tcb->tls_slot(0));
   main_thread.tid = __getpid();
   main_thread.set_cached_pid(main_thread.tid);
 }
 
 // Finish initializing the main thread.
 __BIONIC_WEAK_FOR_NATIVE_BRIDGE
-void __libc_init_main_thread_late() {
-  main_thread.bionic_tls = __allocate_bionic_tls();
-  if (main_thread.bionic_tls == nullptr) {
-    // Avoid strerror because it might need bionic_tls.
-    async_safe_fatal("failed to allocate bionic_tls: error %d", errno);
-  }
+extern "C" void __libc_init_main_thread_late() {
+  __init_bionic_tls_ptrs(__get_bionic_tcb(), __allocate_temp_bionic_tls());
 
   // Tell the kernel to clear our tid field when we exit, so we're like any other pthread.
+  // For threads created by pthread_create, this setup happens during the clone syscall (i.e.
+  // CLONE_CHILD_CLEARTID).
   __set_tid_address(&main_thread.tid);
 
-  // We don't want to free the main thread's stack even when the main thread exits
-  // because things like environment variables with global scope live on it.
-  // We also can't free the pthread_internal_t itself, since it is a static variable.
-  // The main thread has no mmap allocated space for stack or pthread_internal_t.
-  main_thread.mmap_size = 0;
-
   pthread_attr_init(&main_thread.attr);
   // We don't want to explicitly set the main thread's scheduler attributes (http://b/68328561).
   pthread_attr_setinheritsched(&main_thread.attr, PTHREAD_INHERIT_SCHED);
@@ -110,9 +102,41 @@
   // before we initialize the TLS. Dynamic executables will initialize their copy of the global
   // stack protector from the one in the main thread's TLS.
   __libc_safe_arc4random_buf(&__stack_chk_guard, sizeof(__stack_chk_guard));
-  __init_tls_stack_guard(&main_thread);
+  __init_tcb_stack_guard(__get_bionic_tcb());
 
   __init_thread(&main_thread);
 
   __init_additional_stacks(&main_thread);
 }
+
+// Once all ELF modules are loaded, allocate the final copy of the main thread's
+// static TLS memory.
+__BIONIC_WEAK_FOR_NATIVE_BRIDGE
+extern "C" void __libc_init_main_thread_final() {
+  bionic_tcb* temp_tcb = __get_bionic_tcb();
+  bionic_tls* temp_tls = &__get_bionic_tls();
+
+  // Allocate the main thread's static TLS. (This mapping doesn't include a
+  // stack.)
+  ThreadMapping mapping = __allocate_thread_mapping(0, PTHREAD_GUARD_SIZE);
+  if (mapping.mmap_base == nullptr) {
+    async_safe_fatal("failed to mmap main thread static TLS: %s", strerror(errno));
+  }
+
+  const StaticTlsLayout& layout = __libc_shared_globals()->static_tls_layout;
+  auto new_tcb = reinterpret_cast<bionic_tcb*>(mapping.static_tls + layout.offset_bionic_tcb());
+  auto new_tls = reinterpret_cast<bionic_tls*>(mapping.static_tls + layout.offset_bionic_tls());
+
+  __init_static_tls(mapping.static_tls);
+  new_tcb->copy_from_bootstrap(temp_tcb);
+  new_tls->copy_from_bootstrap(temp_tls);
+  __init_tcb(new_tcb, &main_thread);
+  __init_bionic_tls_ptrs(new_tcb, new_tls);
+
+  main_thread.mmap_base = mapping.mmap_base;
+  main_thread.mmap_size = mapping.mmap_size;
+
+  __set_tls(&new_tcb->tls_slot(0));
+
+  __free_temp_bionic_tls(temp_tls);
+}
diff --git a/libc/bionic/android_set_abort_message.cpp b/libc/bionic/android_set_abort_message.cpp
index 56e6771..2ea12ee 100644
--- a/libc/bionic/android_set_abort_message.cpp
+++ b/libc/bionic/android_set_abort_message.cpp
@@ -33,6 +33,7 @@
 #include <stddef.h>
 #include <string.h>
 #include <sys/mman.h>
+#include <sys/prctl.h>
 
 #include "private/bionic_defs.h"
 #include "private/bionic_globals.h"
@@ -82,6 +83,10 @@
     return;
   }
 
+  // Name the abort message mapping to make it easier for tools to find the
+  // mapping.
+  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, map, size, "abort message");
+
   magic_abort_msg_t* new_magic_abort_message = reinterpret_cast<magic_abort_msg_t*>(map);
   fill_abort_message_magic(new_magic_abort_message);
   new_magic_abort_message->msg.size = size;
diff --git a/libc/bionic/bionic_allocator.cpp b/libc/bionic/bionic_allocator.cpp
new file mode 100644
index 0000000..168d6ba
--- /dev/null
+++ b/libc/bionic/bionic_allocator.cpp
@@ -0,0 +1,404 @@
+/*
+ * Copyright (C) 2015 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 "private/bionic_allocator.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/param.h>
+#include <sys/prctl.h>
+#include <unistd.h>
+
+#include <new>
+
+#include <async_safe/log.h>
+#include <async_safe/CHECK.h>
+
+#include "private/bionic_macros.h"
+#include "private/bionic_page.h"
+
+//
+// BionicAllocator is a general purpose allocator designed to provide the same
+// functionality as the malloc/free/realloc/memalign libc functions.
+//
+// On alloc:
+// If size is > 1k allocator proxies malloc call directly to mmap.
+// If size <= 1k allocator uses BionicSmallObjectAllocator for the size
+// rounded up to the nearest power of two.
+//
+// On free:
+//
+// For a pointer allocated using proxy-to-mmap allocator unmaps
+// the memory.
+//
+// For a pointer allocated using BionicSmallObjectAllocator it adds
+// the block to free_blocks_list in the corresponding page. If the number of
+// free pages reaches 2, BionicSmallObjectAllocator munmaps one of the pages
+// keeping the other one in reserve.
+
+// Memory management for large objects is fairly straightforward, but for small
+// objects it is more complicated.  If you are changing this code, one simple
+// way to evaluate the memory usage change is by running 'dd' and examine the
+// memory usage by 'showmap $(pidof dd)'.  'dd' is nice in that:
+//   1. It links in quite a few libraries, so you get some linker memory use.
+//   2. When run with no arguments, it sits waiting for input, so it is easy to
+//      examine its memory usage with showmap.
+//   3. Since it does nothing while waiting for input, the memory usage is
+//      determinisitic.
+
+static const char kSignature[4] = {'L', 'M', 'A', 1};
+
+static const size_t kSmallObjectMaxSize = 1 << kSmallObjectMaxSizeLog2;
+
+// This type is used for large allocations (with size >1k)
+static const uint32_t kLargeObject = 111;
+
+// Allocated pointers must be at least 16-byte aligned.  Round up the size of
+// page_info to multiple of 16.
+static constexpr size_t kPageInfoSize = __BIONIC_ALIGN(sizeof(page_info), 16);
+
+static inline uint16_t log2(size_t number) {
+  uint16_t result = 0;
+  number--;
+
+  while (number != 0) {
+    result++;
+    number >>= 1;
+  }
+
+  return result;
+}
+
+BionicSmallObjectAllocator::BionicSmallObjectAllocator(uint32_t type,
+                                                       size_t block_size)
+    : type_(type),
+      block_size_(block_size),
+      blocks_per_page_((PAGE_SIZE - sizeof(small_object_page_info)) /
+                       block_size),
+      free_pages_cnt_(0),
+      page_list_(nullptr) {}
+
+void* BionicSmallObjectAllocator::alloc() {
+  CHECK(block_size_ != 0);
+
+  if (page_list_ == nullptr) {
+    alloc_page();
+  }
+
+  // Fully allocated pages are de-managed and removed from the page list, so
+  // every page from the page list must be useable.  Let's just take the first
+  // one.
+  small_object_page_info* page = page_list_;
+  CHECK(page->free_block_list != nullptr);
+
+  small_object_block_record* const block_record = page->free_block_list;
+  if (block_record->free_blocks_cnt > 1) {
+    small_object_block_record* next_free =
+        reinterpret_cast<small_object_block_record*>(
+            reinterpret_cast<uint8_t*>(block_record) + block_size_);
+    next_free->next = block_record->next;
+    next_free->free_blocks_cnt = block_record->free_blocks_cnt - 1;
+    page->free_block_list = next_free;
+  } else {
+    page->free_block_list = block_record->next;
+  }
+
+  if (page->free_blocks_cnt == blocks_per_page_) {
+    free_pages_cnt_--;
+  }
+
+  page->free_blocks_cnt--;
+
+  memset(block_record, 0, block_size_);
+
+  if (page->free_blocks_cnt == 0) {
+    // De-manage fully allocated pages.  These pages will be managed again if
+    // a block is freed.
+    remove_from_page_list(page);
+  }
+
+  return block_record;
+}
+
+void BionicSmallObjectAllocator::free_page(small_object_page_info* page) {
+  CHECK(page->free_blocks_cnt == blocks_per_page_);
+  if (page->prev_page) {
+    page->prev_page->next_page = page->next_page;
+  }
+  if (page->next_page) {
+    page->next_page->prev_page = page->prev_page;
+  }
+  if (page_list_ == page) {
+    page_list_ = page->next_page;
+  }
+  munmap(page, PAGE_SIZE);
+  free_pages_cnt_--;
+}
+
+void BionicSmallObjectAllocator::free(void* ptr) {
+  small_object_page_info* const page =
+      reinterpret_cast<small_object_page_info*>(
+          PAGE_START(reinterpret_cast<uintptr_t>(ptr)));
+
+  if (reinterpret_cast<uintptr_t>(ptr) % block_size_ != 0) {
+    async_safe_fatal("invalid pointer: %p (block_size=%zd)", ptr, block_size_);
+  }
+
+  memset(ptr, 0, block_size_);
+  small_object_block_record* const block_record =
+      reinterpret_cast<small_object_block_record*>(ptr);
+
+  block_record->next = page->free_block_list;
+  block_record->free_blocks_cnt = 1;
+
+  page->free_block_list = block_record;
+  page->free_blocks_cnt++;
+
+  if (page->free_blocks_cnt == blocks_per_page_) {
+    if (++free_pages_cnt_ > 1) {
+      // if we already have a free page - unmap this one.
+      free_page(page);
+    }
+  } else if (page->free_blocks_cnt == 1) {
+    // We just freed from a full page.  Add this page back to the list.
+    add_to_page_list(page);
+  }
+}
+
+void BionicSmallObjectAllocator::alloc_page() {
+  void* const map_ptr = mmap(nullptr, PAGE_SIZE, PROT_READ | PROT_WRITE,
+                             MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+  if (map_ptr == MAP_FAILED) {
+    async_safe_fatal("mmap failed: %s", strerror(errno));
+  }
+
+  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, map_ptr, PAGE_SIZE,
+        "bionic_alloc_small_objects");
+
+  small_object_page_info* const page =
+      reinterpret_cast<small_object_page_info*>(map_ptr);
+  memcpy(page->info.signature, kSignature, sizeof(kSignature));
+  page->info.type = type_;
+  page->info.allocator_addr = this;
+
+  page->free_blocks_cnt = blocks_per_page_;
+
+  // Align the first block to block_size_.
+  const uintptr_t first_block_addr =
+      __BIONIC_ALIGN(reinterpret_cast<uintptr_t>(page + 1), block_size_);
+  small_object_block_record* const first_block =
+      reinterpret_cast<small_object_block_record*>(first_block_addr);
+
+  first_block->next = nullptr;
+  first_block->free_blocks_cnt = blocks_per_page_;
+
+  page->free_block_list = first_block;
+
+  add_to_page_list(page);
+
+  free_pages_cnt_++;
+}
+
+void BionicSmallObjectAllocator::add_to_page_list(small_object_page_info* page) {
+  page->next_page = page_list_;
+  page->prev_page = nullptr;
+  if (page_list_) {
+    page_list_->prev_page = page;
+  }
+  page_list_ = page;
+}
+
+void BionicSmallObjectAllocator::remove_from_page_list(
+    small_object_page_info* page) {
+  if (page->prev_page) {
+    page->prev_page->next_page = page->next_page;
+  }
+  if (page->next_page) {
+    page->next_page->prev_page = page->prev_page;
+  }
+  if (page_list_ == page) {
+    page_list_ = page->next_page;
+  }
+  page->prev_page = nullptr;
+  page->next_page = nullptr;
+}
+
+void BionicAllocator::initialize_allocators() {
+  if (allocators_ != nullptr) {
+    return;
+  }
+
+  BionicSmallObjectAllocator* allocators =
+      reinterpret_cast<BionicSmallObjectAllocator*>(allocators_buf_);
+
+  for (size_t i = 0; i < kSmallObjectAllocatorsCount; ++i) {
+    uint32_t type = i + kSmallObjectMinSizeLog2;
+    new (allocators + i) BionicSmallObjectAllocator(type, 1 << type);
+  }
+
+  allocators_ = allocators;
+}
+
+void* BionicAllocator::alloc_mmap(size_t align, size_t size) {
+  size_t header_size = __BIONIC_ALIGN(kPageInfoSize, align);
+  size_t allocated_size;
+  if (__builtin_add_overflow(header_size, size, &allocated_size) ||
+      PAGE_END(allocated_size) < allocated_size) {
+    async_safe_fatal("overflow trying to alloc %zu bytes", size);
+  }
+  allocated_size = PAGE_END(allocated_size);
+  void* map_ptr = mmap(nullptr, allocated_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
+                       -1, 0);
+
+  if (map_ptr == MAP_FAILED) {
+    async_safe_fatal("mmap failed: %s", strerror(errno));
+  }
+
+  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, map_ptr, allocated_size, "bionic_alloc_lob");
+
+  void* result = static_cast<char*>(map_ptr) + header_size;
+  page_info* info = get_page_info_unchecked(result);
+  memcpy(info->signature, kSignature, sizeof(kSignature));
+  info->type = kLargeObject;
+  info->allocated_size = allocated_size;
+
+  return result;
+}
+
+
+inline void* BionicAllocator::alloc_impl(size_t align, size_t size) {
+  if (size > kSmallObjectMaxSize) {
+    return alloc_mmap(align, size);
+  }
+
+  uint16_t log2_size = log2(size);
+
+  if (log2_size < kSmallObjectMinSizeLog2) {
+    log2_size = kSmallObjectMinSizeLog2;
+  }
+
+  return get_small_object_allocator(log2_size)->alloc();
+}
+
+void* BionicAllocator::alloc(size_t size) {
+  // treat alloc(0) as alloc(1)
+  if (size == 0) {
+    size = 1;
+  }
+  return alloc_impl(16, size);
+}
+
+void* BionicAllocator::memalign(size_t align, size_t size) {
+  // The Bionic allocator only supports alignment up to one page, which is good
+  // enough for ELF TLS.
+  align = MIN(align, PAGE_SIZE);
+  align = MAX(align, 16);
+  if (!powerof2(align)) {
+    align = BIONIC_ROUND_UP_POWER_OF_2(align);
+  }
+  size = MAX(size, align);
+  return alloc_impl(align, size);
+}
+
+inline page_info* BionicAllocator::get_page_info_unchecked(void* ptr) {
+  uintptr_t header_page = PAGE_START(reinterpret_cast<size_t>(ptr) - kPageInfoSize);
+  return reinterpret_cast<page_info*>(header_page);
+}
+
+inline page_info* BionicAllocator::get_page_info(void* ptr) {
+  page_info* info = get_page_info_unchecked(ptr);
+  if (memcmp(info->signature, kSignature, sizeof(kSignature)) != 0) {
+    async_safe_fatal("invalid pointer %p (page signature mismatch)", ptr);
+  }
+
+  return info;
+}
+
+void* BionicAllocator::realloc(void* ptr, size_t size) {
+  if (ptr == nullptr) {
+    return alloc(size);
+  }
+
+  if (size == 0) {
+    free(ptr);
+    return nullptr;
+  }
+
+  page_info* info = get_page_info(ptr);
+
+  size_t old_size = 0;
+
+  if (info->type == kLargeObject) {
+    old_size = info->allocated_size - (static_cast<char*>(ptr) - reinterpret_cast<char*>(info));
+  } else {
+    BionicSmallObjectAllocator* allocator = get_small_object_allocator(info->type);
+    if (allocator != info->allocator_addr) {
+      async_safe_fatal("invalid pointer %p (page signature mismatch)", ptr);
+    }
+
+    old_size = allocator->get_block_size();
+  }
+
+  if (old_size < size) {
+    void *result = alloc(size);
+    memcpy(result, ptr, old_size);
+    free(ptr);
+    return result;
+  }
+
+  return ptr;
+}
+
+void BionicAllocator::free(void* ptr) {
+  if (ptr == nullptr) {
+    return;
+  }
+
+  page_info* info = get_page_info(ptr);
+
+  if (info->type == kLargeObject) {
+    munmap(info, info->allocated_size);
+  } else {
+    BionicSmallObjectAllocator* allocator = get_small_object_allocator(info->type);
+    if (allocator != info->allocator_addr) {
+      async_safe_fatal("invalid pointer %p (invalid allocator address for the page)", ptr);
+    }
+
+    allocator->free(ptr);
+  }
+}
+
+BionicSmallObjectAllocator* BionicAllocator::get_small_object_allocator(uint32_t type) {
+  if (type < kSmallObjectMinSizeLog2 || type > kSmallObjectMaxSizeLog2) {
+    async_safe_fatal("invalid type: %u", type);
+  }
+
+  initialize_allocators();
+  return &allocators_[type - kSmallObjectMinSizeLog2];
+}
diff --git a/libc/bionic/bionic_elf_tls.cpp b/libc/bionic/bionic_elf_tls.cpp
new file mode 100644
index 0000000..3fa5182
--- /dev/null
+++ b/libc/bionic/bionic_elf_tls.cpp
@@ -0,0 +1,366 @@
+/*
+ * Copyright (C) 2019 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 "private/bionic_elf_tls.h"
+
+#include <async_safe/log.h>
+#include <string.h>
+#include <sys/param.h>
+#include <unistd.h>
+
+#include "private/ScopedRWLock.h"
+#include "private/ScopedSignalBlocker.h"
+#include "private/bionic_globals.h"
+#include "private/bionic_macros.h"
+#include "private/bionic_tls.h"
+#include "pthread_internal.h"
+
+// Every call to __tls_get_addr needs to check the generation counter, so
+// accesses to the counter need to be as fast as possible. Keep a copy of it in
+// a hidden variable, which can be accessed without using the GOT. The linker
+// will update this variable when it updates its counter.
+//
+// To allow the linker to update this variable, libc.so's constructor passes its
+// address to the linker. To accommodate a possible __tls_get_addr call before
+// libc.so's constructor, this local copy is initialized to SIZE_MAX, forcing
+// __tls_get_addr to initially use the slow path.
+__LIBC_HIDDEN__ _Atomic(size_t) __libc_tls_generation_copy = SIZE_MAX;
+
+// Search for a TLS segment in the given phdr table. Returns true if it has a
+// TLS segment and false otherwise.
+bool __bionic_get_tls_segment(const ElfW(Phdr)* phdr_table, size_t phdr_count,
+                              ElfW(Addr) load_bias, TlsSegment* out) {
+  for (size_t i = 0; i < phdr_count; ++i) {
+    const ElfW(Phdr)& phdr = phdr_table[i];
+    if (phdr.p_type == PT_TLS) {
+      *out = TlsSegment {
+        phdr.p_memsz,
+        phdr.p_align,
+        reinterpret_cast<void*>(load_bias + phdr.p_vaddr),
+        phdr.p_filesz,
+      };
+      return true;
+    }
+  }
+  return false;
+}
+
+// Return true if the alignment of a TLS segment is a valid power-of-two. Also
+// cap the alignment if it's too high.
+bool __bionic_check_tls_alignment(size_t* alignment) {
+  // N.B. The size does not need to be a multiple of the alignment. With
+  // ld.bfd (or after using binutils' strip), the TLS segment's size isn't
+  // rounded up.
+  if (*alignment == 0 || !powerof2(*alignment)) {
+    return false;
+  }
+  // Bionic only respects TLS alignment up to one page.
+  *alignment = MIN(*alignment, PAGE_SIZE);
+  return true;
+}
+
+size_t StaticTlsLayout::offset_thread_pointer() const {
+  return offset_bionic_tcb_ + (-MIN_TLS_SLOT * sizeof(void*));
+}
+
+// Reserves space for the Bionic TCB and the executable's TLS segment. Returns
+// the offset of the executable's TLS segment.
+size_t StaticTlsLayout::reserve_exe_segment_and_tcb(const TlsSegment* exe_segment,
+                                                    const char* progname __attribute__((unused))) {
+  // Special case: if the executable has no TLS segment, then just allocate a
+  // TCB and skip the minimum alignment check on ARM.
+  if (exe_segment == nullptr) {
+    offset_bionic_tcb_ = reserve_type<bionic_tcb>();
+    return 0;
+  }
+
+#if defined(__arm__) || defined(__aarch64__)
+
+  // First reserve enough space for the TCB before the executable segment.
+  reserve(sizeof(bionic_tcb), 1);
+
+  // Then reserve the segment itself.
+  const size_t result = reserve(exe_segment->size, exe_segment->alignment);
+
+  // The variant 1 ABI that ARM linkers follow specifies a 2-word TCB between
+  // the thread pointer and the start of the executable's TLS segment, but both
+  // the thread pointer and the TLS segment are aligned appropriately for the
+  // TLS segment. Calculate the distance between the thread pointer and the
+  // EXE's segment.
+  const size_t exe_tpoff = __BIONIC_ALIGN(sizeof(void*) * 2, exe_segment->alignment);
+
+  const size_t min_bionic_alignment = BIONIC_ROUND_UP_POWER_OF_2(MAX_TLS_SLOT) * sizeof(void*);
+  if (exe_tpoff < min_bionic_alignment) {
+    async_safe_fatal("error: \"%s\": executable's TLS segment is underaligned: "
+                     "alignment is %zu, needs to be at least %zu for %s Bionic",
+                     progname, exe_segment->alignment, min_bionic_alignment,
+                     (sizeof(void*) == 4 ? "ARM" : "ARM64"));
+  }
+
+  offset_bionic_tcb_ = result - exe_tpoff - (-MIN_TLS_SLOT * sizeof(void*));
+  return result;
+
+#elif defined(__i386__) || defined(__x86_64__)
+
+  // x86 uses variant 2 TLS layout. The executable's segment is located just
+  // before the TCB.
+  static_assert(MIN_TLS_SLOT == 0, "First slot of bionic_tcb must be slot #0 on x86");
+  const size_t exe_size = round_up_with_overflow_check(exe_segment->size, exe_segment->alignment);
+  reserve(exe_size, 1);
+  const size_t max_align = MAX(alignof(bionic_tcb), exe_segment->alignment);
+  offset_bionic_tcb_ = reserve(sizeof(bionic_tcb), max_align);
+  return offset_bionic_tcb_ - exe_size;
+
+#else
+#error "Unrecognized architecture"
+#endif
+}
+
+void StaticTlsLayout::reserve_bionic_tls() {
+  offset_bionic_tls_ = reserve_type<bionic_tls>();
+}
+
+void StaticTlsLayout::finish_layout() {
+  // Round the offset up to the alignment.
+  offset_ = round_up_with_overflow_check(offset_, alignment_);
+
+  if (overflowed_) {
+    async_safe_fatal("error: TLS segments in static TLS overflowed");
+  }
+}
+
+// The size is not required to be a multiple of the alignment. The alignment
+// must be a positive power-of-two.
+size_t StaticTlsLayout::reserve(size_t size, size_t alignment) {
+  offset_ = round_up_with_overflow_check(offset_, alignment);
+  const size_t result = offset_;
+  if (__builtin_add_overflow(offset_, size, &offset_)) overflowed_ = true;
+  alignment_ = MAX(alignment_, alignment);
+  return result;
+}
+
+size_t StaticTlsLayout::round_up_with_overflow_check(size_t value, size_t alignment) {
+  const size_t old_value = value;
+  value = __BIONIC_ALIGN(value, alignment);
+  if (value < old_value) overflowed_ = true;
+  return value;
+}
+
+// Copy each TLS module's initialization image into a newly-allocated block of
+// static TLS memory. To reduce dirty pages, this function only writes to pages
+// within the static TLS that need initialization. The memory should already be
+// zero-initialized on entry.
+void __init_static_tls(void* static_tls) {
+  // The part of the table we care about (i.e. static TLS modules) never changes
+  // after startup, but we still need the mutex because the table could grow,
+  // moving the initial part. If this locking is too slow, we can duplicate the
+  // static part of the table.
+  TlsModules& modules = __libc_shared_globals()->tls_modules;
+  ScopedSignalBlocker ssb;
+  ScopedReadLock locker(&modules.rwlock);
+
+  for (size_t i = 0; i < modules.module_count; ++i) {
+    TlsModule& module = modules.module_table[i];
+    if (module.static_offset == SIZE_MAX) {
+      // All of the static modules come before all of the dynamic modules, so
+      // once we see the first dynamic module, we're done.
+      break;
+    }
+    if (module.segment.init_size == 0) {
+      // Skip the memcpy call for TLS segments with no initializer, which is
+      // common.
+      continue;
+    }
+    memcpy(static_cast<char*>(static_tls) + module.static_offset,
+           module.segment.init_ptr,
+           module.segment.init_size);
+  }
+}
+
+static inline size_t dtv_size_in_bytes(size_t module_count) {
+  return sizeof(TlsDtv) + module_count * sizeof(void*);
+}
+
+// Calculates the number of module slots to allocate in a new DTV. For small
+// objects (up to 1KiB), the TLS allocator allocates memory in power-of-2 sizes,
+// so for better space usage, ensure that the DTV size (header + slots) is a
+// power of 2.
+//
+// The lock on TlsModules must be held.
+static size_t calculate_new_dtv_count() {
+  size_t loaded_cnt = __libc_shared_globals()->tls_modules.module_count;
+  size_t bytes = dtv_size_in_bytes(MAX(1, loaded_cnt));
+  if (!powerof2(bytes)) {
+    bytes = BIONIC_ROUND_UP_POWER_OF_2(bytes);
+  }
+  return (bytes - sizeof(TlsDtv)) / sizeof(void*);
+}
+
+// This function must be called with signals blocked and a write lock on
+// TlsModules held.
+static void update_tls_dtv(bionic_tcb* tcb) {
+  const TlsModules& modules = __libc_shared_globals()->tls_modules;
+  BionicAllocator& allocator = __libc_shared_globals()->tls_allocator;
+
+  // Use the generation counter from the shared globals instead of the local
+  // copy, which won't be initialized yet if __tls_get_addr is called before
+  // libc.so's constructor.
+  if (__get_tcb_dtv(tcb)->generation == atomic_load(&modules.generation)) {
+    return;
+  }
+
+  const size_t old_cnt = __get_tcb_dtv(tcb)->count;
+
+  // If the DTV isn't large enough, allocate a larger one. Because a signal
+  // handler could interrupt the fast path of __tls_get_addr, we don't free the
+  // old DTV. Instead, we add the old DTV to a list, then free all of a thread's
+  // DTVs at thread-exit. Each time the DTV is reallocated, its size at least
+  // doubles.
+  if (modules.module_count > old_cnt) {
+    size_t new_cnt = calculate_new_dtv_count();
+    TlsDtv* const old_dtv = __get_tcb_dtv(tcb);
+    TlsDtv* const new_dtv = static_cast<TlsDtv*>(allocator.alloc(dtv_size_in_bytes(new_cnt)));
+    memcpy(new_dtv, old_dtv, dtv_size_in_bytes(old_cnt));
+    new_dtv->count = new_cnt;
+    new_dtv->next = old_dtv;
+    __set_tcb_dtv(tcb, new_dtv);
+  }
+
+  TlsDtv* const dtv = __get_tcb_dtv(tcb);
+
+  const StaticTlsLayout& layout = __libc_shared_globals()->static_tls_layout;
+  char* static_tls = reinterpret_cast<char*>(tcb) - layout.offset_bionic_tcb();
+
+  // Initialize static TLS modules and free unloaded modules.
+  for (size_t i = 0; i < dtv->count; ++i) {
+    if (i < modules.module_count) {
+      const TlsModule& mod = modules.module_table[i];
+      if (mod.static_offset != SIZE_MAX) {
+        dtv->modules[i] = static_tls + mod.static_offset;
+        continue;
+      }
+      if (mod.first_generation != kTlsGenerationNone &&
+          mod.first_generation <= dtv->generation) {
+        continue;
+      }
+    }
+    allocator.free(dtv->modules[i]);
+    dtv->modules[i] = nullptr;
+  }
+
+  dtv->generation = atomic_load(&modules.generation);
+}
+
+__attribute__((noinline)) static void* tls_get_addr_slow_path(const TlsIndex* ti) {
+  TlsModules& modules = __libc_shared_globals()->tls_modules;
+  bionic_tcb* tcb = __get_bionic_tcb();
+
+  // Block signals and lock TlsModules. We may need the allocator, so take
+  // a write lock.
+  ScopedSignalBlocker ssb;
+  ScopedWriteLock locker(&modules.rwlock);
+
+  update_tls_dtv(tcb);
+
+  TlsDtv* dtv = __get_tcb_dtv(tcb);
+  const size_t module_idx = __tls_module_id_to_idx(ti->module_id);
+  void* mod_ptr = dtv->modules[module_idx];
+  if (mod_ptr == nullptr) {
+    const TlsSegment& segment = modules.module_table[module_idx].segment;
+    mod_ptr = __libc_shared_globals()->tls_allocator.memalign(segment.alignment, segment.size);
+    if (segment.init_size > 0) {
+      memcpy(mod_ptr, segment.init_ptr, segment.init_size);
+    }
+    dtv->modules[module_idx] = mod_ptr;
+  }
+
+  return static_cast<char*>(mod_ptr) + ti->offset;
+}
+
+// Returns the address of a thread's TLS memory given a module ID and an offset
+// into that module's TLS segment. This function is called on every access to a
+// dynamic TLS variable on targets that don't use TLSDESC. arm64 uses TLSDESC,
+// so it only calls this function on a thread's first access to a module's TLS
+// segment.
+//
+// On most targets, this accessor function is __tls_get_addr and
+// TLS_GET_ADDR_CCONV is unset. 32-bit x86 uses ___tls_get_addr instead and a
+// regparm() calling convention.
+extern "C" void* TLS_GET_ADDR(const TlsIndex* ti) TLS_GET_ADDR_CCONV {
+  TlsDtv* dtv = __get_tcb_dtv(__get_bionic_tcb());
+
+  // TODO: See if we can use a relaxed memory ordering here instead.
+  size_t generation = atomic_load(&__libc_tls_generation_copy);
+  if (__predict_true(generation == dtv->generation)) {
+    void* mod_ptr = dtv->modules[__tls_module_id_to_idx(ti->module_id)];
+    if (__predict_true(mod_ptr != nullptr)) {
+      return static_cast<char*>(mod_ptr) + ti->offset;
+    }
+  }
+
+  return tls_get_addr_slow_path(ti);
+}
+
+// This function frees:
+//  - TLS modules referenced by the current DTV.
+//  - The list of DTV objects associated with the current thread.
+//
+// The caller must have already blocked signals.
+void __free_dynamic_tls(bionic_tcb* tcb) {
+  TlsModules& modules = __libc_shared_globals()->tls_modules;
+  BionicAllocator& allocator = __libc_shared_globals()->tls_allocator;
+
+  // If we didn't allocate any dynamic memory, skip out early without taking
+  // the lock.
+  TlsDtv* dtv = __get_tcb_dtv(tcb);
+  if (dtv->generation == kTlsGenerationNone) {
+    return;
+  }
+
+  // We need the write lock to use the allocator.
+  ScopedWriteLock locker(&modules.rwlock);
+
+  // First free everything in the current DTV.
+  for (size_t i = 0; i < dtv->count; ++i) {
+    if (i < modules.module_count && modules.module_table[i].static_offset != SIZE_MAX) {
+      // This module's TLS memory is allocated statically, so don't free it here.
+      continue;
+    }
+    allocator.free(dtv->modules[i]);
+  }
+
+  // Now free the thread's list of DTVs.
+  while (dtv->generation != kTlsGenerationNone) {
+    TlsDtv* next = dtv->next;
+    allocator.free(dtv);
+    dtv = next;
+  }
+
+  // Clear the DTV slot. The DTV must not be used again with this thread.
+  tcb->tls_slot(TLS_SLOT_DTV) = nullptr;
+}
diff --git a/libc/bionic/bionic_systrace.cpp b/libc/bionic/bionic_systrace.cpp
index bac3d88..6182ed8 100644
--- a/libc/bionic/bionic_systrace.cpp
+++ b/libc/bionic/bionic_systrace.cpp
@@ -82,7 +82,7 @@
     return;
   }
 
-  TEMP_FAILURE_RETRY(write(trace_marker_fd, "E", 1));
+  TEMP_FAILURE_RETRY(write(trace_marker_fd, "E|", 2));
 }
 
 ScopedTrace::ScopedTrace(const char* message) : called_end_(false) {
diff --git a/libc/bionic/exec.cpp b/libc/bionic/exec.cpp
index 1cf3a58..3309585 100644
--- a/libc/bionic/exec.cpp
+++ b/libc/bionic/exec.cpp
@@ -39,6 +39,7 @@
 #include <string.h>
 #include <unistd.h>
 
+#include "private/__bionic_get_shell_path.h"
 #include "private/FdPath.h"
 
 extern "C" char** environ;
@@ -111,7 +112,7 @@
   script_argv[0] = "sh";
   script_argv[1] = buf;
   memcpy(script_argv + 2, argv + 1, arg_count * sizeof(char*));
-  return execve(_PATH_BSHELL, const_cast<char**>(script_argv), envp);
+  return execve(__bionic_get_shell_path(), const_cast<char**>(script_argv), envp);
 }
 
 int execvpe(const char* name, char* const* argv, char* const* envp) {
diff --git a/libc/bionic/icu.cpp b/libc/bionic/icu.cpp
index c09c9ea..72dac9b 100644
--- a/libc/bionic/icu.cpp
+++ b/libc/bionic/icu.cpp
@@ -36,48 +36,12 @@
 
 #include <async_safe/log.h>
 
-// Allowed icu4c version numbers are in the range [44, 999].
-// Gingerbread's icu4c 4.4 is the minimum supported ICU version.
-static constexpr auto ICUDATA_VERSION_MIN_LENGTH = 2;
-static constexpr auto ICUDATA_VERSION_MAX_LENGTH = 3;
-static constexpr auto ICUDATA_VERSION_MIN = 44;
-
-static char g_icudata_version[ICUDATA_VERSION_MAX_LENGTH + 1];
-
 static void* g_libicuuc_handle = nullptr;
 
-static int __icu_dat_file_filter(const dirent* dirp) {
-  const char* name = dirp->d_name;
-
-  // Is the name the right length to match 'icudt(\d\d\d)l.dat'?
-  const size_t len = strlen(name);
-  if (len < 10 + ICUDATA_VERSION_MIN_LENGTH || len > 10 + ICUDATA_VERSION_MAX_LENGTH) return 0;
-
-  return !strncmp(name, "icudt", 5) && !strncmp(&name[len - 5], "l.dat", 5);
-}
-
 static bool __find_icu() {
-  dirent** namelist = nullptr;
-  int n = scandir("/system/usr/icu", &namelist, &__icu_dat_file_filter, alphasort);
-  int max_version = -1;
-  while (n--) {
-    // We prefer the latest version available.
-    int version = atoi(&namelist[n]->d_name[strlen("icudt")]);
-    if (version != 0 && version > max_version) max_version = version;
-    free(namelist[n]);
-  }
-  free(namelist);
-
-  if (max_version < ICUDATA_VERSION_MIN) {
-    async_safe_write_log(ANDROID_LOG_ERROR, "bionic-icu", "couldn't find an ICU .dat file");
-    return false;
-  }
-
-  snprintf(g_icudata_version, sizeof(g_icudata_version), "_%d", max_version);
-
-  g_libicuuc_handle = dlopen("libicuuc.so", RTLD_LOCAL);
+  g_libicuuc_handle = dlopen("libandroidicu.so", RTLD_LOCAL);
   if (g_libicuuc_handle == nullptr) {
-    async_safe_format_log(ANDROID_LOG_ERROR, "bionic-icu", "couldn't open libicuuc.so: %s",
+    async_safe_format_log(ANDROID_LOG_ERROR, "bionic-icu", "couldn't open libandroidicu.so: %s",
                           dlerror());
     return false;
   }
@@ -89,9 +53,9 @@
   static bool found_icu = __find_icu();
   if (!found_icu) return nullptr;
 
-  char versioned_symbol_name[strlen(symbol_name) + sizeof(g_icudata_version)];
-  snprintf(versioned_symbol_name, sizeof(versioned_symbol_name), "%s%s",
-           symbol_name, g_icudata_version);
+  char versioned_symbol_name[strlen(symbol_name) + strlen("_android") + 1];
+  snprintf(versioned_symbol_name, sizeof(versioned_symbol_name), "%s_android",
+           symbol_name);
 
   void* symbol = dlsym(g_libicuuc_handle, versioned_symbol_name);
   if (symbol == nullptr) {
diff --git a/libc/bionic/jemalloc.h b/libc/bionic/jemalloc.h
index 79a4f72..b9a4e99 100644
--- a/libc/bionic/jemalloc.h
+++ b/libc/bionic/jemalloc.h
@@ -22,14 +22,20 @@
 // Need to wrap memalign since je_memalign fails on non-power of 2 alignments.
 #define je_memalign je_memalign_round_up_boundary
 
+// Need to wrap aligned_alloc since je_aligned_alloc does not enforce
+// that size is a multiple of alignment.
+#define je_aligned_alloc je_aligned_alloc_wrapper
+
 __BEGIN_DECLS
 
-struct mallinfo je_mallinfo();
-int je_mallopt(int, int);
+void* je_aligned_alloc_wrapper(size_t, size_t);
 int je_iterate(uintptr_t, size_t, void (*)(uintptr_t, size_t, void*), void*);
+int je_mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen);
+struct mallinfo je_mallinfo();
 void je_malloc_disable();
 void je_malloc_enable();
-int je_mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen);
+int je_malloc_info(int options, FILE* fp);
+int je_mallopt(int, int);
 void* je_memalign_round_up_boundary(size_t, size_t);
 void* je_pvalloc(size_t);
 
diff --git a/libc/bionic/jemalloc_wrapper.cpp b/libc/bionic/jemalloc_wrapper.cpp
index ef0d384..bc3a9dc 100644
--- a/libc/bionic/jemalloc_wrapper.cpp
+++ b/libc/bionic/jemalloc_wrapper.cpp
@@ -14,12 +14,14 @@
  * limitations under the License.
  */
 
+#include <errno.h>
 #include <malloc.h>
 #include <sys/param.h>
 #include <unistd.h>
 
+#include <private/MallocXmlElem.h>
+
 #include "jemalloc.h"
-#include "private/bionic_macros.h"
 
 void* je_pvalloc(size_t bytes) {
   size_t pagesize = getpagesize();
@@ -48,6 +50,20 @@
   return je_memalign(boundary, size);
 }
 
+#ifdef je_aligned_alloc
+#undef je_aligned_alloc
+#endif
+
+// The aligned_alloc function requires that size is a multiple of alignment.
+// jemalloc doesn't enforce this, so add enforcement here.
+void* je_aligned_alloc_wrapper(size_t alignment, size_t size) {
+  if ((size % alignment) != 0) {
+    errno = EINVAL;
+    return nullptr;
+  }
+  return je_aligned_alloc(alignment, size);
+}
+
 int je_mallopt(int param, int value) {
   // The only parameter we currently understand is M_DECAY_TIME.
   if (param == M_DECAY_TIME) {
@@ -101,3 +117,49 @@
   }
   return 0;
 }
+
+__BEGIN_DECLS
+
+size_t __mallinfo_narenas();
+size_t __mallinfo_nbins();
+struct mallinfo __mallinfo_arena_info(size_t);
+struct mallinfo __mallinfo_bin_info(size_t, size_t);
+
+__END_DECLS
+
+int je_malloc_info(int options, FILE* fp) {
+  if (options != 0) {
+    errno = EINVAL;
+    return -1;
+  }
+
+  MallocXmlElem root(fp, "malloc", "version=\"jemalloc-1\"");
+
+  // Dump all of the large allocations in the arenas.
+  for (size_t i = 0; i < __mallinfo_narenas(); i++) {
+    struct mallinfo mi = __mallinfo_arena_info(i);
+    if (mi.hblkhd != 0) {
+      MallocXmlElem arena_elem(fp, "heap", "nr=\"%d\"", i);
+      {
+        MallocXmlElem(fp, "allocated-large").Contents("%zu", mi.ordblks);
+        MallocXmlElem(fp, "allocated-huge").Contents("%zu", mi.uordblks);
+        MallocXmlElem(fp, "allocated-bins").Contents("%zu", mi.fsmblks);
+
+        size_t total = 0;
+        for (size_t j = 0; j < __mallinfo_nbins(); j++) {
+          struct mallinfo mi = __mallinfo_bin_info(i, j);
+          if (mi.ordblks != 0) {
+            MallocXmlElem bin_elem(fp, "bin", "nr=\"%d\"", j);
+            MallocXmlElem(fp, "allocated").Contents("%zu", mi.ordblks);
+            MallocXmlElem(fp, "nmalloc").Contents("%zu", mi.uordblks);
+            MallocXmlElem(fp, "ndalloc").Contents("%zu", mi.fordblks);
+            total += mi.ordblks;
+          }
+        }
+        MallocXmlElem(fp, "bins-total").Contents("%zu", total);
+      }
+    }
+  }
+
+  return 0;
+}
diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp
index f1fbfa9..b229cda 100644
--- a/libc/bionic/libc_init_common.cpp
+++ b/libc/bionic/libc_init_common.cpp
@@ -298,11 +298,26 @@
   unsigned long is_AT_SECURE = getauxval(AT_SECURE);
   if (errno != 0) __early_abort(__LINE__);
 
-  if (is_AT_SECURE) {
-    // If this is a setuid/setgid program, close the security hole described in
-    // https://www.freebsd.org/security/advisories/FreeBSD-SA-02:23.stdio.asc
+  // Always ensure that STDIN/STDOUT/STDERR exist. This prevents file
+  // descriptor confusion bugs where a parent process closes
+  // STD*, the exec()d process calls open() for an unrelated reason,
+  // the newly created file descriptor is assigned
+  // 0<=FD<=2, and unrelated code attempts to read / write to the STD*
+  // FDs.
+  // In particular, this can be a security bug for setuid/setgid programs.
+  // For example:
+  // https://www.freebsd.org/security/advisories/FreeBSD-SA-02:23.stdio.asc
+  // However, for robustness reasons, we don't limit these protections to
+  // just security critical executables.
+  //
+  // Init is excluded from these protections unless AT_SECURE is set, as
+  // /dev/null and/or /sys/fs/selinux/null will not be available at
+  // early boot.
+  if ((getpid() != 1) || is_AT_SECURE) {
     __nullify_closed_stdio();
+  }
 
+  if (is_AT_SECURE) {
     __sanitize_environment_variables(env);
   }
 
diff --git a/libc/bionic/libc_init_dynamic.cpp b/libc/bionic/libc_init_dynamic.cpp
index af1b847..4f3b4f7 100644
--- a/libc/bionic/libc_init_dynamic.cpp
+++ b/libc/bionic/libc_init_dynamic.cpp
@@ -51,6 +51,7 @@
 #include <elf.h>
 #include "libc_init_common.h"
 
+#include "private/bionic_elf_tls.h"
 #include "private/bionic_globals.h"
 #include "private/bionic_macros.h"
 #include "private/bionic_ssp.h"
@@ -65,9 +66,6 @@
 // Use an initializer so __libc_sysinfo will have a fallback implementation
 // while .preinit_array constructors run.
 #if defined(__i386__)
-static __attribute__((__naked__)) void __libc_int0x80() {
-  __asm__ volatile("int $0x80; ret");
-}
 __LIBC_HIDDEN__ void* __libc_sysinfo = reinterpret_cast<void*>(__libc_int0x80);
 #endif
 
@@ -82,6 +80,12 @@
   __libc_init_sysinfo();
 #endif
 
+  // Register libc.so's copy of the TLS generation variable so the linker can
+  // update it when it loads or unloads a shared object.
+  TlsModules& tls_modules = __libc_shared_globals()->tls_modules;
+  tls_modules.generation_libc_so = &__libc_tls_generation_copy;
+  __libc_tls_generation_copy = tls_modules.generation;
+
   __libc_init_globals();
   __libc_init_common();
 
diff --git a/libc/bionic/libc_init_static.cpp b/libc/bionic/libc_init_static.cpp
index 289b4a3..b4bddce 100644
--- a/libc/bionic/libc_init_static.cpp
+++ b/libc/bionic/libc_init_static.cpp
@@ -39,6 +39,7 @@
 #include "libc_init_common.h"
 #include "pthread_internal.h"
 
+#include "private/bionic_elf_tls.h"
 #include "private/bionic_globals.h"
 #include "private/bionic_macros.h"
 #include "private/bionic_page.h"
@@ -65,6 +66,52 @@
   }
 }
 
+#if defined(__aarch64__) || defined(__x86_64__)
+extern __LIBC_HIDDEN__ __attribute__((weak)) ElfW(Rela) __rela_iplt_start[], __rela_iplt_end[];
+
+static void call_ifunc_resolvers() {
+  if (__rela_iplt_start == nullptr || __rela_iplt_end == nullptr) {
+    // These symbols are not emitted by gold. Gold has code to do so, but for
+    // whatever reason it is not being run. In these cases ifuncs cannot be
+    // resolved, so we do not support using ifuncs in static executables linked
+    // with gold.
+    //
+    // Since they are weak, they will be non-null when linked with bfd/lld and
+    // null when linked with gold.
+    return;
+  }
+
+  typedef ElfW(Addr) (*ifunc_resolver_t)(void);
+  for (ElfW(Rela) *r = __rela_iplt_start; r != __rela_iplt_end; ++r) {
+    ElfW(Addr)* offset = reinterpret_cast<ElfW(Addr)*>(r->r_offset);
+    ElfW(Addr) resolver = r->r_addend;
+    *offset = reinterpret_cast<ifunc_resolver_t>(resolver)();
+  }
+}
+#else
+extern __LIBC_HIDDEN__ __attribute__((weak)) ElfW(Rel) __rel_iplt_start[], __rel_iplt_end[];
+
+static void call_ifunc_resolvers() {
+  if (__rel_iplt_start == nullptr || __rel_iplt_end == nullptr) {
+    // These symbols are not emitted by gold. Gold has code to do so, but for
+    // whatever reason it is not being run. In these cases ifuncs cannot be
+    // resolved, so we do not support using ifuncs in static executables linked
+    // with gold.
+    //
+    // Since they are weak, they will be non-null when linked with bfd/lld and
+    // null when linked with gold.
+    return;
+  }
+
+  typedef ElfW(Addr) (*ifunc_resolver_t)(void);
+  for (ElfW(Rel) *r = __rel_iplt_start; r != __rel_iplt_end; ++r) {
+    ElfW(Addr)* offset = reinterpret_cast<ElfW(Addr)*>(r->r_offset);
+    ElfW(Addr) resolver = *offset;
+    *offset = reinterpret_cast<ifunc_resolver_t>(resolver)();
+  }
+}
+#endif
+
 static void apply_gnu_relro() {
   ElfW(Phdr)* phdr_start = reinterpret_cast<ElfW(Phdr)*>(getauxval(AT_PHDR));
   unsigned long int phdr_ct = getauxval(AT_PHNUM);
@@ -82,6 +129,35 @@
   }
 }
 
+static void layout_static_tls(KernelArgumentBlock& args) {
+  StaticTlsLayout& layout = __libc_shared_globals()->static_tls_layout;
+  layout.reserve_bionic_tls();
+
+  const char* progname = args.argv[0];
+  ElfW(Phdr)* phdr_start = reinterpret_cast<ElfW(Phdr)*>(getauxval(AT_PHDR));
+  size_t phdr_ct = getauxval(AT_PHNUM);
+
+  static TlsModule mod;
+  TlsModules& modules = __libc_shared_globals()->tls_modules;
+  if (__bionic_get_tls_segment(phdr_start, phdr_ct, 0, &mod.segment)) {
+    if (!__bionic_check_tls_alignment(&mod.segment.alignment)) {
+      async_safe_fatal("error: TLS segment alignment in \"%s\" is not a power of 2: %zu\n",
+                       progname, mod.segment.alignment);
+    }
+    mod.static_offset = layout.reserve_exe_segment_and_tcb(&mod.segment, progname);
+    mod.first_generation = kTlsGenerationFirst;
+
+    modules.module_count = 1;
+    modules.module_table = &mod;
+  } else {
+    layout.reserve_exe_segment_and_tcb(nullptr, progname);
+  }
+  // Enable the fast path in __tls_get_addr.
+  __libc_tls_generation_copy = modules.generation;
+
+  layout.finish_layout();
+}
+
 // The program startup function __libc_init() defined here is
 // used for static executables only (i.e. those that don't depend
 // on shared libraries). It is called from arch-$ARCH/bionic/crtbegin_static.S
@@ -92,18 +168,22 @@
 __noreturn static void __real_libc_init(void *raw_args,
                                         void (*onexit)(void) __unused,
                                         int (*slingshot)(int, char**, char**),
-                                        structors_array_t const * const structors) {
+                                        structors_array_t const * const structors,
+                                        bionic_tcb* temp_tcb) {
   BIONIC_STOP_UNWIND;
 
   // Initialize TLS early so system calls and errno work.
   KernelArgumentBlock args(raw_args);
-  __libc_init_main_thread_early(args);
+  __libc_init_main_thread_early(args, temp_tcb);
   __libc_init_main_thread_late();
   __libc_init_globals();
   __libc_shared_globals()->init_progname = args.argv[0];
   __libc_init_AT_SECURE(args.envp);
+  layout_static_tls(args);
+  __libc_init_main_thread_final();
   __libc_init_common();
 
+  call_ifunc_resolvers();
   apply_gnu_relro();
 
   // Several Linux ABIs don't pass the onexit pointer, and the ones that
@@ -122,23 +202,24 @@
   exit(slingshot(args.argc, args.argv, args.envp));
 }
 
-extern "C" void __hwasan_init();
+extern "C" void __hwasan_init_static();
 
 __attribute__((no_sanitize("hwaddress")))
 __noreturn void __libc_init(void* raw_args,
                             void (*onexit)(void) __unused,
                             int (*slingshot)(int, char**, char**),
                             structors_array_t const * const structors) {
+  bionic_tcb temp_tcb = {};
 #if __has_feature(hwaddress_sanitizer)
   // Install main thread TLS early. It will be initialized later in __libc_init_main_thread. For now
-  // all we need is access to TLS_SLOT_TSAN.
-  pthread_internal_t* main_thread = __get_main_thread();
-  __set_tls(main_thread->tls);
-  // Initialize HWASan. This sets up TLS_SLOT_TSAN, among other things.
-  __hwasan_init();
+  // all we need is access to TLS_SLOT_SANITIZER.
+  __set_tls(&temp_tcb.tls_slot(0));
+  // Initialize HWASan enough to run instrumented code. This sets up TLS_SLOT_SANITIZER, among other
+  // things.
+  __hwasan_init_static();
   // We are ready to run HWASan-instrumented code, proceed with libc initialization...
 #endif
-  __real_libc_init(raw_args, onexit, slingshot, structors);
+  __real_libc_init(raw_args, onexit, slingshot, structors, &temp_tcb);
 }
 
 static int g_target_sdk_version{__ANDROID_API__};
@@ -152,8 +233,6 @@
 }
 
 __LIBC_HIDDEN__ libc_shared_globals* __libc_shared_globals() {
-  static libc_shared_globals globals = {
-    .abort_msg_lock = PTHREAD_MUTEX_INITIALIZER,
-  };
+  static libc_shared_globals globals;
   return &globals;
 }
diff --git a/libc/bionic/malloc_common.cpp b/libc/bionic/malloc_common.cpp
index d530fa4..e9f9db2 100644
--- a/libc/bionic/malloc_common.cpp
+++ b/libc/bionic/malloc_common.cpp
@@ -41,13 +41,216 @@
 //                          get_malloc_leak_info.
 //   write_malloc_leak_info: Writes the leak info data to a file.
 
-#include <pthread.h>
-#include <stdatomic.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stdio.h>
 
-#include <private/bionic_defs.h>
 #include <private/bionic_config.h>
-#include <private/bionic_globals.h>
-#include <private/bionic_malloc_dispatch.h>
+#include <private/bionic_malloc.h>
+
+#include "malloc_common.h"
+#include "malloc_limit.h"
+
+// =============================================================================
+// Global variables instantations.
+// =============================================================================
+
+// Malloc hooks globals.
+void* (*volatile __malloc_hook)(size_t, const void*);
+void* (*volatile __realloc_hook)(void*, size_t, const void*);
+void (*volatile __free_hook)(void*, const void*);
+void* (*volatile __memalign_hook)(size_t, size_t, const void*);
+// =============================================================================
+
+// =============================================================================
+// Allocation functions
+// =============================================================================
+extern "C" void* calloc(size_t n_elements, size_t elem_size) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->calloc(n_elements, elem_size);
+  }
+  void* result = Malloc(calloc)(n_elements, elem_size);
+  if (__predict_false(result == nullptr)) {
+    warning_log("calloc(%zu, %zu) failed: returning null pointer", n_elements, elem_size);
+  }
+  return result;
+}
+
+extern "C" void free(void* mem) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    dispatch_table->free(mem);
+  } else {
+    Malloc(free)(mem);
+  }
+}
+
+extern "C" struct mallinfo mallinfo() {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->mallinfo();
+  }
+  return Malloc(mallinfo)();
+}
+
+extern "C" int malloc_info(int options, FILE* fp) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->malloc_info(options, fp);
+  }
+  return Malloc(malloc_info)(options, fp);
+}
+
+extern "C" int mallopt(int param, int value) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->mallopt(param, value);
+  }
+  return Malloc(mallopt)(param, value);
+}
+
+extern "C" void* malloc(size_t bytes) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->malloc(bytes);
+  }
+  void* result = Malloc(malloc)(bytes);
+  if (__predict_false(result == nullptr)) {
+    warning_log("malloc(%zu) failed: returning null pointer", bytes);
+  }
+  return result;
+}
+
+extern "C" size_t malloc_usable_size(const void* mem) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->malloc_usable_size(mem);
+  }
+  return Malloc(malloc_usable_size)(mem);
+}
+
+extern "C" void* memalign(size_t alignment, size_t bytes) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->memalign(alignment, bytes);
+  }
+  void* result = Malloc(memalign)(alignment, bytes);
+  if (__predict_false(result == nullptr)) {
+    warning_log("memalign(%zu, %zu) failed: returning null pointer", alignment, bytes);
+  }
+  return result;
+}
+
+extern "C" int posix_memalign(void** memptr, size_t alignment, size_t size) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->posix_memalign(memptr, alignment, size);
+  }
+  return Malloc(posix_memalign)(memptr, alignment, size);
+}
+
+extern "C" void* aligned_alloc(size_t alignment, size_t size) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->aligned_alloc(alignment, size);
+  }
+  void* result = Malloc(aligned_alloc)(alignment, size);
+  if (__predict_false(result == nullptr)) {
+    warning_log("aligned_alloc(%zu, %zu) failed: returning null pointer", alignment, size);
+  }
+  return result;
+}
+
+extern "C" __attribute__((__noinline__)) void* realloc(void* old_mem, size_t bytes) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->realloc(old_mem, bytes);
+  }
+  void* result = Malloc(realloc)(old_mem, bytes);
+  if (__predict_false(result == nullptr && bytes != 0)) {
+    warning_log("realloc(%p, %zu) failed: returning null pointer", old_mem, bytes);
+  }
+  return result;
+}
+
+extern "C" void* reallocarray(void* old_mem, size_t item_count, size_t item_size) {
+  size_t new_size;
+  if (__builtin_mul_overflow(item_count, item_size, &new_size)) {
+    warning_log("reallocaray(%p, %zu, %zu) failed: returning null pointer",
+                old_mem, item_count, item_size);
+    errno = ENOMEM;
+    return nullptr;
+  }
+  return realloc(old_mem, new_size);
+}
+
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+extern "C" void* pvalloc(size_t bytes) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->pvalloc(bytes);
+  }
+  void* result = Malloc(pvalloc)(bytes);
+  if (__predict_false(result == nullptr)) {
+    warning_log("pvalloc(%zu) failed: returning null pointer", bytes);
+  }
+  return result;
+}
+
+extern "C" void* valloc(size_t bytes) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->valloc(bytes);
+  }
+  void* result = Malloc(valloc)(bytes);
+  if (__predict_false(result == nullptr)) {
+    warning_log("valloc(%zu) failed: returning null pointer", bytes);
+  }
+  return result;
+}
+#endif
+// =============================================================================
+
+// =============================================================================
+// Exported for use by libmemunreachable.
+// =============================================================================
+
+// Calls callback for every allocation in the anonymous heap mapping
+// [base, base+size).  Must be called between malloc_disable and malloc_enable.
+extern "C" int malloc_iterate(uintptr_t base, size_t size,
+    void (*callback)(uintptr_t base, size_t size, void* arg), void* arg) {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->iterate(base, size, callback, arg);
+  }
+  return Malloc(iterate)(base, size, callback, arg);
+}
+
+// Disable calls to malloc so malloc_iterate gets a consistent view of
+// allocated memory.
+extern "C" void malloc_disable() {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->malloc_disable();
+  }
+  return Malloc(malloc_disable)();
+}
+
+// Re-enable calls to malloc after a previous call to malloc_disable.
+extern "C" void malloc_enable() {
+  auto dispatch_table = GetDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->malloc_enable();
+  }
+  return Malloc(malloc_enable)();
+}
+
+#if defined(LIBC_STATIC)
+extern "C" ssize_t malloc_backtrace(void*, uintptr_t*, size_t) {
+  return 0;
+}
+#endif
 
 #if __has_feature(hwaddress_sanitizer)
 // FIXME: implement these in HWASan allocator.
@@ -62,736 +265,24 @@
 
 extern "C" void __sanitizer_malloc_enable() {
 }
-#include <sanitizer/hwasan_interface.h>
-#define Malloc(function)  __sanitizer_ ## function
 
-#else // __has_feature(hwaddress_sanitizer)
-#include "jemalloc.h"
-#define Malloc(function)  je_ ## function
-#endif
-
-template <typename T>
-static T* RemoveConst(const T* x) {
-  return const_cast<T*>(x);
-}
-
-// RemoveConst is a workaround for bug in current libcxx. Fix in
-// https://reviews.llvm.org/D47613
-#define atomic_load_explicit_const(obj, order) atomic_load_explicit(RemoveConst(obj), order)
-
-static constexpr memory_order default_read_memory_order = memory_order_acquire;
-
-static constexpr MallocDispatch __libc_malloc_default_dispatch
-  __attribute__((unused)) = {
-    Malloc(calloc),
-    Malloc(free),
-    Malloc(mallinfo),
-    Malloc(malloc),
-    Malloc(malloc_usable_size),
-    Malloc(memalign),
-    Malloc(posix_memalign),
-#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
-    Malloc(pvalloc),
-#endif
-    Malloc(realloc),
-#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
-    Malloc(valloc),
-#endif
-    Malloc(iterate),
-    Malloc(malloc_disable),
-    Malloc(malloc_enable),
-    Malloc(mallopt),
-    Malloc(aligned_alloc),
-  };
-
-// Malloc hooks.
-void* (*volatile __malloc_hook)(size_t, const void*);
-void* (*volatile __realloc_hook)(void*, size_t, const void*);
-void (*volatile __free_hook)(void*, const void*);
-void* (*volatile __memalign_hook)(size_t, size_t, const void*);
-
-// In a VM process, this is set to 1 after fork()ing out of zygote.
-int gMallocLeakZygoteChild = 0;
-
-// =============================================================================
-// Allocation functions
-// =============================================================================
-extern "C" void* calloc(size_t n_elements, size_t elem_size) {
-  auto _calloc = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.calloc,
-      default_read_memory_order);
-  if (__predict_false(_calloc != nullptr)) {
-    return _calloc(n_elements, elem_size);
-  }
-  return Malloc(calloc)(n_elements, elem_size);
-}
-
-extern "C" void free(void* mem) {
-  auto _free = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.free,
-      default_read_memory_order);
-  if (__predict_false(_free != nullptr)) {
-    _free(mem);
-  } else {
-    Malloc(free)(mem);
-  }
-}
-
-extern "C" struct mallinfo mallinfo() {
-  auto _mallinfo = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.mallinfo,
-      default_read_memory_order);
-  if (__predict_false(_mallinfo != nullptr)) {
-    return _mallinfo();
-  }
-  return Malloc(mallinfo)();
-}
-
-extern "C" int mallopt(int param, int value) {
-  auto _mallopt = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.mallopt,
-      default_read_memory_order);
-  if (__predict_false(_mallopt != nullptr)) {
-    return _mallopt(param, value);
-  }
-  return Malloc(mallopt)(param, value);
-}
-
-extern "C" void* malloc(size_t bytes) {
-  auto _malloc = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.malloc,
-      default_read_memory_order);
-  if (__predict_false(_malloc != nullptr)) {
-    return _malloc(bytes);
-  }
-  return Malloc(malloc)(bytes);
-}
-
-extern "C" size_t malloc_usable_size(const void* mem) {
-  auto _malloc_usable_size = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.malloc_usable_size,
-      default_read_memory_order);
-  if (__predict_false(_malloc_usable_size != nullptr)) {
-    return _malloc_usable_size(mem);
-  }
-  return Malloc(malloc_usable_size)(mem);
-}
-
-extern "C" void* memalign(size_t alignment, size_t bytes) {
-  auto _memalign = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.memalign,
-      default_read_memory_order);
-  if (__predict_false(_memalign != nullptr)) {
-    return _memalign(alignment, bytes);
-  }
-  return Malloc(memalign)(alignment, bytes);
-}
-
-extern "C" int posix_memalign(void** memptr, size_t alignment, size_t size) {
-  auto _posix_memalign = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.posix_memalign,
-      default_read_memory_order);
-  if (__predict_false(_posix_memalign != nullptr)) {
-    return _posix_memalign(memptr, alignment, size);
-  }
-  return Malloc(posix_memalign)(memptr, alignment, size);
-}
-
-extern "C" void* aligned_alloc(size_t alignment, size_t size) {
-  auto _aligned_alloc = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.aligned_alloc,
-      default_read_memory_order);
-  if (__predict_false(_aligned_alloc != nullptr)) {
-    return _aligned_alloc(alignment, size);
-  }
-  return Malloc(aligned_alloc)(alignment, size);
-}
-
-extern "C" void* realloc(void* old_mem, size_t bytes) {
-  auto _realloc = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.realloc,
-      default_read_memory_order);
-  if (__predict_false(_realloc != nullptr)) {
-    return _realloc(old_mem, bytes);
-  }
-  return Malloc(realloc)(old_mem, bytes);
-}
-
-extern "C" void* reallocarray(void* old_mem, size_t item_count, size_t item_size) {
-  size_t new_size;
-  if (__builtin_mul_overflow(item_count, item_size, &new_size)) {
-    errno = ENOMEM;
-    return nullptr;
-  }
-  return realloc(old_mem, new_size);
-}
-
-#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
-extern "C" void* pvalloc(size_t bytes) {
-  auto _pvalloc = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.pvalloc,
-      default_read_memory_order);
-  if (__predict_false(_pvalloc != nullptr)) {
-    return _pvalloc(bytes);
-  }
-  return Malloc(pvalloc)(bytes);
-}
-
-extern "C" void* valloc(size_t bytes) {
-  auto _valloc = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.valloc,
-      default_read_memory_order);
-  if (__predict_false(_valloc != nullptr)) {
-    return _valloc(bytes);
-  }
-  return Malloc(valloc)(bytes);
+extern "C" int __sanitizer_malloc_info(int, FILE*) {
+  errno = ENOTSUP;
+  return -1;
 }
 #endif
-
-// We implement malloc debugging only in libc.so, so the code below
-// must be excluded if we compile this file for static libc.a
-#if !defined(LIBC_STATIC)
-
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <async_safe/log.h>
-#include <sys/system_properties.h>
-
-extern "C" int __cxa_atexit(void (*func)(void *), void *arg, void *dso);
-
-static const char* HOOKS_SHARED_LIB = "libc_malloc_hooks.so";
-static const char* HOOKS_PROPERTY_ENABLE = "libc.debug.hooks.enable";
-static const char* HOOKS_ENV_ENABLE = "LIBC_HOOKS_ENABLE";
-
-static const char* DEBUG_SHARED_LIB = "libc_malloc_debug.so";
-static const char* DEBUG_PROPERTY_OPTIONS = "libc.debug.malloc.options";
-static const char* DEBUG_PROPERTY_PROGRAM = "libc.debug.malloc.program";
-static const char* DEBUG_ENV_OPTIONS = "LIBC_DEBUG_MALLOC_OPTIONS";
-
-static const char* HEAPPROFD_SHARED_LIB = "heapprofd_client.so";
-static const char* HEAPPROFD_PREFIX = "heapprofd";
-static const char* HEAPPROFD_PROPERTY_ENABLE = "heapprofd.enable";
-static const int HEAPPROFD_SIGNAL = __SIGRTMIN + 4;
-
-enum FunctionEnum : uint8_t {
-  FUNC_INITIALIZE,
-  FUNC_FINALIZE,
-  FUNC_GET_MALLOC_LEAK_INFO,
-  FUNC_FREE_MALLOC_LEAK_INFO,
-  FUNC_MALLOC_BACKTRACE,
-  FUNC_WRITE_LEAK_INFO,
-  FUNC_LAST,
-};
-static void* g_functions[FUNC_LAST];
-
-typedef void (*finalize_func_t)();
-typedef bool (*init_func_t)(const MallocDispatch*, int*, const char*);
-typedef void (*get_malloc_leak_info_func_t)(uint8_t**, size_t*, size_t*, size_t*, size_t*);
-typedef void (*free_malloc_leak_info_func_t)(uint8_t*);
-typedef bool (*write_malloc_leak_info_func_t)(FILE*);
-typedef ssize_t (*malloc_backtrace_func_t)(void*, uintptr_t*, size_t);
-
-// =============================================================================
-// Log functions
-// =============================================================================
-#define error_log(format, ...)  \
-    async_safe_format_log(ANDROID_LOG_ERROR, "libc", (format), ##__VA_ARGS__ )
-#define info_log(format, ...)  \
-    async_safe_format_log(ANDROID_LOG_INFO, "libc", (format), ##__VA_ARGS__ )
 // =============================================================================
 
 // =============================================================================
-// Exported for use by ddms.
+// Platform-internal mallopt variant.
 // =============================================================================
-
-// Retrieve native heap information.
-//
-// "*info" is set to a buffer we allocate
-// "*overall_size" is set to the size of the "info" buffer
-// "*info_size" is set to the size of a single entry
-// "*total_memory" is set to the sum of all allocations we're tracking; does
-//   not include heap overhead
-// "*backtrace_size" is set to the maximum number of entries in the back trace
-extern "C" void get_malloc_leak_info(uint8_t** info, size_t* overall_size,
-    size_t* info_size, size_t* total_memory, size_t* backtrace_size) {
-  void* func = g_functions[FUNC_GET_MALLOC_LEAK_INFO];
-  if (func == nullptr) {
-    return;
+#if defined(LIBC_STATIC)
+extern "C" bool android_mallopt(int opcode, void* arg, size_t arg_size) {
+  if (opcode == M_SET_ALLOCATION_LIMIT_BYTES) {
+    return LimitEnable(arg, arg_size);
   }
-  reinterpret_cast<get_malloc_leak_info_func_t>(func)(info, overall_size, info_size, total_memory,
-                                                      backtrace_size);
-}
-
-extern "C" void free_malloc_leak_info(uint8_t* info) {
-  void* func = g_functions[FUNC_FREE_MALLOC_LEAK_INFO];
-  if (func == nullptr) {
-    return;
-  }
-  reinterpret_cast<free_malloc_leak_info_func_t>(func)(info);
-}
-
-extern "C" void write_malloc_leak_info(FILE* fp) {
-  if (fp == nullptr) {
-    error_log("write_malloc_leak_info called with a nullptr");
-    return;
-  }
-
-  void* func = g_functions[FUNC_WRITE_LEAK_INFO];
-  bool written = false;
-  if (func != nullptr) {
-    written = reinterpret_cast<write_malloc_leak_info_func_t>(func)(fp);
-  }
-
-  if (!written) {
-    fprintf(fp, "Native heap dump not available. To enable, run these commands (requires root):\n");
-    fprintf(fp, "# adb shell stop\n");
-    fprintf(fp, "# adb shell setprop libc.debug.malloc.options backtrace\n");
-    fprintf(fp, "# adb shell start\n");
-  }
-}
-
-// =============================================================================
-
-template<typename FunctionType>
-static bool InitMallocFunction(void* malloc_impl_handler, _Atomic(FunctionType)* func, const char* prefix, const char* suffix) {
-  char symbol[128];
-  snprintf(symbol, sizeof(symbol), "%s_%s", prefix, suffix);
-  *func = reinterpret_cast<FunctionType>(dlsym(malloc_impl_handler, symbol));
-  if (*func == nullptr) {
-    error_log("%s: dlsym(\"%s\") failed", getprogname(), symbol);
-    return false;
-  }
-  return true;
-}
-
-static bool InitMallocFunctions(void* impl_handler, MallocDispatch* table, const char* prefix) {
-  if (!InitMallocFunction<MallocFree>(impl_handler, &table->free, prefix, "free")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocCalloc>(impl_handler, &table->calloc, prefix, "calloc")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocMallinfo>(impl_handler, &table->mallinfo, prefix, "mallinfo")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocMallopt>(impl_handler, &table->mallopt, prefix, "mallopt")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocMalloc>(impl_handler, &table->malloc, prefix, "malloc")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocMallocUsableSize>(impl_handler, &table->malloc_usable_size, prefix,
-                                                  "malloc_usable_size")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocMemalign>(impl_handler, &table->memalign, prefix, "memalign")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocPosixMemalign>(impl_handler, &table->posix_memalign, prefix,
-                                               "posix_memalign")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocAlignedAlloc>(impl_handler, &table->aligned_alloc,
-                                              prefix, "aligned_alloc")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocRealloc>(impl_handler, &table->realloc, prefix, "realloc")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocIterate>(impl_handler, &table->iterate, prefix, "iterate")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocMallocDisable>(impl_handler, &table->malloc_disable, prefix,
-                                               "malloc_disable")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocMallocEnable>(impl_handler, &table->malloc_enable, prefix,
-                                              "malloc_enable")) {
-    return false;
-  }
-#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
-  if (!InitMallocFunction<MallocPvalloc>(impl_handler, &table->pvalloc, prefix, "pvalloc")) {
-    return false;
-  }
-  if (!InitMallocFunction<MallocValloc>(impl_handler, &table->valloc, prefix, "valloc")) {
-    return false;
-  }
-#endif
-
-  return true;
-}
-
-static void malloc_fini_impl(void*) {
-  // Our BSD stdio implementation doesn't close the standard streams,
-  // it only flushes them. Other unclosed FILE*s will show up as
-  // malloc leaks, but to avoid the standard streams showing up in
-  // leak reports, close them here.
-  fclose(stdin);
-  fclose(stdout);
-  fclose(stderr);
-
-  reinterpret_cast<finalize_func_t>(g_functions[FUNC_FINALIZE])();
-}
-
-static bool CheckLoadMallocHooks(char** options) {
-  char* env = getenv(HOOKS_ENV_ENABLE);
-  if ((env == nullptr || env[0] == '\0' || env[0] == '0') &&
-    (__system_property_get(HOOKS_PROPERTY_ENABLE, *options) == 0 || *options[0] == '\0' || *options[0] == '0')) {
-    return false;
-  }
-  *options = nullptr;
-  return true;
-}
-
-static bool CheckLoadMallocDebug(char** options) {
-  // If DEBUG_MALLOC_ENV_OPTIONS is set then it overrides the system properties.
-  char* env = getenv(DEBUG_ENV_OPTIONS);
-  if (env == nullptr || env[0] == '\0') {
-    if (__system_property_get(DEBUG_PROPERTY_OPTIONS, *options) == 0 || *options[0] == '\0') {
-      return false;
-    }
-
-    // Check to see if only a specific program should have debug malloc enabled.
-    char program[PROP_VALUE_MAX];
-    if (__system_property_get(DEBUG_PROPERTY_PROGRAM, program) != 0 &&
-        strstr(getprogname(), program) == nullptr) {
-      return false;
-    }
-  } else {
-    *options = env;
-  }
-  return true;
-}
-
-static bool GetHeapprofdProgramProperty(char* data, size_t size) {
-  constexpr char prefix[] = "heapprofd.enable.";
-  // - 1 to skip nullbyte, which we will write later.
-  constexpr size_t prefix_size = sizeof(prefix) - 1;
-  if (size < prefix_size) {
-    error_log("%s: Overflow constructing heapprofd property", getprogname());
-    return false;
-  }
-  memcpy(data, prefix, prefix_size);
-
-  int fd = open("/proc/self/cmdline", O_RDONLY | O_CLOEXEC);
-  if (fd == -1) {
-    error_log("%s: Failed to open /proc/self/cmdline", getprogname());
-    return false;
-  }
-  char cmdline[128];
-  ssize_t rd = read(fd, cmdline, sizeof(cmdline) - 1);
-  close(fd);
-  if (rd == -1) {
-    error_log("%s: Failed to read /proc/self/cmdline", getprogname());
-    return false;
-  }
-  cmdline[rd] = '\0';
-  char* first_arg = static_cast<char*>(memchr(cmdline, '\0', rd));
-  if (first_arg == nullptr || first_arg == cmdline + size - 1) {
-    error_log("%s: Overflow reading cmdline", getprogname());
-    return false;
-  }
-  // For consistency with what we do with Java app cmdlines, trim everything
-  // after the @ sign of the first arg.
-  char* first_at = static_cast<char*>(memchr(cmdline, '@', rd));
-  if (first_at != nullptr && first_at < first_arg) {
-    *first_at = '\0';
-    first_arg = first_at;
-  }
-
-  char* start = static_cast<char*>(memrchr(cmdline, '/', first_arg - cmdline));
-  if (start == first_arg) {
-    // The first argument ended in a slash.
-    error_log("%s: cmdline ends in /", getprogname());
-    return false;
-  } else if (start == nullptr) {
-    start = cmdline;
-  } else {
-    // Skip the /.
-    start++;
-  }
-
-  size_t name_size = static_cast<size_t>(first_arg - start);
-  if (name_size >= size - prefix_size) {
-    error_log("%s: overflow constructing heapprofd property.", getprogname());
-    return false;
-  }
-  // + 1 to also copy the trailing null byte.
-  memcpy(data + prefix_size, start, name_size + 1);
-  return true;
-}
-
-static bool CheckLoadHeapprofd() {
-  // First check for heapprofd.enable. If it is set to "all", enable
-  // heapprofd for all processes. Otherwise, check heapprofd.enable.${prog},
-  // if it is set and not 0, enable heap profiling for this process.
-  char property_value[PROP_VALUE_MAX];
-  if (__system_property_get(HEAPPROFD_PROPERTY_ENABLE, property_value) == 0) {
-    return false;
-  }
-  if (strcmp(property_value, "all") == 0) {
-    return true;
-  }
-
-  char program_property[128];
-  if (!GetHeapprofdProgramProperty(program_property,
-                                   sizeof(program_property))) {
-    return false;
-  }
-  if (__system_property_get(program_property, property_value) == 0) {
-    return false;
-  }
-  return program_property[0] != '\0';
-}
-
-static void ClearGlobalFunctions() {
-  for (size_t i = 0; i < FUNC_LAST; i++) {
-    g_functions[i] = nullptr;
-  }
-}
-
-static void* LoadSharedLibrary(const char* shared_lib, const char* prefix, MallocDispatch* dispatch_table) {
-  void* impl_handle = dlopen(shared_lib, RTLD_NOW | RTLD_LOCAL);
-  if (impl_handle == nullptr) {
-    error_log("%s: Unable to open shared library %s: %s", getprogname(), shared_lib, dlerror());
-    return nullptr;
-  }
-
-  static constexpr const char* names[] = {
-    "initialize",
-    "finalize",
-    "get_malloc_leak_info",
-    "free_malloc_leak_info",
-    "malloc_backtrace",
-    "write_malloc_leak_info",
-  };
-  for (size_t i = 0; i < FUNC_LAST; i++) {
-    char symbol[128];
-    snprintf(symbol, sizeof(symbol), "%s_%s", prefix, names[i]);
-    g_functions[i] = dlsym(impl_handle, symbol);
-    if (g_functions[i] == nullptr) {
-      error_log("%s: %s routine not found in %s", getprogname(), symbol, shared_lib);
-      dlclose(impl_handle);
-      ClearGlobalFunctions();
-      return nullptr;
-    }
-  }
-
-  if (!InitMallocFunctions(impl_handle, dispatch_table, prefix)) {
-    dlclose(impl_handle);
-    ClearGlobalFunctions();
-    return nullptr;
-  }
-
-  return impl_handle;
-}
-
-// A function pointer to heapprofds init function. Used to re-initialize
-// heapprofd. This will start a new profiling session and tear down the old
-// one in case it is still active.
-static _Atomic init_func_t g_heapprofd_init_func = nullptr;
-
-static void install_hooks(libc_globals* globals, const char* options,
-                          const char* prefix, const char* shared_lib) {
-  init_func_t init_func = atomic_load(&g_heapprofd_init_func);
-  if (init_func != nullptr) {
-    init_func(&__libc_malloc_default_dispatch, &gMallocLeakZygoteChild, options);
-    info_log("%s: malloc %s re-enabled", getprogname(), prefix);
-    return;
-  }
-
-  MallocDispatch dispatch_table;
-  void* impl_handle = LoadSharedLibrary(shared_lib, prefix, &dispatch_table);
-  if (impl_handle == nullptr) {
-    return;
-  }
-  init_func = reinterpret_cast<init_func_t>(g_functions[FUNC_INITIALIZE]);
-  if (!init_func(&__libc_malloc_default_dispatch, &gMallocLeakZygoteChild, options)) {
-    dlclose(impl_handle);
-    ClearGlobalFunctions();
-    return;
-  }
-
-  atomic_store(&g_heapprofd_init_func, init_func);
-  // We assign free  first explicitly to prevent the case where we observe a
-  // alloc, but miss the corresponding free because of initialization order.
-  //
-  // This is safer than relying on the declaration order inside
-  // MallocDispatch at the cost of an extra atomic pointer write on
-  // initialization.
-  atomic_store(&globals->malloc_dispatch.free, dispatch_table.free);
-  // The struct gets assigned elementwise and each of the elements is an
-  // _Atomic. Assigning to an _Atomic is an atomic_store operation.
-  // The assignment is done in declaration order.
-  globals->malloc_dispatch = dispatch_table;
-
-  info_log("%s: malloc %s enabled", getprogname(), prefix);
-
-  // Use atexit to trigger the cleanup function. This avoids a problem
-  // where another atexit function is used to cleanup allocated memory,
-  // but the finalize function was already called. This particular error
-  // seems to be triggered by a zygote spawned process calling exit.
-  int ret_value = __cxa_atexit(malloc_fini_impl, nullptr, nullptr);
-  if (ret_value != 0) {
-    error_log("failed to set atexit cleanup function: %d", ret_value);
-  }
-}
-
-extern "C" void InstallInitHeapprofdHook(int);
-
-// Initializes memory allocation framework once per process.
-static void malloc_init_impl(libc_globals* globals) {
-  struct sigaction action = {};
-  action.sa_handler = InstallInitHeapprofdHook;
-  sigaction(HEAPPROFD_SIGNAL, &action, nullptr);
-
-  const char* prefix;
-  const char* shared_lib;
-  char prop[PROP_VALUE_MAX];
-  char* options = prop;
-  // Prefer malloc debug since it existed first and is a more complete
-  // malloc interceptor than the hooks.
-  if (CheckLoadMallocDebug(&options)) {
-    prefix = "debug";
-    shared_lib = DEBUG_SHARED_LIB;
-  } else if (CheckLoadMallocHooks(&options)) {
-    prefix = "hooks";
-    shared_lib = HOOKS_SHARED_LIB;
-  } else if (CheckLoadHeapprofd()) {
-    prefix = "heapprofd";
-    shared_lib = HEAPPROFD_SHARED_LIB;
-  } else {
-    return;
-  }
-  install_hooks(globals, options, prefix, shared_lib);
-}
-
-// Initializes memory allocation framework.
-// This routine is called from __libc_init routines in libc_init_dynamic.cpp.
-__BIONIC_WEAK_FOR_NATIVE_BRIDGE
-__LIBC_HIDDEN__ void __libc_init_malloc(libc_globals* globals) {
-  malloc_init_impl(globals);
-}
-
-// The logic for triggering heapprofd below is as following.
-// 1. HEAPPROFD_SIGNAL is received by the process.
-// 2. If neither InitHeapprofd nor InitHeapprofdHook are currently installed
-//    (g_heapprofd_init_hook_installed is false), InitHeapprofdHook is
-//    installed and g_heapprofd_init_in_progress is set to true.
-//
-// On the next subsequent malloc, InitHeapprofdHook is called and
-// 3a. If the signal is currently being handled (g_heapprofd_init_in_progress
-//     is true), no action is taken.
-// 3b. Otherwise, The signal handler (InstallInitHeapprofdHook) installs a
-//     temporary malloc hook (InitHeapprofdHook).
-// 4. When this hook gets run the first time, it uninstalls itself and spawns
-//    a thread running InitHeapprofd that loads heapprofd.so and installs the
-//    hooks within.
-// 5. g_heapprofd_init_in_progress and g_heapprofd_init_hook_installed are
-//    reset to false so heapprofd can be reinitialized. Reinitialization
-//    means that a new profiling session is started and any still active is
-//    torn down.
-//
-// This roundabout way is needed because we are running non AS-safe code, so
-// we cannot run it directly in the signal handler. The other approach of
-// running a standby thread and signalling through write(2) and read(2) would
-// significantly increase the number of active threads in the system.
-
-static _Atomic bool g_heapprofd_init_in_progress = false;
-static _Atomic bool g_heapprofd_init_hook_installed = false;
-
-static void* InitHeapprofd(void*) {
-  __libc_globals.mutate([](libc_globals* globals) {
-    install_hooks(globals, nullptr, HEAPPROFD_PREFIX, HEAPPROFD_SHARED_LIB);
-  });
-  atomic_store(&g_heapprofd_init_in_progress, false);
-  // Allow to install hook again to re-initialize heap profiling after the
-  // current session finished.
-  atomic_store(&g_heapprofd_init_hook_installed, false);
-  return nullptr;
-}
-
-static void* InitHeapprofdHook(size_t bytes) {
-  if (!atomic_exchange(&g_heapprofd_init_hook_installed, true)) {
-    __libc_globals.mutate([](libc_globals* globals) {
-      atomic_store(&globals->malloc_dispatch.malloc, nullptr);
-    });
-
-    pthread_t thread_id;
-    if (pthread_create(&thread_id, nullptr, InitHeapprofd, nullptr) == -1)
-      error_log("%s: heapprofd: failed to pthread_create.", getprogname());
-    else if (pthread_detach(thread_id) == -1)
-      error_log("%s: heapprofd: failed to pthread_detach", getprogname());
-    if (pthread_setname_np(thread_id, "heapprofdinit") == -1)
-      error_log("%s: heapprod: failed to pthread_setname_np", getprogname());
-  }
-  return Malloc(malloc)(bytes);
-}
-
-extern "C" void InstallInitHeapprofdHook(int) {
-  if (!atomic_exchange(&g_heapprofd_init_in_progress, true)) {
-    __libc_globals.mutate([](libc_globals* globals) {
-      atomic_store(&globals->malloc_dispatch.malloc, InitHeapprofdHook);
-    });
-  }
-}
-
-#endif  // !LIBC_STATIC
-
-// =============================================================================
-// Exported for use by libmemunreachable.
-// =============================================================================
-
-// Calls callback for every allocation in the anonymous heap mapping
-// [base, base+size).  Must be called between malloc_disable and malloc_enable.
-extern "C" int malloc_iterate(uintptr_t base, size_t size,
-    void (*callback)(uintptr_t base, size_t size, void* arg), void* arg) {
-  auto _iterate = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.iterate,
-      default_read_memory_order);
-  if (__predict_false(_iterate != nullptr)) {
-    return _iterate(base, size, callback, arg);
-  }
-  return Malloc(iterate)(base, size, callback, arg);
-}
-
-// Disable calls to malloc so malloc_iterate gets a consistent view of
-// allocated memory.
-extern "C" void malloc_disable() {
-  auto _malloc_disable = atomic_load_explicit_const(
-     & __libc_globals->malloc_dispatch.malloc_disable,
-      default_read_memory_order);
-  if (__predict_false(_malloc_disable != nullptr)) {
-    return _malloc_disable();
-  }
-  return Malloc(malloc_disable)();
-}
-
-// Re-enable calls to malloc after a previous call to malloc_disable.
-extern "C" void malloc_enable() {
-  auto _malloc_enable = atomic_load_explicit_const(
-      &__libc_globals->malloc_dispatch.malloc_enable,
-      default_read_memory_order);
-  if (__predict_false(_malloc_enable != nullptr)) {
-    return _malloc_enable();
-  }
-  return Malloc(malloc_enable)();
-}
-
-#ifndef LIBC_STATIC
-extern "C" ssize_t malloc_backtrace(void* pointer, uintptr_t* frames, size_t frame_count) {
-  void* func = g_functions[FUNC_MALLOC_BACKTRACE];
-  if (func == nullptr) {
-    return 0;
-  }
-  return reinterpret_cast<malloc_backtrace_func_t>(func)(pointer, frames, frame_count);
-}
-#else
-extern "C" ssize_t malloc_backtrace(void*, uintptr_t*, size_t) {
-  return 0;
+  errno = ENOTSUP;
+  return false;
 }
 #endif
+// =============================================================================
diff --git a/libc/bionic/malloc_common.h b/libc/bionic/malloc_common.h
new file mode 100644
index 0000000..2176e63
--- /dev/null
+++ b/libc/bionic/malloc_common.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#pragma once
+
+#include <stdatomic.h>
+#include <stdio.h>
+
+#include <async_safe/log.h>
+#include <private/bionic_globals.h>
+#include <private/bionic_malloc_dispatch.h>
+
+#if __has_feature(hwaddress_sanitizer)
+
+#include <sanitizer/hwasan_interface.h>
+
+__BEGIN_DECLS
+
+// FIXME: implement these in HWASan allocator.
+int __sanitizer_iterate(uintptr_t base, size_t size,
+                        void (*callback)(uintptr_t base, size_t size, void* arg),
+                        void* arg);
+void __sanitizer_malloc_disable();
+void __sanitizer_malloc_enable();
+int __sanitizer_malloc_info(int options, FILE* fp);
+
+__END_DECLS
+
+#define Malloc(function)  __sanitizer_ ## function
+
+#else // __has_feature(hwaddress_sanitizer)
+
+#if defined(USE_SCUDO)
+
+#include "scudo.h"
+#define Malloc(function)  scudo_ ## function
+
+#else
+
+#include "jemalloc.h"
+#define Malloc(function)  je_ ## function
+
+#endif
+
+#endif
+
+extern bool gZygoteChild;
+
+static inline const MallocDispatch* GetDispatchTable() {
+  return atomic_load_explicit(&__libc_globals->current_dispatch_table, memory_order_acquire);
+}
+
+static inline const MallocDispatch* GetDefaultDispatchTable() {
+  return atomic_load_explicit(&__libc_globals->default_dispatch_table, memory_order_acquire);
+}
+
+// =============================================================================
+// Log functions
+// =============================================================================
+#define error_log(format, ...)  \
+    async_safe_format_log(ANDROID_LOG_ERROR, "libc", (format), ##__VA_ARGS__ )
+#define info_log(format, ...)  \
+    async_safe_format_log(ANDROID_LOG_INFO, "libc", (format), ##__VA_ARGS__ )
+#define warning_log(format, ...)  \
+    async_safe_format_log(ANDROID_LOG_WARN, "libc", (format), ##__VA_ARGS__ )
+// =============================================================================
diff --git a/libc/bionic/malloc_common_dynamic.cpp b/libc/bionic/malloc_common_dynamic.cpp
new file mode 100644
index 0000000..64f9f6f
--- /dev/null
+++ b/libc/bionic/malloc_common_dynamic.cpp
@@ -0,0 +1,489 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+
+#if defined(LIBC_STATIC)
+#error This file should not be compiled for static targets.
+#endif
+
+// Contains a thin layer that calls whatever real native allocator
+// has been defined. For the libc shared library, this allows the
+// implementation of a debug malloc that can intercept all of the allocation
+// calls and add special debugging code to attempt to catch allocation
+// errors. All of the debugging code is implemented in a separate shared
+// library that is only loaded when the property "libc.debug.malloc.options"
+// is set to a non-zero value. There are three functions exported to
+// allow ddms, or other external users to get information from the debug
+// allocation.
+//   get_malloc_leak_info: Returns information about all of the known native
+//                         allocations that are currently in use.
+//   free_malloc_leak_info: Frees the data allocated by the call to
+//                          get_malloc_leak_info.
+//   write_malloc_leak_info: Writes the leak info data to a file.
+
+#include <dlfcn.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdatomic.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <android/dlext.h>
+
+#include <private/bionic_config.h>
+#include <private/bionic_defs.h>
+#include <private/bionic_malloc_dispatch.h>
+#include <private/bionic_malloc.h>
+
+#include <sys/system_properties.h>
+
+#include "malloc_common.h"
+#include "malloc_common_dynamic.h"
+#include "malloc_heapprofd.h"
+#include "malloc_limit.h"
+
+// =============================================================================
+// Global variables instantations.
+// =============================================================================
+pthread_mutex_t gGlobalsMutateLock = PTHREAD_MUTEX_INITIALIZER;
+
+bool gZygoteChild = false;
+
+_Atomic bool gGlobalsMutating = false;
+// =============================================================================
+
+static constexpr MallocDispatch __libc_malloc_default_dispatch
+  __attribute__((unused)) = {
+    Malloc(calloc),
+    Malloc(free),
+    Malloc(mallinfo),
+    Malloc(malloc),
+    Malloc(malloc_usable_size),
+    Malloc(memalign),
+    Malloc(posix_memalign),
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+    Malloc(pvalloc),
+#endif
+    Malloc(realloc),
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+    Malloc(valloc),
+#endif
+    Malloc(iterate),
+    Malloc(malloc_disable),
+    Malloc(malloc_enable),
+    Malloc(mallopt),
+    Malloc(aligned_alloc),
+    Malloc(malloc_info),
+  };
+
+static constexpr char kHooksSharedLib[] = "libc_malloc_hooks.so";
+static constexpr char kHooksPrefix[] = "hooks";
+static constexpr char kHooksPropertyEnable[] = "libc.debug.hooks.enable";
+static constexpr char kHooksEnvEnable[] = "LIBC_HOOKS_ENABLE";
+
+static constexpr char kDebugSharedLib[] = "libc_malloc_debug.so";
+static constexpr char kDebugPrefix[] = "debug";
+static constexpr char kDebugPropertyOptions[] = "libc.debug.malloc.options";
+static constexpr char kDebugPropertyProgram[] = "libc.debug.malloc.program";
+static constexpr char kDebugEnvOptions[] = "LIBC_DEBUG_MALLOC_OPTIONS";
+
+typedef void (*finalize_func_t)();
+typedef bool (*init_func_t)(const MallocDispatch*, bool*, const char*);
+typedef void (*get_malloc_leak_info_func_t)(uint8_t**, size_t*, size_t*, size_t*, size_t*);
+typedef void (*free_malloc_leak_info_func_t)(uint8_t*);
+typedef bool (*write_malloc_leak_info_func_t)(FILE*);
+typedef ssize_t (*malloc_backtrace_func_t)(void*, uintptr_t*, size_t);
+
+enum FunctionEnum : uint8_t {
+  FUNC_INITIALIZE,
+  FUNC_FINALIZE,
+  FUNC_GET_MALLOC_LEAK_INFO,
+  FUNC_FREE_MALLOC_LEAK_INFO,
+  FUNC_MALLOC_BACKTRACE,
+  FUNC_WRITE_LEAK_INFO,
+  FUNC_LAST,
+};
+static void* gFunctions[FUNC_LAST];
+
+extern "C" int __cxa_atexit(void (*func)(void *), void *arg, void *dso);
+
+template<typename FunctionType>
+static bool InitMallocFunction(void* malloc_impl_handler, FunctionType* func, const char* prefix, const char* suffix) {
+  char symbol[128];
+  snprintf(symbol, sizeof(symbol), "%s_%s", prefix, suffix);
+  *func = reinterpret_cast<FunctionType>(dlsym(malloc_impl_handler, symbol));
+  if (*func == nullptr) {
+    error_log("%s: dlsym(\"%s\") failed", getprogname(), symbol);
+    return false;
+  }
+  return true;
+}
+
+static bool InitMallocFunctions(void* impl_handler, MallocDispatch* table, const char* prefix) {
+  if (!InitMallocFunction<MallocFree>(impl_handler, &table->free, prefix, "free")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocCalloc>(impl_handler, &table->calloc, prefix, "calloc")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocMallinfo>(impl_handler, &table->mallinfo, prefix, "mallinfo")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocMallopt>(impl_handler, &table->mallopt, prefix, "mallopt")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocMalloc>(impl_handler, &table->malloc, prefix, "malloc")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocMallocInfo>(impl_handler, &table->malloc_info, prefix,
+                                                "malloc_info")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocMallocUsableSize>(impl_handler, &table->malloc_usable_size, prefix,
+                                                  "malloc_usable_size")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocMemalign>(impl_handler, &table->memalign, prefix, "memalign")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocPosixMemalign>(impl_handler, &table->posix_memalign, prefix,
+                                               "posix_memalign")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocAlignedAlloc>(impl_handler, &table->aligned_alloc,
+                                              prefix, "aligned_alloc")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocRealloc>(impl_handler, &table->realloc, prefix, "realloc")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocIterate>(impl_handler, &table->iterate, prefix, "iterate")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocMallocDisable>(impl_handler, &table->malloc_disable, prefix,
+                                               "malloc_disable")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocMallocEnable>(impl_handler, &table->malloc_enable, prefix,
+                                              "malloc_enable")) {
+    return false;
+  }
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+  if (!InitMallocFunction<MallocPvalloc>(impl_handler, &table->pvalloc, prefix, "pvalloc")) {
+    return false;
+  }
+  if (!InitMallocFunction<MallocValloc>(impl_handler, &table->valloc, prefix, "valloc")) {
+    return false;
+  }
+#endif
+
+  return true;
+}
+
+static void MallocFiniImpl(void*) {
+  // Our BSD stdio implementation doesn't close the standard streams,
+  // it only flushes them. Other unclosed FILE*s will show up as
+  // malloc leaks, but to avoid the standard streams showing up in
+  // leak reports, close them here.
+  fclose(stdin);
+  fclose(stdout);
+  fclose(stderr);
+
+  reinterpret_cast<finalize_func_t>(gFunctions[FUNC_FINALIZE])();
+}
+
+static bool CheckLoadMallocHooks(char** options) {
+  char* env = getenv(kHooksEnvEnable);
+  if ((env == nullptr || env[0] == '\0' || env[0] == '0') &&
+    (__system_property_get(kHooksPropertyEnable, *options) == 0 || *options[0] == '\0' || *options[0] == '0')) {
+    return false;
+  }
+  *options = nullptr;
+  return true;
+}
+
+static bool CheckLoadMallocDebug(char** options) {
+  // If kDebugMallocEnvOptions is set then it overrides the system properties.
+  char* env = getenv(kDebugEnvOptions);
+  if (env == nullptr || env[0] == '\0') {
+    if (__system_property_get(kDebugPropertyOptions, *options) == 0 || *options[0] == '\0') {
+      return false;
+    }
+
+    // Check to see if only a specific program should have debug malloc enabled.
+    char program[PROP_VALUE_MAX];
+    if (__system_property_get(kDebugPropertyProgram, program) != 0 &&
+        strstr(getprogname(), program) == nullptr) {
+      return false;
+    }
+  } else {
+    *options = env;
+  }
+  return true;
+}
+
+static void ClearGlobalFunctions() {
+  for (size_t i = 0; i < FUNC_LAST; i++) {
+    gFunctions[i] = nullptr;
+  }
+}
+
+bool InitSharedLibrary(void* impl_handle, const char* shared_lib, const char* prefix, MallocDispatch* dispatch_table) {
+  static constexpr const char* names[] = {
+    "initialize",
+    "finalize",
+    "get_malloc_leak_info",
+    "free_malloc_leak_info",
+    "malloc_backtrace",
+    "write_malloc_leak_info",
+  };
+  for (size_t i = 0; i < FUNC_LAST; i++) {
+    char symbol[128];
+    snprintf(symbol, sizeof(symbol), "%s_%s", prefix, names[i]);
+    gFunctions[i] = dlsym(impl_handle, symbol);
+    if (gFunctions[i] == nullptr) {
+      error_log("%s: %s routine not found in %s", getprogname(), symbol, shared_lib);
+      ClearGlobalFunctions();
+      return false;
+    }
+  }
+
+  if (!InitMallocFunctions(impl_handle, dispatch_table, prefix)) {
+    ClearGlobalFunctions();
+    return false;
+  }
+  return true;
+}
+
+// Note about USE_SCUDO. This file is compiled into libc.so and libc_scudo.so.
+// When compiled into libc_scudo.so, the libc_malloc_* libraries don't need
+// to be loaded from the runtime namespace since libc_scudo.so is not from
+// the runtime APEX, but is copied to any APEX that needs it.
+#ifndef USE_SCUDO
+extern "C" struct android_namespace_t* android_get_exported_namespace(const char* name);
+#endif
+
+void* LoadSharedLibrary(const char* shared_lib, const char* prefix, MallocDispatch* dispatch_table) {
+  void* impl_handle = nullptr;
+#ifndef USE_SCUDO
+  // Try to load the libc_malloc_* libs from the "runtime" namespace and then
+  // fall back to dlopen() to load them from the default namespace.
+  //
+  // The libraries are packaged in the runtime APEX together with libc.so.
+  // However, since the libc.so is searched via the symlink in the system
+  // partition (/system/lib/libc.so -> /apex/com.android.runtime/bionic.libc.so)
+  // libc.so is loaded into the default namespace. If we just dlopen() here, the
+  // linker will load the libs found in /system/lib which might be incompatible
+  // with libc.so in the runtime APEX. Use android_dlopen_ext to explicitly load
+  // the ones in the runtime APEX.
+  struct android_namespace_t* runtime_ns = android_get_exported_namespace("runtime");
+  if (runtime_ns != nullptr) {
+    const android_dlextinfo dlextinfo = {
+      .flags = ANDROID_DLEXT_USE_NAMESPACE,
+      .library_namespace = runtime_ns,
+    };
+    impl_handle = android_dlopen_ext(shared_lib, RTLD_NOW | RTLD_LOCAL, &dlextinfo);
+  }
+#endif
+
+  if (impl_handle == nullptr) {
+    impl_handle = dlopen(shared_lib, RTLD_NOW | RTLD_LOCAL);
+  }
+
+  if (impl_handle == nullptr) {
+    error_log("%s: Unable to open shared library %s: %s", getprogname(), shared_lib, dlerror());
+    return nullptr;
+  }
+
+  if (!InitSharedLibrary(impl_handle, shared_lib, prefix, dispatch_table)) {
+    dlclose(impl_handle);
+    impl_handle = nullptr;
+  }
+
+  return impl_handle;
+}
+
+bool FinishInstallHooks(libc_globals* globals, const char* options, const char* prefix) {
+  init_func_t init_func = reinterpret_cast<init_func_t>(gFunctions[FUNC_INITIALIZE]);
+  if (!init_func(&__libc_malloc_default_dispatch, &gZygoteChild, options)) {
+    error_log("%s: failed to enable malloc %s", getprogname(), prefix);
+    ClearGlobalFunctions();
+    return false;
+  }
+
+  // Do a pointer swap so that all of the functions become valid at once to
+  // avoid any initialization order problems.
+  atomic_store(&globals->default_dispatch_table, &globals->malloc_dispatch_table);
+  if (GetDispatchTable() == nullptr) {
+    atomic_store(&globals->current_dispatch_table, &globals->malloc_dispatch_table);
+  }
+
+  // Use atexit to trigger the cleanup function. This avoids a problem
+  // where another atexit function is used to cleanup allocated memory,
+  // but the finalize function was already called. This particular error
+  // seems to be triggered by a zygote spawned process calling exit.
+  int ret_value = __cxa_atexit(MallocFiniImpl, nullptr, nullptr);
+  if (ret_value != 0) {
+    // We don't consider this a fatal error.
+    warning_log("failed to set atexit cleanup function: %d", ret_value);
+  }
+  return true;
+}
+
+static bool InstallHooks(libc_globals* globals, const char* options, const char* prefix,
+                         const char* shared_lib) {
+  void* impl_handle = LoadSharedLibrary(shared_lib, prefix, &globals->malloc_dispatch_table);
+  if (impl_handle == nullptr) {
+    return false;
+  }
+
+  if (!FinishInstallHooks(globals, options, prefix)) {
+    dlclose(impl_handle);
+    return false;
+  }
+  return true;
+}
+
+// Initializes memory allocation framework once per process.
+static void MallocInitImpl(libc_globals* globals) {
+  char prop[PROP_VALUE_MAX];
+  char* options = prop;
+
+  // Prefer malloc debug since it existed first and is a more complete
+  // malloc interceptor than the hooks.
+  bool hook_installed = false;
+  if (CheckLoadMallocDebug(&options)) {
+    hook_installed = InstallHooks(globals, options, kDebugPrefix, kDebugSharedLib);
+  } else if (CheckLoadMallocHooks(&options)) {
+    hook_installed = InstallHooks(globals, options, kHooksPrefix, kHooksSharedLib);
+  }
+
+  if (!hook_installed) {
+    if (HeapprofdShouldLoad()) {
+      HeapprofdInstallHooksAtInit(globals);
+    }
+
+    // Install this last to avoid as many race conditions as possible.
+    HeapprofdInstallSignalHandler();
+  } else {
+    // Install a signal handler that prints an error since we don't support
+    // heapprofd and any other hook to be installed at the same time.
+    HeapprofdInstallErrorSignalHandler();
+  }
+}
+
+// Initializes memory allocation framework.
+// This routine is called from __libc_init routines in libc_init_dynamic.cpp.
+__BIONIC_WEAK_FOR_NATIVE_BRIDGE
+__LIBC_HIDDEN__ void __libc_init_malloc(libc_globals* globals) {
+  MallocInitImpl(globals);
+}
+
+// =============================================================================
+// Functions to support dumping of native heap allocations using malloc debug.
+// =============================================================================
+
+// Retrieve native heap information.
+//
+// "*info" is set to a buffer we allocate
+// "*overall_size" is set to the size of the "info" buffer
+// "*info_size" is set to the size of a single entry
+// "*total_memory" is set to the sum of all allocations we're tracking; does
+//   not include heap overhead
+// "*backtrace_size" is set to the maximum number of entries in the back trace
+extern "C" void get_malloc_leak_info(uint8_t** info, size_t* overall_size,
+    size_t* info_size, size_t* total_memory, size_t* backtrace_size) {
+  void* func = gFunctions[FUNC_GET_MALLOC_LEAK_INFO];
+  if (func == nullptr) {
+    return;
+  }
+  reinterpret_cast<get_malloc_leak_info_func_t>(func)(info, overall_size, info_size, total_memory,
+                                                      backtrace_size);
+}
+
+extern "C" void free_malloc_leak_info(uint8_t* info) {
+  void* func = gFunctions[FUNC_FREE_MALLOC_LEAK_INFO];
+  if (func == nullptr) {
+    return;
+  }
+  reinterpret_cast<free_malloc_leak_info_func_t>(func)(info);
+}
+
+extern "C" void write_malloc_leak_info(FILE* fp) {
+  if (fp == nullptr) {
+    error_log("write_malloc_leak_info called with a nullptr");
+    return;
+  }
+
+  void* func = gFunctions[FUNC_WRITE_LEAK_INFO];
+  bool written = false;
+  if (func != nullptr) {
+    written = reinterpret_cast<write_malloc_leak_info_func_t>(func)(fp);
+  }
+
+  if (!written) {
+    fprintf(fp, "Native heap dump not available. To enable, run these commands (requires root):\n");
+    fprintf(fp, "# adb shell stop\n");
+    fprintf(fp, "# adb shell setprop libc.debug.malloc.options backtrace\n");
+    fprintf(fp, "# adb shell start\n");
+  }
+}
+// =============================================================================
+
+// =============================================================================
+// Exported for use by libmemunreachable.
+// =============================================================================
+extern "C" ssize_t malloc_backtrace(void* pointer, uintptr_t* frames, size_t frame_count) {
+  void* func = gFunctions[FUNC_MALLOC_BACKTRACE];
+  if (func == nullptr) {
+    return 0;
+  }
+  return reinterpret_cast<malloc_backtrace_func_t>(func)(pointer, frames, frame_count);
+}
+// =============================================================================
+
+// =============================================================================
+// Platform-internal mallopt variant.
+// =============================================================================
+extern "C" bool android_mallopt(int opcode, void* arg, size_t arg_size) {
+  if (opcode == M_SET_ZYGOTE_CHILD) {
+    if (arg != nullptr || arg_size != 0) {
+      errno = EINVAL;
+      return false;
+    }
+    gZygoteChild = true;
+    return true;
+  }
+  if (opcode == M_SET_ALLOCATION_LIMIT_BYTES) {
+    return LimitEnable(arg, arg_size);
+  }
+  return HeapprofdMallopt(opcode, arg, arg_size);
+}
+// =============================================================================
diff --git a/libc/bionic/malloc_common_dynamic.h b/libc/bionic/malloc_common_dynamic.h
new file mode 100644
index 0000000..755af8f
--- /dev/null
+++ b/libc/bionic/malloc_common_dynamic.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#pragma once
+
+#include <pthread.h>
+#include <stdatomic.h>
+
+#include <private/bionic_globals.h>
+#include <private/bionic_malloc_dispatch.h>
+
+// Function prototypes.
+bool InitSharedLibrary(void* impl_handle, const char* shared_lib, const char* prefix,
+                       MallocDispatch* dispatch_table);
+
+void* LoadSharedLibrary(const char* shared_lib, const char* prefix, MallocDispatch* dispatch_table);
+
+bool FinishInstallHooks(libc_globals* globals, const char* options, const char* prefix);
+
+// Lock for globals, to guarantee that only one thread is doing a mutate.
+extern pthread_mutex_t gGlobalsMutateLock;
+extern _Atomic bool gGlobalsMutating;
diff --git a/libc/bionic/malloc_heapprofd.cpp b/libc/bionic/malloc_heapprofd.cpp
new file mode 100644
index 0000000..2aeb9bf
--- /dev/null
+++ b/libc/bionic/malloc_heapprofd.cpp
@@ -0,0 +1,375 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#if defined(LIBC_STATIC)
+#error This file should not be compiled for static targets.
+#endif
+
+#include <dlfcn.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <private/bionic_config.h>
+#include <private/bionic_malloc.h>
+#include <private/bionic_malloc_dispatch.h>
+#include <sys/system_properties.h>
+
+#include "malloc_common.h"
+#include "malloc_common_dynamic.h"
+#include "malloc_heapprofd.h"
+
+static constexpr char kHeapprofdSharedLib[] = "heapprofd_client.so";
+static constexpr char kHeapprofdPrefix[] = "heapprofd";
+static constexpr char kHeapprofdPropertyEnable[] = "heapprofd.enable";
+static constexpr int kHeapprofdSignal = __SIGRTMIN + 4;
+
+// The logic for triggering heapprofd (at runtime) is as follows:
+// 1. HEAPPROFD_SIGNAL is received by the process, entering the
+//    MaybeInstallInitHeapprofdHook signal handler.
+// 2. If the initialization is not already in flight
+//    (gHeapprofdInitInProgress is false), the malloc hook is set to
+//    point at InitHeapprofdHook, and gHeapprofdInitInProgress is set to
+//    true.
+// 3. The next malloc call enters InitHeapprofdHook, which removes the malloc
+//    hook, and spawns a detached pthread to run the InitHeapprofd task.
+//    (gHeapprofdInitHook_installed atomic is used to perform this once.)
+// 4. InitHeapprofd, on a dedicated pthread, loads the heapprofd client library,
+//    installs the full set of heapprofd hooks, and invokes the client's
+//    initializer. The dedicated pthread then terminates.
+// 5. gHeapprofdInitInProgress and gHeapprofdInitHookInstalled are
+//    reset to false such that heapprofd can be reinitialized. Reinitialization
+//    means that a new profiling session is started, and any still active is
+//    torn down.
+//
+// The incremental hooking and a dedicated task thread are used since we cannot
+// do heavy work within a signal handler, or when blocking a malloc invocation.
+
+// The handle returned by dlopen when previously loading the heapprofd
+// hooks. nullptr if shared library has not been already been loaded.
+static _Atomic (void*) gHeapprofdHandle = nullptr;
+
+static _Atomic bool gHeapprofdInitInProgress = false;
+static _Atomic bool gHeapprofdInitHookInstalled = false;
+
+// In a Zygote child process, this is set to true if profiling of this process
+// is allowed. Note that this is set at a later time than the global
+// gZygoteChild. The latter is set during the fork (while still in
+// zygote's SELinux domain). While this bit is set after the child is
+// specialized (and has transferred SELinux domains if applicable).
+static _Atomic bool gZygoteChildProfileable = false;
+
+extern "C" void* MallocInitHeapprofdHook(size_t);
+
+static constexpr MallocDispatch __heapprofd_init_dispatch
+  __attribute__((unused)) = {
+    Malloc(calloc),
+    Malloc(free),
+    Malloc(mallinfo),
+    MallocInitHeapprofdHook,
+    Malloc(malloc_usable_size),
+    Malloc(memalign),
+    Malloc(posix_memalign),
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+    Malloc(pvalloc),
+#endif
+    Malloc(realloc),
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+    Malloc(valloc),
+#endif
+    Malloc(iterate),
+    Malloc(malloc_disable),
+    Malloc(malloc_enable),
+    Malloc(mallopt),
+    Malloc(aligned_alloc),
+    Malloc(malloc_info),
+  };
+
+static void MaybeInstallInitHeapprofdHook(int) {
+  // Zygote child processes must be marked profileable.
+  if (gZygoteChild &&
+      !atomic_load_explicit(&gZygoteChildProfileable, memory_order_acquire)) {
+    return;
+  }
+
+  // Checking this variable is only necessary when this could conflict with
+  // the change to enable the allocation limit. All other places will
+  // not ever have a conflict modifying the globals.
+  if (!atomic_exchange(&gGlobalsMutating, true)) {
+    if (!atomic_exchange(&gHeapprofdInitInProgress, true)) {
+      __libc_globals.mutate([](libc_globals* globals) {
+        atomic_store(&globals->default_dispatch_table, &__heapprofd_init_dispatch);
+        auto dispatch_table = GetDispatchTable();
+        if (dispatch_table == nullptr || dispatch_table == &globals->malloc_dispatch_table) {
+          atomic_store(&globals->current_dispatch_table, &__heapprofd_init_dispatch);
+        }
+      });
+    }
+    atomic_store(&gGlobalsMutating, false);
+  } else {
+    // The only way you can get to this point is if the signal has been
+    // blocked by a call to HeapprofdMaskSignal. The raise below will
+    // do nothing until a call to HeapprofdUnmaskSignal, which will cause
+    // the signal to be resent. Using this avoids the need for a busy loop
+    // waiting for gGlobalsMutating to change back to false.
+    raise(kHeapprofdSignal);
+  }
+}
+
+static bool GetHeapprofdProgramProperty(char* data, size_t size) {
+  constexpr char prefix[] = "heapprofd.enable.";
+  // - 1 to skip nullbyte, which we will write later.
+  constexpr size_t prefix_size = sizeof(prefix) - 1;
+  if (size < prefix_size) {
+    error_log("%s: Overflow constructing heapprofd property", getprogname());
+    return false;
+  }
+  memcpy(data, prefix, prefix_size);
+
+  int fd = open("/proc/self/cmdline", O_RDONLY | O_CLOEXEC);
+  if (fd == -1) {
+    error_log("%s: Failed to open /proc/self/cmdline", getprogname());
+    return false;
+  }
+  char cmdline[128];
+  ssize_t rd = read(fd, cmdline, sizeof(cmdline) - 1);
+  close(fd);
+  if (rd == -1) {
+    error_log("%s: Failed to read /proc/self/cmdline", getprogname());
+    return false;
+  }
+  cmdline[rd] = '\0';
+  char* first_arg = static_cast<char*>(memchr(cmdline, '\0', rd));
+  if (first_arg == nullptr || first_arg == cmdline + size - 1) {
+    error_log("%s: Overflow reading cmdline", getprogname());
+    return false;
+  }
+  // For consistency with what we do with Java app cmdlines, trim everything
+  // after the @ sign of the first arg.
+  char* first_at = static_cast<char*>(memchr(cmdline, '@', rd));
+  if (first_at != nullptr && first_at < first_arg) {
+    *first_at = '\0';
+    first_arg = first_at;
+  }
+
+  char* start = static_cast<char*>(memrchr(cmdline, '/', first_arg - cmdline));
+  if (start == first_arg) {
+    // The first argument ended in a slash.
+    error_log("%s: cmdline ends in /", getprogname());
+    return false;
+  } else if (start == nullptr) {
+    start = cmdline;
+  } else {
+    // Skip the /.
+    start++;
+  }
+
+  size_t name_size = static_cast<size_t>(first_arg - start);
+  if (name_size >= size - prefix_size) {
+    error_log("%s: overflow constructing heapprofd property.", getprogname());
+    return false;
+  }
+  // + 1 to also copy the trailing null byte.
+  memcpy(data + prefix_size, start, name_size + 1);
+  return true;
+}
+
+bool HeapprofdShouldLoad() {
+  // First check for heapprofd.enable. If it is set to "all", enable
+  // heapprofd for all processes. Otherwise, check heapprofd.enable.${prog},
+  // if it is set and not 0, enable heap profiling for this process.
+  char property_value[PROP_VALUE_MAX];
+  if (__system_property_get(kHeapprofdPropertyEnable, property_value) == 0) {
+    return false;
+  }
+  if (strcmp(property_value, "all") == 0) {
+    return true;
+  }
+
+  char program_property[128];
+  if (!GetHeapprofdProgramProperty(program_property,
+                                   sizeof(program_property))) {
+    return false;
+  }
+  if (__system_property_get(program_property, property_value) == 0) {
+    return false;
+  }
+  return property_value[0] != '\0';
+}
+
+void HeapprofdInstallSignalHandler() {
+  struct sigaction action = {};
+  action.sa_handler = MaybeInstallInitHeapprofdHook;
+  sigaction(kHeapprofdSignal, &action, nullptr);
+}
+
+extern "C" int __rt_sigprocmask(int, const sigset64_t*, sigset64_t*, size_t);
+
+void HeapprofdMaskSignal() {
+  sigset64_t mask_set;
+  // Need to use this function instead because sigprocmask64 filters
+  // out this signal.
+  __rt_sigprocmask(SIG_SETMASK, nullptr, &mask_set, sizeof(mask_set));
+  sigaddset64(&mask_set, kHeapprofdSignal);
+  __rt_sigprocmask(SIG_SETMASK, &mask_set, nullptr, sizeof(mask_set));
+}
+
+void HeapprofdUnmaskSignal() {
+  sigset64_t mask_set;
+  __rt_sigprocmask(SIG_SETMASK, nullptr, &mask_set, sizeof(mask_set));
+  sigdelset64(&mask_set, kHeapprofdSignal);
+  __rt_sigprocmask(SIG_SETMASK, &mask_set, nullptr, sizeof(mask_set));
+}
+
+static void DisplayError(int) {
+  error_log("Cannot install heapprofd while malloc debug/malloc hooks are enabled.");
+}
+
+void HeapprofdInstallErrorSignalHandler() {
+  struct sigaction action = {};
+  action.sa_handler = DisplayError;
+  sigaction(kHeapprofdSignal, &action, nullptr);
+}
+
+static void CommonInstallHooks(libc_globals* globals) {
+  void* impl_handle = atomic_load(&gHeapprofdHandle);
+  bool reusing_handle = impl_handle != nullptr;
+  if (!reusing_handle) {
+    impl_handle = LoadSharedLibrary(kHeapprofdSharedLib, kHeapprofdPrefix, &globals->malloc_dispatch_table);
+    if (impl_handle == nullptr) {
+      return;
+    }
+  } else if (!InitSharedLibrary(impl_handle, kHeapprofdSharedLib, kHeapprofdPrefix, &globals->malloc_dispatch_table)) {
+    return;
+  }
+
+  if (FinishInstallHooks(globals, nullptr, kHeapprofdPrefix)) {
+    atomic_store(&gHeapprofdHandle, impl_handle);
+  } else if (!reusing_handle) {
+    dlclose(impl_handle);
+  }
+
+  atomic_store(&gHeapprofdInitInProgress, false);
+}
+
+void HeapprofdInstallHooksAtInit(libc_globals* globals) {
+  if (atomic_exchange(&gHeapprofdInitInProgress, true)) {
+    return;
+  }
+  CommonInstallHooks(globals);
+}
+
+static void* InitHeapprofd(void*) {
+  pthread_mutex_lock(&gGlobalsMutateLock);
+  __libc_globals.mutate([](libc_globals* globals) {
+    CommonInstallHooks(globals);
+  });
+  pthread_mutex_unlock(&gGlobalsMutateLock);
+
+  // Allow to install hook again to re-initialize heap profiling after the
+  // current session finished.
+  atomic_store(&gHeapprofdInitHookInstalled, false);
+  return nullptr;
+}
+
+extern "C" void* MallocInitHeapprofdHook(size_t bytes) {
+  if (!atomic_exchange(&gHeapprofdInitHookInstalled, true)) {
+    pthread_mutex_lock(&gGlobalsMutateLock);
+    __libc_globals.mutate([](libc_globals* globals) {
+      auto old_dispatch = GetDefaultDispatchTable();
+      atomic_store(&globals->default_dispatch_table, nullptr);
+      if (GetDispatchTable() == old_dispatch) {
+        atomic_store(&globals->current_dispatch_table, nullptr);
+      }
+    });
+    pthread_mutex_unlock(&gGlobalsMutateLock);
+
+    pthread_t thread_id;
+    if (pthread_create(&thread_id, nullptr, InitHeapprofd, nullptr) != 0) {
+      error_log("%s: heapprofd: failed to pthread_create.", getprogname());
+    } else if (pthread_detach(thread_id) != 0) {
+      error_log("%s: heapprofd: failed to pthread_detach", getprogname());
+    }
+    if (pthread_setname_np(thread_id, "heapprofdinit") != 0) {
+      error_log("%s: heapprod: failed to pthread_setname_np", getprogname());
+    }
+  }
+  return Malloc(malloc)(bytes);
+}
+
+// Marks this process as a profileable zygote child.
+static bool HandleInitZygoteChildProfiling() {
+  atomic_store_explicit(&gZygoteChildProfileable, true, memory_order_release);
+
+  // Conditionally start "from startup" profiling.
+  if (HeapprofdShouldLoad()) {
+    // Directly call the signal handler (will correctly guard against
+    // concurrent signal delivery).
+    MaybeInstallInitHeapprofdHook(kHeapprofdSignal);
+  }
+  return true;
+}
+
+static bool DispatchReset() {
+  if (!atomic_exchange(&gHeapprofdInitInProgress, true)) {
+    pthread_mutex_lock(&gGlobalsMutateLock);
+    __libc_globals.mutate([](libc_globals* globals) {
+      auto old_dispatch = GetDefaultDispatchTable();
+      atomic_store(&globals->default_dispatch_table, nullptr);
+      if (GetDispatchTable() == old_dispatch) {
+        atomic_store(&globals->current_dispatch_table, nullptr);
+      }
+    });
+    pthread_mutex_unlock(&gGlobalsMutateLock);
+    atomic_store(&gHeapprofdInitInProgress, false);
+    return true;
+  }
+  errno = EAGAIN;
+  return false;
+}
+
+bool HeapprofdMallopt(int opcode, void* arg, size_t arg_size) {
+  if (opcode == M_INIT_ZYGOTE_CHILD_PROFILING) {
+    if (arg != nullptr || arg_size != 0) {
+      errno = EINVAL;
+      return false;
+    }
+    return HandleInitZygoteChildProfiling();
+  }
+  if (opcode == M_RESET_HOOKS) {
+    if (arg != nullptr || arg_size != 0) {
+      errno = EINVAL;
+      return false;
+    }
+    return DispatchReset();
+  }
+  errno = ENOTSUP;
+  return false;
+}
diff --git a/libc/bionic/malloc_heapprofd.h b/libc/bionic/malloc_heapprofd.h
new file mode 100644
index 0000000..9e846b6
--- /dev/null
+++ b/libc/bionic/malloc_heapprofd.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#pragma once
+
+#include <stdint.h>
+
+#include <private/bionic_globals.h>
+
+bool HeapprofdShouldLoad();
+
+void HeapprofdInstallHooksAtInit(libc_globals* globals);
+
+void HeapprofdInstallSignalHandler();
+
+void HeapprofdInstallErrorSignalHandler();
+
+void HeapprofdMaskSignal();
+
+void HeapprofdUnmaskSignal();
+
+bool HeapprofdMallopt(int optcode, void* arg, size_t arg_size);
diff --git a/libc/bionic/malloc_info.cpp b/libc/bionic/malloc_info.cpp
deleted file mode 100644
index 9c8a4bf..0000000
--- a/libc/bionic/malloc_info.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "malloc_info.h"
-
-#include <errno.h>
-#include "private/bionic_macros.h"
-
-class __LIBC_HIDDEN__ Elem {
-public:
-  // name must be valid throughout lifetime of the object.
-  explicit Elem(FILE* fp, const char* name,
-                const char* attr_fmt = nullptr, ...) {
-    this->fp = fp;
-    this->name = name;
-
-    fprintf(fp, "<%s", name);
-    if (attr_fmt != nullptr) {
-      va_list args;
-      va_start(args, attr_fmt);
-      fputc(' ', fp);
-      vfprintf(fp, attr_fmt, args);
-      va_end(args);
-    }
-    fputc('>', fp);
-  }
-
-  ~Elem() noexcept {
-    fprintf(fp, "</%s>", name);
-  }
-
-  void contents(const char* fmt, ...) {
-      va_list args;
-      va_start(args, fmt);
-      vfprintf(fp, fmt, args);
-      va_end(args);
-  }
-
-private:
-  FILE* fp;
-  const char* name;
-
-  BIONIC_DISALLOW_IMPLICIT_CONSTRUCTORS(Elem);
-};
-
-int malloc_info(int options, FILE* fp) {
-  if (options != 0) {
-    errno = EINVAL;
-    return -1;
-  }
-
-  Elem root(fp, "malloc", "version=\"jemalloc-1\"");
-
-  // Dump all of the large allocations in the arenas.
-  for (size_t i = 0; i < __mallinfo_narenas(); i++) {
-    struct mallinfo mi = __mallinfo_arena_info(i);
-    if (mi.hblkhd != 0) {
-      Elem arena_elem(fp, "heap", "nr=\"%d\"", i);
-      {
-        Elem(fp, "allocated-large").contents("%zu", mi.ordblks);
-        Elem(fp, "allocated-huge").contents("%zu", mi.uordblks);
-        Elem(fp, "allocated-bins").contents("%zu", mi.fsmblks);
-
-        size_t total = 0;
-        for (size_t j = 0; j < __mallinfo_nbins(); j++) {
-          struct mallinfo mi = __mallinfo_bin_info(i, j);
-          if (mi.ordblks != 0) {
-            Elem bin_elem(fp, "bin", "nr=\"%d\"", j);
-            Elem(fp, "allocated").contents("%zu", mi.ordblks);
-            Elem(fp, "nmalloc").contents("%zu", mi.uordblks);
-            Elem(fp, "ndalloc").contents("%zu", mi.fordblks);
-            total += mi.ordblks;
-          }
-        }
-        Elem(fp, "bins-total").contents("%zu", total);
-      }
-    }
-  }
-
-  return 0;
-}
diff --git a/libc/bionic/malloc_info.h b/libc/bionic/malloc_info.h
deleted file mode 100644
index 257fec1..0000000
--- a/libc/bionic/malloc_info.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include <malloc.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-__LIBC_HIDDEN__ size_t __mallinfo_narenas();
-__LIBC_HIDDEN__ size_t __mallinfo_nbins();
-__LIBC_HIDDEN__ struct mallinfo __mallinfo_arena_info(size_t);
-__LIBC_HIDDEN__ struct mallinfo __mallinfo_bin_info(size_t, size_t);
-
-__END_DECLS
diff --git a/libc/bionic/malloc_limit.cpp b/libc/bionic/malloc_limit.cpp
new file mode 100644
index 0000000..b42865b
--- /dev/null
+++ b/libc/bionic/malloc_limit.cpp
@@ -0,0 +1,390 @@
+/*
+ * Copyright (C) 2019 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 <inttypes.h>
+#include <pthread.h>
+#include <stdatomic.h>
+#include <stdint.h>
+#include <stdio.h>
+
+#include <private/bionic_malloc_dispatch.h>
+
+#if __has_feature(hwaddress_sanitizer)
+#include <sanitizer/allocator_interface.h>
+#endif
+
+#include "malloc_common.h"
+#include "malloc_common_dynamic.h"
+#include "malloc_heapprofd.h"
+#include "malloc_limit.h"
+
+__BEGIN_DECLS
+static void* LimitCalloc(size_t n_elements, size_t elem_size);
+static void LimitFree(void* mem);
+static void* LimitMalloc(size_t bytes);
+static void* LimitMemalign(size_t alignment, size_t bytes);
+static int LimitPosixMemalign(void** memptr, size_t alignment, size_t size);
+static void* LimitRealloc(void* old_mem, size_t bytes);
+static void* LimitAlignedAlloc(size_t alignment, size_t size);
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+static void* LimitPvalloc(size_t bytes);
+static void* LimitValloc(size_t bytes);
+#endif
+
+// Pass through functions.
+static size_t LimitUsableSize(const void* mem);
+static struct mallinfo LimitMallinfo();
+static int LimitIterate(uintptr_t base, size_t size, void (*callback)(uintptr_t, size_t, void*), void* arg);
+static void LimitMallocDisable();
+static void LimitMallocEnable();
+static int LimitMallocInfo(int options, FILE* fp);
+static int LimitMallopt(int param, int value);
+__END_DECLS
+
+static constexpr MallocDispatch __limit_dispatch
+  __attribute__((unused)) = {
+    LimitCalloc,
+    LimitFree,
+    LimitMallinfo,
+    LimitMalloc,
+    LimitUsableSize,
+    LimitMemalign,
+    LimitPosixMemalign,
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+    LimitPvalloc,
+#endif
+    LimitRealloc,
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+    LimitValloc,
+#endif
+    LimitIterate,
+    LimitMallocDisable,
+    LimitMallocEnable,
+    LimitMallopt,
+    LimitAlignedAlloc,
+    LimitMallocInfo,
+  };
+
+static _Atomic uint64_t gAllocated;
+static uint64_t gAllocLimit;
+
+static inline bool CheckLimit(size_t bytes) {
+  uint64_t total;
+  if (__predict_false(__builtin_add_overflow(
+                          atomic_load_explicit(&gAllocated, memory_order_relaxed), bytes, &total) ||
+                      total > gAllocLimit)) {
+    return false;
+  }
+  return true;
+}
+
+static inline void* IncrementLimit(void* mem) {
+  if (__predict_false(mem == nullptr)) {
+    return nullptr;
+  }
+  atomic_fetch_add(&gAllocated, LimitUsableSize(mem));
+  return mem;
+}
+
+void* LimitCalloc(size_t n_elements, size_t elem_size) {
+  size_t total;
+  if (__builtin_add_overflow(n_elements, elem_size, &total) || !CheckLimit(total)) {
+    warning_log("malloc_limit: calloc(%zu, %zu) exceeds limit %" PRId64, n_elements, elem_size,
+                gAllocLimit);
+    return nullptr;
+  }
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return IncrementLimit(dispatch_table->calloc(n_elements, elem_size));
+  }
+  return IncrementLimit(Malloc(calloc)(n_elements, elem_size));
+}
+
+void LimitFree(void* mem) {
+  atomic_fetch_sub(&gAllocated, LimitUsableSize(mem));
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->free(mem);
+  }
+  return Malloc(free)(mem);
+}
+
+void* LimitMalloc(size_t bytes) {
+  if (!CheckLimit(bytes)) {
+    warning_log("malloc_limit: malloc(%zu) exceeds limit %" PRId64, bytes, gAllocLimit);
+    return nullptr;
+  }
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return IncrementLimit(dispatch_table->malloc(bytes));
+  }
+  return IncrementLimit(Malloc(malloc)(bytes));
+}
+
+static void* LimitMemalign(size_t alignment, size_t bytes) {
+  if (!CheckLimit(bytes)) {
+    warning_log("malloc_limit: memalign(%zu, %zu) exceeds limit %" PRId64, alignment, bytes,
+                gAllocLimit);
+    return nullptr;
+  }
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return IncrementLimit(dispatch_table->memalign(alignment, bytes));
+  }
+  return IncrementLimit(Malloc(memalign)(alignment, bytes));
+}
+
+static int LimitPosixMemalign(void** memptr, size_t alignment, size_t size) {
+  if (!CheckLimit(size)) {
+    warning_log("malloc_limit: posix_memalign(%zu, %zu) exceeds limit %" PRId64, alignment, size,
+                gAllocLimit);
+    return ENOMEM;
+  }
+  int retval;
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    retval = dispatch_table->posix_memalign(memptr, alignment, size);
+  } else {
+    retval = Malloc(posix_memalign)(memptr, alignment, size);
+  }
+  if (__predict_false(retval != 0)) {
+    return retval;
+  }
+  IncrementLimit(*memptr);
+  return 0;
+}
+
+static void* LimitAlignedAlloc(size_t alignment, size_t size) {
+  if (!CheckLimit(size)) {
+    warning_log("malloc_limit: aligned_alloc(%zu, %zu) exceeds limit %" PRId64, alignment, size,
+                gAllocLimit);
+    return nullptr;
+  }
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return IncrementLimit(dispatch_table->aligned_alloc(alignment, size));
+  }
+  return IncrementLimit(Malloc(aligned_alloc)(alignment, size));
+}
+
+static void* LimitRealloc(void* old_mem, size_t bytes) {
+  size_t old_usable_size = LimitUsableSize(old_mem);
+  void* new_ptr;
+  // Need to check the size only if the allocation will increase in size.
+  if (bytes > old_usable_size && !CheckLimit(bytes - old_usable_size)) {
+    warning_log("malloc_limit: realloc(%p, %zu) exceeds limit %" PRId64, old_mem, bytes,
+                gAllocLimit);
+    // Free the old pointer.
+    LimitFree(old_mem);
+    return nullptr;
+  }
+
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    new_ptr = dispatch_table->realloc(old_mem, bytes);
+  } else {
+    new_ptr = Malloc(realloc)(old_mem, bytes);
+  }
+
+  if (__predict_false(new_ptr == nullptr)) {
+    // This acts as if the pointer was freed.
+    atomic_fetch_sub(&gAllocated, old_usable_size);
+    return nullptr;
+  }
+
+  size_t new_usable_size = LimitUsableSize(new_ptr);
+  // Assumes that most allocations increase in size, rather than shrink.
+  if (__predict_false(old_usable_size > new_usable_size)) {
+    atomic_fetch_sub(&gAllocated, old_usable_size - new_usable_size);
+  } else {
+    atomic_fetch_add(&gAllocated, new_usable_size - old_usable_size);
+  }
+  return new_ptr;
+}
+
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+static void* LimitPvalloc(size_t bytes) {
+  if (!CheckLimit(bytes)) {
+    warning_log("malloc_limit: pvalloc(%zu) exceeds limit %" PRId64, bytes, gAllocLimit);
+    return nullptr;
+  }
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return IncrementLimit(dispatch_table->pvalloc(bytes));
+  }
+  return IncrementLimit(Malloc(pvalloc)(bytes));
+}
+
+static void* LimitValloc(size_t bytes) {
+  if (!CheckLimit(bytes)) {
+    warning_log("malloc_limit: valloc(%zu) exceeds limit %" PRId64, bytes, gAllocLimit);
+    return nullptr;
+  }
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return IncrementLimit(dispatch_table->valloc(bytes));
+  }
+  return IncrementLimit(Malloc(valloc)(bytes));
+}
+#endif
+
+#if defined(LIBC_STATIC)
+static bool EnableLimitDispatchTable() {
+  // This is the only valid way to modify the dispatch tables for a
+  // static executable so no locks are necessary.
+  __libc_globals.mutate([](libc_globals* globals) {
+    atomic_store(&globals->current_dispatch_table, &__limit_dispatch);
+  });
+  return true;
+}
+#else
+static bool EnableLimitDispatchTable() {
+  HeapprofdMaskSignal();
+  pthread_mutex_lock(&gGlobalsMutateLock);
+  // All other code that calls mutate will grab the gGlobalsMutateLock.
+  // However, there is one case where the lock cannot be acquired, in the
+  // signal handler that enables heapprofd. In order to avoid having two
+  // threads calling mutate at the same time, use an atomic variable to
+  // verify that only this function or the signal handler are calling mutate.
+  // If this function is called at the same time as the signal handler is
+  // being called, allow up to five ms for the signal handler to complete
+  // before failing.
+  bool enabled = false;
+  size_t num_tries = 20;
+  while (true) {
+    if (!atomic_exchange(&gGlobalsMutating, true)) {
+      __libc_globals.mutate([](libc_globals* globals) {
+        atomic_store(&globals->current_dispatch_table, &__limit_dispatch);
+      });
+      atomic_store(&gGlobalsMutating, false);
+      enabled = true;
+      break;
+    }
+    if (--num_tries == 0) {
+      break;
+    }
+    usleep(1000);
+  }
+  pthread_mutex_unlock(&gGlobalsMutateLock);
+  HeapprofdUnmaskSignal();
+  if (enabled) {
+    info_log("malloc_limit: Allocation limit enabled, max size %" PRId64 " bytes\n", gAllocLimit);
+  } else {
+    error_log("malloc_limit: Failed to enable allocation limit.");
+  }
+  return enabled;
+}
+#endif
+
+bool LimitEnable(void* arg, size_t arg_size) {
+  if (arg == nullptr || arg_size != sizeof(size_t)) {
+    errno = EINVAL;
+    return false;
+  }
+
+  static _Atomic bool limit_enabled;
+  if (atomic_exchange(&limit_enabled, true)) {
+    // The limit can only be enabled once.
+    error_log("malloc_limit: The allocation limit has already been set, it can only be set once.");
+    return false;
+  }
+
+  gAllocLimit = *reinterpret_cast<size_t*>(arg);
+#if __has_feature(hwaddress_sanitizer)
+  size_t current_allocated = __sanitizer_get_current_allocated_bytes();
+#else
+  size_t current_allocated;
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    current_allocated = dispatch_table->mallinfo().uordblks;
+  } else {
+    current_allocated = Malloc(mallinfo)().uordblks;
+  }
+#endif
+  atomic_store(&gAllocated, current_allocated);
+
+  return EnableLimitDispatchTable();
+}
+
+static size_t LimitUsableSize(const void* mem) {
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->malloc_usable_size(mem);
+  }
+  return Malloc(malloc_usable_size)(mem);
+}
+
+static struct mallinfo LimitMallinfo() {
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->mallinfo();
+  }
+  return Malloc(mallinfo)();
+}
+
+static int LimitIterate(uintptr_t base, size_t size, void (*callback)(uintptr_t, size_t, void*), void* arg) {
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->iterate(base, size, callback, arg);
+  }
+  return Malloc(iterate)(base, size, callback, arg);
+}
+
+static void LimitMallocDisable() {
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    dispatch_table->malloc_disable();
+  } else {
+    Malloc(malloc_disable)();
+  }
+}
+
+static void LimitMallocEnable() {
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    dispatch_table->malloc_enable();
+  } else {
+    Malloc(malloc_enable)();
+  }
+}
+
+static int LimitMallocInfo(int options, FILE* fp) {
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->malloc_info(options, fp);
+  }
+  return Malloc(malloc_info)(options, fp);
+}
+
+static int LimitMallopt(int param, int value) {
+  auto dispatch_table = GetDefaultDispatchTable();
+  if (__predict_false(dispatch_table != nullptr)) {
+    return dispatch_table->mallopt(param, value);
+  }
+  return Malloc(mallopt)(param, value);
+}
diff --git a/libc/bionic/malloc_limit.h b/libc/bionic/malloc_limit.h
new file mode 100644
index 0000000..282598f
--- /dev/null
+++ b/libc/bionic/malloc_limit.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#pragma once
+
+#include <stdint.h>
+
+// Function prototypes.
+bool LimitEnable(void* arg, size_t arg_size);
diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp
index dbacf18..2c3299f 100644
--- a/libc/bionic/ndk_cruft.cpp
+++ b/libc/bionic/ndk_cruft.cpp
@@ -355,9 +355,14 @@
   return malloc(size);
 }
 
+} // extern "C"
+
 #define __get_thread __real_get_thread
 #include "pthread_internal.h"
 #undef __get_thread
+
+extern "C" {
+
 // Various third-party apps contain a backport of our pthread_rwlock implementation that uses this.
 pthread_internal_t* __get_thread() {
   return __real_get_thread();
diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp
index 8e8d180..4cf14ad 100644
--- a/libc/bionic/pthread_create.cpp
+++ b/libc/bionic/pthread_create.cpp
@@ -41,8 +41,10 @@
 
 #include "private/bionic_constants.h"
 #include "private/bionic_defs.h"
+#include "private/bionic_globals.h"
 #include "private/bionic_macros.h"
 #include "private/bionic_ssp.h"
+#include "private/bionic_systrace.h"
 #include "private/bionic_tls.h"
 #include "private/ErrnoRestorer.h"
 
@@ -54,42 +56,51 @@
 
 // This code is used both by each new pthread and the code that initializes the main thread.
 __attribute__((no_stack_protector))
-void __init_tls(pthread_internal_t* thread) {
-  // Slot 0 must point to itself. The x86 Linux kernel reads the TLS from %fs:0.
-  thread->tls[TLS_SLOT_SELF] = thread->tls;
-  thread->tls[TLS_SLOT_THREAD_ID] = thread;
+void __init_tcb(bionic_tcb* tcb, pthread_internal_t* thread) {
+#ifdef TLS_SLOT_SELF
+  // On x86, slot 0 must point to itself so code can read the thread pointer by
+  // loading %fs:0 or %gs:0.
+  tcb->tls_slot(TLS_SLOT_SELF) = &tcb->tls_slot(TLS_SLOT_SELF);
+#endif
+  tcb->tls_slot(TLS_SLOT_THREAD_ID) = thread;
 }
 
 __attribute__((no_stack_protector))
-void __init_tls_stack_guard(pthread_internal_t* thread) {
+void __init_tcb_stack_guard(bionic_tcb* tcb) {
   // GCC looks in the TLS for the stack guard on x86, so copy it there from our global.
-  thread->tls[TLS_SLOT_STACK_GUARD] = reinterpret_cast<void*>(__stack_chk_guard);
+  tcb->tls_slot(TLS_SLOT_STACK_GUARD) = reinterpret_cast<void*>(__stack_chk_guard);
 }
 
-bionic_tls* __allocate_bionic_tls() {
-  // Add a guard before and after.
-  size_t allocation_size = BIONIC_TLS_SIZE + (2 * PTHREAD_GUARD_SIZE);
-  void* allocation = mmap(nullptr, allocation_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+__attribute__((no_stack_protector))
+void __init_tcb_dtv(bionic_tcb* tcb) {
+  // Initialize the DTV slot to a statically-allocated empty DTV. The first
+  // access to a dynamic TLS variable allocates a new DTV.
+  static const TlsDtv zero_dtv = {};
+  __set_tcb_dtv(tcb, const_cast<TlsDtv*>(&zero_dtv));
+}
+
+void __init_bionic_tls_ptrs(bionic_tcb* tcb, bionic_tls* tls) {
+  tcb->thread()->bionic_tls = tls;
+  tcb->tls_slot(TLS_SLOT_BIONIC_TLS) = tls;
+}
+
+// Allocate a temporary bionic_tls that the dynamic linker's main thread can
+// use while it's loading the initial set of ELF modules.
+bionic_tls* __allocate_temp_bionic_tls() {
+  size_t allocation_size = __BIONIC_ALIGN(sizeof(bionic_tls), PAGE_SIZE);
+  void* allocation = mmap(nullptr, allocation_size,
+                          PROT_READ | PROT_WRITE,
+                          MAP_PRIVATE | MAP_ANONYMOUS,
+                          -1, 0);
   if (allocation == MAP_FAILED) {
-    async_safe_format_log(ANDROID_LOG_WARN, "libc",
-                          "pthread_create failed: couldn't allocate TLS: %s", strerror(errno));
-    return nullptr;
+    // Avoid strerror because it might need bionic_tls.
+    async_safe_fatal("failed to allocate bionic_tls: error %d", errno);
   }
+  return static_cast<bionic_tls*>(allocation);
+}
 
-  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, allocation, allocation_size, "bionic TLS guard");
-
-  // Carve out the writable TLS section.
-  bionic_tls* result = reinterpret_cast<bionic_tls*>(static_cast<char*>(allocation) +
-                                                     PTHREAD_GUARD_SIZE);
-  if (mprotect(result, BIONIC_TLS_SIZE, PROT_READ | PROT_WRITE) != 0) {
-    async_safe_format_log(ANDROID_LOG_WARN, "libc",
-                          "pthread_create failed: couldn't mprotect TLS: %s", strerror(errno));
-    munmap(allocation, allocation_size);
-    return nullptr;
-  }
-
-  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, result, BIONIC_TLS_SIZE, "bionic TLS");
-  return result;
+void __free_temp_bionic_tls(bionic_tls* tls) {
+  munmap(tls, __BIONIC_ALIGN(sizeof(bionic_tls), PAGE_SIZE));
 }
 
 static void __init_alternate_signal_stack(pthread_internal_t* thread) {
@@ -111,24 +122,30 @@
     // We can only use const static allocated string for mapped region name, as Android kernel
     // uses the string pointer directly when dumping /proc/pid/maps.
     prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ss.ss_sp, ss.ss_size, "thread signal stack");
-    prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, stack_base, PTHREAD_GUARD_SIZE, "thread signal stack guard");
   }
 }
 
 static void __init_shadow_call_stack(pthread_internal_t* thread __unused) {
 #ifdef __aarch64__
-  // Allocate the stack and store its address in register x18. The address is aligned to SCS_SIZE so
-  // that we only need to store the lower log2(SCS_SIZE) bits in jmp_buf.
-  // TODO(pcc): We ought to allocate a larger guard region here and then allocate the SCS at a
-  // random location within it. This will provide greater security since it would mean that an
-  // attacker who can read the pthread_internal_t won't be able to discover the address of the SCS.
-  // However, doing so is blocked on a solution to b/118642754.
+  // Allocate the stack and the guard region.
   char* scs_guard_region = reinterpret_cast<char*>(
       mmap(nullptr, SCS_GUARD_REGION_SIZE, 0, MAP_PRIVATE | MAP_ANON, -1, 0));
   thread->shadow_call_stack_guard_region = scs_guard_region;
 
-  char* scs =
+  // The address is aligned to SCS_SIZE so that we only need to store the lower log2(SCS_SIZE) bits
+  // in jmp_buf.
+  char* scs_aligned_guard_region =
       reinterpret_cast<char*>(align_up(reinterpret_cast<uintptr_t>(scs_guard_region), SCS_SIZE));
+
+  // We need to ensure that [scs_offset,scs_offset+SCS_SIZE) is in the guard region and that there
+  // is at least one unmapped page after the shadow call stack (to catch stack overflows). We can't
+  // use arc4random_uniform in init because /dev/urandom might not have been created yet.
+  size_t scs_offset =
+      (getpid() == 1) ? 0 : (arc4random_uniform(SCS_GUARD_REGION_SIZE / SCS_SIZE - 1) * SCS_SIZE);
+
+  // Make the stack readable and writable and store its address in register x18. This is
+  // deliberately the only place where the address is stored.
+  char *scs = scs_aligned_guard_region + scs_offset;
   mprotect(scs, SCS_SIZE, PROT_READ | PROT_WRITE);
   __asm__ __volatile__("mov x18, %0" ::"r"(scs));
 #endif
@@ -192,84 +209,114 @@
   return 0;
 }
 
-static void* __create_thread_mapped_space(size_t mmap_size, size_t stack_guard_size) {
-  // Create a new private anonymous map.
-  int prot = PROT_READ | PROT_WRITE;
-  int flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE;
-  void* space = mmap(nullptr, mmap_size, prot, flags, -1, 0);
+
+// Allocate a thread's primary mapping. This mapping includes static TLS and
+// optionally a stack. Static TLS includes ELF TLS segments and the bionic_tls
+// struct.
+//
+// The stack_guard_size must be a multiple of the PAGE_SIZE.
+ThreadMapping __allocate_thread_mapping(size_t stack_size, size_t stack_guard_size) {
+  const StaticTlsLayout& layout = __libc_shared_globals()->static_tls_layout;
+
+  // Allocate in order: stack guard, stack, static TLS, guard page.
+  size_t mmap_size;
+  if (__builtin_add_overflow(stack_size, stack_guard_size, &mmap_size)) return {};
+  if (__builtin_add_overflow(mmap_size, layout.size(), &mmap_size)) return {};
+  if (__builtin_add_overflow(mmap_size, PTHREAD_GUARD_SIZE, &mmap_size)) return {};
+
+  // Align the result to a page size.
+  const size_t unaligned_size = mmap_size;
+  mmap_size = __BIONIC_ALIGN(mmap_size, PAGE_SIZE);
+  if (mmap_size < unaligned_size) return {};
+
+  // Create a new private anonymous map. Make the entire mapping PROT_NONE, then carve out a
+  // read+write area in the middle.
+  const int flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE;
+  char* const space = static_cast<char*>(mmap(nullptr, mmap_size, PROT_NONE, flags, -1, 0));
   if (space == MAP_FAILED) {
     async_safe_format_log(ANDROID_LOG_WARN,
-                      "libc",
-                      "pthread_create failed: couldn't allocate %zu-bytes mapped space: %s",
-                      mmap_size, strerror(errno));
-    return nullptr;
+                          "libc",
+                          "pthread_create failed: couldn't allocate %zu-bytes mapped space: %s",
+                          mmap_size, strerror(errno));
+    return {};
   }
-
-  // Stack is at the lower end of mapped space, stack guard region is at the lower end of stack.
-  // Set the stack guard region to PROT_NONE, so we can detect thread stack overflow.
-  if (mprotect(space, stack_guard_size, PROT_NONE) == -1) {
+  const size_t writable_size = mmap_size - stack_guard_size - PTHREAD_GUARD_SIZE;
+  if (mprotect(space + stack_guard_size,
+               writable_size,
+               PROT_READ | PROT_WRITE) != 0) {
     async_safe_format_log(ANDROID_LOG_WARN, "libc",
-                          "pthread_create failed: couldn't mprotect PROT_NONE %zu-byte stack guard region: %s",
-                          stack_guard_size, strerror(errno));
+                          "pthread_create failed: couldn't mprotect R+W %zu-byte thread mapping region: %s",
+                          writable_size, strerror(errno));
     munmap(space, mmap_size);
-    return nullptr;
+    return {};
   }
-  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, space, stack_guard_size, "thread stack guard");
 
-  return space;
+  ThreadMapping result = {};
+  result.mmap_base = space;
+  result.mmap_size = mmap_size;
+  result.static_tls = space + mmap_size - PTHREAD_GUARD_SIZE - layout.size();
+  result.stack_base = space;
+  result.stack_top = result.static_tls;
+  return result;
 }
 
-static int __allocate_thread(pthread_attr_t* attr, pthread_internal_t** threadp, void** child_stack) {
-  size_t mmap_size;
-  uint8_t* stack_top;
+static int __allocate_thread(pthread_attr_t* attr, bionic_tcb** tcbp, void** child_stack) {
+  ThreadMapping mapping;
+  char* stack_top;
+  bool stack_clean = false;
 
   if (attr->stack_base == nullptr) {
     // The caller didn't provide a stack, so allocate one.
-    // Make sure the stack size and guard size are multiples of PAGE_SIZE.
-    if (__builtin_add_overflow(attr->stack_size, attr->guard_size, &mmap_size)) return EAGAIN;
-    if (__builtin_add_overflow(mmap_size, sizeof(pthread_internal_t), &mmap_size)) return EAGAIN;
-    mmap_size = __BIONIC_ALIGN(mmap_size, PAGE_SIZE);
+
+    // Make sure the guard size is a multiple of PAGE_SIZE.
+    const size_t unaligned_guard_size = attr->guard_size;
     attr->guard_size = __BIONIC_ALIGN(attr->guard_size, PAGE_SIZE);
-    attr->stack_base = __create_thread_mapped_space(mmap_size, attr->guard_size);
-    if (attr->stack_base == nullptr) {
-      return EAGAIN;
-    }
-    stack_top = reinterpret_cast<uint8_t*>(attr->stack_base) + mmap_size;
+    if (attr->guard_size < unaligned_guard_size) return EAGAIN;
+
+    mapping = __allocate_thread_mapping(attr->stack_size, attr->guard_size);
+    if (mapping.mmap_base == nullptr) return EAGAIN;
+
+    stack_top = mapping.stack_top;
+    attr->stack_base = mapping.stack_base;
+    stack_clean = true;
   } else {
-    // Remember the mmap size is zero and we don't need to free it.
-    mmap_size = 0;
-    stack_top = reinterpret_cast<uint8_t*>(attr->stack_base) + attr->stack_size;
+    mapping = __allocate_thread_mapping(0, PTHREAD_GUARD_SIZE);
+    if (mapping.mmap_base == nullptr) return EAGAIN;
+
+    stack_top = static_cast<char*>(attr->stack_base) + attr->stack_size;
   }
 
-  // Mapped space(or user allocated stack) is used for:
-  //   pthread_internal_t
-  //   thread stack (including guard)
+  // Carve out space from the stack for the thread's pthread_internal_t. This
+  // memory isn't counted in pthread_attr_getstacksize.
 
   // To safely access the pthread_internal_t and thread stack, we need to find a 16-byte aligned boundary.
-  stack_top = reinterpret_cast<uint8_t*>(
-                (reinterpret_cast<uintptr_t>(stack_top) - sizeof(pthread_internal_t)) & ~0xf);
+  stack_top = align_down(stack_top - sizeof(pthread_internal_t), 16);
 
   pthread_internal_t* thread = reinterpret_cast<pthread_internal_t*>(stack_top);
-  if (mmap_size == 0) {
+  if (!stack_clean) {
     // If thread was not allocated by mmap(), it may not have been cleared to zero.
     // So assume the worst and zero it.
     memset(thread, 0, sizeof(pthread_internal_t));
   }
-  attr->stack_size = stack_top - reinterpret_cast<uint8_t*>(attr->stack_base);
 
-  thread->mmap_size = mmap_size;
+  // Locate static TLS structures within the mapped region.
+  const StaticTlsLayout& layout = __libc_shared_globals()->static_tls_layout;
+  auto tcb = reinterpret_cast<bionic_tcb*>(mapping.static_tls + layout.offset_bionic_tcb());
+  auto tls = reinterpret_cast<bionic_tls*>(mapping.static_tls + layout.offset_bionic_tls());
+
+  // Initialize TLS memory.
+  __init_static_tls(mapping.static_tls);
+  __init_tcb(tcb, thread);
+  __init_tcb_dtv(tcb);
+  __init_tcb_stack_guard(tcb);
+  __init_bionic_tls_ptrs(tcb, tls);
+
+  attr->stack_size = stack_top - static_cast<char*>(attr->stack_base);
   thread->attr = *attr;
+  thread->mmap_base = mapping.mmap_base;
+  thread->mmap_size = mapping.mmap_size;
 
-  thread->bionic_tls = __allocate_bionic_tls();
-  if (thread->bionic_tls == nullptr) {
-    if (thread->mmap_size != 0) munmap(thread->attr.stack_base, thread->mmap_size);
-    return EAGAIN;
-  }
-
-  __init_tls(thread);
-  __init_tls_stack_guard(thread);
-
-  *threadp = thread;
+  *tcbp = tcb;
   *child_stack = stack_top;
   return 0;
 }
@@ -308,6 +355,7 @@
   ErrnoRestorer errno_restorer;
 
   pthread_attr_t thread_attr;
+  ScopedTrace trace("pthread_create");
   if (attr == nullptr) {
     pthread_attr_init(&thread_attr);
   } else {
@@ -315,13 +363,15 @@
     attr = nullptr; // Prevent misuse below.
   }
 
-  pthread_internal_t* thread = nullptr;
+  bionic_tcb* tcb = nullptr;
   void* child_stack = nullptr;
-  int result = __allocate_thread(&thread_attr, &thread, &child_stack);
+  int result = __allocate_thread(&thread_attr, &tcb, &child_stack);
   if (result != 0) {
     return result;
   }
 
+  pthread_internal_t* thread = tcb->thread();
+
   // Create a lock for the thread to wait on once it starts so we can keep
   // it from doing anything until after we notify the debugger about it
   //
@@ -338,7 +388,7 @@
 
   int flags = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD | CLONE_SYSVSEM |
       CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
-  void* tls = reinterpret_cast<void*>(thread->tls);
+  void* tls = &tcb->tls_slot(0);
 #if defined(__i386__)
   // On x86 (but not x86-64), CLONE_SETTLS takes a pointer to a struct user_desc rather than
   // a pointer to the TLS itself.
@@ -354,7 +404,7 @@
     // reminder that you can't rewrite this function to use a ScopedPthreadMutexLocker.
     thread->startup_handshake_lock.unlock();
     if (thread->mmap_size != 0) {
-      munmap(thread->attr.stack_base, thread->mmap_size);
+      munmap(thread->mmap_base, thread->mmap_size);
     }
     async_safe_format_log(ANDROID_LOG_WARN, "libc", "pthread_create failed: clone failed: %s",
                           strerror(clone_errno));
diff --git a/libc/bionic/pthread_detach.cpp b/libc/bionic/pthread_detach.cpp
index c2e4127..6b22039 100644
--- a/libc/bionic/pthread_detach.cpp
+++ b/libc/bionic/pthread_detach.cpp
@@ -34,7 +34,7 @@
 
 __BIONIC_WEAK_FOR_NATIVE_BRIDGE
 int pthread_detach(pthread_t t) {
-  pthread_internal_t* thread = __pthread_internal_find(t);
+  pthread_internal_t* thread = __pthread_internal_find(t, "pthread_detach");
   if (thread == nullptr) {
     return ESRCH;
   }
diff --git a/libc/bionic/pthread_exit.cpp b/libc/bionic/pthread_exit.cpp
index 2d4d6cf..3b873b3 100644
--- a/libc/bionic/pthread_exit.cpp
+++ b/libc/bionic/pthread_exit.cpp
@@ -65,12 +65,6 @@
   }
 }
 
-static void __pthread_unmap_tls(pthread_internal_t* thread) {
-  // Unmap the bionic TLS, including guard pages.
-  void* allocation = reinterpret_cast<char*>(thread->bionic_tls) - PTHREAD_GUARD_SIZE;
-  munmap(allocation, BIONIC_TLS_SIZE + 2 * PTHREAD_GUARD_SIZE);
-}
-
 __BIONIC_WEAK_FOR_NATIVE_BRIDGE
 void pthread_exit(void* return_value) {
   // Call dtors for thread_local objects first.
@@ -104,15 +98,22 @@
     thread->alternate_signal_stack = nullptr;
   }
 
+  ThreadJoinState old_state = THREAD_NOT_JOINED;
+  while (old_state == THREAD_NOT_JOINED &&
+         !atomic_compare_exchange_weak(&thread->join_state, &old_state, THREAD_EXITED_NOT_JOINED)) {
+  }
+
+  // We don't want to take a signal after unmapping the stack, the shadow call
+  // stack, or dynamic TLS memory.
+  ScopedSignalBlocker ssb;
+
 #ifdef __aarch64__
   // Free the shadow call stack and guard pages.
   munmap(thread->shadow_call_stack_guard_region, SCS_GUARD_REGION_SIZE);
 #endif
 
-  ThreadJoinState old_state = THREAD_NOT_JOINED;
-  while (old_state == THREAD_NOT_JOINED &&
-         !atomic_compare_exchange_weak(&thread->join_state, &old_state, THREAD_EXITED_NOT_JOINED)) {
-  }
+  // Free the ELF TLS DTV and all dynamically-allocated ELF TLS memory.
+  __free_dynamic_tls(__get_bionic_tcb());
 
   if (old_state == THREAD_DETACHED) {
     // The thread is detached, no one will use pthread_internal_t after pthread_exit.
@@ -127,19 +128,13 @@
     if (thread->mmap_size != 0) {
       // We need to free mapped space for detached threads when they exit.
       // That's not something we can do in C.
-
-      // We don't want to take a signal after we've unmapped the stack.
-      // That's one last thing we can do before dropping to assembler.
-      ScopedSignalBlocker ssb;
-      __pthread_unmap_tls(thread);
       __hwasan_thread_exit();
-      _exit_with_stack_teardown(thread->attr.stack_base, thread->mmap_size);
+      _exit_with_stack_teardown(thread->mmap_base, thread->mmap_size);
     }
   }
 
   // No need to free mapped space. Either there was no space mapped, or it is left for
   // the pthread_join caller to clean up.
-  __pthread_unmap_tls(thread);
   __hwasan_thread_exit();
   __exit(0);
 }
diff --git a/libc/bionic/pthread_getcpuclockid.cpp b/libc/bionic/pthread_getcpuclockid.cpp
index f641e4c..0b35998 100644
--- a/libc/bionic/pthread_getcpuclockid.cpp
+++ b/libc/bionic/pthread_getcpuclockid.cpp
@@ -31,7 +31,7 @@
 #include "pthread_internal.h"
 
 int pthread_getcpuclockid(pthread_t t, clockid_t* clockid) {
-  pid_t tid = pthread_gettid_np(t);
+  pid_t tid = __pthread_internal_gettid(t, "pthread_getcpuclockid");
   if (tid == -1) return ESRCH;
 
   // The tid is stored in the top bits, but negated.
diff --git a/libc/bionic/pthread_getschedparam.cpp b/libc/bionic/pthread_getschedparam.cpp
index cc1ece8..ed1853b 100644
--- a/libc/bionic/pthread_getschedparam.cpp
+++ b/libc/bionic/pthread_getschedparam.cpp
@@ -34,7 +34,7 @@
 int pthread_getschedparam(pthread_t t, int* policy, sched_param* param) {
   ErrnoRestorer errno_restorer;
 
-  pid_t tid = pthread_gettid_np(t);
+  pid_t tid = __pthread_internal_gettid(t, "pthread_getschedparam");
   if (tid == -1) return ESRCH;
 
   if (sched_getparam(tid, param) == -1) return errno;
diff --git a/libc/bionic/pthread_gettid_np.cpp b/libc/bionic/pthread_gettid_np.cpp
index 1beddc9..d14900b 100644
--- a/libc/bionic/pthread_gettid_np.cpp
+++ b/libc/bionic/pthread_gettid_np.cpp
@@ -31,6 +31,5 @@
 
 __BIONIC_WEAK_FOR_NATIVE_BRIDGE
 pid_t pthread_gettid_np(pthread_t t) {
-  pthread_internal_t* thread = __pthread_internal_find(t);
-  return thread ? thread->tid : -1;
+  return __pthread_internal_gettid(t, "pthread_gettid_np");
 }
diff --git a/libc/bionic/pthread_internal.cpp b/libc/bionic/pthread_internal.cpp
index 2b7a99a..6fddefe 100644
--- a/libc/bionic/pthread_internal.cpp
+++ b/libc/bionic/pthread_internal.cpp
@@ -35,30 +35,13 @@
 
 #include <async_safe/log.h>
 
+#include "private/ScopedRWLock.h"
 #include "private/bionic_futex.h"
 #include "private/bionic_tls.h"
 
 static pthread_internal_t* g_thread_list = nullptr;
 static pthread_rwlock_t g_thread_list_lock = PTHREAD_RWLOCK_INITIALIZER;
 
-template <bool write> class ScopedRWLock {
- public:
-  ScopedRWLock(pthread_rwlock_t* rwlock) : rwlock_(rwlock) {
-    (write ? pthread_rwlock_wrlock : pthread_rwlock_rdlock)(rwlock_);
-  }
-
-  ~ScopedRWLock() {
-    pthread_rwlock_unlock(rwlock_);
-  }
-
- private:
-  pthread_rwlock_t* rwlock_;
-  BIONIC_DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedRWLock);
-};
-
-typedef ScopedRWLock<true> ScopedWriteLock;
-typedef ScopedRWLock<false> ScopedReadLock;
-
 pthread_t __pthread_internal_add(pthread_internal_t* thread) {
   ScopedWriteLock locker(&g_thread_list_lock);
 
@@ -88,7 +71,7 @@
 static void __pthread_internal_free(pthread_internal_t* thread) {
   if (thread->mmap_size != 0) {
     // Free mapped space, including thread stack and pthread_internal_t.
-    munmap(thread->attr.stack_base, thread->mmap_size);
+    munmap(thread->mmap_base, thread->mmap_size);
   }
 }
 
@@ -97,7 +80,12 @@
   __pthread_internal_free(thread);
 }
 
-pthread_internal_t* __pthread_internal_find(pthread_t thread_id) {
+pid_t __pthread_internal_gettid(pthread_t thread_id, const char* caller) {
+  pthread_internal_t* thread = __pthread_internal_find(thread_id, caller);
+  return thread ? thread->tid : -1;
+}
+
+pthread_internal_t* __pthread_internal_find(pthread_t thread_id, const char* caller) {
   pthread_internal_t* thread = reinterpret_cast<pthread_internal_t*>(thread_id);
 
   // Check if we're looking for ourselves before acquiring the lock.
@@ -120,9 +108,9 @@
       // addresses might sometimes contain threads or things that look enough like
       // threads for us to do some real damage by continuing.
       // TODO: try getting rid of this when Treble lets us keep vendor blobs on an old API level.
-      async_safe_format_log(ANDROID_LOG_WARN, "libc", "invalid pthread_t (0) passed to libc");
+      async_safe_format_log(ANDROID_LOG_WARN, "libc", "invalid pthread_t (0) passed to %s", caller);
     } else {
-      async_safe_fatal("invalid pthread_t %p passed to libc", thread);
+      async_safe_fatal("invalid pthread_t %p passed to %s", thread, caller);
     }
   }
   return nullptr;
diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h
index 4c13dcb..a1e0c45 100644
--- a/libc/bionic/pthread_internal.h
+++ b/libc/bionic/pthread_internal.h
@@ -38,6 +38,7 @@
 #define __hwasan_thread_exit()
 #endif
 
+#include "private/bionic_elf_tls.h"
 #include "private/bionic_lock.h"
 #include "private/bionic_tls.h"
 
@@ -52,12 +53,6 @@
 #define PTHREAD_ATTR_FLAG_INHERIT 0x00000004
 #define PTHREAD_ATTR_FLAG_EXPLICIT 0x00000008
 
-class pthread_key_data_t {
- public:
-  uintptr_t seq; // Use uintptr_t just for alignment, as we use pointer below.
-  void* data;
-};
-
 enum ThreadJoinState {
   THREAD_NOT_JOINED,
   THREAD_EXITED_NOT_JOINED,
@@ -131,6 +126,7 @@
 
   Lock startup_handshake_lock;
 
+  void* mmap_base;
   size_t mmap_size;
 
   thread_local_dtor* thread_local_dtors;
@@ -146,42 +142,55 @@
   bionic_tls* bionic_tls;
 
   int errno_value;
-
-  // The thread pointer (__get_tls()) points at this field. This field must come last so that
-  // an executable's TLS segment can be allocated at a fixed offset after the thread pointer.
-  void* tls[BIONIC_TLS_SLOTS];
-
-  // The golang runtime currently expects this field to come after the slots.
-  pthread_key_data_t key_data[BIONIC_PTHREAD_KEY_COUNT];
 };
 
-__LIBC_HIDDEN__ void __init_tls(pthread_internal_t* thread);
-__LIBC_HIDDEN__ void __init_tls_stack_guard(pthread_internal_t* thread);
-__LIBC_HIDDEN__ bionic_tls* __allocate_bionic_tls();
+struct ThreadMapping {
+  char* mmap_base;
+  size_t mmap_size;
+
+  char* static_tls;
+  char* stack_base;
+  char* stack_top;
+};
+
+__LIBC_HIDDEN__ void __init_tcb(bionic_tcb* tcb, pthread_internal_t* thread);
+__LIBC_HIDDEN__ void __init_tcb_stack_guard(bionic_tcb* tcb);
+__LIBC_HIDDEN__ void __init_tcb_dtv(bionic_tcb* tcb);
+__LIBC_HIDDEN__ void __init_bionic_tls_ptrs(bionic_tcb* tcb, bionic_tls* tls);
+__LIBC_HIDDEN__ bionic_tls* __allocate_temp_bionic_tls();
+__LIBC_HIDDEN__ void __free_temp_bionic_tls(bionic_tls* tls);
 __LIBC_HIDDEN__ void __init_additional_stacks(pthread_internal_t*);
 __LIBC_HIDDEN__ int __init_thread(pthread_internal_t* thread);
+__LIBC_HIDDEN__ ThreadMapping __allocate_thread_mapping(size_t stack_size, size_t stack_guard_size);
 
-__LIBC_HIDDEN__ pthread_t           __pthread_internal_add(pthread_internal_t* thread);
-__LIBC_HIDDEN__ pthread_internal_t* __pthread_internal_find(pthread_t pthread_id);
-__LIBC_HIDDEN__ void                __pthread_internal_remove(pthread_internal_t* thread);
-__LIBC_HIDDEN__ void                __pthread_internal_remove_and_free(pthread_internal_t* thread);
+__LIBC_HIDDEN__ pthread_t __pthread_internal_add(pthread_internal_t* thread);
+__LIBC_HIDDEN__ pthread_internal_t* __pthread_internal_find(pthread_t pthread_id, const char* caller);
+__LIBC_HIDDEN__ pid_t __pthread_internal_gettid(pthread_t pthread_id, const char* caller);
+__LIBC_HIDDEN__ void __pthread_internal_remove(pthread_internal_t* thread);
+__LIBC_HIDDEN__ void __pthread_internal_remove_and_free(pthread_internal_t* thread);
+
+static inline __always_inline bionic_tcb* __get_bionic_tcb() {
+  return reinterpret_cast<bionic_tcb*>(&__get_tls()[MIN_TLS_SLOT]);
+}
 
 // Make __get_thread() inlined for performance reason. See http://b/19825434.
 static inline __always_inline pthread_internal_t* __get_thread() {
-  void** tls = __get_tls();
-  if (__predict_true(tls)) {
-    return reinterpret_cast<pthread_internal_t*>(tls[TLS_SLOT_THREAD_ID]);
-  }
-
-  // This happens when called during libc initialization before TLS has been initialized.
-  return nullptr;
+  return static_cast<pthread_internal_t*>(__get_tls()[TLS_SLOT_THREAD_ID]);
 }
 
 static inline __always_inline bionic_tls& __get_bionic_tls() {
-  return *__get_thread()->bionic_tls;
+  return *static_cast<bionic_tls*>(__get_tls()[TLS_SLOT_BIONIC_TLS]);
 }
 
-extern __LIBC_HIDDEN__ pthread_internal_t* __get_main_thread();
+static inline __always_inline TlsDtv* __get_tcb_dtv(bionic_tcb* tcb) {
+  uintptr_t dtv_slot = reinterpret_cast<uintptr_t>(tcb->tls_slot(TLS_SLOT_DTV));
+  return reinterpret_cast<TlsDtv*>(dtv_slot - offsetof(TlsDtv, generation));
+}
+
+static inline void __set_tcb_dtv(bionic_tcb* tcb, TlsDtv* val) {
+  tcb->tls_slot(TLS_SLOT_DTV) = &val->generation;
+}
+
 extern "C" __LIBC_HIDDEN__ int __set_tls(void* ptr);
 
 __LIBC_HIDDEN__ void pthread_key_clean_all(void);
diff --git a/libc/bionic/pthread_join.cpp b/libc/bionic/pthread_join.cpp
index 9aad458..e230fab 100644
--- a/libc/bionic/pthread_join.cpp
+++ b/libc/bionic/pthread_join.cpp
@@ -30,15 +30,17 @@
 
 #include "private/bionic_defs.h"
 #include "private/bionic_futex.h"
+#include "private/bionic_systrace.h"
 #include "pthread_internal.h"
 
 __BIONIC_WEAK_FOR_NATIVE_BRIDGE
 int pthread_join(pthread_t t, void** return_value) {
+  ScopedTrace trace("pthread_join");
   if (t == pthread_self()) {
     return EDEADLK;
   }
 
-  pthread_internal_t* thread = __pthread_internal_find(t);
+  pthread_internal_t* thread = __pthread_internal_find(t, "pthread_join");
   if (thread == nullptr) {
     return ESRCH;
   }
diff --git a/libc/bionic/pthread_key.cpp b/libc/bionic/pthread_key.cpp
index f3878a6..53f0f11 100644
--- a/libc/bionic/pthread_key.cpp
+++ b/libc/bionic/pthread_key.cpp
@@ -69,12 +69,16 @@
   return (key < (KEY_VALID_FLAG | BIONIC_PTHREAD_KEY_COUNT));
 }
 
+static inline pthread_key_data_t* get_thread_key_data() {
+  return __get_bionic_tls().key_data;
+}
+
 // Called from pthread_exit() to remove all pthread keys. This must call the destructor of
 // all keys that have a non-NULL data value and a non-NULL destructor.
 __LIBC_HIDDEN__ void pthread_key_clean_all() {
   // Because destructors can do funky things like deleting/creating other keys,
   // we need to implement this in a loop.
-  pthread_key_data_t* key_data = __get_thread()->key_data;
+  pthread_key_data_t* key_data = get_thread_key_data();
   for (size_t rounds = PTHREAD_DESTRUCTOR_ITERATIONS; rounds > 0; --rounds) {
     size_t called_destructor_count = 0;
     for (size_t i = 0; i < BIONIC_PTHREAD_KEY_COUNT; ++i) {
@@ -158,7 +162,7 @@
   }
   key &= ~KEY_VALID_FLAG;
   uintptr_t seq = atomic_load_explicit(&key_map[key].seq, memory_order_relaxed);
-  pthread_key_data_t* data = &(__get_thread()->key_data[key]);
+  pthread_key_data_t* data = &get_thread_key_data()[key];
   // It is user's responsibility to synchornize between the creation and use of pthread keys,
   // so we use memory_order_relaxed when checking the sequence number.
   if (__predict_true(SeqOfKeyInUse(seq) && data->seq == seq)) {
@@ -178,7 +182,7 @@
   key &= ~KEY_VALID_FLAG;
   uintptr_t seq = atomic_load_explicit(&key_map[key].seq, memory_order_relaxed);
   if (__predict_true(SeqOfKeyInUse(seq))) {
-    pthread_key_data_t* data = &(__get_thread()->key_data[key]);
+    pthread_key_data_t* data = &get_thread_key_data()[key];
     data->seq = seq;
     data->data = const_cast<void*>(ptr);
     return 0;
diff --git a/libc/bionic/pthread_kill.cpp b/libc/bionic/pthread_kill.cpp
index 1531574..8b38f4c 100644
--- a/libc/bionic/pthread_kill.cpp
+++ b/libc/bionic/pthread_kill.cpp
@@ -35,7 +35,7 @@
 int pthread_kill(pthread_t t, int sig) {
   ErrnoRestorer errno_restorer;
 
-  pid_t tid = pthread_gettid_np(t);
+  pid_t tid = __pthread_internal_gettid(t, "pthread_kill");
 
   // tid gets reset to 0 on thread exit by CLONE_CHILD_CLEARTID.
   if (tid == 0 || tid == -1) return ESRCH;
diff --git a/libc/bionic/pthread_mutex.cpp b/libc/bionic/pthread_mutex.cpp
index d9ddf10..37031ad 100644
--- a/libc/bionic/pthread_mutex.cpp
+++ b/libc/bionic/pthread_mutex.cpp
@@ -199,6 +199,8 @@
                                                                    memory_order_relaxed))) {
             return 0;
         }
+    } else {
+        old_owner = atomic_load_explicit(&mutex.owner_tid, memory_order_relaxed);
     }
 
     if (tid != (old_owner & FUTEX_TID_MASK)) {
@@ -644,6 +646,15 @@
         // we call wake, the thread we eventually wake will find an unlocked mutex
         // and will execute. Either way we have correct behavior and nobody is
         // orphaned on the wait queue.
+        //
+        // The pthread_mutex_internal_t object may have been deallocated between the
+        // atomic exchange and the wake call. In that case, this wake call could
+        // target unmapped memory or memory used by an otherwise unrelated futex
+        // operation. Even if the kernel avoids spurious futex wakeups from its
+        // point of view, this wake call could trigger a spurious wakeup in any
+        // futex accessible from this process. References:
+        //  - https://lkml.org/lkml/2014/11/27/472
+        //  - http://austingroupbugs.net/view.php?id=811#c2267
         __futex_wake_ex(&mutex->state, shared, 1);
     }
 }
diff --git a/libc/bionic/pthread_setname_np.cpp b/libc/bionic/pthread_setname_np.cpp
index f582d53..f673983 100644
--- a/libc/bionic/pthread_setname_np.cpp
+++ b/libc/bionic/pthread_setname_np.cpp
@@ -42,9 +42,10 @@
 // This value is not exported by kernel headers.
 #define MAX_TASK_COMM_LEN 16
 
-static int __open_task_comm_fd(pthread_t t, int flags) {
+static int __open_task_comm_fd(pthread_t t, int flags, const char* caller) {
   char comm_name[64];
-  snprintf(comm_name, sizeof(comm_name), "/proc/self/task/%d/comm", pthread_gettid_np(t));
+  snprintf(comm_name, sizeof(comm_name), "/proc/self/task/%d/comm",
+           __pthread_internal_gettid(t, caller));
   return open(comm_name, O_CLOEXEC | flags);
 }
 
@@ -59,7 +60,7 @@
   }
 
   // We have to get another thread's name.
-  int fd = __open_task_comm_fd(t, O_RDONLY);
+  int fd = __open_task_comm_fd(t, O_RDONLY, "pthread_getname_np");
   if (fd == -1) return errno;
 
   ssize_t n = TEMP_FAILURE_RETRY(read(fd, buf, buf_size));
@@ -91,7 +92,7 @@
   }
 
   // We have to set another thread's name.
-  int fd = __open_task_comm_fd(t, O_WRONLY);
+  int fd = __open_task_comm_fd(t, O_WRONLY, "pthread_setname_np");
   if (fd == -1) return errno;
 
   ssize_t n = TEMP_FAILURE_RETRY(write(fd, thread_name, thread_name_len));
diff --git a/libc/bionic/pthread_setschedparam.cpp b/libc/bionic/pthread_setschedparam.cpp
index 10826d1..8a02728 100644
--- a/libc/bionic/pthread_setschedparam.cpp
+++ b/libc/bionic/pthread_setschedparam.cpp
@@ -31,11 +31,12 @@
 #include <sched.h>
 
 #include "private/ErrnoRestorer.h"
+#include "pthread_internal.h"
 
 int pthread_setschedparam(pthread_t t, int policy, const sched_param* param) {
   ErrnoRestorer errno_restorer;
 
-  pid_t tid = pthread_gettid_np(t);
+  pid_t tid = __pthread_internal_gettid(t, "pthread_setschedparam");
   if (tid == -1) return ESRCH;
 
   return (sched_setscheduler(tid, policy, param) == -1) ? errno : 0;
@@ -44,7 +45,7 @@
 int pthread_setschedprio(pthread_t t, int priority) {
   ErrnoRestorer errno_restorer;
 
-  pid_t tid = pthread_gettid_np(t);
+  pid_t tid = __pthread_internal_gettid(t, "pthread_setschedprio");
   if (tid == -1) return ESRCH;
 
   sched_param param = { .sched_priority = priority };
diff --git a/libc/bionic/pthread_sigqueue.cpp b/libc/bionic/pthread_sigqueue.cpp
index 34bda38..5d13ed5 100644
--- a/libc/bionic/pthread_sigqueue.cpp
+++ b/libc/bionic/pthread_sigqueue.cpp
@@ -38,7 +38,7 @@
 int pthread_sigqueue(pthread_t t, int sig, const union sigval value) {
   ErrnoRestorer errno_restorer;
 
-  pid_t tid = pthread_gettid_np(t);
+  pid_t tid = __pthread_internal_gettid(t, "pthread_sigqueue");
   if (tid == -1) return ESRCH;
 
   siginfo_t siginfo;
diff --git a/libc/bionic/scudo.h b/libc/bionic/scudo.h
new file mode 100644
index 0000000..d9933c4
--- /dev/null
+++ b/libc/bionic/scudo.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#pragma once
+
+#include <stdint.h>
+#include <stdio.h>
+#include <malloc.h>
+
+#include <private/bionic_config.h>
+
+__BEGIN_DECLS
+
+void* scudo_aligned_alloc(size_t, size_t);
+void* scudo_calloc(size_t, size_t);
+void scudo_free(void*);
+struct mallinfo scudo_mallinfo();
+void* scudo_malloc(size_t);
+int scudo_malloc_info(int, FILE*);
+size_t scudo_malloc_usable_size(const void*);
+int scudo_mallopt(int, int);
+void* scudo_memalign(size_t, size_t);
+void* scudo_realloc(void*, size_t);
+int scudo_posix_memalign(void**, size_t, size_t);
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+void* scudo_pvalloc(size_t);
+void* scudo_valloc(size_t);
+#endif
+
+int scudo_iterate(uintptr_t, size_t, void (*)(uintptr_t, size_t, void*), void*);
+void scudo_malloc_disable();
+void scudo_malloc_enable();
+
+__END_DECLS
diff --git a/libc/bionic/scudo/Android.bp b/libc/bionic/scudo/Android.bp
new file mode 100644
index 0000000..8b518bb
--- /dev/null
+++ b/libc/bionic/scudo/Android.bp
@@ -0,0 +1,60 @@
+//
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+cc_library_shared {
+    name: "libscudo_wrapper",
+    vendor_available: true,
+    srcs: ["scudo.cpp"],
+
+    stl: "none",
+    system_shared_libs: [],
+    host_supported: false,
+
+    header_libs: ["libc_headers"],
+    include_dirs: [
+        "bionic/libc",
+        "bionic/libc/bionic",
+    ],
+
+    whole_static_libs: ["libasync_safe"],
+
+    arch: {
+        arm: {
+            whole_static_libs: ["libclang_rt.scudo_minimal-arm-android.static"],
+        },
+        arm64: {
+            whole_static_libs: ["libclang_rt.scudo_minimal-aarch64-android.static"],
+        },
+        x86: {
+            whole_static_libs: ["libclang_rt.scudo_minimal-i686-android.static"],
+        },
+        x86_64: {
+            whole_static_libs: ["libclang_rt.scudo_minimal-x86_64-android.static"],
+        },
+    },
+
+    // Will be referencing other libc code that won't be defined here.
+    allow_undefined_symbols: true,
+
+    multilib: {
+        lib32: {
+            version_script: "exported32.map",
+        },
+        lib64: {
+            version_script: "exported64.map",
+        },
+    },
+}
diff --git a/libc/bionic/scudo/exported32.map b/libc/bionic/scudo/exported32.map
new file mode 100644
index 0000000..4b6791d
--- /dev/null
+++ b/libc/bionic/scudo/exported32.map
@@ -0,0 +1,16 @@
+LIBC_SCUDO {
+  global:
+    scudo_aligned_alloc;
+    scudo_calloc;
+    scudo_free;
+    scudo_mallinfo;
+    scudo_malloc;
+    scudo_malloc_usable_size;
+    scudo_memalign;
+    scudo_posix_memalign;
+    scudo_pvalloc;
+    scudo_realloc;
+    scudo_valloc;
+  local:
+    *;
+};
diff --git a/libc/bionic/scudo/exported64.map b/libc/bionic/scudo/exported64.map
new file mode 100644
index 0000000..1346b4b
--- /dev/null
+++ b/libc/bionic/scudo/exported64.map
@@ -0,0 +1,14 @@
+LIBC_SCUDO {
+  global:
+    scudo_aligned_alloc;
+    scudo_calloc;
+    scudo_free;
+    scudo_mallinfo;
+    scudo_malloc;
+    scudo_malloc_usable_size;
+    scudo_memalign;
+    scudo_posix_memalign;
+    scudo_realloc;
+  local:
+    *;
+};
diff --git a/libc/bionic/scudo/scudo.cpp b/libc/bionic/scudo/scudo.cpp
new file mode 100644
index 0000000..fb09b92
--- /dev/null
+++ b/libc/bionic/scudo/scudo.cpp
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2019 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 <errno.h>
+#include <malloc.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+#include <sys/param.h>
+#include <sys/prctl.h>
+
+#include "private/bionic_macros.h"
+
+#include "scudo.h"
+
+// Disable Scudo's mismatch allocation check, as it is being triggered
+// by some third party code.
+extern "C" const char *__scudo_default_options() {
+  return "DeallocationTypeMismatch=false";
+}
+
+static inline bool AllocTooBig(size_t bytes) {
+#if defined(__LP64__)
+  if (__predict_false(bytes > 0x10000000000ULL)) {
+#else
+  if (__predict_false(bytes > 0x80000000ULL)) {
+#endif
+    return true;
+  }
+  return false;
+}
+
+void* scudo_aligned_alloc(size_t alignment, size_t size) {
+  if (alignment == 0 || !powerof2(alignment) || (size % alignment) != 0) {
+    errno = EINVAL;
+    return nullptr;
+  }
+  if (AllocTooBig(size)) {
+    errno = ENOMEM;
+    return nullptr;
+  }
+
+  return aligned_alloc(alignment, size);
+}
+
+void* scudo_calloc(size_t item_count, size_t item_size) {
+  size_t total;
+  if (__builtin_mul_overflow(item_count, item_size, &total) || AllocTooBig(total)) {
+    errno = ENOMEM;
+    return nullptr;
+  }
+  return calloc(item_count, item_size);
+}
+
+void scudo_free(void* ptr) {
+  free(ptr);
+}
+
+extern "C" size_t __sanitizer_get_current_allocated_bytes();
+extern "C" size_t __sanitizer_get_heap_size();
+
+struct mallinfo scudo_mallinfo() {
+  struct mallinfo info {};
+  info.uordblks = __sanitizer_get_current_allocated_bytes();
+  info.hblkhd = __sanitizer_get_heap_size();
+  info.usmblks = info.hblkhd;
+  return info;
+}
+
+void* scudo_malloc(size_t byte_count) {
+  if (AllocTooBig(byte_count)) {
+    errno = ENOMEM;
+    return nullptr;
+  }
+  return malloc(byte_count);
+}
+
+size_t scudo_malloc_usable_size(const void* ptr) {
+  return malloc_usable_size(ptr);
+}
+
+void* scudo_memalign(size_t alignment, size_t byte_count) {
+  if (AllocTooBig(byte_count)) {
+    errno = ENOMEM;
+    return nullptr;
+  }
+  if (alignment != 0) {
+    if (!powerof2(alignment)) {
+      alignment = BIONIC_ROUND_UP_POWER_OF_2(alignment);
+    }
+  } else {
+    alignment = 1;
+  }
+  return memalign(alignment, byte_count);
+}
+
+void* scudo_realloc(void* ptr, size_t byte_count) {
+  if (AllocTooBig(byte_count)) {
+    errno = ENOMEM;
+    return nullptr;
+  }
+  return realloc(ptr, byte_count);
+}
+
+int scudo_posix_memalign(void** memptr, size_t alignment, size_t size) {
+  if (alignment < sizeof(void*) || !powerof2(alignment)) {
+    return EINVAL;
+  }
+  if (AllocTooBig(size)) {
+    return ENOMEM;
+  }
+  return posix_memalign(memptr, alignment, size);
+}
+
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+extern "C" void* pvalloc(size_t);
+
+void* scudo_pvalloc(size_t size) {
+  if (AllocTooBig(size)) {
+    errno = ENOMEM;
+    return nullptr;
+  }
+  return pvalloc(size);
+}
+
+extern "C" void* valloc(size_t);
+
+void* scudo_valloc(size_t size) {
+  if (AllocTooBig(size)) {
+    errno = ENOMEM;
+    return nullptr;
+  }
+  return valloc(size);
+}
+#endif
+
+// Do not try and name the scudo maps by overriding __sanitizer::internal_mmap.
+// There is already a function called MmapNamed that names the maps.
+// Unfortunately, there is no easy way to override MmapNamed because
+// too much of the code is not compiled into functions available in the
+// library, and the code is complicated.
diff --git a/libc/bionic/scudo_wrapper.cpp b/libc/bionic/scudo_wrapper.cpp
new file mode 100644
index 0000000..e17f20b
--- /dev/null
+++ b/libc/bionic/scudo_wrapper.cpp
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2019 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 <errno.h>
+#include <stdio.h>
+
+#include "scudo.h"
+#include "private/bionic_globals.h"
+#include "private/WriteProtected.h"
+
+__LIBC_HIDDEN__ WriteProtected<libc_globals> __libc_globals;
+
+#if defined(__i386__)
+__LIBC_HIDDEN__ void* __libc_sysinfo = reinterpret_cast<void*>(__libc_int0x80);
+#endif
+
+int scudo_mallopt(int /*param*/, int /*value*/) {
+  return 0;
+}
+
+int scudo_malloc_info(int /*options*/, FILE* /*fp*/) {
+  errno = ENOTSUP;
+  return -1;
+}
+
+int scudo_iterate(uintptr_t, size_t, void (*)(uintptr_t, size_t, void*), void*) {
+  return 0;
+}
+
+void scudo_malloc_disable() {
+}
+
+void scudo_malloc_enable() {
+}
diff --git a/libc/bionic/sigaction.cpp b/libc/bionic/sigaction.cpp
index 42dcccd..96e6f3c 100644
--- a/libc/bionic/sigaction.cpp
+++ b/libc/bionic/sigaction.cpp
@@ -43,7 +43,8 @@
   if (bionic_new_action != nullptr) {
     kernel_new_action.sa_flags = bionic_new_action->sa_flags;
     kernel_new_action.sa_handler = bionic_new_action->sa_handler;
-    kernel_new_action.sa_mask = filter_reserved_signals(bionic_new_action->sa_mask, SIG_SETMASK);
+    // Don't filter signals here; if the caller asked for everything to be blocked, we should obey.
+    kernel_new_action.sa_mask = bionic_new_action->sa_mask;
 #if defined(SA_RESTORER)
     kernel_new_action.sa_restorer = bionic_new_action->sa_restorer;
 #if defined(__aarch64__)
@@ -95,6 +96,7 @@
 #if defined(SA_RESTORER)
     kernel_new.sa_restorer = bionic_new->sa_restorer;
 #endif
+    // Don't filter signals here; if the caller asked for everything to be blocked, we should obey.
     memcpy(&kernel_new.sa_mask, &bionic_new->sa_mask, sizeof(bionic_new->sa_mask));
   }
 
@@ -122,7 +124,8 @@
       kernel_new.sa_restorer = (kernel_new.sa_flags & SA_SIGINFO) ? &__restore_rt : &__restore;
     }
 #endif
-    kernel_new.sa_mask = filter_reserved_signals(kernel_new.sa_mask, SIG_SETMASK);
+    // Don't filter signals here; if the caller asked for everything to be blocked, we should obey.
+    kernel_new.sa_mask = kernel_new.sa_mask;
   }
 
   return __rt_sigaction(signal,
diff --git a/libc/bionic/strsignal.cpp b/libc/bionic/strsignal.cpp
index 5637431..05d3498 100644
--- a/libc/bionic/strsignal.cpp
+++ b/libc/bionic/strsignal.cpp
@@ -37,7 +37,7 @@
 };
 
 const char* const sys_signame[NSIG] = {
-#define __BIONIC_SIGDEF(signal_number, unused) [ signal_number ] = #signal_number + 3,
+#define __BIONIC_SIGDEF(signal_number, unused) [ signal_number ] = &(#signal_number)[3],
 #include "private/bionic_sigdefs.h"
 };
 
diff --git a/libc/bionic/system.cpp b/libc/bionic/system.cpp
index 7411ae5..950f05c 100644
--- a/libc/bionic/system.cpp
+++ b/libc/bionic/system.cpp
@@ -27,12 +27,12 @@
  */
 
 #include <errno.h>
-#include <paths.h>
 #include <stdlib.h>
 #include <spawn.h>
 #include <sys/wait.h>
 #include <unistd.h>
 
+#include "private/__bionic_get_shell_path.h"
 #include "private/ScopedSignalBlocker.h"
 #include "private/ScopedSignalHandler.h"
 
@@ -58,7 +58,7 @@
 
   const char* argv[] = { "sh", "-c", command, nullptr };
   pid_t child;
-  if ((errno = posix_spawn(&child, _PATH_BSHELL, nullptr, &attributes,
+  if ((errno = posix_spawn(&child, __bionic_get_shell_path(), nullptr, &attributes,
                            const_cast<char**>(argv), environ)) != 0) {
     return -1;
   }
diff --git a/libc/bionic/system_property_set.cpp b/libc/bionic/system_property_set.cpp
index bc3ba76..c508db1 100644
--- a/libc/bionic/system_property_set.cpp
+++ b/libc/bionic/system_property_set.cpp
@@ -42,6 +42,7 @@
 #include <unistd.h>
 
 #include <async_safe/log.h>
+#include <async_safe/CHECK.h>
 
 #include "private/bionic_defs.h"
 #include "private/bionic_macros.h"
diff --git a/libc/include/android/dlext.h b/libc/include/android/dlext.h
index e78be39..f0b731c 100644
--- a/libc/include/android/dlext.h
+++ b/libc/include/android/dlext.h
@@ -114,6 +114,29 @@
    */
   ANDROID_DLEXT_USE_NAMESPACE = 0x200,
 
+  /**
+   * Instructs dlopen to apply `ANDROID_DLEXT_RESERVED_ADDRESS`,
+   * `ANDROID_DLEXT_RESERVED_ADDRESS_HINT`, `ANDROID_DLEXT_WRITE_RELRO` and
+   * `ANDROID_DLEXT_USE_RELRO` to any libraries loaded as dependencies of the
+   * main library as well.
+   *
+   * This means that if the main library depends on one or more not-already-loaded libraries, they
+   * will be loaded consecutively into the region starting at `reserved_addr`, and `reserved_size`
+   * must be large enough to contain all of the libraries. The libraries will be loaded in the
+   * deterministic order constructed from the DT_NEEDED entries, rather than the more secure random
+   * order used by default.
+   *
+   * Each library's GNU RELRO sections will be written out to `relro_fd` in the same order they were
+   * loaded. This will mean that the resulting file is dependent on which of the libraries were
+   * already loaded, as only the newly loaded libraries will be included, not any already-loaded
+   * dependencies. The caller should ensure that the set of libraries newly loaded is consistent
+   * for this to be effective.
+   *
+   * This is mainly useful for the system WebView implementation.
+   */
+  ANDROID_DLEXT_RESERVED_ADDRESS_RECURSIVE = 0x400,
+
+
   /** Mask of valid bits. */
   ANDROID_DLEXT_VALID_FLAG_BITS       = ANDROID_DLEXT_RESERVED_ADDRESS |
                                         ANDROID_DLEXT_RESERVED_ADDRESS_HINT |
@@ -122,7 +145,8 @@
                                         ANDROID_DLEXT_USE_LIBRARY_FD |
                                         ANDROID_DLEXT_USE_LIBRARY_FD_OFFSET |
                                         ANDROID_DLEXT_FORCE_LOAD |
-                                        ANDROID_DLEXT_USE_NAMESPACE,
+                                        ANDROID_DLEXT_USE_NAMESPACE |
+                                        ANDROID_DLEXT_RESERVED_ADDRESS_RECURSIVE,
 };
 
 struct android_namespace_t;
diff --git a/libc/include/android/fdsan.h b/libc/include/android/fdsan.h
index ea7689c..1169ed0 100644
--- a/libc/include/android/fdsan.h
+++ b/libc/include/android/fdsan.h
@@ -128,40 +128,40 @@
 /*
  * Create an owner tag with the specified type and least significant 56 bits of tag.
  */
-uint64_t android_fdsan_create_owner_tag(enum android_fdsan_owner_type type, uint64_t tag) __INTRODUCED_IN_FUTURE __attribute__((__weak__));
+uint64_t android_fdsan_create_owner_tag(enum android_fdsan_owner_type type, uint64_t tag) __INTRODUCED_IN(29) __attribute__((__weak__));
 
 /*
  * Exchange a file descriptor's tag.
  *
  * Logs and aborts if the fd's tag does not match expected_tag.
  */
-void android_fdsan_exchange_owner_tag(int fd, uint64_t expected_tag, uint64_t new_tag) __INTRODUCED_IN_FUTURE __attribute__((__weak__));
+void android_fdsan_exchange_owner_tag(int fd, uint64_t expected_tag, uint64_t new_tag) __INTRODUCED_IN(29) __attribute__((__weak__));
 
 /*
  * Close a file descriptor with a tag, and resets the tag to 0.
  *
  * Logs and aborts if the tag is incorrect.
  */
-int android_fdsan_close_with_tag(int fd, uint64_t tag) __INTRODUCED_IN_FUTURE __attribute__((__weak__));
+int android_fdsan_close_with_tag(int fd, uint64_t tag) __INTRODUCED_IN(29) __attribute__((__weak__));
 
 /*
  * Get a file descriptor's current owner tag.
  *
  * Returns 0 for untagged and invalid file descriptors.
  */
-uint64_t android_fdsan_get_owner_tag(int fd);
+uint64_t android_fdsan_get_owner_tag(int fd) __INTRODUCED_IN(29);
 
 /*
  * Get an owner tag's string representation.
  *
  * The return value points to memory with static lifetime, do not attempt to modify it.
  */
-const char* android_fdsan_get_tag_type(uint64_t tag);
+const char* android_fdsan_get_tag_type(uint64_t tag) __INTRODUCED_IN(29);
 
 /*
  * Get an owner tag's value, with the type masked off.
  */
-uint64_t android_fdsan_get_tag_value(uint64_t tag);
+uint64_t android_fdsan_get_tag_value(uint64_t tag) __INTRODUCED_IN(29);
 
 enum android_fdsan_error_level {
   // No errors.
@@ -180,7 +180,7 @@
 /*
  * Get the error level.
  */
-enum android_fdsan_error_level android_fdsan_get_error_level() __INTRODUCED_IN_FUTURE __attribute__((__weak__));
+enum android_fdsan_error_level android_fdsan_get_error_level() __INTRODUCED_IN(29) __attribute__((__weak__));
 
 /*
  * Set the error level and return the previous state.
@@ -195,6 +195,6 @@
  * value, and so should probably only be called in single-threaded contexts
  * (e.g. postfork).
  */
-enum android_fdsan_error_level android_fdsan_set_error_level(enum android_fdsan_error_level new_level) __INTRODUCED_IN_FUTURE __attribute__((__weak__));
+enum android_fdsan_error_level android_fdsan_set_error_level(enum android_fdsan_error_level new_level) __INTRODUCED_IN(29) __attribute__((__weak__));
 
 __END_DECLS
diff --git a/libc/include/android/legacy_signal_inlines.h b/libc/include/android/legacy_signal_inlines.h
index 8219759..5ca9813 100644
--- a/libc/include/android/legacy_signal_inlines.h
+++ b/libc/include/android/legacy_signal_inlines.h
@@ -52,7 +52,7 @@
 
 static __inline int __ndk_legacy___libc_current_sigrtmin() {
   if (__libc_current_sigrtmin) return __libc_current_sigrtmin();
-  return __SIGRTMIN + 5; /* Should match __libc_current_sigrtmin. */
+  return __SIGRTMIN + 6; /* Should match __libc_current_sigrtmin. */
 }
 
 #undef SIGRTMAX
diff --git a/libc/include/android/versioning.h b/libc/include/android/versioning.h
index 01fa348..d60957f 100644
--- a/libc/include/android/versioning.h
+++ b/libc/include/android/versioning.h
@@ -17,7 +17,6 @@
 #pragma once
 
 #define __INTRODUCED_IN(api_level) __attribute__((annotate("introduced_in=" #api_level)))
-#define __INTRODUCED_IN_FUTURE __attribute__((annotate("introduced_in_future")))
 #define __DEPRECATED_IN(api_level) __attribute__((annotate("deprecated_in=" #api_level)))
 #define __REMOVED_IN(api_level) __attribute__((annotate("obsoleted_in=" #api_level)))
 #define __INTRODUCED_IN_32(api_level) __attribute__((annotate("introduced_in_32=" #api_level)))
diff --git a/libc/include/bits/get_device_api_level_inlines.h b/libc/include/bits/get_device_api_level_inlines.h
index 9c6e243..d14eb2c 100644
--- a/libc/include/bits/get_device_api_level_inlines.h
+++ b/libc/include/bits/get_device_api_level_inlines.h
@@ -28,11 +28,9 @@
 
 #pragma once
 
-#include <sys/cdefs.h>
+#if defined(__BIONIC_GET_DEVICE_API_LEVEL_INLINE)
 
-#if !defined(__BIONIC_GET_DEVICE_API_LEVEL_INLINE)
-#define __BIONIC_GET_DEVICE_API_LEVEL_INLINE static inline /* for versioner */
-#endif
+#include <sys/cdefs.h>
 
 __BEGIN_DECLS
 
@@ -48,3 +46,5 @@
 }
 
 __END_DECLS
+
+#endif  // __BIONIC_GET_DEVICE_API_LEVEL_INLINE
diff --git a/libc/include/bits/glibc-syscalls.h b/libc/include/bits/glibc-syscalls.h
index 52eff56..e831bdc 100644
--- a/libc/include/bits/glibc-syscalls.h
+++ b/libc/include/bits/glibc-syscalls.h
@@ -1,6 +1,5 @@
-/* Generated by gensyscalls.py. Do not edit. */
-#ifndef _BIONIC_BITS_GLIBC_SYSCALLS_H_
-#define _BIONIC_BITS_GLIBC_SYSCALLS_H_
+/* Generated file. Do not edit. */
+#pragma once
 #if defined(__NR__llseek)
   #define SYS__llseek __NR__llseek
 #endif
@@ -61,12 +60,6 @@
 #if defined(__NR_brk)
   #define SYS_brk __NR_brk
 #endif
-#if defined(__NR_cachectl)
-  #define SYS_cachectl __NR_cachectl
-#endif
-#if defined(__NR_cacheflush)
-  #define SYS_cacheflush __NR_cacheflush
-#endif
 #if defined(__NR_capget)
   #define SYS_capget __NR_capget
 #endif
@@ -1123,9 +1116,6 @@
 #if defined(__NR_syslog)
   #define SYS_syslog __NR_syslog
 #endif
-#if defined(__NR_sysmips)
-  #define SYS_sysmips __NR_sysmips
-#endif
 #if defined(__NR_tee)
   #define SYS_tee __NR_tee
 #endif
@@ -1150,9 +1140,6 @@
 #if defined(__NR_timer_settime)
   #define SYS_timer_settime __NR_timer_settime
 #endif
-#if defined(__NR_timerfd)
-  #define SYS_timerfd __NR_timerfd
-#endif
 #if defined(__NR_timerfd_create)
   #define SYS_timerfd_create __NR_timerfd_create
 #endif
@@ -1255,4 +1242,3 @@
 #if defined(__NR_writev)
   #define SYS_writev __NR_writev
 #endif
-#endif /* _BIONIC_BITS_GLIBC_SYSCALLS_H_ */
diff --git a/libc/include/paths.h b/libc/include/paths.h
index b5b8610..58540d9 100644
--- a/libc/include/paths.h
+++ b/libc/include/paths.h
@@ -47,7 +47,7 @@
 #define _PATH_CONSOLE "/dev/console"
 
 /** Default shell search path. */
-#define _PATH_DEFPATH "/sbin:/system/sbin:/apex/com.android.runtime/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin"
+#define _PATH_DEFPATH "/product/bin:/apex/com.android.runtime/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin"
 
 /** Path to the directory containing device files. */
 #define _PATH_DEV "/dev/"
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index 3089adc..724e5b7 100644
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
@@ -137,7 +137,21 @@
                                         const struct timespec* __timeout) __INTRODUCED_IN_64(28);
 int pthread_cond_wait(pthread_cond_t* __cond, pthread_mutex_t* __mutex);
 
+#if defined(__clang__)
+/*
+ * Disable -Wbuiltin-requires-header because clang confuses this declaration with the one defined in
+ * "llvm/tools/clang/include/clang/Basic/Builtins.def", which did not define any formal arguments.
+ * It seems to be an upstream bug and the fix (https://reviews.llvm.org/D58531) is still under
+ * review. Thus, let's disable the warning for this function declaration.
+ */
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wbuiltin-requires-header"
+#endif
 int pthread_create(pthread_t* __pthread_ptr, pthread_attr_t const* __attr, void* (*__start_routine)(void*), void*);
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
 int pthread_detach(pthread_t __pthread);
 void pthread_exit(void* __return_value) __noreturn;
 
diff --git a/libc/include/resolv.h b/libc/include/resolv.h
index 1518475..6318d00 100644
--- a/libc/include/resolv.h
+++ b/libc/include/resolv.h
@@ -60,7 +60,7 @@
 int res_search(const char* __name, int __class, int __type, u_char* __answer, int __answer_size);
 
 #define res_randomid __res_randomid
-u_int __res_randomid(void) __INTRODUCED_IN_FUTURE;
+u_int __res_randomid(void) __INTRODUCED_IN(29);
 
 __END_DECLS
 
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index 96a77a7..d5b8619 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -154,7 +154,7 @@
  *
  * Returns the number of samples written to `__averages` (at most 3), and returns -1 on failure.
  */
-int getloadavg(double __averages[], int __n) __INTRODUCED_IN_FUTURE;
+int getloadavg(double __averages[], int __n) __INTRODUCED_IN(29);
 
 /* BSD compatibility. */
 const char* getprogname(void) __INTRODUCED_IN(21);
diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index e9d0e4b..a919a79 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -280,7 +280,7 @@
  */
 #  define __BIONIC_FORTIFY_VARIADIC static __inline__
 /* Error functions don't have bodies, so they can just be static. */
-#  define __BIONIC_ERROR_FUNCTION_VISIBILITY static
+#  define __BIONIC_ERROR_FUNCTION_VISIBILITY static __attribute__((unused))
 #else
 /* Further increase sharing for some inline functions */
 #  define __pass_object_size_n(n)
diff --git a/libc/include/sys/param.h b/libc/include/sys/param.h
index 5cde4b7..79ae067 100644
--- a/libc/include/sys/param.h
+++ b/libc/include/sys/param.h
@@ -51,8 +51,19 @@
 #endif
 #define roundup(x, y)   ((((x)+((y)-1))/(y))*(y))
 
-/** Returns true if the argument is a power of two. */
-#define powerof2(x) ((((x)-1)&(x))==0)
+/**
+ * Returns true if the binary representation of the argument is all zeros
+ * or has exactly one bit set. Contrary to the macro name, this macro
+ * DOES NOT determine if the provided value is a power of 2. In particular,
+ * this function falsely returns true for powerof2(0) and some negative
+ * numbers.
+ */
+#define powerof2(x)                                               \
+  ({                                                              \
+    __typeof__(x) _x = (x);                                       \
+    __typeof__(x) _x2;                                            \
+    __builtin_add_overflow(_x, -1, &_x2) ? 1 : ((_x2 & _x) == 0); \
+  })
 
 /** Returns the lesser of its two arguments. */
 #define MIN(a,b) (((a)<(b))?(a):(b))
diff --git a/libc/include/time.h b/libc/include/time.h
index ea41fda..48c5efc 100644
--- a/libc/include/time.h
+++ b/libc/include/time.h
@@ -109,7 +109,7 @@
 time_t timegm(struct tm* __tm) __INTRODUCED_IN(12);
 
 #define TIME_UTC 1
-int timespec_get(struct timespec* __ts, int __base) __INTRODUCED_IN_FUTURE;
+int timespec_get(struct timespec* __ts, int __base) __INTRODUCED_IN(29);
 
 __END_DECLS
 
diff --git a/libc/kernel/README.TXT b/libc/kernel/README.TXT
deleted file mode 100644
index 313dc0d..0000000
--- a/libc/kernel/README.TXT
+++ /dev/null
@@ -1,87 +0,0 @@
-Bionic Kernel Header Files
-==========================
-
-Bionic comes with a processed set of all of the uapi Linux kernel headers that
-can safely be included by userland applications and libraries.
-
-These clean headers are automatically generated by several scripts located
-in the 'bionic/kernel/tools' directory. The tools process the original
-unmodified kernel headers in order to get rid of many annoying
-declarations and constructs that usually result in compilation failure.
-
-The 'clean headers' only contain type and macro definitions, with the
-exception of a couple static inline functions used for performance
-reason (e.g. optimized CPU-specific byte-swapping routines).
-
-They can be included from C++, or when compiling code in strict ANSI mode.
-They can be also included before or after any Bionic C library header.
-
-Description of the directories involved in generating the parsed kernel headers:
-
-  * 'external/kernel-headers/original/'
-    Contains the uapi kernel headers found in the android kernel. Note this
-    also includes the header files that are generated by building the kernel
-    sources.
-
-  * 'bionic/libc/kernel/uapi'
-    Contains the cleaned kernel headers and mirrors the directory structure
-    in 'external/kernel-headers/original/uapi/'.
-
-  * 'bionic/libc/kernel/tools'
-    Contains various Python and shell scripts used to get and re-generate
-    the headers.
-
-The tools to get/parse the headers:
-
-  * tools/generate_uapi_headers.sh
-    Checks out the android kernel and generates all uapi header files.
-    copies all the changed files into external/kernel-headers.
-
-  * tools/clean_header.py
-    Prints the clean version of a given kernel header. With the -u option,
-    this will also update the corresponding clean header file if its
-    content has changed. You can also process more than one file with -u.
-
-  * tools/update_all.py
-    Automatically update all clean headers from the content of
-    'external/kernel-headers/original'.
-
-How To Update The Headers
-=========================
-
-IMPORTANT IMPORTANT:
-
-WHEN UPDATING THE HEADERS, ALWAYS CHECK THAT THE NEW CLEAN HEADERS DO
-NOT BREAK THE KERNEL <-> USER ABI, FOR EXAMPLE BY CHANGING THE SIZE
-OF A GIVEN TYPE. THIS TASK CANNOT BE EASILY AUTOMATED AT THE MOMENT.
-
-Download the Linux kernel source code:
-
-  > mkdir kernel_src
-  > cd kernel_src
-  kernel_src> git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
-
-Then checkout the stable tag for the new kernel headers to import:
-
-  kernel_src> cd linux-stable
-  kernel_src/linux-stable> git checkout tags/vXXX
-
-Before running the command to import the headers, make sure that you have
-done a lunch TARGET. The script uses a variable set by the lunch command
-to determine which directory to use as the destination directory.
-
-After running lunch, run this command to import the headers into the android
-source tree:
-
-  bionic/libc/kernel/tools/generate_uapi_headers.sh --use-kernel-dir kernel_src
-
-Next, run this command to copy the parsed files to bionic/libc/kernel/uapi:
-
-  bionic/libc/kernel/tools/update_all.py
-
-Finally, run this command to regenerate the syscalls list:
-
-  bionic/libc/tools/gensyscalls.py
-
-After this, you will need to build/test the tree to make sure that these
-changes do not introduce any errors.
diff --git a/libc/kernel/README.md b/libc/kernel/README.md
new file mode 100644
index 0000000..9036b9f
--- /dev/null
+++ b/libc/kernel/README.md
@@ -0,0 +1,85 @@
+# Bionic Kernel Header Files
+
+Bionic comes with a processed set of all of the uapi Linux kernel headers that
+can safely be included by userland applications and libraries.
+
+These clean headers are automatically generated by several scripts located
+in the `tools/` directory. The tools process the original
+unmodified kernel headers in order to get rid of many annoying
+declarations and constructs that usually result in compilation failure.
+
+The 'clean headers' only contain type and macro definitions, with the
+exception of a couple static inline functions used for performance
+reason (e.g. optimized CPU-specific byte-swapping routines).
+
+They can be included from C++, or when compiling code in strict ANSI mode.
+They can be also included before or after any Bionic C library header.
+
+Description of the directories involved in generating the parsed kernel headers:
+
+  * `external/kernel-headers/original/`
+    Contains the uapi kernel headers found in the android kernel. Note this
+    also includes the header files that are generated by building the kernel
+    sources.
+
+  * `bionic/libc/kernel/uapi/`
+    Contains the cleaned kernel headers and mirrors the directory structure
+    in `external/kernel-headers/original/uapi/`.
+
+  * `bionic/libc/kernel/tools/`
+    Contains various Python and shell scripts used to get and re-generate
+    the headers.
+
+The tools to get/parse the headers:
+
+  * `tools/generate_uapi_headers.sh`
+    Checks out the android kernel and generates all uapi header files.
+    copies all the changed files into external/kernel-headers.
+
+  * `tools/clean_header.py`
+    Prints the clean version of a given kernel header. With the -u option,
+    this will also update the corresponding clean header file if its
+    content has changed. You can also process more than one file with -u.
+
+  * `tools/update_all.py`
+    Automatically update all clean headers from the content of
+    `external/kernel-headers/original/`.
+
+## How To Update The Headers
+
+IMPORTANT IMPORTANT:
+
+WHEN UPDATING THE HEADERS, ALWAYS CHECK THAT THE NEW CLEAN HEADERS DO
+NOT BREAK THE KERNEL <-> USER ABI, FOR EXAMPLE BY CHANGING THE SIZE
+OF A GIVEN TYPE. THIS TASK CANNOT BE EASILY AUTOMATED AT THE MOMENT.
+
+Download the Linux kernel source code:
+```
+  > mkdir kernel_src
+  > cd kernel_src
+  kernel_src> git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
+```
+
+Then checkout the stable tag for the new kernel headers to import:
+```
+  kernel_src> cd linux-stable
+  kernel_src/linux-stable> git checkout tags/vXXX
+```
+
+Before running the command to import the headers, make sure that you have
+done a lunch TARGET. The script uses a variable set by the lunch command
+to determine which directory to use as the destination directory.
+
+After running lunch, run this command to import the headers into the android
+source tree:
+```
+  bionic/libc/kernel/tools/generate_uapi_headers.sh --use-kernel-dir kernel_src
+```
+
+Next, run this command to copy the parsed files to bionic/libc/kernel/uapi:
+```
+  bionic/libc/kernel/tools/update_all.py
+```
+
+After this, you will need to build/test the tree to make sure that these
+changes do not introduce any errors.
diff --git a/libc/kernel/android/README.TXT b/libc/kernel/android/README.TXT
deleted file mode 100644
index bc2efde..0000000
--- a/libc/kernel/android/README.TXT
+++ /dev/null
@@ -1,17 +0,0 @@
-The files under the uapi directory are android kernel uapi header files that
-exist in android kernels, but have not been upstreamed into the regular
-kernel.
-
-None of these files will get updated automatically, and are frozen at their
-current value.
-
-The files under the scsi directory are frozen copies of kernel scsi headers.
-Linux's scsi headers are a mix of userspace-facing and kernel-facing
-declarations that can't be directly used by userspace. The glibc
-maintainers manually copy-and-pasted these definitions into their own
-scsi headers and haven't substantially updated them in 15 years. The
-musl libc project has a similar set of definitions in its scsi headers.
-
-These files are actually maintained in external/kernel-headers/modified/scsi.
-Any modification should first be made there then copied into the scsi
-directory.
diff --git a/libc/kernel/android/README.md b/libc/kernel/android/README.md
new file mode 100644
index 0000000..88062c0
--- /dev/null
+++ b/libc/kernel/android/README.md
@@ -0,0 +1,17 @@
+The files under the uapi directory are android kernel uapi header files that
+exist in android kernels, but have not been upstreamed into the regular
+kernel.
+
+None of these files are updated automatically, and are frozen at their
+current value.
+
+The files under the scsi directory are frozen copies of kernel scsi headers.
+Linux's scsi headers are a mix of userspace-facing and kernel-facing
+declarations that can't be directly used by userspace. The glibc
+maintainers manually copy-and-pasted these definitions into their own
+scsi headers and haven't substantially updated them in 15 years. The
+musl libc project has a similar set of definitions in its scsi headers.
+
+These files are actually maintained in `external/kernel-headers/modified/scsi/`.
+Any modification should first be made there then copied into the scsi
+directory.
diff --git a/libc/kernel/tools/clean_header.py b/libc/kernel/tools/clean_header.py
index 7c802c2..92a2139 100755
--- a/libc/kernel/tools/clean_header.py
+++ b/libc/kernel/tools/clean_header.py
@@ -86,11 +86,11 @@
     # Check the header path
     if not os.path.exists(src_file):
         print_error(no_update, "'%s' does not exist\n" % src_file)
-        return None, None
+        return None
 
     if not os.path.isfile(src_file):
         print_error(no_update, "'%s' is not a file\n" % src_file)
-        return None, None
+        return None
 
     # Extract the architecture if found.
     arch = None
@@ -152,8 +152,8 @@
         usage()
 
     no_update = True
-    dst_dir = get_kernel_dir()
-    src_dir = get_kernel_headers_original_dir()
+    dst_dir = None
+    src_dir = None
     for opt, arg in optlist:
         if opt == '-u':
             no_update = False
@@ -163,6 +163,15 @@
             src_dir = arg
         elif opt == '-d':
             dst_dir = arg
+    # get_kernel_dir() and get_kernel_headers_original_dir() require the current
+    # working directory to be a direct or indirect subdirectory of
+    # ANDROID_BUILD_TOP.  Otherwise, these functions print an error message and
+    # exit.  Let's allow the user to run this program from an unrelated
+    # directory, if they specify src_dir and dst_dir on the command line.
+    if dst_dir is None:
+      dst_dir = get_kernel_dir()
+    if src_dir is None:
+      src_dir = get_kernel_headers_original_dir()
 
     if len(args) == 0:
         usage()
@@ -172,7 +181,12 @@
             dst_file = os.path.join(dst_dir, path)
             src_file = os.path.join(src_dir, path)
             new_data = cleanupFile(dst_file, src_file, path)
-            print new_data
+            # Use sys.stdout.write instead of a simple print statement to avoid
+            # sending an extra new line character to stdout.  Running this
+            # program in non-update mode and redirecting stdout to a file should
+            # yield the same result as using update mode, where new_data is
+            # written directly to a file.
+            sys.stdout.write(new_data)
 
         sys.exit(0)
 
@@ -187,8 +201,8 @@
         if not new_data:
             continue
 
-        b.readFile(path)
-        r = b.editFile(path, new_data)
+        b.readFile(dst_file)
+        r = b.editFile(dst_file, new_data)
         if r == 0:
             r = "unchanged"
         elif r == 1:
diff --git a/libc/kernel/tools/cpp.py b/libc/kernel/tools/cpp.py
index 336a9c8..1ada59e 100755
--- a/libc/kernel/tools/cpp.py
+++ b/libc/kernel/tools/cpp.py
@@ -1037,11 +1037,14 @@
             if t.id == '{':
                 buf += ' {'
                 result.append(strip_space(buf))
-                indent += 2
+                # Do not indent if this is extern "C" {
+                if i < 2 or tokens[i-2].id != 'extern' or tokens[i-1].id != '"C"':
+                    indent += 2
                 buf = ''
                 newline = True
             elif t.id == '}':
-                indent -= 2
+                if indent >= 2:
+                    indent -= 2
                 if not newline:
                     result.append(strip_space(buf))
                 # Look ahead to determine if it's the end of line.
@@ -1221,133 +1224,140 @@
         function declarations are removed. We only accept typedefs and
         enum/structs/union declarations.
 
+        In addition, remove any macros expanding in the headers. Usually,
+        these macros are static inline functions, which is why they are
+        removed.
+
         However, we keep the definitions corresponding to the set of known
         static inline functions in the set 'keep', which is useful
         for optimized byteorder swap functions and stuff like that.
         """
 
-        # NOTE: It's also removing function-like macros, such as __SYSCALL(...)
-        # in uapi/asm-generic/unistd.h, or KEY_FIELD(...) in linux/bcache.h.
-        # It could be problematic when we have function-like macros but without
-        # '}' following them. It will skip all the tokens/blocks until seeing a
-        # '}' as the function end. Fortunately we don't have such cases in the
-        # current kernel headers.
+        # state = NORMAL => normal (i.e. LN + spaces)
+        # state = OTHER_DECL => typedef/struct encountered, ends with ";"
+        # state = VAR_DECL => var declaration encountered, ends with ";"
+        # state = FUNC_DECL => func declaration encountered, ends with "}"
+        NORMAL = 0
+        OTHER_DECL = 1
+        VAR_DECL = 2
+        FUNC_DECL = 3
 
-        # state = 0 => normal (i.e. LN + spaces)
-        # state = 1 => typedef/struct encountered, ends with ";"
-        # state = 2 => var declaration encountered, ends with ";"
-        # state = 3 => func declaration encountered, ends with "}"
-
-        state = 0
+        state = NORMAL
         depth = 0
-        blocks2 = []
-        skipTokens = False
-        for b in self.blocks:
-            if b.isDirective():
-                blocks2.append(b)
-            else:
-                n = len(b.tokens)
-                i = 0
-                if skipTokens:
-                    first = n
-                else:
-                    first = 0
-                while i < n:
-                    tok = b.tokens[i]
-                    tokid = tok.id
-                    # If we are not looking for the start of a new
-                    # type/var/func, then skip over tokens until
-                    # we find our terminator, managing the depth of
-                    # accolades as we go.
-                    if state > 0:
-                        terminator = False
-                        if tokid == '{':
-                            depth += 1
-                        elif tokid == '}':
-                            if depth > 0:
-                                depth -= 1
-                            if (depth == 0) and (state == 3):
-                                terminator = True
-                        elif tokid == ';' and depth == 0:
-                            terminator = True
-
-                        if terminator:
-                            # we found the terminator
-                            state = 0
-                            if skipTokens:
-                                skipTokens = False
-                                first = i + 1
-
-                        i += 1
-                        continue
-
-                    # Is it a new type definition, then start recording it
-                    if tok.id in ['struct', 'typedef', 'enum', 'union',
-                                  '__extension__']:
-                        state = 1
-                        i += 1
-                        continue
-
-                    # Is it a variable or function definition. If so, first
-                    # try to determine which type it is, and also extract
-                    # its name.
-                    #
-                    # We're going to parse the next tokens of the same block
-                    # until we find a semicolon or a left parenthesis.
-                    #
-                    # The semicolon corresponds to a variable definition,
-                    # the left-parenthesis to a function definition.
-                    #
-                    # We also assume that the var/func name is the last
-                    # identifier before the terminator.
-                    #
-                    j = i + 1
-                    ident = ""
-                    while j < n:
-                        tokid = b.tokens[j].id
-                        if tokid == '(':  # a function declaration
-                            state = 3
-                            break
-                        elif tokid == ';':  # a variable declaration
-                            state = 2
-                            break
-                        if b.tokens[j].kind == TokenKind.IDENTIFIER:
-                            ident = b.tokens[j].id
-                        j += 1
-
-                    if j >= n:
-                        # This can only happen when the declaration
-                        # does not end on the current block (e.g. with
-                        # a directive mixed inside it.
-                        #
-                        # We will treat it as malformed because
-                        # it's very hard to recover from this case
-                        # without making our parser much more
-                        # complex.
-                        #
-                        logging.debug("### skip unterminated static '%s'",
-                                      ident)
-                        break
-
-                    if ident in keep:
-                        logging.debug("### keep var/func '%s': %s", ident,
-                                      repr(b.tokens[i:j]))
+        blocksToKeep = []
+        blocksInProgress = []
+        blocksOfDirectives = []
+        ident = ""
+        state_token = ""
+        macros = set()
+        for block in self.blocks:
+            if block.isDirective():
+                # Record all macros.
+                if block.directive == 'define':
+                    macro_name = block.define_id
+                    paren_index = macro_name.find('(')
+                    if paren_index == -1:
+                        macros.add(macro_name)
                     else:
-                        # We're going to skip the tokens for this declaration
-                        logging.debug("### skip var/func '%s': %s", ident,
-                                      repr(b.tokens[i:j]))
-                        if i > first:
-                            blocks2.append(Block(b.tokens[first:i]))
-                        skipTokens = True
-                        first = n
+                        macros.add(macro_name[0:paren_index])
+                blocksInProgress.append(block)
+                # If this is in a function/variable declaration, we might need
+                # to emit the directives alone, so save them separately.
+                blocksOfDirectives.append(block)
+                continue
 
-                    i += 1
+            numTokens = len(block.tokens)
+            lastTerminatorIndex = 0
+            i = 0
+            while i < numTokens:
+                token_id = block.tokens[i].id
+                terminator = False
+                if token_id == '{':
+                    depth += 1
+                    if (i >= 2 and block.tokens[i-2].id == 'extern' and
+                        block.tokens[i-1].id == '"C"'):
+                        # For an extern "C" { pretend as though this is depth 0.
+                        depth -= 1
+                elif token_id == '}':
+                    if depth > 0:
+                        depth -= 1
+                    if depth == 0:
+                        if state == OTHER_DECL:
+                            # Loop through until we hit the ';'
+                            i += 1
+                            while i < numTokens:
+                                if block.tokens[i].id == ';':
+                                    token_id = ';'
+                                    break
+                                i += 1
+                            # If we didn't hit the ';', just consider this the
+                            # terminator any way.
+                        terminator = True
+                elif depth == 0:
+                    if token_id == ';':
+                        if state == NORMAL:
+                            blocksToKeep.extend(blocksInProgress)
+                            blocksInProgress = []
+                            blocksOfDirectives = []
+                            state = FUNC_DECL
+                        terminator = True
+                    elif (state == NORMAL and token_id == '(' and i >= 1 and
+                          block.tokens[i-1].kind == TokenKind.IDENTIFIER and
+                          block.tokens[i-1].id in macros):
+                        # This is a plain macro being expanded in the header
+                        # which needs to be removed.
+                        blocksToKeep.extend(blocksInProgress)
+                        if lastTerminatorIndex < i - 1:
+                            blocksToKeep.append(Block(block.tokens[lastTerminatorIndex:i-1]))
+                        blocksInProgress = []
+                        blocksOfDirectives = []
 
-                if i > first:
-                    #print "### final '%s'" % repr(b.tokens[first:i])
-                    blocks2.append(Block(b.tokens[first:i]))
+                        # Skip until we see the terminating ')'
+                        i += 1
+                        paren_depth = 1
+                        while i < numTokens:
+                            if block.tokens[i].id == ')':
+                                paren_depth -= 1
+                                if paren_depth == 0:
+                                    break
+                            elif block.tokens[i].id == '(':
+                                paren_depth += 1
+                            i += 1
+                        lastTerminatorIndex = i + 1
+                    elif (state != FUNC_DECL and token_id == '(' and
+                          state_token != 'typedef'):
+                        blocksToKeep.extend(blocksInProgress)
+                        blocksInProgress = []
+                        blocksOfDirectives = []
+                        state = VAR_DECL
+                    elif state == NORMAL and token_id in ['struct', 'typedef',
+                                                          'enum', 'union',
+                                                          '__extension__']:
+                        state = OTHER_DECL
+                        state_token = token_id
+                    elif block.tokens[i].kind == TokenKind.IDENTIFIER:
+                        if state != VAR_DECL or ident == "":
+                            ident = token_id
 
-        self.blocks = blocks2
+                if terminator:
+                    if state != VAR_DECL and state != FUNC_DECL or ident in keep:
+                        blocksInProgress.append(Block(block.tokens[lastTerminatorIndex:i+1]))
+                        blocksToKeep.extend(blocksInProgress)
+                    else:
+                        # Only keep the directives found.
+                        blocksToKeep.extend(blocksOfDirectives)
+                    lastTerminatorIndex = i + 1
+                    blocksInProgress = []
+                    blocksOfDirectives = []
+                    state = NORMAL
+                    ident = ""
+                    state_token = ""
+                i += 1
+            if lastTerminatorIndex < numTokens:
+                blocksInProgress.append(Block(block.tokens[lastTerminatorIndex:numTokens]))
+        if len(blocksInProgress) > 0:
+            blocksToKeep.extend(blocksInProgress)
+        self.blocks = blocksToKeep
 
     def replaceTokens(self, replacements):
         """Replace tokens according to the given dict."""
@@ -1938,6 +1948,299 @@
         expected = ""
         self.assertEqual(self.parse(text), expected)
 
+class FullPathTest(unittest.TestCase):
+    """Test of the full path parsing."""
+
+    def parse(self, text, keep=None):
+        if not keep:
+            keep = set()
+        out = utils.StringOutput()
+        blocks = BlockParser().parse(CppStringTokenizer(text))
+        blocks.removeVarsAndFuncs(keep)
+        blocks.replaceTokens(kernel_token_replacements)
+        blocks.optimizeAll(None)
+        blocks.write(out)
+        return out.get()
+
+    def test_function_removed(self):
+        text = """\
+static inline __u64 function()
+{
+}
+"""
+        expected = ""
+        self.assertEqual(self.parse(text), expected)
+
+    def test_function_removed_with_struct(self):
+        text = """\
+static inline struct something* function()
+{
+}
+"""
+        expected = ""
+        self.assertEqual(self.parse(text), expected)
+
+    def test_function_kept(self):
+        text = """\
+static inline __u64 function()
+{
+}
+"""
+        expected = """\
+static inline __u64 function() {
+}
+"""
+        self.assertEqual(self.parse(text, set(["function"])), expected)
+
+    def test_var_removed(self):
+        text = "__u64 variable;"
+        expected = ""
+        self.assertEqual(self.parse(text), expected)
+
+    def test_var_kept(self):
+        text = "__u64 variable;"
+        expected = "__u64 variable;\n"
+        self.assertEqual(self.parse(text, set(["variable"])), expected)
+
+    def test_keep_function_typedef(self):
+        text = "typedef void somefunction_t(void);"
+        expected = "typedef void somefunction_t(void);\n"
+        self.assertEqual(self.parse(text), expected)
+
+    def test_struct_keep_attribute(self):
+        text = """\
+struct something_s {
+  __u32 s1;
+  __u32 s2;
+} __attribute__((packed));
+"""
+        expected = """\
+struct something_s {
+  __u32 s1;
+  __u32 s2;
+} __attribute__((packed));
+"""
+        self.assertEqual(self.parse(text), expected)
+
+    def test_function_keep_attribute_structs(self):
+        text = """\
+static __inline__ struct some_struct1 * function(struct some_struct2 * e) {
+}
+"""
+        expected = """\
+static __inline__ struct some_struct1 * function(struct some_struct2 * e) {
+}
+"""
+        self.assertEqual(self.parse(text, set(["function"])), expected)
+
+    def test_struct_after_struct(self):
+        text = """\
+struct first {
+};
+
+struct second {
+  unsigned short s1;
+#define SOMETHING 8
+  unsigned short s2;
+};
+"""
+        expected = """\
+struct first {
+};
+struct second {
+  unsigned short s1;
+#define SOMETHING 8
+  unsigned short s2;
+};
+"""
+        self.assertEqual(self.parse(text), expected)
+
+    def test_other_not_removed(self):
+        text = """\
+typedef union {
+  __u64 tu1;
+  __u64 tu2;
+} typedef_name;
+
+union {
+  __u64 u1;
+  __u64 u2;
+};
+
+struct {
+  __u64 s1;
+  __u64 s2;
+};
+
+enum {
+  ENUM1 = 0,
+  ENUM2,
+};
+
+__extension__ typedef __signed__ long long __s64;
+"""
+        expected = """\
+typedef union {
+  __u64 tu1;
+  __u64 tu2;
+} typedef_name;
+union {
+  __u64 u1;
+  __u64 u2;
+};
+struct {
+  __u64 s1;
+  __u64 s2;
+};
+enum {
+  ENUM1 = 0,
+  ENUM2,
+};
+__extension__ typedef __signed__ long long __s64;
+"""
+
+        self.assertEqual(self.parse(text), expected)
+
+    def test_semicolon_after_function(self):
+        text = """\
+static inline __u64 function()
+{
+};
+
+struct should_see {
+        __u32                           field;
+};
+"""
+        expected = """\
+struct should_see {
+  __u32 field;
+};
+"""
+        self.assertEqual(self.parse(text), expected)
+
+    def test_define_in_middle_keep(self):
+        text = """\
+enum {
+  ENUM0 = 0x10,
+  ENUM1 = 0x20,
+#define SOMETHING SOMETHING_ELSE
+  ENUM2 = 0x40,
+};
+"""
+        expected = """\
+enum {
+  ENUM0 = 0x10,
+  ENUM1 = 0x20,
+#define SOMETHING SOMETHING_ELSE
+  ENUM2 = 0x40,
+};
+"""
+        self.assertEqual(self.parse(text), expected)
+
+    def test_define_in_middle_remove(self):
+        text = """\
+static inline function() {
+#define SOMETHING1 SOMETHING_ELSE1
+  i = 0;
+  {
+    i = 1;
+  }
+#define SOMETHING2 SOMETHING_ELSE2
+}
+"""
+        expected = """\
+#define SOMETHING1 SOMETHING_ELSE1
+#define SOMETHING2 SOMETHING_ELSE2
+"""
+        self.assertEqual(self.parse(text), expected)
+
+    def test_define_in_middle_force_keep(self):
+        text = """\
+static inline function() {
+#define SOMETHING1 SOMETHING_ELSE1
+  i = 0;
+  {
+    i = 1;
+  }
+#define SOMETHING2 SOMETHING_ELSE2
+}
+"""
+        expected = """\
+static inline function() {
+#define SOMETHING1 SOMETHING_ELSE1
+  i = 0;
+ {
+    i = 1;
+  }
+#define SOMETHING2 SOMETHING_ELSE2
+}
+"""
+        self.assertEqual(self.parse(text, set(["function"])), expected)
+
+    def test_define_before_remove(self):
+        text = """\
+#define SHOULD_BE_KEPT NOTHING1
+#define ANOTHER_TO_KEEP NOTHING2
+static inline function() {
+#define SOMETHING1 SOMETHING_ELSE1
+  i = 0;
+  {
+    i = 1;
+  }
+#define SOMETHING2 SOMETHING_ELSE2
+}
+"""
+        expected = """\
+#define SHOULD_BE_KEPT NOTHING1
+#define ANOTHER_TO_KEEP NOTHING2
+#define SOMETHING1 SOMETHING_ELSE1
+#define SOMETHING2 SOMETHING_ELSE2
+"""
+        self.assertEqual(self.parse(text), expected)
+
+    def test_extern_C(self):
+        text = """\
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+struct something {
+};
+
+#if defined(__cplusplus)
+}
+#endif
+"""
+        expected = """\
+#ifdef __cplusplus
+extern "C" {
+#endif
+struct something {
+};
+#ifdef __cplusplus
+}
+#endif
+"""
+        self.assertEqual(self.parse(text), expected)
+
+    def test_macro_definition_removed(self):
+        text = """\
+#define MACRO_FUNCTION_NO_PARAMS static inline some_func() {}
+MACRO_FUNCTION_NO_PARAMS()
+
+#define MACRO_FUNCTION_PARAMS(a) static inline some_func() { a; }
+MACRO_FUNCTION_PARAMS(a = 1)
+
+something that should still be kept
+MACRO_FUNCTION_PARAMS(b)
+"""
+        expected = """\
+#define MACRO_FUNCTION_NO_PARAMS static inline some_func() { }
+#define MACRO_FUNCTION_PARAMS(a) static inline some_func() { a; }
+something that should still be kept
+"""
+        self.assertEqual(self.parse(text), expected)
+
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/libc/kernel/tools/update_all.py b/libc/kernel/tools/update_all.py
index 0f30ecd..9d5b02d 100755
--- a/libc/kernel/tools/update_all.py
+++ b/libc/kernel/tools/update_all.py
@@ -4,7 +4,7 @@
 from defaults import *
 from utils import *
 
-def usage():
+def Usage():
     print """\
   usage: %(progname)s [kernel-original-path] [kernel-modified-path]
 
@@ -24,7 +24,7 @@
 """ % { "progname" : os.path.basename(sys.argv[0]) }
     sys.exit(0)
 
-def processFiles(updater, original_dir, modified_dir, src_rel_dir, update_rel_dir):
+def ProcessFiles(updater, original_dir, modified_dir, src_rel_dir, update_rel_dir):
     # Delete the old headers before updating to the new headers.
     update_dir = os.path.join(get_kernel_dir(), update_rel_dir)
     shutil.rmtree(update_dir)
@@ -64,15 +64,64 @@
             update_path = os.path.join(update_rel_dir, rel_path)
             print "cleaning %s -> %s (%s)" % (src_str, update_path, state)
 
+
+# This lets us support regular system calls like __NR_write and also weird
+# ones like __ARM_NR_cacheflush, where the NR doesn't come at the start.
+def make__NR_name(name):
+    if name.startswith('__ARM_NR_'):
+        return name
+    else:
+        return '__NR_%s' % (name)
+
+
+# Scan Linux kernel asm/unistd.h files containing __NR_* constants
+# and write out equivalent SYS_* constants for glibc source compatibility.
+def GenerateGlibcSyscallsHeader(updater):
+    libc_root = '%s/bionic/libc/' % os.environ['ANDROID_BUILD_TOP']
+
+    # Collect the set of all syscalls for all architectures.
+    syscalls = set()
+    pattern = re.compile(r'^\s*#\s*define\s*__NR_([a-z_]\S+)')
+    for unistd_h in ['kernel/uapi/asm-generic/unistd.h',
+                     'kernel/uapi/asm-arm/asm/unistd.h',
+                     'kernel/uapi/asm-arm/asm/unistd-common.h',
+                     'kernel/uapi/asm-arm/asm/unistd-eabi.h',
+                     'kernel/uapi/asm-arm/asm/unistd-oabi.h',
+                     'kernel/uapi/asm-x86/asm/unistd_32.h',
+                     'kernel/uapi/asm-x86/asm/unistd_64.h',
+                     'kernel/uapi/asm-x86/asm/unistd_x32.h']:
+        for line in open(os.path.join(libc_root, unistd_h)):
+            m = re.search(pattern, line)
+            if m:
+                nr_name = m.group(1)
+                if 'reserved' not in nr_name and 'unused' not in nr_name:
+                    syscalls.add(nr_name)
+
+    # Create a single file listing them all.
+    # Note that the input files include #if trickery, so even for a single
+    # architecture we don't know exactly which ones are available.
+    # https://b.corp.google.com/issues/37110151
+    content = '/* Generated file. Do not edit. */\n'
+    content += '#pragma once\n'
+
+    for syscall in sorted(syscalls):
+        nr_name = make__NR_name(syscall)
+        content += '#if defined(%s)\n' % nr_name
+        content += '  #define SYS_%s %s\n' % (syscall, nr_name)
+        content += '#endif\n'
+
+    updater.editFile('%s/include/bits/glibc-syscalls.h' % libc_root, content)
+
+
 try:
     optlist, args = getopt.getopt(sys.argv[1:], '')
 except:
     # Unrecognized option
     sys.stderr.write("error: unrecognized option\n")
-    usage()
+    Usage()
 
 if len(optlist) > 0 or len(args) > 2:
-    usage()
+    Usage()
 
 if len(args) > 0:
     original_dir = args[0]
@@ -91,10 +140,16 @@
     panic("The kernel modified directory %s is not a directory\n" % modified_dir)
 
 updater = BatchFileUpdater()
+
 # Process the original uapi headers first.
-processFiles(updater, original_dir, modified_dir, "uapi", "uapi"),
+ProcessFiles(updater, original_dir, modified_dir, "uapi", "uapi"),
 
 # Now process the special files.
-processFiles(updater, original_dir, modified_dir, "scsi", os.path.join("android", "scsi", "scsi"))
+ProcessFiles(updater, original_dir, modified_dir, "scsi", os.path.join("android", "scsi", "scsi"))
 
 updater.updateGitFiles()
+
+# Now re-generate the <bits/glibc-syscalls.h> from the new uapi headers.
+updater = BatchFileUpdater()
+GenerateGlibcSyscallsHeader(updater)
+updater.updateGitFiles()
diff --git a/libc/kernel/uapi/asm-arm64/asm/hwcap.h b/libc/kernel/uapi/asm-arm64/asm/hwcap.h
index a7cd560..44853a4 100644
--- a/libc/kernel/uapi/asm-arm64/asm/hwcap.h
+++ b/libc/kernel/uapi/asm-arm64/asm/hwcap.h
@@ -46,4 +46,8 @@
 #define HWCAP_USCAT (1 << 25)
 #define HWCAP_ILRCPC (1 << 26)
 #define HWCAP_FLAGM (1 << 27)
+#define HWCAP_SSBS (1 << 28)
+#define HWCAP_SB (1 << 29)
+#define HWCAP_PACA (1 << 30)
+#define HWCAP_PACG (1UL << 31)
 #endif
diff --git a/libc/kernel/uapi/asm-arm64/asm/ptrace.h b/libc/kernel/uapi/asm-arm64/asm/ptrace.h
index 4e6c755..15fde29 100644
--- a/libc/kernel/uapi/asm-arm64/asm/ptrace.h
+++ b/libc/kernel/uapi/asm-arm64/asm/ptrace.h
@@ -20,7 +20,7 @@
 #define _UAPI__ASM_PTRACE_H
 #include <linux/types.h>
 #include <asm/hwcap.h>
-#include <asm/sigcontext.h>
+#include <asm/sve_context.h>
 #define PSR_MODE_EL0t 0x00000000
 #define PSR_MODE_EL1t 0x00000004
 #define PSR_MODE_EL1h 0x00000005
@@ -34,6 +34,7 @@
 #define PSR_I_BIT 0x00000080
 #define PSR_A_BIT 0x00000100
 #define PSR_D_BIT 0x00000200
+#define PSR_SSBS_BIT 0x00001000
 #define PSR_PAN_BIT 0x00400000
 #define PSR_UAO_BIT 0x00800000
 #define PSR_V_BIT 0x10000000
@@ -80,26 +81,29 @@
 #define SVE_PT_REGS_SVE SVE_PT_REGS_MASK
 #define SVE_PT_VL_INHERIT (PR_SVE_VL_INHERIT >> 16)
 #define SVE_PT_VL_ONEXEC (PR_SVE_SET_VL_ONEXEC >> 16)
-#define SVE_PT_REGS_OFFSET ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) / SVE_VQ_BYTES * SVE_VQ_BYTES)
+#define SVE_PT_REGS_OFFSET ((sizeof(struct user_sve_header) + (__SVE_VQ_BYTES - 1)) / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
 #define SVE_PT_FPSIMD_OFFSET SVE_PT_REGS_OFFSET
 #define SVE_PT_FPSIMD_SIZE(vq,flags) (sizeof(struct user_fpsimd_state))
-#define SVE_PT_SVE_ZREG_SIZE(vq) SVE_SIG_ZREG_SIZE(vq)
-#define SVE_PT_SVE_PREG_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
-#define SVE_PT_SVE_FFR_SIZE(vq) SVE_SIG_FFR_SIZE(vq)
+#define SVE_PT_SVE_ZREG_SIZE(vq) __SVE_ZREG_SIZE(vq)
+#define SVE_PT_SVE_PREG_SIZE(vq) __SVE_PREG_SIZE(vq)
+#define SVE_PT_SVE_FFR_SIZE(vq) __SVE_FFR_SIZE(vq)
 #define SVE_PT_SVE_FPSR_SIZE sizeof(__u32)
 #define SVE_PT_SVE_FPCR_SIZE sizeof(__u32)
-#define __SVE_SIG_TO_PT(offset) ((offset) - SVE_SIG_REGS_OFFSET + SVE_PT_REGS_OFFSET)
 #define SVE_PT_SVE_OFFSET SVE_PT_REGS_OFFSET
-#define SVE_PT_SVE_ZREGS_OFFSET __SVE_SIG_TO_PT(SVE_SIG_ZREGS_OFFSET)
-#define SVE_PT_SVE_ZREG_OFFSET(vq,n) __SVE_SIG_TO_PT(SVE_SIG_ZREG_OFFSET(vq, n))
-#define SVE_PT_SVE_ZREGS_SIZE(vq) (SVE_PT_SVE_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_PT_SVE_ZREGS_OFFSET)
-#define SVE_PT_SVE_PREGS_OFFSET(vq) __SVE_SIG_TO_PT(SVE_SIG_PREGS_OFFSET(vq))
-#define SVE_PT_SVE_PREG_OFFSET(vq,n) __SVE_SIG_TO_PT(SVE_SIG_PREG_OFFSET(vq, n))
-#define SVE_PT_SVE_PREGS_SIZE(vq) (SVE_PT_SVE_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_PT_SVE_PREGS_OFFSET(vq))
-#define SVE_PT_SVE_FFR_OFFSET(vq) __SVE_SIG_TO_PT(SVE_SIG_FFR_OFFSET(vq))
-#define SVE_PT_SVE_FPSR_OFFSET(vq) ((SVE_PT_SVE_FFR_OFFSET(vq) + SVE_PT_SVE_FFR_SIZE(vq) + (SVE_VQ_BYTES - 1)) / SVE_VQ_BYTES * SVE_VQ_BYTES)
+#define SVE_PT_SVE_ZREGS_OFFSET (SVE_PT_REGS_OFFSET + __SVE_ZREGS_OFFSET)
+#define SVE_PT_SVE_ZREG_OFFSET(vq,n) (SVE_PT_REGS_OFFSET + __SVE_ZREG_OFFSET(vq, n))
+#define SVE_PT_SVE_ZREGS_SIZE(vq) (SVE_PT_SVE_ZREG_OFFSET(vq, __SVE_NUM_ZREGS) - SVE_PT_SVE_ZREGS_OFFSET)
+#define SVE_PT_SVE_PREGS_OFFSET(vq) (SVE_PT_REGS_OFFSET + __SVE_PREGS_OFFSET(vq))
+#define SVE_PT_SVE_PREG_OFFSET(vq,n) (SVE_PT_REGS_OFFSET + __SVE_PREG_OFFSET(vq, n))
+#define SVE_PT_SVE_PREGS_SIZE(vq) (SVE_PT_SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - SVE_PT_SVE_PREGS_OFFSET(vq))
+#define SVE_PT_SVE_FFR_OFFSET(vq) (SVE_PT_REGS_OFFSET + __SVE_FFR_OFFSET(vq))
+#define SVE_PT_SVE_FPSR_OFFSET(vq) ((SVE_PT_SVE_FFR_OFFSET(vq) + SVE_PT_SVE_FFR_SIZE(vq) + (__SVE_VQ_BYTES - 1)) / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
 #define SVE_PT_SVE_FPCR_OFFSET(vq) (SVE_PT_SVE_FPSR_OFFSET(vq) + SVE_PT_SVE_FPSR_SIZE)
-#define SVE_PT_SVE_SIZE(vq,flags) ((SVE_PT_SVE_FPCR_OFFSET(vq) + SVE_PT_SVE_FPCR_SIZE - SVE_PT_SVE_OFFSET + (SVE_VQ_BYTES - 1)) / SVE_VQ_BYTES * SVE_VQ_BYTES)
+#define SVE_PT_SVE_SIZE(vq,flags) ((SVE_PT_SVE_FPCR_OFFSET(vq) + SVE_PT_SVE_FPCR_SIZE - SVE_PT_SVE_OFFSET + (__SVE_VQ_BYTES - 1)) / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
 #define SVE_PT_SIZE(vq,flags) (((flags) & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE ? SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) : SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_SIZE(vq, flags))
+struct user_pac_mask {
+  __u64 data_mask;
+  __u64 insn_mask;
+};
 #endif
 #endif
diff --git a/libc/kernel/uapi/asm-arm64/asm/sigcontext.h b/libc/kernel/uapi/asm-arm64/asm/sigcontext.h
index b0617de..518079d 100644
--- a/libc/kernel/uapi/asm-arm64/asm/sigcontext.h
+++ b/libc/kernel/uapi/asm-arm64/asm/sigcontext.h
@@ -58,27 +58,28 @@
   __u16 __reserved[3];
 };
 #endif
-#define SVE_VQ_BYTES 16
-#define SVE_VQ_MIN 1
-#define SVE_VQ_MAX 512
-#define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
-#define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
-#define SVE_NUM_ZREGS 32
-#define SVE_NUM_PREGS 16
-#define sve_vl_valid(vl) ((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
-#define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES)
-#define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES)
-#define SVE_SIG_ZREG_SIZE(vq) ((__u32) (vq) * SVE_VQ_BYTES)
-#define SVE_SIG_PREG_SIZE(vq) ((__u32) (vq) * (SVE_VQ_BYTES / 8))
-#define SVE_SIG_FFR_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
-#define SVE_SIG_REGS_OFFSET ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) / SVE_VQ_BYTES * SVE_VQ_BYTES)
-#define SVE_SIG_ZREGS_OFFSET SVE_SIG_REGS_OFFSET
-#define SVE_SIG_ZREG_OFFSET(vq,n) (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))
-#define SVE_SIG_ZREGS_SIZE(vq) (SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)
-#define SVE_SIG_PREGS_OFFSET(vq) (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))
-#define SVE_SIG_PREG_OFFSET(vq,n) (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))
-#define SVE_SIG_PREGS_SIZE(vq) (SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))
-#define SVE_SIG_FFR_OFFSET(vq) (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))
-#define SVE_SIG_REGS_SIZE(vq) (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
+#include <asm/sve_context.h>
+#define SVE_VQ_BYTES __SVE_VQ_BYTES
+#define SVE_VQ_MIN __SVE_VQ_MIN
+#define SVE_VQ_MAX __SVE_VQ_MAX
+#define SVE_VL_MIN __SVE_VL_MIN
+#define SVE_VL_MAX __SVE_VL_MAX
+#define SVE_NUM_ZREGS __SVE_NUM_ZREGS
+#define SVE_NUM_PREGS __SVE_NUM_PREGS
+#define sve_vl_valid(vl) __sve_vl_valid(vl)
+#define sve_vq_from_vl(vl) __sve_vq_from_vl(vl)
+#define sve_vl_from_vq(vq) __sve_vl_from_vq(vq)
+#define SVE_SIG_ZREG_SIZE(vq) __SVE_ZREG_SIZE(vq)
+#define SVE_SIG_PREG_SIZE(vq) __SVE_PREG_SIZE(vq)
+#define SVE_SIG_FFR_SIZE(vq) __SVE_FFR_SIZE(vq)
+#define SVE_SIG_REGS_OFFSET ((sizeof(struct sve_context) + (__SVE_VQ_BYTES - 1)) / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
+#define SVE_SIG_ZREGS_OFFSET (SVE_SIG_REGS_OFFSET + __SVE_ZREGS_OFFSET)
+#define SVE_SIG_ZREG_OFFSET(vq,n) (SVE_SIG_REGS_OFFSET + __SVE_ZREG_OFFSET(vq, n))
+#define SVE_SIG_ZREGS_SIZE(vq) __SVE_ZREGS_SIZE(vq)
+#define SVE_SIG_PREGS_OFFSET(vq) (SVE_SIG_REGS_OFFSET + __SVE_PREGS_OFFSET(vq))
+#define SVE_SIG_PREG_OFFSET(vq,n) (SVE_SIG_REGS_OFFSET + __SVE_PREG_OFFSET(vq, n))
+#define SVE_SIG_PREGS_SIZE(vq) __SVE_PREGS_SIZE(vq)
+#define SVE_SIG_FFR_OFFSET(vq) (SVE_SIG_REGS_OFFSET + __SVE_FFR_OFFSET(vq))
+#define SVE_SIG_REGS_SIZE(vq) (__SVE_FFR_OFFSET(vq) + __SVE_FFR_SIZE(vq))
 #define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
 #endif
diff --git a/libc/kernel/uapi/asm-arm64/asm/siginfo.h b/libc/kernel/uapi/asm-arm64/asm/siginfo.h
index 111a215..a31ebb2 100644
--- a/libc/kernel/uapi/asm-arm64/asm/siginfo.h
+++ b/libc/kernel/uapi/asm-arm64/asm/siginfo.h
@@ -16,8 +16,4 @@
  ***
  ****************************************************************************
  ****************************************************************************/
-#ifndef __ASM_SIGINFO_H
-#define __ASM_SIGINFO_H
-#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
 #include <asm-generic/siginfo.h>
-#endif
diff --git a/libc/kernel/uapi/asm-arm64/asm/sve_context.h b/libc/kernel/uapi/asm-arm64/asm/sve_context.h
new file mode 100644
index 0000000..ff0063e
--- /dev/null
+++ b/libc/kernel/uapi/asm-arm64/asm/sve_context.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI__ASM_SVE_CONTEXT_H
+#define _UAPI__ASM_SVE_CONTEXT_H
+#include <linux/types.h>
+#define __SVE_VQ_BYTES 16
+#define __SVE_VQ_MIN 1
+#define __SVE_VQ_MAX 512
+#define __SVE_VL_MIN (__SVE_VQ_MIN * __SVE_VQ_BYTES)
+#define __SVE_VL_MAX (__SVE_VQ_MAX * __SVE_VQ_BYTES)
+#define __SVE_NUM_ZREGS 32
+#define __SVE_NUM_PREGS 16
+#define __sve_vl_valid(vl) ((vl) % __SVE_VQ_BYTES == 0 && (vl) >= __SVE_VL_MIN && (vl) <= __SVE_VL_MAX)
+#define __sve_vq_from_vl(vl) ((vl) / __SVE_VQ_BYTES)
+#define __sve_vl_from_vq(vq) ((vq) * __SVE_VQ_BYTES)
+#define __SVE_ZREG_SIZE(vq) ((__u32) (vq) * __SVE_VQ_BYTES)
+#define __SVE_PREG_SIZE(vq) ((__u32) (vq) * (__SVE_VQ_BYTES / 8))
+#define __SVE_FFR_SIZE(vq) __SVE_PREG_SIZE(vq)
+#define __SVE_ZREGS_OFFSET 0
+#define __SVE_ZREG_OFFSET(vq,n) (__SVE_ZREGS_OFFSET + __SVE_ZREG_SIZE(vq) * (n))
+#define __SVE_ZREGS_SIZE(vq) (__SVE_ZREG_OFFSET(vq, __SVE_NUM_ZREGS) - __SVE_ZREGS_OFFSET)
+#define __SVE_PREGS_OFFSET(vq) (__SVE_ZREGS_OFFSET + __SVE_ZREGS_SIZE(vq))
+#define __SVE_PREG_OFFSET(vq,n) (__SVE_PREGS_OFFSET(vq) + __SVE_PREG_SIZE(vq) * (n))
+#define __SVE_PREGS_SIZE(vq) (__SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - __SVE_PREGS_OFFSET(vq))
+#define __SVE_FFR_OFFSET(vq) (__SVE_PREGS_OFFSET(vq) + __SVE_PREGS_SIZE(vq))
+#endif
diff --git a/libc/kernel/uapi/asm-arm64/asm/unistd.h b/libc/kernel/uapi/asm-arm64/asm/unistd.h
index cc151fd..0648b02 100644
--- a/libc/kernel/uapi/asm-arm64/asm/unistd.h
+++ b/libc/kernel/uapi/asm-arm64/asm/unistd.h
@@ -17,4 +17,5 @@
  ****************************************************************************
  ****************************************************************************/
 #define __ARCH_WANT_RENAMEAT
+#define __ARCH_WANT_NEW_STAT
 #include <asm-generic/unistd.h>
diff --git a/libc/kernel/uapi/asm-generic/ioctls.h b/libc/kernel/uapi/asm-generic/ioctls.h
index 41dbce2..f8a4357 100644
--- a/libc/kernel/uapi/asm-generic/ioctls.h
+++ b/libc/kernel/uapi/asm-generic/ioctls.h
@@ -81,6 +81,8 @@
 #define TIOCGPTLCK _IOR('T', 0x39, int)
 #define TIOCGEXCL _IOR('T', 0x40, int)
 #define TIOCGPTPEER _IO('T', 0x41)
+#define TIOCGISO7816 _IOR('T', 0x42, struct serial_iso7816)
+#define TIOCSISO7816 _IOWR('T', 0x43, struct serial_iso7816)
 #define FIONCLEX 0x5450
 #define FIOCLEX 0x5451
 #define FIOASYNC 0x5452
diff --git a/libc/kernel/uapi/asm-generic/shmparam.h b/libc/kernel/uapi/asm-generic/shmparam.h
deleted file mode 100644
index d3f1453..0000000
--- a/libc/kernel/uapi/asm-generic/shmparam.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/****************************************************************************
- ****************************************************************************
- ***
- ***   This header was automatically generated from a Linux kernel header
- ***   of the same name, to make information necessary for userspace to
- ***   call into the kernel available to libc.  It contains only constants,
- ***   structures, and macros generated from the original header, and thus,
- ***   contains no copyrightable information.
- ***
- ***   To edit the content of this header, modify the corresponding
- ***   source file (e.g. under external/kernel-headers/original/) then
- ***   run bionic/libc/kernel/tools/update_all.py
- ***
- ***   Any manual change here will be lost the next time this script will
- ***   be run. You've been warned!
- ***
- ****************************************************************************
- ****************************************************************************/
-#ifndef __ASM_GENERIC_SHMPARAM_H
-#define __ASM_GENERIC_SHMPARAM_H
-#define SHMLBA PAGE_SIZE
-#endif
diff --git a/libc/kernel/uapi/asm-generic/siginfo.h b/libc/kernel/uapi/asm-generic/siginfo.h
index 166193b..829ffad 100644
--- a/libc/kernel/uapi/asm-generic/siginfo.h
+++ b/libc/kernel/uapi/asm-generic/siginfo.h
@@ -24,13 +24,7 @@
   int sival_int;
   void __user * sival_ptr;
 } sigval_t;
-#ifndef __ARCH_SI_PREAMBLE_SIZE
-#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
-#endif
 #define SI_MAX_SIZE 128
-#ifndef SI_PAD_SIZE
-#define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
-#endif
 #ifndef __ARCH_SI_BAND_T
 #define __ARCH_SI_BAND_T long
 #endif
@@ -40,73 +34,75 @@
 #ifndef __ARCH_SI_ATTRIBUTES
 #define __ARCH_SI_ATTRIBUTES
 #endif
-typedef struct siginfo {
-  int si_signo;
-#ifndef __ARCH_HAS_SWAPPED_SIGINFO
-  int si_errno;
-  int si_code;
-#else
-  int si_code;
-  int si_errno;
-#endif
-  union {
-    int _pad[SI_PAD_SIZE];
-    struct {
-      __kernel_pid_t _pid;
-      __kernel_uid32_t _uid;
-    } _kill;
-    struct {
-      __kernel_timer_t _tid;
-      int _overrun;
-      sigval_t _sigval;
-      int _sys_private;
-    } _timer;
-    struct {
-      __kernel_pid_t _pid;
-      __kernel_uid32_t _uid;
-      sigval_t _sigval;
-    } _rt;
-    struct {
-      __kernel_pid_t _pid;
-      __kernel_uid32_t _uid;
-      int _status;
-      __ARCH_SI_CLOCK_T _utime;
-      __ARCH_SI_CLOCK_T _stime;
-    } _sigchld;
-    struct {
-      void __user * _addr;
+union __sifields {
+  struct {
+    __kernel_pid_t _pid;
+    __kernel_uid32_t _uid;
+  } _kill;
+  struct {
+    __kernel_timer_t _tid;
+    int _overrun;
+    sigval_t _sigval;
+    int _sys_private;
+  } _timer;
+  struct {
+    __kernel_pid_t _pid;
+    __kernel_uid32_t _uid;
+    sigval_t _sigval;
+  } _rt;
+  struct {
+    __kernel_pid_t _pid;
+    __kernel_uid32_t _uid;
+    int _status;
+    __ARCH_SI_CLOCK_T _utime;
+    __ARCH_SI_CLOCK_T _stime;
+  } _sigchld;
+  struct {
+    void __user * _addr;
 #ifdef __ARCH_SI_TRAPNO
-      int _trapno;
+    int _trapno;
 #endif
 #ifdef __ia64__
-      int _imm;
-      unsigned int _flags;
-      unsigned long _isr;
+    int _imm;
+    unsigned int _flags;
+    unsigned long _isr;
 #endif
 #define __ADDR_BND_PKEY_PAD (__alignof__(void *) < sizeof(short) ? sizeof(short) : __alignof__(void *))
-      union {
-        short _addr_lsb;
-        struct {
-          char _dummy_bnd[__ADDR_BND_PKEY_PAD];
-          void __user * _lower;
-          void __user * _upper;
-        } _addr_bnd;
-        struct {
-          char _dummy_pkey[__ADDR_BND_PKEY_PAD];
-          __u32 _pkey;
-        } _addr_pkey;
-      };
-    } _sigfault;
-    struct {
-      __ARCH_SI_BAND_T _band;
-      int _fd;
-    } _sigpoll;
-    struct {
-      void __user * _call_addr;
-      int _syscall;
-      unsigned int _arch;
-    } _sigsys;
-  } _sifields;
+    union {
+      short _addr_lsb;
+      struct {
+        char _dummy_bnd[__ADDR_BND_PKEY_PAD];
+        void __user * _lower;
+        void __user * _upper;
+      } _addr_bnd;
+      struct {
+        char _dummy_pkey[__ADDR_BND_PKEY_PAD];
+        __u32 _pkey;
+      } _addr_pkey;
+    };
+  } _sigfault;
+  struct {
+    __ARCH_SI_BAND_T _band;
+    int _fd;
+  } _sigpoll;
+  struct {
+    void __user * _call_addr;
+    int _syscall;
+    unsigned int _arch;
+  } _sigsys;
+};
+#ifndef __ARCH_HAS_SWAPPED_SIGINFO
+#define __SIGINFO struct { int si_signo; int si_errno; int si_code; union __sifields _sifields; \
+}
+#else
+#define __SIGINFO struct { int si_signo; int si_code; int si_errno; union __sifields _sifields; \
+}
+#endif
+typedef struct siginfo {
+  union {
+    __SIGINFO;
+    int _si_pad[SI_MAX_SIZE / sizeof(int)];
+  };
 } __ARCH_SI_ATTRIBUTES siginfo_t;
 #define si_pid _sifields._kill._pid
 #define si_uid _sifields._kill._uid
@@ -212,6 +208,8 @@
 #define NSIGPOLL 6
 #define SYS_SECCOMP 1
 #define NSIGSYS 1
+#define EMT_TAGOVF 1
+#define NSIGEMT 1
 #define SIGEV_SIGNAL 0
 #define SIGEV_NONE 1
 #define SIGEV_THREAD 2
diff --git a/libc/kernel/uapi/asm-generic/unistd.h b/libc/kernel/uapi/asm-generic/unistd.h
index 52f0b57..4113881 100644
--- a/libc/kernel/uapi/asm-generic/unistd.h
+++ b/libc/kernel/uapi/asm-generic/unistd.h
@@ -113,8 +113,10 @@
 #define __NR_splice 76
 #define __NR_tee 77
 #define __NR_readlinkat 78
+#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
 #define __NR3264_fstatat 79
 #define __NR3264_fstat 80
+#endif
 #define __NR_sync 81
 #define __NR_fsync 82
 #define __NR_fdatasync 83
@@ -319,8 +321,9 @@
 #define __NR_statx 291
 #define __NR_io_pgetevents 292
 #define __NR_rseq 293
+#define __NR_kexec_file_load 294
 #undef __NR_syscalls
-#define __NR_syscalls 294
+#define __NR_syscalls 295
 #if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT)
 #define __NR_fcntl __NR3264_fcntl
 #define __NR_statfs __NR3264_statfs
@@ -329,8 +332,10 @@
 #define __NR_ftruncate __NR3264_ftruncate
 #define __NR_lseek __NR3264_lseek
 #define __NR_sendfile __NR3264_sendfile
+#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
 #define __NR_newfstatat __NR3264_fstatat
 #define __NR_fstat __NR3264_fstat
+#endif
 #define __NR_mmap __NR3264_mmap
 #define __NR_fadvise64 __NR3264_fadvise64
 #ifdef __NR3264_stat
@@ -345,8 +350,10 @@
 #define __NR_ftruncate64 __NR3264_ftruncate
 #define __NR_llseek __NR3264_lseek
 #define __NR_sendfile64 __NR3264_sendfile
+#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
 #define __NR_fstatat64 __NR3264_fstatat
 #define __NR_fstat64 __NR3264_fstat
+#endif
 #define __NR_mmap2 __NR3264_mmap
 #define __NR_fadvise64_64 __NR3264_fadvise64
 #ifdef __NR3264_stat
diff --git a/libc/kernel/uapi/asm-mips/asm/inst.h b/libc/kernel/uapi/asm-mips/asm/inst.h
index 61fa3d6..090a40b 100644
--- a/libc/kernel/uapi/asm-mips/asm/inst.h
+++ b/libc/kernel/uapi/asm-mips/asm/inst.h
@@ -549,8 +549,9 @@
   mm_ext_op = 0x02c,
   mm_pool32axf_op = 0x03c,
   mm_srl32_op = 0x040,
+  mm_srlv32_op = 0x050,
   mm_sra_op = 0x080,
-  mm_srlv32_op = 0x090,
+  mm_srav_op = 0x090,
   mm_rotr_op = 0x0c0,
   mm_lwxs_op = 0x118,
   mm_addu32_op = 0x150,
diff --git a/libc/kernel/uapi/asm-mips/asm/ioctls.h b/libc/kernel/uapi/asm-mips/asm/ioctls.h
index a4a40b0..694546f 100644
--- a/libc/kernel/uapi/asm-mips/asm/ioctls.h
+++ b/libc/kernel/uapi/asm-mips/asm/ioctls.h
@@ -85,6 +85,8 @@
 #define TIOCGPTLCK _IOR('T', 0x39, int)
 #define TIOCGEXCL _IOR('T', 0x40, int)
 #define TIOCGPTPEER _IO('T', 0x41)
+#define TIOCGISO7816 _IOR('T', 0x42, struct serial_iso7816)
+#define TIOCSISO7816 _IOWR('T', 0x43, struct serial_iso7816)
 #define TIOCSCTTY 0x5480
 #define TIOCGSOFTCAR 0x5481
 #define TIOCSSOFTCAR 0x5482
diff --git a/libc/kernel/uapi/asm-mips/asm/sgidefs.h b/libc/kernel/uapi/asm-mips/asm/sgidefs.h
index 040459b..92750de 100644
--- a/libc/kernel/uapi/asm-mips/asm/sgidefs.h
+++ b/libc/kernel/uapi/asm-mips/asm/sgidefs.h
@@ -18,9 +18,6 @@
  ****************************************************************************/
 #ifndef __ASM_SGIDEFS_H
 #define __ASM_SGIDEFS_H
-#ifndef __linux__
-#error Use a Linux compiler or give up .
-#endif
 #define _MIPS_ISA_MIPS1 1
 #define _MIPS_ISA_MIPS2 2
 #define _MIPS_ISA_MIPS3 3
diff --git a/libc/kernel/uapi/asm-mips/asm/siginfo.h b/libc/kernel/uapi/asm-mips/asm/siginfo.h
index c37107b..c9efb21 100644
--- a/libc/kernel/uapi/asm-mips/asm/siginfo.h
+++ b/libc/kernel/uapi/asm-mips/asm/siginfo.h
@@ -20,13 +20,6 @@
 #define _UAPI_ASM_SIGINFO_H
 #define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2 * sizeof(int))
 #undef __ARCH_SI_TRAPNO
-#if _MIPS_SZLONG == 32
-#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
-#elif _MIPS_SZLONG==64
-#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
-#else
-#error _MIPS_SZLONG neither 32 nor 64
-#endif
 #define __ARCH_HAS_SWAPPED_SIGINFO
 #include <asm-generic/siginfo.h>
 #undef SI_ASYNCIO
diff --git a/libc/kernel/uapi/asm-mips/asm/unistd.h b/libc/kernel/uapi/asm-mips/asm/unistd.h
index e4dee2b..65f3614 100644
--- a/libc/kernel/uapi/asm-mips/asm/unistd.h
+++ b/libc/kernel/uapi/asm-mips/asm/unistd.h
@@ -21,1048 +21,14 @@
 #include <asm/sgidefs.h>
 #if _MIPS_SIM == _MIPS_SIM_ABI32
 #define __NR_Linux 4000
-#define __NR_syscall (__NR_Linux + 0)
-#define __NR_exit (__NR_Linux + 1)
-#define __NR_fork (__NR_Linux + 2)
-#define __NR_read (__NR_Linux + 3)
-#define __NR_write (__NR_Linux + 4)
-#define __NR_open (__NR_Linux + 5)
-#define __NR_close (__NR_Linux + 6)
-#define __NR_waitpid (__NR_Linux + 7)
-#define __NR_creat (__NR_Linux + 8)
-#define __NR_link (__NR_Linux + 9)
-#define __NR_unlink (__NR_Linux + 10)
-#define __NR_execve (__NR_Linux + 11)
-#define __NR_chdir (__NR_Linux + 12)
-#define __NR_time (__NR_Linux + 13)
-#define __NR_mknod (__NR_Linux + 14)
-#define __NR_chmod (__NR_Linux + 15)
-#define __NR_lchown (__NR_Linux + 16)
-#define __NR_break (__NR_Linux + 17)
-#define __NR_unused18 (__NR_Linux + 18)
-#define __NR_lseek (__NR_Linux + 19)
-#define __NR_getpid (__NR_Linux + 20)
-#define __NR_mount (__NR_Linux + 21)
-#define __NR_umount (__NR_Linux + 22)
-#define __NR_setuid (__NR_Linux + 23)
-#define __NR_getuid (__NR_Linux + 24)
-#define __NR_stime (__NR_Linux + 25)
-#define __NR_ptrace (__NR_Linux + 26)
-#define __NR_alarm (__NR_Linux + 27)
-#define __NR_unused28 (__NR_Linux + 28)
-#define __NR_pause (__NR_Linux + 29)
-#define __NR_utime (__NR_Linux + 30)
-#define __NR_stty (__NR_Linux + 31)
-#define __NR_gtty (__NR_Linux + 32)
-#define __NR_access (__NR_Linux + 33)
-#define __NR_nice (__NR_Linux + 34)
-#define __NR_ftime (__NR_Linux + 35)
-#define __NR_sync (__NR_Linux + 36)
-#define __NR_kill (__NR_Linux + 37)
-#define __NR_rename (__NR_Linux + 38)
-#define __NR_mkdir (__NR_Linux + 39)
-#define __NR_rmdir (__NR_Linux + 40)
-#define __NR_dup (__NR_Linux + 41)
-#define __NR_pipe (__NR_Linux + 42)
-#define __NR_times (__NR_Linux + 43)
-#define __NR_prof (__NR_Linux + 44)
-#define __NR_brk (__NR_Linux + 45)
-#define __NR_setgid (__NR_Linux + 46)
-#define __NR_getgid (__NR_Linux + 47)
-#define __NR_signal (__NR_Linux + 48)
-#define __NR_geteuid (__NR_Linux + 49)
-#define __NR_getegid (__NR_Linux + 50)
-#define __NR_acct (__NR_Linux + 51)
-#define __NR_umount2 (__NR_Linux + 52)
-#define __NR_lock (__NR_Linux + 53)
-#define __NR_ioctl (__NR_Linux + 54)
-#define __NR_fcntl (__NR_Linux + 55)
-#define __NR_mpx (__NR_Linux + 56)
-#define __NR_setpgid (__NR_Linux + 57)
-#define __NR_ulimit (__NR_Linux + 58)
-#define __NR_unused59 (__NR_Linux + 59)
-#define __NR_umask (__NR_Linux + 60)
-#define __NR_chroot (__NR_Linux + 61)
-#define __NR_ustat (__NR_Linux + 62)
-#define __NR_dup2 (__NR_Linux + 63)
-#define __NR_getppid (__NR_Linux + 64)
-#define __NR_getpgrp (__NR_Linux + 65)
-#define __NR_setsid (__NR_Linux + 66)
-#define __NR_sigaction (__NR_Linux + 67)
-#define __NR_sgetmask (__NR_Linux + 68)
-#define __NR_ssetmask (__NR_Linux + 69)
-#define __NR_setreuid (__NR_Linux + 70)
-#define __NR_setregid (__NR_Linux + 71)
-#define __NR_sigsuspend (__NR_Linux + 72)
-#define __NR_sigpending (__NR_Linux + 73)
-#define __NR_sethostname (__NR_Linux + 74)
-#define __NR_setrlimit (__NR_Linux + 75)
-#define __NR_getrlimit (__NR_Linux + 76)
-#define __NR_getrusage (__NR_Linux + 77)
-#define __NR_gettimeofday (__NR_Linux + 78)
-#define __NR_settimeofday (__NR_Linux + 79)
-#define __NR_getgroups (__NR_Linux + 80)
-#define __NR_setgroups (__NR_Linux + 81)
-#define __NR_reserved82 (__NR_Linux + 82)
-#define __NR_symlink (__NR_Linux + 83)
-#define __NR_unused84 (__NR_Linux + 84)
-#define __NR_readlink (__NR_Linux + 85)
-#define __NR_uselib (__NR_Linux + 86)
-#define __NR_swapon (__NR_Linux + 87)
-#define __NR_reboot (__NR_Linux + 88)
-#define __NR_readdir (__NR_Linux + 89)
-#define __NR_mmap (__NR_Linux + 90)
-#define __NR_munmap (__NR_Linux + 91)
-#define __NR_truncate (__NR_Linux + 92)
-#define __NR_ftruncate (__NR_Linux + 93)
-#define __NR_fchmod (__NR_Linux + 94)
-#define __NR_fchown (__NR_Linux + 95)
-#define __NR_getpriority (__NR_Linux + 96)
-#define __NR_setpriority (__NR_Linux + 97)
-#define __NR_profil (__NR_Linux + 98)
-#define __NR_statfs (__NR_Linux + 99)
-#define __NR_fstatfs (__NR_Linux + 100)
-#define __NR_ioperm (__NR_Linux + 101)
-#define __NR_socketcall (__NR_Linux + 102)
-#define __NR_syslog (__NR_Linux + 103)
-#define __NR_setitimer (__NR_Linux + 104)
-#define __NR_getitimer (__NR_Linux + 105)
-#define __NR_stat (__NR_Linux + 106)
-#define __NR_lstat (__NR_Linux + 107)
-#define __NR_fstat (__NR_Linux + 108)
-#define __NR_unused109 (__NR_Linux + 109)
-#define __NR_iopl (__NR_Linux + 110)
-#define __NR_vhangup (__NR_Linux + 111)
-#define __NR_idle (__NR_Linux + 112)
-#define __NR_vm86 (__NR_Linux + 113)
-#define __NR_wait4 (__NR_Linux + 114)
-#define __NR_swapoff (__NR_Linux + 115)
-#define __NR_sysinfo (__NR_Linux + 116)
-#define __NR_ipc (__NR_Linux + 117)
-#define __NR_fsync (__NR_Linux + 118)
-#define __NR_sigreturn (__NR_Linux + 119)
-#define __NR_clone (__NR_Linux + 120)
-#define __NR_setdomainname (__NR_Linux + 121)
-#define __NR_uname (__NR_Linux + 122)
-#define __NR_modify_ldt (__NR_Linux + 123)
-#define __NR_adjtimex (__NR_Linux + 124)
-#define __NR_mprotect (__NR_Linux + 125)
-#define __NR_sigprocmask (__NR_Linux + 126)
-#define __NR_create_module (__NR_Linux + 127)
-#define __NR_init_module (__NR_Linux + 128)
-#define __NR_delete_module (__NR_Linux + 129)
-#define __NR_get_kernel_syms (__NR_Linux + 130)
-#define __NR_quotactl (__NR_Linux + 131)
-#define __NR_getpgid (__NR_Linux + 132)
-#define __NR_fchdir (__NR_Linux + 133)
-#define __NR_bdflush (__NR_Linux + 134)
-#define __NR_sysfs (__NR_Linux + 135)
-#define __NR_personality (__NR_Linux + 136)
-#define __NR_afs_syscall (__NR_Linux + 137)
-#define __NR_setfsuid (__NR_Linux + 138)
-#define __NR_setfsgid (__NR_Linux + 139)
-#define __NR__llseek (__NR_Linux + 140)
-#define __NR_getdents (__NR_Linux + 141)
-#define __NR__newselect (__NR_Linux + 142)
-#define __NR_flock (__NR_Linux + 143)
-#define __NR_msync (__NR_Linux + 144)
-#define __NR_readv (__NR_Linux + 145)
-#define __NR_writev (__NR_Linux + 146)
-#define __NR_cacheflush (__NR_Linux + 147)
-#define __NR_cachectl (__NR_Linux + 148)
-#define __NR_sysmips (__NR_Linux + 149)
-#define __NR_unused150 (__NR_Linux + 150)
-#define __NR_getsid (__NR_Linux + 151)
-#define __NR_fdatasync (__NR_Linux + 152)
-#define __NR__sysctl (__NR_Linux + 153)
-#define __NR_mlock (__NR_Linux + 154)
-#define __NR_munlock (__NR_Linux + 155)
-#define __NR_mlockall (__NR_Linux + 156)
-#define __NR_munlockall (__NR_Linux + 157)
-#define __NR_sched_setparam (__NR_Linux + 158)
-#define __NR_sched_getparam (__NR_Linux + 159)
-#define __NR_sched_setscheduler (__NR_Linux + 160)
-#define __NR_sched_getscheduler (__NR_Linux + 161)
-#define __NR_sched_yield (__NR_Linux + 162)
-#define __NR_sched_get_priority_max (__NR_Linux + 163)
-#define __NR_sched_get_priority_min (__NR_Linux + 164)
-#define __NR_sched_rr_get_interval (__NR_Linux + 165)
-#define __NR_nanosleep (__NR_Linux + 166)
-#define __NR_mremap (__NR_Linux + 167)
-#define __NR_accept (__NR_Linux + 168)
-#define __NR_bind (__NR_Linux + 169)
-#define __NR_connect (__NR_Linux + 170)
-#define __NR_getpeername (__NR_Linux + 171)
-#define __NR_getsockname (__NR_Linux + 172)
-#define __NR_getsockopt (__NR_Linux + 173)
-#define __NR_listen (__NR_Linux + 174)
-#define __NR_recv (__NR_Linux + 175)
-#define __NR_recvfrom (__NR_Linux + 176)
-#define __NR_recvmsg (__NR_Linux + 177)
-#define __NR_send (__NR_Linux + 178)
-#define __NR_sendmsg (__NR_Linux + 179)
-#define __NR_sendto (__NR_Linux + 180)
-#define __NR_setsockopt (__NR_Linux + 181)
-#define __NR_shutdown (__NR_Linux + 182)
-#define __NR_socket (__NR_Linux + 183)
-#define __NR_socketpair (__NR_Linux + 184)
-#define __NR_setresuid (__NR_Linux + 185)
-#define __NR_getresuid (__NR_Linux + 186)
-#define __NR_query_module (__NR_Linux + 187)
-#define __NR_poll (__NR_Linux + 188)
-#define __NR_nfsservctl (__NR_Linux + 189)
-#define __NR_setresgid (__NR_Linux + 190)
-#define __NR_getresgid (__NR_Linux + 191)
-#define __NR_prctl (__NR_Linux + 192)
-#define __NR_rt_sigreturn (__NR_Linux + 193)
-#define __NR_rt_sigaction (__NR_Linux + 194)
-#define __NR_rt_sigprocmask (__NR_Linux + 195)
-#define __NR_rt_sigpending (__NR_Linux + 196)
-#define __NR_rt_sigtimedwait (__NR_Linux + 197)
-#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
-#define __NR_rt_sigsuspend (__NR_Linux + 199)
-#define __NR_pread64 (__NR_Linux + 200)
-#define __NR_pwrite64 (__NR_Linux + 201)
-#define __NR_chown (__NR_Linux + 202)
-#define __NR_getcwd (__NR_Linux + 203)
-#define __NR_capget (__NR_Linux + 204)
-#define __NR_capset (__NR_Linux + 205)
-#define __NR_sigaltstack (__NR_Linux + 206)
-#define __NR_sendfile (__NR_Linux + 207)
-#define __NR_getpmsg (__NR_Linux + 208)
-#define __NR_putpmsg (__NR_Linux + 209)
-#define __NR_mmap2 (__NR_Linux + 210)
-#define __NR_truncate64 (__NR_Linux + 211)
-#define __NR_ftruncate64 (__NR_Linux + 212)
-#define __NR_stat64 (__NR_Linux + 213)
-#define __NR_lstat64 (__NR_Linux + 214)
-#define __NR_fstat64 (__NR_Linux + 215)
-#define __NR_pivot_root (__NR_Linux + 216)
-#define __NR_mincore (__NR_Linux + 217)
-#define __NR_madvise (__NR_Linux + 218)
-#define __NR_getdents64 (__NR_Linux + 219)
-#define __NR_fcntl64 (__NR_Linux + 220)
-#define __NR_reserved221 (__NR_Linux + 221)
-#define __NR_gettid (__NR_Linux + 222)
-#define __NR_readahead (__NR_Linux + 223)
-#define __NR_setxattr (__NR_Linux + 224)
-#define __NR_lsetxattr (__NR_Linux + 225)
-#define __NR_fsetxattr (__NR_Linux + 226)
-#define __NR_getxattr (__NR_Linux + 227)
-#define __NR_lgetxattr (__NR_Linux + 228)
-#define __NR_fgetxattr (__NR_Linux + 229)
-#define __NR_listxattr (__NR_Linux + 230)
-#define __NR_llistxattr (__NR_Linux + 231)
-#define __NR_flistxattr (__NR_Linux + 232)
-#define __NR_removexattr (__NR_Linux + 233)
-#define __NR_lremovexattr (__NR_Linux + 234)
-#define __NR_fremovexattr (__NR_Linux + 235)
-#define __NR_tkill (__NR_Linux + 236)
-#define __NR_sendfile64 (__NR_Linux + 237)
-#define __NR_futex (__NR_Linux + 238)
-#define __NR_sched_setaffinity (__NR_Linux + 239)
-#define __NR_sched_getaffinity (__NR_Linux + 240)
-#define __NR_io_setup (__NR_Linux + 241)
-#define __NR_io_destroy (__NR_Linux + 242)
-#define __NR_io_getevents (__NR_Linux + 243)
-#define __NR_io_submit (__NR_Linux + 244)
-#define __NR_io_cancel (__NR_Linux + 245)
-#define __NR_exit_group (__NR_Linux + 246)
-#define __NR_lookup_dcookie (__NR_Linux + 247)
-#define __NR_epoll_create (__NR_Linux + 248)
-#define __NR_epoll_ctl (__NR_Linux + 249)
-#define __NR_epoll_wait (__NR_Linux + 250)
-#define __NR_remap_file_pages (__NR_Linux + 251)
-#define __NR_set_tid_address (__NR_Linux + 252)
-#define __NR_restart_syscall (__NR_Linux + 253)
-#define __NR_fadvise64 (__NR_Linux + 254)
-#define __NR_statfs64 (__NR_Linux + 255)
-#define __NR_fstatfs64 (__NR_Linux + 256)
-#define __NR_timer_create (__NR_Linux + 257)
-#define __NR_timer_settime (__NR_Linux + 258)
-#define __NR_timer_gettime (__NR_Linux + 259)
-#define __NR_timer_getoverrun (__NR_Linux + 260)
-#define __NR_timer_delete (__NR_Linux + 261)
-#define __NR_clock_settime (__NR_Linux + 262)
-#define __NR_clock_gettime (__NR_Linux + 263)
-#define __NR_clock_getres (__NR_Linux + 264)
-#define __NR_clock_nanosleep (__NR_Linux + 265)
-#define __NR_tgkill (__NR_Linux + 266)
-#define __NR_utimes (__NR_Linux + 267)
-#define __NR_mbind (__NR_Linux + 268)
-#define __NR_get_mempolicy (__NR_Linux + 269)
-#define __NR_set_mempolicy (__NR_Linux + 270)
-#define __NR_mq_open (__NR_Linux + 271)
-#define __NR_mq_unlink (__NR_Linux + 272)
-#define __NR_mq_timedsend (__NR_Linux + 273)
-#define __NR_mq_timedreceive (__NR_Linux + 274)
-#define __NR_mq_notify (__NR_Linux + 275)
-#define __NR_mq_getsetattr (__NR_Linux + 276)
-#define __NR_vserver (__NR_Linux + 277)
-#define __NR_waitid (__NR_Linux + 278)
-#define __NR_add_key (__NR_Linux + 280)
-#define __NR_request_key (__NR_Linux + 281)
-#define __NR_keyctl (__NR_Linux + 282)
-#define __NR_set_thread_area (__NR_Linux + 283)
-#define __NR_inotify_init (__NR_Linux + 284)
-#define __NR_inotify_add_watch (__NR_Linux + 285)
-#define __NR_inotify_rm_watch (__NR_Linux + 286)
-#define __NR_migrate_pages (__NR_Linux + 287)
-#define __NR_openat (__NR_Linux + 288)
-#define __NR_mkdirat (__NR_Linux + 289)
-#define __NR_mknodat (__NR_Linux + 290)
-#define __NR_fchownat (__NR_Linux + 291)
-#define __NR_futimesat (__NR_Linux + 292)
-#define __NR_fstatat64 (__NR_Linux + 293)
-#define __NR_unlinkat (__NR_Linux + 294)
-#define __NR_renameat (__NR_Linux + 295)
-#define __NR_linkat (__NR_Linux + 296)
-#define __NR_symlinkat (__NR_Linux + 297)
-#define __NR_readlinkat (__NR_Linux + 298)
-#define __NR_fchmodat (__NR_Linux + 299)
-#define __NR_faccessat (__NR_Linux + 300)
-#define __NR_pselect6 (__NR_Linux + 301)
-#define __NR_ppoll (__NR_Linux + 302)
-#define __NR_unshare (__NR_Linux + 303)
-#define __NR_splice (__NR_Linux + 304)
-#define __NR_sync_file_range (__NR_Linux + 305)
-#define __NR_tee (__NR_Linux + 306)
-#define __NR_vmsplice (__NR_Linux + 307)
-#define __NR_move_pages (__NR_Linux + 308)
-#define __NR_set_robust_list (__NR_Linux + 309)
-#define __NR_get_robust_list (__NR_Linux + 310)
-#define __NR_kexec_load (__NR_Linux + 311)
-#define __NR_getcpu (__NR_Linux + 312)
-#define __NR_epoll_pwait (__NR_Linux + 313)
-#define __NR_ioprio_set (__NR_Linux + 314)
-#define __NR_ioprio_get (__NR_Linux + 315)
-#define __NR_utimensat (__NR_Linux + 316)
-#define __NR_signalfd (__NR_Linux + 317)
-#define __NR_timerfd (__NR_Linux + 318)
-#define __NR_eventfd (__NR_Linux + 319)
-#define __NR_fallocate (__NR_Linux + 320)
-#define __NR_timerfd_create (__NR_Linux + 321)
-#define __NR_timerfd_gettime (__NR_Linux + 322)
-#define __NR_timerfd_settime (__NR_Linux + 323)
-#define __NR_signalfd4 (__NR_Linux + 324)
-#define __NR_eventfd2 (__NR_Linux + 325)
-#define __NR_epoll_create1 (__NR_Linux + 326)
-#define __NR_dup3 (__NR_Linux + 327)
-#define __NR_pipe2 (__NR_Linux + 328)
-#define __NR_inotify_init1 (__NR_Linux + 329)
-#define __NR_preadv (__NR_Linux + 330)
-#define __NR_pwritev (__NR_Linux + 331)
-#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
-#define __NR_perf_event_open (__NR_Linux + 333)
-#define __NR_accept4 (__NR_Linux + 334)
-#define __NR_recvmmsg (__NR_Linux + 335)
-#define __NR_fanotify_init (__NR_Linux + 336)
-#define __NR_fanotify_mark (__NR_Linux + 337)
-#define __NR_prlimit64 (__NR_Linux + 338)
-#define __NR_name_to_handle_at (__NR_Linux + 339)
-#define __NR_open_by_handle_at (__NR_Linux + 340)
-#define __NR_clock_adjtime (__NR_Linux + 341)
-#define __NR_syncfs (__NR_Linux + 342)
-#define __NR_sendmmsg (__NR_Linux + 343)
-#define __NR_setns (__NR_Linux + 344)
-#define __NR_process_vm_readv (__NR_Linux + 345)
-#define __NR_process_vm_writev (__NR_Linux + 346)
-#define __NR_kcmp (__NR_Linux + 347)
-#define __NR_finit_module (__NR_Linux + 348)
-#define __NR_sched_setattr (__NR_Linux + 349)
-#define __NR_sched_getattr (__NR_Linux + 350)
-#define __NR_renameat2 (__NR_Linux + 351)
-#define __NR_seccomp (__NR_Linux + 352)
-#define __NR_getrandom (__NR_Linux + 353)
-#define __NR_memfd_create (__NR_Linux + 354)
-#define __NR_bpf (__NR_Linux + 355)
-#define __NR_execveat (__NR_Linux + 356)
-#define __NR_userfaultfd (__NR_Linux + 357)
-#define __NR_membarrier (__NR_Linux + 358)
-#define __NR_mlock2 (__NR_Linux + 359)
-#define __NR_copy_file_range (__NR_Linux + 360)
-#define __NR_preadv2 (__NR_Linux + 361)
-#define __NR_pwritev2 (__NR_Linux + 362)
-#define __NR_pkey_mprotect (__NR_Linux + 363)
-#define __NR_pkey_alloc (__NR_Linux + 364)
-#define __NR_pkey_free (__NR_Linux + 365)
-#define __NR_statx (__NR_Linux + 366)
-#define __NR_rseq (__NR_Linux + 367)
-#define __NR_io_pgetevents (__NR_Linux + 368)
-#define __NR_Linux_syscalls 368
+#include <asm/unistd_o32.h>
 #endif
-#define __NR_O32_Linux 4000
-#define __NR_O32_Linux_syscalls 368
 #if _MIPS_SIM == _MIPS_SIM_ABI64
 #define __NR_Linux 5000
-#define __NR_read (__NR_Linux + 0)
-#define __NR_write (__NR_Linux + 1)
-#define __NR_open (__NR_Linux + 2)
-#define __NR_close (__NR_Linux + 3)
-#define __NR_stat (__NR_Linux + 4)
-#define __NR_fstat (__NR_Linux + 5)
-#define __NR_lstat (__NR_Linux + 6)
-#define __NR_poll (__NR_Linux + 7)
-#define __NR_lseek (__NR_Linux + 8)
-#define __NR_mmap (__NR_Linux + 9)
-#define __NR_mprotect (__NR_Linux + 10)
-#define __NR_munmap (__NR_Linux + 11)
-#define __NR_brk (__NR_Linux + 12)
-#define __NR_rt_sigaction (__NR_Linux + 13)
-#define __NR_rt_sigprocmask (__NR_Linux + 14)
-#define __NR_ioctl (__NR_Linux + 15)
-#define __NR_pread64 (__NR_Linux + 16)
-#define __NR_pwrite64 (__NR_Linux + 17)
-#define __NR_readv (__NR_Linux + 18)
-#define __NR_writev (__NR_Linux + 19)
-#define __NR_access (__NR_Linux + 20)
-#define __NR_pipe (__NR_Linux + 21)
-#define __NR__newselect (__NR_Linux + 22)
-#define __NR_sched_yield (__NR_Linux + 23)
-#define __NR_mremap (__NR_Linux + 24)
-#define __NR_msync (__NR_Linux + 25)
-#define __NR_mincore (__NR_Linux + 26)
-#define __NR_madvise (__NR_Linux + 27)
-#define __NR_shmget (__NR_Linux + 28)
-#define __NR_shmat (__NR_Linux + 29)
-#define __NR_shmctl (__NR_Linux + 30)
-#define __NR_dup (__NR_Linux + 31)
-#define __NR_dup2 (__NR_Linux + 32)
-#define __NR_pause (__NR_Linux + 33)
-#define __NR_nanosleep (__NR_Linux + 34)
-#define __NR_getitimer (__NR_Linux + 35)
-#define __NR_setitimer (__NR_Linux + 36)
-#define __NR_alarm (__NR_Linux + 37)
-#define __NR_getpid (__NR_Linux + 38)
-#define __NR_sendfile (__NR_Linux + 39)
-#define __NR_socket (__NR_Linux + 40)
-#define __NR_connect (__NR_Linux + 41)
-#define __NR_accept (__NR_Linux + 42)
-#define __NR_sendto (__NR_Linux + 43)
-#define __NR_recvfrom (__NR_Linux + 44)
-#define __NR_sendmsg (__NR_Linux + 45)
-#define __NR_recvmsg (__NR_Linux + 46)
-#define __NR_shutdown (__NR_Linux + 47)
-#define __NR_bind (__NR_Linux + 48)
-#define __NR_listen (__NR_Linux + 49)
-#define __NR_getsockname (__NR_Linux + 50)
-#define __NR_getpeername (__NR_Linux + 51)
-#define __NR_socketpair (__NR_Linux + 52)
-#define __NR_setsockopt (__NR_Linux + 53)
-#define __NR_getsockopt (__NR_Linux + 54)
-#define __NR_clone (__NR_Linux + 55)
-#define __NR_fork (__NR_Linux + 56)
-#define __NR_execve (__NR_Linux + 57)
-#define __NR_exit (__NR_Linux + 58)
-#define __NR_wait4 (__NR_Linux + 59)
-#define __NR_kill (__NR_Linux + 60)
-#define __NR_uname (__NR_Linux + 61)
-#define __NR_semget (__NR_Linux + 62)
-#define __NR_semop (__NR_Linux + 63)
-#define __NR_semctl (__NR_Linux + 64)
-#define __NR_shmdt (__NR_Linux + 65)
-#define __NR_msgget (__NR_Linux + 66)
-#define __NR_msgsnd (__NR_Linux + 67)
-#define __NR_msgrcv (__NR_Linux + 68)
-#define __NR_msgctl (__NR_Linux + 69)
-#define __NR_fcntl (__NR_Linux + 70)
-#define __NR_flock (__NR_Linux + 71)
-#define __NR_fsync (__NR_Linux + 72)
-#define __NR_fdatasync (__NR_Linux + 73)
-#define __NR_truncate (__NR_Linux + 74)
-#define __NR_ftruncate (__NR_Linux + 75)
-#define __NR_getdents (__NR_Linux + 76)
-#define __NR_getcwd (__NR_Linux + 77)
-#define __NR_chdir (__NR_Linux + 78)
-#define __NR_fchdir (__NR_Linux + 79)
-#define __NR_rename (__NR_Linux + 80)
-#define __NR_mkdir (__NR_Linux + 81)
-#define __NR_rmdir (__NR_Linux + 82)
-#define __NR_creat (__NR_Linux + 83)
-#define __NR_link (__NR_Linux + 84)
-#define __NR_unlink (__NR_Linux + 85)
-#define __NR_symlink (__NR_Linux + 86)
-#define __NR_readlink (__NR_Linux + 87)
-#define __NR_chmod (__NR_Linux + 88)
-#define __NR_fchmod (__NR_Linux + 89)
-#define __NR_chown (__NR_Linux + 90)
-#define __NR_fchown (__NR_Linux + 91)
-#define __NR_lchown (__NR_Linux + 92)
-#define __NR_umask (__NR_Linux + 93)
-#define __NR_gettimeofday (__NR_Linux + 94)
-#define __NR_getrlimit (__NR_Linux + 95)
-#define __NR_getrusage (__NR_Linux + 96)
-#define __NR_sysinfo (__NR_Linux + 97)
-#define __NR_times (__NR_Linux + 98)
-#define __NR_ptrace (__NR_Linux + 99)
-#define __NR_getuid (__NR_Linux + 100)
-#define __NR_syslog (__NR_Linux + 101)
-#define __NR_getgid (__NR_Linux + 102)
-#define __NR_setuid (__NR_Linux + 103)
-#define __NR_setgid (__NR_Linux + 104)
-#define __NR_geteuid (__NR_Linux + 105)
-#define __NR_getegid (__NR_Linux + 106)
-#define __NR_setpgid (__NR_Linux + 107)
-#define __NR_getppid (__NR_Linux + 108)
-#define __NR_getpgrp (__NR_Linux + 109)
-#define __NR_setsid (__NR_Linux + 110)
-#define __NR_setreuid (__NR_Linux + 111)
-#define __NR_setregid (__NR_Linux + 112)
-#define __NR_getgroups (__NR_Linux + 113)
-#define __NR_setgroups (__NR_Linux + 114)
-#define __NR_setresuid (__NR_Linux + 115)
-#define __NR_getresuid (__NR_Linux + 116)
-#define __NR_setresgid (__NR_Linux + 117)
-#define __NR_getresgid (__NR_Linux + 118)
-#define __NR_getpgid (__NR_Linux + 119)
-#define __NR_setfsuid (__NR_Linux + 120)
-#define __NR_setfsgid (__NR_Linux + 121)
-#define __NR_getsid (__NR_Linux + 122)
-#define __NR_capget (__NR_Linux + 123)
-#define __NR_capset (__NR_Linux + 124)
-#define __NR_rt_sigpending (__NR_Linux + 125)
-#define __NR_rt_sigtimedwait (__NR_Linux + 126)
-#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
-#define __NR_rt_sigsuspend (__NR_Linux + 128)
-#define __NR_sigaltstack (__NR_Linux + 129)
-#define __NR_utime (__NR_Linux + 130)
-#define __NR_mknod (__NR_Linux + 131)
-#define __NR_personality (__NR_Linux + 132)
-#define __NR_ustat (__NR_Linux + 133)
-#define __NR_statfs (__NR_Linux + 134)
-#define __NR_fstatfs (__NR_Linux + 135)
-#define __NR_sysfs (__NR_Linux + 136)
-#define __NR_getpriority (__NR_Linux + 137)
-#define __NR_setpriority (__NR_Linux + 138)
-#define __NR_sched_setparam (__NR_Linux + 139)
-#define __NR_sched_getparam (__NR_Linux + 140)
-#define __NR_sched_setscheduler (__NR_Linux + 141)
-#define __NR_sched_getscheduler (__NR_Linux + 142)
-#define __NR_sched_get_priority_max (__NR_Linux + 143)
-#define __NR_sched_get_priority_min (__NR_Linux + 144)
-#define __NR_sched_rr_get_interval (__NR_Linux + 145)
-#define __NR_mlock (__NR_Linux + 146)
-#define __NR_munlock (__NR_Linux + 147)
-#define __NR_mlockall (__NR_Linux + 148)
-#define __NR_munlockall (__NR_Linux + 149)
-#define __NR_vhangup (__NR_Linux + 150)
-#define __NR_pivot_root (__NR_Linux + 151)
-#define __NR__sysctl (__NR_Linux + 152)
-#define __NR_prctl (__NR_Linux + 153)
-#define __NR_adjtimex (__NR_Linux + 154)
-#define __NR_setrlimit (__NR_Linux + 155)
-#define __NR_chroot (__NR_Linux + 156)
-#define __NR_sync (__NR_Linux + 157)
-#define __NR_acct (__NR_Linux + 158)
-#define __NR_settimeofday (__NR_Linux + 159)
-#define __NR_mount (__NR_Linux + 160)
-#define __NR_umount2 (__NR_Linux + 161)
-#define __NR_swapon (__NR_Linux + 162)
-#define __NR_swapoff (__NR_Linux + 163)
-#define __NR_reboot (__NR_Linux + 164)
-#define __NR_sethostname (__NR_Linux + 165)
-#define __NR_setdomainname (__NR_Linux + 166)
-#define __NR_create_module (__NR_Linux + 167)
-#define __NR_init_module (__NR_Linux + 168)
-#define __NR_delete_module (__NR_Linux + 169)
-#define __NR_get_kernel_syms (__NR_Linux + 170)
-#define __NR_query_module (__NR_Linux + 171)
-#define __NR_quotactl (__NR_Linux + 172)
-#define __NR_nfsservctl (__NR_Linux + 173)
-#define __NR_getpmsg (__NR_Linux + 174)
-#define __NR_putpmsg (__NR_Linux + 175)
-#define __NR_afs_syscall (__NR_Linux + 176)
-#define __NR_reserved177 (__NR_Linux + 177)
-#define __NR_gettid (__NR_Linux + 178)
-#define __NR_readahead (__NR_Linux + 179)
-#define __NR_setxattr (__NR_Linux + 180)
-#define __NR_lsetxattr (__NR_Linux + 181)
-#define __NR_fsetxattr (__NR_Linux + 182)
-#define __NR_getxattr (__NR_Linux + 183)
-#define __NR_lgetxattr (__NR_Linux + 184)
-#define __NR_fgetxattr (__NR_Linux + 185)
-#define __NR_listxattr (__NR_Linux + 186)
-#define __NR_llistxattr (__NR_Linux + 187)
-#define __NR_flistxattr (__NR_Linux + 188)
-#define __NR_removexattr (__NR_Linux + 189)
-#define __NR_lremovexattr (__NR_Linux + 190)
-#define __NR_fremovexattr (__NR_Linux + 191)
-#define __NR_tkill (__NR_Linux + 192)
-#define __NR_reserved193 (__NR_Linux + 193)
-#define __NR_futex (__NR_Linux + 194)
-#define __NR_sched_setaffinity (__NR_Linux + 195)
-#define __NR_sched_getaffinity (__NR_Linux + 196)
-#define __NR_cacheflush (__NR_Linux + 197)
-#define __NR_cachectl (__NR_Linux + 198)
-#define __NR_sysmips (__NR_Linux + 199)
-#define __NR_io_setup (__NR_Linux + 200)
-#define __NR_io_destroy (__NR_Linux + 201)
-#define __NR_io_getevents (__NR_Linux + 202)
-#define __NR_io_submit (__NR_Linux + 203)
-#define __NR_io_cancel (__NR_Linux + 204)
-#define __NR_exit_group (__NR_Linux + 205)
-#define __NR_lookup_dcookie (__NR_Linux + 206)
-#define __NR_epoll_create (__NR_Linux + 207)
-#define __NR_epoll_ctl (__NR_Linux + 208)
-#define __NR_epoll_wait (__NR_Linux + 209)
-#define __NR_remap_file_pages (__NR_Linux + 210)
-#define __NR_rt_sigreturn (__NR_Linux + 211)
-#define __NR_set_tid_address (__NR_Linux + 212)
-#define __NR_restart_syscall (__NR_Linux + 213)
-#define __NR_semtimedop (__NR_Linux + 214)
-#define __NR_fadvise64 (__NR_Linux + 215)
-#define __NR_timer_create (__NR_Linux + 216)
-#define __NR_timer_settime (__NR_Linux + 217)
-#define __NR_timer_gettime (__NR_Linux + 218)
-#define __NR_timer_getoverrun (__NR_Linux + 219)
-#define __NR_timer_delete (__NR_Linux + 220)
-#define __NR_clock_settime (__NR_Linux + 221)
-#define __NR_clock_gettime (__NR_Linux + 222)
-#define __NR_clock_getres (__NR_Linux + 223)
-#define __NR_clock_nanosleep (__NR_Linux + 224)
-#define __NR_tgkill (__NR_Linux + 225)
-#define __NR_utimes (__NR_Linux + 226)
-#define __NR_mbind (__NR_Linux + 227)
-#define __NR_get_mempolicy (__NR_Linux + 228)
-#define __NR_set_mempolicy (__NR_Linux + 229)
-#define __NR_mq_open (__NR_Linux + 230)
-#define __NR_mq_unlink (__NR_Linux + 231)
-#define __NR_mq_timedsend (__NR_Linux + 232)
-#define __NR_mq_timedreceive (__NR_Linux + 233)
-#define __NR_mq_notify (__NR_Linux + 234)
-#define __NR_mq_getsetattr (__NR_Linux + 235)
-#define __NR_vserver (__NR_Linux + 236)
-#define __NR_waitid (__NR_Linux + 237)
-#define __NR_add_key (__NR_Linux + 239)
-#define __NR_request_key (__NR_Linux + 240)
-#define __NR_keyctl (__NR_Linux + 241)
-#define __NR_set_thread_area (__NR_Linux + 242)
-#define __NR_inotify_init (__NR_Linux + 243)
-#define __NR_inotify_add_watch (__NR_Linux + 244)
-#define __NR_inotify_rm_watch (__NR_Linux + 245)
-#define __NR_migrate_pages (__NR_Linux + 246)
-#define __NR_openat (__NR_Linux + 247)
-#define __NR_mkdirat (__NR_Linux + 248)
-#define __NR_mknodat (__NR_Linux + 249)
-#define __NR_fchownat (__NR_Linux + 250)
-#define __NR_futimesat (__NR_Linux + 251)
-#define __NR_newfstatat (__NR_Linux + 252)
-#define __NR_unlinkat (__NR_Linux + 253)
-#define __NR_renameat (__NR_Linux + 254)
-#define __NR_linkat (__NR_Linux + 255)
-#define __NR_symlinkat (__NR_Linux + 256)
-#define __NR_readlinkat (__NR_Linux + 257)
-#define __NR_fchmodat (__NR_Linux + 258)
-#define __NR_faccessat (__NR_Linux + 259)
-#define __NR_pselect6 (__NR_Linux + 260)
-#define __NR_ppoll (__NR_Linux + 261)
-#define __NR_unshare (__NR_Linux + 262)
-#define __NR_splice (__NR_Linux + 263)
-#define __NR_sync_file_range (__NR_Linux + 264)
-#define __NR_tee (__NR_Linux + 265)
-#define __NR_vmsplice (__NR_Linux + 266)
-#define __NR_move_pages (__NR_Linux + 267)
-#define __NR_set_robust_list (__NR_Linux + 268)
-#define __NR_get_robust_list (__NR_Linux + 269)
-#define __NR_kexec_load (__NR_Linux + 270)
-#define __NR_getcpu (__NR_Linux + 271)
-#define __NR_epoll_pwait (__NR_Linux + 272)
-#define __NR_ioprio_set (__NR_Linux + 273)
-#define __NR_ioprio_get (__NR_Linux + 274)
-#define __NR_utimensat (__NR_Linux + 275)
-#define __NR_signalfd (__NR_Linux + 276)
-#define __NR_timerfd (__NR_Linux + 277)
-#define __NR_eventfd (__NR_Linux + 278)
-#define __NR_fallocate (__NR_Linux + 279)
-#define __NR_timerfd_create (__NR_Linux + 280)
-#define __NR_timerfd_gettime (__NR_Linux + 281)
-#define __NR_timerfd_settime (__NR_Linux + 282)
-#define __NR_signalfd4 (__NR_Linux + 283)
-#define __NR_eventfd2 (__NR_Linux + 284)
-#define __NR_epoll_create1 (__NR_Linux + 285)
-#define __NR_dup3 (__NR_Linux + 286)
-#define __NR_pipe2 (__NR_Linux + 287)
-#define __NR_inotify_init1 (__NR_Linux + 288)
-#define __NR_preadv (__NR_Linux + 289)
-#define __NR_pwritev (__NR_Linux + 290)
-#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
-#define __NR_perf_event_open (__NR_Linux + 292)
-#define __NR_accept4 (__NR_Linux + 293)
-#define __NR_recvmmsg (__NR_Linux + 294)
-#define __NR_fanotify_init (__NR_Linux + 295)
-#define __NR_fanotify_mark (__NR_Linux + 296)
-#define __NR_prlimit64 (__NR_Linux + 297)
-#define __NR_name_to_handle_at (__NR_Linux + 298)
-#define __NR_open_by_handle_at (__NR_Linux + 299)
-#define __NR_clock_adjtime (__NR_Linux + 300)
-#define __NR_syncfs (__NR_Linux + 301)
-#define __NR_sendmmsg (__NR_Linux + 302)
-#define __NR_setns (__NR_Linux + 303)
-#define __NR_process_vm_readv (__NR_Linux + 304)
-#define __NR_process_vm_writev (__NR_Linux + 305)
-#define __NR_kcmp (__NR_Linux + 306)
-#define __NR_finit_module (__NR_Linux + 307)
-#define __NR_getdents64 (__NR_Linux + 308)
-#define __NR_sched_setattr (__NR_Linux + 309)
-#define __NR_sched_getattr (__NR_Linux + 310)
-#define __NR_renameat2 (__NR_Linux + 311)
-#define __NR_seccomp (__NR_Linux + 312)
-#define __NR_getrandom (__NR_Linux + 313)
-#define __NR_memfd_create (__NR_Linux + 314)
-#define __NR_bpf (__NR_Linux + 315)
-#define __NR_execveat (__NR_Linux + 316)
-#define __NR_userfaultfd (__NR_Linux + 317)
-#define __NR_membarrier (__NR_Linux + 318)
-#define __NR_mlock2 (__NR_Linux + 319)
-#define __NR_copy_file_range (__NR_Linux + 320)
-#define __NR_preadv2 (__NR_Linux + 321)
-#define __NR_pwritev2 (__NR_Linux + 322)
-#define __NR_pkey_mprotect (__NR_Linux + 323)
-#define __NR_pkey_alloc (__NR_Linux + 324)
-#define __NR_pkey_free (__NR_Linux + 325)
-#define __NR_statx (__NR_Linux + 326)
-#define __NR_rseq (__NR_Linux + 327)
-#define __NR_io_pgetevents (__NR_Linux + 328)
-#define __NR_Linux_syscalls 328
+#include <asm/unistd_n64.h>
 #endif
-#define __NR_64_Linux 5000
-#define __NR_64_Linux_syscalls 328
 #if _MIPS_SIM == _MIPS_SIM_NABI32
 #define __NR_Linux 6000
-#define __NR_read (__NR_Linux + 0)
-#define __NR_write (__NR_Linux + 1)
-#define __NR_open (__NR_Linux + 2)
-#define __NR_close (__NR_Linux + 3)
-#define __NR_stat (__NR_Linux + 4)
-#define __NR_fstat (__NR_Linux + 5)
-#define __NR_lstat (__NR_Linux + 6)
-#define __NR_poll (__NR_Linux + 7)
-#define __NR_lseek (__NR_Linux + 8)
-#define __NR_mmap (__NR_Linux + 9)
-#define __NR_mprotect (__NR_Linux + 10)
-#define __NR_munmap (__NR_Linux + 11)
-#define __NR_brk (__NR_Linux + 12)
-#define __NR_rt_sigaction (__NR_Linux + 13)
-#define __NR_rt_sigprocmask (__NR_Linux + 14)
-#define __NR_ioctl (__NR_Linux + 15)
-#define __NR_pread64 (__NR_Linux + 16)
-#define __NR_pwrite64 (__NR_Linux + 17)
-#define __NR_readv (__NR_Linux + 18)
-#define __NR_writev (__NR_Linux + 19)
-#define __NR_access (__NR_Linux + 20)
-#define __NR_pipe (__NR_Linux + 21)
-#define __NR__newselect (__NR_Linux + 22)
-#define __NR_sched_yield (__NR_Linux + 23)
-#define __NR_mremap (__NR_Linux + 24)
-#define __NR_msync (__NR_Linux + 25)
-#define __NR_mincore (__NR_Linux + 26)
-#define __NR_madvise (__NR_Linux + 27)
-#define __NR_shmget (__NR_Linux + 28)
-#define __NR_shmat (__NR_Linux + 29)
-#define __NR_shmctl (__NR_Linux + 30)
-#define __NR_dup (__NR_Linux + 31)
-#define __NR_dup2 (__NR_Linux + 32)
-#define __NR_pause (__NR_Linux + 33)
-#define __NR_nanosleep (__NR_Linux + 34)
-#define __NR_getitimer (__NR_Linux + 35)
-#define __NR_setitimer (__NR_Linux + 36)
-#define __NR_alarm (__NR_Linux + 37)
-#define __NR_getpid (__NR_Linux + 38)
-#define __NR_sendfile (__NR_Linux + 39)
-#define __NR_socket (__NR_Linux + 40)
-#define __NR_connect (__NR_Linux + 41)
-#define __NR_accept (__NR_Linux + 42)
-#define __NR_sendto (__NR_Linux + 43)
-#define __NR_recvfrom (__NR_Linux + 44)
-#define __NR_sendmsg (__NR_Linux + 45)
-#define __NR_recvmsg (__NR_Linux + 46)
-#define __NR_shutdown (__NR_Linux + 47)
-#define __NR_bind (__NR_Linux + 48)
-#define __NR_listen (__NR_Linux + 49)
-#define __NR_getsockname (__NR_Linux + 50)
-#define __NR_getpeername (__NR_Linux + 51)
-#define __NR_socketpair (__NR_Linux + 52)
-#define __NR_setsockopt (__NR_Linux + 53)
-#define __NR_getsockopt (__NR_Linux + 54)
-#define __NR_clone (__NR_Linux + 55)
-#define __NR_fork (__NR_Linux + 56)
-#define __NR_execve (__NR_Linux + 57)
-#define __NR_exit (__NR_Linux + 58)
-#define __NR_wait4 (__NR_Linux + 59)
-#define __NR_kill (__NR_Linux + 60)
-#define __NR_uname (__NR_Linux + 61)
-#define __NR_semget (__NR_Linux + 62)
-#define __NR_semop (__NR_Linux + 63)
-#define __NR_semctl (__NR_Linux + 64)
-#define __NR_shmdt (__NR_Linux + 65)
-#define __NR_msgget (__NR_Linux + 66)
-#define __NR_msgsnd (__NR_Linux + 67)
-#define __NR_msgrcv (__NR_Linux + 68)
-#define __NR_msgctl (__NR_Linux + 69)
-#define __NR_fcntl (__NR_Linux + 70)
-#define __NR_flock (__NR_Linux + 71)
-#define __NR_fsync (__NR_Linux + 72)
-#define __NR_fdatasync (__NR_Linux + 73)
-#define __NR_truncate (__NR_Linux + 74)
-#define __NR_ftruncate (__NR_Linux + 75)
-#define __NR_getdents (__NR_Linux + 76)
-#define __NR_getcwd (__NR_Linux + 77)
-#define __NR_chdir (__NR_Linux + 78)
-#define __NR_fchdir (__NR_Linux + 79)
-#define __NR_rename (__NR_Linux + 80)
-#define __NR_mkdir (__NR_Linux + 81)
-#define __NR_rmdir (__NR_Linux + 82)
-#define __NR_creat (__NR_Linux + 83)
-#define __NR_link (__NR_Linux + 84)
-#define __NR_unlink (__NR_Linux + 85)
-#define __NR_symlink (__NR_Linux + 86)
-#define __NR_readlink (__NR_Linux + 87)
-#define __NR_chmod (__NR_Linux + 88)
-#define __NR_fchmod (__NR_Linux + 89)
-#define __NR_chown (__NR_Linux + 90)
-#define __NR_fchown (__NR_Linux + 91)
-#define __NR_lchown (__NR_Linux + 92)
-#define __NR_umask (__NR_Linux + 93)
-#define __NR_gettimeofday (__NR_Linux + 94)
-#define __NR_getrlimit (__NR_Linux + 95)
-#define __NR_getrusage (__NR_Linux + 96)
-#define __NR_sysinfo (__NR_Linux + 97)
-#define __NR_times (__NR_Linux + 98)
-#define __NR_ptrace (__NR_Linux + 99)
-#define __NR_getuid (__NR_Linux + 100)
-#define __NR_syslog (__NR_Linux + 101)
-#define __NR_getgid (__NR_Linux + 102)
-#define __NR_setuid (__NR_Linux + 103)
-#define __NR_setgid (__NR_Linux + 104)
-#define __NR_geteuid (__NR_Linux + 105)
-#define __NR_getegid (__NR_Linux + 106)
-#define __NR_setpgid (__NR_Linux + 107)
-#define __NR_getppid (__NR_Linux + 108)
-#define __NR_getpgrp (__NR_Linux + 109)
-#define __NR_setsid (__NR_Linux + 110)
-#define __NR_setreuid (__NR_Linux + 111)
-#define __NR_setregid (__NR_Linux + 112)
-#define __NR_getgroups (__NR_Linux + 113)
-#define __NR_setgroups (__NR_Linux + 114)
-#define __NR_setresuid (__NR_Linux + 115)
-#define __NR_getresuid (__NR_Linux + 116)
-#define __NR_setresgid (__NR_Linux + 117)
-#define __NR_getresgid (__NR_Linux + 118)
-#define __NR_getpgid (__NR_Linux + 119)
-#define __NR_setfsuid (__NR_Linux + 120)
-#define __NR_setfsgid (__NR_Linux + 121)
-#define __NR_getsid (__NR_Linux + 122)
-#define __NR_capget (__NR_Linux + 123)
-#define __NR_capset (__NR_Linux + 124)
-#define __NR_rt_sigpending (__NR_Linux + 125)
-#define __NR_rt_sigtimedwait (__NR_Linux + 126)
-#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
-#define __NR_rt_sigsuspend (__NR_Linux + 128)
-#define __NR_sigaltstack (__NR_Linux + 129)
-#define __NR_utime (__NR_Linux + 130)
-#define __NR_mknod (__NR_Linux + 131)
-#define __NR_personality (__NR_Linux + 132)
-#define __NR_ustat (__NR_Linux + 133)
-#define __NR_statfs (__NR_Linux + 134)
-#define __NR_fstatfs (__NR_Linux + 135)
-#define __NR_sysfs (__NR_Linux + 136)
-#define __NR_getpriority (__NR_Linux + 137)
-#define __NR_setpriority (__NR_Linux + 138)
-#define __NR_sched_setparam (__NR_Linux + 139)
-#define __NR_sched_getparam (__NR_Linux + 140)
-#define __NR_sched_setscheduler (__NR_Linux + 141)
-#define __NR_sched_getscheduler (__NR_Linux + 142)
-#define __NR_sched_get_priority_max (__NR_Linux + 143)
-#define __NR_sched_get_priority_min (__NR_Linux + 144)
-#define __NR_sched_rr_get_interval (__NR_Linux + 145)
-#define __NR_mlock (__NR_Linux + 146)
-#define __NR_munlock (__NR_Linux + 147)
-#define __NR_mlockall (__NR_Linux + 148)
-#define __NR_munlockall (__NR_Linux + 149)
-#define __NR_vhangup (__NR_Linux + 150)
-#define __NR_pivot_root (__NR_Linux + 151)
-#define __NR__sysctl (__NR_Linux + 152)
-#define __NR_prctl (__NR_Linux + 153)
-#define __NR_adjtimex (__NR_Linux + 154)
-#define __NR_setrlimit (__NR_Linux + 155)
-#define __NR_chroot (__NR_Linux + 156)
-#define __NR_sync (__NR_Linux + 157)
-#define __NR_acct (__NR_Linux + 158)
-#define __NR_settimeofday (__NR_Linux + 159)
-#define __NR_mount (__NR_Linux + 160)
-#define __NR_umount2 (__NR_Linux + 161)
-#define __NR_swapon (__NR_Linux + 162)
-#define __NR_swapoff (__NR_Linux + 163)
-#define __NR_reboot (__NR_Linux + 164)
-#define __NR_sethostname (__NR_Linux + 165)
-#define __NR_setdomainname (__NR_Linux + 166)
-#define __NR_create_module (__NR_Linux + 167)
-#define __NR_init_module (__NR_Linux + 168)
-#define __NR_delete_module (__NR_Linux + 169)
-#define __NR_get_kernel_syms (__NR_Linux + 170)
-#define __NR_query_module (__NR_Linux + 171)
-#define __NR_quotactl (__NR_Linux + 172)
-#define __NR_nfsservctl (__NR_Linux + 173)
-#define __NR_getpmsg (__NR_Linux + 174)
-#define __NR_putpmsg (__NR_Linux + 175)
-#define __NR_afs_syscall (__NR_Linux + 176)
-#define __NR_reserved177 (__NR_Linux + 177)
-#define __NR_gettid (__NR_Linux + 178)
-#define __NR_readahead (__NR_Linux + 179)
-#define __NR_setxattr (__NR_Linux + 180)
-#define __NR_lsetxattr (__NR_Linux + 181)
-#define __NR_fsetxattr (__NR_Linux + 182)
-#define __NR_getxattr (__NR_Linux + 183)
-#define __NR_lgetxattr (__NR_Linux + 184)
-#define __NR_fgetxattr (__NR_Linux + 185)
-#define __NR_listxattr (__NR_Linux + 186)
-#define __NR_llistxattr (__NR_Linux + 187)
-#define __NR_flistxattr (__NR_Linux + 188)
-#define __NR_removexattr (__NR_Linux + 189)
-#define __NR_lremovexattr (__NR_Linux + 190)
-#define __NR_fremovexattr (__NR_Linux + 191)
-#define __NR_tkill (__NR_Linux + 192)
-#define __NR_reserved193 (__NR_Linux + 193)
-#define __NR_futex (__NR_Linux + 194)
-#define __NR_sched_setaffinity (__NR_Linux + 195)
-#define __NR_sched_getaffinity (__NR_Linux + 196)
-#define __NR_cacheflush (__NR_Linux + 197)
-#define __NR_cachectl (__NR_Linux + 198)
-#define __NR_sysmips (__NR_Linux + 199)
-#define __NR_io_setup (__NR_Linux + 200)
-#define __NR_io_destroy (__NR_Linux + 201)
-#define __NR_io_getevents (__NR_Linux + 202)
-#define __NR_io_submit (__NR_Linux + 203)
-#define __NR_io_cancel (__NR_Linux + 204)
-#define __NR_exit_group (__NR_Linux + 205)
-#define __NR_lookup_dcookie (__NR_Linux + 206)
-#define __NR_epoll_create (__NR_Linux + 207)
-#define __NR_epoll_ctl (__NR_Linux + 208)
-#define __NR_epoll_wait (__NR_Linux + 209)
-#define __NR_remap_file_pages (__NR_Linux + 210)
-#define __NR_rt_sigreturn (__NR_Linux + 211)
-#define __NR_fcntl64 (__NR_Linux + 212)
-#define __NR_set_tid_address (__NR_Linux + 213)
-#define __NR_restart_syscall (__NR_Linux + 214)
-#define __NR_semtimedop (__NR_Linux + 215)
-#define __NR_fadvise64 (__NR_Linux + 216)
-#define __NR_statfs64 (__NR_Linux + 217)
-#define __NR_fstatfs64 (__NR_Linux + 218)
-#define __NR_sendfile64 (__NR_Linux + 219)
-#define __NR_timer_create (__NR_Linux + 220)
-#define __NR_timer_settime (__NR_Linux + 221)
-#define __NR_timer_gettime (__NR_Linux + 222)
-#define __NR_timer_getoverrun (__NR_Linux + 223)
-#define __NR_timer_delete (__NR_Linux + 224)
-#define __NR_clock_settime (__NR_Linux + 225)
-#define __NR_clock_gettime (__NR_Linux + 226)
-#define __NR_clock_getres (__NR_Linux + 227)
-#define __NR_clock_nanosleep (__NR_Linux + 228)
-#define __NR_tgkill (__NR_Linux + 229)
-#define __NR_utimes (__NR_Linux + 230)
-#define __NR_mbind (__NR_Linux + 231)
-#define __NR_get_mempolicy (__NR_Linux + 232)
-#define __NR_set_mempolicy (__NR_Linux + 233)
-#define __NR_mq_open (__NR_Linux + 234)
-#define __NR_mq_unlink (__NR_Linux + 235)
-#define __NR_mq_timedsend (__NR_Linux + 236)
-#define __NR_mq_timedreceive (__NR_Linux + 237)
-#define __NR_mq_notify (__NR_Linux + 238)
-#define __NR_mq_getsetattr (__NR_Linux + 239)
-#define __NR_vserver (__NR_Linux + 240)
-#define __NR_waitid (__NR_Linux + 241)
-#define __NR_add_key (__NR_Linux + 243)
-#define __NR_request_key (__NR_Linux + 244)
-#define __NR_keyctl (__NR_Linux + 245)
-#define __NR_set_thread_area (__NR_Linux + 246)
-#define __NR_inotify_init (__NR_Linux + 247)
-#define __NR_inotify_add_watch (__NR_Linux + 248)
-#define __NR_inotify_rm_watch (__NR_Linux + 249)
-#define __NR_migrate_pages (__NR_Linux + 250)
-#define __NR_openat (__NR_Linux + 251)
-#define __NR_mkdirat (__NR_Linux + 252)
-#define __NR_mknodat (__NR_Linux + 253)
-#define __NR_fchownat (__NR_Linux + 254)
-#define __NR_futimesat (__NR_Linux + 255)
-#define __NR_newfstatat (__NR_Linux + 256)
-#define __NR_unlinkat (__NR_Linux + 257)
-#define __NR_renameat (__NR_Linux + 258)
-#define __NR_linkat (__NR_Linux + 259)
-#define __NR_symlinkat (__NR_Linux + 260)
-#define __NR_readlinkat (__NR_Linux + 261)
-#define __NR_fchmodat (__NR_Linux + 262)
-#define __NR_faccessat (__NR_Linux + 263)
-#define __NR_pselect6 (__NR_Linux + 264)
-#define __NR_ppoll (__NR_Linux + 265)
-#define __NR_unshare (__NR_Linux + 266)
-#define __NR_splice (__NR_Linux + 267)
-#define __NR_sync_file_range (__NR_Linux + 268)
-#define __NR_tee (__NR_Linux + 269)
-#define __NR_vmsplice (__NR_Linux + 270)
-#define __NR_move_pages (__NR_Linux + 271)
-#define __NR_set_robust_list (__NR_Linux + 272)
-#define __NR_get_robust_list (__NR_Linux + 273)
-#define __NR_kexec_load (__NR_Linux + 274)
-#define __NR_getcpu (__NR_Linux + 275)
-#define __NR_epoll_pwait (__NR_Linux + 276)
-#define __NR_ioprio_set (__NR_Linux + 277)
-#define __NR_ioprio_get (__NR_Linux + 278)
-#define __NR_utimensat (__NR_Linux + 279)
-#define __NR_signalfd (__NR_Linux + 280)
-#define __NR_timerfd (__NR_Linux + 281)
-#define __NR_eventfd (__NR_Linux + 282)
-#define __NR_fallocate (__NR_Linux + 283)
-#define __NR_timerfd_create (__NR_Linux + 284)
-#define __NR_timerfd_gettime (__NR_Linux + 285)
-#define __NR_timerfd_settime (__NR_Linux + 286)
-#define __NR_signalfd4 (__NR_Linux + 287)
-#define __NR_eventfd2 (__NR_Linux + 288)
-#define __NR_epoll_create1 (__NR_Linux + 289)
-#define __NR_dup3 (__NR_Linux + 290)
-#define __NR_pipe2 (__NR_Linux + 291)
-#define __NR_inotify_init1 (__NR_Linux + 292)
-#define __NR_preadv (__NR_Linux + 293)
-#define __NR_pwritev (__NR_Linux + 294)
-#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
-#define __NR_perf_event_open (__NR_Linux + 296)
-#define __NR_accept4 (__NR_Linux + 297)
-#define __NR_recvmmsg (__NR_Linux + 298)
-#define __NR_getdents64 (__NR_Linux + 299)
-#define __NR_fanotify_init (__NR_Linux + 300)
-#define __NR_fanotify_mark (__NR_Linux + 301)
-#define __NR_prlimit64 (__NR_Linux + 302)
-#define __NR_name_to_handle_at (__NR_Linux + 303)
-#define __NR_open_by_handle_at (__NR_Linux + 304)
-#define __NR_clock_adjtime (__NR_Linux + 305)
-#define __NR_syncfs (__NR_Linux + 306)
-#define __NR_sendmmsg (__NR_Linux + 307)
-#define __NR_setns (__NR_Linux + 308)
-#define __NR_process_vm_readv (__NR_Linux + 309)
-#define __NR_process_vm_writev (__NR_Linux + 310)
-#define __NR_kcmp (__NR_Linux + 311)
-#define __NR_finit_module (__NR_Linux + 312)
-#define __NR_sched_setattr (__NR_Linux + 313)
-#define __NR_sched_getattr (__NR_Linux + 314)
-#define __NR_renameat2 (__NR_Linux + 315)
-#define __NR_seccomp (__NR_Linux + 316)
-#define __NR_getrandom (__NR_Linux + 317)
-#define __NR_memfd_create (__NR_Linux + 318)
-#define __NR_bpf (__NR_Linux + 319)
-#define __NR_execveat (__NR_Linux + 320)
-#define __NR_userfaultfd (__NR_Linux + 321)
-#define __NR_membarrier (__NR_Linux + 322)
-#define __NR_mlock2 (__NR_Linux + 323)
-#define __NR_copy_file_range (__NR_Linux + 324)
-#define __NR_preadv2 (__NR_Linux + 325)
-#define __NR_pwritev2 (__NR_Linux + 326)
-#define __NR_pkey_mprotect (__NR_Linux + 327)
-#define __NR_pkey_alloc (__NR_Linux + 328)
-#define __NR_pkey_free (__NR_Linux + 329)
-#define __NR_statx (__NR_Linux + 330)
-#define __NR_rseq (__NR_Linux + 331)
-#define __NR_io_pgetevents (__NR_Linux + 332)
-#define __NR_Linux_syscalls 332
+#include <asm/unistd_n32.h>
 #endif
-#define __NR_N32_Linux 6000
-#define __NR_N32_Linux_syscalls 332
 #endif
diff --git a/libc/kernel/uapi/asm-mips/asm/unistd_n32.h b/libc/kernel/uapi/asm-mips/asm/unistd_n32.h
new file mode 100644
index 0000000..a72d9d2
--- /dev/null
+++ b/libc/kernel/uapi/asm-mips/asm/unistd_n32.h
@@ -0,0 +1,353 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_ASM_MIPS_UNISTD_N32_H
+#define _UAPI_ASM_MIPS_UNISTD_N32_H
+#define __NR_read (__NR_Linux + 0)
+#define __NR_write (__NR_Linux + 1)
+#define __NR_open (__NR_Linux + 2)
+#define __NR_close (__NR_Linux + 3)
+#define __NR_stat (__NR_Linux + 4)
+#define __NR_fstat (__NR_Linux + 5)
+#define __NR_lstat (__NR_Linux + 6)
+#define __NR_poll (__NR_Linux + 7)
+#define __NR_lseek (__NR_Linux + 8)
+#define __NR_mmap (__NR_Linux + 9)
+#define __NR_mprotect (__NR_Linux + 10)
+#define __NR_munmap (__NR_Linux + 11)
+#define __NR_brk (__NR_Linux + 12)
+#define __NR_rt_sigaction (__NR_Linux + 13)
+#define __NR_rt_sigprocmask (__NR_Linux + 14)
+#define __NR_ioctl (__NR_Linux + 15)
+#define __NR_pread64 (__NR_Linux + 16)
+#define __NR_pwrite64 (__NR_Linux + 17)
+#define __NR_readv (__NR_Linux + 18)
+#define __NR_writev (__NR_Linux + 19)
+#define __NR_access (__NR_Linux + 20)
+#define __NR_pipe (__NR_Linux + 21)
+#define __NR__newselect (__NR_Linux + 22)
+#define __NR_sched_yield (__NR_Linux + 23)
+#define __NR_mremap (__NR_Linux + 24)
+#define __NR_msync (__NR_Linux + 25)
+#define __NR_mincore (__NR_Linux + 26)
+#define __NR_madvise (__NR_Linux + 27)
+#define __NR_shmget (__NR_Linux + 28)
+#define __NR_shmat (__NR_Linux + 29)
+#define __NR_shmctl (__NR_Linux + 30)
+#define __NR_dup (__NR_Linux + 31)
+#define __NR_dup2 (__NR_Linux + 32)
+#define __NR_pause (__NR_Linux + 33)
+#define __NR_nanosleep (__NR_Linux + 34)
+#define __NR_getitimer (__NR_Linux + 35)
+#define __NR_setitimer (__NR_Linux + 36)
+#define __NR_alarm (__NR_Linux + 37)
+#define __NR_getpid (__NR_Linux + 38)
+#define __NR_sendfile (__NR_Linux + 39)
+#define __NR_socket (__NR_Linux + 40)
+#define __NR_connect (__NR_Linux + 41)
+#define __NR_accept (__NR_Linux + 42)
+#define __NR_sendto (__NR_Linux + 43)
+#define __NR_recvfrom (__NR_Linux + 44)
+#define __NR_sendmsg (__NR_Linux + 45)
+#define __NR_recvmsg (__NR_Linux + 46)
+#define __NR_shutdown (__NR_Linux + 47)
+#define __NR_bind (__NR_Linux + 48)
+#define __NR_listen (__NR_Linux + 49)
+#define __NR_getsockname (__NR_Linux + 50)
+#define __NR_getpeername (__NR_Linux + 51)
+#define __NR_socketpair (__NR_Linux + 52)
+#define __NR_setsockopt (__NR_Linux + 53)
+#define __NR_getsockopt (__NR_Linux + 54)
+#define __NR_clone (__NR_Linux + 55)
+#define __NR_fork (__NR_Linux + 56)
+#define __NR_execve (__NR_Linux + 57)
+#define __NR_exit (__NR_Linux + 58)
+#define __NR_wait4 (__NR_Linux + 59)
+#define __NR_kill (__NR_Linux + 60)
+#define __NR_uname (__NR_Linux + 61)
+#define __NR_semget (__NR_Linux + 62)
+#define __NR_semop (__NR_Linux + 63)
+#define __NR_semctl (__NR_Linux + 64)
+#define __NR_shmdt (__NR_Linux + 65)
+#define __NR_msgget (__NR_Linux + 66)
+#define __NR_msgsnd (__NR_Linux + 67)
+#define __NR_msgrcv (__NR_Linux + 68)
+#define __NR_msgctl (__NR_Linux + 69)
+#define __NR_fcntl (__NR_Linux + 70)
+#define __NR_flock (__NR_Linux + 71)
+#define __NR_fsync (__NR_Linux + 72)
+#define __NR_fdatasync (__NR_Linux + 73)
+#define __NR_truncate (__NR_Linux + 74)
+#define __NR_ftruncate (__NR_Linux + 75)
+#define __NR_getdents (__NR_Linux + 76)
+#define __NR_getcwd (__NR_Linux + 77)
+#define __NR_chdir (__NR_Linux + 78)
+#define __NR_fchdir (__NR_Linux + 79)
+#define __NR_rename (__NR_Linux + 80)
+#define __NR_mkdir (__NR_Linux + 81)
+#define __NR_rmdir (__NR_Linux + 82)
+#define __NR_creat (__NR_Linux + 83)
+#define __NR_link (__NR_Linux + 84)
+#define __NR_unlink (__NR_Linux + 85)
+#define __NR_symlink (__NR_Linux + 86)
+#define __NR_readlink (__NR_Linux + 87)
+#define __NR_chmod (__NR_Linux + 88)
+#define __NR_fchmod (__NR_Linux + 89)
+#define __NR_chown (__NR_Linux + 90)
+#define __NR_fchown (__NR_Linux + 91)
+#define __NR_lchown (__NR_Linux + 92)
+#define __NR_umask (__NR_Linux + 93)
+#define __NR_gettimeofday (__NR_Linux + 94)
+#define __NR_getrlimit (__NR_Linux + 95)
+#define __NR_getrusage (__NR_Linux + 96)
+#define __NR_sysinfo (__NR_Linux + 97)
+#define __NR_times (__NR_Linux + 98)
+#define __NR_ptrace (__NR_Linux + 99)
+#define __NR_getuid (__NR_Linux + 100)
+#define __NR_syslog (__NR_Linux + 101)
+#define __NR_getgid (__NR_Linux + 102)
+#define __NR_setuid (__NR_Linux + 103)
+#define __NR_setgid (__NR_Linux + 104)
+#define __NR_geteuid (__NR_Linux + 105)
+#define __NR_getegid (__NR_Linux + 106)
+#define __NR_setpgid (__NR_Linux + 107)
+#define __NR_getppid (__NR_Linux + 108)
+#define __NR_getpgrp (__NR_Linux + 109)
+#define __NR_setsid (__NR_Linux + 110)
+#define __NR_setreuid (__NR_Linux + 111)
+#define __NR_setregid (__NR_Linux + 112)
+#define __NR_getgroups (__NR_Linux + 113)
+#define __NR_setgroups (__NR_Linux + 114)
+#define __NR_setresuid (__NR_Linux + 115)
+#define __NR_getresuid (__NR_Linux + 116)
+#define __NR_setresgid (__NR_Linux + 117)
+#define __NR_getresgid (__NR_Linux + 118)
+#define __NR_getpgid (__NR_Linux + 119)
+#define __NR_setfsuid (__NR_Linux + 120)
+#define __NR_setfsgid (__NR_Linux + 121)
+#define __NR_getsid (__NR_Linux + 122)
+#define __NR_capget (__NR_Linux + 123)
+#define __NR_capset (__NR_Linux + 124)
+#define __NR_rt_sigpending (__NR_Linux + 125)
+#define __NR_rt_sigtimedwait (__NR_Linux + 126)
+#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
+#define __NR_rt_sigsuspend (__NR_Linux + 128)
+#define __NR_sigaltstack (__NR_Linux + 129)
+#define __NR_utime (__NR_Linux + 130)
+#define __NR_mknod (__NR_Linux + 131)
+#define __NR_personality (__NR_Linux + 132)
+#define __NR_ustat (__NR_Linux + 133)
+#define __NR_statfs (__NR_Linux + 134)
+#define __NR_fstatfs (__NR_Linux + 135)
+#define __NR_sysfs (__NR_Linux + 136)
+#define __NR_getpriority (__NR_Linux + 137)
+#define __NR_setpriority (__NR_Linux + 138)
+#define __NR_sched_setparam (__NR_Linux + 139)
+#define __NR_sched_getparam (__NR_Linux + 140)
+#define __NR_sched_setscheduler (__NR_Linux + 141)
+#define __NR_sched_getscheduler (__NR_Linux + 142)
+#define __NR_sched_get_priority_max (__NR_Linux + 143)
+#define __NR_sched_get_priority_min (__NR_Linux + 144)
+#define __NR_sched_rr_get_interval (__NR_Linux + 145)
+#define __NR_mlock (__NR_Linux + 146)
+#define __NR_munlock (__NR_Linux + 147)
+#define __NR_mlockall (__NR_Linux + 148)
+#define __NR_munlockall (__NR_Linux + 149)
+#define __NR_vhangup (__NR_Linux + 150)
+#define __NR_pivot_root (__NR_Linux + 151)
+#define __NR__sysctl (__NR_Linux + 152)
+#define __NR_prctl (__NR_Linux + 153)
+#define __NR_adjtimex (__NR_Linux + 154)
+#define __NR_setrlimit (__NR_Linux + 155)
+#define __NR_chroot (__NR_Linux + 156)
+#define __NR_sync (__NR_Linux + 157)
+#define __NR_acct (__NR_Linux + 158)
+#define __NR_settimeofday (__NR_Linux + 159)
+#define __NR_mount (__NR_Linux + 160)
+#define __NR_umount2 (__NR_Linux + 161)
+#define __NR_swapon (__NR_Linux + 162)
+#define __NR_swapoff (__NR_Linux + 163)
+#define __NR_reboot (__NR_Linux + 164)
+#define __NR_sethostname (__NR_Linux + 165)
+#define __NR_setdomainname (__NR_Linux + 166)
+#define __NR_create_module (__NR_Linux + 167)
+#define __NR_init_module (__NR_Linux + 168)
+#define __NR_delete_module (__NR_Linux + 169)
+#define __NR_get_kernel_syms (__NR_Linux + 170)
+#define __NR_query_module (__NR_Linux + 171)
+#define __NR_quotactl (__NR_Linux + 172)
+#define __NR_nfsservctl (__NR_Linux + 173)
+#define __NR_getpmsg (__NR_Linux + 174)
+#define __NR_putpmsg (__NR_Linux + 175)
+#define __NR_afs_syscall (__NR_Linux + 176)
+#define __NR_reserved177 (__NR_Linux + 177)
+#define __NR_gettid (__NR_Linux + 178)
+#define __NR_readahead (__NR_Linux + 179)
+#define __NR_setxattr (__NR_Linux + 180)
+#define __NR_lsetxattr (__NR_Linux + 181)
+#define __NR_fsetxattr (__NR_Linux + 182)
+#define __NR_getxattr (__NR_Linux + 183)
+#define __NR_lgetxattr (__NR_Linux + 184)
+#define __NR_fgetxattr (__NR_Linux + 185)
+#define __NR_listxattr (__NR_Linux + 186)
+#define __NR_llistxattr (__NR_Linux + 187)
+#define __NR_flistxattr (__NR_Linux + 188)
+#define __NR_removexattr (__NR_Linux + 189)
+#define __NR_lremovexattr (__NR_Linux + 190)
+#define __NR_fremovexattr (__NR_Linux + 191)
+#define __NR_tkill (__NR_Linux + 192)
+#define __NR_reserved193 (__NR_Linux + 193)
+#define __NR_futex (__NR_Linux + 194)
+#define __NR_sched_setaffinity (__NR_Linux + 195)
+#define __NR_sched_getaffinity (__NR_Linux + 196)
+#define __NR_cacheflush (__NR_Linux + 197)
+#define __NR_cachectl (__NR_Linux + 198)
+#define __NR_sysmips (__NR_Linux + 199)
+#define __NR_io_setup (__NR_Linux + 200)
+#define __NR_io_destroy (__NR_Linux + 201)
+#define __NR_io_getevents (__NR_Linux + 202)
+#define __NR_io_submit (__NR_Linux + 203)
+#define __NR_io_cancel (__NR_Linux + 204)
+#define __NR_exit_group (__NR_Linux + 205)
+#define __NR_lookup_dcookie (__NR_Linux + 206)
+#define __NR_epoll_create (__NR_Linux + 207)
+#define __NR_epoll_ctl (__NR_Linux + 208)
+#define __NR_epoll_wait (__NR_Linux + 209)
+#define __NR_remap_file_pages (__NR_Linux + 210)
+#define __NR_rt_sigreturn (__NR_Linux + 211)
+#define __NR_fcntl64 (__NR_Linux + 212)
+#define __NR_set_tid_address (__NR_Linux + 213)
+#define __NR_restart_syscall (__NR_Linux + 214)
+#define __NR_semtimedop (__NR_Linux + 215)
+#define __NR_fadvise64 (__NR_Linux + 216)
+#define __NR_statfs64 (__NR_Linux + 217)
+#define __NR_fstatfs64 (__NR_Linux + 218)
+#define __NR_sendfile64 (__NR_Linux + 219)
+#define __NR_timer_create (__NR_Linux + 220)
+#define __NR_timer_settime (__NR_Linux + 221)
+#define __NR_timer_gettime (__NR_Linux + 222)
+#define __NR_timer_getoverrun (__NR_Linux + 223)
+#define __NR_timer_delete (__NR_Linux + 224)
+#define __NR_clock_settime (__NR_Linux + 225)
+#define __NR_clock_gettime (__NR_Linux + 226)
+#define __NR_clock_getres (__NR_Linux + 227)
+#define __NR_clock_nanosleep (__NR_Linux + 228)
+#define __NR_tgkill (__NR_Linux + 229)
+#define __NR_utimes (__NR_Linux + 230)
+#define __NR_mbind (__NR_Linux + 231)
+#define __NR_get_mempolicy (__NR_Linux + 232)
+#define __NR_set_mempolicy (__NR_Linux + 233)
+#define __NR_mq_open (__NR_Linux + 234)
+#define __NR_mq_unlink (__NR_Linux + 235)
+#define __NR_mq_timedsend (__NR_Linux + 236)
+#define __NR_mq_timedreceive (__NR_Linux + 237)
+#define __NR_mq_notify (__NR_Linux + 238)
+#define __NR_mq_getsetattr (__NR_Linux + 239)
+#define __NR_vserver (__NR_Linux + 240)
+#define __NR_waitid (__NR_Linux + 241)
+#define __NR_add_key (__NR_Linux + 243)
+#define __NR_request_key (__NR_Linux + 244)
+#define __NR_keyctl (__NR_Linux + 245)
+#define __NR_set_thread_area (__NR_Linux + 246)
+#define __NR_inotify_init (__NR_Linux + 247)
+#define __NR_inotify_add_watch (__NR_Linux + 248)
+#define __NR_inotify_rm_watch (__NR_Linux + 249)
+#define __NR_migrate_pages (__NR_Linux + 250)
+#define __NR_openat (__NR_Linux + 251)
+#define __NR_mkdirat (__NR_Linux + 252)
+#define __NR_mknodat (__NR_Linux + 253)
+#define __NR_fchownat (__NR_Linux + 254)
+#define __NR_futimesat (__NR_Linux + 255)
+#define __NR_newfstatat (__NR_Linux + 256)
+#define __NR_unlinkat (__NR_Linux + 257)
+#define __NR_renameat (__NR_Linux + 258)
+#define __NR_linkat (__NR_Linux + 259)
+#define __NR_symlinkat (__NR_Linux + 260)
+#define __NR_readlinkat (__NR_Linux + 261)
+#define __NR_fchmodat (__NR_Linux + 262)
+#define __NR_faccessat (__NR_Linux + 263)
+#define __NR_pselect6 (__NR_Linux + 264)
+#define __NR_ppoll (__NR_Linux + 265)
+#define __NR_unshare (__NR_Linux + 266)
+#define __NR_splice (__NR_Linux + 267)
+#define __NR_sync_file_range (__NR_Linux + 268)
+#define __NR_tee (__NR_Linux + 269)
+#define __NR_vmsplice (__NR_Linux + 270)
+#define __NR_move_pages (__NR_Linux + 271)
+#define __NR_set_robust_list (__NR_Linux + 272)
+#define __NR_get_robust_list (__NR_Linux + 273)
+#define __NR_kexec_load (__NR_Linux + 274)
+#define __NR_getcpu (__NR_Linux + 275)
+#define __NR_epoll_pwait (__NR_Linux + 276)
+#define __NR_ioprio_set (__NR_Linux + 277)
+#define __NR_ioprio_get (__NR_Linux + 278)
+#define __NR_utimensat (__NR_Linux + 279)
+#define __NR_signalfd (__NR_Linux + 280)
+#define __NR_timerfd (__NR_Linux + 281)
+#define __NR_eventfd (__NR_Linux + 282)
+#define __NR_fallocate (__NR_Linux + 283)
+#define __NR_timerfd_create (__NR_Linux + 284)
+#define __NR_timerfd_gettime (__NR_Linux + 285)
+#define __NR_timerfd_settime (__NR_Linux + 286)
+#define __NR_signalfd4 (__NR_Linux + 287)
+#define __NR_eventfd2 (__NR_Linux + 288)
+#define __NR_epoll_create1 (__NR_Linux + 289)
+#define __NR_dup3 (__NR_Linux + 290)
+#define __NR_pipe2 (__NR_Linux + 291)
+#define __NR_inotify_init1 (__NR_Linux + 292)
+#define __NR_preadv (__NR_Linux + 293)
+#define __NR_pwritev (__NR_Linux + 294)
+#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
+#define __NR_perf_event_open (__NR_Linux + 296)
+#define __NR_accept4 (__NR_Linux + 297)
+#define __NR_recvmmsg (__NR_Linux + 298)
+#define __NR_getdents64 (__NR_Linux + 299)
+#define __NR_fanotify_init (__NR_Linux + 300)
+#define __NR_fanotify_mark (__NR_Linux + 301)
+#define __NR_prlimit64 (__NR_Linux + 302)
+#define __NR_name_to_handle_at (__NR_Linux + 303)
+#define __NR_open_by_handle_at (__NR_Linux + 304)
+#define __NR_clock_adjtime (__NR_Linux + 305)
+#define __NR_syncfs (__NR_Linux + 306)
+#define __NR_sendmmsg (__NR_Linux + 307)
+#define __NR_setns (__NR_Linux + 308)
+#define __NR_process_vm_readv (__NR_Linux + 309)
+#define __NR_process_vm_writev (__NR_Linux + 310)
+#define __NR_kcmp (__NR_Linux + 311)
+#define __NR_finit_module (__NR_Linux + 312)
+#define __NR_sched_setattr (__NR_Linux + 313)
+#define __NR_sched_getattr (__NR_Linux + 314)
+#define __NR_renameat2 (__NR_Linux + 315)
+#define __NR_seccomp (__NR_Linux + 316)
+#define __NR_getrandom (__NR_Linux + 317)
+#define __NR_memfd_create (__NR_Linux + 318)
+#define __NR_bpf (__NR_Linux + 319)
+#define __NR_execveat (__NR_Linux + 320)
+#define __NR_userfaultfd (__NR_Linux + 321)
+#define __NR_membarrier (__NR_Linux + 322)
+#define __NR_mlock2 (__NR_Linux + 323)
+#define __NR_copy_file_range (__NR_Linux + 324)
+#define __NR_preadv2 (__NR_Linux + 325)
+#define __NR_pwritev2 (__NR_Linux + 326)
+#define __NR_pkey_mprotect (__NR_Linux + 327)
+#define __NR_pkey_alloc (__NR_Linux + 328)
+#define __NR_pkey_free (__NR_Linux + 329)
+#define __NR_statx (__NR_Linux + 330)
+#define __NR_rseq (__NR_Linux + 331)
+#define __NR_io_pgetevents (__NR_Linux + 332)
+#endif
diff --git a/libc/kernel/uapi/asm-mips/asm/unistd_n64.h b/libc/kernel/uapi/asm-mips/asm/unistd_n64.h
new file mode 100644
index 0000000..5ea908a
--- /dev/null
+++ b/libc/kernel/uapi/asm-mips/asm/unistd_n64.h
@@ -0,0 +1,349 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_ASM_MIPS_UNISTD_N64_H
+#define _UAPI_ASM_MIPS_UNISTD_N64_H
+#define __NR_read (__NR_Linux + 0)
+#define __NR_write (__NR_Linux + 1)
+#define __NR_open (__NR_Linux + 2)
+#define __NR_close (__NR_Linux + 3)
+#define __NR_stat (__NR_Linux + 4)
+#define __NR_fstat (__NR_Linux + 5)
+#define __NR_lstat (__NR_Linux + 6)
+#define __NR_poll (__NR_Linux + 7)
+#define __NR_lseek (__NR_Linux + 8)
+#define __NR_mmap (__NR_Linux + 9)
+#define __NR_mprotect (__NR_Linux + 10)
+#define __NR_munmap (__NR_Linux + 11)
+#define __NR_brk (__NR_Linux + 12)
+#define __NR_rt_sigaction (__NR_Linux + 13)
+#define __NR_rt_sigprocmask (__NR_Linux + 14)
+#define __NR_ioctl (__NR_Linux + 15)
+#define __NR_pread64 (__NR_Linux + 16)
+#define __NR_pwrite64 (__NR_Linux + 17)
+#define __NR_readv (__NR_Linux + 18)
+#define __NR_writev (__NR_Linux + 19)
+#define __NR_access (__NR_Linux + 20)
+#define __NR_pipe (__NR_Linux + 21)
+#define __NR__newselect (__NR_Linux + 22)
+#define __NR_sched_yield (__NR_Linux + 23)
+#define __NR_mremap (__NR_Linux + 24)
+#define __NR_msync (__NR_Linux + 25)
+#define __NR_mincore (__NR_Linux + 26)
+#define __NR_madvise (__NR_Linux + 27)
+#define __NR_shmget (__NR_Linux + 28)
+#define __NR_shmat (__NR_Linux + 29)
+#define __NR_shmctl (__NR_Linux + 30)
+#define __NR_dup (__NR_Linux + 31)
+#define __NR_dup2 (__NR_Linux + 32)
+#define __NR_pause (__NR_Linux + 33)
+#define __NR_nanosleep (__NR_Linux + 34)
+#define __NR_getitimer (__NR_Linux + 35)
+#define __NR_setitimer (__NR_Linux + 36)
+#define __NR_alarm (__NR_Linux + 37)
+#define __NR_getpid (__NR_Linux + 38)
+#define __NR_sendfile (__NR_Linux + 39)
+#define __NR_socket (__NR_Linux + 40)
+#define __NR_connect (__NR_Linux + 41)
+#define __NR_accept (__NR_Linux + 42)
+#define __NR_sendto (__NR_Linux + 43)
+#define __NR_recvfrom (__NR_Linux + 44)
+#define __NR_sendmsg (__NR_Linux + 45)
+#define __NR_recvmsg (__NR_Linux + 46)
+#define __NR_shutdown (__NR_Linux + 47)
+#define __NR_bind (__NR_Linux + 48)
+#define __NR_listen (__NR_Linux + 49)
+#define __NR_getsockname (__NR_Linux + 50)
+#define __NR_getpeername (__NR_Linux + 51)
+#define __NR_socketpair (__NR_Linux + 52)
+#define __NR_setsockopt (__NR_Linux + 53)
+#define __NR_getsockopt (__NR_Linux + 54)
+#define __NR_clone (__NR_Linux + 55)
+#define __NR_fork (__NR_Linux + 56)
+#define __NR_execve (__NR_Linux + 57)
+#define __NR_exit (__NR_Linux + 58)
+#define __NR_wait4 (__NR_Linux + 59)
+#define __NR_kill (__NR_Linux + 60)
+#define __NR_uname (__NR_Linux + 61)
+#define __NR_semget (__NR_Linux + 62)
+#define __NR_semop (__NR_Linux + 63)
+#define __NR_semctl (__NR_Linux + 64)
+#define __NR_shmdt (__NR_Linux + 65)
+#define __NR_msgget (__NR_Linux + 66)
+#define __NR_msgsnd (__NR_Linux + 67)
+#define __NR_msgrcv (__NR_Linux + 68)
+#define __NR_msgctl (__NR_Linux + 69)
+#define __NR_fcntl (__NR_Linux + 70)
+#define __NR_flock (__NR_Linux + 71)
+#define __NR_fsync (__NR_Linux + 72)
+#define __NR_fdatasync (__NR_Linux + 73)
+#define __NR_truncate (__NR_Linux + 74)
+#define __NR_ftruncate (__NR_Linux + 75)
+#define __NR_getdents (__NR_Linux + 76)
+#define __NR_getcwd (__NR_Linux + 77)
+#define __NR_chdir (__NR_Linux + 78)
+#define __NR_fchdir (__NR_Linux + 79)
+#define __NR_rename (__NR_Linux + 80)
+#define __NR_mkdir (__NR_Linux + 81)
+#define __NR_rmdir (__NR_Linux + 82)
+#define __NR_creat (__NR_Linux + 83)
+#define __NR_link (__NR_Linux + 84)
+#define __NR_unlink (__NR_Linux + 85)
+#define __NR_symlink (__NR_Linux + 86)
+#define __NR_readlink (__NR_Linux + 87)
+#define __NR_chmod (__NR_Linux + 88)
+#define __NR_fchmod (__NR_Linux + 89)
+#define __NR_chown (__NR_Linux + 90)
+#define __NR_fchown (__NR_Linux + 91)
+#define __NR_lchown (__NR_Linux + 92)
+#define __NR_umask (__NR_Linux + 93)
+#define __NR_gettimeofday (__NR_Linux + 94)
+#define __NR_getrlimit (__NR_Linux + 95)
+#define __NR_getrusage (__NR_Linux + 96)
+#define __NR_sysinfo (__NR_Linux + 97)
+#define __NR_times (__NR_Linux + 98)
+#define __NR_ptrace (__NR_Linux + 99)
+#define __NR_getuid (__NR_Linux + 100)
+#define __NR_syslog (__NR_Linux + 101)
+#define __NR_getgid (__NR_Linux + 102)
+#define __NR_setuid (__NR_Linux + 103)
+#define __NR_setgid (__NR_Linux + 104)
+#define __NR_geteuid (__NR_Linux + 105)
+#define __NR_getegid (__NR_Linux + 106)
+#define __NR_setpgid (__NR_Linux + 107)
+#define __NR_getppid (__NR_Linux + 108)
+#define __NR_getpgrp (__NR_Linux + 109)
+#define __NR_setsid (__NR_Linux + 110)
+#define __NR_setreuid (__NR_Linux + 111)
+#define __NR_setregid (__NR_Linux + 112)
+#define __NR_getgroups (__NR_Linux + 113)
+#define __NR_setgroups (__NR_Linux + 114)
+#define __NR_setresuid (__NR_Linux + 115)
+#define __NR_getresuid (__NR_Linux + 116)
+#define __NR_setresgid (__NR_Linux + 117)
+#define __NR_getresgid (__NR_Linux + 118)
+#define __NR_getpgid (__NR_Linux + 119)
+#define __NR_setfsuid (__NR_Linux + 120)
+#define __NR_setfsgid (__NR_Linux + 121)
+#define __NR_getsid (__NR_Linux + 122)
+#define __NR_capget (__NR_Linux + 123)
+#define __NR_capset (__NR_Linux + 124)
+#define __NR_rt_sigpending (__NR_Linux + 125)
+#define __NR_rt_sigtimedwait (__NR_Linux + 126)
+#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
+#define __NR_rt_sigsuspend (__NR_Linux + 128)
+#define __NR_sigaltstack (__NR_Linux + 129)
+#define __NR_utime (__NR_Linux + 130)
+#define __NR_mknod (__NR_Linux + 131)
+#define __NR_personality (__NR_Linux + 132)
+#define __NR_ustat (__NR_Linux + 133)
+#define __NR_statfs (__NR_Linux + 134)
+#define __NR_fstatfs (__NR_Linux + 135)
+#define __NR_sysfs (__NR_Linux + 136)
+#define __NR_getpriority (__NR_Linux + 137)
+#define __NR_setpriority (__NR_Linux + 138)
+#define __NR_sched_setparam (__NR_Linux + 139)
+#define __NR_sched_getparam (__NR_Linux + 140)
+#define __NR_sched_setscheduler (__NR_Linux + 141)
+#define __NR_sched_getscheduler (__NR_Linux + 142)
+#define __NR_sched_get_priority_max (__NR_Linux + 143)
+#define __NR_sched_get_priority_min (__NR_Linux + 144)
+#define __NR_sched_rr_get_interval (__NR_Linux + 145)
+#define __NR_mlock (__NR_Linux + 146)
+#define __NR_munlock (__NR_Linux + 147)
+#define __NR_mlockall (__NR_Linux + 148)
+#define __NR_munlockall (__NR_Linux + 149)
+#define __NR_vhangup (__NR_Linux + 150)
+#define __NR_pivot_root (__NR_Linux + 151)
+#define __NR__sysctl (__NR_Linux + 152)
+#define __NR_prctl (__NR_Linux + 153)
+#define __NR_adjtimex (__NR_Linux + 154)
+#define __NR_setrlimit (__NR_Linux + 155)
+#define __NR_chroot (__NR_Linux + 156)
+#define __NR_sync (__NR_Linux + 157)
+#define __NR_acct (__NR_Linux + 158)
+#define __NR_settimeofday (__NR_Linux + 159)
+#define __NR_mount (__NR_Linux + 160)
+#define __NR_umount2 (__NR_Linux + 161)
+#define __NR_swapon (__NR_Linux + 162)
+#define __NR_swapoff (__NR_Linux + 163)
+#define __NR_reboot (__NR_Linux + 164)
+#define __NR_sethostname (__NR_Linux + 165)
+#define __NR_setdomainname (__NR_Linux + 166)
+#define __NR_create_module (__NR_Linux + 167)
+#define __NR_init_module (__NR_Linux + 168)
+#define __NR_delete_module (__NR_Linux + 169)
+#define __NR_get_kernel_syms (__NR_Linux + 170)
+#define __NR_query_module (__NR_Linux + 171)
+#define __NR_quotactl (__NR_Linux + 172)
+#define __NR_nfsservctl (__NR_Linux + 173)
+#define __NR_getpmsg (__NR_Linux + 174)
+#define __NR_putpmsg (__NR_Linux + 175)
+#define __NR_afs_syscall (__NR_Linux + 176)
+#define __NR_reserved177 (__NR_Linux + 177)
+#define __NR_gettid (__NR_Linux + 178)
+#define __NR_readahead (__NR_Linux + 179)
+#define __NR_setxattr (__NR_Linux + 180)
+#define __NR_lsetxattr (__NR_Linux + 181)
+#define __NR_fsetxattr (__NR_Linux + 182)
+#define __NR_getxattr (__NR_Linux + 183)
+#define __NR_lgetxattr (__NR_Linux + 184)
+#define __NR_fgetxattr (__NR_Linux + 185)
+#define __NR_listxattr (__NR_Linux + 186)
+#define __NR_llistxattr (__NR_Linux + 187)
+#define __NR_flistxattr (__NR_Linux + 188)
+#define __NR_removexattr (__NR_Linux + 189)
+#define __NR_lremovexattr (__NR_Linux + 190)
+#define __NR_fremovexattr (__NR_Linux + 191)
+#define __NR_tkill (__NR_Linux + 192)
+#define __NR_reserved193 (__NR_Linux + 193)
+#define __NR_futex (__NR_Linux + 194)
+#define __NR_sched_setaffinity (__NR_Linux + 195)
+#define __NR_sched_getaffinity (__NR_Linux + 196)
+#define __NR_cacheflush (__NR_Linux + 197)
+#define __NR_cachectl (__NR_Linux + 198)
+#define __NR_sysmips (__NR_Linux + 199)
+#define __NR_io_setup (__NR_Linux + 200)
+#define __NR_io_destroy (__NR_Linux + 201)
+#define __NR_io_getevents (__NR_Linux + 202)
+#define __NR_io_submit (__NR_Linux + 203)
+#define __NR_io_cancel (__NR_Linux + 204)
+#define __NR_exit_group (__NR_Linux + 205)
+#define __NR_lookup_dcookie (__NR_Linux + 206)
+#define __NR_epoll_create (__NR_Linux + 207)
+#define __NR_epoll_ctl (__NR_Linux + 208)
+#define __NR_epoll_wait (__NR_Linux + 209)
+#define __NR_remap_file_pages (__NR_Linux + 210)
+#define __NR_rt_sigreturn (__NR_Linux + 211)
+#define __NR_set_tid_address (__NR_Linux + 212)
+#define __NR_restart_syscall (__NR_Linux + 213)
+#define __NR_semtimedop (__NR_Linux + 214)
+#define __NR_fadvise64 (__NR_Linux + 215)
+#define __NR_timer_create (__NR_Linux + 216)
+#define __NR_timer_settime (__NR_Linux + 217)
+#define __NR_timer_gettime (__NR_Linux + 218)
+#define __NR_timer_getoverrun (__NR_Linux + 219)
+#define __NR_timer_delete (__NR_Linux + 220)
+#define __NR_clock_settime (__NR_Linux + 221)
+#define __NR_clock_gettime (__NR_Linux + 222)
+#define __NR_clock_getres (__NR_Linux + 223)
+#define __NR_clock_nanosleep (__NR_Linux + 224)
+#define __NR_tgkill (__NR_Linux + 225)
+#define __NR_utimes (__NR_Linux + 226)
+#define __NR_mbind (__NR_Linux + 227)
+#define __NR_get_mempolicy (__NR_Linux + 228)
+#define __NR_set_mempolicy (__NR_Linux + 229)
+#define __NR_mq_open (__NR_Linux + 230)
+#define __NR_mq_unlink (__NR_Linux + 231)
+#define __NR_mq_timedsend (__NR_Linux + 232)
+#define __NR_mq_timedreceive (__NR_Linux + 233)
+#define __NR_mq_notify (__NR_Linux + 234)
+#define __NR_mq_getsetattr (__NR_Linux + 235)
+#define __NR_vserver (__NR_Linux + 236)
+#define __NR_waitid (__NR_Linux + 237)
+#define __NR_add_key (__NR_Linux + 239)
+#define __NR_request_key (__NR_Linux + 240)
+#define __NR_keyctl (__NR_Linux + 241)
+#define __NR_set_thread_area (__NR_Linux + 242)
+#define __NR_inotify_init (__NR_Linux + 243)
+#define __NR_inotify_add_watch (__NR_Linux + 244)
+#define __NR_inotify_rm_watch (__NR_Linux + 245)
+#define __NR_migrate_pages (__NR_Linux + 246)
+#define __NR_openat (__NR_Linux + 247)
+#define __NR_mkdirat (__NR_Linux + 248)
+#define __NR_mknodat (__NR_Linux + 249)
+#define __NR_fchownat (__NR_Linux + 250)
+#define __NR_futimesat (__NR_Linux + 251)
+#define __NR_newfstatat (__NR_Linux + 252)
+#define __NR_unlinkat (__NR_Linux + 253)
+#define __NR_renameat (__NR_Linux + 254)
+#define __NR_linkat (__NR_Linux + 255)
+#define __NR_symlinkat (__NR_Linux + 256)
+#define __NR_readlinkat (__NR_Linux + 257)
+#define __NR_fchmodat (__NR_Linux + 258)
+#define __NR_faccessat (__NR_Linux + 259)
+#define __NR_pselect6 (__NR_Linux + 260)
+#define __NR_ppoll (__NR_Linux + 261)
+#define __NR_unshare (__NR_Linux + 262)
+#define __NR_splice (__NR_Linux + 263)
+#define __NR_sync_file_range (__NR_Linux + 264)
+#define __NR_tee (__NR_Linux + 265)
+#define __NR_vmsplice (__NR_Linux + 266)
+#define __NR_move_pages (__NR_Linux + 267)
+#define __NR_set_robust_list (__NR_Linux + 268)
+#define __NR_get_robust_list (__NR_Linux + 269)
+#define __NR_kexec_load (__NR_Linux + 270)
+#define __NR_getcpu (__NR_Linux + 271)
+#define __NR_epoll_pwait (__NR_Linux + 272)
+#define __NR_ioprio_set (__NR_Linux + 273)
+#define __NR_ioprio_get (__NR_Linux + 274)
+#define __NR_utimensat (__NR_Linux + 275)
+#define __NR_signalfd (__NR_Linux + 276)
+#define __NR_timerfd (__NR_Linux + 277)
+#define __NR_eventfd (__NR_Linux + 278)
+#define __NR_fallocate (__NR_Linux + 279)
+#define __NR_timerfd_create (__NR_Linux + 280)
+#define __NR_timerfd_gettime (__NR_Linux + 281)
+#define __NR_timerfd_settime (__NR_Linux + 282)
+#define __NR_signalfd4 (__NR_Linux + 283)
+#define __NR_eventfd2 (__NR_Linux + 284)
+#define __NR_epoll_create1 (__NR_Linux + 285)
+#define __NR_dup3 (__NR_Linux + 286)
+#define __NR_pipe2 (__NR_Linux + 287)
+#define __NR_inotify_init1 (__NR_Linux + 288)
+#define __NR_preadv (__NR_Linux + 289)
+#define __NR_pwritev (__NR_Linux + 290)
+#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
+#define __NR_perf_event_open (__NR_Linux + 292)
+#define __NR_accept4 (__NR_Linux + 293)
+#define __NR_recvmmsg (__NR_Linux + 294)
+#define __NR_fanotify_init (__NR_Linux + 295)
+#define __NR_fanotify_mark (__NR_Linux + 296)
+#define __NR_prlimit64 (__NR_Linux + 297)
+#define __NR_name_to_handle_at (__NR_Linux + 298)
+#define __NR_open_by_handle_at (__NR_Linux + 299)
+#define __NR_clock_adjtime (__NR_Linux + 300)
+#define __NR_syncfs (__NR_Linux + 301)
+#define __NR_sendmmsg (__NR_Linux + 302)
+#define __NR_setns (__NR_Linux + 303)
+#define __NR_process_vm_readv (__NR_Linux + 304)
+#define __NR_process_vm_writev (__NR_Linux + 305)
+#define __NR_kcmp (__NR_Linux + 306)
+#define __NR_finit_module (__NR_Linux + 307)
+#define __NR_getdents64 (__NR_Linux + 308)
+#define __NR_sched_setattr (__NR_Linux + 309)
+#define __NR_sched_getattr (__NR_Linux + 310)
+#define __NR_renameat2 (__NR_Linux + 311)
+#define __NR_seccomp (__NR_Linux + 312)
+#define __NR_getrandom (__NR_Linux + 313)
+#define __NR_memfd_create (__NR_Linux + 314)
+#define __NR_bpf (__NR_Linux + 315)
+#define __NR_execveat (__NR_Linux + 316)
+#define __NR_userfaultfd (__NR_Linux + 317)
+#define __NR_membarrier (__NR_Linux + 318)
+#define __NR_mlock2 (__NR_Linux + 319)
+#define __NR_copy_file_range (__NR_Linux + 320)
+#define __NR_preadv2 (__NR_Linux + 321)
+#define __NR_pwritev2 (__NR_Linux + 322)
+#define __NR_pkey_mprotect (__NR_Linux + 323)
+#define __NR_pkey_alloc (__NR_Linux + 324)
+#define __NR_pkey_free (__NR_Linux + 325)
+#define __NR_statx (__NR_Linux + 326)
+#define __NR_rseq (__NR_Linux + 327)
+#define __NR_io_pgetevents (__NR_Linux + 328)
+#endif
diff --git a/libc/kernel/uapi/asm-mips/asm/unistd_nr_n32.h b/libc/kernel/uapi/asm-mips/asm/unistd_nr_n32.h
new file mode 100644
index 0000000..2b74f63
--- /dev/null
+++ b/libc/kernel/uapi/asm-mips/asm/unistd_nr_n32.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_ASM_MIPS_UNISTD_NR_N32_H
+#define _UAPI_ASM_MIPS_UNISTD_NR_N32_H
+#define __NR_N32_Linux 6000
+#define __NR_N32_Linux_syscalls 333
+#endif
diff --git a/libc/kernel/uapi/asm-mips/asm/unistd_nr_n64.h b/libc/kernel/uapi/asm-mips/asm/unistd_nr_n64.h
new file mode 100644
index 0000000..22300b2
--- /dev/null
+++ b/libc/kernel/uapi/asm-mips/asm/unistd_nr_n64.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_ASM_MIPS_UNISTD_NR_N64_H
+#define _UAPI_ASM_MIPS_UNISTD_NR_N64_H
+#define __NR_64_Linux 5000
+#define __NR_64_Linux_syscalls 329
+#endif
diff --git a/libc/kernel/uapi/asm-mips/asm/unistd_nr_o32.h b/libc/kernel/uapi/asm-mips/asm/unistd_nr_o32.h
new file mode 100644
index 0000000..02cbd21
--- /dev/null
+++ b/libc/kernel/uapi/asm-mips/asm/unistd_nr_o32.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_ASM_MIPS_UNISTD_NR_O32_H
+#define _UAPI_ASM_MIPS_UNISTD_NR_O32_H
+#define __NR_O32_Linux 4000
+#define __NR_O32_Linux_syscalls 369
+#endif
diff --git a/libc/kernel/uapi/asm-mips/asm/unistd_o32.h b/libc/kernel/uapi/asm-mips/asm/unistd_o32.h
new file mode 100644
index 0000000..bc248dd
--- /dev/null
+++ b/libc/kernel/uapi/asm-mips/asm/unistd_o32.h
@@ -0,0 +1,389 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_ASM_MIPS_UNISTD_O32_H
+#define _UAPI_ASM_MIPS_UNISTD_O32_H
+#define __NR_syscall (__NR_Linux + 0)
+#define __NR_exit (__NR_Linux + 1)
+#define __NR_fork (__NR_Linux + 2)
+#define __NR_read (__NR_Linux + 3)
+#define __NR_write (__NR_Linux + 4)
+#define __NR_open (__NR_Linux + 5)
+#define __NR_close (__NR_Linux + 6)
+#define __NR_waitpid (__NR_Linux + 7)
+#define __NR_creat (__NR_Linux + 8)
+#define __NR_link (__NR_Linux + 9)
+#define __NR_unlink (__NR_Linux + 10)
+#define __NR_execve (__NR_Linux + 11)
+#define __NR_chdir (__NR_Linux + 12)
+#define __NR_time (__NR_Linux + 13)
+#define __NR_mknod (__NR_Linux + 14)
+#define __NR_chmod (__NR_Linux + 15)
+#define __NR_lchown (__NR_Linux + 16)
+#define __NR_break (__NR_Linux + 17)
+#define __NR_unused18 (__NR_Linux + 18)
+#define __NR_lseek (__NR_Linux + 19)
+#define __NR_getpid (__NR_Linux + 20)
+#define __NR_mount (__NR_Linux + 21)
+#define __NR_umount (__NR_Linux + 22)
+#define __NR_setuid (__NR_Linux + 23)
+#define __NR_getuid (__NR_Linux + 24)
+#define __NR_stime (__NR_Linux + 25)
+#define __NR_ptrace (__NR_Linux + 26)
+#define __NR_alarm (__NR_Linux + 27)
+#define __NR_unused28 (__NR_Linux + 28)
+#define __NR_pause (__NR_Linux + 29)
+#define __NR_utime (__NR_Linux + 30)
+#define __NR_stty (__NR_Linux + 31)
+#define __NR_gtty (__NR_Linux + 32)
+#define __NR_access (__NR_Linux + 33)
+#define __NR_nice (__NR_Linux + 34)
+#define __NR_ftime (__NR_Linux + 35)
+#define __NR_sync (__NR_Linux + 36)
+#define __NR_kill (__NR_Linux + 37)
+#define __NR_rename (__NR_Linux + 38)
+#define __NR_mkdir (__NR_Linux + 39)
+#define __NR_rmdir (__NR_Linux + 40)
+#define __NR_dup (__NR_Linux + 41)
+#define __NR_pipe (__NR_Linux + 42)
+#define __NR_times (__NR_Linux + 43)
+#define __NR_prof (__NR_Linux + 44)
+#define __NR_brk (__NR_Linux + 45)
+#define __NR_setgid (__NR_Linux + 46)
+#define __NR_getgid (__NR_Linux + 47)
+#define __NR_signal (__NR_Linux + 48)
+#define __NR_geteuid (__NR_Linux + 49)
+#define __NR_getegid (__NR_Linux + 50)
+#define __NR_acct (__NR_Linux + 51)
+#define __NR_umount2 (__NR_Linux + 52)
+#define __NR_lock (__NR_Linux + 53)
+#define __NR_ioctl (__NR_Linux + 54)
+#define __NR_fcntl (__NR_Linux + 55)
+#define __NR_mpx (__NR_Linux + 56)
+#define __NR_setpgid (__NR_Linux + 57)
+#define __NR_ulimit (__NR_Linux + 58)
+#define __NR_unused59 (__NR_Linux + 59)
+#define __NR_umask (__NR_Linux + 60)
+#define __NR_chroot (__NR_Linux + 61)
+#define __NR_ustat (__NR_Linux + 62)
+#define __NR_dup2 (__NR_Linux + 63)
+#define __NR_getppid (__NR_Linux + 64)
+#define __NR_getpgrp (__NR_Linux + 65)
+#define __NR_setsid (__NR_Linux + 66)
+#define __NR_sigaction (__NR_Linux + 67)
+#define __NR_sgetmask (__NR_Linux + 68)
+#define __NR_ssetmask (__NR_Linux + 69)
+#define __NR_setreuid (__NR_Linux + 70)
+#define __NR_setregid (__NR_Linux + 71)
+#define __NR_sigsuspend (__NR_Linux + 72)
+#define __NR_sigpending (__NR_Linux + 73)
+#define __NR_sethostname (__NR_Linux + 74)
+#define __NR_setrlimit (__NR_Linux + 75)
+#define __NR_getrlimit (__NR_Linux + 76)
+#define __NR_getrusage (__NR_Linux + 77)
+#define __NR_gettimeofday (__NR_Linux + 78)
+#define __NR_settimeofday (__NR_Linux + 79)
+#define __NR_getgroups (__NR_Linux + 80)
+#define __NR_setgroups (__NR_Linux + 81)
+#define __NR_reserved82 (__NR_Linux + 82)
+#define __NR_symlink (__NR_Linux + 83)
+#define __NR_unused84 (__NR_Linux + 84)
+#define __NR_readlink (__NR_Linux + 85)
+#define __NR_uselib (__NR_Linux + 86)
+#define __NR_swapon (__NR_Linux + 87)
+#define __NR_reboot (__NR_Linux + 88)
+#define __NR_readdir (__NR_Linux + 89)
+#define __NR_mmap (__NR_Linux + 90)
+#define __NR_munmap (__NR_Linux + 91)
+#define __NR_truncate (__NR_Linux + 92)
+#define __NR_ftruncate (__NR_Linux + 93)
+#define __NR_fchmod (__NR_Linux + 94)
+#define __NR_fchown (__NR_Linux + 95)
+#define __NR_getpriority (__NR_Linux + 96)
+#define __NR_setpriority (__NR_Linux + 97)
+#define __NR_profil (__NR_Linux + 98)
+#define __NR_statfs (__NR_Linux + 99)
+#define __NR_fstatfs (__NR_Linux + 100)
+#define __NR_ioperm (__NR_Linux + 101)
+#define __NR_socketcall (__NR_Linux + 102)
+#define __NR_syslog (__NR_Linux + 103)
+#define __NR_setitimer (__NR_Linux + 104)
+#define __NR_getitimer (__NR_Linux + 105)
+#define __NR_stat (__NR_Linux + 106)
+#define __NR_lstat (__NR_Linux + 107)
+#define __NR_fstat (__NR_Linux + 108)
+#define __NR_unused109 (__NR_Linux + 109)
+#define __NR_iopl (__NR_Linux + 110)
+#define __NR_vhangup (__NR_Linux + 111)
+#define __NR_idle (__NR_Linux + 112)
+#define __NR_vm86 (__NR_Linux + 113)
+#define __NR_wait4 (__NR_Linux + 114)
+#define __NR_swapoff (__NR_Linux + 115)
+#define __NR_sysinfo (__NR_Linux + 116)
+#define __NR_ipc (__NR_Linux + 117)
+#define __NR_fsync (__NR_Linux + 118)
+#define __NR_sigreturn (__NR_Linux + 119)
+#define __NR_clone (__NR_Linux + 120)
+#define __NR_setdomainname (__NR_Linux + 121)
+#define __NR_uname (__NR_Linux + 122)
+#define __NR_modify_ldt (__NR_Linux + 123)
+#define __NR_adjtimex (__NR_Linux + 124)
+#define __NR_mprotect (__NR_Linux + 125)
+#define __NR_sigprocmask (__NR_Linux + 126)
+#define __NR_create_module (__NR_Linux + 127)
+#define __NR_init_module (__NR_Linux + 128)
+#define __NR_delete_module (__NR_Linux + 129)
+#define __NR_get_kernel_syms (__NR_Linux + 130)
+#define __NR_quotactl (__NR_Linux + 131)
+#define __NR_getpgid (__NR_Linux + 132)
+#define __NR_fchdir (__NR_Linux + 133)
+#define __NR_bdflush (__NR_Linux + 134)
+#define __NR_sysfs (__NR_Linux + 135)
+#define __NR_personality (__NR_Linux + 136)
+#define __NR_afs_syscall (__NR_Linux + 137)
+#define __NR_setfsuid (__NR_Linux + 138)
+#define __NR_setfsgid (__NR_Linux + 139)
+#define __NR__llseek (__NR_Linux + 140)
+#define __NR_getdents (__NR_Linux + 141)
+#define __NR__newselect (__NR_Linux + 142)
+#define __NR_flock (__NR_Linux + 143)
+#define __NR_msync (__NR_Linux + 144)
+#define __NR_readv (__NR_Linux + 145)
+#define __NR_writev (__NR_Linux + 146)
+#define __NR_cacheflush (__NR_Linux + 147)
+#define __NR_cachectl (__NR_Linux + 148)
+#define __NR_sysmips (__NR_Linux + 149)
+#define __NR_unused150 (__NR_Linux + 150)
+#define __NR_getsid (__NR_Linux + 151)
+#define __NR_fdatasync (__NR_Linux + 152)
+#define __NR__sysctl (__NR_Linux + 153)
+#define __NR_mlock (__NR_Linux + 154)
+#define __NR_munlock (__NR_Linux + 155)
+#define __NR_mlockall (__NR_Linux + 156)
+#define __NR_munlockall (__NR_Linux + 157)
+#define __NR_sched_setparam (__NR_Linux + 158)
+#define __NR_sched_getparam (__NR_Linux + 159)
+#define __NR_sched_setscheduler (__NR_Linux + 160)
+#define __NR_sched_getscheduler (__NR_Linux + 161)
+#define __NR_sched_yield (__NR_Linux + 162)
+#define __NR_sched_get_priority_max (__NR_Linux + 163)
+#define __NR_sched_get_priority_min (__NR_Linux + 164)
+#define __NR_sched_rr_get_interval (__NR_Linux + 165)
+#define __NR_nanosleep (__NR_Linux + 166)
+#define __NR_mremap (__NR_Linux + 167)
+#define __NR_accept (__NR_Linux + 168)
+#define __NR_bind (__NR_Linux + 169)
+#define __NR_connect (__NR_Linux + 170)
+#define __NR_getpeername (__NR_Linux + 171)
+#define __NR_getsockname (__NR_Linux + 172)
+#define __NR_getsockopt (__NR_Linux + 173)
+#define __NR_listen (__NR_Linux + 174)
+#define __NR_recv (__NR_Linux + 175)
+#define __NR_recvfrom (__NR_Linux + 176)
+#define __NR_recvmsg (__NR_Linux + 177)
+#define __NR_send (__NR_Linux + 178)
+#define __NR_sendmsg (__NR_Linux + 179)
+#define __NR_sendto (__NR_Linux + 180)
+#define __NR_setsockopt (__NR_Linux + 181)
+#define __NR_shutdown (__NR_Linux + 182)
+#define __NR_socket (__NR_Linux + 183)
+#define __NR_socketpair (__NR_Linux + 184)
+#define __NR_setresuid (__NR_Linux + 185)
+#define __NR_getresuid (__NR_Linux + 186)
+#define __NR_query_module (__NR_Linux + 187)
+#define __NR_poll (__NR_Linux + 188)
+#define __NR_nfsservctl (__NR_Linux + 189)
+#define __NR_setresgid (__NR_Linux + 190)
+#define __NR_getresgid (__NR_Linux + 191)
+#define __NR_prctl (__NR_Linux + 192)
+#define __NR_rt_sigreturn (__NR_Linux + 193)
+#define __NR_rt_sigaction (__NR_Linux + 194)
+#define __NR_rt_sigprocmask (__NR_Linux + 195)
+#define __NR_rt_sigpending (__NR_Linux + 196)
+#define __NR_rt_sigtimedwait (__NR_Linux + 197)
+#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
+#define __NR_rt_sigsuspend (__NR_Linux + 199)
+#define __NR_pread64 (__NR_Linux + 200)
+#define __NR_pwrite64 (__NR_Linux + 201)
+#define __NR_chown (__NR_Linux + 202)
+#define __NR_getcwd (__NR_Linux + 203)
+#define __NR_capget (__NR_Linux + 204)
+#define __NR_capset (__NR_Linux + 205)
+#define __NR_sigaltstack (__NR_Linux + 206)
+#define __NR_sendfile (__NR_Linux + 207)
+#define __NR_getpmsg (__NR_Linux + 208)
+#define __NR_putpmsg (__NR_Linux + 209)
+#define __NR_mmap2 (__NR_Linux + 210)
+#define __NR_truncate64 (__NR_Linux + 211)
+#define __NR_ftruncate64 (__NR_Linux + 212)
+#define __NR_stat64 (__NR_Linux + 213)
+#define __NR_lstat64 (__NR_Linux + 214)
+#define __NR_fstat64 (__NR_Linux + 215)
+#define __NR_pivot_root (__NR_Linux + 216)
+#define __NR_mincore (__NR_Linux + 217)
+#define __NR_madvise (__NR_Linux + 218)
+#define __NR_getdents64 (__NR_Linux + 219)
+#define __NR_fcntl64 (__NR_Linux + 220)
+#define __NR_reserved221 (__NR_Linux + 221)
+#define __NR_gettid (__NR_Linux + 222)
+#define __NR_readahead (__NR_Linux + 223)
+#define __NR_setxattr (__NR_Linux + 224)
+#define __NR_lsetxattr (__NR_Linux + 225)
+#define __NR_fsetxattr (__NR_Linux + 226)
+#define __NR_getxattr (__NR_Linux + 227)
+#define __NR_lgetxattr (__NR_Linux + 228)
+#define __NR_fgetxattr (__NR_Linux + 229)
+#define __NR_listxattr (__NR_Linux + 230)
+#define __NR_llistxattr (__NR_Linux + 231)
+#define __NR_flistxattr (__NR_Linux + 232)
+#define __NR_removexattr (__NR_Linux + 233)
+#define __NR_lremovexattr (__NR_Linux + 234)
+#define __NR_fremovexattr (__NR_Linux + 235)
+#define __NR_tkill (__NR_Linux + 236)
+#define __NR_sendfile64 (__NR_Linux + 237)
+#define __NR_futex (__NR_Linux + 238)
+#define __NR_sched_setaffinity (__NR_Linux + 239)
+#define __NR_sched_getaffinity (__NR_Linux + 240)
+#define __NR_io_setup (__NR_Linux + 241)
+#define __NR_io_destroy (__NR_Linux + 242)
+#define __NR_io_getevents (__NR_Linux + 243)
+#define __NR_io_submit (__NR_Linux + 244)
+#define __NR_io_cancel (__NR_Linux + 245)
+#define __NR_exit_group (__NR_Linux + 246)
+#define __NR_lookup_dcookie (__NR_Linux + 247)
+#define __NR_epoll_create (__NR_Linux + 248)
+#define __NR_epoll_ctl (__NR_Linux + 249)
+#define __NR_epoll_wait (__NR_Linux + 250)
+#define __NR_remap_file_pages (__NR_Linux + 251)
+#define __NR_set_tid_address (__NR_Linux + 252)
+#define __NR_restart_syscall (__NR_Linux + 253)
+#define __NR_fadvise64 (__NR_Linux + 254)
+#define __NR_statfs64 (__NR_Linux + 255)
+#define __NR_fstatfs64 (__NR_Linux + 256)
+#define __NR_timer_create (__NR_Linux + 257)
+#define __NR_timer_settime (__NR_Linux + 258)
+#define __NR_timer_gettime (__NR_Linux + 259)
+#define __NR_timer_getoverrun (__NR_Linux + 260)
+#define __NR_timer_delete (__NR_Linux + 261)
+#define __NR_clock_settime (__NR_Linux + 262)
+#define __NR_clock_gettime (__NR_Linux + 263)
+#define __NR_clock_getres (__NR_Linux + 264)
+#define __NR_clock_nanosleep (__NR_Linux + 265)
+#define __NR_tgkill (__NR_Linux + 266)
+#define __NR_utimes (__NR_Linux + 267)
+#define __NR_mbind (__NR_Linux + 268)
+#define __NR_get_mempolicy (__NR_Linux + 269)
+#define __NR_set_mempolicy (__NR_Linux + 270)
+#define __NR_mq_open (__NR_Linux + 271)
+#define __NR_mq_unlink (__NR_Linux + 272)
+#define __NR_mq_timedsend (__NR_Linux + 273)
+#define __NR_mq_timedreceive (__NR_Linux + 274)
+#define __NR_mq_notify (__NR_Linux + 275)
+#define __NR_mq_getsetattr (__NR_Linux + 276)
+#define __NR_vserver (__NR_Linux + 277)
+#define __NR_waitid (__NR_Linux + 278)
+#define __NR_add_key (__NR_Linux + 280)
+#define __NR_request_key (__NR_Linux + 281)
+#define __NR_keyctl (__NR_Linux + 282)
+#define __NR_set_thread_area (__NR_Linux + 283)
+#define __NR_inotify_init (__NR_Linux + 284)
+#define __NR_inotify_add_watch (__NR_Linux + 285)
+#define __NR_inotify_rm_watch (__NR_Linux + 286)
+#define __NR_migrate_pages (__NR_Linux + 287)
+#define __NR_openat (__NR_Linux + 288)
+#define __NR_mkdirat (__NR_Linux + 289)
+#define __NR_mknodat (__NR_Linux + 290)
+#define __NR_fchownat (__NR_Linux + 291)
+#define __NR_futimesat (__NR_Linux + 292)
+#define __NR_fstatat64 (__NR_Linux + 293)
+#define __NR_unlinkat (__NR_Linux + 294)
+#define __NR_renameat (__NR_Linux + 295)
+#define __NR_linkat (__NR_Linux + 296)
+#define __NR_symlinkat (__NR_Linux + 297)
+#define __NR_readlinkat (__NR_Linux + 298)
+#define __NR_fchmodat (__NR_Linux + 299)
+#define __NR_faccessat (__NR_Linux + 300)
+#define __NR_pselect6 (__NR_Linux + 301)
+#define __NR_ppoll (__NR_Linux + 302)
+#define __NR_unshare (__NR_Linux + 303)
+#define __NR_splice (__NR_Linux + 304)
+#define __NR_sync_file_range (__NR_Linux + 305)
+#define __NR_tee (__NR_Linux + 306)
+#define __NR_vmsplice (__NR_Linux + 307)
+#define __NR_move_pages (__NR_Linux + 308)
+#define __NR_set_robust_list (__NR_Linux + 309)
+#define __NR_get_robust_list (__NR_Linux + 310)
+#define __NR_kexec_load (__NR_Linux + 311)
+#define __NR_getcpu (__NR_Linux + 312)
+#define __NR_epoll_pwait (__NR_Linux + 313)
+#define __NR_ioprio_set (__NR_Linux + 314)
+#define __NR_ioprio_get (__NR_Linux + 315)
+#define __NR_utimensat (__NR_Linux + 316)
+#define __NR_signalfd (__NR_Linux + 317)
+#define __NR_timerfd (__NR_Linux + 318)
+#define __NR_eventfd (__NR_Linux + 319)
+#define __NR_fallocate (__NR_Linux + 320)
+#define __NR_timerfd_create (__NR_Linux + 321)
+#define __NR_timerfd_gettime (__NR_Linux + 322)
+#define __NR_timerfd_settime (__NR_Linux + 323)
+#define __NR_signalfd4 (__NR_Linux + 324)
+#define __NR_eventfd2 (__NR_Linux + 325)
+#define __NR_epoll_create1 (__NR_Linux + 326)
+#define __NR_dup3 (__NR_Linux + 327)
+#define __NR_pipe2 (__NR_Linux + 328)
+#define __NR_inotify_init1 (__NR_Linux + 329)
+#define __NR_preadv (__NR_Linux + 330)
+#define __NR_pwritev (__NR_Linux + 331)
+#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
+#define __NR_perf_event_open (__NR_Linux + 333)
+#define __NR_accept4 (__NR_Linux + 334)
+#define __NR_recvmmsg (__NR_Linux + 335)
+#define __NR_fanotify_init (__NR_Linux + 336)
+#define __NR_fanotify_mark (__NR_Linux + 337)
+#define __NR_prlimit64 (__NR_Linux + 338)
+#define __NR_name_to_handle_at (__NR_Linux + 339)
+#define __NR_open_by_handle_at (__NR_Linux + 340)
+#define __NR_clock_adjtime (__NR_Linux + 341)
+#define __NR_syncfs (__NR_Linux + 342)
+#define __NR_sendmmsg (__NR_Linux + 343)
+#define __NR_setns (__NR_Linux + 344)
+#define __NR_process_vm_readv (__NR_Linux + 345)
+#define __NR_process_vm_writev (__NR_Linux + 346)
+#define __NR_kcmp (__NR_Linux + 347)
+#define __NR_finit_module (__NR_Linux + 348)
+#define __NR_sched_setattr (__NR_Linux + 349)
+#define __NR_sched_getattr (__NR_Linux + 350)
+#define __NR_renameat2 (__NR_Linux + 351)
+#define __NR_seccomp (__NR_Linux + 352)
+#define __NR_getrandom (__NR_Linux + 353)
+#define __NR_memfd_create (__NR_Linux + 354)
+#define __NR_bpf (__NR_Linux + 355)
+#define __NR_execveat (__NR_Linux + 356)
+#define __NR_userfaultfd (__NR_Linux + 357)
+#define __NR_membarrier (__NR_Linux + 358)
+#define __NR_mlock2 (__NR_Linux + 359)
+#define __NR_copy_file_range (__NR_Linux + 360)
+#define __NR_preadv2 (__NR_Linux + 361)
+#define __NR_pwritev2 (__NR_Linux + 362)
+#define __NR_pkey_mprotect (__NR_Linux + 363)
+#define __NR_pkey_alloc (__NR_Linux + 364)
+#define __NR_pkey_free (__NR_Linux + 365)
+#define __NR_statx (__NR_Linux + 366)
+#define __NR_rseq (__NR_Linux + 367)
+#define __NR_io_pgetevents (__NR_Linux + 368)
+#endif
diff --git a/libc/kernel/uapi/asm-x86/asm/bootparam.h b/libc/kernel/uapi/asm-x86/asm/bootparam.h
index b010277..dc90f57 100644
--- a/libc/kernel/uapi/asm-x86/asm/bootparam.h
+++ b/libc/kernel/uapi/asm-x86/asm/bootparam.h
@@ -135,7 +135,8 @@
   __u8 _pad2[4];
   __u64 tboot_addr;
   struct ist_info ist_info;
-  __u8 _pad3[16];
+  __u64 acpi_rsdp_addr;
+  __u8 _pad3[8];
   __u8 hd0_info[16];
   __u8 hd1_info[16];
   struct sys_desc_table sys_desc_table;
diff --git a/libc/kernel/uapi/asm-x86/asm/kvm.h b/libc/kernel/uapi/asm-x86/asm/kvm.h
index 1d7f767..4386f76 100644
--- a/libc/kernel/uapi/asm-x86/asm/kvm.h
+++ b/libc/kernel/uapi/asm-x86/asm/kvm.h
@@ -248,6 +248,7 @@
 #define KVM_VCPUEVENT_VALID_SIPI_VECTOR 0x00000002
 #define KVM_VCPUEVENT_VALID_SHADOW 0x00000004
 #define KVM_VCPUEVENT_VALID_SMM 0x00000008
+#define KVM_VCPUEVENT_VALID_PAYLOAD 0x00000010
 #define KVM_X86_SHADOW_INT_MOV_SS 0x01
 #define KVM_X86_SHADOW_INT_STI 0x02
 struct kvm_vcpu_events {
@@ -255,7 +256,7 @@
     __u8 injected;
     __u8 nr;
     __u8 has_error_code;
-    __u8 pad;
+    __u8 pending;
     __u32 error_code;
   } exception;
   struct {
@@ -278,7 +279,9 @@
     __u8 smm_inside_nmi;
     __u8 latched_init;
   } smi;
-  __u32 reserved[9];
+  __u8 reserved[27];
+  __u8 exception_has_payload;
+  __u64 exception_payload;
 };
 struct kvm_debugregs {
   __u64 db[4];
@@ -316,6 +319,7 @@
 #define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
 #define KVM_STATE_NESTED_GUEST_MODE 0x00000001
 #define KVM_STATE_NESTED_RUN_PENDING 0x00000002
+#define KVM_STATE_NESTED_EVMCS 0x00000004
 #define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
 #define KVM_STATE_NESTED_SMM_VMXON 0x00000002
 struct kvm_vmx_nested_state {
diff --git a/libc/kernel/uapi/asm-x86/asm/siginfo.h b/libc/kernel/uapi/asm-x86/asm/siginfo.h
index 1da8066..0de5283 100644
--- a/libc/kernel/uapi/asm-x86/asm/siginfo.h
+++ b/libc/kernel/uapi/asm-x86/asm/siginfo.h
@@ -23,8 +23,6 @@
 typedef long long __kernel_si_clock_t __attribute__((aligned(4)));
 #define __ARCH_SI_CLOCK_T __kernel_si_clock_t
 #define __ARCH_SI_ATTRIBUTES __attribute__((aligned(8)))
-#else
-#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
 #endif
 #endif
 #include <asm-generic/siginfo.h>
diff --git a/libc/kernel/uapi/drm/amdgpu_drm.h b/libc/kernel/uapi/drm/amdgpu_drm.h
index bdf59d6..baa2e44 100644
--- a/libc/kernel/uapi/drm/amdgpu_drm.h
+++ b/libc/kernel/uapi/drm/amdgpu_drm.h
@@ -20,6 +20,7 @@
 #define __AMDGPU_DRM_H__
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define DRM_AMDGPU_GEM_CREATE 0x00
 #define DRM_AMDGPU_GEM_MMAP 0x01
@@ -194,6 +195,12 @@
 #define AMDGPU_TILING_NUM_BANKS_MASK 0x3
 #define AMDGPU_TILING_SWIZZLE_MODE_SHIFT 0
 #define AMDGPU_TILING_SWIZZLE_MODE_MASK 0x1f
+#define AMDGPU_TILING_DCC_OFFSET_256B_SHIFT 5
+#define AMDGPU_TILING_DCC_OFFSET_256B_MASK 0xFFFFFF
+#define AMDGPU_TILING_DCC_PITCH_MAX_SHIFT 29
+#define AMDGPU_TILING_DCC_PITCH_MAX_MASK 0x3FFF
+#define AMDGPU_TILING_DCC_INDEPENDENT_64B_SHIFT 43
+#define AMDGPU_TILING_DCC_INDEPENDENT_64B_MASK 0x1
 #define AMDGPU_TILING_SET(field,value) (((__u64) (value) & AMDGPU_TILING_ ##field ##_MASK) << AMDGPU_TILING_ ##field ##_SHIFT)
 #define AMDGPU_TILING_GET(value,field) (((__u64) (value) >> AMDGPU_TILING_ ##field ##_SHIFT) & AMDGPU_TILING_ ##field ##_MASK)
 #define AMDGPU_GEM_METADATA_OP_SET_METADATA 1
@@ -405,6 +412,7 @@
 #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_CNTL 0x0f
 #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_GPM_MEM 0x10
 #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_SRM_MEM 0x11
+#define AMDGPU_INFO_FW_DMCU 0x12
 #define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f
 #define AMDGPU_INFO_VRAM_USAGE 0x10
 #define AMDGPU_INFO_GTT_USAGE 0x11
@@ -593,5 +601,6 @@
 #define AMDGPU_FAMILY_AI 141
 #define AMDGPU_FAMILY_RV 142
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/armada_drm.h b/libc/kernel/uapi/drm/armada_drm.h
index ea1f37d..aabd23b 100644
--- a/libc/kernel/uapi/drm/armada_drm.h
+++ b/libc/kernel/uapi/drm/armada_drm.h
@@ -20,6 +20,7 @@
 #define DRM_ARMADA_IOCTL_H
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define DRM_ARMADA_GEM_CREATE 0x00
 #define DRM_ARMADA_GEM_MMAP 0x02
@@ -46,5 +47,6 @@
 };
 #define DRM_IOCTL_ARMADA_GEM_PWRITE ARMADA_IOCTL(IOW, GEM_PWRITE, gem_pwrite)
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/drm.h b/libc/kernel/uapi/drm/drm.h
index 21f23f4..ef64ed7 100644
--- a/libc/kernel/uapi/drm/drm.h
+++ b/libc/kernel/uapi/drm/drm.h
@@ -37,6 +37,7 @@
 typedef unsigned long drm_handle_t;
 #endif
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define DRM_NAME "drm"
 #define DRM_MIN_ORDER 5
@@ -429,9 +430,11 @@
   __u64 user_data;
 };
 #ifdef __cplusplus
+}
 #endif
 #include "drm_mode.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define DRM_IOCTL_BASE 'd'
 #define DRM_IO(nr) _IO(DRM_IOCTL_BASE, nr)
@@ -603,5 +606,6 @@
 typedef struct drm_scatter_gather drm_scatter_gather_t;
 typedef struct drm_set_version drm_set_version_t;
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/drm_fourcc.h b/libc/kernel/uapi/drm/drm_fourcc.h
index 9634e99..d95bda0 100644
--- a/libc/kernel/uapi/drm/drm_fourcc.h
+++ b/libc/kernel/uapi/drm/drm_fourcc.h
@@ -20,9 +20,11 @@
 #define DRM_FOURCC_H
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define fourcc_code(a,b,c,d) ((__u32) (a) | ((__u32) (b) << 8) | ((__u32) (c) << 16) | ((__u32) (d) << 24))
 #define DRM_FORMAT_BIG_ENDIAN (1 << 31)
+#define DRM_FORMAT_INVALID 0
 #define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ')
 #define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ')
 #define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ')
@@ -73,6 +75,11 @@
 #define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y')
 #define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y')
 #define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V')
+#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V')
+#define DRM_FORMAT_Y0L0 fourcc_code('Y', '0', 'L', '0')
+#define DRM_FORMAT_X0L0 fourcc_code('X', '0', 'L', '0')
+#define DRM_FORMAT_Y0L2 fourcc_code('Y', '0', 'L', '2')
+#define DRM_FORMAT_X0L2 fourcc_code('X', '0', 'L', '2')
 #define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8')
 #define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8')
 #define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8')
@@ -117,6 +124,7 @@
 #define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4)
 #define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5)
 #define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1)
+#define DRM_FORMAT_MOD_SAMSUNG_16_16_TILE fourcc_mod_code(SAMSUNG, 2)
 #define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)
 #define DRM_FORMAT_MOD_VIVANTE_TILED fourcc_mod_code(VIVANTE, 1)
 #define DRM_FORMAT_MOD_VIVANTE_SUPER_TILED fourcc_mod_code(VIVANTE, 2)
@@ -156,5 +164,6 @@
 #define AFBC_FORMAT_MOD_TILED (1ULL << 8)
 #define AFBC_FORMAT_MOD_SC (1ULL << 9)
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/drm_mode.h b/libc/kernel/uapi/drm/drm_mode.h
index 06c26e4..1944c9c 100644
--- a/libc/kernel/uapi/drm/drm_mode.h
+++ b/libc/kernel/uapi/drm/drm_mode.h
@@ -20,6 +20,7 @@
 #define _DRM_MODE_H
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define DRM_DISPLAY_INFO_LEN 32
 #define DRM_CONNECTOR_NAME_LEN 32
@@ -462,6 +463,13 @@
 struct drm_mode_revoke_lease {
   __u32 lessee_id;
 };
+struct drm_mode_rect {
+  __s32 x1;
+  __s32 y1;
+  __s32 x2;
+  __s32 y2;
+};
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/drm_sarea.h b/libc/kernel/uapi/drm/drm_sarea.h
index 03317b9..a0c7f3a 100644
--- a/libc/kernel/uapi/drm/drm_sarea.h
+++ b/libc/kernel/uapi/drm/drm_sarea.h
@@ -20,6 +20,7 @@
 #define _DRM_SAREA_H_
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #ifdef __alpha__
 #define SAREA_MAX 0x2000U
@@ -54,5 +55,6 @@
 typedef struct drm_sarea_frame drm_sarea_frame_t;
 typedef struct drm_sarea drm_sarea_t;
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/etnaviv_drm.h b/libc/kernel/uapi/drm/etnaviv_drm.h
index bb502d9..4c09e6c 100644
--- a/libc/kernel/uapi/drm/etnaviv_drm.h
+++ b/libc/kernel/uapi/drm/etnaviv_drm.h
@@ -20,6 +20,7 @@
 #define __ETNAVIV_DRM_H__
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 struct drm_etnaviv_timespec {
   __s64 tv_sec;
@@ -193,5 +194,6 @@
 #define DRM_IOCTL_ETNAVIV_PM_QUERY_DOM DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_DOM, struct drm_etnaviv_pm_domain)
 #define DRM_IOCTL_ETNAVIV_PM_QUERY_SIG DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_SIG, struct drm_etnaviv_pm_signal)
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/exynos_drm.h b/libc/kernel/uapi/drm/exynos_drm.h
index 8b27cbb..4918035 100644
--- a/libc/kernel/uapi/drm/exynos_drm.h
+++ b/libc/kernel/uapi/drm/exynos_drm.h
@@ -20,6 +20,7 @@
 #define _UAPI_EXYNOS_DRM_H_
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 struct drm_exynos_gem_create {
   __u64 size;
@@ -225,5 +226,6 @@
   __u64 reserved;
 };
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/i810_drm.h b/libc/kernel/uapi/drm/i810_drm.h
index 1fd3c46..e33387d 100644
--- a/libc/kernel/uapi/drm/i810_drm.h
+++ b/libc/kernel/uapi/drm/i810_drm.h
@@ -20,6 +20,7 @@
 #define _I810_DRM_H_
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #ifndef _I810_DEFINES_
 #define _I810_DEFINES_
@@ -214,5 +215,6 @@
   unsigned int last_render;
 } drm_i810_mc_t;
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/i915_drm.h b/libc/kernel/uapi/drm/i915_drm.h
index 4c1d87f..b3fd9fd 100644
--- a/libc/kernel/uapi/drm/i915_drm.h
+++ b/libc/kernel/uapi/drm/i915_drm.h
@@ -20,6 +20,7 @@
 #define _UAPI_I915_DRM_H_
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR"
 #define I915_ERROR_UEVENT "ERROR"
@@ -280,6 +281,9 @@
 typedef struct drm_i915_irq_wait {
   int irq_seq;
 } drm_i915_irq_wait_t;
+#define I915_GEM_PPGTT_NONE 0
+#define I915_GEM_PPGTT_ALIASING 1
+#define I915_GEM_PPGTT_FULL 2
 #define I915_PARAM_IRQ_ACTIVE 1
 #define I915_PARAM_ALLOW_BATCHBUFFER 2
 #define I915_PARAM_LAST_DISPATCH 3
@@ -334,6 +338,7 @@
 #define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49
 #define I915_PARAM_HAS_CONTEXT_ISOLATION 50
 #define I915_PARAM_CS_TIMESTAMP_FREQUENCY 51
+#define I915_PARAM_MMAP_GTT_COHERENT 52
 typedef struct drm_i915_getparam {
   __s32 param;
   int __user * value;
@@ -775,5 +780,6 @@
   __u8 data[];
 };
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/mga_drm.h b/libc/kernel/uapi/drm/mga_drm.h
index 4d5ad0c..4959502 100644
--- a/libc/kernel/uapi/drm/mga_drm.h
+++ b/libc/kernel/uapi/drm/mga_drm.h
@@ -20,6 +20,7 @@
 #define __MGA_DRM_H__
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #ifndef __MGA_SAREA_DEFINES__
 #define __MGA_SAREA_DEFINES__
@@ -240,5 +241,6 @@
   void __user * value;
 } drm_mga_getparam_t;
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/msm_drm.h b/libc/kernel/uapi/drm/msm_drm.h
index 1d53c5d..f6bee3e 100644
--- a/libc/kernel/uapi/drm/msm_drm.h
+++ b/libc/kernel/uapi/drm/msm_drm.h
@@ -20,6 +20,7 @@
 #define __MSM_DRM_H__
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define MSM_PIPE_NONE 0x00
 #define MSM_PIPE_2D0 0x01
@@ -56,12 +57,16 @@
   __u32 flags;
   __u32 handle;
 };
-#define MSM_INFO_IOVA 0x01
-#define MSM_INFO_FLAGS (MSM_INFO_IOVA)
+#define MSM_INFO_GET_OFFSET 0x00
+#define MSM_INFO_GET_IOVA 0x01
+#define MSM_INFO_SET_NAME 0x02
+#define MSM_INFO_GET_NAME 0x03
 struct drm_msm_gem_info {
   __u32 handle;
-  __u32 flags;
-  __u64 offset;
+  __u32 info;
+  __u64 value;
+  __u32 len;
+  __u32 pad;
 };
 #define MSM_PREP_READ 0x01
 #define MSM_PREP_WRITE 0x02
@@ -96,7 +101,8 @@
 };
 #define MSM_SUBMIT_BO_READ 0x0001
 #define MSM_SUBMIT_BO_WRITE 0x0002
-#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE)
+#define MSM_SUBMIT_BO_DUMP 0x0004
+#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE | MSM_SUBMIT_BO_DUMP)
 struct drm_msm_gem_submit_bo {
   __u32 flags;
   __u32 handle;
@@ -158,5 +164,6 @@
 #define DRM_IOCTL_MSM_SUBMITQUEUE_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue)
 #define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32)
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/nouveau_drm.h b/libc/kernel/uapi/drm/nouveau_drm.h
index f9c3447..54c3b97 100644
--- a/libc/kernel/uapi/drm/nouveau_drm.h
+++ b/libc/kernel/uapi/drm/nouveau_drm.h
@@ -21,6 +21,7 @@
 #define DRM_NOUVEAU_EVENT_NVIF 0x80000000
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
 #define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
@@ -122,5 +123,6 @@
 #define DRM_IOCTL_NOUVEAU_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_FINI, struct drm_nouveau_gem_cpu_fini)
 #define DRM_IOCTL_NOUVEAU_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_INFO, struct drm_nouveau_gem_info)
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/omap_drm.h b/libc/kernel/uapi/drm/omap_drm.h
index 54b539a..3c2fc08 100644
--- a/libc/kernel/uapi/drm/omap_drm.h
+++ b/libc/kernel/uapi/drm/omap_drm.h
@@ -20,6 +20,7 @@
 #define __OMAP_DRM_H__
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define OMAP_PARAM_CHIPSET_ID 1
 struct drm_omap_param {
@@ -84,5 +85,6 @@
 #define DRM_IOCTL_OMAP_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_FINI, struct drm_omap_gem_cpu_fini)
 #define DRM_IOCTL_OMAP_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_INFO, struct drm_omap_gem_info)
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/qxl_drm.h b/libc/kernel/uapi/drm/qxl_drm.h
index 5942635..e9521c4 100644
--- a/libc/kernel/uapi/drm/qxl_drm.h
+++ b/libc/kernel/uapi/drm/qxl_drm.h
@@ -20,6 +20,7 @@
 #define QXL_DRM_H
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define QXL_GEM_DOMAIN_CPU 0
 #define QXL_GEM_DOMAIN_VRAM 1
@@ -97,5 +98,6 @@
 #define DRM_IOCTL_QXL_CLIENTCAP DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_CLIENTCAP, struct drm_qxl_clientcap)
 #define DRM_IOCTL_QXL_ALLOC_SURF DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC_SURF, struct drm_qxl_alloc_surf)
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/r128_drm.h b/libc/kernel/uapi/drm/r128_drm.h
index 85dea7e..618b6dc 100644
--- a/libc/kernel/uapi/drm/r128_drm.h
+++ b/libc/kernel/uapi/drm/r128_drm.h
@@ -20,6 +20,7 @@
 #define __R128_DRM_H__
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #ifndef __R128_SAREA_DEFINES__
 #define __R128_SAREA_DEFINES__
@@ -229,5 +230,6 @@
   void __user * value;
 } drm_r128_getparam_t;
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/radeon_drm.h b/libc/kernel/uapi/drm/radeon_drm.h
index fe8fe67..9dc69ad 100644
--- a/libc/kernel/uapi/drm/radeon_drm.h
+++ b/libc/kernel/uapi/drm/radeon_drm.h
@@ -20,6 +20,7 @@
 #define __RADEON_DRM_H__
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #ifndef __RADEON_SAREA_DEFINES__
 #define __RADEON_SAREA_DEFINES__
@@ -801,5 +802,6 @@
 #define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA 2
 #define CIK_TILE_MODE_DEPTH_STENCIL_1D 5
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/savage_drm.h b/libc/kernel/uapi/drm/savage_drm.h
index 8c5a172..ae87d21 100644
--- a/libc/kernel/uapi/drm/savage_drm.h
+++ b/libc/kernel/uapi/drm/savage_drm.h
@@ -20,6 +20,7 @@
 #define __SAVAGE_DRM_H__
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #ifndef __SAVAGE_SAREA_DEFINES__
 #define __SAVAGE_SAREA_DEFINES__
@@ -151,5 +152,6 @@
   } clear1;
 };
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/sis_drm.h b/libc/kernel/uapi/drm/sis_drm.h
index ba88ea9..1606a85 100644
--- a/libc/kernel/uapi/drm/sis_drm.h
+++ b/libc/kernel/uapi/drm/sis_drm.h
@@ -20,6 +20,7 @@
 #define __SIS_DRM_H__
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define NOT_USED_0_3
 #define DRM_SIS_FB_ALLOC 0x04
@@ -48,5 +49,6 @@
   unsigned long offset, size;
 } drm_sis_fb_t;
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/tegra_drm.h b/libc/kernel/uapi/drm/tegra_drm.h
index ee111dc..5244a27 100644
--- a/libc/kernel/uapi/drm/tegra_drm.h
+++ b/libc/kernel/uapi/drm/tegra_drm.h
@@ -20,6 +20,7 @@
 #define _UAPI_TEGRA_DRM_H_
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define DRM_TEGRA_GEM_CREATE_TILED (1 << 0)
 #define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1)
@@ -163,5 +164,6 @@
 #define DRM_IOCTL_TEGRA_GEM_SET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_FLAGS, struct drm_tegra_gem_set_flags)
 #define DRM_IOCTL_TEGRA_GEM_GET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_FLAGS, struct drm_tegra_gem_get_flags)
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/v3d_drm.h b/libc/kernel/uapi/drm/v3d_drm.h
index c3e58cb..985f327 100644
--- a/libc/kernel/uapi/drm/v3d_drm.h
+++ b/libc/kernel/uapi/drm/v3d_drm.h
@@ -20,6 +20,7 @@
 #define _V3D_DRM_H_
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define DRM_V3D_SUBMIT_CL 0x00
 #define DRM_V3D_WAIT_BO 0x01
@@ -27,12 +28,14 @@
 #define DRM_V3D_MMAP_BO 0x03
 #define DRM_V3D_GET_PARAM 0x04
 #define DRM_V3D_GET_BO_OFFSET 0x05
+#define DRM_V3D_SUBMIT_TFU 0x06
 #define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
 #define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
 #define DRM_IOCTL_V3D_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_CREATE_BO, struct drm_v3d_create_bo)
 #define DRM_IOCTL_V3D_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_MMAP_BO, struct drm_v3d_mmap_bo)
 #define DRM_IOCTL_V3D_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_PARAM, struct drm_v3d_get_param)
 #define DRM_IOCTL_V3D_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_BO_OFFSET, struct drm_v3d_get_bo_offset)
+#define DRM_IOCTL_V3D_SUBMIT_TFU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_TFU, struct drm_v3d_submit_tfu)
 struct drm_v3d_submit_cl {
   __u32 bcl_start;
   __u32 bcl_end;
@@ -72,6 +75,7 @@
   DRM_V3D_PARAM_V3D_CORE0_IDENT0,
   DRM_V3D_PARAM_V3D_CORE0_IDENT1,
   DRM_V3D_PARAM_V3D_CORE0_IDENT2,
+  DRM_V3D_PARAM_SUPPORTS_TFU,
 };
 struct drm_v3d_get_param {
   __u32 param;
@@ -82,6 +86,20 @@
   __u32 handle;
   __u32 offset;
 };
+struct drm_v3d_submit_tfu {
+  __u32 icfg;
+  __u32 iia;
+  __u32 iis;
+  __u32 ica;
+  __u32 iua;
+  __u32 ioa;
+  __u32 ios;
+  __u32 coef[4];
+  __u32 bo_handles[4];
+  __u32 in_sync;
+  __u32 out_sync;
+};
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/vc4_drm.h b/libc/kernel/uapi/drm/vc4_drm.h
index 29eb872..fde443f 100644
--- a/libc/kernel/uapi/drm/vc4_drm.h
+++ b/libc/kernel/uapi/drm/vc4_drm.h
@@ -20,6 +20,7 @@
 #define _UAPI_VC4_DRM_H_
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define DRM_VC4_SUBMIT_CL 0x00
 #define DRM_VC4_WAIT_SEQNO 0x01
@@ -233,5 +234,6 @@
   __u64 values_ptr;
 };
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/vgem_drm.h b/libc/kernel/uapi/drm/vgem_drm.h
index 7b0ebc9..b33452b 100644
--- a/libc/kernel/uapi/drm/vgem_drm.h
+++ b/libc/kernel/uapi/drm/vgem_drm.h
@@ -20,6 +20,7 @@
 #define _UAPI_VGEM_DRM_H_
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define DRM_VGEM_FENCE_ATTACH 0x1
 #define DRM_VGEM_FENCE_SIGNAL 0x2
@@ -37,5 +38,6 @@
   __u32 flags;
 };
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/via_drm.h b/libc/kernel/uapi/drm/via_drm.h
index fd4948d..9ef645a 100644
--- a/libc/kernel/uapi/drm/via_drm.h
+++ b/libc/kernel/uapi/drm/via_drm.h
@@ -20,6 +20,7 @@
 #define _VIA_DRM_H_
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #ifndef _VIA_DEFINES_
 #define _VIA_DEFINES_
@@ -196,5 +197,6 @@
   drm_via_blitsync_t sync;
 } drm_via_dmablit_t;
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/virtgpu_drm.h b/libc/kernel/uapi/drm/virtgpu_drm.h
index 6b7fb0b..bc4aad4 100644
--- a/libc/kernel/uapi/drm/virtgpu_drm.h
+++ b/libc/kernel/uapi/drm/virtgpu_drm.h
@@ -20,6 +20,7 @@
 #define VIRTGPU_DRM_H
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define DRM_VIRTGPU_MAP 0x01
 #define DRM_VIRTGPU_EXECBUFFER 0x02
@@ -30,6 +31,9 @@
 #define DRM_VIRTGPU_TRANSFER_TO_HOST 0x07
 #define DRM_VIRTGPU_WAIT 0x08
 #define DRM_VIRTGPU_GET_CAPS 0x09
+#define VIRTGPU_EXECBUF_FENCE_FD_IN 0x01
+#define VIRTGPU_EXECBUF_FENCE_FD_OUT 0x02
+#define VIRTGPU_EXECBUF_FLAGS (VIRTGPU_EXECBUF_FENCE_FD_IN | VIRTGPU_EXECBUF_FENCE_FD_OUT | 0)
 struct drm_virtgpu_map {
   __u64 offset;
   __u32 handle;
@@ -41,7 +45,7 @@
   __u64 command;
   __u64 bo_handles;
   __u32 num_bo_handles;
-  __u32 pad;
+  __s32 fence_fd;
 };
 #define VIRTGPU_PARAM_3D_FEATURES 1
 #define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2
@@ -104,7 +108,7 @@
   __u32 pad;
 };
 #define DRM_IOCTL_VIRTGPU_MAP DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MAP, struct drm_virtgpu_map)
-#define DRM_IOCTL_VIRTGPU_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER, struct drm_virtgpu_execbuffer)
+#define DRM_IOCTL_VIRTGPU_EXECBUFFER DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER, struct drm_virtgpu_execbuffer)
 #define DRM_IOCTL_VIRTGPU_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GETPARAM, struct drm_virtgpu_getparam)
 #define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE, struct drm_virtgpu_resource_create)
 #define DRM_IOCTL_VIRTGPU_RESOURCE_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_INFO, struct drm_virtgpu_resource_info)
@@ -113,5 +117,6 @@
 #define DRM_IOCTL_VIRTGPU_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_WAIT, struct drm_virtgpu_3d_wait)
 #define DRM_IOCTL_VIRTGPU_GET_CAPS DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, struct drm_virtgpu_get_caps)
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/drm/vmwgfx_drm.h b/libc/kernel/uapi/drm/vmwgfx_drm.h
index 7df722a..bb1f36d 100644
--- a/libc/kernel/uapi/drm/vmwgfx_drm.h
+++ b/libc/kernel/uapi/drm/vmwgfx_drm.h
@@ -20,6 +20,7 @@
 #define __VMWGFX_DRM_H__
 #include "drm.h"
 #ifdef __cplusplus
+extern "C" {
 #endif
 #define DRM_VMW_MAX_SURFACE_FACES 6
 #define DRM_VMW_MAX_MIP_LEVELS 24
@@ -350,5 +351,6 @@
   struct drm_vmw_surface_arg req;
 };
 #ifdef __cplusplus
+}
 #endif
 #endif
diff --git a/libc/kernel/uapi/linux/android/binder.h b/libc/kernel/uapi/linux/android/binder.h
index 538a441..542cf1c 100644
--- a/libc/kernel/uapi/linux/android/binder.h
+++ b/libc/kernel/uapi/linux/android/binder.h
@@ -34,6 +34,7 @@
 enum {
   FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,
   FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
+  FLAT_BINDER_FLAG_TXN_SECURITY_CTX = 0x1000,
 };
 #ifdef BINDER_IPC_32BIT
 typedef __u32 binder_size_t;
@@ -103,6 +104,14 @@
   __u32 has_strong_ref;
   __u32 has_weak_ref;
 };
+struct binder_node_info_for_ref {
+  __u32 handle;
+  __u32 strong_count;
+  __u32 weak_count;
+  __u32 reserved1;
+  __u32 reserved2;
+  __u32 reserved3;
+};
 #define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
 #define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
 #define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
@@ -111,6 +120,8 @@
 #define BINDER_THREAD_EXIT _IOW('b', 8, __s32)
 #define BINDER_VERSION _IOWR('b', 9, struct binder_version)
 #define BINDER_GET_NODE_DEBUG_INFO _IOWR('b', 11, struct binder_node_debug_info)
+#define BINDER_GET_NODE_INFO_FOR_REF _IOWR('b', 12, struct binder_node_info_for_ref)
+#define BINDER_SET_CONTEXT_MGR_EXT _IOW('b', 13, struct flat_binder_object)
 enum transaction_flags {
   TF_ONE_WAY = 0x01,
   TF_ROOT_OBJECT = 0x04,
@@ -137,6 +148,10 @@
     __u8 buf[8];
   } data;
 };
+struct binder_transaction_data_secctx {
+  struct binder_transaction_data transaction_data;
+  binder_uintptr_t secctx;
+};
 struct binder_transaction_data_sg {
   struct binder_transaction_data transaction_data;
   binder_size_t buffers_size;
@@ -161,6 +176,7 @@
 enum binder_driver_return_protocol {
   BR_ERROR = _IOR('r', 0, __s32),
   BR_OK = _IO('r', 1),
+  BR_TRANSACTION_SEC_CTX = _IOR('r', 2, struct binder_transaction_data_secctx),
   BR_TRANSACTION = _IOR('r', 2, struct binder_transaction_data),
   BR_REPLY = _IOR('r', 3, struct binder_transaction_data),
   BR_ACQUIRE_RESULT = _IOR('r', 4, __s32),
diff --git a/libc/kernel/uapi/linux/android/binderfs.h b/libc/kernel/uapi/linux/android/binderfs.h
new file mode 100644
index 0000000..d58c333
--- /dev/null
+++ b/libc/kernel/uapi/linux/android/binderfs.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_BINDERFS_H
+#define _UAPI_LINUX_BINDERFS_H
+#include <linux/android/binder.h>
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#define BINDERFS_MAX_NAME 255
+struct binderfs_device {
+  char name[BINDERFS_MAX_NAME + 1];
+  __u32 major;
+  __u32 minor;
+};
+#define BINDER_CTL_ADD _IOWR('b', 1, struct binderfs_device)
+#endif
diff --git a/libc/kernel/uapi/linux/audit.h b/libc/kernel/uapi/linux/audit.h
index 235a0e7..0698fc8 100644
--- a/libc/kernel/uapi/linux/audit.h
+++ b/libc/kernel/uapi/linux/audit.h
@@ -265,6 +265,7 @@
 #define AUDIT_ARCH_ARM (EM_ARM | __AUDIT_ARCH_LE)
 #define AUDIT_ARCH_ARMEB (EM_ARM)
 #define AUDIT_ARCH_CRIS (EM_CRIS | __AUDIT_ARCH_LE)
+#define AUDIT_ARCH_CSKY (EM_CSKY | __AUDIT_ARCH_LE)
 #define AUDIT_ARCH_FRV (EM_FRV)
 #define AUDIT_ARCH_I386 (EM_386 | __AUDIT_ARCH_LE)
 #define AUDIT_ARCH_IA64 (EM_IA_64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
@@ -283,6 +284,8 @@
 #define AUDIT_ARCH_PPC (EM_PPC)
 #define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT)
 #define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
+#define AUDIT_ARCH_RISCV32 (EM_RISCV | __AUDIT_ARCH_LE)
+#define AUDIT_ARCH_RISCV64 (EM_RISCV | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
 #define AUDIT_ARCH_S390 (EM_S390)
 #define AUDIT_ARCH_S390X (EM_S390 | __AUDIT_ARCH_64BIT)
 #define AUDIT_ARCH_SH (EM_SH)
@@ -295,6 +298,7 @@
 #define AUDIT_ARCH_TILEGX32 (EM_TILEGX | __AUDIT_ARCH_LE)
 #define AUDIT_ARCH_TILEPRO (EM_TILEPRO | __AUDIT_ARCH_LE)
 #define AUDIT_ARCH_X86_64 (EM_X86_64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
+#define AUDIT_ARCH_XTENSA (EM_XTENSA)
 #define AUDIT_PERM_EXEC 1
 #define AUDIT_PERM_WRITE 2
 #define AUDIT_PERM_READ 4
diff --git a/libc/kernel/uapi/linux/auto_fs.h b/libc/kernel/uapi/linux/auto_fs.h
index 0264b86..9a9dd65 100644
--- a/libc/kernel/uapi/linux/auto_fs.h
+++ b/libc/kernel/uapi/linux/auto_fs.h
@@ -24,7 +24,7 @@
 #define AUTOFS_PROTO_VERSION 5
 #define AUTOFS_MIN_PROTO_VERSION 3
 #define AUTOFS_MAX_PROTO_VERSION 5
-#define AUTOFS_PROTO_SUBVERSION 3
+#define AUTOFS_PROTO_SUBVERSION 4
 #if defined(__ia64__) || defined(__alpha__)
 typedef unsigned long autofs_wqt_t;
 #else
diff --git a/libc/kernel/uapi/linux/blkzoned.h b/libc/kernel/uapi/linux/blkzoned.h
index eaff1d8..62f826f 100644
--- a/libc/kernel/uapi/linux/blkzoned.h
+++ b/libc/kernel/uapi/linux/blkzoned.h
@@ -57,4 +57,6 @@
 };
 #define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report)
 #define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range)
+#define BLKGETZONESZ _IOR(0x12, 132, __u32)
+#define BLKGETNRZONES _IOR(0x12, 133, __u32)
 #endif
diff --git a/libc/kernel/uapi/linux/bpf.h b/libc/kernel/uapi/linux/bpf.h
index a187913..894b9f7 100644
--- a/libc/kernel/uapi/linux/bpf.h
+++ b/libc/kernel/uapi/linux/bpf.h
@@ -91,6 +91,7 @@
   BPF_BTF_LOAD,
   BPF_BTF_GET_FD_BY_ID,
   BPF_TASK_FD_QUERY,
+  BPF_MAP_LOOKUP_AND_DELETE_ELEM,
 };
 enum bpf_map_type {
   BPF_MAP_TYPE_UNSPEC,
@@ -114,6 +115,9 @@
   BPF_MAP_TYPE_SOCKHASH,
   BPF_MAP_TYPE_CGROUP_STORAGE,
   BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,
+  BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE,
+  BPF_MAP_TYPE_QUEUE,
+  BPF_MAP_TYPE_STACK,
 };
 enum bpf_prog_type {
   BPF_PROG_TYPE_UNSPEC,
@@ -138,6 +142,7 @@
   BPF_PROG_TYPE_LWT_SEG6LOCAL,
   BPF_PROG_TYPE_LIRC_MODE2,
   BPF_PROG_TYPE_SK_REUSEPORT,
+  BPF_PROG_TYPE_FLOW_DISSECTOR,
 };
 enum bpf_attach_type {
   BPF_CGROUP_INET_INGRESS,
@@ -157,12 +162,14 @@
   BPF_CGROUP_UDP4_SENDMSG,
   BPF_CGROUP_UDP6_SENDMSG,
   BPF_LIRC_MODE2,
+  BPF_FLOW_DISSECTOR,
   __MAX_BPF_ATTACH_TYPE
 };
 #define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
 #define BPF_F_ALLOW_OVERRIDE (1U << 0)
 #define BPF_F_ALLOW_MULTI (1U << 1)
 #define BPF_F_STRICT_ALIGNMENT (1U << 0)
+#define BPF_F_ANY_ALIGNMENT (1U << 1)
 #define BPF_PSEUDO_MAP_FD 1
 #define BPF_PSEUDO_CALL 1
 #define BPF_ANY 0
@@ -171,11 +178,12 @@
 #define BPF_F_NO_PREALLOC (1U << 0)
 #define BPF_F_NO_COMMON_LRU (1U << 1)
 #define BPF_F_NUMA_NODE (1U << 2)
-#define BPF_F_QUERY_EFFECTIVE (1U << 0)
 #define BPF_OBJ_NAME_LEN 16U
 #define BPF_F_RDONLY (1U << 3)
 #define BPF_F_WRONLY (1U << 4)
 #define BPF_F_STACK_BUILD_ID (1U << 5)
+#define BPF_F_ZERO_SEED (1U << 6)
+#define BPF_F_QUERY_EFFECTIVE (1U << 0)
 enum bpf_stack_build_id_status {
   BPF_STACK_BUILD_ID_EMPTY = 0,
   BPF_STACK_BUILD_ID_VALID = 1,
@@ -227,6 +235,13 @@
     char prog_name[BPF_OBJ_NAME_LEN];
     __u32 prog_ifindex;
     __u32 expected_attach_type;
+    __u32 prog_btf_fd;
+    __u32 func_info_rec_size;
+    __aligned_u64 func_info;
+    __u32 func_info_cnt;
+    __u32 line_info_rec_size;
+    __aligned_u64 line_info;
+    __u32 line_info_cnt;
   };
   struct {
     __aligned_u64 pathname;
@@ -295,7 +310,7 @@
     __u64 probe_addr;
   } task_fd_query;
 } __attribute__((aligned(8)));
-#define __BPF_FUNC_MAPPER(FN) FN(unspec), FN(map_lookup_elem), FN(map_update_elem), FN(map_delete_elem), FN(probe_read), FN(ktime_get_ns), FN(trace_printk), FN(get_prandom_u32), FN(get_smp_processor_id), FN(skb_store_bytes), FN(l3_csum_replace), FN(l4_csum_replace), FN(tail_call), FN(clone_redirect), FN(get_current_pid_tgid), FN(get_current_uid_gid), FN(get_current_comm), FN(get_cgroup_classid), FN(skb_vlan_push), FN(skb_vlan_pop), FN(skb_get_tunnel_key), FN(skb_set_tunnel_key), FN(perf_event_read), FN(redirect), FN(get_route_realm), FN(perf_event_output), FN(skb_load_bytes), FN(get_stackid), FN(csum_diff), FN(skb_get_tunnel_opt), FN(skb_set_tunnel_opt), FN(skb_change_proto), FN(skb_change_type), FN(skb_under_cgroup), FN(get_hash_recalc), FN(get_current_task), FN(probe_write_user), FN(current_task_under_cgroup), FN(skb_change_tail), FN(skb_pull_data), FN(csum_update), FN(set_hash_invalid), FN(get_numa_node_id), FN(skb_change_head), FN(xdp_adjust_head), FN(probe_read_str), FN(get_socket_cookie), FN(get_socket_uid), FN(set_hash), FN(setsockopt), FN(skb_adjust_room), FN(redirect_map), FN(sk_redirect_map), FN(sock_map_update), FN(xdp_adjust_meta), FN(perf_event_read_value), FN(perf_prog_read_value), FN(getsockopt), FN(override_return), FN(sock_ops_cb_flags_set), FN(msg_redirect_map), FN(msg_apply_bytes), FN(msg_cork_bytes), FN(msg_pull_data), FN(bind), FN(xdp_adjust_tail), FN(skb_get_xfrm_state), FN(get_stack), FN(skb_load_bytes_relative), FN(fib_lookup), FN(sock_hash_update), FN(msg_redirect_hash), FN(sk_redirect_hash), FN(lwt_push_encap), FN(lwt_seg6_store_bytes), FN(lwt_seg6_adjust_srh), FN(lwt_seg6_action), FN(rc_repeat), FN(rc_keydown), FN(skb_cgroup_id), FN(get_current_cgroup_id), FN(get_local_storage), FN(sk_select_reuseport), FN(skb_ancestor_cgroup_id),
+#define __BPF_FUNC_MAPPER(FN) FN(unspec), FN(map_lookup_elem), FN(map_update_elem), FN(map_delete_elem), FN(probe_read), FN(ktime_get_ns), FN(trace_printk), FN(get_prandom_u32), FN(get_smp_processor_id), FN(skb_store_bytes), FN(l3_csum_replace), FN(l4_csum_replace), FN(tail_call), FN(clone_redirect), FN(get_current_pid_tgid), FN(get_current_uid_gid), FN(get_current_comm), FN(get_cgroup_classid), FN(skb_vlan_push), FN(skb_vlan_pop), FN(skb_get_tunnel_key), FN(skb_set_tunnel_key), FN(perf_event_read), FN(redirect), FN(get_route_realm), FN(perf_event_output), FN(skb_load_bytes), FN(get_stackid), FN(csum_diff), FN(skb_get_tunnel_opt), FN(skb_set_tunnel_opt), FN(skb_change_proto), FN(skb_change_type), FN(skb_under_cgroup), FN(get_hash_recalc), FN(get_current_task), FN(probe_write_user), FN(current_task_under_cgroup), FN(skb_change_tail), FN(skb_pull_data), FN(csum_update), FN(set_hash_invalid), FN(get_numa_node_id), FN(skb_change_head), FN(xdp_adjust_head), FN(probe_read_str), FN(get_socket_cookie), FN(get_socket_uid), FN(set_hash), FN(setsockopt), FN(skb_adjust_room), FN(redirect_map), FN(sk_redirect_map), FN(sock_map_update), FN(xdp_adjust_meta), FN(perf_event_read_value), FN(perf_prog_read_value), FN(getsockopt), FN(override_return), FN(sock_ops_cb_flags_set), FN(msg_redirect_map), FN(msg_apply_bytes), FN(msg_cork_bytes), FN(msg_pull_data), FN(bind), FN(xdp_adjust_tail), FN(skb_get_xfrm_state), FN(get_stack), FN(skb_load_bytes_relative), FN(fib_lookup), FN(sock_hash_update), FN(msg_redirect_hash), FN(sk_redirect_hash), FN(lwt_push_encap), FN(lwt_seg6_store_bytes), FN(lwt_seg6_adjust_srh), FN(lwt_seg6_action), FN(rc_repeat), FN(rc_keydown), FN(skb_cgroup_id), FN(get_current_cgroup_id), FN(get_local_storage), FN(sk_select_reuseport), FN(skb_ancestor_cgroup_id), FN(sk_lookup_tcp), FN(sk_lookup_udp), FN(sk_release), FN(map_push_elem), FN(map_pop_elem), FN(map_peek_elem), FN(msg_push_data), FN(msg_pop_data), FN(rc_pointer_rel),
 #define __BPF_ENUM_FN(x) BPF_FUNC_ ##x
 enum bpf_func_id {
   __BPF_FUNC_MAPPER(__BPF_ENUM_FN) __BPF_FUNC_MAX_ID,
@@ -320,6 +335,7 @@
 #define BPF_F_INDEX_MASK 0xffffffffULL
 #define BPF_F_CURRENT_CPU BPF_F_INDEX_MASK
 #define BPF_F_CTXLEN_MASK (0xfffffULL << 32)
+#define BPF_F_CURRENT_NETNS (- 1L)
 enum bpf_adj_room_mode {
   BPF_ADJ_ROOM_NET,
 };
@@ -331,6 +347,8 @@
   BPF_LWT_ENCAP_SEG6,
   BPF_LWT_ENCAP_SEG6_INLINE
 };
+#define __bpf_md_ptr(type,name) union { type name; __u64 : 64; \
+} __attribute__((aligned(8)))
 struct __sk_buff {
   __u32 len;
   __u32 pkt_type;
@@ -358,6 +376,9 @@
   __u32 remote_port;
   __u32 local_port;
   __u32 data_meta;
+  __bpf_md_ptr(struct bpf_flow_keys *, flow_keys);
+  __u64 tstamp;
+  __u32 wire_len;
 };
 struct bpf_tunnel_key {
   __u32 tunnel_id;
@@ -396,6 +417,22 @@
   __u32 src_ip6[4];
   __u32 src_port;
 };
+struct bpf_sock_tuple {
+  union {
+    struct {
+      __be32 saddr;
+      __be32 daddr;
+      __be16 sport;
+      __be16 dport;
+    } ipv4;
+    struct {
+      __be32 saddr[4];
+      __be32 daddr[4];
+      __be16 sport;
+      __be16 dport;
+    } ipv6;
+  };
+};
 #define XDP_PACKET_HEADROOM 256
 enum xdp_action {
   XDP_ABORTED = 0,
@@ -416,8 +453,8 @@
   SK_PASS,
 };
 struct sk_msg_md {
-  void * data;
-  void * data_end;
+  __bpf_md_ptr(void *, data);
+  __bpf_md_ptr(void *, data_end);
   __u32 family;
   __u32 remote_ip4;
   __u32 local_ip4;
@@ -425,10 +462,11 @@
   __u32 local_ip6[4];
   __u32 remote_port;
   __u32 local_port;
+  __u32 size;
 };
 struct sk_reuseport_md {
-  void * data;
-  void * data_end;
+  __bpf_md_ptr(void *, data);
+  __bpf_md_ptr(void *, data_end);
   __u32 len;
   __u32 eth_protocol;
   __u32 ip_protocol;
@@ -457,6 +495,18 @@
   __u32 nr_jited_func_lens;
   __aligned_u64 jited_ksyms;
   __aligned_u64 jited_func_lens;
+  __u32 btf_id;
+  __u32 func_info_rec_size;
+  __aligned_u64 func_info;
+  __u32 nr_func_info;
+  __u32 nr_line_info;
+  __aligned_u64 line_info;
+  __aligned_u64 jited_line_info;
+  __u32 nr_jited_line_info;
+  __u32 line_info_rec_size;
+  __u32 jited_line_info_rec_size;
+  __u32 nr_prog_tags;
+  __aligned_u64 prog_tags;
 } __attribute__((aligned(8)));
 struct bpf_map_info {
   __u32 type;
@@ -630,4 +680,38 @@
   BPF_FD_TYPE_UPROBE,
   BPF_FD_TYPE_URETPROBE,
 };
+struct bpf_flow_keys {
+  __u16 nhoff;
+  __u16 thoff;
+  __u16 addr_proto;
+  __u8 is_frag;
+  __u8 is_first_frag;
+  __u8 is_encap;
+  __u8 ip_proto;
+  __be16 n_proto;
+  __be16 sport;
+  __be16 dport;
+  union {
+    struct {
+      __be32 ipv4_src;
+      __be32 ipv4_dst;
+    };
+    struct {
+      __u32 ipv6_src[4];
+      __u32 ipv6_dst[4];
+    };
+  };
+};
+struct bpf_func_info {
+  __u32 insn_off;
+  __u32 type_id;
+};
+#define BPF_LINE_INFO_LINE_NUM(line_col) ((line_col) >> 10)
+#define BPF_LINE_INFO_LINE_COL(line_col) ((line_col) & 0x3ff)
+struct bpf_line_info {
+  __u32 insn_off;
+  __u32 file_name_off;
+  __u32 line_off;
+  __u32 line_col;
+};
 #endif
diff --git a/libc/kernel/uapi/linux/btf.h b/libc/kernel/uapi/linux/btf.h
index 33dde5a..6e13631 100644
--- a/libc/kernel/uapi/linux/btf.h
+++ b/libc/kernel/uapi/linux/btf.h
@@ -44,6 +44,7 @@
 };
 #define BTF_INFO_KIND(info) (((info) >> 24) & 0x0f)
 #define BTF_INFO_VLEN(info) ((info) & 0xffff)
+#define BTF_INFO_KFLAG(info) ((info) >> 31)
 #define BTF_KIND_UNKN 0
 #define BTF_KIND_INT 1
 #define BTF_KIND_PTR 2
@@ -56,8 +57,10 @@
 #define BTF_KIND_VOLATILE 9
 #define BTF_KIND_CONST 10
 #define BTF_KIND_RESTRICT 11
-#define BTF_KIND_MAX 11
-#define NR_BTF_KINDS 12
+#define BTF_KIND_FUNC 12
+#define BTF_KIND_FUNC_PROTO 13
+#define BTF_KIND_MAX 13
+#define NR_BTF_KINDS 14
 #define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24)
 #define BTF_INT_OFFSET(VAL) (((VAL & 0x00ff0000)) >> 16)
 #define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff)
@@ -78,4 +81,10 @@
   __u32 type;
   __u32 offset;
 };
+#define BTF_MEMBER_BITFIELD_SIZE(val) ((val) >> 24)
+#define BTF_MEMBER_BIT_OFFSET(val) ((val) & 0xffffff)
+struct btf_param {
+  __u32 name_off;
+  __u32 type;
+};
 #endif
diff --git a/libc/kernel/uapi/linux/btrfs.h b/libc/kernel/uapi/linux/btrfs.h
index 2bb79d8..0dae543 100644
--- a/libc/kernel/uapi/linux/btrfs.h
+++ b/libc/kernel/uapi/linux/btrfs.h
@@ -173,6 +173,7 @@
 #define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7)
 #define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8)
 #define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9)
+#define BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10)
 struct btrfs_ioctl_feature_flags {
   __u64 compat_flags;
   __u64 compat_ro_flags;
diff --git a/libc/kernel/uapi/linux/btrfs_tree.h b/libc/kernel/uapi/linux/btrfs_tree.h
index 6a461ec..0618f66 100644
--- a/libc/kernel/uapi/linux/btrfs_tree.h
+++ b/libc/kernel/uapi/linux/btrfs_tree.h
@@ -166,6 +166,7 @@
 #define BTRFS_SUPER_FLAG_METADUMP (1ULL << 33)
 #define BTRFS_SUPER_FLAG_METADUMP_V2 (1ULL << 34)
 #define BTRFS_SUPER_FLAG_CHANGING_FSID (1ULL << 35)
+#define BTRFS_SUPER_FLAG_CHANGING_FSID_V2 (1ULL << 36)
 struct btrfs_extent_item {
   __le64 refs;
   __le64 generation;
diff --git a/libc/kernel/uapi/linux/cec.h b/libc/kernel/uapi/linux/cec.h
index fd0f824..05af529 100644
--- a/libc/kernel/uapi/linux/cec.h
+++ b/libc/kernel/uapi/linux/cec.h
@@ -44,9 +44,12 @@
 #define CEC_TX_STATUS_LOW_DRIVE (1 << 3)
 #define CEC_TX_STATUS_ERROR (1 << 4)
 #define CEC_TX_STATUS_MAX_RETRIES (1 << 5)
+#define CEC_TX_STATUS_ABORTED (1 << 6)
+#define CEC_TX_STATUS_TIMEOUT (1 << 7)
 #define CEC_RX_STATUS_OK (1 << 0)
 #define CEC_RX_STATUS_TIMEOUT (1 << 1)
 #define CEC_RX_STATUS_FEATURE_ABORT (1 << 2)
+#define CEC_RX_STATUS_ABORTED (1 << 3)
 #define CEC_LOG_ADDR_INVALID 0xff
 #define CEC_PHYS_ADDR_INVALID 0xffff
 #define CEC_MAX_LOG_ADDRS 4
diff --git a/libc/kernel/uapi/linux/cryptouser.h b/libc/kernel/uapi/linux/cryptouser.h
index 15c46d8..b32db64 100644
--- a/libc/kernel/uapi/linux/cryptouser.h
+++ b/libc/kernel/uapi/linux/cryptouser.h
@@ -24,6 +24,7 @@
   CRYPTO_MSG_UPDATEALG,
   CRYPTO_MSG_GETALG,
   CRYPTO_MSG_DELRNG,
+  CRYPTO_MSG_GETSTAT,
   __CRYPTO_MSG_MAX
 };
 #define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
@@ -42,6 +43,16 @@
   CRYPTOCFGA_REPORT_AKCIPHER,
   CRYPTOCFGA_REPORT_KPP,
   CRYPTOCFGA_REPORT_ACOMP,
+  CRYPTOCFGA_STAT_LARVAL,
+  CRYPTOCFGA_STAT_HASH,
+  CRYPTOCFGA_STAT_BLKCIPHER,
+  CRYPTOCFGA_STAT_AEAD,
+  CRYPTOCFGA_STAT_COMPRESS,
+  CRYPTOCFGA_STAT_RNG,
+  CRYPTOCFGA_STAT_CIPHER,
+  CRYPTOCFGA_STAT_AKCIPHER,
+  CRYPTOCFGA_STAT_KPP,
+  CRYPTOCFGA_STAT_ACOMP,
   __CRYPTOCFGA_MAX
 #define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
 };
@@ -54,6 +65,63 @@
   __u32 cru_refcnt;
   __u32 cru_flags;
 };
+struct crypto_stat_aead {
+  char type[CRYPTO_MAX_NAME];
+  __u64 stat_encrypt_cnt;
+  __u64 stat_encrypt_tlen;
+  __u64 stat_decrypt_cnt;
+  __u64 stat_decrypt_tlen;
+  __u64 stat_err_cnt;
+};
+struct crypto_stat_akcipher {
+  char type[CRYPTO_MAX_NAME];
+  __u64 stat_encrypt_cnt;
+  __u64 stat_encrypt_tlen;
+  __u64 stat_decrypt_cnt;
+  __u64 stat_decrypt_tlen;
+  __u64 stat_verify_cnt;
+  __u64 stat_sign_cnt;
+  __u64 stat_err_cnt;
+};
+struct crypto_stat_cipher {
+  char type[CRYPTO_MAX_NAME];
+  __u64 stat_encrypt_cnt;
+  __u64 stat_encrypt_tlen;
+  __u64 stat_decrypt_cnt;
+  __u64 stat_decrypt_tlen;
+  __u64 stat_err_cnt;
+};
+struct crypto_stat_compress {
+  char type[CRYPTO_MAX_NAME];
+  __u64 stat_compress_cnt;
+  __u64 stat_compress_tlen;
+  __u64 stat_decompress_cnt;
+  __u64 stat_decompress_tlen;
+  __u64 stat_err_cnt;
+};
+struct crypto_stat_hash {
+  char type[CRYPTO_MAX_NAME];
+  __u64 stat_hash_cnt;
+  __u64 stat_hash_tlen;
+  __u64 stat_err_cnt;
+};
+struct crypto_stat_kpp {
+  char type[CRYPTO_MAX_NAME];
+  __u64 stat_setsecret_cnt;
+  __u64 stat_generate_public_key_cnt;
+  __u64 stat_compute_shared_secret_cnt;
+  __u64 stat_err_cnt;
+};
+struct crypto_stat_rng {
+  char type[CRYPTO_MAX_NAME];
+  __u64 stat_generate_cnt;
+  __u64 stat_generate_tlen;
+  __u64 stat_seed_cnt;
+  __u64 stat_err_cnt;
+};
+struct crypto_stat_larval {
+  char type[CRYPTO_MAX_NAME];
+};
 struct crypto_report_larval {
   char type[CRYPTO_MAX_NAME];
 };
diff --git a/libc/kernel/uapi/linux/devlink.h b/libc/kernel/uapi/linux/devlink.h
index ead40ad..7c55a0a 100644
--- a/libc/kernel/uapi/linux/devlink.h
+++ b/libc/kernel/uapi/linux/devlink.h
@@ -115,6 +115,10 @@
   __DEVLINK_PARAM_CMODE_MAX,
   DEVLINK_PARAM_CMODE_MAX = __DEVLINK_PARAM_CMODE_MAX - 1
 };
+enum devlink_param_fw_load_policy_value {
+  DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER,
+  DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH,
+};
 enum devlink_attr {
   DEVLINK_ATTR_UNSPEC,
   DEVLINK_ATTR_BUS_NAME,
diff --git a/libc/kernel/uapi/linux/dns_resolver.h b/libc/kernel/uapi/linux/dns_resolver.h
new file mode 100644
index 0000000..21cb5c0
--- /dev/null
+++ b/libc/kernel/uapi/linux/dns_resolver.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_DNS_RESOLVER_H
+#define _UAPI_LINUX_DNS_RESOLVER_H
+#include <linux/types.h>
+enum dns_payload_content_type {
+  DNS_PAYLOAD_IS_SERVER_LIST = 0,
+};
+enum dns_payload_address_type {
+  DNS_ADDRESS_IS_IPV4 = 0,
+  DNS_ADDRESS_IS_IPV6 = 1,
+};
+enum dns_payload_protocol_type {
+  DNS_SERVER_PROTOCOL_UNSPECIFIED = 0,
+  DNS_SERVER_PROTOCOL_UDP = 1,
+  DNS_SERVER_PROTOCOL_TCP = 2,
+};
+enum dns_record_source {
+  DNS_RECORD_UNAVAILABLE = 0,
+  DNS_RECORD_FROM_CONFIG = 1,
+  DNS_RECORD_FROM_DNS_A = 2,
+  DNS_RECORD_FROM_DNS_AFSDB = 3,
+  DNS_RECORD_FROM_DNS_SRV = 4,
+  DNS_RECORD_FROM_NSS = 5,
+  NR__dns_record_source
+};
+enum dns_lookup_status {
+  DNS_LOOKUP_NOT_DONE = 0,
+  DNS_LOOKUP_GOOD = 1,
+  DNS_LOOKUP_GOOD_WITH_BAD = 2,
+  DNS_LOOKUP_BAD = 3,
+  DNS_LOOKUP_GOT_NOT_FOUND = 4,
+  DNS_LOOKUP_GOT_LOCAL_FAILURE = 5,
+  DNS_LOOKUP_GOT_TEMP_FAILURE = 6,
+  DNS_LOOKUP_GOT_NS_FAILURE = 7,
+  NR__dns_lookup_status
+};
+struct dns_payload_header {
+  __u8 zero;
+  __u8 content;
+  __u8 version;
+} __packed;
+struct dns_server_list_v1_header {
+  struct dns_payload_header hdr;
+  __u8 source;
+  __u8 status;
+  __u8 nr_servers;
+} __packed;
+struct dns_server_list_v1_server {
+  __u16 name_len;
+  __u16 priority;
+  __u16 weight;
+  __u16 port;
+  __u8 source;
+  __u8 status;
+  __u8 protocol;
+  __u8 nr_addrs;
+} __packed;
+struct dns_server_list_v1_address {
+  __u8 address_type;
+} __packed;
+#endif
diff --git a/libc/kernel/uapi/linux/elf-em.h b/libc/kernel/uapi/linux/elf-em.h
index b7c89da..99835ae 100644
--- a/libc/kernel/uapi/linux/elf-em.h
+++ b/libc/kernel/uapi/linux/elf-em.h
@@ -45,6 +45,7 @@
 #define EM_M32R 88
 #define EM_MN10300 89
 #define EM_OPENRISC 92
+#define EM_XTENSA 94
 #define EM_BLACKFIN 106
 #define EM_ALTERA_NIOS2 113
 #define EM_TI_C6000 140
@@ -52,7 +53,9 @@
 #define EM_TILEPRO 188
 #define EM_MICROBLAZE 189
 #define EM_TILEGX 191
+#define EM_RISCV 243
 #define EM_BPF 247
+#define EM_CSKY 252
 #define EM_FRV 0x5441
 #define EM_ALPHA 0x9026
 #define EM_CYGNUS_M32R 0x9041
diff --git a/libc/kernel/uapi/linux/elf.h b/libc/kernel/uapi/linux/elf.h
index 1f69e1b..9845bd3 100644
--- a/libc/kernel/uapi/linux/elf.h
+++ b/libc/kernel/uapi/linux/elf.h
@@ -355,10 +355,12 @@
 #define NT_ARM_HW_WATCH 0x403
 #define NT_ARM_SYSTEM_CALL 0x404
 #define NT_ARM_SVE 0x405
+#define NT_ARM_PAC_MASK 0x406
 #define NT_ARC_V2 0x600
 #define NT_VMCOREDD 0x700
 #define NT_MIPS_DSP 0x800
 #define NT_MIPS_FP_MODE 0x801
+#define NT_MIPS_MSA 0x802
 typedef struct elf32_note {
   Elf32_Word n_namesz;
   Elf32_Word n_descsz;
diff --git a/libc/kernel/uapi/linux/fanotify.h b/libc/kernel/uapi/linux/fanotify.h
index 73d92ca..4c33fde 100644
--- a/libc/kernel/uapi/linux/fanotify.h
+++ b/libc/kernel/uapi/linux/fanotify.h
@@ -24,9 +24,11 @@
 #define FAN_CLOSE_WRITE 0x00000008
 #define FAN_CLOSE_NOWRITE 0x00000010
 #define FAN_OPEN 0x00000020
+#define FAN_OPEN_EXEC 0x00001000
 #define FAN_Q_OVERFLOW 0x00004000
 #define FAN_OPEN_PERM 0x00010000
 #define FAN_ACCESS_PERM 0x00020000
+#define FAN_OPEN_EXEC_PERM 0x00040000
 #define FAN_ONDIR 0x40000000
 #define FAN_EVENT_ON_CHILD 0x08000000
 #define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE)
@@ -39,15 +41,18 @@
 #define FAN_UNLIMITED_QUEUE 0x00000010
 #define FAN_UNLIMITED_MARKS 0x00000020
 #define FAN_ENABLE_AUDIT 0x00000040
+#define FAN_REPORT_TID 0x00000100
 #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS)
 #define FAN_MARK_ADD 0x00000001
 #define FAN_MARK_REMOVE 0x00000002
 #define FAN_MARK_DONT_FOLLOW 0x00000004
 #define FAN_MARK_ONLYDIR 0x00000008
-#define FAN_MARK_MOUNT 0x00000010
 #define FAN_MARK_IGNORED_MASK 0x00000020
 #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
 #define FAN_MARK_FLUSH 0x00000080
+#define FAN_MARK_INODE 0x00000000
+#define FAN_MARK_MOUNT 0x00000010
+#define FAN_MARK_FILESYSTEM 0x00000100
 #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD | FAN_MARK_REMOVE | FAN_MARK_DONT_FOLLOW | FAN_MARK_ONLYDIR | FAN_MARK_MOUNT | FAN_MARK_IGNORED_MASK | FAN_MARK_IGNORED_SURV_MODIFY | FAN_MARK_FLUSH)
 #define FAN_ALL_EVENTS (FAN_ACCESS | FAN_MODIFY | FAN_CLOSE | FAN_OPEN)
 #define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM | FAN_ACCESS_PERM)
diff --git a/libc/kernel/uapi/linux/fb.h b/libc/kernel/uapi/linux/fb.h
index 9f6b139..38da042 100644
--- a/libc/kernel/uapi/linux/fb.h
+++ b/libc/kernel/uapi/linux/fb.h
@@ -320,4 +320,6 @@
   struct fbcurpos hot;
   struct fb_image image;
 };
+#define FB_BACKLIGHT_LEVELS 128
+#define FB_BACKLIGHT_MAX 0xFF
 #endif
diff --git a/libc/kernel/uapi/linux/fs.h b/libc/kernel/uapi/linux/fs.h
index 5c237d8..84dc010 100644
--- a/libc/kernel/uapi/linux/fs.h
+++ b/libc/kernel/uapi/linux/fs.h
@@ -21,6 +21,7 @@
 #include <linux/limits.h>
 #include <linux/ioctl.h>
 #include <linux/types.h>
+#include <linux/mount.h>
 #undef NR_OPEN
 #define INR_OPEN_CUR 1024
 #define INR_OPEN_MAX 4096
@@ -74,40 +75,6 @@
   long dummy[5];
 };
 #define NR_FILE 8192
-#define MS_RDONLY 1
-#define MS_NOSUID 2
-#define MS_NODEV 4
-#define MS_NOEXEC 8
-#define MS_SYNCHRONOUS 16
-#define MS_REMOUNT 32
-#define MS_MANDLOCK 64
-#define MS_DIRSYNC 128
-#define MS_NOATIME 1024
-#define MS_NODIRATIME 2048
-#define MS_BIND 4096
-#define MS_MOVE 8192
-#define MS_REC 16384
-#define MS_VERBOSE 32768
-#define MS_SILENT 32768
-#define MS_POSIXACL (1 << 16)
-#define MS_UNBINDABLE (1 << 17)
-#define MS_PRIVATE (1 << 18)
-#define MS_SLAVE (1 << 19)
-#define MS_SHARED (1 << 20)
-#define MS_RELATIME (1 << 21)
-#define MS_KERNMOUNT (1 << 22)
-#define MS_I_VERSION (1 << 23)
-#define MS_STRICTATIME (1 << 24)
-#define MS_LAZYTIME (1 << 25)
-#define MS_SUBMOUNT (1 << 26)
-#define MS_NOREMOTELOCK (1 << 27)
-#define MS_NOSEC (1 << 28)
-#define MS_BORN (1 << 29)
-#define MS_ACTIVE (1 << 30)
-#define MS_NOUSER (1 << 31)
-#define MS_RMT_MASK (MS_RDONLY | MS_SYNCHRONOUS | MS_MANDLOCK | MS_I_VERSION | MS_LAZYTIME)
-#define MS_MGC_VAL 0xC0ED0000
-#define MS_MGC_MSK 0xffff0000
 struct fsxattr {
   __u32 fsx_xflags;
   __u32 fsx_extsize;
@@ -190,7 +157,8 @@
 #define FS_POLICY_FLAGS_PAD_16 0x02
 #define FS_POLICY_FLAGS_PAD_32 0x03
 #define FS_POLICY_FLAGS_PAD_MASK 0x03
-#define FS_POLICY_FLAGS_VALID 0x03
+#define FS_POLICY_FLAG_DIRECT_KEY 0x04
+#define FS_POLICY_FLAGS_VALID 0x07
 #define FS_ENCRYPTION_MODE_INVALID 0
 #define FS_ENCRYPTION_MODE_AES_256_XTS 1
 #define FS_ENCRYPTION_MODE_AES_256_GCM 2
@@ -200,6 +168,7 @@
 #define FS_ENCRYPTION_MODE_AES_128_CTS 6
 #define FS_ENCRYPTION_MODE_SPECK128_256_XTS 7
 #define FS_ENCRYPTION_MODE_SPECK128_256_CTS 8
+#define FS_ENCRYPTION_MODE_ADIANTUM 9
 struct fscrypt_policy {
   __u8 version;
   __u8 contents_encryption_mode;
diff --git a/libc/kernel/uapi/linux/fuse.h b/libc/kernel/uapi/linux/fuse.h
index a727580..3c3a124 100644
--- a/libc/kernel/uapi/linux/fuse.h
+++ b/libc/kernel/uapi/linux/fuse.h
@@ -20,7 +20,7 @@
 #define _LINUX_FUSE_H
 #include <stdint.h>
 #define FUSE_KERNEL_VERSION 7
-#define FUSE_KERNEL_MINOR_VERSION 27
+#define FUSE_KERNEL_MINOR_VERSION 28
 #define FUSE_ROOT_ID 1
 struct fuse_attr {
   uint64_t ino;
@@ -72,6 +72,7 @@
 #define FOPEN_DIRECT_IO (1 << 0)
 #define FOPEN_KEEP_CACHE (1 << 1)
 #define FOPEN_NONSEEKABLE (1 << 2)
+#define FOPEN_CACHE_DIR (1 << 3)
 #define FUSE_ASYNC_READ (1 << 0)
 #define FUSE_POSIX_LOCKS (1 << 1)
 #define FUSE_FILE_OPS (1 << 2)
@@ -94,6 +95,8 @@
 #define FUSE_HANDLE_KILLPRIV (1 << 19)
 #define FUSE_POSIX_ACL (1 << 20)
 #define FUSE_ABORT_ERROR (1 << 21)
+#define FUSE_MAX_PAGES (1 << 22)
+#define FUSE_CACHE_SYMLINKS (1 << 23)
 #define CUSE_UNRESTRICTED_IOCTL (1 << 0)
 #define FUSE_RELEASE_FLUSH (1 << 0)
 #define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
@@ -154,6 +157,7 @@
   FUSE_READDIRPLUS = 44,
   FUSE_RENAME2 = 45,
   FUSE_LSEEK = 46,
+  FUSE_COPY_FILE_RANGE = 47,
   CUSE_INIT = 4096,
 };
 enum fuse_notify_code {
@@ -341,7 +345,9 @@
   uint16_t congestion_threshold;
   uint32_t max_write;
   uint32_t time_gran;
-  uint32_t unused[9];
+  uint16_t max_pages;
+  uint16_t padding;
+  uint32_t unused[8];
 };
 #define CUSE_INIT_INFO_MAX 4096
 struct cuse_init_in {
@@ -488,4 +494,13 @@
 struct fuse_lseek_out {
   uint64_t offset;
 };
+struct fuse_copy_file_range_in {
+  uint64_t fh_in;
+  uint64_t off_in;
+  uint64_t nodeid_out;
+  uint64_t fh_out;
+  uint64_t off_out;
+  uint64_t len;
+  uint64_t flags;
+};
 #endif
diff --git a/libc/kernel/uapi/linux/gen_stats.h b/libc/kernel/uapi/linux/gen_stats.h
index 127ae88..0b6c228 100644
--- a/libc/kernel/uapi/linux/gen_stats.h
+++ b/libc/kernel/uapi/linux/gen_stats.h
@@ -27,6 +27,7 @@
   TCA_STATS_APP,
   TCA_STATS_RATE_EST64,
   TCA_STATS_PAD,
+  TCA_STATS_BASIC_HW,
   __TCA_STATS_MAX,
 };
 #define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
diff --git a/libc/kernel/uapi/linux/hash_info.h b/libc/kernel/uapi/linux/hash_info.h
index 898e46f..824b71a 100644
--- a/libc/kernel/uapi/linux/hash_info.h
+++ b/libc/kernel/uapi/linux/hash_info.h
@@ -37,6 +37,8 @@
   HASH_ALGO_TGR_160,
   HASH_ALGO_TGR_192,
   HASH_ALGO_SM3_256,
+  HASH_ALGO_STREEBOG_256,
+  HASH_ALGO_STREEBOG_512,
   HASH_ALGO__LAST
 };
 #endif
diff --git a/libc/kernel/uapi/linux/if_addr.h b/libc/kernel/uapi/linux/if_addr.h
index 0a4b0ae..6a6b640 100644
--- a/libc/kernel/uapi/linux/if_addr.h
+++ b/libc/kernel/uapi/linux/if_addr.h
@@ -38,6 +38,7 @@
   IFA_MULTICAST,
   IFA_FLAGS,
   IFA_RT_PRIORITY,
+  IFA_TARGET_NETNSID,
   __IFA_MAX,
 };
 #define IFA_MAX (__IFA_MAX - 1)
diff --git a/libc/kernel/uapi/linux/if_arp.h b/libc/kernel/uapi/linux/if_arp.h
index 0b1959d..eda888f 100644
--- a/libc/kernel/uapi/linux/if_arp.h
+++ b/libc/kernel/uapi/linux/if_arp.h
@@ -98,7 +98,7 @@
   struct sockaddr arp_ha;
   int arp_flags;
   struct sockaddr arp_netmask;
-  char arp_dev[16];
+  char arp_dev[IFNAMSIZ];
 };
 struct arpreq_old {
   struct sockaddr arp_pa;
diff --git a/libc/kernel/uapi/linux/if_bridge.h b/libc/kernel/uapi/linux/if_bridge.h
index 7e6a72f..31683c1 100644
--- a/libc/kernel/uapi/linux/if_bridge.h
+++ b/libc/kernel/uapi/linux/if_bridge.h
@@ -237,4 +237,12 @@
   __u64 mcast_bytes[BR_MCAST_DIR_SIZE];
   __u64 mcast_packets[BR_MCAST_DIR_SIZE];
 };
+enum br_boolopt_id {
+  BR_BOOLOPT_NO_LL_LEARN,
+  BR_BOOLOPT_MAX
+};
+struct br_boolopt_multi {
+  __u32 optval;
+  __u32 optmask;
+};
 #endif
diff --git a/libc/kernel/uapi/linux/if_fddi.h b/libc/kernel/uapi/linux/if_fddi.h
index 4efd7f8..4b5074b 100644
--- a/libc/kernel/uapi/linux/if_fddi.h
+++ b/libc/kernel/uapi/linux/if_fddi.h
@@ -29,6 +29,18 @@
 #define FDDI_K_LLC_ZLEN 13
 #define FDDI_K_LLC_LEN 4491
 #define FDDI_K_OUI_LEN 3
+#define FDDI_FC_K_CLASS_MASK 0x80
+#define FDDI_FC_K_CLASS_SYNC 0x80
+#define FDDI_FC_K_CLASS_ASYNC 0x00
+#define FDDI_FC_K_ALEN_MASK 0x40
+#define FDDI_FC_K_ALEN_48 0x40
+#define FDDI_FC_K_ALEN_16 0x00
+#define FDDI_FC_K_FORMAT_MASK 0x30
+#define FDDI_FC_K_FORMAT_FUTURE 0x30
+#define FDDI_FC_K_FORMAT_IMPLEMENTOR 0x20
+#define FDDI_FC_K_FORMAT_LLC 0x10
+#define FDDI_FC_K_FORMAT_MANAGEMENT 0x00
+#define FDDI_FC_K_CONTROL_MASK 0x0f
 #define FDDI_FC_K_VOID 0x00
 #define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80
 #define FDDI_FC_K_RESTRICTED_TOKEN 0xC0
diff --git a/libc/kernel/uapi/linux/if_link.h b/libc/kernel/uapi/linux/if_link.h
index 4bbf21d..416c48b 100644
--- a/libc/kernel/uapi/linux/if_link.h
+++ b/libc/kernel/uapi/linux/if_link.h
@@ -138,6 +138,7 @@
   IFLA_EVENT,
   IFLA_NEW_NETNSID,
   IFLA_IF_NETNSID,
+  IFLA_TARGET_NETNSID = IFLA_IF_NETNSID,
   IFLA_CARRIER_UP_COUNT,
   IFLA_CARRIER_DOWN_COUNT,
   IFLA_NEW_IFINDEX,
@@ -219,6 +220,8 @@
   IFLA_BR_MCAST_STATS_ENABLED,
   IFLA_BR_MCAST_IGMP_VERSION,
   IFLA_BR_MCAST_MLD_VERSION,
+  IFLA_BR_VLAN_STATS_PER_PORT,
+  IFLA_BR_MULTI_BOOLOPT,
   __IFLA_BR_MAX,
 };
 #define IFLA_BR_MAX (__IFLA_BR_MAX - 1)
@@ -424,6 +427,7 @@
   IFLA_VXLAN_LABEL,
   IFLA_VXLAN_GPE,
   IFLA_VXLAN_TTL_INHERIT,
+  IFLA_VXLAN_DF,
   __IFLA_VXLAN_MAX
 };
 #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
@@ -431,6 +435,13 @@
   __be16 low;
   __be16 high;
 };
+enum ifla_vxlan_df {
+  VXLAN_DF_UNSET = 0,
+  VXLAN_DF_SET,
+  VXLAN_DF_INHERIT,
+  __VXLAN_DF_END,
+  VXLAN_DF_MAX = __VXLAN_DF_END - 1,
+};
 enum {
   IFLA_GENEVE_UNSPEC,
   IFLA_GENEVE_ID,
@@ -444,9 +455,18 @@
   IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
   IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
   IFLA_GENEVE_LABEL,
+  IFLA_GENEVE_TTL_INHERIT,
+  IFLA_GENEVE_DF,
   __IFLA_GENEVE_MAX
 };
 #define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
+enum ifla_geneve_df {
+  GENEVE_DF_UNSET = 0,
+  GENEVE_DF_SET,
+  GENEVE_DF_INHERIT,
+  __GENEVE_DF_END,
+  GENEVE_DF_MAX = __GENEVE_DF_END - 1,
+};
 enum {
   IFLA_PPP_UNSPEC,
   IFLA_PPP_DEV_FD,
diff --git a/libc/kernel/uapi/linux/if_packet.h b/libc/kernel/uapi/linux/if_packet.h
index 61d0a3a..300aa7b 100644
--- a/libc/kernel/uapi/linux/if_packet.h
+++ b/libc/kernel/uapi/linux/if_packet.h
@@ -63,6 +63,7 @@
 #define PACKET_QDISC_BYPASS 20
 #define PACKET_ROLLOVER_STATS 21
 #define PACKET_FANOUT_DATA 22
+#define PACKET_IGNORE_OUTGOING 23
 #define PACKET_FANOUT_HASH 0
 #define PACKET_FANOUT_LB 1
 #define PACKET_FANOUT_CPU 2
diff --git a/libc/kernel/uapi/linux/if_tun.h b/libc/kernel/uapi/linux/if_tun.h
index 6a3c75e..cb2d2d2 100644
--- a/libc/kernel/uapi/linux/if_tun.h
+++ b/libc/kernel/uapi/linux/if_tun.h
@@ -51,6 +51,7 @@
 #define TUNGETVNETBE _IOR('T', 223, int)
 #define TUNSETSTEERINGEBPF _IOR('T', 224, int)
 #define TUNSETFILTEREBPF _IOR('T', 225, int)
+#define TUNSETCARRIER _IOW('T', 226, int)
 #define IFF_TUN 0x0001
 #define IFF_TAP 0x0002
 #define IFF_NAPI 0x0010
diff --git a/libc/kernel/uapi/linux/if_tunnel.h b/libc/kernel/uapi/linux/if_tunnel.h
index d41dc49..8e1847f 100644
--- a/libc/kernel/uapi/linux/if_tunnel.h
+++ b/libc/kernel/uapi/linux/if_tunnel.h
@@ -154,4 +154,20 @@
   __IFLA_VTI_MAX,
 };
 #define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
+#define TUNNEL_CSUM __cpu_to_be16(0x01)
+#define TUNNEL_ROUTING __cpu_to_be16(0x02)
+#define TUNNEL_KEY __cpu_to_be16(0x04)
+#define TUNNEL_SEQ __cpu_to_be16(0x08)
+#define TUNNEL_STRICT __cpu_to_be16(0x10)
+#define TUNNEL_REC __cpu_to_be16(0x20)
+#define TUNNEL_VERSION __cpu_to_be16(0x40)
+#define TUNNEL_NO_KEY __cpu_to_be16(0x80)
+#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
+#define TUNNEL_OAM __cpu_to_be16(0x0200)
+#define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400)
+#define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800)
+#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)
+#define TUNNEL_NOCACHE __cpu_to_be16(0x2000)
+#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)
+#define TUNNEL_OPTIONS_PRESENT (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT)
 #endif
diff --git a/libc/kernel/uapi/linux/in.h b/libc/kernel/uapi/linux/in.h
index 788a6d9..9ed00b4 100644
--- a/libc/kernel/uapi/linux/in.h
+++ b/libc/kernel/uapi/linux/in.h
@@ -200,9 +200,12 @@
 #define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
 #define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
 #define IN_MULTICAST(a) IN_CLASSD(a)
-#define IN_MULTICAST_NET 0xF0000000
-#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
-#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
+#define IN_MULTICAST_NET 0xe0000000
+#define IN_BADCLASS(a) (((long int) (a)) == (long int) 0xffffffff)
+#define IN_EXPERIMENTAL(a) IN_BADCLASS((a))
+#define IN_CLASSE(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
+#define IN_CLASSE_NET 0xffffffff
+#define IN_CLASSE_NSHIFT 0
 #define INADDR_ANY ((unsigned long int) 0x00000000)
 #define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
 #define INADDR_NONE ((unsigned long int) 0xffffffff)
diff --git a/libc/kernel/uapi/linux/in6.h b/libc/kernel/uapi/linux/in6.h
index 9da111c..3627f52 100644
--- a/libc/kernel/uapi/linux/in6.h
+++ b/libc/kernel/uapi/linux/in6.h
@@ -132,6 +132,7 @@
 #define IPV6_V6ONLY 26
 #define IPV6_JOIN_ANYCAST 27
 #define IPV6_LEAVE_ANYCAST 28
+#define IPV6_MULTICAST_ALL 29
 #define IPV6_PMTUDISC_DONT 0
 #define IPV6_PMTUDISC_WANT 1
 #define IPV6_PMTUDISC_DO 2
diff --git a/libc/kernel/uapi/linux/input-event-codes.h b/libc/kernel/uapi/linux/input-event-codes.h
index d8ae4c8..1ca3cb0 100644
--- a/libc/kernel/uapi/linux/input-event-codes.h
+++ b/libc/kernel/uapi/linux/input-event-codes.h
@@ -622,6 +622,9 @@
 #define REL_DIAL 0x07
 #define REL_WHEEL 0x08
 #define REL_MISC 0x09
+#define REL_RESERVED 0x0a
+#define REL_WHEEL_HI_RES 0x0b
+#define REL_HWHEEL_HI_RES 0x0c
 #define REL_MAX 0x0f
 #define REL_CNT (REL_MAX + 1)
 #define ABS_X 0x00
@@ -650,6 +653,7 @@
 #define ABS_TOOL_WIDTH 0x1c
 #define ABS_VOLUME 0x20
 #define ABS_MISC 0x28
+#define ABS_RESERVED 0x2e
 #define ABS_MT_SLOT 0x2f
 #define ABS_MT_TOUCH_MAJOR 0x30
 #define ABS_MT_TOUCH_MINOR 0x31
diff --git a/libc/kernel/uapi/linux/input.h b/libc/kernel/uapi/linux/input.h
index 0a4b563..f138f64 100644
--- a/libc/kernel/uapi/linux/input.h
+++ b/libc/kernel/uapi/linux/input.h
@@ -24,13 +24,17 @@
 #include <linux/types.h>
 #include "input-event-codes.h"
 struct input_event {
-#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) && !defined(__KERNEL)
+#if __BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)
   struct timeval time;
 #define input_event_sec time.tv_sec
 #define input_event_usec time.tv_usec
 #else
   __kernel_ulong_t __sec;
+#if defined(__sparc__) && defined(__arch64__)
+  unsigned int __usec;
+#else
   __kernel_ulong_t __usec;
+#endif
 #define input_event_sec __sec
 #define input_event_usec __usec
 #endif
diff --git a/libc/kernel/uapi/linux/keyctl.h b/libc/kernel/uapi/linux/keyctl.h
index 0cc7f55..53f0468 100644
--- a/libc/kernel/uapi/linux/keyctl.h
+++ b/libc/kernel/uapi/linux/keyctl.h
@@ -60,9 +60,19 @@
 #define KEYCTL_INVALIDATE 21
 #define KEYCTL_GET_PERSISTENT 22
 #define KEYCTL_DH_COMPUTE 23
+#define KEYCTL_PKEY_QUERY 24
+#define KEYCTL_PKEY_ENCRYPT 25
+#define KEYCTL_PKEY_DECRYPT 26
+#define KEYCTL_PKEY_SIGN 27
+#define KEYCTL_PKEY_VERIFY 28
 #define KEYCTL_RESTRICT_KEYRING 29
 struct keyctl_dh_params {
-  __s32 __linux_private;
+  union {
+#ifndef __cplusplus
+    __s32 __linux_private;
+#endif
+    __s32 priv;
+  };
   __s32 prime;
   __s32 base;
 };
@@ -72,4 +82,26 @@
   __u32 otherinfolen;
   __u32 __spare[8];
 };
+#define KEYCTL_SUPPORTS_ENCRYPT 0x01
+#define KEYCTL_SUPPORTS_DECRYPT 0x02
+#define KEYCTL_SUPPORTS_SIGN 0x04
+#define KEYCTL_SUPPORTS_VERIFY 0x08
+struct keyctl_pkey_query {
+  __u32 supported_ops;
+  __u32 key_size;
+  __u16 max_data_size;
+  __u16 max_sig_size;
+  __u16 max_enc_size;
+  __u16 max_dec_size;
+  __u32 __spare[10];
+};
+struct keyctl_pkey_params {
+  __s32 key_id;
+  __u32 in_len;
+  union {
+    __u32 out_len;
+    __u32 in2_len;
+  };
+  __u32 __spare[7];
+};
 #endif
diff --git a/libc/kernel/uapi/linux/kfd_ioctl.h b/libc/kernel/uapi/linux/kfd_ioctl.h
index 55aff04..5e20606 100644
--- a/libc/kernel/uapi/linux/kfd_ioctl.h
+++ b/libc/kernel/uapi/linux/kfd_ioctl.h
@@ -64,6 +64,13 @@
   __u32 num_cu_mask;
   __u64 cu_mask_ptr;
 };
+struct kfd_ioctl_get_queue_wave_state_args {
+  __u64 ctl_stack_address;
+  __u32 ctl_stack_used_size;
+  __u32 save_area_used_size;
+  __u32 queue_id;
+  __u32 pad;
+};
 #define KFD_IOC_CACHE_POLICY_COHERENT 0
 #define KFD_IOC_CACHE_POLICY_NONCOHERENT 1
 struct kfd_ioctl_set_memory_policy_args {
@@ -175,10 +182,10 @@
   __u32 pad;
 };
 struct kfd_hsa_hw_exception_data {
-  uint32_t reset_type;
-  uint32_t reset_cause;
-  uint32_t memory_lost;
-  uint32_t gpu_id;
+  __u32 reset_type;
+  __u32 reset_cause;
+  __u32 memory_lost;
+  __u32 gpu_id;
 };
 struct kfd_event_data {
   union {
@@ -254,6 +261,20 @@
   __u32 n_devices;
   __u32 n_success;
 };
+struct kfd_ioctl_get_dmabuf_info_args {
+  __u64 size;
+  __u64 metadata_ptr;
+  __u32 metadata_size;
+  __u32 gpu_id;
+  __u32 flags;
+  __u32 dmabuf_fd;
+};
+struct kfd_ioctl_import_dmabuf_args {
+  __u64 va_addr;
+  __u64 handle;
+  __u32 gpu_id;
+  __u32 dmabuf_fd;
+};
 #define AMDKFD_IOCTL_BASE 'K'
 #define AMDKFD_IO(nr) _IO(AMDKFD_IOCTL_BASE, nr)
 #define AMDKFD_IOR(nr,type) _IOR(AMDKFD_IOCTL_BASE, nr, type)
@@ -285,6 +306,9 @@
 #define AMDKFD_IOC_MAP_MEMORY_TO_GPU AMDKFD_IOWR(0x18, struct kfd_ioctl_map_memory_to_gpu_args)
 #define AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU AMDKFD_IOWR(0x19, struct kfd_ioctl_unmap_memory_from_gpu_args)
 #define AMDKFD_IOC_SET_CU_MASK AMDKFD_IOW(0x1A, struct kfd_ioctl_set_cu_mask_args)
+#define AMDKFD_IOC_GET_QUEUE_WAVE_STATE AMDKFD_IOWR(0x1B, struct kfd_ioctl_get_queue_wave_state_args)
+#define AMDKFD_IOC_GET_DMABUF_INFO AMDKFD_IOWR(0x1C, struct kfd_ioctl_get_dmabuf_info_args)
+#define AMDKFD_IOC_IMPORT_DMABUF AMDKFD_IOWR(0x1D, struct kfd_ioctl_import_dmabuf_args)
 #define AMDKFD_COMMAND_START 0x01
-#define AMDKFD_COMMAND_END 0x1B
+#define AMDKFD_COMMAND_END 0x1E
 #endif
diff --git a/libc/kernel/uapi/linux/kvm.h b/libc/kernel/uapi/linux/kvm.h
index 14e882b..8cfa34d 100644
--- a/libc/kernel/uapi/linux/kvm.h
+++ b/libc/kernel/uapi/linux/kvm.h
@@ -316,12 +316,18 @@
 struct kvm_coalesced_mmio_zone {
   __u64 addr;
   __u32 size;
-  __u32 pad;
+  union {
+    __u32 pad;
+    __u32 pio;
+  };
 };
 struct kvm_coalesced_mmio {
   __u64 phys_addr;
   __u32 len;
-  __u32 pad;
+  union {
+    __u32 pad;
+    __u32 pio;
+  };
   __u8 data[8];
 };
 struct kvm_coalesced_mmio_ring {
@@ -361,6 +367,15 @@
     __u64 padding2;
   };
 };
+struct kvm_clear_dirty_log {
+  __u32 slot;
+  __u32 num_pages;
+  __u64 first_page;
+  union {
+    void __user * dirty_bitmap;
+    __u64 padding2;
+  };
+};
 struct kvm_signal_mask {
   __u32 len;
   __u8 sigset[0];
@@ -539,6 +554,7 @@
 };
 #define KVM_PPC_PAGE_SIZES_REAL 0x00000001
 #define KVM_PPC_1T_SEGMENTS 0x00000002
+#define KVM_PPC_NO_HASH 0x00000004
 struct kvm_ppc_smmu_info {
   __u64 flags;
   __u32 slb_size;
@@ -558,6 +574,8 @@
 #define KVM_VM_MIPS_TE 0
 #define KVM_VM_MIPS_VZ 1
 #define KVM_S390_SIE_PAGE_OFFSET 1
+#define KVM_VM_TYPE_ARM_IPA_SIZE_MASK 0xffULL
+#define KVM_VM_TYPE_ARM_IPA_SIZE(x) ((x) & KVM_VM_TYPE_ARM_IPA_SIZE_MASK)
 #define KVM_GET_API_VERSION _IO(KVMIO, 0x00)
 #define KVM_CREATE_VM _IO(KVMIO, 0x01)
 #define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 0x02, struct kvm_msr_list)
@@ -744,6 +762,14 @@
 #define KVM_CAP_NESTED_STATE 157
 #define KVM_CAP_ARM_INJECT_SERROR_ESR 158
 #define KVM_CAP_MSR_PLATFORM_INFO 159
+#define KVM_CAP_PPC_NESTED_HV 160
+#define KVM_CAP_HYPERV_SEND_IPI 161
+#define KVM_CAP_COALESCED_PIO 162
+#define KVM_CAP_HYPERV_ENLIGHTENED_VMCS 163
+#define KVM_CAP_EXCEPTION_PAYLOAD 164
+#define KVM_CAP_ARM_VM_IPA_SIZE 165
+#define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166
+#define KVM_CAP_HYPERV_CPUID 167
 #ifdef KVM_CAP_IRQ_ROUTING
 struct kvm_irq_routing_irqchip {
   __u32 irqchip;
@@ -1055,6 +1081,8 @@
 #define KVM_HYPERV_EVENTFD _IOW(KVMIO, 0xbd, struct kvm_hyperv_eventfd)
 #define KVM_GET_NESTED_STATE _IOWR(KVMIO, 0xbe, struct kvm_nested_state)
 #define KVM_SET_NESTED_STATE _IOW(KVMIO, 0xbf, struct kvm_nested_state)
+#define KVM_CLEAR_DIRTY_LOG _IOWR(KVMIO, 0xc0, struct kvm_clear_dirty_log)
+#define KVM_GET_SUPPORTED_HV_CPUID _IOWR(KVMIO, 0xc1, struct kvm_cpuid2)
 enum sev_cmd_id {
   KVM_SEV_INIT = 0,
   KVM_SEV_ES_INIT,
diff --git a/libc/kernel/uapi/linux/magic.h b/libc/kernel/uapi/linux/magic.h
index 68b4c65..f3b337e 100644
--- a/libc/kernel/uapi/linux/magic.h
+++ b/libc/kernel/uapi/linux/magic.h
@@ -45,6 +45,7 @@
 #define HPFS_SUPER_MAGIC 0xf995e849
 #define ISOFS_SUPER_MAGIC 0x9660
 #define JFFS2_SUPER_MAGIC 0x72b6
+#define XFS_SUPER_MAGIC 0x58465342
 #define PSTOREFS_MAGIC 0x6165676C
 #define EFIVARFS_MAGIC 0xde5e81e4
 #define HOSTFS_SUPER_MAGIC 0x00c0ffee
@@ -77,6 +78,7 @@
 #define DAXFS_MAGIC 0x64646178
 #define BINFMTFS_MAGIC 0x42494e4d
 #define DEVPTS_SUPER_MAGIC 0x1cd1
+#define BINDERFS_SUPER_MAGIC 0x6c6f6f70
 #define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
 #define PIPEFS_MAGIC 0x50495045
 #define PROC_SUPER_MAGIC 0x9fa0
diff --git a/libc/kernel/uapi/linux/media.h b/libc/kernel/uapi/linux/media.h
index eefc07a..4ba0ef6 100644
--- a/libc/kernel/uapi/linux/media.h
+++ b/libc/kernel/uapi/linux/media.h
@@ -198,6 +198,9 @@
 #define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum)
 #define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc)
 #define MEDIA_IOC_G_TOPOLOGY _IOWR('|', 0x04, struct media_v2_topology)
+#define MEDIA_IOC_REQUEST_ALLOC _IOR('|', 0x05, int)
+#define MEDIA_REQUEST_IOC_QUEUE _IO('|', 0x80)
+#define MEDIA_REQUEST_IOC_REINIT _IO('|', 0x81)
 #define MEDIA_ENT_TYPE_SHIFT 16
 #define MEDIA_ENT_TYPE_MASK 0x00ff0000
 #define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff
diff --git a/libc/kernel/uapi/linux/mount.h b/libc/kernel/uapi/linux/mount.h
new file mode 100644
index 0000000..54a4719
--- /dev/null
+++ b/libc/kernel/uapi/linux/mount.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_MOUNT_H
+#define _UAPI_LINUX_MOUNT_H
+#define MS_RDONLY 1
+#define MS_NOSUID 2
+#define MS_NODEV 4
+#define MS_NOEXEC 8
+#define MS_SYNCHRONOUS 16
+#define MS_REMOUNT 32
+#define MS_MANDLOCK 64
+#define MS_DIRSYNC 128
+#define MS_NOATIME 1024
+#define MS_NODIRATIME 2048
+#define MS_BIND 4096
+#define MS_MOVE 8192
+#define MS_REC 16384
+#define MS_VERBOSE 32768
+#define MS_SILENT 32768
+#define MS_POSIXACL (1 << 16)
+#define MS_UNBINDABLE (1 << 17)
+#define MS_PRIVATE (1 << 18)
+#define MS_SLAVE (1 << 19)
+#define MS_SHARED (1 << 20)
+#define MS_RELATIME (1 << 21)
+#define MS_KERNMOUNT (1 << 22)
+#define MS_I_VERSION (1 << 23)
+#define MS_STRICTATIME (1 << 24)
+#define MS_LAZYTIME (1 << 25)
+#define MS_SUBMOUNT (1 << 26)
+#define MS_NOREMOTELOCK (1 << 27)
+#define MS_NOSEC (1 << 28)
+#define MS_BORN (1 << 29)
+#define MS_ACTIVE (1 << 30)
+#define MS_NOUSER (1 << 31)
+#define MS_RMT_MASK (MS_RDONLY | MS_SYNCHRONOUS | MS_MANDLOCK | MS_I_VERSION | MS_LAZYTIME)
+#define MS_MGC_VAL 0xC0ED0000
+#define MS_MGC_MSK 0xffff0000
+#endif
diff --git a/libc/kernel/uapi/linux/msdos_fs.h b/libc/kernel/uapi/linux/msdos_fs.h
index 60ee22a..4b777db 100644
--- a/libc/kernel/uapi/linux/msdos_fs.h
+++ b/libc/kernel/uapi/linux/msdos_fs.h
@@ -57,12 +57,10 @@
 #define MSDOS_SLOTS 21
 #define MSDOS_DOT ".          "
 #define MSDOS_DOTDOT "..         "
-#define FAT_FIRST_ENT(s,x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
 #define FAT_START_ENT 2
 #define MAX_FAT12 0xFF4
 #define MAX_FAT16 0xFFF4
 #define MAX_FAT32 0x0FFFFFF6
-#define MAX_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
 #define BAD_FAT12 0xFF7
 #define BAD_FAT16 0xFFF7
 #define BAD_FAT32 0x0FFFFFF7
@@ -108,7 +106,7 @@
       __u8 state;
       __u8 signature;
       __u8 vol_id[4];
-      __u8 vol_label[11];
+      __u8 vol_label[MSDOS_NAME];
       __u8 fs_type[8];
     } fat16;
     struct {
@@ -123,7 +121,7 @@
       __u8 state;
       __u8 signature;
       __u8 vol_id[4];
-      __u8 vol_label[11];
+      __u8 vol_label[MSDOS_NAME];
       __u8 fs_type[8];
     } fat32;
   };
diff --git a/libc/kernel/uapi/linux/ncsi.h b/libc/kernel/uapi/linux/ncsi.h
index 6b128e4..6334a8a 100644
--- a/libc/kernel/uapi/linux/ncsi.h
+++ b/libc/kernel/uapi/linux/ncsi.h
@@ -23,6 +23,9 @@
   NCSI_CMD_PKG_INFO,
   NCSI_CMD_SET_INTERFACE,
   NCSI_CMD_CLEAR_INTERFACE,
+  NCSI_CMD_SEND_CMD,
+  NCSI_CMD_SET_PACKAGE_MASK,
+  NCSI_CMD_SET_CHANNEL_MASK,
   __NCSI_CMD_AFTER_LAST,
   NCSI_CMD_MAX = __NCSI_CMD_AFTER_LAST - 1
 };
@@ -32,6 +35,10 @@
   NCSI_ATTR_PACKAGE_LIST,
   NCSI_ATTR_PACKAGE_ID,
   NCSI_ATTR_CHANNEL_ID,
+  NCSI_ATTR_DATA,
+  NCSI_ATTR_MULTI_FLAG,
+  NCSI_ATTR_PACKAGE_MASK,
+  NCSI_ATTR_CHANNEL_MASK,
   __NCSI_ATTR_AFTER_LAST,
   NCSI_ATTR_MAX = __NCSI_ATTR_AFTER_LAST - 1
 };
diff --git a/libc/kernel/uapi/linux/ndctl.h b/libc/kernel/uapi/linux/ndctl.h
index bee0b1c..742fbad 100644
--- a/libc/kernel/uapi/linux/ndctl.h
+++ b/libc/kernel/uapi/linux/ndctl.h
@@ -140,9 +140,6 @@
   ND_DRIVER_NAMESPACE_BLK = 1 << ND_DEVICE_NAMESPACE_BLK,
   ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM,
 };
-enum {
-  ND_MIN_NAMESPACE_SIZE = PAGE_SIZE,
-};
 enum ars_masks {
   ARS_STATUS_MASK = 0x0000FFFF,
   ARS_EXT_STATUS_SHIFT = 16,
diff --git a/libc/kernel/uapi/linux/neighbour.h b/libc/kernel/uapi/linux/neighbour.h
index cf32a12..4ce4736 100644
--- a/libc/kernel/uapi/linux/neighbour.h
+++ b/libc/kernel/uapi/linux/neighbour.h
@@ -42,6 +42,7 @@
   NDA_MASTER,
   NDA_LINK_NETNSID,
   NDA_SRC_VNI,
+  NDA_PROTOCOL,
   __NDA_MAX
 };
 #define NDA_MAX (__NDA_MAX - 1)
@@ -51,6 +52,7 @@
 #define NTF_PROXY 0x08
 #define NTF_EXT_LEARNED 0x10
 #define NTF_OFFLOADED 0x20
+#define NTF_STICKY 0x40
 #define NTF_ROUTER 0x80
 #define NUD_INCOMPLETE 0x01
 #define NUD_REACHABLE 0x02
diff --git a/libc/kernel/uapi/linux/net_namespace.h b/libc/kernel/uapi/linux/net_namespace.h
index b1d96f6..a54c9e1 100644
--- a/libc/kernel/uapi/linux/net_namespace.h
+++ b/libc/kernel/uapi/linux/net_namespace.h
@@ -24,6 +24,8 @@
   NETNSA_NSID,
   NETNSA_PID,
   NETNSA_FD,
+  NETNSA_TARGET_NSID,
+  NETNSA_CURRENT_NSID,
   __NETNSA_MAX,
 };
 #define NETNSA_MAX (__NETNSA_MAX - 1)
diff --git a/libc/kernel/uapi/linux/net_tstamp.h b/libc/kernel/uapi/linux/net_tstamp.h
index 2f022ea..375906a 100644
--- a/libc/kernel/uapi/linux/net_tstamp.h
+++ b/libc/kernel/uapi/linux/net_tstamp.h
@@ -80,7 +80,7 @@
   SOF_TXTIME_FLAGS_MASK = (SOF_TXTIME_FLAGS_LAST - 1) | SOF_TXTIME_FLAGS_LAST
 };
 struct sock_txtime {
-  clockid_t clockid;
+  __kernel_clockid_t clockid;
   __u32 flags;
 };
 #endif
diff --git a/libc/kernel/uapi/linux/netfilter.h b/libc/kernel/uapi/linux/netfilter.h
index 5538869..345b197 100644
--- a/libc/kernel/uapi/linux/netfilter.h
+++ b/libc/kernel/uapi/linux/netfilter.h
@@ -35,8 +35,6 @@
 #define NF_VERDICT_QBITS 16
 #define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
 #define NF_DROP_ERR(x) (((- x) << 16) | NF_DROP)
-#define NFC_UNKNOWN 0x4000
-#define NFC_ALTERED 0x8000
 #define NF_VERDICT_BITS 16
 enum nf_inet_hooks {
   NF_INET_PRE_ROUTING,
diff --git a/libc/kernel/uapi/linux/netfilter/ipset/ip_set.h b/libc/kernel/uapi/linux/netfilter/ipset/ip_set.h
index 17107b7..2c5aeeb 100644
--- a/libc/kernel/uapi/linux/netfilter/ipset/ip_set.h
+++ b/libc/kernel/uapi/linux/netfilter/ipset/ip_set.h
@@ -19,7 +19,8 @@
 #ifndef _UAPI_IP_SET_H
 #define _UAPI_IP_SET_H
 #include <linux/types.h>
-#define IPSET_PROTOCOL 6
+#define IPSET_PROTOCOL 7
+#define IPSET_PROTOCOL_MIN 6
 #define IPSET_MAXNAMELEN 32
 #define IPSET_MAX_COMMENT_SIZE 255
 enum ipset_cmd {
@@ -37,6 +38,8 @@
   IPSET_CMD_TEST,
   IPSET_CMD_HEADER,
   IPSET_CMD_TYPE,
+  IPSET_CMD_GET_BYNAME,
+  IPSET_CMD_GET_BYINDEX,
   IPSET_MSG_MAX,
   IPSET_CMD_RESTORE = IPSET_MSG_MAX,
   IPSET_CMD_HELP,
@@ -59,6 +62,7 @@
   IPSET_ATTR_LINENO,
   IPSET_ATTR_PROTOCOL_MIN,
   IPSET_ATTR_REVISION_MIN = IPSET_ATTR_PROTOCOL_MIN,
+  IPSET_ATTR_INDEX,
   __IPSET_ATTR_CMD_MAX,
 };
 #define IPSET_ATTR_CMD_MAX (__IPSET_ATTR_CMD_MAX - 1)
diff --git a/libc/kernel/uapi/linux/netfilter/nf_tables.h b/libc/kernel/uapi/linux/netfilter/nf_tables.h
index 63394e0..2bb7c86 100644
--- a/libc/kernel/uapi/linux/netfilter/nf_tables.h
+++ b/libc/kernel/uapi/linux/netfilter/nf_tables.h
@@ -419,6 +419,7 @@
   NFT_RT_NEXTHOP4,
   NFT_RT_NEXTHOP6,
   NFT_RT_TCPMSS,
+  NFT_RT_XFRM,
   __NFT_RT_MAX
 };
 #define NFT_RT_MAX (__NFT_RT_MAX - 1)
@@ -596,6 +597,13 @@
   __NFTA_QUOTA_MAX
 };
 #define NFTA_QUOTA_MAX (__NFTA_QUOTA_MAX - 1)
+enum nft_secmark_attributes {
+  NFTA_SECMARK_UNSPEC,
+  NFTA_SECMARK_CTX,
+  __NFTA_SECMARK_MAX,
+};
+#define NFTA_SECMARK_MAX (__NFTA_SECMARK_MAX - 1)
+#define NFT_SECMARK_CTX_MAXLEN 256
 enum nft_reject_types {
   NFT_REJECT_ICMP_UNREACH,
   NFT_REJECT_TCP_RST,
@@ -737,7 +745,8 @@
 #define NFT_OBJECT_CONNLIMIT 5
 #define NFT_OBJECT_TUNNEL 6
 #define NFT_OBJECT_CT_TIMEOUT 7
-#define __NFT_OBJECT_MAX 8
+#define NFT_OBJECT_SECMARK 8
+#define __NFT_OBJECT_MAX 9
 #define NFT_OBJECT_MAX (__NFT_OBJECT_MAX - 1)
 enum nft_object_attributes {
   NFTA_OBJ_UNSPEC,
@@ -773,6 +782,7 @@
 enum nft_osf_attributes {
   NFTA_OSF_UNSPEC,
   NFTA_OSF_DREG,
+  NFTA_OSF_TTL,
   __NFTA_OSF_MAX,
 };
 #define NFTA_OSF_MAX (__NFTA_OSF_MAX - 1)
@@ -782,6 +792,26 @@
   __NFTA_DEVICE_MAX
 };
 #define NFTA_DEVICE_MAX (__NFTA_DEVICE_MAX - 1)
+enum nft_xfrm_attributes {
+  NFTA_XFRM_UNSPEC,
+  NFTA_XFRM_DREG,
+  NFTA_XFRM_KEY,
+  NFTA_XFRM_DIR,
+  NFTA_XFRM_SPNUM,
+  __NFTA_XFRM_MAX
+};
+#define NFTA_XFRM_MAX (__NFTA_XFRM_MAX - 1)
+enum nft_xfrm_keys {
+  NFT_XFRM_KEY_UNSPEC,
+  NFT_XFRM_KEY_DADDR_IP4,
+  NFT_XFRM_KEY_DADDR_IP6,
+  NFT_XFRM_KEY_SADDR_IP4,
+  NFT_XFRM_KEY_SADDR_IP6,
+  NFT_XFRM_KEY_REQID,
+  NFT_XFRM_KEY_SPI,
+  __NFT_XFRM_KEY_MAX,
+};
+#define NFT_XFRM_KEY_MAX (__NFT_XFRM_KEY_MAX - 1)
 enum nft_trace_attributes {
   NFTA_TRACE_UNSPEC,
   NFTA_TRACE_TABLE,
diff --git a/libc/kernel/uapi/linux/netfilter/xt_cgroup.h b/libc/kernel/uapi/linux/netfilter/xt_cgroup.h
index ccc0349..6d939ea 100644
--- a/libc/kernel/uapi/linux/netfilter/xt_cgroup.h
+++ b/libc/kernel/uapi/linux/netfilter/xt_cgroup.h
@@ -33,4 +33,16 @@
   __u32 classid;
   void * priv __attribute__((aligned(8)));
 };
+#define XT_CGROUP_PATH_MAX 512
+struct xt_cgroup_info_v2 {
+  __u8 has_path;
+  __u8 has_classid;
+  __u8 invert_path;
+  __u8 invert_classid;
+  union {
+    char path[XT_CGROUP_PATH_MAX];
+    __u32 classid;
+  };
+  void * priv __attribute__((aligned(8)));
+};
 #endif
diff --git a/libc/kernel/uapi/linux/netfilter_bridge.h b/libc/kernel/uapi/linux/netfilter_bridge.h
index 6da98f5..e1434f4 100644
--- a/libc/kernel/uapi/linux/netfilter_bridge.h
+++ b/libc/kernel/uapi/linux/netfilter_bridge.h
@@ -23,6 +23,7 @@
 #include <linux/if_ether.h>
 #include <linux/if_vlan.h>
 #include <linux/if_pppox.h>
+#include <limits.h>
 #define NF_BR_PRE_ROUTING 0
 #define NF_BR_LOCAL_IN 1
 #define NF_BR_FORWARD 2
diff --git a/libc/kernel/uapi/linux/netfilter_decnet.h b/libc/kernel/uapi/linux/netfilter_decnet.h
index a9dcdd3..c9c16ca 100644
--- a/libc/kernel/uapi/linux/netfilter_decnet.h
+++ b/libc/kernel/uapi/linux/netfilter_decnet.h
@@ -20,10 +20,6 @@
 #define __LINUX_DECNET_NETFILTER_H
 #include <linux/netfilter.h>
 #include <limits.h>
-#define NFC_DN_SRC 0x0001
-#define NFC_DN_DST 0x0002
-#define NFC_DN_IF_IN 0x0004
-#define NFC_DN_IF_OUT 0x0008
 #define NF_DN_NUMHOOKS 7
 #define NF_DN_PRE_ROUTING 0
 #define NF_DN_LOCAL_IN 1
diff --git a/libc/kernel/uapi/linux/netfilter_ipv4.h b/libc/kernel/uapi/linux/netfilter_ipv4.h
index 7eed768..bb2a1d9 100644
--- a/libc/kernel/uapi/linux/netfilter_ipv4.h
+++ b/libc/kernel/uapi/linux/netfilter_ipv4.h
@@ -20,18 +20,6 @@
 #define _UAPI__LINUX_IP_NETFILTER_H
 #include <linux/netfilter.h>
 #include <limits.h>
-#define NFC_IP_SRC 0x0001
-#define NFC_IP_DST 0x0002
-#define NFC_IP_IF_IN 0x0004
-#define NFC_IP_IF_OUT 0x0008
-#define NFC_IP_TOS 0x0010
-#define NFC_IP_PROTO 0x0020
-#define NFC_IP_OPTIONS 0x0040
-#define NFC_IP_FRAG 0x0080
-#define NFC_IP_TCPFLAGS 0x0100
-#define NFC_IP_SRC_PT 0x0200
-#define NFC_IP_DST_PT 0x0400
-#define NFC_IP_PROTO_UNKNOWN 0x2000
 #define NF_IP_PRE_ROUTING 0
 #define NF_IP_LOCAL_IN 1
 #define NF_IP_FORWARD 2
diff --git a/libc/kernel/uapi/linux/netfilter_ipv6.h b/libc/kernel/uapi/linux/netfilter_ipv6.h
index 2054532..f454eb6 100644
--- a/libc/kernel/uapi/linux/netfilter_ipv6.h
+++ b/libc/kernel/uapi/linux/netfilter_ipv6.h
@@ -20,18 +20,6 @@
 #define _UAPI__LINUX_IP6_NETFILTER_H
 #include <linux/netfilter.h>
 #include <limits.h>
-#define NFC_IP6_SRC 0x0001
-#define NFC_IP6_DST 0x0002
-#define NFC_IP6_IF_IN 0x0004
-#define NFC_IP6_IF_OUT 0x0008
-#define NFC_IP6_TOS 0x0010
-#define NFC_IP6_PROTO 0x0020
-#define NFC_IP6_OPTIONS 0x0040
-#define NFC_IP6_FRAG 0x0080
-#define NFC_IP6_TCPFLAGS 0x0100
-#define NFC_IP6_SRC_PT 0x0200
-#define NFC_IP6_DST_PT 0x0400
-#define NFC_IP6_PROTO_UNKNOWN 0x2000
 #define NF_IP6_PRE_ROUTING 0
 #define NF_IP6_LOCAL_IN 1
 #define NF_IP6_FORWARD 2
diff --git a/libc/kernel/uapi/linux/netlink.h b/libc/kernel/uapi/linux/netlink.h
index 4f35c02..4c0fd1f 100644
--- a/libc/kernel/uapi/linux/netlink.h
+++ b/libc/kernel/uapi/linux/netlink.h
@@ -112,6 +112,7 @@
 #define NETLINK_LIST_MEMBERSHIPS 9
 #define NETLINK_CAP_ACK 10
 #define NETLINK_EXT_ACK 11
+#define NETLINK_GET_STRICT_CHK 12
 struct nl_pktinfo {
   __u32 group;
 };
diff --git a/libc/kernel/uapi/linux/nilfs2_api.h b/libc/kernel/uapi/linux/nilfs2_api.h
index 2f2692e..d6a6b8f 100644
--- a/libc/kernel/uapi/linux/nilfs2_api.h
+++ b/libc/kernel/uapi/linux/nilfs2_api.h
@@ -39,6 +39,16 @@
 #define NILFS_CPINFO_FNS(flag,name) static inline int nilfs_cpinfo_ ##name(const struct nilfs_cpinfo * cpinfo) \
 { return ! ! (cpinfo->ci_flags & (1UL << NILFS_CPINFO_ ##flag)); \
 }
+struct nilfs_suinfo {
+  __u64 sui_lastmod;
+  __u32 sui_nblocks;
+  __u32 sui_flags;
+};
+enum {
+  NILFS_SUINFO_ACTIVE,
+  NILFS_SUINFO_DIRTY,
+  NILFS_SUINFO_ERROR,
+};
 #define NILFS_SUINFO_FNS(flag,name) static inline int nilfs_suinfo_ ##name(const struct nilfs_suinfo * si) \
 { return si->sui_flags & (1UL << NILFS_SUINFO_ ##flag); \
 }
@@ -61,6 +71,15 @@
 } static inline int nilfs_suinfo_update_ ##name(const struct nilfs_suinfo_update * sup) \
 { return ! ! (sup->sup_flags & (1UL << NILFS_SUINFO_UPDATE_ ##flag)); \
 }
+enum {
+  NILFS_CHECKPOINT,
+  NILFS_SNAPSHOT,
+};
+struct nilfs_cpmode {
+  __u64 cm_cno;
+  __u32 cm_mode;
+  __u32 cm_pad;
+};
 struct nilfs_argv {
   __u64 v_base;
   __u32 v_nmembs;
diff --git a/libc/kernel/uapi/linux/nilfs2_ondisk.h b/libc/kernel/uapi/linux/nilfs2_ondisk.h
index d70b75f..e9995a1 100644
--- a/libc/kernel/uapi/linux/nilfs2_ondisk.h
+++ b/libc/kernel/uapi/linux/nilfs2_ondisk.h
@@ -254,6 +254,11 @@
 } static inline int nilfs_checkpoint_ ##name(const struct nilfs_checkpoint * cp) \
 { return ! ! (le32_to_cpu(cp->cp_flags) & (1UL << NILFS_CHECKPOINT_ ##flag)); \
 }
+struct nilfs_cpfile_header {
+  __le64 ch_ncheckpoints;
+  __le64 ch_nsnapshots;
+  struct nilfs_snapshot_list ch_snapshot_list;
+};
 #define NILFS_CPFILE_FIRST_CHECKPOINT_OFFSET ((sizeof(struct nilfs_cpfile_header) + sizeof(struct nilfs_checkpoint) - 1) / sizeof(struct nilfs_checkpoint))
 struct nilfs_segment_usage {
   __le64 su_lastmod;
diff --git a/libc/kernel/uapi/linux/nl80211.h b/libc/kernel/uapi/linux/nl80211.h
index 1f2f77d..29a7b66 100644
--- a/libc/kernel/uapi/linux/nl80211.h
+++ b/libc/kernel/uapi/linux/nl80211.h
@@ -163,6 +163,11 @@
   NL80211_CMD_EXTERNAL_AUTH,
   NL80211_CMD_STA_OPMODE_CHANGED,
   NL80211_CMD_CONTROL_PORT_FRAME,
+  NL80211_CMD_GET_FTM_RESPONDER_STATS,
+  NL80211_CMD_PEER_MEASUREMENT_START,
+  NL80211_CMD_PEER_MEASUREMENT_RESULT,
+  NL80211_CMD_PEER_MEASUREMENT_COMPLETE,
+  NL80211_CMD_NOTIFY_RADAR,
   __NL80211_CMD_AFTER_LAST,
   NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
 };
@@ -449,6 +454,10 @@
   NL80211_ATTR_TXQ_MEMORY_LIMIT,
   NL80211_ATTR_TXQ_QUANTUM,
   NL80211_ATTR_HE_CAPABILITY,
+  NL80211_ATTR_FTM_RESPONDER,
+  NL80211_ATTR_FTM_RESPONDER_STATS,
+  NL80211_ATTR_TIMEOUT,
+  NL80211_ATTR_PEER_MEASUREMENTS,
   __NL80211_ATTR_AFTER_LAST,
   NUM_NL80211_ATTR = __NL80211_ATTR_AFTER_LAST,
   NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
@@ -615,10 +624,14 @@
   NL80211_STA_INFO_RX_DURATION,
   NL80211_STA_INFO_PAD,
   NL80211_STA_INFO_ACK_SIGNAL,
-  NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG,
+  NL80211_STA_INFO_ACK_SIGNAL_AVG,
+  NL80211_STA_INFO_RX_MPDUS,
+  NL80211_STA_INFO_FCS_ERROR_COUNT,
+  NL80211_STA_INFO_CONNECTED_TO_GATE,
   __NL80211_STA_INFO_AFTER_LAST,
   NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
 };
+#define NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG NL80211_STA_INFO_ACK_SIGNAL_AVG
 enum nl80211_tid_stats {
   __NL80211_TID_STATS_INVALID,
   NL80211_TID_STATS_RX_MSDU,
@@ -872,6 +885,7 @@
   NL80211_MESHCONF_POWER_MODE,
   NL80211_MESHCONF_AWAKE_WINDOW,
   NL80211_MESHCONF_PLINK_TIMEOUT,
+  NL80211_MESHCONF_CONNECTED_TO_GATE,
   __NL80211_MESHCONF_ATTR_AFTER_LAST,
   NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1
 };
@@ -1283,10 +1297,13 @@
   NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN,
   NL80211_EXT_FEATURE_DFS_OFFLOAD,
   NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211,
-  NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT,
+  NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT,
+  NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT = NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT,
   NL80211_EXT_FEATURE_TXQS,
   NL80211_EXT_FEATURE_SCAN_RANDOM_SN,
   NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
+  NL80211_EXT_FEATURE_CAN_REPLACE_PTK0,
+  NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
   NUM_NL80211_EXT_FEATURES,
   MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1
 };
@@ -1448,4 +1465,145 @@
   NL80211_EXTERNAL_AUTH_START,
   NL80211_EXTERNAL_AUTH_ABORT,
 };
+enum nl80211_ftm_responder_attributes {
+  __NL80211_FTM_RESP_ATTR_INVALID,
+  NL80211_FTM_RESP_ATTR_ENABLED,
+  NL80211_FTM_RESP_ATTR_LCI,
+  NL80211_FTM_RESP_ATTR_CIVICLOC,
+  __NL80211_FTM_RESP_ATTR_LAST,
+  NL80211_FTM_RESP_ATTR_MAX = __NL80211_FTM_RESP_ATTR_LAST - 1,
+};
+enum nl80211_ftm_responder_stats {
+  __NL80211_FTM_STATS_INVALID,
+  NL80211_FTM_STATS_SUCCESS_NUM,
+  NL80211_FTM_STATS_PARTIAL_NUM,
+  NL80211_FTM_STATS_FAILED_NUM,
+  NL80211_FTM_STATS_ASAP_NUM,
+  NL80211_FTM_STATS_NON_ASAP_NUM,
+  NL80211_FTM_STATS_TOTAL_DURATION_MSEC,
+  NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM,
+  NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM,
+  NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM,
+  NL80211_FTM_STATS_PAD,
+  __NL80211_FTM_STATS_AFTER_LAST,
+  NL80211_FTM_STATS_MAX = __NL80211_FTM_STATS_AFTER_LAST - 1
+};
+enum nl80211_preamble {
+  NL80211_PREAMBLE_LEGACY,
+  NL80211_PREAMBLE_HT,
+  NL80211_PREAMBLE_VHT,
+  NL80211_PREAMBLE_DMG,
+};
+enum nl80211_peer_measurement_type {
+  NL80211_PMSR_TYPE_INVALID,
+  NL80211_PMSR_TYPE_FTM,
+  NUM_NL80211_PMSR_TYPES,
+  NL80211_PMSR_TYPE_MAX = NUM_NL80211_PMSR_TYPES - 1
+};
+enum nl80211_peer_measurement_status {
+  NL80211_PMSR_STATUS_SUCCESS,
+  NL80211_PMSR_STATUS_REFUSED,
+  NL80211_PMSR_STATUS_TIMEOUT,
+  NL80211_PMSR_STATUS_FAILURE,
+};
+enum nl80211_peer_measurement_req {
+  __NL80211_PMSR_REQ_ATTR_INVALID,
+  NL80211_PMSR_REQ_ATTR_DATA,
+  NL80211_PMSR_REQ_ATTR_GET_AP_TSF,
+  NUM_NL80211_PMSR_REQ_ATTRS,
+  NL80211_PMSR_REQ_ATTR_MAX = NUM_NL80211_PMSR_REQ_ATTRS - 1
+};
+enum nl80211_peer_measurement_resp {
+  __NL80211_PMSR_RESP_ATTR_INVALID,
+  NL80211_PMSR_RESP_ATTR_DATA,
+  NL80211_PMSR_RESP_ATTR_STATUS,
+  NL80211_PMSR_RESP_ATTR_HOST_TIME,
+  NL80211_PMSR_RESP_ATTR_AP_TSF,
+  NL80211_PMSR_RESP_ATTR_FINAL,
+  NL80211_PMSR_RESP_ATTR_PAD,
+  NUM_NL80211_PMSR_RESP_ATTRS,
+  NL80211_PMSR_RESP_ATTR_MAX = NUM_NL80211_PMSR_RESP_ATTRS - 1
+};
+enum nl80211_peer_measurement_peer_attrs {
+  __NL80211_PMSR_PEER_ATTR_INVALID,
+  NL80211_PMSR_PEER_ATTR_ADDR,
+  NL80211_PMSR_PEER_ATTR_CHAN,
+  NL80211_PMSR_PEER_ATTR_REQ,
+  NL80211_PMSR_PEER_ATTR_RESP,
+  NUM_NL80211_PMSR_PEER_ATTRS,
+  NL80211_PMSR_PEER_ATTR_MAX = NUM_NL80211_PMSR_PEER_ATTRS - 1,
+};
+enum nl80211_peer_measurement_attrs {
+  __NL80211_PMSR_ATTR_INVALID,
+  NL80211_PMSR_ATTR_MAX_PEERS,
+  NL80211_PMSR_ATTR_REPORT_AP_TSF,
+  NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR,
+  NL80211_PMSR_ATTR_TYPE_CAPA,
+  NL80211_PMSR_ATTR_PEERS,
+  NUM_NL80211_PMSR_ATTR,
+  NL80211_PMSR_ATTR_MAX = NUM_NL80211_PMSR_ATTR - 1
+};
+enum nl80211_peer_measurement_ftm_capa {
+  __NL80211_PMSR_FTM_CAPA_ATTR_INVALID,
+  NL80211_PMSR_FTM_CAPA_ATTR_ASAP,
+  NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP,
+  NL80211_PMSR_FTM_CAPA_ATTR_REQ_LCI,
+  NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC,
+  NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES,
+  NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS,
+  NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT,
+  NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST,
+  NUM_NL80211_PMSR_FTM_CAPA_ATTR,
+  NL80211_PMSR_FTM_CAPA_ATTR_MAX = NUM_NL80211_PMSR_FTM_CAPA_ATTR - 1
+};
+enum nl80211_peer_measurement_ftm_req {
+  __NL80211_PMSR_FTM_REQ_ATTR_INVALID,
+  NL80211_PMSR_FTM_REQ_ATTR_ASAP,
+  NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE,
+  NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP,
+  NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD,
+  NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION,
+  NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST,
+  NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES,
+  NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI,
+  NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC,
+  NUM_NL80211_PMSR_FTM_REQ_ATTR,
+  NL80211_PMSR_FTM_REQ_ATTR_MAX = NUM_NL80211_PMSR_FTM_REQ_ATTR - 1
+};
+enum nl80211_peer_measurement_ftm_failure_reasons {
+  NL80211_PMSR_FTM_FAILURE_UNSPECIFIED,
+  NL80211_PMSR_FTM_FAILURE_NO_RESPONSE,
+  NL80211_PMSR_FTM_FAILURE_REJECTED,
+  NL80211_PMSR_FTM_FAILURE_WRONG_CHANNEL,
+  NL80211_PMSR_FTM_FAILURE_PEER_NOT_CAPABLE,
+  NL80211_PMSR_FTM_FAILURE_INVALID_TIMESTAMP,
+  NL80211_PMSR_FTM_FAILURE_PEER_BUSY,
+  NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS,
+};
+enum nl80211_peer_measurement_ftm_resp {
+  __NL80211_PMSR_FTM_RESP_ATTR_INVALID,
+  NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON,
+  NL80211_PMSR_FTM_RESP_ATTR_BURST_INDEX,
+  NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS,
+  NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES,
+  NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME,
+  NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP,
+  NL80211_PMSR_FTM_RESP_ATTR_BURST_DURATION,
+  NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST,
+  NL80211_PMSR_FTM_RESP_ATTR_RSSI_AVG,
+  NL80211_PMSR_FTM_RESP_ATTR_RSSI_SPREAD,
+  NL80211_PMSR_FTM_RESP_ATTR_TX_RATE,
+  NL80211_PMSR_FTM_RESP_ATTR_RX_RATE,
+  NL80211_PMSR_FTM_RESP_ATTR_RTT_AVG,
+  NL80211_PMSR_FTM_RESP_ATTR_RTT_VARIANCE,
+  NL80211_PMSR_FTM_RESP_ATTR_RTT_SPREAD,
+  NL80211_PMSR_FTM_RESP_ATTR_DIST_AVG,
+  NL80211_PMSR_FTM_RESP_ATTR_DIST_VARIANCE,
+  NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD,
+  NL80211_PMSR_FTM_RESP_ATTR_LCI,
+  NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC,
+  NL80211_PMSR_FTM_RESP_ATTR_PAD,
+  NUM_NL80211_PMSR_FTM_RESP_ATTR,
+  NL80211_PMSR_FTM_RESP_ATTR_MAX = NUM_NL80211_PMSR_FTM_RESP_ATTR - 1
+};
 #endif
diff --git a/libc/kernel/uapi/linux/pci_regs.h b/libc/kernel/uapi/linux/pci_regs.h
index 7b234f5..8122fbb 100644
--- a/libc/kernel/uapi/linux/pci_regs.h
+++ b/libc/kernel/uapi/linux/pci_regs.h
@@ -36,6 +36,7 @@
 #define PCI_COMMAND_FAST_BACK 0x200
 #define PCI_COMMAND_INTX_DISABLE 0x400
 #define PCI_STATUS 0x06
+#define PCI_STATUS_IMM_READY 0x01
 #define PCI_STATUS_INTERRUPT 0x08
 #define PCI_STATUS_CAP_LIST 0x10
 #define PCI_STATUS_66MHZ 0x20
diff --git a/libc/kernel/uapi/linux/perf_event.h b/libc/kernel/uapi/linux/perf_event.h
index c106b5b..bf51785 100644
--- a/libc/kernel/uapi/linux/perf_event.h
+++ b/libc/kernel/uapi/linux/perf_event.h
@@ -286,6 +286,7 @@
 #define PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT (1 << 12)
 #define PERF_RECORD_MISC_MMAP_DATA (1 << 13)
 #define PERF_RECORD_MISC_COMM_EXEC (1 << 13)
+#define PERF_RECORD_MISC_FORK_EXEC (1 << 13)
 #define PERF_RECORD_MISC_SWITCH_OUT (1 << 13)
 #define PERF_RECORD_MISC_EXACT_IP (1 << 14)
 #define PERF_RECORD_MISC_SWITCH_OUT_PREEMPT (1 << 14)
diff --git a/libc/kernel/uapi/linux/pkt_cls.h b/libc/kernel/uapi/linux/pkt_cls.h
index 1ede892..2018f0b 100644
--- a/libc/kernel/uapi/linux/pkt_cls.h
+++ b/libc/kernel/uapi/linux/pkt_cls.h
@@ -388,6 +388,11 @@
   TCA_FLOWER_KEY_ENC_IP_TTL_MASK,
   TCA_FLOWER_KEY_ENC_OPTS,
   TCA_FLOWER_KEY_ENC_OPTS_MASK,
+  TCA_FLOWER_IN_HW_COUNT,
+  TCA_FLOWER_KEY_PORT_SRC_MIN,
+  TCA_FLOWER_KEY_PORT_SRC_MAX,
+  TCA_FLOWER_KEY_PORT_DST_MIN,
+  TCA_FLOWER_KEY_PORT_DST_MAX,
   __TCA_FLOWER_MAX,
 };
 #define TCA_FLOWER_MAX (__TCA_FLOWER_MAX - 1)
@@ -409,6 +414,7 @@
   TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0),
   TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),
 };
+#define TCA_FLOWER_MASK_FLAGS_RANGE (1 << 0)
 enum {
   TCA_MATCHALL_UNSPEC,
   TCA_MATCHALL_CLASSID,
diff --git a/libc/kernel/uapi/linux/pkt_sched.h b/libc/kernel/uapi/linux/pkt_sched.h
index 4efbc1c..dc0cd2f 100644
--- a/libc/kernel/uapi/linux/pkt_sched.h
+++ b/libc/kernel/uapi/linux/pkt_sched.h
@@ -195,9 +195,33 @@
   TCA_GRED_DPS,
   TCA_GRED_MAX_P,
   TCA_GRED_LIMIT,
+  TCA_GRED_VQ_LIST,
   __TCA_GRED_MAX,
 };
 #define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
+enum {
+  TCA_GRED_VQ_ENTRY_UNSPEC,
+  TCA_GRED_VQ_ENTRY,
+  __TCA_GRED_VQ_ENTRY_MAX,
+};
+#define TCA_GRED_VQ_ENTRY_MAX (__TCA_GRED_VQ_ENTRY_MAX - 1)
+enum {
+  TCA_GRED_VQ_UNSPEC,
+  TCA_GRED_VQ_PAD,
+  TCA_GRED_VQ_DP,
+  TCA_GRED_VQ_STAT_BYTES,
+  TCA_GRED_VQ_STAT_PACKETS,
+  TCA_GRED_VQ_STAT_BACKLOG,
+  TCA_GRED_VQ_STAT_PROB_DROP,
+  TCA_GRED_VQ_STAT_PROB_MARK,
+  TCA_GRED_VQ_STAT_FORCED_DROP,
+  TCA_GRED_VQ_STAT_FORCED_MARK,
+  TCA_GRED_VQ_STAT_PDROP,
+  TCA_GRED_VQ_STAT_OTHER,
+  TCA_GRED_VQ_FLAGS,
+  __TCA_GRED_VQ_MAX
+};
+#define TCA_GRED_VQ_MAX (__TCA_GRED_VQ_MAX - 1)
 struct tc_gred_qopt {
   __u32 limit;
   __u32 qth_min;
@@ -283,8 +307,8 @@
   __u32 lends;
   __u32 borrows;
   __u32 giants;
-  __u32 tokens;
-  __u32 ctokens;
+  __s32 tokens;
+  __s32 ctokens;
 };
 struct tc_hfsc_qopt {
   __u16 defcls;
@@ -639,6 +663,7 @@
   TCA_FQ_FLOW_REFILL_DELAY,
   TCA_FQ_ORPHAN_MASK,
   TCA_FQ_LOW_RATE_THRESHOLD,
+  TCA_FQ_CE_THRESHOLD,
   __TCA_FQ_MAX
 };
 #define TCA_FQ_MAX (__TCA_FQ_MAX - 1)
@@ -655,6 +680,7 @@
   __u32 inactive_flows;
   __u32 throttled_flows;
   __u32 unthrottle_latency_ns;
+  __u64 ce_mark;
 };
 enum {
   TCA_HHF_UNSPEC,
@@ -828,4 +854,35 @@
   CAKE_ATM_PTM,
   CAKE_ATM_MAX
 };
+enum {
+  TC_TAPRIO_CMD_SET_GATES = 0x00,
+  TC_TAPRIO_CMD_SET_AND_HOLD = 0x01,
+  TC_TAPRIO_CMD_SET_AND_RELEASE = 0x02,
+};
+enum {
+  TCA_TAPRIO_SCHED_ENTRY_UNSPEC,
+  TCA_TAPRIO_SCHED_ENTRY_INDEX,
+  TCA_TAPRIO_SCHED_ENTRY_CMD,
+  TCA_TAPRIO_SCHED_ENTRY_GATE_MASK,
+  TCA_TAPRIO_SCHED_ENTRY_INTERVAL,
+  __TCA_TAPRIO_SCHED_ENTRY_MAX,
+};
+#define TCA_TAPRIO_SCHED_ENTRY_MAX (__TCA_TAPRIO_SCHED_ENTRY_MAX - 1)
+enum {
+  TCA_TAPRIO_SCHED_UNSPEC,
+  TCA_TAPRIO_SCHED_ENTRY,
+  __TCA_TAPRIO_SCHED_MAX,
+};
+#define TCA_TAPRIO_SCHED_MAX (__TCA_TAPRIO_SCHED_MAX - 1)
+enum {
+  TCA_TAPRIO_ATTR_UNSPEC,
+  TCA_TAPRIO_ATTR_PRIOMAP,
+  TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST,
+  TCA_TAPRIO_ATTR_SCHED_BASE_TIME,
+  TCA_TAPRIO_ATTR_SCHED_SINGLE_ENTRY,
+  TCA_TAPRIO_ATTR_SCHED_CLOCKID,
+  TCA_TAPRIO_PAD,
+  __TCA_TAPRIO_ATTR_MAX,
+};
+#define TCA_TAPRIO_ATTR_MAX (__TCA_TAPRIO_ATTR_MAX - 1)
 #endif
diff --git a/libc/kernel/uapi/linux/prctl.h b/libc/kernel/uapi/linux/prctl.h
index ba50b14..5031e8d 100644
--- a/libc/kernel/uapi/linux/prctl.h
+++ b/libc/kernel/uapi/linux/prctl.h
@@ -137,9 +137,16 @@
 #define PR_GET_SPECULATION_CTRL 52
 #define PR_SET_SPECULATION_CTRL 53
 #define PR_SPEC_STORE_BYPASS 0
+#define PR_SPEC_INDIRECT_BRANCH 1
 #define PR_SPEC_NOT_AFFECTED 0
 #define PR_SPEC_PRCTL (1UL << 0)
 #define PR_SPEC_ENABLE (1UL << 1)
 #define PR_SPEC_DISABLE (1UL << 2)
 #define PR_SPEC_FORCE_DISABLE (1UL << 3)
+#define PR_PAC_RESET_KEYS 54
+#define PR_PAC_APIAKEY (1UL << 0)
+#define PR_PAC_APIBKEY (1UL << 1)
+#define PR_PAC_APDAKEY (1UL << 2)
+#define PR_PAC_APDBKEY (1UL << 3)
+#define PR_PAC_APGAKEY (1UL << 4)
 #endif
diff --git a/libc/kernel/uapi/linux/ptp_clock.h b/libc/kernel/uapi/linux/ptp_clock.h
index f32dcf0..bef3fe2 100644
--- a/libc/kernel/uapi/linux/ptp_clock.h
+++ b/libc/kernel/uapi/linux/ptp_clock.h
@@ -56,6 +56,11 @@
   unsigned int rsv[3];
   struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
 };
+struct ptp_sys_offset_extended {
+  unsigned int n_samples;
+  unsigned int rsv[3];
+  struct ptp_clock_time ts[PTP_MAX_SAMPLES][3];
+};
 struct ptp_sys_offset_precise {
   struct ptp_clock_time device;
   struct ptp_clock_time sys_realtime;
@@ -84,6 +89,7 @@
 #define PTP_PIN_GETFUNC _IOWR(PTP_CLK_MAGIC, 6, struct ptp_pin_desc)
 #define PTP_PIN_SETFUNC _IOW(PTP_CLK_MAGIC, 7, struct ptp_pin_desc)
 #define PTP_SYS_OFFSET_PRECISE _IOWR(PTP_CLK_MAGIC, 8, struct ptp_sys_offset_precise)
+#define PTP_SYS_OFFSET_EXTENDED _IOWR(PTP_CLK_MAGIC, 9, struct ptp_sys_offset_extended)
 struct ptp_extts_event {
   struct ptp_clock_time t;
   unsigned int index;
diff --git a/libc/kernel/uapi/linux/sctp.h b/libc/kernel/uapi/linux/sctp.h
index 6ba738e..66fde70 100644
--- a/libc/kernel/uapi/linux/sctp.h
+++ b/libc/kernel/uapi/linux/sctp.h
@@ -83,6 +83,7 @@
 #define SCTP_STREAM_SCHEDULER_VALUE 124
 #define SCTP_INTERLEAVING_SUPPORTED 125
 #define SCTP_SENDMSG_CONNECT 126
+#define SCTP_EVENT 127
 #define SCTP_PR_SCTP_NONE 0x0000
 #define SCTP_PR_SCTP_TTL 0x0010
 #define SCTP_PR_SCTP_RTX 0x0020
@@ -314,6 +315,8 @@
 };
 #define SCTP_ASSOC_CHANGE_DENIED 0x0004
 #define SCTP_ASSOC_CHANGE_FAILED 0x0008
+#define SCTP_STREAM_CHANGE_DENIED SCTP_ASSOC_CHANGE_DENIED
+#define SCTP_STREAM_CHANGE_FAILED SCTP_ASSOC_CHANGE_FAILED
 struct sctp_stream_change_event {
   __u16 strchange_type;
   __u16 strchange_flags;
@@ -358,6 +361,8 @@
 };
 enum sctp_sn_type {
   SCTP_SN_TYPE_BASE = (1 << 15),
+  SCTP_DATA_IO_EVENT = SCTP_SN_TYPE_BASE,
+#define SCTP_DATA_IO_EVENT SCTP_DATA_IO_EVENT
   SCTP_ASSOC_CHANGE,
 #define SCTP_ASSOC_CHANGE SCTP_ASSOC_CHANGE
   SCTP_PEER_ADDR_CHANGE,
@@ -382,6 +387,8 @@
 #define SCTP_ASSOC_RESET_EVENT SCTP_ASSOC_RESET_EVENT
   SCTP_STREAM_CHANGE_EVENT,
 #define SCTP_STREAM_CHANGE_EVENT SCTP_STREAM_CHANGE_EVENT
+  SCTP_SN_TYPE_MAX = SCTP_STREAM_CHANGE_EVENT,
+#define SCTP_SN_TYPE_MAX SCTP_SN_TYPE_MAX
 };
 typedef enum sctp_sn_error {
   SCTP_FAILED_THRESHOLD,
@@ -653,8 +660,14 @@
   uint16_t sas_instrms;
   uint16_t sas_outstrms;
 };
+struct sctp_event {
+  sctp_assoc_t se_assoc_id;
+  uint16_t se_type;
+  uint8_t se_on;
+};
 enum sctp_sched_type {
   SCTP_SS_FCFS,
+  SCTP_SS_DEFAULT = SCTP_SS_FCFS,
   SCTP_SS_PRIO,
   SCTP_SS_RR,
   SCTP_SS_MAX = SCTP_SS_RR
diff --git a/libc/kernel/uapi/linux/seccomp.h b/libc/kernel/uapi/linux/seccomp.h
index fe63789..a1e577d 100644
--- a/libc/kernel/uapi/linux/seccomp.h
+++ b/libc/kernel/uapi/linux/seccomp.h
@@ -26,14 +26,17 @@
 #define SECCOMP_SET_MODE_STRICT 0
 #define SECCOMP_SET_MODE_FILTER 1
 #define SECCOMP_GET_ACTION_AVAIL 2
+#define SECCOMP_GET_NOTIF_SIZES 3
 #define SECCOMP_FILTER_FLAG_TSYNC (1UL << 0)
 #define SECCOMP_FILTER_FLAG_LOG (1UL << 1)
 #define SECCOMP_FILTER_FLAG_SPEC_ALLOW (1UL << 2)
+#define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)
 #define SECCOMP_RET_KILL_PROCESS 0x80000000U
 #define SECCOMP_RET_KILL_THREAD 0x00000000U
 #define SECCOMP_RET_KILL SECCOMP_RET_KILL_THREAD
 #define SECCOMP_RET_TRAP 0x00030000U
 #define SECCOMP_RET_ERRNO 0x00050000U
+#define SECCOMP_RET_USER_NOTIF 0x7fc00000U
 #define SECCOMP_RET_TRACE 0x7ff00000U
 #define SECCOMP_RET_LOG 0x7ffc0000U
 #define SECCOMP_RET_ALLOW 0x7fff0000U
@@ -46,4 +49,29 @@
   __u64 instruction_pointer;
   __u64 args[6];
 };
+struct seccomp_notif_sizes {
+  __u16 seccomp_notif;
+  __u16 seccomp_notif_resp;
+  __u16 seccomp_data;
+};
+struct seccomp_notif {
+  __u64 id;
+  __u32 pid;
+  __u32 flags;
+  struct seccomp_data data;
+};
+struct seccomp_notif_resp {
+  __u64 id;
+  __s64 val;
+  __s32 error;
+  __u32 flags;
+};
+#define SECCOMP_IOC_MAGIC '!'
+#define SECCOMP_IO(nr) _IO(SECCOMP_IOC_MAGIC, nr)
+#define SECCOMP_IOR(nr,type) _IOR(SECCOMP_IOC_MAGIC, nr, type)
+#define SECCOMP_IOW(nr,type) _IOW(SECCOMP_IOC_MAGIC, nr, type)
+#define SECCOMP_IOWR(nr,type) _IOWR(SECCOMP_IOC_MAGIC, nr, type)
+#define SECCOMP_IOCTL_NOTIF_RECV SECCOMP_IOWR(0, struct seccomp_notif)
+#define SECCOMP_IOCTL_NOTIF_SEND SECCOMP_IOWR(1, struct seccomp_notif_resp)
+#define SECCOMP_IOCTL_NOTIF_ID_VALID SECCOMP_IOR(2, __u64)
 #endif
diff --git a/libc/kernel/uapi/linux/serial.h b/libc/kernel/uapi/linux/serial.h
index 79f11e3..e4e903d 100644
--- a/libc/kernel/uapi/linux/serial.h
+++ b/libc/kernel/uapi/linux/serial.h
@@ -100,4 +100,15 @@
   __u32 delay_rts_after_send;
   __u32 padding[5];
 };
+struct serial_iso7816 {
+  __u32 flags;
+#define SER_ISO7816_ENABLED (1 << 0)
+#define SER_ISO7816_T_PARAM (0x0f << 4)
+#define SER_ISO7816_T(t) (((t) & 0x0f) << 4)
+  __u32 tg;
+  __u32 sc_fi;
+  __u32 sc_di;
+  __u32 clk;
+  __u32 reserved[5];
+};
 #endif
diff --git a/libc/kernel/uapi/linux/serial_core.h b/libc/kernel/uapi/linux/serial_core.h
index f0f464b..b9af467 100644
--- a/libc/kernel/uapi/linux/serial_core.h
+++ b/libc/kernel/uapi/linux/serial_core.h
@@ -134,4 +134,5 @@
 #define PORT_PIC32 115
 #define PORT_MPS2UART 116
 #define PORT_MTK_BTIF 117
+#define PORT_RDA 118
 #endif
diff --git a/libc/kernel/uapi/linux/snmp.h b/libc/kernel/uapi/linux/snmp.h
index ae24f0f..75dea54 100644
--- a/libc/kernel/uapi/linux/snmp.h
+++ b/libc/kernel/uapi/linux/snmp.h
@@ -210,6 +210,7 @@
   LINUX_MIB_TCPREQQFULLDROP,
   LINUX_MIB_TCPRETRANSFAIL,
   LINUX_MIB_TCPRCVCOALESCE,
+  LINUX_MIB_TCPBACKLOGCOALESCE,
   LINUX_MIB_TCPOFOQUEUE,
   LINUX_MIB_TCPOFODROP,
   LINUX_MIB_TCPOFOMERGE,
diff --git a/libc/kernel/uapi/linux/sysctl.h b/libc/kernel/uapi/linux/sysctl.h
index 24d8362..ae0f44a 100644
--- a/libc/kernel/uapi/linux/sysctl.h
+++ b/libc/kernel/uapi/linux/sysctl.h
@@ -124,6 +124,7 @@
   KERN_NMI_WATCHDOG = 75,
   KERN_PANIC_ON_NMI = 76,
   KERN_PANIC_ON_WARN = 77,
+  KERN_PANIC_PRINT = 78,
 };
 enum {
   VM_UNUSED1 = 1,
diff --git a/libc/kernel/uapi/linux/taskstats.h b/libc/kernel/uapi/linux/taskstats.h
index b7bc744..dc7791d 100644
--- a/libc/kernel/uapi/linux/taskstats.h
+++ b/libc/kernel/uapi/linux/taskstats.h
@@ -19,7 +19,7 @@
 #ifndef _LINUX_TASKSTATS_H
 #define _LINUX_TASKSTATS_H
 #include <linux/types.h>
-#define TASKSTATS_VERSION 8
+#define TASKSTATS_VERSION 9
 #define TS_COMM_LEN 32
 struct taskstats {
   __u16 version;
@@ -66,6 +66,8 @@
   __u64 cpu_scaled_run_real_total;
   __u64 freepages_count;
   __u64 freepages_delay_total;
+  __u64 thrashing_count;
+  __u64 thrashing_delay_total;
 };
 enum {
   TASKSTATS_CMD_UNSPEC = 0,
diff --git a/libc/kernel/uapi/linux/tcp.h b/libc/kernel/uapi/linux/tcp.h
index d940f0f..ce3d735 100644
--- a/libc/kernel/uapi/linux/tcp.h
+++ b/libc/kernel/uapi/linux/tcp.h
@@ -207,6 +207,7 @@
   TCP_NLA_BYTES_RETRANS,
   TCP_NLA_DSACK_DUPS,
   TCP_NLA_REORD_SEEN,
+  TCP_NLA_SRTT,
 };
 #define TCP_MD5SIG_MAXKEYLEN 80
 #define TCP_MD5SIG_FLAG_PREFIX 1
diff --git a/libc/kernel/uapi/linux/udmabuf.h b/libc/kernel/uapi/linux/udmabuf.h
new file mode 100644
index 0000000..70cf49f
--- /dev/null
+++ b/libc/kernel/uapi/linux/udmabuf.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_UDMABUF_H
+#define _UAPI_LINUX_UDMABUF_H
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#define UDMABUF_FLAGS_CLOEXEC 0x01
+struct udmabuf_create {
+  __u32 memfd;
+  __u32 flags;
+  __u64 offset;
+  __u64 size;
+};
+struct udmabuf_create_item {
+  __u32 memfd;
+  __u32 __pad;
+  __u64 offset;
+  __u64 size;
+};
+struct udmabuf_create_list {
+  __u32 flags;
+  __u32 count;
+  struct udmabuf_create_item list[];
+};
+#define UDMABUF_CREATE _IOW('u', 0x42, struct udmabuf_create)
+#define UDMABUF_CREATE_LIST _IOW('u', 0x43, struct udmabuf_create_list)
+#endif
diff --git a/libc/kernel/uapi/linux/udp.h b/libc/kernel/uapi/linux/udp.h
index 3cd286b..278cf6c 100644
--- a/libc/kernel/uapi/linux/udp.h
+++ b/libc/kernel/uapi/linux/udp.h
@@ -30,6 +30,7 @@
 #define UDP_NO_CHECK6_TX 101
 #define UDP_NO_CHECK6_RX 102
 #define UDP_SEGMENT 103
+#define UDP_GRO 104
 #define UDP_ENCAP_ESPINUDP_NON_IKE 1
 #define UDP_ENCAP_ESPINUDP 2
 #define UDP_ENCAP_L2TPINUDP 3
diff --git a/libc/kernel/uapi/linux/usb/tmc.h b/libc/kernel/uapi/linux/usb/tmc.h
index 6e276de..20c061b 100644
--- a/libc/kernel/uapi/linux/usb/tmc.h
+++ b/libc/kernel/uapi/linux/usb/tmc.h
@@ -37,10 +37,30 @@
 #define USBTMC488_REQUEST_REN_CONTROL 160
 #define USBTMC488_REQUEST_GOTO_LOCAL 161
 #define USBTMC488_REQUEST_LOCAL_LOCKOUT 162
+struct usbtmc_request {
+  __u8 bRequestType;
+  __u8 bRequest;
+  __u16 wValue;
+  __u16 wIndex;
+  __u16 wLength;
+} __attribute__((packed));
+struct usbtmc_ctrlrequest {
+  struct usbtmc_request req;
+  void __user * data;
+} __attribute__((packed));
 struct usbtmc_termchar {
   __u8 term_char;
   __u8 term_char_enabled;
 } __attribute__((packed));
+#define USBTMC_FLAG_ASYNC 0x0001
+#define USBTMC_FLAG_APPEND 0x0002
+#define USBTMC_FLAG_IGNORE_TRAILER 0x0004
+struct usbtmc_message {
+  __u32 transfer_size;
+  __u32 transferred;
+  __u32 flags;
+  void __user * message;
+} __attribute__((packed));
 #define USBTMC_IOC_NR 91
 #define USBTMC_IOCTL_INDICATOR_PULSE _IO(USBTMC_IOC_NR, 1)
 #define USBTMC_IOCTL_CLEAR _IO(USBTMC_IOC_NR, 2)
@@ -48,16 +68,26 @@
 #define USBTMC_IOCTL_ABORT_BULK_IN _IO(USBTMC_IOC_NR, 4)
 #define USBTMC_IOCTL_CLEAR_OUT_HALT _IO(USBTMC_IOC_NR, 6)
 #define USBTMC_IOCTL_CLEAR_IN_HALT _IO(USBTMC_IOC_NR, 7)
+#define USBTMC_IOCTL_CTRL_REQUEST _IOWR(USBTMC_IOC_NR, 8, struct usbtmc_ctrlrequest)
 #define USBTMC_IOCTL_GET_TIMEOUT _IOR(USBTMC_IOC_NR, 9, __u32)
 #define USBTMC_IOCTL_SET_TIMEOUT _IOW(USBTMC_IOC_NR, 10, __u32)
 #define USBTMC_IOCTL_EOM_ENABLE _IOW(USBTMC_IOC_NR, 11, __u8)
 #define USBTMC_IOCTL_CONFIG_TERMCHAR _IOW(USBTMC_IOC_NR, 12, struct usbtmc_termchar)
+#define USBTMC_IOCTL_WRITE _IOWR(USBTMC_IOC_NR, 13, struct usbtmc_message)
+#define USBTMC_IOCTL_READ _IOWR(USBTMC_IOC_NR, 14, struct usbtmc_message)
+#define USBTMC_IOCTL_WRITE_RESULT _IOWR(USBTMC_IOC_NR, 15, __u32)
+#define USBTMC_IOCTL_API_VERSION _IOR(USBTMC_IOC_NR, 16, __u32)
 #define USBTMC488_IOCTL_GET_CAPS _IOR(USBTMC_IOC_NR, 17, unsigned char)
 #define USBTMC488_IOCTL_READ_STB _IOR(USBTMC_IOC_NR, 18, unsigned char)
 #define USBTMC488_IOCTL_REN_CONTROL _IOW(USBTMC_IOC_NR, 19, unsigned char)
 #define USBTMC488_IOCTL_GOTO_LOCAL _IO(USBTMC_IOC_NR, 20)
 #define USBTMC488_IOCTL_LOCAL_LOCKOUT _IO(USBTMC_IOC_NR, 21)
 #define USBTMC488_IOCTL_TRIGGER _IO(USBTMC_IOC_NR, 22)
+#define USBTMC488_IOCTL_WAIT_SRQ _IOW(USBTMC_IOC_NR, 23, __u32)
+#define USBTMC_IOCTL_MSG_IN_ATTR _IOR(USBTMC_IOC_NR, 24, __u8)
+#define USBTMC_IOCTL_AUTO_ABORT _IOW(USBTMC_IOC_NR, 25, __u8)
+#define USBTMC_IOCTL_CANCEL_IO _IO(USBTMC_IOC_NR, 35)
+#define USBTMC_IOCTL_CLEANUP_IO _IO(USBTMC_IOC_NR, 36)
 #define USBTMC488_CAPABILITY_TRIGGER 1
 #define USBTMC488_CAPABILITY_SIMPLE 2
 #define USBTMC488_CAPABILITY_REN_CONTROL 2
diff --git a/libc/kernel/uapi/linux/usb/video.h b/libc/kernel/uapi/linux/usb/video.h
index fb34483..cd2ede9 100644
--- a/libc/kernel/uapi/linux/usb/video.h
+++ b/libc/kernel/uapi/linux/usb/video.h
@@ -148,22 +148,22 @@
   __u8 bLength;
   __u8 bDescriptorType;
   __u8 bDescriptorSubType;
-  __u16 bcdUVC;
-  __u16 wTotalLength;
-  __u32 dwClockFrequency;
+  __le16 bcdUVC;
+  __le16 wTotalLength;
+  __le32 dwClockFrequency;
   __u8 bInCollection;
   __u8 baInterfaceNr[];
 } __attribute__((__packed__));
 #define UVC_DT_HEADER_SIZE(n) (12 + (n))
 #define UVC_HEADER_DESCRIPTOR(n) uvc_header_descriptor_ ##n
-#define DECLARE_UVC_HEADER_DESCRIPTOR(n) struct UVC_HEADER_DESCRIPTOR(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u16 bcdUVC; __u16 wTotalLength; __u32 dwClockFrequency; __u8 bInCollection; __u8 baInterfaceNr[n]; \
+#define DECLARE_UVC_HEADER_DESCRIPTOR(n) struct UVC_HEADER_DESCRIPTOR(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __le16 bcdUVC; __le16 wTotalLength; __le32 dwClockFrequency; __u8 bInCollection; __u8 baInterfaceNr[n]; \
 } __attribute__((packed))
 struct uvc_input_terminal_descriptor {
   __u8 bLength;
   __u8 bDescriptorType;
   __u8 bDescriptorSubType;
   __u8 bTerminalID;
-  __u16 wTerminalType;
+  __le16 wTerminalType;
   __u8 bAssocTerminal;
   __u8 iTerminal;
 } __attribute__((__packed__));
@@ -173,7 +173,7 @@
   __u8 bDescriptorType;
   __u8 bDescriptorSubType;
   __u8 bTerminalID;
-  __u16 wTerminalType;
+  __le16 wTerminalType;
   __u8 bAssocTerminal;
   __u8 bSourceID;
   __u8 iTerminal;
@@ -184,12 +184,12 @@
   __u8 bDescriptorType;
   __u8 bDescriptorSubType;
   __u8 bTerminalID;
-  __u16 wTerminalType;
+  __le16 wTerminalType;
   __u8 bAssocTerminal;
   __u8 iTerminal;
-  __u16 wObjectiveFocalLengthMin;
-  __u16 wObjectiveFocalLengthMax;
-  __u16 wOcularFocalLength;
+  __le16 wObjectiveFocalLengthMin;
+  __le16 wObjectiveFocalLengthMax;
+  __le16 wOcularFocalLength;
   __u8 bControlSize;
   __u8 bmControls[3];
 } __attribute__((__packed__));
@@ -213,7 +213,7 @@
   __u8 bDescriptorSubType;
   __u8 bUnitID;
   __u8 bSourceID;
-  __u16 wMaxMultiplier;
+  __le16 wMaxMultiplier;
   __u8 bControlSize;
   __u8 bmControls[2];
   __u8 iProcessing;
@@ -240,7 +240,7 @@
   __u8 bLength;
   __u8 bDescriptorType;
   __u8 bDescriptorSubType;
-  __u16 wMaxTransferSize;
+  __le16 wMaxTransferSize;
 } __attribute__((__packed__));
 #define UVC_DT_CONTROL_ENDPOINT_SIZE 5
 struct uvc_input_header_descriptor {
@@ -248,7 +248,7 @@
   __u8 bDescriptorType;
   __u8 bDescriptorSubType;
   __u8 bNumFormats;
-  __u16 wTotalLength;
+  __le16 wTotalLength;
   __u8 bEndpointAddress;
   __u8 bmInfo;
   __u8 bTerminalLink;
@@ -260,14 +260,14 @@
 } __attribute__((__packed__));
 #define UVC_DT_INPUT_HEADER_SIZE(n,p) (13 + (n * p))
 #define UVC_INPUT_HEADER_DESCRIPTOR(n,p) uvc_input_header_descriptor_ ##n_ ##p
-#define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n,p) struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bNumFormats; __u16 wTotalLength; __u8 bEndpointAddress; __u8 bmInfo; __u8 bTerminalLink; __u8 bStillCaptureMethod; __u8 bTriggerSupport; __u8 bTriggerUsage; __u8 bControlSize; __u8 bmaControls[p][n]; \
+#define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n,p) struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bNumFormats; __le16 wTotalLength; __u8 bEndpointAddress; __u8 bmInfo; __u8 bTerminalLink; __u8 bStillCaptureMethod; __u8 bTriggerSupport; __u8 bTriggerUsage; __u8 bControlSize; __u8 bmaControls[p][n]; \
 } __attribute__((packed))
 struct uvc_output_header_descriptor {
   __u8 bLength;
   __u8 bDescriptorType;
   __u8 bDescriptorSubType;
   __u8 bNumFormats;
-  __u16 wTotalLength;
+  __le16 wTotalLength;
   __u8 bEndpointAddress;
   __u8 bTerminalLink;
   __u8 bControlSize;
@@ -275,7 +275,7 @@
 } __attribute__((__packed__));
 #define UVC_DT_OUTPUT_HEADER_SIZE(n,p) (9 + (n * p))
 #define UVC_OUTPUT_HEADER_DESCRIPTOR(n,p) uvc_output_header_descriptor_ ##n_ ##p
-#define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n,p) struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bNumFormats; __u16 wTotalLength; __u8 bEndpointAddress; __u8 bTerminalLink; __u8 bControlSize; __u8 bmaControls[p][n]; \
+#define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n,p) struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bNumFormats; __le16 wTotalLength; __u8 bEndpointAddress; __u8 bTerminalLink; __u8 bControlSize; __u8 bmaControls[p][n]; \
 } __attribute__((packed))
 struct uvc_color_matching_descriptor {
   __u8 bLength;
@@ -325,18 +325,18 @@
   __u8 bDescriptorSubType;
   __u8 bFrameIndex;
   __u8 bmCapabilities;
-  __u16 wWidth;
-  __u16 wHeight;
-  __u32 dwMinBitRate;
-  __u32 dwMaxBitRate;
-  __u32 dwMaxVideoFrameBufferSize;
-  __u32 dwDefaultFrameInterval;
+  __le16 wWidth;
+  __le16 wHeight;
+  __le32 dwMinBitRate;
+  __le32 dwMaxBitRate;
+  __le32 dwMaxVideoFrameBufferSize;
+  __le32 dwDefaultFrameInterval;
   __u8 bFrameIntervalType;
-  __u32 dwFrameInterval[];
+  __le32 dwFrameInterval[];
 } __attribute__((__packed__));
 #define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26 + 4 * (n))
 #define UVC_FRAME_UNCOMPRESSED(n) uvc_frame_uncompressed_ ##n
-#define DECLARE_UVC_FRAME_UNCOMPRESSED(n) struct UVC_FRAME_UNCOMPRESSED(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bFrameIndex; __u8 bmCapabilities; __u16 wWidth; __u16 wHeight; __u32 dwMinBitRate; __u32 dwMaxBitRate; __u32 dwMaxVideoFrameBufferSize; __u32 dwDefaultFrameInterval; __u8 bFrameIntervalType; __u32 dwFrameInterval[n]; \
+#define DECLARE_UVC_FRAME_UNCOMPRESSED(n) struct UVC_FRAME_UNCOMPRESSED(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bFrameIndex; __u8 bmCapabilities; __le16 wWidth; __le16 wHeight; __le32 dwMinBitRate; __le32 dwMaxBitRate; __le32 dwMaxVideoFrameBufferSize; __le32 dwDefaultFrameInterval; __u8 bFrameIntervalType; __le32 dwFrameInterval[n]; \
 } __attribute__((packed))
 struct uvc_format_mjpeg {
   __u8 bLength;
@@ -358,17 +358,17 @@
   __u8 bDescriptorSubType;
   __u8 bFrameIndex;
   __u8 bmCapabilities;
-  __u16 wWidth;
-  __u16 wHeight;
-  __u32 dwMinBitRate;
-  __u32 dwMaxBitRate;
-  __u32 dwMaxVideoFrameBufferSize;
-  __u32 dwDefaultFrameInterval;
+  __le16 wWidth;
+  __le16 wHeight;
+  __le32 dwMinBitRate;
+  __le32 dwMaxBitRate;
+  __le32 dwMaxVideoFrameBufferSize;
+  __le32 dwDefaultFrameInterval;
   __u8 bFrameIntervalType;
-  __u32 dwFrameInterval[];
+  __le32 dwFrameInterval[];
 } __attribute__((__packed__));
 #define UVC_DT_FRAME_MJPEG_SIZE(n) (26 + 4 * (n))
 #define UVC_FRAME_MJPEG(n) uvc_frame_mjpeg_ ##n
-#define DECLARE_UVC_FRAME_MJPEG(n) struct UVC_FRAME_MJPEG(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bFrameIndex; __u8 bmCapabilities; __u16 wWidth; __u16 wHeight; __u32 dwMinBitRate; __u32 dwMaxBitRate; __u32 dwMaxVideoFrameBufferSize; __u32 dwDefaultFrameInterval; __u8 bFrameIntervalType; __u32 dwFrameInterval[n]; \
+#define DECLARE_UVC_FRAME_MJPEG(n) struct UVC_FRAME_MJPEG(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bFrameIndex; __u8 bmCapabilities; __le16 wWidth; __le16 wHeight; __le32 dwMinBitRate; __le32 dwMaxBitRate; __le32 dwMaxVideoFrameBufferSize; __le32 dwDefaultFrameInterval; __u8 bFrameIntervalType; __le32 dwFrameInterval[n]; \
 } __attribute__((packed))
 #endif
diff --git a/libc/kernel/uapi/linux/v4l2-common.h b/libc/kernel/uapi/linux/v4l2-common.h
index 779bda9..021be85 100644
--- a/libc/kernel/uapi/linux/v4l2-common.h
+++ b/libc/kernel/uapi/linux/v4l2-common.h
@@ -27,18 +27,9 @@
 #define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101
 #define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102
 #define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
-#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP
-#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE
-#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP
-#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE
-#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS V4L2_SEL_TGT_CROP_BOUNDS
-#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS
 #define V4L2_SEL_FLAG_GE (1 << 0)
 #define V4L2_SEL_FLAG_LE (1 << 1)
 #define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2)
-#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE V4L2_SEL_FLAG_GE
-#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
-#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
 struct v4l2_edid {
   __u32 pad;
   __u32 start_block;
@@ -46,4 +37,13 @@
   __u32 reserved[5];
   __u8 * edid;
 };
+#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP
+#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE
+#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP
+#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE
+#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS V4L2_SEL_TGT_CROP_BOUNDS
+#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS
+#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE V4L2_SEL_FLAG_GE
+#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
+#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
 #endif
diff --git a/libc/kernel/uapi/linux/v4l2-controls.h b/libc/kernel/uapi/linux/v4l2-controls.h
index 45590a2..3c2d2b2 100644
--- a/libc/kernel/uapi/linux/v4l2-controls.h
+++ b/libc/kernel/uapi/linux/v4l2-controls.h
@@ -18,6 +18,7 @@
  ****************************************************************************/
 #ifndef __LINUX_V4L2_CONTROLS_H
 #define __LINUX_V4L2_CONTROLS_H
+#include <linux/types.h>
 #define V4L2_CTRL_CLASS_USER 0x00980000
 #define V4L2_CTRL_CLASS_MPEG 0x00990000
 #define V4L2_CTRL_CLASS_CAMERA 0x009a0000
diff --git a/libc/kernel/uapi/linux/version.h b/libc/kernel/uapi/linux/version.h
index a234744..43c04d1 100644
--- a/libc/kernel/uapi/linux/version.h
+++ b/libc/kernel/uapi/linux/version.h
@@ -16,5 +16,5 @@
  ***
  ****************************************************************************
  ****************************************************************************/
-#define LINUX_VERSION_CODE 267008
+#define LINUX_VERSION_CODE 327683
 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
diff --git a/libc/kernel/uapi/linux/vfio.h b/libc/kernel/uapi/linux/vfio.h
index 8b397f4..b947abc 100644
--- a/libc/kernel/uapi/linux/vfio.h
+++ b/libc/kernel/uapi/linux/vfio.h
@@ -57,6 +57,7 @@
 #define VFIO_DEVICE_FLAGS_PLATFORM (1 << 2)
 #define VFIO_DEVICE_FLAGS_AMBA (1 << 3)
 #define VFIO_DEVICE_FLAGS_CCW (1 << 4)
+#define VFIO_DEVICE_FLAGS_AP (1 << 5)
   __u32 num_regions;
   __u32 num_irqs;
 };
@@ -65,6 +66,7 @@
 #define VFIO_DEVICE_API_PLATFORM_STRING "vfio-platform"
 #define VFIO_DEVICE_API_AMBA_STRING "vfio-amba"
 #define VFIO_DEVICE_API_CCW_STRING "vfio-ccw"
+#define VFIO_DEVICE_API_AP_STRING "vfio-ap"
 struct vfio_region_info {
   __u32 argsz;
   __u32 flags;
@@ -100,7 +102,32 @@
 #define VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION (1)
 #define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2)
 #define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3)
+#define VFIO_REGION_TYPE_GFX (1)
+#define VFIO_REGION_SUBTYPE_GFX_EDID (1)
+struct vfio_region_gfx_edid {
+  __u32 edid_offset;
+  __u32 edid_max_size;
+  __u32 edid_size;
+  __u32 max_xres;
+  __u32 max_yres;
+  __u32 link_state;
+#define VFIO_DEVICE_GFX_LINK_STATE_UP 1
+#define VFIO_DEVICE_GFX_LINK_STATE_DOWN 2
+};
+#define VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM (1)
+#define VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD (1)
 #define VFIO_REGION_INFO_CAP_MSIX_MAPPABLE 3
+#define VFIO_REGION_INFO_CAP_NVLINK2_SSATGT 4
+struct vfio_region_info_cap_nvlink2_ssatgt {
+  struct vfio_info_cap_header header;
+  __u64 tgt;
+};
+#define VFIO_REGION_INFO_CAP_NVLINK2_LNKSPD 5
+struct vfio_region_info_cap_nvlink2_lnkspd {
+  struct vfio_info_cap_header header;
+  __u32 link_speed;
+  __u32 __pad;
+};
 struct vfio_irq_info {
   __u32 argsz;
   __u32 flags;
diff --git a/libc/kernel/uapi/linux/vhost.h b/libc/kernel/uapi/linux/vhost.h
index e802e02..9e87e6e 100644
--- a/libc/kernel/uapi/linux/vhost.h
+++ b/libc/kernel/uapi/linux/vhost.h
@@ -18,71 +18,9 @@
  ****************************************************************************/
 #ifndef _LINUX_VHOST_H
 #define _LINUX_VHOST_H
+#include <linux/vhost_types.h>
 #include <linux/types.h>
-#include <linux/compiler.h>
 #include <linux/ioctl.h>
-#include <linux/virtio_config.h>
-#include <linux/virtio_ring.h>
-struct vhost_vring_state {
-  unsigned int index;
-  unsigned int num;
-};
-struct vhost_vring_file {
-  unsigned int index;
-  int fd;
-};
-struct vhost_vring_addr {
-  unsigned int index;
-  unsigned int flags;
-#define VHOST_VRING_F_LOG 0
-  __u64 desc_user_addr;
-  __u64 used_user_addr;
-  __u64 avail_user_addr;
-  __u64 log_guest_addr;
-};
-struct vhost_iotlb_msg {
-  __u64 iova;
-  __u64 size;
-  __u64 uaddr;
-#define VHOST_ACCESS_RO 0x1
-#define VHOST_ACCESS_WO 0x2
-#define VHOST_ACCESS_RW 0x3
-  __u8 perm;
-#define VHOST_IOTLB_MISS 1
-#define VHOST_IOTLB_UPDATE 2
-#define VHOST_IOTLB_INVALIDATE 3
-#define VHOST_IOTLB_ACCESS_FAIL 4
-  __u8 type;
-};
-#define VHOST_IOTLB_MSG 0x1
-#define VHOST_IOTLB_MSG_V2 0x2
-struct vhost_msg {
-  int type;
-  union {
-    struct vhost_iotlb_msg iotlb;
-    __u8 padding[64];
-  };
-};
-struct vhost_msg_v2 {
-  __u32 type;
-  __u32 reserved;
-  union {
-    struct vhost_iotlb_msg iotlb;
-    __u8 padding[64];
-  };
-};
-struct vhost_memory_region {
-  __u64 guest_phys_addr;
-  __u64 memory_size;
-  __u64 userspace_addr;
-  __u64 flags_padding;
-};
-#define VHOST_PAGE_SIZE 0x1000
-struct vhost_memory {
-  __u32 nregions;
-  __u32 padding;
-  struct vhost_memory_region regions[0];
-};
 #define VHOST_VIRTIO 0xAF
 #define VHOST_GET_FEATURES _IOR(VHOST_VIRTIO, 0x00, __u64)
 #define VHOST_SET_FEATURES _IOW(VHOST_VIRTIO, 0x00, __u64)
@@ -108,15 +46,6 @@
 #define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
 #define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
 #define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, struct vhost_vring_file)
-#define VHOST_F_LOG_ALL 26
-#define VHOST_NET_F_VIRTIO_NET_HDR 27
-#define VHOST_SCSI_ABI_VERSION 1
-struct vhost_scsi_target {
-  int abi_version;
-  char vhost_wwpn[224];
-  unsigned short vhost_tpgt;
-  unsigned short reserved;
-};
 #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)
 #define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target)
 #define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int)
diff --git a/libc/kernel/uapi/linux/vhost_types.h b/libc/kernel/uapi/linux/vhost_types.h
new file mode 100644
index 0000000..646fcdc
--- /dev/null
+++ b/libc/kernel/uapi/linux/vhost_types.h
@@ -0,0 +1,94 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_VHOST_TYPES_H
+#define _LINUX_VHOST_TYPES_H
+#include <linux/types.h>
+#include <linux/compiler.h>
+#include <linux/virtio_config.h>
+#include <linux/virtio_ring.h>
+struct vhost_vring_state {
+  unsigned int index;
+  unsigned int num;
+};
+struct vhost_vring_file {
+  unsigned int index;
+  int fd;
+};
+struct vhost_vring_addr {
+  unsigned int index;
+  unsigned int flags;
+#define VHOST_VRING_F_LOG 0
+  __u64 desc_user_addr;
+  __u64 used_user_addr;
+  __u64 avail_user_addr;
+  __u64 log_guest_addr;
+};
+struct vhost_iotlb_msg {
+  __u64 iova;
+  __u64 size;
+  __u64 uaddr;
+#define VHOST_ACCESS_RO 0x1
+#define VHOST_ACCESS_WO 0x2
+#define VHOST_ACCESS_RW 0x3
+  __u8 perm;
+#define VHOST_IOTLB_MISS 1
+#define VHOST_IOTLB_UPDATE 2
+#define VHOST_IOTLB_INVALIDATE 3
+#define VHOST_IOTLB_ACCESS_FAIL 4
+  __u8 type;
+};
+#define VHOST_IOTLB_MSG 0x1
+#define VHOST_IOTLB_MSG_V2 0x2
+struct vhost_msg {
+  int type;
+  union {
+    struct vhost_iotlb_msg iotlb;
+    __u8 padding[64];
+  };
+};
+struct vhost_msg_v2 {
+  __u32 type;
+  __u32 reserved;
+  union {
+    struct vhost_iotlb_msg iotlb;
+    __u8 padding[64];
+  };
+};
+struct vhost_memory_region {
+  __u64 guest_phys_addr;
+  __u64 memory_size;
+  __u64 userspace_addr;
+  __u64 flags_padding;
+};
+#define VHOST_PAGE_SIZE 0x1000
+struct vhost_memory {
+  __u32 nregions;
+  __u32 padding;
+  struct vhost_memory_region regions[0];
+};
+#define VHOST_SCSI_ABI_VERSION 1
+struct vhost_scsi_target {
+  int abi_version;
+  char vhost_wwpn[224];
+  unsigned short vhost_tpgt;
+  unsigned short reserved;
+};
+#define VHOST_F_LOG_ALL 26
+#define VHOST_NET_F_VIRTIO_NET_HDR 27
+#endif
diff --git a/libc/kernel/uapi/linux/videodev2.h b/libc/kernel/uapi/linux/videodev2.h
index 51faa1e..74e591d 100644
--- a/libc/kernel/uapi/linux/videodev2.h
+++ b/libc/kernel/uapi/linux/videodev2.h
@@ -58,6 +58,7 @@
   V4L2_BUF_TYPE_SDR_CAPTURE = 11,
   V4L2_BUF_TYPE_SDR_OUTPUT = 12,
   V4L2_BUF_TYPE_META_CAPTURE = 13,
+  V4L2_BUF_TYPE_META_OUTPUT = 14,
   V4L2_BUF_TYPE_PRIVATE = 0x80,
 };
 #define V4L2_TYPE_IS_MULTIPLANAR(type) ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
@@ -86,7 +87,7 @@
   V4L2_COLORSPACE_470_SYSTEM_BG = 6,
   V4L2_COLORSPACE_JPEG = 7,
   V4L2_COLORSPACE_SRGB = 8,
-  V4L2_COLORSPACE_ADOBERGB = 9,
+  V4L2_COLORSPACE_OPRGB = 9,
   V4L2_COLORSPACE_BT2020 = 10,
   V4L2_COLORSPACE_RAW = 11,
   V4L2_COLORSPACE_DCI_P3 = 12,
@@ -96,13 +97,13 @@
   V4L2_XFER_FUNC_DEFAULT = 0,
   V4L2_XFER_FUNC_709 = 1,
   V4L2_XFER_FUNC_SRGB = 2,
-  V4L2_XFER_FUNC_ADOBERGB = 3,
+  V4L2_XFER_FUNC_OPRGB = 3,
   V4L2_XFER_FUNC_SMPTE240M = 4,
   V4L2_XFER_FUNC_NONE = 5,
   V4L2_XFER_FUNC_DCI_P3 = 6,
   V4L2_XFER_FUNC_SMPTE2084 = 7,
 };
-#define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) ((colsp) == V4L2_COLORSPACE_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : ((colsp) == V4L2_COLORSPACE_DCI_P3 ? V4L2_XFER_FUNC_DCI_P3 : ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : ((colsp) == V4L2_COLORSPACE_SRGB || (colsp) == V4L2_COLORSPACE_JPEG ? V4L2_XFER_FUNC_SRGB : V4L2_XFER_FUNC_709)))))
+#define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) ((colsp) == V4L2_COLORSPACE_OPRGB ? V4L2_XFER_FUNC_OPRGB : ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : ((colsp) == V4L2_COLORSPACE_DCI_P3 ? V4L2_XFER_FUNC_DCI_P3 : ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : ((colsp) == V4L2_COLORSPACE_SRGB || (colsp) == V4L2_COLORSPACE_JPEG ? V4L2_XFER_FUNC_SRGB : V4L2_XFER_FUNC_709)))))
 enum v4l2_ycbcr_encoding {
   V4L2_YCBCR_ENC_DEFAULT = 0,
   V4L2_YCBCR_ENC_601 = 1,
@@ -125,6 +126,8 @@
   V4L2_QUANTIZATION_LIM_RANGE = 2,
 };
 #define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb_or_hsv,colsp,ycbcr_enc) (((is_rgb_or_hsv) && (colsp) == V4L2_COLORSPACE_BT2020) ? V4L2_QUANTIZATION_LIM_RANGE : (((is_rgb_or_hsv) || (colsp) == V4L2_COLORSPACE_JPEG) ? V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
+#define V4L2_COLORSPACE_ADOBERGB V4L2_COLORSPACE_OPRGB
+#define V4L2_XFER_FUNC_ADOBERGB V4L2_XFER_FUNC_OPRGB
 enum v4l2_priority {
   V4L2_PRIORITY_UNSET = 0,
   V4L2_PRIORITY_BACKGROUND = 1,
@@ -177,6 +180,7 @@
 #define V4L2_CAP_READWRITE 0x01000000
 #define V4L2_CAP_ASYNCIO 0x02000000
 #define V4L2_CAP_STREAMING 0x04000000
+#define V4L2_CAP_META_OUTPUT 0x08000000
 #define V4L2_CAP_TOUCH 0x10000000
 #define V4L2_CAP_DEVICE_CAPS 0x80000000
 struct v4l2_pix_format {
@@ -313,6 +317,7 @@
 #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3')
 #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1')
 #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2')
+#define V4L2_PIX_FMT_MPEG2_SLICE v4l2_fourcc('M', 'G', '2', 'S')
 #define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4')
 #define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D')
 #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G')
@@ -352,6 +357,8 @@
 #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ')
 #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1')
 #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I')
+#define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2')
+#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4')
 #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b')
 #define V4L2_PIX_FMT_IPU3_SGBRG10 v4l2_fourcc('i', 'p', '3', 'g')
 #define V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G')
@@ -371,6 +378,7 @@
 #define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H')
 #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T')
 #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H')
+#define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X')
 #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe
 #define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA 0x00000001
 struct v4l2_fmtdesc {
@@ -469,8 +477,14 @@
   __u32 count;
   __u32 type;
   __u32 memory;
-  __u32 reserved[2];
+  __u32 capabilities;
+  __u32 reserved[1];
 };
+#define V4L2_BUF_CAP_SUPPORTS_MMAP (1 << 0)
+#define V4L2_BUF_CAP_SUPPORTS_USERPTR (1 << 1)
+#define V4L2_BUF_CAP_SUPPORTS_DMABUF (1 << 2)
+#define V4L2_BUF_CAP_SUPPORTS_REQUESTS (1 << 3)
+#define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4)
 struct v4l2_plane {
   __u32 bytesused;
   __u32 length;
@@ -500,7 +514,10 @@
   } m;
   __u32 length;
   __u32 reserved2;
-  __u32 reserved;
+  union {
+    __s32 request_fd;
+    __u32 reserved;
+  };
 };
 #define V4L2_BUF_FLAG_MAPPED 0x00000001
 #define V4L2_BUF_FLAG_QUEUED 0x00000002
@@ -509,6 +526,7 @@
 #define V4L2_BUF_FLAG_PFRAME 0x00000010
 #define V4L2_BUF_FLAG_BFRAME 0x00000020
 #define V4L2_BUF_FLAG_ERROR 0x00000040
+#define V4L2_BUF_FLAG_IN_REQUEST 0x00000080
 #define V4L2_BUF_FLAG_TIMECODE 0x00000100
 #define V4L2_BUF_FLAG_PREPARED 0x00000400
 #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x00000800
@@ -521,6 +539,7 @@
 #define V4L2_BUF_FLAG_TSTAMP_SRC_EOF 0x00000000
 #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000
 #define V4L2_BUF_FLAG_LAST 0x00100000
+#define V4L2_BUF_FLAG_REQUEST_FD 0x00800000
 struct v4l2_exportbuffer {
   __u32 type;
   __u32 index;
@@ -702,6 +721,7 @@
 #define V4L2_DV_FL_HAS_PICTURE_ASPECT (1 << 6)
 #define V4L2_DV_FL_HAS_CEA861_VIC (1 << 7)
 #define V4L2_DV_FL_HAS_HDMI_VIC (1 << 8)
+#define V4L2_DV_FL_CAN_DETECT_REDUCED_FPS (1 << 9)
 #define V4L2_DV_BT_BLANKING_WIDTH(bt) ((bt)->hfrontporch + (bt)->hsync + (bt)->hbackporch)
 #define V4L2_DV_BT_FRAME_WIDTH(bt) ((bt)->width + V4L2_DV_BT_BLANKING_WIDTH(bt))
 #define V4L2_DV_BT_BLANKING_HEIGHT(bt) ((bt)->vfrontporch + (bt)->vsync + (bt)->vbackporch + (bt)->il_vfrontporch + (bt)->il_vsync + (bt)->il_vbackporch)
@@ -819,7 +839,8 @@
   };
   __u32 count;
   __u32 error_idx;
-  __u32 reserved[2];
+  __s32 request_fd;
+  __u32 reserved[1];
   struct v4l2_ext_control * controls;
 };
 #define V4L2_CTRL_ID_MASK (0x0fffffff)
@@ -829,6 +850,7 @@
 #define V4L2_CTRL_MAX_DIMS (4)
 #define V4L2_CTRL_WHICH_CUR_VAL 0
 #define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000
+#define V4L2_CTRL_WHICH_REQUEST_VAL 0x0f010000
 enum v4l2_ctrl_type {
   V4L2_CTRL_TYPE_INTEGER = 1,
   V4L2_CTRL_TYPE_BOOLEAN = 2,
@@ -1274,7 +1296,8 @@
   __u32 count;
   __u32 memory;
   struct v4l2_format format;
-  __u32 reserved[8];
+  __u32 capabilities;
+  __u32 reserved[7];
 };
 #define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability)
 #define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc)
diff --git a/libc/kernel/uapi/linux/virtio_balloon.h b/libc/kernel/uapi/linux/virtio_balloon.h
index 5969fa0..806e757 100644
--- a/libc/kernel/uapi/linux/virtio_balloon.h
+++ b/libc/kernel/uapi/linux/virtio_balloon.h
@@ -25,10 +25,16 @@
 #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0
 #define VIRTIO_BALLOON_F_STATS_VQ 1
 #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2
+#define VIRTIO_BALLOON_F_FREE_PAGE_HINT 3
+#define VIRTIO_BALLOON_F_PAGE_POISON 4
 #define VIRTIO_BALLOON_PFN_SHIFT 12
+#define VIRTIO_BALLOON_CMD_ID_STOP 0
+#define VIRTIO_BALLOON_CMD_ID_DONE 1
 struct virtio_balloon_config {
   __u32 num_pages;
   __u32 actual;
+  __u32 free_page_report_cmd_id;
+  __u32 poison_val;
 };
 #define VIRTIO_BALLOON_S_SWAP_IN 0
 #define VIRTIO_BALLOON_S_SWAP_OUT 1
diff --git a/libc/kernel/uapi/linux/virtio_blk.h b/libc/kernel/uapi/linux/virtio_blk.h
index 2d53704..5197434 100644
--- a/libc/kernel/uapi/linux/virtio_blk.h
+++ b/libc/kernel/uapi/linux/virtio_blk.h
@@ -29,6 +29,8 @@
 #define VIRTIO_BLK_F_BLK_SIZE 6
 #define VIRTIO_BLK_F_TOPOLOGY 10
 #define VIRTIO_BLK_F_MQ 12
+#define VIRTIO_BLK_F_DISCARD 13
+#define VIRTIO_BLK_F_WRITE_ZEROES 14
 #ifndef VIRTIO_BLK_NO_LEGACY
 #define VIRTIO_BLK_F_BARRIER 0
 #define VIRTIO_BLK_F_SCSI 7
@@ -54,6 +56,13 @@
   __u8 wce;
   __u8 unused;
   __u16 num_queues;
+  __u32 max_discard_sectors;
+  __u32 max_discard_seg;
+  __u32 discard_sector_alignment;
+  __u32 max_write_zeroes_sectors;
+  __u32 max_write_zeroes_seg;
+  __u8 write_zeroes_may_unmap;
+  __u8 unused1[3];
 } __attribute__((packed));
 #define VIRTIO_BLK_T_IN 0
 #define VIRTIO_BLK_T_OUT 1
@@ -62,6 +71,8 @@
 #endif
 #define VIRTIO_BLK_T_FLUSH 4
 #define VIRTIO_BLK_T_GET_ID 8
+#define VIRTIO_BLK_T_DISCARD 11
+#define VIRTIO_BLK_T_WRITE_ZEROES 13
 #ifndef VIRTIO_BLK_NO_LEGACY
 #define VIRTIO_BLK_T_BARRIER 0x80000000
 #endif
@@ -70,6 +81,12 @@
   __virtio32 ioprio;
   __virtio64 sector;
 };
+#define VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP 0x00000001
+struct virtio_blk_discard_write_zeroes {
+  __le64 sector;
+  __le32 num_sectors;
+  __le32 flags;
+};
 #ifndef VIRTIO_BLK_NO_LEGACY
 struct virtio_scsi_inhdr {
   __virtio32 errors;
diff --git a/libc/kernel/uapi/linux/virtio_config.h b/libc/kernel/uapi/linux/virtio_config.h
index ddf5e4e..c9ec83f 100644
--- a/libc/kernel/uapi/linux/virtio_config.h
+++ b/libc/kernel/uapi/linux/virtio_config.h
@@ -33,5 +33,7 @@
 #endif
 #define VIRTIO_F_VERSION_1 32
 #define VIRTIO_F_IOMMU_PLATFORM 33
+#define VIRTIO_F_RING_PACKED 34
+#define VIRTIO_F_ORDER_PLATFORM 36
 #define VIRTIO_F_SR_IOV 37
 #endif
diff --git a/libc/kernel/uapi/linux/virtio_gpu.h b/libc/kernel/uapi/linux/virtio_gpu.h
index 60dbf71..0ac7495 100644
--- a/libc/kernel/uapi/linux/virtio_gpu.h
+++ b/libc/kernel/uapi/linux/virtio_gpu.h
@@ -20,6 +20,7 @@
 #define VIRTIO_GPU_HW_H
 #include <linux/types.h>
 #define VIRTIO_GPU_F_VIRGL 0
+#define VIRTIO_GPU_F_EDID 1
 enum virtio_gpu_ctrl_type {
   VIRTIO_GPU_UNDEFINED = 0,
   VIRTIO_GPU_CMD_GET_DISPLAY_INFO = 0x0100,
@@ -32,6 +33,7 @@
   VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING,
   VIRTIO_GPU_CMD_GET_CAPSET_INFO,
   VIRTIO_GPU_CMD_GET_CAPSET,
+  VIRTIO_GPU_CMD_GET_EDID,
   VIRTIO_GPU_CMD_CTX_CREATE = 0x0200,
   VIRTIO_GPU_CMD_CTX_DESTROY,
   VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE,
@@ -46,6 +48,7 @@
   VIRTIO_GPU_RESP_OK_DISPLAY_INFO,
   VIRTIO_GPU_RESP_OK_CAPSET_INFO,
   VIRTIO_GPU_RESP_OK_CAPSET,
+  VIRTIO_GPU_RESP_OK_EDID,
   VIRTIO_GPU_RESP_ERR_UNSPEC = 0x1200,
   VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY,
   VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID,
@@ -207,6 +210,17 @@
   struct virtio_gpu_ctrl_hdr hdr;
   __u8 capset_data[];
 };
+struct virtio_gpu_cmd_get_edid {
+  struct virtio_gpu_ctrl_hdr hdr;
+  __le32 scanout;
+  __le32 padding;
+};
+struct virtio_gpu_resp_edid {
+  struct virtio_gpu_ctrl_hdr hdr;
+  __le32 size;
+  __le32 padding;
+  __u8 edid[1024];
+};
 #define VIRTIO_GPU_EVENT_DISPLAY (1 << 0)
 struct virtio_gpu_config {
   __u32 events_read;
diff --git a/libc/kernel/uapi/linux/virtio_ring.h b/libc/kernel/uapi/linux/virtio_ring.h
index e3af401..ba75940 100644
--- a/libc/kernel/uapi/linux/virtio_ring.h
+++ b/libc/kernel/uapi/linux/virtio_ring.h
@@ -24,8 +24,14 @@
 #define VRING_DESC_F_NEXT 1
 #define VRING_DESC_F_WRITE 2
 #define VRING_DESC_F_INDIRECT 4
+#define VRING_PACKED_DESC_F_AVAIL 7
+#define VRING_PACKED_DESC_F_USED 15
 #define VRING_USED_F_NO_NOTIFY 1
 #define VRING_AVAIL_F_NO_INTERRUPT 1
+#define VRING_PACKED_EVENT_FLAG_ENABLE 0x0
+#define VRING_PACKED_EVENT_FLAG_DISABLE 0x1
+#define VRING_PACKED_EVENT_FLAG_DESC 0x2
+#define VRING_PACKED_EVENT_F_WRAP_CTR 15
 #define VIRTIO_RING_F_INDIRECT_DESC 28
 #define VIRTIO_RING_F_EVENT_IDX 29
 struct vring_desc {
@@ -59,4 +65,14 @@
 #define VRING_DESC_ALIGN_SIZE 16
 #define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
 #define vring_avail_event(vr) (* (__virtio16 *) & (vr)->used->ring[(vr)->num])
+struct vring_packed_desc_event {
+  __le16 off_wrap;
+  __le16 flags;
+};
+struct vring_packed_desc {
+  __le64 addr;
+  __le32 len;
+  __le16 id;
+  __le16 flags;
+};
 #endif
diff --git a/libc/kernel/uapi/rdma/hfi/hfi1_user.h b/libc/kernel/uapi/rdma/hfi/hfi1_user.h
index 9148ed5..e74d837 100644
--- a/libc/kernel/uapi/rdma/hfi/hfi1_user.h
+++ b/libc/kernel/uapi/rdma/hfi/hfi1_user.h
@@ -28,6 +28,7 @@
 #define HFI1_CAP_SDMA_AHG (1UL << 2)
 #define HFI1_CAP_EXTENDED_PSN (1UL << 3)
 #define HFI1_CAP_HDRSUPP (1UL << 4)
+#define HFI1_CAP_TID_RDMA (1UL << 5)
 #define HFI1_CAP_USE_SDMA_HEAD (1UL << 6)
 #define HFI1_CAP_MULTI_PKT_EGR (1UL << 7)
 #define HFI1_CAP_NODROP_RHQ_FULL (1UL << 8)
@@ -38,6 +39,7 @@
 #define HFI1_CAP_NO_INTEGRITY (1UL << 13)
 #define HFI1_CAP_PKEY_CHECK (1UL << 14)
 #define HFI1_CAP_STATIC_RATE_CTRL (1UL << 15)
+#define HFI1_CAP_OPFN (1UL << 16)
 #define HFI1_CAP_SDMA_HEAD_CHECK (1UL << 17)
 #define HFI1_CAP_EARLY_CREDIT_RETURN (1UL << 18)
 #define HFI1_RCVHDR_ENTSIZE_2 (1UL << 0)
diff --git a/libc/kernel/uapi/rdma/hns-abi.h b/libc/kernel/uapi/rdma/hns-abi.h
index 23bedf9..0bae0d4 100644
--- a/libc/kernel/uapi/rdma/hns-abi.h
+++ b/libc/kernel/uapi/rdma/hns-abi.h
@@ -27,6 +27,15 @@
   __aligned_u64 cqn;
   __aligned_u64 cap_flags;
 };
+struct hns_roce_ib_create_srq {
+  __aligned_u64 buf_addr;
+  __aligned_u64 db_addr;
+  __aligned_u64 que_addr;
+};
+struct hns_roce_ib_create_srq_resp {
+  __u32 srqn;
+  __u32 reserved;
+};
 struct hns_roce_ib_create_qp {
   __aligned_u64 buf_addr;
   __aligned_u64 db_addr;
diff --git a/libc/kernel/uapi/rdma/ib_user_ioctl_cmds.h b/libc/kernel/uapi/rdma/ib_user_ioctl_cmds.h
index 69ded8e..ebf8b7c 100644
--- a/libc/kernel/uapi/rdma/ib_user_ioctl_cmds.h
+++ b/libc/kernel/uapi/rdma/ib_user_ioctl_cmds.h
@@ -44,6 +44,20 @@
   UVERBS_ATTR_UHW_IN = UVERBS_UDATA_DRIVER_DATA_FLAG,
   UVERBS_ATTR_UHW_OUT,
 };
+enum uverbs_methods_device {
+  UVERBS_METHOD_INVOKE_WRITE,
+  UVERBS_METHOD_INFO_HANDLES,
+  UVERBS_METHOD_QUERY_PORT,
+};
+enum uverbs_attrs_invoke_write_cmd_attr_ids {
+  UVERBS_ATTR_CORE_IN,
+  UVERBS_ATTR_CORE_OUT,
+  UVERBS_ATTR_WRITE_CMD,
+};
+enum uverbs_attrs_query_port_cmd_attr_ids {
+  UVERBS_ATTR_QUERY_PORT_PORT_NUM,
+  UVERBS_ATTR_QUERY_PORT_RESP,
+};
 enum uverbs_attrs_create_cq_cmd_attr_ids {
   UVERBS_ATTR_CREATE_CQ_HANDLE,
   UVERBS_ATTR_CREATE_CQ_CQE,
@@ -104,6 +118,17 @@
 };
 enum uverbs_methods_mr {
   UVERBS_METHOD_DM_MR_REG,
+  UVERBS_METHOD_MR_DESTROY,
+  UVERBS_METHOD_ADVISE_MR,
+};
+enum uverbs_attrs_mr_destroy_ids {
+  UVERBS_ATTR_DESTROY_MR_HANDLE,
+};
+enum uverbs_attrs_advise_mr_cmd_attr_ids {
+  UVERBS_ATTR_ADVISE_MR_PD_HANDLE,
+  UVERBS_ATTR_ADVISE_MR_ADVICE,
+  UVERBS_ATTR_ADVISE_MR_FLAGS,
+  UVERBS_ATTR_ADVISE_MR_SGE_LIST,
 };
 enum uverbs_attrs_create_counters_cmd_attr_ids {
   UVERBS_ATTR_CREATE_COUNTERS_HANDLE,
@@ -121,4 +146,45 @@
   UVERBS_METHOD_COUNTERS_DESTROY,
   UVERBS_METHOD_COUNTERS_READ,
 };
+enum uverbs_attrs_info_handles_id {
+  UVERBS_ATTR_INFO_OBJECT_ID,
+  UVERBS_ATTR_INFO_TOTAL_HANDLES,
+  UVERBS_ATTR_INFO_HANDLES_LIST,
+};
+enum uverbs_methods_pd {
+  UVERBS_METHOD_PD_DESTROY,
+};
+enum uverbs_attrs_pd_destroy_ids {
+  UVERBS_ATTR_DESTROY_PD_HANDLE,
+};
+enum uverbs_methods_mw {
+  UVERBS_METHOD_MW_DESTROY,
+};
+enum uverbs_attrs_mw_destroy_ids {
+  UVERBS_ATTR_DESTROY_MW_HANDLE,
+};
+enum uverbs_methods_xrcd {
+  UVERBS_METHOD_XRCD_DESTROY,
+};
+enum uverbs_attrs_xrcd_destroy_ids {
+  UVERBS_ATTR_DESTROY_XRCD_HANDLE,
+};
+enum uverbs_methods_ah {
+  UVERBS_METHOD_AH_DESTROY,
+};
+enum uverbs_attrs_ah_destroy_ids {
+  UVERBS_ATTR_DESTROY_AH_HANDLE,
+};
+enum uverbs_methods_rwq_ind_tbl {
+  UVERBS_METHOD_RWQ_IND_TBL_DESTROY,
+};
+enum uverbs_attrs_rwq_ind_tbl_destroy_ids {
+  UVERBS_ATTR_DESTROY_RWQ_IND_TBL_HANDLE,
+};
+enum uverbs_methods_flow {
+  UVERBS_METHOD_FLOW_DESTROY,
+};
+enum uverbs_attrs_flow_destroy_ids {
+  UVERBS_ATTR_DESTROY_FLOW_HANDLE,
+};
 #endif
diff --git a/libc/kernel/uapi/rdma/ib_user_ioctl_verbs.h b/libc/kernel/uapi/rdma/ib_user_ioctl_verbs.h
index 8bea1cb..47a548e 100644
--- a/libc/kernel/uapi/rdma/ib_user_ioctl_verbs.h
+++ b/libc/kernel/uapi/rdma/ib_user_ioctl_verbs.h
@@ -19,6 +19,7 @@
 #ifndef IB_USER_IOCTL_VERBS_H
 #define IB_USER_IOCTL_VERBS_H
 #include <linux/types.h>
+#include <rdma/ib_user_verbs.h>
 #ifndef RDMA_UAPI_PTR
 #define RDMA_UAPI_PTR(_type,_name) __aligned_u64 _name
 #endif
@@ -112,4 +113,16 @@
 enum ib_uverbs_read_counters_flags {
   IB_UVERBS_READ_COUNTERS_PREFER_CACHED = 1 << 0,
 };
+enum ib_uverbs_advise_mr_advice {
+  IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH,
+  IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_WRITE,
+};
+enum ib_uverbs_advise_mr_flag {
+  IB_UVERBS_ADVISE_MR_FLAG_FLUSH = 1 << 0,
+};
+struct ib_uverbs_query_port_resp_ex {
+  struct ib_uverbs_query_port_resp legacy_resp;
+  __u16 port_cap_flags2;
+  __u8 reserved[6];
+};
 #endif
diff --git a/libc/kernel/uapi/rdma/ib_user_verbs.h b/libc/kernel/uapi/rdma/ib_user_verbs.h
index 3baf4ed..3154b7a 100644
--- a/libc/kernel/uapi/rdma/ib_user_verbs.h
+++ b/libc/kernel/uapi/rdma/ib_user_verbs.h
@@ -21,7 +21,7 @@
 #include <linux/types.h>
 #define IB_USER_VERBS_ABI_VERSION 6
 #define IB_USER_VERBS_CMD_THRESHOLD 50
-enum {
+enum ib_uverbs_write_cmds {
   IB_USER_VERBS_CMD_GET_CONTEXT,
   IB_USER_VERBS_CMD_QUERY_DEVICE,
   IB_USER_VERBS_CMD_QUERY_PORT,
@@ -111,6 +111,7 @@
 struct ib_uverbs_get_context_resp {
   __u32 async_fd;
   __u32 num_comp_vectors;
+  __aligned_u64 driver_data[0];
 };
 struct ib_uverbs_query_device {
   __aligned_u64 response;
@@ -237,6 +238,7 @@
 };
 struct ib_uverbs_alloc_pd_resp {
   __u32 pd_handle;
+  __u32 driver_data[0];
 };
 struct ib_uverbs_dealloc_pd {
   __u32 pd_handle;
@@ -249,6 +251,7 @@
 };
 struct ib_uverbs_open_xrcd_resp {
   __u32 xrcd_handle;
+  __u32 driver_data[0];
 };
 struct ib_uverbs_close_xrcd {
   __u32 xrcd_handle;
@@ -266,6 +269,7 @@
   __u32 mr_handle;
   __u32 lkey;
   __u32 rkey;
+  __u32 driver_data[0];
 };
 struct ib_uverbs_rereg_mr {
   __aligned_u64 response;
@@ -276,10 +280,12 @@
   __aligned_u64 hca_va;
   __u32 pd_handle;
   __u32 access_flags;
+  __aligned_u64 driver_data[0];
 };
 struct ib_uverbs_rereg_mr_resp {
   __u32 lkey;
   __u32 rkey;
+  __aligned_u64 driver_data[0];
 };
 struct ib_uverbs_dereg_mr {
   __u32 mr_handle;
@@ -289,10 +295,12 @@
   __u32 pd_handle;
   __u8 mw_type;
   __u8 reserved[3];
+  __aligned_u64 driver_data[0];
 };
 struct ib_uverbs_alloc_mw_resp {
   __u32 mw_handle;
   __u32 rkey;
+  __aligned_u64 driver_data[0];
 };
 struct ib_uverbs_dealloc_mw {
   __u32 mw_handle;
@@ -328,6 +336,7 @@
 struct ib_uverbs_create_cq_resp {
   __u32 cq_handle;
   __u32 cqe;
+  __aligned_u64 driver_data[0];
 };
 struct ib_uverbs_ex_create_cq_resp {
   struct ib_uverbs_create_cq_resp base;
@@ -507,6 +516,7 @@
   __u32 max_recv_sge;
   __u32 max_inline_data;
   __u32 reserved;
+  __u32 driver_data[0];
 };
 struct ib_uverbs_ex_create_qp_resp {
   struct ib_uverbs_create_qp_resp base;
@@ -600,8 +610,6 @@
   __u32 rate_limit;
   __u32 reserved;
 };
-struct ib_uverbs_modify_qp_resp {
-};
 struct ib_uverbs_ex_modify_qp_resp {
   __u32 comp_mask;
   __u32 response_length;
@@ -619,6 +627,22 @@
   __u32 length;
   __u32 lkey;
 };
+enum ib_uverbs_wr_opcode {
+  IB_UVERBS_WR_RDMA_WRITE = 0,
+  IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
+  IB_UVERBS_WR_SEND = 2,
+  IB_UVERBS_WR_SEND_WITH_IMM = 3,
+  IB_UVERBS_WR_RDMA_READ = 4,
+  IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
+  IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
+  IB_UVERBS_WR_LOCAL_INV = 7,
+  IB_UVERBS_WR_BIND_MW = 8,
+  IB_UVERBS_WR_SEND_WITH_INV = 9,
+  IB_UVERBS_WR_TSO = 10,
+  IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
+  IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
+  IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
+};
 struct ib_uverbs_send_wr {
   __aligned_u64 wr_id;
   __u32 num_sge;
@@ -693,9 +717,11 @@
   __u32 pd_handle;
   __u32 reserved;
   struct ib_uverbs_ah_attr attr;
+  __aligned_u64 driver_data[0];
 };
 struct ib_uverbs_create_ah_resp {
   __u32 ah_handle;
+  __u32 driver_data[0];
 };
 struct ib_uverbs_destroy_ah {
   __u32 ah_handle;
@@ -954,6 +980,7 @@
   __u32 max_wr;
   __u32 max_sge;
   __u32 srqn;
+  __u32 driver_data[0];
 };
 struct ib_uverbs_modify_srq {
   __u32 srq_handle;
diff --git a/libc/kernel/uapi/rdma/mlx5-abi.h b/libc/kernel/uapi/rdma/mlx5-abi.h
index 50ecd2f..4c85c6c 100644
--- a/libc/kernel/uapi/rdma/mlx5-abi.h
+++ b/libc/kernel/uapi/rdma/mlx5-abi.h
@@ -28,6 +28,10 @@
   MLX5_QP_FLAG_BFREG_INDEX = 1 << 3,
   MLX5_QP_FLAG_TYPE_DCT = 1 << 4,
   MLX5_QP_FLAG_TYPE_DCI = 1 << 5,
+  MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_UC = 1 << 6,
+  MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC = 1 << 7,
+  MLX5_QP_FLAG_ALLOW_SCATTER_CQE = 1 << 8,
+  MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE = 1 << 9,
 };
 enum {
   MLX5_SRQ_FLAG_SIGNATURE = 1 << 0,
@@ -159,6 +163,7 @@
 enum mlx5_ib_query_dev_resp_flags {
   MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP = 1 << 0,
   MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_PAD = 1 << 1,
+  MLX5_IB_QUERY_DEV_RESP_PACKET_BASED_CREDIT_MODE = 1 << 2,
 };
 enum mlx5_ib_tunnel_offloads {
   MLX5_IB_TUNNELED_OFFLOADS_VXLAN = 1 << 0,
@@ -252,9 +257,21 @@
   __u32 comp_mask;
   __u32 flags;
 };
+enum mlx5_ib_create_qp_resp_mask {
+  MLX5_IB_CREATE_QP_RESP_MASK_TIRN = 1UL << 0,
+  MLX5_IB_CREATE_QP_RESP_MASK_TISN = 1UL << 1,
+  MLX5_IB_CREATE_QP_RESP_MASK_RQN = 1UL << 2,
+  MLX5_IB_CREATE_QP_RESP_MASK_SQN = 1UL << 3,
+};
 struct mlx5_ib_create_qp_resp {
   __u32 bfreg_index;
   __u32 reserved;
+  __u32 comp_mask;
+  __u32 tirn;
+  __u32 tisn;
+  __u32 rqn;
+  __u32 sqn;
+  __u32 reserved1;
 };
 struct mlx5_ib_alloc_mw {
   __u32 comp_mask;
diff --git a/libc/kernel/uapi/rdma/mlx5_user_ioctl_cmds.h b/libc/kernel/uapi/rdma/mlx5_user_ioctl_cmds.h
index 11ff576..dcc3d85 100644
--- a/libc/kernel/uapi/rdma/mlx5_user_ioctl_cmds.h
+++ b/libc/kernel/uapi/rdma/mlx5_user_ioctl_cmds.h
@@ -93,6 +93,7 @@
   MLX5_IB_ATTR_FLOW_MATCHER_MATCH_MASK,
   MLX5_IB_ATTR_FLOW_MATCHER_FLOW_TYPE,
   MLX5_IB_ATTR_FLOW_MATCHER_MATCH_CRITERIA,
+  MLX5_IB_ATTR_FLOW_MATCHER_FLOW_FLAGS,
 };
 enum mlx5_ib_flow_matcher_destroy_attrs {
   MLX5_IB_ATTR_FLOW_MATCHER_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
@@ -117,6 +118,9 @@
   MLX5_IB_ATTR_CREATE_FLOW_DEST_QP,
   MLX5_IB_ATTR_CREATE_FLOW_DEST_DEVX,
   MLX5_IB_ATTR_CREATE_FLOW_MATCHER,
+  MLX5_IB_ATTR_CREATE_FLOW_ARR_FLOW_ACTIONS,
+  MLX5_IB_ATTR_CREATE_FLOW_TAG,
+  MLX5_IB_ATTR_CREATE_FLOW_ARR_COUNTERS_DEVX,
 };
 enum mlx5_ib_destoy_flow_attrs {
   MLX5_IB_ATTR_DESTROY_FLOW_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
@@ -125,4 +129,19 @@
   MLX5_IB_METHOD_CREATE_FLOW = (1U << UVERBS_ID_NS_SHIFT),
   MLX5_IB_METHOD_DESTROY_FLOW,
 };
+enum mlx5_ib_flow_action_methods {
+  MLX5_IB_METHOD_FLOW_ACTION_CREATE_MODIFY_HEADER = (1U << UVERBS_ID_NS_SHIFT),
+  MLX5_IB_METHOD_FLOW_ACTION_CREATE_PACKET_REFORMAT,
+};
+enum mlx5_ib_create_flow_action_create_modify_header_attrs {
+  MLX5_IB_ATTR_CREATE_MODIFY_HEADER_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
+  MLX5_IB_ATTR_CREATE_MODIFY_HEADER_ACTIONS_PRM,
+  MLX5_IB_ATTR_CREATE_MODIFY_HEADER_FT_TYPE,
+};
+enum mlx5_ib_create_flow_action_create_packet_reformat_attrs {
+  MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
+  MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_TYPE,
+  MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_FT_TYPE,
+  MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_DATA_BUF,
+};
 #endif
diff --git a/libc/kernel/uapi/rdma/mlx5_user_ioctl_verbs.h b/libc/kernel/uapi/rdma/mlx5_user_ioctl_verbs.h
index c9a83cf..dc246e5 100644
--- a/libc/kernel/uapi/rdma/mlx5_user_ioctl_verbs.h
+++ b/libc/kernel/uapi/rdma/mlx5_user_ioctl_verbs.h
@@ -22,4 +22,14 @@
 enum mlx5_ib_uapi_flow_action_flags {
   MLX5_IB_UAPI_FLOW_ACTION_FLAGS_REQUIRE_METADATA = 1 << 0,
 };
+enum mlx5_ib_uapi_flow_table_type {
+  MLX5_IB_UAPI_FLOW_TABLE_TYPE_NIC_RX = 0x0,
+  MLX5_IB_UAPI_FLOW_TABLE_TYPE_NIC_TX = 0x1,
+};
+enum mlx5_ib_uapi_flow_action_packet_reformat_type {
+  MLX5_IB_UAPI_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2 = 0x0,
+  MLX5_IB_UAPI_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL = 0x1,
+  MLX5_IB_UAPI_FLOW_ACTION_PACKET_REFORMAT_TYPE_L3_TUNNEL_TO_L2 = 0x2,
+  MLX5_IB_UAPI_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL = 0x3,
+};
 #endif
diff --git a/libc/kernel/uapi/rdma/rdma_netlink.h b/libc/kernel/uapi/rdma/rdma_netlink.h
index 48cbc3d..69805f1 100644
--- a/libc/kernel/uapi/rdma/rdma_netlink.h
+++ b/libc/kernel/uapi/rdma/rdma_netlink.h
@@ -173,6 +173,7 @@
 enum rdma_nldev_command {
   RDMA_NLDEV_CMD_UNSPEC,
   RDMA_NLDEV_CMD_GET,
+  RDMA_NLDEV_CMD_SET,
   RDMA_NLDEV_CMD_PORT_GET = 5,
   RDMA_NLDEV_CMD_RES_GET = 9,
   RDMA_NLDEV_CMD_RES_QP_GET,
diff --git a/libc/kernel/uapi/rdma/vmw_pvrdma-abi.h b/libc/kernel/uapi/rdma/vmw_pvrdma-abi.h
index 7b43e35..fc86778 100644
--- a/libc/kernel/uapi/rdma/vmw_pvrdma-abi.h
+++ b/libc/kernel/uapi/rdma/vmw_pvrdma-abi.h
@@ -47,6 +47,7 @@
   PVRDMA_WR_MASKED_ATOMIC_FETCH_AND_ADD,
   PVRDMA_WR_BIND_MW,
   PVRDMA_WR_REG_SIG_MR,
+  PVRDMA_WR_ERROR,
 };
 enum pvrdma_wc_status {
   PVRDMA_WC_SUCCESS,
diff --git a/libc/kernel/uapi/scsi/scsi_bsg_ufs.h b/libc/kernel/uapi/scsi/scsi_bsg_ufs.h
new file mode 100644
index 0000000..177cae9
--- /dev/null
+++ b/libc/kernel/uapi/scsi/scsi_bsg_ufs.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ***   To edit the content of this header, modify the corresponding
+ ***   source file (e.g. under external/kernel-headers/original/) then
+ ***   run bionic/libc/kernel/tools/update_all.py
+ ***
+ ***   Any manual change here will be lost the next time this script will
+ ***   be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef SCSI_BSG_UFS_H
+#define SCSI_BSG_UFS_H
+#include <linux/types.h>
+#define UFS_CDB_SIZE 16
+#define UPIU_TRANSACTION_UIC_CMD 0x1F
+#define UIC_CMD_SIZE (sizeof(__u32) * 4)
+struct utp_upiu_header {
+  __be32 dword_0;
+  __be32 dword_1;
+  __be32 dword_2;
+};
+struct utp_upiu_query {
+  __u8 opcode;
+  __u8 idn;
+  __u8 index;
+  __u8 selector;
+  __be16 reserved_osf;
+  __be16 length;
+  __be32 value;
+  __be32 reserved[2];
+};
+struct utp_upiu_cmd {
+  __be32 exp_data_transfer_len;
+  __u8 cdb[UFS_CDB_SIZE];
+};
+struct utp_upiu_req {
+  struct utp_upiu_header header;
+  union {
+    struct utp_upiu_cmd sc;
+    struct utp_upiu_query qr;
+    struct utp_upiu_query tr;
+    struct utp_upiu_query uc;
+  };
+};
+struct ufs_bsg_request {
+  __u32 msgcode;
+  struct utp_upiu_req upiu_req;
+};
+struct ufs_bsg_reply {
+  __u32 result;
+  __u32 reply_payload_rcv_len;
+  struct utp_upiu_req upiu_rsp;
+};
+#endif
diff --git a/libc/kernel/uapi/sound/firewire.h b/libc/kernel/uapi/sound/firewire.h
index 91289c0..67c010b 100644
--- a/libc/kernel/uapi/sound/firewire.h
+++ b/libc/kernel/uapi/sound/firewire.h
@@ -25,6 +25,7 @@
 #define SNDRV_FIREWIRE_EVENT_EFW_RESPONSE 0x4e617475
 #define SNDRV_FIREWIRE_EVENT_DIGI00X_MESSAGE 0x746e736c
 #define SNDRV_FIREWIRE_EVENT_MOTU_NOTIFICATION 0x64776479
+#define SNDRV_FIREWIRE_EVENT_TASCAM_CONTROL 0x7473636d
 struct snd_firewire_event_common {
   unsigned int type;
 };
@@ -58,17 +59,28 @@
   unsigned int type;
   __u32 message;
 };
+struct snd_firewire_tascam_change {
+  unsigned int index;
+  __be32 before;
+  __be32 after;
+};
+struct snd_firewire_event_tascam_control {
+  unsigned int type;
+  struct snd_firewire_tascam_change changes[0];
+};
 union snd_firewire_event {
   struct snd_firewire_event_common common;
   struct snd_firewire_event_lock_status lock_status;
   struct snd_firewire_event_dice_notification dice_notification;
   struct snd_firewire_event_efw_response efw_response;
   struct snd_firewire_event_digi00x_message digi00x_message;
+  struct snd_firewire_event_tascam_control tascam_control;
   struct snd_firewire_event_motu_notification motu_notification;
 };
 #define SNDRV_FIREWIRE_IOCTL_GET_INFO _IOR('H', 0xf8, struct snd_firewire_get_info)
 #define SNDRV_FIREWIRE_IOCTL_LOCK _IO('H', 0xf9)
 #define SNDRV_FIREWIRE_IOCTL_UNLOCK _IO('H', 0xfa)
+#define SNDRV_FIREWIRE_IOCTL_TASCAM_STATE _IOR('H', 0xfb, struct snd_firewire_tascam_state)
 #define SNDRV_FIREWIRE_TYPE_DICE 1
 #define SNDRV_FIREWIRE_TYPE_FIREWORKS 2
 #define SNDRV_FIREWIRE_TYPE_BEBOB 3
@@ -83,4 +95,8 @@
   unsigned char guid[8];
   char device_name[16];
 };
+#define SNDRV_FIREWIRE_TASCAM_STATE_COUNT 64
+struct snd_firewire_tascam_state {
+  __be32 data[SNDRV_FIREWIRE_TASCAM_STATE_COUNT];
+};
 #endif
diff --git a/libc/libc.arm.map b/libc/libc.arm.map
deleted file mode 100644
index bd39d42..0000000
--- a/libc/libc.arm.map
+++ /dev/null
@@ -1,1679 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __assert;
-    __assert2;
-    __atomic_cmpxchg; # arm
-    __atomic_dec; # arm
-    __atomic_inc; # arm
-    __atomic_swap; # arm
-    __b64_ntop;
-    __b64_pton;
-    __cmsg_nxthdr; # introduced=21
-    __connect; # arm x86 mips introduced=21
-    __ctype_get_mb_cur_max; # introduced=21
-    __cxa_atexit;
-    __cxa_finalize;
-    __cxa_thread_atexit_impl; # introduced=23
-    __dn_comp;
-    __dn_count_labels;
-    __dn_skipname;
-    __epoll_pwait; # arm x86 mips introduced=21
-    __errno;
-    __exit; # arm x86 mips introduced=21
-    __fbufsize; # introduced=23
-    __fcntl64; # arm x86 mips
-    __FD_CLR_chk; # introduced=21
-    __FD_ISSET_chk; # introduced=21
-    __FD_SET_chk; # introduced=21
-    __fgets_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __flbf; # introduced=23
-    __fp_nquery;
-    __fp_query;
-    __fpclassify; # introduced=21
-    __fpclassifyd;
-    __fpclassifyf;
-    __fpclassifyl;
-    __fpending; # introduced=23
-    __fpurge; # introduced=23
-    __freadable; # introduced=23
-    __fsetlocking; # introduced=23
-    __fstatfs64; # arm x86 mips
-    __fwritable; # introduced=23
-    __get_h_errno;
-    __getcpu; # arm x86 mips introduced-arm=12 introduced-mips=16 introduced-x86=12
-    __getcwd; # arm x86 mips
-    __getpid; # arm x86 mips introduced=21
-    __getpriority; # arm x86 mips
-    __gnu_basename; # introduced=23
-    __gnu_strerror_r; # introduced=23
-    __hostalias;
-    __ioctl; # arm x86 mips
-    __isfinite;
-    __isfinitef;
-    __isfinitel;
-    __isinf;
-    __isinff;
-    __isinfl;
-    __isnan; # introduced=21
-    __isnanf; # introduced=21
-    __isnanl;
-    __isnormal;
-    __isnormalf;
-    __isnormall;
-    __isthreaded; # arm x86 mips var
-    __libc_current_sigrtmax; # introduced=21
-    __libc_current_sigrtmin; # introduced=21
-    __libc_init;
-    __llseek; # arm x86 mips
-    __loc_aton;
-    __loc_ntoa;
-    __memchr_chk; # introduced=23
-    __memcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memmove_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memrchr_chk; # introduced=23
-    __memset_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __mmap2; # arm x86 mips
-    __ns_format_ttl; # arm x86 mips
-    __ns_get16; # arm x86 mips
-    __ns_get32; # arm x86 mips
-    __ns_initparse; # arm x86 mips
-    __ns_makecanon; # arm x86 mips
-    __ns_msg_getflag; # arm x86 mips
-    __ns_name_compress; # arm x86 mips
-    __ns_name_ntol; # arm x86 mips
-    __ns_name_ntop; # arm x86 mips
-    __ns_name_pack; # arm x86 mips
-    __ns_name_pton; # arm x86 mips
-    __ns_name_rollback; # arm x86 mips
-    __ns_name_skip; # arm x86 mips
-    __ns_name_uncompress; # arm x86 mips
-    __ns_name_unpack; # arm x86 mips
-    __ns_parserr; # arm x86 mips
-    __ns_put16; # arm x86 mips
-    __ns_put32; # arm x86 mips
-    __ns_samename; # arm x86 mips
-    __ns_skiprr; # arm x86 mips
-    __ns_sprintrr; # arm x86 mips
-    __ns_sprintrrf; # arm x86 mips
-    __open_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __openat; # arm x86 mips
-    __openat_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __p_cdname;
-    __p_cdnname;
-    __p_class;
-    __p_class_syms; # var
-    __p_fqname;
-    __p_fqnname;
-    __p_option;
-    __p_query;
-    __p_rcode;
-    __p_secstodate;
-    __p_time;
-    __p_type;
-    __p_type_syms; # var
-    __poll_chk; # introduced=23
-    __ppoll; # arm x86 mips introduced=21
-    __ppoll_chk; # introduced=23
-    __ppoll64_chk; # introduced=28
-    __pread64_chk; # introduced=23
-    __pread_chk; # introduced=23
-    __progname; # var
-    __pselect6; # arm x86 mips introduced=21
-    __pthread_cleanup_pop;
-    __pthread_cleanup_push;
-    __ptrace; # arm x86 mips
-    __putlong;
-    __putshort;
-    __read_chk; # introduced=21
-    __readlink_chk; # introduced=23
-    __readlinkat_chk; # introduced=23
-    __reboot; # arm x86 mips
-    __recvfrom_chk; # introduced=21
-    __register_atfork; # introduced=23
-    __res_close;
-    __res_dnok;
-    __res_hnok;
-    __res_hostalias;
-    __res_isourserver;
-    __res_mailok;
-    __res_nameinquery;
-    __res_nclose;
-    __res_ninit;
-    __res_nmkquery;
-    __res_nquery;
-    __res_nquerydomain;
-    __res_nsearch;
-    __res_nsend;
-    __res_ownok;
-    __res_queriesmatch;
-    __res_querydomain;
-    __res_send;
-    __res_send_setqhook;
-    __res_send_setrhook;
-    __rt_sigaction; # arm x86 mips
-    __rt_sigpending; # arm x86 mips introduced=21
-    __rt_sigprocmask; # arm x86 mips
-    __rt_sigsuspend; # arm x86 mips introduced=21
-    __rt_sigtimedwait; # arm x86 mips
-    __sched_cpualloc; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpucount; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpufree; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_getaffinity; # arm x86 mips introduced=12
-    __set_tid_address; # arm x86 mips introduced=21
-    __set_tls; # arm mips
-    __sF; # var
-    __sigaction; # arm x86 mips introduced=21
-    __snprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __socket; # arm x86 mips introduced=21
-    __sprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __stack_chk_fail;
-    __stack_chk_guard; # var
-    __statfs64; # arm x86 mips
-    __stpcpy_chk; # introduced=21
-    __stpncpy_chk; # introduced=21
-    __stpncpy_chk2; # introduced=21
-    __strcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __strcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlen_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk2; # introduced=21
-    __strrchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __sym_ntop;
-    __sym_ntos;
-    __sym_ston;
-    __system_property_area_serial; # introduced=23
-    __system_property_find;
-    __system_property_find_nth;
-    __system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_get;
-    __system_property_read;
-    __system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __timer_create; # arm x86 mips
-    __timer_delete; # arm x86 mips
-    __timer_getoverrun; # arm x86 mips
-    __timer_gettime; # arm x86 mips
-    __timer_settime; # arm x86 mips
-    __umask_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __vsnprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __vsprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __waitid; # arm x86 mips
-    _ctype_; # var
-    _Exit; # introduced=21
-    _exit;
-    _flushlbf; # introduced=23
-    _getlong;
-    _getshort;
-    _longjmp;
-    _resolv_delete_cache_for_net; # introduced=21
-    _resolv_flush_cache_for_net; # introduced=21
-    _resolv_set_nameservers_for_net; # introduced=21
-    _setjmp;
-    _tolower; # introduced=21
-    _tolower_tab_; # arm x86 mips var
-    _toupper; # introduced=21
-    _toupper_tab_; # arm x86 mips var
-    abort;
-    abs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    accept;
-    accept4; # introduced=21
-    access;
-    acct;
-    alarm;
-    alphasort;
-    alphasort64; # introduced=21
-    android_set_abort_message; # introduced=21
-    arc4random;
-    arc4random_buf;
-    arc4random_uniform;
-    asctime;
-    asctime64; # arm x86 mips
-    asctime64_r; # arm x86 mips
-    asctime_r;
-    asprintf;
-    at_quick_exit; # introduced=21
-    atof; # introduced=21
-    atoi;
-    atol;
-    atoll;
-    basename;
-    basename_r; # arm x86 mips
-    bind;
-    bindresvport;
-    brk;
-    bsearch;
-    btowc;
-    c16rtomb; # introduced=21
-    c32rtomb; # introduced=21
-    cacheflush; # arm mips
-    calloc;
-    capget;
-    capset;
-    cfgetispeed; # introduced=21
-    cfgetospeed; # introduced=21
-    cfmakeraw; # introduced=21
-    cfsetispeed; # introduced=21
-    cfsetospeed; # introduced=21
-    cfsetspeed; # introduced=21
-    chdir;
-    chmod;
-    chown;
-    chroot;
-    clearenv;
-    clearerr;
-    clearerr_unlocked; # introduced=23
-    clock;
-    clock_getcpuclockid; # introduced=23
-    clock_getres;
-    clock_gettime;
-    clock_nanosleep;
-    clock_settime;
-    clone; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    close;
-    closedir;
-    closelog;
-    connect;
-    creat;
-    creat64; # introduced=21
-    ctime;
-    ctime64; # arm x86 mips
-    ctime64_r; # arm x86 mips
-    ctime_r;
-    daemon;
-    daylight; # var
-    delete_module;
-    difftime;
-    dirfd;
-    dirname;
-    dirname_r; # arm x86 mips
-    div;
-    dn_expand;
-    dprintf; # introduced=21
-    drand48;
-    dup;
-    dup2;
-    dup3; # introduced=21
-    duplocale; # introduced=21
-    endmntent; # introduced=21
-    endservent;
-    endutent;
-    environ; # var
-    epoll_create;
-    epoll_create1; # introduced=21
-    epoll_ctl;
-    epoll_pwait; # introduced=21
-    epoll_wait;
-    erand48;
-    err;
-    error; # introduced=23
-    error_at_line; # introduced=23
-    error_message_count; # var introduced=23
-    error_one_per_line; # var introduced=23
-    error_print_progname; # var introduced=23
-    errx;
-    ether_aton; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_aton_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    eventfd;
-    eventfd_read;
-    eventfd_write;
-    execl;
-    execle;
-    execlp;
-    execv;
-    execve;
-    execvp;
-    execvpe; # introduced=21
-    exit;
-    faccessat; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fallocate; # introduced=21
-    fallocate64; # introduced=21
-    fchdir;
-    fchmod;
-    fchmodat;
-    fchown;
-    fchownat;
-    fclose;
-    fcntl;
-    fdatasync;
-    fdopen;
-    fdopendir;
-    fdprintf; # arm x86 mips versioned=28
-    feof;
-    feof_unlocked; # introduced=23
-    ferror;
-    ferror_unlocked; # introduced=23
-    fflush;
-    ffs; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    fgetc;
-    fgetln;
-    fgetpos;
-    fgets;
-    fgetwc;
-    fgetws;
-    fgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fileno;
-    flistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    flock;
-    flockfile;
-    fmemopen; # introduced=23
-    fnmatch;
-    fopen;
-    fork;
-    forkpty; # introduced=23
-    fpathconf;
-    fprintf;
-    fpurge;
-    fputc;
-    fputs;
-    fputwc;
-    fputws;
-    fread;
-    free;
-    freeaddrinfo;
-    freelocale; # introduced=21
-    fremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    freopen;
-    fscanf;
-    fseek;
-    fseeko;
-    fsetpos;
-    fsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fstat;
-    fstat64; # introduced=21
-    fstatat;
-    fstatat64; # introduced=21
-    fstatfs;
-    fstatfs64; # introduced=21
-    fstatvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fstatvfs64; # introduced=21
-    fsync;
-    ftell;
-    ftello;
-    ftok;
-    ftruncate;
-    ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ftrylockfile;
-    fts_children; # introduced=21
-    fts_close; # introduced=21
-    fts_open; # introduced=21
-    fts_read; # introduced=21
-    fts_set; # introduced=21
-    ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    ftw64; # introduced=21
-    funlockfile;
-    funopen;
-    futimens; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fwide;
-    fwprintf;
-    fwrite;
-    fwscanf;
-    gai_strerror;
-    get_avphys_pages; # introduced=23
-    get_nprocs; # introduced=23
-    get_nprocs_conf; # introduced=23
-    get_phys_pages; # introduced=23
-    getaddrinfo;
-    getauxval; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getc;
-    getc_unlocked;
-    getchar;
-    getchar_unlocked;
-    getcwd;
-    getdelim; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getegid;
-    getenv;
-    geteuid;
-    getgid;
-    getgrgid;
-    getgrnam;
-    getgrouplist;
-    getgroups;
-    gethostbyaddr;
-    gethostbyaddr_r; # introduced=23
-    gethostbyname;
-    gethostbyname2;
-    gethostbyname2_r; # introduced=23
-    gethostbyname_r;
-    gethostent;
-    gethostname;
-    getitimer;
-    getline; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getlogin;
-    getmntent;
-    getmntent_r; # introduced=21
-    getnameinfo;
-    getnetbyaddr;
-    getnetbyname;
-    getopt;
-    getopt_long;
-    getopt_long_only;
-    getpagesize; # introduced=21
-    getpeername;
-    getpgid;
-    getpgrp;
-    getpid;
-    getppid;
-    getpriority;
-    getprogname; # introduced=21
-    getprotobyname;
-    getprotobynumber;
-    getpt;
-    getpwnam;
-    getpwnam_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getpwuid;
-    getpwuid_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getresgid;
-    getresuid;
-    getrlimit;
-    getrlimit64; # introduced=21
-    getrusage;
-    gets;
-    getservbyname;
-    getservbyport;
-    getservent;
-    getsid; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    getsockname;
-    getsockopt;
-    gettid;
-    gettimeofday;
-    getuid;
-    getutent;
-    getwc;
-    getwchar;
-    getxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    gmtime;
-    gmtime64; # arm x86 mips
-    gmtime64_r; # arm x86 mips
-    gmtime_r;
-    grantpt; # introduced=21
-    herror;
-    hstrerror;
-    htonl; # introduced=21
-    htons; # introduced=21
-    if_indextoname;
-    if_nametoindex;
-    imaxabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    imaxdiv; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    inet_addr;
-    inet_aton;
-    inet_lnaof; # introduced=21
-    inet_makeaddr; # introduced=21
-    inet_netof; # introduced=21
-    inet_network; # introduced=21
-    inet_nsap_addr;
-    inet_nsap_ntoa;
-    inet_ntoa;
-    inet_ntop;
-    inet_pton;
-    init_module;
-    initgroups;
-    initstate; # introduced=21
-    inotify_add_watch;
-    inotify_init;
-    inotify_init1; # introduced=21
-    inotify_rm_watch;
-    insque; # introduced=21
-    ioctl;
-    isalnum;
-    isalnum_l; # introduced=21
-    isalpha;
-    isalpha_l; # introduced=21
-    isascii;
-    isatty;
-    isblank;
-    isblank_l; # introduced=21
-    iscntrl;
-    iscntrl_l; # introduced=21
-    isdigit;
-    isdigit_l; # introduced=21
-    isfinite; # introduced=21
-    isfinitef; # introduced=21
-    isfinitel; # introduced=21
-    isgraph;
-    isgraph_l; # introduced=21
-    isinf; # introduced=21
-    isinff; # introduced=21
-    isinfl; # introduced=21
-    islower;
-    islower_l; # introduced=21
-    isnan;
-    isnanf;
-    isnanl; # introduced=21
-    isnormal; # introduced=21
-    isnormalf; # introduced=21
-    isnormall; # introduced=21
-    isprint;
-    isprint_l; # introduced=21
-    ispunct;
-    ispunct_l; # introduced=21
-    isspace;
-    isspace_l; # introduced=21
-    isupper;
-    isupper_l; # introduced=21
-    iswalnum;
-    iswalnum_l; # introduced=21
-    iswalpha;
-    iswalpha_l; # introduced=21
-    iswblank; # introduced=21
-    iswblank_l; # introduced=21
-    iswcntrl;
-    iswcntrl_l; # introduced=21
-    iswctype;
-    iswctype_l; # introduced=21
-    iswdigit;
-    iswdigit_l; # introduced=21
-    iswgraph;
-    iswgraph_l; # introduced=21
-    iswlower;
-    iswlower_l; # introduced=21
-    iswprint;
-    iswprint_l; # introduced=21
-    iswpunct;
-    iswpunct_l; # introduced=21
-    iswspace;
-    iswspace_l; # introduced=21
-    iswupper;
-    iswupper_l; # introduced=21
-    iswxdigit;
-    iswxdigit_l; # introduced=21
-    isxdigit;
-    isxdigit_l; # introduced=21
-    jrand48;
-    kill;
-    killpg;
-    klogctl;
-    labs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lchown;
-    lcong48; # introduced=23
-    ldexp;
-    ldiv;
-    lfind; # introduced=21
-    lgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    link;
-    linkat; # introduced=21
-    listen;
-    listxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    llabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lldiv;
-    llistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    localeconv; # introduced=21
-    localtime;
-    localtime64; # arm x86 mips
-    localtime64_r; # arm x86 mips
-    localtime_r;
-    login_tty; # introduced=23
-    longjmp;
-    lrand48;
-    lremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lsearch; # introduced=21
-    lseek;
-    lseek64;
-    lsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lstat;
-    lstat64; # introduced=21
-    madvise;
-    mallinfo;
-    malloc;
-    malloc_info; # introduced=23
-    malloc_usable_size; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mbrlen;
-    mbrtoc16; # introduced=21
-    mbrtoc32; # introduced=21
-    mbrtowc;
-    mbsinit;
-    mbsnrtowcs; # introduced=21
-    mbsrtowcs;
-    mbstowcs;
-    mbtowc; # introduced=21
-    memalign;
-    memccpy;
-    memchr;
-    memcmp;
-    memcpy;
-    memmem;
-    memmove;
-    mempcpy; # introduced=23
-    memrchr;
-    memset;
-    mincore;
-    mkdir;
-    mkdirat;
-    mkdtemp;
-    mkfifo; # introduced=21
-    mkfifoat; # introduced=23
-    mknod;
-    mknodat; # introduced=21
-    mkostemp; # introduced=23
-    mkostemp64; # introduced=23
-    mkostemps; # introduced=23
-    mkostemps64; # introduced=23
-    mkstemp;
-    mkstemp64; # introduced=21
-    mkstemps;
-    mkstemps64; # introduced=23
-    mktemp;
-    mktime;
-    mktime64; # arm x86 mips
-    mlock;
-    mlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mmap;
-    mmap64; # introduced=21
-    mount;
-    mprotect;
-    mrand48;
-    mremap;
-    msync;
-    munlock;
-    munlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    munmap;
-    nanosleep;
-    newlocale; # introduced=21
-    nftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    nftw64; # introduced=21
-    nice;
-    nrand48;
-    nsdispatch;
-    ntohl; # introduced=21
-    ntohs; # introduced=21
-    open;
-    open64; # introduced=21
-    open_memstream; # introduced=23
-    open_wmemstream; # introduced=23
-    openat;
-    openat64; # introduced=21
-    opendir;
-    openlog;
-    openpty; # introduced=23
-    optarg; # var
-    opterr; # var
-    optind; # var
-    optopt; # var
-    optreset; # var
-    pathconf;
-    pause;
-    pclose;
-    perror;
-    personality; # introduced-arm=15 introduced-arm64=21 introduced-mips=15 introduced-mips64=21 introduced-x86=15 introduced-x86_64=21
-    pipe;
-    pipe2;
-    poll;
-    popen;
-    posix_fadvise; # introduced=21
-    posix_fadvise64; # introduced=21
-    posix_fallocate; # introduced=21
-    posix_fallocate64; # introduced=21
-    posix_madvise; # introduced=23
-    posix_memalign; # introduced=17
-    posix_openpt; # introduced=21
-    ppoll; # introduced=21
-    prctl;
-    pread;
-    pread64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    printf;
-    prlimit64; # introduced=21
-    process_vm_readv; # introduced=23
-    process_vm_writev; # introduced=23
-    pselect;
-    psiginfo; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    psignal; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    pthread_atfork; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    pthread_attr_destroy;
-    pthread_attr_getdetachstate;
-    pthread_attr_getguardsize;
-    pthread_attr_getschedparam;
-    pthread_attr_getschedpolicy;
-    pthread_attr_getscope;
-    pthread_attr_getstack;
-    pthread_attr_getstacksize;
-    pthread_attr_init;
-    pthread_attr_setdetachstate;
-    pthread_attr_setguardsize;
-    pthread_attr_setschedparam;
-    pthread_attr_setschedpolicy;
-    pthread_attr_setscope;
-    pthread_attr_setstack;
-    pthread_attr_setstacksize;
-    pthread_cond_broadcast;
-    pthread_cond_destroy;
-    pthread_cond_init;
-    pthread_cond_signal;
-    pthread_cond_timedwait;
-    pthread_cond_timedwait_monotonic; # arm x86 mips
-    pthread_cond_timedwait_monotonic_np; # introduced-arm=9 introduced-x86=9 introduced-mips=9 introduced-arm64=28 introduced-x64_64=28 introduced-mips64=28
-    pthread_cond_timedwait_relative_np; # arm x86 mips
-    pthread_cond_timeout_np; # arm x86 mips
-    pthread_cond_wait;
-    pthread_condattr_destroy;
-    pthread_condattr_getclock; # introduced=21
-    pthread_condattr_getpshared;
-    pthread_condattr_init;
-    pthread_condattr_setclock; # introduced=21
-    pthread_condattr_setpshared;
-    pthread_create;
-    pthread_detach;
-    pthread_equal;
-    pthread_exit;
-    pthread_getattr_np;
-    pthread_getcpuclockid;
-    pthread_getschedparam;
-    pthread_getspecific;
-    pthread_gettid_np; # introduced=21
-    pthread_join;
-    pthread_key_create;
-    pthread_key_delete;
-    pthread_kill;
-    pthread_mutex_destroy;
-    pthread_mutex_init;
-    pthread_mutex_lock;
-    pthread_mutex_lock_timeout_np; # arm x86 mips
-    pthread_mutex_timedlock; # introduced=21
-    pthread_mutex_trylock;
-    pthread_mutex_unlock;
-    pthread_mutexattr_destroy;
-    pthread_mutexattr_getpshared;
-    pthread_mutexattr_gettype;
-    pthread_mutexattr_init;
-    pthread_mutexattr_setpshared;
-    pthread_mutexattr_settype;
-    pthread_once;
-    pthread_rwlock_destroy;
-    pthread_rwlock_init;
-    pthread_rwlock_rdlock;
-    pthread_rwlock_timedrdlock;
-    pthread_rwlock_timedwrlock;
-    pthread_rwlock_tryrdlock;
-    pthread_rwlock_trywrlock;
-    pthread_rwlock_unlock;
-    pthread_rwlock_wrlock;
-    pthread_rwlockattr_destroy;
-    pthread_rwlockattr_getkind_np; # introduced=23
-    pthread_rwlockattr_getpshared;
-    pthread_rwlockattr_init;
-    pthread_rwlockattr_setkind_np; # introduced=23
-    pthread_rwlockattr_setpshared;
-    pthread_self;
-    pthread_setname_np;
-    pthread_setschedparam;
-    pthread_setspecific;
-    pthread_sigmask;
-    ptrace;
-    ptsname;
-    ptsname_r;
-    putc;
-    putc_unlocked;
-    putchar;
-    putchar_unlocked;
-    putenv;
-    puts;
-    pututline;
-    putw; # arm x86 mips
-    putwc;
-    putwchar;
-    pvalloc; # arm x86 mips introduced=17
-    pwrite;
-    pwrite64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    qsort;
-    quick_exit; # introduced=21
-    raise;
-    rand; # introduced=21
-    rand_r; # introduced=21
-    random; # introduced=21
-    read;
-    readahead; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    readdir;
-    readdir64; # introduced=21
-    readdir64_r; # introduced=21
-    readdir_r;
-    readlink;
-    readlinkat; # introduced=21
-    readv;
-    realloc;
-    realpath;
-    reboot;
-    recv;
-    recvfrom;
-    recvmmsg; # introduced=21
-    recvmsg;
-    regcomp;
-    regerror;
-    regexec;
-    regfree;
-    remove;
-    removexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    remque; # introduced=21
-    rename;
-    renameat;
-    res_init;
-    res_mkquery;
-    res_query;
-    res_search;
-    rewind;
-    rewinddir;
-    rmdir;
-    sbrk;
-    scandir;
-    scandir64; # introduced=21
-    scanf;
-    sched_get_priority_max;
-    sched_get_priority_min;
-    sched_getaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getcpu; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getparam;
-    sched_getscheduler;
-    sched_rr_get_interval;
-    sched_setaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_setparam;
-    sched_setscheduler;
-    sched_yield;
-    seed48;
-    seekdir; # introduced=23
-    select;
-    sem_close;
-    sem_destroy;
-    sem_getvalue;
-    sem_init;
-    sem_open;
-    sem_post;
-    sem_timedwait;
-    sem_trywait;
-    sem_unlink;
-    sem_wait;
-    send;
-    sendfile;
-    sendfile64; # introduced=21
-    sendmmsg; # introduced=21
-    sendmsg;
-    sendto;
-    setbuf;
-    setbuffer;
-    setegid;
-    setenv;
-    seteuid;
-    setfsgid; # introduced=21
-    setfsuid; # introduced=21
-    setgid;
-    setgroups;
-    sethostname; # introduced=23
-    setitimer;
-    setjmp;
-    setlinebuf;
-    setlocale;
-    setlogmask;
-    setmntent; # introduced=21
-    setns; # introduced=21
-    setpgid;
-    setpgrp;
-    setpriority;
-    setprogname; # introduced=21
-    setregid;
-    setresgid;
-    setresuid;
-    setreuid;
-    setrlimit;
-    setrlimit64; # introduced=21
-    setservent;
-    setsid;
-    setsockopt;
-    setstate; # introduced=21
-    settimeofday;
-    setuid;
-    setutent;
-    setvbuf;
-    setxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    shutdown;
-    sigaction;
-    sigaddset; # introduced=21
-    sigaltstack;
-    sigblock;
-    sigdelset; # introduced=21
-    sigemptyset; # introduced=21
-    sigfillset; # introduced=21
-    siginterrupt;
-    sigismember; # introduced=21
-    siglongjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    signal; # introduced=21
-    signalfd; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    sigpending;
-    sigprocmask;
-    sigqueue; # introduced=23
-    sigsetjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sigsetmask;
-    sigsuspend;
-    sigtimedwait; # introduced=23
-    sigwait;
-    sigwaitinfo; # introduced=23
-    sleep;
-    snprintf;
-    socket;
-    socketpair;
-    splice; # introduced=21
-    sprintf;
-    srand; # introduced=21
-    srand48;
-    srandom; # introduced=21
-    sscanf;
-    stat;
-    stat64; # introduced=21
-    statfs;
-    statfs64; # introduced=21
-    statvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    statvfs64; # introduced=21
-    stderr; # var introduced=23
-    stdin; # var introduced=23
-    stdout; # var introduced=23
-    stpcpy; # introduced=21
-    stpncpy; # introduced=21
-    strcasecmp;
-    strcasecmp_l; # introduced=23
-    strcasestr;
-    strcat;
-    strchr;
-    strcmp;
-    strcoll;
-    strcoll_l; # introduced=21
-    strcpy;
-    strcspn;
-    strdup;
-    strerror;
-    strerror_l; # introduced=23
-    strerror_r;
-    strftime;
-    strftime_l; # introduced=21
-    strlcat;
-    strlcpy;
-    strlen;
-    strncasecmp;
-    strncasecmp_l; # introduced=23
-    strncat;
-    strncmp;
-    strncpy;
-    strndup;
-    strnlen;
-    strpbrk;
-    strptime;
-    strrchr;
-    strsep;
-    strsignal;
-    strspn;
-    strstr;
-    strtod;
-    strtof; # introduced=21
-    strtoimax;
-    strtok;
-    strtok_r;
-    strtol;
-    strtold; # introduced=21
-    strtold_l; # introduced=21
-    strtoll;
-    strtoll_l; # introduced=21
-    strtoq; # introduced=21
-    strtoul;
-    strtoull;
-    strtoull_l; # introduced=21
-    strtoumax;
-    strtouq; # introduced=21
-    strxfrm;
-    strxfrm_l; # introduced=21
-    swapoff; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swapon; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swprintf;
-    swscanf;
-    symlink;
-    symlinkat; # introduced=21
-    sync;
-    sys_siglist; # var
-    sys_signame; # var
-    syscall;
-    sysconf;
-    sysinfo;
-    syslog;
-    system;
-    tcdrain; # introduced=21
-    tcflow; # introduced=21
-    tcflush; # introduced=21
-    tcgetattr; # introduced=21
-    tcgetpgrp;
-    tcgetsid; # introduced=21
-    tcsendbreak; # introduced=21
-    tcsetattr; # introduced=21
-    tcsetpgrp;
-    tdelete; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tdestroy; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tee; # introduced=21
-    telldir; # introduced=23
-    tempnam;
-    tfind; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tgkill; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    time;
-    timegm; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timegm64; # arm x86 mips
-    timelocal; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timelocal64; # arm x86 mips
-    timer_create;
-    timer_delete;
-    timer_getoverrun;
-    timer_gettime;
-    timer_settime;
-    timerfd_create; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_gettime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_settime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    times;
-    timezone; # var
-    tmpfile;
-    tmpnam;
-    toascii;
-    tolower;
-    tolower_l; # introduced=21
-    toupper;
-    toupper_l; # introduced=21
-    towlower;
-    towlower_l; # introduced=21
-    towupper;
-    towupper_l; # introduced=21
-    truncate;
-    truncate64; # introduced=21
-    tsearch; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    ttyname;
-    ttyname_r;
-    twalk; # introduced=21
-    tzname; # var
-    tzset;
-    umask;
-    umount;
-    umount2;
-    uname;
-    ungetc;
-    ungetwc;
-    unlink;
-    unlinkat;
-    unlockpt;
-    unsetenv;
-    unshare; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    uselocale; # introduced=21
-    usleep;
-    utime;
-    utimensat; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    utimes;
-    utmpname;
-    valloc; # arm x86 mips
-    vasprintf;
-    vdprintf; # introduced=21
-    verr;
-    verrx;
-    vfdprintf; # arm x86 mips versioned=28
-    vfork;
-    vfprintf;
-    vfscanf;
-    vfwprintf;
-    vfwscanf; # introduced=21
-    vmsplice; # introduced=21
-    vprintf;
-    vscanf;
-    vsnprintf;
-    vsprintf;
-    vsscanf;
-    vswprintf;
-    vswscanf; # introduced=21
-    vsyslog;
-    vwarn;
-    vwarnx;
-    vwprintf;
-    vwscanf; # introduced=21
-    wait;
-    wait4; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    waitid;
-    waitpid;
-    warn;
-    warnx;
-    wcpcpy;
-    wcpncpy;
-    wcrtomb;
-    wcscasecmp;
-    wcscasecmp_l; # introduced=23
-    wcscat;
-    wcschr;
-    wcscmp;
-    wcscoll;
-    wcscoll_l; # introduced=21
-    wcscpy;
-    wcscspn;
-    wcsdup;
-    wcsftime;
-    wcslcat;
-    wcslcpy;
-    wcslen;
-    wcsncasecmp;
-    wcsncasecmp_l; # introduced=23
-    wcsncat;
-    wcsncmp;
-    wcsncpy;
-    wcsnlen;
-    wcsnrtombs; # introduced=21
-    wcspbrk;
-    wcsrchr;
-    wcsrtombs;
-    wcsspn;
-    wcsstr;
-    wcstod;
-    wcstof; # introduced=21
-    wcstoimax; # introduced=21
-    wcstok;
-    wcstol;
-    wcstold; # introduced=21
-    wcstold_l; # introduced=21
-    wcstoll; # introduced=21
-    wcstoll_l; # introduced=21
-    wcstombs;
-    wcstoul;
-    wcstoull; # introduced=21
-    wcstoull_l; # introduced=21
-    wcstoumax; # introduced=21
-    wcswidth;
-    wcsxfrm;
-    wcsxfrm_l; # introduced=21
-    wctob;
-    wctomb; # introduced=21
-    wctype;
-    wctype_l; # introduced=21
-    wcwidth;
-    wmemchr;
-    wmemcmp;
-    wmemcpy;
-    wmemmove;
-    wmempcpy; # introduced=23
-    wmemset;
-    wprintf;
-    write;
-    writev;
-    wscanf;
-  local:
-    *;
-};
-
-LIBC_N { # introduced-arm64=24 introduced-mips=24 introduced-mips64=24 introduced-x86=24 introduced-x86_64=24
-  global:
-    __aeabi_atexit; # arm versioned=24
-    __aeabi_memclr; # arm versioned=24
-    __aeabi_memclr4; # arm versioned=24
-    __aeabi_memclr8; # arm versioned=24
-    __aeabi_memcpy; # arm versioned=24
-    __aeabi_memcpy4; # arm versioned=24
-    __aeabi_memcpy8; # arm versioned=24
-    __aeabi_memmove; # arm versioned=24
-    __aeabi_memmove4; # arm versioned=24
-    __aeabi_memmove8; # arm versioned=24
-    __aeabi_memset; # arm versioned=24
-    __aeabi_memset4; # arm versioned=24
-    __aeabi_memset8; # arm versioned=24
-    __fread_chk; # introduced=24
-    __fwrite_chk; # introduced=24
-    __getcwd_chk; # introduced=24
-    __gnu_Unwind_Find_exidx; # arm versioned=24
-    __pwrite_chk; # introduced=24
-    __pwrite64_chk; # introduced=24
-    __write_chk; # introduced=24
-    adjtimex; # introduced=24
-    clock_adjtime; # introduced=24
-    fgetpos64; # introduced=24
-    fileno_unlocked; # introduced=24
-    fopen64; # introduced=24
-    freeifaddrs; # introduced=24
-    freopen64; # introduced=24
-    fseeko64; # introduced=24
-    fsetpos64; # introduced=24
-    ftello64; # introduced=24
-    funopen64; # introduced=24
-    getgrgid_r; # introduced=24
-    getgrnam_r; # introduced=24
-    getifaddrs; # introduced=24
-    if_freenameindex; # introduced=24
-    if_nameindex; # introduced=24
-    in6addr_any; # var introduced=24
-    in6addr_loopback; # var introduced=24
-    lockf; # introduced=24
-    lockf64; # introduced=24
-    preadv; # introduced=24
-    preadv64; # introduced=24
-    prlimit; # arm mips x86 introduced=24
-    pthread_barrierattr_destroy; # introduced=24
-    pthread_barrierattr_getpshared; # introduced=24
-    pthread_barrierattr_init; # introduced=24
-    pthread_barrierattr_setpshared; # introduced=24
-    pthread_barrier_destroy; # introduced=24
-    pthread_barrier_init; # introduced=24
-    pthread_barrier_wait; # introduced=24
-    pthread_spin_destroy; # introduced=24
-    pthread_spin_init; # introduced=24
-    pthread_spin_lock; # introduced=24
-    pthread_spin_trylock; # introduced=24
-    pthread_spin_unlock; # introduced=24
-    pwritev; # introduced=24
-    pwritev64; # introduced=24
-    scandirat; # introduced=24
-    scandirat64; # introduced=24
-    strchrnul; # introduced=24
-    tmpfile64; # introduced=24
-} LIBC;
-
-LIBC_O {
-  global:
-    __sendto_chk; # introduced=26
-    __system_property_read_callback; # introduced=26
-    __system_property_wait; # introduced=26
-    bsd_signal; # arm x86 mips versioned=26
-    catclose; # introduced=26
-    catgets; # introduced=26
-    catopen; # introduced=26
-    ctermid; # introduced=26
-    endgrent; # introduced=26
-    endpwent; # introduced=26
-    futimes; # introduced=26
-    futimesat; # introduced=26
-    getdomainname; # introduced=26
-    getgrent; # introduced=26
-    getpwent; # introduced=26
-    getsubopt; # introduced=26
-    hasmntopt; # introduced=26
-    lutimes; # introduced=26
-    mallopt; # introduced=26
-    mblen; # introduced=26
-    msgctl; # introduced=26
-    msgget; # introduced=26
-    msgrcv; # introduced=26
-    msgsnd; # introduced=26
-    nl_langinfo; # introduced=26
-    nl_langinfo_l; # introduced=26
-    pthread_getname_np; # introduced=26
-    quotactl; # introduced=26
-    semctl; # introduced=26
-    semget; # introduced=26
-    semop; # introduced=26
-    semtimedop; # introduced=26
-    setdomainname; # introduced=26
-    setgrent; # introduced=26
-    setpwent; # introduced=26
-    shmat; # introduced=26
-    shmctl; # introduced=26
-    shmdt; # introduced=26
-    shmget; # introduced=26
-    sighold; # introduced=26
-    sigignore; # introduced=26
-    sigpause; # introduced=26
-    sigrelse; # introduced=26
-    sigset; # introduced=26
-    strtod_l; # introduced=26
-    strtof_l; # introduced=26
-    strtol_l; # introduced=26
-    strtoul_l; # introduced=26
-    sync_file_range; # introduced=26
-    towctrans; # introduced=26
-    towctrans_l; # introduced=26
-    wctrans; # introduced=26
-    wctrans_l; # introduced=26
-} LIBC_N;
-
-LIBC_P { # introduced=P
-  global:
-    __freading;
-    __free_hook;
-    __fseterr;
-    __fwriting;
-    __malloc_hook;
-    __memalign_hook;
-    __realloc_hook;
-    aligned_alloc;
-    endhostent;
-    endnetent;
-    endprotoent;
-    epoll_pwait64;
-    fexecve;
-    fflush_unlocked;
-    fgetc_unlocked;
-    fgets_unlocked;
-    fputc_unlocked;
-    fputs_unlocked;
-    fread_unlocked;
-    fwrite_unlocked;
-    getentropy;
-    getnetent;
-    getprotoent;
-    getrandom;
-    getlogin_r;
-    glob;
-    globfree;
-    hcreate;
-    hcreate_r;
-    hdestroy;
-    hdestroy_r;
-    hsearch;
-    hsearch_r;
-    iconv;
-    iconv_close;
-    iconv_open;
-    posix_spawn;
-    posix_spawnattr_destroy;
-    posix_spawnattr_getflags;
-    posix_spawnattr_getpgroup;
-    posix_spawnattr_getschedparam;
-    posix_spawnattr_getschedpolicy;
-    posix_spawnattr_getsigdefault;
-    posix_spawnattr_getsigdefault64;
-    posix_spawnattr_getsigmask;
-    posix_spawnattr_getsigmask64;
-    posix_spawnattr_init;
-    posix_spawnattr_setflags;
-    posix_spawnattr_setpgroup;
-    posix_spawnattr_setschedparam;
-    posix_spawnattr_setschedpolicy;
-    posix_spawnattr_setsigdefault;
-    posix_spawnattr_setsigdefault64;
-    posix_spawnattr_setsigmask;
-    posix_spawnattr_setsigmask64;
-    posix_spawn_file_actions_addclose;
-    posix_spawn_file_actions_adddup2;
-    posix_spawn_file_actions_addopen;
-    posix_spawn_file_actions_destroy;
-    posix_spawn_file_actions_init;
-    posix_spawnp;
-    ppoll64;
-    pselect64;
-    pthread_attr_getinheritsched;
-    pthread_attr_setinheritsched;
-    pthread_mutex_timedlock_monotonic_np;
-    pthread_mutexattr_getprotocol;
-    pthread_mutexattr_setprotocol;
-    pthread_rwlock_timedrdlock_monotonic_np;
-    pthread_rwlock_timedwrlock_monotonic_np;
-    pthread_setschedprio;
-    pthread_sigmask64;
-    sem_timedwait_monotonic_np;
-    sethostent;
-    setnetent;
-    setprotoent;
-    sigaction64;
-    sigaddset64;
-    sigdelset64;
-    sigemptyset64;
-    sigfillset64;
-    sigismember64;
-    signalfd64;
-    sigpending64;
-    sigprocmask64;
-    sigsuspend64;
-    sigtimedwait64;
-    sigwait64;
-    sigwaitinfo64;
-    strptime_l;
-    swab;
-    syncfs;
-    wcsftime_l;
-    wcstod_l;
-    wcstof_l;
-    wcstol_l;
-    wcstoul_l;
-} LIBC_O;
-
-LIBC_Q { # introduced=Q
-  global:
-    __res_randomid;
-    android_fdsan_close_with_tag;
-    android_fdsan_create_owner_tag;
-    android_fdsan_exchange_owner_tag;
-    android_fdsan_get_owner_tag;
-    android_fdsan_get_tag_type;
-    android_fdsan_get_tag_value;
-    android_fdsan_get_error_level;
-    android_fdsan_set_error_level;
-    android_get_device_api_level;
-    getloadavg;
-    pthread_sigqueue;
-    reallocarray;
-    timespec_get;
-} LIBC_P;
-
-LIBC_PRIVATE {
-  global:
-    ___Unwind_Backtrace; # arm
-    ___Unwind_ForcedUnwind; # arm
-    ___Unwind_RaiseException; # arm
-    ___Unwind_Resume; # arm
-    ___Unwind_Resume_or_Rethrow; # arm
-    __accept4; # arm x86 mips
-    __adddf3; # arm
-    __addsf3; # arm
-    __aeabi_atexit; # arm
-    __aeabi_cdcmpeq; # arm
-    __aeabi_cdcmple; # arm
-    __aeabi_cdrcmple; # arm
-    __aeabi_d2f; # arm
-    __aeabi_d2iz; # arm
-    __aeabi_dadd; # arm
-    __aeabi_dcmpeq; # arm
-    __aeabi_dcmpge; # arm
-    __aeabi_dcmpgt; # arm
-    __aeabi_dcmple; # arm
-    __aeabi_dcmplt; # arm
-    __aeabi_dcmpun; # arm
-    __aeabi_ddiv; # arm
-    __aeabi_dmul; # arm
-    __aeabi_drsub; # arm
-    __aeabi_dsub; # arm
-    __aeabi_f2d; # arm
-    __aeabi_f2iz; # arm
-    __aeabi_f2uiz; # arm
-    __aeabi_fadd; # arm
-    __aeabi_fcmpun; # arm
-    __aeabi_fdiv; # arm
-    __aeabi_fmul; # arm
-    __aeabi_frsub; # arm
-    __aeabi_fsub; # arm
-    __aeabi_i2d; # arm
-    __aeabi_i2f; # arm
-    __aeabi_idiv; # arm
-    __aeabi_idiv0; # arm
-    __aeabi_idivmod; # arm
-    __aeabi_l2d; # arm
-    __aeabi_l2f; # arm
-    __aeabi_lasr; # arm
-    __aeabi_ldiv0; # arm
-    __aeabi_ldivmod; # arm
-    __aeabi_llsl; # arm
-    __aeabi_llsr; # arm
-    __aeabi_lmul; # arm
-    __aeabi_memclr; # arm
-    __aeabi_memclr4; # arm
-    __aeabi_memclr8; # arm
-    __aeabi_memcpy; # arm
-    __aeabi_memcpy4; # arm
-    __aeabi_memcpy8; # arm
-    __aeabi_memmove; # arm
-    __aeabi_memmove4; # arm
-    __aeabi_memmove8; # arm
-    __aeabi_memset; # arm
-    __aeabi_memset4; # arm
-    __aeabi_memset8; # arm
-    __aeabi_ui2d; # arm
-    __aeabi_ui2f; # arm
-    __aeabi_uidiv; # arm
-    __aeabi_uidivmod; # arm
-    __aeabi_ul2d; # arm
-    __aeabi_ul2f; # arm
-    __aeabi_uldivmod; # arm
-    __aeabi_unwind_cpp_pr0; # arm
-    __aeabi_unwind_cpp_pr1; # arm
-    __aeabi_unwind_cpp_pr2; # arm
-    __arm_fadvise64_64; # arm
-    __ashldi3; # arm
-    __ashrdi3; # arm
-    __bionic_brk; # arm x86 mips
-    __bionic_libgcc_compat_symbols; # arm x86
-    __cmpdf2; # arm
-    __divdf3; # arm
-    __divdi3; # arm x86 mips
-    __divsf3; # arm
-    __divsi3; # arm
-    __dso_handle; # arm
-    __eqdf2; # arm
-    __extendsfdf2; # arm
-    __fixdfsi; # arm
-    __fixsfsi; # arm
-    __fixunssfsi; # arm
-    __floatdidf; # arm
-    __floatdisf; # arm
-    __floatsidf; # arm
-    __floatsisf; # arm
-    __floatundidf; # arm
-    __floatundisf; # arm
-    __floatunsidf; # arm
-    __floatunsisf; # arm
-    __futex_wait; # arm x86 mips
-    __futex_wake; # arm x86 mips
-    __gedf2; # arm
-    __get_thread; # arm x86 mips
-    __get_tls; # arm x86 mips
-    __getdents64; # arm x86 mips
-    __gnu_ldivmod_helper; # arm
-    __gnu_uldivmod_helper; # arm
-    __gnu_Unwind_Backtrace; # arm
-    __gnu_unwind_execute; # arm
-    __gnu_Unwind_Find_exidx; # arm
-    __gnu_Unwind_ForcedUnwind; # arm
-    __gnu_unwind_frame; # arm
-    __gnu_Unwind_RaiseException; # arm
-    __gnu_Unwind_Restore_VFP; # arm
-    __gnu_Unwind_Restore_VFP_D; # arm
-    __gnu_Unwind_Restore_VFP_D_16_to_31; # arm
-    __gnu_Unwind_Restore_WMMXC; # arm
-    __gnu_Unwind_Restore_WMMXD; # arm
-    __gnu_Unwind_Resume; # arm
-    __gnu_Unwind_Resume_or_Rethrow; # arm
-    __gnu_Unwind_Save_VFP; # arm
-    __gnu_Unwind_Save_VFP_D; # arm
-    __gnu_Unwind_Save_VFP_D_16_to_31; # arm
-    __gnu_Unwind_Save_WMMXC; # arm
-    __gnu_Unwind_Save_WMMXD; # arm
-    __gtdf2; # arm
-    __ledf2; # arm
-    __lshrdi3; # arm
-    __ltdf2; # arm
-    __muldf3; # arm
-    __muldi3; # arm
-    __mulsf3; # arm
-    __nedf2; # arm
-    __open; # arm x86 mips
-    __page_shift; # arm x86 mips
-    __page_size; # arm x86 mips
-    __popcount_tab; # arm
-    __popcountsi2; # arm x86 mips
-    __pthread_gettid; # arm x86 mips
-    __restore_core_regs; # arm
-    __sclose; # arm x86 mips
-    __sdidinit; # arm x86 mips
-    __set_errno; # arm x86 mips
-    __sflags; # arm x86 mips
-    __sflush; # arm x86 mips
-    __sfp; # arm x86 mips
-    __sglue; # arm x86 mips
-    __sinit; # arm x86 mips
-    __smakebuf; # arm x86 mips
-    __sread; # arm x86 mips
-    __srefill; # arm x86 mips
-    __srget; # arm x86 mips
-    __sseek; # arm x86 mips
-    __subdf3; # arm
-    __subsf3; # arm
-    __swbuf; # arm x86 mips
-    __swrite; # arm x86 mips
-    __swsetup; # arm x86 mips
-    __truncdfsf2; # arm
-    __udivdi3; # arm x86 mips
-    __udivsi3; # arm
-    __unorddf2; # arm
-    __unordsf2; # arm
-    __wait4; # arm x86 mips
-    _fwalk; # arm x86 mips
-    _Unwind_Backtrace; # arm
-    _Unwind_Complete; # arm
-    _Unwind_DeleteException; # arm
-    _Unwind_ForcedUnwind; # arm
-    _Unwind_GetCFA; # arm
-    _Unwind_GetDataRelBase; # arm
-    _Unwind_GetLanguageSpecificData; # arm
-    _Unwind_GetRegionStart; # arm
-    _Unwind_GetTextRelBase; # arm
-    _Unwind_RaiseException; # arm
-    _Unwind_Resume; # arm
-    _Unwind_Resume_or_Rethrow; # arm
-    _Unwind_VRS_Get; # arm
-    _Unwind_VRS_Pop; # arm
-    _Unwind_VRS_Set; # arm
-    android_getaddrinfofornet;
-    android_getaddrinfofornetcontext;
-    android_gethostbyaddrfornet;
-    android_gethostbyaddrfornetcontext;
-    android_gethostbynamefornet;
-    android_gethostbynamefornetcontext;
-    arc4random_addrandom; # arm x86 mips
-    arc4random_stir; # arm x86 mips
-    atexit; # arm
-    bcopy; # arm x86 mips
-    bzero; # arm x86 mips
-    dlmalloc; # arm x86 mips
-    dlmalloc_inspect_all; # arm x86 mips
-    dlmalloc_trim; # arm x86 mips
-    dlmalloc_usable_size; # arm x86 mips
-    free_malloc_leak_info;
-    ftime; # arm x86 mips
-    get_malloc_leak_info;
-    getdents; # arm x86 mips
-    getdtablesize; # arm x86 mips
-    gMallocLeakZygoteChild;
-    index; # arm x86 mips
-    issetugid; # arm x86 mips
-    memswap; # arm x86 mips
-    pthread_attr_getstackaddr; # arm x86 mips
-    pthread_attr_setstackaddr; # arm x86 mips
-    restore_core_regs; # arm
-    SHA1Final; # arm x86 mips
-    SHA1Init; # arm x86 mips
-    SHA1Transform; # arm x86 mips
-    SHA1Update; # arm x86 mips
-    strntoimax; # arm x86 mips
-    strntoumax; # arm x86 mips
-    strtotimeval; # arm x86 mips
-    sysv_signal; # arm x86 mips
-    tkill; # arm x86 mips
-    wait3; # arm x86 mips
-    wcswcs; # arm x86 mips
-    write_malloc_leak_info;
-} LIBC_Q;
-
-LIBC_DEPRECATED {
-  global:
-    __system_property_wait_any;
-};
-
-LIBC_PLATFORM {
-  global:
-    __system_properties_init;
-    __system_property_area__; # var
-    __system_property_add;
-    __system_property_area_init;
-    __system_property_set_filename;
-    __system_property_update;
-    android_fdsan_get_fd_table;
-    android_net_res_stats_get_info_for_net;
-    android_net_res_stats_aggregate;
-    android_net_res_stats_get_usable_servers;
-    malloc_backtrace;
-    malloc_disable;
-    malloc_enable;
-    malloc_iterate;
-} LIBC_Q;
diff --git a/libc/libc.arm64.map b/libc/libc.arm64.map
deleted file mode 100644
index 81ff00d..0000000
--- a/libc/libc.arm64.map
+++ /dev/null
@@ -1,1397 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __assert;
-    __assert2;
-    __b64_ntop;
-    __b64_pton;
-    __cmsg_nxthdr; # introduced=21
-    __ctype_get_mb_cur_max; # introduced=21
-    __cxa_atexit;
-    __cxa_finalize;
-    __cxa_thread_atexit_impl; # introduced=23
-    __dn_comp;
-    __dn_count_labels;
-    __dn_skipname;
-    __errno;
-    __fbufsize; # introduced=23
-    __FD_CLR_chk; # introduced=21
-    __FD_ISSET_chk; # introduced=21
-    __FD_SET_chk; # introduced=21
-    __fgets_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __flbf; # introduced=23
-    __fp_nquery;
-    __fp_query;
-    __fpclassify; # introduced=21
-    __fpclassifyd;
-    __fpclassifyf;
-    __fpclassifyl;
-    __fpending; # introduced=23
-    __fpurge; # introduced=23
-    __freadable; # introduced=23
-    __fsetlocking; # introduced=23
-    __fwritable; # introduced=23
-    __get_h_errno;
-    __gnu_basename; # introduced=23
-    __gnu_strerror_r; # introduced=23
-    __hostalias;
-    __isfinite;
-    __isfinitef;
-    __isfinitel;
-    __isinf;
-    __isinff;
-    __isinfl;
-    __isnan; # introduced=21
-    __isnanf; # introduced=21
-    __isnanl;
-    __isnormal;
-    __isnormalf;
-    __isnormall;
-    __libc_current_sigrtmax; # introduced=21
-    __libc_current_sigrtmin; # introduced=21
-    __libc_init;
-    __loc_aton;
-    __loc_ntoa;
-    __memchr_chk; # introduced=23
-    __memcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memmove_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memrchr_chk; # introduced=23
-    __memset_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __open_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __openat_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __p_cdname;
-    __p_cdnname;
-    __p_class;
-    __p_class_syms; # var
-    __p_fqname;
-    __p_fqnname;
-    __p_option;
-    __p_query;
-    __p_rcode;
-    __p_secstodate;
-    __p_time;
-    __p_type;
-    __p_type_syms; # var
-    __poll_chk; # introduced=23
-    __ppoll_chk; # introduced=23
-    __ppoll64_chk; # introduced=28
-    __pread64_chk; # introduced=23
-    __pread_chk; # introduced=23
-    __progname; # var
-    __pthread_cleanup_pop;
-    __pthread_cleanup_push;
-    __putlong;
-    __putshort;
-    __read_chk; # introduced=21
-    __readlink_chk; # introduced=23
-    __readlinkat_chk; # introduced=23
-    __recvfrom_chk; # introduced=21
-    __register_atfork; # introduced=23
-    __res_close;
-    __res_dnok;
-    __res_hnok;
-    __res_hostalias;
-    __res_isourserver;
-    __res_mailok;
-    __res_nameinquery;
-    __res_nclose;
-    __res_ninit;
-    __res_nmkquery;
-    __res_nquery;
-    __res_nquerydomain;
-    __res_nsearch;
-    __res_nsend;
-    __res_ownok;
-    __res_queriesmatch;
-    __res_querydomain;
-    __res_send;
-    __res_send_setqhook;
-    __res_send_setrhook;
-    __sched_cpualloc; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpucount; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpufree; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sF; # var
-    __snprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __sprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __stack_chk_fail;
-    __stack_chk_guard; # var
-    __stpcpy_chk; # introduced=21
-    __stpncpy_chk; # introduced=21
-    __stpncpy_chk2; # introduced=21
-    __strcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __strcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlen_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk2; # introduced=21
-    __strrchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __sym_ntop;
-    __sym_ntos;
-    __sym_ston;
-    __system_property_area_serial; # introduced=23
-    __system_property_find;
-    __system_property_find_nth;
-    __system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_get;
-    __system_property_read;
-    __system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __umask_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __vsnprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __vsprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    _ctype_; # var
-    _Exit; # introduced=21
-    _exit;
-    _flushlbf; # introduced=23
-    _getlong;
-    _getshort;
-    _longjmp;
-    _resolv_delete_cache_for_net; # introduced=21
-    _resolv_flush_cache_for_net; # introduced=21
-    _resolv_set_nameservers_for_net; # introduced=21
-    _setjmp;
-    _tolower; # introduced=21
-    _toupper; # introduced=21
-    abort;
-    abs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    accept;
-    accept4; # introduced=21
-    access;
-    acct;
-    alarm;
-    alphasort;
-    alphasort64; # introduced=21
-    android_set_abort_message; # introduced=21
-    arc4random;
-    arc4random_buf;
-    arc4random_uniform;
-    asctime;
-    asctime_r;
-    asprintf;
-    at_quick_exit; # introduced=21
-    atof; # introduced=21
-    atoi;
-    atol;
-    atoll;
-    basename;
-    bind;
-    bindresvport;
-    brk;
-    bsearch;
-    btowc;
-    c16rtomb; # introduced=21
-    c32rtomb; # introduced=21
-    calloc;
-    capget;
-    capset;
-    cfgetispeed; # introduced=21
-    cfgetospeed; # introduced=21
-    cfmakeraw; # introduced=21
-    cfsetispeed; # introduced=21
-    cfsetospeed; # introduced=21
-    cfsetspeed; # introduced=21
-    chdir;
-    chmod;
-    chown;
-    chroot;
-    clearenv;
-    clearerr;
-    clearerr_unlocked; # introduced=23
-    clock;
-    clock_getcpuclockid; # introduced=23
-    clock_getres;
-    clock_gettime;
-    clock_nanosleep;
-    clock_settime;
-    clone; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    close;
-    closedir;
-    closelog;
-    connect;
-    creat;
-    creat64; # introduced=21
-    ctime;
-    ctime_r;
-    daemon;
-    daylight; # var
-    delete_module;
-    difftime;
-    dirfd;
-    dirname;
-    div;
-    dn_expand;
-    dprintf; # introduced=21
-    drand48;
-    dup;
-    dup2;
-    dup3; # introduced=21
-    duplocale; # introduced=21
-    endmntent; # introduced=21
-    endservent;
-    endutent;
-    environ; # var
-    epoll_create;
-    epoll_create1; # introduced=21
-    epoll_ctl;
-    epoll_pwait; # introduced=21
-    epoll_wait;
-    erand48;
-    err;
-    error; # introduced=23
-    error_at_line; # introduced=23
-    error_message_count; # var introduced=23
-    error_one_per_line; # var introduced=23
-    error_print_progname; # var introduced=23
-    errx;
-    ether_aton; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_aton_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    eventfd;
-    eventfd_read;
-    eventfd_write;
-    execl;
-    execle;
-    execlp;
-    execv;
-    execve;
-    execvp;
-    execvpe; # introduced=21
-    exit;
-    faccessat; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fallocate; # introduced=21
-    fallocate64; # introduced=21
-    fchdir;
-    fchmod;
-    fchmodat;
-    fchown;
-    fchownat;
-    fclose;
-    fcntl;
-    fdatasync;
-    fdopen;
-    fdopendir;
-    feof;
-    feof_unlocked; # introduced=23
-    ferror;
-    ferror_unlocked; # introduced=23
-    fflush;
-    ffs; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    fgetc;
-    fgetln;
-    fgetpos;
-    fgets;
-    fgetwc;
-    fgetws;
-    fgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fileno;
-    flistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    flock;
-    flockfile;
-    fmemopen; # introduced=23
-    fnmatch;
-    fopen;
-    fork;
-    forkpty; # introduced=23
-    fpathconf;
-    fprintf;
-    fpurge;
-    fputc;
-    fputs;
-    fputwc;
-    fputws;
-    fread;
-    free;
-    freeaddrinfo;
-    freelocale; # introduced=21
-    fremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    freopen;
-    fscanf;
-    fseek;
-    fseeko;
-    fsetpos;
-    fsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fstat;
-    fstat64; # introduced=21
-    fstatat;
-    fstatat64; # introduced=21
-    fstatfs;
-    fstatfs64; # introduced=21
-    fstatvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fstatvfs64; # introduced=21
-    fsync;
-    ftell;
-    ftello;
-    ftok;
-    ftruncate;
-    ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ftrylockfile;
-    fts_children; # introduced=21
-    fts_close; # introduced=21
-    fts_open; # introduced=21
-    fts_read; # introduced=21
-    fts_set; # introduced=21
-    ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    ftw64; # introduced=21
-    funlockfile;
-    funopen;
-    futimens; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fwide;
-    fwprintf;
-    fwrite;
-    fwscanf;
-    gai_strerror;
-    get_avphys_pages; # introduced=23
-    get_nprocs; # introduced=23
-    get_nprocs_conf; # introduced=23
-    get_phys_pages; # introduced=23
-    getaddrinfo;
-    getauxval; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getc;
-    getc_unlocked;
-    getchar;
-    getchar_unlocked;
-    getcwd;
-    getdelim; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getegid;
-    getenv;
-    geteuid;
-    getgid;
-    getgrgid;
-    getgrnam;
-    getgrouplist;
-    getgroups;
-    gethostbyaddr;
-    gethostbyaddr_r; # introduced=23
-    gethostbyname;
-    gethostbyname2;
-    gethostbyname2_r; # introduced=23
-    gethostbyname_r;
-    gethostent;
-    gethostname;
-    getitimer;
-    getline; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getlogin;
-    getmntent;
-    getmntent_r; # introduced=21
-    getnameinfo;
-    getnetbyaddr;
-    getnetbyname;
-    getopt;
-    getopt_long;
-    getopt_long_only;
-    getpagesize; # introduced=21
-    getpeername;
-    getpgid;
-    getpgrp;
-    getpid;
-    getppid;
-    getpriority;
-    getprogname; # introduced=21
-    getprotobyname;
-    getprotobynumber;
-    getpt;
-    getpwnam;
-    getpwnam_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getpwuid;
-    getpwuid_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getresgid;
-    getresuid;
-    getrlimit;
-    getrlimit64; # introduced=21
-    getrusage;
-    gets;
-    getservbyname;
-    getservbyport;
-    getservent;
-    getsid; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    getsockname;
-    getsockopt;
-    gettid;
-    gettimeofday;
-    getuid;
-    getutent;
-    getwc;
-    getwchar;
-    getxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    gmtime;
-    gmtime_r;
-    grantpt; # introduced=21
-    herror;
-    hstrerror;
-    htonl; # introduced=21
-    htons; # introduced=21
-    if_indextoname;
-    if_nametoindex;
-    imaxabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    imaxdiv; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    inet_addr;
-    inet_aton;
-    inet_lnaof; # introduced=21
-    inet_makeaddr; # introduced=21
-    inet_netof; # introduced=21
-    inet_network; # introduced=21
-    inet_nsap_addr;
-    inet_nsap_ntoa;
-    inet_ntoa;
-    inet_ntop;
-    inet_pton;
-    init_module;
-    initgroups;
-    initstate; # introduced=21
-    inotify_add_watch;
-    inotify_init;
-    inotify_init1; # introduced=21
-    inotify_rm_watch;
-    insque; # introduced=21
-    ioctl;
-    isalnum;
-    isalnum_l; # introduced=21
-    isalpha;
-    isalpha_l; # introduced=21
-    isascii;
-    isatty;
-    isblank;
-    isblank_l; # introduced=21
-    iscntrl;
-    iscntrl_l; # introduced=21
-    isdigit;
-    isdigit_l; # introduced=21
-    isfinite; # introduced=21
-    isfinitef; # introduced=21
-    isfinitel; # introduced=21
-    isgraph;
-    isgraph_l; # introduced=21
-    isinf; # introduced=21
-    isinff; # introduced=21
-    isinfl; # introduced=21
-    islower;
-    islower_l; # introduced=21
-    isnan;
-    isnanf;
-    isnanl; # introduced=21
-    isnormal; # introduced=21
-    isnormalf; # introduced=21
-    isnormall; # introduced=21
-    isprint;
-    isprint_l; # introduced=21
-    ispunct;
-    ispunct_l; # introduced=21
-    isspace;
-    isspace_l; # introduced=21
-    isupper;
-    isupper_l; # introduced=21
-    iswalnum;
-    iswalnum_l; # introduced=21
-    iswalpha;
-    iswalpha_l; # introduced=21
-    iswblank; # introduced=21
-    iswblank_l; # introduced=21
-    iswcntrl;
-    iswcntrl_l; # introduced=21
-    iswctype;
-    iswctype_l; # introduced=21
-    iswdigit;
-    iswdigit_l; # introduced=21
-    iswgraph;
-    iswgraph_l; # introduced=21
-    iswlower;
-    iswlower_l; # introduced=21
-    iswprint;
-    iswprint_l; # introduced=21
-    iswpunct;
-    iswpunct_l; # introduced=21
-    iswspace;
-    iswspace_l; # introduced=21
-    iswupper;
-    iswupper_l; # introduced=21
-    iswxdigit;
-    iswxdigit_l; # introduced=21
-    isxdigit;
-    isxdigit_l; # introduced=21
-    jrand48;
-    kill;
-    killpg;
-    klogctl;
-    labs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lchown;
-    lcong48; # introduced=23
-    ldexp;
-    ldiv;
-    lfind; # introduced=21
-    lgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    link;
-    linkat; # introduced=21
-    listen;
-    listxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    llabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lldiv;
-    llistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    localeconv; # introduced=21
-    localtime;
-    localtime_r;
-    login_tty; # introduced=23
-    longjmp;
-    lrand48;
-    lremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lsearch; # introduced=21
-    lseek;
-    lseek64;
-    lsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lstat;
-    lstat64; # introduced=21
-    madvise;
-    mallinfo;
-    malloc;
-    malloc_info; # introduced=23
-    malloc_usable_size; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mbrlen;
-    mbrtoc16; # introduced=21
-    mbrtoc32; # introduced=21
-    mbrtowc;
-    mbsinit;
-    mbsnrtowcs; # introduced=21
-    mbsrtowcs;
-    mbstowcs;
-    mbtowc; # introduced=21
-    memalign;
-    memccpy;
-    memchr;
-    memcmp;
-    memcpy;
-    memmem;
-    memmove;
-    mempcpy; # introduced=23
-    memrchr;
-    memset;
-    mincore;
-    mkdir;
-    mkdirat;
-    mkdtemp;
-    mkfifo; # introduced=21
-    mkfifoat; # introduced=23
-    mknod;
-    mknodat; # introduced=21
-    mkostemp; # introduced=23
-    mkostemp64; # introduced=23
-    mkostemps; # introduced=23
-    mkostemps64; # introduced=23
-    mkstemp;
-    mkstemp64; # introduced=21
-    mkstemps;
-    mkstemps64; # introduced=23
-    mktemp;
-    mktime;
-    mlock;
-    mlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mmap;
-    mmap64; # introduced=21
-    mount;
-    mprotect;
-    mrand48;
-    mremap;
-    msync;
-    munlock;
-    munlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    munmap;
-    nanosleep;
-    newlocale; # introduced=21
-    nftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    nftw64; # introduced=21
-    nice;
-    nrand48;
-    ns_format_ttl; # arm64 x86_64 mips64 introduced=22
-    ns_get16; # arm64 x86_64 mips64 introduced=22
-    ns_get32; # arm64 x86_64 mips64 introduced=22
-    ns_initparse; # arm64 x86_64 mips64 introduced=22
-    ns_makecanon; # arm64 x86_64 mips64 introduced=22
-    ns_msg_getflag; # arm64 x86_64 mips64 introduced=22
-    ns_name_compress; # arm64 x86_64 mips64 introduced=22
-    ns_name_ntol; # arm64 x86_64 mips64 introduced=22
-    ns_name_ntop; # arm64 x86_64 mips64 introduced=22
-    ns_name_pack; # arm64 x86_64 mips64 introduced=22
-    ns_name_pton; # arm64 x86_64 mips64 introduced=23
-    ns_name_rollback; # arm64 x86_64 mips64 introduced=22
-    ns_name_skip; # arm64 x86_64 mips64 introduced=22
-    ns_name_uncompress; # arm64 x86_64 mips64 introduced=22
-    ns_name_unpack; # arm64 x86_64 mips64 introduced=22
-    ns_parserr; # arm64 x86_64 mips64 introduced=22
-    ns_put16; # arm64 x86_64 mips64 introduced=22
-    ns_put32; # arm64 x86_64 mips64 introduced=22
-    ns_samename; # arm64 x86_64 mips64 introduced=22
-    ns_skiprr; # arm64 x86_64 mips64 introduced=22
-    ns_sprintrr; # arm64 x86_64 mips64 introduced=22
-    ns_sprintrrf; # arm64 x86_64 mips64 introduced=22
-    nsdispatch;
-    ntohl; # introduced=21
-    ntohs; # introduced=21
-    open;
-    open64; # introduced=21
-    open_memstream; # introduced=23
-    open_wmemstream; # introduced=23
-    openat;
-    openat64; # introduced=21
-    opendir;
-    openlog;
-    openpty; # introduced=23
-    optarg; # var
-    opterr; # var
-    optind; # var
-    optopt; # var
-    optreset; # var
-    pathconf;
-    pause;
-    pclose;
-    perror;
-    personality; # introduced-arm=15 introduced-arm64=21 introduced-mips=15 introduced-mips64=21 introduced-x86=15 introduced-x86_64=21
-    pipe;
-    pipe2;
-    poll;
-    popen;
-    posix_fadvise; # introduced=21
-    posix_fadvise64; # introduced=21
-    posix_fallocate; # introduced=21
-    posix_fallocate64; # introduced=21
-    posix_madvise; # introduced=23
-    posix_memalign; # introduced=17
-    posix_openpt; # introduced=21
-    ppoll; # introduced=21
-    prctl;
-    pread;
-    pread64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    printf;
-    prlimit; # arm64 x86_64 mips64
-    prlimit64; # introduced=21
-    process_vm_readv; # introduced=23
-    process_vm_writev; # introduced=23
-    pselect;
-    psiginfo; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    psignal; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    pthread_atfork; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    pthread_attr_destroy;
-    pthread_attr_getdetachstate;
-    pthread_attr_getguardsize;
-    pthread_attr_getschedparam;
-    pthread_attr_getschedpolicy;
-    pthread_attr_getscope;
-    pthread_attr_getstack;
-    pthread_attr_getstacksize;
-    pthread_attr_init;
-    pthread_attr_setdetachstate;
-    pthread_attr_setguardsize;
-    pthread_attr_setschedparam;
-    pthread_attr_setschedpolicy;
-    pthread_attr_setscope;
-    pthread_attr_setstack;
-    pthread_attr_setstacksize;
-    pthread_cond_broadcast;
-    pthread_cond_destroy;
-    pthread_cond_init;
-    pthread_cond_signal;
-    pthread_cond_timedwait;
-    pthread_cond_timedwait_monotonic_np; # introduced-arm=9 introduced-x86=9 introduced-mips=9 introduced-arm64=28 introduced-x64_64=28 introduced-mips64=28
-    pthread_cond_wait;
-    pthread_condattr_destroy;
-    pthread_condattr_getclock; # introduced=21
-    pthread_condattr_getpshared;
-    pthread_condattr_init;
-    pthread_condattr_setclock; # introduced=21
-    pthread_condattr_setpshared;
-    pthread_create;
-    pthread_detach;
-    pthread_equal;
-    pthread_exit;
-    pthread_getattr_np;
-    pthread_getcpuclockid;
-    pthread_getschedparam;
-    pthread_getspecific;
-    pthread_gettid_np; # introduced=21
-    pthread_join;
-    pthread_key_create;
-    pthread_key_delete;
-    pthread_kill;
-    pthread_mutex_destroy;
-    pthread_mutex_init;
-    pthread_mutex_lock;
-    pthread_mutex_timedlock; # introduced=21
-    pthread_mutex_trylock;
-    pthread_mutex_unlock;
-    pthread_mutexattr_destroy;
-    pthread_mutexattr_getpshared;
-    pthread_mutexattr_gettype;
-    pthread_mutexattr_init;
-    pthread_mutexattr_setpshared;
-    pthread_mutexattr_settype;
-    pthread_once;
-    pthread_rwlock_destroy;
-    pthread_rwlock_init;
-    pthread_rwlock_rdlock;
-    pthread_rwlock_timedrdlock;
-    pthread_rwlock_timedwrlock;
-    pthread_rwlock_tryrdlock;
-    pthread_rwlock_trywrlock;
-    pthread_rwlock_unlock;
-    pthread_rwlock_wrlock;
-    pthread_rwlockattr_destroy;
-    pthread_rwlockattr_getkind_np; # introduced=23
-    pthread_rwlockattr_getpshared;
-    pthread_rwlockattr_init;
-    pthread_rwlockattr_setkind_np; # introduced=23
-    pthread_rwlockattr_setpshared;
-    pthread_self;
-    pthread_setname_np;
-    pthread_setschedparam;
-    pthread_setspecific;
-    pthread_sigmask;
-    ptrace;
-    ptsname;
-    ptsname_r;
-    putc;
-    putc_unlocked;
-    putchar;
-    putchar_unlocked;
-    putenv;
-    puts;
-    pututline;
-    putwc;
-    putwchar;
-    pwrite;
-    pwrite64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    qsort;
-    quick_exit; # introduced=21
-    raise;
-    rand; # introduced=21
-    rand_r; # introduced=21
-    random; # introduced=21
-    read;
-    readahead; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    readdir;
-    readdir64; # introduced=21
-    readdir64_r; # introduced=21
-    readdir_r;
-    readlink;
-    readlinkat; # introduced=21
-    readv;
-    realloc;
-    realpath;
-    reboot;
-    recv;
-    recvfrom;
-    recvmmsg; # introduced=21
-    recvmsg;
-    regcomp;
-    regerror;
-    regexec;
-    regfree;
-    remove;
-    removexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    remque; # introduced=21
-    rename;
-    renameat;
-    res_init;
-    res_mkquery;
-    res_query;
-    res_search;
-    rewind;
-    rewinddir;
-    rmdir;
-    sbrk;
-    scandir;
-    scandir64; # introduced=21
-    scanf;
-    sched_get_priority_max;
-    sched_get_priority_min;
-    sched_getaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getcpu; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getparam;
-    sched_getscheduler;
-    sched_rr_get_interval;
-    sched_setaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_setparam;
-    sched_setscheduler;
-    sched_yield;
-    seed48;
-    seekdir; # introduced=23
-    select;
-    sem_close;
-    sem_destroy;
-    sem_getvalue;
-    sem_init;
-    sem_open;
-    sem_post;
-    sem_timedwait;
-    sem_trywait;
-    sem_unlink;
-    sem_wait;
-    send;
-    sendfile;
-    sendfile64; # introduced=21
-    sendmmsg; # introduced=21
-    sendmsg;
-    sendto;
-    setbuf;
-    setbuffer;
-    setegid;
-    setenv;
-    seteuid;
-    setfsgid; # introduced=21
-    setfsuid; # introduced=21
-    setgid;
-    setgroups;
-    sethostname; # introduced=23
-    setitimer;
-    setjmp;
-    setlinebuf;
-    setlocale;
-    setlogmask;
-    setmntent; # introduced=21
-    setns; # introduced=21
-    setpgid;
-    setpgrp;
-    setpriority;
-    setprogname; # introduced=21
-    setregid;
-    setresgid;
-    setresuid;
-    setreuid;
-    setrlimit;
-    setrlimit64; # introduced=21
-    setservent;
-    setsid;
-    setsockopt;
-    setstate; # introduced=21
-    settimeofday;
-    setuid;
-    setutent;
-    setvbuf;
-    setxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    shutdown;
-    sigaction;
-    sigaddset; # introduced=21
-    sigaltstack;
-    sigblock;
-    sigdelset; # introduced=21
-    sigemptyset; # introduced=21
-    sigfillset; # introduced=21
-    siginterrupt;
-    sigismember; # introduced=21
-    siglongjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    signal; # introduced=21
-    signalfd; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    sigpending;
-    sigprocmask;
-    sigqueue; # introduced=23
-    sigsetjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sigsetmask;
-    sigsuspend;
-    sigtimedwait; # introduced=23
-    sigwait;
-    sigwaitinfo; # introduced=23
-    sleep;
-    snprintf;
-    socket;
-    socketpair;
-    splice; # introduced=21
-    sprintf;
-    srand; # introduced=21
-    srand48;
-    srandom; # introduced=21
-    sscanf;
-    stat;
-    stat64; # introduced=21
-    statfs;
-    statfs64; # introduced=21
-    statvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    statvfs64; # introduced=21
-    stderr; # var introduced=23
-    stdin; # var introduced=23
-    stdout; # var introduced=23
-    stpcpy; # introduced=21
-    stpncpy; # introduced=21
-    strcasecmp;
-    strcasecmp_l; # introduced=23
-    strcasestr;
-    strcat;
-    strchr;
-    strcmp;
-    strcoll;
-    strcoll_l; # introduced=21
-    strcpy;
-    strcspn;
-    strdup;
-    strerror;
-    strerror_l; # introduced=23
-    strerror_r;
-    strftime;
-    strftime_l; # introduced=21
-    strlcat;
-    strlcpy;
-    strlen;
-    strncasecmp;
-    strncasecmp_l; # introduced=23
-    strncat;
-    strncmp;
-    strncpy;
-    strndup;
-    strnlen;
-    strpbrk;
-    strptime;
-    strrchr;
-    strsep;
-    strsignal;
-    strspn;
-    strstr;
-    strtod;
-    strtof; # introduced=21
-    strtoimax;
-    strtok;
-    strtok_r;
-    strtol;
-    strtold; # introduced=21
-    strtold_l; # introduced=21
-    strtoll;
-    strtoll_l; # introduced=21
-    strtoq; # introduced=21
-    strtoul;
-    strtoull;
-    strtoull_l; # introduced=21
-    strtoumax;
-    strtouq; # introduced=21
-    strxfrm;
-    strxfrm_l; # introduced=21
-    swapoff; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swapon; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swprintf;
-    swscanf;
-    symlink;
-    symlinkat; # introduced=21
-    sync;
-    sys_siglist; # var
-    sys_signame; # var
-    syscall;
-    sysconf;
-    sysinfo;
-    syslog;
-    system;
-    tcdrain; # introduced=21
-    tcflow; # introduced=21
-    tcflush; # introduced=21
-    tcgetattr; # introduced=21
-    tcgetpgrp;
-    tcgetsid; # introduced=21
-    tcsendbreak; # introduced=21
-    tcsetattr; # introduced=21
-    tcsetpgrp;
-    tdelete; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tdestroy; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tee; # introduced=21
-    telldir; # introduced=23
-    tempnam;
-    tfind; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tgkill; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    time;
-    timegm; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timelocal; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timer_create;
-    timer_delete;
-    timer_getoverrun;
-    timer_gettime;
-    timer_settime;
-    timerfd_create; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_gettime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_settime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    times;
-    timezone; # var
-    tmpfile;
-    tmpnam;
-    toascii;
-    tolower;
-    tolower_l; # introduced=21
-    toupper;
-    toupper_l; # introduced=21
-    towlower;
-    towlower_l; # introduced=21
-    towupper;
-    towupper_l; # introduced=21
-    truncate;
-    truncate64; # introduced=21
-    tsearch; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    ttyname;
-    ttyname_r;
-    twalk; # introduced=21
-    tzname; # var
-    tzset;
-    umask;
-    umount;
-    umount2;
-    uname;
-    ungetc;
-    ungetwc;
-    unlink;
-    unlinkat;
-    unlockpt;
-    unsetenv;
-    unshare; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    uselocale; # introduced=21
-    usleep;
-    utime;
-    utimensat; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    utimes;
-    utmpname;
-    vasprintf;
-    vdprintf; # introduced=21
-    verr;
-    verrx;
-    vfork;
-    vfprintf;
-    vfscanf;
-    vfwprintf;
-    vfwscanf; # introduced=21
-    vmsplice; # introduced=21
-    vprintf;
-    vscanf;
-    vsnprintf;
-    vsprintf;
-    vsscanf;
-    vswprintf;
-    vswscanf; # introduced=21
-    vsyslog;
-    vwarn;
-    vwarnx;
-    vwprintf;
-    vwscanf; # introduced=21
-    wait;
-    wait4; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    waitid;
-    waitpid;
-    warn;
-    warnx;
-    wcpcpy;
-    wcpncpy;
-    wcrtomb;
-    wcscasecmp;
-    wcscasecmp_l; # introduced=23
-    wcscat;
-    wcschr;
-    wcscmp;
-    wcscoll;
-    wcscoll_l; # introduced=21
-    wcscpy;
-    wcscspn;
-    wcsdup;
-    wcsftime;
-    wcslcat;
-    wcslcpy;
-    wcslen;
-    wcsncasecmp;
-    wcsncasecmp_l; # introduced=23
-    wcsncat;
-    wcsncmp;
-    wcsncpy;
-    wcsnlen;
-    wcsnrtombs; # introduced=21
-    wcspbrk;
-    wcsrchr;
-    wcsrtombs;
-    wcsspn;
-    wcsstr;
-    wcstod;
-    wcstof; # introduced=21
-    wcstoimax; # introduced=21
-    wcstok;
-    wcstol;
-    wcstold; # introduced=21
-    wcstold_l; # introduced=21
-    wcstoll; # introduced=21
-    wcstoll_l; # introduced=21
-    wcstombs;
-    wcstoul;
-    wcstoull; # introduced=21
-    wcstoull_l; # introduced=21
-    wcstoumax; # introduced=21
-    wcswidth;
-    wcsxfrm;
-    wcsxfrm_l; # introduced=21
-    wctob;
-    wctomb; # introduced=21
-    wctype;
-    wctype_l; # introduced=21
-    wcwidth;
-    wmemchr;
-    wmemcmp;
-    wmemcpy;
-    wmemmove;
-    wmempcpy; # introduced=23
-    wmemset;
-    wprintf;
-    write;
-    writev;
-    wscanf;
-  local:
-    *;
-};
-
-LIBC_N { # introduced-arm64=24 introduced-mips=24 introduced-mips64=24 introduced-x86=24 introduced-x86_64=24
-  global:
-    __fread_chk; # introduced=24
-    __fwrite_chk; # introduced=24
-    __getcwd_chk; # introduced=24
-    __pwrite_chk; # introduced=24
-    __pwrite64_chk; # introduced=24
-    __write_chk; # introduced=24
-    adjtimex; # introduced=24
-    clock_adjtime; # introduced=24
-    fgetpos64; # introduced=24
-    fileno_unlocked; # introduced=24
-    fopen64; # introduced=24
-    freeifaddrs; # introduced=24
-    freopen64; # introduced=24
-    fseeko64; # introduced=24
-    fsetpos64; # introduced=24
-    ftello64; # introduced=24
-    funopen64; # introduced=24
-    getgrgid_r; # introduced=24
-    getgrnam_r; # introduced=24
-    getifaddrs; # introduced=24
-    if_freenameindex; # introduced=24
-    if_nameindex; # introduced=24
-    in6addr_any; # var introduced=24
-    in6addr_loopback; # var introduced=24
-    lockf; # introduced=24
-    lockf64; # introduced=24
-    preadv; # introduced=24
-    preadv64; # introduced=24
-    pthread_barrierattr_destroy; # introduced=24
-    pthread_barrierattr_getpshared; # introduced=24
-    pthread_barrierattr_init; # introduced=24
-    pthread_barrierattr_setpshared; # introduced=24
-    pthread_barrier_destroy; # introduced=24
-    pthread_barrier_init; # introduced=24
-    pthread_barrier_wait; # introduced=24
-    pthread_spin_destroy; # introduced=24
-    pthread_spin_init; # introduced=24
-    pthread_spin_lock; # introduced=24
-    pthread_spin_trylock; # introduced=24
-    pthread_spin_unlock; # introduced=24
-    pwritev; # introduced=24
-    pwritev64; # introduced=24
-    scandirat; # introduced=24
-    scandirat64; # introduced=24
-    strchrnul; # introduced=24
-    tmpfile64; # introduced=24
-} LIBC;
-
-LIBC_O {
-  global:
-    __sendto_chk; # introduced=26
-    __system_property_read_callback; # introduced=26
-    __system_property_wait; # introduced=26
-    catclose; # introduced=26
-    catgets; # introduced=26
-    catopen; # introduced=26
-    ctermid; # introduced=26
-    endgrent; # introduced=26
-    endpwent; # introduced=26
-    futimes; # introduced=26
-    futimesat; # introduced=26
-    getdomainname; # introduced=26
-    getgrent; # introduced=26
-    getpwent; # introduced=26
-    getsubopt; # introduced=26
-    hasmntopt; # introduced=26
-    lutimes; # introduced=26
-    mallopt; # introduced=26
-    mblen; # introduced=26
-    msgctl; # introduced=26
-    msgget; # introduced=26
-    msgrcv; # introduced=26
-    msgsnd; # introduced=26
-    nl_langinfo; # introduced=26
-    nl_langinfo_l; # introduced=26
-    pthread_getname_np; # introduced=26
-    quotactl; # introduced=26
-    semctl; # introduced=26
-    semget; # introduced=26
-    semop; # introduced=26
-    semtimedop; # introduced=26
-    setdomainname; # introduced=26
-    setgrent; # introduced=26
-    setpwent; # introduced=26
-    shmat; # introduced=26
-    shmctl; # introduced=26
-    shmdt; # introduced=26
-    shmget; # introduced=26
-    sighold; # introduced=26
-    sigignore; # introduced=26
-    sigpause; # introduced=26
-    sigrelse; # introduced=26
-    sigset; # introduced=26
-    strtod_l; # introduced=26
-    strtof_l; # introduced=26
-    strtol_l; # introduced=26
-    strtoul_l; # introduced=26
-    sync_file_range; # introduced=26
-    towctrans; # introduced=26
-    towctrans_l; # introduced=26
-    wctrans; # introduced=26
-    wctrans_l; # introduced=26
-} LIBC_N;
-
-LIBC_P { # introduced=P
-  global:
-    __freading;
-    __free_hook;
-    __fseterr;
-    __fwriting;
-    __malloc_hook;
-    __memalign_hook;
-    __realloc_hook;
-    aligned_alloc;
-    endhostent;
-    endnetent;
-    endprotoent;
-    epoll_pwait64;
-    fexecve;
-    fflush_unlocked;
-    fgetc_unlocked;
-    fgets_unlocked;
-    fputc_unlocked;
-    fputs_unlocked;
-    fread_unlocked;
-    fwrite_unlocked;
-    getentropy;
-    getnetent;
-    getprotoent;
-    getrandom;
-    getlogin_r;
-    glob;
-    globfree;
-    hcreate;
-    hcreate_r;
-    hdestroy;
-    hdestroy_r;
-    hsearch;
-    hsearch_r;
-    iconv;
-    iconv_close;
-    iconv_open;
-    posix_spawn;
-    posix_spawnattr_destroy;
-    posix_spawnattr_getflags;
-    posix_spawnattr_getpgroup;
-    posix_spawnattr_getschedparam;
-    posix_spawnattr_getschedpolicy;
-    posix_spawnattr_getsigdefault;
-    posix_spawnattr_getsigdefault64;
-    posix_spawnattr_getsigmask;
-    posix_spawnattr_getsigmask64;
-    posix_spawnattr_init;
-    posix_spawnattr_setflags;
-    posix_spawnattr_setpgroup;
-    posix_spawnattr_setschedparam;
-    posix_spawnattr_setschedpolicy;
-    posix_spawnattr_setsigdefault;
-    posix_spawnattr_setsigdefault64;
-    posix_spawnattr_setsigmask;
-    posix_spawnattr_setsigmask64;
-    posix_spawn_file_actions_addclose;
-    posix_spawn_file_actions_adddup2;
-    posix_spawn_file_actions_addopen;
-    posix_spawn_file_actions_destroy;
-    posix_spawn_file_actions_init;
-    posix_spawnp;
-    ppoll64;
-    pselect64;
-    pthread_attr_getinheritsched;
-    pthread_attr_setinheritsched;
-    pthread_mutex_timedlock_monotonic_np;
-    pthread_mutexattr_getprotocol;
-    pthread_mutexattr_setprotocol;
-    pthread_rwlock_timedrdlock_monotonic_np;
-    pthread_rwlock_timedwrlock_monotonic_np;
-    pthread_setschedprio;
-    pthread_sigmask64;
-    sem_timedwait_monotonic_np;
-    sethostent;
-    setnetent;
-    setprotoent;
-    sigaction64;
-    sigaddset64;
-    sigdelset64;
-    sigemptyset64;
-    sigfillset64;
-    sigismember64;
-    signalfd64;
-    sigpending64;
-    sigprocmask64;
-    sigsuspend64;
-    sigtimedwait64;
-    sigwait64;
-    sigwaitinfo64;
-    strptime_l;
-    swab;
-    syncfs;
-    wcsftime_l;
-    wcstod_l;
-    wcstof_l;
-    wcstol_l;
-    wcstoul_l;
-} LIBC_O;
-
-LIBC_Q { # introduced=Q
-  global:
-    __res_randomid;
-    android_fdsan_close_with_tag;
-    android_fdsan_create_owner_tag;
-    android_fdsan_exchange_owner_tag;
-    android_fdsan_get_owner_tag;
-    android_fdsan_get_tag_type;
-    android_fdsan_get_tag_value;
-    android_fdsan_get_error_level;
-    android_fdsan_set_error_level;
-    android_get_device_api_level;
-    getloadavg;
-    pthread_sigqueue;
-    reallocarray;
-    timespec_get;
-} LIBC_P;
-
-LIBC_PRIVATE {
-  global:
-    android_getaddrinfofornet;
-    android_getaddrinfofornetcontext;
-    android_gethostbyaddrfornet;
-    android_gethostbyaddrfornetcontext;
-    android_gethostbynamefornet;
-    android_gethostbynamefornetcontext;
-    free_malloc_leak_info;
-    get_malloc_leak_info;
-    gMallocLeakZygoteChild;
-    write_malloc_leak_info;
-} LIBC_Q;
-
-LIBC_DEPRECATED {
-  global:
-    __system_property_wait_any;
-};
-
-LIBC_PLATFORM {
-  global:
-    __system_properties_init;
-    __system_property_area__; # var
-    __system_property_add;
-    __system_property_area_init;
-    __system_property_set_filename;
-    __system_property_update;
-    android_fdsan_get_fd_table;
-    android_net_res_stats_get_info_for_net;
-    android_net_res_stats_aggregate;
-    android_net_res_stats_get_usable_servers;
-    malloc_backtrace;
-    malloc_disable;
-    malloc_enable;
-    malloc_iterate;
-} LIBC_Q;
diff --git a/libc/libc.map.txt b/libc/libc.map.txt
index 934ad1f..55ca9dc 100644
--- a/libc/libc.map.txt
+++ b/libc/libc.map.txt
@@ -207,7 +207,6 @@
     _ctype_; # var
     _Exit; # introduced=21
     _exit;
-    _flush_cache; # mips
     _flushlbf; # introduced=23
     _getlong;
     _getshort;
@@ -1447,20 +1446,43 @@
 
 LIBC_Q { # introduced=Q
   global:
+    ___tls_get_addr; # x86
+    __aeabi_read_tp; # arm
     __res_randomid;
+    __tls_get_addr; # arm x86_64
     android_fdsan_close_with_tag;
     android_fdsan_create_owner_tag;
     android_fdsan_exchange_owner_tag;
+    android_fdsan_get_error_level;
     android_fdsan_get_owner_tag;
     android_fdsan_get_tag_type;
     android_fdsan_get_tag_value;
-    android_fdsan_get_error_level;
     android_fdsan_set_error_level;
     android_get_device_api_level;
     getloadavg;
     pthread_sigqueue;
     reallocarray;
     timespec_get;
+
+    # Used by libselinux
+    __system_properties_init; # apex
+
+    # Used by libmemunreachable
+    malloc_backtrace; # apex
+    malloc_disable; # apex
+    malloc_enable; # apex
+    malloc_iterate; # apex
+
+    # Used by libmediautils
+    write_malloc_leak_info; # apex
+    free_malloc_leak_info; # apex
+    get_malloc_leak_info; # apex
+
+    # Used by libandroid_net
+    android_getaddrinfofornet; # apex
+
+    # Used by libandroid_runtime and libmedia
+    android_mallopt; # apex
 } LIBC_P;
 
 LIBC_PRIVATE {
@@ -1477,8 +1499,12 @@
     __aeabi_cdcmpeq; # arm
     __aeabi_cdcmple; # arm
     __aeabi_cdrcmple; # arm
+    __aeabi_cfcmpeq; # arm
+    __aeabi_cfcmple; # arm
+    __aeabi_cfrcmple; # arm
     __aeabi_d2f; # arm
     __aeabi_d2iz; # arm
+    __aeabi_d2uiz; # arm
     __aeabi_dadd; # arm
     __aeabi_dcmpeq; # arm
     __aeabi_dcmpge; # arm
@@ -1494,6 +1520,11 @@
     __aeabi_f2iz; # arm
     __aeabi_f2uiz; # arm
     __aeabi_fadd; # arm
+    __aeabi_fcmpeq; # arm
+    __aeabi_fcmpge; # arm
+    __aeabi_fcmpgt; # arm
+    __aeabi_fcmple; # arm
+    __aeabi_fcmplt; # arm
     __aeabi_fcmpun; # arm
     __aeabi_fdiv; # arm
     __aeabi_fmul; # arm
@@ -1538,17 +1569,20 @@
     __ashldi3; # arm
     __ashrdi3; # arm
     __bionic_brk; # arm x86 mips
-    __bionic_libgcc_compat_symbols; # arm x86
+    __bionic_libcrt_compat_symbols; # arm x86
     __cmpdf2; # arm
+    __cmpsf2; # arm
     __divdf3; # arm
     __divdi3; # arm x86 mips
     __divsf3; # arm
     __divsi3; # arm
     __dso_handle; # arm
     __eqdf2; # arm
+    __eqsf2; # arm
     __extendsfdf2; # arm
     __fixdfsi; # arm
     __fixsfsi; # arm
+    __fixunsdfsi; # arm
     __fixunssfsi; # arm
     __floatdidf; # arm
     __floatdisf; # arm
@@ -1561,6 +1595,7 @@
     __futex_wait; # arm x86 mips
     __futex_wake; # arm x86 mips
     __gedf2; # arm
+    __gesf2; # arm
     __get_thread; # arm x86 mips
     __get_tls; # arm x86 mips
     __getdents64; # arm x86 mips
@@ -1585,13 +1620,17 @@
     __gnu_Unwind_Save_WMMXC; # arm
     __gnu_Unwind_Save_WMMXD; # arm
     __gtdf2; # arm
+    __gtsf2; # arm
     __ledf2; # arm
+    __lesf2; # arm
     __lshrdi3; # arm
     __ltdf2; # arm
+    __ltsf2; # arm
     __muldf3; # arm
     __muldi3; # arm
     __mulsf3; # arm
     __nedf2; # arm
+    __nesf2; # arm
     __open; # arm x86 mips
     __page_shift; # arm x86 mips
     __page_size; # arm x86 mips
@@ -1640,7 +1679,6 @@
     _Unwind_VRS_Get; # arm
     _Unwind_VRS_Pop; # arm
     _Unwind_VRS_Set; # arm
-    android_getaddrinfofornet;
     android_getaddrinfofornetcontext;
     android_gethostbyaddrfornet;
     android_gethostbyaddrfornetcontext;
@@ -1655,12 +1693,9 @@
     dlmalloc_inspect_all; # arm x86 mips
     dlmalloc_trim; # arm x86 mips
     dlmalloc_usable_size; # arm x86 mips
-    free_malloc_leak_info;
     ftime; # arm x86 mips
-    get_malloc_leak_info;
     getdents; # arm x86 mips
     getdtablesize; # arm x86 mips
-    gMallocLeakZygoteChild;
     index; # arm x86 mips
     issetugid; # arm x86 mips
     memswap; # arm x86 mips
@@ -1678,7 +1713,6 @@
     tkill; # arm x86 mips
     wait3; # arm x86 mips
     wcswcs; # arm x86 mips
-    write_malloc_leak_info;
 } LIBC_Q;
 
 LIBC_DEPRECATED {
@@ -1688,9 +1722,8 @@
 
 LIBC_PLATFORM {
   global:
-    __system_properties_init;
-    __system_property_area__; # var
     __system_property_add;
+    __system_property_area__; # var
     __system_property_area_init;
     __system_property_set_filename;
     __system_property_update;
@@ -1698,8 +1731,4 @@
     android_net_res_stats_get_info_for_net;
     android_net_res_stats_aggregate;
     android_net_res_stats_get_usable_servers;
-    malloc_backtrace;
-    malloc_disable;
-    malloc_enable;
-    malloc_iterate;
 } LIBC_Q;
diff --git a/libc/libc.mips.map b/libc/libc.mips.map
deleted file mode 100644
index dc184a6..0000000
--- a/libc/libc.mips.map
+++ /dev/null
@@ -1,1520 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __assert;
-    __assert2;
-    __b64_ntop;
-    __b64_pton;
-    __cmsg_nxthdr; # introduced=21
-    __connect; # arm x86 mips introduced=21
-    __ctype_get_mb_cur_max; # introduced=21
-    __cxa_atexit;
-    __cxa_finalize;
-    __cxa_thread_atexit_impl; # introduced=23
-    __dn_comp;
-    __dn_count_labels;
-    __dn_skipname;
-    __epoll_pwait; # arm x86 mips introduced=21
-    __errno;
-    __exit; # arm x86 mips introduced=21
-    __fadvise64; # x86 mips introduced=21
-    __fbufsize; # introduced=23
-    __fcntl64; # arm x86 mips
-    __FD_CLR_chk; # introduced=21
-    __FD_ISSET_chk; # introduced=21
-    __FD_SET_chk; # introduced=21
-    __fgets_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __flbf; # introduced=23
-    __fp_nquery;
-    __fp_query;
-    __fpclassify; # introduced=21
-    __fpclassifyd;
-    __fpclassifyf;
-    __fpclassifyl;
-    __fpending; # introduced=23
-    __fpurge; # introduced=23
-    __freadable; # introduced=23
-    __fsetlocking; # introduced=23
-    __fstatfs64; # arm x86 mips
-    __fwritable; # introduced=23
-    __get_h_errno;
-    __getcpu; # arm x86 mips introduced-arm=12 introduced-mips=16 introduced-x86=12
-    __getcwd; # arm x86 mips
-    __getpid; # arm x86 mips introduced=21
-    __getpriority; # arm x86 mips
-    __gnu_basename; # introduced=23
-    __gnu_strerror_r; # introduced=23
-    __hostalias;
-    __ioctl; # arm x86 mips
-    __isfinite;
-    __isfinitef;
-    __isfinitel;
-    __isinf;
-    __isinff;
-    __isinfl;
-    __isnan; # introduced=21
-    __isnanf; # introduced=21
-    __isnanl;
-    __isnormal;
-    __isnormalf;
-    __isnormall;
-    __isthreaded; # arm x86 mips var
-    __libc_current_sigrtmax; # introduced=21
-    __libc_current_sigrtmin; # introduced=21
-    __libc_init;
-    __llseek; # arm x86 mips
-    __loc_aton;
-    __loc_ntoa;
-    __memchr_chk; # introduced=23
-    __memcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memmove_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memrchr_chk; # introduced=23
-    __memset_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __mmap2; # arm x86 mips
-    __ns_format_ttl; # arm x86 mips
-    __ns_get16; # arm x86 mips
-    __ns_get32; # arm x86 mips
-    __ns_initparse; # arm x86 mips
-    __ns_makecanon; # arm x86 mips
-    __ns_msg_getflag; # arm x86 mips
-    __ns_name_compress; # arm x86 mips
-    __ns_name_ntol; # arm x86 mips
-    __ns_name_ntop; # arm x86 mips
-    __ns_name_pack; # arm x86 mips
-    __ns_name_pton; # arm x86 mips
-    __ns_name_rollback; # arm x86 mips
-    __ns_name_skip; # arm x86 mips
-    __ns_name_uncompress; # arm x86 mips
-    __ns_name_unpack; # arm x86 mips
-    __ns_parserr; # arm x86 mips
-    __ns_put16; # arm x86 mips
-    __ns_put32; # arm x86 mips
-    __ns_samename; # arm x86 mips
-    __ns_skiprr; # arm x86 mips
-    __ns_sprintrr; # arm x86 mips
-    __ns_sprintrrf; # arm x86 mips
-    __open_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __openat; # arm x86 mips
-    __openat_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __p_cdname;
-    __p_cdnname;
-    __p_class;
-    __p_class_syms; # var
-    __p_fqname;
-    __p_fqnname;
-    __p_option;
-    __p_query;
-    __p_rcode;
-    __p_secstodate;
-    __p_time;
-    __p_type;
-    __p_type_syms; # var
-    __poll_chk; # introduced=23
-    __ppoll; # arm x86 mips introduced=21
-    __ppoll_chk; # introduced=23
-    __ppoll64_chk; # introduced=28
-    __pread64_chk; # introduced=23
-    __pread_chk; # introduced=23
-    __progname; # var
-    __pselect6; # arm x86 mips introduced=21
-    __pthread_cleanup_pop;
-    __pthread_cleanup_push;
-    __ptrace; # arm x86 mips
-    __putlong;
-    __putshort;
-    __read_chk; # introduced=21
-    __readlink_chk; # introduced=23
-    __readlinkat_chk; # introduced=23
-    __reboot; # arm x86 mips
-    __recvfrom_chk; # introduced=21
-    __register_atfork; # introduced=23
-    __res_close;
-    __res_dnok;
-    __res_hnok;
-    __res_hostalias;
-    __res_isourserver;
-    __res_mailok;
-    __res_nameinquery;
-    __res_nclose;
-    __res_ninit;
-    __res_nmkquery;
-    __res_nquery;
-    __res_nquerydomain;
-    __res_nsearch;
-    __res_nsend;
-    __res_ownok;
-    __res_queriesmatch;
-    __res_querydomain;
-    __res_send;
-    __res_send_setqhook;
-    __res_send_setrhook;
-    __rt_sigaction; # arm x86 mips
-    __rt_sigpending; # arm x86 mips introduced=21
-    __rt_sigprocmask; # arm x86 mips
-    __rt_sigsuspend; # arm x86 mips introduced=21
-    __rt_sigtimedwait; # arm x86 mips
-    __sched_cpualloc; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpucount; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpufree; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_getaffinity; # arm x86 mips introduced=12
-    __set_tid_address; # arm x86 mips introduced=21
-    __set_tls; # arm mips
-    __sF; # var
-    __sigaction; # arm x86 mips introduced=21
-    __snprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __socket; # arm x86 mips introduced=21
-    __sprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __stack_chk_fail;
-    __stack_chk_guard; # var
-    __statfs64; # arm x86 mips
-    __stpcpy_chk; # introduced=21
-    __stpncpy_chk; # introduced=21
-    __stpncpy_chk2; # introduced=21
-    __strcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __strcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlen_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk2; # introduced=21
-    __strrchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __sym_ntop;
-    __sym_ntos;
-    __sym_ston;
-    __system_property_area_serial; # introduced=23
-    __system_property_find;
-    __system_property_find_nth;
-    __system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_get;
-    __system_property_read;
-    __system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __timer_create; # arm x86 mips
-    __timer_delete; # arm x86 mips
-    __timer_getoverrun; # arm x86 mips
-    __timer_gettime; # arm x86 mips
-    __timer_settime; # arm x86 mips
-    __umask_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __vsnprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __vsprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __waitid; # arm x86 mips
-    _ctype_; # var
-    _Exit; # introduced=21
-    _exit;
-    _flush_cache; # mips
-    _flushlbf; # introduced=23
-    _getlong;
-    _getshort;
-    _longjmp;
-    _resolv_delete_cache_for_net; # introduced=21
-    _resolv_flush_cache_for_net; # introduced=21
-    _resolv_set_nameservers_for_net; # introduced=21
-    _setjmp;
-    _tolower; # introduced=21
-    _tolower_tab_; # arm x86 mips var
-    _toupper; # introduced=21
-    _toupper_tab_; # arm x86 mips var
-    abort;
-    abs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    accept;
-    accept4; # introduced=21
-    access;
-    acct;
-    alarm;
-    alphasort;
-    alphasort64; # introduced=21
-    android_set_abort_message; # introduced=21
-    arc4random;
-    arc4random_buf;
-    arc4random_uniform;
-    asctime;
-    asctime64; # arm x86 mips
-    asctime64_r; # arm x86 mips
-    asctime_r;
-    asprintf;
-    at_quick_exit; # introduced=21
-    atof; # introduced=21
-    atoi;
-    atol;
-    atoll;
-    basename;
-    basename_r; # arm x86 mips
-    bind;
-    bindresvport;
-    brk;
-    bsearch;
-    btowc;
-    c16rtomb; # introduced=21
-    c32rtomb; # introduced=21
-    cacheflush; # arm mips
-    calloc;
-    capget;
-    capset;
-    cfgetispeed; # introduced=21
-    cfgetospeed; # introduced=21
-    cfmakeraw; # introduced=21
-    cfsetispeed; # introduced=21
-    cfsetospeed; # introduced=21
-    cfsetspeed; # introduced=21
-    chdir;
-    chmod;
-    chown;
-    chroot;
-    clearenv;
-    clearerr;
-    clearerr_unlocked; # introduced=23
-    clock;
-    clock_getcpuclockid; # introduced=23
-    clock_getres;
-    clock_gettime;
-    clock_nanosleep;
-    clock_settime;
-    clone; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    close;
-    closedir;
-    closelog;
-    connect;
-    creat;
-    creat64; # introduced=21
-    ctime;
-    ctime64; # arm x86 mips
-    ctime64_r; # arm x86 mips
-    ctime_r;
-    daemon;
-    daylight; # var
-    delete_module;
-    difftime;
-    dirfd;
-    dirname;
-    dirname_r; # arm x86 mips
-    div;
-    dn_expand;
-    dprintf; # introduced=21
-    drand48;
-    dup;
-    dup2;
-    dup3; # introduced=21
-    duplocale; # introduced=21
-    endmntent; # introduced=21
-    endservent;
-    endutent;
-    environ; # var
-    epoll_create;
-    epoll_create1; # introduced=21
-    epoll_ctl;
-    epoll_pwait; # introduced=21
-    epoll_wait;
-    erand48;
-    err;
-    error; # introduced=23
-    error_at_line; # introduced=23
-    error_message_count; # var introduced=23
-    error_one_per_line; # var introduced=23
-    error_print_progname; # var introduced=23
-    errx;
-    ether_aton; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_aton_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    eventfd;
-    eventfd_read;
-    eventfd_write;
-    execl;
-    execle;
-    execlp;
-    execv;
-    execve;
-    execvp;
-    execvpe; # introduced=21
-    exit;
-    faccessat; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fallocate; # introduced=21
-    fallocate64; # introduced=21
-    fchdir;
-    fchmod;
-    fchmodat;
-    fchown;
-    fchownat;
-    fclose;
-    fcntl;
-    fdatasync;
-    fdopen;
-    fdopendir;
-    fdprintf; # arm x86 mips versioned=28
-    feof;
-    feof_unlocked; # introduced=23
-    ferror;
-    ferror_unlocked; # introduced=23
-    fflush;
-    ffs; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    fgetc;
-    fgetln;
-    fgetpos;
-    fgets;
-    fgetwc;
-    fgetws;
-    fgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fileno;
-    flistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    flock;
-    flockfile;
-    fmemopen; # introduced=23
-    fnmatch;
-    fopen;
-    fork;
-    forkpty; # introduced=23
-    fpathconf;
-    fprintf;
-    fpurge;
-    fputc;
-    fputs;
-    fputwc;
-    fputws;
-    fread;
-    free;
-    freeaddrinfo;
-    freelocale; # introduced=21
-    fremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    freopen;
-    fscanf;
-    fseek;
-    fseeko;
-    fsetpos;
-    fsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fstat;
-    fstat64; # introduced=21
-    fstatat;
-    fstatat64; # introduced=21
-    fstatfs;
-    fstatfs64; # introduced=21
-    fstatvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fstatvfs64; # introduced=21
-    fsync;
-    ftell;
-    ftello;
-    ftok;
-    ftruncate;
-    ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ftrylockfile;
-    fts_children; # introduced=21
-    fts_close; # introduced=21
-    fts_open; # introduced=21
-    fts_read; # introduced=21
-    fts_set; # introduced=21
-    ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    ftw64; # introduced=21
-    funlockfile;
-    funopen;
-    futimens; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fwide;
-    fwprintf;
-    fwrite;
-    fwscanf;
-    gai_strerror;
-    get_avphys_pages; # introduced=23
-    get_nprocs; # introduced=23
-    get_nprocs_conf; # introduced=23
-    get_phys_pages; # introduced=23
-    getaddrinfo;
-    getauxval; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getc;
-    getc_unlocked;
-    getchar;
-    getchar_unlocked;
-    getcwd;
-    getdelim; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getegid;
-    getenv;
-    geteuid;
-    getgid;
-    getgrgid;
-    getgrnam;
-    getgrouplist;
-    getgroups;
-    gethostbyaddr;
-    gethostbyaddr_r; # introduced=23
-    gethostbyname;
-    gethostbyname2;
-    gethostbyname2_r; # introduced=23
-    gethostbyname_r;
-    gethostent;
-    gethostname;
-    getitimer;
-    getline; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getlogin;
-    getmntent;
-    getmntent_r; # introduced=21
-    getnameinfo;
-    getnetbyaddr;
-    getnetbyname;
-    getopt;
-    getopt_long;
-    getopt_long_only;
-    getpagesize; # introduced=21
-    getpeername;
-    getpgid;
-    getpgrp;
-    getpid;
-    getppid;
-    getpriority;
-    getprogname; # introduced=21
-    getprotobyname;
-    getprotobynumber;
-    getpt;
-    getpwnam;
-    getpwnam_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getpwuid;
-    getpwuid_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getresgid;
-    getresuid;
-    getrlimit;
-    getrlimit64; # introduced=21
-    getrusage;
-    gets;
-    getservbyname;
-    getservbyport;
-    getservent;
-    getsid; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    getsockname;
-    getsockopt;
-    gettid;
-    gettimeofday;
-    getuid;
-    getutent;
-    getwc;
-    getwchar;
-    getxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    gmtime;
-    gmtime64; # arm x86 mips
-    gmtime64_r; # arm x86 mips
-    gmtime_r;
-    grantpt; # introduced=21
-    herror;
-    hstrerror;
-    htonl; # introduced=21
-    htons; # introduced=21
-    if_indextoname;
-    if_nametoindex;
-    imaxabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    imaxdiv; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    inet_addr;
-    inet_aton;
-    inet_lnaof; # introduced=21
-    inet_makeaddr; # introduced=21
-    inet_netof; # introduced=21
-    inet_network; # introduced=21
-    inet_nsap_addr;
-    inet_nsap_ntoa;
-    inet_ntoa;
-    inet_ntop;
-    inet_pton;
-    init_module;
-    initgroups;
-    initstate; # introduced=21
-    inotify_add_watch;
-    inotify_init;
-    inotify_init1; # introduced=21
-    inotify_rm_watch;
-    insque; # introduced=21
-    ioctl;
-    isalnum;
-    isalnum_l; # introduced=21
-    isalpha;
-    isalpha_l; # introduced=21
-    isascii;
-    isatty;
-    isblank;
-    isblank_l; # introduced=21
-    iscntrl;
-    iscntrl_l; # introduced=21
-    isdigit;
-    isdigit_l; # introduced=21
-    isfinite; # introduced=21
-    isfinitef; # introduced=21
-    isfinitel; # introduced=21
-    isgraph;
-    isgraph_l; # introduced=21
-    isinf; # introduced=21
-    isinff; # introduced=21
-    isinfl; # introduced=21
-    islower;
-    islower_l; # introduced=21
-    isnan;
-    isnanf;
-    isnanl; # introduced=21
-    isnormal; # introduced=21
-    isnormalf; # introduced=21
-    isnormall; # introduced=21
-    isprint;
-    isprint_l; # introduced=21
-    ispunct;
-    ispunct_l; # introduced=21
-    isspace;
-    isspace_l; # introduced=21
-    isupper;
-    isupper_l; # introduced=21
-    iswalnum;
-    iswalnum_l; # introduced=21
-    iswalpha;
-    iswalpha_l; # introduced=21
-    iswblank; # introduced=21
-    iswblank_l; # introduced=21
-    iswcntrl;
-    iswcntrl_l; # introduced=21
-    iswctype;
-    iswctype_l; # introduced=21
-    iswdigit;
-    iswdigit_l; # introduced=21
-    iswgraph;
-    iswgraph_l; # introduced=21
-    iswlower;
-    iswlower_l; # introduced=21
-    iswprint;
-    iswprint_l; # introduced=21
-    iswpunct;
-    iswpunct_l; # introduced=21
-    iswspace;
-    iswspace_l; # introduced=21
-    iswupper;
-    iswupper_l; # introduced=21
-    iswxdigit;
-    iswxdigit_l; # introduced=21
-    isxdigit;
-    isxdigit_l; # introduced=21
-    jrand48;
-    kill;
-    killpg;
-    klogctl;
-    labs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lchown;
-    lcong48; # introduced=23
-    ldexp;
-    ldiv;
-    lfind; # introduced=21
-    lgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    link;
-    linkat; # introduced=21
-    listen;
-    listxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    llabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lldiv;
-    llistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    localeconv; # introduced=21
-    localtime;
-    localtime64; # arm x86 mips
-    localtime64_r; # arm x86 mips
-    localtime_r;
-    login_tty; # introduced=23
-    longjmp;
-    lrand48;
-    lremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lsearch; # introduced=21
-    lseek;
-    lseek64;
-    lsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lstat;
-    lstat64; # introduced=21
-    madvise;
-    mallinfo;
-    malloc;
-    malloc_info; # introduced=23
-    malloc_usable_size; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mbrlen;
-    mbrtoc16; # introduced=21
-    mbrtoc32; # introduced=21
-    mbrtowc;
-    mbsinit;
-    mbsnrtowcs; # introduced=21
-    mbsrtowcs;
-    mbstowcs;
-    mbtowc; # introduced=21
-    memalign;
-    memccpy;
-    memchr;
-    memcmp;
-    memcpy;
-    memmem;
-    memmove;
-    mempcpy; # introduced=23
-    memrchr;
-    memset;
-    mincore;
-    mkdir;
-    mkdirat;
-    mkdtemp;
-    mkfifo; # introduced=21
-    mkfifoat; # introduced=23
-    mknod;
-    mknodat; # introduced=21
-    mkostemp; # introduced=23
-    mkostemp64; # introduced=23
-    mkostemps; # introduced=23
-    mkostemps64; # introduced=23
-    mkstemp;
-    mkstemp64; # introduced=21
-    mkstemps;
-    mkstemps64; # introduced=23
-    mktemp;
-    mktime;
-    mktime64; # arm x86 mips
-    mlock;
-    mlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mmap;
-    mmap64; # introduced=21
-    mount;
-    mprotect;
-    mrand48;
-    mremap;
-    msync;
-    munlock;
-    munlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    munmap;
-    nanosleep;
-    newlocale; # introduced=21
-    nftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    nftw64; # introduced=21
-    nice;
-    nrand48;
-    nsdispatch;
-    ntohl; # introduced=21
-    ntohs; # introduced=21
-    open;
-    open64; # introduced=21
-    open_memstream; # introduced=23
-    open_wmemstream; # introduced=23
-    openat;
-    openat64; # introduced=21
-    opendir;
-    openlog;
-    openpty; # introduced=23
-    optarg; # var
-    opterr; # var
-    optind; # var
-    optopt; # var
-    optreset; # var
-    pathconf;
-    pause;
-    pclose;
-    perror;
-    personality; # introduced-arm=15 introduced-arm64=21 introduced-mips=15 introduced-mips64=21 introduced-x86=15 introduced-x86_64=21
-    pipe;
-    pipe2;
-    poll;
-    popen;
-    posix_fadvise; # introduced=21
-    posix_fadvise64; # introduced=21
-    posix_fallocate; # introduced=21
-    posix_fallocate64; # introduced=21
-    posix_madvise; # introduced=23
-    posix_memalign; # introduced=17
-    posix_openpt; # introduced=21
-    ppoll; # introduced=21
-    prctl;
-    pread;
-    pread64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    printf;
-    prlimit64; # introduced=21
-    process_vm_readv; # introduced=23
-    process_vm_writev; # introduced=23
-    pselect;
-    psiginfo; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    psignal; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    pthread_atfork; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    pthread_attr_destroy;
-    pthread_attr_getdetachstate;
-    pthread_attr_getguardsize;
-    pthread_attr_getschedparam;
-    pthread_attr_getschedpolicy;
-    pthread_attr_getscope;
-    pthread_attr_getstack;
-    pthread_attr_getstacksize;
-    pthread_attr_init;
-    pthread_attr_setdetachstate;
-    pthread_attr_setguardsize;
-    pthread_attr_setschedparam;
-    pthread_attr_setschedpolicy;
-    pthread_attr_setscope;
-    pthread_attr_setstack;
-    pthread_attr_setstacksize;
-    pthread_cond_broadcast;
-    pthread_cond_destroy;
-    pthread_cond_init;
-    pthread_cond_signal;
-    pthread_cond_timedwait;
-    pthread_cond_timedwait_monotonic; # arm x86 mips
-    pthread_cond_timedwait_monotonic_np; # introduced-arm=9 introduced-x86=9 introduced-mips=9 introduced-arm64=28 introduced-x64_64=28 introduced-mips64=28
-    pthread_cond_timedwait_relative_np; # arm x86 mips
-    pthread_cond_timeout_np; # arm x86 mips
-    pthread_cond_wait;
-    pthread_condattr_destroy;
-    pthread_condattr_getclock; # introduced=21
-    pthread_condattr_getpshared;
-    pthread_condattr_init;
-    pthread_condattr_setclock; # introduced=21
-    pthread_condattr_setpshared;
-    pthread_create;
-    pthread_detach;
-    pthread_equal;
-    pthread_exit;
-    pthread_getattr_np;
-    pthread_getcpuclockid;
-    pthread_getschedparam;
-    pthread_getspecific;
-    pthread_gettid_np; # introduced=21
-    pthread_join;
-    pthread_key_create;
-    pthread_key_delete;
-    pthread_kill;
-    pthread_mutex_destroy;
-    pthread_mutex_init;
-    pthread_mutex_lock;
-    pthread_mutex_lock_timeout_np; # arm x86 mips
-    pthread_mutex_timedlock; # introduced=21
-    pthread_mutex_trylock;
-    pthread_mutex_unlock;
-    pthread_mutexattr_destroy;
-    pthread_mutexattr_getpshared;
-    pthread_mutexattr_gettype;
-    pthread_mutexattr_init;
-    pthread_mutexattr_setpshared;
-    pthread_mutexattr_settype;
-    pthread_once;
-    pthread_rwlock_destroy;
-    pthread_rwlock_init;
-    pthread_rwlock_rdlock;
-    pthread_rwlock_timedrdlock;
-    pthread_rwlock_timedwrlock;
-    pthread_rwlock_tryrdlock;
-    pthread_rwlock_trywrlock;
-    pthread_rwlock_unlock;
-    pthread_rwlock_wrlock;
-    pthread_rwlockattr_destroy;
-    pthread_rwlockattr_getkind_np; # introduced=23
-    pthread_rwlockattr_getpshared;
-    pthread_rwlockattr_init;
-    pthread_rwlockattr_setkind_np; # introduced=23
-    pthread_rwlockattr_setpshared;
-    pthread_self;
-    pthread_setname_np;
-    pthread_setschedparam;
-    pthread_setspecific;
-    pthread_sigmask;
-    ptrace;
-    ptsname;
-    ptsname_r;
-    putc;
-    putc_unlocked;
-    putchar;
-    putchar_unlocked;
-    putenv;
-    puts;
-    pututline;
-    putw; # arm x86 mips
-    putwc;
-    putwchar;
-    pvalloc; # arm x86 mips introduced=17
-    pwrite;
-    pwrite64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    qsort;
-    quick_exit; # introduced=21
-    raise;
-    rand; # introduced=21
-    rand_r; # introduced=21
-    random; # introduced=21
-    read;
-    readahead; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    readdir;
-    readdir64; # introduced=21
-    readdir64_r; # introduced=21
-    readdir_r;
-    readlink;
-    readlinkat; # introduced=21
-    readv;
-    realloc;
-    realpath;
-    reboot;
-    recv;
-    recvfrom;
-    recvmmsg; # introduced=21
-    recvmsg;
-    regcomp;
-    regerror;
-    regexec;
-    regfree;
-    remove;
-    removexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    remque; # introduced=21
-    rename;
-    renameat;
-    res_init;
-    res_mkquery;
-    res_query;
-    res_search;
-    rewind;
-    rewinddir;
-    rmdir;
-    sbrk;
-    scandir;
-    scandir64; # introduced=21
-    scanf;
-    sched_get_priority_max;
-    sched_get_priority_min;
-    sched_getaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getcpu; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getparam;
-    sched_getscheduler;
-    sched_rr_get_interval;
-    sched_setaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_setparam;
-    sched_setscheduler;
-    sched_yield;
-    seed48;
-    seekdir; # introduced=23
-    select;
-    sem_close;
-    sem_destroy;
-    sem_getvalue;
-    sem_init;
-    sem_open;
-    sem_post;
-    sem_timedwait;
-    sem_trywait;
-    sem_unlink;
-    sem_wait;
-    send;
-    sendfile;
-    sendfile64; # introduced=21
-    sendmmsg; # introduced=21
-    sendmsg;
-    sendto;
-    setbuf;
-    setbuffer;
-    setegid;
-    setenv;
-    seteuid;
-    setfsgid; # introduced=21
-    setfsuid; # introduced=21
-    setgid;
-    setgroups;
-    sethostname; # introduced=23
-    setitimer;
-    setjmp;
-    setlinebuf;
-    setlocale;
-    setlogmask;
-    setmntent; # introduced=21
-    setns; # introduced=21
-    setpgid;
-    setpgrp;
-    setpriority;
-    setprogname; # introduced=21
-    setregid;
-    setresgid;
-    setresuid;
-    setreuid;
-    setrlimit;
-    setrlimit64; # introduced=21
-    setservent;
-    setsid;
-    setsockopt;
-    setstate; # introduced=21
-    settimeofday;
-    setuid;
-    setutent;
-    setvbuf;
-    setxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    shutdown;
-    sigaction;
-    sigaddset; # introduced=21
-    sigaltstack;
-    sigblock;
-    sigdelset; # introduced=21
-    sigemptyset; # introduced=21
-    sigfillset; # introduced=21
-    siginterrupt;
-    sigismember; # introduced=21
-    siglongjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    signal; # introduced=21
-    signalfd; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    sigpending;
-    sigprocmask;
-    sigqueue; # introduced=23
-    sigsetjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sigsetmask;
-    sigsuspend;
-    sigtimedwait; # introduced=23
-    sigwait;
-    sigwaitinfo; # introduced=23
-    sleep;
-    snprintf;
-    socket;
-    socketpair;
-    splice; # introduced=21
-    sprintf;
-    srand; # introduced=21
-    srand48;
-    srandom; # introduced=21
-    sscanf;
-    stat;
-    stat64; # introduced=21
-    statfs;
-    statfs64; # introduced=21
-    statvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    statvfs64; # introduced=21
-    stderr; # var introduced=23
-    stdin; # var introduced=23
-    stdout; # var introduced=23
-    stpcpy; # introduced=21
-    stpncpy; # introduced=21
-    strcasecmp;
-    strcasecmp_l; # introduced=23
-    strcasestr;
-    strcat;
-    strchr;
-    strcmp;
-    strcoll;
-    strcoll_l; # introduced=21
-    strcpy;
-    strcspn;
-    strdup;
-    strerror;
-    strerror_l; # introduced=23
-    strerror_r;
-    strftime;
-    strftime_l; # introduced=21
-    strlcat;
-    strlcpy;
-    strlen;
-    strncasecmp;
-    strncasecmp_l; # introduced=23
-    strncat;
-    strncmp;
-    strncpy;
-    strndup;
-    strnlen;
-    strpbrk;
-    strptime;
-    strrchr;
-    strsep;
-    strsignal;
-    strspn;
-    strstr;
-    strtod;
-    strtof; # introduced=21
-    strtoimax;
-    strtok;
-    strtok_r;
-    strtol;
-    strtold; # introduced=21
-    strtold_l; # introduced=21
-    strtoll;
-    strtoll_l; # introduced=21
-    strtoq; # introduced=21
-    strtoul;
-    strtoull;
-    strtoull_l; # introduced=21
-    strtoumax;
-    strtouq; # introduced=21
-    strxfrm;
-    strxfrm_l; # introduced=21
-    swapoff; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swapon; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swprintf;
-    swscanf;
-    symlink;
-    symlinkat; # introduced=21
-    sync;
-    sys_siglist; # var
-    sys_signame; # var
-    syscall;
-    sysconf;
-    sysinfo;
-    syslog;
-    system;
-    tcdrain; # introduced=21
-    tcflow; # introduced=21
-    tcflush; # introduced=21
-    tcgetattr; # introduced=21
-    tcgetpgrp;
-    tcgetsid; # introduced=21
-    tcsendbreak; # introduced=21
-    tcsetattr; # introduced=21
-    tcsetpgrp;
-    tdelete; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tdestroy; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tee; # introduced=21
-    telldir; # introduced=23
-    tempnam;
-    tfind; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tgkill; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    time;
-    timegm; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timegm64; # arm x86 mips
-    timelocal; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timelocal64; # arm x86 mips
-    timer_create;
-    timer_delete;
-    timer_getoverrun;
-    timer_gettime;
-    timer_settime;
-    timerfd_create; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_gettime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_settime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    times;
-    timezone; # var
-    tmpfile;
-    tmpnam;
-    toascii;
-    tolower;
-    tolower_l; # introduced=21
-    toupper;
-    toupper_l; # introduced=21
-    towlower;
-    towlower_l; # introduced=21
-    towupper;
-    towupper_l; # introduced=21
-    truncate;
-    truncate64; # introduced=21
-    tsearch; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    ttyname;
-    ttyname_r;
-    twalk; # introduced=21
-    tzname; # var
-    tzset;
-    umask;
-    umount;
-    umount2;
-    uname;
-    ungetc;
-    ungetwc;
-    unlink;
-    unlinkat;
-    unlockpt;
-    unsetenv;
-    unshare; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    uselocale; # introduced=21
-    usleep;
-    utime;
-    utimensat; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    utimes;
-    utmpname;
-    valloc; # arm x86 mips
-    vasprintf;
-    vdprintf; # introduced=21
-    verr;
-    verrx;
-    vfdprintf; # arm x86 mips versioned=28
-    vfork;
-    vfprintf;
-    vfscanf;
-    vfwprintf;
-    vfwscanf; # introduced=21
-    vmsplice; # introduced=21
-    vprintf;
-    vscanf;
-    vsnprintf;
-    vsprintf;
-    vsscanf;
-    vswprintf;
-    vswscanf; # introduced=21
-    vsyslog;
-    vwarn;
-    vwarnx;
-    vwprintf;
-    vwscanf; # introduced=21
-    wait;
-    wait4; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    waitid;
-    waitpid;
-    warn;
-    warnx;
-    wcpcpy;
-    wcpncpy;
-    wcrtomb;
-    wcscasecmp;
-    wcscasecmp_l; # introduced=23
-    wcscat;
-    wcschr;
-    wcscmp;
-    wcscoll;
-    wcscoll_l; # introduced=21
-    wcscpy;
-    wcscspn;
-    wcsdup;
-    wcsftime;
-    wcslcat;
-    wcslcpy;
-    wcslen;
-    wcsncasecmp;
-    wcsncasecmp_l; # introduced=23
-    wcsncat;
-    wcsncmp;
-    wcsncpy;
-    wcsnlen;
-    wcsnrtombs; # introduced=21
-    wcspbrk;
-    wcsrchr;
-    wcsrtombs;
-    wcsspn;
-    wcsstr;
-    wcstod;
-    wcstof; # introduced=21
-    wcstoimax; # introduced=21
-    wcstok;
-    wcstol;
-    wcstold; # introduced=21
-    wcstold_l; # introduced=21
-    wcstoll; # introduced=21
-    wcstoll_l; # introduced=21
-    wcstombs;
-    wcstoul;
-    wcstoull; # introduced=21
-    wcstoull_l; # introduced=21
-    wcstoumax; # introduced=21
-    wcswidth;
-    wcsxfrm;
-    wcsxfrm_l; # introduced=21
-    wctob;
-    wctomb; # introduced=21
-    wctype;
-    wctype_l; # introduced=21
-    wcwidth;
-    wmemchr;
-    wmemcmp;
-    wmemcpy;
-    wmemmove;
-    wmempcpy; # introduced=23
-    wmemset;
-    wprintf;
-    write;
-    writev;
-    wscanf;
-  local:
-    *;
-};
-
-LIBC_N { # introduced-arm64=24 introduced-mips=24 introduced-mips64=24 introduced-x86=24 introduced-x86_64=24
-  global:
-    __fread_chk; # introduced=24
-    __fwrite_chk; # introduced=24
-    __getcwd_chk; # introduced=24
-    __pwrite_chk; # introduced=24
-    __pwrite64_chk; # introduced=24
-    __write_chk; # introduced=24
-    adjtimex; # introduced=24
-    clock_adjtime; # introduced=24
-    fgetpos64; # introduced=24
-    fileno_unlocked; # introduced=24
-    fopen64; # introduced=24
-    freeifaddrs; # introduced=24
-    freopen64; # introduced=24
-    fseeko64; # introduced=24
-    fsetpos64; # introduced=24
-    ftello64; # introduced=24
-    funopen64; # introduced=24
-    getgrgid_r; # introduced=24
-    getgrnam_r; # introduced=24
-    getifaddrs; # introduced=24
-    if_freenameindex; # introduced=24
-    if_nameindex; # introduced=24
-    in6addr_any; # var introduced=24
-    in6addr_loopback; # var introduced=24
-    lockf; # introduced=24
-    lockf64; # introduced=24
-    preadv; # introduced=24
-    preadv64; # introduced=24
-    prlimit; # arm mips x86 introduced=24
-    pthread_barrierattr_destroy; # introduced=24
-    pthread_barrierattr_getpshared; # introduced=24
-    pthread_barrierattr_init; # introduced=24
-    pthread_barrierattr_setpshared; # introduced=24
-    pthread_barrier_destroy; # introduced=24
-    pthread_barrier_init; # introduced=24
-    pthread_barrier_wait; # introduced=24
-    pthread_spin_destroy; # introduced=24
-    pthread_spin_init; # introduced=24
-    pthread_spin_lock; # introduced=24
-    pthread_spin_trylock; # introduced=24
-    pthread_spin_unlock; # introduced=24
-    pwritev; # introduced=24
-    pwritev64; # introduced=24
-    scandirat; # introduced=24
-    scandirat64; # introduced=24
-    strchrnul; # introduced=24
-    tmpfile64; # introduced=24
-} LIBC;
-
-LIBC_O {
-  global:
-    __sendto_chk; # introduced=26
-    __system_property_read_callback; # introduced=26
-    __system_property_wait; # introduced=26
-    bsd_signal; # arm x86 mips versioned=26
-    catclose; # introduced=26
-    catgets; # introduced=26
-    catopen; # introduced=26
-    ctermid; # introduced=26
-    endgrent; # introduced=26
-    endpwent; # introduced=26
-    futimes; # introduced=26
-    futimesat; # introduced=26
-    getdomainname; # introduced=26
-    getgrent; # introduced=26
-    getpwent; # introduced=26
-    getsubopt; # introduced=26
-    hasmntopt; # introduced=26
-    lutimes; # introduced=26
-    mallopt; # introduced=26
-    mblen; # introduced=26
-    msgctl; # introduced=26
-    msgget; # introduced=26
-    msgrcv; # introduced=26
-    msgsnd; # introduced=26
-    nl_langinfo; # introduced=26
-    nl_langinfo_l; # introduced=26
-    pthread_getname_np; # introduced=26
-    quotactl; # introduced=26
-    semctl; # introduced=26
-    semget; # introduced=26
-    semop; # introduced=26
-    semtimedop; # introduced=26
-    setdomainname; # introduced=26
-    setgrent; # introduced=26
-    setpwent; # introduced=26
-    shmat; # introduced=26
-    shmctl; # introduced=26
-    shmdt; # introduced=26
-    shmget; # introduced=26
-    sighold; # introduced=26
-    sigignore; # introduced=26
-    sigpause; # introduced=26
-    sigrelse; # introduced=26
-    sigset; # introduced=26
-    strtod_l; # introduced=26
-    strtof_l; # introduced=26
-    strtol_l; # introduced=26
-    strtoul_l; # introduced=26
-    sync_file_range; # introduced=26
-    towctrans; # introduced=26
-    towctrans_l; # introduced=26
-    wctrans; # introduced=26
-    wctrans_l; # introduced=26
-} LIBC_N;
-
-LIBC_P { # introduced=P
-  global:
-    __freading;
-    __free_hook;
-    __fseterr;
-    __fwriting;
-    __malloc_hook;
-    __memalign_hook;
-    __realloc_hook;
-    aligned_alloc;
-    endhostent;
-    endnetent;
-    endprotoent;
-    epoll_pwait64;
-    fexecve;
-    fflush_unlocked;
-    fgetc_unlocked;
-    fgets_unlocked;
-    fputc_unlocked;
-    fputs_unlocked;
-    fread_unlocked;
-    fwrite_unlocked;
-    getentropy;
-    getnetent;
-    getprotoent;
-    getrandom;
-    getlogin_r;
-    glob;
-    globfree;
-    hcreate;
-    hcreate_r;
-    hdestroy;
-    hdestroy_r;
-    hsearch;
-    hsearch_r;
-    iconv;
-    iconv_close;
-    iconv_open;
-    posix_spawn;
-    posix_spawnattr_destroy;
-    posix_spawnattr_getflags;
-    posix_spawnattr_getpgroup;
-    posix_spawnattr_getschedparam;
-    posix_spawnattr_getschedpolicy;
-    posix_spawnattr_getsigdefault;
-    posix_spawnattr_getsigdefault64;
-    posix_spawnattr_getsigmask;
-    posix_spawnattr_getsigmask64;
-    posix_spawnattr_init;
-    posix_spawnattr_setflags;
-    posix_spawnattr_setpgroup;
-    posix_spawnattr_setschedparam;
-    posix_spawnattr_setschedpolicy;
-    posix_spawnattr_setsigdefault;
-    posix_spawnattr_setsigdefault64;
-    posix_spawnattr_setsigmask;
-    posix_spawnattr_setsigmask64;
-    posix_spawn_file_actions_addclose;
-    posix_spawn_file_actions_adddup2;
-    posix_spawn_file_actions_addopen;
-    posix_spawn_file_actions_destroy;
-    posix_spawn_file_actions_init;
-    posix_spawnp;
-    ppoll64;
-    pselect64;
-    pthread_attr_getinheritsched;
-    pthread_attr_setinheritsched;
-    pthread_mutex_timedlock_monotonic_np;
-    pthread_mutexattr_getprotocol;
-    pthread_mutexattr_setprotocol;
-    pthread_rwlock_timedrdlock_monotonic_np;
-    pthread_rwlock_timedwrlock_monotonic_np;
-    pthread_setschedprio;
-    pthread_sigmask64;
-    sem_timedwait_monotonic_np;
-    sethostent;
-    setnetent;
-    setprotoent;
-    sigaction64;
-    sigaddset64;
-    sigdelset64;
-    sigemptyset64;
-    sigfillset64;
-    sigismember64;
-    signalfd64;
-    sigpending64;
-    sigprocmask64;
-    sigsuspend64;
-    sigtimedwait64;
-    sigwait64;
-    sigwaitinfo64;
-    strptime_l;
-    swab;
-    syncfs;
-    wcsftime_l;
-    wcstod_l;
-    wcstof_l;
-    wcstol_l;
-    wcstoul_l;
-} LIBC_O;
-
-LIBC_Q { # introduced=Q
-  global:
-    __res_randomid;
-    android_fdsan_close_with_tag;
-    android_fdsan_create_owner_tag;
-    android_fdsan_exchange_owner_tag;
-    android_fdsan_get_owner_tag;
-    android_fdsan_get_tag_type;
-    android_fdsan_get_tag_value;
-    android_fdsan_get_error_level;
-    android_fdsan_set_error_level;
-    android_get_device_api_level;
-    getloadavg;
-    pthread_sigqueue;
-    reallocarray;
-    timespec_get;
-} LIBC_P;
-
-LIBC_PRIVATE {
-  global:
-    __accept4; # arm x86 mips
-    __bionic_brk; # arm x86 mips
-    __divdi3; # arm x86 mips
-    __futex_wait; # arm x86 mips
-    __futex_wake; # arm x86 mips
-    __get_thread; # arm x86 mips
-    __get_tls; # arm x86 mips
-    __getdents64; # arm x86 mips
-    __open; # arm x86 mips
-    __page_shift; # arm x86 mips
-    __page_size; # arm x86 mips
-    __popcountsi2; # arm x86 mips
-    __pthread_gettid; # arm x86 mips
-    __sclose; # arm x86 mips
-    __sdidinit; # arm x86 mips
-    __set_errno; # arm x86 mips
-    __sflags; # arm x86 mips
-    __sflush; # arm x86 mips
-    __sfp; # arm x86 mips
-    __sglue; # arm x86 mips
-    __sinit; # arm x86 mips
-    __smakebuf; # arm x86 mips
-    __sread; # arm x86 mips
-    __srefill; # arm x86 mips
-    __srget; # arm x86 mips
-    __sseek; # arm x86 mips
-    __swbuf; # arm x86 mips
-    __swrite; # arm x86 mips
-    __swsetup; # arm x86 mips
-    __udivdi3; # arm x86 mips
-    __umoddi3; # x86 mips
-    __wait4; # arm x86 mips
-    _fwalk; # arm x86 mips
-    android_getaddrinfofornet;
-    android_getaddrinfofornetcontext;
-    android_gethostbyaddrfornet;
-    android_gethostbyaddrfornetcontext;
-    android_gethostbynamefornet;
-    android_gethostbynamefornetcontext;
-    arc4random_addrandom; # arm x86 mips
-    arc4random_stir; # arm x86 mips
-    bcopy; # arm x86 mips
-    bzero; # arm x86 mips
-    dlmalloc; # arm x86 mips
-    dlmalloc_inspect_all; # arm x86 mips
-    dlmalloc_trim; # arm x86 mips
-    dlmalloc_usable_size; # arm x86 mips
-    free_malloc_leak_info;
-    ftime; # arm x86 mips
-    get_malloc_leak_info;
-    getdents; # arm x86 mips
-    getdtablesize; # arm x86 mips
-    gMallocLeakZygoteChild;
-    index; # arm x86 mips
-    issetugid; # arm x86 mips
-    memswap; # arm x86 mips
-    pthread_attr_getstackaddr; # arm x86 mips
-    pthread_attr_setstackaddr; # arm x86 mips
-    SHA1Final; # arm x86 mips
-    SHA1Init; # arm x86 mips
-    SHA1Transform; # arm x86 mips
-    SHA1Update; # arm x86 mips
-    strntoimax; # arm x86 mips
-    strntoumax; # arm x86 mips
-    strtotimeval; # arm x86 mips
-    sysv_signal; # arm x86 mips
-    tkill; # arm x86 mips
-    wait3; # arm x86 mips
-    wcswcs; # arm x86 mips
-    write_malloc_leak_info;
-} LIBC_Q;
-
-LIBC_DEPRECATED {
-  global:
-    __system_property_wait_any;
-};
-
-LIBC_PLATFORM {
-  global:
-    __system_properties_init;
-    __system_property_area__; # var
-    __system_property_add;
-    __system_property_area_init;
-    __system_property_set_filename;
-    __system_property_update;
-    android_fdsan_get_fd_table;
-    android_net_res_stats_get_info_for_net;
-    android_net_res_stats_aggregate;
-    android_net_res_stats_get_usable_servers;
-    malloc_backtrace;
-    malloc_disable;
-    malloc_enable;
-    malloc_iterate;
-} LIBC_Q;
diff --git a/libc/libc.mips64.map b/libc/libc.mips64.map
deleted file mode 100644
index 81ff00d..0000000
--- a/libc/libc.mips64.map
+++ /dev/null
@@ -1,1397 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __assert;
-    __assert2;
-    __b64_ntop;
-    __b64_pton;
-    __cmsg_nxthdr; # introduced=21
-    __ctype_get_mb_cur_max; # introduced=21
-    __cxa_atexit;
-    __cxa_finalize;
-    __cxa_thread_atexit_impl; # introduced=23
-    __dn_comp;
-    __dn_count_labels;
-    __dn_skipname;
-    __errno;
-    __fbufsize; # introduced=23
-    __FD_CLR_chk; # introduced=21
-    __FD_ISSET_chk; # introduced=21
-    __FD_SET_chk; # introduced=21
-    __fgets_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __flbf; # introduced=23
-    __fp_nquery;
-    __fp_query;
-    __fpclassify; # introduced=21
-    __fpclassifyd;
-    __fpclassifyf;
-    __fpclassifyl;
-    __fpending; # introduced=23
-    __fpurge; # introduced=23
-    __freadable; # introduced=23
-    __fsetlocking; # introduced=23
-    __fwritable; # introduced=23
-    __get_h_errno;
-    __gnu_basename; # introduced=23
-    __gnu_strerror_r; # introduced=23
-    __hostalias;
-    __isfinite;
-    __isfinitef;
-    __isfinitel;
-    __isinf;
-    __isinff;
-    __isinfl;
-    __isnan; # introduced=21
-    __isnanf; # introduced=21
-    __isnanl;
-    __isnormal;
-    __isnormalf;
-    __isnormall;
-    __libc_current_sigrtmax; # introduced=21
-    __libc_current_sigrtmin; # introduced=21
-    __libc_init;
-    __loc_aton;
-    __loc_ntoa;
-    __memchr_chk; # introduced=23
-    __memcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memmove_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memrchr_chk; # introduced=23
-    __memset_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __open_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __openat_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __p_cdname;
-    __p_cdnname;
-    __p_class;
-    __p_class_syms; # var
-    __p_fqname;
-    __p_fqnname;
-    __p_option;
-    __p_query;
-    __p_rcode;
-    __p_secstodate;
-    __p_time;
-    __p_type;
-    __p_type_syms; # var
-    __poll_chk; # introduced=23
-    __ppoll_chk; # introduced=23
-    __ppoll64_chk; # introduced=28
-    __pread64_chk; # introduced=23
-    __pread_chk; # introduced=23
-    __progname; # var
-    __pthread_cleanup_pop;
-    __pthread_cleanup_push;
-    __putlong;
-    __putshort;
-    __read_chk; # introduced=21
-    __readlink_chk; # introduced=23
-    __readlinkat_chk; # introduced=23
-    __recvfrom_chk; # introduced=21
-    __register_atfork; # introduced=23
-    __res_close;
-    __res_dnok;
-    __res_hnok;
-    __res_hostalias;
-    __res_isourserver;
-    __res_mailok;
-    __res_nameinquery;
-    __res_nclose;
-    __res_ninit;
-    __res_nmkquery;
-    __res_nquery;
-    __res_nquerydomain;
-    __res_nsearch;
-    __res_nsend;
-    __res_ownok;
-    __res_queriesmatch;
-    __res_querydomain;
-    __res_send;
-    __res_send_setqhook;
-    __res_send_setrhook;
-    __sched_cpualloc; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpucount; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpufree; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sF; # var
-    __snprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __sprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __stack_chk_fail;
-    __stack_chk_guard; # var
-    __stpcpy_chk; # introduced=21
-    __stpncpy_chk; # introduced=21
-    __stpncpy_chk2; # introduced=21
-    __strcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __strcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlen_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk2; # introduced=21
-    __strrchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __sym_ntop;
-    __sym_ntos;
-    __sym_ston;
-    __system_property_area_serial; # introduced=23
-    __system_property_find;
-    __system_property_find_nth;
-    __system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_get;
-    __system_property_read;
-    __system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __umask_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __vsnprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __vsprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    _ctype_; # var
-    _Exit; # introduced=21
-    _exit;
-    _flushlbf; # introduced=23
-    _getlong;
-    _getshort;
-    _longjmp;
-    _resolv_delete_cache_for_net; # introduced=21
-    _resolv_flush_cache_for_net; # introduced=21
-    _resolv_set_nameservers_for_net; # introduced=21
-    _setjmp;
-    _tolower; # introduced=21
-    _toupper; # introduced=21
-    abort;
-    abs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    accept;
-    accept4; # introduced=21
-    access;
-    acct;
-    alarm;
-    alphasort;
-    alphasort64; # introduced=21
-    android_set_abort_message; # introduced=21
-    arc4random;
-    arc4random_buf;
-    arc4random_uniform;
-    asctime;
-    asctime_r;
-    asprintf;
-    at_quick_exit; # introduced=21
-    atof; # introduced=21
-    atoi;
-    atol;
-    atoll;
-    basename;
-    bind;
-    bindresvport;
-    brk;
-    bsearch;
-    btowc;
-    c16rtomb; # introduced=21
-    c32rtomb; # introduced=21
-    calloc;
-    capget;
-    capset;
-    cfgetispeed; # introduced=21
-    cfgetospeed; # introduced=21
-    cfmakeraw; # introduced=21
-    cfsetispeed; # introduced=21
-    cfsetospeed; # introduced=21
-    cfsetspeed; # introduced=21
-    chdir;
-    chmod;
-    chown;
-    chroot;
-    clearenv;
-    clearerr;
-    clearerr_unlocked; # introduced=23
-    clock;
-    clock_getcpuclockid; # introduced=23
-    clock_getres;
-    clock_gettime;
-    clock_nanosleep;
-    clock_settime;
-    clone; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    close;
-    closedir;
-    closelog;
-    connect;
-    creat;
-    creat64; # introduced=21
-    ctime;
-    ctime_r;
-    daemon;
-    daylight; # var
-    delete_module;
-    difftime;
-    dirfd;
-    dirname;
-    div;
-    dn_expand;
-    dprintf; # introduced=21
-    drand48;
-    dup;
-    dup2;
-    dup3; # introduced=21
-    duplocale; # introduced=21
-    endmntent; # introduced=21
-    endservent;
-    endutent;
-    environ; # var
-    epoll_create;
-    epoll_create1; # introduced=21
-    epoll_ctl;
-    epoll_pwait; # introduced=21
-    epoll_wait;
-    erand48;
-    err;
-    error; # introduced=23
-    error_at_line; # introduced=23
-    error_message_count; # var introduced=23
-    error_one_per_line; # var introduced=23
-    error_print_progname; # var introduced=23
-    errx;
-    ether_aton; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_aton_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    eventfd;
-    eventfd_read;
-    eventfd_write;
-    execl;
-    execle;
-    execlp;
-    execv;
-    execve;
-    execvp;
-    execvpe; # introduced=21
-    exit;
-    faccessat; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fallocate; # introduced=21
-    fallocate64; # introduced=21
-    fchdir;
-    fchmod;
-    fchmodat;
-    fchown;
-    fchownat;
-    fclose;
-    fcntl;
-    fdatasync;
-    fdopen;
-    fdopendir;
-    feof;
-    feof_unlocked; # introduced=23
-    ferror;
-    ferror_unlocked; # introduced=23
-    fflush;
-    ffs; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    fgetc;
-    fgetln;
-    fgetpos;
-    fgets;
-    fgetwc;
-    fgetws;
-    fgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fileno;
-    flistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    flock;
-    flockfile;
-    fmemopen; # introduced=23
-    fnmatch;
-    fopen;
-    fork;
-    forkpty; # introduced=23
-    fpathconf;
-    fprintf;
-    fpurge;
-    fputc;
-    fputs;
-    fputwc;
-    fputws;
-    fread;
-    free;
-    freeaddrinfo;
-    freelocale; # introduced=21
-    fremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    freopen;
-    fscanf;
-    fseek;
-    fseeko;
-    fsetpos;
-    fsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fstat;
-    fstat64; # introduced=21
-    fstatat;
-    fstatat64; # introduced=21
-    fstatfs;
-    fstatfs64; # introduced=21
-    fstatvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fstatvfs64; # introduced=21
-    fsync;
-    ftell;
-    ftello;
-    ftok;
-    ftruncate;
-    ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ftrylockfile;
-    fts_children; # introduced=21
-    fts_close; # introduced=21
-    fts_open; # introduced=21
-    fts_read; # introduced=21
-    fts_set; # introduced=21
-    ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    ftw64; # introduced=21
-    funlockfile;
-    funopen;
-    futimens; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fwide;
-    fwprintf;
-    fwrite;
-    fwscanf;
-    gai_strerror;
-    get_avphys_pages; # introduced=23
-    get_nprocs; # introduced=23
-    get_nprocs_conf; # introduced=23
-    get_phys_pages; # introduced=23
-    getaddrinfo;
-    getauxval; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getc;
-    getc_unlocked;
-    getchar;
-    getchar_unlocked;
-    getcwd;
-    getdelim; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getegid;
-    getenv;
-    geteuid;
-    getgid;
-    getgrgid;
-    getgrnam;
-    getgrouplist;
-    getgroups;
-    gethostbyaddr;
-    gethostbyaddr_r; # introduced=23
-    gethostbyname;
-    gethostbyname2;
-    gethostbyname2_r; # introduced=23
-    gethostbyname_r;
-    gethostent;
-    gethostname;
-    getitimer;
-    getline; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getlogin;
-    getmntent;
-    getmntent_r; # introduced=21
-    getnameinfo;
-    getnetbyaddr;
-    getnetbyname;
-    getopt;
-    getopt_long;
-    getopt_long_only;
-    getpagesize; # introduced=21
-    getpeername;
-    getpgid;
-    getpgrp;
-    getpid;
-    getppid;
-    getpriority;
-    getprogname; # introduced=21
-    getprotobyname;
-    getprotobynumber;
-    getpt;
-    getpwnam;
-    getpwnam_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getpwuid;
-    getpwuid_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getresgid;
-    getresuid;
-    getrlimit;
-    getrlimit64; # introduced=21
-    getrusage;
-    gets;
-    getservbyname;
-    getservbyport;
-    getservent;
-    getsid; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    getsockname;
-    getsockopt;
-    gettid;
-    gettimeofday;
-    getuid;
-    getutent;
-    getwc;
-    getwchar;
-    getxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    gmtime;
-    gmtime_r;
-    grantpt; # introduced=21
-    herror;
-    hstrerror;
-    htonl; # introduced=21
-    htons; # introduced=21
-    if_indextoname;
-    if_nametoindex;
-    imaxabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    imaxdiv; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    inet_addr;
-    inet_aton;
-    inet_lnaof; # introduced=21
-    inet_makeaddr; # introduced=21
-    inet_netof; # introduced=21
-    inet_network; # introduced=21
-    inet_nsap_addr;
-    inet_nsap_ntoa;
-    inet_ntoa;
-    inet_ntop;
-    inet_pton;
-    init_module;
-    initgroups;
-    initstate; # introduced=21
-    inotify_add_watch;
-    inotify_init;
-    inotify_init1; # introduced=21
-    inotify_rm_watch;
-    insque; # introduced=21
-    ioctl;
-    isalnum;
-    isalnum_l; # introduced=21
-    isalpha;
-    isalpha_l; # introduced=21
-    isascii;
-    isatty;
-    isblank;
-    isblank_l; # introduced=21
-    iscntrl;
-    iscntrl_l; # introduced=21
-    isdigit;
-    isdigit_l; # introduced=21
-    isfinite; # introduced=21
-    isfinitef; # introduced=21
-    isfinitel; # introduced=21
-    isgraph;
-    isgraph_l; # introduced=21
-    isinf; # introduced=21
-    isinff; # introduced=21
-    isinfl; # introduced=21
-    islower;
-    islower_l; # introduced=21
-    isnan;
-    isnanf;
-    isnanl; # introduced=21
-    isnormal; # introduced=21
-    isnormalf; # introduced=21
-    isnormall; # introduced=21
-    isprint;
-    isprint_l; # introduced=21
-    ispunct;
-    ispunct_l; # introduced=21
-    isspace;
-    isspace_l; # introduced=21
-    isupper;
-    isupper_l; # introduced=21
-    iswalnum;
-    iswalnum_l; # introduced=21
-    iswalpha;
-    iswalpha_l; # introduced=21
-    iswblank; # introduced=21
-    iswblank_l; # introduced=21
-    iswcntrl;
-    iswcntrl_l; # introduced=21
-    iswctype;
-    iswctype_l; # introduced=21
-    iswdigit;
-    iswdigit_l; # introduced=21
-    iswgraph;
-    iswgraph_l; # introduced=21
-    iswlower;
-    iswlower_l; # introduced=21
-    iswprint;
-    iswprint_l; # introduced=21
-    iswpunct;
-    iswpunct_l; # introduced=21
-    iswspace;
-    iswspace_l; # introduced=21
-    iswupper;
-    iswupper_l; # introduced=21
-    iswxdigit;
-    iswxdigit_l; # introduced=21
-    isxdigit;
-    isxdigit_l; # introduced=21
-    jrand48;
-    kill;
-    killpg;
-    klogctl;
-    labs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lchown;
-    lcong48; # introduced=23
-    ldexp;
-    ldiv;
-    lfind; # introduced=21
-    lgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    link;
-    linkat; # introduced=21
-    listen;
-    listxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    llabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lldiv;
-    llistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    localeconv; # introduced=21
-    localtime;
-    localtime_r;
-    login_tty; # introduced=23
-    longjmp;
-    lrand48;
-    lremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lsearch; # introduced=21
-    lseek;
-    lseek64;
-    lsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lstat;
-    lstat64; # introduced=21
-    madvise;
-    mallinfo;
-    malloc;
-    malloc_info; # introduced=23
-    malloc_usable_size; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mbrlen;
-    mbrtoc16; # introduced=21
-    mbrtoc32; # introduced=21
-    mbrtowc;
-    mbsinit;
-    mbsnrtowcs; # introduced=21
-    mbsrtowcs;
-    mbstowcs;
-    mbtowc; # introduced=21
-    memalign;
-    memccpy;
-    memchr;
-    memcmp;
-    memcpy;
-    memmem;
-    memmove;
-    mempcpy; # introduced=23
-    memrchr;
-    memset;
-    mincore;
-    mkdir;
-    mkdirat;
-    mkdtemp;
-    mkfifo; # introduced=21
-    mkfifoat; # introduced=23
-    mknod;
-    mknodat; # introduced=21
-    mkostemp; # introduced=23
-    mkostemp64; # introduced=23
-    mkostemps; # introduced=23
-    mkostemps64; # introduced=23
-    mkstemp;
-    mkstemp64; # introduced=21
-    mkstemps;
-    mkstemps64; # introduced=23
-    mktemp;
-    mktime;
-    mlock;
-    mlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mmap;
-    mmap64; # introduced=21
-    mount;
-    mprotect;
-    mrand48;
-    mremap;
-    msync;
-    munlock;
-    munlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    munmap;
-    nanosleep;
-    newlocale; # introduced=21
-    nftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    nftw64; # introduced=21
-    nice;
-    nrand48;
-    ns_format_ttl; # arm64 x86_64 mips64 introduced=22
-    ns_get16; # arm64 x86_64 mips64 introduced=22
-    ns_get32; # arm64 x86_64 mips64 introduced=22
-    ns_initparse; # arm64 x86_64 mips64 introduced=22
-    ns_makecanon; # arm64 x86_64 mips64 introduced=22
-    ns_msg_getflag; # arm64 x86_64 mips64 introduced=22
-    ns_name_compress; # arm64 x86_64 mips64 introduced=22
-    ns_name_ntol; # arm64 x86_64 mips64 introduced=22
-    ns_name_ntop; # arm64 x86_64 mips64 introduced=22
-    ns_name_pack; # arm64 x86_64 mips64 introduced=22
-    ns_name_pton; # arm64 x86_64 mips64 introduced=23
-    ns_name_rollback; # arm64 x86_64 mips64 introduced=22
-    ns_name_skip; # arm64 x86_64 mips64 introduced=22
-    ns_name_uncompress; # arm64 x86_64 mips64 introduced=22
-    ns_name_unpack; # arm64 x86_64 mips64 introduced=22
-    ns_parserr; # arm64 x86_64 mips64 introduced=22
-    ns_put16; # arm64 x86_64 mips64 introduced=22
-    ns_put32; # arm64 x86_64 mips64 introduced=22
-    ns_samename; # arm64 x86_64 mips64 introduced=22
-    ns_skiprr; # arm64 x86_64 mips64 introduced=22
-    ns_sprintrr; # arm64 x86_64 mips64 introduced=22
-    ns_sprintrrf; # arm64 x86_64 mips64 introduced=22
-    nsdispatch;
-    ntohl; # introduced=21
-    ntohs; # introduced=21
-    open;
-    open64; # introduced=21
-    open_memstream; # introduced=23
-    open_wmemstream; # introduced=23
-    openat;
-    openat64; # introduced=21
-    opendir;
-    openlog;
-    openpty; # introduced=23
-    optarg; # var
-    opterr; # var
-    optind; # var
-    optopt; # var
-    optreset; # var
-    pathconf;
-    pause;
-    pclose;
-    perror;
-    personality; # introduced-arm=15 introduced-arm64=21 introduced-mips=15 introduced-mips64=21 introduced-x86=15 introduced-x86_64=21
-    pipe;
-    pipe2;
-    poll;
-    popen;
-    posix_fadvise; # introduced=21
-    posix_fadvise64; # introduced=21
-    posix_fallocate; # introduced=21
-    posix_fallocate64; # introduced=21
-    posix_madvise; # introduced=23
-    posix_memalign; # introduced=17
-    posix_openpt; # introduced=21
-    ppoll; # introduced=21
-    prctl;
-    pread;
-    pread64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    printf;
-    prlimit; # arm64 x86_64 mips64
-    prlimit64; # introduced=21
-    process_vm_readv; # introduced=23
-    process_vm_writev; # introduced=23
-    pselect;
-    psiginfo; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    psignal; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    pthread_atfork; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    pthread_attr_destroy;
-    pthread_attr_getdetachstate;
-    pthread_attr_getguardsize;
-    pthread_attr_getschedparam;
-    pthread_attr_getschedpolicy;
-    pthread_attr_getscope;
-    pthread_attr_getstack;
-    pthread_attr_getstacksize;
-    pthread_attr_init;
-    pthread_attr_setdetachstate;
-    pthread_attr_setguardsize;
-    pthread_attr_setschedparam;
-    pthread_attr_setschedpolicy;
-    pthread_attr_setscope;
-    pthread_attr_setstack;
-    pthread_attr_setstacksize;
-    pthread_cond_broadcast;
-    pthread_cond_destroy;
-    pthread_cond_init;
-    pthread_cond_signal;
-    pthread_cond_timedwait;
-    pthread_cond_timedwait_monotonic_np; # introduced-arm=9 introduced-x86=9 introduced-mips=9 introduced-arm64=28 introduced-x64_64=28 introduced-mips64=28
-    pthread_cond_wait;
-    pthread_condattr_destroy;
-    pthread_condattr_getclock; # introduced=21
-    pthread_condattr_getpshared;
-    pthread_condattr_init;
-    pthread_condattr_setclock; # introduced=21
-    pthread_condattr_setpshared;
-    pthread_create;
-    pthread_detach;
-    pthread_equal;
-    pthread_exit;
-    pthread_getattr_np;
-    pthread_getcpuclockid;
-    pthread_getschedparam;
-    pthread_getspecific;
-    pthread_gettid_np; # introduced=21
-    pthread_join;
-    pthread_key_create;
-    pthread_key_delete;
-    pthread_kill;
-    pthread_mutex_destroy;
-    pthread_mutex_init;
-    pthread_mutex_lock;
-    pthread_mutex_timedlock; # introduced=21
-    pthread_mutex_trylock;
-    pthread_mutex_unlock;
-    pthread_mutexattr_destroy;
-    pthread_mutexattr_getpshared;
-    pthread_mutexattr_gettype;
-    pthread_mutexattr_init;
-    pthread_mutexattr_setpshared;
-    pthread_mutexattr_settype;
-    pthread_once;
-    pthread_rwlock_destroy;
-    pthread_rwlock_init;
-    pthread_rwlock_rdlock;
-    pthread_rwlock_timedrdlock;
-    pthread_rwlock_timedwrlock;
-    pthread_rwlock_tryrdlock;
-    pthread_rwlock_trywrlock;
-    pthread_rwlock_unlock;
-    pthread_rwlock_wrlock;
-    pthread_rwlockattr_destroy;
-    pthread_rwlockattr_getkind_np; # introduced=23
-    pthread_rwlockattr_getpshared;
-    pthread_rwlockattr_init;
-    pthread_rwlockattr_setkind_np; # introduced=23
-    pthread_rwlockattr_setpshared;
-    pthread_self;
-    pthread_setname_np;
-    pthread_setschedparam;
-    pthread_setspecific;
-    pthread_sigmask;
-    ptrace;
-    ptsname;
-    ptsname_r;
-    putc;
-    putc_unlocked;
-    putchar;
-    putchar_unlocked;
-    putenv;
-    puts;
-    pututline;
-    putwc;
-    putwchar;
-    pwrite;
-    pwrite64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    qsort;
-    quick_exit; # introduced=21
-    raise;
-    rand; # introduced=21
-    rand_r; # introduced=21
-    random; # introduced=21
-    read;
-    readahead; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    readdir;
-    readdir64; # introduced=21
-    readdir64_r; # introduced=21
-    readdir_r;
-    readlink;
-    readlinkat; # introduced=21
-    readv;
-    realloc;
-    realpath;
-    reboot;
-    recv;
-    recvfrom;
-    recvmmsg; # introduced=21
-    recvmsg;
-    regcomp;
-    regerror;
-    regexec;
-    regfree;
-    remove;
-    removexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    remque; # introduced=21
-    rename;
-    renameat;
-    res_init;
-    res_mkquery;
-    res_query;
-    res_search;
-    rewind;
-    rewinddir;
-    rmdir;
-    sbrk;
-    scandir;
-    scandir64; # introduced=21
-    scanf;
-    sched_get_priority_max;
-    sched_get_priority_min;
-    sched_getaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getcpu; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getparam;
-    sched_getscheduler;
-    sched_rr_get_interval;
-    sched_setaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_setparam;
-    sched_setscheduler;
-    sched_yield;
-    seed48;
-    seekdir; # introduced=23
-    select;
-    sem_close;
-    sem_destroy;
-    sem_getvalue;
-    sem_init;
-    sem_open;
-    sem_post;
-    sem_timedwait;
-    sem_trywait;
-    sem_unlink;
-    sem_wait;
-    send;
-    sendfile;
-    sendfile64; # introduced=21
-    sendmmsg; # introduced=21
-    sendmsg;
-    sendto;
-    setbuf;
-    setbuffer;
-    setegid;
-    setenv;
-    seteuid;
-    setfsgid; # introduced=21
-    setfsuid; # introduced=21
-    setgid;
-    setgroups;
-    sethostname; # introduced=23
-    setitimer;
-    setjmp;
-    setlinebuf;
-    setlocale;
-    setlogmask;
-    setmntent; # introduced=21
-    setns; # introduced=21
-    setpgid;
-    setpgrp;
-    setpriority;
-    setprogname; # introduced=21
-    setregid;
-    setresgid;
-    setresuid;
-    setreuid;
-    setrlimit;
-    setrlimit64; # introduced=21
-    setservent;
-    setsid;
-    setsockopt;
-    setstate; # introduced=21
-    settimeofday;
-    setuid;
-    setutent;
-    setvbuf;
-    setxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    shutdown;
-    sigaction;
-    sigaddset; # introduced=21
-    sigaltstack;
-    sigblock;
-    sigdelset; # introduced=21
-    sigemptyset; # introduced=21
-    sigfillset; # introduced=21
-    siginterrupt;
-    sigismember; # introduced=21
-    siglongjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    signal; # introduced=21
-    signalfd; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    sigpending;
-    sigprocmask;
-    sigqueue; # introduced=23
-    sigsetjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sigsetmask;
-    sigsuspend;
-    sigtimedwait; # introduced=23
-    sigwait;
-    sigwaitinfo; # introduced=23
-    sleep;
-    snprintf;
-    socket;
-    socketpair;
-    splice; # introduced=21
-    sprintf;
-    srand; # introduced=21
-    srand48;
-    srandom; # introduced=21
-    sscanf;
-    stat;
-    stat64; # introduced=21
-    statfs;
-    statfs64; # introduced=21
-    statvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    statvfs64; # introduced=21
-    stderr; # var introduced=23
-    stdin; # var introduced=23
-    stdout; # var introduced=23
-    stpcpy; # introduced=21
-    stpncpy; # introduced=21
-    strcasecmp;
-    strcasecmp_l; # introduced=23
-    strcasestr;
-    strcat;
-    strchr;
-    strcmp;
-    strcoll;
-    strcoll_l; # introduced=21
-    strcpy;
-    strcspn;
-    strdup;
-    strerror;
-    strerror_l; # introduced=23
-    strerror_r;
-    strftime;
-    strftime_l; # introduced=21
-    strlcat;
-    strlcpy;
-    strlen;
-    strncasecmp;
-    strncasecmp_l; # introduced=23
-    strncat;
-    strncmp;
-    strncpy;
-    strndup;
-    strnlen;
-    strpbrk;
-    strptime;
-    strrchr;
-    strsep;
-    strsignal;
-    strspn;
-    strstr;
-    strtod;
-    strtof; # introduced=21
-    strtoimax;
-    strtok;
-    strtok_r;
-    strtol;
-    strtold; # introduced=21
-    strtold_l; # introduced=21
-    strtoll;
-    strtoll_l; # introduced=21
-    strtoq; # introduced=21
-    strtoul;
-    strtoull;
-    strtoull_l; # introduced=21
-    strtoumax;
-    strtouq; # introduced=21
-    strxfrm;
-    strxfrm_l; # introduced=21
-    swapoff; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swapon; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swprintf;
-    swscanf;
-    symlink;
-    symlinkat; # introduced=21
-    sync;
-    sys_siglist; # var
-    sys_signame; # var
-    syscall;
-    sysconf;
-    sysinfo;
-    syslog;
-    system;
-    tcdrain; # introduced=21
-    tcflow; # introduced=21
-    tcflush; # introduced=21
-    tcgetattr; # introduced=21
-    tcgetpgrp;
-    tcgetsid; # introduced=21
-    tcsendbreak; # introduced=21
-    tcsetattr; # introduced=21
-    tcsetpgrp;
-    tdelete; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tdestroy; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tee; # introduced=21
-    telldir; # introduced=23
-    tempnam;
-    tfind; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tgkill; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    time;
-    timegm; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timelocal; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timer_create;
-    timer_delete;
-    timer_getoverrun;
-    timer_gettime;
-    timer_settime;
-    timerfd_create; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_gettime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_settime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    times;
-    timezone; # var
-    tmpfile;
-    tmpnam;
-    toascii;
-    tolower;
-    tolower_l; # introduced=21
-    toupper;
-    toupper_l; # introduced=21
-    towlower;
-    towlower_l; # introduced=21
-    towupper;
-    towupper_l; # introduced=21
-    truncate;
-    truncate64; # introduced=21
-    tsearch; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    ttyname;
-    ttyname_r;
-    twalk; # introduced=21
-    tzname; # var
-    tzset;
-    umask;
-    umount;
-    umount2;
-    uname;
-    ungetc;
-    ungetwc;
-    unlink;
-    unlinkat;
-    unlockpt;
-    unsetenv;
-    unshare; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    uselocale; # introduced=21
-    usleep;
-    utime;
-    utimensat; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    utimes;
-    utmpname;
-    vasprintf;
-    vdprintf; # introduced=21
-    verr;
-    verrx;
-    vfork;
-    vfprintf;
-    vfscanf;
-    vfwprintf;
-    vfwscanf; # introduced=21
-    vmsplice; # introduced=21
-    vprintf;
-    vscanf;
-    vsnprintf;
-    vsprintf;
-    vsscanf;
-    vswprintf;
-    vswscanf; # introduced=21
-    vsyslog;
-    vwarn;
-    vwarnx;
-    vwprintf;
-    vwscanf; # introduced=21
-    wait;
-    wait4; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    waitid;
-    waitpid;
-    warn;
-    warnx;
-    wcpcpy;
-    wcpncpy;
-    wcrtomb;
-    wcscasecmp;
-    wcscasecmp_l; # introduced=23
-    wcscat;
-    wcschr;
-    wcscmp;
-    wcscoll;
-    wcscoll_l; # introduced=21
-    wcscpy;
-    wcscspn;
-    wcsdup;
-    wcsftime;
-    wcslcat;
-    wcslcpy;
-    wcslen;
-    wcsncasecmp;
-    wcsncasecmp_l; # introduced=23
-    wcsncat;
-    wcsncmp;
-    wcsncpy;
-    wcsnlen;
-    wcsnrtombs; # introduced=21
-    wcspbrk;
-    wcsrchr;
-    wcsrtombs;
-    wcsspn;
-    wcsstr;
-    wcstod;
-    wcstof; # introduced=21
-    wcstoimax; # introduced=21
-    wcstok;
-    wcstol;
-    wcstold; # introduced=21
-    wcstold_l; # introduced=21
-    wcstoll; # introduced=21
-    wcstoll_l; # introduced=21
-    wcstombs;
-    wcstoul;
-    wcstoull; # introduced=21
-    wcstoull_l; # introduced=21
-    wcstoumax; # introduced=21
-    wcswidth;
-    wcsxfrm;
-    wcsxfrm_l; # introduced=21
-    wctob;
-    wctomb; # introduced=21
-    wctype;
-    wctype_l; # introduced=21
-    wcwidth;
-    wmemchr;
-    wmemcmp;
-    wmemcpy;
-    wmemmove;
-    wmempcpy; # introduced=23
-    wmemset;
-    wprintf;
-    write;
-    writev;
-    wscanf;
-  local:
-    *;
-};
-
-LIBC_N { # introduced-arm64=24 introduced-mips=24 introduced-mips64=24 introduced-x86=24 introduced-x86_64=24
-  global:
-    __fread_chk; # introduced=24
-    __fwrite_chk; # introduced=24
-    __getcwd_chk; # introduced=24
-    __pwrite_chk; # introduced=24
-    __pwrite64_chk; # introduced=24
-    __write_chk; # introduced=24
-    adjtimex; # introduced=24
-    clock_adjtime; # introduced=24
-    fgetpos64; # introduced=24
-    fileno_unlocked; # introduced=24
-    fopen64; # introduced=24
-    freeifaddrs; # introduced=24
-    freopen64; # introduced=24
-    fseeko64; # introduced=24
-    fsetpos64; # introduced=24
-    ftello64; # introduced=24
-    funopen64; # introduced=24
-    getgrgid_r; # introduced=24
-    getgrnam_r; # introduced=24
-    getifaddrs; # introduced=24
-    if_freenameindex; # introduced=24
-    if_nameindex; # introduced=24
-    in6addr_any; # var introduced=24
-    in6addr_loopback; # var introduced=24
-    lockf; # introduced=24
-    lockf64; # introduced=24
-    preadv; # introduced=24
-    preadv64; # introduced=24
-    pthread_barrierattr_destroy; # introduced=24
-    pthread_barrierattr_getpshared; # introduced=24
-    pthread_barrierattr_init; # introduced=24
-    pthread_barrierattr_setpshared; # introduced=24
-    pthread_barrier_destroy; # introduced=24
-    pthread_barrier_init; # introduced=24
-    pthread_barrier_wait; # introduced=24
-    pthread_spin_destroy; # introduced=24
-    pthread_spin_init; # introduced=24
-    pthread_spin_lock; # introduced=24
-    pthread_spin_trylock; # introduced=24
-    pthread_spin_unlock; # introduced=24
-    pwritev; # introduced=24
-    pwritev64; # introduced=24
-    scandirat; # introduced=24
-    scandirat64; # introduced=24
-    strchrnul; # introduced=24
-    tmpfile64; # introduced=24
-} LIBC;
-
-LIBC_O {
-  global:
-    __sendto_chk; # introduced=26
-    __system_property_read_callback; # introduced=26
-    __system_property_wait; # introduced=26
-    catclose; # introduced=26
-    catgets; # introduced=26
-    catopen; # introduced=26
-    ctermid; # introduced=26
-    endgrent; # introduced=26
-    endpwent; # introduced=26
-    futimes; # introduced=26
-    futimesat; # introduced=26
-    getdomainname; # introduced=26
-    getgrent; # introduced=26
-    getpwent; # introduced=26
-    getsubopt; # introduced=26
-    hasmntopt; # introduced=26
-    lutimes; # introduced=26
-    mallopt; # introduced=26
-    mblen; # introduced=26
-    msgctl; # introduced=26
-    msgget; # introduced=26
-    msgrcv; # introduced=26
-    msgsnd; # introduced=26
-    nl_langinfo; # introduced=26
-    nl_langinfo_l; # introduced=26
-    pthread_getname_np; # introduced=26
-    quotactl; # introduced=26
-    semctl; # introduced=26
-    semget; # introduced=26
-    semop; # introduced=26
-    semtimedop; # introduced=26
-    setdomainname; # introduced=26
-    setgrent; # introduced=26
-    setpwent; # introduced=26
-    shmat; # introduced=26
-    shmctl; # introduced=26
-    shmdt; # introduced=26
-    shmget; # introduced=26
-    sighold; # introduced=26
-    sigignore; # introduced=26
-    sigpause; # introduced=26
-    sigrelse; # introduced=26
-    sigset; # introduced=26
-    strtod_l; # introduced=26
-    strtof_l; # introduced=26
-    strtol_l; # introduced=26
-    strtoul_l; # introduced=26
-    sync_file_range; # introduced=26
-    towctrans; # introduced=26
-    towctrans_l; # introduced=26
-    wctrans; # introduced=26
-    wctrans_l; # introduced=26
-} LIBC_N;
-
-LIBC_P { # introduced=P
-  global:
-    __freading;
-    __free_hook;
-    __fseterr;
-    __fwriting;
-    __malloc_hook;
-    __memalign_hook;
-    __realloc_hook;
-    aligned_alloc;
-    endhostent;
-    endnetent;
-    endprotoent;
-    epoll_pwait64;
-    fexecve;
-    fflush_unlocked;
-    fgetc_unlocked;
-    fgets_unlocked;
-    fputc_unlocked;
-    fputs_unlocked;
-    fread_unlocked;
-    fwrite_unlocked;
-    getentropy;
-    getnetent;
-    getprotoent;
-    getrandom;
-    getlogin_r;
-    glob;
-    globfree;
-    hcreate;
-    hcreate_r;
-    hdestroy;
-    hdestroy_r;
-    hsearch;
-    hsearch_r;
-    iconv;
-    iconv_close;
-    iconv_open;
-    posix_spawn;
-    posix_spawnattr_destroy;
-    posix_spawnattr_getflags;
-    posix_spawnattr_getpgroup;
-    posix_spawnattr_getschedparam;
-    posix_spawnattr_getschedpolicy;
-    posix_spawnattr_getsigdefault;
-    posix_spawnattr_getsigdefault64;
-    posix_spawnattr_getsigmask;
-    posix_spawnattr_getsigmask64;
-    posix_spawnattr_init;
-    posix_spawnattr_setflags;
-    posix_spawnattr_setpgroup;
-    posix_spawnattr_setschedparam;
-    posix_spawnattr_setschedpolicy;
-    posix_spawnattr_setsigdefault;
-    posix_spawnattr_setsigdefault64;
-    posix_spawnattr_setsigmask;
-    posix_spawnattr_setsigmask64;
-    posix_spawn_file_actions_addclose;
-    posix_spawn_file_actions_adddup2;
-    posix_spawn_file_actions_addopen;
-    posix_spawn_file_actions_destroy;
-    posix_spawn_file_actions_init;
-    posix_spawnp;
-    ppoll64;
-    pselect64;
-    pthread_attr_getinheritsched;
-    pthread_attr_setinheritsched;
-    pthread_mutex_timedlock_monotonic_np;
-    pthread_mutexattr_getprotocol;
-    pthread_mutexattr_setprotocol;
-    pthread_rwlock_timedrdlock_monotonic_np;
-    pthread_rwlock_timedwrlock_monotonic_np;
-    pthread_setschedprio;
-    pthread_sigmask64;
-    sem_timedwait_monotonic_np;
-    sethostent;
-    setnetent;
-    setprotoent;
-    sigaction64;
-    sigaddset64;
-    sigdelset64;
-    sigemptyset64;
-    sigfillset64;
-    sigismember64;
-    signalfd64;
-    sigpending64;
-    sigprocmask64;
-    sigsuspend64;
-    sigtimedwait64;
-    sigwait64;
-    sigwaitinfo64;
-    strptime_l;
-    swab;
-    syncfs;
-    wcsftime_l;
-    wcstod_l;
-    wcstof_l;
-    wcstol_l;
-    wcstoul_l;
-} LIBC_O;
-
-LIBC_Q { # introduced=Q
-  global:
-    __res_randomid;
-    android_fdsan_close_with_tag;
-    android_fdsan_create_owner_tag;
-    android_fdsan_exchange_owner_tag;
-    android_fdsan_get_owner_tag;
-    android_fdsan_get_tag_type;
-    android_fdsan_get_tag_value;
-    android_fdsan_get_error_level;
-    android_fdsan_set_error_level;
-    android_get_device_api_level;
-    getloadavg;
-    pthread_sigqueue;
-    reallocarray;
-    timespec_get;
-} LIBC_P;
-
-LIBC_PRIVATE {
-  global:
-    android_getaddrinfofornet;
-    android_getaddrinfofornetcontext;
-    android_gethostbyaddrfornet;
-    android_gethostbyaddrfornetcontext;
-    android_gethostbynamefornet;
-    android_gethostbynamefornetcontext;
-    free_malloc_leak_info;
-    get_malloc_leak_info;
-    gMallocLeakZygoteChild;
-    write_malloc_leak_info;
-} LIBC_Q;
-
-LIBC_DEPRECATED {
-  global:
-    __system_property_wait_any;
-};
-
-LIBC_PLATFORM {
-  global:
-    __system_properties_init;
-    __system_property_area__; # var
-    __system_property_add;
-    __system_property_area_init;
-    __system_property_set_filename;
-    __system_property_update;
-    android_fdsan_get_fd_table;
-    android_net_res_stats_get_info_for_net;
-    android_net_res_stats_aggregate;
-    android_net_res_stats_get_usable_servers;
-    malloc_backtrace;
-    malloc_disable;
-    malloc_enable;
-    malloc_iterate;
-} LIBC_Q;
diff --git a/libc/libc.x86.map b/libc/libc.x86.map
deleted file mode 100644
index f360dbf..0000000
--- a/libc/libc.x86.map
+++ /dev/null
@@ -1,1519 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __assert;
-    __assert2;
-    __b64_ntop;
-    __b64_pton;
-    __cmsg_nxthdr; # introduced=21
-    __connect; # arm x86 mips introduced=21
-    __ctype_get_mb_cur_max; # introduced=21
-    __cxa_atexit;
-    __cxa_finalize;
-    __cxa_thread_atexit_impl; # introduced=23
-    __dn_comp;
-    __dn_count_labels;
-    __dn_skipname;
-    __epoll_pwait; # arm x86 mips introduced=21
-    __errno;
-    __exit; # arm x86 mips introduced=21
-    __fadvise64; # x86 mips introduced=21
-    __fbufsize; # introduced=23
-    __fcntl64; # arm x86 mips
-    __FD_CLR_chk; # introduced=21
-    __FD_ISSET_chk; # introduced=21
-    __FD_SET_chk; # introduced=21
-    __fgets_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __flbf; # introduced=23
-    __fp_nquery;
-    __fp_query;
-    __fpclassify; # introduced=21
-    __fpclassifyd;
-    __fpclassifyf;
-    __fpclassifyl;
-    __fpending; # introduced=23
-    __fpurge; # introduced=23
-    __freadable; # introduced=23
-    __fsetlocking; # introduced=23
-    __fstatfs64; # arm x86 mips
-    __fwritable; # introduced=23
-    __get_h_errno;
-    __getcpu; # arm x86 mips introduced-arm=12 introduced-mips=16 introduced-x86=12
-    __getcwd; # arm x86 mips
-    __getpid; # arm x86 mips introduced=21
-    __getpriority; # arm x86 mips
-    __gnu_basename; # introduced=23
-    __gnu_strerror_r; # introduced=23
-    __hostalias;
-    __ioctl; # arm x86 mips
-    __isfinite;
-    __isfinitef;
-    __isfinitel;
-    __isinf;
-    __isinff;
-    __isinfl;
-    __isnan; # introduced=21
-    __isnanf; # introduced=21
-    __isnanl;
-    __isnormal;
-    __isnormalf;
-    __isnormall;
-    __isthreaded; # arm x86 mips var
-    __libc_current_sigrtmax; # introduced=21
-    __libc_current_sigrtmin; # introduced=21
-    __libc_init;
-    __llseek; # arm x86 mips
-    __loc_aton;
-    __loc_ntoa;
-    __memchr_chk; # introduced=23
-    __memcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memmove_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memrchr_chk; # introduced=23
-    __memset_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __mmap2; # arm x86 mips
-    __ns_format_ttl; # arm x86 mips
-    __ns_get16; # arm x86 mips
-    __ns_get32; # arm x86 mips
-    __ns_initparse; # arm x86 mips
-    __ns_makecanon; # arm x86 mips
-    __ns_msg_getflag; # arm x86 mips
-    __ns_name_compress; # arm x86 mips
-    __ns_name_ntol; # arm x86 mips
-    __ns_name_ntop; # arm x86 mips
-    __ns_name_pack; # arm x86 mips
-    __ns_name_pton; # arm x86 mips
-    __ns_name_rollback; # arm x86 mips
-    __ns_name_skip; # arm x86 mips
-    __ns_name_uncompress; # arm x86 mips
-    __ns_name_unpack; # arm x86 mips
-    __ns_parserr; # arm x86 mips
-    __ns_put16; # arm x86 mips
-    __ns_put32; # arm x86 mips
-    __ns_samename; # arm x86 mips
-    __ns_skiprr; # arm x86 mips
-    __ns_sprintrr; # arm x86 mips
-    __ns_sprintrrf; # arm x86 mips
-    __open_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __openat; # arm x86 mips
-    __openat_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __p_cdname;
-    __p_cdnname;
-    __p_class;
-    __p_class_syms; # var
-    __p_fqname;
-    __p_fqnname;
-    __p_option;
-    __p_query;
-    __p_rcode;
-    __p_secstodate;
-    __p_time;
-    __p_type;
-    __p_type_syms; # var
-    __poll_chk; # introduced=23
-    __ppoll; # arm x86 mips introduced=21
-    __ppoll_chk; # introduced=23
-    __ppoll64_chk; # introduced=28
-    __pread64_chk; # introduced=23
-    __pread_chk; # introduced=23
-    __progname; # var
-    __pselect6; # arm x86 mips introduced=21
-    __pthread_cleanup_pop;
-    __pthread_cleanup_push;
-    __ptrace; # arm x86 mips
-    __putlong;
-    __putshort;
-    __read_chk; # introduced=21
-    __readlink_chk; # introduced=23
-    __readlinkat_chk; # introduced=23
-    __reboot; # arm x86 mips
-    __recvfrom_chk; # introduced=21
-    __register_atfork; # introduced=23
-    __res_close;
-    __res_dnok;
-    __res_hnok;
-    __res_hostalias;
-    __res_isourserver;
-    __res_mailok;
-    __res_nameinquery;
-    __res_nclose;
-    __res_ninit;
-    __res_nmkquery;
-    __res_nquery;
-    __res_nquerydomain;
-    __res_nsearch;
-    __res_nsend;
-    __res_ownok;
-    __res_queriesmatch;
-    __res_querydomain;
-    __res_send;
-    __res_send_setqhook;
-    __res_send_setrhook;
-    __rt_sigaction; # arm x86 mips
-    __rt_sigpending; # arm x86 mips introduced=21
-    __rt_sigprocmask; # arm x86 mips
-    __rt_sigsuspend; # arm x86 mips introduced=21
-    __rt_sigtimedwait; # arm x86 mips
-    __sched_cpualloc; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpucount; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpufree; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_getaffinity; # arm x86 mips introduced=12
-    __set_thread_area; # x86
-    __set_tid_address; # arm x86 mips introduced=21
-    __sF; # var
-    __sigaction; # arm x86 mips introduced=21
-    __snprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __socket; # arm x86 mips introduced=21
-    __sprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __stack_chk_fail;
-    __stack_chk_guard; # var
-    __statfs64; # arm x86 mips
-    __stpcpy_chk; # introduced=21
-    __stpncpy_chk; # introduced=21
-    __stpncpy_chk2; # introduced=21
-    __strcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __strcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlen_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk2; # introduced=21
-    __strrchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __sym_ntop;
-    __sym_ntos;
-    __sym_ston;
-    __system_property_area_serial; # introduced=23
-    __system_property_find;
-    __system_property_find_nth;
-    __system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_get;
-    __system_property_read;
-    __system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __timer_create; # arm x86 mips
-    __timer_delete; # arm x86 mips
-    __timer_getoverrun; # arm x86 mips
-    __timer_gettime; # arm x86 mips
-    __timer_settime; # arm x86 mips
-    __umask_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __vsnprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __vsprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __waitid; # arm x86 mips
-    _ctype_; # var
-    _Exit; # introduced=21
-    _exit;
-    _flushlbf; # introduced=23
-    _getlong;
-    _getshort;
-    _longjmp;
-    _resolv_delete_cache_for_net; # introduced=21
-    _resolv_flush_cache_for_net; # introduced=21
-    _resolv_set_nameservers_for_net; # introduced=21
-    _setjmp;
-    _tolower; # introduced=21
-    _tolower_tab_; # arm x86 mips var
-    _toupper; # introduced=21
-    _toupper_tab_; # arm x86 mips var
-    abort;
-    abs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    accept;
-    accept4; # introduced=21
-    access;
-    acct;
-    alarm;
-    alphasort;
-    alphasort64; # introduced=21
-    android_set_abort_message; # introduced=21
-    arc4random;
-    arc4random_buf;
-    arc4random_uniform;
-    asctime;
-    asctime64; # arm x86 mips
-    asctime64_r; # arm x86 mips
-    asctime_r;
-    asprintf;
-    at_quick_exit; # introduced=21
-    atof; # introduced=21
-    atoi;
-    atol;
-    atoll;
-    basename;
-    basename_r; # arm x86 mips
-    bind;
-    bindresvport;
-    brk;
-    bsearch;
-    btowc;
-    c16rtomb; # introduced=21
-    c32rtomb; # introduced=21
-    calloc;
-    capget;
-    capset;
-    cfgetispeed; # introduced=21
-    cfgetospeed; # introduced=21
-    cfmakeraw; # introduced=21
-    cfsetispeed; # introduced=21
-    cfsetospeed; # introduced=21
-    cfsetspeed; # introduced=21
-    chdir;
-    chmod;
-    chown;
-    chroot;
-    clearenv;
-    clearerr;
-    clearerr_unlocked; # introduced=23
-    clock;
-    clock_getcpuclockid; # introduced=23
-    clock_getres;
-    clock_gettime;
-    clock_nanosleep;
-    clock_settime;
-    clone; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    close;
-    closedir;
-    closelog;
-    connect;
-    creat;
-    creat64; # introduced=21
-    ctime;
-    ctime64; # arm x86 mips
-    ctime64_r; # arm x86 mips
-    ctime_r;
-    daemon;
-    daylight; # var
-    delete_module;
-    difftime;
-    dirfd;
-    dirname;
-    dirname_r; # arm x86 mips
-    div;
-    dn_expand;
-    dprintf; # introduced=21
-    drand48;
-    dup;
-    dup2;
-    dup3; # introduced=21
-    duplocale; # introduced=21
-    endmntent; # introduced=21
-    endservent;
-    endutent;
-    environ; # var
-    epoll_create;
-    epoll_create1; # introduced=21
-    epoll_ctl;
-    epoll_pwait; # introduced=21
-    epoll_wait;
-    erand48;
-    err;
-    error; # introduced=23
-    error_at_line; # introduced=23
-    error_message_count; # var introduced=23
-    error_one_per_line; # var introduced=23
-    error_print_progname; # var introduced=23
-    errx;
-    ether_aton; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_aton_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    eventfd;
-    eventfd_read;
-    eventfd_write;
-    execl;
-    execle;
-    execlp;
-    execv;
-    execve;
-    execvp;
-    execvpe; # introduced=21
-    exit;
-    faccessat; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fallocate; # introduced=21
-    fallocate64; # introduced=21
-    fchdir;
-    fchmod;
-    fchmodat;
-    fchown;
-    fchownat;
-    fclose;
-    fcntl;
-    fdatasync;
-    fdopen;
-    fdopendir;
-    fdprintf; # arm x86 mips versioned=28
-    feof;
-    feof_unlocked; # introduced=23
-    ferror;
-    ferror_unlocked; # introduced=23
-    fflush;
-    ffs; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    fgetc;
-    fgetln;
-    fgetpos;
-    fgets;
-    fgetwc;
-    fgetws;
-    fgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fileno;
-    flistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    flock;
-    flockfile;
-    fmemopen; # introduced=23
-    fnmatch;
-    fopen;
-    fork;
-    forkpty; # introduced=23
-    fpathconf;
-    fprintf;
-    fpurge;
-    fputc;
-    fputs;
-    fputwc;
-    fputws;
-    fread;
-    free;
-    freeaddrinfo;
-    freelocale; # introduced=21
-    fremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    freopen;
-    fscanf;
-    fseek;
-    fseeko;
-    fsetpos;
-    fsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fstat;
-    fstat64; # introduced=21
-    fstatat;
-    fstatat64; # introduced=21
-    fstatfs;
-    fstatfs64; # introduced=21
-    fstatvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fstatvfs64; # introduced=21
-    fsync;
-    ftell;
-    ftello;
-    ftok;
-    ftruncate;
-    ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ftrylockfile;
-    fts_children; # introduced=21
-    fts_close; # introduced=21
-    fts_open; # introduced=21
-    fts_read; # introduced=21
-    fts_set; # introduced=21
-    ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    ftw64; # introduced=21
-    funlockfile;
-    funopen;
-    futimens; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fwide;
-    fwprintf;
-    fwrite;
-    fwscanf;
-    gai_strerror;
-    get_avphys_pages; # introduced=23
-    get_nprocs; # introduced=23
-    get_nprocs_conf; # introduced=23
-    get_phys_pages; # introduced=23
-    getaddrinfo;
-    getauxval; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getc;
-    getc_unlocked;
-    getchar;
-    getchar_unlocked;
-    getcwd;
-    getdelim; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getegid;
-    getenv;
-    geteuid;
-    getgid;
-    getgrgid;
-    getgrnam;
-    getgrouplist;
-    getgroups;
-    gethostbyaddr;
-    gethostbyaddr_r; # introduced=23
-    gethostbyname;
-    gethostbyname2;
-    gethostbyname2_r; # introduced=23
-    gethostbyname_r;
-    gethostent;
-    gethostname;
-    getitimer;
-    getline; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getlogin;
-    getmntent;
-    getmntent_r; # introduced=21
-    getnameinfo;
-    getnetbyaddr;
-    getnetbyname;
-    getopt;
-    getopt_long;
-    getopt_long_only;
-    getpagesize; # introduced=21
-    getpeername;
-    getpgid;
-    getpgrp;
-    getpid;
-    getppid;
-    getpriority;
-    getprogname; # introduced=21
-    getprotobyname;
-    getprotobynumber;
-    getpt;
-    getpwnam;
-    getpwnam_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getpwuid;
-    getpwuid_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getresgid;
-    getresuid;
-    getrlimit;
-    getrlimit64; # introduced=21
-    getrusage;
-    gets;
-    getservbyname;
-    getservbyport;
-    getservent;
-    getsid; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    getsockname;
-    getsockopt;
-    gettid;
-    gettimeofday;
-    getuid;
-    getutent;
-    getwc;
-    getwchar;
-    getxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    gmtime;
-    gmtime64; # arm x86 mips
-    gmtime64_r; # arm x86 mips
-    gmtime_r;
-    grantpt; # introduced=21
-    herror;
-    hstrerror;
-    htonl; # introduced=21
-    htons; # introduced=21
-    if_indextoname;
-    if_nametoindex;
-    imaxabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    imaxdiv; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    inet_addr;
-    inet_aton;
-    inet_lnaof; # introduced=21
-    inet_makeaddr; # introduced=21
-    inet_netof; # introduced=21
-    inet_network; # introduced=21
-    inet_nsap_addr;
-    inet_nsap_ntoa;
-    inet_ntoa;
-    inet_ntop;
-    inet_pton;
-    init_module;
-    initgroups;
-    initstate; # introduced=21
-    inotify_add_watch;
-    inotify_init;
-    inotify_init1; # introduced=21
-    inotify_rm_watch;
-    insque; # introduced=21
-    ioctl;
-    isalnum;
-    isalnum_l; # introduced=21
-    isalpha;
-    isalpha_l; # introduced=21
-    isascii;
-    isatty;
-    isblank;
-    isblank_l; # introduced=21
-    iscntrl;
-    iscntrl_l; # introduced=21
-    isdigit;
-    isdigit_l; # introduced=21
-    isfinite; # introduced=21
-    isfinitef; # introduced=21
-    isfinitel; # introduced=21
-    isgraph;
-    isgraph_l; # introduced=21
-    isinf; # introduced=21
-    isinff; # introduced=21
-    isinfl; # introduced=21
-    islower;
-    islower_l; # introduced=21
-    isnan;
-    isnanf;
-    isnanl; # introduced=21
-    isnormal; # introduced=21
-    isnormalf; # introduced=21
-    isnormall; # introduced=21
-    isprint;
-    isprint_l; # introduced=21
-    ispunct;
-    ispunct_l; # introduced=21
-    isspace;
-    isspace_l; # introduced=21
-    isupper;
-    isupper_l; # introduced=21
-    iswalnum;
-    iswalnum_l; # introduced=21
-    iswalpha;
-    iswalpha_l; # introduced=21
-    iswblank; # introduced=21
-    iswblank_l; # introduced=21
-    iswcntrl;
-    iswcntrl_l; # introduced=21
-    iswctype;
-    iswctype_l; # introduced=21
-    iswdigit;
-    iswdigit_l; # introduced=21
-    iswgraph;
-    iswgraph_l; # introduced=21
-    iswlower;
-    iswlower_l; # introduced=21
-    iswprint;
-    iswprint_l; # introduced=21
-    iswpunct;
-    iswpunct_l; # introduced=21
-    iswspace;
-    iswspace_l; # introduced=21
-    iswupper;
-    iswupper_l; # introduced=21
-    iswxdigit;
-    iswxdigit_l; # introduced=21
-    isxdigit;
-    isxdigit_l; # introduced=21
-    jrand48;
-    kill;
-    killpg;
-    klogctl;
-    labs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lchown;
-    lcong48; # introduced=23
-    ldexp;
-    ldiv;
-    lfind; # introduced=21
-    lgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    link;
-    linkat; # introduced=21
-    listen;
-    listxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    llabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lldiv;
-    llistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    localeconv; # introduced=21
-    localtime;
-    localtime64; # arm x86 mips
-    localtime64_r; # arm x86 mips
-    localtime_r;
-    login_tty; # introduced=23
-    longjmp;
-    lrand48;
-    lremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lsearch; # introduced=21
-    lseek;
-    lseek64;
-    lsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lstat;
-    lstat64; # introduced=21
-    madvise;
-    mallinfo;
-    malloc;
-    malloc_info; # introduced=23
-    malloc_usable_size; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mbrlen;
-    mbrtoc16; # introduced=21
-    mbrtoc32; # introduced=21
-    mbrtowc;
-    mbsinit;
-    mbsnrtowcs; # introduced=21
-    mbsrtowcs;
-    mbstowcs;
-    mbtowc; # introduced=21
-    memalign;
-    memccpy;
-    memchr;
-    memcmp;
-    memcpy;
-    memmem;
-    memmove;
-    mempcpy; # introduced=23
-    memrchr;
-    memset;
-    mincore;
-    mkdir;
-    mkdirat;
-    mkdtemp;
-    mkfifo; # introduced=21
-    mkfifoat; # introduced=23
-    mknod;
-    mknodat; # introduced=21
-    mkostemp; # introduced=23
-    mkostemp64; # introduced=23
-    mkostemps; # introduced=23
-    mkostemps64; # introduced=23
-    mkstemp;
-    mkstemp64; # introduced=21
-    mkstemps;
-    mkstemps64; # introduced=23
-    mktemp;
-    mktime;
-    mktime64; # arm x86 mips
-    mlock;
-    mlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mmap;
-    mmap64; # introduced=21
-    mount;
-    mprotect;
-    mrand48;
-    mremap;
-    msync;
-    munlock;
-    munlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    munmap;
-    nanosleep;
-    newlocale; # introduced=21
-    nftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    nftw64; # introduced=21
-    nice;
-    nrand48;
-    nsdispatch;
-    ntohl; # introduced=21
-    ntohs; # introduced=21
-    open;
-    open64; # introduced=21
-    open_memstream; # introduced=23
-    open_wmemstream; # introduced=23
-    openat;
-    openat64; # introduced=21
-    opendir;
-    openlog;
-    openpty; # introduced=23
-    optarg; # var
-    opterr; # var
-    optind; # var
-    optopt; # var
-    optreset; # var
-    pathconf;
-    pause;
-    pclose;
-    perror;
-    personality; # introduced-arm=15 introduced-arm64=21 introduced-mips=15 introduced-mips64=21 introduced-x86=15 introduced-x86_64=21
-    pipe;
-    pipe2;
-    poll;
-    popen;
-    posix_fadvise; # introduced=21
-    posix_fadvise64; # introduced=21
-    posix_fallocate; # introduced=21
-    posix_fallocate64; # introduced=21
-    posix_madvise; # introduced=23
-    posix_memalign; # introduced=17
-    posix_openpt; # introduced=21
-    ppoll; # introduced=21
-    prctl;
-    pread;
-    pread64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    printf;
-    prlimit64; # introduced=21
-    process_vm_readv; # introduced=23
-    process_vm_writev; # introduced=23
-    pselect;
-    psiginfo; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    psignal; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    pthread_atfork; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    pthread_attr_destroy;
-    pthread_attr_getdetachstate;
-    pthread_attr_getguardsize;
-    pthread_attr_getschedparam;
-    pthread_attr_getschedpolicy;
-    pthread_attr_getscope;
-    pthread_attr_getstack;
-    pthread_attr_getstacksize;
-    pthread_attr_init;
-    pthread_attr_setdetachstate;
-    pthread_attr_setguardsize;
-    pthread_attr_setschedparam;
-    pthread_attr_setschedpolicy;
-    pthread_attr_setscope;
-    pthread_attr_setstack;
-    pthread_attr_setstacksize;
-    pthread_cond_broadcast;
-    pthread_cond_destroy;
-    pthread_cond_init;
-    pthread_cond_signal;
-    pthread_cond_timedwait;
-    pthread_cond_timedwait_monotonic; # arm x86 mips
-    pthread_cond_timedwait_monotonic_np; # introduced-arm=9 introduced-x86=9 introduced-mips=9 introduced-arm64=28 introduced-x64_64=28 introduced-mips64=28
-    pthread_cond_timedwait_relative_np; # arm x86 mips
-    pthread_cond_timeout_np; # arm x86 mips
-    pthread_cond_wait;
-    pthread_condattr_destroy;
-    pthread_condattr_getclock; # introduced=21
-    pthread_condattr_getpshared;
-    pthread_condattr_init;
-    pthread_condattr_setclock; # introduced=21
-    pthread_condattr_setpshared;
-    pthread_create;
-    pthread_detach;
-    pthread_equal;
-    pthread_exit;
-    pthread_getattr_np;
-    pthread_getcpuclockid;
-    pthread_getschedparam;
-    pthread_getspecific;
-    pthread_gettid_np; # introduced=21
-    pthread_join;
-    pthread_key_create;
-    pthread_key_delete;
-    pthread_kill;
-    pthread_mutex_destroy;
-    pthread_mutex_init;
-    pthread_mutex_lock;
-    pthread_mutex_lock_timeout_np; # arm x86 mips
-    pthread_mutex_timedlock; # introduced=21
-    pthread_mutex_trylock;
-    pthread_mutex_unlock;
-    pthread_mutexattr_destroy;
-    pthread_mutexattr_getpshared;
-    pthread_mutexattr_gettype;
-    pthread_mutexattr_init;
-    pthread_mutexattr_setpshared;
-    pthread_mutexattr_settype;
-    pthread_once;
-    pthread_rwlock_destroy;
-    pthread_rwlock_init;
-    pthread_rwlock_rdlock;
-    pthread_rwlock_timedrdlock;
-    pthread_rwlock_timedwrlock;
-    pthread_rwlock_tryrdlock;
-    pthread_rwlock_trywrlock;
-    pthread_rwlock_unlock;
-    pthread_rwlock_wrlock;
-    pthread_rwlockattr_destroy;
-    pthread_rwlockattr_getkind_np; # introduced=23
-    pthread_rwlockattr_getpshared;
-    pthread_rwlockattr_init;
-    pthread_rwlockattr_setkind_np; # introduced=23
-    pthread_rwlockattr_setpshared;
-    pthread_self;
-    pthread_setname_np;
-    pthread_setschedparam;
-    pthread_setspecific;
-    pthread_sigmask;
-    ptrace;
-    ptsname;
-    ptsname_r;
-    putc;
-    putc_unlocked;
-    putchar;
-    putchar_unlocked;
-    putenv;
-    puts;
-    pututline;
-    putw; # arm x86 mips
-    putwc;
-    putwchar;
-    pvalloc; # arm x86 mips introduced=17
-    pwrite;
-    pwrite64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    qsort;
-    quick_exit; # introduced=21
-    raise;
-    rand; # introduced=21
-    rand_r; # introduced=21
-    random; # introduced=21
-    read;
-    readahead; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    readdir;
-    readdir64; # introduced=21
-    readdir64_r; # introduced=21
-    readdir_r;
-    readlink;
-    readlinkat; # introduced=21
-    readv;
-    realloc;
-    realpath;
-    reboot;
-    recv;
-    recvfrom;
-    recvmmsg; # introduced=21
-    recvmsg;
-    regcomp;
-    regerror;
-    regexec;
-    regfree;
-    remove;
-    removexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    remque; # introduced=21
-    rename;
-    renameat;
-    res_init;
-    res_mkquery;
-    res_query;
-    res_search;
-    rewind;
-    rewinddir;
-    rmdir;
-    sbrk;
-    scandir;
-    scandir64; # introduced=21
-    scanf;
-    sched_get_priority_max;
-    sched_get_priority_min;
-    sched_getaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getcpu; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getparam;
-    sched_getscheduler;
-    sched_rr_get_interval;
-    sched_setaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_setparam;
-    sched_setscheduler;
-    sched_yield;
-    seed48;
-    seekdir; # introduced=23
-    select;
-    sem_close;
-    sem_destroy;
-    sem_getvalue;
-    sem_init;
-    sem_open;
-    sem_post;
-    sem_timedwait;
-    sem_trywait;
-    sem_unlink;
-    sem_wait;
-    send;
-    sendfile;
-    sendfile64; # introduced=21
-    sendmmsg; # introduced=21
-    sendmsg;
-    sendto;
-    setbuf;
-    setbuffer;
-    setegid;
-    setenv;
-    seteuid;
-    setfsgid; # introduced=21
-    setfsuid; # introduced=21
-    setgid;
-    setgroups;
-    sethostname; # introduced=23
-    setitimer;
-    setjmp;
-    setlinebuf;
-    setlocale;
-    setlogmask;
-    setmntent; # introduced=21
-    setns; # introduced=21
-    setpgid;
-    setpgrp;
-    setpriority;
-    setprogname; # introduced=21
-    setregid;
-    setresgid;
-    setresuid;
-    setreuid;
-    setrlimit;
-    setrlimit64; # introduced=21
-    setservent;
-    setsid;
-    setsockopt;
-    setstate; # introduced=21
-    settimeofday;
-    setuid;
-    setutent;
-    setvbuf;
-    setxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    shutdown;
-    sigaction;
-    sigaddset; # introduced=21
-    sigaltstack;
-    sigblock;
-    sigdelset; # introduced=21
-    sigemptyset; # introduced=21
-    sigfillset; # introduced=21
-    siginterrupt;
-    sigismember; # introduced=21
-    siglongjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    signal; # introduced=21
-    signalfd; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    sigpending;
-    sigprocmask;
-    sigqueue; # introduced=23
-    sigsetjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sigsetmask;
-    sigsuspend;
-    sigtimedwait; # introduced=23
-    sigwait;
-    sigwaitinfo; # introduced=23
-    sleep;
-    snprintf;
-    socket;
-    socketpair;
-    splice; # introduced=21
-    sprintf;
-    srand; # introduced=21
-    srand48;
-    srandom; # introduced=21
-    sscanf;
-    stat;
-    stat64; # introduced=21
-    statfs;
-    statfs64; # introduced=21
-    statvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    statvfs64; # introduced=21
-    stderr; # var introduced=23
-    stdin; # var introduced=23
-    stdout; # var introduced=23
-    stpcpy; # introduced=21
-    stpncpy; # introduced=21
-    strcasecmp;
-    strcasecmp_l; # introduced=23
-    strcasestr;
-    strcat;
-    strchr;
-    strcmp;
-    strcoll;
-    strcoll_l; # introduced=21
-    strcpy;
-    strcspn;
-    strdup;
-    strerror;
-    strerror_l; # introduced=23
-    strerror_r;
-    strftime;
-    strftime_l; # introduced=21
-    strlcat;
-    strlcpy;
-    strlen;
-    strncasecmp;
-    strncasecmp_l; # introduced=23
-    strncat;
-    strncmp;
-    strncpy;
-    strndup;
-    strnlen;
-    strpbrk;
-    strptime;
-    strrchr;
-    strsep;
-    strsignal;
-    strspn;
-    strstr;
-    strtod;
-    strtof; # introduced=21
-    strtoimax;
-    strtok;
-    strtok_r;
-    strtol;
-    strtold; # introduced=21
-    strtold_l; # introduced=21
-    strtoll;
-    strtoll_l; # introduced=21
-    strtoq; # introduced=21
-    strtoul;
-    strtoull;
-    strtoull_l; # introduced=21
-    strtoumax;
-    strtouq; # introduced=21
-    strxfrm;
-    strxfrm_l; # introduced=21
-    swapoff; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swapon; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swprintf;
-    swscanf;
-    symlink;
-    symlinkat; # introduced=21
-    sync;
-    sys_siglist; # var
-    sys_signame; # var
-    syscall;
-    sysconf;
-    sysinfo;
-    syslog;
-    system;
-    tcdrain; # introduced=21
-    tcflow; # introduced=21
-    tcflush; # introduced=21
-    tcgetattr; # introduced=21
-    tcgetpgrp;
-    tcgetsid; # introduced=21
-    tcsendbreak; # introduced=21
-    tcsetattr; # introduced=21
-    tcsetpgrp;
-    tdelete; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tdestroy; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tee; # introduced=21
-    telldir; # introduced=23
-    tempnam;
-    tfind; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tgkill; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    time;
-    timegm; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timegm64; # arm x86 mips
-    timelocal; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timelocal64; # arm x86 mips
-    timer_create;
-    timer_delete;
-    timer_getoverrun;
-    timer_gettime;
-    timer_settime;
-    timerfd_create; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_gettime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_settime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    times;
-    timezone; # var
-    tmpfile;
-    tmpnam;
-    toascii;
-    tolower;
-    tolower_l; # introduced=21
-    toupper;
-    toupper_l; # introduced=21
-    towlower;
-    towlower_l; # introduced=21
-    towupper;
-    towupper_l; # introduced=21
-    truncate;
-    truncate64; # introduced=21
-    tsearch; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    ttyname;
-    ttyname_r;
-    twalk; # introduced=21
-    tzname; # var
-    tzset;
-    umask;
-    umount;
-    umount2;
-    uname;
-    ungetc;
-    ungetwc;
-    unlink;
-    unlinkat;
-    unlockpt;
-    unsetenv;
-    unshare; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    uselocale; # introduced=21
-    usleep;
-    utime;
-    utimensat; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    utimes;
-    utmpname;
-    valloc; # arm x86 mips
-    vasprintf;
-    vdprintf; # introduced=21
-    verr;
-    verrx;
-    vfdprintf; # arm x86 mips versioned=28
-    vfork;
-    vfprintf;
-    vfscanf;
-    vfwprintf;
-    vfwscanf; # introduced=21
-    vmsplice; # introduced=21
-    vprintf;
-    vscanf;
-    vsnprintf;
-    vsprintf;
-    vsscanf;
-    vswprintf;
-    vswscanf; # introduced=21
-    vsyslog;
-    vwarn;
-    vwarnx;
-    vwprintf;
-    vwscanf; # introduced=21
-    wait;
-    wait4; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    waitid;
-    waitpid;
-    warn;
-    warnx;
-    wcpcpy;
-    wcpncpy;
-    wcrtomb;
-    wcscasecmp;
-    wcscasecmp_l; # introduced=23
-    wcscat;
-    wcschr;
-    wcscmp;
-    wcscoll;
-    wcscoll_l; # introduced=21
-    wcscpy;
-    wcscspn;
-    wcsdup;
-    wcsftime;
-    wcslcat;
-    wcslcpy;
-    wcslen;
-    wcsncasecmp;
-    wcsncasecmp_l; # introduced=23
-    wcsncat;
-    wcsncmp;
-    wcsncpy;
-    wcsnlen;
-    wcsnrtombs; # introduced=21
-    wcspbrk;
-    wcsrchr;
-    wcsrtombs;
-    wcsspn;
-    wcsstr;
-    wcstod;
-    wcstof; # introduced=21
-    wcstoimax; # introduced=21
-    wcstok;
-    wcstol;
-    wcstold; # introduced=21
-    wcstold_l; # introduced=21
-    wcstoll; # introduced=21
-    wcstoll_l; # introduced=21
-    wcstombs;
-    wcstoul;
-    wcstoull; # introduced=21
-    wcstoull_l; # introduced=21
-    wcstoumax; # introduced=21
-    wcswidth;
-    wcsxfrm;
-    wcsxfrm_l; # introduced=21
-    wctob;
-    wctomb; # introduced=21
-    wctype;
-    wctype_l; # introduced=21
-    wcwidth;
-    wmemchr;
-    wmemcmp;
-    wmemcpy;
-    wmemmove;
-    wmempcpy; # introduced=23
-    wmemset;
-    wprintf;
-    write;
-    writev;
-    wscanf;
-  local:
-    *;
-};
-
-LIBC_N { # introduced-arm64=24 introduced-mips=24 introduced-mips64=24 introduced-x86=24 introduced-x86_64=24
-  global:
-    __fread_chk; # introduced=24
-    __fwrite_chk; # introduced=24
-    __getcwd_chk; # introduced=24
-    __pwrite_chk; # introduced=24
-    __pwrite64_chk; # introduced=24
-    __write_chk; # introduced=24
-    adjtimex; # introduced=24
-    clock_adjtime; # introduced=24
-    fgetpos64; # introduced=24
-    fileno_unlocked; # introduced=24
-    fopen64; # introduced=24
-    freeifaddrs; # introduced=24
-    freopen64; # introduced=24
-    fseeko64; # introduced=24
-    fsetpos64; # introduced=24
-    ftello64; # introduced=24
-    funopen64; # introduced=24
-    getgrgid_r; # introduced=24
-    getgrnam_r; # introduced=24
-    getifaddrs; # introduced=24
-    if_freenameindex; # introduced=24
-    if_nameindex; # introduced=24
-    in6addr_any; # var introduced=24
-    in6addr_loopback; # var introduced=24
-    lockf; # introduced=24
-    lockf64; # introduced=24
-    preadv; # introduced=24
-    preadv64; # introduced=24
-    prlimit; # arm mips x86 introduced=24
-    pthread_barrierattr_destroy; # introduced=24
-    pthread_barrierattr_getpshared; # introduced=24
-    pthread_barrierattr_init; # introduced=24
-    pthread_barrierattr_setpshared; # introduced=24
-    pthread_barrier_destroy; # introduced=24
-    pthread_barrier_init; # introduced=24
-    pthread_barrier_wait; # introduced=24
-    pthread_spin_destroy; # introduced=24
-    pthread_spin_init; # introduced=24
-    pthread_spin_lock; # introduced=24
-    pthread_spin_trylock; # introduced=24
-    pthread_spin_unlock; # introduced=24
-    pwritev; # introduced=24
-    pwritev64; # introduced=24
-    scandirat; # introduced=24
-    scandirat64; # introduced=24
-    strchrnul; # introduced=24
-    tmpfile64; # introduced=24
-} LIBC;
-
-LIBC_O {
-  global:
-    __sendto_chk; # introduced=26
-    __system_property_read_callback; # introduced=26
-    __system_property_wait; # introduced=26
-    bsd_signal; # arm x86 mips versioned=26
-    catclose; # introduced=26
-    catgets; # introduced=26
-    catopen; # introduced=26
-    ctermid; # introduced=26
-    endgrent; # introduced=26
-    endpwent; # introduced=26
-    futimes; # introduced=26
-    futimesat; # introduced=26
-    getdomainname; # introduced=26
-    getgrent; # introduced=26
-    getpwent; # introduced=26
-    getsubopt; # introduced=26
-    hasmntopt; # introduced=26
-    lutimes; # introduced=26
-    mallopt; # introduced=26
-    mblen; # introduced=26
-    msgctl; # introduced=26
-    msgget; # introduced=26
-    msgrcv; # introduced=26
-    msgsnd; # introduced=26
-    nl_langinfo; # introduced=26
-    nl_langinfo_l; # introduced=26
-    pthread_getname_np; # introduced=26
-    quotactl; # introduced=26
-    semctl; # introduced=26
-    semget; # introduced=26
-    semop; # introduced=26
-    semtimedop; # introduced=26
-    setdomainname; # introduced=26
-    setgrent; # introduced=26
-    setpwent; # introduced=26
-    shmat; # introduced=26
-    shmctl; # introduced=26
-    shmdt; # introduced=26
-    shmget; # introduced=26
-    sighold; # introduced=26
-    sigignore; # introduced=26
-    sigpause; # introduced=26
-    sigrelse; # introduced=26
-    sigset; # introduced=26
-    strtod_l; # introduced=26
-    strtof_l; # introduced=26
-    strtol_l; # introduced=26
-    strtoul_l; # introduced=26
-    sync_file_range; # introduced=26
-    towctrans; # introduced=26
-    towctrans_l; # introduced=26
-    wctrans; # introduced=26
-    wctrans_l; # introduced=26
-} LIBC_N;
-
-LIBC_P { # introduced=P
-  global:
-    __freading;
-    __free_hook;
-    __fseterr;
-    __fwriting;
-    __malloc_hook;
-    __memalign_hook;
-    __realloc_hook;
-    aligned_alloc;
-    endhostent;
-    endnetent;
-    endprotoent;
-    epoll_pwait64;
-    fexecve;
-    fflush_unlocked;
-    fgetc_unlocked;
-    fgets_unlocked;
-    fputc_unlocked;
-    fputs_unlocked;
-    fread_unlocked;
-    fwrite_unlocked;
-    getentropy;
-    getnetent;
-    getprotoent;
-    getrandom;
-    getlogin_r;
-    glob;
-    globfree;
-    hcreate;
-    hcreate_r;
-    hdestroy;
-    hdestroy_r;
-    hsearch;
-    hsearch_r;
-    iconv;
-    iconv_close;
-    iconv_open;
-    posix_spawn;
-    posix_spawnattr_destroy;
-    posix_spawnattr_getflags;
-    posix_spawnattr_getpgroup;
-    posix_spawnattr_getschedparam;
-    posix_spawnattr_getschedpolicy;
-    posix_spawnattr_getsigdefault;
-    posix_spawnattr_getsigdefault64;
-    posix_spawnattr_getsigmask;
-    posix_spawnattr_getsigmask64;
-    posix_spawnattr_init;
-    posix_spawnattr_setflags;
-    posix_spawnattr_setpgroup;
-    posix_spawnattr_setschedparam;
-    posix_spawnattr_setschedpolicy;
-    posix_spawnattr_setsigdefault;
-    posix_spawnattr_setsigdefault64;
-    posix_spawnattr_setsigmask;
-    posix_spawnattr_setsigmask64;
-    posix_spawn_file_actions_addclose;
-    posix_spawn_file_actions_adddup2;
-    posix_spawn_file_actions_addopen;
-    posix_spawn_file_actions_destroy;
-    posix_spawn_file_actions_init;
-    posix_spawnp;
-    ppoll64;
-    pselect64;
-    pthread_attr_getinheritsched;
-    pthread_attr_setinheritsched;
-    pthread_mutex_timedlock_monotonic_np;
-    pthread_mutexattr_getprotocol;
-    pthread_mutexattr_setprotocol;
-    pthread_rwlock_timedrdlock_monotonic_np;
-    pthread_rwlock_timedwrlock_monotonic_np;
-    pthread_setschedprio;
-    pthread_sigmask64;
-    sem_timedwait_monotonic_np;
-    sethostent;
-    setnetent;
-    setprotoent;
-    sigaction64;
-    sigaddset64;
-    sigdelset64;
-    sigemptyset64;
-    sigfillset64;
-    sigismember64;
-    signalfd64;
-    sigpending64;
-    sigprocmask64;
-    sigsuspend64;
-    sigtimedwait64;
-    sigwait64;
-    sigwaitinfo64;
-    strptime_l;
-    swab;
-    syncfs;
-    wcsftime_l;
-    wcstod_l;
-    wcstof_l;
-    wcstol_l;
-    wcstoul_l;
-} LIBC_O;
-
-LIBC_Q { # introduced=Q
-  global:
-    __res_randomid;
-    android_fdsan_close_with_tag;
-    android_fdsan_create_owner_tag;
-    android_fdsan_exchange_owner_tag;
-    android_fdsan_get_owner_tag;
-    android_fdsan_get_tag_type;
-    android_fdsan_get_tag_value;
-    android_fdsan_get_error_level;
-    android_fdsan_set_error_level;
-    android_get_device_api_level;
-    getloadavg;
-    pthread_sigqueue;
-    reallocarray;
-    timespec_get;
-} LIBC_P;
-
-LIBC_PRIVATE {
-  global:
-    __accept4; # arm x86 mips
-    __bionic_brk; # arm x86 mips
-    __bionic_libgcc_compat_symbols; # arm x86
-    __divdi3; # arm x86 mips
-    __futex_wait; # arm x86 mips
-    __futex_wake; # arm x86 mips
-    __get_thread; # arm x86 mips
-    __get_tls; # arm x86 mips
-    __getdents64; # arm x86 mips
-    __open; # arm x86 mips
-    __page_shift; # arm x86 mips
-    __page_size; # arm x86 mips
-    __popcountsi2; # arm x86 mips
-    __pthread_gettid; # arm x86 mips
-    __sclose; # arm x86 mips
-    __sdidinit; # arm x86 mips
-    __set_errno; # arm x86 mips
-    __sflags; # arm x86 mips
-    __sflush; # arm x86 mips
-    __sfp; # arm x86 mips
-    __sglue; # arm x86 mips
-    __sinit; # arm x86 mips
-    __smakebuf; # arm x86 mips
-    __sread; # arm x86 mips
-    __srefill; # arm x86 mips
-    __srget; # arm x86 mips
-    __sseek; # arm x86 mips
-    __swbuf; # arm x86 mips
-    __swrite; # arm x86 mips
-    __swsetup; # arm x86 mips
-    __udivdi3; # arm x86 mips
-    __umoddi3; # x86 mips
-    __wait4; # arm x86 mips
-    _fwalk; # arm x86 mips
-    android_getaddrinfofornet;
-    android_getaddrinfofornetcontext;
-    android_gethostbyaddrfornet;
-    android_gethostbyaddrfornetcontext;
-    android_gethostbynamefornet;
-    android_gethostbynamefornetcontext;
-    arc4random_addrandom; # arm x86 mips
-    arc4random_stir; # arm x86 mips
-    bcopy; # arm x86 mips
-    bzero; # arm x86 mips
-    dlmalloc; # arm x86 mips
-    dlmalloc_inspect_all; # arm x86 mips
-    dlmalloc_trim; # arm x86 mips
-    dlmalloc_usable_size; # arm x86 mips
-    free_malloc_leak_info;
-    ftime; # arm x86 mips
-    get_malloc_leak_info;
-    getdents; # arm x86 mips
-    getdtablesize; # arm x86 mips
-    gMallocLeakZygoteChild;
-    index; # arm x86 mips
-    issetugid; # arm x86 mips
-    memswap; # arm x86 mips
-    pthread_attr_getstackaddr; # arm x86 mips
-    pthread_attr_setstackaddr; # arm x86 mips
-    SHA1Final; # arm x86 mips
-    SHA1Init; # arm x86 mips
-    SHA1Transform; # arm x86 mips
-    SHA1Update; # arm x86 mips
-    strntoimax; # arm x86 mips
-    strntoumax; # arm x86 mips
-    strtotimeval; # arm x86 mips
-    sysv_signal; # arm x86 mips
-    tkill; # arm x86 mips
-    wait3; # arm x86 mips
-    wcswcs; # arm x86 mips
-    write_malloc_leak_info;
-} LIBC_Q;
-
-LIBC_DEPRECATED {
-  global:
-    __system_property_wait_any;
-};
-
-LIBC_PLATFORM {
-  global:
-    __system_properties_init;
-    __system_property_area__; # var
-    __system_property_add;
-    __system_property_area_init;
-    __system_property_set_filename;
-    __system_property_update;
-    android_fdsan_get_fd_table;
-    android_net_res_stats_get_info_for_net;
-    android_net_res_stats_aggregate;
-    android_net_res_stats_get_usable_servers;
-    malloc_backtrace;
-    malloc_disable;
-    malloc_enable;
-    malloc_iterate;
-} LIBC_Q;
diff --git a/libc/libc.x86_64.map b/libc/libc.x86_64.map
deleted file mode 100644
index 81ff00d..0000000
--- a/libc/libc.x86_64.map
+++ /dev/null
@@ -1,1397 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __assert;
-    __assert2;
-    __b64_ntop;
-    __b64_pton;
-    __cmsg_nxthdr; # introduced=21
-    __ctype_get_mb_cur_max; # introduced=21
-    __cxa_atexit;
-    __cxa_finalize;
-    __cxa_thread_atexit_impl; # introduced=23
-    __dn_comp;
-    __dn_count_labels;
-    __dn_skipname;
-    __errno;
-    __fbufsize; # introduced=23
-    __FD_CLR_chk; # introduced=21
-    __FD_ISSET_chk; # introduced=21
-    __FD_SET_chk; # introduced=21
-    __fgets_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __flbf; # introduced=23
-    __fp_nquery;
-    __fp_query;
-    __fpclassify; # introduced=21
-    __fpclassifyd;
-    __fpclassifyf;
-    __fpclassifyl;
-    __fpending; # introduced=23
-    __fpurge; # introduced=23
-    __freadable; # introduced=23
-    __fsetlocking; # introduced=23
-    __fwritable; # introduced=23
-    __get_h_errno;
-    __gnu_basename; # introduced=23
-    __gnu_strerror_r; # introduced=23
-    __hostalias;
-    __isfinite;
-    __isfinitef;
-    __isfinitel;
-    __isinf;
-    __isinff;
-    __isinfl;
-    __isnan; # introduced=21
-    __isnanf; # introduced=21
-    __isnanl;
-    __isnormal;
-    __isnormalf;
-    __isnormall;
-    __libc_current_sigrtmax; # introduced=21
-    __libc_current_sigrtmin; # introduced=21
-    __libc_init;
-    __loc_aton;
-    __loc_ntoa;
-    __memchr_chk; # introduced=23
-    __memcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memmove_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __memrchr_chk; # introduced=23
-    __memset_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __open_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __openat_2; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __p_cdname;
-    __p_cdnname;
-    __p_class;
-    __p_class_syms; # var
-    __p_fqname;
-    __p_fqnname;
-    __p_option;
-    __p_query;
-    __p_rcode;
-    __p_secstodate;
-    __p_time;
-    __p_type;
-    __p_type_syms; # var
-    __poll_chk; # introduced=23
-    __ppoll_chk; # introduced=23
-    __ppoll64_chk; # introduced=28
-    __pread64_chk; # introduced=23
-    __pread_chk; # introduced=23
-    __progname; # var
-    __pthread_cleanup_pop;
-    __pthread_cleanup_push;
-    __putlong;
-    __putshort;
-    __read_chk; # introduced=21
-    __readlink_chk; # introduced=23
-    __readlinkat_chk; # introduced=23
-    __recvfrom_chk; # introduced=21
-    __register_atfork; # introduced=23
-    __res_close;
-    __res_dnok;
-    __res_hnok;
-    __res_hostalias;
-    __res_isourserver;
-    __res_mailok;
-    __res_nameinquery;
-    __res_nclose;
-    __res_ninit;
-    __res_nmkquery;
-    __res_nquery;
-    __res_nquerydomain;
-    __res_nsearch;
-    __res_nsend;
-    __res_ownok;
-    __res_queriesmatch;
-    __res_querydomain;
-    __res_send;
-    __res_send_setqhook;
-    __res_send_setrhook;
-    __sched_cpualloc; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpucount; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sched_cpufree; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __sF; # var
-    __snprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __sprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __stack_chk_fail;
-    __stack_chk_guard; # var
-    __stpcpy_chk; # introduced=21
-    __stpncpy_chk; # introduced=21
-    __stpncpy_chk2; # introduced=21
-    __strcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __strcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlcpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strlen_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncat_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __strncpy_chk2; # introduced=21
-    __strrchr_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __sym_ntop;
-    __sym_ntos;
-    __sym_ston;
-    __system_property_area_serial; # introduced=23
-    __system_property_find;
-    __system_property_find_nth;
-    __system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_get;
-    __system_property_read;
-    __system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    __system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    __umask_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    __vsnprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    __vsprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    _ctype_; # var
-    _Exit; # introduced=21
-    _exit;
-    _flushlbf; # introduced=23
-    _getlong;
-    _getshort;
-    _longjmp;
-    _resolv_delete_cache_for_net; # introduced=21
-    _resolv_flush_cache_for_net; # introduced=21
-    _resolv_set_nameservers_for_net; # introduced=21
-    _setjmp;
-    _tolower; # introduced=21
-    _toupper; # introduced=21
-    abort;
-    abs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    accept;
-    accept4; # introduced=21
-    access;
-    acct;
-    alarm;
-    alphasort;
-    alphasort64; # introduced=21
-    android_set_abort_message; # introduced=21
-    arc4random;
-    arc4random_buf;
-    arc4random_uniform;
-    asctime;
-    asctime_r;
-    asprintf;
-    at_quick_exit; # introduced=21
-    atof; # introduced=21
-    atoi;
-    atol;
-    atoll;
-    basename;
-    bind;
-    bindresvport;
-    brk;
-    bsearch;
-    btowc;
-    c16rtomb; # introduced=21
-    c32rtomb; # introduced=21
-    calloc;
-    capget;
-    capset;
-    cfgetispeed; # introduced=21
-    cfgetospeed; # introduced=21
-    cfmakeraw; # introduced=21
-    cfsetispeed; # introduced=21
-    cfsetospeed; # introduced=21
-    cfsetspeed; # introduced=21
-    chdir;
-    chmod;
-    chown;
-    chroot;
-    clearenv;
-    clearerr;
-    clearerr_unlocked; # introduced=23
-    clock;
-    clock_getcpuclockid; # introduced=23
-    clock_getres;
-    clock_gettime;
-    clock_nanosleep;
-    clock_settime;
-    clone; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    close;
-    closedir;
-    closelog;
-    connect;
-    creat;
-    creat64; # introduced=21
-    ctime;
-    ctime_r;
-    daemon;
-    daylight; # var
-    delete_module;
-    difftime;
-    dirfd;
-    dirname;
-    div;
-    dn_expand;
-    dprintf; # introduced=21
-    drand48;
-    dup;
-    dup2;
-    dup3; # introduced=21
-    duplocale; # introduced=21
-    endmntent; # introduced=21
-    endservent;
-    endutent;
-    environ; # var
-    epoll_create;
-    epoll_create1; # introduced=21
-    epoll_ctl;
-    epoll_pwait; # introduced=21
-    epoll_wait;
-    erand48;
-    err;
-    error; # introduced=23
-    error_at_line; # introduced=23
-    error_message_count; # var introduced=23
-    error_one_per_line; # var introduced=23
-    error_print_progname; # var introduced=23
-    errx;
-    ether_aton; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_aton_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ether_ntoa_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    eventfd;
-    eventfd_read;
-    eventfd_write;
-    execl;
-    execle;
-    execlp;
-    execv;
-    execve;
-    execvp;
-    execvpe; # introduced=21
-    exit;
-    faccessat; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fallocate; # introduced=21
-    fallocate64; # introduced=21
-    fchdir;
-    fchmod;
-    fchmodat;
-    fchown;
-    fchownat;
-    fclose;
-    fcntl;
-    fdatasync;
-    fdopen;
-    fdopendir;
-    feof;
-    feof_unlocked; # introduced=23
-    ferror;
-    ferror_unlocked; # introduced=23
-    fflush;
-    ffs; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    fgetc;
-    fgetln;
-    fgetpos;
-    fgets;
-    fgetwc;
-    fgetws;
-    fgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fileno;
-    flistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    flock;
-    flockfile;
-    fmemopen; # introduced=23
-    fnmatch;
-    fopen;
-    fork;
-    forkpty; # introduced=23
-    fpathconf;
-    fprintf;
-    fpurge;
-    fputc;
-    fputs;
-    fputwc;
-    fputws;
-    fread;
-    free;
-    freeaddrinfo;
-    freelocale; # introduced=21
-    fremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    freopen;
-    fscanf;
-    fseek;
-    fseeko;
-    fsetpos;
-    fsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    fstat;
-    fstat64; # introduced=21
-    fstatat;
-    fstatat64; # introduced=21
-    fstatfs;
-    fstatfs64; # introduced=21
-    fstatvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fstatvfs64; # introduced=21
-    fsync;
-    ftell;
-    ftello;
-    ftok;
-    ftruncate;
-    ftruncate64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    ftrylockfile;
-    fts_children; # introduced=21
-    fts_close; # introduced=21
-    fts_open; # introduced=21
-    fts_read; # introduced=21
-    fts_set; # introduced=21
-    ftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    ftw64; # introduced=21
-    funlockfile;
-    funopen;
-    futimens; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    fwide;
-    fwprintf;
-    fwrite;
-    fwscanf;
-    gai_strerror;
-    get_avphys_pages; # introduced=23
-    get_nprocs; # introduced=23
-    get_nprocs_conf; # introduced=23
-    get_phys_pages; # introduced=23
-    getaddrinfo;
-    getauxval; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getc;
-    getc_unlocked;
-    getchar;
-    getchar_unlocked;
-    getcwd;
-    getdelim; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getegid;
-    getenv;
-    geteuid;
-    getgid;
-    getgrgid;
-    getgrnam;
-    getgrouplist;
-    getgroups;
-    gethostbyaddr;
-    gethostbyaddr_r; # introduced=23
-    gethostbyname;
-    gethostbyname2;
-    gethostbyname2_r; # introduced=23
-    gethostbyname_r;
-    gethostent;
-    gethostname;
-    getitimer;
-    getline; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    getlogin;
-    getmntent;
-    getmntent_r; # introduced=21
-    getnameinfo;
-    getnetbyaddr;
-    getnetbyname;
-    getopt;
-    getopt_long;
-    getopt_long_only;
-    getpagesize; # introduced=21
-    getpeername;
-    getpgid;
-    getpgrp;
-    getpid;
-    getppid;
-    getpriority;
-    getprogname; # introduced=21
-    getprotobyname;
-    getprotobynumber;
-    getpt;
-    getpwnam;
-    getpwnam_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getpwuid;
-    getpwuid_r; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    getresgid;
-    getresuid;
-    getrlimit;
-    getrlimit64; # introduced=21
-    getrusage;
-    gets;
-    getservbyname;
-    getservbyport;
-    getservent;
-    getsid; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    getsockname;
-    getsockopt;
-    gettid;
-    gettimeofday;
-    getuid;
-    getutent;
-    getwc;
-    getwchar;
-    getxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    gmtime;
-    gmtime_r;
-    grantpt; # introduced=21
-    herror;
-    hstrerror;
-    htonl; # introduced=21
-    htons; # introduced=21
-    if_indextoname;
-    if_nametoindex;
-    imaxabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    imaxdiv; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    inet_addr;
-    inet_aton;
-    inet_lnaof; # introduced=21
-    inet_makeaddr; # introduced=21
-    inet_netof; # introduced=21
-    inet_network; # introduced=21
-    inet_nsap_addr;
-    inet_nsap_ntoa;
-    inet_ntoa;
-    inet_ntop;
-    inet_pton;
-    init_module;
-    initgroups;
-    initstate; # introduced=21
-    inotify_add_watch;
-    inotify_init;
-    inotify_init1; # introduced=21
-    inotify_rm_watch;
-    insque; # introduced=21
-    ioctl;
-    isalnum;
-    isalnum_l; # introduced=21
-    isalpha;
-    isalpha_l; # introduced=21
-    isascii;
-    isatty;
-    isblank;
-    isblank_l; # introduced=21
-    iscntrl;
-    iscntrl_l; # introduced=21
-    isdigit;
-    isdigit_l; # introduced=21
-    isfinite; # introduced=21
-    isfinitef; # introduced=21
-    isfinitel; # introduced=21
-    isgraph;
-    isgraph_l; # introduced=21
-    isinf; # introduced=21
-    isinff; # introduced=21
-    isinfl; # introduced=21
-    islower;
-    islower_l; # introduced=21
-    isnan;
-    isnanf;
-    isnanl; # introduced=21
-    isnormal; # introduced=21
-    isnormalf; # introduced=21
-    isnormall; # introduced=21
-    isprint;
-    isprint_l; # introduced=21
-    ispunct;
-    ispunct_l; # introduced=21
-    isspace;
-    isspace_l; # introduced=21
-    isupper;
-    isupper_l; # introduced=21
-    iswalnum;
-    iswalnum_l; # introduced=21
-    iswalpha;
-    iswalpha_l; # introduced=21
-    iswblank; # introduced=21
-    iswblank_l; # introduced=21
-    iswcntrl;
-    iswcntrl_l; # introduced=21
-    iswctype;
-    iswctype_l; # introduced=21
-    iswdigit;
-    iswdigit_l; # introduced=21
-    iswgraph;
-    iswgraph_l; # introduced=21
-    iswlower;
-    iswlower_l; # introduced=21
-    iswprint;
-    iswprint_l; # introduced=21
-    iswpunct;
-    iswpunct_l; # introduced=21
-    iswspace;
-    iswspace_l; # introduced=21
-    iswupper;
-    iswupper_l; # introduced=21
-    iswxdigit;
-    iswxdigit_l; # introduced=21
-    isxdigit;
-    isxdigit_l; # introduced=21
-    jrand48;
-    kill;
-    killpg;
-    klogctl;
-    labs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lchown;
-    lcong48; # introduced=23
-    ldexp;
-    ldiv;
-    lfind; # introduced=21
-    lgetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    link;
-    linkat; # introduced=21
-    listen;
-    listxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    llabs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    lldiv;
-    llistxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    localeconv; # introduced=21
-    localtime;
-    localtime_r;
-    login_tty; # introduced=23
-    longjmp;
-    lrand48;
-    lremovexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lsearch; # introduced=21
-    lseek;
-    lseek64;
-    lsetxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    lstat;
-    lstat64; # introduced=21
-    madvise;
-    mallinfo;
-    malloc;
-    malloc_info; # introduced=23
-    malloc_usable_size; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mbrlen;
-    mbrtoc16; # introduced=21
-    mbrtoc32; # introduced=21
-    mbrtowc;
-    mbsinit;
-    mbsnrtowcs; # introduced=21
-    mbsrtowcs;
-    mbstowcs;
-    mbtowc; # introduced=21
-    memalign;
-    memccpy;
-    memchr;
-    memcmp;
-    memcpy;
-    memmem;
-    memmove;
-    mempcpy; # introduced=23
-    memrchr;
-    memset;
-    mincore;
-    mkdir;
-    mkdirat;
-    mkdtemp;
-    mkfifo; # introduced=21
-    mkfifoat; # introduced=23
-    mknod;
-    mknodat; # introduced=21
-    mkostemp; # introduced=23
-    mkostemp64; # introduced=23
-    mkostemps; # introduced=23
-    mkostemps64; # introduced=23
-    mkstemp;
-    mkstemp64; # introduced=21
-    mkstemps;
-    mkstemps64; # introduced=23
-    mktemp;
-    mktime;
-    mlock;
-    mlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    mmap;
-    mmap64; # introduced=21
-    mount;
-    mprotect;
-    mrand48;
-    mremap;
-    msync;
-    munlock;
-    munlockall; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    munmap;
-    nanosleep;
-    newlocale; # introduced=21
-    nftw; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    nftw64; # introduced=21
-    nice;
-    nrand48;
-    ns_format_ttl; # arm64 x86_64 mips64 introduced=22
-    ns_get16; # arm64 x86_64 mips64 introduced=22
-    ns_get32; # arm64 x86_64 mips64 introduced=22
-    ns_initparse; # arm64 x86_64 mips64 introduced=22
-    ns_makecanon; # arm64 x86_64 mips64 introduced=22
-    ns_msg_getflag; # arm64 x86_64 mips64 introduced=22
-    ns_name_compress; # arm64 x86_64 mips64 introduced=22
-    ns_name_ntol; # arm64 x86_64 mips64 introduced=22
-    ns_name_ntop; # arm64 x86_64 mips64 introduced=22
-    ns_name_pack; # arm64 x86_64 mips64 introduced=22
-    ns_name_pton; # arm64 x86_64 mips64 introduced=23
-    ns_name_rollback; # arm64 x86_64 mips64 introduced=22
-    ns_name_skip; # arm64 x86_64 mips64 introduced=22
-    ns_name_uncompress; # arm64 x86_64 mips64 introduced=22
-    ns_name_unpack; # arm64 x86_64 mips64 introduced=22
-    ns_parserr; # arm64 x86_64 mips64 introduced=22
-    ns_put16; # arm64 x86_64 mips64 introduced=22
-    ns_put32; # arm64 x86_64 mips64 introduced=22
-    ns_samename; # arm64 x86_64 mips64 introduced=22
-    ns_skiprr; # arm64 x86_64 mips64 introduced=22
-    ns_sprintrr; # arm64 x86_64 mips64 introduced=22
-    ns_sprintrrf; # arm64 x86_64 mips64 introduced=22
-    nsdispatch;
-    ntohl; # introduced=21
-    ntohs; # introduced=21
-    open;
-    open64; # introduced=21
-    open_memstream; # introduced=23
-    open_wmemstream; # introduced=23
-    openat;
-    openat64; # introduced=21
-    opendir;
-    openlog;
-    openpty; # introduced=23
-    optarg; # var
-    opterr; # var
-    optind; # var
-    optopt; # var
-    optreset; # var
-    pathconf;
-    pause;
-    pclose;
-    perror;
-    personality; # introduced-arm=15 introduced-arm64=21 introduced-mips=15 introduced-mips64=21 introduced-x86=15 introduced-x86_64=21
-    pipe;
-    pipe2;
-    poll;
-    popen;
-    posix_fadvise; # introduced=21
-    posix_fadvise64; # introduced=21
-    posix_fallocate; # introduced=21
-    posix_fallocate64; # introduced=21
-    posix_madvise; # introduced=23
-    posix_memalign; # introduced=17
-    posix_openpt; # introduced=21
-    ppoll; # introduced=21
-    prctl;
-    pread;
-    pread64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    printf;
-    prlimit; # arm64 x86_64 mips64
-    prlimit64; # introduced=21
-    process_vm_readv; # introduced=23
-    process_vm_writev; # introduced=23
-    pselect;
-    psiginfo; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    psignal; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    pthread_atfork; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    pthread_attr_destroy;
-    pthread_attr_getdetachstate;
-    pthread_attr_getguardsize;
-    pthread_attr_getschedparam;
-    pthread_attr_getschedpolicy;
-    pthread_attr_getscope;
-    pthread_attr_getstack;
-    pthread_attr_getstacksize;
-    pthread_attr_init;
-    pthread_attr_setdetachstate;
-    pthread_attr_setguardsize;
-    pthread_attr_setschedparam;
-    pthread_attr_setschedpolicy;
-    pthread_attr_setscope;
-    pthread_attr_setstack;
-    pthread_attr_setstacksize;
-    pthread_cond_broadcast;
-    pthread_cond_destroy;
-    pthread_cond_init;
-    pthread_cond_signal;
-    pthread_cond_timedwait;
-    pthread_cond_timedwait_monotonic_np; # introduced-arm=9 introduced-x86=9 introduced-mips=9 introduced-arm64=28 introduced-x64_64=28 introduced-mips64=28
-    pthread_cond_wait;
-    pthread_condattr_destroy;
-    pthread_condattr_getclock; # introduced=21
-    pthread_condattr_getpshared;
-    pthread_condattr_init;
-    pthread_condattr_setclock; # introduced=21
-    pthread_condattr_setpshared;
-    pthread_create;
-    pthread_detach;
-    pthread_equal;
-    pthread_exit;
-    pthread_getattr_np;
-    pthread_getcpuclockid;
-    pthread_getschedparam;
-    pthread_getspecific;
-    pthread_gettid_np; # introduced=21
-    pthread_join;
-    pthread_key_create;
-    pthread_key_delete;
-    pthread_kill;
-    pthread_mutex_destroy;
-    pthread_mutex_init;
-    pthread_mutex_lock;
-    pthread_mutex_timedlock; # introduced=21
-    pthread_mutex_trylock;
-    pthread_mutex_unlock;
-    pthread_mutexattr_destroy;
-    pthread_mutexattr_getpshared;
-    pthread_mutexattr_gettype;
-    pthread_mutexattr_init;
-    pthread_mutexattr_setpshared;
-    pthread_mutexattr_settype;
-    pthread_once;
-    pthread_rwlock_destroy;
-    pthread_rwlock_init;
-    pthread_rwlock_rdlock;
-    pthread_rwlock_timedrdlock;
-    pthread_rwlock_timedwrlock;
-    pthread_rwlock_tryrdlock;
-    pthread_rwlock_trywrlock;
-    pthread_rwlock_unlock;
-    pthread_rwlock_wrlock;
-    pthread_rwlockattr_destroy;
-    pthread_rwlockattr_getkind_np; # introduced=23
-    pthread_rwlockattr_getpshared;
-    pthread_rwlockattr_init;
-    pthread_rwlockattr_setkind_np; # introduced=23
-    pthread_rwlockattr_setpshared;
-    pthread_self;
-    pthread_setname_np;
-    pthread_setschedparam;
-    pthread_setspecific;
-    pthread_sigmask;
-    ptrace;
-    ptsname;
-    ptsname_r;
-    putc;
-    putc_unlocked;
-    putchar;
-    putchar_unlocked;
-    putenv;
-    puts;
-    pututline;
-    putwc;
-    putwchar;
-    pwrite;
-    pwrite64; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    qsort;
-    quick_exit; # introduced=21
-    raise;
-    rand; # introduced=21
-    rand_r; # introduced=21
-    random; # introduced=21
-    read;
-    readahead; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    readdir;
-    readdir64; # introduced=21
-    readdir64_r; # introduced=21
-    readdir_r;
-    readlink;
-    readlinkat; # introduced=21
-    readv;
-    realloc;
-    realpath;
-    reboot;
-    recv;
-    recvfrom;
-    recvmmsg; # introduced=21
-    recvmsg;
-    regcomp;
-    regerror;
-    regexec;
-    regfree;
-    remove;
-    removexattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    remque; # introduced=21
-    rename;
-    renameat;
-    res_init;
-    res_mkquery;
-    res_query;
-    res_search;
-    rewind;
-    rewinddir;
-    rmdir;
-    sbrk;
-    scandir;
-    scandir64; # introduced=21
-    scanf;
-    sched_get_priority_max;
-    sched_get_priority_min;
-    sched_getaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getcpu; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_getparam;
-    sched_getscheduler;
-    sched_rr_get_interval;
-    sched_setaffinity; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sched_setparam;
-    sched_setscheduler;
-    sched_yield;
-    seed48;
-    seekdir; # introduced=23
-    select;
-    sem_close;
-    sem_destroy;
-    sem_getvalue;
-    sem_init;
-    sem_open;
-    sem_post;
-    sem_timedwait;
-    sem_trywait;
-    sem_unlink;
-    sem_wait;
-    send;
-    sendfile;
-    sendfile64; # introduced=21
-    sendmmsg; # introduced=21
-    sendmsg;
-    sendto;
-    setbuf;
-    setbuffer;
-    setegid;
-    setenv;
-    seteuid;
-    setfsgid; # introduced=21
-    setfsuid; # introduced=21
-    setgid;
-    setgroups;
-    sethostname; # introduced=23
-    setitimer;
-    setjmp;
-    setlinebuf;
-    setlocale;
-    setlogmask;
-    setmntent; # introduced=21
-    setns; # introduced=21
-    setpgid;
-    setpgrp;
-    setpriority;
-    setprogname; # introduced=21
-    setregid;
-    setresgid;
-    setresuid;
-    setreuid;
-    setrlimit;
-    setrlimit64; # introduced=21
-    setservent;
-    setsid;
-    setsockopt;
-    setstate; # introduced=21
-    settimeofday;
-    setuid;
-    setutent;
-    setvbuf;
-    setxattr; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    shutdown;
-    sigaction;
-    sigaddset; # introduced=21
-    sigaltstack;
-    sigblock;
-    sigdelset; # introduced=21
-    sigemptyset; # introduced=21
-    sigfillset; # introduced=21
-    siginterrupt;
-    sigismember; # introduced=21
-    siglongjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    signal; # introduced=21
-    signalfd; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    sigpending;
-    sigprocmask;
-    sigqueue; # introduced=23
-    sigsetjmp; # introduced-arm=9 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    sigsetmask;
-    sigsuspend;
-    sigtimedwait; # introduced=23
-    sigwait;
-    sigwaitinfo; # introduced=23
-    sleep;
-    snprintf;
-    socket;
-    socketpair;
-    splice; # introduced=21
-    sprintf;
-    srand; # introduced=21
-    srand48;
-    srandom; # introduced=21
-    sscanf;
-    stat;
-    stat64; # introduced=21
-    statfs;
-    statfs64; # introduced=21
-    statvfs; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    statvfs64; # introduced=21
-    stderr; # var introduced=23
-    stdin; # var introduced=23
-    stdout; # var introduced=23
-    stpcpy; # introduced=21
-    stpncpy; # introduced=21
-    strcasecmp;
-    strcasecmp_l; # introduced=23
-    strcasestr;
-    strcat;
-    strchr;
-    strcmp;
-    strcoll;
-    strcoll_l; # introduced=21
-    strcpy;
-    strcspn;
-    strdup;
-    strerror;
-    strerror_l; # introduced=23
-    strerror_r;
-    strftime;
-    strftime_l; # introduced=21
-    strlcat;
-    strlcpy;
-    strlen;
-    strncasecmp;
-    strncasecmp_l; # introduced=23
-    strncat;
-    strncmp;
-    strncpy;
-    strndup;
-    strnlen;
-    strpbrk;
-    strptime;
-    strrchr;
-    strsep;
-    strsignal;
-    strspn;
-    strstr;
-    strtod;
-    strtof; # introduced=21
-    strtoimax;
-    strtok;
-    strtok_r;
-    strtol;
-    strtold; # introduced=21
-    strtold_l; # introduced=21
-    strtoll;
-    strtoll_l; # introduced=21
-    strtoq; # introduced=21
-    strtoul;
-    strtoull;
-    strtoull_l; # introduced=21
-    strtoumax;
-    strtouq; # introduced=21
-    strxfrm;
-    strxfrm_l; # introduced=21
-    swapoff; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swapon; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    swprintf;
-    swscanf;
-    symlink;
-    symlinkat; # introduced=21
-    sync;
-    sys_siglist; # var
-    sys_signame; # var
-    syscall;
-    sysconf;
-    sysinfo;
-    syslog;
-    system;
-    tcdrain; # introduced=21
-    tcflow; # introduced=21
-    tcflush; # introduced=21
-    tcgetattr; # introduced=21
-    tcgetpgrp;
-    tcgetsid; # introduced=21
-    tcsendbreak; # introduced=21
-    tcsetattr; # introduced=21
-    tcsetpgrp;
-    tdelete; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tdestroy; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tee; # introduced=21
-    telldir; # introduced=23
-    tempnam;
-    tfind; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    tgkill; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    time;
-    timegm; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timelocal; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    timer_create;
-    timer_delete;
-    timer_getoverrun;
-    timer_gettime;
-    timer_settime;
-    timerfd_create; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_gettime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    timerfd_settime; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
-    times;
-    timezone; # var
-    tmpfile;
-    tmpnam;
-    toascii;
-    tolower;
-    tolower_l; # introduced=21
-    toupper;
-    toupper_l; # introduced=21
-    towlower;
-    towlower_l; # introduced=21
-    towupper;
-    towupper_l; # introduced=21
-    truncate;
-    truncate64; # introduced=21
-    tsearch; # introduced-arm=16 introduced-arm64=21 introduced-mips=16 introduced-mips64=21 introduced-x86=16 introduced-x86_64=21
-    ttyname;
-    ttyname_r;
-    twalk; # introduced=21
-    tzname; # var
-    tzset;
-    umask;
-    umount;
-    umount2;
-    uname;
-    ungetc;
-    ungetwc;
-    unlink;
-    unlinkat;
-    unlockpt;
-    unsetenv;
-    unshare; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
-    uselocale; # introduced=21
-    usleep;
-    utime;
-    utimensat; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
-    utimes;
-    utmpname;
-    vasprintf;
-    vdprintf; # introduced=21
-    verr;
-    verrx;
-    vfork;
-    vfprintf;
-    vfscanf;
-    vfwprintf;
-    vfwscanf; # introduced=21
-    vmsplice; # introduced=21
-    vprintf;
-    vscanf;
-    vsnprintf;
-    vsprintf;
-    vsscanf;
-    vswprintf;
-    vswscanf; # introduced=21
-    vsyslog;
-    vwarn;
-    vwarnx;
-    vwprintf;
-    vwscanf; # introduced=21
-    wait;
-    wait4; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    waitid;
-    waitpid;
-    warn;
-    warnx;
-    wcpcpy;
-    wcpncpy;
-    wcrtomb;
-    wcscasecmp;
-    wcscasecmp_l; # introduced=23
-    wcscat;
-    wcschr;
-    wcscmp;
-    wcscoll;
-    wcscoll_l; # introduced=21
-    wcscpy;
-    wcscspn;
-    wcsdup;
-    wcsftime;
-    wcslcat;
-    wcslcpy;
-    wcslen;
-    wcsncasecmp;
-    wcsncasecmp_l; # introduced=23
-    wcsncat;
-    wcsncmp;
-    wcsncpy;
-    wcsnlen;
-    wcsnrtombs; # introduced=21
-    wcspbrk;
-    wcsrchr;
-    wcsrtombs;
-    wcsspn;
-    wcsstr;
-    wcstod;
-    wcstof; # introduced=21
-    wcstoimax; # introduced=21
-    wcstok;
-    wcstol;
-    wcstold; # introduced=21
-    wcstold_l; # introduced=21
-    wcstoll; # introduced=21
-    wcstoll_l; # introduced=21
-    wcstombs;
-    wcstoul;
-    wcstoull; # introduced=21
-    wcstoull_l; # introduced=21
-    wcstoumax; # introduced=21
-    wcswidth;
-    wcsxfrm;
-    wcsxfrm_l; # introduced=21
-    wctob;
-    wctomb; # introduced=21
-    wctype;
-    wctype_l; # introduced=21
-    wcwidth;
-    wmemchr;
-    wmemcmp;
-    wmemcpy;
-    wmemmove;
-    wmempcpy; # introduced=23
-    wmemset;
-    wprintf;
-    write;
-    writev;
-    wscanf;
-  local:
-    *;
-};
-
-LIBC_N { # introduced-arm64=24 introduced-mips=24 introduced-mips64=24 introduced-x86=24 introduced-x86_64=24
-  global:
-    __fread_chk; # introduced=24
-    __fwrite_chk; # introduced=24
-    __getcwd_chk; # introduced=24
-    __pwrite_chk; # introduced=24
-    __pwrite64_chk; # introduced=24
-    __write_chk; # introduced=24
-    adjtimex; # introduced=24
-    clock_adjtime; # introduced=24
-    fgetpos64; # introduced=24
-    fileno_unlocked; # introduced=24
-    fopen64; # introduced=24
-    freeifaddrs; # introduced=24
-    freopen64; # introduced=24
-    fseeko64; # introduced=24
-    fsetpos64; # introduced=24
-    ftello64; # introduced=24
-    funopen64; # introduced=24
-    getgrgid_r; # introduced=24
-    getgrnam_r; # introduced=24
-    getifaddrs; # introduced=24
-    if_freenameindex; # introduced=24
-    if_nameindex; # introduced=24
-    in6addr_any; # var introduced=24
-    in6addr_loopback; # var introduced=24
-    lockf; # introduced=24
-    lockf64; # introduced=24
-    preadv; # introduced=24
-    preadv64; # introduced=24
-    pthread_barrierattr_destroy; # introduced=24
-    pthread_barrierattr_getpshared; # introduced=24
-    pthread_barrierattr_init; # introduced=24
-    pthread_barrierattr_setpshared; # introduced=24
-    pthread_barrier_destroy; # introduced=24
-    pthread_barrier_init; # introduced=24
-    pthread_barrier_wait; # introduced=24
-    pthread_spin_destroy; # introduced=24
-    pthread_spin_init; # introduced=24
-    pthread_spin_lock; # introduced=24
-    pthread_spin_trylock; # introduced=24
-    pthread_spin_unlock; # introduced=24
-    pwritev; # introduced=24
-    pwritev64; # introduced=24
-    scandirat; # introduced=24
-    scandirat64; # introduced=24
-    strchrnul; # introduced=24
-    tmpfile64; # introduced=24
-} LIBC;
-
-LIBC_O {
-  global:
-    __sendto_chk; # introduced=26
-    __system_property_read_callback; # introduced=26
-    __system_property_wait; # introduced=26
-    catclose; # introduced=26
-    catgets; # introduced=26
-    catopen; # introduced=26
-    ctermid; # introduced=26
-    endgrent; # introduced=26
-    endpwent; # introduced=26
-    futimes; # introduced=26
-    futimesat; # introduced=26
-    getdomainname; # introduced=26
-    getgrent; # introduced=26
-    getpwent; # introduced=26
-    getsubopt; # introduced=26
-    hasmntopt; # introduced=26
-    lutimes; # introduced=26
-    mallopt; # introduced=26
-    mblen; # introduced=26
-    msgctl; # introduced=26
-    msgget; # introduced=26
-    msgrcv; # introduced=26
-    msgsnd; # introduced=26
-    nl_langinfo; # introduced=26
-    nl_langinfo_l; # introduced=26
-    pthread_getname_np; # introduced=26
-    quotactl; # introduced=26
-    semctl; # introduced=26
-    semget; # introduced=26
-    semop; # introduced=26
-    semtimedop; # introduced=26
-    setdomainname; # introduced=26
-    setgrent; # introduced=26
-    setpwent; # introduced=26
-    shmat; # introduced=26
-    shmctl; # introduced=26
-    shmdt; # introduced=26
-    shmget; # introduced=26
-    sighold; # introduced=26
-    sigignore; # introduced=26
-    sigpause; # introduced=26
-    sigrelse; # introduced=26
-    sigset; # introduced=26
-    strtod_l; # introduced=26
-    strtof_l; # introduced=26
-    strtol_l; # introduced=26
-    strtoul_l; # introduced=26
-    sync_file_range; # introduced=26
-    towctrans; # introduced=26
-    towctrans_l; # introduced=26
-    wctrans; # introduced=26
-    wctrans_l; # introduced=26
-} LIBC_N;
-
-LIBC_P { # introduced=P
-  global:
-    __freading;
-    __free_hook;
-    __fseterr;
-    __fwriting;
-    __malloc_hook;
-    __memalign_hook;
-    __realloc_hook;
-    aligned_alloc;
-    endhostent;
-    endnetent;
-    endprotoent;
-    epoll_pwait64;
-    fexecve;
-    fflush_unlocked;
-    fgetc_unlocked;
-    fgets_unlocked;
-    fputc_unlocked;
-    fputs_unlocked;
-    fread_unlocked;
-    fwrite_unlocked;
-    getentropy;
-    getnetent;
-    getprotoent;
-    getrandom;
-    getlogin_r;
-    glob;
-    globfree;
-    hcreate;
-    hcreate_r;
-    hdestroy;
-    hdestroy_r;
-    hsearch;
-    hsearch_r;
-    iconv;
-    iconv_close;
-    iconv_open;
-    posix_spawn;
-    posix_spawnattr_destroy;
-    posix_spawnattr_getflags;
-    posix_spawnattr_getpgroup;
-    posix_spawnattr_getschedparam;
-    posix_spawnattr_getschedpolicy;
-    posix_spawnattr_getsigdefault;
-    posix_spawnattr_getsigdefault64;
-    posix_spawnattr_getsigmask;
-    posix_spawnattr_getsigmask64;
-    posix_spawnattr_init;
-    posix_spawnattr_setflags;
-    posix_spawnattr_setpgroup;
-    posix_spawnattr_setschedparam;
-    posix_spawnattr_setschedpolicy;
-    posix_spawnattr_setsigdefault;
-    posix_spawnattr_setsigdefault64;
-    posix_spawnattr_setsigmask;
-    posix_spawnattr_setsigmask64;
-    posix_spawn_file_actions_addclose;
-    posix_spawn_file_actions_adddup2;
-    posix_spawn_file_actions_addopen;
-    posix_spawn_file_actions_destroy;
-    posix_spawn_file_actions_init;
-    posix_spawnp;
-    ppoll64;
-    pselect64;
-    pthread_attr_getinheritsched;
-    pthread_attr_setinheritsched;
-    pthread_mutex_timedlock_monotonic_np;
-    pthread_mutexattr_getprotocol;
-    pthread_mutexattr_setprotocol;
-    pthread_rwlock_timedrdlock_monotonic_np;
-    pthread_rwlock_timedwrlock_monotonic_np;
-    pthread_setschedprio;
-    pthread_sigmask64;
-    sem_timedwait_monotonic_np;
-    sethostent;
-    setnetent;
-    setprotoent;
-    sigaction64;
-    sigaddset64;
-    sigdelset64;
-    sigemptyset64;
-    sigfillset64;
-    sigismember64;
-    signalfd64;
-    sigpending64;
-    sigprocmask64;
-    sigsuspend64;
-    sigtimedwait64;
-    sigwait64;
-    sigwaitinfo64;
-    strptime_l;
-    swab;
-    syncfs;
-    wcsftime_l;
-    wcstod_l;
-    wcstof_l;
-    wcstol_l;
-    wcstoul_l;
-} LIBC_O;
-
-LIBC_Q { # introduced=Q
-  global:
-    __res_randomid;
-    android_fdsan_close_with_tag;
-    android_fdsan_create_owner_tag;
-    android_fdsan_exchange_owner_tag;
-    android_fdsan_get_owner_tag;
-    android_fdsan_get_tag_type;
-    android_fdsan_get_tag_value;
-    android_fdsan_get_error_level;
-    android_fdsan_set_error_level;
-    android_get_device_api_level;
-    getloadavg;
-    pthread_sigqueue;
-    reallocarray;
-    timespec_get;
-} LIBC_P;
-
-LIBC_PRIVATE {
-  global:
-    android_getaddrinfofornet;
-    android_getaddrinfofornetcontext;
-    android_gethostbyaddrfornet;
-    android_gethostbyaddrfornetcontext;
-    android_gethostbynamefornet;
-    android_gethostbynamefornetcontext;
-    free_malloc_leak_info;
-    get_malloc_leak_info;
-    gMallocLeakZygoteChild;
-    write_malloc_leak_info;
-} LIBC_Q;
-
-LIBC_DEPRECATED {
-  global:
-    __system_property_wait_any;
-};
-
-LIBC_PLATFORM {
-  global:
-    __system_properties_init;
-    __system_property_area__; # var
-    __system_property_add;
-    __system_property_area_init;
-    __system_property_set_filename;
-    __system_property_update;
-    android_fdsan_get_fd_table;
-    android_net_res_stats_get_info_for_net;
-    android_net_res_stats_aggregate;
-    android_net_res_stats_get_usable_servers;
-    malloc_backtrace;
-    malloc_disable;
-    malloc_enable;
-    malloc_iterate;
-} LIBC_Q;
diff --git a/libc/libstdc++.arm.map b/libc/libstdc++.arm.map
deleted file mode 100644
index 8ee5863..0000000
--- a/libc/libstdc++.arm.map
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC_O {
-  global:
-    _ZSt7nothrow; # var
-    _ZdaPv; # weak
-    _ZdaPvRKSt9nothrow_t; # weak
-    _ZdlPv; # weak
-    _ZdlPvRKSt9nothrow_t; # weak
-    _Znaj; # arm x86 mips weak
-    _ZnajRKSt9nothrow_t; # arm x86 mips weak
-    _Znwj; # arm x86 mips weak
-    _ZnwjRKSt9nothrow_t; # arm x86 mips weak
-    __cxa_guard_abort;
-    __cxa_guard_acquire;
-    __cxa_guard_release;
-    __cxa_pure_virtual;
-  local:
-    *;
-};
diff --git a/libc/libstdc++.arm64.map b/libc/libstdc++.arm64.map
deleted file mode 100644
index cd4f3c3..0000000
--- a/libc/libstdc++.arm64.map
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC_O {
-  global:
-    _ZSt7nothrow; # var
-    _ZdaPv; # weak
-    _ZdaPvRKSt9nothrow_t; # weak
-    _ZdlPv; # weak
-    _ZdlPvRKSt9nothrow_t; # weak
-    _Znam; # arm64 x86_64 mips64 weak
-    _ZnamRKSt9nothrow_t; # arm64 x86_64 mips64 weak
-    _Znwm; # arm64 x86_64 mips64 weak
-    _ZnwmRKSt9nothrow_t; # arm64 x86_64 mips64 weak
-    __cxa_guard_abort;
-    __cxa_guard_acquire;
-    __cxa_guard_release;
-    __cxa_pure_virtual;
-  local:
-    *;
-};
diff --git a/libc/libstdc++.mips.map b/libc/libstdc++.mips.map
deleted file mode 100644
index 8ee5863..0000000
--- a/libc/libstdc++.mips.map
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC_O {
-  global:
-    _ZSt7nothrow; # var
-    _ZdaPv; # weak
-    _ZdaPvRKSt9nothrow_t; # weak
-    _ZdlPv; # weak
-    _ZdlPvRKSt9nothrow_t; # weak
-    _Znaj; # arm x86 mips weak
-    _ZnajRKSt9nothrow_t; # arm x86 mips weak
-    _Znwj; # arm x86 mips weak
-    _ZnwjRKSt9nothrow_t; # arm x86 mips weak
-    __cxa_guard_abort;
-    __cxa_guard_acquire;
-    __cxa_guard_release;
-    __cxa_pure_virtual;
-  local:
-    *;
-};
diff --git a/libc/libstdc++.mips64.map b/libc/libstdc++.mips64.map
deleted file mode 100644
index cd4f3c3..0000000
--- a/libc/libstdc++.mips64.map
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC_O {
-  global:
-    _ZSt7nothrow; # var
-    _ZdaPv; # weak
-    _ZdaPvRKSt9nothrow_t; # weak
-    _ZdlPv; # weak
-    _ZdlPvRKSt9nothrow_t; # weak
-    _Znam; # arm64 x86_64 mips64 weak
-    _ZnamRKSt9nothrow_t; # arm64 x86_64 mips64 weak
-    _Znwm; # arm64 x86_64 mips64 weak
-    _ZnwmRKSt9nothrow_t; # arm64 x86_64 mips64 weak
-    __cxa_guard_abort;
-    __cxa_guard_acquire;
-    __cxa_guard_release;
-    __cxa_pure_virtual;
-  local:
-    *;
-};
diff --git a/libc/libstdc++.x86.map b/libc/libstdc++.x86.map
deleted file mode 100644
index 8ee5863..0000000
--- a/libc/libstdc++.x86.map
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC_O {
-  global:
-    _ZSt7nothrow; # var
-    _ZdaPv; # weak
-    _ZdaPvRKSt9nothrow_t; # weak
-    _ZdlPv; # weak
-    _ZdlPvRKSt9nothrow_t; # weak
-    _Znaj; # arm x86 mips weak
-    _ZnajRKSt9nothrow_t; # arm x86 mips weak
-    _Znwj; # arm x86 mips weak
-    _ZnwjRKSt9nothrow_t; # arm x86 mips weak
-    __cxa_guard_abort;
-    __cxa_guard_acquire;
-    __cxa_guard_release;
-    __cxa_pure_virtual;
-  local:
-    *;
-};
diff --git a/libc/libstdc++.x86_64.map b/libc/libstdc++.x86_64.map
deleted file mode 100644
index cd4f3c3..0000000
--- a/libc/libstdc++.x86_64.map
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC_O {
-  global:
-    _ZSt7nothrow; # var
-    _ZdaPv; # weak
-    _ZdaPvRKSt9nothrow_t; # weak
-    _ZdlPv; # weak
-    _ZdlPvRKSt9nothrow_t; # weak
-    _Znam; # arm64 x86_64 mips64 weak
-    _ZnamRKSt9nothrow_t; # arm64 x86_64 mips64 weak
-    _Znwm; # arm64 x86_64 mips64 weak
-    _ZnwmRKSt9nothrow_t; # arm64 x86_64 mips64 weak
-    __cxa_guard_abort;
-    __cxa_guard_acquire;
-    __cxa_guard_release;
-    __cxa_pure_virtual;
-  local:
-    *;
-};
diff --git a/libc/malloc_debug/Android.bp b/libc/malloc_debug/Android.bp
index 0961a94..bcbd7da 100644
--- a/libc/malloc_debug/Android.bp
+++ b/libc/malloc_debug/Android.bp
@@ -123,6 +123,7 @@
     static_libs: [
         "libc_malloc_debug",
         "libdemangle",
+        "libtinyxml2",
     ],
 
     shared_libs: [
@@ -144,6 +145,8 @@
 cc_test {
     name: "malloc_debug_system_tests",
 
+    include_dirs: ["bionic/libc"],
+
     srcs: [
         "tests/malloc_debug_system_tests.cpp",
     ],
diff --git a/libc/malloc_debug/Config.cpp b/libc/malloc_debug/Config.cpp
index 926b265..dbd3eac 100644
--- a/libc/malloc_debug/Config.cpp
+++ b/libc/malloc_debug/Config.cpp
@@ -132,6 +132,12 @@
     {
         "verify_pointers", {TRACK_ALLOCS, &Config::VerifyValueEmpty},
     },
+    {
+        "abort_on_error", {ABORT_ON_ERROR, &Config::VerifyValueEmpty},
+    },
+    {
+        "verbose", {VERBOSE, &Config::VerifyValueEmpty},
+    },
 };
 
 bool Config::ParseValue(const std::string& option, const std::string& value, size_t min_value,
diff --git a/libc/malloc_debug/Config.h b/libc/malloc_debug/Config.h
index 86d1ee4..1b5c748 100644
--- a/libc/malloc_debug/Config.h
+++ b/libc/malloc_debug/Config.h
@@ -44,6 +44,8 @@
 constexpr uint64_t LEAK_TRACK = 0x100;
 constexpr uint64_t RECORD_ALLOCS = 0x200;
 constexpr uint64_t BACKTRACE_FULL = 0x400;
+constexpr uint64_t ABORT_ON_ERROR = 0x800;
+constexpr uint64_t VERBOSE = 0x1000;
 
 // In order to guarantee posix compliance, set the minimum alignment
 // to 8 bytes for 32 bit systems and 16 bytes for 64 bit systems.
diff --git a/libc/malloc_debug/GuardData.cpp b/libc/malloc_debug/GuardData.cpp
index debc14e..c307dc9 100644
--- a/libc/malloc_debug/GuardData.cpp
+++ b/libc/malloc_debug/GuardData.cpp
@@ -64,6 +64,9 @@
   error_log("Backtrace at time of failure:");
   BacktraceAndLog();
   error_log(LOG_DIVIDER);
+  if (g_debug->config().options() & ABORT_ON_ERROR) {
+    abort();
+  }
 }
 
 FrontGuardData::FrontGuardData(DebugData* debug_data, const Config& config, size_t* offset)
diff --git a/libc/malloc_debug/MapData.cpp b/libc/malloc_debug/MapData.cpp
index 060425e..e8fbc54 100644
--- a/libc/malloc_debug/MapData.cpp
+++ b/libc/malloc_debug/MapData.cpp
@@ -33,6 +33,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/mman.h>
 
 #include <vector>
 
@@ -44,6 +45,7 @@
   uintptr_t start;
   uintptr_t end;
   uintptr_t offset;
+  int flags;
   char permissions[5];
   int name_pos;
   if (sscanf(line, "%" PRIxPTR "-%" PRIxPTR " %4s %" PRIxPTR " %*x:%*x %*d %n", &start, &end,
@@ -57,18 +59,27 @@
     name_len -= 1;
   }
 
-  MapEntry* entry = new MapEntry(start, end, offset, name, name_len);
-  if (permissions[0] != 'r') {
-    // Any unreadable map will just get a zero load base.
-    entry->load_base = 0;
-    entry->load_base_read = true;
+  flags = 0;
+  if (permissions[0] == 'r') {
+    flags |= PROT_READ;
+  }
+  if (permissions[2] == 'x') {
+    flags |= PROT_EXEC;
+  }
+
+  MapEntry* entry = new MapEntry(start, end, offset, name, name_len, flags);
+  if (!(flags & PROT_READ)) {
+    // Any unreadable map will just get a zero load bias.
+    entry->load_bias = 0;
+    entry->init = true;
+    entry->valid = false;
   }
   return entry;
 }
 
 template <typename T>
 static inline bool get_val(MapEntry* entry, uintptr_t addr, T* store) {
-  if (addr < entry->start || addr + sizeof(T) > entry->end) {
+  if (!(entry->flags & PROT_READ) || addr < entry->start || addr + sizeof(T) > entry->end) {
     return false;
   }
   // Make sure the address is aligned properly.
@@ -79,9 +90,18 @@
   return true;
 }
 
-static void read_loadbase(MapEntry* entry) {
-  entry->load_base = 0;
-  entry->load_base_read = true;
+static bool valid_elf(MapEntry* entry) {
+  uintptr_t addr = entry->start;
+  uintptr_t end;
+  if (__builtin_add_overflow(addr, SELFMAG, &end) || end >= entry->end) {
+    return false;
+  }
+
+  return memcmp(reinterpret_cast<void*>(addr), ELFMAG, SELFMAG) == 0;
+}
+
+static void read_loadbias(MapEntry* entry) {
+  entry->load_bias = 0;
   uintptr_t addr = entry->start;
   ElfW(Ehdr) ehdr;
   if (!get_val<ElfW(Half)>(entry, addr + offsetof(ElfW(Ehdr), e_phnum), &ehdr.e_phnum)) {
@@ -103,13 +123,24 @@
       if (!get_val<ElfW(Addr)>(entry, addr + offsetof(ElfW(Phdr), p_vaddr), &phdr.p_vaddr)) {
         return;
       }
-      entry->load_base = phdr.p_vaddr;
+      entry->load_bias = phdr.p_vaddr;
       return;
     }
     addr += sizeof(phdr);
   }
 }
 
+static void inline init(MapEntry* entry) {
+  if (entry->init) {
+    return;
+  }
+  entry->init = true;
+  if (valid_elf(entry)) {
+    entry->valid = true;
+    read_loadbias(entry);
+  }
+}
+
 bool MapData::ReadMaps() {
   FILE* fp = fopen("/proc/self/maps", "re");
   if (fp == nullptr) {
@@ -158,11 +189,25 @@
   }
 
   MapEntry* entry = *it;
-  if (!entry->load_base_read) {
-    read_loadbase(entry);
-  }
-  if (rel_pc) {
-    *rel_pc = pc - entry->start + entry->load_base;
+  init(entry);
+
+  if (rel_pc != nullptr) {
+    // Need to check to see if this is a read-execute map and the read-only
+    // map is the previous one.
+    if (!entry->valid && it != entries_.begin()) {
+      MapEntry* prev_entry = *--it;
+      if (prev_entry->flags == PROT_READ && prev_entry->offset < entry->offset &&
+          prev_entry->name == entry->name) {
+        init(prev_entry);
+
+        if (prev_entry->valid) {
+          entry->elf_start_offset = prev_entry->offset;
+          *rel_pc = pc - entry->start + entry->offset + prev_entry->load_bias;
+          return entry;
+        }
+      }
+    }
+    *rel_pc = pc - entry->start + entry->load_bias;
   }
   return entry;
 }
diff --git a/libc/malloc_debug/MapData.h b/libc/malloc_debug/MapData.h
index b9b697c..5b08b90 100644
--- a/libc/malloc_debug/MapData.h
+++ b/libc/malloc_debug/MapData.h
@@ -37,17 +37,20 @@
 #include <private/bionic_macros.h>
 
 struct MapEntry {
-  MapEntry(uintptr_t start, uintptr_t end, uintptr_t offset, const char* name, size_t name_len)
-      : start(start), end(end), offset(offset), name(name, name_len) {}
+  MapEntry(uintptr_t start, uintptr_t end, uintptr_t offset, const char* name, size_t name_len, int flags)
+      : start(start), end(end), offset(offset), name(name, name_len), flags(flags) {}
 
   explicit MapEntry(uintptr_t pc) : start(pc), end(pc) {}
 
   uintptr_t start;
   uintptr_t end;
   uintptr_t offset;
-  uintptr_t load_base;
-  bool load_base_read = false;
+  uintptr_t load_bias;
+  uintptr_t elf_start_offset = 0;
   std::string name;
+  int flags;
+  bool init = false;
+  bool valid = false;
 };
 
 // Ordering comparator that returns equivalence for overlapping entries
diff --git a/libc/malloc_debug/PointerData.cpp b/libc/malloc_debug/PointerData.cpp
index b0e2fc8..617d128 100644
--- a/libc/malloc_debug/PointerData.cpp
+++ b/libc/malloc_debug/PointerData.cpp
@@ -105,8 +105,10 @@
       error_log("Unable to set up backtrace signal enable function: %s", strerror(errno));
       return false;
     }
-    info_log("%s: Run: 'kill -%d %d' to enable backtracing.", getprogname(),
-             config.backtrace_signal(), getpid());
+    if (config.options() & VERBOSE) {
+      info_log("%s: Run: 'kill -%d %d' to enable backtracing.", getprogname(),
+               config.backtrace_signal(), getpid());
+    }
   }
 
   if (config.options() & BACKTRACE) {
@@ -117,8 +119,10 @@
       error_log("Unable to set up backtrace dump signal function: %s", strerror(errno));
       return false;
     }
-    info_log("%s: Run: 'kill -%d %d' to dump the backtrace.", getprogname(),
-             config.backtrace_dump_signal(), getpid());
+    if (config.options() & VERBOSE) {
+      info_log("%s: Run: 'kill -%d %d' to dump the backtrace.", getprogname(),
+               config.backtrace_dump_signal(), getpid());
+    }
   }
 
   backtrace_dump_ = false;
@@ -206,7 +210,7 @@
     std::lock_guard<std::mutex> pointer_guard(pointer_mutex_);
     auto entry = pointers_.find(pointer);
     if (entry == pointers_.end()) {
-      // Error.
+      // Attempt to remove unknown pointer.
       error_log("No tracked pointer found for 0x%" PRIxPTR, pointer);
       return;
     }
@@ -266,12 +270,12 @@
   error_log("  hash_index %zu does not have matching frame data.", hash_index);
 }
 
-void PointerData::LogFreeError(const FreePointerInfoType& info, size_t usable_size) {
+void PointerData::LogFreeError(const FreePointerInfoType& info, size_t max_cmp_bytes) {
   error_log(LOG_DIVIDER);
   uint8_t* memory = reinterpret_cast<uint8_t*>(info.pointer);
   error_log("+++ ALLOCATION %p USED AFTER FREE", memory);
   uint8_t fill_free_value = g_debug->config().fill_free_value();
-  for (size_t i = 0; i < usable_size; i++) {
+  for (size_t i = 0; i < max_cmp_bytes; i++) {
     if (memory[i] != fill_free_value) {
       error_log("  allocation[%zu] = 0x%02x (expected 0x%02x)", i, memory[i], fill_free_value);
     }
@@ -283,6 +287,9 @@
   }
 
   error_log(LOG_DIVIDER);
+  if (g_debug->config().options() & ABORT_ON_ERROR) {
+    abort();
+  }
 }
 
 void PointerData::VerifyFreedPointer(const FreePointerInfoType& info) {
@@ -295,6 +302,9 @@
       error_log("+++ ALLOCATION 0x%" PRIxPTR " HAS CORRUPTED HEADER TAG 0x%x AFTER FREE",
                 info.pointer, header->tag);
       error_log(LOG_DIVIDER);
+      if (g_debug->config().options() & ABORT_ON_ERROR) {
+        abort();
+      }
 
       // Stop processing here, it is impossible to tell how the header
       // may have been damaged.
@@ -308,11 +318,12 @@
   size_t bytes = (usable_size < g_debug->config().fill_on_free_bytes())
                      ? usable_size
                      : g_debug->config().fill_on_free_bytes();
+  size_t max_cmp_bytes = bytes;
   const uint8_t* memory = reinterpret_cast<const uint8_t*>(info.pointer);
   while (bytes > 0) {
     size_t bytes_to_cmp = (bytes < g_cmp_mem.size()) ? bytes : g_cmp_mem.size();
     if (memcmp(memory, g_cmp_mem.data(), bytes_to_cmp) != 0) {
-      LogFreeError(info, usable_size);
+      LogFreeError(info, max_cmp_bytes);
     }
     bytes -= bytes_to_cmp;
     memory = &memory[bytes_to_cmp];
@@ -485,6 +496,17 @@
   }
 }
 
+void PointerData::GetAllocList(std::vector<ListInfoType>* list) {
+  std::lock_guard<std::mutex> pointer_guard(pointer_mutex_);
+  std::lock_guard<std::mutex> frame_guard(frame_mutex_);
+
+  if (pointers_.empty()) {
+    return;
+  }
+
+  GetList(list, false);
+}
+
 void PointerData::GetInfo(uint8_t** info, size_t* overall_size, size_t* info_size,
                           size_t* total_memory, size_t* backtrace_size) {
   std::lock_guard<std::mutex> pointer_guard(pointer_mutex_);
@@ -583,9 +605,9 @@
 }
 
 void PointerData::PrepareFork() NO_THREAD_SAFETY_ANALYSIS {
+  free_pointer_mutex_.lock();
   pointer_mutex_.lock();
   frame_mutex_.lock();
-  free_pointer_mutex_.lock();
 }
 
 void PointerData::PostForkParent() NO_THREAD_SAFETY_ANALYSIS {
diff --git a/libc/malloc_debug/PointerData.h b/libc/malloc_debug/PointerData.h
index b05a763..c7958f3 100644
--- a/libc/malloc_debug/PointerData.h
+++ b/libc/malloc_debug/PointerData.h
@@ -44,7 +44,7 @@
 #include "OptionData.h"
 #include "UnwindBacktrace.h"
 
-extern int* g_malloc_zygote_child;
+extern bool* g_zygote_child;
 
 // Forward declarations.
 class Config;
@@ -89,7 +89,9 @@
   size_t hash_index;
   size_t RealSize() const { return size & ~(1U << 31); }
   bool ZygoteChildAlloc() const { return size & (1U << 31); }
-  static size_t GetEncodedSize(size_t size) { return GetEncodedSize(*g_malloc_zygote_child, size); }
+  static size_t GetEncodedSize(size_t size) {
+    return GetEncodedSize(*g_zygote_child, size);
+  }
   static size_t GetEncodedSize(bool child_alloc, size_t size) {
     return size | ((child_alloc) ? (1U << 31) : 0);
   }
@@ -112,7 +114,7 @@
 
 class PointerData : public OptionData {
  public:
-  PointerData(DebugData* debug_data);
+  explicit PointerData(DebugData* debug_data);
   virtual ~PointerData() = default;
 
   bool Initialize(const Config& config);
@@ -132,9 +134,6 @@
   void PostForkParent();
   void PostForkChild();
 
-  static void GetList(std::vector<ListInfoType>* list, bool only_with_backtrace);
-  static void GetUniqueList(std::vector<ListInfoType>* list, bool only_with_backtrace);
-
   static size_t AddBacktrace(size_t num_frames);
   static void RemoveBacktrace(size_t hash_index);
 
@@ -151,6 +150,7 @@
   static void VerifyFreedPointer(const FreePointerInfoType& info);
   static void VerifyAllFreed();
 
+  static void GetAllocList(std::vector<ListInfoType>* list);
   static void LogLeaks();
   static void DumpLiveToFile(FILE* fp);
 
@@ -165,6 +165,9 @@
   static std::string GetHashString(uintptr_t* frames, size_t num_frames);
   static void LogBacktrace(size_t hash_index);
 
+  static void GetList(std::vector<ListInfoType>* list, bool only_with_backtrace);
+  static void GetUniqueList(std::vector<ListInfoType>* list, bool only_with_backtrace);
+
   size_t alloc_offset_ = 0;
   std::vector<uint8_t> cmp_mem_;
 
diff --git a/libc/malloc_debug/README.md b/libc/malloc_debug/README.md
index a8289b3..bebc1c1 100644
--- a/libc/malloc_debug/README.md
+++ b/libc/malloc_debug/README.md
@@ -394,6 +394,28 @@
 
 **NOTE**: This option is not available until the P release of Android.
 
+### abort\_on\_error
+When malloc debug detects an error, abort after sending the error
+log message.
+
+**NOTE**: If leak\_track is enabled, no abort occurs if leaks have been
+detected when the process is exiting.
+
+### verbose
+As of Android Q, all info messages will be turned off by default. For example,
+in Android P and older, enabling malloc debug would result in this message
+in the log:
+
+    08-16 15:54:16.060 26947 26947 I libc    : /system/bin/app_process64: malloc debug enabled
+
+In android Q, this message will not be displayed because these info messages
+slow down process start up. However, if you want to re-enable these messages,
+add the verbose option. All of the "Run XXX" messages are also silenced unless
+the verbose option is specified. This is an example of the type
+of messages that are no longer displayed:
+
+    09-10 01:03:50.070   557   557 I malloc_debug: /system/bin/audioserver: Run: 'kill -47 557' to dump the backtrace.
+
 Additional Errors
 -----------------
 There are a few other error messages that might appear in the log.
diff --git a/libc/malloc_debug/RecordData.cpp b/libc/malloc_debug/RecordData.cpp
index aea2513..5c550c0 100644
--- a/libc/malloc_debug/RecordData.cpp
+++ b/libc/malloc_debug/RecordData.cpp
@@ -181,8 +181,10 @@
   }
   pthread_setspecific(key_, nullptr);
 
-  info_log("%s: Run: 'kill -%d %d' to dump the allocation records.", getprogname(),
-           config.record_allocs_signal(), getpid());
+  if (config.options() & VERBOSE) {
+    info_log("%s: Run: 'kill -%d %d' to dump the allocation records.", getprogname(),
+             config.record_allocs_signal(), getpid());
+  }
 
   num_entries_ = config.record_allocs_num_entries();
   entries_ = new const RecordEntry*[num_entries_];
diff --git a/libc/malloc_debug/backtrace.cpp b/libc/malloc_debug/backtrace.cpp
index cd8c334..0e3a53f 100644
--- a/libc/malloc_debug/backtrace.cpp
+++ b/libc/malloc_debug/backtrace.cpp
@@ -156,8 +156,8 @@
     }
 
     char offset_buf[128];
-    if (entry != nullptr && entry->offset != 0) {
-      snprintf(offset_buf, sizeof(offset_buf), " (offset 0x%" PRIxPTR ")", entry->offset);
+    if (entry != nullptr && entry->elf_start_offset != 0) {
+      snprintf(offset_buf, sizeof(offset_buf), " (offset 0x%" PRIxPTR ")", entry->elf_start_offset);
     } else {
       offset_buf[0] = '\0';
     }
diff --git a/libc/malloc_debug/exported32.map b/libc/malloc_debug/exported32.map
index 2f590d0..8ed37fa 100644
--- a/libc/malloc_debug/exported32.map
+++ b/libc/malloc_debug/exported32.map
@@ -14,6 +14,7 @@
     debug_malloc_backtrace;
     debug_malloc_disable;
     debug_malloc_enable;
+    debug_malloc_info;
     debug_malloc_usable_size;
     debug_mallopt;
     debug_memalign;
diff --git a/libc/malloc_debug/exported64.map b/libc/malloc_debug/exported64.map
index 08d36a5..cdff88b 100644
--- a/libc/malloc_debug/exported64.map
+++ b/libc/malloc_debug/exported64.map
@@ -14,6 +14,7 @@
     debug_malloc_backtrace;
     debug_malloc_disable;
     debug_malloc_enable;
+    debug_malloc_info;
     debug_malloc_usable_size;
     debug_mallopt;
     debug_memalign;
diff --git a/libc/malloc_debug/malloc_debug.cpp b/libc/malloc_debug/malloc_debug.cpp
index 9075a9c..91e1d26 100644
--- a/libc/malloc_debug/malloc_debug.cpp
+++ b/libc/malloc_debug/malloc_debug.cpp
@@ -29,6 +29,8 @@
 #include <errno.h>
 #include <inttypes.h>
 #include <malloc.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <sys/cdefs.h>
 #include <sys/param.h>
@@ -41,6 +43,7 @@
 #include <android-base/properties.h>
 #include <android-base/stringprintf.h>
 #include <private/bionic_malloc_dispatch.h>
+#include <private/MallocXmlElem.h>
 
 #include "Config.h"
 #include "DebugData.h"
@@ -55,7 +58,7 @@
 // ------------------------------------------------------------------------
 DebugData* g_debug;
 
-int* g_malloc_zygote_child;
+bool* g_zygote_child;
 
 const MallocDispatch* g_dispatch;
 // ------------------------------------------------------------------------
@@ -67,7 +70,7 @@
 // ------------------------------------------------------------------------
 __BEGIN_DECLS
 
-bool debug_initialize(const MallocDispatch* malloc_dispatch, int* malloc_zygote_child,
+bool debug_initialize(const MallocDispatch* malloc_dispatch, bool* malloc_zygote_child,
                       const char* options);
 void debug_finalize();
 void debug_dump_heap(const char* file_name);
@@ -85,6 +88,7 @@
 void* debug_calloc(size_t nmemb, size_t bytes);
 struct mallinfo debug_mallinfo();
 int debug_mallopt(int param, int value);
+int debug_malloc_info(int options, FILE* fp);
 int debug_posix_memalign(void** memptr, size_t alignment, size_t size);
 int debug_iterate(uintptr_t base, size_t size,
                   void (*callback)(uintptr_t base, size_t size, void* arg), void* arg);
@@ -154,6 +158,9 @@
   error_log("Backtrace at time of failure:");
   BacktraceAndLog();
   error_log(LOG_DIVIDER);
+  if (g_debug->config().options() & ABORT_ON_ERROR) {
+    abort();
+  }
 }
 
 static bool VerifyPointer(const void* pointer, const char* function_name) {
@@ -218,15 +225,15 @@
   return g_debug->GetPointer(header);
 }
 
-bool debug_initialize(const MallocDispatch* malloc_dispatch, int* malloc_zygote_child,
+bool debug_initialize(const MallocDispatch* malloc_dispatch, bool* zygote_child,
                       const char* options) {
-  if (malloc_zygote_child == nullptr || options == nullptr) {
+  if (zygote_child == nullptr || options == nullptr) {
     return false;
   }
 
   InitAtfork();
 
-  g_malloc_zygote_child = malloc_zygote_child;
+  g_zygote_child = zygote_child;
 
   g_dispatch = malloc_dispatch;
 
@@ -246,6 +253,10 @@
   // of different error cases.
   backtrace_startup();
 
+  if (g_debug->config().options() & VERBOSE) {
+    info_log("%s: malloc debug enabled", getprogname());
+  }
+
   return true;
 }
 
@@ -722,11 +733,37 @@
   return g_dispatch->mallopt(param, value);
 }
 
+int debug_malloc_info(int options, FILE* fp) {
+  if (DebugCallsDisabled() || !g_debug->TrackPointers()) {
+    return g_dispatch->malloc_info(options, fp);
+  }
+
+  MallocXmlElem root(fp, "malloc", "version=\"debug-malloc-1\"");
+  std::vector<ListInfoType> list;
+  PointerData::GetAllocList(&list);
+
+  size_t alloc_num = 0;
+  for (size_t i = 0; i < list.size(); i++) {
+    MallocXmlElem alloc(fp, "allocation", "nr=\"%zu\"", alloc_num);
+
+    size_t total = 1;
+    size_t size = list[i].size;
+    while (i < list.size() - 1 && list[i + 1].size == size) {
+      i++;
+      total++;
+    }
+    MallocXmlElem(fp, "size").Contents("%zu", list[i].size);
+    MallocXmlElem(fp, "total").Contents("%zu", total);
+    alloc_num++;
+  }
+  return 0;
+}
+
 void* debug_aligned_alloc(size_t alignment, size_t size) {
   if (DebugCallsDisabled()) {
     return g_dispatch->aligned_alloc(alignment, size);
   }
-  if (!powerof2(alignment)) {
+  if (!powerof2(alignment) || (size % alignment) != 0) {
     errno = EINVAL;
     return nullptr;
   }
@@ -738,7 +775,7 @@
     return g_dispatch->posix_memalign(memptr, alignment, size);
   }
 
-  if (!powerof2(alignment)) {
+  if (alignment < sizeof(void*) || !powerof2(alignment)) {
     return EINVAL;
   }
   int saved_errno = errno;
diff --git a/libc/malloc_debug/tests/malloc_debug_config_tests.cpp b/libc/malloc_debug/tests/malloc_debug_config_tests.cpp
index a083b4f..42d1415 100644
--- a/libc/malloc_debug/tests/malloc_debug_config_tests.cpp
+++ b/libc/malloc_debug/tests/malloc_debug_config_tests.cpp
@@ -725,3 +725,39 @@
       "value must be <= 50000000: 100000000\n");
   ASSERT_STREQ((log_msg + usage_string).c_str(), getFakeLogPrint().c_str());
 }
+
+TEST_F(MallocDebugConfigTest, abort_on_error) {
+  ASSERT_TRUE(InitConfig("abort_on_error")) << getFakeLogPrint();
+  ASSERT_EQ(ABORT_ON_ERROR, config->options());
+
+  ASSERT_STREQ("", getFakeLogBuf().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
+}
+
+TEST_F(MallocDebugConfigTest, trigger_abort_fail) {
+  ASSERT_FALSE(InitConfig("abort_on_error=200")) << getFakeLogPrint();
+
+  ASSERT_STREQ("", getFakeLogBuf().c_str());
+  std::string log_msg(
+      "6 malloc_debug malloc_testing: value set for option 'abort_on_error' "
+      "which does not take a value\n");
+  ASSERT_STREQ((log_msg + usage_string).c_str(), getFakeLogPrint().c_str());
+}
+
+TEST_F(MallocDebugConfigTest, verbose) {
+  ASSERT_TRUE(InitConfig("verbose")) << getFakeLogPrint();
+  ASSERT_EQ(VERBOSE, config->options());
+
+  ASSERT_STREQ("", getFakeLogBuf().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
+}
+
+TEST_F(MallocDebugConfigTest, trigger_verbose_fail) {
+  ASSERT_FALSE(InitConfig("verbose=200")) << getFakeLogPrint();
+
+  ASSERT_STREQ("", getFakeLogBuf().c_str());
+  std::string log_msg(
+      "6 malloc_debug malloc_testing: value set for option 'verbose' "
+      "which does not take a value\n");
+  ASSERT_STREQ((log_msg + usage_string).c_str(), getFakeLogPrint().c_str());
+}
diff --git a/libc/malloc_debug/tests/malloc_debug_system_tests.cpp b/libc/malloc_debug/tests/malloc_debug_system_tests.cpp
index ccefb25..71e8ebf 100644
--- a/libc/malloc_debug/tests/malloc_debug_system_tests.cpp
+++ b/libc/malloc_debug/tests/malloc_debug_system_tests.cpp
@@ -37,13 +37,15 @@
 #include <time.h>
 #include <unistd.h>
 
+#include <android-base/stringprintf.h>
 #include <gtest/gtest.h>
-
 #include <log/log.h>
 
 #include <string>
 #include <vector>
 
+#include "private/bionic_malloc.h"
+
 static constexpr time_t kTimeoutSeconds = 5;
 
 static void Exec(const char* test_name, const char* debug_options, pid_t* pid) {
@@ -60,13 +62,15 @@
     ASSERT_NE(0, dup2(fds[1], STDERR_FILENO));
 
     std::vector<const char*> args;
-    args.push_back(testing::internal::GetArgvs()[0].c_str());
+    // Get a copy of this argument so it doesn't disappear on us.
+    std::string exec(testing::internal::GetArgvs()[0]);
+    args.push_back(exec.c_str());
     args.push_back("--gtest_also_run_disabled_tests");
     std::string filter_arg = std::string("--gtest_filter=") + test_name;
     args.push_back(filter_arg.c_str());
     args.push_back(nullptr);
     execv(args[0], reinterpret_cast<char* const*>(const_cast<char**>(args.data())));
-    exit(1);
+    exit(20);
   }
   ASSERT_NE(-1, *pid);
   close(fds[1]);
@@ -191,21 +195,222 @@
 
 TEST(MallocDebugSystemTest, smoke) {
   pid_t pid;
-  ASSERT_NO_FATAL_FAILURE(Exec("MallocTests.DISABLED_smoke", "backtrace", &pid));
+  ASSERT_NO_FATAL_FAILURE(Exec("MallocTests.DISABLED_smoke", "verbose backtrace", &pid));
 
   ASSERT_NO_FATAL_FAILURE(FindStrings(pid, std::vector<const char*>{"malloc debug enabled"}));
 }
 
-TEST(MallocTests, DISABLED_leak_memory) {
+static void SetAllocationLimit() {
+  // Set to a large value, this is only to enable the limit code and
+  // verify that malloc debug is still called properly.
+  size_t limit = 500 * 1024 * 1024;
+  ASSERT_TRUE(android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES, &limit, sizeof(limit)));
+}
+
+static void AlignedAlloc() {
+  void* ptr = aligned_alloc(64, 1152);
+  ASSERT_TRUE(ptr != nullptr);
+  memset(ptr, 0, 1152);
+}
+
+TEST(MallocTests, DISABLED_leak_memory_aligned_alloc) {
+  AlignedAlloc();
+}
+
+TEST(MallocTests, DISABLED_leak_memory_limit_aligned_alloc) {
+  SetAllocationLimit();
+  AlignedAlloc();
+}
+
+static void Calloc() {
+  void* ptr = calloc(1, 1123);
+  ASSERT_TRUE(ptr != nullptr);
+  memset(ptr, 1, 1123);
+}
+
+TEST(MallocTests, DISABLED_leak_memory_calloc) {
+  Calloc();
+}
+
+TEST(MallocTests, DISABLED_leak_memory_limit_calloc) {
+  SetAllocationLimit();
+  Calloc();
+}
+
+static void Malloc() {
   void* ptr = malloc(1123);
   ASSERT_TRUE(ptr != nullptr);
   memset(ptr, 0, 1123);
 }
 
-TEST(MallocDebugSystemTest, verify_leak) {
-  pid_t pid;
-  ASSERT_NO_FATAL_FAILURE(Exec("MallocTests.DISABLED_leak_memory", "backtrace leak_track", &pid));
+TEST(MallocTests, DISABLED_leak_memory_malloc) {
+  Malloc();
+}
 
-  ASSERT_NO_FATAL_FAILURE(FindStrings(
-      pid, std::vector<const char*>{"malloc debug enabled", "leaked block of size 1123 at"}));
+TEST(MallocTests, DISABLED_leak_memory_limit_malloc) {
+  SetAllocationLimit();
+  Malloc();
+}
+
+static void Memalign() {
+  void* ptr = memalign(64, 1123);
+  ASSERT_TRUE(ptr != nullptr);
+  memset(ptr, 0, 1123);
+}
+
+TEST(MallocTests, DISABLED_leak_memory_memalign) {
+  Memalign();
+}
+
+TEST(MallocTests, DISABLED_leak_memory_limit_memalign) {
+  SetAllocationLimit();
+  Memalign();
+}
+
+static void PosixMemalign() {
+  void* ptr;
+  ASSERT_EQ(0, posix_memalign(&ptr, 64, 1123));
+  ASSERT_TRUE(ptr != nullptr);
+  memset(ptr, 0, 1123);
+}
+
+TEST(MallocTests, DISABLED_leak_memory_posix_memalign) {
+  PosixMemalign();
+}
+
+TEST(MallocTests, DISABLED_leak_memory_limit_posix_memalign) {
+  SetAllocationLimit();
+  PosixMemalign();
+}
+
+static void Reallocarray() {
+  void* ptr = reallocarray(nullptr, 1, 1123);
+  ASSERT_TRUE(ptr != nullptr);
+  memset(ptr, 0, 1123);
+}
+
+TEST(MallocTests, DISABLED_leak_memory_reallocarray) {
+  Reallocarray();
+}
+
+TEST(MallocTests, DISABLED_leak_memory_limit_reallocarray) {
+  SetAllocationLimit();
+  Reallocarray();
+}
+
+static void Realloc() {
+  void* ptr = realloc(nullptr, 1123);
+  ASSERT_TRUE(ptr != nullptr);
+  memset(ptr, 0, 1123);
+}
+
+TEST(MallocTests, DISABLED_leak_memory_realloc) {
+  Realloc();
+}
+
+TEST(MallocTests, DISABLED_leak_memory_limit_realloc) {
+  SetAllocationLimit();
+  Realloc();
+}
+
+#if !defined(__LP64__)
+extern "C" void* pvalloc(size_t);
+
+static void Pvalloc() {
+  void* ptr = pvalloc(1123);
+  ASSERT_TRUE(ptr != nullptr);
+  memset(ptr, 0, 1123);
+}
+
+TEST(MallocTests, DISABLED_leak_memory_pvalloc) {
+  Pvalloc();
+}
+
+TEST(MallocTests, DISABLED_leak_memory_limit_pvalloc) {
+  SetAllocationLimit();
+  Pvalloc();
+}
+
+extern "C" void* valloc(size_t);
+
+static void Valloc() {
+  void* ptr = valloc(1123);
+  ASSERT_TRUE(ptr != nullptr);
+  memset(ptr, 0, 1123);
+}
+
+TEST(MallocTests, DISABLED_leak_memory_valloc) {
+  Valloc();
+}
+
+TEST(MallocTests, DISABLED_leak_memory_limit_valloc) {
+  SetAllocationLimit();
+  Valloc();
+}
+#endif
+
+static void VerifyLeak(const char* test_prefix) {
+  struct FunctionInfo {
+    const char* name;
+    size_t size;
+  };
+  static FunctionInfo functions[] = {
+    {
+      "aligned_alloc",
+      1152,
+    },
+    {
+      "calloc",
+      1123,
+    },
+    {
+      "malloc",
+      1123,
+    },
+    {
+      "memalign",
+      1123,
+    },
+    {
+      "posix_memalign",
+      1123,
+    },
+    {
+      "reallocarray",
+      1123,
+    },
+    {
+      "realloc",
+      1123,
+    },
+#if !defined(__LP64__)
+    {
+      "pvalloc",
+      4096,
+    },
+    {
+      "valloc",
+      1123,
+    }
+#endif
+  };
+
+  for (size_t i = 0; i < sizeof(functions) / sizeof(FunctionInfo); i++) {
+    pid_t pid;
+    SCOPED_TRACE(testing::Message() << functions[i].name << " expected size " << functions[i].size);
+    std::string test = std::string("MallocTests.DISABLED_") + test_prefix + functions[i].name;
+    EXPECT_NO_FATAL_FAILURE(Exec(test.c_str(), "verbose backtrace leak_track", &pid));
+
+    std::string expected_leak = android::base::StringPrintf("leaked block of size %zu at", functions[i].size);
+    EXPECT_NO_FATAL_FAILURE(FindStrings(
+        pid, std::vector<const char*>{"malloc debug enabled", expected_leak.c_str()}));
+  }
+}
+
+TEST(MallocDebugSystemTest, verify_leak) {
+  VerifyLeak("leak_memory_");
+}
+
+TEST(MallocDebugSystemTest, verify_leak_allocation_limit) {
+  VerifyLeak("leak_memory_limit_");
 }
diff --git a/libc/malloc_debug/tests/malloc_debug_unit_tests.cpp b/libc/malloc_debug/tests/malloc_debug_unit_tests.cpp
index 2d6346f..0238d10 100644
--- a/libc/malloc_debug/tests/malloc_debug_unit_tests.cpp
+++ b/libc/malloc_debug/tests/malloc_debug_unit_tests.cpp
@@ -16,6 +16,7 @@
 
 #include <malloc.h>
 #include <signal.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/cdefs.h>
@@ -25,10 +26,13 @@
 #include <unistd.h>
 
 #include <algorithm>
+#include <memory>
 #include <thread>
 #include <vector>
 #include <utility>
 
+#include <tinyxml2.h>
+
 #include <gtest/gtest.h>
 
 #include <android-base/file.h>
@@ -46,7 +50,7 @@
 
 __BEGIN_DECLS
 
-bool debug_initialize(const MallocDispatch*, int*, const char*);
+bool debug_initialize(const MallocDispatch*, bool*, const char*);
 void debug_finalize();
 
 void* debug_malloc(size_t);
@@ -62,6 +66,7 @@
 
 struct mallinfo debug_mallinfo();
 int debug_mallopt(int, int);
+int debug_malloc_info(int, FILE*);
 
 #if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
 void* debug_pvalloc(size_t);
@@ -98,8 +103,8 @@
   }
 
   void Init(const char* options) {
-    zygote = 0;
-    ASSERT_TRUE(debug_initialize(&dispatch, &zygote, options));
+    zygote_child = false;
+    ASSERT_TRUE(debug_initialize(&dispatch, &zygote_child, options));
     initialized = true;
   }
 
@@ -111,7 +116,7 @@
 
   bool initialized;
 
-  int zygote;
+  bool zygote_child;
 
   static MallocDispatch dispatch;
 };
@@ -136,6 +141,7 @@
   nullptr,
   mallopt,
   aligned_alloc,
+  malloc_info,
 };
 
 std::string ShowDiffs(uint8_t* a, uint8_t* b, size_t size) {
@@ -148,7 +154,7 @@
   return diff;
 }
 
-void VerifyAllocCalls(bool backtrace_enabled) {
+void VerifyAllocCalls(bool all_options) {
   size_t alloc_size = 1024;
 
   // Verify debug_malloc.
@@ -203,21 +209,28 @@
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
   std::string expected_log;
-  if (backtrace_enabled) {
+  if (all_options) {
+    expected_log += android::base::StringPrintf(
+        "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to enable backtracing.\n",
+        SIGRTMAX - 19, getpid());
     expected_log += android::base::StringPrintf(
         "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
         SIGRTMAX - 17, getpid());
+    expected_log += android::base::StringPrintf(
+        "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the allocation records.\n",
+        SIGRTMAX - 18, getpid());
   }
+  expected_log += "4 malloc_debug malloc_testing: malloc debug enabled\n";
   ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
 }
 
 TEST_F(MallocDebugTest, fill_generic) {
-  Init("fill");
+  Init("verbose fill");
   VerifyAllocCalls(false);
 }
 
 TEST_F(MallocDebugTest, fill_on_alloc_generic) {
-  Init("fill_on_alloc");
+  Init("verbose fill_on_alloc");
   VerifyAllocCalls(false);
 }
 
@@ -235,6 +248,46 @@
   ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
+TEST_F(MallocDebugTest, verbose_only) {
+  Init("verbose");
+
+  ASSERT_STREQ("", getFakeLogBuf().c_str());
+  ASSERT_STREQ("4 malloc_debug malloc_testing: malloc debug enabled\n", getFakeLogPrint().c_str());
+}
+
+TEST_F(MallocDebugTest, verbose_backtrace_enable_on_signal) {
+  Init("verbose backtrace_enable_on_signal");
+
+  std::string expected_log = android::base::StringPrintf(
+      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to enable backtracing.\n",
+      SIGRTMAX - 19, getpid());
+  expected_log += android::base::StringPrintf(
+      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
+      SIGRTMAX - 17, getpid());
+  expected_log += "4 malloc_debug malloc_testing: malloc debug enabled\n";
+  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+}
+
+TEST_F(MallocDebugTest, verbose_backtrace) {
+  Init("verbose backtrace");
+
+  std::string expected_log = android::base::StringPrintf(
+      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
+      SIGRTMAX - 17, getpid());
+  expected_log += "4 malloc_debug malloc_testing: malloc debug enabled\n";
+  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+}
+
+TEST_F(MallocDebugTest, verbose_record_allocs) {
+  Init("verbose record_allocs");
+
+  std::string expected_log = android::base::StringPrintf(
+      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the allocation records.\n",
+      SIGRTMAX - 18, getpid());
+  expected_log += "4 malloc_debug malloc_testing: malloc debug enabled\n";
+  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+}
+
 TEST_F(MallocDebugTest, fill_on_free) {
   Init("fill_on_free free_track free_track_backtrace_num_frames=0");
 
@@ -296,7 +349,9 @@
 }
 
 TEST_F(MallocDebugTest, all_options) {
-  Init("guard backtrace fill expand_alloc free_track leak_track");
+  Init(
+      "guard backtrace backtrace_enable_on_signal fill expand_alloc free_track leak_track "
+      "record_allocs verify_pointers abort_on_error verbose");
   VerifyAllocCalls(true);
 }
 
@@ -318,7 +373,7 @@
   ASSERT_LE(1039U, debug_malloc_usable_size(pointer));
   debug_free(pointer);
 
-  pointer = debug_aligned_alloc(128, 15);
+  pointer = debug_aligned_alloc(16, 16);
   ASSERT_TRUE(pointer != nullptr);
   ASSERT_LE(1039U, debug_malloc_usable_size(pointer));
   debug_free(pointer);
@@ -661,9 +716,6 @@
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
   std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  expected_log += android::base::StringPrintf(
       "6 malloc_debug +++ malloc_testing leaked block of size 1024 at %p (leak 1 of 3)\n",
       pointer3);
   expected_log += "6 malloc_debug Backtrace at time of allocation:\n";
@@ -990,6 +1042,35 @@
   ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
+TEST_F(MallocDebugTest, free_track_pointer_modified_after_free) {
+  Init("free_track=4 fill_on_free=2 free_track_backtrace_num_frames=0");
+
+  void* pointers[5];
+  for (size_t i = 0; i < sizeof(pointers) / sizeof(void*); i++) {
+    pointers[i] = debug_malloc(100);
+    ASSERT_TRUE(pointers[i] != nullptr);
+    memset(pointers[i], 0, 100);
+  }
+
+  debug_free(pointers[0]);
+
+  // overwrite the whole pointer, only expect errors on the fill bytes we check.
+  memset(pointers[0], 0x20, 100);
+
+  for (size_t i = 1; i < sizeof(pointers) / sizeof(void*); i++) {
+    debug_free(pointers[i]);
+  }
+
+  std::string expected_log(DIVIDER);
+  expected_log += android::base::StringPrintf("6 malloc_debug +++ ALLOCATION %p USED AFTER FREE\n",
+                                              pointers[0]);
+  expected_log += "6 malloc_debug   allocation[0] = 0x20 (expected 0xef)\n";
+  expected_log += "6 malloc_debug   allocation[1] = 0x20 (expected 0xef)\n";
+  expected_log += DIVIDER;
+  ASSERT_STREQ("", getFakeLogBuf().c_str());
+  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+}
+
 TEST_F(MallocDebugTest, get_malloc_leak_info_invalid) {
   Init("fill");
 
@@ -1061,10 +1142,7 @@
   ASSERT_EQ(0U, backtrace_size);
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
 TEST_F(MallocDebugTest, get_malloc_leak_info_single) {
@@ -1108,10 +1186,7 @@
   debug_free(pointer);
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
 TEST_F(MallocDebugTest, get_malloc_leak_info_multi) {
@@ -1191,10 +1266,7 @@
   debug_free(pointers[2]);
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
 TEST_F(MallocDebugTest, get_malloc_backtrace_with_header) {
@@ -1226,10 +1298,7 @@
   initialized = false;
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
 static std::string SanitizeHeapData(const std::string& data) {
@@ -1275,7 +1344,7 @@
   backtrace_fake_add(std::vector<uintptr_t> {0xa300, 0xb300});
 
   std::vector<void*> pointers;
-  zygote = 1;
+  zygote_child = true;
   pointers.push_back(debug_malloc(100));
   ASSERT_TRUE(pointers.back() != nullptr);
   pointers.push_back(debug_malloc(40));
@@ -1283,7 +1352,7 @@
   pointers.push_back(debug_malloc(200));
   ASSERT_TRUE(pointers.back() != nullptr);
 
-  zygote = 0;
+  zygote_child = false;
   pointers.push_back(debug_malloc(10));
   ASSERT_TRUE(pointers.back() != nullptr);
   pointers.push_back(debug_malloc(50));
@@ -1340,9 +1409,6 @@
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
   std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  expected_log += android::base::StringPrintf(
       "6 malloc_debug Dumping to file: /data/local/tmp/backtrace_heap.%d.txt\n\n", getpid());
   ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
 }
@@ -1614,13 +1680,7 @@
   debug_free_malloc_leak_info(info);
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to enable backtracing.\n",
-      SIGRTMAX - 19, getpid());
-  expected_log += android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
 TEST_F(MallocDebugTest, backtrace_same_stack) {
@@ -1677,10 +1737,7 @@
   debug_free(pointers[3]);
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
 TEST_F(MallocDebugTest, backtrace_same_stack_zygote) {
@@ -1693,7 +1750,7 @@
   backtrace_fake_add(std::vector<uintptr_t> {0xbc000, 0xecd00, 0x12000});
   backtrace_fake_add(std::vector<uintptr_t> {0xbc000});
 
-  zygote = 1;
+  zygote_child = true;
 
   void* pointers[4];
   pointers[0] = debug_malloc(100);
@@ -1739,10 +1796,7 @@
   debug_free(pointers[3]);
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
 TEST_F(MallocDebugTest, backtrace_same_stack_mix_zygote) {
@@ -1755,14 +1809,14 @@
   backtrace_fake_add(std::vector<uintptr_t> {0xbc000, 0xecd00, 0x12000});
   backtrace_fake_add(std::vector<uintptr_t> {0xbc000});
 
-  zygote = 1;
+  zygote_child = true;
   void* pointers[4];
   pointers[0] = debug_malloc(40);
   ASSERT_TRUE(pointers[0] != nullptr);
   pointers[1] = debug_malloc(40);
   ASSERT_TRUE(pointers[1] != nullptr);
 
-  zygote = 0;
+  zygote_child = false;
   pointers[2] = debug_malloc(40);
   ASSERT_TRUE(pointers[2] != nullptr);
   pointers[3] = debug_malloc(100);
@@ -1809,10 +1863,7 @@
   debug_free(pointers[3]);
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
 TEST_F(MallocDebugTest, backtrace_frame_data_nullptr_same_size) {
@@ -1856,10 +1907,7 @@
   debug_free(pointers[3]);
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
 TEST_F(MallocDebugTest, overflow) {
@@ -1941,7 +1989,7 @@
   // Set all of the options.
   Init("guard fill backtrace leak_track free_track=2");
 
-  zygote = 1;
+  zygote_child = true;
 
   backtrace_fake_add(std::vector<uintptr_t> {0x1});
 
@@ -1987,10 +2035,7 @@
   debug_free(pointer);
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the backtrace.\n",
-      SIGRTMAX - 17, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 }
 
 TEST_F(MallocDebugTest, max_size) {
@@ -2115,9 +2160,9 @@
   debug_free(pointer);
   expected += android::base::StringPrintf("%d: free %p\n", getpid(), pointer);
 
-  pointer = debug_aligned_alloc(32, 50);
+  pointer = debug_aligned_alloc(32, 64);
   ASSERT_TRUE(pointer != nullptr);
-  expected += android::base::StringPrintf("%d: memalign %p 32 50\n", getpid(), pointer);
+  expected += android::base::StringPrintf("%d: memalign %p 32 64\n", getpid(), pointer);
   debug_free(pointer);
   expected += android::base::StringPrintf("%d: free %p\n", getpid(), pointer);
 
@@ -2158,10 +2203,7 @@
   ASSERT_STREQ(expected.c_str(), actual.c_str());
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the allocation records.\n",
-      SIGRTMAX - 18, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 
   debug_free(pointer);
 }
@@ -2216,10 +2258,7 @@
   ASSERT_STREQ(expected.c_str(), actual.c_str());
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the allocation records.\n",
-      SIGRTMAX - 18, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 
   debug_free(pointer);
 }
@@ -2258,10 +2297,7 @@
   ASSERT_STREQ(expected.c_str(), actual.c_str());
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
-  std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the allocation records.\n",
-      SIGRTMAX - 18, getpid());
-  ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
 
   debug_free(pointer);
 }
@@ -2313,9 +2349,6 @@
 
   ASSERT_STREQ("", getFakeLogBuf().c_str());
   std::string expected_log = android::base::StringPrintf(
-      "4 malloc_debug malloc_testing: Run: 'kill -%d %d' to dump the allocation records.\n",
-      SIGRTMAX - 18, getpid());
-  expected_log += android::base::StringPrintf(
       "6 malloc_debug Cannot create record alloc file %s: Too many symbolic links encountered\n",
       RECORD_ALLOCS_FILE);
   ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
@@ -2380,3 +2413,138 @@
   expected_log += DIVIDER;
   ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
 }
+
+TEST_F(MallocDebugTest, abort_on_error_log_error) {
+  Init("abort_on_error verify_pointers");
+
+  void* pointer = debug_malloc(10);
+  memset(pointer, 0, 10);
+  debug_free(pointer);
+
+  ASSERT_STREQ("", getFakeLogBuf().c_str());
+  ASSERT_STREQ("", getFakeLogPrint().c_str());
+
+  EXPECT_DEATH(debug_free(pointer), "");
+}
+
+TEST_F(MallocDebugTest, abort_on_error_guard_corrupted) {
+  Init("abort_on_error front_guard=32");
+
+  uint8_t* pointer = reinterpret_cast<uint8_t*>(debug_malloc(100));
+  ASSERT_TRUE(pointer != nullptr);
+  pointer[-16] = 0x00;
+  EXPECT_DEATH(debug_free(pointer), "");
+  pointer[-16] = 0xaa;
+  debug_free(pointer);
+}
+
+TEST_F(MallocDebugTest, abort_on_error_use_after_free) {
+  Init("abort_on_error free_track=100 free_track_backtrace_num_frames=0");
+
+  uint8_t* pointer = reinterpret_cast<uint8_t*>(debug_malloc(100));
+  ASSERT_TRUE(pointer != nullptr);
+  memset(pointer, 0, 100);
+  debug_free(pointer);
+
+  pointer[56] = 0x91;
+
+  EXPECT_DEATH(debug_finalize(), "");
+
+  pointer[56] = 0xef;
+}
+
+TEST_F(MallocDebugTest, abort_on_error_header_tag_corrupted) {
+  Init("abort_on_error free_track=100 free_track_backtrace_num_frames=0 rear_guard");
+
+  uint8_t* pointer = reinterpret_cast<uint8_t*>(debug_malloc(100));
+  ASSERT_TRUE(pointer != nullptr);
+  memset(pointer, 0, 100);
+  debug_free(pointer);
+
+  uint8_t tag_value = pointer[-get_tag_offset()];
+  pointer[-get_tag_offset()] = 0x00;
+
+  EXPECT_DEATH(debug_finalize(), "");
+
+  pointer[-get_tag_offset()] = tag_value;
+}
+
+TEST_F(MallocDebugTest, malloc_info_no_pointer_tracking) {
+  Init("fill");
+
+  char* buffer;
+  size_t size;
+  FILE* memstream = open_memstream(&buffer, &size);
+  ASSERT_TRUE(memstream != nullptr);
+  ASSERT_EQ(0, debug_malloc_info(0, memstream));
+  ASSERT_EQ(0, fclose(memstream));
+
+  tinyxml2::XMLDocument doc;
+  ASSERT_EQ(tinyxml2::XML_SUCCESS, doc.Parse(buffer));
+  auto root = doc.FirstChildElement();
+  ASSERT_TRUE(root != nullptr);
+  ASSERT_STREQ("malloc", root->Name());
+  // Don't care what the underyling implementation says, just that it's
+  // not generated by debug malloc.
+  ASSERT_STRNE("debug-malloc-1", root->Attribute("version"));
+}
+
+TEST_F(MallocDebugTest, malloc_info_with_pointer_tracking) {
+  Init("verify_pointers");
+
+  std::unique_ptr<void, decltype(debug_free)*> ptr1(debug_malloc(1000), debug_free);
+  ASSERT_TRUE(ptr1.get() != nullptr);
+  std::unique_ptr<void, decltype(debug_free)*> ptr2(debug_malloc(1000), debug_free);
+  ASSERT_TRUE(ptr2.get() != nullptr);
+  std::unique_ptr<void, decltype(debug_free)*> ptr3(debug_malloc(500), debug_free);
+  ASSERT_TRUE(ptr3.get() != nullptr);
+  std::unique_ptr<void, decltype(debug_free)*> ptr4(debug_malloc(1200), debug_free);
+  ASSERT_TRUE(ptr4.get() != nullptr);
+
+  char* buffer;
+  size_t size;
+  FILE* memstream = open_memstream(&buffer, &size);
+  ASSERT_TRUE(memstream != nullptr);
+  ASSERT_EQ(0, debug_malloc_info(0, memstream));
+  ASSERT_EQ(0, fclose(memstream));
+
+  SCOPED_TRACE(testing::Message() << "Output:\n" << buffer);
+
+  tinyxml2::XMLDocument doc;
+  ASSERT_EQ(tinyxml2::XML_SUCCESS, doc.Parse(buffer));
+  auto root = doc.FirstChildElement();
+  ASSERT_TRUE(root != nullptr);
+  ASSERT_STREQ("malloc", root->Name());
+  ASSERT_STREQ("debug-malloc-1", root->Attribute("version"));
+
+  auto alloc = root->FirstChildElement();
+  ASSERT_TRUE(alloc != nullptr);
+  ASSERT_STREQ("allocation", alloc->Name());
+  int val;
+  ASSERT_EQ(tinyxml2::XML_SUCCESS, alloc->QueryIntAttribute("nr", &val));
+  ASSERT_EQ(0, val);
+  ASSERT_EQ(tinyxml2::XML_SUCCESS, alloc->FirstChildElement("size")->QueryIntText(&val));
+  ASSERT_EQ(1200, val);
+  ASSERT_EQ(tinyxml2::XML_SUCCESS, alloc->FirstChildElement("total")->QueryIntText(&val));
+  ASSERT_EQ(1, val);
+
+  alloc = alloc->NextSiblingElement();
+  ASSERT_TRUE(alloc != nullptr);
+  ASSERT_STREQ("allocation", alloc->Name());
+  ASSERT_EQ(tinyxml2::XML_SUCCESS, alloc->QueryIntAttribute("nr", &val));
+  ASSERT_EQ(1, val);
+  ASSERT_EQ(tinyxml2::XML_SUCCESS, alloc->FirstChildElement("size")->QueryIntText(&val));
+  ASSERT_EQ(1000, val);
+  ASSERT_EQ(tinyxml2::XML_SUCCESS, alloc->FirstChildElement("total")->QueryIntText(&val));
+  ASSERT_EQ(2, val);
+
+  alloc = alloc->NextSiblingElement();
+  ASSERT_TRUE(alloc != nullptr);
+  ASSERT_STREQ("allocation", alloc->Name());
+  ASSERT_EQ(tinyxml2::XML_SUCCESS, alloc->QueryIntAttribute("nr", &val));
+  ASSERT_EQ(2, val);
+  ASSERT_EQ(tinyxml2::XML_SUCCESS, alloc->FirstChildElement("size")->QueryIntText(&val));
+  ASSERT_EQ(500, val);
+  ASSERT_EQ(tinyxml2::XML_SUCCESS, alloc->FirstChildElement("total")->QueryIntText(&val));
+  ASSERT_EQ(1, val);
+}
diff --git a/libc/malloc_hooks/Android.bp b/libc/malloc_hooks/Android.bp
index d4b5a2a..d119f89 100644
--- a/libc/malloc_hooks/Android.bp
+++ b/libc/malloc_hooks/Android.bp
@@ -39,14 +39,6 @@
 // ==============================================================
 cc_test {
     name: "malloc_hooks_unit_tests",
-    multilib: {
-        lib32: {
-            suffix: "32",
-        },
-        lib64: {
-            suffix: "64",
-        },
-    },
 
     srcs: [
         "tests/malloc_hooks_tests.cpp",
diff --git a/libc/malloc_hooks/exported32.map b/libc/malloc_hooks/exported32.map
index bd3e547..293d9ac 100644
--- a/libc/malloc_hooks/exported32.map
+++ b/libc/malloc_hooks/exported32.map
@@ -13,6 +13,7 @@
     hooks_malloc_backtrace;
     hooks_malloc_disable;
     hooks_malloc_enable;
+    hooks_malloc_info;
     hooks_malloc_usable_size;
     hooks_mallopt;
     hooks_memalign;
diff --git a/libc/malloc_hooks/exported64.map b/libc/malloc_hooks/exported64.map
index 72465c4..340106b 100644
--- a/libc/malloc_hooks/exported64.map
+++ b/libc/malloc_hooks/exported64.map
@@ -13,6 +13,7 @@
     hooks_malloc_backtrace;
     hooks_malloc_disable;
     hooks_malloc_enable;
+    hooks_malloc_info;
     hooks_malloc_usable_size;
     hooks_mallopt;
     hooks_memalign;
diff --git a/libc/malloc_hooks/malloc_hooks.cpp b/libc/malloc_hooks/malloc_hooks.cpp
index f7bdd56..b1c1d50 100644
--- a/libc/malloc_hooks/malloc_hooks.cpp
+++ b/libc/malloc_hooks/malloc_hooks.cpp
@@ -29,6 +29,7 @@
 #include <errno.h>
 #include <malloc.h>
 #include <stdint.h>
+#include <stdio.h>
 #include <string.h>
 #include <sys/param.h>
 #include <unistd.h>
@@ -47,7 +48,7 @@
 // ------------------------------------------------------------------------
 __BEGIN_DECLS
 
-bool hooks_initialize(const MallocDispatch* malloc_dispatch, int* malloc_zygote_child,
+bool hooks_initialize(const MallocDispatch* malloc_dispatch, bool* zygote_child,
     const char* options);
 void hooks_finalize();
 void hooks_get_malloc_leak_info(
@@ -57,6 +58,7 @@
 void hooks_free_malloc_leak_info(uint8_t* info);
 size_t hooks_malloc_usable_size(void* pointer);
 void* hooks_malloc(size_t size);
+int hooks_malloc_info(int options, FILE* fp);
 void hooks_free(void* pointer);
 void* hooks_memalign(size_t alignment, size_t bytes);
 void* hooks_aligned_alloc(size_t alignment, size_t bytes);
@@ -95,7 +97,7 @@
 __END_DECLS
 // ------------------------------------------------------------------------
 
-bool hooks_initialize(const MallocDispatch* malloc_dispatch, int*, const char*) {
+bool hooks_initialize(const MallocDispatch* malloc_dispatch, bool*, const char*) {
   g_dispatch = malloc_dispatch;
   __malloc_hook = default_malloc_hook;
   __realloc_hook = default_realloc_hook;
@@ -174,9 +176,13 @@
   return g_dispatch->mallopt(param, value);
 }
 
+int hooks_malloc_info(int options, FILE* fp) {
+  return g_dispatch->malloc_info(options, fp);
+}
+
 void* hooks_aligned_alloc(size_t alignment, size_t size) {
   if (__memalign_hook != nullptr && __memalign_hook != default_memalign_hook) {
-    if (!powerof2(alignment)) {
+    if (!powerof2(alignment) || (size % alignment) != 0) {
       errno = EINVAL;
       return nullptr;
     }
@@ -191,7 +197,7 @@
 
 int hooks_posix_memalign(void** memptr, size_t alignment, size_t size) {
   if (__memalign_hook != nullptr && __memalign_hook != default_memalign_hook) {
-    if (!powerof2(alignment)) {
+    if (alignment < sizeof(void*) || !powerof2(alignment)) {
       return EINVAL;
     }
     *memptr = __memalign_hook(alignment, size, __builtin_return_address(0));
diff --git a/libc/private/MallocXmlElem.h b/libc/private/MallocXmlElem.h
new file mode 100644
index 0000000..04d3eee
--- /dev/null
+++ b/libc/private/MallocXmlElem.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#include <private/bionic_macros.h>
+
+class MallocXmlElem {
+ public:
+  // Name must be valid throughout lifetime of the object.
+  explicit MallocXmlElem(FILE* fp, const char* name,
+                         const char* attr_fmt = nullptr, ...) : fp_(fp), name_(name) {
+    fprintf(fp, "<%s", name_);
+    if (attr_fmt != nullptr) {
+      va_list args;
+      va_start(args, attr_fmt);
+      fputc(' ', fp_);
+      vfprintf(fp_, attr_fmt, args);
+      va_end(args);
+    }
+    fputc('>', fp_);
+  }
+
+  ~MallocXmlElem() noexcept {
+    fprintf(fp_, "</%s>", name_);
+  }
+
+  void Contents(const char* fmt, ...) {
+    va_list args;
+    va_start(args, fmt);
+    vfprintf(fp_, fmt, args);
+    va_end(args);
+  }
+
+private:
+  FILE* fp_;
+  const char* name_;
+
+  BIONIC_DISALLOW_IMPLICIT_CONSTRUCTORS(MallocXmlElem);
+};
diff --git a/libc/private/ScopedRWLock.h b/libc/private/ScopedRWLock.h
new file mode 100644
index 0000000..f034505
--- /dev/null
+++ b/libc/private/ScopedRWLock.h
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <pthread.h>
+
+#include "private/bionic_macros.h"
+
+template <bool write> class ScopedRWLock {
+ public:
+  explicit ScopedRWLock(pthread_rwlock_t* rwlock) : rwlock_(rwlock) {
+    (write ? pthread_rwlock_wrlock : pthread_rwlock_rdlock)(rwlock_);
+  }
+
+  ~ScopedRWLock() {
+    pthread_rwlock_unlock(rwlock_);
+  }
+
+ private:
+  pthread_rwlock_t* rwlock_;
+  BIONIC_DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedRWLock);
+};
+
+typedef ScopedRWLock<true> ScopedWriteLock;
+typedef ScopedRWLock<false> ScopedReadLock;
diff --git a/libc/private/ScopedReaddir.h b/libc/private/ScopedReaddir.h
index dc22309..9a20c09 100644
--- a/libc/private/ScopedReaddir.h
+++ b/libc/private/ScopedReaddir.h
@@ -22,10 +22,10 @@
 
 class ScopedReaddir {
  public:
-  ScopedReaddir(const char* path) : ScopedReaddir(opendir(path)) {
+  explicit ScopedReaddir(const char* path) : ScopedReaddir(opendir(path)) {
   }
 
-  ScopedReaddir(DIR* dir) {
+  explicit ScopedReaddir(DIR* dir) {
     dir_ = dir;
   }
 
diff --git a/libc/private/ScopedSignalHandler.h b/libc/private/ScopedSignalHandler.h
index dd5823f..7031752 100644
--- a/libc/private/ScopedSignalHandler.h
+++ b/libc/private/ScopedSignalHandler.h
@@ -33,7 +33,7 @@
     sigaction64(signal_number_, &action_, &old_action_);
   }
 
-  ScopedSignalHandler(int signal_number) : signal_number_(signal_number) {
+  explicit ScopedSignalHandler(int signal_number) : signal_number_(signal_number) {
     sigaction64(signal_number, nullptr, &old_action_);
   }
 
diff --git a/libc/private/__bionic_get_shell_path.h b/libc/private/__bionic_get_shell_path.h
new file mode 100644
index 0000000..171c14a
--- /dev/null
+++ b/libc/private/__bionic_get_shell_path.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#pragma once
+
+extern "C" const char* __bionic_get_shell_path();
diff --git a/libc/private/bionic_allocator.h b/libc/private/bionic_allocator.h
new file mode 100644
index 0000000..c705ce4
--- /dev/null
+++ b/libc/private/bionic_allocator.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+#pragma once
+
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/cdefs.h>
+#include <sys/mman.h>
+#include <sys/prctl.h>
+#include <stddef.h>
+#include <unistd.h>
+
+const uint32_t kSmallObjectMaxSizeLog2 = 10;
+const uint32_t kSmallObjectMinSizeLog2 = 4;
+const uint32_t kSmallObjectAllocatorsCount = kSmallObjectMaxSizeLog2 - kSmallObjectMinSizeLog2 + 1;
+
+class BionicSmallObjectAllocator;
+
+// This structure is placed at the beginning of each addressable page
+// and has all information we need to find the corresponding memory allocator.
+struct page_info {
+  char signature[4];
+  uint32_t type;
+  union {
+    // we use allocated_size for large objects allocator
+    size_t allocated_size;
+    // and allocator_addr for small ones.
+    BionicSmallObjectAllocator* allocator_addr;
+  };
+};
+
+struct small_object_block_record {
+  small_object_block_record* next;
+  size_t free_blocks_cnt;
+};
+
+// This structure is placed at the beginning of each page managed by
+// BionicSmallObjectAllocator.  Note that a page_info struct is expected at the
+// beginning of each page as well, and therefore this structure contains a
+// page_info as its *first* field.
+struct small_object_page_info {
+  page_info info;  // Must be the first field.
+
+  // Doubly linked list for traversing all pages allocated by a
+  // BionicSmallObjectAllocator.
+  small_object_page_info* next_page;
+  small_object_page_info* prev_page;
+
+  // Linked list containing all free blocks in this page.
+  small_object_block_record* free_block_list;
+
+  // Free blocks counter.
+  size_t free_blocks_cnt;
+};
+
+class BionicSmallObjectAllocator {
+ public:
+  BionicSmallObjectAllocator(uint32_t type, size_t block_size);
+  void* alloc();
+  void free(void* ptr);
+
+  size_t get_block_size() const { return block_size_; }
+ private:
+  void alloc_page();
+  void free_page(small_object_page_info* page);
+  void add_to_page_list(small_object_page_info* page);
+  void remove_from_page_list(small_object_page_info* page);
+
+  const uint32_t type_;
+  const size_t block_size_;
+  const size_t blocks_per_page_;
+
+  size_t free_pages_cnt_;
+
+  small_object_page_info* page_list_;
+};
+
+class BionicAllocator {
+ public:
+  constexpr BionicAllocator() : allocators_(nullptr), allocators_buf_() {}
+  void* alloc(size_t size);
+  void* memalign(size_t align, size_t size);
+
+  // Note that this implementation of realloc never shrinks allocation
+  void* realloc(void* ptr, size_t size);
+  void free(void* ptr);
+ private:
+  void* alloc_mmap(size_t align, size_t size);
+  inline void* alloc_impl(size_t align, size_t size);
+  inline page_info* get_page_info_unchecked(void* ptr);
+  inline page_info* get_page_info(void* ptr);
+  BionicSmallObjectAllocator* get_small_object_allocator(uint32_t type);
+  void initialize_allocators();
+
+  BionicSmallObjectAllocator* allocators_;
+  uint8_t allocators_buf_[sizeof(BionicSmallObjectAllocator)*kSmallObjectAllocatorsCount];
+};
diff --git a/libc/private/bionic_asm_tls.h b/libc/private/bionic_asm_tls.h
new file mode 100644
index 0000000..92f707a
--- /dev/null
+++ b/libc/private/bionic_asm_tls.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2018 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.
+ */
+
+#pragma once
+
+/** WARNING WARNING WARNING
+ **
+ ** This header file is *NOT* part of the public Bionic ABI/API and should not
+ ** be used/included by user-serviceable parts of the system (e.g.
+ ** applications).
+ **
+ ** It is only provided here for the benefit of Android components that need a
+ ** pre-allocated slot for performance reasons (including ART, the OpenGL
+ ** subsystem, and sanitizers).
+ **/
+
+// Bionic TCB / TLS slots:
+//
+//  - TLS_SLOT_SELF: On x86-{32,64}, the kernel makes TLS memory available via
+//    the gs/fs segments. To get the address of a TLS variable, the first slot
+//    of TLS memory (accessed using %gs:0 / %fs:0) holds the address of the
+//    gs/fs segment. This slot is used by:
+//     - OpenGL and compiler-rt
+//     - Accesses of x86 ELF TLS variables
+//
+//  - TLS_SLOT_OPENGL and TLS_SLOT_OPENGL_API: These two aren't used by bionic
+//    itself, but allow the graphics code to access TLS directly rather than
+//    using the pthread API.
+//
+//  - TLS_SLOT_STACK_GUARD: Used for -fstack-protector by:
+//     - Clang targeting Android/arm64
+//     - gcc targeting Linux/x86-{32,64}
+//
+//  - TLS_SLOT_SANITIZER: Lets sanitizers avoid using pthread_getspecific for
+//    finding the current thread state.
+//
+//  - TLS_SLOT_DTV: Pointer to ELF TLS dynamic thread vector.
+//
+//  - TLS_SLOT_ART_THREAD_SELF: Fast storage for Thread::Current() in ART.
+//
+//  - TLS_SLOT_BIONIC_TLS: Optimizes accesses to bionic_tls by one load versus
+//    finding it using __get_thread().
+//
+//  - TLS_SLOT_APP: Available for use by apps in Android Q and later. (This slot
+//    was used for errno in P and earlier.)
+
+#if defined(__arm__) || defined(__aarch64__)
+
+// The ARM ELF TLS ABI specifies[1] that the thread pointer points at a 2-word
+// TCB followed by the executable's TLS segment. Both the TCB and the
+// executable's segment are aligned according to the segment, so Bionic requires
+// a minimum segment alignment, which effectively reserves an 8-word TCB. The
+// ARM spec allocates the first TCB word to the DTV.
+//
+// [1] "Addenda to, and Errata in, the ABI for the ARM Architecture". Section 3.
+// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0045e/IHI0045E_ABI_addenda.pdf
+
+#define MIN_TLS_SLOT              -1 // update this value when reserving a slot
+#define TLS_SLOT_BIONIC_TLS       -1
+#define TLS_SLOT_DTV              0
+#define TLS_SLOT_THREAD_ID        1
+#define TLS_SLOT_APP              2 // was historically used for errno
+#define TLS_SLOT_OPENGL           3
+#define TLS_SLOT_OPENGL_API       4
+#define TLS_SLOT_STACK_GUARD      5
+#define TLS_SLOT_SANITIZER        6 // was historically used for dlerror
+#define TLS_SLOT_ART_THREAD_SELF  7
+
+// The maximum slot is fixed by the minimum TLS alignment in Bionic executables.
+#define MAX_TLS_SLOT              7
+
+#elif defined(__i386__) || defined(__x86_64__)
+
+// x86 uses variant 2 ELF TLS layout, which places the executable's TLS segment
+// immediately before the thread pointer. New slots are allocated at positive
+// offsets from the thread pointer.
+
+#define MIN_TLS_SLOT              0
+
+#define TLS_SLOT_SELF             0
+#define TLS_SLOT_THREAD_ID        1
+#define TLS_SLOT_APP              2 // was historically used for errno
+#define TLS_SLOT_OPENGL           3
+#define TLS_SLOT_OPENGL_API       4
+#define TLS_SLOT_STACK_GUARD      5
+#define TLS_SLOT_SANITIZER        6 // was historically used for dlerror
+#define TLS_SLOT_ART_THREAD_SELF  7
+#define TLS_SLOT_DTV              8
+#define TLS_SLOT_BIONIC_TLS       9
+#define MAX_TLS_SLOT              9 // update this value when reserving a slot
+
+#endif
+
+#define BIONIC_TLS_SLOTS (MAX_TLS_SLOT - MIN_TLS_SLOT + 1)
diff --git a/libc/private/bionic_constants.h b/libc/private/bionic_constants.h
index e64c826..09294b6 100644
--- a/libc/private/bionic_constants.h
+++ b/libc/private/bionic_constants.h
@@ -26,7 +26,6 @@
 // guard region must be large enough that we can allocate an SCS_SIZE-aligned SCS while ensuring
 // that there is at least one guard page after the SCS so that a stack overflow results in a SIGSEGV
 // instead of corrupting the allocation that comes after it.
-// TODO(b/118642754): Use a larger guard region.
-#define SCS_GUARD_REGION_SIZE (SCS_SIZE * 2)
+#define SCS_GUARD_REGION_SIZE (16 * 1024 * 1024)
 
 #endif // _BIONIC_CONSTANTS_H_
diff --git a/libc/private/bionic_elf_tls.h b/libc/private/bionic_elf_tls.h
new file mode 100644
index 0000000..fa1af76
--- /dev/null
+++ b/libc/private/bionic_elf_tls.h
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#pragma once
+
+#include <link.h>
+#include <pthread.h>
+#include <stdatomic.h>
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+__LIBC_HIDDEN__ extern _Atomic(size_t) __libc_tls_generation_copy;
+
+struct TlsSegment {
+  size_t size = 0;
+  size_t alignment = 1;
+  const void* init_ptr = "";    // Field is non-null even when init_size is 0.
+  size_t init_size = 0;
+};
+
+__LIBC_HIDDEN__ bool __bionic_get_tls_segment(const ElfW(Phdr)* phdr_table, size_t phdr_count,
+                                              ElfW(Addr) load_bias, TlsSegment* out);
+
+__LIBC_HIDDEN__ bool __bionic_check_tls_alignment(size_t* alignment);
+
+struct StaticTlsLayout {
+  constexpr StaticTlsLayout() {}
+
+private:
+  size_t offset_ = 0;
+  size_t alignment_ = 1;
+  bool overflowed_ = false;
+
+  // Offsets to various Bionic TLS structs from the beginning of static TLS.
+  size_t offset_bionic_tcb_ = SIZE_MAX;
+  size_t offset_bionic_tls_ = SIZE_MAX;
+
+public:
+  size_t offset_bionic_tcb() const { return offset_bionic_tcb_; }
+  size_t offset_bionic_tls() const { return offset_bionic_tls_; }
+  size_t offset_thread_pointer() const;
+
+  size_t size() const { return offset_; }
+  size_t alignment() const { return alignment_; }
+  bool overflowed() const { return overflowed_; }
+
+  size_t reserve_exe_segment_and_tcb(const TlsSegment* exe_segment, const char* progname);
+  void reserve_bionic_tls();
+  size_t reserve_solib_segment(const TlsSegment& segment) {
+    return reserve(segment.size, segment.alignment);
+  }
+  void finish_layout();
+
+private:
+  size_t reserve(size_t size, size_t alignment);
+
+  template <typename T> size_t reserve_type() {
+    return reserve(sizeof(T), alignof(T));
+  }
+
+  size_t round_up_with_overflow_check(size_t value, size_t alignment);
+};
+
+static constexpr size_t kTlsGenerationNone = 0;
+static constexpr size_t kTlsGenerationFirst = 1;
+
+// The first ELF TLS module has ID 1. Zero is reserved for the first word of
+// the DTV, a generation count. Unresolved weak symbols also use module ID 0.
+static constexpr size_t kTlsUninitializedModuleId = 0;
+
+static inline size_t __tls_module_id_to_idx(size_t id) { return id - 1; }
+static inline size_t __tls_module_idx_to_id(size_t idx) { return idx + 1; }
+
+// A descriptor for a single ELF TLS module.
+struct TlsModule {
+  TlsSegment segment;
+
+  // Offset into the static TLS block or SIZE_MAX for a dynamic module.
+  size_t static_offset = SIZE_MAX;
+
+  // The generation in which this module was loaded. Dynamic TLS lookups use
+  // this field to detect when a module has been unloaded.
+  size_t first_generation = kTlsGenerationNone;
+
+  // Used by the dynamic linker to track the associated soinfo* object.
+  void* soinfo_ptr = nullptr;
+};
+
+// Table of the ELF TLS modules. Either the dynamic linker or the static
+// initialization code prepares this table, and it's then used during thread
+// creation and for dynamic TLS lookups.
+struct TlsModules {
+  constexpr TlsModules() {}
+
+  // A pointer to the TLS generation counter in libc.so. The counter is
+  // incremented each time an solib is loaded or unloaded.
+  _Atomic(size_t) generation = kTlsGenerationFirst;
+  _Atomic(size_t) *generation_libc_so = nullptr;
+
+  // Access to the TlsModule[] table requires taking this lock.
+  pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER;
+
+  // Pointer to a block of TlsModule objects. The first module has ID 1 and
+  // is stored at index 0 in this table.
+  size_t module_count = 0;
+  TlsModule* module_table = nullptr;
+};
+
+void __init_static_tls(void* static_tls);
+
+// Dynamic Thread Vector. Each thread has a different DTV. For each module
+// (executable or solib), the DTV has a pointer to that module's TLS memory. The
+// DTV is initially empty and is allocated on-demand. It grows as more modules
+// are dlopen'ed. See https://www.akkadia.org/drepper/tls.pdf.
+//
+// The layout of the DTV is specified in various documents, but it is not part
+// of Bionic's public ABI. A compiler can't generate code to access it directly,
+// because it can't access libc's global generation counter.
+struct TlsDtv {
+  // Number of elements in this object's modules field.
+  size_t count;
+
+  // A pointer to an older TlsDtv object that should be freed when the thread
+  // exits. The objects aren't immediately freed because a DTV could be
+  // reallocated by a signal handler that interrupted __tls_get_addr's fast
+  // path.
+  TlsDtv* next;
+
+  // The DTV slot points at this field, which allows omitting an add instruction
+  // on the fast path for a TLS lookup. The arm64 tlsdesc_resolver.S depends on
+  // the layout of fields past this point.
+  size_t generation;
+  void* modules[];
+};
+
+struct TlsIndex {
+  size_t module_id;
+  size_t offset;
+};
+
+#if defined(__i386__)
+#define TLS_GET_ADDR_CCONV __attribute__((regparm(1)))
+#define TLS_GET_ADDR ___tls_get_addr
+#else
+#define TLS_GET_ADDR_CCONV
+#define TLS_GET_ADDR __tls_get_addr
+#endif
+
+extern "C" void* TLS_GET_ADDR(const TlsIndex* ti) TLS_GET_ADDR_CCONV;
+
+struct bionic_tcb;
+void __free_dynamic_tls(bionic_tcb* tcb);
diff --git a/libc/private/bionic_fdsan.h b/libc/private/bionic_fdsan.h
index de14cf8..f403d08 100644
--- a/libc/private/bionic_fdsan.h
+++ b/libc/private/bionic_fdsan.h
@@ -39,21 +39,23 @@
 #include <sys/user.h>
 
 struct FdEntry {
-  _Atomic(uint64_t) close_tag;
+  _Atomic(uint64_t) close_tag = 0;
 };
 
 struct FdTableOverflow {
-  size_t len;
+  size_t len = 0;
   FdEntry entries[0];
 };
 
 template <size_t inline_fds>
 struct FdTableImpl {
-  uint32_t version;  // currently 0, and hopefully it'll stay that way.
-  _Atomic(android_fdsan_error_level) error_level;
+  constexpr FdTableImpl() {}
+
+  uint32_t version = 0;  // currently 0, and hopefully it'll stay that way.
+  _Atomic(android_fdsan_error_level) error_level = ANDROID_FDSAN_ERROR_LEVEL_DISABLED;
 
   FdEntry entries[inline_fds];
-  _Atomic(FdTableOverflow*) overflow;
+  _Atomic(FdTableOverflow*) overflow = nullptr;
 
   FdEntry* at(size_t idx);
 };
diff --git a/libc/private/bionic_globals.h b/libc/private/bionic_globals.h
index ba510b1..d73079e 100644
--- a/libc/private/bionic_globals.h
+++ b/libc/private/bionic_globals.h
@@ -29,10 +29,13 @@
 #ifndef _PRIVATE_BIONIC_GLOBALS_H
 #define _PRIVATE_BIONIC_GLOBALS_H
 
+#include <stdatomic.h>
 #include <sys/cdefs.h>
 #include <link.h>
 #include <pthread.h>
 
+#include "private/bionic_allocator.h"
+#include "private/bionic_elf_tls.h"
 #include "private/bionic_fdsan.h"
 #include "private/bionic_malloc_dispatch.h"
 #include "private/bionic_vdso.h"
@@ -41,7 +44,21 @@
 struct libc_globals {
   vdso_entry vdso[VDSO_END];
   long setjmp_cookie;
-  MallocDispatch malloc_dispatch;
+
+  // In order to allow a complete switch between dispatch tables without
+  // the need for copying each function by function in the structure,
+  // use a single atomic pointer to switch.
+  // The current_dispatch_table pointer can only ever be set to a complete
+  // table. Any dispatch table that is pointed to by current_dispatch_table
+  // cannot be modified after that. If the pointer changes in the future,
+  // the old pointer must always stay valid.
+  // The malloc_dispatch_table is modified by malloc debug, malloc hooks,
+  // and heaprofd. Only one of these modes can be active at any given time.
+  _Atomic(const MallocDispatch*) current_dispatch_table;
+  // This pointer is only used by the allocation limit code when both a
+  // limit is enabled and some other hook is enabled at the same time.
+  _Atomic(const MallocDispatch*) default_dispatch_table;
+  MallocDispatch malloc_dispatch_table;
 };
 
 __LIBC_HIDDEN__ extern WriteProtected<libc_globals> __libc_globals;
@@ -50,21 +67,30 @@
 
 // Globals shared between the dynamic linker and libc.so.
 struct libc_shared_globals {
+  // Construct the shared globals using a constexpr constructor to ensure that
+  // the object doesn't need dynamic initialization. The object is accessed
+  // before the dynamic linker has relocated itself.
+  constexpr libc_shared_globals() {}
+
   FdTable fd_table;
 
   // When the linker is invoked on a binary (e.g. `linker64 /system/bin/date`),
   // record the number of arguments passed to the linker itself rather than to
   // the program it's loading. Typically 0, sometimes 1.
-  int initial_linker_arg_count;
+  int initial_linker_arg_count = 0;
 
-  ElfW(auxv_t)* auxv;
+  ElfW(auxv_t)* auxv = nullptr;
 
-  pthread_mutex_t abort_msg_lock;
-  abort_msg_t* abort_msg;
+  pthread_mutex_t abort_msg_lock = PTHREAD_MUTEX_INITIALIZER;
+  abort_msg_t* abort_msg = nullptr;
+
+  StaticTlsLayout static_tls_layout;
+  TlsModules tls_modules;
+  BionicAllocator tls_allocator;
 
   // Values passed from the linker to libc.so.
-  const char* init_progname;
-  char** init_environ;
+  const char* init_progname = nullptr;
+  char** init_environ = nullptr;
 };
 
 __LIBC_HIDDEN__ libc_shared_globals* __libc_shared_globals();
@@ -76,6 +102,7 @@
 
 #if defined(__i386__)
 __LIBC_HIDDEN__ extern void* __libc_sysinfo;
+__LIBC_HIDDEN__ void __libc_int0x80();
 __LIBC_HIDDEN__ void __libc_init_sysinfo();
 #endif
 
diff --git a/libc/private/bionic_lock.h b/libc/private/bionic_lock.h
index eebfeff..d70ba6c 100644
--- a/libc/private/bionic_lock.h
+++ b/libc/private/bionic_lock.h
@@ -70,15 +70,22 @@
   }
 
   void unlock() {
+    bool shared = process_shared; /* cache to local variable */
     if (atomic_exchange_explicit(&state, Unlocked, memory_order_release) == LockedWithWaiter) {
-      __futex_wake_ex(&state, process_shared, 1);
+      // The Lock object may have been deallocated between the atomic exchange and the futex wake
+      // call, so avoid accessing any fields of Lock here. In that case, the wake call may target
+      // unmapped memory or trigger a spurious futex wakeup. The same situation happens with
+      // pthread mutexes. References:
+      //  - https://lkml.org/lkml/2014/11/27/472
+      //  - http://austingroupbugs.net/view.php?id=811#c2267
+      __futex_wake_ex(&state, shared, 1);
     }
   }
 };
 
 class LockGuard {
  public:
-  LockGuard(Lock& lock) : lock_(lock) {
+  explicit LockGuard(Lock& lock) : lock_(lock) {
     lock_.lock();
   }
   ~LockGuard() {
diff --git a/libc/private/bionic_malloc.h b/libc/private/bionic_malloc.h
new file mode 100644
index 0000000..e8a6f6e
--- /dev/null
+++ b/libc/private/bionic_malloc.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2018 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.
+ */
+
+#pragma once
+
+#include <stdbool.h>
+
+// Opcodes for android_mallopt.
+
+enum {
+  // Marks the calling process as a profileable zygote child, possibly
+  // initializing profiling infrastructure.
+  M_INIT_ZYGOTE_CHILD_PROFILING = 1,
+#define M_INIT_ZYGOTE_CHILD_PROFILING M_INIT_ZYGOTE_CHILD_PROFILING
+  M_RESET_HOOKS = 2,
+#define M_RESET_HOOKS M_RESET_HOOKS
+  // Set an upper bound on the total size in bytes of all allocations made
+  // using the memory allocation APIs.
+  //   arg = size_t*
+  //   arg_size = sizeof(size_t)
+  M_SET_ALLOCATION_LIMIT_BYTES = 3,
+#define M_SET_ALLOCATION_LIMIT_BYTES M_SET_ALLOCATION_LIMIT_BYTES
+  // Called after the zygote forks to indicate this is a child.
+  M_SET_ZYGOTE_CHILD = 4,
+#define M_SET_ZYGOTE_CHILD M_SET_ZYGOTE_CHILD
+};
+
+// Manipulates bionic-specific handling of memory allocation APIs such as
+// malloc. Only for use by the Android platform itself.
+//
+// On success, returns true. On failure, returns false and sets errno.
+extern "C" bool android_mallopt(int opcode, void* arg, size_t arg_size);
diff --git a/libc/private/bionic_malloc_dispatch.h b/libc/private/bionic_malloc_dispatch.h
index f15b72c..aea3a1c 100644
--- a/libc/private/bionic_malloc_dispatch.h
+++ b/libc/private/bionic_malloc_dispatch.h
@@ -31,7 +31,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <stdatomic.h>
+#include <stdio.h>
 #include <private/bionic_config.h>
 
 // Entry in malloc dispatch table.
@@ -39,6 +39,7 @@
 typedef void (*MallocFree)(void*);
 typedef struct mallinfo (*MallocMallinfo)();
 typedef void* (*MallocMalloc)(size_t);
+typedef int (*MallocMallocInfo)(int, FILE*);
 typedef size_t (*MallocMallocUsableSize)(const void*);
 typedef void* (*MallocMemalign)(size_t, size_t);
 typedef int (*MallocPosixMemalign)(void**, size_t, size_t);
@@ -55,25 +56,26 @@
 #endif
 
 struct MallocDispatch {
-  _Atomic MallocCalloc calloc;
-  _Atomic MallocFree free;
-  _Atomic MallocMallinfo mallinfo;
-  _Atomic MallocMalloc malloc;
-  _Atomic MallocMallocUsableSize malloc_usable_size;
-  _Atomic MallocMemalign memalign;
-  _Atomic MallocPosixMemalign posix_memalign;
+  MallocCalloc calloc;
+  MallocFree free;
+  MallocMallinfo mallinfo;
+  MallocMalloc malloc;
+  MallocMallocUsableSize malloc_usable_size;
+  MallocMemalign memalign;
+  MallocPosixMemalign posix_memalign;
 #if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
-  _Atomic MallocPvalloc pvalloc;
+  MallocPvalloc pvalloc;
 #endif
-  _Atomic MallocRealloc realloc;
+  MallocRealloc realloc;
 #if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
-  _Atomic MallocValloc valloc;
+  MallocValloc valloc;
 #endif
-  _Atomic MallocIterate iterate;
-  _Atomic MallocMallocDisable malloc_disable;
-  _Atomic MallocMallocEnable malloc_enable;
-  _Atomic MallocMallopt mallopt;
-  _Atomic MallocAlignedAlloc aligned_alloc;
+  MallocIterate iterate;
+  MallocMallocDisable malloc_disable;
+  MallocMallocEnable malloc_enable;
+  MallocMallopt mallopt;
+  MallocAlignedAlloc aligned_alloc;
+  MallocMallocInfo malloc_info;
 } __attribute__((aligned(32)));
 
 #endif
diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h
index 4749cee..90914c3 100644
--- a/libc/private/bionic_tls.h
+++ b/libc/private/bionic_tls.h
@@ -26,8 +26,7 @@
  * SUCH DAMAGE.
  */
 
-#ifndef __BIONIC_PRIVATE_BIONIC_TLS_H_
-#define __BIONIC_PRIVATE_BIONIC_TLS_H_
+#pragma once
 
 #include <locale.h>
 #include <mntent.h>
@@ -35,73 +34,48 @@
 #include <sys/cdefs.h>
 #include <sys/param.h>
 
+#include "bionic_asm_tls.h"
 #include "bionic_macros.h"
 #include "__get_tls.h"
 #include "grp_pwd.h"
 
-__BEGIN_DECLS
-
 /** WARNING WARNING WARNING
  **
- ** This header file is *NOT* part of the public Bionic ABI/API
- ** and should not be used/included by user-serviceable parts of
- ** the system (e.g. applications).
- **
- ** It is only provided here for the benefit of the system dynamic
- ** linker and the OpenGL sub-system (which needs to access the
- ** pre-allocated slot directly for performance reason).
+ ** This header file is *NOT* part of the public Bionic ABI/API and should not
+ ** be used/included by user-serviceable parts of the system (e.g.
+ ** applications).
  **/
 
-// Well-known TLS slots. What data goes in which slot is arbitrary unless otherwise noted.
-enum {
-  TLS_SLOT_SELF = 0, // The kernel requires this specific slot for x86.
-  TLS_SLOT_THREAD_ID,
+class pthread_internal_t;
 
-  // TLS slot 2 was used for errno but is now free.
+// This struct is small, so the linker can allocate a temporary copy on its
+// stack. It can't be combined with pthread_internal_t because:
+//  - native bridge requires pthread_internal_t to have the same layout across
+//    architectures, and
+//  - On x86, this struct would have to be placed at the front of
+//    pthread_internal_t, moving fields like `tid`.
+//  - We'd like to avoid having a temporary pthread_internal_t object that
+//    needs to be transferred once the final size of static TLS is known.
+struct bionic_tcb {
+  void* raw_slots_storage[BIONIC_TLS_SLOTS];
 
-  // These two aren't used by bionic itself, but allow the graphics code to
-  // access TLS directly rather than using the pthread API.
-  TLS_SLOT_OPENGL_API = 3,
-  TLS_SLOT_OPENGL = 4,
+  // Return a reference to a slot given its TP-relative TLS_SLOT_xxx index.
+  // The thread pointer (i.e. __get_tls()) points at &tls_slot(0).
+  void*& tls_slot(size_t tpindex) {
+    return raw_slots_storage[tpindex - MIN_TLS_SLOT];
+  }
 
-  TLS_SLOT_STACK_GUARD = 5, // GCC requires this specific slot for x86.
+  // Initialize the main thread's final object using its bootstrap object.
+  void copy_from_bootstrap(const bionic_tcb* boot) {
+    // Copy everything. Problematic slots will be reinitialized.
+    *this = *boot;
+  }
 
-  // Lets sanitizers avoid using pthread_getspecific for finding the current
-  // thread state. (Slot 6 was historically used for dlerror instead.)
-  TLS_SLOT_SANITIZER = 6,
-
-  // Fast storage for Thread::Current() in ART.
-  TLS_SLOT_ART_THREAD_SELF = 7,
-
-  // Lets TSAN avoid using pthread_getspecific for finding the current thread
-  // state.
-  TLS_SLOT_TSAN = 8,
-
-  BIONIC_TLS_SLOTS // Must come last!
+  pthread_internal_t* thread() {
+    return static_cast<pthread_internal_t*>(tls_slot(TLS_SLOT_THREAD_ID));
+  }
 };
 
-// ~3 pages.
-struct bionic_tls {
-  locale_t locale;
-
-  char basename_buf[MAXPATHLEN];
-  char dirname_buf[MAXPATHLEN];
-
-  mntent mntent_buf;
-  char mntent_strings[BUFSIZ];
-
-  char ptsname_buf[32];
-  char ttyname_buf[64];
-
-  char strerror_buf[NL_TEXTMAX];
-  char strsignal_buf[NL_TEXTMAX];
-
-  group_state_t group;
-  passwd_state_t passwd;
-};
-
-#define BIONIC_TLS_SIZE (__BIONIC_ALIGN(sizeof(bionic_tls), PAGE_SIZE))
-
 /*
  * Bionic uses some pthread keys internally. All pthread keys used internally
  * should be created in constructors, except for keys that may be used in or
@@ -126,12 +100,42 @@
  */
 #define BIONIC_PTHREAD_KEY_COUNT (BIONIC_PTHREAD_KEY_RESERVED_COUNT + PTHREAD_KEYS_MAX)
 
-__END_DECLS
+class pthread_key_data_t {
+ public:
+  uintptr_t seq; // Use uintptr_t just for alignment, as we use pointer below.
+  void* data;
+};
 
-#if defined(__cplusplus)
+// ~3 pages. This struct is allocated as static TLS memory (i.e. at a fixed
+// offset from the thread pointer).
+struct bionic_tls {
+  pthread_key_data_t key_data[BIONIC_PTHREAD_KEY_COUNT];
+
+  locale_t locale;
+
+  char basename_buf[MAXPATHLEN];
+  char dirname_buf[MAXPATHLEN];
+
+  mntent mntent_buf;
+  char mntent_strings[BUFSIZ];
+
+  char ptsname_buf[32];
+  char ttyname_buf[64];
+
+  char strerror_buf[NL_TEXTMAX];
+  char strsignal_buf[NL_TEXTMAX];
+
+  group_state_t group;
+  passwd_state_t passwd;
+
+  // Initialize the main thread's final object using its bootstrap object.
+  void copy_from_bootstrap(const bionic_tls* boot __attribute__((unused))) {
+    // Nothing in bionic_tls needs to be preserved in the transition to the
+    // final TLS objects, so don't copy anything.
+  }
+};
+
 class KernelArgumentBlock;
-extern void __libc_init_main_thread_early(KernelArgumentBlock& args);
-extern void __libc_init_main_thread_late();
-#endif
-
-#endif /* __BIONIC_PRIVATE_BIONIC_TLS_H_ */
+extern "C" void __libc_init_main_thread_early(const KernelArgumentBlock& args, bionic_tcb* temp_tcb);
+extern "C" void __libc_init_main_thread_late();
+extern "C" void __libc_init_main_thread_final();
diff --git a/libc/private/linker_native_bridge.h b/libc/private/linker_native_bridge.h
new file mode 100644
index 0000000..bfd0153
--- /dev/null
+++ b/libc/private/linker_native_bridge.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#pragma once
+
+extern "C" void __linker_reserve_bionic_tls_in_static_tls();
diff --git a/libc/private/sigrtmin.h b/libc/private/sigrtmin.h
index 67bd864..d78d980 100644
--- a/libc/private/sigrtmin.h
+++ b/libc/private/sigrtmin.h
@@ -40,11 +40,12 @@
 //   34 (__SIGRTMIN + 2)        libcore
 //   35 (__SIGRTMIN + 3)        debuggerd -b
 //   36 (__SIGRTMIN + 4)        heapprofd
+//   37 (__SIGRTMIN + 5)        coverage (libprofile-extras)
 //
 // If you change this, also change __ndk_legacy___libc_current_sigrtmin
 // in <android/legacy_signal_inlines.h> to match.
 
-#define __SIGRT_RESERVED 5
+#define __SIGRT_RESERVED 6
 static inline __always_inline sigset64_t filter_reserved_signals(sigset64_t sigset, int how) {
   int (*block)(sigset64_t*, int);
   int (*unblock)(sigset64_t*, int);
@@ -70,5 +71,6 @@
   unblock(&sigset, __SIGRTMIN + 2);
   unblock(&sigset, __SIGRTMIN + 3);
   unblock(&sigset, __SIGRTMIN + 4);
+  unblock(&sigset, __SIGRTMIN + 5);
   return sigset;
 }
diff --git a/libc/seccomp/include/seccomp_policy.h b/libc/seccomp/include/seccomp_policy.h
index 49280f4..fd0fb60 100644
--- a/libc/seccomp/include/seccomp_policy.h
+++ b/libc/seccomp/include/seccomp_policy.h
@@ -17,8 +17,14 @@
 #pragma once
 
 #include <stddef.h>
+#include <stdint.h>
 #include <linux/filter.h>
 
 bool set_app_seccomp_filter();
+bool set_app_zygote_seccomp_filter();
 bool set_system_seccomp_filter();
 bool set_global_seccomp_filter();
+
+// Installs a filter that limits setresuid/setresgid to a range of
+// [uid_gid_min..uid_gid_max] (for the real-, effective- and super-ids).
+bool install_setuidgid_seccomp_filter(uint32_t uid_gid_min, uint32_t uid_gid_max);
diff --git a/libc/seccomp/seccomp_bpfs.h b/libc/seccomp/seccomp_bpfs.h
index 797dfc5..d9e8047 100644
--- a/libc/seccomp/seccomp_bpfs.h
+++ b/libc/seccomp/seccomp_bpfs.h
@@ -21,6 +21,8 @@
 
 extern const struct sock_filter arm_app_filter[];
 extern const size_t arm_app_filter_size;
+extern const struct sock_filter arm_app_zygote_filter[];
+extern const size_t arm_app_zygote_filter_size;
 extern const struct sock_filter arm_system_filter[];
 extern const size_t arm_system_filter_size;
 extern const struct sock_filter arm_global_filter[];
@@ -28,6 +30,8 @@
 
 extern const struct sock_filter arm64_app_filter[];
 extern const size_t arm64_app_filter_size;
+extern const struct sock_filter arm64_app_zygote_filter[];
+extern const size_t arm64_app_zygote_filter_size;
 extern const struct sock_filter arm64_system_filter[];
 extern const size_t arm64_system_filter_size;
 extern const struct sock_filter arm64_global_filter[];
@@ -35,6 +39,8 @@
 
 extern const struct sock_filter x86_app_filter[];
 extern const size_t x86_app_filter_size;
+extern const struct sock_filter x86_app_zygote_filter[];
+extern const size_t x86_app_zygote_filter_size;
 extern const struct sock_filter x86_system_filter[];
 extern const size_t x86_system_filter_size;
 extern const struct sock_filter x86_global_filter[];
@@ -42,6 +48,8 @@
 
 extern const struct sock_filter x86_64_app_filter[];
 extern const size_t x86_64_app_filter_size;
+extern const struct sock_filter x86_64_app_zygote_filter[];
+extern const size_t x86_64_app_zygote_filter_size;
 extern const struct sock_filter x86_64_system_filter[];
 extern const size_t x86_64_system_filter_size;
 extern const struct sock_filter x86_64_global_filter[];
@@ -49,6 +57,8 @@
 
 extern const struct sock_filter mips_app_filter[];
 extern const size_t mips_app_filter_size;
+extern const struct sock_filter mips_app_zygote_filter[];
+extern const size_t mips_app_zygote_filter_size;
 extern const struct sock_filter mips_system_filter[];
 extern const size_t mips_system_filter_size;
 extern const struct sock_filter mips_global_filter[];
@@ -56,6 +66,8 @@
 
 extern const struct sock_filter mips64_app_filter[];
 extern const size_t mips64_app_filter_size;
+extern const struct sock_filter mips64_app_zygote_filter[];
+extern const size_t mips64_app_zygote_filter_size;
 extern const struct sock_filter mips64_system_filter[];
 extern const size_t mips64_system_filter_size;
 extern const struct sock_filter mips64_global_filter[];
diff --git a/libc/seccomp/seccomp_policy.cpp b/libc/seccomp/seccomp_policy.cpp
index 3d617be..222a2c8 100644
--- a/libc/seccomp/seccomp_policy.cpp
+++ b/libc/seccomp/seccomp_policy.cpp
@@ -20,78 +20,111 @@
 #include <linux/audit.h>
 #include <linux/seccomp.h>
 #include <sys/prctl.h>
+#include <sys/syscall.h>
 
 #include <vector>
 
 #include <android-base/logging.h>
 
+#include "func_to_syscall_nrs.h"
 #include "seccomp_bpfs.h"
 
-
 #if defined __arm__ || defined __aarch64__
 
 #define DUAL_ARCH
 #define PRIMARY_ARCH AUDIT_ARCH_AARCH64
 static const struct sock_filter* primary_app_filter = arm64_app_filter;
 static const size_t primary_app_filter_size = arm64_app_filter_size;
+static const struct sock_filter* primary_app_zygote_filter = arm64_app_zygote_filter;
+static const size_t primary_app_zygote_filter_size = arm64_app_zygote_filter_size;
 static const struct sock_filter* primary_system_filter = arm64_system_filter;
 static const size_t primary_system_filter_size = arm64_system_filter_size;
 static const struct sock_filter* primary_global_filter = arm64_global_filter;
 static const size_t primary_global_filter_size = arm64_global_filter_size;
+
+static const long primary_setresgid = __arm64_setresgid;
+static const long primary_setresuid = __arm64_setresuid;
 #define SECONDARY_ARCH AUDIT_ARCH_ARM
 static const struct sock_filter* secondary_app_filter = arm_app_filter;
 static const size_t secondary_app_filter_size = arm_app_filter_size;
+static const struct sock_filter* secondary_app_zygote_filter = arm_app_zygote_filter;
+static const size_t secondary_app_zygote_filter_size = arm_app_zygote_filter_size;
 static const struct sock_filter* secondary_system_filter = arm_system_filter;
 static const size_t secondary_system_filter_size = arm_system_filter_size;
 static const struct sock_filter* secondary_global_filter = arm_global_filter;
 static const size_t secondary_global_filter_size = arm_global_filter_size;
 
+static const long secondary_setresgid = __arm_setresgid;
+static const long secondary_setresuid = __arm_setresuid;
 #elif defined __i386__ || defined __x86_64__
 
 #define DUAL_ARCH
 #define PRIMARY_ARCH AUDIT_ARCH_X86_64
 static const struct sock_filter* primary_app_filter = x86_64_app_filter;
 static const size_t primary_app_filter_size = x86_64_app_filter_size;
+static const struct sock_filter* primary_app_zygote_filter = x86_64_app_zygote_filter;
+static const size_t primary_app_zygote_filter_size = x86_64_app_zygote_filter_size;
 static const struct sock_filter* primary_system_filter = x86_64_system_filter;
 static const size_t primary_system_filter_size = x86_64_system_filter_size;
 static const struct sock_filter* primary_global_filter = x86_64_global_filter;
 static const size_t primary_global_filter_size = x86_64_global_filter_size;
+
+static const long primary_setresgid = __x86_64_setresgid;
+static const long primary_setresuid = __x86_64_setresuid;
 #define SECONDARY_ARCH AUDIT_ARCH_I386
 static const struct sock_filter* secondary_app_filter = x86_app_filter;
 static const size_t secondary_app_filter_size = x86_app_filter_size;
+static const struct sock_filter* secondary_app_zygote_filter = x86_app_zygote_filter;
+static const size_t secondary_app_zygote_filter_size = x86_app_zygote_filter_size;
 static const struct sock_filter* secondary_system_filter = x86_system_filter;
 static const size_t secondary_system_filter_size = x86_system_filter_size;
 static const struct sock_filter* secondary_global_filter = x86_global_filter;
 static const size_t secondary_global_filter_size = x86_global_filter_size;
 
+static const long secondary_setresgid = __x86_setresgid;
+static const long secondary_setresuid = __x86_setresuid;
 #elif defined __mips__ || defined __mips64__
 
 #define DUAL_ARCH
 #define PRIMARY_ARCH AUDIT_ARCH_MIPSEL64
 static const struct sock_filter* primary_app_filter = mips64_app_filter;
 static const size_t primary_app_filter_size = mips64_app_filter_size;
+static const struct sock_filter* primary_app_zygote_filter = mips64_app_zygote_filter;
+static const size_t primary_app_zygote_filter_size = mips64_app_zygote_filter_size;
 static const struct sock_filter* primary_system_filter = mips64_system_filter;
 static const size_t primary_system_filter_size = mips64_system_filter_size;
 static const struct sock_filter* primary_global_filter = mips64_global_filter;
 static const size_t primary_global_filter_size = mips64_global_filter_size;
+
+static const long primary_setresgid = __mips64_setresgid;
+static const long primary_setresuid = __mips64_setresuid;
 #define SECONDARY_ARCH AUDIT_ARCH_MIPSEL
 static const struct sock_filter* secondary_app_filter = mips_app_filter;
 static const size_t secondary_app_filter_size = mips_app_filter_size;
+static const struct sock_filter* secondary_app_zygote_filter = mips_app_zygote_filter;
+static const size_t secondary_app_zygote_filter_size = mips_app_zygote_filter_size;
 static const struct sock_filter* secondary_system_filter = mips_system_filter;
 static const size_t secondary_system_filter_size = mips_system_filter_size;
 static const struct sock_filter* secondary_global_filter = mips_global_filter;
 static const size_t secondary_global_filter_size = mips_global_filter_size;
 
+static const long secondary_setresgid = __mips_setresgid;
+static const long secondary_setresuid = __mips_setresuid;
 #else
 #error No architecture was defined!
 #endif
 
 
 #define syscall_nr (offsetof(struct seccomp_data, nr))
+#define syscall_arg(_n) (offsetof(struct seccomp_data, args[_n]))
 #define arch_nr (offsetof(struct seccomp_data, arch))
 
 typedef std::vector<sock_filter> filter;
 
+inline void Allow(filter& f) {
+    f.push_back(BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW));
+}
+
 inline void Disallow(filter& f) {
     f.push_back(BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_TRAP));
 }
@@ -128,6 +161,49 @@
 }
 #endif
 
+static void ValidateSyscallArgInRange(filter& f, __u32 arg_num, __u32 range_min, __u32 range_max) {
+    const __u32 syscall_arg = syscall_arg(arg_num);
+
+    if (range_max == UINT32_MAX) {
+        LOG(FATAL) << "range_max exceeds maximum argument range.";
+        return;
+    }
+
+    f.push_back(BPF_STMT(BPF_LD|BPF_W|BPF_ABS, syscall_arg));
+    f.push_back(BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, range_min, 0, 1));
+    f.push_back(BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, range_max + 1, 0, 1));
+    Disallow(f);
+}
+
+// This filter is meant to be installed in addition to a regular whitelist filter.
+// Therefore, it's default action has to be Allow, except when the evaluated
+// system call matches setresuid/setresgid and the arguments don't fall within the
+// passed in range.
+//
+// The regular whitelist only allows setresuid/setresgid for UID/GID changes, so
+// that's the only system call we need to check here. A CTS test ensures the other
+// calls will remain blocked.
+static void ValidateSetUidGid(filter& f, uint32_t uid_gid_min, uint32_t uid_gid_max, bool primary) {
+    // Check setresuid(ruid, euid, sguid) fall within range
+    ExamineSyscall(f);
+    __u32 setresuid_nr = primary ? primary_setresuid : secondary_setresuid;
+    f.push_back(BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, setresuid_nr, 0, 12));
+    for (int arg = 0; arg < 3; arg++) {
+        ValidateSyscallArgInRange(f, arg, uid_gid_min, uid_gid_max);
+    }
+
+    // Check setresgid(rgid, egid, sgid) fall within range
+    ExamineSyscall(f);
+    __u32 setresgid_nr = primary ? primary_setresgid : secondary_setresgid;
+    f.push_back(BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, setresgid_nr, 0, 12));
+    for (int arg = 0; arg < 3; arg++) {
+        ValidateSyscallArgInRange(f, arg, uid_gid_min, uid_gid_max);
+    }
+
+    // Default is to allow; other filters may still reject this call.
+    Allow(f);
+}
+
 static bool install_filter(filter const& f) {
     struct sock_fprog prog = {
         static_cast<unsigned short>(f.size()),
@@ -141,8 +217,33 @@
     return true;
 }
 
+bool _install_setuidgid_filter(uint32_t uid_gid_min, uint32_t uid_gid_max) {
+    filter f;
+#ifdef DUAL_ARCH
+    // Note that for mixed 64/32 bit architectures, ValidateArchitecture inserts a
+    // jump that must be changed to point to the start of the 32-bit policy
+    // 32 bit syscalls will not hit the policy between here and the call to SetJump
+    auto offset_to_secondary_filter = ValidateArchitectureAndJumpIfNeeded(f);
+#else
+    ValidateArchitecture(f);
+#endif
+
+    ValidateSetUidGid(f, uid_gid_min, uid_gid_max, true /* primary */);
+
+#ifdef DUAL_ARCH
+    if (!SetValidateArchitectureJumpTarget(offset_to_secondary_filter, f)) {
+        return false;
+    }
+
+    ValidateSetUidGid(f, uid_gid_min, uid_gid_max, false /* primary */);
+#endif
+
+    return install_filter(f);
+}
+
 enum FilterType {
   APP,
+  APP_ZYGOTE,
   SYSTEM,
   GLOBAL
 };
@@ -159,6 +260,12 @@
         s = secondary_app_filter;
         s_size = secondary_app_filter_size;
         break;
+      case APP_ZYGOTE:
+        p = primary_app_zygote_filter;
+        p_size = primary_app_zygote_filter_size;
+        s = secondary_app_zygote_filter;
+        s_size = secondary_app_zygote_filter_size;
+        break;
       case SYSTEM:
         p = primary_system_filter;
         p_size = primary_system_filter_size;
@@ -210,6 +317,10 @@
     return _set_seccomp_filter(FilterType::APP);
 }
 
+bool set_app_zygote_seccomp_filter() {
+    return _set_seccomp_filter(FilterType::APP_ZYGOTE);
+}
+
 bool set_system_seccomp_filter() {
     return _set_seccomp_filter(FilterType::SYSTEM);
 }
@@ -217,3 +328,7 @@
 bool set_global_seccomp_filter() {
     return _set_seccomp_filter(FilterType::GLOBAL);
 }
+
+bool install_setuidgid_seccomp_filter(uint32_t uid_gid_min, uint32_t uid_gid_max) {
+    return _install_setuidgid_filter(uid_gid_min, uid_gid_max);
+}
diff --git a/libc/stdio/fmemopen.cpp b/libc/stdio/fmemopen.cpp
index 9d8c41f..6e333ba 100644
--- a/libc/stdio/fmemopen.cpp
+++ b/libc/stdio/fmemopen.cpp
@@ -149,7 +149,9 @@
   } else if (mode[0] == 'w') {
     ck->size = 0;
     ck->offset = 0;
-    ck->buf[0] = '\0';
+    if (capacity > 0) {
+      ck->buf[0] = '\0';
+    }
   }
 
   return fp;
diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp
index d7b69dc..4cec757 100644
--- a/libc/stdio/stdio.cpp
+++ b/libc/stdio/stdio.cpp
@@ -52,6 +52,7 @@
 
 #include "local.h"
 #include "glue.h"
+#include "private/__bionic_get_shell_path.h"
 #include "private/bionic_fortify.h"
 #include "private/ErrnoRestorer.h"
 #include "private/thread_private.h"
@@ -290,7 +291,7 @@
     if (fcntl(fd, F_SETFL, fd_flags | O_APPEND) == -1) return nullptr;
   }
 
-  // Make sure O_CLOEXEC is set on the underlying fd if our mode has 'x'.
+  // Make sure O_CLOEXEC is set on the underlying fd if our mode has 'e'.
   if ((mode_flags & O_CLOEXEC) && !((tmp = fcntl(fd, F_GETFD)) & FD_CLOEXEC)) {
     fcntl(fd, F_SETFD, tmp | FD_CLOEXEC);
   }
@@ -1169,11 +1170,6 @@
   return (__sfvwrite(fp, &uio) == 0) ? count : ((n - uio.uio_resid) / size);
 }
 
-static int __close_if_popened(FILE* fp) {
-  if (_EXT(fp)->_popen_pid > 0) close(fileno(fp));
-  return 0;
-}
-
 static FILE* __popen_fail(int fds[2]) {
   ErrnoRestorer errno_restorer;
   close(fds[0]);
@@ -1219,14 +1215,11 @@
 
   if (pid == 0) {
     close(fds[parent]);
-    // POSIX says "The popen() function shall ensure that any streams from previous popen() calls
-    // that remain open in the parent process are closed in the new child process."
-    _fwalk(__close_if_popened);
     // dup2 so that the child fd isn't closed on exec.
     if (dup2(fds[child], desired_child_fd) == -1) _exit(127);
     close(fds[child]);
     if (bidirectional) dup2(STDOUT_FILENO, STDIN_FILENO);
-    execl(_PATH_BSHELL, "sh", "-c", cmd, nullptr);
+    execl(__bionic_get_shell_path(), "sh", "-c", cmd, nullptr);
     _exit(127);
   }
 
diff --git a/libc/symbol_ordering b/libc/symbol_ordering
new file mode 100644
index 0000000..c04692b
--- /dev/null
+++ b/libc/symbol_ordering
@@ -0,0 +1,210 @@
+# This file is generated by sorting symbols in the .bss section in libc.so by
+# their sizes and taking out symbols that are unique to a target.  By sorting
+# symbols by size, we usually have less dirty pages at runtime, because small
+# symbols are grouped together.
+
+ctl_initialized
+gGlobalsMutating
+global_hashtable_initialized
+gmtcheck.gmt_is_set
+had_conf_error
+je_background_thread_enabled_state
+je_log_init_done
+je_opt_abort
+je_opt_abort_conf
+je_opt_background_thread
+je_opt_junk_alloc
+je_opt_junk_free
+je_opt_stats_print
+je_opt_utrace
+je_opt_xmalloc
+je_opt_zero
+je_tsd_booted
+malloc_disabled_tcache
+malloc_slow_flags
+mmap_flags
+os_overcommits
+restartloop
+_ZL24gHeapprofdInitInProgress
+_ZL27gHeapprofdInitHookInstalled
+_ZL23gZygoteChildProfileable
+_ZZ17__find_icu_symbolPKcE9found_icu
+ru_a
+ru_b
+ru_counter
+ru_g
+ru_msb
+ru_seed
+ru_seed2
+ru_x
+_ZZ12bindresvportE4port
+a0
+__atexit
+atexit_mutex
+b0
+ctl_arenas
+ctl_stats
+__cxa_finalize.call_depth
+daylight
+dirty_decay_ms_default.0
+environ
+error_message_count
+error_one_per_line
+error_print_progname
+__free_hook
+g_atexit_lock
+gGlobalsMutateLock
+global_hashtable
+gmtptr
+handlers
+je_background_thread_info
+je_hooks_arena_new_hook
+je_init_system_thp_mode
+je_malloc_conf
+je_malloc_disable.once_control
+je_malloc_message
+je_narenas_auto
+je_ncpus
+je_nhbins
+je_opt_dirty_decay_ms
+je_opt_metadata_thp
+je_opt_muzzy_decay_ms
+je_opt_narenas
+je_opt_thp
+je_tcache_bin_info
+je_tcache_maxclass
+je_tcaches
+je_tsd_tsd
+lastenv
+lcl_is_set
+lclptr
+locallock
+malloc_disabled_lock
+__malloc_hook
+malloc_initializer
+mbrlen.mbs
+mbtowc.mbs
+__memalign_hook
+muzzy_decay_ms_default.0
+narenas_total
+ncleanups
+optarg
+optreset
+os_page
+p5s
+__progname
+random_mutex
+__realloc_hook
+_res_cache_list_lock
+_res_cache_once
+_res_key
+__res_randomid.__libc_mutex_random
+rs
+_rs_forkdetect._rs_pid
+_rs_forked
+rsx
+ru_pid
+ru_prf
+ru_reseed
+__stack_chk_guard
+stack_nelms
+strtok.last
+suboptarg
+__system_property_area__
+tcaches_avail
+tcaches_past
+timezone
+tmpnam.tmpcount
+ut
+wctomb.mbs
+_ZL11g_arc4_lock
+_ZL13g_locale_once
+_ZL13g_thread_list
+_ZL14syslog_log_tag
+_ZL16gHeapprofdHandle
+_ZL17g_libicuuc_handle
+_ZL18netdClientInitOnce
+_ZL30g_propservice_protocol_version
+_ZN9prop_area13pa_data_size_E
+_ZN9prop_area8pa_size_E
+_ZZ10mbsnrtowcsE15__private_state
+_ZZ10wcsnrtombsE15__private_state
+_ZZ13error_at_lineE9last_file
+_ZZ13error_at_lineE9last_line
+_ZZ14__icu_charTypejE10u_charType
+_ZZ23__bionic_get_shell_pathE7sh_path
+_ZZ23__icu_hasBinaryPropertyj9UPropertyPFiiEE19u_hasBinaryProperty
+_ZZ25__icu_getIntPropertyValuej9UPropertyE21u_getIntPropertyValue
+_ZZ7mbrtowcE15__private_state
+_ZZ7wcrtombE15__private_state
+_ZZ8c16rtombE15__private_state
+_ZZ8c32rtombE15__private_state
+_ZZ8iswcntrlE10u_charType
+_ZZ8iswdigitE9u_isdigit
+_ZZ8iswpunctE9u_ispunct
+_ZZ8mbrtoc16E15__private_state
+_ZZ8mbrtoc32E15__private_state
+_ZZ8towlowerE9u_tolower
+_ZZ8towupperE9u_toupper
+ether_aton.addr
+seed48.sseed
+__dtoa_locks
+_ZGVZ14__icu_charTypejE10u_charType
+_ZGVZ14tzset_unlockedE20persist_sys_timezone
+_ZGVZ17__find_icu_symbolPKcE9found_icu
+_ZGVZ23__bionic_get_shell_pathE7sh_path
+_ZGVZ23__icu_hasBinaryPropertyj9UPropertyPFiiEE19u_hasBinaryProperty
+_ZGVZ25__icu_getIntPropertyValuej9UPropertyE21u_getIntPropertyValue
+_ZGVZ8iswcntrlE10u_charType
+_ZGVZ8iswdigitE9u_isdigit
+_ZGVZ8iswpunctE9u_ispunct
+_ZGVZ8towlowerE9u_tolower
+_ZGVZ8towupperE9u_toupper
+_ZL10gAllocated
+_ZL11gAllocLimit
+_ZL13g_atfork_list
+_ZL6g_lock
+_ZL6g_tags
+je_opt_stats_print_opts
+nuls
+precsize_ntoa.retbuf
+__p_secstodate.output
+ether_ntoa.buf
+inet_ntoa.b
+__p_class.classbuf
+__p_type.typebuf
+__sym_ntop.unname
+__sym_ntos.unname
+_ZL10gFunctions
+_ZL12vendor_group
+_ZL13vendor_passwd
+freelist
+__p_option.nbuf
+__p_time.nbuf
+_ZL18g_thread_list_lock
+tm
+_ZL8g_locale
+ctl_mtx
+init_lock
+je_arenas_lock
+je_background_thread_lock
+tcaches_mtx
+je_tsd_init_head
+buf_asctime
+__loc_ntoa.tmpbuf
+utmp
+_ZZ14tzset_unlockedE20persist_sys_timezone
+arena_binind_div_info
+__hexdig_D2A
+lcl_TZname
+inet_nsap_ntoa_tmpbuf
+_ZL7key_map
+_ZL17system_properties
+private_mem
+_res_cache_list
+__libc_globals
+tmpnam.buf
+je_extents_rtree
+_nres
+je_arenas
+je_extent_mutex_pool
diff --git a/libc/system_properties/Android.bp b/libc/system_properties/Android.bp
index f94cda9..911afb1 100644
--- a/libc/system_properties/Android.bp
+++ b/libc/system_properties/Android.bp
@@ -12,8 +12,8 @@
     whole_static_libs: [
         "libpropertyinfoparser",
     ],
-    static_libs: [
-        "libasync_safe",
+    header_libs: [
+        "libasync_safe_headers",
     ],
 
     include_dirs: [
diff --git a/libc/tools/Android.bp b/libc/tools/Android.bp
new file mode 100644
index 0000000..13179a0
--- /dev/null
+++ b/libc/tools/Android.bp
@@ -0,0 +1,4 @@
+filegroup {
+    name: "bionic-gensyscalls",
+    srcs: ["gensyscalls.py"]
+}
diff --git a/libc/tools/generate-NOTICE.py b/libc/tools/generate-NOTICE.py
index 17429e1..7218445 100755
--- a/libc/tools/generate-NOTICE.py
+++ b/libc/tools/generate-NOTICE.py
@@ -1,7 +1,5 @@
 #!/usr/bin/env python
 # Run with directory arguments from any directory, with no special setup required.
-# Or:
-# for i in libc libdl libm linker libstdc++ ; do ./libc/tools/generate-NOTICE.py $i > $i/NOTICE ; done
 
 import ftplib
 import hashlib
diff --git a/libc/tools/genfunctosyscallnrs.py b/libc/tools/genfunctosyscallnrs.py
new file mode 100755
index 0000000..6a456f2
--- /dev/null
+++ b/libc/tools/genfunctosyscallnrs.py
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+
+import argparse
+import collections
+import logging
+import os
+import re
+import subprocess
+import textwrap
+
+from gensyscalls import SysCallsTxtParser
+from genseccomp import parse_syscall_NRs
+
+def load_syscall_names_from_file(file_path, architecture):
+  parser = SysCallsTxtParser()
+  parser.parse_open_file(open(file_path))
+  arch_map = {}
+  for syscall in parser.syscalls:
+    if syscall.get(architecture):
+      arch_map[syscall["func"]] = syscall["name"];
+
+  return arch_map
+
+def gen_syscall_nrs(out_file, base_syscall_file, syscall_NRs):
+  for arch in ('arm', 'arm64', 'mips', 'mips64', 'x86', 'x86_64'):
+    base_names = load_syscall_names_from_file(base_syscall_file, arch)
+
+    for func,syscall in base_names.iteritems():
+      out_file.write("#define __" + arch + "_" + func + " " + str(syscall_NRs[arch][syscall]) + ";\n")
+
+def main():
+  parser = argparse.ArgumentParser(
+      description="Generates a mapping of bionic functions to system call numbers per architecture.")
+  parser.add_argument("--verbose", "-v", help="Enables verbose logging.")
+  parser.add_argument("--out-dir",
+                      help="The output directory for the output files")
+  parser.add_argument("base_file", metavar="base-file", type=str,
+                      help="The path of the base syscall list (SYSCALLS.TXT).")
+  parser.add_argument("files", metavar="FILE", type=str, nargs="+",
+                      help=("A syscall name-number mapping file for an architecture.\n"))
+  args = parser.parse_args()
+
+  if args.verbose:
+    logging.basicConfig(level=logging.DEBUG)
+  else:
+    logging.basicConfig(level=logging.INFO)
+
+  syscall_files = []
+  syscall_NRs = {}
+  for filename in args.files:
+    m = re.search(r"libseccomp_gen_syscall_nrs_([^/]+)", filename)
+    syscall_NRs[m.group(1)] = parse_syscall_NRs(filename)
+
+  output_path = os.path.join(args.out_dir, "func_to_syscall_nrs.h")
+  with open(output_path, "w") as output_file:
+    gen_syscall_nrs(out_file=output_file,
+             syscall_NRs=syscall_NRs, base_syscall_file=args.base_file)
+
+if __name__ == "__main__":
+  main()
diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py
index d78a5e7..b307486 100755
--- a/libc/tools/gensyscalls.py
+++ b/libc/tools/gensyscalls.py
@@ -8,7 +8,6 @@
 import commands
 import filecmp
 import glob
-import logging
 import os.path
 import re
 import shutil
@@ -20,39 +19,10 @@
 
 all_arches = [ "arm", "arm64", "mips", "mips64", "x86", "x86_64" ]
 
+bionic_libc = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
 
-# temp directory where we store all intermediate files
-bionic_temp = tempfile.mkdtemp(prefix="bionic_gensyscalls");
-# Make sure the directory is deleted when the script exits.
-atexit.register(shutil.rmtree, bionic_temp)
-
-bionic_libc_root = os.path.join(os.path.dirname(os.path.abspath(__file__)),
-                                "..")
-
-warning = "Generated by gensyscalls.py. Do not edit."
-
-DRY_RUN = False
-
-def make_dir(path):
-    path = os.path.abspath(path)
-    if not os.path.exists(path):
-        parent = os.path.dirname(path)
-        if parent:
-            make_dir(parent)
-        os.mkdir(path)
-
-
-def create_file(relpath):
-    full_path = os.path.join(bionic_temp, relpath)
-    dir = os.path.dirname(full_path)
-    make_dir(dir)
-    return open(full_path, "w")
-
-
-syscall_stub_header = "/* " + warning + " */\n" + \
+syscall_stub_header = \
 """
-#include <private/bionic_asm.h>
-
 ENTRY(%(func)s)
 """
 
@@ -97,7 +67,7 @@
 
 
 #
-# Arm64 assembler templates for each syscall stub
+# Arm64 assembler template for each syscall stub
 #
 
 arm64_call = syscall_stub_header + """\
@@ -114,7 +84,7 @@
 
 
 #
-# MIPS assembler templates for each syscall stub
+# MIPS assembler template for each syscall stub
 #
 
 mips_call = syscall_stub_header + """\
@@ -136,7 +106,7 @@
 
 
 #
-# MIPS64 assembler templates for each syscall stub
+# MIPS64 assembler template for each syscall stub
 #
 
 mips64_call = syscall_stub_header + """\
@@ -199,7 +169,7 @@
 
 
 #
-# x86_64 assembler templates for each syscall stub
+# x86_64 assembler template for each syscall stub
 #
 
 x86_64_call = """\
@@ -507,8 +477,6 @@
 
         self.syscalls.append(t)
 
-        logging.debug(t)
-
     def parse_open_file(self, fp):
         for line in fp:
             self.lineno += 1
@@ -518,175 +486,47 @@
             self.parse_line(line)
 
     def parse_file(self, file_path):
-        logging.debug("parse_file: %s" % file_path)
         with open(file_path) as fp:
             self.parse_open_file(fp)
 
 
-class State:
-    def __init__(self):
-        self.old_stubs = []
-        self.new_stubs = []
-        self.other_files = []
-        self.syscalls = []
+def main(arch):
+    parser = SysCallsTxtParser()
+    parser.parse_file(os.path.join(bionic_libc, "SYSCALLS.TXT"))
 
+    for syscall in parser.syscalls:
+        syscall["__NR_name"] = make__NR_name(syscall["name"])
 
-    def process_file(self, input):
-        parser = SysCallsTxtParser()
-        parser.parse_file(input)
-        self.syscalls = parser.syscalls
-        parser = None
+        if syscall.has_key("arm"):
+            syscall["asm-arm"] = add_footer(32, arm_eabi_genstub(syscall), syscall)
 
-        for syscall in self.syscalls:
-            syscall["__NR_name"] = make__NR_name(syscall["name"])
+        if syscall.has_key("arm64"):
+            syscall["asm-arm64"] = add_footer(64, arm64_genstub(syscall), syscall)
 
-            if syscall.has_key("arm"):
-                syscall["asm-arm"] = add_footer(32, arm_eabi_genstub(syscall), syscall)
+        if syscall.has_key("x86"):
+            if syscall["socketcall_id"] >= 0:
+                syscall["asm-x86"] = add_footer(32, x86_genstub_socketcall(syscall), syscall)
+            else:
+                syscall["asm-x86"] = add_footer(32, x86_genstub(syscall), syscall)
+        elif syscall["socketcall_id"] >= 0:
+            E("socketcall_id for dispatch syscalls is only supported for x86 in '%s'" % t)
+            return
 
-            if syscall.has_key("arm64"):
-                syscall["asm-arm64"] = add_footer(64, arm64_genstub(syscall), syscall)
+        if syscall.has_key("mips"):
+            syscall["asm-mips"] = add_footer(32, mips_genstub(syscall), syscall)
 
-            if syscall.has_key("x86"):
-                if syscall["socketcall_id"] >= 0:
-                    syscall["asm-x86"] = add_footer(32, x86_genstub_socketcall(syscall), syscall)
-                else:
-                    syscall["asm-x86"] = add_footer(32, x86_genstub(syscall), syscall)
-            elif syscall["socketcall_id"] >= 0:
-                E("socketcall_id for dispatch syscalls is only supported for x86 in '%s'" % t)
-                return
+        if syscall.has_key("mips64"):
+            syscall["asm-mips64"] = add_footer(64, mips64_genstub(syscall), syscall)
 
-            if syscall.has_key("mips"):
-                syscall["asm-mips"] = add_footer(32, mips_genstub(syscall), syscall)
+        if syscall.has_key("x86_64"):
+            syscall["asm-x86_64"] = add_footer(64, x86_64_genstub(syscall), syscall)
 
-            if syscall.has_key("mips64"):
-                syscall["asm-mips64"] = add_footer(64, mips64_genstub(syscall), syscall)
+    print("/* Generated by gensyscalls.py. Do not edit. */\n")
+    print("#include <private/bionic_asm.h>\n")
+    for syscall in parser.syscalls:
+        if syscall.has_key("asm-%s" % arch):
+            print(syscall["asm-%s" % arch])
 
-            if syscall.has_key("x86_64"):
-                syscall["asm-x86_64"] = add_footer(64, x86_64_genstub(syscall), syscall)
-
-
-    # Scan Linux kernel asm/unistd.h files containing __NR_* constants
-    # and write out equivalent SYS_* constants for glibc source compatibility.
-    def gen_glibc_syscalls_h(self):
-        glibc_syscalls_h_path = "include/bits/glibc-syscalls.h"
-        logging.info("generating " + glibc_syscalls_h_path)
-        glibc_fp = create_file(glibc_syscalls_h_path)
-        glibc_fp.write("/* %s */\n" % warning)
-        glibc_fp.write("#ifndef _BIONIC_BITS_GLIBC_SYSCALLS_H_\n")
-        glibc_fp.write("#define _BIONIC_BITS_GLIBC_SYSCALLS_H_\n")
-
-        # Collect the set of all syscalls for all architectures.
-        syscalls = set()
-        pattern = re.compile(r'^\s*#\s*define\s*__NR_([a-z_]\S+)')
-        for unistd_h in ["kernel/uapi/asm-generic/unistd.h",
-                         "kernel/uapi/asm-arm/asm/unistd.h",
-                         "kernel/uapi/asm-arm/asm/unistd-common.h",
-                         "kernel/uapi/asm-arm/asm/unistd-eabi.h",
-                         "kernel/uapi/asm-arm/asm/unistd-oabi.h",
-                         "kernel/uapi/asm-mips/asm/unistd.h",
-                         "kernel/uapi/asm-x86/asm/unistd_32.h",
-                         "kernel/uapi/asm-x86/asm/unistd_64.h"]:
-          for line in open(os.path.join(bionic_libc_root, unistd_h)):
-            m = re.search(pattern, line)
-            if m:
-              nr_name = m.group(1)
-              if 'reserved' not in nr_name and 'unused' not in nr_name:
-                syscalls.add(nr_name)
-
-        # Write out a single file listing them all. Note that the input
-        # files include #if trickery, so even for a single architecture
-        # we don't know exactly which ones are available.
-        # https://code.google.com/p/android/issues/detail?id=215853
-        for syscall in sorted(syscalls):
-          nr_name = make__NR_name(syscall)
-          glibc_fp.write("#if defined(%s)\n" % nr_name)
-          glibc_fp.write("  #define SYS_%s %s\n" % (syscall, nr_name))
-          glibc_fp.write("#endif\n")
-
-        glibc_fp.write("#endif /* _BIONIC_BITS_GLIBC_SYSCALLS_H_ */\n")
-        glibc_fp.close()
-        self.other_files.append(glibc_syscalls_h_path)
-
-
-    # Write each syscall stub.
-    def gen_syscall_stubs(self):
-        for syscall in self.syscalls:
-            for arch in all_arches:
-                if syscall.has_key("asm-%s" % arch):
-                    filename = "arch-%s/syscalls/%s.S" % (arch, syscall["func"])
-                    logging.info(">>> generating " + filename)
-                    fp = create_file(filename)
-                    fp.write(syscall["asm-%s" % arch])
-                    fp.close()
-                    self.new_stubs.append(filename)
-
-
-    def regenerate(self):
-        logging.info("scanning for existing architecture-specific stub files...")
-
-        for arch in all_arches:
-            arch_dir = "arch-" + arch
-            logging.info("scanning " + os.path.join(bionic_libc_root, arch_dir))
-            rel_path = os.path.join(arch_dir, "syscalls")
-            for file in os.listdir(os.path.join(bionic_libc_root, rel_path)):
-                if file.endswith(".S"):
-                  self.old_stubs.append(os.path.join(rel_path, file))
-
-        logging.info("found %d stub files" % len(self.old_stubs))
-
-        if not os.path.exists(bionic_temp):
-            logging.info("creating %s..." % bionic_temp)
-            make_dir(bionic_temp)
-
-        logging.info("re-generating stubs and support files...")
-
-        self.gen_glibc_syscalls_h()
-        self.gen_syscall_stubs()
-
-        logging.info("comparing files...")
-        adds    = []
-        edits   = []
-
-        for stub in self.new_stubs + self.other_files:
-            tmp_file = os.path.join(bionic_temp, stub)
-            libc_file = os.path.join(bionic_libc_root, stub)
-            if not os.path.exists(libc_file):
-                # new file, git add it
-                logging.info("new file:     " + stub)
-                adds.append(libc_file)
-                shutil.copyfile(tmp_file, libc_file)
-
-            elif not filecmp.cmp(tmp_file, libc_file):
-                logging.info("changed file: " + stub)
-                edits.append(stub)
-
-        deletes = []
-        for stub in self.old_stubs:
-            if not stub in self.new_stubs:
-                logging.info("deleted file: " + stub)
-                deletes.append(os.path.join(bionic_libc_root, stub))
-
-        if not DRY_RUN:
-            if adds:
-                commands.getoutput("git add " + " ".join(adds))
-            if deletes:
-                commands.getoutput("git rm " + " ".join(deletes))
-            if edits:
-                for file in edits:
-                    shutil.copyfile(os.path.join(bionic_temp, file),
-                                    os.path.join(bionic_libc_root, file))
-                commands.getoutput("git add " + " ".join((os.path.join(bionic_libc_root, file)) for file in edits))
-
-            commands.getoutput("git add %s" % (os.path.join(bionic_libc_root, "SYSCALLS.TXT")))
-
-        if (not adds) and (not deletes) and (not edits):
-            logging.info("no changes detected!")
-        else:
-            logging.info("ready to go!!")
-
-logging.basicConfig(level=logging.INFO)
 
 if __name__ == "__main__":
-    state = State()
-    state.process_file(os.path.join(bionic_libc_root, "SYSCALLS.TXT"))
-    state.regenerate()
+    main(sys.argv[1])
diff --git a/libc/tools/genversion-scripts.py b/libc/tools/genversion-scripts.py
deleted file mode 100755
index 5410580..0000000
--- a/libc/tools/genversion-scripts.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-
-# This tool is used to generate the version scripts for libc and libm
-# for every architecture.
-
-import atexit
-import os.path
-import shutil
-import tempfile
-import sys
-
-
-all_arches = ["arm", "arm64", "mips", "mips64", "x86", "x86_64"]
-bionic_libc_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libc")
-bionic_libm_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libm")
-bionic_libdl_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libdl")
-libc_script = os.path.join(bionic_libc_root, "libc.map.txt")
-libm_script = os.path.join(bionic_libm_root, "libm.map.txt")
-libdl_script = os.path.join(bionic_libdl_root, "libdl.map.txt")
-libstdcxx_script = os.path.join(bionic_libc_root, "libstdc++.map.txt")
-
-script_name = os.path.basename(sys.argv[0])
-
-# TODO (dimity): generate architecture-specific version scripts as part of build
-
-# temp directory where we store all intermediate files
-bionic_temp = tempfile.mkdtemp(prefix="bionic_genversionscripts")
-# Make sure the directory is deleted when the script exits.
-atexit.register(shutil.rmtree, bionic_temp)
-
-bionic_libc_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libc")
-
-warning = "Generated by %s. Do not edit." % script_name
-
-
-def has_arch_tags(tags):
-  for arch in all_arches:
-    if arch in tags:
-      return True
-  return False
-
-
-class VersionScriptGenerator(object):
-
-  def run(self):
-    for script in [libc_script, libstdcxx_script, libm_script, libdl_script]:
-      basename = os.path.basename(script)
-      dirname = os.path.dirname(script)
-      for arch in all_arches:
-        name = basename.split(".")[0] + "." + arch + ".map"
-        tmp_path = os.path.join(bionic_temp, name)
-        dest_path = os.path.join(dirname, name)
-        with open(tmp_path, "w") as fout:
-          with open(script, "r") as fin:
-            fout.write("# %s\n" % warning)
-            for line in fin:
-              index = line.find("#")
-              if index != -1:
-                tags = line[index+1:].split()
-                if arch not in tags and has_arch_tags(tags):
-                  continue
-              fout.write(line)
-        shutil.copyfile(tmp_path, dest_path)
-
-
-generator = VersionScriptGenerator()
-generator.run()
diff --git a/libc/tzcode/bionic.cpp b/libc/tzcode/bionic.cpp
index cb9c359..1742d79 100644
--- a/libc/tzcode/bionic.cpp
+++ b/libc/tzcode/bionic.cpp
@@ -228,13 +228,23 @@
   if (fd >= 0) return fd;
 #else
   // On the host, we don't expect those locations to exist, and we're not
-  // worried about security so we trust $ANDROID_DATA and $ANDROID_ROOT to
-  // point us in the right direction.
+  // worried about security so we trust $ANDROID_DATA, $ANDROID_RUNTIME_ROOT,
+  // $ANDROID_TZDATA_ROOT, and $ANDROID_ROOT to point us in the right direction.
   char* path = make_path("ANDROID_DATA", "/misc/zoneinfo/current/tzdata");
   fd = __bionic_open_tzdata_path(path, olson_id, entry_length);
   free(path);
   if (fd >= 0) return fd;
 
+  path = make_path("ANDROID_TZDATA_ROOT", "/etc/tz/tzdata");
+  fd = __bionic_open_tzdata_path(path, olson_id, entry_length);
+  free(path);
+  if (fd >= 0) return fd;
+
+  path = make_path("ANDROID_RUNTIME_ROOT", "/etc/tz/tzdata");
+  fd = __bionic_open_tzdata_path(path, olson_id, entry_length);
+  free(path);
+  if (fd >= 0) return fd;
+
   path = make_path("ANDROID_ROOT", "/usr/share/zoneinfo/tzdata");
   fd = __bionic_open_tzdata_path(path, olson_id, entry_length);
   free(path);
diff --git a/libc/tzcode/strptime.c b/libc/tzcode/strptime.c
index 0e9a7d3..41eaa9b 100644
--- a/libc/tzcode/strptime.c
+++ b/libc/tzcode/strptime.c
@@ -172,6 +172,12 @@
                 return (NULL);
             break;
 
+        case 'F':  /* The date as "%Y-%m-%d". */
+            _LEGAL_ALT(0);
+            if (!(bp = _strptime(bp, "%Y-%m-%d", tm, cr)))
+                return (NULL);
+            continue;
+
         case 'R':   /* The time as "%H:%M". */
             _LEGAL_ALT(0);
             if (!(bp = _strptime(bp, "%H:%M", tm, cr)))
@@ -190,6 +196,12 @@
                 return (NULL);
             break;
 
+        case 'v':  /* The date as "%e-%b-%Y". */
+            _LEGAL_ALT(0);
+            if (!(bp = _strptime(bp, "%e-%b-%Y", tm, cr)))
+                return (NULL);
+            break;
+
         case 'X':   /* The time, using the locale's format. */
             _LEGAL_ALT(_ALT_E);
             if (!(bp = _strptime(bp, _ctloc(t_fmt), tm, cr)))
@@ -305,6 +317,7 @@
             tm->tm_mon--;
             break;
 
+        case 'P':
         case 'p':   /* The locale's equivalent of AM/PM. */
             _LEGAL_ALT(0);
             /* AM? */
@@ -377,6 +390,33 @@
                 return (NULL);
             break;
 
+        case 'u':  /* The day of week, monday = 1. */
+            _LEGAL_ALT(_ALT_O);
+            if (!(_conv_num(&bp, &i, 1, 7)))
+                return (NULL);
+            tm->tm_wday = i % 7;
+            continue;
+
+        case 'g':  /* The year corresponding to the ISO week
+                    * number but without the century.
+                    */
+            if (!(_conv_num(&bp, &i, 0, 99)))
+                return (NULL);
+            continue;
+
+        case 'G':  /* The year corresponding to the ISO week
+                    * number with century.
+                    */
+            do
+                bp++;
+            while (isdigit(*bp));
+            continue;
+
+        case 'V':  /* The ISO 8601:1988 week number as decimal */
+            if (!(_conv_num(&bp, &i, 0, 53)))
+                return (NULL);
+            continue;
+
         case 'Y':   /* The year. */
             _LEGAL_ALT(_ALT_E);
             if (!(_conv_num(&bp, &i, 0, 9999)))
diff --git a/libc/upstream-netbsd/common/lib/libc/stdlib/random.c b/libc/upstream-netbsd/common/lib/libc/stdlib/random.c
index e7503c7..0e6eac0 100644
--- a/libc/upstream-netbsd/common/lib/libc/stdlib/random.c
+++ b/libc/upstream-netbsd/common/lib/libc/stdlib/random.c
@@ -1,4 +1,4 @@
-/*	$NetBSD: random.c,v 1.4 2014/06/12 20:59:46 christos Exp $	*/
+/*	$NetBSD: random.c,v 1.5 2016/02/08 05:27:24 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -35,7 +35,7 @@
 #if 0
 static char sccsid[] = "@(#)random.c	8.2 (Berkeley) 5/19/95";
 #else
-__RCSID("$NetBSD: random.c,v 1.4 2014/06/12 20:59:46 christos Exp $");
+__RCSID("$NetBSD: random.c,v 1.5 2016/02/08 05:27:24 dholland Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -92,7 +92,7 @@
  * state information, which will allow a degree seven polynomial.  (Note:
  * the zeroeth word of state information also has some other information
  * stored in it -- see setstate() for details).
- * 
+ *
  * The random number generation technique is a linear feedback shift register
  * approach, employing trinomials (since there are fewer terms to sum up that
  * way).  In this approach, the least significant bit of all the numbers in
@@ -318,12 +318,12 @@
  * the break values for the different R.N.G.'s, we choose the best (largest)
  * one we can and set things up for it.  srandom() is then called to
  * initialize the state information.
- * 
+ *
  * Note that on return from srandom(), we set state[-1] to be the type
  * multiplexed with the current value of the rear pointer; this is so
  * successive calls to initstate() won't lose this information and will be
  * able to restart with setstate().
- * 
+ *
  * Note: the first thing we do is save the current state, if any, just like
  * setstate() so that it doesn't matter when initstate is called.
  *
@@ -511,7 +511,7 @@
 {
 	static u_long randseed = 1;
 	long x, hi, lo, t;
- 
+
 	/*
 	 * Compute x[n + 1] = (7^5 * x[n]) mod (2^31 - 1).
 	 * From "Random number generators: good ones are hard to find",
diff --git a/libc/upstream-netbsd/lib/libc/include/isc/dst.h b/libc/upstream-netbsd/lib/libc/include/isc/dst.h
index 5537e3d..a25cf01 100644
--- a/libc/upstream-netbsd/lib/libc/include/isc/dst.h
+++ b/libc/upstream-netbsd/lib/libc/include/isc/dst.h
@@ -1,4 +1,4 @@
-/*	$NetBSD: dst.h,v 1.1.1.4 2009/04/12 16:35:44 christos Exp $	*/
+/*	$NetBSD: dst.h,v 1.2 2014/08/03 19:14:24 wiz Exp $	*/
 
 #ifndef DST_H
 #define DST_H
@@ -55,7 +55,7 @@
 #define	dst_write_key		__dst_write_key
 
 /* 
- * DST Crypto API defintions 
+ * DST Crypto API definitions 
  */
 void     dst_init(void);
 int      dst_check_algorithm(const int);
diff --git a/libc/upstream-netbsd/lib/libc/regex/regcomp.c b/libc/upstream-netbsd/lib/libc/regex/regcomp.c
index 6af9734..4a0d99a 100644
--- a/libc/upstream-netbsd/lib/libc/regex/regcomp.c
+++ b/libc/upstream-netbsd/lib/libc/regex/regcomp.c
@@ -1,4 +1,4 @@
-/*	$NetBSD: regcomp.c,v 1.36 2015/09/12 19:08:47 christos Exp $	*/
+/*	$NetBSD: regcomp.c,v 1.38 2019/02/07 22:22:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -76,7 +76,7 @@
 #if 0
 static char sccsid[] = "@(#)regcomp.c	8.5 (Berkeley) 3/20/94";
 #else
-__RCSID("$NetBSD: regcomp.c,v 1.36 2015/09/12 19:08:47 christos Exp $");
+__RCSID("$NetBSD: regcomp.c,v 1.38 2019/02/07 22:22:31 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -474,6 +474,8 @@
 		REQUIRE(!MORE() || !isdigit((unsigned char)PEEK()), REG_BADRPT);
 		/* FALLTHROUGH */
 	default:
+		if (p->error != 0)
+			return;
 		ordinary(p, c);
 		break;
 	}
@@ -692,6 +694,8 @@
 		REQUIRE(starordinary, REG_BADRPT);
 		/* FALLTHROUGH */
 	default:
+		if (p->error != 0)
+			return(0);
 		ordinary(p, c &~ BACKSL);
 		break;
 	}
@@ -1007,7 +1011,7 @@
 	}
 	len = p->next - sp;
 	for (cp = cnames; cp->name != NULL; cp++)
-		if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0')
+		if (strncmp(cp->name, sp, len) == 0 && strlen(cp->name) == len)
 			return(cp->code);	/* known name */
 	if (len == 1)
 		return(*sp);	/* single character */
diff --git a/libc/upstream-netbsd/lib/libc/stdlib/div.c b/libc/upstream-netbsd/lib/libc/stdlib/div.c
deleted file mode 100644
index f3bd32f..0000000
--- a/libc/upstream-netbsd/lib/libc/stdlib/div.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*	$NetBSD: div.c,v 1.8 2012/06/25 22:32:45 abs Exp $	*/
-
-/*
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)div.c	8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: div.c,v 1.8 2012/06/25 22:32:45 abs Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdlib.h>		/* div_t */
-
-div_t
-div(int num, int denom)
-{
-	div_t r;
-
-	r.quot = num / denom;
-	r.rem = num % denom;
-	/*
-	 * The ANSI standard says that |r.quot| <= |n/d|, where
-	 * n/d is to be computed in infinite precision.  In other
-	 * words, we should always truncate the quotient towards
-	 * 0, never -infinity.
-	 *
-	 * Machine division and remainer may work either way when
-	 * one or both of n or d is negative.  If only one is
-	 * negative and r.quot has been truncated towards -inf,
-	 * r.rem will have the same sign as denom and the opposite
-	 * sign of num; if both are negative and r.quot has been
-	 * truncated towards -inf, r.rem will be positive (will
-	 * have the opposite sign of num).  These are considered
-	 * `wrong'.
-	 *
-	 * If both are num and denom are positive, r will always
-	 * be positive.
-	 *
-	 * This all boils down to:
-	 *	if num >= 0, but r.rem < 0, we got the wrong answer.
-	 * In that case, to get the right answer, add 1 to r.quot and
-	 * subtract denom from r.rem.
-	 */
-	if (num >= 0 && r.rem < 0) {
-		r.quot++;
-		r.rem -= denom;
-	}
-	return (r);
-}
diff --git a/libc/upstream-netbsd/lib/libc/stdlib/ldiv.c b/libc/upstream-netbsd/lib/libc/stdlib/ldiv.c
deleted file mode 100644
index 507c831..0000000
--- a/libc/upstream-netbsd/lib/libc/stdlib/ldiv.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*	$NetBSD: ldiv.c,v 1.8 2012/06/25 22:32:45 abs Exp $	*/
-
-/*
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)ldiv.c	8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: ldiv.c,v 1.8 2012/06/25 22:32:45 abs Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdlib.h>		/* ldiv_t */
-
-ldiv_t
-ldiv(long num, long denom)
-{
-	ldiv_t r;
-
-	/* see div.c for comments */
-
-	r.quot = num / denom;
-	r.rem = num % denom;
-	if (num >= 0 && r.rem < 0) {
-		r.quot++;
-		r.rem -= denom;
-	}
-	return (r);
-}
diff --git a/libc/upstream-netbsd/lib/libc/stdlib/lldiv.c b/libc/upstream-netbsd/lib/libc/stdlib/lldiv.c
deleted file mode 100644
index 47104b3..0000000
--- a/libc/upstream-netbsd/lib/libc/stdlib/lldiv.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*	$NetBSD: lldiv.c,v 1.4 2012/06/25 22:32:45 abs Exp $	*/
-
-/*
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "from: @(#)ldiv.c	8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: lldiv.c,v 1.4 2012/06/25 22:32:45 abs Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
-#include <stdlib.h>		/* lldiv_t */
-
-#ifdef __weak_alias
-__weak_alias(lldiv, _lldiv)
-#endif
-
-/* LONGLONG */
-lldiv_t
-lldiv(long long int num, long long int denom)
-{
-	lldiv_t r;
-
-	/* see div.c for comments */
-
-	r.quot = num / denom;
-	r.rem = num % denom;
-	if (num >= 0 && r.rem < 0) {
-		r.quot++;
-		r.rem -= denom;
-	}
-	return (r);
-}
diff --git a/libc/upstream-netbsd/lib/libc/string/memccpy.c b/libc/upstream-netbsd/lib/libc/string/memccpy.c
deleted file mode 100644
index c086241..0000000
--- a/libc/upstream-netbsd/lib/libc/string/memccpy.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*	$NetBSD: memccpy.c,v 1.13 2012/06/25 22:32:46 abs Exp $	*/
-
-/*-
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)memccpy.c	8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: memccpy.c,v 1.13 2012/06/25 22:32:46 abs Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#include <assert.h>
-#include <string.h>
-
-void *
-memccpy(void *t, const void *f, int c, size_t n)
-{
-
-	_DIAGASSERT(t != 0);
-	_DIAGASSERT(f != 0);
-
-	if (n) {
-		unsigned char *tp = t;
-		const unsigned char *fp = f;
-		unsigned char uc = c;
-		do {
-			if ((*tp++ = *fp++) == uc)
-				return (tp);
-		} while (--n != 0);
-	}
-	return (0);
-}
diff --git a/libc/upstream-netbsd/lib/libc/string/strcasestr.c b/libc/upstream-netbsd/lib/libc/string/strcasestr.c
deleted file mode 100644
index f8a9444..0000000
--- a/libc/upstream-netbsd/lib/libc/string/strcasestr.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*	$NetBSD: strcasestr.c,v 1.3 2005/11/29 03:12:00 christos Exp $	*/
-
-/*-
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strcasestr.c,v 1.3 2005/11/29 03:12:00 christos Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
-#include <assert.h>
-#include <ctype.h>
-#include <string.h>
-
-/*
- * Find the first occurrence of find in s, ignore case.
- */
-char *
-strcasestr(const char *s, const char *find)
-{
-	char c, sc;
-	size_t len;
-
-	_DIAGASSERT(s != NULL);
-	_DIAGASSERT(find != NULL);
-
-	if ((c = *find++) != 0) {
-		c = tolower((unsigned char)c);
-		len = strlen(find);
-		do {
-			do {
-				if ((sc = *s++) == 0)
-					return (NULL);
-			} while ((char)tolower((unsigned char)sc) != c);
-		} while (strncasecmp(s, find, len) != 0);
-		s--;
-	}
-	return __UNCONST(s);
-}
diff --git a/libc/upstream-netbsd/lib/libc/string/strcoll.c b/libc/upstream-netbsd/lib/libc/string/strcoll.c
deleted file mode 100644
index 77a0942..0000000
--- a/libc/upstream-netbsd/lib/libc/string/strcoll.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*	$NetBSD: strcoll.c,v 1.10 2012/06/25 22:32:46 abs Exp $	*/
-
-/*-
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)strcoll.c	8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: strcoll.c,v 1.10 2012/06/25 22:32:46 abs Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#include <assert.h>
-#include <string.h>
-
-/*
- * Compare strings according to LC_COLLATE category of current locale.
- */
-int
-strcoll(const char *s1, const char *s2)
-{
-
-	_DIAGASSERT(s1 != NULL);
-	_DIAGASSERT(s2 != NULL);
-
-	/* LC_COLLATE is unimplemented, hence always "C" */
-	return (strcmp(s1, s2));
-}
diff --git a/libc/upstream-netbsd/lib/libc/string/strxfrm.c b/libc/upstream-netbsd/lib/libc/string/strxfrm.c
deleted file mode 100644
index 42c2a24..0000000
--- a/libc/upstream-netbsd/lib/libc/string/strxfrm.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*	$NetBSD: strxfrm.c,v 1.12 2012/06/25 22:32:46 abs Exp $	*/
-
-/*-
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)strxfrm.c	8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: strxfrm.c,v 1.12 2012/06/25 22:32:46 abs Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#include <assert.h>
-#include <string.h>
-
-/*
- * Transform src, storing the result in dst, such that
- * strcmp() on transformed strings returns what strcoll()
- * on the original untransformed strings would return.
- */
-size_t
-strxfrm(char *dst, const char *src, size_t n)
-{
-	size_t srclen, copysize;
-
-	_DIAGASSERT(src != NULL);
-
-	/*
-	 * Since locales are unimplemented, this is just a copy.
-	 */
-	srclen = strlen(src);
-	if (n != 0) {
-		_DIAGASSERT(dst != NULL);
-		copysize = srclen < n ? srclen : n - 1;
-		(void)memcpy(dst, src, copysize);
-		dst[copysize] = 0;
-	}
-	return (srclen);
-}
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/div.c b/libc/upstream-openbsd/lib/libc/stdlib/div.c
new file mode 100644
index 0000000..beaa428
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/stdlib/div.c
@@ -0,0 +1,72 @@
+/*	$OpenBSD: div.c,v 1.6 2015/09/13 08:31:47 guenther Exp $ */
+/*
+ * Copyright (c) 1990 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <stdlib.h>		/* div_t */
+
+div_t
+div(int num, int denom)
+{
+	div_t r;
+
+	r.quot = num / denom;
+	r.rem = num % denom;
+	/*
+	 * The ANSI standard says that |r.quot| <= |n/d|, where
+	 * n/d is to be computed in infinite precision.  In other
+	 * words, we should always truncate the quotient towards
+	 * 0, never -infinity.
+	 *
+	 * Machine division and remainer may work either way when
+	 * one or both of n or d is negative.  If only one is
+	 * negative and r.quot has been truncated towards -inf,
+	 * r.rem will have the same sign as denom and the opposite
+	 * sign of num; if both are negative and r.quot has been
+	 * truncated towards -inf, r.rem will be positive (will
+	 * have the opposite sign of num).  These are considered
+	 * `wrong'.
+	 *
+	 * If both are num and denom are positive, r will always
+	 * be positive.
+	 *
+	 * This all boils down to:
+	 *	if num >= 0, but r.rem < 0, we got the wrong answer.
+	 * In that case, to get the right answer, add 1 to r.quot and
+	 * subtract denom from r.rem.
+	 */
+	if (num >= 0 && r.rem < 0) {
+		r.quot++;
+		r.rem -= denom;
+	}
+	return (r);
+}
+DEF_STRONG(div);
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/ldiv.c b/libc/upstream-openbsd/lib/libc/stdlib/ldiv.c
new file mode 100644
index 0000000..775065f
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/stdlib/ldiv.c
@@ -0,0 +1,50 @@
+/*	$OpenBSD: ldiv.c,v 1.5 2005/08/08 08:05:36 espie Exp $ */
+/*
+ * Copyright (c) 1990 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <stdlib.h>		/* ldiv_t */
+
+ldiv_t
+ldiv(long num, long denom)
+{
+	ldiv_t r;
+
+	/* see div.c for comments */
+
+	r.quot = num / denom;
+	r.rem = num % denom;
+	if (num >= 0 && r.rem < 0) {
+		r.quot++;
+		r.rem -= denom;
+	}
+	return (r);
+}
diff --git a/libc/upstream-openbsd/lib/libc/stdlib/lldiv.c b/libc/upstream-openbsd/lib/libc/stdlib/lldiv.c
new file mode 100644
index 0000000..59c37b8
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/stdlib/lldiv.c
@@ -0,0 +1,52 @@
+/*	$OpenBSD: lldiv.c,v 1.2 2016/08/14 23:18:03 guenther Exp $	*/
+/*
+ * Copyright (c) 1990 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <stdlib.h>		/* lldiv_t */
+
+lldiv_t
+lldiv(long long num, long long denom)
+{
+	lldiv_t r;
+
+	/* see div.c for comments */
+
+	r.quot = num / denom;
+	r.rem = num % denom;
+	if (num >= 0 && r.rem < 0) {
+		r.quot++;
+		r.rem -= denom;
+	}
+	return (r);
+}
+
+__weak_alias(qdiv, lldiv);
diff --git a/libc/upstream-openbsd/lib/libc/string/memccpy.c b/libc/upstream-openbsd/lib/libc/string/memccpy.c
new file mode 100644
index 0000000..635061b
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/string/memccpy.c
@@ -0,0 +1,49 @@
+/*	$OpenBSD: memccpy.c,v 1.7 2015/08/31 02:53:57 guenther Exp $	*/
+
+/*-
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <string.h>
+
+void *
+memccpy(void *t, const void *f, int c, size_t n)
+{
+
+	if (n) {
+		unsigned char *tp = t;
+		const unsigned char *fp = f;
+		unsigned char uc = c;
+		do {
+			if ((*tp++ = *fp++) == uc)
+				return (tp);
+		} while (--n != 0);
+	}
+	return (0);
+}
+DEF_WEAK(memccpy);
diff --git a/libc/upstream-openbsd/lib/libc/string/strcasestr.c b/libc/upstream-openbsd/lib/libc/string/strcasestr.c
new file mode 100644
index 0000000..abb3e15
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/string/strcasestr.c
@@ -0,0 +1,61 @@
+/*	$OpenBSD: strcasestr.c,v 1.4 2015/08/31 02:53:57 guenther Exp $	*/
+/*	$NetBSD: strcasestr.c,v 1.2 2005/02/09 21:35:47 kleink Exp $	*/
+
+/*-
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <ctype.h>
+#include <string.h>
+
+/*
+ * Find the first occurrence of find in s, ignore case.
+ */
+char *
+strcasestr(const char *s, const char *find)
+{
+	char c, sc;
+	size_t len;
+
+	if ((c = *find++) != 0) {
+		c = (char)tolower((unsigned char)c);
+		len = strlen(find);
+		do {
+			do {
+				if ((sc = *s++) == 0)
+					return (NULL);
+			} while ((char)tolower((unsigned char)sc) != c);
+		} while (strncasecmp(s, find, len) != 0);
+		s--;
+	}
+	return ((char *)s);
+}
+DEF_WEAK(strcasestr);
diff --git a/libc/upstream-openbsd/lib/libc/string/strcoll.c b/libc/upstream-openbsd/lib/libc/string/strcoll.c
new file mode 100644
index 0000000..47a6ea4
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/string/strcoll.c
@@ -0,0 +1,45 @@
+/*	$OpenBSD: strcoll.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <string.h>
+
+/*
+ * Compare strings according to LC_COLLATE category of current locale.
+ */
+int
+strcoll(const char *s1, const char *s2)
+{
+	/* LC_COLLATE is unimplemented, hence always "C" */
+	return (strcmp(s1, s2));
+}
+DEF_STRONG(strcoll);
diff --git a/libc/upstream-openbsd/lib/libc/string/strxfrm.c b/libc/upstream-openbsd/lib/libc/string/strxfrm.c
new file mode 100644
index 0000000..97df097
--- /dev/null
+++ b/libc/upstream-openbsd/lib/libc/string/strxfrm.c
@@ -0,0 +1,52 @@
+/*	$OpenBSD: strxfrm.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 <string.h>
+
+/*
+ * Transform src, storing the result in dst, such that
+ * strcmp() on transformed strings returns what strcoll()
+ * on the original untransformed strings would return.
+ */
+size_t
+strxfrm(char *dst, const char *src, size_t n)
+{
+
+	/*
+	 * Since locales are unimplemented, this is just a copy.
+	 */
+	if (n == 0)
+		return (strlen(src));
+	return (strlcpy(dst, src, n));
+}
+DEF_STRONG(strxfrm);
diff --git a/libdl/Android.bp b/libdl/Android.bp
index 656d3ab..b1ee5ab 100644
--- a/libdl/Android.bp
+++ b/libdl/Android.bp
@@ -56,18 +56,12 @@
     // for x86, exclude libgcc_eh.a for the same reasons as above
     arch: {
         arm: {
-            version_script: "libdl.arm.map",
+            version_script: ":libdl.arm.map",
             pack_relocations: false,
             ldflags: ["-Wl,--hash-style=both"],
         },
         arm64: {
-            version_script: "libdl.arm64.map",
-        },
-        mips: {
-            version_script: "libdl.mips.map",
-        },
-        mips64: {
-            version_script: "libdl.mips64.map",
+            version_script: ":libdl.arm64.map",
         },
         x86: {
             pack_relocations: false,
@@ -75,11 +69,11 @@
                 "-Wl,--exclude-libs=libgcc_eh.a",
                 "-Wl,--hash-style=both",
             ],
-            version_script: "libdl.x86.map",
+            version_script: ":libdl.x86.map",
         },
         x86_64: {
             ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
-            version_script: "libdl.x86_64.map",
+            version_script: ":libdl.x86_64.map",
         },
     },
     shared: {
@@ -99,6 +93,9 @@
     nocrt: true,
     system_shared_libs: [],
 
+    // Opt out of native_coverage when opting out of system_shared_libs
+    native_coverage: false,
+
     // This is placeholder library the actual implementation is (currently)
     // provided by the linker.
     shared_libs: ["ld-android"],
@@ -106,6 +103,78 @@
     sanitize: {
         never: true,
     },
+
+    stubs: {
+        symbol_file: "libdl.map.txt",
+        versions: ["10000"],
+    },
+}
+
+cc_library {
+    name: "libdl_android",
+
+    defaults: ["linux_bionic_supported"],
+    recovery_available: true,
+
+    // NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from
+    // libgcc.a are made static to libdl.so.  This in turn ensures that libraries that
+    // a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so
+    // to provide those symbols, but will instead pull them from libgcc.a.  Specifically,
+    // we use this property to make sure libc.so has its own copy of the code from
+    // libgcc.a it uses.
+    //
+    // DO NOT REMOVE --exclude-libs!
+
+    ldflags: [
+        "-Wl,--exclude-libs=libgcc.a",
+        "-Wl,--exclude-libs=libclang_rt.builtins-arm-android.a",
+        "-Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a",
+        "-Wl,--exclude-libs=libclang_rt.builtins-x86-android.a",
+        "-Wl,--exclude-libs=libclang_rt.builtins-x86_64-android.a",
+    ],
+
+    // for x86, exclude libgcc_eh.a for the same reasons as above
+    arch: {
+        x86: {
+            ldflags: [
+                "-Wl,--exclude-libs=libgcc_eh.a",
+            ],
+        },
+        x86_64: {
+            ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
+        },
+    },
+
+    srcs: [ "libdl_android.cpp" ],
+    version_script: "libdl_android.map.txt",
+
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Wunused",
+        "-Werror",
+    ],
+
+    stl: "none",
+
+    nocrt: true,
+    system_shared_libs: [],
+
+    // Opt out of native_coverage when opting out of system_shared_libs
+    native_coverage: false,
+
+    // This is placeholder library the actual implementation is (currently)
+    // provided by the linker.
+    shared_libs: ["ld-android"],
+
+    sanitize: {
+        never: true,
+    },
+
+    stubs: {
+        symbol_file: "libdl_android.map.txt",
+        versions: ["10000"],
+    },
 }
 
 ndk_library {
@@ -118,3 +187,35 @@
     name: "libdl",
     symbol_file: "libdl.map.txt",
 }
+
+genrule {
+    name: "libdl.arm.map",
+    out: ["libdl.arm.map"],
+    srcs: ["libdl.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
+}
+
+genrule {
+    name: "libdl.arm64.map",
+    out: ["libdl.arm64.map"],
+    srcs: ["libdl.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
+}
+
+genrule {
+    name: "libdl.x86.map",
+    out: ["libdl.x86.map"],
+    srcs: ["libdl.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
+}
+
+genrule {
+    name: "libdl.x86_64.map",
+    out: ["libdl.x86_64.map"],
+    srcs: ["libdl.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
+}
diff --git a/libdl/MODULE_LICENSE_BSD b/libdl/MODULE_LICENSE_APACHE2
similarity index 100%
rename from libdl/MODULE_LICENSE_BSD
rename to libdl/MODULE_LICENSE_APACHE2
diff --git a/libdl/NOTICE b/libdl/NOTICE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/libdl/NOTICE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/libdl/libdl.arm.map b/libdl/libdl.arm.map
deleted file mode 100644
index 28f0601..0000000
--- a/libdl/libdl.arm.map
+++ /dev/null
@@ -1,56 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dl_unwind_find_exidx; # arm
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;
diff --git a/libdl/libdl.arm64.map b/libdl/libdl.arm64.map
deleted file mode 100644
index a03e9e1..0000000
--- a/libdl/libdl.arm64.map
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;
diff --git a/libdl/libdl.cpp b/libdl/libdl.cpp
index a468f81..1ee4012 100644
--- a/libdl/libdl.cpp
+++ b/libdl/libdl.cpp
@@ -25,6 +25,9 @@
 extern "C" {
 
 __attribute__((__weak__, visibility("default")))
+void __loader_android_get_LD_LIBRARY_PATH(char* buffer, size_t buffer_size);
+
+__attribute__((__weak__, visibility("default")))
 void* __loader_dlopen(const char* filename, int flags, const void* caller_addr);
 
 __attribute__((__weak__, visibility("default")))
@@ -67,39 +70,15 @@
                                   const void* caller_addr);
 
 __attribute__((__weak__, visibility("default")))
-void __loader_android_set_application_target_sdk_version(int target);
-
-__attribute__((__weak__, visibility("default")))
 int __loader_android_get_application_target_sdk_version();
 
-__attribute__((__weak__, visibility("default")))
-bool __loader_android_init_anonymous_namespace(const char* shared_libs_sonames,
-                                               const char* library_search_path);
-
-__attribute__((__weak__, visibility("default")))
-struct android_namespace_t* __loader_android_create_namespace(
-                                const char* name,
-                                const char* ld_library_path,
-                                const char* default_library_path,
-                                uint64_t type,
-                                const char* permitted_when_isolated_path,
-                                struct android_namespace_t* parent,
-                                const void* caller_addr);
-
-__attribute__((__weak__, visibility("default")))
-bool __loader_android_link_namespaces(
-                                struct android_namespace_t* namespace_from,
-                                struct android_namespace_t* namespace_to,
-                                const char* shared_libs_sonames);
-
-__attribute__((__weak__, visibility("default")))
-void __loader_android_dlwarning(void* obj, void (*f)(void*, const char*));
-
-__attribute__((__weak__, visibility("default")))
-struct android_namespace_t* __loader_android_get_exported_namespace(const char* name);
-
 // Proxy calls to bionic loader
 __attribute__((__weak__))
+void android_get_LD_LIBRARY_PATH(char* buffer, size_t buffer_size) {
+  __loader_android_get_LD_LIBRARY_PATH(buffer, buffer_size);
+}
+
+__attribute__((__weak__))
 void* dlopen(const char* filename, int flag) {
   const void* caller_addr = __builtin_return_address(0);
   return __loader_dlopen(filename, flag, caller_addr);
@@ -149,71 +128,16 @@
 }
 
 __attribute__((__weak__))
-void android_get_LD_LIBRARY_PATH(char* buffer, size_t buffer_size) {
-  __loader_android_get_LD_LIBRARY_PATH(buffer, buffer_size);
-}
-
-__attribute__((__weak__))
-void android_update_LD_LIBRARY_PATH(const char* ld_library_path) {
-  __loader_android_update_LD_LIBRARY_PATH(ld_library_path);
-}
-
-__attribute__((__weak__))
 void* android_dlopen_ext(const char* filename, int flag, const android_dlextinfo* extinfo) {
   const void* caller_addr = __builtin_return_address(0);
   return __loader_android_dlopen_ext(filename, flag, extinfo, caller_addr);
 }
 
 __attribute__((__weak__))
-void android_set_application_target_sdk_version(int target) {
-  __loader_android_set_application_target_sdk_version(target);
-}
-
-__attribute__((__weak__))
 int android_get_application_target_sdk_version() {
   return __loader_android_get_application_target_sdk_version();
 }
 
-__attribute__((__weak__))
-bool android_init_anonymous_namespace(const char* shared_libs_sonames,
-                                      const char* library_search_path) {
-  return __loader_android_init_anonymous_namespace(shared_libs_sonames, library_search_path);
-}
-
-__attribute__((__weak__))
-struct android_namespace_t* android_create_namespace(const char* name,
-                                                     const char* ld_library_path,
-                                                     const char* default_library_path,
-                                                     uint64_t type,
-                                                     const char* permitted_when_isolated_path,
-                                                     struct android_namespace_t* parent) {
-  const void* caller_addr = __builtin_return_address(0);
-  return __loader_android_create_namespace(name,
-                                           ld_library_path,
-                                           default_library_path,
-                                           type,
-                                           permitted_when_isolated_path,
-                                           parent,
-                                           caller_addr);
-}
-
-__attribute__((__weak__))
-bool android_link_namespaces(struct android_namespace_t* namespace_from,
-                             struct android_namespace_t* namespace_to,
-                             const char* shared_libs_sonames) {
-  return __loader_android_link_namespaces(namespace_from, namespace_to, shared_libs_sonames);
-}
-
-__attribute__((__weak__))
-void android_dlwarning(void* obj, void (*f)(void*, const char*)) {
-  __loader_android_dlwarning(obj, f);
-}
-
-__attribute__((__weak__))
-struct android_namespace_t* android_get_exported_namespace(const char* name) {
-  return __loader_android_get_exported_namespace(name);
-}
-
 #if defined(__arm__)
 // An arm32 unwinding table has an R_ARM_NONE relocation to
 // __aeabi_unwind_cpp_pr0. This shared library will never invoke the unwinder,
diff --git a/libdl/libdl.map.txt b/libdl/libdl.map.txt
index c5d1be4..473bdf2 100644
--- a/libdl/libdl.map.txt
+++ b/libdl/libdl.map.txt
@@ -43,13 +43,6 @@
 
 LIBC_PLATFORM {
   global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
     android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
+    __cfi_init;
 } LIBC_OMR1;
diff --git a/libdl/libdl.mips.map b/libdl/libdl.mips.map
deleted file mode 100644
index a03e9e1..0000000
--- a/libdl/libdl.mips.map
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;
diff --git a/libdl/libdl.mips64.map b/libdl/libdl.mips64.map
deleted file mode 100644
index a03e9e1..0000000
--- a/libdl/libdl.mips64.map
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;
diff --git a/libdl/libdl.x86.map b/libdl/libdl.x86.map
deleted file mode 100644
index a03e9e1..0000000
--- a/libdl/libdl.x86.map
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;
diff --git a/libdl/libdl.x86_64.map b/libdl/libdl.x86_64.map
deleted file mode 100644
index a03e9e1..0000000
--- a/libdl/libdl.x86_64.map
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;
diff --git a/libdl/libdl_android.cpp b/libdl/libdl_android.cpp
new file mode 100644
index 0000000..77b3bf8
--- /dev/null
+++ b/libdl/libdl_android.cpp
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dlfcn.h>
+#include <link.h>
+#include <stdlib.h>
+#include <android/dlext.h>
+
+// These functions are exported by the loader
+// TODO(dimitry): replace these with reference to libc.so
+
+extern "C" {
+
+__attribute__((__weak__, visibility("default")))
+void __loader_android_get_LD_LIBRARY_PATH(char* buffer, size_t buffer_size);
+
+__attribute__((__weak__, visibility("default")))
+void __loader_android_update_LD_LIBRARY_PATH(const char* ld_library_path);
+
+__attribute__((__weak__, visibility("default")))
+void __loader_android_set_application_target_sdk_version(int target);
+
+__attribute__((__weak__, visibility("default")))
+bool __loader_android_init_anonymous_namespace(const char* shared_libs_sonames,
+                                               const char* library_search_path);
+
+__attribute__((__weak__, visibility("default")))
+struct android_namespace_t* __loader_android_create_namespace(
+                                const char* name,
+                                const char* ld_library_path,
+                                const char* default_library_path,
+                                uint64_t type,
+                                const char* permitted_when_isolated_path,
+                                struct android_namespace_t* parent,
+                                const void* caller_addr);
+
+__attribute__((__weak__, visibility("default")))
+bool __loader_android_link_namespaces(
+                                struct android_namespace_t* namespace_from,
+                                struct android_namespace_t* namespace_to,
+                                const char* shared_libs_sonames);
+
+__attribute__((__weak__, visibility("default")))
+void __loader_android_dlwarning(void* obj, void (*f)(void*, const char*));
+
+__attribute__((__weak__, visibility("default")))
+struct android_namespace_t* __loader_android_get_exported_namespace(const char* name);
+
+// Proxy calls to bionic loader
+__attribute__((__weak__))
+void android_get_LD_LIBRARY_PATH(char* buffer, size_t buffer_size) {
+  __loader_android_get_LD_LIBRARY_PATH(buffer, buffer_size);
+}
+
+__attribute__((__weak__))
+void android_update_LD_LIBRARY_PATH(const char* ld_library_path) {
+  __loader_android_update_LD_LIBRARY_PATH(ld_library_path);
+}
+
+__attribute__((__weak__))
+void android_set_application_target_sdk_version(int target) {
+  __loader_android_set_application_target_sdk_version(target);
+}
+
+__attribute__((__weak__))
+bool android_init_anonymous_namespace(const char* shared_libs_sonames,
+                                      const char* library_search_path) {
+  return __loader_android_init_anonymous_namespace(shared_libs_sonames, library_search_path);
+}
+
+__attribute__((__weak__))
+struct android_namespace_t* android_create_namespace(const char* name,
+                                                     const char* ld_library_path,
+                                                     const char* default_library_path,
+                                                     uint64_t type,
+                                                     const char* permitted_when_isolated_path,
+                                                     struct android_namespace_t* parent) {
+  const void* caller_addr = __builtin_return_address(0);
+  return __loader_android_create_namespace(name,
+                                           ld_library_path,
+                                           default_library_path,
+                                           type,
+                                           permitted_when_isolated_path,
+                                           parent,
+                                           caller_addr);
+}
+
+__attribute__((__weak__))
+bool android_link_namespaces(struct android_namespace_t* namespace_from,
+                             struct android_namespace_t* namespace_to,
+                             const char* shared_libs_sonames) {
+  return __loader_android_link_namespaces(namespace_from, namespace_to, shared_libs_sonames);
+}
+
+__attribute__((__weak__))
+void android_dlwarning(void* obj, void (*f)(void*, const char*)) {
+  __loader_android_dlwarning(obj, f);
+}
+
+__attribute__((__weak__))
+struct android_namespace_t* android_get_exported_namespace(const char* name) {
+  return __loader_android_get_exported_namespace(name);
+}
+
+#if defined(__arm__)
+// An arm32 unwinding table has an R_ARM_NONE relocation to
+// __aeabi_unwind_cpp_pr0. This shared library will never invoke the unwinder,
+// so it doesn't actually need the routine. Define a dummy version here,
+// because the real version calls libc functions (e.g. memcpy, abort), which
+// would create a dependency cycle with libc.so.
+__attribute__((visibility("hidden")))
+void __aeabi_unwind_cpp_pr0() {
+  __builtin_trap();
+}
+#endif
+
+} // extern "C"
diff --git a/libdl/libdl_android.map.txt b/libdl/libdl_android.map.txt
new file mode 100644
index 0000000..7afcd9c
--- /dev/null
+++ b/libdl/libdl_android.map.txt
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2019 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LIBDL_ANDROID {
+  global:
+    android_create_namespace; # apex
+    android_dlwarning; # apex
+    android_get_LD_LIBRARY_PATH; # apex
+    android_update_LD_LIBRARY_PATH;
+    android_get_exported_namespace; # apex
+    android_init_anonymous_namespace; # apex
+    android_link_namespaces; # apex
+    android_set_application_target_sdk_version; # apex
+  local:
+    *;
+};
diff --git a/libm/Android.bp b/libm/Android.bp
index e4ba20d..8c32810 100644
--- a/libm/Android.bp
+++ b/libm/Android.bp
@@ -285,7 +285,7 @@
             instruction_set: "arm",
             pack_relocations: false,
             ldflags: ["-Wl,--hash-style=both"],
-            version_script: "libm.arm.map",
+            version_script: ":libm.arm.map",
         },
 
         arm64: {
@@ -318,17 +318,7 @@
                 "upstream-freebsd/lib/msun/src/s_trunc.c",
                 "upstream-freebsd/lib/msun/src/s_truncf.c",
             ],
-            version_script: "libm.arm64.map",
-        },
-
-        mips: {
-            srcs: ["mips/fenv.c"],
-            version_script: "libm.mips.map",
-        },
-
-        mips64: {
-            srcs: ["mips/fenv.c"],
-            version_script: "libm.mips64.map",
+            version_script: ":libm.arm64.map",
         },
 
         x86: {
@@ -403,7 +393,7 @@
             local_include_dirs: ["i387"],
             pack_relocations: false,
             ldflags: ["-Wl,--hash-style=both"],
-            version_script: "libm.x86.map",
+            version_script: ":libm.x86.map",
         },
 
         x86_64: {
@@ -474,7 +464,7 @@
                     "upstream-freebsd/lib/msun/src/s_truncf.c",
                 ],
             },
-            version_script: "libm.x86_64.map",
+            version_script: ":libm.x86_64.map",
         },
     },
 
@@ -504,6 +494,9 @@
         "-Wl,--Bsymbolic-functions",
     ],
 
+    // b/120614316, non-critical readibility check
+    tidy_checks: ["-cert-dcl16-c"],
+
     include_dirs: ["bionic/libc"],
     system_shared_libs: ["libc"],
 
@@ -515,8 +508,10 @@
     },
     stl: "none",
 
-    // TODO(ivanlozano): Remove after b/118321713
-    xom: false,
+    stubs: {
+        symbol_file: "libm.map.txt",
+        versions: ["10000"],
+    },
 }
 
 ndk_library {
@@ -529,3 +524,35 @@
     name: "libm",
     symbol_file: "libm.map.txt",
 }
+
+genrule {
+    name: "libm.arm.map",
+    out: ["libm.arm.map"],
+    srcs: ["libm.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
+}
+
+genrule {
+    name: "libm.arm64.map",
+    out: ["libm.arm64.map"],
+    srcs: ["libm.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
+}
+
+genrule {
+    name: "libm.x86.map",
+    out: ["libm.x86.map"],
+    srcs: ["libm.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
+}
+
+genrule {
+    name: "libm.x86_64.map",
+    out: ["libm.x86_64.map"],
+    srcs: ["libm.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
+}
diff --git a/libm/libm.arm.map b/libm/libm.arm.map
deleted file mode 100644
index bee08d4..0000000
--- a/libm/libm.arm.map
+++ /dev/null
@@ -1,401 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __fe_dfl_env; # var
-    __signbit;
-    __signbitf;
-    __signbitl;
-    acos;
-    acosf;
-    acosh;
-    acoshf;
-    acoshl; # introduced=21
-    acosl; # introduced=21
-    asin;
-    asinf;
-    asinh;
-    asinhf;
-    asinhl; # introduced=21
-    asinl; # introduced=21
-    atan;
-    atan2;
-    atan2f;
-    atan2l; # introduced=21
-    atanf;
-    atanh;
-    atanhf;
-    atanhl; # introduced=21
-    atanl; # introduced=21
-    cabs; # introduced=23
-    cabsf; # introduced=23
-    cabsl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    cacos; # introduced=23
-    cacosf; # introduced=23
-    cacosh; # introduced=23
-    cacoshf; # introduced=23
-    carg; # introduced=23
-    cargf; # introduced=23
-    cargl; # introduced=23
-    casin; # introduced=23
-    casinf; # introduced=23
-    casinh; # introduced=23
-    casinhf; # introduced=23
-    catan; # introduced=23
-    catanf; # introduced=23
-    catanh; # introduced=23
-    catanhf; # introduced=23
-    cbrt;
-    cbrtf;
-    cbrtl; # introduced=21
-    ccos; # introduced=23
-    ccosf; # introduced=23
-    ccosh; # introduced=23
-    ccoshf; # introduced=23
-    ceil;
-    ceilf;
-    ceill;
-    cexp; # introduced=23
-    cexpf; # introduced=23
-    cimag; # introduced=23
-    cimagf; # introduced=23
-    cimagl; # introduced=23
-    conj; # introduced=23
-    conjf; # introduced=23
-    conjl; # introduced=23
-    copysign;
-    copysignf;
-    copysignl;
-    cos;
-    cosf;
-    cosh;
-    coshf;
-    coshl; # introduced=21
-    cosl; # introduced=21
-    cproj; # introduced=23
-    cprojf; # introduced=23
-    cprojl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    creal; # introduced=23
-    crealf; # introduced=23
-    creall; # introduced=23
-    csin; # introduced=23
-    csinf; # introduced=23
-    csinh; # introduced=23
-    csinhf; # introduced=23
-    csqrt; # introduced=23
-    csqrtf; # introduced=23
-    csqrtl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    ctan; # introduced=23
-    ctanf; # introduced=23
-    ctanh; # introduced=23
-    ctanhf; # introduced=23
-    drem;
-    dremf;
-    erf;
-    erfc;
-    erfcf;
-    erfcl; # introduced=21
-    erff;
-    erfl; # introduced=21
-    exp;
-    exp2;
-    exp2f;
-    exp2l; # introduced=21
-    expf;
-    expl; # introduced=21
-    expm1;
-    expm1f;
-    expm1l; # introduced=21
-    fabs;
-    fabsf;
-    fabsl;
-    fdim;
-    fdimf;
-    fdiml;
-    feclearexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fedisableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feenableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feholdexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feraiseexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fetestexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feupdateenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    finite;
-    finitef;
-    floor;
-    floorf;
-    floorl;
-    fma;
-    fmaf;
-    fmal; # introduced=21
-    fmax;
-    fmaxf;
-    fmaxl;
-    fmin;
-    fminf;
-    fminl;
-    fmod;
-    fmodf;
-    fmodl; # introduced=21
-    frexp;
-    frexpf;
-    frexpl; # introduced=21
-    gamma;
-    gamma_r;
-    gammaf;
-    gammaf_r;
-    hypot;
-    hypotf;
-    hypotl; # introduced=21
-    ilogb;
-    ilogbf;
-    ilogbl;
-    j0;
-    j0f;
-    j1;
-    j1f;
-    jn;
-    jnf;
-    ldexpf;
-    ldexpl;
-    lgamma;
-    lgamma_r;
-    lgammaf;
-    lgammaf_r;
-    lgammal; # introduced=21
-    lgammal_r; # introduced=23
-    llrint;
-    llrintf;
-    llrintl; # introduced=21
-    llround;
-    llroundf;
-    llroundl;
-    log;
-    log10;
-    log10f;
-    log10l; # introduced=21
-    log1p;
-    log1pf;
-    log1pl; # introduced=21
-    log2; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2f; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2l; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logb;
-    logbf;
-    logbl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logf;
-    logl; # introduced=21
-    lrint;
-    lrintf;
-    lrintl; # introduced=21
-    lround;
-    lroundf;
-    lroundl;
-    modf;
-    modff;
-    modfl; # introduced=21
-    nan; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanl; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=13 introduced-x86_64=21
-    nearbyint;
-    nearbyintf;
-    nearbyintl; # introduced=21
-    nextafter;
-    nextafterf;
-    nextafterl; # introduced=21
-    nexttoward; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    nexttowardf;
-    nexttowardl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    pow;
-    powf;
-    powl; # introduced=21
-    remainder;
-    remainderf;
-    remainderl; # introduced=21
-    remquo;
-    remquof;
-    remquol; # introduced=21
-    rint;
-    rintf;
-    rintl; # introduced=21
-    round;
-    roundf;
-    roundl;
-    scalb;
-    scalbf;
-    scalbln; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnf; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnl; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalbn;
-    scalbnf;
-    scalbnl;
-    signgam; # var
-    significand;
-    significandf;
-    significandl; # introduced=21
-    sin;
-    sincos;
-    sincosf;
-    sincosl;
-    sinf;
-    sinh;
-    sinhf;
-    sinhl; # introduced=21
-    sinl; # introduced=21
-    sqrt;
-    sqrtf;
-    sqrtl; # introduced=21
-    tan;
-    tanf;
-    tanh;
-    tanhf;
-    tanhl; # introduced=21
-    tanl; # introduced=21
-    tgamma;
-    tgammaf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    tgammal; # introduced=21
-    trunc;
-    truncf;
-    truncl;
-    y0;
-    y0f;
-    y1;
-    y1f;
-    yn;
-    ynf;
-  local:
-    *;
-};
-
-LIBC_O { # introduced=O
-  global:
-    cacoshl;
-    cacosl;
-    casinhl;
-    casinl;
-    catanhl;
-    catanl;
-    ccoshl;
-    ccosl;
-    cexpl;
-    clog;
-    clogf;
-    clogl;
-    cpow;
-    cpowf;
-    cpowl;
-    csinhl;
-    csinl;
-    ctanhl;
-    ctanl;
-} LIBC;
-
-LIBC_DEPRECATED { # arm mips platform-only
-  global: # arm mips
-    ___Unwind_Backtrace; # arm
-    ___Unwind_ForcedUnwind; # arm
-    ___Unwind_RaiseException; # arm
-    ___Unwind_Resume; # arm
-    ___Unwind_Resume_or_Rethrow; # arm
-    __adddf3; # arm
-    __aeabi_cdcmpeq; # arm
-    __aeabi_cdcmple; # arm
-    __aeabi_cdrcmple; # arm
-    __aeabi_cfcmpeq; # arm
-    __aeabi_cfcmple; # arm
-    __aeabi_cfrcmple; # arm
-    __aeabi_d2lz; # arm
-    __aeabi_d2uiz; # arm
-    __aeabi_d2ulz; # arm
-    __aeabi_dadd; # arm
-    __aeabi_dcmpeq; # arm
-    __aeabi_dcmpge; # arm
-    __aeabi_dcmpgt; # arm
-    __aeabi_dcmple; # arm
-    __aeabi_dcmplt; # arm
-    __aeabi_ddiv; # arm
-    __aeabi_dmul; # arm
-    __aeabi_drsub; # arm
-    __aeabi_dsub; # arm
-    __aeabi_f2d; # arm
-    __aeabi_f2lz; # arm
-    __aeabi_f2ulz; # arm
-    __aeabi_fcmpeq; # arm
-    __aeabi_fcmpge; # arm
-    __aeabi_fcmpgt; # arm
-    __aeabi_fcmple; # arm
-    __aeabi_fcmplt; # arm
-    __aeabi_i2d; # arm
-    __aeabi_l2d; # arm
-    __aeabi_ui2d; # arm
-    __aeabi_ul2d; # arm
-    __aeabi_unwind_cpp_pr0; # arm
-    __aeabi_unwind_cpp_pr1; # arm
-    __aeabi_unwind_cpp_pr2; # arm
-    __cmpdf2; # arm
-    __cmpsf2; # arm
-    __divdf3; # arm
-    __eqdf2; # arm
-    __eqsf2; # arm
-    __extendsfdf2; # arm
-    __fixdfdi; # arm mips
-    __fixsfdi; # arm mips
-    __fixunsdfdi; # arm mips
-    __fixunsdfsi; # arm
-    __fixunssfdi; # arm mips
-    __floatdidf; # arm
-    __floatsidf; # arm
-    __floatundidf; # arm
-    __floatunsidf; # arm
-    __gedf2; # arm
-    __gesf2; # arm
-    __gnu_Unwind_Backtrace; # arm
-    __gnu_unwind_execute; # arm
-    __gnu_Unwind_ForcedUnwind; # arm
-    __gnu_unwind_frame; # arm
-    __gnu_Unwind_RaiseException; # arm
-    __gnu_Unwind_Restore_VFP; # arm
-    __gnu_Unwind_Restore_VFP_D; # arm
-    __gnu_Unwind_Restore_VFP_D_16_to_31; # arm
-    __gnu_Unwind_Restore_WMMXC; # arm
-    __gnu_Unwind_Restore_WMMXD; # arm
-    __gnu_Unwind_Resume; # arm
-    __gnu_Unwind_Resume_or_Rethrow; # arm
-    __gnu_Unwind_Save_VFP; # arm
-    __gnu_Unwind_Save_VFP_D; # arm
-    __gnu_Unwind_Save_VFP_D_16_to_31; # arm
-    __gnu_Unwind_Save_WMMXC; # arm
-    __gnu_Unwind_Save_WMMXD; # arm
-    __gtdf2; # arm
-    __gtsf2; # arm
-    __ledf2; # arm
-    __lesf2; # arm
-    __ltdf2; # arm
-    __ltsf2; # arm
-    __muldf3; # arm
-    __nedf2; # arm
-    __nesf2; # arm
-    __restore_core_regs; # arm
-    __subdf3; # arm
-    _Unwind_Backtrace; # arm
-    _Unwind_Complete; # arm
-    _Unwind_DeleteException; # arm
-    _Unwind_ForcedUnwind; # arm
-    _Unwind_GetCFA; # arm
-    _Unwind_GetDataRelBase; # arm
-    _Unwind_GetLanguageSpecificData; # arm
-    _Unwind_GetRegionStart; # arm
-    _Unwind_GetTextRelBase; # arm
-    _Unwind_RaiseException; # arm
-    _Unwind_Resume; # arm
-    _Unwind_Resume_or_Rethrow; # arm
-    _Unwind_VRS_Get; # arm
-    _Unwind_VRS_Pop; # arm
-    _Unwind_VRS_Set; # arm
-    restore_core_regs; # arm
-} LIBC_O; # arm mips
diff --git a/libm/libm.arm64.map b/libm/libm.arm64.map
deleted file mode 100644
index 550c39b..0000000
--- a/libm/libm.arm64.map
+++ /dev/null
@@ -1,297 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __fe_dfl_env; # var
-    __signbit;
-    __signbitf;
-    __signbitl;
-    acos;
-    acosf;
-    acosh;
-    acoshf;
-    acoshl; # introduced=21
-    acosl; # introduced=21
-    asin;
-    asinf;
-    asinh;
-    asinhf;
-    asinhl; # introduced=21
-    asinl; # introduced=21
-    atan;
-    atan2;
-    atan2f;
-    atan2l; # introduced=21
-    atanf;
-    atanh;
-    atanhf;
-    atanhl; # introduced=21
-    atanl; # introduced=21
-    cabs; # introduced=23
-    cabsf; # introduced=23
-    cabsl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    cacos; # introduced=23
-    cacosf; # introduced=23
-    cacosh; # introduced=23
-    cacoshf; # introduced=23
-    carg; # introduced=23
-    cargf; # introduced=23
-    cargl; # introduced=23
-    casin; # introduced=23
-    casinf; # introduced=23
-    casinh; # introduced=23
-    casinhf; # introduced=23
-    catan; # introduced=23
-    catanf; # introduced=23
-    catanh; # introduced=23
-    catanhf; # introduced=23
-    cbrt;
-    cbrtf;
-    cbrtl; # introduced=21
-    ccos; # introduced=23
-    ccosf; # introduced=23
-    ccosh; # introduced=23
-    ccoshf; # introduced=23
-    ceil;
-    ceilf;
-    ceill;
-    cexp; # introduced=23
-    cexpf; # introduced=23
-    cimag; # introduced=23
-    cimagf; # introduced=23
-    cimagl; # introduced=23
-    conj; # introduced=23
-    conjf; # introduced=23
-    conjl; # introduced=23
-    copysign;
-    copysignf;
-    copysignl;
-    cos;
-    cosf;
-    cosh;
-    coshf;
-    coshl; # introduced=21
-    cosl; # introduced=21
-    cproj; # introduced=23
-    cprojf; # introduced=23
-    cprojl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    creal; # introduced=23
-    crealf; # introduced=23
-    creall; # introduced=23
-    csin; # introduced=23
-    csinf; # introduced=23
-    csinh; # introduced=23
-    csinhf; # introduced=23
-    csqrt; # introduced=23
-    csqrtf; # introduced=23
-    csqrtl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    ctan; # introduced=23
-    ctanf; # introduced=23
-    ctanh; # introduced=23
-    ctanhf; # introduced=23
-    drem;
-    dremf;
-    erf;
-    erfc;
-    erfcf;
-    erfcl; # introduced=21
-    erff;
-    erfl; # introduced=21
-    exp;
-    exp2;
-    exp2f;
-    exp2l; # introduced=21
-    expf;
-    expl; # introduced=21
-    expm1;
-    expm1f;
-    expm1l; # introduced=21
-    fabs;
-    fabsf;
-    fabsl;
-    fdim;
-    fdimf;
-    fdiml;
-    feclearexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fedisableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feenableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feholdexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feraiseexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fetestexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feupdateenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    finite;
-    finitef;
-    floor;
-    floorf;
-    floorl;
-    fma;
-    fmaf;
-    fmal; # introduced=21
-    fmax;
-    fmaxf;
-    fmaxl;
-    fmin;
-    fminf;
-    fminl;
-    fmod;
-    fmodf;
-    fmodl; # introduced=21
-    frexp;
-    frexpf;
-    frexpl; # introduced=21
-    gamma;
-    gamma_r;
-    gammaf;
-    gammaf_r;
-    hypot;
-    hypotf;
-    hypotl; # introduced=21
-    ilogb;
-    ilogbf;
-    ilogbl;
-    j0;
-    j0f;
-    j1;
-    j1f;
-    jn;
-    jnf;
-    ldexpf;
-    ldexpl;
-    lgamma;
-    lgamma_r;
-    lgammaf;
-    lgammaf_r;
-    lgammal; # introduced=21
-    lgammal_r; # introduced=23
-    llrint;
-    llrintf;
-    llrintl; # introduced=21
-    llround;
-    llroundf;
-    llroundl;
-    log;
-    log10;
-    log10f;
-    log10l; # introduced=21
-    log1p;
-    log1pf;
-    log1pl; # introduced=21
-    log2; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2f; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2l; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logb;
-    logbf;
-    logbl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logf;
-    logl; # introduced=21
-    lrint;
-    lrintf;
-    lrintl; # introduced=21
-    lround;
-    lroundf;
-    lroundl;
-    modf;
-    modff;
-    modfl; # introduced=21
-    nan; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanl; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=13 introduced-x86_64=21
-    nearbyint;
-    nearbyintf;
-    nearbyintl; # introduced=21
-    nextafter;
-    nextafterf;
-    nextafterl; # introduced=21
-    nexttoward; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    nexttowardf;
-    nexttowardl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    pow;
-    powf;
-    powl; # introduced=21
-    remainder;
-    remainderf;
-    remainderl; # introduced=21
-    remquo;
-    remquof;
-    remquol; # introduced=21
-    rint;
-    rintf;
-    rintl; # introduced=21
-    round;
-    roundf;
-    roundl;
-    scalb;
-    scalbf;
-    scalbln; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnf; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnl; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalbn;
-    scalbnf;
-    scalbnl;
-    signgam; # var
-    significand;
-    significandf;
-    significandl; # introduced=21
-    sin;
-    sincos;
-    sincosf;
-    sincosl;
-    sinf;
-    sinh;
-    sinhf;
-    sinhl; # introduced=21
-    sinl; # introduced=21
-    sqrt;
-    sqrtf;
-    sqrtl; # introduced=21
-    tan;
-    tanf;
-    tanh;
-    tanhf;
-    tanhl; # introduced=21
-    tanl; # introduced=21
-    tgamma;
-    tgammaf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    tgammal; # introduced=21
-    trunc;
-    truncf;
-    truncl;
-    y0;
-    y0f;
-    y1;
-    y1f;
-    yn;
-    ynf;
-  local:
-    *;
-};
-
-LIBC_O { # introduced=O
-  global:
-    cacoshl;
-    cacosl;
-    casinhl;
-    casinl;
-    catanhl;
-    catanl;
-    ccoshl;
-    ccosl;
-    cexpl;
-    clog;
-    clogf;
-    clogl;
-    cpow;
-    cpowf;
-    cpowl;
-    csinhl;
-    csinl;
-    ctanhl;
-    ctanl;
-} LIBC;
-
diff --git a/libm/libm.map.txt b/libm/libm.map.txt
index 1f9a3f9..00ea7ee 100644
--- a/libm/libm.map.txt
+++ b/libm/libm.map.txt
@@ -301,58 +301,19 @@
     ___Unwind_RaiseException; # arm
     ___Unwind_Resume; # arm
     ___Unwind_Resume_or_Rethrow; # arm
-    __adddf3; # arm
-    __aeabi_cdcmpeq; # arm
-    __aeabi_cdcmple; # arm
-    __aeabi_cdrcmple; # arm
-    __aeabi_cfcmpeq; # arm
-    __aeabi_cfcmple; # arm
-    __aeabi_cfrcmple; # arm
     __aeabi_d2lz; # arm
-    __aeabi_d2uiz; # arm
     __aeabi_d2ulz; # arm
-    __aeabi_dadd; # arm
-    __aeabi_dcmpeq; # arm
-    __aeabi_dcmpge; # arm
-    __aeabi_dcmpgt; # arm
-    __aeabi_dcmple; # arm
-    __aeabi_dcmplt; # arm
-    __aeabi_ddiv; # arm
-    __aeabi_dmul; # arm
-    __aeabi_drsub; # arm
-    __aeabi_dsub; # arm
-    __aeabi_f2d; # arm
     __aeabi_f2lz; # arm
     __aeabi_f2ulz; # arm
-    __aeabi_fcmpeq; # arm
-    __aeabi_fcmpge; # arm
-    __aeabi_fcmpgt; # arm
-    __aeabi_fcmple; # arm
-    __aeabi_fcmplt; # arm
-    __aeabi_i2d; # arm
     __aeabi_l2d; # arm
-    __aeabi_ui2d; # arm
-    __aeabi_ul2d; # arm
     __aeabi_unwind_cpp_pr0; # arm
     __aeabi_unwind_cpp_pr1; # arm
     __aeabi_unwind_cpp_pr2; # arm
-    __cmpdf2; # arm
-    __cmpsf2; # arm
-    __divdf3; # arm
-    __eqdf2; # arm
-    __eqsf2; # arm
-    __extendsfdf2; # arm
     __fixdfdi; # arm mips
     __fixsfdi; # arm mips
     __fixunsdfdi; # arm mips
-    __fixunsdfsi; # arm
     __fixunssfdi; # arm mips
     __floatdidf; # arm
-    __floatsidf; # arm
-    __floatundidf; # arm
-    __floatunsidf; # arm
-    __gedf2; # arm
-    __gesf2; # arm
     __gnu_Unwind_Backtrace; # arm
     __gnu_unwind_execute; # arm
     __gnu_Unwind_ForcedUnwind; # arm
@@ -370,17 +331,7 @@
     __gnu_Unwind_Save_VFP_D_16_to_31; # arm
     __gnu_Unwind_Save_WMMXC; # arm
     __gnu_Unwind_Save_WMMXD; # arm
-    __gtdf2; # arm
-    __gtsf2; # arm
-    __ledf2; # arm
-    __lesf2; # arm
-    __ltdf2; # arm
-    __ltsf2; # arm
-    __muldf3; # arm
-    __nedf2; # arm
-    __nesf2; # arm
     __restore_core_regs; # arm
-    __subdf3; # arm
     _Unwind_Backtrace; # arm
     _Unwind_Complete; # arm
     _Unwind_DeleteException; # arm
diff --git a/libm/libm.mips.map b/libm/libm.mips.map
deleted file mode 100644
index 0b6dc02..0000000
--- a/libm/libm.mips.map
+++ /dev/null
@@ -1,304 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __fe_dfl_env; # var
-    __signbit;
-    __signbitf;
-    __signbitl;
-    acos;
-    acosf;
-    acosh;
-    acoshf;
-    acoshl; # introduced=21
-    acosl; # introduced=21
-    asin;
-    asinf;
-    asinh;
-    asinhf;
-    asinhl; # introduced=21
-    asinl; # introduced=21
-    atan;
-    atan2;
-    atan2f;
-    atan2l; # introduced=21
-    atanf;
-    atanh;
-    atanhf;
-    atanhl; # introduced=21
-    atanl; # introduced=21
-    cabs; # introduced=23
-    cabsf; # introduced=23
-    cabsl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    cacos; # introduced=23
-    cacosf; # introduced=23
-    cacosh; # introduced=23
-    cacoshf; # introduced=23
-    carg; # introduced=23
-    cargf; # introduced=23
-    cargl; # introduced=23
-    casin; # introduced=23
-    casinf; # introduced=23
-    casinh; # introduced=23
-    casinhf; # introduced=23
-    catan; # introduced=23
-    catanf; # introduced=23
-    catanh; # introduced=23
-    catanhf; # introduced=23
-    cbrt;
-    cbrtf;
-    cbrtl; # introduced=21
-    ccos; # introduced=23
-    ccosf; # introduced=23
-    ccosh; # introduced=23
-    ccoshf; # introduced=23
-    ceil;
-    ceilf;
-    ceill;
-    cexp; # introduced=23
-    cexpf; # introduced=23
-    cimag; # introduced=23
-    cimagf; # introduced=23
-    cimagl; # introduced=23
-    conj; # introduced=23
-    conjf; # introduced=23
-    conjl; # introduced=23
-    copysign;
-    copysignf;
-    copysignl;
-    cos;
-    cosf;
-    cosh;
-    coshf;
-    coshl; # introduced=21
-    cosl; # introduced=21
-    cproj; # introduced=23
-    cprojf; # introduced=23
-    cprojl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    creal; # introduced=23
-    crealf; # introduced=23
-    creall; # introduced=23
-    csin; # introduced=23
-    csinf; # introduced=23
-    csinh; # introduced=23
-    csinhf; # introduced=23
-    csqrt; # introduced=23
-    csqrtf; # introduced=23
-    csqrtl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    ctan; # introduced=23
-    ctanf; # introduced=23
-    ctanh; # introduced=23
-    ctanhf; # introduced=23
-    drem;
-    dremf;
-    erf;
-    erfc;
-    erfcf;
-    erfcl; # introduced=21
-    erff;
-    erfl; # introduced=21
-    exp;
-    exp2;
-    exp2f;
-    exp2l; # introduced=21
-    expf;
-    expl; # introduced=21
-    expm1;
-    expm1f;
-    expm1l; # introduced=21
-    fabs;
-    fabsf;
-    fabsl;
-    fdim;
-    fdimf;
-    fdiml;
-    feclearexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fedisableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feenableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feholdexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feraiseexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fetestexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feupdateenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    finite;
-    finitef;
-    floor;
-    floorf;
-    floorl;
-    fma;
-    fmaf;
-    fmal; # introduced=21
-    fmax;
-    fmaxf;
-    fmaxl;
-    fmin;
-    fminf;
-    fminl;
-    fmod;
-    fmodf;
-    fmodl; # introduced=21
-    frexp;
-    frexpf;
-    frexpl; # introduced=21
-    gamma;
-    gamma_r;
-    gammaf;
-    gammaf_r;
-    hypot;
-    hypotf;
-    hypotl; # introduced=21
-    ilogb;
-    ilogbf;
-    ilogbl;
-    j0;
-    j0f;
-    j1;
-    j1f;
-    jn;
-    jnf;
-    ldexpf;
-    ldexpl;
-    lgamma;
-    lgamma_r;
-    lgammaf;
-    lgammaf_r;
-    lgammal; # introduced=21
-    lgammal_r; # introduced=23
-    llrint;
-    llrintf;
-    llrintl; # introduced=21
-    llround;
-    llroundf;
-    llroundl;
-    log;
-    log10;
-    log10f;
-    log10l; # introduced=21
-    log1p;
-    log1pf;
-    log1pl; # introduced=21
-    log2; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2f; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2l; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logb;
-    logbf;
-    logbl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logf;
-    logl; # introduced=21
-    lrint;
-    lrintf;
-    lrintl; # introduced=21
-    lround;
-    lroundf;
-    lroundl;
-    modf;
-    modff;
-    modfl; # introduced=21
-    nan; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanl; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=13 introduced-x86_64=21
-    nearbyint;
-    nearbyintf;
-    nearbyintl; # introduced=21
-    nextafter;
-    nextafterf;
-    nextafterl; # introduced=21
-    nexttoward; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    nexttowardf;
-    nexttowardl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    pow;
-    powf;
-    powl; # introduced=21
-    remainder;
-    remainderf;
-    remainderl; # introduced=21
-    remquo;
-    remquof;
-    remquol; # introduced=21
-    rint;
-    rintf;
-    rintl; # introduced=21
-    round;
-    roundf;
-    roundl;
-    scalb;
-    scalbf;
-    scalbln; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnf; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnl; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalbn;
-    scalbnf;
-    scalbnl;
-    signgam; # var
-    significand;
-    significandf;
-    significandl; # introduced=21
-    sin;
-    sincos;
-    sincosf;
-    sincosl;
-    sinf;
-    sinh;
-    sinhf;
-    sinhl; # introduced=21
-    sinl; # introduced=21
-    sqrt;
-    sqrtf;
-    sqrtl; # introduced=21
-    tan;
-    tanf;
-    tanh;
-    tanhf;
-    tanhl; # introduced=21
-    tanl; # introduced=21
-    tgamma;
-    tgammaf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    tgammal; # introduced=21
-    trunc;
-    truncf;
-    truncl;
-    y0;
-    y0f;
-    y1;
-    y1f;
-    yn;
-    ynf;
-  local:
-    *;
-};
-
-LIBC_O { # introduced=O
-  global:
-    cacoshl;
-    cacosl;
-    casinhl;
-    casinl;
-    catanhl;
-    catanl;
-    ccoshl;
-    ccosl;
-    cexpl;
-    clog;
-    clogf;
-    clogl;
-    cpow;
-    cpowf;
-    cpowl;
-    csinhl;
-    csinl;
-    ctanhl;
-    ctanl;
-} LIBC;
-
-LIBC_DEPRECATED { # arm mips platform-only
-  global: # arm mips
-    __fixdfdi; # arm mips
-    __fixsfdi; # arm mips
-    __fixunsdfdi; # arm mips
-    __fixunssfdi; # arm mips
-} LIBC_O; # arm mips
diff --git a/libm/libm.mips64.map b/libm/libm.mips64.map
deleted file mode 100644
index 550c39b..0000000
--- a/libm/libm.mips64.map
+++ /dev/null
@@ -1,297 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __fe_dfl_env; # var
-    __signbit;
-    __signbitf;
-    __signbitl;
-    acos;
-    acosf;
-    acosh;
-    acoshf;
-    acoshl; # introduced=21
-    acosl; # introduced=21
-    asin;
-    asinf;
-    asinh;
-    asinhf;
-    asinhl; # introduced=21
-    asinl; # introduced=21
-    atan;
-    atan2;
-    atan2f;
-    atan2l; # introduced=21
-    atanf;
-    atanh;
-    atanhf;
-    atanhl; # introduced=21
-    atanl; # introduced=21
-    cabs; # introduced=23
-    cabsf; # introduced=23
-    cabsl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    cacos; # introduced=23
-    cacosf; # introduced=23
-    cacosh; # introduced=23
-    cacoshf; # introduced=23
-    carg; # introduced=23
-    cargf; # introduced=23
-    cargl; # introduced=23
-    casin; # introduced=23
-    casinf; # introduced=23
-    casinh; # introduced=23
-    casinhf; # introduced=23
-    catan; # introduced=23
-    catanf; # introduced=23
-    catanh; # introduced=23
-    catanhf; # introduced=23
-    cbrt;
-    cbrtf;
-    cbrtl; # introduced=21
-    ccos; # introduced=23
-    ccosf; # introduced=23
-    ccosh; # introduced=23
-    ccoshf; # introduced=23
-    ceil;
-    ceilf;
-    ceill;
-    cexp; # introduced=23
-    cexpf; # introduced=23
-    cimag; # introduced=23
-    cimagf; # introduced=23
-    cimagl; # introduced=23
-    conj; # introduced=23
-    conjf; # introduced=23
-    conjl; # introduced=23
-    copysign;
-    copysignf;
-    copysignl;
-    cos;
-    cosf;
-    cosh;
-    coshf;
-    coshl; # introduced=21
-    cosl; # introduced=21
-    cproj; # introduced=23
-    cprojf; # introduced=23
-    cprojl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    creal; # introduced=23
-    crealf; # introduced=23
-    creall; # introduced=23
-    csin; # introduced=23
-    csinf; # introduced=23
-    csinh; # introduced=23
-    csinhf; # introduced=23
-    csqrt; # introduced=23
-    csqrtf; # introduced=23
-    csqrtl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    ctan; # introduced=23
-    ctanf; # introduced=23
-    ctanh; # introduced=23
-    ctanhf; # introduced=23
-    drem;
-    dremf;
-    erf;
-    erfc;
-    erfcf;
-    erfcl; # introduced=21
-    erff;
-    erfl; # introduced=21
-    exp;
-    exp2;
-    exp2f;
-    exp2l; # introduced=21
-    expf;
-    expl; # introduced=21
-    expm1;
-    expm1f;
-    expm1l; # introduced=21
-    fabs;
-    fabsf;
-    fabsl;
-    fdim;
-    fdimf;
-    fdiml;
-    feclearexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fedisableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feenableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feholdexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feraiseexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fetestexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feupdateenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    finite;
-    finitef;
-    floor;
-    floorf;
-    floorl;
-    fma;
-    fmaf;
-    fmal; # introduced=21
-    fmax;
-    fmaxf;
-    fmaxl;
-    fmin;
-    fminf;
-    fminl;
-    fmod;
-    fmodf;
-    fmodl; # introduced=21
-    frexp;
-    frexpf;
-    frexpl; # introduced=21
-    gamma;
-    gamma_r;
-    gammaf;
-    gammaf_r;
-    hypot;
-    hypotf;
-    hypotl; # introduced=21
-    ilogb;
-    ilogbf;
-    ilogbl;
-    j0;
-    j0f;
-    j1;
-    j1f;
-    jn;
-    jnf;
-    ldexpf;
-    ldexpl;
-    lgamma;
-    lgamma_r;
-    lgammaf;
-    lgammaf_r;
-    lgammal; # introduced=21
-    lgammal_r; # introduced=23
-    llrint;
-    llrintf;
-    llrintl; # introduced=21
-    llround;
-    llroundf;
-    llroundl;
-    log;
-    log10;
-    log10f;
-    log10l; # introduced=21
-    log1p;
-    log1pf;
-    log1pl; # introduced=21
-    log2; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2f; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2l; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logb;
-    logbf;
-    logbl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logf;
-    logl; # introduced=21
-    lrint;
-    lrintf;
-    lrintl; # introduced=21
-    lround;
-    lroundf;
-    lroundl;
-    modf;
-    modff;
-    modfl; # introduced=21
-    nan; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanl; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=13 introduced-x86_64=21
-    nearbyint;
-    nearbyintf;
-    nearbyintl; # introduced=21
-    nextafter;
-    nextafterf;
-    nextafterl; # introduced=21
-    nexttoward; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    nexttowardf;
-    nexttowardl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    pow;
-    powf;
-    powl; # introduced=21
-    remainder;
-    remainderf;
-    remainderl; # introduced=21
-    remquo;
-    remquof;
-    remquol; # introduced=21
-    rint;
-    rintf;
-    rintl; # introduced=21
-    round;
-    roundf;
-    roundl;
-    scalb;
-    scalbf;
-    scalbln; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnf; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnl; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalbn;
-    scalbnf;
-    scalbnl;
-    signgam; # var
-    significand;
-    significandf;
-    significandl; # introduced=21
-    sin;
-    sincos;
-    sincosf;
-    sincosl;
-    sinf;
-    sinh;
-    sinhf;
-    sinhl; # introduced=21
-    sinl; # introduced=21
-    sqrt;
-    sqrtf;
-    sqrtl; # introduced=21
-    tan;
-    tanf;
-    tanh;
-    tanhf;
-    tanhl; # introduced=21
-    tanl; # introduced=21
-    tgamma;
-    tgammaf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    tgammal; # introduced=21
-    trunc;
-    truncf;
-    truncl;
-    y0;
-    y0f;
-    y1;
-    y1f;
-    yn;
-    ynf;
-  local:
-    *;
-};
-
-LIBC_O { # introduced=O
-  global:
-    cacoshl;
-    cacosl;
-    casinhl;
-    casinl;
-    catanhl;
-    catanl;
-    ccoshl;
-    ccosl;
-    cexpl;
-    clog;
-    clogf;
-    clogl;
-    cpow;
-    cpowf;
-    cpowl;
-    csinhl;
-    csinl;
-    ctanhl;
-    ctanl;
-} LIBC;
-
diff --git a/libm/libm.x86.map b/libm/libm.x86.map
deleted file mode 100644
index 550c39b..0000000
--- a/libm/libm.x86.map
+++ /dev/null
@@ -1,297 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __fe_dfl_env; # var
-    __signbit;
-    __signbitf;
-    __signbitl;
-    acos;
-    acosf;
-    acosh;
-    acoshf;
-    acoshl; # introduced=21
-    acosl; # introduced=21
-    asin;
-    asinf;
-    asinh;
-    asinhf;
-    asinhl; # introduced=21
-    asinl; # introduced=21
-    atan;
-    atan2;
-    atan2f;
-    atan2l; # introduced=21
-    atanf;
-    atanh;
-    atanhf;
-    atanhl; # introduced=21
-    atanl; # introduced=21
-    cabs; # introduced=23
-    cabsf; # introduced=23
-    cabsl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    cacos; # introduced=23
-    cacosf; # introduced=23
-    cacosh; # introduced=23
-    cacoshf; # introduced=23
-    carg; # introduced=23
-    cargf; # introduced=23
-    cargl; # introduced=23
-    casin; # introduced=23
-    casinf; # introduced=23
-    casinh; # introduced=23
-    casinhf; # introduced=23
-    catan; # introduced=23
-    catanf; # introduced=23
-    catanh; # introduced=23
-    catanhf; # introduced=23
-    cbrt;
-    cbrtf;
-    cbrtl; # introduced=21
-    ccos; # introduced=23
-    ccosf; # introduced=23
-    ccosh; # introduced=23
-    ccoshf; # introduced=23
-    ceil;
-    ceilf;
-    ceill;
-    cexp; # introduced=23
-    cexpf; # introduced=23
-    cimag; # introduced=23
-    cimagf; # introduced=23
-    cimagl; # introduced=23
-    conj; # introduced=23
-    conjf; # introduced=23
-    conjl; # introduced=23
-    copysign;
-    copysignf;
-    copysignl;
-    cos;
-    cosf;
-    cosh;
-    coshf;
-    coshl; # introduced=21
-    cosl; # introduced=21
-    cproj; # introduced=23
-    cprojf; # introduced=23
-    cprojl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    creal; # introduced=23
-    crealf; # introduced=23
-    creall; # introduced=23
-    csin; # introduced=23
-    csinf; # introduced=23
-    csinh; # introduced=23
-    csinhf; # introduced=23
-    csqrt; # introduced=23
-    csqrtf; # introduced=23
-    csqrtl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    ctan; # introduced=23
-    ctanf; # introduced=23
-    ctanh; # introduced=23
-    ctanhf; # introduced=23
-    drem;
-    dremf;
-    erf;
-    erfc;
-    erfcf;
-    erfcl; # introduced=21
-    erff;
-    erfl; # introduced=21
-    exp;
-    exp2;
-    exp2f;
-    exp2l; # introduced=21
-    expf;
-    expl; # introduced=21
-    expm1;
-    expm1f;
-    expm1l; # introduced=21
-    fabs;
-    fabsf;
-    fabsl;
-    fdim;
-    fdimf;
-    fdiml;
-    feclearexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fedisableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feenableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feholdexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feraiseexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fetestexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feupdateenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    finite;
-    finitef;
-    floor;
-    floorf;
-    floorl;
-    fma;
-    fmaf;
-    fmal; # introduced=21
-    fmax;
-    fmaxf;
-    fmaxl;
-    fmin;
-    fminf;
-    fminl;
-    fmod;
-    fmodf;
-    fmodl; # introduced=21
-    frexp;
-    frexpf;
-    frexpl; # introduced=21
-    gamma;
-    gamma_r;
-    gammaf;
-    gammaf_r;
-    hypot;
-    hypotf;
-    hypotl; # introduced=21
-    ilogb;
-    ilogbf;
-    ilogbl;
-    j0;
-    j0f;
-    j1;
-    j1f;
-    jn;
-    jnf;
-    ldexpf;
-    ldexpl;
-    lgamma;
-    lgamma_r;
-    lgammaf;
-    lgammaf_r;
-    lgammal; # introduced=21
-    lgammal_r; # introduced=23
-    llrint;
-    llrintf;
-    llrintl; # introduced=21
-    llround;
-    llroundf;
-    llroundl;
-    log;
-    log10;
-    log10f;
-    log10l; # introduced=21
-    log1p;
-    log1pf;
-    log1pl; # introduced=21
-    log2; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2f; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2l; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logb;
-    logbf;
-    logbl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logf;
-    logl; # introduced=21
-    lrint;
-    lrintf;
-    lrintl; # introduced=21
-    lround;
-    lroundf;
-    lroundl;
-    modf;
-    modff;
-    modfl; # introduced=21
-    nan; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanl; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=13 introduced-x86_64=21
-    nearbyint;
-    nearbyintf;
-    nearbyintl; # introduced=21
-    nextafter;
-    nextafterf;
-    nextafterl; # introduced=21
-    nexttoward; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    nexttowardf;
-    nexttowardl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    pow;
-    powf;
-    powl; # introduced=21
-    remainder;
-    remainderf;
-    remainderl; # introduced=21
-    remquo;
-    remquof;
-    remquol; # introduced=21
-    rint;
-    rintf;
-    rintl; # introduced=21
-    round;
-    roundf;
-    roundl;
-    scalb;
-    scalbf;
-    scalbln; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnf; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnl; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalbn;
-    scalbnf;
-    scalbnl;
-    signgam; # var
-    significand;
-    significandf;
-    significandl; # introduced=21
-    sin;
-    sincos;
-    sincosf;
-    sincosl;
-    sinf;
-    sinh;
-    sinhf;
-    sinhl; # introduced=21
-    sinl; # introduced=21
-    sqrt;
-    sqrtf;
-    sqrtl; # introduced=21
-    tan;
-    tanf;
-    tanh;
-    tanhf;
-    tanhl; # introduced=21
-    tanl; # introduced=21
-    tgamma;
-    tgammaf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    tgammal; # introduced=21
-    trunc;
-    truncf;
-    truncl;
-    y0;
-    y0f;
-    y1;
-    y1f;
-    yn;
-    ynf;
-  local:
-    *;
-};
-
-LIBC_O { # introduced=O
-  global:
-    cacoshl;
-    cacosl;
-    casinhl;
-    casinl;
-    catanhl;
-    catanl;
-    ccoshl;
-    ccosl;
-    cexpl;
-    clog;
-    clogf;
-    clogl;
-    cpow;
-    cpowf;
-    cpowl;
-    csinhl;
-    csinl;
-    ctanhl;
-    ctanl;
-} LIBC;
-
diff --git a/libm/libm.x86_64.map b/libm/libm.x86_64.map
deleted file mode 100644
index 550c39b..0000000
--- a/libm/libm.x86_64.map
+++ /dev/null
@@ -1,297 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-LIBC {
-  global:
-    __fe_dfl_env; # var
-    __signbit;
-    __signbitf;
-    __signbitl;
-    acos;
-    acosf;
-    acosh;
-    acoshf;
-    acoshl; # introduced=21
-    acosl; # introduced=21
-    asin;
-    asinf;
-    asinh;
-    asinhf;
-    asinhl; # introduced=21
-    asinl; # introduced=21
-    atan;
-    atan2;
-    atan2f;
-    atan2l; # introduced=21
-    atanf;
-    atanh;
-    atanhf;
-    atanhl; # introduced=21
-    atanl; # introduced=21
-    cabs; # introduced=23
-    cabsf; # introduced=23
-    cabsl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    cacos; # introduced=23
-    cacosf; # introduced=23
-    cacosh; # introduced=23
-    cacoshf; # introduced=23
-    carg; # introduced=23
-    cargf; # introduced=23
-    cargl; # introduced=23
-    casin; # introduced=23
-    casinf; # introduced=23
-    casinh; # introduced=23
-    casinhf; # introduced=23
-    catan; # introduced=23
-    catanf; # introduced=23
-    catanh; # introduced=23
-    catanhf; # introduced=23
-    cbrt;
-    cbrtf;
-    cbrtl; # introduced=21
-    ccos; # introduced=23
-    ccosf; # introduced=23
-    ccosh; # introduced=23
-    ccoshf; # introduced=23
-    ceil;
-    ceilf;
-    ceill;
-    cexp; # introduced=23
-    cexpf; # introduced=23
-    cimag; # introduced=23
-    cimagf; # introduced=23
-    cimagl; # introduced=23
-    conj; # introduced=23
-    conjf; # introduced=23
-    conjl; # introduced=23
-    copysign;
-    copysignf;
-    copysignl;
-    cos;
-    cosf;
-    cosh;
-    coshf;
-    coshl; # introduced=21
-    cosl; # introduced=21
-    cproj; # introduced=23
-    cprojf; # introduced=23
-    cprojl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    creal; # introduced=23
-    crealf; # introduced=23
-    creall; # introduced=23
-    csin; # introduced=23
-    csinf; # introduced=23
-    csinh; # introduced=23
-    csinhf; # introduced=23
-    csqrt; # introduced=23
-    csqrtf; # introduced=23
-    csqrtl; # introduced-arm=21 introduced-arm64=23 introduced-mips=21 introduced-mips64=23 introduced-x86=21 introduced-x86_64=23
-    ctan; # introduced=23
-    ctanf; # introduced=23
-    ctanh; # introduced=23
-    ctanhf; # introduced=23
-    drem;
-    dremf;
-    erf;
-    erfc;
-    erfcf;
-    erfcl; # introduced=21
-    erff;
-    erfl; # introduced=21
-    exp;
-    exp2;
-    exp2f;
-    exp2l; # introduced=21
-    expf;
-    expl; # introduced=21
-    expm1;
-    expm1f;
-    expm1l; # introduced=21
-    fabs;
-    fabsf;
-    fabsl;
-    fdim;
-    fdimf;
-    fdiml;
-    feclearexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fedisableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feenableexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fegetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feholdexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feraiseexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetexceptflag; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fesetround; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    fetestexcept; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    feupdateenv; # introduced-arm=21 introduced-arm64=21 introduced-mips=21 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    finite;
-    finitef;
-    floor;
-    floorf;
-    floorl;
-    fma;
-    fmaf;
-    fmal; # introduced=21
-    fmax;
-    fmaxf;
-    fmaxl;
-    fmin;
-    fminf;
-    fminl;
-    fmod;
-    fmodf;
-    fmodl; # introduced=21
-    frexp;
-    frexpf;
-    frexpl; # introduced=21
-    gamma;
-    gamma_r;
-    gammaf;
-    gammaf_r;
-    hypot;
-    hypotf;
-    hypotl; # introduced=21
-    ilogb;
-    ilogbf;
-    ilogbl;
-    j0;
-    j0f;
-    j1;
-    j1f;
-    jn;
-    jnf;
-    ldexpf;
-    ldexpl;
-    lgamma;
-    lgamma_r;
-    lgammaf;
-    lgammaf_r;
-    lgammal; # introduced=21
-    lgammal_r; # introduced=23
-    llrint;
-    llrintf;
-    llrintl; # introduced=21
-    llround;
-    llroundf;
-    llroundl;
-    log;
-    log10;
-    log10f;
-    log10l; # introduced=21
-    log1p;
-    log1pf;
-    log1pl; # introduced=21
-    log2; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2f; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    log2l; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logb;
-    logbf;
-    logbl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    logf;
-    logl; # introduced=21
-    lrint;
-    lrintf;
-    lrintl; # introduced=21
-    lround;
-    lroundf;
-    lroundl;
-    modf;
-    modff;
-    modfl; # introduced=21
-    nan; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    nanl; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=13 introduced-x86_64=21
-    nearbyint;
-    nearbyintf;
-    nearbyintl; # introduced=21
-    nextafter;
-    nextafterf;
-    nextafterl; # introduced=21
-    nexttoward; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    nexttowardf;
-    nexttowardl; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    pow;
-    powf;
-    powl; # introduced=21
-    remainder;
-    remainderf;
-    remainderl; # introduced=21
-    remquo;
-    remquof;
-    remquol; # introduced=21
-    rint;
-    rintf;
-    rintl; # introduced=21
-    round;
-    roundf;
-    roundl;
-    scalb;
-    scalbf;
-    scalbln; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnf; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalblnl; # introduced-arm=9 introduced-arm64=21 introduced-mips=9 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
-    scalbn;
-    scalbnf;
-    scalbnl;
-    signgam; # var
-    significand;
-    significandf;
-    significandl; # introduced=21
-    sin;
-    sincos;
-    sincosf;
-    sincosl;
-    sinf;
-    sinh;
-    sinhf;
-    sinhl; # introduced=21
-    sinl; # introduced=21
-    sqrt;
-    sqrtf;
-    sqrtl; # introduced=21
-    tan;
-    tanf;
-    tanh;
-    tanhf;
-    tanhl; # introduced=21
-    tanl; # introduced=21
-    tgamma;
-    tgammaf; # introduced-arm=13 introduced-arm64=21 introduced-mips=13 introduced-mips64=21 introduced-x86=9 introduced-x86_64=21
-    tgammal; # introduced=21
-    trunc;
-    truncf;
-    truncl;
-    y0;
-    y0f;
-    y1;
-    y1f;
-    yn;
-    ynf;
-  local:
-    *;
-};
-
-LIBC_O { # introduced=O
-  global:
-    cacoshl;
-    cacosl;
-    casinhl;
-    casinl;
-    catanhl;
-    catanl;
-    ccoshl;
-    ccosl;
-    cexpl;
-    clog;
-    clogf;
-    clogl;
-    cpow;
-    cpowf;
-    cpowl;
-    csinhl;
-    csinl;
-    ctanhl;
-    ctanl;
-} LIBC;
-
diff --git a/libm/upstream-freebsd/lib/msun/ld128/e_powl.c b/libm/upstream-freebsd/lib/msun/ld128/e_powl.c
index 15a57dd..2f3ee55 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/e_powl.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/e_powl.c
@@ -32,7 +32,7 @@
  *	1. Compute and return log2(x) in two pieces:
  *		log2(x) = w1 + w2,
  *	   where w1 has 113-53 = 60 bit trailing zeros.
- *	2. Perform y*log2(x) = n+y' by simulating muti-precision
+ *	2. Perform y*log2(x) = n+y' by simulating multi-precision
  *	   arithmetic, where |y'|<=0.5.
  *	3. Return x**y = 2**n*exp(y'*log2)
  *
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/ld128/e_powl.c 336362 2018-07-17 07:42:14Z bde $");
+__FBSDID("$FreeBSD: head/lib/msun/ld128/e_powl.c 342651 2018-12-31 15:43:06Z pfg $");
 
 #include <float.h>
 #include <math.h>
diff --git a/libm/upstream-freebsd/lib/msun/ld128/e_rem_pio2l.h b/libm/upstream-freebsd/lib/msun/ld128/e_rem_pio2l.h
index 5d78c4d..1ed79ae 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/e_rem_pio2l.h
+++ b/libm/upstream-freebsd/lib/msun/ld128/e_rem_pio2l.h
@@ -14,7 +14,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/lib/msun/ld128/e_rem_pio2l.h 336545 2018-07-20 12:42:24Z bde $");
 
 /* ld128 version of __ieee754_rem_pio2l(x,y)
  * 
@@ -74,14 +74,9 @@
 	if (ex < BIAS + 45 || ex == BIAS + 45 &&
 	    u.bits.manh < 0x921fb54442d1LL) {
 	    /* |x| ~< 2^45*(pi/2), medium size */
-	    /* Use a specialized rint() to get fn.  Assume round-to-nearest. */
-	    fn = x*invpio2+0x1.8p112;
-	    fn = fn-0x1.8p112;
-#ifdef HAVE_EFFICIENT_I64RINT
+	    /* TODO: use only double precision for fn, as in expl(). */
+	    fn = rnintl(x * invpio2);
 	    n  = i64rint(fn);
-#else
-	    n  = fn;
-#endif
 	    r  = x-fn*pio2_1;
 	    w  = fn*pio2_1t;	/* 1st round good to 180 bit */
 	    {
diff --git a/libm/upstream-freebsd/lib/msun/ld128/k_expl.h b/libm/upstream-freebsd/lib/msun/ld128/k_expl.h
index 4c041e8..b80d00e 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/k_expl.h
+++ b/libm/upstream-freebsd/lib/msun/ld128/k_expl.h
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/ld128/k_expl.h 326219 2017-11-26 02:00:33Z pfg $");
+__FBSDID("$FreeBSD: head/lib/msun/ld128/k_expl.h 336545 2018-07-20 12:42:24Z bde $");
 
 /*
  * ld128 version of k_expl.h.  See ../ld80/s_expl.c for most comments.
@@ -244,16 +244,8 @@
 	int n, n2;
 
 	/* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */
-	/* Use a specialized rint() to get fn.  Assume round-to-nearest. */
-	/* XXX assume no extra precision for the additions, as for trig fns. */
-	/* XXX this set of comments is now quadruplicated. */
-	/* XXX but see ../src/e_exp.c for a fix using double_t. */
-	fn = (double)x * INV_L + 0x1.8p52 - 0x1.8p52;
-#if defined(HAVE_EFFICIENT_IRINT)
+	fn = rnint((double)x * INV_L);
 	n = irint(fn);
-#else
-	n = (int)fn;
-#endif
 	n2 = (unsigned)n % INTERVALS;
 	/* Depend on the sign bit being propagated: */
 	*kp = n >> LOG2_INTERVALS;
diff --git a/libm/upstream-freebsd/lib/msun/ld128/s_expl.c b/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
index 53bc04a..f4c18be 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/ld128/s_expl.c 326219 2017-11-26 02:00:33Z pfg $");
+__FBSDID("$FreeBSD: head/lib/msun/ld128/s_expl.c 336545 2018-07-20 12:42:24Z bde $");
 
 /*
  * ld128 version of s_expl.c.  See ../ld80/s_expl.c for most comments.
@@ -268,13 +268,8 @@
 	}
 
 	/* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */
-	/* Use a specialized rint() to get fn.  Assume round-to-nearest. */
-	fn = (double)x * INV_L + 0x1.8p52 - 0x1.8p52;
-#if defined(HAVE_EFFICIENT_IRINT)
+	fn = rnint((double)x * INV_L);
 	n = irint(fn);
-#else
-	n = (int)fn;
-#endif
 	n2 = (unsigned)n % INTERVALS;
 	k = n >> LOG2_INTERVALS;
 	r1 = x - fn * L1;
diff --git a/libm/upstream-freebsd/lib/msun/src/e_j0.c b/libm/upstream-freebsd/lib/msun/src/e_j0.c
index cfa71c2..6bca542 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_j0.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_j0.c
@@ -11,7 +11,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/src/e_j0.c 336089 2018-07-08 16:26:13Z markj $");
+__FBSDID("$FreeBSD: head/lib/msun/src/e_j0.c 343023 2019-01-14 15:48:35Z pfg $");
 
 /* __ieee754_j0(x), __ieee754_y0(x)
  * Bessel function of the first and second kinds of order zero.
@@ -80,7 +80,7 @@
 S03  =  5.13546550207318111446e-07, /* 0x3EA13B54, 0xCE84D5A9 */
 S04  =  1.16614003333790000205e-09; /* 0x3E1408BC, 0xF4745D8F */
 
-static const double zero = 0.0;
+static const double zero = 0, qrtr = 0.25;
 
 double
 __ieee754_j0(double x)
@@ -97,7 +97,7 @@
 		c = cos(x);
 		ss = s-c;
 		cc = s+c;
-		if(ix<0x7fe00000) {  /* make sure x+x not overflow */
+		if(ix<0x7fe00000) {  /* Make sure x+x does not overflow. */
 		    z = -cos(x+x);
 		    if ((s*c)<zero) cc = z/ss;
 		    else 	    ss = z/cc;
@@ -123,9 +123,9 @@
 	r =  z*(R02+z*(R03+z*(R04+z*R05)));
 	s =  one+z*(S01+z*(S02+z*(S03+z*S04)));
 	if(ix < 0x3FF00000) {	/* |x| < 1.00 */
-	    return one + z*(-0.25+(r/s));
+	    return one + z*((r/s)-qrtr);
 	} else {
-	    u = 0.5*x;
+	    u = x/2;
 	    return((one+u)*(one-u)+z*(r/s));
 	}
 }
@@ -374,6 +374,7 @@
 static __inline double
 qzero(double x)
 {
+	static const double eighth = 0.125;
 	const double *p,*q;
 	double s,r,z;
 	int32_t ix;
@@ -386,5 +387,5 @@
 	z = one/(x*x);
 	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
 	s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
-	return (-.125 + r/s)/x;
+	return (r/s-eighth)/x;
 }
diff --git a/libm/upstream-freebsd/lib/msun/src/e_j0f.c b/libm/upstream-freebsd/lib/msun/src/e_j0f.c
index e53b218..714caac 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_j0f.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_j0f.c
@@ -14,7 +14,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/src/e_j0f.c 283032 2015-05-17 16:27:06Z kargl $");
+__FBSDID("$FreeBSD: head/lib/msun/src/e_j0f.c 343023 2019-01-14 15:48:35Z pfg $");
 
 /*
  * See e_j0.c for complete comments.
@@ -42,7 +42,7 @@
 S03  =  5.1354652442e-07, /* 0x3509daa6 */
 S04  =  1.1661400734e-09; /* 0x30a045e8 */
 
-static const float zero = 0.0;
+static const float zero = 0, qrtr = 0.25;
 
 float
 __ieee754_j0f(float x)
@@ -59,7 +59,7 @@
 		c = cosf(x);
 		ss = s-c;
 		cc = s+c;
-		if(ix<0x7f000000) {  /* make sure x+x not overflow */
+		if(ix<0x7f000000) {  /* Make sure x+x does not overflow. */
 		    z = -cosf(x+x);
 		    if ((s*c)<zero) cc = z/ss;
 		    else 	    ss = z/cc;
@@ -85,9 +85,9 @@
 	r =  z*(R02+z*(R03+z*(R04+z*R05)));
 	s =  one+z*(S01+z*(S02+z*(S03+z*S04)));
 	if(ix < 0x3F800000) {	/* |x| < 1.00 */
-	    return one + z*((float)-0.25+(r/s));
+	    return one + z*((r/s)-qrtr);
 	} else {
-	    u = (float)0.5*x;
+	    u = x/2;
 	    return((one+u)*(one-u)+z*(r/s));
 	}
 }
@@ -328,6 +328,7 @@
 static __inline float
 qzerof(float x)
 {
+	static const float eighth = 0.125;
 	const float *p,*q;
 	float s,r,z;
 	int32_t ix;
@@ -340,5 +341,5 @@
 	z = one/(x*x);
 	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
 	s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
-	return (-(float).125 + r/s)/x;
+	return (r/s-eighth)/x;
 }
diff --git a/libm/upstream-freebsd/lib/msun/src/e_pow.c b/libm/upstream-freebsd/lib/msun/src/e_pow.c
index 411dd52..b4f6a5a 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_pow.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_pow.c
@@ -10,7 +10,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/src/e_pow.c 336362 2018-07-17 07:42:14Z bde $");
+__FBSDID("$FreeBSD: head/lib/msun/src/e_pow.c 342851 2019-01-07 17:35:09Z pfg $");
 
 /* __ieee754_pow(x,y) return x**y
  *
@@ -133,7 +133,7 @@
 		k = (iy>>20)-0x3ff;	   /* exponent */
 		if(k>20) {
 		    j = ly>>(52-k);
-		    if((j<<(52-k))==ly) yisint = 2-(j&1);
+		    if(((u_int32_t)j<<(52-k))==ly) yisint = 2-(j&1);
 		} else if(ly==0) {
 		    j = iy>>(20-k);
 		    if((j<<(20-k))==iy) yisint = 2-(j&1);
diff --git a/libm/upstream-freebsd/lib/msun/src/e_rem_pio2.c b/libm/upstream-freebsd/lib/msun/src/e_rem_pio2.c
index be2630b..3e62c2b 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_rem_pio2.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_rem_pio2.c
@@ -14,7 +14,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/lib/msun/src/e_rem_pio2.c 336545 2018-07-20 12:42:24Z bde $");
 
 /* __ieee754_rem_pio2(x,y)
  * 
@@ -127,14 +127,8 @@
 	}
 	if(ix<0x413921fb) {	/* |x| ~< 2^20*(pi/2), medium size */
 medium:
-	    /* Use a specialized rint() to get fn.  Assume round-to-nearest. */
-	    STRICT_ASSIGN(double,fn,x*invpio2+0x1.8p52);
-	    fn = fn-0x1.8p52;
-#ifdef HAVE_EFFICIENT_IRINT
+	    fn = rnint((double_t)x*invpio2);
 	    n  = irint(fn);
-#else
-	    n  = (int32_t)fn;
-#endif
 	    r  = x-fn*pio2_1;
 	    w  = fn*pio2_1t;	/* 1st round good to 85 bit */
 	    {
diff --git a/libm/upstream-freebsd/lib/msun/src/e_rem_pio2f.c b/libm/upstream-freebsd/lib/msun/src/e_rem_pio2f.c
index f1ee7a0..2a89d27 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_rem_pio2f.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_rem_pio2f.c
@@ -15,7 +15,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/lib/msun/src/e_rem_pio2f.c 336545 2018-07-20 12:42:24Z bde $");
 
 /* __ieee754_rem_pio2f(x,y)
  *
@@ -55,14 +55,8 @@
 	ix = hx&0x7fffffff;
     /* 33+53 bit pi is good enough for medium size */
 	if(ix<0x4dc90fdb) {		/* |x| ~< 2^28*(pi/2), medium size */
-	    /* Use a specialized rint() to get fn.  Assume round-to-nearest. */
-	    STRICT_ASSIGN(double,fn,x*invpio2+0x1.8p52);
-	    fn = fn-0x1.8p52;
-#ifdef HAVE_EFFICIENT_IRINT
+	    fn = rnint((float_t)x*invpio2);
 	    n  = irint(fn);
-#else
-	    n  = (int32_t)fn;
-#endif
 	    r  = x-fn*pio2_1;
 	    w  = fn*pio2_1t;
 	    *y = r-w;
diff --git a/libm/upstream-freebsd/lib/msun/src/k_rem_pio2.c b/libm/upstream-freebsd/lib/msun/src/k_rem_pio2.c
index 81363d4..0869e03 100644
--- a/libm/upstream-freebsd/lib/msun/src/k_rem_pio2.c
+++ b/libm/upstream-freebsd/lib/msun/src/k_rem_pio2.c
@@ -12,7 +12,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/src/k_rem_pio2.c 298896 2016-05-01 19:37:33Z pfg $");
+__FBSDID("$FreeBSD: head/lib/msun/src/k_rem_pio2.c 342651 2018-12-31 15:43:06Z pfg $");
 
 /*
  * __kernel_rem_pio2(x,y,e0,nx,prec)
@@ -52,7 +52,7 @@
  *			64-bit  precision	2
  *			113-bit precision	3
  *		The actual value is the sum of them. Thus for 113-bit
- *		precison, one may have to do something like:
+ *		precision, one may have to do something like:
  *
  *		long double t,w,r_head, r_tail;
  *		t = (long double)y[2] + (long double)y[1];
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cbrt.c b/libm/upstream-freebsd/lib/msun/src/s_cbrt.c
index d75ad0b..268425e 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cbrt.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cbrt.c
@@ -13,8 +13,9 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/src/s_cbrt.c 298896 2016-05-01 19:37:33Z pfg $");
+__FBSDID("$FreeBSD: head/lib/msun/src/s_cbrt.c 342563 2018-12-28 01:34:08Z jhibbits $");
 
+#include <float.h>
 #include "math.h"
 #include "math_private.h"
 
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cpow.c b/libm/upstream-freebsd/lib/msun/src/s_cpow.c
index 9be5c51..1cb99aa 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cpow.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cpow.c
@@ -44,11 +44,12 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/src/s_cpow.c 336299 2018-07-15 00:23:10Z mmacy $");
+__FBSDID("$FreeBSD: head/lib/msun/src/s_cpow.c 336563 2018-07-20 18:27:30Z dim $");
 
 #include <complex.h>
 #include <float.h>
 #include <math.h>
+#include "math_private.h"
 
 double complex
 cpow(double complex a, double complex z)
@@ -60,7 +61,7 @@
 	y = cimag (z);
 	absa = cabs (a);
 	if (absa == 0.0) {
-		return (0.0 + 0.0 * I);
+		return (CMPLX(0.0, 0.0));
 	}
 	arga = carg (a);
 	r = pow (absa, x);
@@ -69,6 +70,6 @@
 		r = r * exp (-y * arga);
 		theta = theta + y * log (absa);
 	}
-	w = r * cos (theta) + (r * sin (theta)) * I;
+	w = CMPLX(r * cos (theta),  r * sin (theta));
 	return (w);
 }
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cpowf.c b/libm/upstream-freebsd/lib/msun/src/s_cpowf.c
index 6e27f57..a2ef525 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cpowf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cpowf.c
@@ -44,10 +44,11 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/src/s_cpowf.c 336299 2018-07-15 00:23:10Z mmacy $");
+__FBSDID("$FreeBSD: head/lib/msun/src/s_cpowf.c 336563 2018-07-20 18:27:30Z dim $");
 
 #include <complex.h>
 #include <math.h>
+#include "math_private.h"
 
 float complex
 cpowf(float complex a, float complex z)
@@ -59,7 +60,7 @@
 	y = cimagf(z);
 	absa = cabsf (a);
 	if (absa == 0.0f) {
-		return (0.0f + 0.0f * I);
+		return (CMPLXF(0.0f, 0.0f));
 	}
 	arga = cargf (a);
 	r = powf (absa, x);
@@ -68,6 +69,6 @@
 		r = r * expf (-y * arga);
 		theta = theta + y * logf (absa);
 	}
-	w = r * cosf (theta) + (r * sinf (theta)) * I;
+	w = CMPLXF(r * cosf (theta), r * sinf (theta));
 	return (w);
 }
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cpowl.c b/libm/upstream-freebsd/lib/msun/src/s_cpowl.c
index fcb5c7f..f9c6373 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cpowl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cpowl.c
@@ -44,10 +44,11 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/src/s_cpowl.c 336299 2018-07-15 00:23:10Z mmacy $");
+__FBSDID("$FreeBSD: head/lib/msun/src/s_cpowl.c 336563 2018-07-20 18:27:30Z dim $");
 
 #include <complex.h>
 #include <math.h>
+#include "math_private.h"
 
 long double complex
 cpowl(long double complex a, long double complex z)
@@ -59,7 +60,7 @@
 	y = cimagl(z);
 	absa = cabsl(a);
 	if (absa == 0.0L) {
-		return (0.0L + 0.0L * I);
+		return (CMPLXL(0.0L, 0.0L));
 	}
 	arga = cargl(a);
 	r = powl(absa, x);
@@ -68,6 +69,6 @@
 		r = r * expl(-y * arga);
 		theta = theta + y * logl(absa);
 	}
-	w = r * cosl(theta) + (r * sinl(theta)) * I;
+	w = CMPLXL(r * cosl(theta), r * sinl(theta));
 	return (w);
 }
diff --git a/libm/upstream-freebsd/lib/msun/src/s_cproj.c b/libm/upstream-freebsd/lib/msun/src/s_cproj.c
index 3083f2b..7677b5f 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cproj.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cproj.c
@@ -27,9 +27,10 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/lib/msun/src/s_cproj.c 326219 2017-11-26 02:00:33Z pfg $");
+__FBSDID("$FreeBSD: head/lib/msun/src/s_cproj.c 342563 2018-12-28 01:34:08Z jhibbits $");
 
 #include <complex.h>
+#include <float.h>
 #include <math.h>
 
 #include "math_private.h"
diff --git a/libm/upstream-freebsd/lib/msun/src/s_erf.c b/libm/upstream-freebsd/lib/msun/src/s_erf.c
index e1d63bc..3e39d80 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_erf.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_erf.c
@@ -11,7 +11,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/lib/msun/src/s_erf.c 342563 2018-12-28 01:34:08Z jhibbits $");
 
 /* double erf(double x)
  * double erfc(double x)
@@ -107,7 +107,7 @@
  *	   	erfc/erf(NaN) is NaN
  */
 
-
+#include <float.h>
 #include "math.h"
 #include "math_private.h"
 
diff --git a/linker/Android.bp b/linker/Android.bp
index 0e3484a..73328da 100644
--- a/linker/Android.bp
+++ b/linker/Android.bp
@@ -4,7 +4,6 @@
     recovery_available: true,
 
     srcs: [
-        "linker_allocator.cpp",
         "linker_memory.cpp",
     ],
     cflags: [
@@ -86,6 +85,7 @@
         "linker_phdr.cpp",
         "linker_sdk_versions.cpp",
         "linker_soinfo.cpp",
+        "linker_tls.cpp",
         "linker_utils.cpp",
         "rt.cpp",
     ],
@@ -103,6 +103,7 @@
     name: "linker_sources_arm64",
     srcs: [
         "arch/arm64/begin.S",
+        "arch/arm64/tlsdesc_resolver.S",
     ],
 }
 
@@ -175,6 +176,11 @@
         "-Wextra",
         "-Wunused",
         "-Werror",
+
+        // Define _USING_LIBCXX so <stdatomic.h> defers to the <atomic> header. When a Soong module
+        // uses the platform libc++, Soong automatically passes this macro, but the dynamic linker
+        // links against libc++ manually.
+        "-D_USING_LIBCXX",
     ],
 
     // TODO: split out the asflags.
@@ -279,11 +285,19 @@
     symlinks: ["linker_asan"],
     recovery_available: true,
     multilib: {
+        lib32: {
+            cflags: ["-DLIB_PATH=\"lib\""],
+        },
         lib64: {
+            cflags: ["-DLIB_PATH=\"lib64\""],
             suffix: "64",
         },
     },
     system_shared_libs: [],
+
+    // Opt out of native_coverage when opting out of system_shared_libs
+    native_coverage: false,
+
     target: {
         android: {
             static_libs: ["libdebuggerd_handler_fallback"],
@@ -351,7 +365,46 @@
     nocrt: true,
     system_shared_libs: [],
 
+    // Opt out of native_coverage when opting out of system_shared_libs
+    native_coverage: false,
+
     sanitize: {
         never: true,
     },
 }
+
+cc_test {
+    name: "linker-unit-tests",
+
+    cflags: [
+        "-g",
+        "-Wall",
+        "-Wextra",
+        "-Wunused",
+        "-Werror",
+    ],
+
+    // We need to access Bionic private headers in the linker.
+    include_dirs: ["bionic/libc"],
+
+    srcs: [
+        // Tests.
+        "linker_block_allocator_test.cpp",
+        "linker_config_test.cpp",
+        "linked_list_test.cpp",
+        "linker_sleb128_test.cpp",
+        "linker_utils_test.cpp",
+
+        // Parts of the linker that we're testing.
+        "linker_block_allocator.cpp",
+        "linker_config.cpp",
+        "linker_test_globals.cpp",
+        "linker_utils.cpp",
+    ],
+
+    static_libs: [
+        "libasync_safe",
+        "libbase",
+        "liblog",
+    ],
+}
diff --git a/linker/Android.mk b/linker/Android.mk
deleted file mode 100644
index ea7451c..0000000
--- a/linker/Android.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(call first-makefiles-under,$(LOCAL_PATH))
diff --git a/linker/MODULE_LICENSE_BSD b/linker/MODULE_LICENSE_APACHE2
similarity index 100%
rename from linker/MODULE_LICENSE_BSD
rename to linker/MODULE_LICENSE_APACHE2
diff --git a/linker/NOTICE b/linker/NOTICE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/linker/NOTICE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/linker/arch/arm64/tlsdesc_resolver.S b/linker/arch/arm64/tlsdesc_resolver.S
new file mode 100644
index 0000000..ef46839
--- /dev/null
+++ b/linker/arch/arm64/tlsdesc_resolver.S
@@ -0,0 +1,203 @@
+/*
+ * Copyright (C) 2019 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 <private/bionic_asm.h>
+#include <private/bionic_asm_tls.h>
+
+.globl __tls_get_addr
+
+// These resolver functions must preserve every register except x0. They set x0
+// to the offset of the TLS symbol relative to the thread pointer.
+
+ENTRY_PRIVATE(tlsdesc_resolver_static)
+  ldr x0, [x0, #8]
+  ret
+END(tlsdesc_resolver_static)
+
+ENTRY_PRIVATE(tlsdesc_resolver_dynamic)
+  stp x19, x20, [sp, #-32]!
+  .cfi_def_cfa_offset 32
+  .cfi_rel_offset x19, 0
+  .cfi_rel_offset x20, 8
+  stp x21, x22, [sp, #16]
+  .cfi_rel_offset x21, 16
+  .cfi_rel_offset x22, 24
+
+  mrs x19, tpidr_el0            // __get_tls()
+  ldr x20, [x19, #(TLS_SLOT_DTV * 8)]
+  ldr x21, [x20]                // TlsDtv::generation
+
+  ldr x0, [x0, #8]              // TlsDynamicResolverArg*
+  ldr x22, [x0]                 // TlsDynamicResolverArg::generation
+
+  cmp x21, x22
+  b.lo .fallback
+
+  ldr x21, [x0, #8]             // TlsIndex::module
+  ldr x22, [x0, #16]            // TlsIndex::offset
+  ldr x21, [x20, x21, lsl #3]   // TlsDtv::modules[module]
+  cbz x21, .fallback
+  add x0, x21, x22
+  sub x0, x0, x19
+
+  ldp x21, x22, [sp, #16]
+  .cfi_remember_state
+  .cfi_restore x21
+  .cfi_restore x22
+  ldp x19, x20, [sp], #32
+  .cfi_adjust_cfa_offset -32
+  .cfi_restore x19
+  .cfi_restore x20
+  ret
+
+.fallback:
+  .cfi_restore_state
+  ldp x21, x22, [sp, #16]
+  .cfi_restore x21
+  .cfi_restore x22
+  ldp x19, x20, [sp], #32
+  .cfi_adjust_cfa_offset -32
+  .cfi_restore x19
+  .cfi_restore x20
+  b tlsdesc_resolver_dynamic_slow_path
+END(tlsdesc_resolver_dynamic)
+
+#define SAVE_REG(x, slot)                 \
+    str x, [sp, #((slot) * 8)];           \
+    .cfi_rel_offset x, (slot) * 8;        \
+
+#define SAVE_GPR_PAIR(x, y, slot)         \
+    stp x, y, [sp, #((slot) * 8)];        \
+    .cfi_rel_offset x, (slot) * 8;        \
+    .cfi_rel_offset y, ((slot) + 1) * 8;  \
+
+#define SAVE_VEC_PAIR(x, y, slot)         \
+    stp x, y, [sp, #((slot) * 8)];        \
+    .cfi_rel_offset x, (slot) * 8;        \
+    .cfi_rel_offset y, ((slot) + 2) * 8;  \
+
+#define RESTORE_REG(x, slot)              \
+    ldr x, [sp, #((slot) * 8)];           \
+    .cfi_restore x;                       \
+
+#define RESTORE_REG_PAIR(x, y, slot)      \
+    ldp x, y, [sp, #((slot) * 8)];        \
+    .cfi_restore x;                       \
+    .cfi_restore y;                       \
+
+// On entry, x0 is the address of a TlsDynamicResolverArg object rather than
+// the TlsDescriptor address passed to the original resolver function.
+ENTRY_PRIVATE(tlsdesc_resolver_dynamic_slow_path)
+  sub sp, sp, #(8 * 84)
+  .cfi_def_cfa_offset (8 * 84)
+  SAVE_GPR_PAIR(x29, x30, 0)
+  mov x29, sp
+
+  // Avoid leaking the contents of the shadow call stack register (x18) into
+  // memory. x19 through x29 are callee-save registers, so we do not need to
+  // save them.
+  SAVE_GPR_PAIR(x1,  x2,  2)
+  SAVE_GPR_PAIR(x3,  x4,  4)
+  SAVE_GPR_PAIR(x5,  x6,  6)
+  SAVE_GPR_PAIR(x7,  x8,  8)
+  SAVE_GPR_PAIR(x9,  x10, 10)
+  SAVE_GPR_PAIR(x11, x12, 12)
+  SAVE_GPR_PAIR(x13, x14, 14)
+  SAVE_GPR_PAIR(x15, x16, 16)
+  SAVE_REG(x17, 18)
+
+  SAVE_VEC_PAIR(q0,  q1,  20)
+  SAVE_VEC_PAIR(q2,  q3,  24)
+  SAVE_VEC_PAIR(q4,  q5,  28)
+  SAVE_VEC_PAIR(q6,  q7,  32)
+  SAVE_VEC_PAIR(q8,  q9,  36)
+  SAVE_VEC_PAIR(q10, q11, 40)
+  SAVE_VEC_PAIR(q12, q13, 44)
+  SAVE_VEC_PAIR(q14, q15, 48)
+  SAVE_VEC_PAIR(q16, q17, 52)
+  SAVE_VEC_PAIR(q18, q19, 56)
+  SAVE_VEC_PAIR(q20, q21, 60)
+  SAVE_VEC_PAIR(q22, q23, 64)
+  SAVE_VEC_PAIR(q24, q25, 68)
+  SAVE_VEC_PAIR(q26, q27, 72)
+  SAVE_VEC_PAIR(q28, q29, 76)
+  SAVE_VEC_PAIR(q30, q31, 80)
+
+  add x0, x0, #8
+  bl __tls_get_addr
+  mrs x1, tpidr_el0 // __get_tls()
+  sub x0, x0, x1
+
+  RESTORE_REG_PAIR(q30, q31, 80)
+  RESTORE_REG_PAIR(q28, q29, 76)
+  RESTORE_REG_PAIR(q26, q27, 72)
+  RESTORE_REG_PAIR(q24, q25, 68)
+  RESTORE_REG_PAIR(q22, q23, 64)
+  RESTORE_REG_PAIR(q20, q21, 60)
+  RESTORE_REG_PAIR(q18, q19, 56)
+  RESTORE_REG_PAIR(q16, q17, 52)
+  RESTORE_REG_PAIR(q14, q15, 48)
+  RESTORE_REG_PAIR(q12, q13, 44)
+  RESTORE_REG_PAIR(q10, q11, 40)
+  RESTORE_REG_PAIR(q8,  q9,  36)
+  RESTORE_REG_PAIR(q6,  q7,  32)
+  RESTORE_REG_PAIR(q4,  q5,  28)
+  RESTORE_REG_PAIR(q2,  q3,  24)
+  RESTORE_REG_PAIR(q0,  q1,  20)
+
+  RESTORE_REG(x17, 18)
+  RESTORE_REG_PAIR(x15, x16, 16)
+  RESTORE_REG_PAIR(x13, x14, 14)
+  RESTORE_REG_PAIR(x11, x12, 12)
+  RESTORE_REG_PAIR(x9,  x10, 10)
+  RESTORE_REG_PAIR(x7,  x8,  8)
+  RESTORE_REG_PAIR(x5,  x6,  6)
+  RESTORE_REG_PAIR(x3,  x4,  4)
+  RESTORE_REG_PAIR(x1,  x2,  2)
+
+  RESTORE_REG_PAIR(x29, x30, 0)
+  add sp, sp, #(8 * 84)
+  .cfi_def_cfa_offset 0
+  ret
+END(tlsdesc_resolver_dynamic_slow_path)
+
+// The address of an unresolved weak TLS symbol evaluates to NULL with TLSDESC.
+// The value returned by this function is added to the thread pointer, so return
+// a negated thread pointer to cancel it out.
+ENTRY_PRIVATE(tlsdesc_resolver_unresolved_weak)
+  str x19, [sp, #-16]!
+  .cfi_def_cfa_offset 16
+  .cfi_rel_offset x19, 0
+  ldr x19, [x0, #8]
+  mrs x0, tpidr_el0             // __get_tls()
+  sub x0, x19, x0
+  ldr x19, [sp], #16
+  .cfi_def_cfa_offset 0
+  .cfi_restore x19
+  ret
+END(tlsdesc_resolver_unresolved_weak)
diff --git a/linker/ld.config.format.md b/linker/ld.config.format.md
index 686d6be..faf5cc8 100644
--- a/linker/ld.config.format.md
+++ b/linker/ld.config.format.md
@@ -79,5 +79,8 @@
 # and links it to default namespace
 namespace.ns.links = default
 namespace.ns.link.default.shared_libs = libc.so:libdl.so:libm.so:libstdc++.so
+
+# This defines what libraries are allowed to be loaded from ns1
+namespace.ns1.whitelisted = libsomething.so
 ```
 
diff --git a/linker/linked_list_test.cpp b/linker/linked_list_test.cpp
new file mode 100644
index 0000000..71a7d09
--- /dev/null
+++ b/linker/linked_list_test.cpp
@@ -0,0 +1,245 @@
+/*
+ * Copyright (C) 2013 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 <stdlib.h>
+#include <string>
+#include <sstream>
+
+#include <gtest/gtest.h>
+
+#include "linked_list.h"
+
+namespace {
+
+bool alloc_called = false;
+bool free_called = false;
+
+class LinkedListTestAllocator {
+ public:
+  typedef LinkedListEntry<const char> entry_t;
+
+  static entry_t* alloc() {
+    alloc_called = true;
+    return reinterpret_cast<entry_t*>(::malloc(sizeof(entry_t)));
+  }
+
+  static void free(entry_t* p) {
+    free_called = true;
+    ::free(p);
+  }
+ private:
+  DISALLOW_IMPLICIT_CONSTRUCTORS(LinkedListTestAllocator);
+};
+
+typedef LinkedList<const char, LinkedListTestAllocator> test_list_t;
+
+std::string test_list_to_string(test_list_t& list) {
+  std::stringstream ss;
+  list.for_each([&] (const char* c) {
+    ss << c;
+  });
+
+  return ss.str();
+}
+
+};
+
+TEST(linked_list, simple) {
+  alloc_called = free_called = false;
+  test_list_t list;
+  ASSERT_EQ("", test_list_to_string(list));
+  ASSERT_TRUE(!alloc_called);
+  ASSERT_TRUE(!free_called);
+  list.push_front("a");
+  ASSERT_TRUE(alloc_called);
+  ASSERT_TRUE(!free_called);
+  ASSERT_EQ("a", test_list_to_string(list));
+  list.push_front("b");
+  ASSERT_EQ("ba", test_list_to_string(list));
+  list.push_front("c");
+  list.push_front("d");
+  ASSERT_EQ("dcba", test_list_to_string(list));
+  ASSERT_TRUE(alloc_called);
+  ASSERT_TRUE(!free_called);
+  alloc_called = free_called = false;
+  list.remove_if([] (const char* c) {
+    return *c == 'c';
+  });
+
+  ASSERT_TRUE(!alloc_called);
+  ASSERT_TRUE(free_called);
+
+  ASSERT_EQ("dba", test_list_to_string(list));
+  alloc_called = free_called = false;
+  list.remove_if([] (const char* c) {
+    return *c == '2';
+  });
+  ASSERT_TRUE(!alloc_called);
+  ASSERT_TRUE(!free_called);
+  ASSERT_EQ("dba", test_list_to_string(list));
+  list.clear();
+  ASSERT_TRUE(!alloc_called);
+  ASSERT_TRUE(free_called);
+  ASSERT_EQ("", test_list_to_string(list));
+}
+
+TEST(linked_list, push_pop) {
+  test_list_t list;
+  list.push_front("b");
+  list.push_front("a");
+  ASSERT_EQ("ab", test_list_to_string(list));
+  list.push_back("c");
+  ASSERT_EQ("abc", test_list_to_string(list));
+  ASSERT_STREQ("a", list.pop_front());
+  ASSERT_EQ("bc", test_list_to_string(list));
+  ASSERT_STREQ("b", list.pop_front());
+  ASSERT_EQ("c", test_list_to_string(list));
+  ASSERT_STREQ("c", list.pop_front());
+  ASSERT_EQ("", test_list_to_string(list));
+  ASSERT_TRUE(list.pop_front() == nullptr);
+  list.push_back("r");
+  ASSERT_EQ("r", test_list_to_string(list));
+  ASSERT_STREQ("r", list.pop_front());
+  ASSERT_TRUE(list.pop_front() == nullptr);
+}
+
+TEST(linked_list, remove_if_then_pop) {
+  test_list_t list;
+  list.push_back("a");
+  list.push_back("b");
+  list.push_back("c");
+  list.push_back("d");
+  list.remove_if([](const char* c) {
+    return *c == 'b' || *c == 'c';
+  });
+
+  ASSERT_EQ("ad", test_list_to_string(list));
+  ASSERT_STREQ("a", list.pop_front());
+  ASSERT_EQ("d", test_list_to_string(list));
+  ASSERT_STREQ("d", list.pop_front());
+  ASSERT_TRUE(list.pop_front() == nullptr);
+}
+
+TEST(linked_list, remove_if_last_then_push_back) {
+  test_list_t list;
+
+  list.push_back("a");
+  list.push_back("b");
+  list.push_back("c");
+  list.push_back("d");
+
+  list.remove_if([](const char* c) {
+    return *c == 'c' || *c == 'd';
+  });
+
+  ASSERT_EQ("ab", test_list_to_string(list));
+  list.push_back("d");
+  ASSERT_EQ("abd", test_list_to_string(list));
+}
+
+TEST(linked_list, copy_to_array) {
+  test_list_t list;
+  const size_t max_size = 128;
+  const char* buf[max_size];
+  memset(buf, 0, sizeof(buf));
+
+  ASSERT_EQ(0U, list.copy_to_array(buf, max_size));
+  ASSERT_EQ(nullptr, buf[0]);
+
+  list.push_back("a");
+  list.push_back("b");
+  list.push_back("c");
+  list.push_back("d");
+
+  memset(buf, 0, sizeof(buf));
+  ASSERT_EQ(2U, list.copy_to_array(buf, 2));
+  ASSERT_STREQ("a", buf[0]);
+  ASSERT_STREQ("b", buf[1]);
+  ASSERT_EQ(nullptr, buf[2]);
+
+  ASSERT_EQ(4U, list.copy_to_array(buf, max_size));
+  ASSERT_STREQ("a", buf[0]);
+  ASSERT_STREQ("b", buf[1]);
+  ASSERT_STREQ("c", buf[2]);
+  ASSERT_STREQ("d", buf[3]);
+  ASSERT_EQ(nullptr, buf[4]);
+
+  memset(buf, 0, sizeof(buf));
+  list.remove_if([](const char* c) {
+    return *c != 'c';
+  });
+  ASSERT_EQ(1U, list.copy_to_array(buf, max_size));
+  ASSERT_STREQ("c", buf[0]);
+  ASSERT_EQ(nullptr, buf[1]);
+
+  memset(buf, 0, sizeof(buf));
+
+  list.remove_if([](const char* c) {
+    return *c == 'c';
+  });
+
+  ASSERT_EQ(0U, list.copy_to_array(buf, max_size));
+  ASSERT_EQ(nullptr, buf[0]);
+}
+
+TEST(linked_list, test_visit) {
+  test_list_t list;
+  list.push_back("a");
+  list.push_back("b");
+  list.push_back("c");
+  list.push_back("d");
+
+  int visits = 0;
+  std::stringstream ss;
+  bool result = list.visit([&](const char* c) {
+    ++visits;
+    ss << c;
+    return true;
+  });
+
+  ASSERT_TRUE(result);
+  ASSERT_EQ(4, visits);
+  ASSERT_EQ("abcd", ss.str());
+
+  visits = 0;
+  ss.str(std::string());
+
+  result = list.visit([&](const char* c) {
+    if (++visits == 3) {
+      return false;
+    }
+
+    ss << c;
+    return true;
+  });
+
+  ASSERT_TRUE(!result);
+  ASSERT_EQ(3, visits);
+  ASSERT_EQ("ab", ss.str());
+}
+
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 1f259e1..b59df73 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -65,8 +65,10 @@
 #include "linker_phdr.h"
 #include "linker_relocs.h"
 #include "linker_reloc_iterators.h"
+#include "linker_tls.h"
 #include "linker_utils.h"
 
+#include "private/bionic_globals.h"
 #include "android-base/macros.h"
 #include "android-base/strings.h"
 #include "android-base/stringprintf.h"
@@ -89,19 +91,21 @@
 static const char* const kLdConfigVndkLiteFilePath = "/system/etc/ld.config.vndk_lite.txt";
 
 #if defined(__LP64__)
-static const char* const kSystemLibDir     = "/system/lib64";
-static const char* const kOdmLibDir        = "/odm/lib64";
-static const char* const kVendorLibDir     = "/vendor/lib64";
-static const char* const kAsanSystemLibDir = "/data/asan/system/lib64";
-static const char* const kAsanOdmLibDir    = "/data/asan/odm/lib64";
-static const char* const kAsanVendorLibDir = "/data/asan/vendor/lib64";
+static const char* const kSystemLibDir        = "/system/lib64";
+static const char* const kOdmLibDir           = "/odm/lib64";
+static const char* const kVendorLibDir        = "/vendor/lib64";
+static const char* const kAsanSystemLibDir    = "/data/asan/system/lib64";
+static const char* const kAsanOdmLibDir       = "/data/asan/odm/lib64";
+static const char* const kAsanVendorLibDir    = "/data/asan/vendor/lib64";
+static const char* const kRuntimeApexLibDir   = "/apex/com.android.runtime/lib64";
 #else
-static const char* const kSystemLibDir     = "/system/lib";
-static const char* const kOdmLibDir        = "/odm/lib";
-static const char* const kVendorLibDir     = "/vendor/lib";
-static const char* const kAsanSystemLibDir = "/data/asan/system/lib";
-static const char* const kAsanOdmLibDir    = "/data/asan/odm/lib";
-static const char* const kAsanVendorLibDir = "/data/asan/vendor/lib";
+static const char* const kSystemLibDir        = "/system/lib";
+static const char* const kOdmLibDir           = "/odm/lib";
+static const char* const kVendorLibDir        = "/vendor/lib";
+static const char* const kAsanSystemLibDir    = "/data/asan/system/lib";
+static const char* const kAsanOdmLibDir       = "/data/asan/odm/lib";
+static const char* const kAsanVendorLibDir    = "/data/asan/vendor/lib";
+static const char* const kRuntimeApexLibDir   = "/apex/com.android.runtime/lib";
 #endif
 
 static const char* const kAsanLibDirPrefix = "/data/asan";
@@ -226,6 +230,44 @@
 }
 // END OF WORKAROUND
 
+// Workaround for dlopen(/system/lib(64)/<soname>) when .so is in /apex. http://b/121248172
+/**
+ * Translate /system path to /apex path if needed
+ * The workaround should work only when targetSdkVersion < Q.
+ *
+ * param out_name_to_apex pointing to /apex path
+ * return true if translation is needed
+ */
+static bool translateSystemPathToApexPath(const char* name, std::string* out_name_to_apex) {
+  static const char* const kSystemToRuntimeApexLibs[] = {
+    "libicuuc.so",
+    "libicui18n.so",
+  };
+  // New mapping for new apex should be added below
+
+  // Nothing to do if target sdk version is Q or above
+  if (get_application_target_sdk_version() >= __ANDROID_API_Q__) {
+    return false;
+  }
+
+  // If the path isn't /system/lib, there's nothing to do.
+  if (name == nullptr || dirname(name) != kSystemLibDir) {
+    return false;
+  }
+
+  const char* base_name = basename(name);
+
+  for (const char* soname : kSystemToRuntimeApexLibs) {
+    if (strcmp(base_name, soname) == 0) {
+      *out_name_to_apex = std::string(kRuntimeApexLibDir) + "/" + base_name;
+      return true;
+    }
+  }
+
+  return false;
+}
+// End Workaround for dlopen(/system/lib/<soname>) when .so is in /apex.
+
 static std::vector<std::string> g_ld_preload_names;
 
 static bool g_anonymous_namespace_initialized;
@@ -373,11 +415,9 @@
 //
 // Intended to be called by libc's __gnu_Unwind_Find_exidx().
 _Unwind_Ptr do_dl_unwind_find_exidx(_Unwind_Ptr pc, int* pcount) {
-  for (soinfo* si = solist_get_head(); si != 0; si = si->next) {
-    if ((pc >= si->base) && (pc < (si->base + si->size))) {
-        *pcount = si->ARM_exidx_count;
-        return reinterpret_cast<_Unwind_Ptr>(si->ARM_exidx);
-    }
+  if (soinfo* si = find_containing_library(reinterpret_cast<void*>(pc))) {
+    *pcount = si->ARM_exidx_count;
+    return reinterpret_cast<_Unwind_Ptr>(si->ARM_exidx);
   }
   *pcount = 0;
   return 0;
@@ -534,6 +574,10 @@
     allocator_.free(ptr);
   }
 
+  static void purge() {
+    allocator_.purge();
+  }
+
  private:
   static LinkerBlockAllocator allocator_;
 };
@@ -551,6 +595,10 @@
   static void free(T* ptr) {
     SizeBasedAllocator<sizeof(T)>::free(ptr);
   }
+
+  static void purge() {
+    SizeBasedAllocator<sizeof(T)>::purge();
+  }
 };
 
 class LoadTask {
@@ -601,6 +649,9 @@
   }
 
   void set_fd(int fd, bool assume_ownership) {
+    if (fd_ != -1 && close_fd_) {
+      close(fd_);
+    }
     fd_ = fd;
     close_fd_ = assume_ownership;
   }
@@ -645,9 +696,9 @@
     return elf_reader.Read(realpath, fd_, file_offset_, file_size);
   }
 
-  bool load() {
+  bool load(address_space_params* address_space) {
     ElfReader& elf_reader = get_elf_reader();
-    if (!elf_reader.Load(extinfo_)) {
+    if (!elf_reader.Load(address_space)) {
       return false;
     }
 
@@ -885,8 +936,18 @@
 soinfo* find_containing_library(const void* p) {
   ElfW(Addr) address = reinterpret_cast<ElfW(Addr)>(p);
   for (soinfo* si = solist_get_head(); si != nullptr; si = si->next) {
-    if (address >= si->base && address - si->base < si->size) {
-      return si;
+    if (address < si->base || address - si->base >= si->size) {
+      continue;
+    }
+    ElfW(Addr) vaddr = address - si->load_bias;
+    for (size_t i = 0; i != si->phnum; ++i) {
+      const ElfW(Phdr)* phdr = &si->phdr[i];
+      if (phdr->p_type != PT_LOAD) {
+        continue;
+      }
+      if (vaddr >= phdr->p_vaddr && vaddr < phdr->p_vaddr + phdr->p_memsz) {
+        return si;
+      }
     }
   }
   return nullptr;
@@ -1063,7 +1124,7 @@
                         ZipArchiveCache* zip_archive_cache,
                         const char* name, soinfo *needed_by,
                         off64_t* file_offset, std::string* realpath) {
-  TRACE("[ opening %s at namespace %s]", name, ns->get_name());
+  TRACE("[ opening %s from namespace %s ]", name, ns->get_name());
 
   // If the name contains a slash, we should attempt to open it directly and not search the paths.
   if (strchr(name, '/') != nullptr) {
@@ -1105,14 +1166,6 @@
     fd = open_library_on_paths(zip_archive_cache, name, file_offset, ns->get_default_library_paths(), realpath);
   }
 
-  // TODO(dimitry): workaround for http://b/26394120 (the grey-list)
-  if (fd == -1 && ns->is_greylist_enabled() && is_greylisted(ns, name, needed_by)) {
-    // try searching for it on default_namespace default_library_path
-    fd = open_library_on_paths(zip_archive_cache, name, file_offset,
-                               g_default_namespace.get_default_library_paths(), realpath);
-  }
-  // END OF WORKAROUND
-
   return fd;
 }
 
@@ -1212,6 +1265,9 @@
   const char* name = task->get_name();
   const android_dlextinfo* extinfo = task->get_extinfo();
 
+  LD_LOG(kLogDlopen, "load_library(ns=%s, task=%s, flags=0x%x, realpath=%s)", ns->get_name(), name,
+         rtld_flags, realpath.c_str());
+
   if ((file_offset % PAGE_SIZE) != 0) {
     DL_ERR("file offset for the library \"%s\" is not page-aligned: %" PRId64, name, file_offset);
     return false;
@@ -1237,8 +1293,10 @@
   if (extinfo == nullptr || (extinfo->flags & ANDROID_DLEXT_FORCE_LOAD) == 0) {
     soinfo* si = nullptr;
     if (find_loaded_library_by_inode(ns, file_stat, file_offset, search_linked_namespaces, &si)) {
-      TRACE("library \"%s\" is already loaded under different name/path \"%s\" - "
-            "will return existing soinfo", name, si->get_realpath());
+      LD_LOG(kLogDlopen,
+             "load_library(ns=%s, task=%s): Already loaded under different name/path \"%s\" - "
+             "will return existing soinfo",
+             ns->get_name(), name, si->get_realpath());
       task->set_soinfo(si);
       return true;
     }
@@ -1339,6 +1397,8 @@
 #endif
 
   for_each_dt_needed(task->get_elf_reader(), [&](const char* name) {
+    LD_LOG(kLogDlopen, "load_library(ns=%s, task=%s): Adding DT_NEEDED task: %s",
+           ns->get_name(), task->get_name(), name);
     load_tasks->push_back(LoadTask::create(name, si, ns, task->get_readers_map()));
   });
 
@@ -1454,17 +1514,24 @@
 
   if (!namespace_link.is_accessible(soname.c_str())) {
     // the library is not accessible via namespace_link
+    LD_LOG(kLogDlopen,
+           "find_library_in_linked_namespace(ns=%s, task=%s): Not accessible (soname=%s)",
+           ns->get_name(), task->get_name(), soname.c_str());
     return false;
   }
 
   // if library is already loaded - return it
   if (loaded) {
+    LD_LOG(kLogDlopen, "find_library_in_linked_namespace(ns=%s, task=%s): Already loaded",
+           ns->get_name(), task->get_name());
     task->set_soinfo(candidate);
     return true;
   }
 
   // returning true with empty soinfo means that the library is okay to be
   // loaded in the namespace but has not yet been loaded there before.
+  LD_LOG(kLogDlopen, "find_library_in_linked_namespace(ns=%s, task=%s): Ok to load", ns->get_name(),
+         task->get_name());
   task->set_soinfo(nullptr);
   return true;
 }
@@ -1478,26 +1545,47 @@
   soinfo* candidate;
 
   if (find_loaded_library_by_soname(ns, task->get_name(), search_linked_namespaces, &candidate)) {
+    LD_LOG(kLogDlopen,
+           "find_library_internal(ns=%s, task=%s): Already loaded (by soname): %s",
+           ns->get_name(), task->get_name(), candidate->get_realpath());
     task->set_soinfo(candidate);
     return true;
   }
 
   // Library might still be loaded, the accurate detection
   // of this fact is done by load_library.
-  TRACE("[ \"%s\" find_loaded_library_by_soname failed (*candidate=%s@%p). Trying harder...]",
-      task->get_name(), candidate == nullptr ? "n/a" : candidate->get_realpath(), candidate);
+  TRACE("[ \"%s\" find_loaded_library_by_soname failed (*candidate=%s@%p). Trying harder... ]",
+        task->get_name(), candidate == nullptr ? "n/a" : candidate->get_realpath(), candidate);
 
   if (load_library(ns, task, zip_archive_cache, load_tasks, rtld_flags, search_linked_namespaces)) {
     return true;
   }
 
+  // TODO(dimitry): workaround for http://b/26394120 (the grey-list)
+  if (ns->is_greylist_enabled() && is_greylisted(ns, task->get_name(), task->get_needed_by())) {
+    // For the libs in the greylist, switch to the default namespace and then
+    // try the load again from there. The library could be loaded from the
+    // default namespace or from another namespace (e.g. runtime) that is linked
+    // from the default namespace.
+    LD_LOG(kLogDlopen,
+           "find_library_internal(ns=%s, task=%s): Greylisted library - trying namespace %s",
+           ns->get_name(), task->get_name(), g_default_namespace.get_name());
+    ns = &g_default_namespace;
+    if (load_library(ns, task, zip_archive_cache, load_tasks, rtld_flags,
+                     search_linked_namespaces)) {
+      return true;
+    }
+  }
+  // END OF WORKAROUND
+
   if (search_linked_namespaces) {
     // if a library was not found - look into linked namespaces
     // preserve current dlerror in the case it fails.
     DlErrorRestorer dlerror_restorer;
+    LD_LOG(kLogDlopen, "find_library_internal(ns=%s, task=%s): Trying %zu linked namespaces",
+           ns->get_name(), task->get_name(), ns->linked_namespaces().size());
     for (auto& linked_namespace : ns->linked_namespaces()) {
-      if (find_library_in_linked_namespace(linked_namespace,
-                                           task)) {
+      if (find_library_in_linked_namespace(linked_namespace, task)) {
         if (task->get_soinfo() == nullptr) {
           // try to load the library - once namespace boundary is crossed
           // we need to load a library within separate load_group
@@ -1508,6 +1596,9 @@
           // Otherwise, the libs in the linked namespace won't get symbols from
           // the global group.
           if (load_library(linked_namespace.linked_namespace(), task, zip_archive_cache, load_tasks, rtld_flags, false)) {
+            LD_LOG(
+                kLogDlopen, "find_library_internal(ns=%s, task=%s): Found in linked namespace %s",
+                ns->get_name(), task->get_name(), linked_namespace.linked_namespace()->get_name());
             return true;
           }
         } else {
@@ -1595,6 +1686,9 @@
     task->set_extinfo(is_dt_needed ? nullptr : extinfo);
     task->set_dt_needed(is_dt_needed);
 
+    LD_LOG(kLogDlopen, "find_libraries(ns=%s): task=%s, is_dt_needed=%d", ns->get_name(),
+           task->get_name(), is_dt_needed);
+
     // Note: start from the namespace that is stored in the LoadTask. This namespace
     // is different from the current namespace when the LoadTask is for a transitive
     // dependency and the lib that created the LoadTask is not found in the
@@ -1638,10 +1732,34 @@
       load_list.push_back(task);
     }
   }
-  shuffle(&load_list);
+  bool reserved_address_recursive = false;
+  if (extinfo) {
+    reserved_address_recursive = extinfo->flags & ANDROID_DLEXT_RESERVED_ADDRESS_RECURSIVE;
+  }
+  if (!reserved_address_recursive) {
+    // Shuffle the load order in the normal case, but not if we are loading all
+    // the libraries to a reserved address range.
+    shuffle(&load_list);
+  }
+
+  // Set up address space parameters.
+  address_space_params extinfo_params, default_params;
+  size_t relro_fd_offset = 0;
+  if (extinfo) {
+    if (extinfo->flags & ANDROID_DLEXT_RESERVED_ADDRESS) {
+      extinfo_params.start_addr = extinfo->reserved_addr;
+      extinfo_params.reserved_size = extinfo->reserved_size;
+      extinfo_params.must_use_address = true;
+    } else if (extinfo->flags & ANDROID_DLEXT_RESERVED_ADDRESS_HINT) {
+      extinfo_params.start_addr = extinfo->reserved_addr;
+      extinfo_params.reserved_size = extinfo->reserved_size;
+    }
+  }
 
   for (auto&& task : load_list) {
-    if (!task->load()) {
+    address_space_params* address_space =
+        (reserved_address_recursive || !task->is_dt_needed()) ? &extinfo_params : &default_params;
+    if (!task->load(address_space)) {
       return false;
     }
   }
@@ -1652,6 +1770,7 @@
     if (!si->is_linked() && !si->prelink_image()) {
       return false;
     }
+    register_soinfo_tls(si);
   }
 
   // Step 4: Construct the global group. Note: DF_1_GLOBAL bit of a library is
@@ -1746,11 +1865,17 @@
 
     soinfo_list_t global_group = local_group_ns->get_global_group();
     bool linked = local_group.visit([&](soinfo* si) {
-      // Even though local group may contain accessible soinfos from other namesapces
+      // Even though local group may contain accessible soinfos from other namespaces
       // we should avoid linking them (because if they are not linked -> they
       // are in the local_group_roots and will be linked later).
       if (!si->is_linked() && si->get_primary_namespace() == local_group_ns) {
-        if (!si->link_image(global_group, local_group, extinfo) ||
+        const android_dlextinfo* link_extinfo = nullptr;
+        if (si == soinfos[0] || reserved_address_recursive) {
+          // Only forward extinfo for the first library unless the recursive
+          // flag is set.
+          link_extinfo = extinfo;
+        }
+        if (!si->link_image(global_group, local_group, link_extinfo, &relro_fd_offset) ||
             !get_cfi_shadow()->AfterLoad(si, solist_get_head())) {
           return false;
         }
@@ -1887,6 +2012,7 @@
            si->get_realpath(),
            si);
     notify_gdb_of_unload(si);
+    unregister_soinfo_tls(si);
     get_cfi_shadow()->BeforeUnload(si);
     soinfo_free(si);
   }
@@ -2059,13 +2185,16 @@
   android_namespace_t* ns = get_caller_namespace(caller);
 
   LD_LOG(kLogDlopen,
-         "dlopen(name=\"%s\", flags=0x%x, extinfo=%s, caller=\"%s\", caller_ns=%s@%p) ...",
+         "dlopen(name=\"%s\", flags=0x%x, extinfo=%s, caller=\"%s\", caller_ns=%s@%p, targetSdkVersion=%i) ...",
          name,
          flags,
          android_dlextinfo_to_string(extinfo).c_str(),
          caller == nullptr ? "(null)" : caller->get_realpath(),
          ns == nullptr ? "(null)" : ns->get_name(),
-         ns);
+         ns,
+         get_application_target_sdk_version());
+
+  auto purge_guard = android::base::make_scope_guard([&]() { purge_unused_memory(); });
 
   auto failure_guard = android::base::make_scope_guard(
       [&]() { LD_LOG(kLogDlopen, "... dlopen failed: %s", linker_get_error_buffer()); });
@@ -2097,6 +2226,32 @@
     }
   }
 
+  // Workaround for dlopen(/system/lib/<soname>) when .so is in /apex. http://b/121248172
+  // The workaround works only when targetSdkVersion < Q.
+  std::string name_to_apex;
+  if (translateSystemPathToApexPath(name, &name_to_apex)) {
+    const char* new_name = name_to_apex.c_str();
+    LD_LOG(kLogDlopen, "dlopen considering translation from %s to APEX path %s",
+           name,
+           new_name);
+    // Some APEXs could be optionally disabled. Only translate the path
+    // when the old file is absent and the new file exists.
+    // TODO(b/124218500): Re-enable it once app compat issue is resolved
+    /*
+    if (file_exists(name)) {
+      LD_LOG(kLogDlopen, "dlopen %s exists, not translating", name);
+    } else
+    */
+    if (!file_exists(new_name)) {
+      LD_LOG(kLogDlopen, "dlopen %s does not exist, not translating",
+             new_name);
+    } else {
+      LD_LOG(kLogDlopen, "dlopen translation accepted: using %s", new_name);
+      name = new_name;
+    }
+  }
+  // End Workaround for dlopen(/system/lib/<soname>) when .so is in /apex.
+
   std::string asan_name_holder;
 
   const char* translated_name = name;
@@ -2234,9 +2389,26 @@
 
   if (sym != nullptr) {
     uint32_t bind = ELF_ST_BIND(sym->st_info);
+    uint32_t type = ELF_ST_TYPE(sym->st_info);
 
     if ((bind == STB_GLOBAL || bind == STB_WEAK) && sym->st_shndx != 0) {
-      *symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
+      if (type == STT_TLS) {
+        // For a TLS symbol, dlsym returns the address of the current thread's
+        // copy of the symbol. This function may allocate a DTV and/or storage
+        // for the source TLS module. (Allocating a DTV isn't necessary if the
+        // symbol is part of static TLS, but it's simpler to reuse
+        // __tls_get_addr.)
+        soinfo_tls* tls_module = found->get_tls();
+        if (tls_module == nullptr) {
+          DL_ERR("TLS symbol \"%s\" in solib \"%s\" with no TLS segment",
+                 sym_name, found->get_realpath());
+          return false;
+        }
+        const TlsIndex ti { tls_module->module_id, sym->st_value };
+        *symbol = TLS_GET_ADDR(&ti);
+      } else {
+        *symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
+      }
       failure_guard.Disable();
       LD_LOG(kLogDlsym,
              "... dlsym successful: sym_name=\"%s\", sym_ver=\"%s\", found in=\"%s\", address=%p",
@@ -2666,16 +2838,33 @@
 #else
 static ElfW(Addr) get_addend(ElfW(Rel)* rel, ElfW(Addr) reloc_addr) {
   if (ELFW(R_TYPE)(rel->r_info) == R_GENERIC_RELATIVE ||
-      ELFW(R_TYPE)(rel->r_info) == R_GENERIC_IRELATIVE) {
+      ELFW(R_TYPE)(rel->r_info) == R_GENERIC_IRELATIVE ||
+      ELFW(R_TYPE)(rel->r_info) == R_GENERIC_TLS_DTPREL ||
+      ELFW(R_TYPE)(rel->r_info) == R_GENERIC_TLS_TPREL) {
     return *reinterpret_cast<ElfW(Addr)*>(reloc_addr);
   }
   return 0;
 }
 #endif
 
+static bool is_tls_reloc(ElfW(Word) type) {
+  switch (type) {
+    case R_GENERIC_TLS_DTPMOD:
+    case R_GENERIC_TLS_DTPREL:
+    case R_GENERIC_TLS_TPREL:
+    case R_GENERIC_TLSDESC:
+      return true;
+    default:
+      return false;
+  }
+}
+
 template<typename ElfRelIteratorT>
 bool soinfo::relocate(const VersionTracker& version_tracker, ElfRelIteratorT&& rel_iterator,
                       const soinfo_list_t& global_group, const soinfo_list_t& local_group) {
+  const size_t tls_tp_base = __libc_shared_globals()->static_tls_layout.offset_thread_pointer();
+  std::vector<std::pair<TlsDescriptor*, size_t>> deferred_tlsdesc_relocs;
+
   for (size_t idx = 0; rel_iterator.has_next(); ++idx) {
     const auto rel = rel_iterator.next();
     if (rel == nullptr) {
@@ -2698,7 +2887,26 @@
     const ElfW(Sym)* s = nullptr;
     soinfo* lsi = nullptr;
 
-    if (sym != 0) {
+    if (sym == 0) {
+      // By convention in ld.bfd and lld, an omitted symbol on a TLS relocation
+      // is a reference to the current module.
+      if (is_tls_reloc(type)) {
+        lsi = this;
+      }
+    } else if (ELF_ST_BIND(symtab_[sym].st_info) == STB_LOCAL && is_tls_reloc(type)) {
+      // In certain situations, the Gold linker accesses a TLS symbol using a
+      // relocation to an STB_LOCAL symbol in .dynsym of either STT_SECTION or
+      // STT_TLS type. Bionic doesn't support these relocations, so issue an
+      // error. References:
+      //  - https://groups.google.com/d/topic/generic-abi/dJ4_Y78aQ2M/discussion
+      //  - https://sourceware.org/bugzilla/show_bug.cgi?id=17699
+      s = &symtab_[sym];
+      sym_name = get_string(s->st_name);
+      DL_ERR("unexpected TLS reference to local symbol \"%s\": "
+             "sym type %d, rel type %u (idx %zu of \"%s\")",
+             sym_name, ELF_ST_TYPE(s->st_info), type, idx, get_realpath());
+      return false;
+    } else {
       sym_name = get_string(symtab_[sym].st_name);
       const version_info* vi = nullptr;
 
@@ -2735,6 +2943,10 @@
           case R_GENERIC_GLOB_DAT:
           case R_GENERIC_RELATIVE:
           case R_GENERIC_IRELATIVE:
+          case R_GENERIC_TLS_DTPMOD:
+          case R_GENERIC_TLS_DTPREL:
+          case R_GENERIC_TLS_TPREL:
+          case R_GENERIC_TLSDESC:
 #if defined(__aarch64__)
           case R_AARCH64_ABS64:
           case R_AARCH64_ABS32:
@@ -2782,12 +2994,26 @@
           }
         }
 #endif
-        if (ELF_ST_TYPE(s->st_info) == STT_TLS) {
-          DL_ERR("unsupported ELF TLS symbol \"%s\" referenced by \"%s\"",
-                 sym_name, get_realpath());
-          return false;
+        if (is_tls_reloc(type)) {
+          if (ELF_ST_TYPE(s->st_info) != STT_TLS) {
+            DL_ERR("reference to non-TLS symbol \"%s\" from TLS relocation in \"%s\"",
+                   sym_name, get_realpath());
+            return false;
+          }
+          if (lsi->get_tls() == nullptr) {
+            DL_ERR("TLS relocation refers to symbol \"%s\" in solib \"%s\" with no TLS segment",
+                   sym_name, lsi->get_realpath());
+            return false;
+          }
+          sym_addr = s->st_value;
+        } else {
+          if (ELF_ST_TYPE(s->st_info) == STT_TLS) {
+            DL_ERR("reference to TLS symbol \"%s\" from non-TLS relocation in \"%s\"",
+                   sym_name, get_realpath());
+            return false;
+          }
+          sym_addr = lsi->resolve_symbol_address(s);
         }
-        sym_addr = lsi->resolve_symbol_address(s);
 #if !defined(__LP64__)
         if (protect_segments) {
           if (phdr_table_unprotect_segments(phdr, phnum, load_bias) < 0) {
@@ -2860,6 +3086,104 @@
           *reinterpret_cast<ElfW(Addr)*>(reloc) = ifunc_addr;
         }
         break;
+      case R_GENERIC_TLS_TPREL:
+        count_relocation(kRelocRelative);
+        MARK(rel->r_offset);
+        {
+          ElfW(Addr) tpoff = 0;
+          if (lsi == nullptr) {
+            // Unresolved weak relocation. Leave tpoff at 0 to resolve
+            // &weak_tls_symbol to __get_tls().
+          } else {
+            CHECK(lsi->get_tls() != nullptr); // We rejected a missing TLS segment above.
+            const TlsModule& mod = get_tls_module(lsi->get_tls()->module_id);
+            if (mod.static_offset != SIZE_MAX) {
+              tpoff += mod.static_offset - tls_tp_base;
+            } else {
+              DL_ERR("TLS symbol \"%s\" in dlopened \"%s\" referenced from \"%s\" using IE access model",
+                     sym_name, lsi->get_realpath(), get_realpath());
+              return false;
+            }
+          }
+          tpoff += sym_addr + addend;
+          TRACE_TYPE(RELO, "RELO TLS_TPREL %16p <- %16p %s\n",
+                     reinterpret_cast<void*>(reloc),
+                     reinterpret_cast<void*>(tpoff), sym_name);
+          *reinterpret_cast<ElfW(Addr)*>(reloc) = tpoff;
+        }
+        break;
+
+#if !defined(__aarch64__)
+      // Omit support for DTPMOD/DTPREL on arm64, at least until
+      // http://b/123385182 is fixed. arm64 uses TLSDESC instead.
+      case R_GENERIC_TLS_DTPMOD:
+        count_relocation(kRelocRelative);
+        MARK(rel->r_offset);
+        {
+          size_t module_id = 0;
+          if (lsi == nullptr) {
+            // Unresolved weak relocation. Evaluate the module ID to 0.
+          } else {
+            CHECK(lsi->get_tls() != nullptr); // We rejected a missing TLS segment above.
+            module_id = lsi->get_tls()->module_id;
+          }
+          TRACE_TYPE(RELO, "RELO TLS_DTPMOD %16p <- %zu %s\n",
+                     reinterpret_cast<void*>(reloc), module_id, sym_name);
+          *reinterpret_cast<ElfW(Addr)*>(reloc) = module_id;
+        }
+        break;
+      case R_GENERIC_TLS_DTPREL:
+        count_relocation(kRelocRelative);
+        MARK(rel->r_offset);
+        TRACE_TYPE(RELO, "RELO TLS_DTPREL %16p <- %16p %s\n",
+                   reinterpret_cast<void*>(reloc),
+                   reinterpret_cast<void*>(sym_addr + addend), sym_name);
+        *reinterpret_cast<ElfW(Addr)*>(reloc) = sym_addr + addend;
+        break;
+#endif  // !defined(__aarch64__)
+
+#if defined(__aarch64__)
+      // Bionic currently only implements TLSDESC for arm64. This implementation should work with
+      // other architectures, as long as the resolver functions are implemented.
+      case R_GENERIC_TLSDESC:
+        count_relocation(kRelocRelative);
+        MARK(rel->r_offset);
+        {
+          TlsDescriptor* desc = reinterpret_cast<TlsDescriptor*>(reloc);
+          if (lsi == nullptr) {
+            // Unresolved weak relocation.
+            desc->func = tlsdesc_resolver_unresolved_weak;
+            desc->arg = addend;
+            TRACE_TYPE(RELO, "RELO TLSDESC %16p <- unresolved weak 0x%zx %s\n",
+                       reinterpret_cast<void*>(reloc), static_cast<size_t>(addend), sym_name);
+          } else {
+            CHECK(lsi->get_tls() != nullptr); // We rejected a missing TLS segment above.
+            size_t module_id = lsi->get_tls()->module_id;
+            const TlsModule& mod = get_tls_module(module_id);
+            if (mod.static_offset != SIZE_MAX) {
+              desc->func = tlsdesc_resolver_static;
+              desc->arg = mod.static_offset - tls_tp_base + sym_addr + addend;
+              TRACE_TYPE(RELO, "RELO TLSDESC %16p <- static (0x%zx - 0x%zx + 0x%zx + 0x%zx) %s\n",
+                         reinterpret_cast<void*>(reloc), mod.static_offset, tls_tp_base,
+                         static_cast<size_t>(sym_addr), static_cast<size_t>(addend), sym_name);
+            } else {
+              tlsdesc_args_.push_back({
+                .generation = mod.first_generation,
+                .index.module_id = module_id,
+                .index.offset = sym_addr + addend,
+              });
+              // Defer the TLSDESC relocation until the address of the TlsDynamicResolverArg object
+              // is finalized.
+              deferred_tlsdesc_relocs.push_back({ desc, tlsdesc_args_.size() - 1 });
+              const TlsDynamicResolverArg& desc_arg = tlsdesc_args_.back();
+              TRACE_TYPE(RELO, "RELO TLSDESC %16p <- dynamic (gen %zu, mod %zu, off %zu) %s",
+                         reinterpret_cast<void*>(reloc), desc_arg.generation,
+                         desc_arg.index.module_id, desc_arg.index.offset, sym_name);
+            }
+          }
+        }
+        break;
+#endif  // defined(__aarch64__)
 
 #if defined(__aarch64__)
       case R_AARCH64_ABS64:
@@ -2961,14 +3285,6 @@
          */
         DL_ERR("%s R_AARCH64_COPY relocations are not supported", get_realpath());
         return false;
-      case R_AARCH64_TLS_TPREL64:
-        TRACE_TYPE(RELO, "RELO TLS_TPREL64 *** %16llx <- %16llx - %16llx\n",
-                   reloc, (sym_addr + addend), rel->r_offset);
-        break;
-      case R_AARCH64_TLSDESC:
-        TRACE_TYPE(RELO, "RELO TLSDESC *** %16llx <- %16llx - %16llx\n",
-                   reloc, (sym_addr + addend), rel->r_offset);
-        break;
 #elif defined(__x86_64__)
       case R_X86_64_32:
         count_relocation(kRelocRelative);
@@ -3038,6 +3354,16 @@
         return false;
     }
   }
+
+#if defined(__aarch64__)
+  // Bionic currently only implements TLSDESC for arm64.
+  for (const std::pair<TlsDescriptor*, size_t>& pair : deferred_tlsdesc_relocs) {
+    TlsDescriptor* desc = pair.first;
+    desc->func = tlsdesc_resolver_dynamic;
+    desc->arg = reinterpret_cast<size_t>(&tlsdesc_args_[pair.second]);
+  }
+#endif
+
   return true;
 }
 #endif  // !defined(__mips__)
@@ -3073,6 +3399,19 @@
                                   &ARM_exidx, &ARM_exidx_count);
 #endif
 
+  TlsSegment tls_segment;
+  if (__bionic_get_tls_segment(phdr, phnum, load_bias, &tls_segment)) {
+    if (!__bionic_check_tls_alignment(&tls_segment.alignment)) {
+      if (!relocating_linker) {
+        DL_ERR("TLS segment alignment in \"%s\" is not a power of 2: %zu",
+               get_realpath(), tls_segment.alignment);
+      }
+      return false;
+    }
+    tls_ = std::make_unique<soinfo_tls>();
+    tls_->segment = tls_segment;
+  }
+
   // Extract useful information from dynamic section.
   // Note that: "Except for the DT_NULL element at the end of the array,
   // and the relative order of DT_NEEDED elements, entries may appear in any order."
@@ -3438,13 +3777,14 @@
         // this is parsed after we have strtab initialized (see below).
         break;
 
+      case DT_TLSDESC_GOT:
+      case DT_TLSDESC_PLT:
+        // These DT entries are used for lazy TLSDESC relocations. Bionic
+        // resolves everything eagerly, so these can be ignored.
+        break;
+
       default:
         if (!relocating_linker) {
-          if (d->d_tag == DT_TLSDESC_GOT || d->d_tag == DT_TLSDESC_PLT) {
-            DL_ERR("unsupported ELF TLS DT entry in \"%s\"", get_realpath());
-            return false;
-          }
-
           const char* tag_name;
           if (d->d_tag == DT_RPATH) {
             tag_name = "DT_RPATH";
@@ -3530,7 +3870,7 @@
 }
 
 bool soinfo::link_image(const soinfo_list_t& global_group, const soinfo_list_t& local_group,
-                        const android_dlextinfo* extinfo) {
+                        const android_dlextinfo* extinfo, size_t* relro_fd_offset) {
   if (is_image_linked()) {
     // already linked.
     return true;
@@ -3670,14 +4010,14 @@
   /* Handle serializing/sharing the RELRO segment */
   if (extinfo && (extinfo->flags & ANDROID_DLEXT_WRITE_RELRO)) {
     if (phdr_table_serialize_gnu_relro(phdr, phnum, load_bias,
-                                       extinfo->relro_fd) < 0) {
+                                       extinfo->relro_fd, relro_fd_offset) < 0) {
       DL_ERR("failed serializing GNU RELRO section for \"%s\": %s",
              get_realpath(), strerror(errno));
       return false;
     }
   } else if (extinfo && (extinfo->flags & ANDROID_DLEXT_USE_RELRO)) {
     if (phdr_table_map_gnu_relro(phdr, phnum, load_bias,
-                                 extinfo->relro_fd) < 0) {
+                                 extinfo->relro_fd, relro_fd_offset) < 0) {
       DL_ERR("failed mapping GNU RELRO section for \"%s\": %s",
              get_realpath(), strerror(errno));
       return false;
@@ -3793,6 +4133,7 @@
 
   std::string ld_config_file_path = get_ld_config_file_path(executable_path);
 
+  INFO("[ Reading linker config \"%s\" ]", ld_config_file_path.c_str());
   if (!Config::read_binary_config(ld_config_file_path.c_str(),
                                   executable_path,
                                   g_is_asan,
@@ -3838,6 +4179,7 @@
     ns->set_isolated(ns_config->isolated());
     ns->set_default_library_paths(ns_config->search_paths());
     ns->set_permitted_paths(ns_config->permitted_paths());
+    ns->set_whitelisted_libs(ns_config->whitelisted_libs());
 
     namespaces[ns_config->name()] = ns;
     if (ns_config->visible()) {
@@ -3897,3 +4239,17 @@
   }
   return it->second;
 }
+
+void purge_unused_memory() {
+  // For now, we only purge the memory used by LoadTask because we know those
+  // are temporary objects.
+  //
+  // Purging other LinkerBlockAllocator hardly yields much because they hold
+  // information about namespaces and opened libraries, which are not freed
+  // when the control leaves the linker.
+  //
+  // Purging BionicAllocator may give us a few dirty pages back, but those pages
+  // would be already zeroed out, so they compress easily in ZRAM.  Therefore,
+  // it is not worth munmap()'ing those pages.
+  TypeBasedAllocator<LoadTask>::purge();
+}
diff --git a/linker/linker.h b/linker/linker.h
index 91d3ddf..4c89ceb 100644
--- a/linker/linker.h
+++ b/linker/linker.h
@@ -186,3 +186,11 @@
 
 void increment_dso_handle_reference_counter(void* dso_handle);
 void decrement_dso_handle_reference_counter(void* dso_handle);
+
+void purge_unused_memory();
+
+struct address_space_params {
+  void* start_addr = nullptr;
+  size_t reserved_size = 0;
+  bool must_use_address = false;
+};
diff --git a/linker/linker_allocator.cpp b/linker/linker_allocator.cpp
deleted file mode 100644
index 8b05a7e..0000000
--- a/linker/linker_allocator.cpp
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * Copyright (C) 2015 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 "linker_allocator.h"
-#include "linker_debug.h"
-#include "linker.h"
-
-#include <algorithm>
-#include <vector>
-
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <sys/prctl.h>
-#include <unistd.h>
-
-#include <async_safe/log.h>
-
-//
-// LinkerMemeoryAllocator is general purpose allocator
-// designed to provide the same functionality as the malloc/free/realloc
-// libc functions.
-//
-// On alloc:
-// If size is >= 1k allocator proxies malloc call directly to mmap
-// If size < 1k allocator uses SmallObjectAllocator for the size
-// rounded up to the nearest power of two.
-//
-// On free:
-//
-// For a pointer allocated using proxy-to-mmap allocator unmaps
-// the memory.
-//
-// For a pointer allocated using SmallObjectAllocator it adds
-// the block to free_blocks_list_. If the number of free pages reaches 2,
-// SmallObjectAllocator munmaps one of the pages keeping the other one
-// in reserve.
-
-static const char kSignature[4] = {'L', 'M', 'A', 1};
-
-static const size_t kSmallObjectMaxSize = 1 << kSmallObjectMaxSizeLog2;
-
-// This type is used for large allocations (with size >1k)
-static const uint32_t kLargeObject = 111;
-
-bool operator<(const small_object_page_record& one, const small_object_page_record& two) {
-  return one.page_addr < two.page_addr;
-}
-
-static inline uint16_t log2(size_t number) {
-  uint16_t result = 0;
-  number--;
-
-  while (number != 0) {
-    result++;
-    number >>= 1;
-  }
-
-  return result;
-}
-
-LinkerSmallObjectAllocator::LinkerSmallObjectAllocator(uint32_t type, size_t block_size)
-    : type_(type), block_size_(block_size), free_pages_cnt_(0), free_blocks_list_(nullptr) {}
-
-void* LinkerSmallObjectAllocator::alloc() {
-  CHECK(block_size_ != 0);
-
-  if (free_blocks_list_ == nullptr) {
-    alloc_page();
-  }
-
-  small_object_block_record* block_record = free_blocks_list_;
-  if (block_record->free_blocks_cnt > 1) {
-    small_object_block_record* next_free = reinterpret_cast<small_object_block_record*>(
-        reinterpret_cast<uint8_t*>(block_record) + block_size_);
-    next_free->next = block_record->next;
-    next_free->free_blocks_cnt = block_record->free_blocks_cnt - 1;
-    free_blocks_list_ = next_free;
-  } else {
-    free_blocks_list_ = block_record->next;
-  }
-
-  // bookkeeping...
-  auto page_record = find_page_record(block_record);
-
-  if (page_record->allocated_blocks_cnt == 0) {
-    free_pages_cnt_--;
-  }
-
-  page_record->free_blocks_cnt--;
-  page_record->allocated_blocks_cnt++;
-
-  memset(block_record, 0, block_size_);
-
-  return block_record;
-}
-
-void LinkerSmallObjectAllocator::free_page(linker_vector_t::iterator page_record) {
-  void* page_start = reinterpret_cast<void*>(page_record->page_addr);
-  void* page_end = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(page_start) + PAGE_SIZE);
-
-  while (free_blocks_list_ != nullptr &&
-      free_blocks_list_ > page_start &&
-      free_blocks_list_ < page_end) {
-    free_blocks_list_ = free_blocks_list_->next;
-  }
-
-  small_object_block_record* current = free_blocks_list_;
-
-  while (current != nullptr) {
-    while (current->next > page_start && current->next < page_end) {
-      current->next = current->next->next;
-    }
-
-    current = current->next;
-  }
-
-  munmap(page_start, PAGE_SIZE);
-  page_records_.erase(page_record);
-  free_pages_cnt_--;
-}
-
-void LinkerSmallObjectAllocator::free(void* ptr) {
-  auto page_record = find_page_record(ptr);
-
-  ssize_t offset = reinterpret_cast<uintptr_t>(ptr) - sizeof(page_info);
-
-  if (offset % block_size_ != 0) {
-    async_safe_fatal("invalid pointer: %p (block_size=%zd)", ptr, block_size_);
-  }
-
-  memset(ptr, 0, block_size_);
-  small_object_block_record* block_record = reinterpret_cast<small_object_block_record*>(ptr);
-
-  block_record->next = free_blocks_list_;
-  block_record->free_blocks_cnt = 1;
-
-  free_blocks_list_ = block_record;
-
-  page_record->free_blocks_cnt++;
-  page_record->allocated_blocks_cnt--;
-
-  if (page_record->allocated_blocks_cnt == 0) {
-    if (free_pages_cnt_++ > 1) {
-      // if we already have a free page - unmap this one.
-      free_page(page_record);
-    }
-  }
-}
-
-linker_vector_t::iterator LinkerSmallObjectAllocator::find_page_record(void* ptr) {
-  void* addr = reinterpret_cast<void*>(PAGE_START(reinterpret_cast<uintptr_t>(ptr)));
-  small_object_page_record boundary;
-  boundary.page_addr = addr;
-  linker_vector_t::iterator it = std::lower_bound(
-      page_records_.begin(), page_records_.end(), boundary);
-
-  if (it == page_records_.end() || it->page_addr != addr) {
-    // not found...
-    async_safe_fatal("page record for %p was not found (block_size=%zd)", ptr, block_size_);
-  }
-
-  return it;
-}
-
-void LinkerSmallObjectAllocator::create_page_record(void* page_addr, size_t free_blocks_cnt) {
-  small_object_page_record record;
-  record.page_addr = page_addr;
-  record.free_blocks_cnt = free_blocks_cnt;
-  record.allocated_blocks_cnt = 0;
-
-  linker_vector_t::iterator it = std::lower_bound(
-      page_records_.begin(), page_records_.end(), record);
-  page_records_.insert(it, record);
-}
-
-void LinkerSmallObjectAllocator::alloc_page() {
-  static_assert(sizeof(page_info) % 16 == 0, "sizeof(page_info) is not multiple of 16");
-  void* map_ptr = mmap(nullptr, PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
-  if (map_ptr == MAP_FAILED) {
-    async_safe_fatal("mmap failed: %s", strerror(errno));
-  }
-
-  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, map_ptr, PAGE_SIZE, "linker_alloc_small_objects");
-
-  page_info* info = reinterpret_cast<page_info*>(map_ptr);
-  memcpy(info->signature, kSignature, sizeof(kSignature));
-  info->type = type_;
-  info->allocator_addr = this;
-
-  size_t free_blocks_cnt = (PAGE_SIZE - sizeof(page_info))/block_size_;
-
-  create_page_record(map_ptr, free_blocks_cnt);
-
-  small_object_block_record* first_block = reinterpret_cast<small_object_block_record*>(info + 1);
-
-  first_block->next = free_blocks_list_;
-  first_block->free_blocks_cnt = free_blocks_cnt;
-
-  free_blocks_list_ = first_block;
-
-  free_pages_cnt_++;
-}
-
-
-void LinkerMemoryAllocator::initialize_allocators() {
-  if (allocators_ != nullptr) {
-    return;
-  }
-
-  LinkerSmallObjectAllocator* allocators =
-      reinterpret_cast<LinkerSmallObjectAllocator*>(allocators_buf_);
-
-  for (size_t i = 0; i < kSmallObjectAllocatorsCount; ++i) {
-    uint32_t type = i + kSmallObjectMinSizeLog2;
-    new (allocators + i) LinkerSmallObjectAllocator(type, 1 << type);
-  }
-
-  allocators_ = allocators;
-}
-
-void* LinkerMemoryAllocator::alloc_mmap(size_t size) {
-  size_t allocated_size = PAGE_END(size + sizeof(page_info));
-  void* map_ptr = mmap(nullptr, allocated_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-                       -1, 0);
-
-  if (map_ptr == MAP_FAILED) {
-    async_safe_fatal("mmap failed: %s", strerror(errno));
-  }
-
-  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, map_ptr, allocated_size, "linker_alloc_lob");
-
-  page_info* info = reinterpret_cast<page_info*>(map_ptr);
-  memcpy(info->signature, kSignature, sizeof(kSignature));
-  info->type = kLargeObject;
-  info->allocated_size = allocated_size;
-
-  return info + 1;
-}
-
-void* LinkerMemoryAllocator::alloc(size_t size) {
-  // treat alloc(0) as alloc(1)
-  if (size == 0) {
-    size = 1;
-  }
-
-  if (size > kSmallObjectMaxSize) {
-    return alloc_mmap(size);
-  }
-
-  uint16_t log2_size = log2(size);
-
-  if (log2_size < kSmallObjectMinSizeLog2) {
-    log2_size = kSmallObjectMinSizeLog2;
-  }
-
-  return get_small_object_allocator(log2_size)->alloc();
-}
-
-page_info* LinkerMemoryAllocator::get_page_info(void* ptr) {
-  page_info* info = reinterpret_cast<page_info*>(PAGE_START(reinterpret_cast<size_t>(ptr)));
-  if (memcmp(info->signature, kSignature, sizeof(kSignature)) != 0) {
-    async_safe_fatal("invalid pointer %p (page signature mismatch)", ptr);
-  }
-
-  return info;
-}
-
-void* LinkerMemoryAllocator::realloc(void* ptr, size_t size) {
-  if (ptr == nullptr) {
-    return alloc(size);
-  }
-
-  if (size == 0) {
-    free(ptr);
-    return nullptr;
-  }
-
-  page_info* info = get_page_info(ptr);
-
-  size_t old_size = 0;
-
-  if (info->type == kLargeObject) {
-    old_size = info->allocated_size - sizeof(page_info);
-  } else {
-    LinkerSmallObjectAllocator* allocator = get_small_object_allocator(info->type);
-    if (allocator != info->allocator_addr) {
-      async_safe_fatal("invalid pointer %p (page signature mismatch)", ptr);
-    }
-
-    old_size = allocator->get_block_size();
-  }
-
-  if (old_size < size) {
-    void *result = alloc(size);
-    memcpy(result, ptr, old_size);
-    free(ptr);
-    return result;
-  }
-
-  return ptr;
-}
-
-void LinkerMemoryAllocator::free(void* ptr) {
-  if (ptr == nullptr) {
-    return;
-  }
-
-  page_info* info = get_page_info(ptr);
-
-  if (info->type == kLargeObject) {
-    munmap(info, info->allocated_size);
-  } else {
-    LinkerSmallObjectAllocator* allocator = get_small_object_allocator(info->type);
-    if (allocator != info->allocator_addr) {
-      async_safe_fatal("invalid pointer %p (invalid allocator address for the page)", ptr);
-    }
-
-    allocator->free(ptr);
-  }
-}
-
-LinkerSmallObjectAllocator* LinkerMemoryAllocator::get_small_object_allocator(uint32_t type) {
-  if (type < kSmallObjectMinSizeLog2 || type > kSmallObjectMaxSizeLog2) {
-    async_safe_fatal("invalid type: %u", type);
-  }
-
-  initialize_allocators();
-  return &allocators_[type - kSmallObjectMinSizeLog2];
-}
diff --git a/linker/linker_allocator.h b/linker/linker_allocator.h
deleted file mode 100644
index 8c4198b..0000000
--- a/linker/linker_allocator.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#pragma once
-
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/cdefs.h>
-#include <sys/mman.h>
-#include <sys/prctl.h>
-#include <stddef.h>
-#include <unistd.h>
-
-#include <vector>
-
-#include <async_safe/log.h>
-
-const uint32_t kSmallObjectMaxSizeLog2 = 10;
-const uint32_t kSmallObjectMinSizeLog2 = 4;
-const uint32_t kSmallObjectAllocatorsCount = kSmallObjectMaxSizeLog2 - kSmallObjectMinSizeLog2 + 1;
-
-class LinkerSmallObjectAllocator;
-
-// This structure is placed at the beginning of each addressable page
-// and has all information we need to find the corresponding memory allocator.
-struct page_info {
-  char signature[4];
-  uint32_t type;
-  union {
-    // we use allocated_size for large objects allocator
-    size_t allocated_size;
-    // and allocator_addr for small ones.
-    LinkerSmallObjectAllocator* allocator_addr;
-  };
-} __attribute__((aligned(16)));
-
-struct small_object_page_record {
-  void* page_addr;
-  size_t free_blocks_cnt;
-  size_t allocated_blocks_cnt;
-};
-
-// for lower_bound...
-bool operator<(const small_object_page_record& one, const small_object_page_record& two);
-
-struct small_object_block_record {
-  small_object_block_record* next;
-  size_t free_blocks_cnt;
-};
-
-// This is implementation for std::vector allocator
-template <typename T>
-class linker_vector_allocator {
- public:
-  typedef T value_type;
-  typedef T* pointer;
-  typedef const T* const_pointer;
-  typedef T& reference;
-  typedef const T& const_reference;
-  typedef size_t size_type;
-  typedef ptrdiff_t difference_type;
-
-  T* allocate(size_t n, const T* hint = nullptr) {
-    size_t size = n * sizeof(T);
-    void* ptr = mmap(const_cast<T*>(hint), size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-                     -1, 0);
-    if (ptr == MAP_FAILED) {
-      // Spec says we need to throw std::bad_alloc here but because our
-      // code does not support exception handling anyways - we are going to abort.
-      async_safe_fatal("mmap failed: %s", strerror(errno));
-    }
-
-    prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ptr, size, "linker_alloc_vector");
-
-    return reinterpret_cast<T*>(ptr);
-  }
-
-  void deallocate(T* ptr, size_t n) {
-    munmap(ptr, n * sizeof(T));
-  }
-};
-
-typedef
-    std::vector<small_object_page_record, linker_vector_allocator<small_object_page_record>>
-    linker_vector_t;
-
-
-class LinkerSmallObjectAllocator {
- public:
-  LinkerSmallObjectAllocator(uint32_t type, size_t block_size);
-  void* alloc();
-  void free(void* ptr);
-
-  size_t get_block_size() const { return block_size_; }
- private:
-  void alloc_page();
-  void free_page(linker_vector_t::iterator page_record);
-  linker_vector_t::iterator find_page_record(void* ptr);
-  void create_page_record(void* page_addr, size_t free_blocks_cnt);
-
-  uint32_t type_;
-  size_t block_size_;
-
-  size_t free_pages_cnt_;
-  small_object_block_record* free_blocks_list_;
-
-  // sorted vector of page records
-  linker_vector_t page_records_;
-};
-
-class LinkerMemoryAllocator {
- public:
-  constexpr LinkerMemoryAllocator() : allocators_(nullptr), allocators_buf_() {}
-  void* alloc(size_t size);
-
-  // Note that this implementation of realloc never shrinks allocation
-  void* realloc(void* ptr, size_t size);
-  void free(void* ptr);
- private:
-  void* alloc_mmap(size_t size);
-  page_info* get_page_info(void* ptr);
-  LinkerSmallObjectAllocator* get_small_object_allocator(uint32_t type);
-  void initialize_allocators();
-
-  LinkerSmallObjectAllocator* allocators_;
-  uint8_t allocators_buf_[sizeof(LinkerSmallObjectAllocator)*kSmallObjectAllocatorsCount];
-};
diff --git a/linker/linker_block_allocator.cpp b/linker/linker_block_allocator.cpp
index dca944e..1e2f9a2 100644
--- a/linker/linker_block_allocator.cpp
+++ b/linker/linker_block_allocator.cpp
@@ -33,6 +33,9 @@
 #include <sys/prctl.h>
 #include <unistd.h>
 
+static constexpr size_t kAllocateSize = PAGE_SIZE * 100;
+static_assert(kAllocateSize % PAGE_SIZE == 0, "Invalid kAllocateSize.");
+
 // the multiplier should be power of 2
 static constexpr size_t round_up(size_t size, size_t multiplier) {
   return (size + (multiplier - 1)) & ~(multiplier-1);
@@ -40,7 +43,7 @@
 
 struct LinkerBlockAllocatorPage {
   LinkerBlockAllocatorPage* next;
-  uint8_t bytes[PAGE_SIZE - 16] __attribute__((aligned(16)));
+  uint8_t bytes[kAllocateSize - 16] __attribute__((aligned(16)));
 };
 
 struct FreeBlockInfo {
@@ -52,7 +55,8 @@
   : block_size_(
       round_up(block_size < sizeof(FreeBlockInfo) ? sizeof(FreeBlockInfo) : block_size, 16)),
     page_list_(nullptr),
-    free_block_list_(nullptr)
+    free_block_list_(nullptr),
+    allocated_(0)
 {}
 
 void* LinkerBlockAllocator::alloc() {
@@ -73,6 +77,8 @@
 
   memset(block_info, 0, block_size_);
 
+  ++allocated_;
+
   return block_info;
 }
 
@@ -101,32 +107,34 @@
   block_info->num_free_blocks = 1;
 
   free_block_list_ = block_info;
+
+  --allocated_;
 }
 
 void LinkerBlockAllocator::protect_all(int prot) {
   for (LinkerBlockAllocatorPage* page = page_list_; page != nullptr; page = page->next) {
-    if (mprotect(page, PAGE_SIZE, prot) == -1) {
+    if (mprotect(page, kAllocateSize, prot) == -1) {
       abort();
     }
   }
 }
 
 void LinkerBlockAllocator::create_new_page() {
-  static_assert(sizeof(LinkerBlockAllocatorPage) == PAGE_SIZE,
+  static_assert(sizeof(LinkerBlockAllocatorPage) == kAllocateSize,
                 "Invalid sizeof(LinkerBlockAllocatorPage)");
 
   LinkerBlockAllocatorPage* page = reinterpret_cast<LinkerBlockAllocatorPage*>(
-      mmap(nullptr, PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0));
+      mmap(nullptr, kAllocateSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0));
 
   if (page == MAP_FAILED) {
     abort(); // oom
   }
 
-  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, page, PAGE_SIZE, "linker_alloc");
+  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, page, kAllocateSize, "linker_alloc");
 
   FreeBlockInfo* first_block = reinterpret_cast<FreeBlockInfo*>(page->bytes);
   first_block->next_block = free_block_list_;
-  first_block->num_free_blocks = (PAGE_SIZE - sizeof(LinkerBlockAllocatorPage*))/block_size_;
+  first_block->num_free_blocks = sizeof(page->bytes) / block_size_;
 
   free_block_list_ = first_block;
 
@@ -142,7 +150,7 @@
   LinkerBlockAllocatorPage* page = page_list_;
   while (page != nullptr) {
     const uint8_t* page_ptr = reinterpret_cast<const uint8_t*>(page);
-    if (block >= (page_ptr + sizeof(page->next)) && block < (page_ptr + PAGE_SIZE)) {
+    if (block >= (page_ptr + sizeof(page->next)) && block < (page_ptr + kAllocateSize)) {
       return page;
     }
 
@@ -151,3 +159,18 @@
 
   abort();
 }
+
+void LinkerBlockAllocator::purge() {
+  if (allocated_) {
+    return;
+  }
+
+  LinkerBlockAllocatorPage* page = page_list_;
+  while (page) {
+    LinkerBlockAllocatorPage* next = page->next;
+    munmap(page, kAllocateSize);
+    page = next;
+  }
+  page_list_ = nullptr;
+  free_block_list_ = nullptr;
+}
diff --git a/linker/linker_block_allocator.h b/linker/linker_block_allocator.h
index bd44fc8..8ae4094 100644
--- a/linker/linker_block_allocator.h
+++ b/linker/linker_block_allocator.h
@@ -50,6 +50,9 @@
   void free(void* block);
   void protect_all(int prot);
 
+  // Purge all pages if all previously allocated blocks have been freed.
+  void purge();
+
  private:
   void create_new_page();
   LinkerBlockAllocatorPage* find_page(void* block);
@@ -57,6 +60,7 @@
   size_t block_size_;
   LinkerBlockAllocatorPage* page_list_;
   void* free_block_list_;
+  size_t allocated_;
 
   DISALLOW_COPY_AND_ASSIGN(LinkerBlockAllocator);
 };
@@ -66,17 +70,17 @@
  * of a single fixed-size type. Allocations are backed by page-sized private
  * anonymous mmaps.
  *
- * The differences between this allocator and LinkerMemoryAllocator are:
- * 1. This allocator manages space more efficiently. LinkerMemoryAllocator
- *    operates in power-of-two sized blocks up to 1k, when this implementation
- *    splits the page to aligned size of structure; For example for structures
- *    with size 513 this allocator will use 516 (520 for lp64) bytes of data
- *    where generalized implementation is going to use 1024 sized blocks.
+ * The differences between this allocator and BionicAllocator are:
+ * 1. This allocator manages space more efficiently. BionicAllocator operates in
+ *    power-of-two sized blocks up to 1k, when this implementation splits the
+ *    page to aligned size of structure; For example for structures with size
+ *    513 this allocator will use 516 (520 for lp64) bytes of data where
+ *    generalized implementation is going to use 1024 sized blocks.
  *
- * 2. This allocator does not munmap allocated memory, where LinkerMemoryAllocator does.
+ * 2. This allocator does not munmap allocated memory, where BionicAllocator does.
  *
- * 3. This allocator provides mprotect services to the user, where LinkerMemoryAllocator
- *    always treats it's memory as READ|WRITE.
+ * 3. This allocator provides mprotect services to the user, where BionicAllocator
+ *    always treats its memory as READ|WRITE.
  */
 template<typename T>
 class LinkerTypeAllocator {
diff --git a/linker/linker_block_allocator_test.cpp b/linker/linker_block_allocator_test.cpp
new file mode 100644
index 0000000..359eefb
--- /dev/null
+++ b/linker/linker_block_allocator_test.cpp
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2013 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 <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+
+#include <gtest/gtest.h>
+
+#include "linker_block_allocator.h"
+
+#include <unistd.h>
+
+namespace {
+
+struct test_struct_nominal {
+  void* pointer;
+  ssize_t value;
+};
+
+/*
+ * this one has size below allocator cap which is 2*sizeof(void*)
+ */
+struct test_struct_small {
+  char dummy_str[5];
+};
+
+/*
+ * 1009 byte struct (1009 is prime)
+ */
+struct test_struct_larger {
+  char dummy_str[1009];
+};
+
+static size_t kPageSize = sysconf(_SC_PAGE_SIZE);
+};
+
+TEST(linker_allocator, test_nominal) {
+  LinkerTypeAllocator<test_struct_nominal> allocator;
+
+  test_struct_nominal* ptr1 = allocator.alloc();
+  ASSERT_TRUE(ptr1 != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
+  test_struct_nominal* ptr2 = allocator.alloc();
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
+  ASSERT_TRUE(ptr2 != nullptr);
+  // they should be next to each other.
+  ASSERT_EQ(reinterpret_cast<uint8_t*>(ptr1)+16, reinterpret_cast<uint8_t*>(ptr2));
+
+  ptr1->value = 42;
+
+  allocator.free(ptr1);
+  allocator.free(ptr2);
+}
+
+TEST(linker_allocator, test_small) {
+  LinkerTypeAllocator<test_struct_small> allocator;
+
+  char* ptr1 = reinterpret_cast<char*>(allocator.alloc());
+  char* ptr2 = reinterpret_cast<char*>(allocator.alloc());
+
+  ASSERT_TRUE(ptr1 != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
+  ASSERT_TRUE(ptr2 != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
+  ASSERT_EQ(ptr1+16, ptr2); // aligned to 16
+}
+
+TEST(linker_allocator, test_larger) {
+  LinkerTypeAllocator<test_struct_larger> allocator;
+
+  test_struct_larger* ptr1 = allocator.alloc();
+  test_struct_larger* ptr2 = allocator.alloc();
+
+  ASSERT_TRUE(ptr1 != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
+  ASSERT_TRUE(ptr2 != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
+
+  ASSERT_EQ(reinterpret_cast<uint8_t*>(ptr1) + 1024, reinterpret_cast<uint8_t*>(ptr2));
+
+  // lets allocate until we reach next page.
+  size_t n = kPageSize/sizeof(test_struct_larger) + 1 - 2;
+
+  for (size_t i=0; i<n; ++i) {
+    ASSERT_TRUE(allocator.alloc() != nullptr);
+  }
+
+  test_struct_larger* ptr_to_free = allocator.alloc();
+  ASSERT_TRUE(ptr_to_free != nullptr);
+  allocator.free(ptr1);
+}
+
+static void protect_all() {
+  LinkerTypeAllocator<test_struct_larger> allocator;
+
+  // number of allocs to reach the end of first page
+  size_t n = kPageSize/sizeof(test_struct_larger) - 1;
+  test_struct_larger* page1_ptr = allocator.alloc();
+
+  for (size_t i=0; i<n; ++i) {
+    allocator.alloc();
+  }
+
+  test_struct_larger* page2_ptr = allocator.alloc();
+  allocator.protect_all(PROT_READ);
+  allocator.protect_all(PROT_READ | PROT_WRITE);
+  // check access
+  page2_ptr->dummy_str[23] = 27;
+  page1_ptr->dummy_str[13] = 11;
+
+  allocator.protect_all(PROT_READ);
+  fprintf(stderr, "trying to access protected page");
+
+  // this should result in segmentation fault
+  page1_ptr->dummy_str[11] = 7;
+}
+
+TEST(linker_allocator, test_protect) {
+  testing::FLAGS_gtest_death_test_style = "threadsafe";
+  ASSERT_EXIT(protect_all(), testing::KilledBySignal(SIGSEGV), "trying to access protected page");
+}
diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp
index ac4c1fd..7741904 100644
--- a/linker/linker_config.cpp
+++ b/linker/linker_config.cpp
@@ -41,6 +41,7 @@
 
 #include <limits.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 #include <string>
 #include <unordered_map>
@@ -59,7 +60,7 @@
   };
 
   explicit ConfigParser(std::string&& content)
-      : content_(content), p_(0), lineno_(0), was_end_of_file_(false) {}
+      : content_(std::move(content)), p_(0), lineno_(0), was_end_of_file_(false) {}
 
   /*
    * Possible return values
@@ -79,7 +80,7 @@
         continue;
       }
 
-      if (line[0] == '[' && line[line.size() - 1] == ']') {
+      if (line[0] == '[' && line.back() == ']') {
         *name = line.substr(1, line.size() - 2);
         return kSection;
       }
@@ -146,7 +147,7 @@
   PropertyValue() = default;
 
   PropertyValue(std::string&& value, size_t lineno)
-    : value_(value), lineno_(lineno) {}
+    : value_(std::move(value)), lineno_(lineno) {}
 
   const std::string& value() const {
     return value_;
@@ -238,18 +239,27 @@
       // If the path can be resolved, resolve it
       char buf[PATH_MAX];
       std::string resolved_path;
-      if (realpath(value.c_str(), buf)) {
-        resolved_path = buf;
-      } else if (errno != ENOENT)  {
-        DL_WARN("%s:%zd: warning: path \"%s\" couldn't be resolved: %s",
-                ld_config_file_path,
-                cp.lineno(),
-                value.c_str(),
-                strerror(errno));
+      if (access(value.c_str(), R_OK) != 0) {
+        if (errno == ENOENT) {
+          // no need to test for non-existing path. skip.
+          continue;
+        }
+        // If not accessible, don't call realpath as it will just cause
+        // SELinux denial spam. Use the path unresolved.
         resolved_path = value;
+      } else if (realpath(value.c_str(), buf)) {
+        resolved_path = buf;
       } else {
-        // ENOENT: no need to test if binary is under the path
-        continue;
+        // realpath is expected to fail with EPERM in some situations, so log
+        // the failure with INFO rather than DL_WARN. e.g. A binary in
+        // /data/local/tmp may attempt to stat /postinstall. See
+        // http://b/120996057.
+        INFO("%s:%zd: warning: path \"%s\" couldn't be resolved: %s",
+             ld_config_file_path,
+             cp.lineno(),
+             value.c_str(),
+             strerror(errno));
+        resolved_path = value;
       }
 
       if (file_is_under_dir(binary_realpath, resolved_path)) {
@@ -259,6 +269,8 @@
     }
   }
 
+  INFO("[ Using config section \"%s\" ]", section_name.c_str());
+
   // skip everything until we meet a correct section
   while (true) {
     std::string name;
@@ -350,7 +362,7 @@
 class Properties {
  public:
   explicit Properties(std::unordered_map<std::string, PropertyValue>&& properties)
-      : properties_(properties), target_sdk_version_(__ANDROID_API__) {}
+      : properties_(std::move(properties)), target_sdk_version_(__ANDROID_API__) {}
 
   std::vector<std::string> get_strings(const std::string& name, size_t* lineno = nullptr) const {
     auto it = find_property(name, lineno);
@@ -399,7 +411,7 @@
     static std::string vndk = Config::get_vndk_version_string('-');
     params.push_back({ "VNDK_VER", vndk });
 
-    for (auto&& path : paths) {
+    for (auto& path : paths) {
       format_string(&path, params);
     }
 
@@ -540,6 +552,12 @@
     ns_config->set_isolated(properties.get_bool(property_name_prefix + ".isolated"));
     ns_config->set_visible(properties.get_bool(property_name_prefix + ".visible"));
 
+    std::string whitelisted =
+        properties.get_string(property_name_prefix + ".whitelisted", &lineno);
+    if (!whitelisted.empty()) {
+      ns_config->set_whitelisted_libs(android::base::Split(whitelisted, ":"));
+    }
+
     // these are affected by is_asan flag
     if (is_asan) {
       property_name_prefix += ".asan";
diff --git a/linker/linker_config.h b/linker/linker_config.h
index 49739ee..75d9378 100644
--- a/linker/linker_config.h
+++ b/linker/linker_config.h
@@ -92,6 +92,10 @@
     return permitted_paths_;
   }
 
+  const std::vector<std::string>& whitelisted_libs() const {
+    return whitelisted_libs_;
+  }
+
   const std::vector<NamespaceLinkConfig>& links() const {
     return namespace_links_;
   }
@@ -110,11 +114,15 @@
   }
 
   void set_search_paths(std::vector<std::string>&& search_paths) {
-    search_paths_ = search_paths;
+    search_paths_ = std::move(search_paths);
   }
 
   void set_permitted_paths(std::vector<std::string>&& permitted_paths) {
-    permitted_paths_ = permitted_paths;
+    permitted_paths_ = std::move(permitted_paths);
+  }
+
+  void set_whitelisted_libs(std::vector<std::string>&& whitelisted_libs) {
+    whitelisted_libs_ = std::move(whitelisted_libs);
   }
  private:
   const std::string name_;
@@ -122,6 +130,7 @@
   bool visible_;
   std::vector<std::string> search_paths_;
   std::vector<std::string> permitted_paths_;
+  std::vector<std::string> whitelisted_libs_;
   std::vector<NamespaceLinkConfig> namespace_links_;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(NamespaceConfig);
diff --git a/linker/linker_config_test.cpp b/linker/linker_config_test.cpp
new file mode 100644
index 0000000..4937056
--- /dev/null
+++ b/linker/linker_config_test.cpp
@@ -0,0 +1,307 @@
+/*
+ * Copyright (C) 2017 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 <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+
+#include <gtest/gtest.h>
+
+#include "linker_config.h"
+#include "linker_utils.h"
+
+#include <unistd.h>
+
+#include <android-base/file.h>
+#include <android-base/scopeguard.h>
+#include <android-base/stringprintf.h>
+
+#if defined(__LP64__)
+#define ARCH_SUFFIX "64"
+#else
+#define ARCH_SUFFIX ""
+#endif
+
+static const char* config_str =
+  "# comment \n"
+  "dir.test = /data/local/tmp\n"
+  "\n"
+  "[test]\n"
+  "\n"
+  "enable.target.sdk.version = true\n"
+  "additional.namespaces=system\n"
+  "additional.namespaces+=vndk\n"
+  "additional.namespaces+=vndk_in_system\n"
+  "namespace.default.isolated = true\n"
+  "namespace.default.search.paths = /vendor/${LIB}\n"
+  "namespace.default.permitted.paths = /vendor/${LIB}\n"
+  "namespace.default.asan.search.paths = /data\n"
+  "namespace.default.asan.search.paths += /vendor/${LIB}\n"
+  "namespace.default.asan.permitted.paths = /data:/vendor\n"
+  "namespace.default.links = system\n"
+  "namespace.default.links += vndk\n"
+  // irregular whitespaces are added intentionally for testing purpose
+  "namespace.default.link.system.shared_libs=  libc.so\n"
+  "namespace.default.link.system.shared_libs +=   libm.so:libdl.so\n"
+  "namespace.default.link.system.shared_libs   +=libstdc++.so\n"
+  "namespace.default.link.vndk.shared_libs = libcutils.so:libbase.so\n"
+  "namespace.system.isolated = true\n"
+  "namespace.system.visible = true\n"
+  "namespace.system.search.paths = /system/${LIB}\n"
+  "namespace.system.permitted.paths = /system/${LIB}\n"
+  "namespace.system.asan.search.paths = /data:/system/${LIB}\n"
+  "namespace.system.asan.permitted.paths = /data:/system\n"
+  "namespace.vndk.isolated = tr\n"
+  "namespace.vndk.isolated += ue\n" // should be ignored and return as 'false'.
+  "namespace.vndk.search.paths = /system/${LIB}/vndk\n"
+  "namespace.vndk.asan.search.paths = /data\n"
+  "namespace.vndk.asan.search.paths += /system/${LIB}/vndk\n"
+  "namespace.vndk.links = default\n"
+  "namespace.vndk.link.default.allow_all_shared_libs = true\n"
+  "namespace.vndk.link.vndk_in_system.allow_all_shared_libs = true\n"
+  "namespace.vndk_in_system.isolated = true\n"
+  "namespace.vndk_in_system.visible = true\n"
+  "namespace.vndk_in_system.search.paths = /system/${LIB}\n"
+  "namespace.vndk_in_system.permitted.paths = /system/${LIB}\n"
+  "namespace.vndk_in_system.whitelisted = libz.so:libyuv.so:libtinyxml2.so\n"
+  "\n";
+
+static bool write_version(const std::string& path, uint32_t version) {
+  std::string content = android::base::StringPrintf("%d", version);
+  return android::base::WriteStringToFile(content, path);
+}
+
+static std::vector<std::string> resolve_paths(std::vector<std::string> paths) {
+  std::vector<std::string> resolved_paths;
+  resolve_paths(paths, &resolved_paths);
+  return resolved_paths;
+}
+
+static void run_linker_config_smoke_test(bool is_asan) {
+  const std::vector<std::string> kExpectedDefaultSearchPath =
+      resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/vendor/lib" ARCH_SUFFIX }) :
+                              std::vector<std::string>({ "/vendor/lib" ARCH_SUFFIX }));
+
+  const std::vector<std::string> kExpectedDefaultPermittedPath =
+      resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/vendor" }) :
+                              std::vector<std::string>({ "/vendor/lib" ARCH_SUFFIX }));
+
+  const std::vector<std::string> kExpectedSystemSearchPath =
+      resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/system/lib" ARCH_SUFFIX }) :
+                              std::vector<std::string>({ "/system/lib" ARCH_SUFFIX }));
+
+  const std::vector<std::string> kExpectedSystemPermittedPath =
+      resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/system" }) :
+                              std::vector<std::string>({ "/system/lib" ARCH_SUFFIX }));
+
+  const std::vector<std::string> kExpectedVndkSearchPath =
+      resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/system/lib" ARCH_SUFFIX "/vndk"}) :
+                              std::vector<std::string>({ "/system/lib" ARCH_SUFFIX "/vndk"}));
+
+  TemporaryFile tmp_file;
+  close(tmp_file.fd);
+  tmp_file.fd = -1;
+
+  android::base::WriteStringToFile(config_str, tmp_file.path);
+
+  TemporaryDir tmp_dir;
+
+  std::string executable_path = std::string(tmp_dir.path) + "/some-binary";
+  std::string version_file = std::string(tmp_dir.path) + "/.version";
+
+  auto file_guard =
+      android::base::make_scope_guard([&version_file] { unlink(version_file.c_str()); });
+
+  ASSERT_TRUE(write_version(version_file, 113U)) << strerror(errno);
+
+  // read config
+  const Config* config = nullptr;
+  std::string error_msg;
+  ASSERT_TRUE(Config::read_binary_config(tmp_file.path,
+                                         executable_path.c_str(),
+                                         is_asan,
+                                         &config,
+                                         &error_msg)) << error_msg;
+  ASSERT_TRUE(config != nullptr);
+  ASSERT_TRUE(error_msg.empty());
+
+  ASSERT_EQ(113, config->target_sdk_version());
+
+  const NamespaceConfig* default_ns_config = config->default_namespace_config();
+  ASSERT_TRUE(default_ns_config != nullptr);
+
+  ASSERT_TRUE(default_ns_config->isolated());
+  ASSERT_FALSE(default_ns_config->visible());
+  ASSERT_EQ(kExpectedDefaultSearchPath, default_ns_config->search_paths());
+  ASSERT_EQ(kExpectedDefaultPermittedPath, default_ns_config->permitted_paths());
+
+  const auto& default_ns_links = default_ns_config->links();
+  ASSERT_EQ(2U, default_ns_links.size());
+
+  ASSERT_EQ("system", default_ns_links[0].ns_name());
+  ASSERT_EQ("libc.so:libm.so:libdl.so:libstdc++.so", default_ns_links[0].shared_libs());
+  ASSERT_FALSE(default_ns_links[0].allow_all_shared_libs());
+
+  ASSERT_EQ("vndk", default_ns_links[1].ns_name());
+  ASSERT_EQ("libcutils.so:libbase.so", default_ns_links[1].shared_libs());
+  ASSERT_FALSE(default_ns_links[1].allow_all_shared_libs());
+
+  auto& ns_configs = config->namespace_configs();
+  ASSERT_EQ(4U, ns_configs.size());
+
+  // find second namespace
+  const NamespaceConfig* ns_system = nullptr;
+  const NamespaceConfig* ns_vndk = nullptr;
+  const NamespaceConfig* ns_vndk_in_system = nullptr;
+  for (auto& ns : ns_configs) {
+    std::string ns_name = ns->name();
+    ASSERT_TRUE(ns_name == "system" || ns_name == "default" ||
+                ns_name == "vndk" || ns_name == "vndk_in_system")
+        << "unexpected ns name: " << ns->name();
+
+    if (ns_name == "system") {
+      ns_system = ns.get();
+    } else if (ns_name == "vndk") {
+      ns_vndk = ns.get();
+    } else if (ns_name == "vndk_in_system") {
+      ns_vndk_in_system = ns.get();
+    }
+  }
+
+  ASSERT_TRUE(ns_system != nullptr) << "system namespace was not found";
+
+  ASSERT_TRUE(ns_system->isolated());
+  ASSERT_TRUE(ns_system->visible());
+  ASSERT_EQ(kExpectedSystemSearchPath, ns_system->search_paths());
+  ASSERT_EQ(kExpectedSystemPermittedPath, ns_system->permitted_paths());
+
+  ASSERT_TRUE(ns_vndk != nullptr) << "vndk namespace was not found";
+
+  ASSERT_FALSE(ns_vndk->isolated()); // malformed bool property
+  ASSERT_FALSE(ns_vndk->visible()); // undefined bool property
+  ASSERT_EQ(kExpectedVndkSearchPath, ns_vndk->search_paths());
+
+  const auto& ns_vndk_links = ns_vndk->links();
+  ASSERT_EQ(1U, ns_vndk_links.size());
+  ASSERT_EQ("default", ns_vndk_links[0].ns_name());
+  ASSERT_TRUE(ns_vndk_links[0].allow_all_shared_libs());
+
+  ASSERT_TRUE(ns_vndk_in_system != nullptr) << "vndk_in_system namespace was not found";
+  ASSERT_EQ(
+      std::vector<std::string>({"libz.so", "libyuv.so", "libtinyxml2.so"}),
+      ns_vndk_in_system->whitelisted_libs());
+}
+
+TEST(linker_config, smoke) {
+  run_linker_config_smoke_test(false);
+}
+
+TEST(linker_config, asan_smoke) {
+  run_linker_config_smoke_test(true);
+}
+
+TEST(linker_config, ns_link_shared_libs_invalid_settings) {
+  // This unit test ensures an error is emitted when a namespace link in ld.config.txt specifies
+  // both shared_libs and allow_all_shared_libs.
+
+  static const char config_str[] =
+    "dir.test = /data/local/tmp\n"
+    "\n"
+    "[test]\n"
+    "additional.namespaces = system\n"
+    "namespace.default.links = system\n"
+    "namespace.default.link.system.shared_libs = libc.so:libm.so\n"
+    "namespace.default.link.system.allow_all_shared_libs = true\n"
+    "\n";
+
+  TemporaryFile tmp_file;
+  close(tmp_file.fd);
+  tmp_file.fd = -1;
+
+  android::base::WriteStringToFile(config_str, tmp_file.path);
+
+  TemporaryDir tmp_dir;
+
+  std::string executable_path = std::string(tmp_dir.path) + "/some-binary";
+
+  const Config* config = nullptr;
+  std::string error_msg;
+  ASSERT_FALSE(Config::read_binary_config(tmp_file.path,
+                                          executable_path.c_str(),
+                                          false,
+                                          &config,
+                                          &error_msg));
+  ASSERT_TRUE(config == nullptr);
+  ASSERT_EQ(std::string(tmp_file.path) + ":6: "
+            "error: both shared_libs and allow_all_shared_libs are set for default->system link.",
+            error_msg);
+}
+
+TEST(linker_config, dir_path_resolve) {
+  // This unit test ensures the linker resolves paths of dir.${section}
+  // properties to real path.
+
+  TemporaryDir tmp_dir;
+
+  std::string sub_dir = std::string(tmp_dir.path) + "/subdir";
+  mkdir(sub_dir.c_str(), 0755);
+
+  auto subdir_guard =
+      android::base::make_scope_guard([&sub_dir] { rmdir(sub_dir.c_str()); });
+
+  std::string symlink_path = std::string(tmp_dir.path) + "/symlink";
+  symlink(sub_dir.c_str(), symlink_path.c_str());
+
+  auto symlink_guard =
+      android::base::make_scope_guard([&symlink_path] { unlink(symlink_path.c_str()); });
+
+  std::string config_str =
+      "dir.test = " + symlink_path + "\n"
+      "\n"
+      "[test]\n";
+
+  TemporaryFile tmp_file;
+  close(tmp_file.fd);
+  tmp_file.fd = -1;
+
+  android::base::WriteStringToFile(config_str, tmp_file.path);
+
+  std::string executable_path = sub_dir + "/some-binary";
+
+  const Config* config = nullptr;
+  std::string error_msg;
+
+  ASSERT_TRUE(Config::read_binary_config(tmp_file.path,
+                                         executable_path.c_str(),
+                                         false,
+                                         &config,
+                                         &error_msg)) << error_msg;
+
+  ASSERT_TRUE(config != nullptr) << error_msg;
+  ASSERT_TRUE(error_msg.empty()) << error_msg;
+}
diff --git a/linker/linker_debug.h b/linker/linker_debug.h
index 862ea12..7a1cb3c 100644
--- a/linker/linker_debug.h
+++ b/linker/linker_debug.h
@@ -56,6 +56,7 @@
 #include <unistd.h>
 
 #include <async_safe/log.h>
+#include <async_safe/CHECK.h>
 
 __LIBC_HIDDEN__ extern int g_ld_debug_verbosity;
 
diff --git a/linker/linker_logger.cpp b/linker/linker_logger.cpp
index d0e5072..ec07a55 100644
--- a/linker/linker_logger.cpp
+++ b/linker/linker_logger.cpp
@@ -118,11 +118,7 @@
   flags_ |= ParseProperty(debug_ld_app);
 }
 
-void LinkerLogger::Log(uint32_t type, const char* format, ...) {
-  if ((flags_ & type) == 0) {
-    return;
-  }
-
+void LinkerLogger::Log(const char* format, ...) {
   va_list ap;
   va_start(ap, format);
   async_safe_format_log_va_list(ANDROID_LOG_DEBUG, "linker", format, ap);
diff --git a/linker/linker_logger.h b/linker/linker_logger.h
index 1828799..fedbc05 100644
--- a/linker/linker_logger.h
+++ b/linker/linker_logger.h
@@ -35,10 +35,10 @@
 
 #include <android-base/macros.h>
 
-#define LD_LOG(type, x...) \
-  { \
-    g_linker_logger.Log(type, x); \
-  }
+#define LD_LOG(type, x...)                                       \
+  do {                                                           \
+    if (g_linker_logger.IsEnabled(type)) g_linker_logger.Log(x); \
+  } while (0)
 
 constexpr const uint32_t kLogErrors = 1 << 0;
 constexpr const uint32_t kLogDlopen = 1 << 1;
@@ -49,7 +49,12 @@
   LinkerLogger() : flags_(0) { }
 
   void ResetState();
-  void Log(uint32_t type, const char* format, ...);
+  void Log(const char* format, ...) __printflike(2, 3);
+
+  uint32_t IsEnabled(uint32_t type) {
+    return flags_ & type;
+  }
+
  private:
   uint32_t flags_;
 
diff --git a/linker/linker_main.cpp b/linker/linker_main.cpp
index 3318c2c..f6e4f67 100644
--- a/linker/linker_main.cpp
+++ b/linker/linker_main.cpp
@@ -36,6 +36,7 @@
 #include "linker_gdb_support.h"
 #include "linker_globals.h"
 #include "linker_phdr.h"
+#include "linker_tls.h"
 #include "linker_utils.h"
 
 #include "private/bionic_globals.h"
@@ -51,6 +52,7 @@
 
 #include <async_safe/log.h>
 #include <bionic/libc_init_common.h>
+#include <bionic/pthread_internal.h>
 
 #include <vector>
 
@@ -163,7 +165,7 @@
   si->load_bias = get_elf_exec_load_bias(ehdr_vdso);
 
   si->prelink_image();
-  si->link_image(g_empty_list, soinfo_list_t::make_list(si), nullptr);
+  si->link_image(g_empty_list, soinfo_list_t::make_list(si), nullptr, nullptr);
   // prevents accidental unloads...
   si->set_dt_flags_1(si->get_dt_flags_1() | DF_1_NODELETE);
   si->set_linked();
@@ -279,7 +281,8 @@
   if (!elf_reader.Read(result.path.c_str(), fd.get(), file_offset, result.file_stat.st_size)) {
     __linker_error("error: %s\n", linker_get_error_buffer());
   }
-  if (!elf_reader.Load(nullptr)) {
+  address_space_params address_space;
+  if (!elf_reader.Load(&address_space)) {
     __linker_error("error: %s\n", linker_get_error_buffer());
   }
 
@@ -350,6 +353,8 @@
   // a C-style string to last until the program exits.
   static std::string exe_path = exe_info.path;
 
+  INFO("[ Linking executable \"%s\" ]", exe_path.c_str());
+
   // Initialize the main exe's soinfo.
   soinfo* si = soinfo_alloc(&g_default_namespace,
                             exe_path.c_str(), &exe_info.file_stat,
@@ -413,6 +418,8 @@
     }
   }
 
+  linker_setup_exe_static_tls(g_argv[0]);
+
   // Load ld_preloads and dependencies.
   std::vector<const char*> needed_library_name_list;
   size_t ld_preloads_count = 0;
@@ -444,12 +451,15 @@
                       &namespaces)) {
     __linker_cannot_link(g_argv[0]);
   } else if (needed_libraries_count == 0) {
-    if (!si->link_image(g_empty_list, soinfo_list_t::make_list(si), nullptr)) {
+    if (!si->link_image(g_empty_list, soinfo_list_t::make_list(si), nullptr, nullptr)) {
       __linker_cannot_link(g_argv[0]);
     }
     si->increment_ref_count();
   }
 
+  linker_finalize_static_tls();
+  __libc_init_main_thread_final();
+
   if (!get_cfi_shadow()->InitialLinkDone(solist)) __linker_cannot_link(g_argv[0]);
 
   si->call_pre_init_constructors();
@@ -457,9 +467,11 @@
 
 #if TIMING
   gettimeofday(&t1, nullptr);
-  PRINT("LINKER TIME: %s: %d microseconds", g_argv[0], (int) (
-           (((long long)t1.tv_sec * 1000000LL) + (long long)t1.tv_usec) -
-           (((long long)t0.tv_sec * 1000000LL) + (long long)t0.tv_usec)));
+  PRINT("LINKER TIME: %s: %d microseconds", g_argv[0],
+        static_cast<int>(((static_cast<long long>(t1.tv_sec) * 1000000LL) +
+                          static_cast<long long>(t1.tv_usec)) -
+                         ((static_cast<long long>(t0.tv_sec) * 1000000LL) +
+                          static_cast<long long>(t0.tv_usec))));
 #endif
 #if STATS
   PRINT("RELO STATS: %s: %d abs, %d rel, %d copy, %d symbol", g_argv[0],
@@ -496,6 +508,10 @@
   fflush(stdout);
 #endif
 
+  // We are about to hand control over to the executable loaded.  We don't want
+  // to leave dirty pages behind unnecessarily.
+  purge_unused_memory();
+
   ElfW(Addr) entry = exe_info.entry_point;
   TRACE("[ Ready to execute \"%s\" @ %p ]", si->get_realpath(), reinterpret_cast<void*>(entry));
   return entry;
@@ -542,6 +558,24 @@
   async_safe_fatal("Could not find a PHDR: broken executable?");
 }
 
+// Detect an attempt to run the linker on itself. e.g.:
+//   /system/bin/linker64 /system/bin/linker64
+// Use priority-1 to run this constructor before other constructors.
+__attribute__((constructor(1))) static void detect_self_exec() {
+  // Normally, the linker initializes the auxv global before calling its
+  // constructors. If the linker loads itself, though, the first loader calls
+  // the second loader's constructors before calling __linker_init.
+  if (__libc_shared_globals()->auxv != nullptr) {
+    return;
+  }
+#if defined(__i386__)
+  // We don't have access to the auxv struct from here, so use the int 0x80
+  // fallback.
+  __libc_sysinfo = reinterpret_cast<void*>(__libc_int0x80);
+#endif
+  __linker_error("error: linker cannot load itself\n");
+}
+
 static ElfW(Addr) __attribute__((noinline))
 __linker_init_post_relocation(KernelArgumentBlock& args, soinfo& linker_so);
 
@@ -557,24 +591,15 @@
 extern "C" ElfW(Addr) __linker_init(void* raw_args) {
   // Initialize TLS early so system calls and errno work.
   KernelArgumentBlock args(raw_args);
-  __libc_init_main_thread_early(args);
+  bionic_tcb temp_tcb = {};
+  __libc_init_main_thread_early(args, &temp_tcb);
 
   // When the linker is run by itself (rather than as an interpreter for
   // another program), AT_BASE is 0.
   ElfW(Addr) linker_addr = getauxval(AT_BASE);
   if (linker_addr == 0) {
-    // Detect an attempt to run the linker on itself (e.g.
-    // `linker64 /system/bin/linker64`). If the kernel loaded this instance of
-    // the linker, then AT_ENTRY will refer to &_start. If it doesn't, then
-    // something else must have loaded this instance of the linker. It's
-    // simpler if we only allow one copy of the linker to be loaded at a time.
-    if (getauxval(AT_ENTRY) != reinterpret_cast<uintptr_t>(&_start)) {
-      // The first linker already relocated this one and set up TLS, so we don't
-      // need further libc initialization.
-      __linker_error("error: linker cannot load itself\n");
-    }
-    // Otherwise, the AT_PHDR and AT_PHNUM aux values describe this linker
-    // instance, so use the phdr to find the linker's base address.
+    // The AT_PHDR and AT_PHNUM aux values describe this linker instance, so use
+    // the phdr to find the linker's base address.
     ElfW(Addr) load_bias;
     get_elf_base_from_phdr(
       reinterpret_cast<ElfW(Phdr)*>(getauxval(AT_PHDR)), getauxval(AT_PHNUM),
@@ -603,7 +628,7 @@
   // itself without having to look into local_group and (2) allocators
   // are not yet initialized, and therefore we cannot use linked_list.push_*
   // functions at this point.
-  if (!tmp_linker_so.link_image(g_empty_list, g_empty_list, nullptr)) __linker_cannot_link(args.argv[0]);
+  if (!tmp_linker_so.link_image(g_empty_list, g_empty_list, nullptr, nullptr)) __linker_cannot_link(args.argv[0]);
 
   return __linker_init_post_relocation(args, tmp_linker_so);
 }
diff --git a/linker/linker_memory.cpp b/linker/linker_memory.cpp
index f2cce01..ce29997 100644
--- a/linker/linker_memory.cpp
+++ b/linker/linker_memory.cpp
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 
-#include "linker_allocator.h"
+#include "private/bionic_allocator.h"
 
 #include <stdlib.h>
 #include <sys/cdefs.h>
@@ -36,7 +36,7 @@
 
 #include <async_safe/log.h>
 
-static LinkerMemoryAllocator g_linker_allocator;
+static BionicAllocator g_bionic_allocator;
 static std::atomic<pid_t> fallback_tid(0);
 
 // Used by libdebuggerd_handler to switch allocators during a crash dump, in
@@ -56,16 +56,16 @@
   }
 }
 
-static LinkerMemoryAllocator& get_fallback_allocator() {
-  static LinkerMemoryAllocator fallback_allocator;
+static BionicAllocator& get_fallback_allocator() {
+  static BionicAllocator fallback_allocator;
   return fallback_allocator;
 }
 
-static LinkerMemoryAllocator& get_allocator() {
+static BionicAllocator& get_allocator() {
   if (__predict_false(fallback_tid) && __predict_false(gettid() == fallback_tid)) {
     return get_fallback_allocator();
   }
-  return g_linker_allocator;
+  return g_bionic_allocator;
 }
 
 void* malloc(size_t byte_count) {
diff --git a/linker/linker_namespaces.cpp b/linker/linker_namespaces.cpp
index fd72cdc..e870ef7 100644
--- a/linker/linker_namespaces.cpp
+++ b/linker/linker_namespaces.cpp
@@ -38,6 +38,14 @@
     return true;
   }
 
+  if (!whitelisted_libs_.empty()) {
+    const char *lib_name = basename(file.c_str());
+    if (std::find(whitelisted_libs_.begin(), whitelisted_libs_.end(),
+                  lib_name) == whitelisted_libs_.end()) {
+      return false;
+    }
+  }
+
   for (const auto& dir : ld_library_paths_) {
     if (file_is_in_dir(file, dir)) {
       return true;
diff --git a/linker/linker_namespaces.h b/linker/linker_namespaces.h
index cd8b09d..f4428eb 100644
--- a/linker/linker_namespaces.h
+++ b/linker/linker_namespaces.h
@@ -87,14 +87,14 @@
     return ld_library_paths_;
   }
   void set_ld_library_paths(std::vector<std::string>&& library_paths) {
-    ld_library_paths_ = library_paths;
+    ld_library_paths_ = std::move(library_paths);
   }
 
   const std::vector<std::string>& get_default_library_paths() const {
     return default_library_paths_;
   }
   void set_default_library_paths(std::vector<std::string>&& library_paths) {
-    default_library_paths_ = library_paths;
+    default_library_paths_ = std::move(library_paths);
   }
   void set_default_library_paths(const std::vector<std::string>& library_paths) {
     default_library_paths_ = library_paths;
@@ -104,12 +104,22 @@
     return permitted_paths_;
   }
   void set_permitted_paths(std::vector<std::string>&& permitted_paths) {
-    permitted_paths_ = permitted_paths;
+    permitted_paths_ = std::move(permitted_paths);
   }
   void set_permitted_paths(const std::vector<std::string>& permitted_paths) {
     permitted_paths_ = permitted_paths;
   }
 
+  const std::vector<std::string>& get_whitelisted_libs() const {
+    return whitelisted_libs_;
+  }
+  void set_whitelisted_libs(std::vector<std::string>&& whitelisted_libs) {
+    whitelisted_libs_ = std::move(whitelisted_libs);
+  }
+  void set_whitelisted_libs(const std::vector<std::string>& whitelisted_libs) {
+    whitelisted_libs_ = whitelisted_libs;
+  }
+
   const std::vector<android_namespace_link_t>& linked_namespaces() const {
     return linked_namespaces_;
   }
@@ -157,6 +167,7 @@
   std::vector<std::string> ld_library_paths_;
   std::vector<std::string> default_library_paths_;
   std::vector<std::string> permitted_paths_;
+  std::vector<std::string> whitelisted_libs_;
   // Loader looks into linked namespace if it was not able
   // to find a library in this namespace. Note that library
   // lookup in linked namespaces are limited by the list of
diff --git a/linker/linker_phdr.cpp b/linker/linker_phdr.cpp
index 34ac606..3534287 100644
--- a/linker/linker_phdr.cpp
+++ b/linker/linker_phdr.cpp
@@ -166,14 +166,12 @@
   return did_read_;
 }
 
-bool ElfReader::Load(const android_dlextinfo* extinfo) {
+bool ElfReader::Load(address_space_params* address_space) {
   CHECK(did_read_);
   if (did_load_) {
     return true;
   }
-  if (ReserveAddressSpace(extinfo) &&
-      LoadSegments() &&
-      FindPhdr()) {
+  if (ReserveAddressSpace(address_space) && LoadSegments() && FindPhdr()) {
     did_load_ = true;
   }
 
@@ -559,7 +557,7 @@
 // Reserve a virtual address range big enough to hold all loadable
 // segments of a program header table. This is done by creating a
 // private anonymous mmap() with PROT_NONE.
-bool ElfReader::ReserveAddressSpace(const android_dlextinfo* extinfo) {
+bool ElfReader::ReserveAddressSpace(address_space_params* address_space) {
   ElfW(Addr) min_vaddr;
   load_size_ = phdr_table_get_load_size(phdr_table_, phdr_num_, &min_vaddr);
   if (load_size_ == 0) {
@@ -569,22 +567,11 @@
 
   uint8_t* addr = reinterpret_cast<uint8_t*>(min_vaddr);
   void* start;
-  size_t reserved_size = 0;
-  bool reserved_hint = true;
 
-  if (extinfo != nullptr) {
-    if (extinfo->flags & ANDROID_DLEXT_RESERVED_ADDRESS) {
-      reserved_size = extinfo->reserved_size;
-      reserved_hint = false;
-    } else if (extinfo->flags & ANDROID_DLEXT_RESERVED_ADDRESS_HINT) {
-      reserved_size = extinfo->reserved_size;
-    }
-  }
-
-  if (load_size_ > reserved_size) {
-    if (!reserved_hint) {
+  if (load_size_ > address_space->reserved_size) {
+    if (address_space->must_use_address) {
       DL_ERR("reserved address space %zd smaller than %zd bytes needed for \"%s\"",
-             reserved_size - load_size_, load_size_, name_.c_str());
+             load_size_ - address_space->reserved_size, load_size_, name_.c_str());
       return false;
     }
     start = ReserveAligned(load_size_, kLibraryAlignment);
@@ -593,8 +580,12 @@
       return false;
     }
   } else {
-    start = extinfo->reserved_addr;
+    start = address_space->start_addr;
     mapped_by_caller_ = true;
+
+    // Update the reserved address space to subtract the space used by this library.
+    address_space->start_addr = reinterpret_cast<uint8_t*>(address_space->start_addr) + load_size_;
+    address_space->reserved_size -= load_size_;
   }
 
   load_start_ = start;
@@ -840,16 +831,17 @@
  *   phdr_count  -> number of entries in tables
  *   load_bias   -> load bias
  *   fd          -> writable file descriptor to use
+ *   file_offset -> pointer to offset into file descriptor to use/update
  * Return:
  *   0 on error, -1 on failure (error code in errno).
  */
 int phdr_table_serialize_gnu_relro(const ElfW(Phdr)* phdr_table,
                                    size_t phdr_count,
                                    ElfW(Addr) load_bias,
-                                   int fd) {
+                                   int fd,
+                                   size_t* file_offset) {
   const ElfW(Phdr)* phdr = phdr_table;
   const ElfW(Phdr)* phdr_limit = phdr + phdr_count;
-  ssize_t file_offset = 0;
 
   for (phdr = phdr_table; phdr < phdr_limit; phdr++) {
     if (phdr->p_type != PT_GNU_RELRO) {
@@ -865,11 +857,11 @@
       return -1;
     }
     void* map = mmap(reinterpret_cast<void*>(seg_page_start), size, PROT_READ,
-                     MAP_PRIVATE|MAP_FIXED, fd, file_offset);
+                     MAP_PRIVATE|MAP_FIXED, fd, *file_offset);
     if (map == MAP_FAILED) {
       return -1;
     }
-    file_offset += size;
+    *file_offset += size;
   }
   return 0;
 }
@@ -887,13 +879,15 @@
  *   phdr_count  -> number of entries in tables
  *   load_bias   -> load bias
  *   fd          -> readable file descriptor to use
+ *   file_offset -> pointer to offset into file descriptor to use/update
  * Return:
  *   0 on error, -1 on failure (error code in errno).
  */
 int phdr_table_map_gnu_relro(const ElfW(Phdr)* phdr_table,
                              size_t phdr_count,
                              ElfW(Addr) load_bias,
-                             int fd) {
+                             int fd,
+                             size_t* file_offset) {
   // Map the file at a temporary location so we can compare its contents.
   struct stat file_stat;
   if (TEMP_FAILURE_RETRY(fstat(fd, &file_stat)) != 0) {
@@ -907,7 +901,6 @@
       return -1;
     }
   }
-  size_t file_offset = 0;
 
   // Iterate over the relro segments and compare/remap the pages.
   const ElfW(Phdr)* phdr = phdr_table;
@@ -921,12 +914,12 @@
     ElfW(Addr) seg_page_start = PAGE_START(phdr->p_vaddr) + load_bias;
     ElfW(Addr) seg_page_end   = PAGE_END(phdr->p_vaddr + phdr->p_memsz) + load_bias;
 
-    char* file_base = static_cast<char*>(temp_mapping) + file_offset;
+    char* file_base = static_cast<char*>(temp_mapping) + *file_offset;
     char* mem_base = reinterpret_cast<char*>(seg_page_start);
     size_t match_offset = 0;
     size_t size = seg_page_end - seg_page_start;
 
-    if (file_size - file_offset < size) {
+    if (file_size - *file_offset < size) {
       // File is too short to compare to this segment. The contents are likely
       // different as well (it's probably for a different library version) so
       // just don't bother checking.
@@ -950,7 +943,7 @@
       // Map over similar pages.
       if (mismatch_offset > match_offset) {
         void* map = mmap(mem_base + match_offset, mismatch_offset - match_offset,
-                         PROT_READ, MAP_PRIVATE|MAP_FIXED, fd, match_offset);
+                         PROT_READ, MAP_PRIVATE|MAP_FIXED, fd, *file_offset + match_offset);
         if (map == MAP_FAILED) {
           munmap(temp_mapping, file_size);
           return -1;
@@ -961,7 +954,7 @@
     }
 
     // Add to the base file offset in case there are multiple relro segments.
-    file_offset += size;
+    *file_offset += size;
   }
   munmap(temp_mapping, file_size);
   return 0;
diff --git a/linker/linker_phdr.h b/linker/linker_phdr.h
index 0eee089..5d1cfc2 100644
--- a/linker/linker_phdr.h
+++ b/linker/linker_phdr.h
@@ -43,7 +43,7 @@
   ElfReader();
 
   bool Read(const char* name, int fd, off64_t file_offset, off64_t file_size);
-  bool Load(const android_dlextinfo* extinfo);
+  bool Load(address_space_params* address_space);
 
   const char* name() const { return name_.c_str(); }
   size_t phdr_count() const { return phdr_num_; }
@@ -62,7 +62,7 @@
   bool ReadProgramHeaders();
   bool ReadSectionHeaders();
   bool ReadDynamicSection();
-  bool ReserveAddressSpace(const android_dlextinfo* extinfo);
+  bool ReserveAddressSpace(address_space_params* address_space);
   bool LoadSegments();
   bool FindPhdr();
   bool CheckPhdr(ElfW(Addr));
@@ -119,10 +119,10 @@
                                  ElfW(Addr) load_bias);
 
 int phdr_table_serialize_gnu_relro(const ElfW(Phdr)* phdr_table, size_t phdr_count,
-                                   ElfW(Addr) load_bias, int fd);
+                                   ElfW(Addr) load_bias, int fd, size_t* file_offset);
 
 int phdr_table_map_gnu_relro(const ElfW(Phdr)* phdr_table, size_t phdr_count,
-                             ElfW(Addr) load_bias, int fd);
+                             ElfW(Addr) load_bias, int fd, size_t* file_offset);
 
 #if defined(__arm__)
 int phdr_table_get_arm_exidx(const ElfW(Phdr)* phdr_table, size_t phdr_count, ElfW(Addr) load_bias,
diff --git a/linker/linker_relocs.h b/linker/linker_relocs.h
index 4bab0e0..68191f9 100644
--- a/linker/linker_relocs.h
+++ b/linker/linker_relocs.h
@@ -34,30 +34,46 @@
 
 #if defined (__aarch64__)
 
-#define R_GENERIC_JUMP_SLOT R_AARCH64_JUMP_SLOT
-#define R_GENERIC_GLOB_DAT  R_AARCH64_GLOB_DAT
-#define R_GENERIC_RELATIVE  R_AARCH64_RELATIVE
-#define R_GENERIC_IRELATIVE R_AARCH64_IRELATIVE
+#define R_GENERIC_JUMP_SLOT     R_AARCH64_JUMP_SLOT
+#define R_GENERIC_GLOB_DAT      R_AARCH64_GLOB_DAT
+#define R_GENERIC_RELATIVE      R_AARCH64_RELATIVE
+#define R_GENERIC_IRELATIVE     R_AARCH64_IRELATIVE
+#define R_GENERIC_TLS_DTPMOD    R_AARCH64_TLS_DTPMOD64
+#define R_GENERIC_TLS_DTPREL    R_AARCH64_TLS_DTPREL64
+#define R_GENERIC_TLS_TPREL     R_AARCH64_TLS_TPREL64
+#define R_GENERIC_TLSDESC       R_AARCH64_TLSDESC
 
 #elif defined (__arm__)
 
-#define R_GENERIC_JUMP_SLOT R_ARM_JUMP_SLOT
-#define R_GENERIC_GLOB_DAT  R_ARM_GLOB_DAT
-#define R_GENERIC_RELATIVE  R_ARM_RELATIVE
-#define R_GENERIC_IRELATIVE R_ARM_IRELATIVE
+#define R_GENERIC_JUMP_SLOT     R_ARM_JUMP_SLOT
+#define R_GENERIC_GLOB_DAT      R_ARM_GLOB_DAT
+#define R_GENERIC_RELATIVE      R_ARM_RELATIVE
+#define R_GENERIC_IRELATIVE     R_ARM_IRELATIVE
+#define R_GENERIC_TLS_DTPMOD    R_ARM_TLS_DTPMOD32
+#define R_GENERIC_TLS_DTPREL    R_ARM_TLS_DTPOFF32
+#define R_GENERIC_TLS_TPREL     R_ARM_TLS_TPOFF32
+#define R_GENERIC_TLSDESC       R_ARM_TLS_DESC
 
 #elif defined (__i386__)
 
-#define R_GENERIC_JUMP_SLOT R_386_JMP_SLOT
-#define R_GENERIC_GLOB_DAT  R_386_GLOB_DAT
-#define R_GENERIC_RELATIVE  R_386_RELATIVE
-#define R_GENERIC_IRELATIVE R_386_IRELATIVE
+#define R_GENERIC_JUMP_SLOT     R_386_JMP_SLOT
+#define R_GENERIC_GLOB_DAT      R_386_GLOB_DAT
+#define R_GENERIC_RELATIVE      R_386_RELATIVE
+#define R_GENERIC_IRELATIVE     R_386_IRELATIVE
+#define R_GENERIC_TLS_DTPMOD    R_386_TLS_DTPMOD32
+#define R_GENERIC_TLS_DTPREL    R_386_TLS_DTPOFF32
+#define R_GENERIC_TLS_TPREL     R_386_TLS_TPOFF
+#define R_GENERIC_TLSDESC       R_386_TLS_DESC
 
 #elif defined (__x86_64__)
 
-#define R_GENERIC_JUMP_SLOT R_X86_64_JUMP_SLOT
-#define R_GENERIC_GLOB_DAT  R_X86_64_GLOB_DAT
-#define R_GENERIC_RELATIVE  R_X86_64_RELATIVE
-#define R_GENERIC_IRELATIVE R_X86_64_IRELATIVE
+#define R_GENERIC_JUMP_SLOT     R_X86_64_JUMP_SLOT
+#define R_GENERIC_GLOB_DAT      R_X86_64_GLOB_DAT
+#define R_GENERIC_RELATIVE      R_X86_64_RELATIVE
+#define R_GENERIC_IRELATIVE     R_X86_64_IRELATIVE
+#define R_GENERIC_TLS_DTPMOD    R_X86_64_DTPMOD64
+#define R_GENERIC_TLS_DTPREL    R_X86_64_DTPOFF64
+#define R_GENERIC_TLS_TPREL     R_X86_64_TPOFF64
+#define R_GENERIC_TLSDESC       R_X86_64_TLSDESC
 
 #endif
diff --git a/linker/linker_sleb128_test.cpp b/linker/linker_sleb128_test.cpp
new file mode 100644
index 0000000..9e819c6
--- /dev/null
+++ b/linker/linker_sleb128_test.cpp
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2016 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 <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+
+#include <gtest/gtest.h>
+
+#include "linker_sleb128.h"
+
+TEST(linker_sleb128, smoke) {
+  std::vector<uint8_t> encoding;
+  // 624485
+  encoding.push_back(0xe5);
+  encoding.push_back(0x8e);
+  encoding.push_back(0x26);
+  // 0
+  encoding.push_back(0x00);
+  // 1
+  encoding.push_back(0x01);
+  // 63
+  encoding.push_back(0x3f);
+  // 64
+  encoding.push_back(0xc0);
+  encoding.push_back(0x00);
+  // -1
+  encoding.push_back(0x7f);
+  // -624485
+  encoding.push_back(0x9b);
+  encoding.push_back(0xf1);
+  encoding.push_back(0x59);
+  // 2147483647
+  encoding.push_back(0xff);
+  encoding.push_back(0xff);
+  encoding.push_back(0xff);
+  encoding.push_back(0xff);
+  encoding.push_back(0x07);
+  // -2147483648
+  encoding.push_back(0x80);
+  encoding.push_back(0x80);
+  encoding.push_back(0x80);
+  encoding.push_back(0x80);
+  encoding.push_back(0x78);
+#if defined(__LP64__)
+  // 9223372036854775807
+  encoding.push_back(0xff);
+  encoding.push_back(0xff);
+  encoding.push_back(0xff);
+  encoding.push_back(0xff);
+  encoding.push_back(0xff);
+  encoding.push_back(0xff);
+  encoding.push_back(0xff);
+  encoding.push_back(0xff);
+  encoding.push_back(0xff);
+  encoding.push_back(0x00);
+  // -9223372036854775808
+  encoding.push_back(0x80);
+  encoding.push_back(0x80);
+  encoding.push_back(0x80);
+  encoding.push_back(0x80);
+  encoding.push_back(0x80);
+  encoding.push_back(0x80);
+  encoding.push_back(0x80);
+  encoding.push_back(0x80);
+  encoding.push_back(0x80);
+  encoding.push_back(0x7f);
+#endif
+  sleb128_decoder decoder(&encoding[0], encoding.size());
+
+  EXPECT_EQ(624485U, decoder.pop_front());
+
+  EXPECT_EQ(0U, decoder.pop_front());
+  EXPECT_EQ(1U, decoder.pop_front());
+  EXPECT_EQ(63U, decoder.pop_front());
+  EXPECT_EQ(64U, decoder.pop_front());
+  EXPECT_EQ(static_cast<size_t>(-1), decoder.pop_front());
+  EXPECT_EQ(static_cast<size_t>(-624485), decoder.pop_front());
+  EXPECT_EQ(2147483647U, decoder.pop_front());
+  EXPECT_EQ(static_cast<size_t>(-2147483648), decoder.pop_front());
+#if defined(__LP64__)
+  EXPECT_EQ(9223372036854775807ULL, decoder.pop_front());
+  EXPECT_EQ(static_cast<uint64_t>(-9223372036854775807LL - 1), decoder.pop_front());
+#endif
+}
diff --git a/linker/linker_soinfo.cpp b/linker/linker_soinfo.cpp
index 93079ca..31ee74c 100644
--- a/linker/linker_soinfo.cpp
+++ b/linker/linker_soinfo.cpp
@@ -82,8 +82,15 @@
   split_path(path, ":", &runpaths);
 
   std::string origin = dirname(get_realpath());
-  // FIXME: add $LIB and $PLATFORM.
-  std::vector<std::pair<std::string, std::string>> params = {{"ORIGIN", origin}};
+  // FIXME: add $PLATFORM.
+  std::vector<std::pair<std::string, std::string>> params = {
+    {"ORIGIN", origin},
+#if defined(LIB_PATH)
+    {"LIB", LIB_PATH},
+#else
+#error "LIB_PATH not defined"
+#endif
+  };
   for (auto&& s : runpaths) {
     format_string(&s, params);
   }
@@ -290,7 +297,11 @@
 }
 
 static bool symbol_matches_soaddr(const ElfW(Sym)* sym, ElfW(Addr) soaddr) {
+  // Skip TLS symbols. A TLS symbol's value is relative to the start of the TLS segment rather than
+  // to the start of the solib. The solib only reserves space for the initialized part of the TLS
+  // segment. (i.e. .tdata is followed by .tbss, and .tbss overlaps other sections.)
   return sym->st_shndx != SHN_UNDEF &&
+      ELF_ST_TYPE(sym->st_info) != STT_TLS &&
       soaddr >= sym->st_value &&
       soaddr < sym->st_value + sym->st_size;
 }
@@ -628,6 +639,10 @@
   return secondary_namespaces_;
 }
 
+soinfo_tls* soinfo::get_tls() const {
+  return has_min_version(5) ? tls_.get() : nullptr;
+}
+
 ElfW(Addr) soinfo::resolve_symbol_address(const ElfW(Sym)* s) const {
   if (ELF_ST_TYPE(s->st_info) == STT_GNU_IFUNC) {
     return call_ifunc_resolver(s->st_value + load_bias);
diff --git a/linker/linker_soinfo.h b/linker/linker_soinfo.h
index 44bff28..80c51af 100644
--- a/linker/linker_soinfo.h
+++ b/linker/linker_soinfo.h
@@ -30,9 +30,13 @@
 
 #include <link.h>
 
+#include <memory>
 #include <string>
+#include <vector>
 
+#include "private/bionic_elf_tls.h"
 #include "linker_namespaces.h"
+#include "linker_tls.h"
 
 #define FLAG_LINKED           0x00000001
 #define FLAG_EXE              0x00000004 // The main executable
@@ -61,7 +65,7 @@
                                          // unset.
 #define FLAG_NEW_SOINFO       0x40000000 // new soinfo format
 
-#define SOINFO_VERSION 4
+#define SOINFO_VERSION 5
 
 typedef void (*linker_dtor_function_t)();
 typedef void (*linker_ctor_function_t)(int, char**, char**);
@@ -100,6 +104,11 @@
 // TODO(dimitry): remove reference from soinfo member functions to this class.
 class VersionTracker;
 
+struct soinfo_tls {
+  TlsSegment segment;
+  size_t module_id = kTlsUninitializedModuleId;
+};
+
 #if defined(__work_around_b_24465209__)
 #define SOINFO_NAME_LEN 128
 #endif
@@ -214,7 +223,7 @@
   void call_pre_init_constructors();
   bool prelink_image();
   bool link_image(const soinfo_list_t& global_group, const soinfo_list_t& local_group,
-                  const android_dlextinfo* extinfo);
+                  const android_dlextinfo* extinfo, size_t* relro_fd_offset);
   bool protect_relro();
 
   void add_child(soinfo* child);
@@ -284,6 +293,8 @@
   void add_secondary_namespace(android_namespace_t* secondary_ns);
   android_namespace_list_t& get_secondary_namespaces();
 
+  soinfo_tls* get_tls() const;
+
   void set_mapped_by_caller(bool reserved_map);
   bool is_mapped_by_caller() const;
 
@@ -366,6 +377,10 @@
   // version >= 4
   ElfW(Relr)* relr_;
   size_t relr_count_;
+
+  // version >= 5
+  std::unique_ptr<soinfo_tls> tls_;
+  std::vector<TlsDynamicResolverArg> tlsdesc_args_;
 };
 
 // This function is used by dlvsym() to calculate hash of sym_ver
diff --git a/linker/tests/linker_globals.cpp b/linker/linker_test_globals.cpp
similarity index 100%
rename from linker/tests/linker_globals.cpp
rename to linker/linker_test_globals.cpp
diff --git a/linker/linker_tls.cpp b/linker/linker_tls.cpp
new file mode 100644
index 0000000..d2edbb3
--- /dev/null
+++ b/linker/linker_tls.cpp
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2019 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 "linker_tls.h"
+
+#include <vector>
+
+#include "async_safe/CHECK.h"
+#include "private/ScopedRWLock.h"
+#include "private/ScopedSignalBlocker.h"
+#include "private/bionic_defs.h"
+#include "private/bionic_elf_tls.h"
+#include "private/bionic_globals.h"
+#include "private/linker_native_bridge.h"
+#include "linker_main.h"
+#include "linker_soinfo.h"
+
+static bool g_static_tls_finished;
+static std::vector<TlsModule> g_tls_modules;
+
+static size_t get_unused_module_index() {
+  for (size_t i = 0; i < g_tls_modules.size(); ++i) {
+    if (g_tls_modules[i].soinfo_ptr == nullptr) {
+      return i;
+    }
+  }
+  g_tls_modules.push_back({});
+  __libc_shared_globals()->tls_modules.module_count = g_tls_modules.size();
+  __libc_shared_globals()->tls_modules.module_table = g_tls_modules.data();
+  return g_tls_modules.size() - 1;
+}
+
+static void register_tls_module(soinfo* si, size_t static_offset) {
+  TlsModules& libc_modules = __libc_shared_globals()->tls_modules;
+
+  // The global TLS module table points at the std::vector of modules declared
+  // in this file, so acquire a write lock before modifying the std::vector.
+  ScopedSignalBlocker ssb;
+  ScopedWriteLock locker(&libc_modules.rwlock);
+
+  size_t module_idx = get_unused_module_index();
+
+  soinfo_tls* si_tls = si->get_tls();
+  si_tls->module_id = __tls_module_idx_to_id(module_idx);
+
+  const size_t new_generation = ++libc_modules.generation;
+  __libc_tls_generation_copy = new_generation;
+  if (libc_modules.generation_libc_so != nullptr) {
+    *libc_modules.generation_libc_so = new_generation;
+  }
+
+  g_tls_modules[module_idx] = {
+    .segment = si_tls->segment,
+    .static_offset = static_offset,
+    .first_generation = new_generation,
+    .soinfo_ptr = si,
+  };
+}
+
+static void unregister_tls_module(soinfo* si) {
+  ScopedSignalBlocker ssb;
+  ScopedWriteLock locker(&__libc_shared_globals()->tls_modules.rwlock);
+
+  soinfo_tls* si_tls = si->get_tls();
+  TlsModule& mod = g_tls_modules[__tls_module_id_to_idx(si_tls->module_id)];
+  CHECK(mod.static_offset == SIZE_MAX);
+  CHECK(mod.soinfo_ptr == si);
+  mod = {};
+  si_tls->module_id = kTlsUninitializedModuleId;
+}
+
+// The reference is valid until a TLS module is registered or unregistered.
+const TlsModule& get_tls_module(size_t module_id) {
+  size_t module_idx = __tls_module_id_to_idx(module_id);
+  CHECK(module_idx < g_tls_modules.size());
+  return g_tls_modules[module_idx];
+}
+
+__BIONIC_WEAK_FOR_NATIVE_BRIDGE
+extern "C" void __linker_reserve_bionic_tls_in_static_tls() {
+  __libc_shared_globals()->static_tls_layout.reserve_bionic_tls();
+}
+
+void linker_setup_exe_static_tls(const char* progname) {
+  soinfo* somain = solist_get_somain();
+  StaticTlsLayout& layout = __libc_shared_globals()->static_tls_layout;
+  if (somain->get_tls() == nullptr) {
+    layout.reserve_exe_segment_and_tcb(nullptr, progname);
+  } else {
+    register_tls_module(somain, layout.reserve_exe_segment_and_tcb(&somain->get_tls()->segment, progname));
+  }
+
+  // The pthread key data is located at the very front of bionic_tls. As a
+  // temporary workaround, allocate bionic_tls just after the thread pointer so
+  // Golang can find its pthread key, as long as the executable's TLS segment is
+  // small enough. Specifically, Golang scans forward 384 words from the TP on
+  // ARM.
+  //  - http://b/118381796
+  //  - https://github.com/golang/go/issues/29674
+  __linker_reserve_bionic_tls_in_static_tls();
+}
+
+void linker_finalize_static_tls() {
+  g_static_tls_finished = true;
+  __libc_shared_globals()->static_tls_layout.finish_layout();
+}
+
+void register_soinfo_tls(soinfo* si) {
+  soinfo_tls* si_tls = si->get_tls();
+  if (si_tls == nullptr || si_tls->module_id != kTlsUninitializedModuleId) {
+    return;
+  }
+  size_t static_offset = SIZE_MAX;
+  if (!g_static_tls_finished) {
+    StaticTlsLayout& layout = __libc_shared_globals()->static_tls_layout;
+    static_offset = layout.reserve_solib_segment(si_tls->segment);
+  }
+  register_tls_module(si, static_offset);
+}
+
+void unregister_soinfo_tls(soinfo* si) {
+  soinfo_tls* si_tls = si->get_tls();
+  if (si_tls == nullptr || si_tls->module_id == kTlsUninitializedModuleId) {
+    return;
+  }
+  return unregister_tls_module(si);
+}
diff --git a/linker/linker_tls.h b/linker/linker_tls.h
new file mode 100644
index 0000000..87e1f0d
--- /dev/null
+++ b/linker/linker_tls.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#pragma once
+
+#include <stdlib.h>
+
+#include "private/bionic_elf_tls.h"
+
+struct TlsModule;
+struct soinfo;
+
+void linker_setup_exe_static_tls(const char* progname);
+void linker_finalize_static_tls();
+
+void register_soinfo_tls(soinfo* si);
+void unregister_soinfo_tls(soinfo* si);
+
+const TlsModule& get_tls_module(size_t module_id);
+
+typedef size_t TlsDescResolverFunc(size_t);
+
+struct TlsDescriptor {
+#if defined(__arm__)
+  size_t arg;
+  TlsDescResolverFunc* func;
+#else
+  TlsDescResolverFunc* func;
+  size_t arg;
+#endif
+};
+
+struct TlsDynamicResolverArg {
+  size_t generation;
+  TlsIndex index;
+};
+
+__LIBC_HIDDEN__ extern "C" size_t tlsdesc_resolver_static(size_t);
+__LIBC_HIDDEN__ extern "C" size_t tlsdesc_resolver_dynamic(size_t);
+__LIBC_HIDDEN__ extern "C" size_t tlsdesc_resolver_unresolved_weak(size_t);
diff --git a/linker/linker_utils_test.cpp b/linker/linker_utils_test.cpp
new file mode 100644
index 0000000..44907da
--- /dev/null
+++ b/linker/linker_utils_test.cpp
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2013 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 <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+
+#include <gtest/gtest.h>
+
+#include "linker_utils.h"
+
+TEST(linker_utils, format_string) {
+  std::vector<std::pair<std::string, std::string>> params = {{ "LIB", "lib32"}, { "SDKVER", "42"}};
+  std::string str_smoke = "LIB$LIB${LIB${SDKVER}SDKVER$TEST$";
+  format_string(&str_smoke, params);
+  ASSERT_EQ("LIBlib32${LIB42SDKVER$TEST$", str_smoke);
+}
+
+TEST(linker_utils, normalize_path_smoke) {
+  std::string output;
+  ASSERT_TRUE(normalize_path("/../root///dir/.///dir2/somedir/../zipfile!/dir/dir9//..///afile", &output));
+  ASSERT_EQ("/root/dir/dir2/zipfile!/dir/afile", output);
+
+  ASSERT_TRUE(normalize_path("/../root///dir/.///dir2/somedir/.../zipfile!/.dir/dir9//..///afile", &output));
+  ASSERT_EQ("/root/dir/dir2/somedir/.../zipfile!/.dir/afile", output);
+
+  ASSERT_TRUE(normalize_path("/root/..", &output));
+  ASSERT_EQ("/", output);
+
+  ASSERT_TRUE(normalize_path("/root/notroot/..", &output));
+  ASSERT_EQ("/root/", output);
+
+  ASSERT_TRUE(normalize_path("/a/../../b", &output));
+  ASSERT_EQ("/b", output);
+
+  ASSERT_TRUE(normalize_path("/..", &output));
+  ASSERT_EQ("/", output);
+
+  output = "unchanged";
+  ASSERT_FALSE(normalize_path("root///dir/.///dir2/somedir/../zipfile!/dir/dir9//..///afile", &output));
+  ASSERT_EQ("unchanged", output);
+}
+
+TEST(linker_utils, file_is_in_dir_smoke) {
+  ASSERT_TRUE(file_is_in_dir("/foo/bar/file", "/foo/bar"));
+  ASSERT_FALSE(file_is_in_dir("/foo/bar/file", "/foo"));
+
+  ASSERT_FALSE(file_is_in_dir("/foo/bar/file", "/bar/foo"));
+
+  ASSERT_TRUE(file_is_in_dir("/file", ""));
+  ASSERT_FALSE(file_is_in_dir("/file", "/"));
+}
+
+TEST(linker_utils, file_is_under_dir_smoke) {
+  ASSERT_TRUE(file_is_under_dir("/foo/bar/file", "/foo/bar"));
+  ASSERT_TRUE(file_is_under_dir("/foo/bar/file", "/foo"));
+
+  ASSERT_FALSE(file_is_under_dir("/foo/bar/file", "/bar/foo"));
+
+  ASSERT_TRUE(file_is_under_dir("/file", ""));
+  ASSERT_TRUE(file_is_under_dir("/foo/bar/file", ""));
+  ASSERT_FALSE(file_is_under_dir("/file", "/"));
+  ASSERT_FALSE(file_is_under_dir("/foo/bar/file", "/"));
+}
+
+TEST(linker_utils, parse_zip_path_smoke) {
+  std::string zip_path;
+  std::string entry_path;
+
+  ASSERT_FALSE(parse_zip_path("/not/a/zip/path/file.zip", &zip_path, &entry_path));
+  ASSERT_FALSE(parse_zip_path("/not/a/zip/path/file.zip!path/in/zip", &zip_path, &entry_path));
+  ASSERT_TRUE(parse_zip_path("/zip/path/file.zip!/path/in/zip", &zip_path, &entry_path));
+  ASSERT_EQ("/zip/path/file.zip", zip_path);
+  ASSERT_EQ("path/in/zip", entry_path);
+
+  ASSERT_TRUE(parse_zip_path("/zip/path/file2.zip!/", &zip_path, &entry_path));
+  ASSERT_EQ("/zip/path/file2.zip", zip_path);
+  ASSERT_EQ("", entry_path);
+}
+
+TEST(linker_utils, page_start) {
+  ASSERT_EQ(0x0001000, page_start(0x0001000));
+  ASSERT_EQ(0x3002000, page_start(0x300222f));
+  ASSERT_EQ(0x6001000, page_start(0x6001fff));
+}
+
+TEST(linker_utils, page_offset) {
+  ASSERT_EQ(0x0U, page_offset(0x0001000));
+  ASSERT_EQ(0x22fU, page_offset(0x300222f));
+  ASSERT_EQ(0xfffU, page_offset(0x6001fff));
+}
+
+TEST(linker_utils, safe_add) {
+  int64_t val = 42;
+  ASSERT_FALSE(safe_add(&val, INT64_MAX-20, 21U));
+  ASSERT_EQ(42, val);
+  ASSERT_TRUE(safe_add(&val, INT64_MAX-42, 42U));
+  ASSERT_EQ(INT64_MAX, val);
+  ASSERT_TRUE(safe_add(&val, 2000, 42U));
+  ASSERT_EQ(2042, val);
+}
diff --git a/linker/tests/Android.mk b/linker/tests/Android.mk
deleted file mode 100644
index 9268e31..0000000
--- a/linker/tests/Android.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# Copyright (C) 2012 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.
-#
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := linker-unit-tests
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
-LOCAL_CFLAGS += -g -Wall -Wextra -Wunused -Werror
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../libc/
-
-LOCAL_SRC_FILES := \
-  linker_block_allocator_test.cpp \
-  linker_config_test.cpp \
-  linker_globals.cpp \
-  linked_list_test.cpp \
-  linker_memory_allocator_test.cpp \
-  linker_sleb128_test.cpp \
-  linker_utils_test.cpp \
-  ../linker_allocator.cpp \
-  ../linker_block_allocator.cpp \
-  ../linker_config.cpp \
-  ../linker_utils.cpp \
-
-LOCAL_STATIC_LIBRARIES += libasync_safe libbase liblog
-
-include $(BUILD_NATIVE_TEST)
diff --git a/linker/tests/linked_list_test.cpp b/linker/tests/linked_list_test.cpp
deleted file mode 100644
index 2b88ed0..0000000
--- a/linker/tests/linked_list_test.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Copyright (C) 2013 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 <stdlib.h>
-#include <string>
-#include <sstream>
-
-#include <gtest/gtest.h>
-
-#include "../linked_list.h"
-
-namespace {
-
-bool alloc_called = false;
-bool free_called = false;
-
-class LinkedListTestAllocator {
- public:
-  typedef LinkedListEntry<const char> entry_t;
-
-  static entry_t* alloc() {
-    alloc_called = true;
-    return reinterpret_cast<entry_t*>(::malloc(sizeof(entry_t)));
-  }
-
-  static void free(entry_t* p) {
-    free_called = true;
-    ::free(p);
-  }
- private:
-  DISALLOW_IMPLICIT_CONSTRUCTORS(LinkedListTestAllocator);
-};
-
-typedef LinkedList<const char, LinkedListTestAllocator> test_list_t;
-
-std::string test_list_to_string(test_list_t& list) {
-  std::stringstream ss;
-  list.for_each([&] (const char* c) {
-    ss << c;
-  });
-
-  return ss.str();
-}
-
-};
-
-TEST(linked_list, simple) {
-  alloc_called = free_called = false;
-  test_list_t list;
-  ASSERT_EQ("", test_list_to_string(list));
-  ASSERT_TRUE(!alloc_called);
-  ASSERT_TRUE(!free_called);
-  list.push_front("a");
-  ASSERT_TRUE(alloc_called);
-  ASSERT_TRUE(!free_called);
-  ASSERT_EQ("a", test_list_to_string(list));
-  list.push_front("b");
-  ASSERT_EQ("ba", test_list_to_string(list));
-  list.push_front("c");
-  list.push_front("d");
-  ASSERT_EQ("dcba", test_list_to_string(list));
-  ASSERT_TRUE(alloc_called);
-  ASSERT_TRUE(!free_called);
-  alloc_called = free_called = false;
-  list.remove_if([] (const char* c) {
-    return *c == 'c';
-  });
-
-  ASSERT_TRUE(!alloc_called);
-  ASSERT_TRUE(free_called);
-
-  ASSERT_EQ("dba", test_list_to_string(list));
-  alloc_called = free_called = false;
-  list.remove_if([] (const char* c) {
-    return *c == '2';
-  });
-  ASSERT_TRUE(!alloc_called);
-  ASSERT_TRUE(!free_called);
-  ASSERT_EQ("dba", test_list_to_string(list));
-  list.clear();
-  ASSERT_TRUE(!alloc_called);
-  ASSERT_TRUE(free_called);
-  ASSERT_EQ("", test_list_to_string(list));
-}
-
-TEST(linked_list, push_pop) {
-  test_list_t list;
-  list.push_front("b");
-  list.push_front("a");
-  ASSERT_EQ("ab", test_list_to_string(list));
-  list.push_back("c");
-  ASSERT_EQ("abc", test_list_to_string(list));
-  ASSERT_STREQ("a", list.pop_front());
-  ASSERT_EQ("bc", test_list_to_string(list));
-  ASSERT_STREQ("b", list.pop_front());
-  ASSERT_EQ("c", test_list_to_string(list));
-  ASSERT_STREQ("c", list.pop_front());
-  ASSERT_EQ("", test_list_to_string(list));
-  ASSERT_TRUE(list.pop_front() == nullptr);
-  list.push_back("r");
-  ASSERT_EQ("r", test_list_to_string(list));
-  ASSERT_STREQ("r", list.pop_front());
-  ASSERT_TRUE(list.pop_front() == nullptr);
-}
-
-TEST(linked_list, remove_if_then_pop) {
-  test_list_t list;
-  list.push_back("a");
-  list.push_back("b");
-  list.push_back("c");
-  list.push_back("d");
-  list.remove_if([](const char* c) {
-    return *c == 'b' || *c == 'c';
-  });
-
-  ASSERT_EQ("ad", test_list_to_string(list));
-  ASSERT_STREQ("a", list.pop_front());
-  ASSERT_EQ("d", test_list_to_string(list));
-  ASSERT_STREQ("d", list.pop_front());
-  ASSERT_TRUE(list.pop_front() == nullptr);
-}
-
-TEST(linked_list, remove_if_last_then_push_back) {
-  test_list_t list;
-
-  list.push_back("a");
-  list.push_back("b");
-  list.push_back("c");
-  list.push_back("d");
-
-  list.remove_if([](const char* c) {
-    return *c == 'c' || *c == 'd';
-  });
-
-  ASSERT_EQ("ab", test_list_to_string(list));
-  list.push_back("d");
-  ASSERT_EQ("abd", test_list_to_string(list));
-}
-
-TEST(linked_list, copy_to_array) {
-  test_list_t list;
-  const size_t max_size = 128;
-  const char* buf[max_size];
-  memset(buf, 0, sizeof(buf));
-
-  ASSERT_EQ(0U, list.copy_to_array(buf, max_size));
-  ASSERT_EQ(nullptr, buf[0]);
-
-  list.push_back("a");
-  list.push_back("b");
-  list.push_back("c");
-  list.push_back("d");
-
-  memset(buf, 0, sizeof(buf));
-  ASSERT_EQ(2U, list.copy_to_array(buf, 2));
-  ASSERT_STREQ("a", buf[0]);
-  ASSERT_STREQ("b", buf[1]);
-  ASSERT_EQ(nullptr, buf[2]);
-
-  ASSERT_EQ(4U, list.copy_to_array(buf, max_size));
-  ASSERT_STREQ("a", buf[0]);
-  ASSERT_STREQ("b", buf[1]);
-  ASSERT_STREQ("c", buf[2]);
-  ASSERT_STREQ("d", buf[3]);
-  ASSERT_EQ(nullptr, buf[4]);
-
-  memset(buf, 0, sizeof(buf));
-  list.remove_if([](const char* c) {
-    return *c != 'c';
-  });
-  ASSERT_EQ(1U, list.copy_to_array(buf, max_size));
-  ASSERT_STREQ("c", buf[0]);
-  ASSERT_EQ(nullptr, buf[1]);
-
-  memset(buf, 0, sizeof(buf));
-
-  list.remove_if([](const char* c) {
-    return *c == 'c';
-  });
-
-  ASSERT_EQ(0U, list.copy_to_array(buf, max_size));
-  ASSERT_EQ(nullptr, buf[0]);
-}
-
-TEST(linked_list, test_visit) {
-  test_list_t list;
-  list.push_back("a");
-  list.push_back("b");
-  list.push_back("c");
-  list.push_back("d");
-
-  int visits = 0;
-  std::stringstream ss;
-  bool result = list.visit([&](const char* c) {
-    ++visits;
-    ss << c;
-    return true;
-  });
-
-  ASSERT_TRUE(result);
-  ASSERT_EQ(4, visits);
-  ASSERT_EQ("abcd", ss.str());
-
-  visits = 0;
-  ss.str(std::string());
-
-  result = list.visit([&](const char* c) {
-    if (++visits == 3) {
-      return false;
-    }
-
-    ss << c;
-    return true;
-  });
-
-  ASSERT_TRUE(!result);
-  ASSERT_EQ(3, visits);
-  ASSERT_EQ("ab", ss.str());
-}
-
diff --git a/linker/tests/linker_block_allocator_test.cpp b/linker/tests/linker_block_allocator_test.cpp
deleted file mode 100644
index d5eb97c..0000000
--- a/linker/tests/linker_block_allocator_test.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2013 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 <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-
-#include <gtest/gtest.h>
-
-#include "../linker_block_allocator.h"
-
-#include <unistd.h>
-
-namespace {
-
-struct test_struct_nominal {
-  void* pointer;
-  ssize_t value;
-};
-
-/*
- * this one has size below allocator cap which is 2*sizeof(void*)
- */
-struct test_struct_small {
-  char dummy_str[5];
-};
-
-/*
- * 1009 byte struct (1009 is prime)
- */
-struct test_struct_larger {
-  char dummy_str[1009];
-};
-
-static size_t kPageSize = sysconf(_SC_PAGE_SIZE);
-};
-
-TEST(linker_allocator, test_nominal) {
-  LinkerTypeAllocator<test_struct_nominal> allocator;
-
-  test_struct_nominal* ptr1 = allocator.alloc();
-  ASSERT_TRUE(ptr1 != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
-  test_struct_nominal* ptr2 = allocator.alloc();
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
-  ASSERT_TRUE(ptr2 != nullptr);
-  // they should be next to each other.
-  ASSERT_EQ(reinterpret_cast<uint8_t*>(ptr1)+16, reinterpret_cast<uint8_t*>(ptr2));
-
-  ptr1->value = 42;
-
-  allocator.free(ptr1);
-  allocator.free(ptr2);
-}
-
-TEST(linker_allocator, test_small) {
-  LinkerTypeAllocator<test_struct_small> allocator;
-
-  char* ptr1 = reinterpret_cast<char*>(allocator.alloc());
-  char* ptr2 = reinterpret_cast<char*>(allocator.alloc());
-
-  ASSERT_TRUE(ptr1 != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
-  ASSERT_TRUE(ptr2 != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
-  ASSERT_EQ(ptr1+16, ptr2); // aligned to 16
-}
-
-TEST(linker_allocator, test_larger) {
-  LinkerTypeAllocator<test_struct_larger> allocator;
-
-  test_struct_larger* ptr1 = allocator.alloc();
-  test_struct_larger* ptr2 = allocator.alloc();
-
-  ASSERT_TRUE(ptr1 != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
-  ASSERT_TRUE(ptr2 != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
-
-  ASSERT_EQ(reinterpret_cast<uint8_t*>(ptr1) + 1024, reinterpret_cast<uint8_t*>(ptr2));
-
-  // lets allocate until we reach next page.
-  size_t n = kPageSize/sizeof(test_struct_larger) + 1 - 2;
-
-  for (size_t i=0; i<n; ++i) {
-    ASSERT_TRUE(allocator.alloc() != nullptr);
-  }
-
-  test_struct_larger* ptr_to_free = allocator.alloc();
-  ASSERT_TRUE(ptr_to_free != nullptr);
-  allocator.free(ptr1);
-}
-
-static void protect_all() {
-  LinkerTypeAllocator<test_struct_larger> allocator;
-
-  // number of allocs to reach the end of first page
-  size_t n = kPageSize/sizeof(test_struct_larger) - 1;
-  test_struct_larger* page1_ptr = allocator.alloc();
-
-  for (size_t i=0; i<n; ++i) {
-    allocator.alloc();
-  }
-
-  test_struct_larger* page2_ptr = allocator.alloc();
-  allocator.protect_all(PROT_READ);
-  allocator.protect_all(PROT_READ | PROT_WRITE);
-  // check access
-  page2_ptr->dummy_str[23] = 27;
-  page1_ptr->dummy_str[13] = 11;
-
-  allocator.protect_all(PROT_READ);
-  fprintf(stderr, "trying to access protected page");
-
-  // this should result in segmentation fault
-  page1_ptr->dummy_str[11] = 7;
-}
-
-TEST(linker_allocator, test_protect) {
-  testing::FLAGS_gtest_death_test_style = "threadsafe";
-  ASSERT_EXIT(protect_all(), testing::KilledBySignal(SIGSEGV), "trying to access protected page");
-}
-
diff --git a/linker/tests/linker_config_test.cpp b/linker/tests/linker_config_test.cpp
deleted file mode 100644
index 14fd132..0000000
--- a/linker/tests/linker_config_test.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright (C) 2017 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 <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-
-#include <gtest/gtest.h>
-
-#include "../linker_config.h"
-#include "../linker_utils.h"
-
-#include <unistd.h>
-
-#include <android-base/file.h>
-#include <android-base/scopeguard.h>
-#include <android-base/stringprintf.h>
-
-#if defined(__LP64__)
-#define ARCH_SUFFIX "64"
-#else
-#define ARCH_SUFFIX ""
-#endif
-
-static const char* config_str =
-  "# comment \n"
-  "dir.test = /data/local/tmp\n"
-  "\n"
-  "[test]\n"
-  "\n"
-  "enable.target.sdk.version = true\n"
-  "additional.namespaces=system\n"
-  "additional.namespaces+=vndk\n"
-  "namespace.default.isolated = true\n"
-  "namespace.default.search.paths = /vendor/${LIB}\n"
-  "namespace.default.permitted.paths = /vendor/${LIB}\n"
-  "namespace.default.asan.search.paths = /data\n"
-  "namespace.default.asan.search.paths += /vendor/${LIB}\n"
-  "namespace.default.asan.permitted.paths = /data:/vendor\n"
-  "namespace.default.links = system\n"
-  "namespace.default.links += vndk\n"
-  // irregular whitespaces are added intentionally for testing purpose
-  "namespace.default.link.system.shared_libs=  libc.so\n"
-  "namespace.default.link.system.shared_libs +=   libm.so:libdl.so\n"
-  "namespace.default.link.system.shared_libs   +=libstdc++.so\n"
-  "namespace.default.link.vndk.shared_libs = libcutils.so:libbase.so\n"
-  "namespace.system.isolated = true\n"
-  "namespace.system.visible = true\n"
-  "namespace.system.search.paths = /system/${LIB}\n"
-  "namespace.system.permitted.paths = /system/${LIB}\n"
-  "namespace.system.asan.search.paths = /data:/system/${LIB}\n"
-  "namespace.system.asan.permitted.paths = /data:/system\n"
-  "namespace.vndk.isolated = tr\n"
-  "namespace.vndk.isolated += ue\n" // should be ignored and return as 'false'.
-  "namespace.vndk.search.paths = /system/${LIB}/vndk\n"
-  "namespace.vndk.asan.search.paths = /data\n"
-  "namespace.vndk.asan.search.paths += /system/${LIB}/vndk\n"
-  "namespace.vndk.links = default\n"
-  "namespace.vndk.link.default.allow_all_shared_libs = true\n"
-  "\n";
-
-static bool write_version(const std::string& path, uint32_t version) {
-  std::string content = android::base::StringPrintf("%d", version);
-  return android::base::WriteStringToFile(content, path);
-}
-
-static std::vector<std::string> resolve_paths(std::vector<std::string> paths) {
-  std::vector<std::string> resolved_paths;
-  resolve_paths(paths, &resolved_paths);
-  return resolved_paths;
-}
-
-static void run_linker_config_smoke_test(bool is_asan) {
-  const std::vector<std::string> kExpectedDefaultSearchPath =
-      resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/vendor/lib" ARCH_SUFFIX }) :
-                              std::vector<std::string>({ "/vendor/lib" ARCH_SUFFIX }));
-
-  const std::vector<std::string> kExpectedDefaultPermittedPath =
-      resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/vendor" }) :
-                              std::vector<std::string>({ "/vendor/lib" ARCH_SUFFIX }));
-
-  const std::vector<std::string> kExpectedSystemSearchPath =
-      resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/system/lib" ARCH_SUFFIX }) :
-                              std::vector<std::string>({ "/system/lib" ARCH_SUFFIX }));
-
-  const std::vector<std::string> kExpectedSystemPermittedPath =
-      resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/system" }) :
-                              std::vector<std::string>({ "/system/lib" ARCH_SUFFIX }));
-
-  const std::vector<std::string> kExpectedVndkSearchPath =
-      resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/system/lib" ARCH_SUFFIX "/vndk"}) :
-                              std::vector<std::string>({ "/system/lib" ARCH_SUFFIX "/vndk"}));
-
-  TemporaryFile tmp_file;
-  close(tmp_file.fd);
-  tmp_file.fd = -1;
-
-  android::base::WriteStringToFile(config_str, tmp_file.path);
-
-  TemporaryDir tmp_dir;
-
-  std::string executable_path = std::string(tmp_dir.path) + "/some-binary";
-  std::string version_file = std::string(tmp_dir.path) + "/.version";
-
-  auto file_guard =
-      android::base::make_scope_guard([&version_file] { unlink(version_file.c_str()); });
-
-  ASSERT_TRUE(write_version(version_file, 113U)) << strerror(errno);
-
-  // read config
-  const Config* config = nullptr;
-  std::string error_msg;
-  ASSERT_TRUE(Config::read_binary_config(tmp_file.path,
-                                         executable_path.c_str(),
-                                         is_asan,
-                                         &config,
-                                         &error_msg)) << error_msg;
-  ASSERT_TRUE(config != nullptr);
-  ASSERT_TRUE(error_msg.empty());
-
-  ASSERT_EQ(113, config->target_sdk_version());
-
-  const NamespaceConfig* default_ns_config = config->default_namespace_config();
-  ASSERT_TRUE(default_ns_config != nullptr);
-
-  ASSERT_TRUE(default_ns_config->isolated());
-  ASSERT_FALSE(default_ns_config->visible());
-  ASSERT_EQ(kExpectedDefaultSearchPath, default_ns_config->search_paths());
-  ASSERT_EQ(kExpectedDefaultPermittedPath, default_ns_config->permitted_paths());
-
-  const auto& default_ns_links = default_ns_config->links();
-  ASSERT_EQ(2U, default_ns_links.size());
-
-  ASSERT_EQ("system", default_ns_links[0].ns_name());
-  ASSERT_EQ("libc.so:libm.so:libdl.so:libstdc++.so", default_ns_links[0].shared_libs());
-  ASSERT_FALSE(default_ns_links[0].allow_all_shared_libs());
-
-  ASSERT_EQ("vndk", default_ns_links[1].ns_name());
-  ASSERT_EQ("libcutils.so:libbase.so", default_ns_links[1].shared_libs());
-  ASSERT_FALSE(default_ns_links[1].allow_all_shared_libs());
-
-  auto& ns_configs = config->namespace_configs();
-  ASSERT_EQ(3U, ns_configs.size());
-
-  // find second namespace
-  const NamespaceConfig* ns_system = nullptr;
-  const NamespaceConfig* ns_vndk = nullptr;
-  for (auto& ns : ns_configs) {
-    std::string ns_name = ns->name();
-    ASSERT_TRUE(ns_name == "system" || ns_name == "default" || ns_name == "vndk")
-        << "unexpected ns name: " << ns->name();
-
-    if (ns_name == "system") {
-      ns_system = ns.get();
-    } else if (ns_name == "vndk") {
-      ns_vndk = ns.get();
-    }
-  }
-
-  ASSERT_TRUE(ns_system != nullptr) << "system namespace was not found";
-
-  ASSERT_TRUE(ns_system->isolated());
-  ASSERT_TRUE(ns_system->visible());
-  ASSERT_EQ(kExpectedSystemSearchPath, ns_system->search_paths());
-  ASSERT_EQ(kExpectedSystemPermittedPath, ns_system->permitted_paths());
-
-  ASSERT_TRUE(ns_vndk != nullptr) << "vndk namespace was not found";
-
-  ASSERT_FALSE(ns_vndk->isolated()); // malformed bool property
-  ASSERT_FALSE(ns_vndk->visible()); // undefined bool property
-  ASSERT_EQ(kExpectedVndkSearchPath, ns_vndk->search_paths());
-
-  const auto& ns_vndk_links = ns_vndk->links();
-  ASSERT_EQ(1U, ns_vndk_links.size());
-  ASSERT_EQ("default", ns_vndk_links[0].ns_name());
-  ASSERT_TRUE(ns_vndk_links[0].allow_all_shared_libs());
-}
-
-TEST(linker_config, smoke) {
-  run_linker_config_smoke_test(false);
-}
-
-TEST(linker_config, asan_smoke) {
-  run_linker_config_smoke_test(true);
-}
-
-TEST(linker_config, ns_link_shared_libs_invalid_settings) {
-  // This unit test ensures an error is emitted when a namespace link in ld.config.txt specifies
-  // both shared_libs and allow_all_shared_libs.
-
-  static const char config_str[] =
-    "dir.test = /data/local/tmp\n"
-    "\n"
-    "[test]\n"
-    "additional.namespaces = system\n"
-    "namespace.default.links = system\n"
-    "namespace.default.link.system.shared_libs = libc.so:libm.so\n"
-    "namespace.default.link.system.allow_all_shared_libs = true\n"
-    "\n";
-
-  TemporaryFile tmp_file;
-  close(tmp_file.fd);
-  tmp_file.fd = -1;
-
-  android::base::WriteStringToFile(config_str, tmp_file.path);
-
-  TemporaryDir tmp_dir;
-
-  std::string executable_path = std::string(tmp_dir.path) + "/some-binary";
-
-  const Config* config = nullptr;
-  std::string error_msg;
-  ASSERT_FALSE(Config::read_binary_config(tmp_file.path,
-                                          executable_path.c_str(),
-                                          false,
-                                          &config,
-                                          &error_msg));
-  ASSERT_TRUE(config == nullptr);
-  ASSERT_EQ(std::string(tmp_file.path) + ":6: "
-            "error: both shared_libs and allow_all_shared_libs are set for default->system link.",
-            error_msg);
-}
-
-TEST(linker_config, dir_path_resolve) {
-  // This unit test ensures the linker resolves paths of dir.${section}
-  // properties to real path.
-
-  TemporaryDir tmp_dir;
-
-  std::string sub_dir = std::string(tmp_dir.path) + "/subdir";
-  mkdir(sub_dir.c_str(), 0755);
-
-  auto subdir_guard =
-      android::base::make_scope_guard([&sub_dir] { rmdir(sub_dir.c_str()); });
-
-  std::string symlink_path = std::string(tmp_dir.path) + "/symlink";
-  symlink(sub_dir.c_str(), symlink_path.c_str());
-
-  auto symlink_guard =
-      android::base::make_scope_guard([&symlink_path] { unlink(symlink_path.c_str()); });
-
-  std::string config_str =
-      "dir.test = " + symlink_path + "\n"
-      "\n"
-      "[test]\n";
-
-  TemporaryFile tmp_file;
-  close(tmp_file.fd);
-  tmp_file.fd = -1;
-
-  android::base::WriteStringToFile(config_str, tmp_file.path);
-
-  std::string executable_path = sub_dir + "/some-binary";
-
-  const Config* config = nullptr;
-  std::string error_msg;
-
-  ASSERT_TRUE(Config::read_binary_config(tmp_file.path,
-                                         executable_path.c_str(),
-                                         false,
-                                         &config,
-                                         &error_msg)) << error_msg;
-
-  ASSERT_TRUE(config != nullptr) << error_msg;
-  ASSERT_TRUE(error_msg.empty()) << error_msg;
-}
diff --git a/linker/tests/linker_memory_allocator_test.cpp b/linker/tests/linker_memory_allocator_test.cpp
deleted file mode 100644
index c284eaa..0000000
--- a/linker/tests/linker_memory_allocator_test.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (C) 2013 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 <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-
-#include <gtest/gtest.h>
-
-#include "../linker_allocator.h"
-
-#include <unistd.h>
-
-namespace {
-
-/*
- * this one has size below allocator cap which is 2*sizeof(void*)
- */
-struct test_struct_small {
-  char dummy_str[5];
-};
-
-struct test_struct_large {
-  char dummy_str[1009];
-};
-
-struct test_struct_huge {
-  char dummy_str[73939];
-};
-
-struct test_struct_512 {
-  char dummy_str[503];
-};
-
-};
-
-static size_t kPageSize = sysconf(_SC_PAGE_SIZE);
-
-TEST(linker_memory, test_alloc_0) {
-  LinkerMemoryAllocator allocator;
-  void* ptr = allocator.alloc(0);
-  ASSERT_TRUE(ptr != nullptr);
-  allocator.free(ptr);
-}
-
-TEST(linker_memory, test_free_nullptr) {
-  LinkerMemoryAllocator allocator;
-  allocator.free(nullptr);
-}
-
-TEST(linker_memory, test_realloc) {
-  LinkerMemoryAllocator allocator;
-  uint32_t* array = reinterpret_cast<uint32_t*>(allocator.alloc(512));
-  const size_t array_size = 512 / sizeof(uint32_t);
-
-  uint32_t model[1000];
-
-  model[0] = 1;
-  model[1] = 1;
-
-  for (size_t i = 2; i < 1000; ++i) {
-    model[i] = model[i - 1] + model[i - 2];
-  }
-
-  memcpy(array, model, array_size);
-
-  uint32_t* reallocated_ptr = reinterpret_cast<uint32_t*>(allocator.realloc(array, 1024));
-
-  ASSERT_TRUE(reallocated_ptr != nullptr);
-  ASSERT_TRUE(reallocated_ptr != array);
-
-  ASSERT_TRUE(memcmp(reallocated_ptr, model, array_size) == 0);
-
-  array = reallocated_ptr;
-
-  memcpy(array, model, 2*array_size);
-
-  reallocated_ptr = reinterpret_cast<uint32_t*>(allocator.realloc(array, 62));
-
-  ASSERT_TRUE(reallocated_ptr == array);
-
-  reallocated_ptr = reinterpret_cast<uint32_t*>(allocator.realloc(array, 4000));
-
-  ASSERT_TRUE(reallocated_ptr != nullptr);
-  ASSERT_TRUE(reallocated_ptr != array);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(reallocated_ptr) % 16);
-
-  ASSERT_TRUE(memcmp(reallocated_ptr, model, array_size * 2) == 0);
-
-  array = reallocated_ptr;
-
-  memcpy(array, model, 4000);
-
-  reallocated_ptr = reinterpret_cast<uint32_t*>(allocator.realloc(array, 64000));
-
-  ASSERT_TRUE(reallocated_ptr != nullptr);
-  ASSERT_TRUE(reallocated_ptr != array);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(reallocated_ptr) % 16);
-
-  ASSERT_TRUE(memcmp(reallocated_ptr, model, 4000) == 0);
-
-  ASSERT_EQ(nullptr, allocator.realloc(reallocated_ptr, 0));
-}
-
-TEST(linker_memory, test_small_smoke) {
-  LinkerMemoryAllocator allocator;
-
-  uint8_t zeros[16];
-  memset(zeros, 0, sizeof(zeros));
-
-  test_struct_small* ptr1 =
-      reinterpret_cast<test_struct_small*>(allocator.alloc(sizeof(test_struct_small)));
-  test_struct_small* ptr2 =
-      reinterpret_cast<test_struct_small*>(allocator.alloc(sizeof(test_struct_small)));
-
-  ASSERT_TRUE(ptr1 != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
-  ASSERT_TRUE(ptr2 != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
-
-  ASSERT_EQ(reinterpret_cast<uintptr_t>(ptr1)+16, reinterpret_cast<uintptr_t>(ptr2));
-  ASSERT_TRUE(memcmp(ptr1, zeros, 16) == 0);
-
-  allocator.free(ptr1);
-  allocator.free(ptr2);
-}
-
-TEST(linker_memory, test_huge_smoke) {
-  LinkerMemoryAllocator allocator;
-
-  // this should trigger proxy-to-mmap
-  test_struct_huge* ptr1 =
-      reinterpret_cast<test_struct_huge*>(allocator.alloc(sizeof(test_struct_huge)));
-  test_struct_huge* ptr2 =
-      reinterpret_cast<test_struct_huge*>(allocator.alloc(sizeof(test_struct_huge)));
-
-  ASSERT_TRUE(ptr1 != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
-  ASSERT_TRUE(ptr2 != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
-
-  ASSERT_TRUE(
-      reinterpret_cast<uintptr_t>(ptr1)/kPageSize != reinterpret_cast<uintptr_t>(ptr2)/kPageSize);
-  allocator.free(ptr2);
-  allocator.free(ptr1);
-}
-
-TEST(linker_memory, test_large) {
-  LinkerMemoryAllocator allocator;
-
-  test_struct_large* ptr1 =
-      reinterpret_cast<test_struct_large*>(allocator.alloc(sizeof(test_struct_large)));
-  test_struct_large* ptr2 =
-      reinterpret_cast<test_struct_large*>(allocator.alloc(1024));
-
-  ASSERT_TRUE(ptr1 != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
-  ASSERT_TRUE(ptr2 != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
-
-  ASSERT_EQ(reinterpret_cast<uintptr_t>(ptr1) + 1024, reinterpret_cast<uintptr_t>(ptr2));
-
-  // let's allocate until we reach the next page.
-  size_t n = kPageSize / sizeof(test_struct_large) + 1 - 2;
-  test_struct_large* objects[n];
-
-  for (size_t i = 0; i < n; ++i) {
-    test_struct_large* obj_ptr =
-        reinterpret_cast<test_struct_large*>(allocator.alloc(sizeof(test_struct_large)));
-    ASSERT_TRUE(obj_ptr != nullptr);
-    objects[i] = obj_ptr;
-  }
-
-  test_struct_large* ptr_to_free =
-      reinterpret_cast<test_struct_large*>(allocator.alloc(sizeof(test_struct_large)));
-
-  ASSERT_TRUE(ptr_to_free != nullptr);
-  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr_to_free) % 16);
-
-  allocator.free(ptr1);
-
-  for (size_t i=0; i<n; ++i) {
-    allocator.free(objects[i]);
-  }
-
-  allocator.free(ptr2);
-  allocator.free(ptr_to_free);
-}
-
-
diff --git a/linker/tests/linker_sleb128_test.cpp b/linker/tests/linker_sleb128_test.cpp
deleted file mode 100644
index 551faf2..0000000
--- a/linker/tests/linker_sleb128_test.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2016 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 <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-
-#include <gtest/gtest.h>
-
-#include "../linker_sleb128.h"
-
-TEST(linker_sleb128, smoke) {
-  std::vector<uint8_t> encoding;
-  // 624485
-  encoding.push_back(0xe5);
-  encoding.push_back(0x8e);
-  encoding.push_back(0x26);
-  // 0
-  encoding.push_back(0x00);
-  // 1
-  encoding.push_back(0x01);
-  // 63
-  encoding.push_back(0x3f);
-  // 64
-  encoding.push_back(0xc0);
-  encoding.push_back(0x00);
-  // -1
-  encoding.push_back(0x7f);
-  // -624485
-  encoding.push_back(0x9b);
-  encoding.push_back(0xf1);
-  encoding.push_back(0x59);
-  // 2147483647
-  encoding.push_back(0xff);
-  encoding.push_back(0xff);
-  encoding.push_back(0xff);
-  encoding.push_back(0xff);
-  encoding.push_back(0x07);
-  // -2147483648
-  encoding.push_back(0x80);
-  encoding.push_back(0x80);
-  encoding.push_back(0x80);
-  encoding.push_back(0x80);
-  encoding.push_back(0x78);
-#if defined(__LP64__)
-  // 9223372036854775807
-  encoding.push_back(0xff);
-  encoding.push_back(0xff);
-  encoding.push_back(0xff);
-  encoding.push_back(0xff);
-  encoding.push_back(0xff);
-  encoding.push_back(0xff);
-  encoding.push_back(0xff);
-  encoding.push_back(0xff);
-  encoding.push_back(0xff);
-  encoding.push_back(0x00);
-  // -9223372036854775808
-  encoding.push_back(0x80);
-  encoding.push_back(0x80);
-  encoding.push_back(0x80);
-  encoding.push_back(0x80);
-  encoding.push_back(0x80);
-  encoding.push_back(0x80);
-  encoding.push_back(0x80);
-  encoding.push_back(0x80);
-  encoding.push_back(0x80);
-  encoding.push_back(0x7f);
-#endif
-  sleb128_decoder decoder(&encoding[0], encoding.size());
-
-  EXPECT_EQ(624485U, decoder.pop_front());
-
-  EXPECT_EQ(0U, decoder.pop_front());
-  EXPECT_EQ(1U, decoder.pop_front());
-  EXPECT_EQ(63U, decoder.pop_front());
-  EXPECT_EQ(64U, decoder.pop_front());
-  EXPECT_EQ(static_cast<size_t>(-1), decoder.pop_front());
-  EXPECT_EQ(static_cast<size_t>(-624485), decoder.pop_front());
-  EXPECT_EQ(2147483647U, decoder.pop_front());
-  EXPECT_EQ(static_cast<size_t>(-2147483648), decoder.pop_front());
-#if defined(__LP64__)
-  EXPECT_EQ(9223372036854775807ULL, decoder.pop_front());
-  EXPECT_EQ(static_cast<uint64_t>(-9223372036854775807LL - 1), decoder.pop_front());
-#endif
-}
diff --git a/linker/tests/linker_utils_test.cpp b/linker/tests/linker_utils_test.cpp
deleted file mode 100644
index e406af5..0000000
--- a/linker/tests/linker_utils_test.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (C) 2013 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 <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-
-#include <gtest/gtest.h>
-
-#include "../linker_utils.h"
-
-TEST(linker_utils, format_string) {
-  std::vector<std::pair<std::string, std::string>> params = {{ "LIB", "lib32"}, { "SDKVER", "42"}};
-  std::string str_smoke = "LIB$LIB${LIB${SDKVER}SDKVER$TEST$";
-  format_string(&str_smoke, params);
-  ASSERT_EQ("LIBlib32${LIB42SDKVER$TEST$", str_smoke);
-}
-
-TEST(linker_utils, normalize_path_smoke) {
-  std::string output;
-  ASSERT_TRUE(normalize_path("/../root///dir/.///dir2/somedir/../zipfile!/dir/dir9//..///afile", &output));
-  ASSERT_EQ("/root/dir/dir2/zipfile!/dir/afile", output);
-
-  ASSERT_TRUE(normalize_path("/../root///dir/.///dir2/somedir/.../zipfile!/.dir/dir9//..///afile", &output));
-  ASSERT_EQ("/root/dir/dir2/somedir/.../zipfile!/.dir/afile", output);
-
-  ASSERT_TRUE(normalize_path("/root/..", &output));
-  ASSERT_EQ("/", output);
-
-  ASSERT_TRUE(normalize_path("/root/notroot/..", &output));
-  ASSERT_EQ("/root/", output);
-
-  ASSERT_TRUE(normalize_path("/a/../../b", &output));
-  ASSERT_EQ("/b", output);
-
-  ASSERT_TRUE(normalize_path("/..", &output));
-  ASSERT_EQ("/", output);
-
-  output = "unchanged";
-  ASSERT_FALSE(normalize_path("root///dir/.///dir2/somedir/../zipfile!/dir/dir9//..///afile", &output));
-  ASSERT_EQ("unchanged", output);
-}
-
-TEST(linker_utils, file_is_in_dir_smoke) {
-  ASSERT_TRUE(file_is_in_dir("/foo/bar/file", "/foo/bar"));
-  ASSERT_FALSE(file_is_in_dir("/foo/bar/file", "/foo"));
-
-  ASSERT_FALSE(file_is_in_dir("/foo/bar/file", "/bar/foo"));
-
-  ASSERT_TRUE(file_is_in_dir("/file", ""));
-  ASSERT_FALSE(file_is_in_dir("/file", "/"));
-}
-
-TEST(linker_utils, file_is_under_dir_smoke) {
-  ASSERT_TRUE(file_is_under_dir("/foo/bar/file", "/foo/bar"));
-  ASSERT_TRUE(file_is_under_dir("/foo/bar/file", "/foo"));
-
-  ASSERT_FALSE(file_is_under_dir("/foo/bar/file", "/bar/foo"));
-
-  ASSERT_TRUE(file_is_under_dir("/file", ""));
-  ASSERT_TRUE(file_is_under_dir("/foo/bar/file", ""));
-  ASSERT_FALSE(file_is_under_dir("/file", "/"));
-  ASSERT_FALSE(file_is_under_dir("/foo/bar/file", "/"));
-}
-
-TEST(linker_utils, parse_zip_path_smoke) {
-  std::string zip_path;
-  std::string entry_path;
-
-  ASSERT_FALSE(parse_zip_path("/not/a/zip/path/file.zip", &zip_path, &entry_path));
-  ASSERT_FALSE(parse_zip_path("/not/a/zip/path/file.zip!path/in/zip", &zip_path, &entry_path));
-  ASSERT_TRUE(parse_zip_path("/zip/path/file.zip!/path/in/zip", &zip_path, &entry_path));
-  ASSERT_EQ("/zip/path/file.zip", zip_path);
-  ASSERT_EQ("path/in/zip", entry_path);
-
-  ASSERT_TRUE(parse_zip_path("/zip/path/file2.zip!/", &zip_path, &entry_path));
-  ASSERT_EQ("/zip/path/file2.zip", zip_path);
-  ASSERT_EQ("", entry_path);
-}
-
-TEST(linker_utils, page_start) {
-  ASSERT_EQ(0x0001000, page_start(0x0001000));
-  ASSERT_EQ(0x3002000, page_start(0x300222f));
-  ASSERT_EQ(0x6001000, page_start(0x6001fff));
-}
-
-TEST(linker_utils, page_offset) {
-  ASSERT_EQ(0x0U, page_offset(0x0001000));
-  ASSERT_EQ(0x22fU, page_offset(0x300222f));
-  ASSERT_EQ(0xfffU, page_offset(0x6001fff));
-}
-
-TEST(linker_utils, safe_add) {
-  int64_t val = 42;
-  ASSERT_FALSE(safe_add(&val, INT64_MAX-20, 21U));
-  ASSERT_EQ(42, val);
-  ASSERT_TRUE(safe_add(&val, INT64_MAX-42, 42U));
-  ASSERT_EQ(INT64_MAX, val);
-  ASSERT_TRUE(safe_add(&val, 2000, 42U));
-  ASSERT_EQ(2042, val);
-}
diff --git a/tests/Android.bp b/tests/Android.bp
index 899fc66..71cf8a6 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -40,8 +40,9 @@
     ],
     stl: "libc++",
     sanitize: {
-        never: true,
+        address: false,
     },
+    bootstrap: true,
 }
 
 // -----------------------------------------------------------------------------
@@ -64,6 +65,7 @@
     name: "libBionicStandardTests",
     defaults: ["bionic_tests_defaults"],
     srcs: [
+        "__aeabi_read_tp_test.cpp",
         "alloca_test.cpp",
         "android_get_device_api_level.cpp",
         "arpa_inet_test.cpp",
@@ -93,6 +95,7 @@
         "grp_pwd_file_test.cpp",
         "iconv_test.cpp",
         "ifaddrs_test.cpp",
+        "ifunc_test.cpp",
         "inttypes_test.cpp",
         "iso646_test.c",
         "langinfo_test.cpp",
@@ -150,6 +153,7 @@
         "sys_epoll_test.cpp",
         "sys_mman_test.cpp",
         "sys_msg_test.cpp",
+        "sys_param_test.cpp",
         "sys_personality_test.cpp",
         "sys_prctl_test.cpp",
         "sys_procfs_test.cpp",
@@ -191,7 +195,6 @@
 
     include_dirs: [
         "bionic/libc",
-        "external/tinyxml2",
     ],
 
     target: {
@@ -216,6 +219,44 @@
     generated_headers: ["generated_android_ids"],
 }
 
+cc_test_library {
+    name: "libBionicElfTlsTests",
+    defaults: ["bionic_tests_defaults"],
+    srcs: [
+        "elftls_test.cpp",
+    ],
+    include_dirs: [
+        "bionic/libc",
+    ],
+    shared: {
+        enabled: false,
+    },
+    cflags: [
+        "-fno-emulated-tls",
+    ],
+}
+
+cc_test_library {
+    name: "libBionicElfTlsLoaderTests",
+    defaults: ["bionic_tests_defaults"],
+    srcs: [
+        "elftls_dl_test.cpp",
+    ],
+    include_dirs: [
+        "bionic/libc",
+    ],
+    static_libs: [
+        "liblog",
+        "libbase",
+    ],
+    shared: {
+        enabled: false,
+    },
+    cflags: [
+        "-fno-emulated-tls",
+    ],
+}
+
 // -----------------------------------------------------------------------------
 // Fortify tests.
 // -----------------------------------------------------------------------------
@@ -304,6 +345,7 @@
     defaults: ["bionic_tests_defaults"],
     whole_static_libs: [
         "libBionicStandardTests",
+        "libBionicElfTlsTests",
         "libfortify1-tests-clang",
         "libfortify2-tests-clang",
     ],
@@ -343,7 +385,8 @@
                 "libdl_test.cpp",
             ],
             static_libs: [
-                "libpagemap",
+                "libmeminfo",
+                "libprocinfo",
                 "libziparchive",
                 "libLLVMObject",
                 "libLLVMBitReader",
@@ -383,22 +426,30 @@
 cc_defaults {
     name: "bionic_unit_tests_defaults",
     host_supported: false,
+    gtest: false,
+
+    defaults: [
+        "bionic_tests_defaults",
+    ],
 
     whole_static_libs: [
         "libBionicTests",
         "libBionicLoaderTests",
+        "libBionicElfTlsLoaderTests",
     ],
 
     static_libs: [
         "libtinyxml2",
         "liblog",
         "libbase",
+        "libgtest_isolated",
     ],
 
     srcs: [
         // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
         "__cxa_thread_atexit_test.cpp",
         "gtest_globals.cpp",
+        "gtest_main.cpp",
         "thread_local_test.cpp",
     ],
 
@@ -417,15 +468,19 @@
         android: {
             shared_libs: [
                 "ld-android",
+                "libandroidicu",
                 "libdl",
+                "libdl_android",
                 "libdl_preempt_test_1",
                 "libdl_preempt_test_2",
                 "libdl_test_df_1_global",
+                "libtest_elftls_shared_var",
+                "libtest_elftls_tprel",
             ],
             static_libs: [
                 // The order of these libraries matters, do not shuffle them.
                 "libbase",
-                "libpagemap",
+                "libmeminfo",
                 "libziparchive",
                 "libz",
                 "libutils",
@@ -442,45 +497,25 @@
             ],
         },
     },
-}
-
-cc_test {
-    name: "bionic-unit-tests",
-    gtest: false,
-    defaults: [
-        "bionic_unit_tests_defaults",
-        "bionic_tests_defaults",
-    ],
-
-    srcs: [
-        "gtest_main.cpp",
-    ],
-
-    static_libs: [
-        "libgtest_isolated",
-    ],
-
-    target: {
-        android: {
-            shared_libs: ["libicuuc"],
-        },
-    },
 
     required: [
         "cfi_test_helper",
         "cfi_test_helper2",
+        "elftls_dlopen_ie_error_helper",
         "exec_linker_helper",
         "exec_linker_helper_lib",
         "libtest_dt_runpath_a",
         "libtest_dt_runpath_b",
         "libtest_dt_runpath_c",
         "libtest_dt_runpath_x",
+        "libtest_dt_runpath_y",
         "libatest_simple_zip",
         "libcfi-test",
         "libcfi-test-bad",
         "libdlext_test_different_soname",
         "libdlext_test_fd",
         "libdlext_test_norelro",
+        "libdlext_test_recursive",
         "libdlext_test_runpath_zip_zipaligned",
         "libdlext_test",
         "libdlext_test_zip",
@@ -488,7 +523,6 @@
         "libdl_preempt_test_1",
         "libdl_preempt_test_2",
         "libdl_test_df_1_global",
-        "libelf-tls-library",
         "libgnu-hash-table-library",
         "libsysv-hash-table-library",
         "libtestshared",
@@ -526,6 +560,13 @@
         "libtest_dlsym_from_this",
         "libtest_dlsym_weak_func",
         "libtest_dt_runpath_d",
+        "libtest_elftls_dynamic",
+        "libtest_elftls_dynamic_filler_1",
+        "libtest_elftls_dynamic_filler_2",
+        "libtest_elftls_dynamic_filler_3",
+        "libtest_elftls_shared_var",
+        "libtest_elftls_shared_var_ie",
+        "libtest_elftls_tprel",
         "libtest_empty",
         "libtest_ifunc_variable_impl",
         "libtest_ifunc_variable",
@@ -588,6 +629,8 @@
         "libnstest_ns_a_public1_internal",
         "libnstest_ns_b_public2",
         "libnstest_ns_b_public3",
+        "libsegment_gap_inner",
+        "libsegment_gap_outer",
         "ld_preload_test_helper",
         "ld_preload_test_helper_lib1",
         "ld_preload_test_helper_lib2",
@@ -598,6 +641,24 @@
     ],
 }
 
+cc_test {
+    name: "bionic-unit-tests",
+    defaults: [
+        "bionic_unit_tests_defaults",
+    ],
+}
+
+cc_test {
+    name: "bionic-unit-tests-scudo",
+    defaults: [
+        "bionic_unit_tests_defaults",
+    ],
+
+    shared_libs: [
+        "libc_scudo",
+    ],
+}
+
 // -----------------------------------------------------------------------------
 // Tests for the device linked against bionic's static library. Run with:
 //   adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static
@@ -613,6 +674,13 @@
         "gtest_preinit_debuggerd.cpp",
         "gtest_globals.cpp",
         "gtest_main.cpp",
+
+        // The Bionic allocator has its own C++ API. It isn't packaged into its
+        // own library, so it can only be tested when it's part of libc.a.
+        "bionic_allocator_test.cpp",
+    ],
+    include_dirs: [
+        "bionic/libc",
     ],
     whole_static_libs: [
         "libBionicTests",
@@ -627,14 +695,12 @@
         "libbase",
         "libdebuggerd_handler",
         "libgtest_isolated",
+        "libtest_elftls_shared_var",
+        "libtest_elftls_tprel",
     ],
 
     static_executable: true,
     stl: "libc++_static",
-
-    // libclang_rt.builtins does not work with libm
-    // http://b/117167374
-    no_libcrt: true,
 }
 
 // -----------------------------------------------------------------------------
@@ -660,12 +726,15 @@
     shared_libs: [
         "libdl_preempt_test_1",
         "libdl_preempt_test_2",
-
         "libdl_test_df_1_global",
+        "libtest_elftls_shared_var",
+        "libtest_elftls_tprel",
     ],
 
     whole_static_libs: [
         "libBionicStandardTests",
+        "libBionicElfTlsTests",
+        "libBionicElfTlsLoaderTests",
         "libfortify1-tests-clang",
         "libfortify2-tests-clang",
     ],
diff --git a/tests/Android.build.mk b/tests/Android.build.mk
index 266c7d7..04fc92d 100644
--- a/tests/Android.build.mk
+++ b/tests/Android.build.mk
@@ -35,8 +35,20 @@
     native_tests_var := TARGET_OUT_DATA_NATIVE_TESTS
   endif
 
-  LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)$(native_tests_var))/$($(module)_install_to_native_tests_dir)
-  LOCAL_MODULE_PATH_64 := $($(native_tests_var))/$($(module)_install_to_native_tests_dir)
+  ifneq ($($(module)_install_to_native_tests_dir_32),)
+    tests_dir_32 := $($(module)_install_to_native_tests_dir_32)
+  else
+    tests_dir_32 := $($(module)_install_to_native_tests_dir)
+  endif
+
+  ifneq ($($(module)_install_to_native_tests_dir_64),)
+    tests_dir_64 := $($(module)_install_to_native_tests_dir_64)
+  else
+    tests_dir_64 := $($(module)_install_to_native_tests_dir)
+  endif
+
+  LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)$(native_tests_var))/$(tests_dir_32)
+  LOCAL_MODULE_PATH_64 := $($(native_tests_var))/$(tests_dir_64)
 endif
 endif
 
diff --git a/tests/__aeabi_read_tp_test.cpp b/tests/__aeabi_read_tp_test.cpp
new file mode 100644
index 0000000..7209a75
--- /dev/null
+++ b/tests/__aeabi_read_tp_test.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2019 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 <gtest/gtest.h>
+
+#include "private/__get_tls.h"
+
+#if defined(__arm__)
+extern "C" void* __aeabi_read_tp();
+#endif
+
+TEST(aeabi, read_tp) {
+#if defined(__arm__)
+  ASSERT_EQ(__aeabi_read_tp(), static_cast<void*>(__get_tls()));
+#else
+  GTEST_SKIP() << "__aeabi_read_tp is only available on arm32";
+#endif
+}
diff --git a/tests/async_safe_test.cpp b/tests/async_safe_test.cpp
index 4940e3a..6c4758e 100644
--- a/tests/async_safe_test.cpp
+++ b/tests/async_safe_test.cpp
@@ -104,7 +104,7 @@
   async_safe_format_buffer(buf, sizeof(buf), "a%lld,%d,%d,%dz", 0x1000000000LL, 6, 7, 8);
   EXPECT_STREQ("a68719476736,6,7,8z", buf);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -114,7 +114,7 @@
   async_safe_format_buffer(buf, sizeof(buf), "%d", INT_MAX);
   EXPECT_STREQ("2147483647", buf);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -124,7 +124,7 @@
   async_safe_format_buffer(buf, sizeof(buf), "%d", INT_MIN);
   EXPECT_STREQ("-2147483648", buf);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -138,7 +138,7 @@
   EXPECT_STREQ("2147483647", buf);
 #endif
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -152,7 +152,7 @@
   EXPECT_STREQ("-2147483648", buf);
 #endif
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -162,7 +162,7 @@
   async_safe_format_buffer(buf, sizeof(buf), "%lld", LLONG_MAX);
   EXPECT_STREQ("9223372036854775807", buf);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -172,7 +172,7 @@
   async_safe_format_buffer(buf, sizeof(buf), "%lld", LLONG_MIN);
   EXPECT_STREQ("-9223372036854775808", buf);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -196,6 +196,6 @@
   ASSERT_EQ(4, async_safe_format_buffer(buf, 2, "xxxx"));
   EXPECT_STREQ("x", buf);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
diff --git a/tests/bionic_allocator_test.cpp b/tests/bionic_allocator_test.cpp
new file mode 100644
index 0000000..f710907
--- /dev/null
+++ b/tests/bionic_allocator_test.cpp
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2013 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 <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+
+#include <gtest/gtest.h>
+
+#include "private/bionic_allocator.h"
+
+#include <unistd.h>
+
+namespace {
+
+/*
+ * this one has size below allocator cap which is 2*sizeof(void*)
+ */
+struct test_struct_small {
+  char dummy_str[5];
+};
+
+struct test_struct_large {
+  char dummy_str[1009];
+};
+
+struct test_struct_huge {
+  char dummy_str[73939];
+};
+
+struct test_struct_512 {
+  char dummy_str[503];
+};
+
+};
+
+static size_t kPageSize = sysconf(_SC_PAGE_SIZE);
+
+TEST(bionic_allocator, test_alloc_0) {
+  BionicAllocator allocator;
+  void* ptr = allocator.alloc(0);
+  ASSERT_TRUE(ptr != nullptr);
+  allocator.free(ptr);
+}
+
+TEST(bionic_allocator, test_free_nullptr) {
+  BionicAllocator allocator;
+  allocator.free(nullptr);
+}
+
+TEST(bionic_allocator, test_realloc) {
+  BionicAllocator allocator;
+  uint32_t* array = reinterpret_cast<uint32_t*>(allocator.alloc(512));
+  const size_t array_size = 512 / sizeof(uint32_t);
+
+  uint32_t model[1000];
+
+  model[0] = 1;
+  model[1] = 1;
+
+  for (size_t i = 2; i < 1000; ++i) {
+    model[i] = model[i - 1] + model[i - 2];
+  }
+
+  memcpy(array, model, array_size);
+
+  uint32_t* reallocated_ptr = reinterpret_cast<uint32_t*>(allocator.realloc(array, 1024));
+
+  ASSERT_TRUE(reallocated_ptr != nullptr);
+  ASSERT_TRUE(reallocated_ptr != array);
+
+  ASSERT_TRUE(memcmp(reallocated_ptr, model, array_size) == 0);
+
+  array = reallocated_ptr;
+
+  memcpy(array, model, 2*array_size);
+
+  reallocated_ptr = reinterpret_cast<uint32_t*>(allocator.realloc(array, 62));
+
+  ASSERT_TRUE(reallocated_ptr == array);
+
+  reallocated_ptr = reinterpret_cast<uint32_t*>(allocator.realloc(array, 4000));
+
+  ASSERT_TRUE(reallocated_ptr != nullptr);
+  ASSERT_TRUE(reallocated_ptr != array);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(reallocated_ptr) % 16);
+
+  ASSERT_TRUE(memcmp(reallocated_ptr, model, array_size * 2) == 0);
+
+  array = reallocated_ptr;
+
+  memcpy(array, model, 4000);
+
+  reallocated_ptr = reinterpret_cast<uint32_t*>(allocator.realloc(array, 64000));
+
+  ASSERT_TRUE(reallocated_ptr != nullptr);
+  ASSERT_TRUE(reallocated_ptr != array);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(reallocated_ptr) % 16);
+
+  ASSERT_TRUE(memcmp(reallocated_ptr, model, 4000) == 0);
+
+  ASSERT_EQ(nullptr, allocator.realloc(reallocated_ptr, 0));
+}
+
+TEST(bionic_allocator, test_small_smoke) {
+  BionicAllocator allocator;
+
+  uint8_t zeros[16];
+  memset(zeros, 0, sizeof(zeros));
+
+  test_struct_small* ptr1 =
+      reinterpret_cast<test_struct_small*>(allocator.alloc(sizeof(test_struct_small)));
+  test_struct_small* ptr2 =
+      reinterpret_cast<test_struct_small*>(allocator.alloc(sizeof(test_struct_small)));
+
+  ASSERT_TRUE(ptr1 != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
+  ASSERT_TRUE(ptr2 != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
+
+  ASSERT_EQ(reinterpret_cast<uintptr_t>(ptr1)+16, reinterpret_cast<uintptr_t>(ptr2));
+  ASSERT_TRUE(memcmp(ptr1, zeros, 16) == 0);
+
+  allocator.free(ptr1);
+  allocator.free(ptr2);
+}
+
+TEST(bionic_allocator, test_huge_smoke) {
+  BionicAllocator allocator;
+
+  // this should trigger proxy-to-mmap
+  test_struct_huge* ptr1 =
+      reinterpret_cast<test_struct_huge*>(allocator.alloc(sizeof(test_struct_huge)));
+  test_struct_huge* ptr2 =
+      reinterpret_cast<test_struct_huge*>(allocator.alloc(sizeof(test_struct_huge)));
+
+  ASSERT_TRUE(ptr1 != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
+  ASSERT_TRUE(ptr2 != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
+
+  ASSERT_TRUE(
+      reinterpret_cast<uintptr_t>(ptr1)/kPageSize != reinterpret_cast<uintptr_t>(ptr2)/kPageSize);
+  allocator.free(ptr2);
+  allocator.free(ptr1);
+}
+
+TEST(bionic_allocator, test_large) {
+  BionicAllocator allocator;
+
+  test_struct_large* ptr1 =
+      reinterpret_cast<test_struct_large*>(allocator.alloc(sizeof(test_struct_large)));
+  test_struct_large* ptr2 =
+      reinterpret_cast<test_struct_large*>(allocator.alloc(1024));
+
+  ASSERT_TRUE(ptr1 != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr1) % 16);
+  ASSERT_TRUE(ptr2 != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr2) % 16);
+
+  ASSERT_EQ(reinterpret_cast<uintptr_t>(ptr1) + 1024, reinterpret_cast<uintptr_t>(ptr2));
+
+  // let's allocate until we reach the next page.
+  size_t n = kPageSize / sizeof(test_struct_large) + 1 - 2;
+  test_struct_large* objects[n];
+
+  for (size_t i = 0; i < n; ++i) {
+    test_struct_large* obj_ptr =
+        reinterpret_cast<test_struct_large*>(allocator.alloc(sizeof(test_struct_large)));
+    ASSERT_TRUE(obj_ptr != nullptr);
+    objects[i] = obj_ptr;
+  }
+
+  test_struct_large* ptr_to_free =
+      reinterpret_cast<test_struct_large*>(allocator.alloc(sizeof(test_struct_large)));
+
+  ASSERT_TRUE(ptr_to_free != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr_to_free) % 16);
+
+  allocator.free(ptr1);
+
+  for (size_t i=0; i<n; ++i) {
+    allocator.free(objects[i]);
+  }
+
+  allocator.free(ptr2);
+  allocator.free(ptr_to_free);
+}
+
+TEST(bionic_allocator, test_memalign_small) {
+  BionicAllocator allocator;
+  void* ptr;
+
+  // simple case
+  ptr = allocator.memalign(0x100, 0x100);
+  ASSERT_TRUE(ptr != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr) % 0x100);
+  allocator.free(ptr);
+
+  // small objects are automatically aligned to their size.
+  ptr = allocator.alloc(0x200);
+  ASSERT_TRUE(ptr != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr) % 0x200);
+  allocator.free(ptr);
+
+  // the size (0x10) is bumped up to the alignment (0x100)
+  ptr = allocator.memalign(0x100, 0x10);
+  ASSERT_TRUE(ptr != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr) % 0x100);
+  allocator.free(ptr);
+}
+
+TEST(bionic_allocator, test_memalign_large) {
+  BionicAllocator allocator;
+  void* ptr;
+
+  // a large object with alignment < PAGE_SIZE
+  ptr = allocator.memalign(0x100, 0x2000);
+  ASSERT_TRUE(ptr != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr) % 0x100);
+  allocator.free(ptr);
+
+  // a large object with alignment == PAGE_SIZE
+  ptr = allocator.memalign(0x1000, 0x2000);
+  ASSERT_TRUE(ptr != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr) % 0x1000);
+  allocator.free(ptr);
+
+  // A large object with alignment > PAGE_SIZE is only guaranteed to have page
+  // alignment.
+  ptr = allocator.memalign(0x2000, 0x4000);
+  ASSERT_TRUE(ptr != nullptr);
+  ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr) % 0x1000);
+  allocator.free(ptr);
+}
diff --git a/tests/buffer_tests.cpp b/tests/buffer_tests.cpp
index 7563448..fb0b6d8 100644
--- a/tests/buffer_tests.cpp
+++ b/tests/buffer_tests.cpp
@@ -20,6 +20,7 @@
 
 #include <gtest/gtest.h>
 #include "buffer_tests.h"
+#include "utils.h"
 
 // For the comparison buffer tests, the maximum length to test for the
 // miscompare checks.
@@ -227,16 +228,11 @@
   }
 }
 
-// Malloc can return a tagged pointer, which is not accepted in mm system calls like mprotect.
-// Clear top 8 bits of the address on 64-bit platforms.
+// Malloc can return a tagged pointer, which is not accepted in mm system calls like mprotect
+// in the preliminary version of the syscall tagging support in the current Pixel 2 kernel.
+// Note: the final version of the kernel patchset may relax this requirement.
 static int MprotectHeap(void* addr, size_t len, int prot) {
-#if defined(__LP64__)
-  constexpr uintptr_t mask = (static_cast<uintptr_t>(1) << 56) - 1;
-  void* untagged_addr = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(addr) & mask);
-#else
-  void* untagged_addr = addr;
-#endif
-  return mprotect(untagged_addr, len, prot);
+  return mprotect(untag_address(addr), len, prot);
 }
 
 void RunSingleBufferAlignTest(
diff --git a/tests/complex_test.cpp b/tests/complex_test.cpp
index 3bbddbb..f015b2c 100644
--- a/tests/complex_test.cpp
+++ b/tests/complex_test.cpp
@@ -27,7 +27,6 @@
 #define __INTRODUCED_IN(x)
 #define __INTRODUCED_IN_32(x)
 #define __INTRODUCED_IN_64(x)
-#define __INTRODUCED_IN_FUTURE
 #define __RENAME_LDBL(a,b,c)
 #endif
 
diff --git a/tests/dl_test.cpp b/tests/dl_test.cpp
index aea92b4..9e46394 100644
--- a/tests/dl_test.cpp
+++ b/tests/dl_test.cpp
@@ -138,7 +138,7 @@
 
 TEST(dl, preinit_system_calls) {
 #if defined(__BIONIC__)
-  SKIP_WITH_HWASAN; // hwasan not initialized in preinit_array
+  SKIP_WITH_HWASAN << "hwasan not initialized in preinit_array, b/124007027";
   std::string helper = GetTestlibRoot() +
       "/preinit_syscall_test_helper/preinit_syscall_test_helper";
   chmod(helper.c_str(), 0755); // TODO: "x" lost in CTS, b/34945607
@@ -150,6 +150,7 @@
 
 TEST(dl, preinit_getauxval) {
 #if defined(__BIONIC__)
+  SKIP_WITH_HWASAN << "hwasan not initialized in preinit_array, b/124007027";
   std::string helper = GetTestlibRoot() +
       "/preinit_getauxval_test_helper/preinit_getauxval_test_helper";
   chmod(helper.c_str(), 0755); // TODO: "x" lost in CTS, b/34945607
@@ -241,7 +242,7 @@
 // whose search paths include the 'ns2/' subdir.
 TEST(dl, exec_with_ld_config_file) {
 #if defined(__BIONIC__)
-  SKIP_WITH_HWASAN; // libclang_rt.hwasan is not found with custom ld config
+  SKIP_WITH_HWASAN << "libclang_rt.hwasan is not found with custom ld config";
   if (!is_debuggable_build()) {
     // LD_CONFIG_FILE is not supported on user build
     return;
@@ -264,7 +265,7 @@
 // additional namespaces other than the default namespace.
 TEST(dl, exec_with_ld_config_file_with_ld_preload) {
 #if defined(__BIONIC__)
-  SKIP_WITH_HWASAN; // libclang_rt.hwasan is not found with custom ld config
+  SKIP_WITH_HWASAN << "libclang_rt.hwasan is not found with custom ld config";
   if (!is_debuggable_build()) {
     // LD_CONFIG_FILE is not supported on user build
     return;
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp
index 34013a7..eed84a4 100644
--- a/tests/dlext_test.cpp
+++ b/tests/dlext_test.cpp
@@ -36,7 +36,8 @@
 #include <sys/vfs.h>
 #include <sys/wait.h>
 
-#include <pagemap/pagemap.h>
+#include <meminfo/procmeminfo.h>
+#include <procinfo/process_map.h>
 #include <ziparchive/zip_archive.h>
 
 #include "gtest_globals.h"
@@ -59,13 +60,14 @@
 
 typedef int (*fn)(void);
 constexpr const char* kLibName = "libdlext_test.so";
+constexpr const char* kLibNameRecursive = "libdlext_test_recursive.so";
 constexpr const char* kLibNameNoRelro = "libdlext_test_norelro.so";
 constexpr const char* kLibZipSimpleZip = "libdir/libatest_simple_zip.so";
 constexpr auto kLibSize = 1024 * 1024; // how much address space to reserve for it
 
 class DlExtTest : public ::testing::Test {
 protected:
-  virtual void SetUp() {
+  void SetUp() override {
     handle_ = nullptr;
     // verify that we don't have the library loaded already
     void* h = dlopen(kLibName, RTLD_NOW | RTLD_NOLOAD);
@@ -76,7 +78,7 @@
     ASSERT_EQ(std::string("dlopen failed: library \"") + kLibNameNoRelro + "\" wasn't loaded and RTLD_NOLOAD prevented it", dlerror());
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     if (handle_ != nullptr) {
       ASSERT_DL_ZERO(dlclose(handle_));
     }
@@ -232,6 +234,12 @@
   dlclose(handle);
 }
 
+TEST(dlfcn, dlopen_from_nullptr_android_api_level) {
+  // Regression test for http://b/123972211. Testing dlopen(nullptr) when target sdk is P
+  android_set_application_target_sdk_version(__ANDROID_API_P__);
+  ASSERT_TRUE(dlopen(nullptr, RTLD_NOW) != nullptr);
+}
+
 TEST(dlfcn, dlopen_from_zip_absolute_path) {
   const std::string lib_zip_path = "/libdlext_test_zip/libdlext_test_zip_zipaligned.zip";
   const std::string lib_path = GetTestlibRoot() + lib_zip_path;
@@ -332,6 +340,48 @@
   EXPECT_EQ(nullptr, handle_);
 }
 
+TEST_F(DlExtTest, ReservedRecursive) {
+  void* start = mmap(nullptr, kLibSize, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+  ASSERT_TRUE(start != MAP_FAILED);
+  android_dlextinfo extinfo;
+  extinfo.flags = ANDROID_DLEXT_RESERVED_ADDRESS | ANDROID_DLEXT_RESERVED_ADDRESS_RECURSIVE;
+  extinfo.reserved_addr = start;
+  extinfo.reserved_size = kLibSize;
+  handle_ = android_dlopen_ext(kLibNameRecursive, RTLD_NOW, &extinfo);
+  ASSERT_DL_NOTNULL(handle_);
+
+  fn f = reinterpret_cast<fn>(dlsym(handle_, "getRandomNumber"));
+  ASSERT_DL_NOTNULL(f);
+  EXPECT_GE(reinterpret_cast<void*>(f), start);
+  EXPECT_LT(reinterpret_cast<void*>(f),
+            reinterpret_cast<char*>(start) + kLibSize);
+  EXPECT_EQ(4, f());
+
+  f = reinterpret_cast<fn>(dlsym(handle_, "getBiggerRandomNumber"));
+  ASSERT_DL_NOTNULL(f);
+  EXPECT_GE(reinterpret_cast<void*>(f), start);
+  EXPECT_LT(reinterpret_cast<void*>(f),
+            reinterpret_cast<char*>(start) + kLibSize);
+  EXPECT_EQ(8, f());
+
+  uint32_t* taxicab_number = reinterpret_cast<uint32_t*>(dlsym(handle_, "dlopen_testlib_taxicab_number"));
+  ASSERT_DL_NOTNULL(taxicab_number);
+  EXPECT_GE(reinterpret_cast<void*>(taxicab_number), start);
+  EXPECT_LT(reinterpret_cast<void*>(taxicab_number), reinterpret_cast<char*>(start) + kLibSize);
+  EXPECT_EQ(1729U, *taxicab_number);
+}
+
+TEST_F(DlExtTest, ReservedRecursiveTooSmall) {
+  void* start = mmap(nullptr, PAGE_SIZE, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+  ASSERT_TRUE(start != MAP_FAILED);
+  android_dlextinfo extinfo;
+  extinfo.flags = ANDROID_DLEXT_RESERVED_ADDRESS | ANDROID_DLEXT_RESERVED_ADDRESS_RECURSIVE;
+  extinfo.reserved_addr = start;
+  extinfo.reserved_size = PAGE_SIZE;
+  handle_ = android_dlopen_ext(kLibNameRecursive, RTLD_NOW, &extinfo);
+  EXPECT_EQ(nullptr, handle_);
+}
+
 TEST_F(DlExtTest, ReservedHint) {
   void* start = mmap(nullptr, kLibSize, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
   ASSERT_TRUE(start != MAP_FAILED);
@@ -368,7 +418,7 @@
 
 class DlExtRelroSharingTest : public DlExtTest {
 protected:
-  virtual void SetUp() {
+  void SetUp() override {
     DlExtTest::SetUp();
     void* start = mmap(nullptr, kLibSize, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
     ASSERT_TRUE(start != MAP_FAILED);
@@ -378,14 +428,18 @@
     extinfo_.relro_fd = -1;
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     DlExtTest::TearDown();
   }
 
-  void CreateRelroFile(const char* lib, const char* relro_file) {
+  void CreateRelroFile(const char* lib, const char* relro_file, bool recursive) {
     int relro_fd = open(relro_file, O_RDWR | O_TRUNC | O_CLOEXEC);
     ASSERT_NOERROR(relro_fd);
 
+    if (recursive) {
+      extinfo_.flags |= ANDROID_DLEXT_RESERVED_ADDRESS_RECURSIVE;
+    }
+
     pid_t pid = fork();
     if (pid == 0) {
       // child process
@@ -396,7 +450,21 @@
         fprintf(stderr, "in child: %s\n", dlerror());
         exit(1);
       }
-      exit(0);
+      fn f = reinterpret_cast<fn>(dlsym(handle, "getRandomNumber"));
+      ASSERT_DL_NOTNULL(f);
+      EXPECT_EQ(4, f());
+
+      if (recursive) {
+        fn f = reinterpret_cast<fn>(dlsym(handle, "getBiggerRandomNumber"));
+        ASSERT_DL_NOTNULL(f);
+        EXPECT_EQ(8, f());
+      }
+
+      uint32_t* taxicab_number =
+              reinterpret_cast<uint32_t*>(dlsym(handle, "dlopen_testlib_taxicab_number"));
+      ASSERT_DL_NOTNULL(taxicab_number);
+      EXPECT_EQ(1729U, *taxicab_number);
+      exit(testing::Test::HasFailure());
     }
 
     // continuing in parent
@@ -411,13 +479,19 @@
     extinfo_.relro_fd = relro_fd;
   }
 
-  void TryUsingRelro(const char* lib) {
+  void TryUsingRelro(const char* lib, bool recursive) {
     handle_ = android_dlopen_ext(lib, RTLD_NOW, &extinfo_);
     ASSERT_DL_NOTNULL(handle_);
     fn f = reinterpret_cast<fn>(dlsym(handle_, "getRandomNumber"));
     ASSERT_DL_NOTNULL(f);
     EXPECT_EQ(4, f());
 
+    if (recursive) {
+      fn f = reinterpret_cast<fn>(dlsym(handle_, "getBiggerRandomNumber"));
+      ASSERT_DL_NOTNULL(f);
+      EXPECT_EQ(8, f());
+    }
+
     uint32_t* taxicab_number =
             reinterpret_cast<uint32_t*>(dlsym(handle_, "dlopen_testlib_taxicab_number"));
     ASSERT_DL_NOTNULL(taxicab_number);
@@ -427,6 +501,8 @@
   void SpawnChildrenAndMeasurePss(const char* lib, const char* relro_file, bool share_relro,
                                   size_t* pss_out);
 
+  std::string FindMappingName(void* ptr);
+
   android_dlextinfo extinfo_;
 };
 
@@ -434,38 +510,76 @@
   TemporaryFile tf; // Use tf to get an unique filename.
   ASSERT_NOERROR(close(tf.fd));
 
-  ASSERT_NO_FATAL_FAILURE(CreateRelroFile(kLibName, tf.path));
-  ASSERT_NO_FATAL_FAILURE(TryUsingRelro(kLibName));
+  ASSERT_NO_FATAL_FAILURE(CreateRelroFile(kLibName, tf.path, false));
+  ASSERT_NO_FATAL_FAILURE(TryUsingRelro(kLibName, false));
+  void* relro_data = dlsym(handle_, "lots_of_relro");
+  ASSERT_DL_NOTNULL(relro_data);
+  EXPECT_EQ(tf.path, FindMappingName(relro_data));
 
   // Use destructor of tf to close and unlink the file.
   tf.fd = extinfo_.relro_fd;
 }
 
+TEST_F(DlExtRelroSharingTest, ChildWritesGoodDataRecursive) {
+  TemporaryFile tf; // Use tf to get an unique filename.
+  ASSERT_NOERROR(close(tf.fd));
+
+  ASSERT_NO_FATAL_FAILURE(CreateRelroFile(kLibNameRecursive, tf.path, true));
+  ASSERT_NO_FATAL_FAILURE(TryUsingRelro(kLibNameRecursive, true));
+  void* relro_data = dlsym(handle_, "lots_of_relro");
+  ASSERT_DL_NOTNULL(relro_data);
+  EXPECT_EQ(tf.path, FindMappingName(relro_data));
+  void* recursive_relro_data = dlsym(handle_, "lots_more_relro");
+  ASSERT_DL_NOTNULL(recursive_relro_data);
+  EXPECT_EQ(tf.path, FindMappingName(recursive_relro_data));
+
+
+  // Use destructor of tf to close and unlink the file.
+  tf.fd = extinfo_.relro_fd;
+}
+
+TEST_F(DlExtRelroSharingTest, CheckRelroSizes) {
+  TemporaryFile tf1, tf2;
+  ASSERT_NOERROR(close(tf1.fd));
+  ASSERT_NOERROR(close(tf2.fd));
+
+  ASSERT_NO_FATAL_FAILURE(CreateRelroFile(kLibNameRecursive, tf1.path, false));
+  struct stat no_recursive;
+  ASSERT_NOERROR(fstat(extinfo_.relro_fd, &no_recursive));
+  tf1.fd = extinfo_.relro_fd;
+
+  ASSERT_NO_FATAL_FAILURE(CreateRelroFile(kLibNameRecursive, tf2.path, true));
+  struct stat with_recursive;
+  ASSERT_NOERROR(fstat(extinfo_.relro_fd, &with_recursive));
+  tf2.fd = extinfo_.relro_fd;
+
+  // RELRO file should end up bigger when we use the recursive flag, since it
+  // includes data for more than one library.
+  ASSERT_GT(with_recursive.st_size, no_recursive.st_size);
+}
+
 TEST_F(DlExtRelroSharingTest, ChildWritesNoRelro) {
   TemporaryFile tf; // // Use tf to get an unique filename.
   ASSERT_NOERROR(close(tf.fd));
 
-  ASSERT_NO_FATAL_FAILURE(CreateRelroFile(kLibNameNoRelro, tf.path));
-  ASSERT_NO_FATAL_FAILURE(TryUsingRelro(kLibNameNoRelro));
+  ASSERT_NO_FATAL_FAILURE(CreateRelroFile(kLibNameNoRelro, tf.path, false));
+  ASSERT_NO_FATAL_FAILURE(TryUsingRelro(kLibNameNoRelro, false));
 
   // Use destructor of tf to close and unlink the file.
   tf.fd = extinfo_.relro_fd;
 }
 
 TEST_F(DlExtRelroSharingTest, RelroFileEmpty) {
-  ASSERT_NO_FATAL_FAILURE(TryUsingRelro(kLibName));
+  ASSERT_NO_FATAL_FAILURE(TryUsingRelro(kLibName, false));
 }
 
 TEST_F(DlExtRelroSharingTest, VerifyMemorySaving) {
-  if (geteuid() != 0) {
-    GTEST_LOG_(INFO) << "This test must be run as root.\n";
-    return;
-  }
+  if (geteuid() != 0) GTEST_SKIP() << "This test must be run as root";
 
   TemporaryFile tf; // Use tf to get an unique filename.
   ASSERT_NOERROR(close(tf.fd));
 
-  ASSERT_NO_FATAL_FAILURE(CreateRelroFile(kLibName, tf.path));
+  ASSERT_NO_FATAL_FAILURE(CreateRelroFile(kLibName, tf.path, false));
 
   int pipefd[2];
   ASSERT_NOERROR(pipe(pipefd));
@@ -488,33 +602,23 @@
 
 void GetPss(bool shared_relro, const char* lib, const char* relro_file, pid_t pid,
             size_t* total_pss) {
-  pm_kernel_t* kernel;
-  ASSERT_EQ(0, pm_kernel_create(&kernel));
-
-  pm_process_t* process;
-  ASSERT_EQ(0, pm_process_create(kernel, pid, &process));
-
-  pm_map_t** maps;
-  size_t num_maps;
-  ASSERT_EQ(0, pm_process_maps(process, &maps, &num_maps));
+  android::meminfo::ProcMemInfo proc_mem(pid);
+  const std::vector<android::meminfo::Vma>& maps = proc_mem.Maps();
+  ASSERT_GT(maps.size(), 0UL);
 
   // Calculate total PSS of the library.
   *total_pss = 0;
   bool saw_relro_file = false;
-  for (size_t i = 0; i < num_maps; ++i) {
-    if (android::base::EndsWith(maps[i]->name, lib) || strcmp(maps[i]->name, relro_file) == 0) {
-      if (strcmp(maps[i]->name, relro_file) == 0) saw_relro_file = true;
+  for (auto& vma : maps) {
+    if (android::base::EndsWith(vma.name, lib) || (vma.name == relro_file)) {
+      if (vma.name == relro_file) {
+          saw_relro_file = true;
+      }
 
-      pm_memusage_t usage;
-      ASSERT_EQ(0, pm_map_usage(maps[i], &usage));
-      *total_pss += usage.pss;
+      *total_pss += vma.usage.pss;
     }
   }
 
-  free(maps);
-  pm_process_destroy(process);
-  pm_kernel_destroy(kernel);
-
   if (shared_relro) ASSERT_TRUE(saw_relro_file);
 }
 
@@ -590,6 +694,21 @@
   }
 }
 
+std::string DlExtRelroSharingTest::FindMappingName(void* ptr) {
+  uint64_t addr = reinterpret_cast<uint64_t>(ptr);
+  std::string found_name = "<not found>";
+
+  EXPECT_TRUE(android::procinfo::ReadMapFile(
+      "/proc/self/maps",
+      [&](uint64_t start, uint64_t end, uint16_t, uint16_t, ino_t, const char* name) {
+        if (addr >= start && addr < end) {
+          found_name = name;
+        }
+      }));
+
+  return found_name;
+}
+
 // Testing namespaces
 static const char* g_public_lib = "libnstest_public.so";
 
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index 5f48e67..c6d7ddb 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -49,6 +49,12 @@
 #pragma clang diagnostic pop
 #endif //  defined(__ANDROID__) && (defined(__arm__) || defined(__i386__))
 
+// Declared manually because the macro definitions in <elf.h> conflict with LLVM headers.
+#ifdef __arm__
+typedef uintptr_t _Unwind_Ptr;
+extern "C" _Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr, int*);
+#endif
+
 #define ASSERT_SUBSTR(needle, haystack) \
     ASSERT_PRED_FORMAT2(::testing::IsSubstring, needle, haystack)
 
@@ -254,8 +260,7 @@
 TEST(dlfcn, dlopen_vdso) {
 #if __has_include(<sys/auxv.h>)
   if (getauxval(AT_SYSINFO_EHDR) == 0) {
-    GTEST_LOG_(INFO) << "getauxval(AT_SYSINFO_EHDR) == 0, skipping this test.";
-    return;
+    GTEST_SKIP() << "getauxval(AT_SYSINFO_EHDR) == 0, skipping this test";
   }
 #endif
 
@@ -970,23 +975,23 @@
 #if defined(__BIONIC__)
   ASSERT_EQ(handle1, handle2);
 #else
-  GTEST_LOG_(INFO) << "Skipping ASSERT_EQ(handle1, handle2) for glibc: "
-                      "it loads a separate copy of the main executable "
-                      "on dlopen by absolute path.";
+  GTEST_SKIP() << "Skipping ASSERT_EQ(handle1, handle2) for glibc: "
+                  "it loads a separate copy of the main executable "
+                  "on dlopen by absolute path";
 #endif
 }
 
 #if defined (__aarch64__)
-#define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib/arm64/"
+#define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib64/arm64/"
 #elif defined (__arm__)
 #define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib/arm/"
 #elif defined (__i386__)
 #define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib/x86/"
 #elif defined (__x86_64__)
-#define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib/x86_64/"
+#define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib64/x86_64/"
 #elif defined (__mips__)
 #if defined(__LP64__)
-#define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib/mips64/"
+#define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib64/mips64/"
 #else
 #define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib/mips/"
 #endif
@@ -997,7 +1002,10 @@
 #define ALTERNATE_PATH_TO_LIBC ALTERNATE_PATH_TO_SYSTEM_LIB "libc.so"
 
 TEST(dlfcn, dladdr_libc) {
-#if defined(__BIONIC__)
+#if defined(__GLIBC__)
+  GTEST_SKIP() << "glibc returns libc.so's ldconfig path, which is a symlink (not a realpath)";
+#endif
+
   Dl_info info;
   void* addr = reinterpret_cast<void*>(puts); // well-known libc function
   ASSERT_TRUE(dladdr(addr, &info) != 0);
@@ -1019,10 +1027,6 @@
   // TODO: add check for dfi_fbase
   ASSERT_STREQ("puts", info.dli_sname);
   ASSERT_EQ(addr, info.dli_saddr);
-#else
-  GTEST_LOG_(INFO) << "This test does nothing for glibc. Glibc returns path from ldconfig "
-      "for libc.so, which is symlink itself (not a realpath).\n";
-#endif
 }
 
 TEST(dlfcn, dladdr_invalid) {
@@ -1060,7 +1064,7 @@
   ASSERT_STREQ("getRandomNumber", dlinfo.dli_sname);
   ASSERT_SUBSTR("libgnu-hash-table-library.so", dlinfo.dli_fname);
 #else
-  GTEST_LOG_(INFO) << "This test does nothing for mips/mips64; mips toolchain does not support '--hash-style=gnu'\n";
+  GTEST_SKIP() << "mips toolchain does not support '--hash-style=gnu'";
 #endif
 }
 
@@ -1082,13 +1086,6 @@
   ASSERT_SUBSTR("libsysv-hash-table-library.so", dlinfo.dli_fname);
 }
 
-TEST(dlfcn, dlopen_library_with_ELF_TLS) {
-  dlerror(); // Clear any pending errors.
-  void* handle = dlopen("libelf-tls-library.so", RTLD_NOW);
-  ASSERT_TRUE(handle == nullptr);
-  ASSERT_SUBSTR("unsupported ELF TLS", dlerror());
-}
-
 TEST(dlfcn, dlopen_bad_flags) {
   dlerror(); // Clear any pending errors.
   void* handle;
@@ -1185,13 +1182,13 @@
 // that calls dlopen(libc...). This is to test the situation
 // described in b/7941716.
 TEST(dlfcn, dlopen_dlopen_from_ctor) {
-#if defined(__BIONIC__)
+#if defined(__GLIBC__)
+  GTEST_SKIP() << "glibc segfaults if you try to call dlopen from a constructor";
+#endif
+
   void* handle = dlopen("libtest_dlopen_from_ctor_main.so", RTLD_NOW);
   ASSERT_TRUE(handle != nullptr) << dlerror();
   dlclose(handle);
-#else
-  GTEST_LOG_(INFO) << "This test is disabled for glibc (glibc segfaults if you try to call dlopen from a constructor).\n";
-#endif
 }
 
 static std::string g_fini_call_order_str;
@@ -1739,4 +1736,28 @@
   ASSERT_TRUE(handle != nullptr) << dlerror();
 }
 
+TEST(dlfcn, segment_gap) {
+  void* handle = dlopen("libsegment_gap_outer.so", RTLD_NOW);
+  ASSERT_TRUE(handle != nullptr) << dlerror();
+
+  auto get_inner = reinterpret_cast<void* (*)()>(dlsym(handle, "get_inner"));
+  void* inner = get_inner();
+  (void)inner;
+
+#if __arm__
+  int count;
+  _Unwind_Ptr outer_exidx = dl_unwind_find_exidx(reinterpret_cast<_Unwind_Ptr>(get_inner), &count);
+  _Unwind_Ptr inner_exidx = dl_unwind_find_exidx(reinterpret_cast<_Unwind_Ptr>(inner), &count);
+  EXPECT_NE(0u, outer_exidx);
+  EXPECT_NE(0u, inner_exidx);
+  EXPECT_NE(inner_exidx, outer_exidx);
+#endif
+
+  Dl_info info;
+  int rc = dladdr(inner, &info);
+  ASSERT_NE(rc, 0);
+
+  EXPECT_NE(nullptr, strstr(info.dli_fname, "libsegment_gap_inner.so"));
+}
+
 #endif
diff --git a/tests/elftls_dl_test.cpp b/tests/elftls_dl_test.cpp
new file mode 100644
index 0000000..6d88880
--- /dev/null
+++ b/tests/elftls_dl_test.cpp
@@ -0,0 +1,337 @@
+/*
+ * Copyright (C) 2019 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 <dlfcn.h>
+#include <gtest/gtest.h>
+
+#include <thread>
+
+#include "gtest_globals.h"
+#include "private/__get_tls.h"
+#include "utils.h"
+
+#if defined(__BIONIC__)
+#include "bionic/pthread_internal.h"
+#endif
+
+// Access libtest_elftls_shared_var.so's TLS variable using an IE access.
+__attribute__((tls_model("initial-exec"))) extern "C" __thread int elftls_shared_var;
+
+TEST(elftls_dl, dlopen_shared_var_ie) {
+  // libtest_elftls_shared_var_ie.so can be dlopen'ed, even though it contains a
+  // TLS IE access, because its IE access references a TLS variable from
+  // libtest_elftls_shared_var.so, which is DT_NEEDED by the executable. This
+  // pattern appears in sanitizers, which use TLS IE instrumentation in shared
+  // objects to access special variables exported from the executable or from a
+  // preloaded solib.
+  void* lib = dlopen("libtest_elftls_shared_var_ie.so", RTLD_LOCAL | RTLD_NOW);
+  ASSERT_NE(nullptr, lib);
+
+  auto bump_shared_var = reinterpret_cast<int(*)()>(dlsym(lib, "bump_shared_var"));
+  ASSERT_NE(nullptr, bump_shared_var);
+
+  ASSERT_EQ(21, ++elftls_shared_var);
+  ASSERT_EQ(22, bump_shared_var());
+
+  std::thread([bump_shared_var] {
+    ASSERT_EQ(21, ++elftls_shared_var);
+    ASSERT_EQ(22, bump_shared_var());
+  }).join();
+}
+
+TEST(elftls_dl, dlopen_ie_error) {
+  std::string helper = GetTestlibRoot() +
+      "/elftls_dlopen_ie_error_helper/elftls_dlopen_ie_error_helper";
+  std::string src_path = GetTestlibRoot() + "/libtest_elftls_shared_var_ie.so";
+  std::string dst_path = GetTestlibRoot() + "/libtest_elftls_shared_var.so";
+#if defined(__BIONIC__)
+  std::string error =
+      "dlerror: dlopen failed: TLS symbol \"elftls_shared_var\" in dlopened \"" + dst_path + "\" " +
+      "referenced from \"" + src_path + "\" using IE access model\n";
+#else
+  // glibc will reserve some surplus static TLS memory, allowing this test to pass.
+  std::string error = "success\n";
+#endif
+
+  chmod(helper.c_str(), 0755); // TODO: "x" lost in CTS, b/34945607
+  ExecTestHelper eth;
+  eth.SetArgs({ helper.c_str(), nullptr });
+  eth.Run([&]() { execve(helper.c_str(), eth.GetArgs(), eth.GetEnv()); }, 0, error.c_str());
+}
+
+// Use a GD access (__tls_get_addr or TLSDESC) to modify a variable in static
+// TLS memory.
+TEST(elftls_dl, access_static_tls) {
+  void* lib = dlopen("libtest_elftls_dynamic.so", RTLD_LOCAL | RTLD_NOW);
+  ASSERT_NE(nullptr, lib);
+
+  auto bump_shared_var = reinterpret_cast<int(*)()>(dlsym(lib, "bump_shared_var"));
+  ASSERT_NE(nullptr, bump_shared_var);
+
+  ASSERT_EQ(21, ++elftls_shared_var);
+  ASSERT_EQ(22, bump_shared_var());
+
+  std::thread([bump_shared_var] {
+    ASSERT_EQ(21, ++elftls_shared_var);
+    ASSERT_EQ(22, bump_shared_var());
+  }).join();
+}
+
+TEST(elftls_dl, bump_local_vars) {
+  void* lib = dlopen("libtest_elftls_dynamic.so", RTLD_LOCAL | RTLD_NOW);
+  ASSERT_NE(nullptr, lib);
+
+  auto bump_local_vars = reinterpret_cast<int(*)()>(dlsym(lib, "bump_local_vars"));
+  ASSERT_NE(nullptr, bump_local_vars);
+
+  ASSERT_EQ(42, bump_local_vars());
+  std::thread([bump_local_vars] {
+    ASSERT_EQ(42, bump_local_vars());
+  }).join();
+}
+
+extern "C" int* missing_weak_tls_addr();
+
+// The Bionic linker resolves a TPREL relocation to an unresolved weak TLS
+// symbol to 0, which is added to the thread pointer. N.B.: A TPREL relocation
+// in a static executable is resolved by the static linker instead, and static
+// linker behavior varies (especially with bfd and gold). See
+// https://bugs.llvm.org/show_bug.cgi?id=40570.
+TEST(elftls_dl, tprel_missing_weak) {
+  ASSERT_EQ(static_cast<void*>(__get_tls()), missing_weak_tls_addr());
+  std::thread([] {
+    ASSERT_EQ(static_cast<void*>(__get_tls()), missing_weak_tls_addr());
+  }).join();
+}
+
+// The behavior of accessing an unresolved weak TLS symbol using a dynamic TLS
+// relocation depends on which kind of implementation the target uses. With
+// TLSDESC, the result is NULL. With __tls_get_addr, the result is the
+// generation count (or maybe undefined behavior)? This test only tests TLSDESC.
+TEST(elftls_dl, tlsdesc_missing_weak) {
+#if defined(__aarch64__)
+  void* lib = dlopen("libtest_elftls_dynamic.so", RTLD_LOCAL | RTLD_NOW);
+  ASSERT_NE(nullptr, lib);
+
+  auto missing_weak_dyn_tls_addr = reinterpret_cast<int*(*)()>(dlsym(lib, "missing_weak_dyn_tls_addr"));
+  ASSERT_NE(nullptr, missing_weak_dyn_tls_addr);
+
+  ASSERT_EQ(nullptr, missing_weak_dyn_tls_addr());
+  std::thread([missing_weak_dyn_tls_addr] {
+    ASSERT_EQ(nullptr, missing_weak_dyn_tls_addr());
+  }).join();
+#else
+  GTEST_SKIP() << "This test is only run on TLSDESC-based targets";
+#endif
+}
+
+TEST(elftls_dl, dtv_resize) {
+#if defined(__BIONIC__)
+#define LOAD_LIB(soname) ({                           \
+    auto lib = dlopen(soname, RTLD_LOCAL | RTLD_NOW); \
+    ASSERT_NE(nullptr, lib);                          \
+    reinterpret_cast<int(*)()>(dlsym(lib, "bump"));   \
+  })
+
+  auto dtv = []() -> TlsDtv* { return __get_tcb_dtv(__get_bionic_tcb()); };
+
+  static_assert(sizeof(TlsDtv) == 3 * sizeof(void*),
+                "This test assumes that the Dtv has a 3-word header");
+
+  // Initially there are 3 modules:
+  //  - the main test executable
+  //  - libtest_elftls_shared_var
+  //  - libtest_elftls_tprel
+
+  // The initial DTV is an empty DTV with no generation and a size of 0.
+  TlsDtv* zero_dtv = dtv();
+  ASSERT_EQ(0u, zero_dtv->count);
+  ASSERT_EQ(nullptr, zero_dtv->next);
+  ASSERT_EQ(kTlsGenerationNone, zero_dtv->generation);
+
+  // Load the fourth module.
+  auto func1 = LOAD_LIB("libtest_elftls_dynamic_filler_1.so");
+  ASSERT_EQ(101, func1());
+
+  // After loading one module, the DTV should be initialized to the next
+  // power-of-2 size (including the header).
+  TlsDtv* initial_dtv = dtv();
+  ASSERT_EQ(5u, initial_dtv->count);
+  ASSERT_EQ(zero_dtv, initial_dtv->next);
+  ASSERT_LT(0u, initial_dtv->generation);
+
+  // Load module 5.
+  auto func2 = LOAD_LIB("libtest_elftls_dynamic_filler_2.so");
+  ASSERT_EQ(102, func1());
+  ASSERT_EQ(201, func2());
+  ASSERT_EQ(initial_dtv, dtv());
+  ASSERT_EQ(5u, initial_dtv->count);
+
+  // Load module 6.
+  auto func3 = LOAD_LIB("libtest_elftls_dynamic_filler_3.so");
+  ASSERT_EQ(103, func1());
+  ASSERT_EQ(202, func2());
+
+#if defined(__aarch64__)
+  // The arm64 TLSDESC resolver doesn't update the DTV if it is new enough for
+  // the given access.
+  ASSERT_EQ(5u, dtv()->count);
+#else
+  // __tls_get_addr updates the DTV anytime the generation counter changes.
+  ASSERT_EQ(13u, dtv()->count);
+#endif
+
+  ASSERT_EQ(301, func3());
+
+  TlsDtv* new_dtv = dtv();
+  ASSERT_EQ(13u, new_dtv->count);
+  ASSERT_NE(initial_dtv, new_dtv);
+  ASSERT_EQ(initial_dtv, new_dtv->next);
+
+#undef LOAD_LIB
+#else
+  GTEST_SKIP() << "test doesn't apply to glibc";
+#endif
+}
+
+// Verify that variables are reset to their initial values after the library
+// containing them is closed.
+TEST(elftls_dl, dlclose_resets_values) {
+  for (int round = 0; round < 2; ++round) {
+    void* lib = dlopen("libtest_elftls_dynamic.so", RTLD_LOCAL | RTLD_NOW);
+    ASSERT_NE(nullptr, lib);
+
+    auto bump_local_vars = reinterpret_cast<int(*)()>(dlsym(lib, "bump_local_vars"));
+    ASSERT_NE(nullptr, bump_local_vars);
+
+    ASSERT_EQ(42, bump_local_vars());
+    ASSERT_EQ(44, bump_local_vars());
+
+    ASSERT_EQ(0, dlclose(lib));
+  }
+}
+
+// Calling dlclose should remove the entry for the solib from the global list of
+// ELF TLS modules. Test that repeatedly loading and unloading a library doesn't
+// increase the DTV size.
+TEST(elftls_dl, dlclose_removes_entry) {
+#if defined(__BIONIC__)
+  auto dtv = []() -> TlsDtv* { return __get_tcb_dtv(__get_bionic_tcb()); };
+
+  bool first = true;
+  size_t count = 0;
+
+  // Use a large number of rounds in case the DTV is initially larger than
+  // expected.
+  for (int round = 0; round < 32; ++round) {
+    void* lib = dlopen("libtest_elftls_dynamic.so", RTLD_LOCAL | RTLD_NOW);
+    ASSERT_NE(nullptr, lib);
+
+    auto bump_local_vars = reinterpret_cast<int(*)()>(dlsym(lib, "bump_local_vars"));
+    ASSERT_NE(nullptr, bump_local_vars);
+
+    ASSERT_EQ(42, bump_local_vars());
+    if (first) {
+      first = false;
+      count = dtv()->count;
+    } else {
+      ASSERT_EQ(count, dtv()->count);
+    }
+
+    dlclose(lib);
+  }
+#else
+  GTEST_SKIP() << "test doesn't apply to glibc";
+#endif
+}
+
+// Use dlsym to get the address of a TLS variable in static TLS and compare it
+// against the ordinary address of the variable.
+TEST(elftls_dl, dlsym_static_tls) {
+  void* lib = dlopen("libtest_elftls_shared_var.so", RTLD_LOCAL | RTLD_NOW);
+  ASSERT_NE(nullptr, lib);
+
+  int* var_addr = static_cast<int*>(dlsym(lib, "elftls_shared_var"));
+  ASSERT_EQ(&elftls_shared_var, var_addr);
+
+  std::thread([lib] {
+    int* var_addr = static_cast<int*>(dlsym(lib, "elftls_shared_var"));
+    ASSERT_EQ(&elftls_shared_var, var_addr);
+  }).join();
+}
+
+// Use dlsym to get the address of a TLS variable in dynamic TLS and compare it
+// against the ordinary address of the variable.
+TEST(elftls_dl, dlsym_dynamic_tls) {
+  void* lib = dlopen("libtest_elftls_dynamic.so", RTLD_LOCAL | RTLD_NOW);
+  ASSERT_NE(nullptr, lib);
+  auto get_var_addr = reinterpret_cast<int*(*)()>(dlsym(lib, "get_large_tls_var_addr"));
+  ASSERT_NE(nullptr, get_var_addr);
+
+  int* var_addr = static_cast<int*>(dlsym(lib, "large_tls_var"));
+  ASSERT_EQ(get_var_addr(), var_addr);
+
+  std::thread([lib, get_var_addr] {
+    int* var_addr = static_cast<int*>(dlsym(lib, "large_tls_var"));
+    ASSERT_EQ(get_var_addr(), var_addr);
+  }).join();
+}
+
+// Calling dladdr on a TLS variable's address doesn't find anything.
+TEST(elftls_dl, dladdr_on_tls_var) {
+  Dl_info info;
+
+  // Static TLS variable
+  ASSERT_EQ(0, dladdr(&elftls_shared_var, &info));
+
+  // Dynamic TLS variable
+  void* lib = dlopen("libtest_elftls_dynamic.so", RTLD_LOCAL | RTLD_NOW);
+  ASSERT_NE(nullptr, lib);
+  int* var_addr = static_cast<int*>(dlsym(lib, "large_tls_var"));
+  ASSERT_EQ(0, dladdr(var_addr, &info));
+}
+
+// Verify that dladdr does not misinterpret a TLS symbol's value as a virtual
+// address.
+TEST(elftls_dl, dladdr_skip_tls_symbol) {
+  void* lib = dlopen("libtest_elftls_dynamic.so", RTLD_LOCAL | RTLD_NOW);
+
+  auto get_local_addr = reinterpret_cast<void*(*)()>(dlsym(lib, "get_local_addr"));
+  ASSERT_NE(nullptr, get_local_addr);
+  void* local_addr = get_local_addr();
+
+  Dl_info info;
+  ASSERT_NE(0, dladdr(local_addr, &info));
+
+  std::string libpath = GetTestlibRoot() + "/libtest_elftls_dynamic.so";
+  char dli_realpath[PATH_MAX];
+  ASSERT_TRUE(realpath(info.dli_fname, dli_realpath));
+  ASSERT_STREQ(libpath.c_str(), dli_realpath);
+  ASSERT_STREQ(nullptr, info.dli_sname);
+  ASSERT_EQ(nullptr, info.dli_saddr);
+}
diff --git a/tests/elftls_test.cpp b/tests/elftls_test.cpp
new file mode 100644
index 0000000..7c072b6
--- /dev/null
+++ b/tests/elftls_test.cpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2019 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 <gtest/gtest.h>
+
+#include <thread>
+
+// Specify the LE access model explicitly. This file is compiled into the
+// bionic-unit-tests executable, but the compiler sees an -fpic object file
+// output into a static library, so it defaults to dynamic TLS accesses.
+
+// This variable will be zero-initialized (.tbss)
+__attribute__((tls_model("local-exec"))) static __thread int tlsvar_le_zero;
+
+// This variable will have an initializer (.tdata)
+__attribute__((tls_model("local-exec"))) static __thread int tlsvar_le_init = 10;
+
+// Access libtest_elftls_shared_var's TLS variable using an IE access.
+__attribute__((tls_model("initial-exec"))) extern "C" __thread int elftls_shared_var;
+
+TEST(elftls, basic_le) {
+  // Check the variables on the main thread.
+  ASSERT_EQ(11, ++tlsvar_le_init);
+  ASSERT_EQ(1, ++tlsvar_le_zero);
+
+  // Check variables on a new thread.
+  std::thread([] {
+    ASSERT_EQ(11, ++tlsvar_le_init);
+    ASSERT_EQ(1, ++tlsvar_le_zero);
+  }).join();
+}
+
+TEST(elftls, shared_ie) {
+  ASSERT_EQ(21, ++elftls_shared_var);
+  std::thread([] {
+    ASSERT_EQ(21, ++elftls_shared_var);
+  }).join();
+}
+
+extern "C" int bump_static_tls_var_1();
+extern "C" int bump_static_tls_var_2();
+
+TEST(elftls, tprel_addend) {
+  ASSERT_EQ(4, bump_static_tls_var_1());
+  ASSERT_EQ(8, bump_static_tls_var_2());
+  std::thread([] {
+    ASSERT_EQ(4, bump_static_tls_var_1());
+    ASSERT_EQ(8, bump_static_tls_var_2());
+  }).join();
+}
+
+// Because this C++ source file is built with -fpic, the compiler will access
+// this variable using a GD model. Typically, the static linker will relax the
+// GD to LE, but the arm32 linker doesn't do TLS relaxations, so we can test
+// calling __tls_get_addr in a static executable. The static linker knows that
+// the main executable's TlsIndex::module_id is 1 and writes that into the GOT.
+__thread int tlsvar_general = 30;
+
+TEST(elftls, general) {
+  ASSERT_EQ(31, ++tlsvar_general);
+  std::thread([] {
+    ASSERT_EQ(31, ++tlsvar_general);
+  }).join();
+}
diff --git a/tests/endian_test.cpp b/tests/endian_test.cpp
index 85d56f0..3d6dc4d 100644
--- a/tests/endian_test.cpp
+++ b/tests/endian_test.cpp
@@ -46,7 +46,7 @@
   ASSERT_EQ(be32, htonl(le32));
   ASSERT_EQ(be64, htonq(le64));
 #else
-  GTEST_LOG_(INFO) << "glibc doesn't have these macros";
+  GTEST_SKIP() << "glibc doesn't have htons/htonl/htonq in <endian.h>";
 #endif
 }
 
@@ -56,7 +56,7 @@
   ASSERT_EQ(le32, ntohl(be32));
   ASSERT_EQ(le64, ntohq(be64));
 #else
-  GTEST_LOG_(INFO) << "glibc doesn't have these macros";
+  GTEST_SKIP() << "glibc doesn't have ntohs/ntohl/ntohq in <endian.h>";
 #endif
 }
 
@@ -90,7 +90,7 @@
   ASSERT_EQ(le32, betoh32(be32));
   ASSERT_EQ(le64, betoh64(be64));
 #else
-  GTEST_LOG_(INFO) << "glibc doesn't have these macros";
+  GTEST_SKIP() << "glibc doesn't have betoh16/betoh32/betoh64";
 #endif
 }
 
@@ -100,6 +100,6 @@
   ASSERT_EQ(le32, letoh32(le32));
   ASSERT_EQ(le64, letoh64(le64));
 #else
-  GTEST_LOG_(INFO) << "glibc doesn't have these macros";
+  GTEST_SKIP() << "glibc doesn't have letoh16/letoh32/letoh64";
 #endif
 }
diff --git a/tests/fortify_test.cpp b/tests/fortify_test.cpp
index bc33251..489b701 100644
--- a/tests/fortify_test.cpp
+++ b/tests/fortify_test.cpp
@@ -143,7 +143,7 @@
   ASSERT_FORTIFY(stpcpy(myfoo.empty, src));
   free(src);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "stpcpy not available";
 #endif // __BIONIC__
 }
 
@@ -155,7 +155,7 @@
   ASSERT_FORTIFY(strcpy(myfoo.empty, src));
   free(src);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -167,7 +167,7 @@
   ASSERT_FORTIFY(strcpy(myfoo.empty, src));
   free(src);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -179,7 +179,7 @@
   ASSERT_FORTIFY(strcpy(myfoo.one, src));
   free(src);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -191,7 +191,7 @@
   ASSERT_FORTIFY(printf("%s", strchr(myfoo.a, 'a')));
   ASSERT_FORTIFY(printf("%s", strchr(static_cast<const char*>(myfoo.a), 'a')));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -203,7 +203,7 @@
   ASSERT_FORTIFY(printf("%s", strrchr(myfoo.a, 'a')));
   ASSERT_FORTIFY(printf("%s", strrchr(static_cast<const char*>(myfoo.a), 'a')));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -215,7 +215,7 @@
   ASSERT_FORTIFY(printf("%s", memchr(myfoo.a, 'a', asize)));
   ASSERT_FORTIFY(printf("%s", memchr(static_cast<const void*>(myfoo.a), 'a', asize)));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -227,7 +227,7 @@
   ASSERT_FORTIFY(printf("%s", memrchr(myfoo.a, 'a', asize)));
   ASSERT_FORTIFY(printf("%s", memrchr(static_cast<const void*>(myfoo.a), 'a', asize)));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -238,7 +238,7 @@
   size_t n = strlen(myfoo.a);
   ASSERT_FORTIFY(strlcpy(myfoo.one, myfoo.a, n));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "strlcpy not available";
 #endif // __BIONIC__
 }
 
@@ -250,7 +250,7 @@
   size_t n = strlen(myfoo.a);
   ASSERT_FORTIFY(strlcat(myfoo.one, myfoo.a, n));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "strlcat not available";
 #endif // __BIONIC__
 }
 
@@ -315,7 +315,7 @@
   ASSERT_FORTIFY(strcpy(buf, orig));
   free(orig);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -327,7 +327,7 @@
   ASSERT_FORTIFY(strcpy(buf, orig));
   free(orig);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -339,7 +339,7 @@
   ASSERT_FORTIFY(strcpy(buf, orig));
   free(orig);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -351,7 +351,7 @@
   ASSERT_FORTIFY(strcpy(buf, orig));
   free(orig);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -361,7 +361,7 @@
   memcpy(buf, "0123456789", sizeof(buf));
   ASSERT_FORTIFY(printf("%zd", strlen(buf)));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -371,7 +371,7 @@
   memcpy(buf, "0123456789", sizeof(buf));
   ASSERT_FORTIFY(printf("%s", strchr(buf, 'a')));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -381,7 +381,7 @@
   memcpy(buf, "0123456789", sizeof(buf));
   ASSERT_FORTIFY(printf("%s", strrchr(buf, 'a')));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif // __BIONIC__
 }
 
@@ -393,7 +393,7 @@
   size_t n = strlen(bufa);
   ASSERT_FORTIFY(strlcpy(bufb, bufa, n));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "strlcpy not available";
 #endif // __BIONIC__
 }
 
@@ -406,7 +406,7 @@
   size_t n = strlen(bufa);
   ASSERT_FORTIFY(strlcat(bufb, bufa, n));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "strlcat not available";
 #endif // __BIONIC__
 }
 
diff --git a/tests/getauxval_test.cpp b/tests/getauxval_test.cpp
index 63bc963..f4ec7f5 100644
--- a/tests/getauxval_test.cpp
+++ b/tests/getauxval_test.cpp
@@ -14,29 +14,14 @@
  * limitations under the License.
  */
 
+#include <sys/auxv.h>
+
 #include <errno.h>
 #include <sys/cdefs.h>
 #include <sys/utsname.h>
 #include <gtest/gtest.h>
 
-// getauxval() was only added as of glibc version 2.16.
-// See: http://lwn.net/Articles/519085/
-// Don't try to compile this code on older glibc versions.
-
-#if defined(__BIONIC__)
-  #define GETAUXVAL_CAN_COMPILE 1
-#elif defined(__GLIBC_PREREQ)
-  #if __GLIBC_PREREQ(2, 16)
-    #define GETAUXVAL_CAN_COMPILE 1
-  #endif
-#endif
-
-#if defined(GETAUXVAL_CAN_COMPILE)
-#include <sys/auxv.h>
-#endif
-
 TEST(getauxval, expected_values) {
-#if defined(GETAUXVAL_CAN_COMPILE)
   ASSERT_EQ(0UL, getauxval(AT_SECURE));
   ASSERT_EQ(getuid(), getauxval(AT_UID));
   ASSERT_EQ(geteuid(), getauxval(AT_EUID));
@@ -48,19 +33,12 @@
   ASSERT_NE(0UL, getauxval(AT_PHNUM));
   ASSERT_NE(0UL, getauxval(AT_ENTRY));
   ASSERT_NE(0UL, getauxval(AT_PAGESZ));
-#else
-  GTEST_LOG_(INFO) << "This test requires a C library with getauxval.\n";
-#endif
 }
 
 TEST(getauxval, unexpected_values) {
-#if defined(GETAUXVAL_CAN_COMPILE)
   errno = 0;
   ASSERT_EQ(0UL, getauxval(0xdeadbeef));
   ASSERT_EQ(ENOENT, errno);
-#else
-  GTEST_LOG_(INFO) << "This test requires a C library with getauxval.\n";
-#endif
 }
 
 TEST(getauxval, arm_has_AT_HWCAP2) {
@@ -83,5 +61,5 @@
     return;
   }
 #endif
-  GTEST_LOG_(INFO) << "This test is only meaningful for 32-bit ARM code on 64-bit devices.\n";
+  GTEST_SKIP() << "This test is only meaningful for 32-bit ARM code on 64-bit devices";
 }
diff --git a/tests/getcwd_test.cpp b/tests/getcwd_test.cpp
index 791ffae..97b1d4f 100644
--- a/tests/getcwd_test.cpp
+++ b/tests/getcwd_test.cpp
@@ -51,7 +51,7 @@
 }
 
 TEST(getcwd, auto_too_large) {
-  SKIP_WITH_HWASAN; // allocation size too large
+  SKIP_WITH_HWASAN << "allocation size too large";
   // If we ask the library to allocate an unreasonably large buffer, ERANGE.
   errno = 0;
   char* cwd = getcwd(nullptr, static_cast<size_t>(-1));
diff --git a/tests/grp_pwd_file_test.cpp b/tests/grp_pwd_file_test.cpp
index 2cbad62..adcdbd6 100644
--- a/tests/grp_pwd_file_test.cpp
+++ b/tests/grp_pwd_file_test.cpp
@@ -26,7 +26,7 @@
 template <typename T>
 class FileUnmapper {
  public:
-  FileUnmapper(T& file) : file_(file) {
+  explicit FileUnmapper(T& file) : file_(file) {
   }
   ~FileUnmapper() {
     file_.Unmap();
@@ -103,7 +103,7 @@
   EXPECT_FALSE(passwd_file.FindById(3, nullptr));
 
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif  // __BIONIC__
 }
 
@@ -123,7 +123,7 @@
   EXPECT_FALSE(group_file.FindById(3, nullptr));
 
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif  // __BIONIC__
 }
 
@@ -161,7 +161,7 @@
   EXPECT_FALSE(passwd_file.FindById(50, nullptr));
 
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif  // __BIONIC__
 }
 
@@ -197,7 +197,7 @@
   EXPECT_FALSE(group_file.FindById(799, nullptr));
 
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif  // __BIONIC__
 }
 
@@ -219,7 +219,7 @@
   FindAndCheckPasswdEntry(&passwd_file, "vendor_name", 3, 4, "dir", "shell");
 
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif  // __BIONIC__
 }
 
@@ -241,6 +241,6 @@
   FindAndCheckGroupEntry(&group_file, "vendor_name", 2);
 
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif  // __BIONIC__
 }
diff --git a/tests/grp_pwd_test.cpp b/tests/grp_pwd_test.cpp
index ca34205..b46839b 100644
--- a/tests/grp_pwd_test.cpp
+++ b/tests/grp_pwd_test.cpp
@@ -34,6 +34,7 @@
 #include <private/android_filesystem_config.h>
 
 #if defined(__BIONIC__)
+#include <android/api-level.h>
 #include <android-base/properties.h>
 #endif
 
@@ -137,17 +138,13 @@
 
 #else // !defined(__BIONIC__)
 
-static void print_no_getpwnam_test_info() {
-  GTEST_LOG_(INFO) << "This test is about uid/username translation for Android, which does nothing on libc other than bionic.\n";
-}
-
 static void check_get_passwd(const char* /* username */, uid_t /* uid */, uid_type_t /* uid_type */,
                              bool /* check_username */) {
-  print_no_getpwnam_test_info();
+  GTEST_SKIP() << "bionic-only test";
 }
 
 static void check_get_passwd(const char* /* username */, uid_t /* uid */, uid_type_t /* uid_type */) {
-  print_no_getpwnam_test_info();
+  GTEST_SKIP() << "bionic-only test";
 }
 
 #endif
@@ -198,7 +195,7 @@
 }
 
 TEST(pwd, getpwnam_app_id_u0_i1) {
-  check_get_passwd("u0_i1", 99001, TYPE_APP);
+  check_get_passwd("u0_i1", 90001, TYPE_APP);
 }
 
 TEST(pwd, getpwnam_app_id_u1_root) {
@@ -218,9 +215,8 @@
 }
 
 TEST(pwd, getpwnam_app_id_u1_i0) {
-  check_get_passwd("u1_i0", 199000, TYPE_APP);
+  check_get_passwd("u1_i0", 190000, TYPE_APP);
 }
-
 #if defined(__BIONIC__)
 template <typename T>
 static void expect_ids(const T& ids) {
@@ -248,11 +244,9 @@
   expect_range(AID_SHARED_GID_START, AID_SHARED_GID_END);
   expect_range(AID_ISOLATED_START, AID_ISOLATED_END);
 
-  // Upgrading devices launched before API level 28 may not comply with the below check.
-  // Due to the difficulty in changing uids after launch, it is waived for these devices.
-  // Also grant this check for device launched with 28(P) to give the vendor time to
-  // adopt the AID scheme.
-  if (android::base::GetIntProperty("ro.product.first_api_level", 0) <= 28) {
+  // TODO(73062966): We still don't have a good way to create vendor AIDs in the system or other
+  // non-vendor partitions, therefore we keep this check disabled.
+  if (android::base::GetIntProperty("ro.product.first_api_level", 0) <= __ANDROID_API_Q__) {
     return;
   }
 
@@ -313,7 +307,7 @@
 
   expect_ids(uids);
 #else
-  print_no_getpwnam_test_info();
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -384,16 +378,12 @@
 
 #else // !defined(__BIONIC__)
 
-static void print_no_getgrnam_test_info() {
-  GTEST_LOG_(INFO) << "This test is about gid/group_name translation for Android, which does nothing on libc other than bionic.\n";
-}
-
 static void check_get_group(const char*, gid_t, bool) {
-  print_no_getgrnam_test_info();
+  GTEST_SKIP() << "bionic-only test";
 }
 
 static void check_get_group(const char*, gid_t) {
-  print_no_getgrnam_test_info();
+  GTEST_SKIP() << "bionic-only test";
 }
 
 #endif
@@ -464,7 +454,7 @@
 }
 
 TEST(grp, getgrnam_app_id_u0_i1) {
-  check_get_group("u0_i1", 99001);
+  check_get_group("u0_i1", 90001);
 }
 
 TEST(grp, getgrnam_app_id_u1_root) {
@@ -484,7 +474,7 @@
 }
 
 TEST(grp, getgrnam_app_id_u1_i0) {
-  check_get_group("u1_i0", 199000);
+  check_get_group("u1_i0", 190000);
 }
 
 TEST(grp, getgrnam_r_reentrancy) {
@@ -503,7 +493,7 @@
   check_group(grp[0], "root", 0);
   check_group(grp[1], "system", 1000);
 #else
-  print_no_getgrnam_test_info();
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -523,7 +513,7 @@
   check_group(grp[0], "root", 0);
   check_group(grp[1], "system", 1000);
 #else
-  print_no_getgrnam_test_info();
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -563,7 +553,7 @@
 
   expect_ids(gids);
 #else
-  print_no_getgrnam_test_info();
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -592,7 +582,7 @@
 
   TestAidNamePrefix("/vendor/etc/passwd");
 #else
-  print_no_getpwnam_test_info();
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -604,6 +594,6 @@
 
   TestAidNamePrefix("/vendor/etc/group");
 #else
-  print_no_getgrnam_test_info();
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
diff --git a/tests/headers/posix/signal_h.c b/tests/headers/posix/signal_h.c
index 661b55e..c2e544e 100644
--- a/tests/headers/posix/signal_h.c
+++ b/tests/headers/posix/signal_h.c
@@ -53,7 +53,7 @@
   STRUCT_MEMBER(struct sigevent, int, sigev_signo);
   STRUCT_MEMBER(struct sigevent, union sigval, sigev_value);
   STRUCT_MEMBER_FUNCTION_POINTER(struct sigevent, void (*f)(union sigval), sigev_notify_function);
-#if defined(__BIONIC__) || defined(__GLIBC__)
+#if defined(__BIONIC__)
   STRUCT_MEMBER(struct sigevent, void*, sigev_notify_attributes);
 #else
   STRUCT_MEMBER(struct sigevent, pthread_attr_t*, sigev_notify_attributes);
diff --git a/tests/ifunc_test.cpp b/tests/ifunc_test.cpp
new file mode 100644
index 0000000..7ab5899
--- /dev/null
+++ b/tests/ifunc_test.cpp
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <gtest/gtest.h>
+
+int ret42() {
+  return 42;
+}
+
+extern "C" void* resolver() {
+  return (void*)ret42;
+}
+
+int ifunc() __attribute__((ifunc("resolver")));
+
+TEST(ifunc, function) {
+  ASSERT_EQ(42, ifunc());
+}
diff --git a/tests/libgen_test.cpp b/tests/libgen_test.cpp
index d5b5eb6..24f7923 100644
--- a/tests/libgen_test.cpp
+++ b/tests/libgen_test.cpp
@@ -78,7 +78,7 @@
   TestBasename(".", ".", 1, buf, sizeof(buf), 0);
   TestBasename("..", "..", 2, buf, sizeof(buf), 0);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "basename_r is only available on 32-bit bionic";
 #endif // __BIONIC__
 }
 
@@ -95,6 +95,6 @@
   TestDirname(".", ".", 1, buf, sizeof(buf), 0);
   TestDirname("..", ".", 1, buf, sizeof(buf), 0);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "dirname_r is only available on 32-bit bionic";
 #endif // __BIONIC__
 }
diff --git a/tests/libs/Android.bp b/tests/libs/Android.bp
index 79c9a06..422cd75 100644
--- a/tests/libs/Android.bp
+++ b/tests/libs/Android.bp
@@ -40,14 +40,64 @@
 }
 
 // -----------------------------------------------------------------------------
-// Library to test ELF TLS
+// Libraries and helper binaries for ELF TLS
 // -----------------------------------------------------------------------------
 cc_test_library {
-    name: "libelf-tls-library",
+    name: "libtest_elftls_shared_var",
     defaults: ["bionic_testlib_defaults"],
-    srcs: ["elf_tls_test_library.cpp"],
+    srcs: ["elftls_shared_var.cpp"],
     cflags: ["-fno-emulated-tls"],
-    allow_undefined_symbols: true, // __tls_get_addr is undefined.
+}
+
+cc_test_library {
+    name: "libtest_elftls_shared_var_ie",
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["elftls_shared_var_ie.cpp"],
+    cflags: ["-fno-emulated-tls"],
+    shared_libs: ["libtest_elftls_shared_var"],
+}
+
+cc_test_library {
+    name: "libtest_elftls_tprel",
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["elftls_tprel.cpp"],
+    cflags: ["-fno-emulated-tls"],
+}
+
+cc_test {
+    name: "elftls_dlopen_ie_error_helper",
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["elftls_dlopen_ie_error_helper.cpp"],
+    ldflags: ["-Wl,--rpath,${ORIGIN}/.."],
+}
+
+cc_test_library {
+    name: "libtest_elftls_dynamic",
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["elftls_dynamic.cpp"],
+    cflags: ["-fno-emulated-tls"],
+    shared_libs: ["libtest_elftls_shared_var"],
+}
+
+cc_test_library {
+    name: "libtest_elftls_dynamic_filler_1",
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["elftls_dynamic_filler.cpp"],
+    cflags: ["-fno-emulated-tls", "-DTLS_FILLER=100"],
+}
+
+cc_test_library {
+    name: "libtest_elftls_dynamic_filler_2",
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["elftls_dynamic_filler.cpp"],
+    cflags: ["-fno-emulated-tls", "-DTLS_FILLER=200"],
+}
+
+cc_test_library {
+    name: "libtest_elftls_dynamic_filler_3",
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["elftls_dynamic_filler.cpp"],
+    cflags: ["-fno-emulated-tls", "-DTLS_FILLER=300"],
 }
 
 // -----------------------------------------------------------------------------
@@ -237,6 +287,10 @@
         "libnstest_public",
         "libnstest_private",
     ],
+    // The dlext.ns_anonymous test copies the loaded segments of this shared
+    // object into a new mapping, so every segment must be readable. Turn off
+    // eXecute-Only-Memory. See http://b/123034666.
+    xom: false,
 }
 
 cc_test_library {
@@ -864,3 +918,18 @@
     defaults: ["bionic_testlib_defaults"],
     srcs: ["exec_linker_helper_lib.cpp"],
 }
+
+cc_test_library {
+    name: "libsegment_gap_outer",
+    host_supported: false,
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["segment_gap_outer.cpp"],
+    ldflags: ["-Wl,-T,bionic/tests/libs/segment_gap_outer.lds"],
+}
+
+cc_test_library {
+    name: "libsegment_gap_inner",
+    host_supported: false,
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["segment_gap_inner.cpp"],
+}
diff --git a/tests/libs/Android.build.dlext_testzip.mk b/tests/libs/Android.build.dlext_testzip.mk
index 19fd64b..8775c29 100644
--- a/tests/libs/Android.build.dlext_testzip.mk
+++ b/tests/libs/Android.build.dlext_testzip.mk
@@ -59,21 +59,38 @@
 lib_b := $(call intermediates-dir-for,SHARED_LIBRARIES,libtest_dt_runpath_b,,,$(bionic_2nd_arch_prefix))/libtest_dt_runpath_b.so
 lib_c := $(call intermediates-dir-for,SHARED_LIBRARIES,libtest_dt_runpath_c,,,$(bionic_2nd_arch_prefix))/libtest_dt_runpath_c.so
 lib_x := $(call intermediates-dir-for,SHARED_LIBRARIES,libtest_dt_runpath_x,,,$(bionic_2nd_arch_prefix))/libtest_dt_runpath_x.so
+lib_y := $(call intermediates-dir-for,SHARED_LIBRARIES,libtest_dt_runpath_y,,,$(bionic_2nd_arch_prefix))/libtest_dt_runpath_y.so
 
 $(LOCAL_BUILT_MODULE) : PRIVATE_LIB_D := $(lib_d)
 $(LOCAL_BUILT_MODULE) : PRIVATE_LIB_A := $(lib_a)
 $(LOCAL_BUILT_MODULE) : PRIVATE_LIB_B := $(lib_b)
 $(LOCAL_BUILT_MODULE) : PRIVATE_LIB_C := $(lib_c)
 $(LOCAL_BUILT_MODULE) : PRIVATE_LIB_X := $(lib_x)
-$(LOCAL_BUILT_MODULE) : $(lib_d) $(lib_a) $(lib_b) $(lib_c) $(lib_x) $(BIONIC_TESTS_ZIPALIGN)
+$(LOCAL_BUILT_MODULE) : PRIVATE_LIB_Y := $(lib_y)
+ifeq ($(TARGET_IS_64_BIT),true)
+  ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
+    $(LOCAL_BUILT_MODULE) : PRIVATE_LIB_OR_LIB64 := $(if $(LOCAL_2ND_ARCH_VAR_PREFIX),lib/$(TARGET_2ND_ARCH),lib64)
+  else
+    $(LOCAL_BUILT_MODULE) : PRIVATE_LIB_OR_LIB64 := $(if $(LOCAL_2ND_ARCH_VAR_PREFIX),lib,lib64)
+  endif
+else
+  ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
+    $(LOCAL_BUILT_MODULE) : PRIVATE_LIB_OR_LIB64 := $(if $(LOCAL_2ND_ARCH_VAR_PREFIX),lib/$(TARGET_2ND_ARCH),lib)
+  else
+    $(LOCAL_BUILT_MODULE) : PRIVATE_LIB_OR_LIB64 := lib
+  endif
+endif
+$(LOCAL_BUILT_MODULE) : $(lib_d) $(lib_a) $(lib_b) $(lib_c) $(lib_x) $(lib_y) $(BIONIC_TESTS_ZIPALIGN)
 	@echo "Aligning zip: $@"
 	$(hide) rm -rf $@.unaligned $@ $(dir $@)/zipdir && mkdir -p $(dir $@)/zipdir/libdir && \
-    mkdir -p $(dir $@)/zipdir/libdir/dt_runpath_a && mkdir -p $(dir $@)/zipdir/libdir/dt_runpath_b_c_x
+    mkdir -p $(dir $@)/zipdir/libdir/dt_runpath_a && mkdir -p $(dir $@)/zipdir/libdir/dt_runpath_b_c_x && \
+    mkdir -p $(dir $@)/zipdir/libdir/dt_runpath_y/$(PRIVATE_LIB_OR_LIB64)
 	$(hide) cp $(PRIVATE_LIB_D) $(dir $@)/zipdir/libdir
 	$(hide) cp $(PRIVATE_LIB_A) $(dir $@)/zipdir/libdir/dt_runpath_a
 	$(hide) cp $(PRIVATE_LIB_B) $(dir $@)/zipdir/libdir/dt_runpath_b_c_x
 	$(hide) cp $(PRIVATE_LIB_C) $(dir $@)/zipdir/libdir/dt_runpath_b_c_x
 	$(hide) cp $(PRIVATE_LIB_X) $(dir $@)/zipdir/libdir/dt_runpath_b_c_x
+	$(hide) cp $(PRIVATE_LIB_Y) $(dir $@)/zipdir/libdir/dt_runpath_y/$(PRIVATE_LIB_OR_LIB64)
 	$(hide) touch $(dir $@)/zipdir/empty_file.txt
 	$(hide) (cd $(dir $@)/zipdir && zip -qrD0 ../$(notdir $@).unaligned .)
 	$(hide) $(BIONIC_TESTS_ZIPALIGN) 4096 $@.unaligned $@
diff --git a/tests/libs/Android.build.dt_runpath.mk b/tests/libs/Android.build.dt_runpath.mk
index a3fcac5..b0d8e4b 100644
--- a/tests/libs/Android.build.dt_runpath.mk
+++ b/tests/libs/Android.build.dt_runpath.mk
@@ -21,11 +21,12 @@
 #
 # Dependencies
 #
-# libtest_dt_runpath_d.so                       runpath: ${ORIGIN}/dt_runpath_b_c_x
+# libtest_dt_runpath_d.so                       runpath: ${ORIGIN}/dt_runpath_b_c_x, ${ORIGIN}/dt_runpath_y/${LIB}
 # |-> dt_runpath_b_c_x/libtest_dt_runpath_b.so  runpath: ${ORIGIN}/../dt_runpath_a
 # |   |-> dt_runpath_a/libtest_dt_runpath_a.so
 # |-> dt_runpath_b_c_x/libtest_dt_runpath_c.so  runpath: ${ORIGIN}/invalid_dt_runpath
 # |   |-> libtest_dt_runpath_a.so (soname)
+# |-> dt_runpath_y/lib[64]/libtest_dt_runpath_y.so
 #
 # This one is used to test dlopen
 # dt_runpath_b_c_x/libtest_dt_runpath_x.so
@@ -61,12 +62,18 @@
 module := libtest_dt_runpath_c
 include $(LOCAL_PATH)/Android.build.testlib.mk
 
-# D depends on B and C with DT_RUNPATH.
+# D depends on B, C, and Y with DT_RUNPATH.
 libtest_dt_runpath_d_src_files := \
     dlopen_b.cpp
 
-libtest_dt_runpath_d_shared_libraries := libtest_dt_runpath_b libtest_dt_runpath_c
-libtest_dt_runpath_d_ldflags := -Wl,--rpath,\$${ORIGIN}/dt_runpath_b_c_x -Wl,--enable-new-dtags
+libtest_dt_runpath_d_shared_libraries := \
+    libtest_dt_runpath_b \
+    libtest_dt_runpath_c \
+    libtest_dt_runpath_y
+libtest_dt_runpath_d_ldflags := \
+    -Wl,--rpath,\$${ORIGIN}/dt_runpath_b_c_x \
+    -Wl,--rpath,\$${ORIGIN}/dt_runpath_y/\$${LIB} \
+    -Wl,--enable-new-dtags
 libtest_dt_runpath_d_ldlibs := -ldl
 module := libtest_dt_runpath_d
 include $(LOCAL_PATH)/Android.build.testlib.mk
@@ -77,8 +84,14 @@
 libtest_dt_runpath_d_zip_src_files := \
     dlopen_b.cpp
 
-libtest_dt_runpath_d_zip_shared_libraries := libtest_dt_runpath_b libtest_dt_runpath_c
-libtest_dt_runpath_d_zip_ldflags := -Wl,--rpath,\$${ORIGIN}/dt_runpath_b_c_x -Wl,--enable-new-dtags
+libtest_dt_runpath_d_zip_shared_libraries := \
+    libtest_dt_runpath_b \
+    libtest_dt_runpath_c \
+    libtest_dt_runpath_y
+libtest_dt_runpath_d_zip_ldflags := \
+    -Wl,--rpath,\$${ORIGIN}/dt_runpath_b_c_x \
+    -Wl,--rpath,\$${ORIGIN}/dt_runpath_y/\$${LIB} \
+    -Wl,--enable-new-dtags
 libtest_dt_runpath_d_zip_ldlibs := -ldl
 libtest_dt_runpath_d_zip_install_to_native_tests_dir := $(module)
 
@@ -96,3 +109,20 @@
 module := libtest_dt_runpath_x
 include $(LOCAL_PATH)/Android.build.testlib.mk
 
+# A leaf library in lib or lib64 directory
+libtest_dt_runpath_y_src_files := \
+    empty.cpp
+
+ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
+libtest_dt_runpath_y_install_to_native_tests_dir_32 := bionic-loader-test-libs/dt_runpath_y/lib/$(TARGET_2ND_ARCH)
+else
+libtest_dt_runpath_y_install_to_native_tests_dir_32 := bionic-loader-test-libs/dt_runpath_y/lib
+endif
+ifeq ($(TARGET_IS_64_BIT),true)
+libtest_dt_runpath_y_install_to_native_tests_dir_64 := bionic-loader-test-libs/dt_runpath_y/lib64
+else
+libtest_dt_runpath_y_install_to_native_tests_dir_64 := bionic-loader-test-libs/dt_runpath_y/lib
+endif
+
+module := libtest_dt_runpath_y
+include $(LOCAL_PATH)/Android.build.testlib.mk
diff --git a/tests/libs/Android.mk b/tests/libs/Android.mk
index 5bd028d..c40277d 100644
--- a/tests/libs/Android.mk
+++ b/tests/libs/Android.mk
@@ -49,6 +49,21 @@
 include $(LOCAL_PATH)/Android.build.testlib.mk
 
 # -----------------------------------------------------------------------------
+# Library used by dlext tests - recursive use of RELRO sharing
+# -----------------------------------------------------------------------------
+libdlext_test_recursive_src_files := \
+    dlext_test_recursive_library.cpp \
+
+libdlext_test_recursive_ldflags := \
+    -Wl,-z,relro \
+
+libdlext_test_recursive_shared_libraries := libdlext_test
+
+module := libdlext_test_recursive
+module_tag := optional
+include $(LOCAL_PATH)/Android.build.testlib.mk
+
+# -----------------------------------------------------------------------------
 # Library used by dlext tests - different name non-default location
 # -----------------------------------------------------------------------------
 module := libdlext_test_fd
diff --git a/tests/libs/dlext_test_recursive_library.cpp b/tests/libs/dlext_test_recursive_library.cpp
new file mode 100644
index 0000000..b37bd70
--- /dev/null
+++ b/tests/libs/dlext_test_recursive_library.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+extern "C" int getRandomNumber();
+
+class B {
+public:
+  virtual int getBiggerRandomNumber() {
+    // Call to the other library.
+    return getRandomNumber() * 2;
+  }
+
+  virtual ~B() {}
+};
+
+B b;
+
+// nested macros to make it easy to define a large amount of read-only data
+// which will require relocation.
+#define B_16 &b, &b, &b, &b, &b, &b, &b, &b, &b, &b, &b, &b, &b, &b, &b, &b,
+#define B_128 B_16 B_16 B_16 B_16 B_16 B_16 B_16 B_16
+#define B_1024 B_128 B_128 B_128 B_128 B_128 B_128 B_128 B_128
+
+extern "C" B* const lots_more_relro[] = {
+  B_1024 B_1024 B_1024 B_1024 B_1024 B_1024 B_1024 B_1024
+};
+
+extern "C" int getBiggerRandomNumber() {
+  // access the relro section (twice, in fact, once for the pointer, and once
+  // for the vtable of B) to check it's actually there.
+  return lots_more_relro[0]->getBiggerRandomNumber();
+}
diff --git a/tests/libs/elf_tls_test_library.cpp b/tests/libs/elf_tls_test_library.cpp
deleted file mode 100644
index 56d0171..0000000
--- a/tests/libs/elf_tls_test_library.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-thread_local int elf_tls_variable;
-
-extern "C" int* get() { return &elf_tls_variable; }
diff --git a/tests/libs/elftls_dlopen_ie_error_helper.cpp b/tests/libs/elftls_dlopen_ie_error_helper.cpp
new file mode 100644
index 0000000..5902e07
--- /dev/null
+++ b/tests/libs/elftls_dlopen_ie_error_helper.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2019 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 <dlfcn.h>
+#include <stdio.h>
+
+// This helper executable attempts to load libtest_elftls_shared_var_ie.so,
+// then reports success or failure. With Bionic, it is expected to fail, because
+// libtest_elftls_shared_var_ie.so tries to access a dynamically-allocated TLS
+// variable using the IE access model intended for static TLS.
+
+int main() {
+  void* lib = dlopen("libtest_elftls_shared_var_ie.so", RTLD_LOCAL | RTLD_NOW);
+  if (lib) {
+    printf("success\n");
+  } else {
+    printf("dlerror: %s\n", dlerror());
+  }
+  return 0;
+}
diff --git a/tests/libs/elftls_dynamic.cpp b/tests/libs/elftls_dynamic.cpp
new file mode 100644
index 0000000..6da2f6f
--- /dev/null
+++ b/tests/libs/elftls_dynamic.cpp
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+// This shared object test library is dlopen'ed by the main test executable.
+
+// Export a large TLS variable from a solib for testing dladdr and dlsym. The
+// TLS symbol's value will appear to overlap almost everything else in the
+// shared object, but dladdr must not return it.
+__thread char large_tls_var[4 * 1024 * 1024];
+
+extern "C" char* get_large_tls_var_addr() {
+  return large_tls_var;
+}
+
+// For testing dladdr, return an address that's part of the solib's .bss
+// section, but does not have an entry in the dynsym table and whose
+// solib-relative address appears to overlap with the large TLS variable.
+extern "C" void* get_local_addr() {
+  static char dummy[1024];
+  return &dummy[512];
+}
+
+// This variable comes from libtest_elftls_shared_var.so, which is part of
+// static TLS. Verify that a GD-model access can access the variable.
+//
+// Accessing the static TLS variable from an solib prevents the static linker
+// from relaxing the GD access to IE and lets us test that __tls_get_addr and
+// the tlsdesc resolver handle a static TLS variable.
+extern "C" __thread int elftls_shared_var;
+
+extern "C" int bump_shared_var() {
+  return ++elftls_shared_var;
+}
+
+// The static linker denotes the current module by omitting the symbol from
+// the DTPMOD/TLSDESC relocations.
+static __thread int local_var_1 = 15;
+static __thread int local_var_2 = 25;
+
+extern "C" int bump_local_vars() {
+  return ++local_var_1 + ++local_var_2;
+}
+
+__attribute__((weak)) extern "C" __thread int missing_weak_dyn_tls;
+
+extern "C" int* missing_weak_dyn_tls_addr() {
+  return &missing_weak_dyn_tls;
+}
diff --git a/tests/libs/elftls_dynamic_filler.cpp b/tests/libs/elftls_dynamic_filler.cpp
new file mode 100644
index 0000000..9c00ab0
--- /dev/null
+++ b/tests/libs/elftls_dynamic_filler.cpp
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+__thread int var = TLS_FILLER;
+
+extern "C" int bump() {
+  return ++var;
+}
diff --git a/tests/libs/elftls_shared_var.cpp b/tests/libs/elftls_shared_var.cpp
new file mode 100644
index 0000000..27a15f0
--- /dev/null
+++ b/tests/libs/elftls_shared_var.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+// This shared object merely declares a global TLS variable without accessing
+// it.
+
+extern "C" __thread int elftls_shared_var = 20;
diff --git a/tests/libs/elftls_shared_var_ie.cpp b/tests/libs/elftls_shared_var_ie.cpp
new file mode 100644
index 0000000..14e2ab0
--- /dev/null
+++ b/tests/libs/elftls_shared_var_ie.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+// Accessing a symbol in libtest_elftls_shared_var.so using an IE access should
+// work iff the solib is part of static TLS.
+__attribute__((tls_model("initial-exec"))) extern "C" __thread int elftls_shared_var;
+
+extern "C" int bump_shared_var() {
+  return ++elftls_shared_var;
+}
diff --git a/tests/libs/elftls_tprel.cpp b/tests/libs/elftls_tprel.cpp
new file mode 100644
index 0000000..eb2fd93
--- /dev/null
+++ b/tests/libs/elftls_tprel.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+// This shared object tests TPREL relocations in the dynamic linker. It's always
+// part of static TLS.
+
+// For accesses to these variables, the bfd and lld linkers generate a TPREL
+// relocation with no symbol but a non-zero addend.
+__attribute__((tls_model("initial-exec"))) static __thread int tls_var_1 = 3;
+__attribute__((tls_model("initial-exec"))) static __thread int tls_var_2 = 7;
+
+extern "C" int bump_static_tls_var_1() {
+  return ++tls_var_1;
+}
+
+extern "C" int bump_static_tls_var_2() {
+  return ++tls_var_2;
+}
+
+__attribute__((tls_model("initial-exec"), weak)) extern "C" __thread int missing_weak_tls;
+
+extern "C" int* missing_weak_tls_addr() {
+  // The dynamic linker should resolve a TPREL relocation to this symbol to 0,
+  // which this function adds to the thread pointer.
+  return &missing_weak_tls;
+}
diff --git a/tests/libs/segment_gap_inner.cpp b/tests/libs/segment_gap_inner.cpp
new file mode 100644
index 0000000..f23b065
--- /dev/null
+++ b/tests/libs/segment_gap_inner.cpp
@@ -0,0 +1 @@
+extern "C" void inner() {}
diff --git a/tests/libs/segment_gap_outer.cpp b/tests/libs/segment_gap_outer.cpp
new file mode 100644
index 0000000..fb448e7
--- /dev/null
+++ b/tests/libs/segment_gap_outer.cpp
@@ -0,0 +1,25 @@
+#include <android/dlext.h>
+#include <dlfcn.h>
+#include <jni.h>
+#include <stdlib.h>
+
+extern "C" void text_before_start_of_gap() {}
+char end_of_gap[0x1000];
+
+extern "C" void* get_inner() {
+  android_dlextinfo info = {};
+  info.flags = ANDROID_DLEXT_RESERVED_ADDRESS;
+
+  char* start_of_gap =
+      reinterpret_cast<char*>(reinterpret_cast<uintptr_t>(text_before_start_of_gap) & ~0xfffull) +
+      0x1000;
+  info.reserved_addr = start_of_gap;
+  info.reserved_size = end_of_gap - start_of_gap;
+
+  void *handle = android_dlopen_ext("libsegment_gap_inner.so", RTLD_NOW, &info);
+  if (!handle) {
+    __builtin_trap();
+  }
+
+  return dlsym(handle, "inner");
+}
diff --git a/tests/libs/segment_gap_outer.lds b/tests/libs/segment_gap_outer.lds
new file mode 100644
index 0000000..f326aab
--- /dev/null
+++ b/tests/libs/segment_gap_outer.lds
@@ -0,0 +1,27 @@
+SECTIONS {
+  # This starts off fairly normal: rodata, text, data, relro, bss with
+  # appropriate alignment between them.
+  . = SIZEOF_HEADERS;
+  .rodata : {}
+  . = ALIGN(0x1000);
+  .text : {}
+  . = ALIGN(0x1000);
+  .data : {}
+  . = ALIGN(0x1000);
+  .data.rel.ro : {}
+  . = ALIGN(0x1000);
+  .bss : {}
+
+  # Now create the gap. We need a text segment first to prevent the linker from
+  # merging .bss with .bss.end_of_gap.
+  . = ALIGN(0x1000);
+  .text.text_before_start_of_gap : {
+    *(.text.text_before_start_of_gap);
+  }
+
+  # Place end_of_gap at the end of the gap.
+  . = 0x1000000;
+  .bss.end_of_gap : {
+    *(.bss.end_of_gap);
+  }
+}
diff --git a/tests/libs/thread_local_dtor.cpp b/tests/libs/thread_local_dtor.cpp
index cefff7a..90fd418 100644
--- a/tests/libs/thread_local_dtor.cpp
+++ b/tests/libs/thread_local_dtor.cpp
@@ -30,7 +30,7 @@
 
 class TestClass {
  public:
-  TestClass(bool* flag) : flag_(flag) {}
+  explicit TestClass(bool* flag) : flag_(flag) {}
   ~TestClass() {
     *flag_ = true;
   }
diff --git a/tests/libs/thread_local_dtor2.cpp b/tests/libs/thread_local_dtor2.cpp
index 9b2b164..177c91b 100644
--- a/tests/libs/thread_local_dtor2.cpp
+++ b/tests/libs/thread_local_dtor2.cpp
@@ -30,7 +30,7 @@
 
 class TestClass {
  public:
-  TestClass(bool* flag) : flag_(flag) {}
+  explicit TestClass(bool* flag) : flag_(flag) {}
   ~TestClass() {
     *flag_ = true;
   }
diff --git a/tests/link_test.cpp b/tests/link_test.cpp
index 1bdee9f..cf5fc0b 100644
--- a/tests/link_test.cpp
+++ b/tests/link_test.cpp
@@ -231,6 +231,6 @@
   }
   ASSERT_TRUE(found);
 #else
-  GTEST_LOG_(INFO) << "dl_unwind_find_exidx is an ARM-only API\n";
+  GTEST_SKIP() << "dl_unwind_find_exidx is an ARM-only API";
 #endif
 }
diff --git a/tests/malloc_iterate_test.cpp b/tests/malloc_iterate_test.cpp
index 5e60a6d..9d4fe04 100644
--- a/tests/malloc_iterate_test.cpp
+++ b/tests/malloc_iterate_test.cpp
@@ -92,14 +92,15 @@
   test_data->total_allocated_bytes = 0;
 
   // Find all of the maps that are [anon:libc_malloc].
-  ASSERT_TRUE(android::procinfo::ReadMapFile("/proc/self/maps",
-    [&](uint64_t start, uint64_t end, uint16_t, uint64_t, const char* name) {
-    if (std::string(name) == "[anon:libc_malloc]") {
-      malloc_disable();
-      malloc_iterate(start, end - start, SavePointers, test_data);
-      malloc_enable();
-    }
-  }));
+  ASSERT_TRUE(android::procinfo::ReadMapFile(
+      "/proc/self/maps",
+      [&](uint64_t start, uint64_t end, uint16_t, uint64_t, ino_t, const char* name) {
+        if (std::string(name) == "[anon:libc_malloc]") {
+          malloc_disable();
+          malloc_iterate(start, end - start, SavePointers, test_data);
+          malloc_enable();
+        }
+      }));
 
   for (size_t i = 0; i < test_data->allocs.size(); i++) {
     EXPECT_EQ(1UL, test_data->allocs[i].count) << "Failed on size " << test_data->allocs[i].size;
@@ -149,7 +150,7 @@
 
   FreePtrs(&test_data);
 #else
-  GTEST_LOG_(INFO) << "Skipping, this is a bionic only test.";
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -168,7 +169,7 @@
 
   FreePtrs(&test_data);
 #else
-  GTEST_LOG_(INFO) << "Skipping, this is a bionic only test.";
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -180,18 +181,19 @@
   TestDataType test_data = {};
 
   // Find all of the maps that are not [anon:libc_malloc].
-  ASSERT_TRUE(android::procinfo::ReadMapFile("/proc/self/maps",
-    [&](uint64_t start, uint64_t end, uint16_t, uint64_t, const char* name) {
-    if (std::string(name) != "[anon:libc_malloc]") {
-      malloc_disable();
-      malloc_iterate(start, end - start, SavePointers, &test_data);
-      malloc_enable();
-    }
-  }));
+  ASSERT_TRUE(android::procinfo::ReadMapFile(
+      "/proc/self/maps",
+      [&](uint64_t start, uint64_t end, uint16_t, uint64_t, ino_t, const char* name) {
+        if (std::string(name) != "[anon:libc_malloc]") {
+          malloc_disable();
+          malloc_iterate(start, end - start, SavePointers, &test_data);
+          malloc_enable();
+        }
+      }));
 
   ASSERT_EQ(0UL, test_data.total_allocated_bytes);
 #else
-  GTEST_LOG_(INFO) << "Skipping, this is a bionic only test.";
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -220,6 +222,6 @@
   ASSERT_NE(-1, wait_pid) << "Unknown failure in waitpid.";
   ASSERT_EQ(0, wait_pid) << "malloc_disable did not prevent allocation calls.";
 #else
-  GTEST_LOG_(INFO) << "Skipping, this is a bionic only test.";
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp
index 4a01278..706de15 100644
--- a/tests/malloc_test.cpp
+++ b/tests/malloc_test.cpp
@@ -16,15 +16,25 @@
 
 #include <gtest/gtest.h>
 
+#include <elf.h>
 #include <limits.h>
+#include <pthread.h>
 #include <stdint.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/wait.h>
 #include <malloc.h>
 #include <unistd.h>
 
+#include <atomic>
 #include <tinyxml2.h>
 
+#include <android-base/file.h>
+
 #include "private/bionic_config.h"
+#include "private/bionic_malloc.h"
 #include "utils.h"
 
 #if defined(__BIONIC__)
@@ -84,7 +94,7 @@
 }
 
 TEST(malloc, memalign_multiple) {
-  SKIP_WITH_HWASAN; // hwasan requires power of 2 alignment.
+  SKIP_WITH_HWASAN << "hwasan requires power of 2 alignment";
   // Memalign test where the alignment is any value.
   for (size_t i = 0; i <= 12; i++) {
     for (size_t alignment = 1 << i; alignment < (1U << (i+1)); alignment++) {
@@ -331,6 +341,7 @@
 
 TEST(malloc, malloc_info) {
 #ifdef __BIONIC__
+  SKIP_WITH_HWASAN; // hwasan does not implement malloc_info
   char* buf;
   size_t bufsize;
   FILE* memstream = open_memstream(&buf, &bufsize);
@@ -344,35 +355,42 @@
   auto root = doc.FirstChildElement();
   ASSERT_NE(nullptr, root);
   ASSERT_STREQ("malloc", root->Name());
-  ASSERT_STREQ("jemalloc-1", root->Attribute("version"));
+  if (std::string(root->Attribute("version")) == "jemalloc-1") {
+    // Verify jemalloc version of this data.
+    ASSERT_STREQ("jemalloc-1", root->Attribute("version"));
 
-  auto arena = root->FirstChildElement();
-  for (; arena != nullptr; arena = arena->NextSiblingElement()) {
-    int val;
+    auto arena = root->FirstChildElement();
+    for (; arena != nullptr; arena = arena->NextSiblingElement()) {
+      int val;
 
-    ASSERT_STREQ("heap", arena->Name());
-    ASSERT_EQ(tinyxml2::XML_SUCCESS, arena->QueryIntAttribute("nr", &val));
-    ASSERT_EQ(tinyxml2::XML_SUCCESS,
-              arena->FirstChildElement("allocated-large")->QueryIntText(&val));
-    ASSERT_EQ(tinyxml2::XML_SUCCESS,
-              arena->FirstChildElement("allocated-huge")->QueryIntText(&val));
-    ASSERT_EQ(tinyxml2::XML_SUCCESS,
-              arena->FirstChildElement("allocated-bins")->QueryIntText(&val));
-    ASSERT_EQ(tinyxml2::XML_SUCCESS,
-              arena->FirstChildElement("bins-total")->QueryIntText(&val));
+      ASSERT_STREQ("heap", arena->Name());
+      ASSERT_EQ(tinyxml2::XML_SUCCESS, arena->QueryIntAttribute("nr", &val));
+      ASSERT_EQ(tinyxml2::XML_SUCCESS,
+                arena->FirstChildElement("allocated-large")->QueryIntText(&val));
+      ASSERT_EQ(tinyxml2::XML_SUCCESS,
+                arena->FirstChildElement("allocated-huge")->QueryIntText(&val));
+      ASSERT_EQ(tinyxml2::XML_SUCCESS,
+                arena->FirstChildElement("allocated-bins")->QueryIntText(&val));
+      ASSERT_EQ(tinyxml2::XML_SUCCESS,
+                arena->FirstChildElement("bins-total")->QueryIntText(&val));
 
-    auto bin = arena->FirstChildElement("bin");
-    for (; bin != nullptr; bin = bin ->NextSiblingElement()) {
-      if (strcmp(bin->Name(), "bin") == 0) {
-        ASSERT_EQ(tinyxml2::XML_SUCCESS, bin->QueryIntAttribute("nr", &val));
-        ASSERT_EQ(tinyxml2::XML_SUCCESS,
-                  bin->FirstChildElement("allocated")->QueryIntText(&val));
-        ASSERT_EQ(tinyxml2::XML_SUCCESS,
-                  bin->FirstChildElement("nmalloc")->QueryIntText(&val));
-        ASSERT_EQ(tinyxml2::XML_SUCCESS,
-                  bin->FirstChildElement("ndalloc")->QueryIntText(&val));
+      auto bin = arena->FirstChildElement("bin");
+      for (; bin != nullptr; bin = bin ->NextSiblingElement()) {
+        if (strcmp(bin->Name(), "bin") == 0) {
+          ASSERT_EQ(tinyxml2::XML_SUCCESS, bin->QueryIntAttribute("nr", &val));
+          ASSERT_EQ(tinyxml2::XML_SUCCESS,
+                    bin->FirstChildElement("allocated")->QueryIntText(&val));
+          ASSERT_EQ(tinyxml2::XML_SUCCESS,
+                    bin->FirstChildElement("nmalloc")->QueryIntText(&val));
+          ASSERT_EQ(tinyxml2::XML_SUCCESS,
+                    bin->FirstChildElement("ndalloc")->QueryIntText(&val));
+        }
       }
     }
+  } else {
+    // Only verify that this is debug-malloc-1, the malloc debug unit tests
+    // verify the output.
+    ASSERT_STREQ("debug-malloc-1", root->Attribute("version"));
   }
 #endif
 }
@@ -514,22 +532,24 @@
 
 TEST(malloc, mallopt_decay) {
 #if defined(__BIONIC__)
+  SKIP_WITH_HWASAN << "hwasan does not implement mallopt";
   errno = 0;
   ASSERT_EQ(1, mallopt(M_DECAY_TIME, 1));
   ASSERT_EQ(1, mallopt(M_DECAY_TIME, 0));
   ASSERT_EQ(1, mallopt(M_DECAY_TIME, 1));
   ASSERT_EQ(1, mallopt(M_DECAY_TIME, 0));
 #else
-  GTEST_LOG_(INFO) << "This tests a bionic implementation detail.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
 TEST(malloc, mallopt_purge) {
 #if defined(__BIONIC__)
+  SKIP_WITH_HWASAN << "hwasan does not implement mallopt";
   errno = 0;
   ASSERT_EQ(1, mallopt(M_PURGE, 0));
 #else
-  GTEST_LOG_(INFO) << "This tests a bionic implementation detail.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -547,7 +567,7 @@
   ASSERT_TRUE(reallocarray(nullptr, b, a) == nullptr);
   ASSERT_EQ(ENOMEM, errno);
 #else
-  GTEST_LOG_(INFO) << "This test requires a C library with reallocarray.\n";
+  GTEST_SKIP() << "reallocarray not available";
 #endif
 }
 
@@ -557,12 +577,13 @@
   ASSERT_TRUE(p != nullptr);
   ASSERT_GE(malloc_usable_size(p), 64U);
 #else
-  GTEST_LOG_(INFO) << "This test requires a C library with reallocarray.\n";
+  GTEST_SKIP() << "reallocarray not available";
 #endif
 }
 
 TEST(malloc, mallinfo) {
 #if defined(__BIONIC__)
+  SKIP_WITH_HWASAN << "hwasan does not implement mallinfo";
   static size_t sizes[] = {
     8, 32, 128, 4096, 32768, 131072, 1024000, 10240000, 20480000, 300000000
   };
@@ -584,10 +605,13 @@
       size_t new_allocated = mallinfo().uordblks;
       if (allocated != new_allocated) {
         size_t usable_size = malloc_usable_size(ptrs[i]);
-        ASSERT_GE(new_allocated, allocated + usable_size)
-            << "Failed at size " << size << " usable size " << usable_size;
-        pass = true;
-        break;
+        // Only check if the total got bigger by at least allocation size.
+        // Sometimes the mallinfo numbers can go backwards due to compaction
+        // and/or freeing of cached data.
+        if (new_allocated >= allocated + usable_size) {
+          pass = true;
+          break;
+        }
       }
     }
     for (void* ptr : ptrs) {
@@ -598,6 +622,299 @@
         << kMaxAllocs << " allocations.";
   }
 #else
-  GTEST_LOG_(INFO) << "Host glibc does not pass this test, skipping.\n";
+  GTEST_SKIP() << "glibc is broken";
+#endif
+}
+
+TEST(android_mallopt, error_on_unexpected_option) {
+#if defined(__BIONIC__)
+  const int unrecognized_option = -1;
+  errno = 0;
+  EXPECT_EQ(false, android_mallopt(unrecognized_option, nullptr, 0));
+  EXPECT_EQ(ENOTSUP, errno);
+#else
+  GTEST_SKIP() << "bionic-only test";
+#endif
+}
+
+bool IsDynamic() {
+#if defined(__LP64__)
+  Elf64_Ehdr ehdr;
+#else
+  Elf32_Ehdr ehdr;
+#endif
+  std::string path(android::base::GetExecutablePath());
+
+  int fd = open(path.c_str(), O_RDONLY | O_CLOEXEC);
+  if (fd == -1) {
+    // Assume dynamic on error.
+    return true;
+  }
+  bool read_completed = android::base::ReadFully(fd, &ehdr, sizeof(ehdr));
+  close(fd);
+  // Assume dynamic in error cases.
+  return !read_completed || ehdr.e_type == ET_DYN;
+}
+
+TEST(android_mallopt, init_zygote_child_profiling) {
+#if defined(__BIONIC__)
+  // Successful call.
+  errno = 0;
+  if (IsDynamic()) {
+    EXPECT_EQ(true, android_mallopt(M_INIT_ZYGOTE_CHILD_PROFILING, nullptr, 0));
+    EXPECT_EQ(0, errno);
+  } else {
+    // Not supported in static executables.
+    EXPECT_EQ(false, android_mallopt(M_INIT_ZYGOTE_CHILD_PROFILING, nullptr, 0));
+    EXPECT_EQ(ENOTSUP, errno);
+  }
+
+  // Unexpected arguments rejected.
+  errno = 0;
+  char unexpected = 0;
+  EXPECT_EQ(false, android_mallopt(M_INIT_ZYGOTE_CHILD_PROFILING, &unexpected, 1));
+  if (IsDynamic()) {
+    EXPECT_EQ(EINVAL, errno);
+  } else {
+    EXPECT_EQ(ENOTSUP, errno);
+  }
+#else
+  GTEST_SKIP() << "bionic-only test";
+#endif
+}
+
+#if defined(__BIONIC__)
+template <typename FuncType>
+void CheckAllocationFunction(FuncType func) {
+  // Assumes that no more than 108MB of memory is allocated before this.
+  size_t limit = 128 * 1024 * 1024;
+  ASSERT_TRUE(android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES, &limit, sizeof(limit)));
+  if (!func(20 * 1024 * 1024))
+    exit(1);
+  if (func(128 * 1024 * 1024))
+    exit(1);
+  exit(0);
+}
+#endif
+
+TEST(android_mallopt, set_allocation_limit) {
+#if defined(__BIONIC__)
+  EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return calloc(bytes, 1) != nullptr; }),
+              testing::ExitedWithCode(0), "");
+  EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return calloc(1, bytes) != nullptr; }),
+              testing::ExitedWithCode(0), "");
+  EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return malloc(bytes) != nullptr; }),
+              testing::ExitedWithCode(0), "");
+  EXPECT_EXIT(CheckAllocationFunction(
+                  [](size_t bytes) { return memalign(sizeof(void*), bytes) != nullptr; }),
+              testing::ExitedWithCode(0), "");
+  EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) {
+                void* ptr;
+                return posix_memalign(&ptr, sizeof(void *), bytes) == 0;
+              }),
+              testing::ExitedWithCode(0), "");
+  EXPECT_EXIT(CheckAllocationFunction(
+                  [](size_t bytes) { return aligned_alloc(sizeof(void*), bytes) != nullptr; }),
+              testing::ExitedWithCode(0), "");
+  EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) {
+                void* p = malloc(1024 * 1024);
+                return realloc(p, bytes) != nullptr;
+              }),
+              testing::ExitedWithCode(0), "");
+#if !defined(__LP64__)
+  EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return pvalloc(bytes) != nullptr; }),
+              testing::ExitedWithCode(0), "");
+  EXPECT_EXIT(CheckAllocationFunction([](size_t bytes) { return valloc(bytes) != nullptr; }),
+              testing::ExitedWithCode(0), "");
+#endif
+#else
+  GTEST_SKIP() << "bionic extension";
+#endif
+}
+
+TEST(android_mallopt, set_allocation_limit_multiple) {
+#if defined(__BIONIC__)
+  // Only the first set should work.
+  size_t limit = 256 * 1024 * 1024;
+  ASSERT_TRUE(android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES, &limit, sizeof(limit)));
+  limit = 32 * 1024 * 1024;
+  ASSERT_FALSE(android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES, &limit, sizeof(limit)));
+#else
+  GTEST_SKIP() << "bionic extension";
+#endif
+}
+
+#if defined(__BIONIC__)
+static constexpr size_t kAllocationSize = 8 * 1024 * 1024;
+
+static size_t GetMaxAllocations() {
+  size_t max_pointers = 0;
+  void* ptrs[20];
+  for (size_t i = 0; i < sizeof(ptrs) / sizeof(void*); i++) {
+    ptrs[i] = malloc(kAllocationSize);
+    if (ptrs[i] == nullptr) {
+      max_pointers = i;
+      break;
+    }
+  }
+  for (size_t i = 0; i < max_pointers; i++) {
+    free(ptrs[i]);
+  }
+  return max_pointers;
+}
+
+static void VerifyMaxPointers(size_t max_pointers) {
+  // Now verify that we can allocate the same number as before.
+  void* ptrs[20];
+  for (size_t i = 0; i < max_pointers; i++) {
+    ptrs[i] = malloc(kAllocationSize);
+    ASSERT_TRUE(ptrs[i] != nullptr) << "Failed to allocate on iteration " << i;
+  }
+
+  // Make sure the next allocation still fails.
+  ASSERT_TRUE(malloc(kAllocationSize) == nullptr);
+  for (size_t i = 0; i < max_pointers; i++) {
+    free(ptrs[i]);
+  }
+}
+#endif
+
+TEST(android_mallopt, set_allocation_limit_realloc_increase) {
+#if defined(__BIONIC__)
+  size_t limit = 128 * 1024 * 1024;
+  ASSERT_TRUE(android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES, &limit, sizeof(limit)));
+
+  size_t max_pointers = GetMaxAllocations();
+  ASSERT_TRUE(max_pointers != 0) << "Limit never reached.";
+
+  void* memory = malloc(10 * 1024 * 1024);
+  ASSERT_TRUE(memory != nullptr);
+
+  // Increase size.
+  memory = realloc(memory, 20 * 1024 * 1024);
+  ASSERT_TRUE(memory != nullptr);
+  memory = realloc(memory, 40 * 1024 * 1024);
+  ASSERT_TRUE(memory != nullptr);
+  memory = realloc(memory, 60 * 1024 * 1024);
+  ASSERT_TRUE(memory != nullptr);
+  memory = realloc(memory, 80 * 1024 * 1024);
+  ASSERT_TRUE(memory != nullptr);
+  // Now push past limit.
+  memory = realloc(memory, 130 * 1024 * 1024);
+  ASSERT_TRUE(memory == nullptr);
+
+  VerifyMaxPointers(max_pointers);
+#else
+  GTEST_SKIP() << "bionic extension";
+#endif
+}
+
+TEST(android_mallopt, set_allocation_limit_realloc_decrease) {
+#if defined(__BIONIC__)
+  size_t limit = 100 * 1024 * 1024;
+  ASSERT_TRUE(android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES, &limit, sizeof(limit)));
+
+  size_t max_pointers = GetMaxAllocations();
+  ASSERT_TRUE(max_pointers != 0) << "Limit never reached.";
+
+  void* memory = malloc(80 * 1024 * 1024);
+  ASSERT_TRUE(memory != nullptr);
+
+  // Decrease size.
+  memory = realloc(memory, 60 * 1024 * 1024);
+  ASSERT_TRUE(memory != nullptr);
+  memory = realloc(memory, 40 * 1024 * 1024);
+  ASSERT_TRUE(memory != nullptr);
+  memory = realloc(memory, 20 * 1024 * 1024);
+  ASSERT_TRUE(memory != nullptr);
+  memory = realloc(memory, 10 * 1024 * 1024);
+  ASSERT_TRUE(memory != nullptr);
+  free(memory);
+
+  VerifyMaxPointers(max_pointers);
+#else
+  GTEST_SKIP() << "bionic extension";
+#endif
+}
+
+TEST(android_mallopt, set_allocation_limit_realloc_free) {
+#if defined(__BIONIC__)
+  size_t limit = 100 * 1024 * 1024;
+  ASSERT_TRUE(android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES, &limit, sizeof(limit)));
+
+  size_t max_pointers = GetMaxAllocations();
+  ASSERT_TRUE(max_pointers != 0) << "Limit never reached.";
+
+  void* memory = malloc(60 * 1024 * 1024);
+  ASSERT_TRUE(memory != nullptr);
+
+  memory = realloc(memory, 0);
+  ASSERT_TRUE(memory == nullptr);
+
+  VerifyMaxPointers(max_pointers);
+#else
+  GTEST_SKIP() << "bionic extension";
+#endif
+}
+
+#if defined(__BIONIC__)
+static void* SetAllocationLimit(void* data) {
+  std::atomic_bool* go = reinterpret_cast<std::atomic_bool*>(data);
+  while (!go->load()) {
+  }
+  size_t limit = 500 * 1024 * 1024;
+  if (android_mallopt(M_SET_ALLOCATION_LIMIT_BYTES, &limit, sizeof(limit))) {
+    return reinterpret_cast<void*>(-1);
+  }
+  return nullptr;
+}
+
+static void SetAllocationLimitMultipleThreads() {
+  std::atomic_bool go;
+  go = false;
+
+  static constexpr size_t kNumThreads = 4;
+  pthread_t threads[kNumThreads];
+  for (size_t i = 0; i < kNumThreads; i++) {
+    ASSERT_EQ(0, pthread_create(&threads[i], nullptr, SetAllocationLimit, &go));
+  }
+
+  // Let them go all at once.
+  go = true;
+  ASSERT_EQ(0, kill(getpid(), __SIGRTMIN + 4));
+
+  size_t num_successful = 0;
+  for (size_t i = 0; i < kNumThreads; i++) {
+    void* result;
+    ASSERT_EQ(0, pthread_join(threads[i], &result));
+    if (result != nullptr) {
+      num_successful++;
+    }
+  }
+  ASSERT_EQ(1U, num_successful);
+  exit(0);
+}
+#endif
+
+TEST(android_mallopt, set_allocation_limit_multiple_threads) {
+#if defined(__BIONIC__)
+  if (IsDynamic()) {
+    ASSERT_TRUE(android_mallopt(M_INIT_ZYGOTE_CHILD_PROFILING, nullptr, 0));
+  }
+
+  // Run this a number of times as a stress test.
+  for (size_t i = 0; i < 100; i++) {
+    // Not using ASSERT_EXIT because errors messages are not displayed.
+    pid_t pid;
+    if ((pid = fork()) == 0) {
+      ASSERT_NO_FATAL_FAILURE(SetAllocationLimitMultipleThreads());
+    }
+    ASSERT_NE(-1, pid);
+    int status;
+    ASSERT_EQ(pid, wait(&status));
+    ASSERT_EQ(0, WEXITSTATUS(status));
+  }
+#else
+  GTEST_SKIP() << "bionic extension";
 #endif
 }
diff --git a/tests/math_test.cpp b/tests/math_test.cpp
index f816fad..1dd45b4 100644
--- a/tests/math_test.cpp
+++ b/tests/math_test.cpp
@@ -388,7 +388,7 @@
   ASSERT_TRUE(__isnormal(123.0));
   ASSERT_FALSE(__isnormal(double_subnormal()));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "glibc doesn't have __isnormal.\n";
+  GTEST_SKIP() << "glibc doesn't have __isnormal";
 #endif // __BIONIC__
 }
 
@@ -397,7 +397,7 @@
   ASSERT_TRUE(__isnormalf(123.0f));
   ASSERT_FALSE(__isnormalf(float_subnormal()));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "glibc doesn't have __isnormalf.\n";
+  GTEST_SKIP() << "glibc doesn't have __isnormalf";
 #endif // __BIONIC__
 }
 
@@ -406,7 +406,7 @@
   ASSERT_TRUE(isnormalf(123.0f));
   ASSERT_FALSE(isnormalf(float_subnormal()));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "glibc doesn't have isnormalf.\n";
+  GTEST_SKIP() << "glibc doesn't have isnormalf";
 #endif // __BIONIC__
 }
 
@@ -415,7 +415,7 @@
   ASSERT_TRUE(__isnormall(123.0L));
   ASSERT_FALSE(__isnormall(ldouble_subnormal()));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "glibc doesn't have __isnormall.\n";
+  GTEST_SKIP() << "glibc doesn't have __isnormall";
 #endif // __BIONIC__
 }
 
@@ -424,7 +424,7 @@
   ASSERT_TRUE(isnormall(123.0L));
   ASSERT_FALSE(isnormall(ldouble_subnormal()));
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "glibc doesn't have isnormall.\n";
+  GTEST_SKIP() << "glibc doesn't have isnormall";
 #endif // __BIONIC__
 }
 
@@ -1396,7 +1396,7 @@
   ASSERT_DOUBLE_EQ(log(24.0), gamma_r(5.0, &sign));
   ASSERT_EQ(1, sign);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "glibc doesn't have gamma_r.\n";
+  GTEST_SKIP() << "glibc doesn't have gamma_r";
 #endif // __BIONIC__
 }
 
@@ -1406,7 +1406,7 @@
   ASSERT_FLOAT_EQ(logf(24.0f), gammaf_r(5.0f, &sign));
   ASSERT_EQ(1, sign);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "glibc doesn't have gammaf_r.\n";
+  GTEST_SKIP() << "glibc doesn't have gammaf_r";
 #endif // __BIONIC__
 }
 
diff --git a/tests/membarrier_test.cpp b/tests/membarrier_test.cpp
index 9e871c7..6f650e7 100644
--- a/tests/membarrier_test.cpp
+++ b/tests/membarrier_test.cpp
@@ -46,8 +46,7 @@
 
 TEST(membarrier, global_barrier) {
   if (!HasMembarrier(MEMBARRIER_CMD_GLOBAL)) {
-    GTEST_LOG_(INFO) << "MEMBARRIER_CMD_GLOBAL not supported, skipping test.";
-    return;
+    GTEST_SKIP() << "MEMBARRIER_CMD_GLOBAL not supported";
   }
   ASSERT_EQ(0, syscall(__NR_membarrier, MEMBARRIER_CMD_GLOBAL, 0));
 }
@@ -78,14 +77,10 @@
 static void TestRegisterAndBarrierCommands(int membarrier_cmd_register,
                                            int membarrier_cmd_barrier) {
   if (!HasMembarrier(membarrier_cmd_register)) {
-    GTEST_LOG_(INFO) << MembarrierCommandToName(membarrier_cmd_register)
-        << " not supported, skipping test.";
-    return;
+    GTEST_SKIP() << MembarrierCommandToName(membarrier_cmd_register) << " not supported";
   }
   if (!HasMembarrier(membarrier_cmd_barrier)) {
-    GTEST_LOG_(INFO) << MembarrierCommandToName(membarrier_cmd_barrier)
-        << " not supported, skipping test.";
-    return;
+    GTEST_SKIP() << MembarrierCommandToName(membarrier_cmd_barrier) << " not supported";
   }
 
   ScopedErrnoCleaner errno_cleaner;
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index 84ce531..0bf8e29 100644
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/prctl.h>
+#include <sys/resource.h>
 #include <sys/syscall.h>
 #include <time.h>
 #include <unistd.h>
@@ -189,7 +190,7 @@
   ASSERT_EQ(EINVAL, pthread_setspecific(key, nullptr));
   ASSERT_EQ(EINVAL, pthread_key_delete(key));
 #else
-  GTEST_LOG_(INFO) << "This test tests bionic pthread key implementation detail.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -336,11 +337,14 @@
   static void* thread_fn(void* arg) {
     TestBug37410* data = reinterpret_cast<TestBug37410*>(arg);
 
+    // Unlocking data->mutex will cause the main thread to exit, invalidating *data. Save the handle.
+    pthread_t main_thread = data->main_thread;
+
     // Let the main thread know we're running.
     pthread_mutex_unlock(&data->mutex);
 
     // And wait for the main thread to exit.
-    pthread_join(data->main_thread, nullptr);
+    pthread_join(main_thread, nullptr);
 
     return nullptr;
   }
@@ -494,7 +498,8 @@
   pthread_t dead_thread;
   MakeDeadThread(dead_thread);
 
-  EXPECT_DEATH(pthread_setname_np(dead_thread, "short 3"), "invalid pthread_t");
+  EXPECT_DEATH(pthread_setname_np(dead_thread, "short 3"),
+               "invalid pthread_t (.*) passed to pthread_setname_np");
 }
 
 TEST_F(pthread_DeathTest, pthread_setname_np__null_thread) {
@@ -507,7 +512,8 @@
   MakeDeadThread(dead_thread);
 
   char name[64];
-  EXPECT_DEATH(pthread_getname_np(dead_thread, name, sizeof(name)), "invalid pthread_t");
+  EXPECT_DEATH(pthread_getname_np(dead_thread, name, sizeof(name)),
+               "invalid pthread_t (.*) passed to pthread_getname_np");
 }
 
 TEST_F(pthread_DeathTest, pthread_getname_np__null_thread) {
@@ -563,7 +569,8 @@
   pthread_t dead_thread;
   MakeDeadThread(dead_thread);
 
-  EXPECT_DEATH(pthread_detach(dead_thread), "invalid pthread_t");
+  EXPECT_DEATH(pthread_detach(dead_thread),
+               "invalid pthread_t (.*) passed to pthread_detach");
 }
 
 TEST_F(pthread_DeathTest, pthread_detach__null_thread) {
@@ -590,7 +597,8 @@
   MakeDeadThread(dead_thread);
 
   clockid_t c;
-  EXPECT_DEATH(pthread_getcpuclockid(dead_thread, &c), "invalid pthread_t");
+  EXPECT_DEATH(pthread_getcpuclockid(dead_thread, &c),
+               "invalid pthread_t (.*) passed to pthread_getcpuclockid");
 }
 
 TEST_F(pthread_DeathTest, pthread_getcpuclockid__null_thread) {
@@ -605,7 +613,8 @@
 
   int policy;
   sched_param param;
-  EXPECT_DEATH(pthread_getschedparam(dead_thread, &policy, &param), "invalid pthread_t");
+  EXPECT_DEATH(pthread_getschedparam(dead_thread, &policy, &param),
+               "invalid pthread_t (.*) passed to pthread_getschedparam");
 }
 
 TEST_F(pthread_DeathTest, pthread_getschedparam__null_thread) {
@@ -621,7 +630,8 @@
 
   int policy = 0;
   sched_param param;
-  EXPECT_DEATH(pthread_setschedparam(dead_thread, policy, &param), "invalid pthread_t");
+  EXPECT_DEATH(pthread_setschedparam(dead_thread, policy, &param),
+               "invalid pthread_t (.*) passed to pthread_setschedparam");
 }
 
 TEST_F(pthread_DeathTest, pthread_setschedparam__null_thread) {
@@ -635,7 +645,8 @@
   pthread_t dead_thread;
   MakeDeadThread(dead_thread);
 
-  EXPECT_DEATH(pthread_setschedprio(dead_thread, 123), "invalid pthread_t");
+  EXPECT_DEATH(pthread_setschedprio(dead_thread, 123),
+               "invalid pthread_t (.*) passed to pthread_setschedprio");
 }
 
 TEST_F(pthread_DeathTest, pthread_setschedprio__null_thread) {
@@ -647,7 +658,8 @@
   pthread_t dead_thread;
   MakeDeadThread(dead_thread);
 
-  EXPECT_DEATH(pthread_join(dead_thread, nullptr), "invalid pthread_t");
+  EXPECT_DEATH(pthread_join(dead_thread, nullptr),
+               "invalid pthread_t (.*) passed to pthread_join");
 }
 
 TEST_F(pthread_DeathTest, pthread_join__null_thread) {
@@ -659,7 +671,8 @@
   pthread_t dead_thread;
   MakeDeadThread(dead_thread);
 
-  EXPECT_DEATH(pthread_kill(dead_thread, 0), "invalid pthread_t");
+  EXPECT_DEATH(pthread_kill(dead_thread, 0),
+               "invalid pthread_t (.*) passed to pthread_kill");
 }
 
 TEST_F(pthread_DeathTest, pthread_kill__null_thread) {
@@ -973,8 +986,7 @@
   test_pthread_rwlock_reader_wakeup_writer(
       [&](pthread_rwlock_t* lock) { return pthread_rwlock_timedwrlock_monotonic_np(lock, &ts); });
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing since pthread_rwlock_timedwrlock_monotonic_np is "
-                      "only supported on bionic";
+  GTEST_SKIP() << "pthread_rwlock_timedwrlock_monotonic_np not available";
 #endif  // __BIONIC__
 }
 
@@ -1022,8 +1034,7 @@
   test_pthread_rwlock_writer_wakeup_reader(
       [&](pthread_rwlock_t* lock) { return pthread_rwlock_timedrdlock_monotonic_np(lock, &ts); });
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing since pthread_rwlock_timedrdlock_monotonic_np is "
-                      "only supported on bionic";
+  GTEST_SKIP() << "pthread_rwlock_timedrdlock_monotonic_np not available";
 #endif  // __BIONIC__
 }
 
@@ -1083,8 +1094,7 @@
   pthread_rwlock_timedrdlock_timeout_helper(CLOCK_MONOTONIC,
                                             pthread_rwlock_timedrdlock_monotonic_np);
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing since pthread_rwlock_timedrdlock_monotonic_np is "
-                      "only supported on bionic";
+  GTEST_SKIP() << "pthread_rwlock_timedrdlock_monotonic_np not available";
 #endif  // __BIONIC__
 }
 
@@ -1120,8 +1130,7 @@
   pthread_rwlock_timedwrlock_timeout_helper(CLOCK_MONOTONIC,
                                             pthread_rwlock_timedwrlock_monotonic_np);
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing since pthread_rwlock_timedwrlock_monotonic_np is "
-                      "only supported on bionic";
+  GTEST_SKIP() << "pthread_rwlock_timedwrlock_monotonic_np not available";
 #endif  // __BIONIC__
 }
 
@@ -1351,7 +1360,7 @@
   ASSERT_EQ(0, pthread_condattr_getpshared(&attr, &pshared));
   ASSERT_EQ(PTHREAD_PROCESS_SHARED, pshared);
 #else  // !defined(__BIONIC__)
-  GTEST_LOG_(INFO) << "This tests a bionic implementation detail.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif  // !defined(__BIONIC__)
 }
 
@@ -1467,8 +1476,7 @@
   progress = SIGNALED;
   ASSERT_EQ(0, pthread_cond_signal(&cond));
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing since pthread_cond_timedwait_monotonic_np is only "
-                      "supported on bionic";
+  GTEST_SKIP() << "pthread_cond_timedwait_monotonic_np not available";
 #endif  // __BIONIC__
 }
 
@@ -1503,8 +1511,7 @@
 #if defined(__BIONIC__)
   pthread_cond_timedwait_timeout_helper(CLOCK_MONOTONIC, pthread_cond_timedwait_monotonic_np);
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing since pthread_cond_timedwait_monotonic_np is only "
-                      "supported on bionic";
+  GTEST_SKIP() << "pthread_cond_timedwait_monotonic_np not available";
 #endif  // __BIONIC__
 }
 
@@ -1540,7 +1547,7 @@
   void* maps_stack_hi = nullptr;
   std::vector<map_record> maps;
   ASSERT_TRUE(Maps::parse_maps(&maps));
-  uintptr_t stack_address = reinterpret_cast<uintptr_t>(&maps_stack_hi);
+  uintptr_t stack_address = reinterpret_cast<uintptr_t>(untag_address(&maps_stack_hi));
   for (const auto& map : maps) {
     if (map.addr_start <= stack_address && map.addr_end > stack_address){
       maps_stack_hi = reinterpret_cast<void*>(map.addr_end);
@@ -1619,9 +1626,9 @@
 
   // Verify if the stack used by the signal handler is the alternate stack just registered.
   ASSERT_LE(getstack_signal_handler_arg.signal_stack_base, &attr);
-  ASSERT_LT(static_cast<void*>(&attr),
+  ASSERT_LT(static_cast<void*>(untag_address(&attr)),
             static_cast<char*>(getstack_signal_handler_arg.signal_stack_base) +
-            getstack_signal_handler_arg.signal_stack_size);
+                getstack_signal_handler_arg.signal_stack_size);
 
   // Verify if the main thread's stack got in the signal handler is correct.
   ASSERT_EQ(getstack_signal_handler_arg.main_stack_base, stack_base);
@@ -1680,7 +1687,7 @@
 
   // Test whether &local_variable is in [stack_base, stack_base + stack_size).
   ASSERT_LE(reinterpret_cast<char*>(stack_base), &local_variable);
-  ASSERT_LT(&local_variable, reinterpret_cast<char*>(stack_base) + stack_size);
+  ASSERT_LT(untag_address(&local_variable), reinterpret_cast<char*>(stack_base) + stack_size);
 }
 
 // Check whether something on stack is in the range of
@@ -1726,7 +1733,7 @@
 
   ASSERT_EQ(t_gettid_result, t_pthread_gettid_np_result);
 #else
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "pthread_gettid_np not available";
 #endif
 }
 
@@ -1836,10 +1843,25 @@
   DISALLOW_COPY_AND_ASSIGN(PthreadMutex);
 };
 
+static int UnlockFromAnotherThread(pthread_mutex_t* mutex) {
+  pthread_t thread;
+  pthread_create(&thread, nullptr, [](void* mutex_voidp) -> void* {
+    pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(mutex_voidp);
+    intptr_t result = pthread_mutex_unlock(mutex);
+    return reinterpret_cast<void*>(result);
+  }, mutex);
+  void* result;
+  EXPECT_EQ(0, pthread_join(thread, &result));
+  return reinterpret_cast<intptr_t>(result);
+};
+
 static void TestPthreadMutexLockNormal(int protocol) {
   PthreadMutex m(PTHREAD_MUTEX_NORMAL, protocol);
 
   ASSERT_EQ(0, pthread_mutex_lock(&m.lock));
+  if (protocol == PTHREAD_PRIO_INHERIT) {
+    ASSERT_EQ(EPERM, UnlockFromAnotherThread(&m.lock));
+  }
   ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
   ASSERT_EQ(0, pthread_mutex_trylock(&m.lock));
   ASSERT_EQ(EBUSY, pthread_mutex_trylock(&m.lock));
@@ -1850,6 +1872,7 @@
   PthreadMutex m(PTHREAD_MUTEX_ERRORCHECK, protocol);
 
   ASSERT_EQ(0, pthread_mutex_lock(&m.lock));
+  ASSERT_EQ(EPERM, UnlockFromAnotherThread(&m.lock));
   ASSERT_EQ(EDEADLK, pthread_mutex_lock(&m.lock));
   ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
   ASSERT_EQ(0, pthread_mutex_trylock(&m.lock));
@@ -1866,7 +1889,9 @@
   PthreadMutex m(PTHREAD_MUTEX_RECURSIVE, protocol);
 
   ASSERT_EQ(0, pthread_mutex_lock(&m.lock));
+  ASSERT_EQ(EPERM, UnlockFromAnotherThread(&m.lock));
   ASSERT_EQ(0, pthread_mutex_lock(&m.lock));
+  ASSERT_EQ(EPERM, UnlockFromAnotherThread(&m.lock));
   ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
   ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
   ASSERT_EQ(0, pthread_mutex_trylock(&m.lock));
@@ -1921,7 +1946,7 @@
   }
   ASSERT_EQ(0, pthread_mutexattr_destroy(&attr));
 #else
-  GTEST_LOG_(INFO) << "This test does nothing as pi mutex count isn't limited.\n";
+  GTEST_SKIP() << "pi mutex count not limited to 64Ki";
 #endif
 }
 
@@ -2108,7 +2133,7 @@
   // Bionic's pthread_mutex implementation on 32-bit devices uses 16 bits to represent owner tid.
   ASSERT_LE(pid_max, 65536);
 #else
-  GTEST_LOG_(INFO) << "This test does nothing as 32-bit tid is supported by pthread_mutex.\n";
+  GTEST_SKIP() << "pthread_mutex supports 32-bit tid";
 #endif
 }
 
@@ -2151,8 +2176,7 @@
 #if defined(__BIONIC__)
   pthread_mutex_timedlock_helper(CLOCK_MONOTONIC, pthread_mutex_timedlock_monotonic_np);
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing since pthread_mutex_timedlock_monotonic_np is only "
-                      "supported on bionic";
+  GTEST_SKIP() << "pthread_mutex_timedlock_monotonic_np not available";
 #endif  // __BIONIC__
 }
 
@@ -2203,8 +2227,7 @@
 #if defined(__BIONIC__)
   pthread_mutex_timedlock_pi_helper(CLOCK_MONOTONIC, pthread_mutex_timedlock_monotonic_np);
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing since pthread_mutex_timedlock_monotonic_np is only "
-                      "supported on bionic";
+  GTEST_SKIP() << "pthread_mutex_timedlock_monotonic_np not available";
 #endif  // __BIONIC__
 }
 
@@ -2227,7 +2250,7 @@
   ASSERT_EXIT(pthread_mutex_destroy(&m), ::testing::KilledBySignal(SIGABRT),
               "pthread_mutex_destroy called on a destroyed mutex");
 #else
-  GTEST_LOG_(INFO) << "This test tests bionic pthread mutex implementation details.";
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -2284,7 +2307,7 @@
   ASSERT_EQ(0, pthread_rwlock_destroy(rwlock));
 
 #else
-  GTEST_LOG_(INFO) << "This test tests bionic implementation details.";
+  GTEST_SKIP() << "bionic-only test";
 #endif
 }
 
@@ -2299,7 +2322,7 @@
   pthread_mutex_t* null_value = nullptr;
   ASSERT_EQ(EINVAL, pthread_mutex_lock(null_value));
 #else
-  GTEST_LOG_(INFO) << "This test tests bionic implementation details on 32 bit devices.";
+  GTEST_SKIP() << "32-bit bionic-only test";
 #endif
 }
 
@@ -2314,7 +2337,7 @@
   pthread_mutex_t* null_value = nullptr;
   ASSERT_EQ(EINVAL, pthread_mutex_unlock(null_value));
 #else
-  GTEST_LOG_(INFO) << "This test tests bionic implementation details on 32 bit devices.";
+  GTEST_SKIP() << "32-bit bionic-only test";
 #endif
 }
 
@@ -2323,7 +2346,7 @@
   pthread_mutex_t* null_value = nullptr;
   ASSERT_EXIT(pthread_mutex_lock(null_value), testing::KilledBySignal(SIGSEGV), "");
 #else
-  GTEST_LOG_(INFO) << "This test tests bionic implementation details on 64 bit devices.";
+  GTEST_SKIP() << "64-bit bionic-only test";
 #endif
 }
 
@@ -2332,7 +2355,7 @@
   pthread_mutex_t* null_value = nullptr;
   ASSERT_EXIT(pthread_mutex_unlock(null_value), testing::KilledBySignal(SIGSEGV), "");
 #else
-  GTEST_LOG_(INFO) << "This test tests bionic implementation details on 64 bit devices.";
+  GTEST_SKIP() << "64-bit bionic-only test";
 #endif
 }
 
@@ -2582,9 +2605,9 @@
     ASSERT_EQ(0, munmap(pages[i], kPageSize));
   }
 
-  // Creating a thread uses at least six VMAs: the stack, the TLS, and a guard each side of both.
-  // So we should have seen at least six failures.
-  ASSERT_GE(EAGAIN_count, 6U);
+  // Creating a thread uses at least three VMAs: the combined stack and TLS, and a guard on each
+  // side. So we should have seen at least three failures.
+  ASSERT_GE(EAGAIN_count, 3U);
 
   for (; i < pages.size(); ++i) {
     ASSERT_EQ(0, munmap(pages[i], kPageSize));
@@ -2645,10 +2668,7 @@
 TEST(pthread, pthread_attr_setinheritsched_PTHREAD_INHERIT_SCHED_takes_effect) {
   sched_param param = { .sched_priority = sched_get_priority_min(SCHED_FIFO) };
   int rc = pthread_setschedparam(pthread_self(), SCHED_FIFO, &param);
-  if (rc == EPERM) {
-    GTEST_LOG_(INFO) << "pthread_setschedparam failed with EPERM, skipping test\n";
-    return;
-  }
+  if (rc == EPERM) GTEST_SKIP() << "pthread_setschedparam failed with EPERM";
   ASSERT_EQ(0, rc);
 
   pthread_attr_t attr;
@@ -2669,10 +2689,7 @@
 TEST(pthread, pthread_attr_setinheritsched_PTHREAD_EXPLICIT_SCHED_takes_effect) {
   sched_param param = { .sched_priority = sched_get_priority_min(SCHED_FIFO) };
   int rc = pthread_setschedparam(pthread_self(), SCHED_FIFO, &param);
-  if (rc == EPERM) {
-    GTEST_LOG_(INFO) << "pthread_setschedparam failed with EPERM, skipping test\n";
-    return;
-  }
+  if (rc == EPERM) GTEST_SKIP() << "pthread_setschedparam failed with EPERM";
   ASSERT_EQ(0, rc);
 
   pthread_attr_t attr;
@@ -2694,10 +2711,7 @@
 TEST(pthread, pthread_attr_setinheritsched__takes_effect_despite_SCHED_RESET_ON_FORK) {
   sched_param param = { .sched_priority = sched_get_priority_min(SCHED_FIFO) };
   int rc = pthread_setschedparam(pthread_self(), SCHED_FIFO | SCHED_RESET_ON_FORK, &param);
-  if (rc == EPERM) {
-    GTEST_LOG_(INFO) << "pthread_setschedparam failed with EPERM, skipping test\n";
-    return;
-  }
+  if (rc == EPERM) GTEST_SKIP() << "pthread_setschedparam failed with EPERM";
   ASSERT_EQ(0, rc);
 
   pthread_attr_t attr;
diff --git a/tests/pty_test.cpp b/tests/pty_test.cpp
index 75f228c..29f86f1 100644
--- a/tests/pty_test.cpp
+++ b/tests/pty_test.cpp
@@ -109,8 +109,7 @@
   cpu_set_t cpus;
   ASSERT_EQ(0, sched_getaffinity(0, sizeof(cpu_set_t), &cpus));
   if (CPU_COUNT(&cpus) < 2) {
-    GTEST_LOG_(INFO) << "This test tests bug happens only on multiprocessors.";
-    return;
+    GTEST_SKIP() << "This bug only happens on multiprocessors";
   }
   constexpr uint32_t TEST_DATA_COUNT = 2000000;
 
diff --git a/tests/run-on-host.sh b/tests/run-on-host.sh
index c47bc4f..c8a30f5 100755
--- a/tests/run-on-host.sh
+++ b/tests/run-on-host.sh
@@ -3,32 +3,33 @@
 . $(dirname $0)/../build/run-on-host.sh
 
 if [ "$1" = glibc ]; then
-    m -j bionic-unit-tests-glibc
-    (
-        cd ${ANDROID_BUILD_TOP}
-        export ANDROID_DATA=${TARGET_OUT_DATA}
-        export ANDROID_ROOT=${TARGET_OUT}
-        ${HOST_OUT}/nativetest64/bionic-unit-tests-glibc/bionic-unit-tests-glibc $@
-    )
-    exit 0
+  shift
+  m -j bionic-unit-tests-glibc
+  (
+    cd ${ANDROID_BUILD_TOP}
+    export ANDROID_DATA=${TARGET_OUT_DATA}
+    export ANDROID_ROOT=${TARGET_OUT}
+    ${HOST_OUT}/nativetest64/bionic-unit-tests-glibc/bionic-unit-tests-glibc $@
+  )
+  exit 0
 elif [ "$1" != 32 -a "$1" != 64 ]; then
-    echo "Usage: $0 [ 32 | 64 | glibc ] [gtest flags]"
-    exit 1
+  echo "Usage: $0 [ 32 | 64 | glibc ] [gtest flags]"
+  exit 1
 fi
 
 if [ ${HOST_OS}-${HOST_ARCH} = linux-x86 -o ${HOST_OS}-${HOST_ARCH} = linux-x86_64 ]; then
 
-    prepare $1 bionic-unit-tests
+  prepare $1 bionic-unit-tests
 
-    if [ ${TARGET_ARCH} = x86 -o ${TARGET_ARCH} = x86_64 ]; then
-        (
-            cd ${ANDROID_BUILD_TOP}
-            export ANDROID_DATA=${TARGET_OUT_DATA}
-            export ANDROID_DNS_MODE=local
-            export ANDROID_ROOT=${TARGET_OUT}
-            ${NATIVETEST}/bionic-unit-tests/bionic-unit-tests $@
-        )
-    else
-        echo "$0 not supported on TARGET_ARCH=$TARGET_ARCH"
-    fi
+  if [ ${TARGET_ARCH} = x86 -o ${TARGET_ARCH} = x86_64 ]; then
+    (
+      cd ${ANDROID_BUILD_TOP}
+      export ANDROID_DATA=${TARGET_OUT_DATA}
+      export ANDROID_DNS_MODE=local
+      export ANDROID_ROOT=${TARGET_OUT}
+      ${NATIVETEST}/bionic-unit-tests/bionic-unit-tests $@
+    )
+  else
+    echo "$0 not supported on TARGET_ARCH=$TARGET_ARCH"
+  fi
 fi
diff --git a/tests/sched_test.cpp b/tests/sched_test.cpp
index 9184026..9309a7f 100644
--- a/tests/sched_test.cpp
+++ b/tests/sched_test.cpp
@@ -47,7 +47,7 @@
 // See https://sourceware.org/bugzilla/show_bug.cgi?id=10311 for more details.
 TEST(sched, clone) {
   // In order to enumerate all possible tests for CTS, create an empty test.
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc is broken";
 }
 #endif
 
diff --git a/tests/semaphore_test.cpp b/tests/semaphore_test.cpp
index 690e886..7addf6d 100644
--- a/tests/semaphore_test.cpp
+++ b/tests/semaphore_test.cpp
@@ -141,8 +141,7 @@
 #if defined(__BIONIC__)
   sem_timedwait_helper(CLOCK_MONOTONIC, sem_timedwait_monotonic_np);
 #else   // __BIONIC__
-  GTEST_LOG_(INFO)
-      << "This test does nothing since sem_timedwait_monotonic_np is only supported on bionic";
+  GTEST_SKIP() << "sem_timedwait_monotonic_np is only supported on bionic";
 #endif  // __BIONIC__
 }
 
@@ -218,7 +217,7 @@
   ASSERT_EQ(0, pthread_join(thread, &result));
   ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(result));
 #else
-  GTEST_LOG_(INFO) << "This test tests sem_wait's compatibility for old sdk versions";
+  GTEST_SKIP() << "This test tests sem_wait's compatibility for old sdk versions";
 #endif
 }
 
diff --git a/tests/signal_test.cpp b/tests/signal_test.cpp
index dd27aef..1ae174a 100644
--- a/tests/signal_test.cpp
+++ b/tests/signal_test.cpp
@@ -392,11 +392,19 @@
   static uint64_t sigset;
   struct sigaction sa = {};
   sa.sa_handler = [](int) { sigset = GetSignalMask(); };
+  sa.sa_flags = SA_ONSTACK | SA_NODEFER;
   sigfillset(&sa.sa_mask);
   sigaction(SIGUSR1, &sa, nullptr);
   raise(SIGUSR1);
-  ASSERT_NE(0ULL, sigset);
-  TestSignalMaskFiltered(sigset);
+
+  // On LP32, struct sigaction::sa_mask is only 32-bits wide.
+  unsigned long expected_sigset = ~0UL;
+
+  // SIGKILL and SIGSTOP are always blocked.
+  expected_sigset &= ~(1UL << (SIGKILL - 1));
+  expected_sigset &= ~(1UL << (SIGSTOP - 1));
+
+  ASSERT_EQ(static_cast<uint64_t>(expected_sigset), sigset);
 }
 
 TEST(signal, sigaction64_filter) {
@@ -404,11 +412,18 @@
   static uint64_t sigset;
   struct sigaction64 sa = {};
   sa.sa_handler = [](int) { sigset = GetSignalMask(); };
+  sa.sa_flags = SA_ONSTACK | SA_NODEFER;
   sigfillset64(&sa.sa_mask);
   sigaction64(SIGUSR1, &sa, nullptr);
   raise(SIGUSR1);
-  ASSERT_NE(0ULL, sigset);
-  TestSignalMaskFiltered(sigset);
+
+  uint64_t expected_sigset = ~0ULL;
+
+  // SIGKILL and SIGSTOP are always blocked.
+  expected_sigset &= ~(1ULL << (SIGKILL - 1));
+  expected_sigset &= ~(1ULL << (SIGSTOP - 1));
+
+  ASSERT_EQ(expected_sigset, sigset);
 }
 
 TEST(signal, sigprocmask_setmask_filter) {
@@ -567,7 +582,7 @@
   ASSERT_TRUE(sys_signame[0] == nullptr);
   ASSERT_STREQ("HUP", sys_signame[SIGHUP]);
 #else
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "glibc doesn't have sys_signame";
 #endif
 }
 
diff --git a/tests/stack_protector_test.cpp b/tests/stack_protector_test.cpp
index 34e3c11..9fe7bb1 100644
--- a/tests/stack_protector_test.cpp
+++ b/tests/stack_protector_test.cpp
@@ -95,7 +95,7 @@
   ASSERT_NE(0, gettid());
   ASSERT_NE(0U, __stack_chk_guard);
 #else
-  GTEST_LOG_(INFO) << "glibc doesn't have a global __stack_chk_guard.\n";
+  GTEST_SKIP() << "glibc doesn't have a global __stack_chk_guard";
 #endif
 }
 
@@ -104,6 +104,11 @@
 TEST_F(stack_protector_DeathTest, modify_stack_protector) {
   // In another file to prevent inlining, which removes stack protection.
   extern void modify_stack_protector_test();
+#if __has_feature(hwaddress_sanitizer)
+  ASSERT_EXIT(modify_stack_protector_test(),
+              testing::KilledBySignal(SIGABRT), "tag-mismatch");
+#else
   ASSERT_EXIT(modify_stack_protector_test(),
               testing::KilledBySignal(SIGABRT), "stack corruption detected");
+#endif
 }
diff --git a/tests/stack_protector_test_helper.cpp b/tests/stack_protector_test_helper.cpp
index 3f15a12..2db4ef1 100644
--- a/tests/stack_protector_test_helper.cpp
+++ b/tests/stack_protector_test_helper.cpp
@@ -21,6 +21,6 @@
   // the line of defense *after* that.
   // Without volatile, the generic x86/x86-64 targets don't write to the stack.
   volatile char* p = buf;
-  int size = static_cast<int>(sizeof(buf) + 1);
+  int size = static_cast<int>(sizeof(buf) + sizeof(void*));
   while ((p - buf) < size) *p++ = '\0';
 }
diff --git a/tests/stdio_ext_test.cpp b/tests/stdio_ext_test.cpp
index d84fda0..fce600a 100644
--- a/tests/stdio_ext_test.cpp
+++ b/tests/stdio_ext_test.cpp
@@ -193,7 +193,7 @@
 
 TEST(stdio_ext, __fseterr) {
 #if defined(__GLIBC__)
-  GTEST_LOG_(INFO) << "glibc doesn't have __fseterr, but gnulib will use it";
+  GTEST_SKIP() << "glibc doesn't have __fseterr, but gnulib will use it";
 #else
   FILE* fp = fopen("/dev/null", "w");
 
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index 479fd9d..65a942c 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -330,7 +330,7 @@
   int i = 1234;
   EXPECT_DEATH(snprintf(buf, sizeof(buf), "a %n b", &i), "%n not allowed on Android");
 #else
-  GTEST_LOG_(INFO) << "This test does nothing on glibc.\n";
+  GTEST_SKIP() << "glibc does allow %n";
 #endif
 }
 
@@ -1820,6 +1820,14 @@
   ASSERT_EQ(0, fclose(fp));
 }
 
+TEST(STDIO_TEST, fmemopen_zero_length_buffer_overrun) {
+  char buf[2] = "x";
+  ASSERT_EQ('x', buf[0]);
+  FILE* fp = fmemopen(buf, 0, "w");
+  ASSERT_EQ('x', buf[0]);
+  ASSERT_EQ(0, fclose(fp));
+}
+
 TEST(STDIO_TEST, fmemopen_write_only_allocated) {
   // POSIX says fmemopen "may fail if the mode argument does not include a '+'".
   // BSD fails, glibc doesn't. We side with the more lenient.
@@ -1889,7 +1897,7 @@
   ASSERT_EQ(nullptr, open_memstream(&p, nullptr));
   ASSERT_EQ(EINVAL, errno);
 #else
-  GTEST_LOG_(INFO) << "This test does nothing on glibc.\n";
+  GTEST_SKIP() << "glibc is broken";
 #endif
 }
 
@@ -2149,7 +2157,7 @@
 
   fclose(fp);
 #else
-  GTEST_LOG_(INFO) << "glibc uses fopencookie instead.\n";
+  GTEST_SKIP() << "glibc uses fopencookie instead";
 #endif
 }
 
@@ -2159,7 +2167,7 @@
   ASSERT_EQ(nullptr, funopen(nullptr, nullptr, nullptr, nullptr, nullptr));
   ASSERT_EQ(EINVAL, errno);
 #else
-  GTEST_LOG_(INFO) << "glibc uses fopencookie instead.\n";
+  GTEST_SKIP() << "glibc uses fopencookie instead";
 #endif
 }
 
@@ -2187,7 +2195,7 @@
   EXPECT_EQ(0, fgetpos64(fp64, &pos64)) << strerror(errno);
   EXPECT_EQ(0xfedcba12345678, pos64);
 #else
-  GTEST_LOG_(INFO) << "glibc uses fopencookie instead.\n";
+  GTEST_SKIP() << "glibc uses fopencookie instead";
 #endif
 }
 
@@ -2226,7 +2234,7 @@
   EXPECT_EQ(offset, static_cast<off64_t>(pos));
   EXPECT_EQ(offset, static_cast<off64_t>(pos64));
 #else
-  GTEST_LOG_(INFO) << "glibc's fpos_t is opaque.\n";
+  GTEST_SKIP() << "glibc's fpos_t is opaque";
 #endif
 }
 
diff --git a/tests/stdlib_test.cpp b/tests/stdlib_test.cpp
index 00850f6..ff4cb71 100644
--- a/tests/stdlib_test.cpp
+++ b/tests/stdlib_test.cpp
@@ -36,14 +36,6 @@
 #include "math_data_test.h"
 #include "utils.h"
 
-#if defined(__BIONIC__)
-  #define ALIGNED_ALLOC_AVAILABLE 1
-#elif defined(__GLIBC_PREREQ)
-  #if __GLIBC_PREREQ(2, 16)
-    #define ALIGNED_ALLOC_AVAILABLE 1
-  #endif
-#endif
-
 template <typename T = int (*)(char*)>
 class GenericTemporaryFile {
  public:
@@ -274,49 +266,37 @@
 
 TEST(stdlib, aligned_alloc_sweep) {
   SKIP_WITH_HWASAN;
-#if defined(ALIGNED_ALLOC_AVAILABLE)
   // Verify powers of 2 up to 2048 allocate, and verify that all other
   // alignment values between the powers of 2 fail.
   size_t last_align = 1;
   for (size_t align = 1; align <= 2048; align <<= 1) {
     // Try all of the non power of 2 values from the last until this value.
     for (size_t fail_align = last_align + 1; fail_align < align; fail_align++) {
-      ASSERT_TRUE(aligned_alloc(fail_align, 256) == nullptr)
+      ASSERT_TRUE(aligned_alloc(fail_align, fail_align) == nullptr)
           << "Unexpected success at align " << fail_align;
       ASSERT_EQ(EINVAL, errno) << "Unexpected errno at align " << fail_align;
     }
-    void* ptr = aligned_alloc(align, 256);
+    void* ptr = aligned_alloc(align, 2 * align);
     ASSERT_TRUE(ptr != nullptr) << "Unexpected failure at align " << align;
     ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr) & (align - 1))
         << "Did not return a valid aligned ptr " << ptr << " expected alignment " << align;
     free(ptr);
     last_align = align;
   }
-#else
-  GTEST_LOG_(INFO) << "This test requires a C library that has aligned_alloc.\n";
-#endif
 }
 
 TEST(stdlib, aligned_alloc_overflow) {
   SKIP_WITH_HWASAN;
-#if defined(ALIGNED_ALLOC_AVAILABLE)
   ASSERT_TRUE(aligned_alloc(16, SIZE_MAX) == nullptr);
-#else
-  GTEST_LOG_(INFO) << "This test requires a C library that has aligned_alloc.\n";
-#endif
 }
 
 TEST(stdlib, aligned_alloc_size_not_multiple_of_alignment) {
   SKIP_WITH_HWASAN;
-#if defined(ALIGNED_ALLOC_AVAILABLE)
-  for (size_t size = 1; size <= 2048; size++) {
-    void* ptr = aligned_alloc(2048, size);
-    ASSERT_TRUE(ptr != nullptr) << "Failed at size " << std::to_string(size);
-    free(ptr);
-  }
-#else
-  GTEST_LOG_(INFO) << "This test requires a C library that has aligned_alloc.\n";
-#endif
+
+  ASSERT_TRUE(aligned_alloc(2048, 1) == nullptr);
+  ASSERT_TRUE(aligned_alloc(4, 3) == nullptr);
+  ASSERT_TRUE(aligned_alloc(4, 7) == nullptr);
+  ASSERT_TRUE(aligned_alloc(16, 8) == nullptr);
 }
 
 TEST(stdlib, realpath__NULL_filename) {
@@ -876,16 +856,18 @@
   ASSERT_EQ(3, getloadavg(load, INT_MAX));
 
   // Read /proc/loadavg and check that it's "close enough".
-  load[0] = nan("");
   double expected[3];
   std::unique_ptr<FILE, decltype(&fclose)> fp{fopen("/proc/loadavg", "re"), fclose};
   ASSERT_EQ(3, fscanf(fp.get(), "%lf %lf %lf", &expected[0], &expected[1], &expected[2]));
+  load[0] = load[1] = load[2] = nan("");
   ASSERT_EQ(3, getloadavg(load, 3));
 
-  // It's probably too flaky if we look at the 1-minute average, so we just place a NaN there
-  // and check that it's overwritten with _something_.
+  // Check that getloadavg(3) at least overwrote the NaNs.
   ASSERT_FALSE(isnan(load[0]));
-  // For the others, rounding to an integer is pessimistic but at least gives us a sanity check.
-  ASSERT_DOUBLE_EQ(rint(expected[1]), rint(load[1]));
-  ASSERT_DOUBLE_EQ(rint(expected[2]), rint(load[2]));
+  ASSERT_FALSE(isnan(load[1]));
+  ASSERT_FALSE(isnan(load[2]));
+  // And that the difference between /proc/loadavg and getloadavg(3) is "small".
+  ASSERT_TRUE(fabs(expected[0] - load[0]) < 0.5) << expected[0] << ' ' << load[0];
+  ASSERT_TRUE(fabs(expected[1] - load[1]) < 0.5) << expected[1] << ' ' << load[1];
+  ASSERT_TRUE(fabs(expected[2] - load[2]) < 0.5) << expected[2] << ' ' << load[2];
 }
diff --git a/tests/string_test.cpp b/tests/string_test.cpp
index fd2a787..335d33b 100644
--- a/tests/string_test.cpp
+++ b/tests/string_test.cpp
@@ -85,7 +85,7 @@
 
   ASSERT_STREQ("Unknown error 1001", strerror1001);
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "Skipping test, requires a thread safe strerror.";
+  GTEST_SKIP() << "thread-safe strerror not available";
 #endif // __BIONIC__
 }
 
@@ -578,7 +578,7 @@
     }
   }
 #else
-  GTEST_LOG_(INFO) << "Skipping test, strlcat not supported on this platform.";
+  GTEST_SKIP() << "strlcat not available";
 #endif
 }
 
@@ -610,7 +610,7 @@
                  (memcmp(state.ptr2, state.ptr + state.MAX_LEN, state.MAX_LEN) != 0));
   }
 #else
-  GTEST_LOG_(INFO) << "Skipping test, strlcpy not supported on this platform.";
+  GTEST_SKIP() << "strlcpy not available";
 #endif
 }
 
@@ -1139,7 +1139,7 @@
 #if defined(STRLCPY_SUPPORTED)
   RunSrcDstBufferAlignTest(LARGE, DoStrlcpyTest);
 #else
-  GTEST_LOG_(INFO) << "Skipping test, strlcpy not supported on this platform.";
+  GTEST_SKIP() << "strlcpy not available";
 #endif
 }
 
@@ -1147,7 +1147,7 @@
 #if defined(STRLCPY_SUPPORTED)
   RunSrcDstBufferOverreadTest(DoStrlcpyTest);
 #else
-  GTEST_LOG_(INFO) << "Skipping test, strlcpy not supported on this platform.";
+  GTEST_SKIP() << "strlcpy not available";
 #endif
 }
 
@@ -1275,7 +1275,7 @@
 #if defined(STRLCAT_SUPPORTED)
   RunSrcDstBufferAlignTest(MEDIUM, DoStrlcatTest, LargeSetIncrement);
 #else
-  GTEST_LOG_(INFO) << "Skipping test, strlcat not supported on this platform.";
+  GTEST_SKIP() << "strlcat not available";
 #endif
 }
 
@@ -1283,7 +1283,7 @@
 #if defined(STRLCAT_SUPPORTED)
   RunSrcDstBufferOverreadTest(DoStrlcatTest);
 #else
-  GTEST_LOG_(INFO) << "Skipping test, strlcat not supported on this platform.";
+  GTEST_SKIP() << "strlcat not available";
 #endif
 }
 
@@ -1554,3 +1554,40 @@
   ASSERT_EQ(haystack + 1, strstr(haystack, "i"));
   ASSERT_EQ(haystack + 4, strstr(haystack, "da"));
 }
+
+TEST(STRING_TEST, strcasestr_smoke) {
+  const char* haystack = "bIg dAdDy/gIaNt hAyStAcKs";
+  ASSERT_EQ(haystack, strcasestr(haystack, ""));
+  ASSERT_EQ(haystack + 0, strcasestr(haystack, "B"));
+  ASSERT_EQ(haystack + 1, strcasestr(haystack, "i"));
+  ASSERT_EQ(haystack + 4, strcasestr(haystack, "Da"));
+}
+
+TEST(STRING_TEST, strcoll_smoke) {
+  ASSERT_TRUE(strcoll("aab", "aac") < 0);
+  ASSERT_TRUE(strcoll("aab", "aab") == 0);
+  ASSERT_TRUE(strcoll("aac", "aab") > 0);
+}
+
+TEST(STRING_TEST, strxfrm_smoke) {
+  const char* src1 = "aab";
+  char dst1[16] = {};
+  ASSERT_GT(strxfrm(dst1, src1, sizeof(dst1)), 0U);
+  const char* src2 = "aac";
+  char dst2[16] = {};
+  ASSERT_GT(strxfrm(dst2, src2, sizeof(dst2)), 0U);
+  ASSERT_TRUE(strcmp(dst1, dst2) < 0);
+}
+
+TEST(STRING_TEST, memccpy_smoke) {
+  char dst[32];
+
+  memset(dst, 0, sizeof(dst));
+  char* p = static_cast<char*>(memccpy(dst, "hello world", ' ', 32));
+  ASSERT_STREQ("hello ", dst);
+  ASSERT_EQ(ptrdiff_t(6), p - dst);
+
+  memset(dst, 0, sizeof(dst));
+  ASSERT_EQ(nullptr, memccpy(dst, "hello world", ' ', 4));
+  ASSERT_STREQ("hell", dst);
+}
diff --git a/tests/sys_msg_test.cpp b/tests/sys_msg_test.cpp
index 8b3623e..200f654 100644
--- a/tests/sys_msg_test.cpp
+++ b/tests/sys_msg_test.cpp
@@ -35,8 +35,7 @@
 
 TEST(sys_msg, smoke) {
   if (msgctl(-1, IPC_STAT, nullptr) == -1 && errno == ENOSYS) {
-    GTEST_LOG_(INFO) << "no <sys/msg.h> support in this kernel\n";
-    return;
+    GTEST_SKIP() << "no <sys/msg.h> support in this kernel";
   }
 
   // Create a queue.
diff --git a/tests/sys_param_test.cpp b/tests/sys_param_test.cpp
new file mode 100644
index 0000000..e4bbf42
--- /dev/null
+++ b/tests/sys_param_test.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <gtest/gtest.h>
+#include <sys/param.h>
+
+TEST(sys_param_test, powerof2_positives) {
+  ASSERT_TRUE(powerof2(1));
+  ASSERT_TRUE(powerof2(2));
+  ASSERT_TRUE(powerof2(4));
+  ASSERT_TRUE(powerof2(8));
+  ASSERT_FALSE(powerof2(3));
+  ASSERT_FALSE(powerof2(5));
+  ASSERT_FALSE(powerof2(7));
+  ASSERT_FALSE(powerof2(9));
+  ASSERT_FALSE(powerof2(10));
+}
+
+TEST(sys_param_test, powerof2_zero) {
+  // 0 isn't a power of 2, but for compatibility, we assume it is.
+  ASSERT_TRUE(powerof2(0));
+  uint32_t zero = 0;
+  ASSERT_TRUE(powerof2(zero));
+}
+
+TEST(sys_param_test, powerof2_negatives) {
+  // negative numbers can never be a power of 2, but for compatibility,
+  // we assume they can be.
+  int32_t min32 = INT32_MIN;
+  int64_t min64 = INT64_MIN;
+  ASSERT_TRUE(powerof2(min32));
+  ASSERT_FALSE(powerof2(min32 + 1));
+  ASSERT_TRUE(powerof2(min64));
+  ASSERT_FALSE(powerof2(min64 + 1));
+}
diff --git a/tests/sys_prctl_test.cpp b/tests/sys_prctl_test.cpp
index 7afa626..6d1fa1d 100644
--- a/tests/sys_prctl_test.cpp
+++ b/tests/sys_prctl_test.cpp
@@ -20,6 +20,7 @@
 #include <sys/capability.h>
 #include <sys/mman.h>
 #include <sys/prctl.h>
+#include <sys/utsname.h>
 #include <unistd.h>
 
 #include <string>
@@ -60,7 +61,7 @@
 
   ASSERT_EQ(0, munmap(p, page_size * 3));
 #else
-  GTEST_LOG_(INFO) << "This test does nothing as it tests an Android specific kernel feature.";
+  GTEST_SKIP() << "PR_SET_VMA not available";
 #endif
 }
 
@@ -75,10 +76,14 @@
       "https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/"
       "?id=b7f76ea2ef6739ee484a165ffbac98deb855d3d3";
 
+  utsname u = {};
+  ASSERT_EQ(0, uname(&u));
+
+  errno = 0;
   auto err = prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_CLEAR_ALL, 0, 0, 0);
   EXPECT_EQ(0, err);
   // EINVAL -> unrecognized prctl option
-  ASSERT_NE(EINVAL, errno) << "kernel missing required commits:\n"
+  ASSERT_NE(EINVAL, errno) << "kernel (" << u.release << ") missing required commits:\n"
                            << caps_sha << "\n"
                            << caps_typo_sha << "\n";
 
@@ -107,7 +112,6 @@
   EXPECT_EQ(-1, err);
   EXPECT_EQ(EINVAL, errno);
 #else
-  GTEST_LOG_(INFO)
-      << "Skipping test that requires host support for PR_CAP_AMBIENT.";
+  GTEST_SKIP() << "PR_CAP_AMBIENT not available";
 #endif
 }
diff --git a/tests/sys_ptrace_test.cpp b/tests/sys_ptrace_test.cpp
index 83fd93b..90539fe 100644
--- a/tests/sys_ptrace_test.cpp
+++ b/tests/sys_ptrace_test.cpp
@@ -35,6 +35,8 @@
 #include <android-base/macros.h>
 #include <android-base/unique_fd.h>
 
+#include "utils.h"
+
 using namespace std::chrono_literals;
 
 using android::base::unique_fd;
@@ -60,14 +62,13 @@
 
 enum class HwFeature { Watchpoint, Breakpoint };
 
-static bool is_hw_feature_supported(pid_t child, HwFeature feature) {
+static void check_hw_feature_supported(pid_t child, HwFeature feature) {
 #if defined(__arm__)
   long capabilities;
   long result = ptrace(PTRACE_GETHBPREGS, child, 0, &capabilities);
   if (result == -1) {
     EXPECT_EQ(EIO, errno);
-    GTEST_LOG_(INFO) << "Hardware debug support disabled at kernel configuration time.";
-    return false;
+    GTEST_SKIP() << "Hardware debug support disabled at kernel configuration time";
   }
   uint8_t hb_count = capabilities & 0xff;
   capabilities >>= 8;
@@ -75,19 +76,12 @@
   capabilities >>= 8;
   uint8_t max_wp_size = capabilities & 0xff;
   if (max_wp_size == 0) {
-    GTEST_LOG_(INFO)
-        << "Kernel reports zero maximum watchpoint size. Hardware debug support missing.";
-    return false;
+    GTEST_SKIP() << "Kernel reports zero maximum watchpoint size";
+  } else if (feature == HwFeature::Watchpoint && wp_count == 0) {
+    GTEST_SKIP() << "Kernel reports zero hardware watchpoints";
+  } else if (feature == HwFeature::Breakpoint && hb_count == 0) {
+    GTEST_SKIP() << "Kernel reports zero hardware breakpoints";
   }
-  if (feature == HwFeature::Watchpoint && wp_count == 0) {
-    GTEST_LOG_(INFO) << "Kernel reports zero hardware watchpoints";
-    return false;
-  }
-  if (feature == HwFeature::Breakpoint && hb_count == 0) {
-    GTEST_LOG_(INFO) << "Kernel reports zero hardware breakpoints";
-    return false;
-  }
-  return true;
 #elif defined(__aarch64__)
   user_hwdebug_state dreg_state;
   iovec iov;
@@ -97,20 +91,13 @@
   long result = ptrace(PTRACE_GETREGSET, child,
                        feature == HwFeature::Watchpoint ? NT_ARM_HW_WATCH : NT_ARM_HW_BREAK, &iov);
   if (result == -1) {
-    EXPECT_EQ(EINVAL, errno);
-    return false;
+    ASSERT_EQ(EINVAL, errno);
   }
-  return (dreg_state.dbg_info & 0xff) > 0;
-#elif defined(__i386__) || defined(__x86_64__)
+  if ((dreg_state.dbg_info & 0xff) == 0) GTEST_SKIP() << "hardware support missing";
+#else
   // We assume watchpoints and breakpoints are always supported on x86.
   UNUSED(child);
   UNUSED(feature);
-  return true;
-#else
-  // TODO: mips support.
-  UNUSED(child);
-  UNUSED(feature);
-  return false;
 #endif
 }
 
@@ -188,12 +175,9 @@
   ASSERT_TRUE(WIFSTOPPED(status)) << "Status was: " << status;
   ASSERT_EQ(SIGSTOP, WSTOPSIG(status)) << "Status was: " << status;
 
-  if (!is_hw_feature_supported(child, HwFeature::Watchpoint)) {
-    GTEST_LOG_(INFO) << "Skipping test because hardware support is not available.\n";
-    return;
-  }
+  check_hw_feature_supported(child, HwFeature::Watchpoint);
 
-  set_watchpoint(child, uintptr_t(&data) + offset, size);
+  set_watchpoint(child, uintptr_t(untag_address(&data)) + offset, size);
 
   ASSERT_EQ(0, ptrace(PTRACE_CONT, child, nullptr, nullptr)) << strerror(errno);
   ASSERT_EQ(child, TEMP_FAILURE_RETRY(waitpid(child, &status, __WALL))) << strerror(errno);
@@ -358,10 +342,7 @@
   ASSERT_TRUE(WIFSTOPPED(status)) << "Status was: " << status;
   ASSERT_EQ(SIGSTOP, WSTOPSIG(status)) << "Status was: " << status;
 
-  if (!is_hw_feature_supported(child, HwFeature::Breakpoint)) {
-    GTEST_LOG_(INFO) << "Skipping test because hardware support is not available.\n";
-    return;
-  }
+  check_hw_feature_supported(child, HwFeature::Breakpoint);
 
   set_breakpoint(child);
 
@@ -421,7 +402,7 @@
     }
   }
 
-  ~PtraceResumptionTest() {
+  ~PtraceResumptionTest() override {
   }
 
   void AssertDeath(int signo);
diff --git a/tests/sys_random_test.cpp b/tests/sys_random_test.cpp
index 78cbf4a..2e2665b 100644
--- a/tests/sys_random_test.cpp
+++ b/tests/sys_random_test.cpp
@@ -43,7 +43,7 @@
   ASSERT_EQ(0, getentropy(buf2, sizeof(buf2)));
   ASSERT_TRUE(memcmp(buf1, buf2, sizeof(buf1)) != 0);
 #else
-  GTEST_LOG_(INFO) << "This test requires a C library with <sys/random.h>.\n";
+  GTEST_SKIP() << "<sys/random.h> not available";
 #endif
 }
 
@@ -53,7 +53,7 @@
   ASSERT_EQ(-1, getentropy(nullptr, 1));
   ASSERT_EQ(EFAULT, errno);
 #else
-  GTEST_LOG_(INFO) << "This test requires a C library with <sys/random.h>.\n";
+  GTEST_SKIP() << "<sys/random.h> not available";
 #endif
 }
 
@@ -66,7 +66,7 @@
   ASSERT_EQ(-1, getentropy(buf, sizeof(buf)));
   ASSERT_EQ(EIO, errno);
 #else
-  GTEST_LOG_(INFO) << "This test requires a C library with <sys/random.h>.\n";
+  GTEST_SKIP() << "<sys/random.h> not available";
 #endif
 }
 
@@ -79,7 +79,7 @@
   ASSERT_EQ(64, getrandom(buf2, sizeof(buf2), 0));
   ASSERT_TRUE(memcmp(buf1, buf2, sizeof(buf1)) != 0);
 #else
-  GTEST_LOG_(INFO) << "This test requires a C library with <sys/random.h>.\n";
+  GTEST_SKIP() << "<sys/random.h> not available";
 #endif
 }
 
@@ -89,7 +89,7 @@
   ASSERT_EQ(-1, getrandom(nullptr, 256, 0));
   ASSERT_EQ(EFAULT, errno);
 #else
-  GTEST_LOG_(INFO) << "This test requires a C library with <sys/random.h>.\n";
+  GTEST_SKIP() << "<sys/random.h> not available";
 #endif
 }
 
@@ -100,6 +100,6 @@
   ASSERT_EQ(-1, getrandom(buf, sizeof(buf), ~0));
   ASSERT_EQ(EINVAL, errno);
 #else
-  GTEST_LOG_(INFO) << "This test requires a C library with <sys/random.h>.\n";
+  GTEST_SKIP() << "<sys/random.h> not available";
 #endif
 }
diff --git a/tests/sys_resource_test.cpp b/tests/sys_resource_test.cpp
index 0b6b6ef..b1e8b1a 100644
--- a/tests/sys_resource_test.cpp
+++ b/tests/sys_resource_test.cpp
@@ -30,7 +30,7 @@
 
 class SysResourceTest : public ::testing::Test {
  protected:
-  virtual void SetUp() {
+  void SetUp() override {
     ASSERT_EQ(0, getrlimit(RLIMIT_CORE, &l32_));
     ASSERT_EQ(0, getrlimit64(RLIMIT_CORE, &l64_));
     ASSERT_EQ(0, prlimit(0, RLIMIT_CORE, nullptr, &pr_l32_));
diff --git a/tests/sys_sem_test.cpp b/tests/sys_sem_test.cpp
index dff34c8..b98926b 100644
--- a/tests/sys_sem_test.cpp
+++ b/tests/sys_sem_test.cpp
@@ -35,8 +35,7 @@
 
 TEST(sys_sem, smoke) {
   if (semctl(-1, 0, IPC_RMID) == -1 && errno == ENOSYS) {
-    GTEST_LOG_(INFO) << "no <sys/sem.h> support in this kernel\n";
-    return;
+    GTEST_SKIP() << "no <sys/sem.h> support in this kernel";
   }
 
   // Create a semaphore.
diff --git a/tests/sys_shm_test.cpp b/tests/sys_shm_test.cpp
index 15abe05..fd5d424 100644
--- a/tests/sys_shm_test.cpp
+++ b/tests/sys_shm_test.cpp
@@ -34,8 +34,7 @@
 
 TEST(sys_shm, smoke) {
   if (shmctl(-1, IPC_STAT, nullptr) == -1 && errno == ENOSYS) {
-    GTEST_LOG_(INFO) << "no <sys/shm.h> support in this kernel\n";
-    return;
+    GTEST_SKIP() << "no <sys/shm.h> support in this kernel";
   }
 
   // Create a segment.
diff --git a/tests/sys_stat_test.cpp b/tests/sys_stat_test.cpp
index 70ad451..97bf580 100644
--- a/tests/sys_stat_test.cpp
+++ b/tests/sys_stat_test.cpp
@@ -82,7 +82,7 @@
     unlink(path.c_str());
   } else {
     // SELinux policy forbids us from creating FIFOs. http://b/17646702.
-    GTEST_LOG_(INFO) << "This test only performs a test when run as root.";
+    GTEST_SKIP() << "SELinux policy forbids non-root from creating FIFOs";
   }
 }
 
diff --git a/tests/sys_time_test.cpp b/tests/sys_time_test.cpp
index 16187eb..5dda7ab 100644
--- a/tests/sys_time_test.cpp
+++ b/tests/sys_time_test.cpp
@@ -147,7 +147,7 @@
     tv2.tv_usec += 1000000;
   }
 
-  // Should be less than (a very generous, to try to avoid flakiness) 2ms (2000us).
+  // To try to avoid flakiness we'll accept answers within 10,000us (0.01s).
   ASSERT_EQ(0, tv2.tv_sec);
-  ASSERT_LT(tv2.tv_usec, 2000);
+  ASSERT_LT(tv2.tv_usec, 10'000);
 }
diff --git a/tests/system_properties_test.cpp b/tests/system_properties_test.cpp
index 3b50896..245e42f 100644
--- a/tests/system_properties_test.cpp
+++ b/tests/system_properties_test.cpp
@@ -121,7 +121,7 @@
     ASSERT_EQ(5, system_properties.Get(name, propvalue));
     ASSERT_STREQ(propvalue, "value");
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -156,7 +156,7 @@
     ASSERT_EQ(6, system_properties.Get("property_other", propvalue));
     ASSERT_STREQ(propvalue, "value6");
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -202,7 +202,7 @@
         ASSERT_EQ(0, memcmp(prop_value, prop_value_ret, PROP_VALUE_MAX));
     }
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -219,7 +219,7 @@
     ASSERT_EQ(0, system_properties.Foreach(foreach_test_callback, &count));
     ASSERT_EQ(3U, count);
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -248,7 +248,7 @@
       ASSERT_TRUE(system_properties.FindNth(i) == nullptr);
     }
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -307,7 +307,7 @@
         }
     }
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -328,7 +328,7 @@
     ASSERT_EQ(-1, system_properties.Add("name", 4, "value", PROP_VALUE_MAX));
     ASSERT_EQ(-1, system_properties.Update(NULL, "value", PROP_VALUE_MAX));
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -344,7 +344,7 @@
     ASSERT_EQ(0, system_properties.Update(const_cast<prop_info*>(pi), "value2", 6));
     ASSERT_NE(serial, system_properties.Serial(pi));
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -375,7 +375,7 @@
 
     thread.join();
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -408,7 +408,7 @@
 
     thread.join();
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -436,7 +436,7 @@
 
   ASSERT_EXIT(__system_property_add("property", 8, "value", 5), KilledByFault(), "");
 #else // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -508,7 +508,7 @@
   }
 
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif  // __BIONIC__
 }
 
@@ -523,6 +523,6 @@
   ASSERT_NE(0, system_properties.Add(name.c_str(), name.size(), value.c_str(), value.size()));
 
 #else   // __BIONIC__
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "bionic-only test";
 #endif  // __BIONIC__
 }
diff --git a/tests/system_properties_test2.cpp b/tests/system_properties_test2.cpp
index e6e7ef2..c061faa 100644
--- a/tests/system_properties_test2.cpp
+++ b/tests/system_properties_test2.cpp
@@ -124,7 +124,7 @@
     ASSERT_EQ(expected_name, legacy_name);
     ASSERT_STREQ("value2", propvalue);
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
 
@@ -143,6 +143,6 @@
     }
 
 #else // __BIONIC__
-    GTEST_LOG_(INFO) << "This test does nothing.\n";
+    GTEST_SKIP() << "bionic-only test";
 #endif // __BIONIC__
 }
diff --git a/tests/time_test.cpp b/tests/time_test.cpp
index 4ec5976..c890358 100644
--- a/tests/time_test.cpp
+++ b/tests/time_test.cpp
@@ -296,6 +296,69 @@
   EXPECT_STREQ("09:41:53", buf);
 }
 
+TEST(time, strptime_F) {
+  setenv("TZ", "UTC", 1);
+
+  struct tm tm = {};
+  ASSERT_EQ('\0', *strptime("2019-03-26", "%F", &tm));
+  EXPECT_EQ(119, tm.tm_year);
+  EXPECT_EQ(2, tm.tm_mon);
+  EXPECT_EQ(26, tm.tm_mday);
+}
+
+TEST(time, strptime_P_p) {
+  setenv("TZ", "UTC", 1);
+
+  // For parsing, %P and %p are the same: case doesn't matter.
+
+  struct tm tm = {.tm_hour = 12};
+  ASSERT_EQ('\0', *strptime("AM", "%p", &tm));
+  EXPECT_EQ(0, tm.tm_hour);
+
+  tm = {.tm_hour = 12};
+  ASSERT_EQ('\0', *strptime("am", "%p", &tm));
+  EXPECT_EQ(0, tm.tm_hour);
+
+  tm = {.tm_hour = 12};
+  ASSERT_EQ('\0', *strptime("AM", "%P", &tm));
+  EXPECT_EQ(0, tm.tm_hour);
+
+  tm = {.tm_hour = 12};
+  ASSERT_EQ('\0', *strptime("am", "%P", &tm));
+  EXPECT_EQ(0, tm.tm_hour);
+}
+
+TEST(time, strptime_u) {
+  setenv("TZ", "UTC", 1);
+
+  struct tm tm = {};
+  ASSERT_EQ('\0', *strptime("2", "%u", &tm));
+  EXPECT_EQ(2, tm.tm_wday);
+}
+
+TEST(time, strptime_v) {
+  setenv("TZ", "UTC", 1);
+
+  struct tm tm = {};
+  ASSERT_EQ('\0', *strptime("26-Mar-1980", "%v", &tm));
+  EXPECT_EQ(80, tm.tm_year);
+  EXPECT_EQ(2, tm.tm_mon);
+  EXPECT_EQ(26, tm.tm_mday);
+}
+
+TEST(time, strptime_V_G_g) {
+  setenv("TZ", "UTC", 1);
+
+  // %V (ISO-8601 week number), %G (year of week number, without century), and
+  // %g (year of week number) have no effect when parsed, and are supported
+  // solely so that it's possible for strptime(3) to parse everything that
+  // strftime(3) can output.
+  struct tm tm = {};
+  ASSERT_EQ('\0', *strptime("1 2 3", "%V %G %g", &tm));
+  struct tm zero = {};
+  EXPECT_TRUE(memcmp(&tm, &zero, sizeof(tm)) == 0);
+}
+
 void SetTime(timer_t t, time_t value_s, time_t value_ns, time_t interval_s, time_t interval_ns) {
   itimerspec ts;
   ts.it_value.tv_sec = value_s;
@@ -607,9 +670,9 @@
     ts2.tv_nsec += NS_PER_S;
   }
 
-  // Should be less than (a very generous, to try to avoid flakiness) 1000000ns.
+  // To try to avoid flakiness we'll accept answers within 10,000,000ns (0.01s).
   ASSERT_EQ(0, ts2.tv_sec);
-  ASSERT_LT(ts2.tv_nsec, 1000000);
+  ASSERT_LT(ts2.tv_nsec, 10'000'000);
 }
 
 TEST(time, clock_gettime_CLOCK_REALTIME) {
@@ -912,6 +975,6 @@
   ASSERT_EQ(0, timespec_get(&ts, 123));
   ASSERT_EQ(TIME_UTC, timespec_get(&ts, TIME_UTC));
 #else
-  GTEST_LOG_(INFO) << "glibc doesn't have timespec_get until 2.21\n";
+  GTEST_SKIP() << "glibc doesn't have timespec_get until 2.21";
 #endif
 }
diff --git a/tests/uchar_test.cpp b/tests/uchar_test.cpp
index 522d5ac..48c500d 100644
--- a/tests/uchar_test.cpp
+++ b/tests/uchar_test.cpp
@@ -15,12 +15,7 @@
  */
 
 
-#include <sys/cdefs.h>
-#if defined(__BIONIC__)
-#define HAVE_UCHAR 1
-#elif defined(__GLIBC__)
-#define HAVE_UCHAR __GLIBC_PREREQ(2, 16)
-#endif
+#include <uchar.h>
 
 #include <gtest/gtest.h>
 
@@ -29,21 +24,12 @@
 #include <locale.h>
 #include <stdint.h>
 
-#if HAVE_UCHAR
-#include <uchar.h>
-#endif
-
 TEST(uchar, sizeof_uchar_t) {
-#if HAVE_UCHAR
   EXPECT_EQ(2U, sizeof(char16_t));
   EXPECT_EQ(4U, sizeof(char32_t));
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, start_state) {
-#if HAVE_UCHAR
   char out[MB_LEN_MAX];
   mbstate_t ps;
 
@@ -64,31 +50,19 @@
   EXPECT_EQ(static_cast<size_t>(-2), mbrtoc32(nullptr, "\xf0\xa4", 1, &ps));
   EXPECT_EQ(1U, c32rtomb(out, L'\0', &ps));
   EXPECT_TRUE(mbsinit(&ps));
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, c16rtomb_null_out) {
-#if HAVE_UCHAR
   EXPECT_EQ(1U, c16rtomb(nullptr, L'\0', nullptr));
   EXPECT_EQ(1U, c16rtomb(nullptr, L'h', nullptr));
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, c16rtomb_null_char) {
-#if HAVE_UCHAR
   char bytes[MB_LEN_MAX];
   EXPECT_EQ(1U, c16rtomb(bytes, L'\0', nullptr));
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, c16rtomb) {
-#if HAVE_UCHAR
   char bytes[MB_LEN_MAX];
 
   memset(bytes, 0, sizeof(bytes));
@@ -113,13 +87,9 @@
   EXPECT_EQ('\xe2', bytes[0]);
   EXPECT_EQ('\x82', bytes[1]);
   EXPECT_EQ('\xac', bytes[2]);
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, c16rtomb_surrogate) {
-#if HAVE_UCHAR
   char bytes[MB_LEN_MAX];
 
   memset(bytes, 0, sizeof(bytes));
@@ -129,13 +99,9 @@
   EXPECT_EQ('\x8a', bytes[1]);
   EXPECT_EQ('\xaf', bytes[2]);
   EXPECT_EQ('\x8d', bytes[3]);
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, c16rtomb_invalid) {
-#if HAVE_UCHAR
   char bytes[MB_LEN_MAX];
 
   memset(bytes, 0, sizeof(bytes));
@@ -143,21 +109,13 @@
 
   EXPECT_EQ(0U, c16rtomb(bytes, 0xdbea, nullptr));
   EXPECT_EQ(static_cast<size_t>(-1), c16rtomb(bytes, 0xdbea, nullptr));
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, mbrtoc16_null) {
-#if HAVE_UCHAR
   ASSERT_EQ(0U, mbrtoc16(nullptr, nullptr, 0, nullptr));
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, mbrtoc16_zero_len) {
-#if HAVE_UCHAR
   char16_t out;
 
   out = L'x';
@@ -168,13 +126,9 @@
   ASSERT_EQ(0U, mbrtoc16(&out, "", 0, nullptr));
   ASSERT_EQ(1U, mbrtoc16(&out, "hello", 1, nullptr));
   ASSERT_EQ(L'h', out);
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, mbrtoc16) {
-#if HAVE_UCHAR
   char16_t out;
 
   ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
@@ -189,13 +143,9 @@
   // 3-byte UTF-8.
   ASSERT_EQ(3U, mbrtoc16(&out, "\xe2\x82\xac" "def", 6, nullptr));
   ASSERT_EQ(static_cast<char16_t>(0x20ac), out);
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, mbrtoc16_surrogate) {
-#if HAVE_UCHAR
   char16_t out;
 
   ASSERT_EQ(static_cast<size_t>(-3),
@@ -203,32 +153,20 @@
   ASSERT_EQ(static_cast<char16_t>(0xdbea), out);
   ASSERT_EQ(4U, mbrtoc16(&out, "\xf4\x8a\xaf\x8d" "ef", 6, nullptr));
   ASSERT_EQ(static_cast<char16_t>(0xdfcd), out);
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, mbrtoc16_reserved_range) {
-#if HAVE_UCHAR
   char16_t out;
   ASSERT_EQ(static_cast<size_t>(-1),
             mbrtoc16(&out, "\xf0\x80\xbf\xbf", 6, nullptr));
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, mbrtoc16_beyond_range) {
-#if HAVE_UCHAR
   char16_t out;
   ASSERT_EQ(static_cast<size_t>(-1),
             mbrtoc16(&out, "\xf5\x80\x80\x80", 6, nullptr));
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
-#if HAVE_UCHAR
 void test_mbrtoc16_incomplete(mbstate_t* ps) {
   ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
   uselocale(LC_GLOBAL_LOCALE);
@@ -259,22 +197,16 @@
   ASSERT_EQ(static_cast<size_t>(-1), mbrtoc16(&out, "\x20" "cdef", 5, ps));
   ASSERT_EQ(EILSEQ, errno);
 }
-#endif
 
 TEST(uchar, mbrtoc16_incomplete) {
-#if HAVE_UCHAR
   mbstate_t ps;
   memset(&ps, 0, sizeof(ps));
 
   test_mbrtoc16_incomplete(&ps);
   test_mbrtoc16_incomplete(nullptr);
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, c32rtomb) {
-#if HAVE_UCHAR
   EXPECT_EQ(1U, c32rtomb(nullptr, L'\0', nullptr));
   EXPECT_EQ(1U, c32rtomb(nullptr, L'h', nullptr));
 
@@ -317,13 +249,9 @@
   // Invalid code point.
   EXPECT_EQ(static_cast<size_t>(-1), c32rtomb(bytes, 0xffffffff, nullptr));
   EXPECT_EQ(EILSEQ, errno);
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, mbrtoc32_valid_non_characters) {
-#if HAVE_UCHAR
   ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
   uselocale(LC_GLOBAL_LOCALE);
 
@@ -332,13 +260,9 @@
   ASSERT_EQ(0xfffeU, out[0]);
   ASSERT_EQ(3U, mbrtoc32(out, "\xef\xbf\xbf", 3, nullptr));
   ASSERT_EQ(0xffffU, out[0]);
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, mbrtoc32_out_of_range) {
-#if HAVE_UCHAR
   ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
   uselocale(LC_GLOBAL_LOCALE);
 
@@ -346,13 +270,9 @@
   errno = 0;
   ASSERT_EQ(static_cast<size_t>(-1), mbrtoc32(out, "\xf5\x80\x80\x80", 4, nullptr));
   ASSERT_EQ(EILSEQ, errno);
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
 TEST(uchar, mbrtoc32) {
-#if HAVE_UCHAR
   char32_t out[8];
 
   out[0] = L'x';
@@ -393,12 +313,8 @@
   // Illegal over-long sequence.
   ASSERT_EQ(static_cast<size_t>(-1), mbrtoc32(out, "\xf0\x82\x82\xac" "ef", 6, nullptr));
   ASSERT_EQ(EILSEQ, errno);
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
 
-#if HAVE_UCHAR
 void test_mbrtoc32_incomplete(mbstate_t* ps) {
   ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
   uselocale(LC_GLOBAL_LOCALE);
@@ -427,16 +343,11 @@
   ASSERT_EQ(static_cast<size_t>(-1), mbrtoc32(&out, "\x20" "cdef", 5, ps));
   ASSERT_EQ(EILSEQ, errno);
 }
-#endif
 
 TEST(uchar, mbrtoc32_incomplete) {
-#if HAVE_UCHAR
   mbstate_t ps;
   memset(&ps, 0, sizeof(ps));
 
   test_mbrtoc32_incomplete(&ps);
   test_mbrtoc32_incomplete(nullptr);
-#else
-  GTEST_LOG_(INFO) << "uchar.h is unavailable.\n";
-#endif
 }
diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp
index f4a7f1f..10c1710 100644
--- a/tests/unistd_test.cpp
+++ b/tests/unistd_test.cpp
@@ -538,7 +538,7 @@
 
 static int CloneStartRoutine(int (*start_routine)(void*)) {
   void* child_stack[1024];
-  return clone(start_routine, &child_stack[1024], SIGCHLD, nullptr);
+  return clone(start_routine, untag_address(&child_stack[1024]), SIGCHLD, nullptr);
 }
 
 static int GetPidCachingCloneStartRoutine(void*) {
@@ -628,6 +628,45 @@
   ASSERT_NE(static_cast<uint64_t>(parent_tid), reinterpret_cast<uint64_t>(result));
 }
 
+static void optimization_barrier(void* arg) {
+  asm volatile("" : : "r"(arg) : "memory");
+}
+
+__attribute__((noinline)) static void HwasanVforkTestChild() {
+  // Allocate a tagged region on stack and leave it there.
+  char x[10000];
+  optimization_barrier(x);
+  _exit(0);
+}
+
+__attribute__((noinline)) static void HwasanReadMemory(const char* p, size_t size) {
+  // Read memory byte-by-byte. This will blow up if the pointer tag in p does not match any memory
+  // tag in [p, p+size).
+  volatile char z;
+  for (size_t i = 0; i < size; ++i) {
+    z = p[i];
+  }
+}
+
+__attribute__((noinline, no_sanitize("hwaddress"))) static void HwasanVforkTestParent() {
+  // Allocate a region on stack, but don't tag it (see the function attribute).
+  // This depends on unallocated stack space at current function entry being untagged.
+  char x[10000];
+  optimization_barrier(x);
+  // Verify that contents of x[] are untagged.
+  HwasanReadMemory(x, sizeof(x));
+}
+
+TEST(UNISTD_TEST, hwasan_vfork) {
+  // Test hwasan annotation in vfork. This test is only interesting when built with hwasan, but it
+  // is supposed to work correctly either way.
+  if (vfork()) {
+    HwasanVforkTestParent();
+  } else {
+    HwasanVforkTestChild();
+  }
+}
+
 class UNISTD_DEATHTEST : public BionicDeathTest {};
 
 TEST_F(UNISTD_DEATHTEST, abort) {
diff --git a/tests/utils.h b/tests/utils.h
index 5fc1d93..fe41019 100644
--- a/tests/utils.h
+++ b/tests/utils.h
@@ -64,7 +64,17 @@
   return &__hwasan_init != 0;
 }
 
-#define SKIP_WITH_HWASAN if (running_with_hwasan()) { return; }
+#define SKIP_WITH_HWASAN if (running_with_hwasan()) GTEST_SKIP()
+
+static inline void* untag_address(void* addr) {
+#if defined(__LP64__)
+  if (running_with_hwasan()) {
+    constexpr uintptr_t mask = (static_cast<uintptr_t>(1) << 56) - 1;
+    addr = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(addr) & mask);
+  }
+#endif
+  return addr;
+}
 
 #if defined(__linux__)
 
diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp
index 9aef800..9b4fc4f 100644
--- a/tests/wchar_test.cpp
+++ b/tests/wchar_test.cpp
@@ -713,7 +713,7 @@
   ASSERT_EQ(nullptr, open_wmemstream(&p, nullptr));
   ASSERT_EQ(EINVAL, errno);
 #else
-  GTEST_LOG_(INFO) << "This test does nothing.\n";
+  GTEST_SKIP() << "This test is bionic-specific";
 #endif
 }
 
diff --git a/tests/wctype_test.cpp b/tests/wctype_test.cpp
index 06e1571..85a46aa 100644
--- a/tests/wctype_test.cpp
+++ b/tests/wctype_test.cpp
@@ -111,7 +111,7 @@
     EXPECT_EQ(wint_t(L'δ'), towlower(L'δ'));
     EXPECT_EQ(wint_t(L'δ'), towlower(L'Δ'));
   } else {
-    GTEST_LOG_(INFO) << "skipping unicode towlower tests";
+    GTEST_SKIP() << "icu not available";
   }
 }
 
@@ -127,7 +127,7 @@
     EXPECT_EQ(wint_t(L'δ'), towlower_l(L'δ', l.l));
     EXPECT_EQ(wint_t(L'δ'), towlower_l(L'Δ', l.l));
   } else {
-    GTEST_LOG_(INFO) << "skipping unicode towlower_l tests";
+    GTEST_SKIP() << "icu not available";
   }
 }
 
@@ -142,7 +142,7 @@
     EXPECT_EQ(wint_t(L'Δ'), towupper(L'δ'));
     EXPECT_EQ(wint_t(L'Δ'), towupper(L'Δ'));
   } else {
-    GTEST_LOG_(INFO) << "skipping unicode towupper tests";
+    GTEST_SKIP() << "icu not available";
   }
 }
 
@@ -158,7 +158,7 @@
     EXPECT_EQ(wint_t(L'Δ'), towupper_l(L'δ', l.l));
     EXPECT_EQ(wint_t(L'Δ'), towupper_l(L'Δ', l.l));
   } else {
-    GTEST_LOG_(INFO) << "skipping unicode towupper_l tests";
+    GTEST_SKIP() << "icu not available";
   }
 }
 
diff --git a/tools/Android.bp b/tools/Android.bp
index b44c296..c540c3c 100644
--- a/tools/Android.bp
+++ b/tools/Android.bp
@@ -1 +1,6 @@
 subdirs = ["*"]
+
+filegroup {
+    name: "bionic-generate-version-script",
+    srcs: ["generate-version-script.py"],
+}
diff --git a/tools/Android.mk b/tools/Android.mk
deleted file mode 100644
index 4dd66fe..0000000
--- a/tools/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-subdir-makefiles)
diff --git a/tools/generate-version-script.py b/tools/generate-version-script.py
new file mode 100755
index 0000000..acfe218
--- /dev/null
+++ b/tools/generate-version-script.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+# This tool is used to generate the version scripts for libc, libm, libdl,
+# and libstdc++ for every architecture.
+
+# usage: generate-version-script.py ARCH INPUT OUTPUT
+
+import sys
+
+def has_arch_tags(tags):
+  for arch in ["arm", "arm64", "x86", "x86_64"]:
+    if arch in tags:
+      return True
+  return False
+
+def GenerateVersionScript(arch, in_filename, out_filename):
+  with open(out_filename, "w") as fout:
+    with open(in_filename, "r") as fin:
+      for line in fin:
+        index = line.find("#")
+        if index != -1:
+          tags = line[index+1:].split()
+          if arch not in tags and has_arch_tags(tags):
+            continue
+        fout.write(line)
+
+arch = sys.argv[1]
+in_filename = sys.argv[2]
+out_filename = sys.argv[3]
+GenerateVersionScript(arch, in_filename, out_filename)
diff --git a/tools/update_notice.sh b/tools/update_notice.sh
index 0b8a106..a309bc2 100755
--- a/tools/update_notice.sh
+++ b/tools/update_notice.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 cd $DIR/..
-./libc/tools/generate-NOTICE.py libc libdl libm linker libstdc++ > libc/NOTICE
+./libc/tools/generate-NOTICE.py libc libm > libc/NOTICE
 
 git diff --exit-code HEAD libc/NOTICE
 exit $?
diff --git a/tools/update_seccomp.sh b/tools/update_seccomp.sh
deleted file mode 100755
index b9e53aa..0000000
--- a/tools/update_seccomp.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-cd $DIR/..
-./libc/tools/genseccomp.py
-
-git diff --exit-code HEAD libc/seccomp/
-exit $?
diff --git a/tools/update_syscalls.sh b/tools/update_syscalls.sh
deleted file mode 100755
index 5e7eb0a..0000000
--- a/tools/update_syscalls.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-cd $DIR/..
-./libc/tools/gensyscalls.py
-
-git diff --exit-code HEAD libc/arch-*/syscalls/
-exit $?
diff --git a/tools/update_version_scripts.sh b/tools/update_version_scripts.sh
deleted file mode 100755
index 2c3a5b4..0000000
--- a/tools/update_version_scripts.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-cd $DIR/..
-./libc/tools/genversion-scripts.py
-
-git diff --exit-code HEAD libc/*.map libdl/*.map libm/*.map linker/*.map
-exit $?
diff --git a/tools/versioner/src/Arch.h b/tools/versioner/src/Arch.h
index bac9ec4..16fa265 100644
--- a/tools/versioner/src/Arch.h
+++ b/tools/versioner/src/Arch.h
@@ -138,7 +138,7 @@
   { Arch::x86_64, "x86_64-linux-android" },
 };
 
-static const std::set<int> default_levels = { 14, 15, 16, 17, 18, 19, 21, 23, 24, 25, 26, 27, 28 };
+static const std::set<int> default_levels = { 14, 15, 16, 17, 18, 19, 21, 23, 24, 25, 26, 27, 28, 29 };
 
 static const ArchMap<int> arch_min_api = {
   { Arch::arm, 9 },
@@ -149,8 +149,6 @@
   { Arch::x86_64, 21 },
 };
 
-static constexpr int future_api = 10000;
-
 static const std::unordered_map<std::string, int> api_codename_map{
   {"G", 9},
   {"I", 14},
@@ -166,5 +164,5 @@
   {"O", 26},
   {"O-MR1", 27},
   {"P", 28},
-  {"Q", 9001},
+  {"Q", 29},
 };
diff --git a/tools/versioner/src/DeclarationDatabase.cpp b/tools/versioner/src/DeclarationDatabase.cpp
index d9cff17..0ba51d1 100644
--- a/tools/versioner/src/DeclarationDatabase.cpp
+++ b/tools/versioner/src/DeclarationDatabase.cpp
@@ -147,9 +147,6 @@
       llvm::StringRef annotation = attr->getAnnotation();
       if (annotation == "versioner_no_guard") {
         no_guard = true;
-      } else if (annotation == "introduced_in_future") {
-        // Tag the compiled-for arch, since this can vary across archs.
-        availability.arch_availability[type.arch].future = true;
       } else {
         llvm::SmallVector<llvm::StringRef, 2> fragments;
         annotation.split(fragments, "=");
@@ -345,10 +342,6 @@
 std::string to_string(const AvailabilityValues& av) {
   std::stringstream ss;
 
-  if (av.future) {
-    ss << "future, ";
-  }
-
   if (av.introduced != 0) {
     ss << "introduced = " << av.introduced << ", ";
   }
diff --git a/tools/versioner/src/DeclarationDatabase.h b/tools/versioner/src/DeclarationDatabase.h
index 0daa2cd..4496ee9 100644
--- a/tools/versioner/src/DeclarationDatabase.h
+++ b/tools/versioner/src/DeclarationDatabase.h
@@ -42,13 +42,12 @@
 };
 
 struct AvailabilityValues {
-  bool future = false;
   int introduced = 0;
   int deprecated = 0;
   int obsoleted = 0;
 
   bool empty() const {
-    return !(future || introduced || deprecated || obsoleted);
+    return !(introduced || deprecated || obsoleted);
   }
 
   bool operator==(const AvailabilityValues& rhs) const {
diff --git a/tools/versioner/src/Driver.cpp b/tools/versioner/src/Driver.cpp
index 6062240..3927480 100644
--- a/tools/versioner/src/Driver.cpp
+++ b/tools/versioner/src/Driver.cpp
@@ -62,7 +62,7 @@
       : header_database(header_database), type(type) {
   }
 
-  virtual void HandleTranslationUnit(ASTContext& ctx) override {
+  void HandleTranslationUnit(ASTContext& ctx) override {
     header_database->parseAST(type, ctx);
   }
 };
diff --git a/tools/versioner/src/Preprocessor.cpp b/tools/versioner/src/Preprocessor.cpp
index a7f289b..9eac2ab 100644
--- a/tools/versioner/src/Preprocessor.cpp
+++ b/tools/versioner/src/Preprocessor.cpp
@@ -190,13 +190,6 @@
 
     int version = avail.arch_availability[*it.second.begin()].introduced;
 
-    // Assume that the entire declaration is declared __INTRODUCED_IN_FUTURE if one arch is.
-    bool future = avail.arch_availability[*it.second.begin()].future;
-
-    if (future) {
-      return "__ANDROID_API__ >= __ANDROID_API_FUTURE__";
-    }
-
     // The maximum min_version of the set.
     int max_min_version = 0;
     for (Arch arch : archs) {
diff --git a/tools/versioner/src/SymbolFileParser.cpp b/tools/versioner/src/SymbolFileParser.cpp
index 33308d9..c312b48 100644
--- a/tools/versioner/src/SymbolFileParser.cpp
+++ b/tools/versioner/src/SymbolFileParser.cpp
@@ -257,10 +257,6 @@
         intro_arch = true;
         continue;
       }
-
-      if (tag == "future") {
-        return compilation_type.api_level == future_api;
-      }
     }
 
     if (intro.empty() && api_level.empty()) {
diff --git a/tools/versioner/src/versioner.cpp b/tools/versioner/src/versioner.cpp
index 73eff0e..d3c2f7c 100644
--- a/tools/versioner/src/versioner.cpp
+++ b/tools/versioner/src/versioner.cpp
@@ -397,10 +397,6 @@
         should_be_available = false;
       }
 
-      if (arch_availability.future) {
-        continue;
-      }
-
       // The function declaration might be (validly) missing for the given CompilationType.
       if (!symbol_it.second.hasDeclaration(type)) {
         should_be_available = false;
diff --git a/tools/versioner/tests/future/headers/foo.h b/tools/versioner/tests/future/headers/foo.h
deleted file mode 100644
index 51a3a1c..0000000
--- a/tools/versioner/tests/future/headers/foo.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-int foo() __INTRODUCED_IN_FUTURE;
-
-#if defined(__cplusplus)
-}
-#endif
diff --git a/tools/versioner/tests/future/platforms/libc.map.txt b/tools/versioner/tests/future/platforms/libc.map.txt
deleted file mode 100644
index e69de29..0000000
--- a/tools/versioner/tests/future/platforms/libc.map.txt
+++ /dev/null
diff --git a/tools/versioner/tests/future/run.sh b/tools/versioner/tests/future/run.sh
deleted file mode 100644
index 041b047..0000000
--- a/tools/versioner/tests/future/run.sh
+++ /dev/null
@@ -1 +0,0 @@
-versioner -v headers -p platforms -r arm -a 9 -i
\ No newline at end of file
diff --git a/tools/versioner/tests/future_arch/headers/foo.h b/tools/versioner/tests/future_arch/headers/foo.h
deleted file mode 100644
index a3258e7..0000000
--- a/tools/versioner/tests/future_arch/headers/foo.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-#if defined(__arm__)
-int foo() __INTRODUCED_IN(9);
-#else
-int foo() __INTRODUCED_IN_FUTURE;
-#endif
-
-#if defined(__cplusplus)
-}
-#endif
diff --git a/tools/versioner/tests/future_arch/platforms/libc.map.txt b/tools/versioner/tests/future_arch/platforms/libc.map.txt
deleted file mode 100644
index f56190e..0000000
--- a/tools/versioner/tests/future_arch/platforms/libc.map.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-LIBC {
-  global:
-    foo;  # arm
-};
diff --git a/tools/versioner/tests/future_arch/run.sh b/tools/versioner/tests/future_arch/run.sh
deleted file mode 100644
index ad8f430..0000000
--- a/tools/versioner/tests/future_arch/run.sh
+++ /dev/null
@@ -1 +0,0 @@
-versioner -v headers -p platforms -r arm -r x86 -a 9 -i
\ No newline at end of file
diff --git a/tools/versioner/tests/preprocessor/expected/foo.h b/tools/versioner/tests/preprocessor/expected/foo.h
index cb719f0..61e6056 100644
--- a/tools/versioner/tests/preprocessor/expected/foo.h
+++ b/tools/versioner/tests/preprocessor/expected/foo.h
@@ -74,11 +74,6 @@
 
 
 
-#if __ANDROID_API__ >= __ANDROID_API_FUTURE__
-int future() __INTRODUCED_IN_FUTURE;
-#endif /* __ANDROID_API__ >= __ANDROID_API_FUTURE__ */
-
-
 #if defined(__cplusplus)
 }
 #endif
diff --git a/tools/versioner/tests/preprocessor/headers/foo.h b/tools/versioner/tests/preprocessor/headers/foo.h
index 2429334..349e5e6 100644
--- a/tools/versioner/tests/preprocessor/headers/foo.h
+++ b/tools/versioner/tests/preprocessor/headers/foo.h
@@ -45,8 +45,6 @@
 
 int group_lp32() __INTRODUCED_IN_ARM(12) __INTRODUCED_IN_X86(12) __INTRODUCED_IN_MIPS(12);
 
-int future() __INTRODUCED_IN_FUTURE;
-
 #if defined(__cplusplus)
 }
 #endif