This is the mail archive of the mailing list for the binutils 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: [patch windres]: Fix binary import of version-info resource

On Tue, Nov 27, 2012 at 10:38:46AM +0100, Kai Tietz wrote:
>This patch fixes a quirk about index/length calculation for binary
>Eg for cygwin the following command './windres.exe
>/cygdrive/c/Windows/System32/ntdll.dll' failed in
>importing version-resource from system-DLL.
>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?
>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.


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