This is the mail archive of the cygwin-apps 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] |
On Nov 20 19:14, Corinna Vinschen wrote: > On Nov 20 18:32, Corinna Vinschen wrote: > > 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. > > I just made a quick test for the sake of creating a generic script to > add the manifests. > [...] For the records and to all interested in this. I have a script now which works, provided the executables are stripped and the .gnu_debuglink section is the only section with a long section name. The sources of the script called "add-mani.sh" and the sources of the Windows tool necessary to update the manifest are attached. The downside: If you add a manifest to, say, tcsh, the tcsh.exe.dbg file from the tcsh-debuginfo package will not have the .rsrc section, and due to the Dwarf2 debug sections you will not be able to add the .rsrc section successfully *and* keep the tcsh.exe.dbg file debuggable. This in turn results in a warning in GDB: warning: section .rsrc not found in /usr/lib/debug/bin/tcsh.exe.dbg The tcsh binary is still debuggable, apparently, but still... Therefore I think this script is only a temporary measure, until the time the binutils package allows to accomplish this by itself. We're working on that. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat
Attachment:
manifestize.tar.xz
Description: application/xz
Attachment:
pgpBIB0bF7zuP.pgp
Description: PGP signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |