This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: BUG: Binutils strip corrupts dll files when using cygwin 1.5.18 and latest snapshot (20051103)


On Nov  4 06:44, 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.
> 
> > 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?  If it
> is ever expected that other DLLs will have the same property, then yes,
> strip should be taught to not strip intermediate debug sections; but if it
> is just cygwin1.dll, I can live with the rule of thumb of "don't do it if
> it hurts".

It's very likely that the Cygwin DLL is the only one (*) having this
special layout.  The debug sections are usually at the end of the file
since that's how the linker description files look like.  Cygwin uses
its own linker description file, because it requires that the last
section in the file is the .cygheap section, which is designed as a
potentially growing section.

I agree that it would be nice if strip would not strip debug sections
from the middle of the file, but it doesn't look like there would be any
pressing need for that.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]