Add functions to provide target sdk version
Bug: http://b/21364029
Change-Id: I8648d1bff6c8fd6e7cd12da7f128e048b9f2829a
diff --git a/libdl/Android.mk b/libdl/Android.mk
index 2a0724a..7b97dc4 100644
--- a/libdl/Android.mk
+++ b/libdl/Android.mk
@@ -15,7 +15,7 @@
#
# DO NOT REMOVE --exclude-libs!
-LOCAL_LDFLAGS := -Wl,--exclude-libs=libgcc.a
+LOCAL_LDFLAGS := -Wl,--exclude-libs=libgcc.a -Wl,--version-script=$(LOCAL_PATH)/libdl.map
# for x86, exclude libgcc_eh.a for the same reasons as above
LOCAL_LDFLAGS_x86 := -Wl,--exclude-libs=libgcc_eh.a
diff --git a/libdl/libdl.c b/libdl/libdl.c
index dca51b0..9a858a3 100644
--- a/libdl/libdl.c
+++ b/libdl/libdl.c
@@ -17,6 +17,7 @@
#include <dlfcn.h>
#include <link.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <android/dlext.h>
// These are stubs for functions that are actually defined
@@ -38,3 +39,6 @@
void android_update_LD_LIBRARY_PATH(const char* ld_library_path __unused) { }
void* android_dlopen_ext(const char* filename __unused, int flag __unused, const android_dlextinfo* extinfo __unused) { return 0; }
+
+void android_set_application_target_sdk_version(uint32_t target __unused) { }
+uint32_t android_get_application_target_sdk_version() { return 0; }
diff --git a/libdl/libdl.map b/libdl/libdl.map
new file mode 100644
index 0000000..a911cb6
--- /dev/null
+++ b/libdl/libdl.map
@@ -0,0 +1,39 @@
+#
+# Copyright (C) 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LIBC {
+ global:
+ android_dlopen_ext;
+ dl_iterate_phdr;
+# begin arm-only
+ dl_unwind_find_exidx;
+# end arm-only
+ dladdr;
+ dlclose;
+ dlerror;
+ dlopen;
+ dlsym;
+ local:
+ *;
+};
+
+LIBC_PRIVATE {
+ global:
+ android_get_application_target_sdk_version;
+ android_set_application_target_sdk_version;
+ android_get_LD_LIBRARY_PATH;
+ android_update_LD_LIBRARY_PATH;
+} LIBC;