The intention behind https://android-review.googlesource.com/44791 was that only apps with API level >= 16 pick up PIE support. As you point out, programs intended to run on API level 9 won't have linker support for PIE, and will crash on startup.
However, according to https://code.google.com/p/android/issues/detail?id=39752 , it looks like there's some known problems with detecting minSdkVersion / APP_PLATFORM. I would recommend trying the workarounds in that bug to see if they help you. My advise to Jeffrey back in Jun 2013 is a hack intended for developers who insist on running PIE code on unsupported platforms, and it's not something I recommend. -- Nick On Sat, Apr 12, 2014 at 3:28 AM, Massimo Dragano <[email protected]>wrote: > Il giorno lunedì 24 giugno 2013 03:38:49 UTC+2, nnk ha scritto: > >> Support for position independent executables wasn't added to Android's >> dynamic linker until Android 4.1. Trying to run PIE binaries on prior >> Android versions isn't supported and will crash (as you've seen) >> >> As a workaround, you can embed a newer copy of /system/bin/linker into >> your APK, and compile/link your executable with the --dynamic-linker >> command line option ("man ld"). This will tell your executable to use the >> embedded dynamic linker instead of the system dynamic linker. >> >> -- Nick >> -- >> Nick Kralevich | Android Security | [email protected] | 650.214.4037 >> > > Hi Nick, > why my NDK executables are built with PIE if i have minSdkVersion="9" ?? > > there isn't any other solution? > i have to distribute a 4.1+ linker with my app? > that's really horrible...not as statically link the whole libc but... > > thanks in advance for your help. > > -- > You received this message because you are subscribed to the Google Groups > "Android Security Discussions" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to > [email protected]. > Visit this group at > http://groups.google.com/group/android-security-discuss. > For more options, visit https://groups.google.com/d/optout. > -- Nick Kralevich | Android Security | [email protected] | 650.214.4037 -- You received this message because you are subscribed to the Google Groups "Android Security Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/android-security-discuss. For more options, visit https://groups.google.com/d/optout.
