blob: e897d8118afc3b0cd1b96e1a578237540d5e2395 [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
changho.shin715b1aa2018-11-28 15:15:16 +090014# Except for /postinstall, where only /system and /product are searched
Jiyong Parkd7e6cb22018-03-20 01:12:31 +090015dir.postinstall = /postinstall
16
Jiyong Park450cff42017-04-05 14:24:14 +090017[legacy]
18namespace.default.isolated = false
Jiyong Park2498e1b2017-12-12 22:11:47 +090019
20namespace.default.search.paths = /system/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090021namespace.default.search.paths += /product/${LIB}
Jiyong Park2498e1b2017-12-12 22:11:47 +090022namespace.default.search.paths += /vendor/${LIB}
23namespace.default.search.paths += /odm/${LIB}
24
25namespace.default.asan.search.paths = /data/asan/system/${LIB}
26namespace.default.asan.search.paths += /system/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090027namespace.default.asan.search.paths += /data/asan/product/${LIB}
28namespace.default.asan.search.paths += /product/${LIB}
Jiyong Park2498e1b2017-12-12 22:11:47 +090029namespace.default.asan.search.paths += /data/asan/vendor/${LIB}
30namespace.default.asan.search.paths += /vendor/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090031namespace.default.asan.search.paths += /data/asan/odm/${LIB}
32namespace.default.asan.search.paths += /odm/${LIB}
Jiyong Parkd7e6cb22018-03-20 01:12:31 +090033
34###############################################################################
Nicolas Geoffrayad125602019-01-24 21:20:20 +000035# APEX related namespaces.
36###############################################################################
37
chenbruceaa87fd52019-01-24 13:01:21 +080038additional.namespaces = runtime,conscrypt,media,resolv
Nicolas Geoffrayad125602019-01-24 21:20:20 +000039
40# Keep in sync with ld.config.txt in the com.android.runtime APEX.
chenbruced7717402019-01-29 11:52:41 +080041# 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.
chenbruceaa87fd52019-01-24 13:01:21 +080047namespace.default.links = runtime,resolv
48namespace.default.asan.links = runtime,resolv
Nicolas Geoffrayad125602019-01-24 21:20:20 +000049# Visible because some libraries are dlopen'ed, e.g. libopenjdk is dlopen'ed by
50# libart.
51namespace.default.visible = true
52namespace.default.link.runtime.shared_libs = libart.so:libartd.so
53namespace.default.link.runtime.shared_libs += libdexfile_external.so
54namespace.default.link.runtime.shared_libs += libnativebridge.so
55namespace.default.link.runtime.shared_libs += libnativehelper.so
56namespace.default.link.runtime.shared_libs += libnativeloader.so
57
chenbruced7717402019-01-29 11:52:41 +080058# When libnetd_resolv.so can't be found in the default namespace, search for it
59# in the resolv namespace. Don't allow any other libraries from the resolv namespace
60# to be loaded in the default namespace.
chenbruceaa87fd52019-01-24 13:01:21 +080061namespace.default.link.resolv.shared_libs = libnetd_resolv.so
62
Nicolas Geoffrayad125602019-01-24 21:20:20 +000063###############################################################################
64# "runtime" APEX namespace
65#
66# This namespace exposes externally accessible libraries from the Runtime APEX.
67###############################################################################
68namespace.runtime.isolated = true
Nicolas Geoffraya9b4f2b2019-01-26 01:06:43 +000069namespace.runtime.visible = true
Nicolas Geoffrayad125602019-01-24 21:20:20 +000070
71# Keep in sync with ld.config.txt in the com.android.runtime APEX.
72namespace.runtime.search.paths = /apex/com.android.runtime/${LIB}
73namespace.runtime.asan.search.paths = /apex/com.android.runtime/${LIB}
74namespace.runtime.links = default
75# TODO(b/119867084): Restrict to Bionic dlopen dependencies and PALette library
76# when it exists.
77namespace.runtime.link.default.allow_all_shared_libs = true
78
79###############################################################################
80# "media" APEX namespace
81#
82# This namespace is for libraries within the media APEX.
83###############################################################################
84namespace.media.isolated = true
85namespace.media.visible = true
86
87namespace.media.search.paths = /apex/com.android.media/${LIB}
88namespace.media.asan.search.paths = /apex/com.android.media/${LIB}
89
90namespace.media.links = default
91namespace.media.link.default.shared_libs = %LLNDK_LIBRARIES%
92namespace.media.link.default.shared_libs += libandroid.so
93namespace.media.link.default.shared_libs += libbinder_ndk.so
Dongwon Kang0095e352019-01-25 09:26:17 -080094namespace.media.link.default.shared_libs += libmediametrics.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +000095namespace.media.link.default.shared_libs += %SANITIZER_RUNTIME_LIBRARIES%
96
97###############################################################################
98# "conscrypt" APEX namespace
99#
100# This namespace is for libraries within the conscrypt APEX.
101###############################################################################
102namespace.conscrypt.isolated = true
103namespace.conscrypt.visible = true
104
105# Keep in sync with ld.config.txt in the com.android.runtime APEX.
106namespace.conscrypt.search.paths = /apex/com.android.conscrypt/${LIB}
107namespace.conscrypt.asan.search.paths = /apex/com.android.conscrypt/${LIB}
Pete Bentley7b967bf2019-01-30 18:35:48 +0000108namespace.conscrypt.links = runtime,default
109namespace.conscrypt.link.runtime.shared_libs = libjavacore.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +0000110namespace.conscrypt.link.default.shared_libs = libc.so
111namespace.conscrypt.link.default.shared_libs += libm.so
112namespace.conscrypt.link.default.shared_libs += libdl.so
113
114###############################################################################
chenbruceaa87fd52019-01-24 13:01:21 +0800115# "resolv" APEX namespace
116#
117# This namespace is for libraries within the resolv APEX.
118###############################################################################
119namespace.resolv.isolated = true
120namespace.resolv.visible = true
121
122namespace.resolv.search.paths = /apex/com.android.resolv/${LIB}
123namespace.resolv.asan.search.paths = /apex/com.android.resolv/${LIB}
124namespace.resolv.links = default
125namespace.resolv.link.default.shared_libs = libc.so
126namespace.resolv.link.default.shared_libs += libm.so
127namespace.resolv.link.default.shared_libs += libdl.so
128namespace.resolv.link.default.shared_libs += libbinder_ndk.so
Dongwon Kang9dff5152019-02-08 14:00:35 -0800129namespace.resolv.link.default.shared_libs += libvndksupport.so
chenbruceaa87fd52019-01-24 13:01:21 +0800130
131###############################################################################
Jiyong Parkd7e6cb22018-03-20 01:12:31 +0900132# Namespace config for binaries under /postinstall.
133# Only one default namespace is defined and it has no directories other than
changho.shin715b1aa2018-11-28 15:15:16 +0900134# /system/lib and /product/lib in the search paths. This is because linker
135# calls realpath on the search paths and this causes selinux denial if the
136# paths (/vendor, /odm) are not allowed to the poinstall binaries.
137# There is no reason to allow the binaries to access the paths.
Jiyong Parkd7e6cb22018-03-20 01:12:31 +0900138###############################################################################
139[postinstall]
140namespace.default.isolated = false
changho.shin715b1aa2018-11-28 15:15:16 +0900141namespace.default.search.paths = /system/${LIB}
142namespace.default.search.paths += /product/${LIB}