Issue
i've moved to new laptop and latest android NDK, recompiled the binaries into my android app and got "executable not found" exception while running. I've checked the file exists and is on expected path.
Then i've analyzed the file and got the following:
$file ./build_pie/my_file
./build_pie/my_file: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /usr/lib/libc.so.1, not stripped
Then i've checked the previous version of the executable and it was:
$file /tmp/f4_old/my_file
/tmp/f4_old/my_file: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped
I believe wrong interpreter is the reason. How can i fix it?
PS.
Here are some lines from config:
... // override PATH and SYSROOT to android NDK (standalone toolchain)
export CFLAGS="-I$SRC/libftdi1.0-2-android-arm-lollipop/include -I$SRC/libusb1.0-2-android-arm-lollipop/include -fPIE"
export CPPLAGS="$CPPFLAGS -fPIE"
export CXXLAGS="$CXXFLAGS -fPIE"
export LDFLAGS="$LDFLAGS -lusb-1.0 -lusb -lftdi -L$SRC/libftdi1.0-2-android-arm-lollipop/lib -L$SRC/libusb1.0-2-android-arm-lollipop/lib -L$SRC/libusb-android-arm-lollipop/lib -static -fPIE -pie"
../configure --build=x86-unknown-linux-gnu --host=arm-linux-androideabi --target=arm-linux-androideabi --verbose
Solution
I had to specify dynamic linker with -Wl,--dynamic-linker=/system/bin/linker
(add to LDFLAGS
)
Answered By - 4ntoine
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.