Altera_Forum
Honored Contributor
19 years agoC/C++ application dumps
Hello,
I've been working with NIOS2 for few months now I use std_1c20 (from now on I am going to use self developed NIOS board). For NIOS2 environment I am using uClinux-dist-test 20060511, kernel 2.6.16, uClibc 0.9.27, gcc 3.4.6, binutils 2.15. I have build gcc (3.4.6 c++) NIOS2 compiler from build root environment and NIOS2 patches from nioswiki.jot.com (many thanks). Now the problem I have is that I am working on a uClibc mixed C and C++ application with POSIX ptread. For stdio/file IO I've been using C functions and not c++ stdio. Application builds correctly, but when I try to run it I get something like this in console:SIGSEGV and BINFMT_FLAT: reference 0x680000 to shared library 53, killing maindemo! in dmesg Application is definitely statically build so I don't know why I am getting error with shared library. I have checked that application is linked statical with nios2-linux-uclibc-nm. I've also checked: the stack, FLT header, rebuild gcc/g++ few times nothing helped http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif I have also successfully build an a little bit complex hello world using same libraries and it works but main application is not working. Otherwise the main application works on i686 Gentoo Linux. The reasons I thought of for my application not working are: - mixing C/C++ code in the same file (few people from Ecos suggest full C/C++ code separation) - bug in code not detectable on i386 arch (might be possible) - gcc (g++) compiler/linker ? Another question is there a debugger like strace or gdb I could use? Any kind of help or comments would be very appreciated. Uros