archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / mingw-w64-binutils / repos / community-x86_64 / 99852365513266afdd793289813e8e565186c9e6.patch
blob485c19322017d600dfbd068bdea177876fc93ef4
1 From 99852365513266afdd793289813e8e565186c9e6 Mon Sep 17 00:00:00 2001
2 From: Nick Clifton <nickc@redhat.com>
3 Date: Wed, 23 Mar 2022 11:39:49 +0000
4 Subject: [PATCH] dlltool: Use the output name as basis for deterministic temp
5 prefixes
7 PR 28885
8 * dlltool.c (main): use imp_name rather than dll_name when
9 generating a temporary file name.
10 ---
11 binutils/ChangeLog | 9 +++++++++
12 binutils/dlltool.c | 7 ++++---
13 2 files changed, 13 insertions(+), 3 deletions(-)
15 diff --git a/binutils/dlltool.c b/binutils/dlltool.c
16 index d95bf3f5470..89871510b45 100644
17 --- a/binutils/dlltool.c
18 +++ b/binutils/dlltool.c
19 @@ -3992,10 +3992,11 @@ main (int ac, char **av)
20 if (tmp_prefix == NULL)
22 /* If possible use a deterministic prefix. */
23 - if (dll_name)
24 + if (imp_name || delayimp_name)
26 - tmp_prefix = xmalloc (strlen (dll_name) + 2);
27 - sprintf (tmp_prefix, "%s_", dll_name);
28 + const char *input = imp_name ? imp_name : delayimp_name;
29 + tmp_prefix = xmalloc (strlen (input) + 2);
30 + sprintf (tmp_prefix, "%s_", input);
31 for (i = 0; tmp_prefix[i]; i++)
32 if (!ISALNUM (tmp_prefix[i]))
33 tmp_prefix[i] = '_';
34 --
35 2.31.1