Programa de Android Hello World

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

Check the permissions for that directory -

Permissions seems to be fine ! -

¿Cuál es la salida de ldd ./a.out? -

ls worked, so the directory obviously had both r y x permissions for the user account in question. -

how did you achieve this? please see my question stackoverflow.com/questions/9324772/… -

2 Respuestas

I added the -static option during compilation worked. arm-linux-gnueabi-gcc -static

Respondido 02 Feb 12, 12:02

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:~# 

Respondido 18 Abr '13, 14:04

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.