Jiyong Park | 450cff4 | 2017-04-05 14:24:14 +0900 | [diff] [blame] | 1 | # Copyright (C) 2017 The Android Open Source Project |
| 2 | # |
| 3 | # Bionic loader config file. |
| 4 | # This gives the exactly the same namespace setup in pre-O. |
| 5 | # |
| 6 | |
| 7 | # All binaries gets the same configuration 'legacy' |
| 8 | dir.legacy = /system |
changho.shin | 715b1aa | 2018-11-28 15:15:16 +0900 | [diff] [blame] | 9 | dir.legacy = /product |
Jiyong Park | 450cff4 | 2017-04-05 14:24:14 +0900 | [diff] [blame] | 10 | dir.legacy = /vendor |
Alin Jerpelea | fa7958e | 2017-09-27 09:40:59 +0200 | [diff] [blame] | 11 | dir.legacy = /odm |
Jiyong Park | 450cff4 | 2017-04-05 14:24:14 +0900 | [diff] [blame] | 12 | dir.legacy = /sbin |
| 13 | |
changho.shin | 715b1aa | 2018-11-28 15:15:16 +0900 | [diff] [blame] | 14 | # Except for /postinstall, where only /system and /product are searched |
Jiyong Park | d7e6cb2 | 2018-03-20 01:12:31 +0900 | [diff] [blame] | 15 | dir.postinstall = /postinstall |
| 16 | |
Jiyong Park | 450cff4 | 2017-04-05 14:24:14 +0900 | [diff] [blame] | 17 | [legacy] |
| 18 | namespace.default.isolated = false |
Jiyong Park | 2498e1b | 2017-12-12 22:11:47 +0900 | [diff] [blame] | 19 | |
| 20 | namespace.default.search.paths = /system/${LIB} |
changho.shin | 715b1aa | 2018-11-28 15:15:16 +0900 | [diff] [blame] | 21 | namespace.default.search.paths += /product/${LIB} |
Jiyong Park | 2498e1b | 2017-12-12 22:11:47 +0900 | [diff] [blame] | 22 | namespace.default.search.paths += /vendor/${LIB} |
| 23 | namespace.default.search.paths += /odm/${LIB} |
| 24 | |
| 25 | namespace.default.asan.search.paths = /data/asan/system/${LIB} |
| 26 | namespace.default.asan.search.paths += /system/${LIB} |
changho.shin | 715b1aa | 2018-11-28 15:15:16 +0900 | [diff] [blame] | 27 | namespace.default.asan.search.paths += /data/asan/product/${LIB} |
| 28 | namespace.default.asan.search.paths += /product/${LIB} |
Jiyong Park | 2498e1b | 2017-12-12 22:11:47 +0900 | [diff] [blame] | 29 | namespace.default.asan.search.paths += /data/asan/vendor/${LIB} |
| 30 | namespace.default.asan.search.paths += /vendor/${LIB} |
changho.shin | 715b1aa | 2018-11-28 15:15:16 +0900 | [diff] [blame] | 31 | namespace.default.asan.search.paths += /data/asan/odm/${LIB} |
| 32 | namespace.default.asan.search.paths += /odm/${LIB} |
Jiyong Park | d7e6cb2 | 2018-03-20 01:12:31 +0900 | [diff] [blame] | 33 | |
| 34 | ############################################################################### |
Nicolas Geoffray | ad12560 | 2019-01-24 21:20:20 +0000 | [diff] [blame] | 35 | # APEX related namespaces. |
| 36 | ############################################################################### |
| 37 | |
chenbruce | aa87fd5 | 2019-01-24 13:01:21 +0800 | [diff] [blame] | 38 | additional.namespaces = runtime,conscrypt,media,resolv |
Nicolas Geoffray | ad12560 | 2019-01-24 21:20:20 +0000 | [diff] [blame] | 39 | |
| 40 | # Keep in sync with ld.config.txt in the com.android.runtime APEX. |
chenbruce | d771740 | 2019-01-29 11:52:41 +0800 | [diff] [blame] | 41 | # If a shared library or an executable requests a shared library that |
| 42 | # cannot be loaded into the default namespace, the dynamic linker tries |
| 43 | # to load the shared library from the runtime namespace.And then, if the |
| 44 | # shared library cannot be loaded from the runtime namespace either, the |
| 45 | # dynamic linker tries to load the shared library from the resolv namespace. |
| 46 | # Finally, if all attempts fail, the dynamic linker returns an error. |
chenbruce | aa87fd5 | 2019-01-24 13:01:21 +0800 | [diff] [blame] | 47 | namespace.default.links = runtime,resolv |
| 48 | namespace.default.asan.links = runtime,resolv |
Nicolas Geoffray | ad12560 | 2019-01-24 21:20:20 +0000 | [diff] [blame] | 49 | # Visible because some libraries are dlopen'ed, e.g. libopenjdk is dlopen'ed by |
| 50 | # libart. |
| 51 | namespace.default.visible = true |
| 52 | namespace.default.link.runtime.shared_libs = libart.so:libartd.so |
| 53 | namespace.default.link.runtime.shared_libs += libdexfile_external.so |
| 54 | namespace.default.link.runtime.shared_libs += libnativebridge.so |
| 55 | namespace.default.link.runtime.shared_libs += libnativehelper.so |
| 56 | namespace.default.link.runtime.shared_libs += libnativeloader.so |
Victor Chang | 785ba2e | 2019-01-15 18:04:56 +0000 | [diff] [blame] | 57 | namespace.default.link.runtime.shared_libs += libandroidicu.so |
| 58 | |
| 59 | # TODO(b/122876336): Remove libpac.so once it's migrated to Webview |
| 60 | namespace.default.link.runtime.shared_libs += libpac.so |
Nicolas Geoffray | ad12560 | 2019-01-24 21:20:20 +0000 | [diff] [blame] | 61 | |
chenbruce | d771740 | 2019-01-29 11:52:41 +0800 | [diff] [blame] | 62 | # When libnetd_resolv.so can't be found in the default namespace, search for it |
| 63 | # in the resolv namespace. Don't allow any other libraries from the resolv namespace |
| 64 | # to be loaded in the default namespace. |
chenbruce | aa87fd5 | 2019-01-24 13:01:21 +0800 | [diff] [blame] | 65 | namespace.default.link.resolv.shared_libs = libnetd_resolv.so |
| 66 | |
Nicolas Geoffray | ad12560 | 2019-01-24 21:20:20 +0000 | [diff] [blame] | 67 | ############################################################################### |
| 68 | # "runtime" APEX namespace |
| 69 | # |
| 70 | # This namespace exposes externally accessible libraries from the Runtime APEX. |
| 71 | ############################################################################### |
| 72 | namespace.runtime.isolated = true |
Nicolas Geoffray | a9b4f2b | 2019-01-26 01:06:43 +0000 | [diff] [blame] | 73 | namespace.runtime.visible = true |
Nicolas Geoffray | ad12560 | 2019-01-24 21:20:20 +0000 | [diff] [blame] | 74 | |
| 75 | # Keep in sync with ld.config.txt in the com.android.runtime APEX. |
| 76 | namespace.runtime.search.paths = /apex/com.android.runtime/${LIB} |
| 77 | namespace.runtime.asan.search.paths = /apex/com.android.runtime/${LIB} |
| 78 | namespace.runtime.links = default |
| 79 | # TODO(b/119867084): Restrict to Bionic dlopen dependencies and PALette library |
| 80 | # when it exists. |
| 81 | namespace.runtime.link.default.allow_all_shared_libs = true |
| 82 | |
| 83 | ############################################################################### |
| 84 | # "media" APEX namespace |
| 85 | # |
| 86 | # This namespace is for libraries within the media APEX. |
| 87 | ############################################################################### |
| 88 | namespace.media.isolated = true |
| 89 | namespace.media.visible = true |
| 90 | |
| 91 | namespace.media.search.paths = /apex/com.android.media/${LIB} |
| 92 | namespace.media.asan.search.paths = /apex/com.android.media/${LIB} |
| 93 | |
| 94 | namespace.media.links = default |
| 95 | namespace.media.link.default.shared_libs = %LLNDK_LIBRARIES% |
| 96 | namespace.media.link.default.shared_libs += libandroid.so |
| 97 | namespace.media.link.default.shared_libs += libbinder_ndk.so |
Dongwon Kang | 0095e35 | 2019-01-25 09:26:17 -0800 | [diff] [blame] | 98 | namespace.media.link.default.shared_libs += libmediametrics.so |
Nicolas Geoffray | ad12560 | 2019-01-24 21:20:20 +0000 | [diff] [blame] | 99 | namespace.media.link.default.shared_libs += %SANITIZER_RUNTIME_LIBRARIES% |
| 100 | |
| 101 | ############################################################################### |
| 102 | # "conscrypt" APEX namespace |
| 103 | # |
| 104 | # This namespace is for libraries within the conscrypt APEX. |
| 105 | ############################################################################### |
| 106 | namespace.conscrypt.isolated = true |
| 107 | namespace.conscrypt.visible = true |
| 108 | |
| 109 | # Keep in sync with ld.config.txt in the com.android.runtime APEX. |
| 110 | namespace.conscrypt.search.paths = /apex/com.android.conscrypt/${LIB} |
| 111 | namespace.conscrypt.asan.search.paths = /apex/com.android.conscrypt/${LIB} |
Pete Bentley | 7b967bf | 2019-01-30 18:35:48 +0000 | [diff] [blame] | 112 | namespace.conscrypt.links = runtime,default |
| 113 | namespace.conscrypt.link.runtime.shared_libs = libjavacore.so |
Nicolas Geoffray | ad12560 | 2019-01-24 21:20:20 +0000 | [diff] [blame] | 114 | namespace.conscrypt.link.default.shared_libs = libc.so |
| 115 | namespace.conscrypt.link.default.shared_libs += libm.so |
| 116 | namespace.conscrypt.link.default.shared_libs += libdl.so |
Tom Cherry | fe1f701 | 2019-02-08 11:55:36 -0800 | [diff] [blame] | 117 | namespace.conscrypt.link.default.shared_libs += liblog.so |
Nicolas Geoffray | ad12560 | 2019-01-24 21:20:20 +0000 | [diff] [blame] | 118 | |
| 119 | ############################################################################### |
chenbruce | aa87fd5 | 2019-01-24 13:01:21 +0800 | [diff] [blame] | 120 | # "resolv" APEX namespace |
| 121 | # |
| 122 | # This namespace is for libraries within the resolv APEX. |
| 123 | ############################################################################### |
| 124 | namespace.resolv.isolated = true |
| 125 | namespace.resolv.visible = true |
| 126 | |
| 127 | namespace.resolv.search.paths = /apex/com.android.resolv/${LIB} |
| 128 | namespace.resolv.asan.search.paths = /apex/com.android.resolv/${LIB} |
| 129 | namespace.resolv.links = default |
| 130 | namespace.resolv.link.default.shared_libs = libc.so |
| 131 | namespace.resolv.link.default.shared_libs += libm.so |
| 132 | namespace.resolv.link.default.shared_libs += libdl.so |
| 133 | namespace.resolv.link.default.shared_libs += libbinder_ndk.so |
Tom Cherry | fe1f701 | 2019-02-08 11:55:36 -0800 | [diff] [blame] | 134 | namespace.resolv.link.default.shared_libs += liblog.so |
Dongwon Kang | 9dff515 | 2019-02-08 14:00:35 -0800 | [diff] [blame] | 135 | namespace.resolv.link.default.shared_libs += libvndksupport.so |
chenbruce | aa87fd5 | 2019-01-24 13:01:21 +0800 | [diff] [blame] | 136 | |
| 137 | ############################################################################### |
Jiyong Park | d7e6cb2 | 2018-03-20 01:12:31 +0900 | [diff] [blame] | 138 | # Namespace config for binaries under /postinstall. |
| 139 | # Only one default namespace is defined and it has no directories other than |
changho.shin | 715b1aa | 2018-11-28 15:15:16 +0900 | [diff] [blame] | 140 | # /system/lib and /product/lib in the search paths. This is because linker |
| 141 | # calls realpath on the search paths and this causes selinux denial if the |
| 142 | # paths (/vendor, /odm) are not allowed to the poinstall binaries. |
| 143 | # There is no reason to allow the binaries to access the paths. |
Jiyong Park | d7e6cb2 | 2018-03-20 01:12:31 +0900 | [diff] [blame] | 144 | ############################################################################### |
| 145 | [postinstall] |
| 146 | namespace.default.isolated = false |
changho.shin | 715b1aa | 2018-11-28 15:15:16 +0900 | [diff] [blame] | 147 | namespace.default.search.paths = /system/${LIB} |
| 148 | namespace.default.search.paths += /product/${LIB} |