dlltool: Use the output name as basis for deterministic temp prefixes

PR 28885
	* dlltool.c (main): use imp_name rather than dll_name when
	generating a temporary file name.
This commit is contained in:
Martin Storsj? 2022-03-16 15:01:30 +00:00 committed by Nick Clifton
parent a2757c4ed6
commit d65c0ddddd
2 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,9 @@
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 Simon Marchi <simon.marchi@efficios.com>
* readelf.c (dump_relocations): Handle EM_AMDGPU.

View 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] = '_';