Has anyone been able to use shared libraries on M5?
I am trying to build a simple hello world in C using a non system
shared library and run on the M5 emulator.
I followed the instructions from here:
http://honeypod.blogspot.com/2007/12/shared-library-hello-world-for-android.html
but I get a segmentation violation when I try to run on M5 emulator.
Below is the strace output.
Any suggestions?
Thanks.
Shawn
# sharedhello
WARNING: `libhello.so` is not a prelinked library
[1] Segmentation fault sharedhello
# strace sharedhello
execve("./sharedhello", ["sharedhello"], [/* 10 vars */]) = 0
getpid() = 616
syscall_983045(0xb0015cb0, 0xb00128d8, 0x3d4, 0, 0xbea9dda8, 0x1, 0,
0xf0005, 0xb00128d8, 0, 0, 0xbea9dda4, 0, 0xbea9dd58, 0xb0000dd9,
0xb00016fc, 0x10, 0xb0015cb0, 0, 0, 0, 0xeb48, 0xcd1f8, 0xcd1d0, 0, 0,
0, 0, 0, 0, 0, 0) = 0
gettid() = 616
sigaction(SIGILL, {0xb0001471, [], SA_RESTART}, {SIG_DFL}, 0) = 0
sigaction(SIGABRT, {0xb0001471, [], SA_RESTART}, {SIG_DFL}, 0) = 0
sigaction(SIGBUS, {0xb0001471, [], SA_RESTART}, {SIG_DFL}, 0) = 0
sigaction(SIGFPE, {0xb0001471, [], SA_RESTART}, {SIG_DFL}, 0) = 0
sigaction(SIGSEGV, {0xb0001471, [], SA_RESTART}, {SIG_DFL}, 0) = 0
sigaction(SIGSTKFLT, {0xb0001471, [], SA_RESTART}, {SIG_DFL}, 0) = 0
open("libc.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or
directory)
open("/system/lib/libc.so", O_RDONLY|O_LARGEFILE) = 3
lseek(3, -8, SEEK_END) = 241860
read(3, "\0\0\340\257PRE ", 8) = 8
mmap2(0xafe00000, 245760, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE,
3, 0) = 0xafe00000
close(3) = 0
mmap2(0xafe3c000, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|
MAP_ANONYMOUS, 0, 0) = 0xafe3c000
mprotect(0xafe00000, 233472, PROT_READ|PROT_EXEC) = 0
open("libhello.so", O_RDONLY|O_LARGEFILE) = 3
lseek(3, -8, SEEK_END) = 2332
read(3, "a_start\0", 8) = 8
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(253, 0), ...}) = 0
brk(0) = 0x11000
brk(0x11000) = 0x11000
brk(0x13000) = 0x13000
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon
echo ...}) = 0
write(1, "WARNING: `libhello.so` is not a "..., 50WARNING:
`libhello.so` is not a prelinked library
) = 50
lseek(3, 0, SEEK_END) = 2340
mmap2(0x80100000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE,
3, 0) = 0x80100000
close(3) = 0
--- SIGSEGV (Segmentation fault) @ 0 (801082bc) ---
sigaction(SIGUSR1, {SIG_IGN}, {SIG_DFL}, 0) = 0
gettid() = 616
SYS_281(0x1, 0x1, 0, 0xffffd9c8, 0xb00102a0) = 3
SYS_283(0x3, 0xbea9d922, 0x14, 0, 0x14) = 0
write(3, "h\2\0\0", 4) = 4
read(3, 0xbea9d9bc, 1) = ? ERESTARTSYS (To be
restarted)
+++ killed by SIGKILL +++
Process 616 detached
#
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---