This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
windres bug + fix
- To: <binutils at sources dot redhat dot com>
- Subject: windres bug + fix
- From: "Dmitry Timoshkov" <dmitry at baikal dot ru>
- Date: Fri, 6 Jul 2001 15:51:50 +0800
Repost from <cygwin@cygwin.com> follows:
--
Hello.
This simple resource file causes windres to fail:
rc -r windres_bug.rc
windres -I res -O coff -o windres_bug.res.o -i windres_bug.res
windres: windres_bug.res: unexpected end of file
-- cut here: windres_bug.rc --
1 RCDATA
BEGIN
"text1"
END
2 RCDATA
BEGIN
"text2"
END
-- cut here --
The patch below fixes it. I have tested the patch with many different
resource files and it seems to have no side effects.
Dmitry Timoshkov <dmitry@codeweavers.com>
* resres.c (read_resource_entry): Align after reading data.
--- binutils-2.11.2/binutils/resres.c Sun Sep 19 23:59:36 1999
+++ resres.c Fri Jul 06 04:39:34 2001
@@ -177,6 +177,9 @@
buff = res_alloc (reshdr.data_size);
/* Read data */
read_res_data (buff, reshdr.data_size, 1);
+
+ res_align_file ();
+
/* Convert binary data to resource */
r = bin_to_res (type, buff, reshdr.data_size, 0);
r->res_info = resinfo;
P.S.
Why Cygwin version of binutils is so different from the official release
of binutils 2.11.2? Is it expected to have both branches merged?
--
Dmitry at Baikal.ru