dimitry | 581723e | 2018-01-05 14:31:44 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * * Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * * Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in |
| 12 | * the documentation and/or other materials provided with the |
| 13 | * distribution. |
| 14 | * |
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 16 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 18 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 19 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
| 22 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 25 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 26 | * SUCH DAMAGE. |
| 27 | */ |
| 28 | |
dimitry | 581723e | 2018-01-05 14:31:44 +0100 | [diff] [blame] | 29 | #include <sys/cdefs.h> |
| 30 | |
dimitry | 581723e | 2018-01-05 14:31:44 +0100 | [diff] [blame] | 31 | extern "C" void __internal_linker_error() { |
Ryan Prichard | 470b666 | 2018-03-27 22:10:55 -0700 | [diff] [blame] | 32 | __builtin_trap(); |
dimitry | 581723e | 2018-01-05 14:31:44 +0100 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | __strong_alias(__loader_android_create_namespace, __internal_linker_error); |
| 36 | __strong_alias(__loader_android_dlopen_ext, __internal_linker_error); |
| 37 | __strong_alias(__loader_android_dlwarning, __internal_linker_error); |
| 38 | __strong_alias(__loader_android_get_application_target_sdk_version, __internal_linker_error); |
| 39 | __strong_alias(__loader_android_get_LD_LIBRARY_PATH, __internal_linker_error); |
| 40 | __strong_alias(__loader_android_get_exported_namespace, __internal_linker_error); |
| 41 | __strong_alias(__loader_android_init_anonymous_namespace, __internal_linker_error); |
| 42 | __strong_alias(__loader_android_link_namespaces, __internal_linker_error); |
Logan Chien | 9ee4591 | 2018-01-18 12:05:09 +0800 | [diff] [blame] | 43 | __strong_alias(__loader_android_link_namespaces_all_libs, __internal_linker_error); |
dimitry | 581723e | 2018-01-05 14:31:44 +0100 | [diff] [blame] | 44 | __strong_alias(__loader_android_set_application_target_sdk_version, __internal_linker_error); |
| 45 | __strong_alias(__loader_android_update_LD_LIBRARY_PATH, __internal_linker_error); |
| 46 | __strong_alias(__loader_cfi_fail, __internal_linker_error); |
| 47 | __strong_alias(__loader_dl_iterate_phdr, __internal_linker_error); |
| 48 | __strong_alias(__loader_dladdr, __internal_linker_error); |
| 49 | __strong_alias(__loader_dlclose, __internal_linker_error); |
| 50 | __strong_alias(__loader_dlerror, __internal_linker_error); |
| 51 | __strong_alias(__loader_dlopen, __internal_linker_error); |
| 52 | __strong_alias(__loader_dlsym, __internal_linker_error); |
| 53 | __strong_alias(__loader_dlvsym, __internal_linker_error); |
dimitry | 06016f2 | 2018-01-05 11:39:28 +0100 | [diff] [blame] | 54 | __strong_alias(__loader_add_thread_local_dtor, __internal_linker_error); |
| 55 | __strong_alias(__loader_remove_thread_local_dtor, __internal_linker_error); |
dimitry | 581723e | 2018-01-05 14:31:44 +0100 | [diff] [blame] | 56 | #if defined(__arm__) |
| 57 | __strong_alias(__loader_dl_unwind_find_exidx, __internal_linker_error); |
| 58 | #endif |
| 59 | __strong_alias(rtld_db_dlactivity, __internal_linker_error); |
| 60 | |
Ryan Prichard | 470b666 | 2018-03-27 22:10:55 -0700 | [diff] [blame] | 61 | #if defined(__arm__) |
| 62 | // An arm32 unwinding table has an R_ARM_NONE relocation to |
| 63 | // __aeabi_unwind_cpp_pr0. This shared library will never invoke the unwinder, |
| 64 | // so it doesn't actually need the routine. Define a dummy version here, |
| 65 | // because the real version calls libc functions (e.g. memcpy, abort), which |
| 66 | // would create a dependency cycle with libc.so. |
| 67 | __attribute__((visibility("hidden"))) |
| 68 | extern "C" void __aeabi_unwind_cpp_pr0() { |
| 69 | __builtin_trap(); |
| 70 | } |
| 71 | #endif |