Merge "Remove XOM properties."
diff --git a/libc/NOTICE b/libc/NOTICE
index 87d39c9..ef61ec1 100644
--- a/libc/NOTICE
+++ b/libc/NOTICE
@@ -3532,31 +3532,6 @@
 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.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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) 2001-2002 Opsycon AB  (www.opsycon.se / www.opsycon.com)
-
-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 Opsycon AB nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.
diff --git a/libc/SECCOMP_BLACKLIST_APP.TXT b/libc/SECCOMP_BLACKLIST_APP.TXT
index b7a05c4..40ca222 100644
--- a/libc/SECCOMP_BLACKLIST_APP.TXT
+++ b/libc/SECCOMP_BLACKLIST_APP.TXT
@@ -4,28 +4,6 @@
 # The final seccomp whitelist is SYSCALLS.TXT - SECCOMP_BLACKLIST.TXT + SECCOMP_WHITELIST.TXT
 # Any entry in the blacklist must be in the syscalls file and not be in the whitelist file
 #
-# Each non-blank, non-comment line has the following format:
-#
-# return_type func_name[|alias_list][:syscall_name[:socketcall_id]]([parameter_list]) arch_list
-#
-# where:
-#       arch_list ::= "all" | arch+
-#       arch      ::= "arm" | "arm64" | "mips" | "mips64" | "x86" | "x86_64"
-#
-# Note:
-#      - syscall_name corresponds to the name of the syscall, which may differ from
-#        the exported function name (example: the exit syscall is implemented by the _exit()
-#        function, which is not the same as the standard C exit() function which calls it)
-
-#      - alias_list is optional comma separated list of function aliases
-#
-#      - The call_id parameter, given that func_name and syscall_name have
-#        been provided, allows the user to specify dispatch style syscalls.
-#        For example, socket() syscall on i386 actually becomes:
-#          socketcall(__NR_socket, 1, *(rest of args on stack)).
-#
-#      - Each parameter type is assumed to be stored in 32 bits.
-#
 # 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,
@@ -33,21 +11,21 @@
 # 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
+int     setgid:setgid32(gid_t)     lp32
+int     setgid:setgid(gid_t)       lp64
+int     setuid:setuid32(uid_t)    lp32
+int     setuid:setuid(uid_t)      lp64
+int     setregid:setregid32(gid_t, gid_t)  lp32
+int     setregid:setregid(gid_t, gid_t)    lp64
+int     setreuid:setreuid32(uid_t, uid_t)   lp32
+int     setreuid:setreuid(uid_t, uid_t)     lp64
+int     setresgid:setresgid32(gid_t, gid_t, gid_t)   lp32
+int     setresgid:setresgid(gid_t, gid_t, gid_t)     lp64
 # 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
-int     setgroups:setgroups(int, const gid_t*)     arm64,mips,mips64,x86_64
+int     setgroups:setgroups32(int, const gid_t*)   lp32
+int     setgroups:setgroups(int, const gid_t*)     lp64
 
 # syscalls to modify times
 int     adjtimex(struct timex*)   all
diff --git a/libc/SECCOMP_BLACKLIST_COMMON.TXT b/libc/SECCOMP_BLACKLIST_COMMON.TXT
index f279002..8ae21c1 100644
--- a/libc/SECCOMP_BLACKLIST_COMMON.TXT
+++ b/libc/SECCOMP_BLACKLIST_COMMON.TXT
@@ -4,28 +4,6 @@
 # The final seccomp whitelist is SYSCALLS.TXT - SECCOMP_BLACKLIST.TXT + SECCOMP_WHITELIST.TXT
 # Any entry in the blacklist must be in the syscalls file and not be in the whitelist file
 #
-# Each non-blank, non-comment line has the following format:
-#
-# return_type func_name[|alias_list][:syscall_name[:socketcall_id]]([parameter_list]) arch_list
-#
-# where:
-#       arch_list ::= "all" | arch+
-#       arch      ::= "arm" | "arm64" | "mips" | "mips64" | "x86" | "x86_64"
-#
-# Note:
-#      - syscall_name corresponds to the name of the syscall, which may differ from
-#        the exported function name (example: the exit syscall is implemented by the _exit()
-#        function, which is not the same as the standard C exit() function which calls it)
-
-#      - alias_list is optional comma separated list of function aliases
-#
-#      - The call_id parameter, given that func_name and syscall_name have
-#        been provided, allows the user to specify dispatch style syscalls.
-#        For example, socket() syscall on i386 actually becomes:
-#          socketcall(__NR_socket, 1, *(rest of args on stack)).
-#
-#      - Each parameter type is assumed to be stored in 32 bits.
-#
 # This file is processed by a python script named genseccomp.py.
 
 int     swapon(const char*, int) all
diff --git a/libc/SECCOMP_WHITELIST_APP.TXT b/libc/SECCOMP_WHITELIST_APP.TXT
index faa2d63..dc48715 100644
--- a/libc/SECCOMP_WHITELIST_APP.TXT
+++ b/libc/SECCOMP_WHITELIST_APP.TXT
@@ -1,80 +1,58 @@
 # This file is used to populate seccomp's whitelist policy in combination with SYSCALLS.TXT.
 # Note that the resultant policy is applied only to zygote spawned processes.
 #
-# Each non-blank, non-comment line has the following format:
-#
-# return_type func_name[|alias_list][:syscall_name[:socketcall_id]]([parameter_list]) arch_list
-#
-# where:
-#       arch_list ::= "all" | arch+
-#       arch      ::= "arm" | "arm64" | "mips" | "mips64" | "x86" | "x86_64"
-#
-# Note:
-#      - syscall_name corresponds to the name of the syscall, which may differ from
-#        the exported function name (example: the exit syscall is implemented by the _exit()
-#        function, which is not the same as the standard C exit() function which calls it)
-
-#      - alias_list is optional comma separated list of function aliases
-#
-#      - The call_id parameter, given that func_name and syscall_name have
-#        been provided, allows the user to specify dispatch style syscalls.
-#        For example, socket() syscall on i386 actually becomes:
-#          socketcall(__NR_socket, 1, *(rest of args on stack)).
-#
-#      - Each parameter type is assumed to be stored in 32 bits.
-#
 # This file is processed by a python script named genseccomp.py.
 
 # Needed for debugging 32-bit Chrome
-int	pipe:pipe(int pipefd[2])	arm,x86,mips
+int	pipe:pipe(int pipefd[2])	lp32
 
 # b/34651972
-int	access:access(const char *pathname, int mode)	arm,x86,mips
-int	stat64:stat64(const char*, struct stat64*)	arm,x86,mips
+int	access:access(const char *pathname, int mode)	lp32
+int	stat64:stat64(const char*, struct stat64*)	lp32
 
 # b/34813887
-int	open:open(const char *path, int oflag, ... ) arm,x86,x86_64,mips
-int	getdents:getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int count) arm,x86,x86_64,mips
+int	open:open(const char *path, int oflag, ... ) lp32,x86_64
+int	getdents:getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int count) lp32,x86_64
 
 # b/34719286
-int	eventfd:eventfd(unsigned int initval, int flags)	arm,x86,mips
+int	eventfd:eventfd(unsigned int initval, int flags)	lp32
 
 # b/34817266
-int	epoll_wait:epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)	arm,x86,mips
+int	epoll_wait:epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)	lp32
 
 # b/34908783
-int	epoll_create:epoll_create(int size)	arm,x86,mips
+int	epoll_create:epoll_create(int size)	lp32
 
 # b/34979910
-int	creat:creat(const char *pathname, mode_t mode)	arm,x86,mips
-int	unlink:unlink(const char *pathname)	arm,x86,mips
+int	creat:creat(const char *pathname, mode_t mode)	lp32
+int	unlink:unlink(const char *pathname)	lp32
 
 # b/35059702
-int	lstat64:lstat64(const char*, struct stat64*)	arm,x86,mips
+int	lstat64:lstat64(const char*, struct stat64*)	lp32
 
 # b/35217603
-int	fcntl:fcntl(int fd, int cmd, ... /* arg */ )	arm,x86,mips
-pid_t	fork:fork()	arm,x86,mips
-int	poll:poll(struct pollfd *fds, nfds_t nfds, int timeout)	arm,x86,mips
+int	fcntl:fcntl(int fd, int cmd, ... /* arg */ )	lp32
+pid_t	fork:fork()	lp32
+int	poll:poll(struct pollfd *fds, nfds_t nfds, int timeout)	lp32
 
-# b/35906875. Note mips already has getuid from SYSCALLS.TXT
-int	inotify_init()	arm,x86,mips
-uid_t	getuid()	arm,x86
+# b/35906875
+int	inotify_init()	lp32
+uid_t	getuid()	lp32
 
 # b/36435222
-int	remap_file_pages(void *addr, size_t size, int prot, size_t pgoff, int flags)	arm,x86,mips
+int	remap_file_pages(void *addr, size_t size, int prot, size_t pgoff, int flags)	lp32
 
 # b/36449658
-int	rename(const char *oldpath, const char *newpath)	arm,x86,mips
+int	rename(const char *oldpath, const char *newpath)	lp32
 
 # b/36726183. Note arm does not support mmap
-void*	mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)	x86,mips
+void*	mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)	x86
 
 # b/37769298
-int dup2(int oldfd, int newfd)	arm,x86,mips
+int dup2(int oldfd, int newfd)	lp32
 
 # b/62779795
-int compat_select:_newselect(int n, unsigned long* inp, unsigned long* outp, unsigned long* exp, struct timeval* timeout) arm,x86,mips
+int compat_select:_newselect(int n, unsigned long* inp, unsigned long* outp, unsigned long* exp, struct timeval* timeout) lp32
 
 # b/62090571
-int mkdir(const char *pathname, mode_t mode)	arm,x86,mips
+int mkdir(const char *pathname, mode_t mode)	lp32
diff --git a/libc/SECCOMP_WHITELIST_COMMON.TXT b/libc/SECCOMP_WHITELIST_COMMON.TXT
index c55d875..72ced4f 100644
--- a/libc/SECCOMP_WHITELIST_COMMON.TXT
+++ b/libc/SECCOMP_WHITELIST_COMMON.TXT
@@ -1,44 +1,19 @@
 # This file is used to populate seccomp's whitelist policy in combination with SYSCALLS.TXT.
 # Note that the resultant policy is applied only to zygote spawned processes.
 #
-# Each non-blank, non-comment line has the following format:
-#
-# return_type func_name[|alias_list][:syscall_name[:socketcall_id]]([parameter_list]) arch_list
-#
-# where:
-#       arch_list ::= "all" | arch+
-#       arch      ::= "arm" | "arm64" | "mips" | "mips64" | "x86" | "x86_64"
-#
-# Note:
-#      - syscall_name corresponds to the name of the syscall, which may differ from
-#        the exported function name (example: the exit syscall is implemented by the _exit()
-#        function, which is not the same as the standard C exit() function which calls it)
-
-#      - alias_list is optional comma separated list of function aliases
-#
-#      - The call_id parameter, given that func_name and syscall_name have
-#        been provided, allows the user to specify dispatch style syscalls.
-#        For example, socket() syscall on i386 actually becomes:
-#          socketcall(__NR_socket, 1, *(rest of args on stack)).
-#
-#      - Each parameter type is assumed to be stored in 32 bits.
-#
 # This file is processed by a python script named genseccomp.py.
 
 # syscalls needed to boot android
-int	pivot_root:pivot_root(const char *new_root, const char *put_old)	arm64,x86_64,mips64
-int	ioprio_get:ioprio_get(int which, int who)	arm64,x86_64,mips64
-int	ioprio_set:ioprio_set(int which, int who, int ioprio)	arm64,x86_64,mips64
+int	pivot_root:pivot_root(const char *new_root, const char *put_old)	lp64
+int	ioprio_get:ioprio_get(int which, int who)	lp64
+int	ioprio_set:ioprio_set(int which, int who, int ioprio)	lp64
 pid_t	gettid:gettid()	all
 int	futex:futex(int *uaddr, int futex_op, int val, const struct timespec *timeout, int *uaddr2, int val3)	all
 int	clone:clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ..) all
-int	sigreturn:sigreturn(unsigned long __unused)	arm,x86,mips
+int	sigreturn:sigreturn(unsigned long __unused)	lp32
 int	rt_sigreturn:rt_sigreturn(unsigned long __unused)	all
 int	rt_tgsigqueueinfo:int rt_tgsigqueueinfo(pid_t tgid, pid_t tid, int sig, siginfo_t *uinfo)	all
 int	restart_syscall:int restart_syscall()	all
-int	fstatat64|fstatat:newfstatat(int, const char*, struct stat*, int)	mips64
-int	fstat64|fstat:fstat(int, struct stat*)	mips64
-int	_flush_cache:cacheflush(char* addr, const int nbytes, const int op)	mips64
 
 # vfork is used by java.lang.ProcessBuilder
 pid_t	vfork:vfork()	arm,x86,x86_64
diff --git a/libc/SECCOMP_WHITELIST_SYSTEM.TXT b/libc/SECCOMP_WHITELIST_SYSTEM.TXT
index 155867f..266fe30 100644
--- a/libc/SECCOMP_WHITELIST_SYSTEM.TXT
+++ b/libc/SECCOMP_WHITELIST_SYSTEM.TXT
@@ -1,28 +1,6 @@
 # This file is used to populate seccomp's whitelist policy in combination with SYSCALLS.TXT.
 # Note that the resultant policy is applied only to zygote spawned processes.
 #
-# Each non-blank, non-comment line has the following format:
-#
-# return_type func_name[|alias_list][:syscall_name[:socketcall_id]]([parameter_list]) arch_list
-#
-# where:
-#       arch_list ::= "all" | arch+
-#       arch      ::= "arm" | "arm64" | "mips" | "mips64" | "x86" | "x86_64"
-#
-# Note:
-#      - syscall_name corresponds to the name of the syscall, which may differ from
-#        the exported function name (example: the exit syscall is implemented by the _exit()
-#        function, which is not the same as the standard C exit() function which calls it)
-
-#      - alias_list is optional comma separated list of function aliases
-#
-#      - The call_id parameter, given that func_name and syscall_name have
-#        been provided, allows the user to specify dispatch style syscalls.
-#        For example, socket() syscall on i386 actually becomes:
-#          socketcall(__NR_socket, 1, *(rest of args on stack)).
-#
-#      - Each parameter type is assumed to be stored in 32 bits.
-#
 # This file is processed by a python script named genseccomp.py.
 
 int bpf(int cmd, union bpf_attr *attr, unsigned int size) all
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index 1343e4e..571df22 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -5,8 +5,9 @@
 # return_type func_name[|alias_list][:syscall_name[:socketcall_id]]([parameter_list]) arch_list
 #
 # where:
-#       arch_list ::= "all" | "lp32" | "lp64" | arch+
-#       arch      ::= "arm" | "arm64" | "mips" | "mips64" | "x86" | "x86_64"
+#       arch_list ::= "all" | arches
+#       arches    ::= arch |  arch "," arches
+#       arch      ::= "arm" | "arm64" | "x86" | "x86_64" | "lp32" | "lp64"
 #
 # Note:
 #      - syscall_name corresponds to the name of the syscall, which may differ from
@@ -27,35 +28,35 @@
 
 int     execve(const char*, char* const*, char* const*)  all
 
-uid_t   getuid:getuid32()         arm,x86
-uid_t   getuid:getuid()           arm64,mips,mips64,x86_64
-gid_t   getgid:getgid32()         arm,x86
-gid_t   getgid:getgid()           arm64,mips,mips64,x86_64
-uid_t   geteuid:geteuid32()       arm,x86
-uid_t   geteuid:geteuid()         arm64,mips,mips64,x86_64
-gid_t   getegid:getegid32()       arm,x86
-gid_t   getegid:getegid()         arm64,mips,mips64,x86_64
-uid_t   getresuid:getresuid32(uid_t* ruid, uid_t* euid, uid_t* suid)   arm,x86
-uid_t   getresuid:getresuid(uid_t* ruid, uid_t* euid, uid_t* suid)     arm64,mips,mips64,x86_64
-gid_t   getresgid:getresgid32(gid_t* rgid, gid_t* egid, gid_t* sgid)   arm,x86
-gid_t   getresgid:getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid)     arm64,mips,mips64,x86_64
+uid_t   getuid:getuid32()         lp32
+uid_t   getuid:getuid()           lp64
+gid_t   getgid:getgid32()         lp32
+gid_t   getgid:getgid()           lp64
+uid_t   geteuid:geteuid32()       lp32
+uid_t   geteuid:geteuid()         lp64
+gid_t   getegid:getegid32()       lp32
+gid_t   getegid:getegid()         lp64
+uid_t   getresuid:getresuid32(uid_t* ruid, uid_t* euid, uid_t* suid)   lp32
+uid_t   getresuid:getresuid(uid_t* ruid, uid_t* euid, uid_t* suid)     lp64
+gid_t   getresgid:getresgid32(gid_t* rgid, gid_t* egid, gid_t* sgid)   lp32
+gid_t   getresgid:getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid)     lp64
 ssize_t readahead(int, off64_t, size_t)     all
-int     getgroups:getgroups32(int, gid_t*)    arm,x86
-int     getgroups:getgroups(int, gid_t*)      arm64,mips,mips64,x86_64
+int     getgroups:getgroups32(int, gid_t*)    lp32
+int     getgroups:getgroups(int, gid_t*)      lp64
 pid_t   getpgid(pid_t)             all
 pid_t   getppid()                  all
 pid_t   getsid(pid_t)              all
 pid_t   setsid()                   all
-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     setreuid:setreuid32(uid_t, uid_t)   arm,x86
-int     setreuid:setreuid(uid_t, uid_t)     arm64,mips,mips64,x86_64
-int     setresuid:setresuid32(uid_t, uid_t, uid_t)   arm,x86
-int     setresuid:setresuid(uid_t, 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
+int     setgid:setgid32(gid_t)     lp32
+int     setgid:setgid(gid_t)       lp64
+int     setuid:setuid32(uid_t)    lp32
+int     setuid:setuid(uid_t)      lp64
+int     setreuid:setreuid32(uid_t, uid_t)   lp32
+int     setreuid:setreuid(uid_t, uid_t)     lp64
+int     setresuid:setresuid32(uid_t, uid_t, uid_t)   lp32
+int     setresuid:setresuid(uid_t, uid_t, uid_t)     lp64
+int     setresgid:setresgid32(gid_t, gid_t, gid_t)   lp32
+int     setresgid:setresgid(gid_t, gid_t, gid_t)     lp64
 void*   __brk:brk(void*)           all
 int     kill(pid_t, int)           all
 int     tgkill(pid_t tgid, pid_t tid, int sig)  all
@@ -67,19 +68,18 @@
 int setpriority(int, id_t, int)   all
 # On LP64, rlimit and rlimit64 are the same.
 # On 32-bit systems we use prlimit64 to implement the rlimit64 functions.
-int getrlimit:ugetrlimit(int, struct rlimit*)  arm,x86
-int getrlimit(int, struct rlimit*)  mips
+int getrlimit:ugetrlimit(int, struct rlimit*)  lp32
 int getrlimit|getrlimit64(int, struct rlimit*)  lp64
 int setrlimit(int, const struct rlimit*)  lp32
 int setrlimit|setrlimit64(int, const struct rlimit*)  lp64
 int prlimit64|prlimit(pid_t, int, struct rlimit64*, const struct rlimit64*)  lp64
 int prlimit64(pid_t, int, struct rlimit64*, const struct rlimit64*)  lp32
 
-int     setgroups:setgroups32(int, const gid_t*)   arm,x86
-int     setgroups:setgroups(int, const gid_t*)     arm64,mips,mips64,x86_64
+int     setgroups:setgroups32(int, const gid_t*)   lp32
+int     setgroups:setgroups(int, const gid_t*)     lp64
 int     setpgid(pid_t, pid_t)  all
-int     setregid:setregid32(gid_t, gid_t)  arm,x86
-int     setregid:setregid(gid_t, gid_t)    arm64,mips,mips64,x86_64
+int     setregid:setregid32(gid_t, gid_t)  lp32
+int     setregid:setregid(gid_t, gid_t)    lp64
 int     chroot(const char*)  all
 int     prctl(int, unsigned long, unsigned long, unsigned long, unsigned long) all
 long    __arch_prctl:arch_prctl(int, unsigned long) x86_64
@@ -131,8 +131,8 @@
 int         __dup3:dup3(int, int, int)   all
 int         fsync(int)  all
 int         fdatasync(int) all
-int         fchown:fchown32(int, uid_t, gid_t)  arm,x86
-int         fchown:fchown(int, uid_t, gid_t)    arm64,mips,mips64,x86_64
+int         fchown:fchown32(int, uid_t, gid_t)  lp32
+int         fchown:fchown(int, uid_t, gid_t)    lp64
 void        sync(void)  all
 int         syncfs(int)  all
 int         __fsetxattr:fsetxattr(int, const char*, const void*, size_t, int) all
@@ -140,7 +140,7 @@
 ssize_t     __flistxattr:flistxattr(int, char*, size_t) all
 int         fremovexattr(int, const char*) all
 
-int __getdents64:getdents64(unsigned int, struct dirent*, unsigned int)   arm,arm64,mips,mips64,x86,x86_64
+int __getdents64:getdents64(unsigned int, struct dirent*, unsigned int)   all
 
 int __openat:openat(int, const char*, int, mode_t) all
 int __faccessat:faccessat(int, const char*, int)  all
@@ -184,7 +184,7 @@
 # the POSIX functions don't set errno, and no architecture has posix_fadvise.
 int __arm_fadvise64_64:arm_fadvise64_64(int, int, off64_t, off64_t) arm
 int __fadvise64:fadvise64_64(int, off64_t, off64_t, int) x86
-int __fadvise64:fadvise64(int, off64_t, off64_t, int) arm64,mips,mips64,x86_64
+int __fadvise64:fadvise64(int, off64_t, off64_t, int) lp64
 
 int __fstatfs64:fstatfs64(int, size_t, struct statfs*)  lp32
 int __fstatfs:fstatfs(int, struct statfs*)  lp64
@@ -241,23 +241,23 @@
 int     __signalfd4:signalfd4(int, const sigset64_t*, size_t, int)  all
 
 # sockets
-int           __socket:socket(int, int, int)              arm,arm64,mips,mips64,x86_64
-int           socketpair(int, int, int, int*)    arm,arm64,mips,mips64,x86_64
-int           bind(int, struct sockaddr*, socklen_t)  arm,arm64,mips,mips64,x86_64
-int           __connect:connect(int, struct sockaddr*, socklen_t)   arm,arm64,mips,mips64,x86_64
-int           listen(int, int)                   arm,arm64,mips,mips64,x86_64
-int           __accept4:accept4(int, struct sockaddr*, socklen_t*, int)  arm,arm64,mips,mips64,x86_64
-int           getsockname(int, struct sockaddr*, socklen_t*)  arm,arm64,mips,mips64,x86_64
-int           getpeername(int, struct sockaddr*, socklen_t*)  arm,arm64,mips,mips64,x86_64
-ssize_t       __sendto:sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t)  arm,arm64,mips,mips64,x86_64
-ssize_t       recvfrom(int, void*, size_t, unsigned int, struct sockaddr*, socklen_t*)  arm,arm64,mips,mips64,x86_64
-int           shutdown(int, int)  arm,arm64,mips,mips64,x86_64
-int           setsockopt(int, int, int, const void*, socklen_t)  arm,arm64,mips,mips64,x86_64
-int           getsockopt(int, int, int, void*, socklen_t*)    arm,arm64,mips,mips64,x86_64
-ssize_t       __recvmsg:recvmsg(int, struct msghdr*, unsigned int)   arm,arm64,mips,mips64,x86_64
-ssize_t       __sendmsg:sendmsg(int, const struct msghdr*, unsigned int)  arm,arm64,mips,mips64,x86_64
-int           __recvmmsg:recvmmsg(int, struct mmsghdr*, unsigned int, int, const struct timespec*)   arm,arm64,mips,mips64,x86_64
-int           __sendmmsg:sendmmsg(int, struct mmsghdr*, unsigned int, int)   arm,arm64,mips,mips64,x86_64
+int           __socket:socket(int, int, int)              arm,lp64
+int           socketpair(int, int, int, int*)    arm,lp64
+int           bind(int, struct sockaddr*, socklen_t)  arm,lp64
+int           __connect:connect(int, struct sockaddr*, socklen_t)   arm,lp64
+int           listen(int, int)                   arm,lp64
+int           __accept4:accept4(int, struct sockaddr*, socklen_t*, int)  arm,lp64
+int           getsockname(int, struct sockaddr*, socklen_t*)  arm,lp64
+int           getpeername(int, struct sockaddr*, socklen_t*)  arm,lp64
+ssize_t       __sendto:sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t)  arm,lp64
+ssize_t       recvfrom(int, void*, size_t, unsigned int, struct sockaddr*, socklen_t*)  arm,lp64
+int           shutdown(int, int)  arm,lp64
+int           setsockopt(int, int, int, const void*, socklen_t)  arm,lp64
+int           getsockopt(int, int, int, void*, socklen_t*)    arm,lp64
+ssize_t       __recvmsg:recvmsg(int, struct msghdr*, unsigned int)   arm,lp64
+ssize_t       __sendmsg:sendmsg(int, const struct msghdr*, unsigned int)  arm,lp64
+int           __recvmmsg:recvmmsg(int, struct mmsghdr*, unsigned int, int, const struct timespec*)   arm,lp64
+int           __sendmmsg:sendmmsg(int, struct mmsghdr*, unsigned int, int)   arm,lp64
 
 # sockets for x86. These are done as an "indexed" call to socketcall syscall.
 int           __socket:socketcall:1(int, int, int) x86
@@ -336,7 +336,7 @@
 int setdomainname(const char*, size_t)  all
 int sethostname(const char*, size_t)  all
 
-int __sync_file_range:sync_file_range(int, off64_t, off64_t, unsigned int) arm64,mips,mips64,x86,x86_64
+int __sync_file_range:sync_file_range(int, off64_t, off64_t, unsigned int) arm64,x86,x86_64
 int __sync_file_range2:sync_file_range2(int, unsigned int, off64_t, off64_t) arm
 
 pid_t wait4(pid_t, int*, int, struct rusage*)  all
@@ -346,10 +346,6 @@
 int     __set_tls:__ARM_NR_set_tls(void*)                                 arm
 int     cacheflush:__ARM_NR_cacheflush(long start, long end, long flags)  arm
 
-# MIPS-specific
-int     _flush_cache:cacheflush(char* addr, const int nbytes, const int op) mips
-int     __set_tls:set_thread_area(void*) mips,mips64
-
 # x86-specific
 int     __set_thread_area:set_thread_area(void*) x86
 
diff --git a/libc/include/android/versioning.h b/libc/include/android/versioning.h
index c7e844a..3ea414a 100644
--- a/libc/include/android/versioning.h
+++ b/libc/include/android/versioning.h
@@ -27,7 +27,6 @@
 #define __INTRODUCED_IN_64(api_level) __attribute__((annotate("introduced_in_64=" #api_level)))
 #define __INTRODUCED_IN_ARM(api_level) __attribute__((annotate("introduced_in_arm=" #api_level)))
 #define __INTRODUCED_IN_X86(api_level) __attribute__((annotate("introduced_in_x86=" #api_level)))
-#define __INTRODUCED_IN_MIPS(api_level)
 
 #define __VERSIONER_NO_GUARD __attribute__((annotate("versioner_no_guard")))
 #define __VERSIONER_FORTIFY_INLINE __attribute__((annotate("versioner_fortify_inline")))
@@ -41,7 +40,6 @@
 #define __INTRODUCED_IN_64(api_level)
 #define __INTRODUCED_IN_ARM(api_level)
 #define __INTRODUCED_IN_X86(api_level)
-#define __INTRODUCED_IN_MIPS(api_level)
 
 #define __VERSIONER_NO_GUARD
 #define __VERSIONER_FORTIFY_INLINE
diff --git a/libc/include/bits/signal_types.h b/libc/include/bits/signal_types.h
index 881ac58..e1a155f 100644
--- a/libc/include/bits/signal_types.h
+++ b/libc/include/bits/signal_types.h
@@ -26,15 +26,14 @@
  * SUCH DAMAGE.
  */
 
-#ifndef _BITS_SIGNAL_TYPES_H_
-#define _BITS_SIGNAL_TYPES_H_
+#pragma once
 
 #include <limits.h>
 #include <sys/cdefs.h>
 #include <sys/types.h>
 
-/* For 64-bit (and mips), the kernel's struct sigaction doesn't match the
- * POSIX one, so we need to expose our own and translate behind the scenes.
+/* For 64-bit, the kernel's struct sigaction doesn't match the POSIX one,
+ * so we need to expose our own and translate behind the scenes.
  * For 32-bit, we're stuck with the definitions we already shipped,
  * even though they contain a sigset_t that's too small. See sigaction64.
  */
@@ -56,10 +55,10 @@
 typedef __sighandler_t sig_t; /* BSD compatibility. */
 typedef __sighandler_t sighandler_t; /* glibc compatibility. */
 
-/* sigset_t is already large enough on LP64 and mips, but other LP32's sigset_t
+/* sigset_t is already large enough on LP64, but LP32's sigset_t
  * is just `unsigned long`.
  */
-#if defined(__LP64__) || defined(__mips__)
+#if defined(__LP64__)
 typedef sigset_t sigset64_t;
 #else
 typedef struct { unsigned long __bits[_KERNEL__NSIG/LONG_BIT]; } sigset64_t;
@@ -81,21 +80,6 @@
 
 #undef __SIGACTION_BODY
 
-#elif defined(__mips__)
-
-#define __SIGACTION_BODY \
-  int sa_flags; \
-  union { \
-    sighandler_t sa_handler; \
-    void (*sa_sigaction)(int, struct siginfo*, void*); \
-  }; \
-  sigset_t sa_mask; \
-
-struct sigaction { __SIGACTION_BODY };
-struct sigaction64 { __SIGACTION_BODY };
-
-#undef __SIGACTION_BODY
-
 #else
 
 #undef sa_handler
@@ -123,5 +107,3 @@
 };
 
 #endif
-
-#endif
diff --git a/libc/include/sched.h b/libc/include/sched.h
index 52a8ca6..3260231 100644
--- a/libc/include/sched.h
+++ b/libc/include/sched.h
@@ -53,8 +53,7 @@
 
 #if defined(__USE_GNU)
 
-int clone(int (*__fn)(void*), void* __child_stack, int __flags, void* __arg, ...)
-    __INTRODUCED_IN_ARM(9) __INTRODUCED_IN_MIPS(12) __INTRODUCED_IN_X86(17);
+int clone(int (*__fn)(void*), void* __child_stack, int __flags, void* __arg, ...) __INTRODUCED_IN_ARM(9) __INTRODUCED_IN_X86(17);
 int unshare(int __flags) __INTRODUCED_IN(17);
 int sched_getcpu(void);
 int setns(int __fd, int __ns_type) __INTRODUCED_IN(21);
diff --git a/libc/include/setjmp.h b/libc/include/setjmp.h
index b22071f..3a64b33 100644
--- a/libc/include/setjmp.h
+++ b/libc/include/setjmp.h
@@ -48,12 +48,6 @@
 #define _JBLEN 64
 #elif defined(__i386__)
 #define _JBLEN 10
-#elif defined(__mips__)
-  #if defined(__LP64__)
-  #define _JBLEN 25
-  #else
-  #define _JBLEN 157
-  #endif
 #elif defined(__x86_64__)
 #define _JBLEN 11
 #endif
diff --git a/libc/include/sys/cachectl.h b/libc/include/sys/cachectl.h
index 9235327..5ec295d 100644
--- a/libc/include/sys/cachectl.h
+++ b/libc/include/sys/cachectl.h
@@ -26,12 +26,8 @@
  * SUCH DAMAGE.
  */
 
-#ifndef _SYS_CACHECTL_H
-#define _SYS_CACHECTL_H 1
+#pragma once
 
 #include <sys/cdefs.h>
-#ifdef __mips__
-#include <asm/cachectl.h>
-#endif
 
-#endif
+/* This header file is obsolete. */
diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h
index e2acab7..3ecbcce 100644
--- a/libc/include/sys/socket.h
+++ b/libc/include/sys/socket.h
@@ -46,13 +46,8 @@
 
 struct timespec;
 
-#ifdef __mips__
-#define SOCK_DGRAM      1
-#define SOCK_STREAM     2
-#else
 #define SOCK_STREAM     1
 #define SOCK_DGRAM      2
-#endif
 #define SOCK_RAW        3
 #define SOCK_RDM        4
 #define SOCK_SEQPACKET  5
diff --git a/libc/include/sys/stat.h b/libc/include/sys/stat.h
index d8e92d9..a6c73b7 100644
--- a/libc/include/sys/stat.h
+++ b/libc/include/sys/stat.h
@@ -36,7 +36,7 @@
 
 __BEGIN_DECLS
 
-#if defined(__aarch64__) || (defined(__mips__) && defined(__LP64__))
+#if defined(__aarch64__)
 #define __STAT64_BODY \
   dev_t st_dev; \
   ino_t st_ino; \
@@ -56,25 +56,6 @@
   unsigned int __unused4; \
   unsigned int __unused5; \
 
-#elif defined(__mips__) && !defined(__LP64__)
-#define __STAT64_BODY \
-  unsigned int st_dev; \
-  unsigned int __pad0[3]; \
-  unsigned long long st_ino; \
-  mode_t st_mode; \
-  nlink_t st_nlink; \
-  uid_t st_uid; \
-  gid_t st_gid; \
-  unsigned int st_rdev; \
-  unsigned int __pad1[3]; \
-  long long st_size; \
-  struct timespec st_atim; \
-  struct timespec st_mtim; \
-  struct timespec st_ctim; \
-  unsigned int st_blksize; \
-  unsigned int __pad2; \
-  unsigned long long st_blocks; \
-
 #elif defined(__x86_64__)
 #define __STAT64_BODY \
   dev_t st_dev; \
diff --git a/libc/include/sys/ucontext.h b/libc/include/sys/ucontext.h
index 730ac69..9c5801f 100644
--- a/libc/include/sys/ucontext.h
+++ b/libc/include/sys/ucontext.h
@@ -213,78 +213,6 @@
   struct _libc_fpstate __fpregs_mem;
 } ucontext_t;
 
-#elif defined(__mips__)
-
-/* glibc doesn't have names for MIPS registers. */
-
-#define NGREG 32
-#define NFPREG 32
-
-typedef unsigned long long greg_t;
-typedef greg_t gregset_t[NGREG];
-
-typedef struct fpregset {
-  union {
-    double fp_dregs[NFPREG];
-    struct {
-      float _fp_fregs;
-      unsigned _fp_pad;
-    } fp_fregs[NFPREG];
-  } fp_r;
-} fpregset_t;
-
-#ifdef __LP64__
-typedef struct {
-  gregset_t gregs;
-  fpregset_t fpregs;
-  greg_t mdhi;
-  greg_t hi1;
-  greg_t hi2;
-  greg_t hi3;
-  greg_t mdlo;
-  greg_t lo1;
-  greg_t lo2;
-  greg_t lo3;
-  greg_t pc;
-  uint32_t fpc_csr;
-  uint32_t used_math;
-  uint32_t dsp;
-  uint32_t reserved;
-} mcontext_t;
-#else
-typedef struct {
-  unsigned regmask;
-  unsigned status;
-  greg_t pc;
-  gregset_t gregs;
-  fpregset_t fpregs;
-  unsigned fp_owned;
-  unsigned fpc_csr;
-  unsigned fpc_eir;
-  unsigned used_math;
-  unsigned dsp;
-  greg_t mdhi;
-  greg_t mdlo;
-  unsigned long hi1;
-  unsigned long lo1;
-  unsigned long hi2;
-  unsigned long lo2;
-  unsigned long hi3;
-  unsigned long lo3;
-} mcontext_t;
-#endif
-
-typedef struct ucontext {
-  unsigned long uc_flags;
-  struct ucontext* uc_link;
-  stack_t uc_stack;
-  mcontext_t uc_mcontext;
-  union {
-    sigset_t uc_sigmask;
-    sigset64_t uc_sigmask64;
-  };
-} ucontext_t;
-
 #elif defined(__x86_64__)
 
 enum {
diff --git a/libc/include/sys/user.h b/libc/include/sys/user.h
index ed3e10a..2392edd 100644
--- a/libc/include/sys/user.h
+++ b/libc/include/sys/user.h
@@ -172,22 +172,6 @@
   unsigned long fault_address;
 };
 
-#elif defined(__mips__)
-
-struct user {
-  unsigned long regs[180 / sizeof(unsigned long) + 64];
-  size_t u_tsize;
-  size_t u_dsize;
-  size_t u_ssize;
-  unsigned long start_code;
-  unsigned long start_data;
-  unsigned long start_stack;
-  long int signal;
-  void* u_ar0;
-  unsigned long magic;
-  char u_comm[32];
-};
-
 #elif defined(__arm__)
 
 struct user_fpregs {
diff --git a/libc/include/sys/vfs.h b/libc/include/sys/vfs.h
index 9237ee6..ad859f0 100644
--- a/libc/include/sys/vfs.h
+++ b/libc/include/sys/vfs.h
@@ -39,7 +39,7 @@
 typedef struct { int __val[2]; } __fsid_t;
 typedef __fsid_t fsid_t;
 
-#if defined(__aarch64__) || defined(__x86_64__)
+#if defined(__LP64__)
 #define __STATFS64_BODY \
   uint64_t f_type; \
   uint64_t f_bsize; \
@@ -54,39 +54,6 @@
   uint64_t f_flags; \
   uint64_t f_spare[4]; \
 
-#elif defined(__mips__) && defined(__LP64__)
-/* 64-bit MIPS. */
-#define __STATFS64_BODY \
-  uint64_t f_type; \
-  uint64_t f_bsize; \
-  uint64_t f_frsize; /* Fragment size - unsupported. */ \
-  uint64_t f_blocks; \
-  uint64_t f_bfree; \
-  uint64_t f_files; \
-  uint64_t f_ffree; \
-  uint64_t f_bavail; \
-  fsid_t f_fsid; \
-  uint64_t f_namelen; \
-  uint64_t f_flags; \
-  uint64_t f_spare[5]; \
-
-#elif defined(__mips__)
-/* 32-bit MIPS (corresponds to the kernel's statfs64 type). */
-#define __STATFS64_BODY \
-  uint32_t f_type; \
-  uint32_t f_bsize; \
-  uint32_t f_frsize; \
-  uint32_t __pad; \
-  uint64_t f_blocks; \
-  uint64_t f_bfree; \
-  uint64_t f_files; \
-  uint64_t f_ffree; \
-  uint64_t f_bavail; \
-  fsid_t f_fsid; \
-  uint32_t f_namelen; \
-  uint32_t f_flags; \
-  uint32_t f_spare[5]; \
-
 #else
 /* 32-bit ARM or x86 (corresponds to the kernel's statfs64 type). */
 #define __STATFS64_BODY \
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index e4afd8e..aaa8f22 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -294,7 +294,7 @@
 
 int daemon(int __no_chdir, int __no_close);
 
-#if defined(__arm__) || (defined(__mips__) && !defined(__LP64__))
+#if defined(__arm__)
 int cacheflush(long __addr, long __nbytes, long __cache);
     /* __attribute__((deprecated("use __builtin___clear_cache instead"))); */
 #endif
diff --git a/libc/platform/bionic/macros.h b/libc/platform/bionic/macros.h
index 54903f5..28a69e6 100644
--- a/libc/platform/bionic/macros.h
+++ b/libc/platform/bionic/macros.h
@@ -57,8 +57,6 @@
 #define BIONIC_STOP_UNWIND asm volatile(".cfi_undefined \%eip")
 #elif defined(__x86_64__)
 #define BIONIC_STOP_UNWIND asm volatile(".cfi_undefined \%rip")
-#elif defined (__mips__)
-#define BIONIC_STOP_UNWIND asm volatile(".cfi_undefined $ra")
 #endif
 
 // The arraysize(arr) macro returns the # of elements in an array arr.
diff --git a/libc/platform/bionic/tls.h b/libc/platform/bionic/tls.h
index ca39020..bf9e65b 100644
--- a/libc/platform/bionic/tls.h
+++ b/libc/platform/bionic/tls.h
@@ -32,15 +32,6 @@
 # define __get_tls() ({ void** __val; __asm__("mrs %0, tpidr_el0" : "=r"(__val)); __val; })
 #elif defined(__arm__)
 # define __get_tls() ({ void** __val; __asm__("mrc p15, 0, %0, c13, c0, 3" : "=r"(__val)); __val; })
-#elif defined(__mips__)
-# define __get_tls() \
-    /* On mips32r1, this goes via a kernel illegal instruction trap that's optimized for v1. */ \
-    ({ register void** __val asm("v1"); \
-       __asm__(".set    push\n" \
-               ".set    mips32r2\n" \
-               "rdhwr   %0,$29\n" \
-               ".set    pop\n" : "=r"(__val)); \
-       __val; })
 #elif defined(__i386__)
 # define __get_tls() ({ void** __val; __asm__("movl %%gs:0, %0" : "=r"(__val)); __val; })
 #elif defined(__x86_64__)
diff --git a/libc/private/bionic_asm.h b/libc/private/bionic_asm.h
index 30842f4..6409563 100644
--- a/libc/private/bionic_asm.h
+++ b/libc/private/bionic_asm.h
@@ -42,8 +42,6 @@
 #include <private/bionic_asm_arm.h>
 #elif defined(__i386__)
 #include <private/bionic_asm_x86.h>
-#elif defined(__mips__)
-#include <private/bionic_asm_mips.h>
 #elif defined(__x86_64__)
 #include <private/bionic_asm_x86_64.h>
 #endif
diff --git a/libc/private/bionic_asm_mips.h b/libc/private/bionic_asm_mips.h
deleted file mode 100644
index 99dcfb1..0000000
--- a/libc/private/bionic_asm_mips.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*	$OpenBSD: asm.h,v 1.7 2004/10/20 12:49:15 pefo Exp $ */
-
-/*
- * Copyright (c) 2001-2002 Opsycon AB  (www.opsycon.se / www.opsycon.com)
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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
-
-#define __bionic_asm_align 16
-
-#undef __bionic_asm_custom_entry
-#undef __bionic_asm_custom_end
-#define __bionic_asm_custom_entry(f) .ent f
-#define __bionic_asm_custom_end(f) .end f
-
-#define	_MIPS_ISA_MIPS1	1	/* R2000/R3000 */
-#define	_MIPS_ISA_MIPS2	2	/* R4000/R6000 */
-#define	_MIPS_ISA_MIPS3	3	/* R4000 */
-#define	_MIPS_ISA_MIPS4	4	/* TFP (R1x000) */
-#define	_MIPS_ISA_MIPS5 5
-#define	_MIPS_ISA_MIPS32 6
-#define	_MIPS_ISA_MIPS64 7
-
-#if !defined(ABICALLS) && !defined(_NO_ABICALLS)
-#define	ABICALLS	.abicalls
-#endif
-
-#if defined(ABICALLS) && !defined(_KERNEL)
-	ABICALLS
-#endif
-
-/*
- * Define how to access unaligned data word
- */
-#define LWLO    lwl
-#define LWHI    lwr
-#define	SWLO	swl
-#define	SWHI	swr
-#define LDLO    ldl
-#define LDHI    ldr
-#define	SDLO	sdl
-#define	SDHI	sdr
-
-/*
- *  Define programming environment for ABI.
- */
-#if defined(ABICALLS) && !defined(_KERNEL) && !defined(_STANDALONE)
-
-#if (_MIPS_SIM == _ABIO32) || (_MIPS_SIM == _ABI32)
-#define NARGSAVE	4
-
-#define	SETUP_GP		\
-	.set	noreorder;	\
-	.cpload	$t9;		\
-	.set	reorder;
-
-#define	SAVE_GP(x)		\
-	.cprestore x
-
-#define	SETUP_GP64(gpoff, name)
-#define	RESTORE_GP64
-#endif
-
-#if (_MIPS_SIM == _ABI64) || (_MIPS_SIM == _ABIN32)
-#define NARGSAVE	0
-
-#define	SETUP_GP
-#define	SAVE_GP(x)
-#define	SETUP_GP64(gpoff, name)	\
-	.cpsetup $t9, gpoff, name
-#define	RESTORE_GP64		\
-	.cpreturn
-#endif
-
-#define	MKFSIZ(narg,locals) (((narg+locals)*REGSZ+31)&(~31))
-
-#else /* defined(ABICALLS) && !defined(_KERNEL) */
-
-#define	NARGSAVE	4
-#define	SETUP_GP
-#define	SAVE_GP(x)
-
-#define	ALIGNSZ		16	/* Stack layout alignment */
-#define	FRAMESZ(sz)	(((sz) + (ALIGNSZ-1)) & ~(ALIGNSZ-1))
-
-#endif
-
-/*
- *  Basic register operations based on selected ISA
- */
-#if (_MIPS_ISA == _MIPS_ISA_MIPS1 || _MIPS_ISA == _MIPS_ISA_MIPS2 || _MIPS_ISA == _MIPS_ISA_MIPS32)
-#define REGSZ		4	/* 32 bit mode register size */
-#define LOGREGSZ	2	/* log rsize */
-#define	REG_S	sw
-#define	REG_L	lw
-#define	CF_SZ		24	/* Call frame size */
-#define	CF_ARGSZ	16	/* Call frame arg size */
-#define	CF_RA_OFFS	20	/* Call ra save offset */
-#endif
-
-#if (_MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4 || _MIPS_ISA == _MIPS_ISA_MIPS64)
-#define REGSZ		8	/* 64 bit mode register size */
-#define LOGREGSZ	3	/* log rsize */
-#define	REG_S	sd
-#define	REG_L	ld
-#define	CF_SZ		48	/* Call frame size (multiple of ALIGNSZ) */
-#define	CF_ARGSZ	32	/* Call frame arg size */
-#define	CF_RA_OFFS	40	/* Call ra save offset */
-#endif
-
-#define REGSZ_FP	 8	/* 64 bit FP register size */
-
-#ifndef __LP64__
-#define	PTR_L		lw
-#define	PTR_S		sw
-#define	PTR_SUB		sub
-#define	PTR_ADD		add
-#define	PTR_SUBU	subu
-#define	PTR_ADDU	addu
-#define LI		li
-#define	LA		la
-#define	PTR_SLL		sll
-#define	PTR_SRL		srl
-#define	PTR_VAL		.word
-#else
-#define	PTR_L		ld
-#define	PTR_S		sd
-#define	PTR_ADD		dadd
-#define	PTR_SUB		dsub
-#define	PTR_SUBU	dsubu
-#define	PTR_ADDU	daddu
-#define LI		dli
-#define LA		dla
-#define	PTR_SLL		dsll
-#define	PTR_SRL		dsrl
-#define	PTR_VAL		.dword
-#endif
-
-/*
- * LEAF(x, fsize)
- *
- *	Declare a leaf routine.
- */
-#define LEAF(x, fsize)		\
-	.align	3;		\
-	.globl x;		\
-	.ent x, 0;		\
-x: ;				\
-	.cfi_startproc; \
-	.frame $sp, fsize, $ra;	\
-	SETUP_GP		\
-
-/*
- * NON_LEAF(x)
- *
- *	Declare a non-leaf routine (a routine that makes other C calls).
- */
-#define NON_LEAF(x, fsize, retpc) \
-	.align	3;		\
-	.globl x;		\
-	.ent x, 0;		\
-x: ;				\
-	.cfi_startproc; \
-	.frame $sp, fsize, retpc; \
-	SETUP_GP		\
diff --git a/libc/private/bionic_ssp.h b/libc/private/bionic_ssp.h
index 9883d72..ea62cb9 100644
--- a/libc/private/bionic_ssp.h
+++ b/libc/private/bionic_ssp.h
@@ -26,20 +26,18 @@
  * SUCH DAMAGE.
  */
 
-#ifndef _PRIVATE_SSP_H
-#define _PRIVATE_SSP_H
+#pragma once
 
 #include <stdint.h>
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
 
-/* GCC uses this on ARM and MIPS; we use it on x86 to set the guard in TLS. */
+// The compiler uses this if it's not using TLS.
+// Currently that's on arm32 and on x86 before API 17.
 extern uintptr_t __stack_chk_guard;
 
-/* GCC calls this if a stack guard check fails. */
+// The compiler calls this if a stack guard check fails.
 extern void __stack_chk_fail();
 
 __END_DECLS
-
-#endif
diff --git a/libc/seccomp/seccomp_bpfs.h b/libc/seccomp/seccomp_bpfs.h
index 8245429..3bdffa9 100644
--- a/libc/seccomp/seccomp_bpfs.h
+++ b/libc/seccomp/seccomp_bpfs.h
@@ -46,17 +46,3 @@
 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 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 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;
diff --git a/libc/seccomp/seccomp_policy.cpp b/libc/seccomp/seccomp_policy.cpp
index bce7b14..65357fc 100644
--- a/libc/seccomp/seccomp_policy.cpp
+++ b/libc/seccomp/seccomp_policy.cpp
@@ -75,29 +75,6 @@
 
 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 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 long secondary_setresgid = __mips_setresgid;
-static const long secondary_setresuid = __mips_setresuid;
 #else
 #error No architecture was defined!
 #endif
diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py
index fa5420b..0271a04 100755
--- a/libc/tools/gensyscalls.py
+++ b/libc/tools/gensyscalls.py
@@ -81,56 +81,6 @@
 
 
 #
-# MIPS assembler template for each syscall stub
-#
-
-mips_call = syscall_stub_header + """\
-    .set noreorder
-    .cpload $t9
-    li $v0, %(__NR_name)s
-    syscall
-    bnez $a3, 1f
-    move $a0, $v0
-    j $ra
-    nop
-1:
-    la $t9,__set_errno_internal
-    j $t9
-    nop
-    .set reorder
-END(%(func)s)
-"""
-
-
-#
-# MIPS64 assembler template for each syscall stub
-#
-
-mips64_call = syscall_stub_header + """\
-    .set push
-    .set noreorder
-    li $v0, %(__NR_name)s
-    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(%(func)s)
-"""
-
-
-#
 # x86 assembler templates for each syscall stub
 #
 
@@ -279,14 +229,6 @@
     return arm64_call % syscall
 
 
-def mips_genstub(syscall):
-    return mips_call % syscall
-
-
-def mips64_genstub(syscall):
-    return mips64_call % syscall
-
-
 def x86_genstub(syscall):
     result     = syscall_stub_header % syscall
 
@@ -455,21 +397,18 @@
         if arch_list == "all":
             for arch in SupportedArchitectures:
                 t[arch] = True
-        elif arch_list == "lp32":
-            for arch in SupportedArchitectures:
-                if "64" not in arch:
-                    t[arch] = True
-        elif arch_list == "lp64":
-            for arch in SupportedArchitectures:
-                if "64" in arch:
-                    t[arch] = True
         else:
             for arch in string.split(arch_list, ','):
-                if arch in SupportedArchitectures:
+                if arch == "lp32":
+                    for arch in SupportedArchitectures:
+                        if "64" not in arch:
+                          t[arch] = True
+                elif arch == "lp64":
+                    for arch in SupportedArchitectures:
+                        if "64" in arch:
+                            t[arch] = True
+                elif arch in SupportedArchitectures:
                     t[arch] = True
-                elif arch in ['mips', 'mips64']:
-                    # Unused.
-                    pass
                 else:
                     E("invalid syscall architecture '%s' in '%s'" % (arch, line))
                     return
@@ -511,12 +450,6 @@
             E("socketcall_id for dispatch syscalls is only supported for x86 in '%s'" % t)
             return
 
-        if syscall.has_key("mips"):
-            syscall["asm-mips"] = add_footer(32, mips_genstub(syscall), syscall)
-
-        if syscall.has_key("mips64"):
-            syscall["asm-mips64"] = add_footer(64, mips64_genstub(syscall), syscall)
-
         if syscall.has_key("x86_64"):
             syscall["asm-x86_64"] = add_footer(64, x86_64_genstub(syscall), syscall)
 
diff --git a/libc/tools/test_genseccomp.py b/libc/tools/test_genseccomp.py
index 71a78d1..0c2699a 100755
--- a/libc/tools/test_genseccomp.py
+++ b/libc/tools/test_genseccomp.py
@@ -25,8 +25,8 @@
 
   def test_get_names(self):
     bionic = cStringIO.StringIO(textwrap.dedent("""\
-int __llseek:_llseek(int, unsigned long, unsigned long, off64_t*, int) arm,mips,x86
-int         fchown:fchown(int, uid_t, gid_t)    arm64,mips,mips64,x86_64
+int __llseek:_llseek(int, unsigned long, unsigned long, off64_t*, int) arm,x86
+int         fchown:fchown(int, uid_t, gid_t)    arm64,x86_64
     """))
 
     whitelist = cStringIO.StringIO(textwrap.dedent("""\
@@ -54,7 +54,7 @@
 
     # Blacklist item must be in bionic
     blacklist = cStringIO.StringIO(textwrap.dedent("""\
-int         fchown2:fchown2(int, uid_t, gid_t)    arm64,mips,mips64,x86_64
+int         fchown2:fchown2(int, uid_t, gid_t)    arm64,x86_64
     """))
     with self.assertRaises(RuntimeError):
       genseccomp.get_names([bionic, whitelist, blacklist], "arm")
@@ -64,7 +64,7 @@
 
     # Test blacklist item is removed
     blacklist = cStringIO.StringIO(textwrap.dedent("""\
-int         fchown:fchown(int, uid_t, gid_t)    arm64,mips,mips64,x86_64
+int         fchown:fchown(int, uid_t, gid_t)    arm64,x86_64
     """))
     names = genseccomp.get_names([bionic, whitelist, blacklist], "arm64")
     bionic.seek(0)
@@ -75,7 +75,7 @@
 
     # Blacklist item must not be in whitelist
     whitelist = cStringIO.StringIO(textwrap.dedent("""\
-int         fchown:fchown(int, uid_t, gid_t)    arm64,mips,mips64,x86_64
+int         fchown:fchown(int, uid_t, gid_t)    arm64,x86_64
     """))
     with self.assertRaises(RuntimeError):
       genseccomp.get_names([empty, whitelist, blacklist], "arm")
@@ -85,7 +85,7 @@
 
     # No dups in bionic and whitelist
     whitelist = cStringIO.StringIO(textwrap.dedent("""\
-int __llseek:_llseek(int, unsigned long, unsigned long, off64_t*, int) arm,mips,x86
+int __llseek:_llseek(int, unsigned long, unsigned long, off64_t*, int) arm,x86
     """))
     with self.assertRaises(RuntimeError):
       genseccomp.get_names([bionic, whitelist, empty], "arm")
@@ -119,16 +119,6 @@
                                                       self.get_switches("x86_64")),
                       [("openat", 257)])
 
-    self.assertEquals(genseccomp.convert_names_to_NRs(["openat"],
-                                                      self.get_headers("mips"),
-                                                      self.get_switches("mips")),
-                      [("openat", 4288)])
-
-    self.assertEquals(genseccomp.convert_names_to_NRs(["openat"],
-                                                      self.get_headers("mips64"),
-                                                      self.get_switches("mips64")),
-                      [("openat", 5247)])
-
 
   def test_convert_NRs_to_ranges(self):
     ranges = genseccomp.convert_NRs_to_ranges([("b", 2), ("a", 1)])
@@ -192,8 +182,8 @@
 
   def test_construct_bpf(self):
     syscalls = cStringIO.StringIO(textwrap.dedent("""\
-    int __llseek:_llseek(int, unsigned long, unsigned long, off64_t*, int) arm,mips,x86
-    int         fchown:fchown(int, uid_t, gid_t)    arm64,mips,mips64,x86_64
+    int __llseek:_llseek(int, unsigned long, unsigned long, off64_t*, int) arm,x86
+    int         fchown:fchown(int, uid_t, gid_t)    arm64,x86_64
     """))
 
     whitelist = cStringIO.StringIO(textwrap.dedent("""\
diff --git a/linker/Android.bp b/linker/Android.bp
index d2d5f8a..4be080b 100644
--- a/linker/Android.bp
+++ b/linker/Android.bp
@@ -205,22 +205,6 @@
     ],
 }
 
-filegroup {
-    name: "linker_sources_mips",
-    srcs: [
-        "arch/mips/begin.S",
-        "linker_mips.cpp",
-    ],
-}
-
-filegroup {
-    name: "linker_sources_mips64",
-    srcs: [
-        "arch/mips64/begin.S",
-        "linker_mips.cpp",
-    ],
-}
-
 cc_defaults {
     name: "linker_version_script_overlay",
     arch: {
@@ -228,8 +212,6 @@
         arm64:  { version_script: "linker.generic.map"  },
         x86:    { version_script: "linker.generic.map"  },
         x86_64: { version_script: "linker.generic.map"  },
-        mips:   { version_script: "linker.generic.map"  },
-        mips64: { version_script: "linker.generic.map"  },
     },
 }
 
@@ -257,14 +239,6 @@
             srcs: [":linker_sources_x86_64"],
             static_libs: ["libgcc_stripped"],
         },
-        mips: {
-            srcs: [":linker_sources_mips"],
-            static_libs: ["libgcc_stripped"],
-        },
-        mips64: {
-            srcs: [":linker_sources_mips64"],
-            static_libs: ["libgcc_stripped"],
-        },
     },
 
     // -shared is used to overwrite the -Bstatic and -static flags triggered by enabling
diff --git a/linker/arch/mips/begin.S b/linker/arch/mips/begin.S
deleted file mode 100644
index 1bdd358..0000000
--- a/linker/arch/mips/begin.S
+++ /dev/null
@@ -1,104 +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.
- */
-
-    .text
-    .balign   16
-    .type    __start,@function
-
-    .ent    __start
-    .globl    __start
-    .globl    _start
-__start:
-_start:
-    .set    noreorder
-    bal    1f
-    nop
-1:  .cpload    $31
-    .set    reorder
-
-    /* Discover the load address */
-    la    $t0, 1f
-    bal    1f
-1:  subu    $t0, $ra, $t0
-
-#define DT_PLTGOT 3
-#define DT_MIPS_LOCAL_GOTNO 0x7000000a
-
-    /* Search dynamic table for DT_MIPS_LOCAL_GOTNO and DT_PLTGOT values */
-    la    $t1, _DYNAMIC
-    addu    $t1, $t0
-    li    $t3, DT_PLTGOT
-    li    $t4, DT_MIPS_LOCAL_GOTNO
-0:
-    lw    $t2, 0($t1)
-    beqz    $t2, .Lrelocate_local_got
-
-    bne    $t2, $t3, 1f    /* DT_PLTGOT? */
-    lw    $s0, 4($t1)
-    addu    $s0, $t0
-    b    2f
-
-1:  bne    $t2, $t4, 1f    /* DT_MIPS_LOCAL_GOTNO? */
-    lw    $s1, 4($t1)
-    b    2f
-
-1:
-2:  addu    $t1, 8
-    b    0b
-
-.Lrelocate_local_got:
-    /*
-     * Relocate the local GOT entries
-     * got[0] is address of lazy resolver function
-     * got[1] may be used for a GNU extension
-     */
-
-    addu    $s0, 4
-    subu    $s1, 1
-    lw    $t1, ($s0)
-    bgez    $t1, 9f
-    addu    $s0, 4
-    subu    $s1, 1
-    b    9f
-
-1:  lw    $t1, ($s0)
-    addu    $t1, $t0
-    sw    $t1, ($s0)
-    addu    $s0, 4
-9:  subu    $s1, 1
-    bgez    $s1, 1b
-
-    /* call linker_init */
-    move    $a0, $sp
-    addiu    $sp, -4*4        /* space for arg saves in linker_init */
-    la    $t9, __linker_init
-    jalr    $t9
-    move    $t9, $v0
-    addu    $sp, 4*4        /* restore sp */
-    j    $t9
-    .end    __start
diff --git a/linker/arch/mips64/begin.S b/linker/arch/mips64/begin.S
deleted file mode 100644
index 60169b4..0000000
--- a/linker/arch/mips64/begin.S
+++ /dev/null
@@ -1,124 +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.
- */
-
-#include <private/bionic_asm.h>
-
-#if (_MIPS_SIM == _ABIO32) || (_MIPS_SIM == _ABI32)
-#define ELF_DYNSZ       8
-#define ELF_DYN_TAG     0
-#define ELF_DYN_VAL     4
-#define GOTENT_SZ       4
-#else
-#define ELF_DYNSZ       16
-#define ELF_DYN_TAG     0
-#define ELF_DYN_VAL     8
-#define GOTENT_SZ       8
-#endif
-
-    .text
-    .balign	16
-    .type	__start,@function
-
-    .ent	__start
-    .globl	__start
-    .globl	_start
-__start:
-_start:
-    .set	noreorder
-    bal		1f
-     nop
-1:
-#if (_MIPS_SIM == _ABIO32) || (_MIPS_SIM == _ABI32)
-    .cpload	$ra
-#else
-    .cpsetup	$ra, $0, 1b
-#endif
-    .set	reorder
-
-    /* Discover the load address */
-    LA		$t0, 1b
-    PTR_SUBU	$t0, $ra, $t0
-
-#define DT_PLTGOT 3
-#define DT_MIPS_LOCAL_GOTNO 0x7000000a
-
-    /* Search dynamic table for DT_MIPS_LOCAL_GOTNO and DT_PLTGOT values */
-    LA		$t1, _DYNAMIC
-    PTR_ADDU	$t1, $t0
-    LI		$t3, DT_PLTGOT
-    LI		$ta0, DT_MIPS_LOCAL_GOTNO
-0:
-    REG_L	$t2, ELF_DYN_TAG($t1)
-    beqz	$t2, .Lrelocate_local_got
-
-    bne		$t2, $t3, 1f	/* DT_PLTGOT? */
-    REG_L	$s0, ELF_DYN_VAL($t1)
-    PTR_ADDU	$s0, $t0
-    b		2f
-
-1:
-    bne		$t2, $ta0, 2f    /* DT_MIPS_LOCAL_GOTNO? */
-    REG_L	$s1, ELF_DYN_VAL($t1)
-
-2:  PTR_ADDU    $t1, ELF_DYNSZ
-    b		0b
-
-.Lrelocate_local_got:
-    /*
-     * Relocate the local GOT entries
-     * got[0] is address of lazy resolver function
-     * got[1] may be used for a GNU extension
-     */
-
-    PTR_ADDU	$s0, GOTENT_SZ
-    SUBU	$s1, 1
-    PTR_L	$t1, ($s0)
-    bgez	$t1, 9f
-    PTR_ADDU	$s0, GOTENT_SZ
-    SUBU	$s1, 1
-    b		9f
-
-1:  PTR_L	$t1, ($s0)
-    PTR_ADDU	$t1, $t0
-    PTR_S	$t1, ($s0)
-    PTR_ADDU	$s0, GOTENT_SZ
-9:  SUBU	$s1, 1
-    bgez	$s1, 1b
-
-    /* call linker_init */
-    move	$a0, $sp
-#if (_MIPS_SIM == _ABIO32) || (_MIPS_SIM == _ABI32)
-    PTR_SUBU	$sp, 4*REGSZ       /* space for arg saves in linker_init */
-#endif
-    jal		__linker_init
-#if (_MIPS_SIM == _ABIO32) || (_MIPS_SIM == _ABI32)
-    PTR_ADDU	$sp, 4*REGSZ        /* restore sp */
-#endif
-    move	$t9, $v0
-    j		$t9
-    .end    __start
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 0e68259..03b08b6 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -2949,25 +2949,15 @@
         break;
 
       case DT_PLTGOT:
-#if defined(__mips__)
-        // Used by mips and mips64.
-        plt_got_ = reinterpret_cast<ElfW(Addr)**>(load_bias + d->d_un.d_ptr);
-#endif
-        // Ignore for other platforms... (because RTLD_LAZY is not supported)
+        // Ignored (because RTLD_LAZY is not supported).
         break;
 
       case DT_DEBUG:
         // Set the DT_DEBUG entry to the address of _r_debug for GDB
         // if the dynamic table is writable
-// FIXME: not working currently for N64
-// The flags for the LOAD and DYNAMIC program headers do not agree.
-// The LOAD section containing the dynamic table has been mapped as
-// read-only, but the DYNAMIC header claims it is writable.
-#if !(defined(__mips__) && defined(__LP64__))
         if ((dynamic_flags & PF_W) != 0) {
           d->d_un.d_val = reinterpret_cast<uintptr_t>(&_r_debug);
         }
-#endif
         break;
 #if defined(USE_RELA)
       case DT_RELA:
@@ -3162,41 +3152,7 @@
                   get_realpath(), reinterpret_cast<void*>(d->d_un.d_val));
         }
         break;
-#if defined(__mips__)
-      case DT_MIPS_RLD_MAP:
-        // Set the DT_MIPS_RLD_MAP entry to the address of _r_debug for GDB.
-        {
-          r_debug** dp = reinterpret_cast<r_debug**>(load_bias + d->d_un.d_ptr);
-          *dp = &_r_debug;
-        }
-        break;
-      case DT_MIPS_RLD_MAP_REL:
-        // Set the DT_MIPS_RLD_MAP_REL entry to the address of _r_debug for GDB.
-        {
-          r_debug** dp = reinterpret_cast<r_debug**>(
-              reinterpret_cast<ElfW(Addr)>(d) + d->d_un.d_val);
-          *dp = &_r_debug;
-        }
-        break;
 
-      case DT_MIPS_RLD_VERSION:
-      case DT_MIPS_FLAGS:
-      case DT_MIPS_BASE_ADDRESS:
-      case DT_MIPS_UNREFEXTNO:
-        break;
-
-      case DT_MIPS_SYMTABNO:
-        mips_symtabno_ = d->d_un.d_val;
-        break;
-
-      case DT_MIPS_LOCAL_GOTNO:
-        mips_local_gotno_ = d->d_un.d_val;
-        break;
-
-      case DT_MIPS_GOTSYM:
-        mips_gotsym_ = d->d_un.d_val;
-        break;
-#endif
       // Ignored: "Its use has been superseded by the DF_BIND_NOW flag"
       case DT_BIND_NOW:
         break;
@@ -3254,12 +3210,6 @@
     }
   }
 
-#if defined(__mips__) && !defined(__LP64__)
-  if (!mips_check_and_adjust_fp_modes()) {
-    return false;
-  }
-#endif
-
   DEBUG("si->base = %p, si->strtab = %p, si->symtab = %p",
         reinterpret_cast<void*>(base), strtab_, symtab_);
 
diff --git a/linker/linker.h b/linker/linker.h
index 80c11d0..2da1404 100644
--- a/linker/linker.h
+++ b/linker/linker.h
@@ -51,20 +51,6 @@
 #define ELFW(what) ELF32_ ## what
 #endif
 
-// mips64 interprets Elf64_Rel structures' r_info field differently.
-// bionic (like other C libraries) has macros that assume regular ELF files,
-// but the dynamic linker needs to be able to load mips64 ELF files.
-#if defined(__mips__) && defined(__LP64__)
-#undef ELF64_R_SYM
-#undef ELF64_R_TYPE
-#undef ELF64_R_INFO
-#define ELF64_R_SYM(info)   (((info) >> 0) & 0xffffffff)
-#define ELF64_R_SSYM(info)  (((info) >> 32) & 0xff)
-#define ELF64_R_TYPE3(info) (((info) >> 40) & 0xff)
-#define ELF64_R_TYPE2(info) (((info) >> 48) & 0xff)
-#define ELF64_R_TYPE(info)  (((info) >> 56) & 0xff)
-#endif
-
 #define SUPPORTED_DT_FLAGS_1 (DF_1_NOW | DF_1_GLOBAL | DF_1_NODELETE | DF_1_PIE)
 
 // Class used construct version dependency graph.
diff --git a/linker/linker_common_types.h b/linker/linker_common_types.h
index ae78aa9..276fd66 100644
--- a/linker/linker_common_types.h
+++ b/linker/linker_common_types.h
@@ -33,11 +33,8 @@
 
 #include <android-base/macros.h>
 
-// TODO(dimitry): move this to linker_defines.h? Unless it is removed by
-// consequent refactoring steps.
-
-// Android uses RELA for aarch64 and x86_64. mips64 still uses REL.
-#if defined(__aarch64__) || defined(__x86_64__)
+// Android uses RELA for LP64.
+#if defined(__LP64__)
 #define USE_RELA 1
 #endif
 
diff --git a/linker/linker_mips.cpp b/linker/linker_mips.cpp
deleted file mode 100644
index 71a96e6..0000000
--- a/linker/linker_mips.cpp
+++ /dev/null
@@ -1,334 +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.
- */
-
-#if !defined(__LP64__) && __mips_isa_rev >= 5
-#include <sys/prctl.h>
-#endif
-
-#include "linker.h"
-#include "linker_debug.h"
-#include "linker_globals.h"
-#include "linker_phdr.h"
-#include "linker_relocs.h"
-#include "linker_reloc_iterators.h"
-#include "linker_sleb128.h"
-#include "linker_soinfo.h"
-
-template bool soinfo::relocate<plain_reloc_iterator>(const VersionTracker& version_tracker,
-                                                     plain_reloc_iterator&& rel_iterator,
-                                                     const soinfo_list_t& global_group,
-                                                     const soinfo_list_t& local_group);
-
-template bool soinfo::relocate<packed_reloc_iterator<sleb128_decoder>>(
-    const VersionTracker& version_tracker,
-    packed_reloc_iterator<sleb128_decoder>&& rel_iterator,
-    const soinfo_list_t& global_group,
-    const soinfo_list_t& local_group);
-
-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) {
-  for (size_t idx = 0; rel_iterator.has_next(); ++idx) {
-    const auto rel = rel_iterator.next();
-
-    if (rel == nullptr) {
-      return false;
-    }
-
-    ElfW(Word) type = ELFW(R_TYPE)(rel->r_info);
-    ElfW(Word) sym = ELFW(R_SYM)(rel->r_info);
-
-    ElfW(Addr) reloc = static_cast<ElfW(Addr)>(rel->r_offset + load_bias);
-    ElfW(Addr) sym_addr = 0;
-    const char* sym_name = nullptr;
-
-    DEBUG("Processing \"%s\" relocation at index %zd", get_realpath(), idx);
-    if (type == R_GENERIC_NONE) {
-      continue;
-    }
-
-    const ElfW(Sym)* s = nullptr;
-    soinfo* lsi = nullptr;
-
-    if (sym != 0) {
-      sym_name = get_string(symtab_[sym].st_name);
-      const version_info* vi = nullptr;
-
-      if (!lookup_version_info(version_tracker, sym, sym_name, &vi)) {
-        return false;
-      }
-
-      if (!soinfo_do_lookup(this, sym_name, vi, &lsi, global_group, local_group, &s)) {
-        return false;
-      }
-
-      if (s == nullptr) {
-        // mips does not support relocation with weak-undefined symbols
-        DL_ERR("cannot locate symbol \"%s\" referenced by \"%s\"...",
-               sym_name, get_realpath());
-        return false;
-      } else {
-        // We got a definition.
-        sym_addr = lsi->resolve_symbol_address(s);
-      }
-      count_relocation(kRelocSymbol);
-    }
-
-    switch (type) {
-      case R_MIPS_REL32:
-#if defined(__LP64__)
-        // MIPS Elf64_Rel entries contain compound relocations
-        // We only handle the R_MIPS_NONE|R_MIPS_64|R_MIPS_REL32 case
-        if (ELF64_R_TYPE2(rel->r_info) != R_MIPS_64 ||
-            ELF64_R_TYPE3(rel->r_info) != R_MIPS_NONE) {
-          DL_ERR("Unexpected compound relocation type:%d type2:%d type3:%d @ %p (%zu)",
-                 type, static_cast<unsigned>(ELF64_R_TYPE2(rel->r_info)),
-                 static_cast<unsigned>(ELF64_R_TYPE3(rel->r_info)), rel, idx);
-          return false;
-        }
-#endif
-        count_relocation(s == nullptr ? kRelocAbsolute : kRelocRelative);
-        MARK(rel->r_offset);
-        TRACE_TYPE(RELO, "RELO REL32 %08zx <- %08zx %s", static_cast<size_t>(reloc),
-                   static_cast<size_t>(sym_addr), sym_name ? sym_name : "*SECTIONHDR*");
-        if (s != nullptr) {
-          *reinterpret_cast<ElfW(Addr)*>(reloc) += sym_addr;
-        } else {
-          *reinterpret_cast<ElfW(Addr)*>(reloc) += load_bias;
-        }
-        break;
-      default:
-        DL_ERR("unknown reloc type %d @ %p (%zu)", type, rel, idx);
-        return false;
-    }
-  }
-  return true;
-}
-
-bool soinfo::mips_relocate_got(const VersionTracker& version_tracker,
-                               const soinfo_list_t& global_group,
-                               const soinfo_list_t& local_group) {
-  ElfW(Addr)** got = plt_got_;
-  if (got == nullptr) {
-    return true;
-  }
-
-  // got[0] is the address of the lazy resolver function.
-  // got[1] may be used for a GNU extension.
-  // FIXME: maybe this should be in a separate routine?
-  if ((flags_ & FLAG_LINKER) == 0) {
-    size_t g = 1;
-    // Check for the high bit to determine whether to skip got[1]
-    if (reinterpret_cast<intptr_t>(got[g]) < 0) {
-      g++;
-    }
-    // Relocate the local GOT entries.
-    for (; g < mips_local_gotno_; g++) {
-      got[g] = reinterpret_cast<ElfW(Addr)*>(reinterpret_cast<uintptr_t>(got[g]) + load_bias);
-    }
-  }
-
-  // Now for the global GOT entries...
-  got = plt_got_ + mips_local_gotno_;
-  for (ElfW(Word) sym = mips_gotsym_; sym < mips_symtabno_; sym++, got++) {
-    // This is an undefined reference... try to locate it.
-    const ElfW(Sym)* local_sym = symtab_ + sym;
-    const char* sym_name = get_string(local_sym->st_name);
-    soinfo* lsi = nullptr;
-    const ElfW(Sym)* s = nullptr;
-
-    ElfW(Word) st_visibility = (local_sym->st_other & 0x3);
-
-    if (st_visibility == STV_DEFAULT) {
-      const version_info* vi = nullptr;
-
-      if (!lookup_version_info(version_tracker, sym, sym_name, &vi)) {
-        return false;
-      }
-
-      if (!soinfo_do_lookup(this, sym_name, vi, &lsi, global_group, local_group, &s)) {
-        return false;
-      }
-    } else if (st_visibility == STV_PROTECTED) {
-      if (local_sym->st_value == 0) {
-        DL_ERR("%s: invalid symbol \"%s\" (PROTECTED/UNDEFINED) ",
-               get_realpath(), sym_name);
-        return false;
-      }
-      s = local_sym;
-      lsi = this;
-    } else {
-      DL_ERR("%s: invalid symbol \"%s\" visibility: 0x%x",
-             get_realpath(), sym_name, st_visibility);
-      return false;
-    }
-
-    if (s == nullptr) {
-      // We only allow an undefined symbol if this is a weak reference.
-      if (ELF_ST_BIND(local_sym->st_info) != STB_WEAK) {
-        DL_ERR("%s: cannot locate \"%s\"...", get_realpath(), sym_name);
-        return false;
-      }
-      *got = 0;
-    } else {
-      // FIXME: is this sufficient?
-      // For reference see NetBSD link loader
-      // http://cvsweb.netbsd.org/bsdweb.cgi/src/libexec/ld.elf_so/arch/mips/mips_reloc.c?rev=1.53&content-type=text/x-cvsweb-markup
-      *got = reinterpret_cast<ElfW(Addr)*>(lsi->resolve_symbol_address(s));
-    }
-  }
-  return true;
-}
-
-#if !defined(__LP64__)
-
-// Checks for mips32's various floating point abis.
-// (Mips64 Android has a single floating point abi and doesn't need any checks)
-
-// Linux kernel has declarations similar to the following
-//   in <linux>/arch/mips/include/asm/elf.h,
-// but that non-uapi internal header file will never be imported
-// into bionic's kernel headers.
-
-#define PT_MIPS_ABIFLAGS  0x70000003	// is .MIPS.abiflags segment
-
-struct mips_elf_abiflags_v0 {
-  uint16_t version;  // version of this structure
-  uint8_t  isa_level, isa_rev, gpr_size, cpr1_size, cpr2_size;
-  uint8_t  fp_abi;  // mips32 ABI variants for floating point
-  uint32_t isa_ext, ases, flags1, flags2;
-};
-
-// Bits of flags1:
-#define MIPS_AFL_FLAGS1_ODDSPREG 1  // Uses odd-numbered single-prec fp regs
-
-// Some values of fp_abi:        via compiler flag:
-#define MIPS_ABI_FP_ANY    0  // Not tagged or not using any ABIs affected by the differences.
-#define MIPS_ABI_FP_DOUBLE 1  // -mdouble-float
-#define MIPS_ABI_FP_XX     5  // -mfpxx
-#define MIPS_ABI_FP_64A    7  // -mips32r* -mfp64 -mno-odd-spreg
-
-#if __mips_isa_rev >= 5
-static bool mips_fre_mode_on = false;  // have set FRE=1 mode for process
-#endif
-
-bool soinfo::mips_check_and_adjust_fp_modes() {
-  mips_elf_abiflags_v0* abiflags = nullptr;
-  int mips_fpabi;
-
-  // Find soinfo's optional .MIPS.abiflags segment
-  for (size_t i = 0; i<phnum; ++i) {
-    const ElfW(Phdr)& ph = phdr[i];
-    if (ph.p_type == PT_MIPS_ABIFLAGS) {
-      if (ph.p_filesz < sizeof (mips_elf_abiflags_v0)) {
-        DL_ERR("Corrupt PT_MIPS_ABIFLAGS header found \"%s\"", get_realpath());
-        return false;
-      }
-      abiflags = reinterpret_cast<mips_elf_abiflags_v0*>(ph.p_vaddr + load_bias);
-      break;
-    }
-  }
-
-  // FP ABI-variant compatibility checks for MIPS o32 ABI
-  if (abiflags == nullptr) {
-    // Old compilers lack the new abiflags section.
-    // These compilers used -mfp32 -mdouble-float -modd-spreg defaults,
-    //   ie FP32 aka DOUBLE, using odd-numbered single-prec regs
-    mips_fpabi = MIPS_ABI_FP_DOUBLE;
-  } else {
-    mips_fpabi = abiflags->fp_abi;
-    if ( (abiflags->flags1 & MIPS_AFL_FLAGS1_ODDSPREG)
-         && (mips_fpabi == MIPS_ABI_FP_XX ||
-             mips_fpabi == MIPS_ABI_FP_64A   ) ) {
-      // Android supports fewer cases than Linux
-      DL_ERR("Unsupported odd-single-prec FloatPt reg uses in \"%s\"",
-             get_realpath());
-      return false;
-    }
-  }
-  if (!(mips_fpabi == MIPS_ABI_FP_DOUBLE ||
-#if __mips_isa_rev >= 5
-        mips_fpabi == MIPS_ABI_FP_64A    ||
-#endif
-        mips_fpabi == MIPS_ABI_FP_ANY    ||
-        mips_fpabi == MIPS_ABI_FP_XX       )) {
-    DL_ERR("Unsupported MIPS32 FloatPt ABI %d found in \"%s\"",
-           mips_fpabi, get_realpath());
-    return false;
-  }
-
-#if __mips_isa_rev >= 5
-  // Adjust process's FR Emulation mode, if needed
-  //
-  // On Mips R5 & R6, Android runs continuously in FR=1 64bit-fpreg mode.
-  // NDK mips32 apps compiled with old compilers generate FP32 code
-  //   which expects FR=0 32-bit fp registers.
-  // NDK mips32 apps compiled with newer compilers generate modeless
-  //   FPXX code which runs on both FR=0 and FR=1 modes.
-  // Android itself is compiled in FP64A which requires FR=1 mode.
-  // FP32, FPXX, and FP64A all interlink okay, without dynamic FR mode
-  //   changes during calls.  For details, see
-  //   http://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking
-  // Processes containing FR32 FR=0 code are run via kernel software assist,
-  //   which maps all odd-numbered single-precision reg refs onto the
-  //   upper half of the paired even-numbered double-precision reg.
-  // FRE=1 triggers traps to the kernel's emulator on every single-precision
-  //   fp op (for both odd and even-numbered registers).
-  // Turning on FRE=1 traps is done at most once per process, simultanously
-  //   for all threads of that process, when dlopen discovers FP32 code.
-  // The kernel repacks threads' registers when FRE mode is turn on or off.
-  //   These asynchronous adjustments are wrong if any thread was executing
-  //   FPXX code using odd-numbered single-precision regs.
-  // Current Android compilers default to the -mno-oddspreg option,
-  //   and this requirement is checked by Android's dlopen.
-  //   So FRE can always be safely turned on for FP32, anytime.
-  // Deferred enhancement: Allow loading of odd-spreg FPXX modules.
-
-  if (mips_fpabi == MIPS_ABI_FP_DOUBLE && !mips_fre_mode_on) {
-    // Turn on FRE mode, which emulates mode-sensitive FR=0 code on FR=1
-    //   register files, by trapping to kernel on refs to single-precision regs
-    if (prctl(PR_SET_FP_MODE, PR_FP_MODE_FR|PR_FP_MODE_FRE)) {
-      DL_ERR("Kernel or cpu failed to set FRE mode required for running \"%s\"",
-             get_realpath());
-      return false;
-    }
-    DL_WARN("Using FRE=1 mode to run \"%s\"", get_realpath());
-    mips_fre_mode_on = true;  // Avoid future redundant mode-switch calls
-    // FRE mode is never turned back off.
-    // Deferred enhancement:
-    //   Reset FRE mode when dlclose() removes all FP32 modules
-  }
-#else
-  // Android runs continuously in FR=0 32bit-fpreg mode.
-#endif  // __mips_isa_rev
-  return true;
-}
-
-#endif  // __LP64___
diff --git a/linker/linker_phdr.cpp b/linker/linker_phdr.cpp
index da2d03c..9b7a461 100644
--- a/linker/linker_phdr.cpp
+++ b/linker/linker_phdr.cpp
@@ -51,8 +51,6 @@
   return EM_AARCH64;
 #elif defined(__i386__)
   return EM_386;
-#elif defined(__mips__)
-  return EM_MIPS;
 #elif defined(__x86_64__)
   return EM_X86_64;
 #endif
@@ -204,7 +202,6 @@
   if (em == EM_386) return "EM_386";
   if (em == EM_AARCH64) return "EM_AARCH64";
   if (em == EM_ARM) return "EM_ARM";
-  if (em == EM_MIPS) return "EM_MIPS";
   if (em == EM_X86_64) return "EM_X86_64";
   return "EM_???";
 }
diff --git a/linker/linker_relocate.cpp b/linker/linker_relocate.cpp
index 17516e9..72be5f7 100644
--- a/linker/linker_relocate.cpp
+++ b/linker/linker_relocate.cpp
@@ -643,12 +643,6 @@
   }
 #endif
 
-#if defined(__mips__)
-  if (!mips_relocate_got(version_tracker, global_group, local_group)) {
-    return false;
-  }
-#endif
-
   // Once the tlsdesc_args_ vector's size is finalized, we can write the addresses of its elements
   // into the TLSDESC relocations.
 #if defined(__aarch64__)
diff --git a/linker/linker_soinfo.h b/linker/linker_soinfo.h
index 3a33949..e1a3c30 100644
--- a/linker/linker_soinfo.h
+++ b/linker/linker_soinfo.h
@@ -191,10 +191,8 @@
   uint32_t* bucket_;
   uint32_t* chain_;
 
-#if defined(__mips__) || !defined(__LP64__)
-  // This is only used by mips and mips64, but needs to be here for
-  // all 32-bit architectures to preserve binary compatibility.
-  ElfW(Addr)** plt_got_;
+#if !defined(__LP64__)
+  ElfW(Addr)** unused4; // DO NOT USE, maintained for compatibility
 #endif
 
 #if defined(USE_RELA)
@@ -228,16 +226,6 @@
   uint32_t* ARM_exidx;
   size_t ARM_exidx_count;
  private:
-#elif defined(__mips__)
-  uint32_t mips_symtabno_;
-  uint32_t mips_local_gotno_;
-  uint32_t mips_gotsym_;
-  bool mips_relocate_got(const VersionTracker& version_tracker,
-                         const soinfo_list_t& global_group,
-                         const soinfo_list_t& local_group);
-#if !defined(__LP64__)
-  bool mips_check_and_adjust_fp_modes();
-#endif
 #endif
   size_t ref_count_;
  public:
diff --git a/tests/Android.build.prebuilt.mk b/tests/Android.build.prebuilt.mk
index 3b34846..de8f5e6 100644
--- a/tests/Android.build.prebuilt.mk
+++ b/tests/Android.build.prebuilt.mk
@@ -25,8 +25,6 @@
 LOCAL_SRC_FILES_arm64 := prebuilt-elf-files/arm64/$(bionic_tests_module)
 LOCAL_SRC_FILES_x86 := prebuilt-elf-files/x86/$(bionic_tests_module)
 LOCAL_SRC_FILES_x86_64 := prebuilt-elf-files/x86_64/$(bionic_tests_module)
-LOCAL_SRC_FILES_mips := prebuilt-elf-files/mips/$(bionic_tests_module)
-LOCAL_SRC_FILES_mips64 := prebuilt-elf-files/mips64/$(bionic_tests_module)
 include $(BUILD_PREBUILT)
 bionic-loader-test-libs-target: $(LOCAL_MODULE)
 .PHONY: bionic-loader-test-libs-target
diff --git a/tests/dl_test.cpp b/tests/dl_test.cpp
index ed60e8e..6adba19 100644
--- a/tests/dl_test.cpp
+++ b/tests/dl_test.cpp
@@ -95,12 +95,6 @@
   static constexpr const char* kAlternatePathToLinker = "/system/bin/x86_64/linker64";
 #elif defined (__i386__)
   static constexpr const char* kAlternatePathToLinker = "/system/bin/x86/linker";
-#elif defined (__mips__)
-#if defined(__LP64__)
-  static constexpr const char* kAlternatePathToLinker = "/system/bin/mips64/linker64";
-#else
-  static constexpr const char* kAlternatePathToLinker = "/system/bin/mips/linker";
-#endif
 #else
 #error "Unknown architecture"
 #endif
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index d815dba..d7b9bae 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -273,8 +273,6 @@
   dlclose(handle);
 }
 
-// mips doesn't support ifuncs
-#if !defined(__mips__)
 TEST(dlfcn, ifunc_variable) {
   typedef const char* (*fn_ptr)();
 
@@ -367,7 +365,6 @@
   ASSERT_STREQ("true", is_ctor_called());
   dlclose(handle);
 }
-#endif
 
 TEST(dlfcn, dlopen_check_relocation_dt_needed_order) {
   // This is the structure of the test library and
@@ -989,12 +986,6 @@
 #define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib/x86/"
 #elif defined (__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/lib64/mips64/"
-#else
-#define ALTERNATE_PATH_TO_SYSTEM_LIB "/system/lib/mips/"
-#endif
 #else
 #error "Unknown architecture"
 #endif
@@ -1047,10 +1038,7 @@
   ASSERT_TRUE(dlerror() == nullptr); // dladdr(3) doesn't set dlerror(3).
 }
 
-// GNU-style ELF hash tables are incompatible with the MIPS ABI.
-// MIPS requires .dynsym to be sorted to match the GOT but GNU-style requires sorting by hash code.
 TEST(dlfcn, dlopen_library_with_only_gnu_hash) {
-#if !defined(__mips__)
   dlerror(); // Clear any pending errors.
   void* handle = dlopen("libgnu-hash-table-library.so", RTLD_NOW);
   ASSERT_TRUE(handle != nullptr) << dlerror();
@@ -1067,9 +1055,6 @@
   ASSERT_TRUE(fn == dlinfo.dli_saddr);
   ASSERT_STREQ("getRandomNumber", dlinfo.dli_sname);
   ASSERT_SUBSTR("libgnu-hash-table-library.so", dlinfo.dli_fname);
-#else
-  GTEST_SKIP() << "mips toolchain does not support '--hash-style=gnu'";
-#endif
 }
 
 TEST(dlfcn, dlopen_library_with_only_sysv_hash) {
diff --git a/tests/headers/posix/sys_stat_h.c b/tests/headers/posix/sys_stat_h.c
index 5764dfb..b22e34f 100644
--- a/tests/headers/posix/sys_stat_h.c
+++ b/tests/headers/posix/sys_stat_h.c
@@ -69,10 +69,8 @@
   STRUCT_MEMBER(struct stat, struct timespec, st_mtim);
   STRUCT_MEMBER(struct stat, struct timespec, st_ctim);
 #if defined(__BIONIC__)
-#if defined(__aarch64__) || (defined(__mips__) && defined(__LP64__))
+#if defined(__aarch64__)
   STRUCT_MEMBER(struct stat, int, st_blksize);
-#elif defined(__mips__) && !defined(__LP64__)
-  STRUCT_MEMBER(struct stat, unsigned int, st_blksize);
 #elif defined(__x86_64__)
   STRUCT_MEMBER(struct stat, long, st_blksize);
 #else
diff --git a/tests/libs/Android.bp b/tests/libs/Android.bp
index 847c353..c427282 100644
--- a/tests/libs/Android.bp
+++ b/tests/libs/Android.bp
@@ -117,14 +117,6 @@
     defaults: ["bionic_testlib_defaults"],
     srcs: ["dlext_test_library.cpp"],
     ldflags: ["-Wl,--hash-style=gnu"],
-    arch: {
-        mips: {
-            enabled: false,
-        },
-        mips64: {
-            enabled: false,
-        },
-    },
 }
 
 // -----------------------------------------------------------------------------
@@ -1116,15 +1108,6 @@
     name: "libtest_ifunc",
     defaults: ["bionic_testlib_defaults"],
     srcs: ["dlopen_testlib_ifunc.cpp"],
-
-    arch: {
-        mips: {
-            enabled: false,
-        },
-        mips64: {
-            enabled: false,
-        },
-    },
 }
 
 cc_test_library {
@@ -1132,30 +1115,12 @@
     defaults: ["bionic_testlib_defaults"],
     srcs: ["dlopen_testlib_ifunc_variable.cpp"],
     shared_libs: ["libtest_ifunc_variable_impl"],
-
-    arch: {
-        mips: {
-            enabled: false,
-        },
-        mips64: {
-            enabled: false,
-        },
-    },
 }
 
 cc_test_library {
     name: "libtest_ifunc_variable_impl",
     defaults: ["bionic_testlib_defaults"],
     srcs: ["dlopen_testlib_ifunc_variable_impl.cpp"],
-
-    arch: {
-        mips: {
-            enabled: false,
-        },
-        mips64: {
-            enabled: false,
-        },
-    },
 }
 
 // -----------------------------------------------------------------------------
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp
index 6620cdb..4da6d3f 100644
--- a/tests/malloc_test.cpp
+++ b/tests/malloc_test.cpp
@@ -387,9 +387,6 @@
   ASSERT_STREQ("malloc", root->Name());
   std::string version(root->Attribute("version"));
   if (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;
@@ -418,10 +415,18 @@
         }
       }
     }
+  } else if (version == "scudo-1") {
+    auto element = root->FirstChildElement();
+    for (; element != nullptr; element = element->NextSiblingElement()) {
+      int val;
+
+      ASSERT_STREQ("alloc", element->Name());
+      ASSERT_EQ(tinyxml2::XML_SUCCESS, element->QueryIntAttribute("size", &val));
+      ASSERT_EQ(tinyxml2::XML_SUCCESS, element->QueryIntAttribute("count", &val));
+    }
   } else {
-    // Do not verify output for scudo or debug malloc.
-    ASSERT_TRUE(version == "scudo-1" || version == "debug-malloc-1")
-        << "Unknown version: " << version;
+    // Do not verify output for debug malloc.
+    ASSERT_TRUE(version == "debug-malloc-1") << "Unknown version: " << version;
   }
 #endif
 }
@@ -452,9 +457,6 @@
   ASSERT_STREQ("malloc", root->Name());
   std::string version(root->Attribute("version"));
   if (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;
@@ -477,10 +479,22 @@
     // since malloc_info allocates some memory.
     EXPECT_LE(mallinfo_before_allocated_bytes, total_allocated_bytes);
     EXPECT_GE(mallinfo_after_allocated_bytes, total_allocated_bytes);
+  } else if (version == "scudo-1") {
+    auto element = root->FirstChildElement();
+    for (; element != nullptr; element = element->NextSiblingElement()) {
+      ASSERT_STREQ("alloc", element->Name());
+      int size;
+      ASSERT_EQ(tinyxml2::XML_SUCCESS, element->QueryIntAttribute("size", &size));
+      int count;
+      ASSERT_EQ(tinyxml2::XML_SUCCESS, element->QueryIntAttribute("count", &count));
+      total_allocated_bytes += size * count;
+    }
+    // Scudo only gives the information on the primary, so simply make
+    // sure that the value is non-zero.
+    EXPECT_NE(0U, total_allocated_bytes);
   } else {
-    // Do not verify output for scudo or debug malloc.
-    ASSERT_TRUE(version == "scudo-1" || version == "debug-malloc-1")
-        << "Unknown version: " << version;
+    // Do not verify output for debug malloc.
+    ASSERT_TRUE(version == "debug-malloc-1") << "Unknown version: " << version;
   }
 #endif
 }
diff --git a/tests/prebuilt-elf-files/mips/libtest_empty.so b/tests/prebuilt-elf-files/mips/libtest_empty.so
deleted file mode 100755
index 417a98b..0000000
--- a/tests/prebuilt-elf-files/mips/libtest_empty.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips/libtest_invalid-empty_shdr_table.so b/tests/prebuilt-elf-files/mips/libtest_invalid-empty_shdr_table.so
deleted file mode 100755
index 94b67b0..0000000
--- a/tests/prebuilt-elf-files/mips/libtest_invalid-empty_shdr_table.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips/libtest_invalid-rw_load_segment.so b/tests/prebuilt-elf-files/mips/libtest_invalid-rw_load_segment.so
deleted file mode 100755
index b6bfaca..0000000
--- a/tests/prebuilt-elf-files/mips/libtest_invalid-rw_load_segment.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips/libtest_invalid-textrels.so b/tests/prebuilt-elf-files/mips/libtest_invalid-textrels.so
deleted file mode 100755
index 7ff0753..0000000
--- a/tests/prebuilt-elf-files/mips/libtest_invalid-textrels.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips/libtest_invalid-textrels2.so b/tests/prebuilt-elf-files/mips/libtest_invalid-textrels2.so
deleted file mode 100755
index bfbadec..0000000
--- a/tests/prebuilt-elf-files/mips/libtest_invalid-textrels2.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips/libtest_invalid-unaligned_shdr_offset.so b/tests/prebuilt-elf-files/mips/libtest_invalid-unaligned_shdr_offset.so
deleted file mode 100755
index f6fcad2..0000000
--- a/tests/prebuilt-elf-files/mips/libtest_invalid-unaligned_shdr_offset.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shdr_table_content.so b/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shdr_table_content.so
deleted file mode 100755
index 500d4d7..0000000
--- a/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shdr_table_content.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shdr_table_offset.so b/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shdr_table_offset.so
deleted file mode 100755
index e4166d1..0000000
--- a/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shdr_table_offset.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shentsize.so b/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shentsize.so
deleted file mode 100755
index ace8fdd..0000000
--- a/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shentsize.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shstrndx.so b/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shstrndx.so
deleted file mode 100755
index 9141875..0000000
--- a/tests/prebuilt-elf-files/mips/libtest_invalid-zero_shstrndx.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips64/libtest_empty.so b/tests/prebuilt-elf-files/mips64/libtest_empty.so
deleted file mode 100755
index ad3a568..0000000
--- a/tests/prebuilt-elf-files/mips64/libtest_empty.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips64/libtest_invalid-empty_shdr_table.so b/tests/prebuilt-elf-files/mips64/libtest_invalid-empty_shdr_table.so
deleted file mode 100755
index 9420211..0000000
--- a/tests/prebuilt-elf-files/mips64/libtest_invalid-empty_shdr_table.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips64/libtest_invalid-rw_load_segment.so b/tests/prebuilt-elf-files/mips64/libtest_invalid-rw_load_segment.so
deleted file mode 100755
index 3fcfc38..0000000
--- a/tests/prebuilt-elf-files/mips64/libtest_invalid-rw_load_segment.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips64/libtest_invalid-textrels.so b/tests/prebuilt-elf-files/mips64/libtest_invalid-textrels.so
deleted file mode 100755
index ec43ace..0000000
--- a/tests/prebuilt-elf-files/mips64/libtest_invalid-textrels.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips64/libtest_invalid-textrels2.so b/tests/prebuilt-elf-files/mips64/libtest_invalid-textrels2.so
deleted file mode 100755
index cb6661e..0000000
--- a/tests/prebuilt-elf-files/mips64/libtest_invalid-textrels2.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips64/libtest_invalid-unaligned_shdr_offset.so b/tests/prebuilt-elf-files/mips64/libtest_invalid-unaligned_shdr_offset.so
deleted file mode 100755
index c61efaf..0000000
--- a/tests/prebuilt-elf-files/mips64/libtest_invalid-unaligned_shdr_offset.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shdr_table_content.so b/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shdr_table_content.so
deleted file mode 100755
index ffabdc3..0000000
--- a/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shdr_table_content.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shdr_table_offset.so b/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shdr_table_offset.so
deleted file mode 100755
index 43b44f0..0000000
--- a/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shdr_table_offset.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shentsize.so b/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shentsize.so
deleted file mode 100755
index cf55d06..0000000
--- a/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shentsize.so
+++ /dev/null
Binary files differ
diff --git a/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shstrndx.so b/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shstrndx.so
deleted file mode 100755
index 8155949..0000000
--- a/tests/prebuilt-elf-files/mips64/libtest_invalid-zero_shstrndx.so
+++ /dev/null
Binary files differ
diff --git a/tests/setjmp_test.cpp b/tests/setjmp_test.cpp
index 44d8af1..2476704 100644
--- a/tests/setjmp_test.cpp
+++ b/tests/setjmp_test.cpp
@@ -224,10 +224,6 @@
 #define __JB_SIGFLAG 8
 #elif defined(__x86_64)
 #define __JB_SIGFLAG 8
-#elif defined(__mips__) && defined(__LP64__)
-#define __JB_SIGFLAG 1
-#elif defined(__mips__)
-#define __JB_SIGFLAG 2
 #endif
 
 TEST(setjmp, setjmp_cookie) {
@@ -235,13 +231,7 @@
   int value = setjmp(jb);
   ASSERT_EQ(0, value);
 
-#if defined(__mips__) && !defined(__LP64__)
-  // round address to 8-byte boundry
-  uintptr_t jb_aligned = reinterpret_cast<uintptr_t>(jb) & ~7L;
-  long* sigflag = reinterpret_cast<long*>(jb_aligned) + __JB_SIGFLAG;
-#else
   long* sigflag = reinterpret_cast<long*>(jb) + __JB_SIGFLAG;
-#endif
 
   // Make sure there's actually a cookie.
   EXPECT_NE(0, *sigflag & ~1);
diff --git a/tests/signal_test.cpp b/tests/signal_test.cpp
index eec56dc..3c66034 100644
--- a/tests/signal_test.cpp
+++ b/tests/signal_test.cpp
@@ -282,8 +282,7 @@
                           int sig) {
   // Both bionic and glibc set SA_RESTORER when talking to the kernel on arm,
   // arm64, x86, and x86-64. The version of glibc we're using also doesn't
-  // define SA_RESTORER, but luckily it's the same value everywhere, and mips
-  // doesn't use the bit for anything.
+  // define SA_RESTORER, but luckily it's the same value everywhere.
   static const unsigned sa_restorer = 0x4000000;
 
   // See what's currently set for this signal.
@@ -598,19 +597,13 @@
 }
 
 TEST(signal, limits) {
-  // This comes from the kernel.
+  // These come from the kernel.
   ASSERT_EQ(32, __SIGRTMIN);
+  ASSERT_EQ(64, __SIGRTMAX);
 
   // We reserve a non-zero number at the bottom for ourselves.
   ASSERT_GT(SIGRTMIN, __SIGRTMIN);
 
-  // MIPS has more signals than everyone else.
-#if defined(__mips__)
-  ASSERT_EQ(128, __SIGRTMAX);
-#else
-  ASSERT_EQ(64, __SIGRTMAX);
-#endif
-
   // We don't currently reserve any at the top.
   ASSERT_EQ(SIGRTMAX, __SIGRTMAX);
 }
diff --git a/tests/stdatomic_test.cpp b/tests/stdatomic_test.cpp
index 9911d64..8a6b267 100644
--- a/tests/stdatomic_test.cpp
+++ b/tests/stdatomic_test.cpp
@@ -69,12 +69,7 @@
   atomic_char small;
   ASSERT_TRUE(atomic_is_lock_free(&small));
   atomic_intmax_t big;
-  // atomic_intmax_t(size = 64) is not lock free on mips32.
-#if defined(__mips__) && !defined(__LP64__)
-  ASSERT_FALSE(atomic_is_lock_free(&big));
-#else
   ASSERT_TRUE(atomic_is_lock_free(&big));
-#endif
 }
 
 TEST(stdatomic, atomic_flag) {
diff --git a/tests/sys_personality_test.cpp b/tests/sys_personality_test.cpp
index 6bd00ef..2dfaa65 100644
--- a/tests/sys_personality_test.cpp
+++ b/tests/sys_personality_test.cpp
@@ -21,9 +21,7 @@
 TEST(sys_personality, current_persona) {
   int persona = personality(0xffffffff) & PER_MASK;
 #if defined(__BIONIC__)
-// When personality syscall is executed on mips64, for a 32bit process
-// sys_32_personality() is called, which converts PER_LINUX32 -> PER_LINUX
-#if defined(__LP64__) || (__mips==32 && __mips_isa_rev>2)
+#if defined(__LP64__)
   ASSERT_EQ(PER_LINUX, persona);
 #else
   ASSERT_EQ(PER_LINUX32, persona);
diff --git a/tests/sys_ptrace_test.cpp b/tests/sys_ptrace_test.cpp
index f17f80c..a079ead 100644
--- a/tests/sys_ptrace_test.cpp
+++ b/tests/sys_ptrace_test.cpp
@@ -257,9 +257,6 @@
   asm volatile("stm %0, { r0, r1, r2, r3 }" : : "r"(&data));
 #elif defined(__aarch64__)
   asm volatile("stp x0, x1, %0" : : "m"(data));
-#elif defined(__mips__)
-// TODO
-  UNUSED(data);
 #endif
 }
 
diff --git a/tools/versioner/platforms/crtbegin.map.txt b/tools/versioner/platforms/crtbegin.map.txt
index 2c08da6..b844c1e 100644
--- a/tools/versioner/platforms/crtbegin.map.txt
+++ b/tools/versioner/platforms/crtbegin.map.txt
@@ -3,5 +3,5 @@
 
 CRTBEGIN {
   global:
-    atexit;  # arm64 x86 x86_64 mips mips64
+    atexit;  # arm64 x86 x86_64
 };
diff --git a/tools/versioner/tests/preprocessor/expected/foo.h b/tools/versioner/tests/preprocessor/expected/foo.h
index 61e6056..769c37e 100644
--- a/tools/versioner/tests/preprocessor/expected/foo.h
+++ b/tools/versioner/tests/preprocessor/expected/foo.h
@@ -54,26 +54,23 @@
 
 // __INTRODUCED_IN_64(21) should be ignored.
 
-#if (defined(__LP64__)) || (defined(__arm__) && __ANDROID_API__ >= 13) || (defined(__mips__) && !defined(__LP64__) && __ANDROID_API__ >= 14) || (defined(__i386__) && __ANDROID_API__ >= 13)
-int multiple_introduced_1() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_MIPS(14) __INTRODUCED_IN_X86(13)
-    __INTRODUCED_IN_64(21);
-#endif /* (defined(__LP64__)) || (defined(__arm__) && __ANDROID_API__ >= 13) || (defined(__mips__) && !defined(__LP64__) && __ANDROID_API__ >= 14) || (defined(__i386__) && __ANDROID_API__ >= 13) */
+#if (!defined(__LP64__) && __ANDROID_API__ >= 13) || (defined(__LP64__))
+int multiple_introduced_1() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_X86(13) __INTRODUCED_IN_64(21);
+#endif /* (!defined(__LP64__) && __ANDROID_API__ >= 13) || (defined(__LP64__)) */
 
 
 
-#if (defined(__LP64__) && __ANDROID_API__ >= 22) || (defined(__arm__) && __ANDROID_API__ >= 13) || (defined(__mips__) && !defined(__LP64__) && __ANDROID_API__ >= 14) || (defined(__i386__) && __ANDROID_API__ >= 13)
-int multiple_introduced_2() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_MIPS(14) __INTRODUCED_IN_X86(13)
-    __INTRODUCED_IN_64(22);
-#endif /* (defined(__LP64__) && __ANDROID_API__ >= 22) || (defined(__arm__) && __ANDROID_API__ >= 13) || (defined(__mips__) && !defined(__LP64__) && __ANDROID_API__ >= 14) || (defined(__i386__) && __ANDROID_API__ >= 13) */
+#if (!defined(__LP64__) && __ANDROID_API__ >= 13) || (defined(__LP64__) && __ANDROID_API__ >= 22)
+int multiple_introduced_2() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_X86(13) __INTRODUCED_IN_64(22);
+#endif /* (!defined(__LP64__) && __ANDROID_API__ >= 13) || (defined(__LP64__) && __ANDROID_API__ >= 22) */
 
 
 
 #if (!defined(__LP64__) && __ANDROID_API__ >= 12) || (defined(__LP64__))
-int group_lp32() __INTRODUCED_IN_ARM(12) __INTRODUCED_IN_X86(12) __INTRODUCED_IN_MIPS(12);
+int group_lp32() __INTRODUCED_IN_ARM(12) __INTRODUCED_IN_X86(12);
 #endif /* (!defined(__LP64__) && __ANDROID_API__ >= 12) || (defined(__LP64__)) */
 
 
-
 #if defined(__cplusplus)
 }
 #endif
diff --git a/tools/versioner/tests/preprocessor/headers/foo.h b/tools/versioner/tests/preprocessor/headers/foo.h
index 349e5e6..782b44a 100644
--- a/tools/versioner/tests/preprocessor/headers/foo.h
+++ b/tools/versioner/tests/preprocessor/headers/foo.h
@@ -37,13 +37,11 @@
 #endif
 
 // __INTRODUCED_IN_64(21) should be ignored.
-int multiple_introduced_1() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_MIPS(14) __INTRODUCED_IN_X86(13)
-    __INTRODUCED_IN_64(21);
+int multiple_introduced_1() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_X86(13) __INTRODUCED_IN_64(21);
 
-int multiple_introduced_2() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_MIPS(14) __INTRODUCED_IN_X86(13)
-    __INTRODUCED_IN_64(22);
+int multiple_introduced_2() __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_X86(13) __INTRODUCED_IN_64(22);
 
-int group_lp32() __INTRODUCED_IN_ARM(12) __INTRODUCED_IN_X86(12) __INTRODUCED_IN_MIPS(12);
+int group_lp32() __INTRODUCED_IN_ARM(12) __INTRODUCED_IN_X86(12);
 
 #if defined(__cplusplus)
 }