aboutsummaryrefslogtreecommitdiff
path: root/ld/deffilep.y
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2006-02-01 21:28:29 +0000
committerDanny Smith <dannysmith@users.sourceforge.net>2006-02-01 21:28:29 +0000
commit6b31ad165d5b94d0a207bc2eab1855599a81033b (patch)
tree9de036d784734513fec2056aeadb908486761f01 /ld/deffilep.y
parentf524510a162cee710564bda63698c2e6b6307554 (diff)
downloadgdb-6b31ad165d5b94d0a207bc2eab1855599a81033b.zip
gdb-6b31ad165d5b94d0a207bc2eab1855599a81033b.tar.gz
gdb-6b31ad165d5b94d0a207bc2eab1855599a81033b.tar.bz2
* deffilep.y (def_image_name): If the image name does not have
a suffix, append the default. * ld.texinfo: Document NAME, LIBRARY usage in PE-COFF .def files.
Diffstat (limited to 'ld/deffilep.y')
-rw-r--r--ld/deffilep.y11
1 files changed, 10 insertions, 1 deletions
diff --git a/ld/deffilep.y b/ld/deffilep.y
index d349537..78da27a 100644
--- a/ld/deffilep.y
+++ b/ld/deffilep.y
@@ -654,7 +654,16 @@ def_image_name (const char *name, int base, int is_dll)
def_filename, linenumber, is_dll ? "LIBRARY" : "NAME", name);
if (def->name)
free (def->name);
- def->name = xstrdup (image_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);
+ sprintf (def->name, "%s%s", image_name, suffix);
+ }
+ else
+ def->name = xstrdup (image_name);
def->base_address = base;
def->is_dll = is_dll;
}