summaryrefslogtreecommitdiff
path: root/libdl
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2018-12-13 18:26:48 +0900
committerJiyong Park <jiyong@google.com>2019-01-04 22:29:36 +0900
commitc45fe9f7bd49b110f63b5928d00cf33a7b515d04 (patch)
tree71c0df52796a2e3b24e1983897f019101e6bcf3e /libdl
parentc975355066daf0b3012d236aa4e726b0d3d7e06a (diff)
Add stubs variants for bionic libs
Bionic libs are part of the runtime APEX (com.android.runtime). In order to be able to update the runtime APEX independetly from the platform, we have to prevent things outside of the APEX from using bionic symbols that are not guaranteed to be stable. Otherwise, platform could break when a symbol is removed from the libs via the APEX update. To achive this goal, this change adds stubs variant to the bionic libs. With this, things outside of the runtime APEX (i.e. other APEXes and the platform) are built with the stubs variants that provide only the symbols that are guaranteed to be stable. The set of symbols are basically the same as the symbols available to NDK clients. However, there are a few additional symbols that are not available for NDK but should be made available for platform components. They are marked with "# apex" tag. Symbols with that tag are not exposed to apps (via NDK stubs) or vendors (via LLNDK stubs). Note that the stubs is a build-time only artifact. It is used just to break the build when private symbols are used outside of the runtime APEX. At runtime, the real library in the APEX is used. Bug: 120266448 Test: m Test: m bionic-unit-tests Change-Id: I7b8d75830c81d7d7d54e2fca21a85b3417531b47
Diffstat (limited to 'libdl')
-rw-r--r--libdl/Android.bp5
-rw-r--r--libdl/libdl.map.txt20
2 files changed, 17 insertions, 8 deletions
diff --git a/libdl/Android.bp b/libdl/Android.bp
index c4078a0c5..262da6c7d 100644
--- a/libdl/Android.bp
+++ b/libdl/Android.bp
@@ -100,6 +100,11 @@ cc_library {
sanitize: {
never: true,
},
+
+ stubs: {
+ symbol_file: "libdl.map.txt",
+ versions: ["10000"],
+ },
}
ndk_library {
diff --git a/libdl/libdl.map.txt b/libdl/libdl.map.txt
index c5d1be4d0..15148276a 100644
--- a/libdl/libdl.map.txt
+++ b/libdl/libdl.map.txt
@@ -41,15 +41,19 @@ LIBC_OMR1 { # introduced=27
__cfi_slowpath_diag;
} LIBC_N;
+LIBC_Q { # introduced=29
+ global:
+ android_create_namespace; # apex
+ android_dlwarning; # apex
+ android_get_LD_LIBRARY_PATH; # apex
+ android_get_exported_namespace; # apex
+ android_init_anonymous_namespace; # apex
+ android_link_namespaces; # apex
+ android_set_application_target_sdk_version; # apex
+} LIBC_OMR1;
+
LIBC_PLATFORM {
global:
__cfi_init;
- android_dlwarning;
- android_set_application_target_sdk_version;
- android_get_LD_LIBRARY_PATH;
android_update_LD_LIBRARY_PATH;
- android_init_anonymous_namespace;
- android_create_namespace;
- android_link_namespaces;
- android_get_exported_namespace;
-} LIBC_OMR1;
+} LIBC_Q;