------- Additional Comments From ro at TechFak dot Uni-Bielefeld dot DE 2008-11-14 15:09 ------- Subject: Re: 64-bit libstdc++.so fails to link on Solaris 11/SPARC: could not read symbols: Bad value
Hi Nick, > As a matter of interest if you change this to: > > if ((! ABI_64_P (abfd) && ELF32_R_TYPE (rel->r_info) == R_SPARC_PLT32) > || (ABI_64_P (abfd) && ELF32_R_TYPE (rel->r_info) == R_SPARC_WPLT30)) > > does the patch then work ? (I agree that the 32-bit case does seem > rather mysterious). unfortunately not: this time ld SEGVs: /vol/gcc/obj/binutils-2.19.50-g/ld/ld-new: warning: section `.bss' type changed to PROGBITS /vol/gcc/obj/binutils-2.19.50-g/ld/ld-new: BFD (GNU Binutils) 2.19.50.20081111 assertion fail /vol/gnu/src/binutils/binutils-dist/bfd/elfxx-sparc.c:2765 Segmentation Fault #0 0x00091024 in _bfd_sparc_elf_relocate_section (output_bfd=0x1c5f10, info=0x19da08, input_bfd=0x1dc5a0, input_section=0x1f6ab0, contents=0x1082948 "[EMAIL PROTECTED]", relocs=0x1fdca0, local_syms=0x753920, local_sections=0xfa3c98) at /vol/gnu/src/binutils/binutils-dist/bfd/elfxx-sparc.c:2768 #1 0x000d4b9c in elf_link_input_bfd (finfo=0xffbfe880, input_bfd=0x1dc5a0) at /vol/gnu/src/binutils/binutils-dist/bfd/elflink.c:9327 #2 0x000d7f84 in bfd_elf_final_link (abfd=0x1c5f10, info=0x19da08) at /vol/gnu/src/binutils/binutils-dist/bfd/elflink.c:10452 #3 0x00040958 in ldwrite () at /vol/gnu/src/binutils/binutils-dist/ld/ldwrite.c:567 #4 0x0003cec0 in main (argc=114, argv=0xffbfea7c) at /vol/gnu/src/binutils/binutils-dist/ld/ldmain.c:462 At l. 2768 of elfxx-sparc.c (_bfd_sparc_elf_relocate_section), h is NULL, so if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) { /* We didn't make a PLT entry for this symbol. This happens when statically linking PIC code, or when using -Bsymbolic. */ break; } crashes when dereferencing it. If I adapt the check immediately before @@ -2751,19 +2751,12 @@ /* Relocation is to the entry for this symbol in the procedure linkage table. */ - if (! ABI_64_P (output_bfd)) - { - /* The Solaris native assembler will generate a WPLT30 reloc - for a local symbol if you assemble a call from one - section to another when using -K pic. We treat it as - WDISP30. */ - if (h == NULL) - break; - } - else - { - BFD_ASSERT (h != NULL); - } + /* The Solaris native assembler will generate a WPLT30 reloc + for a local symbol if you assemble a call from one + section to another when using -K pic. We treat it as + WDISP30. */ + if (h == NULL) + break; if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) { I still get the "section `.bss' type changed to PROGBITS" warning, but at least a libstdc++.so is produced. I'm now continuting the GCC bootstrap and will run the testsuite see if this seems to work. Rainer -- http://sourceware.org/bugzilla/show_bug.cgi?id=7027 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils