Hi, I'm using Sourcery G++ Lite 2008q3-72 tool chain for my application. I have written a sample code to print the stack and it is working fine, If I build using gcc [gcc (GCC) 3.4.6 version]. But the same code built using Sourcery binaries and when executed on ARM platform, it is not printing the stack contents. Could you please help on this regard? Regards. Balaji ON INTEL ======== [balkani@server ~]$ ./intelv Calling dummy calling print Trace IN Print_traceObtained 5 stack frames. 5 ./intelv(print_trace+0x14) [0x8048660] ./intelv(dummy_function+0x1b) [0x8048712] ./intelv(main+0x31) [0x8048745] /lib/tls/libc.so.6(__libc_start_main+0xd3) [0x6bade3] ./intelv [0x80485c5] [balkani@server ~]$ ON ARM ======= [root@ip202ff:cisco#]./PrintDump Calling dummy calling print Trace IN Print_traceObtained 1 stack frames. 1 /lib/ld-linux.so.3 [0x40025000] [root@ip202ff:cisco#]
Attachment:
stackPrint.c
Description: stackPrint.c
[balkani@server ~]$ uname -a Linux server 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386 GNU/Linux [balkani@server ~]$ gcc -rdynamic stackprint.c -o intelv [balkani@server ~]$ file intelv intelv: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped [balkani@server ~]$ ./intelv Calling dummy calling print Trace IN Print_traceObtained 5 stack frames. 5 ./intelv(print_trace+0x14) [0x8048660] ./intelv(dummy_function+0x1b) [0x8048712] ./intelv(main+0x31) [0x8048745] /lib/tls/libc.so.6(__libc_start_main+0xd3) [0x6bade3] ./intelv [0x80485c5] [balkani@server ~]$ [balkani@server ~]$ gcc --version gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[balkani@server ~]$ uname -a Linux server 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386 GNU/Linux [balkani@server ~]$ arm-none-linux-gnueabi-gcc -rdynamic -g3 stackprint.c -o PrintDump [balkani@server ~]$ file PrintDump PrintDump: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), not stripped [balkani@server ~]$ arm-none-linux-gnueabi-gcc --version arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2008q3-72) 4.3.2 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [balkani@server ~]$ [balkani@server ~]$ scp PrintDump root@xxxxxxxxxxxxx:/opt/cisco {{{{{{{{ COPIED TO ARM PLATFORM}}}}}}}} root@xxxxxxxxxxxxx's password: PrintDump 100% 25KB 24.7KB/s 00:00 [balkani@server ~]$ On ARM Platform =============== [root@ip202ff:cisco#]uname -a Linux ip202ff 2.6.28-ip202ff-xc-180.0-picochip-3.2.2 #2 PREEMPT Fri Jan 29 14:43:24 GMT 2010 armv5tejl unknown [root@ip202ff:cisco#]./PrintDump Calling dummy calling print Trace IN Print_traceObtained 1 stack frames. 1 /lib/ld-linux.so.3 [0x40025000] [root@ip202ff:cisco#]