X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Thu, 24 Jan 2013 11:00:37 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Binutils objcopy bug (was Re: rebase segfault) Message-ID: <20130124100037.GB24121@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20130115100745 DOT GC2353 AT calimero DOT vinschen DOT de> <50F5312A DOT 2040503 AT gmail DOT com> <20130115112406 DOT GA13752 AT calimero DOT vinschen DOT de> <50F5D246 DOT 6010902 AT gmail DOT com> <50F653AB DOT 80102 AT gmail DOT com> <20130116123509 DOT GA16991 AT calimero DOT vinschen DOT de> <50F6AD63 DOT 8080106 AT gmail DOT com> <20130124030145 DOT 22fa143f AT YAAKOV04> <20130124092746 DOT GC8311 AT calimero DOT vinschen DOT de> <510103AF DOT 3080305 AT gmail DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <510103AF.3080305@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Jan 24 10:49, marco atzeri wrote: > On 1/24/2013 10:27 AM, Corinna Vinschen wrote: > >On Jan 24 03:01, Yaakov wrote: > >>On Wed, 16 Jan 2013 14:38:43 +0100, marco atzeri wrote: > >>>On 1/16/2013 1:35 PM, Corinna Vinschen wrote: > >>>>On Jan 16 08:15, marco atzeri wrote: > >>>>>On 1/15/2013 11:03 PM, marco atzeri wrote: > >>>>>>On 1/15/2013 12:24 PM, Corinna Vinschen wrote: > >>>>This is a serious bug in objcopy in the current binutils. Given that > >>>>cygport creates the debug info automatically, we might end up with > >>>>spuriously broken DLLs in the distro. > >>> > >>>we already have some : > >>> > >>>/usr/bin/cygcrypto-1.0.0.dll > >>> 8 .gnu_deb 0000001c 67542000 67542000 0017ac00 2**2 > >>> > >>>/usr/bin/cyglsa.dll > >>> 6 .gnu_deb 00000014 10007000 10007000 00001400 2**2 > >>> > >>>/usr/bin/cygssl-1.0.0.dll > >>> 8 .gnu_deb 0000001c 58fcf000 58fcf000 00059a00 2**2 > >> > >>I checked every /usr/bin/*.dll on my system (which is a lot), and these > >>three, plus cyglsa64.dll (which can only be read by > >>x86_64-w64-mingw32-objdump), are the only ones which show this. I did > >>manage to reproduce this on my machine with openssl, and passing > >>--long-section-names=enable to objcopy does fix this, but why are only > >>these DLLs affected? > > > >Don't forget Marco's DLLs. However, aprt from that it's kind of weird > >that all of them are built by me, isn't it? I just don't see where > >the connection is. I'm using your stock Fedora cygwin tools on Fedora 17 > >to build the Cygwin DLLs. OTOH, the openssl package doesn't support > >cross builds, so I'm using stock Cygwin distro gcc, binutils, and cygport > >to build openssl. > > > >This is quite puzzeling. > > > > > >Corinna > > > > likely complex program have anyway a section with long name > > The attached patch solves the issue of the short ".gnu_deb" > on binutils cvs > > --- src/binutils/objcopy.c 2013-01-07 18:40:59.000000000 +0100 > +++ src_new/binutils/objcopy.c 2013-01-19 22:50:12.447000600 +0100 > @@ -3453,6 +3453,7 @@ > break; > > case OPTION_ADD_GNU_DEBUGLINK: > + long_section_names = ENABLE ; > gnu_debuglink_filename = optarg; > break; > > No clue what is causing rebase to chock. I compared the > ".reloc" section of > > built, stripped and with debug link versions of dict_snowball.dll, > and I did not notice any difference (but I am not a PE-COFF expert) > all file here: > http://matzeri.altervista.org/works/rebase/ > > Please note that rebase segfaults on dict_snowball.dll the first time > but any subsequent rebasing, also with different start address, > works without any problem, so it is possible that we had other > dll with the same problem but we never noticed I already explained why: The SEGV happens during relocation. The file header has been changed already. If you call the same rebase, it will try to rebase the file to the same new address. If current file base address == requested file base address, rebase will return without performing any action. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple