I just built my goldfish android kernel. I wrote a hello world program and compiled using arm-linux-gnueabi-gcc. I used adb push to put the executable in /data/local of the emulated kernel. I was able to ssh into the emulated kernel using adb shell. When I cd into /data/local and ls the directory, I'm able to see the a.out which I had put using adb push. When I do #./a.out, I get the error ./a.out: not found.
Alguien me puede ayudar en esto.
preguntado el 31 de enero de 12 a las 16:01
I added the -static option during compilation worked.
I guess it's a missing library problem. I have met this problem before, my fix is below:
root@evab:~# ./a.out -sh: ./a.out: not found root@evab:~# ls /lib /root /lib: libc.so.6 /root: a.out root@evab:~#
Then check which shared library is needed by the application:
leo@leo-VirtualBox:/opt/nfs/root$ arm-linux-readelf a.out -a |grep lib [Requesting program interpreter: /lib/ld-linux.so.3] 0x00000001 (NEEDED) Shared library: [libc.so.6] ... ...
By the output, we can confirm that the
ld-linux.so.3 is missing, so copy
ld-linux.so.3 to target filesystem /lib directory:
root@evab:~# ./a.out test root@evab:~# ls /lib /root /lib: ld-linux.so.3 libc.so.6 /root: a.out root@evab:~#