Hello, I'm just trying to link a simple C program writing to stdout with printf, and it segfaults before entering the main(). Any program I tried to built linked with this toolchain, ends in segfault. My toolchain has gcc 4.5.1 (with ppl), uclibc 0.9.31 (the same happened with 0.9.30.3), binutils 2.20.1, all natively built on i686-linux. The same combination on x86_64-linux works perfectly. The command line I use is: gcc -o program -static program.c Here is the gdb session: Program received signal SIGSEGV, Segmentation fault. 0x00000000 in ?? () (gdb) bt #0 0x00000000 in ?? () #1 0x08049348 in __uClibc_main () #2 0x00000000 in ?? () (gdb) f 1 #1 0x08049348 in __uClibc_main () (gdb) disassemble Dump of assembler code for function __uClibc_main: ........ 0x08049330 <+427>: sub %eax,%esi 0x08049332 <+429>: sar $0x2,%esi 0x08049335 <+432>: jmp 0x804933f <__uClibc_main+442> 0x08049337 <+434>: call *-0x3c(%ebx,%edi,4) 0x0804933e <+441>: inc %edi 0x0804933f <+442>: cmp %esi,%edi 0x08049341 <+444>: jb 0x8049337 <__uClibc_main+434> 0x08049343 <+446>: call 0x0 => 0x08049348 <+451>: movl $0x0,(%eax) 0x0804934e <+457>: call 0x0 0x08049353 <+462>: movl $0x0,(%eax) 0x08049359 <+468>: mov -0x1c(%ebx),%eax 0x0804935f <+474>: push %ecx 0x08049360 <+475>: pushl (%eax) .........
Building with DODEBUG y makes all work. Maybe it is a gcc problem? This last time when I tried I was using gcc 4.5.1. As a note apart, uclibc 0.9.30.3 failed in the same way for me.
This should be fixed on trunk. Which version are you using?
I tried only the last released (0.9.31) and 0.9.30.3.
This is supposedly fixed for 0.9.32-rc1 onward. Please reopen if you still experience the same problem. Thanks for the report!