chdir / aria2-android

This repository is obsolete. Much better frontends for aria2 have been written and can be found in F-Droid
GNU General Public License v3.0
66 stars 15 forks source link

Text relocations on x86 #1

Closed Alexander-- closed 8 years ago

Alexander-- commented 9 years ago

Android does not support non-PIC code since Lollipop. Despite building aria2 native binaries with (seemingly) correct flags Lollipop linker still whines about presence of text section relocations on executable startup. The warning seems to be harmless, but may have unwanted consequences.

Alexander-- commented 8 years ago

Apparently, prevents current x86 builds from working on android-N:

CANNOT LINK EXECUTABLE "/data/aria2_PIC": /data/aria2_PIC: has text relocations
Aborted

There are two possible workarounds:

  1. Screw over Bionic and link everything statically;
  2. Migrate everything to proper PIC without text relocations.

Given that aria2 is a security sensitive network-enabled software, I would rather have ASLR working. Which leaves option 2.

Using eu-findtextrel as explained in this Fedora Wiki article indicates, that the only affected code is an assembly implementation of ftruncate64 in ftruncate64.S.

Alexander-- commented 8 years ago

After a lot of messing with build options the real cause of issue appears to be two-fold:

The former has been solved by shuffling around build flags in OpenSSL build script and disabling CAST symmetric cipher (seemingly unused by aria2 or any of major SSL ciphers).

The later has been solved by stripping debugging symbols only (strip -g).

Seems like those issues are either not reproducible in upstream builds or haven't been a problem for anyone, so no need to report them there.