I'm running the gdb 6.1.1 test suite with gcc 2.95.3 and binutils HEAD. I'm getting these errors when I compile and link some C++ files: `local symbol 0' referenced in section `.gcc_except_table': discarded in section `.basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::Rep::gnu.linkonce.t.clone(void)' from /berman/fsf/_current_/berman/install/target/native/gcc/gcc-2.95.3-as-HEAD-ld-HEAD/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libstdc++.a(cstrmain.o) `local symbol 1' referenced in section `.gcc_except_table': discarded in section `.basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::Rep::gnu.linkonce.t.clone(void)' from /berman/fsf/_current_/berman/install/target/native/gcc/gcc-2.95.3-as-HEAD-ld-HEAD/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libstdc++.a(cstrmain.o) This is a regression from binutils 2.15. This is with binutils HEAD 2004-07-01 04:26:06 (approximately). The last known working binutils was binutils HEAD 2004-06-17 18:55:08 UTC. I'll attach a typescript showing the source files and the output with "gcc -v ..." with good and bad linkers.
Created attachment 123 [details] typescript showing source files and ld output with good and bad ld
I downloaded a fresh binutils and it works for me. This is binutils 2004-07-01 18:27:41 UTC. This patch fixed it. 2004-07-01 Alan Modra <amodra@bigpond.net.au> * elflink.c (elf_section_ignore_discarded_relocs): Revert last change. Comment. (elf_section_complain_discarded): New function. Handle .gcc_except_table too. (elf_link_input_bfd): Rewrite handling of relocs against symbols in discarded sections. * elf-bfd.h (elf_discarded_section): Protect macro arg. I ran the gdb 6.1.1 test suite with gdb 6.1.1 and gcc 2.95.3, dwarf-2 and stabs+, and compared it to results from 2004-06-19. There were no regressions and no improvements. I'm going to mark this RESOLVED/FIXED, let me know if I shouldn't do this to your bugzilla bugs. :) Thanks, Michael C