androidnativeandroid-4.4-kitkat

mylib.so has text relocations. This is wasting memory and is a security risk. Please fix


My Android application (using native library) print this warning on Android 4.4:

linker mylib.so has text relocations. This is wasting memory and is a security risk. Please fix.

What is it and how to fix it?


Solution

  • This would appear to be a result of two ndk-gcc bugs mentioned at https://code.google.com/p/android/issues/detail?id=23203

    and stated there to have been fixed as of ndk-r8c.

    It would appear that the check for libraries with the issue has been added only recently.

    Note: The link URL is explicit because the destination is what makes it authoritative.

    Further Note Changing NDK versions is only a fix when the warning is due to the code of your application. It will have no effect if the warning is instead on a system component such as libdvm - that can only be fixed by a system update.