[patch ld/dlltool]: Allow empty LIBRARY statement in .def file
Hi,
this patch relax behavior of dlltool and ld about .def file parsing so
that the name of LIBRARY statement is optional.
ChangeLog
binutils/
2012-07-25 Kai Tietz
* defparse.y (command): Call def_library only if name isn't
NULL and not empty.
ld/
2012-07-25 Kai Tietz
* deffilep.y (command): Call def_image_name only if name isn't
NULL and not empty.
Regression tested for x86_64-w64-mingw32, i686-w64-mingw32, and
i686-pc-cygwin. ok for apply?
Regards,
Kai
Index: defparse.y
===================================================================
RCS file: /cvs/src/src/binutils/defparse.y,v
retrieving revision 1.14
diff -u -r1.14 defparse.y
--- defparse.y 24 Feb 2012 14:20:16 -0000 1.14
+++ defparse.y 25 Jul 2012 20:56:31 -0000
@@ -52,7 +52,12 @@
command:
NAME opt_name opt_base { def_name ($2, $3); }
- | LIBRARY opt_name opt_base option_list { def_library ($2, $3); }
+ | LIBRARY opt_name opt_base option_list
+ {
+ /* Ignore LIBRARY without argument, or empty name. */
+ if ($2 && $2[0] != 0)
+ def_library ($2, $3);
+ }
| EXPORTS explist
| DESCRIPTION ID { def_description ($2);}
| STACKSIZE NUMBER opt_number { def_stacksize ($2, $3);}
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination