I have prebuilt shared library (libssl.so) and I need to rename to a different name before linking to my executable(wpa_supplicant
).
Reason: I don’t want other executables from loading this library (because it has some custom code)
I can’t modify the build rules for libssl.so in its Android.mk because neither I own that code, nor I can build it.
I tried writing an Android.bp file for including this prebuilt library with a different name(mylibssl.so) and used this new name as LOCAL_SHARED_LIBRARIES for my executable(wpa_supplicant)
But when I checked the dependencies of my executable(using readelf -d wpa_supplicant
), it still points to libssl.so
0x0000000000000001 (NEEDED) Shared library: [libssl.so]
When we open the corresponding so.toc file from the build intermediates of the shared library, we see that the SONAME is still the original shared library’s name and not the renamed shared library filename.
0x000000000000000e (SONAME) Library soname: [libssl.so]