Hi all,
Up until Android 6, we have loaded our libraries as shown here
System.loadLibrary("c"); //libc.so
System.loadLibrary("m"); //libm.so
System.loadLibrary("dl"); //libdl.so
System.loadLibrary("gnustl_shared"); //libgnustl_shared.so
System.loadLibrary("ourA"); //libourA.so
...
System.loadLibrary("ourZ"); //libourZ.so
this worked fine, but starting from Android 6 it shows: "
dlopen failed: cannot locate symbol “__cxa_finalize” referenced by “/system/lib/libdl.so”..." error.
Then we have removed all standard libraries from loading (libc, libm, libdl), this time Android 6 started fine (but with different bug), at lease it didnt show error about __cxa_finalize
Same code we tested in Android 5, again it started fine.
Here is my question.
- Do we really need load system libraries if we depend on them? according to this thread:
https://groups.google.com/forum/?fromgroups#!msg/android-ndk/J3lzK4X--bM/4YaijymZy_AJIn a nutshell, the dynamic linker doesn't know anything about your
application (e.g. where its libraries live), it only knows about the
LD_LIBRARY_PATH value that was set when the process was created.
system can find its own libraries and no need to do System.loadLibrary(...) for standard libraries.
- In case our assumption is not correct about not loading system libraries, why did Android 6 shows us such an error?
libdl is system library, libc system library, they know each other, libc contains __cxa_finalize, why Android 6 gives this error?
Thanks.