diff options
Diffstat (limited to 'binutils/dlltool.c')
-rw-r--r-- | binutils/dlltool.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/binutils/dlltool.c b/binutils/dlltool.c index 8c72647..80aac99 100644 --- a/binutils/dlltool.c +++ b/binutils/dlltool.c @@ -399,6 +399,7 @@ typedef struct identify_data_t static char *head_label; static char *imp_name_lab; static char *dll_name; +static int dll_name_set_by_exp_name; static int add_indirect = 0; static int add_underscore = 0; static int add_stdcall_underscore = 0; @@ -1089,6 +1090,11 @@ def_name (const char *name, int base) if (d_is_dll) non_fatal (_("Can't have LIBRARY and NAME")); + if (dll_name_set_by_exp_name && name && *name != 0) + { + dll_name = NULL; + dll_name_set_by_exp_name = 0; + } /* If --dllname not provided, use the one in the DEF file. FIXME: Is this appropriate for executables? */ if (!dll_name) @@ -1105,6 +1111,12 @@ def_library (const char *name, int base) if (d_is_exe) non_fatal (_("Can't have LIBRARY and NAME")); + if (dll_name_set_by_exp_name && name && *name != 0) + { + dll_name = NULL; + dll_name_set_by_exp_name = 0; + } + /* If --dllname not provided, use the one in the DEF file. */ if (!dll_name) set_dll_name_from_def (name, 1); @@ -4177,6 +4189,7 @@ main (int ac, char **av) dll_name = xmalloc (len); strcpy (dll_name, exp_basename); strcat (dll_name, ".dll"); + dll_name_set_by_exp_name = 1; } if (as_name == NULL) |