Why does arm-linux-androideabi-gcc enforce -fpic?

前端 未结 1 727
猫巷女王i
猫巷女王i 2021-01-21 09:33

I was surprised to see that gcc enforces code to be position independent, even if such flag wasn\'t provided explicitly in the command line.

I suspect it might have to d

1条回答
  •  北荒
    北荒 (楼主)
    2021-01-21 09:48

    Starting with Android 4.1, Google is forcing full ASLR to overcome common security exploits, see this article for more details.

    Position Independent Code (PIC) is required for this to work but also PIE (Position Independent Executable) too.

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