static iheadtype *import_list = NULL;
static char *as_name = NULL;
static char * as_flags = "";
-static char *tmp_prefix;
+static char *tmp_prefix = NULL;
static int no_idata4;
static int no_idata5;
static char *exp_name;
}
}
- if (!tmp_prefix)
- tmp_prefix = prefix_encode ("d", getpid ());
+ 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)
{ STRING_COMMA_LEN ("libgcj") },
{ STRING_COMMA_LEN ("libmsvcrt") },
{ STRING_COMMA_LEN ("libmsvcrt-os") },
+ { STRING_COMMA_LEN ("libucrt") },
{ STRING_COMMA_LEN ("libucrtbase") },
{ NULL, 0 }
};
static int tmp_seq;
static const char *dll_filename;
static char *dll_symname;
+static int dll_symname_len;
#define UNDSEC bfd_und_section_ptr
char *oname;
bfd *abfd;
- oname = xmalloc (20);
- sprintf (oname, "d%06d.o", tmp_seq);
+ oname = xmalloc (20 + dll_symname_len);
+ sprintf (oname, "%s_d%06d.o", dll_symname, tmp_seq);
tmp_seq++;
abfd = bfd_create (oname, parent);
char *oname;
bfd *abfd;
- oname = xmalloc (20);
- sprintf (oname, "d%06d.o", tmp_seq);
+ oname = xmalloc (20 + dll_symname_len);
+ sprintf (oname, "%s_d%06d.o", dll_symname, tmp_seq);
tmp_seq++;
abfd = bfd_create (oname, parent);
}
}
- oname = xmalloc (20);
- sprintf (oname, "d%06d.o", tmp_seq);
+ oname = xmalloc (20 + dll_symname_len);
+ sprintf (oname, "%s_d%06d.o", dll_symname, tmp_seq);
tmp_seq++;
abfd = bfd_create (oname, parent);
char *oname;
bfd *abfd;
- oname = xmalloc (20);
- sprintf (oname, "nmth%06d.o", tmp_seq);
+ oname = xmalloc (20 + dll_symname_len);
+ sprintf (oname, "%s_nmth%06d.o", dll_symname, tmp_seq);
tmp_seq++;
abfd = bfd_create (oname, parent);
char *oname;
bfd *abfd;
- oname = xmalloc (20);
- sprintf (oname, "fu%06d.o", tmp_seq);
+ oname = xmalloc (20 + dll_symname_len);
+ sprintf (oname, "%s_fu%06d.o", dll_symname, tmp_seq);
tmp_seq++;
abfd = bfd_create (oname, parent);
bfd *abfd;
bfd_size_type size;
- oname = xmalloc (20);
- sprintf (oname, "rtr%06d.o", tmp_seq);
+ oname = xmalloc (20 + dll_symname_len);
+ sprintf (oname, "%s_rtr%06d.o", dll_symname, tmp_seq);
tmp_seq++;
abfd = bfd_create (oname, parent);
char *oname;
bfd *abfd;
- oname = xmalloc (20);
- sprintf (oname, "ertr%06d.o", tmp_seq);
+ oname = xmalloc (20 + dll_symname_len);
+ sprintf (oname, "%s_ertr%06d.o", dll_symname, tmp_seq);
tmp_seq++;
abfd = bfd_create (oname, parent);
dll_filename = (def->name) ? def->name : dll_name;
dll_symname = xstrdup (dll_filename);
+ dll_symname_len = strlen (dll_symname);
for (i = 0; dll_symname[i]; i++)
if (!ISALNUM (dll_symname[i]))
dll_symname[i] = '_';
dll_filename = module->name;
dll_symname = xstrdup (module->name);
+ dll_symname_len = strlen (dll_symname);
for (j = 0; dll_symname[j]; j++)
if (!ISALNUM (dll_symname[j]))
dll_symname[j] = '_';