* deffilep.y (def_image_name): If LIBRARY or NAME statement

specifies an empty string, retain the name specified on command
	line.
	* ld.texinfo: Document above
This commit is contained in:
Danny Smith 2006-04-01 04:51:23 +00:00
parent 61353e4284
commit a287798505
3 changed files with 32 additions and 16 deletions

View File

@ -1,3 +1,10 @@
2006-04-01 Danny Smith <dannysmith@users.sourceforge.net>
* deffilep.y (def_image_name): If LIBRARY or NAME statement
specifies an empty string, retain the name specified on command
line.
* ld.texinfo: Document above.
2006-03-31 Jakub Jelinek <jakub@redhat.com> 2006-03-31 Jakub Jelinek <jakub@redhat.com>
* ldmisc.c (vfinfo): Revert 2005-10-05 changes. If * ldmisc.c (vfinfo): Revert 2005-10-05 changes. If

View File

@ -648,22 +648,30 @@ def_file_add_directive (def_file *my_def, const char *param, int len)
static void static void
def_image_name (const char *name, int base, int is_dll) def_image_name (const char *name, int base, int is_dll)
{ {
const char* image_name = lbasename (name); /* If a LIBRARY or NAME statement is specified without a name, there is nothing
if (image_name != name) to do here. We retain the output filename specified on command line. */
einfo ("%s:%d: Warning: path components stripped from %s, '%s'\n", if (*name)
def_filename, linenumber, is_dll ? "LIBRARY" : "NAME", name); {
if (def->name) const char* image_name = lbasename (name);
free (def->name); if (image_name != name)
/* Append the default suffix, if none specified. */ einfo ("%s:%d: Warning: path components stripped from %s, '%s'\n",
if (strchr (image_name, '.') == 0) def_filename, linenumber, is_dll ? "LIBRARY" : "NAME",
{ name);
const char * suffix = is_dll ? ".dll" : ".exe"; if (def->name)
free (def->name);
/* Append the default suffix, if none specified. */
if (strchr (image_name, '.') == 0)
{
const char * suffix = is_dll ? ".dll" : ".exe";
def->name = xmalloc (strlen (image_name) + strlen (suffix) + 1); def->name = xmalloc (strlen (image_name) + strlen (suffix) + 1);
sprintf (def->name, "%s%s", image_name, suffix); sprintf (def->name, "%s%s", image_name, suffix);
} }
else else
def->name = xstrdup (image_name); def->name = xstrdup (image_name);
}
/* Honor a BASE address statement, even if LIBRARY string is empty. */
def->base_address = base; def->base_address = base;
def->is_dll = is_dll; def->is_dll = is_dll;
} }

View File

@ -5618,7 +5618,8 @@ specification @code{BASE = <number>} may be used to specify a
non-default base address for the image. non-default base address for the image.
If neither @code{LIBRARY <name>} nor @code{NAME <name>} is specified, If neither @code{LIBRARY <name>} nor @code{NAME <name>} is specified,
the internal name is the same as the filename specified on the command line. or they specify an empty string, the internal name is the same as the
filename specified on the command line.
The complete specification of an export symbol is: The complete specification of an export symbol is: