This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch ld/binutils]: Fix PR/13710 for supporting broken user .def-file generation


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"; }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]