Add android_dlopen_ext() interface to linker.

Add a function "android_dlopen_ext()", defined in <android/dlext.h>.
This is an extended version of dlopen() which takes a struct for passing
additional parameters for Android-specific functionality. This will be
used to support RELRO section sharing between separate processes.

Bug: 13005501
Change-Id: I9c99b2f2a02ee329dedaeba09ef3a1113b17b2d6
This commit is contained in:
Torne (Richard Coles)
2014-02-06 14:34:21 +00:00
parent 26c2bb84dd
commit 012cb4583a
5 changed files with 70 additions and 16 deletions

View File

@@ -17,6 +17,7 @@
#include <dlfcn.h>
#include <link.h>
#include <stdlib.h>
#include <android/dlext.h>
// These are stubs for functions that are actually defined
// in the dynamic linker and hijacked at runtime.
@@ -27,11 +28,13 @@ void* dlsym(void* handle __unused, const char* symbol __unused) { return 0; }
int dladdr(const void* addr __unused, Dl_info* info __unused) { return 0; }
int dlclose(void* handle __unused) { return 0; }
void android_get_LD_LIBRARY_PATH(char* buffer __unused, size_t buffer_size __unused) { }
void android_update_LD_LIBRARY_PATH(const char* ld_library_path __unused) { }
#if defined(__arm__)
_Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc __unused, int* pcount __unused) { return 0; }
#endif
int dl_iterate_phdr(int (*cb)(struct dl_phdr_info* info, size_t size, void* data) __unused, void* data __unused) { return 0; }
void android_get_LD_LIBRARY_PATH(char* buffer __unused, size_t buffer_size __unused) { }
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; }