If stripping large object files with 'strip -x <obj.o>' the following error results: BFD: BFD (GNU Binutils) 2.18.50.20080625 internal error, aborting at /netrel/src/binutils-20080624-2/bfd/coffcode.h line 842 in handle_COMDAT Sometimes, stripping works but a subsequent building of a library by 'ar -r *.o' results in the same error: BFD: BFD (GNU Binutils) 2.18.50.20080625 internal error, aborting at /netrel/src/binutils-20080624-2/bfd/coffcode.h line 842 in handle_COMDAT I can send an object file to reproduce this error (500kB), but I don't see where to attach it here.
Created attachment 3773 [details] an object file produces by g++ to reproduce the error by 'strip -x ipp_inst_lib-1.o': BFD: BFD (GNU Binutils) 2.18.50.20080625 internal error, aborting at /netrel/src/binutils-20080624-2/bfd/coffcode.h line 842 in handle_COMDAT
Created attachment 3868 [details] Allow external symbols for the section comdat symbol
Hi Claudius, You are using a slightly out of date version of binutils (2.18 as opposed to 2.19), but the bug is present in the current sources anyway. Please could you try out the uploaded patch which I think will solve the problem. Cheers Nick
Subject: Re: Binutils strip/ar BFD internal error Hello Nick, I downloaded the cygwin package binutils-20080624-2-src.tar.bz2 and created strip-new.exe and ar.exe while applying your patch. Then the object files could be stripped and ar-chived correctly. I couldn't figure out how to get the gcc use ld-new from the package above. Renaming it to ld.exe and adapting the PATH didn't work. Thus I couldn't create a complete test.exe based on the stripped object files as a final verification, but I guess that if all tools were built with your patch all would work fine. Claudius nickc at redhat dot com schrieb: > ------- Additional Comments From nickc at redhat dot com 2009-04-09 14:32 ------- > Hi Claudius, > > You are using a slightly out of date version of binutils (2.18 as opposed to > 2.19), but the bug is present in the current sources anyway. > > Please could you try out the uploaded patch which I think will solve the problem. > > Cheers > Nick > > >
Subject: Bug 9909 CVSROOT: /cvs/src Module name: src Changes by: nickc@sourceware.org 2009-04-17 12:08:10 Modified files: bfd : ChangeLog Log message: PR 9909 * coffcode.h (handle_COMDAT): Allow for external COMDAT symbols. [delta to coffcode.h accidentally committed with a previous patch] Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.4558&r2=1.4559
Hi Claudius, Thanks - I have applied the patch along with the changelog entry below. With regard to getting gcc to use a newly built linker you will probably find in the gcc build directory an executable (file or script) called "collect-ld". Try replacing it with a symbolic link to the ld-new executable and then it should work. Cheers Nick bfd/ChangeLog 2009-04-17 Nick Clifton <nickc@redhat.com> PR 9909 * coffcode.h (handle_COMDAT): Allow for external COMDAT symbols.