SSIA. Building with gcc 3.4.4, binutils 2.16.1 (tried 2.16.91.0.1 too, same behavior) results in stage1/xgcc -Bstage1/ -B/usr/i586-ark-linux/bin/ -c -g -O2 -fprofile-use -freorder-blocks-and-partition -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include ../../gcc/attribs.c -o attribs.o /tmp/ccHE8Qe5.s: Assembler messages: /tmp/ccHE8Qe5.s:1539: Error: invalid sections for operation on `.LCFI11' and `.LCFI10' make[2]: *** [attribs.o] Error 1
Created attachment 9208 [details] preprocessed source
Created attachment 9209 [details] Generated asm code
imho the code is good. assembler should converts the local references into relocs off the .text section. .section .rodata .zoo: .long .foo-.zoo .section .text .foo: nop Disassembly of section .text: 00000000 <.foo>: 0: 90 nop RELOCATION RECORDS FOR [.rodata]: OFFSET TYPE VALUE 00000000 R_386_PC32 .text (binutils-2.15.94.0.2.2)
*** Bug 23502 has been marked as a duplicate of this bug. ***
Actually this effects x86_64 only or if you have a local patch to turn on omit frame pointer all the time and -fasynchronous-unwind-tables which is why only x86_64 is effected on a pure sources.
This works for me with binutils 2.15.
This is not a bug in the assembler. The attached assembler code is trying to put the difference between a symbol in the .text section (.LCFI10) and the .text.unlikely section (.LCFI11) into the .debug_frame section. There is no way to represent such a relocation in ELF. It would require the relocation to specify two different symbols, which can not be done in ELF, or it would require a paired relocation, which is not supported for x86_64 ELF. Comment #3 is incorrect as it refers to the special case in which the computed difference is being put into the same section as the subtrahend symbol. That case does not apply here.
(In reply to comment #5) > Actually this effects x86_64 only or if you have a local patch to turn on omit > frame pointer all the time > and -fasynchronous-unwind-tables which is why only x86_64 is effected on a pure > sources. Actually this is on x86-linux-gnu with a newer binutils, I don't know why I attributed it to x86_64 for some reason, which means it is not related at all to -fasynchronous-unwind-tables.
Closing as works for me, this works for me and it worked for Honza on 2005-09-28, see PR 23396, comment #5. Plus 2.15 errored out with your .s file. So it looks like one of your local patches were breaking this.
This is still reproducable here [with unpatched sources], using binutils 2.16.1 and gcc 3.4.4 to compile the stage1 compiler
This is reproducable on gcc mainline on amd64: {standard input}: Assembler messages: {standard input}:510: Error: can't resolve `.text.unlikely' {.text.unlikely section} - `.LFB96' {.text section} Building gcc-4.1.0_beta20051105 with gcc-4.0.2, with binutils 2.16.91.0.3. Same error with binutils-2.16.1 as well.
(In reply to comment #11) > This is reproducable on gcc mainline on amd64: This works for me with "GNU assembler 2.16.91 20051027" with the GCC mainline on i686-linux-gnu And with "GNU assembler 2.16" with the GCC mainline on x86_64-linux-gnu.
You should be able to reproduce this by setting BOOT_CFLAGS="-O2". Eliminating that allows me to successfully compile gcc-4.1 on x86_64.
This is a bug still.
so with -g, it works but without -g it does not.
The problem is that dwarf2out_switch_text_section does not get called as the debug_hooks are set to none. So the handling of NOTE_INSN_SWITCH_TEXT_SECTIONS is slightly wrong for this case. Looking more into it.
Testing a fix for the with/without -g problem.
Patch posted for the x86_64 failure: http://gcc.gnu.org/ml/gcc-patches/2005-11/msg00857.html For the i686 failure, I don't know since I was not able to reproduce that.
I don't know if this is related, but I can't compile make profiledbootstrap on a x86 Linux. Stops in attribs.c. I don't know if it is related to this bug but you can find more info in http://gcc.gnu.org/ml/gcc/2005-11/msg00906.html
Review mail was here: http://gcc.gnu.org/ml/gcc-patches/2005-12/msg00121.html
This is a bootstrap failure, and there is an approved patch, so this should be fixed before release: P1.
Test this again on the 4.1 branch and then will apply it there, the mainline currently ignores BOOT_CFLAGS so I cannot test it there.
Subject: Bug 22313 Author: pinskia Date: Tue Dec 20 04:53:06 2005 New Revision: 108839 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108839 Log: 2005-12-19 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/22313 * dwarf2out.c (dwarf2out_switch_text_section): Export. * debug.h (dwarf2out_switch_text_section): Prototype. * final.c (final_scan_insn): Call dwarf2out_switch_text_section if we need to call it for dwarf2 unwind info. Forgot the PR number Modified: branches/gcc-4_1-branch/gcc/ChangeLog
Fixed on the 4.1 branch, will test the mainline with --disable-bootstrap since that caused BOOT_CFLAGS to be ignored.
This is now broken even with -g on the mainline so unassigning.
I still can't profiledbootstrap gcc 4.1 branch. Stops with the following message: tage1/xgcc -Bstage1/ -B/usr/gcc_4_1/i486-slackware-linux/bin/ -c -O2 -g -fomit-frame-pointer -fprofile-use -freorder-blocks-and-partition -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute -DHAVE_CONFIG_H -I. -I. -I../../gcc-4_1-branch/gcc -I../../gcc-4_1-branch/gcc/. -I../../gcc-4_1-branch/gcc/../include -I../../gcc-4_1-branch/gcc/../libcpp/include ../../gcc-4_1-branch/gcc/attribs.c -o attribs.o /tmp/ccXgVrwC.s: Assembler messages: /tmp/ccXgVrwC.s:1280: Error: invalid sections for operation on `.LCFI71' and `.LCFI70' make[2]: *** [attribs.o] Error 1 This is with binutils 2.16.91.0.4 20051111 and gcc version 4.0.3 20051207 (prerelease) on a linux x86 machine.
Still breaks for me on 4.1 branch too (4.1 branch SVN ID 109831). Linux x86, binutils 2.16.91.0.4 The error is related but slightly different and on a different file these days: c-errors.c -o c-errors.o stage1/xgcc -Bstage1/ -B/usr/i586-ark-linux/bin/ -c -g -O2 -fprofile-use -freorder-blocks-and-partition -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include ../../gcc/c-lex.c -o c-lex.o /tmp/ccMLYhJE.s: Assembler messages: /tmp/ccMLYhJE.s:2979: Error: invalid sections for operation on `.LCFI22' and `.LCFI21' /tmp/ccMLYhJE.s:3048: Error: invalid sections for operation on `.LCFI38' and `.LCFI37' /tmp/ccMLYhJE.s:3242: Error: invalid sections for operation on `.LCFI76' and `.LCFI75' /tmp/ccMLYhJE.s:3279: Error: invalid sections for operation on `.LCFI83' and `.LCFI82'
Created attachment 10664 [details] Preprocessed source of code triggering this in current 4.1 SVN
(In reply to comment #27) > Still breaks for me on 4.1 branch too (4.1 branch SVN ID 109831). > Linux x86, binutils 2.16.91.0.4 Can you file a different bug and attach the .s file? Because I don't see this at all. Also can you try with a FSF release of binutils and not some hacked up version?
Created attachment 10665 [details] asm code generated by current 4.1 SVN
I am going to apply my patch to the mainline in the next or two, I will make sure I also apply my follow up patch too.
And now profiledbootstrap is broken a different way on the mainline so I am not fixing this.
*** Bug 27011 has been marked as a duplicate of this bug. ***
I've completed a successful profiledbootstrap on amd64-linux-gnu last night. Is anyone else still seeing this, or is it fixed?
FWIW profiledbootstrap still fails with -march=pentium4 and fortran enabled because of PR26449. Last tested with 20060520.
Still have this problen on x86 with latest gcc-4.1 SVN branch and binutils 2.16.91.0.7. stage1/xgcc -Bstage1/ -B/usr/i486-slackware-linux/bin/ -c -O2 -g -fomit-frame-pointer -fprofile-use -freorder-blocks-and-partition -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.1-branch/gcc -I../../gcc-4.1-branch/gcc/. -I../../gcc-4.1-branch/gcc/../include -I../../gcc-4.1-branch/gcc/../libcpp/include ../../gcc-4.1-branch/gcc/attribs.c -o attribs.o /tmp/ccoORGHT.s: Assembler messages: /tmp/ccoORGHT.s:1280: Error: invalid sections for operation on `.LCFI71' and `.LCFI70' make[2]: *** [attribs.o] Error 1 make[2]: Leaving directory `/root/SVN/GCC/build/gcc' make[1]: *** [stagefeedback_build] Error 2 make[1]: Leaving directory `/root/SVN/GCC/build/gcc' make: *** [profiledbootstrap] Error 2
I've now tested "make profiledbootstrap" on both mainline and the gcc-4_1-branch, on both x86_64-unknown-linux-gnu and i686-pc-linux-gnu, and not only does the profiled bootstrap build fine, but the dejagnu testsuite looks identical to a baseline "make bootstrap". Could anyone confirm whether they're still seeing this problem? Its likely that Andrew Pinski's patches together with the resolution of PRs 25518 and 26449 have now resolved this issue.
Unfortunately I still have the same problem.. Don't know if I am the only one! This is during compiling gcc 4.1 SVN trunk GNU ld version 2.16.91.0.7 20060317 gcc -v Using built-in specs. Target: i486-slackware-linux Configured with: ../gcc-4.1-branch/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux Thread model: posix gcc version 4.1.2 20060601 (prerelease) stage1/xgcc -Bstage1/ -B/usr/i486-slackware-linux/bin/ -c -O2 -g -fomit-frame-pointer -fprofile-use -freorder-blocks-and-partition -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.1-branch/gcc -I../../gcc-4.1-branch/gcc/. -I../../gcc-4.1-branch/gcc/../include -I../../gcc-4.1-branch/gcc/../libcpp/include ../../gcc-4.1-branch/gcc/c-lang.c -o c-lang.o stage1/xgcc -Bstage1/ -B/usr/i486-slackware-linux/bin/ -c -O2 -g -fomit-frame-pointer -fprofile-use -freorder-blocks-and-partition -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.1-branch/gcc -I../../gcc-4.1-branch/gcc/. -I../../gcc-4.1-branch/gcc/../include -I../../gcc-4.1-branch/gcc/../libcpp/include ../../gcc-4.1-branch/gcc/stub-objc.c -o stub-objc.o stage1/xgcc -Bstage1/ -B/usr/i486-slackware-linux/bin/ -c -O2 -g -fomit-frame-pointer -fprofile-use -freorder-blocks-and-partition -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.1-branch/gcc -I../../gcc-4.1-branch/gcc/. -I../../gcc-4.1-branch/gcc/../include -I../../gcc-4.1-branch/gcc/../libcpp/include ../../gcc-4.1-branch/gcc/attribs.c -o attribs.o /tmp/ccqSKDxK.s: Assembler messages: /tmp/ccqSKDxK.s:1280: Error: invalid sections for operation on `.LCFI71' and `.LCFI70'
My latest analysis and a possible patch/workaround have been posted here: http://gcc.gnu.org/ml/gcc-patches/2006-07/msg01015.html
Roger, the patch for advance loc seems sane solution to me (in my limited understanding of dwarf2). If I understand it right, we need the advance_loc only when crossing the section boundary, so we ought to be able to use NOTE_INSN_SWITCH_TEXT_SECTIONS and use the advance_loc only when tripping over it. Only anoying thing would be probably to get it passed out of final.c up to the offending place. Thanks for looking into this, Honza
Subject: Bug 22313 Author: sayle Date: Thu Aug 31 17:35:32 2006 New Revision: 116604 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116604 Log: PR other/22313 * dwarf2out.c (add_fde_cfi): Use a set_loc if the current label is NULL, otherwise use an advance_loc4 to adjust relative to the current label. (output_cfi) <DW_CFA_set_loc>: Update the current label. (dwarf2out_switch_text_section): Reset the current label to avoid using advance_loc4 over section boundaries. Modified: trunk/gcc/ChangeLog trunk/gcc/dwarf2out.c
Fixed.
Subject: Bug 22313 Author: sayle Date: Fri Sep 1 15:47:29 2006 New Revision: 116628 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116628 Log: PR other/22313 * dwarf2out.c (add_fde_cfi): Use a set_loc if the current label is NULL, otherwise use an advance_loc4 to adjust relative to the current label. (output_cfi) <DW_CFA_set_loc>: Update the current label. (dwarf2out_switch_text_section): Reset the current label to avoid using advance_loc4 over section boundaries. Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/dwarf2out.c