Code: $ ./curl --help error: only position independent executables (PIE) are supported.

Code: 3a06: f8c6 5098 str.w r5, [r6, #152] ; 0x98 3a0a: f8c6 4100 str.w r4, [r6, #256] ; 0x100 3a0e: 8a0a ldrh r2, [r1, #16] 3a10: 2a03 cmp r2, #3 3a12: d007 beq.n 3a24 // change to e007 (b.n) 3a14: 4992 ldr r1, [pc, #584] ; (3c60) 3a16: 2002 movs r0, #2 3a18: 4479 add r1, pc

Code: $ ./curl --help Usage: curl [options...] <url> Options: (H) means HTTP/HTTPS only, (F) means FTP only --anyauth Pick "any" authentication method (H) -a, --append Append to target file when uploading (F/SFTP) --basic Use HTTP Basic Authentication (H) --cacert FILE CA certificate to verify peer against (SSL) [...]

Last month, Chainfire posted a nice writeup on several new security changes happening upstream in AOSP. There has been much discussion of the SELinux changes and what that means for root apps, but I'd like to touch on another change that can affect even garden variety non-root apps: mandatory PIE (position-independent executables).If you're running the Android "L" developer preview image, you may have noticed that some of your native binaries no longer execute:PIE is a useful security feature, as randomizing the address space makes it significantly more difficult for an attacker to exploit bugs in a program. However, in this case, one must trade off compatibility for security: PIE is only available in JB 4.1 and above, so. The new PIE check in "L" will cause breakage for most apps that ship native executables.As it turns out, even some of the precompiled binaries shipped with Android itself are affected, and Google has temporarily disabled PIE enforcement . It is not clear whether they will re-enable it at a later date.Since the Android "L" preview images were built prior to Google's latest change, they still have PIE enabled. I am attaching a flashable "bypass-pie.zip" which overwrites one byte in /system/bin/linker to bypass the PIE check:Use this at your own risk. It works for me. The same non-PIE curl binary now runs correctly with the patched linker:This was tested on hammerhead-lpv79-preview-ac1d8a8e.tgz. If somebody wants to test on razor-lpv79-preview-d0ddf8ce.tgz and post the result, that would be helpful.It is not necessary to wipe any caches after flashing, although you may want to "clear data" for any apps that were crashing prior to applying the change so that they can start fresh.Update 2014/07/21: AOSP has re-enabled the PIE check after recompiling their last non-PIE binary. I filed a ticket asking Google to revert this change in order to avoid breaking ABI compatibility.