yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Android Development] dechronic:
Get the file from the original ROM and replace.

Edit: In case you didn't know, the file is located at

/system/bin/linker
[Nexus 5 Android Development] codecaine21:
I flashed this bypass zip on my nexus 6 running DU 5.1.1 and it soft bricked it. Thanks =)

EDIT: I had to reflash my phone. I did however find a solution. Solution was implemented on a Linux box.

cd ~/

wget "http://dl.google.com/android/ndk/android-ndk-r9b-linux-x86.tar.bz2"

tar -xjvf android-ndk-r9b-linux-x86.tar.bz2

set up standalone toolchain:

export NDK=/home/anthony/android-ndk-r9b

export SYSROOT=$NDK/platforms/android-16/arch-arm

export CC="$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc-4.8 --sysroot=$SYSROOT"

to cross compile for arm -> $CC -fPIE -pie select.c -o select

The pie flags I set with the cross compile takes care of the pie bypass problem. At least for me. I'm using a Nexus 6 on 5.1.1 DU. At least if my way doesn't work, you won't brick your phone ;)
[Nexus 5 Android Development] omnis:
Oopsie!

I flashed the bypass-pie.zip and now I cannot use my phone. It boots, but it won't even let me unlock the screen. I am hoping you could supply a zip that would put the digit back to the way it was. I am using Lollipop on an SM-910T. Thanks. I was not entirely clear on what to do with the curl zip. I tried flashing it, but it failed. Then I opened it to find what I think is just a binary. Could it be that I need to place that somewhere and chmod it? If so please let me know where. Thx again.
[Nexus 5 Android Development] omnis:
Fixed

I really needed to get my phone working as I'm moving today so I figured out how to fix it. I downloaded the linker file from here http://lifepluslinux.blogspot.com/2015/01/installing-python-on-android-50.html adb pushed it, and then chmod 755 in recovery. All is restored to normal again and this time no PIE error when running a tethermod startup script via SManager yay!
[Nexus 5 Android Development] waelh:
Please help, after I flashed bypass-pie.zip my xperia z3 is going through a boot loop. is there a way to revert back the pie change ?

Thank You
[Nexus 5 Android Development] dechronic:
You would need to flash back the original linker file. Get the linker file from the original system image and place in the zip
[Nexus 5 Android Development] jamesta:
Has anyone done this for the ASUS Zenfone2 550ML/551ML version? I keep getting PIE only supported on some apps via SuperSU Android 5.0 Lollipop. Need a decent explanation due to me being a noob with this stuff. I recently was able to get Xposed installed.
[Nexus 5 Android Development] folefole:
is it possible to bypass PIE for android M???
[Nexus 5 Android Development] :
[MENTION=5293221]cernekee[/MENTION] Thanks for the share! I was trying to root Galaxy J2. I pushed the binaries via adb and when do a su in adb shell, it gave me the PIE error. I tried flashing your linker file and now its a bootloop. The bootloop doesn't allow adb detection and hence no logs. Any help will be greatly appreciated!!
[Nexus 5 Android Development] TheoKondak:
wont even load back to OS anymore yeee!
[Nexus 5 Android Development] dave7802:
Is there any way to do this in Marshmallow?

I have been looking at the instructions for the Linker file,

But the views am looking at, against the instructions provided, dont match up, I can see Multiple Hex Values of:

d007 (07 DO)

File included (Linker) from CM13 (6.0)
[Nexus 5 Android Development] sarshar:
Thanks my friend, but this one doesn't work on my Note5 with 5.1.1 rooted

I say it doesn't work because dSploit works only on 5.1.1 PIE patched OSs for me (since Galaxy S4)

Any suggestion ?
[Nexus 5 Android Development] sarshar:
Note5 SYSTEM path

File you mentioned has an updater-script file which I had to change its path as Note5 uses different path to SYSTEM (/dev/block/platform/15570000.ufs/by-name/SYSTEM"

What I'm wonder of is despite of wrong path before altering the updater script, installation was successful with both paths !

Hence I can't be assured if PIE patch is applied or not.

by the way, the exact script is starting with "mount("ext4", "EMMC", "/dev/block/platform...." is EMMC correct for Note5 ?

is 64 bit version of Lollipop supported by this PatchPIE ? (it was working on Galaxy S4 with Lillpop 32 bit while Note5 uses 64 one)

It's much appreciated if someone could help me patching my annoying restricted PIE !

Regards
[Nexus 5 Android Development] pseudolobster:
I know it's been a while since you posted this, but I've created a patched x86 linker! See attached.

For any of you with unsupported devices, here's how I did it.

I downloaded a disassembler called Hopper. There are probably better ones out there that are free and don't have so many nag screens, but it's what I happened to use.

I went to File -> Read Executable for Disassembly, and opened my copy of the linker binary. I hit Ctrl+F, and searched for "independent" as a "string in assembly".

This brought me to:

000127b0 db "error: only position independent executables (PIE) are supported.\n", 0 ; XREF=__dl___linker_init+5445

From there I was able to double click "__dl___linker_init+5445", but otherwise I could have searched for the address "127B0" to see where this string is used in the code. That brings me to address 0000:89C5, where this string is pulled into a register to be acted on. So, let's see if there is a jump to this point.

In the disassembler there's a blue arrow pointing to this section of the code, meaning there's a conditional jump here. This "hopper" disassembler is kinda janky and I can't follow where the arrow comes from, but another Ctrl+F and search for "89C5" brings us to:

00007b1d mov dword [ds:eax+0x98], ecx
00007b23 mov dword [ds:eax+0xf8], esi
00007b29 cmp word [ds:edi+0x10], 0x3
00007b2e jne 0x89c5

It's moving the values 98 and F8 in hex into some registers, making a comparison, then JNE, Jump-if-Not-Equal, to address 89C5, which is the error.

Incidentally, this is the same code as OP's, but in x86 instead of ARM:

000032D4 STR.W R5, [R6,#0x98]
000032D8 STR.W R4, [R6,#0x100]
000032DC LDRH R2, [R1,#0x10]
000032DE CMP R2, #3
000032E0 BEQ loc_32F2 <---- replace D007 (07 D0) with E007 (07 E0, B loc_32F2)

So anyway, the address 0000:7B2E is the address in the code where the jump to the error occurs. We don't want that to ever happen, so let's fire up a hex editor, and navigate to the 7B2E'th position in the file.

00007b10: 8b85 74fe ffff 31c9 be01 0000 0089 8898 ..t...1.........
00007b20: 0000 0089 b0f8 0000 0066 837f 1003 0f85 .........f......
00007b30: 910e 0000 8b85 68fe ffff 85c0 0f84 9500 ......h.........
00007b40: 0000 8db3 d409 0000 ba00 0200 0089 3424 ..............4$

So, starting at the 7B20 column, you count E sets of two over, so the command is the next 4 bytes: 0F 85 91 0E.

Change those to 90 90 90 90, (nop instruction, ie: "Do nothing") so that it never takes that jump to the error.

Ta-dah!

Edit: I just realized, that zip looks flashable, but it wasn't intended to be, and the permissions on the file are not set to executable. You'll need to copy this over in a recovery console and chmod 755 it.

Also: This came from a copy of android-x86 5.1-rc1, and has not been tested on anything else. I' assume it works on any x86 device, but I can't necessarily assume it will work on anything other than 5.1. You've all been warned!
[Nexus 5 Android Development] Dave_Ro:
Nexus 7 3G 2012 Android 5.1.1 build LMY47V

I disassembled the linker using objdump and found the code equivalent to the OP:

3840:	f8c4 5098	str.w	r5, [r4, #152]	; 0x98
3844:	f8c4 6100	str.w	r6, [r4, #256]	; 0x100
3848:	8a0b	ldrh	r3, [r1, #16]
384a:	2b03	cmp	r3, #3
384c:	d007	beq.n	385e <calloc+0x2586>

Changed D0 to E0 at byte 384D

Made bypass and restore zips based on the script used in post #55
[Nexus 5 Android Development] shayraz:
Just notifying the thread that the one that did work was the linker file in patch-pie.zip (not bypass-pie.zip, caused bootloop), the exact linker file size that worked on my phones was 87556 bytes, which is also available in this thread somewhere...

Renamed the old linker to linker.old and copied the new linker into /system/bin and then chmod 755 /system/bin/linker and chgrp shell /system/bin/linker and then reboot.

This worked on 5.1.1 for both Note 4 N910U Sweetrom and rooted S6 Edge+ stock 5.1.1, now can run rsync and other apps without the PIE error...

Note however this does not mean patch-pie is "correct" but the one that worked on my phones. Other phones may need bypass-pie. I had TWRP installed to make sure I could go into shell and fix the linker in case of issues...
[Nexus 5 Android Development] Bn-Yussuph:
Samsung galaxy core prime

I tried both flash files on my samsung galaxy core prime and both failed. But the problem is still there. Does anybody have any trick for me.

Thanks very much
[Nexus 5 Android Development] Pranz...:
Plz give me the bypass-pie.zip file for oneplus one on cm13....
[Nexus 5 Android Development] sudhirkonatham:
hi ,

I am using 5.1.1 Nexus 7 tablet and wanted to run my own binaries on this, Could you tell me how to flash the bypass-pie.zip file, as I tried flashing this using some tool kits but I am not sure whether it is flashed or not as I am getting still the same PIE error when executing the binary or the curl thing thaty you mentioned
[Nexus 5 Android Development] sorinilidan:
Hi, as i'm a complete noob at hex I tried editing with Hopper and IDA but still didn't know where to change it, I found the pie line etc, but after that i didn't know where to change so it does the hop. Can someone with knowledge in these please change this linker file for me?

https://mega.nz/#!U8lXSJJI!t3Gc5VP-UrcGz6FvEZ0mTU63WmlIJMi2Q-Q9os39pFA

~ Pretty please :)
[Nexus 5 Android Development] jamnhel:
my note 3 stock on logo after flashing this need help :(
[Nexus 5 Android Development] evildog1:
This is bad. I really want to use GDB debugger on Android 5.1.1, but instead, it bricks my phone, and i can't even go into the recovery mode! Now i have to reflash my phone from flashtool
[Nexus 5 Android Development] levone1:
I'm getting pie error on AOSP MM. Bypass zip here doesn't work, (bootloop). Any way to get it to work on MM?
[Nexus 5 Android Development] setmaster:
Im on bootloop too after flashing this bypass-pie.zip on my Nexus 5 (hammerhead) running 6.0.1. Some one could post an updated version?
[Nexus 5 Android Development] MikaelFolkesson:
Would it be really stupid to try to flash this on Samsung note 3 Android 5. 0? I want to run sox and ffmpeg binaries, but they only give this error message now.
[Nexus 5 Android Development] eebssk1:
i need a 64bit version linker64

( do i need it on arm64?…)
[Nexus 5 Android Development] HardcoreMountainbike:
Can anyone patch the linker file of the zenfone 2 or tell me how to do it myself and which programs to use.

View attachment 3742328
[Nexus 5 Android Development] sudhirkonatham:
bypass pie on nexus 7 2013 with Android 5.1.1

Can I use these zip files on Nexus 7 2013 with same Android build 5.1.1 LMY47V. It actually worked on 2012 but I want to be sure that it will work on 2013 Nexus as I have to order that before I make sure it works
[Nexus 5 Android Development] ligayaaaaa:
HELP

How to flash it?
[Nexus 5 Android Development] Rick#2:
I couldn't get any of the binaries available in this thread to work properly on my Samsung Note 5 (SM-N920W8); a couple of the binaries would work if the phone had already booted, but if I restarted my phone, the device would bootloop (guessing due to some issue with the patched linker binary at boot).

So I just modified linker.cpp (bionic/linker/linker.cpp) from the main Android source repository as follows:

https://android.googlesource.com/platform/bionic/+/master/linker/linker.cpp

Original

4143 ElfW(Ehdr)* elf_hdr = reinterpret_cast<ElfW(Ehdr)*>(si->base);
4144 if (elf_hdr->e_type != ET_DYN) {
4145 __libc_fatal("\"%s\": error: only position independent executables (PIE) are supported.",
4146 args.argv[0]);
4147 }

My patch:

4143 ElfW(Ehdr)* elf_hdr = reinterpret_cast<ElfW(Ehdr)*>(si->base);
4144 if (elf_hdr->e_type != ET_DYN) {
4145 __libc_format_fd(2, "warning: only position independent executables (PIE) are supported.\n");
4146 }

Attached my binary for anyone else out there. Works for booting now anyways, and just spits out a warning instead of the error but still allows the binary to run.
[Nexus 5 Android Development] TheCodeFighter:
Booting problems!!!

I can't boot again on my nexus 5 after flashing the bypasspie.zip! Any ideas why? :eek:
[Nexus 5 Android Development] boback:
Thanks for the info on "error: only position independent executables (PIE) are supported" i tried flashing the zip but got boot loops. I ended up restoring my device and just pulling the "linker" file using adb pull /system/bin/linker after editing BEQ loc_32F2 <---- replace D007 (07 D0) with E007 (07 E0, B loc_32F2) in hex and pushing linker back adb push linker /system/bin,

everything running great.

My device, htc one m8 s-off running viper rom marshmallow.
[Nexus 5 Android Development] daktah:
im trying to find the values in a hex editor as you said but i cant seem to find them even with find, would it even be the same if im on arhd 53.1? i want to s-off with firewater so i can downgrade to lollipop
[Nexus 5 Android Development] boback:
In ida the offset is 00005230. In hex editor, the hex search is 07 D0 A2 49 02 20 79 44 05 F0 38 FB 01 20.

For htc one m8 running viperone marshmallow rom
[Nexus 5 Android Development] Swapnil Soni:
Tried in AOSP MM 6.0.1 having bootloops. Can you give me for MM working one? Greatly appriciate.
[Nexus 5 Android Development] RIPAciD:
I patched the linker for/from xXx No Limits 5.1 ROM Android 6.0.1

Tested it with curl only on SM-G900F.

Should work with other MM roms as well but create a backup first.
[Nexus 5 Android Development] Ervankurniawan41:
This is work di zenfone 5 lollipop 87 ???
[Nexus 5 Android Development] SrFahim:
Can anyone patch the linker and linker64 from cm 13? It would be helpfull ?
[Nexus 5 Android Development] phoberus:
Broke my camera (no connection to camera with app).

Can you edit my linker file too?

Also MM 6.0.1
[Nexus 5 Android Development] luka46:
Hi. Can you please explain how did you edit the linker file, and what program did you use.

Thanks.
[Nexus 5 Android Development] boback:
I used ida and hxd editor

If you have ida, load the linker file, after that search for string " error: only position independent " some results will show up double click it, it should bring you to the function. After that look for BEQ loc_ XXXX Highlight this instruction and click view at top of ida opensubviews--> Hex dump. In the hex dump window highlight the entire hex then click edit and copy.

Now open hxd editor click search find paste in the box " Search for: " then on the Datatype dropdown box select Hex-values, after it brings you to the hex click the search text at top of hxd and find again if there are no more then you are good to go.

Edit the first D0 07 or 07 D0 numbers may vary to E007, when done click at the top of hxd file then save as " linkerPatched " after that make another folder and call it " Patched Linker" copy linkerPatched into the folder you just made then push back to your device.

Images if you get lost or confused

Edit: I have no idea why images don't show https://gyazo.com/search

If you still get confused or lost you can send me your linker file and i will patch it for you.
[Nexus 5 Android Development] luka46:
Thanks for the reply. This is quite difficult for me. After I find the " error: only position independent " string, I double click on it and it doesn't bring me to the function. I'm basically stuck. I'm attaching my linker file, and would be glad if you could patch it for me. If it helps, I'm running CyanogenMod 13 on Samsung Galaxy S3.

Thanks!
[Nexus 5 Android Development] boback:
Before copying or pushing to your device make a backup of your original linker file

Here is your Patched linker

View attachment 3998112
[Nexus 5 Android Development] luka46:
I did the backup copy. But when I try to push patched liner with adb command , I get "failed to copy 'linker' to '/system/bin/linker': Read-only file system"

Edit: I remounted abd and successfully pushed

---------- Post added at 02:34 PM ---------- Previous post was at 02:23 PM ----------

I thing it bricked my phone. I restart it, and now everytime after the samsung logo, it goes into recovery.
[Nexus 5 Android Development] boback:
If you have a removable battery try and remove battery for 1 minute, then boot again.
[Nexus 5 Android Development] luka46:
Still the same. Eh...it was worth to try. I'm going to reinstall CM. Thanks anyway :)
[Nexus 5 Android Development] BeeWall:
Could you please patch my linker? I am on an armv7 5.1.1 device, patch level November 2016. I've looked, and none of the other patches will work.
[Nexus 5 Android Development] boback:
Hopefully it works for you.

View attachment 4040630
[Nexus 5 Android Development] BeeWall:
It keeps sending me to recovery... Thanks for trying though! What changes did you make? So that I can try myself, and know what's already been tried.
[Nexus 5 Android Development] boback:
The only changes I've made is the "error only pie " located at offset 00003880 for your linker file, I changed 07 D7 to E0 07, maybe it's a bit thing...i could be wrong but its the only beq_____lock function I found on your linker file, sorry it didn't work out.
[Nexus 5 Android Development] BeeWall:
Ok. Like I said, thanks for trying to help. Maybe it needs to be 07 E0? I'll try it that way.

EDIT: Didn't work.
[Nexus 5 Android Development] LazerL0rd:
Can someone patch my link? I'm on PixelROM 7.1.2 bullhead.
[Nexus 5 Android Development] BeeWall:
You need to attach your linker. Go to /system/bin in a root explorer, zip/archive it so that XDA will allow the upload, and attach it with the "Manage Attachments" button at the bottom, or the paperclip if you are using an app.
[Nexus 5 Android Development] LazerL0rd:
Thanks. I'll do it tomorrow morning. Um, is this safe though? I NEED it for DTS's configurator to work properly since it's a PIE.
[Nexus 5 Android Development] BeeWall:
Zipping and attaching it is safe, as long as you do not delete the original file.
[Nexus 5 Android Development] LazerL0rd:
I meant replacing it. Because I don't have zip tools can I just rename the file to .zip and upload?
[Nexus 5 Android Development] BeeWall:
No do not rename it. Everything will start crashing, and it's difficult to fix. Just get a root file manager. Replacing it MIGHT be safe. Be sure to have a nandroid/TWRP backup.
[Nexus 5 Android Development] LazerL0rd:
Do I just replace the linker in the zip file with mine? Or shall I upload here if you need to modify it.
[Nexus 5 Android Development] BeeWall:
You need to upload it here. However, XDA only allows uploads of certain formats, which is why you need to create a zip.
[Nexus 5 Android Development] LazerL0rd:
Thanks man, I know that. I just wondered how it needed to be done. If I just needed to replace the file in the OP then no point bothering you. But here's my linker anyway.

I found a 64-bit linker too. I think it might need to be patched. It's in the zip as well.
[Nexus 5 Android Development] BeeWall:
OK, I misunderstood your question. The version in the OP will not work for you, as it is a different Android version and architecture.

Unfortunately, it appears that I can't patch it, as radare2 and ODA are the only Android options and aren't working well for me, but perhaps someone else can help. [MENTION=3706605]boback[/MENTION] patched mine, maybe can patch yours as well? And yes, I believe both linker and linker64 need to be patched.

Alternatively, you might be able to patch it yourself. There are instructions here on how. If you have to use Android, radare2 (no longer on play store) might work better for you than me. Or you could try ODA, but that is rather laggy as it is online.
[Nexus 5 Android Development] Arusar:
I'm following your guide and it works.

thanks.

Device: S3 Mini (GT-I8190) - Android 5.1.1 - CM 12.1 Novafusion
[Nexus 5 Android Development] LazerL0rd:
Not easy on the 64-bit file. I can't do it either. I'll just have to find a recent or recompile a PIE dts_configurator to fix my issue.
[Nexus 5 Android Development] Rgern100:
I did it following your steps, thanks alot

There is my linker original and patched, Moto G 2015 (osprey) android 6.0.1 ( CM 13 )

View attachment linker.zip

View attachment linker_patched.zip
[Nexus 5 Android Development] liteon01:
Hello sorry for my Bad englisch But ich need help can anyone patch my linker File for android 6.0.1 galaxy s6 ?
[Nexus 5 Android Development] francwalter:
If someone just need to run sqlite3 and has Titanium installed, he could just use the Titanium sqlite3 as mentioned in this Thread of Tasker Group.

It is found in:

/data/data/com.keramidas.TitaniumBackup/files/sqlite3
[Nexus 5 Android Development] Rgern100:
Here you go, i tried my best to help you.
[Nexus 5 Android Development] liteon01:
The linker File

Hello the linker File doesn't Worked for me beacouse

Wireshark says: cannot link Executable: Cannot locate Symbol "Obj_name_add" Referenced by"/data/data/ lv.n3o.shark/files/tcpdump"..... Page record for 0xf778b00c was Not found (block_size=16

Thank You for your help.
[Nexus 5 Android Development] BeeWall:
Which linker are you using? From the OP, or a post? What os and architecture is your device?
[Nexus 5 Android Development] liteon01:
Linker

I have used the linker from rgern100 He has patched the File for me. my Phone is a samsung galaxy s6 g920f , it is rooted and runs android 6.0.1 on stock rom.
[Nexus 5 Android Development] BeeWall:
Looking at your error, I don't think it is linker related. It looks like an error with whatever file you were executing.
[Android Q&A, Help & Troubleshooting] Particicutor:
I have a Nexus 5, unmodified and unrooted on 4.4.4

I disabled background data recently because I was running out.

I noticed that the Google Now Launcher had a "No Internet Connection" box even when connected to home Wi-Fi.

I re-enabled background data and pulled down to refresh.

I now have no cards at all, when there were previously some old ones.

I have cleared data and cache of both Google Now Launcher and Google Search.

I have rebooted multiple times.

I have uninstalled updates and reinstalled updates for both Google Now Launcher and Google Search.

I don't know what to do at this point, other than a full device reset.
[Android Q&A, Help & Troubleshooting] archit1291:
I am facing the same issue since morning :(
[Android Q&A, Help & Troubleshooting] subham99:
You can try deleting the home network and then reconnecting to it.

Sent from my XT1022
[Android Q&A, Help & Troubleshooting] stvmac11:
I'm having the same issues.. But remember, people were having this issue after last year's Google IO.
[Android Q&A, Help & Troubleshooting] rayzaname:
It's definitely an issue on Google's end. I'm having problems on both my Nexus 5 and iPad Mini...
[Android Q&A, Help & Troubleshooting] archit1291:
Yeah, tried everything but still no luck. I wish google sends an update
[Android Q&A, Help & Troubleshooting] balg86:
I have the same problem on Nexus 4, (4.4.4). I hope Google will fix this issue soon.
[Android Q&A, Help & Troubleshooting] archit1291:
I know its not a wrong thread to ask but I am facing this issue whenever I recieve call and using the phone, no option comes up to accept or reject plus navigation bar also hides. Can anyone please suggest me whats the issue. Have searched other threads but no luck.
[Android Q&A, Help & Troubleshooting] BiggerF0X:
Hi guy i can help you :)

Try to change/modify the Kernel ROM, or even change your Smartphone if you are under warranty
[Android Q&A, Help & Troubleshooting] archit1291:
I have tried stock, franco nd elementalx.. In all three issue persists.
[Android Q&A, Help & Troubleshooting] Particicutor:
Has anyone tried a full device reset?

I got some cards. When I pull to reset, I get "no internet connection again."

Forgetting and reconnecting to the Wi-fi had no effect.