Cygport and auto-manifestize compatibility manifest

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Nov 20 17:32:00 GMT 2013


On Nov 20 18:22, Achim Gratz wrote:
> Corinna Vinschen writes:
> > Well, perhaps.  I'm just not sure it's the right thing to do it at
> > postinstall time.  I mean, it's not impossible, obviously, but it's
> > a lot of stuff per executable and running this for a few thousand .exe
> > files could take some time.
> 
> Yes, it does... but ever since I've switched to doing incremental
> autorebases that time has shrunk a lot.
> 
> > We would also have to make sure that the sections with long section
> > names are recreated after adding the .rsrc section, which is something
> > I don't quite see how to accomplish, right now.
> 
> Hmm.  I'm out of my depths on this, but would it be possible to excise
> those sections, do whatever changes are necessary to the rest of the
> executable and then add them back?

I don't know.  It's apparently more complicated than just calling
objcopy.  For instance, objcopy can export sections from a file in
whatever format you want, but it can only add back sections if they are
given as binary blobs.  If you add such a binary blob it's missing
relocation information.  Also, you have to make sure all the sections
start at the right address, thanks to the harebrained PE/COFF format.

This is apparently a big deal, otherwise it should have been no problem
to add a resource binary blob into an executable without making Windows
choke on it (ERROR_BAD_EXE_FORMAT).  Maybe I did something wrong, but I
would have no idea what option I missed.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20131120/da7d871f/attachment.sig>


More information about the Cygwin-apps mailing list