Created attachment 22372 [details] Suggested patch Trying to compile trunk/r166596 for the AVR target results in: /junk/gcc/trunk/build-avr/./gcc/xgcc -B/junk/gcc/trunk/build-avr/./gcc/ -B/junk/test/avr/bin/ -B/junk/test/avr/lib/ -isystem /junk/test/avr/include -isystem /junk/test/avr/sys-include -g -O2 -mmcu=avr25 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -Os -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector -Dinhibit_libc -I. -I. -I../../.././gcc -I../../../../libgcc -I../../../../libgcc/. -I../../../../libgcc/../gcc -I../../../../libgcc/../include -DHAVE_CC_TLS -DUSE_EMUTLS -o _exit.o -MT _exit.o -MD -MP -MF _exit.dep -DL_exit -xassembler-with-cpp \ -c ../../../../libgcc/../gcc/config/avr/libgcc.S ../../../../libgcc/../gcc/config/avr/libgcc.S: Assembler messages: ../../../../libgcc/../gcc/config/avr/libgcc.S:655: Error: operation combines symbols in different segments gmake[4]: *** [_exit.o] Error 1 gmake[4]: Leaving directory `/junk/gcc/trunk/build-avr/avr/avr25/libgcc' gmake[3]: *** [multi-do] Error 1 gmake[3]: Leaving directory `/junk/gcc/trunk/build-avr/avr/libgcc' gmake[2]: *** [all-multi] Error 2 gmake[2]: Leaving directory `/junk/gcc/trunk/build-avr/avr/libgcc' gmake[1]: *** [all-target-libgcc] Error 2 gmake[1]: Leaving directory `/junk/gcc/trunk/build-avr' gmake: *** [all] Error 2 The preprocessed source for this is: # 642 "../../../../libgcc/../gcc/config/avr/libgcc.S" .section .fini9,"ax",@progbits .global _exit .func _exit _exit: .weak exit exit: .section .fini0,"ax",@progbits cli __stop_program: rjmp __stop_program .endfunc It complains about ".endfunc". My guess is another .func/.endfunc is needed between _exit and __stop_program. Applying the following patch seems to fix this issue: Index: gcc/config/avr/libgcc.S =================================================================== --- gcc/config/avr/libgcc.S (revision 166596) +++ gcc/config/avr/libgcc.S (working copy) @@ -646,9 +646,11 @@ .weak exit exit: + .endfunc /* Code from .fini8 ... .fini1 sections inserted by ld script. */ .section .fini0,"ax",@progbits + .func __stop_program cli __stop_program: rjmp __stop_program
Same here. But even if I apply this patch, gcc segfaults for any given source.
(In reply to comment #1) > Same here. > But even if I apply this patch, gcc segfaults for any given source. Your issue appears rather to be PR48459 *** This bug has been marked as a duplicate of bug 47534 ***