How to compile .so for Android O without Writable and Executable Segments? How to set specific ELF permissions?

前端 未结 1 1902
野的像风
野的像风 2021-01-21 15:20

https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Writable-and-Executable-Segments-Enforced-for-API-level-26

Currently Andr

相关标签:
1条回答
  • 2021-01-21 15:29

    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.

    0 讨论(0)
提交回复
热议问题