Description of problem: linker error while compiling gcc-4.x from source Version-Release number of selected component (if applicable): binutils-2.15.92.0.2-18 gcc-3.4.5-2 cpp-3.4.5-2 libgcc-3.4.5-2 How reproducible: always Steps to Reproduce: 1. Download gcc-4.x 2. Compile 3. Fails with internal error Actual results: Compile fails Expected results: Should compile Additional info: Works fine with RHEL4U2 binutils-2.15.92.0.2-15 cpp-3.4.4-2 gcc-3.4.4-2 libgcc-3.4.4-2
Error message /usr/bin/ld: BFD 2.15.92.0.2 20040927 internal error, aborting at ../../bfd/elf32-i386.c line 2262 in elf_i386_relocate_section /usr/bin/ld: Please report this bug. log file attached
Created attachment 126071 [details] gcc 4.1.0 compile log
gcc-4.0.2 also compiles properly with binutils-2.16.1 and other packages from RHEL4U3 (e.g. gcc-3.4.5-2).
This issue is on Red Hat Engineering's list of planned work items for the upcoming Red Hat Enterprise Linux 4.4 release. Engineering resources have been assigned and barring unforeseen circumstances, Red Hat intends to include this item in the 4.4 release.
This regression seems to be caused by the binutils-2.15.92.0.2-weak-size.patch patch, added to fix #168316, IT#77962.
I should note that what libstdc++-v3 does here is very fragile and haven't been ever supported, only happens to work with some ld versions (and doesn't work with most other ld versions). One object has versioned symbol (in this case _ZNSt11char_traitsIcE2eqERKcS2_) @@GLIBCXX_3.4.5 and @GLIBCXX_3.4, another one exports the same symbol (weak) unversioned. The reason why this works e.g. in gcc4 RHEL4 rpms is that in RHEL4 gcc4 rpms compatibility.o (which has the versioned symbol) comes last, while in upstream it comes before string-inst.o which defines the weak symbol.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2006-0489.html