How To Compile .so For Android O Without Writable And Executable Segments? How To Set Specific Elf Permissions?
https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Writable-and-Executable-Segments-Enforced-for-API-level-26 Currently Android O Previ
Solution 1:
The GNU toolchains and the Android toolchains have been doing the right thing for a long, long time now. You can use the readelf
/grep
command in the article:
$ readelf --program-headers -W libBadFlags.so | grep WE
If there is no output, you should be fine. If there is output, you need to track down the source of the writable/executable mapping. For a GNU_STACK
header, it is likely an assembler file with a missing annotation (a mere oversight). But much more obscure things are possible, so there is no generic solution.
But in most cases, no changes to your project should be needed.
Post a Comment for "How To Compile .so For Android O Without Writable And Executable Segments? How To Set Specific Elf Permissions?"