Since some time I get boot strap errors with gcc on systems with systemtap installed. It fails when linking libsupc++ like this (PR60946). systemtap sets up some complicated data structures in notes to describe trace points. `_.stapsdt.base' referenced in section `.note.stapsdt' of ../libsupc++/.libs/libsupc++convenience.a(eh_catch.o): defined in discarded section `.stapsdt.base[.stapsdt.base]' of ../libsupc++/.libs/libsupc++convenience.a(eh_catch.o) `_.stapsdt.base' referenced in section `.note.stapsdt' of ../libsupc++/.libs/libsupc++convenience.a(eh_throw.o): defined in discarded section `.stapsdt.base[.stapsdt.base]' of ../libsupc++/.libs/libsupc++convenience.a(eh_catch.o) `_.stapsdt.base' referenced in section `.note.stapsdt' of ../libsupc++/.libs/libsupc++convenience.a(eh_throw.o): defined in discarded section `.stapsdt.base[.stapsdt.base]' of ../libsupc++/.libs/libsupc++convenience.a(eh_catch.o) collect2: error: ld returned 1 exit status I can work around it by commenting use use of -gc-sections for libstdc++. This seems like a bug. Even with gc-sections symbol references from notes sections should not result in an error. GNU ld version 2.25-8.fc22
Please provide procedure how to reproduce it.
Install systemtap-devel on Fedora Do a gcc bootstrap
Please try binutils master branch.
Are you using ld or gold? I have no problems with ld.
I'm using ld ld --version GNU ld version 2.25-8.fc22
(In reply to Andi Kleen from comment #5) > I'm using ld > > ld --version > GNU ld version 2.25-8.fc22 Please try binutils master branch.
binutils mainline can't build gcc /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section (3168) /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section (2884) /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section (1858) /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section (2688) /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section (2379) /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section (3136) /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section (3310) /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section (1947) /usr/local/bin/ld-plugin: _muldi3_s.o(.debug_info+0x53c): reloc against `.debug_str': error 2 Lots of these messages
I don't see anything like that here, on x86_64-linux with GNU ld (GNU Binutils) 2.25.51.20150926 xgcc (GCC) 6.0.0 20150926 (experimental) Perhaps your binutils is miscompiled? I suggest starting off the bootstrap process from a known good system compiler.
Binutils was compiled with the system compiler Did a separate build on binutils Then bootstrapped gcc with PATH=/path/to/binutils/bin:$PATH ....
(In reply to Andi Kleen from comment #7) > binutils mainline can't build gcc > > /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section > (3168) > /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section > (2884) > /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section > (1858) > /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section > (2688) > /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section > (2379) > /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section > (3136) > /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section > (3310) > /usr/local/bin/ld-plugin: _muldi3_s.o: access beyond end of merged section > (1947) > /usr/local/bin/ld-plugin: _muldi3_s.o(.debug_info+0x53c): reloc against > `.debug_str': error 2 > > > Lots of these messages Please send me all input files to reproduce this linker error.
It is a pilot error.