]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
dlltool: Use the output name as basis for deterministic temp prefixes
authorNick Clifton <nickc@redhat.com>
Wed, 23 Mar 2022 11:39:49 +0000 (11:39 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 23 Mar 2022 11:39:49 +0000 (11:39 +0000)
PR 28885
* dlltool.c (main): use imp_name rather than dll_name when
generating a temporary file name.

binutils/ChangeLog
binutils/dlltool.c

index b8dcda6fd846856de984bae5f7a182aae0356593..9b6bac7accb10617330b0c0210921de1777fcafb 100644 (file)
@@ -1,3 +1,12 @@
+2022-03-23  Nick Clifton  <nickc@redhat.com>
+
+       Import patch from mainline:
+       2022-03-16  Martin Storsjö  <martin@martin.st>
+
+       PR 28885
+       * dlltool.c (main): use imp_name rather than dll_name when
+       generating a temporary file name.
+
 2022-03-16  Nick Clifton  <nickc@redhat.com>
 
        * po/sr.po: Updated Serbian translation.
index d95bf3f5470b999fa3b30bc887791859f48d81d1..89871510b459a78ba1076368e3752c677f8daaf6 100644 (file)
@@ -3992,10 +3992,11 @@ main (int ac, char **av)
   if (tmp_prefix == NULL)
     {
       /* If possible use a deterministic prefix.  */
-      if (dll_name)
+      if (imp_name || delayimp_name)
         {
-          tmp_prefix = xmalloc (strlen (dll_name) + 2);
-          sprintf (tmp_prefix, "%s_", dll_name);
+          const char *input = imp_name ? imp_name : delayimp_name;
+          tmp_prefix = xmalloc (strlen (input) + 2);
+          sprintf (tmp_prefix, "%s_", input);
           for (i = 0; tmp_prefix[i]; i++)
             if (!ISALNUM (tmp_prefix[i]))
               tmp_prefix[i] = '_';