Hi Sean,
I tried __builtin_clz() test. It can be run and the results are correct on my QCOM8250 board.
Basically QCOM8250 supports armv7 instruction set, it's not surprising that it can execute armv5 inst.
I mentioned armv6 and armv5 toolchain before is because I don't want to "downgrade" the toolchain. Right now I want to make them co-exist. Using qcom's toolchain to compile kernel while using android's toolchain to compile android binaries, since qcom is also toolchain sensitive(it specifically said to use THAT version of codesourcery toolchain).
What I'm wondering right now is why android's static linked executables can't run on my platform.
Now I have new clue, but I don't know how to interpret it.
Below are the results I ran strace clz_test (clz_test is the clz test program), seems quite normal.
====================
# strace /mnt/clz_test
uname({sys="Linux", node="
192.168.0.100", ...}) = 0
brk(0) = 0x80000
brk(0x80c70) = 0x80c70
syscall_983045(0x80430, 0x7db20, 0, 0x10, 0x80430, 0x7e4cc, 0x7e7d0, 0xf0005, 0x28, 0x8, 0x4, 0x10, 0, 0xbe966b48, 0x11b58, 0x8874, 0x60000010, 0x80430, 0, 0, 0, 0xda4c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) = 0
brk(0xa1c70) = 0xa1c70
brk(0xa2000) = 0xa2000
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40000000
write(1, "__builtin_clz test: 18\n", 23__builtin_clz test: 18
) = 23
...
====================
Below are the results I ran strace init, stuck at syscall_983045()
====================
# strace /mnt/init
gettid() = 696
syscall_983045(
0xbebf5d14, 0, 0x40, 0, 0xbebd6000, 0xbebf5e50, 0xbebf5e14, 0xf0005, 0, 0, 0, 0, 0, 0xbebf5cf8, 0x1209b, 0x1790c, 0x60000010, 0xbebf5d14, 0, 0, 0, 0xda4c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV (core dumped) +++
Process 696 detached
====================
1. I don't know what syscall_983045() is, why it has no reasonable name.
2. I noticied the first parameter value is not reasonable, seems it should be an address? Compare to the value I ran clz_test, 0xbebf5d14 is too large.
Any suggestions? Thanks!
Regards,
Mac