This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch ld/binutils]: Fix PR/13710 for supporting broken user .def-file generation
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Nick Clifton <nickc at redhat dot com>
- Date: Mon, 20 Feb 2012 08:44:20 +0100
- Subject: [patch ld/binutils]: Fix PR/13710 for supporting broken user .def-file generation
- Authentication-results: mr.google.com; spf=pass (google.com: domain of ktietz70@googlemail.com designates 10.60.22.228 as permitted sender) smtp.mail=ktietz70@googlemail.com; dkim=pass header.i=ktietz70@googlemail.com
Hi,
this patch re-enables that LIBRARY definition comes after
EXPORTS-section. This behavior
needs to be allowed to support broken logic in libtool and some other
projects creating .def
files. The standard definition of .def files can be found at
http://msdn.microsoft.com/en-us/library/d91k01sh%28v=vs.80%29.aspx
The consequence of this patch is, that we don't allow export/import
names of "LIBRARY", nor we support
by it that a library is named "LIBRARY.*".
ChangeLog binutils/
2012-02-20 Kai Tietz <ktietz@redhat.com>
PR binutils/13710
* defparse.y (keyword_as_name): Disable LIBRARY
keyword.
ChangeLog ld/
2012-02-20 Kai Tietz <ktietz@redhat.com>
PR binutils/13710
* deffilep.y (keyword_as_name): Disable LIBRARY
keyword.
Tested for i686-w64-mingw32, x86_64-w64-mingw32, and i686-pc-cygwin.
Ok for apply?
Regards,
Kai
Index: binutils/defparse.y
===================================================================
RCS file: /cvs/src/src/binutils/defparse.y,v
retrieving revision 1.13
diff -u -r1.13 defparse.y
--- binutils/defparse.y 11 Feb 2012 20:02:02 -0000 1.13
+++ binutils/defparse.y 20 Feb 2012 07:36:21 -0000
@@ -153,7 +153,9 @@
;
keyword_as_name: NAME { $$ = "NAME"; }
- | LIBRARY { $$ = "LIBRARY"; }
+/* Disabled LIBRARY keyword for a quirk in libtool. It places LIBRARY
+ command after EXPORTS list, which is illegal by specification.
+ | LIBRARY { $$ = "LIBRARY"; } */
| DESCRIPTION { $$ = "DESCRIPTION"; }
| STACKSIZE { $$ = "STACKSIZE"; }
| HEAPSIZE { $$ = "HEAPSIZE"; }
Index: ld/deffilep.y
===================================================================
RCS file: /cvs/src/src/ld/deffilep.y,v
retrieving revision 1.39
diff -u -r1.39 deffilep.y
--- ld/deffilep.y 19 Feb 2012 21:18:08 -0000 1.39
+++ ld/deffilep.y 20 Feb 2012 07:36:21 -0000
@@ -249,7 +249,11 @@
| EXPORTS { $$ = "EXPORTS"; }
| HEAPSIZE { $$ = "HEAPSIZE"; }
| IMPORTS { $$ = "IMPORTS"; }
- | LIBRARY { $$ = "LIBRARY"; }
+/* Disable LIBRARY keyword as valid symbol-name. This is necessary
+ for libtool, which places this command after EXPORTS command.
+ This behavior is illegal by specification, but sadly required by
+ by compatibility reasons.
+ | LIBRARY { $$ = "LIBRARY"; } */
| NAME { $$ = "NAME"; }
| NONAMEU { $$ = "NONAME"; }
| NONAMEL { $$ = "noname"; }