I\'m recompiling some executable for Android 5.0 as it requires executables to be PIE
. I was able to recompile it for ARM
with just adding some argumen
If -pie and -static are both given together, gcc will issue unexpected error.
-pie
Produce a position independent executable on targets that support it. For predictable results, you must also specify the same set of options used for compilation (-fpie, -fPIE, or model suboptions) when you specify this linker option.
-pie actually create a DYN type elf file with INTERP with /system/bin/linker
executable compiled with -pie
-static
On systems that support dynamic linking, this prevents linking with the shared libraries. On other systems, this option has no effect.
-static create a EXEC type elf file with no INTERP