aboutsummaryrefslogtreecommitdiff
path: root/ld/deffilep.y
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2005-01-16 09:18:35 +0000
committerDanny Smith <dannysmith@users.sourceforge.net>2005-01-16 09:18:35 +0000
commita880c7485ce602503bce7b5b9cd5970ad52e5725 (patch)
tree9ffce9cb68d73449120248abd0afe5aa56b35b80 /ld/deffilep.y
parentaf42176667d4e71bc97afd5406384f0dce191c9a (diff)
downloadgdb-a880c7485ce602503bce7b5b9cd5970ad52e5725.zip
gdb-a880c7485ce602503bce7b5b9cd5970ad52e5725.tar.gz
gdb-a880c7485ce602503bce7b5b9cd5970ad52e5725.tar.bz2
* defilep.y (def_name, def_library): Combine into...
(def_image_name): New function. Strip name to basename, with warning.
Diffstat (limited to 'ld/deffilep.y')
-rw-r--r--ld/deffilep.y27
1 files changed, 10 insertions, 17 deletions
diff --git a/ld/deffilep.y b/ld/deffilep.y
index 80cf548..5dc26c6 100644
--- a/ld/deffilep.y
+++ b/ld/deffilep.y
@@ -83,8 +83,7 @@ static void def_exports (const char *, const char *, int, int);
static void def_heapsize (int, int);
static void def_import (const char *, const char *, const char *, const char *,
int);
-static void def_library (const char *, int);
-static void def_name (const char *, int);
+static void def_image_name (const char *, int, int);
static void def_section (const char *, int);
static void def_section_alt (const char *, const char *);
static void def_stacksize (int, int);
@@ -122,8 +121,8 @@ start: start command
;
command:
- NAME opt_name opt_base { def_name ($2, $3); }
- | LIBRARY opt_name opt_base { def_library ($2, $3); }
+ NAME opt_name opt_base { def_image_name ($2, $3, 0); }
+ | LIBRARY opt_name opt_base { def_image_name ($2, $3, 1); }
| DESCRIPTION ID { def_description ($2);}
| STACKSIZE NUMBER opt_number { def_stacksize ($2, $3);}
| HEAPSIZE NUMBER opt_number { def_heapsize ($2, $3);}
@@ -647,23 +646,17 @@ def_file_add_directive (def_file *my_def, const char *param, int len)
/* Parser Callbacks. */
static void
-def_name (const char *name, int base)
+def_image_name (const char *name, int base, int is_dll)
{
+ const char* image_name = lbasename (name);
+ if (image_name != name)
+ einfo ("%s:%d: Warning: path components stripped from %s, '%s'\n",
+ def_filename, linenumber, is_dll ? "LIBRARY" : "NAME", name);
if (def->name)
free (def->name);
- def->name = xstrdup (name);
+ def->name = xstrdup (image_name);
def->base_address = base;
- def->is_dll = 0;
-}
-
-static void
-def_library (const char *name, int base)
-{
- if (def->name)
- free (def->name);
- def->name = xstrdup (name);
- def->base_address = base;
- def->is_dll = 1;
+ def->is_dll = is_dll;
}
static void