Ejecución de binarios ARM para Android en Linux ARM

Es posible ejecutar un binario ARM construido para Android (no el .apk) en otros dispositivos ARM con Linux (como Raspberry Pi)? Estoy intentando portar uno de mis proyectos en ARM, pero necesito usar un binario de código cerrado (SopCast) que está disponible sólo para x86 (Windows y Linux) y (recientemente) dispositivos Android.

Ejecutar file sopclient muestra ELF 32-bit LSB ejecutable, ARM, versión 1 (SYSV), dinámicamente vinculado (utiliza libs compartidas), despojado pero sh sopclient dice simplemente no puede ejecutar archivo binario (sí, chmoded + x antes).

¿Hay alguna diferencia notable entre un núcleo Linux "clásico" y un Linux Linux?

Tenga en cuenta que podría haber dependencias en el bionic lib de Android que no puede estar presente en otro brazo de Linux?

Puede comprobar que ejecutando un readelf -Ss binary_name para ver los símbolos si alguno,

Por ejemplo, usando readelf -Ss logwrapper

 Symbol table '.dynsym' contains 47 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr0 2: 00000000 0 FUNC GLOBAL DEFAULT UND strlen 3: 00000000 0 FUNC GLOBAL DEFAULT UND __errno 4: 00000000 0 FUNC GLOBAL DEFAULT UND open 5: 00000000 0 FUNC GLOBAL DEFAULT UND close 6: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail 7: 00000000 0 OBJECT GLOBAL DEFAULT UND __stack_chk_guard 8: 00000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_unlock 9: 00000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_lock 10: 00000000 0 FUNC GLOBAL DEFAULT UND read 11: 00000000 0 FUNC GLOBAL DEFAULT UND abort 12: 00000000 0 OBJECT GLOBAL DEFAULT UND __sF 13: 00000000 0 FUNC GLOBAL DEFAULT UND memcpy 14: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_init 15: 00000000 0 FUNC GLOBAL DEFAULT UND exit 16: 0000a170 0 NOTYPE GLOBAL DEFAULT 19 __dso_handle 17: 0000a008 0 NOTYPE GLOBAL DEFAULT 13 __INIT_ARRAY__ 18: 0000a010 0 NOTYPE GLOBAL DEFAULT 14 __FINI_ARRAY__ 19: 00000000 0 FUNC GLOBAL DEFAULT UND setgid 20: 00000000 0 FUNC GLOBAL DEFAULT UND writev 21: 00000000 0 FUNC GLOBAL DEFAULT UND dup2 22: 00000000 0 FUNC GLOBAL DEFAULT UND access 23: 00000000 0 FUNC GLOBAL DEFAULT UND __aeabi_unwind_cpp_pr1 24: 00000000 0 FUNC GLOBAL DEFAULT UND memmove 25: 00000000 0 FUNC GLOBAL DEFAULT UND fork 26: 00000000 0 FUNC GLOBAL DEFAULT UND execvp 27: 00000000 0 FUNC GLOBAL DEFAULT UND strncmp 28: 00000000 0 FUNC GLOBAL DEFAULT UND strcmp 29: 00000000 0 FUNC GLOBAL DEFAULT UND ptsname 30: 00000000 0 FUNC GLOBAL DEFAULT UND setuid 31: 00000000 0 FUNC GLOBAL DEFAULT UND strerror 32: 00000000 0 FUNC GLOBAL DEFAULT UND vsnprintf 33: 00000000 0 FUNC GLOBAL DEFAULT UND unlockpt 34: 00000000 0 FUNC GLOBAL DEFAULT UND wait 35: 00000000 0 FUNC GLOBAL DEFAULT UND fputs 36: 00009318 0 NOTYPE GLOBAL DEFAULT ABS __exidx_start 37: 00009368 0 NOTYPE GLOBAL DEFAULT ABS __exidx_end 38: 0000a15c 0 NOTYPE GLOBAL DEFAULT 18 __data_start 39: 0000a170 0 NOTYPE GLOBAL DEFAULT ABS _edata 40: 0000a170 0 NOTYPE GLOBAL DEFAULT ABS __bss_start 41: 0000a170 0 NOTYPE GLOBAL DEFAULT ABS __bss_start__ 42: 0000a188 0 NOTYPE GLOBAL DEFAULT ABS _bss_end__ 43: 0000a188 0 NOTYPE GLOBAL DEFAULT ABS __bss_end__ 44: 0000a188 0 NOTYPE GLOBAL DEFAULT ABS __end__ 45: 0000a188 0 NOTYPE GLOBAL DEFAULT ABS _end 46: 00080000 0 NOTYPE GLOBAL DEFAULT ABS _stack 

Observe los símbolos utilizados, que es su señal para comprobar los símbolos, finalmente emitir esto, readelf -d logwrapper

 Dynamic section at offset 0x2020 contains 24 entries: Tag Type Name/Value 0x00000003 (PLTGOT) 0xa0e8 0x00000002 (PLTRELSZ) 208 (bytes) 0x00000017 (JMPREL) 0x875c 0x00000014 (PLTREL) REL 0x00000011 (REL) 0x882c 0x00000012 (RELSZ) 16 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000015 (DEBUG) 0x0 0x00000006 (SYMTAB) 0x8280 0x0000000b (SYMENT) 16 (bytes) 0x00000005 (STRTAB) 0x8570 0x0000000a (STRSZ) 490 (bytes) 0x00000004 (HASH) 0x8128 0x00000001 (NEEDED) Shared library: [libc.so] 0x00000001 (NEEDED) Shared library: [libstdc++.so] 0x00000001 (NEEDED) Shared library: [libm.so] 0x00000020 (PREINIT_ARRAY) 0xa000 0x00000021 (PREINIT_ARRAYSZ) 0x8 0x00000019 (INIT_ARRAY) 0xa008 0x0000001b (INIT_ARRAYSZ) 8 (bytes) 0x0000001a (FINI_ARRAY) 0xa010 0x0000001c (FINI_ARRAYSZ) 8 (bytes) 0x0000001e (FLAGS) 0x00000000 (NULL) 0x0 

Hay tres bibliotecas enlazadas dinámicamente en tiempo de ejecución, la cosa es, bionic biblioteca bionic es libc.so desde la perspectiva nativa de C y Android, así que compruebe que en primer lugar!

Hay otros ARM libc.so que vendrán bajo el disfraz de ucLibC por lo que el kilometraje puede variar. La única manera de ver, es ejecutarlo bajo el ARM de Linux para ver qué pasa, si bombardea con errores de segmentación o errores de bus, ya lo sabrás.

  • 'Ningún comando' adb 'encontrado' error en Ubuntu
  • Ejecución de un software QT en Android
  • Permiso de Android denegado al leer / proc / self / exe de un hilo no principal
  • Obtención de seguimiento de pila en Android NDK
  • tools / android devuelto no puede encontrar sdkmanager.jar
  • Error al cargar CharSequence en Scala 2.11.4 y sbt 0.12.4
  • ¿Dónde puedo encontrar documentación para BlueZ?
  • Mi aplicación está instalada en el emulador, pero no se inicia automáticamente
  • ¿Cómo evitar las filtraciones de Eclipse en XServer al editar archivos XML de Android?
  • Instalar android sdk usando la línea de comandos linux
  • Compilación de FFmpeg 2.3 con Android NDK r10
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.