delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/11/04/10:03:02

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 4 Nov 2005 10:02:50 -0500
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: BUG: Binutils strip corrupts dll files when using cygwin 1.5.18 and latest snapshot (20051103)
Message-ID: <20051104150250.GD27444@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
References: <F5D40D7C-1285-49BA-ADA0-4A93ABD63982 AT rehley DOT net> <20051104015144 DOT GI17650 AT trixie DOT casa DOT cgf DOT cx> <436B5771 DOT 1070202 AT byu DOT net> <20051104131115 DOT GA2858 AT calimero DOT vinschen DOT de> <436B65CC DOT 8010705 AT byu DOT net>
Mime-Version: 1.0
In-Reply-To: <436B65CC.8010705@byu.net>
User-Agent: Mutt/1.5.8i

On Fri, Nov 04, 2005 at 06:44:44AM -0700, Eric Blake wrote:
>According to Corinna Vinschen on 11/4/2005 6:11 AM:
>>The problem is that there's one section in the file, .gnu_debuglink,
>>which is defined as a debugging section.  strip's job is to remove all
>>debug sections.  This is usually a simple job to do since the debug
>>sections are typically at the end of the file anyway.  Not so the
>>.gnu_debuglink section.  By stripping this out, strip generates an
>>invalid PE/COFF file since it leaves an undefined memory hole in the
>>address space of the file, which is a no-no with the somewhat overly
>>simple Windows runtime loader.
>
>Wow.  Learn something every day.  No wonder ELF is so much more popular
>in the open source community.

Yeah, we tried hard to convince the open source community to use PE/COFF
and to start adopting the use of extensions like '.exe', and '.dll' but
you know how they are.

>>It's an unlucky case.  You could argue that strip should know better
>>than to remove debug sections from the middle of a PE/COFF file but
>>OTOH the Cygwin DLL is a very special case.
>
>So the cygwin DLL is likely to be the only PE/COFF dll that strip ever
>encounters with a section marked as debug in the middle of a file?

Yes.  Let me quote from the link that I provided since it seems like you
haven't read it:

>cgf wrote:
>>The splitting of the debug information into a new file is something that
>>I've wanted to do for a long time but problems with the standard
>>binutils way of accomplishing this task had proven to be daunting for PE
>>format executables.  I took some time today to try to understand what
>>was going wrong and wrote a script to fix up the dll so that information
>>about cygwin1.dbg was included in cygwin1.dll in a way that does not
>>cause cygwin1.dll to be an invalid binary -- which was the problem
>>before.
>>
>>Eventually, I will fix binutils so that this workaround is no longer
>>necessary and, then, it will be possible to create separate debug files
>>for any binary, without the need for my fixup.

So, to clarify, I was wrong to say that it wasn't a bug before.  It is
at least arguably a bug that binutils creates a bad dll if you strip
cygwin1.dll.  However, if you read the above it should be pretty clear
that this is a problem that is understood and that notes of concern
about the behavior are not required.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019