This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch ld/dlltool]: Allow empty LIBRARY statement in .def file
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Nick Clifton <nickc at redhat dot com>
- Date: Wed, 25 Jul 2012 23:13:02 +0200
- Subject: [patch ld/dlltool]: Allow empty LIBRARY statement in .def file
- References: <CAEwic4YhM18R9Ns+1pRLV_a1CQXJHzKp3=7JCLSEPQ-zDsZEdw@mail.gmail.com>
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