Add android_dlwarning() method
This is temporary method intended to use
for a toast message on preview and beta
releases. Will be removed before the
production release.
Bug: http://b/27365747
Change-Id: I39cc716bb82863ae761b6821bcec77cce6db3781
diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp
index a7c3fb0..89b2a36 100644
--- a/linker/dlfcn.cpp
+++ b/linker/dlfcn.cpp
@@ -15,6 +15,7 @@
*/
#include "linker.h"
+#include "linker_dlwarning.h"
#include <pthread.h>
#include <stdio.h>
@@ -136,6 +137,11 @@
return get_application_target_sdk_version();
}
+const char* android_dlwarning() {
+ ScopedPthreadMutexLocker locker(&g_dl_mutex);
+ return get_dlwarning();
+}
+
bool android_init_namespaces(const char* public_ns_sonames,
const char* anon_ns_library_path) {
ScopedPthreadMutexLocker locker(&g_dl_mutex);
@@ -190,11 +196,11 @@
// 00000000001 1111111112222222222 3333333333444444444455555555556666666666777 777777788888888889999999999
// 01234567890 1234567890123456789 0123456789012345678901234567890123456789012 345678901234567890123456789
"erate_phdr\0android_dlopen_ext\0android_set_application_target_sdk_version\0android_get_application_tar"
- // 0000000000111111 111122222222223333333333 4444444444555555555566666 6666677
- // 0123456789012345 678901234567890123456789 0123456789012345678901234 5678901
- "get_sdk_version\0android_init_namespaces\0android_create_namespace\0dlvsym\0"
+ // 0000000000111111 111122222222223333333333 4444444444555555555566666 6666677 777777778888888888
+ // 0123456789012345 678901234567890123456789 0123456789012345678901234 5678901 234567890123456789
+ "get_sdk_version\0android_init_namespaces\0android_create_namespace\0dlvsym\0android_dlwarning\0"
#if defined(__arm__)
- // 272
+ // 290
"dl_unwind_find_exidx\0"
#endif
;
@@ -219,8 +225,9 @@
ELFW(SYM_INITIALIZER)(216, &android_init_namespaces, 1),
ELFW(SYM_INITIALIZER)(240, &android_create_namespace, 1),
ELFW(SYM_INITIALIZER)(265, &dlvsym, 1),
+ ELFW(SYM_INITIALIZER)(272, &android_dlwarning, 1),
#if defined(__arm__)
- ELFW(SYM_INITIALIZER)(272, &dl_unwind_find_exidx, 1),
+ ELFW(SYM_INITIALIZER)(290, &dl_unwind_find_exidx, 1),
#endif
};
@@ -237,9 +244,9 @@
// Note that adding any new symbols here requires stubbing them out in libdl.
static unsigned g_libdl_buckets[1] = { 1 };
#if defined(__arm__)
-static unsigned g_libdl_chains[] = { 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0 };
+static unsigned g_libdl_chains[] = { 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0 };
#else
-static unsigned g_libdl_chains[] = { 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0 };
+static unsigned g_libdl_chains[] = { 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0 };
#endif
static uint8_t __libdl_info_buf[sizeof(soinfo)] __attribute__((aligned(8)));