This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch windres]: Fix binary import of version-info resource
- From: Christopher Faylor <cgf-use-the-mailinglist-please at sourceware dot org>
- To: Kai Tietz <ktietz70 at googlemail dot com>, Nick Clifton <nickc at redhat dot com>, Binutils <binutils at sourceware dot org>
- Date: Tue, 27 Nov 2012 11:21:08 -0500
- Subject: Re: [patch windres]: Fix binary import of version-info resource
- References: <CAEwic4Z1KeLdxz3j-aQcsAYHXNnv2Oq=HbPWmbnQft1TtfM9oQ@mail.gmail.com>
On Tue, Nov 27, 2012 at 10:38:46AM +0100, Kai Tietz wrote:
>Hi,
>
>This patch fixes a quirk about index/length calculation for binary
>versioninfo-resource.
>Eg for cygwin the following command './windres.exe
>/cygdrive/c/Windows/System32/ntdll.dll' failed in
>importing version-resource from system-DLL.
>
>ChangeLog
>
>2012-11-27 Kai Tietz
>
> * resbin.c (bin_to_res_version): Correct offset
> and length calculation of resource.
>
>Tested for x86_64-w64-mingw32, i686-pc-cygwin, and i686-w64-mingw32.
>Ok for apply?
>
>Regards,
>Kai
>
>Index: resbin.c
>===================================================================
>RCS file: /cvs/src/src/binutils/resbin.c,v
>retrieving revision 1.18
>diff -p -u -r1.18 resbin.c
>--- resbin.c 11 Oct 2011 15:56:28 -0000 1.18
>+++ resbin.c 27 Nov 2012 09:34:48 -0000
>@@ -1045,6 +1045,7 @@ bin_to_res_version (windres_bfd *wrbfd,
> since we round the subvariables in the loop. */
>
> verlen = (verlen + 3) &~ 3;
>+ verlen -= off;
Rather than do this repeatedly could you just modify get_version_header
to do this automatically? Then you only need to do it in one place.
cgf