Allow inferring tmp_prefix from the dll name from a def file.
authorMartin Storsj? <martin@martin.st>
Sat, 22 Jan 2022 14:31:22 +0000 (14:31 +0000)
committerNick Clifton <nickc@redhat.com>
Sat, 22 Jan 2022 14:31:22 +0000 (14:31 +0000)
binutils/ChangeLog
binutils/dlltool.c

index d8f370dfd65e881bf751f7162d7bf887125ce0aa..09f392091e82c809e68bd258a07a29f5d2ef87ef 100644 (file)
@@ -1,3 +1,8 @@
+2022-01-22  Martin Storsjö  <martin@martin.st>
+
+       * dlltool.c (main): Allow inferring tmp_prefix from the dll name
+       from a def file.
+
 2022-01-22  Nick Clifton  <nickc@redhat.com>
 
        * configure: Regenerate.
index a1e2b484328ad69e302e55947e6cb45c896649ce..d95bf3f5470b999fa3b30bc887791859f48d81d1 100644 (file)
@@ -3930,23 +3930,6 @@ main (int ac, char **av)
        }
     }
 
-  if (tmp_prefix == NULL)
-    {
-      /* If possible use a deterministic prefix.  */
-      if (dll_name)
-        {
-          tmp_prefix = xmalloc (strlen (dll_name) + 2);
-          sprintf (tmp_prefix, "%s_", dll_name);
-          for (i = 0; tmp_prefix[i]; i++)
-            if (!ISALNUM (tmp_prefix[i]))
-              tmp_prefix[i] = '_';
-        }
-      else
-        {
-          tmp_prefix = prefix_encode ("d", getpid ());
-        }
-    }
-
   for (i = 0; mtable[i].type; i++)
     if (strcmp (mtable[i].type, mname) == 0)
       break;
@@ -4006,6 +3989,23 @@ main (int ac, char **av)
       optind++;
     }
 
+  if (tmp_prefix == NULL)
+    {
+      /* If possible use a deterministic prefix.  */
+      if (dll_name)
+        {
+          tmp_prefix = xmalloc (strlen (dll_name) + 2);
+          sprintf (tmp_prefix, "%s_", dll_name);
+          for (i = 0; tmp_prefix[i]; i++)
+            if (!ISALNUM (tmp_prefix[i]))
+              tmp_prefix[i] = '_';
+        }
+      else
+        {
+          tmp_prefix = prefix_encode ("d", getpid ());
+        }
+    }
+
   mangle_defs ();
 
   if (exp_name)