blob: fa463343c781293c8f24dbe958652f5ea09b66ee [file] [log] [blame]
Jiyong Park450cff42017-04-05 14:24:14 +09001# 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'
8dir.legacy = /system
changho.shin715b1aa2018-11-28 15:15:16 +09009dir.legacy = /product
Jiyong Park450cff42017-04-05 14:24:14 +090010dir.legacy = /vendor
Alin Jerpeleafa7958e2017-09-27 09:40:59 +020011dir.legacy = /odm
Jiyong Park450cff42017-04-05 14:24:14 +090012dir.legacy = /sbin
13
Roland Levillain5c99a0c2019-03-18 17:37:36 +000014dir.legacy = /data/nativetest
15dir.legacy = /data/nativetest64
16dir.legacy = /data/benchmarktest
17dir.legacy = /data/benchmarktest64
18
changho.shin715b1aa2018-11-28 15:15:16 +090019# Except for /postinstall, where only /system and /product are searched
Jiyong Parkd7e6cb22018-03-20 01:12:31 +090020dir.postinstall = /postinstall
21
Jiyong Park450cff42017-04-05 14:24:14 +090022[legacy]
23namespace.default.isolated = false
Jiyong Park2498e1b2017-12-12 22:11:47 +090024
25namespace.default.search.paths = /system/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090026namespace.default.search.paths += /product/${LIB}
Jiyong Park2498e1b2017-12-12 22:11:47 +090027namespace.default.search.paths += /vendor/${LIB}
28namespace.default.search.paths += /odm/${LIB}
29
30namespace.default.asan.search.paths = /data/asan/system/${LIB}
31namespace.default.asan.search.paths += /system/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090032namespace.default.asan.search.paths += /data/asan/product/${LIB}
33namespace.default.asan.search.paths += /product/${LIB}
Jiyong Park2498e1b2017-12-12 22:11:47 +090034namespace.default.asan.search.paths += /data/asan/vendor/${LIB}
35namespace.default.asan.search.paths += /vendor/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090036namespace.default.asan.search.paths += /data/asan/odm/${LIB}
37namespace.default.asan.search.paths += /odm/${LIB}
Jiyong Parkd7e6cb22018-03-20 01:12:31 +090038
39###############################################################################
Nicolas Geoffrayad125602019-01-24 21:20:20 +000040# APEX related namespaces.
41###############################################################################
42
chenbruceaa87fd52019-01-24 13:01:21 +080043additional.namespaces = runtime,conscrypt,media,resolv
Nicolas Geoffrayad125602019-01-24 21:20:20 +000044
45# Keep in sync with ld.config.txt in the com.android.runtime APEX.
chenbruced7717402019-01-29 11:52:41 +080046# If a shared library or an executable requests a shared library that
47# cannot be loaded into the default namespace, the dynamic linker tries
Roland Levillaine51c8762019-03-07 19:06:57 +000048# to load the shared library from the runtime namespace. And then, if the
chenbruced7717402019-01-29 11:52:41 +080049# shared library cannot be loaded from the runtime namespace either, the
50# dynamic linker tries to load the shared library from the resolv namespace.
51# Finally, if all attempts fail, the dynamic linker returns an error.
chenbruceaa87fd52019-01-24 13:01:21 +080052namespace.default.links = runtime,resolv
53namespace.default.asan.links = runtime,resolv
Nicolas Geoffrayad125602019-01-24 21:20:20 +000054# Visible because some libraries are dlopen'ed, e.g. libopenjdk is dlopen'ed by
55# libart.
56namespace.default.visible = true
57namespace.default.link.runtime.shared_libs = libart.so:libartd.so
58namespace.default.link.runtime.shared_libs += libdexfile_external.so
59namespace.default.link.runtime.shared_libs += libnativebridge.so
60namespace.default.link.runtime.shared_libs += libnativehelper.so
61namespace.default.link.runtime.shared_libs += libnativeloader.so
Victor Chang785ba2e2019-01-15 18:04:56 +000062namespace.default.link.runtime.shared_libs += libandroidicu.so
63
64# TODO(b/122876336): Remove libpac.so once it's migrated to Webview
65namespace.default.link.runtime.shared_libs += libpac.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +000066
chenbruced7717402019-01-29 11:52:41 +080067# When libnetd_resolv.so can't be found in the default namespace, search for it
68# in the resolv namespace. Don't allow any other libraries from the resolv namespace
69# to be loaded in the default namespace.
chenbruceaa87fd52019-01-24 13:01:21 +080070namespace.default.link.resolv.shared_libs = libnetd_resolv.so
71
Nicolas Geoffrayad125602019-01-24 21:20:20 +000072###############################################################################
73# "runtime" APEX namespace
74#
75# This namespace exposes externally accessible libraries from the Runtime APEX.
76###############################################################################
77namespace.runtime.isolated = true
Nicolas Geoffraya9b4f2b2019-01-26 01:06:43 +000078namespace.runtime.visible = true
Nicolas Geoffrayad125602019-01-24 21:20:20 +000079
80# Keep in sync with ld.config.txt in the com.android.runtime APEX.
81namespace.runtime.search.paths = /apex/com.android.runtime/${LIB}
82namespace.runtime.asan.search.paths = /apex/com.android.runtime/${LIB}
83namespace.runtime.links = default
84# TODO(b/119867084): Restrict to Bionic dlopen dependencies and PALette library
85# when it exists.
86namespace.runtime.link.default.allow_all_shared_libs = true
87
88###############################################################################
89# "media" APEX namespace
90#
91# This namespace is for libraries within the media APEX.
92###############################################################################
93namespace.media.isolated = true
94namespace.media.visible = true
95
96namespace.media.search.paths = /apex/com.android.media/${LIB}
97namespace.media.asan.search.paths = /apex/com.android.media/${LIB}
98
Dongwon Kang3408eaa2019-02-22 00:47:13 -080099namespace.media.permitted.paths = /apex/com.android.media/${LIB}/extractors
100
Nicolas Geoffrayad125602019-01-24 21:20:20 +0000101namespace.media.links = default
Dongwon Kanga013e3d2019-03-15 14:43:07 -0700102namespace.media.link.default.shared_libs = libandroid.so
103namespace.media.link.default.shared_libs += libbinder_ndk.so
104namespace.media.link.default.shared_libs += libc.so
105namespace.media.link.default.shared_libs += libdl.so
106namespace.media.link.default.shared_libs += liblog.so
107namespace.media.link.default.shared_libs += libmediametrics.so
108namespace.media.link.default.shared_libs += libmediandk.so
109namespace.media.link.default.shared_libs += libm.so
110namespace.media.link.default.shared_libs += libvndksupport.so
111
112namespace.media.link.default.shared_libs += libclang_rt.asan-aarch64-android.so
113namespace.media.link.default.shared_libs += libclang_rt.asan-arm-android.so
114namespace.media.link.default.shared_libs += libclang_rt.asan-i686-android.so
115namespace.media.link.default.shared_libs += libclang_rt.asan-x86_64-android.so
116namespace.media.link.default.shared_libs += libclang_rt.hwasan-aarch64-android.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +0000117
118###############################################################################
119# "conscrypt" APEX namespace
120#
121# This namespace is for libraries within the conscrypt APEX.
122###############################################################################
123namespace.conscrypt.isolated = true
124namespace.conscrypt.visible = true
125
126# Keep in sync with ld.config.txt in the com.android.runtime APEX.
127namespace.conscrypt.search.paths = /apex/com.android.conscrypt/${LIB}
128namespace.conscrypt.asan.search.paths = /apex/com.android.conscrypt/${LIB}
Pete Bentley7b967bf2019-01-30 18:35:48 +0000129namespace.conscrypt.links = runtime,default
130namespace.conscrypt.link.runtime.shared_libs = libjavacore.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +0000131namespace.conscrypt.link.default.shared_libs = libc.so
132namespace.conscrypt.link.default.shared_libs += libm.so
133namespace.conscrypt.link.default.shared_libs += libdl.so
Tom Cherryfe1f7012019-02-08 11:55:36 -0800134namespace.conscrypt.link.default.shared_libs += liblog.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +0000135
136###############################################################################
chenbruceaa87fd52019-01-24 13:01:21 +0800137# "resolv" APEX namespace
138#
139# This namespace is for libraries within the resolv APEX.
140###############################################################################
141namespace.resolv.isolated = true
142namespace.resolv.visible = true
143
144namespace.resolv.search.paths = /apex/com.android.resolv/${LIB}
145namespace.resolv.asan.search.paths = /apex/com.android.resolv/${LIB}
146namespace.resolv.links = default
147namespace.resolv.link.default.shared_libs = libc.so
148namespace.resolv.link.default.shared_libs += libm.so
149namespace.resolv.link.default.shared_libs += libdl.so
150namespace.resolv.link.default.shared_libs += libbinder_ndk.so
Tom Cherryfe1f7012019-02-08 11:55:36 -0800151namespace.resolv.link.default.shared_libs += liblog.so
Dongwon Kang9dff5152019-02-08 14:00:35 -0800152namespace.resolv.link.default.shared_libs += libvndksupport.so
chenbruceaa87fd52019-01-24 13:01:21 +0800153
154###############################################################################
Jiyong Parkd7e6cb22018-03-20 01:12:31 +0900155# Namespace config for binaries under /postinstall.
156# Only one default namespace is defined and it has no directories other than
changho.shin715b1aa2018-11-28 15:15:16 +0900157# /system/lib and /product/lib in the search paths. This is because linker
158# calls realpath on the search paths and this causes selinux denial if the
159# paths (/vendor, /odm) are not allowed to the poinstall binaries.
160# There is no reason to allow the binaries to access the paths.
Jiyong Parkd7e6cb22018-03-20 01:12:31 +0900161###############################################################################
162[postinstall]
163namespace.default.isolated = false
changho.shin715b1aa2018-11-28 15:15:16 +0900164namespace.default.search.paths = /system/${LIB}
165namespace.default.search.paths += /product/${LIB}