Purge more of development/ndk.

The static libraries now come from prebuilts/ndk and the CRT sources
now come from bionic.

Test: treehugger
Bug: None
Change-Id: I2e8075d6acca60e64d0c3173713be2bf102a09d8
diff --git a/ndk/crt/arm/__dso_handle.h b/ndk/crt/arm/__dso_handle.h
deleted file mode 100644
index 3b56eba..0000000
--- a/ndk/crt/arm/__dso_handle.h
+++ /dev/null
@@ -1,50 +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.
- */
-
-/* The __dso_handle global variable is used by static
-   C++ constructors and destructors in the binary.
-   See http://www.codesourcery.com/public/cxx-abi/abi.html#dso-dtor
-
-   CRT_LEGACY_WORKAROUND is only defined when building this file
-   for the C library. This forces __dso_handle to be exported by
-   it. This is only required to ensure binary compatibility with
-   old NDK application machine code that contains reference to
-   the symbol, but do not have a proper definition for it.
-
-   These binaries cannot call their destructorson dlclose(), but
-   at least they will not fail to load.
-
-   When this file is built for the NDK, CRT_LEGACY_WORKAROUND
-   should never be defined.
- */
-
-#ifndef CRT_LEGACY_WORKAROUND
-__attribute__ ((visibility ("hidden")))
-#endif
-__attribute__ ((section (".bss")))
-void *__dso_handle = (void *) 0;
diff --git a/ndk/crt/arm/__dso_handle_so.h b/ndk/crt/arm/__dso_handle_so.h
deleted file mode 100644
index bd8b378..0000000
--- a/ndk/crt/arm/__dso_handle_so.h
+++ /dev/null
@@ -1,36 +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.
- */
-
-/* The __dso_handle global variable is used by static
-   C++ constructors and destructors in the binary.
-   See http://www.codesourcery.com/public/cxx-abi/abi.html#dso-dtor
-*/
-
-__attribute__ ((visibility ("hidden")))
-__attribute__ ((section (".data")))
-void *__dso_handle;
diff --git a/ndk/crt/arm/atexit.h b/ndk/crt/arm/atexit.h
deleted file mode 100644
index 90aa030..0000000
--- a/ndk/crt/arm/atexit.h
+++ /dev/null
@@ -1,45 +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 <stddef.h>
-
-extern void* __dso_handle;
-
-extern int __cxa_atexit(void (*)(void*), void*, void*);
-
-__attribute__ ((visibility ("hidden")))
-void __atexit_handler_wrapper(void* func) {
-  if (func != NULL) {
-    (*(void (*)(void))func)();
-  }
-}
-
-__attribute__ ((visibility ("hidden")))
-int atexit(void (*func)(void)) {
-  return (__cxa_atexit(&__atexit_handler_wrapper, func, &__dso_handle));
-}
diff --git a/ndk/crt/arm/crtbegin.c b/ndk/crt/arm/crtbegin.c
deleted file mode 100644
index 0753d14..0000000
--- a/ndk/crt/arm/crtbegin.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-typedef struct
-{
-    void (**preinit_array)(void);
-    void (**init_array)(void);
-    void (**fini_array)(void);
-    void (**ctor_list)(void);
-} structors_array_t;
-
-extern int main(int argc, char **argv, char **env);
-
-extern void __libc_init(
-  unsigned int *elfdata,
-  void (*onexit)(void),
-  int (*slingshot)(int, char**, char**),
-  structors_array_t const * const structors
-);
-
-__attribute__ ((section (".preinit_array")))
-void (*__PREINIT_ARRAY__)(void) = (void (*)(void)) -1;
-
-__attribute__ ((section (".init_array")))
-void (*__INIT_ARRAY__)(void) = (void (*)(void)) -1;
-
-__attribute__ ((section (".fini_array")))
-void (*__FINI_ARRAY__)(void) = (void (*)(void)) -1;
-
-__attribute__ ((section (".ctors")))
-void (*__CTOR_LIST__)(void) = (void (*)(void)) -1;
-
-/*
- * This is the small startup code that is first run when any executable runs.
- *
- * Its purpose is to call __libc_init with appropriate arguments, which are:
- *
- * - The address of the raw data block setup by the Linux kernel ELF loader.
- *
- * - The address of an "onexit" function, not used on any platform supported by
- *   Bionic.
- *
- * - The address of the "main" function of the program.
- *
- * - The address of the constructor list.
- */
-__attribute__((visibility("hidden")))
-void _start() {
-  structors_array_t array;
-  void *elfdata;
-
-  array.preinit_array = &__PREINIT_ARRAY__;
-  array.init_array =    &__INIT_ARRAY__;
-  array.fini_array =    &__FINI_ARRAY__;
-  array.ctor_list =    &__CTOR_LIST__;
-
-  elfdata = __builtin_frame_address(0) + sizeof(void *);
-  __libc_init(elfdata, (void *) 0, &main, &array);
-}
-
-#include "__dso_handle.h"
-// Old releases included atexit() details in libc.a, not in crtbegin_static.o.
-// It was, however, in crtbegin_dynamic.o rather than libc.so.
-#if PLATFORM_SDK_VERSION >= 21 || defined(BUILDING_DYNAMIC)
-#include "atexit.h"
-#endif
diff --git a/ndk/crt/arm/crtbegin_so.c b/ndk/crt/arm/crtbegin_so.c
deleted file mode 100644
index cd0257a..0000000
--- a/ndk/crt/arm/crtbegin_so.c
+++ /dev/null
@@ -1,58 +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.
- */
-
-extern void __cxa_finalize(void *);
-extern void *__dso_handle;
-
-__attribute__((visibility("hidden"),destructor))
-void __on_dlclose() {
-  __cxa_finalize(&__dso_handle);
-}
-
-/* CRT_LEGACY_WORKAROUND should only be defined when building
- * this file as part of the platform's C library.
- *
- * The C library already defines a function named 'atexit()'
- * for backwards compatibility with older NDK-generated binaries.
- *
- * For newer ones, 'atexit' is actually embedded in the C
- * runtime objects that are linked into the final ELF
- * binary (shared library or executable), and will call
- * __cxa_atexit() in order to un-register any atexit()
- * handler when a library is unloaded.
- *
- * This function must be global *and* hidden. Only the
- * code inside the same ELF binary should be able to access it.
- */
-
-#ifdef CRT_LEGACY_WORKAROUND
-#include "__dso_handle.h"
-#else
-#include "__dso_handle_so.h"
-#include "atexit.h"
-#endif
diff --git a/ndk/crt/arm/crtend_android.S b/ndk/crt/arm/crtend_android.S
deleted file mode 100644
index 2f3b1ed..0000000
--- a/ndk/crt/arm/crtend_android.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-	
-	.section .preinit_array, "aw"
-	.long 0
-
-	.section .init_array, "aw"
-	.long 0
-
-	.section .fini_array, "aw"
-	.long 0
-
-	.section .ctors, "aw"
-	.long 0
-
diff --git a/ndk/crt/arm/crtend_so.S b/ndk/crt/arm/crtend_so.S
deleted file mode 100644
index a1281c4..0000000
--- a/ndk/crt/arm/crtend_so.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* This is the same than crtend.S except that a shared library
- * cannot have a .preinit_array
- */
-	
-	.section .init_array, "aw"
-	.long 0
-
-	.section .fini_array, "aw"
-	.long 0
-
diff --git a/ndk/crt/arm64/atexit.h b/ndk/crt/arm64/atexit.h
deleted file mode 100644
index 90aa030..0000000
--- a/ndk/crt/arm64/atexit.h
+++ /dev/null
@@ -1,45 +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 <stddef.h>
-
-extern void* __dso_handle;
-
-extern int __cxa_atexit(void (*)(void*), void*, void*);
-
-__attribute__ ((visibility ("hidden")))
-void __atexit_handler_wrapper(void* func) {
-  if (func != NULL) {
-    (*(void (*)(void))func)();
-  }
-}
-
-__attribute__ ((visibility ("hidden")))
-int atexit(void (*func)(void)) {
-  return (__cxa_atexit(&__atexit_handler_wrapper, func, &__dso_handle));
-}
diff --git a/ndk/crt/arm64/crtbegin.c b/ndk/crt/arm64/crtbegin.c
deleted file mode 100644
index fec0b11..0000000
--- a/ndk/crt/arm64/crtbegin.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "../../bionic/libc_init_common.h"
-#include <stddef.h>
-#include <stdint.h>
-
-__attribute__ ((section (".preinit_array")))
-void (*__PREINIT_ARRAY__)(void) = (void (*)(void)) -1;
-
-__attribute__ ((section (".init_array")))
-void (*__INIT_ARRAY__)(void) = (void (*)(void)) -1;
-
-__attribute__ ((section (".fini_array")))
-void (*__FINI_ARRAY__)(void) = (void (*)(void)) -1;
-
-
-__LIBC_HIDDEN__ void do_arm64_start(void* raw_args) {
-  structors_array_t array;
-  array.preinit_array = &__PREINIT_ARRAY__;
-  array.init_array = &__INIT_ARRAY__;
-  array.fini_array = &__FINI_ARRAY__;
-  __libc_init(raw_args, NULL, &main, &array);
-}
-
-/*
- * Put the value of sp in x0 and call do_arm64_init(). The latter will then
- * then be able to access the stack as prepared by the kernel's execve system
- * call (via the first argument).
- */
-__asm__ (
-"        .text                      \n"
-"        .align  2                  \n"
-"        .global _start             \n"
-"        .hidden _start             \n"
-"        .type   _start, %function  \n"
-"_start:                            \n"
-"        add     x0, sp, xzr        \n"
-"        b       do_arm64_start   \n"
-"        .size   _start, .-_start   \n"
-);
-
-#include "../../arch-common/bionic/__dso_handle.h"
-#include "../../arch-common/bionic/atexit.h"
diff --git a/ndk/crt/arm64/crtbegin_so.c b/ndk/crt/arm64/crtbegin_so.c
deleted file mode 100644
index cd0257a..0000000
--- a/ndk/crt/arm64/crtbegin_so.c
+++ /dev/null
@@ -1,58 +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.
- */
-
-extern void __cxa_finalize(void *);
-extern void *__dso_handle;
-
-__attribute__((visibility("hidden"),destructor))
-void __on_dlclose() {
-  __cxa_finalize(&__dso_handle);
-}
-
-/* CRT_LEGACY_WORKAROUND should only be defined when building
- * this file as part of the platform's C library.
- *
- * The C library already defines a function named 'atexit()'
- * for backwards compatibility with older NDK-generated binaries.
- *
- * For newer ones, 'atexit' is actually embedded in the C
- * runtime objects that are linked into the final ELF
- * binary (shared library or executable), and will call
- * __cxa_atexit() in order to un-register any atexit()
- * handler when a library is unloaded.
- *
- * This function must be global *and* hidden. Only the
- * code inside the same ELF binary should be able to access it.
- */
-
-#ifdef CRT_LEGACY_WORKAROUND
-#include "__dso_handle.h"
-#else
-#include "__dso_handle_so.h"
-#include "atexit.h"
-#endif
diff --git a/ndk/crt/arm64/crtend_android.S b/ndk/crt/arm64/crtend_android.S
deleted file mode 100644
index a4cf8de..0000000
--- a/ndk/crt/arm64/crtend_android.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "asm_multiarch.h"
-
-	.section .preinit_array, "aw"
-	ASM_PTR_SIZE(0)
-
-	.section .init_array, "aw"
-	ASM_PTR_SIZE(0)
-
-	.section .fini_array, "aw"
-	ASM_PTR_SIZE(0)
-
-#if defined(__linux__) && defined(__ELF__)
-	.section .note.GNU-stack,"",%progbits
-#endif
-#if defined(__i386__) || defined(__x86_64__)
-	.section	.eh_frame,"a",@progbits
-	ASM_ALIGN(4)
-	.type	__FRAME_END__, @object
-	.size	__FRAME_END__, 4
-__FRAME_END__:
-	.zero	4
-#endif
diff --git a/ndk/crt/arm64/crtend_so.S b/ndk/crt/arm64/crtend_so.S
deleted file mode 100644
index f745109..0000000
--- a/ndk/crt/arm64/crtend_so.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "asm_multiarch.h"
-
-#ifndef __arm__
-	.section .init_array, "aw"
-	ASM_PTR_SIZE(0)
-
-	.section .fini_array, "aw"
-	ASM_PTR_SIZE(0)
-#endif
-
-#if defined(__linux__) && defined(__ELF__)
-	.section .note.GNU-stack,"",%progbits
-#endif
-#if defined(__i386__) || defined(__x86_64__)
-	.section	.eh_frame,"a",@progbits
-	ASM_ALIGN(4)
-	.type	__FRAME_END__, @object
-	.size	__FRAME_END__, 4
-__FRAME_END__:
-	.zero	4
-#endif
diff --git a/ndk/crt/x86/__stack_chk_fail_local.h b/ndk/crt/x86/__stack_chk_fail_local.h
deleted file mode 100644
index 4f3699a..0000000
--- a/ndk/crt/x86/__stack_chk_fail_local.h
+++ /dev/null
@@ -1,60 +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.
- */
-
-
-/*
-   __stack_chk_fail routine is runtime part of stack protector compiler
-   feature. It's implemented in libc and represents die routine when stack
-   corruption is detected.
-
-   Calls are generated by compiler and injected into user functions when
-   -fstack-protector* options are used.
-
-   __stack_chk_fail_local is wrapper for __stack_chk_fail. Compiler generates
-   wrapper calls instead for PIC code only and only on IA32 for optimization
-   purpose (see gcc/config/i386/i386.c). Wrapper body is always included into
-   executable or library. This is the idea of optimization.
-
-   Glibc is doing this via libc_nonshared.a which is linked automatically
-   everytime with libc.so. In bionic we have to bring it within crtfiles
-   because libc.so is real library and not a link script like libc.so at glibc.
-
-   For x86_64 or non-PIC code compiler always generates __stack_chk_fail calls.
-*/
-
-#ifdef __i386__
-#ifdef __PIC__
-extern void __stack_chk_fail();
-
-__attribute__ ((visibility ("hidden")))
-void __stack_chk_fail_local()
-{
-  __stack_chk_fail();
-}
-#endif
-#endif
diff --git a/ndk/crt/x86/asm_multiarch.h b/ndk/crt/x86/asm_multiarch.h
deleted file mode 100644
index 91cb8af..0000000
--- a/ndk/crt/x86/asm_multiarch.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef __LP64__
-# define ASM_PTR_SIZE(x) .quad x
-# define ASM_ALIGN_TO_PTR_SIZE .balign 8
-#else
-# define ASM_PTR_SIZE(x) .long x
-# define ASM_ALIGN_TO_PTR_SIZE .balign 4
-#endif
-
diff --git a/ndk/crt/x86/atexit.h b/ndk/crt/x86/atexit.h
deleted file mode 100644
index 90aa030..0000000
--- a/ndk/crt/x86/atexit.h
+++ /dev/null
@@ -1,45 +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 <stddef.h>
-
-extern void* __dso_handle;
-
-extern int __cxa_atexit(void (*)(void*), void*, void*);
-
-__attribute__ ((visibility ("hidden")))
-void __atexit_handler_wrapper(void* func) {
-  if (func != NULL) {
-    (*(void (*)(void))func)();
-  }
-}
-
-__attribute__ ((visibility ("hidden")))
-int atexit(void (*func)(void)) {
-  return (__cxa_atexit(&__atexit_handler_wrapper, func, &__dso_handle));
-}
diff --git a/ndk/crt/x86/crtbegin.c b/ndk/crt/x86/crtbegin.c
deleted file mode 100644
index 18e7ae0..0000000
--- a/ndk/crt/x86/crtbegin.c
+++ /dev/null
@@ -1,64 +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 "../../bionic/libc_init_common.h"
-#include <stddef.h>
-#include <stdint.h>
-
-__attribute__ ((section (".preinit_array")))
-void (*__PREINIT_ARRAY__)(void) = (void (*)(void)) -1;
-
-__attribute__ ((section (".init_array")))
-void (*__INIT_ARRAY__)(void) = (void (*)(void)) -1;
-
-__attribute__ ((section (".fini_array")))
-void (*__FINI_ARRAY__)(void) = (void (*)(void)) -1;
-
-__LIBC_HIDDEN__
-#ifdef __i386__
-__attribute__((force_align_arg_pointer))
-#endif
-void _start() {
-  structors_array_t array;
-  array.preinit_array = &__PREINIT_ARRAY__;
-  array.init_array = &__INIT_ARRAY__;
-  array.fini_array = &__FINI_ARRAY__;
-
-  void* raw_args = (void*) ((uintptr_t) __builtin_frame_address(0) + sizeof(void*));
-#ifdef __x86_64__
-  // 16-byte stack alignment is required by x86_64 ABI
-  asm("andq  $~15, %rsp");
-#endif
-  __libc_init(raw_args, NULL, &main, &array);
-}
-
-#include "__dso_handle.h"
-#include "atexit.h"
-#ifdef __i386__
-# include "__stack_chk_fail_local.h"
-#endif
diff --git a/ndk/crt/x86/crtbegin_so.c b/ndk/crt/x86/crtbegin_so.c
deleted file mode 100644
index 30de6af..0000000
--- a/ndk/crt/x86/crtbegin_so.c
+++ /dev/null
@@ -1,59 +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.
- */
-
-extern void __cxa_finalize(void *);
-extern void *__dso_handle;
-
-__attribute__((visibility("hidden"),destructor))
-void __on_dlclose() {
-  __cxa_finalize(&__dso_handle);
-}
-
-/* CRT_LEGACY_WORKAROUND should only be defined when building
- * this file as part of the platform's C library.
- *
- * The C library already defines a function named 'atexit()'
- * for backwards compatibility with older NDK-generated binaries.
- *
- * For newer ones, 'atexit' is actually embedded in the C
- * runtime objects that are linked into the final ELF
- * binary (shared library or executable), and will call
- * __cxa_atexit() in order to un-register any atexit()
- * handler when a library is unloaded.
- *
- * This function must be global *and* hidden. Only the
- * code inside the same ELF binary should be able to access it.
- */
-
-#ifdef CRT_LEGACY_WORKAROUND
-#include "__dso_handle.h"
-#else
-#include "__dso_handle_so.h"
-#include "atexit.h"
-#include "__stack_chk_fail_local.h"
-#endif
diff --git a/ndk/crt/x86/crtend_android.S b/ndk/crt/x86/crtend_android.S
deleted file mode 100644
index 9796ea0..0000000
--- a/ndk/crt/x86/crtend_android.S
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "asm_multiarch.h"
-
-	.section .preinit_array, "aw"
-	ASM_ALIGN_TO_PTR_SIZE
-	ASM_PTR_SIZE(0)
-
-	.section .init_array, "aw"
-	ASM_ALIGN_TO_PTR_SIZE
-	ASM_PTR_SIZE(0)
-
-	.section .fini_array, "aw"
-	ASM_ALIGN_TO_PTR_SIZE
-	ASM_PTR_SIZE(0)
-
-	.section	.eh_frame,"a",@progbits
-	.align 4
-	.type	__FRAME_END__, @object
-	.size	__FRAME_END__, 4
-__FRAME_END__:
-	.zero	4
diff --git a/ndk/crt/x86/crtend_so.S b/ndk/crt/x86/crtend_so.S
deleted file mode 100644
index 6ef493b..0000000
--- a/ndk/crt/x86/crtend_so.S
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "asm_multiarch.h"
-
-	.section .init_array, "aw"
-	ASM_ALIGN_TO_PTR_SIZE
-	ASM_PTR_SIZE(0)
-
-	.section .fini_array, "aw"
-	ASM_ALIGN_TO_PTR_SIZE
-	ASM_PTR_SIZE(0)
-
-	.section	.eh_frame,"a",@progbits
-	.align 4
-	.type	__FRAME_END__, @object
-	.size	__FRAME_END__, 4
-__FRAME_END__:
-	.zero	4
diff --git a/ndk/crt/x86_64 b/ndk/crt/x86_64
deleted file mode 120000
index f4bad79..0000000
--- a/ndk/crt/x86_64
+++ /dev/null
@@ -1 +0,0 @@
-x86
\ No newline at end of file
diff --git a/ndk/platforms/android-14/arch-arm/lib/libc.a b/ndk/platforms/android-14/arch-arm/lib/libc.a
deleted file mode 100644
index 67ff818..0000000
--- a/ndk/platforms/android-14/arch-arm/lib/libc.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-14/arch-arm/lib/libcompiler_rt-extras.a b/ndk/platforms/android-14/arch-arm/lib/libcompiler_rt-extras.a
deleted file mode 100644
index 97af575..0000000
--- a/ndk/platforms/android-14/arch-arm/lib/libcompiler_rt-extras.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-14/arch-arm/lib/libdl.a b/ndk/platforms/android-14/arch-arm/lib/libdl.a
deleted file mode 100644
index 2fff639..0000000
--- a/ndk/platforms/android-14/arch-arm/lib/libdl.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-14/arch-arm/lib/libm.a b/ndk/platforms/android-14/arch-arm/lib/libm.a
deleted file mode 100644
index 3e1ccb0..0000000
--- a/ndk/platforms/android-14/arch-arm/lib/libm.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-14/arch-arm/lib/libstdc++.a b/ndk/platforms/android-14/arch-arm/lib/libstdc++.a
deleted file mode 100644
index 8f495a5..0000000
--- a/ndk/platforms/android-14/arch-arm/lib/libstdc++.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-14/arch-x86/lib/libc.a b/ndk/platforms/android-14/arch-x86/lib/libc.a
deleted file mode 100644
index 788b92e..0000000
--- a/ndk/platforms/android-14/arch-x86/lib/libc.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-14/arch-x86/lib/libcompiler_rt-extras.a b/ndk/platforms/android-14/arch-x86/lib/libcompiler_rt-extras.a
deleted file mode 100644
index 310d717..0000000
--- a/ndk/platforms/android-14/arch-x86/lib/libcompiler_rt-extras.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-14/arch-x86/lib/libdl.a b/ndk/platforms/android-14/arch-x86/lib/libdl.a
deleted file mode 100644
index 97e733e..0000000
--- a/ndk/platforms/android-14/arch-x86/lib/libdl.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-14/arch-x86/lib/libm.a b/ndk/platforms/android-14/arch-x86/lib/libm.a
deleted file mode 100644
index 34f3c1f..0000000
--- a/ndk/platforms/android-14/arch-x86/lib/libm.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-14/arch-x86/lib/libstdc++.a b/ndk/platforms/android-14/arch-x86/lib/libstdc++.a
deleted file mode 100644
index 336bcfa..0000000
--- a/ndk/platforms/android-14/arch-x86/lib/libstdc++.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-14/arch-x86/lib/libz.a b/ndk/platforms/android-14/arch-x86/lib/libz.a
deleted file mode 100644
index 5c91867..0000000
--- a/ndk/platforms/android-14/arch-x86/lib/libz.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm/lib/libc.a b/ndk/platforms/android-21/arch-arm/lib/libc.a
deleted file mode 100644
index fb3ee8c..0000000
--- a/ndk/platforms/android-21/arch-arm/lib/libc.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm/lib/libcompiler_rt-extras.a b/ndk/platforms/android-21/arch-arm/lib/libcompiler_rt-extras.a
deleted file mode 100644
index 97af575..0000000
--- a/ndk/platforms/android-21/arch-arm/lib/libcompiler_rt-extras.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm/lib/libdl.a b/ndk/platforms/android-21/arch-arm/lib/libdl.a
deleted file mode 100644
index 2fff639..0000000
--- a/ndk/platforms/android-21/arch-arm/lib/libdl.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm/lib/libm.a b/ndk/platforms/android-21/arch-arm/lib/libm.a
deleted file mode 100644
index 9429fb5..0000000
--- a/ndk/platforms/android-21/arch-arm/lib/libm.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm/lib/libstdc++.a b/ndk/platforms/android-21/arch-arm/lib/libstdc++.a
deleted file mode 100644
index 698f3d6..0000000
--- a/ndk/platforms/android-21/arch-arm/lib/libstdc++.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm/lib/libz.a b/ndk/platforms/android-21/arch-arm/lib/libz.a
deleted file mode 100644
index fd67a52..0000000
--- a/ndk/platforms/android-21/arch-arm/lib/libz.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm64/lib/libc.a b/ndk/platforms/android-21/arch-arm64/lib/libc.a
deleted file mode 100644
index 4e8c6ef..0000000
--- a/ndk/platforms/android-21/arch-arm64/lib/libc.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm64/lib/libcompiler_rt-extras.a b/ndk/platforms/android-21/arch-arm64/lib/libcompiler_rt-extras.a
deleted file mode 100644
index 408ca08..0000000
--- a/ndk/platforms/android-21/arch-arm64/lib/libcompiler_rt-extras.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm64/lib/libdl.a b/ndk/platforms/android-21/arch-arm64/lib/libdl.a
deleted file mode 100644
index c88c6d68..0000000
--- a/ndk/platforms/android-21/arch-arm64/lib/libdl.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm64/lib/libm.a b/ndk/platforms/android-21/arch-arm64/lib/libm.a
deleted file mode 100644
index 093ca2c..0000000
--- a/ndk/platforms/android-21/arch-arm64/lib/libm.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm64/lib/libstdc++.a b/ndk/platforms/android-21/arch-arm64/lib/libstdc++.a
deleted file mode 100644
index 99b4856..0000000
--- a/ndk/platforms/android-21/arch-arm64/lib/libstdc++.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm64/lib/libz.a b/ndk/platforms/android-21/arch-arm64/lib/libz.a
deleted file mode 100644
index e96c721..0000000
--- a/ndk/platforms/android-21/arch-arm64/lib/libz.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86/lib/libc.a b/ndk/platforms/android-21/arch-x86/lib/libc.a
deleted file mode 100644
index 94a33f3..0000000
--- a/ndk/platforms/android-21/arch-x86/lib/libc.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86/lib/libcompiler_rt-extras.a b/ndk/platforms/android-21/arch-x86/lib/libcompiler_rt-extras.a
deleted file mode 100644
index 310d717..0000000
--- a/ndk/platforms/android-21/arch-x86/lib/libcompiler_rt-extras.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86/lib/libdl.a b/ndk/platforms/android-21/arch-x86/lib/libdl.a
deleted file mode 100644
index 97e733e..0000000
--- a/ndk/platforms/android-21/arch-x86/lib/libdl.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86/lib/libm.a b/ndk/platforms/android-21/arch-x86/lib/libm.a
deleted file mode 100644
index a944a6a..0000000
--- a/ndk/platforms/android-21/arch-x86/lib/libm.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86/lib/libstdc++.a b/ndk/platforms/android-21/arch-x86/lib/libstdc++.a
deleted file mode 100644
index 4565d3f..0000000
--- a/ndk/platforms/android-21/arch-x86/lib/libstdc++.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86/lib/libz.a b/ndk/platforms/android-21/arch-x86/lib/libz.a
deleted file mode 100644
index 6ea48c6..0000000
--- a/ndk/platforms/android-21/arch-x86/lib/libz.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86_64/lib64/libc.a b/ndk/platforms/android-21/arch-x86_64/lib64/libc.a
deleted file mode 100644
index 830077f..0000000
--- a/ndk/platforms/android-21/arch-x86_64/lib64/libc.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86_64/lib64/libcompiler_rt-extras.a b/ndk/platforms/android-21/arch-x86_64/lib64/libcompiler_rt-extras.a
deleted file mode 100644
index c6a5325..0000000
--- a/ndk/platforms/android-21/arch-x86_64/lib64/libcompiler_rt-extras.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86_64/lib64/libdl.a b/ndk/platforms/android-21/arch-x86_64/lib64/libdl.a
deleted file mode 100644
index 5150b60..0000000
--- a/ndk/platforms/android-21/arch-x86_64/lib64/libdl.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86_64/lib64/libm.a b/ndk/platforms/android-21/arch-x86_64/lib64/libm.a
deleted file mode 100644
index 991cc05..0000000
--- a/ndk/platforms/android-21/arch-x86_64/lib64/libm.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86_64/lib64/libstdc++.a b/ndk/platforms/android-21/arch-x86_64/lib64/libstdc++.a
deleted file mode 100644
index 18a78a4..0000000
--- a/ndk/platforms/android-21/arch-x86_64/lib64/libstdc++.a
+++ /dev/null
Binary files differ
diff --git a/ndk/platforms/android-21/arch-x86_64/lib64/libz.a b/ndk/platforms/android-21/arch-x86_64/lib64/libz.a
deleted file mode 100644
index ca200a4..0000000
--- a/ndk/platforms/android-21/arch-x86_64/lib64/libz.a
+++ /dev/null
Binary files differ