ld.config.txt revision 63226400f34f9ec1f07990d5b5e36b3443188463
1# Copyright (C) 2017 The Android Open Source Project
2#
3# Bionic loader config file.
4#
5
6# Don't change the order here.
7dir.system = /system/bin/
8dir.system = /system/xbin/
9dir.vendor = /vendor/bin/
10
11[system]
12additional.namespaces = sphal,vndk,rs
13
14###############################################################################
15# "default" namespace
16#
17# Framework-side code runs in this namespace. Anything from /vendor partition
18# can't be loaded in this namespace.
19###############################################################################
20namespace.default.isolated = false
21namespace.default.search.paths = /system/${LIB}:/vendor/${LIB}
22namespace.default.permitted.paths = /system/${LIB}:/vendor/${LIB}
23
24namespace.default.asan.search.paths = /data/asan/system/${LIB}:/system/${LIB}:/data/asan/vendor/${LIB}:/vendor/${LIB}
25namespace.default.asan.permitted.paths = /data/asan/system/${LIB}:/system/${LIB}:/data/asan/vendor/${LIB}:/vendor/${LIB}
26
27# TODO(b/37013858): remove all dependencies to /vendor/lib from system processes
28# When this is done, comment out following three lines and remove the three
29# lines above
30#namespace.default.isolated = true
31#namespace.default.search.paths = /system/${LIB}
32#namespace.default.permitted.paths = /system/${LIB}
33#
34#namespace.default.asan.search.paths = /data/asan/system/${LIB}:/system/${LIB}
35#namespace.default.asan.permitted.paths = /data/asan/system/${LIB}:/system/${LIB}
36
37###############################################################################
38# "sphal" namespace
39#
40# SP-HAL(Sameprocess-HAL)s are the only vendor libraries that are allowed to be
41# loaded inside system processes. libEGL_<chipset>.so, libGLESv2_<chipset>.so,
42# android.hardware.graphics.mapper@2.0-impl.so, etc are SP-HALs.
43#
44# This namespace is exclusivly for SP-HALs. When the framework tries to dynami-
45# cally load SP-HALs, android_dlopen_ext() is used to explicitly specifying
46# that they should be searched and loaded from this namespace.
47#
48# Note that there is no link from the default namespace to this namespace.
49###############################################################################
50namespace.sphal.isolated = true
51namespace.sphal.visible = true
52namespace.sphal.search.paths = /vendor/${LIB}/egl:/vendor/${LIB}/hw:/vendor/${LIB}
53namespace.sphal.permitted.paths = /vendor/${LIB}
54
55namespace.sphal.asan.search.paths = /data/asan/vendor/${LIB}/egl:/vendor/${LIB}/egl:/data/asan/vendor/${LIB}/hw:/vendor/${LIB}/hw:/data/asan/vendor/${LIB}:/vendor/${LIB}
56namespace.sphal.asan.permitted.paths = /data/asan/vendor/${LIB}:/vendor/${LIB}
57
58# Once in this namespace, access to libraries in /system/lib is restricted. Only
59# libs listed here can be used.
60namespace.sphal.links = default,vndk,rs
61
62# WARNING: only NDK libs can be listed here.
63namespace.sphal.link.default.shared_libs = libc.so:libm.so:libdl.so:libstdc++.so:liblog.so:libnativewindow.so:libEGL.so:libsync.so:libGLESv1_CM.so:libGLESv2.so:libvndksupport.so
64
65# WARNING: only VNDK-SP libs can be listed here. DO NOT EDIT this line.
66namespace.sphal.link.vndk.shared_libs = android.hardware.renderscript@1.0.so:android.hardware.graphics.allocator@2.0.so:android.hardware.graphics.mapper@2.0.so:android.hardware.graphics.common@1.0.so:libhwbinder.so:libbase.so:libcutils.so:libhardware.so:libhidlbase.so:libhidltransport.so:libutils.so:libc++.so:libz.so
67
68# Renderscript gets separate namespace
69namespace.sphal.link.rs.shared_libs = libRS_internal.so
70
71###############################################################################
72# "rs" namespace
73#
74# This namespace is exclusively for Renderscript internal libraries.
75# This namespace has slightly looser restriction than the vndk namespace because
76# of the genuine characteristics of Renderscript; /data is in the permitted path
77# to load the compiled *.so file and libmediandk.so can be used here.
78###############################################################################
79namespace.rs.isolated = true
80namespace.rs.search.paths = /system/${LIB}/vndk-sp:/vendor/${LIB}
81namespace.rs.permitted.paths = /vendor/${LIB}:/data
82
83namespace.rs.links = default,vndk
84namespace.rs.link.default.shared_libs = libc.so:libm.so:libdl.so:libstdc++.so:liblog.so:libnativewindow.so:libEGL.so:libsync.so:libGLESv1_CM.so:libGLESv2.so:libmediandk.so:libui.so:libvndksupport.so
85namespace.rs.link.vndk.shared_libs = android.hardware.renderscript@1.0.so:android.hardware.graphics.allocator@2.0.so:android.hardware.graphics.mapper@2.0.so:android.hardware.graphics.common@1.0.so:libhwbinder.so:libbase.so:libcutils.so:libhardware.so:libhidlbase.so:libhidltransport.so:libutils.so:libc++.so:libz.so
86
87###############################################################################
88# "vndk" namespace
89#
90# This namespace is exclusively for vndk-sp libs.
91###############################################################################
92namespace.vndk.isolated = true
93namespace.vndk.search.paths = /system/${LIB}/vndk-sp:/vendor/${LIB}
94namespace.vndk.permitted.paths = /vendor/${LIB}/hw:/vendor/${LIB}/egl
95
96namespace.vndk.asan.search.paths = /data/asan/system/${LIB}/vndk-sp:/system/${LIB}/vndk-sp:/data/asan/vendor/${LIB}:/vendor/${LIB}
97namespace.vndk.asan.permitted.paths = /data/asan/vendor/${LIB}/hw:/vendor/${LIB}/hw:/data/asan/vendor/${LIB}/egl:/vendor/${LIB}/egl
98
99# When these NDK libs are required inside this namespace, then it is redirected
100# to the default namespace. This is possible since their ABI is stable across
101# Android releases.
102namespace.vndk.links = default
103namespace.vndk.link.default.shared_libs = libc.so:libm.so:libdl.so:libstdc++.so:liblog.so:libnativewindow.so:libEGL.so:libsync.so:libvndksupport.so
104
105
106[vendor]
107namespace.default.isolated = false
108namespace.default.search.paths = /vendor/${LIB}:/system/${LIB}/vndk-sp:/system/${LIB}
109
110namespace.default.asan.search.paths = /data/asan/vendor/${LIB}:/vendor/${LIB}:/data/asan/system/${LIB}/vndk-sp:/system/${LIB}/vndk-sp:/data/asan/system/${LIB}:/system/${LIB}
111