PR binutils/13051

Fix a syntax error bug when compiling rc files with the VERSIONINFO resource
	containing more than one language block inside a single StringFileInfo block.

	* windint.h (rc_ver_stringtable): New structure definition.
	(rc_ver_info): Use it.
	* rcparse.y (verstringtable): New variable.
	(verstringtables): New type.
	(verstringtables:): New rule declaration.
	(verblocks:): Use it.
	* resrc.c (append_ver_stringtable): New function.
	(append_ver_stringfileinfo): Update to use stringtables.
	* windres.h (append_ver_stringfileinfo): Update declaration.
	(append_ver_stringtable): New declaration.
	* resrc.c (write_rc_versioninfo): Update to support multiple blocks.
	* resbin.c (bin_to_res_version): Likewise.
	(res_to_bin_versioninfo): Likewise.

	* binutils-all\windres\version.rsd: Regenerate.
	* binutils-all\windres\version_cat.rsd: Regenerate.
	* binutils-all\windres\version_mlang.rc: Add new test.
	* binutils-all\windres\version_mlang.rsd: Likewise.
This commit is contained in:
Nick Clifton
2011-10-11 15:56:29 +00:00
parent 941b2081b1
commit bfb6c1ab1e
11 changed files with 334 additions and 100 deletions

View File

@@ -1,6 +1,6 @@
%{ /* rcparse.y -- parser for Windows rc files
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008
Free Software Foundation, Inc.
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008,
2011 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
Extended by Kai Tietz, Onevision.
@@ -79,6 +79,7 @@ static const rc_res_id res_null_text = { 1, {{0, &null_unichar}}};
rc_rcdata_item *rcdata_item;
rc_fixed_versioninfo *fixver;
rc_ver_info *verinfo;
rc_ver_stringtable *verstringtable;
rc_ver_stringinfo *verstring;
rc_ver_varinfo *vervar;
rc_toolbar_item *toobar_item;
@@ -150,6 +151,7 @@ static const rc_res_id res_null_text = { 1, {{0, &null_unichar}}};
%type <rcdata_item> opt_control_data
%type <fixver> fixedverinfo
%type <verinfo> verblocks
%type <verstringtable> verstringtables
%type <verstring> vervals
%type <vervar> vertrans
%type <toobar_item> toolbar_data
@@ -1471,9 +1473,9 @@ verblocks:
{
$$ = NULL;
}
| verblocks BLOCKSTRINGFILEINFO BEG BLOCK BEG vervals END END
| verblocks BLOCKSTRINGFILEINFO BEG verstringtables END
{
$$ = append_ver_stringfileinfo ($1, $4, $6);
$$ = append_ver_stringfileinfo ($1, $4);
}
| verblocks BLOCKVARFILEINFO BEG VALUE res_unicode_string_concat vertrans END
{
@@ -1481,6 +1483,17 @@ verblocks:
}
;
verstringtables:
/* empty */
{
$$ = NULL;
}
| verstringtables BLOCK BEG vervals END
{
$$ = append_ver_stringtable ($1, $2, $4);
}
;
vervals:
/* empty */
{