Avoid collisions between parallel installations of Cygwin

Dave Korn dave.korn.cygwin@googlemail.com
Wed Oct 21 01:13:00 GMT 2009

Corinna Vinschen wrote:

> Does anybody have an idea what's going on?  Am I doing something
> wrong or are these Windows function really broken?

  Cygwin keeps long section names in a string table which is brutally
concatenated on the end of the PE executable - generally that means
"immediately after the resources".  Long section names are non-standard in the
PE format so I expect the standard ABIs won't handle it.

  I don't know whether using --disable-long-section-names is a practical
solution; it breaks debug info, but we could for example link the dll twice,
extracting the .dbg file the first time and disabling long section names the
second.  There may be other things that break; the .gnu_debuglink won't work
for example, and you'd have to manually load the dll-symbols in gdb, and I
dunno if the autoload_text or cygwin_dll_common sections ever get looked up by
name anywhere.

  I think maybe the robust solution is going to have to look like:

- create temp copy of dll
- strip string table from end, save section headers.
- use standard APIs to process it
- reconcatenate string table
- copy names (only) back from saved section headers.

  Not sure if we can do any better than that without actually relinking the
DLL from objects.  Or reworking it to use only short section names, which
ought to also be practical; it wouldn't be hard to hack on GDB to spot the
truncated versions of the section names (albeit that there's an ambiguity
problem we'd have to resolve in there one way or another).


More information about the Cygwin-developers mailing list