public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch binutils/11065] [DllTool] DLL name from DEF file is ignored when using --output-exp option
@ 2010-11-23 14:20 Kai Tietz
  2010-11-23 14:54 ` Kai Tietz
  0 siblings, 1 reply; 7+ messages in thread
From: Kai Tietz @ 2010-11-23 14:20 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 854 bytes --]

Hello,

this patch addresses the bug described at 
http://sourceware.org/bugzilla/show_bug.cgi?id=11065 report. The logic 
should be IMHO that if --dllname is specified, it shall be used in any 
case. If the exp_name is used for determine the DLL name, then just in 
case there is no DLL name specified in the .def file.

ChangeLog

2010-11-23  Kai Tietz

        PR binutils/11065
        * dlltool.c (dll_name_set_by_exp_name): New variable.
        (def_name): Allow setting of dll_name by .def file.
        (def_library): Likewise.
        (main): Set dll_name_set_by_exp_name, if dll_name is
        set indirect by exp_name.

Tested for x86_64-w64-mingw32, i686-pc-cygwin, and i686-w64-mingw32. Ok 
for apply?

Regards,
Kai

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.


[-- Attachment #2: dlltool_11065.diff --]
[-- Type: application/octet-stream, Size: 1611 bytes --]

Index: src/binutils/dlltool.c
===================================================================
--- src.orig/binutils/dlltool.c	2010-11-02 11:06:15.000000000 +0100
+++ src/binutils/dlltool.c	2010-11-23 15:15:28.094842200 +0100
@@ -399,6 +399,7 @@ typedef struct identify_data_t
 static char *head_label;
 static char *imp_name_lab;
 static char *dll_name;
+static int dll_name_set_by_exp_name;
 static int add_indirect = 0;
 static int add_underscore = 0;
 static int add_stdcall_underscore = 0;
@@ -1089,6 +1090,15 @@ def_name (const char *name, int base)
   if (d_is_dll)
     non_fatal (_("Can't have LIBRARY and NAME"));
 
+  if (dll_name_set_by_exp_name)
+    {
+      if (dll_name)
+        {
+          free (dll_name);
+          dll_name = NULL;
+        }
+      dll_name_set_by_exp_name = 0;
+    }
   /* If --dllname not provided, use the one in the DEF file.
      FIXME: Is this appropriate for executables?  */
   if (!dll_name)
@@ -1105,6 +1115,16 @@ def_library (const char *name, int base)
   if (d_is_exe)
     non_fatal (_("Can't have LIBRARY and NAME"));
 
+  if (dll_name_set_by_exp_name)
+    {
+      if (dll_name)
+        {
+          free (dll_name);
+          dll_name = NULL;
+        }
+      dll_name_set_by_exp_name = 0;
+    }
+
   /* If --dllname not provided, use the one in the DEF file.  */
   if (!dll_name)
     set_dll_name_from_def (name, 1);
@@ -4177,6 +4197,7 @@ main (int ac, char **av)
       dll_name = xmalloc (len);
       strcpy (dll_name, exp_basename);
       strcat (dll_name, ".dll");
+      dll_name_set_by_exp_name = 1;
     }
 
   if (as_name == NULL)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-01 21:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-23 14:20 [patch binutils/11065] [DllTool] DLL name from DEF file is ignored when using --output-exp option Kai Tietz
2010-11-23 14:54 ` Kai Tietz
2010-11-23 19:32   ` Dave Korn
2010-11-24  9:08     ` Kai Tietz
2010-11-29 18:30       ` Kai Tietz
2010-12-01 21:47         ` Dave Korn
2010-12-01 21:37           ` Kai Tietz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).