Bug 1022

Summary: binutils failed to build gcc 4.0.1 20050619
Product: binutils Reporter: John David Anglin <danglin>
Component: ldAssignee: unassigned
Status: RESOLVED DUPLICATE    
Severity: normal CC: bug-binutils
Priority: P2    
Version: 2.17   
Target Milestone: ---   
Host: hppa-unknown-linux-gnu Target: hppa-unknown-linux-gnu
Build: hppa-unknown-linux-gnu Last reconfirmed:
Bug Depends on:    
Bug Blocks: 1025    

Description John David Anglin 2005-06-18 02:35:32 UTC
/home/dave/gcc-4.0/objdir/gcc/xgcc -shared-libgcc -B/home/dave/gcc-4.0/objdir/gc
c/ -nostdinc++ -L/home/dave/gcc-4.0/objdir/hppa-linux/libstdc++-v3/src -L/home/d
ave/gcc-4.0/objdir/hppa-linux/libstdc++-v3/src/.libs -B/home/dave/opt/gnu/gcc/gc
c-4.0.0/hppa-linux/bin/ -B/home/dave/opt/gnu/gcc/gcc-4.0.0/hppa-linux/lib/ -isys
tem /home/dave/opt/gnu/gcc/gcc-4.0.0/hppa-linux/include -isystem /home/dave/opt/
gnu/gcc/gcc-4.0.0/hppa-linux/sys-include -shared -nostdlib /usr/lib/crti.o /home
/dave/gcc-4.0/objdir/gcc/crtbeginS.o  .libs/bitmap_allocator.o .libs/pool_alloca
tor.o .libs/mt_allocator.o .libs/codecvt.o .libs/compatibility.o .libs/complex_i
o.o .libs/ctype.o .libs/debug.o .libs/debug_list.o .libs/functexcept.o .libs/glo
bals_locale.o .libs/globals_io.o .libs/ios.o .libs/ios_failure.o .libs/ios_init.
o .libs/ios_locale.o .libs/limits.o .libs/list.o .libs/locale.o .libs/locale_ini
t.o .libs/locale_facets.o .libs/localename.o .libs/stdexcept.o .libs/strstream.o
 .libs/tree.o .libs/allocator-inst.o .libs/concept-inst.o .libs/fstream-inst.o .
libs/ext-inst.o .libs/io-inst.o .libs/istream-inst.o .libs/istream.o .libs/local
e-inst.o .libs/locale-misc-inst.o .libs/misc-inst.o .libs/ostream-inst.o .libs/s
stream-inst.o .libs/streambuf-inst.o .libs/streambuf.o .libs/string-inst.o .libs
/valarray-inst.o .libs/wlocale-inst.o .libs/wstring-inst.o .libs/atomicity.o .li
bs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/message
s_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_members.
o .libs/basic_file.o .libs/c++locale.o -Wl,--whole-archive ../libmath/.libs/libm
ath.a ../libsupc++/.libs/libsupc++convenience.a -Wl,--no-whole-archive  -L/home/
dave/gcc-4.0/objdir/hppa-linux/libstdc++-v3/src -L/home/dave/gcc-4.0/objdir/hppa
-linux/libstdc++-v3/src/.libs -lm ../libmath/.libs/libmath.a -lm ../libsupc++/.l
ibs/libsupc++convenience.a -lm -L/home/dave/gcc-4.0/objdir/gcc -L/home/dave/opt/
gnu/gcc/gcc-4.0.0/lib/gcc/hppa-linux/../.. -lgcc_s -lgcc -lc -lgcc_s -lm -lgcc_s
 -lgcc -lc -lgcc_s   /home/dave/gcc-4.0/objdir/gcc/crtendS.o /usr/lib/crtn.o  -W
l,-O1 -Wl,--version-script=libstdc++-symbol.ver -Wl,-soname -Wl,libstdc++.so.6 -
o .libs/libstdc++.so.6.0.5
/home/dave/opt/gnu/bin/ld: BFD 2.16.91 20050612 internal error, aborting at ../.
./src/bfd/elf32-hppa.c line 3680 in elf32_hppa_relocate_section

/home/dave/opt/gnu/bin/ld: Please report this bug.

collect2: ld returned 1 exit status

(gdb) p *((struct elf32_hppa_link_hash_entry *) h)
$21 = {elf = {root = {root = {next = 0x0,
        string = 0x17e9f3 "_ZNSt11char_traitsIcE2eqERKcS2_@@GLIBCXX_3.4.5",
        hash = 600204418}, type = bfd_link_hash_defined, u = {undef = {
          next = 0x0, abfd = 0x172d90, weak = 0x0}, def = {next = 0x0,
          section = 0x172d90, value = 0}, i = {next = 0x0, link = 0x172d90,
          warning = 0x0}, c = {next = 0x0, p = 0x172d90, size = 0}}},
    indx = -1, dynindx = 382, got = {refcount = 0, offset = 0, glist = 0x0,
      plist = 0x0}, plt = {refcount = -1, offset = 4294967295,
      glist = 0xffffffff, plist = 0xffffffff}, size = 28, type = 2, other = 0,
    ref_regular = 0, def_regular = 1, ref_dynamic = 0, def_dynamic = 0,
    ref_regular_nonweak = 0, dynamic_adjusted = 0, needs_copy = 0,
    needs_plt = 0, non_elf = 0, hidden = 0, forced_local = 0, mark = 0,
    non_got_ref = 0, dynamic_def = 0, dynamic_weak = 0,
    pointer_equality_needed = 0, dynstr_index = 356, u = {weakdef = 0x0,
      elf_hash_value = 0}, verinfo = {verdef = 0xdb078, vertree = 0xdb078},
    vtable = 0x0}, stub_cache = 0x0, dyn_relocs = 0x0, plabel = 0}

ld aborts because h->plt.offset = 0xffffffff.

We have a weak definition for _ZNSt11char_traitsIcE2eqERKcS2_ in
string-inst.o:

00000000 W _ZNSt11char_traitsIcE2eqERKcS2_

dave@gsyprf11:~/gcc-4.0/objdir/hppa-linux/libstdc++-v3/src$ objdump -r string-
inst.o|grep _ZNSt11char_traitsIcE2eqERKcS2_|less
00004003 R_PARISC_DIR32    .gnu.linkonce.t._ZNSt11char_traitsIcE2eqERKcS2_
00004007 R_PARISC_DIR32    .gnu.linkonce.t._ZNSt11char_traitsIcE2eqERKcS2_+0x000
0001c
00002303 R_PARISC_DIR32    .gnu.linkonce.t._ZNSt11char_traitsIcE2eqERKcS2_
00000000 R_PARISC_SEGREL32  _ZNSt11char_traitsIcE2eqERKcS2_
00000004 R_PARISC_SEGREL32  .gnu.linkonce.t._ZNSt11char_traitsIcE2eqERKcS2_+0x00
000018
00000000 R_PARISC_PLABEL32  _ZNSt11char_traitsIcE2eqERKcS2_
00000018 R_PARISC_DIR32    .gnu.linkonce.t._ZNSt11char_traitsIcE2eqERKcS2_
00000018 R_PARISC_DIR32    .gnu.linkonce.t._ZNSt11char_traitsIcE2eqERKcS2_

The error doesn't occur with 2.15.
Comment 1 Andrew Pinski 2005-06-20 00:16:26 UTC
http://gcc.gnu.org/ml/gcc/2005-06/msg00844.html
Comment 2 H.J. Lu 2005-06-20 13:15:37 UTC
Fixed by

http://sourceware.org/ml/binutils/2005-06/msg00505.html

*** This bug has been marked as a duplicate of 1025 ***
Comment 3 dave@hiauly1.hia.nrc.ca 2005-06-20 15:24:25 UTC
Subject: Re:  binutils failed to build gcc 4.0.1 20050619

> Fixed by
> 
> http://sourceware.org/ml/binutils/2005-06/msg00505.html

Should this fix be backported to 2.16?

Thanks,
Dave